Ignore:
Timestamp:
Feb 11, 2010, 11:19:06 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.1 sources.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/demos/qtdemo/mainwindow.cpp

    r2 r561  
    22**
    33** 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])
    56**
    67** This file is part of the demonstration applications of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you
     37** @nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    6464    this->useTimer = false;
    6565    this->updateTimer.setSingleShot(true);
    66     this->trolltechLogo = 0;
     66    this->Logo = 0;
    6767    this->qtLogo = 0;
    6868    this->setupWidget();
     
    7474MainWindow::~MainWindow()
    7575{
    76     delete this->trolltechLogo;
     76    delete this->Logo;
    7777    delete this->qtLogo;
    7878}
     
    101101    QWidget *viewport = 0;
    102102
    103     if (Colors::direct3dRendering){
    104         viewport->setAttribute(Qt::WA_MSWindowsUseDirect3D);
    105         setCacheMode(QGraphicsView::CacheNone);
    106         if (Colors::verbose)
    107             qDebug() << "- using Direct3D";
    108     }
    109103#ifndef QT_NO_OPENGL
    110     else if (Colors::openGlRendering){
     104    {
    111105        QGLWidget *glw = new QGLWidget(QGLFormat(QGL::SampleBuffers));
    112106        if (Colors::noScreenSync)
     
    117111        if (Colors::verbose)
    118112            qDebug() << "- using OpenGL";
    119     }
     113    }
    120114#endif
    121     else{ // software rendering
     115    {
     116        // software rendering
    122117        viewport = new QWidget;
    123118        setCacheMode(QGraphicsView::CacheBackground);
     
    264259
    265260    this->viewport()->update();
    266     if (Colors::softwareRendering)
    267         QApplication::syncX();
    268 
    269261    if (this->useTimer)
    270262        this->updateTimer.start(int(1000 / Colors::fps));
     
    279271    }
    280272
    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);
    282274    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);
    284276    this->qtLogo->setZValue(100);
    285277    this->pausedLabel = new DemoTextItem(QString("PAUSED"), Colors::buttonFont(), Qt::white, -1, this->scene, 0);
     
    390382            if (Colors::openGlRendering)
    391383                s += "OpenGL";
    392             else if (Colors::direct3dRendering)
    393                 s += "Direct3D";
    394384            else
    395385                s += "software";
     
    467457    DemoItem::setMatrix(this->matrix());
    468458
    469     if (this->trolltechLogo){
     459    if (this->Logo){
    470460        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());
    473463        QRectF qtb = this->qtLogo->boundingRect();
    474464        this->qtLogo->setPos(802 - qtb.width(), 0);
Note: See TracChangeset for help on using the changeset viewer.