demos/qtdemo/mainwindow.cpp
changeset 33 3e2da88830cd
parent 18 2f34d5167611
--- a/demos/qtdemo/mainwindow.cpp	Tue Jul 06 15:10:48 2010 +0300
+++ b/demos/qtdemo/mainwindow.cpp	Wed Aug 18 10:37:55 2010 +0300
@@ -266,12 +266,14 @@
 {
     if (Colors::showFps){
         this->fpsLabel = new DemoTextItem(QString("FPS: --"), Colors::buttonFont(), Qt::white, -1, this->scene, 0, DemoTextItem::DYNAMIC_TEXT);
-        this->fpsLabel->setZValue(100);
+        this->fpsLabel->setZValue(1000);
         this->fpsLabel->setPos(Colors::stageStartX, 600 - QFontMetricsF(Colors::buttonFont()).height() - 5);
     }
 
-    this->companyLogo = new ImageItem(QImage(":/images/trolltech-logo.png"), 1000, 1000, this->scene, 0, true, 0.5f);
-    this->qtLogo = new ImageItem(QImage(":/images/qtlogo_small.png"), 1000, 1000, this->scene, 0, true, 0.5f);
+    this->mainSceneRoot = new QGraphicsWidget();
+    this->scene->addItem(mainSceneRoot);
+    this->companyLogo = new ImageItem(QImage(":/images/trolltech-logo.png"), 1000, 1000, this->scene, mainSceneRoot, true, 0.5f);
+    this->qtLogo = new ImageItem(QImage(":/images/qtlogo_small.png"), 1000, 1000, this->scene, mainSceneRoot, true, 0.5f);
     this->companyLogo->setZValue(100);
     this->qtLogo->setZValue(100);
     this->pausedLabel = new DemoTextItem(QString("PAUSED"), Colors::buttonFont(), Qt::white, -1, this->scene, 0);
@@ -376,7 +378,7 @@
         this->loop = false;
         QApplication::quit();
     }
-    else if (event->key() == Qt::Key_1){
+    else if (event->key() == Qt::Key_F1){
             QString s("");
             s += "Rendering system: ";
             if (Colors::openGlRendering)
@@ -415,6 +417,7 @@
             s += Colors::noScreenSync ? "no" : "yes";
             QMessageBox::information(0, QString("Current configuration"), s);
     }
+    QGraphicsView::keyPressEvent(event);
 }
 
 void MainWindow::focusInEvent(QFocusEvent *)