mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-20 01:12:15 -07:00
Set the index correctly when removing a non-providerId printing for a providerId printing to avoid jumping to the next card.
This commit is contained in:
parent
7a136178e0
commit
059c23f8f4
1 changed files with 3 additions and 1 deletions
|
|
@ -87,12 +87,14 @@ void CardAmountWidget::updateCardCount()
|
|||
|
||||
void CardAmountWidget::addPrinting(const QString &zone)
|
||||
{
|
||||
const auto newCardIndex = deckModel->addCard(rootCard->getName(), setInfoForCard, zone);
|
||||
auto newCardIndex = deckModel->addCard(rootCard->getName(), setInfoForCard, zone);
|
||||
recursiveExpand(newCardIndex);
|
||||
QModelIndex find_card = deckModel->findCard(rootCard->getName(), zone);
|
||||
if (find_card.isValid() && find_card != newCardIndex) {
|
||||
deckModel->removeRow(find_card.row(), find_card.parent());
|
||||
};
|
||||
newCardIndex = deckModel->findCard(rootCard->getName(), zone, setInfoForCard.getProperty("uuid"));
|
||||
deckView->setCurrentIndex(newCardIndex);
|
||||
deckView->setFocus(Qt::FocusReason::MouseFocusReason);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue