summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.qmake.conf2
-rw-r--r--config.tests/qpa/integrityfb/integrityfb.cpp46
-rw-r--r--config.tests/qpa/integrityfb/integrityfb.pro3
-rw-r--r--config.tests/qpa/integrityhid/integrityhid.cpp52
-rw-r--r--config.tests/qpa/integrityhid/integrityhid.pro2
-rw-r--r--configure.json2
-rw-r--r--examples/gui/gui.pro2
-rw-r--r--examples/network/googlesuggest/googlesuggest.cpp2
-rw-r--r--examples/touch/fingerpaint/scribblearea.cpp9
-rw-r--r--examples/widgets/dialogs/licensewizard/licensewizard.cpp7
-rw-r--r--examples/widgets/doc/src/icons.qdoc4
-rw-r--r--examples/widgets/graphicsview/boxes/3rdparty/fbm.c2
-rw-r--r--examples/widgets/graphicsview/chip/view.cpp7
-rw-r--r--examples/widgets/itemviews/pixelator/mainwindow.cpp7
-rw-r--r--examples/widgets/itemviews/spreadsheet/spreadsheet.cpp9
-rw-r--r--examples/widgets/mainwindows/dockwidgets/mainwindow.cpp7
-rw-r--r--examples/widgets/painting/fontsampler/mainwindow.cpp9
-rw-r--r--examples/widgets/painting/fontsampler/mainwindow.h2
-rw-r--r--examples/widgets/richtext/orderform/mainwindow.cpp7
-rw-r--r--examples/widgets/richtext/textedit/textedit.cpp13
-rw-r--r--examples/widgets/widgets.pro2
-rw-r--r--examples/widgets/widgets/imageviewer/imageviewer.cpp7
-rw-r--r--examples/widgets/widgets/scribble/scribblearea.cpp9
-rw-r--r--mkspecs/common/ghs-integrity-armv8.conf27
-rw-r--r--mkspecs/devices/integrity-armv8-drive-cx/qmake.conf39
-rw-r--r--mkspecs/devices/integrity-armv8-drive-cx/qplatformdefs.h45
-rw-r--r--mkspecs/features/file_copies.prf5
-rw-r--r--mkspecs/features/moc.prf4
-rw-r--r--mkspecs/features/qt_configure.prf4
-rw-r--r--mkspecs/features/win32/idcidl.prf9
-rw-r--r--mkspecs/features/winrt/default_pre.prf2
-rw-r--r--qmake/generators/makefile.cpp26
-rw-r--r--qmake/generators/unix/unixmake.cpp8
-rw-r--r--qmake/generators/win32/msvc_objectmodel.cpp8
-rw-r--r--qmake/generators/win32/winmakefile.cpp5
-rw-r--r--qmake/main.cpp29
-rw-r--r--src/3rdparty/sqlite/qt_attribution.json2
-rw-r--r--src/3rdparty/sqlite/sqlite3.c171
-rw-r--r--src/3rdparty/sqlite/sqlite3.h14
-rw-r--r--src/android/jar/src/org/qtproject/qt5/android/QtNative.java16
-rw-r--r--src/corelib/animation/qabstractanimation.cpp1
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_io_qdiriterator.cpp9
-rw-r--r--src/corelib/global/qglobal.cpp6
-rw-r--r--src/corelib/global/qnamespace.qdoc10
-rw-r--r--src/corelib/global/qprocessordetection.h9
-rw-r--r--src/corelib/io/qdiriterator.cpp6
-rw-r--r--src/corelib/io/qfile.cpp4
-rw-r--r--src/corelib/io/qfiledevice.cpp4
-rw-r--r--src/corelib/io/qfilesystemwatcher.cpp1
-rw-r--r--src/corelib/io/qfilesystemwatcher_inotify.cpp2
-rw-r--r--src/corelib/io/qfilesystemwatcher_polling.cpp3
-rw-r--r--src/corelib/io/qiodevice.cpp4
-rw-r--r--src/corelib/io/qnoncontiguousbytedevice.cpp1
-rw-r--r--src/corelib/io/qsavefile.cpp4
-rw-r--r--src/corelib/io/qsettings.cpp4
-rw-r--r--src/corelib/io/qstandardpaths.cpp4
-rw-r--r--src/corelib/io/qstorageinfo_unix.cpp6
-rw-r--r--src/corelib/io/qtemporarydir.cpp10
-rw-r--r--src/corelib/io/qtemporaryfile.cpp4
-rw-r--r--src/corelib/io/qtextstream.cpp3
-rw-r--r--src/corelib/itemmodels/qabstractitemmodel.cpp2
-rw-r--r--src/corelib/itemmodels/qitemselectionmodel.cpp35
-rw-r--r--src/corelib/itemmodels/qstringlistmodel.cpp2
-rw-r--r--src/corelib/kernel/qabstracteventdispatcher.cpp2
-rw-r--r--src/corelib/kernel/qcoreapplication.cpp4
-rw-r--r--src/corelib/kernel/qcoreevent.cpp2
-rw-r--r--src/corelib/kernel/qeventdispatcher_glib.cpp2
-rw-r--r--src/corelib/kernel/qeventdispatcher_unix.cpp2
-rw-r--r--src/corelib/kernel/qeventdispatcher_win.cpp4
-rw-r--r--src/corelib/kernel/qeventloop.cpp2
-rw-r--r--src/corelib/kernel/qmimedata.cpp2
-rw-r--r--src/corelib/kernel/qobject_p.h1
-rw-r--r--src/corelib/kernel/qobjectcleanuphandler.cpp2
-rw-r--r--src/corelib/kernel/qobjectdefs_impl.h4
-rw-r--r--src/corelib/kernel/qsharedmemory.cpp2
-rw-r--r--src/corelib/kernel/qsocketnotifier.cpp2
-rw-r--r--src/corelib/kernel/qtimer.cpp1
-rw-r--r--src/corelib/kernel/qtranslator.cpp2
-rw-r--r--src/corelib/plugin/qfactoryloader.cpp2
-rw-r--r--src/corelib/plugin/qlibrary.cpp2
-rw-r--r--src/corelib/plugin/qpluginloader.cpp1
-rw-r--r--src/corelib/statemachine/qabstractstate.cpp2
-rw-r--r--src/corelib/statemachine/qabstracttransition.cpp2
-rw-r--r--src/corelib/statemachine/qeventtransition.cpp2
-rw-r--r--src/corelib/statemachine/qfinalstate.cpp2
-rw-r--r--src/corelib/statemachine/qhistorystate.cpp3
-rw-r--r--src/corelib/statemachine/qsignaltransition.cpp2
-rw-r--r--src/corelib/statemachine/qstate.cpp2
-rw-r--r--src/corelib/thread/qfuturewatcher.cpp2
-rw-r--r--src/corelib/thread/qthread.cpp2
-rw-r--r--src/corelib/thread/qthreadpool.cpp2
-rw-r--r--src/corelib/tools/qcryptographichash.cpp4
-rw-r--r--src/corelib/tools/qeasingcurve.cpp2
-rw-r--r--src/corelib/tools/qhash.h28
-rw-r--r--src/corelib/tools/qlocale.cpp13
-rw-r--r--src/corelib/tools/qscopedpointer.cpp2
-rw-r--r--src/corelib/tools/qtimeline.cpp2
-rw-r--r--src/gui/configure.json23
-rw-r--r--src/gui/image/image.pri6
-rw-r--r--src/gui/image/qmovie.cpp4
-rw-r--r--src/gui/image/qmovie.h7
-rw-r--r--src/gui/kernel/qguiapplication.cpp13
-rw-r--r--src/gui/kernel/qwindowsysteminterface.cpp3
-rw-r--r--src/gui/painting/qpainterpath.cpp33
-rw-r--r--src/gui/text/qtextlayout.cpp6
-rw-r--r--src/network/access/qhttp2protocolhandler.cpp8
-rw-r--r--src/network/doc/src/bearermanagement.qdoc29
-rw-r--r--src/network/socket/qnativesocketengine_winrt.cpp246
-rw-r--r--src/network/socket/qnativesocketengine_winrt_p.h71
-rw-r--r--src/network/ssl/qsslcertificate.cpp5
-rw-r--r--src/network/ssl/qsslsocket_openssl_symbols.cpp11
-rw-r--r--src/platformsupport/eglconvenience/qt_egl_p.h6
-rw-r--r--src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp9
-rw-r--r--src/platformsupport/fontdatabases/mac/coretext.pri14
-rw-r--r--src/platformsupport/input/input.pro4
-rw-r--r--src/platformsupport/input/integrityhid/integrityhid.pri7
-rw-r--r--src/platformsupport/input/integrityhid/qintegrityhidmanager.cpp263
-rw-r--r--src/platformsupport/input/integrityhid/qintegrityhidmanager.h69
-rw-r--r--src/platformsupport/platformsupport.pro2
-rw-r--r--src/plugins/platforms/android/androidjniclipboard.cpp23
-rw-r--r--src/plugins/platforms/android/androidjniclipboard.h5
-rw-r--r--src/plugins/platforms/android/qandroidplatformclipboard.cpp2
-rw-r--r--src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm2
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.h1
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.mm96
-rw-r--r--src/plugins/platforms/cocoa/qnsview.mm60
-rw-r--r--src/plugins/platforms/eglfs/api/qeglfsintegration.cpp8
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp7
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.h1
-rw-r--r--src/plugins/platforms/ios/qiostextresponder.mm11
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.cpp27
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.cpp12
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.h1
-rw-r--r--src/printsupport/dialogs/dialogs.pri62
-rw-r--r--src/printsupport/dialogs/qabstractprintdialog.cpp4
-rw-r--r--src/printsupport/dialogs/qabstractprintdialog.h7
-rw-r--r--src/printsupport/dialogs/qabstractprintdialog_p.h10
-rw-r--r--src/printsupport/dialogs/qpagesetupdialog.cpp4
-rw-r--r--src/printsupport/dialogs/qpagesetupdialog.h7
-rw-r--r--src/printsupport/dialogs/qpagesetupdialog_mac.mm3
-rw-r--r--src/printsupport/dialogs/qpagesetupdialog_p.h6
-rw-r--r--src/printsupport/dialogs/qpagesetupdialog_unix.cpp11
-rw-r--r--src/printsupport/dialogs/qpagesetupdialog_unix_p.h5
-rw-r--r--src/printsupport/dialogs/qpagesetupdialog_win.cpp2
-rw-r--r--src/printsupport/dialogs/qprintdialog.h7
-rw-r--r--src/printsupport/dialogs/qprintdialog_mac.mm4
-rw-r--r--src/printsupport/dialogs/qprintdialog_unix.cpp15
-rw-r--r--src/printsupport/dialogs/qprintdialog_win.cpp4
-rw-r--r--src/printsupport/dialogs/qprintpreviewdialog.cpp6
-rw-r--r--src/printsupport/dialogs/qprintpreviewdialog.h7
-rw-r--r--src/printsupport/doc/snippets/widgetprinting.cpp5
-rw-r--r--src/printsupport/kernel/kernel.pri7
-rw-r--r--src/printsupport/kernel/qcups.cpp4
-rw-r--r--src/printsupport/kernel/qcups_p.h4
-rw-r--r--src/printsupport/kernel/qpaintengine_preview.cpp3
-rw-r--r--src/printsupport/kernel/qpaintengine_preview_p.h4
-rw-r--r--src/printsupport/kernel/qplatformprintdevice.cpp2
-rw-r--r--src/printsupport/kernel/qprint_p.h4
-rw-r--r--src/printsupport/kernel/qprinter.cpp8
-rw-r--r--src/printsupport/kernel/qprinter_p.h6
-rw-r--r--src/printsupport/widgets/qcupsjobwidget.cpp4
-rw-r--r--src/printsupport/widgets/qprintpreviewwidget.cpp4
-rw-r--r--src/printsupport/widgets/qprintpreviewwidget.h3
-rw-r--r--src/printsupport/widgets/widgets.pri8
-rw-r--r--src/tools/moc/main.cpp3
-rw-r--r--src/tools/qdbusxml2cpp/qdbusxml2cpp.pro7
-rw-r--r--src/widgets/accessible/simplewidgets.cpp6
-rw-r--r--src/widgets/doc/src/guibooks.qdoc4
-rw-r--r--src/widgets/itemviews/qtreeview.cpp2
-rw-r--r--src/widgets/kernel/qstackedlayout.cpp2
-rw-r--r--src/widgets/kernel/qwidget.cpp2
-rw-r--r--src/widgets/kernel/qwidgetwindow.cpp4
-rw-r--r--src/widgets/widgets/qlabel.cpp16
-rw-r--r--src/widgets/widgets/qlabel.h6
-rw-r--r--src/widgets/widgets/qlabel_p.h6
-rw-r--r--src/widgets/widgets/qlcdnumber.cpp4
-rw-r--r--src/widgets/widgets/qlcdnumber.h5
-rw-r--r--src/widgets/widgets/qsplashscreen.cpp4
-rw-r--r--src/widgets/widgets/qsplashscreen.h6
-rw-r--r--src/widgets/widgets/widgets.pri19
-rw-r--r--tests/auto/corelib/global/qlogging/app/app.pro2
-rw-r--r--tests/auto/corelib/itemmodels/qitemselectionmodel/tst_qitemselectionmodel.cpp74
-rw-r--r--tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp13
-rw-r--r--tests/auto/corelib/kernel/qeventdispatcher/BLACKLIST2
-rw-r--r--tests/auto/corelib/kernel/qeventloop/BLACKLIST1
-rw-r--r--tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp4
-rw-r--r--tests/auto/corelib/kernel/qobject/tst_qobject.cpp820
-rw-r--r--tests/auto/corelib/kernel/qsocketnotifier/tst_qsocketnotifier.cpp4
-rw-r--r--tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp6
-rw-r--r--tests/auto/corelib/tools/qhash/tst_qhash.cpp69
-rw-r--r--tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp19
-rw-r--r--tests/auto/dbus/qdbusabstractadaptor/myobject.h5
-rw-r--r--tests/auto/dbus/qdbusmarshall/common.h2
-rw-r--r--tests/auto/gui/kernel/qinputmethod/tst_qinputmethod.cpp5
-rw-r--r--tests/auto/gui/kernel/qwindow/tst_qwindow.cpp15
-rw-r--r--tests/auto/gui/painting/qpainter/tst_qpainter.cpp4
-rw-r--r--tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp61
-rw-r--r--tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp8
-rw-r--r--tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac.cpp15
-rw-r--r--tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.h2
-rw-r--r--tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm19
-rw-r--r--tests/auto/printsupport/dialogs/qabstractprintdialog/tst_qabstractprintdialog.cpp7
-rw-r--r--tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp41
-rw-r--r--tests/auto/widgets/effects/qgraphicseffect/tst_qgraphicseffect.cpp21
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsscene/BLACKLIST3
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp6
-rw-r--r--tests/auto/widgets/kernel/qapplication/BLACKLIST2
-rw-r--r--tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp2
-rw-r--r--tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp4
-rw-r--r--tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp11
-rwxr-xr-xutil/includemocs/includemocs.pl138
211 files changed, 2511 insertions, 1166 deletions
diff --git a/.qmake.conf b/.qmake.conf
index 6d42bbdd34..2e269c554b 100644
--- a/.qmake.conf
+++ b/.qmake.conf
@@ -4,4 +4,4 @@ CONFIG += warning_clean
QT_SOURCE_TREE = $$PWD
QT_BUILD_TREE = $$shadowed($$PWD)
-MODULE_VERSION = 5.9.0
+MODULE_VERSION = 5.9.1
diff --git a/config.tests/qpa/integrityfb/integrityfb.cpp b/config.tests/qpa/integrityfb/integrityfb.cpp
new file mode 100644
index 0000000000..7f2dd0705f
--- /dev/null
+++ b/config.tests/qpa/integrityfb/integrityfb.cpp
@@ -0,0 +1,46 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the config.tests of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** 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 Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <device/fbdriver.h>
+
+int main(int, char **)
+{
+ FBDriver *driver = 0;
+ return 0;
+}
diff --git a/config.tests/qpa/integrityfb/integrityfb.pro b/config.tests/qpa/integrityfb/integrityfb.pro
new file mode 100644
index 0000000000..5da4e77923
--- /dev/null
+++ b/config.tests/qpa/integrityfb/integrityfb.pro
@@ -0,0 +1,3 @@
+SOURCES = integrityfb.cpp
+
+CONFIG -= qt
diff --git a/config.tests/qpa/integrityhid/integrityhid.cpp b/config.tests/qpa/integrityhid/integrityhid.cpp
new file mode 100644
index 0000000000..1493e7c7e4
--- /dev/null
+++ b/config.tests/qpa/integrityhid/integrityhid.cpp
@@ -0,0 +1,52 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the config.tests of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** 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 Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <stdlib.h>
+#include <stdint.h>
+#include <device/hiddriver.h>
+
+int main(int, char **)
+{
+ HIDDriver *driver;
+ uintptr_t devicecontext;
+ uint32_t device_id;
+ gh_hid_enum_devices(driver, &device_id, &devicecontext);
+
+ return 0;
+}
diff --git a/config.tests/qpa/integrityhid/integrityhid.pro b/config.tests/qpa/integrityhid/integrityhid.pro
new file mode 100644
index 0000000000..87fafde897
--- /dev/null
+++ b/config.tests/qpa/integrityhid/integrityhid.pro
@@ -0,0 +1,2 @@
+SOURCES = integrityhid.cpp
+CONFIG -= qt
diff --git a/configure.json b/configure.json
index 02d5f1a65e..52831f161f 100644
--- a/configure.json
+++ b/configure.json
@@ -490,7 +490,7 @@
},
"use_gold_linker": {
"label": "Using gold linker",
- "condition": "!config.msvc && !config.integrity && tests.use_gold_linker",
+ "condition": "!config.win32 && !config.integrity && tests.use_gold_linker",
"output": [ "privateConfig", "useGoldLinker" ]
},
"optimize_debug": {
diff --git a/examples/gui/gui.pro b/examples/gui/gui.pro
index a4d960d3f5..b8080c2075 100644
--- a/examples/gui/gui.pro
+++ b/examples/gui/gui.pro
@@ -6,5 +6,5 @@ CONFIG += no_docs_target
SUBDIRS += analogclock
SUBDIRS += rasterwindow
-qtConfig(opengl): \
+qtHaveModule(gui):qtConfig(opengl): \
SUBDIRS += openglwindow
diff --git a/examples/network/googlesuggest/googlesuggest.cpp b/examples/network/googlesuggest/googlesuggest.cpp
index a4ae9d9fe8..9fdfd8faa6 100644
--- a/examples/network/googlesuggest/googlesuggest.cpp
+++ b/examples/network/googlesuggest/googlesuggest.cpp
@@ -117,11 +117,13 @@ bool GSuggestCompletion::eventFilter(QObject *obj, QEvent *ev)
case Qt::Key_Return:
doneCompletion();
consumed = true;
+ break;
case Qt::Key_Escape:
editor->setFocus();
popup->hide();
consumed = true;
+ break;
case Qt::Key_Up:
case Qt::Key_Down:
diff --git a/examples/touch/fingerpaint/scribblearea.cpp b/examples/touch/fingerpaint/scribblearea.cpp
index f8dadb4829..aa4e60c934 100644
--- a/examples/touch/fingerpaint/scribblearea.cpp
+++ b/examples/touch/fingerpaint/scribblearea.cpp
@@ -49,10 +49,13 @@
****************************************************************************/
#include <QtWidgets>
-#ifndef QT_NO_PRINTER
+#if defined(QT_PRINTSUPPORT_LIB)
+#include <QtPrintSupport/qtprintsupportglobal.h>
+#if QT_CONFIG(printdialog)
#include <QPrinter>
#include <QPrintDialog>
#endif
+#endif
#include "scribblearea.h"
@@ -167,7 +170,7 @@ void ScribbleArea::resizeImage(QImage *image, const QSize &newSize)
//! [21]
void ScribbleArea::print()
{
-#if !defined(QT_NO_PRINTER) && !defined(QT_NO_PRINTDIALOG)
+#if QT_CONFIG(printdialog)
QPrinter printer(QPrinter::HighResolution);
QPrintDialog printDialog(&printer, this);
@@ -181,7 +184,7 @@ void ScribbleArea::print()
painter.setWindow(image.rect());
painter.drawImage(0, 0, image);
}
-#endif // QT_NO_PRINTER
+#endif // QT_CONFIG(printdialog)
}
//! [22]
diff --git a/examples/widgets/dialogs/licensewizard/licensewizard.cpp b/examples/widgets/dialogs/licensewizard/licensewizard.cpp
index 6dbb894ad8..c082afa876 100644
--- a/examples/widgets/dialogs/licensewizard/licensewizard.cpp
+++ b/examples/widgets/dialogs/licensewizard/licensewizard.cpp
@@ -49,8 +49,13 @@
****************************************************************************/
#include <QtWidgets>
+#if defined(QT_PRINTSUPPORT_LIB)
+#include <QtPrintSupport/qtprintsupportglobal.h>
+#if QT_CONFIG(printdialog)
#include <QPrinter>
#include <QPrintDialog>
+#endif
+#endif
#include "licensewizard.h"
@@ -364,7 +369,7 @@ void ConclusionPage::setVisible(bool visible)
void ConclusionPage::printButtonClicked()
{
-#if !defined(QT_NO_PRINTER) && !defined(QT_NO_PRINTDIALOG)
+#if QT_CONFIG(printdialog)
QPrinter printer;
QPrintDialog dialog(&printer, this);
if (dialog.exec())
diff --git a/examples/widgets/doc/src/icons.qdoc b/examples/widgets/doc/src/icons.qdoc
index 42d823975b..60cb9062c2 100644
--- a/examples/widgets/doc/src/icons.qdoc
+++ b/examples/widgets/doc/src/icons.qdoc
@@ -98,8 +98,8 @@
The application allows you to manipulate the icon size with some
predefined sizes and a spin box. The predefined sizes are style
- dependent, but most of the styles have the same values: Only the
- Macintosh style differ by using 32 pixels, instead of 16 pixels,
+ dependent, but most of the styles have the same values. Only the
+ \macos style differs by using 32 pixels instead of 16 pixels
for toolbar buttons. You can navigate between the available styles
using the \uicontrol View menu.
diff --git a/examples/widgets/graphicsview/boxes/3rdparty/fbm.c b/examples/widgets/graphicsview/boxes/3rdparty/fbm.c
index 98eb87a33b..3eebaabfba 100644
--- a/examples/widgets/graphicsview/boxes/3rdparty/fbm.c
+++ b/examples/widgets/graphicsview/boxes/3rdparty/fbm.c
@@ -106,7 +106,7 @@ float noise3(float vec[3])
{
int bx0, bx1, by0, by1, bz0, bz1, b00, b10, b01, b11;
float rx0, rx1, ry0, ry1, rz0, rz1, *q, sy, sz, a, b, c, d, t, u, v;
- register int i, j;
+ int i, j;
if (start) {
start = 0;
diff --git a/examples/widgets/graphicsview/chip/view.cpp b/examples/widgets/graphicsview/chip/view.cpp
index 62aa25b575..79b173bec7 100644
--- a/examples/widgets/graphicsview/chip/view.cpp
+++ b/examples/widgets/graphicsview/chip/view.cpp
@@ -50,8 +50,13 @@
#include "view.h"
+#if defined(QT_PRINTSUPPORT_LIB)
+#include <QtPrintSupport/qtprintsupportglobal.h>
+#if QT_CONFIG(printdialog)
#include <QPrinter>
#include <QPrintDialog>
+#endif
+#endif
#ifndef QT_NO_OPENGL
#include <QtOpenGL>
#else
@@ -259,7 +264,7 @@ void View::toggleAntialiasing()
void View::print()
{
-#if !defined(QT_NO_PRINTER) && !defined(QT_NO_PRINTDIALOG)
+#if QT_CONFIG(printdialog)
QPrinter printer;
QPrintDialog dialog(&printer, this);
if (dialog.exec() == QDialog::Accepted) {
diff --git a/examples/widgets/itemviews/pixelator/mainwindow.cpp b/examples/widgets/itemviews/pixelator/mainwindow.cpp
index 2a5b572344..63617f0169 100644
--- a/examples/widgets/itemviews/pixelator/mainwindow.cpp
+++ b/examples/widgets/itemviews/pixelator/mainwindow.cpp
@@ -53,10 +53,13 @@
#include "pixeldelegate.h"
#include <QtWidgets>
-#ifndef QT_NO_PRINTER
+#if defined(QT_PRINTSUPPORT_LIB)
+#include <QtPrintSupport/qtprintsupportglobal.h>
+#if QT_CONFIG(printdialog)
#include <QPrinter>
#include <QPrintDialog>
#endif
+#endif
//! [0]
MainWindow::MainWindow()
@@ -164,7 +167,7 @@ void MainWindow::openImage(const QString &fileName)
void MainWindow::printImage()
{
-#if !defined(QT_NO_PRINTER) && !defined(QT_NO_PRINTDIALOG)
+#if QT_CONFIG(printdialog)
if (model->rowCount(QModelIndex())*model->columnCount(QModelIndex()) > 90000) {
QMessageBox::StandardButton answer;
answer = QMessageBox::question(this, tr("Large Image Size"),
diff --git a/examples/widgets/itemviews/spreadsheet/spreadsheet.cpp b/examples/widgets/itemviews/spreadsheet/spreadsheet.cpp
index e894d7fbd4..621f655b02 100644
--- a/examples/widgets/itemviews/spreadsheet/spreadsheet.cpp
+++ b/examples/widgets/itemviews/spreadsheet/spreadsheet.cpp
@@ -49,11 +49,16 @@
****************************************************************************/
#include <QtWidgets>
-#ifndef QT_NO_PRINTER
+#if defined(QT_PRINTSUPPORT_LIB)
+#include <QtPrintSupport/qtprintsupportglobal.h>
+#if QT_CONFIG(printdialog)
#include <QPrinter>
#include <QPrintDialog>
+#endif
+#if QT_CONFIG(printpreviewdialog)
#include <QPrintPreviewDialog>
#endif
+#endif
#include "spreadsheet.h"
#include "spreadsheetdelegate.h"
@@ -637,7 +642,7 @@ QString encode_pos(int row, int col)
void SpreadSheet::print()
{
-#if !defined(QT_NO_PRINTER) && !defined(QT_NO_PRINTDIALOG)
+#if QT_CONFIG(printpreviewdialog)
QPrinter printer(QPrinter::ScreenResolution);
QPrintPreviewDialog dlg(&printer);
PrintView view;
diff --git a/examples/widgets/mainwindows/dockwidgets/mainwindow.cpp b/examples/widgets/mainwindows/dockwidgets/mainwindow.cpp
index eb5864c818..47a6e78265 100644
--- a/examples/widgets/mainwindows/dockwidgets/mainwindow.cpp
+++ b/examples/widgets/mainwindows/dockwidgets/mainwindow.cpp
@@ -50,9 +50,12 @@
//! [0]
#include <QtWidgets>
-#ifndef QT_NO_PRINTDIALOG
+#if defined(QT_PRINTSUPPORT_LIB)
+#include <QtPrintSupport/qtprintsupportglobal.h>
+#if QT_CONFIG(printdialog)
#include <QtPrintSupport>
#endif
+#endif
#include "mainwindow.h"
//! [0]
@@ -125,7 +128,7 @@ void MainWindow::newLetter()
//! [3]
void MainWindow::print()
{
-#ifndef QT_NO_PRINTDIALOG
+#if QT_CONFIG(printdialog)
QTextDocument *document = textEdit->document();
QPrinter printer;
diff --git a/examples/widgets/painting/fontsampler/mainwindow.cpp b/examples/widgets/painting/fontsampler/mainwindow.cpp
index 192ffbd369..bd15438df9 100644
--- a/examples/widgets/painting/fontsampler/mainwindow.cpp
+++ b/examples/widgets/painting/fontsampler/mainwindow.cpp
@@ -50,8 +50,15 @@
#include <QtWidgets>
#if defined(QT_PRINTSUPPORT_LIB)
+#include <QtPrintSupport/qtprintsupportglobal.h>
+#if QT_CONFIG(printdialog)
+#include <QPrinter>
+#include <QPrintDialog>
+#if QT_CONFIG(printpreviewdialog)
#include <QPrintPreviewDialog>
#endif
+#endif
+#endif
#include "mainwindow.h"
@@ -270,7 +277,7 @@ void MainWindow::printDocument(QPrinter *printer)
void MainWindow::on_printPreviewAction_triggered()
{
-#if defined(QT_PRINTSUPPORT_LIB) && QT_CONFIG(printdialog)
+#if defined(QT_PRINTSUPPORT_LIB) && QT_CONFIG(printpreviewdialog)
pageMap = currentPageMap();
if (pageMap.count() == 0)
diff --git a/examples/widgets/painting/fontsampler/mainwindow.h b/examples/widgets/painting/fontsampler/mainwindow.h
index 8f59e1021b..ffb2839ffa 100644
--- a/examples/widgets/painting/fontsampler/mainwindow.h
+++ b/examples/widgets/painting/fontsampler/mainwindow.h
@@ -52,8 +52,6 @@
#define MAINWINDOW_H
#include "ui_mainwindowbase.h"
-#include <QPrinter>
-#include <QPrintDialog>
#if defined(QT_PRINTSUPPORT_LIB)
#include <QtPrintSupport/qtprintsupportglobal.h>
diff --git a/examples/widgets/richtext/orderform/mainwindow.cpp b/examples/widgets/richtext/orderform/mainwindow.cpp
index 35934bee72..030072978e 100644
--- a/examples/widgets/richtext/orderform/mainwindow.cpp
+++ b/examples/widgets/richtext/orderform/mainwindow.cpp
@@ -49,10 +49,13 @@
****************************************************************************/
#include <QtWidgets>
-#ifndef QT_NO_PRINTER
+#if defined(QT_PRINTSUPPORT_LIB)
+#include <QtPrintSupport/qtprintsupportglobal.h>
+#if QT_CONFIG(printdialog)
#include <QPrinter>
#include <QPrintDialog>
#endif
+#endif
#include "detailsdialog.h"
#include "mainwindow.h"
@@ -245,7 +248,7 @@ void MainWindow::openDialog()
//! [17]
void MainWindow::printFile()
{
-#if !defined(QT_NO_PRINTER) && !defined(QT_NO_PRINTDIALOG)
+#if QT_CONFIG(printdialog)
QTextEdit *editor = static_cast<QTextEdit*>(letters->currentWidget());
//! [18]
QPrinter printer;
diff --git a/examples/widgets/richtext/textedit/textedit.cpp b/examples/widgets/richtext/textedit/textedit.cpp
index 140ae478ff..fe4ee4f499 100644
--- a/examples/widgets/richtext/textedit/textedit.cpp
+++ b/examples/widgets/richtext/textedit/textedit.cpp
@@ -71,11 +71,18 @@
#include <QCloseEvent>
#include <QMessageBox>
#include <QMimeData>
-#ifndef QT_NO_PRINTER
+#if defined(QT_PRINTSUPPORT_LIB)
+#include <QtPrintSupport/qtprintsupportglobal.h>
+#if QT_CONFIG(printer)
+#if QT_CONFIG(printdialog)
#include <QPrintDialog>
+#endif
#include <QPrinter>
+#if QT_CONFIG(printpreviewdialog)
#include <QPrintPreviewDialog>
#endif
+#endif
+#endif
#include "textedit.h"
@@ -474,7 +481,7 @@ bool TextEdit::fileSaveAs()
void TextEdit::filePrint()
{
-#if !defined(QT_NO_PRINTER) && !defined(QT_NO_PRINTDIALOG)
+#if QT_CONFIG(printdialog)
QPrinter printer(QPrinter::HighResolution);
QPrintDialog *dlg = new QPrintDialog(&printer, this);
if (textEdit->textCursor().hasSelection())
@@ -488,7 +495,7 @@ void TextEdit::filePrint()
void TextEdit::filePrintPreview()
{
-#if !defined(QT_NO_PRINTER) && !defined(QT_NO_PRINTDIALOG)
+#if QT_CONFIG(printpreviewdialog)
QPrinter printer(QPrinter::HighResolution);
QPrintPreviewDialog preview(&printer, this);
connect(&preview, &QPrintPreviewDialog::paintRequested, this, &TextEdit::printPreview);
diff --git a/examples/widgets/widgets.pro b/examples/widgets/widgets.pro
index 513ddc91f2..cef4936d32 100644
--- a/examples/widgets/widgets.pro
+++ b/examples/widgets/widgets.pro
@@ -22,7 +22,7 @@ SUBDIRS = \
tutorials \
widgets
-qtConfig(opengl): \
+qtHaveModule(gui):qtConfig(opengl): \
SUBDIRS += windowcontainer
contains(DEFINES, QT_NO_CURSOR): SUBDIRS -= mainwindows
diff --git a/examples/widgets/widgets/imageviewer/imageviewer.cpp b/examples/widgets/widgets/imageviewer/imageviewer.cpp
index f2570c18c1..327abf7e43 100644
--- a/examples/widgets/widgets/imageviewer/imageviewer.cpp
+++ b/examples/widgets/widgets/imageviewer/imageviewer.cpp
@@ -49,9 +49,12 @@
****************************************************************************/
#include <QtWidgets>
-#ifndef QT_NO_PRINTER
+#if defined(QT_PRINTSUPPORT_LIB)
+#include <QtPrintSupport/qtprintsupportglobal.h>
+#if QT_CONFIG(printdialog)
#include <QPrintDialog>
#endif
+#endif
#include "imageviewer.h"
@@ -180,7 +183,7 @@ void ImageViewer::print()
//! [5] //! [6]
{
Q_ASSERT(imageLabel->pixmap());
-#if !defined(QT_NO_PRINTER) && !defined(QT_NO_PRINTDIALOG)
+#if QT_CONFIG(printdialog)
//! [6] //! [7]
QPrintDialog dialog(&printer, this);
//! [7] //! [8]
diff --git a/examples/widgets/widgets/scribble/scribblearea.cpp b/examples/widgets/widgets/scribble/scribblearea.cpp
index 2ae7ee027b..d32a29697b 100644
--- a/examples/widgets/widgets/scribble/scribblearea.cpp
+++ b/examples/widgets/widgets/scribble/scribblearea.cpp
@@ -49,10 +49,13 @@
****************************************************************************/
#include <QtWidgets>
-#ifndef QT_NO_PRINTER
+#if defined(QT_PRINTSUPPORT_LIB)
+#include <QtPrintSupport/qtprintsupportglobal.h>
+#if QT_CONFIG(printdialog)
#include <QPrinter>
#include <QPrintDialog>
#endif
+#endif
#include "scribblearea.h"
@@ -210,7 +213,7 @@ void ScribbleArea::resizeImage(QImage *image, const QSize &newSize)
//! [21]
void ScribbleArea::print()
{
-#if !defined(QT_NO_PRINTER) && !defined(QT_NO_PRINTDIALOG)
+#if QT_CONFIG(printdialog)
QPrinter printer(QPrinter::HighResolution);
QPrintDialog printDialog(&printer, this);
@@ -224,6 +227,6 @@ void ScribbleArea::print()
painter.setWindow(image.rect());
painter.drawImage(0, 0, image);
}
-#endif // QT_NO_PRINTER
+#endif // QT_CONFIG(printdialog)
}
//! [22]
diff --git a/mkspecs/common/ghs-integrity-armv8.conf b/mkspecs/common/ghs-integrity-armv8.conf
new file mode 100644
index 0000000000..e454cfd245
--- /dev/null
+++ b/mkspecs/common/ghs-integrity-armv8.conf
@@ -0,0 +1,27 @@
+#
+# Base qmake configuration for INTEGRITY armv8 targets
+#
+MAKEFILE_GENERATOR = UNIX
+
+QMAKE_PLATFORM = integrity
+
+include(unix.conf)
+
+include(ghs-base.conf)
+
+bsp_name = $$(INTEGRITY_BSP)
+isEmpty(bsp_name): \
+ error("This qmakespec requires $INTEGRITY_BSP to be set")
+
+os_directory = $$(INTEGRITY_DIR)
+isEmpty(os_directory): \
+ error("This qmakespec requires $INTEGRITY_DIR to be set")
+
+QMAKE_CC = cxintarm64 -bsp $$bsp_name -os_dir $$os_directory -non_shared
+QMAKE_CXX = cxintarm64 -bsp $$bsp_name -os_dir $$os_directory -non_shared
+QMAKE_LINK = $$QMAKE_CXX
+QMAKE_AR = $$QMAKE_CXX -archive -o
+
+QMAKE_CFLAGS += -bigswitch
+QMAKE_CXXFLAGS += -bigswitch
+QMAKE_LFLAGS += -bigswitch
diff --git a/mkspecs/devices/integrity-armv8-drive-cx/qmake.conf b/mkspecs/devices/integrity-armv8-drive-cx/qmake.conf
new file mode 100644
index 0000000000..37474e9dea
--- /dev/null
+++ b/mkspecs/devices/integrity-armv8-drive-cx/qmake.conf
@@ -0,0 +1,39 @@
+#
+# qmake configuration for 64-bit Tegra X1 boards, like the DRIVE CX, using Vibrante Integrity
+#
+# A typical configure line might look like:
+# configure \
+# -device integrity-armv8-drive-cx \
+# -device-option VIBRANTE_INTEGRITY_PDK_TOPDIR=/opt/nvidia/vibrante-t186ref-integrity
+# -static \
+# -opengl es2
+
+load(device_config)
+
+include(../../common/ghs-integrity-armv8.conf)
+
+DEFINES += WIN_INTERFACE_CUSTOM
+
+QT_QPA_DEFAULT_PLATFORM = eglfs
+
+QMAKE_LIBS_EGL += -lEGL -lGLESv2 -lnvidia-glsi -lnvidia-eglcore -lnvidia-rmapi-tegra -lposix -livfs -ldrm-nvdc -lnvll -lnvdc -lnvrm -lnvrm_gpu -lnvrm_graphics -lnvos -lsocket -lnet -lnvtegrahv
+QMAKE_LIBS_OPENGL_ES2 += $${QMAKE_LIBS_EGL}
+
+EGLFS_DEVICE_INTEGRATION = eglfs_kms_egldevice
+
+# Vibrante Integrity PDK headers & libraries
+QMAKE_INCDIR += $${VIBRANTE_INTEGRITY_PDK_TOPDIR}/include
+QMAKE_LIBDIR += $${VIBRANTE_INTEGRITY_PDK_TOPDIR}/libs
+
+# OpenGL libraries have a dependency on libEGL
+QMAKE_INCDIR_EGL = $${VIBRANTE_INTEGRITY_PDK_TOPDIR}/include
+QMAKE_LIBDIR_EGL = $${VIBRANTE_INTEGRITY_PDK_TOPDIR}/libs
+QMAKE_INCDIR_OPENGL_ES2 = $${VIBRANTE_INTEGRITY_PDK_TOPDIR}/include
+QMAKE_LIBDIR_OPENGL_ES2 = $${VIBRANTE_INTEGRITY_PDK_TOPDIR}/libs
+
+defineTest(qtConfSanitizeMkspec) {
+ isEmpty(VIBRANTE_INTEGRITY_PDK_TOPDIR): \
+ error("You must pass -device-option VIBRANTE_INTEGRITY_PDK_TOPDIR=/path/to/pdk")
+}
+
+load(qt_config)
diff --git a/mkspecs/devices/integrity-armv8-drive-cx/qplatformdefs.h b/mkspecs/devices/integrity-armv8-drive-cx/qplatformdefs.h
new file mode 100644
index 0000000000..c8361113a0
--- /dev/null
+++ b/mkspecs/devices/integrity-armv8-drive-cx/qplatformdefs.h
@@ -0,0 +1,45 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the qmake spec of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** 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 Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QPLATFORMDEFS_H
+#define QPLATFORMDEFS_H
+
+#include "../../common/integrity/qplatformdefs.h"
+
+#endif // QPLATFORMDEFS_H
diff --git a/mkspecs/features/file_copies.prf b/mkspecs/features/file_copies.prf
index a3520ba549..58e07bd393 100644
--- a/mkspecs/features/file_copies.prf
+++ b/mkspecs/features/file_copies.prf
@@ -44,10 +44,7 @@ for (cp, COPIES) {
$${pfx}.output = $$path/${QMAKE_FUNC_FILE_IN_qtStripSrcDir_$$cp}
}
$${pfx}.input = $${pfx}.files
- !$$dir: \
- $${pfx}.commands = $(QINSTALL_FILE) ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT}
- else: \
- $${pfx}.commands = $(QINSTALL_DIR) ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT}
+ $${pfx}.commands = $(QINSTALL) ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT}
$${pfx}.name = COPY ${QMAKE_FILE_IN}
$${pfx}.CONFIG = no_link no_clean target_predeps
QMAKE_EXTRA_COMPILERS += $${pfx}
diff --git a/mkspecs/features/moc.prf b/mkspecs/features/moc.prf
index 15eb38af31..955933d874 100644
--- a/mkspecs/features/moc.prf
+++ b/mkspecs/features/moc.prf
@@ -31,10 +31,10 @@ if(gcc|intel_icl|msvc):!rim_qcc:!uikit:!no_moc_predefs:if(!macos|count(QMAKE_APP
moc_predefs.name = "Generate moc_predefs.h"
moc_predefs.CONFIG = no_link
gcc: moc_predefs.commands = $$QMAKE_CXX $$QMAKE_CXXFLAGS -dM -E -o ${QMAKE_FILE_OUT} ${QMAKE_FILE_IN}
- else:intel_icl: moc_predefs.commands = $$QMAKE_CXX $$QMAKE_CXXFLAGS -QdM -P -Za -Fi${QMAKE_FILE_OUT} ${QMAKE_FILE_IN}
+ else:intel_icl: moc_predefs.commands = $$QMAKE_CXX $$QMAKE_CXXFLAGS -QdM -P -Fi${QMAKE_FILE_OUT} ${QMAKE_FILE_IN}
else:msvc {
moc_predefs.commands += $$QMAKE_CXX -Bx$$shell_quote($$shell_path($$QMAKE_QMAKE)) $$QMAKE_CXXFLAGS \
- -E -Za ${QMAKE_FILE_IN} 2>NUL >${QMAKE_FILE_OUT}
+ -E ${QMAKE_FILE_IN} 2>NUL >${QMAKE_FILE_OUT}
} else: error("Oops, I messed up")
moc_predefs.output = $$MOC_DIR/moc_predefs.h
moc_predefs.input = MOC_PREDEF_FILE
diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf
index 966c43108c..5cbc0d4bfd 100644
--- a/mkspecs/features/qt_configure.prf
+++ b/mkspecs/features/qt_configure.prf
@@ -1919,8 +1919,10 @@ qtConfCheckErrors()
for (k, $${currentConfig}.features._KEYS_) {
pp = $$eval($${currentConfig}.features.$${k}.purpose)
!isEmpty(pp) {
+ pfx = $$eval($${currentConfig}.features.$${k}.section)
+ !isEmpty(pfx): pfx = "$$pfx: "
all_ft += $$qtConfPadCols($$k, ".......................", \
- $$section(pp, $$escape_expand(\\n), 0, 0))
+ $$pfx$$section(pp, $$escape_expand(\\n), 0, 0))
}
}
}
diff --git a/mkspecs/features/win32/idcidl.prf b/mkspecs/features/win32/idcidl.prf
index fba7173e79..922ae3f99e 100644
--- a/mkspecs/features/win32/idcidl.prf
+++ b/mkspecs/features/win32/idcidl.prf
@@ -14,13 +14,8 @@ contains(TEMPLATE, "vc.*") {
ACTIVEQT_IDC = $${QMAKE_IDC}
ACTIVEQT_IDL = $${QMAKE_IDL}
ACTIVEQT_TARGET = \"$(TargetPath)\"
- win32-msvc {
- ACTIVEQT_NEWLINE = $$escape_expand(\\t)
- ACTIVEQT_OUTPUT = $(IntDir)/$${TARGET}
- } else {
- ACTIVEQT_NEWLINE = $$escape_expand(\\n\\t)
- ACTIVEQT_OUTPUT = $(IntDir)$${TARGET}
- }
+ ACTIVEQT_NEWLINE = $$escape_expand(\\n\\t)
+ ACTIVEQT_OUTPUT = $(IntDir)$${TARGET}
ACTIVEQT_TLBOUT = \"$(TargetDir)/$${TARGET}.tlb\"
GENERATED += $${OBJECTS_DIR}/$${TARGET}.idl $${ACTIVEQT_TLBOUT}
} else {
diff --git a/mkspecs/features/winrt/default_pre.prf b/mkspecs/features/winrt/default_pre.prf
index 8b9c1d7663..966d24f091 100644
--- a/mkspecs/features/winrt/default_pre.prf
+++ b/mkspecs/features/winrt/default_pre.prf
@@ -9,6 +9,6 @@ CONFIG(debug, debug|release): \
else: \
QMAKE_LIBS = ucrt.lib vcruntime.lib $$QMAKE_LIBS
-equals(TEMPLATE, "vcapp"): CONFIG += windeployqt
+equals(TEMPLATE, "vcapp"):!static: CONFIG += windeployqt
load(default_pre)
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
index c76708285a..d3221b7a25 100644
--- a/qmake/generators/makefile.cpp
+++ b/qmake/generators/makefile.cpp
@@ -1287,12 +1287,10 @@ MakefileGenerator::writeInstalls(QTextStream &t, bool noBuild)
dst_file += Option::dir_sep;
dst_file += fi.fileName();
QString cmd;
- if (fi.isDir())
- cmd = "-$(QINSTALL_DIR)";
- else if (is_target || fi.isExecutable())
- cmd = "-$(QINSTALL_PROGRAM)";
+ if (is_target || (!fi.isDir() && fi.isExecutable()))
+ cmd = QLatin1String("-$(QINSTALL_PROGRAM)");
else
- cmd = "-$(QINSTALL_FILE)";
+ cmd = QLatin1String("-$(QINSTALL)");
cmd += " " + escapeFilePath(wild) + " " + escapeFilePath(dst_file);
inst << cmd;
if (!project->isActiveConfig("debug_info") && !project->isActiveConfig("nostrip") &&
@@ -1307,17 +1305,14 @@ MakefileGenerator::writeInstalls(QTextStream &t, bool noBuild)
QDir::NoDotAndDotDot | QDir::AllEntries);
if (installConfigValues.contains("no_check_exist") && files.isEmpty()) {
QString dst_file = filePrefixRoot(root, dst_dir);
- QString cmd;
if (!dst_file.endsWith(Option::dir_sep))
dst_file += Option::dir_sep;
dst_file += filestr;
- if (installConfigValues.contains("directory")) {
- cmd = QLatin1String("-$(QINSTALL_DIR)");
- } else if (installConfigValues.contains("executable")) {
+ QString cmd;
+ if (installConfigValues.contains("executable"))
cmd = QLatin1String("-$(QINSTALL_PROGRAM)");
- } else {
- cmd = QLatin1String("-$(QINSTALL_FILE)");
- }
+ else
+ cmd = QLatin1String("-$(QINSTALL)");
cmd += " " + escapeFilePath(wild) + " " + escapeFilePath(dst_file);
inst << cmd;
uninst.append(rm_dir_contents + " " + escapeFilePath(filePrefixRoot(root, fileFixify(dst_dir + filestr, FileFixifyAbsolute, false))));
@@ -1330,7 +1325,7 @@ MakefileGenerator::writeInstalls(QTextStream &t, bool noBuild)
if (!dst_file.endsWith(Option::dir_sep))
dst_file += Option::dir_sep;
dst_file += fi.fileName();
- QString cmd = QString(fi.isDir() ? "-$(QINSTALL_DIR)" : "-$(QINSTALL_FILE)") + " " +
+ QString cmd = QLatin1String("-$(QINSTALL) ") +
escapeFilePath(dirstr + file) + " " + escapeFilePath(dst_file);
inst << cmd;
if (!project->isActiveConfig("debug_info") && !project->isActiveConfig("nostrip") &&
@@ -2242,9 +2237,8 @@ MakefileGenerator::writeDefaultVariables(QTextStream &t)
t << "INSTALL_FILE = " << var("QMAKE_INSTALL_FILE") << endl;
t << "INSTALL_PROGRAM = " << var("QMAKE_INSTALL_PROGRAM") << endl;
t << "INSTALL_DIR = " << var("QMAKE_INSTALL_DIR") << endl;
- t << "QINSTALL_FILE = " << var("QMAKE_QMAKE") << " -install qinstall file" << endl;
- t << "QINSTALL_PROGRAM = " << var("QMAKE_QMAKE") << " -install qinstall program" << endl;
- t << "QINSTALL_DIR = " << var("QMAKE_QMAKE") << " -install qinstall directory" << endl;
+ t << "QINSTALL = " << var("QMAKE_QMAKE") << " -install qinstall" << endl;
+ t << "QINSTALL_PROGRAM = " << var("QMAKE_QMAKE") << " -install qinstall -exe" << endl;
t << "DEL_FILE = " << var("QMAKE_DEL_FILE") << endl;
t << "SYMLINK = " << var("QMAKE_SYMBOLIC_LINK") << endl;
t << "DEL_DIR = " << var("QMAKE_DEL_DIR") << endl;
diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp
index 20318f120c..b86594d191 100644
--- a/qmake/generators/unix/unixmake.cpp
+++ b/qmake/generators/unix/unixmake.cpp
@@ -600,7 +600,7 @@ UnixMakefileGenerator::defaultInstall(const QString &t)
dst = escapeFilePath(filePrefixRoot(root, targetdir + src.section('/', -1)));
if(!ret.isEmpty())
ret += "\n\t";
- ret += "-$(QINSTALL_FILE) " + escapeFilePath(Option::fixPathToTargetOS(src, false)) + ' ' + dst;
+ ret += "-$(QINSTALL) " + escapeFilePath(Option::fixPathToTargetOS(src, false)) + ' ' + dst;
if(!uninst.isEmpty())
uninst.append("\n\t");
uninst.append("-$(DEL_FILE) " + dst);
@@ -636,9 +636,9 @@ UnixMakefileGenerator::defaultInstall(const QString &t)
QString copy_cmd;
if (bundle == SolidBundle) {
- copy_cmd += "-$(QINSTALL_DIR) " + src_targ + ' ' + plain_targ;
+ copy_cmd += "-$(QINSTALL) " + src_targ + ' ' + plain_targ;
} else if (project->first("TEMPLATE") == "lib" && project->isActiveConfig("staticlib")) {
- copy_cmd += "-$(QINSTALL_FILE) " + src_targ + ' ' + dst_targ;
+ copy_cmd += "-$(QINSTALL) " + src_targ + ' ' + dst_targ;
} else if (!isAux) {
if (bundle == SlicedBundle) {
if (!ret.isEmpty())
@@ -698,7 +698,7 @@ UnixMakefileGenerator::defaultInstall(const QString &t)
ret += "\n\t";
ret += mkdir_p_asstring("\"`dirname " + dst + "`\"", false) + "\n\t";
ret += "-$(DEL_FILE) " + dst + "\n\t"; // Can't overwrite symlinks to directories
- ret += "-$(QINSTALL_DIR) " + escapeFilePath(src) + " " + dst;
+ ret += "-$(QINSTALL) " + escapeFilePath(src) + " " + dst;
if (!uninst.isEmpty())
uninst.append("\n\t");
uninst.append("-$(DEL_FILE) " + dst);
diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp
index 1093d9849e..579d3117ef 100644
--- a/qmake/generators/win32/msvc_objectmodel.cpp
+++ b/qmake/generators/win32/msvc_objectmodel.cpp
@@ -950,12 +950,8 @@ bool VCCLCompilerTool::parseOption(const char* option)
ForceConformanceInForLoopScope = ((*c) == '-' ? _False : _True);
else if(fourth == 'w')
TreatWChar_tAsBuiltInType = ((*c) == '-' ? _False : _True);
- else if (config->CompilerVersion >= NET2013 && strncmp(option + 4, "strictStrings", 13) == 0)
- AdditionalOptions += option;
- else if (config->CompilerVersion >= NET2015 && strncmp(option + 4, "throwingNew", 11) == 0)
- AdditionalOptions += option;
else
- found = false;
+ AdditionalOptions += option;
} else {
found = false; break;
}
@@ -1155,7 +1151,7 @@ bool VCCLCompilerTool::parseOption(const char* option)
case 'u':
if (!second)
UndefineAllPreprocessorDefinitions = _True;
- else if (second == 't' && third == 'f' && fourth == '8')
+ else if (strcmp(option + 2, "tf-8") == 0)
AdditionalOptions += option;
else
found = false;
diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp
index 2013698c99..6f2f43c03c 100644
--- a/qmake/generators/win32/winmakefile.cpp
+++ b/qmake/generators/win32/winmakefile.cpp
@@ -530,9 +530,8 @@ void Win32MakefileGenerator::writeStandardParts(QTextStream &t)
t << "INSTALL_FILE = " << var("QMAKE_INSTALL_FILE") << endl;
t << "INSTALL_PROGRAM = " << var("QMAKE_INSTALL_PROGRAM") << endl;
t << "INSTALL_DIR = " << var("QMAKE_INSTALL_DIR") << endl;
- t << "QINSTALL_FILE = " << var("QMAKE_QMAKE") << " -install qinstall file" << endl;
- t << "QINSTALL_PROGRAM = " << var("QMAKE_QMAKE") << " -install qinstall program" << endl;
- t << "QINSTALL_DIR = " << var("QMAKE_QMAKE") << " -install qinstall directory" << endl;
+ t << "QINSTALL = " << var("QMAKE_QMAKE") << " -install qinstall" << endl;
+ t << "QINSTALL_PROGRAM = " << var("QMAKE_QMAKE") << " -install qinstall -exe" << endl;
t << endl;
t << "####### Output directory\n\n";
diff --git a/qmake/main.cpp b/qmake/main.cpp
index f25b128d03..13b18d018a 100644
--- a/qmake/main.cpp
+++ b/qmake/main.cpp
@@ -273,7 +273,7 @@ static int installFile(const QString &source, const QString &target, bool exe =
return 0;
}
-static int installDirectory(const QString &source, const QString &target)
+static int installFileOrDirectory(const QString &source, const QString &target)
{
QFileInfo fi(source);
if (false) {
@@ -299,7 +299,7 @@ static int installDirectory(const QString &source, const QString &target)
const QFileInfo &entry = it.fileInfo();
const QString &entryTarget = target + QDir::separator() + entry.fileName();
- const int recursionResult = installDirectory(entry.filePath(), entryTarget);
+ const int recursionResult = installFileOrDirectory(entry.filePath(), entryTarget);
if (recursionResult != 0)
return recursionResult;
}
@@ -313,23 +313,24 @@ static int installDirectory(const QString &source, const QString &target)
static int doQInstall(int argc, char **argv)
{
- if (argc != 3) {
- fprintf(stderr, "Error: this qinstall command requires exactly three arguments (type, source, destination)\n");
+ bool installExecutable = false;
+ if (argc == 3 && !strcmp(argv[0], "-exe")) {
+ installExecutable = true;
+ --argc;
+ ++argv;
+ }
+
+ if (argc != 2 && !installExecutable) {
+ fprintf(stderr, "Error: usage: [-exe] source target\n");
return 3;
}
- const QString source = QString::fromLocal8Bit(argv[1]);
- const QString target = QString::fromLocal8Bit(argv[2]);
+ const QString source = QString::fromLocal8Bit(argv[0]);
+ const QString target = QString::fromLocal8Bit(argv[1]);
- if (!strcmp(argv[0], "file"))
- return installFile(source, target);
- if (!strcmp(argv[0], "program"))
+ if (installExecutable)
return installFile(source, target, /*exe=*/true);
- if (!strcmp(argv[0], "directory"))
- return installDirectory(source, target);
-
- fprintf(stderr, "Error: Unsupported qinstall command type %s\n", argv[0]);
- return 3;
+ return installFileOrDirectory(source, target);
}
diff --git a/src/3rdparty/sqlite/qt_attribution.json b/src/3rdparty/sqlite/qt_attribution.json
index 02686c2147..1f91bb180f 100644
--- a/src/3rdparty/sqlite/qt_attribution.json
+++ b/src/3rdparty/sqlite/qt_attribution.json
@@ -6,7 +6,7 @@
"Description": "SQLite is a small C library that implements a self-contained, embeddable, zero-configuration SQL database engine.",
"Homepage": "http://www.sqlite.org/",
- "Version": "3.16.1",
+ "Version": "3.16.2",
"License": "Public Domain",
"Copyright": "The authors disclaim copyright to the source code. However, a license can be obtained if needed."
}
diff --git a/src/3rdparty/sqlite/sqlite3.c b/src/3rdparty/sqlite/sqlite3.c
index 905176cf9d..7f5e75921f 100644
--- a/src/3rdparty/sqlite/sqlite3.c
+++ b/src/3rdparty/sqlite/sqlite3.c
@@ -1,6 +1,6 @@
/******************************************************************************
** This file is an amalgamation of many separate C source files from SQLite
-** version 3.16.1. By combining all the individual C code files into this
+** version 3.16.2. By combining all the individual C code files into this
** single large file, the entire code can be compiled as a single translation
** unit. This allows many compilers to do optimizations that would not be
** possible if the files were compiled separately. Performance improvements
@@ -381,9 +381,9 @@ extern "C" {
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
** [sqlite_version()] and [sqlite_source_id()].
*/
-#define SQLITE_VERSION "3.16.1"
-#define SQLITE_VERSION_NUMBER 3016001
-#define SQLITE_SOURCE_ID "2017-01-03 18:27:03 979f04392853b8053817a3eea2fc679947b437fd"
+#define SQLITE_VERSION "3.16.2"
+#define SQLITE_VERSION_NUMBER 3016002
+#define SQLITE_SOURCE_ID "2017-01-06 16:32:41 a65a62893ca8319e89e48b8a38cf8a59c69a8209"
/*
** CAPI3REF: Run-Time Library Version Numbers
@@ -4156,8 +4156,12 @@ SQLITE_API int sqlite3_clear_bindings(sqlite3_stmt*);
** METHOD: sqlite3_stmt
**
** ^Return the number of columns in the result set returned by the
-** [prepared statement]. ^This routine returns 0 if pStmt is an SQL
-** statement that does not return data (for example an [UPDATE]).
+** [prepared statement]. ^If this routine returns 0, that means the
+** [prepared statement] returns no data (for example an [UPDATE]).
+** ^However, just because this routine returns a positive number does not
+** mean that one or more rows of data will be returned. ^A SELECT statement
+** will always have a positive sqlite3_column_count() but depending on the
+** WHERE clause constraints and the table content, it might return no rows.
**
** See also: [sqlite3_data_count()]
*/
@@ -12861,8 +12865,10 @@ SQLITE_PRIVATE int sqlite3VdbeAddOp4Int(Vdbe*,int,int,int,int,int);
SQLITE_PRIVATE void sqlite3VdbeEndCoroutine(Vdbe*,int);
#if defined(SQLITE_DEBUG) && !defined(SQLITE_TEST_REALLOC_STRESS)
SQLITE_PRIVATE void sqlite3VdbeVerifyNoMallocRequired(Vdbe *p, int N);
+SQLITE_PRIVATE void sqlite3VdbeVerifyNoResultRow(Vdbe *p);
#else
# define sqlite3VdbeVerifyNoMallocRequired(A,B)
+# define sqlite3VdbeVerifyNoResultRow(A)
#endif
SQLITE_PRIVATE VdbeOp *sqlite3VdbeAddOpList(Vdbe*, int nOp, VdbeOpList const *aOp, int iLineno);
SQLITE_PRIVATE void sqlite3VdbeAddParseSchemaOp(Vdbe*,int,char*);
@@ -70277,6 +70283,7 @@ static SQLITE_NOINLINE const void *valueToText(sqlite3_value* pVal, u8 enc){
assert( (pVal->flags & MEM_RowSet)==0 );
assert( (pVal->flags & (MEM_Null))==0 );
if( pVal->flags & (MEM_Blob|MEM_Str) ){
+ if( ExpandBlob(pVal) ) return 0;
pVal->flags |= MEM_Str;
if( pVal->enc != (enc & ~SQLITE_UTF16_ALIGNED) ){
sqlite3VdbeChangeEncoding(pVal, enc & ~SQLITE_UTF16_ALIGNED);
@@ -71626,6 +71633,22 @@ SQLITE_PRIVATE void sqlite3VdbeVerifyNoMallocRequired(Vdbe *p, int N){
#endif
/*
+** Verify that the VM passed as the only argument does not contain
+** an OP_ResultRow opcode. Fail an assert() if it does. This is used
+** by code in pragma.c to ensure that the implementation of certain
+** pragmas comports with the flags specified in the mkpragmatab.tcl
+** script.
+*/
+#if defined(SQLITE_DEBUG) && !defined(SQLITE_TEST_REALLOC_STRESS)
+SQLITE_PRIVATE void sqlite3VdbeVerifyNoResultRow(Vdbe *p){
+ int i;
+ for(i=0; i<p->nOp; i++){
+ assert( p->aOp[i].opcode!=OP_ResultRow );
+ }
+}
+#endif
+
+/*
** This function returns a pointer to the array of opcodes associated with
** the Vdbe passed as the first argument. It is the callers responsibility
** to arrange for the returned array to be eventually freed using the
@@ -109544,12 +109567,25 @@ SQLITE_PRIVATE void sqlite3GenerateConstraintChecks(
onError = OE_Abort;
}
- if( ix==0 && pPk==pIdx && onError==OE_Replace && pPk->pNext==0 ){
+ /* Collision detection may be omitted if all of the following are true:
+ ** (1) The conflict resolution algorithm is REPLACE
+ ** (2) The table is a WITHOUT ROWID table
+ ** (3) There are no secondary indexes on the table
+ ** (4) No delete triggers need to be fired if there is a conflict
+ ** (5) No FK constraint counters need to be updated if a conflict occurs.
+ */
+ if( (ix==0 && pIdx->pNext==0) /* Condition 3 */
+ && pPk==pIdx /* Condition 2 */
+ && onError==OE_Replace /* Condition 1 */
+ && ( 0==(db->flags&SQLITE_RecTriggers) || /* Condition 4 */
+ 0==sqlite3TriggersExist(pParse, pTab, TK_DELETE, 0, 0))
+ && ( 0==(db->flags&SQLITE_ForeignKeys) || /* Condition 5 */
+ (0==pTab->pFKey && 0==sqlite3FkReferences(pTab)))
+ ){
sqlite3VdbeResolveLabel(v, addrUniqueOk);
continue;
}
-
/* Check to see if the new index entry will be unique */
sqlite3VdbeAddOp4Int(v, OP_NoConflict, iThisCur, addrUniqueOk,
regIdx, pIdx->nKeyCol); VdbeCoverage(v);
@@ -111795,11 +111831,12 @@ SQLITE_PRIVATE void sqlite3AutoLoadExtensions(sqlite3 *db){
/* Property flags associated with various pragma. */
#define PragFlg_NeedSchema 0x01 /* Force schema load before running */
#define PragFlg_NoColumns 0x02 /* OP_ResultRow called with zero columns */
-#define PragFlg_ReadOnly 0x04 /* Read-only HEADER_VALUE */
-#define PragFlg_Result0 0x08 /* Acts as query when no argument */
-#define PragFlg_Result1 0x10 /* Acts as query when has one argument */
-#define PragFlg_SchemaOpt 0x20 /* Schema restricts name search if present */
-#define PragFlg_SchemaReq 0x40 /* Schema required - "main" is default */
+#define PragFlg_NoColumns1 0x04 /* zero columns if RHS argument is present */
+#define PragFlg_ReadOnly 0x08 /* Read-only HEADER_VALUE */
+#define PragFlg_Result0 0x10 /* Acts as query when no argument */
+#define PragFlg_Result1 0x20 /* Acts as query when has one argument */
+#define PragFlg_SchemaOpt 0x40 /* Schema restricts name search if present */
+#define PragFlg_SchemaReq 0x80 /* Schema required - "main" is default */
/* Names of columns for pragmas that return multi-column result
** or that return single-column results where the name of the
@@ -111876,14 +111913,14 @@ static const PragmaName aPragmaName[] = {
#if !defined(SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS)
{/* zName: */ "application_id",
/* ePragTyp: */ PragTyp_HEADER_VALUE,
- /* ePragFlg: */ PragFlg_Result0,
+ /* ePragFlg: */ PragFlg_NoColumns1|PragFlg_Result0,
/* ColNames: */ 0, 0,
/* iArg: */ BTREE_APPLICATION_ID },
#endif
#if !defined(SQLITE_OMIT_AUTOVACUUM)
{/* zName: */ "auto_vacuum",
/* ePragTyp: */ PragTyp_AUTO_VACUUM,
- /* ePragFlg: */ PragFlg_NeedSchema|PragFlg_Result0|PragFlg_SchemaReq,
+ /* ePragFlg: */ PragFlg_NeedSchema|PragFlg_Result0|PragFlg_SchemaReq|PragFlg_NoColumns1,
/* ColNames: */ 0, 0,
/* iArg: */ 0 },
#endif
@@ -111891,7 +111928,7 @@ static const PragmaName aPragmaName[] = {
#if !defined(SQLITE_OMIT_AUTOMATIC_INDEX)
{/* zName: */ "automatic_index",
/* ePragTyp: */ PragTyp_FLAG,
- /* ePragFlg: */ PragFlg_Result0|PragFlg_NoColumns,
+ /* ePragFlg: */ PragFlg_Result0|PragFlg_NoColumns1,
/* ColNames: */ 0, 0,
/* iArg: */ SQLITE_AutoIndex },
#endif
@@ -111904,31 +111941,31 @@ static const PragmaName aPragmaName[] = {
#if !defined(SQLITE_OMIT_PAGER_PRAGMAS)
{/* zName: */ "cache_size",
/* ePragTyp: */ PragTyp_CACHE_SIZE,
- /* ePragFlg: */ PragFlg_NeedSchema|PragFlg_Result0|PragFlg_SchemaReq,
+ /* ePragFlg: */ PragFlg_NeedSchema|PragFlg_Result0|PragFlg_SchemaReq|PragFlg_NoColumns1,
/* ColNames: */ 0, 0,
/* iArg: */ 0 },
#endif
#if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
{/* zName: */ "cache_spill",
/* ePragTyp: */ PragTyp_CACHE_SPILL,
- /* ePragFlg: */ PragFlg_Result0|PragFlg_SchemaReq,
+ /* ePragFlg: */ PragFlg_Result0|PragFlg_SchemaReq|PragFlg_NoColumns1,
/* ColNames: */ 0, 0,
/* iArg: */ 0 },
#endif
{/* zName: */ "case_sensitive_like",
/* ePragTyp: */ PragTyp_CASE_SENSITIVE_LIKE,
- /* ePragFlg: */ 0,
+ /* ePragFlg: */ PragFlg_NoColumns,
/* ColNames: */ 0, 0,
/* iArg: */ 0 },
{/* zName: */ "cell_size_check",
/* ePragTyp: */ PragTyp_FLAG,
- /* ePragFlg: */ PragFlg_Result0|PragFlg_NoColumns,
+ /* ePragFlg: */ PragFlg_Result0|PragFlg_NoColumns1,
/* ColNames: */ 0, 0,
/* iArg: */ SQLITE_CellSizeCk },
#if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
{/* zName: */ "checkpoint_fullfsync",
/* ePragTyp: */ PragTyp_FLAG,
- /* ePragFlg: */ PragFlg_Result0|PragFlg_NoColumns,
+ /* ePragFlg: */ PragFlg_Result0|PragFlg_NoColumns1,
/* ColNames: */ 0, 0,
/* iArg: */ SQLITE_CkptFullFSync },
#endif
@@ -111949,21 +111986,21 @@ static const PragmaName aPragmaName[] = {
#if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
{/* zName: */ "count_changes",
/* ePragTyp: */ PragTyp_FLAG,
- /* ePragFlg: */ PragFlg_Result0|PragFlg_NoColumns,
+ /* ePragFlg: */ PragFlg_Result0|PragFlg_NoColumns1,
/* ColNames: */ 0, 0,
/* iArg: */ SQLITE_CountRows },
#endif
#if !defined(SQLITE_OMIT_PAGER_PRAGMAS) && SQLITE_OS_WIN
{/* zName: */ "data_store_directory",
/* ePragTyp: */ PragTyp_DATA_STORE_DIRECTORY,
- /* ePragFlg: */ 0,
+ /* ePragFlg: */ PragFlg_NoColumns1,
/* ColNames: */ 0, 0,
/* iArg: */ 0 },
#endif
#if !defined(SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS)
{/* zName: */ "data_version",
/* ePragTyp: */ PragTyp_HEADER_VALUE,
- /* ePragFlg: */ PragFlg_Result0|PragFlg_ReadOnly,
+ /* ePragFlg: */ PragFlg_ReadOnly|PragFlg_Result0,
/* ColNames: */ 0, 0,
/* iArg: */ BTREE_DATA_VERSION },
#endif
@@ -111977,7 +112014,7 @@ static const PragmaName aPragmaName[] = {
#if !defined(SQLITE_OMIT_PAGER_PRAGMAS) && !defined(SQLITE_OMIT_DEPRECATED)
{/* zName: */ "default_cache_size",
/* ePragTyp: */ PragTyp_DEFAULT_CACHE_SIZE,
- /* ePragFlg: */ PragFlg_NeedSchema|PragFlg_Result0|PragFlg_SchemaReq,
+ /* ePragFlg: */ PragFlg_NeedSchema|PragFlg_Result0|PragFlg_SchemaReq|PragFlg_NoColumns1,
/* ColNames: */ 0, 1,
/* iArg: */ 0 },
#endif
@@ -111985,7 +112022,7 @@ static const PragmaName aPragmaName[] = {
#if !defined(SQLITE_OMIT_FOREIGN_KEY) && !defined(SQLITE_OMIT_TRIGGER)
{/* zName: */ "defer_foreign_keys",
/* ePragTyp: */ PragTyp_FLAG,
- /* ePragFlg: */ PragFlg_Result0|PragFlg_NoColumns,
+ /* ePragFlg: */ PragFlg_Result0|PragFlg_NoColumns1,
/* ColNames: */ 0, 0,
/* iArg: */ SQLITE_DeferFKs },
#endif
@@ -111993,14 +112030,14 @@ static const PragmaName aPragmaName[] = {
#if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
{/* zName: */ "empty_result_callbacks",
/* ePragTyp: */ PragTyp_FLAG,
- /* ePragFlg: */ PragFlg_Result0|PragFlg_NoColumns,
+ /* ePragFlg: */ PragFlg_Result0|PragFlg_NoColumns1,
/* ColNames: */ 0, 0,
/* iArg: */ SQLITE_NullCallback },
#endif
#if !defined(SQLITE_OMIT_UTF16)
{/* zName: */ "encoding",
/* ePragTyp: */ PragTyp_ENCODING,
- /* ePragFlg: */ PragFlg_Result0,
+ /* ePragFlg: */ PragFlg_Result0|PragFlg_NoColumns1,
/* ColNames: */ 0, 0,
/* iArg: */ 0 },
#endif
@@ -112022,7 +112059,7 @@ static const PragmaName aPragmaName[] = {
#if !defined(SQLITE_OMIT_FOREIGN_KEY) && !defined(SQLITE_OMIT_TRIGGER)
{/* zName: */ "foreign_keys",
/* ePragTyp: */ PragTyp_FLAG,
- /* ePragFlg: */ PragFlg_Result0|PragFlg_NoColumns,
+ /* ePragFlg: */ PragFlg_Result0|PragFlg_NoColumns1,
/* ColNames: */ 0, 0,
/* iArg: */ SQLITE_ForeignKeys },
#endif
@@ -112030,19 +112067,19 @@ static const PragmaName aPragmaName[] = {
#if !defined(SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS)
{/* zName: */ "freelist_count",
/* ePragTyp: */ PragTyp_HEADER_VALUE,
- /* ePragFlg: */ PragFlg_Result0|PragFlg_ReadOnly,
+ /* ePragFlg: */ PragFlg_ReadOnly|PragFlg_Result0,
/* ColNames: */ 0, 0,
/* iArg: */ BTREE_FREE_PAGE_COUNT },
#endif
#if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
{/* zName: */ "full_column_names",
/* ePragTyp: */ PragTyp_FLAG,
- /* ePragFlg: */ PragFlg_Result0|PragFlg_NoColumns,
+ /* ePragFlg: */ PragFlg_Result0|PragFlg_NoColumns1,
/* ColNames: */ 0, 0,
/* iArg: */ SQLITE_FullColNames },
{/* zName: */ "fullfsync",
/* ePragTyp: */ PragTyp_FLAG,
- /* ePragFlg: */ PragFlg_Result0|PragFlg_NoColumns,
+ /* ePragFlg: */ PragFlg_Result0|PragFlg_NoColumns1,
/* ColNames: */ 0, 0,
/* iArg: */ SQLITE_FullFSync },
#endif
@@ -112062,7 +112099,7 @@ static const PragmaName aPragmaName[] = {
#if !defined(SQLITE_OMIT_CHECK)
{/* zName: */ "ignore_check_constraints",
/* ePragTyp: */ PragTyp_FLAG,
- /* ePragFlg: */ PragFlg_Result0|PragFlg_NoColumns,
+ /* ePragFlg: */ PragFlg_Result0|PragFlg_NoColumns1,
/* ColNames: */ 0, 0,
/* iArg: */ SQLITE_IgnoreChecks },
#endif
@@ -112120,14 +112157,14 @@ static const PragmaName aPragmaName[] = {
#if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
{/* zName: */ "legacy_file_format",
/* ePragTyp: */ PragTyp_FLAG,
- /* ePragFlg: */ PragFlg_Result0|PragFlg_NoColumns,
+ /* ePragFlg: */ PragFlg_Result0|PragFlg_NoColumns1,
/* ColNames: */ 0, 0,
/* iArg: */ SQLITE_LegacyFileFmt },
#endif
#if !defined(SQLITE_OMIT_PAGER_PRAGMAS) && SQLITE_ENABLE_LOCKING_STYLE
{/* zName: */ "lock_proxy_file",
/* ePragTyp: */ PragTyp_LOCK_PROXY_FILE,
- /* ePragFlg: */ 0,
+ /* ePragFlg: */ PragFlg_NoColumns1,
/* ColNames: */ 0, 0,
/* iArg: */ 0 },
#endif
@@ -112161,7 +112198,7 @@ static const PragmaName aPragmaName[] = {
/* iArg: */ 0 },
{/* zName: */ "page_size",
/* ePragTyp: */ PragTyp_PAGE_SIZE,
- /* ePragFlg: */ PragFlg_Result0|PragFlg_SchemaReq,
+ /* ePragFlg: */ PragFlg_Result0|PragFlg_SchemaReq|PragFlg_NoColumns1,
/* ColNames: */ 0, 0,
/* iArg: */ 0 },
#endif
@@ -112175,7 +112212,7 @@ static const PragmaName aPragmaName[] = {
#if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
{/* zName: */ "query_only",
/* ePragTyp: */ PragTyp_FLAG,
- /* ePragFlg: */ PragFlg_Result0|PragFlg_NoColumns,
+ /* ePragFlg: */ PragFlg_Result0|PragFlg_NoColumns1,
/* ColNames: */ 0, 0,
/* iArg: */ SQLITE_QueryOnly },
#endif
@@ -112189,12 +112226,12 @@ static const PragmaName aPragmaName[] = {
#if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
{/* zName: */ "read_uncommitted",
/* ePragTyp: */ PragTyp_FLAG,
- /* ePragFlg: */ PragFlg_Result0|PragFlg_NoColumns,
+ /* ePragFlg: */ PragFlg_Result0|PragFlg_NoColumns1,
/* ColNames: */ 0, 0,
/* iArg: */ SQLITE_ReadUncommitted },
{/* zName: */ "recursive_triggers",
/* ePragTyp: */ PragTyp_FLAG,
- /* ePragFlg: */ PragFlg_Result0|PragFlg_NoColumns,
+ /* ePragFlg: */ PragFlg_Result0|PragFlg_NoColumns1,
/* ColNames: */ 0, 0,
/* iArg: */ SQLITE_RecTriggers },
#endif
@@ -112208,14 +112245,14 @@ static const PragmaName aPragmaName[] = {
#if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
{/* zName: */ "reverse_unordered_selects",
/* ePragTyp: */ PragTyp_FLAG,
- /* ePragFlg: */ PragFlg_Result0|PragFlg_NoColumns,
+ /* ePragFlg: */ PragFlg_Result0|PragFlg_NoColumns1,
/* ColNames: */ 0, 0,
/* iArg: */ SQLITE_ReverseOrder },
#endif
#if !defined(SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS)
{/* zName: */ "schema_version",
/* ePragTyp: */ PragTyp_HEADER_VALUE,
- /* ePragFlg: */ PragFlg_Result0,
+ /* ePragFlg: */ PragFlg_NoColumns1|PragFlg_Result0,
/* ColNames: */ 0, 0,
/* iArg: */ BTREE_SCHEMA_VERSION },
#endif
@@ -112229,13 +112266,13 @@ static const PragmaName aPragmaName[] = {
#if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
{/* zName: */ "short_column_names",
/* ePragTyp: */ PragTyp_FLAG,
- /* ePragFlg: */ PragFlg_Result0|PragFlg_NoColumns,
+ /* ePragFlg: */ PragFlg_Result0|PragFlg_NoColumns1,
/* ColNames: */ 0, 0,
/* iArg: */ SQLITE_ShortColNames },
#endif
{/* zName: */ "shrink_memory",
/* ePragTyp: */ PragTyp_SHRINK_MEMORY,
- /* ePragFlg: */ 0,
+ /* ePragFlg: */ PragFlg_NoColumns,
/* ColNames: */ 0, 0,
/* iArg: */ 0 },
{/* zName: */ "soft_heap_limit",
@@ -112247,7 +112284,7 @@ static const PragmaName aPragmaName[] = {
#if defined(SQLITE_DEBUG)
{/* zName: */ "sql_trace",
/* ePragTyp: */ PragTyp_FLAG,
- /* ePragFlg: */ PragFlg_Result0|PragFlg_NoColumns,
+ /* ePragFlg: */ PragFlg_Result0|PragFlg_NoColumns1,
/* ColNames: */ 0, 0,
/* iArg: */ SQLITE_SqlTrace },
#endif
@@ -112262,7 +112299,7 @@ static const PragmaName aPragmaName[] = {
#if !defined(SQLITE_OMIT_PAGER_PRAGMAS)
{/* zName: */ "synchronous",
/* ePragTyp: */ PragTyp_SYNCHRONOUS,
- /* ePragFlg: */ PragFlg_NeedSchema|PragFlg_Result0|PragFlg_SchemaReq,
+ /* ePragFlg: */ PragFlg_NeedSchema|PragFlg_Result0|PragFlg_SchemaReq|PragFlg_NoColumns1,
/* ColNames: */ 0, 0,
/* iArg: */ 0 },
#endif
@@ -112276,12 +112313,12 @@ static const PragmaName aPragmaName[] = {
#if !defined(SQLITE_OMIT_PAGER_PRAGMAS)
{/* zName: */ "temp_store",
/* ePragTyp: */ PragTyp_TEMP_STORE,
- /* ePragFlg: */ PragFlg_Result0,
+ /* ePragFlg: */ PragFlg_Result0|PragFlg_NoColumns1,
/* ColNames: */ 0, 0,
/* iArg: */ 0 },
{/* zName: */ "temp_store_directory",
/* ePragTyp: */ PragTyp_TEMP_STORE_DIRECTORY,
- /* ePragFlg: */ 0,
+ /* ePragFlg: */ PragFlg_NoColumns1,
/* ColNames: */ 0, 0,
/* iArg: */ 0 },
#endif
@@ -112293,7 +112330,7 @@ static const PragmaName aPragmaName[] = {
#if !defined(SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS)
{/* zName: */ "user_version",
/* ePragTyp: */ PragTyp_HEADER_VALUE,
- /* ePragFlg: */ PragFlg_Result0,
+ /* ePragFlg: */ PragFlg_NoColumns1|PragFlg_Result0,
/* ColNames: */ 0, 0,
/* iArg: */ BTREE_USER_VERSION },
#endif
@@ -112301,27 +112338,27 @@ static const PragmaName aPragmaName[] = {
#if defined(SQLITE_DEBUG)
{/* zName: */ "vdbe_addoptrace",
/* ePragTyp: */ PragTyp_FLAG,
- /* ePragFlg: */ PragFlg_Result0|PragFlg_NoColumns,
+ /* ePragFlg: */ PragFlg_Result0|PragFlg_NoColumns1,
/* ColNames: */ 0, 0,
/* iArg: */ SQLITE_VdbeAddopTrace },
{/* zName: */ "vdbe_debug",
/* ePragTyp: */ PragTyp_FLAG,
- /* ePragFlg: */ PragFlg_Result0|PragFlg_NoColumns,
+ /* ePragFlg: */ PragFlg_Result0|PragFlg_NoColumns1,
/* ColNames: */ 0, 0,
/* iArg: */ SQLITE_SqlTrace|SQLITE_VdbeListing|SQLITE_VdbeTrace },
{/* zName: */ "vdbe_eqp",
/* ePragTyp: */ PragTyp_FLAG,
- /* ePragFlg: */ PragFlg_Result0|PragFlg_NoColumns,
+ /* ePragFlg: */ PragFlg_Result0|PragFlg_NoColumns1,
/* ColNames: */ 0, 0,
/* iArg: */ SQLITE_VdbeEQP },
{/* zName: */ "vdbe_listing",
/* ePragTyp: */ PragTyp_FLAG,
- /* ePragFlg: */ PragFlg_Result0|PragFlg_NoColumns,
+ /* ePragFlg: */ PragFlg_Result0|PragFlg_NoColumns1,
/* ColNames: */ 0, 0,
/* iArg: */ SQLITE_VdbeListing },
{/* zName: */ "vdbe_trace",
/* ePragTyp: */ PragTyp_FLAG,
- /* ePragFlg: */ PragFlg_Result0|PragFlg_NoColumns,
+ /* ePragFlg: */ PragFlg_Result0|PragFlg_NoColumns1,
/* ColNames: */ 0, 0,
/* iArg: */ SQLITE_VdbeTrace },
#endif
@@ -112341,7 +112378,7 @@ static const PragmaName aPragmaName[] = {
#if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
{/* zName: */ "writable_schema",
/* ePragTyp: */ PragTyp_FLAG,
- /* ePragFlg: */ PragFlg_Result0|PragFlg_NoColumns,
+ /* ePragFlg: */ PragFlg_Result0|PragFlg_NoColumns1,
/* ColNames: */ 0, 0,
/* iArg: */ SQLITE_WriteSchema|SQLITE_RecoveryMode },
#endif
@@ -112729,7 +112766,9 @@ SQLITE_PRIVATE void sqlite3Pragma(
}
/* Register the result column names for pragmas that return results */
- if( (pPragma->mPragFlg & PragFlg_NoColumns)==0 ){
+ if( (pPragma->mPragFlg & PragFlg_NoColumns)==0
+ && ((pPragma->mPragFlg & PragFlg_NoColumns1)==0 || zRight==0)
+ ){
setPragmaResultColumnNames(v, pPragma);
}
@@ -114274,6 +114313,15 @@ SQLITE_PRIVATE void sqlite3Pragma(
} /* End of the PRAGMA switch */
+ /* The following block is a no-op unless SQLITE_DEBUG is defined. Its only
+ ** purpose is to execute assert() statements to verify that if the
+ ** PragFlg_NoColumns1 flag is set and the caller specified an argument
+ ** to the PRAGMA, the implementation has not added any OP_ResultRow
+ ** instructions to the VM. */
+ if( (pPragma->mPragFlg & PragFlg_NoColumns1) && zRight ){
+ sqlite3VdbeVerifyNoResultRow(v);
+ }
+
pragma_out:
sqlite3DbFree(db, zLeft);
sqlite3DbFree(db, zRight);
@@ -116188,8 +116236,7 @@ static void selectInnerLoop(
}else{
ecelFlags = 0;
}
- assert( eDest!=SRT_Table || pSort==0 );
- if( pSort && hasDistinct==0 && eDest!=SRT_EphemTab ){
+ if( pSort && hasDistinct==0 && eDest!=SRT_EphemTab && eDest!=SRT_Table ){
/* For each expression in pEList that is a copy of an expression in
** the ORDER BY clause (pSort->pOrderBy), set the associated
** iOrderByCol value to one more than the index of the ORDER BY
@@ -116731,6 +116778,7 @@ static void generateSortTail(
VdbeComment((v, "%s", aOutEx[i].zName ? aOutEx[i].zName : aOutEx[i].zSpan));
}
switch( eDest ){
+ case SRT_Table:
case SRT_EphemTab: {
sqlite3VdbeAddOp2(v, OP_NewRowid, iParm, regRowid);
sqlite3VdbeAddOp3(v, OP_Insert, iParm, regRow, regRowid);
@@ -189750,7 +189798,7 @@ static void fts5SegIterNext(
else if( pLeaf->nn>pLeaf->szLeaf ){
pIter->iPgidxOff = pLeaf->szLeaf + fts5GetVarint32(
&pLeaf->p[pLeaf->szLeaf], iOff
- );
+ );
pIter->iLeafOffset = iOff;
pIter->iEndofDoclist = iOff;
bNewTerm = 1;
@@ -189784,6 +189832,7 @@ static void fts5SegIterNext(
*/
int nSz;
assert( p->rc==SQLITE_OK );
+ assert( pIter->iLeafOffset<=pIter->pLeaf->nn );
fts5FastGetVarint32(pIter->pLeaf->p, pIter->iLeafOffset, nSz);
pIter->bDel = (nSz & 0x0001);
pIter->nPos = nSz>>1;
@@ -190778,7 +190827,7 @@ static void fts5ChunkIterate(
break;
}else{
pgno++;
- pData = fts5DataRead(p, FTS5_SEGMENT_ROWID(pSeg->pSeg->iSegid, pgno));
+ pData = fts5LeafRead(p, FTS5_SEGMENT_ROWID(pSeg->pSeg->iSegid, pgno));
if( pData==0 ) break;
pChunk = &pData->p[4];
nChunk = MIN(nRem, pData->szLeaf - 4);
@@ -193540,7 +193589,7 @@ static void fts5IndexIntegrityCheckSegment(
** ignore this b-tree entry. Otherwise, load it into memory. */
if( iIdxLeaf<pSeg->pgnoFirst ) continue;
iRow = FTS5_SEGMENT_ROWID(pSeg->iSegid, iIdxLeaf);
- pLeaf = fts5DataRead(p, iRow);
+ pLeaf = fts5LeafRead(p, iRow);
if( pLeaf==0 ) break;
/* Check that the leaf contains at least one term, and that it is equal
@@ -196816,7 +196865,7 @@ static void fts5SourceIdFunc(
){
assert( nArg==0 );
UNUSED_PARAM2(nArg, apUnused);
- sqlite3_result_text(pCtx, "fts5: 2017-01-03 18:27:03 979f04392853b8053817a3eea2fc679947b437fd", -1, SQLITE_TRANSIENT);
+ sqlite3_result_text(pCtx, "fts5: 2017-01-06 16:32:41 a65a62893ca8319e89e48b8a38cf8a59c69a8209", -1, SQLITE_TRANSIENT);
}
static int fts5Init(sqlite3 *db){
diff --git a/src/3rdparty/sqlite/sqlite3.h b/src/3rdparty/sqlite/sqlite3.h
index 33910e0683..35fa4171d3 100644
--- a/src/3rdparty/sqlite/sqlite3.h
+++ b/src/3rdparty/sqlite/sqlite3.h
@@ -121,9 +121,9 @@ extern "C" {
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
** [sqlite_version()] and [sqlite_source_id()].
*/
-#define SQLITE_VERSION "3.16.1"
-#define SQLITE_VERSION_NUMBER 3016001
-#define SQLITE_SOURCE_ID "2017-01-03 18:27:03 979f04392853b8053817a3eea2fc679947b437fd"
+#define SQLITE_VERSION "3.16.2"
+#define SQLITE_VERSION_NUMBER 3016002
+#define SQLITE_SOURCE_ID "2017-01-06 16:32:41 a65a62893ca8319e89e48b8a38cf8a59c69a8209"
/*
** CAPI3REF: Run-Time Library Version Numbers
@@ -3896,8 +3896,12 @@ SQLITE_API int sqlite3_clear_bindings(sqlite3_stmt*);
** METHOD: sqlite3_stmt
**
** ^Return the number of columns in the result set returned by the
-** [prepared statement]. ^This routine returns 0 if pStmt is an SQL
-** statement that does not return data (for example an [UPDATE]).
+** [prepared statement]. ^If this routine returns 0, that means the
+** [prepared statement] returns no data (for example an [UPDATE]).
+** ^However, just because this routine returns a positive number does not
+** mean that one or more rows of data will be returned. ^A SELECT statement
+** will always have a positive sqlite3_column_count() but depending on the
+** WHERE clause constraints and the table content, it might return no rows.
**
** See also: [sqlite3_data_count()]
*/
diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtNative.java b/src/android/jar/src/org/qtproject/qt5/android/QtNative.java
index c74e38d997..ccd8ec410e 100644
--- a/src/android/jar/src/org/qtproject/qt5/android/QtNative.java
+++ b/src/android/jar/src/org/qtproject/qt5/android/QtNative.java
@@ -52,7 +52,8 @@ import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Handler;
import android.os.Looper;
-import android.text.ClipboardManager;
+import android.content.ClipboardManager;
+import android.content.ClipboardManager.OnPrimaryClipChangedListener;
import android.os.Build;
import android.util.Log;
import android.view.ContextMenu;
@@ -584,7 +585,14 @@ public class QtNative
@Override
public void run() {
if (m_activity != null)
- m_clipboardManager = (android.text.ClipboardManager) m_activity.getSystemService(Context.CLIPBOARD_SERVICE);
+ m_clipboardManager = (android.content.ClipboardManager) m_activity.getSystemService(Context.CLIPBOARD_SERVICE);
+ if (m_clipboardManager != null) {
+ m_clipboardManager.addPrimaryClipChangedListener(new ClipboardManager.OnPrimaryClipChangedListener() {
+ public void onPrimaryClipChanged() {
+ onClipboardDataChanged();
+ }
+ });
+ }
semaphore.release();
}
});
@@ -844,6 +852,10 @@ public class QtNative
public static native void onContextMenuClosed(Menu menu);
// menu methods
+ // clipboard methods
+ public static native void onClipboardDataChanged();
+ // clipboard methods
+
// activity methods
public static native void onActivityResult(int requestCode, int resultCode, Intent data);
public static native void onNewIntent(Intent data);
diff --git a/src/corelib/animation/qabstractanimation.cpp b/src/corelib/animation/qabstractanimation.cpp
index 8c189e9288..2041b8816e 100644
--- a/src/corelib/animation/qabstractanimation.cpp
+++ b/src/corelib/animation/qabstractanimation.cpp
@@ -1484,5 +1484,6 @@ void QAbstractAnimation::updateDirection(QAbstractAnimation::Direction direction
QT_END_NAMESPACE
#include "moc_qabstractanimation.cpp"
+#include "moc_qabstractanimation_p.cpp"
#endif //QT_NO_ANIMATION
diff --git a/src/corelib/doc/snippets/code/src_corelib_io_qdiriterator.cpp b/src/corelib/doc/snippets/code/src_corelib_io_qdiriterator.cpp
index 7a6ffeae06..31442a5516 100644
--- a/src/corelib/doc/snippets/code/src_corelib_io_qdiriterator.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_io_qdiriterator.cpp
@@ -60,3 +60,12 @@ while (it.hasNext()) {
// ...
}
//! [0]
+
+//! [1]
+QDirIterator it("/sys", QStringList() << "scaling_cur_freq", QDir::NoFilter, QDirIterator::Subdirectories);
+while (it.hasNext()) {
+ QFile f(it.next());
+ f.open(QIODevice::ReadOnly);
+ qDebug() << f.fileName() << f.readAll().trimmed().toDouble() / 1000 << "MHz";
+}
+//! [1]
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index c37503f3db..22fc20d47e 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -3988,8 +3988,10 @@ bool QInternal::registerCallback(Callback cb, qInternalCallback callback)
bool QInternal::unregisterCallback(Callback cb, qInternalCallback callback)
{
if (cb >= 0 && cb < QInternal::LastCallback) {
- QInternal_CallBackTable *cbt = global_callback_table();
- return (bool) cbt->callbacks[cb].removeAll(callback);
+ if (global_callback_table.exists()) {
+ QInternal_CallBackTable *cbt = global_callback_table();
+ return (bool) cbt->callbacks[cb].removeAll(callback);
+ }
}
return false;
}
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc
index 404bbfe65a..c030baa05c 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -203,7 +203,7 @@
\value AA_SetPalette Indicates whether a palette was explicitly set on the
QApplication/QGuiApplication. This value has been added in Qt 5.5.
- \value AA_EnableHighDpiScaling. Enables high-DPI scaling in Qt on supported
+ \value AA_EnableHighDpiScaling Enables high-DPI scaling in Qt on supported
platforms (see also \l{High DPI Displays}). Supported platforms are
X11, Windows and Android. Enabling makes Qt scale the main (device
independent) coordinate system according to display scale factors
@@ -364,7 +364,7 @@
\omitvalue KeyboardModifierMask
\note On \macos, the \c ControlModifier value corresponds to
- the Command keys on the Macintosh keyboard, and the \c MetaModifier value
+ the Command keys on the keyboard, and the \c MetaModifier value
corresponds to the Control keys. The \c KeypadModifier value will also be set
when an arrow key is pressed as the arrow keys are considered part of the
keypad.
@@ -382,7 +382,7 @@
supported by Qt.
\note On \macos, the \c CTRL value corresponds to
- the Command keys on the Macintosh keyboard, and the \c META value
+ the Command keys on the keyboard, and the \c META value
corresponds to the Control keys.
\value SHIFT The Shift keys provided on all standard keyboards.
@@ -2084,12 +2084,12 @@
We refer to a top-level window that has a parent
as a \e secondary window.
- \value Sheet Indicates that the window is a Macintosh sheet. Since
+ \value Sheet Indicates that the window is a sheet on \macos. Since
using a sheet implies window modality, the recommended
way is to use QWidget::setWindowModality(), or
QDialog::open(), instead.
- \value Drawer Indicates that the widget is a Macintosh drawer.
+ \value Drawer Indicates that the widget is a drawer on \macos.
\value Popup Indicates that the widget is a pop-up top-level
window, i.e. that it is modal, but has a window
diff --git a/src/corelib/global/qprocessordetection.h b/src/corelib/global/qprocessordetection.h
index ed11e013f2..0b260d01e3 100644
--- a/src/corelib/global/qprocessordetection.h
+++ b/src/corelib/global/qprocessordetection.h
@@ -94,8 +94,8 @@
ARM is bi-endian, detect using __ARMEL__ or __ARMEB__, falling back to
auto-detection implemented below.
*/
-#if defined(__arm__) || defined(__TARGET_ARCH_ARM) || defined(_M_ARM) || defined(__aarch64__)
-# if defined(__aarch64__)
+#if defined(__arm__) || defined(__TARGET_ARCH_ARM) || defined(_M_ARM) || defined(__aarch64__) || defined(__ARM64__)
+# if defined(__aarch64__) || defined(__ARM64__)
# define Q_PROCESSOR_ARM_64
# define Q_PROCESSOR_WORDSIZE 8
# else
@@ -109,7 +109,8 @@
# define Q_PROCESSOR_ARM _M_ARM
# elif defined(__ARM64_ARCH_8__) \
|| defined(__aarch64__) \
- || defined(__CORE_CORTEXAV8__) // GHS-specific for INTEGRITY
+ || defined(__ARMv8__) \
+ || defined(__ARMv8_A__)
# define Q_PROCESSOR_ARM 8
# elif defined(__ARM_ARCH_7__) \
|| defined(__ARM_ARCH_7A__) \
@@ -117,7 +118,7 @@
|| defined(__ARM_ARCH_7M__) \
|| defined(__ARM_ARCH_7S__) \
|| defined(_ARM_ARCH_7) \
- || defined(__CORE_CORTEXA__) // GHS-specific for INTEGRITY
+ || defined(__CORE_CORTEXA__)
# define Q_PROCESSOR_ARM 7
# elif defined(__ARM_ARCH_6__) \
|| defined(__ARM_ARCH_6J__) \
diff --git a/src/corelib/io/qdiriterator.cpp b/src/corelib/io/qdiriterator.cpp
index 5fd9edc552..648593b020 100644
--- a/src/corelib/io/qdiriterator.cpp
+++ b/src/corelib/io/qdiriterator.cpp
@@ -56,6 +56,10 @@
\snippet code/src_corelib_io_qdiriterator.cpp 0
+ Here's how to find and read all files filtered by name, recursively:
+
+ \snippet code/src_corelib_io_qdiriterator.cpp 1
+
The next() function returns the path to the next directory entry and
advances the iterator. You can also call filePath() to get the current
file path without advancing the iterator. The fileName() function returns
@@ -204,6 +208,8 @@ void QDirIteratorPrivate::pushDirectory(const QFileInfo &fileInfo)
QFileSystemIterator *it = new QFileSystemIterator(fileInfo.d_ptr->fileEntry,
filters, nameFilters, iteratorFlags);
nativeIterators << it;
+#else
+ qWarning("Qt was built with -no-feature-filesystemiterator: no files/plugins will be found!");
#endif
}
}
diff --git a/src/corelib/io/qfile.cpp b/src/corelib/io/qfile.cpp
index 41fae69bb2..06d706b915 100644
--- a/src/corelib/io/qfile.cpp
+++ b/src/corelib/io/qfile.cpp
@@ -1106,3 +1106,7 @@ qint64 QFile::size() const
}
QT_END_NAMESPACE
+
+#ifndef QT_NO_QOBJECT
+#include "moc_qfile.cpp"
+#endif
diff --git a/src/corelib/io/qfiledevice.cpp b/src/corelib/io/qfiledevice.cpp
index ce9c8275ce..715dc7293a 100644
--- a/src/corelib/io/qfiledevice.cpp
+++ b/src/corelib/io/qfiledevice.cpp
@@ -739,3 +739,7 @@ bool QFileDevice::unmap(uchar *address)
}
QT_END_NAMESPACE
+
+#ifndef QT_NO_QOBJECT
+#include "moc_qfiledevice.cpp"
+#endif
diff --git a/src/corelib/io/qfilesystemwatcher.cpp b/src/corelib/io/qfilesystemwatcher.cpp
index 612b3fa57c..ed597c415b 100644
--- a/src/corelib/io/qfilesystemwatcher.cpp
+++ b/src/corelib/io/qfilesystemwatcher.cpp
@@ -497,6 +497,7 @@ QStringList QFileSystemWatcher::files() const
QT_END_NAMESPACE
#include "moc_qfilesystemwatcher.cpp"
+#include "moc_qfilesystemwatcher_p.cpp"
#endif // QT_NO_FILESYSTEMWATCHER
diff --git a/src/corelib/io/qfilesystemwatcher_inotify.cpp b/src/corelib/io/qfilesystemwatcher_inotify.cpp
index 5564bc7dca..3cfc6a254f 100644
--- a/src/corelib/io/qfilesystemwatcher_inotify.cpp
+++ b/src/corelib/io/qfilesystemwatcher_inotify.cpp
@@ -417,4 +417,6 @@ QString QInotifyFileSystemWatcherEngine::getPathFromID(int id) const
QT_END_NAMESPACE
+#include "moc_qfilesystemwatcher_inotify_p.cpp"
+
#endif // QT_NO_FILESYSTEMWATCHER
diff --git a/src/corelib/io/qfilesystemwatcher_polling.cpp b/src/corelib/io/qfilesystemwatcher_polling.cpp
index cbcb68e7d2..5bef8127f7 100644
--- a/src/corelib/io/qfilesystemwatcher_polling.cpp
+++ b/src/corelib/io/qfilesystemwatcher_polling.cpp
@@ -151,4 +151,7 @@ void QPollingFileSystemWatcherEngine::timeout()
}
QT_END_NAMESPACE
+
+#include "moc_qfilesystemwatcher_polling_p.cpp"
+
#endif // !QT_NO_FILESYSTEMWATCHER
diff --git a/src/corelib/io/qiodevice.cpp b/src/corelib/io/qiodevice.cpp
index 41a4d7a1ba..80122eac5e 100644
--- a/src/corelib/io/qiodevice.cpp
+++ b/src/corelib/io/qiodevice.cpp
@@ -2059,3 +2059,7 @@ QDebug operator<<(QDebug debug, QIODevice::OpenMode modes)
#endif
QT_END_NAMESPACE
+
+#ifndef QT_NO_QOBJECT
+#include "moc_qiodevice.cpp"
+#endif
diff --git a/src/corelib/io/qnoncontiguousbytedevice.cpp b/src/corelib/io/qnoncontiguousbytedevice.cpp
index 61299b8aa8..beca6ccbf7 100644
--- a/src/corelib/io/qnoncontiguousbytedevice.cpp
+++ b/src/corelib/io/qnoncontiguousbytedevice.cpp
@@ -578,3 +578,4 @@ QIODevice* QNonContiguousByteDeviceFactory::wrap(QNonContiguousByteDevice* byteD
QT_END_NAMESPACE
+#include "moc_qnoncontiguousbytedevice_p.cpp"
diff --git a/src/corelib/io/qsavefile.cpp b/src/corelib/io/qsavefile.cpp
index d8166014db..0283c5f31f 100644
--- a/src/corelib/io/qsavefile.cpp
+++ b/src/corelib/io/qsavefile.cpp
@@ -412,4 +412,8 @@ bool QSaveFile::directWriteFallback() const
QT_END_NAMESPACE
+#ifndef QT_NO_QOBJECT
+#include "moc_qsavefile.cpp"
+#endif
+
#endif // QT_NO_TEMPORARYFILE
diff --git a/src/corelib/io/qsettings.cpp b/src/corelib/io/qsettings.cpp
index 16dab38a60..d5460238ec 100644
--- a/src/corelib/io/qsettings.cpp
+++ b/src/corelib/io/qsettings.cpp
@@ -3513,4 +3513,8 @@ QSettings::Format QSettings::registerFormat(const QString &extension, ReadFunc r
QT_END_NAMESPACE
+#ifndef QT_BOOTSTRAPPED
+#include "moc_qsettings.cpp"
+#endif
+
#endif // QT_NO_SETTINGS
diff --git a/src/corelib/io/qstandardpaths.cpp b/src/corelib/io/qstandardpaths.cpp
index 4cf3a3e9bd..f2368c3b23 100644
--- a/src/corelib/io/qstandardpaths.cpp
+++ b/src/corelib/io/qstandardpaths.cpp
@@ -645,4 +645,8 @@ bool QStandardPaths::isTestModeEnabled()
QT_END_NAMESPACE
+#ifndef QT_NO_QOBJECT
+#include "moc_qstandardpaths.cpp"
+#endif
+
#endif // QT_NO_STANDARDPATHS
diff --git a/src/corelib/io/qstorageinfo_unix.cpp b/src/corelib/io/qstorageinfo_unix.cpp
index b9c9883609..9072b34f54 100644
--- a/src/corelib/io/qstorageinfo_unix.cpp
+++ b/src/corelib/io/qstorageinfo_unix.cpp
@@ -195,8 +195,12 @@ static bool shouldIncludeFs(const QStorageIterator &it)
#if defined(Q_OS_BSD4)
+#ifndef MNT_NOWAIT
+# define MNT_NOWAIT 0
+#endif
+
inline QStorageIterator::QStorageIterator()
- : entryCount(::getmntinfo(&stat_buf, 0)),
+ : entryCount(::getmntinfo(&stat_buf, MNT_NOWAIT)),
currentIndex(-1)
{
}
diff --git a/src/corelib/io/qtemporarydir.cpp b/src/corelib/io/qtemporarydir.cpp
index b2bf9fce97..ffaee9c683 100644
--- a/src/corelib/io/qtemporarydir.cpp
+++ b/src/corelib/io/qtemporarydir.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2017 The Qt Company Ltd.
** Copyright (C) 2016 Intel Corporation.
** Contact: https://www.qt.io/licensing/
**
@@ -198,10 +198,10 @@ void QTemporaryDirPrivate::create(const QString &templateName)
\ingroup io
- QTemporaryDir is used to create unique temporary dirs safely.
- The dir itself is created by the constructor. The name of the
+ QTemporaryDir is used to create unique temporary directories safely.
+ The directory itself is created by the constructor. The name of the
temporary directory is guaranteed to be unique (i.e., you are
- guaranteed to not overwrite an existing dir), and the directory will
+ guaranteed to not overwrite an existing directory), and the directory will
subsequently be removed upon destruction of the QTemporaryDir
object. The directory name is either auto-generated, or created based
on a template, which is passed to QTemporaryDir's constructor.
@@ -214,7 +214,7 @@ void QTemporaryDirPrivate::create(const QString &templateName)
created, using isValid(). Do not use \l {QDir::exists()}{exists()}, since a default-constructed
QDir represents the current directory, which exists.
- The path to the temporary dir can be found by calling path().
+ The path to the temporary directory can be found by calling path().
A temporary directory will have some static part of the name and some
part that is calculated to be unique. The default path will be
diff --git a/src/corelib/io/qtemporaryfile.cpp b/src/corelib/io/qtemporaryfile.cpp
index 7aae128796..8a99873fee 100644
--- a/src/corelib/io/qtemporaryfile.cpp
+++ b/src/corelib/io/qtemporaryfile.cpp
@@ -796,4 +796,6 @@ QT_END_NAMESPACE
#endif // QT_NO_TEMPORARYFILE
-
+#ifndef QT_NO_QOBJECT
+#include "moc_qtemporaryfile.cpp"
+#endif
diff --git a/src/corelib/io/qtextstream.cpp b/src/corelib/io/qtextstream.cpp
index 9b565bff9d..5144ac0ec9 100644
--- a/src/corelib/io/qtextstream.cpp
+++ b/src/corelib/io/qtextstream.cpp
@@ -3188,3 +3188,6 @@ QLocale QTextStream::locale() const
QT_END_NAMESPACE
+#ifndef QT_NO_QOBJECT
+#include "moc_qtextstream_p.cpp"
+#endif
diff --git a/src/corelib/itemmodels/qabstractitemmodel.cpp b/src/corelib/itemmodels/qabstractitemmodel.cpp
index 0c87dd5659..c0737ffb36 100644
--- a/src/corelib/itemmodels/qabstractitemmodel.cpp
+++ b/src/corelib/itemmodels/qabstractitemmodel.cpp
@@ -3804,3 +3804,5 @@ void QAbstractItemModelPrivate::Persistent::insertMultiAtEnd(const QModelIndex&
}
QT_END_NAMESPACE
+
+#include "moc_qabstractitemmodel.cpp"
diff --git a/src/corelib/itemmodels/qitemselectionmodel.cpp b/src/corelib/itemmodels/qitemselectionmodel.cpp
index 74bd7abfcb..8dcd80808b 100644
--- a/src/corelib/itemmodels/qitemselectionmodel.cpp
+++ b/src/corelib/itemmodels/qitemselectionmodel.cpp
@@ -945,13 +945,14 @@ static QItemSelection mergeRowLengths(const QVector<QPair<QPersistentModelIndex,
const uint nextLength = rowLengths.at(i).second;
if ((nextLength == length)
&& (next.row() == br.row() + 1)
+ && (next.column() == br.column())
&& (next.parent() == br.parent())) {
br = next;
} else {
break;
}
}
- result.append(QItemSelectionRange(tl, br.sibling(br.row(), length - 1)));
+ result.append(QItemSelectionRange(tl, br.sibling(br.row(), br.column() + length - 1)));
}
return result;
}
@@ -1266,6 +1267,21 @@ void QItemSelectionModel::select(const QModelIndex &index, QItemSelectionModel::
convenience.
*/
+namespace {
+namespace QtFunctionObjects {
+struct IsNotValid {
+ typedef bool result_type;
+ struct is_transparent : std::true_type {};
+ template <typename T>
+ Q_DECL_CONSTEXPR bool operator()(T &t) const Q_DECL_NOEXCEPT_EXPR(noexcept(t.isValid()))
+ { return !t.isValid(); }
+ template <typename T>
+ Q_DECL_CONSTEXPR bool operator()(T *t) const Q_DECL_NOEXCEPT_EXPR(noexcept(t->isValid()))
+ { return !t->isValid(); }
+};
+}
+} // unnamed namespace
+
/*!
Selects the item \a selection using the specified \a command, and emits
selectionChanged().
@@ -1289,13 +1305,9 @@ void QItemSelectionModel::select(const QItemSelection &selection, QItemSelection
// be too late if another model observer is connected to the same modelReset slot and is invoked first
// it might call select() on this selection model before any such QItemSelectionModelPrivate::_q_modelReset() slot
// is invoked, so it would not be cleared yet. We clear it invalid ranges in it here.
- QItemSelection::iterator it = d->ranges.begin();
- while (it != d->ranges.end()) {
- if (!it->isValid())
- it = d->ranges.erase(it);
- else
- ++it;
- }
+ using namespace QtFunctionObjects;
+ d->ranges.erase(std::remove_if(d->ranges.begin(), d->ranges.end(), IsNotValid()),
+ d->ranges.end());
QItemSelection old = d->ranges;
old.merge(d->currentSelection, d->currentCommand);
@@ -1747,12 +1759,9 @@ const QItemSelection QItemSelectionModel::selection() const
selected.merge(d->currentSelection, d->currentCommand);
// make sure we have no invalid ranges
// ### should probably be handled more generic somewhere else
- auto isNotValid = [](const QItemSelectionRange& range) {
- return !range.isValid();
- };
-
+ using namespace QtFunctionObjects;
selected.erase(std::remove_if(selected.begin(), selected.end(),
- isNotValid),
+ IsNotValid()),
selected.end());
return selected;
}
diff --git a/src/corelib/itemmodels/qstringlistmodel.cpp b/src/corelib/itemmodels/qstringlistmodel.cpp
index 0f7472aa5a..2b47d43469 100644
--- a/src/corelib/itemmodels/qstringlistmodel.cpp
+++ b/src/corelib/itemmodels/qstringlistmodel.cpp
@@ -328,4 +328,6 @@ Qt::DropActions QStringListModel::supportedDropActions() const
QT_END_NAMESPACE
+#include "moc_qstringlistmodel.cpp"
+
#endif // QT_NO_STRINGLISTMODEL
diff --git a/src/corelib/kernel/qabstracteventdispatcher.cpp b/src/corelib/kernel/qabstracteventdispatcher.cpp
index e94faa4587..d234949d14 100644
--- a/src/corelib/kernel/qabstracteventdispatcher.cpp
+++ b/src/corelib/kernel/qabstracteventdispatcher.cpp
@@ -521,3 +521,5 @@ bool QAbstractEventDispatcher::filterNativeEvent(const QByteArray &eventType, vo
*/
QT_END_NAMESPACE
+
+#include "moc_qabstracteventdispatcher.cpp"
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
index 0104ba0101..39e7c71a9c 100644
--- a/src/corelib/kernel/qcoreapplication.cpp
+++ b/src/corelib/kernel/qcoreapplication.cpp
@@ -2914,3 +2914,7 @@ void QCoreApplication::setEventDispatcher(QAbstractEventDispatcher *eventDispatc
*/
QT_END_NAMESPACE
+
+#ifndef QT_NO_QOBJECT
+#include "moc_qcoreapplication.cpp"
+#endif
diff --git a/src/corelib/kernel/qcoreevent.cpp b/src/corelib/kernel/qcoreevent.cpp
index 4efc38ac89..e90cd842ab 100644
--- a/src/corelib/kernel/qcoreevent.cpp
+++ b/src/corelib/kernel/qcoreevent.cpp
@@ -652,3 +652,5 @@ QDeferredDeleteEvent::~QDeferredDeleteEvent()
*/
QT_END_NAMESPACE
+
+#include "moc_qcoreevent.cpp"
diff --git a/src/corelib/kernel/qeventdispatcher_glib.cpp b/src/corelib/kernel/qeventdispatcher_glib.cpp
index 8ca2ac1c39..8cefa7a118 100644
--- a/src/corelib/kernel/qeventdispatcher_glib.cpp
+++ b/src/corelib/kernel/qeventdispatcher_glib.cpp
@@ -611,3 +611,5 @@ QEventDispatcherGlib::QEventDispatcherGlib(QEventDispatcherGlibPrivate &dd, QObj
}
QT_END_NAMESPACE
+
+#include "moc_qeventdispatcher_glib_p.cpp"
diff --git a/src/corelib/kernel/qeventdispatcher_unix.cpp b/src/corelib/kernel/qeventdispatcher_unix.cpp
index 802962d77d..a28f2e3f0a 100644
--- a/src/corelib/kernel/qeventdispatcher_unix.cpp
+++ b/src/corelib/kernel/qeventdispatcher_unix.cpp
@@ -553,3 +553,5 @@ void QEventDispatcherUNIX::flush()
{ }
QT_END_NAMESPACE
+
+#include "moc_qeventdispatcher_unix_p.cpp"
diff --git a/src/corelib/kernel/qeventdispatcher_win.cpp b/src/corelib/kernel/qeventdispatcher_win.cpp
index 40db5020ab..0952464f53 100644
--- a/src/corelib/kernel/qeventdispatcher_win.cpp
+++ b/src/corelib/kernel/qeventdispatcher_win.cpp
@@ -860,7 +860,7 @@ bool QEventDispatcherWin32::unregisterTimers(QObject *object)
Q_D(QEventDispatcherWin32);
if (d->timerVec.isEmpty())
return false;
- register WinTimerInfo *t;
+ WinTimerInfo *t;
for (int i=0; i<d->timerVec.size(); i++) {
t = d->timerVec.at(i);
if (t && t->obj == object) { // object found
@@ -957,7 +957,7 @@ int QEventDispatcherWin32::remainingTime(int timerId)
quint64 currentTime = qt_msectime();
- register WinTimerInfo *t;
+ WinTimerInfo *t;
for (int i=0; i<d->timerVec.size(); i++) {
t = d->timerVec.at(i);
if (t && t->timerId == timerId) { // timer found
diff --git a/src/corelib/kernel/qeventloop.cpp b/src/corelib/kernel/qeventloop.cpp
index e4b819d9d2..8974ff7709 100644
--- a/src/corelib/kernel/qeventloop.cpp
+++ b/src/corelib/kernel/qeventloop.cpp
@@ -441,3 +441,5 @@ QEventLoopLocker::~QEventLoopLocker()
}
QT_END_NAMESPACE
+
+#include "moc_qeventloop.cpp"
diff --git a/src/corelib/kernel/qmimedata.cpp b/src/corelib/kernel/qmimedata.cpp
index a550ca6ca1..73307e925a 100644
--- a/src/corelib/kernel/qmimedata.cpp
+++ b/src/corelib/kernel/qmimedata.cpp
@@ -678,3 +678,5 @@ void QMimeData::removeFormat(const QString &mimeType)
}
QT_END_NAMESPACE
+
+#include "moc_qmimedata.cpp"
diff --git a/src/corelib/kernel/qobject_p.h b/src/corelib/kernel/qobject_p.h
index a7d7ef0889..7b9253ac64 100644
--- a/src/corelib/kernel/qobject_p.h
+++ b/src/corelib/kernel/qobject_p.h
@@ -198,6 +198,7 @@ public:
static QObjectPrivate *get(QObject *o) {
return o->d_func();
}
+ static const QObjectPrivate *get(const QObject *o) { return o->d_func(); }
int signalIndex(const char *signalName, const QMetaObject **meta = 0) const;
inline bool isSignalConnected(uint signalIdx, bool checkDeclarative = true) const;
diff --git a/src/corelib/kernel/qobjectcleanuphandler.cpp b/src/corelib/kernel/qobjectcleanuphandler.cpp
index f3d23c4b44..b6c62af4b3 100644
--- a/src/corelib/kernel/qobjectcleanuphandler.cpp
+++ b/src/corelib/kernel/qobjectcleanuphandler.cpp
@@ -145,3 +145,5 @@ void QObjectCleanupHandler::objectDestroyed(QObject *object)
}
QT_END_NAMESPACE
+
+#include "moc_qobjectcleanuphandler.cpp"
diff --git a/src/corelib/kernel/qobjectdefs_impl.h b/src/corelib/kernel/qobjectdefs_impl.h
index 3f5f2e78bb..29ab77b269 100644
--- a/src/corelib/kernel/qobjectdefs_impl.h
+++ b/src/corelib/kernel/qobjectdefs_impl.h
@@ -201,7 +201,6 @@ namespace QtPrivate {
typedef List<Args...> Arguments;
typedef Ret ReturnType;
typedef Ret (Obj::*Function) (Args...) noexcept;
- template <class Base> struct ChangeClass { typedef Ret (Base:: *Type)(Args...) noexcept; };
enum {ArgumentCount = sizeof...(Args), IsPointerToMemberFunction = true};
template <typename SignalArgs, typename R>
static void call(Function f, Obj *o, void **arg) {
@@ -214,7 +213,6 @@ namespace QtPrivate {
typedef List<Args...> Arguments;
typedef Ret ReturnType;
typedef Ret (Obj::*Function) (Args...) const noexcept;
- template <class Base> struct ChangeClass { typedef Ret (Base:: *Type)(Args...) const noexcept; };
enum {ArgumentCount = sizeof...(Args), IsPointerToMemberFunction = true};
template <typename SignalArgs, typename R>
static void call(Function f, Obj *o, void **arg) {
@@ -300,7 +298,7 @@ namespace QtPrivate {
static const typename RemoveRef<A1>::Type &dummy();
enum { value = sizeof(test(dummy())) == sizeof(int) };
#ifdef QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
- struct AreArgumentsNarrowed : AreArgumentsNarrowedBase<typename RemoveRef<A1>::Type, typename RemoveRef<A2>::Type> {};
+ using AreArgumentsNarrowed = AreArgumentsNarrowedBase<typename RemoveRef<A1>::Type, typename RemoveRef<A2>::Type>;
Q_STATIC_ASSERT_X(!AreArgumentsNarrowed::value, "Signal and slot arguments are not compatible (narrowing)");
#endif
};
diff --git a/src/corelib/kernel/qsharedmemory.cpp b/src/corelib/kernel/qsharedmemory.cpp
index 29b3e87076..7f185ee9dc 100644
--- a/src/corelib/kernel/qsharedmemory.cpp
+++ b/src/corelib/kernel/qsharedmemory.cpp
@@ -598,3 +598,5 @@ QString QSharedMemory::errorString() const
#endif // QT_NO_SHAREDMEMORY
QT_END_NAMESPACE
+
+#include "moc_qsharedmemory.cpp"
diff --git a/src/corelib/kernel/qsocketnotifier.cpp b/src/corelib/kernel/qsocketnotifier.cpp
index 933eac19ab..2268cb83bb 100644
--- a/src/corelib/kernel/qsocketnotifier.cpp
+++ b/src/corelib/kernel/qsocketnotifier.cpp
@@ -270,3 +270,5 @@ bool QSocketNotifier::event(QEvent *e)
}
QT_END_NAMESPACE
+
+#include "moc_qsocketnotifier.cpp"
diff --git a/src/corelib/kernel/qtimer.cpp b/src/corelib/kernel/qtimer.cpp
index 0c314526cb..55f75ab17e 100644
--- a/src/corelib/kernel/qtimer.cpp
+++ b/src/corelib/kernel/qtimer.cpp
@@ -670,3 +670,4 @@ int QTimer::remainingTime() const
QT_END_NAMESPACE
#include "qtimer.moc"
+#include "moc_qtimer.cpp"
diff --git a/src/corelib/kernel/qtranslator.cpp b/src/corelib/kernel/qtranslator.cpp
index 04a5e7ed7a..2232e24a25 100644
--- a/src/corelib/kernel/qtranslator.cpp
+++ b/src/corelib/kernel/qtranslator.cpp
@@ -1143,4 +1143,6 @@ bool QTranslator::isEmpty() const
QT_END_NAMESPACE
+#include "moc_qtranslator.cpp"
+
#endif // QT_NO_TRANSLATION
diff --git a/src/corelib/plugin/qfactoryloader.cpp b/src/corelib/plugin/qfactoryloader.cpp
index 21f1007d5b..40000e7b24 100644
--- a/src/corelib/plugin/qfactoryloader.cpp
+++ b/src/corelib/plugin/qfactoryloader.cpp
@@ -346,4 +346,6 @@ int QFactoryLoader::indexOf(const QString &needle) const
QT_END_NAMESPACE
+#include "moc_qfactoryloader_p.cpp"
+
#endif // QT_NO_QOBJECT
diff --git a/src/corelib/plugin/qlibrary.cpp b/src/corelib/plugin/qlibrary.cpp
index 6421e7c5d8..3d04d0802d 100644
--- a/src/corelib/plugin/qlibrary.cpp
+++ b/src/corelib/plugin/qlibrary.cpp
@@ -1129,3 +1129,5 @@ bool qt_debug_component()
}
QT_END_NAMESPACE
+
+#include "moc_qlibrary.cpp"
diff --git a/src/corelib/plugin/qpluginloader.cpp b/src/corelib/plugin/qpluginloader.cpp
index dbd3bee556..aab00cc7eb 100644
--- a/src/corelib/plugin/qpluginloader.cpp
+++ b/src/corelib/plugin/qpluginloader.cpp
@@ -479,3 +479,4 @@ QJsonObject QStaticPlugin::metaData() const
QT_END_NAMESPACE
+#include "moc_qpluginloader.cpp"
diff --git a/src/corelib/statemachine/qabstractstate.cpp b/src/corelib/statemachine/qabstractstate.cpp
index 13bf41faa9..1a9ad4601d 100644
--- a/src/corelib/statemachine/qabstractstate.cpp
+++ b/src/corelib/statemachine/qabstractstate.cpp
@@ -234,3 +234,5 @@ bool QAbstractState::event(QEvent *e)
}
QT_END_NAMESPACE
+
+#include "moc_qabstractstate.cpp"
diff --git a/src/corelib/statemachine/qabstracttransition.cpp b/src/corelib/statemachine/qabstracttransition.cpp
index 8c30d5f11c..53c713d6a8 100644
--- a/src/corelib/statemachine/qabstracttransition.cpp
+++ b/src/corelib/statemachine/qabstracttransition.cpp
@@ -431,3 +431,5 @@ bool QAbstractTransition::event(QEvent *e)
}
QT_END_NAMESPACE
+
+#include "moc_qabstracttransition.cpp"
diff --git a/src/corelib/statemachine/qeventtransition.cpp b/src/corelib/statemachine/qeventtransition.cpp
index cd0cfe2f85..a90f147773 100644
--- a/src/corelib/statemachine/qeventtransition.cpp
+++ b/src/corelib/statemachine/qeventtransition.cpp
@@ -252,3 +252,5 @@ bool QEventTransition::event(QEvent *e)
}
QT_END_NAMESPACE
+
+#include "moc_qeventtransition.cpp"
diff --git a/src/corelib/statemachine/qfinalstate.cpp b/src/corelib/statemachine/qfinalstate.cpp
index bef9fc4239..d8bfd30974 100644
--- a/src/corelib/statemachine/qfinalstate.cpp
+++ b/src/corelib/statemachine/qfinalstate.cpp
@@ -137,3 +137,5 @@ bool QFinalState::event(QEvent *e)
}
QT_END_NAMESPACE
+
+#include "moc_qfinalstate.cpp"
diff --git a/src/corelib/statemachine/qhistorystate.cpp b/src/corelib/statemachine/qhistorystate.cpp
index b1c5a92d00..a179d7c75b 100644
--- a/src/corelib/statemachine/qhistorystate.cpp
+++ b/src/corelib/statemachine/qhistorystate.cpp
@@ -310,3 +310,6 @@ bool QHistoryState::event(QEvent *e)
*/
QT_END_NAMESPACE
+
+#include "moc_qhistorystate.cpp"
+#include "moc_qhistorystate_p.cpp"
diff --git a/src/corelib/statemachine/qsignaltransition.cpp b/src/corelib/statemachine/qsignaltransition.cpp
index 3b219bda53..c05b4617b2 100644
--- a/src/corelib/statemachine/qsignaltransition.cpp
+++ b/src/corelib/statemachine/qsignaltransition.cpp
@@ -284,3 +284,5 @@ void QSignalTransitionPrivate::callOnTransition(QEvent *e)
QT_END_NAMESPACE
+
+#include "moc_qsignaltransition.cpp"
diff --git a/src/corelib/statemachine/qstate.cpp b/src/corelib/statemachine/qstate.cpp
index 48456424cf..76dcbf784b 100644
--- a/src/corelib/statemachine/qstate.cpp
+++ b/src/corelib/statemachine/qstate.cpp
@@ -599,3 +599,5 @@ bool QState::event(QEvent *e)
*/
QT_END_NAMESPACE
+
+#include "moc_qstate.cpp"
diff --git a/src/corelib/thread/qfuturewatcher.cpp b/src/corelib/thread/qfuturewatcher.cpp
index aa6f00c317..d2ec18850f 100644
--- a/src/corelib/thread/qfuturewatcher.cpp
+++ b/src/corelib/thread/qfuturewatcher.cpp
@@ -592,4 +592,6 @@ void QFutureWatcherBasePrivate::sendCallOutEvent(QFutureCallOutEvent *event)
QT_END_NAMESPACE
+#include "moc_qfuturewatcher.cpp"
+
#endif // QT_NO_QFUTURE
diff --git a/src/corelib/thread/qthread.cpp b/src/corelib/thread/qthread.cpp
index 0828400733..996a1df9a0 100644
--- a/src/corelib/thread/qthread.cpp
+++ b/src/corelib/thread/qthread.cpp
@@ -901,3 +901,5 @@ QDaemonThread::~QDaemonThread()
}
QT_END_NAMESPACE
+
+#include "moc_qthread.cpp"
diff --git a/src/corelib/thread/qthreadpool.cpp b/src/corelib/thread/qthreadpool.cpp
index e45aaec103..f3ce1f258f 100644
--- a/src/corelib/thread/qthreadpool.cpp
+++ b/src/corelib/thread/qthreadpool.cpp
@@ -679,4 +679,6 @@ void QThreadPool::cancel(QRunnable *runnable)
QT_END_NAMESPACE
+#include "moc_qthreadpool.cpp"
+
#endif
diff --git a/src/corelib/tools/qcryptographichash.cpp b/src/corelib/tools/qcryptographichash.cpp
index 963a91b9a9..5410adc737 100644
--- a/src/corelib/tools/qcryptographichash.cpp
+++ b/src/corelib/tools/qcryptographichash.cpp
@@ -494,3 +494,7 @@ QByteArray QCryptographicHash::hash(const QByteArray &data, Algorithm method)
}
QT_END_NAMESPACE
+
+#ifndef QT_NO_QOBJECT
+#include "moc_qcryptographichash.cpp"
+#endif
diff --git a/src/corelib/tools/qeasingcurve.cpp b/src/corelib/tools/qeasingcurve.cpp
index 4b5f5e7830..03bb1a1411 100644
--- a/src/corelib/tools/qeasingcurve.cpp
+++ b/src/corelib/tools/qeasingcurve.cpp
@@ -1501,3 +1501,5 @@ QDataStream &operator>>(QDataStream &stream, QEasingCurve &easing)
#endif // QT_NO_DATASTREAM
QT_END_NAMESPACE
+
+#include "moc_qeasingcurve.cpp"
diff --git a/src/corelib/tools/qhash.h b/src/corelib/tools/qhash.h
index c59f789cb2..b2c3cf574d 100644
--- a/src/corelib/tools/qhash.h
+++ b/src/corelib/tools/qhash.h
@@ -51,6 +51,8 @@
#include <initializer_list>
#endif
+#include <algorithm>
+
#if defined(Q_CC_MSVC)
#pragma warning( push )
#pragma warning( disable : 4311 ) // disable pointer truncation warning
@@ -936,18 +938,24 @@ Q_OUTOFLINE_TEMPLATE bool QHash<Key, T>::operator==(const QHash &other) const
const_iterator it = begin();
while (it != end()) {
- const Key &akey = it.key();
+ // Build two equal ranges for i.key(); one for *this and one for other.
+ // For *this we can avoid a lookup via equal_range, as we know the beginning of the range.
+ auto thisEqualRangeEnd = it;
+ while (thisEqualRangeEnd != end() && it.key() == thisEqualRangeEnd.key())
+ ++thisEqualRangeEnd;
- const_iterator it2 = other.find(akey);
- do {
- if (it2 == other.end() || !(it2.key() == akey))
- return false;
- if (!(it.value() == it2.value()))
- return false;
- ++it;
- ++it2;
- } while (it != end() && it.key() == akey);
+ const auto otherEqualRange = other.equal_range(it.key());
+
+ if (std::distance(it, thisEqualRangeEnd) != std::distance(otherEqualRange.first, otherEqualRange.second))
+ return false;
+
+ // Keys in the ranges are equal by construction; this checks only the values.
+ if (!std::is_permutation(it, thisEqualRangeEnd, otherEqualRange.first))
+ return false;
+
+ it = thisEqualRangeEnd;
}
+
return true;
}
diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp
index 697e0062dd..dcdf6b5ed7 100644
--- a/src/corelib/tools/qlocale.cpp
+++ b/src/corelib/tools/qlocale.cpp
@@ -3005,14 +3005,18 @@ QString QLocaleData::unsLongLongToString(const QChar zero, const QChar group,
int base, int width,
unsigned flags)
{
+ const QChar resultZero = base == 10 ? zero : QChar(QLatin1Char('0'));
+ QString num_str = l ? qulltoa(l, base, zero) : QString(resultZero);
+
bool precision_not_specified = false;
if (precision == -1) {
+ if (flags == NoFlags)
+ return num_str; // fast-path: nothing below applies, so we're done.
+
precision_not_specified = true;
precision = 1;
}
- QString num_str = qulltoa(l, base, zero);
-
uint cnt_thousand_sep = 0;
if (flags & ThousandsGroup && base == 10) {
for (int i = num_str.length() - 3; i > 0; i -=3) {
@@ -3021,7 +3025,6 @@ QString QLocaleData::unsLongLongToString(const QChar zero, const QChar group,
}
}
- const QChar resultZero = base == 10 ? zero : QChar(QLatin1Char('0'));
const int zeroPadding = precision - num_str.length()/* + cnt_thousand_sep*/;
if (zeroPadding > 0)
num_str.prepend(QString(zeroPadding, resultZero));
@@ -3665,3 +3668,7 @@ QDebug operator<<(QDebug dbg, const QLocale &l)
}
#endif
QT_END_NAMESPACE
+
+#ifndef QT_NO_QOBJECT
+#include "moc_qlocale.cpp"
+#endif
diff --git a/src/corelib/tools/qscopedpointer.cpp b/src/corelib/tools/qscopedpointer.cpp
index 67d11660e1..0e8eba2a0f 100644
--- a/src/corelib/tools/qscopedpointer.cpp
+++ b/src/corelib/tools/qscopedpointer.cpp
@@ -115,7 +115,7 @@ QT_BEGIN_NAMESPACE
\snippet code/src_corelib_tools_qscopedpointer.cpp 4
- Otherwise, the compiler output a warning about not being able to destruct
+ Otherwise, the compiler outputs a warning about not being able to destruct
\c MyPrivateClass.
\sa QSharedPointer
diff --git a/src/corelib/tools/qtimeline.cpp b/src/corelib/tools/qtimeline.cpp
index adbc2900e3..e70e7f8e16 100644
--- a/src/corelib/tools/qtimeline.cpp
+++ b/src/corelib/tools/qtimeline.cpp
@@ -784,3 +784,5 @@ void QTimeLine::timerEvent(QTimerEvent *event)
}
QT_END_NAMESPACE
+
+#include "moc_qtimeline.cpp"
diff --git a/src/gui/configure.json b/src/gui/configure.json
index 73e59a7ad9..83d1530745 100644
--- a/src/gui/configure.json
+++ b/src/gui/configure.json
@@ -85,7 +85,8 @@
"test": "qpa/kms",
"sources": [
{ "type": "pkgConfig", "args": "libdrm" },
- "-ldrm"
+ { "libs": "-ldrm", "condition": "!config.integrity" },
+ { "libs": "-ldrm-nvdc -lposix -livfs -lnvll -lnvdc -lnvrm -lnvrm_graphics -lnvos", "condition": "config.integrity" }
]
},
"egl": {
@@ -148,6 +149,13 @@
{ "type": "pkgConfig", "args": "libinput" }
]
},
+ "integrityhid": {
+ "label": "integrityhid",
+ "test": "qpa/integrityhid",
+ "sources": [
+ { "libs": "-lhiddev -lusbhid -lusb" }
+ ]
+ },
"libjpeg": {
"label": "libjpeg",
"test": "unix/libjpeg",
@@ -362,6 +370,11 @@
"type": "compile",
"test": "unix/evdev"
},
+ "integrityfb": {
+ "label": "INTEGRITY framebuffer",
+ "type": "compile",
+ "test": "qpa/integrityfb"
+ },
"libinput_axis_api": {
"label": "axis API in libinput",
"type": "compile",
@@ -508,7 +521,7 @@
"integrityfb": {
"label": "INTEGRITY framebuffer",
"section": "Platform plugins",
- "condition": "config.integrity",
+ "condition": "config.integrity && tests.integrityfb",
"output": [ "privateFeature" ]
},
"kms": {
@@ -521,6 +534,11 @@
"condition": "features.libudev && libs.libinput",
"output": [ "privateFeature" ]
},
+ "integrityhid": {
+ "label": "INTEGRITY HID",
+ "condition": "config.integrity && libs.integrityhid",
+ "output": [ "privateFeature" ]
+ },
"libinput-axis-api": {
"label": "axis API in libinput",
"condition": "features.libinput && tests.libinput_axis_api",
@@ -1108,6 +1126,7 @@ QMAKE_LIBDIR_OPENGL[_ES2] and QMAKE_LIBS_OPENGL[_ES2] in the mkspec for your pla
"entries": [
"evdev",
"libinput",
+ "integrityhid",
"mtdev",
"tslib",
"xkbcommon-evdev"
diff --git a/src/gui/image/image.pri b/src/gui/image/image.pri
index bac00f7e95..76aba944b2 100644
--- a/src/gui/image/image.pri
+++ b/src/gui/image/image.pri
@@ -10,7 +10,6 @@ HEADERS += \
image/qimageiohandler.h \
image/qimagereader.h \
image/qimagewriter.h \
- image/qmovie.h \
image/qpaintengine_pic_p.h \
image/qpicture.h \
image/qpicture_p.h \
@@ -41,7 +40,6 @@ SOURCES += \
image/qpixmap.cpp \
image/qpixmapcache.cpp \
image/qplatformpixmap.cpp \
- image/qmovie.cpp \
image/qpixmap_raster.cpp \
image/qpixmap_blitter.cpp \
image/qimagepixmapcleanuphooks.cpp \
@@ -50,6 +48,10 @@ SOURCES += \
image/qiconengine.cpp \
image/qiconengineplugin.cpp \
+qtConfig(movie) {
+ HEADERS += image/qmovie.h
+ SOURCES += image/qmovie.cpp
+}
win32:!winrt: SOURCES += image/qpixmap_win.cpp
diff --git a/src/gui/image/qmovie.cpp b/src/gui/image/qmovie.cpp
index 55ddd839b7..a1ca857daa 100644
--- a/src/gui/image/qmovie.cpp
+++ b/src/gui/image/qmovie.cpp
@@ -172,8 +172,6 @@
#include "qmovie.h"
-#ifndef QT_NO_MOVIE
-
#include "qglobal.h"
#include "qimage.h"
#include "qimagereader.h"
@@ -1020,5 +1018,3 @@ void QMovie::setCacheMode(CacheMode cacheMode)
QT_END_NAMESPACE
#include "moc_qmovie.cpp"
-
-#endif // QT_NO_MOVIE
diff --git a/src/gui/image/qmovie.h b/src/gui/image/qmovie.h
index 2b41e07dba..930d502892 100644
--- a/src/gui/image/qmovie.h
+++ b/src/gui/image/qmovie.h
@@ -42,15 +42,14 @@
#include <QtGui/qtguiglobal.h>
-#ifndef QT_NO_MOVIE
-
#include <QtCore/qobject.h>
#include <QtCore/qbytearray.h>
#include <QtCore/qlist.h>
#include <QtGui/qimagereader.h>
-QT_BEGIN_NAMESPACE
+QT_REQUIRE_CONFIG(movie);
+QT_BEGIN_NAMESPACE
class QByteArray;
class QColor;
@@ -144,6 +143,4 @@ private:
QT_END_NAMESPACE
-#endif // QT_NO_MOVIE
-
#endif // QMOVIE_H
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index 1dd019cd55..c0b0acbda6 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -634,6 +634,18 @@ QGuiApplication::~QGuiApplication()
QGuiApplicationPrivate::m_inputDeviceManager = 0;
delete QGuiApplicationPrivate::desktopFileName;
QGuiApplicationPrivate::desktopFileName = 0;
+ QGuiApplicationPrivate::mouse_buttons = Qt::NoButton;
+ QGuiApplicationPrivate::modifier_buttons = Qt::NoModifier;
+ QGuiApplicationPrivate::lastCursorPosition = {qInf(), qInf()};
+ QGuiApplicationPrivate::currentMousePressWindow = QGuiApplicationPrivate::currentMouseWindow = nullptr;
+ QGuiApplicationPrivate::applicationState = Qt::ApplicationInactive;
+ QGuiApplicationPrivate::highDpiScalingUpdated = false;
+ QGuiApplicationPrivate::tabletDevicePoints.clear();
+#ifndef QT_NO_SESSIONMANAGER
+ QGuiApplicationPrivate::is_fallback_session_management_enabled = true;
+#endif
+ QGuiApplicationPrivate::mousePressTime = 0;
+ QGuiApplicationPrivate::mousePressX = QGuiApplicationPrivate::mousePressY = 0;
}
QGuiApplicationPrivate::QGuiApplicationPrivate(int &argc, char **argv, int flags)
@@ -1531,6 +1543,7 @@ QGuiApplicationPrivate::~QGuiApplicationPrivate()
delete m_a32ColorProfile.load();
window_list.clear();
+ screen_list.clear();
}
#if 0
diff --git a/src/gui/kernel/qwindowsysteminterface.cpp b/src/gui/kernel/qwindowsysteminterface.cpp
index 7f25ed76c3..3982b5568e 100644
--- a/src/gui/kernel/qwindowsysteminterface.cpp
+++ b/src/gui/kernel/qwindowsysteminterface.cpp
@@ -215,7 +215,8 @@ bool QWindowSystemEventHandler::sendEvent(QWindowSystemInterfacePrivate::WindowS
QT_DEFINE_QPA_EVENT_HANDLER(void, handleEnterEvent, QWindow *window, const QPointF &local, const QPointF &global)
{
if (window) {
- QWindowSystemInterfacePrivate::EnterEvent *e = new QWindowSystemInterfacePrivate::EnterEvent(window, local, global);
+ QWindowSystemInterfacePrivate::EnterEvent *e
+ = new QWindowSystemInterfacePrivate::EnterEvent(window, QHighDpi::fromNativeLocalPosition(local, window), QHighDpi::fromNativePixels(global, window));
QWindowSystemInterfacePrivate::handleWindowSystemEvent<Delivery>(e);
}
}
diff --git a/src/gui/painting/qpainterpath.cpp b/src/gui/painting/qpainterpath.cpp
index 7dbc83b338..27bd2e59e6 100644
--- a/src/gui/painting/qpainterpath.cpp
+++ b/src/gui/painting/qpainterpath.cpp
@@ -1981,6 +1981,17 @@ static bool qt_isect_curve_vertical(const QBezier &bezier, qreal x, qreal y1, qr
return false;
}
+static bool pointOnEdge(const QRectF &rect, const QPointF &point)
+{
+ if ((point.x() == rect.left() || point.x() == rect.right()) &&
+ (point.y() >= rect.top() && point.y() <= rect.bottom()))
+ return true;
+ if ((point.y() == rect.top() || point.y() == rect.bottom()) &&
+ (point.x() >= rect.left() && point.x() <= rect.right()))
+ return true;
+ return false;
+}
+
/*
Returns \c true if any lines or curves cross the four edges in of rect
*/
@@ -1988,6 +1999,7 @@ static bool qt_painterpath_check_crossing(const QPainterPath *path, const QRectF
{
QPointF last_pt;
QPointF last_start;
+ enum { OnRect, InsideRect, OutsideRect} edgeStatus = OnRect;
for (int i=0; i<path->elementCount(); ++i) {
const QPainterPath::Element &e = path->elementAt(i);
@@ -2026,6 +2038,27 @@ static bool qt_painterpath_check_crossing(const QPainterPath *path, const QRectF
default:
break;
}
+ // Handle crossing the edges of the rect at the end-points of individual sub-paths.
+ // A point on on the edge itself is considered neither inside nor outside for this purpose.
+ if (!pointOnEdge(rect, last_pt)) {
+ bool contained = rect.contains(last_pt);
+ switch (edgeStatus) {
+ case OutsideRect:
+ if (contained)
+ return true;
+ break;
+ case InsideRect:
+ if (!contained)
+ return true;
+ break;
+ case OnRect:
+ edgeStatus = contained ? InsideRect : OutsideRect;
+ break;
+ }
+ } else {
+ if (last_pt == last_start)
+ edgeStatus = OnRect;
+ }
}
// implicitly close last subpath
diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp
index 023a1b7f52..cc91c107f9 100644
--- a/src/gui/text/qtextlayout.cpp
+++ b/src/gui/text/qtextlayout.cpp
@@ -630,6 +630,9 @@ Qt::CursorMoveStyle QTextLayout::cursorMoveStyle() const
/*!
Begins the layout process.
+ \warning This will invalidate the layout, so all existing QTextLine objects
+ that refer to the previous contents should now be discarded.
+
\sa endLayout()
*/
void QTextLayout::beginLayout()
@@ -673,6 +676,9 @@ void QTextLayout::endLayout()
Clears the line information in the layout. After having called
this function, lineCount() returns 0.
+
+ \warning This will invalidate the layout, so all existing QTextLine objects
+ that refer to the previous contents should now be discarded.
*/
void QTextLayout::clearLayout()
{
diff --git a/src/network/access/qhttp2protocolhandler.cpp b/src/network/access/qhttp2protocolhandler.cpp
index 555f1ba0ef..44ab637da8 100644
--- a/src/network/access/qhttp2protocolhandler.cpp
+++ b/src/network/access/qhttp2protocolhandler.cpp
@@ -528,7 +528,7 @@ void QHttp2ProtocolHandler::handleDATA()
auto &stream = activeStreams[streamID];
if (qint32(inboundFrame.payloadSize()) > stream.recvWindow) {
- finishStreamWithError(stream, QNetworkReply::ProtocolInvalidOperationError,
+ finishStreamWithError(stream, QNetworkReply::ProtocolFailure,
QLatin1String("flow control error"));
sendRST_STREAM(streamID, FLOW_CONTROL_ERROR);
markAsReset(streamID);
@@ -834,7 +834,7 @@ void QHttp2ProtocolHandler::handleWINDOW_UPDATE()
}
auto &stream = activeStreams[streamID];
if (!valid || sum_will_overflow(stream.sendWindow, delta)) {
- finishStreamWithError(stream, QNetworkReply::ProtocolInvalidOperationError,
+ finishStreamWithError(stream, QNetworkReply::ProtocolFailure,
QLatin1String("invalid WINDOW_UPDATE delta"));
sendRST_STREAM(streamID, PROTOCOL_ERROR);
markAsReset(streamID);
@@ -888,7 +888,7 @@ void QHttp2ProtocolHandler::handleContinuedHEADERS()
// We can receive HEADERS on streams initiated by our requests
// (these streams are in halfClosedLocal state) or remote-reserved
// streams from a server's PUSH_PROMISE.
- finishStreamWithError(stream, QNetworkReply::ProtocolInvalidOperationError,
+ finishStreamWithError(stream, QNetworkReply::ProtocolFailure,
QLatin1String("HEADERS on invalid stream"));
sendRST_STREAM(streamID, CANCEL);
markAsReset(streamID);
@@ -977,7 +977,7 @@ bool QHttp2ProtocolHandler::acceptSetting(Http2::Settings identifier, quint32 ne
for (auto id : brokenStreams) {
auto &stream = activeStreams[id];
- finishStreamWithError(stream, QNetworkReply::ProtocolInvalidOperationError,
+ finishStreamWithError(stream, QNetworkReply::ProtocolFailure,
QLatin1String("SETTINGS window overflow"));
sendRST_STREAM(id, PROTOCOL_ERROR);
markAsReset(id);
diff --git a/src/network/doc/src/bearermanagement.qdoc b/src/network/doc/src/bearermanagement.qdoc
index 52b5958996..f8d6a807d2 100644
--- a/src/network/doc/src/bearermanagement.qdoc
+++ b/src/network/doc/src/bearermanagement.qdoc
@@ -235,33 +235,6 @@ QNetworkSession is the central class for managing roaming related issues.
Some API features are not available on all platforms. The
\l QNetworkConfigurationManager::Capability should be used to detect
-platform features at runtime. The following table lists the various
-platform APIs being used by this API. This may assist in the process of
-determining the feature support:
-
-\table
- \header
- \li Platform
- \li Backend capabilities
- \row
- \li Linux\unicode{0xAE}
- \li Linux uses the \l {http://projects.gnome.org/NetworkManager}{NetworkManager}
- and \l {http://connman.net/}{ConnMan} / \l {http://ofono.org/}{oFono} APIs
- which support interface notifications and starting and stopping of network
- interfaces. Network Manager version 0.9 and above is supported.
- \row
- \li Windows\unicode{0xAE} XP
- \li This platform supports interface notifications without active polling.
- \row
- \li Windows XP SP2+Hotfixes, Windows XP SP3, Windows Vista, Windows 7
- \li In addition to standard Windows XP wifi access point monitoring has been improved which includes the ability to start and stop wifi interfaces. This requires Windows to manage the wifi interfaces.
- \row
- \li Mac OS\unicode{0xAE}
- \li This platform has full support by way of CoreWLAN offered in Mac OS 10.6. Previous
- versions of Mac OS - 10.5 and 10.4 have limited support.
- \row
- \li All other platforms (*nix, Windows Mobile)
- \li This backend is the fallback for all platforms supports network interface notifications via active polling only.
-\endtable
+platform features at runtime.
*/
diff --git a/src/network/socket/qnativesocketengine_winrt.cpp b/src/network/socket/qnativesocketengine_winrt.cpp
index 7b20b47aa9..0625ea65da 100644
--- a/src/network/socket/qnativesocketengine_winrt.cpp
+++ b/src/network/socket/qnativesocketengine_winrt.cpp
@@ -194,9 +194,22 @@ public:
Q_ASSERT_SUCCEEDED(hr);
}
}
+
+ if (connectOp) {
+ ComPtr<IAsyncInfo> info;
+ HRESULT hr = connectOp.As(&info);
+ Q_ASSERT_SUCCEEDED(hr);
+ if (info) {
+ hr = info->Cancel();
+ Q_ASSERT_SUCCEEDED(hr);
+ hr = info->Close();
+ Q_ASSERT_SUCCEEDED(hr);
+ }
+ }
}
signals:
+ void connectOpFinished(bool success, QAbstractSocket::SocketError error, WinRTSocketEngine::ErrorString errorString);
void newDatagramsReceived(const QList<WinRtDatagram> &datagram);
void newDataReceived(const QVector<QByteArray> &data);
void socketErrorOccured(QAbstractSocket::SocketError error);
@@ -234,6 +247,45 @@ public:
Q_ASSERT_SUCCEEDED(hr);
}
+ HRESULT onConnectOpFinished(IAsyncAction *action, AsyncStatus)
+ {
+ HRESULT hr = action->GetResults();
+ if (FAILED(hr)) {
+ switch (hr) {
+ case HRESULT_FROM_WIN32(WSAETIMEDOUT):
+ emit connectOpFinished(false, QAbstractSocket::NetworkError, WinRTSocketEngine::ConnectionTimeOutErrorString);
+ return S_OK;
+ case HRESULT_FROM_WIN32(WSAEHOSTUNREACH):
+ emit connectOpFinished(false, QAbstractSocket::HostNotFoundError, WinRTSocketEngine::HostUnreachableErrorString);
+ return S_OK;
+ case HRESULT_FROM_WIN32(WSAECONNREFUSED):
+ emit connectOpFinished(false, QAbstractSocket::ConnectionRefusedError, WinRTSocketEngine::ConnectionRefusedErrorString);
+ return S_OK;
+ default:
+ emit connectOpFinished(false, QAbstractSocket::UnknownSocketError, WinRTSocketEngine::UnknownSocketErrorString);
+ return S_OK;
+ }
+ }
+
+ // The callback might be triggered several times if we do not cancel/reset it here
+ if (connectOp) {
+ ComPtr<IAsyncInfo> info;
+ hr = connectOp.As(&info);
+ Q_ASSERT_SUCCEEDED(hr);
+ if (info) {
+ hr = info->Cancel();
+ Q_ASSERT_SUCCEEDED(hr);
+ hr = info->Close();
+ Q_ASSERT_SUCCEEDED(hr);
+ }
+ hr = connectOp.Reset();
+ Q_ASSERT_SUCCEEDED(hr);
+ }
+
+ emit connectOpFinished(true, QAbstractSocket::UnknownSocketError, WinRTSocketEngine::UnknownSocketErrorString);
+ return S_OK;
+ }
+
HRESULT OnNewDatagramReceived(IDatagramSocket *, IDatagramSocketMessageReceivedEventArgs *args)
{
WinRtDatagram datagram;
@@ -378,6 +430,7 @@ public:
void setTcpSocket(ComPtr<IStreamSocket> socket) { tcpSocket = socket; }
private:
+ friend class QNativeSocketEngine;
ComPtr<IStreamSocket> tcpSocket;
QList<WinRtDatagram> pendingDatagrams;
@@ -386,6 +439,7 @@ private:
// Protects pendingData/pendingDatagrams which are accessed from native callbacks
QMutex mutex;
+ ComPtr<IAsyncAction> connectOp;
ComPtr<IAsyncOperationWithProgress<IBuffer *, UINT32>> initialReadOp;
ComPtr<IAsyncOperationWithProgress<IBuffer *, UINT32>> readOp;
@@ -481,6 +535,7 @@ QNativeSocketEngine::QNativeSocketEngine(QObject *parent)
: QAbstractSocketEngine(*new QNativeSocketEnginePrivate(), parent)
{
qRegisterMetaType<WinRtDatagram>();
+ qRegisterMetaType<WinRTSocketEngine::ErrorString>();
#ifndef QT_NO_SSL
Q_D(QNativeSocketEngine);
if (parent)
@@ -490,6 +545,8 @@ QNativeSocketEngine::QNativeSocketEngine(QObject *parent)
connect(this, SIGNAL(connectionReady()), SLOT(connectionNotification()), Qt::QueuedConnection);
connect(this, SIGNAL(readReady()), SLOT(readNotification()), Qt::QueuedConnection);
connect(this, SIGNAL(writeReady()), SLOT(writeNotification()), Qt::QueuedConnection);
+ connect(d->worker, &SocketEngineWorker::connectOpFinished,
+ this, &QNativeSocketEngine::handleConnectOpFinished, Qt::QueuedConnection);
connect(d->worker, &SocketEngineWorker::newDatagramsReceived, this, &QNativeSocketEngine::handleNewDatagrams, Qt::QueuedConnection);
connect(d->worker, &SocketEngineWorker::newDataReceived,
this, &QNativeSocketEngine::handleNewData, Qt::QueuedConnection);
@@ -531,7 +588,7 @@ bool QNativeSocketEngine::initialize(qintptr socketDescriptor, QAbstractSocket::
if (!d->socketDescriptor || !d->fetchConnectionParameters()) {
d->setError(QAbstractSocket::UnsupportedSocketOperationError,
- d->InvalidSocketErrorString);
+ WinRTSocketEngine::InvalidSocketErrorString);
d->socketDescriptor = -1;
return false;
}
@@ -599,9 +656,9 @@ bool QNativeSocketEngine::connectToHostByName(const QString &name, quint16 port)
const QString portString = QString::number(port);
HStringReference portReference(reinterpret_cast<LPCWSTR>(portString.utf16()));
if (d->socketType == QAbstractSocket::TcpSocket)
- hr = d->tcpSocket()->ConnectAsync(remoteHost.Get(), portReference.Get(), &d->connectOp);
+ hr = d->tcpSocket()->ConnectAsync(remoteHost.Get(), portReference.Get(), &d->worker->connectOp);
else if (d->socketType == QAbstractSocket::UdpSocket)
- hr = d->udpSocket()->ConnectAsync(remoteHost.Get(), portReference.Get(), &d->connectOp);
+ hr = d->udpSocket()->ConnectAsync(remoteHost.Get(), portReference.Get(), &d->worker->connectOp);
if (hr == E_ACCESSDENIED) {
qErrnoWarning(hr, "QNativeSocketEngine::connectToHostByName: Unable to connect to host (%s:%hu/%s). "
"Please check your manifest capabilities.",
@@ -622,8 +679,8 @@ bool QNativeSocketEngine::connectToHostByName(const QString &name, quint16 port)
d->socketState = QAbstractSocket::ConnectingState;
QEventDispatcherWinRT::runOnXamlThread([d, &hr]() {
- hr = d->connectOp->put_Completed(Callback<IAsyncActionCompletedHandler>(
- d, &QNativeSocketEnginePrivate::handleConnectOpFinished).Get());
+ hr = d->worker->connectOp->put_Completed(Callback<IAsyncActionCompletedHandler>(
+ d->worker, &SocketEngineWorker::onConnectOpFinished).Get());
RETURN_OK_IF_FAILED("connectToHostByName: Could not register \"connectOp\" callback");
return S_OK;
});
@@ -677,7 +734,7 @@ bool QNativeSocketEngine::bind(const QHostAddress &address, quint16 port)
qErrnoWarning(hr, "Unable to bind socket (%s:%hu/%s). Please check your manifest capabilities.",
qPrintable(address.toString()), port, socketDescription(this).constData());
d->setError(QAbstractSocket::SocketAccessError,
- QNativeSocketEnginePrivate::AccessErrorString);
+ WinRTSocketEngine::AccessErrorString);
d->socketState = QAbstractSocket::UnconnectedState;
specificErrorSet = true;
return S_OK;
@@ -687,14 +744,14 @@ bool QNativeSocketEngine::bind(const QHostAddress &address, quint16 port)
hr = QWinRTFunctions::await(op);
if (hr == 0x80072741) { // The requested address is not valid in its context
d->setError(QAbstractSocket::SocketAddressNotAvailableError,
- QNativeSocketEnginePrivate::AddressNotAvailableErrorString);
+ WinRTSocketEngine::AddressNotAvailableErrorString);
d->socketState = QAbstractSocket::UnconnectedState;
specificErrorSet = true;
return S_OK;
// Only one usage of each socket address (protocol/network address/port) is normally permitted
} else if (hr == 0x80072740) {
d->setError(QAbstractSocket::AddressInUseError,
- QNativeSocketEnginePrivate::AddressInuseErrorString);
+ WinRTSocketEngine::AddressInuseErrorString);
d->socketState = QAbstractSocket::UnconnectedState;
specificErrorSet = true;
return S_OK;
@@ -705,7 +762,7 @@ bool QNativeSocketEngine::bind(const QHostAddress &address, quint16 port)
if (FAILED(hr)) {
if (!specificErrorSet) {
d->setError(QAbstractSocket::UnknownSocketError,
- QNativeSocketEnginePrivate::UnknownSocketErrorString);
+ WinRTSocketEngine::UnknownSocketErrorString);
d->socketState = QAbstractSocket::UnconnectedState;
}
return false;
@@ -737,7 +794,7 @@ int QNativeSocketEngine::accept()
Q_CHECK_TYPE(QNativeSocketEngine::accept(), QAbstractSocket::TcpSocket, -1);
if (d->socketDescriptor == -1 || d->pendingConnections.isEmpty()) {
- d->setError(QAbstractSocket::TemporaryError, QNativeSocketEnginePrivate::TemporaryErrorString);
+ d->setError(QAbstractSocket::TemporaryError, WinRTSocketEngine::TemporaryErrorString);
return -1;
}
@@ -767,18 +824,6 @@ void QNativeSocketEngine::close()
d->notifyOnException = false;
HRESULT hr;
- if (d->connectOp) {
- ComPtr<IAsyncInfo> info;
- hr = d->connectOp.As(&info);
- Q_ASSERT_SUCCEEDED(hr);
- if (info) {
- hr = info->Cancel();
- Q_ASSERT_SUCCEEDED(hr);
- hr = info->Close();
- Q_ASSERT_SUCCEEDED(hr);
- }
- }
-
if (d->socketType == QAbstractSocket::TcpSocket) {
hr = QEventDispatcherWinRT::runOnXamlThread([d]() {
HRESULT hr;
@@ -924,7 +969,7 @@ qint64 QNativeSocketEngine::write(const char *data, qint64 len)
qint64 bytesWritten = writeIOStream(stream, data, len);
if (bytesWritten < 0)
- d->setError(QAbstractSocket::SocketAccessError, QNativeSocketEnginePrivate::AccessErrorString);
+ d->setError(QAbstractSocket::SocketAccessError, WinRTSocketEngine::AccessErrorString);
else if (bytesWritten > 0 && d->notifyOnWrite)
emit writeReady();
@@ -1089,7 +1134,7 @@ bool QNativeSocketEngine::waitForRead(int msecs, bool *timedOut)
}
d->setError(QAbstractSocket::SocketTimeoutError,
- QNativeSocketEnginePrivate::TimeOutErrorString);
+ WinRTSocketEngine::TimeOutErrorString);
if (timedOut)
*timedOut = true;
@@ -1102,9 +1147,9 @@ bool QNativeSocketEngine::waitForWrite(int msecs, bool *timedOut)
Q_UNUSED(timedOut);
Q_D(QNativeSocketEngine);
if (d->socketState == QAbstractSocket::ConnectingState) {
- HRESULT hr = QWinRTFunctions::await(d->connectOp, QWinRTFunctions::ProcessMainThreadEvents);
+ HRESULT hr = QWinRTFunctions::await(d->worker->connectOp, QWinRTFunctions::ProcessMainThreadEvents);
if (SUCCEEDED(hr)) {
- d->handleConnectOpFinished(d->connectOp.Get(), Completed);
+ handleConnectOpFinished(true, QAbstractSocket::UnknownSocketError, WinRTSocketEngine::UnknownSocketErrorString);
return true;
}
}
@@ -1176,6 +1221,32 @@ void QNativeSocketEngine::establishRead()
Q_ASSERT_SUCCEEDED(hr);
}
+void QNativeSocketEngine::handleConnectOpFinished(bool success, QAbstractSocket::SocketError error, WinRTSocketEngine::ErrorString errorString)
+{
+ Q_D(QNativeSocketEngine);
+ disconnect(d->worker, &SocketEngineWorker::connectOpFinished,
+ this, &QNativeSocketEngine::handleConnectOpFinished);
+ if (!success) {
+ d->setError(error, errorString);
+ d->socketState = QAbstractSocket::UnconnectedState;
+ return;
+ }
+
+ d->socketState = QAbstractSocket::ConnectedState;
+ emit connectionReady();
+
+ if (d->socketType != QAbstractSocket::TcpSocket)
+ return;
+
+#ifndef QT_NO_SSL
+ // Delay the reader so that the SSL socket can upgrade
+ if (d->sslSocket)
+ QObject::connect(qobject_cast<QSslSocket *>(d->sslSocket), &QSslSocket::encrypted, this, &QNativeSocketEngine::establishRead);
+ else
+#endif
+ establishRead();
+}
+
void QNativeSocketEngine::handleNewDatagrams(const QList<WinRtDatagram> &datagrams)
{
Q_D(QNativeSocketEngine);
@@ -1198,13 +1269,13 @@ void QNativeSocketEngine::handleNewData(const QVector<QByteArray> &data)
void QNativeSocketEngine::handleTcpError(QAbstractSocket::SocketError error)
{
Q_D(QNativeSocketEngine);
- QNativeSocketEnginePrivate::ErrorString errorString;
+ WinRTSocketEngine::ErrorString errorString;
switch (error) {
case QAbstractSocket::RemoteHostClosedError:
- errorString = QNativeSocketEnginePrivate::RemoteHostClosedErrorString;
+ errorString = WinRTSocketEngine::RemoteHostClosedErrorString;
break;
default:
- errorString = QNativeSocketEnginePrivate::UnknownSocketErrorString;
+ errorString = WinRTSocketEngine::UnknownSocketErrorString;
}
d->setError(error, errorString);
@@ -1271,7 +1342,7 @@ bool QNativeSocketEnginePrivate::createNewSocket(QAbstractSocket::SocketType soc
// Make the socket nonblocking.
if (!setOption(QAbstractSocketEngine::NonBlockingSocketOption, 1)) {
- setError(QAbstractSocket::UnsupportedSocketOperationError, NonBlockingInitFailedErrorString);
+ setError(QAbstractSocket::UnsupportedSocketOperationError, WinRTSocketEngine::NonBlockingInitFailedErrorString);
q_func()->close();
return false;
}
@@ -1307,7 +1378,7 @@ QNativeSocketEnginePrivate::~QNativeSocketEnginePrivate()
worker->deleteLater();
}
-void QNativeSocketEnginePrivate::setError(QAbstractSocket::SocketError error, ErrorString errorString) const
+void QNativeSocketEnginePrivate::setError(QAbstractSocket::SocketError error, WinRTSocketEngine::ErrorString errorString) const
{
if (hasSetSocketError) {
// Only set socket errors once for one engine; expect the
@@ -1325,86 +1396,86 @@ void QNativeSocketEnginePrivate::setError(QAbstractSocket::SocketError error, Er
socketError = error;
switch (errorString) {
- case NonBlockingInitFailedErrorString:
+ case WinRTSocketEngine::NonBlockingInitFailedErrorString:
socketErrorString = QNativeSocketEngine::tr("Unable to initialize non-blocking socket");
break;
- case BroadcastingInitFailedErrorString:
+ case WinRTSocketEngine::BroadcastingInitFailedErrorString:
socketErrorString = QNativeSocketEngine::tr("Unable to initialize broadcast socket");
break;
// should not happen anymore
- case NoIpV6ErrorString:
+ case WinRTSocketEngine::NoIpV6ErrorString:
socketErrorString = QNativeSocketEngine::tr("Attempt to use IPv6 socket on a platform with no IPv6 support");
break;
- case RemoteHostClosedErrorString:
+ case WinRTSocketEngine::RemoteHostClosedErrorString:
socketErrorString = QNativeSocketEngine::tr("The remote host closed the connection");
break;
- case TimeOutErrorString:
+ case WinRTSocketEngine::TimeOutErrorString:
socketErrorString = QNativeSocketEngine::tr("Network operation timed out");
break;
- case ResourceErrorString:
+ case WinRTSocketEngine::ResourceErrorString:
socketErrorString = QNativeSocketEngine::tr("Out of resources");
break;
- case OperationUnsupportedErrorString:
+ case WinRTSocketEngine::OperationUnsupportedErrorString:
socketErrorString = QNativeSocketEngine::tr("Unsupported socket operation");
break;
- case ProtocolUnsupportedErrorString:
+ case WinRTSocketEngine::ProtocolUnsupportedErrorString:
socketErrorString = QNativeSocketEngine::tr("Protocol type not supported");
break;
- case InvalidSocketErrorString:
+ case WinRTSocketEngine::InvalidSocketErrorString:
socketErrorString = QNativeSocketEngine::tr("Invalid socket descriptor");
break;
- case HostUnreachableErrorString:
+ case WinRTSocketEngine::HostUnreachableErrorString:
socketErrorString = QNativeSocketEngine::tr("Host unreachable");
break;
- case NetworkUnreachableErrorString:
+ case WinRTSocketEngine::NetworkUnreachableErrorString:
socketErrorString = QNativeSocketEngine::tr("Network unreachable");
break;
- case AccessErrorString:
+ case WinRTSocketEngine::AccessErrorString:
socketErrorString = QNativeSocketEngine::tr("Permission denied");
break;
- case ConnectionTimeOutErrorString:
+ case WinRTSocketEngine::ConnectionTimeOutErrorString:
socketErrorString = QNativeSocketEngine::tr("Connection timed out");
break;
- case ConnectionRefusedErrorString:
+ case WinRTSocketEngine::ConnectionRefusedErrorString:
socketErrorString = QNativeSocketEngine::tr("Connection refused");
break;
- case AddressInuseErrorString:
+ case WinRTSocketEngine::AddressInuseErrorString:
socketErrorString = QNativeSocketEngine::tr("The bound address is already in use");
break;
- case AddressNotAvailableErrorString:
+ case WinRTSocketEngine::AddressNotAvailableErrorString:
socketErrorString = QNativeSocketEngine::tr("The address is not available");
break;
- case AddressProtectedErrorString:
+ case WinRTSocketEngine::AddressProtectedErrorString:
socketErrorString = QNativeSocketEngine::tr("The address is protected");
break;
- case DatagramTooLargeErrorString:
+ case WinRTSocketEngine::DatagramTooLargeErrorString:
socketErrorString = QNativeSocketEngine::tr("Datagram was too large to send");
break;
- case SendDatagramErrorString:
+ case WinRTSocketEngine::SendDatagramErrorString:
socketErrorString = QNativeSocketEngine::tr("Unable to send a message");
break;
- case ReceiveDatagramErrorString:
+ case WinRTSocketEngine::ReceiveDatagramErrorString:
socketErrorString = QNativeSocketEngine::tr("Unable to receive a message");
break;
- case WriteErrorString:
+ case WinRTSocketEngine::WriteErrorString:
socketErrorString = QNativeSocketEngine::tr("Unable to write");
break;
- case ReadErrorString:
+ case WinRTSocketEngine::ReadErrorString:
socketErrorString = QNativeSocketEngine::tr("Network error");
break;
- case PortInuseErrorString:
+ case WinRTSocketEngine::PortInuseErrorString:
socketErrorString = QNativeSocketEngine::tr("Another socket is already listening on the same port");
break;
- case NotSocketErrorString:
+ case WinRTSocketEngine::NotSocketErrorString:
socketErrorString = QNativeSocketEngine::tr("Operation on non-socket");
break;
- case InvalidProxyTypeString:
+ case WinRTSocketEngine::InvalidProxyTypeString:
socketErrorString = QNativeSocketEngine::tr("The proxy type is invalid for this operation");
break;
- case TemporaryErrorString:
+ case WinRTSocketEngine::TemporaryErrorString:
socketErrorString = QNativeSocketEngine::tr("Temporary error");
break;
- case UnknownSocketErrorString:
+ case WinRTSocketEngine::UnknownSocketErrorString:
socketErrorString = QNativeSocketEngine::tr("Unknown error");
break;
}
@@ -1615,65 +1686,6 @@ HRESULT QNativeSocketEnginePrivate::handleClientConnection(IStreamSocketListener
return S_OK;
}
-HRESULT QNativeSocketEnginePrivate::handleConnectOpFinished(IAsyncAction *action, AsyncStatus)
-{
- Q_Q(QNativeSocketEngine);
- if (wasDeleted || !connectOp) // Protect against a late callback
- return S_OK;
-
- HRESULT hr = action->GetResults();
- switch (hr) {
- case 0x8007274c: // A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
- setError(QAbstractSocket::NetworkError, ConnectionTimeOutErrorString);
- socketState = QAbstractSocket::UnconnectedState;
- return S_OK;
- case 0x80072751: // A socket operation was attempted to an unreachable host.
- setError(QAbstractSocket::HostNotFoundError, HostUnreachableErrorString);
- socketState = QAbstractSocket::UnconnectedState;
- return S_OK;
- case 0x8007274d: // No connection could be made because the target machine actively refused it.
- setError(QAbstractSocket::ConnectionRefusedError, ConnectionRefusedErrorString);
- socketState = QAbstractSocket::UnconnectedState;
- return S_OK;
- default:
- if (FAILED(hr)) {
- setError(QAbstractSocket::UnknownSocketError, UnknownSocketErrorString);
- socketState = QAbstractSocket::UnconnectedState;
- return S_OK;
- }
- }
-
- // The callback might be triggered several times if we do not cancel/reset it here
- if (connectOp) {
- ComPtr<IAsyncInfo> info;
- hr = connectOp.As(&info);
- Q_ASSERT_SUCCEEDED(hr);
- if (info) {
- hr = info->Cancel();
- Q_ASSERT_SUCCEEDED(hr);
- hr = info->Close();
- Q_ASSERT_SUCCEEDED(hr);
- }
- hr = connectOp.Reset();
- Q_ASSERT_SUCCEEDED(hr);
- }
-
- socketState = QAbstractSocket::ConnectedState;
- emit q->connectionReady();
-
- if (socketType != QAbstractSocket::TcpSocket)
- return S_OK;
-
-#ifndef QT_NO_SSL
- // Delay the reader so that the SSL socket can upgrade
- if (sslSocket)
- QObject::connect(qobject_cast<QSslSocket *>(sslSocket), &QSslSocket::encrypted, q, &QNativeSocketEngine::establishRead);
- else
-#endif
- q->establishRead();
- return S_OK;
-}
-
HRESULT QNativeSocketEnginePrivate::handleNewDatagram(IDatagramSocket *socket, IDatagramSocketMessageReceivedEventArgs *args)
{
Q_Q(QNativeSocketEngine);
diff --git a/src/network/socket/qnativesocketengine_winrt_p.h b/src/network/socket/qnativesocketengine_winrt_p.h
index 9758310902..6528c6d627 100644
--- a/src/network/socket/qnativesocketengine_winrt_p.h
+++ b/src/network/socket/qnativesocketengine_winrt_p.h
@@ -63,6 +63,39 @@
QT_BEGIN_NAMESPACE
+namespace WinRTSocketEngine {
+ enum ErrorString {
+ NonBlockingInitFailedErrorString,
+ BroadcastingInitFailedErrorString,
+ NoIpV6ErrorString,
+ RemoteHostClosedErrorString,
+ TimeOutErrorString,
+ ResourceErrorString,
+ OperationUnsupportedErrorString,
+ ProtocolUnsupportedErrorString,
+ InvalidSocketErrorString,
+ HostUnreachableErrorString,
+ NetworkUnreachableErrorString,
+ AccessErrorString,
+ ConnectionTimeOutErrorString,
+ ConnectionRefusedErrorString,
+ AddressInuseErrorString,
+ AddressNotAvailableErrorString,
+ AddressProtectedErrorString,
+ DatagramTooLargeErrorString,
+ SendDatagramErrorString,
+ ReceiveDatagramErrorString,
+ WriteErrorString,
+ ReadErrorString,
+ PortInuseErrorString,
+ NotSocketErrorString,
+ InvalidProxyTypeString,
+ TemporaryErrorString,
+
+ UnknownSocketErrorString = -1
+ };
+}
+
class QNativeSocketEnginePrivate;
class SocketEngineWorker;
@@ -143,6 +176,8 @@ signals:
private slots:
void establishRead();
+ void handleConnectOpFinished(bool success, QAbstractSocket::SocketError error,
+ WinRTSocketEngine::ErrorString errorString);
void handleNewDatagrams(const QList<WinRtDatagram> &datagram);
void handleNewData(const QVector<QByteArray> &data);
void handleTcpError(QAbstractSocket::SocketError error);
@@ -168,38 +203,7 @@ public:
bool notifyOnRead, notifyOnWrite, notifyOnException;
QAtomicInt closingDown;
- enum ErrorString {
- NonBlockingInitFailedErrorString,
- BroadcastingInitFailedErrorString,
- NoIpV6ErrorString,
- RemoteHostClosedErrorString,
- TimeOutErrorString,
- ResourceErrorString,
- OperationUnsupportedErrorString,
- ProtocolUnsupportedErrorString,
- InvalidSocketErrorString,
- HostUnreachableErrorString,
- NetworkUnreachableErrorString,
- AccessErrorString,
- ConnectionTimeOutErrorString,
- ConnectionRefusedErrorString,
- AddressInuseErrorString,
- AddressNotAvailableErrorString,
- AddressProtectedErrorString,
- DatagramTooLargeErrorString,
- SendDatagramErrorString,
- ReceiveDatagramErrorString,
- WriteErrorString,
- ReadErrorString,
- PortInuseErrorString,
- NotSocketErrorString,
- InvalidProxyTypeString,
- TemporaryErrorString,
-
- UnknownSocketErrorString = -1
- };
-
- void setError(QAbstractSocket::SocketError error, ErrorString errorString) const;
+ void setError(QAbstractSocket::SocketError error, WinRTSocketEngine::ErrorString errorString) const;
// native functions
int option(QNativeSocketEngine::SocketOption option) const;
@@ -216,7 +220,6 @@ private:
inline ABI::Windows::Networking::Sockets::IDatagramSocket *udpSocket() const
{ return reinterpret_cast<ABI::Windows::Networking::Sockets::IDatagramSocket *>(socketDescriptor); }
Microsoft::WRL::ComPtr<ABI::Windows::Networking::Sockets::IStreamSocketListener> tcpListener;
- Microsoft::WRL::ComPtr<ABI::Windows::Foundation::IAsyncAction> connectOp;
// In case of TCP readMutex protects readBytes and bytesAvailable. In case of UDP it is
// pendingDatagrams. They are written inside native callbacks (handleReadyRead and
@@ -242,11 +245,11 @@ private:
ABI::Windows::Networking::Sockets::IDatagramSocketMessageReceivedEventArgs *args);
HRESULT handleClientConnection(ABI::Windows::Networking::Sockets::IStreamSocketListener *tcpListener,
ABI::Windows::Networking::Sockets::IStreamSocketListenerConnectionReceivedEventArgs *args);
- HRESULT handleConnectOpFinished(ABI::Windows::Foundation::IAsyncAction *, ABI::Windows::Foundation::AsyncStatus);
};
QT_END_NAMESPACE
Q_DECLARE_METATYPE(WinRtDatagram)
+Q_DECLARE_METATYPE(WinRTSocketEngine::ErrorString)
#endif // QNATIVESOCKETENGINE_WINRT_P_H
diff --git a/src/network/ssl/qsslcertificate.cpp b/src/network/ssl/qsslcertificate.cpp
index ce78399e01..6433b84e80 100644
--- a/src/network/ssl/qsslcertificate.cpp
+++ b/src/network/ssl/qsslcertificate.cpp
@@ -143,7 +143,7 @@ QSslCertificate::QSslCertificate(QIODevice *device, QSsl::EncodingFormat format)
: d(new QSslCertificatePrivate)
{
QSslSocketPrivate::ensureInitialized();
- if (device)
+ if (device && QSslSocket::supportsSsl())
d->init(device->readAll(), format);
}
@@ -157,7 +157,8 @@ QSslCertificate::QSslCertificate(const QByteArray &data, QSsl::EncodingFormat fo
: d(new QSslCertificatePrivate)
{
QSslSocketPrivate::ensureInitialized();
- d->init(data, format);
+ if (QSslSocket::supportsSsl())
+ d->init(data, format);
}
/*!
diff --git a/src/network/ssl/qsslsocket_openssl_symbols.cpp b/src/network/ssl/qsslsocket_openssl_symbols.cpp
index 1b2419ef07..c344a94427 100644
--- a/src/network/ssl/qsslsocket_openssl_symbols.cpp
+++ b/src/network/ssl/qsslsocket_openssl_symbols.cpp
@@ -1028,9 +1028,18 @@ bool q_resolveOpenSslSymbols()
RESOLVEFUNC(d2i_PKCS12_bio)
RESOLVEFUNC(PKCS12_free)
- symbolsResolved = true;
delete libs.first;
delete libs.second;
+ if (!_q_SSLeay || q_SSLeay() >= 0x10100000L) {
+ // OpenSSL 1.1 deprecated and removed SSLeay. We consider a failure to
+ // resolve this symbol as a failure to resolve symbols.
+ // The right operand of '||' above ... a bit of paranoia.
+ qCWarning(lcSsl, "Incompatible version of OpenSSL");
+ return false;
+ }
+
+ symbolsResolved = true;
+
return true;
}
#endif // QT_CONFIG(library)
diff --git a/src/platformsupport/eglconvenience/qt_egl_p.h b/src/platformsupport/eglconvenience/qt_egl_p.h
index b1495c9f9d..e2c6b0ceb6 100644
--- a/src/platformsupport/eglconvenience/qt_egl_p.h
+++ b/src/platformsupport/eglconvenience/qt_egl_p.h
@@ -53,8 +53,10 @@
#ifdef QT_EGL_NO_X11
# define MESA_EGL_NO_X11_HEADERS // MESA
-# define WIN_INTERFACE_CUSTOM // NV
-#endif // QT_EGL_NO_X11
+# if !defined(Q_OS_INTEGRITY)
+# define WIN_INTERFACE_CUSTOM // NV
+# endif // Q_OS_INTEGRITY
+#endif // QT_EGL_NO_X11
#ifdef QT_EGL_WAYLAND
# define WAYLAND // NV
diff --git a/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp b/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp
index 39b6814a57..64a0ef6fe8 100644
--- a/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp
+++ b/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp
@@ -967,15 +967,10 @@ int QFontEngineFT::loadFlags(QGlyphSet *set, GlyphFormat format, int flags,
if (format == Format_Mono) {
load_target = FT_LOAD_TARGET_MONO;
} else if (format == Format_A32) {
- if (subpixelType == Subpixel_RGB || subpixelType == Subpixel_BGR) {
- if (default_hint_style == HintFull)
- load_target = FT_LOAD_TARGET_LCD;
+ if (subpixelType == Subpixel_RGB || subpixelType == Subpixel_BGR)
hsubpixel = true;
- } else if (subpixelType == Subpixel_VRGB || subpixelType == Subpixel_VBGR) {
- if (default_hint_style == HintFull)
- load_target = FT_LOAD_TARGET_LCD_V;
+ else if (subpixelType == Subpixel_VRGB || subpixelType == Subpixel_VBGR)
vfactor = 3;
- }
} else if (format == Format_ARGB) {
#ifdef FT_LOAD_COLOR
load_flags |= FT_LOAD_COLOR;
diff --git a/src/platformsupport/fontdatabases/mac/coretext.pri b/src/platformsupport/fontdatabases/mac/coretext.pri
index a533234c26..2a9b32f65a 100644
--- a/src/platformsupport/fontdatabases/mac/coretext.pri
+++ b/src/platformsupport/fontdatabases/mac/coretext.pri
@@ -7,12 +7,16 @@ qtConfig(freetype) {
SOURCES += freetype/qfontengine_ft.cpp
}
-uikit: \
- # On iOS/tvOS/watchOS CoreText and CoreGraphics are stand-alone frameworks
- LIBS_PRIVATE += -framework CoreText -framework CoreGraphics
-else: \
- # On macOS they are re-exported by the AppKit framework
+LIBS_PRIVATE += \
+ -framework CoreFoundation \
+ -framework CoreGraphics \
+ -framework CoreText \
+ -framework Foundation
+
+macos: \
LIBS_PRIVATE += -framework AppKit
+else: \
+ LIBS_PRIVATE += -framework UIKit
# CoreText is documented to be available on watchOS, but the headers aren't present
# in the watchOS Simulator SDK like they are supposed to be. Work around the problem
diff --git a/src/platformsupport/input/input.pro b/src/platformsupport/input/input.pro
index f8ff4344cf..3d39210b9e 100644
--- a/src/platformsupport/input/input.pro
+++ b/src/platformsupport/input/input.pro
@@ -28,4 +28,8 @@ qtConfig(evdev)|qtConfig(libinput) {
include($$PWD/shared/shared.pri)
}
+qtConfig(integrityhid) {
+ include($$PWD/integrityhid/integrityhid.pri)
+}
+
load(qt_module)
diff --git a/src/platformsupport/input/integrityhid/integrityhid.pri b/src/platformsupport/input/integrityhid/integrityhid.pri
new file mode 100644
index 0000000000..0a6240c422
--- /dev/null
+++ b/src/platformsupport/input/integrityhid/integrityhid.pri
@@ -0,0 +1,7 @@
+HEADERS += \
+ $$PWD/qintegrityhidmanager.h
+
+SOURCES += \
+ $$PWD/qintegrityhidmanager.cpp
+
+QMAKE_USE_PRIVATE += integrityhid
diff --git a/src/platformsupport/input/integrityhid/qintegrityhidmanager.cpp b/src/platformsupport/input/integrityhid/qintegrityhidmanager.cpp
new file mode 100644
index 0000000000..8089a6e38b
--- /dev/null
+++ b/src/platformsupport/input/integrityhid/qintegrityhidmanager.cpp
@@ -0,0 +1,263 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 Green Hills Software
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** 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 Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qintegrityhidmanager.h"
+#include <QList>
+#include <QPoint>
+#include <QGuiApplication>
+#include <qpa/qwindowsysteminterface.h>
+#include <device/hiddriver.h>
+#include <private/qguiapplication_p.h>
+#include <private/qinputdevicemanager_p_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class IntNotifier
+{
+ static const Value ActivityPriority = 2;
+protected:
+ Activity act;
+public:
+ IntNotifier()
+ {
+ CheckSuccess(CreateActivity(CurrentTask(), ActivityPriority, false, (Value)this, &act));
+ };
+ ~IntNotifier()
+ {
+ CheckSuccess(CloseActivity(act));
+ };
+ virtual void process_event() = 0;
+ virtual void async_wait() = 0;
+};
+
+class HIDDeviceHandler : IntNotifier
+{
+public:
+ HIDDeviceHandler(HIDDriver *hidd, HIDHandle hidh)
+ : driver(hidd), handle(hidh), currentPos(0, 0) { }
+ ~HIDDeviceHandler()
+ {
+ CheckSuccess(gh_hid_close(handle));
+ };
+ void process_event(void) Q_DECL_OVERRIDE;
+ void async_wait(void) Q_DECL_OVERRIDE;
+ HIDDriver *get_driver(void) { return driver; };
+ HIDHandle get_handle(void) { return handle; };
+private:
+ HIDDriver *driver;
+ HIDHandle handle;
+ QPoint currentPos;
+ Qt::MouseButtons buttons;
+};
+
+class HIDDriverHandler : IntNotifier
+{
+public:
+ HIDDriverHandler(HIDDriver *hidd) : IntNotifier(), driver(hidd) { }
+ ~HIDDriverHandler()
+ {
+ qDeleteAll(devices);
+ };
+ void process_event(void) Q_DECL_OVERRIDE;
+ void async_wait(void) Q_DECL_OVERRIDE;
+ void find_devices(void);
+private:
+ QHash<Value, HIDDeviceHandler *> devices;
+ HIDDriver *driver;
+};
+
+void HIDDriverHandler::process_event()
+{
+ find_devices();
+}
+
+void HIDDriverHandler::async_wait()
+{
+ gh_hid_wait_for_new_device(driver, act);
+}
+
+void HIDDriverHandler::find_devices()
+{
+ Error err;
+ uintptr_t devicecontext;
+ uint32_t device_id;
+ HIDHandle handle;
+ HIDDeviceHandler *hidnot;
+ int deviceCount = 0;
+
+ devicecontext = 0;
+ forever {
+ err = gh_hid_enum_devices(driver, &device_id, &devicecontext);
+ if (err == OperationNotImplemented)
+ break;
+ else if (err == Failure)
+ break;
+ if (!devices.contains(device_id)) {
+ err = gh_hid_init_device(driver, device_id, &handle);
+ if (err == Success) {
+ hidnot = new HIDDeviceHandler(driver, handle);
+ devices.insert(device_id, hidnot);
+ QInputDeviceManagerPrivate::get(QGuiApplicationPrivate::inputDeviceManager())->setDeviceCount(
+ QInputDeviceManager::DeviceTypePointer,++deviceCount);
+ hidnot->async_wait();
+ }
+ }
+ }
+ if (err == OperationNotImplemented) {
+ /* fallback on legacy enumeration where we assume 0-based
+ * contiguous indexes */
+ device_id = 0;
+ err = Success;
+ do {
+ if (!devices.contains(device_id)) {
+ err = gh_hid_init_device(driver, device_id, &handle);
+ if (err != Success)
+ break;
+ hidnot = new HIDDeviceHandler(driver, handle);
+ devices.insert(device_id, hidnot);
+ hidnot->async_wait();
+ }
+ device_id++;
+ } while (err == Success);
+ }
+
+ async_wait();
+}
+
+
+void HIDDeviceHandler::process_event()
+{
+ HIDEvent event;
+ uint32_t num_events = 1;
+
+ while (gh_hid_get_event(handle, &event, &num_events) == Success) {
+ if (event.type == HID_TYPE_AXIS) {
+ switch (event.index) {
+ case HID_AXIS_ABSX:
+ currentPos.setX(event.value);
+ break;
+ case HID_AXIS_ABSY:
+ currentPos.setY(event.value);
+ break;
+ case HID_AXIS_RELX:
+ currentPos.setX(currentPos.x() + event.value);
+ break;
+ case HID_AXIS_RELY:
+ currentPos.setY(currentPos.y() + event.value);
+ break;
+ default:
+ /* ignore the rest for now */
+ break;
+ }
+ } else if (event.type == HID_TYPE_KEY) {
+ switch (event.index) {
+ case HID_BUTTON_LEFT:
+ if (event.value)
+ buttons |= Qt::LeftButton;
+ else
+ buttons &= ~Qt::LeftButton;
+ break;
+ case HID_BUTTON_MIDDLE:
+ if (event.value)
+ buttons |= Qt::MiddleButton;
+ else
+ buttons &= ~Qt::MiddleButton;
+ break;
+ case HID_BUTTON_RIGHT:
+ if (event.value)
+ buttons |= Qt::RightButton;
+ else
+ buttons &= ~Qt::RightButton;
+ break;
+ default:
+ /* ignore the rest for now */
+ break;
+ }
+ } else if (event.type == HID_TYPE_SYNC) {
+ QWindowSystemInterface::handleMouseEvent(0, currentPos, currentPos, buttons,
+ QGuiApplication::keyboardModifiers());
+ } else if (event.type == HID_TYPE_DISCONNECT) {
+ /* FIXME */
+ }
+ }
+ async_wait();
+}
+
+void HIDDeviceHandler::async_wait()
+{
+ CheckSuccess(gh_hid_async_wait_for_event(handle, act));
+}
+
+void QIntegrityHIDManager::open_devices()
+{
+ HIDDriver *hidd;
+ uintptr_t context = 0;
+ HIDDriverHandler *hidnot;
+
+ while (gh_hid_enum_drivers(&hidd, &context) == Success) {
+ hidnot = new HIDDriverHandler(hidd);
+ m_drivers.append(hidnot);
+ hidnot->find_devices();
+ }
+}
+
+void QIntegrityHIDManager::run()
+{
+ IntNotifier *notifier;
+ open_devices();
+ /* main loop */
+ forever {
+ WaitForActivity((Value *)&notifier);
+ notifier->process_event();
+ }
+}
+
+QIntegrityHIDManager::QIntegrityHIDManager(const QString &key, const QString &spec, QObject *parent)
+ : QThread(parent)
+{
+ start();
+}
+
+QIntegrityHIDManager::~QIntegrityHIDManager()
+{
+ terminate();
+ qDeleteAll(m_drivers);
+}
+
+QT_END_NAMESPACE
diff --git a/src/platformsupport/input/integrityhid/qintegrityhidmanager.h b/src/platformsupport/input/integrityhid/qintegrityhidmanager.h
new file mode 100644
index 0000000000..c8780b2dc2
--- /dev/null
+++ b/src/platformsupport/input/integrityhid/qintegrityhidmanager.h
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 Green Hills Software
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** 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 Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QINTEGRITYHIDMANAGER_P_H
+#define QINTEGRITYHIDMANAGER_P_H
+
+#include <QObject>
+#include <QList>
+#include <QThread>
+
+QT_BEGIN_NAMESPACE
+
+class HIDDriverHandler;
+
+class QIntegrityHIDManager : public QThread
+{
+ Q_OBJECT
+public:
+ QIntegrityHIDManager(const QString &key, const QString &specification, QObject *parent = 0);
+ ~QIntegrityHIDManager();
+
+ void run(void);
+private:
+ void open_devices(void);
+
+ QString m_spec;
+ QList<HIDDriverHandler *> m_drivers;
+
+};
+
+QT_END_NAMESPACE
+
+#endif // QINTEGRITYHIDMANAGER_P_H
diff --git a/src/platformsupport/platformsupport.pro b/src/platformsupport/platformsupport.pro
index 7a97a12bae..7db6de78b4 100644
--- a/src/platformsupport/platformsupport.pro
+++ b/src/platformsupport/platformsupport.pro
@@ -10,7 +10,7 @@ SUBDIRS = \
qtConfig(freetype)|darwin|win32: \
SUBDIRS += fontdatabases
-qtConfig(evdev)|qtConfig(tslib)|qtConfig(libinput) {
+qtConfig(evdev)|qtConfig(tslib)|qtConfig(libinput)|qtConfig(integrityhid) {
SUBDIRS += input
input.depends += devicediscovery
}
diff --git a/src/plugins/platforms/android/androidjniclipboard.cpp b/src/plugins/platforms/android/androidjniclipboard.cpp
index 17ff0e0bbb..833996403c 100644
--- a/src/plugins/platforms/android/androidjniclipboard.cpp
+++ b/src/plugins/platforms/android/androidjniclipboard.cpp
@@ -38,7 +38,6 @@
****************************************************************************/
#include "androidjniclipboard.h"
-#include "androidjnimain.h"
#include <QtCore/private/qjni_p.h>
QT_BEGIN_NAMESPACE
@@ -46,10 +45,23 @@ QT_BEGIN_NAMESPACE
using namespace QtAndroid;
namespace QtAndroidClipboard
{
- void setClipboardListener(QAndroidPlatformClipboard *listener)
+ QAndroidPlatformClipboard *m_manager = nullptr;
+
+ static char const *const QtNativeClassName = "org/qtproject/qt5/android/QtNative";
+ static JNINativeMethod methods[] = {
+ {"onClipboardDataChanged", "()V", (void *)onClipboardDataChanged}
+ };
+
+ void setClipboardManager(QAndroidPlatformClipboard *manager)
{
- Q_UNUSED(listener);
+ m_manager = manager;
QJNIObjectPrivate::callStaticMethod<void>(applicationClass(), "registerClipboardManager");
+ jclass appClass = QtAndroid::applicationClass();
+ QJNIEnvironmentPrivate env;
+ if (env->RegisterNatives(appClass, methods, sizeof(methods) / sizeof(methods[0])) < 0) {
+ __android_log_print(ANDROID_LOG_FATAL,"Qt", "RegisterNatives failed");
+ return;
+ }
}
void setClipboardText(const QString &text)
@@ -73,6 +85,11 @@ namespace QtAndroidClipboard
"()Ljava/lang/String;");
return text.toString();
}
+
+ void onClipboardDataChanged(JNIEnv */*env*/, jobject /*thiz*/)
+ {
+ m_manager->emitChanged(QClipboard::Clipboard);
+ }
}
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/android/androidjniclipboard.h b/src/plugins/platforms/android/androidjniclipboard.h
index 9de6dc1f44..2ec566e729 100644
--- a/src/plugins/platforms/android/androidjniclipboard.h
+++ b/src/plugins/platforms/android/androidjniclipboard.h
@@ -41,6 +41,8 @@
#define ANDROIDJNICLIPBOARD_H
#include <QString>
+#include "qandroidplatformclipboard.h"
+#include "androidjnimain.h"
QT_BEGIN_NAMESPACE
@@ -48,10 +50,11 @@ class QAndroidPlatformClipboard;
namespace QtAndroidClipboard
{
// Clipboard support
- void setClipboardListener(QAndroidPlatformClipboard *listener);
+ void setClipboardManager(QAndroidPlatformClipboard *manager);
void setClipboardText(const QString &text);
bool hasClipboardText();
QString clipboardText();
+ void onClipboardDataChanged(JNIEnv */*env*/, jobject /*thiz*/);
// Clipboard support
}
diff --git a/src/plugins/platforms/android/qandroidplatformclipboard.cpp b/src/plugins/platforms/android/qandroidplatformclipboard.cpp
index a2bc802680..dc5147b259 100644
--- a/src/plugins/platforms/android/qandroidplatformclipboard.cpp
+++ b/src/plugins/platforms/android/qandroidplatformclipboard.cpp
@@ -45,7 +45,7 @@ QT_BEGIN_NAMESPACE
QAndroidPlatformClipboard::QAndroidPlatformClipboard()
{
- QtAndroidClipboard::setClipboardListener(this);
+ QtAndroidClipboard::setClipboardManager(this);
}
QMimeData *QAndroidPlatformClipboard::mimeData(QClipboard::Mode mode)
diff --git a/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm b/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm
index 6001a845e8..7e6bae127c 100644
--- a/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm
+++ b/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm
@@ -509,7 +509,7 @@ static void convertLineOffset(QAccessibleTextInterface *text, int *line, int *of
// actions
- (NSArray *)accessibilityActionNames {
- NSMutableArray * nsActions = [NSMutableArray new];
+ NSMutableArray *nsActions = [[NSMutableArray new] autorelease];
QAccessibleInterface *iface = QAccessible::accessibleInterface(axid);
if (!iface || !iface->isValid())
return nsActions;
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.h b/src/plugins/platforms/cocoa/qcocoawindow.h
index 567eb7438b..deba861fcc 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.h
+++ b/src/plugins/platforms/cocoa/qcocoawindow.h
@@ -302,6 +302,7 @@ public: // for QNSView
friend class QCocoaBackingStore;
friend class QCocoaNativeInterface;
+ bool alwaysShowToolWindow() const;
void removeMonitor();
NSView *m_view;
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm
index b85fb97f67..59b76370ae 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.mm
+++ b/src/plugins/platforms/cocoa/qcocoawindow.mm
@@ -291,6 +291,8 @@ static void qt_closePopups()
- (void)closeAndRelease
{
+ qCDebug(lcQpaCocoaWindow) << "closeAndRelease" << self;
+
[self close];
if (self.helper.grabbingMouse) {
@@ -315,6 +317,71 @@ static void qt_closePopups()
@synthesize helper = _helper;
++ (void)applicationActivationChanged:(NSNotification*)notification
+{
+ const id sender = self;
+ NSEnumerator<NSWindow*> *windowEnumerator = nullptr;
+ NSApplication *application = [NSApplication sharedApplication];
+
+#if QT_MACOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_12)
+ if (QOperatingSystemVersion::current() >= QOperatingSystemVersion::MacOSSierra) {
+ // Unfortunately there's no NSWindowListOrderedBackToFront,
+ // so we have to manually reverse the order using an array.
+ NSMutableArray *windows = [[[NSMutableArray alloc] init] autorelease];
+ [application enumerateWindowsWithOptions:NSWindowListOrderedFrontToBack
+ usingBlock:^(NSWindow *window, BOOL *) {
+ // For some reason AppKit will give us nil-windows, skip those
+ if (!window)
+ return;
+
+ [(NSMutableArray*)windows addObject:window];
+ }
+ ];
+
+ windowEnumerator = windows.reverseObjectEnumerator;
+ } else
+#endif
+ {
+ // No way to get ordered list of windows, so fall back to unordered,
+ // list, which typically corresponds to window creation order.
+ windowEnumerator = application.windows.objectEnumerator;
+ }
+
+ for (NSWindow *window in windowEnumerator) {
+ // We're meddling with normal and floating windows, so leave others alone
+ if (!(window.level == NSNormalWindowLevel || window.level == NSFloatingWindowLevel))
+ continue;
+
+ // Windows that hide automatically will keep their NSFloatingWindowLevel,
+ // and hence be on top of the window stack. We don't want to affect these
+ // windows, as otherwise we might end up with key windows being ordered
+ // behind these auto-hidden windows when activating the application by
+ // clicking on a new tool window.
+ if (window.hidesOnDeactivate)
+ continue;
+
+ if ([window conformsToProtocol:@protocol(QNSWindowProtocol)]) {
+ QCocoaWindow *cocoaWindow = static_cast<id<QNSWindowProtocol>>(window).helper.platformWindow;
+ window.level = notification.name == NSApplicationWillResignActiveNotification ?
+ NSNormalWindowLevel : cocoaWindow->windowLevel(cocoaWindow->window()->flags());
+ }
+
+ // The documentation says that "when a window enters a new level, it’s ordered
+ // in front of all its peers in that level", but that doesn't seem to be the
+ // case in practice. To keep the order correct after meddling with the window
+ // levels, we explicitly order each window to the front. Since we are iterating
+ // the windows in back-to-front order, this is okey. The call also triggers AppKit
+ // to re-evaluate the level in relation to windows from other applications,
+ // working around an issue where our tool windows would stay on top of other
+ // application windows if activation was transferred to another application by
+ // clicking on it instead of via the application switcher or Dock. Finally, we
+ // do this re-ordering for all windows (except auto-hiding ones), otherwise we would
+ // end up triggering a bug in AppKit where the tool windows would disappear behind
+ // the application window.
+ [window orderFront:sender];
+ }
+}
+
- (id)initWithContentRect:(NSRect)contentRect
screen:(NSScreen*)screen
styleMask:(NSUInteger)windowStyle
@@ -328,6 +395,17 @@ static void qt_closePopups()
if (self) {
_helper = [[QNSWindowHelper alloc] initWithNSWindow:self platformWindow:qpw];
+
+ if (qpw->alwaysShowToolWindow()) {
+ static dispatch_once_t onceToken;
+ dispatch_once(&onceToken, ^{
+ NSNotificationCenter *center = [NSNotificationCenter defaultCenter];
+ [center addObserver:[self class] selector:@selector(applicationActivationChanged:)
+ name:NSApplicationWillResignActiveNotification object:nil];
+ [center addObserver:[self class] selector:@selector(applicationActivationChanged:)
+ name:NSApplicationWillBecomeActiveNotification object:nil];
+ });
+ }
}
return self;
}
@@ -361,6 +439,8 @@ static void qt_closePopups()
- (void)closeAndRelease
{
+ qCDebug(lcQpaCocoaWindow) << "closeAndRelease" << self;
+
[self.helper detachFromPlatformWindow];
[self close];
[self release];
@@ -1584,7 +1664,7 @@ void QCocoaWindow::recreateWindowIfNeeded()
if (isChildNSWindow() != shouldBeChildNSWindow)
recreateReason |= ChildNSWindowChanged;
- const bool shouldBeContentView = !parentWindow || shouldBeChildNSWindow;
+ const bool shouldBeContentView = (!parentWindow && !m_viewIsEmbedded) || shouldBeChildNSWindow;
if (isContentView() != shouldBeContentView)
recreateReason |= ContentViewChanged;
@@ -1601,7 +1681,7 @@ void QCocoaWindow::recreateWindowIfNeeded()
return;
}
- qCDebug(lcQpaCocoaWindow) << "Recreating NSWindow due to" << recreateReason;
+ qCDebug(lcQpaCocoaWindow) << "Reconfiguring NSWindow due to" << recreateReason;
QCocoaWindow *parentCocoaWindow = static_cast<QCocoaWindow *>(parentWindow);
@@ -1616,6 +1696,7 @@ void QCocoaWindow::recreateWindowIfNeeded()
// Remove current window (if any)
if ((isContentView() && !shouldBeContentView) || (recreateReason & PanelChanged)) {
+ qCDebug(lcQpaCocoaWindow) << "Getting rid of existing window" << m_nsWindow;
[m_nsWindow closeAndRelease];
if (isChildNSWindow())
[m_view.window.parentWindow removeChildWindow:m_view.window];
@@ -1642,6 +1723,7 @@ void QCocoaWindow::recreateWindowIfNeeded()
// Move view to new NSWindow if needed
if (m_nsWindow.contentView != m_view) {
+ qCDebug(lcQpaCocoaWindow) << "Ensuring that view is content view for" << m_nsWindow;
[m_view setPostsFrameChangedNotifications:NO];
[m_view retain];
if (m_view.superview) // m_view comes from another NSWindow
@@ -1723,6 +1805,8 @@ void QCocoaWindow::requestActivateWindow()
QCocoaNSWindow *QCocoaWindow::createNSWindow(bool shouldBeChildNSWindow, bool shouldBePanel)
{
+ qCDebug(lcQpaCocoaWindow) << "createNSWindow" << shouldBeChildNSWindow << shouldBePanel;
+
QMacAutoReleasePool pool;
QRect rect = geometry();
@@ -1770,8 +1854,7 @@ QCocoaNSWindow *QCocoaWindow::createNSWindow(bool shouldBeChildNSWindow, bool sh
if (shouldBePanel) {
// Qt::Tool windows hide on app deactivation, unless Qt::WA_MacAlwaysShowToolWindow is set
- window.hidesOnDeactivate = ((type & Qt::Tool) == Qt::Tool) &&
- !qt_mac_resolveOption(false, QPlatformWindow::window(), "_q_macAlwaysShowToolWindow", "");
+ window.hidesOnDeactivate = ((type & Qt::Tool) == Qt::Tool) && !alwaysShowToolWindow();
// Make popup windows show on the same desktop as the parent full-screen window
window.collectionBehavior = NSWindowCollectionBehaviorFullScreenAuxiliary;
@@ -1797,6 +1880,11 @@ QCocoaNSWindow *QCocoaWindow::createNSWindow(bool shouldBeChildNSWindow, bool sh
return window;
}
+bool QCocoaWindow::alwaysShowToolWindow() const
+{
+ return qt_mac_resolveOption(false, window(), "_q_macAlwaysShowToolWindow", "");
+}
+
void QCocoaWindow::removeMonitor()
{
if (!monitor)
diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm
index 6494dd3386..72e90a5363 100644
--- a/src/plugins/platforms/cocoa/qnsview.mm
+++ b/src/plugins/platforms/cocoa/qnsview.mm
@@ -237,7 +237,7 @@ static bool _q_dontOverrideCtrlLMB = false;
- (void)viewDidMoveToSuperview
{
- if (m_platformWindow.isNull())
+ if (!m_platformWindow)
return;
if (!(m_platformWindow->m_viewIsToBeEmbedded))
@@ -260,7 +260,7 @@ static bool _q_dontOverrideCtrlLMB = false;
- (QWindow *)topLevelWindow
{
- if (m_platformWindow.isNull())
+ if (!m_platformWindow)
return nullptr;
QWindow *focusWindow = m_platformWindow->window();
@@ -278,7 +278,7 @@ static bool _q_dontOverrideCtrlLMB = false;
- (void)updateGeometry
{
- if (m_platformWindow.isNull())
+ if (!m_platformWindow)
return;
QRect geometry;
@@ -437,8 +437,11 @@ static bool _q_dontOverrideCtrlLMB = false;
}
}
-- (void) drawRect:(NSRect)dirtyRect
+- (void)drawRect:(NSRect)dirtyRect
{
+ if (!m_platformWindow)
+ return;
+
qCDebug(lcQpaCocoaWindow) << "[QNSView drawRect:]" << m_platformWindow->window() << QRectF::fromCGRect(NSRectToCGRect(dirtyRect));
#ifndef QT_NO_OPENGL
@@ -627,7 +630,7 @@ static bool _q_dontOverrideCtrlLMB = false;
- (void)handleMouseEvent:(NSEvent *)theEvent
{
- if (m_platformWindow.isNull())
+ if (!m_platformWindow)
return;
// Tablet events may come in via the mouse event handlers,
@@ -644,7 +647,7 @@ static bool _q_dontOverrideCtrlLMB = false;
else
m_platformWindow->m_forwardWindow.clear();
}
- if (targetView->m_platformWindow.isNull())
+ if (!targetView.platformWindow)
return;
// Popups implicitly grap mouse events; forward to the active popup if there is one
@@ -670,7 +673,7 @@ static bool _q_dontOverrideCtrlLMB = false;
- (void)handleFrameStrutMouseEvent:(NSEvent *)theEvent
{
- if (m_platformWindow.isNull())
+ if (!m_platformWindow)
return;
// get m_buttons in sync
@@ -955,7 +958,7 @@ static bool _q_dontOverrideCtrlLMB = false;
- (void)mouseMovedImpl:(NSEvent *)theEvent
{
- if (m_platformWindow.isNull())
+ if (!m_platformWindow)
return;
if ([self isTransparentForUserInput])
@@ -989,7 +992,7 @@ static bool _q_dontOverrideCtrlLMB = false;
- (void)mouseEnteredImpl:(NSEvent *)theEvent
{
Q_UNUSED(theEvent)
- if (m_platformWindow.isNull())
+ if (!m_platformWindow)
return;
m_platformWindow->m_windowUnderMouse = true;
@@ -1011,7 +1014,7 @@ static bool _q_dontOverrideCtrlLMB = false;
- (void)mouseExitedImpl:(NSEvent *)theEvent
{
Q_UNUSED(theEvent);
- if (m_platformWindow.isNull())
+ if (!m_platformWindow)
return;
m_platformWindow->m_windowUnderMouse = false;
@@ -1040,7 +1043,7 @@ Q_GLOBAL_STATIC(QCocoaTabletDeviceDataHash, tabletDeviceDataHash)
- (bool)handleTabletEvent: (NSEvent *)theEvent
{
- if (m_platformWindow.isNull())
+ if (!m_platformWindow)
return false;
NSEventType eventType = [theEvent type];
@@ -1200,7 +1203,7 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent)
- (bool)shouldSendSingleTouch
{
- if (m_platformWindow.isNull())
+ if (!m_platformWindow)
return true;
// QtWidgets expects single-point touch events, QtDeclarative does not.
@@ -1210,7 +1213,7 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent)
- (void)touchesBeganWithEvent:(NSEvent *)event
{
- if (m_platformWindow.isNull())
+ if (!m_platformWindow)
return;
const NSTimeInterval timestamp = [event timestamp];
@@ -1221,7 +1224,7 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent)
- (void)touchesMovedWithEvent:(NSEvent *)event
{
- if (m_platformWindow.isNull())
+ if (!m_platformWindow)
return;
const NSTimeInterval timestamp = [event timestamp];
@@ -1232,7 +1235,7 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent)
- (void)touchesEndedWithEvent:(NSEvent *)event
{
- if (m_platformWindow.isNull())
+ if (!m_platformWindow)
return;
const NSTimeInterval timestamp = [event timestamp];
@@ -1243,7 +1246,7 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent)
- (void)touchesCancelledWithEvent:(NSEvent *)event
{
- if (m_platformWindow.isNull())
+ if (!m_platformWindow)
return;
const NSTimeInterval timestamp = [event timestamp];
@@ -1273,7 +1276,7 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent)
}
- (void)magnifyWithEvent:(NSEvent *)event
{
- if (m_platformWindow.isNull())
+ if (!m_platformWindow)
return;
if ([self handleGestureAsBeginEnd:event])
@@ -1290,7 +1293,7 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent)
- (void)smartMagnifyWithEvent:(NSEvent *)event
{
- if (m_platformWindow.isNull())
+ if (!m_platformWindow)
return;
static bool zoomIn = true;
@@ -1306,7 +1309,7 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent)
- (void)rotateWithEvent:(NSEvent *)event
{
- if (m_platformWindow.isNull())
+ if (!m_platformWindow)
return;
if ([self handleGestureAsBeginEnd:event])
@@ -1322,7 +1325,7 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent)
- (void)swipeWithEvent:(NSEvent *)event
{
- if (m_platformWindow.isNull())
+ if (!m_platformWindow)
return;
qCDebug(lcQpaGestures) << "swipeWithEvent" << [event deltaX] << [event deltaY];
@@ -1347,7 +1350,7 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent)
- (void)beginGestureWithEvent:(NSEvent *)event
{
- if (m_platformWindow.isNull())
+ if (!m_platformWindow)
return;
const NSTimeInterval timestamp = [event timestamp];
@@ -1361,7 +1364,7 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent)
- (void)endGestureWithEvent:(NSEvent *)event
{
- if (m_platformWindow.isNull())
+ if (!m_platformWindow)
return;
qCDebug(lcQpaGestures) << "endGestureWithEvent";
@@ -1377,7 +1380,7 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent)
#ifndef QT_NO_WHEELEVENT
- (void)scrollWheel:(NSEvent *)theEvent
{
- if (m_platformWindow.isNull())
+ if (!m_platformWindow)
return;
if ([self isTransparentForUserInput])
@@ -1879,6 +1882,9 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent)
- (NSArray*)validAttributesForMarkedText
{
+ if (!m_platformWindow)
+ return nil;
+
if (m_platformWindow->window() != QGuiApplication::focusWindow())
return nil;
@@ -2050,7 +2056,7 @@ static QPoint mapWindowCoordinates(QWindow *source, QWindow *target, QPoint poin
// Sends drag update to Qt, return the action
- (NSDragOperation)handleDrag:(id <NSDraggingInfo>)sender
{
- if (m_platformWindow.isNull())
+ if (!m_platformWindow)
return NSDragOperationNone;
NSPoint windowPoint = [self convertPoint: [sender draggingLocation] fromView: nil];
@@ -2080,7 +2086,7 @@ static QPoint mapWindowCoordinates(QWindow *source, QWindow *target, QPoint poin
- (void)draggingExited:(id <NSDraggingInfo>)sender
{
- if (m_platformWindow.isNull())
+ if (!m_platformWindow)
return;
QWindow *target = findEventTargetWindow(m_platformWindow->window());
@@ -2097,7 +2103,7 @@ static QPoint mapWindowCoordinates(QWindow *source, QWindow *target, QPoint poin
// called on drop, send the drop to Qt and return if it was accepted.
- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender
{
- if (m_platformWindow.isNull())
+ if (!m_platformWindow)
return false;
QWindow *target = findEventTargetWindow(m_platformWindow->window());
@@ -2131,7 +2137,7 @@ static QPoint mapWindowCoordinates(QWindow *source, QWindow *target, QPoint poin
Q_UNUSED(session);
Q_UNUSED(operation);
- if (m_platformWindow.isNull())
+ if (!m_platformWindow)
return;
QWindow *target = findEventTargetWindow(m_platformWindow->window());
diff --git a/src/plugins/platforms/eglfs/api/qeglfsintegration.cpp b/src/plugins/platforms/eglfs/api/qeglfsintegration.cpp
index 8b751a72bf..9a0be489a8 100644
--- a/src/plugins/platforms/eglfs/api/qeglfsintegration.cpp
+++ b/src/plugins/platforms/eglfs/api/qeglfsintegration.cpp
@@ -92,6 +92,10 @@
#include <QtInputSupport/private/qtslib_p.h>
#endif
+#if QT_CONFIG(integrityhid)
+#include <QtInputSupport/qintegrityhidmanager.h>
+#endif
+
#include <QtPlatformHeaders/qeglfsfunctions.h>
static void initResources()
@@ -466,6 +470,10 @@ void QEglFSIntegration::createInputHandlers()
#endif
new QEvdevTouchManager(QLatin1String("EvdevTouch"), QString() /* spec */, this);
#endif
+
+#if QT_CONFIG(integrityhid)
+ new QIntegrityHIDManager("HID", "", this);
+#endif
}
EGLNativeDisplayType QEglFSIntegration::nativeDisplay() const
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp
index 43bdb77a18..3af21d768e 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp
@@ -56,6 +56,13 @@ QEglFSKmsEglDeviceIntegration::QEglFSKmsEglDeviceIntegration()
qCDebug(qLcEglfsKmsDebug, "New DRM/KMS on EGLDevice integration created");
}
+QSurfaceFormat QEglFSKmsEglDeviceIntegration::surfaceFormatFor(const QSurfaceFormat &inputFormat) const
+{
+ QSurfaceFormat format = QEglFSKmsIntegration::surfaceFormatFor(inputFormat);
+ format.setAlphaBufferSize(8);
+ return format;
+}
+
EGLint QEglFSKmsEglDeviceIntegration::surfaceType() const
{
return EGL_STREAM_BIT_KHR;
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.h b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.h
index 62404cfcd1..5819d82ebf 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.h
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.h
@@ -55,6 +55,7 @@ class QEglFSKmsEglDeviceIntegration : public QEglFSKmsIntegration
public:
QEglFSKmsEglDeviceIntegration();
+ QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &inputFormat) const override;
EGLint surfaceType() const override;
EGLDisplay createDisplay(EGLNativeDisplayType nativeDisplay) override;
bool supportsSurfacelessContexts() const override;
diff --git a/src/plugins/platforms/ios/qiostextresponder.mm b/src/plugins/platforms/ios/qiostextresponder.mm
index eab6792266..001985a128 100644
--- a/src/plugins/platforms/ios/qiostextresponder.mm
+++ b/src/plugins/platforms/ios/qiostextresponder.mm
@@ -242,11 +242,12 @@
if (platformData.value(kImePlatformDataHideShortcutsBar).toBool()) {
// According to the docs, leadingBarButtonGroups/trailingBarButtonGroups should be set to nil to hide the shortcuts bar.
// However, starting with iOS 10, the API has been surrounded with NS_ASSUME_NONNULL, which contradicts this and causes
- // compiler warnings. And assigning just an empty array causes layout asserts. Hence, we assign empty button groups instead.
- UIBarButtonItemGroup *leading = [[[UIBarButtonItemGroup alloc] initWithBarButtonItems:@[] representativeItem:nil] autorelease];
- UIBarButtonItemGroup *trailing = [[[UIBarButtonItemGroup alloc] initWithBarButtonItems:@[] representativeItem:nil] autorelease];
- self.inputAssistantItem.leadingBarButtonGroups = @[leading];
- self.inputAssistantItem.trailingBarButtonGroups = @[trailing];
+ // compiler warnings. Still it is the way to go to really hide the space reserved for that.
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wnonnull"
+ self.inputAssistantItem.leadingBarButtonGroups = nil;
+ self.inputAssistantItem.trailingBarButtonGroups = nil;
+#pragma clang diagnostic pop
}
}
#endif
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp
index 2875463e62..077511d4e1 100644
--- a/src/plugins/platforms/windows/qwindowswindow.cpp
+++ b/src/plugins/platforms/windows/qwindowswindow.cpp
@@ -870,13 +870,15 @@ void QWindowsBaseWindow::hide_sys() // Normal hide, do not activate other window
void QWindowsBaseWindow::raise_sys()
{
qCDebug(lcQpaWindows) << __FUNCTION__ << this << window();
- SetWindowPos(handle(), HWND_TOP, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
+ if ((window()->flags() & (Qt::WindowStaysOnTopHint | Qt::WindowStaysOnBottomHint)) == 0)
+ SetWindowPos(handle(), HWND_TOP, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
}
void QWindowsBaseWindow::lower_sys()
{
qCDebug(lcQpaWindows) << __FUNCTION__ << this << window();
- SetWindowPos(handle(), HWND_BOTTOM, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
+ if ((window()->flags() & (Qt::WindowStaysOnTopHint | Qt::WindowStaysOnBottomHint)) == 0)
+ SetWindowPos(handle(), HWND_BOTTOM, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
}
void QWindowsBaseWindow::setWindowTitle_sys(const QString &title)
@@ -1616,6 +1618,16 @@ static inline bool dwmIsCompositionEnabled()
return SUCCEEDED(DwmIsCompositionEnabled(&dWmCompositionEnabled)) && dWmCompositionEnabled == TRUE;
}
+static inline bool isSoftwareGl()
+{
+#if QT_CONFIG(dynamicgl)
+ return QOpenGLStaticContext::opengl32.moduleIsNotOpengl32()
+ && QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGL;
+#else
+ return false;
+#endif // dynamicgl
+}
+
bool QWindowsWindow::handleWmPaint(HWND hwnd, UINT message,
WPARAM, LPARAM)
{
@@ -1627,15 +1639,10 @@ bool QWindowsWindow::handleWmPaint(HWND hwnd, UINT message,
return false;
PAINTSTRUCT ps;
-#if QT_CONFIG(dynamicgl)
- // QTBUG-58178: GL software rendering needs InvalidateRect() to suppress
- // artifacts while resizing.
- if (testFlag(OpenGLSurface)
- && QOpenGLStaticContext::opengl32.moduleIsNotOpengl32()
- && QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGL) {
+ // GL software rendering (QTBUG-58178) and Windows 7/Aero off with some AMD cards
+ // (QTBUG-60527) need InvalidateRect() to suppress artifacts while resizing.
+ if (testFlag(OpenGLSurface) && (isSoftwareGl() || !dwmIsCompositionEnabled()))
InvalidateRect(hwnd, 0, false);
- }
-#endif // dynamicgl
BeginPaint(hwnd, &ps);
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp
index 6365a6e9cb..289d0720e7 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.cpp
+++ b/src/plugins/platforms/xcb/qxcbwindow.cpp
@@ -156,6 +156,14 @@ QXcbScreen *QXcbWindow::parentScreen()
return parent() ? static_cast<QXcbWindow*>(parent())->parentScreen() : xcbScreen();
}
+//QPlatformWindow::screenForGeometry version that uses deviceIndependentGeometry
+QXcbScreen *QXcbWindow::initialScreen() const
+{
+ QWindowPrivate *windowPrivate = qt_window_private(window());
+ QScreen *screen = windowPrivate->screenForGeometry(window()->geometry());
+ return static_cast<QXcbScreen*>(screen->handle());
+}
+
// Returns \c true if we should set WM_TRANSIENT_FOR on \a w
static inline bool isTransient(const QWindow *w)
{
@@ -350,8 +358,8 @@ void QXcbWindow::create()
Qt::WindowType type = window()->type();
QXcbScreen *currentScreen = xcbScreen();
- QRect rect = windowGeometry();
- QXcbScreen *platformScreen = parent() ? parentScreen() : static_cast<QXcbScreen*>(screenForGeometry(rect));
+ QXcbScreen *platformScreen = parent() ? parentScreen() : initialScreen();
+ QRect rect = QHighDpi::toNativePixels(window()->geometry(), platformScreen);
if (type == Qt::Desktop) {
m_window = platformScreen->root();
diff --git a/src/plugins/platforms/xcb/qxcbwindow.h b/src/plugins/platforms/xcb/qxcbwindow.h
index b4d947e700..56628094ee 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.h
+++ b/src/plugins/platforms/xcb/qxcbwindow.h
@@ -191,6 +191,7 @@ protected:
QXcbScreen *parentScreen();
+ QXcbScreen *initialScreen() const;
void changeNetWmState(bool set, xcb_atom_t one, xcb_atom_t two = 0);
NetWmStates netWmStates();
void setNetWmStates(NetWmStates);
diff --git a/src/printsupport/dialogs/dialogs.pri b/src/printsupport/dialogs/dialogs.pri
index 7b520a05de..0a7b947c79 100644
--- a/src/printsupport/dialogs/dialogs.pri
+++ b/src/printsupport/dialogs/dialogs.pri
@@ -1,40 +1,46 @@
# Qt dialogs module
-HEADERS += \
+INCLUDEPATH += $$PWD
+
+qtConfig(printdialog) {
+ HEADERS += \
dialogs/qabstractprintdialog.h \
dialogs/qabstractprintdialog_p.h \
dialogs/qpagesetupdialog_p.h \
dialogs/qpagesetupdialog.h \
- dialogs/qprintdialog.h \
- dialogs/qprintpreviewdialog.h
+ dialogs/qprintdialog.h
-osx {
- OBJECTIVE_SOURCES += dialogs/qpagesetupdialog_mac.mm \
- dialogs/qprintdialog_mac.mm
- LIBS_PRIVATE += -framework AppKit
-}
+ macos {
+ OBJECTIVE_SOURCES += dialogs/qpagesetupdialog_mac.mm \
+ dialogs/qprintdialog_mac.mm
+ LIBS_PRIVATE += -framework AppKit
+ }
-win32 {
- SOURCES += dialogs/qpagesetupdialog_win.cpp \
- dialogs/qprintdialog_win.cpp
-}
+ win32 {
+ SOURCES += dialogs/qpagesetupdialog_win.cpp \
+ dialogs/qprintdialog_win.cpp
+ }
-unix:!mac {
- INCLUDEPATH += $$QT_SOURCE_TREE/src/plugins/printsupport/cups
- HEADERS += dialogs/qpagesetupdialog_unix_p.h
- SOURCES += dialogs/qprintdialog_unix.cpp \
- dialogs/qpagesetupdialog_unix.cpp
- FORMS += dialogs/qprintsettingsoutput.ui \
- dialogs/qprintwidget.ui \
- dialogs/qprintpropertieswidget.ui
-}
+ unix:!darwin {
+ INCLUDEPATH += $$QT_SOURCE_TREE/src/plugins/printsupport/cups
+ HEADERS += dialogs/qpagesetupdialog_unix_p.h
+ SOURCES += dialogs/qprintdialog_unix.cpp \
+ dialogs/qpagesetupdialog_unix.cpp
+ FORMS += dialogs/qprintsettingsoutput.ui \
+ dialogs/qprintwidget.ui \
+ dialogs/qprintpropertieswidget.ui
+ }
-INCLUDEPATH += $$PWD
-
-SOURCES += \
+ SOURCES += \
dialogs/qabstractprintdialog.cpp \
- dialogs/qpagesetupdialog.cpp \
- dialogs/qprintpreviewdialog.cpp
+ dialogs/qpagesetupdialog.cpp
+
+ FORMS += dialogs/qpagesetupwidget.ui
+ RESOURCES += dialogs/qprintdialog.qrc
+}
+
+qtConfig(printpreviewdialog) {
+ HEADERS += dialogs/qprintpreviewdialog.h
+ SOURCES += dialogs/qprintpreviewdialog.cpp
+}
-FORMS += dialogs/qpagesetupwidget.ui
-RESOURCES += dialogs/qprintdialog.qrc
diff --git a/src/printsupport/dialogs/qabstractprintdialog.cpp b/src/printsupport/dialogs/qabstractprintdialog.cpp
index 3c5f882f2e..f982da46d9 100644
--- a/src/printsupport/dialogs/qabstractprintdialog.cpp
+++ b/src/printsupport/dialogs/qabstractprintdialog.cpp
@@ -43,8 +43,6 @@
#include "qprinter.h"
#include "private/qprinter_p.h"
-#ifndef QT_NO_PRINTDIALOG
-
QT_BEGIN_NAMESPACE
// hack
@@ -497,5 +495,3 @@ void QPrintDialog::open(QObject *receiver, const char *member)
}
QT_END_NAMESPACE
-
-#endif // QT_NO_PRINTDIALOG
diff --git a/src/printsupport/dialogs/qabstractprintdialog.h b/src/printsupport/dialogs/qabstractprintdialog.h
index e6d34cdb5b..eb4dc3eb99 100644
--- a/src/printsupport/dialogs/qabstractprintdialog.h
+++ b/src/printsupport/dialogs/qabstractprintdialog.h
@@ -42,12 +42,11 @@
#include <QtPrintSupport/qtprintsupportglobal.h>
-#if QT_CONFIG(printdialog)
-
#include <QtWidgets/qdialog.h>
-QT_BEGIN_NAMESPACE
+QT_REQUIRE_CONFIG(printdialog);
+QT_BEGIN_NAMESPACE
class QAbstractPrintDialogPrivate;
class QPrinter;
@@ -120,6 +119,4 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(QAbstractPrintDialog::PrintDialogOptions)
QT_END_NAMESPACE
-#endif // QT_NO_PRINTDIALOG
-
#endif // QABSTRACTPRINTDIALOG_H
diff --git a/src/printsupport/dialogs/qabstractprintdialog_p.h b/src/printsupport/dialogs/qabstractprintdialog_p.h
index 12de4ee882..2537fcbf80 100644
--- a/src/printsupport/dialogs/qabstractprintdialog_p.h
+++ b/src/printsupport/dialogs/qabstractprintdialog_p.h
@@ -53,14 +53,12 @@
#include <QtPrintSupport/private/qtprintsupportglobal_p.h>
-#ifndef QT_NO_PRINTDIALOG
-
#include "private/qdialog_p.h"
#include "QtPrintSupport/qabstractprintdialog.h"
-QT_BEGIN_NAMESPACE
+QT_REQUIRE_CONFIG(printdialog);
-#ifndef QT_NO_PRINTER
+QT_BEGIN_NAMESPACE
class QPrinter;
class QPrinterPrivate;
@@ -92,10 +90,6 @@ public:
int maxPage;
};
-#endif //QT_NO_PRINTER
-
QT_END_NAMESPACE
-#endif // QT_NO_PRINTDIALOG
-
#endif // QABSTRACTPRINTDIALOG_P_H
diff --git a/src/printsupport/dialogs/qpagesetupdialog.cpp b/src/printsupport/dialogs/qpagesetupdialog.cpp
index 911c0ecdf7..4acac2c5f1 100644
--- a/src/printsupport/dialogs/qpagesetupdialog.cpp
+++ b/src/printsupport/dialogs/qpagesetupdialog.cpp
@@ -42,8 +42,6 @@
#include <QtPrintSupport/qprinter.h>
-#ifndef QT_NO_PRINTDIALOG
-
QT_BEGIN_NAMESPACE
/*!
@@ -183,5 +181,3 @@ void QPageSetupDialog::done(int result)
}
QT_END_NAMESPACE
-
-#endif
diff --git a/src/printsupport/dialogs/qpagesetupdialog.h b/src/printsupport/dialogs/qpagesetupdialog.h
index bc7462ebaa..3bd752a413 100644
--- a/src/printsupport/dialogs/qpagesetupdialog.h
+++ b/src/printsupport/dialogs/qpagesetupdialog.h
@@ -42,12 +42,11 @@
#include <QtPrintSupport/qtprintsupportglobal.h>
-#ifndef QT_NO_PRINTDIALOG
-
#include <QtWidgets/qdialog.h>
-QT_BEGIN_NAMESPACE
+QT_REQUIRE_CONFIG(printdialog);
+QT_BEGIN_NAMESPACE
class QPrinter;
class QPageSetupDialogPrivate;
@@ -77,6 +76,4 @@ public:
QT_END_NAMESPACE
-#endif // QT_NO_PRINTDIALOG
-
#endif // QPAGESETUPDIALOG_H
diff --git a/src/printsupport/dialogs/qpagesetupdialog_mac.mm b/src/printsupport/dialogs/qpagesetupdialog_mac.mm
index 581c0271f1..1e398452f7 100644
--- a/src/printsupport/dialogs/qpagesetupdialog_mac.mm
+++ b/src/printsupport/dialogs/qpagesetupdialog_mac.mm
@@ -42,7 +42,6 @@
#include "qpagesetupdialog.h"
-#ifndef QT_NO_PRINTDIALOG
#include "qpagesetupdialog_p.h"
#include <qpa/qplatformnativeinterface.h>
@@ -222,5 +221,3 @@ int QPageSetupDialog::exec()
}
QT_END_NAMESPACE
-
-#endif /* QT_NO_PRINTDIALOG */
diff --git a/src/printsupport/dialogs/qpagesetupdialog_p.h b/src/printsupport/dialogs/qpagesetupdialog_p.h
index 98b466ccdc..6a389b039a 100644
--- a/src/printsupport/dialogs/qpagesetupdialog_p.h
+++ b/src/printsupport/dialogs/qpagesetupdialog_p.h
@@ -54,14 +54,14 @@
#include <QtPrintSupport/private/qtprintsupportglobal_p.h>
-#ifndef QT_NO_PRINTDIALOG
-
#include "private/qdialog_p.h"
#include "qbytearray.h"
#include "qpagesetupdialog.h"
#include "qpointer.h"
+QT_REQUIRE_CONFIG(printdialog);
+
QT_BEGIN_NAMESPACE
class QPrinter;
@@ -83,6 +83,4 @@ public:
QT_END_NAMESPACE
-#endif // QT_NO_PRINTDIALOG
-
#endif // QPAGESETUPDIALOG_P_H
diff --git a/src/printsupport/dialogs/qpagesetupdialog_unix.cpp b/src/printsupport/dialogs/qpagesetupdialog_unix.cpp
index 98d657bed4..b4ad718646 100644
--- a/src/printsupport/dialogs/qpagesetupdialog_unix.cpp
+++ b/src/printsupport/dialogs/qpagesetupdialog_unix.cpp
@@ -39,12 +39,13 @@
#include "qpagesetupdialog.h"
-#ifndef QT_NO_PRINTDIALOG
#include "qpagesetupdialog_unix_p.h"
#include <private/qpagesetupdialog_p.h>
#include <private/qprintdevice_p.h>
+#if QT_CONFIG(cups)
#include <private/qcups_p.h>
+#endif
#include "qpainter.h"
#include "qprintdialog.h"
@@ -294,7 +295,7 @@ void QPageSetupWidget::initUnits()
// Init the Pages Per Sheet (n-up) combo boxes if using CUPS
void QPageSetupWidget::initPagesPerSheet()
{
-#if !defined(QT_NO_CUPS)
+#if QT_CONFIG(cups)
m_ui.pagesPerSheetLayoutCombo->addItem(QPrintDialog::tr("Left to Right, Top to Bottom"),
QVariant::fromValue(QCUPSSupport::LeftToRightTopToBottom));
m_ui.pagesPerSheetLayoutCombo->addItem(QPrintDialog::tr("Left to Right, Bottom to Top"),
@@ -498,7 +499,7 @@ void QPageSetupWidget::updateWidget()
void QPageSetupWidget::setupPrinter() const
{
m_printer->setPageLayout(m_pageLayout);
-#if !defined(QT_NO_CUPS)
+#if QT_CONFIG(cups)
QCUPSSupport::PagesPerSheet pagesPerSheet = m_ui.pagesPerSheetCombo->currentData()
.value<QCUPSSupport::PagesPerSheet>();
QCUPSSupport::PagesPerSheetLayout pagesPerSheetLayout = m_ui.pagesPerSheetLayoutCombo->currentData()
@@ -545,7 +546,7 @@ void QPageSetupWidget::pageOrientationChanged()
void QPageSetupWidget::pagesPerSheetChanged()
{
-#if !defined(QT_NO_CUPS)
+#if QT_CONFIG(cups)
switch (m_ui.pagesPerSheetCombo->currentData().toInt()) {
case QCUPSSupport::OnePagePerSheet:
m_pagePreview->setPagePreviewLayout(1, 1);
@@ -642,5 +643,3 @@ int QPageSetupDialog::exec()
QT_END_NAMESPACE
#include "moc_qpagesetupdialog.cpp"
-
-#endif // QT_NO_PRINTDIALOG
diff --git a/src/printsupport/dialogs/qpagesetupdialog_unix_p.h b/src/printsupport/dialogs/qpagesetupdialog_unix_p.h
index 3c9733dd83..658f103bea 100644
--- a/src/printsupport/dialogs/qpagesetupdialog_unix_p.h
+++ b/src/printsupport/dialogs/qpagesetupdialog_unix_p.h
@@ -53,14 +53,14 @@
#include <QtPrintSupport/private/qtprintsupportglobal_p.h>
-#ifndef QT_NO_PRINTDIALOG
-
#include "qprinter.h"
#include <QtGui/qpagelayout.h>
#include <ui_qpagesetupwidget.h>
+QT_REQUIRE_CONFIG(printdialog);
+
QT_BEGIN_NAMESPACE
class QPrinter;
@@ -106,5 +106,4 @@ private:
QT_END_NAMESPACE
-#endif // QT_NO_PRINTDIALOG
#endif
diff --git a/src/printsupport/dialogs/qpagesetupdialog_win.cpp b/src/printsupport/dialogs/qpagesetupdialog_win.cpp
index 88e57d27e5..23fff82f25 100644
--- a/src/printsupport/dialogs/qpagesetupdialog_win.cpp
+++ b/src/printsupport/dialogs/qpagesetupdialog_win.cpp
@@ -39,7 +39,6 @@
#include "qpagesetupdialog.h"
-#ifndef QT_NO_PRINTDIALOG
#include <qapplication.h>
#include "../kernel/qprintengine_win_p.h"
@@ -168,4 +167,3 @@ void QPageSetupDialog::setVisible(bool visible)
}
QT_END_NAMESPACE
-#endif
diff --git a/src/printsupport/dialogs/qprintdialog.h b/src/printsupport/dialogs/qprintdialog.h
index 35d650a7fc..53a6224f49 100644
--- a/src/printsupport/dialogs/qprintdialog.h
+++ b/src/printsupport/dialogs/qprintdialog.h
@@ -42,12 +42,11 @@
#include <QtPrintSupport/qtprintsupportglobal.h>
-#ifndef QT_NO_PRINTDIALOG
-
#include <QtPrintSupport/qabstractprintdialog.h>
-QT_BEGIN_NAMESPACE
+QT_REQUIRE_CONFIG(printdialog);
+QT_BEGIN_NAMESPACE
class QPrintDialogPrivate;
class QPushButton;
@@ -104,6 +103,4 @@ private:
QT_END_NAMESPACE
-#endif // QT_NO_PRINTDIALOG
-
#endif // QPRINTDIALOG_H
diff --git a/src/printsupport/dialogs/qprintdialog_mac.mm b/src/printsupport/dialogs/qprintdialog_mac.mm
index 4595ed71ff..854779977c 100644
--- a/src/printsupport/dialogs/qprintdialog_mac.mm
+++ b/src/printsupport/dialogs/qprintdialog_mac.mm
@@ -48,8 +48,6 @@
#include <QtPrintSupport/qprintengine.h>
#include <qpa/qplatformprintdevice.h>
-#ifndef QT_NO_PRINTDIALOG
-
QT_BEGIN_NAMESPACE
extern qreal qt_pointMultiplier(QPageLayout::Unit unit);
@@ -358,5 +356,3 @@ void QPrintDialog::setVisible(bool visible)
QT_END_NAMESPACE
#include "moc_qprintdialog.cpp"
-
-#endif // QT_NO_PRINTDIALOG
diff --git a/src/printsupport/dialogs/qprintdialog_unix.cpp b/src/printsupport/dialogs/qprintdialog_unix.cpp
index 5527cd94f9..32a06a4f7e 100644
--- a/src/printsupport/dialogs/qprintdialog_unix.cpp
+++ b/src/printsupport/dialogs/qprintdialog_unix.cpp
@@ -40,8 +40,6 @@
#include "qplatformdefs.h"
#include <QtPrintSupport/private/qtprintsupportglobal_p.h>
-#ifndef QT_NO_PRINTDIALOG
-
#include "private/qabstractprintdialog_p.h"
#include <QtWidgets/qmessagebox.h>
#include "qprintdialog.h"
@@ -64,7 +62,7 @@
#include "ui_qprintsettingsoutput.h"
#include "ui_qprintwidget.h"
-#ifndef QT_NO_CUPS
+#if QT_CONFIG(cups)
#include <private/qcups_p.h>
#if QT_CONFIG(cupsjobwidget)
#include "qcupsjobwidget_p.h"
@@ -313,7 +311,7 @@ void QPrintDialogPrivate::init()
options.grayscale->setIconSize(QSize(32, 32));
options.grayscale->setIcon(QIcon(QLatin1String(":/qt-project.org/dialogs/qprintdialog/images/status-gray-scale.png")));
-#ifndef QT_NO_CUPS
+#if QT_CONFIG(cups)
// Add Page Set widget if CUPS is available
options.pageSetCombo->addItem(tr("All Pages"), QVariant::fromValue(QCUPSSupport::AllPages));
options.pageSetCombo->addItem(tr("Odd Pages"), QVariant::fromValue(QCUPSSupport::OddPages));
@@ -435,7 +433,7 @@ void QPrintDialogPrivate::setupPrinter()
}
}
-#ifndef QT_NO_CUPS
+#if QT_CONFIG(cups)
// page set
if (p->printRange() == QPrinter::AllPages || p->printRange() == QPrinter::PageRange) {
//If the application is selecting pages and the first page number is even then need to adjust the odd-even accordingly
@@ -518,7 +516,7 @@ void QPrintDialogPrivate::updateWidgets()
options.printCurrentPage->setVisible(q->isOptionEnabled(QPrintDialog::PrintCurrentPage));
options.collate->setVisible(q->isOptionEnabled(QPrintDialog::PrintCollateCopies));
-#ifndef QT_NO_CUPS
+#if QT_CONFIG(cups)
// Don't display Page Set if only Selection or Current Page are enabled
if (!q->isOptionEnabled(QPrintDialog::PrintPageRange)
&& (q->isOptionEnabled(QPrintDialog::PrintSelection) || q->isOptionEnabled(QPrintDialog::PrintCurrentPage))) {
@@ -867,7 +865,7 @@ bool QUnixPrintWidgetPrivate::checkFields()
}
}
-#ifndef QT_NO_CUPS
+#if QT_CONFIG(cups)
if (propertiesDialogShown) {
QCUPSSupport::PagesPerSheet pagesPerSheet = propertiesDialog->widget.pageSetup->m_ui.pagesPerSheetCombo
->currentData().value<QCUPSSupport::PagesPerSheet>();
@@ -983,6 +981,3 @@ QT_END_NAMESPACE
#include "moc_qprintdialog.cpp"
#include "qprintdialog_unix.moc"
-
-#endif // QT_NO_PRINTDIALOG
-
diff --git a/src/printsupport/dialogs/qprintdialog_win.cpp b/src/printsupport/dialogs/qprintdialog_win.cpp
index 2e954a508d..11f2fa3259 100644
--- a/src/printsupport/dialogs/qprintdialog_win.cpp
+++ b/src/printsupport/dialogs/qprintdialog_win.cpp
@@ -39,8 +39,6 @@
#include <QtPrintSupport/qtprintsupportglobal.h>
-#ifndef QT_NO_PRINTDIALOG
-
#include "qprintdialog.h"
#include <qwidget.h>
@@ -308,5 +306,3 @@ void QPrintDialog::setVisible(bool visible)
QT_END_NAMESPACE
#include "moc_qprintdialog.cpp"
-
-#endif // QT_NO_PRINTDIALOG
diff --git a/src/printsupport/dialogs/qprintpreviewdialog.cpp b/src/printsupport/dialogs/qprintpreviewdialog.cpp
index 33ba842a1f..fd23aea460 100644
--- a/src/printsupport/dialogs/qprintpreviewdialog.cpp
+++ b/src/printsupport/dialogs/qprintpreviewdialog.cpp
@@ -56,8 +56,6 @@
#include <QtWidgets/qtoolbar.h>
#include <QtCore/QCoreApplication>
-#ifndef QT_NO_PRINTPREVIEWDIALOG
-
#include "private/qdialog_p.h"
#include <QtWidgets/qformlayout.h>
@@ -787,7 +785,3 @@ QT_END_NAMESPACE
#include "moc_qprintpreviewdialog.cpp"
#include "qprintpreviewdialog.moc"
-
-#endif // QT_NO_PRINTPREVIEWDIALOG
-
-
diff --git a/src/printsupport/dialogs/qprintpreviewdialog.h b/src/printsupport/dialogs/qprintpreviewdialog.h
index 640369fdf3..3b8f8a1171 100644
--- a/src/printsupport/dialogs/qprintpreviewdialog.h
+++ b/src/printsupport/dialogs/qprintpreviewdialog.h
@@ -42,12 +42,11 @@
#include <QtPrintSupport/qtprintsupportglobal.h>
-#ifndef QT_NO_PRINTPREVIEWDIALOG
-
#include <QtWidgets/qdialog.h>
-QT_BEGIN_NAMESPACE
+QT_REQUIRE_CONFIG(printpreviewdialog);
+QT_BEGIN_NAMESPACE
class QGraphicsView;
class QPrintPreviewDialogPrivate;
@@ -91,6 +90,4 @@ private:
QT_END_NAMESPACE
-#endif // QT_NO_PRINTPREVIEWDIALOG
-
#endif // QPRINTPREVIEWDIALOG_H
diff --git a/src/printsupport/doc/snippets/widgetprinting.cpp b/src/printsupport/doc/snippets/widgetprinting.cpp
index 561e22d5b3..6e0256cb92 100644
--- a/src/printsupport/doc/snippets/widgetprinting.cpp
+++ b/src/printsupport/doc/snippets/widgetprinting.cpp
@@ -50,7 +50,8 @@
#include <QtGui>
#include <QtWidgets>
-#ifndef QT_NO_PRINTER
+#include <QtPrintSupport/qtprintsupportglobal.h>
+#if QT_CONFIG(printdialog)
#include <QPrinter>
#include <QPrintDialog>
#endif
@@ -98,7 +99,7 @@ private slots:
}
void printFile() {
- #if !defined(QT_NO_PRINTER) && !defined(QT_NO_PRINTDIALOG)
+ #if QT_CONFIG(printdialog)
//! [1]
QPrinter printer;
diff --git a/src/printsupport/kernel/kernel.pri b/src/printsupport/kernel/kernel.pri
index 90eab4a634..ea7b4b9780 100644
--- a/src/printsupport/kernel/kernel.pri
+++ b/src/printsupport/kernel/kernel.pri
@@ -1,6 +1,5 @@
HEADERS += \
$$PWD/qpaintengine_alpha_p.h \
- $$PWD/qpaintengine_preview_p.h \
$$PWD/qprint_p.h \
$$PWD/qprintdevice_p.h \
$$PWD/qprintengine.h \
@@ -16,7 +15,6 @@ HEADERS += \
SOURCES += \
$$PWD/qpaintengine_alpha.cpp \
- $$PWD/qpaintengine_preview.cpp \
$$PWD/qprintdevice.cpp \
$$PWD/qprintengine_pdf.cpp \
$$PWD/qprinter.cpp \
@@ -25,6 +23,11 @@ SOURCES += \
$$PWD/qplatformprintplugin.cpp \
$$PWD/qplatformprintersupport.cpp
+qtConfig(printpreviewwidget) {
+ HEADERS += $$PWD/qpaintengine_preview_p.h
+ SOURCES += $$PWD/qpaintengine_preview.cpp
+}
+
win32 {
HEADERS += \
$$PWD/qprintengine_win_p.h
diff --git a/src/printsupport/kernel/qcups.cpp b/src/printsupport/kernel/qcups.cpp
index d655dd09ba..48ab71eea4 100644
--- a/src/printsupport/kernel/qcups.cpp
+++ b/src/printsupport/kernel/qcups.cpp
@@ -41,8 +41,6 @@
#include "qprintengine.h"
-#ifndef QT_NO_CUPS
-
QT_BEGIN_NAMESPACE
QStringList QCUPSSupport::cupsOptionsList(QPrinter *printer)
@@ -205,5 +203,3 @@ void QCUPSSupport::setPageRange(QPrinter *printer, int pageFrom, int pageTo)
}
QT_END_NAMESPACE
-
-#endif // QT_NO_CUPS
diff --git a/src/printsupport/kernel/qcups_p.h b/src/printsupport/kernel/qcups_p.h
index 139b18c509..780115e350 100644
--- a/src/printsupport/kernel/qcups_p.h
+++ b/src/printsupport/kernel/qcups_p.h
@@ -57,7 +57,7 @@
#include "QtPrintSupport/qprinter.h"
#include "QtCore/qdatetime.h"
-#ifndef QT_NO_CUPS
+QT_REQUIRE_CONFIG(cups);
QT_BEGIN_NAMESPACE
@@ -150,6 +150,4 @@ Q_DECLARE_METATYPE(QCUPSSupport::PageSet)
Q_DECLARE_METATYPE(QCUPSSupport::PagesPerSheetLayout)
Q_DECLARE_METATYPE(QCUPSSupport::PagesPerSheet)
-#endif // QT_NO_CUPS
-
#endif
diff --git a/src/printsupport/kernel/qpaintengine_preview.cpp b/src/printsupport/kernel/qpaintengine_preview.cpp
index b5d40fd430..4c00333097 100644
--- a/src/printsupport/kernel/qpaintengine_preview.cpp
+++ b/src/printsupport/kernel/qpaintengine_preview.cpp
@@ -46,7 +46,6 @@
#include <QtGui/qpainter.h>
#include <QtGui/qpicture.h>
-#ifndef QT_NO_PRINTPREVIEWWIDGET
QT_BEGIN_NAMESPACE
class QPreviewPaintEnginePrivate : public QPaintEnginePrivate
@@ -218,5 +217,3 @@ QPrinter::PrinterState QPreviewPaintEngine::printerState() const
}
QT_END_NAMESPACE
-
-#endif
diff --git a/src/printsupport/kernel/qpaintengine_preview_p.h b/src/printsupport/kernel/qpaintengine_preview_p.h
index 31b3142cb6..9203e40235 100644
--- a/src/printsupport/kernel/qpaintengine_preview_p.h
+++ b/src/printsupport/kernel/qpaintengine_preview_p.h
@@ -56,7 +56,7 @@
#include <QtGui/qpaintengine.h>
#include <QtPrintSupport/qprintengine.h>
-#ifndef QT_NO_PRINTPREVIEWWIDGET
+QT_REQUIRE_CONFIG(printpreviewwidget);
QT_BEGIN_NAMESPACE
@@ -100,6 +100,4 @@ public:
QT_END_NAMESPACE
-#endif // QT_NO_PRINTPREVIEWWIDGET
-
#endif
diff --git a/src/printsupport/kernel/qplatformprintdevice.cpp b/src/printsupport/kernel/qplatformprintdevice.cpp
index cbb67aefdc..e2d4a08de3 100644
--- a/src/printsupport/kernel/qplatformprintdevice.cpp
+++ b/src/printsupport/kernel/qplatformprintdevice.cpp
@@ -40,7 +40,9 @@
#include "qplatformprintdevice.h"
#include "qprintdevice_p.h"
+#if QT_CONFIG(printdialog)
#include "qprintdialog.h"
+#endif
#include <QtGui/qpagelayout.h>
diff --git a/src/printsupport/kernel/qprint_p.h b/src/printsupport/kernel/qprint_p.h
index 47dfce3787..280c2d7608 100644
--- a/src/printsupport/kernel/qprint_p.h
+++ b/src/printsupport/kernel/qprint_p.h
@@ -57,7 +57,7 @@
#include <QtCore/qstring.h>
#include <QtCore/qlist.h>
-#if (defined Q_OS_OSX) || (defined Q_OS_UNIX && !defined QT_NO_CUPS)
+#if (defined Q_OS_MACOS) || (defined Q_OS_UNIX && QT_CONFIG(cups))
#include <cups/ppd.h> // Use for type defs only, don't want to actually link in main module
#endif
@@ -245,7 +245,7 @@ public:
return QByteArray();
}
-#if (defined Q_OS_OSX) || (defined Q_OS_UNIX && !defined QT_NO_CUPS)
+#if (defined Q_OS_MACOS) || (defined Q_OS_UNIX && QT_CONFIG(cups))
// PPD utilities shared by CUPS and Mac plugins requiring CUPS headers
// May turn into a proper internal QPpd class if enough shared between Mac and CUPS,
diff --git a/src/printsupport/kernel/qprinter.cpp b/src/printsupport/kernel/qprinter.cpp
index 53bed87dfc..83ebb15a12 100644
--- a/src/printsupport/kernel/qprinter.cpp
+++ b/src/printsupport/kernel/qprinter.cpp
@@ -55,7 +55,9 @@
#include "qprintengine_pdf_p.h"
#include <qpicture.h>
+#if QT_CONFIG(printpreviewwidget)
#include <private/qpaintengine_preview_p.h>
+#endif
QT_BEGIN_NAMESPACE
@@ -185,7 +187,7 @@ void QPrinterPrivate::changeEngines(QPrinter::OutputFormat format, const QPrinte
delete oldPrintEngine;
}
-#ifndef QT_NO_PRINTPREVIEWWIDGET
+#if QT_CONFIG(printpreviewwidget)
QList<const QPicture *> QPrinterPrivate::previewPages() const
{
if (previewEngine)
@@ -210,7 +212,7 @@ void QPrinterPrivate::setPreviewMode(bool enable)
use_default_engine = had_default_engines;
}
}
-#endif // QT_NO_PRINTPREVIEWWIDGET
+#endif // QT_CONFIG(printpreviewwidget)
void QPrinterPrivate::setProperty(QPrintEngine::PrintEnginePropertyKey key, const QVariant &value)
{
@@ -623,7 +625,7 @@ QPrinter::~QPrinter()
Q_D(QPrinter);
if (d->use_default_engine)
delete d->printEngine;
-#ifndef QT_NO_PRINTPREVIEWWIDGET
+#if QT_CONFIG(printpreviewwidget)
delete d->previewEngine;
#endif
}
diff --git a/src/printsupport/kernel/qprinter_p.h b/src/printsupport/kernel/qprinter_p.h
index 18dfad926c..603eaf7409 100644
--- a/src/printsupport/kernel/qprinter_p.h
+++ b/src/printsupport/kernel/qprinter_p.h
@@ -79,7 +79,7 @@ public:
paintEngine(0),
realPrintEngine(0),
realPaintEngine(0),
-#ifndef QT_NO_PRINTPREVIEWWIDGET
+#if QT_CONFIG(printpreviewwidget)
previewEngine(0),
#endif
q_ptr(printer),
@@ -98,7 +98,7 @@ public:
QPrinterInfo findValidPrinter(const QPrinterInfo &printer = QPrinterInfo());
void initEngines(QPrinter::OutputFormat format, const QPrinterInfo &printer);
void changeEngines(QPrinter::OutputFormat format, const QPrinterInfo &printer);
-#ifndef QT_NO_PRINTPREVIEWWIDGET
+#if QT_CONFIG(printpreviewwidget)
QList<const QPicture *> previewPages() const;
void setPreviewMode(bool);
#endif
@@ -112,7 +112,7 @@ public:
QPrintEngine *realPrintEngine;
QPaintEngine *realPaintEngine;
-#ifndef QT_NO_PRINTPREVIEWWIDGET
+#if QT_CONFIG(printpreviewwidget)
QPreviewPaintEngine *previewEngine;
#endif
diff --git a/src/printsupport/widgets/qcupsjobwidget.cpp b/src/printsupport/widgets/qcupsjobwidget.cpp
index 204a125d13..00f2d64df2 100644
--- a/src/printsupport/widgets/qcupsjobwidget.cpp
+++ b/src/printsupport/widgets/qcupsjobwidget.cpp
@@ -54,8 +54,6 @@
QT_BEGIN_NAMESPACE
-#if !defined(QT_NO_PRINTER) && !defined(QT_NO_CUPS)
-
/*!
\internal
\class QCupsJobWidget
@@ -212,6 +210,4 @@ QCUPSSupport::BannerPage QCupsJobWidget::endBannerPage() const
return m_ui.endBannerPageCombo->itemData(m_ui.endBannerPageCombo->currentIndex()).value<QCUPSSupport::BannerPage>();
}
-#endif // QT_NO_PRINTER / QT_NO_CUPS
-
QT_END_NAMESPACE
diff --git a/src/printsupport/widgets/qprintpreviewwidget.cpp b/src/printsupport/widgets/qprintpreviewwidget.cpp
index fd1cf68587..b28e693612 100644
--- a/src/printsupport/widgets/qprintpreviewwidget.cpp
+++ b/src/printsupport/widgets/qprintpreviewwidget.cpp
@@ -48,8 +48,6 @@
#include <QtWidgets/qscrollbar.h>
#include <QtWidgets/qstyleoption.h>
-#ifndef QT_NO_PRINTPREVIEWWIDGET
-
QT_BEGIN_NAMESPACE
namespace {
@@ -831,5 +829,3 @@ QT_END_NAMESPACE
#include "moc_qprintpreviewwidget.cpp"
#include "qprintpreviewwidget.moc"
-
-#endif // QT_NO_PRINTPREVIEWWIDGET
diff --git a/src/printsupport/widgets/qprintpreviewwidget.h b/src/printsupport/widgets/qprintpreviewwidget.h
index dec7092eb1..8735d06072 100644
--- a/src/printsupport/widgets/qprintpreviewwidget.h
+++ b/src/printsupport/widgets/qprintpreviewwidget.h
@@ -44,7 +44,7 @@
#include <QtWidgets/qwidget.h>
#include <QtPrintSupport/qprinter.h>
-#ifndef QT_NO_PRINTPREVIEWWIDGET
+QT_REQUIRE_CONFIG(printpreviewwidget);
QT_BEGIN_NAMESPACE
@@ -114,5 +114,4 @@ private:
QT_END_NAMESPACE
-#endif // QT_NO_PRINTPREVIEWWIDGET
#endif // QPRINTPREVIEWWIDGET_H
diff --git a/src/printsupport/widgets/widgets.pri b/src/printsupport/widgets/widgets.pri
index 505983778e..1b5f0aca34 100644
--- a/src/printsupport/widgets/widgets.pri
+++ b/src/printsupport/widgets/widgets.pri
@@ -1,7 +1,9 @@
-HEADERS += widgets/qprintpreviewwidget.h
-SOURCES += widgets/qprintpreviewwidget.cpp
+qtConfig(printpreviewwidget) {
+ HEADERS += widgets/qprintpreviewwidget.h
+ SOURCES += widgets/qprintpreviewwidget.cpp
+}
-unix:!darwin:qtConfig(cups):qtConfig(cupsjobwidget) {
+unix:!darwin:qtConfig(cupsjobwidget) {
HEADERS += widgets/qcupsjobwidget_p.h
SOURCES += widgets/qcupsjobwidget.cpp
FORMS += widgets/qcupsjobwidget.ui
diff --git a/src/tools/moc/main.cpp b/src/tools/moc/main.cpp
index b30de66258..25f2fd45bf 100644
--- a/src/tools/moc/main.cpp
+++ b/src/tools/moc/main.cpp
@@ -380,6 +380,9 @@ int runMoc(int argc, char **argv)
error("Missing macro name");
parser.showHelp(1);
}
+ // Prevent parse errors on MSVC extensions.
+ if (name == "_MSC_EXTENSIONS")
+ continue;
Macro macro;
macro.symbols = Preprocessor::tokenize(value, 1, Preprocessor::TokenizeDefine);
macro.symbols.removeLast(); // remove the EOF symbol
diff --git a/src/tools/qdbusxml2cpp/qdbusxml2cpp.pro b/src/tools/qdbusxml2cpp/qdbusxml2cpp.pro
index d9ee5de0be..95fcbcbc50 100644
--- a/src/tools/qdbusxml2cpp/qdbusxml2cpp.pro
+++ b/src/tools/qdbusxml2cpp/qdbusxml2cpp.pro
@@ -1,6 +1,9 @@
option(host_build)
-!force_bootstrap:!qtConfig(commandlineparser): \
- CONFIG += force_bootstrap
+!force_bootstrap {
+ include($$OUT_PWD/../../corelib/qtcore-config.pri)
+ !qtConfig(commandlineparser): \
+ CONFIG += force_bootstrap
+}
QT = core-private
force_bootstrap: QT += bootstrap_dbus-private
else: QT += dbus-private
diff --git a/src/widgets/accessible/simplewidgets.cpp b/src/widgets/accessible/simplewidgets.cpp
index aa075cad1b..b8ce9a9060 100644
--- a/src/widgets/accessible/simplewidgets.cpp
+++ b/src/widgets/accessible/simplewidgets.cpp
@@ -59,7 +59,9 @@
#include <qlabel.h>
#endif
#include <qgroupbox.h>
+#if QT_CONFIG(lcdnumber)
#include <qlcdnumber.h>
+#endif
#include <qlineedit.h>
#include <private/qlineedit_p.h>
#include <qstyle.h>
@@ -422,7 +424,7 @@ QAccessible::Role QAccessibleDisplay::role() const
if (l->picture())
return QAccessible::Graphic;
#endif
-#ifndef QT_NO_MOVIE
+#if QT_CONFIG(movie)
if (l->movie())
return QAccessible::Animation;
#endif
@@ -464,7 +466,7 @@ QString QAccessibleDisplay::text(QAccessible::Text t) const
str = qt_accStripAmp(str);
#endif
#endif // QT_CONFIG(label)
-#ifndef QT_NO_LCDNUMBER
+#if QT_CONFIG(lcdnumber)
} else if (qobject_cast<QLCDNumber*>(object())) {
QLCDNumber *l = qobject_cast<QLCDNumber*>(object());
if (l->digitCount())
diff --git a/src/widgets/doc/src/guibooks.qdoc b/src/widgets/doc/src/guibooks.qdoc
index 5f68344758..30ffd0b5ec 100644
--- a/src/widgets/doc/src/guibooks.qdoc
+++ b/src/widgets/doc/src/guibooks.qdoc
@@ -58,7 +58,7 @@
alphabetical dictionary of widgets and other user interface elements,
with comprehensive coverage of each. Each chapter covers one widget
or other element, contains the most important recommendation from the
- Macintosh, Windows and Motif style guides, notes about common
+ \macos, Windows and Motif style guides, notes about common
problems, comparison with other widgets that can serve some of the
same roles as this one, etc.
@@ -72,7 +72,7 @@
\b{\l{http://www.amazon.com/exec/obidos/ASIN/0201622165/trolltech/t}{Macintosh
Human Interface Guidelines}}, Second Edition, ISBN
0-201-62216-5, is worth buying for the \e {don't}s alone. Even
- if you're not writing Macintosh software, avoiding most of what it
+ if you are not writing software for \macos, avoiding most of what it
advises against will produce more easily comprehensible software.
Doing what it tells you to do may also help.
diff --git a/src/widgets/itemviews/qtreeview.cpp b/src/widgets/itemviews/qtreeview.cpp
index 9583dd9657..f139fb2d5b 100644
--- a/src/widgets/itemviews/qtreeview.cpp
+++ b/src/widgets/itemviews/qtreeview.cpp
@@ -1818,7 +1818,7 @@ void QTreeView::drawBranches(QPainter *painter, const QRect &rect,
QStyle::State extraFlags = QStyle::State_None;
if (isEnabled())
extraFlags |= QStyle::State_Enabled;
- if (window()->isActiveWindow())
+ if (hasFocus())
extraFlags |= QStyle::State_Active;
QPoint oldBO = painter->brushOrigin();
if (verticalScrollMode() == QAbstractItemView::ScrollPerPixel)
diff --git a/src/widgets/kernel/qstackedlayout.cpp b/src/widgets/kernel/qstackedlayout.cpp
index d9c1c524d7..b8b6f4302d 100644
--- a/src/widgets/kernel/qstackedlayout.cpp
+++ b/src/widgets/kernel/qstackedlayout.cpp
@@ -253,7 +253,7 @@ QLayoutItem *QStackedLayout::itemAt(int index) const
// on the object then)
static bool qt_wasDeleted(const QWidget *w)
{
- return QWidgetPrivate::get(w)->wasDeleted;
+ return QObjectPrivate::get(w)->wasDeleted;
}
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index 7a83e0b517..a2f3fa4a5f 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -5858,7 +5858,7 @@ QRectF QWidgetEffectSourcePrivate::boundingRect(Qt::CoordinateSystem system) con
void QWidgetEffectSourcePrivate::draw(QPainter *painter)
{
- if (!context || context->painter != painter) {
+ if (!context || context->painter != painter || !context->sharedPainter) {
m_widget->render(painter);
return;
}
diff --git a/src/widgets/kernel/qwidgetwindow.cpp b/src/widgets/kernel/qwidgetwindow.cpp
index 31f2d672bb..6741555c0c 100644
--- a/src/widgets/kernel/qwidgetwindow.cpp
+++ b/src/widgets/kernel/qwidgetwindow.cpp
@@ -152,6 +152,10 @@ QObject *QWidgetWindow::focusObject() const
if (!windowWidget)
return Q_NULLPTR;
+ // A window can't have a focus object if it's being destroyed.
+ if (QWidgetPrivate::get(windowWidget)->data.in_destructor)
+ return nullptr;
+
QWidget *widget = windowWidget->focusWidget();
if (!widget)
diff --git a/src/widgets/widgets/qlabel.cpp b/src/widgets/widgets/qlabel.cpp
index 39e072234e..4946e3e354 100644
--- a/src/widgets/widgets/qlabel.cpp
+++ b/src/widgets/widgets/qlabel.cpp
@@ -72,7 +72,7 @@ QLabelPrivate::QLabelPrivate()
#ifndef QT_NO_PICTURE
picture(Q_NULLPTR),
#endif
-#ifndef QT_NO_MOVIE
+#if QT_CONFIG(movie)
movie(),
#endif
control(Q_NULLPTR),
@@ -582,7 +582,7 @@ QSize QLabelPrivate::sizeForWidth(int w) const
} else if (picture && !picture->isNull()) {
br = picture->boundingRect();
#endif
-#ifndef QT_NO_MOVIE
+#if QT_CONFIG(movie)
} else if (movie && !movie->currentPixmap().isNull()) {
br = movie->currentPixmap().rect();
br.setSize(br.size() / movie->currentPixmap().devicePixelRatio());
@@ -1015,7 +1015,7 @@ void QLabel::paintEvent(QPaintEvent *)
int align = QStyle::visualAlignment(d->isTextLabel ? d->textDirection()
: layoutDirection(), QFlag(d->align));
-#ifndef QT_NO_MOVIE
+#if QT_CONFIG(movie)
if (d->movie) {
if (d->scaledcontents)
style->drawItemPixmap(&painter, cr, align, d->movie->currentPixmap().scaled(cr.size()));
@@ -1216,7 +1216,7 @@ void QLabelPrivate::updateShortcut()
#endif // QT_NO_SHORTCUT
-#ifndef QT_NO_MOVIE
+#if QT_CONFIG(movie)
void QLabelPrivate::_q_movieUpdated(const QRect& rect)
{
Q_Q(QLabel);
@@ -1276,7 +1276,7 @@ void QLabel::setMovie(QMovie *movie)
d->updateLabel();
}
-#endif // QT_NO_MOVIE
+#endif // QT_CONFIG(movie)
/*!
\internal
@@ -1309,7 +1309,7 @@ void QLabelPrivate::clearContents()
q->releaseShortcut(shortcutId);
shortcutId = 0;
#endif
-#ifndef QT_NO_MOVIE
+#if QT_CONFIG(movie)
if (movie) {
QObject::disconnect(movie, SIGNAL(resized(QSize)), q, SLOT(_q_movieResized(QSize)));
QObject::disconnect(movie, SIGNAL(updated(QRect)), q, SLOT(_q_movieUpdated(QRect)));
@@ -1329,7 +1329,7 @@ void QLabelPrivate::clearContents()
}
-#ifndef QT_NO_MOVIE
+#if QT_CONFIG(movie)
/*!
Returns a pointer to the label's movie, or 0 if no movie has been
@@ -1344,7 +1344,7 @@ QMovie *QLabel::movie() const
return d->movie;
}
-#endif // QT_NO_MOVIE
+#endif // QT_CONFIG(movie)
/*!
\property QLabel::textFormat
diff --git a/src/widgets/widgets/qlabel.h b/src/widgets/widgets/qlabel.h
index 3978e34d14..469254a145 100644
--- a/src/widgets/widgets/qlabel.h
+++ b/src/widgets/widgets/qlabel.h
@@ -76,7 +76,7 @@ public:
#ifndef QT_NO_PICTURE
const QPicture *picture() const;
#endif
-#ifndef QT_NO_MOVIE
+#if QT_CONFIG(movie)
QMovie *movie() const;
#endif
@@ -122,7 +122,7 @@ public Q_SLOTS:
#ifndef QT_NO_PICTURE
void setPicture(const QPicture &);
#endif
-#ifndef QT_NO_MOVIE
+#if QT_CONFIG(movie)
void setMovie(QMovie *movie);
#endif
void setNum(int);
@@ -152,7 +152,7 @@ protected:
private:
Q_DISABLE_COPY(QLabel)
Q_DECLARE_PRIVATE(QLabel)
-#ifndef QT_NO_MOVIE
+#if QT_CONFIG(movie)
Q_PRIVATE_SLOT(d_func(), void _q_movieUpdated(const QRect&))
Q_PRIVATE_SLOT(d_func(), void _q_movieResized(const QSize&))
#endif
diff --git a/src/widgets/widgets/qlabel_p.h b/src/widgets/widgets/qlabel_p.h
index d13c05fc99..f3236ac527 100644
--- a/src/widgets/widgets/qlabel_p.h
+++ b/src/widgets/widgets/qlabel_p.h
@@ -59,7 +59,9 @@
#include "qtextdocumentfragment.h"
#include "qframe_p.h"
#include "qtextdocument.h"
+#if QT_CONFIG(movie)
#include "qmovie.h"
+#endif
#include "qimage.h"
#include "qbitmap.h"
#include "qpicture.h"
@@ -79,7 +81,7 @@ public:
void updateLabel();
QSize sizeForWidth(int w) const;
-#ifndef QT_NO_MOVIE
+#if QT_CONFIG(movie)
void _q_movieUpdated(const QRect&);
void _q_movieResized(const QSize&);
#endif
@@ -116,7 +118,7 @@ public:
#ifndef QT_NO_PICTURE
QPicture *picture;
#endif
-#ifndef QT_NO_MOVIE
+#if QT_CONFIG(movie)
QPointer<QMovie> movie;
#endif
mutable QWidgetTextControl *control;
diff --git a/src/widgets/widgets/qlcdnumber.cpp b/src/widgets/widgets/qlcdnumber.cpp
index aa052ef5cb..a0aeee2237 100644
--- a/src/widgets/widgets/qlcdnumber.cpp
+++ b/src/widgets/widgets/qlcdnumber.cpp
@@ -38,7 +38,7 @@
****************************************************************************/
#include "qlcdnumber.h"
-#ifndef QT_NO_LCDNUMBER
+
#include "qbitarray.h"
#include "qpainter.h"
#include "private/qframe_p.h"
@@ -1220,5 +1220,3 @@ bool QLCDNumber::event(QEvent *e)
QT_END_NAMESPACE
#include "moc_qlcdnumber.cpp"
-
-#endif // QT_NO_LCDNUMBER
diff --git a/src/widgets/widgets/qlcdnumber.h b/src/widgets/widgets/qlcdnumber.h
index 33669fa900..28fd530e6e 100644
--- a/src/widgets/widgets/qlcdnumber.h
+++ b/src/widgets/widgets/qlcdnumber.h
@@ -45,8 +45,7 @@
QT_BEGIN_NAMESPACE
-
-#ifndef QT_NO_LCDNUMBER
+QT_REQUIRE_CONFIG(lcdnumber);
class QLCDNumberPrivate;
class Q_WIDGETS_EXPORT QLCDNumber : public QFrame // LCD number widget
@@ -115,8 +114,6 @@ private:
Q_DECLARE_PRIVATE(QLCDNumber)
};
-#endif // QT_NO_LCDNUMBER
-
QT_END_NAMESPACE
#endif // QLCDNUMBER_H
diff --git a/src/widgets/widgets/qsplashscreen.cpp b/src/widgets/widgets/qsplashscreen.cpp
index 2758af53ef..fb92d5de0d 100644
--- a/src/widgets/widgets/qsplashscreen.cpp
+++ b/src/widgets/widgets/qsplashscreen.cpp
@@ -39,8 +39,6 @@
#include "qsplashscreen.h"
-#ifndef QT_NO_SPLASHSCREEN
-
#include "qapplication.h"
#include "qdesktopwidget.h"
#include "qpainter.h"
@@ -354,5 +352,3 @@ bool QSplashScreen::event(QEvent *e)
QT_END_NAMESPACE
#include "moc_qsplashscreen.cpp"
-
-#endif //QT_NO_SPLASHSCREEN
diff --git a/src/widgets/widgets/qsplashscreen.h b/src/widgets/widgets/qsplashscreen.h
index de58d86592..1971b8bacf 100644
--- a/src/widgets/widgets/qsplashscreen.h
+++ b/src/widgets/widgets/qsplashscreen.h
@@ -44,10 +44,10 @@
#include <QtGui/qpixmap.h>
#include <QtWidgets/qwidget.h>
-QT_BEGIN_NAMESPACE
+QT_REQUIRE_CONFIG(splashscreen);
+QT_BEGIN_NAMESPACE
-#ifndef QT_NO_SPLASHSCREEN
class QSplashScreenPrivate;
class Q_WIDGETS_EXPORT QSplashScreen : public QWidget
@@ -82,8 +82,6 @@ private:
Q_DECLARE_PRIVATE(QSplashScreen)
};
-#endif // QT_NO_SPLASHSCREEN
-
QT_END_NAMESPACE
#endif // QSPLASHSCREEN_H
diff --git a/src/widgets/widgets/widgets.pri b/src/widgets/widgets/widgets.pri
index 086585f0e6..1779c8d183 100644
--- a/src/widgets/widgets/widgets.pri
+++ b/src/widgets/widgets/widgets.pri
@@ -20,7 +20,6 @@ HEADERS += \
widgets/qgroupbox.h \
widgets/qkeysequenceedit.h \
widgets/qkeysequenceedit_p.h \
- widgets/qlcdnumber.h \
widgets/qlineedit.h \
widgets/qlineedit_p.h \
widgets/qmainwindow.h \
@@ -41,7 +40,6 @@ HEADERS += \
widgets/qsizegrip.h \
widgets/qslider.h \
widgets/qspinbox.h \
- widgets/qsplashscreen.h \
widgets/qsplitter.h \
widgets/qsplitter_p.h \
widgets/qstackedwidget.h \
@@ -84,7 +82,6 @@ SOURCES += \
widgets/qframe.cpp \
widgets/qgroupbox.cpp \
widgets/qkeysequenceedit.cpp \
- widgets/qlcdnumber.cpp \
widgets/qlineedit_p.cpp \
widgets/qlineedit.cpp \
widgets/qmainwindow.cpp \
@@ -99,7 +96,6 @@ SOURCES += \
widgets/qsizegrip.cpp \
widgets/qslider.cpp \
widgets/qspinbox.cpp \
- widgets/qsplashscreen.cpp \
widgets/qsplitter.cpp \
widgets/qstackedwidget.cpp \
widgets/qstatusbar.cpp \
@@ -165,6 +161,13 @@ qtConfig(label) {
widgets/qlabel.cpp
}
+qtConfig(lcdnumber) {
+ HEADERS += \
+ widgets/qlcdnumber.h
+
+ SOURCES += \
+ widgets/qlcdnumber.cpp
+}
qtConfig(pushbutton) {
HEADERS += \
@@ -191,6 +194,14 @@ qtConfig(dialogbuttonbox) {
widgets/qdialogbuttonbox.cpp
}
+qtConfig(splashscreen) {
+ HEADERS += \
+ widgets/qsplashscreen.h
+
+ SOURCES += \
+ widgets/qsplashscreen.cpp
+}
+
qtConfig(widgettextcontrol) {
HEADERS += \
widgets/qwidgettextcontrol_p.h \
diff --git a/tests/auto/corelib/global/qlogging/app/app.pro b/tests/auto/corelib/global/qlogging/app/app.pro
index 6fba1b6129..30751d89ec 100644
--- a/tests/auto/corelib/global/qlogging/app/app.pro
+++ b/tests/auto/corelib/global/qlogging/app/app.pro
@@ -13,5 +13,5 @@ DEFINES += QT_MESSAGELOGCONTEXT
gcc:!mingw:!haiku {
QMAKE_LFLAGS += -rdynamic
- contains(QT_ARCH, arm): QMAKE_CXXFLAGS += -funwind-tables
+ contains(QT_ARCH, arm): QMAKE_CXXFLAGS += -funwind-tables -fno-inline
}
diff --git a/tests/auto/corelib/itemmodels/qitemselectionmodel/tst_qitemselectionmodel.cpp b/tests/auto/corelib/itemmodels/qitemselectionmodel/tst_qitemselectionmodel.cpp
index fb3968c838..b05e3968ea 100644
--- a/tests/auto/corelib/itemmodels/qitemselectionmodel/tst_qitemselectionmodel.cpp
+++ b/tests/auto/corelib/itemmodels/qitemselectionmodel/tst_qitemselectionmodel.cpp
@@ -92,6 +92,9 @@ private slots:
void QTBUG48402_data();
void QTBUG48402();
+ void QTBUG58851_data();
+ void QTBUG58851();
+
private:
QAbstractItemModel *model;
QItemSelectionModel *selection;
@@ -2848,5 +2851,76 @@ void tst_QItemSelectionModel::QTBUG48402()
QCOMPARE(QItemSelectionRange(helper.tl, helper.br), QItemSelectionRange(dtl, dbr));
}
+void tst_QItemSelectionModel::QTBUG58851_data()
+{
+ using IntPair = std::pair<int, int>;
+ using IntPairList = QList<IntPair>;
+ using IntPairPair = std::pair<IntPair, IntPair>;
+ using IntPairPairList = QList<IntPairPair>;
+
+ QTest::addColumn<IntPairPairList>("rangesToSelect");
+ QTest::addColumn<IntPairList>("expectedSelectedIndexesPairs");
+ QTest::newRow("Single index in > 0 column")
+ << (IntPairPairList() << IntPairPair(IntPair(0, 1), IntPair(0, 1)))
+ << (IntPairList() << IntPair(0, 1));
+ QTest::newRow("Rectangle in > 0 column")
+ << (IntPairPairList() << IntPairPair(IntPair(0, 1), IntPair(1, 2)))
+ << (IntPairList() << IntPair(0, 1) << IntPair(0, 2) << IntPair(1, 1) << IntPair(1, 2));
+ QTest::newRow("Diagonal in > 0 column")
+ << (IntPairPairList()
+ << IntPairPair(IntPair(0, 1), IntPair(0, 1))
+ << IntPairPair(IntPair(1, 2), IntPair(1, 2))
+ << IntPairPair(IntPair(2, 3), IntPair(2, 3)))
+ << (IntPairList()
+ << IntPair(0, 1)
+ << IntPair(1, 2)
+ << IntPair(2, 3));
+}
+
+void tst_QItemSelectionModel::QTBUG58851()
+{
+ using IntPair = std::pair<int, int>;
+ using IntPairList = QList<IntPair>;
+ using IntPairPair = std::pair<IntPair, IntPair>;
+ using IntPairPairList = QList<IntPairPair>;
+
+ QFETCH(IntPairPairList, rangesToSelect);
+ QFETCH(IntPairList, expectedSelectedIndexesPairs);
+
+ QStandardItemModel model(4, 4);
+ for (int row = 0; row < model.rowCount(); ++row) {
+ for (int column = 0; column < model.columnCount(); ++column) {
+ QStandardItem *item = new QStandardItem(QString("%0%1").arg(row).arg(column));
+ model.setItem(row, column, item);
+ }
+ }
+
+ QSortFilterProxyModel proxy;
+ proxy.setSourceModel(&model);
+ proxy.setSortRole(Qt::DisplayRole);
+
+ std::vector<QPersistentModelIndex> expectedSelectedIndexes;
+ for (const IntPair &index : expectedSelectedIndexesPairs)
+ expectedSelectedIndexes.emplace_back(proxy.index(index.first, index.second));
+
+ QItemSelectionModel selections(&proxy);
+ for (const IntPairPair &range : rangesToSelect) {
+ const IntPair &tl = range.first;
+ const IntPair &br = range.second;
+ selections.select(QItemSelection(proxy.index(tl.first, tl.second),
+ proxy.index(br.first, br.second)),
+ QItemSelectionModel::Select);
+ }
+
+ for (const QPersistentModelIndex &i : expectedSelectedIndexes) {
+ QVERIFY(selections.isSelected(i));
+ }
+ proxy.sort(1, Qt::DescendingOrder);
+ QCOMPARE(selections.selectedIndexes().count(), (int)expectedSelectedIndexes.size());
+ for (const QPersistentModelIndex &i : expectedSelectedIndexes) {
+ QVERIFY(selections.isSelected(i));
+ }
+}
+
QTEST_MAIN(tst_QItemSelectionModel)
#include "tst_qitemselectionmodel.moc"
diff --git a/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp b/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp
index 31e76c4407..22f0d8ecaa 100644
--- a/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp
+++ b/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp
@@ -155,7 +155,9 @@ void tst_QCoreApplication::qAppName()
void tst_QCoreApplication::qAppVersion()
{
-#if defined(Q_OS_WIN)
+#if defined(Q_OS_WINRT)
+ const char appVersion[] = "1.0.0.0";
+#elif defined(Q_OS_WIN)
const char appVersion[] = "1.2.3.4";
#elif defined(Q_OS_DARWIN) || defined(Q_OS_ANDROID)
const char appVersion[] = "1.2.3";
@@ -946,9 +948,12 @@ void tst_QCoreApplication::addRemoveLibPaths()
char *argv[] = { const_cast<char*>(QTest::currentAppName()) };
TestApplication app(argc, argv);
- // Check that modifications stay alive across the creation of an application.
- QVERIFY(QCoreApplication::libraryPaths().contains(currentDir));
- QVERIFY(!QCoreApplication::libraryPaths().contains(paths[0]));
+ // If libraryPaths only contains currentDir, neither will be in libraryPaths now.
+ if (paths.length() != 1 && currentDir != paths[0]) {
+ // Check that modifications stay alive across the creation of an application.
+ QVERIFY(QCoreApplication::libraryPaths().contains(currentDir));
+ QVERIFY(!QCoreApplication::libraryPaths().contains(paths[0]));
+ }
QStringList replace;
replace << currentDir << paths[0];
diff --git a/tests/auto/corelib/kernel/qeventdispatcher/BLACKLIST b/tests/auto/corelib/kernel/qeventdispatcher/BLACKLIST
index 00be65751b..402d87b82f 100644
--- a/tests/auto/corelib/kernel/qeventdispatcher/BLACKLIST
+++ b/tests/auto/corelib/kernel/qeventdispatcher/BLACKLIST
@@ -1,4 +1,6 @@
[sendPostedEvents]
windows
+osx
[registerTimer]
windows
+osx
diff --git a/tests/auto/corelib/kernel/qeventloop/BLACKLIST b/tests/auto/corelib/kernel/qeventloop/BLACKLIST
index 6ea6314b0a..9f837aa197 100644
--- a/tests/auto/corelib/kernel/qeventloop/BLACKLIST
+++ b/tests/auto/corelib/kernel/qeventloop/BLACKLIST
@@ -1,2 +1,3 @@
[testQuitLock]
windows
+osx
diff --git a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp
index b6106e8c9e..f9ddd59aaa 100644
--- a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp
+++ b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp
@@ -1721,10 +1721,10 @@ void tst_QMetaType::metaObject()
}
#define METATYPE_ID_FUNCTION(Type, MetaTypeId, Name) \
- case ::qMetaTypeId< Name >(): metaType = MetaTypeIdStruct<MetaTypeId>::Value;
+ case ::qMetaTypeId< Name >(): metaType = MetaTypeIdStruct<MetaTypeId>::Value; break;
#define REGISTER_METATYPE_FUNCTION(Type, MetaTypeId, Name) \
- case qRegisterMetaType< Name >(): metaType = RegisterMetaTypeStruct<MetaTypeId>::Value;
+ case qRegisterMetaType< Name >(): metaType = RegisterMetaTypeStruct<MetaTypeId>::Value; break;
template<int>
struct MetaTypeIdStruct
diff --git a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp
index db6bdf0809..642d48d721 100644
--- a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp
+++ b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp
@@ -6926,309 +6926,261 @@ void tst_QObject::checkArgumentsForNarrowing()
enum UnscopedEnum {};
enum SignedUnscopedEnum { SignedUnscopedEnumV1 = -1, SignedUnscopedEnumV2 = 1 };
- QVERIFY(sizeof(UnscopedEnum) <= sizeof(int));
- QVERIFY(sizeof(SignedUnscopedEnum) <= sizeof(int));
+ // a constexpr would suffice, but MSVC2013 RTM doesn't support them...
+#define IS_UNSCOPED_ENUM_SIGNED (std::is_signed<typename std::underlying_type<UnscopedEnum>::type>::value)
+
+#define NARROWS_IF(x, y, test) Q_STATIC_ASSERT((QtPrivate::AreArgumentsNarrowedBase<x, y>::value) == (test))
+#define FITS_IF(x, y, test) Q_STATIC_ASSERT((QtPrivate::AreArgumentsNarrowedBase<x, y>::value) != (test))
+#define NARROWS(x, y) NARROWS_IF(x, y, true)
+#define FITS(x, y) FITS_IF(x, y, true)
+
+ Q_STATIC_ASSERT(sizeof(UnscopedEnum) <= sizeof(int));
+ Q_STATIC_ASSERT(sizeof(SignedUnscopedEnum) <= sizeof(int));
// floating point to integral
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<float, bool>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<double, bool>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<long double, bool>::value));
+ NARROWS(float, bool);
+ NARROWS(double, bool);
+ NARROWS(long double, bool);
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<float, char>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<double, char>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<long double, char>::value));
+ NARROWS(float, char);
+ NARROWS(double, char);
+ NARROWS(long double, char);
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<float, short>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<double, short>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<long double, short>::value));
+ NARROWS(float, short);
+ NARROWS(double, short);
+ NARROWS(long double, short);
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<float, int>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<double, int>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<long double, int>::value));
+ NARROWS(float, int);
+ NARROWS(double, int);
+ NARROWS(long double, int);
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<float, long>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<double, long>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<long double, long>::value));
+ NARROWS(float, long);
+ NARROWS(double, long);
+ NARROWS(long double, long);
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<float, long long>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<double, long long>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<long double, long long>::value));
+ NARROWS(float, long long);
+ NARROWS(double, long long);
+ NARROWS(long double, long long);
// floating point to a smaller floating point
- if (sizeof(double) > sizeof(float)) {
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<double, float>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<long double, float>::value));
- }
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<float, double>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<float, long double>::value));
+ NARROWS_IF(double, float, (sizeof(double) > sizeof(float)));
+ NARROWS_IF(long double, float, (sizeof(long double) > sizeof(float)));
+ FITS(float, double);
+ FITS(float, long double);
- if (sizeof(long double) > sizeof(double))
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<long double, float>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<double, long double>::value));
+ NARROWS_IF(long double, double, (sizeof(long double) > sizeof(double)));
+ FITS(double, long double);
// integral to floating point
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<bool, float>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<bool, double>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<bool, long double>::value));
+ NARROWS(bool, float);
+ NARROWS(bool, double);
+ NARROWS(bool, long double);
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<char, float>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<char, double>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<char, long double>::value));
+ NARROWS(char, float);
+ NARROWS(char, double);
+ NARROWS(char, long double);
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<short, float>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<short, double>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<short, long double>::value));
+ NARROWS(short, float);
+ NARROWS(short, double);
+ NARROWS(short, long double);
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<int, float>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<int, double>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<int, long double>::value));
+ NARROWS(int, float);
+ NARROWS(int, double);
+ NARROWS(int, long double);
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<long, float>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<long, double>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<long, long double>::value));
+ NARROWS(long, float);
+ NARROWS(long, double);
+ NARROWS(long, long double);
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<long long, float>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<long long, double>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<long long, long double>::value));
+ NARROWS(long long, float);
+ NARROWS(long long, double);
+ NARROWS(long long, long double);
// enum to floating point
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<UnscopedEnum, float>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<UnscopedEnum, double>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<UnscopedEnum, long double>::value));
+ NARROWS(UnscopedEnum, float);
+ NARROWS(UnscopedEnum, double);
+ NARROWS(UnscopedEnum, long double);
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<SignedUnscopedEnum, float>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<SignedUnscopedEnum, double>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<SignedUnscopedEnum, long double>::value));
+ NARROWS(SignedUnscopedEnum, float);
+ NARROWS(SignedUnscopedEnum, double);
+ NARROWS(SignedUnscopedEnum, long double);
// integral to smaller integral
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<bool, bool>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<char, char>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<signed char, signed char>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<signed char, short>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<signed char, int>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<signed char, long>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<signed char, long long>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<unsigned char, unsigned char>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<unsigned char, unsigned short>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<unsigned char, unsigned int>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<unsigned char, unsigned long>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<unsigned char, unsigned long long>::value));
-
- if (sizeof(bool) > sizeof(char))
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<bool, unsigned char>::value));
- else
- QVERIFY(!(QtPrivate::AreArgumentsNarrowedBase<bool, unsigned char>::value));
-
- if (sizeof(bool) > sizeof(short))
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<bool, unsigned short>::value));
- else
- QVERIFY(!(QtPrivate::AreArgumentsNarrowedBase<bool, unsigned short>::value));
-
- if (sizeof(bool) > sizeof(int))
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<bool, unsigned int>::value));
- else
- QVERIFY(!(QtPrivate::AreArgumentsNarrowedBase<bool, unsigned int>::value));
-
- if (sizeof(bool) > sizeof(long))
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<bool, unsigned long>::value));
- else
- QVERIFY(!(QtPrivate::AreArgumentsNarrowedBase<bool, unsigned long>::value));
-
- if (sizeof(bool) > sizeof(long long))
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<bool, unsigned long long>::value));
- else
- QVERIFY(!(QtPrivate::AreArgumentsNarrowedBase<bool, unsigned long long>::value));
-
- if (sizeof(short) > sizeof(char)) {
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<short, char>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<short, unsigned char>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<short, signed char>::value));
-
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<unsigned short, char>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<unsigned short, unsigned char>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<unsigned short, signed char>::value));
- }
-
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<short, short>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<short, int>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<short, long>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<short, long long>::value));
-
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<unsigned short, unsigned short>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<unsigned short, unsigned int>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<unsigned short, unsigned long>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<unsigned short, unsigned long long>::value));
-
- if (sizeof(int) > sizeof(short)) {
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<int, char>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<int, unsigned char>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<int, signed char>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<int, short>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<int, unsigned short>::value));
-
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<unsigned int, char>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<unsigned int, unsigned char>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<unsigned int, signed char>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<unsigned int, short>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<unsigned int, unsigned short>::value));
- }
-
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<int, int>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<int, long>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<int, long long>::value));
-
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<unsigned int, unsigned int>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<unsigned int, unsigned long>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<unsigned int, unsigned long long>::value));
-
- if (sizeof(long) > sizeof(int)) {
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<long, char>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<long, unsigned char>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<long, signed char>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<long, short>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<long, unsigned short>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<long, int>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<long, unsigned int>::value));
-
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<unsigned long, char>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<unsigned long, unsigned char>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<unsigned long, signed char>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<unsigned long, short>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<unsigned long, unsigned short>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<unsigned long, int>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<unsigned long, unsigned int>::value));
- }
-
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<long, long>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<long, long long>::value));
-
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<unsigned long, unsigned long>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<unsigned long, unsigned long long>::value));
-
- if (sizeof(long long) > sizeof(long)) {
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<long long, char>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<long long, unsigned char>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<long long, signed char>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<long long, short>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<long long, unsigned short>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<long long, int>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<long long, unsigned int>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<long long, long>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<long long, unsigned long>::value));
-
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<unsigned long long, char>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<unsigned long long, unsigned char>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<unsigned long long, signed char>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<unsigned long long, short>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<unsigned long long, unsigned short>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<unsigned long long, int>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<unsigned long long, unsigned int>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<unsigned long long, long>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<unsigned long long, unsigned long>::value));
- }
-
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<long long, long long>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<unsigned long long, unsigned long long>::value));
+ FITS(bool, bool);
+ FITS(char, char);
+ FITS(signed char, signed char);
+ FITS(signed char, short);
+ FITS(signed char, int);
+ FITS(signed char, long);
+ FITS(signed char, long long);
+ FITS(unsigned char, unsigned char);
+ FITS(unsigned char, unsigned short);
+ FITS(unsigned char, unsigned int);
+ FITS(unsigned char, unsigned long);
+ FITS(unsigned char, unsigned long long);
+
+ NARROWS_IF(bool, unsigned char, (sizeof(bool) > sizeof(char) || std::is_signed<bool>::value));
+ NARROWS_IF(bool, unsigned short, (sizeof(bool) > sizeof(short) || std::is_signed<bool>::value));
+ NARROWS_IF(bool, unsigned int, (sizeof(bool) > sizeof(int) || std::is_signed<bool>::value));
+ NARROWS_IF(bool, unsigned long, (sizeof(bool) > sizeof(long) || std::is_signed<bool>::value));
+ NARROWS_IF(bool, unsigned long long, (sizeof(bool) > sizeof(long long) || std::is_signed<bool>::value));
+
+ NARROWS_IF(short, char, (sizeof(short) > sizeof(char) || std::is_unsigned<char>::value));
+ NARROWS_IF(short, unsigned char, (sizeof(short) > sizeof(char)));
+ NARROWS_IF(short, signed char, (sizeof(short) > sizeof(char)));
+
+ NARROWS_IF(unsigned short, char, (sizeof(short) > sizeof(char) || std::is_signed<char>::value));
+ NARROWS_IF(unsigned short, unsigned char, (sizeof(short) > sizeof(char)));
+ NARROWS_IF(unsigned short, signed char, (sizeof(short) > sizeof(char)));
+
+ FITS(short, short);
+ FITS(short, int);
+ FITS(short, long);
+ FITS(short, long long);
+
+ FITS(unsigned short, unsigned short);
+ FITS(unsigned short, unsigned int);
+ FITS(unsigned short, unsigned long);
+ FITS(unsigned short, unsigned long long);
+
+ NARROWS_IF(int, char, (sizeof(int) > sizeof(char) || std::is_unsigned<char>::value));
+ NARROWS(int, unsigned char);
+ NARROWS_IF(int, signed char, (sizeof(int) > sizeof(char)));
+ NARROWS_IF(int, short, (sizeof(int) > sizeof(short)));
+ NARROWS(int, unsigned short);
+
+ NARROWS_IF(unsigned int, char, (sizeof(int) > sizeof(char) || std::is_signed<char>::value));
+ NARROWS_IF(unsigned int, unsigned char, (sizeof(int) > sizeof(char)));
+ NARROWS(unsigned int, signed char);
+ NARROWS(unsigned int, short);
+ NARROWS_IF(unsigned int, unsigned short, (sizeof(int) > sizeof(short)));
+
+ FITS(int, int);
+ FITS(int, long);
+ FITS(int, long long);
+
+ FITS(unsigned int, unsigned int);
+ FITS(unsigned int, unsigned long);
+ FITS(unsigned int, unsigned long long);
+
+ NARROWS_IF(long, char, (sizeof(long) > sizeof(char) || std::is_unsigned<char>::value));
+ NARROWS(long, unsigned char);
+ NARROWS_IF(long, signed char, (sizeof(long) > sizeof(char)));
+ NARROWS_IF(long, short, (sizeof(long) > sizeof(short)));
+ NARROWS(long, unsigned short);
+ NARROWS_IF(long, int, (sizeof(long) > sizeof(int)));
+ NARROWS(long, unsigned int);
+
+ NARROWS_IF(unsigned long, char, (sizeof(long) > sizeof(char) || std::is_signed<char>::value));
+ NARROWS_IF(unsigned long, unsigned char, (sizeof(long) > sizeof(char)));
+ NARROWS(unsigned long, signed char);
+ NARROWS(unsigned long, short);
+ NARROWS_IF(unsigned long, unsigned short, (sizeof(long) > sizeof(short)));
+ NARROWS(unsigned long, int);
+ NARROWS_IF(unsigned long, unsigned int, (sizeof(long) > sizeof(int)));
+
+ FITS(long, long);
+ FITS(long, long long);
+
+ FITS(unsigned long, unsigned long);
+ FITS(unsigned long, unsigned long long);
+
+ NARROWS_IF(long long, char, (sizeof(long long) > sizeof(char) || std::is_unsigned<char>::value));
+ NARROWS(long long, unsigned char);
+ NARROWS_IF(long long, signed char, (sizeof(long long) > sizeof(char)));
+ NARROWS_IF(long long, short, (sizeof(long long) > sizeof(short)));
+ NARROWS(long long, unsigned short);
+ NARROWS_IF(long long, int, (sizeof(long long) > sizeof(int)));
+ NARROWS(long long, unsigned int);
+ NARROWS_IF(long long, long, (sizeof(long long) > sizeof(long)));
+ NARROWS(long long, unsigned long);
+
+ NARROWS_IF(unsigned long long, char, (sizeof(long long) > sizeof(char) || std::is_signed<char>::value));
+ NARROWS_IF(unsigned long long, unsigned char, (sizeof(long long) > sizeof(char)));
+ NARROWS(unsigned long long, signed char);
+ NARROWS(unsigned long long, short);
+ NARROWS_IF(unsigned long long, unsigned short, (sizeof(long long) > sizeof(short)));
+ NARROWS(unsigned long long, int);
+ NARROWS_IF(unsigned long long, unsigned int, (sizeof(long long) > sizeof(int)));
+ NARROWS(unsigned long long, long);
+ NARROWS_IF(unsigned long long, unsigned long, (sizeof(long long) > sizeof(long)));
+
+ FITS(long long, long long);
+ FITS(unsigned long long, unsigned long long);
// integral to integral with different signedness. smaller ones tested above
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<signed char, unsigned char>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<signed char, unsigned short>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<signed char, unsigned int>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<signed char, unsigned long>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<signed char, unsigned long long>::value));
+ NARROWS(signed char, unsigned char);
+ NARROWS(signed char, unsigned short);
+ NARROWS(signed char, unsigned int);
+ NARROWS(signed char, unsigned long);
+ NARROWS(signed char, unsigned long long);
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<unsigned char, signed char>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<unsigned char, short>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<unsigned char, int>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<unsigned char, long>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<unsigned char, long long>::value));
+ NARROWS(unsigned char, signed char);
+ FITS(unsigned char, short);
+ FITS(unsigned char, int);
+ FITS(unsigned char, long);
+ FITS(unsigned char, long long);
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<short, unsigned short>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<short, unsigned int>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<short, unsigned long>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<short, unsigned long long>::value));
+ NARROWS(short, unsigned short);
+ NARROWS(short, unsigned int);
+ NARROWS(short, unsigned long);
+ NARROWS(short, unsigned long long);
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<unsigned short, short>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<unsigned short, int>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<unsigned short, long>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<unsigned short, long long>::value));
+ NARROWS(unsigned short, short);
+ FITS(unsigned short, int);
+ FITS(unsigned short, long);
+ FITS(unsigned short, long long);
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<int, unsigned int>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<int, unsigned long>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<int, unsigned long long>::value));
+ NARROWS(int, unsigned int);
+ NARROWS(int, unsigned long);
+ NARROWS(int, unsigned long long);
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<unsigned int, int>::value));
- QCOMPARE((QtPrivate::AreArgumentsNarrowedBase<unsigned int, long>::value), sizeof(int) >= sizeof(long));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<unsigned int, long long>::value));
+ NARROWS(unsigned int, int);
+ NARROWS_IF(unsigned int, long, (sizeof(int) >= sizeof(long)));
+ FITS(unsigned int, long long);
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<long, unsigned long>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<long, unsigned long long>::value));
+ NARROWS(long, unsigned long);
+ NARROWS(long, unsigned long long);
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<unsigned long, long>::value));
- QCOMPARE((QtPrivate::AreArgumentsNarrowedBase<unsigned long, long long>::value), sizeof(long) >= sizeof(long long));
+ NARROWS(unsigned long, long);
+ NARROWS_IF(unsigned long, long long, (sizeof(long) >= sizeof(long long)));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<long long, unsigned long long>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<unsigned long long, long long>::value));
+ NARROWS(long long, unsigned long long);
+ NARROWS(unsigned long long, long long);
// enum to smaller integral
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<UnscopedEnum, UnscopedEnum>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<SignedUnscopedEnum, SignedUnscopedEnum>::value));
-
- if (std::is_signed<typename std::underlying_type<UnscopedEnum>::type>::value) {
- if (sizeof(UnscopedEnum) > sizeof(char))
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<UnscopedEnum, signed char>::value));
- else
- QVERIFY(!(QtPrivate::AreArgumentsNarrowedBase<UnscopedEnum, signed char>::value));
-
- if (sizeof(UnscopedEnum) > sizeof(short))
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<UnscopedEnum, short>::value));
- else
- QVERIFY(!(QtPrivate::AreArgumentsNarrowedBase<UnscopedEnum, short>::value));
-
- QVERIFY(!(QtPrivate::AreArgumentsNarrowedBase<UnscopedEnum, int>::value));
- QVERIFY(!(QtPrivate::AreArgumentsNarrowedBase<UnscopedEnum, long>::value));
- QVERIFY(!(QtPrivate::AreArgumentsNarrowedBase<UnscopedEnum, long long>::value));
- } else {
- if (sizeof(UnscopedEnum) > sizeof(bool))
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<UnscopedEnum, bool>::value));
- else
- QVERIFY(!(QtPrivate::AreArgumentsNarrowedBase<UnscopedEnum, bool>::value));
+ // (note that we know that sizeof(UnscopedEnum) <= sizeof(int)
+ FITS(UnscopedEnum, UnscopedEnum);
+ FITS(SignedUnscopedEnum, SignedUnscopedEnum);
- if (sizeof(UnscopedEnum) > sizeof(char))
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<UnscopedEnum, unsigned char>::value));
- else
- QVERIFY(!(QtPrivate::AreArgumentsNarrowedBase<UnscopedEnum, unsigned char>::value));
+ NARROWS_IF(UnscopedEnum, char, ((sizeof(UnscopedEnum) > sizeof(char)) || (sizeof(UnscopedEnum) == sizeof(char) && IS_UNSCOPED_ENUM_SIGNED == std::is_signed<char>::value)));
+ NARROWS_IF(UnscopedEnum, signed char, ((sizeof(UnscopedEnum) > sizeof(char)) || (sizeof(UnscopedEnum) == sizeof(char) && !IS_UNSCOPED_ENUM_SIGNED)));
+ NARROWS_IF(UnscopedEnum, unsigned char, ((sizeof(UnscopedEnum) > sizeof(char)) || IS_UNSCOPED_ENUM_SIGNED));
- if (sizeof(UnscopedEnum) > sizeof(short))
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<UnscopedEnum, unsigned short>::value));
- else
- QVERIFY(!(QtPrivate::AreArgumentsNarrowedBase<UnscopedEnum, unsigned short>::value));
+ NARROWS_IF(UnscopedEnum, short, ((sizeof(UnscopedEnum) > sizeof(short)) || (sizeof(UnscopedEnum) == sizeof(short) && !IS_UNSCOPED_ENUM_SIGNED)));
+ NARROWS_IF(UnscopedEnum, unsigned short, ((sizeof(UnscopedEnum) > sizeof(short)) || IS_UNSCOPED_ENUM_SIGNED));
- QVERIFY(!(QtPrivate::AreArgumentsNarrowedBase<UnscopedEnum, unsigned int>::value));
- QVERIFY(!(QtPrivate::AreArgumentsNarrowedBase<UnscopedEnum, unsigned long>::value));
- QVERIFY(!(QtPrivate::AreArgumentsNarrowedBase<UnscopedEnum, unsigned long long>::value));
- }
+ NARROWS_IF(UnscopedEnum, int, (sizeof(UnscopedEnum) == sizeof(int) && !IS_UNSCOPED_ENUM_SIGNED));
+ NARROWS_IF(UnscopedEnum, unsigned int, IS_UNSCOPED_ENUM_SIGNED);
- QVERIFY(std::is_signed<typename std::underlying_type<SignedUnscopedEnum>::type>::value);
+ NARROWS_IF(UnscopedEnum, long, (sizeof(UnscopedEnum) == sizeof(long) && !IS_UNSCOPED_ENUM_SIGNED));
+ NARROWS_IF(UnscopedEnum, unsigned long, IS_UNSCOPED_ENUM_SIGNED);
- if (sizeof(SignedUnscopedEnum) > sizeof(char))
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<SignedUnscopedEnum, signed char>::value));
- else
- QVERIFY(!(QtPrivate::AreArgumentsNarrowedBase<SignedUnscopedEnum, signed char>::value));
+ NARROWS_IF(UnscopedEnum, long long, (sizeof(UnscopedEnum) == sizeof(long long) && !IS_UNSCOPED_ENUM_SIGNED));
+ NARROWS_IF(UnscopedEnum, unsigned long long, IS_UNSCOPED_ENUM_SIGNED);
- if (sizeof(SignedUnscopedEnum) > sizeof(short))
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<SignedUnscopedEnum, short>::value));
- else
- QVERIFY(!(QtPrivate::AreArgumentsNarrowedBase<SignedUnscopedEnum, short>::value));
+ Q_STATIC_ASSERT(std::is_signed<typename std::underlying_type<SignedUnscopedEnum>::type>::value);
- QVERIFY(!(QtPrivate::AreArgumentsNarrowedBase<SignedUnscopedEnum, int>::value));
- QVERIFY(!(QtPrivate::AreArgumentsNarrowedBase<SignedUnscopedEnum, long>::value));
- QVERIFY(!(QtPrivate::AreArgumentsNarrowedBase<SignedUnscopedEnum, long long>::value));
+ NARROWS_IF(SignedUnscopedEnum, signed char, (sizeof(SignedUnscopedEnum) > sizeof(char)));
+ NARROWS_IF(SignedUnscopedEnum, short, (sizeof(SignedUnscopedEnum) > sizeof(short)));
+ FITS(SignedUnscopedEnum, int);
+ FITS(SignedUnscopedEnum, long);
+ FITS(SignedUnscopedEnum, long long);
enum class ScopedEnumBackedBySChar : signed char { A };
@@ -7242,192 +7194,190 @@ void tst_QObject::checkArgumentsForNarrowing()
enum class ScopedEnumBackedByLongLong : long long { A };
enum class ScopedEnumBackedByULongLong : unsigned long long { A };
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedBySChar, ScopedEnumBackedBySChar>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByUChar, ScopedEnumBackedByUChar>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByShort, ScopedEnumBackedByShort>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByUShort, ScopedEnumBackedByUShort>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByInt, ScopedEnumBackedByInt>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByUInt, ScopedEnumBackedByUInt>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByLong, ScopedEnumBackedByLong>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByULong, ScopedEnumBackedByULong>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByLongLong, ScopedEnumBackedByLongLong>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByULongLong, ScopedEnumBackedByULongLong>::value));
-
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedBySChar, signed char>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByUChar, unsigned char>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByShort, short>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByUShort, unsigned short>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByInt, int>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByUInt, unsigned int>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByLong, long>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByULong, unsigned long>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByLongLong, long long>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByULongLong, unsigned long long>::value));
-
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedBySChar, signed char>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedBySChar, short>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedBySChar, int>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedBySChar, long>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedBySChar, long long>::value));
-
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByUChar, unsigned char>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByUChar, unsigned short>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByUChar, unsigned int>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByUChar, unsigned long>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByUChar, unsigned long long>::value));
-
- if (sizeof(short) > sizeof(char)) {
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByShort, char>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByUShort, char>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByInt, char>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByUInt, char>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByLong, char>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByULong, char>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByLongLong, char>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByULongLong, char>::value));
-
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByShort, signed char>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByUShort, signed char>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByInt, signed char>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByUInt, signed char>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByLong, signed char>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByULong, signed char>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByLongLong, signed char>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByULongLong, signed char>::value));
-
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByShort, unsigned char>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByUShort, unsigned char>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByInt, unsigned char>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByUInt, unsigned char>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByLong, unsigned char>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByULong, unsigned char>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByLongLong, unsigned char>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByULongLong, unsigned char>::value));
- }
-
- if (sizeof(int) > sizeof(short)) {
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByInt, short>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByUInt, short>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByLong, short>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByULong, short>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByLongLong, short>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByULongLong, short>::value));
-
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByInt, unsigned short>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByUInt, unsigned short>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByLong, unsigned short>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByULong, unsigned short>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByLongLong, unsigned short>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByULongLong, unsigned short>::value));
- }
-
- if (sizeof(long) > sizeof(int)) {
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByLong, int>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByULong, int>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByLongLong, int>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByULongLong, int>::value));
-
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByLong, unsigned int>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByULong, unsigned int>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByLongLong, unsigned int>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByULongLong, unsigned int>::value));
- }
-
- if (sizeof(long long) > sizeof(long)) {
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByLongLong, long>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByULongLong, long>::value));
-
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByLongLong, unsigned long>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByULongLong, unsigned long>::value));
- }
+ FITS(ScopedEnumBackedBySChar, ScopedEnumBackedBySChar);
+ FITS(ScopedEnumBackedByUChar, ScopedEnumBackedByUChar);
+ FITS(ScopedEnumBackedByShort, ScopedEnumBackedByShort);
+ FITS(ScopedEnumBackedByUShort, ScopedEnumBackedByUShort);
+ FITS(ScopedEnumBackedByInt, ScopedEnumBackedByInt);
+ FITS(ScopedEnumBackedByUInt, ScopedEnumBackedByUInt);
+ FITS(ScopedEnumBackedByLong, ScopedEnumBackedByLong);
+ FITS(ScopedEnumBackedByULong, ScopedEnumBackedByULong);
+ FITS(ScopedEnumBackedByLongLong, ScopedEnumBackedByLongLong);
+ FITS(ScopedEnumBackedByULongLong, ScopedEnumBackedByULongLong);
+
+ FITS(ScopedEnumBackedBySChar, signed char);
+ FITS(ScopedEnumBackedByUChar, unsigned char);
+ FITS(ScopedEnumBackedByShort, short);
+ FITS(ScopedEnumBackedByUShort, unsigned short);
+ FITS(ScopedEnumBackedByInt, int);
+ FITS(ScopedEnumBackedByUInt, unsigned int);
+ FITS(ScopedEnumBackedByLong, long);
+ FITS(ScopedEnumBackedByULong, unsigned long);
+ FITS(ScopedEnumBackedByLongLong, long long);
+ FITS(ScopedEnumBackedByULongLong, unsigned long long);
+
+ FITS(ScopedEnumBackedBySChar, signed char);
+ FITS(ScopedEnumBackedBySChar, short);
+ FITS(ScopedEnumBackedBySChar, int);
+ FITS(ScopedEnumBackedBySChar, long);
+ FITS(ScopedEnumBackedBySChar, long long);
+
+ FITS(ScopedEnumBackedByUChar, unsigned char);
+ FITS(ScopedEnumBackedByUChar, unsigned short);
+ FITS(ScopedEnumBackedByUChar, unsigned int);
+ FITS(ScopedEnumBackedByUChar, unsigned long);
+ FITS(ScopedEnumBackedByUChar, unsigned long long);
+
+ NARROWS_IF(ScopedEnumBackedByShort, char, (sizeof(short) > sizeof(char) || std::is_unsigned<char>::value));
+ NARROWS_IF(ScopedEnumBackedByUShort, char, (sizeof(short) > sizeof(char) || std::is_signed<char>::value));
+ NARROWS_IF(ScopedEnumBackedByInt, char, (sizeof(int) > sizeof(char) || std::is_unsigned<char>::value));
+ NARROWS_IF(ScopedEnumBackedByUInt, char, (sizeof(int) > sizeof(char) || std::is_signed<char>::value));
+ NARROWS_IF(ScopedEnumBackedByLong, char, (sizeof(long) > sizeof(char) || std::is_unsigned<char>::value));
+ NARROWS_IF(ScopedEnumBackedByULong, char, (sizeof(long) > sizeof(char) || std::is_signed<char>::value));
+ NARROWS_IF(ScopedEnumBackedByLongLong, char, (sizeof(long long) > sizeof(char) || std::is_unsigned<char>::value));
+ NARROWS_IF(ScopedEnumBackedByULongLong, char, (sizeof(long long) > sizeof(char) || std::is_signed<char>::value));
+
+ NARROWS_IF(ScopedEnumBackedByShort, signed char, (sizeof(short) > sizeof(char)));
+ NARROWS(ScopedEnumBackedByUShort, signed char);
+ NARROWS_IF(ScopedEnumBackedByInt, signed char, (sizeof(int) > sizeof(char)));
+ NARROWS(ScopedEnumBackedByUInt, signed char);
+ NARROWS_IF(ScopedEnumBackedByLong, signed char, (sizeof(long) > sizeof(char)));
+ NARROWS(ScopedEnumBackedByULong, signed char);
+ NARROWS_IF(ScopedEnumBackedByLongLong, signed char, (sizeof(long long) > sizeof(char)));
+ NARROWS(ScopedEnumBackedByULongLong, signed char);
+
+ NARROWS(ScopedEnumBackedByShort, unsigned char);
+ NARROWS_IF(ScopedEnumBackedByUShort, unsigned char, (sizeof(short) > sizeof(char)));
+ NARROWS(ScopedEnumBackedByInt, unsigned char);
+ NARROWS_IF(ScopedEnumBackedByUInt, unsigned char, (sizeof(int) > sizeof(char)));
+ NARROWS(ScopedEnumBackedByLong, unsigned char);
+ NARROWS_IF(ScopedEnumBackedByULong, unsigned char, (sizeof(long) > sizeof(char)));
+ NARROWS(ScopedEnumBackedByLongLong, unsigned char);
+ NARROWS_IF(ScopedEnumBackedByULongLong, unsigned char, (sizeof(long long) > sizeof(char)));
+
+ NARROWS_IF(ScopedEnumBackedByInt, short, (sizeof(int) > sizeof(short)));
+ NARROWS(ScopedEnumBackedByUInt, short);
+ NARROWS_IF(ScopedEnumBackedByLong, short, (sizeof(long) > sizeof(short)));
+ NARROWS(ScopedEnumBackedByULong, short);
+ NARROWS_IF(ScopedEnumBackedByLongLong, short, (sizeof(long long) > sizeof(short)));
+ NARROWS(ScopedEnumBackedByULongLong, short);
+
+ NARROWS(ScopedEnumBackedByInt, unsigned short);
+ NARROWS_IF(ScopedEnumBackedByUInt, unsigned short, (sizeof(int) > sizeof(short)));
+ NARROWS(ScopedEnumBackedByLong, unsigned short);
+ NARROWS_IF(ScopedEnumBackedByULong, unsigned short, (sizeof(long) > sizeof(short)));
+ NARROWS(ScopedEnumBackedByLongLong, unsigned short);
+ NARROWS_IF(ScopedEnumBackedByULongLong, unsigned short, (sizeof(long long) > sizeof(short)));
+
+ NARROWS_IF(ScopedEnumBackedByLong, int, (sizeof(long) > sizeof(int)));
+ NARROWS(ScopedEnumBackedByULong, int);
+ NARROWS_IF(ScopedEnumBackedByLongLong, int, (sizeof(long long) > sizeof(int)));
+ NARROWS(ScopedEnumBackedByULongLong, int);
+
+ NARROWS(ScopedEnumBackedByLong, unsigned int);
+ NARROWS_IF(ScopedEnumBackedByULong, unsigned int, (sizeof(long) > sizeof(int)));
+ NARROWS(ScopedEnumBackedByLongLong, unsigned int);
+ NARROWS_IF(ScopedEnumBackedByULongLong, unsigned int, (sizeof(long long) > sizeof(int)));
+
+ NARROWS_IF(ScopedEnumBackedByLongLong, long, (sizeof(long long) > sizeof(long)));
+ NARROWS(ScopedEnumBackedByULongLong, long);
+
+ NARROWS(ScopedEnumBackedByLongLong, unsigned long);
+ NARROWS_IF(ScopedEnumBackedByULongLong, unsigned long, (sizeof(long long) > sizeof(long)));
// different signedness of the underlying type
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<SignedUnscopedEnum, unsigned char>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<SignedUnscopedEnum, unsigned short>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<SignedUnscopedEnum, unsigned int>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<SignedUnscopedEnum, unsigned long>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<SignedUnscopedEnum, unsigned long long>::value));
-
-
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedBySChar, unsigned char>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedBySChar, unsigned short>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedBySChar, unsigned int>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedBySChar, unsigned long>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedBySChar, unsigned long long>::value));
-
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByShort, unsigned char>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByShort, unsigned short>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByShort, unsigned int>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByShort, unsigned long>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByShort, unsigned long long>::value));
-
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByInt, unsigned char>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByInt, unsigned short>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByInt, unsigned int>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByInt, unsigned long>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByInt, unsigned long long>::value));
-
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByLong, unsigned char>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByLong, unsigned short>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByLong, unsigned int>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByLong, unsigned long>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByLong, unsigned long long>::value));
-
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByLongLong, unsigned char>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByLongLong, unsigned short>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByLongLong, unsigned int>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByLongLong, unsigned long>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByLongLong, unsigned long long>::value));
-
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByUChar, signed char>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByUChar, short>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByUChar, int>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByUChar, long>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByUChar, long long>::value));
-
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByUShort, signed char>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByUShort, short>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByUShort, int>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByUShort, long>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByUShort, long long>::value));
-
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByUInt, signed char>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByUInt, short>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByUInt, int>::value));
- QCOMPARE((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByUInt, long>::value), sizeof(ScopedEnumBackedByUInt) >= sizeof(long));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByUInt, long long>::value));
-
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByULong, signed char>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByULong, short>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByULong, int>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByULong, long>::value));
- QCOMPARE((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByULong, long long>::value), sizeof(ScopedEnumBackedByULong) >= sizeof(long long));
-
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByULongLong, signed char>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByULongLong, short>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByULongLong, int>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByULongLong, long>::value));
- QVERIFY((QtPrivate::AreArgumentsNarrowedBase<ScopedEnumBackedByULongLong, long long>::value));
+ NARROWS(SignedUnscopedEnum, unsigned char);
+ NARROWS(SignedUnscopedEnum, unsigned short);
+ NARROWS(SignedUnscopedEnum, unsigned int);
+ NARROWS(SignedUnscopedEnum, unsigned long);
+ NARROWS(SignedUnscopedEnum, unsigned long long);
+
+ NARROWS(ScopedEnumBackedBySChar, unsigned char);
+ NARROWS(ScopedEnumBackedBySChar, unsigned short);
+ NARROWS(ScopedEnumBackedBySChar, unsigned int);
+ NARROWS(ScopedEnumBackedBySChar, unsigned long);
+ NARROWS(ScopedEnumBackedBySChar, unsigned long long);
+
+ NARROWS(ScopedEnumBackedByShort, unsigned char);
+ NARROWS(ScopedEnumBackedByShort, unsigned short);
+ NARROWS(ScopedEnumBackedByShort, unsigned int);
+ NARROWS(ScopedEnumBackedByShort, unsigned long);
+ NARROWS(ScopedEnumBackedByShort, unsigned long long);
+
+ NARROWS(ScopedEnumBackedByInt, unsigned char);
+ NARROWS(ScopedEnumBackedByInt, unsigned short);
+ NARROWS(ScopedEnumBackedByInt, unsigned int);
+ NARROWS(ScopedEnumBackedByInt, unsigned long);
+ NARROWS(ScopedEnumBackedByInt, unsigned long long);
+
+ NARROWS(ScopedEnumBackedByLong, unsigned char);
+ NARROWS(ScopedEnumBackedByLong, unsigned short);
+ NARROWS(ScopedEnumBackedByLong, unsigned int);
+ NARROWS(ScopedEnumBackedByLong, unsigned long);
+ NARROWS(ScopedEnumBackedByLong, unsigned long long);
+
+ NARROWS(ScopedEnumBackedByLongLong, unsigned char);
+ NARROWS(ScopedEnumBackedByLongLong, unsigned short);
+ NARROWS(ScopedEnumBackedByLongLong, unsigned int);
+ NARROWS(ScopedEnumBackedByLongLong, unsigned long);
+ NARROWS(ScopedEnumBackedByLongLong, unsigned long long);
+
+ NARROWS(ScopedEnumBackedByUChar, signed char);
+ FITS_IF(ScopedEnumBackedByUChar, short, (sizeof(char) < sizeof(short)));
+ FITS_IF(ScopedEnumBackedByUChar, int, (sizeof(char) < sizeof(int)));
+ FITS_IF(ScopedEnumBackedByUChar, long, (sizeof(char) < sizeof(long)));
+ FITS_IF(ScopedEnumBackedByUChar, long long, (sizeof(char) < sizeof(long long)));
+
+ NARROWS(ScopedEnumBackedByUShort, signed char);
+ NARROWS(ScopedEnumBackedByUShort, short);
+ FITS_IF(ScopedEnumBackedByUShort, int, (sizeof(short) < sizeof(int)));
+ FITS_IF(ScopedEnumBackedByUShort, long, (sizeof(short) < sizeof(long)));
+ FITS_IF(ScopedEnumBackedByUShort, long long, (sizeof(short) < sizeof(long long)));
+
+ NARROWS(ScopedEnumBackedByUInt, signed char);
+ NARROWS(ScopedEnumBackedByUInt, short);
+ NARROWS(ScopedEnumBackedByUInt, int);
+ FITS_IF(ScopedEnumBackedByUInt, long, (sizeof(ScopedEnumBackedByUInt) < sizeof(long)));
+ FITS(ScopedEnumBackedByUInt, long long);
+
+ NARROWS(ScopedEnumBackedByULong, signed char);
+ NARROWS(ScopedEnumBackedByULong, short);
+ NARROWS(ScopedEnumBackedByULong, int);
+ NARROWS(ScopedEnumBackedByULong, long);
+ FITS_IF(ScopedEnumBackedByULong, long long, (sizeof(ScopedEnumBackedByULong) < sizeof(long long)));
+
+ NARROWS(ScopedEnumBackedByULongLong, signed char);
+ NARROWS(ScopedEnumBackedByULongLong, short);
+ NARROWS(ScopedEnumBackedByULongLong, int);
+ NARROWS(ScopedEnumBackedByULongLong, long);
+ NARROWS(ScopedEnumBackedByULongLong, long long);
// other types which should be always unaffected
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<void *, void *>::value));
+ FITS(void *, void *);
+
+ FITS(QString, QString);
+ FITS(QString &, QString &);
+ FITS(const QString &, const QString &);
+
+ FITS(QObject, QObject);
+ FITS(QObject *, QObject *);
+ FITS(const QObject *, const QObject *);
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<QString, QString>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<QString &, QString &>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<const QString &, const QString &>::value));
+ FITS(std::nullptr_t, std::nullptr_t);
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<QObject, QObject>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<QObject *, QObject *>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<const QObject *, const QObject *>::value));
+ FITS(QString, QObject);
+ FITS(QString, QVariant);
+ FITS(QString, void *);
+ FITS(QString, long long);
+ FITS(bool, const QObject *&);
+ FITS(int (*)(bool), void (QObject::*)());
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<std::nullptr_t, std::nullptr_t>::value));
+#undef IS_UNSCOPED_ENUM_SIGNED
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<QString, QObject>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<QString, QVariant>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<QString, void *>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<QString, long long>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<bool, const QObject *&>::value));
- QVERIFY((!QtPrivate::AreArgumentsNarrowedBase<int (*)(bool), void (QObject::*)()>::value));
+#undef NARROWS_IF
+#undef FITS_IF
+#undef NARROWS
+#undef FITS
}
// Test for QtPrivate::HasQ_OBJECT_Macro
diff --git a/tests/auto/corelib/kernel/qsocketnotifier/tst_qsocketnotifier.cpp b/tests/auto/corelib/kernel/qsocketnotifier/tst_qsocketnotifier.cpp
index a52b80170f..e3f45df27d 100644
--- a/tests/auto/corelib/kernel/qsocketnotifier/tst_qsocketnotifier.cpp
+++ b/tests/auto/corelib/kernel/qsocketnotifier/tst_qsocketnotifier.cpp
@@ -350,6 +350,9 @@ void tst_QSocketNotifier::async_writeDatagramSlot()
void tst_QSocketNotifier::asyncMultipleDatagram()
{
+#ifdef Q_OS_WINRT
+ QSKIP("WinRT does not allow connection to localhost", SkipAll);
+#else
m_asyncSender = new QUdpSocket;
m_asyncReceiver = new QUdpSocket;
@@ -379,6 +382,7 @@ void tst_QSocketNotifier::asyncMultipleDatagram()
delete m_asyncSender;
delete m_asyncReceiver;
+ #endif // !Q_OS_WINRT
}
QTEST_MAIN(tst_QSocketNotifier)
diff --git a/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp b/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp
index 3c2989831e..d2035a088e 100644
--- a/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp
+++ b/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp
@@ -144,12 +144,10 @@ void tst_QTimer::timeout()
QCOMPARE(helper.count, 0);
- QTest::qWait(TIMEOUT_TIMEOUT);
- QVERIFY(helper.count > 0);
+ QTRY_VERIFY_WITH_TIMEOUT(helper.count > 0, TIMEOUT_TIMEOUT);
int oldCount = helper.count;
- QTest::qWait(TIMEOUT_TIMEOUT);
- QVERIFY(helper.count > oldCount);
+ QTRY_VERIFY_WITH_TIMEOUT(helper.count > oldCount, TIMEOUT_TIMEOUT);
}
void tst_QTimer::remainingTime()
diff --git a/tests/auto/corelib/tools/qhash/tst_qhash.cpp b/tests/auto/corelib/tools/qhash/tst_qhash.cpp
index 0c5f1a7afb..943b4316ff 100644
--- a/tests/auto/corelib/tools/qhash/tst_qhash.cpp
+++ b/tests/auto/corelib/tools/qhash/tst_qhash.cpp
@@ -51,7 +51,7 @@ private slots:
void contains(); // copied from tst_QMap
void qhash();
void take(); // copied from tst_QMap
- void operator_eq(); // copied from tst_QMap
+ void operator_eq(); // slightly modified from tst_QMap
void rehash_isnt_quadratic();
void dont_need_default_constructor();
void qmultihash_specific();
@@ -771,7 +771,7 @@ void tst_QHash::take()
QVERIFY(!map.contains(3));
}
-//copied from tst_QMap
+// slightly modified from tst_QMap
void tst_QHash::operator_eq()
{
{
@@ -848,6 +848,71 @@ void tst_QHash::operator_eq()
QVERIFY(a != b);
QVERIFY(!(a == b));
}
+
+ // unlike multi-maps, multi-hashes should be equal iff their contents are equal,
+ // regardless of insertion or iteration order
+
+ {
+ QHash<int, int> a;
+ QHash<int, int> b;
+
+ a.insertMulti(0, 0);
+ a.insertMulti(0, 1);
+
+ b.insertMulti(0, 1);
+ b.insertMulti(0, 0);
+
+ QVERIFY(a == b);
+ QVERIFY(!(a != b));
+ }
+
+ {
+ QHash<int, int> a;
+ QHash<int, int> b;
+
+ enum { Count = 100 };
+
+ for (int key = 0; key < Count; ++key) {
+ for (int value = 0; value < Count; ++value)
+ a.insertMulti(key, value);
+ }
+
+ for (int key = Count - 1; key >= 0; --key) {
+ for (int value = 0; value < Count; ++value)
+ b.insertMulti(key, value);
+ }
+
+ QVERIFY(a == b);
+ QVERIFY(!(a != b));
+ }
+
+ {
+ QHash<int, int> a;
+ QHash<int, int> b;
+
+ enum {
+ Count = 100,
+ KeyStep = 17, // coprime with Count
+ ValueStep = 23, // coprime with Count
+ };
+
+ for (int key = 0; key < Count; ++key) {
+ for (int value = 0; value < Count; ++value)
+ a.insertMulti(key, value);
+ }
+
+ // Generates two permutations of [0, Count) for the keys and values,
+ // so that b will be identical to a, just built in a very different order.
+
+ for (int k = 0; k < Count; ++k) {
+ const int key = (k * KeyStep) % Count;
+ for (int v = 0; v < Count; ++v)
+ b.insertMulti(key, (v * ValueStep) % Count);
+ }
+
+ QVERIFY(a == b);
+ QVERIFY(!(a != b));
+ }
}
void tst_QHash::compare()
diff --git a/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp b/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp
index 7850478602..442d4d089c 100644
--- a/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp
+++ b/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp
@@ -43,6 +43,10 @@
#include <stdlib.h>
#include <time.h>
+#ifdef Q_OS_UNIX
+#include <sys/resource.h>
+#endif
+
QT_BEGIN_NAMESPACE
namespace QtSharedPointer {
Q_CORE_EXPORT void internalSafetyCheckCleanCheck();
@@ -54,6 +58,7 @@ class tst_QSharedPointer: public QObject
Q_OBJECT
private slots:
+ void initTestCase();
void basics_data();
void basics();
void operators();
@@ -118,6 +123,20 @@ public:
}
};
+void tst_QSharedPointer::initTestCase()
+{
+#if defined(Q_OS_UNIX)
+ // The tests create a lot of threads, which require file descriptors. On systems like
+ // OS X low defaults such as 256 as the limit for the number of simultaneously
+ // open files is not sufficient.
+ struct rlimit numFiles;
+ if (getrlimit(RLIMIT_NOFILE, &numFiles) == 0 && numFiles.rlim_cur < 1024) {
+ numFiles.rlim_cur = qMin(rlim_t(1024), numFiles.rlim_max);
+ setrlimit(RLIMIT_NOFILE, &numFiles);
+ }
+#endif
+}
+
template<typename T> static inline
QtSharedPointer::ExternalRefCountData *refCountData(const QSharedPointer<T> &b)
{
diff --git a/tests/auto/dbus/qdbusabstractadaptor/myobject.h b/tests/auto/dbus/qdbusabstractadaptor/myobject.h
index 1d9b33ccd8..fe3f6f3dd2 100644
--- a/tests/auto/dbus/qdbusabstractadaptor/myobject.h
+++ b/tests/auto/dbus/qdbusabstractadaptor/myobject.h
@@ -242,10 +242,13 @@ public:
{
case 4:
if4 = new Interface4(this);
+ Q_FALLTHROUGH();
case 3:
if3 = new Interface3(this);
+ Q_FALLTHROUGH();
case 2:
if2 = new Interface2(this);
+ Q_FALLTHROUGH();
case 1:
if1 = new Interface1(this);
}
@@ -270,4 +273,4 @@ signals:
void nonScriptableSignalVoid();
};
-#endif // MYOBJECT_H \ No newline at end of file
+#endif // MYOBJECT_H
diff --git a/tests/auto/dbus/qdbusmarshall/common.h b/tests/auto/dbus/qdbusmarshall/common.h
index f37ba47508..44346cd6f2 100644
--- a/tests/auto/dbus/qdbusmarshall/common.h
+++ b/tests/auto/dbus/qdbusmarshall/common.h
@@ -437,7 +437,7 @@ bool compareToArgument(const QDBusArgument &arg, const QVariant &v2)
case QVariant::DateTime:
return compare<QDateTime>(arg, v2);
default:
- register int id = v2.userType();
+ int id = v2.userType();
if (id == qMetaTypeId<QDBusObjectPath>())
return compare<QDBusObjectPath>(arg, v2);
else if (id == qMetaTypeId<QDBusSignature>())
diff --git a/tests/auto/gui/kernel/qinputmethod/tst_qinputmethod.cpp b/tests/auto/gui/kernel/qinputmethod/tst_qinputmethod.cpp
index d024538ee0..509f8bd45f 100644
--- a/tests/auto/gui/kernel/qinputmethod/tst_qinputmethod.cpp
+++ b/tests/auto/gui/kernel/qinputmethod/tst_qinputmethod.cpp
@@ -287,6 +287,11 @@ void tst_qinputmethod::inputMethodAccepted()
if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive))
QSKIP("Wayland: This fails. Figure out why.");
+ if (!QGuiApplication::platformName().compare(QLatin1String("minimal"), Qt::CaseInsensitive)
+ || !QGuiApplication::platformName().compare(QLatin1String("offscreen"), Qt::CaseInsensitive)) {
+ QSKIP("minimal/offscreen: This fails. Figure out why.");
+ }
+
if (!QGuiApplication::platformName().compare(QLatin1String("xcb"), Qt::CaseInsensitive))
QSKIP("XCB: depends on dedicated platform context.");
diff --git a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
index 0196c7d72c..4cccf08086 100644
--- a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
+++ b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
@@ -1829,6 +1829,12 @@ void tst_QWindow::initialSize()
}
}
+static bool isPlatformOffscreenOrMinimal()
+{
+ return ((QGuiApplication::platformName() == QLatin1String("offscreen"))
+ || (QGuiApplication::platformName() == QLatin1String("minimal")));
+}
+
void tst_QWindow::modalDialog()
{
if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive))
@@ -1853,8 +1859,7 @@ void tst_QWindow::modalDialog()
QGuiApplication::sync();
QGuiApplication::processEvents();
- if (!QGuiApplication::platformName().compare(QLatin1String("offscreen"), Qt::CaseInsensitive)
- || !QGuiApplication::platformName().compare(QLatin1String("minimal"), Qt::CaseInsensitive)) {
+ if (isPlatformOffscreenOrMinimal()) {
QWARN("Focus stays in normalWindow on offscreen/minimal platforms");
QTRY_COMPARE(QGuiApplication::focusWindow(), &normalWindow);
return;
@@ -1899,8 +1904,7 @@ void tst_QWindow::modalDialogClosingOneOfTwoModal()
QGuiApplication::sync();
QGuiApplication::processEvents();
- if (!QGuiApplication::platformName().compare(QLatin1String("offscreen"), Qt::CaseInsensitive)
- || !QGuiApplication::platformName().compare(QLatin1String("minimal"), Qt::CaseInsensitive)) {
+ if (isPlatformOffscreenOrMinimal()) {
QWARN("Focus is lost when closing modal dialog on offscreen/minimal platforms");
QTRY_COMPARE(QGuiApplication::focusWindow(), nullptr);
return;
@@ -1994,6 +1998,9 @@ void tst_QWindow::modalWindowEnterEventOnHide_QTBUG35109()
if (QGuiApplication::platformName() == QLatin1String("cocoa"))
QSKIP("This test fails on OS X on CI");
+ if (isPlatformOffscreenOrMinimal())
+ QSKIP("Can't test window focusing on offscreen/minimal");
+
const QPoint center = QGuiApplication::primaryScreen()->availableGeometry().center();
const int childOffset = 16;
diff --git a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp
index 3562bc63f4..8db4489ec1 100644
--- a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp
+++ b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp
@@ -3004,6 +3004,10 @@ void fpe_steepSlopes()
void fpe_radialGradients()
{
+#if defined(Q_PROCESSOR_ARM)
+ QEXPECT_FAIL("", "Test fails for ARM (QTBUG-59961)", Continue);
+#endif
+
FpExceptionChecker checker(FE_UNDERFLOW | FE_OVERFLOW | FE_INVALID | FE_DIVBYZERO);
QImage img(21, 21, QImage::Format_ARGB32_Premultiplied);
diff --git a/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp b/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp
index 98f63984b3..757e4d16e4 100644
--- a/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp
+++ b/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp
@@ -99,6 +99,9 @@ private slots:
void translate();
void lineWithinBounds();
+
+ void intersectionEquality();
+ void intersectionPointOnEdge();
};
void tst_QPainterPath::cleanupTestCase()
@@ -1313,6 +1316,64 @@ void tst_QPainterPath::lineWithinBounds()
}
}
+void tst_QPainterPath::intersectionEquality()
+{
+ // Test case from QTBUG-17027
+ QPainterPath p1;
+ p1.moveTo(256.0000000000000000, 135.8384137532701743);
+ p1.lineTo(50.9999999999999715, 107.9999999999999857);
+ p1.lineTo(233.5425474228109123, 205.3560252921671462);
+ p1.lineTo(191.7771366877784373, 318.0257074407572304);
+ p1.lineTo(-48.2616272048215151, 229.0459803737862216);
+ p1.lineTo(0.0000000000000000, 98.8515898136580801);
+ p1.lineTo(0.0000000000000000, 0.0000000000000000);
+ p1.lineTo(256.0000000000000000, 0.0000000000000000);
+ p1.lineTo(256.0000000000000000, 135.8384137532701743);
+
+ QPainterPath p2;
+ p2.moveTo(1516.2703263523442274, 306.9795200262722119);
+ p2.lineTo(-1296.8426224886295585, -75.0331736542986931);
+ p2.lineTo(-1678.8553161692004778, 2738.0797751866753060);
+ p2.lineTo(1134.2576326717733081, 3120.0924688672457705);
+ p2.lineTo(1516.2703263523442274, 306.9795200262722119);
+
+ QPainterPath i1 = p1.intersected(p2);
+ QPainterPath i2 = p2.intersected(p1);
+ QVERIFY(i1 == i2 || i1.toReversed() == i2);
+
+ p1 = QPainterPath();
+ p1.moveTo(256.00000000, 135.83841375);
+ p1.lineTo(50.99999999, 107.99999999);
+ p1.lineTo(233.54254742, 205.35602529);
+ p1.lineTo(191.77713668, 318.02570744);
+ p1.lineTo(-48.26162720, 229.04598037);
+ p1.lineTo(0.00000000, 98.85158981);
+ p1.lineTo(0.00000000, 0.00000000);
+ p1.lineTo(256.00000000, 0.00000000);
+ p1.lineTo(256.00000000, 135.83841375);
+
+ p2 = QPainterPath();
+ p2.moveTo(1516.27032635, 306.97952002);
+ p2.lineTo(-1296.84262248, -75.03317365);
+ p2.lineTo(-1678.85531616, 2738.07977518);
+ p2.lineTo(1134.25763267, 3120.09246886);
+ p2.lineTo(1516.27032635, 306.97952002);
+
+ i1 = p1.intersected(p2);
+ i2 = p2.intersected(p1);
+ QVERIFY(i1 == i2 || i1.toReversed() == i2);
+}
+
+void tst_QPainterPath::intersectionPointOnEdge()
+{
+ // From QTBUG-31551
+ QPainterPath p; p.addRoundedRect(-10, 10, 40, 40, 10, 10);
+ QRectF r(0, 0, 100, 100);
+ QPainterPath rp; rp.addRect(r);
+ QVERIFY(!p.intersected(rp).isEmpty());
+ QVERIFY(p.intersects(rp));
+ QVERIFY(p.intersects(r));
+}
QTEST_APPLESS_MAIN(tst_QPainterPath)
diff --git a/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp b/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp
index 9a604e5d04..b476fdd334 100644
--- a/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp
+++ b/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp
@@ -1553,9 +1553,17 @@ void tst_QUdpSocket::linkLocalIPv6()
//Windows preallocates link local addresses to interfaces that are down.
//These may or may not work depending on network driver
if (iface.flags() & QNetworkInterface::IsUp) {
+#if defined(Q_OS_WIN)
// Do not add the Teredo Tunneling Pseudo Interface on Windows.
if (iface.humanReadableName().contains("Teredo"))
continue;
+#elif defined(Q_OS_DARWIN)
+ // Do not add "utun" interfaces on macOS: nothing ever gets received
+ // (we don't know why)
+ if (iface.name().startsWith("utun"))
+ continue;
+#endif
+
foreach (QNetworkAddressEntry addressEntry, iface.addressEntries()) {
QHostAddress addr(addressEntry.ip());
if (!addr.scopeId().isEmpty() && addr.isInSubnet(localMask, 64)) {
diff --git a/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac.cpp b/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac.cpp
index efa724b730..13c933aa14 100644
--- a/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac.cpp
+++ b/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac.cpp
@@ -94,9 +94,6 @@ void tst_QAccessibilityMac::cleanup()
void tst_QAccessibilityMac::singleWidgetTest()
{
- if (!macNativeAccessibilityEnabled())
- return;
-
delete m_window;
m_window = 0;
@@ -105,9 +102,6 @@ void tst_QAccessibilityMac::singleWidgetTest()
void tst_QAccessibilityMac::lineEditTest()
{
- if (!macNativeAccessibilityEnabled())
- return;
-
QLineEdit *lineEdit = new QLineEdit(m_window);
lineEdit->setText("a11y test QLineEdit");
m_window->addWidget(lineEdit);
@@ -119,9 +113,6 @@ void tst_QAccessibilityMac::lineEditTest()
void tst_QAccessibilityMac::hierarchyTest()
{
- if (!macNativeAccessibilityEnabled())
- return;
-
QWidget *w = new QWidget(m_window);
m_window->addWidget(w);
@@ -141,17 +132,11 @@ void tst_QAccessibilityMac::hierarchyTest()
void tst_QAccessibilityMac::notificationsTest()
{
- if (!macNativeAccessibilityEnabled())
- return;
-
QVERIFY(notifications(m_window));
}
void tst_QAccessibilityMac::checkBoxTest()
{
- if (!macNativeAccessibilityEnabled())
- return;
-
QCheckBox *cb = new QCheckBox(m_window);
cb->setText("Great option");
m_window->addWidget(cb);
diff --git a/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.h b/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.h
index 5f10513bb5..75b2d39a00 100644
--- a/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.h
+++ b/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.h
@@ -33,8 +33,6 @@
QT_USE_NAMESPACE
-bool macNativeAccessibilityEnabled();
-bool trusted();
bool testLineEdit();
bool testHierarchy(QWidget *w);
bool singleWidget();
diff --git a/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm b/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm
index fb030aa4be..e9407fd903 100644
--- a/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm
+++ b/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm
@@ -42,19 +42,6 @@
QT_USE_NAMESPACE
-bool macNativeAccessibilityEnabled()
-{
- bool enabled = AXAPIEnabled();
- if (!enabled)
- qWarning() << "Accessibility is disabled (check System Preferences) skipping test.";
- return enabled;
-}
-
-bool trusted()
-{
- return AXIsProcessTrusted();
-}
-
struct AXErrorTag {
AXError err;
explicit AXErrorTag(AXError theErr) : err(theErr) {}
@@ -413,12 +400,6 @@ bool singleWidget()
bool testLineEdit()
{
-// not sure if this is needed. on my machine the calls succeed.
-// NSString *path = @"/Users/frederik/qt5/qtbase/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac.app/Contents/MacOS/tst_qaccessibilitymac";
-// NSString *path = @"/Users/frederik/qt5/qtbase/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac.app";
-// AXError e = AXMakeProcessTrusted((CFStringRef) path);
-// NSLog(@"error: %i", e);
-
TestAXObject *appObject = [TestAXObject getApplicationAXObject];
EXPECT(appObject);
diff --git a/tests/auto/printsupport/dialogs/qabstractprintdialog/tst_qabstractprintdialog.cpp b/tests/auto/printsupport/dialogs/qabstractprintdialog/tst_qabstractprintdialog.cpp
index 79c910cb5b..bb3624a51d 100644
--- a/tests/auto/printsupport/dialogs/qabstractprintdialog/tst_qabstractprintdialog.cpp
+++ b/tests/auto/printsupport/dialogs/qabstractprintdialog/tst_qabstractprintdialog.cpp
@@ -31,14 +31,17 @@
#include <qcoreapplication.h>
#include <qdebug.h>
+#include <QtPrintSupport/qtprintsupportglobal.h>
+#if QT_CONFIG(printdialog)
#include <qabstractprintdialog.h>
#include <qprinter.h>
+#endif
class tst_QAbstractPrintDialog : public QObject
{
Q_OBJECT
-#if defined(QT_NO_PRINTER) || defined(QT_NO_PRINTDIALOG)
+#if !QT_CONFIG(printdialog)
public slots:
void initTestCase();
#else
@@ -49,7 +52,7 @@ private slots:
#endif
};
-#if defined(QT_NO_PRINTER) || defined(QT_NO_PRINTDIALOG)
+#if !QT_CONFIG(printdialog)
void tst_QAbstractPrintDialog::initTestCase()
{
QSKIP("This test requires printing and print dialog support");
diff --git a/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp b/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp
index 44cb5a5bf8..05410f4a0f 100644
--- a/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp
+++ b/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp
@@ -144,6 +144,7 @@ private slots:
#endif
void rejectModalDialogs();
void QTBUG49600_nativeIconProviderCrash();
+ void focusObjectDuringDestruction();
// NOTE: Please keep widgetlessNativeDialog() as the LAST test!
//
@@ -1463,18 +1464,15 @@ class DialogRejecter : public QObject
public:
DialogRejecter()
{
- QTimer *timer = new QTimer(this);
- timer->setInterval(1000);
- connect(timer, &QTimer::timeout, this, &DialogRejecter::rejectFileDialog);
- timer->start();
+ connect(qApp, &QApplication::focusChanged, this, &DialogRejecter::rejectFileDialog);
}
public slots:
- void rejectFileDialog()
+ virtual void rejectFileDialog()
{
if (QWidget *w = QApplication::activeModalWidget())
if (QDialog *d = qobject_cast<QDialog *>(w))
- d->reject();
+ QTest::keyClick(d, Qt::Key_Escape);
}
};
@@ -1514,5 +1512,36 @@ void tst_QFiledialog::QTBUG49600_nativeIconProviderCrash()
fd.iconProvider();
}
+class qtbug57193DialogRejecter : public DialogRejecter
+{
+public:
+ void rejectFileDialog() override
+ {
+ QCOMPARE(QGuiApplication::topLevelWindows().size(), 1);
+ const QWindow *window = QGuiApplication::topLevelWindows().constFirst();
+
+ const QFileDialog *fileDialog = qobject_cast<QFileDialog*>(QApplication::activeModalWidget());
+ QVERIFY(fileDialog);
+
+ // The problem in QTBUG-57193 was from a platform input context plugin that was
+ // connected to QWindow::focusObjectChanged(), and consequently accessed the focus
+ // object (the QFileDialog) that was in the process of being destroyed. This test
+ // checks that the QFileDialog is never set as the focus object after its destruction process begins.
+ connect(window, &QWindow::focusObjectChanged, [=](QObject *focusObject) {
+ QVERIFY(focusObject != fileDialog);
+ });
+ DialogRejecter::rejectFileDialog();
+ }
+};
+
+void tst_QFiledialog::focusObjectDuringDestruction()
+{
+ QTRY_VERIFY(QGuiApplication::topLevelWindows().isEmpty());
+
+ qtbug57193DialogRejecter dialogRejecter;
+
+ QFileDialog::getOpenFileName(nullptr, QString(), QString(), QString(), nullptr);
+}
+
QTEST_MAIN(tst_QFiledialog)
#include "tst_qfiledialog.moc"
diff --git a/tests/auto/widgets/effects/qgraphicseffect/tst_qgraphicseffect.cpp b/tests/auto/widgets/effects/qgraphicseffect/tst_qgraphicseffect.cpp
index a1cb729849..4d289dcb02 100644
--- a/tests/auto/widgets/effects/qgraphicseffect/tst_qgraphicseffect.cpp
+++ b/tests/auto/widgets/effects/qgraphicseffect/tst_qgraphicseffect.cpp
@@ -52,6 +52,7 @@ private slots:
void boundingRect2();
void draw();
void opacity();
+ void nestedOpaqueOpacity();
void grayscale();
void colorize();
void drawPixmapItem();
@@ -407,6 +408,26 @@ void tst_QGraphicsEffect::opacity()
QCOMPARE(effect->m_opacity, qreal(0.5));
}
+void tst_QGraphicsEffect::nestedOpaqueOpacity()
+{
+ // QTBUG-60231: Nesting widgets with a QGraphicsEffect on a toplevel with
+ // QGraphicsOpacityEffect caused crashes due to constructing several
+ // QPainter instances on a device in the fast path for
+ // QGraphicsOpacityEffect::opacity=1
+ QWidget topLevel;
+ topLevel.setWindowTitle(QTest::currentTestFunction());
+ topLevel.resize(QApplication::desktop()->screenGeometry(&topLevel).size() / 8);
+ QGraphicsOpacityEffect *opacityEffect = new QGraphicsOpacityEffect;
+ opacityEffect->setOpacity(1);
+ topLevel.setGraphicsEffect(opacityEffect);
+ QWidget *child = new QWidget(&topLevel);
+ child->resize(topLevel.size() / 2);
+ QGraphicsDropShadowEffect *childEffect = new QGraphicsDropShadowEffect;
+ child->setGraphicsEffect(childEffect);
+ topLevel.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&topLevel));
+}
+
void tst_QGraphicsEffect::grayscale()
{
if (qApp->desktop()->depth() < 24)
diff --git a/tests/auto/widgets/graphicsview/qgraphicsscene/BLACKLIST b/tests/auto/widgets/graphicsview/qgraphicsscene/BLACKLIST
new file mode 100644
index 0000000000..c6f69a51a5
--- /dev/null
+++ b/tests/auto/widgets/graphicsview/qgraphicsscene/BLACKLIST
@@ -0,0 +1,3 @@
+[removeItem]
+# QTBUG-60754, QTest::mouseMove is not always respected, or the CI moves the cursor
+osx-10.11 ci
diff --git a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
index 76b25cdb52..1a96180c05 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
@@ -4804,8 +4804,12 @@ public:
void tst_QGraphicsView::hoverLeave()
{
- if (platformName == QStringLiteral("cocoa"))
+ if (platformName == QStringLiteral("cocoa")) {
QSKIP("Insignificant on OSX");
+ } else if (platformName == QStringLiteral("minimal")
+ || (platformName == QStringLiteral("offscreen"))) {
+ QSKIP("Fails in minimal/offscreen platforms if forwardMouseDoubleClick has been run");
+ }
const QRect availableGeometry = QGuiApplication::primaryScreen()->availableGeometry();
QGraphicsScene scene;
QGraphicsView view(&scene);
diff --git a/tests/auto/widgets/kernel/qapplication/BLACKLIST b/tests/auto/widgets/kernel/qapplication/BLACKLIST
index 6abb1d9988..f4a9cb6166 100644
--- a/tests/auto/widgets/kernel/qapplication/BLACKLIST
+++ b/tests/auto/widgets/kernel/qapplication/BLACKLIST
@@ -1,4 +1,2 @@
[quitOnLastWindowClosed]
osx-10.10
-[touchEventPropagation]
-xcb
diff --git a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp
index 49095b9625..b98cc048c8 100644
--- a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp
+++ b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp
@@ -1987,7 +1987,7 @@ void tst_QApplication::touchEventPropagation()
window.show();
QVERIFY(QTest::qWaitForWindowExposed(&window));
const QPoint deviceGlobalPos =
- QHighDpi::toNativePixels(window.mapToGlobal(QPoint(50, 50)), window.windowHandle()->screen());
+ QHighDpi::toNativePixels(window.mapToGlobal(QPoint(50, 150)), window.windowHandle()->screen());
pressedTouchPoints[0].setScreenPos(deviceGlobalPos);
releasedTouchPoints[0].setScreenPos(deviceGlobalPos);
diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
index e68f0f57ef..0933dc991d 100644
--- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
+++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
@@ -8526,8 +8526,8 @@ void tst_QWidget::translucentWidget()
else
#endif
widgetSnapshot = label.grab(QRect(QPoint(0, 0), label.size()));
- QImage actual = widgetSnapshot.toImage().convertToFormat(QImage::Format_RGB32);
- QImage expected = pm.toImage().convertToFormat(QImage::Format_RGB32);
+ const QImage actual = widgetSnapshot.toImage().convertToFormat(QImage::Format_RGB32);
+ const QImage expected = pm.toImage().scaled(label.devicePixelRatioF() * pm.size());
QCOMPARE(actual.size(),expected.size());
QCOMPARE(actual,expected);
}
diff --git a/tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp b/tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp
index 4d57b85f9a..9a0ca0565e 100644
--- a/tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp
+++ b/tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp
@@ -824,6 +824,12 @@ void tst_QMenuBar::check_escKey()
if (!QApplication::style()->inherits("QWindowsStyle"))
return;
+ if (!QGuiApplication::platformName().compare(QLatin1String("minimal"), Qt::CaseInsensitive)
+ || !QGuiApplication::platformName().compare(QLatin1String("offscreen"), Qt::CaseInsensitive)) {
+ QWARN("Skipping menu button test on minimal/offscreen platforms");
+ return;
+ }
+
// If we press Down the popupmenu should be active again
QTest::keyClick(static_cast<QWidget *>(0), Qt::Key_Down );
QVERIFY( !menu.menus.at(0)->isActiveWindow() );
@@ -1196,6 +1202,11 @@ void tst_QMenuBar::task223138_triggered()
void tst_QMenuBar::task256322_highlight()
{
+ if (!QGuiApplication::platformName().compare(QLatin1String("minimal"), Qt::CaseInsensitive)
+ || !QGuiApplication::platformName().compare(QLatin1String("offscreen"), Qt::CaseInsensitive)) {
+ QSKIP("Highlighting does not work correctly for minimal/offscreen platforms");
+ }
+
QMainWindow win;
win.menuBar()->setNativeMenuBar(false); //we can't check the geometry of native menubars
QMenu menu;
diff --git a/util/includemocs/includemocs.pl b/util/includemocs/includemocs.pl
new file mode 100755
index 0000000000..ce04d961d8
--- /dev/null
+++ b/util/includemocs/includemocs.pl
@@ -0,0 +1,138 @@
+#!/usr/bin/perl
+#############################################################################
+##
+## Copyright (C) 2017 Intel Corporation.
+## Contact: https://www.qt.io/licensing/
+##
+## This file is the build configuration utility of the Qt Toolkit.
+##
+## $QT_BEGIN_LICENSE:GPL-EXCEPT$
+## 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 General Public License Usage
+## Alternatively, this file may be used under the terms of the GNU
+## General Public License version 3 as published by the Free Software
+## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+## included in the packaging of this file. Please review the following
+## information to ensure the GNU General Public License requirements will
+## be met: https://www.gnu.org/licenses/gpl-3.0.html.
+##
+## $QT_END_LICENSE$
+##
+#############################################################################
+use strict;
+
+MAKEFILE: while ($_ = shift @ARGV) {
+ chdir($ENV{PWD});
+ open MAKEFILE, "<", $_
+ or die("Could not open Makefile");
+ print "includemocs.pl: Processing $_\n";
+
+ my $srcdir;
+ my $sourcesline;
+
+ # Find "SOURCES =" line
+ while (<MAKEFILE>) {
+ $srcdir = $1 if m,^# Project:\s+(.*)/[^/]+.pro,;
+ if (/^# Template:\s+(\w+)/) {
+ next MAKEFILE if $1 eq "subdirs";
+ }
+ if (/^SOURCES\s*=\s*(.*)/) {
+ $sourcesline = $1;
+ last;
+ }
+ }
+ if ($sourcesline =~ s/\s+\\//) {
+ # continuation
+ while (<MAKEFILE>) {
+ chomp;
+ /^\s*([^ ]+)/;
+ $sourcesline .= " $1";
+ last unless m/\\$/;
+ }
+ }
+ close MAKEFILE;
+
+ # Now parse the sources
+ my @mocs;
+ my @sources;
+ for (split(/ /, $sourcesline)) {
+ if (/\.moc\/(moc_.*\.cpp)/) {
+ push @mocs, $1;
+ } elsif (/^\.(rcc|uic)/) {
+ # ignore
+ } else {
+ push @sources, $_;
+ }
+ }
+
+ chdir($srcdir) or die("Where's $srcdir? $!");
+ for my $moc (@mocs) {
+ my $include = "#include \"$moc\"\n";
+
+ # Find a corresponding .cpp file to host the new #include
+ my $basename = ($moc =~ s/^moc_//r);
+ $basename =~ s/\.[^.]+//;
+ my @candidates = grep { m,\Q/$basename.\E, } @sources;
+
+ if (scalar @candidates == 0) {
+ # Try without a _p suffix
+ $basename =~ s/_p$//;
+ @candidates = grep { m,\Q/$basename.\E, } @sources;
+ }
+ if (scalar @candidates == 0) {
+ print STDERR "includemocs.pl: Cannot find .cpp file for $moc\n";
+ next;
+ }
+
+ my $cpp = $candidates[0];
+ undef @candidates;
+
+ #print "$moc -> $cpp\n";
+ open CPP, "<", $cpp
+ or die("Cannot open source $cpp: $!");
+
+ my @lines;
+ while (<CPP>) {
+ push @lines, $_;
+ next unless defined($include);
+
+ # Print the new include next to a pre-existing moc include
+ if (/#include \"moc_/ || /#include ".*\.moc"/) {
+ push @lines, $include;
+ undef $include;
+ }
+ }
+ close CPP;
+
+ if (defined($include)) {
+ # Try to insert the new #include between QT_END_NAMESPACE and any #endif lines
+ my $n = 0;
+ my $extrablank = "";
+ while (defined($include)) {
+ --$n;
+ $_ = $lines[$n];
+ if (/^#endif/) {
+ $extrablank = "\n";
+ next;
+ }
+
+ $_ .= "\n" unless /^$/;
+ splice @lines, $n, 1, ($_, $include, $extrablank);
+ undef $include;
+ }
+ }
+
+ # Write the file again
+ open CPP, ">", $cpp
+ or die("Cannot open source $cpp for writing: $!");
+ map { print CPP $_; } @lines;
+ close CPP;
+ }
+}