From e83c52a997dd84f3f69c5a9d3b787ee04c6d78f1 Mon Sep 17 00:00:00 2001 From: Fabian Bumberger Date: Tue, 8 Apr 2014 19:31:45 +0200 Subject: [PATCH 01/10] QNX: Fix QMdiWindow autotests In "setOpaqueResizeAndMove" this patch makes sure that the content of a subwindow actually fits into the window, otherwise the resize does not work properly. The content is dpi dependent and thus the pixel size of it increases with the display dpi value. Furthermore when moving the QMdiSubwindow this patch makes sure that we actually grab the window's header and not one of it's tool buttons (minimize, maximize, close). Change-Id: I88314994957c5883f57c09c9240a3b83f1ee42ed Reviewed-by: Sergio Ahumada Reviewed-by: Bernd Weimer --- .../widgets/qmdisubwindow/tst_qmdisubwindow.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp b/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp index ffc3e3b67d..87d87eb4bc 100644 --- a/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp +++ b/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp @@ -444,7 +444,7 @@ void tst_QMdiSubWindow::mainWindowSupport() QVERIFY(!nestedWindow->maximizedButtonsWidget()); QVERIFY(!nestedWindow->maximizedSystemMenuIconWidget()); -#if !defined(Q_OS_MAC) && !defined(Q_OS_WINCE) +#if !defined(Q_OS_MAC) && !defined(Q_OS_WINCE) && !defined(Q_OS_QNX) QCOMPARE(mainWindow.windowTitle(), QString::fromLatin1("%1 - [%2]") .arg(originalWindowTitle, window->widget()->windowTitle())); #endif @@ -687,8 +687,8 @@ void tst_QMdiSubWindow::setOpaqueResizeAndMove_data() QTest::addColumn("workspaceSize"); QTest::addColumn("windowSize"); - QTest::newRow("normal mode") << true<< 20 << 20 << QSize(400, 400) << QSize(200, 200); - QTest::newRow("rubberband mode") << false << 20 << 1 << QSize(400, 400) << QSize(200, 200); + QTest::newRow("normal mode") << true<< 20 << 20 << QSize(400, 400) << QSize(240, 200); + QTest::newRow("rubberband mode") << false << 20 << 1 << QSize(400, 400) << QSize(240, 200); } void tst_QMdiSubWindow::setOpaqueResizeAndMove() @@ -779,7 +779,7 @@ void tst_QMdiSubWindow::setOpaqueResizeAndMove() // ### Remove this after mac style has been fixed height -= 4; #endif - QPoint mousePosition(window->width() / 2, height - 1); + QPoint mousePosition(window->width() / 3, height - 1); sendMouseMove(window, mousePosition, Qt::NoButton); sendMousePress(window, mousePosition); @@ -1478,6 +1478,9 @@ void tst_QMdiSubWindow::hideAndShow() #if !defined (Q_OS_MAC) && !defined (Q_OS_WINCE) QVERIFY(menuBar->cornerWidget(Qt::TopRightCorner)); +#if defined Q_OS_QNX + QEXPECT_FAIL("", "QTBUG-38231", Abort); +#endif QVERIFY(subWindow->maximizedButtonsWidget()); QVERIFY(subWindow->maximizedSystemMenuIconWidget()); QCOMPARE(menuBar->cornerWidget(Qt::TopRightCorner), subWindow->maximizedButtonsWidget()); @@ -1702,6 +1705,9 @@ void tst_QMdiSubWindow::replaceMenuBarWhileMaximized() qApp->processEvents(); +#if defined Q_OS_QNX + QEXPECT_FAIL("", "QTBUG-38231", Abort); +#endif QVERIFY(subWindow->maximizedButtonsWidget()); QVERIFY(subWindow->maximizedSystemMenuIconWidget()); QCOMPARE(menuBar->cornerWidget(Qt::TopLeftCorner), subWindow->maximizedSystemMenuIconWidget()); From 36009d6b8f040b0c2731c05d4911b5c95b5a7326 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lisandro=20Dami=C3=A1n=20Nicanor=20P=C3=A9rez=20Meyer?= Date: Sat, 15 Mar 2014 09:47:29 -0300 Subject: [PATCH 02/10] Create the 64 bits version strings for MIPS, SPARC and S390 Note that the specialization has to be declared before the common arch because of how qprocessordetection.h sets this variables. Else you would still get mips on a mips64 system. Change-Id: Ief949a5d30aa217c4bfda2d674ec2683e6c130c4 Reviewed-by: Thiago Macieira --- config.tests/arch/arch.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/config.tests/arch/arch.cpp b/config.tests/arch/arch.cpp index b3c0d3b7d2..e08183c193 100644 --- a/config.tests/arch/arch.cpp +++ b/config.tests/arch/arch.cpp @@ -61,14 +61,20 @@ const char msg[] = "==Qt=magic=Qt== Architecture:" "x86_64" #elif defined(Q_PROCESSOR_IA64) "ia64" +#elif defined(Q_PROCESSOR_MIPS_64) +"mips64" #elif defined(Q_PROCESSOR_MIPS) "mips" #elif defined(Q_PROCESSOR_POWER) "power" +#elif defined(Q_PROCESSOR_S390_X) +"s390x" #elif defined(Q_PROCESSOR_S390) "s390" #elif defined(Q_PROCESSOR_SH) "sh" +#elif defined(Q_PROCESSORS_SPARC_64) +"sparc64" #elif defined(Q_PROCESSOR_SPARC) "sparc" #else From 19d49de6f10de0365db8c37c211bf540710176ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lisandro=20Dami=C3=A1n=20Nicanor=20P=C3=A9rez=20Meyer?= Date: Thu, 22 May 2014 20:19:29 -0300 Subject: [PATCH 03/10] Remove -Wcast-align from QMAKE_CXXFLAGS. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit x86 doesn't care about alignment, and on all other platforms where it does something it causes build errors, so instead of removing it on those platforms just don't enable it at all. Change-Id: Idfeb387099b28af60ba161b6ca678b7c9df17fe1 Reviewed-by: Thiago Macieira Reviewed-by: Jędrzej Nowacki Reviewed-by: Oswald Buddenhagen --- mkspecs/features/qt_headersclean.prf | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/mkspecs/features/qt_headersclean.prf b/mkspecs/features/qt_headersclean.prf index ab0a722628..0650adfe5e 100644 --- a/mkspecs/features/qt_headersclean.prf +++ b/mkspecs/features/qt_headersclean.prf @@ -13,16 +13,11 @@ *-g++*: QMAKE_CXXFLAGS += -Woverloaded-virtual -Wshadow -Wundef # Other nice flags -*-g++*: QMAKE_CXXFLAGS += -Wnon-virtual-dtor -ansi -Wcast-align -Wchar-subscripts -Wpointer-arith -Wformat-security +*-g++*: QMAKE_CXXFLAGS += -Wnon-virtual-dtor -ansi -Wchar-subscripts -Wpointer-arith -Wformat-security # Enable pedantic mode, but accept variadic macros and 'long long' usage. *-g++*: QMAKE_CXXFLAGS += -Wno-long-long -Wno-variadic-macros -pedantic-errors -contains(QT_ARCH,arm)|contains(QT_ARCH,mips) { - # There are outstanding alignment issues in some container classes. - *-g++*:QMAKE_CXXFLAGS -= -Wcast-align -} - QMAKE_CXXFLAGS += -DQT_NO_CAST_TO_ASCII \ -DQT_NO_CAST_FROM_ASCII \ -DQT_STRICT_ITERATORS \ From dd91f8d46dbdf62cc276bc204425c4ae106d913e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lisandro=20Dami=C3=A1n=20Nicanor=20P=C3=A9rez=20Meyer?= Date: Fri, 14 Mar 2014 19:33:54 -0300 Subject: [PATCH 04/10] Enable sparc detection. It has been working in Debian for some time. It also adds detection for 64bits Sparc. Change-Id: Ie4fc0f58b37672b79191ebe51de0caf2eaf8a1d9 Reviewed-by: Thiago Macieira --- src/corelib/global/qprocessordetection.h | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/corelib/global/qprocessordetection.h b/src/corelib/global/qprocessordetection.h index 384df8fd54..c9fb728593 100644 --- a/src/corelib/global/qprocessordetection.h +++ b/src/corelib/global/qprocessordetection.h @@ -294,12 +294,15 @@ SPARC is big-endian only prior to V9, while V9 is bi-endian with big-endian as the default byte order. Assume all SPARC systems are big-endian. */ -// #elif defined(__sparc__) -// # define Q_PROCESSOR_SPARC -// # if defined(__sparc_v9__) -// # define Q_PROCESSOR_SPARC_V9 -// # endif -// # define Q_BYTE_ORDER Q_BIG_ENDIAN +#elif defined(__sparc__) +# define Q_PROCESSOR_SPARC +# if defined(__sparc_v9__) +# define Q_PROCESSOR_SPARC_V9 +# endif +# if defined(__sparc64__) +# define Q_PROCESSOR_SPARC_64 +# endif +# define Q_BYTE_ORDER Q_BIG_ENDIAN #endif From 60b6b28c213a420ee40e254ff1823876098e0a04 Mon Sep 17 00:00:00 2001 From: Aurelien Jarno Date: Sun, 10 Nov 2013 23:20:46 +0100 Subject: [PATCH 05/10] Support MIPS atomic on pre-MIPS32 architectures MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The atomic functions on MIPS are based on the sync opcode with an immediate argument, which is something introduced in the MIPS32 instruction set. This prevent to use Qt on pre-MIPS32 CPU, like the Loongson 2 CPU. However some of the pre-MIPS32 CPUs interprets the sync opcode with and immediate argument as a sync opcode without argument (which is a stronger ordering than with the argument), and for the others the kernel emulates it. It is therefore fine to use the current MIPS atomic functions on pre-MIPS32 CPU. This patch allows that by temporarily changing the instruction set to MIPS32 around the sync instruction, so that binutils doesn't choke on it. Change-Id: I9cc984bd55b5f172736ce9e638a6f4e271b79fe7 Reviewed-by: Lisandro Damián Nicanor Pérez Meyer Reviewed-by: Thiago Macieira --- src/corelib/arch/qatomic_mips.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/corelib/arch/qatomic_mips.h b/src/corelib/arch/qatomic_mips.h index 463612212b..7bfe16a450 100644 --- a/src/corelib/arch/qatomic_mips.h +++ b/src/corelib/arch/qatomic_mips.h @@ -110,13 +110,19 @@ template struct QAtomicOps : QBasicAtomicOps template template inline void QBasicAtomicOps::acquireMemoryFence(const T &) Q_DECL_NOTHROW { - asm volatile ("sync 0x11" ::: "memory"); + asm volatile (".set push\n" + ".set mips32\n" + "sync 0x11\n" + ".set pop\n" ::: "memory"); } template template inline void QBasicAtomicOps::releaseMemoryFence(const T &) Q_DECL_NOTHROW { - asm volatile ("sync 0x12" ::: "memory"); + asm volatile (".set push\n" + ".set mips32\n" + "sync 0x11\n" + ".set pop\n" ::: "memory"); } template template inline From 5f7ea1a41aa9e299130f335b0023b9026de841c5 Mon Sep 17 00:00:00 2001 From: Bernd Weimer Date: Fri, 6 Jun 2014 13:29:03 +0200 Subject: [PATCH 06/10] Fix QFileInfoGatherer threading issue QFileInfoGatherer has a QFileSystemWatcher member that lives in the same thread as the QFileInfoGatherer object. If only the poller engine is available for the file system watcher, the engine will only be created when addPaths() is called. However the latter was called from anohter thread (the QFileInfoGatherer thread). Hence the QPollingFileSystemWatcherEngine had its parent in a different thread and worse, this thread didn't have an event loop needed for the QTimer used in the poller engine. This fixes tst_qfilesystemmodel on platforms that only support the polling file system watcher engine. Task-Number: QTBUG-29366 Change-Id: I83b58b4237e3438a27e5cdde4b1e4126e4740a94 Reviewed-by: Fabian Bumberger Reviewed-by: Thiago Macieira --- src/widgets/dialogs/qfileinfogatherer.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/widgets/dialogs/qfileinfogatherer.cpp b/src/widgets/dialogs/qfileinfogatherer.cpp index b08cc798e5..41b0b30eeb 100644 --- a/src/widgets/dialogs/qfileinfogatherer.cpp +++ b/src/widgets/dialogs/qfileinfogatherer.cpp @@ -146,6 +146,15 @@ void QFileInfoGatherer::fetchExtendedInformation(const QString &path, const QStr this->path.push(path); this->files.push(files); condition.wakeAll(); + +#ifndef QT_NO_FILESYSTEMWATCHER + if (files.isEmpty() + && !path.isEmpty() + && !path.startsWith(QLatin1String("//")) /*don't watch UNC path*/) { + if (!watcher->directories().contains(path)) + watcher->addPath(path); + } +#endif } /*! @@ -269,16 +278,6 @@ static QString translateDriveName(const QFileInfo &drive) */ void QFileInfoGatherer::getFileInfos(const QString &path, const QStringList &files) { -#ifndef QT_NO_FILESYSTEMWATCHER - if (files.isEmpty() - && !path.isEmpty() - && !path.startsWith(QLatin1String("//")) /*don't watch UNC path*/) { - QMutexLocker locker(&mutex); - if (!watcher->directories().contains(path)) - watcher->addPath(path); - } -#endif - // List drives if (path.isEmpty()) { #ifdef QT_BUILD_INTERNAL From 47a66d5eac0df9481cff1dc23caed4335d49b515 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Tue, 13 May 2014 14:28:18 +0200 Subject: [PATCH 07/10] Mac: Don't register for Pan Gestures. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This will enable touch events for the viewport widget, which has undesired side effects (see task). Fixes a regression from Qt 4. Task-number: QTBUG-38815 Change-Id: I7b9c0d1de985d1c82f946140fecf460fcfc5e686 Reviewed-by: Morten Johan Sørvig --- src/widgets/widgets/qabstractscrollarea.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widgets/widgets/qabstractscrollarea.cpp b/src/widgets/widgets/qabstractscrollarea.cpp index e1e933cdd8..98e715fc62 100644 --- a/src/widgets/widgets/qabstractscrollarea.cpp +++ b/src/widgets/widgets/qabstractscrollarea.cpp @@ -309,7 +309,7 @@ void QAbstractScrollAreaPrivate::init() q->setFrameStyle(QFrame::StyledPanel | QFrame::Sunken); q->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); layoutChildren(); -#ifndef Q_WS_MAC +#ifndef Q_OS_OSX # ifndef QT_NO_GESTURES viewport->grabGesture(Qt::PanGesture); # endif From 35f6b003341f31172b3a0a7fab8902350b9ba6c0 Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Wed, 25 Sep 2013 16:11:58 +0200 Subject: [PATCH 08/10] move loading of testability driver from QApplication to QGuiApplication This is useful without QWidget too. Change-Id: Ic7857e52e4a8f57c1205615a1f30323b486814af Reviewed-by: Richard J. Moore Reviewed-by: Friedemann Kleint Reviewed-by: Alberto Mardegan Reviewed-by: Shawn Rutledge --- src/gui/kernel/qguiapplication.cpp | 23 +++++++++++++++++++++++ src/widgets/kernel/qapplication.cpp | 23 ----------------------- src/widgets/kernel/qapplication_p.h | 1 - 3 files changed, 23 insertions(+), 24 deletions(-) diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 8ccff4321d..91e4833812 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -96,6 +96,10 @@ #include #endif +#ifndef QT_NO_LIBRARY +#include +#endif + #if defined(Q_OS_MAC) # include "private/qcore_mac_p.h" #elif defined(Q_OS_WIN) && !defined(Q_OS_WINCE) @@ -1180,6 +1184,7 @@ void QGuiApplicationPrivate::init() QCoreApplicationPrivate::is_app_running = false; // Starting up. bool doGrabUnderDebugger = false; + bool loadTestability = false; QList pluginList; // Get command line params #ifndef QT_NO_SESSIONMANAGER @@ -1230,6 +1235,8 @@ void QGuiApplicationPrivate::init() is_session_restored = true; } #endif + } else if (arg == "-testability") { + loadTestability = true; } else { argv[j++] = argv[i]; } @@ -1287,6 +1294,22 @@ void QGuiApplicationPrivate::init() session_manager = new QSessionManager(q, session_id, session_key); #endif +#ifndef QT_NO_LIBRARY + if (loadTestability) { + QLibrary testLib(QStringLiteral("qttestability")); + if (testLib.load()) { + typedef void (*TasInitialize)(void); + TasInitialize initFunction = (TasInitialize)testLib.resolve("qt_testability_init"); + if (initFunction) { + initFunction(); + } else { + qCritical() << "Library qttestability resolve failed!"; + } + } else { + qCritical() << "Library qttestability load failed:" << testLib.errorString(); + } + } +#endif // QT_NO_LIBRARY } extern void qt_cleanupFontDatabase(); diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index 0b983e7a9d..4bd306ed32 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -92,9 +92,6 @@ #include "qgesture.h" #include "private/qgesturemanager_p.h" #include -#ifndef QT_NO_LIBRARY -#include "qlibrary.h" -#endif #include "qdatetime.h" @@ -415,7 +412,6 @@ int qt_antialiasing_threshold = -1; QSize QApplicationPrivate::app_strut = QSize(0,0); // no default application strut int QApplicationPrivate::enabledAnimations = QPlatformTheme::GeneralUiEffect; bool QApplicationPrivate::widgetCount = false; -bool QApplicationPrivate::load_testability = false; #ifdef QT_KEYPAD_NAVIGATION Qt::NavigationMode QApplicationPrivate::navigationMode = Qt::NavigationModeKeypadTabOrder; QWidget *QApplicationPrivate::oldEditFocus = 0; @@ -490,8 +486,6 @@ void QApplicationPrivate::process_cmdline() #endif } else if (qstrcmp(arg, "-widgetcount") == 0) { widgetCount = true; - } else if (qstrcmp(arg, "-testability") == 0) { - load_testability = true; } else { argv[j++] = argv[i]; } @@ -582,23 +576,6 @@ void QApplicationPrivate::construct() extern void qt_gui_eval_init(QCoreApplicationPrivate::Type); qt_gui_eval_init(application_type); #endif - -#ifndef QT_NO_LIBRARY - if(load_testability) { - QLibrary testLib(QLatin1String("qttestability")); - if (testLib.load()) { - typedef void (*TasInitialize)(void); - TasInitialize initFunction = (TasInitialize)testLib.resolve("qt_testability_init"); - if (initFunction) { - initFunction(); - } else { - qCritical("Library qttestability resolve failed!"); - } - } else { - qCritical("Library qttestability load failed!"); - } - } -#endif } #ifndef QT_NO_STATEMACHINE diff --git a/src/widgets/kernel/qapplication_p.h b/src/widgets/kernel/qapplication_p.h index d5efb62dda..29142470a7 100644 --- a/src/widgets/kernel/qapplication_p.h +++ b/src/widgets/kernel/qapplication_p.h @@ -214,7 +214,6 @@ public: static int enabledAnimations; // Combination of QPlatformTheme::UiEffect static bool widgetCount; // Coupled with -widgetcount switch - static bool load_testability; // Coupled with -testability switch static void setSystemPalette(const QPalette &pal); static void setPalette_helper(const QPalette &palette, const char* className, bool clearWidgetPaletteHash); From 66790d63e914e46bc91818e530be40738f92cfcf Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Wed, 18 Jun 2014 14:53:42 +0200 Subject: [PATCH 09/10] XCB: Enable loading of the Qt::DragLinkCursor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It did not load due to an off-by-1 boundary error in a check. Qt::DragLinkCursor happens to be Qt::LastCursor. Task-number: QTBUG-39735 Change-Id: Ia7b11fc4eecc4329bd487bd5689c83c986fd2de6 Reviewed-by: Laszlo Agocs Reviewed-by: Jørgen Lind --- src/plugins/platforms/xcb/qxcbcursor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/platforms/xcb/qxcbcursor.cpp b/src/plugins/platforms/xcb/qxcbcursor.cpp index ce9e445ba2..6dbac90e0c 100644 --- a/src/plugins/platforms/xcb/qxcbcursor.cpp +++ b/src/plugins/platforms/xcb/qxcbcursor.cpp @@ -545,7 +545,7 @@ xcb_cursor_t QXcbCursor::createFontCursor(int cshape) // Try Xcursor first #ifdef XCB_USE_XLIB - if (cshape >= 0 && cshape < Qt::LastCursor) { + if (cshape >= 0 && cshape <= Qt::LastCursor) { void *dpy = connection()->xlib_display(); // special case for non-standard dnd-* cursors cursor = loadCursor(dpy, cshape); From 3fed060b94ff04131de603d4d668ae7853e50a53 Mon Sep 17 00:00:00 2001 From: Joni Poikelin Date: Mon, 9 Jun 2014 16:27:36 +0300 Subject: [PATCH 10/10] Fix warning message when re-setting text on tooltip Fix warning message that gets printed when changing tooltip message without rect and widget parameters for already shown tooltip widget. Task-number: QTBUG-39550 Change-Id: I69ed8747e5e77ca618525d74479c72e02b7ab897 Reviewed-by: Andy Shaw Reviewed-by: Friedemann Kleint --- src/widgets/kernel/qtooltip.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widgets/kernel/qtooltip.cpp b/src/widgets/kernel/qtooltip.cpp index 2b43fd7f6d..16fb41e1fc 100644 --- a/src/widgets/kernel/qtooltip.cpp +++ b/src/widgets/kernel/qtooltip.cpp @@ -273,7 +273,7 @@ void QTipLabel::hideTipImmediately() void QTipLabel::setTipRect(QWidget *w, const QRect &r) { - if (!rect.isNull() && !w) + if (!r.isNull() && !w) qWarning("QToolTip::setTipRect: Cannot pass null widget if rect is set"); else{ widget = w;