From 3195a5ab68570494d2b5cc5958b4abaa4fbbe847 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Br=C3=BCbach?= Date: Wed, 27 Nov 2024 23:53:37 +0100 Subject: [PATCH] Update PrintingSelector properly on DeckListModel::dataChanged --- .../ui/widgets/printing_selector/printing_selector.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cockatrice/src/client/ui/widgets/printing_selector/printing_selector.cpp b/cockatrice/src/client/ui/widgets/printing_selector/printing_selector.cpp index 8353bbcd4..de0a808fb 100644 --- a/cockatrice/src/client/ui/widgets/printing_selector/printing_selector.cpp +++ b/cockatrice/src/client/ui/widgets/printing_selector/printing_selector.cpp @@ -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()