From c059c6f2add4a500121c19b0c95d0c57196285ba Mon Sep 17 00:00:00 2001 From: ck Date: Fri, 6 Nov 2009 11:49:07 +0100 Subject: Assistant: Fix bugs on cached collection file handling. 1. When the dates between the caller-supplied and the cached versions of a collection file differed, we used to overwrite the cached with the original version. This was obviously wrong - we should only overwrite when the cached version is older. 2. We also forgot to set the zoom factor when overwriting. Task-number: QTBUG-4899 Reviewed-by: kh1 --- tools/assistant/tools/assistant/main.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/assistant/tools/assistant/main.cpp b/tools/assistant/tools/assistant/main.cpp index a721880..12bc5b1 100644 --- a/tools/assistant/tools/assistant/main.cpp +++ b/tools/assistant/tools/assistant/main.cpp @@ -115,7 +115,7 @@ updateUserCollection(QHelpEngineCore& user, const QHelpEngineCore& caller) const uint userCollectionCreationTime = user. customValue(QLatin1String("CreationTime"), 1).toUInt(); - if (callerCollectionCreationTime == userCollectionCreationTime) + if (callerCollectionCreationTime <= userCollectionCreationTime) return false; user.setCustomValue(QLatin1String("CreationTime"), @@ -124,6 +124,12 @@ updateUserCollection(QHelpEngineCore& user, const QHelpEngineCore& caller) caller.customValue(QLatin1String("WindowTitle"))); user.setCustomValue(QLatin1String("LastShownPages"), caller.customValue(QLatin1String("LastShownPages"))); +#if !defined(QT_NO_WEBKIT) + const QLatin1String zoomKey("LastPagesZoomWebView"); +#else + const QLatin1String zoomKey("LastPagesZoomTextBrowser"); +#endif + user.setCustomValue(zoomKey, caller.customValue(zoomKey)); user.setCustomValue(QLatin1String("CurrentFilter"), caller.customValue(QLatin1String("CurrentFilter"))); user.setCustomValue(QLatin1String("CacheDirectory"), -- cgit v0.12 g EnableModeless(). After the above commit, no repaints will be generated by this code path, so we can remove this call. Task-number: QTBUG-8355 Reviewed-by: Bradley T. Hughes --- src/activeqt/container/qaxwidget.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/activeqt/container/qaxwidget.cpp b/src/activeqt/container/qaxwidget.cpp index 9149320..865c26c 100644 --- a/src/activeqt/container/qaxwidget.cpp +++ b/src/activeqt/container/qaxwidget.cpp @@ -1438,9 +1438,6 @@ extern Q_GUI_EXPORT bool qt_win_ignoreNextMouseReleaseEvent; HRESULT WINAPI QAxClientSite::EnableModeless(BOOL fEnable) { -#if !defined(Q_OS_WINCE) - LockWindowUpdate(host->window()->winId()); -#endif EnableWindow(host->window()->winId(), fEnable); if (!fEnable) { @@ -1451,9 +1448,6 @@ HRESULT WINAPI QAxClientSite::EnableModeless(BOOL fEnable) QApplicationPrivate::leaveModal(host); } qt_win_ignoreNextMouseReleaseEvent = false; -#if !defined(Q_OS_WINCE) - LockWindowUpdate(0); -#endif return S_OK; } -- cgit v0.12 From 7ff5a5bc4b67a807200cae3ac83884d721bad373 Mon Sep 17 00:00:00 2001 From: Tom Cooksey Date: Tue, 23 Feb 2010 17:12:30 +0100 Subject: Skip complex FBO tests if combined depth-stencil isn't supported MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-By: Trond Kjernåsen --- tests/auto/qgl/tst_qgl.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/tests/auto/qgl/tst_qgl.cpp b/tests/auto/qgl/tst_qgl.cpp index 2983af3..a0656d0 100644 --- a/tests/auto/qgl/tst_qgl.cpp +++ b/tests/auto/qgl/tst_qgl.cpp @@ -1036,6 +1036,11 @@ void tst_QGL::glFBORendering() // Don't complicate things by using NPOT: QGLFramebufferObject *fbo = new QGLFramebufferObject(256, 128, fboFormat); + if (fbo->attachment() != QGLFramebufferObject::CombinedDepthStencil) { + delete fbo; + QSKIP("FBOs missing combined depth~stencil support", SkipSingle); + } + QPainter fboPainter; bool painterBegun = fboPainter.begin(fbo); QVERIFY(painterBegun); @@ -1098,6 +1103,16 @@ void tst_QGL::multipleFBOInterleavedRendering() QGLFramebufferObject *fbo2 = new QGLFramebufferObject(256, 128, fboFormat); QGLFramebufferObject *fbo3 = new QGLFramebufferObject(256, 128, fboFormat); + if ( (fbo1->attachment() != QGLFramebufferObject::CombinedDepthStencil) || + (fbo2->attachment() != QGLFramebufferObject::CombinedDepthStencil) || + (fbo3->attachment() != QGLFramebufferObject::CombinedDepthStencil) ) + { + delete fbo1; + delete fbo2; + delete fbo3; + QSKIP("FBOs missing combined depth~stencil support", SkipSingle); + } + QPainter fbo1Painter; QPainter fbo2Painter; QPainter fbo3Painter; @@ -1203,7 +1218,7 @@ protected: QPainter widgetPainter; widgetPainterBeginOk = widgetPainter.begin(this); QGLFramebufferObjectFormat fboFormat; - fboFormat.setAttachment(QGLFramebufferObject::CombinedDepthStencil); + fboFormat.setAttachment(QGLFramebufferObject::NoAttachment); QGLFramebufferObject *fbo = new QGLFramebufferObject(128, 128, fboFormat); QPainter fboPainter; -- cgit v0.12 From c815fd0a6426e43aa9efd861888888aa4d5b233b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Fri, 26 Feb 2010 10:44:51 +0100 Subject: Fixed qgl autotest failures on Maemo. Changed glFBOSimpleRendering and glFBOUseInGLWidget auto tests to use NPOT sizes. NPOT FBOs are not twiddled, and thus not exposed to the twiddled glReadPixels() bug in the current drivers. Skipped glWidgetRenderPixmap as renderPixmap() is not supported under EGL currently. Reviewed-by: Tom Cooksey --- tests/auto/qgl/qgl.pro | 2 ++ tests/auto/qgl/tst_qgl.cpp | 11 +++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/tests/auto/qgl/qgl.pro b/tests/auto/qgl/qgl.pro index 9116f39..5f058f9 100644 --- a/tests/auto/qgl/qgl.pro +++ b/tests/auto/qgl/qgl.pro @@ -6,6 +6,8 @@ load(qttest_p4) requires(contains(QT_CONFIG,opengl)) QT += opengl +contains(QT_CONFIG,egl):DEFINES += QGL_EGL + SOURCES += tst_qgl.cpp RESOURCES = qgl.qrc diff --git a/tests/auto/qgl/tst_qgl.cpp b/tests/auto/qgl/tst_qgl.cpp index a0656d0..101e361 100644 --- a/tests/auto/qgl/tst_qgl.cpp +++ b/tests/auto/qgl/tst_qgl.cpp @@ -998,8 +998,7 @@ void tst_QGL::glFBOSimpleRendering() QGLFramebufferObjectFormat fboFormat; fboFormat.setAttachment(QGLFramebufferObject::NoAttachment); - // Don't complicate things by using NPOT: - QGLFramebufferObject *fbo = new QGLFramebufferObject(256, 128, fboFormat); + QGLFramebufferObject *fbo = new QGLFramebufferObject(200, 100, fboFormat); fbo->bind(); @@ -1219,7 +1218,7 @@ protected: widgetPainterBeginOk = widgetPainter.begin(this); QGLFramebufferObjectFormat fboFormat; fboFormat.setAttachment(QGLFramebufferObject::NoAttachment); - QGLFramebufferObject *fbo = new QGLFramebufferObject(128, 128, fboFormat); + QGLFramebufferObject *fbo = new QGLFramebufferObject(100, 100, fboFormat); QPainter fboPainter; fboPainterBeginOk = fboPainter.begin(fbo); @@ -1243,7 +1242,7 @@ void tst_QGL::glFBOUseInGLWidget() #ifdef Q_WS_QWS w.setWindowFlags(Qt::FramelessWindowHint); #endif - w.resize(128, 128); + w.resize(100, 100); w.show(); #ifdef Q_WS_X11 @@ -1355,6 +1354,10 @@ void tst_QGL::glWidgetRenderPixmap() QImage reference(fb.size(), QImage::Format_RGB32); reference.fill(0xffff0000); +#ifdef QGL_EGL + QSKIP("renderPixmap() not yet supported under EGL", SkipAll); +#endif + QFUZZY_COMPARE_IMAGES(fb, reference); } -- cgit v0.12 From 9229489304894e35e137606ea263f007e5605d22 Mon Sep 17 00:00:00 2001 From: Prasanth Ullattil Date: Fri, 26 Feb 2010 14:37:59 +0100 Subject: Fixed autotest tst_QWidget::translucentWidget() on Windows Vista & above Grabbing layered windows doesn't work on Vista and above, so instead we need to grab the corresponding area of the desktop widget. Reviewed-by: Samuel --- src/gui/image/qpixmap.cpp | 6 +++++- tests/auto/qwidget/tst_qwidget.cpp | 10 +++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp index 1df7946..08003e5 100644 --- a/src/gui/image/qpixmap.cpp +++ b/src/gui/image/qpixmap.cpp @@ -2026,12 +2026,16 @@ QPixmap QPixmap::fromImage(const QImage &image, Qt::ImageConversionFlags flags) over the one you grab, you get pixels from the overlying window, too. The mouse cursor is generally not grabbed. - Note on X11that if the given \a window doesn't have the same depth + Note on X11 that if the given \a window doesn't have the same depth as the root window, and another window partially or entirely obscures the one you grab, you will \e not get pixels from the overlying window. The contents of the obscured areas in the pixmap will be undefined and uninitialized. + On Windows Vista and above grabbing a layered window, which is + created by setting the Qt::WA_TranslucentBackground attribute, will + not work. Instead grabbing the desktop widget should work. + \warning In general, grabbing an area outside the screen is not safe. This depends on the underlying window system. diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp index b59017b..abd9604 100644 --- a/tests/auto/qwidget/tst_qwidget.cpp +++ b/tests/auto/qwidget/tst_qwidget.cpp @@ -8829,7 +8829,15 @@ void tst_QWidget::translucentWidget() #endif QTest::qWait(200); - QPixmap widgetSnapshot = QPixmap::grabWindow(label.winId()); + QPixmap widgetSnapshot; + +#ifdef Q_WS_WIN + QWidget *desktopWidget = QApplication::desktop()->screen(0); + if (QSysInfo::windowsVersion() >= QSysInfo::WV_VISTA) + widgetSnapshot = QPixmap::grabWindow(desktopWidget->winId(), 0,0, label.width(), label.height()); + else +#endif + widgetSnapshot = QPixmap::grabWindow(label.winId()); QImage actual = widgetSnapshot.toImage().convertToFormat(QImage::Format_RGB32); QImage expected = pm.toImage().convertToFormat(QImage::Format_RGB32); QCOMPARE(actual.size(),expected.size()); -- cgit v0.12 From 8733baf8b770a5fca12aecf4c38a8c8f94c4b0fa Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 26 Feb 2010 14:45:55 +0100 Subject: fix "configure -fast" on Windows for other maketools than nmake Task-number: QTBUG-8562 Reviewed-by: ossi --- configure.exe | Bin 1008128 -> 1212416 bytes tools/configure/configureapp.cpp | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.exe b/configure.exe index 9974236..3e51833 100755 Binary files a/configure.exe and b/configure.exe differ diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index d521276..153df10 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -3700,7 +3700,7 @@ void Configure::generateMakefiles() QTextStream txt(&file); txt << "all:\n"; txt << "\t" << args.join(" ") << "\n"; - txt << "\t" << dictionary[ "MAKE" ] << " -f " << it->target << "\n"; + txt << "\t\"$(MAKE)\" -$(MAKEFLAGS) -f " << it->target << "\n"; txt << "first: all\n"; txt << "qmake:\n"; txt << "\t" << args.join(" ") << "\n"; -- cgit v0.12 From 573fee867d129654ca2eb629d8f0ffb7f515a324 Mon Sep 17 00:00:00 2001 From: Prasanth Ullattil Date: Fri, 26 Feb 2010 13:28:45 +0100 Subject: Crash when dragging an empty URL-list. While converting the mime to native CF_ formats, we need to check the vaildity of the list. Task-number: QTBUG-8446 Reviewed-by: Thierry --- src/gui/kernel/qmime_win.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/gui/kernel/qmime_win.cpp b/src/gui/kernel/qmime_wi