From e83c52a997dd84f3f69c5a9d3b787ee04c6d78f1 Mon Sep 17 00:00:00 2001 From: Fabian Bumberger Date: Tue, 8 Apr 2014 19:31:45 +0200 Subject: 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/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()); -- cgit v1.2.3 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: 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 -- cgit v1.2.3 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: 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 \ -- cgit v1.2.3 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: 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 -- cgit v1.2.3 From 60b6b28c213a420ee40e254ff1823876098e0a04 Mon Sep 17 00:00:00 2001 From: Aurelien Jarno Date: Sun, 10 Nov 2013 23:20:46 +0100 Subject: 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 -- cgit v1.2.3 From 5f7ea1a41aa9e299130f335b0023b9026de841c5 Mon Sep 17 00:00:00 2001 From: Bernd Weimer Date: Fri, 6 Jun 2014 13:29:03 +0200 Subject: 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 -- cgit v1.2.3 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: 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 -- cgit v1.2.3 From 35f6b003341f31172b3a0a7fab8902350b9ba6c0 Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Wed, 25 Sep 2013 16:11:58 +0200 Subject: 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); -- cgit v1.2.3 From 66790d63e914e46bc91818e530be40738f92cfcf Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Wed, 18 Jun 2014 14:53:42 +0200 Subject: 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); -- cgit v1.2.3 From 3fed060b94ff04131de603d4d668ae7853e50a53 Mon Sep 17 00:00:00 2001 From: Joni Poikelin Date: Mon, 9 Jun 2014 16:27:36 +0300 Subject: 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; -- cgit v1.2.3 From 0afc80c9225ca9630f627fe1aea3d4fd7f958082 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 29 Jul 2014 12:56:34 +0200 Subject: Don't convert signed to unsigned when we need all 32bit The fast scale methods qt_scale_image_16bit and qt_scale_image_32bit were incorrectly assigning an unsigned value to a signed variable, which broke their support of images with dimensions from 32384 to 65535. Images with dimensions higher than that are already using another code- path. Task-number: QTBUG-40297 Change-Id: I8c971889e069381224cea2befbb5c66cd93ea5c2 Reviewed-by: Gunnar Sletta --- src/gui/painting/qblendfunctions_p.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/painting/qblendfunctions_p.h b/src/gui/painting/qblendfunctions_p.h index 98e9e10bd8..e08c74ab88 100644 --- a/src/gui/painting/qblendfunctions_p.h +++ b/src/gui/painting/qblendfunctions_p.h @@ -147,7 +147,7 @@ void qt_scale_image_16bit(uchar *destPixels, int dbpl, while (h--) { const SRC *src = (const SRC *) (srcPixels + (srcy >> 16) * sbpl); - int srcx = basex; + quint32 srcx = basex; int x = 0; for (; x> 16]); srcx += ix; @@ -258,7 +258,7 @@ template void qt_scale_image_32bit(uchar *destPixels, int dbpl, while (h--) { const uint *src = (const quint32 *) (srcPixels + (srcy >> 16) * sbpl); - int srcx = basex; + quint32 srcx = basex; int x = 0; for (; x> 16]); -- cgit v1.2.3 From e7839d9717820a8f0049316c626d28fbcf252fa7 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Wed, 2 Jul 2014 17:14:26 +0200 Subject: QCoreTextFontDatabase: Fix font weight value when populating a family MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit kCTFontWeightTrait returns a normalized value between -1.0 (lightest) and 1.0 (heaviest), 0.0 being the regular font weight. The threshold values used in this change have been estimated from the weight values of fonts from the Helvetica Neue and Myriad Pro font families. Change-Id: I49de8e8bd5894107de4842aeda7ace2e83f95be3 Reviewed-by: Tor Arne Vestbø --- .../fontdatabases/mac/qcoretextfontdatabase.mm | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm index 9248785696..4aa4253773 100644 --- a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm +++ b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm @@ -245,9 +245,19 @@ void QCoreTextFontDatabase::populateFromDescriptor(CTFontDescriptorRef font) if (styles) { if (CFNumberRef weightValue = (CFNumberRef) CFDictionaryGetValue(styles, kCTFontWeightTrait)) { Q_ASSERT(CFNumberIsFloatType(weightValue)); - double d; - if (CFNumberGetValue(weightValue, kCFNumberDoubleType, &d)) - weight = (d > 0.0) ? QFont::Bold : QFont::Normal; + double normalizedWeight; + if (CFNumberGetValue(weightValue, kCFNumberDoubleType, &normalizedWeight)) { + if (normalizedWeight >= 0.62) + weight = QFont::Black; + else if (normalizedWeight >= 0.4) + weight = QFont::Bold; + else if (normalizedWeight >= 0.3) + weight = QFont::DemiBold; + else if (normalizedWeight == 0.0) + weight = QFont::Normal; + else if (normalizedWeight <= -0.4) + weight = QFont::Light; + } } if (CFNumberRef italic = (CFNumberRef) CFDictionaryGetValue(styles, kCTFontSlantTrait)) { Q_ASSERT(CFNumberIsFloatType(italic)); -- cgit v1.2.3 From 3866c89dee50e3a1156097f3f866e280b327ba28 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 16 Jul 2014 18:39:40 -0700 Subject: Work around ICC bug in local static symbols for Q_GLOBAL_STATIC MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When compiling the innerFunction() of the Q_GLOBAL_STATIC expansion, ICC emits global symbols for the internal "holder" local static variable and its guard. If there are two global statics of the same name in two different .cpp files, the linker will incorrectly merge the two "holder" variables. This was noted between the "customTypes" global statics of qmetatype.cpp and qdbusmetatype.cpp in a static build. The C++ standard requires that local static variables declared in inline functions must be the same, regardless of whether the body of the function got inlined or not. The IA-64 C++ ABI does that by requiring local static symbols for inline functions to be global and mergeable ("link once"). However, two functions in anonymous namespaces in different files are not considered to be the same function, so their local statics should not be merged. This is where ICC failed: the local statics are global and mergeable, even though the function is in an anonymous namespace. ICC correctly emits the function itself as a local symbol. Alternative solutions were: 1) add "static", but you can't use a static symbol in a template parameter in C++98 mode 2) remove the "inline" keyword, but then GCC 4.8 will not inline Intel issue ID: 6000058488 Task-number: QTBUG-40053 Change-Id: I307622222499682dde711b2771c8cf7557400799 Reviewed-by: Jędrzej Nowacki --- src/corelib/global/qglobalstatic.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/corelib/global/qglobalstatic.h b/src/corelib/global/qglobalstatic.h index ad39452cf4..1c44569dbd 100644 --- a/src/corelib/global/qglobalstatic.h +++ b/src/corelib/global/qglobalstatic.h @@ -68,8 +68,17 @@ enum GuardValues { // until the constructor returns ... // We better avoid these kind of problems by using our own locked implementation. +#if defined(Q_OS_UNIX) && defined(Q_CC_INTEL) +// Work around Intel issue ID 6000058488: +// local statics inside an inline function inside an anonymous namespace are global +// symbols (this affects the IA-64 C++ ABI, so OS X and Linux only) +# define Q_GLOBAL_STATIC_INTERNAL_DECORATION Q_DECL_HIDDEN +#else +# define Q_GLOBAL_STATIC_INTERNAL_DECORATION Q_DECL_HIDDEN inline +#endif + #define Q_GLOBAL_STATIC_INTERNAL(ARGS) \ - Q_DECL_HIDDEN inline Type *innerFunction() \ + Q_GLOBAL_STATIC_INTERNAL_DECORATION Type *innerFunction() \ { \ struct HolderBase { \ ~HolderBase() Q_DECL_NOTHROW \ -- cgit v1.2.3 From 429beecb19e9a2890fe60a56e7eed7ddf6067e61 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Wed, 9 Jul 2014 16:36:59 +0200 Subject: Fix double clicks in eglfs The window can be null in the qpa event. This is indicated by the nullWindow field to be able to differentiate between a dead window and a genuinely null input. [ChangeLog] Double click events are now sent correctly on eglfs. Task-number: QTBUG-40146 Change-Id: I63c8d08e0dec217b929161d2e827e0c273b4dd3e Reviewed-by: Will Wagner Reviewed-by: Friedemann Kleint --- src/gui/kernel/qguiapplication.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index f429ad2229..8e0fdd561f 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -1755,7 +1755,7 @@ void QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::Mo } if (doubleClick) { mousePressButton = Qt::NoButton; - if (!e->window.isNull()) { // QTBUG-36364, check if window closed in response to press + if (!e->window.isNull() || e->nullWindow) { // QTBUG-36364, check if window closed in response to press const QEvent::Type doubleClickType = frameStrut ? QEvent::NonClientAreaMouseButtonDblClick : QEvent::MouseButtonDblClick; QMouseEvent dblClickEvent(doubleClickType, localPoint, localPoint, globalPoint, button, buttons, e->modifiers); -- cgit v1.2.3 From 07e1f524f383eced94d4b3cdc150f7db2aadcd27 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Mon, 28 Jul 2014 10:06:22 +0200 Subject: Propagate swapInterval to QGLFormat Task-number: QTBUG-39370 Change-Id: Ib3a46a0ae24e5f6d690625b1d91be9e599bbc927 Reviewed-by: Gunnar Sletta --- src/opengl/qgl_qpa.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/opengl/qgl_qpa.cpp b/src/opengl/qgl_qpa.cpp index 61d295f173..90ba0e7f5a 100644 --- a/src/opengl/qgl_qpa.cpp +++ b/src/opengl/qgl_qpa.cpp @@ -77,6 +77,7 @@ QGLFormat QGLFormat::fromSurfaceFormat(const QSurfaceFormat &format) retFormat.setStencil(true); retFormat.setStencilBufferSize(format.stencilBufferSize()); } + retFormat.setSwapInterval(format.swapInterval()); retFormat.setDoubleBuffer(format.swapBehavior() != QSurfaceFormat::SingleBuffer); retFormat.setStereo(format.stereo()); retFormat.setVersion(format.majorVersion(), format.minorVersion()); @@ -105,6 +106,7 @@ QSurfaceFormat QGLFormat::toSurfaceFormat(const QGLFormat &format) retFormat.setSamples(format.samples() == -1 ? 4 : format.samples()); if (format.stencil()) retFormat.setStencilBufferSize(format.stencilBufferSize() == -1 ? 1 : format.stencilBufferSize()); + retFormat.setSwapInterval(format.swapInterval()); retFormat.setStereo(format.stereo()); retFormat.setMajorVersion(format.majorVersion()); retFormat.setMinorVersion(format.minorVersion()); -- cgit v1.2.3 From 291c6615a3b5209760da03d1830d31a2581bd0cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Martins?= Date: Mon, 14 Jul 2014 13:12:07 +0100 Subject: cocoa: Fix compiler warnings about unused functions. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Id85c86dd2f2468b3ac17751aefdebe0e8666a0c0 Reviewed-by: Tor Arne Vestbø --- src/plugins/platforms/cocoa/qpaintengine_mac.mm | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/plugins/platforms/cocoa/qpaintengine_mac.mm b/src/plugins/platforms/cocoa/qpaintengine_mac.mm index ef67d1166f..f4cd071ab7 100644 --- a/src/plugins/platforms/cocoa/qpaintengine_mac.mm +++ b/src/plugins/platforms/cocoa/qpaintengine_mac.mm @@ -193,7 +193,6 @@ CGImageRef qt_mac_create_imagemask(const QPixmap &pixmap, const QRectF &sr) //conversion inline static float qt_mac_convert_color_to_cg(int c) { return ((float)c * 1000 / 255) / 1000; } -inline static int qt_mac_convert_color_from_cg(float c) { return qRound(c * 255); } CGAffineTransform qt_mac_convert_transform_to_cg(const QTransform &t) { return CGAffineTransformMake(t.m11(), t.m12(), t.m21(), t.m22(), t.dx(), t.dy()); } @@ -974,11 +973,6 @@ void QCoreGraphicsPaintEngine::drawPixmap(const QRectF &r, const QPixmap &pm, co d->restoreGraphicsState(); } -static void drawImageReleaseData (void *info, const void *, size_t) -{ - delete static_cast(info); -} - void QCoreGraphicsPaintEngine::drawImage(const QRectF &r, const QImage &img, const QRectF &sr, Qt::ImageConversionFlags flags) { -- cgit v1.2.3 From ef5fb6ead50ca4423c2a1fca8b75fa571adcd00d Mon Sep 17 00:00:00 2001 From: BogDan Vatra Date: Tue, 29 Jul 2014 16:13:57 +0300 Subject: Android: export ANDROID_SDK_BUILD_TOOLS_REVISION. It's needed by androiddeployqt tool to run "zipalign" tool and to set it to gradle properties. Task-number:QTBUG-40481 Change-Id: I3dd665a7461a4e981867cdad75a50940e46a5ae6 Reviewed-by: Oswald Buddenhagen Reviewed-by: Eskil Abrahamsen Blomfeldt --- mkspecs/android-g++/qmake.conf | 13 ++++++++++++ .../android/android_deployment_settings.prf | 5 ++--- mkspecs/features/java.prf | 24 +++++----------------- 3 files changed, 20 insertions(+), 22 deletions(-) diff --git a/mkspecs/android-g++/qmake.conf b/mkspecs/android-g++/qmake.conf index 78b484fdb5..e510c2d93c 100644 --- a/mkspecs/android-g++/qmake.conf +++ b/mkspecs/android-g++/qmake.conf @@ -74,6 +74,19 @@ else: ANDROID_ARCHITECTURE = arm NDK_TOOLCHAIN = $$NDK_TOOLCHAIN_PREFIX-$$NDK_TOOLCHAIN_VERSION NDK_TOOLCHAIN_PATH = $$NDK_ROOT/toolchains/$$NDK_TOOLCHAIN/prebuilt/$$NDK_HOST + +ANDROID_SDK_ROOT = $$(ANDROID_SDK_ROOT) +isEmpty(ANDROID_SDK_ROOT): ANDROID_SDK_ROOT = $$DEFAULT_ANDROID_SDK_ROOT + +ANDROID_SDK_BUILD_TOOLS_REVISION = $$(ANDROID_BUILD_TOOLS_REVISION) +isEmpty(ANDROID_SDK_BUILD_TOOLS_REVISION) { + SDK_BUILD_TOOLS_REVISIONS = $$files($$ANDROID_SDK_ROOT/build-tools/*) + for (REVISION, SDK_BUILD_TOOLS_REVISIONS) { + BASENAME = $$basename(REVISION) + greaterThan(BASENAME, $$ANDROID_SDK_BUILD_TOOLS_REVISION): ANDROID_SDK_BUILD_TOOLS_REVISION = $$BASENAME + } +} + CONFIG += $$ANDROID_PLATFORM ANDROID_PLATFORM_ROOT_PATH = $$NDK_ROOT/platforms/$$ANDROID_PLATFORM/arch-$$ANDROID_ARCHITECTURE/ ANDROID_PLATFORM_PATH = $$ANDROID_PLATFORM_ROOT_PATH/usr diff --git a/mkspecs/features/android/android_deployment_settings.prf b/mkspecs/features/android/android_deployment_settings.prf index 5bc1fd14c9..208d4abaa7 100644 --- a/mkspecs/features/android/android_deployment_settings.prf +++ b/mkspecs/features/android/android_deployment_settings.prf @@ -10,9 +10,8 @@ contains(TEMPLATE, ".*app"):!build_pass:!android-no-sdk { FILE_CONTENT += " \"qt\": $$emitString($$[QT_INSTALL_PREFIX])," # Settings from mkspecs/environment - isEmpty(SDK_ROOT): SDK_ROOT = $$(ANDROID_SDK_ROOT) - isEmpty(SDK_ROOT): SDK_ROOT = $$DEFAULT_ANDROID_SDK_ROOT - FILE_CONTENT += " \"sdk\": $$emitString($$SDK_ROOT)," + FILE_CONTENT += " \"sdk\": $$emitString($$ANDROID_SDK_ROOT)," + FILE_CONTENT += " \"sdkBuildToolsRevision\": $$emitString($$ANDROID_SDK_BUILD_TOOLS_REVISION)," isEmpty(NDK_ROOT): NDK_ROOT = $$(ANDROID_NDK_ROOT) isEmpty(NDK_ROOT): NDK_ROOT = $$DEFAULT_ANDROID_NDK_ROOT diff --git a/mkspecs/features/java.prf b/mkspecs/features/java.prf index 790724cec9..1c55b8974e 100644 --- a/mkspecs/features/java.prf +++ b/mkspecs/features/java.prf @@ -1,24 +1,10 @@ TEMPLATE = lib android { - isEmpty(SDK_ROOT): SDK_ROOT = $$(ANDROID_SDK_ROOT) - isEmpty(SDK_ROOT): SDK_ROOT = $$DEFAULT_ANDROID_SDK_ROOT - API_VERSION_TO_USE = $$(ANDROID_API_VERSION) isEmpty(API_VERSION_TO_USE): API_VERSION_TO_USE = $$API_VERSION isEmpty(API_VERSION_TO_USE): API_VERSION_TO_USE = android-10 - isEmpty(BUILD_TOOLS_REVISION) { - BUILD_TOOLS_REVISION = $$(ANDROID_BUILD_TOOLS_REVISION) - isEmpty(BUILD_TOOLS_REVISION) { - BUILD_TOOLS_REVISIONS = $$files($$SDK_ROOT/build-tools/*) - for (REVISION, BUILD_TOOLS_REVISIONS) { - BASENAME = $$basename(REVISION) - greaterThan(BASENAME, $$BUILD_TOOLS_REVISION): BUILD_TOOLS_REVISION = $$BASENAME - } - } - } - - ANDROID_JAR_FILE = $$SDK_ROOT/platforms/$$API_VERSION_TO_USE/android.jar + ANDROID_JAR_FILE = $$ANDROID_SDK_ROOT/platforms/$$API_VERSION_TO_USE/android.jar !exists($$ANDROID_JAR_FILE) { error("The Path $$ANDROID_JAR_FILE does not exist. Make sure the ANDROID_SDK_ROOT and ANDROID_API_VERSION environment variables are correctly set.") } @@ -69,12 +55,12 @@ android:!bundled_jar_file { # of the base sdk folder. # Doing it this way makes this logic more similar to the other platforms and # also means that our dx.bat is more like Google's dx.bat - DEX_BAT = $$SDK_ROOT/platform-tools/dx.bat - !exists($$DEX_BAT): DEX_BAT = $$SDK_ROOT/build-tools/$$BUILD_TOOLS_REVISION/dx.bat + DEX_BAT = $$ANDROID_SDK_ROOT/platform-tools/dx.bat + !exists($$DEX_BAT): DEX_BAT = $$ANDROID_SDK_ROOT/build-tools/$$ANDROID_SDK_BUILD_TOOLS_REVISION/dx.bat DEX_CMD = $$PWD/data/android/dx $$DEX_BAT } else { - DEX_CMD = $$SDK_ROOT/platform-tools/dx - !exists($$DEX_CMD): DEX_CMD = $$SDK_ROOT/build-tools/$$BUILD_TOOLS_REVISION/dx + DEX_CMD = $$ANDROID_SDK_ROOT/platform-tools/dx + !exists($$DEX_CMD): DEX_CMD = $$ANDROID_SDK_ROOT/build-tools/$$ANDROID_SDK_BUILD_TOOLS_REVISION/dx !exists($$DEX_CMD): error("The path $$DEX_CMD does not exist. Please set the environment variable ANDROID_BUILD_TOOLS_REVISION to the revision of the build tools installed in your Android SDK.") } QMAKE_LINK_SHLIB_CMD = $$DEX_CMD --dex --output $(TARGET) $$CLASS_DIR -- cgit v1.2.3 From c0429719c1a28bb1a0d88862b3a8c84525ee9a48 Mon Sep 17 00:00:00 2001 From: Rainer Keller Date: Thu, 31 Jul 2014 10:16:01 +0200 Subject: Add missing power button keycode to keymap Change-Id: I03682716aaea8344ebb5b71dcea5fe18babcd610 Reviewed-by: Allan Sandfeld Jensen Reviewed-by: Laszlo Agocs --- src/platformsupport/input/evdevkeyboard/qevdevkeyboard_defaultmap_p.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/platformsupport/input/evdevkeyboard/qevdevkeyboard_defaultmap_p.h b/src/platformsupport/input/evdevkeyboard/qevdevkeyboard_defaultmap_p.h index 3f656668aa..5e919ebeb7 100644 --- a/src/platformsupport/input/evdevkeyboard/qevdevkeyboard_defaultmap_p.h +++ b/src/platformsupport/input/evdevkeyboard/qevdevkeyboard_defaultmap_p.h @@ -639,6 +639,7 @@ const QEvdevKeyboardMap::Mapping QEvdevKeyboardHandler::s_keymap_default[] = { { KEY_MUTE, 0xffff, Qt::Key_VolumeMute, 0x00, 0x00, 0x0000 }, { KEY_VOLUMEDOWN, 0xffff, Qt::Key_VolumeDown, 0x00, 0x00, 0x0000 }, { KEY_VOLUMEUP, 0xffff, Qt::Key_VolumeUp, 0x00, 0x00, 0x0000 }, + { KEY_POWER, 0xffff, Qt::Key_PowerOff, 0x00, 0x00, 0x0000 }, { KEY_PAUSE, 0xffff, Qt::Key_Pause, 0x00, 0x00, 0x0000 }, { KEY_STOP, 0xffff, Qt::Key_Stop, 0x00, 0x00, 0x0000 }, { KEY_SETUP, 0xffff, Qt::Key_Settings, 0x00, 0x00, 0x0000 }, -- cgit v1.2.3 From 6c8e59d6942b3fcc4201e77bcc2d4ecc01168b10 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 2 Jul 2014 14:24:33 +0200 Subject: ensure that arch_host.pro is used also on windows Change-Id: I110ec33a40f37ecdec5ab952ea56a4fc00cd27a8 Reviewed-by: David Schulz --- tools/configure/configureapp.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 63d9f2804e..f40c1ac615 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -3090,13 +3090,14 @@ void Configure::generateCachefile() } struct ArchData { + bool isHost; const char *qmakespec; const char *key; const char *subarchKey; const char *type; ArchData() {} - ArchData(const char *t, const char *qm, const char *k, const char *sak) - : qmakespec(qm), key(k), subarchKey(sak), type(t) + ArchData(bool h, const char *t, const char *qm, const char *k, const char *sak) + : isHost(h), qmakespec(qm), key(k), subarchKey(sak), type(t) {} }; @@ -3122,8 +3123,8 @@ void Configure::detectArch() QVector qmakespecs; if (dictionary.contains("XQMAKESPEC")) - qmakespecs << ArchData("target", "XQMAKESPEC", "QT_ARCH", "QT_CPU_FEATURES"); - qmakespecs << ArchData("host", "QMAKESPEC", "QT_HOST_ARCH", "QT_HOST_CPU_FEATURES"); + qmakespecs << ArchData(false, "target", "XQMAKESPEC", "QT_ARCH", "QT_CPU_FEATURES"); + qmakespecs << ArchData(true, "host", "QMAKESPEC", "QT_HOST_ARCH", "QT_HOST_CPU_FEATURES"); for (int i = 0; i < qmakespecs.count(); ++i) { const ArchData &data = qmakespecs.at(i); @@ -3135,7 +3136,8 @@ void Configure::detectArch() QString command = QString("%1 -spec %2 %3") .arg(QDir::toNativeSeparators(buildPath + "/bin/qmake.exe"), QDir::toNativeSeparators(qmakespec), - QDir::toNativeSeparators(sourcePath + "/config.tests/arch/arch.pro")); + QDir::toNativeSeparators(sourcePath + "/config.tests/arch/arch" + + (data.isHost ? "_host" : "") + ".pro")); if (qmakespec.startsWith("winrt") || qmakespec.startsWith("winphone")) command.append(" QMAKE_LFLAGS+=/ENTRY:main"); -- cgit v1.2.3 From 4a55f1510d1e250b5e899fe5c03c98f714816a5c Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 2 Jul 2014 13:44:38 +0200 Subject: avoid that CROSS_COMPILE affects host builds Change-Id: Iee40cfd87d7ec640fb4b3526e58317bdc8a778c7 Reviewed-by: Joerg Bornemann Reviewed-by: David Schulz --- mkspecs/features/device_config.prf | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mkspecs/features/device_config.prf b/mkspecs/features/device_config.prf index cb1de0b947..1de64b8821 100644 --- a/mkspecs/features/device_config.prf +++ b/mkspecs/features/device_config.prf @@ -5,7 +5,9 @@ DEVICE_PRI = $$[QT_HOST_DATA/get]/mkspecs/qdevice.pri exists($$DEVICE_PRI):include($$DEVICE_PRI) unset(DEVICE_PRI) -isEmpty(CROSS_COMPILE) { +host_build { + CROSS_COMPILE = +} else: isEmpty(CROSS_COMPILE) { #this variable can be persisted via qmake -set CROSS_COMPILE /foo CROSS_COMPILE = $$[CROSS_COMPILE] } -- cgit v1.2.3 From ae496a0ea6c0951e9220209b345fb656bf50c09e Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 2 Jul 2014 14:42:58 +0200 Subject: add /ENTRY:main only for target builds Change-Id: Ifa1d36607a1884ec989b5b514e7d1b9a2b40ddce Reviewed-by: David Schulz Reviewed-by: Oliver Wolff Reviewed-by: Joerg Bornemann --- tools/configure/configureapp.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index f40c1ac615..76b2b9073c 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -3139,8 +3139,10 @@ void Configure::detectArch() QDir::toNativeSeparators(sourcePath + "/config.tests/arch/arch" + (data.isHost ? "_host" : "") + ".pro")); - if (qmakespec.startsWith("winrt") || qmakespec.startsWith("winphone")) - command.append(" QMAKE_LFLAGS+=/ENTRY:main"); + if (!data.isHost) { + if (qmakespec.startsWith("winrt") || qmakespec.startsWith("winphone")) + command.append(" QMAKE_LFLAGS+=/ENTRY:main"); + } int returnValue = 0; Environment::execute(command, &returnValue); -- cgit v1.2.3 From ffd44acd0de4fc7079e76f1fe4689b655f9dc763 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 2 Jul 2014 14:43:18 +0200 Subject: pass --sysroot to compile tests also on windows Change-Id: I486059197479842f32c3590d7fd269550d22698e Reviewed-by: David Schulz Reviewed-by: Oliver Wolff Reviewed-by: Joerg Bornemann --- tools/configure/configureapp.cpp | 11 +++++++++++ tools/configure/configureapp.h | 1 + 2 files changed, 12 insertions(+) diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 76b2b9073c..90981f6624 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -3089,6 +3089,15 @@ void Configure::generateCachefile() } } +void Configure::addSysroot(QString *command) +{ + const QString &sysroot = dictionary["CFG_SYSROOT"]; + if (!sysroot.isEmpty() && dictionary["CFG_GCC_SYSROOT"] == "yes") { + command->append(" QMAKE_LFLAGS+=--sysroot=" + sysroot); + command->append(" QMAKE_CXXFLAGS+=--sysroot=" + sysroot); + } +} + struct ArchData { bool isHost; const char *qmakespec; @@ -3142,6 +3151,7 @@ void Configure::detectArch() if (!data.isHost) { if (qmakespec.startsWith("winrt") || qmakespec.startsWith("winphone")) command.append(" QMAKE_LFLAGS+=/ENTRY:main"); + addSysroot(&command); } int returnValue = 0; @@ -3249,6 +3259,7 @@ bool Configure::tryCompileProject(const QString &projectPath, const QString &ext const QString qmakespec = dictionary["XQMAKESPEC"]; if (qmakespec.startsWith("winrt") || qmakespec.startsWith("winphone")) command.append(" QMAKE_LFLAGS+=/ENTRY:main"); + addSysroot(&command); } int code = 0; diff --git a/tools/configure/configureapp.h b/tools/configure/configureapp.h index 5f118ddd39..faa9c1eb14 100644 --- a/tools/configure/configureapp.h +++ b/tools/configure/configureapp.h @@ -169,6 +169,7 @@ private: void reloadCmdLine(); void saveCmdLine(); + void addSysroot(QString *command); bool tryCompileProject(const QString &projectPath, const QString &extraOptions = QString()); bool compilerSupportsFlag(const QString &compilerAndArgs); -- cgit v1.2.3