summaryrefslogtreecommitdiffstats
path: root/demos/qtdemo
diff options
context:
space:
mode:
authorBjørn Erik Nilsen <bjorn.nilsen@nokia.com>2009-06-12 12:35:46 (GMT)
committerBjørn Erik Nilsen <bjorn.nilsen@nokia.com>2009-06-12 12:35:46 (GMT)
commitc53414e11b3f980f81a4470b3fb52f9d1aa80d56 (patch)
tree7d51540148af638b1c4fb7cda939d34739245457 /demos/qtdemo
parentf2b93868f48a3e2d6e462ca8a051ab47eefef49d (diff)
parent304bf2ef0a99882d2d969347f85a330523086fb3 (diff)
downloadQt-c53414e11b3f980f81a4470b3fb52f9d1aa80d56.zip
Qt-c53414e11b3f980f81a4470b3fb52f9d1aa80d56.tar.gz
Qt-c53414e11b3f980f81a4470b3fb52f9d1aa80d56.tar.bz2
Merge commit 'origin/4.5'
Conflicts: demos/boxes/glshaders.cpp src/gui/graphicsview/qgraphicsitem.cpp tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp tools/linguist/shared/cpp.cpp translations/linguist_ja.qm translations/qt_ru.qm
Diffstat (limited to 'demos/qtdemo')
-rw-r--r--demos/qtdemo/colors.cpp2
-rw-r--r--demos/qtdemo/mainwindow.cpp10
-rw-r--r--demos/qtdemo/qtdemo.pro4
3 files changed, 12 insertions, 4 deletions
diff --git a/demos/qtdemo/colors.cpp b/demos/qtdemo/colors.cpp
index b82de2f..eaef058 100644
--- a/demos/qtdemo/colors.cpp
+++ b/demos/qtdemo/colors.cpp
@@ -328,7 +328,7 @@ void Colors::detectSystemResources()
#if defined(Q_WS_X11)
// check if X render is present:
QPixmap tmp(1, 1);
- if (!tmp.x11PictureHandle()){
+ if (!tmp.x11PictureHandle() && tmp.paintEngine()->type() == QPaintEngine::X11){
Colors::xRenderPresent = false;
if (Colors::verbose)
qDebug("- X render not present");
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);
}
diff --git a/demos/qtdemo/qtdemo.pro b/demos/qtdemo/qtdemo.pro
index 2534b75..163ed17 100644
--- a/demos/qtdemo/qtdemo.pro
+++ b/demos/qtdemo/qtdemo.pro
@@ -1,6 +1,8 @@
CONFIG += assistant help x11inc
TARGET = qtdemo
-DESTDIR = $$QT_BUILD_TREE/bin
+DEMO_DESTDIR = $$QT_BUILD_TREE
+isEmpty(DEMO_DESTDIR):DEMO_DESTDIR=../..
+DESTDIR = $$DEMO_DESTDIR/bin
OBJECTS_DIR = .obj
MOC_DIR = .moc
INSTALLS += target sources