diff options
Diffstat (limited to 'demos/qtdemo/mainwindow.cpp')
-rw-r--r-- | demos/qtdemo/mainwindow.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/demos/qtdemo/mainwindow.cpp b/demos/qtdemo/mainwindow.cpp index 858d389..6207607 100644 --- a/demos/qtdemo/mainwindow.cpp +++ b/demos/qtdemo/mainwindow.cpp @@ -185,6 +185,7 @@ void MainWindow::switchTimerOnOff(bool on) if (on && !Colors::noTimerUpdate){ this->useTimer = true; + this->setViewportUpdateMode(QGraphicsView::NoViewportUpdate); this->fpsTime = QTime::currentTime(); this->updateTimer.start(int(1000 / Colors::fps)); } @@ -256,6 +257,7 @@ void MainWindow::tick() if (MenuManager::instance()->ticker) MenuManager::instance()->ticker->tick(); + this->viewport()->update(); if (this->useTimer) this->updateTimer.start(int(1000 / Colors::fps)); } @@ -423,7 +425,9 @@ void MainWindow::focusInEvent(QFocusEvent *) if (MenuManager::instance()->ticker) MenuManager::instance()->ticker->pause(false); - this->switchTimerOnOff(true); + int code = MenuManager::instance()->currentMenuCode; + if (code == MenuManager::ROOT || code == MenuManager::MENU1) + this->switchTimerOnOff(true); this->pausedLabel->setRecursiveVisible(false); } @@ -436,7 +440,9 @@ void MainWindow::focusOutEvent(QFocusEvent *) if (MenuManager::instance()->ticker) MenuManager::instance()->ticker->pause(true); - this->switchTimerOnOff(false); + int code = MenuManager::instance()->currentMenuCode; + if (code == MenuManager::ROOT || code == MenuManager::MENU1) + this->switchTimerOnOff(false); this->pausedLabel->setRecursiveVisible(true); } |