diff options
author | Jarek Kobus <jkobus@trolltech.com> | 2009-06-10 10:48:27 (GMT) |
---|---|---|
committer | Jarek Kobus <jkobus@trolltech.com> | 2009-06-10 10:48:27 (GMT) |
commit | f7abcf91ab997dc92518fbc324363e4a936a8c2d (patch) | |
tree | a5b66353b5e098a711469e55b146ad87afda2c8b | |
parent | e6652650fe1de6421b48fab076c5e80c0deddbd8 (diff) | |
parent | 5c7042862c74dd3a5666bb266eaed922407e9711 (diff) | |
download | Qt-f7abcf91ab997dc92518fbc324363e4a936a8c2d.zip Qt-f7abcf91ab997dc92518fbc324363e4a936a8c2d.tar.gz Qt-f7abcf91ab997dc92518fbc324363e4a936a8c2d.tar.bz2 |
Merge branch '4.5' of git@scm.dev.nokia.troll.no:qt/qt into 4.5
-rw-r--r-- | demos/boxes/glshaders.cpp | 20 | ||||
-rw-r--r-- | demos/browser/browser.pro | 2 | ||||
-rw-r--r-- | demos/qtdemo/mainwindow.cpp | 10 | ||||
-rw-r--r-- | demos/qtdemo/qtdemo.pro | 4 | ||||
-rw-r--r-- | demos/spreadsheet/spreadsheet.pro | 2 | ||||
-rw-r--r-- | src/3rdparty/phonon/qt7/quicktimevideoplayer.mm | 3 | ||||
-rw-r--r-- | src/gui/image/qimage.cpp | 5 | ||||
-rw-r--r-- | src/gui/painting/qpaintengine_x11_p.h | 1 | ||||
-rw-r--r-- | src/gui/styles/qcommonstyle.cpp | 2 | ||||
-rw-r--r-- | src/network/ssl/qsslsocket.cpp | 2 | ||||
-rw-r--r-- | tests/arthur/common/common.pri | 2 | ||||
-rw-r--r-- | tests/arthur/datagenerator/datagenerator.pro | 4 | ||||
-rw-r--r-- | tests/arthur/htmlgenerator/htmlgenerator.pro | 4 | ||||
-rw-r--r-- | tests/arthur/performancediff/performancediff.pro | 4 | ||||
-rw-r--r-- | tests/arthur/shower/shower.pro | 4 | ||||
-rw-r--r-- | tests/auto/qitemdelegate/tst_qitemdelegate.cpp | 28 |
16 files changed, 60 insertions, 37 deletions
diff --git a/demos/boxes/glshaders.cpp b/demos/boxes/glshaders.cpp index b6999a8..05bbf71 100644 --- a/demos/boxes/glshaders.cpp +++ b/demos/boxes/glshaders.cpp @@ -58,7 +58,7 @@ GLShader::GLShader(const char *data, int size, GLenum shaderType) m_shader = glCreateShaderObjectARB(shaderType); GLint glSize = size; - glShaderSourceARB(m_shader, 1, &data, &glSize); + glShaderSourceARB(m_shader, 1, static_cast<const GLcharARB**>(&data), &glSize); glCompileShaderARB(m_shader); int status; glGetObjectParameterivARB(m_shader, GL_OBJECT_COMPILE_STATUS_ARB, &status); @@ -79,7 +79,7 @@ GLShader::GLShader(const QString& fileName, GLenum shaderType) GLint size = file.size(); const char *p = bytes.data(); file.close(); - glShaderSourceARB(m_shader, 1, &p, &size); + glShaderSourceARB(m_shader, 1, static_cast<const GLcharARB**>(&p), &size); glCompileShaderARB(m_shader); int status; glGetObjectParameterivARB(m_shader, GL_OBJECT_COMPILE_STATUS_ARB, &status); @@ -105,7 +105,7 @@ QString GLShader::log() glGetObjectParameterivARB(m_shader, GL_OBJECT_INFO_LOG_LENGTH_ARB, &length); char *log = new char[length + 1]; GLsizei glLength = length; - glGetInfoLogARB(m_shader, glLength, &glLength, log); + glGetInfoLogARB(m_shader, glLength, &glLength, static_cast<GLcharARB*>(log)); log[glLength] = '\0'; QString result(log); delete log; @@ -184,7 +184,7 @@ QString GLProgram::log() glGetObjectParameterivARB(m_program, GL_OBJECT_INFO_LOG_LENGTH_ARB, &length); char *log = new char[length + 1]; GLsizei glLength = length; - glGetInfoLogARB(m_program, glLength, &glLength, log); + glGetInfoLogARB(m_program, glLength, &glLength, static_cast<GLcharARB*>(log)); log[glLength] = '\0'; QString result(log); delete log; @@ -212,7 +212,7 @@ bool GLProgram::hasParameter(const QString& name) if (!failed()) { QByteArray asciiName = name.toAscii(); - return -1 != glGetUniformLocationARB(m_program, asciiName.data()); + return -1 != glGetUniformLocationARB(m_program, static_cast<const GLcharARB*>(asciiName.data())); } return false; } @@ -223,7 +223,7 @@ void GLProgram::setInt(const QString& name, int value) if (!failed()) { QByteArray asciiName = name.toAscii(); - int loc = glGetUniformLocationARB(m_program, asciiName.data()); + int loc = glGetUniformLocationARB(m_program, static_cast<const GLcharARB*>(asciiName.data())); glUniform1iARB(loc, value); } } @@ -234,7 +234,7 @@ void GLProgram::setFloat(const QString& name, float value) if (!failed()) { QByteArray asciiName = name.toAscii(); - int loc = glGetUniformLocationARB(m_program, asciiName.data()); + int loc = glGetUniformLocationARB(m_program, static_cast<const GLcharARB*>(asciiName.data())); glUniform1fARB(loc, value); } } @@ -246,7 +246,7 @@ void GLProgram::setColor(const QString& name, QRgb value) //qDebug() << "Setting color" << name; if (!failed()) { QByteArray asciiName = name.toAscii(); - int loc = glGetUniformLocationARB(m_program, asciiName.data()); + int loc = glGetUniformLocationARB(m_program, static_cast<const GLcharARB*>(asciiName.data())); //qDebug() << "Location of" << name << "is" << loc; QColor color(value); glUniform4fARB(loc, color.redF(), color.greenF(), color.blueF(), color.alphaF()); @@ -259,8 +259,8 @@ void GLProgram::setMatrix(const QString& name, const gfx::Matrix4x4f &mat) if (!failed()) { QByteArray asciiName = name.toAscii(); - int loc = glGetUniformLocationARB(m_program, asciiName.data()); + int loc = glGetUniformLocationARB(m_program, static_cast<const GLcharARB*>(asciiName.data())); //qDebug() << "Location of" << name << "is" << loc; glUniformMatrix4fvARB(loc, 1, GL_FALSE, mat.bits()); } -}
\ No newline at end of file +} diff --git a/demos/browser/browser.pro b/demos/browser/browser.pro index d970f99..13e8a1d 100644 --- a/demos/browser/browser.pro +++ b/demos/browser/browser.pro @@ -86,6 +86,6 @@ wince*: { # install target.path = $$[QT_INSTALL_DEMOS]/browser -sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.plist *.icns *.ico *.rc *.pro *.html *.doc images htmls +sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.plist *.icns *.ico *.rc *.pro *.html *.doc images htmls data sources.path = $$[QT_INSTALL_DEMOS]/browser INSTALLS += target sources diff --git a/demos/qtdemo/mainwindow.cpp b/demos/qtdemo/mainwindow.cpp index 16ca95f..bfffba5 100644 --- a/demos/qtdemo/mainwindow.cpp +++ b/demos/qtdemo/mainwindow.cpp @@ -190,6 +190,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)); } @@ -261,6 +262,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)); } @@ -430,7 +432,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); } @@ -443,7 +447,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 diff --git a/demos/spreadsheet/spreadsheet.pro b/demos/spreadsheet/spreadsheet.pro index b62f244..6ed0016 100644 --- a/demos/spreadsheet/spreadsheet.pro +++ b/demos/spreadsheet/spreadsheet.pro @@ -27,7 +27,7 @@ build_all:!build_pass { # install target.path = $$[QT_INSTALL_DEMOS]/spreadsheet -sources.files = $$SOURCES $$RESOURCES *.pro images +sources.files = $$SOURCES $$RESOURCES *.pro images $$HEADERS sources.path = $$[QT_INSTALL_DEMOS]/spreadsheet INSTALLS += target sources diff --git a/src/3rdparty/phonon/qt7/quicktimevideoplayer.mm b/src/3rdparty/phonon/qt7/quicktimevideoplayer.mm index 93867e2..02a594b 100644 --- a/src/3rdparty/phonon/qt7/quicktimevideoplayer.mm +++ b/src/3rdparty/phonon/qt7/quicktimevideoplayer.mm @@ -1041,7 +1041,8 @@ NSString* QuickTimeVideoPlayer::pathToCompactDisc() { PhononAutoReleasePool pool; NSArray *devices = [[NSWorkspace sharedWorkspace] mountedRemovableMedia]; - for (NSString *dev in devices) { + for (unsigned int i=0; i<[devices count]; ++i) { + NSString *dev = [devices objectAtIndex:i]; if (isCompactDisc(dev)) return [dev retain]; } diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index 70d4e2c..338ae77 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -4277,6 +4277,11 @@ QImage QImage::mirrored(bool horizontal, bool vertical) const int h = d->height; // Create result image, copy colormap QImage result(d->width, d->height, d->format); + + // check if we ran out of of memory.. + if (!result.d) + return QImage(); + result.d->colortable = d->colortable; result.d->has_alpha_clut = d->has_alpha_clut; diff --git a/src/gui/painting/qpaintengine_x11_p.h b/src/gui/painting/qpaintengine_x11_p.h index f277eeb..f3dd283 100644 --- a/src/gui/painting/qpaintengine_x11_p.h +++ b/src/gui/painting/qpaintengine_x11_p.h @@ -153,6 +153,7 @@ public: txop = QTransform::TxNone; has_clipping = false; render_hints = 0; + xform_scale = 1; #ifndef QT_NO_XRENDER tessellator = 0; #endif diff --git a/src/gui/styles/qcommonstyle.cpp b/src/gui/styles/qcommonstyle.cpp index f3d1537..9a4fc0f 100644 --- a/src/gui/styles/qcommonstyle.cpp +++ b/src/gui/styles/qcommonstyle.cpp @@ -848,7 +848,7 @@ void QCommonStylePrivate::lookupIconTheme() const dataDirs = QLatin1String("/usr/local/share/:/usr/share/"); dataDirs += QLatin1Char(':') + QApplicationPrivate::kdeHome() + QLatin1String("/share"); dataDirs.prepend(QDir::homePath() + QLatin1String("/:")); - QStringList kdeDirs = QString::fromLocal8Bit(getenv("KDEDIRS")).split(QLatin1Char(':')); + QStringList kdeDirs = QString::fromLocal8Bit(getenv("KDEDIRS")).split(QLatin1Char(':'), QString::SkipEmptyParts); foreach (const QString &dirName, kdeDirs) dataDirs.append(QLatin1String(":") + dirName + QLatin1String("/share")); iconDirs = dataDirs.split(QLatin1Char(':')); diff --git a/src/network/ssl/qsslsocket.cpp b/src/network/ssl/qsslsocket.cpp index cf2512e..18450de 100644 --- a/src/network/ssl/qsslsocket.cpp +++ b/src/network/ssl/qsslsocket.cpp @@ -1527,7 +1527,7 @@ void QSslSocket::startServerEncryption() { Q_D(QSslSocket); if (d->mode != UnencryptedMode) { - qWarning("QSslSocket::startClientEncryption: cannot start handshake on non-plain connection"); + qWarning("QSslSocket::startServerEncryption: cannot start handshake on non-plain connection"); return; } #ifdef QSSLSOCKET_DEBUG diff --git a/tests/arthur/common/common.pri b/tests/arthur/common/common.pri index 58cb636..1f84904 100644 --- a/tests/arthur/common/common.pri +++ b/tests/arthur/common/common.pri @@ -1,7 +1,7 @@ VPATH+=$$PWD INCLUDEPATH += $$PWD -contains(QT_CONFIG, opengl):DEFINES += BUILD_OPENGL +contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, opengles2):DEFINES += BUILD_OPENGL SOURCES += \ xmldata.cpp \ diff --git a/tests/arthur/datagenerator/datagenerator.pro b/tests/arthur/datagenerator/datagenerator.pro index c302969..9da6fcd 100644 --- a/tests/arthur/datagenerator/datagenerator.pro +++ b/tests/arthur/datagenerator/datagenerator.pro @@ -8,7 +8,9 @@ DEPENDPATH += . INCLUDEPATH += . DESTDIR = ../bin -QT += svg opengl xml qt3support +QT += svg xml +contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, opengles2):QT += opengl +contains(QT_CONFIG, qt3support):QT += qt3support # Input HEADERS += datagenerator.h \ diff --git a/tests/arthur/htmlgenerator/htmlgenerator.pro b/tests/arthur/htmlgenerator/htmlgenerator.pro index f74c460..4a1c8ba 100644 --- a/tests/arthur/htmlgenerator/htmlgenerator.pro +++ b/tests/arthur/htmlgenerator/htmlgenerator.pro @@ -9,7 +9,9 @@ DESTDIR = ../bin CONFIG += console -QT += svg opengl xml qt3support +QT += svg xml +contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, opengles2):QT += opengl +contains(QT_CONFIG, qt3support):QT += qt3support # Input HEADERS += htmlgenerator.h diff --git a/tests/arthur/performancediff/performancediff.pro b/tests/arthur/performancediff/performancediff.pro index 1c9b9fe..15d5ec5 100644 --- a/tests/arthur/performancediff/performancediff.pro +++ b/tests/arthur/performancediff/performancediff.pro @@ -9,7 +9,9 @@ DESTDIR = ../bin CONFIG += console -QT += xml opengl svg qt3support +QT += xml svg +contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, opengles2):QT += opengl +contains(QT_CONFIG, qt3support):QT += qt3support # Input HEADERS += performancediff.h diff --git a/tests/arthur/shower/shower.pro b/tests/arthur/shower/shower.pro index 000c6e4..c02ded0 100644 --- a/tests/arthur/shower/shower.pro +++ b/tests/arthur/shower/shower.pro @@ -7,7 +7,9 @@ DEPENDPATH += . INCLUDEPATH += . DESTDIR = ../bin -QT += xml opengl svg qt3support +QT += xml svg +contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, opengles2):QT += opengl +contains(QT_CONFIG, qt3support):QT += qt3support # Input HEADERS += shower.h diff --git a/tests/auto/qitemdelegate/tst_qitemdelegate.cpp b/tests/auto/qitemdelegate/tst_qitemdelegate.cpp index 615ac01..50e1ff0 100644 --- a/tests/auto/qitemdelegate/tst_qitemdelegate.cpp +++ b/tests/auto/qitemdelegate/tst_qitemdelegate.cpp @@ -1034,7 +1034,7 @@ void tst_QItemDelegate::editorEvent() option.rect = rect; option.state |= QStyle::State_Enabled; - const int checkMargin = qApp->style()->pixelMetric(QStyle::PM_FocusFrameHMargin, 0, 0) + 1; + const int checkMargin = qApp->style()->pixelMetric(QStyle::PM_FocusFrameHMargin, 0, 0) + 1; QPoint pos = inCheck ? qApp->style()->subElementRect(QStyle::SE_ViewItemCheckIndicator, &option, 0).center() + QPoint(checkMargin, 0) : QPoint(200,200); QEvent *event = new QMouseEvent((QEvent::Type)type, @@ -1057,7 +1057,7 @@ void tst_QItemDelegate::enterKey_data() QTest::addColumn<int>("widget"); QTest::addColumn<int>("key"); QTest::addColumn<bool>("expectedFocus"); - + QTest::newRow("lineedit enter") << 1 << int(Qt::Key_Enter) << false; QTest::newRow("textedit enter") << 2 << int(Qt::Key_Enter) << true; QTest::newRow("plaintextedit enter") << 3 << int(Qt::Key_Enter) << true; @@ -1071,17 +1071,17 @@ void tst_QItemDelegate::enterKey() QFETCH(int, widget); QFETCH(int, key); QFETCH(bool, expectedFocus); - + QStandardItemModel model; model.appendRow(new QStandardItem()); - + QListView view; view.setModel(&model); view.show(); QApplication::setActiveWindow(&view); view.setFocus(); QTest::qWait(30); - + struct TestDelegate : public QItemDelegate { int widgetType; @@ -1089,7 +1089,7 @@ void tst_QItemDelegate::enterKey() { QWidget *editor = 0; switch(widgetType) { - case 1: + case 1: editor = new QLineEdit(parent); break; case 2: @@ -1103,25 +1103,25 @@ void tst_QItemDelegate::enterKey() return editor; } } delegate; - + delegate.widgetType = widget; - + view.setItemDelegate(&delegate); QModelIndex index = model.index(0, 0); view.setCurrentIndex(index); // the editor will only selectAll on the current index view.edit(index); QTest::qWait(30); - + QList<QWidget*> lineEditors = qFindChildren<QWidget *>(view.viewport(), QString::fromLatin1("TheEditor")); QCOMPARE(lineEditors.count(), 1); - - QWidget *editor = lineEditors.at(0); + + QPointer<QWidget> editor = lineEditors.at(0); QCOMPARE(editor->hasFocus(), true); - + QTest::keyClick(editor, Qt::Key(key)); QApplication::processEvents(); - - QCOMPARE(editor->hasFocus(), expectedFocus); + + QCOMPARE(editor && editor->hasFocus(), expectedFocus); } |