From e903b5cddaaa606300292ad2cf26c2b6ee111cdd Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Tue, 26 Nov 2013 10:45:53 +0100 Subject: [PATCH 1/7] Fix for co-existence of QtDeclarative and QtQml As a follow-up to commit 2f87fde9bb4bad6787101c0d135419b350b201a5, we also need to change "hack" in the QGraphicsItem and QWidget destructor for early item destruction to support the _qml1 variant of the QObject destroyed callback. Task-number: QTBUG-35006 Change-Id: I65e37b1e9ddd8d14267aaba024408611b8cd3d77 Reviewed-by: Lars Knoll --- src/widgets/graphicsview/qgraphicsitem.cpp | 5 ++++- src/widgets/kernel/qwidget.cpp | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/widgets/graphicsview/qgraphicsitem.cpp b/src/widgets/graphicsview/qgraphicsitem.cpp index 7cab132a2e8..fffc8056377 100644 --- a/src/widgets/graphicsview/qgraphicsitem.cpp +++ b/src/widgets/graphicsview/qgraphicsitem.cpp @@ -1414,7 +1414,10 @@ QGraphicsItem::~QGraphicsItem() QObjectPrivate *p = QObjectPrivate::get(o); p->wasDeleted = true; if (p->declarativeData) { - QAbstractDeclarativeData::destroyed(p->declarativeData, o); + if (QAbstractDeclarativeData::destroyed) + QAbstractDeclarativeData::destroyed(p->declarativeData, o); + if (QAbstractDeclarativeData::destroyed_qml1) + QAbstractDeclarativeData::destroyed_qml1(p->declarativeData, o); p->declarativeData = 0; } } diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index 1da0be97817..421ce570966 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -1464,7 +1464,10 @@ QWidget::~QWidget() } if (d->declarativeData) { - QAbstractDeclarativeData::destroyed(d->declarativeData, this); + if (QAbstractDeclarativeData::destroyed) + QAbstractDeclarativeData::destroyed(d->declarativeData, this); + if (QAbstractDeclarativeData::destroyed_qml1) + QAbstractDeclarativeData::destroyed_qml1(d->declarativeData, this); d->declarativeData = 0; // don't activate again in ~QObject } From 939a001c3ac33ebf801d2594ac9073da28d09a46 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Tue, 26 Nov 2013 10:13:04 +0100 Subject: [PATCH 2/7] Android: Remove invalid error message All usage of context menus prints out an error message because onContextMenuClosed() is called more than once. We just return silently instead if the method is called after the menu has already been closed. Change-Id: Ifa27ed42d188fdf670f09c4b1450b9fec0d5941f Reviewed-by: BogDan Vatra --- .../jar/src/org/qtproject/qt5/android/QtActivityDelegate.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java b/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java index 3dcffeb07d0..3bcd6eaea3a 100644 --- a/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java +++ b/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java @@ -858,10 +858,8 @@ public class QtActivityDelegate public void onContextMenuClosed(Menu menu) { - if (!m_contextMenuVisible) { - Log.e(QtNative.QtTAG, "invalid onContextMenuClosed call"); + if (!m_contextMenuVisible) return; - } m_contextMenuVisible = false; QtNative.onContextMenuClosed(menu); } From 08f3177fdfc9aefbd4232dcd1529b537b2ca9402 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Mon, 25 Nov 2013 13:41:49 +0100 Subject: [PATCH 3/7] CoreWLan: Fix potential unhandled exception assert -[QNSListener notificationHandler:] was declared as not taking any parameter, but used as taking a single NSNotification. This would lead to an 'unrecognized selector' exception raised by Cocoa. Task-number: QTBUG-26844 Change-Id: I56d03a7738c2a1b9dcf3cdecc696b01e65d7b233 Reviewed-by: Liang Qi --- src/plugins/bearer/corewlan/qcorewlanengine.mm | 5 +++-- src/plugins/bearer/corewlan/qcorewlanengine_10_6.mm | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/plugins/bearer/corewlan/qcorewlanengine.mm b/src/plugins/bearer/corewlan/qcorewlanengine.mm index b0ed4076daa..dc2920360d1 100644 --- a/src/plugins/bearer/corewlan/qcorewlanengine.mm +++ b/src/plugins/bearer/corewlan/qcorewlanengine.mm @@ -71,7 +71,7 @@ extern "C" { // Otherwise it won't find CWKeychain* symbols at link time QCoreWlanEngine *engine; NSLock *locker; } -- (void)notificationHandler;//:(NSNotification *)notification; +- (void)notificationHandler:(NSNotification *)notification; - (void)remove; - (void)setEngine:(QCoreWlanEngine *)coreEngine; - (QCoreWlanEngine *)engine; @@ -120,8 +120,9 @@ extern "C" { // Otherwise it won't find CWKeychain* symbols at link time [locker unlock]; } -- (void)notificationHandler//:(NSNotification *)notification +- (void)notificationHandler:(NSNotification *)notification { + Q_UNUSED(notification); engine->requestUpdate(); } @end diff --git a/src/plugins/bearer/corewlan/qcorewlanengine_10_6.mm b/src/plugins/bearer/corewlan/qcorewlanengine_10_6.mm index 1b95ae29ad6..7044e9696bb 100644 --- a/src/plugins/bearer/corewlan/qcorewlanengine_10_6.mm +++ b/src/plugins/bearer/corewlan/qcorewlanengine_10_6.mm @@ -48,7 +48,7 @@ QCoreWlanEngine *engine; NSLock *locker; } -- (void)notificationHandler;//:(NSNotification *)notification; +- (void)notificationHandler:(NSNotification *)notification; - (void)remove; - (void)setEngine:(QCoreWlanEngine *)coreEngine; - (QCoreWlanEngine *)engine; @@ -97,8 +97,9 @@ [locker unlock]; } -- (void)notificationHandler//:(NSNotification *)notification +- (void)notificationHandler:(NSNotification *)notification { + Q_UNUSED(notification); engine->requestUpdate(); } @end From f03fd0d82a50361c0b89165b3f8d98d66b0a4e16 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Tue, 26 Nov 2013 15:06:20 +0100 Subject: [PATCH 4/7] Remove leading '/' from target paths. This is inappropriate on Windows, and breaks non-prefix builds there. This is only needed when we calculate a relative path from a sysroot, so only add it in that case. Task-number: QTBUG-34880 Change-Id: I0e3b3d977a7b56649e4ba0077ac574aabf1dc915 Reviewed-by: Oswald Buddenhagen Reviewed-by: Stephen Kelly --- mkspecs/features/cmake_functions.prf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mkspecs/features/cmake_functions.prf b/mkspecs/features/cmake_functions.prf index a9b0c86cade..1e6b05c78e9 100644 --- a/mkspecs/features/cmake_functions.prf +++ b/mkspecs/features/cmake_functions.prf @@ -27,9 +27,9 @@ defineReplace(cmakeModuleList) { defineReplace(cmakeTargetPath) { SYSR = $$[QT_SYSROOT] - !isEmpty(SYSR): path = $$relative_path($$1, $$[QT_SYSROOT]) + !isEmpty(SYSR): path = /$$relative_path($$1, $$[QT_SYSROOT]) else: path = $$1 - return($$clean_path(/$$path)) + return($$clean_path($$path)) } defineReplace(cmakeTargetPaths) { From 94c17dce04c7726afbdd6ac67c569eedc629a81a Mon Sep 17 00:00:00 2001 From: Frank Osterfeld Date: Fri, 22 Nov 2013 10:43:49 +0100 Subject: [PATCH 5/7] QNX: Fix retrieving the window group name The code assumes that there is a root window, and crashed otherwise. Task-number: QTBUG-35121 Change-Id: Idbf0e0bfc03cd427f0aab81db88b34fe94228c81 Reviewed-by: Rafael Roquetto --- src/plugins/platforms/qnx/qqnxnativeinterface.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/plugins/platforms/qnx/qqnxnativeinterface.cpp b/src/plugins/platforms/qnx/qqnxnativeinterface.cpp index 8958a5c1e26..24af5c26835 100644 --- a/src/plugins/platforms/qnx/qqnxnativeinterface.cpp +++ b/src/plugins/platforms/qnx/qqnxnativeinterface.cpp @@ -52,11 +52,13 @@ QT_BEGIN_NAMESPACE void *QQnxNativeInterface::nativeResourceForWindow(const QByteArray &resource, QWindow *window) { if (resource == "windowGroup" && window && window->screen()) { - const QQnxScreen * const screen = static_cast(window->screen()->handle()); + QQnxScreen * const screen = static_cast(window->screen()->handle()); if (screen) { + screen_window_t screenWindow = reinterpret_cast(window->winId()); + QQnxWindow *qnxWindow = screen->findWindow(screenWindow); // We can't just call data() instead of constData() here, since that would detach // and the lifetime of the char * would not be long enough. Therefore the const_cast. - return const_cast(screen->rootWindow()->groupName().constData()); + return qnxWindow ? const_cast(qnxWindow->groupName().constData()) : 0; } } From 4fbe50e77a8d24d42581cdeabd1e93cb993b0d8d Mon Sep 17 00:00:00 2001 From: Yoann Lopes Date: Fri, 22 Nov 2013 18:45:49 +0100 Subject: [PATCH 6/7] Revert "Store the font's scalability in QFontEngine." This reverts commit 65b12fbdb13d34c61bcadd5cc8fd6ee28a8dfafd. QFontEngine is not always loaded from QFontDatabase, resulting in the flag not being set. Change-Id: I39bc5bd4a8dea153d191cfc55f4324195f75f64c Reviewed-by: Konstantin Ritt Reviewed-by: Mitch Curtis Reviewed-by: Lars Knoll --- src/gui/text/qfontdatabase_qpa.cpp | 1 - src/gui/text/qfontengine.cpp | 3 +-- src/gui/text/qfontengine_p.h | 2 -- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/gui/text/qfontdatabase_qpa.cpp b/src/gui/text/qfontdatabase_qpa.cpp index fddbb11122a..6c0be950dc9 100644 --- a/src/gui/text/qfontdatabase_qpa.cpp +++ b/src/gui/text/qfontdatabase_qpa.cpp @@ -184,7 +184,6 @@ QFontEngine *loadSingleEngine(int script, if (!engine) { engine = pfdb->fontEngine(def, QChar::Script(script), size->handle); if (engine) { - engine->smoothScalable = style->smoothScalable; QFontCache::Key key(def,script); QFontCache::instance()->instance()->insertEngine(key,engine); } diff --git a/src/gui/text/qfontengine.cpp b/src/gui/text/qfontengine.cpp index 7d1afbbfb65..303c85ce75b 100644 --- a/src/gui/text/qfontengine.cpp +++ b/src/gui/text/qfontengine.cpp @@ -208,8 +208,7 @@ Q_AUTOTEST_EXPORT QList QFontEngine_stopCollectingEngines() QFontEngine::QFontEngine() : ref(0), font_(0), font_destroy_func(0), - face_(0), face_destroy_func(0), - smoothScalable(false) + face_(0), face_destroy_func(0) { cache_cost = 0; fsType = 0; diff --git a/src/gui/text/qfontengine_p.h b/src/gui/text/qfontengine_p.h index 07be498764e..c181d61d738 100644 --- a/src/gui/text/qfontengine_p.h +++ b/src/gui/text/qfontengine_p.h @@ -302,8 +302,6 @@ public: inline QVariant userData() const { return m_userData; } - bool smoothScalable; - protected: QFixed lastRightBearing(const QGlyphLayout &glyphs, bool round = false); From 82a2d28d841c7f59fa76fae6a67e1712a5fb4740 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Wed, 27 Nov 2013 12:22:54 +0100 Subject: [PATCH 7/7] CMake: Parse the output of new CMake versions. As of CMake 3.0, the output of `cmake --version` now has a second line showing that it is maintained by Kitware. Change the version parsing to look only at the first line of output. Change-Id: I347de4c376e0bde25a43a38d59587d9b63f6b43a Reviewed-by: Oswald Buddenhagen --- mkspecs/features/ctest_testcase_common.prf | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mkspecs/features/ctest_testcase_common.prf b/mkspecs/features/ctest_testcase_common.prf index 118eed1e94b..a9461eb4ae3 100644 --- a/mkspecs/features/ctest_testcase_common.prf +++ b/mkspecs/features/ctest_testcase_common.prf @@ -1,10 +1,11 @@ win32 { - CMAKE_VERSION = $$system(cmake --version 2>NUL) + CMAKE_VERSION = $$system(cmake --version 2>NUL, lines) } else { - CMAKE_VERSION = $$system(cmake --version 2>/dev/null) + CMAKE_VERSION = $$system(cmake --version 2>/dev/null, lines) } +CMAKE_VERSION = $$member(CMAKE_VERSION, 0, 0) check.commands = QMAKE_EXTRA_TARGETS *= check