From 8c10255e377c38a8655c733dc527674b1f5cb3da Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Wed, 23 Jan 2019 16:31:35 +0100 Subject: [PATCH 01/10] Add conversion to and from long and ulong This implements conversion parity with QString, which can convert to and from long and unsigned long. The implementation simply forwards to existing long long overloads or uses the existing helpers, so just as for the conversion to/from int or short, no additional test cases were added. Change-Id: I37ef06d9ce4d80d98bd72720353996bac723e09c Fixes: QTBUG-782 Reviewed-by: Volker Hilsheimer (cherry picked from commit 783953f09dcfe9c58dc991394535ba07dabe2560) Reviewed-by: Edward Welbourne --- src/corelib/tools/qlocale.cpp | 126 +++++++++++++++++++++++++++++++++ src/corelib/tools/qlocale.h | 12 ++++ src/corelib/tools/qlocale.qdoc | 24 +++++++ 3 files changed, 162 insertions(+) diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp index b3fb0793421..ebb6c97975f 100644 --- a/src/corelib/tools/qlocale.cpp +++ b/src/corelib/tools/qlocale.cpp @@ -1332,6 +1332,48 @@ uint QLocale::toUInt(const QString &s, bool *ok) const return toIntegral_helper(d, s, ok); } +/*! + Returns the long int represented by the localized string \a s. + + If the conversion fails the function returns 0. + + If \a ok is not \c nullptr, failure is reported by setting *\a{ok} + to \c false, and success by setting *\a{ok} to \c true. + + This function ignores leading and trailing whitespace. + + \sa toInt(), toULong(), toDouble(), toString() + + \since 5.13 + */ + + +long QLocale::toLong(const QString &s, bool *ok) const +{ + return toIntegral_helper(d, s, ok); +} + +/*! + Returns the unsigned long int represented by the localized + string \a s. + + If the conversion fails the function returns 0. + + If \a ok is not \c nullptr, failure is reported by setting *\a{ok} + to \c false, and success by setting *\a{ok} to \c true. + + This function ignores leading and trailing whitespace. + + \sa toLong(), toInt(), toDouble(), toString() + + \since 5.13 +*/ + +ulong QLocale::toULong(const QString &s, bool *ok) const +{ + return toIntegral_helper(d, s, ok); +} + /*! Returns the long long int represented by the localized string \a s. @@ -1499,6 +1541,48 @@ uint QLocale::toUInt(const QStringRef &s, bool *ok) const return toIntegral_helper(d, s, ok); } +/*! + Returns the long int represented by the localized string \a s. + + If the conversion fails the function returns 0. + + If \a ok is not \c nullptr, failure is reported by setting *\a{ok} + to \c false, and success by setting *\a{ok} to \c true. + + This function ignores leading and trailing whitespace. + + \sa toInt(), toULong(), toDouble(), toString() + + \since 5.13 + */ + + +long QLocale::toLong(const QStringRef &s, bool *ok) const +{ + return toIntegral_helper(d, s, ok); +} + +/*! + Returns the unsigned long int represented by the localized + string \a s. + + If the conversion fails the function returns 0. + + If \a ok is not \c nullptr, failure is reported by setting *\a{ok} + to \c false, and success by setting *\a{ok} to \c true. + + This function ignores leading and trailing whitespace. + + \sa toLong(), toInt(), toDouble(), toString() + + \since 5.13 + */ + +ulong QLocale::toULong(const QStringRef &s, bool *ok) const +{ + return toIntegral_helper(d, s, ok); +} + /*! Returns the long long int represented by the localized string \a s. @@ -1675,6 +1759,48 @@ uint QLocale::toUInt(QStringView s, bool *ok) const return toIntegral_helper(d, s, ok); } +/*! + Returns the long int represented by the localized string \a s. + + If the conversion fails the function returns 0. + + If \a ok is not \c nullptr, failure is reported by setting *\a{ok} + to \c false, and success by setting *\a{ok} to \c true. + + This function ignores leading and trailing whitespace. + + \sa toInt(), toULong(), toDouble(), toString() + + \since 5.13 + */ + + +long QLocale::toLong(QStringView s, bool *ok) const +{ + return toIntegral_helper(d, s, ok); +} + +/*! + Returns the unsigned long int represented by the localized + string \a s. + + If the conversion fails the function returns 0. + + If \a ok is not \c nullptr, failure is reported by setting *\a{ok} + to \c false, and success by setting *\a{ok} to \c true. + + This function ignores leading and trailing whitespace. + + \sa toLong(), toInt(), toDouble(), toString() + + \since 5.13 + */ + +ulong QLocale::toULong(QStringView s, bool *ok) const +{ + return toIntegral_helper(d, s, ok); +} + /*! Returns the long long int represented by the localized string \a s. diff --git a/src/corelib/tools/qlocale.h b/src/corelib/tools/qlocale.h index 1fbd96c6d53..2b4f1315525 100644 --- a/src/corelib/tools/qlocale.h +++ b/src/corelib/tools/qlocale.h @@ -961,6 +961,8 @@ public: ushort toUShort(const QString &s, bool *ok = nullptr) const; int toInt(const QString &s, bool *ok = nullptr) const; uint toUInt(const QString &s, bool *ok = nullptr) const; + long toLong(const QString &s, bool *ok = nullptr) const; + ulong toULong(const QString &s, bool *ok = nullptr) const; qlonglong toLongLong(const QString &s, bool *ok = nullptr) const; qulonglong toULongLong(const QString &s, bool *ok = nullptr) const; float toFloat(const QString &s, bool *ok = nullptr) const; @@ -970,6 +972,8 @@ public: ushort toUShort(const QStringRef &s, bool *ok = nullptr) const; int toInt(const QStringRef &s, bool *ok = nullptr) const; uint toUInt(const QStringRef &s, bool *ok = nullptr) const; + long toLong(const QStringRef &s, bool *ok = nullptr) const; + ulong toULong(const QStringRef &s, bool *ok = nullptr) const; qlonglong toLongLong(const QStringRef &s, bool *ok = nullptr) const; qulonglong toULongLong(const QStringRef &s, bool *ok = nullptr) const; float toFloat(const QStringRef &s, bool *ok = nullptr) const; @@ -980,6 +984,8 @@ public: ushort toUShort(QStringView s, bool *ok = nullptr) const; int toInt(QStringView s, bool *ok = nullptr) const; uint toUInt(QStringView s, bool *ok = nullptr) const; + long toLong(QStringView s, bool *ok = nullptr) const; + ulong toULong(QStringView s, bool *ok = nullptr) const; qlonglong toLongLong(QStringView s, bool *ok = nullptr) const; qulonglong toULongLong(QStringView s, bool *ok = nullptr) const; float toFloat(QStringView s, bool *ok = nullptr) const; @@ -987,6 +993,8 @@ public: QString toString(qlonglong i) const; QString toString(qulonglong i) const; + inline QString toString(long i) const; + inline QString toString(ulong i) const; inline QString toString(short i) const; inline QString toString(ushort i) const; inline QString toString(int i) const; @@ -1107,6 +1115,10 @@ private: Q_DECLARE_SHARED(QLocale) Q_DECLARE_OPERATORS_FOR_FLAGS(QLocale::NumberOptions) +inline QString QLocale::toString(long i) const + { return toString(qlonglong(i)); } +inline QString QLocale::toString(ulong i) const + { return toString(qulonglong(i)); } inline QString QLocale::toString(short i) const { return toString(qlonglong(i)); } inline QString QLocale::toString(ushort i) const diff --git a/src/corelib/tools/qlocale.qdoc b/src/corelib/tools/qlocale.qdoc index b852c10b8dc..91b0ab64423 100644 --- a/src/corelib/tools/qlocale.qdoc +++ b/src/corelib/tools/qlocale.qdoc @@ -1163,6 +1163,30 @@ currency string. */ +/*! +\fn QString QLocale::toString(long i) const + +\overload + +\sa toLong() +*/ + +/*! +\fn QString QLocale::toString(ulong i) const + +\overload + +\sa toULong() +*/ + +/*! +\fn QString QLocale::toString(ushort i) const + +\overload + +\sa toUShort() +*/ + /*! \fn QString QLocale::toString(short i) const From a2b31cd5db6410144a613142a7b60f0cd2ba2b1d Mon Sep 17 00:00:00 2001 From: Kirill Burtsev Date: Tue, 19 Feb 2019 15:21:58 +0100 Subject: [PATCH 02/10] Fix build for size with gcc Fixes the error: variable 'isDifferent' set but not used Change-Id: Ibd60b17126057da64a41d325b7ef548316f27c4b Reviewed-by: Edward Welbourne Reviewed-by: Thiago Macieira --- src/corelib/tools/qstring.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index 63d44eb39ce..d8bfb69a8bd 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -1047,6 +1047,7 @@ static int ucstrncmp(const QChar *a, const uchar *c, size_t l) __m128i nullmask = _mm_setzero_si128(); qptrdiff offset = 0; +# if !defined(__OPTIMIZE_SIZE__) // Using the PMOVMSKB instruction, we get two bits for each character // we compare. int retval; @@ -1059,6 +1060,7 @@ static int ucstrncmp(const QChar *a, const uchar *c, size_t l) retval = uc[offset + idx / 2] - c[offset + idx / 2]; return true; }; +# endif // we're going to read uc[offset..offset+15] (32 bytes) // and c[offset..offset+15] (16 bytes) From 1e0395f73e624bf9d40f508acd3da08294006947 Mon Sep 17 00:00:00 2001 From: Eirik Aavitsland Date: Thu, 7 Feb 2019 12:18:07 +0100 Subject: [PATCH 03/10] Fix assert when drawing lines with extreme coordinates For extreme coordinates, the rasterizer's width parameter could become NaN, which compares false with everything and hence would trigger an assert. Fixes: QTBUG-56434 Change-Id: I27abae6ab0bc94ce042be86ea0587095cdb7d487 Reviewed-by: Allan Sandfeld Jensen --- src/gui/painting/qrasterizer.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/gui/painting/qrasterizer.cpp b/src/gui/painting/qrasterizer.cpp index 52501880e44..b4014272f46 100644 --- a/src/gui/painting/qrasterizer.cpp +++ b/src/gui/painting/qrasterizer.cpp @@ -755,11 +755,9 @@ static inline int qSafeFloatToQ16Dot16(qreal x) void QRasterizer::rasterizeLine(const QPointF &a, const QPointF &b, qreal width, bool squareCap) { - if (a == b || width == 0 || d->clipRect.isEmpty()) + if (a == b || !(width > 0.0) || d->clipRect.isEmpty()) return; - Q_ASSERT(width > 0.0); - QPointF pa = a; QPointF pb = b; From b56cfce73288263624f490c06215fad1026297b4 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 14 Feb 2019 11:03:17 -0800 Subject: [PATCH 04/10] Make the qfloat16tables.cpp depend on the executable, not the command qtPrepareTool could return a more complex command-line in the variable, for some reason. So declare the dependency on the actual executable only. Change-Id: Id061f35c088044b69a15fffd1583504f25936a7a Reviewed-by: Oswald Buddenhagen Reviewed-by: Joerg Bornemann --- src/corelib/global/global.pri | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/global/global.pri b/src/corelib/global/global.pri index a4d132a4f44..029357ff43e 100644 --- a/src/corelib/global/global.pri +++ b/src/corelib/global/global.pri @@ -131,7 +131,7 @@ qtPrepareTool(QMAKE_QFLOAT16_TABLES, qfloat16-tables) qfloat16_tables.commands = $$QMAKE_QFLOAT16_TABLES ${QMAKE_FILE_OUT} qfloat16_tables.output = global/qfloat16tables.cpp -qfloat16_tables.depends = $$QMAKE_QFLOAT16_TABLES +qfloat16_tables.depends = $$QMAKE_QFLOAT16_TABLES_EXE qfloat16_tables.input = QMAKE_QFLOAT16_TABLES_GENERATE qfloat16_tables.variable_out = SOURCES QMAKE_EXTRA_COMPILERS += qfloat16_tables From 241533962c56e79fe6809bfa81e3ffb34850942c Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Fri, 22 Feb 2019 15:58:11 +0100 Subject: [PATCH 05/10] Add ### Qt6 comment requested in code-review Task-number: QTBUG-73484 Change-Id: I7c1c5faf3d32fa21d8d2277ec434084450290156 Reviewed-by: Thiago Macieira --- src/dbus/qdbusargument.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/dbus/qdbusargument.h b/src/dbus/qdbusargument.h index ac650d5f62f..94a89a4e08d 100644 --- a/src/dbus/qdbusargument.h +++ b/src/dbus/qdbusargument.h @@ -158,6 +158,7 @@ QT_END_NAMESPACE Q_DECLARE_METATYPE(QDBusArgument) QT_BEGIN_NAMESPACE +// ### Qt6: remove the defaulted T * = nullptr from these two (MSVC6 work-around): template inline T qdbus_cast(const QDBusArgument &arg, T * = nullptr) { T item; From 79644952f7e6e44e20820ffde5e974d7254329c7 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Wed, 20 Feb 2019 10:30:58 +0100 Subject: [PATCH 06/10] Revise download location for pcre2 in its qt_attribution.json file Changed DownloadLocation to match the version claimed in Version, 10.32, rather than the 10.31 tar-ball's URL. Task-number: QTBUG-72623 Change-Id: Id3e17085ea9bb0a854c95e4dce7f472cc38923ed Reviewed-by: Thiago Macieira --- src/3rdparty/pcre2/qt_attribution.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/3rdparty/pcre2/qt_attribution.json b/src/3rdparty/pcre2/qt_attribution.json index 828c4e8314b..72f04e7c06e 100644 --- a/src/3rdparty/pcre2/qt_attribution.json +++ b/src/3rdparty/pcre2/qt_attribution.json @@ -8,7 +8,7 @@ "Description": "The PCRE library is a set of functions that implement regular expression pattern matching using the same syntax and semantics as Perl 5.", "Homepage": "http://www.pcre.org/", "Version": "10.32", - "DownloadLocation": "https://ftp.pcre.org/pub/pcre/pcre2-10.31.tar.bz2", + "DownloadLocation": "https://ftp.pcre.org/pub/pcre/pcre2-10.32.tar.bz2", "License": "BSD 3-clause \"New\" or \"Revised\" License", "LicenseId": "BSD-3-Clause", "LicenseFile": "LICENCE", @@ -27,7 +27,7 @@ Copyright (c) 2013-2013 Tilera Corporation (jiwang@tilera.com)" "Description": "The PCRE library is a set of functions that implement regular expression pattern matching using the same syntax and semantics as Perl 5.", "Homepage": "http://www.pcre.org/", "Version": "10.32", - "DownloadLocation": "https://ftp.pcre.org/pub/pcre/pcre2-10.31.tar.bz2", + "DownloadLocation": "https://ftp.pcre.org/pub/pcre/pcre2-10.32.tar.bz2", "License": "BSD 2-clause \"Simplified\" License", "LicenseId": "BSD-2-Clause", "LicenseFile": "LICENCE-SLJIT", From 1be070a2bef8b85caa5722ede60092b6038b13e6 Mon Sep 17 00:00:00 2001 From: Mikhail Svetkin Date: Tue, 22 Jan 2019 14:49:34 +0100 Subject: [PATCH 07/10] qtlite: Fix build the source code with -no-feature-shortcut Change-Id: If47149466a5da901e3eb6e6f2dcfb0a7816bc60b Reviewed-by: Gatis Paeglis --- .../xdgdesktopportal/qxdgdesktopportaltheme.cpp | 2 ++ .../platformthemes/xdgdesktopportal/qxdgdesktopportaltheme.h | 2 ++ src/testlib/qtestkeyboard.h | 4 ++++ 3 files changed, 8 insertions(+) diff --git a/src/plugins/platformthemes/xdgdesktopportal/qxdgdesktopportaltheme.cpp b/src/plugins/platformthemes/xdgdesktopportal/qxdgdesktopportaltheme.cpp index f07ca3f0986..fb65f6d9096 100644 --- a/src/plugins/platformthemes/xdgdesktopportal/qxdgdesktopportaltheme.cpp +++ b/src/plugins/platformthemes/xdgdesktopportal/qxdgdesktopportaltheme.cpp @@ -185,11 +185,13 @@ QIconEngine * QXdgDesktopPortalTheme::createIconEngine(const QString &iconName) return d->baseTheme->createIconEngine(iconName); } +#if QT_CONFIG(shortcut) QList QXdgDesktopPortalTheme::keyBindings(QKeySequence::StandardKey key) const { Q_D(const QXdgDesktopPortalTheme); return d->baseTheme->keyBindings(key); } +#endif QString QXdgDesktopPortalTheme::standardButtonText(int button) const { diff --git a/src/plugins/platformthemes/xdgdesktopportal/qxdgdesktopportaltheme.h b/src/plugins/platformthemes/xdgdesktopportal/qxdgdesktopportaltheme.h index b72e6764192..4c5f4745956 100644 --- a/src/plugins/platformthemes/xdgdesktopportal/qxdgdesktopportaltheme.h +++ b/src/plugins/platformthemes/xdgdesktopportal/qxdgdesktopportaltheme.h @@ -76,7 +76,9 @@ public: QIconEngine *createIconEngine(const QString &iconName) const override; +#if QT_CONFIG(shortcut) QList keyBindings(QKeySequence::StandardKey key) const override; +#endif QString standardButtonText(int button) const override; diff --git a/src/testlib/qtestkeyboard.h b/src/testlib/qtestkeyboard.h index 63501ffb1e9..e8a7e0d5f5e 100644 --- a/src/testlib/qtestkeyboard.h +++ b/src/testlib/qtestkeyboard.h @@ -166,6 +166,7 @@ namespace QTest Q_DECL_UNUSED inline static void keyPress(QWindow *window, Qt::Key key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1) { keyEvent(Press, window, key, modifier, delay); } +#if QT_CONFIG(shortcut) Q_DECL_UNUSED inline static void keySequence(QWindow *window, const QKeySequence &keySequence) { for (int i = 0; i < keySequence.count(); ++i) { @@ -174,6 +175,7 @@ namespace QTest keyClick(window, key, modifiers); } } +#endif #ifdef QT_WIDGETS_LIB static void simulateEvent(QWidget *widget, bool press, int code, @@ -305,6 +307,7 @@ namespace QTest inline static void keyClick(QWidget *widget, Qt::Key key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1) { keyEvent(Click, widget, key, modifier, delay); } +#if QT_CONFIG(shortcut) inline static void keySequence(QWidget *widget, const QKeySequence &keySequence) { for (int i = 0; i < keySequence.count(); ++i) { @@ -313,6 +316,7 @@ namespace QTest keyClick(widget, key, modifiers); } } +#endif #endif // QT_WIDGETS_LIB From 85b0ce8ca36d52db71b519ee8d2a1ce369c53a81 Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Mon, 25 Feb 2019 13:54:26 +0100 Subject: [PATCH 08/10] Fix can not -> cannot Change-Id: Ie9992f67ca59aff662a4be046ace08640e7c2714 Reviewed-by: Paul Wicking --- src/3rdparty/angle/src/libANGLE/validationES.cpp | 2 +- src/corelib/Qt5CoreMacros.cmake | 2 +- src/corelib/global/qlogging.cpp | 2 +- src/corelib/io/qiodevice.cpp | 2 +- src/corelib/itemmodels/qabstractitemmodel.cpp | 4 ++-- src/corelib/itemmodels/qidentityproxymodel.cpp | 2 +- src/corelib/kernel/qcore_mac_objc.mm | 2 +- src/corelib/kernel/qeventdispatcher_unix.cpp | 2 +- src/corelib/kernel/qobject.cpp | 2 +- src/corelib/tools/qarraydata.cpp | 2 +- src/corelib/tools/qsharedpointer.cpp | 2 +- src/gui/kernel/qplatformgraphicsbuffer.cpp | 2 +- src/gui/kernel/qwindow.cpp | 4 ++-- src/gui/opengl/qopenglframebufferobject.cpp | 2 +- src/gui/text/qtextdocumentwriter.cpp | 4 ++-- src/gui/text/qtextodfwriter.cpp | 2 +- src/network/access/qnetworkreplyhttpimpl.cpp | 2 +- src/network/bearer/qnetworkconfiguration.cpp | 2 +- src/network/socket/qsocks5socketengine.cpp | 2 +- src/network/ssl/qsslsocket_schannel.cpp | 4 ++-- src/opengl/qglframebufferobject.cpp | 2 +- .../input/evdevkeyboard/qevdevkeyboardhandler.cpp | 2 +- src/plugins/platforms/cocoa/qcocoaglcontext.mm | 2 +- src/plugins/platforms/cocoa/qcocoawindow.mm | 2 +- src/plugins/platforms/cocoa/qnsview_drawing.mm | 2 +- src/testlib/qtestcase.cpp | 2 +- src/widgets/graphicsview/qgraphicsscene.cpp | 2 +- src/widgets/widgets/qabstractspinbox.cpp | 2 +- src/xml/dom/qdom.cpp | 2 +- util/local_database/xpathlite.py | 2 +- 30 files changed, 34 insertions(+), 34 deletions(-) diff --git a/src/3rdparty/angle/src/libANGLE/validationES.cpp b/src/3rdparty/angle/src/libANGLE/validationES.cpp index ae564b74122..069ca045f89 100644 --- a/src/3rdparty/angle/src/libANGLE/validationES.cpp +++ b/src/3rdparty/angle/src/libANGLE/validationES.cpp @@ -3525,7 +3525,7 @@ bool ValidateGetBufferPointervBase(Context *context, if (context->getGLState().getTargetBuffer(target) == nullptr) { context->handleError(InvalidOperation() - << "Can not get pointer for reserved buffer name zero."); + << "Cannot get pointer for reserved buffer name zero."); return false; } diff --git a/src/corelib/Qt5CoreMacros.cmake b/src/corelib/Qt5CoreMacros.cmake index 620795d2cf5..a7b579165ca 100644 --- a/src/corelib/Qt5CoreMacros.cmake +++ b/src/corelib/Qt5CoreMacros.cmake @@ -370,7 +370,7 @@ if (NOT CMAKE_VERSION VERSION_LESS 2.8.9) if (NOT Qt5${_module}_FOUND) find_package(Qt5${_module} PATHS "${_Qt5_COMPONENT_PATH}" NO_DEFAULT_PATH) if (NOT Qt5${_module}_FOUND) - message(FATAL_ERROR "Can not use \"${_module}\" module which has not yet been found.") + message(FATAL_ERROR "Cannot use \"${_module}\" module which has not yet been found.") endif() endif() target_link_libraries(${_target} ${_qt5_link_type} ${Qt5${_module}_LIBRARIES}) diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp index 168934c2028..b2093101fa5 100644 --- a/src/corelib/global/qlogging.cpp +++ b/src/corelib/global/qlogging.cpp @@ -239,7 +239,7 @@ static bool systemHasStderr() \note Qt Creator does not implement a pseudo TTY, nor does it launch apps with the override environment variable set, but it will read stderr and print it to - the user, so in effect this function can not be used to conclude that stderr + the user, so in effect this function cannot be used to conclude that stderr output will _not_ be visible to the user, as even if this function returns false, the output might still end up visible to the user. For this reason, we don't guard the stderr output in the default message handler with stderrHasConsoleAttached(). diff --git a/src/corelib/io/qiodevice.cpp b/src/corelib/io/qiodevice.cpp index 86e21f0a663..74df0f71efe 100644 --- a/src/corelib/io/qiodevice.cpp +++ b/src/corelib/io/qiodevice.cpp @@ -194,7 +194,7 @@ QIODevicePrivate::~QIODevicePrivate() QIODevice provides both a common implementation and an abstract interface for devices that support reading and writing of blocks of data, such as QFile, QBuffer and QTcpSocket. QIODevice is - abstract and can not be instantiated, but it is common to use the + abstract and cannot be instantiated, but it is common to use the interface it defines to provide device-independent I/O features. For example, Qt's XML classes operate on a QIODevice pointer, allowing them to be used with various devices (such as files and diff --git a/src/corelib/itemmodels/qabstractitemmodel.cpp b/src/corelib/itemmodels/qabstractitemmodel.cpp index 75e13ff994f..abd86f2b49c 100644 --- a/src/corelib/itemmodels/qabstractitemmodel.cpp +++ b/src/corelib/itemmodels/qabstractitemmodel.cpp @@ -2329,7 +2329,7 @@ QModelIndex QAbstractItemModel::buddy(const QModelIndex &index) const The way the search is performed is defined by the \a flags given. The list that is returned may be empty. Note also that the order of results in the list may not correspond to the order in the model, if for example a proxy - model is used. The order of the results can not be relied upon. + model is used. The order of the results cannot be relied upon. The search begins from the \a start index, and continues until the number of matching data items equals \a hits, the search reaches the last row, or @@ -2903,7 +2903,7 @@ bool QAbstractItemModelPrivate::allowMove(const QModelIndex &srcParent, int star Note that other rows may be displaced accordingly. Note also that when moving items within the same parent you should not attempt invalid or no-op moves. In - the above example, item 2 is at row 2 before the move, so it can not be moved + the above example, item 2 is at row 2 before the move, so it cannot be moved to row 2 (where it is already) or row 3 (no-op as row 3 means above row 3, where it is already) diff --git a/src/corelib/itemmodels/qidentityproxymodel.cpp b/src/corelib/itemmodels/qidentityproxymodel.cpp index bb928577865..39992eccd34 100644 --- a/src/corelib/itemmodels/qidentityproxymodel.cpp +++ b/src/corelib/itemmodels/qidentityproxymodel.cpp @@ -95,7 +95,7 @@ class QIdentityProxyModelPrivate : public QAbstractProxyModelPrivate need to implement all data handling in the same class that creates the structure of the model, and can also be used to create re-usable components. - This also provides a way to change the data in the case where a source model is supplied by a third party which can not be modified. + This also provides a way to change the data in the case where a source model is supplied by a third party which cannot be modified. \snippet code/src_gui_itemviews_qidentityproxymodel.cpp 0 diff --git a/src/corelib/kernel/qcore_mac_objc.mm b/src/corelib/kernel/qcore_mac_objc.mm index 4550891e2a4..6687eb88a54 100644 --- a/src/corelib/kernel/qcore_mac_objc.mm +++ b/src/corelib/kernel/qcore_mac_objc.mm @@ -501,7 +501,7 @@ void qt_apple_check_os_version() if (!applicationName) applicationName = NSProcessInfo.processInfo.processName; - fprintf(stderr, "Sorry, \"%s\" can not be run on this version of %s. " + fprintf(stderr, "Sorry, \"%s\" cannot be run on this version of %s. " "Qt requires %s %ld.%ld.%ld or later, you have %s %ld.%ld.%ld.\n", applicationName.UTF8String, os, os, long(required.majorVersion), long(required.minorVersion), long(required.patchVersion), diff --git a/src/corelib/kernel/qeventdispatcher_unix.cpp b/src/corelib/kernel/qeventdispatcher_unix.cpp index 535f86fefe5..df0cac02399 100644 --- a/src/corelib/kernel/qeventdispatcher_unix.cpp +++ b/src/corelib/kernel/qeventdispatcher_unix.cpp @@ -225,7 +225,7 @@ int QThreadPipe::check(const pollfd &pfd) QEventDispatcherUNIXPrivate::QEventDispatcherUNIXPrivate() { if (Q_UNLIKELY(threadPipe.init() == false)) - qFatal("QEventDispatcherUNIXPrivate(): Can not continue without a thread pipe"); + qFatal("QEventDispatcherUNIXPrivate(): Cannot continue without a thread pipe"); } QEventDispatcherUNIXPrivate::~QEventDispatcherUNIXPrivate() diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index 77f507ff3fc..e67b2306c23 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -2152,7 +2152,7 @@ void QObject::removeEventFilter(QObject *obj) This signal is emitted immediately before the object \a obj is destroyed, after any instances of QPointer have been notified, - and can not be blocked. + and cannot be blocked. All the objects's children are destroyed immediately after this signal is emitted. diff --git a/src/corelib/tools/qarraydata.cpp b/src/corelib/tools/qarraydata.cpp index a04536b18be..a91d833e3b3 100644 --- a/src/corelib/tools/qarraydata.cpp +++ b/src/corelib/tools/qarraydata.cpp @@ -163,7 +163,7 @@ void QArrayData::deallocate(QArrayData *data, size_t objectSize, #endif Q_ASSERT_X(data == 0 || !data->ref.isStatic(), "QArrayData::deallocate", - "Static data can not be deleted"); + "Static data cannot be deleted"); ::free(data); } diff --git a/src/corelib/tools/qsharedpointer.cpp b/src/corelib/tools/qsharedpointer.cpp index ce0a1ad9cbf..8bc0dc8a74f 100644 --- a/src/corelib/tools/qsharedpointer.cpp +++ b/src/corelib/tools/qsharedpointer.cpp @@ -379,7 +379,7 @@ You can inherit this class when you need to create a QSharedPointer from any instance of a class; for instance, from within the object itself. The key point is that the technique of - just returning QSharedPointer(this) can not be used, because + just returning QSharedPointer(this) cannot be used, because this winds up creating multiple distinct QSharedPointer objects with separate reference counts. For this reason you must never create more than one QSharedPointer from the same raw pointer. diff --git a/src/gui/kernel/qplatformgraphicsbuffer.cpp b/src/gui/kernel/qplatformgraphicsbuffer.cpp index d361a8fc120..73ec033e195 100644 --- a/src/gui/kernel/qplatformgraphicsbuffer.cpp +++ b/src/gui/kernel/qplatformgraphicsbuffer.cpp @@ -184,7 +184,7 @@ void QPlatformGraphicsBuffer::unlock() \fn QPlatformGraphicsBuffer::doLock(AccessTypes access, const QRect &rect = QRect()) This function should be reimplemented by subclasses. If one of the \a - access types specified can not be locked, then all should fail and this + access types specified cannot be locked, then all should fail and this function should return false. \a rect is the subrect which is desired to be locked. This diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp index 0b833cfbc70..3040a203088 100644 --- a/src/gui/kernel/qwindow.cpp +++ b/src/gui/kernel/qwindow.cpp @@ -166,7 +166,7 @@ QWindow::QWindow(QScreen *targetScreen) static QWindow *nonDesktopParent(QWindow *parent) { if (parent && parent->type() == Qt::Desktop) { - qWarning("QWindows can not be reparented into desktop windows"); + qWarning("QWindows cannot be reparented into desktop windows"); return nullptr; } @@ -1351,7 +1351,7 @@ void QWindow::setTransientParent(QWindow *parent) return; } if (parent == this) { - qWarning() << "transient parent" << parent << "can not be same as window"; + qWarning() << "transient parent" << parent << "cannot be same as window"; return; } diff --git a/src/gui/opengl/qopenglframebufferobject.cpp b/src/gui/opengl/qopenglframebufferobject.cpp index cae3d516c45..e7631b09ce0 100644 --- a/src/gui/opengl/qopenglframebufferobject.cpp +++ b/src/gui/opengl/qopenglframebufferobject.cpp @@ -249,7 +249,7 @@ QOpenGLFramebufferObjectFormat::~QOpenGLFramebufferObjectFormat() If the desired amount of samples per pixel is not supported by the hardware then the maximum number of samples per pixel will be used. Note that - multisample framebuffer objects can not be bound as textures. Also, the + multisample framebuffer objects cannot be bound as textures. Also, the \c{GL_EXT_framebuffer_multisample} extension is required to create a framebuffer with more than one sample per pixel. diff --git a/src/gui/text/qtextdocumentwriter.cpp b/src/gui/text/qtextdocumentwriter.cpp index ee72300bc7a..42e623153af 100644 --- a/src/gui/text/qtextdocumentwriter.cpp +++ b/src/gui/text/qtextdocumentwriter.cpp @@ -270,7 +270,7 @@ bool QTextDocumentWriter::write(const QTextDocument *document) #ifndef QT_NO_TEXTHTMLPARSER if (format == "html" || format == "htm") { if (!d->device->isWritable() && ! d->device->open(QIODevice::WriteOnly)) { - qWarning("QTextDocumentWriter::write: the device can not be opened for writing"); + qWarning("QTextDocumentWriter::write: the device cannot be opened for writing"); return false; } QTextStream ts(d->device); @@ -284,7 +284,7 @@ bool QTextDocumentWriter::write(const QTextDocument *document) #endif if (format == "txt" || format == "plaintext") { if (!d->device->isWritable() && ! d->device->open(QIODevice::WriteOnly)) { - qWarning("QTextDocumentWriter::write: the device can not be opened for writing"); + qWarning("QTextDocumentWriter::write: the device cannot be opened for writing"); return false; } QTextStream ts(d->device); diff --git a/src/gui/text/qtextodfwriter.cpp b/src/gui/text/qtextodfwriter.cpp index c8fa5306c37..a62e7e425af 100644 --- a/src/gui/text/qtextodfwriter.cpp +++ b/src/gui/text/qtextodfwriter.cpp @@ -963,7 +963,7 @@ bool QTextOdfWriter::writeAll() m_strategy = new QXmlStreamStrategy(m_device); if (!m_device->isWritable() && ! m_device->open(QIODevice::WriteOnly)) { - qWarning("QTextOdfWriter::writeAll: the device can not be opened for writing"); + qWarning("QTextOdfWriter::writeAll: the device cannot be opened for writing"); return false; } QXmlStreamWriter writer(m_strategy->contentStream); diff --git a/src/network/access/qnetworkreplyhttpimpl.cpp b/src/network/access/qnetworkreplyhttpimpl.cpp index b55ae0ab717..9ae94afc5ab 100644 --- a/src/network/access/qnetworkreplyhttpimpl.cpp +++ b/src/network/access/qnetworkreplyhttpimpl.cpp @@ -1562,7 +1562,7 @@ bool QNetworkReplyHttpImplPrivate::sendCacheContents(const QNetworkCacheMetaData QIODevice *contents = nc->data(url); if (!contents) { #if defined(QNETWORKACCESSHTTPBACKEND_DEBUG) - qDebug() << "Can not send cache, the contents are 0" << url; + qDebug() << "Cannot send cache, the contents are 0" << url; #endif return false; } diff --git a/src/network/bearer/qnetworkconfiguration.cpp b/src/network/bearer/qnetworkconfiguration.cpp index e36903fc94a..f5ced0693aa 100644 --- a/src/network/bearer/qnetworkconfiguration.cpp +++ b/src/network/bearer/qnetworkconfiguration.cpp @@ -518,7 +518,7 @@ QNetworkConfiguration::BearerType QNetworkConfiguration::bearerTypeFamily() cons /*! Returns the type of bearer used by this network configuration as a string. - The string is not translated and therefore can not be shown to the user. The subsequent table + The string is not translated and therefore cannot be shown to the user. The subsequent table shows the fixed mappings between BearerType and the bearer type name for known types. If the BearerType is unknown this function may return additional information if it is available; otherwise an empty string will be returned. diff --git a/src/network/socket/qsocks5socketengine.cpp b/src/network/socket/qsocks5socketengine.cpp index 3e4c35fcc56..23aec123904 100644 --- a/src/network/socket/qsocks5socketengine.cpp +++ b/src/network/socket/qsocks5socketengine.cpp @@ -372,7 +372,7 @@ QSocks5BindData *QSocks5BindStore::retrieve(qintptr socketDescriptor) store.erase(it); if (bindData) { if (bindData->controlSocket->thread() != QThread::currentThread()) { - qWarning("Can not access socks5 bind data from different thread"); + qWarning("Cannot access socks5 bind data from different thread"); return 0; } } else { diff --git a/src/network/ssl/qsslsocket_schannel.cpp b/src/network/ssl/qsslsocket_schannel.cpp index e75f81bd365..1314b432a4b 100644 --- a/src/network/ssl/qsslsocket_schannel.cpp +++ b/src/network/ssl/qsslsocket_schannel.cpp @@ -615,8 +615,8 @@ bool QSslSocketBackendPrivate::acquireCredentialsHandle() nullptr); if (!chainContext) { const QString message = isClient - ? QSslSocket::tr("The certificate provided can not be used for a client.") - : QSslSocket::tr("The certificate provided can not be used for a server."); + ? QSslSocket::tr("The certificate provided cannot be used for a client.") + : QSslSocket::tr("The certificate provided cannot be used for a server."); setErrorAndEmit(QAbstractSocket::SocketError::SslInvalidUserDataError, message); return false; } diff --git a/src/opengl/qglframebufferobject.cpp b/src/opengl/qglframebufferobject.cpp index 0b2ddf97fe5..b2158ebfaa5 100644 --- a/src/opengl/qglframebufferobject.cpp +++ b/src/opengl/qglframebufferobject.cpp @@ -211,7 +211,7 @@ QGLFramebufferObjectFormat::~QGLFramebufferObjectFormat() If the desired amount of samples per pixel is not supported by the hardware then the maximum number of samples per pixel will be used. Note that - multisample framebuffer objects can not be bound as textures. Also, the + multisample framebuffer objects cannot be bound as textures. Also, the \c{GL_EXT_framebuffer_multisample} extension is required to create a framebuffer with more than one sample per pixel. diff --git a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp index ad134a825f8..666613f09d6 100644 --- a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp +++ b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp @@ -557,7 +557,7 @@ bool QEvdevKeyboardHandler::loadKeymap(const QString &file) delete [] qmap_keymap; delete [] qmap_keycompose; - qWarning("Keymap file '%s' can not be loaded.", qPrintable(file)); + qWarning("Keymap file '%s' cannot be loaded.", qPrintable(file)); return false; } diff --git a/src/plugins/platforms/cocoa/qcocoaglcontext.mm b/src/plugins/platforms/cocoa/qcocoaglcontext.mm index 93d95b38eaa..fe1fc31553d 100644 --- a/src/plugins/platforms/cocoa/qcocoaglcontext.mm +++ b/src/plugins/platforms/cocoa/qcocoaglcontext.mm @@ -86,7 +86,7 @@ QCocoaGLContext::QCocoaGLContext(QOpenGLContext *context) } m_context = nativeHandle.value().context(); if (!m_context) { - qCWarning(lcQpaOpenGLContext, "QCocoaNativeContext's NSOpenGLContext can not be null"); + qCWarning(lcQpaOpenGLContext, "QCocoaNativeContext's NSOpenGLContext cannot be null"); return; } diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index ff2c4de9852..298d11fe08d 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -619,7 +619,7 @@ void QCocoaWindow::applyWindowState(Qt::WindowStates requestedState) if (nsWindow.styleMask & NSWindowStyleMaskUtilityWindow && newState & (Qt::WindowMinimized | Qt::WindowFullScreen)) { - qWarning() << window()->type() << "windows can not be made" << newState; + qWarning() << window()->type() << "windows cannot be made" << newState; handleWindowStateChanged(HandleUnconditionally); return; } diff --git a/src/plugins/platforms/cocoa/qnsview_drawing.mm b/src/plugins/platforms/cocoa/qnsview_drawing.mm index e9af90a45c1..6db5ed8bad6 100644 --- a/src/plugins/platforms/cocoa/qnsview_drawing.mm +++ b/src/plugins/platforms/cocoa/qnsview_drawing.mm @@ -106,7 +106,7 @@ "_q_mac_wantsLayer", "QT_MAC_WANTS_LAYER"); if (wantsLayer != -1 && [self layerEnabledByMacOS]) { - qCWarning(lcQpaDrawing) << "Layer-backing can not be explicitly controlled on 10.14 when built against the 10.14 SDK"; + qCWarning(lcQpaDrawing) << "Layer-backing cannot be explicitly controlled on 10.14 when built against the 10.14 SDK"; return true; } diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp index 840b4071e2d..3ee8094ddf8 100644 --- a/src/testlib/qtestcase.cpp +++ b/src/testlib/qtestcase.cpp @@ -2311,7 +2311,7 @@ void QTest::addColumnInternal(int id, const char *name) */ QTestData &QTest::newRow(const char *dataTag) { - QTEST_ASSERT_X(dataTag, "QTest::newRow()", "Data tag can not be null"); + QTEST_ASSERT_X(dataTag, "QTest::newRow()", "Data tag cannot be null"); QTestTable *tbl = QTestTable::currentTestTable(); QTEST_ASSERT_X(tbl, "QTest::newRow()", "Cannot add testdata outside of a _data slot."); QTEST_ASSERT_X(tbl->elementCount(), "QTest::newRow()", "Must add columns before attempting to add rows."); diff --git a/src/widgets/graphicsview/qgraphicsscene.cpp b/src/widgets/graphicsview/qgraphicsscene.cpp index a60c2872aeb..c517198a237 100644 --- a/src/widgets/graphicsview/qgraphicsscene.cpp +++ b/src/widgets/graphicsview/qgraphicsscene.cpp @@ -1923,7 +1923,7 @@ void QGraphicsScene::setBspTreeDepth(int depth) QGraphicsSceneBspTreeIndex *bspTree = qobject_cast(d->index); if (!bspTree) { - qWarning("QGraphicsScene::setBspTreeDepth: can not apply if indexing method is not BSP"); + qWarning("QGraphicsScene::setBspTreeDepth: cannot apply if indexing method is not BSP"); return; } bspTree->setBspTreeDepth(depth); diff --git a/src/widgets/widgets/qabstractspinbox.cpp b/src/widgets/widgets/qabstractspinbox.cpp index 00ac5034e95..6a35dbe2745 100644 --- a/src/widgets/widgets/qabstractspinbox.cpp +++ b/src/widgets/widgets/qabstractspinbox.cpp @@ -688,7 +688,7 @@ QLineEdit *QAbstractSpinBox::lineEdit() const \fn void QAbstractSpinBox::setLineEdit(QLineEdit *lineEdit) Sets the line edit of the spinbox to be \a lineEdit instead of the - current line edit widget. \a lineEdit can not be 0. + current line edit widget. \a lineEdit cannot be 0. QAbstractSpinBox takes ownership of the new lineEdit diff --git a/src/xml/dom/qdom.cpp b/src/xml/dom/qdom.cpp index a1f4d57da69..cffc1974afd 100644 --- a/src/xml/dom/qdom.cpp +++ b/src/xml/dom/qdom.cpp @@ -5183,7 +5183,7 @@ QDomNodePrivate* QDomTextPrivate::cloneNode(bool deep) QDomTextPrivate* QDomTextPrivate::splitText(int offset) { if (!parent()) { - qWarning("QDomText::splitText The node has no parent. So I can not split"); + qWarning("QDomText::splitText The node has no parent. So I cannot split"); return 0; } diff --git a/util/local_database/xpathlite.py b/util/local_database/xpathlite.py index b3f83255695..218135d7a75 100644 --- a/util/local_database/xpathlite.py +++ b/util/local_database/xpathlite.py @@ -257,7 +257,7 @@ def findEntry(base, path, draft=None, attribute=None): if result: return result if not aliaspath: - raise Error("findEntry: fatal error: %s: can not find key %s" % (filename, path)) + raise Error("findEntry: fatal error: %s: cannot find key %s" % (filename, path)) path = aliaspath return result From 00cfb4d7801ec9b5d9b070879ef4a962390628b7 Mon Sep 17 00:00:00 2001 From: Andre de la Rocha Date: Mon, 18 Feb 2019 16:16:23 +0100 Subject: [PATCH 09/10] Windows QPA: Generate proper event when dragging item outside window When an item was dragged outside the window, the mouse release event was not being properly delivered and the item would stick to mouse cursor after moving it back into the window. Fixes: QTBUG-72994 Change-Id: Ibce990390c866e16d58f7d969673dd05e862d97e Reviewed-by: Oliver Wolff Reviewed-by: Friedemann Kleint --- .../platforms/windows/qwindowsdrag.cpp | 25 +++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/src/plugins/platforms/windows/qwindowsdrag.cpp b/src/plugins/platforms/windows/qwindowsdrag.cpp index 95d1fc8b7d0..322865b0f34 100644 --- a/src/plugins/platforms/windows/qwindowsdrag.cpp +++ b/src/plugins/platforms/windows/qwindowsdrag.cpp @@ -49,6 +49,7 @@ #include "qwindowswindow.h" #include "qwindowsmousehandler.h" #include "qwindowscursor.h" +#include "qwindowskeymapper.h" #include #include @@ -205,6 +206,9 @@ static inline Qt::MouseButtons toQtMouseButtons(DWORD keyState) return buttons; } +static Qt::KeyboardModifiers lastModifiers = Qt::NoModifier; +static Qt::MouseButtons lastButtons = Qt::NoButton; + /*! \class QWindowsOleDropSource \brief Implementation of IDropSource @@ -403,7 +407,7 @@ QWindowsOleDropSource::QueryContinueDrag(BOOL fEscapePressed, DWORD grfKeyState) case DRAGDROP_S_DROP: case DRAGDROP_S_CANCEL: if (!m_windowUnderMouse.isNull() && m_mode != TouchDrag && fEscapePressed == FALSE - && buttons != QGuiApplicationPrivate::mouse_buttons) { + && buttons != lastButtons) { // QTBUG 66447: Synthesize a mouse release to the window under mouse at // start of the DnD operation as Windows does not send any. const QPoint globalPos = QWindowsCursor::mousePosition(); @@ -503,13 +507,14 @@ void QWindowsOleDropTarget::handleDrag(QWindow *window, DWORD grfKeyState, QWindowsDrag *windowsDrag = QWindowsDrag::instance(); const Qt::DropActions actions = translateToQDragDropActions(*pdwEffect); - const Qt::KeyboardModifiers keyboardModifiers = toQtKeyboardModifiers(grfKeyState); - const Qt::MouseButtons mouseButtons = toQtMouseButtons(grfKeyState); + + lastModifiers = toQtKeyboardModifiers(grfKeyState); + lastButtons = toQtMouseButtons(grfKeyState); const QPlatformDragQtResponse response = QWindowSystemInterface::handleDrag(window, windowsDrag->dropData(), m_lastPoint, actions, - mouseButtons, keyboardModifiers); + lastButtons, lastModifiers); m_answerRect = response.answerRect(); const Qt::DropAction action = response.acceptedAction(); @@ -521,7 +526,7 @@ void QWindowsOleDropTarget::handleDrag(QWindow *window, DWORD grfKeyState, *pdwEffect = m_chosenEffect; qCDebug(lcQpaMime) << __FUNCTION__ << m_window << windowsDrag->dropData() << " supported actions=" << actions - << " mods=" << keyboardModifiers << " mouse=" << mouseButtons + << " mods=" << lastModifiers << " mouse=" << lastButtons << " accepted: " << response.isAccepted() << action << m_answerRect << " effect" << *pdwEffect; } @@ -572,6 +577,9 @@ QWindowsOleDropTarget::DragLeave() qCDebug(lcQpaMime) << __FUNCTION__ << ' ' << m_window; + lastModifiers = QWindowsKeyMapper::queryKeyboardModifiers(); + lastButtons = QWindowsMouseHandler::queryMouseButtons(); + QWindowSystemInterface::handleDrag(m_window, nullptr, QPoint(), Qt::IgnoreAction, Qt::NoButton, Qt::NoModifier); @@ -598,12 +606,15 @@ QWindowsOleDropTarget::Drop(LPDATAOBJECT pDataObj, DWORD grfKeyState, QWindowsDrag *windowsDrag = QWindowsDrag::instance(); + lastModifiers = toQtKeyboardModifiers(grfKeyState); + lastButtons = toQtMouseButtons(grfKeyState); + const QPlatformDropQtResponse response = QWindowSystemInterface::handleDrop(m_window, windowsDrag->dropData(), m_lastPoint, translateToQDragDropActions(*pdwEffect), - toQtMouseButtons(grfKeyState), - toQtKeyboardModifiers(grfKeyState)); + lastButtons, + lastModifiers); m_lastKeyState = grfKeyState; From bc107d81004a5f3929f30088f4a58a221bea5c3b Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Mon, 25 Feb 2019 13:33:18 +0100 Subject: [PATCH 10/10] Allow QML plugin to specify import name explicitly For creating the qmlplugindump rule we need the name of the import. So far we're trying to derive this from the directory name, but that becomes complicated if versions are included, like QtQuick/Controls.2/Fusion Instead of trying to tweak the regexp even more to capture this, we now allow a plugin to set it's name explicitly via IMPORT_NAME. Change-Id: Ie75dae7d41398b3ac19ccb6910002b6fad009891 Reviewed-by: Joerg Bornemann --- mkspecs/features/qml_plugin.prf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mkspecs/features/qml_plugin.prf b/mkspecs/features/qml_plugin.prf index ad8ecdf5f1a..02068ae766d 100644 --- a/mkspecs/features/qml_plugin.prf +++ b/mkspecs/features/qml_plugin.prf @@ -94,7 +94,7 @@ load(qt_common) } load(resolve_target) - TARGETPATHBASE = $$replace(TARGETPATH, \\.\\d+\$, ) + isEmpty(IMPORT_NAME): IMPORT_NAME = $$replace(TARGETPATH, \\.\\d+\$, ) !qml1_target { isEmpty(QMAKE_PLUGINDUMP_DEPENDENCIES_FILE):exists($$_PRO_FILE_PWD_/dependencies.json): \ @@ -104,7 +104,7 @@ load(qt_common) } qmltypes.target = qmltypes - qmltypes.commands = $$QMLPLUGINDUMP -nonrelocatable $$QMAKE_QMLPLUGINDUMP_FLAGS $$replace(TARGETPATHBASE, /, .) $$IMPORT_VERSION > $$QMLTYPEFILE + qmltypes.commands = $$QMLPLUGINDUMP -nonrelocatable $$QMAKE_QMLPLUGINDUMP_FLAGS $$replace(IMPORT_NAME, /, .) $$IMPORT_VERSION > $$QMLTYPEFILE qmltypes.depends = $$QMAKE_RESOLVED_TARGET } else { qmltypes.CONFIG += recursive