summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-09-15 19:47:57 +0200
committerLiang Qi <liang.qi@qt.io>2016-09-15 19:47:57 +0200
commit40a1f69e8663fb79560c26cfad5ead45b1b3ee5f (patch)
treea8ceb093a098a38b29c0fe27e41af480ae10b876 /src
parent446afc10451d5097d7bd20b1b8d20325c4d54fa5 (diff)
parent6b2071c697d4c48f0cd289b28b443ebffc3432e6 (diff)
Merge remote-tracking branch 'origin/5.8' into dev
Conflicts: configure.json mkspecs/macx-tvos-clang/qmake.conf mkspecs/macx-watchos-clang/qmake.conf Change-Id: Iaf32339ace59dff9ed344972472744c55d75025c
Diffstat (limited to 'src')
-rw-r--r--src/3rdparty/freetype/freetype.pro2
-rw-r--r--src/3rdparty/pcre_dependency.pri6
-rw-r--r--src/angle/src/common/common.pri1
-rw-r--r--src/angle/src/compiler/preprocessor/preprocessor.pro1
-rw-r--r--src/angle/src/compiler/translator.pro1
-rw-r--r--src/corelib/configure.json611
-rw-r--r--src/corelib/corelib.pro3
-rw-r--r--src/corelib/global/qcompilerdetection.h4
-rw-r--r--src/corelib/global/qglobal.h9
-rw-r--r--src/corelib/global/qglobal_p.h1
-rw-r--r--src/corelib/global/qlibraryinfo.cpp8
-rw-r--r--src/corelib/io/qtextstream.cpp1
-rw-r--r--src/corelib/tools/qbytearray.cpp7
-rw-r--r--src/corelib/tools/qlocale_win.cpp44
-rw-r--r--src/corelib/tools/tools.pri2
-rw-r--r--src/gui/configure.json1095
-rw-r--r--src/gui/configure.pri67
-rw-r--r--src/gui/image/qicon.cpp47
-rw-r--r--src/gui/image/qiconloader.cpp2
-rw-r--r--src/gui/kernel/qtguiglobal.h1
-rw-r--r--src/gui/kernel/qtguiglobal_p.h1
-rw-r--r--src/gui/kernel/qwindow.cpp3
-rw-r--r--src/gui/kernel/qwindow_p.h10
-rw-r--r--src/gui/opengl/qopengl.h7
-rw-r--r--src/gui/opengl/qopenglframebufferobject.cpp2
-rw-r--r--src/gui/painting/painting.pri1
-rw-r--r--src/gui/painting/qcolor.cpp323
-rw-r--r--src/gui/painting/qcolor_p.cpp369
-rw-r--r--src/gui/painting/qdrawhelper.cpp184
-rw-r--r--src/gui/painting/qdrawhelper_p.h16
-rw-r--r--src/gui/painting/qdrawhelper_ssse3.cpp9
-rw-r--r--src/gui/painting/qdrawingprimitive_sse2_p.h24
-rw-r--r--src/gui/text/qfontdatabase.cpp11
-rw-r--r--src/gui/text/qplatformfontdatabase.cpp6
-rw-r--r--src/gui/text/qtextimagehandler.cpp4
-rw-r--r--src/network/configure.json274
-rw-r--r--src/network/configure.pri12
-rw-r--r--src/network/kernel/qnetworkproxy_mac.cpp80
-rw-r--r--src/network/kernel/qtnetworkglobal.h1
-rw-r--r--src/network/kernel/qtnetworkglobal_p.h1
-rw-r--r--src/network/socket/qnativesocketengine_winrt.cpp2
-rw-r--r--src/network/ssl/qsslcertificate.cpp2
-rw-r--r--src/platformsupport/cglconvenience/cglconvenience.mm5
-rw-r--r--src/platformsupport/fbconvenience/qfbvthandler_p.h1
-rw-r--r--src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp8
-rw-r--r--src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase_p.h1
-rw-r--r--src/platformsupport/input/evdevtouch/qevdevtouchhandler_p.h1
-rw-r--r--src/platformsupport/themes/qabstractfileiconengine.cpp3
-rw-r--r--src/plugins/bearer/bearer.pro1
-rw-r--r--src/plugins/bearer/connman/qconnmanengine.cpp16
-rw-r--r--src/plugins/bearer/connman/qconnmanservice_linux.cpp14
-rw-r--r--src/plugins/bearer/linux_common/qofonoservice_linux.cpp12
-rw-r--r--src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp74
-rw-r--r--src/plugins/bearer/qnetworksession_impl.cpp6
-rw-r--r--src/plugins/generic/generic.pro5
-rw-r--r--src/plugins/generic/tuiotouch/qoscbundle.cpp23
-rw-r--r--src/plugins/generic/tuiotouch/qoscbundle_p.h19
-rw-r--r--src/plugins/generic/tuiotouch/qoscmessage.cpp25
-rw-r--r--src/plugins/generic/tuiotouch/qoscmessage_p.h18
-rw-r--r--src/plugins/generic/tuiotouch/qtuiocursor_p.h1
-rw-r--r--src/plugins/generic/tuiotouch/qtuiohandler.cpp23
-rw-r--r--src/plugins/generic/tuiotouch/qtuiotoken_p.h1
-rw-r--r--src/plugins/generic/tuiotouch/tuiotouch.pro1
-rw-r--r--src/plugins/imageformats/imageformats.pro1
-rw-r--r--src/plugins/platforminputcontexts/platforminputcontexts.pro1
-rw-r--r--src/plugins/platforms/cocoa/qcocoaglcontext.mm10
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/deviceintegration.pro1
-rw-r--r--src/plugins/platforms/platforms.pro1
-rw-r--r--src/plugins/platforms/windows/qwindowsdialoghelpers.cpp13
-rw-r--r--src/plugins/platforms/winrt/qwinrtinputcontext.cpp29
-rw-r--r--src/plugins/platforms/winrt/qwinrtinputcontext.h4
-rw-r--r--src/plugins/platforms/winrt/qwinrtintegration.cpp2
-rw-r--r--src/plugins/platforms/winrt/qwinrtscreen.cpp83
-rw-r--r--src/plugins/platforms/winrt/qwinrtscreen.h5
-rw-r--r--src/plugins/platforms/xcb/gl_integrations/gl_integrations.pro1
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection.h5
-rw-r--r--src/plugins/platforms/xcb/qxcbmime.cpp4
-rw-r--r--src/plugins/platforms/xcb/qxcbnativeinterface.cpp4
-rw-r--r--src/plugins/platforms/xcb/qxcbnativeinterface.h1
-rw-r--r--src/plugins/platforms/xcb/qxcbscreen.cpp4
-rw-r--r--src/plugins/platforms/xcb/qxcbscreen.h2
-rw-r--r--src/plugins/platforms/xcb/xcb.pro1
-rw-r--r--src/plugins/platformthemes/platformthemes.pro3
-rw-r--r--src/plugins/plugins.pro11
-rw-r--r--src/plugins/printsupport/printsupport.pro2
-rw-r--r--src/plugins/sqldrivers/psql/qsql_psql.cpp4
-rw-r--r--src/plugins/sqldrivers/sqldrivers.pro19
-rw-r--r--src/printsupport/configure.json72
-rw-r--r--src/printsupport/dialogs/qprintdialog_unix.cpp1
-rw-r--r--src/printsupport/dialogs/qprintdialog_win.cpp2
-rw-r--r--src/printsupport/kernel/qpaintengine_alpha.cpp2
-rw-r--r--src/printsupport/kernel/qplatformprintplugin.cpp4
-rw-r--r--src/printsupport/kernel/qplatformprintplugin.h4
-rw-r--r--src/printsupport/kernel/qprintengine_win.cpp6
-rw-r--r--src/printsupport/kernel/qprintengine_win_p.h6
-rw-r--r--src/printsupport/kernel/qtprintsupportglobal.h1
-rw-r--r--src/sql/configure.json201
-rw-r--r--src/sql/configure.pri89
-rw-r--r--src/src.pro14
-rw-r--r--src/testlib/qteamcitylogger.cpp12
-rw-r--r--src/testlib/qtestblacklist.cpp2
-rw-r--r--src/testlib/qtestcase.h10
-rw-r--r--src/tools/moc/moc.cpp15
-rw-r--r--src/tools/rcc/rcc.cpp4
-rw-r--r--src/tools/uic/cpp/cppwriteinitialization.cpp2
-rw-r--r--src/widgets/configure.json567
-rw-r--r--src/widgets/configure.pri8
-rw-r--r--src/widgets/kernel/qtwidgetsglobal.h1
-rw-r--r--src/widgets/kernel/qtwidgetsglobal_p.h1
-rw-r--r--src/widgets/styles/qstylesheetstyle.cpp12
-rw-r--r--src/widgets/styles/styles.pri2
-rw-r--r--src/widgets/widgets/qdockarealayout.cpp53
-rw-r--r--src/widgets/widgets/qdockarealayout_p.h1
-rw-r--r--src/widgets/widgets/qmainwindowlayout.cpp70
-rw-r--r--src/widgets/widgets/qmainwindowlayout_p.h2
-rw-r--r--src/xml/configure.json16
-rw-r--r--src/xml/qtxmlglobal.h3
117 files changed, 4009 insertions, 898 deletions
diff --git a/src/3rdparty/freetype/freetype.pro b/src/3rdparty/freetype/freetype.pro
index 41ca469576..1e12dadc5d 100644
--- a/src/3rdparty/freetype/freetype.pro
+++ b/src/3rdparty/freetype/freetype.pro
@@ -68,6 +68,8 @@ DEFINES += FT2_BUILD_LIBRARY
DEFINES += FT_CONFIG_OPTION_SYSTEM_ZLIB
include(../zlib_dependency.pri)
+QT_FOR_CONFIG += gui-private
+include(../../gui/qtgui-config.pri)
DEFINES += FT_CONFIG_OPTION_USE_PNG
include($$PWD/../png_dependency.pri)
diff --git a/src/3rdparty/pcre_dependency.pri b/src/3rdparty/pcre_dependency.pri
index fa7df4df0e..f1355eabe6 100644
--- a/src/3rdparty/pcre_dependency.pri
+++ b/src/3rdparty/pcre_dependency.pri
@@ -1,7 +1,7 @@
-pcre {
+qtConfig(system-pcre) {
+ QMAKE_USE_PRIVATE += pcre
+} else {
win32: DEFINES += PCRE_STATIC
INCLUDEPATH += $$PWD/pcre
LIBS_PRIVATE += -L$$QT_BUILD_TREE/lib -lqtpcre$$qtPlatformTargetSuffix()
-} else {
- QMAKE_USE_PRIVATE += pcre
}
diff --git a/src/angle/src/common/common.pri b/src/angle/src/common/common.pri
index c948e27dc3..e9351b2c42 100644
--- a/src/angle/src/common/common.pri
+++ b/src/angle/src/common/common.pri
@@ -1,4 +1,5 @@
# static builds should still link ANGLE dynamically when dynamic GL is enabled
+include(../../../gui/qtgui-config.pri)
static:qtConfig(dynamicgl) {
CONFIG -= static
CONFIG += shared
diff --git a/src/angle/src/compiler/preprocessor/preprocessor.pro b/src/angle/src/compiler/preprocessor/preprocessor.pro
index f9170b3bee..c13cf7ba8d 100644
--- a/src/angle/src/compiler/preprocessor/preprocessor.pro
+++ b/src/angle/src/compiler/preprocessor/preprocessor.pro
@@ -1,4 +1,5 @@
CONFIG += static
+include(../../../../gui/qtgui-config.pri)
qtConfig(dynamicgl): CONFIG += not_installed
include(../../config.pri)
diff --git a/src/angle/src/compiler/translator.pro b/src/angle/src/compiler/translator.pro
index cee13d06bb..4c0a05e45c 100644
--- a/src/angle/src/compiler/translator.pro
+++ b/src/angle/src/compiler/translator.pro
@@ -1,4 +1,5 @@
CONFIG += static
+include(../../../gui/qtgui-config.pri)
qtConfig(dynamicgl): CONFIG += not_installed
include(../config.pri)
diff --git a/src/corelib/configure.json b/src/corelib/configure.json
new file mode 100644
index 0000000000..b0c78f5122
--- /dev/null
+++ b/src/corelib/configure.json
@@ -0,0 +1,611 @@
+{
+ "module": "core",
+ "testDir": "../../config.tests",
+
+ "commandline": {
+ "options": {
+ "doubleconversion": { "type": "enum", "values": [ "no", "qt", "system" ] },
+ "eventfd": "boolean",
+ "glib": "boolean",
+ "iconv": { "type": "enum", "values": [ "no", "yes", "posix", "sun", "gnu" ] },
+ "icu": "boolean",
+ "inotify": "boolean",
+ "journald": "boolean",
+ "pcre": { "type": "enum", "values": [ "qt", "system" ] },
+ "posix-ipc": { "type": "boolean", "name": "ipc_posix" },
+ "pps": { "type": "boolean", "name": "qqnx_pps" },
+ "slog2": "boolean",
+ "syslog": "boolean"
+ }
+ },
+
+ "libraries": {
+ "doubleconversion": {
+ "label": "DoubleConversion",
+ "test": "unix/doubleconversion",
+ "sources": [
+ "-ldouble-conversion"
+ ]
+ },
+ "glib": {
+ "label": "GLib",
+ "test": "unix/glib",
+ "sources": [
+ { "type": "pkgConfig", "args": "glib-2.0 gthread-2.0" }
+ ]
+ },
+ "gnu_iconv": {
+ "label": "GNU libiconv",
+ "export": "iconv",
+ "test": "unix/gnu-libiconv",
+ "sources": [
+ "-liconv"
+ ]
+ },
+ "icu": {
+ "label": "ICU",
+ "export": "",
+ "test": "unix/icu",
+ "sources": [
+ {
+ "builds": {
+ "debug": "-lsicuind -lsicuucd -lsicudtd",
+ "release": "-lsicuin -lsicuuc -lsicudt"
+ },
+ "condition": "config.win32 && !features.shared"
+ },
+ { "libs": "-licuin -licuuc -licudt", "condition": "config.win32 && features.shared" },
+ { "libs": "-licui18n -licuuc -licudata", "condition": "!config.win32" }
+ ]
+ },
+ "journald": {
+ "label": "journald",
+ "test": "unix/journald",
+ "export": "",
+ "sources": [
+ { "type": "pkgConfig", "args": "libsystemd" },
+ { "type": "pkgConfig", "args": "libsystemd-journal" }
+ ]
+ },
+ "libatomic": {
+ "label": "64 bit atomics in libatomic",
+ "test": "common/atomic64",
+ "sources": [
+ "-latomic"
+ ]
+ },
+ "libdl": {
+ "label": "dlopen() in libdl",
+ "export": "",
+ "test": "unix/dlopen",
+ "sources": [
+ "-ldl"
+ ]
+ },
+ "pcre": {
+ "label": "PCRE",
+ "test": "unix/pcre",
+ "sources": [
+ "-lpcre16"
+ ]
+ },
+ "pps": {
+ "label": "PPS",
+ "test": "unix/pps",
+ "sources": [
+ "-lpps"
+ ]
+ },
+ "slog2": {
+ "label": "slog2",
+ "test": "unix/slog2",
+ "export": "",
+ "sources": [
+ "-lslog2"
+ ]
+ }
+ },
+
+ "tests": {
+ "atomic64": {
+ "label": "64 bit atomics",
+ "type": "compile",
+ "test": "common/atomic64"
+ },
+ "atomicfptr": {
+ "label": "working std::atomic for function pointers",
+ "type": "compile",
+ "test": "common/atomicfptr"
+ },
+ "clock-gettime": {
+ "label": "clock_gettime()",
+ "type": "compile",
+ "test": "unix/clock-gettime"
+ },
+ "clock-monotonic": {
+ "label": "POSIX monotonic clock",
+ "type": "compile",
+ "test": "unix/clock-monotonic"
+ },
+ "cloexec": {
+ "label": "O_CLOEXEC",
+ "type": "compile",
+ "test": "unix/cloexec"
+ },
+ "dlopen": {
+ "label": "dlopen() in libc",
+ "type": "compile",
+ "test": "unix/dlopen"
+ },
+ "eventfd": {
+ "label": "eventfd",
+ "type": "compile",
+ "test": "unix/eventfd"
+ },
+ "posix-iconv": {
+ "label": "POSIX iconv",
+ "type": "compile",
+ "test": "unix/iconv"
+ },
+ "sun-iconv": {
+ "label": "SUN libiconv",
+ "type": "compile",
+ "test": "unix/sun-libiconv"
+ },
+ "inotify": {
+ "label": "inotify",
+ "type": "compile",
+ "test": "unix/inotify"
+ },
+ "ipc_sysv": {
+ "label": "SysV IPC",
+ "type": "compile",
+ "test": "unix/ipc_sysv"
+ },
+ "ipc_posix": {
+ "label": "POSIX IPC",
+ "type": "compile",
+ "test": "unix/ipc_posix"
+ },
+ "journald": {
+ "label": "journald",
+ "type": "compile",
+ "test": "unix/journald"
+ },
+ "ppoll": {
+ "label": "ppoll()",
+ "type": "compile",
+ "test": "unix/ppoll"
+ },
+ "pollts": {
+ "label": "pollts()",
+ "type": "compile",
+ "test": "unix/pollts"
+ },
+ "poll": {
+ "label": "poll()",
+ "type": "compile",
+ "test": "unix/poll"
+ },
+ "syslog": {
+ "label": "syslog",
+ "type": "compile",
+ "test": "unix/syslog"
+ },
+ "xlocalescanprint": {
+ "label": "xlocale.h (or equivalents)",
+ "type": "compile",
+ "test": "common/xlocalescanprint"
+ }
+ },
+
+ "features": {
+ "clock-gettime": {
+ "label": "clock_gettime()",
+ "condition": "tests.clock-gettime",
+ "output": [ "privateFeature" ]
+ },
+ "clock-monotonic": {
+ "label": "POSIX monotonic clock",
+ "condition": "features.clock-gettime && tests.clock-monotonic",
+ "output": [ "feature" ]
+ },
+ "dlopen": {
+ "label": "dlopen()",
+ "condition": "tests.dlopen || libs.libdl",
+ "output": [ { "type": "define", "negative": true, "name": "QT_NO_DYNAMIC_LIBRARY" } ]
+ },
+ "libdl": {
+ "label": "dlopen() in libdl",
+ "condition": "!tests.dlopen && libs.libdl",
+ "output": [ { "type": "privateConfig", "negative": true } ]
+ },
+ "doubleconversion": {
+ "label": "DoubleConversion",
+ "output": [ "privateFeature", "feature" ]
+ },
+ "system-doubleconversion": {
+ "label": " Using system DoubleConversion",
+ "enable": "input.doubleconversion == 'system'",
+ "disable": "input.doubleconversion == 'qt'",
+ "condition": "features.doubleconversion && libs.doubleconversion",
+ "output": [ "privateFeature" ]
+ },
+ "eventfd": {
+ "label": "eventfd",
+ "condition": "tests.eventfd",
+ "output": [ "feature" ]
+ },
+ "glib": {
+ "label": "GLib",
+ "autoDetect": "!config.win32",
+ "condition": "libs.glib",
+ "output": [ "privateFeature", "feature" ]
+ },
+ "iconv": {
+ "label": "iconv",
+ "purpose": "Provides internationalization on Unix.",
+ "section": "Internationalization",
+ "condition": "features.posix-libiconv || features.sun-libiconv || features.gnu-libiconv",
+ "output": [ "privateFeature", "feature" ]
+ },
+ "posix-libiconv": {
+ "label": "POSIX iconv",
+ "enable": "input.iconv == 'posix'",
+ "disable": "input.iconv == 'sun' || input.iconv == 'gnu' || input.iconv == 'no'",
+ "condition": "!config.win32 && !config.qnx && !config.android && !config.darwin && tests.posix-iconv"
+ },
+ "sun-libiconv": {
+ "label": "SUN iconv",
+ "enable": "input.iconv == 'sun'",
+ "disable": "input.iconv == 'posix' || input.iconv == 'gnu' || input.iconv == 'no'",
+ "condition": "!config.win32 && !config.qnx && !config.android && !config.darwin && !features.posix-libiconv && tests.sun-iconv",
+ "output": [ "privateFeature", "publicQtConfig" ]
+ },
+ "gnu-libiconv": {
+ "label": "GNU iconv",
+ "enable": "input.iconv == 'gnu'",
+ "disable": "input.iconv == 'posix' || input.iconv == 'sun' || input.iconv == 'no'",
+ "condition": "!config.win32 && !config.qnx && !config.android && !config.darwin && !features.posix-libiconv && !features.sun-libiconv && libs.gnu_iconv",
+ "output": [ "privateFeature" ]
+ },
+ "icu": {
+ "label": "ICU",
+ "autoDetect": "!config.win32",
+ "condition": "libs.icu",
+ "output": [ "privateFeature" ]
+ },
+ "inotify": {
+ "label": "inotify",
+ "condition": "tests.inotify",
+ "output": [ "privateFeature", "feature" ]
+ },
+ "ipc_posix": {
+ "label": "Using POSIX IPC",
+ "autoDetect": "!config.win32",
+ "condition": "!tests.ipc_sysv && tests.ipc_posix",
+ "output": [ { "type": "define", "name": "QT_POSIX_IPC" } ]
+ },
+ "journald": {
+ "label": "journald",
+ "autoDetect": false,
+ "condition": "libs.journald",
+ "output": [ "privateConfig" ]
+ },
+ "std-atomic64": {
+ "label": "64 bit atomic operations",
+ "condition": "tests.atomic64 || libs.libatomic",
+ "output": [ { "type": "define", "negative": true, "name": "QT_NO_STD_ATOMIC64" } ]
+ },
+ "libatomic": {
+ "label": "64 bit atomic operations in libatomic",
+ "condition": "!tests.atomic64 && libs.libatomic",
+ "output": [ "privateFeature" ]
+ },
+ "mimetype": {
+ "label": "Mimetype handling",
+ "purpose": "Provides MIME type handling.",
+ "section": "Utilities",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "system-pcre": {
+ "label": "Using system PCRE",
+ "disable": "input.pcre == 'qt'",
+ "enable": "input.pcre == 'system'",
+ "condition": "libs.pcre",
+ "output": [
+ "privateFeature",
+ { "type": "privateConfig", "negative": true, "name": "pcre" }
+ ]
+ },
+ "poll_ppoll": {
+ "label": "Native ppoll()",
+ "emitIf": "!config.win32",
+ "condition": "tests.ppoll",
+ "output": [ "privateFeature" ]
+ },
+ "poll_pollts": {
+ "label": "Native pollts()",
+ "emitIf": "!config.win32",
+ "condition": "!features.poll_ppoll && tests.pollts",
+ "output": [ "privateFeature" ]
+ },
+ "poll_poll": {
+ "label": "Native poll()",
+ "emitIf": "!config.win32",
+ "condition": "!features.poll_ppoll && !features.poll_pollts && tests.poll",
+ "output": [ "privateFeature" ]
+ },
+ "poll_select": {
+ "label": "Emulated poll()",
+ "emitIf": "!config.win32",
+ "condition": "!features.poll_ppoll && !features.poll_pollts && !features.poll_poll",
+ "output": [
+ "privateFeature",
+ { "type": "define", "name": "QT_NO_NATIVE_POLL" }
+ ]
+ },
+ "qqnx_pps": {
+ "label": "PPS",
+ "emitIf": "config.qnx",
+ "condition": "libs.pps",
+ "output": [ "privateConfig" ]
+ },
+ "qeventtransition": {
+ "label": "QEventTransition class",
+ "output": [ "publicFeature" ]
+ },
+ "sharedmemory": {
+ "label": "Enable QSharedMemory",
+ "condition": "config.android || config.win32 || tests.ipc_sysv || tests.ipc_posix",
+ "output": [ { "type": "define", "negative": true, "name": "QT_NO_SHAREDMEMORY" } ]
+ },
+ "slog2": {
+ "label": "slog2",
+ "condition": "libs.slog2",
+ "emitIf": "config.qnx",
+ "output": [ "privateConfig" ]
+ },
+ "syslog": {
+ "label": "syslog",
+ "autoDetect": false,
+ "condition": "tests.syslog",
+ "output": [ "privateConfig" ]
+ },
+ "systemsemaphore": {
+ "label": "Enable QSystemSemaphore",
+ "condition": "config.android || config.win32 || tests.ipc_sysv || tests.ipc_posix",
+ "output": [ { "type": "define", "negative": true, "name": "QT_NO_SYSTEMSEMAPHORE" } ]
+ },
+ "threadsafe-cloexec": {
+ "label": "Threadsafe pipe creation",
+ "condition": "tests.cloexec",
+ "output": [
+ "publicQtConfig",
+ { "type": "define", "name": "QT_THREADSAFE_CLOEXEC", "value": 1 }
+ ]
+ },
+ "properties": {
+ "label": "Properties",
+ "purpose": "Supports scripting Qt-based applications.",
+ "section": "Kernel",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "regularexpression": {
+ "label": "QRegularExpression",
+ "purpose": "Provides an API to Perl-compatible regular expressions.",
+ "section": "Kernel",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "sharedmemory": {
+ "label": "QSharedMemory",
+ "purpose": "Provides access to a shared memory segment.",
+ "section": "Kernel",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "systemsemaphore": {
+ "label": "QSystemSemaphore",
+ "purpose": "Provides a general counting system semaphore.",
+ "section": "Kernel",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "xmlstream": {
+ "label": "XML Streaming APIs",
+ "purpose": "Provides a simple streaming API for XML.",
+ "section": "Kernel",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "xmlstreamreader": {
+ "label": "QXmlStreamReader",
+ "purpose": "Provides a well-formed XML parser with a simple streaming API.",
+ "section": "Kernel",
+ "condition": "features.xmlstream",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "xmlstreamwriter": {
+ "label": "QXmlStreamWriter",
+ "purpose": "Provides a XML writer with a simple streaming API.",
+ "section": "Kernel",
+ "condition": "features.xmlstream",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "textdate": {
+ "label": "Text Date",
+ "purpose": "Supports month and day names in dates.",
+ "section": "Data structures",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "datestring": {
+ "label": "QDate/QTime/QDateTime",
+ "purpose": "Provides convertion between dates and strings.",
+ "section": "Data structures",
+ "condition": "features.textdate",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "process": {
+ "label": "QProcess",
+ "purpose": "Supports external process invocation.",
+ "section": "File I/O",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "temporaryfile": {
+ "label": "QTemporaryFile",
+ "purpose": "Provides an I/O device that operates on temporary files.",
+ "section": "File I/O",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "library": {
+ "label": "QLibrary",
+ "purpose": "Provides a wrapper for dynamically loaded libraries.",
+ "section": "File I/O",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "settings": {
+ "label": "QSettings",
+ "purpose": "Provides persistent application settings.",
+ "section": "File I/O",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "filesystemwatcher": {
+ "label": "QFileSystemWatcher",
+ "purpose": "Provides an interface for monitoring files and directories for modifications.",
+ "section": "File I/O",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "filesystemiterator": {
+ "label": "QFileSystemIterator",
+ "purpose": "Provides fast file system iteration.",
+ "section": "File I/O",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "itemmodel": {
+ "label": "Qt Item Model",
+ "purpose": "Provides the item model for item views",
+ "section": "ItemViews",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "proxymodel": {
+ "label": "QAbstractProxyModel",
+ "purpose": "Supports processing of data passed between another model and a view.",
+ "section": "ItemViews",
+ "condition": "features.itemmodel",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "sortfilterproxymodel": {
+ "label": "QSortFilterProxyModel",
+ "purpose": "Supports sorting and filtering of data passed between another model and a view.",
+ "section": "ItemViews",
+ "condition": "features.proxymodel",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "identityproxymodel": {
+ "label": "QIdentityProxyModel",
+ "purpose": "Supports proxying a source model unmodified.",
+ "section": "ItemViews",
+ "condition": "features.proxymodel",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "stringlistmodel": {
+ "label": "QStringListModel",
+ "purpose": "Provides a model that supplies strings to views.",
+ "section": "ItemViews",
+ "condition": "features.itemmodel",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "translation": {
+ "label": "Translation",
+ "purpose": "Supports translations using QObject::tr().",
+ "section": "Internationalization",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "textcodec": {
+ "label": "QTextCodec",
+ "purpose": "Supports conversions between text encodings.",
+ "section": "Internationalization",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "codecs": {
+ "label": "Codecs",
+ "purpose": "Supports non-unicode text conversions.",
+ "section": "Internationalization",
+ "condition": "features.textcodec",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "big_codecs": {
+ "label": "Big Codecs",
+ "purpose": "Supports big codecs, e.g. CJK.",
+ "section": "Internationalization",
+ "condition": "features.textcodec",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "animation": {
+ "label": "Animation",
+ "purpose": "Provides a framework for animations.",
+ "section": "Utilities",
+ "condition": "features.properties",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "statemachine": {
+ "label": "State machine",
+ "purpose": "Provides hierarchical finite state machines.",
+ "section": "Utilities",
+ "condition": "features.properties",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "gestures": {
+ "label": "Gesture",
+ "purpose": "Provides a framework for gestures.",
+ "section": "Utilities",
+ "output": [ "publicFeature", "feature" ]
+ }
+ },
+
+ "report": [
+ {
+ "type": "note",
+ "condition": "features.journald || features.syslog || (config.qnx && features.slog2)",
+ "message": "journald, syslog or slog2 integration is enabled.
+If your users intend to develop applications against this build,
+ensure that the IDEs they use either set QT_LOGGING_TO_CONSOLE to 1
+or are able to read the logged output from journald, syslog or slog2."
+ },
+ {
+ "type": "error",
+ "condition": "input.doubleconversion == 'no' && !tests.xlocalescanprint",
+ "message": "Your C library does not provide sscanf_l or snprintf_l.
+You need to use libdouble-conversion for double/string conversion."
+ },
+ {
+ "type": "error",
+ "condition": "!tests.atomicfptr",
+ "message": "detected a std::atomic implementation that fails for function pointers.
+Please apply the patch corresponding to your Standard Library vendor, found in
+ qtbase/config.tests/common/atomicfptr"
+ }
+ ],
+
+ "summary": [
+ {
+ "section": "Qt Core",
+ "entries": [
+ "doubleconversion",
+ "system-doubleconversion",
+ "glib",
+ "iconv",
+ "icu",
+ {
+ "section": "Logging backends",
+ "entries": [
+ "journald", "syslog", "slog2"
+ ]
+ },
+ {
+ "type": "feature",
+ "args": "qqnx_pps",
+ "condition": "config.qnx"
+ },
+ "system-pcre"
+ ]
+ }
+ ]
+}
diff --git a/src/corelib/corelib.pro b/src/corelib/corelib.pro
index 1db814180b..616a9641a1 100644
--- a/src/corelib/corelib.pro
+++ b/src/corelib/corelib.pro
@@ -31,8 +31,6 @@ ANDROID_PERMISSIONS = \
# OpenBSD 6.0 will include environ in libc.
freebsd|openbsd: QMAKE_LFLAGS_NOUNDEF =
-load(qfeatures)
-
include(animation/animation.pri)
include(arch/arch.pri)
include(global/global.pri)
@@ -100,6 +98,7 @@ cmake_umbrella_config_version_file.output = $$DESTDIR/cmake/Qt5/Qt5ConfigVersion
load(cmake_functions)
+##### This requires fixing, so that the feature system works with cmake as well
CMAKE_DISABLED_FEATURES = $$join(QT_DISABLED_FEATURES, "$$escape_expand(\\n) ")
CMAKE_HOST_DATA_DIR = $$cmakeRelativePath($$[QT_HOST_DATA/src], $$[QT_INSTALL_PREFIX])
diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h
index 085e3063b4..a48548bc90 100644
--- a/src/corelib/global/qcompilerdetection.h
+++ b/src/corelib/global/qcompilerdetection.h
@@ -942,7 +942,8 @@
# endif /* VC 11 */
# if _MSC_VER >= 1800
/* C++11 features in VC12 = VC2013 */
-# define Q_COMPILER_DEFAULT_MEMBERS
+/* Implemented, but can't be used on move special members */
+/* # define Q_COMPILER_DEFAULT_MEMBERS */
# define Q_COMPILER_DELETE_MEMBERS
# define Q_COMPILER_DELEGATING_CONSTRUCTORS
# define Q_COMPILER_EXPLICIT_CONVERSIONS
@@ -960,6 +961,7 @@
# endif /* VC 12 SP 2 RC */
# if _MSC_VER >= 1900
/* C++11 features in VC14 = VC2015 */
+# define Q_COMPILER_DEFAULT_MEMBERS
# define Q_COMPILER_ALIGNAS
# define Q_COMPILER_ALIGNOF
// Partial support, insufficient for Qt
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index e6d65b0f99..f11ec127e0 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -58,7 +58,7 @@
#ifndef QT_BOOTSTRAPPED
#include <QtCore/qconfig.h>
-#include <QtCore/qfeatures.h>
+#include <QtCore/qtcore-config.h>
#endif
// The QT_SUPPORTS macro is deprecated. Don't use it in new code.
@@ -943,10 +943,11 @@ template <typename T>
class QForeachContainer {
QForeachContainer &operator=(const QForeachContainer &) Q_DECL_EQ_DELETE;
public:
- inline QForeachContainer(const T& t) : c(t), i(c.begin()), e(c.end()), control(1) { }
+ QForeachContainer(const T &t) : c(t) {}
+ QForeachContainer(T &&t) : c(std::move(t)) {}
const T c;
- typename T::const_iterator i, e;
- int control;
+ typename T::const_iterator i = c.begin(), e = c.end();
+ int control = 1;
};
// Explanation of the control word:
diff --git a/src/corelib/global/qglobal_p.h b/src/corelib/global/qglobal_p.h
index e75d87b384..c329357f46 100644
--- a/src/corelib/global/qglobal_p.h
+++ b/src/corelib/global/qglobal_p.h
@@ -50,6 +50,7 @@
#ifndef QT_BOOTSTRAPPED
#include <QtCore/private/qconfig_p.h>
+#include <QtCore/private/qtcore-config_p.h>
#endif
#define QT_LIBRARY_VERSION(lib) QT_LIBRARY_VERSION_##lib
diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp
index 4303f74709..1a7d64780f 100644
--- a/src/corelib/global/qlibraryinfo.cpp
+++ b/src/corelib/global/qlibraryinfo.cpp
@@ -616,10 +616,10 @@ QStringList QLibraryInfo::platformPluginArguments(const QString &platformName)
#if !defined(QT_BUILD_QMAKE) && !defined(QT_NO_SETTINGS)
QScopedPointer<const QSettings> settings(QLibraryInfoPrivate::findConfiguration());
if (!settings.isNull()) {
- QString key = QLatin1String(platformsSection);
- key += QLatin1Char('/');
- key += platformName;
- key += QLatin1String("Arguments");
+ const QString key = QLatin1String(platformsSection)
+ + QLatin1Char('/')
+ + platformName
+ + QLatin1String("Arguments");
return settings->value(key).toStringList();
}
#endif // !QT_BUILD_QMAKE && !QT_NO_SETTINGS
diff --git a/src/corelib/io/qtextstream.cpp b/src/corelib/io/qtextstream.cpp
index b8db23329a..4fdb1505ff 100644
--- a/src/corelib/io/qtextstream.cpp
+++ b/src/corelib/io/qtextstream.cpp
@@ -2644,6 +2644,7 @@ QTextStream &QTextStream::operator<<(const char *string)
{
Q_D(QTextStream);
CHECK_VALID_STREAM(*this);
+ // ### Qt6: consider changing to UTF-8
d->putString(QLatin1String(string));
return *this;
}
diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp
index 71bbd80980..7d9c5dc325 100644
--- a/src/corelib/tools/qbytearray.cpp
+++ b/src/corelib/tools/qbytearray.cpp
@@ -303,13 +303,14 @@ char *qstrncpy(char *dst, const char *src, uint len)
{
if (!src || !dst)
return 0;
+ if (len > 0) {
#if defined(_MSC_VER) && _MSC_VER >= 1400
- strncpy_s(dst, len, src, len-1);
+ strncpy_s(dst, len, src, len - 1);
#else
- strncpy(dst, src, len);
+ strncpy(dst, src, len);
#endif
- if (len > 0)
dst[len-1] = '\0';
+ }
return dst;
}
diff --git a/src/corelib/tools/qlocale_win.cpp b/src/corelib/tools/qlocale_win.cpp
index 42ac888e47..b5f97b5fe8 100644
--- a/src/corelib/tools/qlocale_win.cpp
+++ b/src/corelib/tools/qlocale_win.cpp
@@ -57,7 +57,7 @@
#include <wrl.h>
#include <windows.foundation.h>
#include <windows.foundation.collections.h>
-#include <windows.globalization.h>
+#include <windows.system.userprofile.h>
#endif // Q_OS_WINRT
QT_BEGIN_NAMESPACE
@@ -70,6 +70,7 @@ static QString winIso3116CtryName(LCID id = LOCALE_USER_DEFAULT);
using namespace Microsoft::WRL;
using namespace Microsoft::WRL::Wrappers;
using namespace ABI::Windows::Foundation;
+using namespace ABI::Windows::System::UserProfile;
static QByteArray getWinLocaleName(LPWSTR id = LOCALE_NAME_USER_DEFAULT);
static const char *winLangCodeToIsoName(int code);
@@ -624,16 +625,17 @@ QVariant QSystemLocalePrivate::uiLanguages()
return result;
#else // !Q_OS_WINRT
QStringList result;
- ComPtr<ABI::Windows::Globalization::IApplicationLanguagesStatics> appLanguagesStatics;
- if (FAILED(GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Globalization_ApplicationLanguages).Get(), &appLanguagesStatics))) {
+
+ ComPtr<IGlobalizationPreferencesStatics> preferences;
+ HRESULT hr = GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_System_UserProfile_GlobalizationPreferences).Get(), &preferences);
+ if (FAILED(hr)) {
qWarning("Could not obtain ApplicationLanguagesStatic");
return QStringList();
}
ComPtr<ABI::Windows::Foundation::Collections::IVectorView<HSTRING> > languageList;
- // Languages is a ranked list of "long names" (e.g. en-US) of preferred languages, which matches
- // languages from the manifest with languages from the user's system.
- HRESULT hr = appLanguagesStatics->get_Languages(&languageList);
+ // Languages is a ranked list of "long names" (e.g. en-US) of preferred languages
+ hr = preferences->get_Languages(&languageList);
Q_ASSERT_SUCCEEDED(hr);
unsigned int size;
hr = languageList->get_Size(&size);
@@ -648,36 +650,6 @@ QVariant QSystemLocalePrivate::uiLanguages()
result << QString::fromWCharArray(rawString, length);
}
- // ManifestLanguages covers all languages given in the manifest and uses short names (like "en").
- hr = appLanguagesStatics->get_ManifestLanguages(&languageList);
- Q_ASSERT_SUCCEEDED(hr);
- hr = languageList->get_Size(&size);
- Q_ASSERT_SUCCEEDED(hr);
- for (unsigned int i = 0; i < size; ++i) {
- HString language;
- hr = languageList->GetAt(i, language.GetAddressOf());
- Q_ASSERT_SUCCEEDED(hr);
- UINT32 length;
- PCWSTR rawString = language.GetRawBuffer(&length);
- const QString qLanguage = QString::fromWCharArray(rawString, length);
- bool found = false;
- // Since ApplicationLanguages:::Languages uses long names, we compare the "pre-dash" part of
- // the language and filter it out, if it is already covered by a more specialized form.
- for (const QString &lang : qAsConst(result)) {
- int dashIndex = lang.indexOf('-');
- // There will not be any long name after the first short name was found, so we can stop.
- if (dashIndex == -1)
- break;
-
- if (lang.leftRef(dashIndex) == qLanguage) {
- found = true;
- break;
- }
- }
- if (!found)
- result << qLanguage;
- }
-
return result;
#endif // Q_OS_WINRT
}
diff --git a/src/corelib/tools/tools.pri b/src/corelib/tools/tools.pri
index 7ebd9cf710..e3d89651e4 100644
--- a/src/corelib/tools/tools.pri
+++ b/src/corelib/tools/tools.pri
@@ -168,7 +168,7 @@ qtConfig(icu) {
SOURCES += tools/qcollator_posix.cpp
}
-!contains(QT_DISABLED_FEATURES, regularexpression) {
+qtConfig(regularexpression) {
include($$PWD/../../3rdparty/pcre_dependency.pri)
HEADERS += tools/qregularexpression.h
diff --git a/src/gui/configure.json b/src/gui/configure.json
new file mode 100644
index 0000000000..376359ba37
--- /dev/null
+++ b/src/gui/configure.json
@@ -0,0 +1,1095 @@
+{
+ "module": "gui",
+ "depends": [
+ "core"
+ ],
+ "testDir": "../../config.tests",
+
+ "commandline": {
+ "options": {
+ "angle": "boolean",
+ "directfb": "boolean",
+ "directwrite": "boolean",
+ "egl": "boolean",
+ "eglfs": "boolean",
+ "evdev": "boolean",
+ "fontconfig": "boolean",
+ "freetype": { "type": "enum", "values": [ "no", "qt", "system" ] },
+ "gbm": "boolean",
+ "gif": "boolean",
+ "harfbuzz": { "type": "enum", "values": [ "no", "qt", "system" ] },
+ "ico": "boolean",
+ "imf": { "type": "boolean", "name": "qqnx_imf" },
+ "kms": "boolean",
+ "lgmon": "boolean",
+ "libinput": "boolean",
+ "libjpeg": { "type": "enum", "values": [ "no", "qt", "system" ] },
+ "libpng": { "type": "enum", "values": [ "no", "qt", "system" ] },
+ "linuxfb": "boolean",
+ "mirclient": "boolean",
+ "mtdev": "boolean",
+ "opengl": { "type": "optionalString", "values": [ "no", "yes", "desktop", "es2", "dynamic" ] },
+ "opengl-es-2": { "type": "void", "name": "opengl", "value": "es2" },
+ "opengles3": "boolean",
+ "qpa": { "type": "string", "name": "qpa_default_platform" },
+ "qpa-platform-guard": "boolean",
+ "sm": { "type": "boolean", "name": "sessionmanager" },
+ "tslib": "boolean",
+ "xcb": { "type": "enum", "values": [ "no", "yes", "qt", "system" ] },
+ "xcb-xlib": "boolean",
+ "xinput2": "boolean",
+ "xkb": "boolean",
+ "xkb-config-root": "string",
+ "xkbcommon": { "type": "enum", "values": [ "no", "qt", "system" ] },
+ "xkbcommon-evdev": "boolean",
+ "xkbcommon-x11": { "type": "enum", "name": "xkbcommon", "values": [ "no", "qt", "system" ] },
+ "xrender": "boolean"
+ }
+ },
+
+ "libraries": {
+ "bcm_host": {
+ "export": "",
+ "sources": [
+ "-lbcm_host"
+ ]
+ },
+ "directfb": {
+ "label": "DirectFB",
+ "test": "qpa/directfb",
+ "sources": [
+ { "type": "pkgConfig", "args": "directfb" }
+ ]
+ },
+ "directwrite": {
+ "label": "DirectWrite",
+ "export": "",
+ "test": "win/directwrite",
+ "sources": [
+ "-ldwrite"
+ ]
+ },
+ "drm": {
+ "label": "KMS",
+ "test": "qpa/kms",
+ "sources": [
+ { "type": "pkgConfig", "args": "libdrm" },
+ "-ldrm"
+ ]
+ },
+ "egl": {
+ "label": "EGL",
+ "test": "qpa/egl",
+ "sources": [
+ { "type": "pkgConfig", "args": "egl" },
+ { "type": "makeSpec", "spec": "EGL" }
+ ]
+ },
+ "freetype": {
+ "label": "FreeType",
+ "export": "",
+ "test": "unix/freetype",
+ "sources": [
+ "-lfreetype"
+ ]
+ },
+ "fontconfig": {
+ "label": "Fontconfig",
+ "test": "unix/fontconfig",
+ "sources": [
+ { "type": "pkgConfig", "args": "fontconfig freetype2" },
+ "-lfontconfig -lfreetype"
+ ]
+ },
+ "gbm": {
+ "label": "GBM",
+ "test": "qpa/gbm",
+ "sources": [
+ { "type": "pkgConfig", "args": "gbm" }
+ ]
+ },
+ "harfbuzz": {
+ "label": "HarfBuzz",
+ "test": "unix/harfbuzz",
+ "sources": [
+ "-lharfbuzz"
+ ]
+ },
+ "imf": {
+ "label": "IMF",
+ "export": "",
+ "test": "unix/qqnx_imf",
+ "sources": [
+ "-linput_client"
+ ]
+ },
+ "lgmon": {
+ "label": "lgmon",
+ "test": "unix/lgmon",
+ "sources": [
+ "-llgmon"
+ ]
+ },
+ "libinput": {
+ "label": "libinput",
+ "test": "unix/libinput",
+ "sources": [
+ { "type": "pkgConfig", "args": "libinput" }
+ ]
+ },
+ "libjpeg": {
+ "label": "libjpeg",
+ "test": "unix/libjpeg",
+ "sources": [
+ { "libs": "-llibjpeg", "condition": "config.msvc" },
+ { "libs": "-ljpeg", "condition": "!config.msvc" }
+ ]
+ },
+ "libpng": {
+ "label": "libpng",
+ "test": "unix/libpng",
+ "sources": [
+ { "type": "pkgConfig", "args": "libpng" },
+ { "libs": "-llibpng", "condition": "config.msvc" },
+ { "libs": "-lpng", "condition": "!config.msvc" }
+ ]
+ },
+ "mirclient": {
+ "label": "Mir client libraries",
+ "export": "",
+ "test": "qpa/mirclient",
+ "sources": [
+ { "type": "pkgConfig", "args": "egl mirclient ubuntu-platform-api" }
+ ]
+ },
+ "mtdev": {
+ "label": "mtdev",
+ "export": "",
+ "test": "unix/mtdev",
+ "sources": [
+ { "type": "pkgConfig", "args": "mtdev" }
+ ]
+ },
+ "opengl": {
+ "label": "Desktop OpenGL",
+ "test": "unix/opengldesktop",
+ "sources": [
+ { "type": "pkgConfig", "args": "gl" },
+ { "type": "makeSpec", "spec": "OPENGL" }
+ ]
+ },
+ "opengl_es2": {
+ "label": "OpenGL ES 2.0",
+ "test": "unix/opengles2",
+ "sources": [
+ { "type": "pkgConfig", "args": "glesv2" },
+ { "type": "makeSpec", "spec": "OPENGL_ES2" }
+ ]
+ },
+ "tslib": {
+ "label": "tslib",
+ "test": "unix/tslib",
+ "sources": [
+ "-lts"
+ ]
+ },
+ "wayland_server": {
+ "label": "Wayland Server",
+ "export": "",
+ "test": "qpa/wayland-server",
+ "sources": [
+ { "type": "pkgConfig", "args": "wayland-server" }
+ ]
+ },
+ "x11sm": {
+ "label": "X11 session management",
+ "sources": [
+ { "type": "pkgConfig", "args": "sm ice" }
+ ]
+ },
+ "xcb": {
+ "label": "XCB >= 1.5 (core)",
+ "test": "qpa/xcb",
+ "sources": [
+ { "type": "pkgConfig", "args": "xcb >= 1.5" },
+ "-lxcb"
+ ]
+ },
+ "xcb_syslibs": {
+ "label": "XCB (secondary)",
+ "test": "qpa/xcb-syslibs",
+ "sources": [
+ { "type": "pkgConfig",
+ "args": "xcb xcb-shm xcb-sync xcb-xfixes xcb-randr xcb-image xcb-keysyms xcb-icccm xcb-shape" },
+ "-lxcb -lxcb-shm -lxcb-sync -lxcb-xfixes -lxcb-randr -lxcb-image -lxcb-keysyms -lxcb-icccm -lxcb-shape"
+ ]
+ },
+ "xcb_xlib": {
+ "label": "XCB Xlib",
+ "test": "qpa/xcb-xlib",
+ "sources": [
+ { "type": "pkgConfig", "args": "X11-xcb x11 xcb" },
+ "-lxcb -lX11 -lX11-xcb"
+ ]
+ },
+ "xcb_xkb": {
+ "label": "XCB XKB >= 1.10",
+ "test": "qpa/xcb-xkb",
+ "sources": [
+ { "type": "pkgConfig", "args": "xcb-xkb >= 1.10 xcb" },
+ "-lxcb-xkb -lxcb"
+ ]
+ },
+ "xcb_render": {
+ "label": "XCB XRender",
+ "test": "qpa/xcb-render",
+ "sources": [
+ { "type": "pkgConfig", "args": "xcb-renderutil xcb-render xcb" },
+ "-lxcb-render-util -lxcb-render -lxcb"
+ ]
+ },
+ "xcb_glx": {
+ "label": "XCB GLX",
+ "test": "qpa/xcb-glx",
+ "sources": [
+ { "type": "pkgConfig", "args": "xcb-glx xcb" },
+ "-lxcb-glx -lxcb"
+ ]
+ },
+ "xinput2": {
+ "label": "Xinput2",
+ "test": "x11/xinput2",
+ "sources": [
+ { "type": "pkgConfig", "args": "xi" },
+ "-lXi"
+ ]
+ },
+ "xkbcommon": {
+ "label": "xkbcommon",
+ "export": "xkbcommon_evdev",
+ "test": "unix/xkbcommon",
+ "sources": [
+ { "type": "pkgConfig", "args": "xkbcommon" }
+ ]
+ },
+ "xkbcommon_x11": {
+ "label": "xkbcommon-x11 >= 0.4.1",
+ "export": "xkbcommon",
+ "sources": [
+ { "type": "pkgConfig", "args": "xkbcommon xkbcommon-x11 >= 0.4.1" }
+ ]
+ },
+ "xrender": {
+ "label": "XRender",
+ "test": "x11/xrender",
+ "sources": [
+ "-lXrender"
+ ]
+ }
+ },
+
+ "testTypeAliases": {
+ "files": [ "directX" ],
+ "getPkgConfigVariable": [ "xkbConfigRoot" ]
+ },
+
+ "tests": {
+ "direct2d": {
+ "label": "Direct 2D",
+ "type": "compile",
+ "test": "qpa/direct2d",
+ "use": "direct2d"
+ },
+ "directwrite2": {
+ "label": "DirectWrite 2",
+ "type": "compile",
+ "test": "win/directwrite2",
+ "use": "directwrite"
+ },
+ "directx": {
+ "label": "DirectX SDK",
+ "type": "directX",
+ "files": [
+ "d3dcompiler.h",
+ "d3d11.lib",
+ "fxc.exe"
+ ]
+ },
+ "egl-x11": {
+ "label": "EGL on X11",
+ "type": "compile",
+ "test": "qpa/egl-x11",
+ "use": "egl xcb_xlib"
+ },
+ "egl-brcm": {
+ "label": "Broadcom EGL (Rasberry Pi)",
+ "type": "compile",
+ "test": "qpa/eglfs-brcm",
+ "use": "egl bcm_host"
+ },
+ "egl-egldevice": {
+ "label": "EGLDevice",
+ "type": "compile",
+ "test": "qpa/eglfs-egldevice",
+ "use": "egl"
+ },
+ "egl-mali": {
+ "label": "Mali EGL",
+ "type": "compile",
+ "test": "qpa/eglfs-mali",
+ "use": "egl"
+ },
+ "egl-mali-2": {
+ "label": "Mali 2 EGL",
+ "type": "compile",
+ "test": "qpa/eglfs-mali-2",
+ "use": "egl"
+ },
+ "egl-viv": {
+ "label": "i.Mx6 EGL",
+ "type": "compile",
+ "test": "qpa/eglfs-viv",
+ "use": "egl"
+ },
+ "evdev": {
+ "label": "evdev",
+ "type": "compile",
+ "test": "unix/evdev"
+ },
+ "linuxfb": {
+ "label": "LinuxFB",
+ "type": "compile",
+ "test": "qpa/linuxfb"
+ },
+ "opengles3": {
+ "label": "OpenGL ES 3.0",
+ "type": "compile",
+ "test": "unix/opengles3",
+ "use": "opengl_es2"
+ },
+ "opengles31": {
+ "label": "OpenGL ES 3.1",
+ "type": "compile",
+ "test": "unix/opengles31",
+ "use": "opengl_es2"
+ },
+ "qpa_default_platform": {
+ "label": "default QPA platform",
+ "type": "qpaDefaultPlatform",
+ "log": "value"
+ },
+ "x11prefix": {
+ "label": "X11 prefix",
+ "type": "getPkgConfigVariable",
+ "pkg-config-args": "x11",
+ "pkg-config-variable": "prefix",
+ "value": "/usr",
+ "log": "value"
+ },
+ "xkbconfigroot": {
+ "label": "XKB config root",
+ "type": "xkbConfigRoot",
+ "pkg-config-args": "xkeyboard-config",
+ "pkg-config-variable": "xkb_base",
+ "log": "value"
+ },
+ "xlib": {
+ "label": "XLib",
+ "type": "compile",
+ "test": "x11/xlib"
+ }
+ },
+
+ "features": {
+ "accessibility-atspi-bridge": {
+ "label": "ATSPI Bridge",
+ "condition": "features.accessibility && features.xcb && features.dbus",
+ "output": [ "privateFeature", "feature" ]
+ },
+ "angle": {
+ "label": "ANGLE",
+ "autoDetect": "features.opengles2 || features.opengl-dynamic",
+ "condition": "config.win32 && tests.directx",
+ "output": [
+ "publicFeature",
+ { "type": "define", "name": "QT_OPENGL_ES_2_ANGLE" }
+ ]
+ },
+ "directfb": {
+ "label": "DirectFB",
+ "autoDetect": false,
+ "condition": "libs.directfb",
+ "output": [ "privateFeature" ]
+ },
+ "directwrite": {
+ "label": "DirectWrite",
+ "emitIf": "config.win32",
+ "condition": "libs.directwrite",
+ "output": [ "privateFeature" ]
+ },
+ "directwrite2": {
+ "label": "DirectWrite 2",
+ "emitIf": "config.win32",
+ "condition": "features.directwrite && tests.directwrite2",
+ "output": [ "privateFeature" ]
+ },
+ "direct2d": {
+ "label": "Direct 2D",
+ "autoDetect": false,
+ "condition": "tests.direct2d",
+ "output": [ "privateFeature" ]
+ },
+ "evdev": {
+ "label": "evdev",
+ "condition": "tests.evdev",
+ "output": [ "privateFeature" ]
+ },
+ "freetype": {
+ "label": "FreeType",
+ "output": [ "privateFeature", "feature" ]
+ },
+ "system-freetype": {
+ "label": " Using system FreeType",
+ "enable": "input.freetype == 'system'",
+ "disable": "input.freetype == 'qt'",
+ "autoDetect": "!config.win32",
+ "condition": "features.freetype && libs.freetype",
+ "output": [ "privateFeature" ]
+ },
+ "fontconfig": {
+ "label": "Fontconfig",
+ "condition": "!config.win32 && !config.darwin && features.system-freetype && libs.fontconfig",
+ "output": [ "privateFeature", "feature" ]
+ },
+ "gbm": {
+ "label": "GBM",
+ "condition": "libs.gbm",
+ "output": [ "publicQtConfig" ]
+ },
+ "harfbuzz": {
+ "label": "HarfBuzz",
+ "output": [ "privateFeature", "feature" ]
+ },
+ "system-harfbuzz": {
+ "label": " Using system HarfBuzz",
+ "enable": "input.harfbuzz == 'system'",
+ "disable": "input.harfbuzz == 'qt'",
+ "autoDetect": "!config.darwin && !config.win32",
+ "condition": "features.harfbuzz && libs.harfbuzz",
+ "output": [ "privateFeature" ]
+ },
+ "qqnx_imf": {
+ "label": "IMF",
+ "emitIf": "config.qnx",
+ "condition": "libs.imf",
+ "output": [ "privateConfig" ]
+ },
+ "integrityfb": {
+ "label": "INTEGRITY framebuffer",
+ "condition": "config.integrity",
+ "output": [ "privateFeature" ]
+ },
+ "kms": {
+ "label": "KMS",
+ "condition": "libs.drm",
+ "output": [ "publicQtConfig" ]
+ },
+ "libinput": {
+ "label": "libinput",
+ "condition": "features.libudev && libs.libinput",
+ "output": [ "privateFeature" ]
+ },
+ "lgmon": {
+ "label": "lgmon",
+ "emitIf": "config.qnx",
+ "condition": "libs.lgmon",
+ "output": [ "privateConfig" ]
+ },
+ "linuxfb": {
+ "label": "LinuxFB",
+ "condition": "tests.linuxfb",
+ "output": [ "privateFeature" ]
+ },
+ "mirclient": {
+ "label": "Mir client",
+ "condition": "libs.mirclient",
+ "output": [ "privateFeature" ]
+ },
+ "mtdev": {
+ "label": "mtdev",
+ "condition": "libs.mtdev",
+ "output": [ "privateFeature" ]
+ },
+ "opengles2": {
+ "label": "OpenGL ES 2.0",
+ "enable": "input.opengl == 'es2'",
+ "disable": "input.opengl == 'desktop' || input.opengl == 'dynamic' || input.opengl == 'no'",
+ "condition": "config.win32 || (!config.watchos && !features.opengl-desktop && libs.opengl_es2)",
+ "output": [
+ "publicFeature",
+ "publicQtConfig",
+ { "type": "define", "name": "QT_OPENGL_ES" },
+ { "type": "define", "name": "QT_OPENGL_ES_2" }
+ ]
+ },
+ "opengles3": {
+ "label": "OpenGL ES 3.0",
+ "condition": "features.opengles2 && !features.angle && tests.opengles3",
+ "output": [
+ "publicFeature",
+ { "type": "define", "name": "QT_OPENGL_ES_3" }
+ ]
+ },
+ "opengles31": {
+ "label": "OpenGL ES 3.1",
+ "condition": "features.opengles3 && tests.opengles31",
+ "output": [
+ "publicFeature",
+ { "type": "define", "name": "QT_OPENGL_ES_3_1" }
+ ]
+ },
+ "opengl-desktop": {
+ "label": "Desktop OpenGL",
+ "enable": "input.opengl == 'desktop'",
+ "disable": "input.opengl == 'es2' || input.opengl == 'dynamic' || input.opengl == 'no'",
+ "condition": "(config.win32 && !config.winrt && !features.opengles2 && (config.msvc || libs.opengl))
+ || (!config.watchos && !config.win32 && libs.opengl)"
+ },
+ "opengl-dynamic": {
+ "label": "Dynamic OpenGL",
+ "enable": "input.opengl == 'dynamic'",
+ "autoDetect": false,
+ "condition": "config.win32 && !config.winrt",
+ "output": [
+ { "type": "publicFeature", "name": "dynamicgl" },
+ { "type": "define", "name": "QT_OPENGL_DYNAMIC" }
+ ]
+ },
+ "opengl": {
+ "label": "OpenGL",
+ "condition": "features.opengl-desktop || features.opengl-dynamic || features.opengles2",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "egl": {
+ "label": "EGL",
+ "condition": "features.opengl && (features.angle || libs.egl)",
+ "output": [ "privateFeature", "feature" ]
+ },
+ "egl_x11": {
+ "label": "EGL on X11",
+ "condition": "features.egl && tests.egl-x11",
+ "output": [ "privateFeature" ]
+ },
+ "eglfs": {
+ "label": "EGLFS",
+ "autoDetect": "!config.android && !config.win32",
+ "condition": "features.egl",
+ "output": [ "privateFeature" ]
+ },
+ "eglfs_brcm": {
+ "label": "EGLFS Rasberry Pi",
+ "condition": "features.eglfs && tests.egl-brcm",
+ "output": [ "privateFeature" ]
+ },
+ "eglfs_egldevice": {
+ "label": "EGLFS EGLDevice",
+ "condition": "features.eglfs && tests.egl-egldevice && features.kms",
+ "output": [ "privateFeature" ]
+ },
+ "eglfs_gbm": {
+ "label": "EGLFS GBM",
+ "condition": "features.eglfs && features.gbm && features.kms",
+ "output": [ "privateFeature" ]
+ },
+ "eglfs_mali": {
+ "label": "EGLFS Mali",
+ "condition": "features.eglfs && (tests.egl-mali || tests.egl-mali-2)",
+ "output": [ "privateFeature" ]
+ },
+ "eglfs_viv": {
+ "label": "EGLFS i.Mx6",
+ "condition": "features.eglfs && tests.egl-viv",
+ "output": [ "privateFeature" ]
+ },
+ "eglfs_viv_wl": {
+ "label": "EGLFS i.Mx6 Wayland",
+ "condition": "features.eglfs_viv && libs.wayland_server",
+ "output": [ "privateFeature" ]
+ },
+ "gif": {
+ "label": "GIF",
+ "output": [
+ "privateFeature",
+ { "type": "define", "negative": true, "name": "QT_NO_IMAGEFORMAT_GIF" }
+ ]
+ },
+ "ico": {
+ "label": "ICO",
+ "output": [ "privateFeature", "feature" ]
+ },
+ "jpeg": {
+ "label": "JPEG",
+ "disable": "input.libjpeg == 'no'",
+ "output": [
+ "privateFeature",
+ { "type": "define", "negative": true, "name": "QT_NO_IMAGEFORMAT_JPEG" }
+ ]
+ },
+ "system-jpeg": {
+ "label": " Using system libjpeg",
+ "disable": "input.libjpeg == 'qt'",
+ "enable": "input.libjpeg == 'system'",
+ "condition": "features.jpeg && libs.libjpeg",
+ "output": [ "privateFeature" ]
+ },
+ "png": {
+ "label": "PNG",
+ "disable": "input.libpng == 'no'",
+ "output": [
+ "privateFeature",
+ { "type": "define", "negative": true, "name": "QT_NO_IMAGEFORMAT_PNG" }
+ ]
+ },
+ "system-png": {
+ "label": " Using system libpng",
+ "disable": "input.libpng == 'qt'",
+ "enable": "input.libpng == 'system'",
+ "condition": "features.png && libs.libpng",
+ "output": [ "privateFeature" ]
+ },
+ "qpa_default_platform": {
+ "label": "QPA default platform",
+ "condition": "features.gui",
+ "output": [
+ { "type": "define", "name": "QT_QPA_DEFAULT_PLATFORM_NAME", "value": "tests.qpa_default_platform.name" },
+ { "type": "varAssign", "public": true, "name": "QT_DEFAULT_QPA_PLUGIN", "value": "tests.qpa_default_platform.plugin",
+ "condition": "!features.shared" }
+ ]
+ },
+ "sessionmanager": {
+ "label": "Session Management",
+ "purpose": "Provides an interface to the windowing system's session management.",
+ "section": "Kernel",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "tslib": {
+ "label": "tslib",
+ "condition": "libs.tslib",
+ "output": [ "privateFeature" ]
+ },
+ "xcb": {
+ "label": "XCB",
+ "autoDetect": "!config.darwin",
+ "condition": "libs.xcb",
+ "output": [ "privateFeature" ]
+ },
+ "system-xcb": {
+ "label": "Using system provided XCB libraries",
+ "enable": "input.xcb == 'system' || input.xcb == 'yes'",
+ "disable": "input.xcb == 'qt' || input.xcb == 'no'",
+ "autoDetect": "!config.darwin",
+ "condition": "libs.xcb && libs.xcb_syslibs",
+ "output": [ "privateFeature" ]
+ },
+ "x11-prefix": {
+ "label": "X11 prefix",
+ "emitIf": "features.xcb",
+ "output": [ { "type": "varAssign", "name": "QMAKE_X11_PREFIX", "value": "tests.x11prefix.value" } ]
+ },
+ "xcb-glx": {
+ "label": "XCB GLX",
+ "emitIf": "features.xcb",
+ "condition": "libs.xcb_glx",
+ "output": [ "privateFeature" ]
+ },
+ "xcb-render": {
+ "label": "XCB render",
+ "emitIf": "features.system-xcb",
+ "condition": "libs.xcb_render",
+ "output": [ "privateFeature" ]
+ },
+ "xcb-xlib": {
+ "label": "XCB Xlib",
+ "emitIf": "features.xcb",
+ "condition": "libs.xcb_xlib",
+ "output": [ "privateFeature" ]
+ },
+ "xcb-sm": {
+ "label": "xcb-sm",
+ "emitIf": "features.xcb",
+ "condition": "features.sessionmanager && libs.x11sm",
+ "output": [ "privateFeature" ]
+ },
+ "xinput2": {
+ "label": "Xinput2",
+ "condition": "libs.xinput2",
+ "output": [ "privateFeature" ]
+ },
+ "xkbcommon-evdev": {
+ "label": "xkbcommon-evdev",
+ "condition": "libs.xkbcommon",
+ "output": [ "privateFeature" ]
+ },
+ "xkbcommon-system": {
+ "label": "Using system-provided xkbcommon",
+ "emitIf": "features.xcb",
+ "enable": "input.xkbcommon == 'system'",
+ "disable": "input.xkbcommon == 'qt' || input.xkbcommon == 'no'",
+ "condition": "libs.xkbcommon_x11",
+ "output": [ "privateFeature" ]
+ },
+ "xkb": {
+ "label": "XCB XKB",
+ "condition": "features.system-xcb && libs.xcb_xkb",
+ "output": [ "privateFeature" ]
+ },
+ "xkb-config-root": {
+ "label": "XKB config root",
+ "emitIf": "features.xcb",
+ "condition": "features.xcb && !features.xkbcommon-system && tests.xkbconfigroot",
+ "output": [ { "type": "varAssign", "name": "QMAKE_XKB_CONFIG_ROOT", "value": "tests.xkbconfigroot.value"} ]
+ },
+ "xlib": {
+ "label": "XLib",
+ "condition": "tests.xlib",
+ "output": [ "privateFeature" ]
+ },
+ "xrender": {
+ "label": "Xrender",
+ "condition": "libs.xrender",
+ "output": [ "privateFeature", "feature" ]
+ },
+ "texthtmlparser": {
+ "label": "HtmlParser",
+ "purpose": "Provides a parser for HTML.",
+ "section": "Kernel",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "textodfwriter": {
+ "label": "OdfWriter",
+ "purpose": "Provides an ODF writer.",
+ "section": "Kernel",
+ "condition": "features.xmlstreamwriter",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "cssparser": {
+ "label": "CssParser",
+ "purpose": "Provides a parser for Cascading Style Sheets.",
+ "section": "Kernel",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "draganddrop": {
+ "label": "Drag and Drop",
+ "purpose": "Supports the drag and drop mechansim.",
+ "section": "Kernel",
+ "condition": "features.imageformat_xpm",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "shortcut": {
+ "label": "QShortcut",
+ "purpose": "Provides keyboard accelerators and shortcuts.",
+ "section": "Kernel",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "action": {
+ "label": "QAction",
+ "purpose": "Provides widget actions.",
+ "section": "Kernel",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "cursor": {
+ "label": "QCursor",
+ "purpose": "Provides mouse cursors.",
+ "section": "Kernel",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "clipboard": {
+ "label": "QClipboard",
+ "purpose": "Provides cut and paste operations.",
+ "section": "Kernel",
+ "condition": "!config.integrity && !config.qnx",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "wheelevent": {
+ "label": "QWheelEvent",
+ "purpose": "Supports wheel events.",
+ "section": "Kernel",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "tabletevent": {
+ "label": "QTabletEvent",
+ "purpose": "Supports tablet events.",
+ "section": "Kernel",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "im": {
+ "label": "QInputContext",
+ "purpose": "Provides complex input methods.",
+ "section": "Kernel",
+ "condition": "features.library",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "validator": {
+ "label": "QValidator",
+ "purpose": "Supports validation of input text.",
+ "section": "Widgets",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "standarditemmodel": {
+ "label": "QStandardItemModel",
+ "purpose": "Provides a generic model for storing custom data.",
+ "section": "ItemViews",
+ "condition": "features.itemmodel",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "imageformatplugin": {
+ "label": "QImageIOPlugin",
+ "purpose": "Provides a base for writing a image format plugins.",
+ "section": "Images",
+ "condition": "features.library",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "movie": {
+ "label": "QMovie",
+ "purpose": "Supports animated images.",
+ "section": "Images",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "imageformat_bmp": {
+ "label": "BMP Image Format",
+ "purpose": "Supports Microsoft's Bitmap image file format.",
+ "section": "Images",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "imageformat_ppm": {
+ "label": "PPM Image Format",
+ "purpose": "Supports the Portable Pixmap image file format.",
+ "section": "Images",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "imageformat_xbm": {
+ "label": "XBM Image Format",
+ "purpose": "Supports the X11 Bitmap image file format.",
+ "section": "Images",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "imageformat_xpm": {
+ "label": "XPM Image Format",
+ "purpose": "Supports the X11 Pixmap image file format.",
+ "section": "Images",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "imageformat_png": {
+ "label": "PNG Image Format",
+ "purpose": "Supports the Portable Network Graphics image file format.",
+ "section": "Images",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "imageformat_jpeg": {
+ "label": "JPEG Image Format",
+ "purpose": "Supports the Joint Photographic Experts Group image file format.",
+ "section": "Images",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "image_heuristic_mask": {
+ "label": "QImage::createHeuristicMask()",
+ "purpose": "Supports creating a 1-bpp heuristic mask for images.",
+ "section": "Images",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "image_text": {
+ "label": "Image Text",
+ "purpose": "Supports image file text strings.",
+ "section": "Images",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "picture": {
+ "label": "QPicture",
+ "purpose": "Supports recording and replaying QPainter commands.",
+ "section": "Painting",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "colornames": {
+ "label": "Color Names",
+ "purpose": "Supports color names such as \"red\", used by QColor and by some HTML documents.",
+ "section": "Painting",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "pdf": {
+ "label": "QPdf",
+ "purpose": "Provides a PDF backend for QPainter.",
+ "section": "Painting",
+ "condition": "features.temporaryfile",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "freetype": {
+ "label": "Freetype Font Engine",
+ "purpose": "Supports the FreeType 2 font engine (and its supported font formats).",
+ "section": "Fonts",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "desktopservices": {
+ "label": "QDesktopServices",
+ "purpose": "Provides methods for accessing common desktop services.",
+ "section": "Utilities",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "systemtrayicon": {
+ "label": "QSystemTrayIcon",
+ "purpose": "Provides an icon for an application in the system tray.",
+ "section": "Utilities",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "accessibility": {
+ "label": "Accessibility",
+ "purpose": "Provides accessibility support.",
+ "section": "Utilities",
+ "condition": "features.properties",
+ "output": [ "publicFeature", "feature" ]
+ }
+ },
+
+ "earlyReport": [
+ {
+ "type": "error",
+ "condition": "input.xcb != '' && input.xcb != 'no' && input.xkbcommon == 'no'",
+ "message": "XCB plugin requires libxkbcommon. See -qt-xkbcommon-x11 and -system-xkbcommon-x11."
+ }
+ ],
+
+ "report": [
+ {
+ "type": "warning",
+ "condition": "features.xcb && !features.xkbcommon-system && !features.xkb-config-root",
+ "message": "Could not find XKB config root, use -xkb-config-root to set a path to
+XKB configuration data. This is required for keyboard input support."
+ },
+ {
+ "type": "note",
+ "condition": "features.accessibility && features.xcb && !features.accessibility-atspi-bridge",
+ "message": "Disabling Linux Accessibility Bridge: D-Bus is missing."
+ },
+ {
+ "type": "warning",
+ "condition": "input.qpa-platform-guard != ''",
+ "message": "The [-no]-qpa-platform-guard argument is deprecated and has no effect."
+ },
+ {
+ "type": "warning",
+ "condition": "features.gui && config.linux && !config.android && !features.xcb && !features.eglfs && !features.directfb && !features.linuxfb && !features.mirclient",
+ "message": "No QPA platform plugin enabled! This will
+produce a Qt that cannot run GUI applications.
+The dependencies needed for xcb to build are listed in
+src/plugins/platforms/xcb/README"
+ },
+ {
+ "type": "warning",
+ "condition": "config.win32 && (features.opengles2 || features.opengl-dynamic) && !features.angle",
+ "message": "Using OpenGL ES 2.0 on Windows without ANGLE.
+The build will most likely fail.
+Specify -opengl desktop to use regular OpenGL."
+ },
+ {
+ "type": "warning",
+ "condition": "config.darwin && features.system-harfbuzz",
+ "message": "On OS X, AAT is supported only with -qt-harfbuzz."
+ },
+ {
+ "type": "error",
+ "condition": "features.gui && !config.watchos && input.opengl != 'no' && !features.opengl-desktop && !features.opengles2 && !features.opengl-dynamic",
+ "message": "The OpenGL functionality tests failed!
+You might need to modify the include and library search paths by editing QMAKE_INCDIR_OPENGL[_ES2],
+QMAKE_LIBDIR_OPENGL[_ES2] and QMAKE_LIBS_OPENGL[_ES2] in the mkspec for your platform."
+ }
+ ],
+
+ "summary": [
+ {
+ "section": "Qt Gui",
+ "entries": [
+ "freetype",
+ "system-freetype",
+ "harfbuzz",
+ "system-harfbuzz",
+ "fontconfig",
+ {
+ "section": "Image formats",
+ "entries": [
+ "gif", "ico", "jpeg", "system-jpeg", "png", "system-png"
+ ]
+ },
+ {
+ "section": "OpenGL",
+ "entries": [
+ {
+ "type": "feature",
+ "args": "angle",
+ "condition": "config.win32"
+ },
+ "egl",
+ "opengl-desktop",
+ {
+ "type": "feature",
+ "args": "opengl-dynamic",
+ "condition": "config.win32"
+ },
+ "opengles2",
+ "opengles3",
+ "opengles31"
+ ]
+ },
+ "sessionmanager"
+ ]
+ },
+ {
+ "section": "Features used by QPA backends",
+ "entries": [
+ "evdev",
+ "libinput",
+ "mtdev",
+ "tslib",
+ "xkbcommon-evdev"
+ ]
+ },
+ {
+ "section": "QPA backends",
+ "entries": [
+ "directfb", "eglfs",
+ {
+ "section": "EGLFS details",
+ "condition": "features.eglfs",
+ "entries": [
+ "eglfs_viv", "eglfs_viv_wl", "eglfs_egldevice", "eglfs_gbm", "eglfs_mali", "eglfs_brcm", "egl_x11"
+ ]
+ },
+ "linuxfb", "mirclient",
+ {
+ "message": "INTEGRITY framebuffer",
+ "condition": "config.integrity",
+ "args": "integrityfb"
+ },
+ {
+ "section": "QNX",
+ "condition": "config.qnx",
+ "entries": [
+ "lgmon", "qqnx_imf"
+ ]
+ },
+ {
+ "section": "X11",
+ "condition": "features.xcb",
+ "entries": [
+ "system-xcb", "egl_x11", "xinput2", "xkb", "xlib", "xrender", "xcb-render", "xcb-glx", "xcb-xlib", "xkbcommon-system"
+ ]
+ },
+ {
+ "section": "Windows",
+ "condition": "config.win32",
+ "entries": [
+ "direct2d", "directwrite", "directwrite2"
+ ]
+ }
+ ]
+ }
+ ]
+}
diff --git a/src/gui/configure.pri b/src/gui/configure.pri
new file mode 100644
index 0000000000..d79c5a6bba
--- /dev/null
+++ b/src/gui/configure.pri
@@ -0,0 +1,67 @@
+# custom tests
+
+# Check for Direct X SDK (include, lib, and direct shader compiler 'fxc').
+# Up to Direct X SDK June 2010 and for MinGW, this is pointed to by the
+# DXSDK_DIR variable. Starting with Windows Kit 8, it is included in
+# the Windows SDK. Checking for the header is not sufficient, since it
+# is also present in MinGW.
+defineTest(qtConfTest_directX) {
+ dxdir = $$getenv("DXSDK_DIR")
+ !isEmpty(dxdir) {
+ EXTRA_INCLUDEPATH += $$dxdir/include
+ equals(QT_ARCH, x86_64): \
+ EXTRA_LIBDIR += $$dxdir/lib/x64
+ else: \
+ EXTRA_LIBDIR += $$dxdir/lib/x86
+ EXTRA_PATH += $$dxdir/Utilities/bin/x86
+ }
+
+ $$qtConfEvaluate("features.sse2") {
+ ky = $$size($${1}.files._KEYS_)
+ $${1}.files._KEYS_ += $$ky
+ # Not present on MinGW-32
+ $${1}.files.$${ky} = "intrin.h"
+ }
+
+ qtConfTest_files($${1}): return(true)
+ return(false)
+}
+
+defineTest(qtConfTest_xkbConfigRoot) {
+ qtConfTest_getPkgConfigVariable($${1}): return(true)
+
+ for (dir, $$list("/usr/share/X11/xkb", "/usr/local/share/X11/xkb")) {
+ exists($$dir) {
+ $${1}.value = $$dir
+ export($${1}.value)
+ $${1}.cache += value
+ export($${1}.cache)
+ return(true)
+ }
+ }
+ return(false)
+}
+
+defineTest(qtConfTest_qpaDefaultPlatform) {
+ name =
+ !isEmpty(config.input.qpa_default_platform): name = $$config.input.qpa_default_platform
+ else: !isEmpty(QT_QPA_DEFAULT_PLATFORM): name = $$QT_QPA_DEFAULT_PLATFORM
+ else: winrt: name = winrt
+ else: win32: name = windows
+ else: android: name = android
+ else: macos: name = cocoa
+ else: ios: name = ios
+ else: qnx: name = qnx
+ else: integrity: name = integrityfb
+ else: name = xcb
+
+ $${1}.value = $$name
+ $${1}.plugin = q$$name
+ $${1}.name = "\"$$name\""
+ export($${1}.value)
+ export($${1}.plugin)
+ export($${1}.name)
+ $${1}.cache += value plugin name
+ export($${1}.cache)
+ return(true)
+}
diff --git a/src/gui/image/qicon.cpp b/src/gui/image/qicon.cpp
index 62ec8e93b2..db118edf04 100644
--- a/src/gui/image/qicon.cpp
+++ b/src/gui/image/qicon.cpp
@@ -47,6 +47,8 @@
#include "private/qiconloader_p.h"
#include "qpainter.h"
#include "qfileinfo.h"
+#include <qmimedatabase.h>
+#include <qmimetype.h>
#include "qpixmapcache.h"
#include "qvariant.h"
#include "qcache.h"
@@ -839,8 +841,11 @@ QPixmap QIcon::pixmap(QWindow *window, const QSize &size, Mode mode, State state
qreal devicePixelRatio = qt_effective_device_pixel_ratio(window);
// Handle the simple normal-dpi case:
- if (!(devicePixelRatio > 1.0))
- return d->engine->pixmap(size, mode, state);
+ if (!(devicePixelRatio > 1.0)) {
+ QPixmap pixmap = d->engine->pixmap(size, mode, state);
+ pixmap.setDevicePixelRatio(1.0);
+ return pixmap;
+ }
// Try get a pixmap that is big enough to be displayed at device pixel resolution.
QPixmap pixmap = d->engine->pixmap(size * devicePixelRatio, mode, state);
@@ -976,6 +981,18 @@ void QIcon::addPixmap(const QPixmap &pixmap, Mode mode, State state)
d->engine->addPixmap(pixmap, mode, state);
}
+static QIconEngine *iconEngineFromSuffix(const QString &fileName, const QString &suffix)
+{
+ if (!suffix.isEmpty()) {
+ const int index = loader()->indexOf(suffix);
+ if (index != -1) {
+ if (QIconEnginePlugin *factory = qobject_cast<QIconEnginePlugin*>(loader()->instance(index))) {
+ return factory->create(fileName);
+ }
+ }
+ }
+ return nullptr;
+}
/*! Adds an image from the file with the given \a fileName to the
icon, as a specialization for \a size, \a mode and \a state. The
@@ -1013,25 +1030,15 @@ void QIcon::addFile(const QString &fileName, const QSize &size, Mode mode, State
return;
detach();
if (!d) {
+
QFileInfo info(fileName);
- QString suffix = info.suffix();
- if (!suffix.isEmpty()) {
- // first try version 2 engines..
- const int index = loader()->indexOf(suffix);
- if (index != -1) {
- if (QIconEnginePlugin *factory = qobject_cast<QIconEnginePlugin*>(loader()->instance(index))) {
- if (QIconEngine *engine = factory->create(fileName)) {
- d = new QIconPrivate;
- d->engine = engine;
- }
- }
- }
- }
- // ...then fall back to the default engine
- if (!d) {
- d = new QIconPrivate;
- d->engine = new QPixmapIconEngine;
- }
+ QIconEngine *engine = iconEngineFromSuffix(fileName, info.suffix());
+#ifndef QT_NO_MIMETYPE
+ if (!engine)
+ engine = iconEngineFromSuffix(fileName, QMimeDatabase().mimeTypeForFile(info).preferredSuffix());
+#endif // !QT_NO_MIMETYPE
+ d = new QIconPrivate;
+ d->engine = engine ? engine : new QPixmapIconEngine;
}
d->engine->addFile(fileName, size, mode, state);
diff --git a/src/gui/image/qiconloader.cpp b/src/gui/image/qiconloader.cpp
index e61a6bb48e..eda9d6f24e 100644
--- a/src/gui/image/qiconloader.cpp
+++ b/src/gui/image/qiconloader.cpp
@@ -199,7 +199,7 @@ private:
QIconCacheGtkReader::QIconCacheGtkReader(const QString &dirName)
: m_isValid(false)
{
- QFileInfo info(dirName + QLatin1Literal("/icon-theme.cache"));
+ QFileInfo info(dirName + QLatin1String("/icon-theme.cache"));
if (!info.exists() || info.lastModified() < QFileInfo(dirName).lastModified())
return;
m_file.setFileName(info.absoluteFilePath());
diff --git a/src/gui/kernel/qtguiglobal.h b/src/gui/kernel/qtguiglobal.h
index f0e64fbc53..8a7409e3d9 100644
--- a/src/gui/kernel/qtguiglobal.h
+++ b/src/gui/kernel/qtguiglobal.h
@@ -41,6 +41,7 @@
#define QTGUIGLOBAL_H
#include <QtCore/qglobal.h>
+#include <QtGui/qtgui-config.h>
QT_BEGIN_NAMESPACE
diff --git a/src/gui/kernel/qtguiglobal_p.h b/src/gui/kernel/qtguiglobal_p.h
index fd04b8ff95..d2c0b3c5d1 100644
--- a/src/gui/kernel/qtguiglobal_p.h
+++ b/src/gui/kernel/qtguiglobal_p.h
@@ -53,5 +53,6 @@
#include <QtGui/qtguiglobal.h>
#include <QtCore/private/qglobal_p.h>
+#include <QtGui/private/qtgui-config_p.h>
#endif // QTGUIGLOBAL_P_H
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp
index 5f71bdaded..18e8bcf99c 100644
--- a/src/gui/kernel/qwindow.cpp
+++ b/src/gui/kernel/qwindow.cpp
@@ -2195,6 +2195,9 @@ void QWindowPrivate::deliverUpdateRequest()
*/
void QWindow::requestUpdate()
{
+ Q_ASSERT_X(QThread::currentThread() == QCoreApplication::instance()->thread(),
+ "QWindow", "Updates can only be scheduled from the GUI (main) thread");
+
Q_D(QWindow);
if (d->updateRequestPending || !d->platformWindow)
return;
diff --git a/src/gui/kernel/qwindow_p.h b/src/gui/kernel/qwindow_p.h
index 6d6d5a22ee..b8a9f5d3de 100644
--- a/src/gui/kernel/qwindow_p.h
+++ b/src/gui/kernel/qwindow_p.h
@@ -126,8 +126,14 @@ public:
QPoint globalPosition() const {
Q_Q(const QWindow);
QPoint offset = q->position();
- for (const QWindow *p = q->parent(); p; p = p->parent())
- offset += p->position();
+ for (const QWindow *p = q->parent(); p; p = p->parent()) {
+ if (p->type() != Qt::ForeignWindow) {
+ offset += p->position();
+ } else { // QTBUG-43252, mapToGlobal() for foreign children.
+ offset += p->mapToGlobal(QPoint(0, 0));
+ break;
+ }
+ }
return offset;
}
diff --git a/src/gui/opengl/qopengl.h b/src/gui/opengl/qopengl.h
index e2408d0047..c7a3e79666 100644
--- a/src/gui/opengl/qopengl.h
+++ b/src/gui/opengl/qopengl.h
@@ -95,14 +95,15 @@ typedef void* GLeglImageOES;
// applications cannot target ES 3. Therefore QOpenGLFunctions and
// friends do everything dynamically and never rely on these macros.
+# ifndef GL_GLEXT_PROTOTYPES
+# define GL_GLEXT_PROTOTYPES
+# endif
+
# if defined(QT_OPENGL_ES_3_1)
# include <GLES3/gl31.h>
# elif defined(QT_OPENGL_ES_3)
# include <GLES3/gl3.h>
# else
-# ifndef GL_GLEXT_PROTOTYPES
-# define GL_GLEXT_PROTOTYPES
-# endif
# include <GLES2/gl2.h>
#endif
diff --git a/src/gui/opengl/qopenglframebufferobject.cpp b/src/gui/opengl/qopenglframebufferobject.cpp
index 1ccd78d2ed..e0f469cbcb 100644
--- a/src/gui/opengl/qopenglframebufferobject.cpp
+++ b/src/gui/opengl/qopenglframebufferobject.cpp
@@ -1283,11 +1283,11 @@ static inline QImage qt_gl_read_framebuffer_rgba8(const QSize &size, bool includ
? context->hasExtension(QByteArrayLiteral("GL_EXT_read_format_bgra"))
: context->hasExtension(QByteArrayLiteral("GL_EXT_bgra"));
+#ifndef Q_OS_IOS
const char *renderer = reinterpret_cast<const char *>(funcs->glGetString(GL_RENDERER));
const char *ver = reinterpret_cast<const char *>(funcs->glGetString(GL_VERSION));
// Blacklist GPU chipsets that have problems with their BGRA support.
-#ifndef Q_OS_IOS
const bool blackListed = (qstrcmp(renderer, "PowerVR Rogue G6200") == 0
&& ::strstr(ver, "1.3") != 0) ||
(qstrcmp(renderer, "Mali-T760") == 0
diff --git a/src/gui/painting/painting.pri b/src/gui/painting/painting.pri
index 00f2375923..c47060a2ad 100644
--- a/src/gui/painting/painting.pri
+++ b/src/gui/painting/painting.pri
@@ -63,7 +63,6 @@ SOURCES += \
painting/qblittable.cpp \
painting/qbrush.cpp \
painting/qcolor.cpp \
- painting/qcolor_p.cpp \
painting/qcompositionfunctions.cpp \
painting/qcosmeticstroker.cpp \
painting/qcssutil.cpp \
diff --git a/src/gui/painting/qcolor.cpp b/src/gui/painting/qcolor.cpp
index 56180af693..650ba0187e 100644
--- a/src/gui/painting/qcolor.cpp
+++ b/src/gui/painting/qcolor.cpp
@@ -43,6 +43,9 @@
#include "qdatastream.h"
#include "qvariant.h"
#include "qdebug.h"
+#include "private/qtools_p.h"
+
+#include <algorithm>
#include <stdio.h>
#include <limits.h>
@@ -50,6 +53,326 @@
QT_BEGIN_NAMESPACE
/*!
+ \internal
+ If s[0..1] is a valid hex number, returns its integer value,
+ otherwise returns -1.
+ */
+static inline int hex2int(const char *s)
+{
+ const int hi = QtMiscUtils::fromHex(s[0]);
+ if (hi < 0)
+ return -1;
+ const int lo = QtMiscUtils::fromHex(s[1]);
+ if (lo < 0)
+ return -1;
+ return (hi << 4) | lo;
+}
+
+/*!
+ \internal
+ If s is a valid hex digit, returns its integer value,
+ multiplied by 0x11, otherwise returns -1.
+ */
+static inline int hex2int(char s)
+{
+ const int h = QtMiscUtils::fromHex(s);
+ return h < 0 ? h : (h << 4) | h;
+}
+
+bool qt_get_hex_rgb(const char *name, QRgb *rgb)
+{
+ if (name[0] != '#')
+ return false;
+ name++;
+ int len = qstrlen(name);
+ int a, r, g, b;
+ a = 255;
+ if (len == 12) {
+ r = hex2int(name);
+ g = hex2int(name + 4);
+ b = hex2int(name + 8);
+ } else if (len == 9) {
+ r = hex2int(name);
+ g = hex2int(name + 3);
+ b = hex2int(name + 6);
+ } else if (len == 8) {
+ a = hex2int(name);
+ r = hex2int(name + 2);
+ g = hex2int(name + 4);
+ b = hex2int(name + 6);
+ } else if (len == 6) {
+ r = hex2int(name);
+ g = hex2int(name + 2);
+ b = hex2int(name + 4);
+ } else if (len == 3) {
+ r = hex2int(name[0]);
+ g = hex2int(name[1]);
+ b = hex2int(name[2]);
+ } else {
+ r = g = b = -1;
+ }
+ if ((uint)r > 255 || (uint)g > 255 || (uint)b > 255 || (uint)a > 255) {
+ *rgb = 0;
+ return false;
+ }
+ *rgb = qRgba(r, g ,b, a);
+ return true;
+}
+
+bool qt_get_hex_rgb(const QChar *str, int len, QRgb *rgb)
+{
+ if (len > 13)
+ return false;
+ char tmp[16];
+ for (int i = 0; i < len; ++i)
+ tmp[i] = str[i].toLatin1();
+ tmp[len] = 0;
+ return qt_get_hex_rgb(tmp, rgb);
+}
+
+#ifndef QT_NO_COLORNAMES
+
+/*
+ CSS color names = SVG 1.0 color names + transparent (rgba(0,0,0,0))
+*/
+
+#ifdef rgb
+# undef rgb
+#endif
+#define rgb(r,g,b) (0xff000000 | (r << 16) | (g << 8) | b)
+
+static const struct RGBData {
+ const char name[21];
+ uint value;
+} rgbTbl[] = {
+ { "aliceblue", rgb(240, 248, 255) },
+ { "antiquewhite", rgb(250, 235, 215) },
+ { "aqua", rgb( 0, 255, 255) },
+ { "aquamarine", rgb(127, 255, 212) },
+ { "azure", rgb(240, 255, 255) },
+ { "beige", rgb(245, 245, 220) },
+ { "bisque", rgb(255, 228, 196) },
+ { "black", rgb( 0, 0, 0) },
+ { "blanchedalmond", rgb(255, 235, 205) },
+ { "blue", rgb( 0, 0, 255) },
+ { "blueviolet", rgb(138, 43, 226) },
+ { "brown", rgb(165, 42, 42) },
+ { "burlywood", rgb(222, 184, 135) },
+ { "cadetblue", rgb( 95, 158, 160) },
+ { "chartreuse", rgb(127, 255, 0) },
+ { "chocolate", rgb(210, 105, 30) },
+ { "coral", rgb(255, 127, 80) },
+ { "cornflowerblue", rgb(100, 149, 237) },
+ { "cornsilk", rgb(255, 248, 220) },
+ { "crimson", rgb(220, 20, 60) },
+ { "cyan", rgb( 0, 255, 255) },
+ { "darkblue", rgb( 0, 0, 139) },
+ { "darkcyan", rgb( 0, 139, 139) },
+ { "darkgoldenrod", rgb(184, 134, 11) },
+ { "darkgray", rgb(169, 169, 169) },
+ { "darkgreen", rgb( 0, 100, 0) },
+ { "darkgrey", rgb(169, 169, 169) },
+ { "darkkhaki", rgb(189, 183, 107) },
+ { "darkmagenta", rgb(139, 0, 139) },
+ { "darkolivegreen", rgb( 85, 107, 47) },
+ { "darkorange", rgb(255, 140, 0) },
+ { "darkorchid", rgb(153, 50, 204) },
+ { "darkred", rgb(139, 0, 0) },
+ { "darksalmon", rgb(233, 150, 122) },
+ { "darkseagreen", rgb(143, 188, 143) },
+ { "darkslateblue", rgb( 72, 61, 139) },
+ { "darkslategray", rgb( 47, 79, 79) },
+ { "darkslategrey", rgb( 47, 79, 79) },
+ { "darkturquoise", rgb( 0, 206, 209) },
+ { "darkviolet", rgb(148, 0, 211) },
+ { "deeppink", rgb(255, 20, 147) },
+ { "deepskyblue", rgb( 0, 191, 255) },
+ { "dimgray", rgb(105, 105, 105) },
+ { "dimgrey", rgb(105, 105, 105) },
+ { "dodgerblue", rgb( 30, 144, 255) },
+ { "firebrick", rgb(178, 34, 34) },
+ { "floralwhite", rgb(255, 250, 240) },
+ { "forestgreen", rgb( 34, 139, 34) },
+ { "fuchsia", rgb(255, 0, 255) },
+ { "gainsboro", rgb(220, 220, 220) },
+ { "ghostwhite", rgb(248, 248, 255) },
+ { "gold", rgb(255, 215, 0) },
+ { "goldenrod", rgb(218, 165, 32) },
+ { "gray", rgb(128, 128, 128) },
+ { "green", rgb( 0, 128, 0) },
+ { "greenyellow", rgb(173, 255, 47) },
+ { "grey", rgb(128, 128, 128) },
+ { "honeydew", rgb(240, 255, 240) },
+ { "hotpink", rgb(255, 105, 180) },
+ { "indianred", rgb(205, 92, 92) },
+ { "indigo", rgb( 75, 0, 130) },
+ { "ivory", rgb(255, 255, 240) },
+ { "khaki", rgb(240, 230, 140) },
+ { "lavender", rgb(230, 230, 250) },
+ { "lavenderblush", rgb(255, 240, 245) },
+ { "lawngreen", rgb(124, 252, 0) },
+ { "lemonchiffon", rgb(255, 250, 205) },
+ { "lightblue", rgb(173, 216, 230) },
+ { "lightcoral", rgb(240, 128, 128) },
+ { "lightcyan", rgb(224, 255, 255) },
+ { "lightgoldenrodyellow", rgb(250, 250, 210) },
+ { "lightgray", rgb(211, 211, 211) },
+ { "lightgreen", rgb(144, 238, 144) },
+ { "lightgrey", rgb(211, 211, 211) },
+ { "lightpink", rgb(255, 182, 193) },
+ { "lightsalmon", rgb(255, 160, 122) },
+ { "lightseagreen", rgb( 32, 178, 170) },
+ { "lightskyblue", rgb(135, 206, 250) },
+ { "lightslategray", rgb(119, 136, 153) },
+ { "lightslategrey", rgb(119, 136, 153) },
+ { "lightsteelblue", rgb(176, 196, 222) },
+ { "lightyellow", rgb(255, 255, 224) },
+ { "lime", rgb( 0, 255, 0) },
+ { "limegreen", rgb( 50, 205, 50) },
+ { "linen", rgb(250, 240, 230) },
+ { "magenta", rgb(255, 0, 255) },
+ { "maroon", rgb(128, 0, 0) },
+ { "mediumaquamarine", rgb(102, 205, 170) },
+ { "mediumblue", rgb( 0, 0, 205) },
+ { "mediumorchid", rgb(186, 85, 211) },
+ { "mediumpurple", rgb(147, 112, 219) },
+ { "mediumseagreen", rgb( 60, 179, 113) },
+ { "mediumslateblue", rgb(123, 104, 238) },
+ { "mediumspringgreen", rgb( 0, 250, 154) },
+ { "mediumturquoise", rgb( 72, 209, 204) },
+ { "mediumvioletred", rgb(199, 21, 133) },
+ { "midnightblue", rgb( 25, 25, 112) },
+ { "mintcream", rgb(245, 255, 250) },
+ { "mistyrose", rgb(255, 228, 225) },
+ { "moccasin", rgb(255, 228, 181) },
+ { "navajowhite", rgb(255, 222, 173) },
+ { "navy", rgb( 0, 0, 128) },
+ { "oldlace", rgb(253, 245, 230) },
+ { "olive", rgb(128, 128, 0) },
+ { "olivedrab", rgb(107, 142, 35) },
+ { "orange", rgb(255, 165, 0) },
+ { "orangered", rgb(255, 69, 0) },
+ { "orchid", rgb(218, 112, 214) },
+ { "palegoldenrod", rgb(238, 232, 170) },
+ { "palegreen", rgb(152, 251, 152) },
+ { "paleturquoise", rgb(175, 238, 238) },
+ { "palevioletred", rgb(219, 112, 147) },
+ { "papayawhip", rgb(255, 239, 213) },
+ { "peachpuff", rgb(255, 218, 185) },
+ { "peru", rgb(205, 133, 63) },
+ { "pink", rgb(255, 192, 203) },
+ { "plum", rgb(221, 160, 221) },
+ { "powderblue", rgb(176, 224, 230) },
+ { "purple", rgb(128, 0, 128) },
+ { "red", rgb(255, 0, 0) },
+ { "rosybrown", rgb(188, 143, 143) },
+ { "royalblue", rgb( 65, 105, 225) },
+ { "saddlebrown", rgb(139, 69, 19) },
+ { "salmon", rgb(250, 128, 114) },
+ { "sandybrown", rgb(244, 164, 96) },
+ { "seagreen", rgb( 46, 139, 87) },
+ { "seashell", rgb(255, 245, 238) },
+ { "sienna", rgb(160, 82, 45) },
+ { "silver", rgb(192, 192, 192) },
+ { "skyblue", rgb(135, 206, 235) },
+ { "slateblue", rgb(106, 90, 205) },
+ { "slategray", rgb(112, 128, 144) },
+ { "slategrey", rgb(112, 128, 144) },
+ { "snow", rgb(255, 250, 250) },
+ { "springgreen", rgb( 0, 255, 127) },
+ { "steelblue", rgb( 70, 130, 180) },
+ { "tan", rgb(210, 180, 140) },
+ { "teal", rgb( 0, 128, 128) },
+ { "thistle", rgb(216, 191, 216) },
+ { "tomato", rgb(255, 99, 71) },
+ { "transparent", 0 },
+ { "turquoise", rgb( 64, 224, 208) },
+ { "violet", rgb(238, 130, 238) },
+ { "wheat", rgb(245, 222, 179) },
+ { "white", rgb(255, 255, 255) },
+ { "whitesmoke", rgb(245, 245, 245) },
+ { "yellow", rgb(255, 255, 0) },
+ { "yellowgreen", rgb(154, 205, 50) }
+};
+
+static const int rgbTblSize = sizeof(rgbTbl) / sizeof(RGBData);
+
+#undef rgb
+
+#if defined(Q_CC_MSVC) && _MSC_VER < 1600
+inline bool operator<(const RGBData &data1, const RGBData &data2)
+{ return qstrcmp(data1.name, data2.name) < 0; }
+#endif
+
+inline bool operator<(const char *name, const RGBData &data)
+{ return qstrcmp(name, data.name) < 0; }
+inline bool operator<(const RGBData &data, const char *name)
+{ return qstrcmp(data.name, name) < 0; }
+
+static bool get_named_rgb(const char *name_no_space, QRgb *rgb)
+{
+ const RGBData *r = std::lower_bound(rgbTbl, rgbTbl + rgbTblSize, name_no_space);
+ if ((r != rgbTbl + rgbTblSize) && !(name_no_space < *r)) {
+ *rgb = r->value;
+ return true;
+ }
+ return false;
+}
+
+bool qt_get_named_rgb(const char *name, QRgb* rgb)
+{
+ int len = int(strlen(name));
+ if (len > 255)
+ return false;
+ char name_no_space[256];
+ int pos = 0;
+ for (int i = 0; i < len; i++) {
+ if (name[i] != '\t' && name[i] != ' ')
+ name_no_space[pos++] = QChar::toLower(name[i]);
+ }
+ name_no_space[pos] = 0;
+
+ return get_named_rgb(name_no_space, rgb);
+}
+
+bool qt_get_named_rgb(const QChar *name, int len, QRgb *rgb)
+{
+ if (len > 255)
+ return false;
+ char name_no_space[256];
+ int pos = 0;
+ for (int i = 0; i < len; i++) {
+ if (name[i] != QLatin1Char('\t') && name[i] != QLatin1Char(' '))
+ name_no_space[pos++] = name[i].toLower().toLatin1();
+ }
+ name_no_space[pos] = 0;
+ return get_named_rgb(name_no_space, rgb);
+}
+
+QStringList qt_get_colornames()
+{
+ int i = 0;
+ QStringList lst;
+ lst.reserve(rgbTblSize);
+ for (i = 0; i < rgbTblSize; i++)
+ lst << QLatin1String(rgbTbl[i].name);
+ return lst;
+}
+
+#else
+
+bool qt_get_named_rgb(const char *, QRgb*)
+{
+ return false;
+}
+
+QStringList qt_get_colornames()
+{
+ return QStringList();
+}
+#endif // QT_NO_COLORNAMES
+
+/*!
\class QColor
\brief The QColor class provides colors based on RGB, HSV or CMYK values.
diff --git a/src/gui/painting/qcolor_p.cpp b/src/gui/painting/qcolor_p.cpp
deleted file mode 100644
index b4ade9dc58..0000000000
--- a/src/gui/painting/qcolor_p.cpp
+++ /dev/null
@@ -1,369 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtGui module 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 "qglobal.h"
-#include "qrgb.h"
-#include "qstringlist.h"
-#include "private/qtools_p.h"
-
-#include <algorithm>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \internal
- If s[0..1] is a valid hex number, returns its integer value,
- otherwise returns -1.
- */
-static inline int hex2int(const char *s)
-{
- const int hi = QtMiscUtils::fromHex(s[0]);
- if (hi < 0)
- return -1;
- const int lo = QtMiscUtils::fromHex(s[1]);
- if (lo < 0)
- return -1;
- return (hi << 4) | lo;
-}
-
-/*!
- \internal
- If s is a valid hex digit, returns its integer value,
- multiplied by 0x11, otherwise returns -1.
- */
-static inline int hex2int(char s)
-{
- const int h = QtMiscUtils::fromHex(s);
- return h < 0 ? h : (h << 4) | h;
-}
-
-bool qt_get_hex_rgb(const char *name, QRgb *rgb)
-{
- if(name[0] != '#')
- return false;
- name++;
- int len = qstrlen(name);
- int a, r, g, b;
- a = 255;
- if (len == 12) {
- r = hex2int(name);
- g = hex2int(name + 4);
- b = hex2int(name + 8);
- } else if (len == 9) {
- r = hex2int(name);
- g = hex2int(name + 3);
- b = hex2int(name + 6);
- } else if (len == 8) {
- a = hex2int(name);
- r = hex2int(name + 2);
- g = hex2int(name + 4);
- b = hex2int(name + 6);
- } else if (len == 6) {
- r = hex2int(name);
- g = hex2int(name + 2);
- b = hex2int(name + 4);
- } else if (len == 3) {
- r = hex2int(name[0]);
- g = hex2int(name[1]);
- b = hex2int(name[2]);
- } else {
- r = g = b = -1;
- }
- if ((uint)r > 255 || (uint)g > 255 || (uint)b > 255 || (uint)a > 255) {
- *rgb = 0;
- return false;
- }
- *rgb = qRgba(r, g ,b, a);
- return true;
-}
-
-bool qt_get_hex_rgb(const QChar *str, int len, QRgb *rgb)
-{
- if (len > 13)
- return false;
- char tmp[16];
- for(int i = 0; i < len; ++i)
- tmp[i] = str[i].toLatin1();
- tmp[len] = 0;
- return qt_get_hex_rgb(tmp, rgb);
-}
-
-#ifndef QT_NO_COLORNAMES
-
-/*
- CSS color names = SVG 1.0 color names + transparent (rgba(0,0,0,0))
-*/
-
-#ifdef rgb
-# undef rgb
-#endif
-#define rgb(r,g,b) (0xff000000 | (r << 16) | (g << 8) | b)
-
-static const struct RGBData {
- const char name[21];
- uint value;
-} rgbTbl[] = {
- { "aliceblue", rgb(240, 248, 255) },
- { "antiquewhite", rgb(250, 235, 215) },
- { "aqua", rgb( 0, 255, 255) },
- { "aquamarine", rgb(127, 255, 212) },
- { "azure", rgb(240, 255, 255) },
- { "beige", rgb(245, 245, 220) },
- { "bisque", rgb(255, 228, 196) },
- { "black", rgb( 0, 0, 0) },
- { "blanchedalmond", rgb(255, 235, 205) },
- { "blue", rgb( 0, 0, 255) },
- { "blueviolet", rgb(138, 43, 226) },
- { "brown", rgb(165, 42, 42) },
- { "burlywood", rgb(222, 184, 135) },
- { "cadetblue", rgb( 95, 158, 160) },
- { "chartreuse", rgb(127, 255, 0) },
- { "chocolate", rgb(210, 105, 30) },
- { "coral", rgb(255, 127, 80) },
- { "cornflowerblue", rgb(100, 149, 237) },
- { "cornsilk", rgb(255, 248, 220) },
- { "crimson", rgb(220, 20, 60) },
- { "cyan", rgb( 0, 255, 255) },
- { "darkblue", rgb( 0, 0, 139) },
- { "darkcyan", rgb( 0, 139, 139) },
- { "darkgoldenrod", rgb(184, 134, 11) },
- { "darkgray", rgb(169, 169, 169) },
- { "darkgreen", rgb( 0, 100, 0) },
- { "darkgrey", rgb(169, 169, 169) },
- { "darkkhaki", rgb(189, 183, 107) },
- { "darkmagenta", rgb(139, 0, 139) },
- { "darkolivegreen", rgb( 85, 107, 47) },
- { "darkorange", rgb(255, 140, 0) },
- { "darkorchid", rgb(153, 50, 204) },
- { "darkred", rgb(139, 0, 0) },
- { "darksalmon", rgb(233, 150, 122) },
- { "darkseagreen", rgb(143, 188, 143) },
- { "darkslateblue", rgb( 72, 61, 139) },
- { "darkslategray", rgb( 47, 79, 79) },
- { "darkslategrey", rgb( 47, 79, 79) },
- { "darkturquoise", rgb( 0, 206, 209) },
- { "darkviolet", rgb(148, 0, 211) },
- { "deeppink", rgb(255, 20, 147) },
- { "deepskyblue", rgb( 0, 191, 255) },
- { "dimgray", rgb(105, 105, 105) },
- { "dimgrey", rgb(105, 105, 105) },
- { "dodgerblue", rgb( 30, 144, 255) },
- { "firebrick", rgb(178, 34, 34) },
- { "floralwhite", rgb(255, 250, 240) },
- { "forestgreen", rgb( 34, 139, 34) },
- { "fuchsia", rgb(255, 0, 255) },
- { "gainsboro", rgb(220, 220, 220) },
- { "ghostwhite", rgb(248, 248, 255) },
- { "gold", rgb(255, 215, 0) },
- { "goldenrod", rgb(218, 165, 32) },
- { "gray", rgb(128, 128, 128) },
- { "green", rgb( 0, 128, 0) },
- { "greenyellow", rgb(173, 255, 47) },
- { "grey", rgb(128, 128, 128) },
- { "honeydew", rgb(240, 255, 240) },
- { "hotpink", rgb(255, 105, 180) },
- { "indianred", rgb(205, 92, 92) },
- { "indigo", rgb( 75, 0, 130) },
- { "ivory", rgb(255, 255, 240) },
- { "khaki", rgb(240, 230, 140) },
- { "lavender", rgb(230, 230, 250) },
- { "lavenderblush", rgb(255, 240, 245) },
- { "lawngreen", rgb(124, 252, 0) },
- { "lemonchiffon", rgb(255, 250, 205) },
- { "lightblue", rgb(173, 216, 230) },
- { "lightcoral", rgb(240, 128, 128) },
- { "lightcyan", rgb(224, 255, 255) },
- { "lightgoldenrodyellow", rgb(250, 250, 210) },
- { "lightgray", rgb(211, 211, 211) },
- { "lightgreen", rgb(144, 238, 144) },
- { "lightgrey", rgb(211, 211, 211) },
- { "lightpink", rgb(255, 182, 193) },
- { "lightsalmon", rgb(255, 160, 122) },
- { "lightseagreen", rgb( 32, 178, 170) },
- { "lightskyblue", rgb(135, 206, 250) },
- { "lightslategray", rgb(119, 136, 153) },
- { "lightslategrey", rgb(119, 136, 153) },
- { "lightsteelblue", rgb(176, 196, 222) },
- { "lightyellow", rgb(255, 255, 224) },
- { "lime", rgb( 0, 255, 0) },
- { "limegreen", rgb( 50, 205, 50) },
- { "linen", rgb(250, 240, 230) },
- { "magenta", rgb(255, 0, 255) },
- { "maroon", rgb(128, 0, 0) },
- { "mediumaquamarine", rgb(102, 205, 170) },
- { "mediumblue", rgb( 0, 0, 205) },
- { "mediumorchid", rgb(186, 85, 211) },
- { "mediumpurple", rgb(147, 112, 219) },
- { "mediumseagreen", rgb( 60, 179, 113) },
- { "mediumslateblue", rgb(123, 104, 238) },
- { "mediumspringgreen", rgb( 0, 250, 154) },
- { "mediumturquoise", rgb( 72, 209, 204) },
- { "mediumvioletred", rgb(199, 21, 133) },
- { "midnightblue", rgb( 25, 25, 112) },
- { "mintcream", rgb(245, 255, 250) },
- { "mistyrose", rgb(255, 228, 225) },
- { "moccasin", rgb(255, 228, 181) },
- { "navajowhite", rgb(255, 222, 173) },
- { "navy", rgb( 0, 0, 128) },
- { "oldlace", rgb(253, 245, 230) },
- { "olive", rgb(128, 128, 0) },
- { "olivedrab", rgb(107, 142, 35) },
- { "orange", rgb(255, 165, 0) },
- { "orangered", rgb(255, 69, 0) },
- { "orchid", rgb(218, 112, 214) },
- { "palegoldenrod", rgb(238, 232, 170) },
- { "palegreen", rgb(152, 251, 152) },
- { "paleturquoise", rgb(175, 238, 238) },
- { "palevioletred", rgb(219, 112, 147) },
- { "papayawhip", rgb(255, 239, 213) },
- { "peachpuff", rgb(255, 218, 185) },
- { "peru", rgb(205, 133, 63) },
- { "pink", rgb(255, 192, 203) },
- { "plum", rgb(221, 160, 221) },
- { "powderblue", rgb(176, 224, 230) },
- { "purple", rgb(128, 0, 128) },
- { "red", rgb(255, 0, 0) },
- { "rosybrown", rgb(188, 143, 143) },
- { "royalblue", rgb( 65, 105, 225) },
- { "saddlebrown", rgb(139, 69, 19) },
- { "salmon", rgb(250, 128, 114) },
- { "sandybrown", rgb(244, 164, 96) },
- { "seagreen", rgb( 46, 139, 87) },
- { "seashell", rgb(255, 245, 238) },
- { "sienna", rgb(160, 82, 45) },
- { "silver", rgb(192, 192, 192) },
- { "skyblue", rgb(135, 206, 235) },
- { "slateblue", rgb(106, 90, 205) },
- { "slategray", rgb(112, 128, 144) },
- { "slategrey", rgb(112, 128, 144) },
- { "snow", rgb(255, 250, 250) },
- { "springgreen", rgb( 0, 255, 127) },
- { "steelblue", rgb( 70, 130, 180) },
- { "tan", rgb(210, 180, 140) },
- { "teal", rgb( 0, 128, 128) },
- { "thistle", rgb(216, 191, 216) },
- { "tomato", rgb(255, 99, 71) },
- { "transparent", 0 },
- { "turquoise", rgb( 64, 224, 208) },
- { "violet", rgb(238, 130, 238) },
- { "wheat", rgb(245, 222, 179) },
- { "white", rgb(255, 255, 255) },
- { "whitesmoke", rgb(245, 245, 245) },
- { "yellow", rgb(255, 255, 0) },
- { "yellowgreen", rgb(154, 205, 50) }
-};
-
-static const int rgbTblSize = sizeof(rgbTbl) / sizeof(RGBData);
-
-#undef rgb
-
-#if defined(Q_CC_MSVC) && _MSC_VER < 1600
-inline bool operator<(const RGBData &data1, const RGBData &data2)
-{ return qstrcmp(data1.name, data2.name) < 0; }
-#endif
-
-inline bool operator<(const char *name, const RGBData &data)
-{ return qstrcmp(name, data.name) < 0; }
-inline bool operator<(const RGBData &data, const char *name)
-{ return qstrcmp(data.name, name) < 0; }
-
-static bool get_named_rgb(const char *name_no_space, QRgb *rgb)
-{
- const RGBData *r = std::lower_bound(rgbTbl, rgbTbl + rgbTblSize, name_no_space);
- if ((r != rgbTbl + rgbTblSize) && !(name_no_space < *r)) {
- *rgb = r->value;
- return true;
- }
- return false;
-}
-
-bool qt_get_named_rgb(const char *name, QRgb* rgb)
-{
- int len = int(strlen(name));
- if(len > 255)
- return false;
- char name_no_space[256];
- int pos = 0;
- for(int i = 0; i < len; i++) {
- if(name[i] != '\t' && name[i] != ' ')
- name_no_space[pos++] = QChar::toLower(name[i]);
- }
- name_no_space[pos] = 0;
-
- return get_named_rgb(name_no_space, rgb);
-}
-
-bool qt_get_named_rgb(const QChar *name, int len, QRgb *rgb)
-{
- if(len > 255)
- return false;
- char name_no_space[256];
- int pos = 0;
- for(int i = 0; i < len; i++) {
- if(name[i] != QLatin1Char('\t') && name[i] != QLatin1Char(' '))
- name_no_space[pos++] = name[i].toLower().toLatin1();
- }
- name_no_space[pos] = 0;
- return get_named_rgb(name_no_space, rgb);
-}
-
-QStringList qt_get_colornames()
-{
- int i = 0;
- QStringList lst;
- lst.reserve(rgbTblSize);
- for (i = 0; i < rgbTblSize; i++)
- lst << QLatin1String(rgbTbl[i].name);
- return lst;
-}
-
-#else
-
-bool qt_get_named_rgb(const char *, QRgb*)
-{
- return false;
-}
-
-QStringList qt_get_colornames()
-{
- return QStringList();
-}
-#endif // QT_NO_COLORNAMES
-
-QT_END_NAMESPACE
diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp
index ac11b0f324..c697aceaf3 100644
--- a/src/gui/painting/qdrawhelper.cpp
+++ b/src/gui/painting/qdrawhelper.cpp
@@ -2176,7 +2176,8 @@ static const uint * QT_FASTCALL fetchTransformedBilinearARGB32PM(uint *buffer, c
fetchTransformedBilinear_pixelBounds<blendType>(image_height, image_y1, image_y2, y1, y2);
const uint *s1 = (const uint *)data->texture.scanLine(y1);
const uint *s2 = (const uint *)data->texture.scanLine(y2);
- int disty = ((fy & 0x0000ffff) + 0x0800) >> 12;
+ const int disty8 = (fy & 0x0000ffff) >> 8;
+ const int disty4 = (disty8 + 0x08) >> 4;
if (blendType != BlendTransformedBilinearTiled) {
#define BILINEAR_DOWNSCALE_BOUNDS_PROLOG \
@@ -2188,12 +2189,9 @@ static const uint * QT_FASTCALL fetchTransformedBilinearARGB32PM(uint *buffer, c
fetchTransformedBilinear_pixelBounds<blendType>(image_width, image_x1, image_x2, x1, x2); \
if (x1 != x2) \
break; \
- uint tl = s1[x1]; \
- uint tr = s1[x2]; \
- uint bl = s2[x1]; \
- uint br = s2[x2]; \
- int distx = ((fx & 0x0000ffff) + 0x0800) >> 12; \
- *b = interpolate_4_pixels_16(tl, tr, bl, br, distx, disty); \
+ uint top = s1[x1]; \
+ uint bot = s2[x1]; \
+ *b = INTERPOLATE_PIXEL_256(top, 256 - disty8, bot, disty8); \
fx += fdx; \
++b; \
} \
@@ -2209,7 +2207,7 @@ static const uint * QT_FASTCALL fetchTransformedBilinearARGB32PM(uint *buffer, c
const __m128i colorMask = _mm_set1_epi32(0x00ff00ff);
const __m128i v_256 = _mm_set1_epi16(256);
- const __m128i v_disty = _mm_set1_epi16(disty);
+ const __m128i v_disty = _mm_set1_epi16(disty4);
const __m128i v_fdx = _mm_set1_epi32(fdx*4);
const __m128i v_fx_r = _mm_set1_epi32(0x8);
__m128i v_fx = _mm_setr_epi32(fx, fx + fdx, fx + fdx + fdx, fx + fdx + fdx + fdx);
@@ -2241,18 +2239,14 @@ static const uint * QT_FASTCALL fetchTransformedBilinearARGB32PM(uint *buffer, c
const int16x8_t colorMask = vdupq_n_s16(0x00ff);
const int16x8_t invColorMask = vmvnq_s16(colorMask);
const int16x8_t v_256 = vdupq_n_s16(256);
- const int16x8_t v_disty = vdupq_n_s16(disty);
+ const int16x8_t v_disty = vdupq_n_s16(disty4);
const int16x8_t v_disty_ = vshlq_n_s16(v_disty, 4);
int32x4_t v_fdx = vdupq_n_s32(fdx*4);
int32x4_t v_fx = vmovq_n_s32(fx);
- fx += fdx;
- v_fx = vsetq_lane_s32(fx, v_fx, 1);
- fx += fdx;
- v_fx = vsetq_lane_s32(fx, v_fx, 2);
- fx += fdx;
- v_fx = vsetq_lane_s32(fx, v_fx, 3);
- fx += fdx;
+ v_fx = vsetq_lane_s32(fx + fdx, v_fx, 1);
+ v_fx = vsetq_lane_s32(fx + fdx * 2, v_fx, 2);
+ v_fx = vsetq_lane_s32(fx + fdx * 3, v_fx, 3);
const int32x4_t v_ffff_mask = vdupq_n_s32(0x0000ffff);
const int32x4_t v_fx_r = vdupq_n_s32(0x0800);
@@ -2260,18 +2254,20 @@ static const uint * QT_FASTCALL fetchTransformedBilinearARGB32PM(uint *buffer, c
while (b < boundedEnd) {
uint32x4x2_t v_top, v_bot;
- int32x4_t v_fx_shifted = vshrq_n_s32(v_fx, 16);
-
- int x1 = vgetq_lane_s32(v_fx_shifted, 0);
+ int x1 = (fx >> 16);
+ fx += fdx;
v_top = vld2q_lane_u32(s1 + x1, v_top, 0);
v_bot = vld2q_lane_u32(s2 + x1, v_bot, 0);
- x1 = vgetq_lane_s32(v_fx_shifted, 1);
+ x1 = (fx >> 16);
+ fx += fdx;
v_top = vld2q_lane_u32(s1 + x1, v_top, 1);
v_bot = vld2q_lane_u32(s2 + x1, v_bot, 1);
- x1 = vgetq_lane_s32(v_fx_shifted, 2);
+ x1 = (fx >> 16);
+ fx += fdx;
v_top = vld2q_lane_u32(s1 + x1, v_top, 2);
v_bot = vld2q_lane_u32(s2 + x1, v_bot, 2);
- x1 = vgetq_lane_s32(v_fx_shifted, 3);
+ x1 = (fx >> 16);
+ fx += fdx;
v_top = vld2q_lane_u32(s1 + x1, v_top, 3);
v_bot = vld2q_lane_u32(s2 + x1, v_bot, 3);
@@ -2286,7 +2282,6 @@ static const uint * QT_FASTCALL fetchTransformedBilinearARGB32PM(uint *buffer, c
b+=4;
v_fx = vaddq_s32(v_fx, v_fdx);
}
- fx = vgetq_lane_s32(v_fx, 0);
#endif
}
@@ -2298,8 +2293,14 @@ static const uint * QT_FASTCALL fetchTransformedBilinearARGB32PM(uint *buffer, c
uint tr = s1[x2];
uint bl = s2[x1];
uint br = s2[x2];
- int distx = ((fx & 0x0000ffff) + 0x0800) >> 12;
- *b = interpolate_4_pixels_16(tl, tr, bl, br, distx, disty);
+#if defined(__SSE2__) || defined(__ARM_NEON__)
+ // The optimized interpolate_4_pixels are faster than interpolate_4_pixels_16.
+ int distx8 = (fx & 0x0000ffff) >> 8;
+ *b = interpolate_4_pixels(tl, tr, bl, br, distx8, disty8);
+#else
+ int distx4 = ((fx & 0x0000ffff) + 0x0800) >> 12;
+ *b = interpolate_4_pixels_16(tl, tr, bl, br, distx4, disty4);
+#endif
fx += fdx;
++b;
}
@@ -2436,16 +2437,12 @@ static const uint * QT_FASTCALL fetchTransformedBilinearARGB32PM(uint *buffer, c
int32x4_t v_fx = vmovq_n_s32(fx);
int32x4_t v_fy = vmovq_n_s32(fy);
- fx += fdx; fy += fdy;
- v_fx = vsetq_lane_s32(fx, v_fx, 1);
- v_fy = vsetq_lane_s32(fy, v_fy, 1);
- fx += fdx; fy += fdy;
- v_fx = vsetq_lane_s32(fx, v_fx, 2);
- v_fy = vsetq_lane_s32(fy, v_fy, 2);
- fx += fdx; fy += fdy;
- v_fx = vsetq_lane_s32(fx, v_fx, 3);
- v_fy = vsetq_lane_s32(fy, v_fy, 3);
- fx += fdx; fy += fdy;
+ v_fx = vsetq_lane_s32(fx + fdx, v_fx, 1);
+ v_fy = vsetq_lane_s32(fy + fdy, v_fy, 1);
+ v_fx = vsetq_lane_s32(fx + fdx * 2, v_fx, 2);
+ v_fy = vsetq_lane_s32(fy + fdy * 2, v_fy, 2);
+ v_fx = vsetq_lane_s32(fx + fdx * 3, v_fx, 3);
+ v_fy = vsetq_lane_s32(fy + fdy * 3, v_fy, 3);
const int32x4_t v_ffff_mask = vdupq_n_s32(0x0000ffff);
const int32x4_t v_round = vdupq_n_s32(0x0800);
@@ -2453,33 +2450,33 @@ static const uint * QT_FASTCALL fetchTransformedBilinearARGB32PM(uint *buffer, c
while (b < boundedEnd) {
uint32x4x2_t v_top, v_bot;
- int32x4_t v_fx_shifted, v_fy_shifted;
- v_fx_shifted = vshrq_n_s32(v_fx, 16);
- v_fy_shifted = vshrq_n_s32(v_fy, 16);
-
- int x1 = vgetq_lane_s32(v_fx_shifted, 0);
- int y1 = vgetq_lane_s32(v_fy_shifted, 0);
+ int x1 = (fx >> 16);
+ int y1 = (fy >> 16);
+ fx += fdx; fy += fdy;
const uchar *sl = textureData + bytesPerLine * y1;
const uint *s1 = reinterpret_cast<const uint *>(sl);
const uint *s2 = reinterpret_cast<const uint *>(sl + bytesPerLine);
v_top = vld2q_lane_u32(s1 + x1, v_top, 0);
v_bot = vld2q_lane_u32(s2 + x1, v_bot, 0);
- x1 = vgetq_lane_s32(v_fx_shifted, 1);
- y1 = vgetq_lane_s32(v_fy_shifted, 1);
+ x1 = (fx >> 16);
+ y1 = (fy >> 16);
+ fx += fdx; fy += fdy;
sl = textureData + bytesPerLine * y1;
s1 = reinterpret_cast<const uint *>(sl);
s2 = reinterpret_cast<const uint *>(sl + bytesPerLine);
v_top = vld2q_lane_u32(s1 + x1, v_top, 1);
v_bot = vld2q_lane_u32(s2 + x1, v_bot, 1);
- x1 = vgetq_lane_s32(v_fx_shifted, 2);
- y1 = vgetq_lane_s32(v_fy_shifted, 2);
+ x1 = (fx >> 16);
+ y1 = (fy >> 16);
+ fx += fdx; fy += fdy;
sl = textureData + bytesPerLine * y1;
s1 = reinterpret_cast<const uint *>(sl);
s2 = reinterpret_cast<const uint *>(sl + bytesPerLine);
v_top = vld2q_lane_u32(s1 + x1, v_top, 2);
v_bot = vld2q_lane_u32(s2 + x1, v_bot, 2);
- x1 = vgetq_lane_s32(v_fx_shifted, 3);
- y1 = vgetq_lane_s32(v_fy_shifted, 3);
+ x1 = (fx >> 16);
+ y1 = (fy >> 16);
+ fx += fdx; fy += fdy;
sl = textureData + bytesPerLine * y1;
s1 = reinterpret_cast<const uint *>(sl);
s2 = reinterpret_cast<const uint *>(sl + bytesPerLine);
@@ -2501,8 +2498,6 @@ static const uint * QT_FASTCALL fetchTransformedBilinearARGB32PM(uint *buffer, c
v_fx = vaddq_s32(v_fx, v_fdx);
v_fy = vaddq_s32(v_fy, v_fdy);
}
- fx = vgetq_lane_s32(v_fx, 0);
- fy = vgetq_lane_s32(v_fy, 0);
#endif
}
@@ -2980,10 +2975,8 @@ static const QRgba64 *QT_FASTCALL fetchTransformedBilinear64(QRgba64 *buffer, co
fetchTransformedBilinear_pixelBounds<blendType>(image_width, image_x1, image_x2, x1, x2);
if (x1 != x2)
break;
- sbuf1[i * 2 + 0] = ((const uint*)s1)[x1];
- sbuf1[i * 2 + 1] = ((const uint*)s1)[x2];
- sbuf2[i * 2 + 0] = ((const uint*)s2)[x1];
- sbuf2[i * 2 + 1] = ((const uint*)s2)[x2];
+ sbuf1[i * 2 + 0] = sbuf1[i * 2 + 1] = ((const uint*)s1)[x1];
+ sbuf2[i * 2 + 0] = sbuf2[i * 2 + 1] = ((const uint*)s2)[x1];
fx += fdx;
}
int fastLen;
@@ -3102,6 +3095,16 @@ static const QRgba64 *QT_FASTCALL fetchTransformedBilinear64(QRgba64 *buffer, co
fx += fdx;
fy += fdy;
}
+ int fastLen = len;
+ if (fdx > 0)
+ fastLen = qMin(fastLen, int((qint64(image_x2) * fixed_scale - fx) / fdx));
+ else if (fdx < 0)
+ fastLen = qMin(fastLen, int((qint64(image_x1) * fixed_scale - fx) / fdx));
+ if (fdy > 0)
+ fastLen = qMin(fastLen, int((qint64(image_y2) * fixed_scale - fy) / fdy));
+ else if (fdy < 0)
+ fastLen = qMin(fastLen, int((qint64(image_y1) * fixed_scale - fy) / fdy));
+ fastLen -= 3;
const __m128i v_fdx = _mm_set1_epi32(fdx*4);
const __m128i v_fdy = _mm_set1_epi32(fdy*4);
@@ -3111,15 +3114,7 @@ static const QRgba64 *QT_FASTCALL fetchTransformedBilinear64(QRgba64 *buffer, co
const uchar *s1 = data->texture.imageData;
const uchar *s2 = s1 + bytesPerLine;
const __m128i vbpl = _mm_shufflelo_epi16(_mm_cvtsi32_si128(bytesPerLine/4), _MM_SHUFFLE(0, 0, 0, 0));
- for (; i < len-3; i+=4) {
- if (fdx > 0 && (short)_mm_extract_epi16(v_fx, 7) >= image_x2)
- break;
- if (fdx < 0 && (short)_mm_extract_epi16(v_fx, 7) < image_x1)
- break;
- if (fdy > 0 && (short)_mm_extract_epi16(v_fy, 7) >= image_y2)
- break;
- if (fdy < 0 && (short)_mm_extract_epi16(v_fy, 7) < image_y1)
- break;
+ for (; i < fastLen; i += 4) {
const __m128i vy = _mm_packs_epi32(_mm_srai_epi32(v_fy, 16), _mm_setzero_si128());
__m128i voffset = _mm_unpacklo_epi16(_mm_mullo_epi16(vy, vbpl), _mm_mulhi_epu16(vy, vbpl));
voffset = _mm_add_epi32(voffset, _mm_srli_epi32(v_fx, 16));
@@ -5555,17 +5550,17 @@ static const ProcessSpans processTextureSpans[NBlendTypes][QImage::NImageFormats
blend_src_generic, // ARGB32
blend_transformed_argb, // ARGB32_Premultiplied
blend_transformed_rgb565,
- blend_src_generic,
- blend_src_generic,
- blend_src_generic,
- blend_src_generic,
- blend_src_generic,
- blend_src_generic,
- blend_src_generic,
- blend_src_generic,
- blend_src_generic,
- blend_src_generic,
- blend_src_generic,
+ blend_src_generic, // ARGB8565_Premultiplied
+ blend_src_generic, // RGB666
+ blend_src_generic, // ARGB6666_Premultiplied
+ blend_src_generic, // RGB555
+ blend_src_generic, // ARGB8555_Premultiplied
+ blend_src_generic, // RGB888
+ blend_src_generic, // RGB444
+ blend_src_generic, // ARGB4444_Premultiplied
+ blend_src_generic, // RGBX8888
+ blend_src_generic, // RGBA8888
+ blend_src_generic, // RGBA8888_Premultiplied
blend_src_generic_rgb64,
blend_src_generic_rgb64,
blend_src_generic_rgb64,
@@ -5583,16 +5578,17 @@ static const ProcessSpans processTextureSpans[NBlendTypes][QImage::NImageFormats
blend_src_generic, // ARGB32
blend_transformed_tiled_argb, // ARGB32_Premultiplied
blend_transformed_tiled_rgb565,
- blend_src_generic,
- blend_src_generic,
- blend_src_generic,
- blend_src_generic,
- blend_src_generic,
- blend_src_generic,
- blend_src_generic,
- blend_src_generic,
- blend_src_generic,
- blend_src_generic,
+ blend_src_generic, // ARGB8565_Premultiplied
+ blend_src_generic, // RGB666
+ blend_src_generic, // ARGB6666_Premultiplied
+ blend_src_generic, // RGB555
+ blend_src_generic, // ARGB8555_Premultiplied
+ blend_src_generic, // RGB888
+ blend_src_generic, // RGB444
+ blend_src_generic, // ARGB4444_Premultiplied
+ blend_src_generic, // RGBX8888
+ blend_src_generic, // RGBA8888
+ blend_src_generic, // RGBA8888_Premultiplied
blend_src_generic_rgb64,
blend_src_generic_rgb64,
blend_src_generic_rgb64,
@@ -5610,17 +5606,17 @@ static const ProcessSpans processTextureSpans[NBlendTypes][QImage::NImageFormats
blend_src_generic, // ARGB32
blend_src_generic, // ARGB32_Premultiplied
blend_transformed_bilinear_rgb565,
- blend_src_generic,
- blend_src_generic,
- blend_src_generic,
- blend_src_generic,
- blend_src_generic,
- blend_src_generic,
- blend_src_generic,
- blend_src_generic,
- blend_src_generic,
- blend_src_generic,
- blend_src_generic,
+ blend_src_generic, // ARGB8565_Premultiplied
+ blend_src_generic, // RGB666
+ blend_src_generic, // ARGB6666_Premultiplied
+ blend_src_generic, // RGB555
+ blend_src_generic, // ARGB8555_Premultiplied
+ blend_src_generic, // RGB888
+ blend_src_generic, // RGB444
+ blend_src_generic, // ARGB4444_Premultiplied
+ blend_src_generic, // RGBX8888
+ blend_src_generic, // RGBA8888
+ blend_src_generic, // RGBA8888_Premultiplied
blend_src_generic_rgb64,
blend_src_generic_rgb64,
blend_src_generic_rgb64,
diff --git a/src/gui/painting/qdrawhelper_p.h b/src/gui/painting/qdrawhelper_p.h
index 664117a730..45a3174734 100644
--- a/src/gui/painting/qdrawhelper_p.h
+++ b/src/gui/painting/qdrawhelper_p.h
@@ -636,6 +636,22 @@ static Q_ALWAYS_INLINE uint BYTE_MUL(uint x, uint a) {
}
#endif
+static Q_ALWAYS_INLINE void blend_pixel(quint32 &dst, const quint32 src)
+{
+ if (src >= 0xff000000)
+ dst = src;
+ else if (src != 0)
+ dst = src + BYTE_MUL(dst, qAlpha(~src));
+}
+
+static Q_ALWAYS_INLINE void blend_pixel(quint32 &dst, const quint32 src, const int const_alpha)
+{
+ if (src != 0) {
+ const quint32 s = BYTE_MUL(src, const_alpha);
+ dst = s + BYTE_MUL(dst, qAlpha(~s));
+ }
+}
+
#if defined(__SSE2__)
static Q_ALWAYS_INLINE uint interpolate_4_pixels_sse2(__m128i vt, __m128i vb, uint distx, uint disty)
{
diff --git a/src/gui/painting/qdrawhelper_ssse3.cpp b/src/gui/painting/qdrawhelper_ssse3.cpp
index 7cd3e9ca1b..2026a4e656 100644
--- a/src/gui/painting/qdrawhelper_ssse3.cpp
+++ b/src/gui/painting/qdrawhelper_ssse3.cpp
@@ -45,15 +45,6 @@
QT_BEGIN_NAMESPACE
-inline static void blend_pixel(quint32 &dst, const quint32 src)
-{
- if (src >= 0xff000000)
- dst = src;
- else if (src != 0)
- dst = src + BYTE_MUL(dst, qAlpha(~src));
-}
-
-
/* The instruction palignr uses direct arguments, so we have to generate the code fo the different
shift (4, 8, 12). Checking the alignment inside the loop is unfortunatelly way too slow.
*/
diff --git a/src/gui/painting/qdrawingprimitive_sse2_p.h b/src/gui/painting/qdrawingprimitive_sse2_p.h
index 8799dff92a..7affc63b32 100644
--- a/src/gui/painting/qdrawingprimitive_sse2_p.h
+++ b/src/gui/painting/qdrawingprimitive_sse2_p.h
@@ -171,11 +171,7 @@ QT_BEGIN_NAMESPACE
\
/* First, get dst aligned. */ \
ALIGNMENT_PROLOGUE_16BYTES(dst, x, length) { \
- uint s = src[x]; \
- if (s >= 0xff000000) \
- dst[x] = s; \
- else if (s != 0) \
- dst[x] = s + BYTE_MUL(dst[x], qAlpha(~s)); \
+ blend_pixel(dst[x], src[x]); \
} \
\
for (; x < length-3; x += 4) { \
@@ -183,11 +179,7 @@ QT_BEGIN_NAMESPACE
BLEND_SOURCE_OVER_ARGB32_SSE2_helper(dst, srcVector, nullVector, half, one, colorMask, alphaMask) \
} \
for (; x < length; ++x) { \
- uint s = src[x]; \
- if (s >= 0xff000000) \
- dst[x] = s; \
- else if (s != 0) \
- dst[x] = s + BYTE_MUL(dst[x], qAlpha(~s)); \
+ blend_pixel(dst[x], src[x]); \
} \
}
@@ -207,11 +199,7 @@ QT_BEGIN_NAMESPACE
int x = 0; \
\
ALIGNMENT_PROLOGUE_16BYTES(dst, x, length) { \
- quint32 s = src[x]; \
- if (s != 0) { \
- s = BYTE_MUL(s, const_alpha); \
- dst[x] = s + BYTE_MUL(dst[x], qAlpha(~s)); \
- } \
+ blend_pixel(dst[x], src[x], const_alpha); \
} \
\
for (; x < length-3; x += 4) { \
@@ -232,11 +220,7 @@ QT_BEGIN_NAMESPACE
} \
} \
for (; x < length; ++x) { \
- quint32 s = src[x]; \
- if (s != 0) { \
- s = BYTE_MUL(s, const_alpha); \
- dst[x] = s + BYTE_MUL(dst[x], qAlpha(~s)); \
- } \
+ blend_pixel(dst[x], src[x], const_alpha); \
} \
}
diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp
index e8f29ce520..a3a3f20b18 100644
--- a/src/gui/text/qfontdatabase.cpp
+++ b/src/gui/text/qfontdatabase.cpp
@@ -663,11 +663,8 @@ struct QtFontDesc
static void initFontDef(const QtFontDesc &desc, const QFontDef &request, QFontDef *fontDef, bool multi)
{
fontDef->family = desc.family->name;
- if (! desc.foundry->name.isEmpty() && desc.family->count > 1) {
- fontDef->family += QString::fromLatin1(" [");
- fontDef->family += desc.foundry->name;
- fontDef->family += QLatin1Char(']');
- }
+ if (! desc.foundry->name.isEmpty() && desc.family->count > 1)
+ fontDef->family += QLatin1String(" [") + desc.foundry->name + QLatin1Char(']');
if (desc.style->smoothScalable
|| QGuiApplicationPrivate::platformIntegration()->fontDatabase()->fontsAlwaysScalable()
@@ -842,9 +839,13 @@ QStringList QPlatformFontDatabase::fallbacksForFamily(const QString &family, QFo
return retList;
}
+static void initializeDb();
+
static QStringList fallbacksForFamily(const QString &family, QFont::Style style, QFont::StyleHint styleHint, QChar::Script script)
{
QFontDatabasePrivate *db = privateDb();
+ if (!db->count)
+ initializeDb();
const FallbacksCacheKey cacheKey = { family, style, styleHint, script };
diff --git a/src/gui/text/qplatformfontdatabase.cpp b/src/gui/text/qplatformfontdatabase.cpp
index 0d7cb204ff..b83affecdc 100644
--- a/src/gui/text/qplatformfontdatabase.cpp
+++ b/src/gui/text/qplatformfontdatabase.cpp
@@ -395,10 +395,8 @@ void QPlatformFontDatabase::releaseHandle(void *handle)
QString QPlatformFontDatabase::fontDir() const
{
QString fontpath = QString::fromLocal8Bit(qgetenv("QT_QPA_FONTDIR"));
- if (fontpath.isEmpty()) {
- fontpath = QLibraryInfo::location(QLibraryInfo::LibrariesPath);
- fontpath += QLatin1String("/fonts");
- }
+ if (fontpath.isEmpty())
+ fontpath = QLibraryInfo::location(QLibraryInfo::LibrariesPath) + QLatin1String("/fonts");
return fontpath;
}
diff --git a/src/gui/text/qtextimagehandler.cpp b/src/gui/text/qtextimagehandler.cpp
index 18311ed161..f7117bfe0a 100644
--- a/src/gui/text/qtextimagehandler.cpp
+++ b/src/gui/text/qtextimagehandler.cpp
@@ -61,10 +61,10 @@ static QString resolveFileName(QString fileName, QUrl *url, qreal targetDevicePi
// Also, QFile{Info}::exists works only on filepaths (not urls)
if (url->isValid()) {
- if (url->scheme() == QLatin1Literal("qrc")) {
+ if (url->scheme() == QLatin1String("qrc")) {
fileName = fileName.right(fileName.length() - 3);
}
- else if (url->scheme() == QLatin1Literal("file")) {
+ else if (url->scheme() == QLatin1String("file")) {
fileName = url->toLocalFile();
}
}
diff --git a/src/network/configure.json b/src/network/configure.json
new file mode 100644
index 0000000000..97bf92167d
--- /dev/null
+++ b/src/network/configure.json
@@ -0,0 +1,274 @@
+{
+ "module": "network",
+ "depends": [
+ "core"
+ ],
+ "testDir": "../../config.tests",
+
+ "commandline": {
+ "assignments": {
+ "OPENSSL_LIBS": "openssl.libs",
+ "OPENSSL_LIBS_DEBUG": "openssl.libs.debug",
+ "OPENSSL_LIBS_RELEASE": "openssl.libs.release",
+ "OPENSSL_PATH": "openssl.prefix"
+ },
+ "options": {
+ "libproxy": "boolean",
+ "openssl": { "type": "optionalString", "values": [ "no", "yes", "linked", "runtime" ] },
+ "openssl-linked": { "type": "void", "name": "openssl", "value": "linked" },
+ "openssl-runtime": { "type": "void", "name": "openssl", "value": "runtime" },
+ "sctp": "boolean",
+ "securetransport": "boolean",
+ "ssl": "boolean",
+ "system-proxies": "boolean"
+ }
+ },
+
+ "libraries": {
+ "corewlan": {
+ "label": "CoreWLan",
+ "export": "",
+ "test": "mac/corewlan",
+ "sources": [
+ "-framework CoreWLAN -framework Foundation"
+ ]
+ },
+ "network": {
+ "export": "",
+ "sources": [
+ { "type": "makeSpec", "spec": "NETWORK" }
+ ]
+ },
+ "libproxy": {
+ "label": "libproxy",
+ "test": "common/libproxy",
+ "sources": [
+ "-lproxy"
+ ]
+ },
+ "openssl": {
+ "label": "OpenSSL Libraries",
+ "export": "",
+ "sources": [
+ { "type": "openssl" },
+ {
+ "comment": "placeholder for OPENSSL_LIBS{,_{DEBUG,RELEASE}}",
+ "libs": "",
+ "builds": {
+ "debug": "",
+ "release": ""
+ },
+ "condition": "config.win32 && !features.shared"
+ },
+ { "libs": "-lssleay32 -llibeay32", "condition": "config.win32 && features.shared" },
+ { "libs": "-lssl -lcrypto", "condition": "!config.win32" }
+ ]
+ }
+ },
+
+ "tests": {
+ "getaddrinfo": {
+ "label": "getaddrinfo()",
+ "type": "compile",
+ "test": "unix/getaddrinfo",
+ "use": "network"
+ },
+ "getifaddrs": {
+ "label": "getifaddrs()",
+ "type": "compile",
+ "test": "unix/getifaddrs",
+ "use": "network"
+ },
+ "ipv6ifname": {
+ "label": "IPv6 ifname",
+ "type": "compile",
+ "test": "unix/ipv6ifname",
+ "use": "network"
+ },
+ "openssl": {
+ "label": "OpenSSL",
+ "type": "compile",
+ "test": "unix/openssl"
+ },
+ "sctp": {
+ "label": "SCTP support",
+ "type": "compile",
+ "test": "unix/sctp",
+ "use": "network"
+ }
+ },
+
+ "features": {
+ "corewlan": {
+ "label": "CoreWLan",
+ "condition": "libs.corewlan",
+ "emitIf": "config.darwin",
+ "output": [ "feature", "privateFeature" ]
+ },
+ "getaddrinfo": {
+ "label": "getaddrinfo()",
+ "condition": "tests.getaddrinfo",
+ "output": [ "feature" ]
+ },
+ "getifaddrs": {
+ "label": "getifaddrs()",
+ "condition": "tests.getifaddrs",
+ "output": [ "feature" ]
+ },
+ "ipv6ifname": {
+ "label": "IPv6 ifname",
+ "condition": "tests.ipv6ifname",
+ "output": [ "feature" ]
+ },
+ "libproxy": {
+ "label": "libproxy",
+ "autoDetect": false,
+ "condition": "libs.libproxy",
+ "output": [ "privateFeature" ]
+ },
+ "openssl": {
+ "label": "OpenSSL",
+ "enable": "input.openssl == 'yes' || input.openssl == 'linked' || input.openssl == 'runtime'",
+ "disable": "input.openssl == 'no' || input.ssl == 'no'",
+ "autoDetect": "!config.winrt",
+ "condition": "!features.securetransport && tests.openssl",
+ "output": [
+ "privateFeature",
+ { "type": "publicQtConfig", "condition": "!features.openssl-linked" },
+ { "type": "define", "negative": true, "name": "QT_NO_OPENSSL" }
+ ]
+ },
+ "openssl-linked": {
+ "label": " Qt directly linked to OpenSSL",
+ "enable": "input.openssl == 'linked'",
+ "disable": "input.openssl != 'linked'",
+ "condition": "features.openssl && libs.openssl",
+ "output": [
+ "privateFeature",
+ { "type": "varAssign", "name": "OPENSSL_LIBS", "value": "libs.openssl.libs", "eval": "true" },
+ { "type": "varAssign", "name": "OPENSSL_LIBS_DEBUG", "value": "libs.openssl.builds.debug.libs",
+ "eval": "true", "condition": "config.win32" },
+ { "type": "varAssign", "name": "OPENSSL_LIBS_RELEASE", "value": "libs.openssl.builds.release.libs",
+ "eval": "true", "condition": "config.win32" },
+ { "type": "define", "name": "QT_LINKED_OPENSSL" }
+ ]
+ },
+ "securetransport": {
+ "label": "SecureTransport",
+ "disable": "input.securetransport == 'no' || input.ssl == 'no'",
+ "condition": "config.darwin && (input.openssl == '' || input.openssl == 'no')",
+ "output": [
+ "privateFeature",
+ { "type": "define", "name": "QT_SECURETRANSPORT" }
+ ]
+ },
+ "ssl": {
+ "label": "SSL",
+ "condition": "config.winrt || features.securetransport || features.openssl",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "sctp": {
+ "label": "SCTP",
+ "autoDetect": false,
+ "condition": "tests.sctp",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "system-proxies": {
+ "label": "Use system proxies",
+ "output": [ "privateFeature" ]
+ },
+ "ftp": {
+ "label": "FTP",
+ "purpose": "Provides support for the File Transfer Protocol in QNetworkAccessManager.",
+ "section": "Networking",
+ "condition": "features.textdate",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "http": {
+ "label": "HTTP",
+ "purpose": "Provides support for the Hypertext Transfer Protocol in QNetworkAccessManager.",
+ "section": "Networking",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "udpsocket": {
+ "label": "QUdpSocket",
+ "purpose": "Provides access to UDP sockets.",
+ "section": "Networking",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "networkproxy": {
+ "label": "QNetworkProxy",
+ "purpose": "Provides network proxy support.",
+ "section": "Networking",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "socks5": {
+ "label": "SOCKS5",
+ "purpose": "Provides SOCKS5 support in QNetworkProxy.",
+ "section": "Networking",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "networkinterface": {
+ "label": "QNetworkInterface",
+ "purpose": "Supports enumerating a host's IP addresses and network interfaces.",
+ "section": "Networking",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "networkdiskcache": {
+ "label": "QNetworkDiskCache",
+ "purpose": "Provides a disk cache for network resources.",
+ "section": "Networking",
+ "condition": "features.temporaryfile",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "bearermanagement": {
+ "label": "Bearer management",
+ "purpose": "Provides bearer management for the network stack.",
+ "section": "Networking",
+ "condition": "features.library && features.networkinterface && features.properties",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "localserver": {
+ "label": "QLocalServer",
+ "purpose": "Provides a local socket based server.",
+ "section": "Networking",
+ "condition": "features.temporaryfile",
+ "output": [ "publicFeature", "feature" ]
+ }
+ },
+
+ "report": [
+ {
+ "type": "note",
+ "condition": "features.openssl-linked && libs.openssl.source != 0
+ && input.openssl.prefix == '' && input.openssl.libs == '' && input.openssl.libs.debug == ''",
+ "message": "When linking against OpenSSL, you can override the default
+library names through OPENSSL_LIBS.
+For example:
+ OPENSSL_LIBS='-L/opt/ssl/lib -lssl -lcrypto' ./configure -openssl-linked"
+ }
+ ],
+
+ "summary": [
+ {
+ "section": "Qt Network",
+ "entries": [
+ {
+ "type": "feature",
+ "args": "corewlan",
+ "condition": "config.darwin"
+ },
+ "getaddrinfo", "getifaddrs", "ipv6ifname", "libproxy",
+ {
+ "type": "feature",
+ "args": "securetransport",
+ "condition": "config.darwin"
+ },
+ "openssl",
+ "openssl-linked",
+ "sctp",
+ "system-proxies"
+ ]
+ }
+ ]
+}
diff --git a/src/network/configure.pri b/src/network/configure.pri
new file mode 100644
index 0000000000..57568902e4
--- /dev/null
+++ b/src/network/configure.pri
@@ -0,0 +1,12 @@
+# custom tests
+
+defineTest(qtConfLibrary_openssl) {
+ libs = $$getenv("OPENSSL_LIBS")
+ !isEmpty(libs) {
+ $${1}.libs = $$libs
+ export($${1}.libs)
+ return(true)
+ }
+ return(false)
+}
+
diff --git a/src/network/kernel/qnetworkproxy_mac.cpp b/src/network/kernel/qnetworkproxy_mac.cpp
index 37126298c6..76a2d2df9f 100644
--- a/src/network/kernel/qnetworkproxy_mac.cpp
+++ b/src/network/kernel/qnetworkproxy_mac.cpp
@@ -180,31 +180,23 @@ static QNetworkProxy proxyFromDictionary(CFDictionaryRef dict)
return QNetworkProxy(proxyType, hostName, port, user, password);
}
-const char * cfurlErrorDescription(SInt32 errorCode)
+namespace {
+struct PACInfo {
+ QCFType<CFArrayRef> proxies;
+ QCFType<CFErrorRef> error;
+ bool done = false;
+};
+
+void proxyAutoConfigCallback(void *client, CFArrayRef proxylist, CFErrorRef error)
{
- switch (errorCode) {
- case kCFURLUnknownError:
- return "Unknown Error";
- case kCFURLUnknownSchemeError:
- return "Unknown Scheme";
- case kCFURLResourceNotFoundError:
- return "Resource Not Found";
- case kCFURLResourceAccessViolationError:
- return "Resource Access Violation";
- case kCFURLRemoteHostUnavailableError:
- return "Remote Host Unavailable";
- case kCFURLImproperArgumentsError:
- return "Improper Arguments";
- case kCFURLUnknownPropertyKeyError:
- return "Unknown Property Key";
- case kCFURLPropertyKeyUnavailableError:
- return "Property Key Unavailable";
- case kCFURLTimeoutError:
- return "Timeout";
- default:
- return "Really Unknown Error";
- }
+ PACInfo *info = reinterpret_cast<PACInfo *>(reinterpret_cast<CFStreamClientContext *>(client)->info);
+ info->done = true;
+ if (proxylist)
+ CFRetain(proxylist);
+ info->proxies = proxylist;
+ info->error = error;
}
+} // anon namespace
QList<QNetworkProxy> macQueryInternal(const QNetworkProxyQuery &query)
{
@@ -240,23 +232,6 @@ QList<QNetworkProxy> macQueryInternal(const QNetworkProxyQuery &query)
qWarning("Invalid PAC URL \"%s\"", qPrintable(QCFString::toQString(cfPacLocation)));
return result;
}
- SInt32 errorCode;
- if (!CFURLCreateDataAndPropertiesFromResource(kCFAllocatorDefault, pacUrl, &pacData, NULL, NULL, &errorCode)) {
- QString pacLocation = QCFString::toQString(cfPacLocation);
- qWarning("Unable to get the PAC script at \"%s\" (%s)", qPrintable(pacLocation), cfurlErrorDescription(errorCode));
- return result;
- }
- if (!pacData) {
- qWarning("\"%s\" returned an empty PAC script", qPrintable(QCFString::toQString(cfPacLocation)));
- return result;
- }
- QCFType<CFStringRef> pacScript = CFStringCreateFromExternalRepresentation(kCFAllocatorDefault, pacData, kCFStringEncodingISOLatin1);
- if (!pacScript) {
- // This should never happen, but the documentation says it may return NULL if there was a problem creating the object.
- QString pacLocation = QCFString::toQString(cfPacLocation);
- qWarning("Unable to read the PAC script at \"%s\"", qPrintable(pacLocation));
- return result;
- }
QByteArray encodedURL = query.url().toEncoded(); // converted to UTF-8
if (encodedURL.isEmpty()) {
@@ -268,18 +243,31 @@ QList<QNetworkProxy> macQueryInternal(const QNetworkProxyQuery &query)
return result; // URL creation problem, abort
}
- QCFType<CFErrorRef> pacError;
- QCFType<CFArrayRef> proxies = CFNetworkCopyProxiesForAutoConfigurationScript(pacScript, targetURL, &pacError);
- if (!proxies) {
+ CFStreamClientContext pacCtx;
+ pacCtx.version = 0;
+ PACInfo pacInfo;
+ pacCtx.info = &pacInfo;
+ pacCtx.retain = NULL;
+ pacCtx.release = NULL;
+ pacCtx.copyDescription = NULL;
+
+ static CFStringRef pacRunLoopMode = CFSTR("qtPACRunLoopMode");
+
+ QCFType<CFRunLoopSourceRef> pacRunLoopSource = CFNetworkExecuteProxyAutoConfigurationURL(pacUrl, targetURL, &proxyAutoConfigCallback, &pacCtx);
+ CFRunLoopAddSource(CFRunLoopGetCurrent(), pacRunLoopSource, pacRunLoopMode);
+ while (!pacInfo.done)
+ CFRunLoopRunInMode(pacRunLoopMode, 1000, /*returnAfterSourceHandled*/ true);
+
+ if (!pacInfo.proxies) {
QString pacLocation = QCFString::toQString(cfPacLocation);
- QCFType<CFStringRef> pacErrorDescription = CFErrorCopyDescription(pacError);
+ QCFType<CFStringRef> pacErrorDescription = CFErrorCopyDescription(pacInfo.error);
qWarning("Execution of PAC script at \"%s\" failed: %s", qPrintable(pacLocation), qPrintable(QCFString::toQString(pacErrorDescription)));
return result;
}
- CFIndex size = CFArrayGetCount(proxies);
+ CFIndex size = CFArrayGetCount(pacInfo.proxies);
for (CFIndex i = 0; i < size; ++i) {
- CFDictionaryRef proxy = (CFDictionaryRef)CFArrayGetValueAtIndex(proxies, i);
+ CFDictionaryRef proxy = (CFDictionaryRef)CFArrayGetValueAtIndex(pacInfo.proxies, i);
result << proxyFromDictionary(proxy);
}
return result;
diff --git a/src/network/kernel/qtnetworkglobal.h b/src/network/kernel/qtnetworkglobal.h
index 192601970a..586b847816 100644
--- a/src/network/kernel/qtnetworkglobal.h
+++ b/src/network/kernel/qtnetworkglobal.h
@@ -41,6 +41,7 @@
#define QTNETWORKGLOBAL_H
#include <QtCore/qglobal.h>
+#include <QtNetwork/qtnetwork-config.h>
QT_BEGIN_NAMESPACE
diff --git a/src/network/kernel/qtnetworkglobal_p.h b/src/network/kernel/qtnetworkglobal_p.h
index 51347e440d..859e3d9ebd 100644
--- a/src/network/kernel/qtnetworkglobal_p.h
+++ b/src/network/kernel/qtnetworkglobal_p.h
@@ -53,5 +53,6 @@
#include <QtNetwork/qtnetworkglobal.h>
#include <QtCore/private/qglobal_p.h>
+#include <QtNetwork/private/qtnetwork-config_p.h>
#endif // QTNETWORKGLOBAL_P_H
diff --git a/src/network/socket/qnativesocketengine_winrt.cpp b/src/network/socket/qnativesocketengine_winrt.cpp
index 641863b4fd..6b71912838 100644
--- a/src/network/socket/qnativesocketengine_winrt.cpp
+++ b/src/network/socket/qnativesocketengine_winrt.cpp
@@ -1306,10 +1306,12 @@ HRESULT QNativeSocketEnginePrivate::handleConnectOpFinished(IAsyncAction *action
if (socketType != QAbstractSocket::TcpSocket)
return S_OK;
+#ifndef QT_NO_SSL
// Delay the reader so that the SSL socket can upgrade
if (sslSocket)
QObject::connect(qobject_cast<QSslSocket *>(sslSocket), &QSslSocket::encrypted, q, &QNativeSocketEngine::establishRead);
else
+#endif
q->establishRead();
return S_OK;
}
diff --git a/src/network/ssl/qsslcertificate.cpp b/src/network/ssl/qsslcertificate.cpp
index 96ba68089d..ce78399e01 100644
--- a/src/network/ssl/qsslcertificate.cpp
+++ b/src/network/ssl/qsslcertificate.cpp
@@ -111,7 +111,7 @@
\value EmailAddress The email address associated with the certificate
*/
-#include <QtCore/qglobal.h>
+#include <QtNetwork/qtnetworkglobal.h>
#ifndef QT_NO_OPENSSL
#include "qsslsocket_openssl_symbols_p.h"
#endif
diff --git a/src/platformsupport/cglconvenience/cglconvenience.mm b/src/platformsupport/cglconvenience/cglconvenience.mm
index 28cde1264d..85add35879 100644
--- a/src/platformsupport/cglconvenience/cglconvenience.mm
+++ b/src/platformsupport/cglconvenience/cglconvenience.mm
@@ -75,8 +75,11 @@ void *qcgl_createNSOpenGLPixelFormat(const QSurfaceFormat &format)
QVector<NSOpenGLPixelFormatAttribute> attrs;
- if (format.swapBehavior() != QSurfaceFormat::SingleBuffer)
+ if (format.swapBehavior() == QSurfaceFormat::DoubleBuffer
+ || format.swapBehavior() == QSurfaceFormat::DefaultSwapBehavior)
attrs.append(NSOpenGLPFADoubleBuffer);
+ else if (format.swapBehavior() == QSurfaceFormat::TripleBuffer)
+ attrs.append(NSOpenGLPFATripleBuffer);
if (format.profile() == QSurfaceFormat::CoreProfile
&& ((format.majorVersion() == 3 && format.minorVersion() >= 2)
diff --git a/src/platformsupport/fbconvenience/qfbvthandler_p.h b/src/platformsupport/fbconvenience/qfbvthandler_p.h
index e05a9d3ffc..17d07317b2 100644
--- a/src/platformsupport/fbconvenience/qfbvthandler_p.h
+++ b/src/platformsupport/fbconvenience/qfbvthandler_p.h
@@ -51,6 +51,7 @@
// We mean it.
//
+#include <QtGui/private/qtguiglobal_p.h>
#include <QObject>
QT_BEGIN_NAMESPACE
diff --git a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp
index 02b7e1bd63..5847c601a8 100644
--- a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp
+++ b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp
@@ -504,7 +504,7 @@ static void populateFromPattern(FcPattern *pattern)
void QFontconfigDatabase::populateFontDatabase()
{
- FcInitReinitialize();
+ FcInit();
FcFontSet *fonts;
{
@@ -568,6 +568,12 @@ void QFontconfigDatabase::populateFontDatabase()
// QApplication::setFont(font);
}
+void QFontconfigDatabase::invalidate()
+{
+ // Clear app fonts.
+ FcConfigAppFontClear(0);
+}
+
QFontEngineMulti *QFontconfigDatabase::fontEngineMulti(QFontEngine *fontEngine, QChar::Script script)
{
return new QFontEngineMultiFontConfig(fontEngine, script);
diff --git a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase_p.h b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase_p.h
index 197a442d5b..244558b910 100644
--- a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase_p.h
+++ b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase_p.h
@@ -62,6 +62,7 @@ class QFontconfigDatabase : public QBasicFontDatabase
{
public:
void populateFontDatabase() Q_DECL_OVERRIDE;
+ void invalidate() Q_DECL_OVERRIDE;
QFontEngineMulti *fontEngineMulti(QFontEngine *fontEngine, QChar::Script script) Q_DECL_OVERRIDE;
QFontEngine *fontEngine(const QFontDef &fontDef, void *handle) Q_DECL_OVERRIDE;
QFontEngine *fontEngine(const QByteArray &fontData, qreal pixelSize, QFont::HintingPreference hintingPreference) Q_DECL_OVERRIDE;
diff --git a/src/platformsupport/input/evdevtouch/qevdevtouchhandler_p.h b/src/platformsupport/input/evdevtouch/qevdevtouchhandler_p.h
index b29aa3a793..6554d4998c 100644
--- a/src/platformsupport/input/evdevtouch/qevdevtouchhandler_p.h
+++ b/src/platformsupport/input/evdevtouch/qevdevtouchhandler_p.h
@@ -51,6 +51,7 @@
// We mean it.
//
+#include <QtGui/private/qtguiglobal_p.h>
#include <QObject>
#include <QString>
#include <QList>
diff --git a/src/platformsupport/themes/qabstractfileiconengine.cpp b/src/platformsupport/themes/qabstractfileiconengine.cpp
index 19a8eee47b..192ed00510 100644
--- a/src/platformsupport/themes/qabstractfileiconengine.cpp
+++ b/src/platformsupport/themes/qabstractfileiconengine.cpp
@@ -73,8 +73,7 @@ QPixmap QAbstractFileIconEngine::pixmap(const QSize &size, QIcon::Mode mode,
if (key.isEmpty())
return filePixmap(size, mode, state);
- key += QLatin1Char('_');
- key += QString::number(size.width());
+ key += QLatin1Char('_') + QString::number(size.width());
QPixmap result;
if (!QPixmapCache::find(key, result)) {
diff --git a/src/plugins/bearer/bearer.pro b/src/plugins/bearer/bearer.pro
index 8078a5708c..b362722b28 100644
--- a/src/plugins/bearer/bearer.pro
+++ b/src/plugins/bearer/bearer.pro
@@ -1,4 +1,5 @@
TEMPLATE = subdirs
+QT_FOR_CONFIG += network-private
!android:linux*:qtHaveModule(dbus) {
SUBDIRS += generic
diff --git a/src/plugins/bearer/connman/qconnmanengine.cpp b/src/plugins/bearer/connman/qconnmanengine.cpp
index 51ee51a64a..eabae5a07b 100644
--- a/src/plugins/bearer/connman/qconnmanengine.cpp
+++ b/src/plugins/bearer/connman/qconnmanengine.cpp
@@ -93,9 +93,9 @@ void QConnmanEngine::initialize()
connect(connmanManager,SIGNAL(servicesReady(QStringList)),this,SLOT(servicesReady(QStringList)));
connect(connmanManager,SIGNAL(scanFinished(bool)),this,SLOT(finishedScan(bool)));
- foreach (const QString &servPath, connmanManager->getServices()) {
+ const auto servPaths = connmanManager->getServices();
+ for (const QString &servPath : servPaths)
addServiceConfiguration(servPath);
- }
Q_EMIT updateCompleted();
}
@@ -115,9 +115,8 @@ void QConnmanEngine::changedModem()
void QConnmanEngine::servicesReady(const QStringList &list)
{
QMutexLocker locker(&mutex);
- foreach (const QString &servPath, list) {
+ for (const QString &servPath : list)
addServiceConfiguration(servPath);
- }
Q_EMIT updateCompleted();
}
@@ -329,7 +328,8 @@ QNetworkSessionPrivate *QConnmanEngine::createSessionBackend()
QNetworkConfigurationPrivatePointer QConnmanEngine::defaultConfiguration()
{
const QMutexLocker locker(&mutex);
- Q_FOREACH (const QString &servPath, connmanManager->getServices()) {
+ const auto servPaths = connmanManager->getServices();
+ for (const QString &servPath : servPaths) {
if (connmanServiceInterfaces.contains(servPath)) {
if (accessPointConfigurations.contains(servPath))
return accessPointConfigurations.value(servPath);
@@ -461,7 +461,8 @@ QNetworkConfiguration::BearerType QConnmanEngine::ofonoTechToBearerType(const QS
bool QConnmanEngine::isRoamingAllowed(const QString &context)
{
- foreach (const QString &dcPath, ofonoContextManager->contexts()) {
+ const auto dcPaths = ofonoContextManager->contexts();
+ for (const QString &dcPath : dcPaths) {
if (dcPath.contains(context.section("_",-1))) {
return ofonoContextManager->roamingAllowed();
}
@@ -557,7 +558,8 @@ bool QConnmanEngine::requiresPolling() const
void QConnmanEngine::reEvaluateCellular()
{
- Q_FOREACH (const QString &servicePath, connmanManager->getServices()) {
+ const auto servicePaths = connmanManager->getServices();
+ for (const QString &servicePath : servicePaths) {
if (servicePath.contains("cellular") && accessPointConfigurations.contains(servicePath)) {
configurationChange(connmanServiceInterfaces.value(servicePath));
}
diff --git a/src/plugins/bearer/connman/qconnmanservice_linux.cpp b/src/plugins/bearer/connman/qconnmanservice_linux.cpp
index 7fbbe2cd07..bc89f540fc 100644
--- a/src/plugins/bearer/connman/qconnmanservice_linux.cpp
+++ b/src/plugins/bearer/connman/qconnmanservice_linux.cpp
@@ -144,10 +144,9 @@ void QConnmanManagerInterface::servicesReply(QDBusPendingCallWatcher *call)
qDebug() << serv_reply.error().message();
} else {
servicesList.clear(); //connman list changes order
- ConnmanMap connmanobj;
- Q_FOREACH (connmanobj, serv_reply.value()) {
+ const ConnmanMapList connmanobjs = serv_reply.value();
+ for (const ConnmanMap &connmanobj : connmanobjs)
servicesList << connmanobj.objectPath.path();
- }
Q_EMIT servicesReady(servicesList);
}
call->deleteLater();
@@ -181,7 +180,7 @@ void QConnmanManagerInterface::connectNotify(const QMetaMethod &signal)
void QConnmanManagerInterface::onServicesChanged(const ConnmanMapList &changed, const QList<QDBusObjectPath> &removed)
{
servicesList.clear(); //connman list changes order
- Q_FOREACH (const ConnmanMap &connmanobj, changed) {
+ for (const ConnmanMap &connmanobj : changed) {
const QString svcPath(connmanobj.objectPath.path());
servicesList << svcPath;
}
@@ -225,7 +224,8 @@ QStringList QConnmanManagerInterface::getTechnologies()
QDBusPendingReply<ConnmanMapList> reply = call(QLatin1String("GetTechnologies"));
reply.waitForFinished();
if (!reply.isError()) {
- Q_FOREACH (const ConnmanMap &map, reply.value()) {
+ const ConnmanMapList maps = reply.value();
+ for (const ConnmanMap &map : maps) {
if (!technologiesMap.contains(map.objectPath.path())) {
technologyAdded(map.objectPath, map.propertyMap);
}
@@ -241,9 +241,9 @@ QStringList QConnmanManagerInterface::getServices()
QDBusPendingReply<ConnmanMapList> reply = call(QLatin1String("GetServices"));
reply.waitForFinished();
if (!reply.isError()) {
- Q_FOREACH (const ConnmanMap &map, reply.value()) {
+ const ConnmanMapList maps = reply.value();
+ for (const ConnmanMap &map : maps)
servicesList << map.objectPath.path();
- }
}
}
return servicesList;
diff --git a/src/plugins/bearer/linux_common/qofonoservice_linux.cpp b/src/plugins/bearer/linux_common/qofonoservice_linux.cpp
index b0f5f29f6c..adf7feef2e 100644
--- a/src/plugins/bearer/linux_common/qofonoservice_linux.cpp
+++ b/src/plugins/bearer/linux_common/qofonoservice_linux.cpp
@@ -103,9 +103,9 @@ QStringList QOfonoManagerInterface::getModems()
QDBusPendingReply<PathPropertiesList> reply = callWithArgumentList(QDBus::Block, QLatin1String("GetModems"), argumentList);
reply.waitForFinished();
if (!reply.isError()) {
- foreach (const ObjectPathProperties &modem, reply.value()) {
+ const auto modems = reply.value();
+ for (const ObjectPathProperties &modem : modems)
modemList << modem.path.path();
- }
}
}
@@ -114,8 +114,8 @@ QStringList QOfonoManagerInterface::getModems()
QString QOfonoManagerInterface::currentModem()
{
- QStringList modems = getModems();
- foreach (const QString &modem, modems) {
+ const QStringList modems = getModems();
+ for (const QString &modem : modems) {
QOfonoModemInterface device(modem);
if (device.isPowered() && device.isOnline()
&& device.interfaces().contains(QStringLiteral("org.ofono.NetworkRegistration")))
@@ -266,9 +266,9 @@ QStringList QOfonoDataConnectionManagerInterface::contexts()
QDBusPendingReply<PathPropertiesList > reply = call(QLatin1String("GetContexts"));
reply.waitForFinished();
if (!reply.isError()) {
- foreach (const ObjectPathProperties &context, reply.value()) {
+ const auto contexts = reply.value();
+ for (const ObjectPathProperties &context : contexts)
contextList << context.path.path();
- }
}
}
return contextList;
diff --git a/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp b/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp
index f02b6befb8..543e66491d 100644
--- a/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp
+++ b/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp
@@ -127,7 +127,8 @@ void QNetworkManagerEngine::setupConfigurations()
{
QMutexLocker locker(&mutex);
// Get active connections.
- foreach (const QDBusObjectPath &acPath, managerInterface->activeConnections()) {
+ const auto acPaths = managerInterface->activeConnections();
+ for (const QDBusObjectPath &acPath : acPaths) {
if (activeConnectionsList.contains(acPath.path()))
continue;
@@ -144,8 +145,10 @@ void QNetworkManagerEngine::setupConfigurations()
connectionInterfaces.insert(activeConnection->connection().path(),device.networkInterface());
}
}
+
// Get connections.
- foreach (const QDBusObjectPath &settingsPath, systemSettings->listConnections()) {
+ const auto settingsPaths = systemSettings->listConnections();
+ for (const QDBusObjectPath &settingsPath : settingsPaths) {
locker.unlock();
if (!hasIdentifier(settingsPath.path()))
newConnection(settingsPath, systemSettings); //add system connection configs
@@ -189,21 +192,13 @@ void QNetworkManagerEngine::connectToId(const QString &id)
if (isConnectionActive(settingsPath))
return;
- QHashIterator<QString, QNetworkManagerInterfaceDevice*> i(interfaceDevices);
- while (i.hasNext()) {
- i.next();
- if (i.value()->deviceType() == DEVICE_TYPE_ETHERNET &&
- connectionType == DEVICE_TYPE_ETHERNET) {
- dbusDevicePath = i.key();
- break;
- } else if (i.value()->deviceType() == DEVICE_TYPE_WIFI &&
- connectionType == DEVICE_TYPE_WIFI) {
- dbusDevicePath = i.key();
- break;
- } else if (i.value()->deviceType() == DEVICE_TYPE_MODEM &&
- connectionType == DEVICE_TYPE_MODEM) {
- dbusDevicePath = i.key();
- break;
+ for (auto i = interfaceDevices.cbegin(), end = interfaceDevices.cend(); i != end; ++i) {
+ const auto type = i.value()->deviceType();
+ if (type == DEVICE_TYPE_ETHERNET || type == DEVICE_TYPE_WIFI || type == DEVICE_TYPE_MODEM) {
+ if (type == connectionType) {
+ dbusDevicePath = i.key();
+ break;
+ }
}
}
@@ -230,9 +225,7 @@ void QNetworkManagerEngine::disconnectFromId(const QString &id)
return;
}
- QHashIterator<QString, QNetworkManagerConnectionActive*> i(activeConnectionsList);
- while (i.hasNext()) {
- i.next();
+ for (auto i = activeConnectionsList.cbegin(), end = activeConnectionsList.cend(); i != end; ++i) {
if (id == i.value()->connection().path() && accessPointConfigurations.contains(id)) {
managerInterface->deactivateConnection(QDBusObjectPath(i.key()));
break;
@@ -243,11 +236,8 @@ void QNetworkManagerEngine::disconnectFromId(const QString &id)
void QNetworkManagerEngine::requestUpdate()
{
if (managerInterface && managerInterface->wirelessEnabled()) {
- QHashIterator<QString, QNetworkManagerInterfaceDeviceWireless *> i(wirelessDevices);
- while (i.hasNext()) {
- i.next();
- i.value()->requestScan();
- }
+ for (auto *wirelessDevice : qAsConst(wirelessDevices))
+ wirelessDevice->requestScan();
}
QMetaObject::invokeMethod(this, "updateCompleted", Qt::QueuedConnection);
}
@@ -255,20 +245,17 @@ void QNetworkManagerEngine::requestUpdate()
void QNetworkManagerEngine::interfacePropertiesChanged(const QMap<QString, QVariant> &properties)
{
QMutexLocker locker(&mutex);
- QMapIterator<QString, QVariant> i(properties);
- while (i.hasNext()) {
- i.next();
+ for (auto i = properties.cbegin(), end = properties.cend(); i != end; ++i) {
if (i.key() == QLatin1String("ActiveConnections")) {
// Active connections changed, update configurations.
- QList<QDBusObjectPath> activeConnections =
- qdbus_cast<QList<QDBusObjectPath> >(i.value().value<QDBusArgument>());
+ const auto activeConnections = qdbus_cast<QList<QDBusObjectPath> >(i.value().value<QDBusArgument>());
QStringList identifiers = accessPointConfigurations.keys();
QStringList priorActiveConnections = activeConnectionsList.keys();
- foreach (const QDBusObjectPath &acPath, activeConnections) {
+ for (const QDBusObjectPath &acPath : activeConnections) {
priorActiveConnections.removeOne(acPath.path());
QNetworkManagerConnectionActive *activeConnection =
activeConnectionsList.value(acPath.path());
@@ -399,7 +386,8 @@ void QNetworkManagerEngine::wiredCarrierChanged(bool carrier)
if (!deviceWired)
return;
QMutexLocker locker(&mutex);
- foreach (const QDBusObjectPath &settingsPath, systemSettings->listConnections()) {
+ const auto settingsPaths = systemSettings->listConnections();
+ for (const QDBusObjectPath &settingsPath : settingsPaths) {
for (int i = 0; i < connections.count(); ++i) {
QNetworkManagerSettingsConnection *connection = connections.at(i);
if (connection->getType() == DEVICE_TYPE_ETHERNET
@@ -477,12 +465,9 @@ void QNetworkManagerEngine::newConnection(const QDBusObjectPath &path,
cpPriv->state |= QNetworkConfiguration::Active;
if (deviceType == DEVICE_TYPE_ETHERNET) {
- QHashIterator<QString, QNetworkManagerInterfaceDevice*> i(interfaceDevices);
- while (i.hasNext()) {
- i.next();
- if (i.value()->deviceType() == deviceType) {
- QNetworkManagerInterfaceDeviceWired *wiredDevice
- = wiredDevices.value(i.value()->path());
+ for (const auto *interfaceDevice : interfaceDevices) {
+ if (interfaceDevice->deviceType() == deviceType) {
+ auto *wiredDevice = wiredDevices.value(interfaceDevice->path());
if (wiredDevice && wiredDevice->carrier()) {
cpPriv->state |= QNetworkConfiguration::Discovered;
}
@@ -559,7 +544,8 @@ void QNetworkManagerEngine::updateConnection()
QNetworkConfigurationPrivate *cpPriv = parseConnection(settingsPath, connection->getSettings());
// Check if connection is active.
- foreach (const QDBusObjectPath &acPath, managerInterface->activeConnections()) {
+ const auto acPaths = managerInterface->activeConnections();
+ for (const QDBusObjectPath &acPath : acPaths) {
QNetworkManagerConnectionActive activeConnection(acPath.path());
if (activeConnection.connection().path() == settingsPath &&
@@ -635,7 +621,8 @@ QNetworkConfigurationPrivate *QNetworkManagerEngine::parseConnection(const QStri
if (connectionType == QLatin1String("802-3-ethernet")) {
cpPriv->bearerType = QNetworkConfiguration::BearerEthernet;
- foreach (const QDBusObjectPath &devicePath, managerInterface->getDevices()) {
+ const auto devicePaths = managerInterface->getDevices();
+ for (const QDBusObjectPath &devicePath : devicePaths) {
QNetworkManagerInterfaceDevice device(devicePath.path(),this);
if (device.deviceType() == DEVICE_TYPE_ETHERNET) {
QNetworkManagerInterfaceDeviceWired *wiredDevice = wiredDevices.value(device.path());
@@ -729,9 +716,7 @@ QNetworkSession::State QNetworkManagerEngine::sessionStateForId(const QString &i
if (!ptr->isValid)
return QNetworkSession::Invalid;
- foreach (const QString &acPath, activeConnectionsList.keys()) {
- QNetworkManagerConnectionActive *activeConnection = activeConnectionsList.value(acPath);
-
+ for (QNetworkManagerConnectionActive *activeConnection : activeConnectionsList) {
const QString identifier = activeConnection->connection().path();
if (id == identifier) {
@@ -932,7 +917,8 @@ void QNetworkManagerEngine::ofonoRegistered(const QString &)
}
ofonoManager = new QOfonoManagerInterface(this);
if (ofonoManager && ofonoManager->isValid()) {
- Q_FOREACH (const QString &modem, ofonoManager->getModems()) {
+ const auto modems = ofonoManager->getModems();
+ for (const QString &modem : modems) {
QOfonoDataConnectionManagerInterface *ofonoContextManager
= new QOfonoDataConnectionManagerInterface(modem,this);
ofonoContextManagers.insert(modem, ofonoContextManager);
diff --git a/src/plugins/bearer/qnetworksession_impl.cpp b/src/plugins/bearer/qnetworksession_impl.cpp
index 85942b56f1..5ce51670f7 100644
--- a/src/plugins/bearer/qnetworksession_impl.cpp
+++ b/src/plugins/bearer/qnetworksession_impl.cpp
@@ -54,7 +54,8 @@ static QBearerEngineImpl *getEngineFromId(const QString &id)
{
QNetworkConfigurationManagerPrivate *priv = qNetworkConfigurationManagerPrivate();
- foreach (QBearerEngine *engine, priv->engines()) {
+ const auto engines = priv->engines();
+ for (QBearerEngine *engine : engines) {
QBearerEngineImpl *engineImpl = qobject_cast<QBearerEngineImpl *>(engine);
if (engineImpl && engineImpl->hasIdentifier(id))
return engineImpl;
@@ -306,7 +307,8 @@ void QNetworkSessionPrivateImpl::updateStateFromServiceNetwork()
{
QNetworkSession::State oldState = state;
- foreach (const QNetworkConfiguration &config, serviceConfig.children()) {
+ const auto configs = serviceConfig.children();
+ for (const QNetworkConfiguration &config : configs) {
if ((config.state() & QNetworkConfiguration::Active) != QNetworkConfiguration::Active)
continue;
diff --git a/src/plugins/generic/generic.pro b/src/plugins/generic/generic.pro
index c0a81d4dc8..996e57d015 100644
--- a/src/plugins/generic/generic.pro
+++ b/src/plugins/generic/generic.pro
@@ -1,6 +1,5 @@
TEMPLATE = subdirs
-
-load(qfeatures)
+QT_FOR_CONFIG += gui-private network-private
qtConfig(evdev) {
SUBDIRS += evdevmouse evdevtouch evdevkeyboard evdevtablet
@@ -10,7 +9,7 @@ qtConfig(tslib) {
SUBDIRS += tslib
}
-!contains(QT_DISABLED_FEATURES, udpsocket) {
+qtConfig(udpsocket) {
SUBDIRS += tuiotouch
}
diff --git a/src/plugins/generic/tuiotouch/qoscbundle.cpp b/src/plugins/generic/tuiotouch/qoscbundle.cpp
index 6ddca9b09d..b84ae39aca 100644
--- a/src/plugins/generic/tuiotouch/qoscbundle.cpp
+++ b/src/plugins/generic/tuiotouch/qoscbundle.cpp
@@ -38,17 +38,20 @@
**
****************************************************************************/
+#include "qoscbundle_p.h"
+#include "qtuio_p.h"
+
#include <QtEndian>
#include <QDebug>
#include <QLoggingCategory>
-#include "qoscbundle_p.h"
-#include "qtuio_p.h"
QT_BEGIN_NAMESPACE
Q_LOGGING_CATEGORY(lcTuioBundle, "qt.qpa.tuio.bundle")
+QOscBundle::QOscBundle() {}
+
// TUIO packets are transmitted using the OSC protocol, located at:
// http://opensoundcontrol.org/specification
// Snippets of this specification have been pasted into the source as a means of
@@ -172,21 +175,5 @@ QOscBundle::QOscBundle(const QByteArray &data)
}
}
-
-bool QOscBundle::isValid() const
-{
- return m_isValid;
-}
-
-QList<QOscBundle> QOscBundle::bundles() const
-{
- return m_bundles;
-}
-
-QList<QOscMessage> QOscBundle::messages() const
-{
- return m_messages;
-}
-
QT_END_NAMESPACE
diff --git a/src/plugins/generic/tuiotouch/qoscbundle_p.h b/src/plugins/generic/tuiotouch/qoscbundle_p.h
index e95a202ae7..cb3ec4d251 100644
--- a/src/plugins/generic/tuiotouch/qoscbundle_p.h
+++ b/src/plugins/generic/tuiotouch/qoscbundle_p.h
@@ -43,25 +43,32 @@
#include "qoscmessage_p.h"
+#include <QtCore/QVector>
+
QT_BEGIN_NAMESPACE
+class QByteArray;
+
class QOscBundle
{
+ QOscBundle(); // for QVector, don't use
+ friend class QVector<QOscBundle>;
public:
- QOscBundle(const QByteArray &data);
+ explicit QOscBundle(const QByteArray &data);
- bool isValid() const;
- QList<QOscBundle> bundles() const;
- QList<QOscMessage> messages() const;
+ bool isValid() const { return m_isValid; }
+ QVector<QOscBundle> bundles() const { return m_bundles; }
+ QVector<QOscMessage> messages() const { return m_messages; }
private:
bool m_isValid;
bool m_immediate;
quint32 m_timeEpoch;
quint32 m_timePico;
- QList<QOscBundle> m_bundles;
- QList<QOscMessage> m_messages;
+ QVector<QOscBundle> m_bundles;
+ QVector<QOscMessage> m_messages;
};
+Q_DECLARE_TYPEINFO(QOscBundle, Q_MOVABLE_TYPE);
QT_END_NAMESPACE
diff --git a/src/plugins/generic/tuiotouch/qoscmessage.cpp b/src/plugins/generic/tuiotouch/qoscmessage.cpp
index 6f82cd784b..b2004903bd 100644
--- a/src/plugins/generic/tuiotouch/qoscmessage.cpp
+++ b/src/plugins/generic/tuiotouch/qoscmessage.cpp
@@ -38,19 +38,19 @@
**
****************************************************************************/
-#include <QByteArray>
+#include "qoscmessage_p.h"
+#include "qtuio_p.h"
+
#include <QDebug>
#include <QtEndian>
-#include <QVariant>
#include <QLoggingCategory>
-#include "qoscmessage_p.h"
-#include "qtuio_p.h"
-
QT_BEGIN_NAMESPACE
Q_LOGGING_CATEGORY(lcTuioMessage, "qt.qpa.tuio.message")
+QOscMessage::QOscMessage() {}
+
// TUIO packets are transmitted using the OSC protocol, located at:
// http://opensoundcontrol.org/specification
// Snippets of this specification have been pasted into the source as a means of
@@ -125,20 +125,5 @@ QOscMessage::QOscMessage(const QByteArray &data)
qCDebug(lcTuioMessage) << "Message with address pattern: " << addressPattern << " arguments: " << arguments;
}
-bool QOscMessage::isValid() const
-{
- return m_isValid;
-}
-
-QByteArray QOscMessage::addressPattern() const
-{
- return m_addressPattern;
-}
-
-QList<QVariant> QOscMessage::arguments() const
-{
- return m_arguments;
-}
-
QT_END_NAMESPACE
diff --git a/src/plugins/generic/tuiotouch/qoscmessage_p.h b/src/plugins/generic/tuiotouch/qoscmessage_p.h
index 788a03e504..76d40ceb18 100644
--- a/src/plugins/generic/tuiotouch/qoscmessage_p.h
+++ b/src/plugins/generic/tuiotouch/qoscmessage_p.h
@@ -41,22 +41,32 @@
#ifndef QOSCMESSAGE_P_H
#define QOSCMESSAGE_P_H
+#include <QtCore/QByteArray>
+#include <QtCore/QVariant>
+#include <QtCore/QVector>
+#include <QtCore/QList>
+
+
QT_BEGIN_NAMESPACE
class QOscMessage
{
+ QOscMessage(); // for QVector, don't use
+ friend class QVector<QOscMessage>;
public:
- QOscMessage(const QByteArray &data);
- bool isValid() const;
+ explicit QOscMessage(const QByteArray &data);
+
+ bool isValid() const { return m_isValid; }
- QByteArray addressPattern() const;
- QList<QVariant> arguments() const;
+ QByteArray addressPattern() const { return m_addressPattern; }
+ QList<QVariant> arguments() const { return m_arguments; }
private:
bool m_isValid;
QByteArray m_addressPattern;
QList<QVariant> m_arguments;
};
+Q_DECLARE_TYPEINFO(QOscMessage, Q_MOVABLE_TYPE);
QT_END_NAMESPACE
diff --git a/src/plugins/generic/tuiotouch/qtuiocursor_p.h b/src/plugins/generic/tuiotouch/qtuiocursor_p.h
index 2ff762b836..46134e6f3f 100644
--- a/src/plugins/generic/tuiotouch/qtuiocursor_p.h
+++ b/src/plugins/generic/tuiotouch/qtuiocursor_p.h
@@ -102,6 +102,7 @@ private:
float m_acceleration;
Qt::TouchPointState m_state;
};
+Q_DECLARE_TYPEINFO(QTuioCursor, Q_MOVABLE_TYPE); // Q_PRIMITIVE_TYPE: not possible, m_state is = 1, not 0.
QT_END_NAMESPACE
diff --git a/src/plugins/generic/tuiotouch/qtuiohandler.cpp b/src/plugins/generic/tuiotouch/qtuiohandler.cpp
index 38105fe656..26b88d6d78 100644
--- a/src/plugins/generic/tuiotouch/qtuiohandler.cpp
+++ b/src/plugins/generic/tuiotouch/qtuiohandler.cpp
@@ -38,19 +38,22 @@
**
****************************************************************************/
-#include <QLoggingCategory>
-#include <QRect>
-#include <QWindow>
-#include <QGuiApplication>
-#include <QTouchDevice>
-#include <qmath.h>
-
-#include <qpa/qwindowsysteminterface.h>
+#include "qtuiohandler_p.h"
#include "qtuiocursor_p.h"
#include "qtuiotoken_p.h"
-#include "qtuiohandler_p.h"
#include "qoscbundle_p.h"
+#include "qoscmessage_p.h"
+
+#include <qpa/qwindowsysteminterface.h>
+
+#include <QTouchDevice>
+#include <QWindow>
+#include <QGuiApplication>
+
+#include <QLoggingCategory>
+#include <QRect>
+#include <qmath.h>
QT_BEGIN_NAMESPACE
@@ -151,7 +154,7 @@ void QTuioHandler::processPackets()
// messages. The FSEQ frame ID is incremented for each delivered bundle,
// while redundant bundles can be marked using the frame sequence ID
// -1."
- QList<QOscMessage> messages;
+ QVector<QOscMessage> messages;
QOscBundle bundle(datagram);
if (bundle.isValid()) {
diff --git a/src/plugins/generic/tuiotouch/qtuiotoken_p.h b/src/plugins/generic/tuiotouch/qtuiotoken_p.h
index 5084aeed11..b784190d53 100644
--- a/src/plugins/generic/tuiotouch/qtuiotoken_p.h
+++ b/src/plugins/generic/tuiotouch/qtuiotoken_p.h
@@ -138,6 +138,7 @@ private:
float m_angularAcceleration;
Qt::TouchPointState m_state;
};
+Q_DECLARE_TYPEINFO(QTuioToken, Q_MOVABLE_TYPE); // Q_PRIMITIVE_TYPE: not possible: m_id, m_classId == -1
QT_END_NAMESPACE
diff --git a/src/plugins/generic/tuiotouch/tuiotouch.pro b/src/plugins/generic/tuiotouch/tuiotouch.pro
index ad6a1c6876..08f7036c92 100644
--- a/src/plugins/generic/tuiotouch/tuiotouch.pro
+++ b/src/plugins/generic/tuiotouch/tuiotouch.pro
@@ -21,6 +21,7 @@ HEADERS += \
OTHER_FILES += \
tuiotouch.json
+DEFINES += QT_NO_FOREACH
PLUGIN_TYPE = generic
PLUGIN_EXTENDS = -
PLUGIN_CLASS_NAME = QTuioTouchPlugin
diff --git a/src/plugins/imageformats/imageformats.pro b/src/plugins/imageformats/imageformats.pro
index d2588c1b18..9d1c0c8fdf 100644
--- a/src/plugins/imageformats/imageformats.pro
+++ b/src/plugins/imageformats/imageformats.pro
@@ -1,4 +1,5 @@
TEMPLATE = subdirs
+QT_FOR_CONFIG += gui-private
qtConfig(ico): SUBDIRS += ico
qtConfig(jpeg): SUBDIRS += jpeg
diff --git a/src/plugins/platforminputcontexts/platforminputcontexts.pro b/src/plugins/platforminputcontexts/platforminputcontexts.pro
index f22b8b69db..ed6b1b8702 100644
--- a/src/plugins/platforminputcontexts/platforminputcontexts.pro
+++ b/src/plugins/platforminputcontexts/platforminputcontexts.pro
@@ -1,4 +1,5 @@
TEMPLATE = subdirs
+QT_FOR_CONFIG += gui-private
qtHaveModule(dbus) {
!mac:!win32:SUBDIRS += ibus
diff --git a/src/plugins/platforms/cocoa/qcocoaglcontext.mm b/src/plugins/platforms/cocoa/qcocoaglcontext.mm
index 7a12969972..628357eb39 100644
--- a/src/plugins/platforms/cocoa/qcocoaglcontext.mm
+++ b/src/plugins/platforms/cocoa/qcocoaglcontext.mm
@@ -312,8 +312,16 @@ void QCocoaGLContext::updateSurfaceFormat()
m_format.setSamples(samples);
int doubleBuffered = -1;
+ int tripleBuffered = -1;
[pixelFormat getValues:&doubleBuffered forAttribute:NSOpenGLPFADoubleBuffer forVirtualScreen:0];
- m_format.setSwapBehavior(doubleBuffered == 1 ? QSurfaceFormat::DoubleBuffer : QSurfaceFormat::SingleBuffer);
+ [pixelFormat getValues:&tripleBuffered forAttribute:NSOpenGLPFATripleBuffer forVirtualScreen:0];
+
+ if (tripleBuffered == 1)
+ m_format.setSwapBehavior(QSurfaceFormat::TripleBuffer);
+ else if (doubleBuffered == 1)
+ m_format.setSwapBehavior(QSurfaceFormat::DoubleBuffer);
+ else
+ m_format.setSwapBehavior(QSurfaceFormat::SingleBuffer);
int steroBuffers = -1;
[pixelFormat getValues:&steroBuffers forAttribute:NSOpenGLPFAStereo forVirtualScreen:0];
diff --git a/src/plugins/platforms/eglfs/deviceintegration/deviceintegration.pro b/src/plugins/platforms/eglfs/deviceintegration/deviceintegration.pro
index b46b04d149..d86a67b4f4 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/deviceintegration.pro
+++ b/src/plugins/platforms/eglfs/deviceintegration/deviceintegration.pro
@@ -1,4 +1,5 @@
TEMPLATE = subdirs
+QT_FOR_CONFIG += gui-private
qtConfig(egl_x11): SUBDIRS += eglfs_x11
qtConfig(eglfs_gbm): SUBDIRS += eglfs_kms_support eglfs_kms
diff --git a/src/plugins/platforms/platforms.pro b/src/plugins/platforms/platforms.pro
index fcfebf6e94..938e63d95a 100644
--- a/src/plugins/platforms/platforms.pro
+++ b/src/plugins/platforms/platforms.pro
@@ -1,4 +1,5 @@
TEMPLATE = subdirs
+QT_FOR_CONFIG += gui-private
android: SUBDIRS += android
diff --git a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp
index a7106c972b..8f1358de6c 100644
--- a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp
+++ b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp
@@ -750,10 +750,13 @@ void QWindowsNativeFileDialogBase::setDirectory(const QUrl &directory)
QString QWindowsNativeFileDialogBase::directory() const
{
+ QString result;
IShellItem *item = 0;
- if (m_fileDialog && SUCCEEDED(m_fileDialog->GetFolder(&item)) && item)
- return QWindowsNativeFileDialogBase::itemPath(item);
- return QString();
+ if (m_fileDialog && SUCCEEDED(m_fileDialog->GetFolder(&item)) && item) {
+ result = QWindowsNativeFileDialogBase::itemPath(item);
+ item->Release();
+ }
+ return result;
}
void QWindowsNativeFileDialogBase::doExec(HWND owner)
@@ -1216,8 +1219,10 @@ QList<QUrl> QWindowsNativeSaveFileDialog::selectedFiles() const
QList<QUrl> result;
IShellItem *item = 0;
const HRESULT hr = fileDialog()->GetCurrentSelection(&item);
- if (SUCCEEDED(hr) && item)
+ if (SUCCEEDED(hr) && item) {
result.push_back(QUrl::fromLocalFile(QWindowsNativeSaveFileDialog::itemPath(item)));
+ item->Release();
+ }
return result;
}
diff --git a/src/plugins/platforms/winrt/qwinrtinputcontext.cpp b/src/plugins/platforms/winrt/qwinrtinputcontext.cpp
index 3f476556ee..968c47f2c2 100644
--- a/src/plugins/platforms/winrt/qwinrtinputcontext.cpp
+++ b/src/plugins/platforms/winrt/qwinrtinputcontext.cpp
@@ -39,6 +39,7 @@
#include "qwinrtinputcontext.h"
#include "qwinrtscreen.h"
+#include <QtGui/QGuiApplication>
#include <QtGui/QWindow>
#include <private/qeventdispatcher_winrt_p.h>
@@ -59,7 +60,7 @@ QT_BEGIN_NAMESPACE
Q_LOGGING_CATEGORY(lcQpaInputMethods, "qt.qpa.input.methods")
-inline QRectF getInputPaneRect(IInputPane *pane, qreal scaleFactor)
+inline QRectF getInputPaneRect(ComPtr<IInputPane> pane, qreal scaleFactor)
{
Rect rect;
pane->get_OccludedRect(&rect);
@@ -85,28 +86,32 @@ QWinRTInputContext::QWinRTInputContext(QWinRTScreen *screen)
{
qCDebug(lcQpaInputMethods) << __FUNCTION__ << screen;
- IInputPaneStatics *statics;
+ ComPtr<IInputPaneStatics> statics;
if (FAILED(GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_UI_ViewManagement_InputPane).Get(),
&statics))) {
qWarning("failed to retrieve input pane statics.");
return;
}
- IInputPane *inputPane;
+ ComPtr<IInputPane> inputPane;
statics->GetForCurrentView(&inputPane);
- statics->Release();
if (inputPane) {
- EventRegistrationToken showToken, hideToken;
- inputPane->add_Showing(Callback<InputPaneVisibilityHandler>(
- this, &QWinRTInputContext::onShowing).Get(), &showToken);
- inputPane->add_Hiding(Callback<InputPaneVisibilityHandler>(
- this, &QWinRTInputContext::onHiding).Get(), &hideToken);
+ QEventDispatcherWinRT::runOnXamlThread([this, inputPane]() {
+ EventRegistrationToken showToken, hideToken;
+ inputPane->add_Showing(Callback<InputPaneVisibilityHandler>(
+ this, &QWinRTInputContext::onShowing).Get(), &showToken);
+ inputPane->add_Hiding(Callback<InputPaneVisibilityHandler>(
+ this, &QWinRTInputContext::onHiding).Get(), &hideToken);
+ return S_OK;
+ });
m_keyboardRect = getInputPaneRect(inputPane, m_screen->scaleFactor());
m_isInputPanelVisible = !m_keyboardRect.isEmpty();
} else {
qWarning("failed to retrieve InputPane.");
}
+ connect(QGuiApplication::inputMethod(), &QInputMethod::cursorRectangleChanged,
+ this, &QWinRTInputContext::updateScreenCursorRect);
}
QRectF QWinRTInputContext::keyboardRect() const
@@ -119,6 +124,11 @@ bool QWinRTInputContext::isInputPanelVisible() const
return m_isInputPanelVisible;
}
+void QWinRTInputContext::updateScreenCursorRect()
+{
+ m_screen->setCursorRect(QGuiApplication::inputMethod()->cursorRectangle());
+}
+
HRESULT QWinRTInputContext::onShowing(IInputPane *pane, IInputPaneVisibilityEventArgs *)
{
qCDebug(lcQpaInputMethods) << __FUNCTION__ << pane;
@@ -141,6 +151,7 @@ HRESULT QWinRTInputContext::handleVisibilityChange(IInputPane *pane)
const QRectF keyboardRect = getInputPaneRect(pane, m_screen->scaleFactor());
if (m_keyboardRect != keyboardRect) {
m_keyboardRect = keyboardRect;
+ m_screen->setKeyboardRect(m_keyboardRect);
emitKeyboardRectChanged();
}
return S_OK;
diff --git a/src/plugins/platforms/winrt/qwinrtinputcontext.h b/src/plugins/platforms/winrt/qwinrtinputcontext.h
index 5e416bb99f..9d5c4187e2 100644
--- a/src/plugins/platforms/winrt/qwinrtinputcontext.h
+++ b/src/plugins/platforms/winrt/qwinrtinputcontext.h
@@ -79,6 +79,9 @@ public:
void hideInputPanel();
#endif
+private slots:
+ void updateScreenCursorRect();
+
private:
HRESULT onShowing(ABI::Windows::UI::ViewManagement::IInputPane *,
ABI::Windows::UI::ViewManagement::IInputPaneVisibilityEventArgs *);
@@ -89,6 +92,7 @@ private:
QWinRTScreen *m_screen;
QRectF m_keyboardRect;
+ QRectF m_cursorRect;
bool m_isInputPanelVisible;
};
diff --git a/src/plugins/platforms/winrt/qwinrtintegration.cpp b/src/plugins/platforms/winrt/qwinrtintegration.cpp
index 42b7f7e909..32edf2b1a2 100644
--- a/src/plugins/platforms/winrt/qwinrtintegration.cpp
+++ b/src/plugins/platforms/winrt/qwinrtintegration.cpp
@@ -197,9 +197,9 @@ QWinRTIntegration::QWinRTIntegration() : d_ptr(new QWinRTIntegrationPrivate)
QEventDispatcherWinRT::runOnXamlThread([d]() {
d->mainScreen = new QWinRTScreen;
- d->inputContext.reset(new QWinRTInputContext(d->mainScreen));
return S_OK;
});
+ d->inputContext.reset(new QWinRTInputContext(d->mainScreen));
screenAdded(d->mainScreen);
d->platformServices = new QWinRTServices;
diff --git a/src/plugins/platforms/winrt/qwinrtscreen.cpp b/src/plugins/platforms/winrt/qwinrtscreen.cpp
index ad32c046df..9236de58a1 100644
--- a/src/plugins/platforms/winrt/qwinrtscreen.cpp
+++ b/src/plugins/platforms/winrt/qwinrtscreen.cpp
@@ -753,12 +753,66 @@ void QWinRTScreen::initialize()
onVisibilityChanged(nullptr, nullptr);
}
+void QWinRTScreen::setCursorRect(const QRectF &cursorRect)
+{
+ mCursorRect = cursorRect;
+}
+
+void QWinRTScreen::setKeyboardRect(const QRectF &keyboardRect)
+{
+ Q_D(QWinRTScreen);
+ QRectF visibleRectF;
+ HRESULT hr;
+ Rect windowSize;
+
+ hr = d->coreWindow->get_Bounds(&windowSize);
+ if (FAILED(hr)) {
+ qErrnoWarning(hr, "Failed to get window bounds");
+ return;
+ }
+ d->logicalRect = QRectF(windowSize.X, windowSize.Y, windowSize.Width, windowSize.Height);
+#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
+ Rect visibleRect;
+ hr = d->view2->get_VisibleBounds(&visibleRect);
+ if (FAILED(hr)) {
+ qErrnoWarning(hr, "Failed to get window visible bounds");
+ return;
+ }
+ visibleRectF = QRectF(visibleRect.X, visibleRect.Y, visibleRect.Width, visibleRect.Height);
+#else
+ visibleRectF = d->logicalRect;
+#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
+ // if keyboard is snapped to the bottom of the screen and would cover the cursor the content is
+ // moved up to make it visible
+ if (keyboardRect.intersects(mCursorRect)
+ && qFuzzyCompare(geometry().height(), keyboardRect.y() + keyboardRect.height())) {
+ visibleRectF.moveTop(visibleRectF.top() - keyboardRect.height() / d->scaleFactor);
+ }
+ d->visibleRect = visibleRectF;
+
+ qCDebug(lcQpaWindows) << __FUNCTION__ << d->visibleRect;
+ QWindowSystemInterface::handleScreenGeometryChange(screen(), geometry(), availableGeometry());
+ QPlatformScreen::resizeMaximizedWindows();
+ handleExpose();
+}
+
QWindow *QWinRTScreen::topWindow() const
{
Q_D(const QWinRTScreen);
return d->visibleWindows.isEmpty() ? 0 : d->visibleWindows.first();
}
+QWindow *QWinRTScreen::windowAt(const QPoint &pos)
+{
+ Q_D(const QWinRTScreen);
+ for (auto w : qAsConst(d->visibleWindows)) {
+ if (w->geometry().contains(pos))
+ return w;
+ }
+ qCDebug(lcQpaWindows) << __FUNCTION__ << ": No window found at:" << pos;
+ return nullptr;
+}
+
void QWinRTScreen::addWindow(QWindow *window)
{
Q_D(QWinRTScreen);
@@ -767,8 +821,12 @@ void QWinRTScreen::addWindow(QWindow *window)
return;
d->visibleWindows.prepend(window);
- updateWindowTitle(window->title());
- QWindowSystemInterface::handleWindowActivated(window, Qt::OtherFocusReason);
+ const Qt::WindowType type = window->type();
+ if (type != Qt::Popup && type != Qt::ToolTip && type != Qt::Tool) {
+ updateWindowTitle(window->title());
+ QWindowSystemInterface::handleWindowActivated(window, Qt::OtherFocusReason);
+ }
+
handleExpose();
QWindowSystemInterface::flushWindowSystemEvents();
@@ -785,7 +843,9 @@ void QWinRTScreen::removeWindow(QWindow *window)
const bool wasTopWindow = window == topWindow();
if (!d->visibleWindows.removeAll(window))
return;
- if (wasTopWindow)
+
+ const Qt::WindowType type = window->type();
+ if (wasTopWindow && type != Qt::Popup && type != Qt::ToolTip && type != Qt::Tool)
QWindowSystemInterface::handleWindowActivated(Q_NULLPTR, Qt::OtherFocusReason);
handleExpose();
QWindowSystemInterface::flushWindowSystemEvents();
@@ -1001,9 +1061,12 @@ HRESULT QWinRTScreen::onPointerUpdated(ICoreWindow *, IPointerEventArgs *args)
pointerPoint->get_Position(&point);
QPointF pos(point.X * d->scaleFactor, point.Y * d->scaleFactor);
QPointF localPos = pos;
- if (topWindow()) {
- const QPointF globalPosDelta = pos - pos.toPoint();
- localPos = topWindow()->mapFromGlobal(pos.toPoint()) + globalPosDelta;
+
+ const QPoint posPoint = pos.toPoint();
+ QWindow *targetWindow = windowAt(posPoint);
+ if (targetWindow) {
+ const QPointF globalPosDelta = pos - posPoint;
+ localPos = targetWindow->mapFromGlobal(posPoint) + globalPosDelta;
}
VirtualKeyModifiers modifiers;
@@ -1038,7 +1101,7 @@ HRESULT QWinRTScreen::onPointerUpdated(ICoreWindow *, IPointerEventArgs *args)
boolean isHorizontal;
properties->get_IsHorizontalMouseWheel(&isHorizontal);
QPoint angleDelta(isHorizontal ? delta : 0, isHorizontal ? 0 : delta);
- QWindowSystemInterface::handleWheelEvent(topWindow(), localPos, pos, QPoint(), angleDelta, mods);
+ QWindowSystemInterface::handleWheelEvent(targetWindow, localPos, pos, QPoint(), angleDelta, mods);
break;
}
@@ -1064,7 +1127,7 @@ HRESULT QWinRTScreen::onPointerUpdated(ICoreWindow *, IPointerEventArgs *args)
if (isPressed)
buttons |= Qt::XButton2;
- QWindowSystemInterface::handleMouseEvent(topWindow(), localPos, pos, buttons, mods);
+ QWindowSystemInterface::handleMouseEvent(targetWindow, localPos, pos, buttons, mods);
break;
}
@@ -1116,7 +1179,7 @@ HRESULT QWinRTScreen::onPointerUpdated(ICoreWindow *, IPointerEventArgs *args)
it.value().normalPosition = QPointF(point.X/d->logicalRect.width(), point.Y/d->logicalRect.height());
it.value().pressure = pressure;
- QWindowSystemInterface::handleTouchEvent(topWindow(), d->touchDevice, d->touchPoints.values(), mods);
+ QWindowSystemInterface::handleTouchEvent(targetWindow, d->touchDevice, d->touchPoints.values(), mods);
// Fall-through for pen to generate tablet event
if (pointerDeviceType != PointerDeviceType_Pen)
@@ -1135,7 +1198,7 @@ HRESULT QWinRTScreen::onPointerUpdated(ICoreWindow *, IPointerEventArgs *args)
float rotation;
properties->get_Twist(&rotation);
- QWindowSystemInterface::handleTabletEvent(topWindow(), isPressed, pos, pos, 0,
+ QWindowSystemInterface::handleTabletEvent(targetWindow, isPressed, pos, pos, 0,
pointerType, pressure, xTilt, yTilt,
0, rotation, 0, id, mods);
diff --git a/src/plugins/platforms/winrt/qwinrtscreen.h b/src/plugins/platforms/winrt/qwinrtscreen.h
index 0e753b748b..e489e208d5 100644
--- a/src/plugins/platforms/winrt/qwinrtscreen.h
+++ b/src/plugins/platforms/winrt/qwinrtscreen.h
@@ -104,6 +104,7 @@ public:
Qt::ScreenOrientation orientation() const Q_DECL_OVERRIDE;
QWindow *topWindow() const;
+ QWindow *windowAt(const QPoint &pos);
void addWindow(QWindow *window);
void removeWindow(QWindow *window);
void raise(QWindow *window);
@@ -116,6 +117,9 @@ public:
void initialize();
+ void setCursorRect(const QRectF &cursorRect);
+ void setKeyboardRect(const QRectF &keyboardRect);
+
private:
void handleExpose();
@@ -140,6 +144,7 @@ private:
#endif
QScopedPointer<QWinRTScreenPrivate> d_ptr;
+ QRectF mCursorRect;
Q_DECLARE_PRIVATE(QWinRTScreen)
};
diff --git a/src/plugins/platforms/xcb/gl_integrations/gl_integrations.pro b/src/plugins/platforms/xcb/gl_integrations/gl_integrations.pro
index 0cdee03f62..b8f878ffe8 100644
--- a/src/plugins/platforms/xcb/gl_integrations/gl_integrations.pro
+++ b/src/plugins/platforms/xcb/gl_integrations/gl_integrations.pro
@@ -1,4 +1,5 @@
TEMPLATE = subdirs
+QT_FOR_CONFIG += gui-private
qtConfig(egl):qtConfig(egl_x11):qtConfig(opengl) {
SUBDIRS += xcb_egl
diff --git a/src/plugins/platforms/xcb/qxcbconnection.h b/src/plugins/platforms/xcb/qxcbconnection.h
index dca32af9b1..f6ba828a15 100644
--- a/src/plugins/platforms/xcb/qxcbconnection.h
+++ b/src/plugins/platforms/xcb/qxcbconnection.h
@@ -43,6 +43,7 @@
#include <xcb/xcb.h>
#include <xcb/randr.h>
+#include <QtGui/private/qtguiglobal_p.h>
#include "qxcbexport.h"
#include <QHash>
#include <QList>
@@ -686,8 +687,12 @@ private:
friend class QXcbEventReader;
};
+#ifdef XCB_USE_XINPUT2
+#ifndef QT_NO_TABLETEVENT
Q_DECLARE_TYPEINFO(QXcbConnection::TabletData::ValuatorClassInfo, Q_PRIMITIVE_TYPE);
Q_DECLARE_TYPEINFO(QXcbConnection::TabletData, Q_MOVABLE_TYPE);
+#endif
+#endif
#define DISPLAY_FROM_XCB(object) ((Display *)(object->connection()->xlib_display()))
#define CREATE_VISUALINFO_FROM_DEFAULT_VISUALID(object) ((XVisualInfo *)(object->connection()->createVisualInfoForDefaultVisualId()))
diff --git a/src/plugins/platforms/xcb/qxcbmime.cpp b/src/plugins/platforms/xcb/qxcbmime.cpp
index 4803c14c4c..749906d1e8 100644
--- a/src/plugins/platforms/xcb/qxcbmime.cpp
+++ b/src/plugins/platforms/xcb/qxcbmime.cpp
@@ -121,9 +121,7 @@ bool QXcbMime::mimeDataForAtom(QXcbConnection *connection, xcb_atom_t a, QMimeDa
// so QXcbConnection::atomName() has to be used.
if (atomName == QLatin1String("text/uri-list")
&& connection->atomName(a) == "text/x-moz-url") {
- const QByteArray uri = data->split('\n').first();
- QString mozUri = QString::fromLatin1(uri, uri.size());
- mozUri += QLatin1Char('\n');
+ const QString mozUri = QLatin1String(data->split('\n').constFirst()) + QLatin1Char('\n');
*data = QByteArray(reinterpret_cast<const char *>(mozUri.utf16()),
mozUri.length() * 2);
} else if (atomName == QLatin1String("application/x-color"))
diff --git a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp
index a3e8da7df8..189ec53050 100644
--- a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp
+++ b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp
@@ -85,7 +85,6 @@ static int resourceType(const QByteArray &key)
QByteArrayLiteral("gettimestamp"), QByteArrayLiteral("x11screen"),
QByteArrayLiteral("rootwindow"),
QByteArrayLiteral("subpixeltype"), QByteArrayLiteral("antialiasingenabled"),
- QByteArrayLiteral("nofonthinting"),
QByteArrayLiteral("atspibus"),
QByteArrayLiteral("compositingenabled")
};
@@ -242,9 +241,6 @@ void *QXcbNativeInterface::nativeResourceForScreen(const QByteArray &resourceStr
case GetTimestamp:
result = getTimestamp(xcbScreen);
break;
- case NoFontHinting:
- result = xcbScreen->noFontHinting() ? this : 0; //qboolptr...
- break;
case RootWindow:
result = reinterpret_cast<void *>(xcbScreen->root());
break;
diff --git a/src/plugins/platforms/xcb/qxcbnativeinterface.h b/src/plugins/platforms/xcb/qxcbnativeinterface.h
index ba19cd869c..8728b6e937 100644
--- a/src/plugins/platforms/xcb/qxcbnativeinterface.h
+++ b/src/plugins/platforms/xcb/qxcbnativeinterface.h
@@ -73,7 +73,6 @@ public:
RootWindow,
ScreenSubpixelType,
ScreenAntialiasingEnabled,
- NoFontHinting,
AtspiBus,
CompositingEnabled
};
diff --git a/src/plugins/platforms/xcb/qxcbscreen.cpp b/src/plugins/platforms/xcb/qxcbscreen.cpp
index dc6846b20b..a9675935f4 100644
--- a/src/plugins/platforms/xcb/qxcbscreen.cpp
+++ b/src/plugins/platforms/xcb/qxcbscreen.cpp
@@ -61,8 +61,7 @@ QXcbVirtualDesktop::QXcbVirtualDesktop(QXcbConnection *connection, xcb_screen_t
, m_number(number)
, m_xSettings(Q_NULLPTR)
{
- QByteArray cmAtomName("_NET_WM_CM_S");
- cmAtomName += QByteArray::number(m_number);
+ const QByteArray cmAtomName = "_NET_WM_CM_S" + QByteArray::number(m_number);
m_net_wm_cm_atom = connection->internAtom(cmAtomName.constData());
m_compositingActive = connection->getSelectionOwner(m_net_wm_cm_atom);
@@ -188,7 +187,6 @@ QXcbScreen::QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDe
, m_forcedDpi(-1)
, m_pixelDensity(1)
, m_hintStyle(QFontEngine::HintStyle(-1))
- , m_noFontHinting(false)
, m_subpixelType(QFontEngine::SubpixelAntialiasingType(-1))
, m_antialiasingEnabled(-1)
{
diff --git a/src/plugins/platforms/xcb/qxcbscreen.h b/src/plugins/platforms/xcb/qxcbscreen.h
index 8716af29b5..0d32c3d624 100644
--- a/src/plugins/platforms/xcb/qxcbscreen.h
+++ b/src/plugins/platforms/xcb/qxcbscreen.h
@@ -172,7 +172,6 @@ public:
void readXResources();
QFontEngine::HintStyle hintStyle() const { return m_hintStyle; }
- bool noFontHinting() const { return m_noFontHinting; }
QFontEngine::SubpixelAntialiasingType subpixelType() const { return m_subpixelType; }
int antialiasingEnabled() const { return m_antialiasingEnabled; }
@@ -208,7 +207,6 @@ private:
int m_forcedDpi;
int m_pixelDensity;
QFontEngine::HintStyle m_hintStyle;
- bool m_noFontHinting;
QFontEngine::SubpixelAntialiasingType m_subpixelType;
int m_antialiasingEnabled;
};
diff --git a/src/plugins/platforms/xcb/xcb.pro b/src/plugins/platforms/xcb/xcb.pro
index 7840a4583f..0d27645a60 100644
--- a/src/plugins/platforms/xcb/xcb.pro
+++ b/src/plugins/platforms/xcb/xcb.pro
@@ -1,5 +1,6 @@
TEMPLATE = subdirs
CONFIG += ordered
+QT_FOR_CONFIG += gui-private
!qtConfig(system-xcb): SUBDIRS += xcb-static
diff --git a/src/plugins/platformthemes/platformthemes.pro b/src/plugins/platformthemes/platformthemes.pro
index 166b39ce8c..0e2812bed3 100644
--- a/src/plugins/platformthemes/platformthemes.pro
+++ b/src/plugins/platformthemes/platformthemes.pro
@@ -1,3 +1,4 @@
TEMPLATE = subdirs
+QT_FOR_CONFIG += widgets-private
-qtConfig(gtk3): SUBDIRS += gtk3
+qtHaveModule(widgets):qtConfig(gtk3): SUBDIRS += gtk3
diff --git a/src/plugins/plugins.pro b/src/plugins/plugins.pro
index 0f4207c636..941c25361f 100644
--- a/src/plugins/plugins.pro
+++ b/src/plugins/plugins.pro
@@ -1,14 +1,13 @@
TEMPLATE = subdirs
+QT_FOR_CONFIG += network
-load(qfeatures)
SUBDIRS *= sqldrivers
-qtHaveModule(network):!contains(QT_DISABLED_FEATURES, bearermanagement): SUBDIRS += bearer
+qtHaveModule(network):qtConfig(bearermanagement): SUBDIRS += bearer
qtHaveModule(gui) {
SUBDIRS *= platforms platforminputcontexts platformthemes
- !contains(QT_DISABLED_FEATURES, imageformatplugin): SUBDIRS *= imageformats
- !android:!contains(QT_DISABLED_FEATURES, library): SUBDIRS *= generic
+ qtConfig(imageformatplugin): SUBDIRS *= imageformats
+ !android:qtConfig(library): SUBDIRS *= generic
}
-!winrt:!wince*:qtHaveModule(widgets):!contains(QT_DISABLED_FEATURES, printer) {
+!winrt:!wince:qtHaveModule(printsupport): \
SUBDIRS += printsupport
-}
diff --git a/src/plugins/printsupport/printsupport.pro b/src/plugins/printsupport/printsupport.pro
index 55feaba40c..05cf1bc0b2 100644
--- a/src/plugins/printsupport/printsupport.pro
+++ b/src/plugins/printsupport/printsupport.pro
@@ -1,5 +1,5 @@
-QT += printsupport
TEMPLATE = subdirs
+QT_FOR_CONFIG += printsupport-private
osx: SUBDIRS += cocoa
win32: SUBDIRS += windows
diff --git a/src/plugins/sqldrivers/psql/qsql_psql.cpp b/src/plugins/sqldrivers/psql/qsql_psql.cpp
index fcf75af298..968b71a27d 100644
--- a/src/plugins/sqldrivers/psql/qsql_psql.cpp
+++ b/src/plugins/sqldrivers/psql/qsql_psql.cpp
@@ -704,10 +704,10 @@ void QPSQLDriverPrivate::detectBackslashEscape()
hasBackslashEscape = true;
} else {
hasBackslashEscape = false;
- PGresult* result = exec(QLatin1Literal("SELECT '\\\\' x"));
+ PGresult* result = exec(QLatin1String("SELECT '\\\\' x"));
int status = PQresultStatus(result);
if (status == PGRES_COMMAND_OK || status == PGRES_TUPLES_OK)
- if (QString::fromLatin1(PQgetvalue(result, 0, 0)) == QLatin1Literal("\\"))
+ if (QString::fromLatin1(PQgetvalue(result, 0, 0)) == QLatin1String("\\"))
hasBackslashEscape = true;
PQclear(result);
}
diff --git a/src/plugins/sqldrivers/sqldrivers.pro b/src/plugins/sqldrivers/sqldrivers.pro
index 37dbd2394e..30fb6019ce 100644
--- a/src/plugins/sqldrivers/sqldrivers.pro
+++ b/src/plugins/sqldrivers/sqldrivers.pro
@@ -1,11 +1,12 @@
TEMPLATE = subdirs
+QT_FOR_CONFIG += sql
-contains(sql-drivers, psql) : SUBDIRS += psql
-contains(sql-drivers, mysql) : SUBDIRS += mysql
-contains(sql-drivers, odbc) : SUBDIRS += odbc
-contains(sql-drivers, tds) : SUBDIRS += tds
-contains(sql-drivers, oci) : SUBDIRS += oci
-contains(sql-drivers, db2) : SUBDIRS += db2
-contains(sql-drivers, sqlite) : SUBDIRS += sqlite
-contains(sql-drivers, sqlite2) : SUBDIRS += sqlite2
-contains(sql-drivers, ibase) : SUBDIRS += ibase
+qtConfig(sql-psql) : SUBDIRS += psql
+qtConfig(sql-mysql) : SUBDIRS += mysql
+qtConfig(sql-odbc) : SUBDIRS += odbc
+qtConfig(sql-tds) : SUBDIRS += tds
+qtConfig(sql-oci) : SUBDIRS += oci
+qtConfig(sql-db2) : SUBDIRS += db2
+qtConfig(sql-sqlite) : SUBDIRS += sqlite
+qtConfig(sql-sqlite2) : SUBDIRS += sqlite2
+qtConfig(sql-ibase) : SUBDIRS += ibase
diff --git a/src/printsupport/configure.json b/src/printsupport/configure.json
new file mode 100644
index 0000000000..439f2dbdd8
--- /dev/null
+++ b/src/printsupport/configure.json
@@ -0,0 +1,72 @@
+{
+ "module": "printsupport",
+ "depends": [
+ "core",
+ "gui",
+ "widgets"
+ ],
+ "testDir": "../../config.tests",
+
+ "commandline": {
+ "options": {
+ "cups": "boolean"
+ }
+ },
+
+ "libraries": {
+ "cups": {
+ "label": "CUPS",
+ "test": "unix/cups",
+ "sources": [
+ "-lcups"
+ ]
+ }
+ },
+
+ "features": {
+ "cups": {
+ "label": "CUPS",
+ "purpose": "Provides support for the Common Unix Printing System.",
+ "section": "Painting",
+ "condition": "libs.cups",
+ "output": [ "privateFeature", "feature" ]
+ },
+ "printer": {
+ "label": "QPrinter",
+ "purpose": "Provides a printer backend of QPainter.",
+ "section": "Painting",
+ "condition": "!config.android && !config.uikit && !config.winrt && features.picture && features.temporaryfile && features.pdf",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "printpreviewwidget": {
+ "label": "QPrintPreviewWidget",
+ "purpose": "Provides a widget for previewing page layouts for printer output.",
+ "section": "Widgets",
+ "condition": "features.graphicsview && features.printer && features.mainwindow",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "printdialog": {
+ "label": "QPrintDialog",
+ "purpose": "Provides a dialog widget for specifying printer configuration.",
+ "section": "Dialogs",
+ "condition": "features.printer && features.combobox && features.buttongroup && features.spinbox && features.treeview && features.tabwidget",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "printpreviewdialog": {
+ "label": "QPrintPreviewDialog",
+ "purpose": "Provides a dialog for previewing and configuring page layouts for printer output.",
+ "section": "Dialogs",
+ "condition": "features.printpreviewwidget && features.printdialog && features.toolbar",
+ "output": [ "publicFeature", "feature" ]
+ }
+ },
+
+ "summary": [
+ {
+ "section": "Qt PrintSupport",
+ "entries": [
+ "cups"
+ ]
+ }
+ ]
+}
diff --git a/src/printsupport/dialogs/qprintdialog_unix.cpp b/src/printsupport/dialogs/qprintdialog_unix.cpp
index 9b08ffe4df..4d8299b115 100644
--- a/src/printsupport/dialogs/qprintdialog_unix.cpp
+++ b/src/printsupport/dialogs/qprintdialog_unix.cpp
@@ -38,6 +38,7 @@
****************************************************************************/
#include "qplatformdefs.h"
+#include <QtPrintSupport/qtprintsupportglobal.h>
#ifndef QT_NO_PRINTDIALOG
diff --git a/src/printsupport/dialogs/qprintdialog_win.cpp b/src/printsupport/dialogs/qprintdialog_win.cpp
index 93d09bc745..2e954a508d 100644
--- a/src/printsupport/dialogs/qprintdialog_win.cpp
+++ b/src/printsupport/dialogs/qprintdialog_win.cpp
@@ -37,6 +37,8 @@
**
****************************************************************************/
+#include <QtPrintSupport/qtprintsupportglobal.h>
+
#ifndef QT_NO_PRINTDIALOG
#include "qprintdialog.h"
diff --git a/src/printsupport/kernel/qpaintengine_alpha.cpp b/src/printsupport/kernel/qpaintengine_alpha.cpp
index 939322cc07..cae5c2f522 100644
--- a/src/printsupport/kernel/qpaintengine_alpha.cpp
+++ b/src/printsupport/kernel/qpaintengine_alpha.cpp
@@ -37,7 +37,7 @@
**
****************************************************************************/
-#include <qglobal.h>
+#include <qtprintsupportglobal.h>
#ifndef QT_NO_PRINTER
#include <qdebug.h>
diff --git a/src/printsupport/kernel/qplatformprintplugin.cpp b/src/printsupport/kernel/qplatformprintplugin.cpp
index b50f43056b..9bc4b61829 100644
--- a/src/printsupport/kernel/qplatformprintplugin.cpp
+++ b/src/printsupport/kernel/qplatformprintplugin.cpp
@@ -43,6 +43,8 @@
#include "private/qfactoryloader_p.h"
#include <qcoreapplication.h>
+#ifndef QT_NO_PRINTER
+
QT_BEGIN_NAMESPACE
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
@@ -86,3 +88,5 @@ QPlatformPrinterSupport *QPlatformPrinterSupportPlugin::get()
}
QT_END_NAMESPACE
+
+#endif
diff --git a/src/printsupport/kernel/qplatformprintplugin.h b/src/printsupport/kernel/qplatformprintplugin.h
index 3e909519c2..30e8f7938a 100644
--- a/src/printsupport/kernel/qplatformprintplugin.h
+++ b/src/printsupport/kernel/qplatformprintplugin.h
@@ -53,6 +53,8 @@
#include <QtCore/qplugin.h>
#include <QtCore/qfactoryinterface.h>
+#ifndef QT_NO_PRINTER
+
QT_BEGIN_NAMESPACE
@@ -74,4 +76,6 @@ public:
QT_END_NAMESPACE
+#endif
+
#endif // QPLATFORMPRINTPLUGIN_H
diff --git a/src/printsupport/kernel/qprintengine_win.cpp b/src/printsupport/kernel/qprintengine_win.cpp
index b0f85dc825..706a7c4b02 100644
--- a/src/printsupport/kernel/qprintengine_win.cpp
+++ b/src/printsupport/kernel/qprintengine_win.cpp
@@ -37,6 +37,8 @@
**
****************************************************************************/
+#include <QtPrintSupport/qtprintsupportglobal.h>
+
#ifndef QT_NO_PRINTER
#include "qprintengine_win_p.h"
@@ -924,14 +926,14 @@ void QWin32PrintEnginePrivate::initialize()
Q_ASSERT(hPrinter);
Q_ASSERT(pInfo);
+ initHDC();
+
if (devMode) {
num_copies = devMode->dmCopies;
devMode->dmCollate = DMCOLLATE_TRUE;
updatePageLayout();
}
- initHDC();
-
#if defined QT_DEBUG_DRAW || defined QT_DEBUG_METRICS
qDebug("QWin32PrintEngine::initialize()");
debugMetrics();
diff --git a/src/printsupport/kernel/qprintengine_win_p.h b/src/printsupport/kernel/qprintengine_win_p.h
index f2c6eeca4c..196263df74 100644
--- a/src/printsupport/kernel/qprintengine_win_p.h
+++ b/src/printsupport/kernel/qprintengine_win_p.h
@@ -130,10 +130,14 @@ public:
state(QPrinter::Idle),
resolution(0),
m_pageLayout(QPageLayout(QPageSize(QPageSize::A4), QPageLayout::Portrait, QMarginsF(0, 0, 0, 0))),
+ stretch_x(1), stretch_y(1), origin_x(0), origin_y(0),
+ dpi_x(96), dpi_y(96), dpi_display(96),
num_copies(1),
printToFile(false),
reinit(false),
- embed_fonts(true)
+ complex_xform(false), has_pen(false), has_brush(false), has_custom_paper_size(false),
+ embed_fonts(true),
+ txop(0 /* QTransform::TxNone */)
{
}
diff --git a/src/printsupport/kernel/qtprintsupportglobal.h b/src/printsupport/kernel/qtprintsupportglobal.h
index c060b98958..67779af5a2 100644
--- a/src/printsupport/kernel/qtprintsupportglobal.h
+++ b/src/printsupport/kernel/qtprintsupportglobal.h
@@ -41,6 +41,7 @@
#define QTPRINTSUPPORTGLOBAL_H
#include <QtWidgets/qtwidgetsglobal.h>
+#include <QtPrintSupport/qtprintsupport-config.h>
QT_BEGIN_NAMESPACE
diff --git a/src/sql/configure.json b/src/sql/configure.json
new file mode 100644
index 0000000000..d1dc198656
--- /dev/null
+++ b/src/sql/configure.json
@@ -0,0 +1,201 @@
+{
+ "module": "sql",
+ "depends": [
+ "core"
+ ],
+ "testDir": "../../config.tests",
+
+ "commandline": {
+ "assignments": {
+ "MYSQL_PATH": "mysql.prefix",
+ "PSQL_LIBS": "psql.libs",
+ "SYBASE": "tds.prefix",
+ "SYBASE_LIBS": "tds.libs"
+ },
+ "options": {
+ "mysql_config": "string",
+ "psql_config": "string",
+ "sqlite": { "type": "enum", "name": "system-sqlite", "values": { "qt": "no", "system": "yes" } },
+ "sql-db2": "boolean",
+ "sql-ibase": "boolean",
+ "sql-mysql": "boolean",
+ "sql-oci": "boolean",
+ "sql-odbc": "boolean",
+ "sql-psql": "boolean",
+ "sql-sqlite": "boolean",
+ "sql-sqlite2": "boolean",
+ "sql-tds": "boolean",
+ "plugin-sql-db2": { "type": "void", "name": "sql-db2" },
+ "plugin-sql-ibase": { "type": "void", "name": "sql-ibase" },
+ "plugin-sql-mysql": { "type": "void", "name": "sql-mysql" },
+ "plugin-sql-oci": { "type": "void", "name": "sql-oci" },
+ "plugin-sql-odbc": { "type": "void", "name": "sql-odbc" },
+ "plugin-sql-psql": { "type": "void", "name": "sql-psql" },
+ "plugin-sql-sqlite": { "type": "void", "name": "sql-sqlite" },
+ "plugin-sql-sqlite2": { "type": "void", "name": "sql-sqlite2" },
+ "plugin-sql-tds": { "type": "void", "name": "sql-tds" }
+ }
+ },
+
+ "libraries": {
+ "db2": {
+ "label": "DB2 (IBM)",
+ "test": "unix/db2",
+ "sources": [
+ { "libs": "-ldb2cli", "condition": "config.win32" },
+ { "libs": "-ldb2", "condition": "!config.win32" }
+ ]
+ },
+ "ibase": {
+ "label": "InterBase",
+ "test": "unix/ibase",
+ "sources": [
+ { "libs": "-lgds32_ms", "condition": "config.win32" },
+ { "libs": "-lgds", "condition": "!config.win32" }
+ ]
+ },
+ "mysql": {
+ "label": "MySQL",
+ "test": "unix/mysql",
+ "sources": [
+ { "type": "mysqlConfig", "query": "--libs_r" },
+ { "type": "mysqlConfig", "query": "--libs" },
+ { "libs": "-lmysqlclient_r", "condition": "!config.win32" },
+ { "libs": "-llibmysql", "condition": "config.win32" },
+ { "libs": "-lmysqlclient", "condition": "!config.win32" }
+ ]
+ },
+ "psql": {
+ "label": "PostgreSQL",
+ "test": "unix/psql",
+ "sources": [
+ { "type": "psqlConfig" },
+ { "type": "psqlEnv", "libs": "-llibpq -lws2_32 -ladvapi32", "condition": "config.win32" },
+ { "type": "psqlEnv", "libs": "-lpq", "condition": "!config.win32" }
+ ]
+ },
+ "tds": {
+ "label": "TDS (Sybase)",
+ "test": "unix/tds",
+ "sources": [
+ { "type": "sybaseEnv", "libs": "-lNTWDBLIB", "condition": "config.win32" },
+ { "type": "sybaseEnv", "libs": "-lsybdb", "condition": "!config.win32" }
+ ]
+ },
+ "oci": {
+ "label": "OCI (Oracle)",
+ "test": "unix/oci",
+ "sources": [
+ { "libs": "-loci", "condition": "config.win32" },
+ { "libs": "-lclntsh", "condition": "!config.win32" }
+ ]
+ },
+ "odbc": {
+ "label": "ODBC",
+ "test": "unix/odbc",
+ "sources": [
+ { "libs": "-lodbc32", "condition": "config.win32" },
+ { "libs": "-liodbc", "condition": "config.darwin" },
+ { "libs": "-lodbc", "condition": "!config.win32 && !config.darwin" }
+ ]
+ },
+ "sqlite2": {
+ "label": "SQLite (version 2)",
+ "test": "unix/sqlite2",
+ "sources": [
+ "-lsqlite"
+ ]
+ },
+ "sqlite3": {
+ "label": "SQLite (version 3)",
+ "export": "sqlite",
+ "test": "unix/sqlite",
+ "sources": [
+ { "type": "pkgConfig", "args": "sqlite3" },
+ { "libs": "-lsqlite3", "condition": "config.win32" },
+ { "libs": "-lsqlite3 -lz", "condition": "!config.win32" }
+ ]
+ }
+ },
+
+ "tests": {
+ },
+
+ "features": {
+ "sql-db2": {
+ "label": "DB2 (IBM)",
+ "condition": "libs.db2",
+ "output": [ "publicFeature" ]
+ },
+ "sql-ibase": {
+ "label": "InterBase",
+ "condition": "libs.ibase",
+ "output": [ "publicFeature" ]
+ },
+ "sql-mysql": {
+ "label": "MySql",
+ "condition": "libs.mysql",
+ "output": [ "publicFeature" ]
+ },
+ "use_libmysqlclient_r": {
+ "label": "MySql (threadsafe)",
+ "condition": "features.sql-mysql && (libs.mysql.source == 0 || libs.mysql.source == 2)",
+ "output": [ "privateConfig" ]
+ },
+ "sql-oci": {
+ "label": "OCI (Oracle)",
+ "condition": "libs.oci",
+ "output": [ "publicFeature" ]
+ },
+ "sql-odbc": {
+ "label": "ODBC",
+ "condition": "libs.odbc",
+ "output": [ "publicFeature" ]
+ },
+ "sql-psql": {
+ "label": "PostgreSQL",
+ "condition": "libs.psql",
+ "output": [ "publicFeature" ]
+ },
+ "sql-sqlite2": {
+ "label": "SQLite2",
+ "condition": "libs.sqlite2",
+ "output": [ "publicFeature" ]
+ },
+ "sql-sqlite": {
+ "label": "SQLite",
+ "output": [ "publicFeature" ]
+ },
+ "system-sqlite": {
+ "label": " Using system provided SQLite",
+ "autoDetect": false,
+ "condition": "features.sql-sqlite && libs.sqlite3",
+ "output": [ "publicQtConfig" ]
+ },
+ "sql-tds": {
+ "label": "TDS (Sybase)",
+ "condition": "libs.tds",
+ "output": [ "publicFeature" ]
+ }
+ },
+
+ "report": [
+ {
+ "type": "warning",
+ "condition": "config.win32 && !config.msvc && features.sql-oci",
+ "message": "Qt does not support compiling the Oracle database driver with
+MinGW, due to lack of such support from Oracle. Consider disabling the
+Oracle driver, as the current build will most likely fail."
+ }
+ ],
+
+ "summary": [
+ {
+ "section": "Qt Sql",
+ "entries": [
+ "sql-db2", "sql-ibase", "sql-mysql", "sql-oci", "sql-odbc", "sql-psql",
+ "sql-sqlite2", "sql-sqlite", "system-sqlite", "sql-tds"
+ ]
+ }
+ ]
+}
diff --git a/src/sql/configure.pri b/src/sql/configure.pri
new file mode 100644
index 0000000000..948808f4f7
--- /dev/null
+++ b/src/sql/configure.pri
@@ -0,0 +1,89 @@
+# custom tests
+
+defineReplace(filterLibraryPath) {
+ str = $${1}
+ for (l, QMAKE_DEFAULT_LIBDIRS): \
+ str -= "-L$$l"
+
+ return($$str)
+}
+
+defineTest(qtConfLibrary_psqlConfig) {
+ pg_config = $$config.input.psql_config
+ isEmpty(pg_config): \
+ pg_config = $$qtConfFindInPath("pg_config")
+ !win32:!isEmpty(pg_config) {
+ qtRunLoggedCommand("$$pg_config --libdir", libdir)|return(false)
+ qtRunLoggedCommand("$$pg_config --includedir", includedir)|return(false)
+ libdir -= $$QMAKE_DEFAULT_LIBDIRS
+ libs =
+ !isEmpty(libdir): libs += "-L$$libdir"
+ libs += "-lpq"
+ $${1}.libs = "$$val_escape(libs)"
+ includedir -= $$QMAKE_DEFAULT_INCDIRS
+ $${1}.includedir = "$$val_escape(includedir)"
+ !isEmpty(includedir): \
+ $${1}.cflags = "-I$$val_escape(includedir)"
+ export($${1}.libs)
+ export($${1}.includedir)
+ export($${1}.cflags)
+ return(true)
+ }
+ return(false)
+}
+
+defineTest(qtConfLibrary_psqlEnv) {
+ # Respect PSQL_LIBS if set
+ PSQL_LIBS = $$getenv(PSQL_LIBS)
+ !isEmpty(PSQL_LIBS) {
+ $${1}.libs = $$PSQL_LIBS
+ export($${1}.libs)
+ }
+ return(true)
+}
+
+defineTest(qtConfLibrary_mysqlConfig) {
+ mysql_config = $$config.input.mysql_config
+ isEmpty(mysql_config): \
+ mysql_config = $$qtConfFindInPath("mysql_config")
+ !isEmpty(mysql_config) {
+ qtRunLoggedCommand("$$mysql_config --version", version)|return(false)
+ version = $$split(version, '.')
+ version = $$first(version)
+ isEmpty(version)|lessThan(version, 4): return(false)]
+
+ # query is either --libs or --libs_r
+ query = $$eval($${1}.query)
+ qtRunLoggedCommand("$$mysql_config $$query", libs)|return(false)
+ qtRunLoggedCommand("$$mysql_config --include", includedir)|return(false)
+ eval(libs = $$libs)
+ libs = $$filterLibraryPath($$libs)
+ # -rdynamic should not be returned by mysql_config, but is on RHEL 6.6
+ libs -= -rdynamic
+ $${1}.libs = "$$val_escape(libs)"
+ eval(includedir = $$includedir)
+ includedir ~= s/^-I//g
+ includedir -= $$QMAKE_DEFAULT_INCDIRS
+ $${1}.includedir = "$$val_escape(includedir)"
+ !isEmpty(includedir): \
+ $${1}.cflags = "-I$$val_escape(includedir)"
+ export($${1}.libs)
+ export($${1}.includedir)
+ export($${1}.cflags)
+ return(true)
+ }
+ return(false)
+}
+
+defineTest(qtConfLibrary_sybaseEnv) {
+ libs =
+ sybase = $$getenv(SYBASE)
+ !isEmpty(sybase): \
+ libs += "-L$${sybase}/lib"
+ libs += $$getenv(SYBASE_LIBS)
+ !isEmpty(libs) {
+ $${1}.libs = "$$val_escape(libs)"
+ export($${1}.libs)
+ }
+ return(true)
+}
diff --git a/src/src.pro b/src/src.pro
index ec656e483c..541053eba5 100644
--- a/src/src.pro
+++ b/src/src.pro
@@ -1,48 +1,44 @@
TEMPLATE = subdirs
+QT_FOR_CONFIG += gui-private
+include($$OUT_PWD/corelib/qtcore-config.pri)
+include($$OUT_PWD/gui/qtgui-config.pri)
+
src_qtzlib.file = $$PWD/corelib/qtzlib.pro
src_qtzlib.target = sub-zlib
src_tools_bootstrap.subdir = tools/bootstrap
src_tools_bootstrap.target = sub-bootstrap
-src_tools_bootstrap.CONFIG = host_build
src_tools_moc.subdir = tools/moc
src_tools_moc.target = sub-moc
src_tools_moc.depends = src_tools_bootstrap
-src_tools_moc.CONFIG = host_build
src_tools_rcc.subdir = tools/rcc
src_tools_rcc.target = sub-rcc
src_tools_rcc.depends = src_tools_bootstrap
-src_tools_rcc.CONFIG = host_build
src_tools_qlalr.subdir = tools/qlalr
src_tools_qlalr.target = sub-qlalr
-src_tools_qlalr.CONFIG = host_build
force_bootstrap: src_tools_qlalr.depends = src_tools_bootstrap
else: src_tools_qlalr.depends = src_corelib
src_tools_uic.subdir = tools/uic
src_tools_uic.target = sub-uic
-src_tools_uic.CONFIG = host_build
force_bootstrap: src_tools_uic.depends = src_tools_bootstrap
else: src_tools_uic.depends = src_corelib
src_tools_bootstrap_dbus.subdir = tools/bootstrap-dbus
src_tools_bootstrap_dbus.target = sub-bootstrap_dbus
src_tools_bootstrap_dbus.depends = src_tools_bootstrap
-src_tools_bootstrap_dbus.CONFIG = host_build
src_tools_qdbusxml2cpp.subdir = tools/qdbusxml2cpp
src_tools_qdbusxml2cpp.target = sub-qdbusxml2cpp
-src_tools_qdbusxml2cpp.CONFIG = host_build
force_bootstrap: src_tools_qdbusxml2cpp.depends = src_tools_bootstrap_dbus
else: src_tools_qdbusxml2cpp.depends = src_dbus
src_tools_qdbuscpp2xml.subdir = tools/qdbuscpp2xml
src_tools_qdbuscpp2xml.target = sub-qdbuscpp2xml
-src_tools_qdbuscpp2xml.CONFIG = host_build
force_bootstrap: src_tools_qdbuscpp2xml.depends = src_tools_bootstrap_dbus
else: src_tools_qdbuscpp2xml.depends = src_dbus
@@ -138,7 +134,7 @@ src_android.subdir = $$PWD/android
}
}
SUBDIRS += src_tools_bootstrap src_tools_moc src_tools_rcc
-!contains(QT_DISABLED_FEATURES, regularexpression):pcre {
+qtConfig(regularexpression):pcre {
SUBDIRS += src_3rdparty_pcre
src_corelib.depends += src_3rdparty_pcre
}
diff --git a/src/testlib/qteamcitylogger.cpp b/src/testlib/qteamcitylogger.cpp
index 4773ea937f..1d700d8201 100644
--- a/src/testlib/qteamcitylogger.cpp
+++ b/src/testlib/qteamcitylogger.cpp
@@ -228,22 +228,22 @@ QString QTeamCityLogger::tcEscapedString(const QString &str) const
switch (ch.toLatin1()) {
case '\n':
- formattedString.append(QLatin1Literal("|n"));
+ formattedString.append(QLatin1String("|n"));
break;
case '\r':
- formattedString.append(QLatin1Literal("|r"));
+ formattedString.append(QLatin1String("|r"));
break;
case '|':
- formattedString.append(QLatin1Literal("||"));
+ formattedString.append(QLatin1String("||"));
break;
case '[':
- formattedString.append(QLatin1Literal("|["));
+ formattedString.append(QLatin1String("|["));
break;
case ']':
- formattedString.append(QLatin1Literal("|]"));
+ formattedString.append(QLatin1String("|]"));
break;
case '\'':
- formattedString.append(QLatin1Literal("|'"));
+ formattedString.append(QLatin1String("|'"));
break;
default:
formattedString.append(ch);
diff --git a/src/testlib/qtestblacklist.cpp b/src/testlib/qtestblacklist.cpp
index 3fec0ad98a..587930ca73 100644
--- a/src/testlib/qtestblacklist.cpp
+++ b/src/testlib/qtestblacklist.cpp
@@ -97,7 +97,7 @@ static QSet<QByteArray> keywords()
#ifdef Q_OS_OSX
<< "osx"
#endif
-#ifdef Q_OS_WIN
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
<< "windows"
#endif
#ifdef Q_OS_IOS
diff --git a/src/testlib/qtestcase.h b/src/testlib/qtestcase.h
index 09da575bc9..106fa7abd5 100644
--- a/src/testlib/qtestcase.h
+++ b/src/testlib/qtestcase.h
@@ -52,11 +52,11 @@
#include <string.h>
+#include <type_traits>
#ifndef QT_NO_EXCEPTIONS
# include <exception>
#endif // QT_NO_EXCEPTIONS
-
QT_BEGIN_NAMESPACE
class QRegularExpression;
@@ -204,11 +204,11 @@ do {\
return;\
} while (0)
-#define QFETCH(type, name)\
- type name = *static_cast<type *>(QTest::qData(#name, ::qMetaTypeId<type >()))
+#define QFETCH(Type, name)\
+ Type name = *static_cast<Type *>(QTest::qData(#name, ::qMetaTypeId<typename std::remove_cv<Type >::type>()))
-#define QFETCH_GLOBAL(type, name)\
- type name = *static_cast<type *>(QTest::qGlobalData(#name, ::qMetaTypeId<type >()))
+#define QFETCH_GLOBAL(Type, name)\
+ Type name = *static_cast<Type *>(QTest::qGlobalData(#name, ::qMetaTypeId<typename std::remove_cv<Type >::type>()))
#define QTEST(actual, testElement)\
do {\
diff --git a/src/tools/moc/moc.cpp b/src/tools/moc/moc.cpp
index 22207a9030..e4b9b19758 100644
--- a/src/tools/moc/moc.cpp
+++ b/src/tools/moc/moc.cpp
@@ -560,7 +560,8 @@ void Moc::parse()
until(RBRACE);
def.end = index;
index = def.begin + 1;
- while (inNamespace(&def) && hasNext()) {
+ const bool parseNamespace = currentFilenames.size() <= 1;
+ while (parseNamespace && inNamespace(&def) && hasNext()) {
switch (next()) {
case Q_NAMESPACE_TOKEN:
def.hasQNamespace = true;
@@ -569,10 +570,16 @@ void Moc::parse()
case Q_ENUM_NS_TOKEN:
parseEnumOrFlag(&def, false);
break;
+ case Q_ENUM_TOKEN:
+ error("Q_ENUM can't be used in a Q_NAMESPACE, use Q_ENUM_NS instead");
+ break;
case Q_FLAGS_TOKEN:
case Q_FLAG_NS_TOKEN:
parseEnumOrFlag(&def, true);
break;
+ case Q_FLAG_TOKEN:
+ error("Q_FLAG can't be used in a Q_NAMESPACE, use Q_FLAG_NS instead");
+ break;
case Q_DECLARE_FLAGS_TOKEN:
parseFlag(&def);
break;
@@ -735,10 +742,16 @@ void Moc::parse()
case Q_ENUM_TOKEN:
parseEnumOrFlag(&def, false);
break;
+ case Q_ENUM_NS_TOKEN:
+ error("Q_ENUM_NS can't be used in a Q_OBJECT/Q_GADGET, use Q_ENUM instead");
+ break;
case Q_FLAGS_TOKEN:
case Q_FLAG_TOKEN:
parseEnumOrFlag(&def, true);
break;
+ case Q_FLAG_NS_TOKEN:
+ error("Q_FLAG_NS can't be used in a Q_OBJECT/Q_GADGET, use Q_FLAG instead");
+ break;
case Q_DECLARE_FLAGS_TOKEN:
parseFlag(&def);
break;
diff --git a/src/tools/rcc/rcc.cpp b/src/tools/rcc/rcc.cpp
index 3156df3f30..18772d2816 100644
--- a/src/tools/rcc/rcc.cpp
+++ b/src/tools/rcc/rcc.cpp
@@ -705,9 +705,7 @@ static void resourceDataFileMapRecursion(const RCCFileInfo *m_root, const QStrin
const ChildConstIterator cend = m_root->m_children.constEnd();
for (ChildConstIterator it = m_root->m_children.constBegin(); it != cend; ++it) {
const RCCFileInfo *child = it.value();
- QString childName = path;
- childName += slash;
- childName += child->m_name;
+ const QString childName = path + slash + child->m_name;
if (child->m_flags & RCCFileInfo::Directory) {
resourceDataFileMapRecursion(child, childName, m);
} else {
diff --git a/src/tools/uic/cpp/cppwriteinitialization.cpp b/src/tools/uic/cpp/cppwriteinitialization.cpp
index df55ca29f1..d69eeebc5c 100644
--- a/src/tools/uic/cpp/cppwriteinitialization.cpp
+++ b/src/tools/uic/cpp/cppwriteinitialization.cpp
@@ -2307,7 +2307,7 @@ QString WriteInitialization::trCall(const QString &str, const QString &commentHi
return QLatin1String("QString()");
QString result;
- const QString comment = commentHint.isEmpty() ? QString(QLatin1Char('0')) : fixString(commentHint, m_dindent);
+ const QString comment = commentHint.isEmpty() ? QString(QLatin1String("Q_NULLPTR")) : fixString(commentHint, m_dindent);
if (m_option.translateFunction.isEmpty()) {
if (m_option.idBased) {
diff --git a/src/widgets/configure.json b/src/widgets/configure.json
new file mode 100644
index 0000000000..c1931d9d80
--- /dev/null
+++ b/src/widgets/configure.json
@@ -0,0 +1,567 @@
+{
+ "module": "widgets",
+ "depends": [
+ "core-private",
+ "gui"
+ ],
+ "testDir": "../../config.tests",
+
+ "commandline": {
+ "options": {
+ "android-style-assets": "boolean",
+ "gtk": { "type": "boolean", "name": "gtk3" },
+ "style-windows": "boolean",
+ "style-windowsxp": "boolean",
+ "style-windowsvista": "boolean",
+ "style-fusion": "boolean",
+ "style-mac": "boolean",
+ "style-android": "boolean"
+ }
+ },
+
+ "libraries": {
+ "gtk3": {
+ "label": "GTK+",
+ "sources": [
+ { "type": "pkgConfig", "args": "gtk+-3.0" }
+ ]
+ }
+ },
+
+ "tests": {
+ "uxtheme": {
+ "label": "uxtheme.h",
+ "type": "files",
+ "files": [ "uxtheme.h" ]
+ }
+ },
+
+ "features": {
+ "gtk3": {
+ "label": "GTK+",
+ "autoDetect": "!config.darwin",
+ "condition": "features.glib && libs.gtk3",
+ "output": [ "privateFeature" ]
+ },
+ "style-fusion": {
+ "label": "Fusion",
+ "output": [ "styles" ]
+ },
+ "style-mac": {
+ "label": "macOS",
+ "condition": "config.osx",
+ "output": [ "styles" ]
+ },
+ "style-windows": {
+ "label": "Windows",
+ "output": [ "styles" ]
+ },
+ "style-windowsxp": {
+ "label": "WindowsXP",
+ "condition": "features.style-windows && config.win32 && !config.winrt && tests.uxtheme",
+ "output": [ "styles" ]
+ },
+ "style-windowsvista": {
+ "label": "WindowsVista",
+ "condition": "features.style-windowsxp",
+ "output": [ "styles" ]
+ },
+ "style-android": {
+ "label": "Android",
+ "autoDetect": "config.android",
+ "output": [ "styles" ]
+ },
+ "style-stylesheet": {
+ "label": "QStyleSheetStyle",
+ "purpose": "Provides a widget style which is configurable via CSS.",
+ "section": "Styles",
+ "condition": "features.style-windows && features.properties && features.cssparser",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "android-style-assets": {
+ "label": "Android Style Assets",
+ "condition": "features.style-android",
+ "output": [ "privateConfig" ]
+ },
+ "effects": {
+ "label": "Effects",
+ "purpose": "Provides special widget effects (e.g. fading and scrolling).",
+ "section": "Kernel"
+ },
+ "filesystemmodel": {
+ "label": "QFileSystemModel",
+ "purpose": "Provides a data model for the local filesystem.",
+ "section": "File I/O",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "itemviews": {
+ "label": "The Model/View Framework",
+ "purpose": "Provides the model/view architecture managing the relationship between data and the way it is presented to the user.",
+ "section": "ItemViews",
+ "condition": "features.itemmodel && features.rubberband && features.scrollarea",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "treewidget": {
+ "label": "QTreeWidget",
+ "purpose": "Provides views using tree models.",
+ "section": "Widgets",
+ "condition": "features.treeview",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "listwidget": {
+ "label": "QListWidget",
+ "purpose": "Provides item-based list widgets.",
+ "section": "Widgets",
+ "condition": "features.listview",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "tablewidget": {
+ "label": "QTableWidget",
+ "purpose": "Provides item-based table views.",
+ "section": "Widgets",
+ "condition": "features.tableview",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "datetimeedit": {
+ "label": "QDateTimeEdit",
+ "purpose": "Supports editing dates and times.",
+ "section": "Widgets",
+ "condition": "features.calendarwidget && features.datestring",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "stackedwidget": {
+ "label": "QStackedWidget",
+ "purpose": "Provides stacked widgets.",
+ "section": "Widgets",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "textbrowser": {
+ "label": "QTextBrowser",
+ "purpose": "Supports HTML document browsing.",
+ "section": "Widgets",
+ "condition": "features.textedit",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "splashscreen": {
+ "label": "QSplashScreen",
+ "purpose": "Supports splash screens that can be shown during application startup.",
+ "section": "Widgets",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "splitter": {
+ "label": "QSplitter",
+ "purpose": "Provides user controlled splitter widgets.",
+ "section": "Widgets",
+ "condition": "features.rubberband",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "lcdnumber": {
+ "label": "QLCDNumber",
+ "purpose": "Provides LCD-like digits.",
+ "section": "Widgets",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "menu": {
+ "label": "QMenu",
+ "purpose": "Provides popup-menus.",
+ "section": "Widgets",
+ "condition": "features.action",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "lineedit": {
+ "label": "QLineEdit",
+ "purpose": "Provides single-line edits.",
+ "section": "Widgets",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "spinbox": {
+ "label": "QSpinBox",
+ "purpose": "Provides spin boxes handling integers and discrete sets of values.",
+ "section": "Widgets",
+ "condition": "features.spinwidget && features.lineedit && features.validator",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "tabbar": {
+ "label": "QTabBar",
+ "purpose": "Provides tab bars, e.g., for use in tabbed dialogs.",
+ "section": "Widgets",
+ "condition": "features.toolbutton",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "tabwidget": {
+ "label": "QTabWidget",
+ "purpose": "Supports stacking tabbed widgets.",
+ "section": "Widgets",
+ "condition": "features.tabbar && features.stackedwidget",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "combobox": {
+ "label": "QComboBox",
+ "purpose": "Provides drop-down boxes presenting a list of options to the user.",
+ "section": "Widgets",
+ "condition": "features.lineedit && features.standarditemmodel && features.listview",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "fontcombobox": {
+ "label": "QFontComboBox",
+ "purpose": "Provides a combobox that lets the user select a font family.",
+ "section": "Widgets",
+ "condition": "features.combobox && features.stringlistmodel",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "toolbutton": {
+ "label": "QToolButton",
+ "purpose": "Provides quick-access buttons to commands and options.",
+ "section": "Widgets",
+ "condition": "features.action",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "toolbar": {
+ "label": "QToolBar",
+ "purpose": "Provides movable panels containing a set of controls.",
+ "section": "Widgets",
+ "condition": "features.mainwindow",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "toolbox": {
+ "label": "QToolBox",
+ "purpose": "Provides columns of tabbed widget items.",
+ "section": "Widgets",
+ "condition": "features.toolbutton && features.scrollarea",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "groupbox": {
+ "label": "QGroupBox",
+ "purpose": "Provides widget grouping boxes with frames.",
+ "section": "Widgets",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "buttongroup": {
+ "label": "QButtonGroup",
+ "purpose": "Supports organizing groups of button widgets.",
+ "section": "Widgets",
+ "condition": "features.groupbox",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "mainwindow": {
+ "label": "QMainWindow",
+ "purpose": "Provides main application windows.",
+ "section": "Widgets",
+ "condition": "features.menu && features.resizehandler && features.toolbutton",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "dockwidget": {
+ "label": "QDockwidget",
+ "purpose": "Supports docking widgets inside a QMainWindow or floated as a top-level window on the desktop.",
+ "section": "Widgets",
+ "condition": "features.rubberband && features.mainwindow",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "mdiarea": {
+ "label": "QMdiArea",
+ "purpose": "Provides an area in which MDI windows are displayed.",
+ "section": "Widgets",
+ "condition": "features.scrollarea",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "resizehandler": {
+ "label": "QWidgetResizeHandler",
+ "purpose": "Provides an internal resize handler for dock widgets.",
+ "section": "Widgets",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "statusbar": {
+ "label": "QStatusBar",
+ "purpose": "Supports presentation of status information.",
+ "section": "Widgets",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "menubar": {
+ "label": "QMenuBar",
+ "purpose": "Provides pull-down menu items.",
+ "section": "Widgets",
+ "condition": "features.menu && features.toolbutton",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "contextmenu": {
+ "label": "Context menus",
+ "purpose": "Adds pop-up menus on right mouse click to numerous widgets.",
+ "section": "Widgets",
+ "condition": "features.menu",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "progressbar": {
+ "label": "QProgressBar",
+ "purpose": "Supports presentation of operation progress.",
+ "section": "Widgets",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "slider": {
+ "label": "QSlider",
+ "purpose": "Provides sliders controlling a bounded value.",
+ "section": "Widgets",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "scrollbar": {
+ "label": "QScrollBar",
+ "purpose": "Provides scrollbars allowing the user access parts of a document that is larger than the widget used to display it.",
+ "section": "Widgets",
+ "condition": "features.slider",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "dial": {
+ "label": "QDial",
+ "purpose": "Provides a rounded range control, e.g., like a speedometer.",
+ "section": "Widgets",
+ "condition": "features.slider",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "scrollarea": {
+ "label": "QScrollArea",
+ "purpose": "Supports scrolling views onto widgets.",
+ "section": "Widgets",
+ "condition": "features.scrollbar",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "graphicsview": {
+ "label": "QGraphicsView",
+ "purpose": "Provides a canvas/sprite framework.",
+ "section": "Widgets",
+ "condition": "features.scrollarea",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "graphicseffect": {
+ "label": "QGraphicsEffect",
+ "purpose": "Provides various graphics effects.",
+ "section": "Widgets",
+ "condition": "features.graphicsview",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "spinbox": {
+ "label": "QSpinBox",
+ "purpose": "Provides spinbox control widgets.",
+ "section": "Widgets",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "textedit": {
+ "label": "QTextEdit",
+ "purpose": "Supports rich text editing.",
+ "section": "Widgets",
+ "condition": "features.scrollarea && features.properties",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "syntaxhighlighter": {
+ "label": "QSyntaxHighlighter",
+ "purpose": "Supports custom syntax highlighting.",
+ "section": "Widgets",
+ "condition": "features.textedit",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "rubberband": {
+ "label": "QRubberBand",
+ "purpose": "Supports using rubberbands to indicate selections and boundaries.",
+ "section": "Widgets",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "tooltip": {
+ "label": "QToolTip",
+ "purpose": "Supports presentation of tooltips.",
+ "section": "Widgets",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "statustip": {
+ "label": "Status Tip",
+ "purpose": "Supports status tip functionality and events.",
+ "section": "Widgets",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "whatsthis": {
+ "label": "QWhatsThis",
+ "purpose": "Supports displaying \"What's this\" help.",
+ "section": "Widgets",
+ "condition": "features.toolbutton",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "sizegrip": {
+ "label": "QSizeGrip",
+ "purpose": "Provides corner-grips for resizing top-level windows.",
+ "section": "Widgets",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "calendarwidget": {
+ "label": "QCalendarWidget",
+ "purpose": "Provides a monthly based calendar widget allowing the user to select a date.",
+ "section": "Widgets",
+ "condition": "features.tableview && features.menu && features.textdate && features.spinbox && features.toolbutton",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "keysequenceedit": {
+ "label": "QKeySequenceEdit",
+ "purpose": "Provides a widget for editing QKeySequences.",
+ "section": "Widgets",
+ "condition": "features.lineedit && features.shortcut",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "messagebox": {
+ "label": "QMessageBox",
+ "purpose": "Provides message boxes displaying informative messages and simple questions.",
+ "section": "Dialogs",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "colordialog": {
+ "label": "QColorDialog",
+ "purpose": "Provides a dialog widget for specifying colors.",
+ "section": "Dialogs",
+ "condition": "features.spinbox",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "filedialog": {
+ "label": "QFileDialog",
+ "purpose": "Provides a dialog widget for selecting files or directories.",
+ "section": "Dialogs",
+ "condition": "features.dirmodel && features.treeview && features.combobox && features.toolbutton && features.buttongroup && features.tooltip && features.splitter && features.stackedwidget && features.proxymodel",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "fontdialog": {
+ "label": "QFontDialog",
+ "purpose": "Provides a dialog widget for selecting fonts.",
+ "section": "Dialogs",
+ "condition": "features.stringlistmodel && features.combobox && features.validator && features.groupbox",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "progressdialog": {
+ "label": "QProgressDialog",
+ "purpose": "Provides feedback on the progress of a slow operation.",
+ "section": "Dialogs",
+ "condition": "features.progressbar",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "inputdialog": {
+ "label": "QInputDialog",
+ "purpose": "Provides a simple convenience dialog to get a single value from the user.",
+ "section": "Dialogs",
+ "condition": "features.combobox && features.spinbox && features.stackedwidget",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "errormessage": {
+ "label": "QErrorMessage",
+ "purpose": "Provides an error message display dialog.",
+ "section": "Dialogs",
+ "condition": "features.textedit",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "wizard": {
+ "label": "QWizard",
+ "purpose": "Provides a framework for multi-page click-through dialogs.",
+ "section": "Dialogs",
+ "condition": "features.properties",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "dirmodel": {
+ "label": "QDirModel",
+ "purpose": "Provides a data model for the local filesystem.",
+ "section": "ItemViews",
+ "condition": "features.itemviews && features.filesystemmodel",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "listview": {
+ "label": "QListView",
+ "purpose": "Provides a list or icon view onto a model.",
+ "section": "ItemViews",
+ "condition": "features.itemviews",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "tableview": {
+ "label": "QTableView",
+ "purpose": "Provides a default model/view implementation of a table view.",
+ "section": "ItemViews",
+ "condition": "features.itemviews",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "treeview": {
+ "label": "QTreeView",
+ "purpose": "Provides a default model/view implementation of a tree view.",
+ "section": "ItemViews",
+ "condition": "features.itemviews",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "datawidgetmapper": {
+ "label": "QDataWidgetMapper",
+ "purpose": "Provides mapping between a section of a data model to widgets.",
+ "section": "ItemViews",
+ "condition": "features.itemviews && features.properties",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "columnview": {
+ "label": "QColumnView",
+ "purpose": "Provides a model/view implementation of a column view.",
+ "section": "ItemViews",
+ "condition": "features.listview",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "paint_debug": {
+ "label": "Painting Debug Utilities",
+ "purpose": "Enabled debugging painting with the environment variables QT_FLUSH_UPDATE and QT_FLUSH_PAINT.",
+ "section": "Painting",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "completer": {
+ "label": "QCompleter",
+ "purpose": "Provides completions based on an item model.",
+ "section": "Utilities",
+ "condition": "features.proxymodel",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "fscompleter": {
+ "label": "QFSCompleter",
+ "purpose": "Provides file name completion in QFileDialog.",
+ "section": "Utilities",
+ "condition": "features.filesystemmodel && features.completer",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "undocommand": {
+ "label": "QUndoCommand",
+ "purpose": "Applies (redo or) undo of a single change in a document.",
+ "section": "Utilities",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "undostack": {
+ "label": "QUndoStack",
+ "purpose": "Provides the ability to (redo or) undo a list of changes in a document.",
+ "section": "Utilities",
+ "condition": "features.undocommand",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "undogroup": {
+ "label": "QUndoGroup",
+ "purpose": "Provides the ability to cluster QUndoCommands.",
+ "section": "Utilities",
+ "condition": "features.undostack",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "undoview": {
+ "label": "QUndoView",
+ "purpose": "Provides a widget which shows the contents of an undo stack.",
+ "section": "Utilities",
+ "condition": "features.undostack && features.listview",
+ "output": [ "publicFeature", "feature" ]
+ }
+ },
+
+ "report": [
+ ],
+
+ "summary": [
+ {
+ "section": "Qt Widgets",
+ "entries": [
+ "gtk3",
+ {
+ "message": "Styles",
+ "type": "featureList",
+ "args": "style-fusion style-mac style-windows style-windowsxp style-windowsvista style-android"
+ }
+ ]
+ }
+ ]
+}
diff --git a/src/widgets/configure.pri b/src/widgets/configure.pri
new file mode 100644
index 0000000000..ddb3657700
--- /dev/null
+++ b/src/widgets/configure.pri
@@ -0,0 +1,8 @@
+# custom outputs
+
+defineTest(qtConfOutput_styles) {
+ !$${2}: return()
+
+ style = $$replace($${1}.feature, "style-", "")
+ qtConfOutputVar(append, "privatePro", "styles", $$style)
+}
diff --git a/src/widgets/kernel/qtwidgetsglobal.h b/src/widgets/kernel/qtwidgetsglobal.h
index f6d003e629..1c74f37618 100644
--- a/src/widgets/kernel/qtwidgetsglobal.h
+++ b/src/widgets/kernel/qtwidgetsglobal.h
@@ -41,6 +41,7 @@
#define QTWIDGETSGLOBAL_H
#include <QtGui/qtguiglobal.h>
+#include <QtWidgets/qtwidgets-config.h>
QT_BEGIN_NAMESPACE
diff --git a/src/widgets/kernel/qtwidgetsglobal_p.h b/src/widgets/kernel/qtwidgetsglobal_p.h
index 7dd545415c..22ba876022 100644
--- a/src/widgets/kernel/qtwidgetsglobal_p.h
+++ b/src/widgets/kernel/qtwidgetsglobal_p.h
@@ -53,5 +53,6 @@
#include <QtWidgets/qtwidgetsglobal.h>
#include <QtGui/private/qtguiglobal_p.h>
+#include <QtWidgets/private/qtwidgets-config_p.h>
#endif // QTWIDGETSGLOBAL_P_H
diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp
index 690524b64b..b214dae154 100644
--- a/src/widgets/styles/qstylesheetstyle.cpp
+++ b/src/widgets/styles/qstylesheetstyle.cpp
@@ -3818,6 +3818,13 @@ void QStyleSheetStyle::drawControl(ControlElement ce, const QStyleOption *opt, Q
ParentStyle::drawControl(ce, opt, p, w);
return;
}
+ if (subRule.hasFont) {
+ const QFont oldFont = p->font();
+ p->setFont(subRule.font.resolve(p->font()));
+ baseStyle()->drawControl(ce, opt, p, w);
+ p->setFont(oldFont);
+ return;
+ }
}
break;
case CE_HeaderSection:
@@ -4931,13 +4938,14 @@ QSize QStyleSheetStyle::sizeFromContents(ContentsType ct, const QStyleOption *op
case CT_HeaderSection: {
if (const QStyleOptionHeader *hdr = qstyleoption_cast<const QStyleOptionHeader *>(opt)) {
QRenderRule subRule = renderRule(w, opt, PseudoElement_HeaderViewSection);
- if (subRule.hasGeometry() || subRule.hasBox() || !subRule.hasNativeBorder()) {
+ if (subRule.hasGeometry() || subRule.hasBox() || !subRule.hasNativeBorder() || subRule.hasFont) {
sz = subRule.adjustSize(csz);
if (!subRule.hasGeometry()) {
QSize nativeContentsSize;
bool nullIcon = hdr->icon.isNull();
int iconSize = nullIcon ? 0 : pixelMetric(QStyle::PM_SmallIconSize, hdr, w);
- QSize txt = hdr->fontMetrics.size(0, hdr->text);
+ const QSize txt = subRule.hasFont ? QFontMetrics(subRule.font).size(0, hdr->text)
+ : hdr->fontMetrics.size(0, hdr->text);
nativeContentsSize.setHeight(qMax(iconSize, txt.height()));
nativeContentsSize.setWidth(iconSize + txt.width());
sz = sz.expandedTo(nativeContentsSize);
diff --git a/src/widgets/styles/styles.pri b/src/widgets/styles/styles.pri
index 7b9497172c..69e13fb6ec 100644
--- a/src/widgets/styles/styles.pri
+++ b/src/widgets/styles/styles.pri
@@ -35,6 +35,8 @@ SOURCES += \
RESOURCES += styles/qstyle.qrc
+include($$OUT_PWD/qtwidgets-config.pri)
+
contains( styles, mac ) {
HEADERS += \
styles/qmacstyle_mac_p.h \
diff --git a/src/widgets/widgets/qdockarealayout.cpp b/src/widgets/widgets/qdockarealayout.cpp
index b347e93807..a7e865ff05 100644
--- a/src/widgets/widgets/qdockarealayout.cpp
+++ b/src/widgets/widgets/qdockarealayout.cpp
@@ -2617,6 +2617,21 @@ void QDockAreaLayout::remove(const QList<int> &path)
docks[index].remove(path.mid(1));
}
+void QDockAreaLayout::removePlaceHolder(const QString &name)
+{
+ QList<int> index = indexOfPlaceHolder(name);
+ if (!index.isEmpty())
+ remove(index);
+ foreach (QDockWidgetGroupWindow *dwgw, mainWindow->findChildren<QDockWidgetGroupWindow *>(
+ QString(), Qt::FindDirectChildrenOnly)) {
+ index = dwgw->layoutInfo()->indexOfPlaceHolder(name);
+ if (!index.isEmpty()) {
+ dwgw->layoutInfo()->remove(index);
+ dwgw->destroyOrHideIfEmpty();
+ }
+ }
+}
+
static inline int qMax(int i1, int i2, int i3) { return qMax(i1, qMax(i2, i3)); }
void QDockAreaLayout::getGrid(QVector<QLayoutStruct> *_ver_struct_list,
@@ -3043,15 +3058,27 @@ QRect QDockAreaLayout::constrainedRect(QRect rect, QWidget* widget)
bool QDockAreaLayout::restoreDockWidget(QDockWidget *dockWidget)
{
- QList<int> index = indexOfPlaceHolder(dockWidget->objectName());
- if (index.isEmpty())
- return false;
+ QDockAreaLayoutItem *item = 0;
+ foreach (QDockWidgetGroupWindow *dwgw, mainWindow->findChildren<QDockWidgetGroupWindow *>(
+ QString(), Qt::FindDirectChildrenOnly)) {
+ QList<int> index = dwgw->layoutInfo()->indexOfPlaceHolder(dockWidget->objectName());
+ if (!index.isEmpty()) {
+ dockWidget->setParent(dwgw);
+ item = const_cast<QDockAreaLayoutItem *>(&dwgw->layoutInfo()->item(index));
+ break;
+ }
+ }
+ if (!item) {
+ QList<int> index = indexOfPlaceHolder(dockWidget->objectName());
+ if (index.isEmpty())
+ return false;
+ item = const_cast<QDockAreaLayoutItem *>(&this->item(index));
+ }
- QDockAreaLayoutItem &item = this->item(index);
- QPlaceHolderItem *placeHolder = item.placeHolderItem;
+ QPlaceHolderItem *placeHolder = item->placeHolderItem;
Q_ASSERT(placeHolder != 0);
- item.widgetItem = new QDockWidgetItem(dockWidget);
+ item->widgetItem = new QDockWidgetItem(dockWidget);
if (placeHolder->window) {
const QRect r = constrainedRect(placeHolder->topLevelRect, dockWidget);
@@ -3063,7 +3090,7 @@ bool QDockAreaLayout::restoreDockWidget(QDockWidget *dockWidget)
dockWidget->d_func()->setWindowState(true);
#endif
- item.placeHolderItem = 0;
+ item->placeHolderItem = 0;
delete placeHolder;
return true;
@@ -3099,9 +3126,7 @@ void QDockAreaLayout::addDockWidget(QInternal::DockPosition pos, QDockWidget *do
info = new_info;
}
- QList<int> index = indexOfPlaceHolder(dockWidget->objectName());
- if (!index.isEmpty())
- remove(index);
+ removePlaceHolder(dockWidget->objectName());
}
void QDockAreaLayout::tabifyDockWidget(QDockWidget *first, QDockWidget *second)
@@ -3114,9 +3139,7 @@ void QDockAreaLayout::tabifyDockWidget(QDockWidget *first, QDockWidget *second)
Q_ASSERT(info != 0);
info->tab(path.last(), new QDockWidgetItem(second));
- QList<int> index = indexOfPlaceHolder(second->objectName());
- if (!index.isEmpty())
- remove(index);
+ removePlaceHolder(second->objectName());
}
void QDockAreaLayout::resizeDocks(const QList<QDockWidget *> &docks,
@@ -3178,9 +3201,7 @@ void QDockAreaLayout::splitDockWidget(QDockWidget *after,
Q_ASSERT(info != 0);
info->split(path.last(), orientation, new QDockWidgetItem(dockWidget));
- QList<int> index = indexOfPlaceHolder(dockWidget->objectName());
- if (!index.isEmpty())
- remove(index);
+ removePlaceHolder(dockWidget->objectName());
}
void QDockAreaLayout::apply(bool animate)
diff --git a/src/widgets/widgets/qdockarealayout_p.h b/src/widgets/widgets/qdockarealayout_p.h
index aa6e4232e0..f22a3d2de2 100644
--- a/src/widgets/widgets/qdockarealayout_p.h
+++ b/src/widgets/widgets/qdockarealayout_p.h
@@ -262,6 +262,7 @@ public:
QLayoutItem *plug(const QList<int> &path);
QLayoutItem *unplug(const QList<int> &path);
void remove(const QList<int> &path);
+ void removePlaceHolder(const QString &name);
void fitLayout();
diff --git a/src/widgets/widgets/qmainwindowlayout.cpp b/src/widgets/widgets/qmainwindowlayout.cpp
index c5b08387a3..939453473a 100644
--- a/src/widgets/widgets/qmainwindowlayout.cpp
+++ b/src/widgets/widgets/qmainwindowlayout.cpp
@@ -221,11 +221,10 @@ public:
}
void setGeometry(const QRect&r) Q_DECL_OVERRIDE
{
+ static_cast<QDockWidgetGroupWindow *>(parent())->destroyOrHideIfEmpty();
QDockAreaLayoutInfo *li = layoutInfo();
- if (li->isEmpty()) {
- static_cast<QDockWidgetGroupWindow *>(parent())->destroyIfEmpty();
+ if (li->isEmpty())
return;
- }
int fw = frameWidth();
li->reparentWidgets(parentWidget());
li->rect = r.adjusted(fw, fw, -fw, -fw);
@@ -278,6 +277,10 @@ bool QDockWidgetGroupWindow::event(QEvent *e)
if (qobject_cast<QDockWidget *>(static_cast<QChildEvent*>(e)->child()))
adjustFlags();
break;
+ case QEvent::LayoutRequest:
+ // We might need to show the widget again
+ destroyOrHideIfEmpty();
+ break;
default:
break;
}
@@ -331,34 +334,43 @@ QDockWidget *QDockWidgetGroupWindow::topDockWidget() const
}
/*! \internal
- Destroy this window if there is no more QDockWidget in it.
+ Destroy or hide this window if there is no more QDockWidget in it.
+ Otherwise make sure it is shown.
*/
-void QDockWidgetGroupWindow::destroyIfEmpty()
-{
- if (layoutInfo()->isEmpty()) {
- // Make sure to reparent the possibly floating or hidden QDockWidgets to the parent
- foreach (QDockWidget *dw,
- findChildren<QDockWidget *>(QString(), Qt::FindDirectChildrenOnly)) {
- bool wasFloating = dw->isFloating();
- bool wasHidden = dw->isHidden();
- dw->setParent(parentWidget());
- if (wasFloating) {
- dw->setFloating(true);
- } else {
- // maybe it was hidden, we still have to put it back in the main layout.
- QMainWindowLayout *ml = qt_mainwindow_layout(static_cast<QMainWindow*>(parentWidget()));
- Qt::DockWidgetArea area = ml->dockWidgetArea(this);
- if (area == Qt::NoDockWidgetArea)
- area = Qt::LeftDockWidgetArea;
- static_cast<QMainWindow*>(parentWidget())->addDockWidget(area, dw);
- }
- if (!wasHidden)
- dw->show();
+void QDockWidgetGroupWindow::destroyOrHideIfEmpty()
+{
+ if (!layoutInfo()->isEmpty()) {
+ show(); // It might have been hidden,
+ return;
+ }
+ // There might still be placeholders
+ if (!layoutInfo()->item_list.isEmpty()) {
+ hide();
+ return;
+ }
+
+ // Make sure to reparent the possibly floating or hidden QDockWidgets to the parent
+ foreach (QDockWidget *dw, findChildren<QDockWidget *>(QString(), Qt::FindDirectChildrenOnly)) {
+ bool wasFloating = dw->isFloating();
+ bool wasHidden = dw->isHidden();
+ dw->setParent(parentWidget());
+ if (wasFloating) {
+ dw->setFloating(true);
+ } else {
+ // maybe it was hidden, we still have to put it back in the main layout.
+ QMainWindowLayout *ml =
+ qt_mainwindow_layout(static_cast<QMainWindow *>(parentWidget()));
+ Qt::DockWidgetArea area = ml->dockWidgetArea(this);
+ if (area == Qt::NoDockWidgetArea)
+ area = Qt::LeftDockWidgetArea;
+ static_cast<QMainWindow *>(parentWidget())->addDockWidget(area, dw);
}
- foreach (QTabBar *tb, findChildren<QTabBar *>(QString(), Qt::FindDirectChildrenOnly))
- tb->setParent(parentWidget());
- deleteLater();
+ if (!wasHidden)
+ dw->show();
}
+ foreach (QTabBar *tb, findChildren<QTabBar *>(QString(), Qt::FindDirectChildrenOnly))
+ tb->setParent(parentWidget());
+ deleteLater();
}
/*! \internal
@@ -2093,7 +2105,7 @@ void QMainWindowLayout::animationFinished(QWidget *widget)
item.subinfo->reparentWidgets(parentWidget());
item.subinfo->setTabBarShape(parentInfo->tabBarShape);
}
- dwgw->destroyIfEmpty();
+ dwgw->destroyOrHideIfEmpty();
}
if (QDockWidget *dw = qobject_cast<QDockWidget*>(widget)) {
diff --git a/src/widgets/widgets/qmainwindowlayout_p.h b/src/widgets/widgets/qmainwindowlayout_p.h
index 7f35f78111..c06122b9c7 100644
--- a/src/widgets/widgets/qmainwindowlayout_p.h
+++ b/src/widgets/widgets/qmainwindowlayout_p.h
@@ -81,7 +81,7 @@ public:
: QWidget(parent, f) {}
QDockAreaLayoutInfo *layoutInfo() const;
QDockWidget *topDockWidget() const;
- void destroyIfEmpty();
+ void destroyOrHideIfEmpty();
void adjustFlags();
protected:
bool event(QEvent *) Q_DECL_OVERRIDE;
diff --git a/src/xml/configure.json b/src/xml/configure.json
new file mode 100644
index 0000000000..345eb8544b
--- /dev/null
+++ b/src/xml/configure.json
@@ -0,0 +1,16 @@
+{
+ "module": "xml",
+ "depends": [
+ "core"
+ ],
+ "testDir": "../../config.tests",
+
+ "features": {
+ "dom": {
+ "label": "DOM",
+ "purpose": "Supports the Document Object Model.",
+ "section": "File I/O",
+ "output": [ "publicFeature", "feature" ]
+ }
+ }
+}
diff --git a/src/xml/qtxmlglobal.h b/src/xml/qtxmlglobal.h
index de5a8ab39d..ed5de8db87 100644
--- a/src/xml/qtxmlglobal.h
+++ b/src/xml/qtxmlglobal.h
@@ -41,6 +41,9 @@
#define QTXMLGLOBAL_H
#include <QtCore/qglobal.h>
+#ifndef QT_BOOTSTRAPPED
+# include <QtXml/qtxml-config.h>
+#endif
QT_BEGIN_NAMESPACE