mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-19 17:02:15 -07:00
Clear timer on updateDisplay.
This commit is contained in:
parent
929789bcf9
commit
facb9a030f
2 changed files with 5 additions and 1 deletions
|
|
@ -26,6 +26,7 @@ PrintingSelector::PrintingSelector(QWidget *parent,
|
|||
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||
layout = new QVBoxLayout();
|
||||
setLayout(layout);
|
||||
timer = new QTimer(this);
|
||||
|
||||
sortToolBar = new QHBoxLayout(this);
|
||||
|
||||
|
|
@ -103,6 +104,8 @@ void PrintingSelector::updateSortOrder()
|
|||
|
||||
void PrintingSelector::updateDisplay()
|
||||
{
|
||||
timer->stop();
|
||||
timer = new QTimer(this);
|
||||
flowWidget->clearLayout();
|
||||
if (selectedCard != nullptr) {
|
||||
setWindowTitle(selectedCard->getName());
|
||||
|
|
@ -301,7 +304,7 @@ void PrintingSelector::getAllSetsForCurrentCard()
|
|||
|
||||
// Defer widget creation
|
||||
currentIndex = 0;
|
||||
QTimer *timer = new QTimer(this);
|
||||
|
||||
connect(timer, &QTimer::timeout, this, [=]() mutable {
|
||||
for (int i = 0; i < BATCH_SIZE && currentIndex < prependedSets.size(); ++i, ++currentIndex) {
|
||||
auto *cardDisplayWidget =
|
||||
|
|
|
|||
|
|
@ -63,6 +63,7 @@ private:
|
|||
QTreeView *deckView;
|
||||
CardInfoPtr selectedCard;
|
||||
QString currentZone;
|
||||
QTimer *timer;
|
||||
int currentIndex = 0;
|
||||
void selectCard(int changeBy);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue