mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-22 10:22: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);
|
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||||
layout = new QVBoxLayout();
|
layout = new QVBoxLayout();
|
||||||
setLayout(layout);
|
setLayout(layout);
|
||||||
|
timer = new QTimer(this);
|
||||||
|
|
||||||
sortToolBar = new QHBoxLayout(this);
|
sortToolBar = new QHBoxLayout(this);
|
||||||
|
|
||||||
|
|
@ -103,6 +104,8 @@ void PrintingSelector::updateSortOrder()
|
||||||
|
|
||||||
void PrintingSelector::updateDisplay()
|
void PrintingSelector::updateDisplay()
|
||||||
{
|
{
|
||||||
|
timer->stop();
|
||||||
|
timer = new QTimer(this);
|
||||||
flowWidget->clearLayout();
|
flowWidget->clearLayout();
|
||||||
if (selectedCard != nullptr) {
|
if (selectedCard != nullptr) {
|
||||||
setWindowTitle(selectedCard->getName());
|
setWindowTitle(selectedCard->getName());
|
||||||
|
|
@ -301,7 +304,7 @@ void PrintingSelector::getAllSetsForCurrentCard()
|
||||||
|
|
||||||
// Defer widget creation
|
// Defer widget creation
|
||||||
currentIndex = 0;
|
currentIndex = 0;
|
||||||
QTimer *timer = new QTimer(this);
|
|
||||||
connect(timer, &QTimer::timeout, this, [=]() mutable {
|
connect(timer, &QTimer::timeout, this, [=]() mutable {
|
||||||
for (int i = 0; i < BATCH_SIZE && currentIndex < prependedSets.size(); ++i, ++currentIndex) {
|
for (int i = 0; i < BATCH_SIZE && currentIndex < prependedSets.size(); ++i, ++currentIndex) {
|
||||||
auto *cardDisplayWidget =
|
auto *cardDisplayWidget =
|
||||||
|
|
|
||||||
|
|
@ -63,6 +63,7 @@ private:
|
||||||
QTreeView *deckView;
|
QTreeView *deckView;
|
||||||
CardInfoPtr selectedCard;
|
CardInfoPtr selectedCard;
|
||||||
QString currentZone;
|
QString currentZone;
|
||||||
|
QTimer *timer;
|
||||||
int currentIndex = 0;
|
int currentIndex = 0;
|
||||||
void selectCard(int changeBy);
|
void selectCard(int changeBy);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue