summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config.tests/common/c++1z/c++1z.cpp2
-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.pri6
-rw-r--r--examples/touch/fingerpaint/scribblearea.cpp9
-rw-r--r--examples/widgets/dialogs/licensewizard/licensewizard.cpp7
-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/imageviewer/imageviewer.cpp7
-rw-r--r--examples/widgets/widgets/scribble/scribblearea.cpp9
-rw-r--r--mkspecs/common/android-base-tail.conf4
-rw-r--r--mkspecs/common/ghs-integrity-armv8.conf27
-rw-r--r--mkspecs/common/msvc-version.conf4
-rw-r--r--mkspecs/common/qcc-base-qnx.conf6
-rw-r--r--mkspecs/devices/common/freebsd_device_pre.conf2
-rw-r--r--mkspecs/devices/common/linux_device_post.conf5
-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/devices/linux-arm-hisilicon-hix5hd2-g++/qmake.conf4
-rw-r--r--mkspecs/devices/linux-arm-trident-pnx8473-g++/qmake.conf6
-rw-r--r--mkspecs/devices/linux-drive-cx-g++/qmake.conf14
-rw-r--r--mkspecs/devices/linux-jetson-tk1-g++/qmake.conf12
-rw-r--r--mkspecs/devices/linux-jetson-tk1-pro-g++/qmake.conf14
-rw-r--r--mkspecs/devices/linux-jetson-tx1-g++/qmake.conf14
-rw-r--r--mkspecs/devices/linux-mipsel-broadcom-97425-g++/qmake.conf7
-rw-r--r--mkspecs/devices/linux-rasp-pi-g++/qmake.conf2
-rw-r--r--mkspecs/devices/linux-rasp-pi2-g++/qmake.conf2
-rw-r--r--mkspecs/devices/linux-rasp-pi3-g++/qmake.conf5
-rw-r--r--mkspecs/devices/linux-snowball-g++/qmake.conf5
-rw-r--r--mkspecs/devices/linux-tegra2-g++/qmake.conf11
-rw-r--r--mkspecs/features/configure_base.prf4
-rw-r--r--mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in2
-rw-r--r--mkspecs/features/default_post.prf11
-rw-r--r--mkspecs/features/qt_configure.prf3
-rw-r--r--mkspecs/freebsd-clang/qmake.conf4
-rw-r--r--mkspecs/freebsd-g++/qmake.conf4
-rw-r--r--mkspecs/netbsd-g++/qmake.conf4
-rw-r--r--mkspecs/openbsd-g++/qmake.conf4
-rw-r--r--qmake/generators/unix/unixmake.cpp4
-rw-r--r--qmake/generators/win32/winmakefile.cpp3
-rw-r--r--src/corelib/global/qcompilerdetection.h5
-rw-r--r--src/corelib/global/qglobal.cpp41
-rw-r--r--src/corelib/global/qglobal.h7
-rw-r--r--src/corelib/global/qprocessordetection.h9
-rw-r--r--src/corelib/io/qstorageinfo_unix.cpp6
-rw-r--r--src/corelib/itemmodels/qabstractitemmodel.cpp2
-rw-r--r--src/corelib/kernel/qobject_p.h1
-rw-r--r--src/corelib/kernel/qvariant.cpp2
-rw-r--r--src/corelib/tools/qarraydataops.h6
-rw-r--r--src/corelib/tools/qbytearray.cpp22
-rw-r--r--src/corelib/tools/qstring.cpp55
-rw-r--r--src/gui/configure.json24
-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/painting/qdrawhelper.cpp2
-rw-r--r--src/network/socket/qnativesocketengine_winrt.cpp37
-rw-r--r--src/network/socket/qnativesocketengine_winrt_p.h3
-rw-r--r--src/network/ssl/qsslcertificate.cpp5
-rw-r--r--src/network/ssl/qsslsocket_mac.cpp27
-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/winrt/qwinrtfontdatabase.cpp28
-rw-r--r--src/platformsupport/fontdatabases/winrt/qwinrtfontdatabase_p.h2
-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/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/windows/qwindowskeymapper.cpp3
-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/sql/configure.pri3
-rw-r--r--src/widgets/accessible/simplewidgets.cpp6
-rw-r--r--src/widgets/itemviews/qheaderview.cpp8
-rw-r--r--src/widgets/itemviews/qlistview.cpp11
-rw-r--r--src/widgets/itemviews/qlistwidget.cpp11
-rw-r--r--src/widgets/itemviews/qtableview.cpp17
-rw-r--r--src/widgets/itemviews/qtablewidget.cpp11
-rw-r--r--src/widgets/itemviews/qtreeview.cpp11
-rw-r--r--src/widgets/itemviews/qtreewidget.cpp11
-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/qcheckbox.cpp14
-rw-r--r--src/widgets/widgets/qcombobox.cpp4
-rw-r--r--src/widgets/widgets/qdatetimeedit.cpp33
-rw-r--r--src/widgets/widgets/qdial.cpp12
-rw-r--r--src/widgets/widgets/qgroupbox.cpp11
-rw-r--r--src/widgets/widgets/qlabel.cpp30
-rw-r--r--src/widgets/widgets/qlabel.h6
-rw-r--r--src/widgets/widgets/qlabel_p.h6
-rw-r--r--src/widgets/widgets/qlcdnumber.cpp17
-rw-r--r--src/widgets/widgets/qlcdnumber.h5
-rw-r--r--src/widgets/widgets/qlineedit.cpp12
-rw-r--r--src/widgets/widgets/qmenu.cpp10
-rw-r--r--src/widgets/widgets/qprogressbar.cpp11
-rw-r--r--src/widgets/widgets/qpushbutton.cpp21
-rw-r--r--src/widgets/widgets/qradiobutton.cpp11
-rw-r--r--src/widgets/widgets/qscrollbar.cpp9
-rw-r--r--src/widgets/widgets/qslider.cpp11
-rw-r--r--src/widgets/widgets/qspinbox.cpp11
-rw-r--r--src/widgets/widgets/qsplashscreen.cpp4
-rw-r--r--src/widgets/widgets/qsplashscreen.h6
-rw-r--r--src/widgets/widgets/qtabwidget.cpp11
-rw-r--r--src/widgets/widgets/widgets.pri19
-rw-r--r--tests/auto/corelib/global/qgetputenv/tst_qgetputenv.cpp26
-rw-r--r--tests/auto/corelib/global/qlogging/tst_qlogging.cpp2
-rw-r--r--tests/auto/corelib/io/qfile/tst_qfile.cpp2
-rw-r--r--tests/auto/corelib/itemmodels/qabstractitemmodel/tst_qabstractitemmodel.cpp22
-rw-r--r--tests/auto/corelib/itemmodels/qstringlistmodel/tst_qstringlistmodel.cpp9
-rw-r--r--tests/auto/corelib/kernel/qtimer/BLACKLIST2
-rw-r--r--tests/auto/corelib/thread/qsemaphore/BLACKLIST1
-rw-r--r--tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp19
-rw-r--r--tests/auto/gui/itemmodels/qstandarditemmodel/tst_qstandarditemmodel.cpp8
-rw-r--r--tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp6
-rw-r--r--tests/auto/gui/text/qfont/tst_qfont.cpp2
-rw-r--r--tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp8
-rw-r--r--tests/auto/other/lancelot/lancelot.pro2
-rw-r--r--tests/auto/other/lancelot/paintcommands.cpp9
-rw-r--r--tests/auto/other/lancelot/paintcommands.h5
-rw-r--r--tests/auto/other/lancelot/scripts/porter_duff.qps12
-rw-r--r--tests/auto/other/lancelot/scripts/porter_duff2.qps12
-rw-r--r--tests/auto/other/lancelot/tst_lancelot.cpp10
-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/itemviews/qheaderview/tst_qheaderview.cpp50
-rw-r--r--tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp4
171 files changed, 1391 insertions, 658 deletions
diff --git a/config.tests/common/c++1z/c++1z.cpp b/config.tests/common/c++1z/c++1z.cpp
index a30196f57d..63c6fb5b8a 100644
--- a/config.tests/common/c++1z/c++1z.cpp
+++ b/config.tests/common/c++1z/c++1z.cpp
@@ -43,4 +43,6 @@
# error "__cplusplus must be > 201402L (the value for C++14)"
#endif
+#include <map> // https://bugs.llvm.org//show_bug.cgi?id=33117
+
int main(int, char **) { return 0; }
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.pri b/configure.pri
index be1b166080..673252dc51 100644
--- a/configure.pri
+++ b/configure.pri
@@ -137,7 +137,7 @@ defineReplace(qtConfFunc_licenseCheck) {
export(config.input.qt_edition)
} else {
equals(QMAKE_HOST.os, Linux) {
- equals(QMAKE_HOST.arch, x86): \
+ !equals(QMAKE_HOST.arch, x86_64): \
Licheck = licheck32
else: \
Licheck = licheck64
@@ -150,10 +150,10 @@ defineReplace(qtConfFunc_licenseCheck) {
}
!qtRunLoggedCommand("$$system_quote($$QT_SOURCE_TREE/bin/$$Licheck) \
- $$eval(config.input.confirm-license) \
+ $$system_quote($$eval(config.input.confirm-license)) \
$$system_quote($$QT_SOURCE_TREE) $$system_quote($$QT_BUILD_TREE) \
$$[QMAKE_SPEC] $$[QMAKE_XSPEC]", \
- LicheckOutput): \
+ LicheckOutput, false): \
return(false)
logn()
for (o, LicheckOutput) {
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/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/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/android-base-tail.conf b/mkspecs/common/android-base-tail.conf
index 23bd6696de..2610918c4e 100644
--- a/mkspecs/common/android-base-tail.conf
+++ b/mkspecs/common/android-base-tail.conf
@@ -74,8 +74,8 @@ else: \
LIBGCC_PATH = $$dirname(LIBGCC_PATH_FULL)
-QMAKE_INCDIR = $$ANDROID_SOURCES_CXX_STL_INCDIR $$QMAKE_ANDROID_PLATFORM_INCDIR
-QMAKE_LIBDIR = $$ANDROID_SOURCES_CXX_STL_LIBDIR $$QMAKE_ANDROID_PLATFORM_LIBDIR $$LIBGCC_PATH
+QMAKE_INCDIR_POST = $$ANDROID_SOURCES_CXX_STL_INCDIR $$QMAKE_ANDROID_PLATFORM_INCDIR
+QMAKE_LIBDIR_POST = $$ANDROID_SOURCES_CXX_STL_LIBDIR $$QMAKE_ANDROID_PLATFORM_LIBDIR $$LIBGCC_PATH
QMAKE_INCDIR_X11 =
QMAKE_LIBDIR_X11 =
QMAKE_INCDIR_OPENGL = $$QMAKE_ANDROID_PLATFORM_INCDIR
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/common/msvc-version.conf b/mkspecs/common/msvc-version.conf
index 29f96b7abf..d8ec089f55 100644
--- a/mkspecs/common/msvc-version.conf
+++ b/mkspecs/common/msvc-version.conf
@@ -81,6 +81,10 @@ greaterThan(QMAKE_MSC_VER, 1909) {
MSVC_VER = 15.0
COMPAT_MKSPEC = win32-msvc2017
QMAKE_CXXFLAGS += -Zc:referenceBinding
+ # For now permissive fails as soon as UWP API comes into play. In qtbase this
+ # API is used in direct2d, but also in multimedia, positioning and sensors.
+ # We can try again with a later version of Visual Studio.
+ # QMAKE_CXXFLAGS_STRICTCXX = -permissive-
}
greaterThan(QMAKE_MSC_VER, 1910) {
diff --git a/mkspecs/common/qcc-base-qnx.conf b/mkspecs/common/qcc-base-qnx.conf
index 624bdd3656..148645b4e9 100644
--- a/mkspecs/common/qcc-base-qnx.conf
+++ b/mkspecs/common/qcc-base-qnx.conf
@@ -38,9 +38,9 @@ isEmpty(QNX_DIR) {
error("QNX_TARGET environment variable not set")
}
-QMAKE_INCDIR = $${QNX_DIR}/usr/include $${QNX_DIR}/usr/include/freetype2
-QMAKE_LIBDIR = $${QNX_DIR}/$${QNX_CPUDIR}/lib $${QNX_DIR}/$${QNX_CPUDIR}/usr/lib
-QMAKE_LFLAGS += -Wl,-rpath-link,$${QNX_DIR}/$${QNX_CPUDIR}/lib -Wl,-rpath-link,$${QNX_DIR}/$${QNX_CPUDIR}/usr/lib
+QMAKE_INCDIR_POST = $${QNX_DIR}/usr/include $${QNX_DIR}/usr/include/freetype2
+QMAKE_LIBDIR_POST = $${QNX_DIR}/$${QNX_CPUDIR}/lib $${QNX_DIR}/$${QNX_CPUDIR}/usr/lib
+QMAKE_RPATHLINKDIR_POST += $${QNX_DIR}/$${QNX_CPUDIR}/lib $${QNX_DIR}/$${QNX_CPUDIR}/usr/lib
QMAKE_CXXFLAGS_CXX11 = -Wc,-std=gnu++11
QMAKE_CXXFLAGS_CXX14 = -Wc,-std=gnu++1y
diff --git a/mkspecs/devices/common/freebsd_device_pre.conf b/mkspecs/devices/common/freebsd_device_pre.conf
index 97d70b5265..8eb76f60f1 100644
--- a/mkspecs/devices/common/freebsd_device_pre.conf
+++ b/mkspecs/devices/common/freebsd_device_pre.conf
@@ -24,4 +24,4 @@ QMAKE_STRIP = $${CROSS_COMPILE}strip
# it messes up system include order. --sysroot is
# sufficient. See link for details:
# https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=213217
-QMAKE_LIBDIR = $$[QT_SYSROOT]/usr/lib
+QMAKE_LIBDIR_POST = $$[QT_SYSROOT]/usr/lib
diff --git a/mkspecs/devices/common/linux_device_post.conf b/mkspecs/devices/common/linux_device_post.conf
index cf1608f32b..9a434dba77 100644
--- a/mkspecs/devices/common/linux_device_post.conf
+++ b/mkspecs/devices/common/linux_device_post.conf
@@ -3,8 +3,9 @@ defineTest(qtConfSanitizeMkspec) {
}
contains(DISTRO_OPTS, deb-multi-arch) {
- QMAKE_LFLAGS += -Wl,-rpath-link,$$[QT_SYSROOT]/usr/lib/$${GCC_MACHINE_DUMP} \
- -Wl,-rpath-link,$$[QT_SYSROOT]/lib/$${GCC_MACHINE_DUMP}
+ QMAKE_RPATHLINKDIR_POST += \
+ $$[QT_SYSROOT]/usr/lib/$${GCC_MACHINE_DUMP} \
+ $$[QT_SYSROOT]/lib/$${GCC_MACHINE_DUMP}
}
contains(DISTRO_OPTS, boot2qt) {
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/devices/linux-arm-hisilicon-hix5hd2-g++/qmake.conf b/mkspecs/devices/linux-arm-hisilicon-hix5hd2-g++/qmake.conf
index 99b8f22f97..f65e9730d0 100644
--- a/mkspecs/devices/linux-arm-hisilicon-hix5hd2-g++/qmake.conf
+++ b/mkspecs/devices/linux-arm-hisilicon-hix5hd2-g++/qmake.conf
@@ -19,8 +19,8 @@
include(../common/linux_device_pre.conf)
-QMAKE_INCDIR += /usr/arm-linux-gnueabihf/include
-QMAKE_LIBDIR += /usr/arm-linux-gnueabihf/lib
+QMAKE_INCDIR_POST += /usr/arm-linux-gnueabihf/include
+QMAKE_LIBDIR_POST += /usr/arm-linux-gnueabihf/lib
QMAKE_LIBS += -lrt
diff --git a/mkspecs/devices/linux-arm-trident-pnx8473-g++/qmake.conf b/mkspecs/devices/linux-arm-trident-pnx8473-g++/qmake.conf
index b131f65a79..5619c205fb 100644
--- a/mkspecs/devices/linux-arm-trident-pnx8473-g++/qmake.conf
+++ b/mkspecs/devices/linux-arm-trident-pnx8473-g++/qmake.conf
@@ -50,9 +50,9 @@ QMAKE_OBJCOPY = $${CROSS_COMPILE}objcopy
QMAKE_NM = $${CROSS_COMPILE}nm -P
QMAKE_STRIP = $${CROSS_COMPILE}strip
-QMAKE_INCDIR += $${TRIDENT_SHINER_SDK_BUILDTREE}/target/output/objs/$${TRIDENT_SHINER_SDK_BUILDSPEC}/comps/generic_apps/usr/include
-QMAKE_LIBDIR += $${TRIDENT_SHINER_SDK_BUILDTREE}/target/output/objs/$${TRIDENT_SHINER_SDK_BUILDSPEC}/comps/generic_apps/usr/lib
-QMAKE_LIBDIR += $${TRIDENT_SHINER_SDK_BUILDTREE}/target/output/objs/$${TRIDENT_SHINER_SDK_BUILDSPEC}/comps/generated/lib/armgnu_linux_el_cortex-a9
+QMAKE_INCDIR_POST += $${TRIDENT_SHINER_SDK_BUILDTREE}/target/output/objs/$${TRIDENT_SHINER_SDK_BUILDSPEC}/comps/generic_apps/usr/include
+QMAKE_LIBDIR_POST += $${TRIDENT_SHINER_SDK_BUILDTREE}/target/output/objs/$${TRIDENT_SHINER_SDK_BUILDSPEC}/comps/generic_apps/usr/lib
+QMAKE_LIBDIR_POST += $${TRIDENT_SHINER_SDK_BUILDTREE}/target/output/objs/$${TRIDENT_SHINER_SDK_BUILDSPEC}/comps/generated/lib/armgnu_linux_el_cortex-a9
QMAKE_INCDIR_EGL = $${TRIDENT_SHINER_SDK_INCDIR_EGL_OPENGL_ES2}
QMAKE_LIBDIR_EGL = $${TRIDENT_SHINER_SDK_LIBDIR_EGL_OPENGL_ES2}
diff --git a/mkspecs/devices/linux-drive-cx-g++/qmake.conf b/mkspecs/devices/linux-drive-cx-g++/qmake.conf
index a658f29deb..a0dcaddec9 100644
--- a/mkspecs/devices/linux-drive-cx-g++/qmake.conf
+++ b/mkspecs/devices/linux-drive-cx-g++/qmake.conf
@@ -16,21 +16,21 @@
include(../common/linux_device_pre.conf)
-QMAKE_INCDIR += \
+QMAKE_INCDIR_POST += \
$${VIBRANTE_SDK_TOPDIR}/include \
$$[QT_SYSROOT]/usr/include
-QMAKE_LIBDIR += \
+QMAKE_LIBDIR_POST += \
$${VIBRANTE_SDK_TOPDIR}/lib-target \
$$[QT_SYSROOT]/usr/lib \
$$[QT_SYSROOT]/lib/aarch64-linux-gnu \
$$[QT_SYSROOT]/usr/lib/aarch64-linux-gnu
-QMAKE_LFLAGS += \
- -Wl,-rpath-link,$${VIBRANTE_SDK_TOPDIR}/lib-target \
- -Wl,-rpath-link,$$[QT_SYSROOT]/usr/lib \
- -Wl,-rpath-link,$$[QT_SYSROOT]/usr/lib/aarch64-linux-gnu \
- -Wl,-rpath-link,$$[QT_SYSROOT]/lib/aarch64-linux-gnu
+QMAKE_RPATHLINKDIR_POST += \
+ $${VIBRANTE_SDK_TOPDIR}/lib-target \
+ $$[QT_SYSROOT]/usr/lib \
+ $$[QT_SYSROOT]/usr/lib/aarch64-linux-gnu \
+ $$[QT_SYSROOT]/lib/aarch64-linux-gnu
DISTRO_OPTS += aarch64
diff --git a/mkspecs/devices/linux-jetson-tk1-g++/qmake.conf b/mkspecs/devices/linux-jetson-tk1-g++/qmake.conf
index 493b55384f..4c733e8b77 100644
--- a/mkspecs/devices/linux-jetson-tk1-g++/qmake.conf
+++ b/mkspecs/devices/linux-jetson-tk1-g++/qmake.conf
@@ -11,19 +11,19 @@
include(../common/linux_device_pre.conf)
-QMAKE_INCDIR += \
+QMAKE_INCDIR_POST += \
$$[QT_SYSROOT]/usr/include \
$$[QT_SYSROOT]/usr/include/arm-linux-gnueabihf
-QMAKE_LIBDIR += \
+QMAKE_LIBDIR_POST += \
$$[QT_SYSROOT]/usr/lib \
$$[QT_SYSROOT]/lib/arm-linux-gnueabihf \
$$[QT_SYSROOT]/usr/lib/arm-linux-gnueabihf
-QMAKE_LFLAGS += \
- -Wl,-rpath-link,$$[QT_SYSROOT]/usr/lib \
- -Wl,-rpath-link,$$[QT_SYSROOT]/usr/lib/arm-linux-gnueabihf \
- -Wl,-rpath-link,$$[QT_SYSROOT]/lib/arm-linux-gnueabihf
+QMAKE_RPATHLINKDIR_POST += \
+ $$[QT_SYSROOT]/usr/lib \
+ $$[QT_SYSROOT]/usr/lib/arm-linux-gnueabihf \
+ $$[QT_SYSROOT]/lib/arm-linux-gnueabihf
DISTRO_OPTS += hard-float
COMPILER_FLAGS += -mtune=cortex-a15 -march=armv7-a -mfpu=neon-vfpv4
diff --git a/mkspecs/devices/linux-jetson-tk1-pro-g++/qmake.conf b/mkspecs/devices/linux-jetson-tk1-pro-g++/qmake.conf
index 1f44c47151..fb89721798 100644
--- a/mkspecs/devices/linux-jetson-tk1-pro-g++/qmake.conf
+++ b/mkspecs/devices/linux-jetson-tk1-pro-g++/qmake.conf
@@ -14,21 +14,21 @@
include(../common/linux_device_pre.conf)
-QMAKE_INCDIR += \
+QMAKE_INCDIR_POST += \
$${VIBRANTE_SDK_TOPDIR}/include \
$$[QT_SYSROOT]/usr/include
-QMAKE_LIBDIR += \
+QMAKE_LIBDIR_POST += \
$${VIBRANTE_SDK_TOPDIR}/lib-target \
$$[QT_SYSROOT]/usr/lib \
$$[QT_SYSROOT]/lib/arm-linux-gnueabihf \
$$[QT_SYSROOT]/usr/lib/arm-linux-gnueabihf
-QMAKE_LFLAGS += \
- -Wl,-rpath-link,$${VIBRANTE_SDK_TOPDIR}/lib-target \
- -Wl,-rpath-link,$$[QT_SYSROOT]/usr/lib \
- -Wl,-rpath-link,$$[QT_SYSROOT]/usr/lib/arm-linux-gnueabihf \
- -Wl,-rpath-link,$$[QT_SYSROOT]/lib/arm-linux-gnueabihf
+QMAKE_RPATHLINKDIR_POST += \
+ $${VIBRANTE_SDK_TOPDIR}/lib-target \
+ $$[QT_SYSROOT]/usr/lib \
+ $$[QT_SYSROOT]/usr/lib/arm-linux-gnueabihf \
+ $$[QT_SYSROOT]/lib/arm-linux-gnueabihf
DISTRO_OPTS += hard-float
COMPILER_FLAGS += -mtune=cortex-a15 -march=armv7-a -mfpu=neon-vfpv4 -DWIN_INTERFACE_CUSTOM
diff --git a/mkspecs/devices/linux-jetson-tx1-g++/qmake.conf b/mkspecs/devices/linux-jetson-tx1-g++/qmake.conf
index 06cf329f3a..f9dec441f6 100644
--- a/mkspecs/devices/linux-jetson-tx1-g++/qmake.conf
+++ b/mkspecs/devices/linux-jetson-tx1-g++/qmake.conf
@@ -25,20 +25,20 @@
include(../common/linux_device_pre.conf)
-QMAKE_INCDIR += \
+QMAKE_INCDIR_POST += \
$$[QT_SYSROOT]/usr/include \
$$[QT_SYSROOT]/usr/include/aarch64-linux-gnu
-QMAKE_LIBDIR += \
+QMAKE_LIBDIR_POST += \
$$[QT_SYSROOT]/usr/lib \
$$[QT_SYSROOT]/lib/aarch64-linux-gnu \
$$[QT_SYSROOT]/usr/lib/aarch64-linux-gnu
-QMAKE_LFLAGS += \
- -Wl,-rpath-link,$$[QT_SYSROOT]/usr/lib \
- -Wl,-rpath-link,$$[QT_SYSROOT]/usr/lib/aarch64-linux-gnu \
- -Wl,-rpath-link,$$[QT_SYSROOT]/usr/lib/aarch64-linux-gnu/tegra \
- -Wl,-rpath-link,$$[QT_SYSROOT]/lib/aarch64-linux-gnu
+QMAKE_RPATHLINKDIR_POST += \
+ $$[QT_SYSROOT]/usr/lib \
+ $$[QT_SYSROOT]/usr/lib/aarch64-linux-gnu \
+ $$[QT_SYSROOT]/usr/lib/aarch64-linux-gnu/tegra \
+ $$[QT_SYSROOT]/lib/aarch64-linux-gnu
DISTRO_OPTS += aarch64
COMPILER_FLAGS += -mtune=cortex-a57.cortex-a53 -march=armv8-a
diff --git a/mkspecs/devices/linux-mipsel-broadcom-97425-g++/qmake.conf b/mkspecs/devices/linux-mipsel-broadcom-97425-g++/qmake.conf
index 9211551daf..c7b6970fea 100644
--- a/mkspecs/devices/linux-mipsel-broadcom-97425-g++/qmake.conf
+++ b/mkspecs/devices/linux-mipsel-broadcom-97425-g++/qmake.conf
@@ -52,10 +52,9 @@ QMAKE_LIBDIR_OPENGL_ES2 = $${BRCM_ROCKFORD_PATH}/middleware/v3d/lib_$${BRCM_PLAT
QMAKE_LIBS_OPENGL_ES2 = -lv3ddriver -lrt
QMAKE_LIBS_EGL =
-INCLUDEPATH += $${BRCM_APPLIBS_PATH}/opensource/zlib/zlib-1.2.3
-QMAKE_LIBDIR += $${BRCM_APPLIBS_PATH}/opensource/zlib/zlib-1.2.3
-
-QMAKE_LFLAGS += -Wl,-rpath-link,$$QMAKE_LIBDIR_OPENGL_ES2 -Wl,-rpath-link,$${BRCM_APPLIBS_PATH}/opensource/zlib/zlib-1.2.3
+QMAKE_INCDIR_POST += $${BRCM_APPLIBS_PATH}/opensource/zlib/zlib-1.2.3
+QMAKE_LIBDIR_POST += $${BRCM_APPLIBS_PATH}/opensource/zlib/zlib-1.2.3
+QMAKE_RPATHLINKDIR_POST += $$QMAKE_LIBDIR_OPENGL_ES2 $${BRCM_APPLIBS_PATH}/opensource/zlib/zlib-1.2.3
# DirectFB platform hooks for this hardware
QT_CONFIG += directfb_egl egl
diff --git a/mkspecs/devices/linux-rasp-pi-g++/qmake.conf b/mkspecs/devices/linux-rasp-pi-g++/qmake.conf
index 8f0edbc6e6..b72091373d 100644
--- a/mkspecs/devices/linux-rasp-pi-g++/qmake.conf
+++ b/mkspecs/devices/linux-rasp-pi-g++/qmake.conf
@@ -5,7 +5,7 @@
include(../common/linux_device_pre.conf)
-QMAKE_LFLAGS += -Wl,-rpath-link,$$[QT_SYSROOT]/opt/vc/lib
+QMAKE_RPATHLINKDIR_POST += $$[QT_SYSROOT]/opt/vc/lib
QMAKE_LIBDIR_OPENGL_ES2 = $$[QT_SYSROOT]/opt/vc/lib
QMAKE_LIBDIR_EGL = $$QMAKE_LIBDIR_OPENGL_ES2
diff --git a/mkspecs/devices/linux-rasp-pi2-g++/qmake.conf b/mkspecs/devices/linux-rasp-pi2-g++/qmake.conf
index 2911f08873..ffe8f5739a 100644
--- a/mkspecs/devices/linux-rasp-pi2-g++/qmake.conf
+++ b/mkspecs/devices/linux-rasp-pi2-g++/qmake.conf
@@ -2,7 +2,7 @@
include(../common/linux_device_pre.conf)
-QMAKE_LFLAGS += -Wl,-rpath-link,$$[QT_SYSROOT]/opt/vc/lib
+QMAKE_RPATHLINKDIR_POST += $$[QT_SYSROOT]/opt/vc/lib
QMAKE_LIBDIR_OPENGL_ES2 = $$[QT_SYSROOT]/opt/vc/lib
QMAKE_LIBDIR_EGL = $$QMAKE_LIBDIR_OPENGL_ES2
diff --git a/mkspecs/devices/linux-rasp-pi3-g++/qmake.conf b/mkspecs/devices/linux-rasp-pi3-g++/qmake.conf
index 10862ccd70..2bb70ffb5a 100644
--- a/mkspecs/devices/linux-rasp-pi3-g++/qmake.conf
+++ b/mkspecs/devices/linux-rasp-pi3-g++/qmake.conf
@@ -8,13 +8,12 @@ include(../common/linux_device_pre.conf)
# and possibly no pkg-config, have some static values as well:
# I consider it a bug that this is required, but our EGL config.test _requires_ it
-QMAKE_LFLAGS += -Wl,-rpath-link,$$[QT_SYSROOT]/opt/vc/lib
+QMAKE_RPATHLINKDIR_POST += $$[QT_SYSROOT]/opt/vc/lib
VC_LIBRARY_PATH = /opt/vc/lib
VC_INCLUDE_PATH = =/opt/vc/include
-# terrible, they do not appear to resolve "=" in rpath!
-VC_LINK_LINE = -L=$${VC_LIBRARY_PATH} -Wl,-rpath-link,$$[QT_SYSROOT]$${VC_LIBRARY_PATH}
+VC_LINK_LINE = -L=$${VC_LIBRARY_PATH}
QMAKE_LIBDIR_OPENGL_ES2 = =$${VC_LIBRARY_PATH}
QMAKE_LIBDIR_EGL = $$QMAKE_LIBDIR_OPENGL_ES2
diff --git a/mkspecs/devices/linux-snowball-g++/qmake.conf b/mkspecs/devices/linux-snowball-g++/qmake.conf
index 9791119363..ff0f3ab1ae 100644
--- a/mkspecs/devices/linux-snowball-g++/qmake.conf
+++ b/mkspecs/devices/linux-snowball-g++/qmake.conf
@@ -27,7 +27,8 @@ QMAKE_OBJCOPY = $${CROSS_COMPILE}objcopy
QMAKE_NM = $${CROSS_COMPILE}nm -P
QMAKE_STRIP = $${CROSS_COMPILE}strip
-QMAKE_LFLAGS += -Wl,-rpath-link,$$[QT_SYSROOT]/usr/lib/arm-linux-gnueabihf \
- -Wl,-rpath-link,$$[QT_SYSROOT]/lib/arm-linux-gnueabihf
+QMAKE_RPATHLINKDIR_POST += \
+ $$[QT_SYSROOT]/usr/lib/arm-linux-gnueabihf \
+ $$[QT_SYSROOT]/lib/arm-linux-gnueabihf
load(qt_config)
diff --git a/mkspecs/devices/linux-tegra2-g++/qmake.conf b/mkspecs/devices/linux-tegra2-g++/qmake.conf
index adadc4d5b0..3f6da7668d 100644
--- a/mkspecs/devices/linux-tegra2-g++/qmake.conf
+++ b/mkspecs/devices/linux-tegra2-g++/qmake.conf
@@ -10,15 +10,16 @@
include(../common/linux_device_pre.conf)
-QMAKE_INCDIR += $$[QT_SYSROOT]/usr/include
+QMAKE_INCDIR_POST += $$[QT_SYSROOT]/usr/include
-QMAKE_LIBDIR += $$[QT_SYSROOT]/usr/lib \
+QMAKE_LIBDIR_POST += $$[QT_SYSROOT]/usr/lib \
$$[QT_SYSROOT]/lib/arm-linux-gnueabi \
$$[QT_SYSROOT]/usr/lib/arm-linux-gnueabi
-QMAKE_LFLAGS += -Wl,-rpath-link,$$[QT_SYSROOT]/usr/lib \
- -Wl,-rpath-link,$$[QT_SYSROOT]/usr/lib/arm-linux-gnueabi \
- -Wl,-rpath-link,$$[QT_SYSROOT]/lib/arm-linux-gnueabi
+QMAKE_RPATHLINKDIR_POST += \
+ $$[QT_SYSROOT]/usr/lib \
+ $$[QT_SYSROOT]/usr/lib/arm-linux-gnueabi \
+ $$[QT_SYSROOT]/lib/arm-linux-gnueabi
TEGRA2_CFLAGS = -mtune=cortex-a9 -march=armv7-a -mhard-float -mfloat-abi=softfp -mfpu=vfpv3-d16
QMAKE_CFLAGS += $$TEGRA2_CFLAGS
diff --git a/mkspecs/features/configure_base.prf b/mkspecs/features/configure_base.prf
index a4464528b4..e870e2ee10 100644
--- a/mkspecs/features/configure_base.prf
+++ b/mkspecs/features/configure_base.prf
@@ -31,7 +31,9 @@ defineTest(qtLog) {
defineTest(qtRunLoggedCommand) {
qtLog("+ $$1")
- output = $$system("( $$1 ) 2>&1", lines, result)
+ !equals(3, false): \
+ 1 = "( $$1 ) 2>&1"
+ output = $$system("$$1", lines, result)
lg =
for (l, output): \
lg += "> $$l"
diff --git a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
index 4f342d67d7..17da8b979e 100644
--- a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
+++ b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
@@ -35,7 +35,7 @@ set(_qt5$${CMAKE_MODULE_NAME}_install_prefix \"$$[QT_INSTALL_PREFIX]\")
!!IF !equals(TEMPLATE, aux)
# For backwards compatibility only. Use Qt5$${CMAKE_MODULE_NAME}_VERSION instead.
-set(Qt5$${CMAKE_MODULE_NAME}_VERSION_STRING "$$eval(QT.$${MODULE}.MAJOR_VERSION).$$eval(QT.$${MODULE}.MINOR_VERSION).$$eval(QT.$${MODULE}.PATCH_VERSION)")
+set(Qt5$${CMAKE_MODULE_NAME}_VERSION_STRING "$$eval(QT.$${MODULE}.VERSION)")
set(Qt5$${CMAKE_MODULE_NAME}_LIBRARIES Qt5::$${CMAKE_MODULE_NAME})
!!ENDIF // TEMPLATE != aux
diff --git a/mkspecs/features/default_post.prf b/mkspecs/features/default_post.prf
index d6caf870f7..d18604e0b8 100644
--- a/mkspecs/features/default_post.prf
+++ b/mkspecs/features/default_post.prf
@@ -124,8 +124,12 @@ c++11|c++14|c++1z {
cxxstd = CXX11
}
- # Check if we should disable the GNU extensions or not
- !strict_c++:!isEmpty(QMAKE_CXXFLAGS_GNU$$cxxstd): cxxstd = GNU$$cxxstd
+ # Check if we should disable compiler extensions or not
+ isEmpty(QMAKE_CXXFLAGS_GNU$$cxxstd) {
+ strict_c++: QMAKE_CXXFLAGS += $$QMAKE_CXXFLAGS_STRICTCXX
+ } else {
+ !strict_c++: cxxstd = GNU$$cxxstd
+ }
QMAKE_CXXFLAGS += $$eval(QMAKE_CXXFLAGS_$$cxxstd)
QMAKE_LFLAGS += $$eval(QMAKE_LFLAGS_$$cxxstd)
@@ -139,6 +143,3 @@ utf8_source {
}
!precompile_header: SOURCES += $$NO_PCH_SOURCES
-
-QMAKE_INCDIR += $$QMAKE_INCDIR_POST
-QMAKE_LIBDIR += $$QMAKE_LIBDIR_POST
diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf
index 5cbc0d4bfd..964c2393c2 100644
--- a/mkspecs/features/qt_configure.prf
+++ b/mkspecs/features/qt_configure.prf
@@ -581,7 +581,8 @@ defineTest(qtConfLibrary_pkgConfig) {
version ~= s/[^0-9.].*$//
$${1}.version = $$first(version)
export($${1}.version)
- $${1}.libs = $$libpaths $$libs
+ libpaths += $$libs
+ $${1}.libs = "$$libpaths"
export($${1}.libs)
return(true)
}
diff --git a/mkspecs/freebsd-clang/qmake.conf b/mkspecs/freebsd-clang/qmake.conf
index 10bb4a3723..f59fbd3c7d 100644
--- a/mkspecs/freebsd-clang/qmake.conf
+++ b/mkspecs/freebsd-clang/qmake.conf
@@ -8,8 +8,8 @@ QMAKE_PLATFORM = freebsd
include(../common/bsd/bsd.conf)
# Addon software goes into /usr/local on FreeBSD, by default we will look there
-QMAKE_INCDIR = /usr/local/include
-QMAKE_LIBDIR = /usr/local/lib
+QMAKE_INCDIR_POST = /usr/local/include
+QMAKE_LIBDIR_POST = /usr/local/lib
QMAKE_LFLAGS_NOUNDEF = -Wl,--no-undefined
diff --git a/mkspecs/freebsd-g++/qmake.conf b/mkspecs/freebsd-g++/qmake.conf
index 1f4448889e..4df444480d 100644
--- a/mkspecs/freebsd-g++/qmake.conf
+++ b/mkspecs/freebsd-g++/qmake.conf
@@ -8,8 +8,8 @@ QMAKE_PLATFORM = freebsd
include(../common/bsd/bsd.conf)
# Addon software goes into /usr/local on FreeBSD, by default we will look there
-QMAKE_INCDIR = /usr/local/include
-QMAKE_LIBDIR = /usr/local/lib
+QMAKE_INCDIR_POST = /usr/local/include
+QMAKE_LIBDIR_POST = /usr/local/lib
include(../common/gcc-base-unix.conf)
include(../common/g++-unix.conf)
diff --git a/mkspecs/netbsd-g++/qmake.conf b/mkspecs/netbsd-g++/qmake.conf
index a4b26837ce..c7e067a5c7 100644
--- a/mkspecs/netbsd-g++/qmake.conf
+++ b/mkspecs/netbsd-g++/qmake.conf
@@ -8,8 +8,8 @@ QMAKE_PLATFORM = netbsd
include(../common/bsd/bsd.conf)
# Addon software goes into /usr/pkg on NetBSD, by default we will look there
-QMAKE_INCDIR = /usr/pkg/include
-QMAKE_LIBDIR = /usr/pkg/lib
+QMAKE_INCDIR_POST = /usr/pkg/include
+QMAKE_LIBDIR_POST = /usr/pkg/lib
# System provided X11 defaults to X11R7 path on NetBSD since 5.0
QMAKE_INCDIR_X11 = /usr/X11R7/include
diff --git a/mkspecs/openbsd-g++/qmake.conf b/mkspecs/openbsd-g++/qmake.conf
index 6124d31439..4a142e476e 100644
--- a/mkspecs/openbsd-g++/qmake.conf
+++ b/mkspecs/openbsd-g++/qmake.conf
@@ -8,8 +8,8 @@ QMAKE_PLATFORM = openbsd
include(../common/bsd/bsd.conf)
# Addon software goes into /usr/local on OpenBSD, by default we will look there
-QMAKE_INCDIR = /usr/local/include
-QMAKE_LIBDIR = /usr/local/lib
+QMAKE_INCDIR_POST = /usr/local/include
+QMAKE_LIBDIR_POST = /usr/local/lib
# System provided X11 defaults to X11R6 path on OpenBSD
QMAKE_INCDIR_X11 = /usr/X11R6/include
diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp
index b86594d191..30f99174f8 100644
--- a/qmake/generators/unix/unixmake.cpp
+++ b/qmake/generators/unix/unixmake.cpp
@@ -94,6 +94,10 @@ UnixMakefileGenerator::init()
!project->values("QMAKE_LIB_FLAG").isEmpty() &&
project->isActiveConfig("dll"))
project->values("QMAKE_LFLAGS") += project->values("QMAKE_LFLAGS_PREBIND");
+ project->values("QMAKE_INCDIR") += project->values("QMAKE_INCDIR_POST");
+ project->values("QMAKE_LIBDIR") += project->values("QMAKE_LIBDIR_POST");
+ project->values("QMAKE_RPATHDIR") += project->values("QMAKE_RPATHDIR_POST");
+ project->values("QMAKE_RPATHLINKDIR") += project->values("QMAKE_RPATHLINKDIR_POST");
if(!project->isEmpty("QMAKE_INCDIR"))
project->values("INCLUDEPATH") += project->values("QMAKE_INCDIR");
ProStringList ldadd;
diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp
index 6f2f43c03c..75bb5d236d 100644
--- a/qmake/generators/win32/winmakefile.cpp
+++ b/qmake/generators/win32/winmakefile.cpp
@@ -174,6 +174,9 @@ void Win32MakefileGenerator::processVars()
else if (project->first("TEMPLATE").startsWith("vc"))
project->values("MAKEFILE") = project->values("QMAKE_PROJECT_NAME");
+ project->values("QMAKE_INCDIR") += project->values("QMAKE_INCDIR_POST");
+ project->values("QMAKE_LIBDIR") += project->values("QMAKE_LIBDIR_POST");
+
if (!project->values("QMAKE_INCDIR").isEmpty())
project->values("INCLUDEPATH") += project->values("QMAKE_INCDIR");
diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h
index 173ada89de..c221115e8f 100644
--- a/src/corelib/global/qcompilerdetection.h
+++ b/src/corelib/global/qcompilerdetection.h
@@ -1246,6 +1246,11 @@
#else
# define QT_HAS_INCLUDE_NEXT(x) 0
#endif
+#ifdef __has_feature
+# define QT_HAS_FEATURE(x) __has_feature(x)
+#else
+# define QT_HAS_FEATURE(x) 0
+#endif
/*
* Warning/diagnostic handling
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index ea9d207177..c2c9ea4e67 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -86,6 +86,12 @@
# include <sys/systeminfo.h>
#endif
+#if defined(Q_OS_DARWIN)
+# include <mach/machine.h>
+# include <sys/sysctl.h>
+# include <sys/types.h>
+#endif
+
#ifdef Q_OS_UNIX
#include <sys/utsname.h>
#include <private/qcore_unix_p.h>
@@ -2484,6 +2490,20 @@ QString QSysInfo::currentCpuArchitecture()
case PROCESSOR_ARCHITECTURE_IA64:
return QStringLiteral("ia64");
}
+#elif defined(Q_OS_DARWIN)
+ cpu_type_t type;
+ size_t size = sizeof(type);
+ sysctlbyname("hw.cputype", &type, &size, NULL, 0);
+ switch (type) {
+ case CPU_TYPE_X86:
+ return QStringLiteral("i386");
+ case CPU_TYPE_X86_64:
+ return QStringLiteral("x86_64");
+ case CPU_TYPE_ARM:
+ return QStringLiteral("arm");
+ case CPU_TYPE_ARM64:
+ return QStringLiteral("arm64");
+ }
#elif defined(Q_OS_UNIX)
long ret = -1;
struct utsname u;
@@ -3306,20 +3326,26 @@ bool qEnvironmentVariableIsEmpty(const char *varName) Q_DECL_NOEXCEPT
Equivalent to
\code
- qgetenv(varName).toInt()
+ qgetenv(varName).toInt(ok, 0)
\endcode
except that it's much faster, and can't throw exceptions.
+ \note there's a limit on the length of the value, which is sufficient for
+ all valid values of int, not counting leading zeroes or spaces. Values that
+ are too long will either be truncated or this function will set \a ok to \c
+ false.
+
\sa qgetenv(), qEnvironmentVariableIsSet()
*/
int qEnvironmentVariableIntValue(const char *varName, bool *ok) Q_DECL_NOEXCEPT
{
- QMutexLocker locker(&environmentMutex);
-#if defined(_MSC_VER) && _MSC_VER >= 1400
- // we provide a buffer that can hold any int value:
static const int NumBinaryDigitsPerOctalDigit = 3;
static const int MaxDigitsForOctalInt =
(std::numeric_limits<uint>::digits + NumBinaryDigitsPerOctalDigit - 1) / NumBinaryDigitsPerOctalDigit;
+
+ QMutexLocker locker(&environmentMutex);
+#if defined(_MSC_VER) && _MSC_VER >= 1400
+ // we provide a buffer that can hold any int value:
char buffer[MaxDigitsForOctalInt + 2]; // +1 for NUL +1 for optional '-'
size_t dummy;
if (getenv_s(&dummy, buffer, sizeof buffer, varName) != 0) {
@@ -3329,15 +3355,16 @@ int qEnvironmentVariableIntValue(const char *varName, bool *ok) Q_DECL_NOEXCEPT
}
#else
const char * const buffer = ::getenv(varName);
- if (!buffer || !*buffer) {
+ if (!buffer || strlen(buffer) > MaxDigitsForOctalInt + 2) {
if (ok)
*ok = false;
return 0;
}
#endif
bool ok_ = true;
- const qlonglong value = qstrtoll(buffer, Q_NULLPTR, 0, &ok_);
- if (int(value) != value) { // this is the check in QByteArray::toInt(), keep it in sync
+ const char *endptr;
+ const qlonglong value = qstrtoll(buffer, &endptr, 0, &ok_);
+ if (int(value) != value || *endptr != '\0') { // this is the check in QByteArray::toInt(), keep it in sync
if (ok)
*ok = false;
return 0;
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index cfc6ef8b16..0628b524fb 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -647,7 +647,12 @@ inline void qt_noop(void) {}
*/
#if !defined(QT_NO_EXCEPTIONS)
-# if defined(QT_BOOTSTRAPPED) || (defined(Q_CC_GNU) && !defined (__EXCEPTIONS) && !defined(Q_MOC_RUN))
+# if !defined(Q_MOC_RUN)
+# if (defined(Q_CC_CLANG) && !defined(Q_CC_INTEL) && !QT_HAS_FEATURE(cxx_exceptions)) || \
+ (defined(Q_CC_GNU) && !defined(__EXCEPTIONS))
+# define QT_NO_EXCEPTIONS
+# endif
+# elif defined(QT_BOOTSTRAPPED)
# define QT_NO_EXCEPTIONS
# endif
#endif
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/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/itemmodels/qabstractitemmodel.cpp b/src/corelib/itemmodels/qabstractitemmodel.cpp
index c0737ffb36..f893cf06e3 100644
--- a/src/corelib/itemmodels/qabstractitemmodel.cpp
+++ b/src/corelib/itemmodels/qabstractitemmodel.cpp
@@ -2044,7 +2044,7 @@ Qt::DropActions QAbstractItemModel::supportedDropActions() const
Qt::DropActions QAbstractItemModel::supportedDragActions() const
{
Q_D(const QAbstractItemModel);
- if (d->supportedDragActions != Qt::IgnoreAction)
+ if (int(d->supportedDragActions) != -1)
return d->supportedDragActions;
return supportedDropActions();
}
diff --git a/src/corelib/kernel/qobject_p.h b/src/corelib/kernel/qobject_p.h
index 0a5d003b05..ad88bcf274 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/qvariant.cpp b/src/corelib/kernel/qvariant.cpp
index e636c6fe52..17c94e4e9d 100644
--- a/src/corelib/kernel/qvariant.cpp
+++ b/src/corelib/kernel/qvariant.cpp
@@ -2363,7 +2363,7 @@ QByteArray QVariant::toByteArray() const
\fn QPoint QVariant::toPoint() const
Returns the variant as a QPoint if the variant has userType()
- \l QMetaType::QPointF or \l QMetaType::QPointF; otherwise returns a null
+ \l QMetaType::QPoint or \l QMetaType::QPointF; otherwise returns a null
QPoint.
\sa canConvert(), convert()
diff --git a/src/corelib/tools/qarraydataops.h b/src/corelib/tools/qarraydataops.h
index ae83e6986e..b7c3bc1287 100644
--- a/src/corelib/tools/qarraydataops.h
+++ b/src/corelib/tools/qarraydataops.h
@@ -49,6 +49,11 @@ QT_BEGIN_NAMESPACE
namespace QtPrivate {
+QT_WARNING_PUSH
+#if defined(Q_CC_GNU) && Q_CC_GNU >= 700
+QT_WARNING_DISABLE_GCC("-Wstringop-overflow")
+#endif
+
template <class T>
struct QPodArrayOps
: QTypedArrayData<T>
@@ -131,6 +136,7 @@ struct QPodArrayOps
this->size -= (e - b);
}
};
+QT_WARNING_POP
template <class T>
struct QGenericArrayOps
diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp
index b5b48324e7..19c27d9ff8 100644
--- a/src/corelib/tools/qbytearray.cpp
+++ b/src/corelib/tools/qbytearray.cpp
@@ -4791,4 +4791,26 @@ QByteArray QByteArray::toPercentEncoding(const QByteArray &exclude, const QByteA
\internal
*/
+/*!
+ \macro QByteArrayLiteral(ba)
+ \relates QByteArray
+
+ The macro generates the data for a QByteArray out of the string literal
+ \a ba at compile time. Creating a QByteArray from it is free in this case, and
+ the generated byte array data is stored in the read-only segment of the
+ compiled object file.
+
+ For instance:
+
+ \code
+ QByteArray ba = QByteArrayLiteral("byte array contents");
+ \endcode
+
+ Using QByteArrayLiteral instead of a double quoted plain C++ string literal
+ can significantly speed up creation of QByteArray instances from data known
+ at compile time.
+
+ \sa QStringLiteral
+*/
+
QT_END_NAMESPACE
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp
index 907de3cb4b..3826d7531a 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -11576,52 +11576,47 @@ QString QString::toHtmlEscaped() const
\macro QStringLiteral(str)
\relates QString
- The macro generates the data for a QString out of \a str at compile time if the compiler supports it.
- Creating a QString from it is free in this case, and the generated string data is stored in
- the read-only segment of the compiled object file.
+ The macro generates the data for a QString out of the string literal \a str
+ at compile time. Creating a QString from it is free in this case, and the
+ generated string data is stored in the read-only segment of the compiled
+ object file.
- For compilers not supporting the creation of compile time strings, QStringLiteral will fall back to
- QString::fromUtf8().
+ If you have code that looks like this:
- If you have code looking like:
\code
+ // hasAttribute takes a QString argument
if (node.hasAttribute("http-contents-length")) //...
\endcode
- One temporary QString will be created to be passed as the hasAttribute function parameter.
- This can be quite expensive, as it involves a memory allocation and the copy and the conversion
- of the data into QString's internal encoding.
- This can be avoided by doing
+ then a temporary QString will be created to be passed as the \c{hasAttribute}
+ function parameter. This can be quite expensive, as it involves a memory
+ allocation and the copy/conversion of the data into QString's internal
+ encoding.
+
+ This cost can be avoided by using QStringLiteral instead:
+
\code
if (node.hasAttribute(QStringLiteral("http-contents-length"))) //...
\endcode
- Then the QString's internal data will be generated at compile time and no conversion or allocation
- will occur at runtime
- Using QStringLiteral instead of a double quoted ascii literal can significantly speed up creation
- of QString's from data known at compile time.
+ In this case, QString's internal data will be generated at compile time; no
+ conversion or allocation will occur at runtime.
+
+ Using QStringLiteral instead of a double quoted plain C++ string literal can
+ significantly speed up creation of QString instances from data known at
+ compile time.
- If the compiler is C++11 enabled the string \a str can actually contain unicode data.
+ \note QLatin1String can still be more efficient than QStringLiteral
+ when the string is passed to a function that has an overload taking
+ QLatin1String and this overload avoids conversion to QString. For
+ instance, QString::operator==() can compare to a QLatin1String
+ directly:
- \note There are still a few cases in which QLatin1String is more efficient than QStringLiteral:
- If it is passed to a function that has an overload that takes the QLatin1String directly, without
- conversion to QString. For instance, this is the case of QString::operator==
\code
if (attribute.name() == QLatin1String("http-contents-length")) //...
\endcode
- \note There are some restrictions when using the MSVC 2010 or 2012 compilers. The example snippets
- provided here fail to compile with them.
- \list
- \li Concatenated string literals cannot be used with QStringLiteral.
- \code
- QString s = QStringLiteral("a" "b");
- \endcode
- \li QStringLiteral cannot be used to initialize lists or arrays of QString.
- \code
- QString a[] = { QStringLiteral("a"), QStringLiteral("b") };
- \endcode
- \endlist
+ \sa QByteArrayLiteral
*/
/*!
diff --git a/src/gui/configure.json b/src/gui/configure.json
index d074bf6794..7c4ea48f2e 100644
--- a/src/gui/configure.json
+++ b/src/gui/configure.json
@@ -87,7 +87,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 -lnvtegrahv", "condition": "config.integrity" }
]
},
"egl": {
@@ -150,6 +151,13 @@
{ "type": "pkgConfig", "args": "libinput" }
]
},
+ "integrityhid": {
+ "label": "integrityhid",
+ "test": "qpa/integrityhid",
+ "sources": [
+ { "libs": "-lhiddev -lusbhid -lusb" }
+ ]
+ },
"libjpeg": {
"label": "libjpeg",
"test": "unix/libjpeg",
@@ -379,6 +387,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",
@@ -447,7 +460,6 @@
"combined-angle-lib": {
"label": "Combined ANGLE Library",
"autoDetect": false,
- "enable": "features.angle",
"condition": "features.angle",
"output": [ "publicFeature" ]
},
@@ -526,7 +538,7 @@
"integrityfb": {
"label": "INTEGRITY framebuffer",
"section": "Platform plugins",
- "condition": "config.integrity",
+ "condition": "config.integrity && tests.integrityfb",
"output": [ "privateFeature" ]
},
"kms": {
@@ -539,6 +551,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",
@@ -1144,6 +1161,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 3889b747db..2ff9fb4e36 100644
--- a/src/gui/image/qmovie.cpp
+++ b/src/gui/image/qmovie.cpp
@@ -174,8 +174,6 @@
#include "qmovie.h"
-#ifndef QT_NO_MOVIE
-
#include "qglobal.h"
#include "qimage.h"
#include "qimagereader.h"
@@ -1062,5 +1060,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 ab8ef82aa0..ca559d491b 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;
@@ -146,6 +145,4 @@ private:
QT_END_NAMESPACE
-#endif // QT_NO_MOVIE
-
#endif // QMOVIE_H
diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp
index dc630aa931..4152d0184f 100644
--- a/src/gui/painting/qdrawhelper.cpp
+++ b/src/gui/painting/qdrawhelper.cpp
@@ -6010,7 +6010,7 @@ DrawHelper qDrawHelper[QImage::NImageFormats] =
// Format_ARGB32,
{
blend_color_generic,
- qt_gradient_argb32,
+ blend_src_generic,
qt_bitmapblit_argb32,
qt_alphamapblit_argb32,
qt_alphargbblit_argb32,
diff --git a/src/network/socket/qnativesocketengine_winrt.cpp b/src/network/socket/qnativesocketengine_winrt.cpp
index 0625ea65da..38c2b6e8c0 100644
--- a/src/network/socket/qnativesocketengine_winrt.cpp
+++ b/src/network/socket/qnativesocketengine_winrt.cpp
@@ -1250,20 +1250,22 @@ void QNativeSocketEngine::handleConnectOpFinished(bool success, QAbstractSocket:
void QNativeSocketEngine::handleNewDatagrams(const QList<WinRtDatagram> &datagrams)
{
Q_D(QNativeSocketEngine);
- // Defer putting the datagrams into the list until the next event loop iteration
- // (where the readyRead signal is emitted as well)
- QMetaObject::invokeMethod(this, "putIntoPendingDatagramsList", Qt::QueuedConnection,
- Q_ARG(QList<WinRtDatagram>, datagrams));
+ QMutexLocker locker(&d->readMutex);
+ d->pendingDatagrams.append(datagrams);
if (d->notifyOnRead)
emit readReady();
}
void QNativeSocketEngine::handleNewData(const QVector<QByteArray> &data)
{
- // Defer putting the data into the list until the next event loop iteration
- // (where the readyRead signal is emitted as well)
- QMetaObject::invokeMethod(this, "putIntoPendingData", Qt::QueuedConnection,
- Q_ARG(QVector<QByteArray>, data));
+ Q_D(QNativeSocketEngine);
+ QMutexLocker locker(&d->readMutex);
+ d->pendingData.append(data);
+ for (const QByteArray &newData : data)
+ d->bytesAvailable += newData.length();
+ locker.unlock();
+ if (d->notifyOnRead)
+ readNotification();
}
void QNativeSocketEngine::handleTcpError(QAbstractSocket::SocketError error)
@@ -1284,25 +1286,6 @@ void QNativeSocketEngine::handleTcpError(QAbstractSocket::SocketError error)
emit readReady();
}
-void QNativeSocketEngine::putIntoPendingDatagramsList(const QList<WinRtDatagram> &datagrams)
-{
- Q_D(QNativeSocketEngine);
- QMutexLocker locker(&d->readMutex);
- d->pendingDatagrams.append(datagrams);
-}
-
-void QNativeSocketEngine::putIntoPendingData(const QVector<QByteArray> &data)
-{
- Q_D(QNativeSocketEngine);
- QMutexLocker locker(&d->readMutex);
- d->pendingData.append(data);
- for (const QByteArray &newData : data)
- d->bytesAvailable += newData.length();
- locker.unlock();
- if (d->notifyOnRead)
- readNotification();
-}
-
bool QNativeSocketEnginePrivate::createNewSocket(QAbstractSocket::SocketType socketType, QAbstractSocket::NetworkLayerProtocol &socketProtocol)
{
Q_UNUSED(socketProtocol);
diff --git a/src/network/socket/qnativesocketengine_winrt_p.h b/src/network/socket/qnativesocketengine_winrt_p.h
index 6528c6d627..13922cb397 100644
--- a/src/network/socket/qnativesocketengine_winrt_p.h
+++ b/src/network/socket/qnativesocketengine_winrt_p.h
@@ -183,9 +183,6 @@ private slots:
void handleTcpError(QAbstractSocket::SocketError error);
private:
- Q_INVOKABLE void putIntoPendingDatagramsList(const QList<WinRtDatagram> &datagrams);
- Q_INVOKABLE void putIntoPendingData(const QVector<QByteArray> &data);
-
Q_DECLARE_PRIVATE(QNativeSocketEngine)
Q_DISABLE_COPY(QNativeSocketEngine)
};
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_mac.cpp b/src/network/ssl/qsslsocket_mac.cpp
index 0456b7cdc7..0a9588deea 100644
--- a/src/network/ssl/qsslsocket_mac.cpp
+++ b/src/network/ssl/qsslsocket_mac.cpp
@@ -1226,9 +1226,32 @@ bool QSslSocketBackendPrivate::verifyPeerTrust()
QCFType<SecCertificateRef> certRef = SecCertificateCreateWithData(NULL, certData);
CFArrayAppendValue(certArray, certRef);
}
+
SecTrustSetAnchorCertificates(trust, certArray);
- // Secure Transport should use anchors only from our QSslConfiguration:
- SecTrustSetAnchorCertificatesOnly(trust, true);
+
+ // By default SecTrustEvaluate uses both CA certificates provided in
+ // QSslConfiguration and the ones from the system database. This behavior can
+ // be unexpected if a user's code tries to limit the trusted CAs to those
+ // explicitly set in QSslConfiguration.
+ // Since on macOS we initialize the default QSslConfiguration copying the
+ // system CA certificates (using SecTrustSettingsCopyCertificates) we can
+ // call SecTrustSetAnchorCertificatesOnly(trust, true) to force SecTrustEvaluate
+ // to use anchors only from our QSslConfiguration.
+ // Unfortunately, SecTrustSettingsCopyCertificates is not available on iOS
+ // and the default QSslConfiguration always has an empty list of system CA
+ // certificates. This leaves no way to provide client code with access to the
+ // actual system CA certificate list (which most use-cases need) other than
+ // by letting SecTrustEvaluate fall through to the system list; so, in this case
+ // (even though the client code may have provided its own certs), we retain
+ // the default behavior.
+
+#ifdef Q_OS_MACOS
+ const bool anchorsFromConfigurationOnly = true;
+#else
+ const bool anchorsFromConfigurationOnly = false;
+#endif
+
+ SecTrustSetAnchorCertificatesOnly(trust, anchorsFromConfigurationOnly);
SecTrustResultType trustResult = kSecTrustResultInvalid;
SecTrustEvaluate(trust, &trustResult);
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/winrt/qwinrtfontdatabase.cpp b/src/platformsupport/fontdatabases/winrt/qwinrtfontdatabase.cpp
index 2a95ca26a9..db58e49bb2 100644
--- a/src/platformsupport/fontdatabases/winrt/qwinrtfontdatabase.cpp
+++ b/src/platformsupport/fontdatabases/winrt/qwinrtfontdatabase.cpp
@@ -448,19 +448,41 @@ QFontEngine *QWinRTFontDatabase::fontEngine(const QFontDef &fontDef, void *handl
return QFontEngineFT::create(fontDef, faceId, fontData);
}
+QString QWinRTFontDatabase::familyForStyleHint(QFont::StyleHint styleHint)
+{
+ switch (styleHint) {
+ case QFont::Times:
+ return QStringLiteral("Times New Roman");
+ case QFont::Courier:
+ return QStringLiteral("Courier New");
+ case QFont::Monospace:
+ return QStringLiteral("Courier New");
+ case QFont::Cursive:
+ return QStringLiteral("Comic Sans MS");
+ case QFont::Fantasy:
+ return QStringLiteral("Impact");
+ case QFont::Decorative:
+ return QStringLiteral("Old English");
+ case QFont::Helvetica:
+ return QStringLiteral("Segoe UI");
+ case QFont::System:
+ default:
+ break;
+ }
+ return QStringLiteral("Segoe UI");
+}
+
QStringList QWinRTFontDatabase::fallbacksForFamily(const QString &family, QFont::Style style,
QFont::StyleHint styleHint,
QChar::Script script) const
{
Q_UNUSED(style)
- Q_UNUSED(styleHint)
Q_UNUSED(script)
qCDebug(lcQpaFonts) << __FUNCTION__ << family;
QStringList result;
- if (family == QLatin1String("Helvetica"))
- result.append(QStringLiteral("Arial"));
+ result.append(QWinRTFontDatabase::familyForStyleHint(styleHint));
result.append(QFreeTypeFontDatabase::fallbacksForFamily(family, style, styleHint, script));
return result;
}
diff --git a/src/platformsupport/fontdatabases/winrt/qwinrtfontdatabase_p.h b/src/platformsupport/fontdatabases/winrt/qwinrtfontdatabase_p.h
index 9a2bf00fab..c21f411fff 100644
--- a/src/platformsupport/fontdatabases/winrt/qwinrtfontdatabase_p.h
+++ b/src/platformsupport/fontdatabases/winrt/qwinrtfontdatabase_p.h
@@ -80,6 +80,8 @@ public:
QStringList fallbacksForFamily(const QString &family, QFont::Style style,
QFont::StyleHint styleHint, QChar::Script script) const override;
void releaseHandle(void *handle) override;
+
+ static QString familyForStyleHint(QFont::StyleHint styleHint);
private:
QHash<IDWriteFontFile *, FontDescription> m_fonts;
QHash<QString, IDWriteFontFamily *> m_fontFamilies;
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 f3f2c1c99a..248c1ae667 100644
--- a/src/platformsupport/platformsupport.pro
+++ b/src/platformsupport/platformsupport.pro
@@ -11,7 +11,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/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/windows/qwindowskeymapper.cpp b/src/plugins/platforms/windows/qwindowskeymapper.cpp
index 2f459b70ec..c2d7632e89 100644
--- a/src/plugins/platforms/windows/qwindowskeymapper.cpp
+++ b/src/plugins/platforms/windows/qwindowskeymapper.cpp
@@ -977,8 +977,7 @@ bool QWindowsKeyMapper::translateKeyEventInternal(QWindow *window, const MSG &ms
state = state ^ Qt::ShiftModifier;
else if (code == Qt::Key_Alt)
state = state ^ Qt::AltModifier;
- else if (code == 0 && modifiersIndex != 0)
- code = keyLayout[vk_key].qtKey[0];
+
// If the bit 24 of lParm is set you received a enter,
// otherwise a Return. (This is the extended key bit)
if ((code == Qt::Key_Return) && (msg.lParam & 0x1000000))
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp
index 7451090cbf..1a360239c3 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)
{
@@ -356,8 +364,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 3e539337b1..5e09865d33 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 4bd5c1441a..1c9d522c1c 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 638187c614..d59db444e4 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
@@ -186,7 +188,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)
@@ -211,7 +213,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)
{
@@ -624,7 +626,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 8f962ea051..6ced466236 100644
--- a/src/printsupport/kernel/qprinter_p.h
+++ b/src/printsupport/kernel/qprinter_p.h
@@ -80,7 +80,7 @@ public:
paintEngine(0),
realPrintEngine(0),
realPaintEngine(0),
-#ifndef QT_NO_PRINTPREVIEWWIDGET
+#if QT_CONFIG(printpreviewwidget)
previewEngine(0),
#endif
q_ptr(printer),
@@ -99,7 +99,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
@@ -114,7 +114,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/sql/configure.pri b/src/sql/configure.pri
index 05794582e9..9fb957291f 100644
--- a/src/sql/configure.pri
+++ b/src/sql/configure.pri
@@ -36,6 +36,9 @@ defineTest(qtConfLibrary_psqlEnv) {
!isEmpty(PSQL_LIBS) {
$${1}.libs = $$PSQL_LIBS
export($${1}.libs)
+ } else {
+ !qtConfLibrary_inline($$1): \
+ return(false)
}
return(true)
}
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/itemviews/qheaderview.cpp b/src/widgets/itemviews/qheaderview.cpp
index ac03ed822b..20b160c03d 100644
--- a/src/widgets/itemviews/qheaderview.cpp
+++ b/src/widgets/itemviews/qheaderview.cpp
@@ -3888,9 +3888,11 @@ bool QHeaderViewPrivate::read(QDataStream &in)
const int currentCount = (orient == Qt::Horizontal ? model->columnCount(root) : model->rowCount(root));
if (newSectionItems.count() < currentCount) {
// we have sections not in the saved state, give them default settings
- for (int i = newSectionItems.count(); i < currentCount; ++i) {
- visualIndicesIn.append(i);
- logicalIndicesIn.append(i);
+ if (!visualIndicesIn.isEmpty() && !logicalIndicesIn.isEmpty()) {
+ for (int i = newSectionItems.count(); i < currentCount; ++i) {
+ visualIndicesIn.append(i);
+ logicalIndicesIn.append(i);
+ }
}
const int insertCount = currentCount - newSectionItems.count();
const int insertLength = defaultSectionSizeIn * insertCount;
diff --git a/src/widgets/itemviews/qlistview.cpp b/src/widgets/itemviews/qlistview.cpp
index dd4a070d24..33943399d1 100644
--- a/src/widgets/itemviews/qlistview.cpp
+++ b/src/widgets/itemviews/qlistview.cpp
@@ -73,6 +73,8 @@ extern bool qt_sendSpontaneousEvent(QObject *receiver, QEvent *event);
\ingroup advanced
\inmodule QtWidgets
+ \image windows-listview.png
+
A QListView presents items stored in a model, either as a simple
non-hierarchical list, or as a collection of icons. This class is used
to provide lists and icon views that were previously provided by the
@@ -111,15 +113,6 @@ extern bool qt_sendSpontaneousEvent(QObject *receiver, QEvent *event);
within a notional grid of size specified by gridSize(). The items can
be rendered as large or small icons depending on their iconSize().
- \table 100%
- \row \li \inlineimage windowsvista-listview.png Screenshot of a Windows Vista style list view
- \li \inlineimage macintosh-listview.png Screenshot of a Macintosh style table view
- \li \inlineimage fusion-listview.png Screenshot of a Fusion style table view
- \row \li A \l{Windows Vista Style Widget Gallery}{Windows Vista style} list view.
- \li A \l{Macintosh Style Widget Gallery}{Macintosh style} list view.
- \li A \l{Fusion Style Widget Gallery}{Fusion style} list view.
- \endtable
-
\section1 Improving Performance
It is possible to give the view hints about the data it is handling in order
diff --git a/src/widgets/itemviews/qlistwidget.cpp b/src/widgets/itemviews/qlistwidget.cpp
index 9b34e89ef0..0a1f85facb 100644
--- a/src/widgets/itemviews/qlistwidget.cpp
+++ b/src/widgets/itemviews/qlistwidget.cpp
@@ -1149,6 +1149,8 @@ void QListWidgetPrivate::_q_dataChanged(const QModelIndex &topLeft,
\ingroup model-view
\inmodule QtWidgets
+ \image windows-listview.png
+
QListWidget is a convenience class that provides a list view similar to the
one supplied by QListView, but with a classic item-based interface for
adding and removing items. QListWidget uses an internal model to manage
@@ -1191,15 +1193,6 @@ void QListWidgetPrivate::_q_dataChanged(const QModelIndex &topLeft,
current item changes, the currentItemChanged() signal is emitted with the
new current item and the item that was previously current.
- \table 100%
- \row \li \inlineimage windowsvista-listview.png Screenshot of a Windows Vista style list widget
- \li \inlineimage macintosh-listview.png Screenshot of a Macintosh style table widget
- \li \inlineimage fusion-listview.png Screenshot of a Fusion style table widget
- \row \li A \l{Windows Vista Style Widget Gallery}{Windows Vista style} list widget.
- \li A \l{Macintosh Style Widget Gallery}{Macintosh style} list widget.
- \li A \l{Fusion Style Widget Gallery}{Fusion style} list widget.
- \endtable
-
\sa QListWidgetItem, QListView, QTreeView, {Model/View Programming},
{Config Dialog Example}
*/
diff --git a/src/widgets/itemviews/qtableview.cpp b/src/widgets/itemviews/qtableview.cpp
index ed6482a8bc..b79932327b 100644
--- a/src/widgets/itemviews/qtableview.cpp
+++ b/src/widgets/itemviews/qtableview.cpp
@@ -988,6 +988,8 @@ int QTableViewPrivate::heightHintForIndex(const QModelIndex &index, int hint, QS
\ingroup advanced
\inmodule QtWidgets
+ \image windows-tableview.png
+
A QTableView implements a table view that displays items from a
model. This class is used to provide standard tables that were
previously provided by the QTable class, but using the more
@@ -1052,21 +1054,6 @@ int QTableViewPrivate::heightHintForIndex(const QModelIndex &index, int hint, QS
columnViewportPosition() functions provide the equivalent conversion
operations between x-coordinates and column indexes.
- \section1 Styles
-
- QTableView is styled appropriately for each platform. The following images show
- how it looks on three different platforms. Go to the \l{Qt Widget Gallery} to see
- its appearance in other styles.
-
- \table 100%
- \row \li \inlineimage windowsvista-tableview.png Screenshot of a Windows Vista style table view
- \li \inlineimage macintosh-tableview.png Screenshot of a Macintosh style table view
- \li \inlineimage fusion-tableview.png Screenshot of a Fusion style table view
- \row \li A \l{Windows Vista Style Widget Gallery}{Windows Vista style} table view.
- \li A \l{Macintosh Style Widget Gallery}{Macintosh style} table view.
- \li A \l{Fusion Style Widget Gallery}{Fusion style} table view.
- \endtable
-
\sa QTableWidget, {View Classes}, QAbstractItemModel, QAbstractItemView,
{Chart Example}, {Pixelator Example}, {Table Model Example}
*/
diff --git a/src/widgets/itemviews/qtablewidget.cpp b/src/widgets/itemviews/qtablewidget.cpp
index ed83ef7b85..663cd4adc6 100644
--- a/src/widgets/itemviews/qtablewidget.cpp
+++ b/src/widgets/itemviews/qtablewidget.cpp
@@ -1504,6 +1504,8 @@ QTableWidgetItem &QTableWidgetItem::operator=(const QTableWidgetItem &other)
\ingroup model-view
\inmodule QtWidgets
+ \image windows-tableview.png
+
Table widgets provide standard table display facilities for applications.
The items in a QTableWidget are provided by QTableWidgetItem.
@@ -1545,15 +1547,6 @@ QTableWidgetItem &QTableWidgetItem::operator=(const QTableWidgetItem &other)
number of columns with columnCount(). The table can be cleared with the
clear() function.
- \table 100%
- \row \li \inlineimage windowsvista-tableview.png Screenshot of a Windows Vista style table widget
- \li \inlineimage macintosh-tableview.png Screenshot of a Macintosh style table widget
- \li \inlineimage fusion-tableview.png Screenshot of a Fusion style table widget
- \row \li A \l{Windows Vista Style Widget Gallery}{Windows Vista style} table widget.
- \li A \l{Macintosh Style Widget Gallery}{Macintosh style} table widget.
- \li A \l{Fusion Style Widget Gallery}{Fusion style} table widget.
- \endtable
-
\sa QTableWidgetItem, QTableView, {Model/View Programming}
*/
diff --git a/src/widgets/itemviews/qtreeview.cpp b/src/widgets/itemviews/qtreeview.cpp
index 63d6580435..f92cef50be 100644
--- a/src/widgets/itemviews/qtreeview.cpp
+++ b/src/widgets/itemviews/qtreeview.cpp
@@ -71,6 +71,8 @@ QT_BEGIN_NAMESPACE
\ingroup advanced
\inmodule QtWidgets
+ \image windows-treeview.png
+
A QTreeView implements a tree representation of items from a
model. This class is used to provide standard hierarchical lists that
were previously provided by the \c QListView class, but using the more
@@ -150,15 +152,6 @@ QT_BEGIN_NAMESPACE
Describe the expanding/collapsing concept if not covered elsewhere.
\endomit
- \table 100%
- \row \li \inlineimage windowsvista-treeview.png Screenshot of a Windows Vista style tree view
- \li \inlineimage macintosh-treeview.png Screenshot of a Macintosh style tree view
- \li \inlineimage fusion-treeview.png Screenshot of a Fusion style tree view
- \row \li A \l{Windows Vista Style Widget Gallery}{Windows Vista style} tree view.
- \li A \l{Macintosh Style Widget Gallery}{Macintosh style} tree view.
- \li A \l{Fusion Style Widget Gallery}{Fusion style} tree view.
- \endtable
-
\section1 Improving Performance
It is possible to give the view hints about the data it is handling in order
diff --git a/src/widgets/itemviews/qtreewidget.cpp b/src/widgets/itemviews/qtreewidget.cpp
index 1338ce4585..8ce36ab47e 100644
--- a/src/widgets/itemviews/qtreewidget.cpp
+++ b/src/widgets/itemviews/qtreewidget.cpp
@@ -2354,6 +2354,8 @@ void QTreeWidgetPrivate::_q_dataChanged(const QModelIndex &topLeft,
\ingroup model-view
\inmodule QtWidgets
+ \image windows-treeview.png
+
The QTreeWidget class is a convenience class that provides a standard
tree widget with a classic item-based interface similar to that used by
the QListView class in Qt 3.
@@ -2387,15 +2389,6 @@ void QTreeWidgetPrivate::_q_dataChanged(const QModelIndex &topLeft,
\l{QTreeView::isSortingEnabled()}{isSortingEnabled()} function indicates
whether sorting is enabled.
- \table 100%
- \row \li \inlineimage windowsvista-treeview.png Screenshot of a Windows Vista style tree widget
- \li \inlineimage macintosh-treeview.png Screenshot of a Macintosh style tree widget
- \li \inlineimage fusion-treeview.png Screenshot of a Fusion style tree widget
- \row \li A \l{Windows Vista Style Widget Gallery}{Windows Vista style} tree widget.
- \li A \l{Macintosh Style Widget Gallery}{Macintosh style} tree widget.
- \li A \l{Fusion Style Widget Gallery}{Fusion style} tree widget.
- \endtable
-
\sa QTreeWidgetItem, QTreeWidgetItemIterator, QTreeView,
{Model/View Programming}, {Settings Editor Example}
*/
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 caa17e4aea..37114449ba 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -5847,7 +5847,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 7d7b553da1..653714743c 100644
--- a/src/widgets/kernel/qwidgetwindow.cpp
+++ b/src/widgets/kernel/qwidgetwindow.cpp
@@ -161,6 +161,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/qcheckbox.cpp b/src/widgets/widgets/qcheckbox.cpp
index d4ba17b08e..9b49916774 100644
--- a/src/widgets/widgets/qcheckbox.cpp
+++ b/src/widgets/widgets/qcheckbox.cpp
@@ -73,6 +73,8 @@ public:
\ingroup basicwidgets
\inmodule QtWidgets
+ \image windows-checkbox.png
+
A QCheckBox is an option button that can be switched on (checked) or off
(unchecked). Checkboxes are typically used to represent features in an
application that can be enabled or disabled without affecting others.
@@ -117,18 +119,6 @@ public:
setAutoRepeat(), toggle(), pressed(), released(), clicked(), toggled(),
checkState(), and stateChanged().
- \table 100%
- \row
- \li \inlineimage macintosh-checkbox.png Screenshot of a Macintosh style checkbox
- \li A checkbox shown in the \l{Macintosh Style Widget Gallery}{Macintosh widget style}.
- \row
- \li \inlineimage windowsvista-checkbox.png Screenshot of a Windows Vista style checkbox
- \li A checkbox shown in the \l{Windows Vista Style Widget Gallery}{Windows Vista widget style}.
- \row
- \li \inlineimage fusion-checkbox.png Screenshot of a Fusion style checkbox
- \li A checkbox shown in the \l{Fusion Style Widget Gallery}{Fusion widget style}.
- \endtable
-
\sa QAbstractButton, QRadioButton, {fowler}{GUI Design Handbook: Check Box}
*/
diff --git a/src/widgets/widgets/qcombobox.cpp b/src/widgets/widgets/qcombobox.cpp
index 4a49542fdd..29c51a2de1 100644
--- a/src/widgets/widgets/qcombobox.cpp
+++ b/src/widgets/widgets/qcombobox.cpp
@@ -909,6 +909,8 @@ QComboBox::QComboBox(QComboBoxPrivate &dd, QWidget *parent)
\ingroup basicwidgets
\inmodule QtWidgets
+ \image windows-combobox.png
+
A QComboBox provides a means of presenting a list of options to the user
in a way that takes up the minimum amount of screen space.
@@ -969,8 +971,6 @@ QComboBox::QComboBox(QComboBoxPrivate &dd, QWidget *parent)
of the view(), e.g., by using
\l{QAbstractItemView::}{setSelectionMode()}.
- \image qstyle-comboboxes.png Comboboxes in the different built-in styles.
-
\sa QLineEdit, QSpinBox, QRadioButton, QButtonGroup,
{fowler}{GUI Design Handbook: Combo Box, Drop-Down List Box}
*/
diff --git a/src/widgets/widgets/qdatetimeedit.cpp b/src/widgets/widgets/qdatetimeedit.cpp
index 0eaa110bee..2e0a8a3cd7 100644
--- a/src/widgets/widgets/qdatetimeedit.cpp
+++ b/src/widgets/widgets/qdatetimeedit.cpp
@@ -76,6 +76,8 @@ QT_BEGIN_NAMESPACE
\ingroup basicwidgets
\inmodule QtWidgets
+ \image windows-datetimeedit.png
+
QDateTimeEdit allows the user to edit dates by using the keyboard or
the arrow keys to increase and decrease date and time values. The
arrow keys can be used to move from section to section within the
@@ -103,15 +105,6 @@ QT_BEGIN_NAMESPACE
calendar pop-up by calling the setCalendarWidget() function. The existing
calendar widget can be retrieved with calendarWidget().
- \table 100%
- \row \li \inlineimage windowsvista-datetimeedit.png Screenshot of a Windows Vista style date time editing widget
- \li A date time editing widget shown in the \l{Windows Vista Style Widget Gallery}{Windows Vista widget style}.
- \row \li \inlineimage macintosh-datetimeedit.png Screenshot of a Macintosh style date time editing widget
- \li A date time editing widget shown in the \l{Macintosh Style Widget Gallery}{Macintosh widget style}.
- \row \li \inlineimage fusion-datetimeedit.png Screenshot of a Fusion style date time editing widget
- \li A date time editing widget shown in the \l{Fusion Style Widget Gallery}{Fusion widget style}.
- \endtable
-
\sa QDateEdit, QTimeEdit, QDate, QTime
*/
@@ -1505,6 +1498,8 @@ void QDateTimeEdit::mousePressEvent(QMouseEvent *event)
\ingroup basicwidgets
\inmodule QtWidgets
+ \image windows-timeedit.png
+
Many of the properties and functions provided by QTimeEdit are implemented in
QDateTimeEdit. These are the relevant properties of this class:
@@ -1518,15 +1513,6 @@ void QDateTimeEdit::mousePressEvent(QMouseEvent *event)
to format the time displayed in the widget.
\endlist
- \table 100%
- \row \li \inlineimage windowsvista-timeedit.png Screenshot of a Windows Vista style time editing widget
- \li A time editing widget shown in the \l{Windows Vista Style Widget Gallery}{Windows Vista widget style}.
- \row \li \inlineimage macintosh-timeedit.png Screenshot of a Macintosh style time editing widget
- \li A time editing widget shown in the \l{Macintosh Style Widget Gallery}{Macintosh widget style}.
- \row \li \inlineimage fusion-timeedit.png Screenshot of a Fusion style time editing widget
- \li A time editing widget shown in the \l{Fusion Style Widget Gallery}{Fusion widget style}.
- \endtable
-
\sa QDateEdit, QDateTimeEdit
*/
@@ -1582,6 +1568,8 @@ QTimeEdit::~QTimeEdit()
\ingroup basicwidgets
\inmodule QtWidgets
+ \image windows-dateedit.png
+
Many of the properties and functions provided by QDateEdit are implemented in
QDateTimeEdit. These are the relevant properties of this class:
@@ -1595,15 +1583,6 @@ QTimeEdit::~QTimeEdit()
to format the date displayed in the widget.
\endlist
- \table 100%
- \row \li \inlineimage windowsvista-dateedit.png Screenshot of a Windows Vista style date editing widget
- \li A date editing widget shown in the \l{Windows Vista Style Widget Gallery}{Windows Vista widget style}.
- \row \li \inlineimage macintosh-dateedit.png Screenshot of a Macintosh style date editing widget
- \li A date editing widget shown in the \l{Macintosh Style Widget Gallery}{Macintosh widget style}.
- \row \li \inlineimage fusion-dateedit.png Screenshot of a Fusion style date editing widget
- \li A date editing widget shown in the \l{Fusion Style Widget Gallery}{Fusion widget style}.
- \endtable
-
\sa QTimeEdit, QDateTimeEdit
*/
diff --git a/src/widgets/widgets/qdial.cpp b/src/widgets/widgets/qdial.cpp
index cee39e2ae3..a219e4ccb6 100644
--- a/src/widgets/widgets/qdial.cpp
+++ b/src/widgets/widgets/qdial.cpp
@@ -179,6 +179,8 @@ int QDialPrivate::valueFromPoint(const QPoint &p) const
\ingroup basicwidgets
\inmodule QtWidgets
+ \image windows-dial.png
+
QDial is used when the user needs to control a value within a
program-definable range, and the range either wraps around
(for example, with angles measured from 0 to 359 degrees) or the
@@ -226,16 +228,6 @@ int QDialPrivate::valueFromPoint(const QPoint &p) const
by \l {QAbstractSlider::singleStep} {singleStep}, and
\l {QAbstractSlider::pageStep} {pageStep}.
- \table
- \row \li \inlineimage fusion-dial.png Screenshot of a dial in the Fusion widget style
- \li \inlineimage windowsvista-dial.png Screenshot of a dial in the Windows Vista widget style
- \li \inlineimage macintosh-dial.png Screenshot of a dial in the Macintosh widget style
- \row \li {3,1} Dials shown in various widget styles (from left to right):
- \l{Fusion Style Widget Gallery}{Fusion},
- \l{Windows Vista Style Widget Gallery}{Windows Vista},
- \l{Macintosh Style Widget Gallery}{Macintosh}.
- \endtable
-
\sa QScrollBar, QSpinBox, QSlider, {fowler}{GUI Design Handbook: Slider}, {Sliders Example}
*/
diff --git a/src/widgets/widgets/qgroupbox.cpp b/src/widgets/widgets/qgroupbox.cpp
index fda68879d1..9e323df9a6 100644
--- a/src/widgets/widgets/qgroupbox.cpp
+++ b/src/widgets/widgets/qgroupbox.cpp
@@ -145,6 +145,8 @@ void QGroupBoxPrivate::click()
\ingroup geomanagement
\inmodule QtWidgets
+ \image windows-groupbox.png
+
A group box provides a frame, a title on top, a keyboard shortcut, and
displays various other widgets inside itself. The keyboard shortcut moves
keyboard focus to one of the group box's child widgets.
@@ -166,15 +168,6 @@ void QGroupBoxPrivate::click()
\snippet widgets/groupbox/window.cpp 2
- \table 100%
- \row \li \inlineimage windowsvista-groupbox.png Screenshot of a Windows Vista style group box
- \li \inlineimage macintosh-groupbox.png Screenshot of a Macintosh style group box
- \li \inlineimage fusion-groupbox.png Screenshot of a Fusion style group box
- \row \li A \l{Windows Vista Style Widget Gallery}{Windows Vista style} group box.
- \li A \l{Macintosh Style Widget Gallery}{Macintosh style} group box.
- \li A \l{Fusion Style Widget Gallery}{Fusion style} group box.
- \endtable
-
\sa QButtonGroup, {Group Box Example}
*/
diff --git a/src/widgets/widgets/qlabel.cpp b/src/widgets/widgets/qlabel.cpp
index 39e072234e..e3225800cc 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),
@@ -116,6 +116,8 @@ QLabelPrivate::~QLabelPrivate()
\ingroup basicwidgets
\inmodule QtWidgets
+ \image windows-label.png
+
QLabel is used for displaying text or an image. No user
interaction functionality is provided. The visual appearance of
the label can be configured in various ways, and it can be used
@@ -181,18 +183,6 @@ QLabelPrivate::~QLabelPrivate()
was a button (inheriting from QAbstractButton), triggering the
mnemonic would emulate a button click.
- \table 100%
- \row
- \li \inlineimage macintosh-label.png Screenshot of a Macintosh style label
- \li A label shown in the \l{Macintosh Style Widget Gallery}{Macintosh widget style}.
- \row
- \li \inlineimage fusion-label.png Screenshot of a Fusion style label
- \li A label shown in the \l{Fusion Style Widget Gallery}{Fusion widget style}.
- \row
- \li \inlineimage windowsvista-label.png Screenshot of a Windows Vista style label
- \li A label shown in the \l{Windows Vista Style Widget Gallery}{Windows Vista widget style}.
- \endtable
-
\sa QLineEdit, QTextEdit, QPixmap, QMovie,
{fowler}{GUI Design Handbook: Label}
*/
@@ -582,7 +572,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 +1005,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 +1206,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 +1266,7 @@ void QLabel::setMovie(QMovie *movie)
d->updateLabel();
}
-#endif // QT_NO_MOVIE
+#endif // QT_CONFIG(movie)
/*!
\internal
@@ -1309,7 +1299,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 +1319,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 +1334,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..282714843c 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"
@@ -74,6 +74,8 @@ public:
\ingroup basicwidgets
\inmodule QtWidgets
+ \image windows-lcdnumber.png
+
It can display a number in just about any size. It can display
decimal, hexadecimal, octal or binary numbers. It is easy to
connect to data sources using the display() slot, which is
@@ -103,17 +105,6 @@ public:
Incidentally, QLCDNumber is the very oldest part of Qt, tracing
its roots back to a BASIC program on the \l{Sinclair Spectrum}{Sinclair Spectrum}.
- \table
- \row \li
- \inlineimage windows-lcdnumber.png Screenshot of a Windows style LCD number widget
- \inlineimage windowsvista-lcdnumber.png Screenshot of a Windows Vista style LCD number widget
- \inlineimage macintosh-lcdnumber.png Screenshot of a Macintosh style LCD number widget
- \inlineimage fusion-lcdnumber.png Screenshot of a Fusion style LCD number widget
- \row \li LCD number widgets shown in various widget styles (from left to right):
- \l{Windows Style Widget Gallery}{Windows}, \l{Windows Vista Style Widget Gallery}{Windows Vista},
- \l{Macintosh Style Widget Gallery}{Macintosh}, \l{Fusion Style Widget Gallery}{Fusion}.
- \endtable
-
\sa QLabel, QFrame, {Digital Clock Example}, {Tetrix Example}
*/
@@ -1220,5 +1211,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/qlineedit.cpp b/src/widgets/widgets/qlineedit.cpp
index b7f19a3bcf..75e3524ab2 100644
--- a/src/widgets/widgets/qlineedit.cpp
+++ b/src/widgets/widgets/qlineedit.cpp
@@ -127,6 +127,8 @@ void QLineEdit::initStyleOption(QStyleOptionFrame *option) const
\ingroup basicwidgets
\inmodule QtWidgets
+ \image windows-lineedit.png
+
A line edit allows the user to enter and edit a single line of
plain text with a useful collection of editing functions,
including undo and redo, cut and paste, and drag and drop (see
@@ -141,7 +143,6 @@ void QLineEdit::initStyleOption(QStyleOptionFrame *option) const
on the same line edit, it is best to clear the validator or input mask to
prevent undefined behavior.
-
A related class is QTextEdit which allows multi-line, rich text
editing.
@@ -201,15 +202,6 @@ void QLineEdit::initStyleOption(QStyleOptionFrame *option) const
Any other key sequence that represents a valid character, will
cause the character to be inserted into the line edit.
- \table 100%
- \row \li \inlineimage macintosh-lineedit.png Screenshot of a Macintosh style line edit
- \li A line edit shown in the \l{Macintosh Style Widget Gallery}{Macintosh widget style}.
- \row \li \inlineimage windowsvista-lineedit.png Screenshot of a Windows Vista style line edit
- \li A line edit shown in the \l{Windows Vista Style Widget Gallery}{Windows Vista widget style}.
- \row \li \inlineimage fusion-lineedit.png Screenshot of a Fusion style line edit
- \li A line edit shown in the \l{Fusion Style Widget Gallery}{Fusion widget style}.
- \endtable
-
\sa QTextEdit, QLabel, QComboBox, {fowler}{GUI Design Handbook: Field, Entry}, {Line Edits Example}
*/
diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp
index 4567f7c2a3..955d445b24 100644
--- a/src/widgets/widgets/qmenu.cpp
+++ b/src/widgets/widgets/qmenu.cpp
@@ -1535,6 +1535,8 @@ void QMenu::initStyleOption(QStyleOptionMenuItem *option, const QAction *action)
\ingroup basicwidgets
\inmodule QtWidgets
+ \image fusion-menu.png
+
A menu widget is a selection menu. It can be either a pull-down
menu in a menu bar or a standalone context menu. Pull-down menus
are shown by the menu bar when the user clicks on the respective
@@ -1546,14 +1548,6 @@ void QMenu::initStyleOption(QStyleOptionMenuItem *option, const QAction *action)
response to button presses; these are just like context menus
except for how they are invoked.
- \table 100%
- \row
- \li \inlineimage fusion-menu.png
- \li \inlineimage macintosh-menu.png
- \endtable
- \caption Fig. A menu shown in \l{Fusion Style Widget Gallery}{Fusion widget style}
- and \l{Macintosh Style Widget Gallery}{Macintosh widget style}.
-
\section1 Actions
A menu consists of a list of action items. Actions are added with
diff --git a/src/widgets/widgets/qprogressbar.cpp b/src/widgets/widgets/qprogressbar.cpp
index 39faf2e458..e26673a010 100644
--- a/src/widgets/widgets/qprogressbar.cpp
+++ b/src/widgets/widgets/qprogressbar.cpp
@@ -177,6 +177,8 @@ bool QProgressBarPrivate::repaintRequired() const
\ingroup basicwidgets
\inmodule QtWidgets
+ \image windows-progressbar.png
+
A progress bar is used to give the user an indication of the
progress of an operation and to reassure them that the application
is still running.
@@ -198,15 +200,6 @@ bool QProgressBarPrivate::repaintRequired() const
example, when using QNetworkAccessManager to download items when
they are unable to determine the size of the item being downloaded.
- \table
- \row \li \inlineimage macintosh-progressbar.png Screenshot of a Macintosh style progress bar
- \li A progress bar shown in the Macintosh widget style.
- \row \li \inlineimage windowsvista-progressbar.png Screenshot of a Windows Vista style progress bar
- \li A progress bar shown in the Windows Vista widget style.
- \row \li \inlineimage fusion-progressbar.png Screenshot of a Fusion style progress bar
- \li A progress bar shown in the Fusion widget style.
- \endtable
-
\sa QProgressDialog, {fowler}{GUI Design Handbook: Progress Indicator}
*/
diff --git a/src/widgets/widgets/qpushbutton.cpp b/src/widgets/widgets/qpushbutton.cpp
index a4318681c9..57af09fef5 100644
--- a/src/widgets/widgets/qpushbutton.cpp
+++ b/src/widgets/widgets/qpushbutton.cpp
@@ -77,6 +77,8 @@ QT_BEGIN_NAMESPACE
\ingroup basicwidgets
\inmodule QtWidgets
+ \image windows-pushbutton.jpg
+
The push button, or command button, is perhaps the most commonly
used widget in any graphical user interface. Push (click) a button
to command the computer to perform some action, or to answer a
@@ -148,6 +150,11 @@ QT_BEGIN_NAMESPACE
button is probably not what you want. When in doubt, use a tool
button.
+ \note On \macos when a push button's width becomes smaller than 50 or
+ its height becomes smaller than 30, the button's corners are
+ changed from round to square. Use the setMinimumSize()
+ function to prevent this behavior.
+
A variation of a command button is a menu button. These provide
not just one command, but several, since when they are clicked
they pop up a menu of options. Use the method setMenu() to
@@ -156,20 +163,6 @@ QT_BEGIN_NAMESPACE
Other classes of buttons are option buttons (see QRadioButton) and
check boxes (see QCheckBox).
- \table 100%
- \row \li \inlineimage macintosh-pushbutton.png Screenshot of a Macintosh style push button
- \li A push button shown in the \l{Macintosh Style Widget Gallery}{Macintosh widget style}.
-
- Note that when a button's width becomes smaller than 50 or
- its height becomes smaller than 30, the button's corners are
- changed from round to square. Use the setMinimumSize()
- function to prevent this behavior.
-
- \row \li \inlineimage windowsvista-pushbutton.png Screenshot of a Windows Vista style push button
- \li A push button shown in the \l{Windows Vista Style Widget Gallery}{Windows Vista widget style}.
- \row \li \inlineimage fusion-pushbutton.png Screenshot of a Fusion style push button
- \li A push button shown in the \l{Fusion Style Widget Gallery}{Fusion widget style}.
- \endtable
In Qt, the QAbstractButton base class provides most of the modes
and other API, and QPushButton provides GUI logic.
diff --git a/src/widgets/widgets/qradiobutton.cpp b/src/widgets/widgets/qradiobutton.cpp
index 284c5f56cf..ac711d34c7 100644
--- a/src/widgets/widgets/qradiobutton.cpp
+++ b/src/widgets/widgets/qradiobutton.cpp
@@ -80,6 +80,8 @@ void QRadioButtonPrivate::init()
\ingroup basicwidgets
\inmodule QtWidgets
+ \image windows-radiobutton.png
+
A QRadioButton is an option button that can be switched on (checked) or
off (unchecked). Radio buttons typically present the user with a "one
of many" choice. In a group of radio buttons, only one radio button at
@@ -113,15 +115,6 @@ void QRadioButtonPrivate::init()
setDown(), isDown(), autoRepeat(), group(), setAutoRepeat(),
toggle(), pressed(), released(), clicked(), and toggled().
- \table 100%
- \row \li \inlineimage fusion-radiobutton.png Screenshot of a Fusion radio button
- \li A radio button shown in the \l{Fusion Style Widget Gallery}{Fusion widget style}.
- \row \li \inlineimage windowsvista-radiobutton.png Screenshot of a Windows Vista radio button
- \li A radio button shown in the \l{Windows Vista Style Widget Gallery}{Windows Vista widget style}.
- \row \li \inlineimage macintosh-radiobutton.png Screenshot of a Macintosh radio button
- \li A radio button shown in the \l{Macintosh Style Widget Gallery}{Macintosh widget style}.
- \endtable
-
\sa QPushButton, QToolButton, QCheckBox, {fowler}{GUI Design Handbook: Radio Button},
{Group Box Example}
*/
diff --git a/src/widgets/widgets/qscrollbar.cpp b/src/widgets/widgets/qscrollbar.cpp
index 79bfedb8c4..66f1a4c689 100644
--- a/src/widgets/widgets/qscrollbar.cpp
+++ b/src/widgets/widgets/qscrollbar.cpp
@@ -187,15 +187,6 @@ QT_BEGIN_NAMESPACE
Most GUI styles use the pageStep() value to calculate the size of the
slider.
- \table 100%
- \row \li \inlineimage macintosh-horizontalscrollbar.png Screenshot of a Macintosh style scroll bar
- \li A scroll bar shown in the \l{Macintosh Style Widget Gallery}{Macintosh widget style}.
- \row \li \inlineimage windowsvista-horizontalscrollbar.png Screenshot of a Windows Vista style scroll bar
- \li A scroll bar shown in the \l{Windows Vista Style Widget Gallery}{Windows Vista widget style}.
- \row \li \inlineimage fusion-horizontalscrollbar.png Screenshot of a Fusion style scroll bar
- \li A scroll bar shown in the \l{Fusion Style Widget Gallery}{Fusion widget style}.
- \endtable
-
\sa QScrollArea, QSlider, QDial, QSpinBox, {fowler}{GUI Design Handbook: Scroll Bar}, {Sliders Example}
*/
diff --git a/src/widgets/widgets/qslider.cpp b/src/widgets/widgets/qslider.cpp
index 744a43253a..356cbcfce7 100644
--- a/src/widgets/widgets/qslider.cpp
+++ b/src/widgets/widgets/qslider.cpp
@@ -203,6 +203,8 @@ QStyle::SubControl QSliderPrivate::newHoverControl(const QPoint &pos)
\ingroup basicwidgets
\inmodule QtWidgets
+ \image windows-slider.png
+
The slider is the classic widget for controlling a bounded value.
It lets the user move a slider handle along a horizontal or vertical
groove and translates the handle's position into an integer value
@@ -252,15 +254,6 @@ QStyle::SubControl QSliderPrivate::newHoverControl(const QPoint &pos)
\li End moves to the end (maximum).
\endlist
- \table 100%
- \row \li \inlineimage macintosh-slider.png Screenshot of a Macintosh slider
- \li A slider shown in the \l{Macintosh Style Widget Gallery}{Macintosh widget style}.
- \row \li \inlineimage windowsvista-slider.png Screenshot of a Windows Vista slider
- \li A slider shown in the \l{Windows Vista Style Widget Gallery}{Windows Vista widget style}.
- \row \li \inlineimage fusion-slider.png Screenshot of a Fusion slider
- \li A slider shown in the \l{Fusion Style Widget Gallery}{Fusion widget style}.
- \endtable
-
\sa QScrollBar, QSpinBox, QDial, {fowler}{GUI Design Handbook: Slider}, {Sliders Example}
*/
diff --git a/src/widgets/widgets/qspinbox.cpp b/src/widgets/widgets/qspinbox.cpp
index 0daa624ae8..508cb05cfc 100644
--- a/src/widgets/widgets/qspinbox.cpp
+++ b/src/widgets/widgets/qspinbox.cpp
@@ -112,6 +112,8 @@ public:
\ingroup basicwidgets
\inmodule QtWidgets
+ \image windows-spinbox.png
+
QSpinBox is designed to handle integers and discrete sets of
values (e.g., month names); use QDoubleSpinBox for floating point
values.
@@ -151,15 +153,6 @@ public:
choice in addition to the range of numeric values. See
setSpecialValueText() for how to do this with QSpinBox.
- \table 100%
- \row \li \inlineimage windowsvista-spinbox.png Screenshot of a Windows Vista spin box
- \li A spin box shown in the \l{Windows Vista Style Widget Gallery}{Windows Vista widget style}.
- \row \li \inlineimage fusion-spinbox.png Screenshot of a Fusion spin box
- \li A spin box shown in the \l{Fusion Style Widget Gallery}{Fusion widget style}.
- \row \li \inlineimage macintosh-spinbox.png Screenshot of a Macintosh spin box
- \li A spin box shown in the \l{Macintosh Style Widget Gallery}{Macintosh widget style}.
- \endtable
-
\section1 Subclassing QSpinBox
If using prefix(), suffix(), and specialValueText() don't provide
diff --git a/src/widgets/widgets/qsplashscreen.cpp b/src/widgets/widgets/qsplashscreen.cpp
index 85c63077eb..d1b59b5196 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/qtabwidget.cpp b/src/widgets/widgets/qtabwidget.cpp
index be870133ee..7c75f859ed 100644
--- a/src/widgets/widgets/qtabwidget.cpp
+++ b/src/widgets/widgets/qtabwidget.cpp
@@ -64,6 +64,8 @@ QT_BEGIN_NAMESPACE
\ingroup basicwidgets
\inmodule QtWidgets
+ \image windows-tabwidget.png
+
A tab widget provides a tab bar (see QTabBar) and a "page area"
that is used to display pages related to each tab. By default, the
tab bar is shown above the page area, but different configurations
@@ -117,15 +119,6 @@ QT_BEGIN_NAMESPACE
(at the top, providing the tabs) and a QStackedWidget (most of the
area, organizing the individual pages).
- \table 100%
- \row \li \inlineimage windowsvista-tabwidget.png Screenshot of a Windows Vista style tab widget
- \li \inlineimage macintosh-tabwidget.png Screenshot of a Macintosh style tab widget
- \li \inlineimage fusion-tabwidget.png Screenshot of a Fusion style tab widget
- \row \li A Windows Vista style tab widget.
- \li A Macintosh style tab widget.
- \li A Fusion style tab widget.
- \endtable
-
\sa QTabBar, QStackedWidget, QToolBox, {Tab Dialog Example}
*/
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/qgetputenv/tst_qgetputenv.cpp b/tests/auto/corelib/global/qgetputenv/tst_qgetputenv.cpp
index 66fc578d5f..09abb953ba 100644
--- a/tests/auto/corelib/global/qgetputenv/tst_qgetputenv.cpp
+++ b/tests/auto/corelib/global/qgetputenv/tst_qgetputenv.cpp
@@ -97,17 +97,33 @@ void tst_QGetPutEnv::intValue_data()
QTest::addColumn<int>("expected");
QTest::addColumn<bool>("ok");
- // most non-success cases already tested in getSetCheck()
+ // some repetition from what is tested in getSetCheck()
+ QTest::newRow("empty") << QByteArray() << 0 << false;
+ QTest::newRow("spaces-heading") << QByteArray(" 1") << 1 << true;
+ QTest::newRow("spaces-trailing") << QByteArray("1 ") << 0 << false;
#define ROW(x, i, b) \
QTest::newRow(#x) << QByteArray(#x) << (i) << (b)
ROW(auto, 0, false);
+ ROW(1auto, 0, false);
ROW(0, 0, true);
+ ROW(+0, 0, true);
ROW(1, 1, true);
+ ROW(+1, 1, true);
+ ROW(09, 0, false);
ROW(010, 8, true);
ROW(0x10, 16, true);
+ ROW(0x, 0, false);
+ ROW(0xg, 0, false);
+ ROW(0x1g, 0, false);
+ ROW(000000000000000000000000000000000000000000000000001, 0, false);
+ ROW(+000000000000000000000000000000000000000000000000001, 0, false);
+ ROW(000000000000000000000000000000000000000000000000001g, 0, false);
+ ROW(-0, 0, true);
ROW(-1, -1, true);
ROW(-010, -8, true);
+ ROW(-000000000000000000000000000000000000000000000000001, 0, false);
+ ROW(2147483648, 0, false);
// ROW(0xffffffff, -1, true); // could be expected, but not how QByteArray::toInt() works
ROW(0xffffffff, 0, false);
const int bases[] = {10, 8, 16};
@@ -125,6 +141,7 @@ void tst_QGetPutEnv::intValue_data()
void tst_QGetPutEnv::intValue()
{
+ const int maxlen = (sizeof(int) * CHAR_BIT + 2) / 3;
const char varName[] = "should_not_exist";
QFETCH(QByteArray, value);
@@ -133,6 +150,13 @@ void tst_QGetPutEnv::intValue()
bool actualOk = !ok;
+ // Self-test: confirm that it was like the docs said it should be
+ if (value.length() < maxlen) {
+ QCOMPARE(value.toInt(&actualOk, 0), expected);
+ QCOMPARE(actualOk, ok);
+ }
+
+ actualOk = !ok;
QVERIFY(qputenv(varName, value));
QCOMPARE(qEnvironmentVariableIntValue(varName), expected);
QCOMPARE(qEnvironmentVariableIntValue(varName, &actualOk), expected);
diff --git a/tests/auto/corelib/global/qlogging/tst_qlogging.cpp b/tests/auto/corelib/global/qlogging/tst_qlogging.cpp
index bb8bb6cc21..3465385ba7 100644
--- a/tests/auto/corelib/global/qlogging/tst_qlogging.cpp
+++ b/tests/auto/corelib/global/qlogging/tst_qlogging.cpp
@@ -100,11 +100,11 @@ tst_qmessagehandler::tst_qmessagehandler()
void tst_qmessagehandler::initTestCase()
{
+#if QT_CONFIG(process)
m_appDir = QFINDTESTDATA("app");
QVERIFY2(!m_appDir.isEmpty(), qPrintable(
QString::fromLatin1("Couldn't find helper app dir starting from %1.").arg(QDir::currentPath())));
-#if QT_CONFIG(process)
m_baseEnvironment = QProcess::systemEnvironment();
for (int i = 0; i < m_baseEnvironment.count(); ++i) {
if (m_baseEnvironment.at(i).startsWith("QT_MESSAGE_PATTERN=")) {
diff --git a/tests/auto/corelib/io/qfile/tst_qfile.cpp b/tests/auto/corelib/io/qfile/tst_qfile.cpp
index 9b12aa9616..f97501e8a6 100644
--- a/tests/auto/corelib/io/qfile/tst_qfile.cpp
+++ b/tests/auto/corelib/io/qfile/tst_qfile.cpp
@@ -412,8 +412,10 @@ static QByteArray msgFileDoesNotExist(const QString &name)
void tst_QFile::initTestCase()
{
QVERIFY2(m_temporaryDir.isValid(), qPrintable(m_temporaryDir.errorString()));
+#if QT_CONFIG(process)
m_stdinProcessDir = QFINDTESTDATA("stdinprocess");
QVERIFY(!m_stdinProcessDir.isEmpty());
+#endif
m_testSourceFile = QFINDTESTDATA("tst_qfile.cpp");
QVERIFY(!m_testSourceFile.isEmpty());
m_testLogFile = QFINDTESTDATA("testlog.txt");
diff --git a/tests/auto/corelib/itemmodels/qabstractitemmodel/tst_qabstractitemmodel.cpp b/tests/auto/corelib/itemmodels/qabstractitemmodel/tst_qabstractitemmodel.cpp
index dcd9eda4bb..9f67ccd9c9 100644
--- a/tests/auto/corelib/itemmodels/qabstractitemmodel/tst_qabstractitemmodel.cpp
+++ b/tests/auto/corelib/itemmodels/qabstractitemmodel/tst_qabstractitemmodel.cpp
@@ -101,6 +101,7 @@ private slots:
void testRoleNames();
void testDragActions();
+ void dragActionsFallsBackToDropActions();
void testFunctionPointerSignalConnection();
@@ -2157,6 +2158,27 @@ void tst_QAbstractItemModel::testDragActions()
QVERIFY(actions & Qt::MoveAction);
}
+class OverrideDropActions : public QStringListModel
+{
+ Q_OBJECT
+public:
+ OverrideDropActions(QObject *parent = 0)
+ : QStringListModel(parent)
+ {
+ }
+ Qt::DropActions supportedDropActions() const override
+ {
+ return Qt::MoveAction;
+ }
+};
+
+void tst_QAbstractItemModel::dragActionsFallsBackToDropActions()
+{
+ QAbstractItemModel *model = new OverrideDropActions(this);
+ QCOMPARE(model->supportedDragActions(), Qt::MoveAction);
+ QCOMPARE(model->supportedDropActions(), Qt::MoveAction);
+}
+
class SignalConnectionTester : public QObject
{
Q_OBJECT
diff --git a/tests/auto/corelib/itemmodels/qstringlistmodel/tst_qstringlistmodel.cpp b/tests/auto/corelib/itemmodels/qstringlistmodel/tst_qstringlistmodel.cpp
index f99241da3b..adc8c59bf7 100644
--- a/tests/auto/corelib/itemmodels/qstringlistmodel/tst_qstringlistmodel.cpp
+++ b/tests/auto/corelib/itemmodels/qstringlistmodel/tst_qstringlistmodel.cpp
@@ -80,6 +80,8 @@ private slots:
void setData_emits_both_roles_data();
void setData_emits_both_roles();
+
+ void supportedDragDropActions();
};
void tst_QStringListModel::rowsAboutToBeRemoved_rowsRemoved_data()
@@ -250,5 +252,12 @@ void tst_QStringListModel::setData_emits_both_roles()
expected);
}
+void tst_QStringListModel::supportedDragDropActions()
+{
+ QStringListModel model;
+ QCOMPARE(model.supportedDragActions(), Qt::CopyAction | Qt::MoveAction);
+ QCOMPARE(model.supportedDropActions(), Qt::CopyAction | Qt::MoveAction);
+}
+
QTEST_MAIN(tst_QStringListModel)
#include "tst_qstringlistmodel.moc"
diff --git a/tests/auto/corelib/kernel/qtimer/BLACKLIST b/tests/auto/corelib/kernel/qtimer/BLACKLIST
index e5136624d8..b355bc22c2 100644
--- a/tests/auto/corelib/kernel/qtimer/BLACKLIST
+++ b/tests/auto/corelib/kernel/qtimer/BLACKLIST
@@ -1,3 +1,5 @@
[remainingTime]
windows
osx
+[basic_chrono]
+osx ci
diff --git a/tests/auto/corelib/thread/qsemaphore/BLACKLIST b/tests/auto/corelib/thread/qsemaphore/BLACKLIST
index c198b90253..eb83b03556 100644
--- a/tests/auto/corelib/thread/qsemaphore/BLACKLIST
+++ b/tests/auto/corelib/thread/qsemaphore/BLACKLIST
@@ -3,3 +3,4 @@ windows
osx-10.12
[tryAcquireWithTimeout:2s]
windows
+osx-10.12
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/gui/itemmodels/qstandarditemmodel/tst_qstandarditemmodel.cpp b/tests/auto/gui/itemmodels/qstandarditemmodel/tst_qstandarditemmodel.cpp
index dca718a6d8..cff26be7bb 100644
--- a/tests/auto/gui/itemmodels/qstandarditemmodel/tst_qstandarditemmodel.cpp
+++ b/tests/auto/gui/itemmodels/qstandarditemmodel/tst_qstandarditemmodel.cpp
@@ -125,6 +125,7 @@ private slots:
void itemRoleNames();
void getMimeDataWithInvalidModelIndex();
+ void supportedDragDropActions();
private:
QAbstractItemModel *m_model;
@@ -1666,5 +1667,12 @@ void tst_QStandardItemModel::getMimeDataWithInvalidModelIndex()
QVERIFY(!data);
}
+void tst_QStandardItemModel::supportedDragDropActions()
+{
+ QStandardItemModel model;
+ QCOMPARE(model.supportedDragActions(), Qt::CopyAction | Qt::MoveAction);
+ QCOMPARE(model.supportedDropActions(), Qt::CopyAction | Qt::MoveAction);
+}
+
QTEST_MAIN(tst_QStandardItemModel)
#include "tst_qstandarditemmodel.moc"
diff --git a/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp b/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp
index 757e4d16e4..16215714f3 100644
--- a/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp
+++ b/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp
@@ -699,9 +699,11 @@ void tst_QPainterPath::testOperatorDatastream()
path.addRect(0, 0, 100, 100);
path.setFillRule(Qt::WindingFill);
+ QTemporaryDir tempDir(QDir::tempPath() + "/tst_qpainterpath.XXXXXX");
+ QVERIFY2(tempDir.isValid(), qPrintable(tempDir.errorString()));
// Write out
{
- QFile data("data");
+ QFile data(tempDir.path() + "/data");
bool ok = data.open(QFile::WriteOnly);
QVERIFY(ok);
QDataStream stream(&data);
@@ -711,7 +713,7 @@ void tst_QPainterPath::testOperatorDatastream()
QPainterPath other;
// Read in
{
- QFile data("data");
+ QFile data(tempDir.path() + "/data");
bool ok = data.open(QFile::ReadOnly);
QVERIFY(ok);
QDataStream stream(&data);
diff --git a/tests/auto/gui/text/qfont/tst_qfont.cpp b/tests/auto/gui/text/qfont/tst_qfont.cpp
index 1f826c01cf..7d230d3bb3 100644
--- a/tests/auto/gui/text/qfont/tst_qfont.cpp
+++ b/tests/auto/gui/text/qfont/tst_qfont.cpp
@@ -515,7 +515,7 @@ void tst_QFont::defaultFamily_data()
QTest::newRow("monospace") << QFont::Monospace << (QStringList() << "Courier New" << "Monaco" << "Droid Sans Mono" << getPlatformGenericFont("monospace").split(","));
QTest::newRow("cursive") << QFont::Cursive << (QStringList() << "Comic Sans MS" << "Apple Chancery" << "Roboto" << "Droid Sans" << getPlatformGenericFont("cursive").split(","));
QTest::newRow("fantasy") << QFont::Fantasy << (QStringList() << "Impact" << "Zapfino" << "Roboto" << "Droid Sans" << getPlatformGenericFont("fantasy").split(","));
- QTest::newRow("sans-serif") << QFont::SansSerif << (QStringList() << "Arial" << "Lucida Grande" << "Roboto" << "Droid Sans" << getPlatformGenericFont("sans-serif").split(","));
+ QTest::newRow("sans-serif") << QFont::SansSerif << (QStringList() << "Arial" << "Lucida Grande" << "Roboto" << "Droid Sans" << "Segoe UI" << getPlatformGenericFont("sans-serif").split(","));
}
void tst_QFont::defaultFamily()
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/lancelot/lancelot.pro b/tests/auto/other/lancelot/lancelot.pro
index 73c12e67a2..6ece7315ed 100644
--- a/tests/auto/other/lancelot/lancelot.pro
+++ b/tests/auto/other/lancelot/lancelot.pro
@@ -1,6 +1,6 @@
CONFIG += testcase
TARGET = tst_lancelot
-QT += testlib
+QT += testlib gui-private
SOURCES += tst_lancelot.cpp \
paintcommands.cpp
diff --git a/tests/auto/other/lancelot/paintcommands.cpp b/tests/auto/other/lancelot/paintcommands.cpp
index c28812e120..8419f93e3b 100644
--- a/tests/auto/other/lancelot/paintcommands.cpp
+++ b/tests/auto/other/lancelot/paintcommands.cpp
@@ -36,6 +36,7 @@
#include <qtextlayout.h>
#include <qdebug.h>
#include <QStaticText>
+#include <private/qimage_p.h>
#ifndef QT_NO_OPENGL
#include <QOpenGLFramebufferObjectFormat>
@@ -2402,7 +2403,13 @@ void PaintCommands::command_surface_begin(QRegExp re)
m_painter = new QPainter(&m_surface_pixmap);
#endif
} else {
- m_surface_image = QImage(qRound(w), qRound(h), QImage::Format_ARGB32_Premultiplied);
+ QImage::Format surface_format;
+ if (QImage::toPixelFormat(m_format).alphaUsage() != QPixelFormat::UsesAlpha)
+ surface_format = qt_alphaVersion(m_format);
+ else
+ surface_format = m_format;
+
+ m_surface_image = QImage(qRound(w), qRound(h), surface_format);
m_surface_image.fill(0);
m_painter = new QPainter(&m_surface_image);
}
diff --git a/tests/auto/other/lancelot/paintcommands.h b/tests/auto/other/lancelot/paintcommands.h
index 4113fd6881..fc7496ce11 100644
--- a/tests/auto/other/lancelot/paintcommands.h
+++ b/tests/auto/other/lancelot/paintcommands.h
@@ -68,9 +68,10 @@ class PaintCommands
{
public:
// construction / initialization
- PaintCommands(const QStringList &cmds, int w, int h)
+ PaintCommands(const QStringList &cmds, int w, int h, QImage::Format format)
: m_painter(0)
, m_surface_painter(0)
+ , m_format(format)
, m_commands(cmds)
, m_gradientSpread(QGradient::PadSpread)
, m_gradientCoordinate(QGradient::LogicalMode)
@@ -246,8 +247,8 @@ private:
// attributes
QPainter *m_painter;
QPainter *m_surface_painter;
+ QImage::Format m_format;
QImage m_surface_image;
- QPixmap m_surface_pixmap;
QRectF m_surface_rect;
QStringList m_commands;
QString m_currentCommand;
diff --git a/tests/auto/other/lancelot/scripts/porter_duff.qps b/tests/auto/other/lancelot/scripts/porter_duff.qps
index 166e48a57f..94e9c68522 100644
--- a/tests/auto/other/lancelot/scripts/porter_duff.qps
+++ b/tests/auto/other/lancelot/scripts/porter_duff.qps
@@ -184,7 +184,7 @@ repeat_block postdraw
surface_end
-# Multiply
+# ColorBurn
surface_begin 100 300 100 100
repeat_block predraw
setCompositionMode ColorBurn
@@ -192,7 +192,7 @@ repeat_block postdraw
surface_end
-# Screen
+# HardLight
surface_begin 200 300 100 100
repeat_block predraw
setCompositionMode HardLight
@@ -200,7 +200,7 @@ repeat_block postdraw
surface_end
-# Overlay
+# SoftLight
surface_begin 300 300 100 100
repeat_block predraw
setCompositionMode SoftLight
@@ -208,7 +208,7 @@ repeat_block postdraw
surface_end
-# Darken
+# Difference
surface_begin 400 300 100 100
repeat_block predraw
setCompositionMode Difference
@@ -216,7 +216,7 @@ repeat_block postdraw
surface_end
-# Lighten
+# Exclusion
surface_begin 500 300 100 100
repeat_block predraw
setCompositionMode Exclusion
@@ -248,4 +248,4 @@ drawText 100 500 "ColorBurn"
drawText 200 500 "HardLight"
drawText 300 500 "SoftLight"
drawText 400 500 "Difference"
-drawText 500 500 "Exclusion" \ No newline at end of file
+drawText 500 500 "Exclusion"
diff --git a/tests/auto/other/lancelot/scripts/porter_duff2.qps b/tests/auto/other/lancelot/scripts/porter_duff2.qps
index a792d9b278..f538371ca1 100644
--- a/tests/auto/other/lancelot/scripts/porter_duff2.qps
+++ b/tests/auto/other/lancelot/scripts/porter_duff2.qps
@@ -194,7 +194,7 @@ repeat_block postdraw
surface_end
-# Multiply
+# ColorBurn
surface_begin 100 300 100 100
repeat_block predraw
setCompositionMode ColorBurn
@@ -202,7 +202,7 @@ repeat_block postdraw
surface_end
-# Screen
+# HardLight
surface_begin 200 300 100 100
repeat_block predraw
setCompositionMode HardLight
@@ -210,7 +210,7 @@ repeat_block postdraw
surface_end
-# Overlay
+# SoftLight
surface_begin 300 300 100 100
repeat_block predraw
setCompositionMode SoftLight
@@ -218,7 +218,7 @@ repeat_block postdraw
surface_end
-# Darken
+# Difference
surface_begin 400 300 100 100
repeat_block predraw
setCompositionMode Difference
@@ -226,7 +226,7 @@ repeat_block postdraw
surface_end
-# Lighten
+# Exclusion
surface_begin 500 300 100 100
repeat_block predraw
setCompositionMode Exclusion
@@ -258,4 +258,4 @@ drawText 100 500 "ColorBurn"
drawText 200 500 "HardLight"
drawText 300 500 "SoftLight"
drawText 400 500 "Difference"
-drawText 500 500 "Exclusion" \ No newline at end of file
+drawText 500 500 "Exclusion"
diff --git a/tests/auto/other/lancelot/tst_lancelot.cpp b/tests/auto/other/lancelot/tst_lancelot.cpp
index 63c62bab86..79d0f7c6cf 100644
--- a/tests/auto/other/lancelot/tst_lancelot.cpp
+++ b/tests/auto/other/lancelot/tst_lancelot.cpp
@@ -54,7 +54,7 @@ private:
void setupTestSuite(const QStringList& blacklist = QStringList());
void runTestSuite(GraphicsEngine engine, QImage::Format format, const QSurfaceFormat &contextFormat = QSurfaceFormat());
- void paint(QPaintDevice *device, GraphicsEngine engine, const QStringList &script, const QString &filePath);
+ void paint(QPaintDevice *device, GraphicsEngine engine, QImage::Format format, const QStringList &script, const QString &filePath);
QStringList qpsFiles;
QHash<QString, QStringList> scripts;
@@ -318,7 +318,7 @@ void tst_Lancelot::runTestSuite(GraphicsEngine engine, QImage::Format format, co
if (engine == Raster) {
QImage img(800, 800, format);
- paint(&img, engine, script, QFileInfo(filePath).absoluteFilePath());
+ paint(&img, engine, format, script, QFileInfo(filePath).absoluteFilePath());
rendered = img;
#ifndef QT_NO_OPENGL
} else if (engine == OpenGL) {
@@ -336,7 +336,7 @@ void tst_Lancelot::runTestSuite(GraphicsEngine engine, QImage::Format format, co
QOpenGLFramebufferObject fbo(800, 800, fmt);
fbo.bind();
QOpenGLPaintDevice pdv(800, 800);
- paint(&pdv, engine, script, QFileInfo(filePath).absoluteFilePath());
+ paint(&pdv, engine, format, script, QFileInfo(filePath).absoluteFilePath());
rendered = fbo.toImage().convertToFormat(format);
#endif
}
@@ -344,10 +344,10 @@ void tst_Lancelot::runTestSuite(GraphicsEngine engine, QImage::Format format, co
QBASELINE_TEST(rendered);
}
-void tst_Lancelot::paint(QPaintDevice *device, GraphicsEngine engine, const QStringList &script, const QString &filePath)
+void tst_Lancelot::paint(QPaintDevice *device, GraphicsEngine engine, QImage::Format format, const QStringList &script, const QString &filePath)
{
QPainter p(device);
- PaintCommands pcmd(script, 800, 800);
+ PaintCommands pcmd(script, 800, 800, format);
//pcmd.setShouldDrawText(false);
switch (engine) {
case OpenGL:
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/itemviews/qheaderview/tst_qheaderview.cpp b/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp
index 7bfec2831d..b13e7b2f33 100644
--- a/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp
+++ b/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp
@@ -171,6 +171,7 @@ private slots:
void saveRestore();
void restoreQt4State();
void restoreToMoreColumns();
+ void restoreToMoreColumnsNoMovedColumns();
void restoreBeforeSetModel();
void defaultSectionSizeTest();
void defaultSectionSizeTestStyles();
@@ -1690,6 +1691,55 @@ void tst_QHeaderView::restoreToMoreColumns()
QCOMPARE(h4.hiddenSectionCount(), 1);
QCOMPARE(h4.sortIndicatorSection(), 2);
QCOMPARE(h4.sortIndicatorOrder(), Qt::DescendingOrder);
+ QCOMPARE(h4.logicalIndex(0), 2);
+ QCOMPARE(h4.logicalIndex(1), 1);
+ QCOMPARE(h4.logicalIndex(2), 0);
+ QCOMPARE(h4.visualIndex(0), 2);
+ QCOMPARE(h4.visualIndex(1), 1);
+ QCOMPARE(h4.visualIndex(2), 0);
+
+ // Repainting shouldn't crash
+ h4.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&h4));
+}
+
+void tst_QHeaderView::restoreToMoreColumnsNoMovedColumns()
+{
+ // Given a model with 2 columns, for saving state
+ QHeaderView h1(Qt::Horizontal);
+ QStandardItemModel model1(1, 2);
+ h1.setModel(&model1);
+ QCOMPARE(h1.visualIndex(0), 0);
+ QCOMPARE(h1.visualIndex(1), 1);
+ QCOMPARE(h1.logicalIndex(0), 0);
+ QCOMPARE(h1.logicalIndex(1), 1);
+ const QByteArray savedState = h1.saveState();
+
+ // And a model with 3 columns, to apply that state upon
+ QHeaderView h2(Qt::Horizontal);
+ QStandardItemModel model2(1, 3);
+ h2.setModel(&model2);
+ QCOMPARE(h2.visualIndex(0), 0);
+ QCOMPARE(h2.visualIndex(1), 1);
+ QCOMPARE(h2.visualIndex(2), 2);
+ QCOMPARE(h2.logicalIndex(0), 0);
+ QCOMPARE(h2.logicalIndex(1), 1);
+ QCOMPARE(h2.logicalIndex(2), 2);
+
+ // When calling restoreState()
+ QVERIFY(h2.restoreState(savedState));
+
+ // Then the index mapping should still be as default
+ QCOMPARE(h2.visualIndex(0), 0);
+ QCOMPARE(h2.visualIndex(1), 1);
+ QCOMPARE(h2.visualIndex(2), 2);
+ QCOMPARE(h2.logicalIndex(0), 0);
+ QCOMPARE(h2.logicalIndex(1), 1);
+ QCOMPARE(h2.logicalIndex(2), 2);
+
+ // And repainting shouldn't crash
+ h2.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&h2));
}
void tst_QHeaderView::restoreBeforeSetModel()
diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
index 08f6a8e7e4..1f4d2e262d 100644
--- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
+++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
@@ -8528,8 +8528,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);
}