From d241616e412c9f33fbc4bffce8811aaab79313dd Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 13 Sep 2018 22:57:30 -0700 Subject: [PATCH 1/5] AVX512 test: an intrinsic that GCC forgot to implement prior to GCC8 _mm512_mask_cvtepi32_storeu_epi8 is VPMOVDB (convert from 32-bit to 8-bit with truncation) where the destination is a memory address, with an OpMask register used to indicate which of the lanes in the vector to store. Similarly, _mm512_mask_cvtepi16_storeu_epi8 is VPMOVWB (convert from 16-bit o 8-bit), which is useful for UTF-16 to Latin1 conversion. Change-Id: I8f261579aad648fdb4f0fffd15542ea306841ce6 Reviewed-by: Allan Sandfeld Jensen --- config.tests/avx512/avx512.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/config.tests/avx512/avx512.cpp b/config.tests/avx512/avx512.cpp index 29e88ebf153..4d47db84634 100644 --- a/config.tests/avx512/avx512.cpp +++ b/config.tests/avx512/avx512.cpp @@ -65,6 +65,10 @@ int main(int, char**argv) d = _mm512_loadu_pd((double *)argv + 64); f = _mm512_loadu_ps((float *)argv + 128); + // some intrinsic that GCC forgot until GCC 8 + i = _mm512_maskz_set1_epi32(m, '?'); + _mm512_mask_cvtepi32_storeu_epi8(argv, m, i); + #ifdef WANT_AVX512ER /* AVX512 Exponential and Reciprocal */ f = _mm512_exp2a23_round_ps(f, 8); @@ -84,6 +88,7 @@ int main(int, char**argv) #ifdef WANT_AVX512BW /* AVX512 Byte and Word support */ i = _mm512_mask_loadu_epi8(i, m, argv - 8); + _mm512_mask_cvtepi16_storeu_epi8(argv + 8, m, i); #endif #ifdef WANT_AVX512VL /* AVX512 Vector Length */ From 232fe3ab6a2eb0585c77c0aee4769493ba23c35a Mon Sep 17 00:00:00 2001 From: Gatis Paeglis Date: Tue, 28 Aug 2018 16:54:14 +0200 Subject: [PATCH 2/5] doc: add note about QAbstractEventDispatcher::wakeUp() for {Unix,Glib} Task-number: QTBUG-70229 Change-Id: I3efc20baf0cfeb79834f3f2b7aa5a4cb049542f6 Reviewed-by: Thiago Macieira --- src/corelib/kernel/qabstracteventdispatcher.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/corelib/kernel/qabstracteventdispatcher.cpp b/src/corelib/kernel/qabstracteventdispatcher.cpp index 304a7bda082..655fe58f98d 100644 --- a/src/corelib/kernel/qabstracteventdispatcher.cpp +++ b/src/corelib/kernel/qabstracteventdispatcher.cpp @@ -309,6 +309,15 @@ int QAbstractEventDispatcher::registerTimer(int interval, Qt::TimerType timerTyp Wakes up the event loop. + \omit + ### FIXME - QTBUG-70229 + On Unix and Glib event dispatchers, if the dispatcher is already awake when + this function is called, it is ensured that the current iteration won't block + waiting for more events, but will instead do another event loop iteration. + + ### TODO - does other event dispatchers behave the same? + \endomit + \sa awake() */ From b7a123a6eed359c362d35247dbf16e963b2f1d0d Mon Sep 17 00:00:00 2001 From: Paul Wicking Date: Thu, 13 Sep 2018 15:14:44 +0200 Subject: [PATCH 3/5] Doc: Remove outdated and unmaintained examples These examples are outdated and unmaintained, and have not been included in the documentation for a long time. Removing the files to avoid further confusion. Task-number: QTBUG-59249 Change-Id: I3e4c535219cc6b40f3add5430c0967eba2c80eb9 Reviewed-by: Martin Smith --- doc/src/examples/bearermonitor.qdoc | 35 ------- doc/src/examples/customtypesending.qdoc | 121 ------------------------ doc/src/examples/dbus-chat.qdoc | 36 ------- doc/src/examples/digiflip.qdoc | 31 ------ doc/src/examples/flickable.qdoc | 33 ------- doc/src/examples/flightinfo.qdoc | 33 ------- doc/src/examples/htmlinfo.qdoc | 68 ------------- doc/src/examples/lightmaps.qdoc | 33 ------- doc/src/examples/raycasting.qdoc | 33 ------- doc/src/examples/rsslisting.qdoc | 36 ------- doc/src/examples/styleexample.qdoc | 33 ------- 11 files changed, 492 deletions(-) delete mode 100644 doc/src/examples/bearermonitor.qdoc delete mode 100644 doc/src/examples/customtypesending.qdoc delete mode 100644 doc/src/examples/dbus-chat.qdoc delete mode 100644 doc/src/examples/digiflip.qdoc delete mode 100644 doc/src/examples/flickable.qdoc delete mode 100644 doc/src/examples/flightinfo.qdoc delete mode 100644 doc/src/examples/htmlinfo.qdoc delete mode 100644 doc/src/examples/lightmaps.qdoc delete mode 100644 doc/src/examples/raycasting.qdoc delete mode 100644 doc/src/examples/rsslisting.qdoc delete mode 100644 doc/src/examples/styleexample.qdoc diff --git a/doc/src/examples/bearermonitor.qdoc b/doc/src/examples/bearermonitor.qdoc deleted file mode 100644 index ab68f99a7b4..00000000000 --- a/doc/src/examples/bearermonitor.qdoc +++ /dev/null @@ -1,35 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Free Documentation License Usage -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: https://www.gnu.org/licenses/fdl-1.3.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \example bearermonitor - \title Bearer Monitor Example - - The Bearer Monitor example shows how to use the Bearer Management API. - - \image bearermonitor-example.png Screenshot of the Bearer Monitor example -*/ diff --git a/doc/src/examples/customtypesending.qdoc b/doc/src/examples/customtypesending.qdoc deleted file mode 100644 index 9fd64b42fd4..00000000000 --- a/doc/src/examples/customtypesending.qdoc +++ /dev/null @@ -1,121 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Free Documentation License Usage -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: https://www.gnu.org/licenses/fdl-1.3.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \example tools/customtypesending - \title Custom Type Sending Example - - The Custom Type Sending example shows how to use a custom type with signals - and slots. - - \image customtypesending-example.png - - \section1 Overview - - In the \l{Custom Type Example}, we showed how to integrate custom types - with the meta-object system, enabling them to be stored in QVariant - objects, written out in debugging information and used in signal-slot - communication. - - In this example, we demonstrate that the preparations made to the - \c Message class and its declaration with Q_DECLARE_METATYPE() enable it - to be used with direct signal-slot connections. We do this by creating - a \c Window class containing signals and slots whose signatures include - \c Message arguments. - - \section1 The Window and Message Class Definitions - - We define a simple \c Window class with a signal and public slot that - allow a \c Message object to be sent via a signal-slot connection: - - \snippet examples/tools/customtypesending/window.h Window class definition - - The window will contain a text editor to show the contents of a message - and a push button that the user can click to send a message. To facilitate - this, we also define the \c sendMessage() slot. We also keep a \c Message - instance in the \c thisMessage private variable which holds the actual - message to be sent. - - The \c Message class is defined in the following way: - - \snippet examples/tools/customtypesending/message.h custom type definition - - The type is declared to the meta-type system with the Q_DECLARE_METATYPE() - macro: - - \snippet examples/tools/customtypesending/message.h custom type meta-type declaration - - This will make the type available for use in direct signal-slot connections. - - \section1 The Window Class Implementation - - The \c Window constructor sets up a user interface containing a text - editor and a push button. - - \snippet examples/tools/customtypesending/window.cpp Window constructor - - The button's \l{QPushButton::}{clicked()} signal is connected to the - window's \c{sendMessage()} slot, which emits the \c{messageSent(Message)} - signal with the \c Message held by the \c thisMessage variable: - - \snippet examples/tools/customtypesending/window.cpp sending a message - - We implement a slot to allow the message to be received, and this also - lets us set the message in the window programatically: - - \snippet examples/tools/customtypesending/window.cpp receiving a message - - In this function, we simply assign the new message to \c thisMessage - and update the text in the editor. - - \section1 Making the Connection - - In the example's \c{main()} function, we perform the connection between - two instances of the \c Window class: - - \snippet examples/tools/customtypesending/main.cpp main function - - We set the message for the first window and connect the - \c{messageSent(Message)} signal from each window to the other's - \c{setMessage(Message)} slot. Since the signals and slots mechanism is only - concerned with the type, we can simplify the signatures of both the - signal and slot when we make the connection. - - When the user clicks on the \uicontrol{Send message} button in either window, - the message shown will be emitted in a signal that the other window will - receive and display. - - \section1 Further Reading - - Although the custom \c Message type can be used with direct signals and - slots, an additional registration step needs to be performed if you want - to use it with queued signal-slot connections. See the - \l{Queued Custom Type Example} for details. - - More information on using custom types with Qt can be found in the - \l{Creating Custom Qt Types} document. -*/ diff --git a/doc/src/examples/dbus-chat.qdoc b/doc/src/examples/dbus-chat.qdoc deleted file mode 100644 index 703d4eef507..00000000000 --- a/doc/src/examples/dbus-chat.qdoc +++ /dev/null @@ -1,36 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Free Documentation License Usage -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: https://www.gnu.org/licenses/fdl-1.3.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \example dbus/dbus-chat - \title D-Bus Chat Example - - The D-Bus Chat example shows how to use D-Bus to communicate between two - applications. - - \image dbus-chat-example.png -*/ diff --git a/doc/src/examples/digiflip.qdoc b/doc/src/examples/digiflip.qdoc deleted file mode 100644 index 174b807a05d..00000000000 --- a/doc/src/examples/digiflip.qdoc +++ /dev/null @@ -1,31 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Free Documentation License Usage -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: https://www.gnu.org/licenses/fdl-1.3.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \example embedded/digiflip - \title Digiflip -*/ diff --git a/doc/src/examples/flickable.qdoc b/doc/src/examples/flickable.qdoc deleted file mode 100644 index f289f421c3a..00000000000 --- a/doc/src/examples/flickable.qdoc +++ /dev/null @@ -1,33 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Free Documentation License Usage -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: https://www.gnu.org/licenses/fdl-1.3.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \example embedded/flickable - \title Flickable List - - \image flickable-demo.png -*/ diff --git a/doc/src/examples/flightinfo.qdoc b/doc/src/examples/flightinfo.qdoc deleted file mode 100644 index 7e5162eb0ef..00000000000 --- a/doc/src/examples/flightinfo.qdoc +++ /dev/null @@ -1,33 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Free Documentation License Usage -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: https://www.gnu.org/licenses/fdl-1.3.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \example embedded/flightinfo - \title Flight Info - - \image flightinfo-demo.png -*/ diff --git a/doc/src/examples/htmlinfo.qdoc b/doc/src/examples/htmlinfo.qdoc deleted file mode 100644 index 8397a287159..00000000000 --- a/doc/src/examples/htmlinfo.qdoc +++ /dev/null @@ -1,68 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Free Documentation License Usage -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: https://www.gnu.org/licenses/fdl-1.3.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \example xml/htmlinfo - \title XML HTML Info Example - - The XML HTML Info example provides a simple command line utility that - scans the current directory for HTML files and prints statistics about - them to standard out. - - The files are parsed using a QXmlStreamReader object. If the file does - not contain a well-formed XML document, a description of the error is - printed to the standard error console. - - \section1 Basic Operation - - The main function of the example uses QDir to access files in the current - directory that match either "*.htm" or "*.html". For each file found, - the \c parseHtmlFile() function is called. - - Reading XML is handled by an instance of the QXmlStreamReader class, which - operates on the input file object: - - \snippet examples/xml/htmlinfo/main.cpp 0 - - The work of parsing and the XML and extracting statistics is done in a - while loop, and is driven by input from the reader: - - \snippet examples/xml/htmlinfo/main.cpp 1 - - If more input is available, the next token from the input file is read - and parsed. The program then looks for the specific element types, - "title", "a", and "p", and stores information about them. - - When there is no more input, the loop terminates. If an error occurred, - information is written to the standard out file via a stream, and the - example exits: - - \snippet examples/xml/htmlinfo/main.cpp 2 - - If no error occurred, the example prints some statistics from the data - gathered in the loop, and then exits. -*/ diff --git a/doc/src/examples/lightmaps.qdoc b/doc/src/examples/lightmaps.qdoc deleted file mode 100644 index c9f1fd664f3..00000000000 --- a/doc/src/examples/lightmaps.qdoc +++ /dev/null @@ -1,33 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Free Documentation License Usage -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: https://www.gnu.org/licenses/fdl-1.3.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \example embedded/lightmaps - \title Light Maps - - \image lightmaps-demo.png -*/ diff --git a/doc/src/examples/raycasting.qdoc b/doc/src/examples/raycasting.qdoc deleted file mode 100644 index 16c1b7a754e..00000000000 --- a/doc/src/examples/raycasting.qdoc +++ /dev/null @@ -1,33 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Free Documentation License Usage -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: https://www.gnu.org/licenses/fdl-1.3.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \example embedded/raycasting - \title Ray Casting - - \image raycasting-demo.png -*/ diff --git a/doc/src/examples/rsslisting.qdoc b/doc/src/examples/rsslisting.qdoc deleted file mode 100644 index 6ca22ce5b5b..00000000000 --- a/doc/src/examples/rsslisting.qdoc +++ /dev/null @@ -1,36 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Free Documentation License Usage -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: https://www.gnu.org/licenses/fdl-1.3.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \example xml/rsslisting - \title RSS-Listing Example - - The RSS-Listing example shows how to create a widget that displays news items - from RDF news sources. - - \image rsslistingexample.png -*/ diff --git a/doc/src/examples/styleexample.qdoc b/doc/src/examples/styleexample.qdoc deleted file mode 100644 index 6294800cef6..00000000000 --- a/doc/src/examples/styleexample.qdoc +++ /dev/null @@ -1,33 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Free Documentation License Usage -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: https://www.gnu.org/licenses/fdl-1.3.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \example embedded/styleexample - \title Embedded Styles - - \image styledemo-demo.png -*/ From f30bf5fbd58c3fd67a98a1c759b63f24fbab8a41 Mon Sep 17 00:00:00 2001 From: Morten Kristensen Date: Tue, 18 Sep 2018 15:23:19 +0200 Subject: [PATCH 4/5] Fix shortcuts in dock widgets with custom title bar MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit QWidgetResizeHandler cannot be sure that it will see the MouseReleaseEvent and therefore buttonDown could be set wrong (and is set wrong in QGraphicsViews). When the mouse is up, the widget should not think it is moving or re-sizing the dock widget. A similar fix exists in the code a few lines above. Task-number: QTBUG-70596 Change-Id: I52ce487836bc71da8fd7d71f8a89e21b51406d00 Reviewed-by: Sérgio Martins Reviewed-by: Christian Ehrlicher Reviewed-by: Thorbjørn Lund Martsum Reviewed-by: Richard Moe Gustavsen --- src/widgets/widgets/qwidgetresizehandler.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/widgets/widgets/qwidgetresizehandler.cpp b/src/widgets/widgets/qwidgetresizehandler.cpp index 45010d1768e..7ed6f6d78d9 100644 --- a/src/widgets/widgets/qwidgetresizehandler.cpp +++ b/src/widgets/widgets/qwidgetresizehandler.cpp @@ -192,6 +192,7 @@ bool QWidgetResizeHandler::eventFilter(QObject *o, QEvent *ee) keyPressEvent(static_cast(ee)); break; case QEvent::ShortcutOverride: + buttonDown &= ((QGuiApplication::mouseButtons() & Qt::LeftButton) != Qt::NoButton); if (buttonDown) { ee->accept(); return true; From 2e94947c5602800b540fdabbb9c058a63f13e9d0 Mon Sep 17 00:00:00 2001 From: Timur Pocheptsov Date: Thu, 20 Sep 2018 13:22:09 +0200 Subject: [PATCH 5/5] qnsview_key/qnsview_mouse make Ctrl+left click work again MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A result of typo/incorrect keyboard modifiers extracted + wrong button sent via QWindowSystemInterface::handleMouseEvent. Task-number: QTBUG-70512 Change-Id: I809168e363496884312412051e8d435f5794b3be Reviewed-by: Tor Arne Vestbø --- src/plugins/platforms/cocoa/qnsview_keys.mm | 2 +- src/plugins/platforms/cocoa/qnsview_mouse.mm | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/plugins/platforms/cocoa/qnsview_keys.mm b/src/plugins/platforms/cocoa/qnsview_keys.mm index 85c0607265b..28db532ddc5 100644 --- a/src/plugins/platforms/cocoa/qnsview_keys.mm +++ b/src/plugins/platforms/cocoa/qnsview_keys.mm @@ -47,7 +47,7 @@ Qt::KeyboardModifiers qtMods =Qt::NoModifier; if (modifierFlags & NSEventModifierFlagShift) qtMods |= Qt::ShiftModifier; - if (modifierFlags & NSEventModifierFlagShift) + if (modifierFlags & NSEventModifierFlagControl) qtMods |= dontSwapCtrlAndMeta ? Qt::ControlModifier : Qt::MetaModifier; if (modifierFlags & NSEventModifierFlagOption) qtMods |= Qt::AltModifier; diff --git a/src/plugins/platforms/cocoa/qnsview_mouse.mm b/src/plugins/platforms/cocoa/qnsview_mouse.mm index 468f26ffb42..3d6471005dd 100644 --- a/src/plugins/platforms/cocoa/qnsview_mouse.mm +++ b/src/plugins/platforms/cocoa/qnsview_mouse.mm @@ -198,7 +198,9 @@ const auto modifiers = [QNSView convertKeyModifiers:theEvent.modifierFlags]; const auto buttons = currentlyPressedMouseButtons(); - const auto button = cocoaButton2QtButton(theEvent); + auto button = cocoaButton2QtButton(theEvent); + if (button == Qt::LeftButton && m_sendUpAsRightButton) + button = Qt::RightButton; const auto eventType = cocoaEvent2QtMouseEvent(theEvent); QWindowSystemInterface::handleMouseEvent(targetView->m_platformWindow->window(), @@ -266,12 +268,14 @@ if (m_sendUpAsRightButton && button == Qt::LeftButton) button = Qt::RightButton; - if (button == Qt::RightButton) - m_sendUpAsRightButton = false; m_buttons &= ~button; [self handleMouseEvent:theEvent]; + + if (button == Qt::RightButton) + m_sendUpAsRightButton = false; + return true; }