Changeset 561 for trunk/demos/qtdemo/mainwindow.cpp
- Timestamp:
- Feb 11, 2010, 11:19:06 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/vendor/nokia/qt/4.6.1 merged eligible /branches/vendor/nokia/qt/current merged eligible /branches/vendor/trolltech/qt/current 3-149
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/demos/qtdemo/mainwindow.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information ([email protected]) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation ([email protected]) 5 6 ** 6 7 ** This file is part of the demonstration applications of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you 37 ** @nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 64 64 this->useTimer = false; 65 65 this->updateTimer.setSingleShot(true); 66 this-> trolltechLogo = 0;66 this->Logo = 0; 67 67 this->qtLogo = 0; 68 68 this->setupWidget(); … … 74 74 MainWindow::~MainWindow() 75 75 { 76 delete this-> trolltechLogo;76 delete this->Logo; 77 77 delete this->qtLogo; 78 78 } … … 101 101 QWidget *viewport = 0; 102 102 103 if (Colors::direct3dRendering){104 viewport->setAttribute(Qt::WA_MSWindowsUseDirect3D);105 setCacheMode(QGraphicsView::CacheNone);106 if (Colors::verbose)107 qDebug() << "- using Direct3D";108 }109 103 #ifndef QT_NO_OPENGL 110 else if (Colors::openGlRendering){104 { 111 105 QGLWidget *glw = new QGLWidget(QGLFormat(QGL::SampleBuffers)); 112 106 if (Colors::noScreenSync) … … 117 111 if (Colors::verbose) 118 112 qDebug() << "- using OpenGL"; 119 } 113 } 120 114 #endif 121 else{ // software rendering 115 { 116 // software rendering 122 117 viewport = new QWidget; 123 118 setCacheMode(QGraphicsView::CacheBackground); … … 264 259 265 260 this->viewport()->update(); 266 if (Colors::softwareRendering)267 QApplication::syncX();268 269 261 if (this->useTimer) 270 262 this->updateTimer.start(int(1000 / Colors::fps)); … … 279 271 } 280 272 281 this-> trolltechLogo = new ImageItem(QImage(":/images/trolltech-logo.png"), 1000, 1000, this->scene, 0, true, 0.5f);273 this->Logo = new ImageItem(QImage(":/images/trolltech-logo.png"), 1000, 1000, this->scene, 0, true, 0.5f); 282 274 this->qtLogo = new ImageItem(QImage(":/images/qtlogo_small.png"), 1000, 1000, this->scene, 0, true, 0.5f); 283 this-> trolltechLogo->setZValue(100);275 this->Logo->setZValue(100); 284 276 this->qtLogo->setZValue(100); 285 277 this->pausedLabel = new DemoTextItem(QString("PAUSED"), Colors::buttonFont(), Qt::white, -1, this->scene, 0); … … 390 382 if (Colors::openGlRendering) 391 383 s += "OpenGL"; 392 else if (Colors::direct3dRendering)393 s += "Direct3D";394 384 else 395 385 s += "software"; … … 467 457 DemoItem::setMatrix(this->matrix()); 468 458 469 if (this-> trolltechLogo){459 if (this->Logo){ 470 460 const QRectF r = this->scene->sceneRect(); 471 QRectF ttb = this-> trolltechLogo->boundingRect();472 this-> trolltechLogo->setPos(int((r.width() - ttb.width()) / 2), 595 - ttb.height());461 QRectF ttb = this->Logo->boundingRect(); 462 this->Logo->setPos(int((r.width() - ttb.width()) / 2), 595 - ttb.height()); 473 463 QRectF qtb = this->qtLogo->boundingRect(); 474 464 this->qtLogo->setPos(802 - qtb.width(), 0);
Note:
See TracChangeset
for help on using the changeset viewer.