Update PrintingSelector properly on DeckListModel::dataChanged

This commit is contained in:
Lukas Brübach 2024-11-27 23:53:37 +01:00 committed by ZeldaZach
parent 279aa8c836
commit 3195a5ab68
No known key found for this signature in database

View file

@ -89,6 +89,11 @@ PrintingSelector::PrintingSelector(QWidget *parent,
cardSelectionBarLayout->addWidget(nextCardButton);
layout->addWidget(cardSelectionBar);
connect(deckModel, &DeckListModel::dataChanged, this, [this]() {
// We have to delay this or else we hit a race condition where the data isn't actually updated yet.
QTimer::singleShot(100, this, &PrintingSelector::updateDisplay);
});
}
void PrintingSelector::updateSortOrder()