From a2b31cd5db6410144a613142a7b60f0cd2ba2b1d Mon Sep 17 00:00:00 2001 From: Kirill Burtsev Date: Tue, 19 Feb 2019 15:21:58 +0100 Subject: [PATCH 1/5] 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 2/5] 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 3/5] 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 1be070a2bef8b85caa5722ede60092b6038b13e6 Mon Sep 17 00:00:00 2001 From: Mikhail Svetkin Date: Tue, 22 Jan 2019 14:49:34 +0100 Subject: [PATCH 4/5] 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 00cfb4d7801ec9b5d9b070879ef4a962390628b7 Mon Sep 17 00:00:00 2001 From: Andre de la Rocha Date: Mon, 18 Feb 2019 16:16:23 +0100 Subject: [PATCH 5/5] 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;