From 692ca95391678b2035014026cbdd19770b53eddf Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Wed, 24 Nov 2010 12:48:36 +0100 Subject: compile with debug defined enabled --- src/gui/painting/qtextureglyphcache.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/painting/qtextureglyphcache.cpp b/src/gui/painting/qtextureglyphcache.cpp index 4a6c03f..a3e3bb4 100644 --- a/src/gui/painting/qtextureglyphcache.cpp +++ b/src/gui/painting/qtextureglyphcache.cpp @@ -440,7 +440,7 @@ void QImageTextureGlyphCache::fillTexture(const Coord &c, glyph_t g, QFixed subP QPoint base(c.x + glyphMargin(), c.y + glyphMargin() + c.baseLineY-1); if (m_image.rect().contains(base)) m_image.setPixel(base, 255); - m_image.save(QString::fromLatin1("cache-%1.png").arg(int(this))); + m_image.save(QString::fromLatin1("cache-%1.png").arg(qint64(this))); #endif } -- cgit v0.12 From 66611fb5c9641dad2c605be790028d206480ea24 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Wed, 24 Nov 2010 12:50:29 +0100 Subject: --warn --- src/opengl/qgl_p.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h index 8285f06..a603ae6 100644 --- a/src/opengl/qgl_p.h +++ b/src/opengl/qgl_p.h @@ -509,6 +509,7 @@ Q_SIGNALS: private slots: void freeTexture_slot(QGLContext *context, QPixmapData *boundPixmap, GLuint id) { + Q_UNUSED(boundPixmap); #if defined(Q_WS_X11) if (boundPixmap) { QGLContext *oldContext = const_cast(QGLContext::currentContext()); -- cgit v0.12 From 7a5b81532d482b611d5ea8b3a93e6ee9f9098db0 Mon Sep 17 00:00:00 2001 From: miniak Date: Thu, 25 Nov 2010 18:02:16 +0100 Subject: QSystemTrayIcon::messageTimeout() signal implemented Task-number: QTBUG-3870 Merge-request: 710 Reviewed-by: Olivier Goffart --- src/gui/util/qsystemtrayicon.cpp | 14 +++++- src/gui/util/qsystemtrayicon.h | 1 + src/gui/util/qsystemtrayicon_win.cpp | 4 ++ tests/auto/qsystemtrayicon/qsystemtrayicon.pro | 1 + tests/auto/qsystemtrayicon/tst_qsystemtrayicon.cpp | 56 ++++++++++++++++++++++ 5 files changed, 75 insertions(+), 1 deletion(-) diff --git a/src/gui/util/qsystemtrayicon.cpp b/src/gui/util/qsystemtrayicon.cpp index 941961b..1c95558 100644 --- a/src/gui/util/qsystemtrayicon.cpp +++ b/src/gui/util/qsystemtrayicon.cpp @@ -335,6 +335,16 @@ bool QSystemTrayIcon::event(QEvent *e) \sa activated() */ +/*! + \fn void QSystemTrayIcon::messageTimeout() + + This signal is emitted when the message displayed using showMessage() + hides automatically after being shown for the timeout value. + + Currently this signal is not sent on Mac OS X. + + \since 4.8 +*/ /*! Returns true if the system tray is available; otherwise returns false. @@ -657,8 +667,10 @@ void QBalloonTip::timerEvent(QTimerEvent *e) { if (e->timerId() == timerId) { killTimer(timerId); - if (!underMouse()) + if (!underMouse()) { close(); + emit trayIcon->messageTimeout(); + } return; } QWidget::timerEvent(e); diff --git a/src/gui/util/qsystemtrayicon.h b/src/gui/util/qsystemtrayicon.h index 0a57e35..5812d07 100644 --- a/src/gui/util/qsystemtrayicon.h +++ b/src/gui/util/qsystemtrayicon.h @@ -111,6 +111,7 @@ public Q_SLOTS: Q_SIGNALS: void activated(QSystemTrayIcon::ActivationReason reason); void messageClicked(); + void messageTimeout(); protected: bool event(QEvent *event); diff --git a/src/gui/util/qsystemtrayicon_win.cpp b/src/gui/util/qsystemtrayicon_win.cpp index fc5de44..91b11ef 100644 --- a/src/gui/util/qsystemtrayicon_win.cpp +++ b/src/gui/util/qsystemtrayicon_win.cpp @@ -313,6 +313,10 @@ bool QSystemTrayIconSys::winEvent( MSG *m, long *result ) emit q->messageClicked(); break; + case NIN_BALLOONTIMEOUT: + emit q->messageTimeout(); + break; + case WM_MBUTTONUP: emit q->activated(QSystemTrayIcon::MiddleClick); break; diff --git a/tests/auto/qsystemtrayicon/qsystemtrayicon.pro b/tests/auto/qsystemtrayicon/qsystemtrayicon.pro index a77b478..a33d072 100644 --- a/tests/auto/qsystemtrayicon/qsystemtrayicon.pro +++ b/tests/auto/qsystemtrayicon/qsystemtrayicon.pro @@ -5,5 +5,6 @@ load(qttest_p4) SOURCES += tst_qsystemtrayicon.cpp +win32:LIBS += user32.lib diff --git a/tests/auto/qsystemtrayicon/tst_qsystemtrayicon.cpp b/tests/auto/qsystemtrayicon/tst_qsystemtrayicon.cpp index b1ec0ff..f4120ca 100644 --- a/tests/auto/qsystemtrayicon/tst_qsystemtrayicon.cpp +++ b/tests/auto/qsystemtrayicon/tst_qsystemtrayicon.cpp @@ -47,6 +47,10 @@ #include #include +#ifdef Q_OS_WIN32 +#include +#endif + //TESTED_CLASS= //TESTED_FILES= @@ -64,6 +68,7 @@ private slots: void showMessage(); void supportsMessages(); void lastWindowClosed(); + void messageTimeout(); }; tst_QSystemTrayIcon::tst_QSystemTrayIcon() @@ -144,5 +149,56 @@ void tst_QSystemTrayIcon::lastWindowClosed() QVERIFY(spy.count() == 1); } +#ifndef Q_WS_MAC + +static void triggerMessageTimeout() +{ +#if defined(Q_WS_WIN) && !defined(Q_WS_WINCE) + // the application has to loose focus on Windows for the message to timeout + INPUT input[2] = {}; + + input[0].type = INPUT_KEYBOARD; + input[0].ki.wVk = VK_LWIN; + input[0].ki.dwFlags = 0; + + input[1].type = INPUT_KEYBOARD; + input[1].ki.wVk = VK_LWIN; + input[1].ki.dwFlags = KEYEVENTF_KEYUP; + + for (int i = 0; i < 2; i++) { + QTest::qWait(100); + ::SendInput(2, input, sizeof(INPUT)); + } +#endif /* defined(Q_WS_WIN) && !defined(Q_WS_WINCE) */ +} + +void tst_QSystemTrayIcon::messageTimeout() +{ + QSystemTrayIcon icon; + if (icon.supportsMessages()) { + icon.setIcon(QIcon("whatever.png")); + icon.show(); + + QObject::connect(&icon, SIGNAL(messageTimeout()), qApp, SLOT(quit())); + QSignalSpy spy(&icon, SIGNAL(messageTimeout())); + icon.showMessage("Title", "Hello World!", QSystemTrayIcon::Information, 1000); + + triggerMessageTimeout(); + + QTimer::singleShot(30000, qApp, SLOT(quit())); // in case the test fails + qApp->exec(); + QVERIFY(spy.count() == 1); + } +} + +#else + +void tst_QSystemTrayIcon::messageTimeout() +{ + // skip the test on Mac OS X +} + +#endif /* Q_WS_MAC */ + QTEST_MAIN(tst_QSystemTrayIcon) #include "tst_qsystemtrayicon.moc" -- cgit v0.12 From 2fd00b200e5e1b13effdf8773386230891127dbe Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Sun, 28 Nov 2010 21:28:01 +0100 Subject: print out which GLSL shader that failed compilation for better debugging --- src/opengl/qglshaderprogram.cpp | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/opengl/qglshaderprogram.cpp b/src/opengl/qglshaderprogram.cpp index 74382b0..1f39884 100644 --- a/src/opengl/qglshaderprogram.cpp +++ b/src/opengl/qglshaderprogram.cpp @@ -260,10 +260,27 @@ bool QGLShaderPrivate::compile(QGLShader *q) glGetShaderInfoLog(shader, value, &len, logbuf); log = QString::fromLatin1(logbuf); QString name = q->objectName(); + + char *types[] = { + "Fragment", + "Vertex", + "Geometry", + "" + }; + + char *type = types[3]; + if (shaderType == QGLShader::Fragment) + type = types[0]; + else if (shaderType == QGLShader::Vertex) + type = types[1]; + else if (shaderType == QGLShader::Geometry) + type = types[2]; + if (name.isEmpty()) - qWarning() << "QGLShader::compile:" << log; + qWarning("QGLShader::compile(%s): %s", type, qPrintable(log)); else - qWarning() << "QGLShader::compile[" << name << "]:" << log; + qWarning("QGLShader::compile(%s)[%s]: %s", type, qPrintable(name), qPrintable(log)); + delete [] logbuf; } return compiled; -- cgit v0.12