summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rwxr-xr-xbin/syncqt.pl6
-rw-r--r--config.tests/common/libproxy/libproxy.pro1
-rw-r--r--config.tests/common/pch/header.h1
-rw-r--r--config.tests/common/pch/pch.pro3
-rw-r--r--config.tests/common/pch/source.cpp (renamed from config.tests/unix/javascriptcore-jit/hwcap_test.cpp)14
-rw-r--r--config.tests/common/verifyspec/verifyspec.cpp1
-rw-r--r--config.tests/common/verifyspec/verifyspec.pro1
-rw-r--r--config.tests/mac/corewlan/corewlan.pro1
-rw-r--r--config.tests/qpa/direct2d/direct2d.pro1
-rw-r--r--config.tests/qpa/egl-x11/egl-x11.pro9
-rw-r--r--config.tests/qpa/egl/egl.pro7
-rw-r--r--config.tests/qpa/eglfs-brcm/eglfs-brcm.cpp1
-rw-r--r--config.tests/qpa/eglfs-brcm/eglfs-brcm.pro8
-rw-r--r--config.tests/qpa/eglfs-egldevice/eglfs-egldevice.cpp10
-rw-r--r--config.tests/qpa/eglfs-egldevice/eglfs-egldevice.pro12
-rw-r--r--config.tests/qpa/eglfs-mali-2/eglfs-mali-2.pro2
-rw-r--r--config.tests/qpa/eglfs-mali/eglfs-mali.pro2
-rw-r--r--config.tests/qpa/eglfs-viv/eglfs-viv.cpp1
-rw-r--r--config.tests/qpa/eglfs-viv/eglfs-viv.pro9
-rw-r--r--config.tests/qpa/gbm/gbm.pro2
-rw-r--r--config.tests/qpa/kms/kms.pro2
-rw-r--r--config.tests/qpa/mirclient/mirclient.pro2
-rw-r--r--config.tests/qpa/wayland-server/wayland-server.pro2
-rw-r--r--config.tests/qpa/xcb-glx/xcb-glx.pro3
-rw-r--r--config.tests/qpa/xcb-render/xcb-render.pro3
-rw-r--r--config.tests/qpa/xcb-syslibs/xcb-syslibs.pro3
-rw-r--r--config.tests/qpa/xcb-xkb/xcb-xkb.pro3
-rw-r--r--config.tests/qpa/xcb-xlib/xcb-xlib.pro3
-rw-r--r--config.tests/qpa/xcb/xcb.pro3
-rw-r--r--config.tests/unix/alsa/alsa.pro1
-rwxr-xr-xconfig.tests/unix/bsymbolic_functions.test31
-rw-r--r--config.tests/unix/cups/cups.pro1
-rw-r--r--config.tests/unix/db2/db2.pro1
-rw-r--r--config.tests/unix/dbus/dbus.pro6
-rw-r--r--config.tests/unix/doubleconversion/doubleconversion.pro1
-rw-r--r--config.tests/unix/fontconfig/fontconfig.pro1
-rw-r--r--config.tests/unix/freetype/freetype.pro1
-rwxr-xr-xconfig.tests/unix/fvisibility.test74
-rw-r--r--config.tests/unix/getaddrinfo/getaddrinfo.pro1
-rw-r--r--config.tests/unix/getifaddrs/getifaddrs.pro1
-rw-r--r--config.tests/unix/gnu-libiconv/gnu-libiconv.pro1
-rw-r--r--config.tests/unix/gstreamer/gstreamer.pro18
-rw-r--r--config.tests/unix/harfbuzz/harfbuzz.pro1
-rw-r--r--config.tests/unix/ibase/ibase.pro1
-rw-r--r--config.tests/unix/icu/icu.pro6
-rw-r--r--config.tests/unix/iodbc/iodbc.cpp46
-rw-r--r--config.tests/unix/iodbc/iodbc.pro3
-rw-r--r--config.tests/unix/ipv6ifname/ipv6ifname.pro1
-rw-r--r--config.tests/unix/javascriptcore-jit/javascriptcore-jit.pro2
-rw-r--r--config.tests/unix/journald/journald.pro7
-rw-r--r--config.tests/unix/lgmon/lgmon.pro1
-rw-r--r--config.tests/unix/libdl/libdl.pro2
-rw-r--r--config.tests/unix/libinput/libinput.pro2
-rw-r--r--config.tests/unix/libjpeg/libjpeg.pro1
-rw-r--r--config.tests/unix/libpng/libpng.pro6
-rw-r--r--config.tests/unix/libudev/libudev.pro2
-rw-r--r--config.tests/unix/mtdev/mtdev.pro3
-rw-r--r--config.tests/unix/mysql/mysql.cpp3
-rw-r--r--config.tests/unix/mysql/mysql.pro1
-rw-r--r--config.tests/unix/mysql_r/mysql_r.pro3
-rw-r--r--config.tests/unix/oci/oci.pro1
-rw-r--r--config.tests/unix/odbc/odbc.cpp4
-rw-r--r--config.tests/unix/odbc/odbc.pro2
-rw-r--r--config.tests/unix/opengldesktop/opengldesktop.pro6
-rw-r--r--config.tests/unix/opengles2/opengles2.pro7
-rw-r--r--config.tests/unix/opengles3/opengles3.pro7
-rw-r--r--config.tests/unix/opengles31/opengles31.pro6
-rw-r--r--config.tests/unix/pcre/pcre.pro1
-rw-r--r--config.tests/unix/pps/pps.pro1
-rwxr-xr-xconfig.tests/unix/precomp.test54
-rw-r--r--config.tests/unix/psql/psql.pro1
-rw-r--r--config.tests/unix/pulseaudio/pulseaudio.pro1
-rw-r--r--config.tests/unix/qqnx_imf/qqnx_imf.pro1
-rw-r--r--config.tests/unix/reduce_exports/fvisibility.c (renamed from config.tests/x11/mitshm/mitshm.cpp)35
-rw-r--r--config.tests/unix/reduce_exports/reduce_exports.pro5
-rw-r--r--config.tests/unix/reduce_relocs/bsymbolic_functions.c (renamed from config.tests/x11/xfixes/xfixes.cpp)19
-rw-r--r--config.tests/unix/reduce_relocs/reduce_relocs.pro5
-rw-r--r--config.tests/unix/sctp/sctp.pro1
-rw-r--r--config.tests/unix/slog2/slog2.pro1
-rw-r--r--config.tests/unix/sqlite2/sqlite2.pro1
-rw-r--r--config.tests/unix/stdint/stdint.pro3
-rw-r--r--config.tests/unix/tds/tds.pro1
-rw-r--r--config.tests/unix/tslib/tslib.pro1
-rw-r--r--config.tests/unix/zlib/zlib.pro1
-rw-r--r--config.tests/win/directwrite/directwrite.pro1
-rw-r--r--config.tests/win/directwrite2/directwrite2.pro1
-rw-r--r--config.tests/x11/glxfbconfig/glxfbconfig.cpp49
-rw-r--r--config.tests/x11/glxfbconfig/glxfbconfig.pro10
-rw-r--r--config.tests/x11/mitshm/mitshm.pro5
-rwxr-xr-xconfig.tests/x11/notype.test49
-rw-r--r--config.tests/x11/notype/notypetest.pro5
-rw-r--r--config.tests/x11/opengl/opengl.cpp47
-rw-r--r--config.tests/x11/opengl/opengl.pro11
-rw-r--r--config.tests/x11/xcursor/xcursor.pro4
-rw-r--r--config.tests/x11/xfixes/xfixes.pro3
-rw-r--r--config.tests/x11/xinput2/xinput2.pro1
-rw-r--r--config.tests/x11/xkb/xkb.pro3
-rw-r--r--config.tests/x11/xrandr/xrandr.cpp52
-rw-r--r--config.tests/x11/xrandr/xrandr.pro4
-rw-r--r--config.tests/x11/xrender/xrender.pro1
-rw-r--r--config.tests/x11/xshape/xshape.cpp49
-rw-r--r--config.tests/x11/xshape/xshape.pro3
-rw-r--r--config.tests/x11/xsync/xsync.cpp54
-rw-r--r--config.tests/x11/xsync/xsync.pro3
-rw-r--r--config_help.txt730
-rwxr-xr-xconfigure159
-rw-r--r--configure.bat25
-rw-r--r--configure.json1665
-rw-r--r--configure.pri206
-rw-r--r--doc/global/config.qdocconf2
-rw-r--r--doc/global/externalsites/qt-webpages.qdoc6
-rw-r--r--doc/global/macros.qdocconf1
-rw-r--r--doc/global/qt-cpp-defines.qdocconf1
-rw-r--r--examples/corelib/threads/doc/src/semaphores.qdoc2
-rw-r--r--examples/dbus/dbus.pro5
-rw-r--r--examples/examples.pro2
-rw-r--r--examples/gui/gui.pro2
-rw-r--r--examples/gui/rasterwindow/rasterwindow.cpp2
-rw-r--r--examples/network/network.pro8
-rw-r--r--examples/opengl/legacy/framebufferobject2/framebufferobject2.pro2
-rw-r--r--examples/opengl/legacy/grabber/grabber.pro2
-rw-r--r--examples/opengl/legacy/hellogl/hellogl.pro2
-rw-r--r--examples/opengl/legacy/legacy.pro2
-rw-r--r--examples/opengl/legacy/overpainting/overpainting.pro2
-rw-r--r--examples/opengl/legacy/pbuffers/pbuffers.pro2
-rw-r--r--examples/opengl/legacy/pbuffers2/pbuffers2.pro2
-rw-r--r--examples/opengl/legacy/samplebuffers/samplebuffers.pro2
-rw-r--r--examples/widgets/desktop/systray/doc/src/systray.qdoc4
-rw-r--r--examples/widgets/dialogs/findfiles/window.cpp139
-rw-r--r--examples/widgets/dialogs/findfiles/window.h6
-rw-r--r--examples/widgets/doc/dropsite.qdoc2
-rw-r--r--examples/widgets/doc/src/application.qdoc6
-rw-r--r--examples/widgets/doc/src/classwizard.qdoc4
-rw-r--r--examples/widgets/doc/src/findfiles.qdoc38
-rw-r--r--examples/widgets/doc/src/licensewizard.qdoc4
-rw-r--r--examples/widgets/doc/src/plugandpaint.qdoc2
-rw-r--r--examples/widgets/draganddrop/draggabletext/dragwidget.cpp4
-rw-r--r--examples/widgets/graphicsview/boxes/boxes.pro2
-rw-r--r--examples/widgets/graphicsview/graphicsview.pro2
-rw-r--r--examples/widgets/painting/composition/composition.pro2
-rw-r--r--examples/widgets/painting/shared/shared.pri2
-rw-r--r--examples/widgets/tools/codecs/mainwindow.cpp137
-rw-r--r--examples/widgets/tools/codecs/mainwindow.h16
-rw-r--r--examples/widgets/tools/codecs/previewform.cpp176
-rw-r--r--examples/widgets/tools/codecs/previewform.h16
-rw-r--r--examples/widgets/tools/plugandpaint/app/app.pro13
-rw-r--r--examples/widgets/tools/plugandpaint/plugins/basictools/basictools.pro1
-rw-r--r--examples/widgets/tools/plugandpaint/plugins/extrafilters/extrafilters.pro1
-rw-r--r--examples/widgets/widgets.pro4
-rw-r--r--examples/widgets/widgets/charactermap/characterwidget.cpp17
-rw-r--r--examples/widgets/widgets/charactermap/characterwidget.h2
-rw-r--r--examples/widgets/widgets/charactermap/mainwindow.cpp121
-rw-r--r--examples/widgets/widgets/charactermap/mainwindow.h6
-rw-r--r--examples/widgets/widgets/icons/images/designer.pngbin4205 -> 3604 bytes
-rw-r--r--examples/widgets/widgets/icons/images/qt_extended_16x16.pngbin524 -> 1263 bytes
-rw-r--r--examples/widgets/widgets/icons/images/qt_extended_32x32.pngbin892 -> 15518 bytes
-rw-r--r--examples/widgets/widgets/icons/images/qt_extended_48x48.pngbin1294 -> 789 bytes
-rw-r--r--mkspecs/common/clang-mac.conf1
-rw-r--r--mkspecs/common/linux.conf1
-rw-r--r--mkspecs/common/msvc-base.conf2
-rw-r--r--mkspecs/common/tvos.conf1
-rw-r--r--mkspecs/common/uikit.conf2
-rw-r--r--mkspecs/common/watchos.conf20
-rw-r--r--mkspecs/devices/linux-drive-cx-g++/qmake.conf12
-rw-r--r--mkspecs/features/android/android_deployment_settings.prf2
-rw-r--r--mkspecs/features/configure.prf2
-rw-r--r--mkspecs/features/configure_base.prf23
-rw-r--r--mkspecs/features/ctest_testcase_common.prf4
-rw-r--r--mkspecs/features/default_post.prf23
-rw-r--r--mkspecs/features/default_pre.prf2
-rw-r--r--mkspecs/features/java.prf2
-rw-r--r--mkspecs/features/mac/default_post.prf4
-rw-r--r--mkspecs/features/mac/default_pre.prf2
-rw-r--r--mkspecs/features/mac/sdk.prf1
-rw-r--r--mkspecs/features/moc.prf2
-rw-r--r--mkspecs/features/qml_module.prf20
-rw-r--r--mkspecs/features/qml_plugin.prf6
-rw-r--r--mkspecs/features/qpa/basicunixfontdatabase.prf2
-rw-r--r--mkspecs/features/qpa/genericunixfontdatabase.prf2
-rw-r--r--mkspecs/features/qt.prf18
-rw-r--r--mkspecs/features/qt_android_deps.prf2
-rw-r--r--mkspecs/features/qt_app.prf4
-rw-r--r--mkspecs/features/qt_common.prf13
-rw-r--r--mkspecs/features/qt_configure.prf661
-rw-r--r--mkspecs/features/qt_docs.prf15
-rw-r--r--mkspecs/features/qt_functions.prf17
-rw-r--r--mkspecs/features/qt_helper_lib.prf8
-rw-r--r--mkspecs/features/qt_module.prf18
-rw-r--r--mkspecs/features/qt_module_headers.prf15
-rw-r--r--mkspecs/features/qt_module_pris.prf6
-rw-r--r--mkspecs/features/qt_plugin.prf12
-rw-r--r--mkspecs/features/qt_tool.prf2
-rw-r--r--mkspecs/features/resolve_config.prf2
-rw-r--r--mkspecs/features/resources.prf2
-rw-r--r--mkspecs/features/uikit/bitcode.prf2
-rw-r--r--mkspecs/features/uikit/default_post.prf8
-rw-r--r--mkspecs/features/uikit/default_pre.prf4
-rwxr-xr-xmkspecs/features/uikit/device_destinations.sh6
-rw-r--r--mkspecs/features/uikit/qt.prf2
-rw-r--r--mkspecs/features/uikit/qt_config.prf1
-rw-r--r--mkspecs/features/uikit/sdk.prf5
-rw-r--r--mkspecs/features/uikit/xcodebuild.mk2
-rw-r--r--mkspecs/features/uikit/xcodebuild.prf4
-rw-r--r--mkspecs/features/unix/opengl.prf2
-rw-r--r--mkspecs/features/unix/openvg.prf4
-rw-r--r--mkspecs/features/win32/opengl.prf10
-rw-r--r--mkspecs/features/win32/openvg.prf2
-rw-r--r--mkspecs/features/winrt/default_pre.prf14
-rw-r--r--mkspecs/macx-watchos-clang/Info.plist.app35
-rw-r--r--mkspecs/macx-watchos-clang/Info.plist.lib22
-rw-r--r--mkspecs/macx-watchos-clang/qmake.conf21
-rw-r--r--mkspecs/macx-watchos-clang/qplatformdefs.h34
-rw-r--r--mkspecs/qnx-aarch64le-qcc/qmake.conf2
-rw-r--r--mkspecs/qnx-x86-64-qcc/qmake.conf2
-rw-r--r--qmake/doc/src/qmake-manual.qdoc53
-rw-r--r--qmake/generators/mac/pbuilder_pbx.cpp2
-rw-r--r--qmake/generators/win32/msvc_nmake.cpp6
-rw-r--r--qmake/library/qmakebuiltins.cpp23
-rw-r--r--qmake/library/qmakeevaluator.h2
-rw-r--r--qtbase.pro20
-rw-r--r--src/3rdparty/android/LICENSE11
-rw-r--r--src/3rdparty/android/qt_attribution.json11
-rw-r--r--src/3rdparty/angle/SYSTEMINFO_LICENSE22
-rw-r--r--src/3rdparty/angle/TRACEEVENT_LICENSE27
-rw-r--r--src/3rdparty/angle/qt_attribution.json61
-rw-r--r--src/3rdparty/atspi2/LICENSE482
-rw-r--r--src/3rdparty/atspi2/qt_attribution.json11
-rw-r--r--src/3rdparty/double-conversion/qt_attribution.json14
-rw-r--r--src/3rdparty/easing/LICENSE25
-rw-r--r--src/3rdparty/easing/qt_attribution.json11
-rw-r--r--src/3rdparty/forkfd/LICENSE19
-rw-r--r--src/3rdparty/forkfd/qt_attribution.json12
-rw-r--r--src/3rdparty/freebsd/LICENSE31
-rw-r--r--src/3rdparty/freebsd/qt_attribution.json17
-rw-r--r--src/3rdparty/freetype/qt_attribution.json13
-rw-r--r--src/3rdparty/freetype_dependency.pri4
-rw-r--r--src/3rdparty/harfbuzz-ng/harfbuzz-ng.pro6
-rw-r--r--src/3rdparty/harfbuzz-ng/qt_attribution.json25
-rw-r--r--src/3rdparty/harfbuzz/qt_attribution.json17
-rw-r--r--src/3rdparty/harfbuzz_dependency.pri6
-rw-r--r--src/3rdparty/iaccessible2/LICENSE38
-rw-r--r--src/3rdparty/iaccessible2/qt_attribution.json17
-rw-r--r--src/3rdparty/libjpeg/LICENSE50
-rw-r--r--src/3rdparty/libjpeg/qt_attribution.json13
-rw-r--r--src/3rdparty/libpng/qt_attribution.json15
-rw-r--r--src/3rdparty/md4/qt_attribution.json10
-rw-r--r--src/3rdparty/md5/qt_attribution.json11
-rw-r--r--src/3rdparty/pcre/qt_attribution.json15
-rw-r--r--src/3rdparty/pcre_dependency.pri2
-rw-r--r--src/3rdparty/pixman/LICENSE20
-rw-r--r--src/3rdparty/pixman/qt_attribution.json13
-rw-r--r--src/3rdparty/png_dependency.pri15
-rw-r--r--src/3rdparty/rfc6234/LICENSE34
-rw-r--r--src/3rdparty/rfc6234/qt_attribution.json12
-rw-r--r--src/3rdparty/sha1/qt_attribution.json12
-rw-r--r--src/3rdparty/sha3/BRG_ENDIAN_LICENSE21
-rw-r--r--src/3rdparty/sha3/CC0_LICENSE99
-rw-r--r--src/3rdparty/sha3/qt_attribution.json29
-rw-r--r--src/3rdparty/sqlite.pri2
-rw-r--r--src/3rdparty/sqlite/qt_attribution.json12
-rw-r--r--src/3rdparty/wintab/qt_attribution.json12
-rw-r--r--src/3rdparty/xcb/LICENSE23
-rw-r--r--src/3rdparty/xcb/qt_attribution.json24
-rw-r--r--src/3rdparty/xkbcommon-x11.pri10
-rw-r--r--src/3rdparty/xkbcommon.pri11
-rw-r--r--src/3rdparty/xkbcommon/qt_attribution.json26
-rw-r--r--src/3rdparty/zlib/LICENSE28
-rw-r--r--src/3rdparty/zlib/gzguts.h4
-rw-r--r--src/3rdparty/zlib/qt_attribution.json15
-rw-r--r--src/3rdparty/zlib/zutil.h4
-rw-r--r--src/3rdparty/zlib_dependency.pri8
-rw-r--r--src/android/jar/src/org/qtproject/qt5/android/CursorHandle.java205
-rw-r--r--src/android/jar/src/org/qtproject/qt5/android/EditMenu.java142
-rw-r--r--src/android/jar/src/org/qtproject/qt5/android/EditPopupMenu.java155
-rw-r--r--src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java72
-rw-r--r--src/android/jar/src/org/qtproject/qt5/android/QtNative.java23
-rw-r--r--src/angle/src/common/common.pri2
-rw-r--r--src/angle/src/compiler/preprocessor/preprocessor.pro2
-rw-r--r--src/angle/src/compiler/translator.pro2
-rw-r--r--src/concurrent/concurrent.pro2
-rw-r--r--src/corelib/Qt5CoreConfigExtras.cmake.in2
-rw-r--r--src/corelib/arch/arch.pri2
-rw-r--r--src/corelib/codecs/codecs.pri23
-rw-r--r--src/corelib/doc/src/qtcore-index.qdoc14
-rw-r--r--src/corelib/doc/src/resource-system.qdoc2
-rw-r--r--src/corelib/global/qglobal.cpp61
-rw-r--r--src/corelib/global/qglobal.h20
-rw-r--r--src/corelib/global/qglobal_p.h9
-rw-r--r--src/corelib/global/qnamespace.qdoc50
-rw-r--r--src/corelib/global/qnumeric_p.h8
-rw-r--r--src/corelib/global/qsysinfo.h10
-rw-r--r--src/corelib/global/qsystemdetection.h14
-rw-r--r--src/corelib/io/io.pri4
-rw-r--r--src/corelib/io/qabstractfileengine.cpp2
-rw-r--r--src/corelib/io/qdebug.h4
-rw-r--r--src/corelib/io/qfileinfo.cpp8
-rw-r--r--src/corelib/io/qfilesystemwatcher.cpp2
-rw-r--r--src/corelib/io/qiodevice.cpp2
-rw-r--r--src/corelib/io/qlockfile_unix.cpp6
-rw-r--r--src/corelib/io/qloggingcategory.cpp2
-rw-r--r--src/corelib/io/qprocess.cpp8
-rw-r--r--src/corelib/io/qsettings.cpp44
-rw-r--r--src/corelib/io/qstandardpaths.cpp4
-rw-r--r--src/corelib/io/qstandardpaths.h7
-rw-r--r--src/corelib/io/qstorageinfo.cpp2
-rw-r--r--src/corelib/io/qurl.cpp26
-rw-r--r--src/corelib/itemmodels/qabstractitemmodel.cpp20
-rw-r--r--src/corelib/itemmodels/qabstractitemmodel.h10
-rw-r--r--src/corelib/itemmodels/qsortfilterproxymodel.cpp6
-rw-r--r--src/corelib/itemmodels/qstringlistmodel.cpp12
-rw-r--r--src/corelib/kernel/kernel.pri25
-rw-r--r--src/corelib/kernel/qcore_mac_objc.mm2
-rw-r--r--src/corelib/kernel/qcore_unix_p.h2
-rw-r--r--src/corelib/kernel/qcoreapplication.cpp8
-rw-r--r--src/corelib/kernel/qcoreevent.cpp4
-rw-r--r--src/corelib/kernel/qdeadlinetimer.cpp827
-rw-r--r--src/corelib/kernel/qdeadlinetimer.h190
-rw-r--r--src/corelib/kernel/qdeadlinetimer_p.h (renamed from config.tests/x11/xcursor/xcursor.cpp)48
-rw-r--r--src/corelib/kernel/qelapsedtimer.cpp13
-rw-r--r--src/corelib/kernel/qelapsedtimer_generic.cpp11
-rw-r--r--src/corelib/kernel/qelapsedtimer_mac.cpp29
-rw-r--r--src/corelib/kernel/qelapsedtimer_unix.cpp14
-rw-r--r--src/corelib/kernel/qelapsedtimer_win.cpp22
-rw-r--r--src/corelib/kernel/qeventdispatcher_cf.mm4
-rw-r--r--src/corelib/kernel/qobject.cpp61
-rw-r--r--src/corelib/kernel/qobjectdefs.h11
-rw-r--r--src/corelib/kernel/qvariant.cpp4
-rw-r--r--src/corelib/mimetypes/mimetypes.pri6
-rw-r--r--src/corelib/mimetypes/qmimedatabase.cpp2
-rw-r--r--src/corelib/plugin/qlibrary.cpp8
-rw-r--r--src/corelib/plugin/qpluginloader.cpp2
-rw-r--r--src/corelib/statemachine/qstatemachine.cpp12
-rw-r--r--src/corelib/statemachine/qstatemachine.h2
-rw-r--r--src/corelib/statemachine/qstatemachine_p.h6
-rw-r--r--src/corelib/statemachine/statemachine.pri10
-rw-r--r--src/corelib/thread/qfuture.h25
-rw-r--r--src/corelib/thread/qfutureinterface.h10
-rw-r--r--src/corelib/thread/qthread_unix.cpp4
-rw-r--r--src/corelib/tools/qalgorithms.h11
-rw-r--r--src/corelib/tools/qcommandlineoption.cpp4
-rw-r--r--src/corelib/tools/qcommandlineparser.cpp5
-rw-r--r--src/corelib/tools/qdatetimeparser.cpp8
-rw-r--r--src/corelib/tools/qmap.cpp6
-rw-r--r--src/corelib/tools/qstring.cpp6
-rw-r--r--src/corelib/tools/qtimezoneprivate_tz.cpp21
-rw-r--r--src/corelib/tools/tools.pri10
-rw-r--r--src/dbus/dbus.pro10
-rw-r--r--src/dbus/qdbusconnection_p.h4
-rw-r--r--src/dbus/qdbusintegrator.cpp13
-rw-r--r--src/gui/accessible/accessible.pri2
-rw-r--r--src/gui/accessible/qaccessible.cpp2
-rw-r--r--src/gui/accessible/qaccessiblebridge.cpp2
-rw-r--r--src/gui/doc/images/qcolor-saturation.pngbin2150 -> 1116 bytes
-rw-r--r--src/gui/doc/images/qcolor-saturation.svg78
-rw-r--r--src/gui/doc/images/qcolor-value.pngbin1241 -> 909 bytes
-rw-r--r--src/gui/doc/images/qcolor-value.svg78
-rw-r--r--src/gui/doc/src/dnd.qdoc4
-rw-r--r--src/gui/doc/src/qtgui.qdoc13
-rw-r--r--src/gui/gui.pro16
-rw-r--r--src/gui/image/image.pri4
-rw-r--r--src/gui/image/qicon.cpp2
-rw-r--r--src/gui/image/qiconloader.cpp6
-rw-r--r--src/gui/image/qimage.h9
-rw-r--r--src/gui/image/qimage_darwin.mm141
-rw-r--r--src/gui/image/qpixmap_blitter_p.h2
-rw-r--r--src/gui/kernel/kernel.pri2
-rw-r--r--src/gui/kernel/qclipboard.cpp18
-rw-r--r--src/gui/kernel/qdrag.cpp4
-rw-r--r--src/gui/kernel/qevent.cpp30
-rw-r--r--src/gui/kernel/qguiapplication.cpp2
-rw-r--r--src/gui/kernel/qhighdpiscaling.cpp2
-rw-r--r--src/gui/kernel/qkeysequence.cpp28
-rw-r--r--src/gui/kernel/qopenglcontext_p.h7
-rw-r--r--src/gui/kernel/qpalette.cpp2
-rw-r--r--src/gui/kernel/qplatformcursor.cpp10
-rw-r--r--src/gui/kernel/qplatformcursor.h8
-rw-r--r--src/gui/kernel/qwindowsysteminterface.cpp5
-rw-r--r--src/gui/kernel/qwindowsysteminterface.h1
-rw-r--r--src/gui/opengl/opengl.pri10
-rw-r--r--src/gui/opengl/qopenglframebufferobject.cpp5
-rw-r--r--src/gui/opengl/qopenglversionfunctions.cpp2
-rw-r--r--src/gui/painting/qblittable_p.h2
-rw-r--r--src/gui/painting/qcolor.cpp5
-rw-r--r--src/gui/painting/qcolor.h1
-rw-r--r--src/gui/painting/qcolor_p.cpp36
-rw-r--r--src/gui/painting/qdatabuffer_p.h2
-rw-r--r--src/gui/painting/qdrawhelper.cpp41
-rw-r--r--src/gui/painting/qgrayraster.c4
-rw-r--r--src/gui/painting/qpagesize.cpp2
-rw-r--r--src/gui/painting/qpaintengine.cpp6
-rw-r--r--src/gui/painting/qpaintengine_blitter_p.h2
-rw-r--r--src/gui/painting/qrasterizer.cpp6
-rw-r--r--src/gui/painting/qregion.cpp2
-rw-r--r--src/gui/painting/qregion.h1
-rw-r--r--src/gui/text/qcssparser.cpp20
-rw-r--r--src/gui/text/qfont.cpp4
-rw-r--r--src/gui/text/qfontdatabase.cpp3
-rw-r--r--src/gui/text/qfontengine_ft.cpp6
-rw-r--r--src/gui/text/qrawfont.cpp2
-rw-r--r--src/gui/text/qtextengine.cpp9
-rw-r--r--src/gui/text/qtextformat.cpp2
-rw-r--r--src/gui/text/qzip.cpp10
-rw-r--r--src/gui/text/text.pri2
-rw-r--r--src/network/access/http2/http2frames.cpp444
-rw-r--r--src/network/access/http2/http2frames_p.h101
-rw-r--r--src/network/access/http2/http2streams.cpp4
-rw-r--r--src/network/access/http2/http2streams_p.h3
-rw-r--r--src/network/access/qhttp2protocolhandler.cpp263
-rw-r--r--src/network/access/qhttp2protocolhandler_p.h13
-rw-r--r--src/network/access/qhttpnetworkconnection.cpp13
-rw-r--r--src/network/access/qhttpnetworkconnectionchannel.cpp68
-rw-r--r--src/network/access/qhttpnetworkconnectionchannel_p.h7
-rw-r--r--src/network/access/qhttpthreaddelegate.cpp5
-rw-r--r--src/network/access/qnetworkrequest.cpp8
-rw-r--r--src/network/kernel/kernel.pri7
-rw-r--r--src/network/kernel/qnetworkinterface.cpp2
-rw-r--r--src/network/kernel/qnetworkproxy.cpp4
-rw-r--r--src/network/socket/qabstractsocket.cpp43
-rw-r--r--src/network/socket/qlocalserver.cpp2
-rw-r--r--src/network/socket/qlocalsocket_tcp.cpp2
-rw-r--r--src/network/socket/qnativesocketengine_unix.cpp2
-rw-r--r--src/network/socket/socket.pri4
-rw-r--r--src/network/ssl/qsslcontext_openssl.cpp2
-rw-r--r--src/network/ssl/qssldiffiehellmanparameters.cpp66
-rw-r--r--src/network/ssl/qssldiffiehellmanparameters.h13
-rw-r--r--src/network/ssl/qsslsocket.cpp2
-rw-r--r--src/network/ssl/qsslsocket_mac.cpp4
-rw-r--r--src/network/ssl/qsslsocket_mac_p.h4
-rw-r--r--src/network/ssl/ssl.pri6
-rw-r--r--src/opengl/doc/src/qtopengl-index.qdoc2
-rw-r--r--src/opengl/doc/src/qtopengl-module.qdoc2
-rw-r--r--src/opengl/opengl.pro4
-rw-r--r--src/opengl/qgl.cpp2
-rw-r--r--src/opengl/qglpixelbuffer.cpp6
-rw-r--r--src/openglextensions/openglextensions.pro4
-rw-r--r--src/platformheaders/nativecontexts/qeglnativecontext.h2
-rw-r--r--src/platformsupport/accessibility/accessibility.pri2
-rw-r--r--src/platformsupport/devicediscovery/devicediscovery.pri7
-rw-r--r--src/platformsupport/eglconvenience/eglconvenience.pri13
-rw-r--r--src/platformsupport/eglconvenience/qeglconvenience_p.h2
-rw-r--r--src/platformsupport/eglconvenience/qeglpbuffer_p.h1
-rw-r--r--src/platformsupport/eglconvenience/qeglplatformcontext_p.h2
-rw-r--r--src/platformsupport/eglconvenience/qeglstreamconvenience_p.h3
-rw-r--r--src/platformsupport/eglconvenience/qt_egl_p.h (renamed from config.tests/unix/stdint/main.cpp)80
-rw-r--r--src/platformsupport/eventdispatchers/eventdispatchers.pri5
-rw-r--r--src/platformsupport/fbconvenience/qfbvthandler.cpp3
-rw-r--r--src/platformsupport/fontdatabases/basic/basic.pri2
-rw-r--r--src/platformsupport/fontdatabases/fontconfig/fontconfig.pri2
-rw-r--r--src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp32
-rw-r--r--src/platformsupport/fontdatabases/fontdatabases.pri25
-rw-r--r--src/platformsupport/fontdatabases/mac/coretext.pri4
-rw-r--r--src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm2
-rw-r--r--src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm27
-rw-r--r--src/platformsupport/glxconvenience/glxconvenience.pri6
-rw-r--r--src/platformsupport/input/evdevkeyboard/evdevkeyboard.pri5
-rw-r--r--src/platformsupport/input/evdevmouse/evdevmouse.pri5
-rw-r--r--src/platformsupport/input/evdevtablet/evdevtablet.pri5
-rw-r--r--src/platformsupport/input/evdevtouch/evdevtouch.pri10
-rw-r--r--src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp62
-rw-r--r--src/platformsupport/input/evdevtouch/qevdevtouchhandler_p.h4
-rw-r--r--src/platformsupport/input/input.pri10
-rw-r--r--src/platformsupport/input/libinput/libinput.pri15
-rw-r--r--src/platformsupport/input/libinput/qlibinputpointer.cpp2
-rw-r--r--src/platformsupport/input/libinput/qlibinputtouch.cpp13
-rw-r--r--src/platformsupport/input/shared/qtouchoutputmapping.cpp (renamed from config.tests/x11/xkb/xkb.cpp)68
-rw-r--r--src/platformsupport/input/shared/qtouchoutputmapping_p.h (renamed from config.tests/x11/notype/notypetest.cpp)39
-rw-r--r--src/platformsupport/input/shared/shared.pri5
-rw-r--r--src/platformsupport/input/tslib/tslib.pri2
-rw-r--r--src/platformsupport/linuxaccessibility/atspiadaptor.cpp25
-rw-r--r--src/platformsupport/linuxaccessibility/linuxaccessibility.pri2
-rw-r--r--src/platformsupport/platformcompositor/platformcompositor.pri2
-rw-r--r--src/platformsupport/platformsupport.pro2
-rw-r--r--src/plugins/bearer/bearer.pro2
-rw-r--r--src/plugins/bearer/corewlan/corewlan.pro2
-rw-r--r--src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp44
-rw-r--r--src/plugins/bearer/networkmanager/qnetworkmanagerengine.h30
-rw-r--r--src/plugins/bearer/networkmanager/qnetworkmanagerservice.cpp30
-rw-r--r--src/plugins/generic/generic.pro6
-rw-r--r--src/plugins/generic/tslib/tslib.pro2
-rw-r--r--src/plugins/imageformats/imageformats.pro6
-rw-r--r--src/plugins/imageformats/jpeg/jpeg.pro7
-rw-r--r--src/plugins/platforminputcontexts/compose/compose.pro7
-rw-r--r--src/plugins/platforminputcontexts/ibus/qibustypes.cpp5
-rw-r--r--src/plugins/platforminputcontexts/platforminputcontexts.pro2
-rw-r--r--src/plugins/platforms/android/androidjniinput.cpp34
-rw-r--r--src/plugins/platforms/android/androidjniinput.h4
-rw-r--r--src/plugins/platforms/android/androidjnimain.cpp14
-rw-r--r--src/plugins/platforms/android/qandroidinputcontext.cpp187
-rw-r--r--src/plugins/platforms/android/qandroidinputcontext.h14
-rw-r--r--src/plugins/platforms/android/qandroidplatformfontdatabase.cpp3
-rw-r--r--src/plugins/platforms/bsdfb/qbsdfbintegration.cpp4
-rw-r--r--src/plugins/platforms/cocoa/cocoa.pro2
-rw-r--r--src/plugins/platforms/cocoa/qcocoadrag.mm16
-rw-r--r--src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm9
-rw-r--r--src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm1
-rw-r--r--src/plugins/platforms/cocoa/qcocoahelpers.mm64
-rw-r--r--src/plugins/platforms/cocoa/qcocoatheme.mm3
-rw-r--r--src/plugins/platforms/cocoa/qnsview.mm33
-rw-r--r--src/plugins/platforms/directfb/directfb.pro5
-rw-r--r--src/plugins/platforms/directfb/qdirectfb_egl.cpp2
-rw-r--r--src/plugins/platforms/eglfs/api/qeglfscursor.cpp163
-rw-r--r--src/plugins/platforms/eglfs/api/qeglfscursor_p.h27
-rw-r--r--src/plugins/platforms/eglfs/api/qeglfsdeviceintegration.cpp3
-rw-r--r--src/plugins/platforms/eglfs/api/qeglfsglobal.h2
-rw-r--r--src/plugins/platforms/eglfs/api/qeglfsscreen.cpp4
-rw-r--r--src/plugins/platforms/eglfs/api/qeglfsscreen_p.h2
-rw-r--r--src/plugins/platforms/eglfs/api/qeglfswindow.cpp4
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/deviceintegration.pro14
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_brcm/eglfs_brcm.pro4
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_brcm/qeglfsbrcmintegration.cpp18
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/eglfs_kms.pro12
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmdevice.cpp4
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmdevice.h3
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.cpp11
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.h5
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/eglfs_kms_egldevice.pro11
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldevice.cpp33
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldevice.h15
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp15
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.h3
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldevicescreen.cpp26
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldevicescreen.h10
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/eglfs_kms_support.pro12
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsdevice.cpp98
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsdevice.h5
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsintegration.cpp25
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsintegration.h7
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsscreen.cpp15
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsscreen.h8
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_mali/eglfs_mali.pro4
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_viv/eglfs_viv.pro1
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_viv_wl/eglfs_viv_wl.pro1
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_x11/eglfs_x11.pro6
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_x11/qeglfsx11integration.cpp4
-rw-r--r--src/plugins/platforms/eglfs/eglfsdeviceintegration.pro4
-rw-r--r--src/plugins/platforms/eglfs/qeglfsintegration.cpp18
-rw-r--r--src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp14
-rw-r--r--src/plugins/platforms/minimal/minimal.pro1
-rw-r--r--src/plugins/platforms/minimal/qminimalintegration.cpp8
-rw-r--r--src/plugins/platforms/minimalegl/minimalegl.pro4
-rw-r--r--src/plugins/platforms/minimalegl/qminimaleglintegration.cpp2
-rw-r--r--src/plugins/platforms/minimalegl/qminimaleglscreen.h2
-rw-r--r--src/plugins/platforms/offscreen/offscreen.pro2
-rw-r--r--src/plugins/platforms/openwfd/openwf.pro3
-rw-r--r--src/plugins/platforms/platforms.pro18
-rw-r--r--src/plugins/platforms/qnx/qnx.pro8
-rw-r--r--src/plugins/platforms/qnx/qqnxscreen.cpp6
-rw-r--r--src/plugins/platforms/vnc/qvncintegration.cpp2
-rw-r--r--src/plugins/platforms/windows/qwindowsfontdatabase.cpp34
-rw-r--r--src/plugins/platforms/windows/qwindowsintegration.cpp6
-rw-r--r--src/plugins/platforms/windows/qwindowsintegration.h4
-rw-r--r--src/plugins/platforms/windows/qwindowskeymapper.cpp16
-rw-r--r--src/plugins/platforms/windows/qwindowskeymapper.h1
-rw-r--r--src/plugins/platforms/windows/windows.pri21
-rw-r--r--src/plugins/platforms/winrt/qwinrtwindow.cpp51
-rw-r--r--src/plugins/platforms/xcb/gl_integrations/gl_integrations.pro4
-rw-r--r--src/plugins/platforms/xcb/gl_integrations/gl_integrations_plugin_base.pri28
-rw-r--r--src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglinclude.h2
-rw-r--r--src/plugins/platforms/xcb/gl_integrations/xcb_egl/xcb_egl.pro2
-rw-r--r--src/plugins/platforms/xcb/gl_integrations/xcb_glx/xcb_glx.pro7
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection.cpp8
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection.h3
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection_xi2.cpp9
-rw-r--r--src/plugins/platforms/xcb/qxcbintegration.cpp2
-rw-r--r--src/plugins/platforms/xcb/qxcbkeyboard.cpp12
-rw-r--r--src/plugins/platforms/xcb/qxcbkeyboard.h6
-rw-r--r--src/plugins/platforms/xcb/xcb.pro2
-rw-r--r--src/plugins/platforms/xcb/xcb_qpa_lib.pro55
-rw-r--r--src/plugins/platformthemes/gtk3/gtk3.pro3
-rw-r--r--src/plugins/platformthemes/gtk3/qgtk3dialoghelpers.cpp6
-rw-r--r--src/plugins/platformthemes/gtk3/qgtk3menu.cpp2
-rw-r--r--src/plugins/platformthemes/platformthemes.pro2
-rw-r--r--src/plugins/printsupport/cups/cups.pro2
-rw-r--r--src/plugins/printsupport/printsupport.pro6
-rw-r--r--src/plugins/sqldrivers/db2/db2.pro6
-rw-r--r--src/plugins/sqldrivers/ibase/ibase.pro9
-rw-r--r--src/plugins/sqldrivers/mysql/mysql.pro14
-rw-r--r--src/plugins/sqldrivers/oci/oci.pro7
-rw-r--r--src/plugins/sqldrivers/odbc/odbc.pro11
-rw-r--r--src/plugins/sqldrivers/psql/psql.pro8
-rw-r--r--src/plugins/sqldrivers/sqlite/sqlite.pro5
-rw-r--r--src/plugins/sqldrivers/sqlite2/sqlite2.pro2
-rw-r--r--src/plugins/sqldrivers/tds/tds.pro8
-rw-r--r--src/printsupport/dialogs/qabstractprintdialog.cpp8
-rw-r--r--src/printsupport/dialogs/qpagesetupdialog.cpp6
-rw-r--r--src/printsupport/kernel/kernel.pri2
-rw-r--r--src/printsupport/kernel/qprinter.cpp6
-rw-r--r--src/printsupport/widgets/widgets.pri2
-rw-r--r--src/sql/doc/src/qtsql.qdoc13
-rw-r--r--src/sql/doc/src/sql-driver.qdoc16
-rw-r--r--src/src.pro30
-rw-r--r--src/testlib/doc/src/qttestlib-manual.qdoc2
-rw-r--r--src/testlib/qtestblacklist.cpp3
-rw-r--r--src/testlib/qtestcase.cpp9
-rw-r--r--src/testlib/qtesttouch.h1
-rw-r--r--src/tools/bootstrap/bootstrap.pro6
-rw-r--r--src/tools/moc/keywords.cpp375
-rw-r--r--src/tools/moc/moc.cpp62
-rw-r--r--src/tools/moc/moc.h42
-rw-r--r--src/tools/moc/token.h3
-rw-r--r--src/tools/moc/util/generate_keywords.cpp3
-rw-r--r--src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp203
-rw-r--r--src/tools/uic/cpp/cppwritedeclaration.cpp21
-rw-r--r--src/tools/uic/cpp/cppwriteinitialization.cpp14
-rw-r--r--src/widgets/accessible/accessible.pri2
-rw-r--r--src/widgets/accessible/widgets.pro2
-rw-r--r--src/widgets/dialogs/images/qtlogo-64.pngbin1676 -> 1032 bytes
-rw-r--r--src/widgets/dialogs/qcolordialog.cpp8
-rw-r--r--src/widgets/dialogs/qfiledialog.cpp10
-rw-r--r--src/widgets/dialogs/qmessagebox.cpp20
-rw-r--r--src/widgets/dialogs/qwizard.cpp20
-rw-r--r--src/widgets/doc/snippets/code/src_gui_itemviews_qtablewidget.cpp4
-rw-r--r--src/widgets/doc/src/graphicsview.qdoc2
-rw-r--r--src/widgets/doc/src/widgets-and-layouts/focus.qdoc4
-rw-r--r--src/widgets/doc/src/widgets-and-layouts/styles.qdoc2
-rw-r--r--src/widgets/doc/src/widgets-and-layouts/stylesheet.qdoc8
-rw-r--r--src/widgets/doc/src/widgets-tutorial.qdoc2
-rw-r--r--src/widgets/graphicsview/qgraphicssceneevent.cpp2
-rw-r--r--src/widgets/itemviews/qabstractitemview.cpp8
-rw-r--r--src/widgets/itemviews/qabstractitemview.h5
-rw-r--r--src/widgets/itemviews/qdatawidgetmapper.cpp18
-rw-r--r--src/widgets/itemviews/qheaderview.cpp1
-rw-r--r--src/widgets/itemviews/qtreeview.h3
-rw-r--r--src/widgets/itemviews/qtreewidget.cpp1
-rw-r--r--src/widgets/kernel/kernel.pri2
-rw-r--r--src/widgets/kernel/qaction.cpp10
-rw-r--r--src/widgets/kernel/qapplication.cpp4
-rw-r--r--src/widgets/kernel/qdesktopwidget.qdoc2
-rw-r--r--src/widgets/kernel/qformlayout.cpp4
-rw-r--r--src/widgets/kernel/qopenglwidget.cpp4
-rw-r--r--src/widgets/kernel/qsizepolicy.cpp2
-rw-r--r--src/widgets/kernel/qwidget.cpp18
-rw-r--r--src/widgets/kernel/qwidget.h1
-rw-r--r--src/widgets/kernel/qwidgetaction.cpp6
-rw-r--r--src/widgets/styles/qmacstyle.qdoc12
-rw-r--r--src/widgets/styles/qmacstyle_mac.mm2
-rw-r--r--src/widgets/styles/qstyle.cpp6
-rw-r--r--src/widgets/styles/qstyleoption.cpp2
-rw-r--r--src/widgets/styles/styles.pri14
-rw-r--r--src/widgets/util/qscroller.cpp2
-rw-r--r--src/widgets/util/qsystemtrayicon.cpp15
-rw-r--r--src/widgets/util/util.pri2
-rw-r--r--src/widgets/widgets/qdialogbuttonbox.cpp4
-rw-r--r--src/widgets/widgets/qmaccocoaviewcontainer_mac.mm6
-rw-r--r--src/widgets/widgets/qmacnativewidget_mac.h4
-rw-r--r--src/widgets/widgets/qmacnativewidget_mac.mm4
-rw-r--r--src/widgets/widgets/qmainwindow.cpp2
-rw-r--r--src/widgets/widgets/qmenu.cpp2
-rw-r--r--src/widgets/widgets/qmenu_mac.mm8
-rw-r--r--src/widgets/widgets/qmenubar.cpp14
-rw-r--r--src/widgets/widgets/qrubberband.cpp2
-rw-r--r--src/widgets/widgets/qtabbar.cpp89
-rw-r--r--src/widgets/widgets/qtabbar_p.h3
-rw-r--r--src/widgets/widgets/qtabwidget.cpp2
-rw-r--r--src/widgets/widgets/qtoolbar.cpp2
-rw-r--r--src/widgets/widgets/qtoolbutton.cpp2
-rw-r--r--src/winmain/winmain.pro2
-rw-r--r--sync.profile4
-rw-r--r--tests/auto/auto.pro2
-rw-r--r--tests/auto/corelib/global/qflags/qflags.pro4
-rw-r--r--tests/auto/corelib/global/qlogging/test/test.pro4
-rw-r--r--tests/auto/corelib/io/io.pro4
-rw-r--r--tests/auto/corelib/io/qfile/tst_qfile.cpp12
-rw-r--r--tests/auto/corelib/io/qprocess/tst_qprocess.cpp15
-rw-r--r--tests/auto/corelib/io/qurl/tst_qurl.cpp16
-rw-r--r--tests/auto/corelib/io/qurlinternal/qurlinternal.pro2
-rw-r--r--tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp62
-rw-r--r--tests/auto/corelib/itemmodels/qstringlistmodel/tst_qstringlistmodel.cpp77
-rw-r--r--tests/auto/corelib/json/json.pro2
-rw-r--r--tests/auto/corelib/kernel/kernel.pro5
-rw-r--r--tests/auto/corelib/kernel/qcoreapplication/qcoreapplication.pro2
-rw-r--r--tests/auto/corelib/kernel/qdeadlinetimer/qdeadlinetimer.pro5
-rw-r--r--tests/auto/corelib/kernel/qdeadlinetimer/tst_qdeadlinetimer.cpp625
-rw-r--r--tests/auto/corelib/kernel/qeventloop/qeventloop.pro2
-rw-r--r--tests/auto/corelib/kernel/qsocketnotifier/qsocketnotifier.pro2
-rw-r--r--tests/auto/corelib/kernel/qvariant/qvariant.pro4
-rw-r--r--tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp55
-rw-r--r--tests/auto/corelib/mimetypes/mimetypes.pro2
-rw-r--r--tests/auto/corelib/plugin/qpluginloader/qpluginloader.pro2
-rw-r--r--tests/auto/corelib/plugin/qpluginloader/tst/tst.pro2
-rw-r--r--tests/auto/corelib/thread/qthreadstorage/tst_qthreadstorage.cpp14
-rw-r--r--tests/auto/corelib/tools/qcollator/qcollator.pro2
-rw-r--r--tests/auto/corelib/tools/qfreelist/qfreelist.pro2
-rw-r--r--tests/auto/corelib/tools/qlatin1string/qlatin1string.pro4
-rw-r--r--tests/auto/corelib/tools/qlocale/test/test.pro2
-rw-r--r--tests/auto/corelib/tools/qregularexpression/qregularexpression.pro2
-rw-r--r--tests/auto/corelib/tools/qstring/qstring.pro6
-rw-r--r--tests/auto/corelib/tools/qstring/tst_qstring.cpp64
-rw-r--r--tests/auto/corelib/tools/qstringapisymmetry/qstringapisymmetry.pro2
-rw-r--r--tests/auto/corelib/tools/qtimezone/qtimezone.pro2
-rw-r--r--tests/auto/corelib/tools/qvector/qvector.pro2
-rw-r--r--tests/auto/corelib/tools/qversionnumber/qversionnumber.pro4
-rw-r--r--tests/auto/dbus/dbus.pro2
-rw-r--r--tests/auto/dbus/qdbusconnection/tst_qdbusconnection.cpp19
-rw-r--r--tests/auto/dbus/qdbusmarshall/qdbusmarshall.pro2
-rw-r--r--tests/auto/dbus/qdbusmarshall/qdbusmarshall/qdbusmarshall.pro5
-rw-r--r--tests/auto/dbus/qdbustype/qdbustype.pro5
-rw-r--r--tests/auto/gui/gui.pro2
-rw-r--r--tests/auto/gui/image/image.pro2
-rw-r--r--tests/auto/gui/image/qimage/qimage.pro2
-rw-r--r--tests/auto/gui/image/qimage/tst_qimage.cpp45
-rw-r--r--tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp13
-rw-r--r--tests/auto/gui/image/qmovie/qmovie.pro4
-rw-r--r--tests/auto/gui/kernel/kernel.pro4
-rw-r--r--tests/auto/gui/kernel/noqteventloop/noqteventloop.pro2
-rw-r--r--tests/auto/gui/kernel/qwindow/qwindow.pro2
-rw-r--r--tests/auto/gui/painting/painting.pro2
-rw-r--r--tests/auto/gui/painting/qcolor/tst_qcolor.cpp2
-rw-r--r--tests/auto/gui/painting/qpathclipper/qpathclipper.pro2
-rw-r--r--tests/auto/gui/qopengl/qopengl.pro2
-rw-r--r--tests/auto/gui/text/qabstracttextdocumentlayout/BLACKLIST7
-rw-r--r--tests/auto/gui/text/qabstracttextdocumentlayout/tst_qabstracttextdocumentlayout.cpp4
-rw-r--r--tests/auto/gui/text/qcssparser/qcssparser.pro2
-rw-r--r--tests/auto/gui/text/qstatictext/qstatictext.pro2
-rw-r--r--tests/auto/gui/text/qtextpiecetable/qtextpiecetable.pro2
-rw-r--r--tests/auto/gui/text/qzip/tst_qzip.cpp2
-rw-r--r--tests/auto/gui/text/text.pro8
-rw-r--r--tests/auto/network/access/access.pro15
-rw-r--r--tests/auto/network/access/http2/http2.pro1
-rwxr-xr-x[-rw-r--r--]tests/auto/network/access/http2/http2srv.cpp183
-rwxr-xr-x[-rw-r--r--]tests/auto/network/access/http2/http2srv.h16
-rw-r--r--tests/auto/network/access/http2/tst_http2.cpp32
-rw-r--r--tests/auto/network/access/qftp/qftp.pro2
-rw-r--r--tests/auto/network/access/qhttpnetworkconnection/qhttpnetworkconnection.pro2
-rw-r--r--tests/auto/network/access/qhttpnetworkreply/qhttpnetworkreply.pro2
-rw-r--r--tests/auto/network/access/qnetworkreply/test/test.pro2
-rw-r--r--tests/auto/network/kernel/kernel.pro2
-rw-r--r--tests/auto/network/kernel/qauthenticator/qauthenticator.pro2
-rw-r--r--tests/auto/network/kernel/qhostinfo/qhostinfo.pro2
-rw-r--r--tests/auto/network/socket/platformsocketengine/platformsocketengine.pri2
-rw-r--r--tests/auto/network/socket/platformsocketengine/platformsocketengine.pro2
-rw-r--r--tests/auto/network/socket/platformsocketengine/tst_platformsocketengine.cpp1
-rw-r--r--tests/auto/network/socket/qhttpsocketengine/qhttpsocketengine.pro2
-rw-r--r--tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp1
-rw-r--r--tests/auto/network/socket/qsocks5socketengine/qsocks5socketengine.pro2
-rw-r--r--tests/auto/network/socket/qtcpsocket/qtcpsocket.pro2
-rw-r--r--tests/auto/network/socket/socket.pro4
-rw-r--r--tests/auto/network/ssl/qssldiffiehellmanparameters/tst_qssldiffiehellmanparameters.cpp8
-rw-r--r--tests/auto/network/ssl/qsslkey/qsslkey.pro2
-rw-r--r--tests/auto/network/ssl/qsslsocket/qsslsocket.pro4
-rw-r--r--tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp119
-rw-r--r--tests/auto/network/ssl/qsslsocket_onDemandCertificates_member/qsslsocket_onDemandCertificates_member.pro2
-rw-r--r--tests/auto/network/ssl/qsslsocket_onDemandCertificates_static/qsslsocket_onDemandCertificates_static.pro2
-rw-r--r--tests/auto/network/ssl/ssl.pro8
-rw-r--r--tests/auto/opengl/qglthreads/qglthreads.pro7
-rw-r--r--tests/auto/other/compiler/compiler.pro4
-rw-r--r--tests/auto/other/other.pro4
-rw-r--r--tests/auto/other/qaccessibility/qaccessibility.pro2
-rw-r--r--tests/auto/tools/moc/tst_moc.cpp110
-rw-r--r--tests/auto/tools/qmakelib/evaltest.cpp12
-rw-r--r--tests/auto/tools/uic/baseline/imagedialog.ui.h4
-rw-r--r--tests/auto/tools/uic/baseline/newdynamicpropertydialog.ui.h2
-rw-r--r--tests/auto/widgets/dialogs/dialogs.pro2
-rw-r--r--tests/auto/widgets/graphicsview/graphicsview.pro2
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp3
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicssceneindex/qgraphicssceneindex.pro2
-rw-r--r--tests/auto/widgets/itemviews/itemviews.pro2
-rw-r--r--tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp297
-rw-r--r--tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp5
-rw-r--r--tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp159
-rw-r--r--tests/auto/widgets/kernel/qwidget/BLACKLIST1
-rw-r--r--tests/auto/widgets/kernel/qwidget/qwidget.pro4
-rw-r--r--tests/auto/widgets/kernel/qwidget_window/qwidget_window.pro5
-rw-r--r--tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp5
-rw-r--r--tests/auto/widgets/styles/qstylesheetstyle/qstylesheetstyle.pro2
-rw-r--r--tests/auto/widgets/styles/styles.pro2
-rw-r--r--tests/auto/widgets/widgets/widgets.pro4
-rw-r--r--tests/benchmarks/corelib/thread/qreadwritelock/qreadwritelock.pro6
-rw-r--r--tests/benchmarks/corelib/thread/qreadwritelock/tst_qreadwritelock.cpp183
-rw-r--r--tests/benchmarks/corelib/thread/thread.pro1
-rw-r--r--tests/benchmarks/dbus/qdbustype/qdbustype.pro5
-rw-r--r--tests/benchmarks/gui/image/qimageconversion/qimageconversion.pro6
-rw-r--r--tests/benchmarks/gui/image/qimagereader/qimagereader.pro4
-rw-r--r--tests/benchmarks/gui/painting/painting.pro1
-rw-r--r--tests/benchmarks/gui/painting/qcolor/qcolor.pro7
-rw-r--r--tests/benchmarks/gui/painting/qcolor/tst_qcolor.cpp67
-rw-r--r--tests/benchmarks/network/kernel/kernel.pro2
-rw-r--r--tests/benchmarks/network/network.pro2
-rw-r--r--tests/manual/manual.pro6
-rw-r--r--tests/tests.pro2
-rw-r--r--tools/configure/configureapp.cpp3169
-rw-r--r--tools/configure/configureapp.h77
-rw-r--r--tools/configure/environment.cpp214
-rw-r--r--tools/configure/environment.h11
-rw-r--r--tools/configure/main.cpp28
786 files changed, 11489 insertions, 9090 deletions
diff --git a/.gitignore b/.gitignore
index 52b064109f..d583ffa12e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -116,6 +116,7 @@ bin/qt.conf
bin/servicefw*
bin/sfwlisten*
configure.cache
+config.opt
config.status
config.summary
config.log
diff --git a/bin/syncqt.pl b/bin/syncqt.pl
index 0c10ccbe14..7410762985 100755
--- a/bin/syncqt.pl
+++ b/bin/syncqt.pl
@@ -333,8 +333,8 @@ sub check_header {
my ($lib, $header, $iheader, $public_header, $private_header) = @_;
my $header_skip_qt_begin_namespace_test = 0;
+ return if ($ignore_for_include_check{$header});
if ($public_header) {
- return if ($ignore_for_include_check{$header});
$header_skip_qt_begin_namespace_test = 1 if ($ignore_for_qt_begin_namespace_check{$header});
}
@@ -879,6 +879,10 @@ loadSyncProfile(\$basedir, \$out_basedir);
@modules_to_sync = keys(%modules) if($#modules_to_sync == -1);
+for my $p (keys %inject_headers) {
+ push @ignore_for_include_check, @{$inject_headers{$p}};
+}
+
my %allmoduleheadersprivate = map { $_ => 1 } @allmoduleheadersprivate;
%ignore_for_include_check = map { $_ => 1 } @ignore_for_include_check;
%ignore_for_qt_begin_namespace_check = map { $_ => 1 } @ignore_for_qt_begin_namespace_check;
diff --git a/config.tests/common/libproxy/libproxy.pro b/config.tests/common/libproxy/libproxy.pro
index 51de2021ff..e3183d99e7 100644
--- a/config.tests/common/libproxy/libproxy.pro
+++ b/config.tests/common/libproxy/libproxy.pro
@@ -1,4 +1,3 @@
SOURCES = libproxy.cpp
CONFIG -= qt dylib
mac:CONFIG -= app_bundle
-LIBS += -lproxy
diff --git a/config.tests/common/pch/header.h b/config.tests/common/pch/header.h
new file mode 100644
index 0000000000..ebc22c4fb0
--- /dev/null
+++ b/config.tests/common/pch/header.h
@@ -0,0 +1 @@
+#define HEADER_H
diff --git a/config.tests/common/pch/pch.pro b/config.tests/common/pch/pch.pro
new file mode 100644
index 0000000000..a6f842dff0
--- /dev/null
+++ b/config.tests/common/pch/pch.pro
@@ -0,0 +1,3 @@
+CONFIG += precompile_header
+PRECOMPILED_HEADER = header.h
+SOURCES = source.cpp
diff --git a/config.tests/unix/javascriptcore-jit/hwcap_test.cpp b/config.tests/common/pch/source.cpp
index 560476963a..855672ffa8 100644
--- a/config.tests/unix/javascriptcore-jit/hwcap_test.cpp
+++ b/config.tests/common/pch/source.cpp
@@ -1,9 +1,9 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2016 The Qt Company.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the documentation of the Qt Toolkit.
+** This file is part of the configuration of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -36,9 +36,9 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-#include <asm/hwcap.h>
-int main (int argc, char **argv)
-{
- return 0;
-}
+#ifndef HEADER_H
+#error no go
+#endif
+
+int main() { return 0; }
diff --git a/config.tests/common/verifyspec/verifyspec.cpp b/config.tests/common/verifyspec/verifyspec.cpp
new file mode 100644
index 0000000000..bd5560bf02
--- /dev/null
+++ b/config.tests/common/verifyspec/verifyspec.cpp
@@ -0,0 +1 @@
+int main(int, char **) {}
diff --git a/config.tests/common/verifyspec/verifyspec.pro b/config.tests/common/verifyspec/verifyspec.pro
new file mode 100644
index 0000000000..d78ed2985a
--- /dev/null
+++ b/config.tests/common/verifyspec/verifyspec.pro
@@ -0,0 +1 @@
+SOURCES = verifyspec.cpp
diff --git a/config.tests/mac/corewlan/corewlan.pro b/config.tests/mac/corewlan/corewlan.pro
index 8db0c8c1e7..97e864f476 100644
--- a/config.tests/mac/corewlan/corewlan.pro
+++ b/config.tests/mac/corewlan/corewlan.pro
@@ -1,3 +1,2 @@
OBJECTIVE_SOURCES = corewlantest.mm
-LIBS += -framework CoreWLAN -framework Foundation
CONFIG -= qt
diff --git a/config.tests/qpa/direct2d/direct2d.pro b/config.tests/qpa/direct2d/direct2d.pro
index ab62a1da5c..98527b12a7 100644
--- a/config.tests/qpa/direct2d/direct2d.pro
+++ b/config.tests/qpa/direct2d/direct2d.pro
@@ -1,4 +1,3 @@
SOURCES = direct2d.cpp
-LIBS += -ld2d1 -ldwrite -ld3d11
CONFIG -= qt
CONFIG += console
diff --git a/config.tests/qpa/egl-x11/egl-x11.pro b/config.tests/qpa/egl-x11/egl-x11.pro
index aceb03dd78..fd8479ba35 100644
--- a/config.tests/qpa/egl-x11/egl-x11.pro
+++ b/config.tests/qpa/egl-x11/egl-x11.pro
@@ -1,12 +1,3 @@
SOURCES = egl-x11.cpp
-for(p, QMAKE_LIBDIR_EGL) {
- LIBS += -L$$p
-}
-
-!isEmpty(QMAKE_INCDIR_EGL): INCLUDEPATH += $$QMAKE_INCDIR_EGL
-!isEmpty(QMAKE_LIBS_EGL): LIBS += $$QMAKE_LIBS_EGL
-
CONFIG -= qt
-
-LIBS += -lxcb -lX11 -lX11-xcb
diff --git a/config.tests/qpa/egl/egl.pro b/config.tests/qpa/egl/egl.pro
index b5396dab15..2c4ae07e64 100644
--- a/config.tests/qpa/egl/egl.pro
+++ b/config.tests/qpa/egl/egl.pro
@@ -1,10 +1,3 @@
SOURCES = egl.cpp
-for(p, QMAKE_LIBDIR_EGL) {
- LIBS += -L$$p
-}
-
-!isEmpty(QMAKE_INCDIR_EGL): INCLUDEPATH += $$QMAKE_INCDIR_EGL
-!isEmpty(QMAKE_LIBS_EGL): LIBS += $$QMAKE_LIBS_EGL
-
CONFIG -= qt
diff --git a/config.tests/qpa/eglfs-brcm/eglfs-brcm.cpp b/config.tests/qpa/eglfs-brcm/eglfs-brcm.cpp
index 8a46ec9fff..e6ba06f89b 100644
--- a/config.tests/qpa/eglfs-brcm/eglfs-brcm.cpp
+++ b/config.tests/qpa/eglfs-brcm/eglfs-brcm.cpp
@@ -38,7 +38,6 @@
****************************************************************************/
#include <EGL/egl.h>
-#include <GLES2/gl2.h>
#include <bcm_host.h>
int main(int, char **)
diff --git a/config.tests/qpa/eglfs-brcm/eglfs-brcm.pro b/config.tests/qpa/eglfs-brcm/eglfs-brcm.pro
index d8b1c3ec7e..d4afa460f7 100644
--- a/config.tests/qpa/eglfs-brcm/eglfs-brcm.pro
+++ b/config.tests/qpa/eglfs-brcm/eglfs-brcm.pro
@@ -1,11 +1,3 @@
SOURCES = eglfs-brcm.cpp
CONFIG -= qt
-
-INCLUDEPATH += $$QMAKE_INCDIR_EGL
-
-for(p, QMAKE_LIBDIR_EGL) {
- LIBS += -L$$p
-}
-
-LIBS += -lEGL -lGLESv2 -lbcm_host
diff --git a/config.tests/qpa/eglfs-egldevice/eglfs-egldevice.cpp b/config.tests/qpa/eglfs-egldevice/eglfs-egldevice.cpp
index a2d69905e5..fa3e9d33f7 100644
--- a/config.tests/qpa/eglfs-egldevice/eglfs-egldevice.cpp
+++ b/config.tests/qpa/eglfs-egldevice/eglfs-egldevice.cpp
@@ -37,23 +37,13 @@
**
****************************************************************************/
-// Test both EGLDevice/Output/Stream and DRM as we only use them in combination.
-//
-// Other KMS/DRM tests relying on pkgconfig for libdrm are not suitable since
-// some systems do not use pkgconfig for the graphics stuff.
-
-#include <stdlib.h>
-#include <stdint.h>
#include <EGL/egl.h>
#include <EGL/eglext.h>
-#include <xf86drm.h>
-#include <xf86drmMode.h>
int main(int, char **)
{
EGLDeviceEXT device = 0;
EGLStreamKHR stream = 0;
EGLOutputLayerEXT layer = 0;
- drmModeCrtcPtr currentMode = drmModeGetCrtc(0, 0);
return EGL_DRM_CRTC_EXT;
}
diff --git a/config.tests/qpa/eglfs-egldevice/eglfs-egldevice.pro b/config.tests/qpa/eglfs-egldevice/eglfs-egldevice.pro
index d0945465a0..2f20d993f5 100644
--- a/config.tests/qpa/eglfs-egldevice/eglfs-egldevice.pro
+++ b/config.tests/qpa/eglfs-egldevice/eglfs-egldevice.pro
@@ -1,15 +1,3 @@
SOURCES = eglfs-egldevice.cpp
-for(p, QMAKE_LIBDIR_EGL) {
- LIBS += -L$$p
-}
-
-INCLUDEPATH += $$QMAKE_INCDIR_EGL
-LIBS += $$QMAKE_LIBS_EGL
-CONFIG += link_pkgconfig
-!contains(QT_CONFIG, no-pkg-config) {
- PKGCONFIG += libdrm
-} else {
- LIBS += -ldrm
-}
CONFIG -= qt
diff --git a/config.tests/qpa/eglfs-mali-2/eglfs-mali-2.pro b/config.tests/qpa/eglfs-mali-2/eglfs-mali-2.pro
index 85bcf6484a..de6f85f20f 100644
--- a/config.tests/qpa/eglfs-mali-2/eglfs-mali-2.pro
+++ b/config.tests/qpa/eglfs-mali-2/eglfs-mali-2.pro
@@ -1,5 +1,3 @@
SOURCES = eglfs-mali-2.cpp
CONFIG -= qt
-
-LIBS += -lEGL -lGLESv2
diff --git a/config.tests/qpa/eglfs-mali/eglfs-mali.pro b/config.tests/qpa/eglfs-mali/eglfs-mali.pro
index 132918c4bc..80f8282842 100644
--- a/config.tests/qpa/eglfs-mali/eglfs-mali.pro
+++ b/config.tests/qpa/eglfs-mali/eglfs-mali.pro
@@ -1,5 +1,3 @@
SOURCES = eglfs-mali.cpp
CONFIG -= qt
-
-LIBS += -lEGL -lGLESv2
diff --git a/config.tests/qpa/eglfs-viv/eglfs-viv.cpp b/config.tests/qpa/eglfs-viv/eglfs-viv.cpp
index 96935a2aa0..e6e17919dc 100644
--- a/config.tests/qpa/eglfs-viv/eglfs-viv.cpp
+++ b/config.tests/qpa/eglfs-viv/eglfs-viv.cpp
@@ -39,7 +39,6 @@
#include <EGL/egl.h>
#include <EGL/eglvivante.h>
-#include <GLES2/gl2.h>
int main(int, char **)
{
diff --git a/config.tests/qpa/eglfs-viv/eglfs-viv.pro b/config.tests/qpa/eglfs-viv/eglfs-viv.pro
index 3b36dc533f..2c3dc5cb01 100644
--- a/config.tests/qpa/eglfs-viv/eglfs-viv.pro
+++ b/config.tests/qpa/eglfs-viv/eglfs-viv.pro
@@ -5,12 +5,3 @@ integrity {
DEFINES += LINUX=1 EGL_API_FB=1
}
CONFIG -= qt
-
-LIBS += -lEGL -lGLESv2 -lGAL
-
-for(p, QMAKE_LIBDIR_OPENGL_ES2) {
- exists($$p):LIBS += -L$$p
-}
-
-!isEmpty(QMAKE_INCDIR_EGL): INCLUDEPATH += $$QMAKE_INCDIR_EGL
-!isEmpty(QMAKE_LIBS_EGL): LIBS += $$QMAKE_LIBS_EGL
diff --git a/config.tests/qpa/gbm/gbm.pro b/config.tests/qpa/gbm/gbm.pro
index 19177062a8..1c08eb4e67 100644
--- a/config.tests/qpa/gbm/gbm.pro
+++ b/config.tests/qpa/gbm/gbm.pro
@@ -1,4 +1,2 @@
SOURCES = gbm.cpp
-CONFIG += link_pkgconfig
-PKGCONFIG += gbm
CONFIG -= qt
diff --git a/config.tests/qpa/kms/kms.pro b/config.tests/qpa/kms/kms.pro
index 5147bc82da..c823914308 100644
--- a/config.tests/qpa/kms/kms.pro
+++ b/config.tests/qpa/kms/kms.pro
@@ -1,4 +1,2 @@
SOURCES = kms.cpp
-CONFIG += link_pkgconfig
-PKGCONFIG += libdrm
CONFIG -= qt
diff --git a/config.tests/qpa/mirclient/mirclient.pro b/config.tests/qpa/mirclient/mirclient.pro
index b397c2d08a..3e87194e4e 100644
--- a/config.tests/qpa/mirclient/mirclient.pro
+++ b/config.tests/qpa/mirclient/mirclient.pro
@@ -1,4 +1,2 @@
SOURCES = mirclient.cpp
-CONFIG += link_pkgconfig
-PKGCONFIG += egl mirclient ubuntu-platform-api
CONFIG -= qt
diff --git a/config.tests/qpa/wayland-server/wayland-server.pro b/config.tests/qpa/wayland-server/wayland-server.pro
index c07740d20f..969bc542bb 100644
--- a/config.tests/qpa/wayland-server/wayland-server.pro
+++ b/config.tests/qpa/wayland-server/wayland-server.pro
@@ -1,5 +1,3 @@
SOURCES = wl.cpp
CONFIG -= qt
-CONFIG += link_pkgconfig
-PKGCONFIG += wayland-server
diff --git a/config.tests/qpa/xcb-glx/xcb-glx.pro b/config.tests/qpa/xcb-glx/xcb-glx.pro
index d7fd1d7208..8086e3a388 100644
--- a/config.tests/qpa/xcb-glx/xcb-glx.pro
+++ b/config.tests/qpa/xcb-glx/xcb-glx.pro
@@ -1,5 +1,2 @@
SOURCES = xcb-glx.cpp
CONFIG -= qt
-
-LIBS += -lxcb -lxcb-glx
-
diff --git a/config.tests/qpa/xcb-render/xcb-render.pro b/config.tests/qpa/xcb-render/xcb-render.pro
index 3248b66a67..7555fa9b61 100644
--- a/config.tests/qpa/xcb-render/xcb-render.pro
+++ b/config.tests/qpa/xcb-render/xcb-render.pro
@@ -1,5 +1,2 @@
SOURCES = xcb-render.cpp
CONFIG -= qt
-
-LIBS += -lxcb -lxcb-render -lxcb-render-util
-
diff --git a/config.tests/qpa/xcb-syslibs/xcb-syslibs.pro b/config.tests/qpa/xcb-syslibs/xcb-syslibs.pro
index 23eedb03a7..6363ae90ee 100644
--- a/config.tests/qpa/xcb-syslibs/xcb-syslibs.pro
+++ b/config.tests/qpa/xcb-syslibs/xcb-syslibs.pro
@@ -1,5 +1,2 @@
SOURCES = xcb.cpp
CONFIG -= qt
-
-LIBS += -lxcb -lxcb-image -lxcb-keysyms -lxcb-icccm -lxcb-sync -lxcb-xfixes -lxcb-randr
-
diff --git a/config.tests/qpa/xcb-xkb/xcb-xkb.pro b/config.tests/qpa/xcb-xkb/xcb-xkb.pro
index a684a869d3..804be7b894 100644
--- a/config.tests/qpa/xcb-xkb/xcb-xkb.pro
+++ b/config.tests/qpa/xcb-xkb/xcb-xkb.pro
@@ -1,5 +1,2 @@
SOURCES = xcb-xkb.cpp
CONFIG -= qt
-
-LIBS += -lxcb -lxcb-xkb
-
diff --git a/config.tests/qpa/xcb-xlib/xcb-xlib.pro b/config.tests/qpa/xcb-xlib/xcb-xlib.pro
index 03250b4480..0e98a00fd0 100644
--- a/config.tests/qpa/xcb-xlib/xcb-xlib.pro
+++ b/config.tests/qpa/xcb-xlib/xcb-xlib.pro
@@ -1,5 +1,2 @@
SOURCES = xcb-xlib.cpp
CONFIG -= qt
-
-LIBS += -lxcb -lX11 -lX11-xcb
-
diff --git a/config.tests/qpa/xcb/xcb.pro b/config.tests/qpa/xcb/xcb.pro
index a48fdbd15f..6363ae90ee 100644
--- a/config.tests/qpa/xcb/xcb.pro
+++ b/config.tests/qpa/xcb/xcb.pro
@@ -1,5 +1,2 @@
SOURCES = xcb.cpp
CONFIG -= qt
-
-LIBS += -lxcb
-
diff --git a/config.tests/unix/alsa/alsa.pro b/config.tests/unix/alsa/alsa.pro
index 6d5d55bcfd..211e9bc899 100644
--- a/config.tests/unix/alsa/alsa.pro
+++ b/config.tests/unix/alsa/alsa.pro
@@ -1,3 +1,2 @@
SOURCES = alsatest.cpp
-LIBS+=-lasound
CONFIG -= qt dylib
diff --git a/config.tests/unix/bsymbolic_functions.test b/config.tests/unix/bsymbolic_functions.test
deleted file mode 100755
index 4d66ee6de0..0000000000
--- a/config.tests/unix/bsymbolic_functions.test
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/bin/sh
-
-BSYMBOLIC_FUNCTIONS_SUPPORT=no
-COMPILER=$1
-VERBOSE=$2
-
-
-cat >>bsymbolic_functions.c << EOF
-#if !(defined(__i386) || defined(__i386__) || defined(__x86_64) || defined(__x86_64__) || defined(__amd64))
-#error "Symbolic function binding on this architecture may be broken, disabling it (see QTBUG-36129)."
-#endif
-
-int main() { return 0; }
-EOF
-
-if [ "$VERBOSE" = "yes" ] ; then
- echo $COMPILER $SYSROOT_FLAG -o libtest.so -shared -Wl,-Bsymbolic-functions -fPIC bsymbolic_functions.c
- $COMPILER $SYSROOT_FLAG -o libtest.so -shared -Wl,-Bsymbolic-functions -fPIC bsymbolic_functions.c && BSYMBOLIC_FUNCTIONS_SUPPORT=yes
-else
- $COMPILER $SYSROOT_FLAG -o libtest.so -shared -Wl,-Bsymbolic-functions -fPIC bsymbolic_functions.c >/dev/null 2>&1 && BSYMBOLIC_FUNCTIONS_SUPPORT=yes
-fi
-rm -f bsymbolic_functions.c libtest.so
-
-# done
-if [ "$BSYMBOLIC_FUNCTIONS_SUPPORT" != "yes" ]; then
- [ "$VERBOSE" = "yes" ] && echo "Symbolic function binding disabled."
- exit 0
-else
- [ "$VERBOSE" = "yes" ] && echo "Symbolic function binding enabled."
- exit 1
-fi
diff --git a/config.tests/unix/cups/cups.pro b/config.tests/unix/cups/cups.pro
index 3f8ca99d0f..d19ce7d9a6 100644
--- a/config.tests/unix/cups/cups.pro
+++ b/config.tests/unix/cups/cups.pro
@@ -1,3 +1,2 @@
SOURCES = cups.cpp
CONFIG -= qt dylib
-LIBS += -lcups
diff --git a/config.tests/unix/db2/db2.pro b/config.tests/unix/db2/db2.pro
index b7316051f9..ef233fc184 100644
--- a/config.tests/unix/db2/db2.pro
+++ b/config.tests/unix/db2/db2.pro
@@ -1,3 +1,2 @@
SOURCES = db2.cpp
CONFIG -= qt dylib
-LIBS += -ldb2
diff --git a/config.tests/unix/dbus/dbus.pro b/config.tests/unix/dbus/dbus.pro
index c2a01ea269..f9d793b867 100644
--- a/config.tests/unix/dbus/dbus.pro
+++ b/config.tests/unix/dbus/dbus.pro
@@ -1,2 +1,8 @@
SOURCES = dbus.cpp
CONFIG -= qt
+
+CONFIG += build_all
+CONFIG(debug, debug|release): \
+ LIBS += $$LIBS_DEBUG
+else: \
+ LIBS += $$LIBS_RELEASE
diff --git a/config.tests/unix/doubleconversion/doubleconversion.pro b/config.tests/unix/doubleconversion/doubleconversion.pro
index ae435b9293..8253d0c2a5 100644
--- a/config.tests/unix/doubleconversion/doubleconversion.pro
+++ b/config.tests/unix/doubleconversion/doubleconversion.pro
@@ -1,4 +1,3 @@
SOURCES = doubleconversion.cpp
CONFIG -= qt
CONFIG += console
-LIBS += -ldouble-conversion
diff --git a/config.tests/unix/fontconfig/fontconfig.pro b/config.tests/unix/fontconfig/fontconfig.pro
index 8360774035..82dcfc80a0 100644
--- a/config.tests/unix/fontconfig/fontconfig.pro
+++ b/config.tests/unix/fontconfig/fontconfig.pro
@@ -1,4 +1,3 @@
SOURCES = fontconfig.cpp
CONFIG -= qt
-LIBS += -lfreetype -lfontconfig
include(../../unix/freetype/freetype.pri)
diff --git a/config.tests/unix/freetype/freetype.pro b/config.tests/unix/freetype/freetype.pro
index c0cc02d564..1a9f06909a 100644
--- a/config.tests/unix/freetype/freetype.pro
+++ b/config.tests/unix/freetype/freetype.pro
@@ -1,4 +1,3 @@
SOURCES = freetype.cpp
CONFIG -= qt
-LIBS += -lfreetype
include(freetype.pri)
diff --git a/config.tests/unix/fvisibility.test b/config.tests/unix/fvisibility.test
deleted file mode 100755
index 621af95e63..0000000000
--- a/config.tests/unix/fvisibility.test
+++ /dev/null
@@ -1,74 +0,0 @@
-#!/bin/sh
-
-FVISIBILITY_SUPPORT=no
-COMPILER=$1
-VERBOSE=$2
-
-CMDLINE=
-
-
-RunCompileTest() {
- cat >>fvisibility.c << EOF
-#if defined(__GNUC__)
-# if (__GNUC__ < 4)
-# error "GCC3 with backported visibility patch is known to miscompile Qt"
-# endif
-__attribute((visibility("default"))) void blah();
-#elif defined(__SUNPRO_CC)
-# if (__SUNPRO_CC < 0x0550)
-# error "SunStudio 8 or later is required for ELF visibility"
-# endif
-__global void blah();
-#else
-# error "GCC4+ or SunStudio 8+ are required to support ELF visibility"
-#endif
-EOF
-
- if [ "$VERBOSE" = "yes" ] ; then
- echo $COMPILER -c $CMDLINE fvisibility.c
- $COMPILER -c $CMDLINE fvisibility.c && FVISIBILITY_SUPPORT=yes
- else
- $COMPILER -c $CMDLINE fvisibility.c >/dev/null 2>&1 && FVISIBILITY_SUPPORT=yes
- fi
- rm -f fvisibility.c fvisibility.o
-}
-
-
-case "$COMPILER" in
-*g++*|*c++*|*qcc*)
- CMDLINE="-fvisibility=hidden"
- RunCompileTest
- ;;
-
-aCC*)
- ;;
-
-icpc)
- ICPC_VERSION=`icpc -dumpversion`
- case "$ICPC_VERSION" in
- 8.*|9.*|10.0)
- # 8.x, 9.x, and 10.0 don't support symbol visibility
- ;;
- *)
- # the compile test works for the intel compiler because it mimics gcc's behavior
- CMDLINE="-fvisibility=hidden"
- RunCompileTest
- ;;
- esac
- ;;
-
-CC)
- # This should be SunStudio. If not, it'll get caught.
- CMDLINE="-xldscope=hidden"
- RunCompileTest
- ;;
-esac
-
-# done
-if [ "$FVISIBILITY_SUPPORT" != "yes" ]; then
- [ "$VERBOSE" = "yes" ] && echo "Symbol visibility control disabled."
- exit 0
-else
- [ "$VERBOSE" = "yes" ] && echo "Symbol visibility control enabled."
- exit 1
-fi
diff --git a/config.tests/unix/getaddrinfo/getaddrinfo.pro b/config.tests/unix/getaddrinfo/getaddrinfo.pro
index cc739118fa..18e40971e5 100644
--- a/config.tests/unix/getaddrinfo/getaddrinfo.pro
+++ b/config.tests/unix/getaddrinfo/getaddrinfo.pro
@@ -1,3 +1,2 @@
SOURCES = getaddrinfotest.cpp
CONFIG -= qt dylib
-LIBS += $$QMAKE_LIBS_NETWORK
diff --git a/config.tests/unix/getifaddrs/getifaddrs.pro b/config.tests/unix/getifaddrs/getifaddrs.pro
index 14a89f87b8..db2956a338 100644
--- a/config.tests/unix/getifaddrs/getifaddrs.pro
+++ b/config.tests/unix/getifaddrs/getifaddrs.pro
@@ -1,4 +1,3 @@
SOURCES = getifaddrs.cpp
CONFIG -= qt
QT =
-LIBS += $$QMAKE_LIBS_NETWORK
diff --git a/config.tests/unix/gnu-libiconv/gnu-libiconv.pro b/config.tests/unix/gnu-libiconv/gnu-libiconv.pro
index 1ecf94390a..4008f882eb 100644
--- a/config.tests/unix/gnu-libiconv/gnu-libiconv.pro
+++ b/config.tests/unix/gnu-libiconv/gnu-libiconv.pro
@@ -1,3 +1,2 @@
SOURCES = gnu-libiconv.cpp
CONFIG -= qt dylib
-LIBS += -liconv
diff --git a/config.tests/unix/gstreamer/gstreamer.pro b/config.tests/unix/gstreamer/gstreamer.pro
index a5e158fa21..7b6fbb4d75 100644
--- a/config.tests/unix/gstreamer/gstreamer.pro
+++ b/config.tests/unix/gstreamer/gstreamer.pro
@@ -1,22 +1,4 @@
SOURCES += gstreamer.cpp
-CONFIG += link_pkgconfig
-
-gst-0.10 {
- PKGCONFIG_PRIVATE += \
- gstreamer-0.10 \
- gstreamer-base-0.10 \
- gstreamer-audio-0.10 \
- gstreamer-video-0.10 \
- gstreamer-pbutils-0.10
-} else:gst-1.0 {
- PKGCONFIG_PRIVATE += \
- gstreamer-1.0 \
- gstreamer-base-1.0 \
- gstreamer-audio-1.0 \
- gstreamer-video-1.0 \
- gstreamer-pbutils-1.0
-}
-
CONFIG -= qt
diff --git a/config.tests/unix/harfbuzz/harfbuzz.pro b/config.tests/unix/harfbuzz/harfbuzz.pro
index 32edd6e358..71a7c355cb 100644
--- a/config.tests/unix/harfbuzz/harfbuzz.pro
+++ b/config.tests/unix/harfbuzz/harfbuzz.pro
@@ -1,3 +1,2 @@
SOURCES = harfbuzz.cpp
CONFIG -= qt dylib
-LIBS += -lharfbuzz
diff --git a/config.tests/unix/ibase/ibase.pro b/config.tests/unix/ibase/ibase.pro
index 58787851e1..8c47f66954 100644
--- a/config.tests/unix/ibase/ibase.pro
+++ b/config.tests/unix/ibase/ibase.pro
@@ -1,3 +1,2 @@
SOURCES = ibase.cpp
CONFIG -= qt dylib
-LIBS += -lgds
diff --git a/config.tests/unix/icu/icu.pro b/config.tests/unix/icu/icu.pro
index f92d7cdfb8..eeed0eaff3 100644
--- a/config.tests/unix/icu/icu.pro
+++ b/config.tests/unix/icu/icu.pro
@@ -2,4 +2,8 @@ SOURCES = icu.cpp
CONFIG += console
CONFIG -= qt dylib
-include($$PWD/../../../src/3rdparty/icu_dependency.pri)
+CONFIG += build_all
+CONFIG(debug, debug|release): \
+ LIBS += $$LIBS_DEBUG
+else: \
+ LIBS += $$LIBS_RELEASE
diff --git a/config.tests/unix/iodbc/iodbc.cpp b/config.tests/unix/iodbc/iodbc.cpp
deleted file mode 100644
index 3ce12390c2..0000000000
--- a/config.tests/unix/iodbc/iodbc.cpp
+++ /dev/null
@@ -1,46 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE: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 <sql.h>
-#include <sqlext.h>
-
-int main(int, char **)
-{
- return 0;
-}
diff --git a/config.tests/unix/iodbc/iodbc.pro b/config.tests/unix/iodbc/iodbc.pro
deleted file mode 100644
index 68a0bd0ef4..0000000000
--- a/config.tests/unix/iodbc/iodbc.pro
+++ /dev/null
@@ -1,3 +0,0 @@
-SOURCES = iodbc.cpp
-CONFIG -= qt dylib
-LIBS += -liodbc
diff --git a/config.tests/unix/ipv6ifname/ipv6ifname.pro b/config.tests/unix/ipv6ifname/ipv6ifname.pro
index 88203a782c..7574dce180 100644
--- a/config.tests/unix/ipv6ifname/ipv6ifname.pro
+++ b/config.tests/unix/ipv6ifname/ipv6ifname.pro
@@ -1,4 +1,3 @@
SOURCES = ipv6ifname.cpp
CONFIG -= qt
QT =
-LIBS += $$QMAKE_LIBS_NETWORK
diff --git a/config.tests/unix/javascriptcore-jit/javascriptcore-jit.pro b/config.tests/unix/javascriptcore-jit/javascriptcore-jit.pro
deleted file mode 100644
index 0d5a20d7f3..0000000000
--- a/config.tests/unix/javascriptcore-jit/javascriptcore-jit.pro
+++ /dev/null
@@ -1,2 +0,0 @@
-SOURCES = hwcap_test.cpp
-CONFIG -= qt dylib
diff --git a/config.tests/unix/journald/journald.pro b/config.tests/unix/journald/journald.pro
index ea765642e6..deb28ae97f 100644
--- a/config.tests/unix/journald/journald.pro
+++ b/config.tests/unix/journald/journald.pro
@@ -1,10 +1,3 @@
SOURCES = journald.c
-CONFIG += link_pkgconfig
-
-packagesExist(libsystemd): \
- PKGCONFIG_PRIVATE += libsystemd
-else: \
- PKGCONFIG_PRIVATE += libsystemd-journal
-
CONFIG -= qt
diff --git a/config.tests/unix/lgmon/lgmon.pro b/config.tests/unix/lgmon/lgmon.pro
index 7bd094dc86..33633b19f8 100644
--- a/config.tests/unix/lgmon/lgmon.pro
+++ b/config.tests/unix/lgmon/lgmon.pro
@@ -1,3 +1,2 @@
SOURCES = lgmon.cpp
CONFIG -= qt
-LIBS += -llgmon
diff --git a/config.tests/unix/libdl/libdl.pro b/config.tests/unix/libdl/libdl.pro
deleted file mode 100644
index 4016395d35..0000000000
--- a/config.tests/unix/libdl/libdl.pro
+++ /dev/null
@@ -1,2 +0,0 @@
-include(../dlopen/dlopen.pro)
-LIBS += -ldl
diff --git a/config.tests/unix/libinput/libinput.pro b/config.tests/unix/libinput/libinput.pro
index 150119c504..941a0b73ef 100644
--- a/config.tests/unix/libinput/libinput.pro
+++ b/config.tests/unix/libinput/libinput.pro
@@ -1,4 +1,2 @@
SOURCES = libinput.cpp
CONFIG -= qt
-LIBS += $$QMAKE_LIBS_LIBINPUT
-INCLUDEPATH += $$QMAKE_INCDIR_LIBINPUT
diff --git a/config.tests/unix/libjpeg/libjpeg.pro b/config.tests/unix/libjpeg/libjpeg.pro
index 01329a11fe..173249c634 100644
--- a/config.tests/unix/libjpeg/libjpeg.pro
+++ b/config.tests/unix/libjpeg/libjpeg.pro
@@ -1,3 +1,2 @@
SOURCES = libjpeg.cpp
CONFIG -= qt dylib
-LIBS += -ljpeg
diff --git a/config.tests/unix/libpng/libpng.pro b/config.tests/unix/libpng/libpng.pro
index cdca43171c..72e5e77b06 100644
--- a/config.tests/unix/libpng/libpng.pro
+++ b/config.tests/unix/libpng/libpng.pro
@@ -1,8 +1,2 @@
SOURCES = libpng.cpp
CONFIG -= qt dylib
-!contains(QT_CONFIG, no-pkg-config) {
- CONFIG += link_pkgconfig
- PKGCONFIG += libpng
-} else {
- LIBS += -lpng
-}
diff --git a/config.tests/unix/libudev/libudev.pro b/config.tests/unix/libudev/libudev.pro
index 28b8980e2e..b557e7b17b 100644
--- a/config.tests/unix/libudev/libudev.pro
+++ b/config.tests/unix/libudev/libudev.pro
@@ -1,4 +1,2 @@
SOURCES = libudev.cpp
CONFIG -= qt
-LIBS += $$QMAKE_LIBS_LIBUDEV
-INCLUDEPATH += $$QMAKE_INCDIR_LIBUDEV
diff --git a/config.tests/unix/mtdev/mtdev.pro b/config.tests/unix/mtdev/mtdev.pro
index 4c7f76c89f..14111c6dc6 100644
--- a/config.tests/unix/mtdev/mtdev.pro
+++ b/config.tests/unix/mtdev/mtdev.pro
@@ -1,6 +1,3 @@
SOURCES = mtdev.cpp
-CONFIG += link_pkgconfig
-PKGCONFIG_PRIVATE += mtdev
-
CONFIG -= qt
diff --git a/config.tests/unix/mysql/mysql.cpp b/config.tests/unix/mysql/mysql.cpp
index 697148cbcb..3f83cb1e68 100644
--- a/config.tests/unix/mysql/mysql.cpp
+++ b/config.tests/unix/mysql/mysql.cpp
@@ -36,6 +36,9 @@
** $QT_END_LICENSE$
**
****************************************************************************/
+#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(WIN64) || defined(_WIN64) || defined(__WIN64__)
+#include <windows.h>
+#endif
#include "mysql.h"
diff --git a/config.tests/unix/mysql/mysql.pro b/config.tests/unix/mysql/mysql.pro
index 06d1880f08..745f9ee0fb 100644
--- a/config.tests/unix/mysql/mysql.pro
+++ b/config.tests/unix/mysql/mysql.pro
@@ -1,3 +1,2 @@
SOURCES = mysql.cpp
CONFIG -= qt dylib
-LIBS += -lmysqlclient
diff --git a/config.tests/unix/mysql_r/mysql_r.pro b/config.tests/unix/mysql_r/mysql_r.pro
deleted file mode 100644
index 096da69487..0000000000
--- a/config.tests/unix/mysql_r/mysql_r.pro
+++ /dev/null
@@ -1,3 +0,0 @@
-SOURCES = ../mysql/mysql.cpp
-CONFIG -= qt dylib
-LIBS += -lmysqlclient_r
diff --git a/config.tests/unix/oci/oci.pro b/config.tests/unix/oci/oci.pro
index 3ffda1ddd7..c9aec08ee0 100644
--- a/config.tests/unix/oci/oci.pro
+++ b/config.tests/unix/oci/oci.pro
@@ -1,3 +1,2 @@
SOURCES = oci.cpp
CONFIG -= qt dylib
-LIBS += -lclntsh
diff --git a/config.tests/unix/odbc/odbc.cpp b/config.tests/unix/odbc/odbc.cpp
index f4a52f9dac..fc36f121c4 100644
--- a/config.tests/unix/odbc/odbc.cpp
+++ b/config.tests/unix/odbc/odbc.cpp
@@ -37,7 +37,7 @@
**
****************************************************************************/
-#ifdef __MINGW32__
+#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(WIN64) || defined(_WIN64) || defined(__WIN64__)
#include <windows.h>
#endif
#include <sql.h>
@@ -45,5 +45,7 @@
int main(int, char **)
{
+ SQLHANDLE env;
+ SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &env);
return 0;
}
diff --git a/config.tests/unix/odbc/odbc.pro b/config.tests/unix/odbc/odbc.pro
index 70f3b668da..6c72dc7b1c 100644
--- a/config.tests/unix/odbc/odbc.pro
+++ b/config.tests/unix/odbc/odbc.pro
@@ -1,4 +1,2 @@
SOURCES = odbc.cpp
CONFIG -= qt dylib
-mingw:LIBS += -lodbc32
-else:LIBS += -lodbc
diff --git a/config.tests/unix/opengldesktop/opengldesktop.pro b/config.tests/unix/opengldesktop/opengldesktop.pro
index c3e700c50a..22c0be247d 100644
--- a/config.tests/unix/opengldesktop/opengldesktop.pro
+++ b/config.tests/unix/opengldesktop/opengldesktop.pro
@@ -1,11 +1,5 @@
SOURCES = opengldesktop.cpp
-INCLUDEPATH += $$QMAKE_INCDIR_OPENGL
-
-for(p, QMAKE_LIBDIR_OPENGL) {
- exists($$p):LIBS += -L$$p
-}
CONFIG -= qt
-LIBS += $$QMAKE_LIBS_OPENGL
mac:DEFINES += Q_OS_MAC
diff --git a/config.tests/unix/opengles2/opengles2.pro b/config.tests/unix/opengles2/opengles2.pro
index da30b453c6..c84563f62e 100644
--- a/config.tests/unix/opengles2/opengles2.pro
+++ b/config.tests/unix/opengles2/opengles2.pro
@@ -1,12 +1,7 @@
SOURCES = opengles2.cpp
-INCLUDEPATH += $$QMAKE_INCDIR_OPENGL_ES2
-
-for(p, QMAKE_LIBDIR_OPENGL_ES2) {
- LIBS += -L$$p
-}
CONFIG -= qt
-LIBS += $$QMAKE_LIBS_OPENGL_ES2
+
mac {
DEFINES += BUILD_ON_MAC
}
diff --git a/config.tests/unix/opengles3/opengles3.pro b/config.tests/unix/opengles3/opengles3.pro
index 720985f14d..956a3bc102 100644
--- a/config.tests/unix/opengles3/opengles3.pro
+++ b/config.tests/unix/opengles3/opengles3.pro
@@ -3,14 +3,9 @@
# the library.
SOURCES = opengles3.cpp
-INCLUDEPATH += $$QMAKE_INCDIR_OPENGL_ES2
-
-for(p, QMAKE_LIBDIR_OPENGL_ES2) {
- LIBS += -L$$p
-}
CONFIG -= qt
-LIBS += $$QMAKE_LIBS_OPENGL_ES2
+
mac {
DEFINES += BUILD_ON_MAC
}
diff --git a/config.tests/unix/opengles31/opengles31.pro b/config.tests/unix/opengles31/opengles31.pro
index 225180e1c6..7895be9efc 100644
--- a/config.tests/unix/opengles31/opengles31.pro
+++ b/config.tests/unix/opengles31/opengles31.pro
@@ -3,11 +3,5 @@
# the library.
SOURCES = opengles31.cpp
-INCLUDEPATH += $$QMAKE_INCDIR_OPENGL_ES2
-
-for(p, QMAKE_LIBDIR_OPENGL_ES2) {
- LIBS += -L$$p
-}
CONFIG -= qt
-LIBS += $$QMAKE_LIBS_OPENGL_ES2
diff --git a/config.tests/unix/pcre/pcre.pro b/config.tests/unix/pcre/pcre.pro
index 7b8bfc6545..a47e6d1e96 100644
--- a/config.tests/unix/pcre/pcre.pro
+++ b/config.tests/unix/pcre/pcre.pro
@@ -1,3 +1,2 @@
SOURCES = pcre.cpp
CONFIG -= qt dylib
-LIBS += -lpcre16
diff --git a/config.tests/unix/pps/pps.pro b/config.tests/unix/pps/pps.pro
index 21bdeedbfb..af9b339f97 100644
--- a/config.tests/unix/pps/pps.pro
+++ b/config.tests/unix/pps/pps.pro
@@ -1,3 +1,2 @@
SOURCES = pps.cpp
CONFIG -= qt
-LIBS += -lpps
diff --git a/config.tests/unix/precomp.test b/config.tests/unix/precomp.test
deleted file mode 100755
index 0b8377b21a..0000000000
--- a/config.tests/unix/precomp.test
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/bin/sh
-
-PRECOMP_SUPPORT=no
-COMPILER=$1
-VERBOSE=$2
-
-case "$COMPILER" in
-*icpc)
- cat >header.h <<EOF
-#define HEADER_H
-
-EOF
- >header.cpp
- cat >source.cpp <<EOF
-#ifndef HEADER_H
-#error no go
-#endif
-
-EOF
-
- rm -f header.pchi
- $COMPILER -pch-create header.pchi -include header.h -c header.cpp -o header.o >/dev/null 2>&1 \
- && $COMPILER -pch-use header.pchi -include header.h -c source.cpp -o source.o >/dev/null 2>&1 \
- && PRECOMP_SUPPORT=yes
-
- rm -f header.h header.cpp source.cpp
- rm -f header.pchi header.o source.o
- ;;
-
-*g++*|c++|*qcc*)
- case `"$COMPILER" -dumpversion 2>/dev/null` in
- 3.*)
- ;;
- *)
-
- >precomp_header.h
- if $COMPILER -x c-header precomp_header.h >/dev/null 2>&1; then
- $COMPILER -x c++-header precomp_header.h && PRECOMP_SUPPORT=yes
- fi
- rm -f precomp_header.h precomp_header.h.gch
- ;;
- esac
- ;;
-esac
-
-
-# done
-if [ "$PRECOMP_SUPPORT" != "yes" ]; then
- [ "$VERBOSE" = "yes" ] && echo "Precompiled-headers support disabled."
- exit 0
-else
- [ "$VERBOSE" = "yes" ] && echo "Precompiled-headers support enabled."
- exit 1
-fi
diff --git a/config.tests/unix/psql/psql.pro b/config.tests/unix/psql/psql.pro
index d0f3761bfb..dae7375be5 100644
--- a/config.tests/unix/psql/psql.pro
+++ b/config.tests/unix/psql/psql.pro
@@ -1,3 +1,2 @@
SOURCES = psql.cpp
CONFIG -= qt dylib
-LIBS *= -lpq
diff --git a/config.tests/unix/pulseaudio/pulseaudio.pro b/config.tests/unix/pulseaudio/pulseaudio.pro
index d75b16f41e..5e36c0aa81 100644
--- a/config.tests/unix/pulseaudio/pulseaudio.pro
+++ b/config.tests/unix/pulseaudio/pulseaudio.pro
@@ -1,3 +1,2 @@
SOURCES = pulseaudio.cpp
CONFIG -= qt
-LIBS +=
diff --git a/config.tests/unix/qqnx_imf/qqnx_imf.pro b/config.tests/unix/qqnx_imf/qqnx_imf.pro
index c51adb65ad..e1a2d9cecb 100644
--- a/config.tests/unix/qqnx_imf/qqnx_imf.pro
+++ b/config.tests/unix/qqnx_imf/qqnx_imf.pro
@@ -1,3 +1,2 @@
SOURCES = qqnx_imf.cpp
CONFIG -= qt
-LIBS += -linput_client
diff --git a/config.tests/x11/mitshm/mitshm.cpp b/config.tests/unix/reduce_exports/fvisibility.c
index fcc25d6eb4..71af9d99a3 100644
--- a/config.tests/x11/mitshm/mitshm.cpp
+++ b/config.tests/unix/reduce_exports/fvisibility.c
@@ -1,9 +1,9 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2016 The Qt Company.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the config.tests of the Qt Toolkit.
+** This file is part of the configuration of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -37,25 +37,16 @@
**
****************************************************************************/
-#ifdef Q_OS_HPUX
-#error "MITSHM not supported on HP-UX."
+#if defined(__GNUC__)
+# if (__GNUC__ < 4)
+# error "GCC3 with backported visibility patch is known to miscompile Qt"
+# endif
+__attribute((visibility("default"))) void blah();
+#elif defined(__SUNPRO_CC)
+# if (__SUNPRO_CC < 0x0550)
+# error "SunStudio 8 or later is required for ELF visibility"
+# endif
+__global void blah();
#else
-#include <X11/Xlib.h>
-#include <sys/ipc.h>
-#include <sys/shm.h>
-#include <X11/extensions/XShm.h>
-
-int main(int, char **)
-{
- Display *dpy = 0;
- int minor;
- int major;
- int pixmaps;
- if (dpy && XShmQueryVersion(dpy, &major, &minor, &pixmaps)) {
- minor = 0;
- major = 0;
- pixmaps = 0;
- }
- return 0;
-}
+# error "GCC4+ or SunStudio 8+ are required to support ELF visibility"
#endif
diff --git a/config.tests/unix/reduce_exports/reduce_exports.pro b/config.tests/unix/reduce_exports/reduce_exports.pro
new file mode 100644
index 0000000000..dc8adc2637
--- /dev/null
+++ b/config.tests/unix/reduce_exports/reduce_exports.pro
@@ -0,0 +1,5 @@
+TEMPLATE = lib
+CONFIG += dll hide_symbols
+SOURCES = fvisibility.c
+
+isEmpty(QMAKE_CFLAGS_HIDESYMS): error("Nope")
diff --git a/config.tests/x11/xfixes/xfixes.cpp b/config.tests/unix/reduce_relocs/bsymbolic_functions.c
index 12e402f175..36ff410c81 100644
--- a/config.tests/x11/xfixes/xfixes.cpp
+++ b/config.tests/unix/reduce_relocs/bsymbolic_functions.c
@@ -1,9 +1,9 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2016 The Qt Company.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the config.tests of the Qt Toolkit.
+** This file is part of the configuration of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -37,17 +37,8 @@
**
****************************************************************************/
-#include <X11/Xlib.h>
-#include <X11/extensions/Xfixes.h>
-
-#if XFIXES_MAJOR < 2
-# error "Required Xfixes version 2.0 not found."
+#if !(defined(__i386) || defined(__i386__) || defined(__x86_64) || defined(__x86_64__) || defined(__amd64))
+# error Symbolic function binding on this architecture may be broken, disabling it (see QTBUG-36129).
#endif
-int main(int, char **)
-{
- XFixesSelectionNotifyEvent event;
- event.type = 0;
- return 0;
-}
-
+int main() { return 0; }
diff --git a/config.tests/unix/reduce_relocs/reduce_relocs.pro b/config.tests/unix/reduce_relocs/reduce_relocs.pro
new file mode 100644
index 0000000000..2f23465a3f
--- /dev/null
+++ b/config.tests/unix/reduce_relocs/reduce_relocs.pro
@@ -0,0 +1,5 @@
+TEMPLATE = lib
+CONFIG += dll bsymbolic_functions
+SOURCES = bsymbolic_functions.c
+
+isEmpty(QMAKE_LFLAGS_BSYMBOLIC_FUNC): error("Nope")
diff --git a/config.tests/unix/sctp/sctp.pro b/config.tests/unix/sctp/sctp.pro
index edcc0a444a..2138254732 100644
--- a/config.tests/unix/sctp/sctp.pro
+++ b/config.tests/unix/sctp/sctp.pro
@@ -1,4 +1,3 @@
SOURCES = sctp.cpp
CONFIG -= qt
QT =
-LIBS += $$QMAKE_LIBS_NETWORK
diff --git a/config.tests/unix/slog2/slog2.pro b/config.tests/unix/slog2/slog2.pro
index e65460bb94..269a88a383 100644
--- a/config.tests/unix/slog2/slog2.pro
+++ b/config.tests/unix/slog2/slog2.pro
@@ -1,3 +1,2 @@
SOURCES = slog2.cpp
CONFIG -= qt
-LIBS += -lslog2
diff --git a/config.tests/unix/sqlite2/sqlite2.pro b/config.tests/unix/sqlite2/sqlite2.pro
index 7e69fdf2f3..b1252721dc 100644
--- a/config.tests/unix/sqlite2/sqlite2.pro
+++ b/config.tests/unix/sqlite2/sqlite2.pro
@@ -1,3 +1,2 @@
SOURCES = sqlite2.cpp
CONFIG -= qt dylib
-LIBS += -lsqlite
diff --git a/config.tests/unix/stdint/stdint.pro b/config.tests/unix/stdint/stdint.pro
deleted file mode 100644
index 9975484889..0000000000
--- a/config.tests/unix/stdint/stdint.pro
+++ /dev/null
@@ -1,3 +0,0 @@
-SOURCES = main.cpp
-CONFIG -= x11 qt
-
diff --git a/config.tests/unix/tds/tds.pro b/config.tests/unix/tds/tds.pro
index 6712779d58..f60fc0a602 100644
--- a/config.tests/unix/tds/tds.pro
+++ b/config.tests/unix/tds/tds.pro
@@ -1,3 +1,2 @@
SOURCES = tds.cpp
CONFIG -= qt dylib
-LIBS += -lsybdb
diff --git a/config.tests/unix/tslib/tslib.pro b/config.tests/unix/tslib/tslib.pro
index 1191120b89..6fc652dd96 100644
--- a/config.tests/unix/tslib/tslib.pro
+++ b/config.tests/unix/tslib/tslib.pro
@@ -1,3 +1,2 @@
SOURCES = tslib.cpp
CONFIG -= qt
-LIBS += -lts
diff --git a/config.tests/unix/zlib/zlib.pro b/config.tests/unix/zlib/zlib.pro
index d9bd03e5df..6a6b324611 100644
--- a/config.tests/unix/zlib/zlib.pro
+++ b/config.tests/unix/zlib/zlib.pro
@@ -1,3 +1,2 @@
SOURCES = zlib.cpp
CONFIG -= qt dylib
-LIBS += -lz
diff --git a/config.tests/win/directwrite/directwrite.pro b/config.tests/win/directwrite/directwrite.pro
index 9a4612ca11..88ff6ee2b8 100644
--- a/config.tests/win/directwrite/directwrite.pro
+++ b/config.tests/win/directwrite/directwrite.pro
@@ -1,4 +1,3 @@
SOURCES = directwrite.cpp
-LIBS += -ldwrite
CONFIG -= qt
CONFIG += console
diff --git a/config.tests/win/directwrite2/directwrite2.pro b/config.tests/win/directwrite2/directwrite2.pro
index ec37247017..5d6fe24a4b 100644
--- a/config.tests/win/directwrite2/directwrite2.pro
+++ b/config.tests/win/directwrite2/directwrite2.pro
@@ -1,4 +1,3 @@
SOURCES = directwrite2.cpp
-LIBS += -ldwrite
CONFIG -= qt
CONFIG += console
diff --git a/config.tests/x11/glxfbconfig/glxfbconfig.cpp b/config.tests/x11/glxfbconfig/glxfbconfig.cpp
deleted file mode 100644
index 9a2a0f166c..0000000000
--- a/config.tests/x11/glxfbconfig/glxfbconfig.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the config.tests of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <GL/gl.h>
-#include <GL/glx.h>
-
-int main(int, char **)
-{
- GLXFBConfig config;
- config = 0;
-
- return 0;
-}
diff --git a/config.tests/x11/glxfbconfig/glxfbconfig.pro b/config.tests/x11/glxfbconfig/glxfbconfig.pro
deleted file mode 100644
index 65f855a5f2..0000000000
--- a/config.tests/x11/glxfbconfig/glxfbconfig.pro
+++ /dev/null
@@ -1,10 +0,0 @@
-SOURCES = glxfbconfig.cpp
-CONFIG += x11
-INCLUDEPATH += $$QMAKE_INCDIR_OPENGL
-
-for(p, QMAKE_LIBDIR_OPENGL) {
- exists($$p):LIBS += -L$$p
-}
-
-CONFIG -= qt
-LIBS += -lGL
diff --git a/config.tests/x11/mitshm/mitshm.pro b/config.tests/x11/mitshm/mitshm.pro
deleted file mode 100644
index 8a40317d97..0000000000
--- a/config.tests/x11/mitshm/mitshm.pro
+++ /dev/null
@@ -1,5 +0,0 @@
-SOURCES = mitshm.cpp
-CONFIG += x11
-CONFIG -= qt
-LIBS += -lXext
-hpux*:DEFINES+=Q_OS_HPUX
diff --git a/config.tests/x11/notype.test b/config.tests/x11/notype.test
deleted file mode 100755
index 3a01d8f1d7..0000000000
--- a/config.tests/x11/notype.test
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/bin/sh
-
-QMKSPEC=$1
-XPLATFORM=`basename $1`
-VERBOSE=$2
-SRCDIR=$3
-OUTDIR=$4
-
-# debuggery
-[ "$VERBOSE" = "yes" ] && echo "Detecting broken X11 headers... ($*)"
-
-# Detect broken X11 headers when using GCC 2.95 or later
-# Xsun on Solaris 2.5.1:
-# Patches are available for Solaris 2.6, 7, and 8 but
-# not for Solaris 2.5.1.
-# HP-UX:
-# Patches are available for HP-UX 10.20, 11.00, and 11.11.
-# AIX 4.3.3 and AIX 5.1:
-# Headers are clearly broken on all AIX versions, and we
-# don't know of any patches. The strange thing is that we
-# did not get any reports about this issue until very
-# recently, long after gcc 3.0.x was released. It seems to
-# work for us with gcc 2.95.2.
-NOTYPE=no
-
-if [ $XPLATFORM = "solaris-g++" -o $XPLATFORM = "hpux-g++" -o $XPLATFORM = "aix-g++" -o $XPLATFORM = "aix-g++-64" ]; then
- NOTYPE=yes
-
- test -d "$OUTDIR/config.tests/x11/notype" || mkdir -p "$OUTDIR/config.tests/x11/notype"
- "$OUTDIR/bin/qmake" -nocache -spec "$QMKSPEC" "$SRCDIR/config.tests/x11/notype/notypetest.pro" -o "$OUTDIR/config.tests/x11/notype/Makefile" >/dev/null 2>&1
- cd "$OUTDIR/config.tests/x11/notype"
-
- if [ "$VERBOSE" = "yes" ]; then
- $MAKE
- else
- $MAKE >/dev/null 2>&1
- fi
-
- [ -x notypetest ] && NOTYPE=no
-fi
-
-# done
-if [ "$NOTYPE" = "yes" ]; then
- [ "$VERBOSE" = "yes" ] && echo "Broken X11 headers detected."
- exit 0
-else
- [ "$VERBOSE" = "yes" ] && echo "X11 headers look good."
- exit 1
-fi
diff --git a/config.tests/x11/notype/notypetest.pro b/config.tests/x11/notype/notypetest.pro
deleted file mode 100644
index 6ce2c62619..0000000000
--- a/config.tests/x11/notype/notypetest.pro
+++ /dev/null
@@ -1,5 +0,0 @@
-TEMPLATE=app
-TARGET=notypetest
-CONFIG-=qt
-CONFIG+=x11
-SOURCES=notypetest.cpp
diff --git a/config.tests/x11/opengl/opengl.cpp b/config.tests/x11/opengl/opengl.cpp
deleted file mode 100644
index e73c46b9e6..0000000000
--- a/config.tests/x11/opengl/opengl.cpp
+++ /dev/null
@@ -1,47 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the config.tests of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <GL/gl.h>
-
-int main(int, char **)
-{
- GLuint x;
- x = 0;
- return 0;
-}
diff --git a/config.tests/x11/opengl/opengl.pro b/config.tests/x11/opengl/opengl.pro
deleted file mode 100644
index d6814f1bd5..0000000000
--- a/config.tests/x11/opengl/opengl.pro
+++ /dev/null
@@ -1,11 +0,0 @@
-SOURCES = opengl.cpp
-CONFIG += x11
-INCLUDEPATH += $$QMAKE_INCDIR_OPENGL
-
-for(p, QMAKE_LIBDIR_OPENGL) {
- exists($$p):LIBS += -L$$p
-}
-
-CONFIG -= qt
-mingw:LIBS += -lopengl32
-else:LIBS += -lGL
diff --git a/config.tests/x11/xcursor/xcursor.pro b/config.tests/x11/xcursor/xcursor.pro
deleted file mode 100644
index b1e69be29a..0000000000
--- a/config.tests/x11/xcursor/xcursor.pro
+++ /dev/null
@@ -1,4 +0,0 @@
-SOURCES = xcursor.cpp
-CONFIG += x11
-CONFIG -= qt
-LIBS += -lXcursor
diff --git a/config.tests/x11/xfixes/xfixes.pro b/config.tests/x11/xfixes/xfixes.pro
deleted file mode 100644
index cc94a11bc2..0000000000
--- a/config.tests/x11/xfixes/xfixes.pro
+++ /dev/null
@@ -1,3 +0,0 @@
-CONFIG += x11
-CONFIG -= qt
-SOURCES = xfixes.cpp
diff --git a/config.tests/x11/xinput2/xinput2.pro b/config.tests/x11/xinput2/xinput2.pro
index ae8819b3d1..4788f0e14b 100644
--- a/config.tests/x11/xinput2/xinput2.pro
+++ b/config.tests/x11/xinput2/xinput2.pro
@@ -1,4 +1,3 @@
CONFIG += x11
CONFIG -= qt
-LIBS += -lXi
SOURCES = xinput2.cpp
diff --git a/config.tests/x11/xkb/xkb.pro b/config.tests/x11/xkb/xkb.pro
deleted file mode 100644
index d4ec2223df..0000000000
--- a/config.tests/x11/xkb/xkb.pro
+++ /dev/null
@@ -1,3 +0,0 @@
-SOURCES = xkb.cpp
-CONFIG += x11
-CONFIG -= qt
diff --git a/config.tests/x11/xrandr/xrandr.cpp b/config.tests/x11/xrandr/xrandr.cpp
deleted file mode 100644
index 4fb8a1b94c..0000000000
--- a/config.tests/x11/xrandr/xrandr.cpp
+++ /dev/null
@@ -1,52 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the config.tests of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <X11/Xlib.h>
-#include <X11/extensions/Xrandr.h>
-
-#if RANDR_MAJOR != 1 || RANDR_MINOR < 1
-# error "Requried Xrandr version 1.1 not found."
-#endif
-
-int main(int, char **)
-{
- XRRScreenSize *size;
- size = 0;
- return 0;
-}
diff --git a/config.tests/x11/xrandr/xrandr.pro b/config.tests/x11/xrandr/xrandr.pro
deleted file mode 100644
index 3fb2910b5e..0000000000
--- a/config.tests/x11/xrandr/xrandr.pro
+++ /dev/null
@@ -1,4 +0,0 @@
-SOURCES = xrandr.cpp
-CONFIG += x11
-CONFIG -= qt
-LIBS += -lXrender -lXrandr
diff --git a/config.tests/x11/xrender/xrender.pro b/config.tests/x11/xrender/xrender.pro
index e7786420fa..ab5c5efa77 100644
--- a/config.tests/x11/xrender/xrender.pro
+++ b/config.tests/x11/xrender/xrender.pro
@@ -1,4 +1,3 @@
SOURCES = xrender.cpp
CONFIG += x11
CONFIG -= qt
-LIBS += -lXrender
diff --git a/config.tests/x11/xshape/xshape.cpp b/config.tests/x11/xshape/xshape.cpp
deleted file mode 100644
index 804a9d044e..0000000000
--- a/config.tests/x11/xshape/xshape.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the config.tests of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-#include <X11/extensions/shape.h>
-
-int main(int, char **)
-{
- XShapeEvent shapeevent;
- shapeevent.type = 0;
- return 0;
-}
diff --git a/config.tests/x11/xshape/xshape.pro b/config.tests/x11/xshape/xshape.pro
deleted file mode 100644
index 611c048e39..0000000000
--- a/config.tests/x11/xshape/xshape.pro
+++ /dev/null
@@ -1,3 +0,0 @@
-CONFIG += x11
-CONFIG -= qt
-SOURCES = xshape.cpp
diff --git a/config.tests/x11/xsync/xsync.cpp b/config.tests/x11/xsync/xsync.cpp
deleted file mode 100644
index 48feefdb4a..0000000000
--- a/config.tests/x11/xsync/xsync.cpp
+++ /dev/null
@@ -1,54 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the config.tests of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-extern "C" {
-#include <X11/extensions/sync.h>
-}
-
-int main(int, char **)
-{
- XSyncValue value;
- (void*)&XSyncIntToValue;
- (void*)&XSyncCreateCounter;
- int a, b;
- Status ret = XSyncInitialize(NULL, &a, &b);
- return ret;
-}
diff --git a/config.tests/x11/xsync/xsync.pro b/config.tests/x11/xsync/xsync.pro
deleted file mode 100644
index 58b82383ea..0000000000
--- a/config.tests/x11/xsync/xsync.pro
+++ /dev/null
@@ -1,3 +0,0 @@
-CONFIG += x11
-CONFIG -= qt
-SOURCES = xsync.cpp
diff --git a/config_help.txt b/config_help.txt
index 2ea2a812e4..76c0c60348 100644
--- a/config_help.txt
+++ b/config_help.txt
@@ -1,431 +1,299 @@
-Usage: configure [options]
-
-Installation options:
-
- These are optional, but you may specify install directories.
-
- -prefix <dir> ...... The deployment directory, as seen on the target device.
- (default /usr/local/Qt-$QT_VERSION, $PWD if -developer-build is active)
-
- -extprefix <dir> ... The installation directory, as seen on the host machine.
- (default SYSROOT/PREFIX)
-
- -hostprefix [dir] .. The installation directory for build tools running on the
- host machine. If [dir] is not given, the current build
- directory will be used. (default EXTPREFIX)
-
- You may use these to change the layout of the install. Note that all directories
- except -sysconfdir should be located under -prefix/-hostprefix:
-
- -bindir <dir> ......... User executables will be installed to <dir>
- (default PREFIX/bin)
- -headerdir <dir> ...... Headers will be installed to <dir>
- (default PREFIX/include)
- -libdir <dir> ......... Libraries will be installed to <dir>
- (default PREFIX/lib)
- -archdatadir <dir> .... Arch-dependent data used by Qt will be installed to <dir>
- (default PREFIX)
- -plugindir <dir> ...... Plugins will be installed to <dir>
- (default ARCHDATADIR/plugins)
- -libexecdir <dir> ..... Program executables will be installed to <dir>
- (default ARCHDATADIR/libexec, ARCHDATADIR/bin for MinGW)
- -importdir <dir> ...... Imports for QML1 will be installed to <dir>
- (default ARCHDATADIR/imports)
- -qmldir <dir> ......... Imports for QML2 will be installed to <dir>
- (default ARCHDATADIR/qml)
- -datadir <dir> ........ Arch-independent data used by Qt will be installed to <dir>
- (default PREFIX)
- -docdir <dir> ......... Documentation will be installed to <dir>
- (default DATADIR/doc)
- -translationdir <dir> . Translations of Qt programs will be installed to <dir>
- (default DATADIR/translations)
- -sysconfdir <dir> ..... Settings used by Qt programs will be looked for in <dir>
- (default PREFIX/etc/xdg)
- -examplesdir <dir> .... Examples will be installed to <dir>
- (default PREFIX/examples)
- -testsdir <dir> ....... Tests will be installed to <dir>
- (default PREFIX/tests)
-
- -hostbindir <dir> ..... Host executables will be installed to <dir>
- (default HOSTPREFIX/bin)
- -hostlibdir <dir> ..... Host libraries will be installed to <dir>
- (default HOSTPREFIX/lib)
- -hostdatadir <dir> .... Data used by qmake will be installed to <dir>
- (default HOSTPREFIX)
-
-Configure options:
-
- The defaults (*) are usually acceptable. A plus (+) denotes a default value
- that needs to be evaluated. If the evaluation succeeds, the feature is
- included. Here is a short explanation of each option:
-
- * -release ............. Compile and link Qt with debugging turned off.
- -debug ............... Compile and link Qt with debugging turned on.
- -debug-and-release ... Compile and link two versions of Qt, with and without
- debugging turned on (Apple platforms only).
-
- -force-debug-info .... Create symbol files for release builds.
-
- -developer-build ..... Compile and link Qt with Qt developer options (including auto-tests exporting)
-
- * -no-optimized-tools .. Do not build optimized host tools even in debug build.
- -optimized-tools ..... Build optimized host tools even in debug build.
-
- -opensource .......... Compile and link the Open-Source Edition of Qt.
- -commercial .......... Compile and link the Commercial Edition of Qt.
-
- -confirm-license ..... Automatically acknowledge the license (use with
- either -opensource or -commercial)
-
- -c++std <edition> .... Compile Qt with C++ standard edition (c++11, c++14, c++1z)
- Default: highest supported
-
- * -shared .............. Create and use shared Qt libraries.
- -static .............. Create and use static Qt libraries.
-
- -no-accessibility .... Do not compile Accessibility support.
- Disabling accessibility is not recommended, as it will break QStyle
- and may break other internal parts of Qt.
- With this switch you create a source incompatible version of Qt,
- which is unsupported.
- + -accessibility ....... Compile Accessibility support.
-
- -no-sql-<driver> ..... Disable SQL <driver>.
- -sql-<driver> Enable SQL <driver> plugin.
-
- Possible values for <driver>:
- [db2, ibase, mysql, oci, odbc, psql, sqlite, sqlite2, tds]
-
- -system-sqlite ....... Use sqlite from the operating system.
-
- -no-qml-debug ........ Do not build the in-process QML debugging support.
- + -qml-debug ........... Build the QML debugging support.
-
- -platform target ..... The operating system and compiler you are building
- on (default detected from host system).
-
- See the README file for a list of supported
- operating systems and compilers.
-
- -no-sse2 ............. Do not compile with use of SSE2 instructions.
- -no-sse3 ............. Do not compile with use of SSE3 instructions.
- -no-ssse3 ............ Do not compile with use of SSSE3 instructions.
- -no-sse4.1 ........... Do not compile with use of SSE4.1 instructions.
- -no-sse4.2 ........... Do not compile with use of SSE4.2 instructions.
- -no-avx .............. Do not compile with use of AVX instructions.
- -no-avx2 ............. Do not compile with use of AVX2 instructions.
- -no-avx512 ........... Do not compile with use of AVX512 instructions.
- -no-mips_dsp ......... Do not compile with use of MIPS DSP instructions.
- -no-mips_dspr2 ....... Do not compile with use of MIPS DSP rev2 instructions.
-
- -qtnamespace <name> .. Wraps all Qt library code in 'namespace <name> {...}'.
- -qtlibinfix <infix> .. Renames all libQt*.so to libQt*<infix>.so.
-
- -testcocoon .......... Instrument Qt with the TestCocoon code coverage tool.
- -gcov ................ Instrument Qt with the GCov code coverage tool.
-
- -D <string> .......... Add an explicit define to the preprocessor.
- -I <string> .......... Add an explicit include path.
- -L <string> .......... Add an explicit library path.
-
- + -pkg-config .......... Use pkg-config to detect include and library paths. By default,
- configure determines whether to use pkg-config or not with
- some heuristics such as checking the environment variables.
- -no-pkg-config ....... Disable use of pkg-config.
- -force-pkg-config .... Force usage of pkg-config (skips pkg-config usability
- detection heuristic).
-
- -help, -h ............ Display this information.
-
-Third Party Libraries:
-
- -qt-zlib ............. Use the zlib bundled with Qt.
- + -system-zlib ......... Use zlib from the operating system.
- See http://www.gzip.org/zlib
-
- -no-mtdev ............ Do not compile mtdev support.
- + -mtdev ............... Enable mtdev support.
-
- + -no-journald ......... Do not send logging output to journald.
- -journald ............ Send logging output to journald.
-
- + -no-syslog ........... Do not send logging output to syslog.
- -syslog .............. Send logging output to syslog.
-
- -no-gif .............. Do not compile GIF reading support.
-
- -no-libpng ........... Do not compile PNG support.
- -qt-libpng ........... Use the libpng bundled with Qt.
- + -system-libpng ....... Use libpng from the operating system.
- See http://www.libpng.org/pub/png
-
- -no-libjpeg .......... Do not compile JPEG support.
- -qt-libjpeg .......... Use the libjpeg bundled with Qt.
- + -system-libjpeg ...... Use libjpeg from the operating system.
- See http://www.ijg.org
-
- -no-doubleconversion ..... Use sscanf_l and snprintf_l for (imprecise) double conversion.
- -qt-doubleconversion ..... Use the libdouble-conversion bundled with Qt.
- + -system-doubleconversion . Use the libdouble-conversion provided by the system.
- See https://github.com/google/double-conversion
-
- -no-freetype ......... Do not compile in Freetype2 support.
- -qt-freetype ......... Use the libfreetype bundled with Qt.
- + -system-freetype...... Use the libfreetype provided by the system (enabled if -fontconfig is active).
- See http://www.freetype.org
-
- -no-harfbuzz ......... Do not compile HarfBuzz-NG support.
- -qt-harfbuzz ......... Use HarfBuzz-NG bundled with Qt to do text shaping.
- It can still be disabled by setting
- the QT_HARFBUZZ environment variable to "old".
- + -system-harfbuzz ..... Use HarfBuzz-NG from the operating system
- to do text shaping. It can still be disabled
- by setting the QT_HARFBUZZ environment variable to "old".
- See http://www.harfbuzz.org
-
- -no-openssl .......... Do not compile support for OpenSSL.
- + -openssl ............. Enable run-time OpenSSL support.
- -openssl-linked ...... Enabled linked OpenSSL support.
-
- * -no-libproxy ......... Do not compile support for libproxy
- -libproxy ............ Use libproxy from the operating system.
-
- -qt-pcre ............. Use the PCRE library bundled with Qt.
- + -system-pcre ......... Use the PCRE library from the operating system.
-
- -qt-xcb .............. Use xcb- libraries bundled with Qt.
- (libxcb.so will still be used from operating system).
- + -system-xcb .......... Use xcb- libraries from the operating system.
-
- -xkb-config-root ..... Set default XKB config root. This option is used only together with -qt-xkbcommon-x11.
- -qt-xkbcommon-x11 .... Use the xkbcommon library bundled with Qt in combination with xcb.
- + -system-xkbcommon-x11 Use the xkbcommon library from the operating system in combination with xcb.
-
- -no-xkbcommon-evdev .. Do not use X-less xkbcommon when compiling libinput support.
- * -xkbcommon-evdev ..... Use X-less xkbcommon when compiling libinput support.
-
- -no-xinput2 .......... Do not compile XInput2 support.
- * -xinput2 ............. Compile XInput2 support.
-
- -no-xcb-xlib.......... Do not compile Xcb-Xlib support.
- * -xcb-xlib............. Compile Xcb-Xlib support.
-
- -no-glib ............. Do not compile Glib support.
- + -glib ................ Compile Glib support.
-
- -no-pulseaudio ....... Do not compile PulseAudio support.
- + -pulseaudio .......... Compile PulseAudio support.
-
- -no-alsa ............. Do not compile ALSA support.
- + -alsa ................ Compile ALSA support.
-
- -no-gtk .............. Do not compile GTK platform theme support.
- + -gtk ................. Compile GTK platform theme support.
-
-Additional options:
-
- -make <part> ......... Add part to the list of parts to be built at make time.
- (defaults to: libs tools examples)
- -nomake <part> ....... Exclude part from the list of parts to be built.
-
- -skip <module> ....... Exclude an entire module from the build.
-
- -no-compile-examples . Install only the sources of examples.
-
- -no-gui .............. Don't build the Qt GUI module and dependencies.
- + -gui ................. Build the Qt GUI module and dependencies.
-
- -no-widgets .......... Don't build the Qt Widgets module and dependencies.
- + -widgets ............. Build the Qt Widgets module and dependencies.
-
- -R <string> .......... Add an explicit runtime library path to the Qt
- libraries.
-
- -no-rpath ............ Do not use the library install path as a runtime
- library path. On Apple platforms, this implies using
- absolute install names (based in -libdir) for dynamic
- libraries and frameworks.
- + -rpath ............... Link Qt libraries and executables using the library
- install path as a runtime library path. Equivalent
- to -R install_libpath
-
- -continue ............ Continue as far as possible if an error occurs.
-
- -verbose, -v ......... Print verbose information about each step of the
- configure process.
-
- -silent .............. Reduce the build output so that warnings and errors
- can be seen more easily.
-
- -no-cups ............. Do not compile CUPS support.
- * -cups ................ Compile CUPS support.
- Requires cups/cups.h and libcups.so.2.
-
- -no-iconv ............ Do not compile support for iconv(3).
- * -iconv ............... Compile support for iconv(3).
-
- -no-evdev ............ Do not compile support for evdev.
- * -evdev ............... Compile support for evdev.
-
- -no-tslib ............ Do not compile support for tslib.
- * -tslib ............... Compile support for tslib.
-
- -no-icu .............. Do not compile support for ICU libraries.
- + -icu ................. Compile support for ICU libraries.
-
- -no-fontconfig ....... Do not compile FontConfig support.
- + -fontconfig .......... Compile FontConfig support.
-
- -no-strip ............ Do not strip binaries and libraries of unneeded symbols.
- * -strip ............... Strip binaries and libraries of unneeded symbols when installing.
-
- * -no-pch .............. Do not use precompiled header support.
- -pch ................. Use precompiled header support.
-
- * -no-ltcg Do not use Link Time Code Generation
- -ltcg Use Link Time Code Generation.
-
- -no-dbus ............. Do not compile the Qt D-Bus module.
- + -dbus-linked ......... Compile the Qt D-Bus module and link to libdbus-1.
- -dbus-runtime ........ Compile the Qt D-Bus module and dynamically load libdbus-1.
-
- -reduce-relocations .. Reduce relocations in the libraries through extra
- linker optimizations (Qt/X11 and Qt for Embedded Linux only;
- experimental; needs GNU ld >= 2.18).
-
- -no-use-gold-linker .. Do not link using the GNU gold linker.
- + -use-gold-linker ..... Link using the GNU gold linker if available.
-
- -force-asserts ....... Force Q_ASSERT to be enabled even in release builds.
-
- -sanitize [address|thread|memory|undefined] Enables the specified compiler sanitizer.
-
- -device <name> ............... Cross-compile for device <name> (experimental)
- -device-option <key=value> ... Add device specific options for the device mkspec
- (experimental)
-
- -host-option <key=value> ..... Add host specific options for the host mkspec
-
- * -no-separate-debug-info ...... Do not store debug information in a separate file.
- -separate-debug-info ......... Strip debug information into a separate file.
-
- -no-xcb .............. Do not compile Xcb (X protocol C-language Binding) support.
- * -xcb ................. Compile Xcb support.
-
- -no-eglfs ............ Do not compile EGLFS (EGL Full Screen/Single Surface) support.
- * -eglfs ............... Compile EGLFS support.
-
- -no-kms .............. Do not compile backends for KMS.
- * -kms ................. Compile backends for KMS.
-
- -no-gbm .............. Do not compile backends for GBM.
- * -gbm ................. Compile backends for GBM.
-
- * -no-directfb ......... Do not compile DirectFB support.
- -directfb ............ Compile DirectFB support.
-
- -no-linuxfb .......... Do not compile Linux Framebuffer support.
- * -linuxfb ............. Compile Linux Framebuffer support.
-
- * -no-mirclient......... Do not compile Mir client support.
- -mirclient............ Compile Mir client support.
-
- -qpa <name> .......... Sets the default QPA platform (e.g xcb, cocoa, windows).
-
- -xplatform target .... The target platform when cross-compiling.
-
- -sysroot <dir> ....... Sets <dir> as the target compiler's and qmake's sysroot and also sets pkg-config paths.
- -no-gcc-sysroot ...... When using -sysroot, it disables the passing of --sysroot to the compiler
-
- -external-hostbindir <path> .. Path to Qt tools built for this machine. Use this when -platform
- does not match the current system, i.e., to make a Canadian Cross Build.
-
- -no-feature-<feature> Do not compile in <feature>.
- -feature-<feature> ... Compile in <feature>. The available features
- are described in src/corelib/global/qfeatures.txt
-
- -qreal [double|float] typedef qreal to the specified type. The default is double.
- Note that changing this flag affects binary compatibility.
-
- -no-opengl ........... Do not support OpenGL.
- -opengl <api> ........ Enable OpenGL support
- With no parameter, this will attempt to auto-detect
- OpenGL ES 2.0 and higher, or regular desktop OpenGL.
- Use es2 for <api> to override auto-detection.
-
- -no-libinput ......... Do not support libinput.
- * -libinput ............ Enable libinput support.
-
- -no-gstreamer ........ Do not support GStreamer.
- + -gstreamer <version> . Enable GStreamer support
- With no parameter, this will attempt to auto-detect GStreamer 0.10 and
- 1.0. GStreamer 1.0 is used by default when available.
- Use 0.10 or 1.0 for <version> to override auto-detection.
-
- -no-system-proxies ... Do not use system network proxies by default.
- * -system-proxies ...... Use system network proxies by default.
-
- * -no-sctp ............. Do not compile SCTP network protocol support.
- -sctp ................ Compile SCTP support.
-
- -no-warnings-are-errors Make warnings be treated normally
- -warnings-are-errors Make warnings be treated as errors
- (enabled if -developer-build is active)
-
-QNX options:
-
- -no-slog2 ........... Do not compile with slog2 support.
- -slog2 .............. Compile with slog2 support.
-
- -no-pps ............. Do not compile with pps support.
- -pps ................ Compile with pps support.
-
- -no-imf ............. Do not compile with imf support.
- -imf ................ Compile with imf support.
-
- -no-lgmon ........... Do not compile with lgmon support.
- -lgmon .............. Compile with lgmon support.
-
-Apple platform options:
-
- -Fstring ............ Add an explicit framework path.
-
- * -framework .......... Build Qt as a series of frameworks and
- link tools against those frameworks.
- -no-framework ....... Do not build Qt as a series of frameworks.
-
- * -securetransport .... Use SecureTransport instead of OpenSSL
-
- -no-securetransport . Do not use SecureTransport, either use OpenSSL or do not use any SSL backend
- at all (if combined with -no-openssl).
-
- -sdk <sdk> .......... Build Qt using Apple provided SDK <sdk>. The argument should be
- one of the available SDKs as listed by 'xcodebuild -showsdks'.
- Note that the argument applies only to Qt libraries and applications built
- using the target mkspec - not host tools such as qmake, moc, rcc, etc.
-
-Android options:
-
- -android-sdk path .............. The Android SDK root path.
- (default $ANDROID_SDK_ROOT)
-
- -android-ndk path .............. The Android NDK root path.
- (default $ANDROID_NDK_ROOT)
-
- -android-ndk-platform .......... Sets the android platform
-
- -android-ndk-host .............. Sets the android NDK host (linux-x86, linux-x86_64, etc.)
- (default $ANDROID_NDK_HOST)
-
- -android-arch .................. Sets the android architecture (armeabi, armeabi-v7a, x86, mips,
- arm64-v8a, x86_64, mips64)
-
- -android-toolchain-version ..... Sets the android toolchain version
-
- -no-android-style-assets ....... Do not compile in the code which automatically extracts
- style assets from the run-time device. Setting this will
- make the Android style behave incorrectly, but will enable
- compatibility with the LGPL2.1 license.
- * -android-style-assets .......... Compile the code which automatically extracts style assets
- from the run-time device. This option will make the
- Android platform plugin incompatible with the LGPL2.1.
+Usage: configure [options] [assignments]
+
+Configure understands variable assignments like VAR=value on the command line.
+These override any values possibly obtained from pkg-config. The variables
+are mentioned in the descriptions of the options they relate to.
+
+It is also possible to manipulate any QMAKE_* variable, to amend the values
+from the mkspec for the build of Qt itself, e.g., QMAKE_CXXFLAGS+=-g3.
+
+Top-level installation directories:
+ -prefix <dir> ...... The deployment directory, as seen on the target device.
+ [/usr/local/Qt-$QT_VERSION, $PWD if -developer-build]
+ -extprefix <dir> ... The installation directory, as seen on the host machine.
+ [SYSROOT/PREFIX]
+ -hostprefix [dir] .. The installation directory for build tools running on
+ the host machine. If [dir] is not given, the current
+ build directory will be used. [EXTPREFIX]
+ -external-hostbindir <path> ... Path to Qt tools built for this machine.
+ Use this when -platform does not match the current
+ system, i.e., to make a Canadian Cross Build.
+
+Fine tuning of installation directory layout. Note that all directories
+except -sysconfdir should be located under -prefix/-hostprefix:
+
+ -bindir <dir> ......... Executables [PREFIX/bin]
+ -headerdir <dir> ...... Header files [PREFIX/include]
+ -libdir <dir> ......... Libraries [PREFIX/lib]
+ -archdatadir <dir> .... Arch-dependent data [PREFIX]
+ -plugindir <dir> ...... Plugins [ARCHDATADIR/plugins]
+ -libexecdir <dir> ..... Helper programs [ARCHDATADIR/bin on Windows,
+ ARCHDATADIR/libexec otherwise]
+ -importdir <dir> ...... QML1 imports [ARCHDATADIR/imports]
+ -qmldir <dir> ......... QML2 imports [ARCHDATADIR/qml]
+ -datadir <dir> ........ Arch-independent data [PREFIX]
+ -docdir <dir> ......... Documentation [DATADIR/doc]
+ -translationdir <dir> . Translations [DATADIR/translations]
+ -sysconfdir <dir> ..... Settings used by Qt programs [PREFIX/etc/xdg]
+ -examplesdir <dir> .... Examples [PREFIX/examples]
+ -testsdir <dir> ....... Tests [PREFIX/tests]
+
+ -hostbindir <dir> ..... Host executables [HOSTPREFIX/bin]
+ -hostlibdir <dir> ..... Host libraries [HOSTPREFIX/lib]
+ -hostdatadir <dir> .... Data used by qmake [HOSTPREFIX]
+
+Conventions for the remaining options: When an option's description is
+followed by a list of values in brackets, the interpretation is as follows:
+'yes' represents the bare option; all other values are possible prefixes to
+the option, e.g., -no-gui. Alternatively, the value can be assigned, e.g.,
+-gui=yes. Values are listed in the order they are tried if not specified;
+'auto' is a shorthand for 'yes/no'. Solitary 'yes' and 'no' represent binary
+options without auto-detection.
+
+Configure meta:
+
+ -help, -h ............ Display this help screen
+ -verbose, -v ......... Print verbose messages during configuration
+ -continue ............ Continue configure despite errors
+ -redo ................ Re-configure with previously used options.
+ Additional options may be passed, but will not be
+ saved for later use by -redo.
+ -recheck ............. Discard cached negative configure test results.
+ Use this after installing missing dependencies.
+ -recheck-all ......... Discard all cached configure test results.
+
+Build options:
+
+ -opensource .......... Build the Open-Source Edition of Qt
+ -commercial .......... Build the Commercial Edition of Qt
+ -confirm-license ..... Automatically acknowledge the license
+
+ -release ............. Build Qt with debugging turned off [yes]
+ -debug ............... Build Qt with debugging turned on [no]
+ -debug-and-release ... Build two versions of Qt, with and without
+ debugging turned on [yes] (Apple and Windows only)
+ -optimized-tools ..... Build optimized host tools even in debug build [no]
+ -force-debug-info .... Create symbol files for release builds [no]
+ -separate-debug-info . Split off debug information to separate files [no]
+ -strip ............... Strip release binaries of unneeded symbols [yes]
+ -force-asserts ....... Enable Q_ASSERT even in release builds [no]
+ -developer-build ..... Compile and link Qt for developing Qt itself
+ (exports for auto-tests, extra checks, etc.) [no]
+
+ -shared .............. Build shared Qt libraries [yes] (no for UIKit)
+ -static .............. Build static Qt libraries [no] (yes for UIKit)
+ -framework ........... Build Qt framework bundles [yes] (Apple only)
+
+ -platform <target> ... Select host mkspec [detected]
+ -host-option <key=value> ..... Add option for the host mkspec
+ -xplatform <target> .. Select target mkspec when cross-compiling [PLATFORM]
+ -device <name> ....... Cross-compile for device <name>
+ -device-option <key=value> ... Add option for the device mkspec
+
+ -qtnamespace <name> .. Wrap all Qt library code in 'namespace <name> {...}'.
+ -qtlibinfix <infix> .. Rename all libQt5*.so to libQt5*<infix>.so.
+
+ -testcocoon .......... Instrument with the TestCocoon code coverage tool [no]
+ -gcov ................ Instrument with the GCov code coverage tool [no]
+ -sanitize {address|thread|memory|undefined}
+ Instrument with the specified compiler sanitizer.
+
+ -c++std <edition> .... Select C++ standard <edition> [c++1z/c++14/c++11]
+ (Not supported with MSVC)
+ -rtti ................ Build with Runtime Type Information [yes] (MSVC only)
+
+ -sse2 ................ Use SSE2 instructions [auto]
+ -sse3/-ssse3/-sse4.1/-sse4.2/-avx/-avx2/-avx512
+ Enable use of particular x86 instructions [auto]
+ Enabled ones are still subject to runtime detection.
+ -mips_dsp/-mips_dspr2 Use MIPS DSP/rev2 instructions [auto]
+
+ -qreal <type> ........ typedef qreal to the specified type. [double]
+ Note: this affects binary compatibility.
+
+ -R <string> .......... Add an explicit runtime library path to the Qt
+ libraries. Supports paths relative to LIBDIR.
+ -rpath ............... Link Qt libraries and executables using the library
+ install path as a runtime library path. Similar to
+ -R LIBDIR. On Apple platforms, disabling this implies
+ using absolute install names (based in LIBDIR) for
+ dynamic libraries and frameworks. [auto]
+
+ -reduce-exports ...... Reduce amount of exported symbols [auto]
+ -reduce-relocations .. Reduce amount of relocations [auto] (Unix only)
+
+ -plugin-manifests .... Embed manifests into plugins [no] (Windows only)
+ -static-runtime ...... With -static, use static runtime [no] (Windows only)
+
+ -pch ................. Use precompiled headers [auto]
+ -ltcg ................ Use Link Time Code Generation [no]
+ -use-gold-linker ..... Use the GNU gold linker [auto]
+ -incredibuild-xge .... Use the IncrediBuild XGE [no] (Windows only)
+ -make-tool <tool> .... Use <tool> to build qmake [nmake] (Windows only)
+ -mp .................. Use multiple processors for compilation (MSVC only)
+
+ -warnings-are-errors . Treat warnings as errors [no; yes if -developer-build]
+ -silent .............. Reduce the build output so that warnings and errors
+ can be seen more easily
+
+Build environment:
+
+ -sysroot <dir> ....... Set <dir> as the target sysroot
+ -gcc-sysroot ......... With -sysroot, pass --sysroot to the compiler [yes]
+
+ -pkg-config .......... Use pkg-config [auto] (Unix only)
+
+ -D <string> .......... Pass additional preprocessor define
+ -I <string> .......... Pass additional include path
+ -L <string> .......... Pass additional library path
+ -F <string> .......... Pass additional framework path (Apple only)
+
+ -sdk <sdk> ........... Build Qt using Apple provided SDK <sdk>. The argument
+ should be one of the available SDKs as listed by
+ 'xcodebuild -showsdks'.
+ Note that the argument applies only to Qt libraries
+ and applications built using the target mkspec - not
+ host tools such as qmake, moc, rcc, etc.
+
+ -android-sdk path .... Set Android SDK root path [$ANDROID_SDK_ROOT]
+ -android-ndk path .... Set Android NDK root path [$ANDROID_NDK_ROOT]
+ -android-ndk-platform Set Android platform
+ -android-ndk-host .... Set Android NDK host (linux-x86, linux-x86_64, etc.)
+ [$ANDROID_NDK_HOST]
+ -android-arch ........ Set Android architecture (armeabi, armeabi-v7a,
+ arm64-v8a, x86, x86_64, mips, mips64)
+ -android-toolchain-version ... Set Android toolchain version
+ -android-style-assets Automatically extract style assets from the device at
+ run time. This option makes the Android style behave
+ correctly, but also makes the Android platform plugin
+ incompatible with the LGPL2.1. [yes]
+
+Component selection:
+
+ -skip <repo> ......... Exclude an entire repository from the build.
+ -make <part> ......... Add <part> to the list of parts to be built.
+ Specifying this option clears the default list first.
+ [libs and examples, also tools if not cross-building,
+ also tests if -developer-build]
+ -nomake <part> ....... Exclude <part> from the list of parts to be built.
+ -compile-examples .... When unset, install only the sources of examples [yes]
+ -gui ................. Build the Qt GUI module and dependencies [yes]
+ -widgets ............. Build the Qt Widgets module and dependencies [yes]
+ -no-dbus ............. Do not build the Qt D-Bus module
+ [default on Android and Windows]
+ -dbus-linked ......... Build Qt D-Bus and link to libdbus-1 [auto]
+ -dbus-runtime ........ Build Qt D-Bus and dynamically load libdbus-1 [no]
+ DBUS_PATH= DBUS_HOST_PATH=
+ -feature-<feature> ... Enable <feature>. The available features are described
+ in src/corelib/global/qfeatures.txt. [all enabled]
+ -accessibility ....... Enable accessibility support [yes]
+ Note: Disabling accessibility is not recommended.
+ -qml-debug ........... Enable QML debugging support [yes]
+
+Qt comes with bundled copies of some 3rd party libraries. These are used
+by default if auto-detection of the respective system library fails.
+
+Core options:
+
+ -doubleconversion .... Select used double conversion library [system/qt/no]
+ No implies use of sscanf_l and snprintf_l (imprecise).
+ -glib ................ Enable Glib support [no; auto on Unix]
+ -eventfd ............. Enable eventfd support
+ -inotify ............. Enable inotify support
+ -iconv ............... Enable iconv(3) support [posix/sun/gnu/no] (Unix only)
+ -icu ................. Enable ICU support [auto]
+ -pps ................. Enable PPS support [auto] (QNX only)
+ -pcre ................ Select used libpcre3 [system/qt]
+ -zlib ................ Select used zlib [system/qt]
+ ZLIB_LIBS=
+
+ Logging backends:
+ -journald .......... Enable journald support [no] (Unix only)
+ -syslog ............ Enable syslog support [no] (Unix only)
+ -slog2 ............. Enable slog2 support [auto] (QNX only)
+
+Network options:
+
+ -ssl ................. Enable either SSL support method [auto]
+ -no-openssl .......... Do not use OpenSSL [default on Apple and WinRT]
+ -openssl-linked ...... Use OpenSSL and link to libssl [no]
+ -openssl-runtime ..... Use OpenSSL and dynamically load libssl [auto]
+ OPENSSL_PATH= OPENSSL_LIBS=, and on Windows also
+ OPENSSL_LIBS_DEBUG= OPENSSL_LIBS_RELEASE=
+ -securetransport ..... Use SecureTransport [auto] (Apple only)
+
+ -sctp ................ Enable SCTP support [no]
+
+ -libproxy ............ Enable use of libproxy [no]
+ -system-proxies ...... Use system network proxies by default [yes]
+
+Gui, printing, widget options:
+
+ -cups ................ Enable CUPS support [auto] (Unix only)
+
+ -fontconfig .......... Enable Fontconfig support [auto] (Unix only)
+ -freetype ............ Select used FreeType [system/qt/no]
+ -harfbuzz ............ Select used HarfBuzz-NG [system/qt/no]
+ (Not auto-detected on Apple and Windows)
+
+ -gtk ................. Enable GTK platform theme support [auto]
+
+ -lgmon ............... Enable lgmon support [auto] (QNX only)
+
+ -no-opengl ........... Disable OpenGL support
+ -opengl <api> ........ Enable OpenGL support. Supported APIs:
+ es2 (default on Windows), desktop (default on Unix),
+ dynamic (Windows only)
+ -opengles3 ........... Enable OpenGL ES 3.x support instead of ES 2.x [auto]
+ -angle ............... Use bundled ANGLE to support OpenGL ES 2.0 [auto]
+ (Windows only)
+
+ -qpa <name> .......... Select default QPA backend (e.g., xcb, cocoa, windows)
+ -xcb-xlib............. Enable Xcb-Xlib support [auto]
+
+ Platform backends:
+ -directfb .......... Enable DirectFB support [no] (Unix only)
+ -eglfs ............. Enable EGLFS support [auto; no on Android and Windows]
+ -gbm ............... Enable backends for GBM [auto] (Linux only)
+ -kms ............... Enable backends for KMS [auto] (Linux only)
+ -linuxfb ........... Enable Linux Framebuffer support [auto] (Linux only)
+ -mirclient ......... Enable Mir client support [no] (Linux only)
+ -xcb ............... Select used xcb-* libraries [system/qt/no]
+ (-qt-xcb still uses system version of libxcb itself)
+
+ Input backends:
+ -evdev ............. Enable evdev support [auto]
+ -imf ............... Enable IMF support [auto] (QNX only)
+ -libinput .......... Enable libinput support [auto]
+ -mtdev ............. Enable mtdev support [auto]
+ -tslib ............. Enable tslib support [auto]
+ -xinput2 ........... Enable XInput2 support [auto]
+ -xkbcommon-x11 ..... Select xkbcommon used in combination with xcb
+ [system/qt/no]
+ -xkb-config-root <dir> ... With -qt-xkbcommon-x11, set default XKB config
+ root <dir> [detect]
+ -xkbcommon-evdev ... Enable X-less xkbcommon in combination with libinput
+ [auto]
+
+ Image formats:
+ -gif ............... Enable reading support for GIF [auto]
+ -ico ............... Enable support for ICO [yes]
+ -libpng ............ Select used libpng [system/qt/no]
+ -libjpeg ........... Select used libjpeg [system/qt/no]
+
+Database options:
+
+ -sql-<driver> ........ Enable SQL <driver> plugin. Supported drivers:
+ db2 ibase mysql oci odbc psql sqlite2 sqlite tds
+ [all auto]
+ MYSQL_PATH= PSQL_LIBS= SYBASE= SYBASE_LIBS=
+ -sqlite .............. Select used sqlite3 [system/qt]
+
+Multimedia options:
+
+ -pulseaudio .......... Enable PulseAudio support [auto]
+ -alsa ................ Enable ALSA support [auto]
+ -no-gstreamer ........ Disable support for GStreamer
+ -gstreamer [version] . Enable GStreamer support [auto]
+ With no parameter, 1.0 is tried first, then 0.10.
+ -wmf-backend ......... Enable WMF support [no] (Windows only)
diff --git a/configure b/configure
index d6879a3272..ac68f3ce4b 100755
--- a/configure
+++ b/configure
@@ -80,23 +80,50 @@ if [ x"$1" = x"-top-level" ]; then
shift
fi
-# later cache the command line in config.status
-OPT_CMDLINE=
+CFG_REDO=no
+OPT_CMDLINE= # excluding -verbose (for config.opt)
+QMAKE_CMDLINE= # including -verbose (for actual parsing)
+set -f # suppress globbing in for loop
+SAVED_IFS=$IFS
+IFS='
+'
for i in "$@"; do
+ case $i in
+ -redo|--redo)
+ if ! test -f config.opt; then
+ echo >&2 "No config.opt present - cannot redo configuration."
+ exit 1
+ fi
+ for a in `cat config.opt`; do
+ OPT_CMDLINE="$OPT_CMDLINE
+$a"
+ QMAKE_CMDLINE="$QMAKE_CMDLINE
+$a"
+ done
+ CFG_REDO=yes # suppress repeated config.opt writeout
+ continue
+ ;;
+ -v|-verbose|--verbose|-no-v|-no-verbose|--no-verbose)
+ ;;
+ *)
+ OPT_CMDLINE="$OPT_CMDLINE
+$i"
+ ;;
+ esac
QMAKE_CMDLINE="$QMAKE_CMDLINE
$i"
- if [ "x$i" != "x-v" ]; then
- [ -z "${i##* *}" ] && i="'$i'"
- OPT_CMDLINE="$OPT_CMDLINE $i"
- fi
done
+set --
+for i in $QMAKE_CMDLINE; do
+ set -- "$@" "$i"
+done
+set +f
+IFS=$SAVED_IFS
# initialize global variables
-QMAKE_VARS_FILE=.qmake.vars
DEVICE_VARS_FILE=.device.vars
HOST_VARS_FILE=.host.vars
-:> "$QMAKE_VARS_FILE"
:> "$DEVICE_VARS_FILE"
:> "$HOST_VARS_FILE"
@@ -124,29 +151,6 @@ makeabs()
echo "$RES" | sed 's,//,/,g; s,/$,,'
}
-# Adds a new qmake variable to the cache
-# Usage: QMakeVar mode varname contents
-# where mode is one of: set, add, del
-QMakeVar()
-{
- case "$1" in
- set)
- eq="="
- ;;
- add)
- eq="+="
- ;;
- del)
- eq="-="
- ;;
- *)
- echo >&2 "BUG: wrong command to QMakeVar: $1"
- ;;
- esac
-
- echo "$2" "$eq" "$3" >> "$QMAKE_VARS_FILE"
-}
-
# Helper function for getQMakeConf. It parses include statements in
# qmake.conf and prints out the expanded file
expandQMakeConf()
@@ -275,6 +279,12 @@ macSDKify()
appletvsimulator*)
version_min_flag="-mtvos-simulator-version-min=$(getSingleQMakeVariable QMAKE_TVOS_DEPLOYMENT_TARGET "$1")"
;;
+ watchos*)
+ version_min_flag="-mwatchos-version-min=$(getSingleQMakeVariable QMAKE_WATCHOS_DEPLOYMENT_TARGET "$1")"
+ ;;
+ watchsimulator*)
+ version_min_flag="-mwatchos-simulator-version-min=$(getSingleQMakeVariable QMAKE_WATCHOS_DEPLOYMENT_TARGET "$1")"
+ ;;
*)
;;
esac
@@ -394,12 +404,7 @@ BUILD_ON_MAC=no
if [ -d /System/Library/Frameworks/Carbon.framework ]; then
BUILD_ON_MAC=yes
fi
-HOST_DIRLIST_SEP=":"
-DEV_NULL=/dev/null
if [ "$OSTYPE" = "msys" ]; then
- HOST_DIRLIST_SEP=";"
- DEV_NULL=/tmp/empty-file
- echo "" > $DEV_NULL
relpath=`(cd "$relpath"; pwd -W)`
outpath=`pwd -W`
fi
@@ -447,32 +452,10 @@ fi
# initalize variables
#-------------------------------------------------------------------------------
-SYSTEM_VARIABLES="AR RANLIB STRIP OBJDUMP LD CC CXX CFLAGS CXXFLAGS LDFLAGS"
-for varname in $SYSTEM_VARIABLES; do
- qmakevarname="${varname}"
- qmakecmdargs=""
- # use LDFLAGS for autoconf compat, but qmake uses QMAKE_LFLAGS
- if [ "${varname}" = "LDFLAGS" ]; then
- qmakevarname="LFLAGS"
- elif [ "${varname}" = "LD" ]; then
- qmakevarname="LINK"
- elif [ "${varname}" = "AR" ]; then
- # QMAKE_AR needs to be set to "/path/to/ar cqs" but the
- # environment variable will be set to the command only so we
- # need to append " cqs" for autoconf compatibility
- qmakecmdargs=" cqs"
- fi
- cmd=`echo \
-'if [ -n "\$'${varname}'" ]; then
- QMakeVar set QMAKE_'${qmakevarname}' "\$'${varname}${qmakecmdargs}'"
-fi'`
- eval "$cmd"
-done
-
# Use CC/CXX to run config.tests
mkdir -p "$outpath/config.tests"
rm -f "$outpath/config.tests/.qmake.cache"
-cp "$QMAKE_VARS_FILE" "$outpath/config.tests/.qmake.cache"
+: > "$outpath/config.tests/.qmake.cache"
# QTDIR may be set and point to an old or system-wide Qt installation
unset QTDIR
@@ -482,9 +465,10 @@ CFG_RELEASE_TOOLS=no
CFG_ANDROID_STYLE_ASSETS=yes
XPLATFORM= # This seems to be the QMAKESPEC, like "linux-g++"
-XPLATFORM_MAC=no # Whether target platform is OS X, iOS or tvOS
+XPLATFORM_MAC=no # Whether target platform is macOS, iOS, tvOS, or watchOS
XPLATFORM_IOS=no # Whether target platform is iOS
XPLATFORM_TVOS=no # Whether target platform is tvOS
+XPLATFORM_WATCHOS=no # Whether target platform is watchOS
XPLATFORM_ANDROID=no
XPLATFORM_MINGW=no # Whether target platform is MinGW (win32-g++*)
PLATFORM=$QMAKESPEC
@@ -1018,6 +1002,10 @@ case "$XPLATFORM" in
XPLATFORM_MAC=yes
XPLATFORM_TVOS=yes
;;
+ *watchos*)
+ XPLATFORM_MAC=yes
+ XPLATFORM_WATCHOS=yes
+ ;;
*macx*)
XPLATFORM_MAC=yes
;;
@@ -1884,20 +1872,6 @@ else
fi
#-------------------------------------------------------------------------------
-# Verify makespec
-#-------------------------------------------------------------------------------
-QMAKE_OUTPUT=`"$CFG_QMAKE_PATH" -qtconf "$QTCONFFILE" -E -nocache -spec "$XQMAKESPEC" "QT=" $DEV_NULL 2>&1`
-if [ $? != "0" ]; then
- echo "Failed to process makespec for platform '$XPLATFORM'"
- if [ "$OPT_VERBOSE" = "yes" ]; then
- echo "$QMAKE_OUTPUT"
- else
- echo "Turn on verbose messaging (-v) to see the final report."
- fi
- exit 101
-fi
-
-#-------------------------------------------------------------------------------
# run configure tests
#-------------------------------------------------------------------------------
@@ -1910,7 +1884,6 @@ config.input.extra_features = $CFG_FEATURES
config.input.qt_edition = $Edition
config.input.qt_licheck = $Licheck
config.input.qt_release_date = $ReleaseDate
-config.input.sysroot = $CFG_SYSROOT
EOF
# create a clean qmodule/qconfig.pri for running the tests
@@ -1959,18 +1932,6 @@ else
echo
fi
-if [ "$OPT_VERBOSE" = "yes" ]; then
- echo $ECHO_N "qmake vars .......... $ECHO_C"
- cat "$QMAKE_VARS_FILE" | tr '\n' ' '
- echo
-fi
-
-sepath=`echo "$relpath" | sed -e 's/\\./\\\\./g'`
-PROCS=1
-EXEC=""
-
-rm -f "$QMAKE_VARS_FILE" 2>/dev/null
-
#-------------------------------------------------------------------------------
# build makefiles based on the configuration
#-------------------------------------------------------------------------------
@@ -1990,31 +1951,19 @@ rm -f "$QMAKE_VARS_FILE" 2>/dev/null
#-------------------------------------------------------------------------------
# finally save the executed command to another script
#-------------------------------------------------------------------------------
-if [ `basename $0` != "config.status" ]; then
- CONFIG_STATUS="$relpath/$relconf$OPT_CMDLINE"
-
- # add the system variables
- for varname in $SYSTEM_VARIABLES; do
- cmd=`echo \
-'if [ -n "\$'${varname}'" ]; then
- CONFIG_STATUS="'${varname}'='"'\\\$${varname}'"' \$CONFIG_STATUS"
-fi'`
- eval "$cmd"
- done
+if [ $CFG_REDO = no ]; then
+ echo "$OPT_CMDLINE" | grep '\-confirm\-license' >/dev/null 2>&1 || OPT_CMDLINE="$OPT_CMDLINE
+-confirm-license"
- echo "$CONFIG_STATUS" | grep '\-confirm\-license' >/dev/null 2>&1 || CONFIG_STATUS="$CONFIG_STATUS -confirm-license"
+ # skip first line, as it's always empty due to unconditional field separation
+ echo "$OPT_CMDLINE" | tail -n +2 > "$outpath/config.opt"
[ -f "$outpath/config.status" ] && rm -f "$outpath/config.status"
echo "#!/bin/sh" > "$outpath/config.status"
- echo "$CONFIG_STATUS \"\$@\"" >> "$outpath/config.status"
+ echo "$relpath/$relconf -redo \"\$@\"" >> "$outpath/config.status"
chmod +x "$outpath/config.status"
fi
-if [ -n "$RPATH_MESSAGE" ]; then
- echo
- echo "$RPATH_MESSAGE"
-fi
-
if [ -n "$PREFIX_COMPLAINTS" ]; then
echo
echo "$PREFIX_COMPLAINTS"
diff --git a/configure.bat b/configure.bat
index 5c01890116..4fcf254a59 100644
--- a/configure.bat
+++ b/configure.bat
@@ -28,9 +28,26 @@
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
@echo off
+setlocal ENABLEEXTENSIONS
+set ARGS=%*
set QTSRC=%~dp0
set QTDIR=%CD%
+:doargs
+ if "%~1" == "" goto doneargs
+
+ if "%~1" == "/?" goto help
+ if "%~1" == "-?" goto help
+ if /i "%~1" == "/h" goto help
+ if /i "%~1" == "-h" goto help
+ if /i "%~1" == "/help" goto help
+ if /i "%~1" == "-help" goto help
+ if /i "%~1" == "--help" goto help
+
+ shift
+ goto doargs
+:doneargs
+
if not exist %QTSRC%.gitignore goto sconf
echo Please wait while bootstrapping configure ...
@@ -114,9 +131,13 @@ if errorlevel 1 (cd ..\.. & exit /b 1)
cd ..\..
:conf
-configure.exe -srcdir %QTSRC% %*
+configure.exe -srcdir %QTSRC% %ARGS%
+goto exit
+
+:help
+type %QTSRC%config_help.txt
goto exit
:sconf
-%QTSRC%configure.exe %*
+%QTSRC%configure.exe %ARGS%
:exit
diff --git a/configure.json b/configure.json
index 81aea1733f..a079572c0a 100644
--- a/configure.json
+++ b/configure.json
@@ -1,11 +1,26 @@
{
"files": {
"publicHeader": "src/corelib/global/qconfig.h",
+ "privateHeader": "src/corelib/global/qconfig_p.h",
"publicPro": "mkspecs/qconfig.pri",
"privatePro": "mkspecs/qmodule.pri"
},
"commandline": {
+ "assignments": {
+ "DBUS_HOST_PATH": "host_dbus.prefix",
+ "DBUS_PATH": "dbus.prefix",
+ "MYSQL_PATH": "mysql.prefix",
+ "OPENSSL_LIBS": "openssl.libs",
+ "OPENSSL_LIBS_DEBUG": "openssl.libs.debug",
+ "OPENSSL_LIBS_RELEASE": "openssl.libs.release",
+ "OPENSSL_PATH": "openssl.prefix",
+ "PSQL_LIBS": "psql.libs",
+ "SYBASE": "tds.prefix",
+ "SYBASE_LIBS": "tds.libs",
+ "ZLIB_LIBS": "zlib.libs"
+ },
+ "custom": "qmakeArgs",
"options": {
"prefix": "string",
"hostprefix": "string",
@@ -41,6 +56,7 @@
"accessibility": "boolean",
"alsa": "boolean",
+ "angle": "boolean",
"audio-backend": "boolean",
"avx": "boolean",
"avx2": "boolean",
@@ -65,6 +81,7 @@
"egl": "boolean",
"eglfs": "boolean",
"evdev": "boolean",
+ "eventfd": "boolean",
"fontconfig": "boolean",
"force-asserts": { "type": "boolean", "name": "force_asserts" },
"force-debug-info": { "type": "boolean", "name": "force_debug_info" },
@@ -83,9 +100,12 @@
"harfbuzz": { "type": "enum", "values": [ "no", "qt", "system" ] },
"headersclean": "boolean",
"host-option": "string",
- "iconv": "boolean",
+ "ico": "boolean",
+ "iconv": { "type": "enum", "values": [ "no", "yes", "posix", "sun", "gnu" ] },
"icu": "boolean",
"imf": { "type": "boolean", "name": "qqnx_imf" },
+ "incredibuild-xge": { "type": "boolean", "name": "incredibuild_xge" },
+ "inotify": "boolean",
"journald": "boolean",
"lgmon": "boolean",
"libinput": "boolean",
@@ -97,13 +117,16 @@
"ltcg": "boolean",
"kms": "boolean",
"make": { "type": "addString", "values": [ "examples", "libs", "tests", "tools" ] },
+ "make-tool": "string",
"mips_dsp": "boolean",
"mips_dspr2": "boolean",
"mirclient": "boolean",
+ "mp": { "type": "boolean", "name": "msvc_mp" },
"mtdev": "boolean",
"mysql_config": "string",
"nomake": { "type": "addString", "values": [ "examples", "tests", "tools" ] },
- "opengl": { "type": "optionalString", "values": [ "no", "yes", "desktop", "es2" ] },
+ "opengl": { "type": "optionalString", "values": [ "no", "yes", "desktop", "es2", "dynamic" ] },
+ "opengl-es-2": { "type": "void", "name": "opengl", "value": "es2" },
"opengles3": "boolean",
"opensource": { "type": "void", "name": "commercial", "value": "no" },
"openssl": { "type": "optionalString", "values": [ "no", "yes", "linked", "runtime" ] },
@@ -115,7 +138,9 @@
"pcre": { "type": "enum", "values": [ "qt", "system" ] },
"pkg-config": "boolean",
"platform": "string",
+ "plugin-manifests": "boolean",
"pps": { "type": "boolean", "name": "qqnx_pps" },
+ "posix-ipc": { "type": "boolean", "name": "ipc_posix" },
"profile": "boolean",
"psql_config": "string",
"pulseaudio": "boolean",
@@ -129,6 +154,7 @@
"reduce-relocations": { "type": "boolean", "name": "reduce_relocations" },
"release": { "type": "enum", "name": "debug", "values": { "yes": "no", "no": "yes" } },
"rpath": "boolean",
+ "rtti": "boolean",
"sanitize": "sanitize",
"sctp": "boolean",
"sdk": "string",
@@ -157,14 +183,24 @@
"plugin-sql-sqlite": { "type": "void", "name": "sqlite" },
"plugin-sql-sqlite2": { "type": "void", "name": "sqlite2" },
"plugin-sql-tds": { "type": "void", "name": "tds" },
+ "qdbus": { "type": "boolean", "name": "dbus" },
"sqlite": { "type": "enum", "name": "system-sqlite", "values": { "qt": "no", "system": "yes" } },
"sse2": "boolean",
"sse3": "boolean",
"sse4.1": { "type": "boolean", "name": "sse4_1" },
"sse4.2": { "type": "boolean", "name": "sse4_2" },
+ "ssl": "boolean",
"ssse3": "boolean",
"static": { "type": "enum", "name": "shared", "values": { "yes": "no", "no": "yes" } },
+ "static-runtime": { "type": "boolean", "name": "static_runtime" },
"strip": "boolean",
+ "style-windows": "boolean",
+ "style-windowsxp": "boolean",
+ "style-windowsvista": "boolean",
+ "style-fusion": "boolean",
+ "style-mac": "boolean",
+ "style-android": "boolean",
+ "syncqt": "boolean",
"syslog": "boolean",
"sysroot": "string",
"system-proxies": "boolean",
@@ -174,6 +210,7 @@
"warnings-are-errors": { "type": "boolean", "name": "warnings_are_errors" },
"Werror": { "type": "boolean", "name": "warnings_are_errors" },
"widgets": "boolean",
+ "wmf-backend": "boolean",
"xcb": { "type": "enum", "values": [ "no", "yes", "qt", "system" ] },
"xcb-xlib": "boolean",
"xinput2": "boolean",
@@ -197,7 +234,557 @@
},
+ "libraries": {
+ "libatomic": {
+ "description": "64 bit atomics in libatomic",
+ "test": "common/atomic64",
+ "sources": [
+ "-latomic"
+ ]
+ },
+ "libdl": {
+ "description": "dlopen() in libdl",
+ "export": "",
+ "test": "unix/dlopen",
+ "sources": [
+ "-ldl"
+ ]
+ },
+ "doubleconversion": {
+ "description": "DoubleConversion",
+ "test": "unix/doubleconversion",
+ "sources": [
+ "-ldouble-conversion"
+ ]
+ },
+ "pcre": {
+ "description": "PCRE",
+ "test": "unix/pcre",
+ "sources": [
+ "-lpcre16"
+ ]
+ },
+ "zlib": {
+ "description": "zlib",
+ "test": "unix/zlib",
+ "sources": [
+ { "libs": "-lzdll", "condition": "config.msvc" },
+ { "libs": "-lz", "condition": "!config.msvc" }
+ ]
+ },
+ "gnu_iconv": {
+ "description": "GNU libiconv",
+ "export": "iconv",
+ "test": "unix/gnu-libiconv",
+ "sources": [
+ "-liconv"
+ ]
+ },
+ "icu": {
+ "description": "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" }
+ ]
+ },
+ "network": {
+ "export": "",
+ "sources": [
+ { "type": "makeSpec", "spec": "NETWORK" }
+ ]
+ },
+ "corewlan": {
+ "description": "CoreWLan",
+ "export": "",
+ "test": "mac/corewlan",
+ "sources": [
+ "-framework CoreWLAN -framework Foundation"
+ ]
+ },
+ "openssl": {
+ "description": "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" }
+ ]
+ },
+ "libproxy": {
+ "description": "libproxy",
+ "test": "common/libproxy",
+ "sources": [
+ "-lproxy"
+ ]
+ },
+ "glib": {
+ "description": "GLib",
+ "test": "unix/glib",
+ "sources": [
+ { "type": "pkgConfig", "args": "glib-2.0 gthread-2.0" }
+ ]
+ },
+ "gtk3": {
+ "description": "GTK+",
+ "sources": [
+ { "type": "pkgConfig", "args": "gtk+-3.0" }
+ ]
+ },
+ "cups": {
+ "description": "CUPS",
+ "test": "unix/cups",
+ "sources": [
+ "-lcups"
+ ]
+ },
+ "libjpeg": {
+ "description": "libjpeg",
+ "test": "unix/libjpeg",
+ "sources": [
+ { "libs": "-llibjpeg", "condition": "config.msvc" },
+ { "libs": "-ljpeg", "condition": "!config.msvc" }
+ ]
+ },
+ "libpng": {
+ "description": "libpng",
+ "test": "unix/libpng",
+ "sources": [
+ { "type": "pkgConfig", "args": "libpng" },
+ { "libs": "-llibpng", "condition": "config.msvc" },
+ { "libs": "-lpng", "condition": "!config.msvc" }
+ ]
+ },
+ "alsa": {
+ "description": "ALSA",
+ "export": "",
+ "test": "unix/alsa",
+ "sources": [
+ "-lasound"
+ ]
+ },
+ "pulseaudio": {
+ "description": "PulseAudio >= 0.9.10",
+ "test": "unix/pulseaudio",
+ "sources": [
+ { "type": "pkgConfig", "args": "libpulse >= 0.9.10 libpulse-mainloop-glib" }
+ ]
+ },
+ "gstreamer_1_0": {
+ "description": "GStreamer 1.0",
+ "export": "",
+ "test": "unix/gstreamer",
+ "sources": [
+ { "type": "pkgConfig",
+ "args": "gstreamer-1.0 gstreamer-base-1.0 gstreamer-audio-1.0 gstreamer-video-1.0 gstreamer-pbutils-1.0" }
+ ]
+ },
+ "gstreamer_0_10": {
+ "description": "GStreamer 0.10",
+ "export": "",
+ "test": "unix/gstreamer",
+ "sources": [
+ { "type": "pkgConfig",
+ "args": "gstreamer-0.10 gstreamer-base-0.10 gstreamer-audio-0.10 gstreamer-video-0.10 gstreamer-pbutils-0.10" }
+ ]
+ },
+ "freetype": {
+ "description": "FreeType",
+ "export": "",
+ "test": "unix/freetype",
+ "sources": [
+ "-lfreetype"
+ ]
+ },
+ "fontconfig": {
+ "description": "Fontconfig",
+ "test": "unix/fontconfig",
+ "sources": [
+ { "type": "pkgConfig", "args": "fontconfig freetype2" },
+ "-lfontconfig -lfreetype"
+ ]
+ },
+ "harfbuzz": {
+ "description": "HarfBuzz",
+ "test": "unix/harfbuzz",
+ "sources": [
+ "-lharfbuzz"
+ ]
+ },
+ "dbus": {
+ "description": "D-Bus >= 1.2",
+ "test": "unix/dbus",
+ "sources": [
+ { "type": "pkgConfig", "args": "dbus-1 >= 1.2" },
+ {
+ "libs": "",
+ "builds": {
+ "debug": "-ldbus-1d",
+ "release": "-ldbus-1"
+ },
+ "condition": "config.win32"
+ },
+ { "libs": "-ldbus-1", "condition": "!config.win32" }
+ ]
+ },
+ "host_dbus": {
+ "description": "D-Bus >= 1.2 (host)",
+ "export": "",
+ "sources": [
+ { "type": "pkgConfig", "host": true, "args": "dbus-1 >= 1.2" },
+ { "libs": "", "comment": "placeholder for DBUS_HOST_PATH" }
+ ]
+ },
+ "libinput": {
+ "description": "libinput",
+ "test": "unix/libinput",
+ "sources": [
+ { "type": "pkgConfig", "args": "libinput" }
+ ]
+ },
+ "mtdev": {
+ "description": "mtdev",
+ "export": "",
+ "test": "unix/mtdev",
+ "sources": [
+ { "type": "pkgConfig", "args": "mtdev" }
+ ]
+ },
+ "tslib": {
+ "description": "tslib",
+ "test": "unix/tslib",
+ "sources": [
+ "-lts"
+ ]
+ },
+ "libudev": {
+ "description": "udev",
+ "test": "unix/libudev",
+ "sources": [
+ { "type": "pkgConfig", "args": "libudev" },
+ "-ludev"
+ ]
+ },
+ "xkbcommon": {
+ "description": "xkbcommon",
+ "export": "xkbcommon_evdev",
+ "test": "unix/xkbcommon",
+ "sources": [
+ { "type": "pkgConfig", "args": "xkbcommon" }
+ ]
+ },
+ "xkbcommon_x11": {
+ "description": "xkbcommon-x11 >= 0.4.1",
+ "export": "xkbcommon",
+ "sources": [
+ { "type": "pkgConfig", "args": "xkbcommon xkbcommon-x11 >= 0.4.1" }
+ ]
+ },
+ "xinput2": {
+ "description": "Xinput2",
+ "test": "x11/xinput2",
+ "sources": [
+ { "type": "pkgConfig", "args": "xi" },
+ "-lXi"
+ ]
+ },
+ "xrender": {
+ "description": "XRender",
+ "test": "x11/xrender",
+ "sources": [
+ "-lXrender"
+ ]
+ },
+ "xcb": {
+ "description": "XCB >= 1.5 (core)",
+ "test": "qpa/xcb",
+ "sources": [
+ { "type": "pkgConfig", "args": "xcb >= 1.5" },
+ "-lxcb"
+ ]
+ },
+ "xcb_syslibs": {
+ "description": "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": {
+ "description": "XCB Xlib",
+ "test": "qpa/xcb-xlib",
+ "sources": [
+ { "type": "pkgConfig", "args": "X11-xcb x11 xcb" },
+ "-lxcb -lX11 -lX11-xcb"
+ ]
+ },
+ "xcb_xkb": {
+ "description": "XCB XKB >= 1.10",
+ "test": "qpa/xcb-xkb",
+ "sources": [
+ { "type": "pkgConfig", "args": "xcb-xkb >= 1.10 xcb" },
+ "-lxcb-xkb -lxcb"
+ ]
+ },
+ "xcb_render": {
+ "description": "XCB XRender",
+ "test": "qpa/xcb-render",
+ "sources": [
+ { "type": "pkgConfig", "args": "xcb-renderutil xcb-render xcb" },
+ "-lxcb-render-util -lxcb-render -lxcb"
+ ]
+ },
+ "xcb_glx": {
+ "description": "XCB GLX",
+ "test": "qpa/xcb-glx",
+ "sources": [
+ { "type": "pkgConfig", "args": "xcb-glx xcb" },
+ "-lxcb-glx -lxcb"
+ ]
+ },
+ "x11sm": {
+ "description": "X11 session management",
+ "sources": [
+ { "type": "pkgConfig", "args": "sm ice" }
+ ]
+ },
+ "opengl": {
+ "description": "Desktop OpenGL",
+ "test": "unix/opengldesktop",
+ "sources": [
+ { "type": "pkgConfig", "args": "gl" },
+ { "type": "makeSpec", "spec": "OPENGL" }
+ ]
+ },
+ "opengl_es2": {
+ "description": "OpenGL ES 2.0",
+ "test": "unix/opengles2",
+ "sources": [
+ { "type": "pkgConfig", "args": "glesv2" },
+ { "type": "makeSpec", "spec": "OPENGL_ES2" }
+ ]
+ },
+ "egl": {
+ "description": "EGL",
+ "test": "qpa/egl",
+ "sources": [
+ { "type": "pkgConfig", "args": "egl" },
+ { "type": "makeSpec", "spec": "EGL" }
+ ]
+ },
+ "bcm_host": {
+ "export": "",
+ "sources": [
+ "-lbcm_host"
+ ]
+ },
+ "gbm": {
+ "description": "GBM",
+ "test": "qpa/gbm",
+ "sources": [
+ { "type": "pkgConfig", "args": "gbm" }
+ ]
+ },
+ "drm": {
+ "description": "KMS",
+ "test": "qpa/kms",
+ "sources": [
+ { "type": "pkgConfig", "args": "libdrm" },
+ "-ldrm"
+ ]
+ },
+ "wayland_server": {
+ "description": "Wayland Server",
+ "export": "",
+ "test": "qpa/wayland-server",
+ "sources": [
+ { "type": "pkgConfig", "args": "wayland-server" }
+ ]
+ },
+ "directfb": {
+ "description": "DirectFB",
+ "test": "qpa/directfb",
+ "sources": [
+ { "type": "pkgConfig", "args": "directfb" }
+ ]
+ },
+ "mirclient": {
+ "description": "Mir client libraries",
+ "export": "",
+ "test": "qpa/mirclient",
+ "sources": [
+ { "type": "pkgConfig", "args": "egl mirclient ubuntu-platform-api" }
+ ]
+ },
+ "directwrite": {
+ "description": "DirectWrite",
+ "export": "",
+ "test": "win/directwrite",
+ "sources": [
+ "-ldwrite"
+ ]
+ },
+ "journald": {
+ "description": "journald",
+ "test": "unix/journald",
+ "export": "",
+ "sources": [
+ { "type": "pkgConfig", "args": "libsystemd" },
+ { "type": "pkgConfig", "args": "libsystemd-journal" }
+ ]
+ },
+ "slog2": {
+ "description": "slog2",
+ "test": "unix/slog2",
+ "export": "",
+ "sources": [
+ "-lslog2"
+ ]
+ },
+ "imf": {
+ "description": "IMF",
+ "export": "",
+ "test": "unix/qqnx_imf",
+ "sources": [
+ "-linput_client"
+ ]
+ },
+ "pps": {
+ "description": "PPS",
+ "test": "unix/pps",
+ "sources": [
+ "-lpps"
+ ]
+ },
+ "lgmon": {
+ "description": "lgmon",
+ "test": "unix/lgmon",
+ "sources": [
+ "-llgmon"
+ ]
+ },
+ "db2": {
+ "description": "DB2 (IBM)",
+ "test": "unix/db2",
+ "sources": [
+ { "libs": "-ldb2cli", "condition": "config.win32" },
+ { "libs": "-ldb2", "condition": "!config.win32" }
+ ]
+ },
+ "ibase": {
+ "description": "InterBase",
+ "test": "unix/ibase",
+ "sources": [
+ { "libs": "-lgds32_ms", "condition": "config.win32" },
+ { "libs": "-lgds", "condition": "!config.win32" }
+ ]
+ },
+ "mysql": {
+ "description": "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": {
+ "description": "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": {
+ "description": "TDS (Sybase)",
+ "test": "unix/tds",
+ "sources": [
+ { "type": "sybaseEnv", "libs": "-lNTWDBLIB", "condition": "config.win32" },
+ { "type": "sybaseEnv", "libs": "-lsybdb", "condition": "!config.win32" }
+ ]
+ },
+ "oci": {
+ "description": "OCI (Oracle)",
+ "test": "unix/oci",
+ "sources": [
+ { "libs": "-loci", "condition": "config.win32" },
+ { "libs": "-lclntsh", "condition": "!config.win32" }
+ ]
+ },
+ "odbc": {
+ "description": "ODBC",
+ "test": "unix/odbc",
+ "sources": [
+ { "libs": "-lodbc32", "condition": "config.win32" },
+ { "libs": "-liodbc", "condition": "config.darwin" },
+ { "libs": "-lodbc", "condition": "!config.win32 && !config.darwin" }
+ ]
+ },
+ "sqlite2": {
+ "description": "SQLite (version 2)",
+ "test": "unix/sqlite2",
+ "sources": [
+ "-lsqlite"
+ ]
+ },
+ "sqlite3": {
+ "description": "SQLite (version 3)",
+ "export": "sqlite",
+ "test": "unix/sqlite",
+ "sources": [
+ { "type": "pkgConfig", "args": "sqlite3" },
+ { "libs": "-lsqlite3", "condition": "config.win32" },
+ { "libs": "-lsqlite3 -lz", "condition": "!config.win32" }
+ ]
+ }
+ },
+
+ "testTypeDependencies": {
+ "linkerSupportsFlag": [ "use_gold_linker" ],
+ "verifySpec": [ "shared", "use_gold_linker", "compiler-flags", "gcc-sysroot", "qmakeargs" ],
+ "compile": [ "verifyspec" ],
+ "detectPkgConfig": [ "cross_compile" ],
+ "library": [ "pkg-config" ],
+ "getPkgConfigVariable": [ "pkg-config" ],
+ "neon": [ "architecture" ],
+ "directX": [ "architecture", "sse2" ]
+ },
+
+ "testTypeAliases": {
+ "compile": [ "library", "architecture" ],
+ "files": [ "directX" ],
+ "getPkgConfigVariable": [ "xkbConfigRoot" ]
+ },
+
"tests": {
+ "verifyspec": {
+ "description": "valid makespec",
+ "type": "verifySpec",
+ "test": "common/verifyspec"
+ },
"architecture": {
"description": "target architecture",
"type": "architecture",
@@ -236,7 +823,7 @@
"test": "common/c++1z"
},
"cxx98default": {
- "description": "compilers defaulting to C++98",
+ "description": "compiler defaulting to C++98",
"type": "compile",
"test": "common/c++98default"
},
@@ -247,9 +834,8 @@
},
"precompile_header": {
"description": "precompiled header support",
- "type": "shell",
- "test": "unix/precomp.test",
- "args": "$$QMAKE_CXX yes"
+ "type": "compile",
+ "test": "common/pch"
},
"use_gold_linker": {
"description": "gold linker",
@@ -263,15 +849,13 @@
},
"reduce_exports": {
"description": "symbol visibility support",
- "type": "shell",
- "test": "unix/fvisibility.test",
- "args": "$$QMAKE_CXX yes"
+ "type": "compile",
+ "test": "unix/reduce_exports"
},
"reduce_relocations": {
"description": "-Bsymbolic-functions support",
- "type": "shell",
- "test": "unix/bsymbolic_functions.test",
- "args": "$$QMAKE_CXX yes"
+ "type": "compile",
+ "test": "unix/reduce_relocs"
},
"skip_modules": {
"description": "modules to skip",
@@ -288,11 +872,6 @@
"type": "compile",
"test": "unix/dlopen"
},
- "libdl": {
- "description": "dlopen() in libdl",
- "type": "compile",
- "test": "unix/libdl"
- },
"separate_debug_info": {
"description": "separate debug information support",
"type": "compile",
@@ -303,12 +882,6 @@
"type": "compile",
"test": "common/atomic64"
},
- "atomic64_libatomic": {
- "description": "64 bit atomics in libatomic",
- "type": "compile",
- "test": "common/atomic64",
- "libs": "-latomic"
- },
"atomicfptr": {
"description": "working std::atomic for function pointers",
"type": "compile",
@@ -432,11 +1005,6 @@
"type": "compile",
"test": "unix/clock-monotonic"
},
- "alsa": {
- "description": "ALSA",
- "type": "compile",
- "test": "unix/alsa"
- },
"evdev": {
"description": "evdev",
"type": "compile",
@@ -447,20 +1015,17 @@
"type": "compile",
"test": "unix/eventfd"
},
- "gbm": {
- "description": "GBM",
- "type": "compile",
- "test": "qpa/gbm"
- },
"getaddrinfo": {
"description": "getaddrinfo()",
"type": "compile",
- "test": "unix/getaddrinfo"
+ "test": "unix/getaddrinfo",
+ "use": "network"
},
"getifaddrs": {
"description": "getifaddrs()",
"type": "compile",
- "test": "unix/getifaddrs"
+ "test": "unix/getifaddrs",
+ "use": "network"
},
"inotify": {
"description": "inotify",
@@ -470,38 +1035,19 @@
"ipv6ifname": {
"description": "IPv6 ifname",
"type": "compile",
- "test": "unix/ipv6ifname"
- },
- "libproxy": {
- "description": "libproxy",
- "type": "compile",
- "test": "common/libproxy"
+ "test": "unix/ipv6ifname",
+ "use": "network"
},
"linuxfb": {
"description": "LinuxFB",
"type": "compile",
"test": "qpa/linuxfb"
},
- "kms": {
- "description": "KMS",
- "type": "compile",
- "test": "qpa/kms"
- },
- "mirclient": {
- "description": "Mir client libraries",
- "type": "compile",
- "test": "qpa/mirclient"
- },
"mremap": {
"description": "mremap()",
"type": "compile",
"test": "unix/mremap"
},
- "mtdev": {
- "description": "mtdev",
- "type": "compile",
- "test": "unix/mtdev"
- },
"journald": {
"description": "journald",
"type": "compile",
@@ -522,26 +1068,6 @@
"type": "compilerSupportsFlag",
"test": "-fstack-protector-strong"
},
- "slog2": {
- "description": "slog2",
- "type": "compile",
- "test": "unix/slog2"
- },
- "imf": {
- "description": "IMF",
- "type": "compile",
- "test": "unix/qqnx_imf"
- },
- "pps": {
- "description": "PPS",
- "type": "compile",
- "test": "unix/pps"
- },
- "lgmon": {
- "description": "lgmon",
- "type": "compile",
- "test": "unix/lgmon"
- },
"ipc_sysv": {
"description": "SysV IPC",
"type": "compile",
@@ -552,11 +1078,6 @@
"type": "compile",
"test": "unix/ipc_posix"
},
- "tslib": {
- "description": "tslib",
- "type": "compile",
- "test": "unix/tslib"
- },
"ppoll": {
"description": "ppoll()",
"type": "compile",
@@ -577,67 +1098,16 @@
"type": "compile",
"test": "unix/cloexec"
},
- "corewlan": {
- "description": "CoreWLan",
- "type": "compile",
- "test": "mac/corewlan"
- },
"openssl": {
"description": "OpenSSL",
"type": "compile",
"test": "unix/openssl"
},
- "openssl-libs": {
- "description": "OpenSSL Libraries",
- "type": "openssl",
- "libs": "-lssl -lcrypto"
- },
"sctp": {
"description": "SCTP support",
"type": "compile",
- "test": "unix/sctp"
- },
- "icu": {
- "description": "ICU",
- "type": "compile",
- "test": "unix/icu"
- },
- "glib": {
- "description": "GLib",
- "type": "compile",
- "test": "unix/glib",
- "pkg-config-args": "glib-2.0 gthread-2.0"
- },
- "gtk": {
- "description": "GTK+",
- "type": "pkgConfig",
- "pkg-config-args": "gtk+-3.0"
- },
- "pulseaudio": {
- "description": "PulseAudio >= 0.9.10",
- "type": "compile",
- "test": "unix/pulseaudio",
- "pkg-config-args": "libpulse >= 0.9.10 libpulse-mainloop-glib"
- },
- "cups": {
- "description": "CUPS",
- "type": "compile",
- "test": "unix/cups"
- },
- "libjpeg": {
- "description": "libjpeg",
- "type": "compile",
- "test": "unix/libjpeg"
- },
- "libpng": {
- "description": "libpng",
- "type": "compile",
- "test": "unix/libpng"
- },
- "zlib": {
- "description": "zlib",
- "type": "compile",
- "test": "unix/zlib"
+ "test": "unix/sctp",
+ "use": "network"
},
"posix-iconv": {
"description": "POSIX iconv",
@@ -649,191 +1119,52 @@
"type": "compile",
"test": "unix/sun-libiconv"
},
- "gnu-iconv": {
- "description": "GNU libiconv",
- "type": "compile",
- "test": "unix/gnu-libiconv"
- },
- "freetype": {
- "description": "FreeType",
- "type": "compile",
- "test": "unix/freetype"
- },
- "fontconfig": {
- "description": "Fontconfig",
- "type": "compile",
- "test": "unix/fontconfig",
- "pkg-config-args": "fontconfig freetype2",
- "libs": "-lfontconfig -lfreetype"
- },
- "harfbuzz": {
- "description": "HarfBuzz",
- "type": "compile",
- "test": "unix/harfbuzz"
- },
- "dbus": {
- "description": "D-Bus >= 1.2",
- "type": "compile",
- "test": "unix/dbus",
- "pkg-config-args": "dbus-1 >= 1.2"
- },
- "host-dbus": {
- "description": "D-Bus >= 1.2 (host)",
- "type": "pkgConfig",
- "host": true,
- "pkg-config-args": "dbus-1 >= 1.2"
- },
- "directfb": {
- "description": "DirectFB",
- "type": "compile",
- "test": "qpa/directfb",
- "pkg-config-args": "directfb"
- },
- "egl": {
- "description": "EGL",
- "type": "compile",
- "test": "qpa/egl",
- "pkg-config-args": "egl"
- },
"egl-x11": {
"description": "EGL on X11",
"type": "compile",
"test": "qpa/egl-x11",
- "pkg-config-args": "egl"
+ "use": "egl xcb_xlib"
},
- "eglfs-brcm": {
+ "egl-brcm": {
"description": "Broadcom EGL (Rasberry Pi)",
"type": "compile",
"test": "qpa/eglfs-brcm",
- "pkg-config-args": "egl"
+ "use": "egl bcm_host"
},
- "eglfs-egldevice": {
+ "egl-egldevice": {
"description": "EGLDevice",
"type": "compile",
- "test": "qpa/eglfs-egldevice"
+ "test": "qpa/eglfs-egldevice",
+ "use": "egl"
},
- "eglfs-mali": {
+ "egl-mali": {
"description": "Mali EGL",
"type": "compile",
- "test": "qpa/eglfs-mali"
- },
- "eglfs-viv": {
- "description": "i.Mx6 EGL",
- "type": "compile",
- "test": "qpa/eglfs-viv"
- },
- "wayland-server": {
- "description": "Wayland Server",
- "type": "compile",
- "test": "qpa/wayland-server"
- },
- "libinput": {
- "description": "libinput",
- "type": "compile",
- "test": "unix/libinput",
- "pkg-config-args": "libinput"
- },
- "libudev": {
- "description": "udev",
- "type": "compile",
- "test": "unix/libudev",
- "pkg-config-args": "libudev"
- },
- "xkbcommon": {
- "description": "xkbcommon",
- "type": "compile",
- "test": "unix/xkbcommon",
- "pkg-config-args": "xkbcommon"
- },
- "xkbcommon-x11": {
- "description": "xkbcommon-x11 >= 0.4.1",
- "type": "pkgConfig",
- "pkg-config-args": "xkbcommon xkbcommon-x11 >= 0.4.1"
+ "test": "qpa/eglfs-mali",
+ "use": "egl"
},
- "xinput2": {
- "description": "Xinput2",
+ "egl-mali-2": {
+ "description": "Mali 2 EGL",
"type": "compile",
- "test": "x11/xinput2",
- "pkg-config-args": "xi"
+ "test": "qpa/eglfs-mali-2",
+ "use": "egl"
},
- "doubleconversion": {
- "description": "DoubleConversion",
+ "egl-viv": {
+ "description": "i.Mx6 EGL",
"type": "compile",
- "test": "unix/doubleconversion"
+ "test": "qpa/eglfs-viv",
+ "use": "egl"
},
"xlocalescanprint": {
"description": "xlocale.h (or equivalents)",
"type": "compile",
"test": "common/xlocalescanprint"
},
- "pcre": {
- "description": "PCRE",
- "type": "compile",
- "test": "unix/pcre"
- },
- "gstreamer-1_0": {
- "description": "GStreamer 1.0",
- "type": "compile",
- "test": "unix/gstreamer",
- "args": "-config gst-1.0"
- },
- "gstreamer-0_10": {
- "description": "GStreamer 0.10",
- "type": "compile",
- "test": "unix/gstreamer",
- "args": "-config gst-0.10"
- },
- "xcb": {
- "description": "XCB >= 1.5 (core)",
- "type": "compile",
- "test": "qpa/xcb",
- "pkg-config-args": "xcb >= 1.5"
- },
- "xcb-syslibs": {
- "description": "XCB (secondary)",
- "type": "compile",
- "test": "qpa/xcb-syslibs",
- "pkg-config-args": "xcb xcb-shm xcb-sync xcb-xfixes xcb-randr xcb-image xcb-keysyms xcb-icccm xcb-shape"
- },
- "xcb-xkb": {
- "description": "XCB XKB >= 1.10",
- "type": "compile",
- "test": "qpa/xcb-xkb",
- "pkg-config-args": "xcb-xkb >= 1.10"
- },
- "xcb-render": {
- "description": "XCB XRender",
- "type": "compile",
- "test": "qpa/xcb-render",
- "pkg-config-args": "xcb"
- },
- "xcb-glx": {
- "description": "XCB GLX",
- "type": "compile",
- "test": "qpa/xcb-glx",
- "pkg-config-args": "xcb"
- },
- "xcb-xlib": {
- "description": "XCB Xlib",
- "type": "compile",
- "test": "qpa/xcb-xlib",
- "pkg-config-args": "xcb"
- },
- "x11-sm": {
- "description": "X11 session management",
- "type": "pkgConfig",
- "pkg-config-args": "sm ice"
- },
"xlib": {
"description": "XLib",
"type": "compile",
"test": "x11/xlib"
},
- "xrender": {
- "description": "XRender",
- "type": "compile",
- "test": "x11/xrender"
- },
"x11prefix": {
"description": "X11 prefix",
"type": "getPkgConfigVariable",
@@ -849,105 +1180,53 @@
"pkg-config-variable": "xkb_base",
"log": "value"
},
- "opengl-desktop": {
- "description": "Desktop OpenGL",
- "type": "compile",
- "test": "unix/opengldesktop",
- "pkg-config-args": "gl"
- },
- "opengl-mingw": {
- "description": "Desktop OpenGL",
- "type": "compile",
- "test": "x11/opengl"
- },
- "opengles2": {
- "description": "OpenGL ES 2.0",
- "type": "compile",
- "test": "unix/opengles2",
- "pkg-config-args": "glesv2"
+ "directx": {
+ "description": "DirectX SDK",
+ "type": "directX",
+ "files": [
+ "d3dcompiler.h",
+ "d3d11.lib",
+ "fxc.exe"
+ ]
},
"opengles3": {
"description": "OpenGL ES 3.0",
"type": "compile",
"test": "unix/opengles3",
- "pkg-config-args": "glesv2"
+ "use": "opengl_es2"
},
"opengles31": {
"description": "OpenGL ES 3.1",
"type": "compile",
"test": "unix/opengles31",
- "pkg-config-args": "glesv2"
- },
- "db2": {
- "description": "DB2 (IBM)",
- "type": "compile",
- "test": "unix/db2"
+ "use": "opengl_es2"
},
- "ibase": {
- "description": "InterBase",
- "type": "compile",
- "test": "unix/ibase"
- },
- "mysql": {
- "description": "MySQL",
- "type": "mysqlCompile",
- "test": "unix/mysql",
- "query": "--libs"
- },
- "mysql_r": {
- "description": "MySQL (threadsafe)",
- "type": "mysqlCompile",
- "test": "unix/mysql_r",
- "query": "--libs_r"
- },
- "oci": {
- "description": "OCI (Oracle)",
- "type": "compile",
- "test": "unix/oci"
- },
- "odbc": {
- "description": "ODBC",
- "type": "compile",
- "test": "unix/odbc",
- "libs": "-lodbc"
- },
- "iodbc": {
- "description": "iODBC",
+ "directwrite2": {
+ "description": "DirectWrite 2",
"type": "compile",
- "test": "unix/iodbc",
- "libs": "-liodbc"
- },
- "psql": {
- "description": "PostgreSQL",
- "type": "psqlCompile",
- "test": "unix/psql"
+ "test": "win/directwrite2",
+ "use": "directwrite"
},
- "sqlite2": {
- "description": "SQLite (version 2)",
- "type": "compile",
- "test": "unix/sqlite2"
+ "uxtheme": {
+ "description": "uxtheme.h",
+ "type": "files",
+ "files": [ "uxtheme.h" ]
},
- "sqlite": {
- "description": "SQLite (version 3)",
+ "direct2d": {
+ "description": "Direct 2D",
"type": "compile",
- "test": "unix/sqlite",
- "pkg-config-args": "sqlite3",
- "libs": "-lsqlite3 -lz"
+ "test": "qpa/direct2d",
+ "use": "direct2d"
},
- "tds": {
- "description": "TDS (Sybase)",
- "type": "tdsCompile",
- "test": "unix/tds"
+ "incredibuild_xge": {
+ "description": "IncrediBuild",
+ "type": "files",
+ "files": [ "BuildConsole.exe", "xgConsole.exe" ]
},
- "directwrite": {
- "description": "DirectWrite",
- "type": "compile",
- "test": "win/directwrite"
- },
- "directwrite2": {
- "description": "DirectWrite 2",
- "type": "compile",
- "test": "win/directwrite2"
+ "wmf": {
+ "description": "WMF",
+ "type": "files",
+ "files": [ "mfapi.h", "mf.lib" ]
},
"qpa_default_platform": {
"description": "default QPA platform",
@@ -962,12 +1241,18 @@
"condition": "!config.uikit && !config.integrity",
"output": [
"shared",
+ "publicFeature",
"publicQtConfig",
- "publicConfig",
- { "type": "publicQtConfig", "negative": true, "name": "static" },
- { "type": "publicConfig", "negative": true, "name": "static" }
- ],
- "priority": -3
+ "publicConfig"
+ ]
+ },
+ "static": {
+ "condition": "!features.shared",
+ "output": [
+ "publicFeature",
+ "publicQtConfig",
+ "publicConfig"
+ ]
},
"cross_compile": {
"description": "Cross compiling",
@@ -975,39 +1260,43 @@
"output": [ "publicConfig", "privateConfig" ]
},
"cxx98default": {
- "description": "Compilers defaulting to C++98",
+ "description": "Compiler defaults to C++98",
"condition": "tests.cxx98default",
"output": [ { "type": "publicConfig", "name": "c++11" } ]
},
"compiler-flags": {
- "output": [ "compilerFlags" ],
- "priority": -3
+ "output": [ "compilerFlags" ]
},
"gcc-sysroot": {
"output": [ "gccSysroot" ],
- "condition": "input.sysroot != ''",
- "priority": -3
+ "condition": "input.sysroot != ''"
+ },
+ "qmakeargs": {
+ "output": [ "qmakeArgs" ],
+ "condition": "input.qmakeArgs != ''"
},
"use_gold_linker": {
"description": "Using gold linker",
- "condition": "tests.use_gold_linker",
- "output": [ "privateConfig", "useGoldLinker" ],
- "priority": -2
+ "condition": "!config.msvc && tests.use_gold_linker",
+ "output": [ "privateConfig", "useGoldLinker" ]
},
"architecture": {
"description": "Architecture",
- "output": [ "architecture" ],
- "priority": -1
+ "output": [ "architecture" ]
},
"pkg-config": {
"description": "Using pkg-config",
- "autoDetect": "!config.darwin",
+ "autoDetect": "!config.darwin && !config.win32",
"condition": "tests.pkg-config",
"output": [
+ "publicFeature",
{ "type": "publicQtConfig", "negative": true },
"pkgConfig"
- ],
- "priority": -1
+ ]
+ },
+ "verifyspec": {
+ "description": "Have valid makespec",
+ "condition": "tests.verifyspec"
},
"developer-build": {
@@ -1015,6 +1304,7 @@
"autoDetect": false,
"output": [
{ "type": "define", "name": "QT_BUILD_INTERNAL" },
+ { "type": "privateFeature", "name": "private_tests" },
{ "type": "publicQtConfig", "name": "private_tests" }
]
},
@@ -1026,7 +1316,7 @@
"description": "Compile libs in debug and release mode",
"autoDetect": "input.debug == ''",
"condition": "config.darwin || config.win32",
- "output": [ "publicQtConfig", "debugAndRelease" ]
+ "output": [ "publicFeature", "publicQtConfig", "debugAndRelease" ]
},
"force_debug_info": {
"description": "Add debug info in release mode",
@@ -1041,25 +1331,25 @@
"features.debug || features.debug_and_release || features.force_debug_info",
"config.darwin || tests.separate_debug_info"
],
- "output": [ "publicQtConfig" ]
+ "output": [ "publicFeature", "publicQtConfig" ]
},
"release_tools": {
"description": "Compile tools in release mode",
- "output": [ "publicQtConfig" ]
+ "output": [ "privateFeature", "publicQtConfig" ]
},
"simulator_and_device": {
"description": "Build for both simulator and device",
"condition": "config.uikit && input.sdk == ''",
- "output": [ "publicQtConfig" ]
+ "output": [ "publicFeature", "publicQtConfig" ]
},
"build_all": {
"condition": "features.debug_and_release || features.simulator_and_device",
- "output": [ "publicQtConfig" ]
+ "output": [ "publicFeature", "publicQtConfig" ]
},
"rpath": {
"description": "Build with RPATH",
"autoDetect": "var.QMAKE_LFLAGS_RPATH != '' && features.shared",
- "output": [ "publicQtConfig" ]
+ "output": [ "publicFeature", "publicQtConfig" ]
},
"rpath_dir": {
"description": "RPATH directory",
@@ -1076,7 +1366,7 @@
"force_asserts": {
"description": "Force assertions",
"autoDetect": false,
- "output": [ "publicQtConfig" ]
+ "output": [ "publicFeature" ]
},
"warnings_are_errors": {
"description": "WError",
@@ -1093,14 +1383,14 @@
"condition": "config.darwin && features.shared",
"output": [
{ "type": "define", "name": "QT_MAC_FRAMEWORK_BUILD" },
+ "publicFeature",
{ "type": "publicQtConfig", "name": "qt_framework"},
{ "type": "publicConfig", "name": "qt_framework"}
]
},
"largefile": {
"description": "Large file support",
- "emitIf": "!config.win32",
- "condition": "!config.android && !config.integrity",
+ "condition": "!config.android && !config.integrity && !config.winrt",
"output": [
"privateConfig",
{ "type": "define", "name": "QT_LARGEFILE_SUPPORT", "value": 64 }
@@ -1152,6 +1442,12 @@
"condition": "tests.GNUmake",
"output": [ "privateConfig" ]
},
+ "plugin-manifests": {
+ "description": "Embed manifests in plugins",
+ "emitIf": "config.win32",
+ "autoDetect": false,
+ "output": [ { "type": "publicConfig", "negative": true, "name": "no_plugin_manifest" } ]
+ },
"profile": {
"description": "GNU profiling support",
"autoDetect": false,
@@ -1173,17 +1469,17 @@
},
"c++11": {
"description": "C++11",
- "output": [ "publicQtConfig" ]
+ "output": [ "publicFeature", "publicQtConfig" ]
},
"c++14": {
"description": "C++14",
"condition": "features.c++11 && tests.c++14",
- "output": [ "publicQtConfig" ]
+ "output": [ "publicFeature", "publicQtConfig" ]
},
"c++1z": {
"description": "C++1z",
"condition": "features.c++14 && tests.c++1z",
- "output": [ "publicQtConfig" ]
+ "output": [ "publicFeature", "publicQtConfig" ]
},
"compiler": {
"description": "Compiler version",
@@ -1192,7 +1488,7 @@
},
"precompile_header": {
"description": "Using precompiled headers",
- "condition": "!config.uikit && tests.precompile_header",
+ "condition": "config.msvc || (!config.uikit && tests.precompile_header)",
"output": [
"privateConfig",
{ "type": "varRemove", "negative": true, "name": "CONFIG", "value": "'precompile_header'" }
@@ -1212,36 +1508,39 @@
"description": "Reduce amount of exported symbols",
"condition": "!config.win32 && tests.reduce_exports",
"output": [
+ "privateFeature",
"publicQtConfig",
{ "type": "define", "name": "QT_VISIBILITY_AVAILABLE" }
]
},
"reduce_relocations": {
"description": "Reduce amount of relocations",
- "condition": "tests.reduce_relocations",
+ "condition": "!config.win32 && tests.reduce_relocations",
"output": [
+ "privateFeature",
"publicQtConfig",
{ "type": "define", "name": "QT_REDUCE_RELOCATIONS" }
]
},
"dlopen": {
"description": "dlopen()",
- "condition": "tests.dlopen || tests.libdl",
+ "condition": "tests.dlopen || libs.libdl",
"output": [ { "type": "define", "negative": true, "name": "QT_NO_DYNAMIC_LIBRARY" } ]
},
"libdl": {
"description": "dlopen() in libdl",
- "condition": "!tests.dlopen && tests.libdl",
+ "condition": "!tests.dlopen && libs.libdl",
"output": [ { "type": "privateConfig", "negative": true } ]
},
"std-atomic64": {
"description": "64 bit atomic operations",
- "condition": "tests.atomic64 || tests.atomic64_libatomic",
- "output": [
- { "type": "define", "negative": true, "name": "QT_NO_STD_ATOMIC64" },
- { "type": "privateConfig", "name": "atomic64-libatomic",
- "condition": "!tests.atomic64 && tests.atomic64_libatomic" }
- ]
+ "condition": "tests.atomic64 || libs.libatomic",
+ "output": [ { "type": "define", "negative": true, "name": "QT_NO_STD_ATOMIC64" } ]
+ },
+ "libatomic": {
+ "description": "64 bit atomic operations in libatomic",
+ "condition": "!tests.atomic64 && libs.libatomic",
+ "output": [ "privateFeature" ]
},
"sse2": {
"description": "SSE2",
@@ -1398,7 +1697,7 @@
"clock-gettime": {
"description": "clock_gettime()",
"condition": "tests.clock-gettime",
- "output": [ "publicQtConfig" ]
+ "output": [ "privateFeature" ]
},
"clock-monotonic": {
"description": "POSIX monotonic clock",
@@ -1407,7 +1706,7 @@
},
"alsa": {
"description": "ALSA",
- "condition": "tests.alsa",
+ "condition": "libs.alsa",
"output": [ "feature" ]
},
"evdev": {
@@ -1422,7 +1721,7 @@
},
"gbm": {
"description": "GBM",
- "condition": "tests.gbm",
+ "condition": "libs.gbm",
"output": [ "publicQtConfig" ]
},
"getaddrinfo": {
@@ -1438,7 +1737,7 @@
"inotify": {
"description": "inotify",
"condition": "tests.inotify",
- "output": [ "feature" ]
+ "output": [ "privateFeature", "feature" ]
},
"ipv6ifname": {
"description": "IPv6 ifname",
@@ -1448,37 +1747,34 @@
"libproxy": {
"description": "libproxy",
"autoDetect": false,
- "condition": "tests.libproxy",
- "output": [ "feature" ]
+ "condition": "libs.libproxy",
+ "output": [ "privateFeature" ]
},
"linuxfb": {
"description": "LinuxFB",
"condition": "tests.linuxfb",
- "output": [ "publicQtConfig" ]
+ "output": [ "privateFeature" ]
},
"directfb": {
"description": "DirectFB",
"autoDetect": false,
- "condition": "tests.directfb",
- "output": [
- "publicQtConfig",
- { "type": "library", "test": "directfb" }
- ]
+ "condition": "libs.directfb",
+ "output": [ "privateFeature" ]
},
"integrityfb": {
"description": "INTEGRITY framebuffer",
"condition": "config.integrity",
- "output": [ "publicQtConfig" ]
+ "output": [ "privateFeature" ]
},
"kms": {
"description": "KMS",
- "condition": "tests.kms",
+ "condition": "libs.drm",
"output": [ "publicQtConfig" ]
},
"mirclient": {
"description": "Mir client",
- "condition": "tests.mirclient",
- "output": [ "publicQtConfig" ]
+ "condition": "libs.mirclient",
+ "output": [ "privateFeature" ]
},
"mremap": {
"description": "mremap()",
@@ -1487,19 +1783,19 @@
},
"mtdev": {
"description": "mtdev",
- "condition": "tests.mtdev",
+ "condition": "libs.mtdev",
"output": [ "privateFeature" ]
},
"journald": {
"description": "journald",
"autoDetect": false,
- "condition": "tests.journald",
+ "condition": "libs.journald",
"output": [ "privateConfig" ]
},
"posix_fallocate": {
"description": "POSIX fallocate()",
"condition": "tests.posix_fallocate",
- "output": [ "feature" ]
+ "output": [ "privateFeature" ]
},
"syslog": {
"description": "syslog",
@@ -1507,60 +1803,65 @@
"condition": "tests.syslog",
"output": [ "privateConfig" ]
},
- "stack_protector_strong": {
+ "stack-protector-strong": {
"description": "stack protection",
"condition": "config.qnx && tests.stack_protector",
"output": [ "publicQtConfig" ]
},
"slog2": {
"description": "slog2",
- "condition": "tests.slog2",
+ "condition": "libs.slog2",
"emitIf": "config.qnx",
"output": [ "privateConfig" ]
},
"qqnx_imf": {
"description": "IMF",
"emitIf": "config.qnx",
- "condition": "tests.imf",
+ "condition": "libs.imf",
"output": [ "privateConfig" ]
},
"qqnx_pps": {
"description": "PPS",
"emitIf": "config.qnx",
- "condition": "tests.pps",
+ "condition": "libs.pps",
"output": [ "privateConfig" ]
},
"lgmon": {
"description": "lgmon",
"emitIf": "config.qnx",
- "condition": "tests.lgmon",
+ "condition": "libs.lgmon",
"output": [ "privateConfig" ]
},
"poll_ppoll": {
"description": "Native ppoll()",
+ "emitIf": "!config.win32",
"condition": "tests.ppoll",
- "output": [ "publicQtConfig" ]
+ "output": [ "privateFeature" ]
},
"poll_pollts": {
"description": "Native pollts()",
+ "emitIf": "!config.win32",
"condition": "!features.poll_ppoll && tests.pollts",
- "output": [ "publicQtConfig" ]
+ "output": [ "privateFeature" ]
},
"poll_poll": {
"description": "Native poll()",
+ "emitIf": "!config.win32",
"condition": "!features.poll_ppoll && !features.poll_pollts && tests.poll",
- "output": [ "publicQtConfig" ]
+ "output": [ "privateFeature" ]
},
"poll_select": {
"description": "Emulated poll()",
+ "emitIf": "!config.win32",
"condition": "!features.poll_ppoll && !features.poll_pollts && !features.poll_poll",
"output": [
- "publicQtConfig",
+ "privateFeature",
{ "type": "define", "name": "QT_NO_NATIVE_POLL" }
]
},
"ipc_posix": {
"description": "Using POSIX IPC",
+ "autoDetect": "!config.win32",
"condition": "!tests.ipc_sysv && tests.ipc_posix",
"output": [ { "type": "define", "name": "QT_POSIX_IPC" } ]
},
@@ -1584,28 +1885,32 @@
},
"tslib": {
"description": "tslib",
- "condition": "tests.tslib",
+ "condition": "libs.tslib",
"output": [ "privateFeature" ]
},
"corewlan": {
"description": "CoreWLan",
- "condition": "tests.corewlan",
+ "condition": "libs.corewlan",
"emitIf": "config.darwin",
- "output": [ "feature" ]
+ "output": [ "feature", "privateFeature" ]
},
"securetransport": {
"description": "SecureTransport",
+ "disable": "input.securetransport == 'no' || input.ssl == 'no'",
"condition": "config.darwin && (input.openssl == '' || input.openssl == 'no')",
"output": [
- "publicQtConfig",
+ "privateFeature",
{ "type": "define", "name": "QT_SECURETRANSPORT" }
]
},
"openssl": {
"description": "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" }
]
@@ -1614,75 +1919,70 @@
"description": " Qt directly linked to OpenSSL",
"enable": "input.openssl == 'linked'",
"disable": "input.openssl != 'linked'",
- "condition": "features.openssl && tests.openssl-libs",
+ "condition": "features.openssl && libs.openssl",
"output": [
- "publicQtConfig",
- { "type": "varAssign", "name": "OPENSSL_LIBS", "value": "tests.openssl-libs.libs" },
+ "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" }
]
},
"ssl": {
"description": "SSL",
- "condition": "features.securetransport || features.openssl",
- "output": [ "feature" ]
+ "condition": "config.winrt || features.securetransport || features.openssl",
+ "output": [ "publicFeature", "feature" ]
},
"sctp": {
"description": "SCTP",
"autoDetect": false,
"condition": "tests.sctp",
- "output": [ "feature" ]
+ "output": [ "publicFeature", "feature" ]
},
"accessibility": {
"description": "Accessibility",
- "output": [ "feature" ]
+ "output": [ "publicFeature", "feature" ]
},
"accessibility-atspi-bridge": {
"description": "ATSPI Bridge",
- "emitIf": "features.accessibility && features.xcb",
- "condition": "features.dbus",
- "output": [ "feature" ]
+ "condition": "features.accessibility && features.xcb && features.dbus",
+ "output": [ "privateFeature", "feature" ]
},
"glib": {
"description": "GLib",
- "condition": "tests.glib",
- "output": [
- "feature",
- { "type": "library", "test": "glib" }
- ]
+ "autoDetect": "!config.win32",
+ "condition": "libs.glib",
+ "output": [ "privateFeature", "feature" ]
},
"gtk3": {
"description": "GTK+",
"autoDetect": "!config.darwin",
- "condition": "features.glib && tests.gtk",
- "output": [
- "publicQtConfig",
- { "type": "library", "test": "gtk" }
- ]
+ "condition": "features.glib && libs.gtk3",
+ "output": [ "privateFeature" ]
},
"icu": {
"description": "ICU",
"autoDetect": "!config.win32",
- "condition": "tests.icu",
- "output": [ "publicQtConfig" ]
+ "condition": "libs.icu",
+ "output": [ "privateFeature" ]
},
"pulseaudio": {
"description": "PulseAudio",
- "condition": "tests.pulseaudio",
- "output": [
- "feature",
- { "type": "library", "test": "pulseaudio" }
- ]
+ "condition": "libs.pulseaudio",
+ "output": [ "feature" ]
},
"cups": {
"description": "CUPS",
- "condition": "tests.cups",
- "output": [ "feature" ]
+ "condition": "libs.cups",
+ "output": [ "privateFeature", "feature" ]
},
"jpeg": {
"description": "JPEG",
"disable": "input.libjpeg == 'no'",
"output": [
- "publicQtConfig",
+ "privateFeature",
{ "type": "define", "negative": true, "name": "QT_NO_IMAGEFORMAT_JPEG" }
]
},
@@ -1690,13 +1990,13 @@
"description": " Using system libjpeg",
"disable": "input.libjpeg == 'qt'",
"enable": "input.libjpeg == 'system'",
- "condition": "features.jpeg && tests.libjpeg",
- "output": [ "publicQtConfig" ]
+ "condition": "features.jpeg && libs.libjpeg",
+ "output": [ "privateFeature" ]
},
"gif": {
"description": "GIF",
"output": [
- "publicQtConfig",
+ "privateFeature",
{ "type": "define", "negative": true, "name": "QT_NO_IMAGEFORMAT_GIF" }
]
},
@@ -1704,7 +2004,7 @@
"description": "PNG",
"disable": "input.libpng == 'no'",
"output": [
- "publicQtConfig",
+ "privateFeature",
{ "type": "define", "negative": true, "name": "QT_NO_IMAGEFORMAT_PNG" }
]
},
@@ -1712,85 +2012,93 @@
"description": " Using system libpng",
"disable": "input.libpng == 'qt'",
"enable": "input.libpng == 'system'",
- "condition": "features.png && tests.libpng",
- "output": [ "publicQtConfig" ]
+ "condition": "features.png && libs.libpng",
+ "output": [ "privateFeature" ]
+ },
+ "ico": {
+ "description": "ICO",
+ "output": [ "privateFeature", "feature" ]
},
"system-zlib": {
"description": "Using system zlib",
- "condition": "config.darwin || tests.zlib",
- "output": [ "publicQtConfig" ]
+ "condition": "libs.zlib",
+ "output": [ "privateFeature" ]
},
"iconv": {
"description": "iconv",
- "condition": "!config.win32 && (tests.posix-iconv || features.sun-libiconv || features.gnu-libiconv)",
- "output": [ "feature" ]
+ "condition": "features.posix-libiconv || features.sun-libiconv || features.gnu-libiconv",
+ "output": [ "privateFeature", "feature" ]
+ },
+ "posix-libiconv": {
+ "description": "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": {
"description": "SUN iconv",
- "condition": "!config.win32 && !tests.posix-iconv && tests.sun-iconv",
- "output": [ "publicQtConfig" ]
+ "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": {
"description": "GNU iconv",
- "condition": "!config.win32 && !tests.posix-iconv && !tests.sun-iconv && tests.gnu-iconv",
- "output": [ "publicQtConfig" ]
+ "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" ]
},
"freetype": {
"description": "FreeType",
- "output": [ "feature" ]
+ "output": [ "privateFeature", "feature" ]
},
"system-freetype": {
"description": " Using system FreeType",
"enable": "input.freetype == 'system'",
"disable": "input.freetype == 'qt'",
"autoDetect": "!config.win32",
- "condition": "features.freetype && tests.freetype",
- "output": [ "publicQtConfig" ]
+ "condition": "features.freetype && libs.freetype",
+ "output": [ "privateFeature" ]
},
"fontconfig": {
"description": "Fontconfig",
- "condition": "features.system-freetype && tests.fontconfig",
- "output": [
- "feature",
- { "type": "library", "test": "fontconfig" }
- ]
+ "condition": "!config.win32 && !config.darwin && features.system-freetype && libs.fontconfig",
+ "output": [ "privateFeature", "feature" ]
},
"harfbuzz": {
"description": "HarfBuzz",
- "output": [ "feature" ]
+ "output": [ "privateFeature", "feature" ]
},
"system-harfbuzz": {
"description": " Using system HarfBuzz",
"enable": "input.harfbuzz == 'system'",
"disable": "input.harfbuzz == 'qt'",
- "autoDetect": "!config.darwin",
- "condition": "features.harfbuzz && tests.harfbuzz",
- "output": [ "publicQtConfig" ]
+ "autoDetect": "!config.darwin && !config.win32",
+ "condition": "features.harfbuzz && libs.harfbuzz",
+ "output": [ "privateFeature" ]
},
"concurrent": {
"description": "Qt Concurrent",
- "output": [ "feature" ]
+ "output": [ "publicFeature", "feature" ]
},
"dbus": {
"description": "Qt D-Bus",
- "autoDetect": "!config.android",
- "output": [ "feature" ]
+ "autoDetect": "!config.uikit && !config.android && !config.winrt",
+ "output": [ "privateFeature", "feature" ]
},
"dbus-linked": {
"description": "Qt D-Bus directly linked to libdbus",
"enable": "input.dbus == 'linked'",
"disable": "input.dbus == 'runtime'",
- "condition": "features.dbus && tests.dbus",
- "output": [
- "publicQtConfig",
- { "type": "library", "feature": "dbus", "test": "dbus" }
- ]
+ "condition": "features.dbus && libs.dbus",
+ "output": [ "privateFeature" ]
},
"host-dbus": {
"description": "Qt D-Bus (Host)",
"autoDetect": "!config.android",
- "condition": "tests.host-dbus",
- "output": [ { "type": "varAppend", "name": "QT_HOST_CFLAGS_DBUS", "value": "tests.host-dbus.cflags" } ]
+ "condition": "libs.host_dbus",
+ "output": [ { "type": "varAppend", "name": "QT_HOST_CFLAGS_DBUS", "value": "libs.host_dbus.cflags", "eval": "true" } ]
},
"skip_modules": {
"output": [ { "type": "varAssign", "name": "QT_SKIP_MODULES", "value": "tests.skip_modules.value" } ]
@@ -1805,102 +2113,92 @@
},
"gui": {
"description": "Qt Gui",
- "output": [ { "type": "publicQtConfig", "negative": true } ]
+ "output": [
+ "privateFeature",
+ { "type": "publicQtConfig", "negative": true }
+ ]
},
"widgets": {
"description": "Qt Widgets",
- "condition": "features.gui && !config.tvos",
+ "condition": "features.gui",
"output": [
+ "privateFeature",
{ "type": "define", "negative": true, "name": "QT_NO_WIDGETS" },
{ "type": "publicQtConfig", "negative": true }
]
},
"system-proxies": {
"description": "Use system proxies",
- "output": [ "publicQtConfig" ]
+ "output": [ "privateFeature" ]
},
"egl": {
"description": "EGL",
- "condition": "features.opengl && tests.egl",
- "output": [
- "feature",
- { "type": "library", "test": "egl" }
- ]
+ "condition": "features.opengl && (features.angle || libs.egl)",
+ "output": [ "privateFeature", "feature" ]
},
"egl_x11": {
"description": "EGL on X11",
"condition": "features.egl && tests.egl-x11",
- "output": [ "feature" ]
+ "output": [ "privateFeature" ]
},
"eglfs": {
"description": "EGLFS",
- "autoDetect": "!config.android",
+ "autoDetect": "!config.android && !config.win32",
"condition": "features.egl",
- "output": [ "feature" ]
+ "output": [ "privateFeature" ]
},
"eglfs_brcm": {
"description": "EGLFS Rasberry Pi",
- "condition": "features.eglfs && tests.eglfs-brcm",
- "output": [ "publicQtConfig" ]
+ "condition": "features.eglfs && tests.egl-brcm",
+ "output": [ "privateFeature" ]
},
"eglfs_egldevice": {
"description": "EGLFS EGLDevice",
- "condition": "features.eglfs && tests.eglfs-egldevice",
- "output": [ "publicQtConfig" ]
+ "condition": "features.eglfs && tests.egl-egldevice && features.kms",
+ "output": [ "privateFeature" ]
},
"eglfs_gbm": {
"description": "EGLFS GBM",
"condition": "features.eglfs && features.gbm && features.kms",
- "output": [ "publicQtConfig" ]
+ "output": [ "privateFeature" ]
},
"eglfs_mali": {
"description": "EGLFS Mali",
- "condition": "features.eglfs && tests.eglfs-mali",
- "output": [ "publicQtConfig" ]
+ "condition": "features.eglfs && (tests.egl-mali || tests.egl-mali-2)",
+ "output": [ "privateFeature" ]
},
"eglfs_viv": {
"description": "EGLFS i.Mx6",
- "condition": "features.eglfs && tests.eglfs-viv",
- "output": [ "publicQtConfig" ]
+ "condition": "features.eglfs && tests.egl-viv",
+ "output": [ "privateFeature" ]
},
"eglfs_viv_wl": {
"description": "EGLFS i.Mx6 Wayland",
- "condition": "features.eglfs_viv && tests.wayland-server",
- "output": [ "publicQtConfig" ]
+ "condition": "features.eglfs_viv && libs.wayland_server",
+ "output": [ "privateFeature" ]
},
"libudev": {
"description": "udev",
- "condition": "tests.libudev",
- "output": [
- "privateFeature",
- { "type": "library", "test": "libudev" }
- ]
+ "condition": "libs.libudev",
+ "output": [ "privateFeature" ]
},
"libinput": {
"description": "libinput",
- "condition": "features.libudev && tests.libinput",
- "output": [
- "privateFeature",
- { "type": "library", "test": "libinput" }
- ]
+ "condition": "features.libudev && libs.libinput",
+ "output": [ "privateFeature" ]
},
"xkbcommon-evdev": {
"description": "xkbcommon-evdev",
- "condition": "tests.xkbcommon",
- "output": [
- "publicQtConfig",
- { "type": "library", "test": "xkbcommon" }
- ]
+ "condition": "libs.xkbcommon",
+ "output": [ "privateFeature" ]
},
"xkbcommon-system": {
"description": "Using system-provided xkbcommon",
"emitIf": "features.xcb",
- "condition": "tests.xkbcommon-x11",
- "disable": "input.xkbcommon == 'qt'",
- "output": [
- { "type": "publicQtConfig", "negative": true, "name": "xkbcommon-qt" },
- { "type": "library", "name": "xkbcommon", "test": "xkbcommon-x11" }
- ]
+ "enable": "input.xkbcommon == 'system'",
+ "disable": "input.xkbcommon == 'qt' || input.xkbcommon == 'no'",
+ "condition": "libs.xkbcommon_x11",
+ "output": [ "privateFeature" ]
},
"xkb-config-root": {
"description": "XKB config root",
@@ -1910,199 +2208,196 @@
},
"xinput2": {
"description": "Xinput2",
- "condition": "tests.xinput2",
- "output": [
- "publicQtConfig",
- { "type": "library", "test": "xinput2" }
- ]
+ "condition": "libs.xinput2",
+ "output": [ "privateFeature" ]
},
"doubleconversion": {
"description": "DoubleConversion",
- "output": [ "feature" ]
+ "output": [ "privateFeature", "feature" ]
},
"system-doubleconversion": {
"description": " Using system DoubleConversion",
"enable": "input.doubleconversion == 'system'",
"disable": "input.doubleconversion == 'qt'",
- "condition": "features.doubleconversion && tests.doubleconversion",
- "output": [ "publicQtConfig" ]
+ "condition": "features.doubleconversion && libs.doubleconversion",
+ "output": [ "privateFeature" ]
},
"system-pcre": {
"description": "Using system PCRE",
"disable": "input.pcre == 'qt'",
"enable": "input.pcre == 'system'",
- "condition": "tests.pcre",
+ "condition": "libs.pcre",
"output": [ { "type": "privateConfig", "negative": true, "name": "pcre" } ]
},
"gstreamer-1_0": {
"description": "GStreamer 1.0",
"disable": "input.gstreamer == '0.10' || input.gstreamer == 'no'",
"enable": "input.gstreamer == '1.0'",
- "condition": "tests.gstreamer-1_0",
+ "condition": "libs.gstreamer_1_0",
"output": [ { "type": "publicQtConfig", "name": "gstreamer-1.0" } ]
},
"gstreamer-0_10": {
"description": "GStreamer 0.10",
"disable": "input.gstreamer == 'no'",
"enable": "input.gstreamer == '0.10'",
- "condition": "!features.gstreamer-1_0 && tests.gstreamer-0_10",
+ "condition": "!features.gstreamer-1_0 && libs.gstreamer_0_10",
"output": [ { "type": "publicQtConfig", "name": "gstreamer-0.10" } ]
},
"xcb": {
"description": "XCB",
"autoDetect": "!config.darwin",
- "condition": "tests.xcb",
- "output": [
- "publicQtConfig",
- { "type": "publicQtConfig", "name": "xcb-qt", "condition": "!features.system-xcb" },
- { "type": "publicQtConfig", "name": "xcb-plugin" },
- { "type": "library", "test": "xcb", "condition": "!features.system-xcb" },
- { "type": "library", "test": "xcb-syslibs", "condition": "features.system-xcb" }
- ]
+ "condition": "libs.xcb",
+ "output": [ "privateFeature" ]
},
"system-xcb": {
"description": "Using system provided XCB libraries",
"enable": "input.xcb == 'system' || input.xcb == 'yes'",
"disable": "input.xcb == 'qt' || input.xcb == 'no'",
"autoDetect": "!config.darwin",
- "condition": "tests.xcb && tests.xcb-syslibs"
+ "condition": "libs.xcb && libs.xcb_syslibs",
+ "output": [ "privateFeature" ]
},
"xcb-render": {
"description": "XCB render",
"emitIf": "features.system-xcb",
- "condition": "tests.xcb-render",
- "output": [
- "publicQtConfig",
- { "type": "library", "test": "xcb-render" }
- ]
+ "condition": "libs.xcb_render",
+ "output": [ "privateFeature" ]
},
"xcb-glx": {
"description": "XCB GLX",
"emitIf": "features.xcb",
- "condition": "tests.xcb-glx",
- "output": [
- "publicQtConfig",
- { "type": "library", "test": "xcb-glx" }
- ]
+ "condition": "libs.xcb_glx",
+ "output": [ "privateFeature" ]
},
"xcb-xlib": {
"description": "XCB Xlib",
"emitIf": "features.xcb",
- "condition": "tests.xcb-xlib",
- "output": [ "publicQtConfig" ]
+ "condition": "libs.xcb_xlib",
+ "output": [ "privateFeature" ]
},
"xcb-sm": {
"description": "xcb-sm",
"emitIf": "features.xcb",
- "condition": "features.sessionmanager && tests.x11-sm",
- "output": [ "publicQtConfig" ]
+ "condition": "features.sessionmanager && libs.x11sm",
+ "output": [ "privateFeature" ]
},
"xkb": {
"description": "XCB XKB",
- "condition": "features.system-xcb && tests.xcb-xkb",
- "output": [
- "privateFeature",
- { "type": "library", "test": "xcb-xkb" }
- ]
+ "condition": "features.system-xcb && libs.xcb_xkb",
+ "output": [ "privateFeature" ]
},
"xlib": {
"description": "XLib",
"condition": "tests.xlib",
- "output": [ "publicQtConfig" ]
+ "output": [ "privateFeature" ]
},
"xrender": {
"description": "Xrender",
- "condition": "tests.xrender",
- "output": [ "feature" ]
+ "condition": "libs.xrender",
+ "output": [ "privateFeature", "feature" ]
},
"x11-prefix": {
"description": "X11 prefix",
"emitIf": "features.xcb",
"output": [ { "type": "varAssign", "name": "QMAKE_X11_PREFIX", "value": "tests.x11prefix.value" } ]
},
+ "angle": {
+ "description": "ANGLE",
+ "autoDetect": "features.opengles2 || features.opengl-dynamic",
+ "condition": "config.win32 && tests.directx",
+ "output": [
+ "privateFeature",
+ { "type": "define", "name": "QT_OPENGL_ES_2_ANGLE" }
+ ]
+ },
"opengles2": {
"description": "OpenGL ES 2.0",
"enable": "input.opengl == 'es2'",
- "disable": "input.opengl == 'desktop' || input.opengl == 'no'",
- "condition": "!features.opengl-desktop && tests.opengles2",
+ "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" },
- { "type": "library", "name": "OPENGL_ES2", "test": "opengles2" }
+ { "type": "define", "name": "QT_OPENGL_ES_2" }
]
},
"opengles3": {
"description": "OpenGL ES 3.0",
- "condition": "features.opengles2 && tests.opengles3",
- "output": [ { "type": "define", "name": "QT_OPENGL_ES_3" } ]
+ "condition": "features.opengles2 && !features.angle && tests.opengles3",
+ "output": [
+ "publicFeature",
+ { "type": "define", "name": "QT_OPENGL_ES_3" }
+ ]
},
"opengles31": {
"description": "OpenGL ES 3.1",
"condition": "features.opengles3 && tests.opengles31",
- "output": [ { "type": "define", "name": "QT_OPENGL_ES_3_1" } ]
+ "output": [
+ "publicFeature",
+ { "type": "define", "name": "QT_OPENGL_ES_3_1" }
+ ]
},
"opengl-desktop": {
"description": "Desktop OpenGL",
"enable": "input.opengl == 'desktop'",
- "disable": "input.opengl == 'es2' || input.opengl == 'no'",
- "condition": "(config.win32 && tests.opengl-mingw) || (!config.win32 && tests.opengl-desktop)",
- "output": [ { "type": "library", "name": "OPENGL", "test": "opengl-desktop", "condition": "!config.win32" } ]
+ "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": {
+ "description": "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": {
"description": "OpenGL",
- "condition": "features.opengl-desktop || features.opengles2",
- "output": [ "feature" ]
+ "condition": "features.opengl-desktop || features.opengl-dynamic || features.opengles2",
+ "output": [ "publicFeature", "feature" ]
},
"db2": {
"description": "DB2 (IBM)",
- "condition": "tests.db2",
+ "condition": "libs.db2",
"output": [ "sqldriver" ]
},
"ibase": {
"description": "InterBase",
- "condition": "tests.ibase",
+ "condition": "libs.ibase",
"output": [ "sqldriver" ]
},
"mysql": {
"description": "MySql",
- "condition": "tests.mysql",
- "output": [
- "sqldriver",
- { "type": "library", "test": "mysql", "condition": "!features.use_libmysqlclient_r" },
- { "type": "library", "test": "mysql_r", "condition": "features.use_libmysqlclient_r" }
- ]
+ "condition": "libs.mysql",
+ "output": [ "sqldriver" ]
},
"use_libmysqlclient_r": {
"description": "MySql (threadsafe)",
- "condition": "features.mysql && tests.mysql_r",
+ "condition": "features.mysql && (libs.mysql.source == 0 || libs.mysql.source == 2)",
"output": [ "privateConfig" ]
},
"oci": {
"description": "OCI (Oracle)",
- "condition": "tests.oci",
+ "condition": "libs.oci",
"output": [ "sqldriver" ]
},
"odbc": {
"description": "ODBC",
- "condition": "(!config.darwin && tests.odbc) || tests.iodbc",
- "output": [
- "sqldriver",
- { "type": "library", "test": "odbc", "condition": "!config.darwin && tests.odbc" },
- { "type": "library", "test": "iodbc", "condition": "config.darwin || !tests.odbc" }
- ]
+ "condition": "libs.odbc",
+ "output": [ "sqldriver" ]
},
"psql": {
"description": "PostgreSQL",
- "condition": "tests.psql",
- "output": [
- "sqldriver",
- { "type": "library", "test": "psql" }
- ]
+ "condition": "libs.psql",
+ "output": [ "sqldriver" ]
},
"sqlite2": {
"description": "SQLite2",
- "condition": "tests.sqlite2",
+ "condition": "libs.sqlite2",
"output": [ "sqldriver" ]
},
"sqlite": {
@@ -2112,50 +2407,45 @@
"system-sqlite": {
"description": " Using system provided SQLite",
"autoDetect": false,
- "condition": "features.sqlite && tests.sqlite",
- "output": [
- "publicQtConfig",
- { "type": "library", "test": "sqlite" }
- ]
+ "condition": "features.sqlite && libs.sqlite3",
+ "output": [ "publicQtConfig" ]
},
"tds": {
"description": "TDS (Sybase)",
- "condition": "tests.tds",
- "output": [
- "sqldriver",
- { "type": "library", "test": "tds" }
- ]
+ "condition": "libs.tds",
+ "output": [ "sqldriver" ]
},
- "fusion-style": {
+ "style-fusion": {
"description": "Fusion Style",
"output": [ "styles" ]
},
- "mac-style": {
+ "style-mac": {
"description": "Mac Style",
+ "condition": "config.osx",
"output": [ "styles" ]
},
- "windows-style": {
+ "style-windows": {
"description": "Windows Style",
"output": [ "styles" ]
},
- "windowsxp-style": {
+ "style-windowsxp": {
"description": "Windows XP Style",
- "condition": "config.win32",
+ "condition": "features.style-windows && config.win32 && !config.winrt && tests.uxtheme",
"output": [ "styles" ]
},
- "windowsvista-style": {
+ "style-windowsvista": {
"description": "Windows Vista Style",
- "condition": "config.win32",
+ "condition": "features.style-windowsxp",
"output": [ "styles" ]
},
- "android-style": {
+ "style-android": {
"description": "Android Style",
- "condition": "config.android",
+ "autoDetect": "config.android",
"output": [ "styles" ]
},
"android-style-assets": {
"description": "Android Style Assets",
- "condition": "features.android-style",
+ "condition": "features.style-android",
"output": [ "privateConfig" ]
},
"audio-backend": {
@@ -2165,14 +2455,20 @@
"directwrite": {
"description": "DirectWrite",
"emitIf": "config.win32",
- "condition": "tests.directwrite",
- "output": [ "publicQtConfig" ]
+ "condition": "libs.directwrite",
+ "output": [ "privateFeature" ]
},
"directwrite2": {
"description": "DirectWrite 2",
"emitIf": "config.win32",
"condition": "features.directwrite && tests.directwrite2",
- "output": [ "publicQtConfig" ]
+ "output": [ "privateFeature" ]
+ },
+ "direct2d": {
+ "description": "Direct 2D",
+ "autoDetect": false,
+ "condition": "tests.direct2d",
+ "output": [ "privateFeature" ]
},
"sessionmanager": {
"description": "Session Management",
@@ -2186,6 +2482,32 @@
"description": "Compile examples",
"output": [ "privateConfig" ]
},
+ "incredibuild_xge": {
+ "description": "IncrediBuild",
+ "emitIf": "var.QMAKE_HOST.os == 'Windows'",
+ "condition": "tests.incredibuild_xge",
+ "output": [ "publicConfig" ]
+ },
+ "msvc_mp": {
+ "description": "Use multiple processors when compiling with MSVC",
+ "emitIf": "config.msvc",
+ "autoDetect": "false",
+ "output": [ "privateConfig" ]
+ },
+ "static_runtime": {
+ "description": "Statically link the C/C++ runtime library",
+ "emitIf": "config.win32",
+ "autoDetect": false,
+ "condition": "!features.shared",
+ "output": [ "publicConfig", "publicQtConfig" ]
+ },
+ "wmf-backend": {
+ "description": "Windows Media Foundation backend for Qt Multimedia",
+ "emitIf": "config.win32",
+ "autoDetect": false,
+ "condition": "tests.wmf",
+ "output": [ "publicQtConfig" ]
+ },
"qpa_default_platform": {
"description": "QPA default platform",
"condition": "features.gui",
@@ -2195,6 +2517,14 @@
"condition": "!features.shared" }
]
},
+ "mimetype": {
+ "description": "Mimetype handling",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "qeventtransition": {
+ "description": "QEventTransition class",
+ "output": [ "publicFeature" ]
+ },
"extra_features": {
"comment": "### remove, once qfeatures.txt is ported to the new system",
"output": [ "extraFeatures" ]
@@ -2254,6 +2584,13 @@ or are able to read the logged output from journald, syslog or slog2."
},
{
"type": "warning",
+ "condition": "config.win32 && !config.msvc && features.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."
+ },
+ {
+ "type": "warning",
"condition": "features.gui && config.linux && !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.
@@ -2274,7 +2611,8 @@ XKB configuration data. This is required for keyboard input support."
},
{
"type": "note",
- "condition": "features.openssl-linked && tests.openssl-libs.showNote",
+ "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:
@@ -2291,6 +2629,13 @@ For example:
"message": "Accessibility disabled. This configuration of Qt is unsupported."
},
{
+ "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": "note",
"condition": "features.accessibility && features.xcb && !features.accessibility-atspi-bridge",
"message": "Disabling Linux Accessibility Bridge: D-Bus is missing."
@@ -2302,7 +2647,7 @@ For example:
},
{
"type": "error",
- "condition": "features.gui && input.opengl != 'no' && !features.opengl-desktop && !features.opengles2",
+ "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."
@@ -2437,7 +2782,7 @@ Please apply the patch corresponding to your Standard Library vendor, found in
{
"section": "Image formats",
"entries": [
- "gif", "jpeg", "system-jpeg", "png", "system-png"
+ "gif", "ico", "jpeg", "system-jpeg", "png", "system-png"
]
},
{
@@ -2471,8 +2816,18 @@ Please apply the patch corresponding to your Standard Library vendor, found in
{
"section": "OpenGL",
"entries": [
+ {
+ "type": "feature",
+ "args": "angle",
+ "condition": "config.win32"
+ },
"egl",
"opengl-desktop",
+ {
+ "type": "feature",
+ "args": "opengl-dynamic",
+ "condition": "config.win32"
+ },
"opengles2",
"opengles3",
"opengles31"
diff --git a/configure.pri b/configure.pri
index 7625074c50..0a25d46b00 100644
--- a/configure.pri
+++ b/configure.pri
@@ -1,10 +1,21 @@
# custom command line handling
+defineTest(qtConfCommandline_qmakeArgs) {
+ contains(1, QMAKE_[A-Z_]+ *[-+]?=.*) {
+ config.input.qmakeArgs += $$1
+ export(config.input.qmakeArgs)
+ return(true)
+ }
+ return(false)
+}
+
defineTest(qtConfCommandline_cxxstd) {
+ msvc: \
+ qtConfAddError("Command line option -c++std is not supported with MSVC compilers.")
+
arg = $${1}
val = $${2}
isEmpty(val): val = $$qtConfGetNextCommandlineArg()
- message("setting c++std: $$arg/$$val")
!contains(val, "^-.*"):!isEmpty(val) {
contains(val, "(c\+\+)?11") {
qtConfCommandlineSetInput("c++14", "no")
@@ -15,10 +26,10 @@ defineTest(qtConfCommandline_cxxstd) {
qtConfCommandlineSetInput("c++14", "yes")
qtConfCommandlineSetInput("c++1z", "yes")
} else {
- error("Invalid argument $$val to command line parameter $$arg")
+ qtConfAddError("Invalid argument $$val to command line parameter $$arg")
}
} else {
- error("Missing argument to command line parameter $$arg")
+ qtConfAddError("Missing argument to command line parameter $$arg")
}
}
@@ -36,10 +47,10 @@ defineTest(qtConfCommandline_sanitize) {
} else: equals(val, "undefined") {
qtConfCommandlineSetInput("sanitize_undefined", "yes")
} else {
- error("Invalid argument $$val to command line parameter $$arg")
+ qtConfAddError("Invalid argument $$val to command line parameter $$arg")
}
} else {
- error("Missing argument to command line parameter $$arg")
+ qtConfAddError("Missing argument to command line parameter $$arg")
}
}
@@ -59,11 +70,11 @@ defineTest(qtConfTest_architecture) {
test = $$eval($${1}.test)
test_out_dir = $$shadowed($$QMAKE_CONFIG_TESTS_DIR/$$test)
- exists($$test_out_dir/arch): \
+ unix:exists($$test_out_dir/arch): \
content = $$cat($$test_out_dir/arch, blob)
- else: exists($$test_out_dir/arch.exe): \
+ else: win32:exists($$test_out_dir/arch.exe): \
content = $$cat($$test_out_dir/arch.exe, blob)
- else: exists($$test_out_dir/libarch.so): \
+ else: android:exists($$test_out_dir/libarch.so): \
content = $$cat($$test_out_dir/libarch.so, blob)
else: \
error("$$eval($${1}.description) detection binary not found.")
@@ -81,13 +92,15 @@ defineTest(qtConfTest_architecture) {
export($${1}.subarch)
qtLog("Detected architecture: $$eval($${1}.arch) ($$eval($${1}.subarch))")
+ $${1}.cache += arch subarch
+ export($${1}.cache)
return(true)
}
defineTest(qtConfTest_avx_test_apple_clang) {
!*g++*:!*-clang*: return(true)
- compiler = $$system("$$QMAKE_CXX --version")
+ qtRunLoggedCommand("$$QMAKE_CXX --version", compiler)|return(false)
contains(compiler, "Apple clang version [23]") {
# Some clang versions produce internal compiler errors compiling Qt AVX code
return(false)
@@ -100,7 +113,7 @@ defineTest(qtConfTest_gnumake) {
make = $$qtConfFindInPath("gmake")
isEmpty(make): make = $$qtConfFindInPath("make")
!isEmpty(make) {
- version = $$system("$$make -v", blob)
+ qtRunLoggedCommand("$$make -v", version)|return(false)
contains(version, "^GNU Make.*"): return(true)
}
return(false)
@@ -147,8 +160,8 @@ defineTest(qtConfTest_detectPkgConfig) {
pkgConfigLibdir = $$sysroot/usr/lib/pkgconfig:$$sysroot/usr/share/pkgconfig
gcc {
- gccMachineDump = $$system("$$QMAKE_CXX -dumpmachine")
- !isEmpty(gccMachineDump): \
+ qtRunLoggedCommand("$$QMAKE_CXX -dumpmachine", gccMachineDump): \
+ !isEmpty(gccMachineDump): \
pkgConfigLibdir = "$$pkgConfigLibdir:$$sysroot/usr/lib/$$gccMachineDump/pkgconfig"
}
@@ -171,9 +184,12 @@ defineTest(qtConfTest_detectPkgConfig) {
export($${1}.pkgConfigLibdir)
$${1}.pkgConfigSysrootDir = $$pkgConfigSysrootDir
export($${1}.pkgConfigSysrootDir)
+ $${1}.cache += pkgConfigLibdir pkgConfigSysrootDir
}
$${1}.pkgConfig = $$pkgConfig
export($${1}.pkgConfig)
+ $${1}.cache += pkgConfig
+ export($${1}.cache)
PKG_CONFIG = $$pkgConfig
export(PKG_CONFIG)
@@ -188,9 +204,9 @@ defineTest(qtConfTest_neon) {
defineTest(qtConfTest_skipModules) {
skip =
- ios|tvos {
+ uikit {
skip += qtdoc qtmacextras qtserialport qtwebkit qtwebkit-examples
- tvos: skip += qtscript
+ !ios: skip += qtscript
}
for (m, config.input.skip) {
@@ -204,6 +220,8 @@ defineTest(qtConfTest_skipModules) {
}
$${1}.value = $$unique(skip)
export($${1}.value)
+ $${1}.cache += value
+ export($${1}.cache)
return(true)
}
@@ -218,7 +236,6 @@ defineTest(qtConfTest_buildParts) {
parts += tools
}
- ios|tvos: parts -= examples
parts -= $$config.input.nomake
# always add libs, as it's required to build Qt
@@ -226,27 +243,24 @@ defineTest(qtConfTest_buildParts) {
$${1}.value = $$parts
export($${1}.value)
+ $${1}.cache += value
+ export($${1}.cache)
return(true)
}
-defineTest(qtConfTest_openssl) {
+defineTest(qtConfLibrary_openssl) {
libs = $$getenv("OPENSSL_LIBS")
-
!isEmpty(libs) {
$${1}.libs = $$libs
export($${1}.libs)
+ return(true)
}
-
- $${1}.showNote = false
- isEmpty(libs): $${1}.showNote = true
- export($${1}.showNote)
-
- return(true)
+ return(false)
}
defineTest(qtConfTest_checkCompiler) {
contains(QMAKE_CXX, ".*clang.*") {
- versionstr = "$$system($$QMAKE_CXX -v 2>&1)"
+ qtRunLoggedCommand("$$QMAKE_CXX -v 2>&1", versionstr)|return(false)
contains(versionstr, "^Apple (clang|LLVM) version .*") {
$${1}.compilerDescription = "Apple Clang"
$${1}.compilerId = "apple_clang"
@@ -259,13 +273,14 @@ defineTest(qtConfTest_checkCompiler) {
return(false)
}
} else: contains(QMAKE_CXX, ".*g\\+\\+.*") {
+ qtRunLoggedCommand("$$QMAKE_CXX -dumpversion", version)|return(false)
$${1}.compilerDescription = "GCC"
$${1}.compilerId = "gcc"
- $${1}.compilerVersion = $$system($$QMAKE_CXX -dumpversion)
+ $${1}.compilerVersion = $$version
} else: contains(QMAKE_CXX, ".*icpc" ) {
+ qtRunLoggedCommand("$$QMAKE_CXX -v", version)|return(false)
$${1}.compilerDescription = "ICC"
$${1}.compilerId = "icc"
- version = "$$system($$QMAKE_CXX -v)"
$${1}.compilerVersion = $$replace(version, "icpc version ([0-9.]+).*", "\\1")
} else: msvc {
$${1}.compilerDescription = "MSVC"
@@ -277,6 +292,8 @@ defineTest(qtConfTest_checkCompiler) {
export($${1}.compilerDescription)
export($${1}.compilerId)
export($${1}.compilerVersion)
+ $${1}.cache += compilerDescription compilerId compilerVersion
+ export($${1}.cache)
return(true)
}
@@ -288,76 +305,114 @@ defineReplace(filterLibraryPath) {
return($$str)
}
-defineTest(qtConfTest_psqlCompile) {
+defineTest(qtConfLibrary_psqlConfig) {
pg_config = $$config.input.psql_config
isEmpty(pg_config): \
pg_config = $$qtConfFindInPath("pg_config")
!win32:!isEmpty(pg_config) {
- libdir = $$system("$$pg_config --libdir")
+ qtRunLoggedCommand("$$pg_config --libdir", libdir)|return(false)
+ qtRunLoggedCommand("$$pg_config --includedir", includedir)|return(false)
libdir -= $$QMAKE_DEFAULT_LIBDIRS
- !isEmpty(libdir): libs = "-L$$libdir"
+ libs =
+ !isEmpty(libdir): libs += "-L$$libdir"
libs += "-lpq"
- $${1}.libs = $$libs
- $${1}.includedir = $$system("$$pg_config --includedir")
- $${1}.includedir -= $$QMAKE_DEFAULT_INCDIRS
- !isEmpty($${1}.includedir): \
- $${1}.cflags = "-I$$eval($${1}.includedir)"
+ $${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)
- export($${1}.includedir)
- export($${1}.cflags)
-
- qtConfTest_compile($${1}): return(true)
- return(false)
+ !isEmpty(PSQL_LIBS) {
+ $${1}.libs = $$PSQL_LIBS
+ export($${1}.libs)
+ }
+ return(true)
}
-defineTest(qtConfTest_mysqlCompile) {
+defineTest(qtConfLibrary_mysqlConfig) {
mysql_config = $$config.input.mysql_config
isEmpty(mysql_config): \
mysql_config = $$qtConfFindInPath("mysql_config")
!isEmpty(mysql_config) {
- version = $$system("$$mysql_config --version")
+ 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)
- $${1}.libs = $$filterLibraryPath($$system("$$mysql_config $$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
- $${1}.libs -= -rdynamic
- includedir = $$system("$$mysql_config --include")
+ libs -= -rdynamic
+ $${1}.libs = "$$val_escape(libs)"
+ eval(includedir = $$includedir)
includedir ~= s/^-I//g
includedir -= $$QMAKE_DEFAULT_INCDIRS
- $${1}.includedir = $$includedir
- !isEmpty($${1}.includedir): \
- $${1}.cflags = "-I$$eval($${1}.includedir)"
+ $${1}.includedir = "$$val_escape(includedir)"
+ !isEmpty(includedir): \
+ $${1}.cflags = "-I$$val_escape(includedir)"
export($${1}.libs)
export($${1}.includedir)
export($${1}.cflags)
+ return(true)
}
-
- qtConfTest_compile($${1}): return(true)
return(false)
}
-defineTest(qtConfTest_tdsCompile) {
+defineTest(qtConfLibrary_sybaseEnv) {
+ libs =
sybase = $$getenv(SYBASE)
!isEmpty(sybase): \
- $${1}.libs = "-L$${sybase}/lib"
- $${1}.libs += $$getenv(SYBASE_LIBS)
- export($${1}.libs)
+ libs += "-L$${sybase}/lib"
+ libs += $$getenv(SYBASE_LIBS)
+ !isEmpty(libs) {
+ $${1}.libs = "$$val_escape(libs)"
+ export($${1}.libs)
+ }
+ return(true)
+}
+
+# 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
+ arch = $$qtConfEvaluate("tests.architecture.arch")
+ equals(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_compile($${1}): return(true)
+ qtConfTest_files($${1}): return(true)
return(false)
}
-
defineTest(qtConfTest_xkbConfigRoot) {
qtConfTest_getPkgConfigVariable($${1}): return(true)
@@ -365,6 +420,8 @@ defineTest(qtConfTest_xkbConfigRoot) {
exists($$dir) {
$${1}.value = $$dir
export($${1}.value)
+ $${1}.cache += value
+ export($${1}.cache)
return(true)
}
}
@@ -375,6 +432,7 @@ 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: osx: name = cocoa
@@ -389,6 +447,8 @@ defineTest(qtConfTest_qpaDefaultPlatform) {
export($${1}.value)
export($${1}.plugin)
export($${1}.name)
+ $${1}.cache += value plugin name
+ export($${1}.cache)
return(true)
}
@@ -443,7 +503,7 @@ defineTest(qtConfOutput_architecture) {
defineTest(qtConfOutput_styles) {
!$${2}: return()
- style = $$replace($${1}.feature, "-style", "")
+ style = $$replace($${1}.feature, "style-", "")
qtConfOutputVar(append, "privatePro", "styles", $$style)
}
@@ -554,11 +614,6 @@ defineTest(qtConfOutput_extraFeatures) {
}
-defineTest(qtConfOutputPostProcess_privatePro) {
- config.output.privatePro += $$cat($$OUT_PWD/.qmake.vars, lines)
- export(config.output.privatePro)
-}
-
defineTest(qtConfOutput_compilerFlags) {
# this output also exports the variables locally, so that subsequent compiler tests can use them
@@ -576,23 +631,23 @@ defineTest(qtConfOutput_compilerFlags) {
!isEmpty(config.input.defines) {
EXTRA_DEFINES += $$config.input.defines
export(EXTRA_DEFINES)
- output += "EXTRA_DEFINES += $$config.input.defines"
+ output += "EXTRA_DEFINES += $$val_escape(config.input.defines)"
}
!isEmpty(config.input.includes) {
EXTRA_INCLUDEPATH += $$config.input.includes
export(EXTRA_INCLUDEPATH)
- output += "EXTRA_INCLUDEPATH += $$config.input.includes"
+ output += "EXTRA_INCLUDEPATH += $$val_escape(config.input.includes)"
}
!isEmpty(config.input.lpaths) {
EXTRA_LIBDIR += $$config.input.lpaths
export(EXTRA_LIBDIR)
- output += "EXTRA_LIBDIR += $$config.input.lpaths"
+ output += "EXTRA_LIBDIR += $$val_escape(config.input.lpaths)"
}
darwin:!isEmpty(config.input.fpaths) {
EXTRA_FRAMEWORKPATH += $$config.input.fpaths
export(EXTRA_FRAMEWORKPATH)
- output += "EXTRA_FRAMEWORKPATH += $$config.input.fpaths"
+ output += "EXTRA_FRAMEWORKPATH += $$val_escape(config.input.fpaths)"
}
config.output.privatePro += $$output
@@ -604,7 +659,7 @@ defineTest(qtConfOutput_gccSysroot) {
# This variable also needs to be exported immediately, so the compilation tests
# can pick it up.
- EXTRA_QMAKE_ARGS = \
+ EXTRA_QMAKE_ARGS += \
"\"QMAKE_CFLAGS += --sysroot=$$config.input.sysroot\"" \
"\"QMAKE_CXXFLAGS += --sysroot=$$config.input.sysroot\"" \
"\"QMAKE_LFLAGS += --sysroot=$$config.input.sysroot\""
@@ -620,6 +675,19 @@ defineTest(qtConfOutput_gccSysroot) {
export(config.output.publicPro)
}
+defineTest(qtConfOutput_qmakeArgs) {
+ !$${2}: return()
+
+ config.output.privatePro = "!host_build {"
+ for (a, config.input.qmakeArgs) {
+ config.output.privatePro += " $$a"
+ EXTRA_QMAKE_ARGS += $$system_quote($$a)
+ }
+ config.output.privatePro += "}"
+ export(EXTRA_QMAKE_ARGS)
+ export(config.output.privatePro)
+}
+
defineTest(qtConfOutputPostProcess_publicPro) {
qt_version = $$[QT_VERSION]
output = \
diff --git a/doc/global/config.qdocconf b/doc/global/config.qdocconf
index 97357345c9..ac9e7ac274 100644
--- a/doc/global/config.qdocconf
+++ b/doc/global/config.qdocconf
@@ -10,6 +10,6 @@ dita.metadata.default.audience = programmer
#Set the main Qt index.html
navigation.homepage = "Qt $QT_VER"
-sourcedirs += includes
+sourcedirs += includes $$BUILDDIR
url = http://doc.qt.io/qt-5
diff --git a/doc/global/externalsites/qt-webpages.qdoc b/doc/global/externalsites/qt-webpages.qdoc
index 706fcc3a97..f17f85da9f 100644
--- a/doc/global/externalsites/qt-webpages.qdoc
+++ b/doc/global/externalsites/qt-webpages.qdoc
@@ -37,6 +37,10 @@
\title Downloads
*/
/*!
+ \externalpage http://www.qt.io/about-us/
+ \title The Qt Company
+*/
+/*!
\externalpage http://qt.io/licensing/
\title Qt Licensing Overview
*/
@@ -70,7 +74,7 @@
\title Qt Quarterly: Another Look at Events
*/
/*!
- \externalpage http://qt-project.org/videos/watch/livecoding-video-effects-with-qt5
+ \externalpage https://www.youtube.com/watch?v=P4kv-AoAJ-Q
\title Livecoding video effects with Qt5
*/
/*!
diff --git a/doc/global/macros.qdocconf b/doc/global/macros.qdocconf
index 71a9dc30d1..da583aedcd 100644
--- a/doc/global/macros.qdocconf
+++ b/doc/global/macros.qdocconf
@@ -10,6 +10,7 @@ macro.gui = "\\b"
macro.HR.HTML = "<hr />"
macro.iacute.HTML = "&iacute;"
macro.key = "\\b"
+macro.macos = "macOS"
macro.menu = "\\b"
macro.oslash.HTML = "&oslash;"
macro.ouml.HTML = "&ouml;"
diff --git a/doc/global/qt-cpp-defines.qdocconf b/doc/global/qt-cpp-defines.qdocconf
index 54d2cbbe4e..13e523411a 100644
--- a/doc/global/qt-cpp-defines.qdocconf
+++ b/doc/global/qt-cpp-defines.qdocconf
@@ -68,6 +68,7 @@ Cpp.ignoretokens += \
Q_LOCATION_EXPORT \
Q_POSITIONING_EXPORT \
Q_MULTIMEDIA_EXPORT \
+ Q_NAMESPACE \
Q_NETWORK_EXPORT \
Q_NEVER_INLINE \
Q_NORETURN \
diff --git a/examples/corelib/threads/doc/src/semaphores.qdoc b/examples/corelib/threads/doc/src/semaphores.qdoc
index b1a1fc1ed2..ccbfcdb6e2 100644
--- a/examples/corelib/threads/doc/src/semaphores.qdoc
+++ b/examples/corelib/threads/doc/src/semaphores.qdoc
@@ -129,7 +129,7 @@
\c{freeBytes.available()} is \c BufferSize - 1 and
\c{usedBytes.available()} is 1. At that point, two things can
happen: Either the consumer thread takes over and reads that
- byte, or the consumer gets to produce a second byte.
+ byte, or the producer thread gets to produce a second byte.
The producer-consumer model presented in this example makes it
possible to write highly concurrent multithreaded applications.
diff --git a/examples/dbus/dbus.pro b/examples/dbus/dbus.pro
index 083e442dfb..afeb1de0d5 100644
--- a/examples/dbus/dbus.pro
+++ b/examples/dbus/dbus.pro
@@ -2,8 +2,9 @@ requires(qtHaveModule(dbus))
TEMPLATE = subdirs
SUBDIRS = listnames \
- pingpong \
- complexpingpong
+ pingpong
+
+!uikit: SUBDIRS += complexpingpong
qtHaveModule(widgets) {
SUBDIRS += chat \
diff --git a/examples/examples.pro b/examples/examples.pro
index bcc13704dc..b57d281384 100644
--- a/examples/examples.pro
+++ b/examples/examples.pro
@@ -15,7 +15,7 @@ SUBDIRS = \
widgets \
xml
-contains(QT_CONFIG, opengl): SUBDIRS += opengl
+qtConfig(opengl): SUBDIRS += opengl
aggregate.files = aggregate/examples.pro
aggregate.path = $$[QT_INSTALL_EXAMPLES]
diff --git a/examples/gui/gui.pro b/examples/gui/gui.pro
index 3a63ffb5eb..e4fec201d7 100644
--- a/examples/gui/gui.pro
+++ b/examples/gui/gui.pro
@@ -5,6 +5,6 @@ CONFIG += no_docs_target
SUBDIRS += analogclock
SUBDIRS += rasterwindow
-contains(QT_CONFIG, opengl(es2)?) {
+qtConfig(opengl(es2)?) {
SUBDIRS += openglwindow
}
diff --git a/examples/gui/rasterwindow/rasterwindow.cpp b/examples/gui/rasterwindow/rasterwindow.cpp
index c44222b13d..eb34bec252 100644
--- a/examples/gui/rasterwindow/rasterwindow.cpp
+++ b/examples/gui/rasterwindow/rasterwindow.cpp
@@ -55,8 +55,8 @@ RasterWindow::RasterWindow(QWindow *parent)
: QWindow(parent)
, m_update_pending(false)
{
- m_backingStore = new QBackingStore(this);
create();
+ m_backingStore = new QBackingStore(this);
setGeometry(100, 100, 300, 200);
diff --git a/examples/network/network.pro b/examples/network/network.pro
index 6a09acaae8..a6a6f3ef52 100644
--- a/examples/network/network.pro
+++ b/examples/network/network.pro
@@ -21,7 +21,7 @@ qtHaveModule(widgets) {
load(qfeatures)
!contains(QT_DISABLED_FEATURES, bearermanagement) {
# no QProcess
- !vxworks:!qnx:!winrt:!integrity: SUBDIRS += network-chat
+ !vxworks:!qnx:!winrt:!integrity:!uikit: SUBDIRS += network-chat
SUBDIRS += \
bearermonitor \
@@ -30,9 +30,9 @@ qtHaveModule(widgets) {
}
- contains(QT_CONFIG, openssl):SUBDIRS += securesocketclient
- contains(QT_CONFIG, openssl-linked):SUBDIRS += securesocketclient
- contains(QT_CONFIG, sctp):SUBDIRS += multistreamserver multistreamclient
+ qtConfig(openssl): SUBDIRS += securesocketclient
+ qtConfig(openssl-linked): SUBDIRS += securesocketclient
+ qtConfig(sctp): SUBDIRS += multistreamserver multistreamclient
}
EXAMPLE_FILES = shared
diff --git a/examples/opengl/legacy/framebufferobject2/framebufferobject2.pro b/examples/opengl/legacy/framebufferobject2/framebufferobject2.pro
index 78fc6b1a63..3f2578bc1f 100644
--- a/examples/opengl/legacy/framebufferobject2/framebufferobject2.pro
+++ b/examples/opengl/legacy/framebufferobject2/framebufferobject2.pro
@@ -8,4 +8,4 @@ QT += opengl widgets
target.path = $$[QT_INSTALL_EXAMPLES]/opengl/legacy/framebufferobject2
INSTALLS += target
-contains(QT_CONFIG, opengles.|angle|dynamicgl):error("This example requires Qt to be configured with -opengl desktop")
+qtConfig(opengles.|angle|dynamicgl): error("This example requires Qt to be configured with -opengl desktop")
diff --git a/examples/opengl/legacy/grabber/grabber.pro b/examples/opengl/legacy/grabber/grabber.pro
index 1db0e23156..88c03f1c5e 100644
--- a/examples/opengl/legacy/grabber/grabber.pro
+++ b/examples/opengl/legacy/grabber/grabber.pro
@@ -9,4 +9,4 @@ QT += opengl widgets
target.path = $$[QT_INSTALL_EXAMPLES]/opengl/legacy/grabber
INSTALLS += target
-contains(QT_CONFIG, opengles.|angle|dynamicgl):error("This example requires Qt to be configured with -opengl desktop")
+qtConfig(opengles.|angle|dynamicgl): error("This example requires Qt to be configured with -opengl desktop")
diff --git a/examples/opengl/legacy/hellogl/hellogl.pro b/examples/opengl/legacy/hellogl/hellogl.pro
index c211242fd2..c6e926c245 100644
--- a/examples/opengl/legacy/hellogl/hellogl.pro
+++ b/examples/opengl/legacy/hellogl/hellogl.pro
@@ -14,4 +14,4 @@ QT += opengl widgets
target.path = $$[QT_INSTALL_EXAMPLES]/opengl/legacy/hellogl
INSTALLS += target
-contains(QT_CONFIG, opengles.|angle):error("This example requires Qt to be configured with -opengl desktop")
+qtConfig(opengles.|angle): error("This example requires Qt to be configured with -opengl desktop")
diff --git a/examples/opengl/legacy/legacy.pro b/examples/opengl/legacy/legacy.pro
index 0a74d50f7f..1398332c11 100644
--- a/examples/opengl/legacy/legacy.pro
+++ b/examples/opengl/legacy/legacy.pro
@@ -2,7 +2,7 @@ requires(qtHaveModule(opengl))
TEMPLATE = subdirs
-!contains(QT_CONFIG, dynamicgl): !contains(QT_CONFIG, opengles2) {
+!qtConfig(dynamicgl):!qtConfig(opengles2) {
# legacy desktop-only examples, no dynamic GL support
SUBDIRS = \
grabber \
diff --git a/examples/opengl/legacy/overpainting/overpainting.pro b/examples/opengl/legacy/overpainting/overpainting.pro
index cc46f18889..17213a6079 100644
--- a/examples/opengl/legacy/overpainting/overpainting.pro
+++ b/examples/opengl/legacy/overpainting/overpainting.pro
@@ -16,4 +16,4 @@ SOURCES = bubble.cpp \
target.path = $$[QT_INSTALL_EXAMPLES]/opengl/legacy/overpainting
INSTALLS += target
-contains(QT_CONFIG, opengles.|angle):error("This example requires Qt to be configured with -opengl desktop")
+qtConfig(opengles.|angle): error("This example requires Qt to be configured with -opengl desktop")
diff --git a/examples/opengl/legacy/pbuffers/pbuffers.pro b/examples/opengl/legacy/pbuffers/pbuffers.pro
index d779a2a2dc..7572ba3583 100644
--- a/examples/opengl/legacy/pbuffers/pbuffers.pro
+++ b/examples/opengl/legacy/pbuffers/pbuffers.pro
@@ -10,4 +10,4 @@ QT += opengl widgets
target.path = $$[QT_INSTALL_EXAMPLES]/opengl/legacy/pbuffers
INSTALLS += target
-contains(QT_CONFIG, opengles.|angle|dynamicgl):error("This example requires Qt to be configured with -opengl desktop")
+qtConfig(opengles.|angle|dynamicgl): error("This example requires Qt to be configured with -opengl desktop")
diff --git a/examples/opengl/legacy/pbuffers2/pbuffers2.pro b/examples/opengl/legacy/pbuffers2/pbuffers2.pro
index 2ba40a6f74..f1baae3931 100644
--- a/examples/opengl/legacy/pbuffers2/pbuffers2.pro
+++ b/examples/opengl/legacy/pbuffers2/pbuffers2.pro
@@ -8,4 +8,4 @@ RESOURCES += pbuffers2.qrc
target.path = $$[QT_INSTALL_EXAMPLES]/opengl/legacy/pbuffers2
INSTALLS += target
-contains(QT_CONFIG, opengles.|angle|dynamicgl):error("This example requires Qt to be configured with -opengl desktop")
+qtConfig(opengles.|angle|dynamicgl): error("This example requires Qt to be configured with -opengl desktop")
diff --git a/examples/opengl/legacy/samplebuffers/samplebuffers.pro b/examples/opengl/legacy/samplebuffers/samplebuffers.pro
index 3719f5039d..aca56f8df8 100644
--- a/examples/opengl/legacy/samplebuffers/samplebuffers.pro
+++ b/examples/opengl/legacy/samplebuffers/samplebuffers.pro
@@ -7,4 +7,4 @@ QT += opengl widgets
target.path = $$[QT_INSTALL_EXAMPLES]/opengl/legacy/samplebuffers
INSTALLS += target
-contains(QT_CONFIG, opengles.|angle|dynamicgl):error("This example requires Qt to be configured with -opengl desktop")
+qtConfig(opengles.|angle|dynamicgl): error("This example requires Qt to be configured with -opengl desktop")
diff --git a/examples/widgets/desktop/systray/doc/src/systray.qdoc b/examples/widgets/desktop/systray/doc/src/systray.qdoc
index aa70561638..b89fed72e0 100644
--- a/examples/widgets/desktop/systray/doc/src/systray.qdoc
+++ b/examples/widgets/desktop/systray/doc/src/systray.qdoc
@@ -137,7 +137,7 @@
to show the message with the title, body, and icon for the time
specified in milliseconds.
- OS X users note: The Growl notification system must be
+ \macos users note: The Growl notification system must be
installed for QSystemTrayIcon::showMessage() to display messages.
QSystemTrayIcon also has the corresponding, \l {QSystemTrayIcon::}
@@ -172,7 +172,7 @@
We have reimplemented the QWidget::closeEvent() event handler to
receive widget close events, showing the above message to the
- users when they are closing the editor window. On OS X we need to
+ users when they are closing the editor window. On \macos we need to
avoid showing the message and accepting the close event when the
user really intends to quit the application, that is, when the
user has triggered "Quit" in the menu bar or pressed the Command+Q
diff --git a/examples/widgets/dialogs/findfiles/window.cpp b/examples/widgets/dialogs/findfiles/window.cpp
index 2f9b187bf0..05e160ed87 100644
--- a/examples/widgets/dialogs/findfiles/window.cpp
+++ b/examples/widgets/dialogs/findfiles/window.cpp
@@ -52,51 +52,72 @@
#include "window.h"
+//! [17]
+enum { absoluteFileNameRole = Qt::UserRole + 1 };
+//! [17]
+
+//! [18]
+static inline QString fileNameOfItem(const QTableWidgetItem *item)
+{
+ return item->data(absoluteFileNameRole).toString();
+}
+//! [18]
+
+//! [14]
+static inline void openFile(const QString &fileName)
+{
+ QDesktopServices::openUrl(QUrl::fromLocalFile(fileName));
+}
+//! [14]
+
//! [0]
Window::Window(QWidget *parent)
: QWidget(parent)
{
- browseButton = new QPushButton(tr("&Browse..."), this);
+ QPushButton *browseButton = new QPushButton(tr("&Browse..."), this);
connect(browseButton, &QAbstractButton::clicked, this, &Window::browse);
findButton = new QPushButton(tr("&Find"), this);
connect(findButton, &QAbstractButton::clicked, this, &Window::find);
fileComboBox = createComboBox(tr("*"));
+ connect(fileComboBox->lineEdit(), &QLineEdit::returnPressed,
+ this, &Window::animateFindClick);
textComboBox = createComboBox();
- directoryComboBox = createComboBox(QDir::currentPath());
+ connect(textComboBox->lineEdit(), &QLineEdit::returnPressed,
+ this, &Window::animateFindClick);
+ directoryComboBox = createComboBox(QDir::toNativeSeparators(QDir::currentPath()));
+ connect(directoryComboBox->lineEdit(), &QLineEdit::returnPressed,
+ this, &Window::animateFindClick);
- fileLabel = new QLabel(tr("Named:"));
- textLabel = new QLabel(tr("Containing text:"));
- directoryLabel = new QLabel(tr("In directory:"));
filesFoundLabel = new QLabel;
createFilesTable();
//! [0]
//! [1]
- QGridLayout *mainLayout = new QGridLayout;
- mainLayout->addWidget(fileLabel, 0, 0);
+ QGridLayout *mainLayout = new QGridLayout(this);
+ mainLayout->addWidget(new QLabel(tr("Named:")), 0, 0);
mainLayout->addWidget(fileComboBox, 0, 1, 1, 2);
- mainLayout->addWidget(textLabel, 1, 0);
+ mainLayout->addWidget(new QLabel(tr("Containing text:")), 1, 0);
mainLayout->addWidget(textComboBox, 1, 1, 1, 2);
- mainLayout->addWidget(directoryLabel, 2, 0);
+ mainLayout->addWidget(new QLabel(tr("In directory:")), 2, 0);
mainLayout->addWidget(directoryComboBox, 2, 1);
mainLayout->addWidget(browseButton, 2, 2);
mainLayout->addWidget(filesTable, 3, 0, 1, 3);
mainLayout->addWidget(filesFoundLabel, 4, 0, 1, 2);
mainLayout->addWidget(findButton, 4, 2);
- setLayout(mainLayout);
setWindowTitle(tr("Find Files"));
- resize(700, 300);
+ const QRect screenGeometry = QApplication::desktop()->screenGeometry(this);
+ resize(screenGeometry.width() / 2, screenGeometry.height() / 3);
}
//! [1]
//! [2]
void Window::browse()
{
- QString directory = QFileDialog::getExistingDirectory(this,
- tr("Find Files"), QDir::currentPath());
+ QString directory =
+ QDir::toNativeSeparators(QFileDialog::getExistingDirectory(this, tr("Find Files"), QDir::currentPath()));
if (!directory.isEmpty()) {
if (directoryComboBox->findText(directory) == -1)
@@ -112,14 +133,28 @@ static void updateComboBox(QComboBox *comboBox)
comboBox->addItem(comboBox->currentText());
}
+//! [13]
+
+static void findRecursion(const QString &path, const QString &pattern, QStringList *result)
+{
+ QDir currentDir(path);
+ const QString prefix = path + QLatin1Char('/');
+ foreach (const QString &match, currentDir.entryList(QStringList(pattern), QDir::Files | QDir::NoSymLinks))
+ result->append(prefix + match);
+ foreach (const QString &dir, currentDir.entryList(QDir::Dirs | QDir::NoSymLinks | QDir::NoDotAndDotDot))
+ findRecursion(prefix + dir, pattern, result);
+}
+
+//! [13]
//! [3]
+
void Window::find()
{
filesTable->setRowCount(0);
QString fileName = fileComboBox->currentText();
QString text = textComboBox->currentText();
- QString path = directoryComboBox->currentText();
+ QString path = QDir::cleanPath(directoryComboBox->currentText());
//! [3]
updateComboBox(fileComboBox);
@@ -127,19 +162,21 @@ void Window::find()
updateComboBox(directoryComboBox);
//! [4]
+
currentDir = QDir(path);
QStringList files;
- if (fileName.isEmpty())
- fileName = "*";
- files = currentDir.entryList(QStringList(fileName),
- QDir::Files | QDir::NoSymLinks);
-
+ findRecursion(path, fileName.isEmpty() ? QStringLiteral("*") : fileName, &files);
if (!text.isEmpty())
files = findFiles(files, text);
showFiles(files);
}
//! [4]
+void Window::animateFindClick()
+{
+ findButton->animateClick();
+}
+
//! [5]
QStringList Window::findFiles(const QStringList &files, const QString &text)
{
@@ -149,21 +186,26 @@ QStringList Window::findFiles(const QStringList &files, const QString &text)
progressDialog.setWindowTitle(tr("Find Files"));
//! [5] //! [6]
+ QMimeDatabase mimeDatabase;
QStringList foundFiles;
for (int i = 0; i < files.size(); ++i) {
progressDialog.setValue(i);
- progressDialog.setLabelText(tr("Searching file number %1 of %2...")
- .arg(i).arg(files.size()));
- qApp->processEvents();
+ progressDialog.setLabelText(tr("Searching file number %1 of %n...", 0, files.size()).arg(i));
+ QCoreApplication::processEvents();
//! [6]
if (progressDialog.wasCanceled())
break;
//! [7]
- QFile file(currentDir.absoluteFilePath(files[i]));
-
+ const QString fileName = files.at(i);
+ const QMimeType mimeType = mimeDatabase.mimeTypeForFile(fileName);
+ if (mimeType.isValid() && !mimeType.inherits(QStringLiteral("text/plain"))) {
+ qWarning() << "Not searching binary file " << QDir::toNativeSeparators(fileName);
+ continue;
+ }
+ QFile file(fileName);
if (file.open(QIODevice::ReadOnly)) {
QString line;
QTextStream in(&file);
@@ -171,7 +213,7 @@ QStringList Window::findFiles(const QStringList &files, const QString &text)
if (progressDialog.wasCanceled())
break;
line = in.readLine();
- if (line.contains(text)) {
+ if (line.contains(text, Qt::CaseInsensitive)) {
foundFiles << files[i];
break;
}
@@ -186,13 +228,18 @@ QStringList Window::findFiles(const QStringList &files, const QString &text)
void Window::showFiles(const QStringList &files)
{
for (int i = 0; i < files.size(); ++i) {
- QFile file(currentDir.absoluteFilePath(files[i]));
- qint64 size = QFileInfo(file).size();
-
- QTableWidgetItem *fileNameItem = new QTableWidgetItem(files[i]);
+ const QString &fileName = files.at(i);
+ const QString toolTip = QDir::toNativeSeparators(fileName);
+ const QString relativePath = QDir::toNativeSeparators(currentDir.relativeFilePath(fileName));
+ const qint64 size = QFileInfo(fileName).size();
+ QTableWidgetItem *fileNameItem = new QTableWidgetItem(relativePath);
+ fileNameItem->setData(absoluteFileNameRole, QVariant(fileName));
+ fileNameItem->setToolTip(toolTip);
fileNameItem->setFlags(fileNameItem->flags() ^ Qt::ItemIsEditable);
QTableWidgetItem *sizeItem = new QTableWidgetItem(tr("%1 KB")
.arg(int((size + 1023) / 1024)));
+ sizeItem->setData(absoluteFileNameRole, QVariant(fileName));
+ sizeItem->setToolTip(toolTip);
sizeItem->setTextAlignment(Qt::AlignRight | Qt::AlignVCenter);
sizeItem->setFlags(sizeItem->flags() ^ Qt::ItemIsEditable);
@@ -201,8 +248,7 @@ void Window::showFiles(const QStringList &files)
filesTable->setItem(row, 0, fileNameItem);
filesTable->setItem(row, 1, sizeItem);
}
- filesFoundLabel->setText(tr("%1 file(s) found").arg(files.size()) +
- (" (Double click on a file to open it)"));
+ filesFoundLabel->setText(tr("%n file(s) found (Double click on a file to open it)", 0, files.size()));
filesFoundLabel->setWordWrap(true);
}
//! [8]
@@ -230,20 +276,43 @@ void Window::createFilesTable()
filesTable->horizontalHeader()->setSectionResizeMode(0, QHeaderView::Stretch);
filesTable->verticalHeader()->hide();
filesTable->setShowGrid(false);
-
+//! [15]
+ filesTable->setContextMenuPolicy(Qt::CustomContextMenu);
+ connect(filesTable, &QTableWidget::customContextMenuRequested,
+ this, &Window::contextMenu);
connect(filesTable, &QTableWidget::cellActivated,
this, &Window::openFileOfItem);
+//! [15]
}
//! [11]
+
//! [12]
void Window::openFileOfItem(int row, int /* column */)
{
- QTableWidgetItem *item = filesTable->item(row, 0);
-
- QDesktopServices::openUrl(QUrl::fromLocalFile(currentDir.absoluteFilePath(item->text())));
+ const QTableWidgetItem *item = filesTable->item(row, 0);
+ openFile(fileNameOfItem(item));
}
//! [12]
+//! [16]
+void Window::contextMenu(const QPoint &pos)
+{
+ const QTableWidgetItem *item = filesTable->itemAt(pos);
+ if (!item)
+ return;
+ QMenu menu;
+ QAction *copyAction = menu.addAction("Copy Name");
+ QAction *openAction = menu.addAction("Open");
+ QAction *action = menu.exec(filesTable->mapToGlobal(pos));
+ if (!action)
+ return;
+ const QString fileName = fileNameOfItem(item);
+ if (action == copyAction)
+ QGuiApplication::clipboard()->setText(QDir::toNativeSeparators(fileName));
+ else if (action == openAction)
+ openFile(fileName);
+}
+//! [16]
diff --git a/examples/widgets/dialogs/findfiles/window.h b/examples/widgets/dialogs/findfiles/window.h
index ae4f49b726..fe217381e2 100644
--- a/examples/widgets/dialogs/findfiles/window.h
+++ b/examples/widgets/dialogs/findfiles/window.h
@@ -73,7 +73,9 @@ public:
private slots:
void browse();
void find();
+ void animateFindClick();
void openFileOfItem(int row, int column);
+ void contextMenu(const QPoint &pos);
private:
QStringList findFiles(const QStringList &files, const QString &text);
@@ -84,11 +86,7 @@ private:
QComboBox *fileComboBox;
QComboBox *textComboBox;
QComboBox *directoryComboBox;
- QLabel *fileLabel;
- QLabel *textLabel;
- QLabel *directoryLabel;
QLabel *filesFoundLabel;
- QPushButton *browseButton;
QPushButton *findButton;
QTableWidget *filesTable;
diff --git a/examples/widgets/doc/dropsite.qdoc b/examples/widgets/doc/dropsite.qdoc
index ee350717e2..32bcfe8916 100644
--- a/examples/widgets/doc/dropsite.qdoc
+++ b/examples/widgets/doc/dropsite.qdoc
@@ -222,7 +222,7 @@
and Qt::AlignLeft.
A QString object, \c text, is customized to display data according to the
- contents of \c format. We invoke {QString}'s \l{QString::simplified()}
+ contents of \c format. We invoke \l{QString}'s \l{QString::simplified()}
{simplified()} function on \c text, to obtain a string that has no
additional space before, after or in between words.
diff --git a/examples/widgets/doc/src/application.qdoc b/examples/widgets/doc/src/application.qdoc
index ba45ec4e16..040aa171b7 100644
--- a/examples/widgets/doc/src/application.qdoc
+++ b/examples/widgets/doc/src/application.qdoc
@@ -234,7 +234,7 @@
Just before we create the \uicontrol{Help} menu, we call
QMenuBar::addSeparator(). This has no effect for most widget
- styles (e.g., Windows and OS X styles), but for some
+ styles (e.g., Windows and \macos styles), but for some
styles this makes sure that \uicontrol{Help} is pushed to the right
side of the menu bar.
@@ -253,7 +253,7 @@
load the user's preferences and other application settings. The
QSettings class provides a high-level interface for storing
settings permanently on disk. On Windows, it uses the (in)famous
- Windows registry; on OS X, it uses the native XML-based
+ Windows registry; on \macos, it uses the native XML-based
CFPreferences API; on Unix/X11, it uses text files.
The QSettings constructor takes arguments that identify your
@@ -305,7 +305,7 @@
We start by opening the file in read-only mode. The QFile::Text
flag indicates that the file is a text file, not a binary file.
- On Unix and OS X, this makes no difference, but on Windows,
+ On Unix and \macos, this makes no difference, but on Windows,
it ensures that the "\\r\\n" end-of-line sequence is converted to
"\\n" when reading.
diff --git a/examples/widgets/doc/src/classwizard.qdoc b/examples/widgets/doc/src/classwizard.qdoc
index 9391e0e133..6977cf5efa 100644
--- a/examples/widgets/doc/src/classwizard.qdoc
+++ b/examples/widgets/doc/src/classwizard.qdoc
@@ -76,7 +76,7 @@
\endlist
Although the program is just an example, if you press \uicontrol Finish
- (\uicontrol Done on OS X), actual C++ source files will actually be
+ (\uicontrol Done on \macos), actual C++ source files will actually be
generated.
\section1 The ClassWizard Class
@@ -158,7 +158,7 @@
layouts. The \c className field is created with an asterisk (\c
*) next to its name. This makes it a \l{mandatory fields}{mandatory field}, that
is, a field that must be filled before the user can press the
- \uicontrol Next button (\uicontrol Continue on OS X). The fields' values
+ \uicontrol Next button (\uicontrol Continue on \macos). The fields' values
can be accessed from any other page using QWizardPage::field(),
or from the wizard code using QWizard::field().
diff --git a/examples/widgets/doc/src/findfiles.qdoc b/examples/widgets/doc/src/findfiles.qdoc
index 700105e100..b8363dc698 100644
--- a/examples/widgets/doc/src/findfiles.qdoc
+++ b/examples/widgets/doc/src/findfiles.qdoc
@@ -120,10 +120,12 @@
\snippet dialogs/findfiles/window.cpp 4
We use the directory's path to create a QDir; the QDir class
- provides access to directory structures and their contents. We
- create a list of the files (contained in the newly created QDir)
- that match the specified file name. If the file name is empty
- the list will contain all the files in the directory.
+ provides access to directory structures and their contents.
+
+ \snippet dialogs/findfiles/window.cpp 13
+
+ We recursively create a list of the files (contained in the newl
+ created QDir) that match the specified file name.
Then we search through all the files in the list, using the private
\c findFiles() function, eliminating the ones that don't contain
@@ -173,9 +175,7 @@
\snippet dialogs/findfiles/window.cpp 7
- After updating the QProgressDialog, we create a QFile using the
- QDir::absoluteFilePath() function which returns the absolute path
- name of a file in the directory. We open the file in read-only
+ After updating the QProgressDialog, we open the file in read-only
mode, and read one line at a time using QTextStream.
The QTextStream class provides a convenient interface for reading
@@ -194,9 +194,18 @@
Both the \c findFiles() and \c showFiles() functions are called from
the \c find() slot. In the \c showFiles() function we run through
- the provided list of file names, adding each file name to the
+ the provided list of file names, adding each relative file name to the
first column in the table widget and retrieving the file's size using
- QFile and QFileInfo for the second column.
+ QFileInfo for the second column. For later use, we set
+ the absolute path as a data on the QTableWidget using the
+ the role absoluteFileNameRole defined to be Qt::UserRole + 1.
+
+ \snippet dialogs/findfiles/window.cpp 17
+
+ This allows for retrieving the name of an item using a
+ convenience function:
+
+ \snippet dialogs/findfiles/window.cpp 18
We also update the total number of files found.
@@ -236,8 +245,19 @@
\snippet dialogs/findfiles/window.cpp 12
+ \snippet dialogs/findfiles/window.cpp 14
+
The \c openFileOfItem() slot is invoked when the user double
clicks on a cell in the table. The QDesktopServices::openUrl()
knows how to open a file given the file name.
+
+ \snippet dialogs/findfiles/window.cpp 15
+ \snippet dialogs/findfiles/window.cpp 16
+
+ We set the context menu policy to of the table view to Qt::CustomContextMenu
+ and connect a slot contextMenu() to its signal
+ customContextMenuRequested(). We retrieve the absolute file name
+ from the data of the QTableWidgetItem and populate the context menu
+ with actions offering to copy the file name and to open the file.
*/
diff --git a/examples/widgets/doc/src/licensewizard.qdoc b/examples/widgets/doc/src/licensewizard.qdoc
index 6f89be5698..30f1a876d2 100644
--- a/examples/widgets/doc/src/licensewizard.qdoc
+++ b/examples/widgets/doc/src/licensewizard.qdoc
@@ -94,7 +94,7 @@
\snippet dialogs/licensewizard/licensewizard.cpp 4
We set the style to \l{QWizard::}{ModernStyle} on all platforms
- except OS X,
+ except \macos,
\snippet dialogs/licensewizard/licensewizard.cpp 5
\snippet dialogs/licensewizard/licensewizard.cpp 6
@@ -160,7 +160,7 @@
layouts. The fields are created with an asterisk (\c
*) next to their name. This makes them \l{mandatory fields}, that
is, fields that must be filled before the user can press the
- \uicontrol Next button (\uicontrol Continue on OS X). The fields' values
+ \uicontrol Next button (\uicontrol Continue on \macos). The fields' values
can be accessed from any other page using QWizardPage::field().
Resetting the page amounts to clearing the two text fields.
diff --git a/examples/widgets/doc/src/plugandpaint.qdoc b/examples/widgets/doc/src/plugandpaint.qdoc
index 5495ae8097..d3044860ab 100644
--- a/examples/widgets/doc/src/plugandpaint.qdoc
+++ b/examples/widgets/doc/src/plugandpaint.qdoc
@@ -162,7 +162,7 @@
subdirectory of the Plug & Paint example. On Unix, this is just a
matter of initializing the QDir variable with
QApplication::applicationDirPath(), the path of the executable
- file, and to do a \l{QDir::cd()}{cd()}. On Windows and OS X,
+ file, and to do a \l{QDir::cd()}{cd()}. On Windows and \macos,
this file is usually located in a subdirectory, so we need to
take this into account.
diff --git a/examples/widgets/draganddrop/draggabletext/dragwidget.cpp b/examples/widgets/draganddrop/draggabletext/dragwidget.cpp
index b184fcf060..fb169b953b 100644
--- a/examples/widgets/draganddrop/draggabletext/dragwidget.cpp
+++ b/examples/widgets/draganddrop/draggabletext/dragwidget.cpp
@@ -160,7 +160,9 @@ void DragWidget::mousePressEvent(QMouseEvent *event)
mimeData->setData(hotSpotMimeDataKey(),
QByteArray::number(hotSpot.x()) + ' ' + QByteArray::number(hotSpot.y()));
- QPixmap pixmap(child->size());
+ qreal dpr = window()->windowHandle()->devicePixelRatio();
+ QPixmap pixmap(child->size() * dpr);
+ pixmap.setDevicePixelRatio(dpr);
child->render(&pixmap);
QDrag *drag = new QDrag(this);
diff --git a/examples/widgets/graphicsview/boxes/boxes.pro b/examples/widgets/graphicsview/boxes/boxes.pro
index 14d22537e8..afdca816b1 100644
--- a/examples/widgets/graphicsview/boxes/boxes.pro
+++ b/examples/widgets/graphicsview/boxes/boxes.pro
@@ -1,6 +1,6 @@
QT += opengl widgets
-contains(QT_CONFIG, opengles.|angle|dynamicgl):error("This example requires Qt to be configured with -opengl desktop")
+qtConfig(opengles.|angle|dynamicgl): error("This example requires Qt to be configured with -opengl desktop")
HEADERS += 3rdparty/fbm.h \
glbuffers.h \
diff --git a/examples/widgets/graphicsview/graphicsview.pro b/examples/widgets/graphicsview/graphicsview.pro
index 06a7ce8071..5a054fe6b2 100644
--- a/examples/widgets/graphicsview/graphicsview.pro
+++ b/examples/widgets/graphicsview/graphicsview.pro
@@ -15,6 +15,6 @@ SUBDIRS = \
contains(DEFINES, QT_NO_CURSOR)|contains(DEFINES, QT_NO_DRAGANDDROP): SUBDIRS -= dragdroprobot
-qtHaveModule(opengl):!contains(QT_CONFIG, opengles.):!contains(QT_CONFIG,dynamicgl) {
+qtHaveModule(opengl):!qtConfig(opengles.):!qtConfig(dynamicgl) {
SUBDIRS += boxes
}
diff --git a/examples/widgets/painting/composition/composition.pro b/examples/widgets/painting/composition/composition.pro
index 7d174ca2bc..5fdbe4a5a2 100644
--- a/examples/widgets/painting/composition/composition.pro
+++ b/examples/widgets/painting/composition/composition.pro
@@ -6,7 +6,7 @@ SHARED_FOLDER = ../shared
include($$SHARED_FOLDER/shared.pri)
RESOURCES += composition.qrc
-qtHaveModule(opengl): !contains(QT_CONFIG,dynamicgl) {
+qtHaveModule(opengl):!qtConfig(dynamicgl) {
DEFINES += USE_OPENGL
QT += opengl
}
diff --git a/examples/widgets/painting/shared/shared.pri b/examples/widgets/painting/shared/shared.pri
index c8d119f4e5..362cc6819c 100644
--- a/examples/widgets/painting/shared/shared.pri
+++ b/examples/widgets/painting/shared/shared.pri
@@ -1,6 +1,6 @@
INCLUDEPATH += $$PWD
-qtHaveModule(opengl)|contains(QT_CONFIG, opengles2) {
+qtHaveModule(opengl)|qtConfig(opengles2) {
DEFINES += QT_OPENGL_SUPPORT
QT += opengl widgets
}
diff --git a/examples/widgets/tools/codecs/mainwindow.cpp b/examples/widgets/tools/codecs/mainwindow.cpp
index fe29eeffa3..5e4810dd4d 100644
--- a/examples/widgets/tools/codecs/mainwindow.cpp
+++ b/examples/widgets/tools/codecs/mainwindow.cpp
@@ -55,8 +55,8 @@
MainWindow::MainWindow()
{
- textEdit = new QTextEdit;
- textEdit->setLineWrapMode(QTextEdit::NoWrap);
+ textEdit = new QPlainTextEdit;
+ textEdit->setLineWrapMode(QPlainTextEdit::NoWrap);
setCentralWidget(textEdit);
findCodecs();
@@ -64,54 +64,57 @@ MainWindow::MainWindow()
previewForm = new PreviewForm(this);
previewForm->setCodecList(codecs);
- createActions();
createMenus();
setWindowTitle(tr("Codecs"));
- resize(500, 400);
+
+ const QRect screenGeometry = QApplication::desktop()->screenGeometry(this);
+ resize(screenGeometry.width() / 2, screenGeometry.height() * 2 / 3);
}
void MainWindow::open()
{
- QString fileName = QFileDialog::getOpenFileName(this);
- if (!fileName.isEmpty()) {
- QFile file(fileName);
- if (!file.open(QFile::ReadOnly)) {
- QMessageBox::warning(this, tr("Codecs"),
- tr("Cannot read file %1:\n%2")
- .arg(fileName)
- .arg(file.errorString()));
- return;
- }
+ const QString fileName = QFileDialog::getOpenFileName(this);
+ if (fileName.isEmpty())
+ return;
+ QFile file(fileName);
+ if (!file.open(QFile::ReadOnly)) {
+ QMessageBox::warning(this, tr("Codecs"),
+ tr("Cannot read file %1:\n%2")
+ .arg(QDir::toNativeSeparators(fileName),
+ file.errorString()));
+ return;
+ }
- QByteArray data = file.readAll();
+ const QByteArray data = file.readAll();
- previewForm->setEncodedData(data);
- if (previewForm->exec())
- textEdit->setPlainText(previewForm->decodedString());
- }
+ previewForm->setWindowTitle(tr("Choose Encoding for %1").arg(QFileInfo(fileName).fileName()));
+ previewForm->setEncodedData(data);
+ if (previewForm->exec())
+ textEdit->setPlainText(previewForm->decodedString());
}
void MainWindow::save()
{
- QString fileName = QFileDialog::getSaveFileName(this);
- if (!fileName.isEmpty()) {
- QFile file(fileName);
- if (!file.open(QFile::WriteOnly | QFile::Text)) {
- QMessageBox::warning(this, tr("Codecs"),
- tr("Cannot write file %1:\n%2")
- .arg(fileName)
- .arg(file.errorString()));
- return;
- }
-
- QAction *action = qobject_cast<QAction *>(sender());
- QByteArray codecName = action->data().toByteArray();
-
- QTextStream out(&file);
- out.setCodec(codecName.constData());
- out << textEdit->toPlainText();
+ const QAction *action = qobject_cast<const QAction *>(sender());
+ const QByteArray codecName = action->data().toByteArray();
+ const QString title = tr("Save As (%1)").arg(QLatin1String(codecName));
+
+ QString fileName = QFileDialog::getSaveFileName(this, title);
+ if (fileName.isEmpty())
+ return;
+ QFile file(fileName);
+ if (!file.open(QFile::WriteOnly | QFile::Text)) {
+ QMessageBox::warning(this, tr("Codecs"),
+ tr("Cannot write file %1:\n%2")
+ .arg(QDir::toNativeSeparators(fileName),
+ file.errorString()));
+ return;
}
+
+ QTextStream out(&file);
+ out.setCodec(codecName.constData());
+ out << textEdit->toPlainText();
}
void MainWindow::about()
@@ -143,9 +146,9 @@ void MainWindow::findCodecs()
QString sortKey = codec->name().toUpper();
int rank;
- if (sortKey.startsWith("UTF-8")) {
+ if (sortKey.startsWith(QLatin1String("UTF-8"))) {
rank = 1;
- } else if (sortKey.startsWith("UTF-16")) {
+ } else if (sortKey.startsWith(QLatin1String("UTF-16"))) {
rank = 2;
} else if (iso8859RegExp.exactMatch(sortKey)) {
if (iso8859RegExp.cap(1).size() == 1)
@@ -155,58 +158,38 @@ void MainWindow::findCodecs()
} else {
rank = 5;
}
- sortKey.prepend(QChar('0' + rank));
+ sortKey.prepend(QLatin1Char('0' + rank));
codecMap.insert(sortKey, codec);
}
codecs = codecMap.values();
}
-void MainWindow::createActions()
+void MainWindow::createMenus()
{
- openAct = new QAction(tr("&Open..."), this);
+ QMenu *fileMenu = menuBar()->addMenu(tr("&File"));
+ QAction *openAct =
+ fileMenu->addAction(tr("&Open..."), this, &MainWindow::open);
openAct->setShortcuts(QKeySequence::Open);
- connect(openAct, SIGNAL(triggered()), this, SLOT(open()));
-
- foreach (QTextCodec *codec, codecs) {
- QString text = tr("%1...").arg(QString(codec->name()));
- QAction *action = new QAction(text, this);
- action->setData(codec->name());
- connect(action, SIGNAL(triggered()), this, SLOT(save()));
+ QMenu *saveAsMenu = fileMenu->addMenu(tr("&Save As"));
+ connect(saveAsMenu, &QMenu::aboutToShow,
+ this, &MainWindow::aboutToShowSaveAsMenu);
+ foreach (const QTextCodec *codec, codecs) {
+ const QByteArray name = codec->name();
+ QAction *action = saveAsMenu->addAction(tr("%1...").arg(QLatin1String(name)));
+ action->setData(QVariant(name));
+ connect(action, &QAction::triggered, this, &MainWindow::save);
saveAsActs.append(action);
}
- exitAct = new QAction(tr("E&xit"), this);
- exitAct->setShortcuts(QKeySequence::Quit);
- connect(exitAct, SIGNAL(triggered()), this, SLOT(close()));
-
- aboutAct = new QAction(tr("&About"), this);
- connect(aboutAct, SIGNAL(triggered()), this, SLOT(about()));
-
- aboutQtAct = new QAction(tr("About &Qt"), this);
- connect(aboutQtAct, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
-}
-
-void MainWindow::createMenus()
-{
- saveAsMenu = new QMenu(tr("&Save As"), this);
- foreach (QAction *action, saveAsActs)
- saveAsMenu->addAction(action);
- connect(saveAsMenu, SIGNAL(aboutToShow()),
- this, SLOT(aboutToShowSaveAsMenu()));
-
- fileMenu = new QMenu(tr("&File"), this);
- fileMenu->addAction(openAct);
- fileMenu->addMenu(saveAsMenu);
fileMenu->addSeparator();
- fileMenu->addAction(exitAct);
-
- helpMenu = new QMenu(tr("&Help"), this);
- helpMenu->addAction(aboutAct);
- helpMenu->addAction(aboutQtAct);
+ QAction *exitAct = fileMenu->addAction(tr("E&xit"), this, &QWidget::close);
+ exitAct->setShortcuts(QKeySequence::Quit);
- menuBar()->addMenu(fileMenu);
menuBar()->addSeparator();
- menuBar()->addMenu(helpMenu);
+
+ QMenu *helpMenu = menuBar()->addMenu(tr("&Help"));
+ helpMenu->addAction(tr("&About"), this, &MainWindow::about);
+ helpMenu->addAction(tr("About &Qt"), qApp, &QApplication::aboutQt);
}
diff --git a/examples/widgets/tools/codecs/mainwindow.h b/examples/widgets/tools/codecs/mainwindow.h
index 1e8b440a02..7121c0b122 100644
--- a/examples/widgets/tools/codecs/mainwindow.h
+++ b/examples/widgets/tools/codecs/mainwindow.h
@@ -56,9 +56,8 @@
QT_BEGIN_NAMESPACE
class QAction;
-class QMenu;
class QTextCodec;
-class QTextEdit;
+class QPlainTextEdit;
QT_END_NAMESPACE
class PreviewForm;
@@ -77,21 +76,12 @@ private slots:
private:
void findCodecs();
- void createActions();
void createMenus();
- QTextEdit *textEdit;
+ QList<QAction *> saveAsActs;
+ QPlainTextEdit *textEdit;
PreviewForm *previewForm;
QList<QTextCodec *> codecs;
-
- QMenu *fileMenu;
- QMenu *helpMenu;
- QMenu *saveAsMenu;
- QAction *openAct;
- QList<QAction *> saveAsActs;
- QAction *exitAct;
- QAction *aboutAct;
- QAction *aboutQtAct;
};
#endif
diff --git a/examples/widgets/tools/codecs/previewform.cpp b/examples/widgets/tools/codecs/previewform.cpp
index 82203175ca..e5ca13f011 100644
--- a/examples/widgets/tools/codecs/previewform.cpp
+++ b/examples/widgets/tools/codecs/previewform.cpp
@@ -52,47 +52,159 @@
#include "previewform.h"
+// Helpers for creating hex dumps
+static void indent(QTextStream &str, int indent)
+{
+ for (int i = 0; i < indent; ++i)
+ str << ' ';
+}
+
+static void formatHex(QTextStream &str, const QByteArray &data)
+{
+ const int fieldWidth = str.fieldWidth();
+ const QTextStream::FieldAlignment alignment = str.fieldAlignment();
+ const int base = str.integerBase();
+ const QChar padChar = str.padChar();
+ str.setIntegerBase(16);
+ str.setPadChar(QLatin1Char('0'));
+ str.setFieldAlignment(QTextStream::AlignRight);
+
+ const unsigned char *p = reinterpret_cast<const unsigned char *>(data.constBegin());
+ for (const unsigned char *end = p + data.size(); p < end; ++p) {
+ str << ' ';
+ str.setFieldWidth(2);
+ str << unsigned(*p);
+ str.setFieldWidth(fieldWidth);
+ }
+ str.setFieldAlignment(alignment);
+ str.setPadChar(padChar);
+ str.setIntegerBase(base);
+}
+
+static void formatPrintableCharacters(QTextStream &str, const QByteArray &data)
+{
+ for (int i = 0, size = data.size(); i < size; ++i) {
+ const char c = data.at(i);
+ switch (c) {
+ case '\0':
+ str << "\\0";
+ break;
+ case '\t':
+ str << "\\t";
+ break;
+ case '\r':
+ str << "\\r";
+ break;
+ case '\n':
+ str << "\\n";
+ break;
+ default:
+ if (c >= 32 && uchar(c) < 127)
+ str << ' ' << c;
+ else
+ str << "..";
+ break;
+ }
+ }
+}
+
+static QString formatHexDump(const QByteArray &data)
+{
+ enum { lineWidth = 16 };
+ QString result;
+ QTextStream str(&result);
+ str.setIntegerBase(16);
+ str.setPadChar(QLatin1Char('0'));
+ const int fieldWidth = str.fieldWidth();
+ const QTextStream::FieldAlignment alignment = str.fieldAlignment();
+ for (int a = 0, size = data.size(); a < size; a += lineWidth) {
+ str.setFieldAlignment(QTextStream::AlignRight);
+ str.setFieldWidth(8);
+ str << a;
+ str.setFieldWidth(fieldWidth);
+ str.setFieldAlignment(alignment);
+
+ const int end = qMin(a + lineWidth, size);
+ const QByteArray line = data.mid(a, end - a);
+
+ formatHex(str, line);
+ indent(str, 3 * (lineWidth - line.size()));
+
+ str << ' ';
+ formatPrintableCharacters(str, line);
+ indent(str, 2 * (lineWidth - line.size()));
+ str << '\n';
+ }
+ return result;
+}
+
PreviewForm::PreviewForm(QWidget *parent)
: QDialog(parent)
{
+ setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
encodingComboBox = new QComboBox;
- encodingLabel = new QLabel(tr("&Encoding:"));
+ QLabel *encodingLabel = new QLabel(tr("&Encoding:"));
encodingLabel->setBuddy(encodingComboBox);
- textEdit = new QTextEdit;
- textEdit->setLineWrapMode(QTextEdit::NoWrap);
+ textEdit = new QPlainTextEdit;
+ textEdit->setLineWrapMode(QPlainTextEdit::NoWrap);
textEdit->setReadOnly(true);
+ hexDumpEdit = new QPlainTextEdit;
+ hexDumpEdit->setLineWrapMode(QPlainTextEdit::NoWrap);
+ hexDumpEdit->setReadOnly(true);
+ hexDumpEdit->setFont(QFontDatabase::systemFont(QFontDatabase::FixedFont));
- buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok
- | QDialogButtonBox::Cancel);
+ QDialogButtonBox *buttonBox =
+ new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
+ okButton = buttonBox->button(QDialogButtonBox::Ok);
- connect(encodingComboBox, SIGNAL(activated(int)),
- this, SLOT(updateTextEdit()));
- connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
- connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
+ typedef void(QComboBox::*ComboBoxIntSignal)(int);
+ connect(encodingComboBox, static_cast<ComboBoxIntSignal>(&QComboBox::activated),
+ this, &PreviewForm::updateTextEdit);
+ connect(buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
+ connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
- QGridLayout *mainLayout = new QGridLayout;
+ QGridLayout *mainLayout = new QGridLayout(this);
mainLayout->addWidget(encodingLabel, 0, 0);
mainLayout->addWidget(encodingComboBox, 0, 1);
- mainLayout->addWidget(textEdit, 1, 0, 1, 2);
- mainLayout->addWidget(buttonBox, 2, 0, 1, 2);
- setLayout(mainLayout);
+ tabWidget = new QTabWidget;
+ tabWidget->addTab(textEdit, tr("Preview"));
+ tabWidget->addTab(hexDumpEdit, tr("Hex Dump"));
+ mainLayout->addWidget(tabWidget, 1, 0, 1, 2);
+ statusLabel = new QLabel;
+ mainLayout->addWidget(statusLabel, 2, 0, 1, 2);
+ mainLayout->addWidget(buttonBox, 3, 0, 1, 2);
- setWindowTitle(tr("Choose Encoding"));
- resize(400, 300);
+ const QRect screenGeometry = QApplication::desktop()->screenGeometry(this);
+ resize(screenGeometry.width() * 2 / 5, screenGeometry.height() / 2);
}
void PreviewForm::setCodecList(const QList<QTextCodec *> &list)
{
encodingComboBox->clear();
- foreach (QTextCodec *codec, list)
- encodingComboBox->addItem(codec->name(), codec->mibEnum());
+ foreach (const QTextCodec *codec, list) {
+ encodingComboBox->addItem(QLatin1String(codec->name()),
+ QVariant(codec->mibEnum()));
+ }
+}
+
+void PreviewForm::reset()
+{
+ decodedStr.clear();
+ textEdit->clear();
+ hexDumpEdit->clear();
+ statusLabel->clear();
+ statusLabel->setStyleSheet(QString());
+ okButton->setEnabled(false);
+ tabWidget->setCurrentIndex(0);
}
void PreviewForm::setEncodedData(const QByteArray &data)
{
+ reset();
encodedData = data;
+ hexDumpEdit->setPlainText(formatHexDump(data));
updateTextEdit();
}
@@ -100,12 +212,30 @@ void PreviewForm::updateTextEdit()
{
int mib = encodingComboBox->itemData(
encodingComboBox->currentIndex()).toInt();
- QTextCodec *codec = QTextCodec::codecForMib(mib);
+ const QTextCodec *codec = QTextCodec::codecForMib(mib);
+ const QString name = QLatin1String(codec->name());
- QTextStream in(&encodedData);
- in.setAutoDetectUnicode(false);
- in.setCodec(codec);
- decodedStr = in.readAll();
+ QTextCodec::ConverterState state;
+ decodedStr = codec->toUnicode(encodedData.constData(), encodedData.size(), &state);
- textEdit->setPlainText(decodedStr);
+ bool success = true;
+ if (state.remainingChars) {
+ success = false;
+ const QString message =
+ tr("%1: conversion error at character %2")
+ .arg(name).arg(encodedData.size() - state.remainingChars + 1);
+ statusLabel->setText(message);
+ statusLabel->setStyleSheet(QStringLiteral("background-color: \"red\";"));
+ } else if (state.invalidChars) {
+ statusLabel->setText(tr("%1: %n invalid characters", 0, state.invalidChars).arg(name));
+ statusLabel->setStyleSheet(QStringLiteral("background-color: \"yellow\";"));
+ } else {
+ statusLabel->setText(tr("%1: %n bytes converted", 0, encodedData.size()).arg(name));
+ statusLabel->setStyleSheet(QString());
+ }
+ if (success)
+ textEdit->setPlainText(decodedStr);
+ else
+ textEdit->clear();
+ okButton->setEnabled(success);
}
diff --git a/examples/widgets/tools/codecs/previewform.h b/examples/widgets/tools/codecs/previewform.h
index f3e13233b4..1846b976de 100644
--- a/examples/widgets/tools/codecs/previewform.h
+++ b/examples/widgets/tools/codecs/previewform.h
@@ -58,8 +58,10 @@ QT_BEGIN_NAMESPACE
class QComboBox;
class QDialogButtonBox;
class QLabel;
+class QPlainTextEdit;
+class QPushButton;
+class QTabWidget;
class QTextCodec;
-class QTextEdit;
QT_END_NAMESPACE
class PreviewForm : public QDialog
@@ -67,7 +69,7 @@ class PreviewForm : public QDialog
Q_OBJECT
public:
- PreviewForm(QWidget *parent = 0);
+ explicit PreviewForm(QWidget *parent = Q_NULLPTR);
void setCodecList(const QList<QTextCodec *> &list);
void setEncodedData(const QByteArray &data);
@@ -77,13 +79,17 @@ private slots:
void updateTextEdit();
private:
+ void reset();
+
QByteArray encodedData;
QString decodedStr;
+ QPushButton *okButton;
+ QTabWidget *tabWidget;
QComboBox *encodingComboBox;
- QLabel *encodingLabel;
- QTextEdit *textEdit;
- QDialogButtonBox *buttonBox;
+ QPlainTextEdit *textEdit;
+ QPlainTextEdit *hexDumpEdit;
+ QLabel *statusLabel;
};
#endif
diff --git a/examples/widgets/tools/plugandpaint/app/app.pro b/examples/widgets/tools/plugandpaint/app/app.pro
index 8139cd53ad..e35203edf2 100644
--- a/examples/widgets/tools/plugandpaint/app/app.pro
+++ b/examples/widgets/tools/plugandpaint/app/app.pro
@@ -13,11 +13,16 @@ SOURCES = main.cpp \
paintarea.cpp \
plugindialog.cpp
-LIBS = -L../plugins -lpnp_basictools
+LIBS = -L../plugins
-if(!debug_and_release|build_pass):CONFIG(debug, debug|release) {
- mac:LIBS = $$member(LIBS, 0) $$member(LIBS, 1)_debug
- win32:LIBS = $$member(LIBS, 0) $$member(LIBS, 1)d
+macx-xcode:qtConfig(simulator_and_device) {
+ LIBS += -lpnp_basictools$($${QMAKE_XCODE_LIBRARY_PLATFORM_SUFFIX_SETTING})$($${QMAKE_XCODE_LIBRARY_SUFFIX_SETTING})
+} else {
+ LIBS += -lpnp_basictools
+ if(!debug_and_release|build_pass):CONFIG(debug, debug|release) {
+ mac:LIBS = $$member(LIBS, 0) $$member(LIBS, 1)_debug
+ win32:LIBS = $$member(LIBS, 0) $$member(LIBS, 1)d
+ }
}
#! [0]
diff --git a/examples/widgets/tools/plugandpaint/plugins/basictools/basictools.pro b/examples/widgets/tools/plugandpaint/plugins/basictools/basictools.pro
index f28be96b03..8317019c10 100644
--- a/examples/widgets/tools/plugandpaint/plugins/basictools/basictools.pro
+++ b/examples/widgets/tools/plugandpaint/plugins/basictools/basictools.pro
@@ -14,3 +14,4 @@ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/tools/plugandpaint/plugins
INSTALLS += target
CONFIG += install_ok # Do not cargo-cult this!
+uikit: CONFIG += debug_and_release simulator_and_device
diff --git a/examples/widgets/tools/plugandpaint/plugins/extrafilters/extrafilters.pro b/examples/widgets/tools/plugandpaint/plugins/extrafilters/extrafilters.pro
index deb3c5e70e..4716665d34 100644
--- a/examples/widgets/tools/plugandpaint/plugins/extrafilters/extrafilters.pro
+++ b/examples/widgets/tools/plugandpaint/plugins/extrafilters/extrafilters.pro
@@ -14,3 +14,4 @@ target.path = $$[QT_INSTALL_EXAMPLES]/widgets/tools/plugandpaint/plugins
INSTALLS += target
CONFIG += install_ok # Do not cargo-cult this!
+uikit: CONFIG += debug_and_release simulator_and_device
diff --git a/examples/widgets/widgets.pro b/examples/widgets/widgets.pro
index cc489b5c16..65a96dd718 100644
--- a/examples/widgets/widgets.pro
+++ b/examples/widgets/widgets.pro
@@ -22,11 +22,11 @@ SUBDIRS = \
tutorials \
widgets
-contains(QT_CONFIG, opengl(es2)?) {
+qtConfig(opengl(es2)?) {
SUBDIRS += windowcontainer
}
-!contains(QT_CONFIG, opengl(es2)?): SUBDIRS -= windowcontainer
+!qtConfig(opengl(es2)?): SUBDIRS -= windowcontainer
contains(DEFINES, QT_NO_CURSOR): SUBDIRS -= mainwindows
contains(DEFINES, QT_NO_DRAGANDDROP): SUBDIRS -= draganddrop
mac:SUBDIRS += mac
diff --git a/examples/widgets/widgets/charactermap/characterwidget.cpp b/examples/widgets/widgets/charactermap/characterwidget.cpp
index 07912da6ff..55d45501f1 100644
--- a/examples/widgets/widgets/charactermap/characterwidget.cpp
+++ b/examples/widgets/widgets/charactermap/characterwidget.cpp
@@ -54,11 +54,9 @@
//! [0]
CharacterWidget::CharacterWidget(QWidget *parent)
- : QWidget(parent)
+ : QWidget(parent), columns(16), lastKey(-1)
{
- squareSize = 24;
- columns = 16;
- lastKey = -1;
+ calculateSquareSize();
setMouseTracking(true);
}
//! [0]
@@ -67,7 +65,7 @@ CharacterWidget::CharacterWidget(QWidget *parent)
void CharacterWidget::updateFont(const QFont &font)
{
displayFont.setFamily(font.family());
- squareSize = qMax(24, QFontMetrics(displayFont).xHeight() * 3);
+ calculateSquareSize();
adjustSize();
update();
}
@@ -77,7 +75,7 @@ void CharacterWidget::updateFont(const QFont &font)
void CharacterWidget::updateSize(const QString &fontSize)
{
displayFont.setPointSize(fontSize.toInt());
- squareSize = qMax(24, QFontMetrics(displayFont).xHeight() * 3);
+ calculateSquareSize();
adjustSize();
update();
}
@@ -89,7 +87,7 @@ void CharacterWidget::updateStyle(const QString &fontStyle)
const QFont::StyleStrategy oldStrategy = displayFont.styleStrategy();
displayFont = fontDatabase.font(displayFont.family(), fontStyle, displayFont.pointSize());
displayFont.setStyleStrategy(oldStrategy);
- squareSize = qMax(24, QFontMetrics(displayFont).xHeight() * 3);
+ calculateSquareSize();
adjustSize();
update();
}
@@ -104,6 +102,11 @@ void CharacterWidget::updateFontMerging(bool enable)
update();
}
+void CharacterWidget::calculateSquareSize()
+{
+ squareSize = qMax(16, 4 + QFontMetrics(displayFont, this).height());
+}
+
//! [3]
QSize CharacterWidget::sizeHint() const
{
diff --git a/examples/widgets/widgets/charactermap/characterwidget.h b/examples/widgets/widgets/charactermap/characterwidget.h
index 8a33d69628..53add51e6f 100644
--- a/examples/widgets/widgets/charactermap/characterwidget.h
+++ b/examples/widgets/widgets/charactermap/characterwidget.h
@@ -86,6 +86,8 @@ protected:
void paintEvent(QPaintEvent *event) override;
private:
+ void calculateSquareSize();
+
QFont displayFont;
int columns;
int lastKey;
diff --git a/examples/widgets/widgets/charactermap/mainwindow.cpp b/examples/widgets/widgets/charactermap/mainwindow.cpp
index 2141850f16..8b406ba1ca 100644
--- a/examples/widgets/widgets/charactermap/mainwindow.cpp
+++ b/examples/widgets/widgets/charactermap/mainwindow.cpp
@@ -54,10 +54,30 @@
#include "mainwindow.h"
//! [0]
+
+Q_DECLARE_METATYPE(QFontComboBox::FontFilter)
+
MainWindow::MainWindow()
{
+ QMenu *fileMenu = menuBar()->addMenu(tr("File"));
+ fileMenu->addAction(tr("Quit"), this, &QWidget::close);
+ QMenu *helpMenu = menuBar()->addMenu(tr("&Help"));
+ helpMenu->addAction(tr("Show Font Info"), this, &MainWindow::showInfo);
+ helpMenu->addAction(tr("About &Qt"), qApp, &QApplication::aboutQt);
+
QWidget *centralWidget = new QWidget;
+ QLabel *filterLabel = new QLabel(tr("Filter:"));
+ filterCombo = new QComboBox;
+ filterCombo->addItem(tr("All"), QVariant::fromValue(QFontComboBox::AllFonts));
+ filterCombo->addItem(tr("Scalable"), QVariant::fromValue(QFontComboBox::ScalableFonts));
+ filterCombo->addItem(tr("Monospaced"), QVariant::fromValue(QFontComboBox::MonospacedFonts));
+ filterCombo->addItem(tr("Proportional"), QVariant::fromValue(QFontComboBox::ProportionalFonts));
+ filterCombo->setCurrentIndex(0);
+ typedef void (QComboBox::*QComboBoxIntSignal)(int);
+ connect(filterCombo, static_cast<QComboBoxIntSignal>(&QComboBox::currentIndexChanged),
+ this, &MainWindow::filterChanged);
+
QLabel *fontLabel = new QLabel(tr("Font:"));
fontCombo = new QFontComboBox;
QLabel *sizeLabel = new QLabel(tr("Size:"));
@@ -80,38 +100,39 @@ MainWindow::MainWindow()
//! [2]
lineEdit = new QLineEdit;
+ lineEdit->setClearButtonEnabled(true);
#ifndef QT_NO_CLIPBOARD
QPushButton *clipboardButton = new QPushButton(tr("&To clipboard"));
//! [2]
-//! [3]
- clipboard = QApplication::clipboard();
-//! [3]
#endif
//! [4]
- connect(fontCombo, SIGNAL(currentFontChanged(QFont)),
- this, SLOT(findStyles(QFont)));
- connect(fontCombo, SIGNAL(currentFontChanged(QFont)),
- this, SLOT(findSizes(QFont)));
- connect(fontCombo, SIGNAL(currentFontChanged(QFont)),
- characterWidget, SLOT(updateFont(QFont)));
- connect(sizeCombo, SIGNAL(currentIndexChanged(QString)),
- characterWidget, SLOT(updateSize(QString)));
- connect(styleCombo, SIGNAL(currentIndexChanged(QString)),
- characterWidget, SLOT(updateStyle(QString)));
+ connect(fontCombo, &QFontComboBox::currentFontChanged,
+ this, &MainWindow::findStyles);
+ connect(fontCombo, &QFontComboBox::currentFontChanged,
+ this, &MainWindow::findSizes);
+ connect(fontCombo, &QFontComboBox::currentFontChanged,
+ characterWidget, &CharacterWidget::updateFont);
+ typedef void (QComboBox::*QComboBoxStringSignal)(const QString &);
+ connect(sizeCombo, static_cast<QComboBoxStringSignal>(&QComboBox::currentIndexChanged),
+ characterWidget, &CharacterWidget::updateSize);
+ connect(styleCombo, static_cast<QComboBoxStringSignal>(&QComboBox::currentIndexChanged),
+ characterWidget, &CharacterWidget::updateStyle);
//! [4] //! [5]
- connect(characterWidget, SIGNAL(characterSelected(QString)),
- this, SLOT(insertCharacter(QString)));
+ connect(characterWidget, &CharacterWidget::characterSelected,
+ this, &MainWindow::insertCharacter);
#ifndef QT_NO_CLIPBOARD
- connect(clipboardButton, SIGNAL(clicked()), this, SLOT(updateClipboard()));
+ connect(clipboardButton, &QAbstractButton::clicked, this, &MainWindow::updateClipboard);
#endif
//! [5]
- connect(fontMerging, SIGNAL(toggled(bool)), characterWidget, SLOT(updateFontMerging(bool)));
+ connect(fontMerging, &QAbstractButton::toggled, characterWidget, &CharacterWidget::updateFontMerging);
//! [6]
QHBoxLayout *controlsLayout = new QHBoxLayout;
+ controlsLayout->addWidget(filterLabel);
+ controlsLayout->addWidget(filterCombo, 1);
controlsLayout->addWidget(fontLabel);
controlsLayout->addWidget(fontCombo, 1);
controlsLayout->addWidget(sizeLabel);
@@ -163,6 +184,14 @@ void MainWindow::findStyles(const QFont &font)
}
//! [8]
+void MainWindow::filterChanged(int f)
+{
+ const QFontComboBox::FontFilter filter =
+ filterCombo->itemData(f).value<QFontComboBox::FontFilter>();
+ fontCombo->setFontFilters(filter);
+ statusBar()->showMessage(tr("%n font(s) found", 0, fontCombo->count()));
+}
+
void MainWindow::findSizes(const QFont &font)
{
QFontDatabase fontDatabase;
@@ -208,9 +237,63 @@ void MainWindow::insertCharacter(const QString &character)
void MainWindow::updateClipboard()
{
//! [11]
- clipboard->setText(lineEdit->text(), QClipboard::Clipboard);
+ QGuiApplication::clipboard()->setText(lineEdit->text(), QClipboard::Clipboard);
//! [11]
- clipboard->setText(lineEdit->text(), QClipboard::Selection);
+ QGuiApplication::clipboard()->setText(lineEdit->text(), QClipboard::Selection);
}
#endif
+
+class FontInfoDialog : public QDialog
+{
+public:
+ explicit FontInfoDialog(QWidget *parent = Q_NULLPTR);
+
+private:
+ QString text() const;
+};
+
+FontInfoDialog::FontInfoDialog(QWidget *parent) : QDialog(parent)
+{
+ setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
+ QVBoxLayout *mainLayout = new QVBoxLayout(this);
+ QPlainTextEdit *textEdit = new QPlainTextEdit(text(), this);
+ textEdit->setReadOnly(true);
+ textEdit->setFont(QFontDatabase::systemFont(QFontDatabase::FixedFont));
+ mainLayout->addWidget(textEdit);
+ QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close, this);
+ connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
+ mainLayout->addWidget(buttonBox);
+}
+
+QString FontInfoDialog::text() const
+{
+ QString text;
+ QTextStream str(&text);
+ const QFont defaultFont = QFontDatabase::systemFont(QFontDatabase::GeneralFont);
+ const QFont fixedFont = QFontDatabase::systemFont(QFontDatabase::FixedFont);
+ const QFont titleFont = QFontDatabase::systemFont(QFontDatabase::TitleFont);
+ const QFont smallestReadableFont = QFontDatabase::systemFont(QFontDatabase::SmallestReadableFont);
+
+ str << "Qt " << QT_VERSION_STR << " on " << QGuiApplication::platformName()
+ << ", " << logicalDpiX() << "DPI";
+ if (!qFuzzyCompare(devicePixelRatioF(), qreal(1)))
+ str << ", device pixel ratio: " << devicePixelRatioF();
+ str << "\n\nDefault font : " << defaultFont.family() << ", " << defaultFont.pointSizeF() << "pt\n"
+ << "Fixed font : " << fixedFont.family() << ", " << fixedFont.pointSizeF() << "pt\n"
+ << "Title font : " << titleFont.family() << ", " << titleFont.pointSizeF() << "pt\n"
+ << "Smallest font: " << smallestReadableFont.family() << ", " << smallestReadableFont.pointSizeF() << "pt\n";
+
+ return text;
+}
+
+void MainWindow::showInfo()
+{
+ const QRect screenGeometry = QApplication::desktop()->screenGeometry(this);
+ FontInfoDialog *dialog = new FontInfoDialog(this);
+ dialog->setWindowTitle(tr("Fonts"));
+ dialog->setAttribute(Qt::WA_DeleteOnClose);
+ dialog->resize(screenGeometry.width() / 4, screenGeometry.height() / 4);
+ dialog->show();
+}
+
//! [10]
diff --git a/examples/widgets/widgets/charactermap/mainwindow.h b/examples/widgets/widgets/charactermap/mainwindow.h
index 2865eacc00..eac16b35fa 100644
--- a/examples/widgets/widgets/charactermap/mainwindow.h
+++ b/examples/widgets/widgets/charactermap/mainwindow.h
@@ -73,18 +73,18 @@ public:
MainWindow();
public slots:
+ void filterChanged(int);
void findStyles(const QFont &font);
void findSizes(const QFont &font);
void insertCharacter(const QString &character);
#ifndef QT_NO_CLIPBOARD
void updateClipboard();
#endif
+ void showInfo();
private:
CharacterWidget *characterWidget;
-#ifndef QT_NO_CLIPBOARD
- QClipboard *clipboard;
-#endif
+ QComboBox *filterCombo;
QComboBox *styleCombo;
QComboBox *sizeCombo;
QFontComboBox *fontCombo;
diff --git a/examples/widgets/widgets/icons/images/designer.png b/examples/widgets/widgets/icons/images/designer.png
index 0988fcee3f..9f8578b49e 100644
--- a/examples/widgets/widgets/icons/images/designer.png
+++ b/examples/widgets/widgets/icons/images/designer.png
Binary files differ
diff --git a/examples/widgets/widgets/icons/images/qt_extended_16x16.png b/examples/widgets/widgets/icons/images/qt_extended_16x16.png
index bee4e7d6cd..30bcb45ed2 100644
--- a/examples/widgets/widgets/icons/images/qt_extended_16x16.png
+++ b/examples/widgets/widgets/icons/images/qt_extended_16x16.png
Binary files differ
diff --git a/examples/widgets/widgets/icons/images/qt_extended_32x32.png b/examples/widgets/widgets/icons/images/qt_extended_32x32.png
index 6e7d000c04..d609c1e1e5 100644
--- a/examples/widgets/widgets/icons/images/qt_extended_32x32.png
+++ b/examples/widgets/widgets/icons/images/qt_extended_32x32.png
Binary files differ
diff --git a/examples/widgets/widgets/icons/images/qt_extended_48x48.png b/examples/widgets/widgets/icons/images/qt_extended_48x48.png
index 7a93d88900..0e524fed5f 100644
--- a/examples/widgets/widgets/icons/images/qt_extended_48x48.png
+++ b/examples/widgets/widgets/icons/images/qt_extended_48x48.png
Binary files differ
diff --git a/mkspecs/common/clang-mac.conf b/mkspecs/common/clang-mac.conf
index c616e20b6e..274fd73d00 100644
--- a/mkspecs/common/clang-mac.conf
+++ b/mkspecs/common/clang-mac.conf
@@ -8,3 +8,4 @@ QMAKE_XCODE_GCC_VERSION = com.apple.compilers.llvm.clang.1_0
QMAKE_CXXFLAGS += -stdlib=libc++
QMAKE_LFLAGS += -stdlib=libc++
+QMAKE_AR_LTCG = libtool -static -o
diff --git a/mkspecs/common/linux.conf b/mkspecs/common/linux.conf
index 28af74b491..1a39c88425 100644
--- a/mkspecs/common/linux.conf
+++ b/mkspecs/common/linux.conf
@@ -35,7 +35,6 @@ QMAKE_LIBS_OPENGL = -lGL
QMAKE_LIBS_OPENGL_ES2 = -lGLESv2
QMAKE_LIBS_OPENVG = -lOpenVG
QMAKE_LIBS_THREAD = -lpthread
-QMAKE_LIBS_LIBUDEV = -ludev
QMAKE_CFLAGS_WAYLAND =
QMAKE_INCDIR_WAYLAND =
diff --git a/mkspecs/common/msvc-base.conf b/mkspecs/common/msvc-base.conf
index 1651cf5ded..d54b11507e 100644
--- a/mkspecs/common/msvc-base.conf
+++ b/mkspecs/common/msvc-base.conf
@@ -50,5 +50,5 @@ greaterThan(MSC_VER, 1899) {
QMAKE_CFLAGS_WARN_ON += -w44456 -w44457 -w44458
QMAKE_CFLAGS_AVX2 = -arch:AVX2
QMAKE_CXXFLAGS += -Zc:strictStrings -Zc:throwingNew
- QMAKE_CXXFLAGS_WARN_ON += -w44456 -w44457 -w44458 -wd4577
+ QMAKE_CXXFLAGS_WARN_ON += -w44456 -w44457 -w44458 -wd4577 -wd4467
}
diff --git a/mkspecs/common/tvos.conf b/mkspecs/common/tvos.conf
index 2db616f51e..45e8c82c7b 100644
--- a/mkspecs/common/tvos.conf
+++ b/mkspecs/common/tvos.conf
@@ -4,7 +4,6 @@
QMAKE_PLATFORM += tvos
QMAKE_MAC_SDK = appletvos
-CONFIG += bitcode
simulator.sdk = appletvsimulator
simulator.target = simulator
diff --git a/mkspecs/common/uikit.conf b/mkspecs/common/uikit.conf
index d975ed98af..edc0eddf00 100644
--- a/mkspecs/common/uikit.conf
+++ b/mkspecs/common/uikit.conf
@@ -3,7 +3,7 @@
#
QMAKE_PLATFORM += uikit
-CONFIG += reduce_exports
+CONFIG += bitcode reduce_exports
INCLUDEPATH += $$PWD/uikit
DEFINES += DARWIN_NO_CARBON QT_NO_PRINTER QT_NO_PRINTDIALOG
diff --git a/mkspecs/common/watchos.conf b/mkspecs/common/watchos.conf
new file mode 100644
index 0000000000..a9352aa9c5
--- /dev/null
+++ b/mkspecs/common/watchos.conf
@@ -0,0 +1,20 @@
+#
+# qmake common configuration for watchOS
+#
+
+QMAKE_PLATFORM += watchos
+QMAKE_MAC_SDK = watchos
+
+simulator.sdk = watchsimulator
+simulator.target = simulator
+simulator.dir_affix = $${simulator.sdk}
+simulator.CONFIG = apple$${simulator.sdk}
+simulator.deployment_identifier = watchos-simulator
+
+device.sdk = watchos
+device.target = device
+device.dir_affix = $${device.sdk}
+device.CONFIG = apple$${device.sdk}
+device.deployment_identifier = $${device.sdk}
+
+include(uikit.conf)
diff --git a/mkspecs/devices/linux-drive-cx-g++/qmake.conf b/mkspecs/devices/linux-drive-cx-g++/qmake.conf
index cb43c9e2f6..985f8626ad 100644
--- a/mkspecs/devices/linux-drive-cx-g++/qmake.conf
+++ b/mkspecs/devices/linux-drive-cx-g++/qmake.conf
@@ -7,7 +7,12 @@
# -device-option VIBRANTE_SDK_TOPDIR=/opt/nvidia/vibrante-t186ref-linux
# -device-option CROSS_COMPILE=/opt/nvidia/toolchains/tegra-4.9-nv/usr/bin/aarch64-gnu-linux/aarch64-gnu-linux- \
# -sysroot /opt/nvidia/vibrante-t186ref-linux/targetfs \
-# -no-gcc-sysroot
+# -no-gcc-sysroot \
+# -opengl es2
+
+# Note: This enables eglfs and wayland only. To enable xcb (with EGL
+# support) as well, add -qt-xcb and fix the SDK's X11 headers. See
+# QTBUG-55140.
include(../common/linux_device_pre.conf)
@@ -30,7 +35,10 @@ QMAKE_LFLAGS += \
-Wl,-rpath-link,$$[QT_SYSROOT]/lib/aarch64-linux-gnu
DISTRO_OPTS += aarch64
-COMPILER_FLAGS += -mtune=cortex-a57.cortex-a53 -march=armv8-a -DWIN_INTERFACE_CUSTOM
+
+# Do not define WIN_INTERFACE_CUSTOM here. It is suitable for drm and
+# wayland, but not X11. Leave it to qt_egl_p.h instead.
+COMPILER_FLAGS += -mtune=cortex-a57.cortex-a53 -march=armv8-a
EGLFS_DEVICE_INTEGRATION = eglfs_kms_egldevice
diff --git a/mkspecs/features/android/android_deployment_settings.prf b/mkspecs/features/android/android_deployment_settings.prf
index ce5696a33c..848de485f8 100644
--- a/mkspecs/features/android/android_deployment_settings.prf
+++ b/mkspecs/features/android/android_deployment_settings.prf
@@ -65,6 +65,6 @@ contains(TEMPLATE, ".*app"):!build_pass: {
isEmpty(ANDROID_DEPLOYMENT_SETTINGS_FILE): ANDROID_DEPLOYMENT_SETTINGS_FILE = $$OUT_PWD/android-$$TARGET-deployment-settings.json
- write_file($$ANDROID_DEPLOYMENT_SETTINGS_FILE, FILE_CONTENT) | error("Aborting.")
+ write_file($$ANDROID_DEPLOYMENT_SETTINGS_FILE, FILE_CONTENT)|error()
}
diff --git a/mkspecs/features/configure.prf b/mkspecs/features/configure.prf
index e1040d250e..bd53e31a04 100644
--- a/mkspecs/features/configure.prf
+++ b/mkspecs/features/configure.prf
@@ -37,7 +37,7 @@ defineTest(qtCompileTest) {
# Clean up after previous run
exists($$test_out_dir/Makefile):qtRunLoggedCommand("$$test_cmd_base $$QMAKE_MAKE distclean")
- mkpath($$test_out_dir)|error("Aborting.")
+ mkpath($$test_out_dir)|error()
!isEmpty (QMAKE_QTCONF): qtconfarg = -qtconf $$QMAKE_QTCONF
diff --git a/mkspecs/features/configure_base.prf b/mkspecs/features/configure_base.prf
index fd1730741a..08edba4b1c 100644
--- a/mkspecs/features/configure_base.prf
+++ b/mkspecs/features/configure_base.prf
@@ -25,23 +25,22 @@ QMAKE_MAKE = "$${SETENV_PFX}MAKEFLAGS=$$SETENV_SFX $$QMAKE_MAKE"
isEmpty(QMAKE_CONFIG_VERBOSE): QMAKE_CONFIG_VERBOSE = false
defineTest(qtLog) {
- msg = "+ $$1"
- write_file($$QMAKE_CONFIG_LOG, msg, append)
- $$QMAKE_CONFIG_VERBOSE: log("$$msg$$escape_expand(\\n)")
+ write_file($$QMAKE_CONFIG_LOG, 1, append)
+ $$QMAKE_CONFIG_VERBOSE: for (l, 1): log("$$l$$escape_expand(\\n)")
}
defineTest(qtRunLoggedCommand) {
- qtLog($$1)
- write_file($${QMAKE_CONFIG_LOG}.part, "")
- result = false
- system("$$1 > \"$${QMAKE_CONFIG_LOG}.part\" 2>&1"): result = true
+ qtLog("+ $$1")
- output = $$cat($${QMAKE_CONFIG_LOG}.part, blob)
+ output = $$system("( $$1 ) 2>&1", lines, result)
+ qtLog($$output)
+ !isEmpty(2) {
+ $$2 = $$output
+ export($$2)
+ }
- write_file($${QMAKE_CONFIG_LOG}, output, append)
- $$QMAKE_CONFIG_VERBOSE: log($$output)
-
- return($$result)
+ !equals(result, 0): return(false)
+ return(true)
}
isEmpty(QMAKE_CONFIG_TESTS_DIR): QMAKE_CONFIG_TESTS_DIR = $$_PRO_FILE_PWD_/config.tests
diff --git a/mkspecs/features/ctest_testcase_common.prf b/mkspecs/features/ctest_testcase_common.prf
index 7183ade4df..40e41900e8 100644
--- a/mkspecs/features/ctest_testcase_common.prf
+++ b/mkspecs/features/ctest_testcase_common.prf
@@ -69,8 +69,8 @@ for (dep, dependentmodules): \
mod_deps += $$cmakeModuleName($$dep)
dependentmodules = $$join(mod_deps, ";")
-contains(QT_CONFIG, angle): CMAKE_GL_DEFINES = -DQT_WITH_ANGLE=True
-!contains(QT_CONFIG, egl): CMAKE_GL_DEFINES += -DNO_EGL=True
+qtConfig(angle): CMAKE_GL_DEFINES = -DQT_WITH_ANGLE=True
+!qtConfig(egl): CMAKE_GL_DEFINES += -DNO_EGL=True
CMAKE_MODULE_VERSIONS =
CMAKE_MODULES_UNDER_TEST =
diff --git a/mkspecs/features/default_post.prf b/mkspecs/features/default_post.prf
index e7e9a5bd87..edc3cac7ba 100644
--- a/mkspecs/features/default_post.prf
+++ b/mkspecs/features/default_post.prf
@@ -116,6 +116,29 @@ c++11|c++14|c++1z {
unset(cxxstd)
}
+suffix =
+for(ever) {
+ QMAKE_USE$${suffix} = $$unique(QMAKE_USE$${suffix})
+ for(name, QMAKE_USE$${suffix}) {
+ nu = $$upper($$name)
+ CONFIG(debug, debug|release): \
+ libs = $$eval(QMAKE_LIBS_$${nu}_DEBUG)
+ else: \
+ libs = $$eval(QMAKE_LIBS_$${nu}_RELEASE)
+ libs += $$eval(QMAKE_LIBS_$$nu)
+ cflags = $$eval(QMAKE_CFLAGS_$${nu})
+
+ isEmpty(libs):isEmpty(cflags): \
+ error("Library '$$name' is not defined.")
+
+ LIBS$${suffix} += $$libs
+ QMAKE_CFLAGS += $$cflags
+ QMAKE_CXXFLAGS += $$cflags
+ }
+ !isEmpty(suffix): break()
+ suffix = "_PRIVATE"
+}
+
!precompile_header: SOURCES += $$NO_PCH_SOURCES
QMAKE_INCDIR += $$QMAKE_INCDIR_POST
diff --git a/mkspecs/features/default_pre.prf b/mkspecs/features/default_pre.prf
index 8841dc19f2..b655f2e0ca 100644
--- a/mkspecs/features/default_pre.prf
+++ b/mkspecs/features/default_pre.prf
@@ -8,8 +8,6 @@ CONFIG = \
testcase_targets import_plugins import_qpa_plugin \
$$CONFIG
-CONFIG += c++11
-
!build_pass:defined(QT_EDITION, var):!equals(QT_EDITION, "OpenSource"):!equals(QT_EDITION, "Preview") {
#
# call license checker (but cache result for one day)
diff --git a/mkspecs/features/java.prf b/mkspecs/features/java.prf
index 0f0b991f0a..852954e5ca 100644
--- a/mkspecs/features/java.prf
+++ b/mkspecs/features/java.prf
@@ -28,7 +28,7 @@ javac.commands = javac -source 6 -target 6 -Xlint:unchecked -bootclasspath $$AND
javac.depends = FORCE
QMAKE_EXTRA_COMPILERS += javac
-mkpath($$absolute_path($$CLASS_DIR, $$OUT_PWD)) | error("Aborting.")
+mkpath($$absolute_path($$CLASS_DIR, $$OUT_PWD))|error()
# Disable all linker flags since we are overriding the regular linker
QMAKE_LFLAGS =
diff --git a/mkspecs/features/mac/default_post.prf b/mkspecs/features/mac/default_post.prf
index 30960e66dd..7bf6b4a716 100644
--- a/mkspecs/features/mac/default_post.prf
+++ b/mkspecs/features/mac/default_post.prf
@@ -2,11 +2,11 @@ load(default_post)
!no_objective_c:CONFIG += objective_c
qt {
- contains(QT_CONFIG, static) {
+ qtConfig(static) {
# C++11 support means using libc++ instead of libstd++. As the
# two libraries are incompatible we need to ensure the end user
# project is built using the same C++11 support/no support as Qt.
- contains(QT_CONFIG, c++11) {
+ qtConfig(c++11) {
CONFIG += c++11
} else: c++11 {
warning("Qt was not built with C++11 enabled, disabling feature")
diff --git a/mkspecs/features/mac/default_pre.prf b/mkspecs/features/mac/default_pre.prf
index 5df99d1acd..4c8c80d101 100644
--- a/mkspecs/features/mac/default_pre.prf
+++ b/mkspecs/features/mac/default_pre.prf
@@ -40,7 +40,7 @@ isEmpty(QMAKE_TARGET_BUNDLE_PREFIX) {
# and put it into a dSYM file. We don't need that dSYM file in
# the first place, since the information is available in the
# object files inside the archives (static libraries).
-contains(QT_CONFIG, static): \
+macx-xcode:qtConfig(static): \
QMAKE_XCODE_DEBUG_INFORMATION_FORMAT = dwarf
# This variable is used by the xcode_dynamic_library_suffix
diff --git a/mkspecs/features/mac/sdk.prf b/mkspecs/features/mac/sdk.prf
index c4d4c90f09..5abc741b90 100644
--- a/mkspecs/features/mac/sdk.prf
+++ b/mkspecs/features/mac/sdk.prf
@@ -62,6 +62,7 @@ for(tool, $$list(QMAKE_CC QMAKE_CXX QMAKE_FIX_RPATH QMAKE_AR QMAKE_RANLIB QMAKE_
version_identifier = $$device.deployment_identifier
ios: deployment_target = $$QMAKE_IOS_DEPLOYMENT_TARGET
tvos: deployment_target = $$QMAKE_TVOS_DEPLOYMENT_TARGET
+ watchos: deployment_target = $$QMAKE_WATCHOS_DEPLOYMENT_TARGET
} else: osx {
version_identifier = macosx
deployment_target = $$QMAKE_MACOSX_DEPLOYMENT_TARGET
diff --git a/mkspecs/features/moc.prf b/mkspecs/features/moc.prf
index 6368c8e394..73fbc8c29b 100644
--- a/mkspecs/features/moc.prf
+++ b/mkspecs/features/moc.prf
@@ -21,7 +21,7 @@ win32:count(MOC_INCLUDEPATH, 40, >) {
WIN_INCLUDETEMP_CONT =
for (inc, MOC_INCLUDEPATH): \
WIN_INCLUDETEMP_CONT += -I$$inc
- write_file($$absolute_path($$WIN_INCLUDETEMP, $$OUT_PWD), WIN_INCLUDETEMP_CONT)|error("Aborting.")
+ write_file($$absolute_path($$WIN_INCLUDETEMP, $$OUT_PWD), WIN_INCLUDETEMP_CONT)|error()
}
# QNX's compiler sets "gcc" config, but does not support the -dM option;
diff --git a/mkspecs/features/qml_module.prf b/mkspecs/features/qml_module.prf
index 05f97a5532..6b08ea3a1a 100644
--- a/mkspecs/features/qml_module.prf
+++ b/mkspecs/features/qml_module.prf
@@ -18,10 +18,15 @@ fq_qml_files = $$qmldir_file
for(qmlf, QML_FILES): fq_qml_files += $$absolute_path($$qmlf, $$_PRO_FILE_PWD_)
-qml1_target: \
+load(qt_build_paths)
+
+qml1_target {
+ DESTDIR = $$MODULE_BASE_OUTDIR/imports/$$TARGETPATH
instbase = $$[QT_INSTALL_IMPORTS]
-else: \
+} else {
+ DESTDIR = $$MODULE_BASE_OUTDIR/qml/$$TARGETPATH
instbase = $$[QT_INSTALL_QML]
+}
!qml1_target:static: CONFIG += builtin_resources
@@ -41,4 +46,13 @@ else: qmldir.files = $$qmldir_file
qmldir.path = $$instbase/$$TARGETPATH
INSTALLS += qmldir
-!prefix_build: COPIES += qmldir
+!debug_and_release|!build_all|CONFIG(release, debug|release) {
+ !prefix_build {
+ COPIES += qmldir
+ } else {
+ # For non-installed static builds, qmlimportscanner needs qmldir file in build dir
+ qmldir2build.files = $$qmldir_file
+ qmldir2build.path = $$DESTDIR
+ COPIES += qmldir2build
+ }
+}
diff --git a/mkspecs/features/qml_plugin.prf b/mkspecs/features/qml_plugin.prf
index f2961f8743..a55ab1928e 100644
--- a/mkspecs/features/qml_plugin.prf
+++ b/mkspecs/features/qml_plugin.prf
@@ -15,9 +15,9 @@ TEMPLATE = lib
CONFIG += plugin
if(win32|mac):!macx-xcode {
- contains(QT_CONFIG, simulator_and_device): CONFIG += simulator_and_device
- contains(QT_CONFIG, debug_and_release): CONFIG += debug_and_release
- contains(QT_CONFIG, build_all): CONFIG += build_all
+ qtConfig(simulator_and_device): CONFIG += simulator_and_device
+ qtConfig(debug_and_release): CONFIG += debug_and_release
+ qtConfig(build_all): CONFIG += build_all
}
CONFIG += relative_qt_rpath # Qt's QML plugins should be relocatable
diff --git a/mkspecs/features/qpa/basicunixfontdatabase.prf b/mkspecs/features/qpa/basicunixfontdatabase.prf
index f2e4016c99..80382da214 100644
--- a/mkspecs/features/qpa/basicunixfontdatabase.prf
+++ b/mkspecs/features/qpa/basicunixfontdatabase.prf
@@ -1,3 +1,3 @@
-contains(QT_CONFIG, system-freetype) {
+qtConfig(system-freetype) {
LIBS_PRIVATE += -lfreetype
}
diff --git a/mkspecs/features/qpa/genericunixfontdatabase.prf b/mkspecs/features/qpa/genericunixfontdatabase.prf
index b0d81e5571..3680d5ad79 100644
--- a/mkspecs/features/qpa/genericunixfontdatabase.prf
+++ b/mkspecs/features/qpa/genericunixfontdatabase.prf
@@ -1,5 +1,5 @@
CONFIG += qpa/basicunixfontdatabase
-contains(QT_CONFIG, fontconfig) {
+qtConfig(fontconfig) {
DEFINES += Q_FONTCONFIGDATABASE
LIBS_PRIVATE += -lfontconfig
} else:!android {
diff --git a/mkspecs/features/qt.prf b/mkspecs/features/qt.prf
index 8d96d18d06..0c5f080ec1 100644
--- a/mkspecs/features/qt.prf
+++ b/mkspecs/features/qt.prf
@@ -2,14 +2,14 @@ CONFIG *= thread
#handle defines
win32 {
- contains(QT_CONFIG, shared) {
+ qtConfig(shared) {
# this variable is read by qmake in qmake/generators/win32/msvc_vcproj.cpp
# function VcprojGenerator::initDeploymentTool()
QMAKE_DLL_PATHS += $$[QT_INSTALL_BINS/get]
}
}
CONFIG(release, debug|release):DEFINES += QT_NO_DEBUG
-contains(QT_CONFIG, force_asserts):DEFINES += QT_FORCE_ASSERTS
+qtConfig(force_asserts): DEFINES += QT_FORCE_ASSERTS
no_keywords:DEFINES += QT_NO_KEYWORDS
plugin { #Qt plugins
static:DEFINES += QT_STATICPLUGIN
@@ -165,7 +165,7 @@ for(ever) {
qt_module_deps = $$CLEAN_QT $$CLEAN_QT_PRIVATE
qt_module_deps = $$resolve_depends(qt_module_deps, "QT.")
-!no_qt_rpath:!static:contains(QT_CONFIG, rpath):!contains(QT_CONFIG, static):\
+!no_qt_rpath:!static:qtConfig(rpath):!qtConfig(static):\
contains(qt_module_deps, core) {
relative_qt_rpath:!isEmpty(QMAKE_REL_RPATH_BASE):contains(INSTALLS, target):\
isEmpty(target.files):isEmpty(target.commands):isEmpty(target.extra) {
@@ -176,7 +176,7 @@ qt_module_deps = $$resolve_depends(qt_module_deps, "QT.")
}
}
-!isEmpty(QMAKE_LFLAGS_RPATHLINK):!contains(QT_CONFIG, static) {
+!isEmpty(QMAKE_LFLAGS_RPATHLINK):!qtConfig(static) {
# -rpath-link is used by the linker to find dependencies of dynamic
# libraries which were NOT specified on the command line.
# This means that paths of direct dependencies (QT & QT_PRIVATE)
@@ -191,7 +191,7 @@ qt_module_deps = $$resolve_depends(qt_module_deps, "QT.")
# static builds: link qml import plugins into the app.
contains(qt_module_deps, qml): \
- contains(QT_CONFIG, static):contains(TEMPLATE, .*app):!host_build:!no_import_scan {
+ qtConfig(static):contains(TEMPLATE, .*app):!host_build:!no_import_scan {
!isEmpty(QTREPOS) {
for (qrep, QTREPOS): \
exists($$qrep/qml): \
@@ -238,7 +238,7 @@ contains(qt_module_deps, qml): \
}
}
QML_IMPORT_CPP = $$OUT_PWD/$$lower($$basename(TARGET))_qml_plugin_import.cpp
- write_file($$QML_IMPORT_CPP, IMPORT_FILE_CONT)|error("Aborting.")
+ write_file($$QML_IMPORT_CPP, IMPORT_FILE_CONT)|error()
GENERATED_SOURCES += $$QML_IMPORT_CPP
QMAKE_DISTCLEAN += $$QML_IMPORT_CPP
@@ -261,7 +261,7 @@ contains(qt_module_deps, qml): \
"[Paths]" \
"Imports = $$QMAKE_QML_BUNDLE_PATH" \
"Qml2Imports = $$QMAKE_QML_BUNDLE_PATH"
- write_file("$$OUT_PWD/qt.conf", QT_CONF_CONTENTS)|error("Aborting.")
+ write_file("$$OUT_PWD/qt.conf", QT_CONF_CONTENTS)|error()
# write qt.conf and copy each qml import dir into the bundle.
# But strip away archives and other files that are not needed:
@@ -318,7 +318,7 @@ contains(TEMPLATE, .*app) {
}
QT_PLUGIN_VERIFY = DEPLOYMENT_PLUGIN
-contains(QT_CONFIG, static) {
+qtConfig(static) {
QT_PLUGIN_VERIFY += QTPLUGIN
force_import_plugins|contains(TEMPLATE, .*app) {
import_plugins:!isEmpty(QTPLUGIN) {
@@ -334,7 +334,7 @@ contains(QT_CONFIG, static) {
warning("Plugin class name could not be determined for $$IMPORT_PLUG plugin.")
}
IMPORT_CPP = $$OUT_PWD/$$lower($$basename(TARGET))_plugin_import.cpp
- write_file($$IMPORT_CPP, IMPORT_FILE_CONT)|error("Aborting.")
+ write_file($$IMPORT_CPP, IMPORT_FILE_CONT)|error()
GENERATED_SOURCES += $$IMPORT_CPP
QMAKE_DISTCLEAN += $$IMPORT_CPP
}
diff --git a/mkspecs/features/qt_android_deps.prf b/mkspecs/features/qt_android_deps.prf
index 7ec7bad047..c172ca8c4e 100644
--- a/mkspecs/features/qt_android_deps.prf
+++ b/mkspecs/features/qt_android_deps.prf
@@ -79,7 +79,7 @@ DEPENDENCY_FILE = $$ANDROID_DEPENDS_DIR$$TARGET-android-dependencies.xml
!isEmpty(FILE_CONTENT) {
FILE_CONTENT = "<rules><dependencies><lib name=\"$$TARGET\"><depends>" $$FILE_CONTENT "</depends></lib></dependencies></rules>"
- write_file($$DEPENDENCY_FILE, FILE_CONTENT) | error("Aborting.")
+ write_file($$DEPENDENCY_FILE, FILE_CONTENT)|error()
}
}
diff --git a/mkspecs/features/qt_app.prf b/mkspecs/features/qt_app.prf
index 46aca50cc2..90135b00a3 100644
--- a/mkspecs/features/qt_app.prf
+++ b/mkspecs/features/qt_app.prf
@@ -21,14 +21,14 @@ QMAKE_LFLAGS += $$QMAKE_LFLAGS_GCSECTIONS
host_build: QT -= gui # no host tool will ever use gui
host_build:force_bootstrap {
- !build_pass:contains(QT_CONFIG, release_tools): CONFIG += release
+ !build_pass:qtConfig(release_tools): CONFIG += release
contains(QT, core(-private)?|xml) {
QT -= core core-private xml
QT += bootstrap-private
}
target.path = $$[QT_HOST_BINS]
} else {
- !build_pass:contains(QT_CONFIG, debug_and_release): CONFIG += release
+ !build_pass:qtConfig(debug_and_release): CONFIG += release
target.path = $$[QT_INSTALL_BINS]
CONFIG += relative_qt_rpath # Qt's tools and apps should be relocatable
}
diff --git a/mkspecs/features/qt_common.prf b/mkspecs/features/qt_common.prf
index e50fdb767b..57f1034d28 100644
--- a/mkspecs/features/qt_common.prf
+++ b/mkspecs/features/qt_common.prf
@@ -12,15 +12,14 @@
QMAKE_DIR_REPLACE_SANE += DESTDIR
CONFIG -= debug_and_release_target
-contains(QT_CONFIG, c++11): CONFIG += c++11 strict_c++
-contains(QT_CONFIG, c++14): CONFIG += c++14
-contains(QT_CONFIG, c++1z): CONFIG += c++1z
+qtConfig(c++11): CONFIG += c++11 strict_c++
+qtConfig(c++14): CONFIG += c++14
+qtConfig(c++1z): CONFIG += c++1z
contains(TEMPLATE, .*lib) {
# module and plugins
- !host_build:contains(QT_CONFIG, reduce_exports): CONFIG += hide_symbols
- unix:contains(QT_CONFIG, reduce_relocations): CONFIG += bsymbolic_functions
- contains(QT_CONFIG, largefile): CONFIG += largefile
- contains(QT_CONFIG, separate_debug_info): CONFIG += separate_debug_info
+ !host_build:qtConfig(reduce_exports): CONFIG += hide_symbols
+ unix:qtConfig(reduce_relocations): CONFIG += bsymbolic_functions
+ qtConfig(separate_debug_info): CONFIG += separate_debug_info
!isEmpty(_QMAKE_SUPER_CACHE_): \
rplbase = $$dirname(_QMAKE_SUPER_CACHE_)/[^/][^/]*
diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf
index bae050ae18..3ed0f9d25d 100644
--- a/mkspecs/features/qt_configure.prf
+++ b/mkspecs/features/qt_configure.prf
@@ -1,6 +1,9 @@
CONFIG -= qt debug_and_release
load(configure_base)
+QMAKE_CONFIG_CACHE = $$dirname(_QMAKE_CACHE_)/config.cache
+QMAKE_CONFIG_CACHE_USE = all
+
QT_CONFIGURE_REPORT =
QT_CONFIGURE_NOTES =
QT_CONFIGURE_WARNINGS =
@@ -123,6 +126,7 @@ defineTest(qtConfCommandline_string) {
val = $${2}
isEmpty(val): val = $$qtConfGetNextCommandlineArg()
+ # Note: Arguments which are variable assignments are legit here.
contains(val, "^-.*")|isEmpty(val) {
qtConfAddError("No value supplied to command line option '$$opt'.")
return()
@@ -139,7 +143,7 @@ defineTest(qtConfCommandline_optionalString) {
val = $${2}
isEmpty(val) {
v = $$qtConfPeekNextCommandlineArg()
- contains(v, "^-.*")|isEmpty(v): \
+ contains(v, "^-.*|[A-Z_]+=.*")|isEmpty(v): \
val = "yes"
else: \
val = $$qtConfGetNextCommandlineArg()
@@ -157,7 +161,7 @@ defineTest(qtConfCommandline_addString) {
val = $${2}
isEmpty(val): val = $$qtConfGetNextCommandlineArg()
- contains(val, "^-.*")|isEmpty(val) {
+ contains(val, "^-.*|[A-Z_]+=.*")|isEmpty(val) {
qtConfAddError("No value supplied to command line option '$$opt'.")
return()
}
@@ -173,6 +177,14 @@ defineTest(qtConfCommandline_addString) {
}
defineTest(qtConfParseCommandLine) {
+ custom = $$config.commandline.custom
+ customCall =
+ !isEmpty(custom) {
+ customCall = qtConfCommandline_$$custom
+ !defined($$customCall, test): \
+ error("Custom command line callback '$$custom' is undefined.")
+ }
+
for (ever) {
c = $$qtConfGetNextCommandlineArg()
isEmpty(c): break()
@@ -189,6 +201,35 @@ defineTest(qtConfParseCommandLine) {
next()
}
+ contains(c, "^--?recheck") {
+ QMAKE_CONFIG_CACHE_USE = positive
+ export(QMAKE_CONFIG_CACHE_USE)
+ next()
+ }
+ contains(c, "^--?recheck-all") {
+ QMAKE_CONFIG_CACHE_USE = none
+ export(QMAKE_CONFIG_CACHE_USE)
+ next()
+ }
+
+ !isEmpty(customCall) {
+ $${customCall}($$c): \
+ next()
+ }
+
+ contains(c, "([A-Z_]+)=(.*)") {
+ opt = $$replace(c, "^([A-Z_]+)=(.*)", "\\1")
+ val = $$replace(c, "^([A-Z_]+)=(.*)", "\\2")
+ var = $$eval(config.commandline.assignments.$${opt})
+ isEmpty(var) {
+ qtConfAddError("Assigning unknown variable '$$opt' on command line.")
+ return()
+ }
+ config.input.$$var = $$val
+ export(config.input.$$var)
+ next()
+ }
+
# parse out opt and val
contains(c, "^--?enable-(.*)") {
opt = $$replace(c, "^--?enable-(.*)", "\\1")
@@ -248,31 +289,12 @@ defineTest(qtConfParseCommandLine) {
}
}
-defineTest(qtConfTest_shell) {
- test = $$eval($${1}.test)
- dir = $$replace(test, [^/]*$, "")
- test = $$replace(test, ([^/]*/)*, "")
- args = $$eval($${1}.args)
- # replace any things like $$QMAKE_CXX by their values
- eval(args = $$args)
-
- test_dir = $$QMAKE_CONFIG_TESTS_DIR/$$dir
- test_out_dir = $$shadowed($$test_dir)
- test_cmd_base = "cd $$system_quote($$system_path($$test_out_dir)) &&"
-
- mkpath($$test_out_dir)|error("Aborting.")
-
- qtRunLoggedCommand("$$test_cmd_base $$test_dir/$${test} $${args}"): \
- return(false)
- return(true)
-}
-
defineReplace(qtConfToolchainSupportsFlag) {
test_out_dir = $$shadowed($$QMAKE_CONFIG_TESTS_DIR)
test_cmd_base = "cd $$system_quote($$system_path($$test_out_dir)) &&"
conftest = "int main() { return 0; }"
- write_file("$$test_out_dir/conftest.cpp", conftest)|error("Aborting.")
+ write_file("$$test_out_dir/conftest.cpp", conftest)|error()
qtRunLoggedCommand("$$test_cmd_base $$QMAKE_CXX $${1} -o conftest-out conftest.cpp"): \
return(true)
@@ -294,15 +316,19 @@ defineTest(qtConfTest_linkerSupportsFlag) {
return($$qtConfToolchainSupportsFlag($$LFLAGS "-Wl,$$flag"))
}
-defineReplace(qtConfFindInPath) {
- ensurePathEnv()
- for (dir, QMAKE_PATH_ENV) {
+defineReplace(qtConfFindInPathList) {
+ for (dir, 2) {
exists("$$dir/$${1}"): \
return("$$dir/$${1}")
}
return()
}
+defineReplace(qtConfFindInPath) {
+ ensurePathEnv()
+ return($$qtConfFindInPathList($$1, $$2 $$QMAKE_PATH_ENV))
+}
+
defineReplace(qtConfPkgConfigEnv) {
env =
!isEmpty(PKG_CONFIG_SYSROOT_DIR): env = "$${SETENV_PFX}PKG_CONFIG_SYSROOT_DIR=$${PKG_CONFIG_SYSROOT_DIR}$${SETENV_SFX} "
@@ -316,8 +342,6 @@ defineReplace(qtConfPkgConfig) {
$$host {
pkg_config = $$qtConfFindInPath("pkg-config")
- isEmpty(pkg_config): \
- return(false)
} else {
pkg_config = "$$qtConfPkgConfigEnv()$$PKG_CONFIG"
}
@@ -343,19 +367,132 @@ defineReplace(qtConfPrepareArgs) {
return($$args)
}
-defineTest(qtConfTest_pkgConfig) {
+defineTest(qtConfSetupLibraries) {
+ for (l, config.libraries._KEYS_) {
+ lpfx = config.libraries.$${l}
+ # 'export' may be omitted, in which case it falls back to the library's name
+ !defined($${lpfx}.export, var) {
+ $${lpfx}.export = $$l
+ export($${lpfx}.export)
+ }
+ isEmpty($${lpfx}.sources._KEYS_): \
+ error("Library $$l defines no sources")
+ for (s, $${lpfx}.sources._KEYS_) {
+ spfx = $${lpfx}.sources.$${s}
+ # link back to parent object
+ $${spfx}.library = $$l
+ export($${spfx}.library)
+ # a plain string is transformed into a structure
+ isEmpty($${spfx}._KEYS_) {
+ $${spfx}.libs = $$eval($${spfx})
+ export($${spfx}.libs)
+ }
+ # if the type is missing (implicitly in the case of plain strings), assume 'inline'
+ isEmpty($${spfx}.type) {
+ $${spfx}.type = inline
+ export($${spfx}.type)
+ }
+ }
+ }
+
+ # reverse mapping for assignments on command line.
+ for (a, config.commandline.assignments._KEYS_) {
+ apfx = config.commandline.assignments.$${a}
+ ra = config.commandline.rev_assignments.$$eval($$apfx)
+ $$ra = $$a
+ export($$ra)
+ }
+}
+
+# the library is specified inline in a 'libs' field.
+# overrides from the command line are accepted.
+defineTest(qtConfLibrary_inline) {
+ lib = $$eval($${1}.library)
+ !defined($${1}.libs, var): \
+ error("'inline' source in library '$$lib' does not specify 'libs'.")
+
+ # direct libs. overwrites inline libs.
+ defined(config.input.$${lib}.libs, var) {
+ $${1}.libs = $$eval(config.input.$${lib}.libs)
+ export($${1}.libs)
+ }
+
+ # build-specific direct libs. overwrites inline libs.
+ vars =
+ any = false
+ all = true
+ for (b, $${1}.builds._KEYS_) {
+ iv = $${lib}.libs.$${b}
+ vars += $$eval(config.commandline.rev_assignments.$${iv})
+ defined(config.input.$${iv}, var) {
+ $${1}.builds.$${b}.libs = $$eval(config.input.$${iv})
+ export($${1}.builds.$${b}.libs)
+ any = true
+ } else {
+ all = false
+ }
+ }
+ $$any:!$$all {
+ qtConfAddError("Either none or all of $$join(vars, ", ", [, ]) must be specified.")
+ return(false)
+ }
+
+ # prefix. prepends to (possibly overwritten) inline libs.
+ prefix = $$val_escape(config.input.$${lib}.prefix)
+ !isEmpty(prefix) {
+ $${1}.includedir = $$prefix/include
+ export($${1}.includedir)
+ $${1}.cflags = -I$$prefix/include
+ export($${1}.cflags)
+ $${1}.libs = "-L$$prefix/lib $$eval($${1}.libs)"
+ export($${1}.libs)
+ }
+
+ return(true)
+}
+
+# the library is provided by the qmake spec.
+# this source type cannot fail.
+defineTest(qtConfLibrary_makeSpec) {
+ spec = $$eval($${1}.spec)
+ isEmpty(spec): \
+ error("makeSpec source in library '$$eval($${1}.library)' does not specify 'spec'.")
+
+ $${1}.includedir = "$$val_escape(QMAKE_INCDIR_$$spec)"
+ export($${1}.includedir)
+ $${1}.cflags = "$$val_escape(QMAKE_CFLAGS_$$spec)"
+ export($${1}.cflags)
+ libs =
+ for (l, QMAKE_LIBDIR_$$spec): \
+ libs += -L$$l
+ libs += $$eval(QMAKE_LIBS_$$spec)
+ $${1}.libs = "$$val_escape(libs)"
+ export($${1}.libs)
+
+ # the library definition is always in scope, so no point in exporting it.
+ $${1}.export = false
+ export($${1}.export)
+
+ return(true)
+}
+
+# the library is found via pkg-config.
+defineTest(qtConfLibrary_pkgConfig) {
pkg_config = $$qtConfPkgConfig($$eval($${1}.host))
- args = $$qtConfPrepareArgs($$eval($${1}.pkg-config-args))
+ isEmpty(pkg_config): \
+ return(false)
+ args = $$qtConfPrepareArgs($$eval($${1}.args))
!qtConfPkgConfigPackageExists($$pkg_config, $$args): \
return(false)
- $${1}.libs = $$system("$$pkg_config --libs $$args")
- $${1}.cflags = $$system("$$pkg_config --cflags $$args")
- includes = $$system("$$pkg_config --cflags-only-I $$args")
+ qtRunLoggedCommand("$$pkg_config --modversion $$args", version)|return(false)
+ qtRunLoggedCommand("$$pkg_config --libs $$args", $${1}.libs)|return(false)
+ qtRunLoggedCommand("$$pkg_config --cflags $$args", $${1}.cflags)|return(false)
+ qtRunLoggedCommand("$$pkg_config --cflags-only-I $$args", includes)|return(false)
+ eval(includes = $$includes)
includes ~= s/^-I//g
- $${1}.includedir = $$includes
- version = $$system("$$pkg_config --modversion $$args")
+ $${1}.includedir = "$$val_escape(includes)"
$${1}.version = $$first(version)
export($${1}.libs)
export($${1}.cflags)
@@ -366,14 +503,158 @@ defineTest(qtConfTest_pkgConfig) {
defineTest(qtConfTest_getPkgConfigVariable) {
pkg_config = $$qtConfPkgConfig($$eval($${1}.host))
+ isEmpty(pkg_config): \
+ return(false)
args = $$qtConfPrepareArgs($$eval($${1}.pkg-config-args))
!qtConfPkgConfigPackageExists($$pkg_config, $$args): \
return(false)
variable = $$eval($${1}.pkg-config-variable)
- $${1}.value = $$system("$$pkg_config --variable=$$variable $$args")
+ qtRunLoggedCommand("$$pkg_config --variable=$$variable $$args", $${1}.value)|return(false)
export($${1}.value)
+ $${1}.cache += value
+ export($${1}.cache)
+ return(true)
+}
+
+defineReplace(qtConfLibraryArgs) {
+ qmake_args =
+ libs = $$eval($${1}.libs)
+ !isEmpty(libs): \
+ qmake_args += $$system_quote(LIBS += $$libs)
+ for (b, $${1}.builds._KEYS_): \
+ qmake_args += $$system_quote(LIBS_$$upper($$b) += $$eval($${1}.builds.$${b}))
+ includedir = $$eval($${1}.includedir)
+ !isEmpty(includedir): \
+ qmake_args += $$system_quote(INCLUDEPATH *= $$includedir)
+ return($$qmake_args)
+}
+
+defineReplace(qtConfGetHexVersion) {
+ version = $$split(1, '.')
+ number =
+ for(i, 0..2) {
+ n = $$member(version, $$i)
+ isEmpty(n): n = 0
+ number += $$format_number($$n, obase=16 zeropad width=2)
+ }
+ number = "0x$$join(number)"
+ return($$number)
+}
+
+defineTest(qtConfExportLibrary) {
+ isEmpty(2): return()
+ !$$qtConfEvaluate($$eval($${1}.export)): return()
+
+ output = privatePro
+
+ eval(libs = $$eval($${1}.libs))
+ eval(cflags = $$eval($${1}.cflags))
+ eval(includes = $$eval($${1}.includedir))
+ version = $$eval($${1}.version)
+
+ NAME = $$upper($$2)
+ !isEmpty(libs): qtConfOutputVar(assign, $$output, QMAKE_LIBS_$$NAME, $$libs)
+ for (b, $${1}.builds._KEYS_): \
+ qtConfOutputVar(assign, $$output, QMAKE_LIBS_$${NAME}_$$upper($$b), \
+ $$eval($${1}.builds.$${b}))
+ !isEmpty(cflags): qtConfOutputVar(assign, $$output, QMAKE_CFLAGS_$$NAME, $$cflags)
+ !isEmpty(includes): qtConfOutputVar(assign, $$output, QMAKE_INCDIR_$$NAME, $$includes)
+ !isEmpty(version) {
+ qtConfOutputVar(assign, $$output, QMAKE_$${NAME}_VERSION, $$version)
+ qtConfOutputSetDefine("privateHeader", "QT_LIBRARY_VERSION_$${2}", $$qtConfGetHexVersion($$version))
+ version = $$split(version, '.')
+ qtConfOutputVar(assign, $$output, QMAKE_$${NAME}_VERSION_MAJOR, $$member(version, 0))
+ qtConfOutputVar(assign, $$output, QMAKE_$${NAME}_VERSION_MINOR, $$member(version, 1))
+ qtConfOutputVar(assign, $$output, QMAKE_$${NAME}_VERSION_PATCH, $$member(version, 2))
+ }
+ export(config.output.$${output})
+}
+
+defineTest(qtConfHandleLibrary) {
+ lpfx = config.libraries.$$1
+ defined($${lpfx}.result, var): return()
+
+ qtConfEnsureTestTypeDeps("library")
+
+ qtConfLoadResult($${lpfx}, $$1) {
+ qtConfExportLibrary($${lpfx}.sources.$$eval($${lpfx}.source), $$eval($${lpfx}.export))
+ return()
+ }
+
+ qtLogTestIntro($${lpfx})
+ msg = "looking for library $${1}"
+ write_file($$QMAKE_CONFIG_LOG, msg, append)
+
+ result = false
+ for (s, $${lpfx}.sources._KEYS_) {
+ qtLog("Trying source $$s of library $${1}.")
+ spfx = $${lpfx}.sources.$${s}
+
+ t = $$eval($${spfx}.type)
+ call = qtConfLibrary_$$t
+ !defined($$call, test): \
+ error("Library $${1} source $${s} has unknown type '$$t'")
+
+ !$$qtConfEvaluate($$eval($${spfx}.condition)) {
+ qtLog("Source $$s of library $$1 failed condition.")
+ next()
+ }
+
+ !$${call}($$spfx) {
+ qtLog("Source $$s of library $$1 produced no result.")
+ next()
+ }
+
+ # if the library defines a test, use it to verify the source.
+ !isEmpty($${lpfx}.test) {
+ $${lpfx}.literal_args = $$qtConfLibraryArgs($$spfx)
+ $${lpfx}.host = $$eval($${spfx}.host)
+ !qtConfTest_compile($$lpfx) {
+ qtLog("Source $$s of library $$1 failed verification.")
+ next()
+ }
+ }
+
+ $${lpfx}.cache += source
+ for (v, $$list(libs includes cflags version export)): \
+ $${lpfx}.cache += sources.$${s}.$${v}
+ for (b, $${spfx}.builds._KEYS_): \
+ $${lpfx}.cache += sources.$${s}.builds.$${b}
+
+ # immediately output the library as well.
+ qtConfExportLibrary($${spfx}, $$eval($${lpfx}.export))
+
+ $${lpfx}.source = $$s
+ export($${lpfx}.source)
+ result = true
+ break()
+ }
+
+ qtLogTestResult($${lpfx}, $$result)
+
+ $${lpfx}.result = $$result
+ export($${lpfx}.result)
+ qtConfSaveResult($${lpfx}, $$1)
+}
+
+# This is a fake test type for the test dependency system.
+defineTest(qtConfTest_library) {
+ error("The test type 'library' may not be instantiated.")
+}
+
+defineTest(qtConfTestPrepare_compile) {
+ for (u, $$list($$eval($${1}.use))) {
+ !contains(config.libraries._KEYS_, $$u): \
+ error("Test $$1 tries to use undeclared library '$$u'")
+ qtConfHandleLibrary($$u)
+ lpfx = config.libraries.$${u}
+ isEmpty($${lpfx}.source): \
+ return(false)
+ $${1}.literal_args += $$qtConfLibraryArgs($${lpfx}.sources.$$eval($${lpfx}.source))
+ }
+ export($${1}.literal_args)
return(true)
}
@@ -382,17 +663,18 @@ defineTest(qtConfTest_compile) {
host = $$eval($${1}.host)
isEmpty(host): host = false
- # get package config information
- qtConfTest_pkgConfig($${1})
-
test_dir = $$QMAKE_CONFIG_TESTS_DIR/$$test
test_out_dir = $$shadowed($$test_dir)
!isEmpty($${1}.pro): \
test_dir = $$test_dir/$$eval($${1}.pro)
test_cmd_base = "cd $$system_quote($$system_path($$test_out_dir)) &&"
+ qmake_args = $$qtConfPkgConfigEnv()$$system_quote($$system_path($$QMAKE_QMAKE))
+ !isEmpty(QMAKE_QTCONF): \
+ qmake_args += -qtconf $$system_quote($$QMAKE_QTCONF)
+
# Disable qmake features which are typically counterproductive for tests
- qmake_args = "\"CONFIG -= qt debug_and_release app_bundle lib_bundle\""
+ qmake_args += "\"CONFIG -= qt debug_and_release app_bundle lib_bundle\""
# allow tests to behave differently depending on the type of library
# being built (shared/static). e.g. see config.tests/unix/icu
@@ -401,6 +683,9 @@ defineTest(qtConfTest_compile) {
else: \
qmake_configs = "static"
+ use_gold_linker: \
+ qmake_configs += "use_gold_linker"
+
# add console to the CONFIG variable when running the tests, so that they
# can work with a regular main() entry point on Windows.
qmake_configs += "console"
@@ -415,35 +700,26 @@ defineTest(qtConfTest_compile) {
# add compiler flags, these are set for the target and should not be applied to host tests
!isEmpty(EXTRA_DEFINES): \
- qmake_args += "\"DEFINES += $$EXTRA_DEFINES\""
+ qmake_args += $$system_quote(DEFINES += $$val_escape(EXTRA_DEFINES))
!isEmpty(EXTRA_LIBDIR) \
- qmake_args += "\"QMAKE_LIBDIR += $$EXTRA_LIBDIR\""
+ qmake_args += $$system_quote(QMAKE_LIBDIR += $$val_escape(EXTRA_LIBDIR))
!isEmpty(EXTRA_FRAMEWORKPATH) \
- qmake_args += "\"QMAKE_FRAMEWORKPATH += $$EXTRA_FRAMEWORKPATH\""
+ qmake_args += $$system_quote(QMAKE_FRAMEWORKPATH += $$val_escape(EXTRA_FRAMEWORKPATH))
!isEmpty(EXTRA_INCLUDEPATH): \
- qmake_args += "\"INCLUDEPATH += $$EXTRA_INCLUDEPATH\""
+ qmake_args += $$system_quote(INCLUDEPATH += $$val_escape(EXTRA_INCLUDEPATH))
qmake_args += $$EXTRA_QMAKE_ARGS
}
- libs = $$eval($${1}.libs)
- !isEmpty(libs): \
- qmake_args += "\"LIBS += $$libs\""
-
- includedir = $$eval($${1}.includedir)
- !isEmpty(includedir): \
- qmake_args += "\"INCLUDEPATH *= $$includedir\""
-
# Clean up after previous run
- exists($$test_out_dir/Makefile): qtRunLoggedCommand("$$test_cmd_base $$QMAKE_MAKE distclean")
+ exists($$test_out_dir/Makefile): \
+ QMAKE_MAKE = "$$QMAKE_MAKE clean && $$QMAKE_MAKE"
- mkpath($$test_out_dir)|error("Aborting.")
-
- !isEmpty(QMAKE_QTCONF): qtconfarg = -qtconf $$QMAKE_QTCONF
+ mkpath($$test_out_dir)|error()
# add possible command line args
- qmake_args += $$qtConfPrepareArgs($$eval($${1}.args))
+ qmake_args += $$qtConfPrepareArgs($$eval($${1}.args)) $$eval($${1}.literal_args)
- qtRunLoggedCommand("$$test_cmd_base $$qtConfPkgConfigEnv()$$system_quote($$system_path($$QMAKE_QMAKE)) $$qtconfarg $$qmake_args $$shell_quote($$test_dir)") {
+ qtRunLoggedCommand("$$test_cmd_base $$qmake_args $$system_quote($$test_dir)") {
qtRunLoggedCommand("$$test_cmd_base $$QMAKE_MAKE"): \
return(true)
}
@@ -451,11 +727,51 @@ defineTest(qtConfTest_compile) {
return(false)
}
+defineTest(qtConfTest_verifySpec) {
+ qtConfTest_compile($$1): return(true)
+ qtConfAddError("Cannot compile a minimal program. The toolchain or QMakeSpec is broken.", log)
+ qtConfPrintReport()
+ error()
+}
+
+defineTest(qtConfTest_files) {
+ for(i, $${1}.files._KEYS_) {
+ f = $$eval($${1}.files.$${i})
+ qtLog("Searching for file $${f}.")
+ contains(f, ".*\.h") {
+ file = $$qtConfFindInPathList($$f, $$EXTRA_INCLUDEPATH $$QMAKE_DEFAULT_INCDIRS)
+ } else: contains(f, ".*\.(lib|so|a)") {
+ file = $$qtConfFindInPathList($$f, $$EXTRA_LIBDIR $$QMAKE_DEFAULT_LIBDIRS)
+ } else {
+ # assume we're looking for an executable
+ file = $$qtConfFindInPath($$f, $$EXTRA_PATH)
+ }
+ isEmpty(file) {
+ qtLog(" Not found.");
+ return(false)
+ }
+ qtLog(" Found at $${file}.")
+ }
+ return(true)
+}
+
defineTest(logn) {
log("$${1}$$escape_expand(\\n)")
}
+defineTest(qtLogTestIntro) {
+ description = $$eval($${1}.description)
+ isEmpty(description): return()
+
+ msg = "Checking for $${description}... "
+ log($$msg)
+ $$QMAKE_CONFIG_VERBOSE: log("$$escape_expand(\\n)")
+ write_file($$QMAKE_CONFIG_LOG, msg, append)
+}
+
defineTest(qtLogTestResult) {
+ isEmpty($${1}.description): return()
+
!isEmpty($${1}.log) {
field = $$eval($${1}.log)
log_msg = $$eval($${1}.$$field)
@@ -472,44 +788,125 @@ defineTest(qtLogTestResult) {
write_file($$QMAKE_CONFIG_LOG, msg, append)
}
+defineTest(qtConfSaveResult) {
+ keys = result $$eval($${1}.cache)
+ cont = "cache.$${2}._KEYS_ = $$keys"
+ for (k, keys): \
+ cont += "cache.$${2}.$${k} = $$val_escape($${1}.$${k})"
+ write_file($$QMAKE_CONFIG_CACHE, cont, append)|error()
+}
+
+defineTest(qtConfLoadResult) {
+ equals(QMAKE_CONFIG_CACHE_USE, none): \
+ return(false)
+ isEmpty(cache.$${2}._KEYS_): \
+ return(false)
+ equals(QMAKE_CONFIG_CACHE_USE, positive):!$$eval(cache.$${2}.result): \
+ return(false)
+ for (k, cache.$${2}._KEYS_) {
+ $${1}.$${k} = $$eval(cache.$${2}.$${k})
+ export($${1}.$${k})
+ }
+ return(true)
+}
+
defineTest(qtConfIsBoolean) {
equals(1, "true")|equals(1, "false"): \
return(true)
return(false)
}
+defineTest(qtConfSetupTestTypeDeps) {
+ for (tt, config.testTypeDependencies._KEYS_) {
+ !defined(qtConfTest_$${tt}, test): \
+ error("Declaring dependency for undefined test type '$$tt'.")
+ for (f, config.testTypeDependencies.$${tt}._KEYS_) {
+ feature = $$eval(config.testTypeDependencies.$${tt}.$${f})
+ isEmpty(config.features.$${feature}._KEYS_): \
+ error("Test type '$$tt' depends on undefined feature '$$feature'.")
+ }
+ }
+ # Test type aliasing means that one test type's callback is called by
+ # another test type's callback. Put differently, one callback forwards
+ # the call to another one. The former representation is more natural
+ # (and concise) to write, while the latter is more efficient to process.
+ # Hence, this function inverts the mapping.
+ for (tt, config.testTypeAliases._KEYS_) {
+ !defined(qtConfTest_$${tt}, test): \
+ error("Aliasing undefined test type '$$tt'.")
+ for (tta, config.testTypeAliases.$${tt}._KEYS_) {
+ type = $$eval(config.testTypeAliases.$${tt}.$${tta})
+ !defined(qtConfTest_$${type}, test): \
+ error("Aliasing '$$tt' to undefined test type '$$type'.")
+ config.testTypeForwards.$${type} += $$tt
+ export(config.testTypeForwards.$${type})
+ }
+ }
+}
+
+defineTest(qtConfEnsureTestTypeDeps) {
+ depsn = config.testTypeDependencies.$${1}._KEYS_
+ !isEmpty($$depsn) {
+ for (dep, $$depsn) {
+ feature = $$eval(config.testTypeDependencies.$${1}.$${dep})
+ !qtConfCheckFeature($$feature): \
+ error("Test type '$$1' depends on non-emitted feature $${feature}.")
+ }
+ $$depsn =
+ export($$depsn)
+ }
+ fwdsn = config.testTypeForwards.$${1}
+ !isEmpty($$fwdsn) {
+ for (fwd, $$fwdsn): \
+ qtConfEnsureTestTypeDeps($$fwd)
+ $$fwdsn =
+ export($$fwdsn)
+ }
+}
+
defineTest(qtRunSingleTest) {
tpfx = config.tests.$${1}
defined($${tpfx}.result, var): \
return()
+ result = true
type = $$eval($${tpfx}.type)
call = "qtConfTest_$$type"
!defined($$call, test): \
error("Configure test $${1} refers to nonexistent type $$type")
- description = $$eval($${tpfx}.description)
- !isEmpty(description) {
- msg = "checking for $${description}... "
- log($$msg)
- $$QMAKE_CONFIG_VERBOSE: log("$$escape_expand(\\n)")
+ qtConfEnsureTestTypeDeps($$type)
+
+ preCall = "qtConfTestPrepare_$$type"
+ defined($$preCall, test): \
+ !$${preCall}($${tpfx}): result = false
+
+ $$result {
+ # note: we do this only after resolving the dependencies and the
+ # preparation (which may resolve libraries), so that caching does
+ # not alter the execution order (and thus the output).
+ qtConfLoadResult($${tpfx}, $$1): \
+ return()
+
+ qtLogTestIntro($${tpfx})
+ msg = "executing config test $${1}"
write_file($$QMAKE_CONFIG_LOG, msg, append)
- }
- msg = "executing config test $${1}"
- write_file($$QMAKE_CONFIG_LOG, msg, append)
+ !$${call}($${tpfx}): result = false
- result = false
- $${call}($${tpfx}): result = true
+ qtLogTestResult($${tpfx}, $$result)
+ }
- !isEmpty(description): qtLogTestResult($${tpfx}, $$result)
$${tpfx}.result = $$result
export($${tpfx}.result)
+ qtConfSaveResult($${tpfx}, $$1)
}
defineReplace(qtConfEvaluate) {
isEmpty(1): return(true)
+ 1 ~= s/$$escape_expand(\\t)/ /g
+ 1 ~= s/$$escape_expand(\\r)//g
1 ~= s/$$escape_expand(\\n) */ /g
expr = $${1}
expr ~= s/&&/ && /g
@@ -547,6 +944,19 @@ defineReplace(qtConfEvaluateSingleExpression) {
error("Unknown test object $${test} in expression '$${1}'.")
qtRunSingleTest($$test)
result = $$eval(config.tests.$${test}.$${var})
+ } else: contains(e, "^libs\..*") {
+ !qt_conf_tests_allowed: \
+ error("Expression '$${1}' refers to a library, which is not allowed at this stage of configuring.")
+ lib = $$section(e, ".", 1, 1)
+ var = $$section(e, ".", 2, -1)
+ isEmpty(var): \
+ var = result
+ !contains(config.libraries._KEYS_, $$lib): \
+ error("Unknown library object $${lib} in expression '$${1}'.")
+ qtConfHandleLibrary($$lib)
+ !defined(config.libraries.$${lib}.$${var}, var): \
+ var = sources.$$eval(config.libraries.$${lib}.$${source}).$$var
+ result = $$eval(config.libraries.$${lib}.$${var})
} else: contains(e, "^features\..*") {
feature = $$section(e, ".", 1, 1)
var = $$section(e, ".", 2, -1)
@@ -564,6 +974,8 @@ defineReplace(qtConfEvaluateSingleExpression) {
} else: contains(e, "^arch\..*") {
var = $$replace(e, "^arch\.", "")
result = false
+ isEmpty(QT_ARCH): \
+ qtConfCheckFeature(architecture)
contains(QT_ARCH, $$var): result = true
} else: contains(e, "^input\..*") {
result = $$eval(config.$$e)
@@ -729,27 +1141,8 @@ defineTest(qtConfCheckFeature) {
defineTest(qtConfProcessFeatures) {
- priorities = 0
for (feature, config.features._KEYS_): \
- priorities += $$eval(config.features.$${feature}.priority)
- priorities = $$unique(priorities)
-
- for (p, priorities): \
- opriorities += $$format_number($$num_add($$p, 10000), width=5 zeropad)
- opriorities = $$sorted(opriorities)
-
- priorities =
- for (op, opriorities): \
- priorities += $$num_add($$op, -10000)
-
- for (priority, priorities) {
- for (feature, config.features._KEYS_) {
- p = $$eval(config.features.$${feature}.priority)
- isEmpty(p): p = 0
- equals(p, $$priority): \
- qtConfCheckFeature($$feature)
- }
- }
+ qtConfCheckFeature($$feature)
}
#
@@ -889,30 +1282,30 @@ defineTest(qtConfCreateSummary) {
defineTest(qtConfPrintReport) {
for (n, QT_CONFIGURE_REPORT): \
logn($$n)
- logn(" ")
+ logn()
for (n, QT_CONFIGURE_NOTES) {
logn($$n)
- logn(" ")
+ logn()
}
for (w, QT_CONFIGURE_WARNINGS) {
logn($$w)
- logn(" ")
+ logn()
}
!isEmpty(QT_CONFIGURE_ERRORS) {
for (e, QT_CONFIGURE_ERRORS) {
logn($$e)
- logn(" ")
+ logn()
}
mention_config_log:!$$QMAKE_CONFIG_VERBOSE {
logn("Check config.log for details.")
- logn(" ")
+ logn()
}
!equals(config.input.continue, yes): \
- error("Aborting.")
+ error()
}
}
@@ -976,6 +1369,8 @@ defineTest(qtConfOutputVarHelper) {
error("Output type 'var$$title($$1)' used in feature '$$eval($${2}.feature)' without a 'name' entry.")
value = $$qtConfEvaluate($$eval($${2}.value))
+ !isEmpty($${2}.eval):$$qtConfEvaluate($$eval($${2}.eval)): \
+ eval(value = $$value)
qtConfOutputVar($$1, $$output, $$name, $$value)
}
@@ -1059,50 +1454,37 @@ defineTest(qtConfOutput_feature) {
}
}
-# currently this is somewhat inconsistent, as the feature is output to the public pro file,
-# whereas the define is being added to the private pro file.
-# This should get cleaned up to add to the private pro and header instead.
-defineTest(qtConfOutput_privateFeature) {
+defineTest(qtConfOutput_publicFeature) {
name = "$$eval($${1}.name)"
isEmpty(name): \
name = $$eval($${1}.feature)
+ feature = $$replace(name, [-+.], _)
$${2} {
- qtConfOutputVar(append, "publicPro", "QT_CONFIG", $$name)
+ qtConfOutputVar(append, "publicPro", "QT.global.enabled_features", $$name)
+ qtConfOutputSetDefine("publicHeader", "QT_FEATURE_$$feature", 1)
} else {
- f = $$upper($$replace(name, -, _))
- qtConfOutputVar(append, "privatePro", "DEFINES", "QT_NO_$$f")
+ qtConfOutputVar(append, "publicPro", "QT.global.disabled_features", $$name)
+ qtConfOutputSetDefine("publicHeader", "QT_FEATURE_$$feature", -1)
}
}
-
-defineTest(qtConfOutput_library) {
- !$${2}: return()
-
- output = privatePro
+# currently this is somewhat inconsistent, as the feature is output to the public pro file,
+# whereas the define is being added to the private pro file.
+# This should get cleaned up to add to the private pro and header instead.
+defineTest(qtConfOutput_privateFeature) {
name = "$$eval($${1}.name)"
isEmpty(name): \
name = $$eval($${1}.feature)
- NAME = $$upper($$replace(name, [-.], _))
+ feature = $$replace(name, [-+.], _)
- lookup = "config.tests.$$eval($${1}.test)"
- isEmpty(lookup): \
- error("Output type 'library' used in feature '$$eval($${1}.feature)' without a 'test' entry.")
-
- libs = $$eval($${lookup}.libs)
- cflags = $$eval($${lookup}.cflags)
- includes = $$eval($${lookup}.includedir)
- version = $$split($${lookup}.version, '.')
-
- !isEmpty(libs): qtConfOutputVar(assign, $$output, QMAKE_LIBS_$$NAME, $$libs)
- !isEmpty(cflags): qtConfOutputVar(assign, $$output, QMAKE_CFLAGS_$$NAME, $$cflags)
- !isEmpty(includes): qtConfOutputVar(assign, $$output, QMAKE_INCDIR_$$NAME, $$includes)
- !isEmpty(version) {
- qtConfOutputVar(assign, $$output, QMAKE_$${NAME}_VERSION_MAJOR, $$first(version))
- qtConfOutputVar(assign, $$output, QMAKE_$${NAME}_VERSION_MINOR, $$member(version, 1))
- qtConfOutputVar(assign, $$output, QMAKE_$${NAME}_VERSION_PATCH, $$member(version, 2))
+ $${2} {
+ qtConfOutputVar(append, "privatePro", "QT.global.enabled_features", $$name)
+ qtConfOutputSetDefine("privateHeader", "QT_FEATURE_$$feature", 1)
+ } else {
+ qtConfOutputVar(append, "privatePro", "QT.global.disabled_features", $$name)
+ qtConfOutputSetDefine("privateHeader", "QT_FEATURE_$$feature", -1)
}
- export(config.output.$${output})
}
defineTest(qtConfProcessOneOutput) {
@@ -1122,15 +1504,13 @@ defineTest(qtConfProcessOneOutput) {
!defined("qtConfOutput_$$call", test): \
error("Undefined type '$$call' in output '$$2' of feature '$$feature'.")
- isEmpty($${opfx}.feature): \
- $${opfx}.feature = $$feature
-
condition = $$eval($${opfx}.condition)
!isEmpty(condition) {
!$$qtConfEvaluate($$condition): \
return(false)
}
+ $${opfx}.feature = $$feature
qtConfOutput_$${call}($$opfx, $$eval($${fpfx}.available))
}
@@ -1148,15 +1528,13 @@ defineTest(qtConfProcessOutput) {
} else {
for (define, config.output.$${type}._KEYS_) {
value = $$eval(config.output.$${type}.$${define})
- config.output.$$type += "$${LITERAL_HASH}ifndef $$define"
config.output.$$type += "$${LITERAL_HASH}define $$define $$value"
- config.output.$$type += "$${LITERAL_HASH}endif"
}
}
defined(qtConfOutputPostProcess_$${type}, test): \
qtConfOutputPostProcess_$${type}()
- write_file($$file, config.output.$${type})|error("Aborting.")
+ write_file($$file, config.output.$${type})|error()
}
}
@@ -1170,13 +1548,30 @@ defineTest(qtConfigure) {
!parseJson(configure_data, config): \
error("Invalid or non-existent file $${1}.")
+ qtConfSetupLibraries()
+ qtConfSetupTestTypeDeps()
+
qtConfParseCommandLine()
+ !equals(QMAKE_CONFIG_CACHE_USE, none) {
+ include($$QMAKE_CONFIG_CACHE, , true)
+ # this crudely determines when to discard the cache. this also catches the case
+ # of no cache being there in the first place.
+ !equals(cache.platform, $$[QMAKE_SPEC])|!equals(cache.xplatform, $$[QMAKE_XSPEC]): \
+ QMAKE_CONFIG_CACHE_USE = none
+ }
+ equals(QMAKE_CONFIG_CACHE_USE, none) {
+ cont = \
+ "cache.platform = $$[QMAKE_SPEC]" \
+ "cache.xplatform = $$[QMAKE_XSPEC]"
+ write_file($$QMAKE_CONFIG_CACHE, cont)
+ }
+
# do early checks, mainly to validate the command line
qtConfProcessEarlyChecks()
CONFIG += qt_conf_tests_allowed
- logn(" ")
+ logn()
logn("Running configuration tests...")
# process all features
@@ -1188,12 +1583,12 @@ defineTest(qtConfigure) {
qtConfCreateSummary()
logn("Done running configuration tests.")
- logn(" ")
+ logn()
}
qtConfigure($$_PRO_FILE_PWD_/configure.json)
logn("Configure summary:")
-logn(" ")
+logn()
qtConfPrintReport()
diff --git a/mkspecs/features/qt_docs.prf b/mkspecs/features/qt_docs.prf
index 183d0c9502..72dde61a40 100644
--- a/mkspecs/features/qt_docs.prf
+++ b/mkspecs/features/qt_docs.prf
@@ -21,12 +21,16 @@ qtvertag.name = QT_VERSION_TAG
qtvertag.value = $$replace(qtver.value, \.,)
qtdocs.name = QT_INSTALL_DOCS
qtdocs.value = $$[QT_INSTALL_DOCS/src]
-QT_TOOL_ENV = qtver qtmver qtvertag qtdocs
+builddir.name = BUILDDIR
+builddir.value = $$OUT_PWD
+QT_TOOL_ENV = qtver qtmver qtvertag qtdocs builddir
qtPrepareTool(QDOC, qdoc)
QT_TOOL_ENV =
!build_online_docs: qtPrepareTool(QHELPGENERATOR, qhelpgenerator)
+qtPrepareTool(QTATTRIBUTIONSSCANNER, qtattributionsscanner)
+
# qtPrepareTool() must be called outside a build pass, as it protects
# against concurrent wrapper creation by omitting it during build passes.
# However, creating the actual targets is reserved to the build passes.
@@ -63,12 +67,21 @@ DOC_INDEXES =
PREP_DOC_INDEXES += -indexdir $$shell_quote($$[QT_INSTALL_DOCS/get])
DOC_INDEXES += -indexdir $$shell_quote($$[QT_INSTALL_DOCS/get])
}
+
+qtattributionsscanner.target = qtattributionsscanner
+qtattributionsscanner.commands = $$QTATTRIBUTIONSSCANNER $$shell_quote($$MODULE_BASE_INDIR) \
+ --filter "QDocModule=$$QMAKE_DOCS_TARGET" -o $$shell_quote($$OUT_PWD/codeattributions.qdoc)
+qtattributionsscanner.CONFIG += phony
+QMAKE_EXTRA_TARGETS += qtattributionsscanner
+
doc_command = $$QDOC $$QMAKE_DOCS
prepare_docs {
prepare_docs.commands += $$doc_command -prepare $$PREP_DOC_INDEXES -no-link-errors
generate_docs.commands += $$doc_command -generate $$DOC_INDEXES
+ prepare_docs.depends += qtattributionsscanner
} else {
html_docs.commands += $$doc_command $$DOC_INDEXES
+ html_docs.depends += qtattributionsscanner
}
!build_online_docs {
diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf
index 6dd4a36b5e..08c7c9f899 100644
--- a/mkspecs/features/qt_functions.prf
+++ b/mkspecs/features/qt_functions.prf
@@ -16,7 +16,7 @@ defineReplace(qtPlatformTargetSuffix) {
defineReplace(qtLibraryTarget) {
LIBRARY_NAME = $$1
- CONFIG(shared, static|shared):contains(QT_CONFIG, qt_framework) {
+ CONFIG(shared, static|shared):qtConfig(framework) {
QMAKE_FRAMEWORK_BUNDLE_NAME = $$LIBRARY_NAME
export(QMAKE_FRAMEWORK_BUNDLE_NAME)
}
@@ -171,7 +171,7 @@ defineTest(qtAddToolEnv) {
"EndLocal"
$$1 = call
}
- !build_pass:!write_file($$OUT_PWD/$$batch_name, batch_cont, exe): error("Aborting.")
+ !build_pass:!write_file($$OUT_PWD/$$batch_name, batch_cont, exe): error()
isEmpty(3): \
$$1 += $$shell_quote($$shell_path($$OUT_PWD/$$batch_name))
else: \
@@ -196,7 +196,7 @@ defineTest(qtAddTargetEnv) {
} else:contains(QMAKE_HOST.os, Haiku) {
deppath.name = LIBRARY_PATH
} else:equals(QMAKE_HOST.os, Darwin) {
- contains(QT_CONFIG, qt_framework): \
+ qtConfig(framework): \
deppath.name = DYLD_FRAMEWORK_PATH
else: \
deppath.name = DYLD_LIBRARY_PATH
@@ -259,7 +259,7 @@ defineReplace(pkgConfigExecutable) {
}
defineTest(packagesExist) {
- contains(QT_CONFIG, no-pkg-config) {
+ !qtConfig(pkg-config) {
warning("pkg-config disabled, can't check package existence")
return(false)
}
@@ -302,3 +302,12 @@ defineTest(prepareRecursiveTarget) {
export($${target}.CONFIG)
export($${target}.recurse_target)
}
+
+defineTest(qtConfig) {
+ contains(QT.global.enabled_features, $$1): \
+ return(true)
+ contains(QT.global.disabled_features, $$1): \
+ return(false)
+
+ error("Could not find feature $${1}.")
+}
diff --git a/mkspecs/features/qt_helper_lib.prf b/mkspecs/features/qt_helper_lib.prf
index dc7a5da30e..8890866c64 100644
--- a/mkspecs/features/qt_helper_lib.prf
+++ b/mkspecs/features/qt_helper_lib.prf
@@ -18,15 +18,15 @@ QT = # In case qt is re-added.
CONFIG -= warning_clean # Don't presume 3rd party code to be clean
load(qt_common)
-contains(QT_CONFIG, simulator_and_device): CONFIG += simulator_and_device
-contains(QT_CONFIG, debug_and_release): CONFIG += debug_and_release
-contains(QT_CONFIG, build_all): CONFIG += build_all
+qtConfig(simulator_and_device): CONFIG += simulator_and_device
+qtConfig(debug_and_release): CONFIG += debug_and_release
+qtConfig(build_all): CONFIG += build_all
DESTDIR = $$MODULE_BASE_OUTDIR/lib
DLLDESTDIR = $$MODULE_BASE_OUTDIR/bin
# In static builds of Qt, convenience libraries must be installed,
# as in this case they are not linked to the final library/plugin.
-installed|if(!not_installed:contains(QT_CONFIG, static)): load(qt_installs)
+installed|if(!not_installed:qtConfig(static)): load(qt_installs)
TARGET = $$qt5LibraryTarget($$TARGET)
diff --git a/mkspecs/features/qt_module.prf b/mkspecs/features/qt_module.prf
index 923ac73200..90b4c181ee 100644
--- a/mkspecs/features/qt_module.prf
+++ b/mkspecs/features/qt_module.prf
@@ -32,17 +32,17 @@ host_build {
QMAKE_CFLAGS += $$QMAKE_CFLAGS_SPLIT_SECTIONS
QMAKE_CXXFLAGS += $$QMAKE_CXXFLAGS_SPLIT_SECTIONS
force_bootstrap {
- !build_pass:contains(QT_CONFIG, release_tools): CONFIG += release
+ !build_pass:qtConfig(release_tools): CONFIG += release
contains(QT, core(-private)?|xml) {
QT -= core core-private xml
QT += bootstrap-private
}
} else {
- !build_pass:contains(QT_CONFIG, debug_and_release): CONFIG += release
+ !build_pass:qtConfig(debug_and_release): CONFIG += release
}
}
-CONFIG(shared, static|shared):contains(QT_CONFIG, qt_framework): \
+CONFIG(shared, static|shared):qtConfig(framework): \
CONFIG += lib_bundle
CONFIG += relative_qt_rpath # Qt libraries should be relocatable
@@ -89,9 +89,9 @@ INCLUDEPATH *= $$eval(QT.$${MODULE}.includes) $$eval(QT.$${MODULE}_private.inclu
# If Qt was configured with -debug-and-release then build the module the same way
# - unless this is a host library
!host_build:if(win32|mac):!macx-xcode {
- contains(QT_CONFIG, simulator_and_device): CONFIG += simulator_and_device
- contains(QT_CONFIG, debug_and_release): CONFIG += debug_and_release
- contains(QT_CONFIG, build_all): CONFIG += build_all
+ qtConfig(simulator_and_device): CONFIG += simulator_and_device
+ qtConfig(debug_and_release): CONFIG += debug_and_release
+ qtConfig(build_all): CONFIG += build_all
}
QMAKE_LFLAGS += $$QMAKE_LFLAGS_NOUNDEF
@@ -140,7 +140,7 @@ mac {
QMAKE_CXXFLAGS += -fconstant-cfstrings
}
- contains(QT_CONFIG, rpath): \
+ qtConfig(rpath): \
QMAKE_SONAME_PREFIX = @rpath
else: \
CONFIG += absolute_library_soname
@@ -167,7 +167,7 @@ aix-g++* {
QMAKE_CXXFLAGS += -mminimal-toc
}
-sse2:!contains(QT_CPU_FEATURES.$$QT_ARCH, sse2):!host_build:!if(static:contains(QT_CONFIG, shared)) {
+sse2:!contains(QT_CPU_FEATURES.$$QT_ARCH, sse2):!host_build:!if(static:qtConfig(shared)) {
# If the compiler supports SSE2, enable it unconditionally in all of Qt shared libraries
# (and only the libraries). This is not expected to be a problem because:
# - on Windows, sharing of libraries is uncommon
@@ -235,7 +235,7 @@ android: CONFIG += qt_android_deps no_linker_version_script
verscript = $$verscript_in
}
- write_file($$OUT_PWD/$$verscript, verscript_content)|error("Aborting.")
+ write_file($$OUT_PWD/$$verscript, verscript_content)|error()
unset(current)
unset(previous)
unset(verscript)
diff --git a/mkspecs/features/qt_module_headers.prf b/mkspecs/features/qt_module_headers.prf
index 05d0706a33..7f4efef052 100644
--- a/mkspecs/features/qt_module_headers.prf
+++ b/mkspecs/features/qt_module_headers.prf
@@ -16,7 +16,7 @@ load(qt_build_paths)
minimal_syncqt {
QMAKE_SYNCQT += -minimal $$QMAKE_SYNCQT_OPTIONS
} else {
- contains(QT_CONFIG, private_tests): \ # -developer-build
+ qtConfig(private_tests): \ # -developer-build
QMAKE_SYNCQT += -check-includes
}
for(mod, MODULE_INCNAME): \
@@ -106,16 +106,19 @@ alien_syncqt: return()
for (injection, SYNCQT.INJECTIONS) {
injects = $$split(injection, :)
+ dst_hdr = $$absolute_path($$member(injects, 0), $$INC_PATH/include/$$MODULE_INCNAME)
fwd_hdr = $$member(injects, 1)
MAIN_FWD = $$INC_PATH/include/$$MODULE_INCNAME/$$fwd_hdr
- MAIN_FWD_CONT = '$${LITERAL_HASH}include "$$member(injects, 0)"'
- write_file($$MAIN_FWD, MAIN_FWD_CONT)|error("Aborting.")
+ MAIN_FWD_CONT = '$${LITERAL_HASH}include "$$relative_path($$dst_hdr, $$dirname(MAIN_FWD))"'
+ write_file($$MAIN_FWD, MAIN_FWD_CONT)|error()
+ touch($$MAIN_FWD, $$dst_hdr)
!git_build: QMAKE_DISTCLEAN += $$MAIN_FWD
injects = $$member(injects, 2, -1)
for (inject, injects) {
CLASS_FWD = $$INC_PATH/include/$$MODULE_INCNAME/$$inject
CLASS_FWD_CONT = '$${LITERAL_HASH}include "$$fwd_hdr"'
- write_file($$CLASS_FWD, CLASS_FWD_CONT)|error("Aborting.")
+ write_file($$CLASS_FWD, CLASS_FWD_CONT)|error()
+ touch($$CLASS_FWD, $$dst_hdr)
!git_build: QMAKE_DISTCLEAN += $$CLASS_FWD
}
}
@@ -135,7 +138,7 @@ MODULE_MASTER_DEPS_HEADER = $$MODULE_BASE_OUTDIR/include/$$MODULE_INCNAME/$${MOD
MODULE_MASTER_DEPS_HEADER_CONT += "$${LITERAL_HASH}include <$$depname/$$depname>"
}
MODULE_MASTER_DEPS_HEADER_CONT += "$${LITERAL_HASH}endif"
- write_file($$MODULE_MASTER_DEPS_HEADER, MODULE_MASTER_DEPS_HEADER_CONT)|error("Aborting.")
+ write_file($$MODULE_MASTER_DEPS_HEADER, MODULE_MASTER_DEPS_HEADER_CONT)|error()
!git_build: QMAKE_DISTCLEAN += $$MODULE_MASTER_DEPS_HEADER
}
SYNCQT.HEADER_FILES += $$MODULE_MASTER_DEPS_HEADER
@@ -227,7 +230,7 @@ headersclean:!internal_module {
$$[QT_INSTALL_DATA/src]/mkspecs/features/data/dummy.cpp
}
- !isEmpty(hcleanCOMMAND):if(!contains(QT_CONFIG, debug_and_release)|CONFIG(release, debug|release)) {
+ !isEmpty(hcleanCOMMAND):if(!qtConfig(debug_and_release)|CONFIG(release, debug|release)) {
header_check.dependency_type = TYPE_C
header_check.CONFIG += no_link
header_check.output = ${QMAKE_VAR_OBJECTS_DIR}header_${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)}
diff --git a/mkspecs/features/qt_module_pris.prf b/mkspecs/features/qt_module_pris.prf
index 4dd9e25f9f..b67a56c7d5 100644
--- a/mkspecs/features/qt_module_pris.prf
+++ b/mkspecs/features/qt_module_pris.prf
@@ -107,7 +107,7 @@ MODULE_FWD_PRI = $$mod_work_pfx/qt_lib_$${MODULE_ID}.pri
winrt: MODULE_PRI_CONT += \
"QT.$${MODULE_ID}.winrt_capabilities =$$join(MODULE_WINRT_CAPABILITIES, " ", " ")" \
"QT.$${MODULE_ID}.winrt_capabilities_device =$$join(MODULE_WINRT_CAPABILITIES_DEVICE, " ", " ")"
- write_file($$MODULE_PRI, MODULE_PRI_CONT)|error("Aborting.")
+ write_file($$MODULE_PRI, MODULE_PRI_CONT)|error()
!internal_module:!no_private_module {
module_build_type += internal_module
private_deps = $$QT
@@ -127,7 +127,7 @@ MODULE_FWD_PRI = $$mod_work_pfx/qt_lib_$${MODULE_ID}.pri
"QT.$${MODULE}_private.frameworks =" \
"QT.$${MODULE}_private.depends = $$private_deps" \
"QT.$${MODULE}_private.module_config =$$join(module_build_type, " ", " ")"
- write_file($$MODULE_PRIVATE_PRI, MODULE_PRIVATE_PRI_CONT)|error("Aborting.")
+ write_file($$MODULE_PRIVATE_PRI, MODULE_PRIVATE_PRI_CONT)|error()
}
MODULE_PRI_FILES = $$MODULE_PRI $$MODULE_PRIVATE_PRI
@@ -162,7 +162,7 @@ MODULE_FWD_PRI = $$mod_work_pfx/qt_lib_$${MODULE_ID}.pri
MODULE_FWD_PRI_CONT += \
"QT.$${MODULE}_private.includes $$pls= $$MODULE_FWD_PRIVATE_INCLUDES"
}
- write_file($$MODULE_FWD_PRI, MODULE_FWD_PRI_CONT)|error("Aborting.")
+ write_file($$MODULE_FWD_PRI, MODULE_FWD_PRI_CONT)|error()
touch($$MODULE_FWD_PRI, $$MODULE_PRI)
MODULE_PRI_FILES += $$MODULE_FWD_PRI
diff --git a/mkspecs/features/qt_plugin.prf b/mkspecs/features/qt_plugin.prf
index e11b543cb4..2179c7ca22 100644
--- a/mkspecs/features/qt_plugin.prf
+++ b/mkspecs/features/qt_plugin.prf
@@ -24,11 +24,11 @@ win32:CONFIG(shared, static|shared) {
}
tool_plugin {
- !build_pass:contains(QT_CONFIG, debug_and_release): CONFIG += release
+ !build_pass:qtConfig(debug_and_release): CONFIG += release
} else:if(win32|mac):!macx-xcode {
- contains(QT_CONFIG, simulator_and_device): CONFIG += simulator_and_device
- contains(QT_CONFIG, debug_and_release): CONFIG += debug_and_release
- contains(QT_CONFIG, build_all): CONFIG += build_all
+ qtConfig(simulator_and_device): CONFIG += simulator_and_device
+ qtConfig(debug_and_release): CONFIG += debug_and_release
+ qtConfig(build_all): CONFIG += build_all
}
CONFIG += relative_qt_rpath # Qt's plugins should be relocatable
@@ -50,7 +50,7 @@ CONFIG(static, static|shared)|prefix_build {
"QT_PLUGIN.$${MODULE}.EXTENDS =$$join(PLUGIN_EXTENDS, " ", " ")" \
"QT_PLUGIN.$${MODULE}.CLASS_NAME = $$PLUGIN_CLASS_NAME" \
"QT_PLUGINS += $$MODULE"
- write_file($$MODULE_PRI, MODULE_PRI_CONT)|error("Aborting.")
+ write_file($$MODULE_PRI, MODULE_PRI_CONT)|error()
MODULE_PRI_FILES = $$MODULE_PRI
force_independent {
@@ -59,7 +59,7 @@ CONFIG(static, static|shared)|prefix_build {
MODULE_FWD_PRI_CONT = \
"QT_PLUGIN.$${MODULE}.PATH = $$MODULE_BASE_OUTDIR/plugins" \
"include($$MODULE_PRI)"
- write_file($$MODULE_FWD_PRI, MODULE_FWD_PRI_CONT)|error("Aborting.")
+ write_file($$MODULE_FWD_PRI, MODULE_FWD_PRI_CONT)|error()
touch($$MODULE_FWD_PRI, $$MODULE_PRI)
MODULE_PRI_FILES += $$MODULE_FWD_PRI
diff --git a/mkspecs/features/qt_tool.prf b/mkspecs/features/qt_tool.prf
index bdeb59c83d..93c952617d 100644
--- a/mkspecs/features/qt_tool.prf
+++ b/mkspecs/features/qt_tool.prf
@@ -60,7 +60,7 @@ DEFINES *= QT_USE_QSTRINGBUILDER
"QT_TOOL.$${MODULE}.binary = $$val_escape(bin)" \
"QT_TOOL.$${MODULE}.depends =$$join(MODULE_DEPENDS, " ", " ")" \
$$module_envvars
- write_file($$TOOL_PRI, TOOL_PRI_CONT)|error("Aborting.")
+ write_file($$TOOL_PRI, TOOL_PRI_CONT)|error()
# Then, inject the new tool into the current cache state
!contains(QMAKE_INTERNAL_INCLUDED_FILES, $$TOOL_PRI) { # before the actual include()!
diff --git a/mkspecs/features/resolve_config.prf b/mkspecs/features/resolve_config.prf
index b712a2b58e..816c3b680d 100644
--- a/mkspecs/features/resolve_config.prf
+++ b/mkspecs/features/resolve_config.prf
@@ -41,7 +41,7 @@ CONFIG(debug, debug|release) {
# or not debug_and_release is active.
for(build, $$list(debug release)) {
suffix =
- contains(QT_CONFIG, debug_and_release) {
+ qtConfig(debug_and_release) {
equals(build, debug): \
suffix = _debug
} else {
diff --git a/mkspecs/features/resources.prf b/mkspecs/features/resources.prf
index 21147e4a42..adc8e9a8ac 100644
--- a/mkspecs/features/resources.prf
+++ b/mkspecs/features/resources.prf
@@ -65,7 +65,7 @@ for(resource, RESOURCES) {
"</RCC>"
!write_file($$OUT_PWD/$$resource_file, resource_file_content): \
- error("Aborting.")
+ error()
}
RESOURCES -= $$resource
diff --git a/mkspecs/features/uikit/bitcode.prf b/mkspecs/features/uikit/bitcode.prf
index ecc6542b3c..a1dff19eb3 100644
--- a/mkspecs/features/uikit/bitcode.prf
+++ b/mkspecs/features/uikit/bitcode.prf
@@ -5,9 +5,11 @@ lessThan(QMAKE_XCODE_VERSION, "7.0") {
QMAKE_CFLAGS += -fembed-bitcode
QMAKE_CXXFLAGS += -fembed-bitcode
QMAKE_OBJECTIVE_CFLAGS += -fembed-bitcode
+ QMAKE_LFLAGS += -fembed-bitcode
} else {
QMAKE_CFLAGS += -fembed-bitcode-marker
QMAKE_CXXFLAGS += -fembed-bitcode-marker
QMAKE_OBJECTIVE_CFLAGS += -fembed-bitcode-marker
+ QMAKE_LFLAGS += -fembed-bitcode-marker
}
}
diff --git a/mkspecs/features/uikit/default_post.prf b/mkspecs/features/uikit/default_post.prf
index 7c92a24556..52c9b1e8c8 100644
--- a/mkspecs/features/uikit/default_post.prf
+++ b/mkspecs/features/uikit/default_post.prf
@@ -22,6 +22,7 @@ macx-xcode {
device_family.name = TARGETED_DEVICE_FAMILY
ios: device_family.value = $$QMAKE_IOS_TARGETED_DEVICE_FAMILY
tvos: device_family.value = $$QMAKE_TVOS_TARGETED_DEVICE_FAMILY
+ watchos: device_family.value = $$QMAKE_WATCHOS_TARGETED_DEVICE_FAMILY
QMAKE_MAC_XCODE_SETTINGS += device_family
ios {
@@ -77,6 +78,11 @@ macx-xcode {
arch_simulator.value = $$QMAKE_TVOS_SIMULATOR_ARCHS
QMAKE_XCODE_ARCHS = $$QMAKE_TVOS_DEVICE_ARCHS $$QMAKE_TVOS_SIMULATOR_ARCHS
}
+ watchos {
+ arch_device.value = $$QMAKE_WATCHOS_DEVICE_ARCHS
+ arch_simulator.value = $$QMAKE_WATCHOS_SIMULATOR_ARCHS
+ QMAKE_XCODE_ARCHS = $$QMAKE_WATCHOS_DEVICE_ARCHS $$QMAKE_WATCHOS_SIMULATOR_ARCHS
+ }
QMAKE_MAC_XCODE_SETTINGS += arch_device arch_simulator
@@ -89,9 +95,11 @@ macx-xcode {
contains(QT_ARCH, arm.*) {
ios: VALID_ARCHS = $$QMAKE_IOS_DEVICE_ARCHS
tvos: VALID_ARCHS = $$QMAKE_TVOS_DEVICE_ARCHS
+ watchos: VALID_ARCHS = $$QMAKE_WATCHOS_DEVICE_ARCHS
} else {
ios: VALID_ARCHS = $$QMAKE_IOS_SIMULATOR_ARCHS
tvos: VALID_ARCHS = $$QMAKE_TVOS_SIMULATOR_ARCHS
+ watchos: VALID_ARCHS = $$QMAKE_WATCHOS_SIMULATOR_ARCHS
}
single_arch: VALID_ARCHS = $$first(VALID_ARCHS)
diff --git a/mkspecs/features/uikit/default_pre.prf b/mkspecs/features/uikit/default_pre.prf
index ff45c1de0d..e719ab0848 100644
--- a/mkspecs/features/uikit/default_pre.prf
+++ b/mkspecs/features/uikit/default_pre.prf
@@ -2,7 +2,7 @@
load(default_pre)
# In case Qt was built for a specific SDK
-!contains(QT_CONFIG, simulator_and_device):contains(QMAKE_MAC_SDK, ^$${simulator.sdk}.*): \
+!isEmpty(QT_VERSION):!qtConfig(simulator_and_device):contains(QMAKE_MAC_SDK, ^$${simulator.sdk}.*): \
CONFIG += simulator $${simulator.sdk}
# Check for supported Xcode versions
@@ -11,7 +11,7 @@ lessThan(QMAKE_XCODE_VERSION, "4.3"): \
build_pass:simulator {
# For a simulator_and_device build all the config tests
- # are based on the iPhoneOS ARM SDK, but we know that the simulator
+ # are based on the iPhoneOS/WatchOS ARM SDK, but we know that the simulator
# is i386 and that we support SSE/SSE2.
QT_ARCH = i386
QT_CPU_FEATURES.i386 = sse sse2
diff --git a/mkspecs/features/uikit/device_destinations.sh b/mkspecs/features/uikit/device_destinations.sh
index af7cb91e85..2c117d0ad4 100755
--- a/mkspecs/features/uikit/device_destinations.sh
+++ b/mkspecs/features/uikit/device_destinations.sh
@@ -44,6 +44,8 @@ echo "SIMULATOR_DEVICES = $booted_simulator"
xcodebuild test -scheme $2 -destination 'id=0' -destination-timeout 1 2>&1| sed -n 's/{ \(platform:.*\) }/\1/p' | while read destination; do
id=$(echo $destination | sed -n -E 's/.*id:([^ ,]+).*/\1/p')
+ [[ $id == *"placeholder"* ]] && continue
+
echo $destination | tr ',' '\n' | while read keyval; do
key=$(echo $keyval | cut -d ':' -f 1 | tr '[:lower:]' '[:upper:]')
val=$(echo $keyval | cut -d ':' -f 2)
@@ -58,6 +60,10 @@ xcodebuild test -scheme $2 -destination 'id=0' -destination-timeout 1 2>&1| sed
echo "HARDWARE_DEVICES += $id"
elif [ "$val" = "tvOS Simulator" -a "$id" != "$booted_simulator" ]; then
echo "SIMULATOR_DEVICES += $id"
+ elif [ "$val" = "watchOS" ]; then
+ echo "HARDWARE_DEVICES += $id"
+ elif [ "$val" = "watchOS Simulator" -a "$id" != "$booted_simulator" ]; then
+ echo "SIMULATOR_DEVICES += $id"
fi
fi
done
diff --git a/mkspecs/features/uikit/qt.prf b/mkspecs/features/uikit/qt.prf
index af047be466..4475c137dc 100644
--- a/mkspecs/features/uikit/qt.prf
+++ b/mkspecs/features/uikit/qt.prf
@@ -1,6 +1,6 @@
qt_depends = $$resolve_depends(QT, "QT.")
-equals(TEMPLATE, app):contains(qt_depends, gui(-private)?) {
+!watchos:equals(TEMPLATE, app):contains(qt_depends, gui(-private)?) {
LIBS *= -L$$[QT_INSTALL_PLUGINS/get]/platforms
lib_name = qios
diff --git a/mkspecs/features/uikit/qt_config.prf b/mkspecs/features/uikit/qt_config.prf
index 71e0982f7e..5fa5a536f8 100644
--- a/mkspecs/features/uikit/qt_config.prf
+++ b/mkspecs/features/uikit/qt_config.prf
@@ -10,6 +10,7 @@ isEmpty(QT_ARCH) {
} else { # Simulator
ios: QT_ARCH = i386
tvos: QT_ARCH = x64
+ watchos: QT_ARCH = i386
}
# Prevent the arch/config tests from building as multi-arch binaries,
diff --git a/mkspecs/features/uikit/sdk.prf b/mkspecs/features/uikit/sdk.prf
index 94451ea196..4ec3600450 100644
--- a/mkspecs/features/uikit/sdk.prf
+++ b/mkspecs/features/uikit/sdk.prf
@@ -1,7 +1,7 @@
# In case the user sets the SDK manually
contains(QMAKE_MAC_SDK, ^$${simulator.sdk}.*) {
- contains(QT_CONFIG, simulator_and_device): \
+ qtConfig(simulator_and_device): \
error("Simulator is handled automatically for simulator_and_device")
CONFIG += simulator $${simulator.sdk}
@@ -12,9 +12,6 @@ build_pass:simulator: \
load(sdk)
-lessThan(QMAKE_MAC_SDK_VERSION, "8.0"): \
- error("Current $$QMAKE_MAC_SDK SDK version ($$QMAKE_MAC_SDK_VERSION) is too old. Please upgrade Xcode.")
-
macx-xcode {
sdk_path_device.name = "QMAKE_MAC_SDK_PATH[sdk=$${device.sdk}*]"
sdk_path_device.value = $$xcodeSDKInfo(Path, $${device.sdk})
diff --git a/mkspecs/features/uikit/xcodebuild.mk b/mkspecs/features/uikit/xcodebuild.mk
index 5cbad60804..b8674947fe 100644
--- a/mkspecs/features/uikit/xcodebuild.mk
+++ b/mkspecs/features/uikit/xcodebuild.mk
@@ -83,7 +83,7 @@ DESTINATION_MESSAGE = "Running $(call tolower,$(CONFIGURATION)) $(ACTION) \
xcodebuild-%:
@$(if $(DESTINATION_NAME), echo $(DESTINATION_MESSAGE),)
- xcodebuild $(ACTION) -scheme $(TARGET) $(if $(SDK), -sdk $(SDK),) $(if $(CONFIGURATION), -configuration $(CONFIGURATION),) $(if $(DESTINATION), -destination $(DESTINATION) -destination-timeout 1,)
+ xcodebuild $(ACTION) -project $(TARGET).xcodeproj -scheme $(TARGET) $(if $(SDK), -sdk $(SDK),) $(if $(CONFIGURATION), -configuration $(CONFIGURATION),) $(if $(DESTINATION), -destination $(DESTINATION) -destination-timeout 1,) $(if $(INSTALL_ROOT), DSTROOT=$(INSTALL_ROOT),)
xcodebuild-check-device_%: DESTINATION_ID=$(lastword $(subst _, ,$@))
diff --git a/mkspecs/features/uikit/xcodebuild.prf b/mkspecs/features/uikit/xcodebuild.prf
index 6e50bbcf50..82bcd9a315 100644
--- a/mkspecs/features/uikit/xcodebuild.prf
+++ b/mkspecs/features/uikit/xcodebuild.prf
@@ -43,6 +43,10 @@ tvos {
DEVICE_FILTER = "Apple TV"
GENERIC_DEVICE_DESTINATION = "generic/platform=tvOS"
}
+watchos {
+ DEVICE_FILTER = "Apple Watch"
+ GENERIC_DEVICE_DESTINATION = "generic/platform=watchOS"
+}
QMAKE_EXTRA_VARIABLES += DEVICE_SDK SIMULATOR_SDK DEVICE_FILTER GENERIC_DEVICE_DESTINATION
QMAKE_EXTRA_INCLUDES += $$shell_quote($$PWD/xcodebuild.mk)
diff --git a/mkspecs/features/unix/opengl.prf b/mkspecs/features/unix/opengl.prf
index 123c647be2..72b5ac453d 100644
--- a/mkspecs/features/unix/opengl.prf
+++ b/mkspecs/features/unix/opengl.prf
@@ -1,4 +1,4 @@
-contains(QT_CONFIG, opengles2) {
+qtConfig(opengles2) {
INCLUDEPATH += $$QMAKE_INCDIR_OPENGL_ES2
!isEmpty(QMAKE_LIBDIR_OPENGL_ES2):QMAKE_LIBDIR += $$QMAKE_LIBDIR_OPENGL_ES2
target_qt:LIBS_PRIVATE += $$QMAKE_LIBS_OPENGL_ES2
diff --git a/mkspecs/features/unix/openvg.prf b/mkspecs/features/unix/openvg.prf
index 29acec18ff..500dfc50c6 100644
--- a/mkspecs/features/unix/openvg.prf
+++ b/mkspecs/features/unix/openvg.prf
@@ -2,13 +2,13 @@
!isEmpty(QMAKE_LIBDIR_OPENVG): QMAKE_LIBDIR += -L$$QMAKE_LIBDIR_OPENVG
!isEmpty(QMAKE_LIBS_OPENVG): LIBS += $$QMAKE_LIBS_OPENVG
-contains(QT_CONFIG, egl) {
+qtConfig(egl) {
!isEmpty(QMAKE_INCDIR_EGL): INCLUDEPATH += $$QMAKE_INCDIR_EGL
!isEmpty(QMAKE_LIBDIR_EGL): LIBS += -L$$QMAKE_LIBDIR_EGL
!isEmpty(QMAKE_LIBS_EGL): LIBS += $$QMAKE_LIBS_EGL
}
-contains(QT_CONFIG, openvg_on_opengl) {
+qtConfig(openvg_on_opengl) {
!isEmpty(QMAKE_INCDIR_OPENGL): INCLUDEPATH += $$QMAKE_INCDIR_OPENGL
!isEmpty(QMAKE_LIBDIR_OPENGL): QMAKE_LIBDIR += -L$$QMAKE_LIBDIR_OPENGL
!isEmpty(QMAKE_LIBS_OPENGL): LIBS += $$QMAKE_LIBS_OPENGL
diff --git a/mkspecs/features/win32/opengl.prf b/mkspecs/features/win32/opengl.prf
index c26ab62f50..ebc29d0923 100644
--- a/mkspecs/features/win32/opengl.prf
+++ b/mkspecs/features/win32/opengl.prf
@@ -1,9 +1,9 @@
-contains(QT_CONFIG, opengles2) {
+qtConfig(opengles2) {
# For Desktop, use the ANGLE library location passed on from configure.
INCLUDEPATH += $$QMAKE_INCDIR_OPENGL_ES2
CONFIG(debug, debug|release) {
QMAKE_LIBDIR += $$QMAKE_LIBDIR_OPENGL_ES2_DEBUG
- contains(QT_CONFIG, angle) {
+ qtConfig(angle) {
LIBS += $$QMAKE_LIBS_OPENGL_ES2_DEBUG
} else {
LIBS += $$QMAKE_LIBS_OPENGL_ES2
@@ -12,11 +12,9 @@ contains(QT_CONFIG, opengles2) {
LIBS += $$QMAKE_LIBS_OPENGL_ES2
QMAKE_LIBDIR += $$QMAKE_LIBDIR_OPENGL_ES2_RELEASE
}
- DEFINES += QT_OPENGL_ES_2 QT_OPENGL_ES_2_ANGLE
- contains(QT_CONFIG, static): DEFINES += QT_OPENGL_ES_2_ANGLE_STATIC GL_APICALL= EGLAPI=
- QT_CONFIG -= opengl
+ qtConfig(static): DEFINES += GL_APICALL= EGLAPI=
} else {
- !contains(QT_CONFIG, dynamicgl) {
+ !qtConfig(dynamicgl) {
QMAKE_LIBS += $$QMAKE_LIBS_OPENGL
QMAKE_LFLAGS += $$QMAKE_LFLAGS_OPENGL
}
diff --git a/mkspecs/features/win32/openvg.prf b/mkspecs/features/win32/openvg.prf
index 0df5b6621a..9d9a49d856 100644
--- a/mkspecs/features/win32/openvg.prf
+++ b/mkspecs/features/win32/openvg.prf
@@ -1,7 +1,7 @@
QMAKE_LIBS += $$QMAKE_LIBS_OPENVG
QMAKE_LFLAGS += $$QMAKE_LFLAGS_OPENVG
-contains(QT_CONFIG, openvg_on_opengl) {
+qtConfig(openvg_on_opengl) {
QMAKE_LIBS += $$QMAKE_LIBS_OPENGL
QMAKE_LFLAGS += $$QMAKE_LFLAGS_OPENGL
}
diff --git a/mkspecs/features/winrt/default_pre.prf b/mkspecs/features/winrt/default_pre.prf
index 8299950d8b..f397ef3d61 100644
--- a/mkspecs/features/winrt/default_pre.prf
+++ b/mkspecs/features/winrt/default_pre.prf
@@ -1,12 +1,14 @@
*msvc2015 {
- # Note that the order is important, ucrt(d) has to be first
- # Otherwise the linker might use malloc from a different library
- # but free_dbg() from the runtime, causing assert when deleting
- # items from different heaps
+ # Note that the order is important - ucrt(d) has to be first.
+ # Otherwise, the linker might use malloc from a different library,
+ # but free_dbg() from the runtime, causing an assertion failure
+ # due to deleting an item from a different heap.
+ # vcruntime(d) is necessary when we don't link to any libraries
+ # which would pull it in transitively.
CONFIG(debug, debug|release): \
- QMAKE_LIBS = ucrtd.lib $$QMAKE_LIBS
+ QMAKE_LIBS = ucrtd.lib vcruntimed.lib $$QMAKE_LIBS
else: \
- QMAKE_LIBS = ucrt.lib $$QMAKE_LIBS
+ QMAKE_LIBS = ucrt.lib vcruntime.lib $$QMAKE_LIBS
}
equals(TEMPLATE, "vcapp"): CONFIG += windeployqt
diff --git a/mkspecs/macx-watchos-clang/Info.plist.app b/mkspecs/macx-watchos-clang/Info.plist.app
new file mode 100644
index 0000000000..cceb9c5b5a
--- /dev/null
+++ b/mkspecs/macx-watchos-clang/Info.plist.app
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>en</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleGetInfoString</key>
+ <string>Created by Qt/QMake</string>
+ <key>CFBundleSignature</key>
+ <string>@TYPEINFO@</string>
+ <key>CFBundleExecutable</key>
+ <string>@EXECUTABLE@</string>
+ <key>CFBundleIdentifier</key>
+ <string>@BUNDLEIDENTIFIER@</string>
+ <key>CFBundleDisplayName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundleName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleVersion</key>
+ <string>1.0</string>
+ <key>UISupportedInterfaceOrientations</key>
+ <array>
+ <string>UIInterfaceOrientationPortrait</string>
+ <string>UIInterfaceOrientationPortraitUpsideDown</string>
+ </array>
+ <key>WKWatchKitApp</key>
+ <true/>
+ <key>NOTE</key>
+ <string>This file was generated by Qt/QMake.</string>
+</dict>
+</plist>
diff --git a/mkspecs/macx-watchos-clang/Info.plist.lib b/mkspecs/macx-watchos-clang/Info.plist.lib
new file mode 100644
index 0000000000..7cbdb9af12
--- /dev/null
+++ b/mkspecs/macx-watchos-clang/Info.plist.lib
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundlePackageType</key>
+ <string>FMWK</string>
+ <key>CFBundleShortVersionString</key>
+ <string>@SHORT_VERSION@</string>
+ <key>CFBundleVersion</key>
+ <string>@FULL_VERSION@</string>
+ <key>CFBundleGetInfoString</key>
+ <string>Created by Qt/QMake</string>
+ <key>CFBundleSignature</key>
+ <string>@TYPEINFO@</string>
+ <key>CFBundleExecutable</key>
+ <string>@LIBRARY@</string>
+ <key>CFBundleIdentifier</key>
+ <string>@BUNDLEIDENTIFIER@</string>
+ <key>NOTE</key>
+ <string>Please, do NOT change this file -- It was generated by Qt/QMake.</string>
+</dict>
+</plist>
diff --git a/mkspecs/macx-watchos-clang/qmake.conf b/mkspecs/macx-watchos-clang/qmake.conf
new file mode 100644
index 0000000000..bb9ab703b7
--- /dev/null
+++ b/mkspecs/macx-watchos-clang/qmake.conf
@@ -0,0 +1,21 @@
+#
+# qmake configuration for macx-watchos-clang
+#
+
+QMAKE_WATCHOS_DEPLOYMENT_TARGET = 2.2
+
+INCLUDEPATH += $$PWD/watchos
+
+QMAKE_WATCHOS_TARGETED_DEVICE_FAMILY = 4
+
+QMAKE_WATCHOS_DEVICE_ARCHS = armv7k
+QMAKE_WATCHOS_SIMULATOR_ARCHS = i386
+
+include(../common/watchos.conf)
+include(../common/gcc-base-mac.conf)
+include(../common/clang.conf)
+include(../common/clang-mac.conf)
+include(../common/ios/clang.conf)
+include(../common/ios/qmake.conf)
+
+load(qt_config)
diff --git a/mkspecs/macx-watchos-clang/qplatformdefs.h b/mkspecs/macx-watchos-clang/qplatformdefs.h
new file mode 100644
index 0000000000..965eb5e97b
--- /dev/null
+++ b/mkspecs/macx-watchos-clang/qplatformdefs.h
@@ -0,0 +1,34 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the qmake spec of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL21$
+** 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 http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://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 2.1 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "../common/mac/qplatformdefs.h"
diff --git a/mkspecs/qnx-aarch64le-qcc/qmake.conf b/mkspecs/qnx-aarch64le-qcc/qmake.conf
index 8e229d360b..6d72bd459e 100644
--- a/mkspecs/qnx-aarch64le-qcc/qmake.conf
+++ b/mkspecs/qnx-aarch64le-qcc/qmake.conf
@@ -8,7 +8,7 @@ QMAKE_LFLAGS_SHLIB += -Wl,-z,relro -Wl,-z,now
include(../common/qcc-base-qnx-aarch64le.conf)
-contains(QT_CONFIG, stack-protector-strong) {
+qtConfig(stack-protector-strong) {
QMAKE_CFLAGS += -fstack-protector-strong
QMAKE_CXXFLAGS += -fstack-protector-strong
} else {
diff --git a/mkspecs/qnx-x86-64-qcc/qmake.conf b/mkspecs/qnx-x86-64-qcc/qmake.conf
index f1760e4072..ebedeceb46 100644
--- a/mkspecs/qnx-x86-64-qcc/qmake.conf
+++ b/mkspecs/qnx-x86-64-qcc/qmake.conf
@@ -8,7 +8,7 @@ QMAKE_LFLAGS_SHLIB += -Wl,-z,relro -Wl,-z,now
include(../common/qcc-base-qnx-x86-64.conf)
-contains(QT_CONFIG, stack-protector-strong) {
+qtConfig(stack-protector-strong) {
QMAKE_CFLAGS += -fstack-protector-strong
QMAKE_CXXFLAGS += -fstack-protector-strong
} else {
diff --git a/qmake/doc/src/qmake-manual.qdoc b/qmake/doc/src/qmake-manual.qdoc
index 4d958b1a20..509dc3efa1 100644
--- a/qmake/doc/src/qmake-manual.qdoc
+++ b/qmake/doc/src/qmake-manual.qdoc
@@ -28,7 +28,7 @@
/*!
\page qmake-manual.html
\title qmake Manual
- \startpage {Qt Reference Documentation}
+ \startpage index.html
\nextpage Overview
\ingroup qttools
@@ -657,7 +657,7 @@
qmake knows about many of these features, which can be accessed via specific
variables that only take effect on the platforms where they are relevant.
- \section1 OS X, iOS and tvOS
+ \section1 \macos, iOS, tvOS, and watchOS
Features specific to these platforms include support for creating universal
binaries, frameworks and bundles.
@@ -681,7 +681,7 @@
qmake is able to automatically generate build
rules for linking against frameworks in the standard framework directory on
- OS X, located at \c{/Library/Frameworks/}.
+ \macos, located at \c{/Library/Frameworks/}.
Directories other than the standard framework directory need to be specified
to the build system, and this is achieved by appending linker options to the
@@ -722,13 +722,13 @@
and \l{QMAKE_FRAMEWORK_VERSION} variables. By default, the values used for
these variables are obtained from the \l{TARGET} and \l{VERSION} variables.
- See \l{Qt for OS X - Deployment} for more information about
+ See \l{Qt for macOS - Deployment} for more information about
deploying applications and libraries.
\section2 Creating and Moving Xcode Projects
- Developers on OS X can take advantage of the qmake support for Xcode
- project files, as described in \l{Qt for OS X#Additional Command-Line Options}{Qt for OS X} documentation.
+ Developers on \macos can take advantage of the qmake support for Xcode
+ project files, as described in \l{Qt for macOS#Additional Command-Line Options}{Qt for \macos} documentation.
by running qmake to generate an Xcode project from an existing qmake project
file. For example:
@@ -1069,7 +1069,7 @@
See \l{Platform Notes#Visual Studio Manifest Files}{Platform Notes}
for more information about the options for embedding manifest files.
- The following options take an effect only on OS X:
+ The following options take an effect only on \macos:
\table
\header \li Option \li Description
@@ -1439,7 +1439,7 @@
\target QMAKE_BUNDLE_DATA
\section1 QMAKE_BUNDLE_DATA
- \note This variable is used on OS X, iOS and tvOS only.
+ \note This variable is used on \macos, iOS, tvOS, and watchOS only.
Specifies the data that will be installed with a library
bundle, and is often used to specify a collection of header files.
@@ -1461,7 +1461,7 @@
\section1 QMAKE_BUNDLE_EXTENSION
- \note This variable is used on OS X, iOS and tvOS only.
+ \note This variable is used on \macos, iOS, tvOS, and watchOS only.
Specifies the extension to be used for library bundles.
This allows frameworks to be created with custom extensions instead of the
@@ -1695,7 +1695,7 @@
\section1 QMAKE_FRAMEWORK_BUNDLE_NAME
- \note This variable is used on OS X, iOS and tvOS only.
+ \note This variable is used on \macos, iOS, tvOS, and watchOS only.
In a framework project, this variable contains the name to be used for the
framework that is built.
@@ -1709,9 +1709,9 @@
\target QMAKE_FRAMEWORK_VERSION
\section1 QMAKE_FRAMEWORK_VERSION
- \note This variable is used on OS X, iOS and tvOS only.
+ \note This variable is used on \macos, iOS, tvOS, and watchOS only.
- For projects where the build target is an OS X, iOS or tvOS framework, this
+ For projects where the build target is an \macos, iOS, tvOS, or watchOS framework, this
variable is used to specify the version number that will be applied to the
framework that is built.
@@ -1804,10 +1804,10 @@
\target QMAKE_INFO_PLIST
\section1 QMAKE_INFO_PLIST
- \note This variable is used on OS X, iOS and tvOS platforms only.
+ \note This variable is used on \macos, iOS, tvOS, and watchOS platforms only.
Specifies the name of the property list file, \c{.plist}, you
- would like to include in your OS X, iOS and tvOS application bundle.
+ would like to include in your \macos, iOS, tvOS, and watchOS application bundle.
In the \c{.plist} file, you can define some variables, e.g., @EXECUTABLE@,
which qmake will replace with the actual executable name. Other variables
@@ -2077,16 +2077,16 @@
\section1 QMAKE_MAC_SDK
- This variable is used on OS X when building universal binaries.
+ This variable is used on \macos when building universal binaries.
\section1 QMAKE_MACOSX_DEPLOYMENT_TARGET
- This variable only takes effect when building on OS X. On that
+ This variable only takes effect when building on \macos. On that
platform, the variable will be forwarded to the MACOSX_DEPLOYMENT_TARGET
environment variable, which is interpreted by the compiler or linker.
For more information, see the
- \l{Qt for OS X - Deployment#OS X Version Dependencies}{Deploying
- an Application on OS X} document.
+ \l{Qt for macOS - Deployment#macOS Version Dependencies}{Deploying
+ an Application on \macos} document.
\section1 QMAKE_MAKEFILE
@@ -2164,8 +2164,8 @@
If defined, the value of this variable is used as a path to be prepended to
the built shared library's \c SONAME identifier. The \c SONAME is the
identifier that the dynamic linker will later use to reference the library.
- In general this reference may be a library name or full library path. On OS
- X, iOS and tvOS, the path may be specified relatively using the following
+ In general this reference may be a library name or full library path. On \macos,
+ iOS, tvOS, and watchOS, the path may be specified relatively using the following
placeholders:
\table
@@ -3138,7 +3138,7 @@
See also \l{fn_size}{size()}.
- \section2 system(command[, mode])
+ \section2 system(command[, mode[, stsvar]])
You can use this variant of the \c system function to obtain stdout from the
command and assign it to a variable.
@@ -3147,6 +3147,11 @@
\snippet code/doc_src_qmake-manual.pro 72
+ If you pass \c stsvar, the command's exit status will be stored in that
+ variable. If the command crashes, the status will be -1, otherwise a
+ non-negative exit code of the command's choosing. Usually, comparing
+ the status with zero (success) is sufficient.
+
See also the test variant of \l{system(command)}{system()}.
\section2 system_path(path)
@@ -4423,7 +4428,7 @@
\li nmake
\li Visual Studio projects (VS 2008 and later)
\endlist
- \li OS X, iOS and tvOS
+ \li \macos, iOS, tvOS, and watchOS
\list
\li Makefile
\li Xcode
@@ -4794,7 +4799,7 @@
them uses project-specific variables to customize output files.
Platform-specific variables are not described here. For more information,
- see \l{Qt for Windows - Deployment} and \l{Qt for OS X}.
+ see \l{Qt for Windows - Deployment} and \l{Qt for macOS}.
\target Application
\section1 Building an Application
@@ -4942,7 +4947,7 @@
\endlist
The target file name for the library is platform-dependent. For example, on
- X11, OS X, and iOS, the library name will be prefixed by \c lib. On Windows,
+ X11, \macos, and iOS, the library name will be prefixed by \c lib. On Windows,
no prefix is added to the file name.
\target Plugin
diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp
index 47c7826154..bf2e774678 100644
--- a/qmake/generators/mac/pbuilder_pbx.cpp
+++ b/qmake/generators/mac/pbuilder_pbx.cpp
@@ -1537,6 +1537,8 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
t << "\t\t\t\t" << writeSettings("IPHONEOS_DEPLOYMENT_TARGET", project->first("QMAKE_IOS_DEPLOYMENT_TARGET")) << ";\n";
if (!project->isEmpty("QMAKE_TVOS_DEPLOYMENT_TARGET"))
t << "\t\t\t\t" << writeSettings("APPLETVOS_DEPLOYMENT_TARGET", project->first("QMAKE_TVOS_DEPLOYMENT_TARGET")) << ";\n";
+ if (!project->isEmpty("QMAKE_WATCHOS_DEPLOYMENT_TARGET"))
+ t << "\t\t\t\t" << writeSettings("WATCHOS_DEPLOYMENT_TARGET", project->first("QMAKE_WATCHOS_DEPLOYMENT_TARGET")) << ";\n";
if (!project->isEmpty("QMAKE_XCODE_CODE_SIGN_IDENTITY"))
t << "\t\t\t\t" << writeSettings("CODE_SIGN_IDENTITY", project->first("QMAKE_XCODE_CODE_SIGN_IDENTITY")) << ";\n";
diff --git a/qmake/generators/win32/msvc_nmake.cpp b/qmake/generators/win32/msvc_nmake.cpp
index 58d6ecf110..029092fdaa 100644
--- a/qmake/generators/win32/msvc_nmake.cpp
+++ b/qmake/generators/win32/msvc_nmake.cpp
@@ -391,6 +391,12 @@ void NmakeMakefileGenerator::init()
if (!defines.contains("NDEBUG"))
defines.append("NDEBUG");
}
+
+ if (project->values("QMAKE_APP_FLAG").isEmpty() && project->isActiveConfig("dll")) {
+ ProStringList &defines = project->values("DEFINES");
+ if (!defines.contains("_WINDLL"))
+ defines.append("_WINDLL");
+ }
}
QStringList NmakeMakefileGenerator::sourceFilesForImplicitRulesFilter()
diff --git a/qmake/library/qmakebuiltins.cpp b/qmake/library/qmakebuiltins.cpp
index 616b05e82d..ba621c1c72 100644
--- a/qmake/library/qmakebuiltins.cpp
+++ b/qmake/library/qmakebuiltins.cpp
@@ -450,12 +450,13 @@ void QMakeEvaluator::runProcess(QProcess *proc, const QString &command) const
}
#endif
-QByteArray QMakeEvaluator::getCommandOutput(const QString &args) const
+QByteArray QMakeEvaluator::getCommandOutput(const QString &args, int *exitCode) const
{
QByteArray out;
#ifndef QT_BOOTSTRAPPED
QProcess proc;
runProcess(&proc, args);
+ *exitCode = (proc.exitStatus() == QProcess::NormalExit) ? proc.exitCode() : -1;
QByteArray errout = proc.readAllStandardError();
# ifdef PROEVALUATOR_FULL
// FIXME: Qt really should have the option to set forwarding per channel
@@ -483,7 +484,12 @@ QByteArray QMakeEvaluator::getCommandOutput(const QString &args) const
break;
out += QByteArray(buff, read_in);
}
- QT_PCLOSE(proc);
+ int ec = QT_PCLOSE(proc);
+# ifdef Q_OS_WIN
+ *exitCode = ec >= 0 ? ec : -1;
+# else
+ *exitCode = WIFEXITED(ec) ? WEXITSTATUS(ec) : -1;
+# endif
}
# ifdef Q_OS_WIN
out.replace("\r\n", "\n");
@@ -871,8 +877,8 @@ ProStringList QMakeEvaluator::evaluateBuiltinExpand(
break;
case E_SYSTEM:
if (!m_skipLevel) {
- if (args.count() < 1 || args.count() > 2) {
- evalError(fL1S("system(execute) requires one or two arguments."));
+ if (args.count() < 1 || args.count() > 3) {
+ evalError(fL1S("system(command, [mode], [stsvar]) requires one to three arguments."));
} else {
bool blob = false;
bool lines = false;
@@ -885,7 +891,12 @@ ProStringList QMakeEvaluator::evaluateBuiltinExpand(
else if (!args.at(1).compare(QLatin1String("lines"), Qt::CaseInsensitive))
lines = true;
}
- QByteArray bytes = getCommandOutput(args.at(0).toQString(m_tmp2));
+ int exitCode;
+ QByteArray bytes = getCommandOutput(args.at(0).toQString(m_tmp2), &exitCode);
+ if (args.count() > 2 && !args.at(2).isEmpty()) {
+ m_valuemapStack.top()[args.at(2).toKey()] =
+ ProStringList(ProString(QString::number(exitCode)));
+ }
if (lines) {
QTextStream stream(bytes);
while (!stream.atEnd())
@@ -1587,7 +1598,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
#ifdef PROEVALUATOR_FULL
fputs(msg.toLatin1().constData(), stderr);
#endif
- } else {
+ } else if (!msg.isEmpty() || func_t != T_ERROR) {
m_handler->fileMessage(
(func_t == T_ERROR ? QMakeHandler::ErrorMessage :
func_t == T_WARNING ? QMakeHandler::WarningMessage :
diff --git a/qmake/library/qmakeevaluator.h b/qmake/library/qmakeevaluator.h
index eddabe39a0..3f2a22c567 100644
--- a/qmake/library/qmakeevaluator.h
+++ b/qmake/library/qmakeevaluator.h
@@ -240,7 +240,7 @@ public:
#ifndef QT_BOOTSTRAPPED
void runProcess(QProcess *proc, const QString &command) const;
#endif
- QByteArray getCommandOutput(const QString &args) const;
+ QByteArray getCommandOutput(const QString &args, int *exitCode) const;
QMakeEvaluator *m_caller;
#ifdef PROEVALUATOR_CUMULATIVE
diff --git a/qtbase.pro b/qtbase.pro
index 34f6704752..0e44395f6f 100644
--- a/qtbase.pro
+++ b/qtbase.pro
@@ -24,6 +24,7 @@ DISTCLEAN_DEPS += qmake-clean
# config.status (and configure.cache, which is the same for Windows)
# are omitted for convenience of rebuilds.
QMAKE_DISTCLEAN += \
+ config.cache \
config.summary \
config.tests/.qmake.cache \
mkspecs/qconfig.pri \
@@ -31,6 +32,7 @@ QMAKE_DISTCLEAN += \
mkspecs/qhost.pri \
mkspecs/qmodule.pri \
src/corelib/global/qconfig.h \
+ src/corelib/global/qconfig_p.h \
src/corelib/global/qconfig.cpp \
bin/qt.conf
@@ -114,11 +116,11 @@ for (ft, features) {
" QT_DISABLED_FEATURES += $$lower($$replace(ft, _, -))"
}
}
-write_file($$OUT_PWD/src/corelib/global/qfeatures.h, FEATURES_H)|error("Aborting.")
+write_file($$OUT_PWD/src/corelib/global/qfeatures.h, FEATURES_H)|error()
# Create forwarding header
FWD_FEATURES_H = \
'$${LITERAL_HASH}include "../../src/corelib/global/qfeatures.h"'
-write_file($$OUT_PWD/include/QtCore/qfeatures.h, FWD_FEATURES_H)|error("Aborting.")
+write_file($$OUT_PWD/include/QtCore/qfeatures.h, FWD_FEATURES_H)|error()
no_features =
lines = $$cat($$OUT_PWD/src/corelib/global/qconfig.h, lines)
@@ -146,23 +148,13 @@ FEATURES_PRI = \
"$$escape_expand(\\n)$${LITERAL_HASH} Dependencies derived from <qtbase>/src/corelib/global/qfeatures.txt:" \
$$FEATURES_PRI \
"QT_DISABLED_FEATURES = \$\$unique(QT_DISABLED_FEATURES)"
-write_file($$OUT_PWD/mkspecs/qfeatures.pri, FEATURES_PRI)|error("Aborting.")
-
-# Create forwarding headers for qconfig.h
-FWD_QCONFIG_H = \
- '$${LITERAL_HASH}include "../../src/corelib/global/qconfig.h"'
-write_file($$OUT_PWD/include/QtCore/qconfig.h, FWD_QCONFIG_H)|error("Aborting.")
-FWD_QTCONFIG = \
- '$${LITERAL_HASH}include "qconfig.h"'
-write_file($$OUT_PWD/include/QtCore/QtConfig, FWD_QTCONFIG)|error("Aborting.")
+write_file($$OUT_PWD/mkspecs/qfeatures.pri, FEATURES_PRI)|error()
# Files created by us
QMAKE_DISTCLEAN += \
src/corelib/global/qfeatures.h \
include/QtCore/qfeatures.h \
- mkspecs/qfeatures.pri \
- include/QtCore/qconfig.h \
- include/QtCore/QtConfig
+ mkspecs/qfeatures.pri
#mkspecs
mkspecs.path = $$[QT_HOST_DATA]/mkspecs
diff --git a/src/3rdparty/android/LICENSE b/src/3rdparty/android/LICENSE
new file mode 100644
index 0000000000..c026b6b79a
--- /dev/null
+++ b/src/3rdparty/android/LICENSE
@@ -0,0 +1,11 @@
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
diff --git a/src/3rdparty/android/qt_attribution.json b/src/3rdparty/android/qt_attribution.json
new file mode 100644
index 0000000000..c1f89fd8bd
--- /dev/null
+++ b/src/3rdparty/android/qt_attribution.json
@@ -0,0 +1,11 @@
+{
+ "Id": "android-native-style",
+ "Name": "Native Style for Android",
+ "QDocModule": "qtgui",
+ "QtUsage": "Used in Android platform plugin.",
+
+ "License": "Apache License 2.0",
+ "LicenseId": "Apache-2.0",
+ "LicenseFile": "LICENSE",
+ "Copyright": "Copyright (C) 2005 The Android Open Source Project"
+}
diff --git a/src/3rdparty/angle/SYSTEMINFO_LICENSE b/src/3rdparty/angle/SYSTEMINFO_LICENSE
new file mode 100644
index 0000000000..c12444e3bc
--- /dev/null
+++ b/src/3rdparty/angle/SYSTEMINFO_LICENSE
@@ -0,0 +1,22 @@
+Copyright (C) 2009 Apple Inc. All Rights Reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/src/3rdparty/angle/TRACEEVENT_LICENSE b/src/3rdparty/angle/TRACEEVENT_LICENSE
new file mode 100644
index 0000000000..34d6cd9268
--- /dev/null
+++ b/src/3rdparty/angle/TRACEEVENT_LICENSE
@@ -0,0 +1,27 @@
+Copyright 2013 The Chromium Authors. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+ * Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+copyright notice, this list of conditions and the following disclaimer
+in the documentation and/or other materials provided with the
+distribution.
+ * Neither the name of Google Inc. nor the names of its
+contributors may be used to endorse or promote products derived from
+this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/src/3rdparty/angle/qt_attribution.json b/src/3rdparty/angle/qt_attribution.json
new file mode 100644
index 0000000000..230f30940b
--- /dev/null
+++ b/src/3rdparty/angle/qt_attribution.json
@@ -0,0 +1,61 @@
+[
+ {
+ "Id": "angle",
+ "Name": "ANGLE Library",
+ "QDocModule": "qtgui",
+ "QtUsage": "Used on Windows to implement OpenGL ES on top of DirectX. Configure with -no-opengl, or -opengl desktop to exclude.",
+
+ "License": "BSD 3-clause \"New\" or \"Revised\" License",
+ "LicenseId": "BSD-3-Clause",
+ "LicenseFile": "LICENSE",
+ "Copyright": "Copyright (C) 2002-2013 The ANGLE Project Authors"
+ },
+ {
+ "Id": "angle-arrayboundsclamper",
+ "Name": "ANGLE Array Bounds Clamper for WebKit",
+ "QDocModule": "qtgui",
+ "QtUsage": "Used on Windows to implement OpenGL ES on top of DirectX. Configure with -no-opengl, or -opengl desktop to exclude.",
+
+ "Path": "src/third_party/compiler",
+ "Description": "Implements clamping of array indexing expressions during shader translation.",
+ "License": "BSD 2-clause \"Simplified\" License",
+ "LicenseId": "BSD-2-Clause",
+ "LicenseFile": "src/third_party/compiler/LICENSE",
+ "Copyright": "Copyright (C) 2012 Apple Inc."
+ },
+ {
+ "Id": "angle-murmurhash",
+ "Name": "Murmurhash (as part of ANGLE)",
+ "QDocModule": "qtgui",
+ "QtUsage": "Used on Windows to implement OpenGL ES on top of DirectX. Configure with -no-opengl, or -opengl desktop to exclude.",
+
+ "Path": "src/third_party/murmurhash",
+ "License": "Public Domain",
+ "LicenseId": "NONE",
+ "Copyright": "MurmurHash3 was written by Austin Appleby, and is placed in the public domain. The author hereby disclaims copyright to this source code."
+ },
+ {
+ "Id": "angle-systeminfo",
+ "Name": "Systeminfo (as part of ANGLE)",
+ "QDocModule": "qtgui",
+ "QtUsage": "Used on Windows to implement OpenGL ES on top of DirectX. Configure with -no-opengl, or -opengl desktop to exclude.",
+
+ "Path": "src/third_party/systeminfo",
+ "License": "BSD 2-clause \"Simplified\" License",
+ "LicenseId": "BSD-2-Clause",
+ "LicenseFile": "SYSTEMINFO_LICENSE",
+ "Copyright": "Copyright (C) 2009 Apple Inc. All Rights Reserved."
+ },
+ {
+ "Id": "angle-trace_event",
+ "Name": "trace_event (as part of ANGLE)",
+ "QDocModule": "qtgui",
+ "QtUsage": "Used on Windows to implement OpenGL ES on top of DirectX. Configure with -no-opengl, or -opengl desktop to exclude.",
+
+ "Path": "src/third_party/trace_event",
+ "License": "BSD 3-clause \"New\" or \"Revised\" License",
+ "LicenseId": "BSD-3-Clause",
+ "LicenseFile": "TRACEEVENT_LICENSE",
+ "Copyright": "Copyright (c) 2013 The Chromium Authors."
+ }
+]
diff --git a/src/3rdparty/atspi2/LICENSE b/src/3rdparty/atspi2/LICENSE
new file mode 100644
index 0000000000..dc5f1b170d
--- /dev/null
+++ b/src/3rdparty/atspi2/LICENSE
@@ -0,0 +1,482 @@
+ GNU LIBRARY GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1991 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the library GPL. It is
+ numbered 2 because it goes with version 2 of the ordinary GPL.]
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+ This license, the Library General Public License, applies to some
+specially designated Free Software Foundation software, and to any
+other libraries whose authors decide to use it. You can use it for
+your libraries, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if
+you distribute copies of the library, or if you modify it.
+
+ For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you. You must make sure that they, too, receive or can get the source
+code. If you link a program with the library, you must provide
+complete object files to the recipients so that they can relink them
+with the library, after making changes to the library and recompiling
+it. And you must show them these terms so they know their rights.
+
+ Our method of protecting your rights has two steps: (1) copyright
+the library, and (2) offer you this license which gives you legal
+permission to copy, distribute and/or modify the library.
+
+ Also, for each distributor's protection, we want to make certain
+that everyone understands that there is no warranty for this free
+library. If the library is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original
+version, so that any problems introduced by others will not reflect on
+the original authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that companies distributing free
+software will individually obtain patent licenses, thus in effect
+transforming the program into proprietary software. To prevent this,
+we have made it clear that any patent must be licensed for everyone's
+free use or not licensed at all.
+
+ Most GNU software, including some libraries, is covered by the ordinary
+GNU General Public License, which was designed for utility programs. This
+license, the GNU Library General Public License, applies to certain
+designated libraries. This license is quite different from the ordinary
+one; be sure to read it in full, and don't assume that anything in it is
+the same as in the ordinary license.
+
+ The reason we have a separate public license for some libraries is that
+they blur the distinction we usually make between modifying or adding to a
+program and simply using it. Linking a program with a library, without
+changing the library, is in some sense simply using the library, and is
+analogous to running a utility program or application program. However, in
+a textual and legal sense, the linked executable is a combined work, a
+derivative of the original library, and the ordinary General Public License
+treats it as such.
+
+ Because of this blurred distinction, using the ordinary General
+Public License for libraries did not effectively promote software
+sharing, because most developers did not use the libraries. We
+concluded that weaker conditions might promote sharing better.
+
+ However, unrestricted linking of non-free programs would deprive the
+users of those programs of all benefit from the free status of the
+libraries themselves. This Library General Public License is intended to
+permit developers of non-free programs to use free libraries, while
+preserving your freedom as a user of such programs to change the free
+libraries that are incorporated in them. (We have not seen how to achieve
+this as regards changes in header files, but we have achieved it as regards
+changes in the actual functions of the Library.) The hope is that this
+will lead to faster development of free libraries.
+
+ The precise terms and conditions for copying, distribution and
+modification follow. Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library". The
+former contains code derived from the library, while the latter only
+works together with the library.
+
+ Note that it is possible for a library to be covered by the ordinary
+General Public License rather than by this special one.
+
+ GNU LIBRARY GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License Agreement applies to any software library which
+contains a notice placed by the copyright holder or other authorized
+party saying it may be distributed under the terms of this Library
+General Public License (also called "this License"). Each licensee is
+addressed as "you".
+
+ A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+ The "Library", below, refers to any such software library or work
+which has been distributed under these terms. A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language. (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+ "Source code" for a work means the preferred form of the work for
+making modifications to it. For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+ Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it). Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+ 1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+ You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+ 2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) The modified work must itself be a software library.
+
+ b) You must cause the files modified to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ c) You must cause the whole of the work to be licensed at no
+ charge to all third parties under the terms of this License.
+
+ d) If a facility in the modified Library refers to a function or a
+ table of data to be supplied by an application program that uses
+ the facility, other than as an argument passed when the facility
+ is invoked, then you must make a good faith effort to ensure that,
+ in the event an application does not supply such function or
+ table, the facility still operates, and performs whatever part of
+ its purpose remains meaningful.
+
+ (For example, a function in a library to compute square roots has
+ a purpose that is entirely well-defined independent of the
+ application. Therefore, Subsection 2d requires that any
+ application-supplied function or table used by this function must
+ be optional: if the application does not supply it, the square
+ root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library. To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License. (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.) Do not make any other change in
+these notices.
+
+ Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+ This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+ 4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+ If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library". Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+ However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library". The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+ When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library. The
+threshold for this to be true is not precisely defined by law.
+
+ If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work. (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+ Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+ 6. As an exception to the Sections above, you may also compile or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+ You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License. You must supply a copy of this License. If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License. Also, you must do one
+of these things:
+
+ a) Accompany the work with the complete corresponding
+ machine-readable source code for the Library including whatever
+ changes were used in the work (which must be distributed under
+ Sections 1 and 2 above); and, if the work is an executable linked
+ with the Library, with the complete machine-readable "work that
+ uses the Library", as object code and/or source code, so that the
+ user can modify the Library and then relink to produce a modified
+ executable containing the modified Library. (It is understood
+ that the user who changes the contents of definitions files in the
+ Library will not necessarily be able to recompile the application
+ to use the modified definitions.)
+
+ b) Accompany the work with a written offer, valid for at
+ least three years, to give the same user the materials
+ specified in Subsection 6a, above, for a charge no more
+ than the cost of performing this distribution.
+
+ c) If distribution of the work is made by offering access to copy
+ from a designated place, offer equivalent access to copy the above
+ specified materials from the same place.
+
+ d) Verify that the user has already received a copy of these
+ materials or that you have already sent this user a copy.
+
+ For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it. However, as a special exception,
+the source code distributed need not include anything that is normally
+distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+ It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system. Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+ 7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+ a) Accompany the combined library with a copy of the same work
+ based on the Library, uncombined with any other library
+ facilities. This must be distributed under the terms of the
+ Sections above.
+
+ b) Give prominent notice with the combined library of the fact
+ that part of it is a work based on the Library, and explaining
+ where to find the accompanying uncombined form of the same work.
+
+ 8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License. Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License. However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+ 9. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Library or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+ 10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all. For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded. In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+ 13. The Free Software Foundation may publish revised and/or new
+versions of the Library General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation. If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+ 14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission. For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this. Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+ NO WARRANTY
+
+ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Libraries
+
+ If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change. You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+ To apply these terms, attach the following notices to the library. It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the library's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the
+ library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+ <signature of Ty Coon>, 1 April 1990
+ Ty Coon, President of Vice
+
+That's all there is to it!
+
diff --git a/src/3rdparty/atspi2/qt_attribution.json b/src/3rdparty/atspi2/qt_attribution.json
new file mode 100644
index 0000000000..ed2ef85158
--- /dev/null
+++ b/src/3rdparty/atspi2/qt_attribution.json
@@ -0,0 +1,11 @@
+{
+ "Id": "atspi2",
+ "Name": "at-spi2 (Assistive Technology Service Provider Interface)",
+ "QDocModule": "qtgui",
+ "QtUsage": "Optionally ysed on Linux for accessibility. Configure without dbus (QT_CONFIG-=accessibility-atspi-bridge) to avoid.",
+
+ "License": "GNU Library General Public License v2 or later",
+ "LicenseId": "LGPL-2.0+",
+ "LicenseFile": "LICENSE",
+ "Copyright": "Copyright 2010, 2011 Novell, Inc., Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany."
+}
diff --git a/src/3rdparty/double-conversion/qt_attribution.json b/src/3rdparty/double-conversion/qt_attribution.json
new file mode 100644
index 0000000000..92118ac779
--- /dev/null
+++ b/src/3rdparty/double-conversion/qt_attribution.json
@@ -0,0 +1,14 @@
+{
+ "Id": "doubleconversion",
+ "Name": "Efficient Binary-Decimal and Decimal-Binary Conversion Routines for IEEE Doubles",
+ "QDocModule": "qtcore",
+ "QtUsage": "Used in Qt Core. Configure with -system-doubleconversion or -no-doubleconversion to avoid.",
+
+ "Homepage": "https://github.com/google/double-conversion",
+ "Version": "2.0.1",
+ "DownloadLocation": "https://github.com/google/double-conversion/commit/2fb03de56faa32bbba5e02222528e7b760f71d77",
+ "License": "BSD 3-clause \"New\" or \"Revised\" License",
+ "LicenseId": "BSD-3-Clause",
+ "LicenseFile": "LICENSE",
+ "Copyright": "Copyright 2006-2012, the V8 project authors"
+}
diff --git a/src/3rdparty/easing/LICENSE b/src/3rdparty/easing/LICENSE
new file mode 100644
index 0000000000..5dc85c4712
--- /dev/null
+++ b/src/3rdparty/easing/LICENSE
@@ -0,0 +1,25 @@
+Copyright (c) 2001 Robert Penner
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+ * Neither the name of the author nor the names of contributors may be used
+ to endorse or promote products derived from this software without specific
+ prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/src/3rdparty/easing/qt_attribution.json b/src/3rdparty/easing/qt_attribution.json
new file mode 100644
index 0000000000..b6240c61c8
--- /dev/null
+++ b/src/3rdparty/easing/qt_attribution.json
@@ -0,0 +1,11 @@
+{
+ "Id": "easing",
+ "Name": "Easing Equations by Robert Penner",
+ "QDocModule": "qtcore",
+ "QtUsage": "Used in Qt Core (QEasingCurve).",
+
+ "License": "BSD 3-clause \"New\" or \"Revised\" License",
+ "LicenseId": "BSD-3-Clause",
+ "LicenseFile": "LICENSE",
+ "Copyright": "Copyright (c) 2001 Robert Penner"
+}
diff --git a/src/3rdparty/forkfd/LICENSE b/src/3rdparty/forkfd/LICENSE
new file mode 100644
index 0000000000..351ebf705d
--- /dev/null
+++ b/src/3rdparty/forkfd/LICENSE
@@ -0,0 +1,19 @@
+Copyright (C) 2016 Intel Corporation.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/src/3rdparty/forkfd/qt_attribution.json b/src/3rdparty/forkfd/qt_attribution.json
new file mode 100644
index 0000000000..89f25f4870
--- /dev/null
+++ b/src/3rdparty/forkfd/qt_attribution.json
@@ -0,0 +1,12 @@
+{
+ "Id": "forkfd",
+ "Name": "forkfd",
+ "QDocModule": "qtcore",
+ "QtUsage": "Used on most Unix platforms in Qt Core.",
+
+ "License": "MIT License",
+ "LicenseId": "MIT",
+ "LicenseFile": "LICENSE",
+ "Copyright": "Copyright (C) 2013-2016 Intel Corporation
+Copyright (C) 2015 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com"
+}
diff --git a/src/3rdparty/freebsd/LICENSE b/src/3rdparty/freebsd/LICENSE
new file mode 100644
index 0000000000..5bb30318eb
--- /dev/null
+++ b/src/3rdparty/freebsd/LICENSE
@@ -0,0 +1,31 @@
+Copyright (c) 1992, 1993
+ The Regents of the University of California. All rights reserved.
+
+Copyright (c) 2011 The FreeBSD Foundation
+All rights reserved.
+Portions of this software were developed by David Chisnall
+under sponsorship from the FreeBSD Foundation.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+3. Neither the name of the University nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
diff --git a/src/3rdparty/freebsd/qt_attribution.json b/src/3rdparty/freebsd/qt_attribution.json
new file mode 100644
index 0000000000..40c337cc67
--- /dev/null
+++ b/src/3rdparty/freebsd/qt_attribution.json
@@ -0,0 +1,17 @@
+{
+ "Id": "freebsd",
+ "Name": "FreeBSD strtoll and strtoull",
+ "QDocModule": "qtcore",
+ "QtUsage": "Used in Qt Core.",
+
+ "License": "BSD 3-clause \"New\" or \"Revised\" License",
+ "LicenseId": "BSD-3-Clause",
+ "LicenseFile": "LICENSE",
+ "Copyright": "Copyright (c) 1992, 1993
+ The Regents of the University of California. All rights reserved.
+
+Copyright (c) 2011 The FreeBSD Foundation
+All rights reserved.
+Portions of this software were developed by David Chisnall
+under sponsorship from the FreeBSD Foundation."
+}
diff --git a/src/3rdparty/freetype/qt_attribution.json b/src/3rdparty/freetype/qt_attribution.json
new file mode 100644
index 0000000000..6c11f1b617
--- /dev/null
+++ b/src/3rdparty/freetype/qt_attribution.json
@@ -0,0 +1,13 @@
+{
+ "Id": "freetype",
+ "Name": "Freetype 2",
+ "QDocModule": "qtgui",
+ "QtUsage": "Optionally used in Qt GUI and platform plugins. Configure with -no-freetype, or -system-freetype to avoid.",
+
+ "Description": "FreeType is a freely available software library to render fonts.",
+ "Homepage": "http://www.freetype.org",
+ "License": "Freetype Project License or GNU General Public License v2.0 only",
+ "LicenseId": "FTL or GPL-2.0",
+ "LicenseFile": "docs/LICENSE.TXT",
+ "Copyright": "Copyright 2006-2015 by David Turner, Robert Wilhelm, and Werner Lemberg."
+}
diff --git a/src/3rdparty/freetype_dependency.pri b/src/3rdparty/freetype_dependency.pri
index 7513e40bfd..012e4af6c3 100644
--- a/src/3rdparty/freetype_dependency.pri
+++ b/src/3rdparty/freetype_dependency.pri
@@ -1,7 +1,7 @@
-contains(QT_CONFIG, system-freetype) {
+qtConfig(system-freetype) {
# pull in the proper freetype2 include directory
include($$QT_SOURCE_TREE/config.tests/unix/freetype/freetype.pri)
-} else: contains(QT_CONFIG, freetype) {
+} else: qtConfig(freetype) {
INCLUDEPATH += $$PWD/freetype/include
LIBS_PRIVATE += -L$$QT_BUILD_TREE/lib -lqtfreetype$$qtPlatformTargetSuffix()
}
diff --git a/src/3rdparty/harfbuzz-ng/harfbuzz-ng.pro b/src/3rdparty/harfbuzz-ng/harfbuzz-ng.pro
index 4fd0823332..1bfeabb8c4 100644
--- a/src/3rdparty/harfbuzz-ng/harfbuzz-ng.pro
+++ b/src/3rdparty/harfbuzz-ng/harfbuzz-ng.pro
@@ -9,7 +9,9 @@ load(qt_helper_lib)
# built-in shapers list configuration:
SHAPERS += opentype # HB's main shaper; enabling it should be enough most of the time
-mac: SHAPERS += coretext # native shaper on OSX/iOS; could be used alone to handle both OT and AAT fonts
+
+# native shaper on Apple platforms; could be used alone to handle both OT and AAT fonts
+darwin:!if(watchos:CONFIG(simulator, simulator|device)): SHAPERS += coretext
DEFINES += HAVE_CONFIG_H
DEFINES += HB_NO_UNICODE_FUNCS HB_DISABLE_DEPRECATED
@@ -147,7 +149,7 @@ contains(SHAPERS, coretext) {
$$PWD/src/hb-coretext.h
uikit: \
- # On iOS/tvOS CoreText and CoreGraphics are stand-alone frameworks
+ # On iOS/tvOS/watchOS CoreText and CoreGraphics are stand-alone frameworks
LIBS_PRIVATE += -framework CoreText -framework CoreGraphics
else: \
# On Mac OS they are part of the ApplicationServices umbrella framework,
diff --git a/src/3rdparty/harfbuzz-ng/qt_attribution.json b/src/3rdparty/harfbuzz-ng/qt_attribution.json
new file mode 100644
index 0000000000..4d3eb79150
--- /dev/null
+++ b/src/3rdparty/harfbuzz-ng/qt_attribution.json
@@ -0,0 +1,25 @@
+{
+ "Id": "harfbuzz-ng",
+ "Name": "HarfBuzz-NG",
+ "QDocModule": "qtgui",
+ "QtUsage": "Optionally used in Qt GUI. Configure with -system-harfbuzz or -qt-harfbuzz to avoid.",
+
+ "Description": "HarfBuzz is an OpenType text shaping engine.",
+ "Homepage": "http://harfbuzz.org",
+
+ "License": "MIT License",
+ "LicenseId": "MIT",
+ "LicenseFile": "COPYING",
+ "Copyright": "Copyright © 2010,2011,2012 Google, Inc.
+Copyright © 2012 Mozilla Foundation
+Copyright © 2011 Codethink Limited
+Copyright © 2008,2010 Nokia Corporation and/or its subsidiary(-ies)
+Copyright © 2009 Keith Stribley
+Copyright © 2009 Martin Hosken and SIL International
+Copyright © 2007 Chris Wilson
+Copyright © 2006 Behdad Esfahbod
+Copyright © 2005 David Turner
+Copyright © 2004,2007,2008,2009,2010 Red Hat, Inc.
+Copyright © 1998-2004 David Turner and Werner Lemberg
+"
+}
diff --git a/src/3rdparty/harfbuzz/qt_attribution.json b/src/3rdparty/harfbuzz/qt_attribution.json
new file mode 100644
index 0000000000..2c2b31e4a9
--- /dev/null
+++ b/src/3rdparty/harfbuzz/qt_attribution.json
@@ -0,0 +1,17 @@
+{
+ "Id": "harfbuzz",
+ "Name": "HarfBuzz",
+ "QDocModule": "qtgui",
+ "QtUsage": "Optionally used in Qt GUI. Configure with -system-harfbuzz or -qt-harfbuzz to avoid.",
+
+ "License": "MIT License",
+ "LicenseId": "MIT",
+ "LicenseFile": "COPYING",
+ "Copyright": "Copyright (c) 1992, 1993
+ The Regents of the University of California. All rights reserved.
+
+Copyright (c) 2011 The FreeBSD Foundation
+All rights reserved.
+Portions of this software were developed by David Chisnall
+under sponsorship from the FreeBSD Foundation."
+}
diff --git a/src/3rdparty/harfbuzz_dependency.pri b/src/3rdparty/harfbuzz_dependency.pri
index 36abbfbe35..5946f403c5 100644
--- a/src/3rdparty/harfbuzz_dependency.pri
+++ b/src/3rdparty/harfbuzz_dependency.pri
@@ -1,6 +1,6 @@
-contains(QT_CONFIG, system-harfbuzz) {
- LIBS_PRIVATE += -lharfbuzz
-} else: contains(QT_CONFIG, harfbuzz) {
+qtConfig(system-harfbuzz) {
+ QMAKE_USE_PRIVATE += harfbuzz
+} else: qtConfig(harfbuzz) {
INCLUDEPATH += $$PWD/harfbuzz-ng/include
LIBS_PRIVATE += -L$$QT_BUILD_TREE/lib -lqtharfbuzzng$$qtPlatformTargetSuffix()
}
diff --git a/src/3rdparty/iaccessible2/LICENSE b/src/3rdparty/iaccessible2/LICENSE
new file mode 100644
index 0000000000..688d9d3197
--- /dev/null
+++ b/src/3rdparty/iaccessible2/LICENSE
@@ -0,0 +1,38 @@
+Copyright (c) 2013 Linux Foundation
+All rights reserved.
+
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials
+ provided with the distribution.
+
+ 3. Neither the name of the Linux Foundation nor the names of its
+ contributors may be used to endorse or promote products
+ derived from this software without specific prior written
+ permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+This BSD License conforms to the Open Source Initiative "Simplified
+BSD License" as published at:
+http://www.opensource.org/licenses/bsd-license.php
diff --git a/src/3rdparty/iaccessible2/qt_attribution.json b/src/3rdparty/iaccessible2/qt_attribution.json
new file mode 100644
index 0000000000..545ffe4d63
--- /dev/null
+++ b/src/3rdparty/iaccessible2/qt_attribution.json
@@ -0,0 +1,17 @@
+{
+ "Id": "iaccessible2",
+ "Name": "IAccessible2 IDL Specification",
+ "QDocModule": "qtgui",
+ "QtUsage": "Optionally used in the Windows platform plugin. Configure with -no-accessibility to avoid.",
+
+ "Description": "IAccessible2 is a new accessibility API which complements Microsoft's earlier work on MSAA",
+ "Homepage": "http://www.linuxfoundation.org/collaborate/workgroups/accessibility/iaccessible2",
+ "License": "BSD 3-clause \"New\" or \"Revised\" License",
+ "LicenseId": "BSD-3-Clause",
+ "LicenseFile": "LICENSE",
+ "Copyright": "Copyright (c) 2000, 2006 Sun Microsystems, Inc.
+Copyright (c) 2006 IBM Corporation
+Copyright (c) 2007, 2010, 2012, 2013 Linux Foundation
+
+IAccessible2 is a trademark of the Linux Foundation. The IAccessible2 mark may be used in accordance with the Linux Foundation Trademark Policy to indicate compliance with the IAccessible2 specification."
+}
diff --git a/src/3rdparty/libjpeg/LICENSE b/src/3rdparty/libjpeg/LICENSE
new file mode 100644
index 0000000000..797a6d5668
--- /dev/null
+++ b/src/3rdparty/libjpeg/LICENSE
@@ -0,0 +1,50 @@
+from qtbase/src/3rdparty/libjpeg/README:
+
+LEGAL ISSUES
+============
+
+In plain English:
+
+1. We don't promise that this software works. (But if you find any bugs,
+ please let us know!)
+2. You can use this software for whatever you want. You don't have to pay us.
+3. You may not pretend that you wrote this software. If you use it in a
+ program, you must acknowledge somewhere in your documentation that
+ you've used the IJG code.
+
+In legalese:
+
+The authors make NO WARRANTY or representation, either express or implied,
+with respect to this software, its quality, accuracy, merchantability, or
+fitness for a particular purpose. This software is provided "AS IS", and you,
+its user, assume the entire risk as to its quality and accuracy.
+
+This software is copyright (C) 1991-1998, Thomas G. Lane.
+All Rights Reserved except as specified below.
+
+Permission is hereby granted to use, copy, modify, and distribute this
+software (or portions thereof) for any purpose, without fee, subject to these
+conditions:
+(1) If any part of the source code for this software is distributed, then this
+README file must be included, with this copyright and no-warranty notice
+unaltered; and any additions, deletions, or changes to the original files
+must be clearly indicated in accompanying documentation.
+(2) If only executable code is distributed, then the accompanying
+documentation must state that "this software is based in part on the work of
+the Independent JPEG Group".
+(3) Permission for use of this software is granted only if the user accepts
+full responsibility for any undesirable consequences; the authors accept
+NO LIABILITY for damages of any kind.
+
+These conditions apply to any software derived from or based on the IJG code,
+not just to the unmodified library. If you use our work, you ought to
+acknowledge us.
+
+Permission is NOT granted for the use of any IJG author's name or company name
+in advertising or publicity relating to this software or products derived from
+it. This software may be referred to only as "the Independent JPEG Group's
+software".
+
+We specifically permit and encourage the use of this software as the basis of
+commercial products, provided that all warranty or liability claims are
+assumed by the product vendor.
diff --git a/src/3rdparty/libjpeg/qt_attribution.json b/src/3rdparty/libjpeg/qt_attribution.json
new file mode 100644
index 0000000000..ee5c094a0f
--- /dev/null
+++ b/src/3rdparty/libjpeg/qt_attribution.json
@@ -0,0 +1,13 @@
+{
+ "Id": "libjpeg",
+ "Name": "LibJPEG",
+ "QDocModule": "qtgui",
+ "QtUsage": "Used in the QJPEG image plugin. Configure with -no-jpeg to avoid.",
+
+ "Description": "The Independent JPEG Group's JPEG software",
+ "Homepage": "http://www.ijg.org/",
+ "License": "Independent JPEG Group License",
+ "LicenseId": "IJG",
+ "LicenseFile": "LICENSE",
+ "Copyright": "Copyright (C) 1991-2011, Thomas G. Lane, Guido Vollbeding."
+}
diff --git a/src/3rdparty/libpng/qt_attribution.json b/src/3rdparty/libpng/qt_attribution.json
new file mode 100644
index 0000000000..93e73243af
--- /dev/null
+++ b/src/3rdparty/libpng/qt_attribution.json
@@ -0,0 +1,15 @@
+{
+ "Id": "libpng",
+ "Name": "LibPNG",
+ "QDocModule": "qtgui",
+ "QtUsage": "Used in the qpng image plugin. Configure with -system-png or -no-png to avoid.",
+
+ "Description": "libpng is the official PNG reference library.",
+ "Homepage": "http://www.libpng.org/pub/png/libpng.html",
+ "License": "libpng License",
+ "LicenseId": "Libpng",
+ "LicenseFile": "LICENSE",
+ "Copyright": "Copyright (c) 1998-2015 Glenn Randers-Pehrson
+Copyright (c) 1996-1997 Andreas Dilger
+Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc."
+}
diff --git a/src/3rdparty/md4/qt_attribution.json b/src/3rdparty/md4/qt_attribution.json
new file mode 100644
index 0000000000..f1bca24660
--- /dev/null
+++ b/src/3rdparty/md4/qt_attribution.json
@@ -0,0 +1,10 @@
+{
+ "Id": "md4",
+ "Name": "MD4",
+ "QDocModule": "qtcore",
+ "QtUsage": "Used in Qt Core (QCryptographicHash). Configure with -DQT_CRYPTOGRAPHICHASH_ONLY_SHA1 to avoid.",
+
+ "Description": "An OpenSSL-compatible implementation of the RSA Data Security, Inc. MD4 Message-Digest Algorithm.",
+ "License": "Public Domain",
+ "Copyright": "Written by Alexander Peslyak - better known as Solar Designer <solar@openwall.com> - in 2001, and placed in the public domain. There's absolutely no warranty."
+}
diff --git a/src/3rdparty/md5/qt_attribution.json b/src/3rdparty/md5/qt_attribution.json
new file mode 100644
index 0000000000..52b613cf6c
--- /dev/null
+++ b/src/3rdparty/md5/qt_attribution.json
@@ -0,0 +1,11 @@
+{
+ "Id": "md5",
+ "Name": "MD5",
+ "QDocModule": "qtcore",
+ "QtUsage": "Used in Qt Core (QCryptographicHash). Configure with -DQT_CRYPTOGRAPHICHASH_ONLY_SHA1 to avoid.",
+
+ "Description": "MD5 message-digest algorithm.",
+ "License": "Public Domain",
+ "Copyright": "Written by Colin Plumb in 1993, no copyright is claimed.
+Ian Jackson <ian@chiark.greenend.org.uk>."
+}
diff --git a/src/3rdparty/pcre/qt_attribution.json b/src/3rdparty/pcre/qt_attribution.json
new file mode 100644
index 0000000000..ec8832486b
--- /dev/null
+++ b/src/3rdparty/pcre/qt_attribution.json
@@ -0,0 +1,15 @@
+{
+ "Id": "pcre",
+ "Name": "PCRE",
+ "QDocModule": "qtcore",
+ "QtUsage": "Optionally used in Qt Core (QRegularExpression). Configure with -system-pcre or -no-pcre to avoid.",
+
+ "Description": "The PCRE library is a set of functions that implement regular expression pattern matching using the same syntax and semantics as Perl 5.",
+ "Homepage": "http://www.pcre.org/",
+ "License": "BSD 3-clause \"New\" or \"Revised\" License",
+ "LicenseId": "BSD-3-Clause",
+ "LicenseFile": "LICENCE",
+ "Copyright": "Copyright (c) 1997-2015 University of Cambridge
+Copyright (c) 2010-2015 Zoltan Herczeg
+Copyright (c) 2007-2012, Google Inc."
+}
diff --git a/src/3rdparty/pcre_dependency.pri b/src/3rdparty/pcre_dependency.pri
index 2a3c99c7ed..fa7df4df0e 100644
--- a/src/3rdparty/pcre_dependency.pri
+++ b/src/3rdparty/pcre_dependency.pri
@@ -3,5 +3,5 @@ pcre {
INCLUDEPATH += $$PWD/pcre
LIBS_PRIVATE += -L$$QT_BUILD_TREE/lib -lqtpcre$$qtPlatformTargetSuffix()
} else {
- LIBS_PRIVATE += -lpcre16
+ QMAKE_USE_PRIVATE += pcre
}
diff --git a/src/3rdparty/pixman/LICENSE b/src/3rdparty/pixman/LICENSE
new file mode 100644
index 0000000000..3cb51484f1
--- /dev/null
+++ b/src/3rdparty/pixman/LICENSE
@@ -0,0 +1,20 @@
+Copyright © 2009 Nokia Corporation
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+the rights to use, copy, modify, merge, publish, distribute, sublicense,
+and/or sell copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice (including the next
+paragraph) shall be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
diff --git a/src/3rdparty/pixman/qt_attribution.json b/src/3rdparty/pixman/qt_attribution.json
new file mode 100644
index 0000000000..607bda754d
--- /dev/null
+++ b/src/3rdparty/pixman/qt_attribution.json
@@ -0,0 +1,13 @@
+{
+ "Id": "pixman",
+ "Name": "Pixman",
+ "QDocModule": "qtgui",
+ "QtUsage": "Used in Qt GUI on ARM NEON.",
+
+ "Description": "pixman is a library that provides low-level pixel manipulation features such as image compositing and trapezoid rasterization.",
+ "Homepage": "http://www.pixman.org/",
+ "License": "MIT License",
+ "LicenseFile": "LICENSE",
+ "LicenseId": "MIT",
+ "Copyright": "Copyright © 2009 Nokia Corporation"
+}
diff --git a/src/3rdparty/png_dependency.pri b/src/3rdparty/png_dependency.pri
index 2ec2e8929d..50711358a0 100644
--- a/src/3rdparty/png_dependency.pri
+++ b/src/3rdparty/png_dependency.pri
@@ -1,15 +1,6 @@
-contains(QT_CONFIG, system-png) {
- unix|mingw {
- !contains(QT_CONFIG, no-pkg-config) {
- CONFIG += link_pkgconfig
- PKGCONFIG_PRIVATE += libpng
- } else {
- LIBS_PRIVATE += -lpng
- }
- } else {
- LIBS += libpng.lib
- }
-} else: contains(QT_CONFIG, png) {
+qtConfig(system-png) {
+ QMAKE_USE_PRIVATE += libpng
+} else: qtConfig(png) {
INCLUDEPATH += $$PWD/libpng
LIBS_PRIVATE += -L$$QT_BUILD_TREE/lib -lqtpng$$qtPlatformTargetSuffix()
}
diff --git a/src/3rdparty/rfc6234/LICENSE b/src/3rdparty/rfc6234/LICENSE
new file mode 100644
index 0000000000..7075960ee2
--- /dev/null
+++ b/src/3rdparty/rfc6234/LICENSE
@@ -0,0 +1,34 @@
+Copyright (c) 2011 IETF Trust and the persons identified as
+authors of the code. All rights reserved.
+
+Redistribution and use in source and binary forms, with or
+without modification, are permitted provided that the following
+conditions are met:
+
+- Redistributions of source code must retain the above
+ copyright notice, this list of conditions and
+ the following disclaimer.
+
+- Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+
+- Neither the name of Internet Society, IETF or IETF Trust, nor
+ the names of specific contributors, may be used to endorse or
+ promote products derived from this software without specific
+ prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/src/3rdparty/rfc6234/qt_attribution.json b/src/3rdparty/rfc6234/qt_attribution.json
new file mode 100644
index 0000000000..9fc427b4a6
--- /dev/null
+++ b/src/3rdparty/rfc6234/qt_attribution.json
@@ -0,0 +1,12 @@
+{
+ "Id": "rfc6234",
+ "Name": "Secure Hash Algorithms SHA-384 and SHA-512",
+ "QDocModule": "qtcore",
+ "QtUsage": "Used in Qt Core (QCryptographicHash and QMessageAuthenticationCode)",
+
+ "Description": "Implements the Secure Hash Algorithms SHA 384 and SHA-521",
+ "License": "BSD 3-clause \"New\" or \"Revised\" License",
+ "LicenseFile": "LICENSE",
+ "LicenseId": "BSD-3-Clause",
+ "Copyright": "Copyright (c) 2011 IETF Trust and the persons identified as authors of the code."
+}
diff --git a/src/3rdparty/sha1/qt_attribution.json b/src/3rdparty/sha1/qt_attribution.json
new file mode 100644
index 0000000000..707c239f8d
--- /dev/null
+++ b/src/3rdparty/sha1/qt_attribution.json
@@ -0,0 +1,12 @@
+{
+ "Id": "sha1",
+ "Name": "Secure Hash Algorithm SHA-1",
+ "QDocModule": "qtcore",
+ "QtUsage": "Used in Qt Core (QCryptographicHash).",
+
+ "Description": "Implements the Secure Hash Algorithms SHA 1",
+ "Homepage": "http://www.dominik-reichl.de/projects/csha1/",
+ "License": "Public Domain",
+ "Copyright": "Copyright (C) Dominik Reichl <dominik.reichl@t-online.de>
+Copyright (C) 2016 The Qt Company Ltd"
+}
diff --git a/src/3rdparty/sha3/BRG_ENDIAN_LICENSE b/src/3rdparty/sha3/BRG_ENDIAN_LICENSE
new file mode 100644
index 0000000000..0a4fdcbc3b
--- /dev/null
+++ b/src/3rdparty/sha3/BRG_ENDIAN_LICENSE
@@ -0,0 +1,21 @@
+Copyright (c) 1998-2008, Brian Gladman, Worcester, UK. All rights reserved.
+
+LICENSE TERMS
+
+The redistribution and use of this software (with or without changes)
+is allowed without the payment of fees or royalties provided that:
+
+ 1. source code distributions include the above copyright notice, this
+ list of conditions and the following disclaimer;
+
+ 2. binary distributions include the above copyright notice, this list
+ of conditions and the following disclaimer in their documentation;
+
+ 3. the name of the copyright holder is not used to endorse products
+ built using this software without specific written permission.
+
+DISCLAIMER
+
+This software is provided 'as is' with no explicit or implied warranties
+in respect of its properties, including, but not limited to, correctness
+and/or fitness for purpose.
diff --git a/src/3rdparty/sha3/CC0_LICENSE b/src/3rdparty/sha3/CC0_LICENSE
new file mode 100644
index 0000000000..cff12c3d88
--- /dev/null
+++ b/src/3rdparty/sha3/CC0_LICENSE
@@ -0,0 +1,99 @@
+CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF
+THIS DOCUMENT DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
+INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE USE OF THIS
+DOCUMENT OR THE INFORMATION OR WORKS PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES
+RESULTING FROM THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED HEREUNDER.
+
+Statement of Purpose
+
+The laws of most jurisdictions throughout the world automatically confer exclusive Copyright and
+Related Rights (defined below) upon the creator and subsequent owner(s) (each and all, an "owner")
+of an original work of authorship and/or a database (each, a "Work").
+
+Certain owners wish to permanently relinquish those rights to a Work for the purpose of contributing
+to a commons of creative, cultural and scientific works ("Commons") that the public can reliably and
+without fear of later claims of infringement build upon, modify, incorporate in other works, reuse
+and redistribute as freely as possible in any form whatsoever and for any purposes, including
+without limitation commercial purposes. These owners may contribute to the Commons to promote the
+ideal of a free culture and the further production of creative, cultural and scientific works, or to
+gain reputation or greater distribution for their Work in part through the use and efforts of
+others.
+
+For these and/or other purposes and motivations, and without any expectation of additional
+consideration or compensation, the person associating CC0 with a Work (the "Affirmer"), to the
+extent that he or she is an owner of Copyright and Related Rights in the Work, voluntarily elects to
+apply CC0 to the Work and publicly distribute the Work under its terms, with knowledge of his or her
+Copyright and Related Rights in the Work and the meaning and intended legal effect of CC0 on those
+rights.
+
+1. Copyright and Related Rights. A Work made available under CC0 may be protected by copyright and
+ related or neighboring rights ("Copyright and Related Rights"). Copyright and Related Rights
+ include, but are not limited to, the following:
+
+ i. the right to reproduce, adapt, distribute, perform, display, communicate, and translate a Work;
+
+ ii. moral rights retained by the original author(s) and/or performer(s);
+
+ iii. publicity and privacy rights pertaining to a person's image or likeness depicted in a Work;
+
+ iv. rights protecting against unfair competition in regards to a Work, subject to the limitations
+ in paragraph 4(a), below;
+
+ v. rights protecting the extraction, dissemination, use and reuse of data in a Work;
+
+ vi. database rights (such as those arising under Directive 96/9/EC of the European Parliament and
+ of the Council of 11 March 1996 on the legal protection of databases, and under any national
+ implementation thereof, including any amended or successor version of such directive); and
+
+ vii. other similar, equivalent or corresponding rights throughout the world based on applicable
+ law or treaty, and any national implementations thereof.
+
+2. Waiver. To the greatest extent permitted by, but not in contravention of, applicable law,
+ Affirmer hereby overtly, fully, permanently, irrevocably and unconditionally waives, abandons,
+ and surrenders all of Affirmer's Copyright and Related Rights and associated claims and causes of
+ action, whether now known or unknown (including existing as well as future claims and causes of
+ action), in the Work (i) in all territories worldwide, (ii) for the maximum duration provided by
+ applicable law or treaty (including future time extensions), (iii) in any current or future
+ medium and for any number of copies, and (iv) for any purpose whatsoever, including without
+ limitation commercial, advertising or promotional purposes (the "Waiver"). Affirmer makes the
+ Waiver for the benefit of each member of the public at large and to the detriment of Affirmer's
+ heirs and successors, fully intending that such Waiver shall not be subject to revocation,
+ rescission, cancellation, termination, or any other legal or equitable action to disrupt the
+ quiet enjoyment of the Work by the public as contemplated by Affirmer's express Statement of
+ Purpose.
+
+3. Public License Fallback. Should any part of the Waiver for any reason be judged legally invalid
+ or ineffective under applicable law, then the Waiver shall be preserved to the maximum extent
+ permitted taking into account Affirmer's express Statement of Purpose. In addition, to the extent
+ the Waiver is so judged Affirmer hereby grants to each affected person a royalty-free, non
+ transferable, non sublicensable, non exclusive, irrevocable and unconditional license to exercise
+ Affirmer's Copyright and Related Rights in the Work (i) in all territories worldwide, (ii) for
+ the maximum duration provided by applicable law or treaty (including future time extensions),
+ (iii) in any current or future medium and for any number of copies, and (iv) for any purpose
+ whatsoever, including without limitation commercial, advertising or promotional purposes (the
+ "License"). The License shall be deemed effective as of the date CC0 was applied by Affirmer to
+ the Work. Should any part of the License for any reason be judged legally invalid or ineffective
+ under applicable law, such partial invalidity or ineffectiveness shall not invalidate the
+ remainder of the License, and in such case Affirmer hereby affirms that he or she will not (i)
+ exercise any of his or her remaining Copyright and Related Rights in the Work or (ii) assert any
+ associated claims and causes of action with respect to the Work, in either case contrary to
+ Affirmer's express Statement of Purpose.
+
+4. Limitations and Disclaimers.
+
+a. No trademark or patent rights held by Affirmer are waived, abandoned, surrendered, licensed or
+ otherwise affected by this document.
+
+b. Affirmer offers the Work as-is and makes no representations or warranties of any kind concerning
+ the Work, express, implied, statutory or otherwise, including without limitation warranties of
+ title, merchantability, fitness for a particular purpose, non infringement, or the absence of
+ latent or other defects, accuracy, or the present or absence of errors, whether or not
+ discoverable, all to the greatest extent permissible under applicable law.
+
+c. Affirmer disclaims responsibility for clearing rights of other persons that may apply to the Work
+ or any use thereof, including without limitation any person's Copyright and Related Rights in the
+ Work. Further, Affirmer disclaims responsibility for obtaining any necessary consents,
+ permissions or other rights required for any use of the Work.
+
+d. Affirmer understands and acknowledges that Creative Commons is not a party to this document and
+ has no duty or obligation with respect to this CC0 or use of the Work.
diff --git a/src/3rdparty/sha3/qt_attribution.json b/src/3rdparty/sha3/qt_attribution.json
new file mode 100644
index 0000000000..13e6e971d9
--- /dev/null
+++ b/src/3rdparty/sha3/qt_attribution.json
@@ -0,0 +1,29 @@
+[
+ {
+ "Id": "sha3_endian",
+ "Name": "Secure Hash Algorithm SHA-3 - brg_endian",
+ "QDocModule": "qtcore",
+ "QtUsage": "Used in Qt Core (QCryptographicHash).",
+
+ "Description": "SHA-3, originally known as Keccak, is a cryptographic hash function.",
+ "License": "BSD 3-clause \"New\" or \"Revised\" License",
+ "LicenseFile": "BRG_ENDIAN_LICENSE",
+ "LicenseId": "BSD-3-Clause",
+ "Copyright": "Copyright (c) 1998-2008, Brian Gladman, Worcester, UK. All rights reserved."
+ },
+ {
+ "Id": "sha3_keccak",
+ "Name": "Secure Hash Algorithm SHA-3 - Keccak",
+ "QDocModule": "qtcore",
+ "QtUsage": "Used in Qt Core (QCryptographicHash).",
+
+ "Description": "SHA-3, originally known as Keccak, is a cryptographic hash function.",
+ "License": "Creative Commons Zero v1.0 Universal",
+ "LicenseId": "CC0-1.0",
+ "LicenseFile": "CC0_LICENSE",
+ "Copyright": "Guido Bertoni, Joan Daemen, Michaël Peeters and Gilles Van Assche.
+
+To the extent possible under law, the implementers have waived all copyright
+and related or neighboring rights to the source code in this file."
+ }
+]
diff --git a/src/3rdparty/sqlite.pri b/src/3rdparty/sqlite.pri
index 29968e323f..87c356870b 100644
--- a/src/3rdparty/sqlite.pri
+++ b/src/3rdparty/sqlite.pri
@@ -1,7 +1,7 @@
CONFIG(release, debug|release):DEFINES *= NDEBUG
DEFINES += SQLITE_OMIT_LOAD_EXTENSION SQLITE_OMIT_COMPLETE SQLITE_ENABLE_FTS3 SQLITE_ENABLE_FTS3_PARENTHESIS SQLITE_ENABLE_RTREE
!contains(CONFIG, largefile):DEFINES += SQLITE_DISABLE_LFS
-contains(QT_CONFIG, posix_fallocate):DEFINES += HAVE_POSIX_FALLOCATE=1
+qtConfig(posix_fallocate): DEFINES += HAVE_POSIX_FALLOCATE=1
winrt: DEFINES += SQLITE_OS_WINRT
winphone: DEFINES += SQLITE_WIN32_FILEMAPPING_API=1
qnx: DEFINES += _QNX_SOURCE
diff --git a/src/3rdparty/sqlite/qt_attribution.json b/src/3rdparty/sqlite/qt_attribution.json
new file mode 100644
index 0000000000..a4ea0cdbd2
--- /dev/null
+++ b/src/3rdparty/sqlite/qt_attribution.json
@@ -0,0 +1,12 @@
+{
+ "Id": "sqlite",
+ "Name": "SQLite",
+ "QDocModule": "qtsql",
+ "QtUsage": "Used in Qt SQL Lite plugin. Configure Qt with -system-sqlite or -no-sqlite to avoid.",
+
+ "Description": "SQLite is a small C library that implements a self-contained, embeddable, zero-configuration SQL database engine.",
+ "Homepage": "http://www.sqlite.org/",
+ "Version": "3.11.1.0",
+ "License": "Public Domain",
+ "Copyright": "The authors disclaim copyright to the source code. However, a license can be obtained if needed."
+}
diff --git a/src/3rdparty/wintab/qt_attribution.json b/src/3rdparty/wintab/qt_attribution.json
new file mode 100644
index 0000000000..742278fb26
--- /dev/null
+++ b/src/3rdparty/wintab/qt_attribution.json
@@ -0,0 +1,12 @@
+{
+ "Id": "wintab",
+ "Name": "Wintab API",
+ "QDocModule": "qtgui",
+ "QtUsage": "Used in the Qt platform plugin for Windows. Configure with -DQT_NO_TABLETEVENT to avoid.",
+
+ "Description": "Wintab is a de facto API for pointing devices on Windows.",
+ "Homepage": "http://www.pointing.com/Wintab.html",
+ "License": "Public Domain",
+ "LicenseId": "NONE",
+ "Copyright": "Copyright 1991-1998 by LCS/Telegraphics."
+}
diff --git a/src/3rdparty/xcb/LICENSE b/src/3rdparty/xcb/LICENSE
new file mode 100644
index 0000000000..8f4e5c3a72
--- /dev/null
+++ b/src/3rdparty/xcb/LICENSE
@@ -0,0 +1,23 @@
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use, copy,
+modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
+CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the names of the authors or
+their institutions shall not be used in advertising or otherwise to
+promote the sale, use or other dealings in this Software without
+prior written authorization from the authors.
diff --git a/src/3rdparty/xcb/qt_attribution.json b/src/3rdparty/xcb/qt_attribution.json
new file mode 100644
index 0000000000..30b9af3818
--- /dev/null
+++ b/src/3rdparty/xcb/qt_attribution.json
@@ -0,0 +1,24 @@
+{
+ "Id": "xcb",
+ "Name": "XCB",
+ "QDocModule": "qtgui",
+ "QtUsage": "Optionally used in xcb platform plugin if configured with -qt-xcb.",
+
+ "Description": "Selected xcb libraries.",
+ "Homepage": "https://xcb.freedesktop.org/",
+ "License": "MIT License",
+ "LicenseId": "MIT",
+ "LicenseFile": "LICENSE",
+ "Copyright": "Copyright © 2000 Keith Packard
+Copyright © 2006 Jamey Sharp
+Copyright © 2007-2008 Vincent Torri <vtorri@univ-evry.fr>
+Copyright © 2007 Bart Massey
+Copyright © 2008-2009 Julien Danjou <julien@danjou.info>
+Copyright © 2008 Arnaud Fontaine <arnau@debian.org>
+Copyright © 2008 Bart Massey <bart@cs.pdx.edu>
+Copyright © 2008 Ian Osgood <iano@quirkster.com>
+Copyright © 2008 Jamey Sharp <jamey@minilop.net>
+Copyright © 2008 Josh Triplett <josh@freedesktop.org>
+Copyright © 2008 Ulrich Eckhardt <doomster@knuut.de>
+"
+}
diff --git a/src/3rdparty/xkbcommon-x11.pri b/src/3rdparty/xkbcommon-x11.pri
new file mode 100644
index 0000000000..36f22ce9cc
--- /dev/null
+++ b/src/3rdparty/xkbcommon-x11.pri
@@ -0,0 +1,10 @@
+include(xkbcommon.pri)
+
+# Build xkbcommon-x11 support library, it depends on -lxcb and -lxcb-xkb, linking is done
+# in xcb-plugin.pro (linked to system libraries or if Qt was configured with -qt-xcb then
+# linked to -lxcb-static).
+INCLUDEPATH += $$PWD/xkbcommon/src/x11
+SOURCES += \
+ $$PWD/xkbcommon/src/x11/util.c \
+ $$PWD/xkbcommon/src/x11/x11-keymap.c \ # renamed: keymap.c -> x11-keymap.c
+ $$PWD/xkbcommon/src/x11/x11-state.c # renamed: state.c -> x11-state.c
diff --git a/src/3rdparty/xkbcommon.pri b/src/3rdparty/xkbcommon.pri
index eaef4749db..12e7a4d8a3 100644
--- a/src/3rdparty/xkbcommon.pri
+++ b/src/3rdparty/xkbcommon.pri
@@ -47,15 +47,4 @@ SOURCES += \
$$PWD/xkbcommon/src/xkbcomp/xkbcomp.c \
$$PWD/xkbcommon/src/xkbcomp/parser.c
-!contains(DEFINES, QT_NO_XKB):contains(QT_CONFIG, use-xkbcommon-x11support): {
- # Build xkbcommon-x11 support library, it depends on -lxcb and -lxcb-xkb, linking is done
- # in xcb-plugin.pro (linked to system libraries or if Qt was configured with -qt-xcb then
- # linked to -lxcb-static).
- INCLUDEPATH += $$PWD/xkbcommon/src/x11
- SOURCES += \
- $$PWD/xkbcommon/src/x11/util.c \
- $$PWD/xkbcommon/src/x11/x11-keymap.c \ # renamed: keymap.c -> x11-keymap.c
- $$PWD/xkbcommon/src/x11/x11-state.c # renamed: state.c -> x11-state.c
-}
-
TR_EXCLUDE += $$PWD/*
diff --git a/src/3rdparty/xkbcommon/qt_attribution.json b/src/3rdparty/xkbcommon/qt_attribution.json
new file mode 100644
index 0000000000..8ee0df1b22
--- /dev/null
+++ b/src/3rdparty/xkbcommon/qt_attribution.json
@@ -0,0 +1,26 @@
+{
+ "Id": "xkbcommon",
+ "Name": "xkbcommon",
+ "QDocModule": "qtgui",
+ "QtUsage": "Used in xcb platform plugin. Configure with -system-xkbcommon-x11 to avoid.",
+
+ "Description": "xkbcommon is a keymap compiler and support library which processes a reduced subset of keymaps as defined by the XKB specification.",
+ "Homepage": "http://xkbcommon.org/",
+ "License": "MIT Licenses (with no-advertisement clause)",
+ "LicenseId": "MIT",
+ "LicenseFile": "COPYING",
+ "Copyright": "Copyright 1985, 1987, 1988, 1990, 1998 The Open Group
+Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts.
+Copyright 1993, 1994, 1995, 1996 by Silicon Graphics Computer Systems, Inc.
+Copyright 1996 by Joseph Moss
+Copyright 2002-2007 Free Software Foundation, Inc.
+Copyright 2003-2004 Dmitry Golubev <lastguru@mail.ru>
+Copyright 2004, Gregory Mokhin <mokhin@bog.msu.ru>
+Copyright 2006 Erdal Ronahî
+Copyright 2008, 2009 Dan Nicholson
+Copyright 2009-2012 Daniel Stone
+Copyright 2010, 2012 Intel Corporation
+Copyright 2010 Francisco Jerez <currojerez@riseup.net>
+Copyright 2011 Joseph Adams <joeyadams3.14159@gmail.com>
+Copyright 2012 Ran Benita <ran234@gmail.com>"
+}
diff --git a/src/3rdparty/zlib/LICENSE b/src/3rdparty/zlib/LICENSE
new file mode 100644
index 0000000000..9c57e18006
--- /dev/null
+++ b/src/3rdparty/zlib/LICENSE
@@ -0,0 +1,28 @@
+ This software is provided 'as-is', without any express or implied
+ warranty. In no event will the authors be held liable for any damages
+ arising from the use of this software.
+
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute it
+ freely, subject to the following restrictions:
+
+ 1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+ 3. This notice may not be removed or altered from any source distribution.
+
+ Jean-loup Gailly Mark Adler
+ jloup@gzip.org madler@alumni.caltech.edu
+
+If you use the zlib library in a product, we would appreciate *not* receiving
+lengthy legal documents to sign. The sources are provided for free but without
+warranty of any kind. The library has been entirely written by Jean-loup
+Gailly and Mark Adler; it does not include third-party code.
+
+If you redistribute modified sources, we would appreciate that you include in
+the file ChangeLog history information documenting your changes. Please read
+the FAQ for more information on the distribution of modified source versions.
+
diff --git a/src/3rdparty/zlib/gzguts.h b/src/3rdparty/zlib/gzguts.h
index 9e4368e889..3daf1070c4 100644
--- a/src/3rdparty/zlib/gzguts.h
+++ b/src/3rdparty/zlib/gzguts.h
@@ -21,7 +21,9 @@
# endif
#endif
-#include "qconfig.h"
+#ifndef QT_BOOTSTRAPPED
+# include <qconfig.h>
+#endif
#if ((__GNUC__-0) * 10 + __GNUC_MINOR__-0 >= 33) && !defined(NO_VIZ) && defined(QT_VISIBILITY_AVAILABLE)
# define ZLIB_INTERNAL __attribute__((visibility ("hidden")))
#else
diff --git a/src/3rdparty/zlib/qt_attribution.json b/src/3rdparty/zlib/qt_attribution.json
new file mode 100644
index 0000000000..a10fd1921f
--- /dev/null
+++ b/src/3rdparty/zlib/qt_attribution.json
@@ -0,0 +1,15 @@
+{
+ "Id": "zlib",
+ "Name": "Data Compression Library (zlib)",
+ "QDocModule": "qtcore",
+ "QtUsage": "Optionally used in Qt Core and and development tools. Configure with -system-zlib to avoid.",
+
+ "Description": "zlib is a general purpose data compression library.",
+ "Homepage": "http://zlib.net/",
+ "Version": "1.2.5",
+
+ "License": "ZLib license",
+ "LicenseId": "Zlib",
+ "LicenseFile": "LICENSE",
+ "Copyright": "(C) 1995-2010 Jean-loup Gailly and Mark Adler"
+}
diff --git a/src/3rdparty/zlib/zutil.h b/src/3rdparty/zlib/zutil.h
index 4d367a92db..881a7ecb3f 100644
--- a/src/3rdparty/zlib/zutil.h
+++ b/src/3rdparty/zlib/zutil.h
@@ -13,7 +13,9 @@
#ifndef ZUTIL_H
#define ZUTIL_H
-#include "qconfig.h"
+#ifndef QT_BOOTSTRAPPED
+# include <qconfig.h>
+#endif
#if ((__GNUC__-0) * 10 + __GNUC_MINOR__-0 >= 33) && !defined(NO_VIZ) && defined(QT_VISIBILITY_AVAILABLE)
# define ZLIB_INTERNAL __attribute__((visibility ("hidden")))
#else
diff --git a/src/3rdparty/zlib_dependency.pri b/src/3rdparty/zlib_dependency.pri
index 53e0b3ef39..6ac7e59158 100644
--- a/src/3rdparty/zlib_dependency.pri
+++ b/src/3rdparty/zlib_dependency.pri
@@ -1,10 +1,6 @@
# zlib dependency satisfied by bundled 3rd party zlib or system zlib
-contains(QT_CONFIG, system-zlib) {
- if(unix|mingw):LIBS_PRIVATE += -lz
- else {
- isEmpty(ZLIB_LIBS): LIBS += zdll.lib
- else: LIBS += $$ZLIB_LIBS
- }
+qtConfig(system-zlib) {
+ QMAKE_USE_PRIVATE += zlib
} else {
INCLUDEPATH += $$PWD/zlib
!no_core_dep {
diff --git a/src/android/jar/src/org/qtproject/qt5/android/CursorHandle.java b/src/android/jar/src/org/qtproject/qt5/android/CursorHandle.java
new file mode 100644
index 0000000000..7d26b8fa04
--- /dev/null
+++ b/src/android/jar/src/org/qtproject/qt5/android/CursorHandle.java
@@ -0,0 +1,205 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 Olivier Goffart <ogoffart@woboq.com>
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Android port 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$
+**
+****************************************************************************/
+
+package org.qtproject.qt5.android;
+
+import android.content.Context;
+import android.os.Bundle;
+import android.util.DisplayMetrics;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.widget.LinearLayout;
+import android.widget.ImageView;
+import android.content.res.TypedArray;
+import android.graphics.drawable.Drawable;
+import android.view.MotionEvent;
+import android.widget.PopupWindow;
+import android.app.Activity;
+import android.view.ViewTreeObserver;
+
+/* This view represents one of the handle (selection or cursor handle) */
+class CursorView extends ImageView
+{
+ private CursorHandle mHandle;
+ // The coordinare which where clicked
+ private int m_offsetX;
+ private int m_offsetY;
+
+ CursorView (Context context, CursorHandle handle) {
+ super(context);
+ mHandle = handle;
+ }
+
+ // Called when the handle was moved programatically , with the delta amount in pixels
+ public void adjusted(int dx, int dy) {
+ m_offsetX += dx;
+ m_offsetY += dy;
+ }
+
+ @Override
+ public boolean onTouchEvent(MotionEvent ev) {
+ switch (ev.getActionMasked()) {
+ case MotionEvent.ACTION_DOWN: {
+ m_offsetX = Math.round(ev.getRawX());
+ m_offsetY = Math.round(ev.getRawY());
+ break;
+ }
+
+ case MotionEvent.ACTION_MOVE: {
+ mHandle.updatePosition(Math.round(ev.getRawX()) - m_offsetX,
+ Math.round(ev.getRawY()) - m_offsetY);
+ break;
+ }
+
+ case MotionEvent.ACTION_UP:
+ break;
+
+ case MotionEvent.ACTION_CANCEL:
+ break;
+ }
+ return true;
+ }
+
+}
+
+// Helper class that manages a cursor or selection handle
+public class CursorHandle implements ViewTreeObserver.OnPreDrawListener
+{
+ private View m_layout = null;
+ private CursorView m_cursorView = null;
+ private PopupWindow m_popup = null;
+ private int m_id;
+ private int m_attr;
+ private Activity m_activity;
+ private int m_posX;
+ private int m_posY;
+ private int m_lastX;
+ private int m_lastY;
+ int tolerance;
+
+ public CursorHandle(Activity activity, View layout, int id, int attr) {
+ m_activity = activity;
+ m_id = id;
+ m_attr = attr;
+ m_layout = layout;
+ DisplayMetrics metrics = new DisplayMetrics();
+ activity.getWindowManager().getDefaultDisplay().getMetrics(metrics);
+ tolerance = Math.round(2 * metrics.density);
+ m_lastX = m_lastY = -1 - tolerance;
+ }
+
+ private boolean initOverlay(){
+ if (m_popup == null){
+
+ Context context = m_layout.getContext();
+ int[] attrs = {m_attr};
+ TypedArray a = context.getTheme().obtainStyledAttributes(attrs);
+ Drawable drawable = a.getDrawable(0);
+
+ m_cursorView = new CursorView(context, this);
+ m_cursorView.setImageDrawable(drawable);
+ // m_layout.addView(m_cursorView);
+
+ m_popup = new PopupWindow(context, null, android.R.attr.textSelectHandleWindowStyle);
+ m_popup.setSplitTouchEnabled(true);
+ m_popup.setClippingEnabled(false);
+ m_popup.setContentView(m_cursorView);
+ m_popup.setWidth(drawable.getIntrinsicWidth());
+ m_popup.setHeight(drawable.getIntrinsicHeight());
+
+ m_layout.getViewTreeObserver().addOnPreDrawListener(this);
+ }
+ return true;
+ }
+
+ // Show the handle at a given position (or move it if it is already shown)
+ public void setPosition(final int x, final int y){
+ initOverlay();
+
+ final int[] location = new int[2];
+ m_layout.getLocationOnScreen(location);
+
+ int x2 = x + location[0];
+ int y2 = y + location[1];
+
+ if (m_id == QtNative.IdCursorHandle) {
+ x2 -= m_cursorView.getWidth() / 2 ;
+ } else if (m_id == QtNative.IdLeftHandle) {
+ x2 -= m_cursorView.getWidth() * 3 / 4;
+ } else if (m_id == QtNative.IdRightHandle) {
+ x2 -= m_cursorView.getWidth() / 4;
+ }
+
+ if (m_popup.isShowing()) {
+ m_popup.update(x2, y2, -1, -1);
+ m_cursorView.adjusted(x - m_posX, y - m_posY);
+ } else {
+ m_popup.showAtLocation(m_layout, 0, x2, y2);
+ }
+
+ m_posX = x;
+ m_posY = y;
+ }
+
+ public void hide() {
+ if (m_popup != null) {
+ m_popup.dismiss();
+ }
+ }
+
+ // The handle was dragged by a given relative position
+ public void updatePosition(int x, int y) {
+ if (Math.abs(m_lastX - x) > tolerance || Math.abs(m_lastY - y) > tolerance) {
+ QtNative.handleLocationChanged(m_id, x + m_posX, y + m_posY);
+ m_lastX = x;
+ m_lastY = y;
+ }
+ }
+
+ @Override
+ public boolean onPreDraw() {
+ // This hook is called when the view location is changed
+ // For example if the keyboard appears.
+ // Adjust the position of the handle accordingly
+ if (m_popup != null && m_popup.isShowing())
+ setPosition(m_posX, m_posY);
+
+ return true;
+ }
+}
diff --git a/src/android/jar/src/org/qtproject/qt5/android/EditMenu.java b/src/android/jar/src/org/qtproject/qt5/android/EditMenu.java
new file mode 100644
index 0000000000..afe7797914
--- /dev/null
+++ b/src/android/jar/src/org/qtproject/qt5/android/EditMenu.java
@@ -0,0 +1,142 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 Olivier Goffart <ogoffart@woboq.com>
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Android port 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$
+**
+****************************************************************************/
+
+package org.qtproject.qt5.android;
+
+import android.view.ActionMode;
+import android.view.ActionMode.Callback;
+import android.view.Menu;
+import android.view.MenuItem;
+import android.app.Activity;
+import android.content.Context;
+import android.content.res.TypedArray;
+
+/**
+ * The edit menu actions (when there is selection)
+ */
+class EditMenu implements ActionMode.Callback {
+
+ private final Activity m_activity;
+ private ActionMode m_actionMode;
+
+ public EditMenu(Activity activity) {
+ m_activity = activity;
+ }
+
+ @Override
+ public boolean onCreateActionMode(ActionMode mode, Menu menu) {
+ mode.setTitle(null);
+ mode.setSubtitle(null);
+ mode.setTitleOptionalHint(true);
+
+ Context context = m_activity;
+ int[] attrs = {
+ android.R.attr.actionModeSelectAllDrawable, android.R.attr.actionModeCutDrawable,
+ android.R.attr.actionModeCopyDrawable, android.R.attr.actionModePasteDrawable
+ };
+ TypedArray a = context.getTheme().obtainStyledAttributes(attrs);
+
+ menu.add(Menu.NONE, android.R.id.selectAll, Menu.NONE, android.R.string.selectAll)
+ .setIcon(a.getResourceId(0, 0))
+ .setAlphabeticShortcut('a')
+ .setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS | MenuItem.SHOW_AS_ACTION_WITH_TEXT);
+
+ menu.add(Menu.NONE, android.R.id.cut, Menu.NONE, android.R.string.cut)
+ .setIcon(a.getResourceId(1, 0))
+ .setAlphabeticShortcut('x')
+ .setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS | MenuItem.SHOW_AS_ACTION_WITH_TEXT);
+
+ menu.add(Menu.NONE, android.R.id.copy, Menu.NONE, android.R.string.copy)
+ .setIcon(a.getResourceId(2, 0))
+ .setAlphabeticShortcut('c')
+ .setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS | MenuItem.SHOW_AS_ACTION_WITH_TEXT);
+
+ menu.add(Menu.NONE, android.R.id.paste, Menu.NONE, android.R.string.paste)
+ .setIcon(a.getResourceId(3, 0))
+ .setAlphabeticShortcut('v')
+ .setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS | MenuItem.SHOW_AS_ACTION_WITH_TEXT);
+
+ return true;
+ }
+
+ @Override
+ public boolean onPrepareActionMode(ActionMode mode, Menu menu) {
+ return true;
+ }
+
+ @Override
+ public void onDestroyActionMode(ActionMode mode) {
+ m_actionMode = null;
+ }
+
+ @Override
+ public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
+
+ switch (item.getItemId()) {
+ case android.R.id.cut:
+ return QtNativeInputConnection.cut();
+ case android.R.id.copy:
+ return QtNativeInputConnection.copy();
+ case android.R.id.paste:
+ return QtNativeInputConnection.paste();
+ case android.R.id.selectAll:
+ return QtNativeInputConnection.selectAll();
+ }
+ return false;
+ }
+
+ public void hide()
+ {
+ if (m_actionMode != null) {
+ m_actionMode.finish();
+ }
+ }
+
+ public void show()
+ {
+ if (m_actionMode == null) {
+ m_actionMode = m_activity.startActionMode(this);
+ }
+ }
+
+ public boolean isShown()
+ {
+ return m_actionMode != null;
+ }
+}
diff --git a/src/android/jar/src/org/qtproject/qt5/android/EditPopupMenu.java b/src/android/jar/src/org/qtproject/qt5/android/EditPopupMenu.java
new file mode 100644
index 0000000000..246be1aeb2
--- /dev/null
+++ b/src/android/jar/src/org/qtproject/qt5/android/EditPopupMenu.java
@@ -0,0 +1,155 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 Olivier Goffart <ogoffart@woboq.com>
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Android port 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$
+**
+****************************************************************************/
+
+package org.qtproject.qt5.android;
+
+import android.content.Context;
+import android.os.Bundle;
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.widget.LinearLayout;
+import android.widget.ImageView;
+import android.content.res.TypedArray;
+import android.graphics.drawable.Drawable;
+import android.view.MotionEvent;
+import android.widget.PopupWindow;
+import android.app.Activity;
+import android.view.ViewTreeObserver;
+import android.view.View.OnClickListener;
+import android.view.ViewGroup.LayoutParams;
+import android.view.ViewGroup;
+
+// Helper class that manages a cursor or selection handle
+public class EditPopupMenu implements ViewTreeObserver.OnPreDrawListener, OnClickListener
+{
+ private View m_layout = null;
+ private View m_view = null;
+ private PopupWindow m_popup = null;
+ private Activity m_activity;
+ private int m_posX;
+ private int m_posY;
+
+ public EditPopupMenu(Activity activity, View layout) {
+ m_activity = activity;
+ m_layout = layout;
+ }
+
+ private boolean initOverlay(){
+ if (m_popup == null){
+ Context context = m_layout.getContext();
+ int[] attrs = { android.R.attr.textEditPasteWindowLayout };
+ TypedArray a = context.getTheme().obtainStyledAttributes(attrs);
+ final int layout = a.getResourceId(0, 0);
+ LayoutInflater inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+ m_view = inflater.inflate(layout, null);
+
+ final int size = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED);
+ m_view.setLayoutParams(new LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,
+ ViewGroup.LayoutParams.WRAP_CONTENT));
+ m_view.measure(size, size);
+ m_view.setOnClickListener(this);
+
+ m_popup = new PopupWindow(context, null, android.R.attr.textSelectHandleWindowStyle);
+ m_popup.setSplitTouchEnabled(true);
+ m_popup.setClippingEnabled(false);
+ m_popup.setContentView(m_view);
+ m_popup.setWidth(ViewGroup.LayoutParams.WRAP_CONTENT);
+ m_popup.setHeight(ViewGroup.LayoutParams.WRAP_CONTENT);
+
+ m_layout.getViewTreeObserver().addOnPreDrawListener(this);
+ }
+ return true;
+ }
+
+ public int getHeight()
+ {
+ initOverlay();
+ return m_view.getHeight();
+ }
+
+ // Show the handle at a given position (or move it if it is already shown)
+ public void setPosition(final int x, final int y){
+ initOverlay();
+
+ final int[] location = new int[2];
+ m_layout.getLocationOnScreen(location);
+
+ int x2 = x + location[0];
+ int y2 = y + location[1];
+
+ x2 -= m_view.getWidth() / 2 ;
+ if (x2 < 0)
+ x2 = 0;
+ y2 -= m_view.getHeight();
+
+ if (m_popup.isShowing())
+ m_popup.update(x2, y2, -1, -1);
+ else
+ m_popup.showAtLocation(m_layout, 0, x2, y2);
+
+ m_posX = x;
+ m_posY = y;
+
+ }
+
+ public void hide() {
+ if (m_popup != null) {
+ m_popup.dismiss();
+ }
+ }
+
+ @Override
+ public boolean onPreDraw() {
+ // This hook is called when the view location is changed
+ // For example if the keyboard appears.
+ // Adjust the position of the handle accordingly
+ if (m_popup != null && m_popup.isShowing())
+ setPosition(m_posX, m_posY);
+
+ return true;
+ }
+
+ @Override
+ public void onClick(View v) {
+ QtNativeInputConnection.paste();
+ hide();
+ }
+}
+
diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java b/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java
index 656dbdda45..b602cabd27 100644
--- a/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java
+++ b/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java
@@ -2,6 +2,7 @@
**
** Copyright (C) 2014 BogDan Vatra <bogdan@kde.org>
** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2016 Olivier Goffart <ogoffart@woboq.com>
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Android port of the Qt Toolkit.
@@ -143,6 +144,11 @@ public class QtActivityDelegate
private int m_portraitKeyboardHeight = 0;
private int m_landscapeKeyboardHeight = 0;
private int m_probeKeyboardHeightDelay = 50; // ms
+ private CursorHandle m_cursorHandle;
+ private CursorHandle m_leftSelectionHandle;
+ private CursorHandle m_rightSelectionHandle;
+ private EditMenu m_editMenu;
+ private EditPopupMenu m_editPopupMenu;
public void setFullScreen(boolean enterFullScreen)
{
@@ -470,6 +476,72 @@ public class QtActivityDelegate
m_imm.updateSelection(m_editText, selStart, selEnd, candidatesStart, candidatesEnd);
}
+ // Values coming from QAndroidInputContext::CursorHandleShowMode
+ private static final int CursorHandleNotShown = 0;
+ private static final int CursorHandleShowNormal = 1;
+ private static final int CursorHandleShowSelection = 2;
+ private static final int CursorHandleShowPopup = 3;
+
+ /* called from the C++ code when the position of the cursor or selection handles needs to
+ be adjusted.
+ mode is one of QAndroidInputContext::CursorHandleShowMode
+ */
+ public void updateHandles(int mode, int x1, int y1, int x2, int y2)
+ {
+ if (mode == CursorHandleNotShown) {
+ if (m_cursorHandle != null)
+ m_cursorHandle.hide();
+ if (m_rightSelectionHandle != null) {
+ m_rightSelectionHandle.hide();
+ m_leftSelectionHandle.hide();
+ }
+ if (m_editMenu != null)
+ m_editMenu.hide();
+ if (m_editPopupMenu != null)
+ m_editPopupMenu.hide();
+ } else if (mode == CursorHandleShowNormal || mode == CursorHandleShowPopup) {
+ if (m_cursorHandle == null) {
+ m_cursorHandle = new CursorHandle(m_activity, m_layout, QtNative.IdCursorHandle,
+ android.R.attr.textSelectHandle);
+ }
+ m_cursorHandle.setPosition(x1, y1);
+ if (m_rightSelectionHandle != null) {
+ m_rightSelectionHandle.hide();
+ m_leftSelectionHandle.hide();
+ }
+ } else if (mode == CursorHandleShowSelection) {
+ if (m_rightSelectionHandle == null) {
+ m_leftSelectionHandle = new CursorHandle(m_activity, m_layout, QtNative.IdLeftHandle,
+ android.R.attr.textSelectHandleLeft);
+ m_rightSelectionHandle = new CursorHandle(m_activity, m_layout, QtNative.IdRightHandle,
+ android.R.attr.textSelectHandleRight);
+ }
+ m_leftSelectionHandle.setPosition(x1,y1);
+ m_rightSelectionHandle.setPosition(x2,y2);
+ if (m_cursorHandle != null)
+ m_cursorHandle.hide();
+
+ if (m_editMenu == null)
+ m_editMenu = new EditMenu(m_activity);
+ m_editMenu.show();
+ }
+
+ // show the edit popup menu
+ if (mode == CursorHandleShowPopup && (m_editMenu == null || !m_editMenu.isShown())
+ && QtNative.hasClipboardText()) {
+ if (m_editPopupMenu == null)
+ m_editPopupMenu = new EditPopupMenu(m_activity, m_layout);
+ if (y2 < m_editPopupMenu.getHeight()) {
+ // If the popup cannot be shown over the text, it must be shown under the anchors
+ y2 = y1 + 2 * m_editPopupMenu.getHeight();
+ }
+ m_editPopupMenu.setPosition(x2, y2);
+ } else if (m_editPopupMenu != null) {
+ m_editPopupMenu.hide();
+ }
+
+ }
+
public boolean loadApplication(Activity activity, ClassLoader classLoader, Bundle loaderParams)
{
/// check parameters integrity
diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtNative.java b/src/android/jar/src/org/qtproject/qt5/android/QtNative.java
index 04b8e6a06f..4df2cb88c9 100644
--- a/src/android/jar/src/org/qtproject/qt5/android/QtNative.java
+++ b/src/android/jar/src/org/qtproject/qt5/android/QtNative.java
@@ -492,6 +492,20 @@ public class QtNative
});
}
+ private static void updateHandles(final int mode,
+ final int x1,
+ final int y1,
+ final int x2,
+ final int y2)
+ {
+ runAction(new Runnable() {
+ @Override
+ public void run() {
+ m_activityDelegate.updateHandles(mode, x1, y1, x2, y2);
+ }
+ });
+ }
+
private static void showSoftwareKeyboard(final int x,
final int y,
final int width,
@@ -569,7 +583,7 @@ public class QtNative
m_clipboardManager.setText(text);
}
- private static boolean hasClipboardText()
+ public static boolean hasClipboardText()
{
if (m_clipboardManager != null)
return m_clipboardManager.hasText();
@@ -777,6 +791,13 @@ public class QtNative
public static native void keyboardGeometryChanged(int x, int y, int width, int height);
// keyboard methods
+ // handle methods
+ public static final int IdCursorHandle = 1;
+ public static final int IdLeftHandle = 2;
+ public static final int IdRightHandle = 3;
+ public static native void handleLocationChanged(int id, int x, int y);
+ // handle methods
+
// dispatch events methods
public static native boolean dispatchGenericMotionEvent(MotionEvent ev);
public static native boolean dispatchKeyEvent(KeyEvent event);
diff --git a/src/angle/src/common/common.pri b/src/angle/src/common/common.pri
index 9eae06d410..c948e27dc3 100644
--- a/src/angle/src/common/common.pri
+++ b/src/angle/src/common/common.pri
@@ -1,5 +1,5 @@
# static builds should still link ANGLE dynamically when dynamic GL is enabled
-static:contains(QT_CONFIG, dynamicgl) {
+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 cbf411623d..f9170b3bee 100644
--- a/src/angle/src/compiler/preprocessor/preprocessor.pro
+++ b/src/angle/src/compiler/preprocessor/preprocessor.pro
@@ -1,5 +1,5 @@
CONFIG += static
-contains(QT_CONFIG, dynamicgl): CONFIG += not_installed
+qtConfig(dynamicgl): CONFIG += not_installed
include(../../config.pri)
INCLUDEPATH = $$ANGLE_DIR/src/compiler/preprocessor
diff --git a/src/angle/src/compiler/translator.pro b/src/angle/src/compiler/translator.pro
index d48ac70472..cee13d06bb 100644
--- a/src/angle/src/compiler/translator.pro
+++ b/src/angle/src/compiler/translator.pro
@@ -1,5 +1,5 @@
CONFIG += static
-contains(QT_CONFIG, dynamicgl): CONFIG += not_installed
+qtConfig(dynamicgl): CONFIG += not_installed
include(../config.pri)
INCLUDEPATH += \
diff --git a/src/concurrent/concurrent.pro b/src/concurrent/concurrent.pro
index fd15a3c758..337f4042bd 100644
--- a/src/concurrent/concurrent.pro
+++ b/src/concurrent/concurrent.pro
@@ -37,7 +37,7 @@ HEADERS += \
# private headers
HEADERS += \
-contains(QT_CONFIG, clock-gettime) {
+qtConfig(clock-gettime) {
linux-*|hpux-*|solaris-*: LIBS_PRIVATE *= -lrt
}
diff --git a/src/corelib/Qt5CoreConfigExtras.cmake.in b/src/corelib/Qt5CoreConfigExtras.cmake.in
index a5ed8b2ea3..545b9a3d1e 100644
--- a/src/corelib/Qt5CoreConfigExtras.cmake.in
+++ b/src/corelib/Qt5CoreConfigExtras.cmake.in
@@ -116,7 +116,7 @@ set_property(TARGET Qt5::Core APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS $<$<
set_property(TARGET Qt5::Core PROPERTY INTERFACE_COMPILE_FEATURES cxx_decltype)
-!!IF contains(QT_CONFIG, reduce_exports)
+!!IF qtConfig(reduce_exports)
set(QT_VISIBILITY_AVAILABLE \"True\")
!!ENDIF
diff --git a/src/corelib/arch/arch.pri b/src/corelib/arch/arch.pri
index 0f7c2b887b..b628bcc6ec 100644
--- a/src/corelib/arch/arch.pri
+++ b/src/corelib/arch/arch.pri
@@ -4,4 +4,4 @@ HEADERS += \
arch/qatomic_bootstrap.h \
arch/qatomic_cxx11.h
-atomic64-libatomic: LIBS += -latomic
+qtConfig(libatomic): QMAKE_USE += libatomic
diff --git a/src/corelib/codecs/codecs.pri b/src/corelib/codecs/codecs.pri
index fdaec33c5a..4fa778d042 100644
--- a/src/corelib/codecs/codecs.pri
+++ b/src/corelib/codecs/codecs.pri
@@ -17,7 +17,7 @@ SOURCES += \
codecs/qtsciicodec.cpp \
codecs/qutfcodec.cpp
-contains(QT_CONFIG,icu) {
+qtConfig(icu) {
HEADERS += \
codecs/qicucodec_p.h
SOURCES += \
@@ -40,20 +40,17 @@ contains(QT_CONFIG,icu) {
codecs/qeuckrcodec.cpp \
codecs/qbig5codec.cpp
- unix:!qnx:!darwin:!linux-android-* {
- contains(QT_CONFIG, iconv) {
- HEADERS += codecs/qiconvcodec_p.h
- SOURCES += codecs/qiconvcodec.cpp
- contains(QT_CONFIG, gnu-libiconv) {
- DEFINES += GNU_LIBICONV
- LIBS_PRIVATE *= -liconv
- } else: contains(QT_CONFIG, sun-libiconv) {
- DEFINES += GNU_LIBICONV
- }
+ qtConfig(iconv) {
+ HEADERS += codecs/qiconvcodec_p.h
+ SOURCES += codecs/qiconvcodec.cpp
+ qtConfig(gnu-libiconv) {
+ DEFINES += GNU_LIBICONV
+ QMAKE_USE_PRIVATE += iconv
+ } else: qtConfig(sun-libiconv) {
+ DEFINES += GNU_LIBICONV
}
- } else:!win32-msvc* {
- DEFINES += QT_NO_ICONV
}
+
win32 {
SOURCES += codecs/qwindowscodec.cpp
HEADERS += codecs/qwindowscodec_p.h
diff --git a/src/corelib/doc/src/qtcore-index.qdoc b/src/corelib/doc/src/qtcore-index.qdoc
index e2fce5797d..fe9b43507c 100644
--- a/src/corelib/doc/src/qtcore-index.qdoc
+++ b/src/corelib/doc/src/qtcore-index.qdoc
@@ -101,7 +101,19 @@
\li \l{The Event System}
\endlist
- \section1 Related Information
+ \section1 Licenses and Attributions
+
+ Qt Core is available under commercial licenses from \l{The Qt Company}.
+ In addition, it is available under the
+ \l{GNU Lesser General Public License, version 3}, or
+ the \l{GNU General Public License, version 2}.
+ See \l{Qt Licensing} for further details.
+
+ Furthermore Qt Core potentially contains third party
+ modules under following permissive licenses:
+
+ \generatelist{groupsbymodule attributions-qtcore}
+
\section1 Reference
These are links to the API reference materials.
\list
diff --git a/src/corelib/doc/src/resource-system.qdoc b/src/corelib/doc/src/resource-system.qdoc
index 95cf585b61..e32343bb1b 100644
--- a/src/corelib/doc/src/resource-system.qdoc
+++ b/src/corelib/doc/src/resource-system.qdoc
@@ -136,7 +136,7 @@
\image resources.png Building resources into an application
Currently, Qt always stores the data directly in the executable,
- even on Windows, OS X, and iOS, where the operating system provides
+ even on Windows, \macos, and iOS, where the operating system provides
native support for resources. This might change in a future Qt
release.
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index 170dd757d3..284e833f73 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -1071,8 +1071,8 @@ bool qSharedBuild() Q_DECL_NOTHROW
\endlist
Some constants are defined only on certain platforms. You can use
- the preprocessor symbols Q_OS_WIN and Q_OS_OSX to test that
- the application is compiled under Windows or OS X.
+ the preprocessor symbols Q_OS_WIN and Q_OS_MACOS to test that
+ the application is compiled under Windows or \macos.
\sa QLibraryInfo
*/
@@ -1111,7 +1111,7 @@ bool qSharedBuild() Q_DECL_NOTHROW
/*!
\fn QSysInfo::MacVersion QSysInfo::macVersion()
- Returns the version of Darwin (OS X or iOS) on which the
+ Returns the version of Darwin (\macos or iOS) on which the
application is run, or MV_None if the operating system
is not a version of Darwin.
*/
@@ -1179,24 +1179,24 @@ bool qSharedBuild() Q_DECL_NOTHROW
\enum QSysInfo::MacVersion
This enum provides symbolic names for the various versions of the
- Darwin operating system, covering both OS X and iOS. The
+ Darwin operating system, covering both \macos and iOS. The
QSysInfo::MacintoshVersion variable gives the version of the
system on which the application is run.
- \value MV_9 Mac OS 9
- \value MV_10_0 Mac OS X 10.0
- \value MV_10_1 Mac OS X 10.1
- \value MV_10_2 Mac OS X 10.2
- \value MV_10_3 Mac OS X 10.3
- \value MV_10_4 Mac OS X 10.4
- \value MV_10_5 Mac OS X 10.5
- \value MV_10_6 Mac OS X 10.6
- \value MV_10_7 Mac OS X 10.7
- \value MV_10_8 OS X 10.8
- \value MV_10_9 OS X 10.9
- \value MV_10_10 OS X 10.10
- \value MV_10_11 OS X 10.11
- \value MV_10_12 macOS 10.12
+ \value MV_9 \macos 9
+ \value MV_10_0 \macos 10.0
+ \value MV_10_1 \macos 10.1
+ \value MV_10_2 \macos 10.2
+ \value MV_10_3 \macos 10.3
+ \value MV_10_4 \macos 10.4
+ \value MV_10_5 \macos 10.5
+ \value MV_10_6 \macos 10.6
+ \value MV_10_7 \macos 10.7
+ \value MV_10_8 \macos 10.8
+ \value MV_10_9 \macos 10.9
+ \value MV_10_10 \macos 10.10
+ \value MV_10_11 \macos 10.11
+ \value MV_10_12 \macos 10.12
\value MV_Unknown An unknown and currently unsupported platform
\value MV_CHEETAH Apple codename for MV_10_0
@@ -1247,7 +1247,7 @@ bool qSharedBuild() Q_DECL_NOTHROW
\macro Q_OS_DARWIN
\relates <QtGlobal>
- Defined on Darwin-based operating systems such as macOS, iOS, watchOS, and tvOS.
+ Defined on Darwin-based operating systems such as \macOS, iOS, watchOS, and tvOS.
*/
/*!
@@ -1268,7 +1268,7 @@ bool qSharedBuild() Q_DECL_NOTHROW
\macro Q_OS_MACOS
\relates <QtGlobal>
- Defined on macOS.
+ Defined on \macos.
*/
/*!
@@ -1946,6 +1946,8 @@ QSysInfo::MacVersion QSysInfo::macVersion()
return QSysInfo::MacVersion(Q_MV_IOS(version.major, version.minor));
#elif defined(Q_OS_TVOS)
return QSysInfo::MacVersion(Q_MV_TVOS(version.major, version.minor));
+#elif defined(Q_OS_WATCHOS)
+ return QSysInfo::MacVersion(Q_MV_WATCHOS(version.major, version.minor));
#else
return QSysInfo::MV_Unknown;
#endif
@@ -2568,7 +2570,7 @@ static QString unknownText()
Note that this function may return surprising values: it returns "linux"
for all operating systems running Linux (including Android), "qnx" for all
operating systems running QNX, "freebsd" for
- Debian/kFreeBSD, and "darwin" for OS X and iOS. For information on the type
+ Debian/kFreeBSD, and "darwin" for \macos and iOS. For information on the type
of product the application is running on, see productType().
\sa QFileSelector, kernelVersion(), productType(), productVersion(), prettyProductName()
@@ -2590,7 +2592,7 @@ QString QSysInfo::kernelType()
Returns the release version of the operating system kernel. On Windows, it
returns the version of the NT kernel. On Unix systems, including
- Android and OS X, it returns the same as the \c{uname -r}
+ Android and \macos, it returns the same as the \c{uname -r}
command would return.
If the version could not be determined, this function may return an empty
@@ -2631,11 +2633,12 @@ QString QSysInfo::kernelVersion()
to determine the distribution name and returns that. If determining the
distribution name failed, it returns "unknown".
- \b{Darwin, macOS, iOS and tvOS note}: this function returns "macos" for macOS
- systems, "ios" for iOS systems, "tvos" for tvOS systems and "darwin" in case
- the system could not be determined.
+ \b{Darwin, \macos, iOS, tvOS, and watchOS note}: this function returns
+ "macos" for \macos systems, "ios" for iOS systems, "tvos" for tvOS systems,
+ "watchos" for watchOS systems, and "darwin" in case the system could not
+ be determined.
- \b{OS X note}: this function returns "osx" for versions of macOS prior to 10.12.
+ \b{OS X note}: this function returns "osx" for versions of \macos prior to 10.12.
\b{FreeBSD note}: this function returns "debian" for Debian/kFreeBSD and
"unknown" otherwise.
@@ -2667,6 +2670,8 @@ QString QSysInfo::productType()
return QStringLiteral("ios");
#elif defined(Q_OS_TVOS)
return QStringLiteral("tvos");
+#elif defined(Q_OS_WATCHOS)
+ return QStringLiteral("watchos");
#elif defined(Q_OS_MACOS)
const QAppleOperatingSystemVersion version = qt_apple_os_version();
if (version.major == 10 && version.minor < 12)
@@ -2690,7 +2695,7 @@ QString QSysInfo::productType()
Returns the product version of the operating system in string form. If the
version could not be determined, this function returns "unknown".
- It will return the Android, iOS, OS X, Windows full-product
+ It will return the Android, iOS, \macos, Windows full-product
versions on those systems. In particular, on OS X, iOS and Windows, the
returned string is similar to the macVersion() or windowsVersion() enums.
@@ -2754,6 +2759,8 @@ QString QSysInfo::prettyProductName()
return QLatin1String("iOS ") + productVersion();
#elif defined(Q_OS_TVOS)
return QLatin1String("tvOS ") + productVersion();
+#elif defined(Q_OS_WATCHOS)
+ return QLatin1String("watchOS ") + productVersion();
#elif defined(Q_OS_MACOS)
const QAppleOperatingSystemVersion version = qt_apple_os_version();
const char *name = osxVer_helper(version);
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index c5d891cc28..e6d65b0f99 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -56,19 +56,29 @@
*/
#define QT_VERSION_CHECK(major, minor, patch) ((major<<16)|(minor<<8)|(patch))
-#if !defined(QT_BUILD_QMAKE) && !defined(QT_BUILD_CONFIGURE)
+#ifndef QT_BOOTSTRAPPED
#include <QtCore/qconfig.h>
#include <QtCore/qfeatures.h>
#endif
// The QT_SUPPORTS macro is deprecated. Don't use it in new code.
-// Instead, use #ifdef/ndef QT_NO_feature.
+// Instead, use QT_CONFIG(feature)
// ### Qt6: remove macro
#ifdef _MSC_VER
# define QT_SUPPORTS(FEATURE) (!defined QT_NO_##FEATURE)
#else
# define QT_SUPPORTS(FEATURE) (!defined(QT_NO_##FEATURE))
#endif
+
+/*
+ The QT_CONFIG macro implements a safe compile time check for features of Qt.
+ Features can be in three states:
+ 0 or undefined: This will lead to a compile error when testing for it
+ -1: The feature is not available
+ 1: The feature is available
+*/
+#define QT_CONFIG(feature) (1/QT_FEATURE_##feature == 1)
+
#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
# define QT_NO_UNSHARABLE_CONTAINERS
#endif
@@ -538,6 +548,12 @@ Q_DECL_CONSTEXPR inline const T &qBound(const T &min, const T &val, const T &max
#ifndef Q_FORWARD_DECLARE_MUTABLE_CF_TYPE
# define Q_FORWARD_DECLARE_MUTABLE_CF_TYPE(type) typedef struct __ ## type * type ## Ref
#endif
+#ifndef Q_FORWARD_DECLARE_CG_TYPE
+#define Q_FORWARD_DECLARE_CG_TYPE(type) typedef const struct type *type ## Ref;
+#endif
+#ifndef Q_FORWARD_DECLARE_MUTABLE_CG_TYPE
+#define Q_FORWARD_DECLARE_MUTABLE_CG_TYPE(type) typedef struct type *type ## Ref;
+#endif
#ifdef Q_OS_DARWIN
# define QT_DARWIN_PLATFORM_SDK_EQUAL_OR_ABOVE(macos, ios, tvos, watchos) \
diff --git a/src/corelib/global/qglobal_p.h b/src/corelib/global/qglobal_p.h
index e8d822b6c6..e75d87b384 100644
--- a/src/corelib/global/qglobal_p.h
+++ b/src/corelib/global/qglobal_p.h
@@ -48,5 +48,14 @@
#include "qglobal.h"
#include "qglobal_p.h" // include self to avoid syncqt warning - no-op
+#ifndef QT_BOOTSTRAPPED
+#include <QtCore/private/qconfig_p.h>
+#endif
+
+#define QT_LIBRARY_VERSION(lib) QT_LIBRARY_VERSION_##lib
+#define QT_LIBRARY_VERSION_MAJOR(lib) (QT_LIBRARY_VERSION_##lib >> 16)
+#define QT_LIBRARY_VERSION_MINOR(lib) ((QT_LIBRARY_VERSION_##lib >> 8) & 0xff)
+#define QT_LIBRARY_VERSION_PATCH(lib) (QT_LIBRARY_VERSION_##lib & 0xff)
+
#endif // QGLOBAL_P_H
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc
index d8a0acabf1..bf55693e8a 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -111,7 +111,7 @@
shown in any menus unless specifically set by the
QAction::iconVisibleInMenu property.
Menus that are currently open or menus already created in the native
- OS X menubar \e{may not} pick up a change in this attribute. Changes
+ \macos menubar \e{may not} pick up a change in this attribute. Changes
in the QAction::iconVisibleInMenu property will always be picked up.
\value AA_NativeWindows Ensures that widgets have native windows.
@@ -137,9 +137,9 @@
\value AA_DontUseNativeMenuBar All menubars created while this attribute is
set to true won't be used as a native menubar (e.g, the menubar at
- the top of the main screen on OS X or at the bottom in Windows CE).
+ the top of the main screen on \macos or at the bottom in Windows CE).
- \value AA_MacDontSwapCtrlAndMeta On OS X by default, Qt swaps the
+ \value AA_MacDontSwapCtrlAndMeta On \macos by default, Qt swaps the
Control and Meta (Command) keys (i.e., whenever Control is pressed, Qt
sends Meta, and whenever Meta is pressed Control is sent). When this
attribute is true, Qt will not do the flip. \l QKeySequence::StandardKey
@@ -357,7 +357,7 @@
\omitvalue KeyboardModifierMask
- \note On OS X, the \c ControlModifier value corresponds to
+ \note On \macos, the \c ControlModifier value corresponds to
the Command keys on the Macintosh keyboard, and the \c MetaModifier value
corresponds to the Control keys. The \c KeypadModifier value will also be set
when an arrow key is pressed as the arrow keys are considered part of the
@@ -375,7 +375,7 @@
This enum provides shorter names for the keyboard modifier keys
supported by Qt.
- \note On OS X, the \c CTRL value corresponds to
+ \note On \macos, the \c CTRL value corresponds to
the Command keys on the Macintosh keyboard, and the \c META value
corresponds to the Control keys.
@@ -974,34 +974,34 @@
\value WA_MacOpaqueSizeGrip Indicates that the native Carbon size grip
should be opaque instead of transparent (the default). This attribute
- is only applicable to OS X and is set by the widget's author.
+ is only applicable to \macos and is set by the widget's author.
\value WA_MacShowFocusRect Indicates that this widget should get a
QFocusFrame around it. Some widgets draw their own focus halo
regardless of this attribute. Not that the QWidget::focusPolicy
also plays the main role in whether something is given focus or
not, this only controls whether or not this gets the focus
- frame. This attribute is only applicable to OS X.
+ frame. This attribute is only applicable to \macos.
\value WA_MacNormalSize Indicates the widget should have the
- normal size for widgets in OS X. This attribute is only
- applicable to OS X.
+ normal size for widgets in \macos. This attribute is only
+ applicable to \macos.
\value WA_MacSmallSize Indicates the widget should have the small
- size for widgets in OS X. This attribute is only applicable to
- OS X.
+ size for widgets in \macos. This attribute is only applicable to
+ \macos.
\value WA_MacMiniSize Indicates the widget should have the mini
- size for widgets in OS X. This attribute is only applicable to
- OS X.
+ size for widgets in \macos. This attribute is only applicable to
+ \macos.
\value WA_MacVariableSize Indicates the widget can choose between
alternative sizes for widgets to avoid clipping.
- This attribute is only applicable to OS X.
+ This attribute is only applicable to \macos.
\value WA_MacBrushedMetal Indicates the widget should be drawn in
the brushed metal style as supported by the windowing system. This
- attribute is only applicable to OS X.
+ attribute is only applicable to \macos.
\omitvalue WA_MacMetalStyle
@@ -1151,14 +1151,14 @@
\b Warning: This flag must \e never be set or cleared by the widget's author.
\value WA_WindowModified Indicates that the window is marked as modified.
- On some platforms this flag will do nothing, on others (including OS X
+ On some platforms this flag will do nothing, on others (including \macos
and Windows) the window will take a modified appearance. This flag is set
or cleared by QWidget::setWindowModified().
\value WA_WindowPropagation Makes a toplevel window inherit font and
palette from its parent.
- \value WA_MacAlwaysShowToolWindow On OS X, show the tool window even
+ \value WA_MacAlwaysShowToolWindow On \macos, show the tool window even
when the application is not active. By default, all tool windows are
hidden when the application is inactive.
@@ -1341,8 +1341,8 @@
\value Key_PageUp
\value Key_PageDown
\value Key_Shift
- \value Key_Control On OS X, this corresponds to the Command keys.
- \value Key_Meta On OS X, this corresponds to the Control keys.
+ \value Key_Control On \macos, this corresponds to the Command keys.
+ \value Key_Meta On \macos, this corresponds to the Control keys.
On Windows keyboards, this key is mapped to the
Windows key.
\value Key_Alt
@@ -2002,7 +2002,7 @@
\value TabFocus the widget accepts focus by tabbing.
\value ClickFocus the widget accepts focus by clicking.
\value StrongFocus the widget accepts focus by both tabbing
- and clicking. On OS X this will also
+ and clicking. On \macos this will also
be indicate that the widget accepts tab focus
when in 'Text/List focus mode'.
\value WheelFocus like Qt::StrongFocus plus the widget accepts
@@ -2108,7 +2108,7 @@
system supports it, a tool window can be decorated
with a somewhat lighter frame. It can also be
combined with Qt::FramelessWindowHint.
- On OS X, tool windows correspond to the
+ On \macos, tool windows correspond to the
\l{http://developer.apple.com/documentation/Carbon/Conceptual/HandlingWindowsControls/hitb-wind_cont_concept/chapter_2_section_2.html}{Floating}
class of windows. This means that the window lives on a
level above normal windows; it impossible to put a normal
@@ -2197,10 +2197,10 @@
\value WindowContextHelpButtonHint Adds a context help button to dialogs.
On some platforms this implies Qt::WindowSystemMenuHint for it to work.
- \value MacWindowToolBarButtonHint On OS X adds a tool bar button (i.e.,
+ \value MacWindowToolBarButtonHint On \macos adds a tool bar button (i.e.,
the oblong button that is on the top right of windows that have toolbars).
- \value WindowFullscreenButtonHint On OS X adds a fullscreen button.
+ \value WindowFullscreenButtonHint On \macos adds a fullscreen button.
\value BypassGraphicsProxyWidget Prevents the window and its children from
automatically embedding themselves into a QGraphicsProxyWidget if the
@@ -2224,7 +2224,7 @@
that support _NET_WM_STATE_BELOW atom. If a window always
on the bottom has a parent, the parent will also be left on
the bottom. This window hint is currently not implemented
- for OS X.
+ for \macos.
\value WindowTransparentForInput Informs the window system that this window
is used only for output (displaying something) and does not take input.
@@ -3088,7 +3088,7 @@
\value CoarseTimer Coarse timers try to keep accuracy within 5% of the desired interval
\value VeryCoarseTimer Very coarse timers only keep full second accuracy
- On UNIX (including Linux, OS X, and iOS), Qt will keep millisecond accuracy
+ On UNIX (including Linux, \macos, and iOS), Qt will keep millisecond accuracy
for Qt::PreciseTimer. For Qt::CoarseTimer, the interval will be adjusted up
to 5% to align the timer with other timers that are expected to fire at or
around the same time. The objective is to make most timers wake up at the
diff --git a/src/corelib/global/qnumeric_p.h b/src/corelib/global/qnumeric_p.h
index 7d725f617c..ef40a45dc4 100644
--- a/src/corelib/global/qnumeric_p.h
+++ b/src/corelib/global/qnumeric_p.h
@@ -66,8 +66,9 @@
#include <float.h>
#endif
-#if !defined(Q_CC_MSVC) && (defined(Q_OS_QNX) || !defined(__cplusplus) || __cplusplus < 201103L)
-#include <math.h>
+#if !defined(Q_CC_MSVC) && (defined(Q_OS_QNX) || defined(Q_CC_INTEL) || !defined(__cplusplus))
+# include <math.h>
+# define QT_MATH_H_DEFINES_MACROS
QT_BEGIN_NAMESPACE
namespace qnumeric_std_wrapper {
// the 'using namespace std' below is cases where the stdlib already put the math.h functions in the std namespace and undefined the macros.
@@ -96,7 +97,8 @@ static inline bool isfinite(double d) { return !!_finite(d); }
static inline bool isnan(float f) { return !!_isnan(f); }
static inline bool isinf(float f) { return !_finite(f) && !_isnan(f); }
static inline bool isfinite(float f) { return !!_finite(f); }
-#elif !defined(Q_CC_MSVC) && (defined(Q_OS_QNX) || !defined(__cplusplus) || __cplusplus < 201103L)
+#elif defined(QT_MATH_H_DEFINES_MACROS)
+# undef QT_MATH_H_DEFINES_MACROS
static inline bool isnan(double d) { return math_h_isnan(d); }
static inline bool isinf(double d) { return math_h_isinf(d); }
static inline bool isfinite(double d) { return math_h_isfinite(d); }
diff --git a/src/corelib/global/qsysinfo.h b/src/corelib/global/qsysinfo.h
index 31d78bca50..f01b45cbf9 100644
--- a/src/corelib/global/qsysinfo.h
+++ b/src/corelib/global/qsysinfo.h
@@ -122,6 +122,7 @@ public:
#define Q_MV_OSX(major, minor) (major == 10 ? minor + 2 : (major == 9 ? 1 : 0))
#define Q_MV_IOS(major, minor) (QSysInfo::MV_IOS | major << 4 | minor)
#define Q_MV_TVOS(major, minor) (QSysInfo::MV_TVOS | major << 4 | minor)
+#define Q_MV_WATCHOS(major, minor) (QSysInfo::MV_WATCHOS | major << 4 | minor)
enum MacVersion {
MV_None = 0xffff,
MV_Unknown = 0x0000,
@@ -182,7 +183,14 @@ public:
MV_TVOS_9_0 = Q_MV_TVOS(9, 0),
MV_TVOS_9_1 = Q_MV_TVOS(9, 1),
MV_TVOS_9_2 = Q_MV_TVOS(9, 2),
- MV_TVOS_10_0 = Q_MV_TVOS(10, 0)
+ MV_TVOS_10_0 = Q_MV_TVOS(10, 0),
+
+ /* watchOS */
+ MV_WATCHOS = 1 << 10,
+ MV_WATCHOS_2_0 = Q_MV_WATCHOS(2, 0),
+ MV_WATCHOS_2_1 = Q_MV_WATCHOS(2, 1),
+ MV_WATCHOS_2_2 = Q_MV_WATCHOS(2, 2),
+ MV_WATCHOS_3_0 = Q_MV_WATCHOS(3, 0)
};
#if defined(Q_OS_MAC)
static const MacVersion MacintoshVersion;
diff --git a/src/corelib/global/qsystemdetection.h b/src/corelib/global/qsystemdetection.h
index 90954b1eca..3b486b8f6f 100644
--- a/src/corelib/global/qsystemdetection.h
+++ b/src/corelib/global/qsystemdetection.h
@@ -102,17 +102,15 @@
# define Q_OS_DARWIN32
# endif
# if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
+# define QT_PLATFORM_UIKIT
# if defined(TARGET_OS_WATCH) && TARGET_OS_WATCH
# define Q_OS_WATCHOS
+# elif defined(TARGET_OS_TV) && TARGET_OS_TV
+# define Q_OS_TVOS
# else
-# define QT_PLATFORM_UIKIT
-# if defined(TARGET_OS_TV) && TARGET_OS_TV
-# define Q_OS_TVOS
-# else
-# // TARGET_OS_IOS is only available in newer SDKs,
-# // so assume any other iOS-based platform is iOS for now
-# define Q_OS_IOS
-# endif
+# // TARGET_OS_IOS is only available in newer SDKs,
+# // so assume any other iOS-based platform is iOS for now
+# define Q_OS_IOS
# endif
# else
# // TARGET_OS_OSX is only available in newer SDKs,
diff --git a/src/corelib/io/io.pri b/src/corelib/io/io.pri
index ab345e9aae..0414ae966a 100644
--- a/src/corelib/io/io.pri
+++ b/src/corelib/io/io.pri
@@ -135,7 +135,7 @@ win32 {
io/qprocess_unix.cpp \
io/qfilesystemiterator_unix.cpp
- !integrity:!tvos {
+ !integrity:!uikit {
SOURCES += io/forkfd_qt.cpp
HEADERS += \
../3rdparty/forkfd/forkfd.h
@@ -169,7 +169,7 @@ win32 {
io/qstorageinfo_unix.cpp
}
- linux|if(qnx:contains(QT_CONFIG, inotify)) {
+ linux|if(qnx:qtConfig(inotify)) {
SOURCES += io/qfilesystemwatcher_inotify.cpp
HEADERS += io/qfilesystemwatcher_inotify_p.h
}
diff --git a/src/corelib/io/qabstractfileengine.cpp b/src/corelib/io/qabstractfileengine.cpp
index 7e64035b30..9606ec68e9 100644
--- a/src/corelib/io/qabstractfileengine.cpp
+++ b/src/corelib/io/qabstractfileengine.cpp
@@ -305,7 +305,7 @@ QAbstractFileEngine *QAbstractFileEngine::create(const QString &fileName)
the file system (i.e. not a file or directory).
\value FileType The file is a regular file to the file system
(i.e. not a link or directory)
- \value BundleType OS X and iOS: the file is a bundle; implies DirectoryType
+ \value BundleType \macos and iOS: the file is a bundle; implies DirectoryType
\value DirectoryType The file is a directory in the file system
(i.e. not a link or file).
diff --git a/src/corelib/io/qdebug.h b/src/corelib/io/qdebug.h
index 8021f29e16..abc2abeaec 100644
--- a/src/corelib/io/qdebug.h
+++ b/src/corelib/io/qdebug.h
@@ -438,8 +438,8 @@ inline QDebug operator<<(QDebug debug, const QFlags<T> &flags)
#define QT_FORWARD_DECLARE_CF_TYPE(type) Q_FORWARD_DECLARE_CF_TYPE(type);
#define QT_FORWARD_DECLARE_MUTABLE_CF_TYPE(type) Q_FORWARD_DECLARE_MUTABLE_CF_TYPE(type);
-#define QT_FORWARD_DECLARE_CG_TYPE(type) typedef const struct type *type ## Ref;
-#define QT_FORWARD_DECLARE_MUTABLE_CG_TYPE(type) typedef struct type *type ## Ref;
+#define QT_FORWARD_DECLARE_CG_TYPE(type) Q_FORWARD_DECLARE_CG_TYPE(type);
+#define QT_FORWARD_DECLARE_MUTABLE_CG_TYPE(type) Q_FORWARD_DECLARE_MUTABLE_CG_TYPE(type);
QT_END_NAMESPACE
Q_FORWARD_DECLARE_CF_TYPE(CFString);
diff --git a/src/corelib/io/qfileinfo.cpp b/src/corelib/io/qfileinfo.cpp
index 6366c5120c..8b9efb638a 100644
--- a/src/corelib/io/qfileinfo.cpp
+++ b/src/corelib/io/qfileinfo.cpp
@@ -240,7 +240,7 @@ QDateTime &QFileInfoPrivate::getFileTime(QAbstractFileEngine::FileTime request)
isSymLink(). The symLinkTarget() function provides the name of the file
the symlink points to.
- On Unix (including OS X and iOS), the symlink has the same size() has
+ On Unix (including \macos and iOS), the symlink has the same size() has
the file it points to, because Unix handles symlinks
transparently; similarly, opening a symlink using QFile
effectively opens the link's target. For example:
@@ -760,7 +760,7 @@ QString QFileInfo::fileName() const
\since 4.3
Returns the name of the bundle.
- On OS X and iOS this returns the proper localized name for a bundle if the
+ On \macos and iOS this returns the proper localized name for a bundle if the
path isBundle(). On all other platforms an empty QString is returned.
Example:
@@ -1042,7 +1042,7 @@ bool QFileInfo::isDir() const
/*!
\since 4.3
Returns \c true if this object points to a bundle or to a symbolic
- link to a bundle on OS X and iOS; otherwise returns \c false.
+ link to a bundle on \macos and iOS; otherwise returns \c false.
\sa isDir(), isSymLink(), isFile()
*/
@@ -1063,7 +1063,7 @@ bool QFileInfo::isBundle() const
Returns \c true if this object points to a symbolic link (or to a
shortcut on Windows); otherwise returns \c false.
- On Unix (including OS X and iOS), opening a symlink effectively opens
+ On Unix (including \macos and iOS), opening a symlink effectively opens
the \l{symLinkTarget()}{link's target}. On Windows, it opens the \c
.lnk file itself.
diff --git a/src/corelib/io/qfilesystemwatcher.cpp b/src/corelib/io/qfilesystemwatcher.cpp
index 55f4bddd17..d3aef27296 100644
--- a/src/corelib/io/qfilesystemwatcher.cpp
+++ b/src/corelib/io/qfilesystemwatcher.cpp
@@ -191,7 +191,7 @@ void QFileSystemWatcherPrivate::_q_directoryChanged(const QString &path, bool re
the file system monitor. Also note that your process may have
other file descriptors open in addition to the ones for files
being monitored, and these other open descriptors also count in
- the total. OS X uses a different backend and does not
+ the total. \macos uses a different backend and does not
suffer from this issue.
diff --git a/src/corelib/io/qiodevice.cpp b/src/corelib/io/qiodevice.cpp
index fbee1a223f..c560bc7a03 100644
--- a/src/corelib/io/qiodevice.cpp
+++ b/src/corelib/io/qiodevice.cpp
@@ -907,7 +907,7 @@ void QIODevicePrivate::seekBuffer(qint64 newPos)
For some devices, atEnd() can return true even though there is more data
to read. This special case only applies to devices that generate data in
direct response to you calling read() (e.g., \c /dev or \c /proc files on
- Unix and OS X, or console input / \c stdin on all platforms).
+ Unix and \macos, or console input / \c stdin on all platforms).
\sa bytesAvailable(), read(), isSequential()
*/
diff --git a/src/corelib/io/qlockfile_unix.cpp b/src/corelib/io/qlockfile_unix.cpp
index 924d2e7214..82beb15912 100644
--- a/src/corelib/io/qlockfile_unix.cpp
+++ b/src/corelib/io/qlockfile_unix.cpp
@@ -141,7 +141,7 @@ static QBasicMutex fcntlLock;
/*!
\internal
Checks that the OS isn't using POSIX locks to emulate flock().
- OS X is one of those.
+ \macos is one of those.
*/
static bool fcntlWorksAfterFlock(const QString &fn)
{
@@ -188,7 +188,7 @@ QLockFile::LockError QLockFilePrivate::tryLock_sys()
% localHostName() % '\n';
const QByteArray lockFileName = QFile::encodeName(fileName);
- const int fd = qt_safe_open(lockFileName.constData(), O_WRONLY | O_CREAT | O_EXCL, 0644);
+ const int fd = qt_safe_open(lockFileName.constData(), O_WRONLY | O_CREAT | O_EXCL, 0666);
if (fd < 0) {
switch (errno) {
case EEXIST:
@@ -229,7 +229,7 @@ QLockFile::LockError QLockFilePrivate::tryLock_sys()
bool QLockFilePrivate::removeStaleLock()
{
const QByteArray lockFileName = QFile::encodeName(fileName);
- const int fd = qt_safe_open(lockFileName.constData(), O_WRONLY, 0644);
+ const int fd = qt_safe_open(lockFileName.constData(), O_WRONLY, 0666);
if (fd < 0) // gone already?
return false;
bool success = setNativeLocks(fileName, fd) && (::unlink(lockFileName) == 0);
diff --git a/src/corelib/io/qloggingcategory.cpp b/src/corelib/io/qloggingcategory.cpp
index afdf0d0312..967a614a2d 100644
--- a/src/corelib/io/qloggingcategory.cpp
+++ b/src/corelib/io/qloggingcategory.cpp
@@ -183,7 +183,7 @@ static void setBoolLane(QBasicAtomicInt *atomic, bool enable, int shift)
by QStandardPaths::GenericConfigLocation, e.g.
\list
- \li on OS X and iOS: \c ~/Library/Preferences
+ \li on \macos and iOS: \c ~/Library/Preferences
\li on Unix: \c ~/.config, \c /etc/xdg
\li on Windows: \c %LOCALAPPDATA%, \c %ProgramData%,
\l QCoreApplication::applicationDirPath(),
diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp
index ebafd6b524..f9b3b9fb00 100644
--- a/src/corelib/io/qprocess.cpp
+++ b/src/corelib/io/qprocess.cpp
@@ -1948,7 +1948,7 @@ void QProcess::setProcessState(ProcessState state)
/*!
This function is called in the child process context just before the
- program is executed on Unix or OS X (i.e., after \c fork(), but before
+ program is executed on Unix or \macos (i.e., after \c fork(), but before
\c execve()). Reimplement this function to do last minute initialization
of the child process. Example:
@@ -1959,7 +1959,7 @@ void QProcess::setProcessState(ProcessState state)
execution, your workaround is to emit finished() and then call
exit().
- \warning This function is called by QProcess on Unix and OS X
+ \warning This function is called by QProcess on Unix and \macos
only. On Windows and QNX, it is not called.
*/
void QProcess::setupChildProcess()
@@ -2350,7 +2350,7 @@ void QProcess::setArguments(const QStringList &arguments)
On Windows, terminate() posts a WM_CLOSE message to all top-level windows
of the process and then to the main thread of the process itself. On Unix
- and OS X the \c SIGTERM signal is sent.
+ and \macos the \c SIGTERM signal is sent.
Console applications on Windows that do not run an event loop, or whose
event loop does not handle the WM_CLOSE message, can only be terminated by
@@ -2367,7 +2367,7 @@ void QProcess::terminate()
/*!
Kills the current process, causing it to exit immediately.
- On Windows, kill() uses TerminateProcess, and on Unix and OS X, the
+ On Windows, kill() uses TerminateProcess, and on Unix and \macos, the
SIGKILL signal is sent to the process.
\sa terminate()
diff --git a/src/corelib/io/qsettings.cpp b/src/corelib/io/qsettings.cpp
index 11f201344e..ffcb2e2d72 100644
--- a/src/corelib/io/qsettings.cpp
+++ b/src/corelib/io/qsettings.cpp
@@ -1917,7 +1917,7 @@ void QConfFileSettingsPrivate::ensureSectionParsed(QConfFile *confFile,
Users normally expect an application to remember its settings
(window sizes and positions, options, etc.) across sessions. This
information is often stored in the system registry on Windows,
- and in property list files on OS X and iOS. On Unix systems, in the
+ and in property list files on \macos and iOS. On Unix systems, in the
absence of a standard, many applications (including the KDE
applications) use INI text files.
@@ -1962,8 +1962,8 @@ void QConfFileSettingsPrivate::ensureSectionParsed(QConfFile *confFile,
\snippet settings/settings.cpp 4
(Here, we also specify the organization's Internet domain. When
- the Internet domain is set, it is used on OS X and iOS instead of the
- organization name, since OS X and iOS applications conventionally use
+ the Internet domain is set, it is used on \macos and iOS instead of the
+ organization name, since \macos and iOS applications conventionally use
Internet domains to identify themselves. If no domain is set, a
fake domain is derived from the organization name. See the
\l{Platform-Specific Notes} below for details.)
@@ -2021,7 +2021,7 @@ void QConfFileSettingsPrivate::ensureSectionParsed(QConfFile *confFile,
Setting keys can contain any Unicode characters. The Windows
registry and INI files use case-insensitive keys, whereas the
- CFPreferences API on OS X and iOS uses case-sensitive keys. To
+ CFPreferences API on \macos and iOS uses case-sensitive keys. To
avoid portability problems, follow these simple rules:
\list 1
@@ -2195,7 +2195,7 @@ void QConfFileSettingsPrivate::ensureSectionParsed(QConfFile *confFile,
\li \c{/etc/xdg/MySoft.conf}
\endlist
- On Mac OS X versions 10.2 and 10.3, these files are used by
+ On \macos versions 10.2 and 10.3, these files are used by
default:
\list 1
@@ -2223,7 +2223,7 @@ void QConfFileSettingsPrivate::ensureSectionParsed(QConfFile *confFile,
in the application's home directory.
If the file format is IniFormat, the following files are
- used on Unix, OS X, and iOS:
+ used on Unix, \macos, and iOS:
\list 1
\li \c{$HOME/.config/MySoft/Star Runner.ini} (Qt for Embedded Linux: \c{$HOME/Settings/MySoft/Star Runner.ini})
@@ -2250,7 +2250,7 @@ void QConfFileSettingsPrivate::ensureSectionParsed(QConfFile *confFile,
in the application's home directory.
The paths for the \c .ini and \c .conf files can be changed using
- setPath(). On Unix, OS X, and iOS the user can override them by
+ setPath(). On Unix, \macos, and iOS the user can override them by
setting the \c XDG_CONFIG_HOME environment variable; see
setPath() for details.
@@ -2267,7 +2267,7 @@ void QConfFileSettingsPrivate::ensureSectionParsed(QConfFile *confFile,
You can then use the QSettings object to read and write settings
in the file.
- On OS X and iOS, you can access property list \c .plist files by passing
+ On \macos and iOS, you can access property list \c .plist files by passing
QSettings::NativeFormat as second argument. For example:
\snippet code/src_corelib_io_qsettings.cpp 3
@@ -2321,13 +2321,13 @@ void QConfFileSettingsPrivate::ensureSectionParsed(QConfFile *confFile,
limitations is to store the settings using the IniFormat
instead of the NativeFormat.
- \li On OS X and iOS, allKeys() will return some extra keys for global
+ \li On \macos and iOS, allKeys() will return some extra keys for global
settings that apply to all applications. These keys can be
read using value() but cannot be changed, only shadowed.
Calling setFallbacksEnabled(false) will hide these global
settings.
- \li On OS X and iOS, the CFPreferences API used by QSettings expects
+ \li On \macos and iOS, the CFPreferences API used by QSettings expects
Internet domain names rather than organization names. To
provide a uniform API, QSettings derives a fake domain name
from the organization name (unless the organization name
@@ -2344,7 +2344,7 @@ void QConfFileSettingsPrivate::ensureSectionParsed(QConfFile *confFile,
\snippet code/src_corelib_io_qsettings.cpp 7
- \li On OS X, permissions to access settings not belonging to the
+ \li On \macos, permissions to access settings not belonging to the
current user (i.e. SystemScope) have changed with 10.7 (Lion). Prior to
that version, users having admin rights could access these. For 10.7 and
10.8 (Mountain Lion), only root can. However, 10.9 (Mavericks) changes
@@ -2373,7 +2373,7 @@ void QConfFileSettingsPrivate::ensureSectionParsed(QConfFile *confFile,
\value NativeFormat Store the settings using the most
appropriate storage format for the platform.
On Windows, this means the system registry;
- on OS X and iOS, this means the CFPreferences
+ on \macos and iOS, this means the CFPreferences
API; on Unix, this means textual
configuration files in INI format.
\value Registry32Format Windows only: Explicitly access the 32-bit system registry
@@ -2546,7 +2546,7 @@ QSettings::QSettings(Format format, Scope scope, const QString &organization,
If \a format is QSettings::NativeFormat, the meaning of \a
fileName depends on the platform. On Unix, \a fileName is the
- name of an INI file. On OS X and iOS, \a fileName is the name of a
+ name of an INI file. On \macos and iOS, \a fileName is the name of a
\c .plist file. On Windows, \a fileName is a path in the system
registry.
@@ -2599,7 +2599,7 @@ QSettings::QSettings(const QString &fileName, Format format, QObject *parent)
called, the QSettings object will not be able to read or write
any settings, and status() will return AccessError.
- On OS X and iOS, if both a name and an Internet domain are specified
+ On \macos and iOS, if both a name and an Internet domain are specified
for the organization, the domain is preferred over the name. On
other platforms, the name is preferred over the domain.
@@ -3115,7 +3115,7 @@ bool QSettings::isWritable() const
exists, the previous value is overwritten.
Note that the Windows registry and INI files use case-insensitive
- keys, whereas the CFPreferences API on OS X and iOS uses
+ keys, whereas the CFPreferences API on \macos and iOS uses
case-sensitive keys. To avoid portability problems, see the
\l{Section and Key Syntax} rules.
@@ -3154,7 +3154,7 @@ void QSettings::setValue(const QString &key, const QVariant &value)
\snippet code/src_corelib_io_qsettings.cpp 25
Note that the Windows registry and INI files use case-insensitive
- keys, whereas the CFPreferences API on OS X and iOS uses
+ keys, whereas the CFPreferences API on \macos and iOS uses
case-sensitive keys. To avoid portability problems, see the
\l{Section and Key Syntax} rules.
@@ -3189,7 +3189,7 @@ void QSettings::remove(const QString &key)
relative to that group.
Note that the Windows registry and INI files use case-insensitive
- keys, whereas the CFPreferences API on OS X and iOS uses
+ keys, whereas the CFPreferences API on \macos and iOS uses
case-sensitive keys. To avoid portability problems, see the
\l{Section and Key Syntax} rules.
@@ -3251,7 +3251,7 @@ bool QSettings::event(QEvent *event)
returned.
Note that the Windows registry and INI files use case-insensitive
- keys, whereas the CFPreferences API on OS X and iOS uses
+ keys, whereas the CFPreferences API on \macos and iOS uses
case-sensitive keys. To avoid portability problems, see the
\l{Section and Key Syntax} rules.
@@ -3354,18 +3354,18 @@ void QSettings::setUserIniPath(const QString &dir)
\row \li SystemScope \li \c /etc/xdg
\row \li{1,2} Qt for Embedded Linux \li{1,2} NativeFormat, IniFormat \li UserScope \li \c $HOME/Settings
\row \li SystemScope \li \c /etc/xdg
- \row \li{1,2} OS X and iOS \li{1,2} IniFormat \li UserScope \li \c $HOME/.config
+ \row \li{1,2} \macos and iOS \li{1,2} IniFormat \li UserScope \li \c $HOME/.config
\row \li SystemScope \li \c /etc/xdg
\endtable
- The default UserScope paths on Unix, OS X, and iOS (\c
+ The default UserScope paths on Unix, \macos, and iOS (\c
$HOME/.config or $HOME/Settings) can be overridden by the user by setting the
\c XDG_CONFIG_HOME environment variable. The default SystemScope
- paths on Unix, OS X, and iOS (\c /etc/xdg) can be overridden when
+ paths on Unix, \macos, and iOS (\c /etc/xdg) can be overridden when
building the Qt library using the \c configure script's \c
-sysconfdir flag (see QLibraryInfo for details).
- Setting the NativeFormat paths on Windows, OS X, and iOS has no
+ Setting the NativeFormat paths on Windows, \macos, and iOS has no
effect.
\warning This function doesn't affect existing QSettings objects.
diff --git a/src/corelib/io/qstandardpaths.cpp b/src/corelib/io/qstandardpaths.cpp
index 02318d427a..4cf3a3e9bd 100644
--- a/src/corelib/io/qstandardpaths.cpp
+++ b/src/corelib/io/qstandardpaths.cpp
@@ -153,7 +153,7 @@ QT_BEGIN_NAMESPACE
paths, if any, represent non-writable locations.
\table
- \header \li Path type \li OS X \li Windows
+ \header \li Path type \li \macos \li Windows
\row \li DesktopLocation
\li "~/Desktop"
\li "C:/Users/<USER>/Desktop"
@@ -609,7 +609,7 @@ QString QStandardPaths::displayName(StandardLocation type)
On Unix, \c XDG_DATA_HOME is set to \e ~/.qttest/share, \c XDG_CONFIG_HOME is
set to \e ~/.qttest/config, and \c XDG_CACHE_HOME is set to \e ~/.qttest/cache.
- On OS X, data goes to \e ~/.qttest/Application Support, cache goes to
+ On \macos, data goes to \e ~/.qttest/Application Support, cache goes to
\e ~/.qttest/Cache, and config goes to \e ~/.qttest/Preferences.
On Windows, everything goes to a "qttest" directory under Application Data.
diff --git a/src/corelib/io/qstandardpaths.h b/src/corelib/io/qstandardpaths.h
index fff1a29bf3..df76d73eae 100644
--- a/src/corelib/io/qstandardpaths.h
+++ b/src/corelib/io/qstandardpaths.h
@@ -41,6 +41,7 @@
#define QSTANDARDPATHS_H
#include <QtCore/qstringlist.h>
+#include <QtCore/qobjectdefs.h>
QT_BEGIN_NAMESPACE
@@ -49,6 +50,8 @@ QT_BEGIN_NAMESPACE
class Q_CORE_EXPORT QStandardPaths
{
+ Q_GADGET
+
public:
// Do not re-order, must match QDesktopServices
enum StandardLocation {
@@ -73,6 +76,7 @@ public:
AppConfigLocation,
AppLocalDataLocation = DataLocation
};
+ Q_ENUM(StandardLocation)
static QString writableLocation(StandardLocation type);
static QStringList standardLocations(StandardLocation type);
@@ -82,6 +86,7 @@ public:
LocateDirectory = 0x1
};
Q_DECLARE_FLAGS(LocateOptions, LocateOption)
+ Q_FLAG(LocateOptions)
static QString locate(StandardLocation type, const QString &fileName, LocateOptions options = LocateFile);
static QStringList locateAll(StandardLocation type, const QString &fileName, LocateOptions options = LocateFile);
@@ -103,6 +108,8 @@ private:
~QStandardPaths();
};
+Q_DECLARE_OPERATORS_FOR_FLAGS(QStandardPaths::LocateOptions)
+
#endif // QT_NO_STANDARDPATHS
QT_END_NAMESPACE
diff --git a/src/corelib/io/qstorageinfo.cpp b/src/corelib/io/qstorageinfo.cpp
index 6faa197491..3773b72606 100644
--- a/src/corelib/io/qstorageinfo.cpp
+++ b/src/corelib/io/qstorageinfo.cpp
@@ -256,7 +256,7 @@ QByteArray QStorageInfo::fileSystemType() const
/*!
Returns the device for this volume.
- For example, on Unix filesystems (including OS X), this returns the
+ For example, on Unix filesystems (including \macos), this returns the
devpath like \c /dev/sda0 for local storages. On Windows, it returns the UNC
path starting with \c \\\\?\\ for local storages (in other words, the volume GUID).
diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp
index 71a0228eeb..42a742213b 100644
--- a/src/corelib/io/qurl.cpp
+++ b/src/corelib/io/qurl.cpp
@@ -833,7 +833,7 @@ recodeFromUser(const QString &input, const ushort *actions, int from, int to)
// appendXXXX functions: copy from the internal form to the external, user form.
// the internal value is stored in its PrettyDecoded form, so that case is easy.
-static inline void appendToUser(QString &appendTo, const QString &value, QUrl::FormattingOptions options,
+static inline void appendToUser(QString &appendTo, const QStringRef &value, QUrl::FormattingOptions options,
const ushort *actions)
{
if (options == QUrl::PrettyDecoded) {
@@ -841,10 +841,17 @@ static inline void appendToUser(QString &appendTo, const QString &value, QUrl::F
return;
}
- if (!qt_urlRecode(appendTo, value.constData(), value.constEnd(), options, actions))
+ if (!qt_urlRecode(appendTo, value.data(), value.end(), options, actions))
appendTo += value;
}
+static inline void appendToUser(QString &appendTo, const QString &value, QUrl::FormattingOptions options,
+ const ushort *actions)
+{
+ appendToUser(appendTo, QStringRef(&value), options, actions);
+}
+
+
inline void QUrlPrivate::appendAuthority(QString &appendTo, QUrl::FormattingOptions options, Section appendingTo) const
{
if ((options & QUrl::RemoveUserInfo) != QUrl::RemoveUserInfo) {
@@ -924,21 +931,22 @@ inline void QUrlPrivate::appendPath(QString &appendTo, QUrl::FormattingOptions o
if (options & QUrl::NormalizePathSegments) {
thePath = qt_normalizePathSegments(path, false);
}
+
+ QStringRef thePathRef(&thePath);
if (options & QUrl::RemoveFilename) {
const int slash = path.lastIndexOf(QLatin1Char('/'));
if (slash == -1)
return;
- thePath = path.left(slash+1);
+ thePathRef = path.leftRef(slash + 1);
}
// check if we need to remove trailing slashes
if (options & QUrl::StripTrailingSlash) {
- while (thePath.length() > 1 && thePath.endsWith(QLatin1Char('/')))
- thePath.chop(1);
+ while (thePathRef.length() > 1 && thePathRef.endsWith(QLatin1Char('/')))
+ thePathRef.chop(1);
}
- appendToUser(appendTo, thePath, options,
+ appendToUser(appendTo, thePathRef, options,
appendingTo == FullUrl || options & QUrl::EncodeDelimiters ? pathInUrl : pathInIsolation);
-
}
inline void QUrlPrivate::appendFragment(QString &appendTo, QUrl::FormattingOptions options, Section appendingTo) const
@@ -3169,8 +3177,8 @@ QUrl QUrl::resolved(const QUrl &relative) const
if (!relative.d) return *this;
QUrl t;
- // be non strict and allow scheme in relative url
- if (!relative.d->scheme.isEmpty() && relative.d->scheme != d->scheme) {
+ // Compatibility hack (mostly for qtdeclarative) : treat "file:relative.txt" as relative even though QUrl::isRelative() says false
+ if (!relative.d->scheme.isEmpty() && (!relative.isLocalFile() || QDir::isAbsolutePath(relative.d->path))) {
t = relative;
t.detach();
} else {
diff --git a/src/corelib/itemmodels/qabstractitemmodel.cpp b/src/corelib/itemmodels/qabstractitemmodel.cpp
index 54ea45782d..7fdf107383 100644
--- a/src/corelib/itemmodels/qabstractitemmodel.cpp
+++ b/src/corelib/itemmodels/qabstractitemmodel.cpp
@@ -364,7 +364,7 @@ quintptr QPersistentModelIndex::internalId() const
Returns the parent QModelIndex for this persistent index, or an invalid
QModelIndex if it has no parent.
- \sa child(), sibling(), model()
+ \sa sibling(), model()
*/
QModelIndex QPersistentModelIndex::parent() const
{
@@ -377,7 +377,7 @@ QModelIndex QPersistentModelIndex::parent() const
Returns the sibling at \a row and \a column or an invalid QModelIndex if
there is no sibling at this position.
- \sa parent(), child()
+ \sa parent()
*/
QModelIndex QPersistentModelIndex::sibling(int row, int column) const
@@ -387,7 +387,12 @@ QModelIndex QPersistentModelIndex::sibling(int row, int column) const
return QModelIndex();
}
+#if QT_DEPRECATED_SINCE(5, 8)
/*!
+ \obsolete
+
+ Use QAbstractItemModel::index() instead.
+
Returns the child of the model index that is stored in the given \a row
and \a column.
@@ -397,9 +402,10 @@ QModelIndex QPersistentModelIndex::sibling(int row, int column) const
QModelIndex QPersistentModelIndex::child(int row, int column) const
{
if (d)
- return d->index.child(row, column);
+ return d->index.model()->index(row, column, d->index);
return QModelIndex();
}
+#endif
/*!
Returns the data for the given \a role for the item referred to by the
@@ -1099,12 +1105,16 @@ void QAbstractItemModel::resetInternalData()
Returns the sibling at \a row and \a column. If there is no sibling at this
position, an invalid QModelIndex is returned.
- \sa parent(), child()
+ \sa parent()
*/
/*!
\fn QModelIndex QModelIndex::child(int row, int column) const
+ \obsolete
+
+ Use QAbstractItemModel::index() instead.
+
Returns the child of the model index that is stored in the given \a row and
\a column.
@@ -1153,7 +1163,7 @@ void QAbstractItemModel::resetInternalData()
Returns the parent of the model index, or QModelIndex() if it has no
parent.
- \sa child(), sibling(), model()
+ \sa sibling(), model()
*/
/*!
diff --git a/src/corelib/itemmodels/qabstractitemmodel.h b/src/corelib/itemmodels/qabstractitemmodel.h
index 0820626452..907ba09676 100644
--- a/src/corelib/itemmodels/qabstractitemmodel.h
+++ b/src/corelib/itemmodels/qabstractitemmodel.h
@@ -63,7 +63,9 @@ public:
inline void *internalPointer() const Q_DECL_NOTHROW { return reinterpret_cast<void*>(i); }
inline QModelIndex parent() const;
inline QModelIndex sibling(int row, int column) const;
- inline QModelIndex child(int row, int column) const;
+#if QT_DEPRECATED_SINCE(5, 8)
+ QT_DEPRECATED_X("Use QAbstractItemModel::index") inline QModelIndex child(int row, int column) const;
+#endif
inline QVariant data(int role = Qt::DisplayRole) const;
inline Qt::ItemFlags flags() const;
Q_DECL_CONSTEXPR inline const QAbstractItemModel *model() const Q_DECL_NOTHROW { return m; }
@@ -128,7 +130,9 @@ public:
quintptr internalId() const;
QModelIndex parent() const;
QModelIndex sibling(int row, int column) const;
- QModelIndex child(int row, int column) const;
+#if QT_DEPRECATED_SINCE(5, 8)
+ QT_DEPRECATED_X("Use QAbstractItemModel::index") QModelIndex child(int row, int column) const;
+#endif
QVariant data(int role = Qt::DisplayRole) const;
Qt::ItemFlags flags() const;
const QAbstractItemModel *model() const;
@@ -419,8 +423,10 @@ inline QModelIndex QModelIndex::parent() const
inline QModelIndex QModelIndex::sibling(int arow, int acolumn) const
{ return m ? (r == arow && c == acolumn) ? *this : m->sibling(arow, acolumn, *this) : QModelIndex(); }
+#if QT_DEPRECATED_SINCE(5, 8)
inline QModelIndex QModelIndex::child(int arow, int acolumn) const
{ return m ? m->index(arow, acolumn, *this) : QModelIndex(); }
+#endif
inline QVariant QModelIndex::data(int arole) const
{ return m ? m->data(*this, arole) : QVariant(); }
diff --git a/src/corelib/itemmodels/qsortfilterproxymodel.cpp b/src/corelib/itemmodels/qsortfilterproxymodel.cpp
index 2b684b855b..b0ddfa879d 100644
--- a/src/corelib/itemmodels/qsortfilterproxymodel.cpp
+++ b/src/corelib/itemmodels/qsortfilterproxymodel.cpp
@@ -1328,6 +1328,7 @@ void QSortFilterProxyModelPrivate::_q_sourceReset()
void QSortFilterProxyModelPrivate::_q_sourceLayoutAboutToBeChanged(const QList<QPersistentModelIndex> &sourceParents, QAbstractItemModel::LayoutChangeHint hint)
{
Q_Q(QSortFilterProxyModel);
+ Q_UNUSED(hint); // We can't forward Hint because we might filter additional rows or columns
saved_persistent_indexes.clear();
QList<QPersistentModelIndex> parents;
@@ -1346,7 +1347,7 @@ void QSortFilterProxyModelPrivate::_q_sourceLayoutAboutToBeChanged(const QList<Q
if (!sourceParents.isEmpty() && parents.isEmpty())
return;
- emit q->layoutAboutToBeChanged(parents, hint);
+ emit q->layoutAboutToBeChanged(parents);
if (persistent.indexes.isEmpty())
return;
@@ -1356,6 +1357,7 @@ void QSortFilterProxyModelPrivate::_q_sourceLayoutAboutToBeChanged(const QList<Q
void QSortFilterProxyModelPrivate::_q_sourceLayoutChanged(const QList<QPersistentModelIndex> &sourceParents, QAbstractItemModel::LayoutChangeHint hint)
{
Q_Q(QSortFilterProxyModel);
+ Q_UNUSED(hint); // We can't forward Hint because we might filter additional rows or columns
// Optimize: We only actually have to clear the mapping related to the contents of
// sourceParents, not everything.
@@ -1385,7 +1387,7 @@ void QSortFilterProxyModelPrivate::_q_sourceLayoutChanged(const QList<QPersisten
if (!sourceParents.isEmpty() && parents.isEmpty())
return;
- emit q->layoutChanged(parents, hint);
+ emit q->layoutChanged(parents);
}
void QSortFilterProxyModelPrivate::_q_sourceRowsAboutToBeInserted(
diff --git a/src/corelib/itemmodels/qstringlistmodel.cpp b/src/corelib/itemmodels/qstringlistmodel.cpp
index f70c318ff7..0f7472aa5a 100644
--- a/src/corelib/itemmodels/qstringlistmodel.cpp
+++ b/src/corelib/itemmodels/qstringlistmodel.cpp
@@ -187,7 +187,13 @@ bool QStringListModel::setData(const QModelIndex &index, const QVariant &value,
if (index.row() >= 0 && index.row() < lst.size()
&& (role == Qt::EditRole || role == Qt::DisplayRole)) {
lst.replace(index.row(), value.toString());
- emit dataChanged(index, index, QVector<int>(1, role));
+ QVector<int> roles;
+ roles.reserve(2);
+ roles.append(Qt::DisplayRole);
+ roles.append(Qt::EditRole);
+ emit dataChanged(index, index, roles);
+ // once Q_COMPILER_UNIFORM_INIT can be used, change to:
+ // emit dataChanged(index, index, {Qt::DisplayRole, Qt::EditRole});
return true;
}
return false;
@@ -307,9 +313,9 @@ QStringList QStringListModel::stringList() const
*/
void QStringListModel::setStringList(const QStringList &strings)
{
- emit beginResetModel();
+ beginResetModel();
lst = strings;
- emit endResetModel();
+ endResetModel();
}
/*!
diff --git a/src/corelib/kernel/kernel.pri b/src/corelib/kernel/kernel.pri
index 39fe61ea4e..a78397e46c 100644
--- a/src/corelib/kernel/kernel.pri
+++ b/src/corelib/kernel/kernel.pri
@@ -4,6 +4,8 @@ HEADERS += \
kernel/qabstracteventdispatcher.h \
kernel/qabstractnativeeventfilter.h \
kernel/qbasictimer.h \
+ kernel/qdeadlinetimer.h \
+ kernel/qdeadlinetimer_p.h \
kernel/qelapsedtimer.h \
kernel/qeventloop.h\
kernel/qpointer.h \
@@ -46,6 +48,7 @@ SOURCES += \
kernel/qabstracteventdispatcher.cpp \
kernel/qabstractnativeeventfilter.cpp \
kernel/qbasictimer.cpp \
+ kernel/qdeadlinetimer.cpp \
kernel/qelapsedtimer.cpp \
kernel/qeventloop.cpp \
kernel/qcoreapplication.cpp \
@@ -120,6 +123,11 @@ mac {
# We need UIKit for UIDevice
LIBS_PRIVATE += -framework UIKit
}
+
+ watchos {
+ # We need WatchKit for WKExtension in qeventdispatcher_cf.mm
+ LIBS_PRIVATE += -framework WatchKit
+ }
}
nacl {
@@ -144,21 +152,20 @@ unix|integrity {
kernel/qpoll_p.h \
kernel/qtimerinfo_unix_p.h
- contains(QT_CONFIG, poll_select): SOURCES += kernel/qpoll.cpp
- contains(QT_CONFIG, poll_poll): DEFINES += QT_HAVE_POLL
- contains(QT_CONFIG, poll_ppoll): DEFINES += QT_HAVE_POLL QT_HAVE_PPOLL
- contains(QT_CONFIG, poll_pollts): DEFINES += QT_HAVE_POLL QT_HAVE_POLLTS
+ qtConfig(poll_select): SOURCES += kernel/qpoll.cpp
+ qtConfig(poll_poll): DEFINES += QT_HAVE_POLL
+ qtConfig(poll_ppoll): DEFINES += QT_HAVE_POLL QT_HAVE_PPOLL
+ qtConfig(poll_pollts): DEFINES += QT_HAVE_POLL QT_HAVE_POLLTS
- contains(QT_CONFIG, glib) {
+ qtConfig(glib) {
SOURCES += \
kernel/qeventdispatcher_glib.cpp
HEADERS += \
kernel/qeventdispatcher_glib_p.h
- QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_GLIB
- LIBS_PRIVATE +=$$QMAKE_LIBS_GLIB
+ QMAKE_USE_PRIVATE += glib
}
- contains(QT_CONFIG, clock-gettime):include($$QT_SOURCE_TREE/config.tests/unix/clock-gettime/clock-gettime.pri)
+ qtConfig(clock-gettime): include($$QT_SOURCE_TREE/config.tests/unix/clock-gettime/clock-gettime.pri)
!android {
SOURCES += kernel/qsharedmemory_posix.cpp \
@@ -181,7 +188,7 @@ vxworks {
}
qqnx_pps {
- LIBS_PRIVATE += -lpps
+ QMAKE_USE_PRIVATE += pps
SOURCES += \
kernel/qppsattribute.cpp \
kernel/qppsobject.cpp
diff --git a/src/corelib/kernel/qcore_mac_objc.mm b/src/corelib/kernel/qcore_mac_objc.mm
index 068b6b0440..ee1a290386 100644
--- a/src/corelib/kernel/qcore_mac_objc.mm
+++ b/src/corelib/kernel/qcore_mac_objc.mm
@@ -101,7 +101,7 @@ QT_FOR_EACH_MUTABLE_CORE_GRAPHICS_TYPE(QT_DECLARE_WEAK_QDEBUG_OPERATOR_FOR_CF_TY
QAppleOperatingSystemVersion qt_apple_os_version()
{
QAppleOperatingSystemVersion v = {0, 0, 0};
-#if QT_MAC_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_10, __IPHONE_8_0) || defined(Q_OS_TVOS)
+#if QT_MAC_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_10, __IPHONE_8_0) || defined(Q_OS_TVOS) || defined(Q_OS_WATCHOS)
if ([NSProcessInfo instancesRespondToSelector:@selector(operatingSystemVersion)]) {
NSOperatingSystemVersion osv = NSProcessInfo.processInfo.operatingSystemVersion;
v.major = osv.majorVersion;
diff --git a/src/corelib/kernel/qcore_unix_p.h b/src/corelib/kernel/qcore_unix_p.h
index c393609188..b5756af994 100644
--- a/src/corelib/kernel/qcore_unix_p.h
+++ b/src/corelib/kernel/qcore_unix_p.h
@@ -299,7 +299,7 @@ static inline int qt_safe_close(int fd)
#undef QT_CLOSE
#define QT_CLOSE qt_safe_close
-// - VxWorks & iOS/tvOS don't have processes
+// - VxWorks & iOS/tvOS/watchOS don't have processes
#if !defined(Q_OS_VXWORKS) && !defined(QT_NO_PROCESS)
static inline int qt_safe_execve(const char *filename, char *const argv[],
char *const envp[])
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
index 72645b4d9b..0413e06665 100644
--- a/src/corelib/kernel/qcoreapplication.cpp
+++ b/src/corelib/kernel/qcoreapplication.cpp
@@ -72,7 +72,7 @@
#ifndef QT_NO_QOBJECT
#if defined(Q_OS_UNIX)
-# if defined(Q_OS_OSX)
+# if defined(Q_OS_DARWIN)
# include "qeventdispatcher_cf_p.h"
# else
# if !defined(QT_NO_GLIB)
@@ -483,7 +483,7 @@ void QCoreApplicationPrivate::createEventDispatcher()
{
Q_Q(QCoreApplication);
#if defined(Q_OS_UNIX)
-# if defined(Q_OS_OSX)
+# if defined(Q_OS_DARWIN)
bool ok = false;
int value = qEnvironmentVariableIntValue("QT_EVENT_DISPATCHER_CORE_FOUNDATION", &ok);
if (ok && value > 0)
@@ -687,7 +687,7 @@ QCoreApplication::QCoreApplication(QCoreApplicationPrivate &p)
If you are doing graphical changes inside a loop that does not
return to the event loop on asynchronous window systems like X11
- or double buffered window systems like Quartz (OS X and iOS), and you want to
+ or double buffered window systems like Quartz (\macos and iOS), and you want to
visualize these changes immediately (e.g. Splash Screens), call
this function.
@@ -2059,7 +2059,7 @@ void QCoreApplicationPrivate::setApplicationFilePath(const QString &path)
directory, and you run the \c{regexp} example, this function will
return "C:/Qt/examples/tools/regexp".
- On OS X and iOS this will point to the directory actually containing
+ On \macos and iOS this will point to the directory actually containing
the executable, which may be inside an application bundle (if the
application is bundled).
diff --git a/src/corelib/kernel/qcoreevent.cpp b/src/corelib/kernel/qcoreevent.cpp
index 00c120093f..e3d0185004 100644
--- a/src/corelib/kernel/qcoreevent.cpp
+++ b/src/corelib/kernel/qcoreevent.cpp
@@ -174,7 +174,7 @@ QT_BEGIN_NAMESPACE
\value NonClientAreaMouseButtonPress A mouse button press occurred outside the client area.
\value NonClientAreaMouseButtonRelease A mouse button release occurred outside the client area.
\value NonClientAreaMouseMove A mouse move occurred outside the client area.
- \value MacSizeChange The user changed his widget sizes (OS X only).
+ \value MacSizeChange The user changed his widget sizes (\macos only).
\value MetaCall An asynchronous method invocation via QMetaObject::invokeMethod().
\value ModifiedChange Widgets modification state has been changed.
\value MouseButtonDblClick Mouse press again (QMouseEvent).
@@ -219,7 +219,7 @@ QT_BEGIN_NAMESPACE
\omitvalue ThemeChange
\value ThreadChange The object is moved to another thread. This is the last event sent to this object in the previous thread. See QObject::moveToThread().
\value Timer Regular timer events (QTimerEvent).
- \value ToolBarChange The toolbar button is toggled on OS X.
+ \value ToolBarChange The toolbar button is toggled on \macos.
\value ToolTip A tooltip was requested (QHelpEvent).
\value ToolTipChange The widget's tooltip has changed.
\value TouchBegin Beginning of a sequence of touch-screen or track-pad events (QTouchEvent).
diff --git a/src/corelib/kernel/qdeadlinetimer.cpp b/src/corelib/kernel/qdeadlinetimer.cpp
new file mode 100644
index 0000000000..7906b29ece
--- /dev/null
+++ b/src/corelib/kernel/qdeadlinetimer.cpp
@@ -0,0 +1,827 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 Intel Corporation.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL21$
+** 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 http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://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 2.1 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qdeadlinetimer.h"
+#include "qdeadlinetimer_p.h"
+#include <qpair.h>
+
+QT_BEGIN_NAMESPACE
+
+Q_DECL_CONST_FUNCTION static inline QPair<qint64, qint64> toSecsAndNSecs(qint64 nsecs)
+{
+ qint64 secs = nsecs / (1000*1000*1000);
+ if (nsecs < 0)
+ --secs;
+ nsecs -= secs * 1000*1000*1000;
+ return qMakePair(secs, nsecs);
+}
+
+/*!
+ \class QDeadlineTimer
+ \inmodule QtCore
+ \brief The QDeadlineTimer class marks a deadline in the future.
+ \since 5.8
+
+ \reentrant
+ \ingroup tools
+
+ The QDeadlineTimer class is usually used to calculate future deadlines and
+ verify whether the deadline has expired. QDeadlineTimer can also be used
+ for deadlines without expiration ("forever"). It forms a counterpart to
+ QElapsedTimer, which calculates how much time has elapsed since
+ QElapsedTimer::start() was called.
+
+ QDeadlineTimer provides a more convenient API compared to
+ QElapsedTimer::hasExpired().
+
+ The typical use-case for the class is to create a QDeadlineTimer before the
+ operation in question is started, and then use remainingTime() or
+ hasExpired() to determine whether to continue trying the operation.
+ QDeadlineTimer objects can be passed to functions being called to execute
+ this operation so they know how long to still operate.
+
+ \code
+ void executeOperation(int msecs)
+ {
+ QDeadlineTimer deadline(msecs);
+ do {
+ if (readFromDevice(deadline.remainingTime())
+ break;
+ waitForReadyRead(deadline);
+ } while (!deadline.hasExpired());
+ }
+ \endcode
+
+ Many QDeadlineTimer functions deal with time out values, which all are
+ measured in milliseconds. There are two special values, the same as many
+ other Qt functions named \c{waitFor} or similar:
+
+ \list
+ \o 0: no time left, expired
+ \o -1: infinite time left, timer never expires
+ \endlist
+
+ \section1 Reference Clocks
+
+ QDeadlineTimer will use the same clock as QElapsedTimer (see
+ QElapsedTimer::clockType() and QElapsedTimer::isMonotonic()).
+
+ \section1 Timer types
+
+ Like QTimer, QDeadlineTimer can select among different levels of coarseness
+ on the timers. You can select precise timing by passing Qt::PreciseTimer to
+ the functions that set of change the timer, or you can select coarse timing
+ by passing Qt::CoarseTimer. Qt::VeryCoarseTimer is currently interpreted
+ the same way as Qt::CoarseTimer.
+
+ This feature is dependent on support from the operating system: if the OS
+ does not support a coarse timer functionality, then QDeadlineTimer will
+ behave like Qt::PreciseTimer was passed.
+
+ QDeadlineTimer defaults to Qt::CoarseTimer because on operating systems
+ that do support coarse timing, making timing calls to that clock source is
+ often much more efficient. The level of coarseness depends on the
+ operating system, but should be in the order of a couple of milliseconds.
+
+ \section1 \c{std::chrono} Compatibility
+
+ QDeadlineTimer is compatible with the \c{std::chrono} API from C++11 and
+ can be constructed from or compared to both \c{std::chrono::duration} and
+ \c{std::chrono::time_point} objects. In addition, it is fully compatible
+ with the time literals from C++14, which allow one to write code as:
+
+ \code
+ using namespace std::chrono;
+
+ QDeadlineTimer deadline(30s);
+ device->waitForReadyRead(deadline);
+ if (deadline.remainingTime<nanoseconds>() > 300ms)
+ cleanup();
+ \endcode
+
+ As can be seen in the example above, QDeadlineTimer offers a templated
+ version of remainingTime() and deadline() that can be used to return
+ \c{std::chrono} objects.
+
+ Note that comparing to \c{time_point} is not as efficient as comparing to
+ \c{duration}, since QDeadlineTimer may need to convert from its own
+ internal clock source to the clock source used by the \c{time_point} object.
+ Also note that, due to this conversion, the deadlines will not be precise,
+ so the following code is not expected to compare equally:
+
+ \code
+ using namespace std::chrono;
+ auto now = steady_clock::now();
+ QDeadlineTimer deadline(now + 1s);
+ Q_ASSERT(deadline == now + 1s);
+ \endcode
+
+ \sa QTime, QTimer, QDeadlineTimer, Qt::TimerType
+*/
+
+/*!
+ \enum QDeadlineTimer::ForeverConstant
+
+ \value Forever Used when creating a QDeadlineTimer to indicate the
+ deadline should not expire
+*/
+
+/*!
+ \fn QDeadlineTimer::QDeadlineTimer(Qt::TimerType timerType)
+
+ Constructs an expired QDeadlineTimer object. For this object,
+ remainingTime() will return 0.
+
+ The timer type \a timerType may be ignored, since the timer is already
+ expired. Similarly, for optimization purposes, this function will not
+ attempt to obtain the current time and will use a value known to be in the
+ past. Therefore, deadline() may return an unexpected value and this object
+ cannot be used in calculation of how long it is overdue. If that
+ functionality is required, use QDeadlineTimer::current().
+
+ \sa hasExpired(), remainingTime(), timerType(), current()
+*/
+
+/*!
+ \fn QDeadlineTimer::QDeadlineTimer(ForeverConstant, Qt::TimerType timerType)
+
+ Constructs a QDeadlineTimer object that never expires. For this object,
+ remainingTime() will return -1, deadline() will return the maximum value,
+ and isForever() will return true.
+
+ The timer type \a timerType may be ignored, since the timer is already
+ expired.
+
+ \sa hasExpired(), isForever(), remainingTime(), timerType()
+*/
+
+/*!
+ Constructs a QDeadlineTimer object with an expiry time of \a msecs msecs
+ from the moment of the creation of this object, if msecs is positive. If \a
+ msecs is zero, this QDeadlineTimer will be marked as expired, causing
+ remainingTime() to return zero and deadline() to return an indeterminate
+ time point in the past. If \a msecs is -1, the timer will be set it to
+ never expire, causing remainingTime() to return -1 and deadline() to return
+ the maximum value.
+
+ The QDeadlineTimer object will be constructed with a timer type of \a
+ timerType.
+
+ For optimization purposes, if \a msecs is zero, this function may skip
+ obtaining the current time and may instead use a value known to be in the
+ past. If that happens, deadline() may return an unexpected value and this
+ object cannot be used in calculation of how long it is overdue. If that
+ functionality is required, use QDeadlineTimer::current() and add time to
+ it.
+
+ \sa hasExpired(), isForever(), remainingTime(), setRemainingTime()
+*/
+QDeadlineTimer::QDeadlineTimer(qint64 msecs, Qt::TimerType type) Q_DECL_NOTHROW
+ : t2(0)
+{
+ setRemainingTime(msecs, type);
+}
+
+/*!
+ \fn QDeadlineTimer::QDeadlineTimer(std::chrono::time_point<Clock, Duration> deadline, Qt::TimerType type)
+
+ Constructs a QDeadlineTimer object with a deadline at \a deadline time
+ point, converting from the clock source \c{Clock} to Qt's internal clock
+ source (see QElapsedTimer::clcokType()).
+
+ If \a deadline is in the past, this QDeadlineTimer object is set to
+ expired, whereas if \a deadline is equal to \c{Duration::max()}, then this
+ object is set to never expire.
+
+ The QDeadlineTimer object will be constructed with a timer type of \a
+ timerType.
+
+ \sa hasExpired(), isForever(), remainingTime<Duration>(), setDeadline()
+*/
+
+/*!
+ \fn QDeadlineTimer::QDeadlineTimer(std::chrono::duration<Rep, Period> remaining, Qt::TimerType type)
+
+ Constructs a QDeadlineTimer object with a remaining time of \a remaining.
+ If \a remaining is zero or negative, this QDeadlineTimer object will be
+ mark as expired, whereas if \a remaining is equal to \c{duration::max()},
+ the object will be set to never expire.
+
+ The QDeadlineTimer object will be constructed with a timer type of \a
+ timerType.
+
+ This constructor can be used with C++14's user-defined literals for time, such as in:
+
+ \code
+ using namespace std::chrono;
+ QDeadlineTimer deadline(250ms);
+ \endcode
+
+ For optimization purposes, if \a remaining is zero or negative, this
+ function may skip obtaining the current time and may instead use a value
+ known to be in the past. If that happens, deadline() may return an
+ unexpected value and this object cannot be used in calculation of how long
+ it is overdue. If that functionality is required, use
+ QDeadlineTimer::current() and add time to it.
+
+ \sa hasExpired(), isForever(), remainingTime<Duration>(), setRemainingTime()
+*/
+
+/*!
+ \fn void QDeadlineTimer::setDeadline(std::chrono::time_point<Clock, Duration> deadline, Qt::TimerType type)
+
+ Sets this QDeadlineTimer to the deadline marked by \a deadline time
+ point, converting from the clock source \c{Clock} to Qt's internal clock
+ source (see QElapsedTimer::clcokType()).
+
+ If \a deadline is in the past, this QDeadlineTimer object is set to
+ expired, whereas if \a deadline is equal to \c{Duration::max()}, then this
+ object is set to never expire.
+
+ The timer type for this QDeadlineTimer object will be set to \a timerType type.
+
+ \sa hasExpired(), isForever(), remainingTime<Duration>(),
+*/
+
+/*!
+ Sets the remaining time for this QDeadlineTimer object to \a msecs
+ milliseconds from now, if \a msecs has a positive value. If \a msecs is
+ zero, this QDeadlineTimer object will be marked as expired, whereas a value
+ of -1 will set it to never expire.
+
+ The timer type for this QDeadlineTimer object will be set to \a timerType type.
+
+ \sa setPreciseRemainingTime(), hasExpired(), isForever(), remainingTime()
+*/
+void QDeadlineTimer::setRemainingTime(qint64 msecs, Qt::TimerType timerType) Q_DECL_NOTHROW
+{
+ if (msecs == -1)
+ *this = QDeadlineTimer(Forever, timerType);
+ else
+ setPreciseRemainingTime(0, msecs * 1000 * 1000, timerType);
+}
+
+/*!
+ Sets the remaining time for this QDeadlineTimer object to \a secs seconds
+ plus \a nsecs nanoseconds from now, if \a secs has a positive value. If \a
+ secs is -1, this QDeadlineTimer will be set it to never expire. If both
+ parameters are zero, this QDeadlineTimer will be marked as expired.
+
+ The timer type for this QDeadlineTimer object will be set to \a timerType type.
+
+ \sa setRemainingTime(), hasExpired(), isForever(), remainingTime()
+*/
+void QDeadlineTimer::setPreciseRemainingTime(qint64 secs, qint64 nsecs, Qt::TimerType timerType) Q_DECL_NOTHROW
+{
+ if (secs == -1) {
+ *this = QDeadlineTimer(Forever, timerType);
+ return;
+ }
+
+ *this = current(timerType);
+ if (QDeadlineTimerNanosecondsInT2) {
+ t1 += secs + toSecsAndNSecs(nsecs).first;
+ t2 += toSecsAndNSecs(nsecs).second;
+ if (t2 > 1000*1000*1000) {
+ t2 -= 1000*1000*1000;
+ ++t1;
+ }
+ } else {
+ t1 += secs * 1000 * 1000 * 1000 + nsecs;
+ }
+}
+
+/*!
+ \overload
+ \fn void QDeadlineTimer::setRemainingTime(std::chrono::duration<Rep, Period> remaining, Qt::TimerType type)
+
+ Sets the remaining time for this QDeadlineTimer object to \a remaining. If
+ \a remaining is zero or negative, this QDeadlineTimer object will be mark
+ as expired, whereas if \a remaining is equal to \c{duration::max()}, the
+ object will be set to never expire.
+
+ The timer type for this QDeadlineTimer object will be set to \a timerType type.
+
+ This function can be used with C++14's user-defined literals for time, such as in:
+
+ \code
+ using namespace std::chrono;
+ deadline.setRemainingTime(250ms);
+ \endcode
+
+ \sa setDeadline(), remainingTime<Duration>(), hasExpired(), isForever()
+*/
+
+/*!
+ \fn void QDeadlineTimer::setPreciseRemainingTime(qint64 secs, unsigned nsecs, Qt::TimerType type)
+
+ Sets the remaining time for this QDeadlineTimer object to \a secs seconds
+ and \a nsecs nanoseconds from now, if \a secs is a positive value. If both
+ values are zero, this QDeadlineTimer object will be marked as expired,
+ whereas if \a secs is -1, it will set it to never expire.
+
+ If value of \a nsecs is more than 1 billion nanoseconds (1 second), this
+ function will adjust \a secs accordingly.
+
+ The timer type for this QDeadlineTimer object will be set to \a timerType type.
+
+ \sa setRemainingTime(), hasExpired(), isForever(), remainingTime()
+*/
+
+/*!
+ \overload
+ \fn Duration QDeadlineTimer::remainingTime() const
+
+ Returns a \c{std::chrono::duration} object of type \c{Duration} containing
+ the remaining time in this QDeadlineTimer, if it still has time left. If
+ the deadline has passed, this returns \c{Duration::zero()}, whereas if the
+ object is set to never expire, it returns \c{Duration::max()} (instead of
+ -1).
+
+ It is not possible to obtain the overdue time for expired timers with this
+ function. To do that, see deadline().
+
+ \note The overload of this function without template parameter always
+ returns milliseconds.
+
+ \sa setRemainingTime(), deadline<Clock, Duration>()
+*/
+
+/*!
+ \overload
+ \fn std::chrono::time_point<Clock, Duration> QDeadlineTimer::deadline() const
+
+ Returns the absolute time point for the deadline stored in QDeadlineTimer
+ object as a \c{std::chrono::time_point} object. The template parameter
+ \c{Clock} is mandatory and indicates which of the C++ timekeeping clocks to
+ use as a reference. The value will be in the past if this QDeadlineTimer
+ has expired.
+
+ If this QDeadlineTimer never expires, this function returns
+ \c{std::chrono::time_point<Clock, Duration>::max()}.
+
+ This function can be used to calculate the amount of time a timer is
+ overdue, by subtracting the current time point of the reference clock, as
+ in the following example:
+
+ \code
+ auto realTimeLeft = std::chrono::nanoseconds::max();
+ auto tp = deadline.deadline<std::chrono::steady_clock>();
+ if (tp != std::chrono::steady_clock::max())
+ realTimeLeft = tp - std::chrono::steady_clock::now();
+ \endcode
+
+ \note Timers that were created as expired have an indetermine time point in
+ the past as their deadline, so the above calculation may not work.
+
+ \sa remainingTime(), deadlineNSecs(), setDeadline()
+*/
+
+/*!
+ Returns true if this QDeadlineTimer object never expires, false otherwise.
+ For timers that never expire, remainingTime() always returns -1 and
+ deadline() returns the maximum value.
+
+ \sa ForeverConstant, hasExpired(), remainingTime()
+*/
+bool QDeadlineTimer::isForever() const Q_DECL_NOTHROW
+{
+ return t1 == (std::numeric_limits<qint64>::max)();
+}
+
+/*!
+ Returns true if this QDeadlineTimer object has expired, false if there
+ remains time left. For objects that have expired, remainingTime() will
+ return zero and deadline() will return a time point in the past.
+
+ QDeadlineTimer objects created with the \ref{ForeverConstant} never expire
+ and this function always returns false for them.
+
+ \sa isForever(), remainingTime()
+*/
+bool QDeadlineTimer::hasExpired() const Q_DECL_NOTHROW
+{
+ if (isForever())
+ return false;
+ return *this <= current(timerType());
+}
+
+/*!
+ \fn Qt::TimerType QDeadlineTimer::timerType() const Q_DECL_NOTHROW
+
+ Returns the timer type is active for this object.
+
+ \sa setTimerType()
+*/
+
+/*!
+ Changes the timer type for this object to \a timerType.
+
+ The behavior for each possible value of \a timerType is operating-system
+ dependent. Qt::PreciseTimer will use the most precise timer that Qt can
+ find, with resolution of 1 millisecond or better, whereas QDeadlineTimer
+ will try to use a more coarse timer for Qt::CoarseTimer and
+ Qt::VeryCoarseTimer.
+
+ \sa timerType()
+ */
+void QDeadlineTimer::setTimerType(Qt::TimerType timerType)
+{
+ type = timerType;
+}
+
+/*!
+ Returns the remaining time in this QDeadlineTimer object in milliseconds.
+ If the timer has already expired, this function will return zero and it is
+ not possible to obtain the amount of time overdue with this function (to do
+ that, see deadline()). If the timer was set to never expire, this function
+ returns -1.
+
+ This function is suitable for use in Qt APIs that take a millisecond
+ timeout, such as the many \ref QIODevice \c waitFor functions or the timed
+ lock functions in \ref QMutex, \ref QWaitCondition, \ref QSemaphore, or
+ \ref QReadWriteLock. For example:
+
+ \code
+ mutex.tryLock(deadline.remainingTime());
+ \code
+
+ \sa remainingTimeNSecs(), isForever(), hasExpired()
+*/
+qint64 QDeadlineTimer::remainingTime() const Q_DECL_NOTHROW
+{
+ qint64 ns = remainingTimeNSecs();
+ return ns <= 0 ? ns : ns / (1000 * 1000);
+}
+
+/*!
+ Returns the remaining time in this QDeadlineTimer object in nanoseconds. If
+ the timer has already expired, this function will return zero and it is not
+ possible to obtain the amount of time overdue with this function. If the
+ timer was set to never expire, this function returns -1.
+
+ \sa remainingTime(), isForever(), hasExpired()
+*/
+qint64 QDeadlineTimer::remainingTimeNSecs() const Q_DECL_NOTHROW
+{
+ if (isForever())
+ return -1;
+ qint64 raw = rawRemainingTimeNSecs();
+ return raw < 0 ? 0 : raw;
+}
+
+/*!
+ \internal
+ Same as remainingTimeNSecs, but may return negative remaining times. Does
+ not deal with Forever.
+*/
+qint64 QDeadlineTimer::rawRemainingTimeNSecs() const Q_DECL_NOTHROW
+{
+ QDeadlineTimer now = current(timerType());
+ if (QDeadlineTimerNanosecondsInT2)
+ return (t1 - now.t1) * (1000*1000*1000) + t2 - now.t2;
+ return t1 - now.t1;
+}
+
+/*!
+ Returns the absolute time point for the deadline stored in QDeadlineTimer
+ object, calculated in milliseconds relative to the reference clock, the
+ same as QElapsedTimer::msecsSinceReference(). The value will be in the past
+ if this QDeadlineTimer has expired.
+
+ If this QDeadlineTimer never expires, this function returns
+ \c{std::numeric_limits<qint64>::max()}.
+
+ This function can be used to calculate the amount of time a timer is
+ overdue, by subtracting QDeadlineTimer::current() or
+ QElapsedTimer::msecsSinceReference(), as in the following example:
+
+ \code
+ qint64 realTimeLeft = deadline.deadline();
+ if (realTimeLeft != (std::numeric_limits<qint64>::max)()) {
+ realTimeLeft -= QDeadlineTimer::current().deadline();
+ // or:
+ //QElapsedTimer timer;
+ //timer.start();
+ //realTimeLeft -= timer.msecsSinceReference();
+ }
+ \endcode
+
+ \note Timers that were created as expired have an indetermine time point in
+ the past as their deadline, so the above calculation may not work.
+
+ \sa remainingTime(), deadlineNSecs(), setDeadline()
+*/
+qint64 QDeadlineTimer::deadline() const Q_DECL_NOTHROW
+{
+ if (isForever())
+ return t1;
+ return deadlineNSecs() / (1000 * 1000);
+}
+
+/*!
+ Returns the absolute time point for the deadline stored in QDeadlineTimer
+ object, calculated in nanoseconds relative to the reference clock, the
+ same as QElapsedTimer::msecsSinceReference(). The value will be in the past
+ if this QDeadlineTimer has expired.
+
+ If this QDeadlineTimer never expires, this function returns
+ \c{std::numeric_limits<qint64>::max()}.
+
+ This function can be used to calculate the amount of time a timer is
+ overdue, by subtracting QDeadlineTimer::current(), as in the following
+ example:
+
+ \code
+ qint64 realTimeLeft = deadline.deadlineNSecs();
+ if (realTimeLeft != std::numeric_limits<qint64>::max())
+ realTimeLeft -= QDeadlineTimer::current().deadlineNSecs();
+ \endcode
+
+ \note Timers that were created as expired have an indetermine time point in
+ the past as their deadline, so the above calculation may not work.
+
+ \sa remainingTime(), deadlineNSecs()
+*/
+qint64 QDeadlineTimer::deadlineNSecs() const Q_DECL_NOTHROW
+{
+ if (isForever())
+ return t1;
+ if (QDeadlineTimerNanosecondsInT2)
+ return t1 * 1000 * 1000 * 1000 + t2;
+ return t1;
+}
+
+/*!
+ Sets the deadline for this QDeadlineTimer object to be the \a msecs
+ absolute time point, counted in milliseconds since the reference clock (the
+ same as QElapsedTimer::msecsSinceReference()), and the timer type to \a
+ timerType. If the value is in the past, this QDeadlineTimer will be marked
+ as expired.
+
+ If \a msecs is \c{std::numeric_limits<qint64>::max()}, this QDeadlineTimer
+ will be set to never expire.
+
+ \sa setPreciseDeadline(), deadline(), deadlineNSecs(), setRemainingTime()
+*/
+void QDeadlineTimer::setDeadline(qint64 msecs, Qt::TimerType timerType) Q_DECL_NOTHROW
+{
+ if (msecs == (std::numeric_limits<qint64>::max)()) {
+ setPreciseDeadline(msecs, 0, timerType); // msecs == MAX implies Forever
+ } else {
+ setPreciseDeadline(msecs / 1000, msecs % 1000 * 1000 * 1000, timerType);
+ }
+}
+
+/*!
+ Sets the deadline for this QDeadlineTimer object to be \a secs seconds and
+ \a nsecs nanoseconds since the reference clock epoch (the same as
+ QElapsedTimer::msecsSinceReference()), and the timer type to \a timerType.
+ If the value is in the past, this QDeadlineTimer will be marked as expired.
+
+ If \a secs or \a nsecs is \c{std::numeric_limits<qint64>::max()}, this
+ QDeadlineTimer will be set to never expire. If \a nsecs is more than 1
+ billion nanoseconds (1 second), then \a secs will be adjusted accordingly.
+
+ \sa setDeadline(), deadline(), deadlineNSecs(), setRemainingTime()
+*/
+void QDeadlineTimer::setPreciseDeadline(qint64 secs, qint64 nsecs, Qt::TimerType timerType) Q_DECL_NOTHROW
+{
+ type = timerType;
+ if (secs == (std::numeric_limits<qint64>::max)() || nsecs == (std::numeric_limits<qint64>::max)()) {
+ *this = QDeadlineTimer(Forever, timerType);
+ } else if (QDeadlineTimerNanosecondsInT2) {
+ t1 = secs + toSecsAndNSecs(nsecs).first;
+ t2 = toSecsAndNSecs(nsecs).second;
+ } else {
+ t1 = secs * (1000*1000*1000) + nsecs;
+ }
+}
+
+/*!
+ Returns a QDeadlineTimer object whose deadline is extended from \a dt's
+ deadline by \a nsecs nanoseconds. If \a dt was set to never expire, this
+ function returns a QDeadlineTimer that will not expire either.
+
+ \note if \a dt was created as expired, its deadline is indeterminate and
+ adding an amount of time may or may not cause it to become unexpired.
+*/
+QDeadlineTimer QDeadlineTimer::addNSecs(QDeadlineTimer dt, qint64 nsecs) Q_DECL_NOTHROW
+{
+ if (dt.isForever() || nsecs == (std::numeric_limits<qint64>::max)()) {
+ dt = QDeadlineTimer(Forever, dt.timerType());
+ } else if (QDeadlineTimerNanosecondsInT2) {
+ dt.t1 += toSecsAndNSecs(nsecs).first;
+ dt.t2 += toSecsAndNSecs(nsecs).second;
+ if (dt.t2 > 1000*1000*1000) {
+ dt.t2 -= 1000*1000*1000;
+ ++dt.t1;
+ }
+ } else {
+ dt.t1 += nsecs;
+ }
+ return dt;
+}
+
+/*!
+ \fn QDeadlineTimer QDeadlineTimer::current(Qt::TimerType timerType)
+
+ Returns a QDeadlineTimer that is expired but is guaranteed to contain the
+ current time. Objects created by this function can participate in the
+ calculation of how long a timer is overdue, using the deadline() function.
+
+ The QDeadlineTimer object will be constructed with a timer type of \a
+ timerType.
+*/
+
+/*!
+ \fn qint64 QDeadlineTimer::resolution(Qt::TimerType timerType)
+
+ Returns the resolution in nanoseconds of the system clock that backs timers
+ of type \a timerType, or 0 if the resolution could not be determined.
+
+ The resolution is not a guarantee that applications will get time values
+ with an accuracy down to that level. It is only the minimum change value
+ that can be expected.
+*/
+
+/*!
+ \fn bool operator==(QDeadlineTimer d1, QDeadlineTimer d2)
+ \related QDeadlineTimer
+
+ Returns true if the deadline on \a d1 and the deadline in \a d2 are the
+ same, false otherwise. The timer type used to create the two deadlines is
+ ignored. This function is equivalent to:
+
+ \code
+ return d1.deadlineNSecs() == d2.deadlineNSecs();
+ \endcode
+
+ \note comparing QDeadlineTimer objects with different timer types is
+ not supported and may result in unpredictable behavior.
+*/
+
+/*!
+ \fn bool operator!=(QDeadlineTimer d1, QDeadlineTimer d2)
+ \related QDeadlineTimer
+
+ Returns true if the deadline on \a d1 and the deadline in \a d2 are
+ diferent, false otherwise. The timer type used to create the two deadlines
+ is ignored. This function is equivalent to:
+
+ \code
+ return d1.deadlineNSecs() != d2.deadlineNSecs();
+ \endcode
+
+ \note comparing QDeadlineTimer objects with different timer types is
+ not supported and may result in unpredictable behavior.
+*/
+
+/*!
+ \fn bool operator<(QDeadlineTimer d1, QDeadlineTimer d2)
+ \related QDeadlineTimer
+
+ Returns true if the deadline on \a d1 is earlier than the deadline in \a
+ d2, false otherwise. The timer type used to create the two deadlines is
+ ignored. This function is equivalent to:
+
+ \code
+ return d1.deadlineNSecs() < d2.deadlineNSecs();
+ \endcode
+
+ \note comparing QDeadlineTimer objects with different timer types is
+ not supported and may result in unpredictable behavior.
+*/
+
+/*!
+ \fn bool operator<=(QDeadlineTimer d1, QDeadlineTimer d2)
+ \related QDeadlineTimer
+
+ Returns true if the deadline on \a d1 is earlier than or the same as the
+ deadline in \a d2, false otherwise. The timer type used to create the two
+ deadlines is ignored. This function is equivalent to:
+
+ \code
+ return d1.deadlineNSecs() <= d2.deadlineNSecs();
+ \endcode
+
+ \note comparing QDeadlineTimer objects with different timer types is
+ not supported and may result in unpredictable behavior.
+*/
+
+/*!
+ \fn bool operator>(QDeadlineTimer d1, QDeadlineTimer d2)
+ \related QDeadlineTimer
+
+ Returns true if the deadline on \a d1 is later than the deadline in \a
+ d2, false otherwise. The timer type used to create the two deadlines is
+ ignored. This function is equivalent to:
+
+ \code
+ return d1.deadlineNSecs() > d2.deadlineNSecs();
+ \endcode
+
+ \note comparing QDeadlineTimer objects with different timer types is
+ not supported and may result in unpredictable behavior.
+*/
+
+/*!
+ \fn bool operator>=(QDeadlineTimer d1, QDeadlineTimer d2)
+ \related QDeadlineTimer
+
+ Returns true if the deadline on \a d1 is later than or the same as the
+ deadline in \a d2, false otherwise. The timer type used to create the two
+ deadlines is ignored. This function is equivalent to:
+
+ \code
+ return d1.deadlineNSecs() >= d2.deadlineNSecs();
+ \endcode
+
+ \note comparing QDeadlineTimer objects with different timer types is
+ not supported and may result in unpredictable behavior.
+*/
+
+/*!
+ \fn QDeadlineTimer operator+(QDeadlineTimer dt, qint64 msecs)
+ \related QDeadlineTimer
+
+ Returns a QDeadlineTimer object whose deadline is \a msecs later than the
+ deadline stored in \a dt. If \a dt is set to never expire, this function
+ returns a QDeadlineTimer that does not expire either.
+
+ To add times of precision greater than 1 millisecond, use addNSecs().
+*/
+
+/*!
+ \fn QDeadlineTimer operator+(qint64 msecs, QDeadlineTimer dt)
+ \related QDeadlineTimer
+
+ Returns a QDeadlineTimer object whose deadline is \a msecs later than the
+ deadline stored in \a dt. If \a dt is set to never expire, this function
+ returns a QDeadlineTimer that does not expire either.
+
+ To add times of precision greater than 1 millisecond, use addNSecs().
+*/
+
+/*!
+ \fn QDeadlineTimer operator-(QDeadlineTimer dt, qint64 msecs)
+ \related QDeadlineTimer
+
+ Returns a QDeadlineTimer object whose deadline is \a msecs before the
+ deadline stored in \a dt. If \a dt is set to never expire, this function
+ returns a QDeadlineTimer that does not expire either.
+
+ To subtract times of precision greater than 1 millisecond, use addNSecs().
+*/
+
+/*!
+ \fn QDeadlineTimer &QDeadlineTimer::operator+=(qint64 msecs)
+
+ Extends this QDeadlineTimer object by \a msecs milliseconds and returns
+ itself. If this object is set to never expire, this function does nothing.
+
+ To add times of precision greater than 1 millisecond, use addNSecs().
+*/
+
+/*!
+ \fn QDeadlineTimer &QDeadlineTimer::operator-=(qint64 msecs)
+
+ Shortens this QDeadlineTimer object by \a msecs milliseconds and returns
+ itself. If this object is set to never expire, this function does nothing.
+
+ To subtract times of precision greater than 1 millisecond, use addNSecs().
+*/
+
+// the rest of the functions are in qelapsedtimer_xxx.cpp
+
+QT_END_NAMESPACE
diff --git a/src/corelib/kernel/qdeadlinetimer.h b/src/corelib/kernel/qdeadlinetimer.h
new file mode 100644
index 0000000000..ac8a09ba97
--- /dev/null
+++ b/src/corelib/kernel/qdeadlinetimer.h
@@ -0,0 +1,190 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 Intel Corporation.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL21$
+** 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 http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://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 2.1 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDEADLINETIMER_H
+#define QDEADLINETIMER_H
+
+#include <QtCore/qelapsedtimer.h>
+#include <QtCore/qmetatype.h>
+#include <QtCore/qnamespace.h>
+
+#ifdef max
+// un-pollute the namespace. We need std::numeric_limits::max() and std::chrono::duration::max()
+# undef max
+#endif
+
+#include <limits>
+
+#if QT_HAS_INCLUDE(<chrono>)
+# include <chrono>
+#endif
+
+QT_BEGIN_NAMESPACE
+
+class Q_CORE_EXPORT QDeadlineTimer
+{
+public:
+ enum ForeverConstant { Forever };
+
+ Q_DECL_CONSTEXPR QDeadlineTimer(Qt::TimerType type_ = Qt::CoarseTimer) Q_DECL_NOTHROW
+ : t1(0), t2(0), type(type_) {}
+ Q_DECL_CONSTEXPR QDeadlineTimer(ForeverConstant, Qt::TimerType type_ = Qt::CoarseTimer) Q_DECL_NOTHROW
+ : t1(std::numeric_limits<qint64>::max()), t2(0), type(type_) {}
+ explicit QDeadlineTimer(qint64 msecs, Qt::TimerType type = Qt::CoarseTimer) Q_DECL_NOTHROW;
+
+ void swap(QDeadlineTimer &other)
+ { qSwap(t1, other.t1); qSwap(t2, other.t2); qSwap(type, other.type); }
+
+ bool isForever() const Q_DECL_NOTHROW;
+ bool hasExpired() const Q_DECL_NOTHROW;
+
+ Qt::TimerType timerType() const Q_DECL_NOTHROW
+ { return Qt::TimerType(type & 0xff); }
+ void setTimerType(Qt::TimerType type);
+
+ qint64 remainingTime() const Q_DECL_NOTHROW;
+ qint64 remainingTimeNSecs() const Q_DECL_NOTHROW;
+ void setRemainingTime(qint64 msecs, Qt::TimerType type = Qt::CoarseTimer) Q_DECL_NOTHROW;
+ void setPreciseRemainingTime(qint64 secs, qint64 nsecs = 0,
+ Qt::TimerType type = Qt::CoarseTimer) Q_DECL_NOTHROW;
+
+ qint64 deadline() const Q_DECL_NOTHROW Q_DECL_PURE_FUNCTION;
+ qint64 deadlineNSecs() const Q_DECL_NOTHROW Q_DECL_PURE_FUNCTION;
+ void setDeadline(qint64 msecs, Qt::TimerType timerType = Qt::CoarseTimer) Q_DECL_NOTHROW;
+ void setPreciseDeadline(qint64 secs, qint64 nsecs = 0,
+ Qt::TimerType type = Qt::CoarseTimer) Q_DECL_NOTHROW;
+
+ static QDeadlineTimer addNSecs(QDeadlineTimer dt, qint64 nsecs) Q_DECL_NOTHROW Q_DECL_PURE_FUNCTION;
+ static QDeadlineTimer current(Qt::TimerType timerType = Qt::CoarseTimer) Q_DECL_NOTHROW;
+
+ friend bool operator==(QDeadlineTimer d1, QDeadlineTimer d2)
+ { return d1.t1 == d2.t1 && d1.t2 == d2.t2; }
+ friend bool operator!=(QDeadlineTimer d1, QDeadlineTimer d2)
+ { return !(d1 == d2); }
+ friend bool operator<(QDeadlineTimer d1, QDeadlineTimer d2)
+ { return d1.t1 < d2.t1 || (d1.t1 == d2.t1 && d1.t2 < d2.t2); }
+ friend bool operator<=(QDeadlineTimer d1, QDeadlineTimer d2)
+ { return d1 == d2 || d1 < d2; }
+ friend bool operator>(QDeadlineTimer d1, QDeadlineTimer d2)
+ { return d2 < d1; }
+ friend bool operator>=(QDeadlineTimer d1, QDeadlineTimer d2)
+ { return !(d1 < d2); }
+
+ friend QDeadlineTimer operator+(QDeadlineTimer dt, qint64 msecs)
+ { return QDeadlineTimer::addNSecs(dt, msecs * 1000 * 1000); }
+ friend QDeadlineTimer operator+(qint64 msecs, QDeadlineTimer dt)
+ { return dt + msecs; }
+ friend QDeadlineTimer operator-(QDeadlineTimer dt, qint64 msecs)
+ { return dt + (-msecs); }
+ friend qint64 operator-(QDeadlineTimer dt1, QDeadlineTimer dt2)
+ { return (dt1.deadlineNSecs() - dt2.deadlineNSecs()) / (1000 * 1000); }
+ QDeadlineTimer &operator+=(qint64 msecs)
+ { *this = *this + msecs; return *this; }
+ QDeadlineTimer &operator-=(qint64 msecs)
+ { *this = *this + (-msecs); return *this; }
+
+#if QT_HAS_INCLUDE(<chrono>) || defined(Q_QDOC)
+ template <class Clock, class Duration>
+ QDeadlineTimer(std::chrono::time_point<Clock, Duration> deadline_,
+ Qt::TimerType type_ = Qt::CoarseTimer) : t2(0)
+ { setDeadline(deadline_, type_); }
+ template <class Clock, class Duration>
+ QDeadlineTimer &operator=(std::chrono::time_point<Clock, Duration> deadline_)
+ { setDeadline(deadline_); return *this; }
+
+ template <class Clock, class Duration>
+ void setDeadline(std::chrono::time_point<Clock, Duration> deadline_,
+ Qt::TimerType type_ = Qt::CoarseTimer)
+ { setRemainingTime(deadline_ == deadline_.max() ? Duration::max() : deadline_ - Clock::now(), type_); }
+
+ template <class Clock, class Duration = typename Clock::duration>
+ std::chrono::time_point<Clock, Duration> deadline() const
+ {
+ auto val = std::chrono::nanoseconds(rawRemainingTimeNSecs()) + Clock::now();
+ return std::chrono::time_point_cast<Duration>(val);
+ }
+
+ template <class Rep, class Period>
+ QDeadlineTimer(std::chrono::duration<Rep, Period> remaining, Qt::TimerType type_ = Qt::CoarseTimer)
+ : t2(0)
+ { setRemainingTime(remaining, type_); }
+
+ template <class Rep, class Period>
+ QDeadlineTimer &operator=(std::chrono::duration<Rep, Period> remaining)
+ { setRemainingTime(remaining); return *this; }
+
+ template <class Rep, class Period>
+ void setRemainingTime(std::chrono::duration<Rep, Period> remaining, Qt::TimerType type_ = Qt::CoarseTimer)
+ {
+ if (remaining == remaining.max())
+ *this = QDeadlineTimer(Forever, type_);
+ else
+ setPreciseRemainingTime(0, std::chrono::nanoseconds(remaining).count(), type_);
+ }
+
+ std::chrono::nanoseconds remainingTimeAsDuration() const Q_DECL_NOTHROW
+ {
+ if (isForever())
+ return std::chrono::nanoseconds::max();
+ qint64 nsecs = rawRemainingTimeNSecs();
+ if (nsecs <= 0)
+ return std::chrono::nanoseconds::zero();
+ return std::chrono::nanoseconds(nsecs);
+ }
+
+ template <class Rep, class Period>
+ friend QDeadlineTimer operator+(QDeadlineTimer dt, std::chrono::duration<Rep, Period> value)
+ { return QDeadlineTimer::addNSecs(dt, std::chrono::duration_cast<std::chrono::nanoseconds>(value).count()); }
+ template <class Rep, class Period>
+ friend QDeadlineTimer operator+(std::chrono::duration<Rep, Period> value, QDeadlineTimer dt)
+ { return dt + value; }
+ template <class Rep, class Period>
+ friend QDeadlineTimer operator+=(QDeadlineTimer &dt, std::chrono::duration<Rep, Period> value)
+ { return dt = dt + value; }
+#endif
+
+private:
+ qint64 t1;
+ unsigned t2;
+ unsigned type;
+
+ qint64 rawRemainingTimeNSecs() const Q_DECL_NOTHROW;
+};
+
+Q_DECLARE_SHARED(QDeadlineTimer)
+
+QT_END_NAMESPACE
+
+Q_DECLARE_METATYPE(QDeadlineTimer)
+
+#endif // QDEADLINETIMER_H
diff --git a/config.tests/x11/xcursor/xcursor.cpp b/src/corelib/kernel/qdeadlinetimer_p.h
index 990534efea..46e12de6c1 100644
--- a/config.tests/x11/xcursor/xcursor.cpp
+++ b/src/corelib/kernel/qdeadlinetimer_p.h
@@ -3,7 +3,7 @@
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the config.tests of the Qt Toolkit.
+** This file is part of the QtCore module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -37,28 +37,34 @@
**
****************************************************************************/
-#include <X11/Xlib.h>
-#include <X11/Xcursor/Xcursor.h>
+#ifndef QDEADLINETIMER_P_H
+#define QDEADLINETIMER_P_H
-#if !defined(XCURSOR_LIB_MAJOR)
-# define XCURSOR_LIB_MAJOR XCURSOR_MAJOR
-#endif
-#if !defined(XCURSOR_LIB_MINOR)
-# define XCURSOR_LIB_MINOR XCURSOR_MINOR
-#endif
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtCore/qglobal.h>
-#if XCURSOR_LIB_MAJOR == 1 && XCURSOR_LIB_MINOR >= 0
-# define XCURSOR_FOUND
+QT_BEGIN_NAMESPACE
+
+enum {
+#if defined(Q_OS_UNIX) && !defined(Q_OS_DARWIN)
+ // t1 contains seconds and t2 contains nanoseconds
+ QDeadlineTimerNanosecondsInT2 = 1
#else
-# define
-# error "Required Xcursor version 1.0 not found."
+ // t1 contains nanoseconds, t2 is always zero
+ QDeadlineTimerNanosecondsInT2 = 0
#endif
+};
+
+QT_END_NAMESPACE
-int main(int, char **)
-{
- XcursorImage *image;
- image = 0;
- XcursorCursors *cursors;
- cursors = 0;
- return 0;
-}
+#endif
diff --git a/src/corelib/kernel/qelapsedtimer.cpp b/src/corelib/kernel/qelapsedtimer.cpp
index 2eabb4c3a3..5e9d1317ac 100644
--- a/src/corelib/kernel/qelapsedtimer.cpp
+++ b/src/corelib/kernel/qelapsedtimer.cpp
@@ -83,6 +83,9 @@ QT_BEGIN_NAMESPACE
\snippet qelapsedtimer/main.cpp 2
+ It is often more convenient to use \ref{QDeadlineTimer} in this case, which
+ counts towards a timeout in the future instead of tracking elapsed time.
+
\section1 Reference Clocks
QElapsedTimer will use the platform's monotonic reference clock in all
@@ -120,7 +123,7 @@ QT_BEGIN_NAMESPACE
The information on which clocks types may overflow and how to remedy that
issue is documented along with the clock types.
- \sa QTime, QTimer
+ \sa QTime, QTimer, QDeadlineTimer
*/
/*!
@@ -137,7 +140,7 @@ QT_BEGIN_NAMESPACE
\value SystemTime The human-readable system time. This clock is not monotonic.
\value MonotonicClock The system's monotonic clock, usually found in Unix systems. This clock is monotonic and does not overflow.
\value TickCounter The system's tick counter, used on Windows systems. This clock may overflow.
- \value MachAbsoluteTime The Mach kernel's absolute time (OS X and iOS). This clock is monotonic and does not overflow.
+ \value MachAbsoluteTime The Mach kernel's absolute time (\macos and iOS). This clock is monotonic and does not overflow.
\value PerformanceCounter The high-resolution performance counter provided by Windows. This clock is monotonic and does not overflow.
\section2 SystemTime
@@ -179,8 +182,8 @@ QT_BEGIN_NAMESPACE
\section2 MachAbsoluteTime
This clock type is based on the absolute time presented by Mach kernels,
- such as that found on OS X. This clock type is presented separately
- from MonotonicClock since OS X and iOS are also Unix systems and may support
+ such as that found on \macos. This clock type is presented separately
+ from MonotonicClock since \macos and iOS are also Unix systems and may support
a POSIX monotonic clock with values differing from the Mach absolute
time.
@@ -255,7 +258,7 @@ bool QElapsedTimer::isValid() const Q_DECL_NOTHROW
The value of \a timeout can be -1 to indicate that this timer does not
expire, in which case this function will always return false.
- \sa elapsed()
+ \sa elapsed(), QDeadlineTimer
*/
bool QElapsedTimer::hasExpired(qint64 timeout) const Q_DECL_NOTHROW
{
diff --git a/src/corelib/kernel/qelapsedtimer_generic.cpp b/src/corelib/kernel/qelapsedtimer_generic.cpp
index 8c724247be..fdeb385188 100644
--- a/src/corelib/kernel/qelapsedtimer_generic.cpp
+++ b/src/corelib/kernel/qelapsedtimer_generic.cpp
@@ -38,6 +38,7 @@
****************************************************************************/
#include "qelapsedtimer.h"
+#include "qdeadlinetimer.h"
#include "qdatetime.h"
QT_BEGIN_NAMESPACE
@@ -145,7 +146,7 @@ qint64 QElapsedTimer::elapsed() const Q_DECL_NOTHROW
number of milliseconds since January 1st, 1970 at 0:00 UTC (that is, it
is the Unix time expressed in milliseconds).
- On Linux, Windows and OS X/iOS systems, this value is usually the time
+ On Linux, Windows and Apple platforms, this value is usually the time
since the system boot, though it usually does not include the time the
system has spent in sleep states.
@@ -201,4 +202,12 @@ bool operator<(const QElapsedTimer &v1, const QElapsedTimer &v2) Q_DECL_NOTHROW
return v1.t1 < v2.t1;
}
+QDeadlineTimer QDeadlineTimer::current(Qt::TimerType timerType) Q_DECL_NOTHROW
+{
+ QDeadlineTimer result;
+ result.t1 = QDateTime::currentMSecsSinceEpoch() * 1000 * 1000;
+ result.type = timerType;
+ return result;
+}
+
QT_END_NAMESPACE
diff --git a/src/corelib/kernel/qelapsedtimer_mac.cpp b/src/corelib/kernel/qelapsedtimer_mac.cpp
index 886e0f41b2..7490693991 100644
--- a/src/corelib/kernel/qelapsedtimer_mac.cpp
+++ b/src/corelib/kernel/qelapsedtimer_mac.cpp
@@ -41,6 +41,8 @@
#define _POSIX_C_SOURCE 200809L
#include "qelapsedtimer.h"
+#include "qdeadlinetimer.h"
+#include "qdeadlinetimer_p.h"
#include <sys/time.h>
#include <time.h>
#include <unistd.h>
@@ -50,6 +52,12 @@
QT_BEGIN_NAMESPACE
+#ifdef __LP64__
+typedef __int128_t LargeInt;
+#else
+typedef qint64 LargeInt;
+#endif
+
QElapsedTimer::ClockType QElapsedTimer::clockType() Q_DECL_NOTHROW
{
return MachAbsoluteTime;
@@ -65,13 +73,13 @@ static qint64 absoluteToNSecs(qint64 cpuTime)
{
if (info.denom == 0)
mach_timebase_info(&info);
-#ifdef __LP64__
- __uint128_t nsecs = static_cast<__uint128_t>(cpuTime) * info.numer / info.denom;
- return static_cast<qint64>(nsecs);
-#else
- qint64 nsecs = cpuTime * info.numer / info.denom;
+
+ // don't do multiplication & division if those are equal
+ // (mathematically it would be the same, but it's computationally expensive)
+ if (info.numer == info.denom)
+ return cpuTime;
+ qint64 nsecs = LargeInt(cpuTime) * info.numer / info.denom;
return nsecs;
-#endif
}
static qint64 absoluteToMSecs(qint64 cpuTime)
@@ -146,4 +154,13 @@ bool operator<(const QElapsedTimer &v1, const QElapsedTimer &v2) Q_DECL_NOTHROW
return v1.t1 < v2.t1;
}
+QDeadlineTimer QDeadlineTimer::current(Qt::TimerType timerType) Q_DECL_NOTHROW
+{
+ Q_STATIC_ASSERT(!QDeadlineTimerNanosecondsInT2);
+ QDeadlineTimer result;
+ result.type = timerType;
+ result.t1 = absoluteToNSecs(mach_absolute_time());
+ return result;
+}
+
QT_END_NAMESPACE
diff --git a/src/corelib/kernel/qelapsedtimer_unix.cpp b/src/corelib/kernel/qelapsedtimer_unix.cpp
index e2c3ae6280..e166d4e3d2 100644
--- a/src/corelib/kernel/qelapsedtimer_unix.cpp
+++ b/src/corelib/kernel/qelapsedtimer_unix.cpp
@@ -39,6 +39,8 @@
****************************************************************************/
#include "qelapsedtimer.h"
+#include "qdeadlinetimer.h"
+#include "qdeadlinetimer_p.h"
#if defined(Q_OS_VXWORKS)
#include "qfunctions_vxworks.h"
#else
@@ -248,4 +250,16 @@ bool operator<(const QElapsedTimer &v1, const QElapsedTimer &v2) Q_DECL_NOTHROW
return v1.t1 < v2.t1 || (v1.t1 == v2.t1 && v1.t2 < v2.t2);
}
+QDeadlineTimer QDeadlineTimer::current(Qt::TimerType timerType) Q_DECL_NOTHROW
+{
+ Q_STATIC_ASSERT(QDeadlineTimerNanosecondsInT2);
+ QDeadlineTimer result;
+ qint64 cursec, curnsec;
+ do_gettime(&cursec, &curnsec);
+ result.t1 = cursec;
+ result.t2 = curnsec;
+ result.type = timerType;
+ return result;
+}
+
QT_END_NAMESPACE
diff --git a/src/corelib/kernel/qelapsedtimer_win.cpp b/src/corelib/kernel/qelapsedtimer_win.cpp
index 520126d262..0c380b2f6a 100644
--- a/src/corelib/kernel/qelapsedtimer_win.cpp
+++ b/src/corelib/kernel/qelapsedtimer_win.cpp
@@ -38,6 +38,8 @@
****************************************************************************/
#include "qelapsedtimer.h"
+#include "qdeadlinetimer.h"
+#include "qdeadlinetimer_p.h"
#include <qt_windows.h>
QT_BEGIN_NAMESPACE
@@ -76,6 +78,17 @@ static inline qint64 ticksToNanoseconds(qint64 ticks)
}
}
+static inline qint64 nanosecondsToTicks(qint64 nsec)
+{
+ if (counterFrequency > 0) {
+ // QueryPerformanceCounter uses an arbitrary frequency
+ return double(nsec) * counterFrequency / 1000000000.;
+ } else {
+ // GetTickCount(64) uses milliseconds
+ return nsec / 1000000;
+ }
+}
+
static quint64 getTickCount()
{
resolveCounterFrequency();
@@ -161,4 +174,13 @@ bool operator<(const QElapsedTimer &v1, const QElapsedTimer &v2) Q_DECL_NOTHROW
return (v1.t1 - v2.t1) < 0;
}
+QDeadlineTimer QDeadlineTimer::current(Qt::TimerType timerType) Q_DECL_NOTHROW
+{
+ Q_STATIC_ASSERT(!QDeadlineTimerNanosecondsInT2);
+ QDeadlineTimer result;
+ result.t1 = ticksToNanoseconds(getTickCount());
+ result.type = timerType;
+ return result;
+}
+
QT_END_NAMESPACE
diff --git a/src/corelib/kernel/qeventdispatcher_cf.mm b/src/corelib/kernel/qeventdispatcher_cf.mm
index 437e4062ad..eecc72fd94 100644
--- a/src/corelib/kernel/qeventdispatcher_cf.mm
+++ b/src/corelib/kernel/qeventdispatcher_cf.mm
@@ -51,6 +51,8 @@
#ifdef Q_OS_OSX
# include <AppKit/NSApplication.h>
+#elif defined(Q_OS_WATCHOS)
+# include <WatchKit/WatchKit.h>
#else
# include <UIKit/UIApplication.h>
#endif
@@ -75,6 +77,8 @@ QT_USE_NAMESPACE
name:nil
#ifdef Q_OS_OSX
object:[NSApplication sharedApplication]];
+#elif defined(Q_OS_WATCHOS)
+ object:[WKExtension sharedExtension]];
#else
object:[UIApplication sharedApplication]];
#endif
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index 26c3ce2443..e901d8cefa 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -4248,7 +4248,7 @@ QDebug operator<<(QDebug dbg, const QObject *o)
This macro registers an enum type with the meta-object system.
It must be placed after the enum declaration in a class that has the Q_OBJECT or the
- Q_GADGET macro.
+ Q_GADGET macro. For namespaces use \l Q_ENUM_NS instead.
For example:
@@ -4275,7 +4275,7 @@ QDebug operator<<(QDebug dbg, const QObject *o)
This macro registers a single \l{QFlags}{flags type} with the
meta-object system. It is typically used in a class definition to declare
that values of a given enum can be used as flags and combined using the
- bitwise OR operator.
+ bitwise OR operator. For namespaces use \l Q_FLAG_NS instead.
The macro must be placed after the enum declaration.
@@ -4294,6 +4294,48 @@ QDebug operator<<(QDebug dbg, const QObject *o)
\sa {Qt's Property System}
*/
+/*!
+ \macro Q_ENUM_NS(...)
+ \since 5.8
+
+ This macro registers an enum type with the meta-object system.
+ It must be placed after the enum declaration in a namespace that
+ has the Q_NAMESPACE macro. It is the same as \l Q_ENUM but in a
+ namespace.
+
+ Enumerations that are declared with Q_ENUM_NS have their QMetaEnum
+ registered in the enclosing QMetaObject. You can also use
+ QMetaEnum::fromType() to get the QMetaEnum.
+
+ Registered enumerations are automatically registered also to the Qt meta
+ type system, making them known to QMetaType without the need to use
+ Q_DECLARE_METATYPE(). This will enable useful features; for example, if
+ used in a QVariant, you can convert them to strings. Likewise, passing them
+ to QDebug will print out their names.
+
+ \sa {Qt's Property System}
+*/
+
+
+/*!
+ \macro Q_FLAG_NS(...)
+ \since 5.8
+
+ This macro registers a single \l{QFlags}{flags type} with the
+ meta-object system. It is used in a namespace that has the
+ Q_NAMESPACE macro, to declare that values of a given enum can be
+ used as flags and combined using the bitwise OR operator.
+ It is the same as \l Q_FLAG but in a namespace.
+
+ The macro must be placed after the enum declaration.
+
+ \note The Q_FLAG_NS macro takes care of registering individual flag
+ values with the meta-object system, so it is unnecessary to use
+ Q_ENUM_NS() in addition to this macro.
+
+ \sa {Qt's Property System}
+*/
+
/*!
\macro Q_OBJECT
@@ -4335,6 +4377,21 @@ QDebug operator<<(QDebug dbg, const QObject *o)
*/
/*!
+ \macro Q_NAMESPACE
+ \since 5.8
+
+ The Q_NAMESPACE macro can be used to add QMetaObject capabilities
+ to a namespace.
+
+ Q_NAMESPACEs can have Q_CLASSINFO, Q_ENUM_NS, Q_FLAG_NS, but they
+ cannot have Q_ENUM, Q_FLAG, Q_PROPERTY, Q_INVOKABLE, signals nor slots.
+
+ Q_NAMESPACE makes an external variable, \c{staticMetaObject}, available.
+ \c{staticMetaObject} is of type QMetaObject and provides access to the
+ enums declared with Q_ENUM_NS/Q_FLAG_NS.
+*/
+
+/*!
\macro Q_SIGNALS
\relates QObject
diff --git a/src/corelib/kernel/qobjectdefs.h b/src/corelib/kernel/qobjectdefs.h
index 3660d1c0e1..7ed6088d3b 100644
--- a/src/corelib/kernel/qobjectdefs.h
+++ b/src/corelib/kernel/qobjectdefs.h
@@ -124,6 +124,11 @@ class QString;
friend Q_DECL_CONSTEXPR const char *qt_getEnumName(ENUM) Q_DECL_NOEXCEPT { return #ENUM; }
#define Q_ENUM(x) Q_ENUMS(x) Q_ENUM_IMPL(x)
#define Q_FLAG(x) Q_FLAGS(x) Q_ENUM_IMPL(x)
+#define Q_ENUM_NS_IMPL(ENUM) \
+ inline Q_DECL_CONSTEXPR const QMetaObject *qt_getEnumMetaObject(ENUM) Q_DECL_NOEXCEPT { return &staticMetaObject; } \
+ inline Q_DECL_CONSTEXPR const char *qt_getEnumName(ENUM) Q_DECL_NOEXCEPT { return #ENUM; }
+#define Q_ENUM_NS(x) Q_ENUMS(x) Q_ENUM_NS_IMPL(x)
+#define Q_FLAG_NS(x) Q_FLAGS(x) Q_ENUM_NS_IMPL(x)
#define Q_SCRIPTABLE QT_ANNOTATE_FUNCTION(qt_scriptable)
#define Q_INVOKABLE QT_ANNOTATE_FUNCTION(qt_invokable)
#define Q_SIGNAL QT_ANNOTATE_FUNCTION(qt_signal)
@@ -227,6 +232,12 @@ private: \
QT_WARNING_POP \
QT_ANNOTATE_CLASS(qt_qgadget, "") \
/*end*/
+
+#define Q_NAMESPACE \
+ extern const QMetaObject staticMetaObject; \
+ QT_ANNOTATE_CLASS(qt_qnamespace, "") \
+ /*end*/
+
#endif // QT_NO_META_MACROS
#else // Q_MOC_RUN
diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp
index d21529d124..72ae3b063f 100644
--- a/src/corelib/kernel/qvariant.cpp
+++ b/src/corelib/kernel/qvariant.cpp
@@ -2722,7 +2722,7 @@ qlonglong QVariant::toLongLong(bool *ok) const
}
/*!
- Returns the variant as as an unsigned long long int if the
+ Returns the variant as an unsigned long long int if the
variant has type() \l QMetaType::ULongLong, \l QMetaType::Bool,
\l QMetaType::QByteArray, \l QMetaType::QChar, \l QMetaType::Double,
\l QMetaType::Int, \l QMetaType::LongLong, \l QMetaType::QString, or
@@ -3560,6 +3560,8 @@ int QVariant::compare(const QVariant &v) const
return v1.toTime() < v2.toTime() ? -1 : 1;
case QVariant::DateTime:
return v1.toDateTime() < v2.toDateTime() ? -1 : 1;
+ case QVariant::StringList:
+ return v1.toStringList() < v2.toStringList() ? -1 : 1;
}
int r = v1.toString().compare(v2.toString(), Qt::CaseInsensitive);
if (r == 0) {
diff --git a/src/corelib/mimetypes/mimetypes.pri b/src/corelib/mimetypes/mimetypes.pri
index 1ab773fc10..870b6c65a5 100644
--- a/src/corelib/mimetypes/mimetypes.pri
+++ b/src/corelib/mimetypes/mimetypes.pri
@@ -1,6 +1,7 @@
# Qt core mimetype module
-HEADERS += \
+qtConfig(mimetype) {
+ HEADERS += \
mimetypes/qmimedatabase.h \
mimetypes/qmimetype.h \
mimetypes/qmimemagicrulematcher_p.h \
@@ -11,7 +12,7 @@ HEADERS += \
mimetypes/qmimeglobpattern_p.h \
mimetypes/qmimeprovider_p.h
-SOURCES += \
+ SOURCES += \
mimetypes/qmimedatabase.cpp \
mimetypes/qmimetype.cpp \
mimetypes/qmimemagicrulematcher.cpp \
@@ -20,6 +21,5 @@ SOURCES += \
mimetypes/qmimeglobpattern.cpp \
mimetypes/qmimeprovider.cpp
-!contains(DEFINES, QT_NO_MIMETYPE) {
RESOURCES += mimetypes/mimetypes.qrc
}
diff --git a/src/corelib/mimetypes/qmimedatabase.cpp b/src/corelib/mimetypes/qmimedatabase.cpp
index d866d3bcf7..f786b2ae03 100644
--- a/src/corelib/mimetypes/qmimedatabase.cpp
+++ b/src/corelib/mimetypes/qmimedatabase.cpp
@@ -246,7 +246,7 @@ bool QMimeDatabasePrivate::inherits(const QString &mime, const QString &parent)
The MIME type database is provided by the freedesktop.org shared-mime-info
project. If the MIME type database cannot be found on the system, as is the case
- on most Windows, OS X, and iOS systems, Qt will use its own copy of it.
+ on most Windows, \macos, and iOS systems, Qt will use its own copy of it.
Applications which want to define custom MIME types need to install an
XML file into the locations searched for MIME definitions.
diff --git a/src/corelib/plugin/qlibrary.cpp b/src/corelib/plugin/qlibrary.cpp
index 93a901d614..aff2991ed1 100644
--- a/src/corelib/plugin/qlibrary.cpp
+++ b/src/corelib/plugin/qlibrary.cpp
@@ -608,7 +608,7 @@ bool QLibraryPrivate::loadPlugin()
\row \li Unix/Linux \li \c .so
\row \li AIX \li \c .a
\row \li HP-UX \li \c .sl, \c .so (HP-UXi)
- \row \li OS X and iOS \li \c .dylib, \c .bundle, \c .so
+ \row \li \macos and iOS \li \c .dylib, \c .bundle, \c .so
\endtable
Trailing versioning numbers on Unix are ignored.
@@ -845,7 +845,7 @@ QLibrary::QLibrary(QObject *parent)
We recommend omitting the file's suffix in \a fileName, since
QLibrary will automatically look for the file with the appropriate
suffix in accordance with the platform, e.g. ".so" on Unix,
- ".dylib" on OS X and iOS, and ".dll" on Windows. (See \l{fileName}.)
+ ".dylib" on \macos and iOS, and ".dll" on Windows. (See \l{fileName}.)
*/
QLibrary::QLibrary(const QString& fileName, QObject *parent)
:QObject(parent), d(0), did_load(false)
@@ -862,7 +862,7 @@ QLibrary::QLibrary(const QString& fileName, QObject *parent)
We recommend omitting the file's suffix in \a fileName, since
QLibrary will automatically look for the file with the appropriate
suffix in accordance with the platform, e.g. ".so" on Unix,
- ".dylib" on OS X and iOS, and ".dll" on Windows. (See \l{fileName}.)
+ ".dylib" on \macos and iOS, and ".dll" on Windows. (See \l{fileName}.)
*/
QLibrary::QLibrary(const QString& fileName, int verNum, QObject *parent)
:QObject(parent), d(0), did_load(false)
@@ -878,7 +878,7 @@ QLibrary::QLibrary(const QString& fileName, int verNum, QObject *parent)
We recommend omitting the file's suffix in \a fileName, since
QLibrary will automatically look for the file with the appropriate
suffix in accordance with the platform, e.g. ".so" on Unix,
- ".dylib" on OS X and iOS, and ".dll" on Windows. (See \l{fileName}.)
+ ".dylib" on \macos and iOS, and ".dll" on Windows. (See \l{fileName}.)
*/
QLibrary::QLibrary(const QString& fileName, const QString &version, QObject *parent)
:QObject(parent), d(0), did_load(false)
diff --git a/src/corelib/plugin/qpluginloader.cpp b/src/corelib/plugin/qpluginloader.cpp
index 4752f69ff3..4ec4e43952 100644
--- a/src/corelib/plugin/qpluginloader.cpp
+++ b/src/corelib/plugin/qpluginloader.cpp
@@ -145,7 +145,7 @@ QPluginLoader::QPluginLoader(QObject *parent)
To be loadable, the file's suffix must be a valid suffix for a
loadable library in accordance with the platform, e.g. \c .so on
- Unix, - \c .dylib on OS X and iOS, and \c .dll on Windows. The suffix
+ Unix, - \c .dylib on \macos and iOS, and \c .dll on Windows. The suffix
can be verified with QLibrary::isLibrary().
\sa setFileName()
diff --git a/src/corelib/statemachine/qstatemachine.cpp b/src/corelib/statemachine/qstatemachine.cpp
index e3cfd7b988..db395b24dd 100644
--- a/src/corelib/statemachine/qstatemachine.cpp
+++ b/src/corelib/statemachine/qstatemachine.cpp
@@ -57,7 +57,7 @@
#include "private/qobject_p.h"
#include "private/qthread_p.h"
-#ifndef QT_NO_STATEMACHINE_EVENTFILTER
+#if QT_CONFIG(qeventtransition)
#include "qeventtransition.h"
#include "qeventtransition_p.h"
#endif
@@ -2196,7 +2196,7 @@ void QStateMachinePrivate::maybeRegisterTransition(QAbstractTransition *transiti
if (QSignalTransition *st = qobject_cast<QSignalTransition*>(transition)) {
maybeRegisterSignalTransition(st);
}
-#ifndef QT_NO_STATEMACHINE_EVENTFILTER
+#if QT_CONFIG(qeventtransition)
else if (QEventTransition *et = qobject_cast<QEventTransition*>(transition)) {
maybeRegisterEventTransition(et);
}
@@ -2208,7 +2208,7 @@ void QStateMachinePrivate::registerTransition(QAbstractTransition *transition)
if (QSignalTransition *st = qobject_cast<QSignalTransition*>(transition)) {
registerSignalTransition(st);
}
-#ifndef QT_NO_STATEMACHINE_EVENTFILTER
+#if QT_CONFIG(qeventtransition)
else if (QEventTransition *oet = qobject_cast<QEventTransition*>(transition)) {
registerEventTransition(oet);
}
@@ -2220,7 +2220,7 @@ void QStateMachinePrivate::unregisterTransition(QAbstractTransition *transition)
if (QSignalTransition *st = qobject_cast<QSignalTransition*>(transition)) {
unregisterSignalTransition(st);
}
-#ifndef QT_NO_STATEMACHINE_EVENTFILTER
+#if QT_CONFIG(qeventtransition)
else if (QEventTransition *oet = qobject_cast<QEventTransition*>(transition)) {
unregisterEventTransition(oet);
}
@@ -2342,7 +2342,7 @@ void QStateMachinePrivate::unregisterAllTransitions()
}
}
-#ifndef QT_NO_STATEMACHINE_EVENTFILTER
+#if QT_CONFIG(qeventtransition)
void QStateMachinePrivate::maybeRegisterEventTransition(QEventTransition *transition)
{
if ((state == Running) && configuration.contains(transition->sourceState()))
@@ -2872,7 +2872,7 @@ bool QStateMachine::event(QEvent *e)
return QState::event(e);
}
-#ifndef QT_NO_STATEMACHINE_EVENTFILTER
+#if QT_CONFIG(qeventtransition)
/*!
\reimp
*/
diff --git a/src/corelib/statemachine/qstatemachine.h b/src/corelib/statemachine/qstatemachine.h
index 843844e172..031d9ceee2 100644
--- a/src/corelib/statemachine/qstatemachine.h
+++ b/src/corelib/statemachine/qstatemachine.h
@@ -141,7 +141,7 @@ public:
QSet<QAbstractState*> configuration() const;
-#ifndef QT_NO_STATEMACHINE_EVENTFILTER
+#if QT_CONFIG(qeventtransition)
bool eventFilter(QObject *watched, QEvent *event) Q_DECL_OVERRIDE;
#endif
diff --git a/src/corelib/statemachine/qstatemachine_p.h b/src/corelib/statemachine/qstatemachine_p.h
index 1305558ef8..45634e27fb 100644
--- a/src/corelib/statemachine/qstatemachine_p.h
+++ b/src/corelib/statemachine/qstatemachine_p.h
@@ -66,7 +66,7 @@
QT_BEGIN_NAMESPACE
class QEvent;
-#ifndef QT_NO_STATEMACHINE_EVENTFILTER
+#if QT_CONFIG(qeventtransition)
class QEventTransition;
#endif
class QSignalEventGenerator;
@@ -186,7 +186,7 @@ public:
void registerSignalTransition(QSignalTransition *transition);
void unregisterSignalTransition(QSignalTransition *transition);
void registerMultiThreadedSignalTransitions();
-#ifndef QT_NO_STATEMACHINE_EVENTFILTER
+#if QT_CONFIG(qeventtransition)
void maybeRegisterEventTransition(QEventTransition *transition);
void registerEventTransition(QEventTransition *transition);
void unregisterEventTransition(QEventTransition *transition);
@@ -301,7 +301,7 @@ public:
QHash<const QObject*, QVector<int> > connections;
QMutex connectionsMutex;
-#ifndef QT_NO_STATEMACHINE_EVENTFILTER
+#if QT_CONFIG(qeventtransition)
QHash<QObject*, QHash<QEvent::Type, int> > qobjectEvents;
#endif
QFreeList<void> delayedEventIdFreeList;
diff --git a/src/corelib/statemachine/statemachine.pri b/src/corelib/statemachine/statemachine.pri
index c5396a2ef8..52df10a3bc 100644
--- a/src/corelib/statemachine/statemachine.pri
+++ b/src/corelib/statemachine/statemachine.pri
@@ -22,8 +22,10 @@ SOURCES += $$PWD/qstatemachine.cpp \
$$PWD/qabstracttransition.cpp \
$$PWD/qsignaltransition.cpp
-!contains(DEFINES, QT_NO_STATEMACHINE_EVENTFILTER) {
-HEADERS += $$PWD/qeventtransition.h \
- $$PWD/qeventtransition_p.h
-SOURCES += $$PWD/qeventtransition.cpp
+qtConfig(qeventtransition) {
+ HEADERS += \
+ $$PWD/qeventtransition.h \
+ $$PWD/qeventtransition_p.h
+ SOURCES += \
+ $$PWD/qeventtransition.cpp
}
diff --git a/src/corelib/thread/qfuture.h b/src/corelib/thread/qfuture.h
index 7ae5c68bb9..1f0c747f40 100644
--- a/src/corelib/thread/qfuture.h
+++ b/src/corelib/thread/qfuture.h
@@ -65,13 +65,7 @@ public:
explicit QFuture(QFutureInterface<T> *p) // internal
: d(*p)
{ }
- QFuture(const QFuture &other)
- : d(other.d)
- { }
- ~QFuture()
- { }
- inline QFuture &operator=(const QFuture &other);
bool operator==(const QFuture &other) const { return (d == other.d); }
bool operator!=(const QFuture &other) const { return (d != other.d); }
@@ -157,13 +151,6 @@ public: // Warning: the d pointer is not documented and is considered private.
};
template <typename T>
-inline QFuture<T> &QFuture<T>::operator=(const QFuture<T> &other)
-{
- d = other.d;
- return *this;
-}
-
-template <typename T>
inline T QFuture<T>::result() const
{
d.waitForResult(0);
@@ -195,13 +182,7 @@ public:
explicit QFuture(QFutureInterfaceBase *p) // internal
: d(*p)
{ }
- QFuture(const QFuture &other)
- : d(other.d)
- { }
- ~QFuture()
- { }
- QFuture &operator=(const QFuture &other);
bool operator==(const QFuture &other) const { return (d == other.d); }
bool operator!=(const QFuture &other) const { return (d != other.d); }
@@ -248,12 +229,6 @@ public:
mutable QFutureInterfaceBase d;
};
-inline QFuture<void> &QFuture<void>::operator=(const QFuture<void> &other)
-{
- d = other.d;
- return *this;
-}
-
inline QFuture<void> QFutureInterface<void>::future()
{
return QFuture<void>(this);
diff --git a/src/corelib/thread/qfutureinterface.h b/src/corelib/thread/qfutureinterface.h
index 1787ff3b93..559d26e231 100644
--- a/src/corelib/thread/qfutureinterface.h
+++ b/src/corelib/thread/qfutureinterface.h
@@ -285,21 +285,13 @@ template <>
class QFutureInterface<void> : public QFutureInterfaceBase
{
public:
- QFutureInterface<void>(State initialState = NoState)
+ explicit QFutureInterface<void>(State initialState = NoState)
: QFutureInterfaceBase(initialState)
{ }
- QFutureInterface<void>(const QFutureInterface<void> &other)
- : QFutureInterfaceBase(other)
- { }
static QFutureInterface<void> canceledResult()
{ return QFutureInterface(State(Started | Finished | Canceled)); }
- QFutureInterface<void> &operator=(const QFutureInterface<void> &other)
- {
- QFutureInterfaceBase::operator=(other);
- return *this;
- }
inline QFuture<void> future(); // implemented in qfuture.h
diff --git a/src/corelib/thread/qthread_unix.cpp b/src/corelib/thread/qthread_unix.cpp
index deedd61c17..ba5f2dca95 100644
--- a/src/corelib/thread/qthread_unix.cpp
+++ b/src/corelib/thread/qthread_unix.cpp
@@ -45,7 +45,7 @@
#include <private/qcoreapplication_p.h>
#include <private/qcore_unix_p.h>
-#if defined(Q_OS_OSX)
+#if defined(Q_OS_DARWIN)
# include <private/qeventdispatcher_cf_p.h>
#else
# if !defined(QT_NO_GLIB)
@@ -279,7 +279,7 @@ typedef void*(*QtThreadCallback)(void*);
void QThreadPrivate::createEventDispatcher(QThreadData *data)
{
-#if defined(Q_OS_OSX)
+#if defined(Q_OS_DARWIN)
bool ok = false;
int value = qEnvironmentVariableIntValue("QT_EVENT_DISPATCHER_CORE_FOUNDATION", &ok);
if (ok && value > 0)
diff --git a/src/corelib/tools/qalgorithms.h b/src/corelib/tools/qalgorithms.h
index 6e68bc7eb1..6e472e8b22 100644
--- a/src/corelib/tools/qalgorithms.h
+++ b/src/corelib/tools/qalgorithms.h
@@ -516,14 +516,19 @@ QT_DEPRECATED_X("Use std::binary_search") Q_OUTOFLINE_TEMPLATE RandomAccessItera
#endif // QT_DEPRECATED_SINCE(5, 2)
+#ifdef Q_CC_CLANG
// Clang had a bug where __builtin_ctz/clz/popcount were not marked as constexpr.
-#if !defined Q_CC_CLANG || (defined __apple_build_version__ && __clang_major__ >= 7) \
- || (Q_CC_CLANG >= 307)
+# if (defined __apple_build_version__ && __clang_major__ >= 7) || (Q_CC_CLANG >= 307)
+# define QT_HAS_CONSTEXPR_BUILTINS
+# endif
+#elif defined(Q_CC_MSVC) && !defined(Q_CC_INTEL) && !defined(Q_OS_WINCE) && !defined(Q_PROCESSOR_ARM)
+# define QT_HAS_CONSTEXPR_BUILTINS
+#elif defined(Q_CC_GNU)
# define QT_HAS_CONSTEXPR_BUILTINS
#endif
#if defined QT_HAS_CONSTEXPR_BUILTINS
-#if defined(Q_CC_GNU)
+#if defined(Q_CC_GNU) || defined(Q_CC_CLANG)
# define QT_HAS_BUILTIN_CTZS
Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_ctzs(quint16 v) Q_DECL_NOTHROW
{
diff --git a/src/corelib/tools/qcommandlineoption.cpp b/src/corelib/tools/qcommandlineoption.cpp
index 7482315909..c2b86014ba 100644
--- a/src/corelib/tools/qcommandlineoption.cpp
+++ b/src/corelib/tools/qcommandlineoption.cpp
@@ -147,7 +147,7 @@ QCommandLineOption::QCommandLineOption(const QStringList &names)
The description is set to \a description. It is customary to add a "."
at the end of the description.
- In addition, the \a valueName can be set if the option expects a value.
+ In addition, the \a valueName needs to be set if the option expects a value.
The default value for the option is set to \a defaultValue.
In Qt versions before 5.4, this constructor was \c explicit. In Qt 5.4
@@ -183,7 +183,7 @@ QCommandLineOption::QCommandLineOption(const QString &name, const QString &descr
The description is set to \a description. It is customary to add a "."
at the end of the description.
- In addition, the \a valueName can be set if the option expects a value.
+ In addition, the \a valueName needs to be set if the option expects a value.
The default value for the option is set to \a defaultValue.
In Qt versions before 5.4, this constructor was \c explicit. In Qt 5.4
diff --git a/src/corelib/tools/qcommandlineparser.cpp b/src/corelib/tools/qcommandlineparser.cpp
index 2450484ce9..4c55880915 100644
--- a/src/corelib/tools/qcommandlineparser.cpp
+++ b/src/corelib/tools/qcommandlineparser.cpp
@@ -52,6 +52,8 @@
QT_BEGIN_NAMESPACE
+extern void Q_CORE_EXPORT qt_call_post_routines();
+
typedef QHash<QString, int> NameHash_t;
class QCommandLineParserPrivate
@@ -588,6 +590,7 @@ void QCommandLineParser::process(const QStringList &arguments)
{
if (!d->parse(arguments)) {
showParserMessage(errorText() + QLatin1Char('\n'), ErrorMessage);
+ qt_call_post_routines();
::exit(EXIT_FAILURE);
}
@@ -1011,6 +1014,7 @@ Q_NORETURN void QCommandLineParser::showVersion()
showParserMessage(QCoreApplication::applicationName() + QLatin1Char(' ')
+ QCoreApplication::applicationVersion() + QLatin1Char('\n'),
UsageMessage);
+ qt_call_post_routines();
::exit(EXIT_SUCCESS);
}
@@ -1028,6 +1032,7 @@ Q_NORETURN void QCommandLineParser::showVersion()
Q_NORETURN void QCommandLineParser::showHelp(int exitCode)
{
showParserMessage(d->helpText(), UsageMessage);
+ qt_call_post_routines();
::exit(exitCode);
}
diff --git a/src/corelib/tools/qdatetimeparser.cpp b/src/corelib/tools/qdatetimeparser.cpp
index ac973b047f..3271e2a8c4 100644
--- a/src/corelib/tools/qdatetimeparser.cpp
+++ b/src/corelib/tools/qdatetimeparser.cpp
@@ -1723,11 +1723,9 @@ QDateTime QDateTimeParser::getMaximum() const
QString QDateTimeParser::getAmPmText(AmPm ap, Case cs) const
{
- if (ap == AmText) {
- return (cs == UpperCase ? tr("AM") : tr("am"));
- } else {
- return (cs == UpperCase ? tr("PM") : tr("pm"));
- }
+ const QLocale loc = locale();
+ QString raw = ap == AmText ? loc.amText() : loc.pmText();
+ return cs == UpperCase ? raw.toUpper() : raw.toLower();
}
/*
diff --git a/src/corelib/tools/qmap.cpp b/src/corelib/tools/qmap.cpp
index 90edeca0a8..406eb31923 100644
--- a/src/corelib/tools/qmap.cpp
+++ b/src/corelib/tools/qmap.cpp
@@ -539,9 +539,6 @@ void QMapDataBase::freeData(QMapDataBase *d)
Constructs a copy of \a other.
- This function is only available if Qt is configured with STL
- compatibility enabled.
-
\sa toStdMap()
*/
@@ -558,9 +555,6 @@ void QMapDataBase::freeData(QMapDataBase *d)
/*! \fn std::map<Key, T> QMap::toStdMap() const
Returns an STL map equivalent to this QMap.
-
- This function is only available if Qt is configured with STL
- compatibility enabled.
*/
/*! \fn QMap::~QMap()
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp
index 7c4280d36b..bf1bc3e650 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -5449,7 +5449,7 @@ int QString::compare_helper(const QChar *data1, int length1, QLatin1String s2,
platform-dependent manner. Use this function to present sorted
lists of strings to the user.
- On OS X and iOS this function compares according the
+ On \macos and iOS this function compares according the
"Order for sorted lists" setting in the International preferences panel.
\sa compare(), QLocale
@@ -9419,7 +9419,7 @@ QStringRef QStringRef::appendTo(QString *string) const
platform-dependent manner. Use this function to present sorted
lists of strings to the user.
- On OS X and iOS, this function compares according the
+ On \macos and iOS, this function compares according the
"Order for sorted lists" setting in the International prefereces panel.
\sa compare(), QLocale
@@ -9478,7 +9478,7 @@ QString &QString::append(const QStringRef &str)
{
if (str.string() == this) {
str.appendTo(this);
- } else if (str.string()) {
+ } else if (!str.isNull()) {
int oldSize = size();
resize(oldSize + str.size());
memcpy(data() + oldSize, str.unicode(), str.size() * sizeof(QChar));
diff --git a/src/corelib/tools/qtimezoneprivate_tz.cpp b/src/corelib/tools/qtimezoneprivate_tz.cpp
index 6e717f2233..96d04df0e2 100644
--- a/src/corelib/tools/qtimezoneprivate_tz.cpp
+++ b/src/corelib/tools/qtimezoneprivate_tz.cpp
@@ -909,13 +909,12 @@ QTimeZonePrivate::Data QTzTimeZonePrivate::data(qint64 forMSecsSinceEpoch) const
if (m_tranTimes.size() > 0 && m_tranTimes.last().atMSecsSinceEpoch < forMSecsSinceEpoch
&& !m_posixRule.isEmpty() && forMSecsSinceEpoch >= 0) {
const int year = QDateTime::fromMSecsSinceEpoch(forMSecsSinceEpoch, Qt::UTC).date().year();
- const int lastMSecs = (m_tranTimes.size() > 0) ? m_tranTimes.last().atMSecsSinceEpoch : 0;
- QVector<QTimeZonePrivate::Data> posixTrans = calculatePosixTransitions(m_posixRule, year - 1,
- year + 1, lastMSecs);
+ QVector<QTimeZonePrivate::Data> posixTrans =
+ calculatePosixTransitions(m_posixRule, year - 1, year + 1,
+ m_tranTimes.last().atMSecsSinceEpoch);
for (int i = posixTrans.size() - 1; i >= 0; --i) {
if (posixTrans.at(i).atMSecsSinceEpoch <= forMSecsSinceEpoch) {
- QTimeZonePrivate::Data data;
- data = posixTrans.at(i);
+ QTimeZonePrivate::Data data = posixTrans.at(i);
data.atMSecsSinceEpoch = forMSecsSinceEpoch;
return data;
}
@@ -953,9 +952,9 @@ QTimeZonePrivate::Data QTzTimeZonePrivate::nextTransition(qint64 afterMSecsSince
if (m_tranTimes.size() > 0 && m_tranTimes.last().atMSecsSinceEpoch < afterMSecsSinceEpoch
&& !m_posixRule.isEmpty() && afterMSecsSinceEpoch >= 0) {
const int year = QDateTime::fromMSecsSinceEpoch(afterMSecsSinceEpoch, Qt::UTC).date().year();
- const int lastMSecs = (m_tranTimes.size() > 0) ? m_tranTimes.last().atMSecsSinceEpoch : 0;
- QVector<QTimeZonePrivate::Data> posixTrans = calculatePosixTransitions(m_posixRule, year - 1,
- year + 1, lastMSecs);
+ QVector<QTimeZonePrivate::Data> posixTrans =
+ calculatePosixTransitions(m_posixRule, year - 1, year + 1,
+ m_tranTimes.last().atMSecsSinceEpoch);
for (int i = 0; i < posixTrans.size(); ++i) {
if (posixTrans.at(i).atMSecsSinceEpoch > afterMSecsSinceEpoch)
return posixTrans.at(i);
@@ -979,9 +978,9 @@ QTimeZonePrivate::Data QTzTimeZonePrivate::previousTransition(qint64 beforeMSecs
if (m_tranTimes.size() > 0 && m_tranTimes.last().atMSecsSinceEpoch < beforeMSecsSinceEpoch
&& !m_posixRule.isEmpty() && beforeMSecsSinceEpoch > 0) {
const int year = QDateTime::fromMSecsSinceEpoch(beforeMSecsSinceEpoch, Qt::UTC).date().year();
- const int lastMSecs = (m_tranTimes.size() > 0) ? m_tranTimes.last().atMSecsSinceEpoch : 0;
- QVector<QTimeZonePrivate::Data> posixTrans = calculatePosixTransitions(m_posixRule, year - 1,
- year + 1, lastMSecs);
+ QVector<QTimeZonePrivate::Data> posixTrans =
+ calculatePosixTransitions(m_posixRule, year - 1, year + 1,
+ m_tranTimes.last().atMSecsSinceEpoch);
for (int i = posixTrans.size() - 1; i >= 0; --i) {
if (posixTrans.at(i).atMSecsSinceEpoch < beforeMSecsSinceEpoch)
return posixTrans.at(i);
diff --git a/src/corelib/tools/tools.pri b/src/corelib/tools/tools.pri
index 853827e032..7ebd9cf710 100644
--- a/src/corelib/tools/tools.pri
+++ b/src/corelib/tools/tools.pri
@@ -146,14 +146,14 @@ else:win32 {
SOURCES += tools/qlocale_unix.cpp
}
-contains(QT_CONFIG, system-zlib) {
+qtConfig(system-zlib) {
include($$PWD/../../3rdparty/zlib_dependency.pri)
} else {
CONFIG += no_core_dep
include($$PWD/../../3rdparty/zlib.pri)
}
-contains(QT_CONFIG,icu) {
+qtConfig(icu) {
include($$PWD/../../3rdparty/icu_dependency.pri)
SOURCES += tools/qlocale_icu.cpp \
@@ -192,9 +192,9 @@ INCLUDEPATH += ../3rdparty/md5 \
../3rdparty/md4 \
../3rdparty/sha3
-contains(QT_CONFIG, system-doubleconversion) {
- LIBS_PRIVATE += -ldouble-conversion
-} else: contains(QT_CONFIG, doubleconversion) {
+qtConfig(system-doubleconversion) {
+ QMAKE_USE_PRIVATE += doubleconversion
+} else: qtConfig(doubleconversion) {
include($$PWD/../../3rdparty/double-conversion/double-conversion.pri)
}
diff --git a/src/dbus/dbus.pro b/src/dbus/dbus.pro
index 96a798ed66..43050dcea2 100644
--- a/src/dbus/dbus.pro
+++ b/src/dbus/dbus.pro
@@ -1,17 +1,11 @@
TARGET = QtDBus
QT = core-private
-CONFIG += link_pkgconfig
MODULE_CONFIG = dbusadaptors dbusinterfaces
-!contains(QMAKE_LIBS_DBUS, .*dbus-1.*) {
- win32:CONFIG(debug, debug|release):QMAKE_LIBS_DBUS += -ldbus-1d
- else:QMAKE_LIBS_DBUS += -ldbus-1
-}
-
DEFINES += DBUS_API_SUBJECT_TO_CHANGE
QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_DBUS
-contains(QT_CONFIG, dbus-linked) {
- LIBS_PRIVATE += $$QMAKE_LIBS_DBUS
+qtConfig(dbus-linked) {
+ QMAKE_USE_PRIVATE += dbus
DEFINES += QT_LINKED_LIBDBUS
}
diff --git a/src/dbus/qdbusconnection_p.h b/src/dbus/qdbusconnection_p.h
index bd100639d1..0b7c731810 100644
--- a/src/dbus/qdbusconnection_p.h
+++ b/src/dbus/qdbusconnection_p.h
@@ -280,7 +280,7 @@ public slots:
void socketWrite(int);
void objectDestroyed(QObject *o);
void relaySignal(QObject *obj, const QMetaObject *, int signalId, const QVariantList &args);
- void addSignalHook(const QString &key, const SignalHook &hook);
+ bool addSignalHook(const QString &key, const SignalHook &hook);
bool removeSignalHook(const QString &key, const SignalHook &hook);
private slots:
@@ -293,7 +293,7 @@ signals:
void dispatchStatusChanged();
void spyHooksFinished(const QDBusMessage &msg);
void messageNeedsSending(QDBusPendingCallPrivate *pcall, void *msg, int timeout = -1);
- void signalNeedsConnecting(const QString &key, const QDBusConnectionPrivate::SignalHook &hook);
+ bool signalNeedsConnecting(const QString &key, const QDBusConnectionPrivate::SignalHook &hook);
bool signalNeedsDisconnecting(const QString &key, const QDBusConnectionPrivate::SignalHook &hook);
void serviceOwnerChanged(const QString &name, const QString &oldOwner, const QString &newOwner);
void callWithCallbackFailed(const QDBusError &error, const QDBusMessage &message);
diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp
index 54418c213a..21bc3c8ac2 100644
--- a/src/dbus/qdbusintegrator.cpp
+++ b/src/dbus/qdbusintegrator.cpp
@@ -2187,20 +2187,16 @@ bool QDBusConnectionPrivate::connectSignal(const QString &service,
// check the slot
QDBusConnectionPrivate::SignalHook hook;
QString key;
- QString name2 = name;
- if (name2.isNull())
- name2.detach();
hook.signature = signature;
if (!prepareHook(hook, key, service, path, interface, name, argumentMatch, receiver, slot, 0, false))
return false; // don't connect
Q_ASSERT(thread() != QThread::currentThread());
- emit signalNeedsConnecting(key, hook);
- return true;
+ return emit signalNeedsConnecting(key, hook);
}
-void QDBusConnectionPrivate::addSignalHook(const QString &key, const SignalHook &hook)
+bool QDBusConnectionPrivate::addSignalHook(const QString &key, const SignalHook &hook)
{
QDBusWriteLocker locker(ConnectAction, this);
@@ -2216,7 +2212,7 @@ void QDBusConnectionPrivate::addSignalHook(const QString &key, const SignalHook
entry.midx == hook.midx &&
entry.argumentMatch == hook.argumentMatch) {
// no need to compare the parameters if it's the same slot
- return; // already there
+ return false; // already there
}
}
@@ -2228,7 +2224,7 @@ void QDBusConnectionPrivate::addSignalHook(const QString &key, const SignalHook
if (mit != matchRefCounts.end()) { // Match already present
mit.value() = mit.value() + 1;
- return;
+ return true;
}
matchRefCounts.insert(hook.matchRule, 1);
@@ -2255,6 +2251,7 @@ void QDBusConnectionPrivate::addSignalHook(const QString &key, const SignalHook
}
}
}
+ return true;
}
bool QDBusConnectionPrivate::disconnectSignal(const QString &service,
diff --git a/src/gui/accessible/accessible.pri b/src/gui/accessible/accessible.pri
index b7f341d5b7..8dd821fe6a 100644
--- a/src/gui/accessible/accessible.pri
+++ b/src/gui/accessible/accessible.pri
@@ -1,6 +1,6 @@
# Qt accessibility module
-contains(QT_CONFIG, accessibility) {
+qtConfig(accessibility) {
HEADERS += \
accessible/qaccessible.h \
accessible/qaccessiblecache_p.h \
diff --git a/src/gui/accessible/qaccessible.cpp b/src/gui/accessible/qaccessible.cpp
index e95315aea8..874b99be4f 100644
--- a/src/gui/accessible/qaccessible.cpp
+++ b/src/gui/accessible/qaccessible.cpp
@@ -91,7 +91,7 @@ QT_BEGIN_NAMESPACE
to replace or extend the default behavior of the static functions
in QAccessible.
- Qt supports Microsoft Active Accessibility (MSAA), OS X
+ Qt supports Microsoft Active Accessibility (MSAA), \macos
Accessibility, and the Unix/X11 AT-SPI standard. Other backends
can be supported using QAccessibleBridge.
diff --git a/src/gui/accessible/qaccessiblebridge.cpp b/src/gui/accessible/qaccessiblebridge.cpp
index ae66579ba7..c6a417e063 100644
--- a/src/gui/accessible/qaccessiblebridge.cpp
+++ b/src/gui/accessible/qaccessiblebridge.cpp
@@ -52,7 +52,7 @@ QT_BEGIN_NAMESPACE
\ingroup accessibility
\inmodule QtWidgets
- Qt supports Microsoft Active Accessibility (MSAA), OS X
+ Qt supports Microsoft Active Accessibility (MSAA), \macos
Accessibility, and the Unix/X11 AT-SPI standard. By subclassing
QAccessibleBridge, you can support other backends than the
predefined ones.
diff --git a/src/gui/doc/images/qcolor-saturation.png b/src/gui/doc/images/qcolor-saturation.png
index f28776aff5..9c104f7389 100644
--- a/src/gui/doc/images/qcolor-saturation.png
+++ b/src/gui/doc/images/qcolor-saturation.png
Binary files differ
diff --git a/src/gui/doc/images/qcolor-saturation.svg b/src/gui/doc/images/qcolor-saturation.svg
new file mode 100644
index 0000000000..608c2555e8
--- /dev/null
+++ b/src/gui/doc/images/qcolor-saturation.svg
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ version="1.1"
+ id="svg2"
+ viewBox="0 0 186.82259 45.046909"
+ height="12.713239mm"
+ width="52.725487mm">
+ <defs
+ id="defs4">
+ <linearGradient
+ id="linearGradient3346">
+ <stop
+ id="stop3348"
+ offset="0"
+ style="stop-color:#808080;stop-opacity:1" />
+ <stop
+ id="stop3350"
+ offset="1"
+ style="stop-color:#0000ff;stop-opacity:1" />
+ </linearGradient>
+ <linearGradient
+ gradientTransform="translate(109.31384,222.16879)"
+ gradientUnits="userSpaceOnUse"
+ y2="16.118341"
+ x2="200.35715"
+ y1="16.118341"
+ x1="3.7246187"
+ id="linearGradient3352"
+ xlink:href="#linearGradient3346" />
+ </defs>
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ transform="translate(-109.31384,-222.16879)"
+ id="layer1">
+ <rect
+ y="225.7121"
+ x="112.85714"
+ height="25.221529"
+ width="179.73599"
+ id="rect3336"
+ style="opacity:1;fill:url(#linearGradient3352);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.1;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+ <text
+ id="text3338"
+ y="263.53079"
+ x="113.03048"
+ style="font-style:normal;font-weight:normal;font-size:10px;line-height:125%;font-family:Sans;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ xml:space="preserve"><tspan
+ y="263.53079"
+ x="113.03048"
+ id="tspan3340">0</tspan></text>
+ <text
+ id="text3342"
+ y="263.53079"
+ x="271.76645"
+ style="font-style:normal;font-weight:normal;font-size:10px;line-height:125%;font-family:Sans;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ xml:space="preserve"><tspan
+ y="263.53079"
+ x="271.76645"
+ id="tspan3344">255</tspan></text>
+ </g>
+</svg>
diff --git a/src/gui/doc/images/qcolor-value.png b/src/gui/doc/images/qcolor-value.png
index 0e069123a9..add9b7f83d 100644
--- a/src/gui/doc/images/qcolor-value.png
+++ b/src/gui/doc/images/qcolor-value.png
Binary files differ
diff --git a/src/gui/doc/images/qcolor-value.svg b/src/gui/doc/images/qcolor-value.svg
new file mode 100644
index 0000000000..51c2de0338
--- /dev/null
+++ b/src/gui/doc/images/qcolor-value.svg
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ width="52.725487mm"
+ height="12.713239mm"
+ viewBox="0 0 186.82259 45.046909"
+ id="svg2"
+ version="1.1">
+ <defs
+ id="defs4">
+ <linearGradient
+ id="linearGradient3346">
+ <stop
+ style="stop-color:#000000;stop-opacity:1"
+ offset="0"
+ id="stop3348" />
+ <stop
+ style="stop-color:#ffffff;stop-opacity:1"
+ offset="1"
+ id="stop3350" />
+ </linearGradient>
+ <linearGradient
+ xlink:href="#linearGradient3346"
+ id="linearGradient3352"
+ x1="3.7246187"
+ y1="16.118341"
+ x2="183.57143"
+ y2="15.761199"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(109.31384,222.16879)" />
+ </defs>
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ id="layer1"
+ transform="translate(-109.31384,-222.16879)">
+ <rect
+ style="opacity:1;fill:url(#linearGradient3352);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.1;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="rect3336"
+ width="179.73599"
+ height="25.221529"
+ x="112.85714"
+ y="225.7121" />
+ <text
+ xml:space="preserve"
+ style="font-style:normal;font-weight:normal;font-size:10px;line-height:125%;font-family:Sans;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ x="113.03048"
+ y="263.53079"
+ id="text3338"><tspan
+ id="tspan3340"
+ x="113.03048"
+ y="263.53079">0</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-style:normal;font-weight:normal;font-size:10px;line-height:125%;font-family:Sans;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ x="271.76645"
+ y="263.53079"
+ id="text3342"><tspan
+ id="tspan3344"
+ x="271.76645"
+ y="263.53079">255</tspan></text>
+ </g>
+</svg>
diff --git a/src/gui/doc/src/dnd.qdoc b/src/gui/doc/src/dnd.qdoc
index 1238480be8..03b3cbfa24 100644
--- a/src/gui/doc/src/dnd.qdoc
+++ b/src/gui/doc/src/dnd.qdoc
@@ -399,7 +399,7 @@
On X11, the public \l{http://www.newplanetsoftware.com/xdnd/}{XDND
protocol} is used, while on Windows Qt uses the OLE standard, and
- Qt for OS X uses the Cocoa Drag Manager. On X11, XDND uses MIME,
+ Qt for \macos uses the Cocoa Drag Manager. On X11, XDND uses MIME,
so no translation is necessary. The Qt API is the same regardless of
the platform. On Windows, MIME-aware applications can communicate by
using clipboard format names that are MIME types. Already some
@@ -408,6 +408,6 @@
Custom classes for translating proprietary clipboard formats can be
registered by reimplementing QWinMime on Windows or
- QMacPasteboardMime on OS X.
+ QMacPasteboardMime on \macos.
*/
diff --git a/src/gui/doc/src/qtgui.qdoc b/src/gui/doc/src/qtgui.qdoc
index 9781135960..a9fe520d5e 100644
--- a/src/gui/doc/src/qtgui.qdoc
+++ b/src/gui/doc/src/qtgui.qdoc
@@ -187,6 +187,19 @@
More info in \l{Drag and Drop}
+ \section1 Licenses and Attributions
+
+ Qt GUI is available under commercial licenses from \l{The Qt Company}.
+ In addition, it is available under the
+ \l{GNU Lesser General Public License, version 3}, or
+ the \l{GNU General Public License, version 2}.
+ See \l{Qt Licensing} for further details.
+
+ Furthermore Qt GUI potentially contains third party
+ modules under following permissive licenses:
+
+ \generatelist{groupsbymodule attributions-qtgui}
+
\section1 Reference
\list
\li \l{Qt GUI C++ Classes}
diff --git a/src/gui/gui.pro b/src/gui/gui.pro
index d1d0041616..a6eaadd6c5 100644
--- a/src/gui/gui.pro
+++ b/src/gui/gui.pro
@@ -1,7 +1,7 @@
TARGET = QtGui
QT = core-private
-contains(QT_CONFIG, opengl.*): MODULE_CONFIG = opengl
+qtConfig(opengl.*): MODULE_CONFIG = opengl
DEFINES += QT_NO_USING_NAMESPACE
@@ -18,7 +18,7 @@ MODULE_PLUGIN_TYPES = \
egldeviceintegrations
# This is here only because the platform plugin is no module, obviously.
-contains(QT_CONFIG, angle) {
+qtConfig(angle) {
MODULE_AUX_INCLUDES = \
\$\$QT_MODULE_INCLUDE_BASE/QtANGLE
}
@@ -53,7 +53,7 @@ load(cmake_functions)
win32: CMAKE_WINDOWS_BUILD = True
-contains(QT_CONFIG, angle) {
+qtConfig(angle) {
CMAKE_GL_INCDIRS = $$CMAKE_INCLUDE_DIR
CMAKE_ANGLE_EGL_DLL_RELEASE = libEGL.dll
CMAKE_ANGLE_EGL_IMPLIB_RELEASE = libEGL.lib
@@ -66,22 +66,22 @@ contains(QT_CONFIG, angle) {
CMAKE_QT_OPENGL_IMPLEMENTATION = GLESv2
} else {
- contains(QT_CONFIG, egl) {
+ qtConfig(egl) {
CMAKE_EGL_LIBS = $$cmakeProcessLibs($$QMAKE_LIBS_EGL)
!isEmpty(QMAKE_LIBDIR_EGL): CMAKE_EGL_LIBDIR += $$cmakeTargetPath($$QMAKE_LIBDIR_EGL)
}
- contains(QT_CONFIG, opengles2) {
+ qtConfig(opengles2) {
!isEmpty(QMAKE_INCDIR_OPENGL_ES2): CMAKE_GL_INCDIRS = $$cmakeTargetPaths($$QMAKE_INCDIR_OPENGL_ES2)
CMAKE_OPENGL_INCDIRS = $$cmakePortablePaths($$QMAKE_INCDIR_OPENGL_ES2)
CMAKE_OPENGL_LIBS = $$cmakeProcessLibs($$QMAKE_LIBS_OPENGL_ES2)
!isEmpty(QMAKE_LIBDIR_OPENGL_ES2): CMAKE_OPENGL_LIBDIR = $$cmakePortablePaths($$QMAKE_LIBDIR_OPENGL_ES2)
CMAKE_GL_HEADER_NAME = GLES2/gl2.h
CMAKE_QT_OPENGL_IMPLEMENTATION = GLESv2
- } else:contains(QT_CONFIG, opengl) {
+ } else: qtConfig(opengl) {
!isEmpty(QMAKE_INCDIR_OPENGL): CMAKE_GL_INCDIRS = $$cmakeTargetPaths($$QMAKE_INCDIR_OPENGL)
CMAKE_OPENGL_INCDIRS = $$cmakePortablePaths($$QMAKE_INCDIR_OPENGL)
- !contains(QT_CONFIG, dynamicgl): CMAKE_OPENGL_LIBS = $$cmakeProcessLibs($$QMAKE_LIBS_OPENGL)
+ !qtConfig(dynamicgl): CMAKE_OPENGL_LIBS = $$cmakeProcessLibs($$QMAKE_LIBS_OPENGL)
!isEmpty(QMAKE_LIBDIR_OPENGL): CMAKE_OPENGL_LIBDIR = $$cmakePortablePaths($$QMAKE_LIBDIR_OPENGL)
CMAKE_GL_HEADER_NAME = GL/gl.h
mac: CMAKE_GL_HEADER_NAME = gl.h
@@ -89,6 +89,6 @@ contains(QT_CONFIG, angle) {
}
}
-contains(QT_CONFIG, egl): CMAKE_EGL_INCDIRS = $$cmakePortablePaths($$QMAKE_INCDIR_EGL)
+qtConfig(egl): CMAKE_EGL_INCDIRS = $$cmakePortablePaths($$QMAKE_INCDIR_EGL)
QMAKE_DYNAMIC_LIST_FILE = $$PWD/QtGui.dynlist
diff --git a/src/gui/image/image.pri b/src/gui/image/image.pri
index 378256516c..3c4d2c0bbf 100644
--- a/src/gui/image/image.pri
+++ b/src/gui/image/image.pri
@@ -53,6 +53,8 @@ SOURCES += \
win32:!winrt: SOURCES += image/qpixmap_win.cpp
+darwin: OBJECTIVE_SOURCES += image/qimage_darwin.mm
+
NO_PCH_SOURCES += image/qimage_compat.cpp
false: SOURCES += $$NO_PCH_SOURCES # Hack for QtCreator
@@ -69,7 +71,7 @@ SOURCES += \
image/qxbmhandler.cpp \
image/qxpmhandler.cpp
-contains(QT_CONFIG, png) {
+qtConfig(png) {
HEADERS += image/qpnghandler_p.h
SOURCES += image/qpnghandler.cpp
include($$PWD/../../3rdparty/png_dependency.pri)
diff --git a/src/gui/image/qicon.cpp b/src/gui/image/qicon.cpp
index c65ac7f92d..62ec8e93b2 100644
--- a/src/gui/image/qicon.cpp
+++ b/src/gui/image/qicon.cpp
@@ -1247,7 +1247,7 @@ void QIcon::setIsMask(bool isMask)
Returns \c true if this icon has been marked as a mask image.
Certain platforms render mask icons differently (for example,
- menu icons on OS X).
+ menu icons on \macos).
\sa setIsMask()
*/
diff --git a/src/gui/image/qiconloader.cpp b/src/gui/image/qiconloader.cpp
index 219daace5c..0faf8820dd 100644
--- a/src/gui/image/qiconloader.cpp
+++ b/src/gui/image/qiconloader.cpp
@@ -316,10 +316,8 @@ QIconTheme::QIconTheme(const QString &themeName)
#ifndef QT_NO_SETTINGS
if (themeIndex.exists()) {
const QSettings indexReader(themeIndex.fileName(), QSettings::IniFormat);
- QStringListIterator keyIterator(indexReader.allKeys());
- while (keyIterator.hasNext()) {
-
- const QString key = keyIterator.next();
+ const QStringList keys = indexReader.allKeys();
+ for (const QString &key : keys) {
if (key.endsWith(QLatin1String("/Size"))) {
// Note the QSettings ini-format does not accept
// slashes in key names, hence we have to cheat
diff --git a/src/gui/image/qimage.h b/src/gui/image/qimage.h
index a99134d3bb..91aaf673d0 100644
--- a/src/gui/image/qimage.h
+++ b/src/gui/image/qimage.h
@@ -54,6 +54,10 @@
#include <QtCore/qstringlist.h>
#endif
+#if defined(Q_OS_DARWIN) || defined(Q_QDOC)
+Q_FORWARD_DECLARE_MUTABLE_CG_TYPE(CGImage);
+#endif
+
QT_BEGIN_NAMESPACE
@@ -321,6 +325,11 @@ public:
static QPixelFormat toPixelFormat(QImage::Format format) Q_DECL_NOTHROW;
static QImage::Format toImageFormat(QPixelFormat format) Q_DECL_NOTHROW;
+ // Platform spesific conversion functions
+#if defined(Q_OS_DARWIN) || defined(Q_QDOC)
+ CGImageRef toCGImage() const Q_DECL_CF_RETURNS_RETAINED;
+#endif
+
#if QT_DEPRECATED_SINCE(5, 0)
QT_DEPRECATED inline QString text(const char *key, const char *lang = Q_NULLPTR) const;
QT_DEPRECATED inline QList<QImageTextKeyLang> textList() const;
diff --git a/src/gui/image/qimage_darwin.mm b/src/gui/image/qimage_darwin.mm
new file mode 100644
index 0000000000..d72733abd3
--- /dev/null
+++ b/src/gui/image/qimage_darwin.mm
@@ -0,0 +1,141 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL21$
+** 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 http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://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 2.1 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qimage.h"
+
+#include <private/qcore_mac_p.h>
+
+#import <Foundation/Foundation.h>
+#import <CoreGraphics/CoreGraphics.h>
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ Creates a \c CGImage equivalent to the QImage \a image. Returns a
+ \c CGImageRef handle.
+
+ The returned CGImageRef partakes in the QImage implicit sharing,
+ and holds a reference to the QImage data. CGImage is immutable
+ and will never detach the QImage. Writing to the QImage will detach
+ as usual.
+
+ This function is fast, and does not copy or convert image data.
+
+ The following image formats are supported, and will be mapped to
+ a corresponding native image type:
+
+ \table
+ \header
+ \li Qt
+ \li CoreGraphics
+ \row
+ \li Format_ARGB32
+ \li kCGImageAlphaFirst | kCGBitmapByteOrder32Host
+ \row
+ \li Format_RGB32
+ \li kCGImageAlphaNoneSkipFirst | kCGBitmapByteOrder32Host
+ \row
+ \li Format_RGBA8888_Premultiplied
+ \li kCGImageAlphaPremultipliedLast | kCGBitmapByteOrder32Big
+ \row
+ \li Format_RGBA8888
+ \li kCGImageAlphaLast | kCGBitmapByteOrder32Big
+ \row
+ \li Format_RGBX8888
+ \li kCGImageAlphaNoneSkipLast | kCGBitmapByteOrder32Big
+ \row
+ \li Format_ARGB32_Premultiplied
+ \li kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host
+ \endtable
+
+ Other formats are not supported; this function returns a null
+ CGImageRef for those cases. Users of this function may then
+ convert the QImage to a supported formate first, for example
+ Format_ARGB32_Premultiplied.
+
+ The CGImageRef color space is set to the sRGB color space.
+
+ \sa toNSImage()
+*/
+CGImageRef QImage::toCGImage() const
+{
+ if (isNull())
+ return nil;
+
+ // Determine the target native format
+ uint cgflags = kCGImageAlphaNone;
+ switch (format()) {
+ case QImage::Format_ARGB32:
+ cgflags = kCGImageAlphaFirst | kCGBitmapByteOrder32Host;
+ break;
+ case QImage::Format_RGB32:
+ cgflags = kCGImageAlphaNoneSkipFirst | kCGBitmapByteOrder32Host;
+ break;
+ case QImage::Format_RGBA8888_Premultiplied:
+ cgflags = kCGImageAlphaPremultipliedLast | kCGBitmapByteOrder32Big;
+ break;
+ case QImage::Format_RGBA8888:
+ cgflags = kCGImageAlphaLast | kCGBitmapByteOrder32Big;
+ break;
+ case QImage::Format_RGBX8888:
+ cgflags = kCGImageAlphaNoneSkipLast | kCGBitmapByteOrder32Big;
+ break;
+ case QImage::Format_ARGB32_Premultiplied:
+ cgflags = kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host;
+ break;
+ default: break;
+ }
+
+ // Format not supported: return nil CGImageRef
+ if (cgflags == kCGImageAlphaNone)
+ return nil;
+
+ // Create a data provider that owns a copy of the QImage and references the image data.
+ auto deleter = [](void *image, const void *, size_t)
+ { delete static_cast<QImage *>(image); };
+ QCFType<CGDataProviderRef> dataProvider =
+ CGDataProviderCreateWithData(new QImage(*this), bits(), byteCount(), deleter);
+
+ QCFType<CGColorSpaceRef> colorSpace = CGColorSpaceCreateWithName(kCGColorSpaceSRGB);
+
+ const size_t bitsPerComponent = 8;
+ const size_t bitsPerPixel = 32;
+ const CGFloat *decode = nullptr;
+ const bool shouldInterpolate = false;
+
+ return CGImageCreate(width(), height(), bitsPerComponent, bitsPerPixel,
+ this->bytesPerLine(), colorSpace, cgflags, dataProvider,
+ decode, shouldInterpolate, kCGRenderingIntentDefault);
+}
+
+QT_END_NAMESPACE
diff --git a/src/gui/image/qpixmap_blitter_p.h b/src/gui/image/qpixmap_blitter_p.h
index 546e2fef79..9889cfb8ec 100644
--- a/src/gui/image/qpixmap_blitter_p.h
+++ b/src/gui/image/qpixmap_blitter_p.h
@@ -60,7 +60,7 @@ QT_BEGIN_NAMESPACE
class Q_GUI_EXPORT QBlittablePlatformPixmap : public QPlatformPixmap
{
-// Q_DECLARE_PRIVATE(QBlittablePlatformPixmap);
+// Q_DECLARE_PRIVATE(QBlittablePlatformPixmap)
public:
QBlittablePlatformPixmap();
~QBlittablePlatformPixmap();
diff --git a/src/gui/kernel/kernel.pri b/src/gui/kernel/kernel.pri
index 0e224df1ff..3b7e03a0ff 100644
--- a/src/gui/kernel/kernel.pri
+++ b/src/gui/kernel/kernel.pri
@@ -139,7 +139,7 @@ SOURCES += \
kernel/qhighdpiscaling.cpp
-contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles2) {
+qtConfig(opengl(es2)?) {
HEADERS += \
kernel/qplatformopenglcontext.h \
kernel/qopenglcontext.h \
diff --git a/src/gui/kernel/qclipboard.cpp b/src/gui/kernel/qclipboard.cpp
index e9da36a42a..ec6c0bcc36 100644
--- a/src/gui/kernel/qclipboard.cpp
+++ b/src/gui/kernel/qclipboard.cpp
@@ -116,22 +116,22 @@ QT_BEGIN_NAMESPACE
\endlist
- \section1 Notes for OS X Users
+ \section1 Notes for \macos Users
- OS X supports a separate find buffer that holds the current
+ \macos supports a separate find buffer that holds the current
search string in Find operations. This find clipboard can be accessed
by specifying the FindBuffer mode.
- \section1 Notes for Windows and OS X Users
+ \section1 Notes for Windows and \macos Users
\list
- \li Windows and OS X do not support the global mouse
+ \li Windows and \macos do not support the global mouse
selection; they only supports the global clipboard, i.e. they
only add text to the clipboard when an explicit copy or cut is
made.
- \li Windows and OS X does not have the concept of ownership;
+ \li Windows and \macos does not have the concept of ownership;
the clipboard is a fully global resource so all applications are
notified of changes.
@@ -187,7 +187,7 @@ QClipboard::~QClipboard()
This signal is emitted when the clipboard data is changed.
- On OS X and with Qt version 4.3 or higher, clipboard
+ On \macos and with Qt version 4.3 or higher, clipboard
changes made by other applications will only be detected
when the application is activated.
@@ -199,7 +199,7 @@ QClipboard::~QClipboard()
This signal is emitted when the selection is changed. This only
applies to windowing systems that support selections, e.g. X11.
- Windows and OS X don't support selections.
+ Windows and \macos don't support selections.
\sa dataChanged(), findBufferChanged(), changed()
*/
@@ -209,7 +209,7 @@ QClipboard::~QClipboard()
\since 4.2
This signal is emitted when the find buffer is changed. This only
- applies to OS X.
+ applies to \macos.
With Qt version 4.3 or higher, clipboard changes made by other
applications will only be detected when the application is activated.
@@ -232,7 +232,7 @@ QClipboard::~QClipboard()
systems with a global mouse selection (e.g. X11).
\value FindBuffer indicates that data should be stored and retrieved from
- the Find buffer. This mode is used for holding search strings on OS X.
+ the Find buffer. This mode is used for holding search strings on \macos.
\omitvalue LastMode
diff --git a/src/gui/kernel/qdrag.cpp b/src/gui/kernel/qdrag.cpp
index 99d8dcb737..5b36f496f1 100644
--- a/src/gui/kernel/qdrag.cpp
+++ b/src/gui/kernel/qdrag.cpp
@@ -226,7 +226,7 @@ QObject *QDrag::target() const
from are specified in \a supportedActions. The default proposed action will be selected
among the allowed actions in the following order: Move, Copy and Link.
- \b{Note:} On Linux and OS X, the drag and drop operation
+ \b{Note:} On Linux and \macos, the drag and drop operation
can take some time, but this function does not block the event
loop. Other events are still delivered to the application while
the operation is performed. On Windows, the Qt event loop is
@@ -250,7 +250,7 @@ Qt::DropAction QDrag::exec(Qt::DropActions supportedActions)
The \a defaultDropAction determines which action will be proposed when the user performs a
drag without using modifier keys.
- \b{Note:} On Linux and OS X, the drag and drop operation
+ \b{Note:} On Linux and \macos, the drag and drop operation
can take some time, but this function does not block the event
loop. Other events are still delivered to the application while
the operation is performed. On Windows, the Qt event loop is
diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp
index d574ba5cc6..63876479bd 100644
--- a/src/gui/kernel/qevent.cpp
+++ b/src/gui/kernel/qevent.cpp
@@ -672,7 +672,7 @@ QHoverEvent::~QHoverEvent()
wheel event delta: angleDelta() returns the delta in wheel
degrees. This value is always provided. pixelDelta() returns
the delta in screen pixels and is available on platforms that
- have high-resolution trackpads, such as OS X. If that is the
+ have high-resolution trackpads, such as \macos. If that is the
case, source() will return Qt::MouseEventSynthesizedBySystem.
The functions pos() and globalPos() return the mouse cursor's
@@ -958,7 +958,7 @@ QWheelEvent::QWheelEvent(const QPointF &pos, const QPointF& globalPos,
Returns the scrolling distance in pixels on screen. This value is
provided on platforms that support high-resolution pixel-based
- delta values, such as OS X. The value should be used directly
+ delta values, such as \macos. The value should be used directly
to scroll content on screen.
Example:
@@ -1099,7 +1099,7 @@ QWheelEvent::QWheelEvent(const QPointF &pos, const QPointF& globalPos,
Returns the scrolling phase of this wheel event.
\note The Qt::ScrollBegin and Qt::ScrollEnd phases are currently
- supported only on OS X.
+ supported only on \macos.
*/
@@ -1717,7 +1717,7 @@ QCloseEvent::~QCloseEvent()
\ingroup events
Icon drag events are sent to widgets when the main icon of a window
- has been dragged away. On OS X, this happens when the proxy
+ has been dragged away. On \macos, this happens when the proxy
icon of a window is dragged off the title bar.
It is normal to begin using drag and drop in response to this
@@ -2727,15 +2727,15 @@ Qt::MouseButtons QTabletEvent::buttons() const
\row
\li Qt::ZoomNativeGesture
\li Magnification delta in percent.
- \li OS X: Two-finger pinch.
+ \li \macos: Two-finger pinch.
\row
\li Qt::SmartZoomNativeGesture
\li Boolean magnification state.
- \li OS X: Two-finger douple tap (trackpad) / One-finger douple tap (magic mouse).
+ \li \macos: Two-finger douple tap (trackpad) / One-finger douple tap (magic mouse).
\row
\li Qt::RotateNativeGesture
\li Rotation delta in degrees.
- \li OS X: Two-finger rotate.
+ \li \macos: Two-finger rotate.
\endtable
@@ -2758,7 +2758,7 @@ Qt::MouseButtons QTabletEvent::buttons() const
gesture position relative to the receiving widget or item,
window, and screen, respectively.
- \a realValue is the OS X event parameter, \a sequenceId and \a intValue are the Windows event parameters.
+ \a realValue is the \macos event parameter, \a sequenceId and \a intValue are the Windows event parameters.
*/
QNativeGestureEvent::QNativeGestureEvent(Qt::NativeGestureType type, const QPointF &localPos, const QPointF &windowPos,
const QPointF &screenPos, qreal realValue, ulong sequenceId, quint64 intValue)
@@ -3495,16 +3495,16 @@ QShowEvent::~QShowEvent()
when the operating system requests that a file or URL should be opened.
This is a high-level event that can be caused by different user actions
depending on the user's desktop environment; for example, double
- clicking on an file icon in the Finder on OS X.
+ clicking on an file icon in the Finder on \macos.
This event is only used to notify the application of a request.
It may be safely ignored.
- \note This class is currently supported for OS X only.
+ \note This class is currently supported for \macos only.
- \section1 OS X Example
+ \section1 \macos Example
- In order to trigger the event on OS X, the application must be configured
+ In order to trigger the event on \macos, the application must be configured
to let the OS know what kind of file(s) it should react on.
For example, the following \c Info.plist file declares that the application
@@ -3581,13 +3581,13 @@ bool QFileOpenEvent::openFile(QFile &file, QIODevice::OpenMode flags) const
\internal
\class QToolBarChangeEvent
\brief The QToolBarChangeEvent class provides an event that is
- sent whenever a the toolbar button is clicked on OS X.
+ sent whenever a the toolbar button is clicked on \macos.
\ingroup events
\inmodule QtGui
- The QToolBarChangeEvent is sent when the toolbar button is clicked. On Mac
- OS X, this is the long oblong button on the right side of the window
+ The QToolBarChangeEvent is sent when the toolbar button is clicked. On
+ \macos, this is the long oblong button on the right side of the window
title bar. The default implementation is to toggle the appearance (hidden or
shown) of the associated toolbars for the window.
*/
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index 416c899270..2ed7eb2cfb 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -1060,7 +1060,7 @@ QWindow *QGuiApplication::topLevelAt(const QPoint &pos)
\list
\li \c android
- \li \c cocoa is a platform plugin for OS X.
+ \li \c cocoa is a platform plugin for \macos.
\li \c directfb
\li \c eglfs is a platform plugin for running Qt5 applications on top of
EGL and OpenGL ES 2.0 without an actual windowing system (like X11
diff --git a/src/gui/kernel/qhighdpiscaling.cpp b/src/gui/kernel/qhighdpiscaling.cpp
index d6e467db59..76663cdc01 100644
--- a/src/gui/kernel/qhighdpiscaling.cpp
+++ b/src/gui/kernel/qhighdpiscaling.cpp
@@ -125,7 +125,7 @@ static inline qreal initialGlobalScaleFactor()
The devicePixelRatio seen by applications is the product of the Qt scale
factor and the OS scale factor. The value of the scale factors may be 1,
in which case two or more of the coordinate systems are equivalent. Platforms
- that (may) have an OS scale factor include OS X, iOS and Wayland.
+ that (may) have an OS scale factor include \macos, iOS and Wayland.
Note that the functions in this file do not work with the OS scale factor
directly and are limited to converting between device independent and native
diff --git a/src/gui/kernel/qkeysequence.cpp b/src/gui/kernel/qkeysequence.cpp
index e7b1f9e073..f1135db307 100644
--- a/src/gui/kernel/qkeysequence.cpp
+++ b/src/gui/kernel/qkeysequence.cpp
@@ -153,7 +153,7 @@ static bool qt_sequence_no_mnemonics = false;
Specifies whether mnemonics for menu items, labels, etc., should
be honored or not. On Windows and X11, this feature is
- on by default; on OS X, it is off. When this feature is off
+ on by default; on \macos, it is off. When this feature is off
(that is, when \a b is false), QKeySequence::mnemonic() always
returns an empty string.
@@ -217,7 +217,7 @@ void Q_GUI_EXPORT qt_set_sequence_auto_mnemonic(bool b) { qt_sequence_no_mnemoni
QKeySequence objects can be cast to a QString to obtain a human-readable
translated version of the sequence. Similarly, the toString() function
- produces human-readable strings for use in menus. On OS X, the
+ produces human-readable strings for use in menus. On \macos, the
appropriate symbols are used to describe keyboard shortcuts using special
keys on the Macintosh keyboard.
@@ -225,12 +225,12 @@ void Q_GUI_EXPORT qt_set_sequence_auto_mnemonic(bool b) { qt_sequence_no_mnemoni
code point of the character; for example, 'A' gives the same key sequence
as Qt::Key_A.
- \b{Note:} On OS X, references to "Ctrl", Qt::CTRL, Qt::Control
+ \note On \macos, references to "Ctrl", Qt::CTRL, Qt::Key_Control
and Qt::ControlModifier correspond to the \uicontrol Command keys on the
- Macintosh keyboard, and references to "Meta", Qt::META, Qt::Meta and
+ Macintosh keyboard, and references to "Meta", Qt::META, Qt::Key_Meta and
Qt::MetaModifier correspond to the \uicontrol Control keys. Developers on
- OS X can use the same shortcut descriptions across all platforms,
- and their applications will automatically work as expected on OS X.
+ \macos can use the same shortcut descriptions across all platforms,
+ and their applications will automatically work as expected on \macos.
\section1 Standard Shortcuts
@@ -239,18 +239,18 @@ void Q_GUI_EXPORT qt_set_sequence_auto_mnemonic(bool b) { qt_sequence_no_mnemoni
setting up actions in a typical application. The table below shows
some common key sequences that are often used for these standard
shortcuts by applications on four widely-used platforms. Note
- that on OS X, the \uicontrol Ctrl value corresponds to the \uicontrol
+ that on \macos, the \uicontrol Ctrl value corresponds to the \uicontrol
Command keys on the Macintosh keyboard, and the \uicontrol Meta value
corresponds to the \uicontrol Control keys.
\table
- \header \li StandardKey \li Windows \li OS X \li KDE \li GNOME
+ \header \li StandardKey \li Windows \li \macos \li KDE \li GNOME
\row \li HelpContents \li F1 \li Ctrl+? \li F1 \li F1
\row \li WhatsThis \li Shift+F1 \li Shift+F1 \li Shift+F1 \li Shift+F1
\row \li Open \li Ctrl+O \li Ctrl+O \li Ctrl+O \li Ctrl+O
\row \li Close \li Ctrl+F4, Ctrl+W \li Ctrl+W, Ctrl+F4 \li Ctrl+W \li Ctrl+W
\row \li Save \li Ctrl+S \li Ctrl+S \li Ctrl+S \li Ctrl+S
- \row \li Quit \li \li Ctrl+Q \li Qtrl+Q \li Qtrl+Q
+ \row \li Quit \li \li Ctrl+Q \li Ctrl+Q \li Ctrl+Q
\row \li SaveAs \li \li Ctrl+Shift+S \li \li Ctrl+Shift+S
\row \li New \li Ctrl+N \li Ctrl+N \li Ctrl+N \li Ctrl+N
\row \li Delete \li Del \li Del, Meta+D \li Del, Ctrl+D \li Del, Ctrl+D
@@ -726,7 +726,7 @@ static const struct {
\value InsertLineSeparator Insert a new line.
\value InsertParagraphSeparator Insert a new paragraph.
\value Italic Italic text.
- \value MoveToEndOfBlock Move cursor to end of block. This shortcut is only used on the OS X.
+ \value MoveToEndOfBlock Move cursor to end of block. This shortcut is only used on the \macos.
\value MoveToEndOfDocument Move cursor to end of document.
\value MoveToEndOfLine Move cursor to end of line.
\value MoveToNextChar Move cursor to next character.
@@ -737,7 +737,7 @@ static const struct {
\value MoveToPreviousLine Move cursor to previous line.
\value MoveToPreviousPage Move cursor to previous page.
\value MoveToPreviousWord Move cursor to previous word.
- \value MoveToStartOfBlock Move cursor to start of a block. This shortcut is only used on OS X.
+ \value MoveToStartOfBlock Move cursor to start of a block. This shortcut is only used on \macos.
\value MoveToStartOfDocument Move cursor to start of document.
\value MoveToStartOfLine Move cursor to start of line.
\value New Create new document.
@@ -755,7 +755,7 @@ static const struct {
\value Save Save document.
\value SelectAll Select all text.
\value Deselect Deselect text. Since 5.1
- \value SelectEndOfBlock Extend selection to the end of a text block. This shortcut is only used on OS X.
+ \value SelectEndOfBlock Extend selection to the end of a text block. This shortcut is only used on \macos.
\value SelectEndOfDocument Extend selection to end of document.
\value SelectEndOfLine Extend selection to end of line.
\value SelectNextChar Extend selection to next character.
@@ -766,7 +766,7 @@ static const struct {
\value SelectPreviousLine Extend selection to previous line.
\value SelectPreviousPage Extend selection to previous page.
\value SelectPreviousWord Extend selection to previous word.
- \value SelectStartOfBlock Extend selection to the start of a text block. This shortcut is only used on OS X.
+ \value SelectStartOfBlock Extend selection to the start of a text block. This shortcut is only used on \macos.
\value SelectStartOfDocument Extend selection to start of document.
\value SelectStartOfLine Extend selection to start of line.
\value Underline Underline text.
@@ -1523,7 +1523,7 @@ bool QKeySequence::isDetached() const
If the key sequence has no keys, an empty string is returned.
- On OS X, the string returned resembles the sequence that is
+ On \macos, the string returned resembles the sequence that is
shown in the menu bar.
\sa fromString()
diff --git a/src/gui/kernel/qopenglcontext_p.h b/src/gui/kernel/qopenglcontext_p.h
index 33e930eabe..57f70356b8 100644
--- a/src/gui/kernel/qopenglcontext_p.h
+++ b/src/gui/kernel/qopenglcontext_p.h
@@ -69,6 +69,7 @@ QT_BEGIN_NAMESPACE
class QOpenGLFunctions;
class QOpenGLContext;
+class QOpenGLFramebufferObject;
class QOpenGLMultiGroupSharedResource;
class Q_GUI_EXPORT QOpenGLSharedResource
@@ -212,6 +213,7 @@ public:
, workaround_missingPrecisionQualifiers(false)
, active_engine(0)
, qgl_current_fbo_invalid(false)
+ , qgl_current_fbo(Q_NULLPTR)
, defaultFboRedirect(0)
{
requestedFormat = QSurfaceFormat::defaultFormat();
@@ -250,6 +252,11 @@ public:
bool qgl_current_fbo_invalid;
+ // Set and unset in QOpenGLFramebufferObject::bind()/unbind().
+ // (Only meaningful for QOGLFBO since an FBO might be bound by other means)
+ // Saves us from querying the driver for the current FBO in most paths.
+ QOpenGLFramebufferObject *qgl_current_fbo;
+
QVariant nativeHandle;
GLuint defaultFboRedirect;
diff --git a/src/gui/kernel/qpalette.cpp b/src/gui/kernel/qpalette.cpp
index b5bcf94cd2..a992793246 100644
--- a/src/gui/kernel/qpalette.cpp
+++ b/src/gui/kernel/qpalette.cpp
@@ -388,7 +388,7 @@ static void qt_palette_from_color(QPalette &pal, const QColor &button)
\warning Some styles do not use the palette for all drawing, for
instance, if they make use of native theme engines. This is the
- case for both the Windows XP, Windows Vista, and the OS X
+ case for both the Windows XP, Windows Vista, and the \macos
styles.
\sa QApplication::setPalette(), QWidget::setPalette(), QColor
diff --git a/src/gui/kernel/qplatformcursor.cpp b/src/gui/kernel/qplatformcursor.cpp
index c644d4769a..af0214e016 100644
--- a/src/gui/kernel/qplatformcursor.cpp
+++ b/src/gui/kernel/qplatformcursor.cpp
@@ -49,16 +49,6 @@
QT_BEGIN_NAMESPACE
-QList<QPlatformCursor *> QPlatformCursorPrivate::getInstances()
-{
- QList<QPlatformCursor *> result;
- for (const QScreen *screen : qAsConst(QGuiApplicationPrivate::screen_list)) {
- if (QPlatformCursor *cursor = screen->handle()->cursor())
- result.push_back(cursor);
- }
- return result;
-}
-
/*!
\class QPlatformCursor
\since 5.0
diff --git a/src/gui/kernel/qplatformcursor.h b/src/gui/kernel/qplatformcursor.h
index f9c1607663..dddd9e5831 100644
--- a/src/gui/kernel/qplatformcursor.h
+++ b/src/gui/kernel/qplatformcursor.h
@@ -76,13 +76,6 @@ private:
QPoint hot;
};
-class QPlatformCursor;
-
-class Q_GUI_EXPORT QPlatformCursorPrivate {
-public:
- static QList<QPlatformCursor *> getInstances();
-};
-
class Q_GUI_EXPORT QPlatformCursor : public QObject {
public:
QPlatformCursor();
@@ -96,7 +89,6 @@ public:
virtual void setPos(const QPoint &pos);
private:
- Q_DECLARE_PRIVATE(QPlatformCursor)
friend void qt_qpa_set_cursor(QWidget * w, bool force);
friend class QApplicationPrivate;
};
diff --git a/src/gui/kernel/qwindowsysteminterface.cpp b/src/gui/kernel/qwindowsysteminterface.cpp
index 2cb9b8053f..73140b4f6f 100644
--- a/src/gui/kernel/qwindowsysteminterface.cpp
+++ b/src/gui/kernel/qwindowsysteminterface.cpp
@@ -448,6 +448,11 @@ void QWindowSystemInterface::unregisterTouchDevice(const QTouchDevice *device)
QTouchDevicePrivate::unregisterDevice(device);
}
+bool QWindowSystemInterface::isTouchDeviceRegistered(const QTouchDevice *device)
+{
+ return QTouchDevicePrivate::isRegistered(device);
+}
+
void QWindowSystemInterface::handleTouchEvent(QWindow *w, QTouchDevice *device,
const QList<TouchPoint> &points, Qt::KeyboardModifiers mods)
{
diff --git a/src/gui/kernel/qwindowsysteminterface.h b/src/gui/kernel/qwindowsysteminterface.h
index 3e2e9803b8..e7e47ac6d9 100644
--- a/src/gui/kernel/qwindowsysteminterface.h
+++ b/src/gui/kernel/qwindowsysteminterface.h
@@ -134,6 +134,7 @@ public:
static void registerTouchDevice(const QTouchDevice *device);
static void unregisterTouchDevice(const QTouchDevice *device);
+ static bool isTouchDeviceRegistered(const QTouchDevice *device);
static void handleTouchEvent(QWindow *w, QTouchDevice *device,
const QList<struct TouchPoint> &points, Qt::KeyboardModifiers mods = Qt::NoModifier);
static void handleTouchEvent(QWindow *w, ulong timestamp, QTouchDevice *device,
diff --git a/src/gui/opengl/opengl.pri b/src/gui/opengl/opengl.pri
index bdda5381ce..2c3cca6b18 100644
--- a/src/gui/opengl/opengl.pri
+++ b/src/gui/opengl/opengl.pri
@@ -1,9 +1,9 @@
# Qt gui library, opengl module
-contains(QT_CONFIG, opengl):CONFIG += opengl
-contains(QT_CONFIG, opengles2):CONFIG += opengles2
+qtConfig(opengl): CONFIG += opengl
+qtConfig(opengles2): CONFIG += opengles2
-contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles2) {
+qtConfig(opengl(es2)?) {
HEADERS += opengl/qopengl.h \
opengl/qopengl_p.h \
@@ -58,7 +58,7 @@ contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles2) {
opengl/qopengltexturehelper.cpp \
opengl/qopenglpixeltransferoptions.cpp
- !contains(QT_CONFIG, opengles2) {
+ !qtConfig(opengles2) {
HEADERS += opengl/qopenglfunctions_1_0.h \
opengl/qopenglfunctions_1_1.h \
opengl/qopenglfunctions_1_2.h \
@@ -117,7 +117,7 @@ contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles2) {
opengl/qopengltimerquery.cpp
}
- contains(QT_CONFIG, opengles2) {
+ qtConfig(opengles2) {
HEADERS += opengl/qopenglfunctions_es2.h
SOURCES += opengl/qopenglfunctions_es2.cpp
diff --git a/src/gui/opengl/qopenglframebufferobject.cpp b/src/gui/opengl/qopenglframebufferobject.cpp
index 3e82d5a649..1ccd78d2ed 100644
--- a/src/gui/opengl/qopenglframebufferobject.cpp
+++ b/src/gui/opengl/qopenglframebufferobject.cpp
@@ -1069,6 +1069,7 @@ bool QOpenGLFramebufferObject::bind()
d->funcs.glBindFramebuffer(GL_FRAMEBUFFER, d->fbo());
QOpenGLContextPrivate::get(current)->qgl_current_fbo_invalid = true;
+ QOpenGLContextPrivate::get(current)->qgl_current_fbo = this;
if (d->format.samples() == 0) {
// Create new textures to replace the ones stolen via takeTexture().
@@ -1108,7 +1109,9 @@ bool QOpenGLFramebufferObject::release()
if (current) {
d->funcs.glBindFramebuffer(GL_FRAMEBUFFER, current->defaultFramebufferObject());
- QOpenGLContextPrivate::get(current)->qgl_current_fbo_invalid = true;
+ QOpenGLContextPrivate *contextPrv = QOpenGLContextPrivate::get(current);
+ contextPrv->qgl_current_fbo_invalid = true;
+ contextPrv->qgl_current_fbo = Q_NULLPTR;
}
return true;
diff --git a/src/gui/opengl/qopenglversionfunctions.cpp b/src/gui/opengl/qopenglversionfunctions.cpp
index 9fa224b0aa..54df2e5734 100644
--- a/src/gui/opengl/qopenglversionfunctions.cpp
+++ b/src/gui/opengl/qopenglversionfunctions.cpp
@@ -194,7 +194,7 @@ void QAbstractOpenGLFunctionsPrivate::removeExternalFunctions(QOpenGLContext *co
Please note that some vendors, notably Apple, do not implement the
Compatibility profile. Therefore if you wish to target new OpenGL features
- on OS X then you should ensure that you request a Core profile context via
+ on \macos then you should ensure that you request a Core profile context via
QSurfaceFormat::setProfile().
Qt provides classes for all version and Core and Compatibility profile
diff --git a/src/gui/painting/qblittable_p.h b/src/gui/painting/qblittable_p.h
index d5e2e22799..24440c3c61 100644
--- a/src/gui/painting/qblittable_p.h
+++ b/src/gui/painting/qblittable_p.h
@@ -64,7 +64,7 @@ class QBlittablePrivate;
class Q_GUI_EXPORT QBlittable
{
- Q_DECLARE_PRIVATE(QBlittable);
+ Q_DECLARE_PRIVATE(QBlittable)
public:
enum Capability {
diff --git a/src/gui/painting/qcolor.cpp b/src/gui/painting/qcolor.cpp
index 269e6f2d97..56180af693 100644
--- a/src/gui/painting/qcolor.cpp
+++ b/src/gui/painting/qcolor.cpp
@@ -527,9 +527,10 @@ QString QColor::name(NameFormat format) const
{
switch (format) {
case HexRgb:
- return QString::asprintf("#%02x%02x%02x", red(), green(), blue());
+ return QLatin1Char('#') + QString::number(rgba() | 0x1000000, 16).rightRef(6);
case HexArgb:
- return QString::asprintf("#%02x%02x%02x%02x", alpha(), red(), green(), blue());
+ // it's called rgba() but it does return AARRGGBB
+ return QLatin1Char('#') + QString::number(rgba() | 0x100000000, 16).rightRef(8);
}
return QString();
}
diff --git a/src/gui/painting/qcolor.h b/src/gui/painting/qcolor.h
index faeccf7b91..6cf3a8e262 100644
--- a/src/gui/painting/qcolor.h
+++ b/src/gui/painting/qcolor.h
@@ -264,6 +264,7 @@ private:
friend Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QColor &);
#endif
};
+Q_DECLARE_TYPEINFO(QColor, QT_VERSION >= QT_VERSION_CHECK(6,0,0) ? Q_MOVABLE_TYPE : Q_RELOCATABLE_TYPE);
inline QColor::QColor() Q_DECL_NOTHROW
{ invalidate(); }
diff --git a/src/gui/painting/qcolor_p.cpp b/src/gui/painting/qcolor_p.cpp
index 96f9620300..b4ade9dc58 100644
--- a/src/gui/painting/qcolor_p.cpp
+++ b/src/gui/painting/qcolor_p.cpp
@@ -40,31 +40,37 @@
#include "qglobal.h"
#include "qrgb.h"
#include "qstringlist.h"
+#include "private/qtools_p.h"
#include <algorithm>
QT_BEGIN_NAMESPACE
-static inline int h2i(char hex)
-{
- if (hex >= '0' && hex <= '9')
- return hex - '0';
- if (hex >= 'a' && hex <= 'f')
- return hex - 'a' + 10;
- if (hex >= 'A' && hex <= 'F')
- return hex - 'A' + 10;
- return -1;
-}
-
+/*!
+ \internal
+ If s[0..1] is a valid hex number, returns its integer value,
+ otherwise returns -1.
+ */
static inline int hex2int(const char *s)
{
- return (h2i(s[0]) << 4) | h2i(s[1]);
+ 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)
{
- int h = h2i(s);
- return (h << 4) | h;
+ const int h = QtMiscUtils::fromHex(s);
+ return h < 0 ? h : (h << 4) | h;
}
bool qt_get_hex_rgb(const char *name, QRgb *rgb)
@@ -130,7 +136,7 @@ bool qt_get_hex_rgb(const QChar *str, int len, QRgb *rgb)
#define rgb(r,g,b) (0xff000000 | (r << 16) | (g << 8) | b)
static const struct RGBData {
- const char *name;
+ const char name[21];
uint value;
} rgbTbl[] = {
{ "aliceblue", rgb(240, 248, 255) },
diff --git a/src/gui/painting/qdatabuffer_p.h b/src/gui/painting/qdatabuffer_p.h
index 631584989a..77b5be0c4c 100644
--- a/src/gui/painting/qdatabuffer_p.h
+++ b/src/gui/painting/qdatabuffer_p.h
@@ -60,7 +60,7 @@ QT_BEGIN_NAMESPACE
template <typename Type> class QDataBuffer
{
- Q_DISABLE_COPY(QDataBuffer);
+ Q_DISABLE_COPY(QDataBuffer)
public:
QDataBuffer(int res)
{
diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp
index 853855b148..a385332d6d 100644
--- a/src/gui/painting/qdrawhelper.cpp
+++ b/src/gui/painting/qdrawhelper.cpp
@@ -2180,6 +2180,8 @@ static const uint * QT_FASTCALL fetchTransformedBilinearARGB32PM(uint *buffer, c
if (blendType != BlendTransformedBilinearTiled) {
#define BILINEAR_DOWNSCALE_BOUNDS_PROLOG \
+ const qint64 min_fx = qint64(image_x1) * fixed_scale; \
+ const qint64 max_fx = qint64(image_x2) * fixed_scale; \
while (b < end) { \
int x1 = (fx >> 16); \
int x2; \
@@ -2195,11 +2197,11 @@ static const uint * QT_FASTCALL fetchTransformedBilinearARGB32PM(uint *buffer, c
fx += fdx; \
++b; \
} \
- uint *boundedEnd; \
+ uint *boundedEnd = end; \
if (fdx > 0) \
- boundedEnd = qMin(end, buffer + uint((image_x2 - (fx >> 16)) / data->m11)); \
- else \
- boundedEnd = qMin(end, buffer + uint((image_x1 - (fx >> 16)) / data->m11)); \
+ boundedEnd = qMin(boundedEnd, b + (max_fx - fx) / fdx); \
+ else if (fdx < 0) \
+ boundedEnd = qMin(boundedEnd, b + (min_fx - fx) / fdx); \
boundedEnd -= 3;
#if defined(__SSE2__)
@@ -2336,6 +2338,10 @@ static const uint * QT_FASTCALL fetchTransformedBilinearARGB32PM(uint *buffer, c
if (blendType != BlendTransformedBilinearTiled) {
#define BILINEAR_ROTATE_BOUNDS_PROLOG \
+ const qint64 min_fx = qint64(image_x1) * fixed_scale; \
+ const qint64 max_fx = qint64(image_x2) * fixed_scale; \
+ const qint64 min_fy = qint64(image_y1) * fixed_scale; \
+ const qint64 max_fy = qint64(image_y2) * fixed_scale; \
while (b < end) { \
int x1 = (fx >> 16); \
int x2; \
@@ -2358,7 +2364,15 @@ static const uint * QT_FASTCALL fetchTransformedBilinearARGB32PM(uint *buffer, c
fy += fdy; \
++b; \
} \
- uint *boundedEnd = end - 3; \
+ uint *boundedEnd = end; \
+ if (fdx > 0) \
+ boundedEnd = qMin(boundedEnd, b + (max_fx - fx) / fdx); \
+ else if (fdx < 0) \
+ boundedEnd = qMin(boundedEnd, b + (min_fx - fx) / fdx); \
+ if (fdy > 0) \
+ boundedEnd = qMin(boundedEnd, b + (max_fy - fy) / fdy); \
+ else if (fdy < 0) \
+ boundedEnd = qMin(boundedEnd, b + (min_fy - fy) / fdy); \
boundedEnd -= 3;
#if defined(__SSE2__)
@@ -2377,15 +2391,6 @@ static const uint * QT_FASTCALL fetchTransformedBilinearARGB32PM(uint *buffer, c
const __m128i vbpl = _mm_shufflelo_epi16(_mm_cvtsi32_si128(bytesPerLine/4), _MM_SHUFFLE(0, 0, 0, 0));
while (b < boundedEnd) {
- 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;
-
const __m128i vy = _mm_packs_epi32(_mm_srli_epi32(v_fy, 16), _mm_setzero_si128());
// 4x16bit * 4x16bit -> 4x32bit
__m128i offset = _mm_unpacklo_epi16(_mm_mullo_epi16(vy, vbpl), _mm_mulhi_epi16(vy, vbpl));
@@ -2981,10 +2986,16 @@ static const QRgba64 *QT_FASTCALL fetchTransformedBilinear64(QRgba64 *buffer, co
sbuf2[i * 2 + 1] = ((const uint*)s2)[x2];
fx += fdx;
}
+ int fastLen;
+ if (fdx > 0)
+ fastLen = qMin(len, int((image_x2 - (fx >> 16)) / data->m11));
+ else
+ fastLen = qMin(len, int((image_x1 - (fx >> 16)) / data->m11));
+ fastLen -= 3;
const __m128i v_fdx = _mm_set1_epi32(fdx*4);
__m128i v_fx = _mm_setr_epi32(fx, fx + fdx, fx + fdx + fdx, fx + fdx + fdx + fdx);
- for (; i < len-3; i+=4) {
+ for (; i < fastLen; i += 4) {
int offset = _mm_extract_epi16(v_fx, 1);
sbuf1[i * 2 + 0] = ((const uint*)s1)[offset];
sbuf1[i * 2 + 1] = ((const uint*)s1)[offset + 1];
diff --git a/src/gui/painting/qgrayraster.c b/src/gui/painting/qgrayraster.c
index 2b850cfb2a..db3453898f 100644
--- a/src/gui/painting/qgrayraster.c
+++ b/src/gui/painting/qgrayraster.c
@@ -208,13 +208,13 @@
#define ONE_PIXEL ( 1L << PIXEL_BITS )
#define PIXEL_MASK ( -1L << PIXEL_BITS )
#define TRUNC( x ) ( (TCoord)( (x) >> PIXEL_BITS ) )
-#define SUBPIXELS( x ) ( (TPos)(x) << PIXEL_BITS )
+#define SUBPIXELS( x ) ( (TPos)(x) * ( 1 << PIXEL_BITS ) )
#define FLOOR( x ) ( (x) & -ONE_PIXEL )
#define CEILING( x ) ( ( (x) + ONE_PIXEL - 1 ) & -ONE_PIXEL )
#define ROUND( x ) ( ( (x) + ONE_PIXEL / 2 ) & -ONE_PIXEL )
#if PIXEL_BITS >= 6
-#define UPSCALE( x ) ( (x) << ( PIXEL_BITS - 6 ) )
+#define UPSCALE( x ) ( (x) * ( 1 << ( PIXEL_BITS - 6 ) ) )
#define DOWNSCALE( x ) ( (x) >> ( PIXEL_BITS - 6 ) )
#else
#define UPSCALE( x ) ( (x) >> ( 6 - PIXEL_BITS ) )
diff --git a/src/gui/painting/qpagesize.cpp b/src/gui/painting/qpagesize.cpp
index f53285d9cb..8831d60d48 100644
--- a/src/gui/painting/qpagesize.cpp
+++ b/src/gui/painting/qpagesize.cpp
@@ -400,7 +400,7 @@ static QPageSize::PageSizeId qt_idForPpdKey(const QString &ppdKey, QSize *match
{
if (ppdKey.isEmpty())
return QPageSize::Custom;
- QString key = ppdKey;
+ QStringRef key(&ppdKey);
// Remove any Rotated or Tranverse modifiers
if (key.endsWith(QLatin1String("Rotated")))
key.chop(7);
diff --git a/src/gui/painting/qpaintengine.cpp b/src/gui/painting/qpaintengine.cpp
index 020392409d..ddea168e72 100644
--- a/src/gui/painting/qpaintengine.cpp
+++ b/src/gui/painting/qpaintengine.cpp
@@ -155,7 +155,7 @@ QFont QTextItem::font() const
provided is the raster paint engine, which contains a software
rasterizer which supports the full feature set on all supported platforms.
This is the default for painting on QWidget-based classes in e.g. on Windows,
- X11 and OS X, it is the backend for painting on QImage and it is
+ X11 and \macos, it is the backend for painting on QImage and it is
used as a fallback for paint engines that do not support a certain
capability. In addition we provide QPaintEngine implementations for
OpenGL (accessible through QGLWidget) and printing (which allows using
@@ -372,8 +372,8 @@ void QPaintEngine::drawPolygon(const QPoint *points, int pointCount, PolygonDraw
\value X11
\value Windows
\value MacPrinter
- \value CoreGraphics OS X's Quartz2D (CoreGraphics)
- \value QuickDraw OS X's QuickDraw
+ \value CoreGraphics \macos's Quartz2D (CoreGraphics)
+ \value QuickDraw \macos's QuickDraw
\value QWindowSystem Qt for Embedded Linux
\value PostScript (No longer supported)
\value OpenGL
diff --git a/src/gui/painting/qpaintengine_blitter_p.h b/src/gui/painting/qpaintengine_blitter_p.h
index 0aa2901b88..40f5347b26 100644
--- a/src/gui/painting/qpaintengine_blitter_p.h
+++ b/src/gui/painting/qpaintengine_blitter_p.h
@@ -63,7 +63,7 @@ class QBlittable;
class Q_GUI_EXPORT QBlitterPaintEngine : public QRasterPaintEngine
{
- Q_DECLARE_PRIVATE(QBlitterPaintEngine);
+ Q_DECLARE_PRIVATE(QBlitterPaintEngine)
public:
QBlitterPaintEngine(QBlittablePlatformPixmap *p);
diff --git a/src/gui/painting/qrasterizer.cpp b/src/gui/painting/qrasterizer.cpp
index eca1cb590c..52501880e4 100644
--- a/src/gui/painting/qrasterizer.cpp
+++ b/src/gui/painting/qrasterizer.cpp
@@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE
typedef int Q16Dot16;
#define Q16Dot16ToFloat(i) ((i)/65536.)
#define FloatToQ16Dot16(i) (int)((i) * 65536.)
-#define IntToQ16Dot16(i) ((i) << 16)
+#define IntToQ16Dot16(i) ((i) * (1 << 16))
#define Q16Dot16ToInt(i) ((i) >> 16)
#define Q16Dot16Factor 65536
@@ -612,7 +612,7 @@ void QScanConverter::mergeLine(QT_FT_Vector a, QT_FT_Vector b)
int iBottom = qMin(m_bottom, int((b.y - 32 - rounding) >> 6));
if (iTop <= iBottom) {
- Q16Dot16 aFP = Q16Dot16Factor/2 + (a.x << 10) - rounding;
+ Q16Dot16 aFP = Q16Dot16Factor/2 + (a.x * (1 << 10)) - rounding;
if (b.x == a.x) {
Line line = { qBound(m_leftFP, aFP, m_rightFP), 0, iTop, iBottom, winding };
@@ -624,7 +624,7 @@ void QScanConverter::mergeLine(QT_FT_Vector a, QT_FT_Vector b)
Q16Dot16 xFP = aFP + Q16Dot16Multiply(slopeFP,
IntToQ16Dot16(iTop)
- + Q16Dot16Factor/2 - (a.y << 10));
+ + Q16Dot16Factor/2 - (a.y * (1 << 10)));
if (clip(xFP, iTop, iBottom, slopeFP, m_leftFP, winding))
return;
diff --git a/src/gui/painting/qregion.cpp b/src/gui/painting/qregion.cpp
index b39a23e7f2..1ba6345bf9 100644
--- a/src/gui/painting/qregion.cpp
+++ b/src/gui/painting/qregion.cpp
@@ -1035,7 +1035,7 @@ QRegion QRegion::intersect(const QRect &r) const
sort key and X as the minor sort key.
\endlist
\omit
- Only some platforms have these restrictions (Qt for Embedded Linux, X11 and OS X).
+ Only some platforms have these restrictions (Qt for Embedded Linux, X11 and \macos).
\endomit
*/
diff --git a/src/gui/painting/qregion.h b/src/gui/painting/qregion.h
index 72710553ef..4f0a071da8 100644
--- a/src/gui/painting/qregion.h
+++ b/src/gui/painting/qregion.h
@@ -178,6 +178,7 @@ Q_GUI_EXPORT
static const struct QRegionData shared_empty;
static void cleanUp(QRegionData *x);
};
+Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6(QRegion)
/*****************************************************************************
QRegion stream functions
diff --git a/src/gui/text/qcssparser.cpp b/src/gui/text/qcssparser.cpp
index 3e36a6d1c9..4548b6f8b9 100644
--- a/src/gui/text/qcssparser.cpp
+++ b/src/gui/text/qcssparser.cpp
@@ -403,8 +403,8 @@ ValueExtractor::ValueExtractor(const QVector<Declaration> &decls, const QPalette
LengthData ValueExtractor::lengthValue(const Value& v)
{
- QString s = v.variant.toString();
- s.reserve(s.length());
+ const QString str = v.variant.toString();
+ QStringRef s(&str);
LengthData data;
data.unit = LengthData::None;
if (s.endsWith(QLatin1String("px"), Qt::CaseInsensitive))
@@ -1442,11 +1442,13 @@ bool Declaration::realValue(qreal *real, const char *unit) const
const Value &v = d->values.at(0);
if (unit && v.type != Value::Length)
return false;
- QString s = v.variant.toString();
+ const QString str = v.variant.toString();
+ QStringRef s(&str);
if (unit) {
- if (!s.endsWith(QLatin1String(unit), Qt::CaseInsensitive))
+ const QLatin1String unitStr(unit);
+ if (!s.endsWith(unitStr, Qt::CaseInsensitive))
return false;
- s.chop(qstrlen(unit));
+ s.chop(unitStr.size());
}
bool ok = false;
qreal val = s.toDouble(&ok);
@@ -1459,11 +1461,13 @@ static bool intValueHelper(const QCss::Value &v, int *i, const char *unit)
{
if (unit && v.type != Value::Length)
return false;
- QString s = v.variant.toString();
+ const QString str = v.variant.toString();
+ QStringRef s(&str);
if (unit) {
- if (!s.endsWith(QLatin1String(unit), Qt::CaseInsensitive))
+ const QLatin1String unitStr(unit);
+ if (!s.endsWith(unitStr, Qt::CaseInsensitive))
return false;
- s.chop(qstrlen(unit));
+ s.chop(unitStr.size());
}
bool ok = false;
int val = s.toInt(&ok);
diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp
index 37b8c22920..3b24039ea6 100644
--- a/src/gui/text/qfont.cpp
+++ b/src/gui/text/qfont.cpp
@@ -730,7 +730,7 @@ void QFont::setFamily(const QString &family)
Returns the requested font style name, it will be used to match the
font with irregular styles (that can't be normalized in other style
properties). It depends on system font support, thus only works for
- OS X and X11 so far. On Windows irregular styles will be added
+ \macos and X11 so far. On Windows irregular styles will be added
as separate font families so there is no need for this.
\sa setFamily(), setStyle()
@@ -825,7 +825,7 @@ int QFont::pointSize() const
\li Vertical hinting (light)
\li Full hinting
\row
- \li Cocoa on OS X
+ \li Cocoa on \macos
\li No hinting
\li No hinting
\li No hinting
diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp
index cb1619e690..e8f29ce520 100644
--- a/src/gui/text/qfontdatabase.cpp
+++ b/src/gui/text/qfontdatabase.cpp
@@ -2048,7 +2048,7 @@ bool QFontDatabase::hasFamily(const QString &family) const
Returns \c true if and only if the \a family font family is private.
- This happens, for instance, on OS X and iOS, where the system UI fonts are not
+ This happens, for instance, on \macos and iOS, where the system UI fonts are not
accessible to the user. For completeness, QFontDatabase::families() returns all
font families, including the private ones. You should use this function if you
are developing a font selection control in order to keep private fonts hidden.
@@ -2810,6 +2810,7 @@ void QFontDatabase::load(const QFontPrivate *d, int script)
req.fallBackFamilies.clear();
}
+ Q_ASSERT(fe);
if (fe->symbol || (d->request.styleStrategy & QFont::NoFontMerging)) {
for (int i = 0; i < QChar::ScriptCount; ++i) {
if (!d->engineData->engines[i]) {
diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp
index ca6d33c7aa..46f5e6c070 100644
--- a/src/gui/text/qfontengine_ft.cpp
+++ b/src/gui/text/qfontengine_ft.cpp
@@ -1830,7 +1830,7 @@ glyph_metrics_t QFontEngineFT::alphaMapBoundingBox(glyph_t glyph, QFixed subPixe
static inline QImage alphaMapFromGlyphData(QFontEngineFT::Glyph *glyph, QFontEngine::GlyphFormat glyphFormat)
{
- if (glyph == Q_NULLPTR)
+ if (glyph == Q_NULLPTR || glyph->height == 0 || glyph->width == 0)
return QImage();
QImage::Format format = QImage::Format_Invalid;
@@ -1878,11 +1878,15 @@ QImage *QFontEngineFT::lockedAlphaMapForGlyph(glyph_t glyphIndex, QFixed subPixe
currentlyLockedAlphaMap = alphaMapFromGlyphData(glyph, neededFormat);
+ const bool glyphHasGeometry = glyph != Q_NULLPTR && glyph->height != 0 && glyph->width != 0;
if (!cacheEnabled && glyph != &emptyGlyph) {
currentlyLockedAlphaMap = currentlyLockedAlphaMap.copy();
delete glyph;
}
+ if (!glyphHasGeometry)
+ return Q_NULLPTR;
+
if (currentlyLockedAlphaMap.isNull())
return QFontEngine::lockedAlphaMapForGlyph(glyphIndex, subPixelPosition, neededFormat, t, offset);
diff --git a/src/gui/text/qrawfont.cpp b/src/gui/text/qrawfont.cpp
index 1fbe0ce9d1..8e6ffa5e94 100644
--- a/src/gui/text/qrawfont.cpp
+++ b/src/gui/text/qrawfont.cpp
@@ -86,7 +86,7 @@ QT_BEGIN_NAMESPACE
also have accessors to some relevant data in the physical font.
QRawFont only provides support for the main font technologies: GDI and DirectWrite on Windows
- platforms, FreeType on Linux platforms and CoreText on OS X. For other
+ platforms, FreeType on Linux platforms and CoreText on \macos. For other
font back-ends, the APIs will be disabled.
QRawFont can be constructed in a number of ways:
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp
index 1aaacdd00d..8a13455ee0 100644
--- a/src/gui/text/qtextengine.cpp
+++ b/src/gui/text/qtextengine.cpp
@@ -1567,12 +1567,13 @@ void QTextEngine::validate() const
layoutData = new LayoutData();
if (block.docHandle()) {
layoutData->string = block.text();
- if (block.next().isValid()) {
- if (option.flags() & QTextOption::ShowLineAndParagraphSeparators)
- layoutData->string += QChar(0xb6);
- } else if (option.flags() & QTextOption::ShowDocumentTerminator) {
+ const bool nextBlockValid = block.next().isValid();
+ if (!nextBlockValid && option.flags() & QTextOption::ShowDocumentTerminator) {
layoutData->string += QChar(0xA7);
+ } else if (option.flags() & QTextOption::ShowLineAndParagraphSeparators) {
+ layoutData->string += QLatin1Char(nextBlockValid ? 0xb6 : 0x20);
}
+
} else {
layoutData->string = text;
}
diff --git a/src/gui/text/qtextformat.cpp b/src/gui/text/qtextformat.cpp
index 2109b15a85..8adeb3e659 100644
--- a/src/gui/text/qtextformat.cpp
+++ b/src/gui/text/qtextformat.cpp
@@ -1335,7 +1335,7 @@ bool QTextFormat::operator==(const QTextFormat &rhs) const
\value WaveUnderline The text is underlined using a wave shaped line.
\value SpellCheckUnderline The underline is drawn depending on the QStyle::SH_SpellCeckUnderlineStyle
style hint of the QApplication style. By default this is mapped to
- WaveUnderline, on OS X it is mapped to DashDotLine.
+ WaveUnderline, on \macos it is mapped to DashDotLine.
\sa Qt::PenStyle
*/
diff --git a/src/gui/text/qzip.cpp b/src/gui/text/qzip.cpp
index 7cb89543ba..b68c36fd9e 100644
--- a/src/gui/text/qzip.cpp
+++ b/src/gui/text/qzip.cpp
@@ -498,11 +498,13 @@ QZipReader::FileInfo QZipPrivate::fillFileInfo(int index) const
// fix the file path, if broken (convert separators, eat leading and trailing ones)
fileInfo.filePath = QDir::fromNativeSeparators(fileInfo.filePath);
- while (!fileInfo.filePath.isEmpty() && (fileInfo.filePath.at(0) == QLatin1Char('.') || fileInfo.filePath.at(0) == QLatin1Char('/')))
- fileInfo.filePath = fileInfo.filePath.mid(1);
- while (!fileInfo.filePath.isEmpty() && fileInfo.filePath.at(fileInfo.filePath.size() - 1) == QLatin1Char('/'))
- fileInfo.filePath.chop(1);
+ QStringRef filePathRef(&fileInfo.filePath);
+ while (filePathRef.startsWith(QLatin1Char('.')) || filePathRef.startsWith(QLatin1Char('/')))
+ filePathRef = filePathRef.mid(1);
+ while (filePathRef.endsWith(QLatin1Char('/')))
+ filePathRef.chop(1);
+ fileInfo.filePath = filePathRef.toString();
return fileInfo;
}
diff --git a/src/gui/text/text.pri b/src/gui/text/text.pri
index be60ba72cc..3fe47a6645 100644
--- a/src/gui/text/text.pri
+++ b/src/gui/text/text.pri
@@ -85,7 +85,7 @@ SOURCES += \
HEADERS += \
text/qplatformfontdatabase.h
-contains(QT_CONFIG, harfbuzz)|contains(QT_CONFIG, system-harfbuzz) {
+qtConfig(harfbuzz)|qtConfig(system-harfbuzz) {
DEFINES += QT_ENABLE_HARFBUZZ_NG
include($$PWD/../../3rdparty/harfbuzz_dependency.pri)
diff --git a/src/network/access/http2/http2frames.cpp b/src/network/access/http2/http2frames.cpp
index 55e9f93b19..978bee09b1 100644
--- a/src/network/access/http2/http2frames.cpp
+++ b/src/network/access/http2/http2frames.cpp
@@ -51,46 +51,125 @@ namespace Http2
// HTTP/2 frames are defined by RFC7540, clauses 4 and 6.
-FrameStatus validate_frame_header(FrameType type, FrameFlags flags, quint32 payloadSize)
+Frame::Frame()
+ : buffer(frameHeaderSize)
{
+}
+
+FrameType Frame::type() const
+{
+ Q_ASSERT(buffer.size() >= frameHeaderSize);
+
+ if (int(buffer[3]) >= int(FrameType::LAST_FRAME_TYPE))
+ return FrameType::LAST_FRAME_TYPE;
+
+ return FrameType(buffer[3]);
+}
+
+quint32 Frame::streamID() const
+{
+ Q_ASSERT(buffer.size() >= frameHeaderSize);
+ return qFromBigEndian<quint32>(&buffer[5]);
+}
+
+FrameFlags Frame::flags() const
+{
+ Q_ASSERT(buffer.size() >= frameHeaderSize);
+ return FrameFlags(buffer[4]);
+}
+
+quint32 Frame::payloadSize() const
+{
+ Q_ASSERT(buffer.size() >= frameHeaderSize);
+ return buffer[0] << 16 | buffer[1] << 8 | buffer[2];
+}
+
+uchar Frame::padding() const
+{
+ Q_ASSERT(validateHeader() == FrameStatus::goodFrame);
+
+ if (!flags().testFlag(FrameFlag::PADDED))
+ return 0;
+
+ switch (type()) {
+ case FrameType::DATA:
+ case FrameType::PUSH_PROMISE:
+ case FrameType::HEADERS:
+ Q_ASSERT(buffer.size() > frameHeaderSize);
+ return buffer[frameHeaderSize];
+ default:
+ return 0;
+ }
+}
+
+bool Frame::priority(quint32 *streamID, uchar *weight) const
+{
+ Q_ASSERT(validatePayload() == FrameStatus::goodFrame);
+
+ if (buffer.size() <= frameHeaderSize)
+ return false;
+
+ const uchar *src = &buffer[0] + frameHeaderSize;
+ if (type() == FrameType::HEADERS && flags().testFlag(FrameFlag::PADDED))
+ ++src;
+
+ if ((type() == FrameType::HEADERS && flags().testFlag(FrameFlag::PRIORITY))
+ || type() == FrameType::PRIORITY) {
+ if (streamID)
+ *streamID = qFromBigEndian<quint32>(src);
+ if (weight)
+ *weight = src[4];
+ return true;
+ }
+
+ return false;
+}
+
+FrameStatus Frame::validateHeader() const
+{
+ // Should be called only on a frame with
+ // a complete header.
+ Q_ASSERT(buffer.size() >= frameHeaderSize);
+
+ const auto framePayloadSize = payloadSize();
// 4.2 Frame Size
- if (payloadSize > maxPayloadSize)
+ if (framePayloadSize > maxPayloadSize)
return FrameStatus::sizeError;
- switch (type) {
+ switch (type()) {
case FrameType::SETTINGS:
// SETTINGS ACK can not have any payload.
// The payload of a SETTINGS frame consists of zero
// or more parameters, each consisting of an unsigned
// 16-bit setting identifier and an unsigned 32-bit value.
// Thus the payload size must be a multiple of 6.
- if (flags.testFlag(FrameFlag::ACK) ? payloadSize : payloadSize % 6)
+ if (flags().testFlag(FrameFlag::ACK) ? framePayloadSize : framePayloadSize % 6)
return FrameStatus::sizeError;
break;
case FrameType::PRIORITY:
// 6.3 PRIORITY
- if (payloadSize != 5)
+ if (framePayloadSize != 5)
return FrameStatus::sizeError;
break;
case FrameType::PING:
// 6.7 PING
- if (payloadSize != 8)
+ if (framePayloadSize != 8)
return FrameStatus::sizeError;
break;
case FrameType::GOAWAY:
// 6.8 GOAWAY
- if (payloadSize < 8)
+ if (framePayloadSize < 8)
return FrameStatus::sizeError;
break;
case FrameType::RST_STREAM:
case FrameType::WINDOW_UPDATE:
// 6.4 RST_STREAM, 6.9 WINDOW_UPDATE
- if (payloadSize != 4)
+ if (framePayloadSize != 4)
return FrameStatus::sizeError;
break;
case FrameType::PUSH_PROMISE:
// 6.6 PUSH_PROMISE
- if (payloadSize < 4)
+ if (framePayloadSize < 4)
return FrameStatus::sizeError;
default:
// DATA/HEADERS/CONTINUATION will be verified
@@ -102,31 +181,37 @@ FrameStatus validate_frame_header(FrameType type, FrameFlags flags, quint32 payl
return FrameStatus::goodFrame;
}
-FrameStatus validate_frame_payload(FrameType type, FrameFlags flags,
- quint32 size, const uchar *src)
+FrameStatus Frame::validatePayload() const
{
- Q_ASSERT(!size || src);
+ // Should be called only on a complete frame with a valid header.
+ Q_ASSERT(validateHeader() == FrameStatus::goodFrame);
// Ignored, 5.1
- if (type == FrameType::LAST_FRAME_TYPE)
+ if (type() == FrameType::LAST_FRAME_TYPE)
return FrameStatus::goodFrame;
+ auto size = payloadSize();
+ Q_ASSERT(buffer.size() >= frameHeaderSize && size == buffer.size() - frameHeaderSize);
+
+ const uchar *src = size ? &buffer[0] + frameHeaderSize : nullptr;
+ const auto frameFlags = flags();
+ switch (type()) {
// 6.1 DATA, 6.2 HEADERS
- if (type == FrameType::DATA || type == FrameType::HEADERS) {
- if (flags.testFlag(FrameFlag::PADDED)) {
+ case FrameType::DATA:
+ case FrameType::HEADERS:
+ if (frameFlags.testFlag(FrameFlag::PADDED)) {
if (!size || size < src[0])
return FrameStatus::sizeError;
size -= src[0];
}
- if (type == FrameType::HEADERS && flags.testFlag(FrameFlag::PRIORITY)) {
+ if (type() == FrameType::HEADERS && frameFlags.testFlag(FrameFlag::PRIORITY)) {
if (size < 5)
return FrameStatus::sizeError;
}
- }
-
+ break;
// 6.6 PUSH_PROMISE
- if (type == FrameType::PUSH_PROMISE) {
- if (flags.testFlag(FrameFlag::PADDED)) {
+ case FrameType::PUSH_PROMISE:
+ if (frameFlags.testFlag(FrameFlag::PADDED)) {
if (!size || size < src[0])
return FrameStatus::sizeError;
size -= src[0];
@@ -134,284 +219,158 @@ FrameStatus validate_frame_payload(FrameType type, FrameFlags flags,
if (size < 4)
return FrameStatus::sizeError;
+ break;
+ default:
+ break;
}
return FrameStatus::goodFrame;
}
-FrameStatus validate_frame_payload(FrameType type, FrameFlags flags,
- const std::vector<uchar> &payload)
-{
- const uchar *src = payload.size() ? &payload[0] : nullptr;
- return validate_frame_payload(type, flags, quint32(payload.size()), src);
-}
-
-FrameReader::FrameReader(FrameReader &&rhs)
- : framePayload(std::move(rhs.framePayload))
+quint32 Frame::dataSize() const
{
- type = rhs.type;
- rhs.type = FrameType::LAST_FRAME_TYPE;
-
- flags = rhs.flags;
- rhs.flags = FrameFlag::EMPTY;
-
- streamID = rhs.streamID;
- rhs.streamID = 0;
+ Q_ASSERT(validatePayload() == FrameStatus::goodFrame);
- payloadSize = rhs.payloadSize;
- rhs.payloadSize = 0;
+ quint32 size = payloadSize();
+ if (const uchar pad = padding()) {
+ // + 1 one for a byte with padding number itself:
+ size -= pad + 1;
+ }
- incompleteRead = rhs.incompleteRead;
- rhs.incompleteRead = false;
+ if (priority())
+ size -= 5;
- offset = rhs.offset;
- rhs.offset = 0;
+ return size;
}
-FrameReader &FrameReader::operator = (FrameReader &&rhs)
+const uchar *Frame::dataBegin() const
{
- framePayload = std::move(rhs.framePayload);
-
- type = rhs.type;
- rhs.type = FrameType::LAST_FRAME_TYPE;
-
- flags = rhs.flags;
- rhs.flags = FrameFlag::EMPTY;
-
- streamID = rhs.streamID;
- rhs.streamID = 0;
-
- payloadSize = rhs.payloadSize;
- rhs.payloadSize = 0;
+ Q_ASSERT(validatePayload() == FrameStatus::goodFrame);
+ if (buffer.size() <= frameHeaderSize)
+ return nullptr;
- incompleteRead = rhs.incompleteRead;
- rhs.incompleteRead = false;
+ const uchar *src = &buffer[0] + frameHeaderSize;
+ if (padding())
+ ++src;
- offset = rhs.offset;
- rhs.offset = 0;
+ if (priority())
+ src += 5;
- return *this;
+ return src;
}
FrameStatus FrameReader::read(QAbstractSocket &socket)
{
- if (!incompleteRead) {
+ if (offset < frameHeaderSize) {
if (!readHeader(socket))
return FrameStatus::incompleteFrame;
- const auto status = validate_frame_header(type, flags, payloadSize);
+ const auto status = frame.validateHeader();
if (status != FrameStatus::goodFrame) {
// No need to read any payload.
return status;
}
- if (Http2PredefinedParameters::maxFrameSize < payloadSize)
+ if (Http2PredefinedParameters::maxFrameSize < frame.payloadSize())
return FrameStatus::sizeError;
- framePayload.resize(payloadSize);
- offset = 0;
- }
-
- if (framePayload.size()) {
- if (!readPayload(socket))
- return FrameStatus::incompleteFrame;
- }
-
- return validate_frame_payload(type, flags, framePayload);
-}
-
-bool FrameReader::padded(uchar *pad) const
-{
- Q_ASSERT(pad);
-
- if (!flags.testFlag(FrameFlag::PADDED))
- return false;
-
- if (type == FrameType::DATA
- || type == FrameType::PUSH_PROMISE
- || type == FrameType::HEADERS) {
- Q_ASSERT(framePayload.size() >= 1);
- *pad = framePayload[0];
- return true;
- }
-
- return false;
-}
-
-bool FrameReader::priority(quint32 *streamID, uchar *weight) const
-{
- Q_ASSERT(streamID);
- Q_ASSERT(weight);
-
- if (!framePayload.size())
- return false;
-
- const uchar *src = &framePayload[0];
- if (type == FrameType::HEADERS && flags.testFlag(FrameFlag::PADDED))
- ++src;
-
- if ((type == FrameType::HEADERS && flags.testFlag(FrameFlag::PRIORITY))
- || type == FrameType::PRIORITY) {
- *streamID = qFromBigEndian<quint32>(src);
- *weight = src[4];
- return true;
+ frame.buffer.resize(frame.payloadSize() + frameHeaderSize);
}
- return false;
-}
+ if (offset < frame.buffer.size() && !readPayload(socket))
+ return FrameStatus::incompleteFrame;
-quint32 FrameReader::dataSize() const
-{
- quint32 size = quint32(framePayload.size());
- uchar pad = 0;
- if (padded(&pad)) {
- // + 1 one for a byte with padding number itself:
- size -= pad + 1;
- }
-
- quint32 dummyID = 0;
- uchar dummyW = 0;
- if (priority(&dummyID, &dummyW))
- size -= 5;
+ // Reset the offset, our frame can be re-used
+ // now (re-read):
+ offset = 0;
- return size;
-}
-
-const uchar *FrameReader::dataBegin() const
-{
- if (!framePayload.size())
- return nullptr;
-
- const uchar *src = &framePayload[0];
- uchar dummyPad = 0;
- if (padded(&dummyPad))
- ++src;
-
- quint32 dummyID = 0;
- uchar dummyW = 0;
- if (priority(&dummyID, &dummyW))
- src += 5;
-
- return src;
+ return frame.validatePayload();
}
bool FrameReader::readHeader(QAbstractSocket &socket)
{
- if (socket.bytesAvailable() < frameHeaderSize)
- return false;
-
- uchar src[frameHeaderSize] = {};
- socket.read(reinterpret_cast<char*>(src), frameHeaderSize);
-
- payloadSize = src[0] << 16 | src[1] << 8 | src[2];
+ Q_ASSERT(offset < frameHeaderSize);
- type = FrameType(src[3]);
- if (int(type) >= int(FrameType::LAST_FRAME_TYPE))
- type = FrameType::LAST_FRAME_TYPE; // To be ignored, 5.1
+ auto &buffer = frame.buffer;
+ if (buffer.size() < frameHeaderSize)
+ buffer.resize(frameHeaderSize);
- flags = FrameFlags(src[4]);
- streamID = qFromBigEndian<quint32>(src + 5);
+ const auto chunkSize = socket.read(reinterpret_cast<char *>(&buffer[offset]),
+ frameHeaderSize - offset);
+ if (chunkSize > 0)
+ offset += chunkSize;
- return true;
+ return offset == frameHeaderSize;
}
bool FrameReader::readPayload(QAbstractSocket &socket)
{
- Q_ASSERT(offset <= framePayload.size());
+ Q_ASSERT(offset < frame.buffer.size());
+ Q_ASSERT(frame.buffer.size() > frameHeaderSize);
+ auto &buffer = frame.buffer;
// Casts and ugliness - to deal with MSVC. Values are guaranteed to fit into quint32.
- if (const auto residue = std::min(qint64(framePayload.size() - offset), socket.bytesAvailable())) {
- socket.read(reinterpret_cast<char *>(&framePayload[offset]), residue);
- offset += quint32(residue);
- }
+ const auto chunkSize = socket.read(reinterpret_cast<char *>(&buffer[offset]),
+ qint64(buffer.size() - offset));
+ if (chunkSize > 0)
+ offset += quint32(chunkSize);
- incompleteRead = offset < framePayload.size();
- return !incompleteRead;
+ return offset == buffer.size();
}
-
FrameWriter::FrameWriter()
{
- frameBuffer.reserve(Http2PredefinedParameters::maxFrameSize +
- Http2PredefinedParameters::frameHeaderSize);
}
FrameWriter::FrameWriter(FrameType type, FrameFlags flags, quint32 streamID)
{
- frameBuffer.reserve(Http2PredefinedParameters::maxFrameSize +
- Http2PredefinedParameters::frameHeaderSize);
start(type, flags, streamID);
}
void FrameWriter::start(FrameType type, FrameFlags flags, quint32 streamID)
{
- frameBuffer.resize(frameHeaderSize);
+ auto &buffer = frame.buffer;
+
+ buffer.resize(frameHeaderSize);
// The first three bytes - payload size, which is 0 for now.
- frameBuffer[0] = 0;
- frameBuffer[1] = 0;
- frameBuffer[2] = 0;
+ buffer[0] = 0;
+ buffer[1] = 0;
+ buffer[2] = 0;
- frameBuffer[3] = uchar(type);
- frameBuffer[4] = uchar(flags);
+ buffer[3] = uchar(type);
+ buffer[4] = uchar(flags);
- qToBigEndian(streamID, &frameBuffer[5]);
+ qToBigEndian(streamID, &buffer[5]);
}
void FrameWriter::setPayloadSize(quint32 size)
{
- Q_ASSERT(frameBuffer.size() >= frameHeaderSize);
+ auto &buffer = frame.buffer;
+
+ Q_ASSERT(buffer.size() >= frameHeaderSize);
Q_ASSERT(size < maxPayloadSize);
- frameBuffer[0] = size >> 16;
- frameBuffer[1] = size >> 8;
- frameBuffer[2] = size;
-}
-
-quint32 FrameWriter::payloadSize() const
-{
- Q_ASSERT(frameBuffer.size() >= frameHeaderSize);
- return frameBuffer[0] << 16 | frameBuffer[1] << 8 | frameBuffer[2];
+ buffer[0] = size >> 16;
+ buffer[1] = size >> 8;
+ buffer[2] = size;
}
void FrameWriter::setType(FrameType type)
{
- Q_ASSERT(frameBuffer.size() >= frameHeaderSize);
- frameBuffer[3] = uchar(type);
-}
-
-FrameType FrameWriter::type() const
-{
- Q_ASSERT(frameBuffer.size() >= frameHeaderSize);
- return FrameType(frameBuffer[3]);
+ Q_ASSERT(frame.buffer.size() >= frameHeaderSize);
+ frame.buffer[3] = uchar(type);
}
void FrameWriter::setFlags(FrameFlags flags)
{
- Q_ASSERT(frameBuffer.size() >= frameHeaderSize);
- frameBuffer[4] = uchar(flags);
+ Q_ASSERT(frame.buffer.size() >= frameHeaderSize);
+ frame.buffer[4] = uchar(flags);
}
void FrameWriter::addFlag(FrameFlag flag)
{
- setFlags(flags() | flag);
-}
-
-FrameFlags FrameWriter::flags() const
-{
- Q_ASSERT(frameBuffer.size() >= frameHeaderSize);
- return FrameFlags(frameBuffer[4]);
-}
-
-quint32 FrameWriter::streamID() const
-{
- return qFromBigEndian<quint32>(&frameBuffer[5]);
-}
-
-void FrameWriter::append(uchar val)
-{
- frameBuffer.push_back(val);
- updatePayloadSize();
+ setFlags(frame.flags() | flag);
}
void FrameWriter::append(const uchar *begin, const uchar *end)
@@ -419,64 +378,71 @@ void FrameWriter::append(const uchar *begin, const uchar *end)
Q_ASSERT(begin && end);
Q_ASSERT(begin < end);
- frameBuffer.insert(frameBuffer.end(), begin, end);
+ frame.buffer.insert(frame.buffer.end(), begin, end);
updatePayloadSize();
}
void FrameWriter::updatePayloadSize()
{
- // First, compute size:
- const quint32 payloadSize = quint32(frameBuffer.size() - frameHeaderSize);
- Q_ASSERT(payloadSize <= maxPayloadSize);
- setPayloadSize(payloadSize);
+ const quint32 size = quint32(frame.buffer.size() - frameHeaderSize);
+ Q_ASSERT(size <= maxPayloadSize);
+ setPayloadSize(size);
}
bool FrameWriter::write(QAbstractSocket &socket) const
{
- Q_ASSERT(frameBuffer.size() >= frameHeaderSize);
+ auto &buffer = frame.buffer;
+ Q_ASSERT(buffer.size() >= frameHeaderSize);
// Do some sanity check first:
- Q_ASSERT(int(type()) < int(FrameType::LAST_FRAME_TYPE));
- Q_ASSERT(validate_frame_header(type(), flags(), payloadSize()) == FrameStatus::goodFrame);
- const auto nWritten = socket.write(reinterpret_cast<const char *>(&frameBuffer[0]),
- frameBuffer.size());
- return nWritten != -1 && size_type(nWritten) == frameBuffer.size();
+ Q_ASSERT(int(frame.type()) < int(FrameType::LAST_FRAME_TYPE));
+ Q_ASSERT(frame.validateHeader() == FrameStatus::goodFrame);
+
+ const auto nWritten = socket.write(reinterpret_cast<const char *>(&buffer[0]),
+ buffer.size());
+ return nWritten != -1 && size_type(nWritten) == buffer.size();
}
bool FrameWriter::writeHEADERS(QAbstractSocket &socket, quint32 sizeLimit)
{
- Q_ASSERT(frameBuffer.size() >= frameHeaderSize);
+ auto &buffer = frame.buffer;
+ Q_ASSERT(buffer.size() >= frameHeaderSize);
if (sizeLimit > quint32(maxPayloadSize))
sizeLimit = quint32(maxPayloadSize);
- if (quint32(frameBuffer.size() - frameHeaderSize) <= sizeLimit) {
+ if (quint32(buffer.size() - frameHeaderSize) <= sizeLimit) {
+ addFlag(FrameFlag::END_HEADERS);
updatePayloadSize();
return write(socket);
}
+ // Our HPACK block does not fit into the size limit, remove
+ // END_HEADERS bit from the first frame, we'll later set
+ // it on the last CONTINUATION frame:
+ setFlags(frame.flags() & ~FrameFlags(FrameFlag::END_HEADERS));
// Write a frame's header (not controlled by sizeLimit) and
// as many bytes of payload as we can within sizeLimit,
// then send CONTINUATION frames, as needed.
setPayloadSize(sizeLimit);
const quint32 firstChunkSize = frameHeaderSize + sizeLimit;
- qint64 written = socket.write(reinterpret_cast<const char *>(&frameBuffer[0]),
+ qint64 written = socket.write(reinterpret_cast<const char *>(&buffer[0]),
firstChunkSize);
if (written != qint64(firstChunkSize))
return false;
- FrameWriter continuationFrame(FrameType::CONTINUATION, FrameFlag::EMPTY, streamID());
+ FrameWriter continuationWriter(FrameType::CONTINUATION, FrameFlag::EMPTY, frame.streamID());
quint32 offset = firstChunkSize;
- while (offset != frameBuffer.size()) {
- const auto chunkSize = std::min(sizeLimit, quint32(frameBuffer.size() - offset));
- if (chunkSize + offset == frameBuffer.size())
- continuationFrame.addFlag(FrameFlag::END_HEADERS);
- continuationFrame.setPayloadSize(chunkSize);
- if (!continuationFrame.write(socket))
+ while (offset != buffer.size()) {
+ const auto chunkSize = std::min(sizeLimit, quint32(buffer.size() - offset));
+ if (chunkSize + offset == buffer.size())
+ continuationWriter.addFlag(FrameFlag::END_HEADERS);
+ continuationWriter.setPayloadSize(chunkSize);
+ if (!continuationWriter.write(socket))
return false;
- written = socket.write(reinterpret_cast<const char *>(&frameBuffer[offset]),
+ written = socket.write(reinterpret_cast<const char *>(&buffer[offset]),
chunkSize);
if (written != qint64(chunkSize))
return false;
@@ -524,6 +490,6 @@ bool FrameWriter::writeDATA(QAbstractSocket &socket, quint32 sizeLimit,
return true;
}
-}
+} // Namespace Http2
QT_END_NAMESPACE
diff --git a/src/network/access/http2/http2frames_p.h b/src/network/access/http2/http2frames_p.h
index 6abed315ca..84ba9c3662 100644
--- a/src/network/access/http2/http2frames_p.h
+++ b/src/network/access/http2/http2frames_p.h
@@ -68,52 +68,53 @@ class QAbstractSocket;
namespace Http2
{
-class Q_AUTOTEST_EXPORT FrameReader
+struct Q_AUTOTEST_EXPORT Frame
{
- friend class QT_PREPEND_NAMESPACE(QHttp2ProtocolHandler);
-
-public:
- FrameReader() = default;
-
- FrameReader(const FrameReader &) = default;
- FrameReader(FrameReader &&rhs);
-
- FrameReader &operator = (const FrameReader &) = default;
- FrameReader &operator = (FrameReader &&rhs);
-
- FrameStatus read(QAbstractSocket &socket);
+ Frame();
+ // Reading these values without first forming a valid frame
+ // (either reading it from a socket or building it) will result
+ // in undefined behavior:
+ FrameType type() const;
+ quint32 streamID() const;
+ FrameFlags flags() const;
+ quint32 payloadSize() const;
+ uchar padding() const;
+ // In HTTP/2 a stream's priority is specified by its weight
+ // and a stream (id) it depends on:
+ bool priority(quint32 *streamID = nullptr,
+ uchar *weight = nullptr) const;
- bool padded(uchar *pad) const;
- bool priority(quint32 *streamID, uchar *weight) const;
+ FrameStatus validateHeader() const;
+ FrameStatus validatePayload() const;
- // N of bytes without padding and/or priority
+ // Number of payload bytes without padding and/or priority
quint32 dataSize() const;
// Beginning of payload without priority/padding
// bytes.
const uchar *dataBegin() const;
- FrameType type = FrameType::LAST_FRAME_TYPE;
- FrameFlags flags = FrameFlag::EMPTY;
- quint32 streamID = 0;
- quint32 payloadSize = 0;
+ std::vector<uchar> buffer;
+};
+class Q_AUTOTEST_EXPORT FrameReader
+{
+public:
+ FrameStatus read(QAbstractSocket &socket);
+
+ Frame &inboundFrame()
+ {
+ return frame;
+ }
private:
bool readHeader(QAbstractSocket &socket);
bool readPayload(QAbstractSocket &socket);
- // As soon as we got a header, we
- // know payload size, offset is
- // needed if we do not have enough
- // data and will read the next chunk.
- bool incompleteRead = false;
quint32 offset = 0;
- std::vector<uchar> framePayload;
+ Frame frame;
};
class Q_AUTOTEST_EXPORT FrameWriter
{
- friend class QT_PREPEND_NAMESPACE(QHttp2ProtocolHandler);
-
public:
using payload_type = std::vector<uchar>;
using size_type = payload_type::size_type;
@@ -121,19 +122,17 @@ public:
FrameWriter();
FrameWriter(FrameType type, FrameFlags flags, quint32 streamID);
- void start(FrameType type, FrameFlags flags, quint32 streamID);
+ Frame &outboundFrame()
+ {
+ return frame;
+ }
+ // Frame 'builders':
+ void start(FrameType type, FrameFlags flags, quint32 streamID);
void setPayloadSize(quint32 size);
- quint32 payloadSize() const;
-
void setType(FrameType type);
- FrameType type() const;
-
void setFlags(FrameFlags flags);
void addFlag(FrameFlag flag);
- FrameFlags flags() const;
-
- quint32 streamID() const;
// All append functions also update frame's payload
// length.
@@ -144,7 +143,11 @@ public:
qToBigEndian(val, wired);
append(wired, wired + sizeof val);
}
- void append(uchar val);
+ void append(uchar val)
+ {
+ frame.buffer.push_back(val);
+ updatePayloadSize();
+ }
void append(Settings identifier)
{
append(quint16(identifier));
@@ -156,25 +159,23 @@ public:
void append(const uchar *begin, const uchar *end);
- // Write 'frameBuffer' as a single frame:
+ // Write as a single frame:
bool write(QAbstractSocket &socket) const;
- // Write as a single frame if we can, or write headers and
- // CONTINUATION(s) frame(s).
+ // Two types of frames we are sending are affected by
+ // frame size limits: HEADERS and DATA. HEADERS' payload
+ // (hpacked HTTP headers, following a frame header)
+ // is always in our 'buffer', we send the initial HEADERS
+ // frame first and then CONTINUTATION frame(s) if needed:
bool writeHEADERS(QAbstractSocket &socket, quint32 sizeLimit);
- // Write either a single DATA frame or several DATA frames
- // depending on 'sizeLimit'. Data itself is 'external' to
- // FrameWriter, since it's a 'readPointer' from QNonContiguousData.
+ // With DATA frames the actual payload is never in our 'buffer',
+ // it's a 'readPointer' from QNonContiguousData. We split
+ // this payload as needed into DATA frames with correct
+ // payload size fitting into frame size limit:
bool writeDATA(QAbstractSocket &socket, quint32 sizeLimit,
const uchar *src, quint32 size);
-
- std::vector<uchar> &rawFrameBuffer()
- {
- return frameBuffer;
- }
-
private:
void updatePayloadSize();
- std::vector<uchar> frameBuffer;
+ Frame frame;
};
}
diff --git a/src/network/access/http2/http2streams.cpp b/src/network/access/http2/http2streams.cpp
index f57f8d8367..660100f5e4 100644
--- a/src/network/access/http2/http2streams.cpp
+++ b/src/network/access/http2/http2streams.cpp
@@ -49,6 +49,10 @@ QT_BEGIN_NAMESPACE
namespace Http2
{
+Stream::Stream()
+{
+}
+
Stream::Stream(const HttpMessagePair &message, quint32 id, qint32 sendSize, qint32 recvSize)
: httpPair(message),
streamID(id),
diff --git a/src/network/access/http2/http2streams_p.h b/src/network/access/http2/http2streams_p.h
index 5d9a6ab512..8a825a5457 100644
--- a/src/network/access/http2/http2streams_p.h
+++ b/src/network/access/http2/http2streams_p.h
@@ -73,11 +73,10 @@ struct Q_AUTOTEST_EXPORT Stream
closed
};
- Stream() = default;
+ Stream();
Stream(const HttpMessagePair &message, quint32 streamID, qint32 sendSize,
qint32 recvSize);
- // TODO: check includes!!!
QHttpNetworkReply *reply() const;
const QHttpNetworkRequest &request() const;
QHttpNetworkRequest &request();
diff --git a/src/network/access/qhttp2protocolhandler.cpp b/src/network/access/qhttp2protocolhandler.cpp
index 937686920c..68a00c6837 100644
--- a/src/network/access/qhttp2protocolhandler.cpp
+++ b/src/network/access/qhttp2protocolhandler.cpp
@@ -40,7 +40,7 @@
#include "qhttpnetworkconnection_p.h"
#include "qhttp2protocolhandler_p.h"
-#if !defined(QT_NO_HTTP) && !defined(QT_NO_SSL)
+#if !defined(QT_NO_HTTP)
#include "http2/bitstreams_p.h"
@@ -170,64 +170,63 @@ void QHttp2ProtocolHandler::_q_receiveReply()
Q_ASSERT(m_socket);
Q_ASSERT(m_channel);
- const auto result = inboundFrame.read(*m_socket);
- switch (result) {
- case FrameStatus::incompleteFrame:
- return;
- case FrameStatus::protocolError:
- return connectionError(PROTOCOL_ERROR, "invalid frame");
- case FrameStatus::sizeError:
- return connectionError(FRAME_SIZE_ERROR, "invalid frame size");
- default:
- break;
- }
+ do {
+ const auto result = frameReader.read(*m_socket);
+ switch (result) {
+ case FrameStatus::incompleteFrame:
+ return;
+ case FrameStatus::protocolError:
+ return connectionError(PROTOCOL_ERROR, "invalid frame");
+ case FrameStatus::sizeError:
+ return connectionError(FRAME_SIZE_ERROR, "invalid frame size");
+ default:
+ break;
+ }
- Q_ASSERT(result == FrameStatus::goodFrame);
+ Q_ASSERT(result == FrameStatus::goodFrame);
- if (continuationExpected && inboundFrame.type != FrameType::CONTINUATION)
- return connectionError(PROTOCOL_ERROR, "CONTINUATION expected");
+ inboundFrame = std::move(frameReader.inboundFrame());
- switch (inboundFrame.type) {
- case FrameType::DATA:
- handleDATA();
- break;
- case FrameType::HEADERS:
- handleHEADERS();
- break;
- case FrameType::PRIORITY:
- handlePRIORITY();
- break;
- case FrameType::RST_STREAM:
- handleRST_STREAM();
- break;
- case FrameType::SETTINGS:
- handleSETTINGS();
- break;
- case FrameType::PUSH_PROMISE:
- handlePUSH_PROMISE();
- break;
- case FrameType::PING:
- handlePING();
- break;
- case FrameType::GOAWAY:
- handleGOAWAY();
- break;
- case FrameType::WINDOW_UPDATE:
- handleWINDOW_UPDATE();
- break;
- case FrameType::CONTINUATION:
- handleCONTINUATION();
- break;
- case FrameType::LAST_FRAME_TYPE:
- // 5.1 - ignore unknown frames.
- break;
- }
-
- if (goingAway && !activeStreams.size())
- return;
+ const auto frameType = inboundFrame.type();
+ if (continuationExpected && frameType != FrameType::CONTINUATION)
+ return connectionError(PROTOCOL_ERROR, "CONTINUATION expected");
- if (m_socket->bytesAvailable())
- QMetaObject::invokeMethod(m_channel, "_q_receiveReply", Qt::QueuedConnection);
+ switch (frameType) {
+ case FrameType::DATA:
+ handleDATA();
+ break;
+ case FrameType::HEADERS:
+ handleHEADERS();
+ break;
+ case FrameType::PRIORITY:
+ handlePRIORITY();
+ break;
+ case FrameType::RST_STREAM:
+ handleRST_STREAM();
+ break;
+ case FrameType::SETTINGS:
+ handleSETTINGS();
+ break;
+ case FrameType::PUSH_PROMISE:
+ handlePUSH_PROMISE();
+ break;
+ case FrameType::PING:
+ handlePING();
+ break;
+ case FrameType::GOAWAY:
+ handleGOAWAY();
+ break;
+ case FrameType::WINDOW_UPDATE:
+ handleWINDOW_UPDATE();
+ break;
+ case FrameType::CONTINUATION:
+ handleCONTINUATION();
+ break;
+ case FrameType::LAST_FRAME_TYPE:
+ // 5.1 - ignore unknown frames.
+ break;
+ }
+ } while (!goingAway || activeStreams.size());
}
bool QHttp2ProtocolHandler::sendRequest()
@@ -293,14 +292,14 @@ bool QHttp2ProtocolHandler::sendClientPreface()
return false;
// 6.5 SETTINGS
- outboundFrame.start(FrameType::SETTINGS, FrameFlag::EMPTY, Http2::connectionStreamID);
+ frameWriter.start(FrameType::SETTINGS, FrameFlag::EMPTY, Http2::connectionStreamID);
// MAX frame size (16 kb), disable PUSH
- outboundFrame.append(Settings::MAX_FRAME_SIZE_ID);
- outboundFrame.append(quint32(Http2::maxFrameSize));
- outboundFrame.append(Settings::ENABLE_PUSH_ID);
- outboundFrame.append(quint32(0));
+ frameWriter.append(Settings::MAX_FRAME_SIZE_ID);
+ frameWriter.append(quint32(Http2::maxFrameSize));
+ frameWriter.append(Settings::ENABLE_PUSH_ID);
+ frameWriter.append(quint32(0));
- if (!outboundFrame.write(*m_socket))
+ if (!frameWriter.write(*m_socket))
return false;
sessionRecvWindowSize = sessionMaxRecvWindowSize;
@@ -323,38 +322,38 @@ bool QHttp2ProtocolHandler::sendSETTINGS_ACK()
if (!prefaceSent && !sendClientPreface())
return false;
- outboundFrame.start(FrameType::SETTINGS, FrameFlag::ACK, Http2::connectionStreamID);
+ frameWriter.start(FrameType::SETTINGS, FrameFlag::ACK, Http2::connectionStreamID);
- return outboundFrame.write(*m_socket);
+ return frameWriter.write(*m_socket);
}
bool QHttp2ProtocolHandler::sendHEADERS(Stream &stream)
{
using namespace HPack;
- outboundFrame.start(FrameType::HEADERS, FrameFlag::PRIORITY | FrameFlag::END_HEADERS,
- stream.streamID);
+ frameWriter.start(FrameType::HEADERS, FrameFlag::PRIORITY | FrameFlag::END_HEADERS,
+ stream.streamID);
if (!stream.data()) {
- outboundFrame.addFlag(FrameFlag::END_STREAM);
+ frameWriter.addFlag(FrameFlag::END_STREAM);
stream.state = Stream::halfClosedLocal;
} else {
stream.state = Stream::open;
}
- outboundFrame.append(quint32()); // No stream dependency in Qt.
- outboundFrame.append(stream.weight());
+ frameWriter.append(quint32()); // No stream dependency in Qt.
+ frameWriter.append(stream.weight());
const auto headers = build_headers(stream.request(), maxHeaderListSize);
if (!headers.size()) // nothing fits into maxHeaderListSize
return false;
// Compress in-place:
- BitOStream outputStream(outboundFrame.frameBuffer);
+ BitOStream outputStream(frameWriter.outboundFrame().buffer);
if (!encoder.encodeRequest(outputStream, headers))
return false;
- return outboundFrame.writeHEADERS(*m_socket, maxFrameSize);
+ return frameWriter.writeHEADERS(*m_socket, maxFrameSize);
}
bool QHttp2ProtocolHandler::sendDATA(Stream &stream)
@@ -384,10 +383,10 @@ bool QHttp2ProtocolHandler::sendDATA(Stream &stream)
return true;
}
- outboundFrame.start(FrameType::DATA, FrameFlag::EMPTY, stream.streamID);
+ frameWriter.start(FrameType::DATA, FrameFlag::EMPTY, stream.streamID);
const qint32 bytesWritten = std::min<qint32>(slot, chunkSize);
- if (!outboundFrame.writeDATA(*m_socket, maxFrameSize, src, bytesWritten))
+ if (!frameWriter.writeDATA(*m_socket, maxFrameSize, src, bytesWritten))
return false;
stream.data()->advanceReadPointer(bytesWritten);
@@ -400,9 +399,9 @@ bool QHttp2ProtocolHandler::sendDATA(Stream &stream)
}
if (replyPrivate->totallyUploadedData == request.contentLength()) {
- outboundFrame.start(FrameType::DATA, FrameFlag::END_STREAM, stream.streamID);
- outboundFrame.setPayloadSize(0);
- outboundFrame.write(*m_socket);
+ frameWriter.start(FrameType::DATA, FrameFlag::END_STREAM, stream.streamID);
+ frameWriter.setPayloadSize(0);
+ frameWriter.write(*m_socket);
stream.state = Stream::halfClosedLocal;
stream.data()->disconnect(this);
removeFromSuspended(stream.streamID);
@@ -417,61 +416,61 @@ bool QHttp2ProtocolHandler::sendWINDOW_UPDATE(quint32 streamID, quint32 delta)
{
Q_ASSERT(m_socket);
- outboundFrame.start(FrameType::WINDOW_UPDATE, FrameFlag::EMPTY, streamID);
- outboundFrame.append(delta);
- return outboundFrame.write(*m_socket);
+ frameWriter.start(FrameType::WINDOW_UPDATE, FrameFlag::EMPTY, streamID);
+ frameWriter.append(delta);
+ return frameWriter.write(*m_socket);
}
bool QHttp2ProtocolHandler::sendRST_STREAM(quint32 streamID, quint32 errorCode)
{
Q_ASSERT(m_socket);
- outboundFrame.start(FrameType::RST_STREAM, FrameFlag::EMPTY, streamID);
- outboundFrame.append(errorCode);
- return outboundFrame.write(*m_socket);
+ frameWriter.start(FrameType::RST_STREAM, FrameFlag::EMPTY, streamID);
+ frameWriter.append(errorCode);
+ return frameWriter.write(*m_socket);
}
bool QHttp2ProtocolHandler::sendGOAWAY(quint32 errorCode)
{
Q_ASSERT(m_socket);
- outboundFrame.start(FrameType::GOAWAY, FrameFlag::EMPTY, connectionStreamID);
- outboundFrame.append(quint32(connectionStreamID));
- outboundFrame.append(errorCode);
- return outboundFrame.write(*m_socket);
+ frameWriter.start(FrameType::GOAWAY, FrameFlag::EMPTY, connectionStreamID);
+ frameWriter.append(quint32(connectionStreamID));
+ frameWriter.append(errorCode);
+ return frameWriter.write(*m_socket);
}
void QHttp2ProtocolHandler::handleDATA()
{
- Q_ASSERT(inboundFrame.type == FrameType::DATA);
+ Q_ASSERT(inboundFrame.type() == FrameType::DATA);
- const auto streamID = inboundFrame.streamID;
+ const auto streamID = inboundFrame.streamID();
if (streamID == connectionStreamID)
return connectionError(PROTOCOL_ERROR, "DATA on stream 0x0");
if (!activeStreams.contains(streamID) && !streamWasReset(streamID))
return connectionError(ENHANCE_YOUR_CALM, "DATA on invalid stream");
- if (qint32(inboundFrame.payloadSize) > sessionRecvWindowSize)
+ if (qint32(inboundFrame.payloadSize()) > sessionRecvWindowSize)
return connectionError(FLOW_CONTROL_ERROR, "Flow control error");
- sessionRecvWindowSize -= inboundFrame.payloadSize;
+ sessionRecvWindowSize -= inboundFrame.payloadSize();
if (activeStreams.contains(streamID)) {
auto &stream = activeStreams[streamID];
- if (qint32(inboundFrame.payloadSize) > stream.recvWindow) {
+ if (qint32(inboundFrame.payloadSize()) > stream.recvWindow) {
finishStreamWithError(stream, QNetworkReply::ProtocolInvalidOperationError,
QLatin1String("flow control error"));
sendRST_STREAM(streamID, FLOW_CONTROL_ERROR);
markAsReset(streamID);
deleteActiveStream(streamID);
} else {
- stream.recvWindow -= inboundFrame.payloadSize;
+ stream.recvWindow -= inboundFrame.payloadSize();
// Uncompress data if needed and append it ...
updateStream(stream, inboundFrame);
- if (inboundFrame.flags.testFlag(FrameFlag::END_STREAM)) {
+ if (inboundFrame.flags().testFlag(FrameFlag::END_STREAM)) {
finishStream(stream);
deleteActiveStream(stream.streamID);
} else if (stream.recvWindow < streamInitialRecvWindowSize / 2) {
@@ -493,22 +492,23 @@ void QHttp2ProtocolHandler::handleDATA()
void QHttp2ProtocolHandler::handleHEADERS()
{
- Q_ASSERT(inboundFrame.type == FrameType::HEADERS);
+ Q_ASSERT(inboundFrame.type() == FrameType::HEADERS);
- const auto streamID = inboundFrame.streamID;
+ const auto streamID = inboundFrame.streamID();
if (streamID == connectionStreamID)
return connectionError(PROTOCOL_ERROR, "HEADERS on 0x0 stream");
if (!activeStreams.contains(streamID) && !streamWasReset(streamID))
return connectionError(ENHANCE_YOUR_CALM, "HEADERS on invalid stream");
- if (inboundFrame.flags.testFlag(FrameFlag::PRIORITY)) {
+ const auto flags = inboundFrame.flags();
+ if (flags.testFlag(FrameFlag::PRIORITY)) {
handlePRIORITY();
if (goingAway)
return;
}
- const bool endHeaders = inboundFrame.flags.testFlag(FrameFlag::END_HEADERS);
+ const bool endHeaders = flags.testFlag(FrameFlag::END_HEADERS);
continuedFrames.clear();
continuedFrames.push_back(std::move(inboundFrame));
if (!endHeaders) {
@@ -521,10 +521,10 @@ void QHttp2ProtocolHandler::handleHEADERS()
void QHttp2ProtocolHandler::handlePRIORITY()
{
- Q_ASSERT(inboundFrame.type == FrameType::PRIORITY ||
- inboundFrame.type == FrameType::HEADERS);
+ Q_ASSERT(inboundFrame.type() == FrameType::PRIORITY ||
+ inboundFrame.type() == FrameType::HEADERS);
- const auto streamID = inboundFrame.streamID;
+ const auto streamID = inboundFrame.streamID();
if (streamID == connectionStreamID)
return connectionError(PROTOCOL_ERROR, "PIRORITY on 0x0 stream");
@@ -548,37 +548,38 @@ void QHttp2ProtocolHandler::handlePRIORITY()
void QHttp2ProtocolHandler::handleRST_STREAM()
{
- Q_ASSERT(inboundFrame.type == FrameType::RST_STREAM);
+ Q_ASSERT(inboundFrame.type() == FrameType::RST_STREAM);
// "RST_STREAM frames MUST be associated with a stream.
// If a RST_STREAM frame is received with a stream identifier of 0x0,
// the recipient MUST treat this as a connection error (Section 5.4.1)
// of type PROTOCOL_ERROR.
- if (inboundFrame.streamID == connectionStreamID)
+ const auto streamID = inboundFrame.streamID();
+ if (streamID == connectionStreamID)
return connectionError(PROTOCOL_ERROR, "RST_STREAM on 0x0");
- if (!(inboundFrame.streamID & 0x1)) {
+ if (!(streamID & 0x1)) {
// RST_STREAM on a promised stream:
// since we do not keep track of such streams,
// just ignore.
return;
}
- if (inboundFrame.streamID >= nextID) {
+ if (streamID >= nextID) {
// "RST_STREAM frames MUST NOT be sent for a stream
// in the "idle" state. .. the recipient MUST treat this
// as a connection error (Section 5.4.1) of type PROTOCOL_ERROR."
return connectionError(PROTOCOL_ERROR, "RST_STREAM on idle stream");
}
- if (!activeStreams.contains(inboundFrame.streamID)) {
+ if (!activeStreams.contains(streamID)) {
// 'closed' stream, ignore.
return;
}
Q_ASSERT(inboundFrame.dataSize() == 4);
- Stream &stream = activeStreams[inboundFrame.streamID];
+ Stream &stream = activeStreams[streamID];
finishStreamWithError(stream, qFromBigEndian<quint32>(inboundFrame.dataBegin()));
markAsReset(stream.streamID);
deleteActiveStream(stream.streamID);
@@ -587,12 +588,12 @@ void QHttp2ProtocolHandler::handleRST_STREAM()
void QHttp2ProtocolHandler::handleSETTINGS()
{
// 6.5 SETTINGS.
- Q_ASSERT(inboundFrame.type == FrameType::SETTINGS);
+ Q_ASSERT(inboundFrame.type() == FrameType::SETTINGS);
- if (inboundFrame.streamID != connectionStreamID)
+ if (inboundFrame.streamID() != connectionStreamID)
return connectionError(PROTOCOL_ERROR, "SETTINGS on invalid stream");
- if (inboundFrame.flags.testFlag(FrameFlag::ACK)) {
+ if (inboundFrame.flags().testFlag(FrameFlag::ACK)) {
if (!waitingForSettingsACK)
return connectionError(PROTOCOL_ERROR, "unexpected SETTINGS ACK");
waitingForSettingsACK = false;
@@ -618,7 +619,7 @@ void QHttp2ProtocolHandler::handleSETTINGS()
void QHttp2ProtocolHandler::handlePUSH_PROMISE()
{
// 6.6 PUSH_PROMISE.
- Q_ASSERT(inboundFrame.type == FrameType::PUSH_PROMISE);
+ Q_ASSERT(inboundFrame.type() == FrameType::PUSH_PROMISE);
if (prefaceSent && !waitingForSettingsACK) {
// This means, server ACKed our 'NO PUSH',
@@ -626,7 +627,7 @@ void QHttp2ProtocolHandler::handlePUSH_PROMISE()
return connectionError(PROTOCOL_ERROR, "unexpected PUSH_PROMISE frame");
}
- const auto streamID = inboundFrame.streamID;
+ const auto streamID = inboundFrame.streamID();
if (streamID == connectionStreamID) {
return connectionError(PROTOCOL_ERROR,
"PUSH_PROMISE with invalid associated stream (0x0)");
@@ -648,7 +649,7 @@ void QHttp2ProtocolHandler::handlePUSH_PROMISE()
sendRST_STREAM(reservedID, REFUSE_STREAM);
markAsReset(reservedID);
- const bool endHeaders = inboundFrame.flags.testFlag(FrameFlag::END_HEADERS);
+ const bool endHeaders = inboundFrame.flags().testFlag(FrameFlag::END_HEADERS);
continuedFrames.clear();
continuedFrames.push_back(std::move(inboundFrame));
@@ -664,30 +665,30 @@ void QHttp2ProtocolHandler::handlePING()
{
// Since we're implementing a client and not
// a server, we only reply to a PING, ACKing it.
- Q_ASSERT(inboundFrame.type == FrameType::PING);
+ Q_ASSERT(inboundFrame.type() == FrameType::PING);
Q_ASSERT(m_socket);
- if (inboundFrame.streamID != connectionStreamID)
+ if (inboundFrame.streamID() != connectionStreamID)
return connectionError(PROTOCOL_ERROR, "PING on invalid stream");
- if (inboundFrame.flags & FrameFlag::ACK)
+ if (inboundFrame.flags() & FrameFlag::ACK)
return connectionError(PROTOCOL_ERROR, "unexpected PING ACK");
Q_ASSERT(inboundFrame.dataSize() == 8);
- outboundFrame.start(FrameType::PING, FrameFlag::ACK, connectionStreamID);
- outboundFrame.append(inboundFrame.dataBegin(), inboundFrame.dataBegin() + 8);
- outboundFrame.write(*m_socket);
+ frameWriter.start(FrameType::PING, FrameFlag::ACK, connectionStreamID);
+ frameWriter.append(inboundFrame.dataBegin(), inboundFrame.dataBegin() + 8);
+ frameWriter.write(*m_socket);
}
void QHttp2ProtocolHandler::handleGOAWAY()
{
// 6.8 GOAWAY
- Q_ASSERT(inboundFrame.type == FrameType::GOAWAY);
+ Q_ASSERT(inboundFrame.type() == FrameType::GOAWAY);
// "An endpoint MUST treat a GOAWAY frame with a stream identifier
// other than 0x0 as a connection error (Section 5.4.1) of type PROTOCOL_ERROR."
- if (inboundFrame.streamID != connectionStreamID)
+ if (inboundFrame.streamID() != connectionStreamID)
return connectionError(PROTOCOL_ERROR, "GOAWAY on invalid stream");
const auto src = inboundFrame.dataBegin();
@@ -740,12 +741,12 @@ void QHttp2ProtocolHandler::handleGOAWAY()
void QHttp2ProtocolHandler::handleWINDOW_UPDATE()
{
- Q_ASSERT(inboundFrame.type == FrameType::WINDOW_UPDATE);
+ Q_ASSERT(inboundFrame.type() == FrameType::WINDOW_UPDATE);
const quint32 delta = qFromBigEndian<quint32>(inboundFrame.dataBegin());
const bool valid = delta && delta <= quint32(std::numeric_limits<qint32>::max());
- const auto streamID = inboundFrame.streamID;
+ const auto streamID = inboundFrame.streamID();
if (streamID == Http2::connectionStreamID) {
if (!valid || sum_will_overflow(sessionSendWindowSize, delta))
@@ -776,13 +777,13 @@ void QHttp2ProtocolHandler::handleWINDOW_UPDATE()
void QHttp2ProtocolHandler::handleCONTINUATION()
{
- Q_ASSERT(inboundFrame.type == FrameType::CONTINUATION);
+ Q_ASSERT(inboundFrame.type() == FrameType::CONTINUATION);
Q_ASSERT(continuedFrames.size()); // HEADERS frame must be already in.
- if (inboundFrame.streamID != continuedFrames.front().streamID)
+ if (inboundFrame.streamID() != continuedFrames.front().streamID())
return connectionError(PROTOCOL_ERROR, "CONTINUATION on invalid stream");
- const bool endHeaders = inboundFrame.flags.testFlag(FrameFlag::END_HEADERS);
+ const bool endHeaders = inboundFrame.flags().testFlag(FrameFlag::END_HEADERS);
continuedFrames.push_back(std::move(inboundFrame));
if (!endHeaders)
@@ -796,9 +797,9 @@ void QHttp2ProtocolHandler::handleContinuedHEADERS()
{
Q_ASSERT(continuedFrames.size());
- const auto streamID = continuedFrames[0].streamID;
+ const auto streamID = continuedFrames[0].streamID();
- if (continuedFrames[0].type == FrameType::HEADERS) {
+ if (continuedFrames[0].type() == FrameType::HEADERS) {
if (activeStreams.contains(streamID)) {
Stream &stream = activeStreams[streamID];
if (stream.state != Stream::halfClosedLocal) {
@@ -841,11 +842,11 @@ void QHttp2ProtocolHandler::handleContinuedHEADERS()
if (!decoder.decodeHeaderFields(inputStream))
return connectionError(COMPRESSION_ERROR, "HPACK decompression failed");
- if (continuedFrames[0].type == FrameType::HEADERS) {
+ if (continuedFrames[0].type() == FrameType::HEADERS) {
if (activeStreams.contains(streamID)) {
Stream &stream = activeStreams[streamID];
updateStream(stream, decoder.decodedHeader());
- if (continuedFrames[0].flags & FrameFlag::END_STREAM) {
+ if (continuedFrames[0].flags() & FrameFlag::END_STREAM) {
finishStream(stream);
deleteActiveStream(stream.streamID);
}
@@ -953,9 +954,9 @@ void QHttp2ProtocolHandler::updateStream(Stream &stream, const HPack::HttpHeader
emit httpReply->headerChanged();
}
-void QHttp2ProtocolHandler::updateStream(Stream &stream, const Http2::FrameReader &frame)
+void QHttp2ProtocolHandler::updateStream(Stream &stream, const Frame &frame)
{
- Q_ASSERT(frame.type == FrameType::DATA);
+ Q_ASSERT(frame.type() == FrameType::DATA);
if (const auto length = frame.dataSize()) {
const char *data = reinterpret_cast<const char *>(frame.dataBegin());
@@ -1214,4 +1215,4 @@ void QHttp2ProtocolHandler::closeSession()
QT_END_NAMESPACE
-#endif // !defined(QT_NO_HTTP) && !defined(QT_NO_SSL)
+#endif // !defined(QT_NO_HTTP)
diff --git a/src/network/access/qhttp2protocolhandler_p.h b/src/network/access/qhttp2protocolhandler_p.h
index b146e37dd3..92c6851078 100644
--- a/src/network/access/qhttp2protocolhandler_p.h
+++ b/src/network/access/qhttp2protocolhandler_p.h
@@ -55,7 +55,7 @@
#include <private/qabstractprotocolhandler_p.h>
#include <private/qhttpnetworkrequest_p.h>
-#if !defined(QT_NO_HTTP) && !defined(QT_NO_SSL)
+#if !defined(QT_NO_HTTP)
#include "http2/http2protocol_p.h"
#include "http2/http2streams_p.h"
@@ -124,7 +124,7 @@ private:
bool acceptSetting(Http2::Settings identifier, quint32 newValue);
void updateStream(Stream &stream, const HPack::HttpHeader &headers);
- void updateStream(Stream &stream, const Http2::FrameReader &dataFrame);
+ void updateStream(Stream &stream, const Http2::Frame &dataFrame);
void finishStream(Stream &stream);
// Error code send by a peer (GOAWAY/RST_STREAM):
void finishStreamWithError(Stream &stream, quint32 errorCode);
@@ -161,12 +161,13 @@ private:
// Peer's max frame size.
quint32 maxFrameSize = Http2::maxFrameSize;
- Http2::FrameReader inboundFrame;
- Http2::FrameWriter outboundFrame;
+ Http2::FrameReader frameReader;
+ Http2::Frame inboundFrame;
+ Http2::FrameWriter frameWriter;
// Temporary storage to assemble HEADERS' block
// from several CONTINUATION frames ...
bool continuationExpected = false;
- std::vector<Http2::FrameReader> continuedFrames;
+ std::vector<Http2::Frame> continuedFrames;
// Peer's max number of streams ...
quint32 maxConcurrentStreams = Http2::maxConcurrentStreams;
@@ -202,6 +203,6 @@ private:
QT_END_NAMESPACE
-#endif // !defined(QT_NO_HTTP) && !defined(QT_NO_SSL)
+#endif // !defined(QT_NO_HTTP)
#endif
diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp
index 09cea8e769..74fc23957c 100644
--- a/src/network/access/qhttpnetworkconnection.cpp
+++ b/src/network/access/qhttpnetworkconnection.cpp
@@ -86,7 +86,7 @@ QHttpNetworkConnectionPrivate::QHttpNetworkConnectionPrivate(const QString &host
, channelCount((type == QHttpNetworkConnection::ConnectionTypeSPDY || type == QHttpNetworkConnection::ConnectionTypeHTTP2)
? 1 : defaultHttpChannelCount)
#else
-, channelCount(defaultHttpChannelCount)
+, channelCount(type == QHttpNetworkConnection::ConnectionTypeHTTP2 ? 1 : defaultHttpChannelCount)
#endif // QT_NO_SSL
#ifndef QT_NO_NETWORKPROXY
, networkProxy(QNetworkProxy::NoProxy)
@@ -619,13 +619,11 @@ QHttpNetworkReply* QHttpNetworkConnectionPrivate::queueRequest(const QHttpNetwor
break;
}
}
-#ifndef QT_NO_SSL
- else { // SPDY
+ else { // SPDY, HTTP/2
if (!pair.second->d_func()->requestIsPrepared)
prepareRequest(pair);
channels[0].spdyRequestsToSend.insertMulti(request.priority(), pair);
}
-#endif // QT_NO_SSL
// For Happy Eyeballs the networkLayerState is set to Unknown
// untill we have started the first connection attempt. So no
@@ -1013,9 +1011,9 @@ void QHttpNetworkConnectionPrivate::_q_startNextRequest()
}
break;
}
- case QHttpNetworkConnection::ConnectionTypeSPDY:
- case QHttpNetworkConnection::ConnectionTypeHTTP2: {
-#ifndef QT_NO_SSL
+ case QHttpNetworkConnection::ConnectionTypeHTTP2:
+ case QHttpNetworkConnection::ConnectionTypeSPDY: {
+
if (channels[0].spdyRequestsToSend.isEmpty())
return;
@@ -1027,7 +1025,6 @@ void QHttpNetworkConnectionPrivate::_q_startNextRequest()
if (channels[0].socket && channels[0].socket->state() == QAbstractSocket::ConnectedState
&& !channels[0].pendingEncrypt)
channels[0].sendRequest();
-#endif // QT_NO_SSL
break;
}
}
diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp
index 87f88aad5f..b6a9b80511 100644
--- a/src/network/access/qhttpnetworkconnectionchannel.cpp
+++ b/src/network/access/qhttpnetworkconnectionchannel.cpp
@@ -179,8 +179,11 @@ void QHttpNetworkConnectionChannel::init()
if (!sslConfiguration.isNull())
sslSocket->setSslConfiguration(sslConfiguration);
} else {
-#endif // QT_NO_SSL
- protocolHandler.reset(new QHttpProtocolHandler(this));
+#endif // !QT_NO_SSL
+ if (connection->connectionType() == QHttpNetworkConnection::ConnectionTypeHTTP2)
+ protocolHandler.reset(new QHttp2ProtocolHandler(this));
+ else
+ protocolHandler.reset(new QHttpProtocolHandler(this));
#ifndef QT_NO_SSL
}
#endif
@@ -835,10 +838,17 @@ void QHttpNetworkConnectionChannel::_q_connected()
#endif
} else {
state = QHttpNetworkConnectionChannel::IdleState;
- if (!reply)
- connection->d_func()->dequeueRequest(socket);
- if (reply)
- sendRequest();
+ if (connection->connectionType() == QHttpNetworkConnection::ConnectionTypeHTTP2) {
+ if (spdyRequestsToSend.count() > 0) {
+ // wait for data from the server first (e.g. initial window, max concurrent requests)
+ QMetaObject::invokeMethod(connection, "_q_startNextRequest", Qt::QueuedConnection);
+ }
+ } else {
+ if (!reply)
+ connection->d_func()->dequeueRequest(socket);
+ if (reply)
+ sendRequest();
+ }
}
}
@@ -972,9 +982,12 @@ void QHttpNetworkConnectionChannel::_q_error(QAbstractSocket::SocketError socket
}
} while (!connection->d_func()->highPriorityQueue.isEmpty()
|| !connection->d_func()->lowPriorityQueue.isEmpty());
+
+ if (connection->connectionType() == QHttpNetworkConnection::ConnectionTypeHTTP2
#ifndef QT_NO_SSL
- if (connection->connectionType() == QHttpNetworkConnection::ConnectionTypeSPDY ||
- connection->connectionType() == QHttpNetworkConnection::ConnectionTypeHTTP2) {
+ || connection->connectionType() == QHttpNetworkConnection::ConnectionTypeSPDY
+#endif
+ ) {
QList<HttpMessagePair> spdyPairs = spdyRequestsToSend.values();
for (int a = 0; a < spdyPairs.count(); ++a) {
// emit error for all replies
@@ -983,7 +996,6 @@ void QHttpNetworkConnectionChannel::_q_error(QAbstractSocket::SocketError socket
emit currentReply->finishedWithError(errorCode, errorString);
}
}
-#endif // QT_NO_SSL
// send the next request
QMetaObject::invokeMethod(that, "_q_startNextRequest", Qt::QueuedConnection);
@@ -1005,20 +1017,19 @@ void QHttpNetworkConnectionChannel::_q_error(QAbstractSocket::SocketError socket
#ifndef QT_NO_NETWORKPROXY
void QHttpNetworkConnectionChannel::_q_proxyAuthenticationRequired(const QNetworkProxy &proxy, QAuthenticator* auth)
{
+ if (connection->connectionType() == QHttpNetworkConnection::ConnectionTypeHTTP2
#ifndef QT_NO_SSL
- if (connection->connectionType() == QHttpNetworkConnection::ConnectionTypeSPDY ||
- connection->connectionType() == QHttpNetworkConnection::ConnectionTypeHTTP2) {
+ || connection->connectionType() == QHttpNetworkConnection::ConnectionTypeSPDY
+#endif
+ ) {
connection->d_func()->emitProxyAuthenticationRequired(this, proxy, auth);
} else { // HTTP
-#endif // QT_NO_SSL
// Need to dequeue the request before we can emit the error.
if (!reply)
connection->d_func()->dequeueRequest(socket);
if (reply)
connection->d_func()->emitProxyAuthenticationRequired(this, proxy, auth);
-#ifndef QT_NO_SSL
}
-#endif // QT_NO_SSL
}
#endif
@@ -1028,6 +1039,19 @@ void QHttpNetworkConnectionChannel::_q_uploadDataReadyRead()
sendRequest();
}
+void QHttpNetworkConnectionChannel::emitFinishedWithError(QNetworkReply::NetworkError error,
+ const char *message)
+{
+ if (reply)
+ emit reply->finishedWithError(error, QHttpNetworkConnectionChannel::tr(message));
+ QList<HttpMessagePair> spdyPairs = spdyRequestsToSend.values();
+ for (int a = 0; a < spdyPairs.count(); ++a) {
+ QHttpNetworkReply *currentReply = spdyPairs.at(a).second;
+ Q_ASSERT(currentReply);
+ emit currentReply->finishedWithError(error, QHttpNetworkConnectionChannel::tr(message));
+ }
+}
+
#ifndef QT_NO_SSL
void QHttpNetworkConnectionChannel::_q_encrypted()
{
@@ -1078,9 +1102,10 @@ void QHttpNetworkConnectionChannel::_q_encrypted()
if (connection->connectionType() == QHttpNetworkConnection::ConnectionTypeSPDY ||
connection->connectionType() == QHttpNetworkConnection::ConnectionTypeHTTP2) {
// we call setSpdyWasUsed(true) on the replies in the SPDY handler when the request is sent
- if (spdyRequestsToSend.count() > 0)
+ if (spdyRequestsToSend.count() > 0) {
// wait for data from the server first (e.g. initial window, max concurrent requests)
QMetaObject::invokeMethod(connection, "_q_startNextRequest", Qt::QueuedConnection);
+ }
} else { // HTTP
if (!reply)
connection->d_func()->dequeueRequest(socket);
@@ -1102,19 +1127,6 @@ void QHttpNetworkConnectionChannel::requeueSpdyRequests()
spdyRequestsToSend.clear();
}
-void QHttpNetworkConnectionChannel::emitFinishedWithError(QNetworkReply::NetworkError error,
- const char *message)
-{
- if (reply)
- emit reply->finishedWithError(error, QHttpNetworkConnectionChannel::tr(message));
- QList<HttpMessagePair> spdyPairs = spdyRequestsToSend.values();
- for (int a = 0; a < spdyPairs.count(); ++a) {
- QHttpNetworkReply *currentReply = spdyPairs.at(a).second;
- Q_ASSERT(currentReply);
- emit currentReply->finishedWithError(error, QHttpNetworkConnectionChannel::tr(message));
- }
-}
-
void QHttpNetworkConnectionChannel::_q_sslErrors(const QList<QSslError> &errors)
{
if (!socket)
diff --git a/src/network/access/qhttpnetworkconnectionchannel_p.h b/src/network/access/qhttpnetworkconnectionchannel_p.h
index d7d5d86a7a..61aea9d35d 100644
--- a/src/network/access/qhttpnetworkconnectionchannel_p.h
+++ b/src/network/access/qhttpnetworkconnectionchannel_p.h
@@ -121,18 +121,21 @@ public:
bool authenticationCredentialsSent;
bool proxyCredentialsSent;
QScopedPointer<QAbstractProtocolHandler> protocolHandler;
+ // SPDY or HTTP/2 requests; SPDY is TLS-only, but
+ // HTTP/2 can be cleartext also, that's why it's
+ // outside of QT_NO_SSL section. Sorted by priority:
+ QMultiMap<int, HttpMessagePair> spdyRequestsToSend;
#ifndef QT_NO_SSL
bool ignoreAllSslErrors;
QList<QSslError> ignoreSslErrorsList;
QSslConfiguration sslConfiguration;
- QMultiMap<int, HttpMessagePair> spdyRequestsToSend; // sorted by priority
void ignoreSslErrors();
void ignoreSslErrors(const QList<QSslError> &errors);
void setSslConfiguration(const QSslConfiguration &config);
void requeueSpdyRequests(); // when we wanted SPDY but got HTTP
+#endif
// to emit the signal for all in-flight replies:
void emitFinishedWithError(QNetworkReply::NetworkError error, const char *message);
-#endif
#ifndef QT_NO_BEARERMANAGEMENT
QSharedPointer<QNetworkSession> networkSession;
#endif
diff --git a/src/network/access/qhttpthreaddelegate.cpp b/src/network/access/qhttpthreaddelegate.cpp
index e16519c2f2..1dca7f02fb 100644
--- a/src/network/access/qhttpthreaddelegate.cpp
+++ b/src/network/access/qhttpthreaddelegate.cpp
@@ -285,10 +285,11 @@ void QHttpThreadDelegate::startRequest()
urlCopy.setPort(urlCopy.port(ssl ? 443 : 80));
QHttpNetworkConnection::ConnectionType connectionType
- = QHttpNetworkConnection::ConnectionTypeHTTP;
+ = httpRequest.isHTTP2Allowed() ? QHttpNetworkConnection::ConnectionTypeHTTP2
+ : QHttpNetworkConnection::ConnectionTypeHTTP;
+
#ifndef QT_NO_SSL
if (httpRequest.isHTTP2Allowed() && ssl) {
- connectionType = QHttpNetworkConnection::ConnectionTypeHTTP2;
QList<QByteArray> protocols;
protocols << QSslConfiguration::ALPNProtocolHTTP2
<< QSslConfiguration::NextProtocolHttp1_1;
diff --git a/src/network/access/qnetworkrequest.cpp b/src/network/access/qnetworkrequest.cpp
index 63332d4fd1..29362b81e2 100644
--- a/src/network/access/qnetworkrequest.cpp
+++ b/src/network/access/qnetworkrequest.cpp
@@ -260,6 +260,14 @@ QT_BEGIN_NAMESPACE
Indicates whether SPDY was used for receiving
this reply.
+ \value HTTP2AllowedAttribute
+ Requests only, type: QMetaType::Bool (default: false)
+ Indicates whether the QNetworkAccessManager code is
+ allowed to use HTTP/2 with this request. This applies
+ to SSL requests or 'cleartext' HTTP/2.
+
+ \omitvalue HTTP2WasUsedAttribute
+
\value EmitAllUploadProgressSignalsAttribute
Requests only, type: QMetaType::Bool (default: false)
Indicates whether all upload signals should be emitted.
diff --git a/src/network/kernel/kernel.pri b/src/network/kernel/kernel.pri
index 34d2f164e8..8f37e28669 100644
--- a/src/network/kernel/kernel.pri
+++ b/src/network/kernel/kernel.pri
@@ -56,14 +56,15 @@ win32: {
}
mac {
- LIBS_PRIVATE += -framework SystemConfiguration -framework CoreFoundation
+ LIBS_PRIVATE += -framework CoreFoundation
!uikit: LIBS_PRIVATE += -framework CoreServices
+ !if(watchos:CONFIG(device, simulator|device)): LIBS_PRIVATE += -framework SystemConfiguration
}
osx:SOURCES += kernel/qnetworkproxy_mac.cpp
else:win32:SOURCES += kernel/qnetworkproxy_win.cpp
-else:contains(QT_CONFIG, libproxy) {
+else: qtConfig(libproxy) {
SOURCES += kernel/qnetworkproxy_libproxy.cpp
- LIBS_PRIVATE += -lproxy
+ QMAKE_USE_PRIVATE += libproxy
}
else:SOURCES += kernel/qnetworkproxy_generic.cpp
diff --git a/src/network/kernel/qnetworkinterface.cpp b/src/network/kernel/qnetworkinterface.cpp
index 22d2e6bb70..c5d1adbef0 100644
--- a/src/network/kernel/qnetworkinterface.cpp
+++ b/src/network/kernel/qnetworkinterface.cpp
@@ -365,7 +365,7 @@ void QNetworkAddressEntry::setBroadcast(const QHostAddress &newBroadcast)
Not all operating systems support reporting all features. Only the
IPv4 addresses are guaranteed to be listed by this class in all
platforms. In particular, IPv6 address listing is only supported
- on Windows, Linux, OS X and the BSDs.
+ on Windows, Linux, \macos and the BSDs.
\sa QNetworkAddressEntry
*/
diff --git a/src/network/kernel/qnetworkproxy.cpp b/src/network/kernel/qnetworkproxy.cpp
index 2f7e9d537d..bb1a7d0d8b 100644
--- a/src/network/kernel/qnetworkproxy.cpp
+++ b/src/network/kernel/qnetworkproxy.cpp
@@ -1557,7 +1557,7 @@ void QNetworkProxyFactory::setApplicationProxyFactory(QNetworkProxyFactory *fact
those settings are not found, this function will attempt to obtain
Internet Explorer's settings and use them.
- On MacOS X, this function will obtain the proxy settings using the
+ On \macos, this function will obtain the proxy settings using the
SystemConfiguration framework from Apple. It will apply the FTP,
HTTP and HTTPS proxy configurations for queries that contain the
protocol tag "ftp", "http" and "https", respectively. If the SOCKS
@@ -1576,7 +1576,7 @@ void QNetworkProxyFactory::setApplicationProxyFactory(QNetworkProxyFactory *fact
listed here.
\list
- \li On MacOS X, this function will ignore the Proxy Auto Configuration
+ \li On \macos, this function will ignore the Proxy Auto Configuration
settings, since it cannot execute the associated ECMAScript code.
\li On Windows platforms, this function may take several seconds to
diff --git a/src/network/socket/qabstractsocket.cpp b/src/network/socket/qabstractsocket.cpp
index be60d187ad..87ef31fb22 100644
--- a/src/network/socket/qabstractsocket.cpp
+++ b/src/network/socket/qabstractsocket.cpp
@@ -428,7 +428,7 @@
allowed to rebind, even if they pass ReuseAddressHint. This option
provides more security than ShareAddress, but on certain operating
systems, it requires you to run the server with administrator privileges.
- On Unix and OS X, not sharing is the default behavior for binding
+ On Unix and \macos, not sharing is the default behavior for binding
an address and port, so this option is ignored. On Windows, this
option uses the SO_EXCLUSIVEADDRUSE socket option.
@@ -438,7 +438,7 @@
socket option.
\value DefaultForPlatform The default option for the current platform.
- On Unix and OS X, this is equivalent to (DontShareAddress
+ On Unix and \macos, this is equivalent to (DontShareAddress
+ ReuseAddressHint), and on Windows, its equivalent to ShareAddress.
*/
@@ -693,19 +693,12 @@ bool QAbstractSocketPrivate::canReadNotification()
qDebug("QAbstractSocketPrivate::canReadNotification()");
#endif
- if (!isBuffered) {
- if (hasPendingData) {
- socketEngine->setReadNotificationEnabled(false);
- return true;
- }
- hasPendingData = true;
- }
-
// If buffered, read data from the socket into the read buffer
- qint64 newBytes = 0;
if (isBuffered) {
+ const qint64 oldBufferSize = buffer.size();
+
// Return if there is no space in the buffer
- if (readBufferMaxSize && buffer.size() >= readBufferMaxSize) {
+ if (readBufferMaxSize && oldBufferSize >= readBufferMaxSize) {
socketEngine->setReadNotificationEnabled(false);
#if defined (QABSTRACTSOCKET_DEBUG)
qDebug("QAbstractSocketPrivate::canReadNotification() buffer is full");
@@ -715,7 +708,6 @@ bool QAbstractSocketPrivate::canReadNotification()
// If reading from the socket fails after getting a read
// notification, close the socket.
- newBytes = buffer.size();
if (!readFromSocket()) {
#if defined (QABSTRACTSOCKET_DEBUG)
qDebug("QAbstractSocketPrivate::canReadNotification() disconnecting socket");
@@ -723,21 +715,28 @@ bool QAbstractSocketPrivate::canReadNotification()
q->disconnectFromHost();
return false;
}
- newBytes = buffer.size() - newBytes;
+
+ // Return if there is no new data available.
+ if (buffer.size() == oldBufferSize) {
+ // If the socket is opened only for writing, return true
+ // to indicate that the data was discarded.
+ return !q->isReadable();
+ }
+ } else {
+ if (hasPendingData) {
+ socketEngine->setReadNotificationEnabled(false);
+ return true;
+ }
+ hasPendingData = true;
}
- // Only emit readyRead() if there is data available.
- if (newBytes > 0 || !isBuffered)
- emitReadyRead();
+ emitReadyRead();
- // If we were closed as a result of the readyRead() signal,
- // return.
- if (state == QAbstractSocket::UnconnectedState || state == QAbstractSocket::ClosingState) {
#if defined (QABSTRACTSOCKET_DEBUG)
+ // If we were closed as a result of the readyRead() signal.
+ if (state == QAbstractSocket::UnconnectedState || state == QAbstractSocket::ClosingState)
qDebug("QAbstractSocketPrivate::canReadNotification() socket is closing - returning");
#endif
- return true;
- }
return true;
}
diff --git a/src/network/socket/qlocalserver.cpp b/src/network/socket/qlocalserver.cpp
index a1085f726a..94143c2dc0 100644
--- a/src/network/socket/qlocalserver.cpp
+++ b/src/network/socket/qlocalserver.cpp
@@ -147,7 +147,7 @@ QLocalServer::~QLocalServer()
and are created based on the umask. Setting the access flags will
overide this and will restrict or permit access as specified.
- Other Unix-based operating systems, such as OS X, do not
+ Other Unix-based operating systems, such as \macos, do not
honor file permissions for Unix domain sockets and by default
have WorldAccess and these permission flags will have no effect.
diff --git a/src/network/socket/qlocalsocket_tcp.cpp b/src/network/socket/qlocalsocket_tcp.cpp
index 4348b819d9..379cdd096d 100644
--- a/src/network/socket/qlocalsocket_tcp.cpp
+++ b/src/network/socket/qlocalsocket_tcp.cpp
@@ -245,8 +245,8 @@ void QLocalSocket::connectToServer(OpenMode openMode)
QLatin1String("QLocalSocket::connectToServer"));
return;
}
- d->tcpSocket->connectToHost(QHostAddress::LocalHost, port, openMode);
QIODevice::open(openMode);
+ d->tcpSocket->connectToHost(QHostAddress::LocalHost, port, openMode);
}
bool QLocalSocket::setSocketDescriptor(qintptr socketDescriptor,
diff --git a/src/network/socket/qnativesocketengine_unix.cpp b/src/network/socket/qnativesocketengine_unix.cpp
index d7d7dad8e7..d1efc21e09 100644
--- a/src/network/socket/qnativesocketengine_unix.cpp
+++ b/src/network/socket/qnativesocketengine_unix.cpp
@@ -317,7 +317,7 @@ int QNativeSocketEnginePrivate::option(QNativeSocketEngine::SocketOption opt) co
case QNativeSocketEngine::BindExclusively:
case QNativeSocketEngine::NonBlockingSocketOption:
case QNativeSocketEngine::BroadcastSocketOption:
- return true;
+ return -1;
case QNativeSocketEngine::MaxStreamsSocketOption: {
#ifndef QT_NO_SCTP
sctp_initmsg sctpInitMsg;
diff --git a/src/network/socket/socket.pri b/src/network/socket/socket.pri
index b1c0b6bd6e..793ea60b07 100644
--- a/src/network/socket/socket.pri
+++ b/src/network/socket/socket.pri
@@ -27,7 +27,7 @@ SOURCES += socket/qabstractsocketengine.cpp \
# SCTP support.
-contains(QT_CONFIG, sctp) {
+qtConfig(sctp) {
HEADERS += socket/qsctpserver.h \
socket/qsctpserver_p.h \
socket/qsctpsocket.h \
@@ -80,6 +80,6 @@ integrity: {
DEFINES += QT_LOCALSOCKET_TCP
}
-contains(QT_CONFIG, system-proxies) {
+qtConfig(system-proxies) {
DEFINES += QT_USE_SYSTEM_PROXIES
}
diff --git a/src/network/ssl/qsslcontext_openssl.cpp b/src/network/ssl/qsslcontext_openssl.cpp
index dec8e12abb..c92d8fc3f8 100644
--- a/src/network/ssl/qsslcontext_openssl.cpp
+++ b/src/network/ssl/qsslcontext_openssl.cpp
@@ -320,7 +320,7 @@ init_context:
}
if (!dhparams.isEmpty()) {
- const QByteArray &params = dhparams.d.data()->derData;
+ const QByteArray &params = dhparams.d->derData;
const char *ptr = params.constData();
DH *dh = q_d2i_DHparams(NULL, reinterpret_cast<const unsigned char **>(&ptr), params.length());
if (dh == NULL)
diff --git a/src/network/ssl/qssldiffiehellmanparameters.cpp b/src/network/ssl/qssldiffiehellmanparameters.cpp
index e75ffe4da5..d0fcb3189a 100644
--- a/src/network/ssl/qssldiffiehellmanparameters.cpp
+++ b/src/network/ssl/qssldiffiehellmanparameters.cpp
@@ -77,7 +77,7 @@ QT_BEGIN_NAMESPACE
QSslDiffieHellmanParameters QSslDiffieHellmanParameters::defaultParameters()
{
// The 1024-bit MODP group from RFC 2459 (Second Oakley Group)
- return QSslDiffieHellmanParameters(
+ return fromEncoded(
QByteArray::fromBase64(QByteArrayLiteral(
"MIGHAoGBAP//////////yQ/aoiFowjTExmKLgNwc0SkCTgiKZ8x0Agu+pjsTmyJR"
"Sgh5jjQE3e+VGbPNOkMbMCsKbfJfFDdP4TVtbVHCReSFtXZiXn7G9ExC6aY37WsL"
@@ -100,73 +100,82 @@ QSslDiffieHellmanParameters QSslDiffieHellmanParameters::defaultParameters()
QSslDiffieHellmanParameters::QSslDiffieHellmanParameters()
: d(new QSslDiffieHellmanParametersPrivate)
{
+ d->ref.ref();
}
/*!
Constructs a QSslDiffieHellmanParameters object using
the byte array \a encoded in either PEM or DER form as specified by \a encoding.
- After construction, the isValid() method should be used to
+ Use the isValid() method on the returned object to
check whether the Diffie-Hellman parameters were valid and
loaded correctly.
\sa isValid()
\sa QSslConfiguration
*/
-QSslDiffieHellmanParameters::QSslDiffieHellmanParameters(const QByteArray &encoded, QSsl::EncodingFormat encoding)
- : d(new QSslDiffieHellmanParametersPrivate)
+QSslDiffieHellmanParameters QSslDiffieHellmanParameters::fromEncoded(const QByteArray &encoded, QSsl::EncodingFormat encoding)
{
+ QSslDiffieHellmanParameters result;
switch (encoding) {
case QSsl::Der:
- d->decodeDer(encoded);
+ result.d->decodeDer(encoded);
break;
case QSsl::Pem:
- d->decodePem(encoded);
+ result.d->decodePem(encoded);
break;
}
+ return result;
}
/*!
Constructs a QSslDiffieHellmanParameters object by
reading from \a device in either PEM or DER form as specified by \a encoding.
- After construction, the isValid() method should be used
+ Use the isValid() method on the returned object
to check whether the Diffie-Hellman parameters were valid
and loaded correctly.
+ In particular, if \a device is \c nullptr or not open for reading, an invalid
+ object will be returned.
+
\sa isValid()
\sa QSslConfiguration
*/
-QSslDiffieHellmanParameters::QSslDiffieHellmanParameters(QIODevice *device, QSsl::EncodingFormat encoding)
- : d(new QSslDiffieHellmanParametersPrivate)
+QSslDiffieHellmanParameters QSslDiffieHellmanParameters::fromEncoded(QIODevice *device, QSsl::EncodingFormat encoding)
{
- if (!device)
- return;
-
- const QByteArray encoded = device->readAll();
-
- switch (encoding) {
- case QSsl::Der:
- d->decodeDer(encoded);
- break;
- case QSsl::Pem:
- d->decodePem(encoded);
- break;
- }
+ if (device)
+ return fromEncoded(device->readAll(), encoding);
+ else
+ return QSslDiffieHellmanParameters();
}
/*!
Constructs an identical copy of \a other.
*/
-QSslDiffieHellmanParameters::QSslDiffieHellmanParameters(const QSslDiffieHellmanParameters &other) : d(other.d)
+QSslDiffieHellmanParameters::QSslDiffieHellmanParameters(const QSslDiffieHellmanParameters &other)
+ : d(other.d)
{
+ if (d)
+ d->ref.ref();
}
/*!
+ \fn QSslDiffieHellmanParameters(QSslDiffieHellmanParameters &&other)
+
+ Move-constructs from \a other.
+
+ \note The moved-from object \a other is placed in a partially-formed state, in which
+ the only valid operations are destruction and assignment of a new value.
+*/
+
+/*!
Destroys the QSslDiffieHellmanParameters object.
*/
QSslDiffieHellmanParameters::~QSslDiffieHellmanParameters()
{
+ if (d && !d->ref.deref())
+ delete d;
}
/*!
@@ -177,7 +186,8 @@ QSslDiffieHellmanParameters::~QSslDiffieHellmanParameters()
*/
QSslDiffieHellmanParameters &QSslDiffieHellmanParameters::operator=(const QSslDiffieHellmanParameters &other)
{
- d = other.d;
+ QSslDiffieHellmanParameters copy(other);
+ swap(copy);
return *this;
}
@@ -185,6 +195,9 @@ QSslDiffieHellmanParameters &QSslDiffieHellmanParameters::operator=(const QSslDi
\fn QSslDiffieHellmanParameters &QSslDiffieHellmanParameters::operator=(QSslDiffieHellmanParameters &&other)
Move-assigns \a other to this QSslDiffieHellmanParameters instance.
+
+ \note The moved-from object \a other is placed in a partially-formed state, in which
+ the only valid operations are destruction and assignment of a new value.
*/
/*!
@@ -265,6 +278,7 @@ QString QSslDiffieHellmanParameters::errorString() const Q_DECL_NOTHROW
}
/*!
+ \since 5.8
\relates QSslDiffieHellmanParameters
Returns \c true if \a lhs is equal to \a rhs; otherwise returns \c false.
@@ -276,6 +290,7 @@ bool operator==(const QSslDiffieHellmanParameters &lhs, const QSslDiffieHellmanP
#ifndef QT_NO_DEBUG_STREAM
/*!
+ \since 5.8
\relates QSslDiffieHellmanParameters
Writes the set of Diffie-Hellman parameters in \a dhparam into the debug object \a debug for
@@ -295,7 +310,8 @@ QDebug operator<<(QDebug debug, const QSslDiffieHellmanParameters &dhparam)
#endif
/*!
- \relates QHash
+ \since 5.8
+ \relates QSslDiffieHellmanParameters
Returns an hash value for \a dhparam, using \a seed to seed
the calculation.
diff --git a/src/network/ssl/qssldiffiehellmanparameters.h b/src/network/ssl/qssldiffiehellmanparameters.h
index aa40be83a6..4533ea4ed2 100644
--- a/src/network/ssl/qssldiffiehellmanparameters.h
+++ b/src/network/ssl/qssldiffiehellmanparameters.h
@@ -82,24 +82,25 @@ public:
Q_NETWORK_EXPORT static QSslDiffieHellmanParameters defaultParameters();
Q_NETWORK_EXPORT QSslDiffieHellmanParameters();
- Q_NETWORK_EXPORT explicit QSslDiffieHellmanParameters(const QByteArray &encoded, QSsl::EncodingFormat format = QSsl::Pem);
- Q_NETWORK_EXPORT explicit QSslDiffieHellmanParameters(QIODevice *device, QSsl::EncodingFormat format = QSsl::Pem);
Q_NETWORK_EXPORT QSslDiffieHellmanParameters(const QSslDiffieHellmanParameters &other);
+ QSslDiffieHellmanParameters(QSslDiffieHellmanParameters &&other) Q_DECL_NOTHROW : d(other.d) { other.d = nullptr; }
Q_NETWORK_EXPORT ~QSslDiffieHellmanParameters();
+
Q_NETWORK_EXPORT QSslDiffieHellmanParameters &operator=(const QSslDiffieHellmanParameters &other);
-#ifdef Q_COMPILER_RVALUE_REFS
QSslDiffieHellmanParameters &operator=(QSslDiffieHellmanParameters &&other) Q_DECL_NOTHROW { swap(other); return *this; }
-#endif
void swap(QSslDiffieHellmanParameters &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+ Q_NETWORK_EXPORT static QSslDiffieHellmanParameters fromEncoded(const QByteArray &encoded, QSsl::EncodingFormat format = QSsl::Pem);
+ Q_NETWORK_EXPORT static QSslDiffieHellmanParameters fromEncoded(QIODevice *device, QSsl::EncodingFormat format = QSsl::Pem);
+
Q_NETWORK_EXPORT bool isEmpty() const Q_DECL_NOTHROW;
Q_NETWORK_EXPORT bool isValid() const Q_DECL_NOTHROW;
- Q_NETWORK_EXPORT QSslDiffieHellmanParameters::Error error() const Q_DECL_NOTHROW;
+ Q_NETWORK_EXPORT Error error() const Q_DECL_NOTHROW;
Q_NETWORK_EXPORT QString errorString() const Q_DECL_NOTHROW;
private:
- QExplicitlySharedDataPointer<QSslDiffieHellmanParametersPrivate> d;
+ QSslDiffieHellmanParametersPrivate *d;
friend class QSslContext;
friend Q_NETWORK_EXPORT bool operator==(const QSslDiffieHellmanParameters &lhs, const QSslDiffieHellmanParameters &rhs) Q_DECL_NOTHROW;
#ifndef QT_NO_DEBUG_STREAM
diff --git a/src/network/ssl/qsslsocket.cpp b/src/network/ssl/qsslsocket.cpp
index 2371dd7212..29e1f32815 100644
--- a/src/network/ssl/qsslsocket.cpp
+++ b/src/network/ssl/qsslsocket.cpp
@@ -142,7 +142,7 @@
addDefaultCaCertificates(), and QSslConfiguration::defaultConfiguration().setCaCertificates().
\endlist
- \note If available, root certificates on Unix (excluding OS X) will be
+ \note If available, root certificates on Unix (excluding \macos) will be
loaded on demand from the standard certificate directories. If you do not
want to load root certificates on demand, you need to call either
QSslConfiguration::defaultConfiguration().setCaCertificates() before the first
diff --git a/src/network/ssl/qsslsocket_mac.cpp b/src/network/ssl/qsslsocket_mac.cpp
index 438ea9a38e..4c06404415 100644
--- a/src/network/ssl/qsslsocket_mac.cpp
+++ b/src/network/ssl/qsslsocket_mac.cpp
@@ -204,7 +204,7 @@ bool QSslSocketPrivate::s_loadedCiphersAndCerts = false;
bool QSslSocketPrivate::s_loadRootCertsOnDemand = false;
-#if !defined(QT_PLATFORM_UIKIT) // dhparam is not used on iOS or tvOS. (see the SSLSetDiffieHellmanParams call below)
+#if !defined(QT_PLATFORM_UIKIT) // dhparam is only used on macOS. (see the SSLSetDiffieHellmanParams call below)
static const uint8_t dhparam[] =
"\x30\x82\x01\x08\x02\x82\x01\x01\x00\x97\xea\xd0\x46\xf7\xae\xa7\x76\x80"
"\x9c\x74\x56\x98\xd8\x56\x97\x2b\x20\x6c\x77\xe2\x82\xbb\xc8\x84\xbe\xe7"
@@ -223,7 +223,7 @@ static const uint8_t dhparam[] =
"\x90\x0b\x35\x64\xff\xd9\xe3\xac\xf2\xf2\xeb\x3a\x63\x02\x01\x02";
#endif
-// No ioErr on iOS/tvOS. (defined in MacErrors.h on OS X)
+// No ioErr on iOS/tvOS/watchOS. (defined in MacErrors.h on macOS)
#if defined(QT_PLATFORM_UIKIT)
# define ioErr -36
#endif
diff --git a/src/network/ssl/qsslsocket_mac_p.h b/src/network/ssl/qsslsocket_mac_p.h
index 5210fb7f30..9e1d18981e 100644
--- a/src/network/ssl/qsslsocket_mac_p.h
+++ b/src/network/ssl/qsslsocket_mac_p.h
@@ -75,7 +75,7 @@ public:
private:
SSLContextRef context;
- Q_DISABLE_COPY(QSecureTransportContext);
+ Q_DISABLE_COPY(QSecureTransportContext)
};
class QSslSocketBackendPrivate : public QSslSocketPrivate
@@ -122,7 +122,7 @@ private:
QSecureTransportContext context;
- Q_DISABLE_COPY(QSslSocketBackendPrivate);
+ Q_DISABLE_COPY(QSslSocketBackendPrivate)
};
QT_END_NAMESPACE
diff --git a/src/network/ssl/ssl.pri b/src/network/ssl/ssl.pri
index edbbeadf51..8139af50af 100644
--- a/src/network/ssl/ssl.pri
+++ b/src/network/ssl/ssl.pri
@@ -1,5 +1,5 @@
# OpenSSL support; compile in QSslSocket.
-contains(QT_CONFIG, ssl) {
+qtConfig(ssl) {
HEADERS += ssl/qasn1element_p.h \
ssl/qssl.h \
ssl/qssl_p.h \
@@ -45,7 +45,7 @@ contains(QT_CONFIG, ssl) {
ssl/qsslellipticcurve_dummy.cpp
}
- contains(QT_CONFIG, securetransport) {
+ qtConfig(securetransport) {
HEADERS += ssl/qsslsocket_mac_p.h
SOURCES += ssl/qsslcertificate_qt.cpp \
ssl/qssldiffiehellmanparameters_dummy.cpp \
@@ -56,7 +56,7 @@ contains(QT_CONFIG, ssl) {
ssl/qsslellipticcurve_dummy.cpp
}
- contains(QT_CONFIG, openssl) | contains(QT_CONFIG, openssl-linked) {
+ qtConfig(openssl)|qtConfig(openssl-linked) {
HEADERS += ssl/qsslcontext_openssl_p.h \
ssl/qsslsocket_openssl_p.h \
ssl/qsslsocket_openssl_symbols_p.h
diff --git a/src/opengl/doc/src/qtopengl-index.qdoc b/src/opengl/doc/src/qtopengl-index.qdoc
index ae12fb8137..6ab888a14d 100644
--- a/src/opengl/doc/src/qtopengl-index.qdoc
+++ b/src/opengl/doc/src/qtopengl-index.qdoc
@@ -37,7 +37,7 @@
OpenGL is a standard API for rendering 3D graphics. OpenGL only
deals with 3D rendering and provides little or no support for GUI
programming issues. The user interface for an OpenGL application
- must be created with another toolkit, such as Cocoa on the OS X
+ must be created with another toolkit, such as Cocoa on the \macos
platform, Microsoft Foundation Classes (MFC) under Windows, or Qt
on both platforms.
diff --git a/src/opengl/doc/src/qtopengl-module.qdoc b/src/opengl/doc/src/qtopengl-module.qdoc
index 8722a9f972..e9b1258266 100644
--- a/src/opengl/doc/src/qtopengl-module.qdoc
+++ b/src/opengl/doc/src/qtopengl-module.qdoc
@@ -40,7 +40,7 @@
OpenGL is a standard API for rendering 3D graphics. OpenGL only
deals with 3D rendering and provides little or no support for GUI
programming issues. The user interface for an OpenGL application
- must be created with another toolkit, such as Cocoa on the OS X
+ must be created with another toolkit, such as Cocoa on the \macos
platform, Microsoft Foundation Classes (MFC) under Windows, or Qt
on both platforms.
diff --git a/src/opengl/opengl.pro b/src/opengl/opengl.pro
index 2386ef5d19..25de6ad670 100644
--- a/src/opengl/opengl.pro
+++ b/src/opengl/opengl.pro
@@ -9,8 +9,8 @@ irix-cc*:QMAKE_CXXFLAGS += -no_prelink -ptused
QMAKE_DOCS = $$PWD/doc/qtopengl.qdocconf
-contains(QT_CONFIG, opengl):CONFIG += opengl
-contains(QT_CONFIG, opengles2):CONFIG += opengles2
+qtConfig(opengl): CONFIG += opengl
+qtConfig(opengles2): CONFIG += opengles2
HEADERS += qgl.h \
qgl_p.h \
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index f249984893..5aa807b12c 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -3697,7 +3697,7 @@ void QGLContext::doneCurrent()
QGLWidget. This will side-step the issue altogether, and is what
we recommend for users that need this kind of functionality.
- On OS X, when Qt is built with Cocoa support, a QGLWidget
+ On \macos, when Qt is built with Cocoa support, a QGLWidget
can't have any sibling widgets placed ontop of itself. This is due
to limitations in the Cocoa API and is not supported by Apple.
diff --git a/src/opengl/qglpixelbuffer.cpp b/src/opengl/qglpixelbuffer.cpp
index b0dc3b2e2c..e2f434ac3c 100644
--- a/src/opengl/qglpixelbuffer.cpp
+++ b/src/opengl/qglpixelbuffer.cpp
@@ -66,7 +66,7 @@
an OpenGL texture.} The texture is then updated automatically
when the pbuffer contents change, eliminating the need for
additional copy operations. This is supported only on Windows
- and OS X systems that provide the \c render_texture
+ and \macos systems that provide the \c render_texture
extension. Note that under Windows, a multi-sampled pbuffer
can't be used in conjunction with the \c render_texture
extension. If a multi-sampled pbuffer is requested under
@@ -293,7 +293,7 @@ QGLContext *QGLPixelBuffer::context() const
pbuffer contents to a texture using updateDynamicTexture().
\warning For the bindToDynamicTexture() call to succeed on the
- OS X, the pbuffer needs a shared context, i.e. the
+ \macos, the pbuffer needs a shared context, i.e. the
QGLPixelBuffer must be created with a share widget.
\sa generateDynamicTexture(), releaseFromDynamicTexture()
@@ -322,7 +322,7 @@ QGLContext *QGLPixelBuffer::context() const
\snippet code/src_opengl_qglpixelbuffer.cpp 1
- An alternative on Windows and OS X systems that support the
+ An alternative on Windows and \macos systems that support the
\c render_texture extension is to use bindToDynamicTexture() to
get dynamic updates of the texture.
diff --git a/src/openglextensions/openglextensions.pro b/src/openglextensions/openglextensions.pro
index 04a871114b..42ba4152d5 100644
--- a/src/openglextensions/openglextensions.pro
+++ b/src/openglextensions/openglextensions.pro
@@ -1,8 +1,8 @@
TARGET = QtOpenGLExtensions
CONFIG += static
-contains(QT_CONFIG, opengl):CONFIG += opengl
-contains(QT_CONFIG, opengles2):CONFIG += opengles2
+qtConfig(opengl): CONFIG += opengl
+qtConfig(opengles2): CONFIG += opengles2
DEFINES += QT_NO_CAST_FROM_ASCII QT_NO_FOREACH
diff --git a/src/platformheaders/nativecontexts/qeglnativecontext.h b/src/platformheaders/nativecontexts/qeglnativecontext.h
index acc5dd10ab..67a6d2b808 100644
--- a/src/platformheaders/nativecontexts/qeglnativecontext.h
+++ b/src/platformheaders/nativecontexts/qeglnativecontext.h
@@ -41,7 +41,7 @@
#define QEGLNATIVECONTEXT_H
#include <QtCore/QMetaType>
-#include <EGL/egl.h>
+#include <QtPlatformSupport/private/qt_egl_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/platformsupport/accessibility/accessibility.pri b/src/platformsupport/accessibility/accessibility.pri
index fb56edbf1a..924f6a512f 100644
--- a/src/platformsupport/accessibility/accessibility.pri
+++ b/src/platformsupport/accessibility/accessibility.pri
@@ -1,4 +1,4 @@
-contains(QT_CONFIG, accessibility) {
+qtConfig(accessibility) {
INCLUDEPATH += $$PWD
HEADERS += \
diff --git a/src/platformsupport/devicediscovery/devicediscovery.pri b/src/platformsupport/devicediscovery/devicediscovery.pri
index 9829ae88ba..f4e9103130 100644
--- a/src/platformsupport/devicediscovery/devicediscovery.pri
+++ b/src/platformsupport/devicediscovery/devicediscovery.pri
@@ -1,11 +1,10 @@
HEADERS += $$PWD/qdevicediscovery_p.h
-contains(QT_CONFIG, libudev) {
+qtConfig(libudev) {
SOURCES += $$PWD/qdevicediscovery_udev.cpp
HEADERS += $$PWD/qdevicediscovery_udev_p.h
- INCLUDEPATH += $$QMAKE_INCDIR_LIBUDEV
- LIBS_PRIVATE += $$QMAKE_LIBS_LIBUDEV
-} else: contains(QT_CONFIG, evdev) {
+ QMAKE_USE_PRIVATE += libudev
+} else: qtConfig(evdev) {
SOURCES += $$PWD/qdevicediscovery_static.cpp
HEADERS += $$PWD/qdevicediscovery_static_p.h
} else {
diff --git a/src/platformsupport/eglconvenience/eglconvenience.pri b/src/platformsupport/eglconvenience/eglconvenience.pri
index fe6d0eb748..4a93d997fb 100644
--- a/src/platformsupport/eglconvenience/eglconvenience.pri
+++ b/src/platformsupport/eglconvenience/eglconvenience.pri
@@ -1,13 +1,14 @@
-contains(QT_CONFIG,egl) {
+qtConfig(egl) {
HEADERS += \
$$PWD/qeglconvenience_p.h \
- $$PWD/qeglstreamconvenience_p.h
+ $$PWD/qeglstreamconvenience_p.h \
+ $$PWD/qt_egl_p.h
SOURCES += \
$$PWD/qeglconvenience.cpp \
$$PWD/qeglstreamconvenience.cpp
- contains(QT_CONFIG,opengl) {
+ qtConfig(opengl) {
HEADERS += $$PWD/qeglplatformcontext_p.h \
$$PWD/qeglpbuffer_p.h
@@ -15,10 +16,10 @@ contains(QT_CONFIG,egl) {
$$PWD/qeglpbuffer.cpp
}
- # Avoid X11 header collision
- DEFINES += MESA_EGL_NO_X11_HEADERS
+ # Avoid X11 header collision, use generic EGL native types
+ DEFINES += QT_EGL_NO_X11
- contains(QT_CONFIG,xlib) {
+ qtConfig(xlib) {
HEADERS += \
$$PWD/qxlibeglintegration_p.h
SOURCES += \
diff --git a/src/platformsupport/eglconvenience/qeglconvenience_p.h b/src/platformsupport/eglconvenience/qeglconvenience_p.h
index ec5c1e403a..fdd21b8f19 100644
--- a/src/platformsupport/eglconvenience/qeglconvenience_p.h
+++ b/src/platformsupport/eglconvenience/qeglconvenience_p.h
@@ -54,7 +54,7 @@
#include <QtGui/QSurfaceFormat>
#include <QtCore/QVector>
#include <QtCore/QSizeF>
-#include <EGL/egl.h>
+#include <QtPlatformSupport/private/qt_egl_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/platformsupport/eglconvenience/qeglpbuffer_p.h b/src/platformsupport/eglconvenience/qeglpbuffer_p.h
index 19a29d5dd8..4f9ea9d5f3 100644
--- a/src/platformsupport/eglconvenience/qeglpbuffer_p.h
+++ b/src/platformsupport/eglconvenience/qeglpbuffer_p.h
@@ -53,7 +53,6 @@
#include <qpa/qplatformoffscreensurface.h>
#include <QtPlatformSupport/private/qeglplatformcontext_p.h>
-#include <EGL/egl.h>
QT_BEGIN_NAMESPACE
diff --git a/src/platformsupport/eglconvenience/qeglplatformcontext_p.h b/src/platformsupport/eglconvenience/qeglplatformcontext_p.h
index e772f5df89..f6b2b876f7 100644
--- a/src/platformsupport/eglconvenience/qeglplatformcontext_p.h
+++ b/src/platformsupport/eglconvenience/qeglplatformcontext_p.h
@@ -55,7 +55,7 @@
#include <qpa/qplatformwindow.h>
#include <qpa/qplatformopenglcontext.h>
#include <QtCore/QVariant>
-#include <EGL/egl.h>
+#include <QtPlatformSupport/private/qt_egl_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/platformsupport/eglconvenience/qeglstreamconvenience_p.h b/src/platformsupport/eglconvenience/qeglstreamconvenience_p.h
index c8a8096816..f535afbc55 100644
--- a/src/platformsupport/eglconvenience/qeglstreamconvenience_p.h
+++ b/src/platformsupport/eglconvenience/qeglstreamconvenience_p.h
@@ -52,8 +52,7 @@
//
#include <qglobal.h>
-#include <EGL/egl.h>
-#include <EGL/eglext.h>
+#include <QtPlatformSupport/private/qt_egl_p.h>
// This provides runtime EGLDevice/Output/Stream support even when eglext.h in
// the sysroot is not up-to-date.
diff --git a/config.tests/unix/stdint/main.cpp b/src/platformsupport/eglconvenience/qt_egl_p.h
index f232e8bb85..615ee4b80a 100644
--- a/config.tests/unix/stdint/main.cpp
+++ b/src/platformsupport/eglconvenience/qt_egl_p.h
@@ -3,7 +3,7 @@
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the config.tests of the Qt Toolkit.
+** This file is part of the QtGui module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -37,11 +37,81 @@
**
****************************************************************************/
-/* Check for the presence of stdint.h */
+#ifndef QT_EGL_P_H
+#define QT_EGL_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#ifdef QT_EGL_NO_X11
+# define MESA_EGL_NO_X11_HEADERS // MESA
+# define WIN_INTERFACE_CUSTOM // NV
+#endif // QT_EGL_NO_X11
+
+#ifdef QT_EGL_WAYLAND
+# define WAYLAND // NV
+#endif // QT_EGL_WAYLAND
+
+#include <EGL/egl.h>
+#include <EGL/eglext.h>
+
#include <stdint.h>
-int main()
+QT_BEGIN_NAMESPACE
+
+namespace QtInternal {
+
+template <class FromType, class ToType>
+struct QtEglConverter
+{
+ static inline ToType convert(FromType v)
+ { return v; }
+};
+
+template <>
+struct QtEglConverter<uint32_t, uintptr_t>
{
- return 0;
-}
+ static inline uintptr_t convert(uint32_t v)
+ { return v; }
+};
+
+#if Q_PROCESSOR_WORDSIZE > 4
+template <>
+struct QtEglConverter<uintptr_t, uint32_t>
+{
+ static inline uint32_t convert(uintptr_t v)
+ { return uint32_t(v); }
+};
+#endif
+
+template <>
+struct QtEglConverter<uint32_t, void *>
+{
+ static inline void *convert(uint32_t v)
+ { return reinterpret_cast<void *>(uintptr_t(v)); }
+};
+
+template <>
+struct QtEglConverter<void *, uint32_t>
+{
+ static inline uint32_t convert(void *v)
+ { return uintptr_t(v); }
+};
+
+} // QtInternal
+
+template <class ToType, class FromType>
+static inline ToType qt_egl_cast(FromType from)
+{ return QtInternal::QtEglConverter<FromType, ToType>::convert(from); }
+
+QT_END_NAMESPACE
+#endif // QT_EGL_P_H
diff --git a/src/platformsupport/eventdispatchers/eventdispatchers.pri b/src/platformsupport/eventdispatchers/eventdispatchers.pri
index 6a4689eb19..fb0f3b3827 100644
--- a/src/platformsupport/eventdispatchers/eventdispatchers.pri
+++ b/src/platformsupport/eventdispatchers/eventdispatchers.pri
@@ -14,9 +14,8 @@ HEADERS +=\
$$PWD/qwindowsguieventdispatcher_p.h
}
-contains(QT_CONFIG, glib) {
+qtConfig(glib) {
SOURCES +=$$PWD/qeventdispatcher_glib.cpp
HEADERS +=$$PWD/qeventdispatcher_glib_p.h
- QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_GLIB
- LIBS_PRIVATE += $$QMAKE_LIBS_GLIB
+ QMAKE_USE_PRIVATE += glib
}
diff --git a/src/platformsupport/fbconvenience/qfbvthandler.cpp b/src/platformsupport/fbconvenience/qfbvthandler.cpp
index 2429cb7c5c..102bc91647 100644
--- a/src/platformsupport/fbconvenience/qfbvthandler.cpp
+++ b/src/platformsupport/fbconvenience/qfbvthandler.cpp
@@ -39,8 +39,9 @@
#include "qfbvthandler_p.h"
#include <QtCore/QSocketNotifier>
+#include <QtCore/private/qglobal_p.h>
-#if defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID) && (!defined(QT_NO_EVDEV) || !defined(QT_NO_LIBINPUT))
+#if defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID) && (QT_CONFIG(evdev) || QT_CONFIG(libinput))
#define VTH_ENABLED
diff --git a/src/platformsupport/fontdatabases/basic/basic.pri b/src/platformsupport/fontdatabases/basic/basic.pri
index 52cf771b2a..575c93fe20 100644
--- a/src/platformsupport/fontdatabases/basic/basic.pri
+++ b/src/platformsupport/fontdatabases/basic/basic.pri
@@ -1,5 +1,3 @@
-DEFINES += QT_NO_FONTCONFIG
-
HEADERS += \
$$PWD/qbasicfontdatabase_p.h \
$$QT_SOURCE_TREE/src/gui/text/qfontengine_ft_p.h
diff --git a/src/platformsupport/fontdatabases/fontconfig/fontconfig.pri b/src/platformsupport/fontdatabases/fontconfig/fontconfig.pri
index bd7294b818..63097c33c1 100644
--- a/src/platformsupport/fontdatabases/fontconfig/fontconfig.pri
+++ b/src/platformsupport/fontdatabases/fontconfig/fontconfig.pri
@@ -2,5 +2,5 @@ HEADERS += $$PWD/qfontconfigdatabase_p.h \
$$PWD/qfontenginemultifontconfig_p.h
SOURCES += $$PWD/qfontconfigdatabase.cpp \
$$PWD/qfontenginemultifontconfig.cpp
-DEFINES -= QT_NO_FONTCONFIG
+
QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_FONTCONFIG
diff --git a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp
index 652a9f4add..02b7e1bd63 100644
--- a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp
+++ b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp
@@ -365,6 +365,7 @@ static const char *getFcFamilyForStyleHint(const QFont::StyleHint style)
static void populateFromPattern(FcPattern *pattern)
{
QString familyName;
+ QString familyNameLang;
FcChar8 *value = 0;
int weight_value;
int slant_value;
@@ -382,6 +383,9 @@ static void populateFromPattern(FcPattern *pattern)
familyName = QString::fromUtf8((const char *)value);
+ if (FcPatternGetString(pattern, FC_FAMILYLANG, 0, &value) == FcResultMatch)
+ familyNameLang = QString::fromUtf8((const char *)value);
+
slant_value = FC_SLANT_ROMAN;
weight_value = FC_WEIGHT_REGULAR;
spacing_value = FC_PROPORTIONAL;
@@ -471,8 +475,30 @@ static void populateFromPattern(FcPattern *pattern)
QPlatformFontDatabase::registerFont(familyName,styleName,QLatin1String((const char *)foundry_value),weight,style,stretch,antialias,scalable,pixel_size,fixedPitch,writingSystems,fontFile);
// qDebug() << familyName << (const char *)foundry_value << weight << style << &writingSystems << scalable << true << pixel_size;
- for (int k = 1; FcPatternGetString(pattern, FC_FAMILY, k, &value) == FcResultMatch; ++k)
- QPlatformFontDatabase::registerAliasToFontFamily(familyName, QString::fromUtf8((const char *)value));
+ for (int k = 1; FcPatternGetString(pattern, FC_FAMILY, k, &value) == FcResultMatch; ++k) {
+ const QString altFamilyName = QString::fromUtf8((const char *)value);
+ // Extra family names can be aliases or subfamilies.
+ // If it is a subfamily, register it as a separate font, so only members of the subfamily are
+ // matched when the subfamily is requested.
+ QString altStyleName;
+ if (FcPatternGetString(pattern, FC_STYLE, k, &value) == FcResultMatch)
+ altStyleName = QString::fromUtf8((const char *)value);
+ else
+ altStyleName = styleName;
+
+ QString altFamilyNameLang;
+ if (FcPatternGetString(pattern, FC_FAMILYLANG, k, &value) == FcResultMatch)
+ altFamilyNameLang = QString::fromUtf8((const char *)value);
+ else
+ altFamilyNameLang = familyNameLang;
+
+ if (familyNameLang == altFamilyNameLang && altStyleName != styleName) {
+ FontFile *altFontFile = new FontFile(*fontFile);
+ QPlatformFontDatabase::registerFont(altFamilyName, altStyleName, QLatin1String((const char *)foundry_value),weight,style,stretch,antialias,scalable,pixel_size,fixedPitch,writingSystems,altFontFile);
+ } else {
+ QPlatformFontDatabase::registerAliasToFontFamily(familyName, altFamilyName);
+ }
+ }
}
@@ -488,7 +514,7 @@ void QFontconfigDatabase::populateFontDatabase()
FC_FAMILY, FC_STYLE, FC_WEIGHT, FC_SLANT,
FC_SPACING, FC_FILE, FC_INDEX,
FC_LANG, FC_CHARSET, FC_FOUNDRY, FC_SCALABLE, FC_PIXEL_SIZE,
- FC_WIDTH,
+ FC_WIDTH, FC_FAMILYLANG,
#if FC_VERSION >= 20297
FC_CAPABILITY,
#endif
diff --git a/src/platformsupport/fontdatabases/fontdatabases.pri b/src/platformsupport/fontdatabases/fontdatabases.pri
index 12b06d64cc..f8e51f2a6d 100644
--- a/src/platformsupport/fontdatabases/fontdatabases.pri
+++ b/src/platformsupport/fontdatabases/fontdatabases.pri
@@ -1,16 +1,15 @@
-!win32|contains(QT_CONFIG, freetype):!mac {
- include($$PWD/basic/basic.pri)
-}
-
-unix:!mac {
- CONFIG += qpa/genericunixfontdatabase
- include($$PWD/genericunix/genericunix.pri)
- contains(QT_CONFIG,fontconfig) {
- include($$PWD/fontconfig/fontconfig.pri)
+darwin:!if(watchos:CONFIG(simulator, simulator|device)) {
+ include($$PWD/mac/coretext.pri)
+} else {
+ !win32|qtConfig(freetype) {
+ include($$PWD/basic/basic.pri)
}
-}
-mac {
- include($$PWD/mac/coretext.pri)
+ unix {
+ CONFIG += qpa/genericunixfontdatabase
+ include($$PWD/genericunix/genericunix.pri)
+ contains(QT_CONFIG,fontconfig) {
+ include($$PWD/fontconfig/fontconfig.pri)
+ }
+ }
}
-
diff --git a/src/platformsupport/fontdatabases/mac/coretext.pri b/src/platformsupport/fontdatabases/mac/coretext.pri
index 272e7591ba..4d19a59226 100644
--- a/src/platformsupport/fontdatabases/mac/coretext.pri
+++ b/src/platformsupport/fontdatabases/mac/coretext.pri
@@ -1,14 +1,14 @@
HEADERS += $$PWD/qcoretextfontdatabase_p.h $$PWD/qfontengine_coretext_p.h
OBJECTIVE_SOURCES += $$PWD/qfontengine_coretext.mm $$PWD/qcoretextfontdatabase.mm
-contains(QT_CONFIG, freetype) {
+qtConfig(freetype) {
include($$QT_SOURCE_TREE/src/3rdparty/freetype_dependency.pri)
HEADERS += $$QT_SOURCE_TREE/src/gui/text/qfontengine_ft_p.h
SOURCES += $$QT_SOURCE_TREE/src/gui/text/qfontengine_ft.cpp
}
uikit: \
- # On iOS/tvOS CoreText and CoreGraphics are stand-alone frameworks
+ # On iOS/tvOS/watchOS CoreText and CoreGraphics are stand-alone frameworks
LIBS_PRIVATE += -framework CoreText -framework CoreGraphics
else: \
# On Mac OS they are part of the ApplicationServices umbrella framework,
diff --git a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
index 5fec53d1ed..6b73134c8b 100644
--- a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
+++ b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
@@ -811,7 +811,7 @@ static CTFontDescriptorRef fontDescriptorFromTheme(QPlatformTheme::Font f)
UIFontDescriptor *desc = [UIFontDescriptor preferredFontDescriptorWithTextStyle:textStyle];
return static_cast<CTFontDescriptorRef>(CFBridgingRetain(desc));
}
-#endif // Q_OS_IOS, Q_OS_TVOS
+#endif // Q_OS_IOS, Q_OS_TVOS, Q_OS_WATCHOS
// OSX default case and iOS fallback case
CTFontUIFontType fontType = fontTypeFromTheme(f);
diff --git a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
index 646212124b..0bc0416eec 100644
--- a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
+++ b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
@@ -453,31 +453,25 @@ void QCoreTextFontEngine::draw(CGContextRef ctx, qreal x, qreal y, const QTextIt
CGContextSetTextDrawingMode(ctx, kCGTextFill);
-
- QVarLengthArray<CGSize> advances(glyphs.size());
+ QVarLengthArray<CGPoint> cgPositions(glyphs.size());
QVarLengthArray<CGGlyph> cgGlyphs(glyphs.size());
-
- for (int i = 0; i < glyphs.size() - 1; ++i) {
- advances[i].width = (positions[i + 1].x - positions[i].x).toReal();
- advances[i].height = (positions[i + 1].y - positions[i].y).toReal();
+ const qreal firstX = positions[0].x.toReal();
+ const qreal firstY = positions[0].y.toReal();
+ for (int i = 0; i < glyphs.size(); ++i) {
+ cgPositions[i].x = positions[i].x.toReal() - firstX;
+ cgPositions[i].y = positions[i].y.toReal() - firstY;
cgGlyphs[i] = glyphs[i];
}
- advances[glyphs.size() - 1].width = 0;
- advances[glyphs.size() - 1].height = 0;
- cgGlyphs[glyphs.size() - 1] = glyphs[glyphs.size() - 1];
- CGContextSetFont(ctx, cgFont);
//NSLog(@"Font inDraw %@ ctfont %@", CGFontCopyFullName(cgFont), CTFontCopyFamilyName(ctfont));
CGContextSetTextPosition(ctx, positions[0].x.toReal(), positions[0].y.toReal());
-
- CGContextShowGlyphsWithAdvances(ctx, cgGlyphs.data(), advances.data(), glyphs.size());
+ CTFontDrawGlyphs(ctfont, cgGlyphs.data(), cgPositions.data(), glyphs.size(), ctx);
if (synthesisFlags & QFontEngine::SynthesizedBold) {
CGContextSetTextPosition(ctx, positions[0].x.toReal() + 0.5 * lineThickness().toReal(),
positions[0].y.toReal());
-
- CGContextShowGlyphsWithAdvances(ctx, cgGlyphs.data(), advances.data(), glyphs.size());
+ CTFontDrawGlyphs(ctfont, cgGlyphs.data(), cgPositions.data(), glyphs.size(), ctx);
}
CGContextSetTextMatrix(ctx, oldTextMatrix);
@@ -661,14 +655,13 @@ QImage QCoreTextFontEngine::imageForGlyph(glyph_t glyph, QFixed subPixelPosition
CGContextSetTextMatrix(ctx, cgMatrix);
CGContextSetRGBFillColor(ctx, 1, 1, 1, 1);
CGContextSetTextDrawingMode(ctx, kCGTextFill);
- CGContextSetFont(ctx, cgFont);
CGContextSetTextPosition(ctx, pos_x, pos_y);
- CGContextShowGlyphsWithAdvances(ctx, &cgGlyph, &CGSizeZero, 1);
+ CTFontDrawGlyphs(ctfont, &cgGlyph, &CGPointZero, 1, ctx);
if (synthesisFlags & QFontEngine::SynthesizedBold) {
CGContextSetTextPosition(ctx, pos_x + 0.5 * lineThickness().toReal(), pos_y);
- CGContextShowGlyphsWithAdvances(ctx, &cgGlyph, &CGSizeZero, 1);
+ CTFontDrawGlyphs(ctfont, &cgGlyph, &CGPointZero, 1, ctx);
}
} else {
// CGContextSetTextMatrix does not work with color glyphs, so we use
diff --git a/src/platformsupport/glxconvenience/glxconvenience.pri b/src/platformsupport/glxconvenience/glxconvenience.pri
index cc5b198f6c..80e79ee663 100644
--- a/src/platformsupport/glxconvenience/glxconvenience.pri
+++ b/src/platformsupport/glxconvenience/glxconvenience.pri
@@ -1,6 +1,6 @@
-contains(QT_CONFIG, xlib) {
- contains(QT_CONFIG,opengl):!contains(QT_CONFIG,opengles2) {
- contains(QT_CONFIG, xrender): LIBS_PRIVATE += -lXrender
+qtConfig(xlib) {
+ qtConfig(opengl):!qtConfig(opengles2) {
+ qtConfig(xrender): QMAKE_USE_PRIVATE += xrender
LIBS_PRIVATE += $$QMAKE_LIBS_X11
HEADERS += $$PWD/qglxconvenience_p.h
SOURCES += $$PWD/qglxconvenience.cpp
diff --git a/src/platformsupport/input/evdevkeyboard/evdevkeyboard.pri b/src/platformsupport/input/evdevkeyboard/evdevkeyboard.pri
index c058498ba0..445f230fa5 100644
--- a/src/platformsupport/input/evdevkeyboard/evdevkeyboard.pri
+++ b/src/platformsupport/input/evdevkeyboard/evdevkeyboard.pri
@@ -7,6 +7,5 @@ SOURCES += \
$$PWD/qevdevkeyboardhandler.cpp \
$$PWD/qevdevkeyboardmanager.cpp
-contains(QT_CONFIG, libudev) {
- LIBS_PRIVATE += $$QMAKE_LIBS_LIBUDEV
-}
+qtConfig(libudev): \
+ QMAKE_USE_PRIVATE += libudev
diff --git a/src/platformsupport/input/evdevmouse/evdevmouse.pri b/src/platformsupport/input/evdevmouse/evdevmouse.pri
index 7e7a9e1629..a8c9c663f3 100644
--- a/src/platformsupport/input/evdevmouse/evdevmouse.pri
+++ b/src/platformsupport/input/evdevmouse/evdevmouse.pri
@@ -6,7 +6,6 @@ SOURCES += \
$$PWD/qevdevmousehandler.cpp \
$$PWD/qevdevmousemanager.cpp
-contains(QT_CONFIG, libudev) {
- LIBS_PRIVATE += $$QMAKE_LIBS_LIBUDEV
-}
+qtConfig(libudev): \
+ QMAKE_USE_PRIVATE += libudev
diff --git a/src/platformsupport/input/evdevtablet/evdevtablet.pri b/src/platformsupport/input/evdevtablet/evdevtablet.pri
index fb9489353c..ea1712ad2f 100644
--- a/src/platformsupport/input/evdevtablet/evdevtablet.pri
+++ b/src/platformsupport/input/evdevtablet/evdevtablet.pri
@@ -6,6 +6,5 @@ SOURCES += \
$$PWD/qevdevtablethandler.cpp \
$$PWD/qevdevtabletmanager.cpp
-contains(QT_CONFIG, libudev) {
- LIBS_PRIVATE += $$QMAKE_LIBS_LIBUDEV
-}
+qtConfig(libudev): \
+ QMAKE_USE_PRIVATE += libudev
diff --git a/src/platformsupport/input/evdevtouch/evdevtouch.pri b/src/platformsupport/input/evdevtouch/evdevtouch.pri
index c2edc13143..58fafcd8f9 100644
--- a/src/platformsupport/input/evdevtouch/evdevtouch.pri
+++ b/src/platformsupport/input/evdevtouch/evdevtouch.pri
@@ -6,12 +6,12 @@ SOURCES += \
$$PWD/qevdevtouchhandler.cpp \
$$PWD/qevdevtouchmanager.cpp
-contains(QT_CONFIG, libudev) {
- LIBS_PRIVATE += $$QMAKE_LIBS_LIBUDEV
-}
+INCLUDEPATH += $$PWD/../shared
+
+qtConfig(libudev): \
+ QMAKE_USE_PRIVATE += libudev
-contains(QT_CONFIG, mtdev) {
+qtConfig(mtdev) {
CONFIG += link_pkgconfig
PKGCONFIG_PRIVATE += mtdev
}
-
diff --git a/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp b/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp
index 6b98ed30a9..32ec9d5452 100644
--- a/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp
+++ b/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp
@@ -38,6 +38,7 @@
****************************************************************************/
#include "qevdevtouchhandler_p.h"
+#include "qtouchoutputmapping_p.h"
#include <QStringList>
#include <QHash>
#include <QSocketNotifier>
@@ -49,7 +50,7 @@
#include <QtGui/private/qguiapplication_p.h>
#include <linux/input.h>
-#if !defined(QT_NO_MTDEV)
+#if QT_CONFIG(mtdev)
extern "C" {
#include <mtdev.h>
}
@@ -116,6 +117,7 @@ public:
int findClosestContact(const QHash<int, Contact> &contacts, int x, int y, int *dist);
void addTouchPoint(const Contact &contact, Qt::TouchPointStates *combinedStates);
void reportPoints();
+ void loadMultiScreenMappings();
int hw_range_x_min;
int hw_range_x_max;
@@ -124,10 +126,12 @@ public:
int hw_pressure_min;
int hw_pressure_max;
QString hw_name;
+ QString deviceNode;
bool m_forceToActiveWindow;
bool m_typeB;
QTransform m_rotate;
bool m_singleTouch;
+ int m_screenIndex;
};
QEvdevTouchScreenData::QEvdevTouchScreenData(QEvdevTouchScreenHandler *q_ptr, const QStringList &args)
@@ -137,7 +141,8 @@ QEvdevTouchScreenData::QEvdevTouchScreenData(QEvdevTouchScreenHandler *q_ptr, co
hw_range_x_min(0), hw_range_x_max(0),
hw_range_y_min(0), hw_range_y_max(0),
hw_pressure_min(0), hw_pressure_max(0),
- m_typeB(false), m_singleTouch(false)
+ m_typeB(false), m_singleTouch(false),
+ m_screenIndex(-1)
{
m_forceToActiveWindow = args.contains(QLatin1String("force_window"));
}
@@ -145,7 +150,7 @@ QEvdevTouchScreenData::QEvdevTouchScreenData(QEvdevTouchScreenHandler *q_ptr, co
#define LONG_BITS (sizeof(long) << 3)
#define NUM_LONGS(bits) (((bits) + LONG_BITS - 1) / LONG_BITS)
-#if defined(QT_NO_MTDEV)
+#if !QT_CONFIG(mtdev)
static inline bool testBit(long bit, const long *array)
{
return (array[bit / LONG_BITS] >> bit % LONG_BITS) & 1;
@@ -154,7 +159,7 @@ static inline bool testBit(long bit, const long *array)
QEvdevTouchScreenHandler::QEvdevTouchScreenHandler(const QString &device, const QString &spec, QObject *parent)
: QObject(parent), m_notify(Q_NULLPTR), m_fd(-1), d(Q_NULLPTR), m_device(Q_NULLPTR)
-#if !defined(QT_NO_MTDEV)
+#if QT_CONFIG(mtdev)
, m_mtdev(Q_NULLPTR)
#endif
{
@@ -198,7 +203,7 @@ QEvdevTouchScreenHandler::QEvdevTouchScreenHandler(const QString &device, const
return;
}
-#if !defined(QT_NO_MTDEV)
+#if QT_CONFIG(mtdev)
m_mtdev = static_cast<mtdev *>(calloc(1, sizeof(mtdev)));
int mtdeverr = mtdev_open(m_mtdev, m_fd);
if (mtdeverr) {
@@ -210,7 +215,7 @@ QEvdevTouchScreenHandler::QEvdevTouchScreenHandler(const QString &device, const
d = new QEvdevTouchScreenData(this, args);
-#if !defined(QT_NO_MTDEV)
+#if QT_CONFIG(mtdev)
const char *mtdevStr = "(mtdev)";
d->m_typeB = true;
#else
@@ -222,7 +227,9 @@ QEvdevTouchScreenHandler::QEvdevTouchScreenHandler(const QString &device, const
}
#endif
- qCDebug(qLcEvdevTouch, "evdevtouch: %s: Protocol type %c %s (%s)", qPrintable(device),
+ d->deviceNode = device;
+
+ qCDebug(qLcEvdevTouch, "evdevtouch: %s: Protocol type %c %s (%s)", qPrintable(d->deviceNode),
d->m_typeB ? 'B' : 'A', mtdevStr, d->m_singleTouch ? "single" : "multi");
input_absinfo absInfo;
@@ -292,12 +299,20 @@ QEvdevTouchScreenHandler::QEvdevTouchScreenHandler(const QString &device, const
if (inverty)
d->m_rotate *= QTransform::fromTranslate(0.5, 0.5).scale(1.0, -1.0).translate(-0.5, -0.5);
+ QTouchOutputMapping mapping;
+ if (mapping.load()) {
+ d->m_screenIndex = mapping.screenIndexForDeviceNode(d->deviceNode);
+ if (d->m_screenIndex >= 0)
+ qCDebug(qLcEvdevTouch, "evdevtouch: Mapping device %s to screen index %d",
+ qPrintable(d->deviceNode), d->m_screenIndex);
+ }
+
registerTouchDevice();
}
QEvdevTouchScreenHandler::~QEvdevTouchScreenHandler()
{
-#if !defined(QT_NO_MTDEV)
+#if QT_CONFIG(mtdev)
if (m_mtdev) {
mtdev_close(m_mtdev);
free(m_mtdev);
@@ -322,7 +337,7 @@ void QEvdevTouchScreenHandler::readData()
::input_event buffer[32];
int events = 0;
-#if !defined(QT_NO_MTDEV)
+#if QT_CONFIG(mtdev)
forever {
do {
events = mtdev_get(m_mtdev, m_fd, buffer, sizeof(buffer) / sizeof(::input_event));
@@ -400,9 +415,13 @@ void QEvdevTouchScreenHandler::unregisterTouchDevice()
if (!m_device)
return;
- QWindowSystemInterface::unregisterTouchDevice(m_device);
+ // At app exit the cleanup may have already been done, avoid
+ // double delete by checking the list first.
+ if (QWindowSystemInterface::isTouchDeviceRegistered(m_device)) {
+ QWindowSystemInterface::unregisterTouchDevice(m_device);
+ delete m_device;
+ }
- delete m_device;
m_device = Q_NULLPTR;
}
@@ -643,8 +662,23 @@ void QEvdevTouchScreenData::reportPoints()
return;
winRect = QHighDpi::toNativePixels(win->geometry(), win);
} else {
- QScreen *primary = QGuiApplication::primaryScreen();
- winRect = QHighDpi::toNativePixels(primary->geometry(), primary);
+ // Now it becomes tricky. Traditionally we picked the primaryScreen()
+ // and were done with it. But then, enter multiple screens, and
+ // suddenly it was all broken.
+ //
+ // For now we only support the display configuration of the KMS/DRM
+ // backends of eglfs. See QTouchOutputMapping.
+ //
+ // The good news it that once winRect refers to the correct screen
+ // geometry in the full virtual desktop space, there is nothing else
+ // left to do since qguiapp will handle the rest.
+ QScreen *screen = QGuiApplication::primaryScreen();
+ if (m_screenIndex >= 0) {
+ const QList<QScreen *> screens = QGuiApplication::screens();
+ if (m_screenIndex < screens.count())
+ screen = screens.at(m_screenIndex);
+ }
+ winRect = QHighDpi::toNativePixels(screen->geometry(), screen);
}
const int hw_w = hw_range_x_max - hw_range_x_min;
@@ -675,10 +709,12 @@ void QEvdevTouchScreenData::reportPoints()
tp.pressure = (tp.pressure - hw_pressure_min) / qreal(hw_pressure_max - hw_pressure_min);
}
+ // Let qguiapp pick the target window.
QWindowSystemInterface::handleTouchEvent(Q_NULLPTR, q->touchDevice(), m_touchPoints);
}
+
QEvdevTouchScreenHandlerThread::QEvdevTouchScreenHandlerThread(const QString &device, const QString &spec, QObject *parent)
: QDaemonThread(parent), m_device(device), m_spec(spec), m_handler(Q_NULLPTR), m_touchDeviceRegistered(false)
{
diff --git a/src/platformsupport/input/evdevtouch/qevdevtouchhandler_p.h b/src/platformsupport/input/evdevtouch/qevdevtouchhandler_p.h
index a423bbd2ef..b29aa3a793 100644
--- a/src/platformsupport/input/evdevtouch/qevdevtouchhandler_p.h
+++ b/src/platformsupport/input/evdevtouch/qevdevtouchhandler_p.h
@@ -58,7 +58,7 @@
#include <QtCore/private/qthread_p.h>
#include <qpa/qwindowsysteminterface.h>
-#if !defined(QT_NO_MTDEV)
+#if QT_CONFIG(mtdev)
struct mtdev;
#endif
@@ -88,7 +88,7 @@ private:
int m_fd;
QEvdevTouchScreenData *d;
QTouchDevice *m_device;
-#if !defined(QT_NO_MTDEV)
+#if QT_CONFIG(mtdev)
mtdev *m_mtdev;
#endif
};
diff --git a/src/platformsupport/input/input.pri b/src/platformsupport/input/input.pri
index 3b9593eb31..eb4d8a983d 100644
--- a/src/platformsupport/input/input.pri
+++ b/src/platformsupport/input/input.pri
@@ -1,14 +1,18 @@
-contains(QT_CONFIG, evdev) {
+qtConfig(evdev) {
include($$PWD/evdevmouse/evdevmouse.pri)
include($$PWD/evdevkeyboard/evdevkeyboard.pri)
include($$PWD/evdevtouch/evdevtouch.pri)
include($$PWD/evdevtablet/evdevtablet.pri)
}
-contains(QT_CONFIG, tslib) {
+qtConfig(tslib) {
include($$PWD/tslib/tslib.pri)
}
-contains(QT_CONFIG, libinput) {
+qtConfig(libinput) {
include($$PWD/libinput/libinput.pri)
}
+
+qtConfig(evdev)|qtConfig(libinput) {
+ include($$PWD/shared/shared.pri)
+}
diff --git a/src/platformsupport/input/libinput/libinput.pri b/src/platformsupport/input/libinput/libinput.pri
index 35d962ff3c..f922769a37 100644
--- a/src/platformsupport/input/libinput/libinput.pri
+++ b/src/platformsupport/input/libinput/libinput.pri
@@ -10,14 +10,11 @@ SOURCES += \
$$PWD/qlibinputkeyboard.cpp \
$$PWD/qlibinputtouch.cpp
-INCLUDEPATH += $$QMAKE_INCDIR_LIBUDEV $$QMAKE_INCDIR_LIBINPUT
-LIBS_PRIVATE += $$QMAKE_LIBS_LIBUDEV $$QMAKE_LIBS_LIBINPUT
+QMAKE_USE_PRIVATE += libudev libinput
-contains(QT_CONFIG, xkbcommon-evdev) {
- INCLUDEPATH += $$QMAKE_INCDIR_XKBCOMMON_EVDEV
- LIBS_PRIVATE += $$QMAKE_LIBS_XKBCOMMON_EVDEV
-} else {
- DEFINES += QT_NO_XKBCOMMON_EVDEV
-}
+INCLUDEPATH += $$PWD/../shared
-DEFINES += QT_LIBINPUT_VERSION_MAJOR=$$QMAKE_LIBINPUT_VERSION_MAJOR QT_LIBINPUT_VERSION_MINOR=$$QMAKE_LIBINPUT_VERSION_MINOR
+qtConfig(xkbcommon-evdev): \
+ QMAKE_USE_PRIVATE += xkbcommon_evdev
+else: \
+ DEFINES += QT_NO_XKBCOMMON_EVDEV
diff --git a/src/platformsupport/input/libinput/qlibinputpointer.cpp b/src/platformsupport/input/libinput/qlibinputpointer.cpp
index d5a3a8b437..3b583ec99d 100644
--- a/src/platformsupport/input/libinput/qlibinputpointer.cpp
+++ b/src/platformsupport/input/libinput/qlibinputpointer.cpp
@@ -96,7 +96,7 @@ void QLibInputPointer::processMotion(libinput_event_pointer *e)
void QLibInputPointer::processAxis(libinput_event_pointer *e)
{
-#if QT_LIBINPUT_VERSION_MAJOR == 0 && QT_LIBINPUT_VERSION_MINOR <= 7
+#if QT_LIBRARY_VERSION(libinput) < QT_VERSION_CHECK(0, 8, 0)
const double v = libinput_event_pointer_get_axis_value(e) * 120;
const Qt::Orientation ori = libinput_event_pointer_get_axis(e) == LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL
? Qt::Vertical : Qt::Horizontal;
diff --git a/src/platformsupport/input/libinput/qlibinputtouch.cpp b/src/platformsupport/input/libinput/qlibinputtouch.cpp
index 0a0e9daccb..42925a18e1 100644
--- a/src/platformsupport/input/libinput/qlibinputtouch.cpp
+++ b/src/platformsupport/input/libinput/qlibinputtouch.cpp
@@ -41,6 +41,7 @@
#include <libinput.h>
#include <QtGui/QGuiApplication>
#include <QtGui/QScreen>
+#include <QtGui/private/qhighdpiscaling_p.h>
QT_BEGIN_NAMESPACE
@@ -63,10 +64,14 @@ QLibInputTouch::DeviceState *QLibInputTouch::deviceState(libinput_event_touch *e
static inline QPointF getPos(libinput_event_touch *e)
{
- const QSize screenSize = QGuiApplication::primaryScreen()->geometry().size();
- const double x = libinput_event_touch_get_x_transformed(e, screenSize.width());
- const double y = libinput_event_touch_get_y_transformed(e, screenSize.height());
- return QPointF(x, y);
+ // TODO Map to correct screen using QTouchOutputMapping.
+ // Perhaps investigate libinput_device_get_output_name as well.
+ // For now just use the primary screen.
+ QScreen *screen = QGuiApplication::primaryScreen();
+ const QRect geom = QHighDpi::toNativePixels(screen->geometry(), screen);
+ const double x = libinput_event_touch_get_x_transformed(e, geom.width());
+ const double y = libinput_event_touch_get_y_transformed(e, geom.height());
+ return geom.topLeft() + QPointF(x, y);
}
void QLibInputTouch::registerDevice(libinput_device *dev)
diff --git a/config.tests/x11/xkb/xkb.cpp b/src/platformsupport/input/shared/qtouchoutputmapping.cpp
index 9876f67a71..55c1dc34f4 100644
--- a/config.tests/x11/xkb/xkb.cpp
+++ b/src/platformsupport/input/shared/qtouchoutputmapping.cpp
@@ -3,7 +3,7 @@
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the config.tests of the Qt Toolkit.
+** This file is part of the plugins module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -37,33 +37,55 @@
**
****************************************************************************/
-#include <X11/Xlib.h>
-#include <X11/XKBlib.h>
+#include "qtouchoutputmapping_p.h"
+#include <QFile>
+#include <QVariantMap>
+#include <QJsonDocument>
+#include <QJsonObject>
+#include <QJsonArray>
-int main(int, char **)
+QT_BEGIN_NAMESPACE
+
+bool QTouchOutputMapping::load()
{
- Display *display = 0;
+ static QByteArray configFile = qgetenv("QT_QPA_EGLFS_KMS_CONFIG");
+ if (configFile.isEmpty())
+ return false;
- int opcode = -1;
- int xkbEventBase = -1;
- int xkbErrorBase = -1;
- int xkblibMajor = XkbMajorVersion;
- int xkblibMinor = XkbMinorVersion;
- XkbQueryExtension(display, &opcode, &xkbEventBase, &xkbErrorBase, &xkblibMajor, &xkblibMinor);
+ QFile file(QString::fromUtf8(configFile));
+ if (!file.open(QFile::ReadOnly)) {
+ qWarning("touch input support: Failed to open %s", configFile.constData());
+ return false;
+ }
- int keycode = 0;
- unsigned int state = 0;
- KeySym keySym;
- unsigned int consumedModifiers;
- XkbLookupKeySym(display, keycode, state, &consumedModifiers, &keySym);
+ const QJsonDocument doc = QJsonDocument::fromJson(file.readAll());
+ if (!doc.isObject()) {
+ qWarning("touch input support: Failed to parse %s", configFile.constData());
+ return false;
+ }
- XkbDescPtr xkbDesc = XkbGetMap(display, XkbAllClientInfoMask, XkbUseCoreKbd);
- int w = XkbKeyGroupsWidth(xkbDesc, keycode);
- keySym = XkbKeySym(xkbDesc, keycode, w-1);
- XkbFreeClientMap(xkbDesc, XkbAllClientInfoMask, true);
+ // What we are interested is the virtualIndex and touchDevice properties for
+ // each element in the outputs array.
+ const QJsonArray outputs = doc.object().value(QLatin1String("outputs")).toArray();
+ for (int i = 0; i < outputs.size(); ++i) {
+ const QVariantMap output = outputs.at(i).toObject().toVariantMap();
+ if (!output.contains(QStringLiteral("touchDevice")))
+ continue;
+ if (!output.contains(QStringLiteral("virtualIndex"))) {
+ qWarning("evdevtouch: Output %d specifies touchDevice but not virtualIndex, this is wrong", i);
+ continue;
+ }
+ const QString &deviceNode = output.value(QStringLiteral("touchDevice")).toString();
+ const int screenIndex = output.value(QStringLiteral("virtualIndex")).toInt();
+ m_screenIndexTable.insert(deviceNode, screenIndex);
+ }
- state = XkbPCF_GrabsUseXKBStateMask;
- (void) XkbSetPerClientControls(display, state, &state);
+ return true;
+}
- return 0;
+int QTouchOutputMapping::screenIndexForDeviceNode(const QString &deviceNode)
+{
+ return m_screenIndexTable.value(deviceNode, -1);
}
+
+QT_END_NAMESPACE
diff --git a/config.tests/x11/notype/notypetest.cpp b/src/platformsupport/input/shared/qtouchoutputmapping_p.h
index 1faf4db056..74999d93ce 100644
--- a/config.tests/x11/notype/notypetest.cpp
+++ b/src/platformsupport/input/shared/qtouchoutputmapping_p.h
@@ -3,7 +3,7 @@
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the config.tests of the Qt Toolkit.
+** This file is part of the plugins module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -37,14 +37,35 @@
**
****************************************************************************/
-/* Sample program for configure to test for broken X11 headers that
-confuse gcc 2.95 and better on target platforms such as Solaris.
-*/
+#ifndef QTOUCHOUTPUTMAPPING_P_H
+#define QTOUCHOUTPUTMAPPING_P_H
-#include <X11/Xlib.h>
-#include <X11/ICE/ICElib.h>
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
-int main()
+#include <QString>
+#include <QHash>
+
+QT_BEGIN_NAMESPACE
+
+class QTouchOutputMapping
{
- return 0;
-}
+public:
+ bool load();
+ int screenIndexForDeviceNode(const QString &deviceNode);
+
+private:
+ QHash<QString, int> m_screenIndexTable;
+};
+
+QT_END_NAMESPACE
+
+#endif // QTOUCHOUTPUTMAPPING_P_H
diff --git a/src/platformsupport/input/shared/shared.pri b/src/platformsupport/input/shared/shared.pri
new file mode 100644
index 0000000000..1443235244
--- /dev/null
+++ b/src/platformsupport/input/shared/shared.pri
@@ -0,0 +1,5 @@
+HEADERS += \
+ $$PWD/qtouchoutputmapping_p.h
+
+SOURCES += \
+ $$PWD/qtouchoutputmapping.cpp
diff --git a/src/platformsupport/input/tslib/tslib.pri b/src/platformsupport/input/tslib/tslib.pri
index c9fef1ca8f..9efd126e13 100644
--- a/src/platformsupport/input/tslib/tslib.pri
+++ b/src/platformsupport/input/tslib/tslib.pri
@@ -4,4 +4,4 @@ HEADERS += \
SOURCES += \
$$PWD/qtslib.cpp
-LIBS += -lts
+QMAKE_USE += tslib
diff --git a/src/platformsupport/linuxaccessibility/atspiadaptor.cpp b/src/platformsupport/linuxaccessibility/atspiadaptor.cpp
index 2b81de43a7..f6c126a771 100644
--- a/src/platformsupport/linuxaccessibility/atspiadaptor.cpp
+++ b/src/platformsupport/linuxaccessibility/atspiadaptor.cpp
@@ -778,9 +778,8 @@ void AtSpiAdaptor::updateEventListeners()
QDBusReply<QSpiEventListenerArray> listenersReply = m_dbus->connection().call(m);
if (listenersReply.isValid()) {
const QSpiEventListenerArray evList = listenersReply.value();
- Q_FOREACH (const QSpiEventListener &ev, evList) {
+ for (const QSpiEventListener &ev : evList)
setBitFlag(ev.eventName);
- }
m_applicationAdaptor->sendEvents(!evList.isEmpty());
} else {
qAtspiDebug("Could not query active accessibility event listeners.");
@@ -1508,11 +1507,10 @@ QStringList AtSpiAdaptor::accessibleInterfaces(QAccessibleInterface *interface)
QSpiRelationArray AtSpiAdaptor::relationSet(QAccessibleInterface *interface, const QDBusConnection &connection) const
{
typedef QPair<QAccessibleInterface*, QAccessible::Relation> RelationPair;
- QVector<RelationPair> relationInterfaces;
- relationInterfaces = interface->relations();
+ const QVector<RelationPair> relationInterfaces = interface->relations();
QSpiRelationArray relations;
- Q_FOREACH (const RelationPair &pair, relationInterfaces) {
+ for (const RelationPair &pair : relationInterfaces) {
// FIXME: this loop seems a bit strange... "related" always have one item when we check.
//And why is it a list, when it always have one item? And it seems to assume that the QAccessible::Relation enum maps directly to AtSpi
QSpiObjectReferenceArray related;
@@ -1757,24 +1755,20 @@ QSpiActionArray AtSpiAdaptor::getActions(QAccessibleInterface *interface) const
QSpiActionArray actions;
const QStringList actionNames = QAccessibleBridgeUtils::effectiveActionNames(interface);
actions.reserve(actionNames.size());
- Q_FOREACH (const QString &actionName, actionNames) {
+ for (const QString &actionName : actionNames) {
QSpiAction action;
- QStringList keyBindings;
action.name = actionName;
if (actionInterface) {
action.description = actionInterface->localizedActionDescription(actionName);
- keyBindings = actionInterface->keyBindingsForAction(actionName);
+ const QStringList keyBindings = actionInterface->keyBindingsForAction(actionName);
+ if (!keyBindings.isEmpty())
+ action.keyBinding = keyBindings.front();
} else {
action.description = qAccessibleLocalizedActionDescription(actionName);
}
- if (keyBindings.length() > 0)
- action.keyBinding = keyBindings[0];
- else
- action.keyBinding = QString();
-
- actions << action;
+ actions.append(std::move(action));
}
return actions;
}
@@ -2085,7 +2079,6 @@ QVariantList AtSpiAdaptor::getAttributeValue(QAccessibleInterface *interface, in
QSpiAttributeSet map;
int startOffset;
int endOffset;
- bool defined;
joined = interface->textInterface()->attributes(offset, &startOffset, &endOffset);
attributes = joined.split (QLatin1Char(';'), QString::SkipEmptyParts, Qt::CaseSensitive);
@@ -2097,7 +2090,7 @@ QVariantList AtSpiAdaptor::getAttributeValue(QAccessibleInterface *interface, in
map[attribute.name] = attribute.value;
}
mapped = map[attributeName];
- defined = mapped.isEmpty();
+ const bool defined = !mapped.isEmpty();
QVariantList list;
list << mapped << startOffset << endOffset << defined;
return list;
diff --git a/src/platformsupport/linuxaccessibility/linuxaccessibility.pri b/src/platformsupport/linuxaccessibility/linuxaccessibility.pri
index 1b65fb1cad..1f36b815cf 100644
--- a/src/platformsupport/linuxaccessibility/linuxaccessibility.pri
+++ b/src/platformsupport/linuxaccessibility/linuxaccessibility.pri
@@ -1,4 +1,4 @@
-contains(QT_CONFIG, accessibility-atspi-bridge) {
+qtConfig(accessibility-atspi-bridge) {
QT_FOR_PRIVATE += dbus
include(../../3rdparty/atspi2/atspi2.pri)
diff --git a/src/platformsupport/platformcompositor/platformcompositor.pri b/src/platformsupport/platformcompositor/platformcompositor.pri
index 923d7225da..1e908c9998 100644
--- a/src/platformsupport/platformcompositor/platformcompositor.pri
+++ b/src/platformsupport/platformcompositor/platformcompositor.pri
@@ -1,4 +1,4 @@
-contains(QT_CONFIG, opengl) {
+qtConfig(opengl) {
SOURCES += $$PWD/qopenglcompositor.cpp \
$$PWD/qopenglcompositorbackingstore.cpp
diff --git a/src/platformsupport/platformsupport.pro b/src/platformsupport/platformsupport.pro
index 9f6f3380e1..0f1d709997 100644
--- a/src/platformsupport/platformsupport.pro
+++ b/src/platformsupport/platformsupport.pro
@@ -25,7 +25,7 @@ include(platformcompositor/platformcompositor.pri)
# dbus convenience, but not for darwin: the platform
# plugins for these platforms do not use dbus and we
# don't want to create a false dependency.
-!darwin: contains(QT_CONFIG, dbus) {
+!darwin:qtConfig(dbus) {
include(dbusmenu/dbusmenu.pri)
include(dbustray/dbustray.pri)
}
diff --git a/src/plugins/bearer/bearer.pro b/src/plugins/bearer/bearer.pro
index 8028e65147..8078a5708c 100644
--- a/src/plugins/bearer/bearer.pro
+++ b/src/plugins/bearer/bearer.pro
@@ -8,7 +8,7 @@ TEMPLATE = subdirs
#win32:SUBDIRS += nla
win32:SUBDIRS += generic
win32:!winrt: SUBDIRS += nativewifi
-mac:contains(QT_CONFIG, corewlan):SUBDIRS += corewlan
+darwin:qtConfig(corewlan): SUBDIRS += corewlan
mac:SUBDIRS += generic
android:SUBDIRS += android
diff --git a/src/plugins/bearer/corewlan/corewlan.pro b/src/plugins/bearer/corewlan/corewlan.pro
index ab0257aecd..1dc09ebdd6 100644
--- a/src/plugins/bearer/corewlan/corewlan.pro
+++ b/src/plugins/bearer/corewlan/corewlan.pro
@@ -3,7 +3,7 @@ TARGET = qcorewlanbearer
QT = core-private network-private
LIBS += -framework Foundation -framework SystemConfiguration
-contains(QT_CONFIG, corewlan) {
+qtConfig(corewlan) {
LIBS += -framework CoreWLAN -framework Security
}
diff --git a/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp b/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp
index b0bc8a265e..3cd9290420 100644
--- a/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp
+++ b/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp
@@ -553,14 +553,13 @@ void QNetworkManagerEngine::newConnection(const QDBusObjectPath &path,
emit configurationAdded(ptr);
}
-bool QNetworkManagerEngine::isConnectionActive(const QString &settingsPath)
+bool QNetworkManagerEngine::isConnectionActive(const QString &settingsPath) const
{
- QHashIterator<QString, QNetworkManagerConnectionActive*> i(activeConnectionsList);
- while (i.hasNext()) {
- i.next();
- if (i.value()->connection().path() == settingsPath) {
- if (i.value()->state() == NM_ACTIVE_CONNECTION_STATE_ACTIVATING
- || i.value()->state() == NM_ACTIVE_CONNECTION_STATE_ACTIVATED) {
+ for (QNetworkManagerConnectionActive *activeConnection : activeConnectionsList) {
+ if (activeConnection->connection().path() == settingsPath) {
+ const auto state = activeConnection->state();
+ if (state == NM_ACTIVE_CONNECTION_STATE_ACTIVATING
+ || state == NM_ACTIVE_CONNECTION_STATE_ACTIVATED) {
return true;
} else {
break;
@@ -848,9 +847,7 @@ QNetworkConfigurationPrivate *QNetworkManagerEngine::parseConnection(const QStri
if (ofonoManager && ofonoManager->isValid()) {
const QString contextPart = connectionPath.section('/', -1);
- QHashIterator<QString, QOfonoDataConnectionManagerInterface*> i(ofonoContextManagers);
- while (i.hasNext()) {
- i.next();
+ for (auto i = ofonoContextManagers.cbegin(), end = ofonoContextManagers.cend(); i != end; ++i) {
const QString path = i.key() + QLatin1Char('/') +contextPart;
if (isActiveContext(path)) {
cpPriv->state |= QNetworkConfiguration::Active;
@@ -863,14 +860,12 @@ QNetworkConfigurationPrivate *QNetworkManagerEngine::parseConnection(const QStri
return cpPriv;
}
-bool QNetworkManagerEngine::isActiveContext(const QString &contextPath)
+bool QNetworkManagerEngine::isActiveContext(const QString &contextPath) const
{
if (ofonoManager && ofonoManager->isValid()) {
const QString contextPart = contextPath.section('/', -1);
- QHashIterator<QString, QOfonoDataConnectionManagerInterface*> i(ofonoContextManagers);
- while (i.hasNext()) {
- i.next();
- PathPropertiesList list = i.value()->contextsWithProperties();
+ for (QOfonoDataConnectionManagerInterface *iface : ofonoContextManagers) {
+ const PathPropertiesList list = iface->contextsWithProperties();
for (int i = 0; i < list.size(); ++i) {
if (list.at(i).path.path().contains(contextPart)) {
return list.at(i).properties.value(QStringLiteral("Active")).toBool();
@@ -1012,10 +1007,7 @@ QNetworkSessionPrivate *QNetworkManagerEngine::createSessionBackend()
QNetworkConfigurationPrivatePointer QNetworkManagerEngine::defaultConfiguration()
{
- QHashIterator<QString, QNetworkManagerConnectionActive*> i(activeConnectionsList);
- while (i.hasNext()) {
- i.next();
- QNetworkManagerConnectionActive *activeConnection = i.value();
+ for (QNetworkManagerConnectionActive *activeConnection : qAsConst(activeConnectionsList)) {
if ((activeConnection->defaultRoute() || activeConnection->default6Route())) {
return accessPointConfigurations.value(activeConnection->connection().path());
}
@@ -1024,12 +1016,10 @@ QNetworkConfigurationPrivatePointer QNetworkManagerEngine::defaultConfiguration(
return QNetworkConfigurationPrivatePointer();
}
-QNetworkConfiguration::BearerType QNetworkManagerEngine::currentBearerType(const QString &id)
+QNetworkConfiguration::BearerType QNetworkManagerEngine::currentBearerType(const QString &id) const
{
QString contextPart = id.section('/', -1);
- QHashIterator<QString, QOfonoDataConnectionManagerInterface*> i(ofonoContextManagers);
- while (i.hasNext()) {
- i.next();
+ for (auto i = ofonoContextManagers.begin(), end = ofonoContextManagers.end(); i != end; ++i) {
QString contextPath = i.key() + QLatin1Char('/') +contextPart;
if (i.value()->contexts().contains(contextPath)) {
@@ -1055,13 +1045,11 @@ QNetworkConfiguration::BearerType QNetworkManagerEngine::currentBearerType(const
return QNetworkConfiguration::BearerUnknown;
}
-QString QNetworkManagerEngine::contextName(const QString &path)
+QString QNetworkManagerEngine::contextName(const QString &path) const
{
QString contextPart = path.section('/', -1);
- QHashIterator<QString, QOfonoDataConnectionManagerInterface*> i(ofonoContextManagers);
- while (i.hasNext()) {
- i.next();
- PathPropertiesList list = i.value()->contextsWithProperties();
+ for (QOfonoDataConnectionManagerInterface *iface : ofonoContextManagers) {
+ const PathPropertiesList list = iface->contextsWithProperties();
for (int i = 0; i < list.size(); ++i) {
if (list.at(i).path.path().contains(contextPart)) {
return list.at(i).properties.value(QStringLiteral("Name")).toString();
diff --git a/src/plugins/bearer/networkmanager/qnetworkmanagerengine.h b/src/plugins/bearer/networkmanager/qnetworkmanagerengine.h
index bfe2d746ec..ac70881f63 100644
--- a/src/plugins/bearer/networkmanager/qnetworkmanagerengine.h
+++ b/src/plugins/bearer/networkmanager/qnetworkmanagerengine.h
@@ -74,26 +74,26 @@ public:
bool networkManagerAvailable() const;
- QString getInterfaceFromId(const QString &id);
- bool hasIdentifier(const QString &id);
+ QString getInterfaceFromId(const QString &id) override;
+ bool hasIdentifier(const QString &id) override;
- void connectToId(const QString &id);
- void disconnectFromId(const QString &id);
+ void connectToId(const QString &id) override;
+ void disconnectFromId(const QString &id) override;
Q_INVOKABLE void initialize();
Q_INVOKABLE void requestUpdate();
- QNetworkSession::State sessionStateForId(const QString &id);
+ QNetworkSession::State sessionStateForId(const QString &id) override;
- quint64 bytesWritten(const QString &id);
- quint64 bytesReceived(const QString &id);
- quint64 startTime(const QString &id);
+ quint64 bytesWritten(const QString &id) override;
+ quint64 bytesReceived(const QString &id) override;
+ quint64 startTime(const QString &id) override;
- QNetworkConfigurationManager::Capabilities capabilities() const;
+ QNetworkConfigurationManager::Capabilities capabilities() const override;
- QNetworkSessionPrivate *createSessionBackend();
+ QNetworkSessionPrivate *createSessionBackend() override;
- QNetworkConfigurationPrivatePointer defaultConfiguration();
+ QNetworkConfigurationPrivatePointer defaultConfiguration() override;
private Q_SLOTS:
void interfacePropertiesChanged(const QMap<QString, QVariant> &properties);
@@ -140,14 +140,14 @@ private:
QOfonoManagerInterface *ofonoManager;
QHash <QString, QOfonoDataConnectionManagerInterface *> ofonoContextManagers;
- QNetworkConfiguration::BearerType currentBearerType(const QString &id);
- QString contextName(const QString &path);
+ QNetworkConfiguration::BearerType currentBearerType(const QString &id) const;
+ QString contextName(const QString &path) const;
- bool isConnectionActive(const QString &settingsPath);
+ bool isConnectionActive(const QString &settingsPath) const;
QDBusServiceWatcher *ofonoWatcher;
QDBusServiceWatcher *nmWatcher;
- bool isActiveContext(const QString &contextPath);
+ bool isActiveContext(const QString &contextPath) const;
bool nmAvailable;
void setupConfigurations();
};
diff --git a/src/plugins/bearer/networkmanager/qnetworkmanagerservice.cpp b/src/plugins/bearer/networkmanager/qnetworkmanagerservice.cpp
index 6c3c661db6..081cb1288d 100644
--- a/src/plugins/bearer/networkmanager/qnetworkmanagerservice.cpp
+++ b/src/plugins/bearer/networkmanager/qnetworkmanagerservice.cpp
@@ -215,9 +215,7 @@ QString QNetworkManagerInterface::version() const
void QNetworkManagerInterface::propertiesSwap(QMap<QString,QVariant> map)
{
- QMapIterator<QString, QVariant> i(map);
- while (i.hasNext()) {
- i.next();
+ for (auto i = map.cbegin(), end = map.cend(); i != end; ++i) {
propertyMap.insert(i.key(),i.value());
if (i.key() == QLatin1String("State")) {
@@ -334,11 +332,8 @@ quint32 QNetworkManagerInterfaceAccessPoint::strength() const
void QNetworkManagerInterfaceAccessPoint::propertiesSwap(QMap<QString,QVariant> map)
{
- QMapIterator<QString, QVariant> i(map);
- while (i.hasNext()) {
- i.next();
+ for (auto i = map.cbegin(), end = map.cend(); i != end; ++i)
propertyMap.insert(i.key(),i.value());
- }
}
QNetworkManagerInterfaceDevice::QNetworkManagerInterfaceDevice(const QString &deviceObjectPath, QObject *parent)
@@ -421,9 +416,7 @@ QDBusObjectPath QNetworkManagerInterfaceDevice::ip4config() const
void QNetworkManagerInterfaceDevice::propertiesSwap(QMap<QString,QVariant> map)
{
- QMapIterator<QString, QVariant> i(map);
- while (i.hasNext()) {
- i.next();
+ for (auto i = map.cbegin(), end = map.cend(); i != end; ++i) {
if (i.key() == QLatin1String("AvailableConnections")) { //Device
const QDBusArgument &dbusArgs = i.value().value<QDBusArgument>();
QDBusObjectPath path;
@@ -516,9 +509,7 @@ QStringList QNetworkManagerInterfaceDeviceWired::availableConnections()
void QNetworkManagerInterfaceDeviceWired::propertiesSwap(QMap<QString,QVariant> map)
{
- QMapIterator<QString, QVariant> i(map);
- while (i.hasNext()) {
- i.next();
+ for (auto i = map.cbegin(), end = map.cend(); i != end; ++i) {
propertyMap.insert(i.key(),i.value());
if (i.key() == QLatin1String("Carrier"))
Q_EMIT carrierChanged(i.value().toBool());
@@ -694,9 +685,7 @@ void QNetworkManagerInterfaceDeviceWireless::requestScan()
void QNetworkManagerInterfaceDeviceWireless::propertiesSwap(QMap<QString,QVariant> map)
{
- QMapIterator<QString, QVariant> i(map);
- while (i.hasNext()) {
- i.next();
+ for (auto i = map.cbegin(), end = map.cend(); i != end; ++i) {
propertyMap.insert(i.key(),i.value());
if (i.key() == QLatin1String("ActiveAccessPoint")) //DeviceWireless
Q_EMIT propertiesChanged(map);
@@ -753,11 +742,8 @@ QNetworkManagerInterfaceDeviceModem::ModemCapabilities QNetworkManagerInterfaceD
void QNetworkManagerInterfaceDeviceModem::propertiesSwap(QMap<QString,QVariant> map)
{
- QMapIterator<QString, QVariant> i(map);
- while (i.hasNext()) {
- i.next();
+ for (auto i = map.cbegin(), end = map.cend(); i != end; ++i)
propertyMap.insert(i.key(),i.value());
- }
Q_EMIT propertiesChanged(map);
}
@@ -1051,9 +1037,7 @@ bool QNetworkManagerConnectionActive::default6Route() const
void QNetworkManagerConnectionActive::propertiesSwap(QMap<QString,QVariant> map)
{
- QMapIterator<QString, QVariant> i(map);
- while (i.hasNext()) {
- i.next();
+ for (auto i = map.cbegin(), end = map.cend(); i != end; ++i) {
propertyMap.insert(i.key(),i.value());
if (i.key() == QLatin1String("State")) {
quint32 state = i.value().toUInt();
diff --git a/src/plugins/generic/generic.pro b/src/plugins/generic/generic.pro
index 182a60fdb5..c0a81d4dc8 100644
--- a/src/plugins/generic/generic.pro
+++ b/src/plugins/generic/generic.pro
@@ -2,11 +2,11 @@ TEMPLATE = subdirs
load(qfeatures)
-contains(QT_CONFIG, evdev) {
+qtConfig(evdev) {
SUBDIRS += evdevmouse evdevtouch evdevkeyboard evdevtablet
}
-contains(QT_CONFIG, tslib) {
+qtConfig(tslib) {
SUBDIRS += tslib
}
@@ -14,7 +14,7 @@ contains(QT_CONFIG, tslib) {
SUBDIRS += tuiotouch
}
-contains(QT_CONFIG, libinput) {
+qtConfig(libinput) {
SUBDIRS += libinput
}
diff --git a/src/plugins/generic/tslib/tslib.pro b/src/plugins/generic/tslib/tslib.pro
index 200d231cc8..d6a0eea3a0 100644
--- a/src/plugins/generic/tslib/tslib.pro
+++ b/src/plugins/generic/tslib/tslib.pro
@@ -4,7 +4,7 @@ SOURCES = main.cpp
QT += gui-private platformsupport-private
-LIBS += -lts
+QMAKE_USE += tslib
OTHER_FILES += tslib.json
diff --git a/src/plugins/imageformats/imageformats.pro b/src/plugins/imageformats/imageformats.pro
index 3de77c056d..d2588c1b18 100644
--- a/src/plugins/imageformats/imageformats.pro
+++ b/src/plugins/imageformats/imageformats.pro
@@ -1,5 +1,5 @@
TEMPLATE = subdirs
-!contains(QT_CONFIG, no-ico):SUBDIRS += ico
-contains(QT_CONFIG, jpeg): SUBDIRS += jpeg
-contains(QT_CONFIG, gif): SUBDIRS += gif
+qtConfig(ico): SUBDIRS += ico
+qtConfig(jpeg): SUBDIRS += jpeg
+qtConfig(gif): SUBDIRS += gif
diff --git a/src/plugins/imageformats/jpeg/jpeg.pro b/src/plugins/imageformats/jpeg/jpeg.pro
index 8954cc6402..89476e62f5 100644
--- a/src/plugins/imageformats/jpeg/jpeg.pro
+++ b/src/plugins/imageformats/jpeg/jpeg.pro
@@ -5,11 +5,8 @@ QT += core-private gui-private
SOURCES += main.cpp qjpeghandler.cpp
HEADERS += main.h qjpeghandler_p.h
-contains(QT_CONFIG, system-jpeg) {
- msvc: \
- LIBS += libjpeg.lib
- else: \
- LIBS += -ljpeg
+qtConfig(system-jpeg) {
+ QMAKE_USE += libjpeg
} else {
include($$PWD/../../../3rdparty/libjpeg.pri)
}
diff --git a/src/plugins/platforminputcontexts/compose/compose.pro b/src/plugins/platforminputcontexts/compose/compose.pro
index 86bdd4729b..17284874f6 100644
--- a/src/plugins/platforminputcontexts/compose/compose.pro
+++ b/src/plugins/platforminputcontexts/compose/compose.pro
@@ -12,13 +12,10 @@ HEADERS += $$PWD/qcomposeplatforminputcontext.h \
$$PWD/generator/qtablegenerator.h \
# libxkbcommon
-contains(QT_CONFIG, xkbcommon-qt): {
- # dont't need x11 dependency for compose key plugin
- QT_CONFIG -= use-xkbcommon-x11support
+!qtConfig(xkbcommon-system) {
include(../../../3rdparty/xkbcommon.pri)
} else {
- LIBS += $$QMAKE_LIBS_XKBCOMMON
- QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_XKBCOMMON
+ QMAKE_USE += xkbcommon
}
OTHER_FILES += $$PWD/compose.json
diff --git a/src/plugins/platforminputcontexts/ibus/qibustypes.cpp b/src/plugins/platforminputcontexts/ibus/qibustypes.cpp
index ac82fa3931..a2551f1320 100644
--- a/src/plugins/platforminputcontexts/ibus/qibustypes.cpp
+++ b/src/plugins/platforminputcontexts/ibus/qibustypes.cpp
@@ -73,10 +73,7 @@ void QIBusSerializable::serializeTo(QDBusArgument &argument) const
argument.beginMap(qMetaTypeId<QString>(), qMetaTypeId<QDBusVariant>());
- QHashIterator<QString, QDBusArgument> i(attachments);
- while (i.hasNext()) {
- i.next();
-
+ for (auto i = attachments.begin(), end = attachments.end(); i != end; ++i) {
argument.beginMapEntry();
argument << i.key();
diff --git a/src/plugins/platforminputcontexts/platforminputcontexts.pro b/src/plugins/platforminputcontexts/platforminputcontexts.pro
index faea54b874..f22b8b69db 100644
--- a/src/plugins/platforminputcontexts/platforminputcontexts.pro
+++ b/src/plugins/platforminputcontexts/platforminputcontexts.pro
@@ -4,6 +4,6 @@ qtHaveModule(dbus) {
!mac:!win32:SUBDIRS += ibus
}
-contains(QT_CONFIG, xcb-plugin): SUBDIRS += compose
+qtConfig(xcb): SUBDIRS += compose
diff --git a/src/plugins/platforms/android/androidjniinput.cpp b/src/plugins/platforms/android/androidjniinput.cpp
index 5be128a0c5..5f05ab395e 100644
--- a/src/plugins/platforms/android/androidjniinput.cpp
+++ b/src/plugins/platforms/android/androidjniinput.cpp
@@ -1,7 +1,8 @@
/****************************************************************************
**
** Copyright (C) 2012 BogDan Vatra <bogdan@kde.org>
-** Contact: https://www.qt.io/licensing/
+** Copyright (C) 2016 Olivier Goffart <ogoffart@woboq.com>
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the plugins of the Qt Toolkit.
**
@@ -120,6 +121,12 @@ namespace QtAndroidInput
return m_softwareKeyboardRect;
}
+ void updateHandles(int mode, QPoint cursor, QPoint anchor)
+ {
+ QJNIObjectPrivate::callStaticMethod<void>(applicationClass(), "updateHandles", "(IIIII)V",
+ mode, cursor.x(), cursor.y(), anchor.x(),
+ anchor.y());
+ }
static void mouseDown(JNIEnv */*env*/, jobject /*thiz*/, jint /*winId*/, jint x, jint y)
{
@@ -168,6 +175,10 @@ namespace QtAndroidInput
static void longPress(JNIEnv */*env*/, jobject /*thiz*/, jint /*winId*/, jint x, jint y)
{
+ QAndroidInputContext *inputContext = QAndroidInputContext::androidInputContext();
+ if (inputContext && qGuiApp)
+ QMetaObject::invokeMethod(inputContext, "longPress", Q_ARG(int, x), Q_ARG(int, y));
+
//### TODO: add proper API for Qt 5.2
static bool rightMouseFromLongPress = qEnvironmentVariableIntValue("QT_NECESSITAS_COMPATIBILITY_LONG_PRESS");
if (!rightMouseFromLongPress)
@@ -225,6 +236,12 @@ namespace QtAndroidInput
double(dw*size),
double(dh*size));
m_touchPoints.push_back(touchPoint);
+
+ if (state == Qt::TouchPointPressed) {
+ QAndroidInputContext *inputContext = QAndroidInputContext::androidInputContext();
+ if (inputContext && qGuiApp)
+ QMetaObject::invokeMethod(inputContext, "touchDown", Q_ARG(int, x), Q_ARG(int, y));
+ }
}
static void touchEnd(JNIEnv */*env*/, jobject /*thiz*/, jint /*winId*/, jint /*action*/)
@@ -786,6 +803,18 @@ namespace QtAndroidInput
#endif
}
+ static void handleLocationChanged(JNIEnv */*env*/, jobject /*thiz*/, int id, int x, int y)
+ {
+#ifdef QT_DEBUG_ANDROID_IM_PROTOCOL
+ qDebug() << "@@@ handleLocationChanged" << id << x << y;
+#endif
+ QAndroidInputContext *inputContext = QAndroidInputContext::androidInputContext();
+ if (inputContext && qGuiApp)
+ QMetaObject::invokeMethod(inputContext, "handleLocationChanged",
+ Q_ARG(int, id), Q_ARG(int, x), Q_ARG(int, y));
+
+ }
+
static JNINativeMethod methods[] = {
{"touchBegin","(I)V",(void*)touchBegin},
{"touchAdd","(IIIZIIFF)V",(void*)touchAdd},
@@ -799,7 +828,8 @@ namespace QtAndroidInput
{"keyDown", "(IIIZ)V", (void *)keyDown},
{"keyUp", "(IIIZ)V", (void *)keyUp},
{"keyboardVisibilityChanged", "(Z)V", (void *)keyboardVisibilityChanged},
- {"keyboardGeometryChanged", "(IIII)V", (void *)keyboardGeometryChanged}
+ {"keyboardGeometryChanged", "(IIII)V", (void *)keyboardGeometryChanged},
+ {"handleLocationChanged", "(III)V", (void *)handleLocationChanged}
};
bool registerNatives(JNIEnv *env)
diff --git a/src/plugins/platforms/android/androidjniinput.h b/src/plugins/platforms/android/androidjniinput.h
index 682abde098..af18a96dc1 100644
--- a/src/plugins/platforms/android/androidjniinput.h
+++ b/src/plugins/platforms/android/androidjniinput.h
@@ -39,6 +39,7 @@
#ifndef ANDROIDJNIINPUT_H
#define ANDROIDJNIINPUT_H
+
#include <jni.h>
#include <QtCore/qglobal.h>
#include <QtCore/QRect>
@@ -56,6 +57,9 @@ namespace QtAndroidInput
void updateSelection(int selStart, int selEnd, int candidatesStart, int candidatesEnd);
// Software keyboard support
+ // cursor/selection handles
+ void updateHandles(int handleCount, QPoint cursor = QPoint(), QPoint anchor = QPoint());
+
bool registerNatives(JNIEnv *env);
}
diff --git a/src/plugins/platforms/android/androidjnimain.cpp b/src/plugins/platforms/android/androidjnimain.cpp
index 6419ba2c51..677a2e2626 100644
--- a/src/plugins/platforms/android/androidjnimain.cpp
+++ b/src/plugins/platforms/android/androidjnimain.cpp
@@ -550,8 +550,11 @@ static void quitQtAndroidPlugin(JNIEnv *env, jclass /*clazz*/)
static void terminateQt(JNIEnv *env, jclass /*clazz*/)
{
- sem_wait(&m_terminateSemaphore);
- sem_destroy(&m_terminateSemaphore);
+ // QAndroidEventDispatcherStopper is stopped when the user uses the task manager to kill the application
+ if (!QAndroidEventDispatcherStopper::instance()->stopped()) {
+ sem_wait(&m_terminateSemaphore);
+ sem_destroy(&m_terminateSemaphore);
+ }
env->DeleteGlobalRef(m_applicationClass);
env->DeleteGlobalRef(m_classLoaderObject);
if (m_resourcesObj)
@@ -571,8 +574,11 @@ static void terminateQt(JNIEnv *env, jclass /*clazz*/)
m_androidPlatformIntegration = nullptr;
delete m_androidAssetsFileEngineHandler;
m_androidAssetsFileEngineHandler = nullptr;
- sem_post(&m_exitSemaphore);
- pthread_join(m_qtAppThread, nullptr);
+
+ if (!QAndroidEventDispatcherStopper::instance()->stopped()) {
+ sem_post(&m_exitSemaphore);
+ pthread_join(m_qtAppThread, nullptr);
+ }
}
static void setSurface(JNIEnv *env, jobject /*thiz*/, jint id, jobject jSurface, jint w, jint h)
diff --git a/src/plugins/platforms/android/qandroidinputcontext.cpp b/src/plugins/platforms/android/qandroidinputcontext.cpp
index 125a03469f..06a9c8c488 100644
--- a/src/plugins/platforms/android/qandroidinputcontext.cpp
+++ b/src/plugins/platforms/android/qandroidinputcontext.cpp
@@ -2,6 +2,7 @@
**
** Copyright (C) 2016 The Qt Company Ltd.
** Copyright (C) 2012 BogDan Vatra <bogdan@kde.org>
+** Copyright (C) 2016 Olivier Goffart <ogoffart@woboq.com>
** Contact: https://www.qt.io/licensing/
**
** This file is part of the plugins of the Qt Toolkit.
@@ -342,9 +343,28 @@ static JNINativeMethod methods[] = {
{"updateCursorPosition", "()Z", (void *)updateCursorPosition}
};
+static QRect inputItemRectangle()
+{
+ QRectF itemRect = qGuiApp->inputMethod()->inputItemRectangle();
+ QRect rect = qGuiApp->inputMethod()->inputItemTransform().mapRect(itemRect).toRect();
+ QWindow *window = qGuiApp->focusWindow();
+ if (window)
+ rect = QRect(window->mapToGlobal(rect.topLeft()), rect.size());
+ double pixelDensity = window
+ ? QHighDpiScaling::factor(window)
+ : QHighDpiScaling::factor(QtAndroid::androidPlatformIntegration()->screen());
+ if (pixelDensity != 1.0) {
+ rect.setX(rect.x() * pixelDensity);
+ rect.setY(rect.y() * pixelDensity);
+ rect.setWidth(rect.width() * pixelDensity);
+ rect.setHeight(rect.height() * pixelDensity);
+ }
+ return rect;
+}
QAndroidInputContext::QAndroidInputContext()
- : QPlatformInputContext(), m_composingTextStart(-1), m_blockUpdateSelection(false), m_batchEditNestingLevel(0), m_focusObject(0)
+ : QPlatformInputContext(), m_composingTextStart(-1), m_blockUpdateSelection(false),
+ m_cursorHandleShown(CursorHandleNotShown), m_batchEditNestingLevel(0), m_focusObject(0)
{
jclass clazz = QJNIEnvironmentPrivate::findClass(QtNativeInputConnectionClassName);
if (Q_UNLIKELY(!clazz)) {
@@ -415,6 +435,9 @@ QAndroidInputContext::QAndroidInputContext()
qRegisterMetaType<QInputMethodEvent *>("QInputMethodEvent*");
qRegisterMetaType<QInputMethodQueryEvent *>("QInputMethodQueryEvent*");
m_androidInputContext = this;
+
+ QObject::connect(QGuiApplication::inputMethod(), &QInputMethod::cursorRectangleChanged,
+ this, &QAndroidInputContext::updateSelectionHandles);
}
QAndroidInputContext::~QAndroidInputContext()
@@ -452,6 +475,7 @@ void QAndroidInputContext::reset()
{
clear();
m_batchEditNestingLevel = 0;
+ m_cursorHandleShown = QAndroidInputContext::CursorHandleNotShown;
if (qGuiApp->focusObject()) {
QSharedPointer<QInputMethodQueryEvent> query = focusObjectInputMethodQueryThreadSafe(Qt::ImEnabled);
if (!query.isNull() && query->value(Qt::ImEnabled).toBool()) {
@@ -500,6 +524,119 @@ void QAndroidInputContext::updateCursorPosition()
}
}
+void QAndroidInputContext::updateSelectionHandles()
+{
+ auto im = qGuiApp->inputMethod();
+ if (!m_focusObject || (m_cursorHandleShown == CursorHandleNotShown)) {
+ // Hide the handles
+ QtAndroidInput::updateHandles(0);
+ return;
+ }
+ QWindow *window = qGuiApp->focusWindow();
+ double pixelDensity = window
+ ? QHighDpiScaling::factor(window)
+ : QHighDpiScaling::factor(QtAndroid::androidPlatformIntegration()->screen());
+
+ QInputMethodQueryEvent query(Qt::ImCursorPosition | Qt::ImAnchorPosition | Qt::ImEnabled);
+ QCoreApplication::sendEvent(m_focusObject, &query);
+ int cpos = query.value(Qt::ImCursorPosition).toInt();
+ int anchor = query.value(Qt::ImAnchorPosition).toInt();
+
+ if (cpos == anchor || im->anchorRectangle().isNull()) {
+ if (!query.value(Qt::ImEnabled).toBool()) {
+ QtAndroidInput::updateHandles(0);
+ return;
+ }
+
+ auto curRect = im->cursorRectangle();
+ QPoint cursorPoint(curRect.center().x(), curRect.bottom());
+ QPoint editMenuPoint(curRect.center().x(), curRect.top());
+ QtAndroidInput::updateHandles(m_cursorHandleShown, cursorPoint * pixelDensity,
+ editMenuPoint * pixelDensity);
+ return;
+ }
+
+ auto leftRect = im->cursorRectangle();
+ auto rightRect = im->anchorRectangle();
+ if (cpos > anchor)
+ std::swap(leftRect, rightRect);
+
+ QPoint leftPoint(leftRect.bottomLeft().toPoint() * pixelDensity);
+ QPoint righPoint(rightRect.bottomRight().toPoint() * pixelDensity);
+ QtAndroidInput::updateHandles(CursorHandleShowSelection, leftPoint, righPoint);
+
+ if (m_cursorHandleShown == CursorHandleShowPopup) {
+ // make sure the popup does not reappear when the selection menu closes
+ m_cursorHandleShown = QAndroidInputContext::CursorHandleNotShown;
+ }
+}
+
+/*
+ Called from Java when a cursor/selection handle was dragged to a new position
+
+ handleId of 1 means the cursor handle, 2 means the left handle, 3 means the right handle
+ */
+void QAndroidInputContext::handleLocationChanged(int handleId, int x, int y)
+{
+ auto im = qGuiApp->inputMethod();
+ auto leftRect = im->cursorRectangle();
+ // The handle is down of the cursor, but we want the position in the middle.
+ QWindow *window = qGuiApp->focusWindow();
+ double pixelDensity = window
+ ? QHighDpiScaling::factor(window)
+ : QHighDpiScaling::factor(QtAndroid::androidPlatformIntegration()->screen());
+ QPoint point(x / pixelDensity, y / pixelDensity);
+ y -= leftRect.width() / 2;
+ if (handleId == 1) {
+ setSelectionOnFocusObject(point, point);
+ return;
+ }
+
+ QInputMethodQueryEvent query(Qt::ImCursorPosition | Qt::ImAnchorPosition);
+ QCoreApplication::sendEvent(m_focusObject, &query);
+ int cpos = query.value(Qt::ImCursorPosition).toInt();
+ int anchor = query.value(Qt::ImAnchorPosition).toInt();
+
+ auto rightRect = im->anchorRectangle();
+ if (cpos > anchor)
+ std::swap(leftRect, rightRect);
+
+ if (handleId == 2) {
+ QPoint rightPoint(rightRect.center().toPoint());
+ setSelectionOnFocusObject(point, rightPoint);
+ } else if (handleId == 3) {
+ QPoint leftPoint(leftRect.center().toPoint());
+ setSelectionOnFocusObject(leftPoint, point);
+ }
+}
+
+void QAndroidInputContext::touchDown(int x, int y)
+{
+ if (m_focusObject && inputItemRectangle().contains(x, y) && !m_cursorHandleShown) {
+ // If the user touch the input rectangle, we can show the cursor handle
+ m_cursorHandleShown = QAndroidInputContext::CursorHandleShowNormal;
+ updateSelectionHandles();
+ }
+}
+
+void QAndroidInputContext::longPress(int x, int y)
+{
+ if (m_focusObject && inputItemRectangle().contains(x, y)) {
+ // Show the paste menu if there is something to paste.
+ m_cursorHandleShown = QAndroidInputContext::CursorHandleShowPopup;
+ updateSelectionHandles();
+ }
+}
+
+void QAndroidInputContext::keyDown()
+{
+ if (m_cursorHandleShown) {
+ // When the user enter text on the keyboard, we hide the cursor handle
+ m_cursorHandleShown = QAndroidInputContext::CursorHandleNotShown;
+ updateSelectionHandles();
+ }
+}
+
void QAndroidInputContext::update(Qt::InputMethodQueries queries)
{
QSharedPointer<QInputMethodQueryEvent> query = focusObjectInputMethodQueryThreadSafe(queries);
@@ -543,22 +680,11 @@ void QAndroidInputContext::showInputPanel()
m_updateCursorPosConnection = connect(qGuiApp->focusObject(), SIGNAL(cursorPositionChanged(int,int)), this, SLOT(updateCursorPosition()));
else
m_updateCursorPosConnection = connect(qGuiApp->focusObject(), SIGNAL(cursorPositionChanged()), this, SLOT(updateCursorPosition()));
- QRectF itemRect = qGuiApp->inputMethod()->inputItemRectangle();
- QRect rect = qGuiApp->inputMethod()->inputItemTransform().mapRect(itemRect).toRect();
- QWindow *window = qGuiApp->focusWindow();
- if (window)
- rect = QRect(window->mapToGlobal(rect.topLeft()), rect.size());
- double pixelDensity = window ? QHighDpiScaling::factor(window)
- : QHighDpiScaling::factor(QtAndroid::androidPlatformIntegration()->screen());
-
- QtAndroidInput::showSoftwareKeyboard(rect.left() * pixelDensity,
- rect.top() * pixelDensity,
- rect.width() * pixelDensity,
- rect.height() * pixelDensity,
+ QRect rect = inputItemRectangle();
+ QtAndroidInput::showSoftwareKeyboard(rect.left(), rect.top(), rect.width(), rect.height(),
query->value(Qt::ImHints).toUInt(),
- query->value(Qt::ImEnterKeyType).toUInt()
- );
+ query->value(Qt::ImEnterKeyType).toUInt());
}
void QAndroidInputContext::showInputPanelLater(Qt::ApplicationState state)
@@ -601,6 +727,7 @@ void QAndroidInputContext::setFocusObject(QObject *object)
reset();
}
QPlatformInputContext::setFocusObject(object);
+ updateSelectionHandles();
}
jboolean QAndroidInputContext::beginBatchEdit()
@@ -858,6 +985,8 @@ jboolean QAndroidInputContext::setComposingText(const QString &text, jint newCur
QInputMethodEvent event(m_composingText, attributes);
sendInputMethodEventThreadSafe(&event);
+ QMetaObject::invokeMethod(this, "keyDown");
+
updateCursorPosition();
return JNI_TRUE;
@@ -979,20 +1108,21 @@ jboolean QAndroidInputContext::setSelection(jint start, jint end)
jboolean QAndroidInputContext::selectAll()
{
-#warning TODO
- return JNI_FALSE;
+ sendShortcut(QKeySequence::SelectAll);
+ return JNI_TRUE;
}
jboolean QAndroidInputContext::cut()
{
-#warning TODO
- return JNI_FALSE;
+ m_cursorHandleShown = CursorHandleNotShown;
+ sendShortcut(QKeySequence::Cut);
+ return JNI_TRUE;
}
jboolean QAndroidInputContext::copy()
{
-#warning TODO
- return JNI_FALSE;
+ sendShortcut(QKeySequence::Copy);
+ return JNI_TRUE;
}
jboolean QAndroidInputContext::copyURL()
@@ -1003,10 +1133,21 @@ jboolean QAndroidInputContext::copyURL()
jboolean QAndroidInputContext::paste()
{
-#warning TODO
- return JNI_FALSE;
+ m_cursorHandleShown = CursorHandleNotShown;
+ sendShortcut(QKeySequence::Paste);
+ return JNI_TRUE;
}
+void QAndroidInputContext::sendShortcut(const QKeySequence &sequence)
+{
+ for (int i = 0; i < sequence.count(); ++i) {
+ const int keys = sequence[i];
+ Qt::Key key = Qt::Key(keys & ~Qt::KeyboardModifierMask);
+ Qt::KeyboardModifiers mod = Qt::KeyboardModifiers(keys & Qt::KeyboardModifierMask);
+ QGuiApplication::postEvent(m_focusObject, new QKeyEvent(QEvent::KeyPress, key, mod));
+ QGuiApplication::postEvent(m_focusObject, new QKeyEvent(QEvent::KeyRelease, key, mod));
+ }
+}
Q_INVOKABLE QVariant QAndroidInputContext::queryFocusObjectUnsafe(Qt::InputMethodQuery query, QVariant argument)
{
diff --git a/src/plugins/platforms/android/qandroidinputcontext.h b/src/plugins/platforms/android/qandroidinputcontext.h
index 5ab85dcab0..8a33ff71cc 100644
--- a/src/plugins/platforms/android/qandroidinputcontext.h
+++ b/src/plugins/platforms/android/qandroidinputcontext.h
@@ -1,6 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 BogDan Vatra <bogdan@kde.org>
+** Copyright (C) 2016 Olivier Goffart <ogoffart@woboq.com>
** Contact: https://www.qt.io/licensing/
**
** This file is part of the plugins of the Qt Toolkit.
@@ -94,6 +95,7 @@ public:
bool isComposing() const;
void clear();
void setFocusObject(QObject *object);
+ void sendShortcut(const QKeySequence &);
//---------------//
jboolean beginBatchEdit();
@@ -117,6 +119,11 @@ public:
public slots:
void updateCursorPosition();
+ void updateSelectionHandles();
+ void handleLocationChanged(int handleId, int x, int y);
+ void touchDown(int x, int y);
+ void longPress(int x, int y);
+ void keyDown();
private slots:
void showInputPanelLater(Qt::ApplicationState);
@@ -138,6 +145,13 @@ private:
int m_composingCursor;
QMetaObject::Connection m_updateCursorPosConnection;
bool m_blockUpdateSelection;
+ enum CursorHandleShowMode {
+ CursorHandleNotShown,
+ CursorHandleShowNormal = 1,
+ CursorHandleShowSelection = 2,
+ CursorHandleShowPopup = 3
+ };
+ CursorHandleShowMode m_cursorHandleShown;
int m_batchEditNestingLevel;
QObject *m_focusObject;
};
diff --git a/src/plugins/platforms/android/qandroidplatformfontdatabase.cpp b/src/plugins/platforms/android/qandroidplatformfontdatabase.cpp
index 0667a9073f..a14271c8f5 100644
--- a/src/plugins/platforms/android/qandroidplatformfontdatabase.cpp
+++ b/src/plugins/platforms/android/qandroidplatformfontdatabase.cpp
@@ -60,7 +60,8 @@ void QAndroidPlatformFontDatabase::populateFontDatabase()
QStringList nameFilters;
nameFilters << QLatin1String("*.ttf")
- << QLatin1String("*.otf");
+ << QLatin1String("*.otf")
+ << QLatin1String("*.ttc");
const auto entries = dir.entryInfoList(nameFilters, QDir::Files);
for (const QFileInfo &fi : entries) {
diff --git a/src/plugins/platforms/bsdfb/qbsdfbintegration.cpp b/src/plugins/platforms/bsdfb/qbsdfbintegration.cpp
index edb4f4e660..e935d89c9f 100644
--- a/src/plugins/platforms/bsdfb/qbsdfbintegration.cpp
+++ b/src/plugins/platforms/bsdfb/qbsdfbintegration.cpp
@@ -48,7 +48,7 @@
#include <qpa/qplatforminputcontext.h>
#include <qpa/qplatforminputcontextfactory_p.h>
-#if !defined(QT_NO_TSLIB)
+#if QT_CONFIG(tslib)
#include <QtPlatformSupport/private/qtslib_p.h>
#endif
@@ -127,7 +127,7 @@ QPlatformServices *QBsdFbIntegration::services() const
void QBsdFbIntegration::createInputHandlers()
{
-#ifndef QT_NO_TSLIB
+#if QT_CONFIG(tslib)
const bool useTslib = qEnvironmentVariableIntValue("QT_QPA_FB_TSLIB");
if (useTslib)
new QTsLibMouseHandler(QLatin1String("TsLib"), QString());
diff --git a/src/plugins/platforms/cocoa/cocoa.pro b/src/plugins/platforms/cocoa/cocoa.pro
index 02d8b16110..d9d3cb1627 100644
--- a/src/plugins/platforms/cocoa/cocoa.pro
+++ b/src/plugins/platforms/cocoa/cocoa.pro
@@ -71,7 +71,7 @@ HEADERS += qcocoaintegration.h \
messages.h \
qcocoamimetypes.h
-contains(QT_CONFIG, opengl.*) {
+qtConfig(opengl.*) {
OBJECTIVE_SOURCES += qcocoaglcontext.mm
HEADERS += qcocoaglcontext.h
diff --git a/src/plugins/platforms/cocoa/qcocoadrag.mm b/src/plugins/platforms/cocoa/qcocoadrag.mm
index 1ebcde0584..13ae0382ab 100644
--- a/src/plugins/platforms/cocoa/qcocoadrag.mm
+++ b/src/plugins/platforms/cocoa/qcocoadrag.mm
@@ -40,6 +40,9 @@
#include "qcocoadrag.h"
#include "qmacclipboard.h"
#include "qcocoahelpers.h"
+#ifndef QT_NO_WIDGETS
+#include <QtWidgets/qwidget.h>
+#endif
QT_BEGIN_NAMESPACE
@@ -187,7 +190,18 @@ QPixmap QCocoaDrag::dragPixmap(QDrag *drag, QPoint &hotSpot) const
const int width = fm.width(s);
const int height = fm.height();
if (width > 0 && height > 0) {
- pm = QPixmap(width, height);
+ qreal dpr = 1.0;
+ if (const QWindow *sourceWindow = qobject_cast<QWindow *>(drag->source())) {
+ dpr = sourceWindow->devicePixelRatio();
+ }
+#ifndef QT_NO_WIDGETS
+ else if (const QWidget *sourceWidget = qobject_cast<QWidget *>(drag->source())) {
+ if (const QWindow *sourceWindow = sourceWidget->window()->windowHandle())
+ dpr = sourceWindow->devicePixelRatio();
+ }
+#endif
+ pm = QPixmap(width * dpr, height * dpr);
+ pm.setDevicePixelRatio(dpr);
QPainter p(&pm);
p.fillRect(0, 0, pm.width(), pm.height(), Qt::color0);
p.setPen(Qt::color1);
diff --git a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
index 0375dd85f2..31a0a3d600 100644
--- a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
+++ b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
@@ -589,6 +589,15 @@ void QCocoaFileDialogHelper::QNSOpenSavePanelDelegate_panelClosed(bool accepted)
QCocoaMenuBar::resetKnownMenuItemsToQt();
if (accepted) {
emit accept();
+
+ QString filter = selectedNameFilter();
+ if (filter.isEmpty())
+ emit filterSelected(filter);
+
+ QList<QUrl> files = selectedFiles();
+ emit filesSelected(files);
+ if (files.count() == 1)
+ emit fileSelected(files.first());
} else {
emit reject();
}
diff --git a/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm b/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm
index dc7dfb788f..dfda22d376 100644
--- a/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm
+++ b/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm
@@ -365,6 +365,7 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSFontPanelDelegate);
emit mHelper->reject();
} else {
emit mHelper->accept();
+ emit mHelper->fontSelected(mHelper->currentFont());
}
}
}
diff --git a/src/plugins/platforms/cocoa/qcocoahelpers.mm b/src/plugins/platforms/cocoa/qcocoahelpers.mm
index 9b4055d92d..6920f75887 100644
--- a/src/plugins/platforms/cocoa/qcocoahelpers.mm
+++ b/src/plugins/platforms/cocoa/qcocoahelpers.mm
@@ -101,65 +101,23 @@ void *qt_mac_QStringListToNSMutableArrayVoid(const QStringList &list)
return result;
}
-static void qt_mac_deleteImage(void *image, const void *, size_t)
-{
- delete static_cast<QImage *>(image);
-}
-
-// Creates a CGDataProvider with the data from the given image.
-// The data provider retains a copy of the image.
-CGDataProviderRef qt_mac_CGDataProvider(const QImage &image)
-{
- return CGDataProviderCreateWithData(new QImage(image), image.bits(),
- image.byteCount(), qt_mac_deleteImage);
-}
-
CGImageRef qt_mac_toCGImage(const QImage &inImage)
{
- if (inImage.isNull())
- return 0;
+ CGImageRef cgImage = inImage.toCGImage();
+ if (cgImage)
+ return cgImage;
- QImage image = inImage;
-
- uint cgflags = kCGImageAlphaNone;
- switch (image.format()) {
- case QImage::Format_ARGB32:
- cgflags = kCGImageAlphaFirst | kCGBitmapByteOrder32Host;
- break;
- case QImage::Format_RGB32:
- cgflags = kCGImageAlphaNoneSkipFirst | kCGBitmapByteOrder32Host;
- break;
- case QImage::Format_RGB888:
- cgflags = kCGImageAlphaNone | kCGBitmapByteOrder32Big;
- break;
- case QImage::Format_RGBA8888_Premultiplied:
- cgflags = kCGImageAlphaPremultipliedLast | kCGBitmapByteOrder32Big;
- break;
- case QImage::Format_RGBA8888:
- cgflags = kCGImageAlphaLast | kCGBitmapByteOrder32Big;
- break;
- case QImage::Format_RGBX8888:
- cgflags = kCGImageAlphaNoneSkipLast | kCGBitmapByteOrder32Big;
- break;
- default:
- // Everything not recognized explicitly is converted to ARGB32_Premultiplied.
- image = inImage.convertToFormat(QImage::Format_ARGB32_Premultiplied);
- // no break;
- case QImage::Format_ARGB32_Premultiplied:
- cgflags = kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host;
- break;
- }
-
- QCFType<CGDataProviderRef> dataProvider = qt_mac_CGDataProvider(image);
- return CGImageCreate(image.width(), image.height(), 8, 32,
- image.bytesPerLine(),
- qt_mac_genericColorSpace(),
- cgflags, dataProvider, 0, false, kCGRenderingIntentDefault);
+ // Convert image data to a known-good format if the fast conversion fails.
+ return inImage.convertToFormat(QImage::Format_ARGB32_Premultiplied).toCGImage();
}
CGImageRef qt_mac_toCGImageMask(const QImage &image)
{
- QCFType<CGDataProviderRef> dataProvider = qt_mac_CGDataProvider(image);
+ static const auto deleter = [](void *image, const void *, size_t) { delete static_cast<QImage *>(image); };
+ QCFType<CGDataProviderRef> dataProvider =
+ CGDataProviderCreateWithData(new QImage(image), image.bits(),
+ image.byteCount(), deleter);
+
return CGImageMaskCreate(image.width(), image.height(), 8, image.depth(),
image.bytesPerLine(), dataProvider, NULL, false);
}
@@ -647,7 +605,7 @@ QString qt_mac_removeAmpersandEscapes(QString s)
returned if it can't be obtained. It is the caller's responsibility to
CGContextRelease the context when finished using it.
- \warning This function is only available on OS X.
+ \warning This function is only available on \macos.
\warning This function is duplicated in qmacstyle_mac.mm
*/
CGContextRef qt_mac_cg_context(QPaintDevice *pdev)
diff --git a/src/plugins/platforms/cocoa/qcocoatheme.mm b/src/plugins/platforms/cocoa/qcocoatheme.mm
index 3a3d634f5a..cb8ffee556 100644
--- a/src/plugins/platforms/cocoa/qcocoatheme.mm
+++ b/src/plugins/platforms/cocoa/qcocoatheme.mm
@@ -287,7 +287,8 @@ public:
const qreal devicePixelRatio = qGuiApp->devicePixelRatio();
const int sizes[] = {
qRound(16 * devicePixelRatio), qRound(32 * devicePixelRatio),
- qRound(64 * devicePixelRatio), qRound(128 * devicePixelRatio)
+ qRound(64 * devicePixelRatio), qRound(128 * devicePixelRatio),
+ qRound(256 * devicePixelRatio)
};
return QAbstractFileIconEngine::toSizeList(sizes, sizes + sizeof(sizes) / sizeof(sizes[0]));
}
diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm
index 500049a504..af324c07ff 100644
--- a/src/plugins/platforms/cocoa/qnsview.mm
+++ b/src/plugins/platforms/cocoa/qnsview.mm
@@ -1999,16 +1999,27 @@ static QPoint mapWindowCoordinates(QWindow *source, QWindow *target, QPoint poin
return target->mapFromGlobal(source->mapToGlobal(point));
}
-- (NSDragOperation) draggingSourceOperationMaskForLocal:(BOOL)isLocal
+- (NSDragOperation)draggingSession:(NSDraggingSession *)session
+ sourceOperationMaskForDraggingContext:(NSDraggingContext)context
{
- Q_UNUSED(isLocal);
+ Q_UNUSED(session);
+ Q_UNUSED(context);
QCocoaDrag* nativeDrag = QCocoaIntegration::instance()->drag();
return qt_mac_mapDropActions(nativeDrag->currentDrag()->supportedActions());
}
-- (BOOL) ignoreModifierKeysWhileDragging
+- (BOOL)ignoreModifierKeysForDraggingSession:(NSDraggingSession *)session
{
- return NO;
+ Q_UNUSED(session);
+ // According to the "Dragging Sources" chapter on Cocoa DnD Programming
+ // (https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/DragandDrop/Concepts/dragsource.html),
+ // if the control, option, or command key is pressed, the source’s
+ // operation mask is filtered to only contain a reduced set of operations.
+ //
+ // Since Qt already takes care of tracking the keyboard modifiers, we
+ // don't need (or want) Cocoa to filter anything. Instead, we'll let
+ // the application do the actual filtering.
+ return YES;
}
- (BOOL)wantsPeriodicDraggingUpdates
@@ -2165,27 +2176,27 @@ static QPoint mapWindowCoordinates(QWindow *source, QWindow *target, QPoint poin
return response.isAccepted();
}
-- (void)draggedImage:(NSImage*) img endedAt:(NSPoint) point operation:(NSDragOperation) operation
+- (void)draggingSession:(NSDraggingSession *)session
+ endedAtPoint:(NSPoint)screenPoint
+ operation:(NSDragOperation)operation
{
- Q_UNUSED(img);
+ Q_UNUSED(session);
Q_UNUSED(operation);
QWindow *target = findEventTargetWindow(m_window);
if (!target)
return;
-// keep our state, and QGuiApplication state (buttons member) in-sync,
-// or future mouse events will be processed incorrectly
+ // keep our state, and QGuiApplication state (buttons member) in-sync,
+ // or future mouse events will be processed incorrectly
NSUInteger pmb = [NSEvent pressedMouseButtons];
for (int buttonNumber = 0; buttonNumber < 32; buttonNumber++) { // see cocoaButton2QtButton() for the 32 value
if (!(pmb & (1 << buttonNumber)))
m_buttons &= ~cocoaButton2QtButton(buttonNumber);
}
- NSPoint windowPoint = [self convertPoint: point fromView: nil];
+ NSPoint windowPoint = [self.window convertRectFromScreen:NSMakeRect(screenPoint.x, screenPoint.y, 1, 1)].origin;
QPoint qtWindowPoint(windowPoint.x, windowPoint.y);
- NSWindow *window = [self window];
- NSPoint screenPoint = [window convertRectToScreen:NSMakeRect(point.x, point.y, 0, 0)].origin;
QPoint qtScreenPoint = QPoint(screenPoint.x, qt_mac_flipYCoordinate(screenPoint.y));
QWindowSystemInterface::handleMouseEvent(target, mapWindowCoordinates(m_window, target, qtWindowPoint), qtScreenPoint, m_buttons);
diff --git a/src/plugins/platforms/directfb/directfb.pro b/src/plugins/platforms/directfb/directfb.pro
index 5c81e0283a..de0344ff5c 100644
--- a/src/plugins/platforms/directfb/directfb.pro
+++ b/src/plugins/platforms/directfb/directfb.pro
@@ -2,8 +2,7 @@ TARGET = qdirectfb
QT += core-private gui-private platformsupport-private
-LIBS += $$QMAKE_LIBS_DIRECTFB
-QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_DIRECTFB
+QMAKE_USE += directfb
SOURCES = main.cpp \
qdirectfbintegration.cpp \
@@ -25,7 +24,7 @@ HEADERS = qdirectfbintegration.h \
qdirectfbeglhooks.h
# ### port the GL context
-contains(QT_CONFIG, directfb_egl) {
+qtConfig(directfb_egl) {
HEADERS += qdirectfb_egl.h
SOURCES += qdirectfb_egl.cpp
DEFINES += DIRECTFB_GL_EGL
diff --git a/src/plugins/platforms/directfb/qdirectfb_egl.cpp b/src/plugins/platforms/directfb/qdirectfb_egl.cpp
index 0e706d789a..2a04c0bba3 100644
--- a/src/plugins/platforms/directfb/qdirectfb_egl.cpp
+++ b/src/plugins/platforms/directfb/qdirectfb_egl.cpp
@@ -49,7 +49,7 @@
#include <QtPlatformSupport/private/qeglplatformcontext_p.h>
#include <QtPlatformSupport/private/qeglconvenience_p.h>
-#include <EGL/egl.h>
+#include <QtPlatformSupport/private/qt_egl_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/platforms/eglfs/api/qeglfscursor.cpp b/src/plugins/platforms/eglfs/api/qeglfscursor.cpp
index 7c1f11372a..0040ecd59d 100644
--- a/src/plugins/platforms/eglfs/api/qeglfscursor.cpp
+++ b/src/plugins/platforms/eglfs/api/qeglfscursor.cpp
@@ -59,12 +59,11 @@
QT_BEGIN_NAMESPACE
QEglFSCursor::QEglFSCursor(QPlatformScreen *screen)
- : m_visible(true),
- m_screen(static_cast<QEglFSScreen *>(screen)),
- m_program(0),
- m_textureEntry(0),
- m_deviceListener(0),
- m_updateRequested(false)
+ : m_visible(true),
+ m_screen(static_cast<QEglFSScreen *>(screen)),
+ m_activeScreen(nullptr),
+ m_deviceListener(0),
+ m_updateRequested(false)
{
QByteArray hideCursorVal = qgetenv("QT_QPA_EGLFS_HIDECURSOR");
if (!hideCursorVal.isEmpty())
@@ -116,15 +115,14 @@ void QEglFSCursorDeviceListener::onDeviceListChanged(QInputDeviceManager::Device
void QEglFSCursor::resetResources()
{
- if (QOpenGLContext::currentContext()) {
- delete m_program;
- glDeleteTextures(1, &m_cursor.customCursorTexture);
- glDeleteTextures(1, &m_cursorAtlas.texture);
+ if (QOpenGLContext *ctx = QOpenGLContext::currentContext()) {
+ GraphicsContextData &gfx(m_gfx[ctx]);
+ delete gfx.program;
+ glDeleteTextures(1, &gfx.customCursorTexture);
+ glDeleteTextures(1, &gfx.atlasTexture);
+ gfx = GraphicsContextData();
}
- m_program = 0;
- m_cursor.customCursorTexture = 0;
m_cursor.customCursorPending = !m_cursor.customCursorImage.isNull();
- m_cursorAtlas.texture = 0;
}
void QEglFSCursor::createShaderPrograms()
@@ -146,15 +144,16 @@ void QEglFSCursor::createShaderPrograms()
" gl_FragColor = texture2D(texture, textureCoord).bgra;\n"
"}\n";
- m_program = new QOpenGLShaderProgram;
- m_program->addShaderFromSourceCode(QOpenGLShader::Vertex, textureVertexProgram);
- m_program->addShaderFromSourceCode(QOpenGLShader::Fragment, textureFragmentProgram);
- m_program->bindAttributeLocation("vertexCoordEntry", 0);
- m_program->bindAttributeLocation("textureCoordEntry", 1);
- m_program->link();
+ GraphicsContextData &gfx(m_gfx[QOpenGLContext::currentContext()]);
+ gfx.program = new QOpenGLShaderProgram;
+ gfx.program->addShaderFromSourceCode(QOpenGLShader::Vertex, textureVertexProgram);
+ gfx.program->addShaderFromSourceCode(QOpenGLShader::Fragment, textureFragmentProgram);
+ gfx.program->bindAttributeLocation("vertexCoordEntry", 0);
+ gfx.program->bindAttributeLocation("textureCoordEntry", 1);
+ gfx.program->link();
- m_textureEntry = m_program->uniformLocation("texture");
- m_matEntry = m_program->uniformLocation("mat");
+ gfx.textureEntry = gfx.program->uniformLocation("texture");
+ gfx.matEntry = gfx.program->uniformLocation("mat");
}
void QEglFSCursor::createCursorTexture(uint *texture, const QImage &image)
@@ -214,7 +213,7 @@ void QEglFSCursor::changeCursor(QCursor *cursor, QWindow *window)
Q_UNUSED(window);
const QRect oldCursorRect = cursorRect();
if (setCurrentCursor(cursor))
- update(oldCursorRect | cursorRect());
+ update(oldCursorRect | cursorRect(), false);
}
bool QEglFSCursor::setCurrentCursor(QCursor *cursor)
@@ -238,16 +237,17 @@ bool QEglFSCursor::setCurrentCursor(QCursor *cursor)
hs * (m_cursor.shape / m_cursorAtlas.cursorsPerRow),
ws, hs);
m_cursor.hotSpot = m_cursorAtlas.hotSpots[m_cursor.shape];
- m_cursor.texture = m_cursorAtlas.texture;
+ m_cursor.useCustomCursor = false;
m_cursor.size = QSize(m_cursorAtlas.cursorWidth, m_cursorAtlas.cursorHeight);
} else {
QImage image = cursor->pixmap().toImage();
m_cursor.textureRect = QRectF(0, 0, 1, 1);
m_cursor.hotSpot = cursor->hotSpot();
- m_cursor.texture = 0; // will get updated in the next render()
+ m_cursor.useCustomCursor = false; // will get updated in the next render()
m_cursor.size = image.size();
m_cursor.customCursorImage = image;
m_cursor.customCursorPending = true;
+ m_cursor.customCursorKey = m_cursor.customCursorImage.cacheKey();
}
return true;
@@ -257,17 +257,20 @@ bool QEglFSCursor::setCurrentCursor(QCursor *cursor)
class CursorUpdateEvent : public QEvent
{
public:
- CursorUpdateEvent(const QPoint &pos, const QRegion &rgn)
+ CursorUpdateEvent(const QPoint &pos, const QRect &rect, bool allScreens)
: QEvent(QEvent::Type(QEvent::User + 1)),
m_pos(pos),
- m_region(rgn)
+ m_rect(rect),
+ m_allScreens(allScreens)
{ }
QPoint pos() const { return m_pos; }
- QRegion region() const { return m_region; }
+ QRegion rect() const { return m_rect; }
+ bool allScreens() const { return m_allScreens; }
private:
QPoint m_pos;
- QRegion m_region;
+ QRect m_rect;
+ bool m_allScreens;
};
bool QEglFSCursor::event(QEvent *e)
@@ -275,21 +278,30 @@ bool QEglFSCursor::event(QEvent *e)
if (e->type() == QEvent::User + 1) {
CursorUpdateEvent *ev = static_cast<CursorUpdateEvent *>(e);
m_updateRequested = false;
- QWindowSystemInterface::handleExposeEvent(m_screen->topLevelAt(ev->pos()), ev->region());
- QWindowSystemInterface::flushWindowSystemEvents(QEventLoop::ExcludeUserInputEvents);
+ if (!ev->allScreens()) {
+ QWindow *w = m_screen->topLevelAt(ev->pos()); // works for the entire virtual desktop, no need to loop
+ if (w) {
+ QWindowSystemInterface::handleExposeEvent(w, ev->rect());
+ QWindowSystemInterface::flushWindowSystemEvents(QEventLoop::ExcludeUserInputEvents);
+ }
+ } else {
+ for (QWindow *w : qGuiApp->topLevelWindows())
+ QWindowSystemInterface::handleExposeEvent(w, w->geometry());
+ QWindowSystemInterface::flushWindowSystemEvents(QEventLoop::ExcludeUserInputEvents);
+ }
return true;
}
return QPlatformCursor::event(e);
}
-void QEglFSCursor::update(const QRegion &rgn)
+void QEglFSCursor::update(const QRect &rect, bool allScreens)
{
if (!m_updateRequested) {
// Must not flush the window system events directly from here since we are likely to
// be a called directly from QGuiApplication's processMouseEvents. Flushing events
// could cause reentering by dispatching more queued mouse events.
m_updateRequested = true;
- QCoreApplication::postEvent(this, new CursorUpdateEvent(m_cursor.pos, rgn));
+ QCoreApplication::postEvent(this, new CursorUpdateEvent(m_cursor.pos, rect, allScreens));
}
}
@@ -308,8 +320,9 @@ void QEglFSCursor::setPos(const QPoint &pos)
QGuiApplicationPrivate::inputDeviceManager()->setCursorPos(pos);
const QRect oldCursorRect = cursorRect();
m_cursor.pos = pos;
- update(oldCursorRect | cursorRect());
- m_screen->handleCursorMove(m_cursor.pos);
+ update(oldCursorRect | cursorRect(), false);
+ for (QPlatformScreen *screen : m_screen->virtualSiblings())
+ static_cast<QEglFSScreen *>(screen)->handleCursorMove(m_cursor.pos);
}
void QEglFSCursor::pointerEvent(const QMouseEvent &event)
@@ -318,8 +331,9 @@ void QEglFSCursor::pointerEvent(const QMouseEvent &event)
return;
const QRect oldCursorRect = cursorRect();
m_cursor.pos = event.screenPos().toPoint();
- update(oldCursorRect | cursorRect());
- m_screen->handleCursorMove(m_cursor.pos);
+ update(oldCursorRect | cursorRect(), false);
+ for (QPlatformScreen *screen : m_screen->virtualSiblings())
+ static_cast<QEglFSScreen *>(screen)->handleCursorMove(m_cursor.pos);
}
void QEglFSCursor::paintOnScreen()
@@ -327,15 +341,35 @@ void QEglFSCursor::paintOnScreen()
if (!m_visible)
return;
- const QRectF cr = cursorRect();
- const QRect screenRect(m_screen->geometry());
- const GLfloat x1 = 2 * (cr.left() / screenRect.width()) - 1;
- const GLfloat x2 = 2 * (cr.right() / screenRect.width()) - 1;
- const GLfloat y1 = 1 - (cr.top() / screenRect.height()) * 2;
- const GLfloat y2 = 1 - (cr.bottom() / screenRect.height()) * 2;
- QRectF r(QPointF(x1, y1), QPointF(x2, y2));
+ QRect cr = cursorRect(); // hotspot included
+
+ // Support virtual desktop too. Backends with multi-screen support (e.g. all
+ // variants of KMS/DRM) will enable this by default. In this case all
+ // screens are siblings of each other. When not enabled, the sibling list
+ // only contains m_screen itself.
+ for (QPlatformScreen *screen : m_screen->virtualSiblings()) {
+ if (screen->geometry().contains(cr.topLeft() + m_cursor.hotSpot)
+ && QOpenGLContext::currentContext()->screen() == screen->screen())
+ {
+ cr.translate(-screen->geometry().topLeft());
+ const QSize screenSize = screen->geometry().size();
+ const GLfloat x1 = 2 * (cr.left() / GLfloat(screenSize.width())) - 1;
+ const GLfloat x2 = 2 * (cr.right() / GLfloat(screenSize.width())) - 1;
+ const GLfloat y1 = 1 - (cr.top() / GLfloat(screenSize.height())) * 2;
+ const GLfloat y2 = 1 - (cr.bottom() / GLfloat(screenSize.height())) * 2;
+ QRectF r(QPointF(x1, y1), QPointF(x2, y2));
+
+ draw(r);
+
+ if (screen != m_activeScreen) {
+ m_activeScreen = screen;
+ // Do not want a leftover cursor on the screen the cursor just left.
+ update(cursorRect(), true);
+ }
- draw(r);
+ break;
+ }
+ }
}
// In order to prevent breaking code doing custom OpenGL rendering while
@@ -437,30 +471,33 @@ void QEglFSCursor::draw(const QRectF &r)
{
StateSaver stateSaver;
- if (!m_program) {
+ GraphicsContextData &gfx(m_gfx[QOpenGLContext::currentContext()]);
+ if (!gfx.program) {
// one time initialization
initializeOpenGLFunctions();
createShaderPrograms();
- if (!m_cursorAtlas.texture) {
- createCursorTexture(&m_cursorAtlas.texture, m_cursorAtlas.image);
+ if (!gfx.atlasTexture) {
+ createCursorTexture(&gfx.atlasTexture, m_cursorAtlas.image);
if (m_cursor.shape != Qt::BitmapCursor)
- m_cursor.texture = m_cursorAtlas.texture;
+ m_cursor.useCustomCursor = false;
}
}
- if (m_cursor.shape == Qt::BitmapCursor && m_cursor.customCursorPending) {
+ if (m_cursor.shape == Qt::BitmapCursor && (m_cursor.customCursorPending || m_cursor.customCursorKey != gfx.customCursorKey)) {
// upload the custom cursor
- createCursorTexture(&m_cursor.customCursorTexture, m_cursor.customCursorImage);
- m_cursor.texture = m_cursor.customCursorTexture;
+ createCursorTexture(&gfx.customCursorTexture, m_cursor.customCursorImage);
+ m_cursor.useCustomCursor = true;
m_cursor.customCursorPending = false;
+ gfx.customCursorKey = m_cursor.customCursorKey;
}
- Q_ASSERT(m_cursor.texture);
+ GLuint cursorTexture = !m_cursor.useCustomCursor ? gfx.atlasTexture : gfx.customCursorTexture;
+ Q_ASSERT(cursorTexture);
- m_program->bind();
+ gfx.program->bind();
const GLfloat x1 = r.left();
const GLfloat x2 = r.right();
@@ -485,20 +522,20 @@ void QEglFSCursor::draw(const QRectF &r)
};
glActiveTexture(GL_TEXTURE0);
- glBindTexture(GL_TEXTURE_2D, m_cursor.texture);
+ glBindTexture(GL_TEXTURE_2D, cursorTexture);
if (stateSaver.vaoHelper->isValid())
stateSaver.vaoHelper->glBindVertexArray(0);
glBindBuffer(GL_ARRAY_BUFFER, 0);
- m_program->enableAttributeArray(0);
- m_program->enableAttributeArray(1);
- m_program->setAttributeArray(0, cursorCoordinates, 2);
- m_program->setAttributeArray(1, textureCoordinates, 2);
+ gfx.program->enableAttributeArray(0);
+ gfx.program->enableAttributeArray(1);
+ gfx.program->setAttributeArray(0, cursorCoordinates, 2);
+ gfx.program->setAttributeArray(1, textureCoordinates, 2);
- m_program->setUniformValue(m_textureEntry, 0);
- m_program->setUniformValue(m_matEntry, m_rotationMatrix);
+ gfx.program->setUniformValue(gfx.textureEntry, 0);
+ gfx.program->setUniformValue(gfx.matEntry, m_rotationMatrix);
glDisable(GL_CULL_FACE);
glFrontFace(GL_CCW);
@@ -508,9 +545,9 @@ void QEglFSCursor::draw(const QRectF &r)
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
- m_program->disableAttributeArray(0);
- m_program->disableAttributeArray(1);
- m_program->release();
+ gfx.program->disableAttributeArray(0);
+ gfx.program->disableAttributeArray(1);
+ gfx.program->release();
}
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/eglfs/api/qeglfscursor_p.h b/src/plugins/platforms/eglfs/api/qeglfscursor_p.h
index f72e4c0374..8ccbe4493c 100644
--- a/src/plugins/platforms/eglfs/api/qeglfscursor_p.h
+++ b/src/plugins/platforms/eglfs/api/qeglfscursor_p.h
@@ -105,30 +105,29 @@ private:
bool setCurrentCursor(QCursor *cursor);
#endif
void draw(const QRectF &rect);
- void update(const QRegion &region);
+ void update(const QRect &rect, bool allScreens);
void createShaderPrograms();
void createCursorTexture(uint *texture, const QImage &image);
void initCursorAtlas();
// current cursor information
struct Cursor {
- Cursor() : texture(0), shape(Qt::BlankCursor), customCursorTexture(0), customCursorPending(false) { }
- uint texture; // a texture from 'image' or the atlas
+ Cursor() : shape(Qt::BlankCursor), customCursorPending(false), customCursorKey(0), useCustomCursor(false) { }
Qt::CursorShape shape;
QRectF textureRect; // normalized rect inside texture
QSize size; // size of the cursor
QPoint hotSpot;
QImage customCursorImage;
QPoint pos; // current cursor position
- uint customCursorTexture;
bool customCursorPending;
+ qint64 customCursorKey;
+ bool useCustomCursor;
} m_cursor;
// cursor atlas information
struct CursorAtlas {
- CursorAtlas() : cursorsPerRow(0), texture(0), cursorWidth(0), cursorHeight(0) { }
+ CursorAtlas() : cursorsPerRow(0), cursorWidth(0), cursorHeight(0) { }
int cursorsPerRow;
- uint texture;
int width, height; // width and height of the atlas
int cursorWidth, cursorHeight; // width and height of cursors inside the atlas
QList<QPoint> hotSpots;
@@ -137,12 +136,22 @@ private:
bool m_visible;
QEglFSScreen *m_screen;
- QOpenGLShaderProgram *m_program;
- int m_textureEntry;
- int m_matEntry;
+ QPlatformScreen *m_activeScreen;
QEglFSCursorDeviceListener *m_deviceListener;
bool m_updateRequested;
QMatrix4x4 m_rotationMatrix;
+
+ struct GraphicsContextData {
+ GraphicsContextData() : program(nullptr), textureEntry(0), matEntry(0),
+ customCursorTexture(0), atlasTexture(0), customCursorKey(0) { }
+ QOpenGLShaderProgram *program;
+ int textureEntry;
+ int matEntry;
+ uint customCursorTexture;
+ uint atlasTexture;
+ qint64 customCursorKey;
+ };
+ QHash<QOpenGLContext *, GraphicsContextData> m_gfx;
};
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/eglfs/api/qeglfsdeviceintegration.cpp b/src/plugins/platforms/eglfs/api/qeglfsdeviceintegration.cpp
index 3848e99221..6f65929913 100644
--- a/src/plugins/platforms/eglfs/api/qeglfsdeviceintegration.cpp
+++ b/src/plugins/platforms/eglfs/api/qeglfsdeviceintegration.cpp
@@ -41,6 +41,7 @@
#include "qeglfsintegration.h"
#include "qeglfscursor_p.h"
#include "qeglfswindow_p.h"
+#include "qeglfsscreen_p.h"
#include "qeglfshooks_p.h"
#include <QtPlatformSupport/private/qeglconvenience_p.h>
@@ -311,7 +312,7 @@ bool QEglFSDeviceIntegration::hasCapability(QPlatformIntegration::Capability cap
QPlatformCursor *QEglFSDeviceIntegration::createCursor(QPlatformScreen *screen) const
{
- return new QEglFSCursor(screen);
+ return new QEglFSCursor(static_cast<QEglFSScreen *>(screen));
}
void QEglFSDeviceIntegration::waitForVSync(QPlatformSurface *surface) const
diff --git a/src/plugins/platforms/eglfs/api/qeglfsglobal.h b/src/plugins/platforms/eglfs/api/qeglfsglobal.h
index 2b5effc2f1..655ab7eaef 100644
--- a/src/plugins/platforms/eglfs/api/qeglfsglobal.h
+++ b/src/plugins/platforms/eglfs/api/qeglfsglobal.h
@@ -42,7 +42,7 @@
#include <QtCore/qglobal.h>
-#include <EGL/egl.h>
+#include <QtPlatformSupport/private/qt_egl_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/platforms/eglfs/api/qeglfsscreen.cpp b/src/plugins/platforms/eglfs/api/qeglfsscreen.cpp
index 47ef2f64e7..b0c32e5176 100644
--- a/src/plugins/platforms/eglfs/api/qeglfsscreen.cpp
+++ b/src/plugins/platforms/eglfs/api/qeglfsscreen.cpp
@@ -65,7 +65,7 @@ QEglFSScreen::~QEglFSScreen()
QRect QEglFSScreen::geometry() const
{
- QRect r = geometryForSurface();
+ QRect r = rawGeometry();
static int rotation = qEnvironmentVariableIntValue("QT_QPA_EGLFS_ROTATION");
switch (rotation) {
@@ -88,7 +88,7 @@ QRect QEglFSScreen::geometry() const
return r;
}
-QRect QEglFSScreen::geometryForSurface() const
+QRect QEglFSScreen::rawGeometry() const
{
return QRect(QPoint(0, 0), qt_egl_device_integration()->screenSize());
}
diff --git a/src/plugins/platforms/eglfs/api/qeglfsscreen_p.h b/src/plugins/platforms/eglfs/api/qeglfsscreen_p.h
index 232525fae3..daba9fc591 100644
--- a/src/plugins/platforms/eglfs/api/qeglfsscreen_p.h
+++ b/src/plugins/platforms/eglfs/api/qeglfsscreen_p.h
@@ -68,7 +68,7 @@ public:
~QEglFSScreen();
QRect geometry() const Q_DECL_OVERRIDE;
- QRect geometryForSurface() const;
+ virtual QRect rawGeometry() const;
int depth() const Q_DECL_OVERRIDE;
QImage::Format format() const Q_DECL_OVERRIDE;
diff --git a/src/plugins/platforms/eglfs/api/qeglfswindow.cpp b/src/plugins/platforms/eglfs/api/qeglfswindow.cpp
index 74723955c6..5ce88e6bd8 100644
--- a/src/plugins/platforms/eglfs/api/qeglfswindow.cpp
+++ b/src/plugins/platforms/eglfs/api/qeglfswindow.cpp
@@ -142,7 +142,7 @@ void QEglFSWindow::create()
context->setScreen(window()->screen());
if (Q_UNLIKELY(!context->create()))
qFatal("EGLFS: Failed to create compositing context");
- compositor->setTarget(context, window(), screen->geometryForSurface());
+ compositor->setTarget(context, window(), screen->rawGeometry());
compositor->setRotation(qEnvironmentVariableIntValue("QT_QPA_EGLFS_ROTATION"));
// If there is a "root" window into which raster and QOpenGLWidget content is
// composited, all other contexts must share with its context.
@@ -190,7 +190,7 @@ void QEglFSWindow::resetSurface()
m_config = QEglFSDeviceIntegration::chooseConfig(display, platformFormat);
m_format = q_glFormatFromConfig(display, m_config, platformFormat);
- const QSize surfaceSize = screen()->geometryForSurface().size();
+ const QSize surfaceSize = screen()->rawGeometry().size();
m_window = qt_egl_device_integration()->createNativeWindow(this, surfaceSize, m_format);
m_surface = eglCreateWindowSurface(display, m_config, m_window, NULL);
}
diff --git a/src/plugins/platforms/eglfs/deviceintegration/deviceintegration.pro b/src/plugins/platforms/eglfs/deviceintegration/deviceintegration.pro
index 769c248d0d..b46b04d149 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/deviceintegration.pro
+++ b/src/plugins/platforms/eglfs/deviceintegration/deviceintegration.pro
@@ -1,12 +1,12 @@
TEMPLATE = subdirs
-contains(QT_CONFIG, egl_x11): SUBDIRS += eglfs_x11
-contains(QT_CONFIG, eglfs_gbm): SUBDIRS += eglfs_kms_support eglfs_kms
-contains(QT_CONFIG, eglfs_egldevice): SUBDIRS += eglfs_kms_support eglfs_kms_egldevice
-contains(QT_CONFIG, eglfs_brcm): SUBDIRS += eglfs_brcm
-contains(QT_CONFIG, eglfs_mali): SUBDIRS += eglfs_mali
-contains(QT_CONFIG, eglfs_viv): SUBDIRS += eglfs_viv
-contains(QT_CONFIG, eglfs_viv_wl): SUBDIRS += eglfs_viv_wl
+qtConfig(egl_x11): SUBDIRS += eglfs_x11
+qtConfig(eglfs_gbm): SUBDIRS += eglfs_kms_support eglfs_kms
+qtConfig(eglfs_egldevice): SUBDIRS += eglfs_kms_support eglfs_kms_egldevice
+qtConfig(eglfs_brcm): SUBDIRS += eglfs_brcm
+qtConfig(eglfs_mali): SUBDIRS += eglfs_mali
+qtConfig(eglfs_viv): SUBDIRS += eglfs_viv
+qtConfig(eglfs_viv_wl): SUBDIRS += eglfs_viv_wl
eglfs_kms_egldevice.depends = eglfs_kms_support
eglfs_kms.depends = eglfs_kms_support
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_brcm/eglfs_brcm.pro b/src/plugins/platforms/eglfs/deviceintegration/eglfs_brcm/eglfs_brcm.pro
index cd97c2c5a3..d65e136a96 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_brcm/eglfs_brcm.pro
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_brcm/eglfs_brcm.pro
@@ -8,8 +8,8 @@ CONFIG += egl
LIBS += -lbcm_host
QMAKE_LFLAGS += $$QMAKE_LFLAGS_NOUNDEF
-# Avoid X11 header collision
-DEFINES += MESA_EGL_NO_X11_HEADERS
+# Avoid X11 header collision, use generic EGL native types
+DEFINES += QT_EGL_NO_X11
SOURCES += $$PWD/qeglfsbrcmmain.cpp \
$$PWD/qeglfsbrcmintegration.cpp
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_brcm/qeglfsbrcmintegration.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_brcm/qeglfsbrcmintegration.cpp
index 363fce2214..4e811a1dfe 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_brcm/qeglfsbrcmintegration.cpp
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_brcm/qeglfsbrcmintegration.cpp
@@ -93,9 +93,23 @@ void QEglFSBrcmIntegration::platformInit()
bcm_host_init();
}
+static int getDisplayId()
+{
+ // As defined in vc_dispmanx_types.h
+ // DISPMANX_ID_MAIN_LCD 0
+ // DISPMANX_ID_AUX_LCD 1
+ // DISPMANX_ID_HDMI 2
+ // DISPMANX_ID_SDTV 3
+ // DISPMANX_ID_FORCE_LCD 4
+ // DISPMANX_ID_FORCE_TV 5
+ // DISPMANX_ID_FORCE_OTHER 6 /* non-default display */
+ static const int dispmanxId = qEnvironmentVariableIntValue("QT_QPA_EGLFS_DISPMANX_ID");
+ return (dispmanxId >= 0 && dispmanxId <= 6) ? dispmanxId : 0;
+}
+
EGLNativeDisplayType QEglFSBrcmIntegration::platformDisplay() const
{
- dispman_display = vc_dispmanx_display_open(0/* LCD */);
+ dispman_display = vc_dispmanx_display_open(getDisplayId());
return EGL_DEFAULT_DISPLAY;
}
@@ -107,7 +121,7 @@ void QEglFSBrcmIntegration::platformDestroy()
QSize QEglFSBrcmIntegration::screenSize() const
{
uint32_t width, height;
- graphics_get_display_size(0 /* LCD */, &width, &height);
+ graphics_get_display_size(getDisplayId(), &width, &height);
return QSize(width, height);
}
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/eglfs_kms.pro b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/eglfs_kms.pro
index b0d631a9d1..70ff054172 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/eglfs_kms.pro
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/eglfs_kms.pro
@@ -8,16 +8,10 @@ QT += core-private gui-private platformsupport-private eglfsdeviceintegration-pr
INCLUDEPATH += $$PWD/../.. $$PWD/../eglfs_kms_support
-# Avoid X11 header collision
-DEFINES += MESA_EGL_NO_X11_HEADERS
-
-CONFIG += link_pkgconfig
-!contains(QT_CONFIG, no-pkg-config) {
- PKGCONFIG += libdrm gbm
-} else {
- LIBS += -ldrm -lgbm
-}
+# Avoid X11 header collision, use generic EGL native types
+DEFINES += QT_EGL_NO_X11
+QMAKE_USE += gbm drm
CONFIG += egl
QMAKE_LFLAGS += $$QMAKE_LFLAGS_NOUNDEF
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmdevice.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmdevice.cpp
index 278752bddf..99f6cfb0ca 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmdevice.cpp
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmdevice.cpp
@@ -142,10 +142,10 @@ void QEglFSKmsGbmDevice::handleDrmEvent()
drmHandleEvent(fd(), &drmEvent);
}
-QEglFSKmsScreen *QEglFSKmsGbmDevice::createScreen(QEglFSKmsIntegration *integration, QEglFSKmsDevice *device, QEglFSKmsOutput output, QPoint position)
+QEglFSKmsScreen *QEglFSKmsGbmDevice::createScreen(QEglFSKmsIntegration *integration, QEglFSKmsDevice *device, QEglFSKmsOutput output)
{
static bool firstScreen = true;
- QEglFSKmsGbmScreen *screen = new QEglFSKmsGbmScreen(integration, device, output, position);
+ QEglFSKmsGbmScreen *screen = new QEglFSKmsGbmScreen(integration, device, output);
if (firstScreen && integration->hwCursor()) {
m_globalCursor = new QEglFSKmsGbmCursor(screen);
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmdevice.h b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmdevice.h
index 6a45f9ffa0..7c0af84422 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmdevice.h
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmdevice.h
@@ -68,8 +68,7 @@ public:
virtual QEglFSKmsScreen *createScreen(QEglFSKmsIntegration *integration,
QEglFSKmsDevice *device,
- QEglFSKmsOutput output,
- QPoint position) Q_DECL_OVERRIDE;
+ QEglFSKmsOutput output) Q_DECL_OVERRIDE;
private:
Q_DISABLE_COPY(QEglFSKmsGbmDevice)
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.cpp
index 7a17b60a5e..dde386fc57 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.cpp
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.cpp
@@ -93,10 +93,9 @@ QEglFSKmsGbmScreen::FrameBuffer *QEglFSKmsGbmScreen::framebufferForBufferObject(
}
QEglFSKmsGbmScreen::QEglFSKmsGbmScreen(QEglFSKmsIntegration *integration,
- QEglFSKmsDevice *device,
- QEglFSKmsOutput output,
- QPoint position)
- : QEglFSKmsScreen(integration, device, output, position)
+ QEglFSKmsDevice *device,
+ QEglFSKmsOutput output)
+ : QEglFSKmsScreen(integration, device, output)
, m_gbm_surface(Q_NULLPTR)
, m_gbm_bo_current(Q_NULLPTR)
, m_gbm_bo_next(Q_NULLPTR)
@@ -130,8 +129,8 @@ gbm_surface *QEglFSKmsGbmScreen::createSurface()
if (!m_gbm_surface) {
qCDebug(qLcEglfsKmsDebug) << "Creating window for screen" << name();
m_gbm_surface = gbm_surface_create(static_cast<QEglFSKmsGbmDevice *>(device())->gbmDevice(),
- geometry().width(),
- geometry().height(),
+ rawGeometry().width(),
+ rawGeometry().height(),
GBM_FORMAT_XRGB8888,
GBM_BO_USE_SCANOUT | GBM_BO_USE_RENDERING);
}
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.h b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.h
index 3381bbfdbb..d7ad348291 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.h
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.h
@@ -55,9 +55,8 @@ class QEglFSKmsGbmScreen : public QEglFSKmsScreen
{
public:
QEglFSKmsGbmScreen(QEglFSKmsIntegration *integration,
- QEglFSKmsDevice *device,
- QEglFSKmsOutput output,
- QPoint position);
+ QEglFSKmsDevice *device,
+ QEglFSKmsOutput output);
~QEglFSKmsGbmScreen();
QPlatformCursor *cursor() const Q_DECL_OVERRIDE;
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/eglfs_kms_egldevice.pro b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/eglfs_kms_egldevice.pro
index 8eabd2d4b7..5f47b98369 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/eglfs_kms_egldevice.pro
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/eglfs_kms_egldevice.pro
@@ -4,15 +4,10 @@ QT += core-private gui-private platformsupport-private eglfsdeviceintegration-pr
INCLUDEPATH += $$PWD/../.. $$PWD/../eglfs_kms_support
-DEFINES += MESA_EGL_NO_X11_HEADERS
-
-CONFIG += link_pkgconfig
-!contains(QT_CONFIG, no-pkg-config) {
- PKGCONFIG += libdrm
-} else {
- LIBS += -ldrm
-}
+# Avoid X11 header collision, use generic EGL native types
+DEFINES += QT_EGL_NO_X11
+QMAKE_USE += drm
CONFIG += egl
QMAKE_LFLAGS += $$QMAKE_LFLAGS_NOUNDEF
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldevice.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldevice.cpp
index 743f714cf0..d30963ff96 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldevice.cpp
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldevice.cpp
@@ -40,11 +40,15 @@
#include "qeglfskmsegldevice.h"
#include "qeglfskmsegldevicescreen.h"
#include "qeglfskmsegldeviceintegration.h"
+#include "private/qeglfscursor_p.h"
#include <QtCore/private/qcore_unix_p.h>
+QT_BEGIN_NAMESPACE
+
QEglFSKmsEglDevice::QEglFSKmsEglDevice(QEglFSKmsIntegration *integration, const QString &path)
- : QEglFSKmsDevice(integration, path)
+ : QEglFSKmsDevice(integration, path),
+ m_globalCursor(nullptr)
{
}
@@ -52,6 +56,8 @@ bool QEglFSKmsEglDevice::open()
{
Q_ASSERT(fd() == -1);
+ qCDebug(qLcEglfsKmsDebug, "Opening DRM device %s", qPrintable(devicePath()));
+
int fd = drmOpen(devicePath().toLocal8Bit().constData(), Q_NULLPTR);
if (Q_UNLIKELY(fd < 0))
qFatal("Could not open DRM device");
@@ -63,6 +69,8 @@ bool QEglFSKmsEglDevice::open()
void QEglFSKmsEglDevice::close()
{
+ qCDebug(qLcEglfsKmsDebug, "Closing DRM device");
+
if (qt_safe_close(fd()) == -1)
qErrnoWarning("Could not close DRM device");
@@ -74,7 +82,26 @@ EGLNativeDisplayType QEglFSKmsEglDevice::nativeDisplay() const
return static_cast<QEglFSKmsEglDeviceIntegration *>(m_integration)->eglDevice();
}
-QEglFSKmsScreen *QEglFSKmsEglDevice::createScreen(QEglFSKmsIntegration *integration, QEglFSKmsDevice *device, QEglFSKmsOutput output, QPoint position)
+QEglFSKmsScreen *QEglFSKmsEglDevice::createScreen(QEglFSKmsIntegration *integration, QEglFSKmsDevice *device,
+ QEglFSKmsOutput output)
{
- return new QEglFSKmsEglDeviceScreen(integration, device, output, position);
+ QEglFSKmsScreen *screen = new QEglFSKmsEglDeviceScreen(integration, device, output);
+
+ if (!m_globalCursor && !integration->separateScreens()) {
+ qCDebug(qLcEglfsKmsDebug, "Creating new global mouse cursor");
+ m_globalCursor = new QEglFSCursor(screen);
+ }
+
+ return screen;
}
+
+void QEglFSKmsEglDevice::destroyGlobalCursor()
+{
+ if (m_globalCursor) {
+ qCDebug(qLcEglfsKmsDebug, "Destroying global mouse cursor");
+ delete m_globalCursor;
+ m_globalCursor = nullptr;
+ }
+}
+
+QT_END_NAMESPACE
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldevice.h b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldevice.h
index b1c98f3fe6..8c8f79f70c 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldevice.h
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldevice.h
@@ -42,6 +42,10 @@
#include <qeglfskmsdevice.h>
+QT_BEGIN_NAMESPACE
+
+class QPlatformCursor;
+
class QEglFSKmsEglDevice: public QEglFSKmsDevice
{
public:
@@ -54,8 +58,15 @@ public:
virtual QEglFSKmsScreen *createScreen(QEglFSKmsIntegration *integration,
QEglFSKmsDevice *device,
- QEglFSKmsOutput output,
- QPoint position) Q_DECL_OVERRIDE;
+ QEglFSKmsOutput output) Q_DECL_OVERRIDE;
+
+ QPlatformCursor *globalCursor() { return m_globalCursor; }
+ void destroyGlobalCursor();
+
+private:
+ QPlatformCursor *m_globalCursor;
};
+QT_END_NAMESPACE
+
#endif // QEGLFSKMSEGLDEVICE_H
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp
index 28967d71ff..ddb2499751 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp
@@ -41,6 +41,7 @@
#include "qeglfskmsegldeviceintegration.h"
#include <QtPlatformSupport/private/qeglconvenience_p.h>
#include "private/qeglfswindow_p.h"
+#include "private/qeglfscursor_p.h"
#include "qeglfskmsegldevice.h"
#include "qeglfskmsscreen.h"
#include <QLoggingCategory>
@@ -193,8 +194,8 @@ void QEglJetsonTK1Window::resetSurface()
m_format = q_glFormatFromConfig(display, m_config);
qCDebug(qLcEglfsKmsDebug) << "Stream producer format is" << m_format;
- const int w = cur_screen->geometry().width();
- const int h = cur_screen->geometry().height();
+ const int w = cur_screen->rawGeometry().width();
+ const int h = cur_screen->rawGeometry().height();
qCDebug(qLcEglfsKmsDebug, "Creating stream producer surface of size %dx%d", w, h);
const EGLint stream_producer_attribs[] = {
@@ -222,11 +223,6 @@ QEglFSWindow *QEglFSKmsEglDeviceIntegration::createWindow(QWindow *window) const
return eglWindow;
}
-bool QEglFSKmsEglDeviceIntegration::separateScreens() const
-{
- return true;
-}
-
QEglFSKmsDevice *QEglFSKmsEglDeviceIntegration::createDevice(const QString &devicePath)
{
Q_UNUSED(devicePath)
@@ -263,4 +259,9 @@ bool QEglFSKmsEglDeviceIntegration::query_egl_device()
return true;
}
+QPlatformCursor *QEglFSKmsEglDeviceIntegration::createCursor(QPlatformScreen *screen) const
+{
+ return separateScreens() ? new QEglFSCursor(screen) : nullptr;
+}
+
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.h b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.h
index f04c42267a..375c388548 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.h
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.h
@@ -61,12 +61,11 @@ public:
bool supportsPBuffers() const Q_DECL_OVERRIDE;
QEglFSWindow *createWindow(QWindow *window) const Q_DECL_OVERRIDE;
- virtual bool separateScreens() const Q_DECL_OVERRIDE;
-
EGLDeviceEXT eglDevice() const { return m_egl_device; }
protected:
QEglFSKmsDevice *createDevice(const QString &devicePath) Q_DECL_OVERRIDE;
+ QPlatformCursor *createCursor(QPlatformScreen *screen) const Q_DECL_OVERRIDE;
private:
bool setup_kms();
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldevicescreen.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldevicescreen.cpp
index da1b577801..55d5941e5f 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldevicescreen.cpp
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldevicescreen.cpp
@@ -39,10 +39,30 @@
#include "qeglfskmsegldevicescreen.h"
#include "qeglfskmsegldevice.h"
+#include <QGuiApplication>
-QEglFSKmsEglDeviceScreen::QEglFSKmsEglDeviceScreen(QEglFSKmsIntegration *integration, QEglFSKmsDevice *device, QEglFSKmsOutput output, QPoint position)
- : QEglFSKmsScreen(integration, device, output, position)
+QT_BEGIN_NAMESPACE
+
+QEglFSKmsEglDeviceScreen::QEglFSKmsEglDeviceScreen(QEglFSKmsIntegration *integration, QEglFSKmsDevice *device, QEglFSKmsOutput output)
+ : QEglFSKmsScreen(integration, device, output)
+{
+}
+
+QEglFSKmsEglDeviceScreen::~QEglFSKmsEglDeviceScreen()
{
+ const int remainingScreenCount = qGuiApp->screens().count();
+ qCDebug(qLcEglfsKmsDebug, "Screen dtor. Remaining screens: %d", remainingScreenCount);
+ if (!remainingScreenCount && !m_integration->separateScreens())
+ static_cast<QEglFSKmsEglDevice *>(device())->destroyGlobalCursor();
+}
+
+QPlatformCursor *QEglFSKmsEglDeviceScreen::cursor() const
+{
+ // The base class creates a cursor via integration->createCursor()
+ // in its ctor. With separateScreens just use that. Otherwise
+ // there's a virtual desktop and the device has a global cursor
+ // and the base class has no dedicated cursor at all.
+ return m_integration->separateScreens() ? QEglFSScreen::cursor() : static_cast<QEglFSKmsEglDevice *>(device())->globalCursor();
}
void QEglFSKmsEglDeviceScreen::waitForFlip()
@@ -76,3 +96,5 @@ void QEglFSKmsEglDeviceScreen::waitForFlip()
}
}
+
+QT_END_NAMESPACE
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldevicescreen.h b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldevicescreen.h
index 0cd46e9f9d..c57f52c6b7 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldevicescreen.h
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldevicescreen.h
@@ -42,15 +42,21 @@
#include <qeglfskmsscreen.h>
+QT_BEGIN_NAMESPACE
+
class QEglFSKmsEglDeviceScreen : public QEglFSKmsScreen
{
public:
QEglFSKmsEglDeviceScreen(QEglFSKmsIntegration *integration,
QEglFSKmsDevice *device,
- QEglFSKmsOutput output,
- QPoint position);
+ QEglFSKmsOutput output);
+ ~QEglFSKmsEglDeviceScreen();
+
+ QPlatformCursor *cursor() const Q_DECL_OVERRIDE;
void waitForFlip() Q_DECL_OVERRIDE;
};
+QT_END_NAMESPACE
+
#endif // QEGLFSKMSEGLDEVICESCREEN_H
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/eglfs_kms_support.pro b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/eglfs_kms_support.pro
index 6dd857a4e4..464c64539f 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/eglfs_kms_support.pro
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/eglfs_kms_support.pro
@@ -6,16 +6,10 @@ QT += core-private gui-private platformsupport-private eglfsdeviceintegration-pr
INCLUDEPATH += $$PWD/../..
-# Avoid X11 header collision
-DEFINES += MESA_EGL_NO_X11_HEADERS
-
-CONFIG += link_pkgconfig
-!contains(QT_CONFIG, no-pkg-config) {
- PKGCONFIG += libdrm
-} else {
- LIBS += -ldrm
-}
+# Avoid X11 header collision, use generic EGL native types
+DEFINES += QT_EGL_NO_X11
+QMAKE_USE += drm
CONFIG += egl
QMAKE_LFLAGS += $$QMAKE_LFLAGS_NOUNDEF
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsdevice.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsdevice.cpp
index f4ffee569d..5944e8d51f 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsdevice.cpp
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsdevice.cpp
@@ -159,7 +159,7 @@ static bool parseModeline(const QByteArray &text, drmModeModeInfoPtr mode)
return true;
}
-QEglFSKmsScreen *QEglFSKmsDevice::screenForConnector(drmModeResPtr resources, drmModeConnectorPtr connector, QPoint pos)
+QEglFSKmsScreen *QEglFSKmsDevice::createScreenForConnector(drmModeResPtr resources, drmModeConnectorPtr connector, int *virtualIndex)
{
const QByteArray connectorName = nameForConnector(connector);
@@ -173,8 +173,11 @@ QEglFSKmsScreen *QEglFSKmsDevice::screenForConnector(drmModeResPtr resources, dr
QSize configurationSize;
drmModeModeInfo configurationModeline;
- const QByteArray mode = m_integration->outputSettings().value(QString::fromUtf8(connectorName))
- .value(QStringLiteral("mode"), QStringLiteral("preferred")).toByteArray().toLower();
+ auto userConfig = m_integration->outputSettings();
+ auto userConnectorConfig = userConfig.value(QString::fromUtf8(connectorName));
+ // default to the preferred mode unless overridden in the config
+ const QByteArray mode = userConnectorConfig.value(QStringLiteral("mode"), QStringLiteral("preferred"))
+ .toByteArray().toLower();
if (mode == "off") {
configuration = OutputConfigOff;
} else if (mode == "preferred") {
@@ -189,6 +192,8 @@ QEglFSKmsScreen *QEglFSKmsDevice::screenForConnector(drmModeResPtr resources, dr
qWarning("Invalid mode \"%s\" for output %s", mode.constData(), connectorName.constData());
configuration = OutputConfigPreferred;
}
+ if (virtualIndex)
+ *virtualIndex = userConnectorConfig.value(QStringLiteral("virtualIndex"), INT_MAX).toInt();
const uint32_t crtc_id = resources->crtcs[crtc];
@@ -287,18 +292,26 @@ QEglFSKmsScreen *QEglFSKmsDevice::screenForConnector(drmModeResPtr resources, dr
qCDebug(qLcEglfsKmsDebug) << "Selected mode" << selected_mode << ":" << width << "x" << height
<< '@' << refresh << "hz for output" << connectorName;
}
+
+ // physical size from connector < config values < env vars
static const int width = qEnvironmentVariableIntValue("QT_QPA_EGLFS_PHYSICAL_WIDTH");
static const int height = qEnvironmentVariableIntValue("QT_QPA_EGLFS_PHYSICAL_HEIGHT");
- QSizeF size(width, height);
- if (size.isEmpty()) {
- size.setWidth(connector->mmWidth);
- size.setHeight(connector->mmHeight);
+ QSizeF physSize(width, height);
+ if (physSize.isEmpty()) {
+ physSize = QSize(userConnectorConfig.value(QStringLiteral("physicalWidth")).toInt(),
+ userConnectorConfig.value(QStringLiteral("physicalHeight")).toInt());
+ if (physSize.isEmpty()) {
+ physSize.setWidth(connector->mmWidth);
+ physSize.setHeight(connector->mmHeight);
+ }
}
+ qCDebug(qLcEglfsKmsDebug) << "Physical size is" << physSize << "mm" << "for output" << connectorName;
+
QEglFSKmsOutput output = {
QString::fromUtf8(connectorName),
connector->connector_id,
crtc_id,
- size,
+ physSize,
selected_mode,
false,
drmModeGetCrtc(m_dri_fd, crtc_id),
@@ -310,7 +323,7 @@ QEglFSKmsScreen *QEglFSKmsDevice::screenForConnector(drmModeResPtr resources, dr
m_crtc_allocator |= (1 << output.crtc_id);
m_connector_allocator |= (1 << output.connector_id);
- return createScreen(m_integration, this, output, pos);
+ return createScreen(m_integration, this, output);
}
drmModePropertyPtr QEglFSKmsDevice::connectorProperty(drmModeConnectorPtr connector, const QByteArray &name)
@@ -342,6 +355,26 @@ QEglFSKmsDevice::~QEglFSKmsDevice()
{
}
+struct OrderedScreen
+{
+ OrderedScreen() : screen(nullptr), index(-1) { }
+ OrderedScreen(QEglFSKmsScreen *screen, int index) : screen(screen), index(index) { }
+ QEglFSKmsScreen *screen;
+ int index;
+};
+
+QDebug operator<<(QDebug dbg, const OrderedScreen &s)
+{
+ QDebugStateSaver saver(dbg);
+ dbg.nospace() << "OrderedScreen(" << s.screen << " : " << s.index << ")";
+ return dbg;
+}
+
+static bool orderedScreenLessThan(const OrderedScreen &a, const OrderedScreen &b)
+{
+ return a.index < b.index;
+}
+
void QEglFSKmsDevice::createScreens()
{
drmModeResPtr resources = drmModeGetResources(m_dri_fd);
@@ -350,32 +383,49 @@ void QEglFSKmsDevice::createScreens()
return;
}
- QEglFSKmsScreen *primaryScreen = Q_NULLPTR;
- QList<QPlatformScreen *> siblings;
- QPoint pos(0, 0);
- QEglFSIntegration *integration = static_cast<QEglFSIntegration *>(QGuiApplicationPrivate::platformIntegration());
+ QVector<OrderedScreen> screens;
for (int i = 0; i < resources->count_connectors; i++) {
drmModeConnectorPtr connector = drmModeGetConnector(m_dri_fd, resources->connectors[i]);
if (!connector)
continue;
- QEglFSKmsScreen *screen = screenForConnector(resources, connector, pos);
- if (screen) {
- integration->addScreen(screen);
- pos.rx() += screen->geometry().width();
- siblings << screen;
-
- if (!primaryScreen)
- primaryScreen = screen;
- }
+ int virtualIndex;
+ QEglFSKmsScreen *screen = createScreenForConnector(resources, connector, &virtualIndex);
+ if (screen)
+ screens.append(OrderedScreen(screen, virtualIndex));
drmModeFreeConnector(connector);
}
drmModeFreeResources(resources);
+ // Use stable sort to preserve the original order for outputs with unspecified indices.
+ std::stable_sort(screens.begin(), screens.end(), orderedScreenLessThan);
+ qCDebug(qLcEglfsKmsDebug) << "Sorted screen list:" << screens;
+
+ QPoint pos(0, 0);
+ QList<QPlatformScreen *> siblings;
+ QEglFSIntegration *qpaIntegration = static_cast<QEglFSIntegration *>(QGuiApplicationPrivate::platformIntegration());
+
+ for (const OrderedScreen &orderedScreen : screens) {
+ QEglFSKmsScreen *s = orderedScreen.screen;
+ // set up a horizontal or vertical virtual desktop
+ s->setVirtualPosition(pos);
+ if (m_integration->virtualDesktopLayout() == QEglFSKmsIntegration::VirtualDesktopLayoutVertical)
+ pos.ry() += s->geometry().height();
+ else
+ pos.rx() += s->geometry().width();
+ qCDebug(qLcEglfsKmsDebug) << "Adding screen" << s << "to QPA with geometry" << s->geometry();
+ // The order in qguiapp's screens list will match the order set by
+ // virtualIndex. This is not only handy but also required since for instance
+ // evdevtouch relies on it when performing touch device - screen mapping.
+ qpaIntegration->addScreen(s);
+ siblings << s;
+ }
+
if (!m_integration->separateScreens()) {
+ // enable the virtual desktop
Q_FOREACH (QPlatformScreen *screen, siblings)
static_cast<QEglFSKmsScreen *>(screen)->setVirtualSiblings(siblings);
}
@@ -391,9 +441,9 @@ QString QEglFSKmsDevice::devicePath() const
return m_path;
}
-QEglFSKmsScreen *QEglFSKmsDevice::createScreen(QEglFSKmsIntegration *integration, QEglFSKmsDevice *device, QEglFSKmsOutput output, QPoint position)
+QEglFSKmsScreen *QEglFSKmsDevice::createScreen(QEglFSKmsIntegration *integration, QEglFSKmsDevice *device, QEglFSKmsOutput output)
{
- return new QEglFSKmsScreen(integration, device, output, position);
+ return new QEglFSKmsScreen(integration, device, output);
}
void QEglFSKmsDevice::setFd(int fd)
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsdevice.h b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsdevice.h
index 041c063695..4aad2e0143 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsdevice.h
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsdevice.h
@@ -68,8 +68,7 @@ public:
protected:
virtual QEglFSKmsScreen *createScreen(QEglFSKmsIntegration *integration,
QEglFSKmsDevice *device,
- QEglFSKmsOutput output,
- QPoint position);
+ QEglFSKmsOutput output);
void setFd(int fd);
QEglFSKmsIntegration *m_integration;
@@ -80,7 +79,7 @@ protected:
quint32 m_connector_allocator;
int crtcForConnector(drmModeResPtr resources, drmModeConnectorPtr connector);
- QEglFSKmsScreen *screenForConnector(drmModeResPtr resources, drmModeConnectorPtr connector, QPoint pos);
+ QEglFSKmsScreen *createScreenForConnector(drmModeResPtr resources, drmModeConnectorPtr connector, int *virtualIndex);
drmModePropertyPtr connectorProperty(drmModeConnectorPtr connector, const QByteArray &name);
static void pageFlipHandler(int fd,
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsintegration.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsintegration.cpp
index 7389050efc..6c30e8f930 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsintegration.cpp
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsintegration.cpp
@@ -65,6 +65,7 @@ QEglFSKmsIntegration::QEglFSKmsIntegration()
, m_hwCursor(false)
, m_pbuffers(false)
, m_separateScreens(false)
+ , m_virtualDesktopLayout(VirtualDesktopLayoutHorizontal)
{}
void QEglFSKmsIntegration::platformInit()
@@ -149,6 +150,11 @@ bool QEglFSKmsIntegration::separateScreens() const
return m_separateScreens;
}
+QEglFSKmsIntegration::VirtualDesktopLayout QEglFSKmsIntegration::virtualDesktopLayout() const
+{
+ return m_virtualDesktopLayout;
+}
+
QMap<QString, QVariantMap> QEglFSKmsIntegration::outputSettings() const
{
return m_outputSettings;
@@ -169,15 +175,15 @@ void QEglFSKmsIntegration::loadConfig()
QFile file(QString::fromUtf8(json));
if (!file.open(QFile::ReadOnly)) {
- qCDebug(qLcEglfsKmsDebug) << "Could not open config file"
- << json << "for reading";
+ qCWarning(qLcEglfsKmsDebug) << "Could not open config file"
+ << json << "for reading";
return;
}
const QJsonDocument doc = QJsonDocument::fromJson(file.readAll());
if (!doc.isObject()) {
- qCDebug(qLcEglfsKmsDebug) << "Invalid config file" << json
- << "- no top-level JSON object";
+ qCWarning(qLcEglfsKmsDebug) << "Invalid config file" << json
+ << "- no top-level JSON object";
return;
}
@@ -188,6 +194,16 @@ void QEglFSKmsIntegration::loadConfig()
m_devicePath = object.value(QLatin1String("device")).toString();
m_separateScreens = object.value(QLatin1String("separateScreens")).toBool(m_separateScreens);
+ const QString vdOriString = object.value(QLatin1String("virtualDesktopLayout")).toString();
+ if (!vdOriString.isEmpty()) {
+ if (vdOriString == QLatin1String("horizontal"))
+ m_virtualDesktopLayout = VirtualDesktopLayoutHorizontal;
+ else if (vdOriString == QLatin1String("vertical"))
+ m_virtualDesktopLayout = VirtualDesktopLayoutVertical;
+ else
+ qCWarning(qLcEglfsKmsDebug) << "Unknown virtualDesktopOrientation value" << vdOriString;
+ }
+
const QJsonArray outputs = object.value(QLatin1String("outputs")).toArray();
for (int i = 0; i < outputs.size(); i++) {
const QVariantMap outputSettings = outputs.at(i).toObject().toVariantMap();
@@ -207,6 +223,7 @@ void QEglFSKmsIntegration::loadConfig()
<< "\thwcursor:" << m_hwCursor << "\n"
<< "\tpbuffers:" << m_pbuffers << "\n"
<< "\tseparateScreens:" << m_separateScreens << "\n"
+ << "\tvirtualDesktopLayout:" << m_virtualDesktopLayout << "\n"
<< "\toutputs:" << m_outputSettings;
}
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsintegration.h b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsintegration.h
index 81386881ff..ba49945715 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsintegration.h
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsintegration.h
@@ -56,6 +56,11 @@ Q_EGLFS_EXPORT Q_DECLARE_LOGGING_CATEGORY(qLcEglfsKmsDebug)
class Q_EGLFS_EXPORT QEglFSKmsIntegration : public QEglFSDeviceIntegration
{
public:
+ enum VirtualDesktopLayout {
+ VirtualDesktopLayoutHorizontal,
+ VirtualDesktopLayoutVertical
+ };
+
QEglFSKmsIntegration();
void platformInit() Q_DECL_OVERRIDE;
@@ -70,6 +75,7 @@ public:
virtual bool hwCursor() const;
virtual bool separateScreens() const;
+ virtual VirtualDesktopLayout virtualDesktopLayout() const;
QMap<QString, QVariantMap> outputSettings() const;
QEglFSKmsDevice *device() const;
@@ -83,6 +89,7 @@ protected:
bool m_hwCursor;
bool m_pbuffers;
bool m_separateScreens;
+ VirtualDesktopLayout m_virtualDesktopLayout;
QString m_devicePath;
QMap<QString, QVariantMap> m_outputSettings;
};
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsscreen.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsscreen.cpp
index e6b256f6b2..f690cd668e 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsscreen.cpp
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsscreen.cpp
@@ -71,17 +71,15 @@ private:
QEglFSKmsScreen::QEglFSKmsScreen(QEglFSKmsIntegration *integration,
QEglFSKmsDevice *device,
- QEglFSKmsOutput output,
- QPoint position)
+ QEglFSKmsOutput output)
: QEglFSScreen(eglGetDisplay(device->nativeDisplay()))
, m_integration(integration)
, m_device(device)
, m_output(output)
- , m_pos(position)
, m_powerState(PowerStateOn)
, m_interruptHandler(new QEglFSKmsInterruptHandler(this))
{
- m_siblings << this;
+ m_siblings << this; // gets overridden by QEglFSKmsDevice later if !separateScreens
}
QEglFSKmsScreen::~QEglFSKmsScreen()
@@ -98,7 +96,14 @@ QEglFSKmsScreen::~QEglFSKmsScreen()
delete m_interruptHandler;
}
-QRect QEglFSKmsScreen::geometry() const
+void QEglFSKmsScreen::setVirtualPosition(const QPoint &pos)
+{
+ m_pos = pos;
+}
+
+// Reimplement rawGeometry(), not geometry(). The base class implementation of
+// geometry() calls rawGeometry() and may apply additional transforms.
+QRect QEglFSKmsScreen::rawGeometry() const
{
const int mode = m_output.mode;
return QRect(m_pos.x(), m_pos.y(),
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsscreen.h b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsscreen.h
index 9679f70260..2b6a0ffe6c 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsscreen.h
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsscreen.h
@@ -74,11 +74,13 @@ class Q_EGLFS_EXPORT QEglFSKmsScreen : public QEglFSScreen
public:
QEglFSKmsScreen(QEglFSKmsIntegration *integration,
QEglFSKmsDevice *device,
- QEglFSKmsOutput output,
- QPoint position);
+ QEglFSKmsOutput output);
~QEglFSKmsScreen();
- QRect geometry() const Q_DECL_OVERRIDE;
+ void setVirtualPosition(const QPoint &pos);
+
+ QRect rawGeometry() const Q_DECL_OVERRIDE;
+
int depth() const Q_DECL_OVERRIDE;
QImage::Format format() const Q_DECL_OVERRIDE;
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_mali/eglfs_mali.pro b/src/plugins/platforms/eglfs/deviceintegration/eglfs_mali/eglfs_mali.pro
index 1e58b5fdcd..6e32ca26d0 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_mali/eglfs_mali.pro
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_mali/eglfs_mali.pro
@@ -2,8 +2,8 @@ TARGET = qeglfs-mali-integration
QT += core-private gui-private platformsupport-private eglfsdeviceintegration-private
-# Avoid X11 header collision
-DEFINES += MESA_EGL_NO_X11_HEADERS
+# Avoid X11 header collision, use generic EGL native types
+DEFINES += QT_EGL_NO_X11
INCLUDEPATH += $$PWD/../..
CONFIG += egl
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_viv/eglfs_viv.pro b/src/plugins/platforms/eglfs/deviceintegration/eglfs_viv/eglfs_viv.pro
index a53aac2041..16880535e3 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_viv/eglfs_viv.pro
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_viv/eglfs_viv.pro
@@ -5,7 +5,6 @@ QT += core-private gui-private platformsupport-private eglfsdeviceintegration-pr
INCLUDEPATH += $$PWD/../..
CONFIG += egl
DEFINES += LINUX=1 EGL_API_FB=1
-LIBS += -lGAL
QMAKE_LFLAGS += $$QMAKE_LFLAGS_NOUNDEF
SOURCES += $$PWD/qeglfsvivmain.cpp \
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_viv_wl/eglfs_viv_wl.pro b/src/plugins/platforms/eglfs/deviceintegration/eglfs_viv_wl/eglfs_viv_wl.pro
index 38259f4a5d..374c5bba6b 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_viv_wl/eglfs_viv_wl.pro
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_viv_wl/eglfs_viv_wl.pro
@@ -5,7 +5,6 @@ QT += core-private gui-private platformsupport-private eglfsdeviceintegration-pr
INCLUDEPATH += $$PWD/../..
CONFIG += egl
DEFINES += LINUX=1 EGL_API_FB=1
-LIBS += -lGAL
QMAKE_LFLAGS += $$QMAKE_LFLAGS_NOUNDEF
SOURCES += $$PWD/qeglfsvivwlmain.cpp \
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_x11/eglfs_x11.pro b/src/plugins/platforms/eglfs/deviceintegration/eglfs_x11/eglfs_x11.pro
index 21af6eb736..10af57e487 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_x11/eglfs_x11.pro
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_x11/eglfs_x11.pro
@@ -2,13 +2,13 @@ TARGET = qeglfs-x11-integration
QT += core-private gui-private platformsupport-private eglfsdeviceintegration-private
-# Avoid X11 header collision
-DEFINES += MESA_EGL_NO_X11_HEADERS
+# Avoid X11 header collision, use generic EGL native types
+DEFINES += QT_EGL_NO_X11
INCLUDEPATH += $$PWD/../..
CONFIG += egl
-LIBS += -lX11 -lX11-xcb -lxcb
+QMAKE_USE += xcb_xlib
QMAKE_LFLAGS += $$QMAKE_LFLAGS_NOUNDEF
SOURCES += $$PWD/qeglfsx11main.cpp \
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_x11/qeglfsx11integration.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_x11/qeglfsx11integration.cpp
index 74a687b382..f9924fe5ce 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_x11/qeglfsx11integration.cpp
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_x11/qeglfsx11integration.cpp
@@ -281,12 +281,12 @@ EGLNativeWindowType QEglFSX11Integration::createNativeWindow(QPlatformWindow *pl
xcb_flush(m_connection);
- return m_window;
+ return qt_egl_cast<EGLNativeWindowType>(m_window);
}
void QEglFSX11Integration::destroyNativeWindow(EGLNativeWindowType window)
{
- xcb_destroy_window(m_connection, window);
+ xcb_destroy_window(m_connection, qt_egl_cast<xcb_window_t>(window));
}
bool QEglFSX11Integration::hasCapability(QPlatformIntegration::Capability cap) const
diff --git a/src/plugins/platforms/eglfs/eglfsdeviceintegration.pro b/src/plugins/platforms/eglfs/eglfsdeviceintegration.pro
index 05f4196728..eb0ce73118 100644
--- a/src/plugins/platforms/eglfs/eglfsdeviceintegration.pro
+++ b/src/plugins/platforms/eglfs/eglfsdeviceintegration.pro
@@ -10,8 +10,8 @@ MODULE = eglfsdeviceintegration
QT += core-private gui-private platformsupport-private
LIBS += $$QMAKE_LIBS_DYNLOAD
-# Avoid X11 header collision
-DEFINES += MESA_EGL_NO_X11_HEADERS
+# Avoid X11 header collision, use generic EGL native types
+DEFINES += QT_EGL_NO_X11
DEFINES += QT_BUILD_EGL_DEVICE_LIB
diff --git a/src/plugins/platforms/eglfs/qeglfsintegration.cpp b/src/plugins/platforms/eglfs/qeglfsintegration.cpp
index 8c8ef99bc2..418ff6119b 100644
--- a/src/plugins/platforms/eglfs/qeglfsintegration.cpp
+++ b/src/plugins/platforms/eglfs/qeglfsintegration.cpp
@@ -70,17 +70,17 @@
#include <QtPlatformHeaders/QEGLNativeContext>
-#ifndef QT_NO_LIBINPUT
+#if QT_CONFIG(libinput)
#include <QtPlatformSupport/private/qlibinputhandler_p.h>
#endif
-#if !defined(QT_NO_EVDEV) && !defined(Q_OS_ANDROID)
+#if QT_CONFIG(evdev)
#include <QtPlatformSupport/private/qevdevmousemanager_p.h>
#include <QtPlatformSupport/private/qevdevkeyboardmanager_p.h>
#include <QtPlatformSupport/private/qevdevtouchmanager_p.h>
#endif
-#if !defined(QT_NO_TSLIB) && !defined(Q_OS_ANDROID)
+#if QT_CONFIG(tslib)
#include <QtPlatformSupport/private/qtslib_p.h>
#endif
@@ -386,7 +386,7 @@ QPlatformNativeInterface::NativeResourceForContextFunction QEglFSIntegration::na
QFunctionPointer QEglFSIntegration::platformFunction(const QByteArray &function) const
{
-#if !defined(QT_NO_EVDEV) && !defined(Q_OS_ANDROID)
+#if QT_CONFIG(evdev)
if (function == QEglFSFunctions::loadKeymapTypeIdentifier())
return QFunctionPointer(loadKeymapStatic);
#else
@@ -398,7 +398,7 @@ QFunctionPointer QEglFSIntegration::platformFunction(const QByteArray &function)
void QEglFSIntegration::loadKeymapStatic(const QString &filename)
{
-#if !defined(QT_NO_EVDEV) && !defined(Q_OS_ANDROID)
+#if QT_CONFIG(evdev)
QEglFSIntegration *self = static_cast<QEglFSIntegration *>(QGuiApplicationPrivate::platformIntegration());
if (self->m_kbdMgr)
self->m_kbdMgr->loadKeymap(filename);
@@ -411,22 +411,22 @@ void QEglFSIntegration::loadKeymapStatic(const QString &filename)
void QEglFSIntegration::createInputHandlers()
{
-#ifndef QT_NO_LIBINPUT
+#if QT_CONFIG(libinput)
if (!qEnvironmentVariableIntValue("QT_QPA_EGLFS_NO_LIBINPUT")) {
new QLibInputHandler(QLatin1String("libinput"), QString());
return;
}
#endif
-#if !defined(QT_NO_EVDEV) && !defined(Q_OS_ANDROID)
+#if QT_CONFIG(evdev)
m_kbdMgr = new QEvdevKeyboardManager(QLatin1String("EvdevKeyboard"), QString() /* spec */, this);
new QEvdevMouseManager(QLatin1String("EvdevMouse"), QString() /* spec */, this);
-#ifndef QT_NO_TSLIB
+#if QT_CONFIG(tslib)
const bool useTslib = qEnvironmentVariableIntValue("QT_QPA_EGLFS_TSLIB");
if (useTslib)
new QTsLibMouseHandler(QLatin1String("TsLib"), QString() /* spec */);
else
-#endif // QT_NO_TSLIB
+#endif
new QEvdevTouchManager(QLatin1String("EvdevTouch"), QString() /* spec */, this);
#endif
}
diff --git a/src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp b/src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp
index 685f231756..707301487d 100644
--- a/src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp
+++ b/src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp
@@ -52,17 +52,17 @@
#include <QtGui/private/qguiapplication_p.h>
#include <qpa/qplatforminputcontextfactory_p.h>
-#ifndef QT_NO_LIBINPUT
+#if QT_CONFIG(libinput)
#include <QtPlatformSupport/private/qlibinputhandler_p.h>
#endif
-#if !defined(QT_NO_EVDEV) && !defined(Q_OS_ANDROID)
+#if QT_CONFIG(evdev) && !defined(Q_OS_ANDROID)
#include <QtPlatformSupport/private/qevdevmousemanager_p.h>
#include <QtPlatformSupport/private/qevdevkeyboardmanager_p.h>
#include <QtPlatformSupport/private/qevdevtouchmanager_p.h>
#endif
-#if !defined(QT_NO_TSLIB) && !defined(Q_OS_ANDROID)
+#if QT_CONFIG(tslib) && !defined(Q_OS_ANDROID)
#include <QtPlatformSupport/private/qtslib_p.h>
#endif
@@ -140,22 +140,22 @@ QPlatformServices *QLinuxFbIntegration::services() const
void QLinuxFbIntegration::createInputHandlers()
{
-#ifndef QT_NO_LIBINPUT
+#if QT_CONFIG(libinput)
if (!qEnvironmentVariableIntValue("QT_QPA_FB_NO_LIBINPUT")) {
new QLibInputHandler(QLatin1String("libinput"), QString());
return;
}
#endif
-#if !defined(QT_NO_EVDEV) && !defined(Q_OS_ANDROID)
+#if QT_CONFIG(evdev) && !defined(Q_OS_ANDROID)
new QEvdevKeyboardManager(QLatin1String("EvdevKeyboard"), QString(), this);
new QEvdevMouseManager(QLatin1String("EvdevMouse"), QString(), this);
-#ifndef QT_NO_TSLIB
+#if QT_CONFIG(tslib)
const bool useTslib = qEnvironmentVariableIntValue("QT_QPA_FB_TSLIB");
if (useTslib)
new QTsLibMouseHandler(QLatin1String("TsLib"), QString());
else
-#endif // QT_NO_TSLIB
+#endif
new QEvdevTouchManager(QLatin1String("EvdevTouch"), QString() /* spec */, this);
#endif
}
diff --git a/src/plugins/platforms/minimal/minimal.pro b/src/plugins/platforms/minimal/minimal.pro
index 3aca27b555..0d31d6605b 100644
--- a/src/plugins/platforms/minimal/minimal.pro
+++ b/src/plugins/platforms/minimal/minimal.pro
@@ -11,7 +11,6 @@ HEADERS = qminimalintegration.h \
OTHER_FILES += minimal.json
CONFIG += qpa/genericunixfontdatabase
-win32|darwin: DEFINES += QT_NO_FONTCONFIG
PLUGIN_TYPE = platforms
PLUGIN_CLASS_NAME = QMinimalIntegrationPlugin
diff --git a/src/plugins/platforms/minimal/qminimalintegration.cpp b/src/plugins/platforms/minimal/qminimalintegration.cpp
index 7224f4114c..984d4456a0 100644
--- a/src/plugins/platforms/minimal/qminimalintegration.cpp
+++ b/src/plugins/platforms/minimal/qminimalintegration.cpp
@@ -46,10 +46,10 @@
#if defined(Q_OS_WIN)
#include <QtPlatformSupport/private/qbasicfontdatabase_p.h>
-#elif defined(QT_NO_FONTCONFIG)
-#include <qpa/qplatformfontdatabase.h>
-#else
+#elif QT_CONFIG(fontconfig)
#include <QtPlatformSupport/private/qgenericunixfontdatabase_p.h>
+#else
+#include <qpa/qplatformfontdatabase.h>
#endif
#if !defined(Q_OS_WIN)
@@ -118,7 +118,7 @@ public:
QPlatformFontDatabase *QMinimalIntegration::fontDatabase() const
{
if (m_options & EnableFonts) {
-#ifndef QT_NO_FONTCONFIG
+#if QT_CONFIG(fontconfig)
if (!m_fontDatabase)
m_fontDatabase = new QGenericUnixFontDatabase;
#else
diff --git a/src/plugins/platforms/minimalegl/minimalegl.pro b/src/plugins/platforms/minimalegl/minimalegl.pro
index ac67249591..b8a91729fd 100644
--- a/src/plugins/platforms/minimalegl/minimalegl.pro
+++ b/src/plugins/platforms/minimalegl/minimalegl.pro
@@ -6,8 +6,8 @@ QT += core-private gui-private platformsupport-private
#DEFINES += Q_OPENKODE
-#Avoid X11 header collision
-DEFINES += MESA_EGL_NO_X11_HEADERS
+# Avoid X11 header collision, use generic EGL native types
+DEFINES += QT_EGL_NO_X11
SOURCES = main.cpp \
qminimaleglintegration.cpp \
diff --git a/src/plugins/platforms/minimalegl/qminimaleglintegration.cpp b/src/plugins/platforms/minimalegl/qminimaleglintegration.cpp
index cf31eec75f..b1d3691a10 100644
--- a/src/plugins/platforms/minimalegl/qminimaleglintegration.cpp
+++ b/src/plugins/platforms/minimalegl/qminimaleglintegration.cpp
@@ -58,7 +58,7 @@
#include <QtGui/QOpenGLContext>
#include <QtGui/QScreen>
-#include <EGL/egl.h>
+#include <QtPlatformSupport/private/qt_egl_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/platforms/minimalegl/qminimaleglscreen.h b/src/plugins/platforms/minimalegl/qminimaleglscreen.h
index 825d5e8541..4b53bbd39a 100644
--- a/src/plugins/platforms/minimalegl/qminimaleglscreen.h
+++ b/src/plugins/platforms/minimalegl/qminimaleglscreen.h
@@ -44,7 +44,7 @@
#include <QtCore/QTextStream>
-#include <EGL/egl.h>
+#include <QtPlatformSupport/private/qt_egl_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/platforms/offscreen/offscreen.pro b/src/plugins/platforms/offscreen/offscreen.pro
index 999550a7e1..cc65449b04 100644
--- a/src/plugins/platforms/offscreen/offscreen.pro
+++ b/src/plugins/platforms/offscreen/offscreen.pro
@@ -13,7 +13,7 @@ HEADERS = qoffscreenintegration.h \
OTHER_FILES += offscreen.json
-contains(QT_CONFIG, xlib):contains(QT_CONFIG, opengl):!contains(QT_CONFIG, opengles2) {
+qtConfig(xlib):qtConfig(opengl):!qtConfig(opengles2) {
SOURCES += qoffscreenintegration_x11.cpp
HEADERS += qoffscreenintegration_x11.h
system(echo "Using X11 offscreen integration with GLX")
diff --git a/src/plugins/platforms/openwfd/openwf.pro b/src/plugins/platforms/openwfd/openwf.pro
index 152e4f57d7..79f349f472 100644
--- a/src/plugins/platforms/openwfd/openwf.pro
+++ b/src/plugins/platforms/openwfd/openwf.pro
@@ -31,7 +31,8 @@ SOURCES += \
qopenwfdportmode.cpp \
qopenwfdwindow.cpp
-LIBS += -lWFD -lgbm -lGLESv2 -lEGL
+LIBS += -lWFD
+QMAKE_USE += gbm opengl_es2 egl
PLUGIN_TYPE = platforms
PLUGIN_CLASS_NAME = QOpenWFDIntegrationPlugin
diff --git a/src/plugins/platforms/platforms.pro b/src/plugins/platforms/platforms.pro
index 4bed5312ec..fcfebf6e94 100644
--- a/src/plugins/platforms/platforms.pro
+++ b/src/plugins/platforms/platforms.pro
@@ -4,19 +4,19 @@ android: SUBDIRS += android
!android: SUBDIRS += minimal
-!android:if(!win32|contains(QT_CONFIG, freetype)): SUBDIRS += offscreen
+!android:if(!win32|qtConfig(freetype)): SUBDIRS += offscreen
-contains(QT_CONFIG, xcb) {
+qtConfig(xcb) {
SUBDIRS += xcb
}
-uikit: SUBDIRS += ios
+uikit:!watchos: SUBDIRS += ios
osx: SUBDIRS += cocoa
win32:!winrt: SUBDIRS += windows
winrt: SUBDIRS += winrt
-contains(QT_CONFIG, direct2d) {
+qtConfig(direct2d) {
SUBDIRS += direct2d
}
@@ -24,16 +24,16 @@ qnx {
SUBDIRS += qnx
}
-contains(QT_CONFIG, eglfs) {
+qtConfig(eglfs) {
SUBDIRS += eglfs
SUBDIRS += minimalegl
}
-contains(QT_CONFIG, directfb) {
+qtConfig(directfb) {
SUBDIRS += directfb
}
-contains(QT_CONFIG, linuxfb): SUBDIRS += linuxfb
+qtConfig(linuxfb): SUBDIRS += linuxfb
unix:!android:!darwin: SUBDIRS += vnc
@@ -45,6 +45,6 @@ haiku {
SUBDIRS += haiku
}
-contains(QT_CONFIG, mirclient): SUBDIRS += mirclient
+qtConfig(mirclient): SUBDIRS += mirclient
-contains(QT_CONFIG, integrityfb): SUBDIRS += integrity
+qtConfig(integrityfb): SUBDIRS += integrity
diff --git a/src/plugins/platforms/qnx/qnx.pro b/src/plugins/platforms/qnx/qnx.pro
index 5a0f4f5c98..e47731476f 100644
--- a/src/plugins/platforms/qnx/qnx.pro
+++ b/src/plugins/platforms/qnx/qnx.pro
@@ -75,14 +75,14 @@ CONFIG(qqnx_screeneventthread) {
LIBS += -lscreen
-contains(QT_CONFIG, opengles2) {
+qtConfig(opengles2) {
SOURCES += qqnxglcontext.cpp \
qqnxeglwindow.cpp
HEADERS += qqnxglcontext.h \
qqnxeglwindow.h
- LIBS += -lEGL
+ QMAKE_USE += egl
}
CONFIG(qqnx_pps) {
@@ -100,7 +100,7 @@ CONFIG(qqnx_pps) {
qqnxnavigatoreventnotifier.h \
qqnxvirtualkeyboardpps.h
- LIBS += -lpps
+ QMAKE_USE += pps
!contains(DEFINES, QT_NO_CLIPBOARD): LIBS += -lclipboard
CONFIG(qqnx_imf) {
@@ -116,7 +116,7 @@ CONFIG(qqnx_pps) {
lgmon {
DEFINES += QQNX_LGMON
SOURCES += qqnxlgmon.cpp
- LIBS += -llgmon
+ QMAKE_USE += lgmon
}
OTHER_FILES += qnx.json
diff --git a/src/plugins/platforms/qnx/qqnxscreen.cpp b/src/plugins/platforms/qnx/qqnxscreen.cpp
index 678e83cd57..f8ae5121d1 100644
--- a/src/plugins/platforms/qnx/qqnxscreen.cpp
+++ b/src/plugins/platforms/qnx/qqnxscreen.cpp
@@ -385,10 +385,8 @@ Qt::ScreenOrientation QQnxScreen::orientation() const
QWindow *QQnxScreen::topLevelAt(const QPoint &point) const
{
- QListIterator<QQnxWindow*> it(m_childWindows);
- it.toBack();
- while (it.hasPrevious()) {
- QWindow *win = it.previous()->window();
+ for (auto it = m_childWindows.rbegin(), end = m_childWindows.rend(); it != end; ++it) {
+ QWindow *win = (*it)->window();
if (win->geometry().contains(point))
return win;
}
diff --git a/src/plugins/platforms/vnc/qvncintegration.cpp b/src/plugins/platforms/vnc/qvncintegration.cpp
index 810c5d2a90..3227478ebe 100644
--- a/src/plugins/platforms/vnc/qvncintegration.cpp
+++ b/src/plugins/platforms/vnc/qvncintegration.cpp
@@ -49,7 +49,7 @@
#include <QtGui/private/qguiapplication_p.h>
#include <qpa/qplatforminputcontextfactory_p.h>
#include <private/qinputdevicemanager_p_p.h>
-#ifndef QT_NO_LIBINPUT
+#if QT_CONFIG(libinput)
#include <QtPlatformSupport/private/qlibinputhandler_p.h>
#endif
diff --git a/src/plugins/platforms/windows/qwindowsfontdatabase.cpp b/src/plugins/platforms/windows/qwindowsfontdatabase.cpp
index 6f236aa588..e87064e385 100644
--- a/src/plugins/platforms/windows/qwindowsfontdatabase.cpp
+++ b/src/plugins/platforms/windows/qwindowsfontdatabase.cpp
@@ -40,6 +40,7 @@
#include "qwindowsfontdatabase.h"
#include "qwindowsfontdatabase_ft.h" // for default font
#include "qwindowscontext.h"
+#include "qwindowsintegration.h"
#include "qwindowsfontengine.h"
#include "qwindowsfontenginedirectwrite.h"
#include <QtCore/qt_windows.h>
@@ -108,6 +109,18 @@ static void createDirectWriteFactory(IDWriteFactory **factory)
*factory = static_cast<IDWriteFactory *>(result);
}
+
+static inline bool useDirectWrite(QFont::HintingPreference hintingPreference, bool isColorFont = false)
+{
+ const unsigned options = QWindowsIntegration::instance()->options();
+ if (Q_UNLIKELY(options & QWindowsIntegration::DontUseDirectWriteFonts))
+ return false;
+ if (isColorFont)
+ return (options & QWindowsIntegration::DontUseColorFonts) == 0;
+ return hintingPreference == QFont::PreferNoHinting
+ || hintingPreference == QFont::PreferVerticalHinting
+ || (QHighDpiScaling::isActive() && hintingPreference == QFont::PreferDefaultHinting);
+}
#endif // !QT_NO_DIRECTWRITE
// Helper classes for creating font engines directly from font data
@@ -1200,11 +1213,7 @@ QFontEngine *QWindowsFontDatabase::fontEngine(const QByteArray &fontData, qreal
QFontEngine *fontEngine = 0;
#if !defined(QT_NO_DIRECTWRITE)
- bool useDirectWrite = (hintingPreference == QFont::PreferNoHinting)
- || (hintingPreference == QFont::PreferVerticalHinting)
- || (QHighDpiScaling::isActive() && hintingPreference == QFont::PreferDefaultHinting);
-
- if (!useDirectWrite)
+ if (!useDirectWrite(hintingPreference))
#endif
{
GUID guid;
@@ -1840,15 +1849,16 @@ QFontEngine *QWindowsFontDatabase::createEngine(const QFontDef &request,
if (SUCCEEDED(directWriteFontFace->QueryInterface(__uuidof(IDWriteFontFace2),
reinterpret_cast<void **>(&directWriteFontFace2)))) {
if (directWriteFontFace2->IsColorFont())
- isColorFont = true;
+ isColorFont = directWriteFontFace2->GetPaletteEntryCount() > 0;
}
#endif
-
- bool useDirectWrite = (request.hintingPreference == QFont::PreferNoHinting)
- || (request.hintingPreference == QFont::PreferVerticalHinting)
- || (QHighDpiScaling::isActive() && request.hintingPreference == QFont::PreferDefaultHinting)
- || isColorFont;
- if (useDirectWrite) {
+ const QFont::HintingPreference hintingPreference =
+ static_cast<QFont::HintingPreference>(request.hintingPreference);
+ const bool useDw = useDirectWrite(hintingPreference, isColorFont);
+ qCDebug(lcQpaFonts) << __FUNCTION__ << request.family << request.pointSize
+ << "pt" << "hintingPreference=" << hintingPreference << "color=" << isColorFont
+ << dpi << "dpi" << "useDirectWrite=" << useDw;
+ if (useDw) {
QWindowsFontEngineDirectWrite *fedw = new QWindowsFontEngineDirectWrite(directWriteFontFace,
request.pixelSize,
data);
diff --git a/src/plugins/platforms/windows/qwindowsintegration.cpp b/src/plugins/platforms/windows/qwindowsintegration.cpp
index 90aa3fef16..b9a63c7a89 100644
--- a/src/plugins/platforms/windows/qwindowsintegration.cpp
+++ b/src/plugins/platforms/windows/qwindowsintegration.cpp
@@ -192,6 +192,10 @@ static inline unsigned parseOptions(const QStringList &paramList,
}
} else if (param == QLatin1String("gl=gdi")) {
options |= QWindowsIntegration::DisableArb;
+ } else if (param == QLatin1String("nodirectwrite")) {
+ options |= QWindowsIntegration::DontUseDirectWriteFonts;
+ } else if (param == QLatin1String("nocolorfonts")) {
+ options |= QWindowsIntegration::DontUseColorFonts;
} else if (param == QLatin1String("nomousefromtouch")) {
options |= QWindowsIntegration::DontPassOsMouseEventsSynthesizedFromTouch;
} else if (parseIntOption(param, QLatin1String("verbose"), 0, INT_MAX, &QWindowsContext::verbose)
@@ -304,7 +308,7 @@ QPlatformWindow *QWindowsIntegration::createPlatformWindow(QWindow *window) cons
if (window->type() == Qt::ForeignWindow) {
const HWND hwnd = reinterpret_cast<HWND>(window->winId());
if (!IsWindow(hwnd)) {
- qWarning("Windows QPA: Invalid foreign window ID %p.");
+ qWarning("Windows QPA: Invalid foreign window ID %p.", hwnd);
return nullptr;
}
QWindowsForeignWindow *result = new QWindowsForeignWindow(window, hwnd);
diff --git a/src/plugins/platforms/windows/qwindowsintegration.h b/src/plugins/platforms/windows/qwindowsintegration.h
index 437253cedc..4258f908e7 100644
--- a/src/plugins/platforms/windows/qwindowsintegration.h
+++ b/src/plugins/platforms/windows/qwindowsintegration.h
@@ -60,7 +60,9 @@ public:
DisableArb = 0x4,
NoNativeDialogs = 0x8,
XpNativeDialogs = 0x10,
- DontPassOsMouseEventsSynthesizedFromTouch = 0x20 // Do not pass OS-generated mouse events from touch.
+ DontPassOsMouseEventsSynthesizedFromTouch = 0x20, // Do not pass OS-generated mouse events from touch.
+ DontUseDirectWriteFonts = 0x40,
+ DontUseColorFonts = 0x80
};
explicit QWindowsIntegration(const QStringList &paramList);
diff --git a/src/plugins/platforms/windows/qwindowskeymapper.cpp b/src/plugins/platforms/windows/qwindowskeymapper.cpp
index 8d6e83298e..79b5bbae41 100644
--- a/src/plugins/platforms/windows/qwindowskeymapper.cpp
+++ b/src/plugins/platforms/windows/qwindowskeymapper.cpp
@@ -43,6 +43,7 @@
#include "qwindowswindow.h"
#include "qwindowsinputcontext.h"
+#include <QtGui/QGuiApplication>
#include <QtGui/QWindow>
#include <qpa/qwindowsysteminterface.h>
#include <private/qguiapplication_p.h>
@@ -1048,6 +1049,21 @@ bool QWindowsKeyMapper::translateKeyEventInternal(QWindow *window, const MSG &ms
if (PeekMessage(&wm_char, 0, charType, charType, PM_REMOVE)) {
// Found a ?_CHAR
uch = QChar(ushort(wm_char.wParam));
+ if (uch.isHighSurrogate()) {
+ m_lastHighSurrogate = uch;
+ return true;
+ } else if (uch.isLowSurrogate() && !m_lastHighSurrogate.isNull()) {
+ if (QObject *focusObject = QGuiApplication::focusObject()) {
+ const QChar chars[2] = {m_lastHighSurrogate, uch};
+ QInputMethodEvent event;
+ event.setCommitString(QString(chars, 2));
+ QCoreApplication::sendEvent(focusObject, &event);
+ }
+ m_lastHighSurrogate = QChar();
+ return true;
+ } else {
+ m_lastHighSurrogate = QChar();
+ }
if (msgType == WM_SYSKEYDOWN && uch.isLetter() && (msg.lParam & KF_ALTDOWN))
uch = uch.toLower(); // (See doc of WM_SYSCHAR) Alt-letter
if (!code && !uch.row())
diff --git a/src/plugins/platforms/windows/qwindowskeymapper.h b/src/plugins/platforms/windows/qwindowskeymapper.h
index 069f78197e..2657644780 100644
--- a/src/plugins/platforms/windows/qwindowskeymapper.h
+++ b/src/plugins/platforms/windows/qwindowskeymapper.h
@@ -103,6 +103,7 @@ private:
void deleteLayouts();
QWindow *m_keyGrabber;
+ QChar m_lastHighSurrogate;
static const size_t NumKeyboardLayoutItems = 256;
KeyboardLayoutItem keyLayout[NumKeyboardLayoutItems];
};
diff --git a/src/plugins/platforms/windows/windows.pri b/src/plugins/platforms/windows/windows.pri
index 1cadcd1954..6929f7365f 100644
--- a/src/plugins/platforms/windows/windows.pri
+++ b/src/plugins/platforms/windows/windows.pri
@@ -1,7 +1,7 @@
# Note: OpenGL32 must precede Gdi32 as it overwrites some functions.
LIBS += -lole32 -luser32 -lwinspool -limm32 -lwinmm -loleaut32
-contains(QT_CONFIG, opengl):!contains(QT_CONFIG, opengles2):!contains(QT_CONFIG, dynamicgl): LIBS *= -lopengl32
+qtConfig(opengl):!qtConfig(opengles2):!qtConfig(dynamicgl): LIBS *= -lopengl32
mingw: LIBS *= -luuid
# For the dialog helpers:
@@ -9,8 +9,8 @@ LIBS += -lshlwapi -lshell32 -ladvapi32
DEFINES *= QT_NO_CAST_FROM_ASCII
-contains(QT_CONFIG, directwrite) {
- contains(QT_CONFIG, directwrite2): \
+qtConfig(directwrite) {
+ qtConfig(directwrite2): \
DEFINES *= QT_USE_DIRECTWRITE2
SOURCES += $$PWD/qwindowsfontenginedirectwrite.cpp
@@ -65,18 +65,18 @@ HEADERS += \
INCLUDEPATH += $$PWD
-contains(QT_CONFIG,opengl): HEADERS += $$PWD/qwindowsopenglcontext.h
+qtConfig(opengl): HEADERS += $$PWD/qwindowsopenglcontext.h
-contains(QT_CONFIG, opengles2) {
+qtConfig(opengles2) {
SOURCES += $$PWD/qwindowseglcontext.cpp
HEADERS += $$PWD/qwindowseglcontext.h
-} else: contains(QT_CONFIG,opengl) {
+} else: qtConfig(opengl) {
SOURCES += $$PWD/qwindowsglcontext.cpp
HEADERS += $$PWD/qwindowsglcontext.h
}
# Dynamic GL needs both WGL and EGL
-contains(QT_CONFIG,dynamicgl) {
+qtConfig(dynamicgl) {
SOURCES += $$PWD/qwindowseglcontext.cpp
HEADERS += $$PWD/qwindowseglcontext.h
}
@@ -111,18 +111,17 @@ contains(QT_CONFIG,dynamicgl) {
RESOURCES += $$PWD/openglblacklists.qrc
-contains(QT_CONFIG, freetype) {
+qtConfig(freetype) {
HEADERS += $$PWD/qwindowsfontdatabase_ft.h
SOURCES += $$PWD/qwindowsfontdatabase_ft.cpp
- contains(QT_CONFIG, system-freetype) {
+ qtConfig(system-freetype) {
include($$QT_SOURCE_TREE/src/platformsupport/fontdatabases/basic/basic.pri)
} else {
- DEFINES *= QT_NO_FONTCONFIG
include($$QT_SOURCE_TREE/src/3rdparty/freetype_dependency.pri)
}
}
-contains(QT_CONFIG, accessibility):include($$PWD/accessible/accessible.pri)
+qtConfig(accessibility): include($$PWD/accessible/accessible.pri)
DEFINES *= LIBEGL_NAME=$${LIBEGL_NAME}
DEFINES *= LIBGLESV2_NAME=$${LIBGLESV2_NAME}
diff --git a/src/plugins/platforms/winrt/qwinrtwindow.cpp b/src/plugins/platforms/winrt/qwinrtwindow.cpp
index a910967f87..606ca22bcd 100644
--- a/src/plugins/platforms/winrt/qwinrtwindow.cpp
+++ b/src/plugins/platforms/winrt/qwinrtwindow.cpp
@@ -322,10 +322,59 @@ void QWinRTWindow::setWindowState(Qt::WindowState state)
if (d->state == state)
return;
+#if _MSC_VER >= 1900
+ if (state == Qt::WindowFullScreen) {
+ HRESULT hr;
+ boolean success;
+ hr = QEventDispatcherWinRT::runOnXamlThread([&hr, &success]() {
+ ComPtr<IApplicationViewStatics2> applicationViewStatics;
+ hr = RoGetActivationFactory(HString::MakeReference(RuntimeClass_Windows_UI_ViewManagement_ApplicationView).Get(),
+ IID_PPV_ARGS(&applicationViewStatics));
+ RETURN_HR_IF_FAILED("Could not access application view statics.");
+ ComPtr<IApplicationView> view;
+ hr = applicationViewStatics->GetForCurrentView(&view);
+ RETURN_HR_IF_FAILED("Could not access application view.");
+ ComPtr<IApplicationView3> view3;
+ hr = view.As(&view3);
+ Q_ASSERT_SUCCEEDED(hr);
+ hr = view3->TryEnterFullScreenMode(&success);
+ return hr;
+ });
+ if (FAILED(hr) || !success) {
+ qCDebug(lcQpaWindows) << "Failed to enter full screen mode.";
+ return;
+ }
+ d->state = state;
+ return;
+ }
+
+ if (d->state == Qt::WindowFullScreen) {
+ HRESULT hr;
+ hr = QEventDispatcherWinRT::runOnXamlThread([&hr]() {
+ ComPtr<IApplicationViewStatics2> applicationViewStatics;
+ hr = RoGetActivationFactory(HString::MakeReference(RuntimeClass_Windows_UI_ViewManagement_ApplicationView).Get(),
+ IID_PPV_ARGS(&applicationViewStatics));
+ RETURN_HR_IF_FAILED("Could not access application view statics.");
+ ComPtr<IApplicationView> view;
+ hr = applicationViewStatics->GetForCurrentView(&view);
+ RETURN_HR_IF_FAILED("Could not access application view.");
+ ComPtr<IApplicationView3> view3;
+ hr = view.As(&view3);
+ Q_ASSERT_SUCCEEDED(hr);
+ hr = view3->ExitFullScreenMode();
+ return hr;
+ });
+ if (FAILED(hr)) {
+ qCDebug(lcQpaWindows) << "Failed to exit full screen mode.";
+ return;
+ }
+ }
+#endif // _MSC_VER >= 1900
+
if (state == Qt::WindowMinimized)
setUIElementVisibility(d->uiElement.Get(), false);
- if (d->state == Qt::WindowMinimized)
+ if (d->state == Qt::WindowMinimized || state == Qt::WindowNoState || state == Qt::WindowActive)
setUIElementVisibility(d->uiElement.Get(), true);
d->state = state;
diff --git a/src/plugins/platforms/xcb/gl_integrations/gl_integrations.pro b/src/plugins/platforms/xcb/gl_integrations/gl_integrations.pro
index 9de0476810..0cdee03f62 100644
--- a/src/plugins/platforms/xcb/gl_integrations/gl_integrations.pro
+++ b/src/plugins/platforms/xcb/gl_integrations/gl_integrations.pro
@@ -1,9 +1,9 @@
TEMPLATE = subdirs
-contains(QT_CONFIG, egl): contains(QT_CONFIG, egl_x11): contains(QT_CONFIG, opengl) {
+qtConfig(egl):qtConfig(egl_x11):qtConfig(opengl) {
SUBDIRS += xcb_egl
}
-contains(QT_CONFIG, xcb-xlib): contains(QT_CONFIG, opengl): !contains(QT_CONFIG, opengles2) {
+qtConfig(xcb-xlib):qtConfig(opengl):!qtConfig(opengles2) {
SUBDIRS += xcb_glx
}
diff --git a/src/plugins/platforms/xcb/gl_integrations/gl_integrations_plugin_base.pri b/src/plugins/platforms/xcb/gl_integrations/gl_integrations_plugin_base.pri
index c2d3849d8e..57c8f27d9c 100644
--- a/src/plugins/platforms/xcb/gl_integrations/gl_integrations_plugin_base.pri
+++ b/src/plugins/platforms/xcb/gl_integrations/gl_integrations_plugin_base.pri
@@ -4,35 +4,31 @@ INCLUDEPATH += $$PWD
INCLUDEPATH += $$PWD/../
# needed by Xcursor ...
-contains(QT_CONFIG, xcb-xlib) {
+qtConfig(xcb-xlib) {
DEFINES += XCB_USE_XLIB
- contains(QT_CONFIG, xinput2) {
+ qtConfig(xinput2) {
DEFINES += XCB_USE_XINPUT2
}
}
-# to support custom cursors with depth > 1
-contains(QT_CONFIG, xcb-render) {
- DEFINES += XCB_USE_RENDER
-}
-
# build with session management support
-contains(QT_CONFIG, xcb-sm) {
+qtConfig(xcb-sm) {
DEFINES += XCB_USE_SM
}
-DEFINES += $$QMAKE_DEFINES_XCB
-LIBS += $$QMAKE_LIBS_XCB
-QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_XCB
-
CONFIG += qpa/genericunixfontdatabase
-contains(QT_CONFIG, xcb-qt) {
+!qtConfig(system-xcb) {
DEFINES += XCB_USE_RENDER
XCB_DIR = $$clean_path($$PWD/../../../../3rdparty/xcb)
INCLUDEPATH += $$XCB_DIR/include $$XCB_DIR/include/xcb $$XCB_DIR/sysinclude
- LIBS += -lxcb -L$$MODULE_BASE_OUTDIR/lib -lxcb-static$$qtPlatformTargetSuffix()
+ LIBS += -L$$MODULE_BASE_OUTDIR/lib -lxcb-static$$qtPlatformTargetSuffix()
+ QMAKE_USE += xcb
} else {
- LIBS += -lxcb -lxcb-image -lxcb-icccm -lxcb-sync -lxcb-xfixes -lxcb-shm -lxcb-randr -lxcb-shape -lxcb-keysyms
- !contains(DEFINES, QT_NO_XKB):LIBS += -lxcb-xkb
+ qtConfig(xkb): QMAKE_USE += xcb_xkb
+ # to support custom cursors with depth > 1
+ qtConfig(xcb-render) {
+ DEFINES += XCB_USE_RENDER
+ }
+ QMAKE_USE += xcb_syslibs
}
diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglinclude.h b/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglinclude.h
index 9729f610b6..7c6524c8ee 100644
--- a/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglinclude.h
+++ b/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglinclude.h
@@ -46,7 +46,7 @@
#include <QtGui/private/qcssparser_p.h>
#include <QtGui/private/qtextengine_p.h>
-#include <EGL/egl.h>
+#include <QtPlatformSupport/private/qt_egl_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_egl/xcb_egl.pro b/src/plugins/platforms/xcb/gl_integrations/xcb_egl/xcb_egl.pro
index 6d52332bad..92e6c18fbe 100644
--- a/src/plugins/platforms/xcb/gl_integrations/xcb_egl/xcb_egl.pro
+++ b/src/plugins/platforms/xcb/gl_integrations/xcb_egl/xcb_egl.pro
@@ -4,7 +4,7 @@ include(../gl_integrations_plugin_base.pri)
CONFIG += egl
-contains(QT_CONFIG, xcb-xlib): DEFINES += XCB_USE_XLIB
+qtConfig(xcb-xlib): DEFINES += XCB_USE_XLIB
HEADERS += \
qxcbeglcontext.h \
diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/xcb_glx.pro b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/xcb_glx.pro
index 67fd68765a..88c4144fd9 100644
--- a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/xcb_glx.pro
+++ b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/xcb_glx.pro
@@ -5,12 +5,11 @@ include(../gl_integrations_plugin_base.pri)
#should be removed from the sources
DEFINES += XCB_USE_GLX XCB_USE_XLIB
-LIBS += -lxcb
-
-contains(QT_CONFIG, xcb-glx) {
+qtConfig(xcb-glx) {
DEFINES += XCB_HAS_XCB_GLX
- LIBS += -lxcb-glx
+ QMAKE_USE += xcb_glx
}
+QMAKE_USE += xcb
LIBS += $$QMAKE_LIBS_DYNLOAD
diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp
index 7065bb0ffb..2d959688b3 100644
--- a/src/plugins/platforms/xcb/qxcbconnection.cpp
+++ b/src/plugins/platforms/xcb/qxcbconnection.cpp
@@ -599,7 +599,7 @@ QXcbConnection::QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGra
xcb_extension_t *extensions[] = {
&xcb_shm_id, &xcb_xfixes_id, &xcb_randr_id, &xcb_shape_id, &xcb_sync_id,
-#ifndef QT_NO_XKB
+#if QT_CONFIG(xkb)
&xcb_xkb_id,
#endif
#ifdef XCB_USE_RENDER
@@ -1069,7 +1069,7 @@ Qt::MouseButton QXcbConnection::translateMouseButton(xcb_button_t s)
}
}
-#ifndef QT_NO_XKB
+#if QT_CONFIG(xkb)
namespace {
typedef union {
/* All XKB events share these fields. */
@@ -1252,7 +1252,7 @@ void QXcbConnection::handleXcbEvent(xcb_generic_event_t *event)
s->handleScreenChange(change_event);
}
handled = true;
-#ifndef QT_NO_XKB
+#if QT_CONFIG(xkb)
} else if (response_type == xkb_first_event) { // https://bugs.freedesktop.org/show_bug.cgi?id=51295
_xkb_event *xkb_event = reinterpret_cast<_xkb_event *>(event);
if (xkb_event->any.deviceID == m_keyboard->coreDeviceId()) {
@@ -2174,7 +2174,7 @@ void QXcbConnection::initializeXShape()
void QXcbConnection::initializeXKB()
{
-#ifndef QT_NO_XKB
+#if QT_CONFIG(xkb)
const xcb_query_extension_reply_t *reply = xcb_get_extension_data(m_connection, &xcb_xkb_id);
if (!reply || !reply->present) {
qWarning("Qt: XKEYBOARD extension not present on the X server.");
diff --git a/src/plugins/platforms/xcb/qxcbconnection.h b/src/plugins/platforms/xcb/qxcbconnection.h
index 34866e5c89..4d903ec8d3 100644
--- a/src/plugins/platforms/xcb/qxcbconnection.h
+++ b/src/plugins/platforms/xcb/qxcbconnection.h
@@ -53,10 +53,11 @@
#include <QVarLengthArray>
#include <qpa/qwindowsysteminterface.h>
#include <QtCore/QLoggingCategory>
+#include <QtCore/private/qglobal_p.h>
// This is needed to make Qt compile together with XKB. xkb.h is using a variable
// which is called 'explicit', this is a reserved keyword in c++
-#ifndef QT_NO_XKB
+#if QT_CONFIG(xkb)
#define explicit dont_use_cxx_explicit
#include <xcb/xkb.h>
#undef explicit
diff --git a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
index 5b7f45fb6c..bda167bce9 100644
--- a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
+++ b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
@@ -697,7 +697,7 @@ void QXcbConnection::xi2ProcessTouch(void *xiDevEvent, QXcbWindow *platformWindo
if (m_xiGrab) {
// XIAllowTouchEvents deadlocks with libXi < 1.7.4 (this has nothing to do with the XI2 versions like 2.2)
// http://lists.x.org/archives/xorg-devel/2014-July/043059.html
-#ifndef LIBXI_MAJOR
+#ifndef XCB_USE_XINPUT2
static bool allowTouchWarningShown = false;
if (!allowTouchWarningShown) {
allowTouchWarningShown = true;
@@ -705,13 +705,16 @@ void QXcbConnection::xi2ProcessTouch(void *xiDevEvent, QXcbWindow *platformWindo
" Minimum libXi version required is 1.7.4."
" Expect issues with touch behavior.");
}
-#elif LIBXI_MAJOR == 1 && (LIBXI_MINOR < 7 || (LIBXI_MINOR == 7 && LIBXI_PATCH < 4))
+#elif QT_LIBRARY_VERSION(xinput2) < QT_VERSION_CHECK(1, 7, 4)
static bool allowTouchWarningShown = false;
if (!allowTouchWarningShown) {
allowTouchWarningShown = true;
qWarning("Skipping XIAllowTouchEvents() due to not having libXi >= 1.7.4."
" libXi version at build time was %d.%d.%d."
- " Expect issues with touch behavior.", LIBXI_MAJOR, LIBXI_MINOR, LIBXI_PATCH);
+ " Expect issues with touch behavior.",
+ QT_LIBRARY_VERSION_MAJOR(xinput2),
+ QT_LIBRARY_VERSION_MINOR(xinput2),
+ QT_LIBRARY_VERSION_PATCH(xinput2));
}
#else
XIAllowTouchEvents(static_cast<Display *>(m_xlib_display), xiDeviceEvent->deviceid,
diff --git a/src/plugins/platforms/xcb/qxcbintegration.cpp b/src/plugins/platforms/xcb/qxcbintegration.cpp
index cdbf9b295e..5a89113a4f 100644
--- a/src/plugins/platforms/xcb/qxcbintegration.cpp
+++ b/src/plugins/platforms/xcb/qxcbintegration.cpp
@@ -65,7 +65,7 @@
#include <QtGui/private/qguiapplication_p.h>
#ifdef XCB_USE_EGL
-#include <EGL/egl.h>
+# include <QtPlatformSupport/private/qt_egl_p.h>
#endif
#ifdef XCB_USE_XLIB
diff --git a/src/plugins/platforms/xcb/qxcbkeyboard.cpp b/src/plugins/platforms/xcb/qxcbkeyboard.cpp
index 811ef4251a..07932ceeb8 100644
--- a/src/plugins/platforms/xcb/qxcbkeyboard.cpp
+++ b/src/plugins/platforms/xcb/qxcbkeyboard.cpp
@@ -711,7 +711,7 @@ void QXcbKeyboard::updateKeymap()
xkb_keymap = 0;
struct xkb_state *new_state = 0;
-#ifndef QT_NO_XKB
+#if QT_CONFIG(xkb)
if (connection()->hasXKB()) {
xkb_keymap = xkb_x11_keymap_new_from_device(xkb_context, xcb_connection(), core_device_id, (xkb_keymap_compile_flags)0);
if (xkb_keymap) {
@@ -754,7 +754,7 @@ void QXcbKeyboard::updateKeymap()
checkForLatinLayout();
}
-#ifndef QT_NO_XKB
+#if QT_CONFIG(xkb)
void QXcbKeyboard::updateXKBState(xcb_xkb_state_notify_event_t *state)
{
if (m_config && connection()->hasXKB()) {
@@ -1140,7 +1140,7 @@ QXcbKeyboard::QXcbKeyboard(QXcbConnection *connection)
, m_hasLatinLayout(false)
{
memset(&xkb_names, 0, sizeof(xkb_names));
-#ifndef QT_NO_XKB
+#if QT_CONFIG(xkb)
core_device_id = 0;
if (connection->hasXKB()) {
updateVModMapping();
@@ -1154,7 +1154,7 @@ QXcbKeyboard::QXcbKeyboard(QXcbConnection *connection)
#endif
m_key_symbols = xcb_key_symbols_alloc(xcb_connection());
updateModifiers();
-#ifndef QT_NO_XKB
+#if QT_CONFIG(xkb)
}
#endif
updateKeymap();
@@ -1173,7 +1173,7 @@ QXcbKeyboard::~QXcbKeyboard()
void QXcbKeyboard::updateVModMapping()
{
-#ifndef QT_NO_XKB
+#if QT_CONFIG(xkb)
xcb_xkb_get_names_cookie_t names_cookie;
xcb_xkb_get_names_reply_t *name_reply;
xcb_xkb_get_names_value_list_t names_list;
@@ -1242,7 +1242,7 @@ void QXcbKeyboard::updateVModMapping()
void QXcbKeyboard::updateVModToRModMapping()
{
-#ifndef QT_NO_XKB
+#if QT_CONFIG(xkb)
xcb_xkb_get_map_cookie_t map_cookie;
xcb_xkb_get_map_reply_t *map_reply;
xcb_xkb_get_map_map_t map;
diff --git a/src/plugins/platforms/xcb/qxcbkeyboard.h b/src/plugins/platforms/xcb/qxcbkeyboard.h
index 75e6d2ec82..817b57ff5b 100644
--- a/src/plugins/platforms/xcb/qxcbkeyboard.h
+++ b/src/plugins/platforms/xcb/qxcbkeyboard.h
@@ -45,7 +45,7 @@
#include <xcb/xcb_keysyms.h>
#include <xkbcommon/xkbcommon.h>
-#ifndef QT_NO_XKB
+#if QT_CONFIG(xkb)
#include <xkbcommon/xkbcommon-x11.h>
#endif
@@ -77,7 +77,7 @@ public:
#ifdef XCB_USE_XINPUT22
void updateXKBStateFromXI(void *modInfo, void *groupInfo);
#endif
-#ifndef QT_NO_XKB
+#if QT_CONFIG(xkb)
// when XKEYBOARD is present on the X server
int coreDeviceId() const { return core_device_id; }
void updateXKBState(xcb_xkb_state_notify_event_t *state);
@@ -136,7 +136,7 @@ private:
xkb_mod_index_t mod5;
};
_xkb_mods xkb_mods;
-#ifndef QT_NO_XKB
+#if QT_CONFIG(xkb)
// when XKEYBOARD is present on the X server
_mod_masks vmod_masks;
int core_device_id;
diff --git a/src/plugins/platforms/xcb/xcb.pro b/src/plugins/platforms/xcb/xcb.pro
index 5915a59c0b..7840a4583f 100644
--- a/src/plugins/platforms/xcb/xcb.pro
+++ b/src/plugins/platforms/xcb/xcb.pro
@@ -1,7 +1,7 @@
TEMPLATE = subdirs
CONFIG += ordered
-contains(QT_CONFIG, xcb-qt):SUBDIRS+=xcb-static
+!qtConfig(system-xcb): SUBDIRS += xcb-static
SUBDIRS += xcb_qpa_lib.pro
SUBDIRS += xcb-plugin.pro
diff --git a/src/plugins/platforms/xcb/xcb_qpa_lib.pro b/src/plugins/platforms/xcb/xcb_qpa_lib.pro
index 7967aee3ab..942183877d 100644
--- a/src/plugins/platforms/xcb/xcb_qpa_lib.pro
+++ b/src/plugins/platforms/xcb/xcb_qpa_lib.pro
@@ -41,67 +41,54 @@ HEADERS = \
DEFINES += QT_BUILD_XCB_PLUGIN
# needed by Xcursor ...
-contains(QT_CONFIG, xcb-xlib) {
+qtConfig(xcb-xlib) {
DEFINES += XCB_USE_XLIB
- LIBS += -lX11 -lX11-xcb
+ QMAKE_USE += xcb_xlib
- contains(QT_CONFIG, xinput2) {
+ qtConfig(xinput2) {
DEFINES += XCB_USE_XINPUT2
SOURCES += qxcbconnection_xi2.cpp
- LIBS += -lXi
- !isEmpty(QMAKE_XINPUT2_VERSION_MAJOR) {
- DEFINES += LIBXI_MAJOR=$$QMAKE_XINPUT2_VERSION_MAJOR \
- LIBXI_MINOR=$$QMAKE_XINPUT2_VERSION_MINOR \
- LIBXI_PATCH=$$QMAKE_XINPUT2_VERSION_PATCH
- }
+ QMAKE_USE += xinput2
}
}
-# to support custom cursors with depth > 1
-contains(QT_CONFIG, xcb-render) {
- DEFINES += XCB_USE_RENDER
- LIBS += -lxcb-render -lxcb-render-util
-}
-
# build with session management support
-contains(QT_CONFIG, xcb-sm) {
+qtConfig(xcb-sm) {
DEFINES += XCB_USE_SM
- LIBS += -lSM -lICE
+ QMAKE_USE += x11sm
SOURCES += qxcbsessionmanager.cpp
HEADERS += qxcbsessionmanager.h
}
include(gl_integrations/gl_integrations.pri)
-DEFINES += $$QMAKE_DEFINES_XCB
-LIBS += $$QMAKE_LIBS_XCB
-QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_XCB
-QMAKE_CFLAGS += $$QMAKE_CFLAGS_XCB
-
CONFIG += qpa/genericunixfontdatabase
-contains(QT_CONFIG, dbus-linked) {
+qtConfig(dbus-linked): \
QT += dbus
- LIBS += $$QMAKE_LIBS_DBUS
-}
-contains(QT_CONFIG, xcb-qt) {
+!qtConfig(system-xcb) {
DEFINES += XCB_USE_RENDER
XCB_DIR = ../../../3rdparty/xcb
INCLUDEPATH += $$XCB_DIR/include $$XCB_DIR/sysinclude
- LIBS += -lxcb -L$$MODULE_BASE_OUTDIR/lib -lxcb-static$$qtPlatformTargetSuffix()
+ LIBS += -L$$MODULE_BASE_OUTDIR/lib -lxcb-static$$qtPlatformTargetSuffix()
+ QMAKE_USE += xcb
} else {
- LIBS += -lxcb -lxcb-image -lxcb-icccm -lxcb-sync -lxcb-xfixes -lxcb-shm -lxcb-randr -lxcb-shape -lxcb-keysyms -lxcb-xinerama
- !contains(DEFINES, QT_NO_XKB):LIBS += -lxcb-xkb
+ LIBS += -lxcb-xinerama ### there is no configure test for this!
+ qtConfig(xkb): QMAKE_USE += xcb_xkb
+ # to support custom cursors with depth > 1
+ qtConfig(xcb-render) {
+ DEFINES += XCB_USE_RENDER
+ QMAKE_USE += xcb_render
+ }
+ QMAKE_USE += xcb_syslibs
}
# libxkbcommon
-contains(QT_CONFIG, xkbcommon-qt) {
- QT_CONFIG += use-xkbcommon-x11support
- include(../../../3rdparty/xkbcommon.pri)
+!qtConfig(xkbcommon-system) {
+ include(../../../3rdparty/xkbcommon-x11.pri)
} else {
- LIBS += $$QMAKE_LIBS_XKBCOMMON
- QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_XKBCOMMON
+ QMAKE_USE += xkbcommon
}
load(qt_module)
diff --git a/src/plugins/platformthemes/gtk3/gtk3.pro b/src/plugins/platformthemes/gtk3/gtk3.pro
index 72a33efeac..12364b0b57 100644
--- a/src/plugins/platformthemes/gtk3/gtk3.pro
+++ b/src/plugins/platformthemes/gtk3/gtk3.pro
@@ -8,8 +8,7 @@ load(qt_plugin)
QT += core-private gui-private platformsupport-private
CONFIG += X11
-QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_GTK3
-LIBS += $$QMAKE_LIBS_GTK3
+QMAKE_USE += gtk3
HEADERS += \
qgtk3dialoghelpers.h \
diff --git a/src/plugins/platformthemes/gtk3/qgtk3dialoghelpers.cpp b/src/plugins/platformthemes/gtk3/qgtk3dialoghelpers.cpp
index eb581f5138..308eee5404 100644
--- a/src/plugins/platformthemes/gtk3/qgtk3dialoghelpers.cpp
+++ b/src/plugins/platformthemes/gtk3/qgtk3dialoghelpers.cpp
@@ -117,8 +117,10 @@ void QGtk3Dialog::exec()
bool QGtk3Dialog::show(Qt::WindowFlags flags, Qt::WindowModality modality, QWindow *parent)
{
- connect(parent, &QWindow::destroyed, this, &QGtk3Dialog::onParentWindowDestroyed,
- Qt::UniqueConnection);
+ if (parent) {
+ connect(parent, &QWindow::destroyed, this, &QGtk3Dialog::onParentWindowDestroyed,
+ Qt::UniqueConnection);
+ }
setParent(parent);
setFlags(flags);
setModality(modality);
diff --git a/src/plugins/platformthemes/gtk3/qgtk3menu.cpp b/src/plugins/platformthemes/gtk3/qgtk3menu.cpp
index 288978ae84..52757587b4 100644
--- a/src/plugins/platformthemes/gtk3/qgtk3menu.cpp
+++ b/src/plugins/platformthemes/gtk3/qgtk3menu.cpp
@@ -371,7 +371,7 @@ void QGtk3Menu::insertMenuItem(QPlatformMenuItem *item, QPlatformMenuItem *befor
void QGtk3Menu::removeMenuItem(QPlatformMenuItem *item)
{
QGtk3MenuItem *gitem = static_cast<QGtk3MenuItem *>(item);
- if (!gitem && !m_items.removeOne(gitem))
+ if (!gitem || !m_items.removeOne(gitem))
return;
GtkWidget *handle = gitem->handle();
diff --git a/src/plugins/platformthemes/platformthemes.pro b/src/plugins/platformthemes/platformthemes.pro
index f5f54068a2..166b39ce8c 100644
--- a/src/plugins/platformthemes/platformthemes.pro
+++ b/src/plugins/platformthemes/platformthemes.pro
@@ -1,3 +1,3 @@
TEMPLATE = subdirs
-contains(QT_CONFIG, gtk3): SUBDIRS += gtk3
+qtConfig(gtk3): SUBDIRS += gtk3
diff --git a/src/plugins/printsupport/cups/cups.pro b/src/plugins/printsupport/cups/cups.pro
index 757408e7f7..58bc11606b 100644
--- a/src/plugins/printsupport/cups/cups.pro
+++ b/src/plugins/printsupport/cups/cups.pro
@@ -3,7 +3,7 @@ MODULE = cupsprintersupport
QT += core-private gui-private printsupport printsupport-private
-LIBS_PRIVATE += -lcups
+QMAKE_USE_PRIVATE += cups
INCLUDEPATH += ../../../printsupport/kernel
diff --git a/src/plugins/printsupport/printsupport.pro b/src/plugins/printsupport/printsupport.pro
index bd6681f53c..55feaba40c 100644
--- a/src/plugins/printsupport/printsupport.pro
+++ b/src/plugins/printsupport/printsupport.pro
@@ -1,8 +1,6 @@
+QT += printsupport
TEMPLATE = subdirs
osx: SUBDIRS += cocoa
win32: SUBDIRS += windows
-unix:!mac:contains(QT_CONFIG, cups) {
- load(qfeatures)
- !contains(QT_DISABLED_FEATURES, cups): SUBDIRS += cups
-}
+unix:!darwin:qtConfig(cups): SUBDIRS += cups
diff --git a/src/plugins/sqldrivers/db2/db2.pro b/src/plugins/sqldrivers/db2/db2.pro
index 31822ef8dc..eef65fac66 100644
--- a/src/plugins/sqldrivers/db2/db2.pro
+++ b/src/plugins/sqldrivers/db2/db2.pro
@@ -3,11 +3,7 @@ TARGET = qsqldb2
HEADERS += $$PWD/qsql_db2_p.h
SOURCES += $$PWD/qsql_db2.cpp $$PWD/main.cpp
-unix {
- !contains(LIBS, .*db2.*):LIBS += -ldb2
-} else {
- !contains(LIBS, .*db2.*):LIBS += -ldb2cli
-}
+QMAKE_USE += db2
OTHER_FILES += db2.json
diff --git a/src/plugins/sqldrivers/ibase/ibase.pro b/src/plugins/sqldrivers/ibase/ibase.pro
index 8237245183..e5709207d1 100644
--- a/src/plugins/sqldrivers/ibase/ibase.pro
+++ b/src/plugins/sqldrivers/ibase/ibase.pro
@@ -3,13 +3,8 @@ TARGET = qsqlibase
HEADERS += $$PWD/qsql_ibase_p.h
SOURCES += $$PWD/qsql_ibase.cpp $$PWD/main.cpp
-unix {
- !contains(LIBS, .*gds.*):!contains(LIBS, .*libfb.*):LIBS += -lgds
-} else {
- !contains(LIBS, .*gds.*):!contains(LIBS, .*fbclient.*) {
- LIBS += -lgds32_ms
- }
-}
+# FIXME: ignores libfb (unix)/fbclient (win32) - but that's for the test anyway
+QMAKE_USE += ibase
OTHER_FILES += ibase.json
diff --git a/src/plugins/sqldrivers/mysql/mysql.pro b/src/plugins/sqldrivers/mysql/mysql.pro
index 3bd8cd0040..56dd5f598c 100644
--- a/src/plugins/sqldrivers/mysql/mysql.pro
+++ b/src/plugins/sqldrivers/mysql/mysql.pro
@@ -3,19 +3,7 @@ TARGET = qsqlmysql
HEADERS += $$PWD/qsql_mysql_p.h
SOURCES += $$PWD/qsql_mysql.cpp $$PWD/main.cpp
-QMAKE_CXXFLAGS *= $$QMAKE_CFLAGS_MYSQL
-LIBS += $$QMAKE_LIBS_MYSQL
-
-unix {
- isEmpty(QMAKE_LIBS_MYSQL) {
- !contains(LIBS, .*mysqlclient.*):!contains(LIBS, .*mysqld.*) {
- use_libmysqlclient_r:LIBS += -lmysqlclient_r
- else:LIBS += -lmysqlclient
- }
- }
-} else {
- !contains(LIBS, .*mysql.*):!contains(LIBS, .*mysqld.*):LIBS += -llibmysql
-}
+QMAKE_USE += mysql
OTHER_FILES += mysql.json
diff --git a/src/plugins/sqldrivers/oci/oci.pro b/src/plugins/sqldrivers/oci/oci.pro
index a22d1181bf..e6ef71f20f 100644
--- a/src/plugins/sqldrivers/oci/oci.pro
+++ b/src/plugins/sqldrivers/oci/oci.pro
@@ -3,11 +3,8 @@ TARGET = qsqloci
HEADERS += $$PWD/qsql_oci_p.h
SOURCES += $$PWD/qsql_oci.cpp $$PWD/main.cpp
-unix {
- !contains(LIBS, .*clnts.*):LIBS += -lclntsh
-} else {
- LIBS *= -loci
-}
+QMAKE_USE += oci
+
darwin:QMAKE_LFLAGS += -Wl,-flat_namespace,-U,_environ
OTHER_FILES += oci.json
diff --git a/src/plugins/sqldrivers/odbc/odbc.pro b/src/plugins/sqldrivers/odbc/odbc.pro
index 0e49f1ac66..17844f27d2 100644
--- a/src/plugins/sqldrivers/odbc/odbc.pro
+++ b/src/plugins/sqldrivers/odbc/odbc.pro
@@ -3,15 +3,8 @@ TARGET = qsqlodbc
HEADERS += $$PWD/qsql_odbc_p.h
SOURCES += $$PWD/qsql_odbc.cpp $$PWD/main.cpp
-unix {
- DEFINES += UNICODE
- !contains(LIBS, .*odbc.*) {
- osx:LIBS += -liodbc
- else:LIBS += $$QMAKE_LIBS_ODBC
- }
-} else {
- LIBS *= -lodbc32
-}
+QMAKE_USE += odbc
+unix: DEFINES += UNICODE
OTHER_FILES += odbc.json
diff --git a/src/plugins/sqldrivers/psql/psql.pro b/src/plugins/sqldrivers/psql/psql.pro
index 4a05266120..c44a6319c3 100644
--- a/src/plugins/sqldrivers/psql/psql.pro
+++ b/src/plugins/sqldrivers/psql/psql.pro
@@ -3,13 +3,7 @@ TARGET = qsqlpsql
HEADERS += $$PWD/qsql_psql_p.h
SOURCES += $$PWD/qsql_psql.cpp $$PWD/main.cpp
-unix|mingw {
- LIBS += $$QMAKE_LIBS_PSQL
- !contains(LIBS, .*pq.*):LIBS += -lpq
- QMAKE_CXXFLAGS *= $$QMAKE_CFLAGS_PSQL
-} else {
- !contains(LIBS, .*pq.*):LIBS += -llibpq -lws2_32 -ladvapi32
-}
+QMAKE_USE += psql
OTHER_FILES += psql.json
diff --git a/src/plugins/sqldrivers/sqlite/sqlite.pro b/src/plugins/sqldrivers/sqlite/sqlite.pro
index c98655f85c..bcdf7d36f3 100644
--- a/src/plugins/sqldrivers/sqlite/sqlite.pro
+++ b/src/plugins/sqldrivers/sqlite/sqlite.pro
@@ -3,11 +3,10 @@ TARGET = qsqlite
HEADERS += $$PWD/qsql_sqlite_p.h
SOURCES += $$PWD/qsql_sqlite.cpp $$PWD/smain.cpp
-!system-sqlite:!contains(LIBS, .*sqlite3.*) {
+!system-sqlite {
include($$PWD/../../../3rdparty/sqlite.pri)
} else {
- LIBS += $$QMAKE_LIBS_SQLITE
- QMAKE_CXXFLAGS *= $$QMAKE_CFLAGS_SQLITE
+ QMAKE_USE += sqlite
}
OTHER_FILES += sqlite.json
diff --git a/src/plugins/sqldrivers/sqlite2/sqlite2.pro b/src/plugins/sqldrivers/sqlite2/sqlite2.pro
index d0ab0eef41..721facb5b8 100644
--- a/src/plugins/sqldrivers/sqlite2/sqlite2.pro
+++ b/src/plugins/sqldrivers/sqlite2/sqlite2.pro
@@ -3,7 +3,7 @@ TARGET = qsqlite2
HEADERS += $$PWD/qsql_sqlite2_p.h
SOURCES += $$PWD/qsql_sqlite2.cpp $$PWD/smain.cpp
-!contains(LIBS, .*sqlite.*):LIBS += -lsqlite
+QMAKE_USE += sqlite2
OTHER_FILES += sqlite2.json
diff --git a/src/plugins/sqldrivers/tds/tds.pro b/src/plugins/sqldrivers/tds/tds.pro
index b5d32ae5a8..67bc0f5c48 100644
--- a/src/plugins/sqldrivers/tds/tds.pro
+++ b/src/plugins/sqldrivers/tds/tds.pro
@@ -3,13 +3,7 @@ TARGET = qsqltds
HEADERS += $$PWD/qsql_tds_p.h
SOURCES += $$PWD/qsql_tds.cpp $$PWD/main.cpp
-unix|mingw: {
- LIBS += $$QMAKE_LIBS_TDS
- !contains(LIBS, .*sybdb.*):LIBS += -lsybdb
- QMAKE_CXXFLAGS *= $$QMAKE_CFLAGS_TDS
-} else {
- LIBS *= -lNTWDBLIB
-}
+QMAKE_USE += tds
OTHER_FILES += tds.json
diff --git a/src/printsupport/dialogs/qabstractprintdialog.cpp b/src/printsupport/dialogs/qabstractprintdialog.cpp
index 7547e31a9e..3c5f882f2e 100644
--- a/src/printsupport/dialogs/qabstractprintdialog.cpp
+++ b/src/printsupport/dialogs/qabstractprintdialog.cpp
@@ -393,13 +393,13 @@ void QAbstractPrintDialogPrivate::setPrinter(QPrinter *newPrinter)
settings for each available printer can be modified via the dialog's
\uicontrol{Properties} push button.
- On Windows and OS X, the native print dialog is used, which means that
+ On Windows and \macos, the native print dialog is used, which means that
some QWidget and QDialog properties set on the dialog won't be respected.
- The native print dialog on OS X does not support setting printer options,
+ The native print dialog on \macos does not support setting printer options,
i.e. setOptions() and setOption() have no effect.
In Qt 4.4, it was possible to use the static functions to show a sheet on
- OS X. This is no longer supported in Qt 4.5. If you want this
+ \macos. This is no longer supported in Qt 4.5. If you want this
functionality, use QPrintDialog::open().
\sa QPageSetupDialog, QPrinter
@@ -459,7 +459,7 @@ void QAbstractPrintDialog::setOptionTabs(const QList<QWidget*> &tabs)
and exec() to return \a result.
\note This function does not apply to the Native Print Dialog on the Mac
- OS X and Windows platforms, because the dialog is required to be modal
+ \macos and Windows platforms, because the dialog is required to be modal
and only the user can close it.
\sa QDialog::done()
diff --git a/src/printsupport/dialogs/qpagesetupdialog.cpp b/src/printsupport/dialogs/qpagesetupdialog.cpp
index cfc391ef43..81cbf87777 100644
--- a/src/printsupport/dialogs/qpagesetupdialog.cpp
+++ b/src/printsupport/dialogs/qpagesetupdialog.cpp
@@ -56,12 +56,12 @@ QT_BEGIN_NAMESPACE
\ingroup printing
\inmodule QtPrintSupport
- On Windows and OS X the page setup dialog is implemented using
+ On Windows and \macos the page setup dialog is implemented using
the native page setup dialogs.
- Note that on Windows and OS X custom paper sizes won't be
+ Note that on Windows and \macos custom paper sizes won't be
reflected in the native page setup dialogs. Additionally, custom
- page margins set on a QPrinter won't show in the native OS X
+ page margins set on a QPrinter won't show in the native \macos
page setup dialog.
\sa QPrinter, QPrintDialog
diff --git a/src/printsupport/kernel/kernel.pri b/src/printsupport/kernel/kernel.pri
index bf95d9e8f6..22d12e4cc3 100644
--- a/src/printsupport/kernel/kernel.pri
+++ b/src/printsupport/kernel/kernel.pri
@@ -33,7 +33,7 @@ win32 {
LIBS_PRIVATE += -lwinspool -lcomdlg32 -lgdi32 -luser32
}
-unix:!mac:contains(QT_CONFIG, cups): {
+unix:!darwin:qtConfig(cups) {
SOURCES += $$PWD/qcups.cpp
HEADERS += $$PWD/qcups_p.h
}
diff --git a/src/printsupport/kernel/qprinter.cpp b/src/printsupport/kernel/qprinter.cpp
index 584be11199..6d6d61b343 100644
--- a/src/printsupport/kernel/qprinter.cpp
+++ b/src/printsupport/kernel/qprinter.cpp
@@ -318,7 +318,7 @@ public:
features, such as orientation and resolution, and to step through
the pages in a document as it is generated.
- When printing directly to a printer on Windows or OS X, QPrinter uses
+ When printing directly to a printer on Windows or \macos, QPrinter uses
the built-in printer drivers. On X11, QPrinter uses the
\l{Common Unix Printing System (CUPS)}
to send PDF output to the printer. As an alternative,
@@ -916,7 +916,7 @@ QString QPrinter::outputFileName() const
QPrinter uses Qt's cross-platform PDF print engines
respectively. If you can produce this format natively, for example
- OS X can generate PDF's from its print engine, set the output format
+ \macos can generate PDF's from its print engine, set the output format
back to NativeFormat.
\sa outputFileName(), setOutputFormat()
@@ -1386,7 +1386,7 @@ QPrinter::ColorMode QPrinter::colorMode() const
\obsolete
Returns the number of copies to be printed. The default value is 1.
- On Windows, OS X and X11 systems that support CUPS, this will always
+ On Windows, \macos and X11 systems that support CUPS, this will always
return 1 as these operating systems can internally handle the number
of copies.
diff --git a/src/printsupport/widgets/widgets.pri b/src/printsupport/widgets/widgets.pri
index 8e5cb12a6d..8a98da1718 100644
--- a/src/printsupport/widgets/widgets.pri
+++ b/src/printsupport/widgets/widgets.pri
@@ -1,7 +1,7 @@
HEADERS += widgets/qprintpreviewwidget.h
SOURCES += widgets/qprintpreviewwidget.cpp
-unix:!mac:contains(QT_CONFIG, cups): {
+unix:!darwin:qtConfig(cups) {
HEADERS += widgets/qcupsjobwidget_p.h
SOURCES += widgets/qcupsjobwidget.cpp
FORMS += widgets/qcupsjobwidget.ui
diff --git a/src/sql/doc/src/qtsql.qdoc b/src/sql/doc/src/qtsql.qdoc
index 9d3a8fbfed..56d714becf 100644
--- a/src/sql/doc/src/qtsql.qdoc
+++ b/src/sql/doc/src/qtsql.qdoc
@@ -51,6 +51,19 @@
QT += sql
\endcode
+ \section1 Licenses and Attributions
+
+ Qt SQL is available under commercial licenses from \l{The Qt Company}.
+ In addition, it is available under the
+ \l{GNU Lesser General Public License, version 3}, or
+ the \l{GNU General Public License, version 2}.
+ See \l{Qt Licensing} for further details.
+
+ Furthermore Qt SQL potentially contains third party
+ modules under following permissive licenses:
+
+ \generatelist{groupsbymodule attributions-qtsql}
+
\section1 Related Information
These are links to the API reference materials and related pages.
diff --git a/src/sql/doc/src/sql-driver.qdoc b/src/sql/doc/src/sql-driver.qdoc
index ddf6e74618..a33f60b561 100644
--- a/src/sql/doc/src/sql-driver.qdoc
+++ b/src/sql/doc/src/sql-driver.qdoc
@@ -77,7 +77,7 @@
\target building
\section1 Building the Drivers Using Configure
- On Unix and OS X, the Qt \c configure script tries to
+ On Unix and \macos, the Qt \c configure script tries to
automatically detect the available client libraries on your
machine. Run \c{configure -help} to see what drivers can be
built. You should get an output similar to this:
@@ -139,7 +139,7 @@
Please refer to the MySQL documentation, chapter "libmysqld, the Embedded
MySQL Server Library" for more information about the MySQL embedded server.
- \section3 How to Build the QMYSQL Plugin on Unix and OS X
+ \section3 How to Build the QMYSQL Plugin on Unix and \macos
You need the MySQL header files and as well as the shared library
\c{libmysqlclient.so}. Depending on your Linux distribution you may
@@ -208,7 +208,7 @@
BLOBs are bound to placeholders or QSqlTableModel, which uses a prepared
query to do this internally.
- \section3 How to Build the OCI Plugin on Unix and OS X
+ \section3 How to Build the OCI Plugin on Unix and \macos
For Oracle 10g, all you need is the "Instant Client Package - Basic" and
"Instant Client Package - SDK". For Oracle prior to 10g, you require
@@ -343,7 +343,7 @@
"SQL_WCHAR support" in the ODBC driver manager otherwise Oracle
will convert all Unicode strings to local 8-bit.
- \section3 How to Build the ODBC Plugin on Unix and OS X
+ \section3 How to Build the ODBC Plugin on Unix and \macos
It is recommended that you use unixODBC. You can find the latest
version and ODBC drivers at \l http://www.unixodbc.org.
@@ -400,7 +400,7 @@
Binary Large Objects are supported through the \c BYTEA field type in
PostgreSQL server versions >= 7.1.
- \section3 How to Build the QPSQL Plugin on Unix and OS X
+ \section3 How to Build the QPSQL Plugin on Unix and \macos
You need the PostgreSQL client library and headers installed.
@@ -440,7 +440,7 @@
Sybase client library. Refer to the Sybase documentation for information on how to set up
a Sybase client configuration file to enable connections to databases on non-default ports.
- \section3 How to Build the QTDS Plugin on Unix and OS X
+ \section3 How to Build the QTDS Plugin on Unix and \macos
Under Unix, two libraries are available which support the TDS protocol:
@@ -493,7 +493,7 @@
We suggest using a forward-only query when calling stored procedures
in DB2 (see QSqlQuery::setForwardOnly()).
- \section3 How to Build the QDB2 Plugin on Unix and OS X
+ \section3 How to Build the QDB2 Plugin on Unix and \macos
\snippet code/doc_src_sql-driver.qdoc 18
@@ -643,7 +643,7 @@
\snippet code/doc_src_sql-driver.cpp 26
- \section3 How to Build the QIBASE Plugin on Unix and OS X
+ \section3 How to Build the QIBASE Plugin on Unix and \macos
The following assumes InterBase or Firebird is installed in
\c{/opt/interbase}:
diff --git a/src/src.pro b/src/src.pro
index c4da871abe..ec656e483c 100644
--- a/src/src.pro
+++ b/src/src.pro
@@ -1,7 +1,5 @@
TEMPLATE = subdirs
-load(qfeatures)
-
src_qtzlib.file = $$PWD/corelib/qtzlib.pro
src_qtzlib.target = sub-zlib
@@ -132,9 +130,9 @@ src_plugins.depends = src_sql src_xml src_network
src_android.subdir = $$PWD/android
# this order is important
-!contains(QT_CONFIG, system-zlib)|cross_compile {
+!qtConfig(system-zlib)|cross_compile {
SUBDIRS += src_qtzlib
- !contains(QT_CONFIG, system-zlib) {
+ !qtConfig(system-zlib) {
src_3rdparty_libpng.depends += src_corelib
src_3rdparty_freetype.depends += src_corelib
}
@@ -148,44 +146,44 @@ SUBDIRS += src_corelib src_tools_qlalr
TOOLS = src_tools_moc src_tools_rcc src_tools_qlalr
win32:SUBDIRS += src_winmain
SUBDIRS += src_network src_sql src_xml src_testlib
-contains(QT_CONFIG, dbus) {
- force_bootstrap|contains(QT_CONFIG, private_tests): \
+qtConfig(dbus) {
+ force_bootstrap|qtConfig(private_tests): \
SUBDIRS += src_tools_bootstrap_dbus
SUBDIRS += src_dbus src_tools_qdbusxml2cpp src_tools_qdbuscpp2xml
TOOLS += src_tools_qdbusxml2cpp src_tools_qdbuscpp2xml
- contains(QT_CONFIG, accessibility-atspi-bridge): \
+ qtConfig(accessibility-atspi-bridge): \
src_platformsupport.depends += src_dbus src_tools_qdbusxml2cpp
src_plugins.depends += src_dbus src_tools_qdbusxml2cpp src_tools_qdbuscpp2xml
}
-contains(QT_CONFIG, concurrent):SUBDIRS += src_concurrent
-!contains(QT_CONFIG, no-gui) {
- contains(QT_CONFIG, harfbuzz):!contains(QT_CONFIG, system-harfbuzz) {
+qtConfig(concurrent): SUBDIRS += src_concurrent
+qtConfig(gui) {
+ qtConfig(harfbuzz):!qtConfig(system-harfbuzz) {
SUBDIRS += src_3rdparty_harfbuzzng
src_gui.depends += src_3rdparty_harfbuzzng
}
- contains(QT_CONFIG, angle) {
+ qtConfig(angle) {
SUBDIRS += src_angle
src_gui.depends += src_angle
}
- contains(QT_CONFIG, png) {
+ qtConfig(png) {
SUBDIRS += src_3rdparty_libpng
src_3rdparty_freetype.depends += src_3rdparty_libpng
src_gui.depends += src_3rdparty_libpng
}
- contains(QT_CONFIG, freetype):!contains(QT_CONFIG, system-freetype) {
+ qtConfig(freetype):!qtConfig(system-freetype) {
SUBDIRS += src_3rdparty_freetype
src_platformsupport.depends += src_3rdparty_freetype
}
SUBDIRS += src_gui src_platformsupport src_platformheaders
- contains(QT_CONFIG, opengl(es2)?):SUBDIRS += src_openglextensions
+ qtConfig(opengl(es2)?): SUBDIRS += src_openglextensions
src_plugins.depends += src_gui src_platformsupport src_platformheaders
src_testlib.depends += src_gui # if QtGui is enabled, QtTest requires QtGui's headers
- !contains(QT_CONFIG, no-widgets) {
+ qtConfig(widgets) {
SUBDIRS += src_tools_uic src_widgets
TOOLS += src_tools_uic
src_plugins.depends += src_widgets
src_testlib.depends += src_widgets # if QtWidgets is enabled, QtTest requires QtWidgets's headers
- contains(QT_CONFIG, opengl(es2)?) {
+ qtConfig(opengl(es2)?) {
SUBDIRS += src_opengl
src_plugins.depends += src_opengl
}
diff --git a/src/testlib/doc/src/qttestlib-manual.qdoc b/src/testlib/doc/src/qttestlib-manual.qdoc
index 624c314f6c..a420ec4761 100644
--- a/src/testlib/doc/src/qttestlib-manual.qdoc
+++ b/src/testlib/doc/src/qttestlib-manual.qdoc
@@ -317,7 +317,7 @@
\li All platforms
\row \li CPU tick counter
\li -tickcounter
- \li Windows, OS X, Linux, many UNIX-like systems.
+ \li Windows, \macos, Linux, many UNIX-like systems.
\row \li Event Counter
\li -eventcounter
\li All platforms
diff --git a/src/testlib/qtestblacklist.cpp b/src/testlib/qtestblacklist.cpp
index 1fa76a692a..3fec0ad98a 100644
--- a/src/testlib/qtestblacklist.cpp
+++ b/src/testlib/qtestblacklist.cpp
@@ -106,6 +106,9 @@ static QSet<QByteArray> keywords()
#ifdef Q_OS_TVOS
<< "tvos"
#endif
+#ifdef Q_OS_WATCHOS
+ << "watchos"
+#endif
#ifdef Q_OS_ANDROID
<< "android"
#endif
diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp
index 05d1592a60..1fc5a36d66 100644
--- a/src/testlib/qtestcase.cpp
+++ b/src/testlib/qtestcase.cpp
@@ -1294,8 +1294,13 @@ void TestMethods::invokeTests(QObject *testObject) const
m_initTestCaseDataMethod.invoke(testObject, Qt::DirectConnection);
QScopedPointer<WatchDog> watchDog;
- if (!debuggerPresent())
+ if (!debuggerPresent()
+#ifdef QTESTLIB_USE_VALGRIND
+ && QBenchmarkGlobalData::current->mode() != QBenchmarkGlobalData::CallgrindChildProcess
+#endif
+ ) {
watchDog.reset(new WatchDog);
+ }
if (!QTestResult::skipCurrentTest() && !QTest::currentTestFailed()) {
if (m_initTestCaseMethod.isValid())
@@ -1383,7 +1388,7 @@ FatalSignalHandler::FatalSignalHandler()
// tvOS/watchOS both define SA_ONSTACK (in sys/signal.h) but mark sigaltstack() as
// unavailable (__WATCHOS_PROHIBITED __TVOS_PROHIBITED in signal.h)
-#if defined(SA_ONSTACK) && !defined(Q_OS_TVOS)
+#if defined(SA_ONSTACK) && !defined(Q_OS_TVOS) && !defined(Q_OS_WATCHOS)
// Let the signal handlers use an alternate stack
// This is necessary if SIGSEGV is to catch a stack overflow
# if defined(Q_CC_GNU) && defined(Q_OF_ELF)
diff --git a/src/testlib/qtesttouch.h b/src/testlib/qtesttouch.h
index 11aa14c268..bda185bfee 100644
--- a/src/testlib/qtesttouch.h
+++ b/src/testlib/qtesttouch.h
@@ -130,6 +130,7 @@ namespace QTest
void commit(bool processEvents = true)
{
if (!points.isEmpty()) {
+ qSleep(1);
if (targetWindow)
{
qt_handleTouchEvent(targetWindow, device, points.values());
diff --git a/src/tools/bootstrap/bootstrap.pro b/src/tools/bootstrap/bootstrap.pro
index f763d0c8fe..d544288031 100644
--- a/src/tools/bootstrap/bootstrap.pro
+++ b/src/tools/bootstrap/bootstrap.pro
@@ -6,6 +6,10 @@ CONFIG += minimal_syncqt internal_module force_bootstrap
MODULE_INCNAME = QtCore QtXml
MODULE_DEFINES = \
+ QT_VERSION_STR=$$shell_quote(\"$$QT_VERSION\") \
+ QT_VERSION_MAJOR=$$QT_MAJOR_VERSION \
+ QT_VERSION_MINOR=$$QT_MINOR_VERSION \
+ QT_VERSION_PATCH=$$QT_PATCH_VERSION \
QT_BOOTSTRAPPED \
QT_LITE_UNICODE \
QT_NO_CAST_TO_ASCII \
@@ -134,7 +138,7 @@ macx {
../../corelib/io/qstandardpaths_win.cpp
}
-!contains(QT_CONFIG, system-zlib)|cross_compile {
+!qtConfig(system-zlib)|cross_compile {
include(../../3rdparty/zlib.pri)
} else {
CONFIG += no_core_dep
diff --git a/src/tools/moc/keywords.cpp b/src/tools/moc/keywords.cpp
index 4f1d16d2c5..07c59d155f 100644
--- a/src/tools/moc/keywords.cpp
+++ b/src/tools/moc/keywords.cpp
@@ -30,12 +30,12 @@
// DO NOT EDIT.
static const short keyword_trans[][128] = {
- {0,0,0,0,0,0,0,0,0,546,543,0,0,0,0,0,
+ {0,0,0,0,0,0,0,0,0,561,558,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 546,252,544,547,8,38,239,545,25,26,236,234,30,235,27,237,
+ 561,252,559,562,8,38,239,560,25,26,236,234,30,235,27,237,
22,22,22,22,22,22,22,22,22,22,34,41,23,39,24,43,
0,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
- 8,21,8,8,8,8,8,8,8,8,8,31,549,32,238,8,
+ 8,21,8,8,8,8,8,8,8,8,8,31,564,32,238,8,
0,1,2,3,4,5,6,7,8,9,8,8,10,11,12,13,
14,8,15,16,17,18,19,20,8,8,8,36,245,37,248,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
@@ -116,7 +116,7 @@ static const short keyword_trans[][128] = {
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,290,222,0,0,475,0,0,0,
+ 0,0,0,0,0,0,0,0,290,222,0,0,490,0,0,0,
0,0,0,0,55,0,0,330,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
@@ -155,7 +155,7 @@ static const short keyword_trans[][128] = {
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,499,0,0,0,0,0,0,0,0,0,0,357,
+ 0,0,0,0,514,0,0,0,0,0,0,0,0,0,0,357,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
@@ -177,7 +177,7 @@ static const short keyword_trans[][128] = {
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,42,0,0,0,28,0,
- 552,552,552,552,552,552,552,552,552,552,0,0,0,0,0,0,
+ 567,567,567,567,567,567,567,567,567,567,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
@@ -336,7 +336,7 @@ static const short keyword_trans[][128] = {
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,551,0,0,0,0,550,
+ 0,0,0,0,0,0,0,0,0,0,566,0,0,0,0,565,
0,0,0,0,0,0,0,0,0,0,0,0,0,258,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
@@ -372,29 +372,29 @@ static const short keyword_trans[][128] = {
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,472,0,0,0,300,0,0,0,0,0,0,0,0,0,0,
+ 0,487,0,0,0,300,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,453,402,392,397,364,0,462,0,0,0,0,0,358,
- 370,0,535,450,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,468,417,401,409,373,0,477,0,0,0,0,364,358,
+ 379,0,550,465,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,378,0,0,0,
- 0,0,371,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,387,0,0,0,
+ 0,0,380,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,489,0,0,0,0,0,372,
+ 0,0,0,0,0,0,0,0,0,504,0,0,0,0,0,381,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
@@ -402,32 +402,48 @@ static const short keyword_trans[][128] = {
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,432,410,0,0,415,0,0,0,424,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,405,0,0,0,0,0,0,0,0,0,0,0,406,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,518,0,451,0,0,0,479,0,0,485,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,413,0,0,0,0,0,0,0,0,0,0,0,414,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,447,425,0,0,430,0,0,0,439,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,464,0,511,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,533,0,466,0,0,0,494,0,0,500,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 527,0,0,495,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
+ {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,479,0,526,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
+ {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 542,0,0,510,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
};
@@ -805,189 +821,204 @@ static const struct
{CHARACTER, 0, 84, 363, CHARACTER},
{Q_OBJECT_TOKEN, 0, 0, 0, CHARACTER},
{CHARACTER, 0, 65, 365, CHARACTER},
- {CHARACTER, 0, 68, 366, CHARACTER},
- {CHARACTER, 0, 71, 367, CHARACTER},
- {CHARACTER, 0, 69, 368, CHARACTER},
- {CHARACTER, 0, 84, 369, CHARACTER},
+ {CHARACTER, 0, 77, 366, CHARACTER},
+ {CHARACTER, 0, 69, 367, CHARACTER},
+ {CHARACTER, 0, 83, 368, CHARACTER},
+ {CHARACTER, 0, 80, 369, CHARACTER},
+ {CHARACTER, 0, 65, 370, CHARACTER},
+ {CHARACTER, 0, 67, 371, CHARACTER},
+ {CHARACTER, 0, 69, 372, CHARACTER},
+ {Q_NAMESPACE_TOKEN, 0, 0, 0, CHARACTER},
+ {CHARACTER, 0, 65, 374, CHARACTER},
+ {CHARACTER, 0, 68, 375, CHARACTER},
+ {CHARACTER, 0, 71, 376, CHARACTER},
+ {CHARACTER, 0, 69, 377, CHARACTER},
+ {CHARACTER, 0, 84, 378, CHARACTER},
{Q_GADGET_TOKEN, 0, 0, 0, CHARACTER},
{CHARACTER, 44, 0, 0, CHARACTER},
{CHARACTER, 45, 0, 0, CHARACTER},
- {CHARACTER, 0, 80, 373, CHARACTER},
- {CHARACTER, 0, 69, 374, CHARACTER},
- {CHARACTER, 0, 82, 375, CHARACTER},
- {CHARACTER, 0, 84, 376, CHARACTER},
- {CHARACTER, 0, 89, 377, CHARACTER},
+ {CHARACTER, 0, 80, 382, CHARACTER},
+ {CHARACTER, 0, 69, 383, CHARACTER},
+ {CHARACTER, 0, 82, 384, CHARACTER},
+ {CHARACTER, 0, 84, 385, CHARACTER},
+ {CHARACTER, 0, 89, 386, CHARACTER},
{Q_PROPERTY_TOKEN, 0, 0, 0, CHARACTER},
- {CHARACTER, 0, 85, 379, CHARACTER},
- {CHARACTER, 0, 71, 380, CHARACTER},
- {CHARACTER, 0, 73, 381, CHARACTER},
- {CHARACTER, 0, 78, 382, CHARACTER},
- {CHARACTER, 0, 95, 383, CHARACTER},
- {CHARACTER, 0, 77, 384, CHARACTER},
- {CHARACTER, 0, 69, 385, CHARACTER},
- {CHARACTER, 0, 84, 386, CHARACTER},
- {CHARACTER, 0, 65, 387, CHARACTER},
- {CHARACTER, 0, 68, 388, CHARACTER},
- {CHARACTER, 0, 65, 389, CHARACTER},
- {CHARACTER, 0, 84, 390, CHARACTER},
- {CHARACTER, 0, 65, 391, CHARACTER},
+ {CHARACTER, 0, 85, 388, CHARACTER},
+ {CHARACTER, 0, 71, 389, CHARACTER},
+ {CHARACTER, 0, 73, 390, CHARACTER},
+ {CHARACTER, 0, 78, 391, CHARACTER},
+ {CHARACTER, 0, 95, 392, CHARACTER},
+ {CHARACTER, 0, 77, 393, CHARACTER},
+ {CHARACTER, 0, 69, 394, CHARACTER},
+ {CHARACTER, 0, 84, 395, CHARACTER},
+ {CHARACTER, 0, 65, 396, CHARACTER},
+ {CHARACTER, 0, 68, 397, CHARACTER},
+ {CHARACTER, 0, 65, 398, CHARACTER},
+ {CHARACTER, 0, 84, 399, CHARACTER},
+ {CHARACTER, 0, 65, 400, CHARACTER},
{Q_PLUGIN_METADATA_TOKEN, 0, 0, 0, CHARACTER},
- {CHARACTER, 0, 78, 393, CHARACTER},
- {CHARACTER, 0, 85, 394, CHARACTER},
- {CHARACTER, 0, 77, 395, CHARACTER},
- {Q_ENUM_TOKEN, 0, 83, 396, CHARACTER},
+ {CHARACTER, 0, 78, 402, CHARACTER},
+ {CHARACTER, 0, 85, 403, CHARACTER},
+ {CHARACTER, 0, 77, 404, CHARACTER},
+ {Q_ENUM_TOKEN, 46, 0, 0, CHARACTER},
{Q_ENUMS_TOKEN, 0, 0, 0, CHARACTER},
- {CHARACTER, 0, 76, 398, CHARACTER},
- {CHARACTER, 0, 65, 399, CHARACTER},
- {CHARACTER, 0, 71, 400, CHARACTER},
- {Q_FLAG_TOKEN, 0, 83, 401, CHARACTER},
+ {CHARACTER, 0, 78, 407, CHARACTER},
+ {CHARACTER, 0, 83, 408, CHARACTER},
+ {Q_ENUM_NS_TOKEN, 0, 0, 0, CHARACTER},
+ {CHARACTER, 0, 76, 410, CHARACTER},
+ {CHARACTER, 0, 65, 411, CHARACTER},
+ {CHARACTER, 0, 71, 412, CHARACTER},
+ {Q_FLAG_TOKEN, 47, 0, 0, CHARACTER},
{Q_FLAGS_TOKEN, 0, 0, 0, CHARACTER},
- {CHARACTER, 0, 69, 403, CHARACTER},
- {CHARACTER, 0, 67, 404, CHARACTER},
- {CHARACTER, 0, 76, 405, CHARACTER},
- {CHARACTER, 0, 65, 406, CHARACTER},
- {CHARACTER, 0, 82, 407, CHARACTER},
- {CHARACTER, 0, 69, 408, CHARACTER},
- {CHARACTER, 0, 95, 409, CHARACTER},
- {CHARACTER, 46, 0, 0, CHARACTER},
- {CHARACTER, 0, 76, 411, CHARACTER},
- {CHARACTER, 0, 65, 412, CHARACTER},
- {CHARACTER, 0, 71, 413, CHARACTER},
- {CHARACTER, 0, 83, 414, CHARACTER},
- {Q_DECLARE_FLAGS_TOKEN, 0, 0, 0, CHARACTER},
- {CHARACTER, 0, 78, 416, CHARACTER},
- {CHARACTER, 0, 84, 417, CHARACTER},
+ {CHARACTER, 0, 78, 415, CHARACTER},
+ {CHARACTER, 0, 83, 416, CHARACTER},
+ {Q_FLAG_NS_TOKEN, 0, 0, 0, CHARACTER},
{CHARACTER, 0, 69, 418, CHARACTER},
- {CHARACTER, 0, 82, 419, CHARACTER},
- {CHARACTER, 0, 70, 420, CHARACTER},
+ {CHARACTER, 0, 67, 419, CHARACTER},
+ {CHARACTER, 0, 76, 420, CHARACTER},
{CHARACTER, 0, 65, 421, CHARACTER},
- {CHARACTER, 0, 67, 422, CHARACTER},
+ {CHARACTER, 0, 82, 422, CHARACTER},
{CHARACTER, 0, 69, 423, CHARACTER},
- {Q_DECLARE_INTERFACE_TOKEN, 0, 0, 0, CHARACTER},
- {CHARACTER, 0, 69, 425, CHARACTER},
- {CHARACTER, 0, 84, 426, CHARACTER},
+ {CHARACTER, 0, 95, 424, CHARACTER},
+ {CHARACTER, 48, 0, 0, CHARACTER},
+ {CHARACTER, 0, 76, 426, CHARACTER},
{CHARACTER, 0, 65, 427, CHARACTER},
- {CHARACTER, 0, 84, 428, CHARACTER},
- {CHARACTER, 0, 89, 429, CHARACTER},
- {CHARACTER, 0, 80, 430, CHARACTER},
- {CHARACTER, 0, 69, 431, CHARACTER},
+ {CHARACTER, 0, 71, 428, CHARACTER},
+ {CHARACTER, 0, 83, 429, CHARACTER},
+ {Q_DECLARE_FLAGS_TOKEN, 0, 0, 0, CHARACTER},
+ {CHARACTER, 0, 78, 431, CHARACTER},
+ {CHARACTER, 0, 84, 432, CHARACTER},
+ {CHARACTER, 0, 69, 433, CHARACTER},
+ {CHARACTER, 0, 82, 434, CHARACTER},
+ {CHARACTER, 0, 70, 435, CHARACTER},
+ {CHARACTER, 0, 65, 436, CHARACTER},
+ {CHARACTER, 0, 67, 437, CHARACTER},
+ {CHARACTER, 0, 69, 438, CHARACTER},
+ {Q_DECLARE_INTERFACE_TOKEN, 0, 0, 0, CHARACTER},
+ {CHARACTER, 0, 69, 440, CHARACTER},
+ {CHARACTER, 0, 84, 441, CHARACTER},
+ {CHARACTER, 0, 65, 442, CHARACTER},
+ {CHARACTER, 0, 84, 443, CHARACTER},
+ {CHARACTER, 0, 89, 444, CHARACTER},
+ {CHARACTER, 0, 80, 445, CHARACTER},
+ {CHARACTER, 0, 69, 446, CHARACTER},
{Q_DECLARE_METATYPE_TOKEN, 0, 0, 0, CHARACTER},
- {CHARACTER, 0, 88, 433, CHARACTER},
- {CHARACTER, 0, 84, 434, CHARACTER},
- {CHARACTER, 0, 69, 435, CHARACTER},
- {CHARACTER, 0, 78, 436, CHARACTER},
- {CHARACTER, 0, 83, 437, CHARACTER},
- {CHARACTER, 0, 73, 438, CHARACTER},
- {CHARACTER, 0, 79, 439, CHARACTER},
- {CHARACTER, 0, 78, 440, CHARACTER},
- {CHARACTER, 0, 95, 441, CHARACTER},
- {CHARACTER, 0, 73, 442, CHARACTER},
- {CHARACTER, 0, 78, 443, CHARACTER},
- {CHARACTER, 0, 84, 444, CHARACTER},
- {CHARACTER, 0, 69, 445, CHARACTER},
- {CHARACTER, 0, 82, 446, CHARACTER},
- {CHARACTER, 0, 70, 447, CHARACTER},
- {CHARACTER, 0, 65, 448, CHARACTER},
- {CHARACTER, 0, 67, 449, CHARACTER},
- {CHARACTER, 0, 69, 423, CHARACTER},
- {CHARACTER, 47, 0, 0, CHARACTER},
- {CHARACTER, 0, 84, 452, CHARACTER},
- {CHARACTER, 0, 83, 401, CHARACTER},
- {CHARACTER, 0, 76, 454, CHARACTER},
- {CHARACTER, 0, 65, 455, CHARACTER},
- {CHARACTER, 0, 83, 456, CHARACTER},
- {CHARACTER, 0, 83, 457, CHARACTER},
- {CHARACTER, 0, 73, 458, CHARACTER},
- {CHARACTER, 0, 78, 459, CHARACTER},
- {CHARACTER, 0, 70, 460, CHARACTER},
- {CHARACTER, 0, 79, 461, CHARACTER},
- {Q_CLASSINFO_TOKEN, 0, 0, 0, CHARACTER},
- {CHARACTER, 0, 78, 463, CHARACTER},
- {CHARACTER, 48, 0, 0, CHARACTER},
- {CHARACTER, 0, 69, 465, CHARACTER},
- {CHARACTER, 0, 82, 466, CHARACTER},
- {CHARACTER, 0, 70, 467, CHARACTER},
- {CHARACTER, 0, 65, 468, CHARACTER},
- {CHARACTER, 0, 67, 469, CHARACTER},
- {CHARACTER, 0, 69, 470, CHARACTER},
+ {CHARACTER, 0, 88, 448, CHARACTER},
+ {CHARACTER, 0, 84, 449, CHARACTER},
+ {CHARACTER, 0, 69, 450, CHARACTER},
+ {CHARACTER, 0, 78, 451, CHARACTER},
+ {CHARACTER, 0, 83, 452, CHARACTER},
+ {CHARACTER, 0, 73, 453, CHARACTER},
+ {CHARACTER, 0, 79, 454, CHARACTER},
+ {CHARACTER, 0, 78, 455, CHARACTER},
+ {CHARACTER, 0, 95, 456, CHARACTER},
+ {CHARACTER, 0, 73, 457, CHARACTER},
+ {CHARACTER, 0, 78, 458, CHARACTER},
+ {CHARACTER, 0, 84, 459, CHARACTER},
+ {CHARACTER, 0, 69, 460, CHARACTER},
+ {CHARACTER, 0, 82, 461, CHARACTER},
+ {CHARACTER, 0, 70, 462, CHARACTER},
+ {CHARACTER, 0, 65, 463, CHARACTER},
+ {CHARACTER, 0, 67, 464, CHARACTER},
+ {CHARACTER, 0, 69, 438, CHARACTER},
+ {CHARACTER, 49, 0, 0, CHARACTER},
+ {CHARACTER, 0, 84, 467, CHARACTER},
+ {CHARACTER, 0, 83, 413, CHARACTER},
+ {CHARACTER, 0, 76, 469, CHARACTER},
+ {CHARACTER, 0, 65, 470, CHARACTER},
{CHARACTER, 0, 83, 471, CHARACTER},
+ {CHARACTER, 0, 83, 472, CHARACTER},
+ {CHARACTER, 0, 73, 473, CHARACTER},
+ {CHARACTER, 0, 78, 474, CHARACTER},
+ {CHARACTER, 0, 70, 475, CHARACTER},
+ {CHARACTER, 0, 79, 476, CHARACTER},
+ {Q_CLASSINFO_TOKEN, 0, 0, 0, CHARACTER},
+ {CHARACTER, 0, 78, 478, CHARACTER},
+ {CHARACTER, 50, 0, 0, CHARACTER},
+ {CHARACTER, 0, 69, 480, CHARACTER},
+ {CHARACTER, 0, 82, 481, CHARACTER},
+ {CHARACTER, 0, 70, 482, CHARACTER},
+ {CHARACTER, 0, 65, 483, CHARACTER},
+ {CHARACTER, 0, 67, 484, CHARACTER},
+ {CHARACTER, 0, 69, 485, CHARACTER},
+ {CHARACTER, 0, 83, 486, CHARACTER},
{Q_INTERFACES_TOKEN, 0, 0, 0, CHARACTER},
- {CHARACTER, 0, 108, 473, CHARACTER},
- {CHARACTER, 0, 115, 474, CHARACTER},
+ {CHARACTER, 0, 108, 488, CHARACTER},
+ {CHARACTER, 0, 115, 489, CHARACTER},
{SIGNALS, 0, 0, 0, CHARACTER},
- {CHARACTER, 0, 111, 476, CHARACTER},
- {CHARACTER, 0, 116, 477, CHARACTER},
- {CHARACTER, 0, 115, 478, CHARACTER},
+ {CHARACTER, 0, 111, 491, CHARACTER},
+ {CHARACTER, 0, 116, 492, CHARACTER},
+ {CHARACTER, 0, 115, 493, CHARACTER},
{SLOTS, 0, 0, 0, CHARACTER},
- {CHARACTER, 0, 71, 480, CHARACTER},
- {CHARACTER, 0, 78, 481, CHARACTER},
- {CHARACTER, 0, 65, 482, CHARACTER},
- {CHARACTER, 0, 76, 483, CHARACTER},
- {Q_SIGNAL_TOKEN, 0, 83, 484, CHARACTER},
+ {CHARACTER, 0, 71, 495, CHARACTER},
+ {CHARACTER, 0, 78, 496, CHARACTER},
+ {CHARACTER, 0, 65, 497, CHARACTER},
+ {CHARACTER, 0, 76, 498, CHARACTER},
+ {Q_SIGNAL_TOKEN, 0, 83, 499, CHARACTER},
{Q_SIGNALS_TOKEN, 0, 0, 0, CHARACTER},
- {CHARACTER, 0, 79, 486, CHARACTER},
- {CHARACTER, 0, 84, 487, CHARACTER},
- {Q_SLOT_TOKEN, 0, 83, 488, CHARACTER},
+ {CHARACTER, 0, 79, 501, CHARACTER},
+ {CHARACTER, 0, 84, 502, CHARACTER},
+ {Q_SLOT_TOKEN, 0, 83, 503, CHARACTER},
{Q_SLOTS_TOKEN, 0, 0, 0, CHARACTER},
- {CHARACTER, 0, 86, 490, CHARACTER},
- {CHARACTER, 0, 65, 491, CHARACTER},
- {CHARACTER, 0, 84, 492, CHARACTER},
- {CHARACTER, 0, 69, 493, CHARACTER},
- {CHARACTER, 0, 95, 494, CHARACTER},
- {CHARACTER, 49, 0, 0, CHARACTER},
- {CHARACTER, 0, 76, 496, CHARACTER},
- {CHARACTER, 0, 79, 497, CHARACTER},
- {CHARACTER, 0, 84, 498, CHARACTER},
+ {CHARACTER, 0, 86, 505, CHARACTER},
+ {CHARACTER, 0, 65, 506, CHARACTER},
+ {CHARACTER, 0, 84, 507, CHARACTER},
+ {CHARACTER, 0, 69, 508, CHARACTER},
+ {CHARACTER, 0, 95, 509, CHARACTER},
+ {CHARACTER, 51, 0, 0, CHARACTER},
+ {CHARACTER, 0, 76, 511, CHARACTER},
+ {CHARACTER, 0, 79, 512, CHARACTER},
+ {CHARACTER, 0, 84, 513, CHARACTER},
{Q_PRIVATE_SLOT_TOKEN, 0, 0, 0, CHARACTER},
- {CHARACTER, 0, 95, 500, CHARACTER},
- {CHARACTER, 0, 77, 501, CHARACTER},
- {CHARACTER, 0, 79, 502, CHARACTER},
- {CHARACTER, 0, 67, 503, CHARACTER},
- {CHARACTER, 0, 95, 504, CHARACTER},
- {CHARACTER, 0, 67, 505, CHARACTER},
- {CHARACTER, 0, 79, 506, CHARACTER},
- {CHARACTER, 0, 77, 507, CHARACTER},
- {CHARACTER, 0, 80, 508, CHARACTER},
- {CHARACTER, 0, 65, 509, CHARACTER},
- {CHARACTER, 0, 84, 510, CHARACTER},
+ {CHARACTER, 0, 95, 515, CHARACTER},
+ {CHARACTER, 0, 77, 516, CHARACTER},
+ {CHARACTER, 0, 79, 517, CHARACTER},
+ {CHARACTER, 0, 67, 518, CHARACTER},
+ {CHARACTER, 0, 95, 519, CHARACTER},
+ {CHARACTER, 0, 67, 520, CHARACTER},
+ {CHARACTER, 0, 79, 521, CHARACTER},
+ {CHARACTER, 0, 77, 522, CHARACTER},
+ {CHARACTER, 0, 80, 523, CHARACTER},
+ {CHARACTER, 0, 65, 524, CHARACTER},
+ {CHARACTER, 0, 84, 525, CHARACTER},
{Q_MOC_COMPAT_TOKEN, 0, 0, 0, CHARACTER},
- {CHARACTER, 0, 79, 512, CHARACTER},
- {CHARACTER, 0, 75, 513, CHARACTER},
- {CHARACTER, 0, 65, 514, CHARACTER},
- {CHARACTER, 0, 66, 515, CHARACTER},
- {CHARACTER, 0, 76, 516, CHARACTER},
- {CHARACTER, 0, 69, 517, CHARACTER},
+ {CHARACTER, 0, 79, 527, CHARACTER},
+ {CHARACTER, 0, 75, 528, CHARACTER},
+ {CHARACTER, 0, 65, 529, CHARACTER},
+ {CHARACTER, 0, 66, 530, CHARACTER},
+ {CHARACTER, 0, 76, 531, CHARACTER},
+ {CHARACTER, 0, 69, 532, CHARACTER},
{Q_INVOKABLE_TOKEN, 0, 0, 0, CHARACTER},
- {CHARACTER, 0, 82, 519, CHARACTER},
- {CHARACTER, 0, 73, 520, CHARACTER},
- {CHARACTER, 0, 80, 521, CHARACTER},
- {CHARACTER, 0, 84, 522, CHARACTER},
- {CHARACTER, 0, 65, 523, CHARACTER},
- {CHARACTER, 0, 66, 524, CHARACTER},
- {CHARACTER, 0, 76, 525, CHARACTER},
- {CHARACTER, 0, 69, 526, CHARACTER},
+ {CHARACTER, 0, 82, 534, CHARACTER},
+ {CHARACTER, 0, 73, 535, CHARACTER},
+ {CHARACTER, 0, 80, 536, CHARACTER},
+ {CHARACTER, 0, 84, 537, CHARACTER},
+ {CHARACTER, 0, 65, 538, CHARACTER},
+ {CHARACTER, 0, 66, 539, CHARACTER},
+ {CHARACTER, 0, 76, 540, CHARACTER},
+ {CHARACTER, 0, 69, 541, CHARACTER},
{Q_SCRIPTABLE_TOKEN, 0, 0, 0, CHARACTER},
- {CHARACTER, 0, 82, 528, CHARACTER},
- {CHARACTER, 0, 79, 529, CHARACTER},
- {CHARACTER, 0, 80, 530, CHARACTER},
- {CHARACTER, 0, 69, 531, CHARACTER},
- {CHARACTER, 0, 82, 532, CHARACTER},
- {CHARACTER, 0, 84, 533, CHARACTER},
- {CHARACTER, 0, 89, 534, CHARACTER},
+ {CHARACTER, 0, 82, 543, CHARACTER},
+ {CHARACTER, 0, 79, 544, CHARACTER},
+ {CHARACTER, 0, 80, 545, CHARACTER},
+ {CHARACTER, 0, 69, 546, CHARACTER},
+ {CHARACTER, 0, 82, 547, CHARACTER},
+ {CHARACTER, 0, 84, 548, CHARACTER},
+ {CHARACTER, 0, 89, 549, CHARACTER},
{Q_PRIVATE_PROPERTY_TOKEN, 0, 0, 0, CHARACTER},
- {CHARACTER, 0, 69, 536, CHARACTER},
- {CHARACTER, 0, 86, 537, CHARACTER},
- {CHARACTER, 0, 73, 538, CHARACTER},
- {CHARACTER, 0, 83, 539, CHARACTER},
- {CHARACTER, 0, 73, 540, CHARACTER},
- {CHARACTER, 0, 79, 541, CHARACTER},
- {CHARACTER, 0, 78, 542, CHARACTER},
+ {CHARACTER, 0, 69, 551, CHARACTER},
+ {CHARACTER, 0, 86, 552, CHARACTER},
+ {CHARACTER, 0, 73, 553, CHARACTER},
+ {CHARACTER, 0, 83, 554, CHARACTER},
+ {CHARACTER, 0, 73, 555, CHARACTER},
+ {CHARACTER, 0, 79, 556, CHARACTER},
+ {CHARACTER, 0, 78, 557, CHARACTER},
{Q_REVISION_TOKEN, 0, 0, 0, CHARACTER},
{NEWLINE, 0, 0, 0, NOTOKEN},
{QUOTE, 0, 0, 0, NOTOKEN},
{SINGLEQUOTE, 0, 0, 0, NOTOKEN},
{WHITESPACE, 0, 0, 0, NOTOKEN},
- {HASH, 0, 35, 548, HASH},
+ {HASH, 0, 35, 563, HASH},
{PP_HASHHASH, 0, 0, 0, NOTOKEN},
{BACKSLASH, 0, 0, 0, NOTOKEN},
{CPP_COMMENT, 0, 0, 0, NOTOKEN},
diff --git a/src/tools/moc/moc.cpp b/src/tools/moc/moc.cpp
index afe64bb889..22207a9030 100644
--- a/src/tools/moc/moc.cpp
+++ b/src/tools/moc/moc.cpp
@@ -554,14 +554,51 @@ void Moc::parse()
until(SEMIC);
} else if (!test(SEMIC)) {
NamespaceDef def;
- def.name = lexem();
+ def.classname = lexem();
next(LBRACE);
def.begin = index - 1;
until(RBRACE);
def.end = index;
index = def.begin + 1;
+ while (inNamespace(&def) && hasNext()) {
+ switch (next()) {
+ case Q_NAMESPACE_TOKEN:
+ def.hasQNamespace = true;
+ break;
+ case Q_ENUMS_TOKEN:
+ case Q_ENUM_NS_TOKEN:
+ parseEnumOrFlag(&def, false);
+ break;
+ case Q_FLAGS_TOKEN:
+ case Q_FLAG_NS_TOKEN:
+ parseEnumOrFlag(&def, true);
+ break;
+ case Q_DECLARE_FLAGS_TOKEN:
+ parseFlag(&def);
+ break;
+ case Q_CLASSINFO_TOKEN:
+ parseClassInfo(&def);
+ break;
+ case ENUM: {
+ EnumDef enumDef;
+ if (parseEnum(&enumDef))
+ def.enumList += enumDef;
+ } break;
+ case CLASS:
+ case STRUCT: {
+ ClassDef classdef;
+ if (!parseClassHead(&classdef))
+ continue;
+ while (inClass(&classdef) && hasNext())
+ next(); // consume all Q_XXXX macros from this class
+ } break;
+ default: break;
+ }
+ }
namespaceList += def;
index = rewind;
+ if (!def.hasQNamespace && (!def.classInfoList.isEmpty() || !def.enumDeclarations.isEmpty()))
+ error("Namespace declaration lacks Q_NAMESPACE macro.");
}
}
break;
@@ -618,7 +655,7 @@ void Moc::parse()
for (int i = namespaceList.size() - 1; i >= 0; --i)
if (inNamespace(&namespaceList.at(i)))
- def.qualified.prepend(namespaceList.at(i).name + "::");
+ def.qualified.prepend(namespaceList.at(i).classname + "::");
QHash<QByteArray, QByteArray> &classHash = def.hasQObject ? knownQObjectClasses : knownGadgets;
classHash.insert(def.classname, def.qualified);
@@ -634,7 +671,7 @@ void Moc::parse()
FunctionDef::Access access = FunctionDef::Private;
for (int i = namespaceList.size() - 1; i >= 0; --i)
if (inNamespace(&namespaceList.at(i)))
- def.qualified.prepend(namespaceList.at(i).name + "::");
+ def.qualified.prepend(namespaceList.at(i).classname + "::");
while (inClass(&def) && hasNext()) {
switch ((t = next())) {
case PRIVATE:
@@ -802,6 +839,19 @@ void Moc::parse()
classHash.insert(def.qualified, def.qualified);
}
}
+ for (const auto &n : qAsConst(namespaceList)) {
+ if (!n.hasQNamespace)
+ continue;
+ ClassDef def;
+ static_cast<BaseDef &>(def) = static_cast<BaseDef>(n);
+ if (!def.qualified.isEmpty())
+ def.qualified += "::";
+ def.qualified += def.classname;
+ def.hasQGadget = true;
+ classList += def;
+ knownGadgets.insert(def.classname, def.qualified);
+ knownGadgets.insert(def.qualified, def.qualified);
+ }
}
static bool any_type_contains(const QVector<PropertyDef> &properties, const QByteArray &pattern)
@@ -1248,7 +1298,7 @@ void Moc::parsePrivateProperty(ClassDef *def)
def->propertyList += propDef;
}
-void Moc::parseEnumOrFlag(ClassDef *def, bool isFlag)
+void Moc::parseEnumOrFlag(BaseDef *def, bool isFlag)
{
next(LPAREN);
QByteArray identifier;
@@ -1263,7 +1313,7 @@ void Moc::parseEnumOrFlag(ClassDef *def, bool isFlag)
next(RPAREN);
}
-void Moc::parseFlag(ClassDef *def)
+void Moc::parseFlag(BaseDef *def)
{
next(LPAREN);
QByteArray flagName, enumName;
@@ -1287,7 +1337,7 @@ void Moc::parseFlag(ClassDef *def)
next(RPAREN);
}
-void Moc::parseClassInfo(ClassDef *def)
+void Moc::parseClassInfo(BaseDef *def)
{
next(LPAREN);
ClassInfoDef infoDef;
diff --git a/src/tools/moc/moc.h b/src/tools/moc/moc.h
index 843bdeb794..6040f944f3 100644
--- a/src/tools/moc/moc.h
+++ b/src/tools/moc/moc.h
@@ -144,12 +144,18 @@ struct ClassInfoDef
};
Q_DECLARE_TYPEINFO(ClassInfoDef, Q_MOVABLE_TYPE);
-struct ClassDef {
- ClassDef():
- hasQObject(false), hasQGadget(false), notifyableProperties(0)
- , revisionedMethods(0), revisionedProperties(0), begin(0), end(0){}
+struct BaseDef {
QByteArray classname;
QByteArray qualified;
+ QVector<ClassInfoDef> classInfoList;
+ QMap<QByteArray, bool> enumDeclarations;
+ QVector<EnumDef> enumList;
+ QMap<QByteArray, QByteArray> flagAliases;
+ int begin = 0;
+ int end = 0;
+};
+
+struct ClassDef : BaseDef {
QVector<QPair<QByteArray, FunctionDef::Access> > superclassList;
struct Interface
@@ -162,8 +168,8 @@ struct ClassDef {
};
QVector<QVector<Interface> >interfaceList;
- bool hasQObject;
- bool hasQGadget;
+ bool hasQObject = false;
+ bool hasQGadget = false;
struct PluginData {
QByteArray iid;
@@ -173,25 +179,17 @@ struct ClassDef {
QVector<FunctionDef> constructorList;
QVector<FunctionDef> signalList, slotList, methodList, publicList;
- int notifyableProperties;
+ int notifyableProperties = 0;
QVector<PropertyDef> propertyList;
- QVector<ClassInfoDef> classInfoList;
- QMap<QByteArray, bool> enumDeclarations;
- QVector<EnumDef> enumList;
- QMap<QByteArray, QByteArray> flagAliases;
- int revisionedMethods;
- int revisionedProperties;
+ int revisionedMethods = 0;
+ int revisionedProperties = 0;
- int begin;
- int end;
};
Q_DECLARE_TYPEINFO(ClassDef, Q_MOVABLE_TYPE);
Q_DECLARE_TYPEINFO(ClassDef::Interface, Q_MOVABLE_TYPE);
-struct NamespaceDef {
- QByteArray name;
- int begin;
- int end;
+struct NamespaceDef : BaseDef {
+ bool hasQNamespace = false;
};
Q_DECLARE_TYPEINFO(NamespaceDef, Q_MOVABLE_TYPE);
@@ -240,9 +238,9 @@ public:
void parseProperty(ClassDef *def);
void parsePluginData(ClassDef *def);
void createPropertyDef(PropertyDef &def);
- void parseEnumOrFlag(ClassDef *def, bool isFlag);
- void parseFlag(ClassDef *def);
- void parseClassInfo(ClassDef *def);
+ void parseEnumOrFlag(BaseDef *def, bool isFlag);
+ void parseFlag(BaseDef *def);
+ void parseClassInfo(BaseDef *def);
void parseInterfaces(ClassDef *def);
void parseDeclareInterface();
void parseDeclareMetatype();
diff --git a/src/tools/moc/token.h b/src/tools/moc/token.h
index 3557da8aa8..db9d319b78 100644
--- a/src/tools/moc/token.h
+++ b/src/tools/moc/token.h
@@ -154,12 +154,15 @@ QT_BEGIN_NAMESPACE
F(RETURN) \
F(Q_OBJECT_TOKEN) \
F(Q_GADGET_TOKEN) \
+ F(Q_NAMESPACE_TOKEN) \
F(Q_PROPERTY_TOKEN) \
F(Q_PLUGIN_METADATA_TOKEN) \
F(Q_ENUMS_TOKEN) \
F(Q_ENUM_TOKEN) \
+ F(Q_ENUM_NS_TOKEN) \
F(Q_FLAGS_TOKEN) \
F(Q_FLAG_TOKEN) \
+ F(Q_FLAG_NS_TOKEN) \
F(Q_DECLARE_FLAGS_TOKEN) \
F(Q_DECLARE_INTERFACE_TOKEN) \
F(Q_DECLARE_METATYPE_TOKEN) \
diff --git a/src/tools/moc/util/generate_keywords.cpp b/src/tools/moc/util/generate_keywords.cpp
index d0f76a4c45..df850c1bdc 100644
--- a/src/tools/moc/util/generate_keywords.cpp
+++ b/src/tools/moc/util/generate_keywords.cpp
@@ -213,13 +213,16 @@ static const Keyword keywords[] = {
{ "goto", "GOTO" },
{ "return", "RETURN" },
{ "Q_OBJECT", "Q_OBJECT_TOKEN" },
+ { "Q_NAMESPACE", "Q_NAMESPACE_TOKEN" },
{ "Q_GADGET", "Q_GADGET_TOKEN" },
{ "Q_PROPERTY", "Q_PROPERTY_TOKEN" },
{ "Q_PLUGIN_METADATA", "Q_PLUGIN_METADATA_TOKEN" },
{ "Q_ENUMS", "Q_ENUMS_TOKEN" },
{ "Q_ENUM", "Q_ENUM_TOKEN" },
+ { "Q_ENUM_NS", "Q_ENUM_NS_TOKEN" },
{ "Q_FLAGS", "Q_FLAGS_TOKEN" },
{ "Q_FLAG", "Q_FLAG_TOKEN" },
+ { "Q_FLAG_NS", "Q_FLAG_NS_TOKEN" },
{ "Q_DECLARE_FLAGS", "Q_DECLARE_FLAGS_TOKEN" },
{ "Q_DECLARE_INTERFACE", "Q_DECLARE_INTERFACE_TOKEN" },
{ "Q_DECLARE_METATYPE", "Q_DECLARE_METATYPE_TOKEN" },
diff --git a/src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp b/src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp
index 8fc54794bc..e58f194b72 100644
--- a/src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp
+++ b/src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp
@@ -27,6 +27,8 @@
****************************************************************************/
#include <qbytearray.h>
+#include <qcommandlineparser.h>
+#include <qcoreapplication.h>
#include <qdebug.h>
#include <qfile.h>
#include <qfileinfo.h>
@@ -59,30 +61,6 @@ static QString commandLine;
static QStringList includes;
static QStringList wantedInterfaces;
-static const char help[] =
- "Usage: " PROGRAMNAME " [options...] [xml-or-xml-file] [interfaces...]\n"
- "Produces the C++ code to implement the interfaces defined in the input file.\n"
- "\n"
- "Options:\n"
- " -a <filename> Write the adaptor code to <filename>\n"
- " -c <classname> Use <classname> as the class name for the generated classes\n"
- " -h Show this information\n"
- " -i <filename> Add #include to the output\n"
- " -l <classname> When generating an adaptor, use <classname> as the parent class\n"
- " -m Generate #include \"filename.moc\" statements in the .cpp files\n"
- " -N Don't use namespaces\n"
- " -p <filename> Write the proxy code to <filename>\n"
- " -v Be verbose.\n"
- " -V Show the program version and quit.\n"
- "\n"
- "If the file name given to the options -a and -p does not end in .cpp or .h, the\n"
- "program will automatically append the suffixes and produce both files.\n"
- "You can also use a colon (:) to separate the header name from the source file\n"
- "name, as in '-a filename_p.h:filename.cpp'.\n"
- "\n"
- "If you pass a dash (-) as the argument to either -p or -a, the output is written\n"
- "to the standard output\n";
-
static const char includeList[] =
"#include <QtCore/QByteArray>\n"
"#include <QtCore/QList>\n"
@@ -101,105 +79,6 @@ static const char forwardDeclarations[] =
"class QVariant;\n"
"QT_END_NAMESPACE\n";
-static void showHelp()
-{
- printf("%s", help);
- exit(0);
-}
-
-static void showVersion()
-{
- printf("%s version %s\n", PROGRAMNAME, PROGRAMVERSION);
- printf("D-Bus binding tool for Qt\n");
- exit(0);
-}
-
-static QString nextArg(QStringList &args, int i, char opt)
-{
- QString arg = args.value(i);
- if (arg.isEmpty()) {
- printf("-%c needs at least one argument\n", opt);
- exit(1);
- }
- return args.takeAt(i);
-}
-
-static void parseCmdLine(QStringList args)
-{
- args.takeFirst();
-
- commandLine = QLatin1String(PROGRAMNAME " ");
- commandLine += args.join(QLatin1Char(' '));
-
- int i = 0;
- while (i < args.count()) {
-
- if (!args.at(i).startsWith(QLatin1Char('-'))) {
- ++i;
- continue;
- }
- QString arg = args.takeAt(i);
-
- char c = '\0';
- if (arg.length() == 2)
- c = arg.at(1).toLatin1();
- else if (arg == QLatin1String("--help"))
- c = 'h';
-
- switch (c) {
- case 'a':
- adaptorFile = nextArg(args, i, 'a');
- break;
-
- case 'c':
- globalClassName = nextArg(args, i, 'c');
- break;
-
- case 'v':
- verbose = true;
- break;
-
- case 'i':
- includes << nextArg(args, i, 'i');
- break;
-
- case 'l':
- parentClassName = nextArg(args, i, 'l');
- break;
-
- case 'm':
- includeMocs = true;
- break;
-
- case 'N':
- skipNamespaces = true;
- break;
-
- case '?':
- case 'h':
- showHelp();
- break;
-
- case 'V':
- showVersion();
- break;
-
- case 'p':
- proxyFile = nextArg(args, i, 'p');
- break;
-
- default:
- printf("unknown option: '%s'\n", qPrintable(arg));
- exit(1);
- }
- }
-
- if (!args.isEmpty())
- inputFile = args.takeFirst();
-
- wantedInterfaces << args;
-}
-
static QDBusIntrospection::Interfaces readInput()
{
QFile input(inputFile);
@@ -1139,13 +1018,79 @@ static void writeAdaptor(const QString &filename, const QDBusIntrospection::Inte
int main(int argc, char **argv)
{
- QStringList arguments;
- arguments.reserve(argc);
- for (int i = 0; i < argc; ++i) {
- arguments.append(QString::fromLocal8Bit(argv[i]));
- }
+ QCoreApplication app(argc, argv);
+ QCoreApplication::setApplicationName(QStringLiteral(PROGRAMNAME));
+ QCoreApplication::setApplicationVersion(QStringLiteral(PROGRAMVERSION));
+
+ QCommandLineParser parser;
+ parser.setApplicationDescription(QLatin1String(
+ "Produces the C++ code to implement the interfaces defined in the input file.\n\n"
+ "If the file name given to the options -a and -p does not end in .cpp or .h, the\n"
+ "program will automatically append the suffixes and produce both files.\n"
+ "You can also use a colon (:) to separate the header name from the source file\n"
+ "name, as in '-a filename_p.h:filename.cpp'.\n\n"
+ "If you pass a dash (-) as the argument to either -p or -a, the output is written\n"
+ "to the standard output."));
+
+ parser.addHelpOption();
+ parser.addVersionOption();
+ parser.addPositionalArgument(QStringLiteral("xml-or-xml-file"), QStringLiteral("XML file to use."));
+ parser.addPositionalArgument(QStringLiteral("interfaces"), QStringLiteral("List of interfaces to use."),
+ QStringLiteral("[interfaces ...]"));
+
+ QCommandLineOption adapterCodeOption(QStringList() << QStringLiteral("a") << QStringLiteral("adaptor"),
+ QStringLiteral("Write the adaptor code to <filename>"), QStringLiteral("filename"));
+ parser.addOption(adapterCodeOption);
+
+ QCommandLineOption classNameOption(QStringList() << QStringLiteral("c") << QStringLiteral("classname"),
+ QStringLiteral("Use <classname> as the class name for the generated classes"), QStringLiteral("classname"));
+ parser.addOption(classNameOption);
+
+ QCommandLineOption addIncludeOption(QStringList() << QStringLiteral("i") << QStringLiteral("include"),
+ QStringLiteral("Add #include to the output"), QStringLiteral("filename"));
+ parser.addOption(addIncludeOption);
+
+ QCommandLineOption adapterParentOption(QStringLiteral("l"),
+ QStringLiteral("When generating an adaptor, use <classname> as the parent class"), QStringLiteral("classname"));
+ parser.addOption(adapterParentOption);
+
+ QCommandLineOption mocIncludeOption(QStringList() << QStringLiteral("m") << QStringLiteral("moc"),
+ QStringLiteral("Generate #include \"filename.moc\" statements in the .cpp files"));
+ parser.addOption(mocIncludeOption);
+
+ QCommandLineOption noNamespaceOption(QStringList() << QStringLiteral("N") << QStringLiteral("no-namespaces"),
+ QStringLiteral("Don't use namespaces"));
+ parser.addOption(noNamespaceOption);
+
+ QCommandLineOption proxyCodeOption(QStringList() << QStringLiteral("p") << QStringLiteral("proxy"),
+ QStringLiteral("Write the proxy code to <filename>"), QStringLiteral("filename"));
+ parser.addOption(proxyCodeOption);
+
+ QCommandLineOption verboseOption(QStringList() << QStringLiteral("V") << QStringLiteral("verbose"),
+ QStringLiteral("Be verbose."));
+ parser.addOption(verboseOption);
+
+ parser.process(app);
+
+ adaptorFile = parser.value(adapterCodeOption);
+ globalClassName = parser.value(classNameOption);
+ includes = parser.values(addIncludeOption);
+ parentClassName = parser.value(adapterParentOption);
+ includeMocs = parser.isSet(mocIncludeOption);
+ skipNamespaces = parser.isSet(noNamespaceOption);
+ proxyFile = parser.value(proxyCodeOption);
+ verbose = parser.isSet(verboseOption);
+
+ wantedInterfaces = parser.positionalArguments();
+ if (!wantedInterfaces.isEmpty()) {
+ inputFile = wantedInterfaces.takeFirst();
- parseCmdLine(arguments);
+ QFileInfo inputInfo(inputFile);
+ if (!inputInfo.exists() || !inputInfo.isFile() || !inputInfo.isReadable()) {
+ qCritical("Error: Input %s is not a file or cannot be accessed\n", qPrintable(inputFile));
+ return 1;
+ }
+ }
QDBusIntrospection::Interfaces interfaces = readInput();
cleanInterfaces(interfaces);
diff --git a/src/tools/uic/cpp/cppwritedeclaration.cpp b/src/tools/uic/cpp/cppwritedeclaration.cpp
index 4c9d2db6df..3aadc878e3 100644
--- a/src/tools/uic/cpp/cppwritedeclaration.cpp
+++ b/src/tools/uic/cpp/cppwritedeclaration.cpp
@@ -44,27 +44,16 @@ QT_BEGIN_NAMESPACE
namespace {
void openNameSpaces(const QStringList &namespaceList, QTextStream &output) {
- if (namespaceList.empty())
- return;
- const QStringList::const_iterator cend = namespaceList.constEnd();
- for (QStringList::const_iterator it = namespaceList.constBegin(); it != cend; ++it) {
- if (!it->isEmpty()) {
+ for (auto it = namespaceList.begin(), end = namespaceList.end(); it != end; ++it) {
+ if (!it->isEmpty())
output << "namespace " << *it << " {\n";
- }
}
}
void closeNameSpaces(const QStringList &namespaceList, QTextStream &output) {
- if (namespaceList.empty())
- return;
-
- QListIterator<QString> it(namespaceList);
- it.toBack();
- while (it.hasPrevious()) {
- const QString ns = it.previous();
- if (!ns.isEmpty()) {
- output << "} // namespace " << ns << "\n";
- }
+ for (auto it = namespaceList.rbegin(), end = namespaceList.rend(); it != end; ++it) {
+ if (!it->isEmpty())
+ output << "} // namespace " << *it << "\n";
}
}
diff --git a/src/tools/uic/cpp/cppwriteinitialization.cpp b/src/tools/uic/cpp/cppwriteinitialization.cpp
index 031b34b67e..df55ca29f1 100644
--- a/src/tools/uic/cpp/cppwriteinitialization.cpp
+++ b/src/tools/uic/cpp/cppwriteinitialization.cpp
@@ -84,10 +84,14 @@ namespace {
const QHash<QString, DomProperty *> properties = propertyMap(node->elementProperty());
output << "new QSpacerItem(";
+ int w = 0;
+ int h = 0;
if (properties.contains(QLatin1String("sizeHint"))) {
const DomSize *sizeHint = properties.value(QLatin1String("sizeHint"))->elementSize();
- output << sizeHint->elementWidth() << ", " << sizeHint->elementHeight() << ", ";
+ w = sizeHint->elementWidth();
+ h = sizeHint->elementHeight();
}
+ output << w << ", " << h << ", ";
// size type
QString sizeType = properties.contains(QLatin1String("sizeType")) ?
@@ -1713,9 +1717,7 @@ void WriteInitialization::writeColorGroup(DomColorGroup *colorGroup, const QStri
// new format
const QList<DomColorRole *> colorRoles = colorGroup->elementColorRole();
- QListIterator<DomColorRole *> itRole(colorRoles);
- while (itRole.hasNext()) {
- const DomColorRole *colorRole = itRole.next();
+ for (const DomColorRole *colorRole : colorRoles) {
if (colorRole->hasAttributeRole()) {
const QString brushName = writeBrushInitialization(colorRole->elementBrush());
m_output << m_indent << paletteName << ".setBrush(" << group
@@ -1792,9 +1794,7 @@ void WriteInitialization::writeBrush(const DomBrush *brush, const QString &brush
}
const QList<DomGradientStop *> stops = gradient->elementGradientStop();
- QListIterator<DomGradientStop *> it(stops);
- while (it.hasNext()) {
- const DomGradientStop *stop = it.next();
+ for (const DomGradientStop *stop : stops) {
const DomColor *color = stop->elementColor();
m_output << m_indent << gradientName << ".setColorAt("
<< stop->attributePosition() << ", "
diff --git a/src/widgets/accessible/accessible.pri b/src/widgets/accessible/accessible.pri
index ac8205b1e3..e63ae28d30 100644
--- a/src/widgets/accessible/accessible.pri
+++ b/src/widgets/accessible/accessible.pri
@@ -1,6 +1,6 @@
# Qt accessibility module
-contains(QT_CONFIG, accessibility) {
+qtConfig(accessibility) {
HEADERS += \
accessible/qaccessiblewidget.h \
accessible/qaccessiblewidgetfactory_p.h \
diff --git a/src/widgets/accessible/widgets.pro b/src/widgets/accessible/widgets.pro
index da8607c637..d04d0da3cc 100644
--- a/src/widgets/accessible/widgets.pro
+++ b/src/widgets/accessible/widgets.pro
@@ -2,7 +2,7 @@ TARGET = qtaccessiblewidgets
QT += core-private gui-private widgets-private
-QTDIR_build:REQUIRES += "contains(QT_CONFIG, accessibility)"
+QTDIR_build:REQUIRES += "qtConfig(accessibility)"
SOURCES += main.cpp \
simplewidgets.cpp \
diff --git a/src/widgets/dialogs/images/qtlogo-64.png b/src/widgets/dialogs/images/qtlogo-64.png
index af87e98cf5..39a4a26f39 100644
--- a/src/widgets/dialogs/images/qtlogo-64.png
+++ b/src/widgets/dialogs/images/qtlogo-64.png
Binary files differ
diff --git a/src/widgets/dialogs/qcolordialog.cpp b/src/widgets/dialogs/qcolordialog.cpp
index f3652c09da..d4764c019e 100644
--- a/src/widgets/dialogs/qcolordialog.cpp
+++ b/src/widgets/dialogs/qcolordialog.cpp
@@ -541,8 +541,8 @@ QColor QColorDialog::customColor(int index)
/*!
Sets the custom color at \a index to the QColor \a color value.
- \note This function does not apply to the Native Color Dialog on the Mac
- OS X platform. If you still require this function, use the
+ \note This function does not apply to the Native Color Dialog on the
+ \macos platform. If you still require this function, use the
QColorDialog::DontUseNativeDialog option.
*/
void QColorDialog::setCustomColor(int index, QColor color)
@@ -563,8 +563,8 @@ QColor QColorDialog::standardColor(int index)
/*!
Sets the standard color at \a index to the QColor \a color value.
- \note This function does not apply to the Native Color Dialog on the Mac
- OS X platform. If you still require this function, use the
+ \note This function does not apply to the Native Color Dialog on the
+ \macos platform. If you still require this function, use the
QColorDialog::DontUseNativeDialog option.
*/
void QColorDialog::setStandardColor(int index, QColor color)
diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp
index e5f11e78da..b4ca853c5d 100644
--- a/src/widgets/dialogs/qfiledialog.cpp
+++ b/src/widgets/dialogs/qfiledialog.cpp
@@ -2068,7 +2068,7 @@ QString QFileDialog::labelText(DialogLabel label) const
The dialog's caption is set to \a caption. If \a caption is not specified
then a default caption will be used.
- On Windows, and OS X, this static function will use the
+ On Windows, and \macos, this static function will use the
native file dialog and not a QFileDialog.
On Windows the dialog will spin a blocking modal event loop that will not
@@ -2179,7 +2179,7 @@ QUrl QFileDialog::getOpenFileUrl(QWidget *parent,
The dialog's caption is set to \a caption. If \a caption is not specified
then a default caption will be used.
- On Windows, and OS X, this static function will use the
+ On Windows, and \macos, this static function will use the
native file dialog and not a QFileDialog.
On Windows the dialog will spin a blocking modal event loop that will not
@@ -2302,12 +2302,12 @@ QList<QUrl> QFileDialog::getOpenFileUrls(QWidget *parent,
The dialog's caption is set to \a caption. If \a caption is not specified,
a default caption will be used.
- On Windows, and OS X, this static function will use the
+ On Windows, and \macos, this static function will use the
native file dialog and not a QFileDialog.
On Windows the dialog will spin a blocking modal event loop that will not
dispatch any QTimers, and if \a parent is not 0 then it will position the
- dialog just below the parent's title bar. On OS X, with its native file
+ dialog just below the parent's title bar. On \macos, with its native file
dialog, the filter argument is ignored.
On Unix/X11, the normal behavior of the file dialog is to resolve and
@@ -2410,7 +2410,7 @@ QUrl QFileDialog::getSaveFileUrl(QWidget *parent,
pass. To ensure a native file dialog, \l{QFileDialog::}{ShowDirsOnly} must
be set.
- On Windows and OS X, this static function will use the
+ On Windows and \macos, this static function will use the
native file dialog and not a QFileDialog. However, the native Windows file
dialog does not support displaying files in the directory chooser. You need
to pass \l{QFileDialog::}{DontUseNativeDialog} to display files using a
diff --git a/src/widgets/dialogs/qmessagebox.cpp b/src/widgets/dialogs/qmessagebox.cpp
index 96046b7ff4..57b3f47863 100644
--- a/src/widgets/dialogs/qmessagebox.cpp
+++ b/src/widgets/dialogs/qmessagebox.cpp
@@ -550,7 +550,7 @@ void QMessageBoxPrivate::_q_clicked(QPlatformDialogHelper::StandardButton button
This is the approach recommended in the
\l{http://developer.apple.com/library/mac/documentation/UserExperience/Conceptual/AppleHIGuidelines/Windows/Windows.html#//apple_ref/doc/uid/20000961-BABCAJID}
- {OS X Guidelines}. Similar guidelines apply for the other
+ {\macos Guidelines}. Similar guidelines apply for the other
platforms, but note the different ways the
\l{QMessageBox::informativeText} {informative text} is handled for
different platforms.
@@ -667,7 +667,7 @@ void QMessageBoxPrivate::_q_clicked(QPlatformDialogHelper::StandardButton button
If the \l{QMessageBox::StandardButtons} {standard buttons} are not
flexible enough for your message box, you can use the addButton()
- overload that takes a text and a ButtonRoleto to add custom
+ overload that takes a text and a ButtonRole to add custom
buttons. The ButtonRole is used by QMessageBox to determine the
ordering of the buttons on screen (which varies according to the
platform). You can test the value of clickedButton() after calling
@@ -765,7 +765,7 @@ void QMessageBoxPrivate::_q_clicked(QPlatformDialogHelper::StandardButton button
Constructs a message box with no text and no buttons. \a parent is
passed to the QDialog constructor.
- On OS X, if you want your message box to appear
+ On \macos, if you want your message box to appear
as a Qt::Sheet of its \a parent, set the message box's
\l{setWindowModality()} {window modality} to Qt::WindowModal or use open().
Otherwise, the message box will be a standard dialog.
@@ -787,7 +787,7 @@ QMessageBox::QMessageBox(QWidget *parent)
The message box is an \l{Qt::ApplicationModal} {application modal}
dialog box.
- On OS X, if \a parent is not 0 and you want your message box
+ On \macos, if \a parent is not 0 and you want your message box
to appear as a Qt::Sheet of that parent, set the message box's
\l{setWindowModality()} {window modality} to Qt::WindowModal
(default). Otherwise, the message box will be a standard dialog.
@@ -955,7 +955,7 @@ QAbstractButton *QMessageBox::button(StandardButton which) const
\list 1
\li If there is only one button, it is made the escape button.
\li If there is a \l Cancel button, it is made the escape button.
- \li On OS X only, if there is exactly one button with the role
+ \li On \macos only, if there is exactly one button with the role
QMessageBox::RejectRole, it is made the escape button.
\endlist
@@ -1732,7 +1732,7 @@ QMessageBox::StandardButton QMessageBox::critical(QWidget *parent, const QString
\li As a last resort it uses the Information icon.
\endlist
- The about box has a single button labelled "OK". On OS X, the
+ The about box has a single button labelled "OK". On \macos, the
about box is popped up as a modeless window; on other platforms,
it is currently application modal.
@@ -1786,7 +1786,7 @@ void QMessageBox::about(QWidget *parent, const QString &title, const QString &te
QApplication provides this functionality as a slot.
- On OS X, the about box is popped up as a modeless window; on
+ On \macos, the about box is popped up as a modeless window; on
other platforms, it is currently application modal.
\sa QApplication::aboutQt()
@@ -2545,8 +2545,8 @@ void QMessageBox::setInformativeText(const QString &text)
This function shadows QWidget::setWindowTitle().
- Sets the title of the message box to \a title. On OS X,
- the window title is ignored (as required by the OS X
+ Sets the title of the message box to \a title. On \macos,
+ the window title is ignored (as required by the \macos
Guidelines).
*/
void QMessageBox::setWindowTitle(const QString &title)
@@ -2567,7 +2567,7 @@ void QMessageBox::setWindowTitle(const QString &title)
Sets the modality of the message box to \a windowModality.
- On OS X, if the modality is set to Qt::WindowModal and the message box
+ On \macos, if the modality is set to Qt::WindowModal and the message box
has a parent, then the message box will be a Qt::Sheet, otherwise the
message box will be a standard dialog.
*/
diff --git a/src/widgets/dialogs/qwizard.cpp b/src/widgets/dialogs/qwizard.cpp
index f3d27ff77f..bcad069b50 100644
--- a/src/widgets/dialogs/qwizard.cpp
+++ b/src/widgets/dialogs/qwizard.cpp
@@ -1819,7 +1819,7 @@ void QWizardAntiFlickerWidget::paintEvent(QPaintEvent *)
\inmodule QtWidgets
- A wizard (also called an assistant on OS X) is a special type
+ A wizard (also called an assistant on \macos) is a special type
of input dialog that consists of a sequence of pages. A wizard's
purpose is to guide the user through a process step by step.
Wizards are useful for complex or infrequent tasks that users may
@@ -2117,10 +2117,10 @@ void QWizardAntiFlickerWidget::paintEvent(QPaintEvent *)
This enum specifies the buttons in a wizard.
- \value BackButton The \uicontrol Back button (\uicontrol {Go Back} on OS X)
- \value NextButton The \uicontrol Next button (\uicontrol Continue on OS X)
+ \value BackButton The \uicontrol Back button (\uicontrol {Go Back} on \macos)
+ \value NextButton The \uicontrol Next button (\uicontrol Continue on \macos)
\value CommitButton The \uicontrol Commit button
- \value FinishButton The \uicontrol Finish button (\uicontrol Done on OS X)
+ \value FinishButton The \uicontrol Finish button (\uicontrol Done on \macos)
\value CancelButton The \uicontrol Cancel button (see also NoCancelButton)
\value HelpButton The \uicontrol Help button (see also HaveHelpButton)
\value CustomButton1 The first user-defined button (see also HaveCustomButton1)
@@ -2160,7 +2160,7 @@ void QWizardAntiFlickerWidget::paintEvent(QPaintEvent *)
\value ClassicStyle Classic Windows look
\value ModernStyle Modern Windows look
- \value MacStyle OS X look
+ \value MacStyle \macos look
\value AeroStyle Windows Aero look
\omitvalue NStyles
@@ -2629,7 +2629,7 @@ bool QWizard::testOption(WizardOption option) const
\list
\li Windows: HelpButtonOnRight.
- \li OS X: NoDefaultButton and NoCancelButton.
+ \li \macos: NoDefaultButton and NoCancelButton.
\li X11 and QWS (Qt for Embedded Linux): none.
\endlist
@@ -2673,7 +2673,7 @@ QWizard::WizardOptions QWizard::options() const
Sets the text on button \a which to be \a text.
By default, the text on buttons depends on the wizardStyle. For
- example, on OS X, the \uicontrol Next button is called \uicontrol
+ example, on \macos, the \uicontrol Next button is called \uicontrol
Continue.
To add extra buttons to the wizard (e.g., a \uicontrol Print button),
@@ -2705,7 +2705,7 @@ void QWizard::setButtonText(WizardButton which, const QString &text)
If a text has ben set using setButtonText(), this text is returned.
By default, the text on buttons depends on the wizardStyle. For
- example, on OS X, the \uicontrol Next button is called \uicontrol
+ example, on \macos, the \uicontrol Next button is called \uicontrol
Continue.
\sa button(), setButton(), setButtonText(), QWizardPage::buttonText(),
@@ -2891,7 +2891,7 @@ void QWizard::setPixmap(WizardPixmap which, const QPixmap &pixmap)
Returns the pixmap set for role \a which.
By default, the only pixmap that is set is the BackgroundPixmap on
- OS X.
+ \macos.
\sa QWizardPage::pixmap(), {Elements of a Wizard Page}
*/
@@ -3802,7 +3802,7 @@ void QWizardPage::setButtonText(QWizard::WizardButton which, const QString &text
this text is returned.
By default, the text on buttons depends on the QWizard::wizardStyle.
- For example, on OS X, the \uicontrol Next button is called \uicontrol
+ For example, on \macos, the \uicontrol Next button is called \uicontrol
Continue.
\sa setButtonText(), QWizard::buttonText(), QWizard::setButtonText()
diff --git a/src/widgets/doc/snippets/code/src_gui_itemviews_qtablewidget.cpp b/src/widgets/doc/snippets/code/src_gui_itemviews_qtablewidget.cpp
index cb5a74fa15..c40152ff49 100644
--- a/src/widgets/doc/snippets/code/src_gui_itemviews_qtablewidget.cpp
+++ b/src/widgets/doc/snippets/code/src_gui_itemviews_qtablewidget.cpp
@@ -49,7 +49,7 @@
****************************************************************************/
//! [0]
-setCellWidget(index, new QLineEdit);
+setCellWidget(row, column, new QLineEdit);
...
-setCellWidget(index, new QTextEdit);
+setCellWidget(row, column, new QTextEdit);
//! [0]
diff --git a/src/widgets/doc/src/graphicsview.qdoc b/src/widgets/doc/src/graphicsview.qdoc
index c49f233001..33f480b0bf 100644
--- a/src/widgets/doc/src/graphicsview.qdoc
+++ b/src/widgets/doc/src/graphicsview.qdoc
@@ -491,7 +491,7 @@
not supported. For example, you can create decorated windows by
passing the Qt::Window window flag to QGraphicsWidget's constructor,
but Graphics View currently doesn't support the Qt::Sheet and
- Qt::Drawer flags that are common on OS X.
+ Qt::Drawer flags that are common on \macos.
\section3 QGraphicsLayout
diff --git a/src/widgets/doc/src/widgets-and-layouts/focus.qdoc b/src/widgets/doc/src/widgets-and-layouts/focus.qdoc
index ed56e37c78..9ce3c8472f 100644
--- a/src/widgets/doc/src/widgets-and-layouts/focus.qdoc
+++ b/src/widgets/doc/src/widgets-and-layouts/focus.qdoc
@@ -162,13 +162,13 @@
\section2 The User Rotates the Mouse Wheel
On Microsoft Windows, mouse wheel usage is always handled by the
- widget that has keyboard focus. On OS X and X11, it's handled by
+ widget that has keyboard focus. On \macos and X11, it's handled by
the widget that gets other mouse events.
The way Qt handles this platform difference is by letting widgets move
the keyboard focus when the wheel is used. With the right focus policy
on each widget, applications can work idiomatically correctly on
- Windows, OS X, and X11.
+ Windows, \macos, and X11.
\section2 The User Moves the Focus to This Window
diff --git a/src/widgets/doc/src/widgets-and-layouts/styles.qdoc b/src/widgets/doc/src/widgets-and-layouts/styles.qdoc
index 1e0ed66b13..6e697a97df 100644
--- a/src/widgets/doc/src/widgets-and-layouts/styles.qdoc
+++ b/src/widgets/doc/src/widgets-and-layouts/styles.qdoc
@@ -115,7 +115,7 @@
The widget is passed as the last argument in case the style needs
it to perform special effects (such as animated default buttons on
- OS X), but it isn't mandatory.
+ \macos), but it isn't mandatory.
In the course of this section, we will look at the style elements,
the style options, and the functions of QStyle. Finally, we describe
diff --git a/src/widgets/doc/src/widgets-and-layouts/stylesheet.qdoc b/src/widgets/doc/src/widgets-and-layouts/stylesheet.qdoc
index 6a4e870cb1..61379fb2f0 100644
--- a/src/widgets/doc/src/widgets-and-layouts/stylesheet.qdoc
+++ b/src/widgets/doc/src/widgets-and-layouts/stylesheet.qdoc
@@ -80,7 +80,7 @@
the QPalette::Button role to red for a QPushButton to obtain a
red push button. However, this wasn't guaranteed to work for all
styles, because style authors are restricted by the different
- platforms' guidelines and (on Windows XP and OS X) by the
+ platforms' guidelines and (on Windows XP and \macos) by the
native theme engine.
Style sheets let you perform all kinds of customizations that are
@@ -121,7 +121,7 @@
\row \li \inlineimage stylesheet-coffee-cleanlooks.png
\li \inlineimage stylesheet-pagefold-mac.png
\row \li Coffee theme running on Ubuntu Linux
- \li Pagefold theme running on OS X
+ \li Pagefold theme running on \macos
\endtable
When a style sheet is active, the QStyle returned by QWidget::style()
@@ -130,7 +130,7 @@
otherwise forwards the drawing operations to the underlying,
platform-specific style (e.g., QWindowsXPStyle on Windows XP).
- Since Qt 4.5, Qt style sheets fully supports OS X.
+ Since Qt 4.5, Qt style sheets fully supports \macos.
*/
@@ -3807,7 +3807,7 @@
\snippet code/doc_src_stylesheet.qdoc 135
If you want the scroll buttons of the scroll bar to be placed together
- (instead of the edges) like on OS X, you can use the following
+ (instead of the edges) like on \macos, you can use the following
stylesheet:
\snippet code/doc_src_stylesheet.qdoc 136
diff --git a/src/widgets/doc/src/widgets-tutorial.qdoc b/src/widgets/doc/src/widgets-tutorial.qdoc
index 693377c972..d7b68a6f67 100644
--- a/src/widgets/doc/src/widgets-tutorial.qdoc
+++ b/src/widgets/doc/src/widgets-tutorial.qdoc
@@ -110,7 +110,7 @@
make sure that the executable is on your path, or enter its
full location.
- \li On Linux/Unix and OS X, type \c make and press
+ \li On Linux/Unix and \macos, type \c make and press
\uicontrol{Return}; on Windows with Visual Studio, type \c nmake and
press \uicontrol{Return}.
diff --git a/src/widgets/graphicsview/qgraphicssceneevent.cpp b/src/widgets/graphicsview/qgraphicssceneevent.cpp
index 49f252e49a..763688191d 100644
--- a/src/widgets/graphicsview/qgraphicssceneevent.cpp
+++ b/src/widgets/graphicsview/qgraphicssceneevent.cpp
@@ -149,7 +149,7 @@
platforms, this means the right mouse button was clicked.
\value Keyboard The keyboard caused this event to be sent. On
- Windows and OS X, this means the menu button was pressed.
+ Windows and \macos, this means the menu button was pressed.
\value Other The event was sent by some other means (i.e. not
by the mouse or keyboard).
diff --git a/src/widgets/itemviews/qabstractitemview.cpp b/src/widgets/itemviews/qabstractitemview.cpp
index 221511f38d..42b35ac644 100644
--- a/src/widgets/itemviews/qabstractitemview.cpp
+++ b/src/widgets/itemviews/qabstractitemview.cpp
@@ -788,8 +788,10 @@ void QAbstractItemView::setSelectionModel(QItemSelectionModel *selectionModel)
QModelIndex oldCurrentIndex;
if (d->selectionModel) {
- oldSelection = d->selectionModel->selection();
- oldCurrentIndex = d->selectionModel->currentIndex();
+ if (d->selectionModel->model() == selectionModel->model()) {
+ oldSelection = d->selectionModel->selection();
+ oldCurrentIndex = d->selectionModel->currentIndex();
+ }
disconnect(d->selectionModel, SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
this, SLOT(selectionChanged(QItemSelection,QItemSelection)));
@@ -3871,7 +3873,7 @@ void QAbstractItemView::doAutoScroll()
int horizontalValue = horizontalScroll->value();
QPoint pos = d->viewport->mapFromGlobal(QCursor::pos());
- QRect area = static_cast<QAbstractItemView*>(d->viewport)->d_func()->clipRect(); // access QWidget private by bending C++ rules
+ QRect area = QWidgetPrivate::get(d->viewport)->clipRect();
// do the scrolling if we are in the scroll margins
if (pos.y() - area.top() < margin)
diff --git a/src/widgets/itemviews/qabstractitemview.h b/src/widgets/itemviews/qabstractitemview.h
index b080f84e90..d6c5d58934 100644
--- a/src/widgets/itemviews/qabstractitemview.h
+++ b/src/widgets/itemviews/qabstractitemview.h
@@ -46,6 +46,9 @@
#include <QtCore/qitemselectionmodel.h>
#include <QtWidgets/qabstractitemdelegate.h>
+class tst_QAbstractItemView;
+class tst_QTreeView;
+
QT_BEGIN_NAMESPACE
@@ -368,6 +371,8 @@ private:
Q_PRIVATE_SLOT(d_func(), void _q_scrollerStateChanged())
#endif
+ friend class ::tst_QAbstractItemView;
+ friend class ::tst_QTreeView;
friend class QTreeViewPrivate; // needed to compile with MSVC
friend class QListModeViewBase;
friend class QListViewPrivate;
diff --git a/src/widgets/itemviews/qdatawidgetmapper.cpp b/src/widgets/itemviews/qdatawidgetmapper.cpp
index 4bf7406f92..b213a0859c 100644
--- a/src/widgets/itemviews/qdatawidgetmapper.cpp
+++ b/src/widgets/itemviews/qdatawidgetmapper.cpp
@@ -205,20 +205,6 @@ void QDataWidgetMapperPrivate::_q_commitData(QWidget *w)
commit(widgetMap.at(idx));
}
-class QFocusHelper: public QWidget
-{
-public:
- bool focusNextPrevChild(bool next) Q_DECL_OVERRIDE
- {
- return QWidget::focusNextPrevChild(next);
- }
-
- static inline void focusNextPrevChild(QWidget *w, bool next)
- {
- static_cast<QFocusHelper *>(w)->focusNextPrevChild(next);
- }
-};
-
void QDataWidgetMapperPrivate::_q_closeEditor(QWidget *w, QAbstractItemDelegate::EndEditHint hint)
{
int idx = findWidget(w);
@@ -230,10 +216,10 @@ void QDataWidgetMapperPrivate::_q_closeEditor(QWidget *w, QAbstractItemDelegate:
populate(widgetMap[idx]);
break; }
case QAbstractItemDelegate::EditNextItem:
- QFocusHelper::focusNextPrevChild(w, true);
+ w->focusNextChild();
break;
case QAbstractItemDelegate::EditPreviousItem:
- QFocusHelper::focusNextPrevChild(w, false);
+ w->focusPreviousChild();
break;
case QAbstractItemDelegate::SubmitModelCache:
case QAbstractItemDelegate::NoHint:
diff --git a/src/widgets/itemviews/qheaderview.cpp b/src/widgets/itemviews/qheaderview.cpp
index 6f1e301d4f..85bd3003e1 100644
--- a/src/widgets/itemviews/qheaderview.cpp
+++ b/src/widgets/itemviews/qheaderview.cpp
@@ -3465,6 +3465,7 @@ void QHeaderViewPrivate::clear()
sectionSelected.clear();
hiddenSectionSize.clear();
sectionItems.clear();
+ lastSectionLogicalIdx = -1;
invalidateCachedSizeHint();
}
}
diff --git a/src/widgets/itemviews/qtreeview.h b/src/widgets/itemviews/qtreeview.h
index b3a88db005..3c7cbddfbb 100644
--- a/src/widgets/itemviews/qtreeview.h
+++ b/src/widgets/itemviews/qtreeview.h
@@ -43,6 +43,8 @@
#include <QtWidgets/qtwidgetsglobal.h>
#include <QtWidgets/qabstractitemview.h>
+class tst_QTreeView;
+
QT_BEGIN_NAMESPACE
@@ -220,6 +222,7 @@ protected:
void currentChanged(const QModelIndex &current, const QModelIndex &previous) Q_DECL_OVERRIDE;
private:
+ friend class ::tst_QTreeView;
friend class QAccessibleTable;
friend class QAccessibleTree;
friend class QAccessibleTableCell;
diff --git a/src/widgets/itemviews/qtreewidget.cpp b/src/widgets/itemviews/qtreewidget.cpp
index 5e0f13277c..1338ce4585 100644
--- a/src/widgets/itemviews/qtreewidget.cpp
+++ b/src/widgets/itemviews/qtreewidget.cpp
@@ -146,6 +146,7 @@ QTreeModel::QTreeModel(QTreeModelPrivate &dd, QTreeWidget *parent)
QTreeModel::~QTreeModel()
{
clear();
+ headerItem->view = Q_NULLPTR;
delete headerItem;
rootItem->view = 0;
delete rootItem;
diff --git a/src/widgets/kernel/kernel.pri b/src/widgets/kernel/kernel.pri
index b40a33b2af..ad2180bbfd 100644
--- a/src/widgets/kernel/kernel.pri
+++ b/src/widgets/kernel/kernel.pri
@@ -80,7 +80,7 @@ wince {
kernel/qwidgetsfunctions_wince.cpp
}
-contains(QT_CONFIG, opengl) {
+qtConfig(opengl) {
HEADERS += kernel/qopenglwidget.h
SOURCES += kernel/qopenglwidget.cpp
}
diff --git a/src/widgets/kernel/qaction.cpp b/src/widgets/kernel/qaction.cpp
index 88b29e9147..e5bf606901 100644
--- a/src/widgets/kernel/qaction.cpp
+++ b/src/widgets/kernel/qaction.cpp
@@ -255,7 +255,7 @@ void QActionPrivate::setShortcutEnabled(bool enable, QShortcutMap &map)
/*!
\enum QAction::MenuRole
- This enum describes how an action should be moved into the application menu on OS X.
+ This enum describes how an action should be moved into the application menu on \macos.
\value NoRole This action should not be put into the application menu
\value TextHeuristicRole This action should be put in the application menu based on the action's text
@@ -264,7 +264,7 @@ void QActionPrivate::setShortcutEnabled(bool enable, QShortcutMap &map)
\value AboutQtRole This action handles the "About Qt" menu item.
\value AboutRole This action should be placed where the "About" menu item is in the application menu. The text of
the menu item will be set to "About <application name>". The application name is fetched from the
- \c{Info.plist} file in the application's bundle (See \l{Qt for OS X - Deployment}).
+ \c{Info.plist} file in the application's bundle (See \l{Qt for macOS - Deployment}).
\value PreferencesRole This action should be placed where the "Preferences..." menu item is in the application menu.
\value QuitRole This action should be placed where the Quit menu item is in the application menu.
@@ -1226,12 +1226,12 @@ void QAction::activate(ActionEvent event)
\brief the action's menu role
\since 4.2
- This indicates what role the action serves in the application menu on Mac
- OS X. By default all actions have the TextHeuristicRole, which means that
+ This indicates what role the action serves in the application menu on
+ \macos. By default all actions have the TextHeuristicRole, which means that
the action is added based on its text (see QMenuBar for more information).
The menu role can only be changed before the actions are put into the menu
- bar in OS X (usually just before the first application window is
+ bar in \macos (usually just before the first application window is
shown).
*/
void QAction::setMenuRole(MenuRole menuRole)
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp
index df467505d9..afc1be7458 100644
--- a/src/widgets/kernel/qapplication.cpp
+++ b/src/widgets/kernel/qapplication.cpp
@@ -1477,7 +1477,7 @@ void QApplicationPrivate::setPalette_helper(const QPalette &palette, const char*
\note Some styles do not use the palette for all drawing, for instance, if
they make use of native theme engines. This is the case for the Windows XP,
- Windows Vista, and OS X styles.
+ Windows Vista, and \macos styles.
\sa QWidget::setPalette(), palette(), QStyle::polish()
*/
@@ -3958,7 +3958,7 @@ bool QApplication::keypadNavigationEnabled()
Currently this function does nothing on Qt for Embedded Linux.
- On OS X, this works more at the application level and will cause the
+ On \macos, this works more at the application level and will cause the
application icon to bounce in the dock.
On Windows, this causes the window's taskbar entry to flash for a time. If
diff --git a/src/widgets/kernel/qdesktopwidget.qdoc b/src/widgets/kernel/qdesktopwidget.qdoc
index c23e942eec..27d05ece8c 100644
--- a/src/widgets/kernel/qdesktopwidget.qdoc
+++ b/src/widgets/kernel/qdesktopwidget.qdoc
@@ -149,7 +149,7 @@
Returns the available geometry of the screen with index \a screen. What
is available will be subrect of screenGeometry() based on what the
platform decides is available (for example excludes the dock and menu bar
- on OS X, or the task bar on Windows). The default screen is used if
+ on \macos, or the task bar on Windows). The default screen is used if
\a screen is -1.
\sa screenNumber(), screenGeometry()
diff --git a/src/widgets/kernel/qformlayout.cpp b/src/widgets/kernel/qformlayout.cpp
index 0bc1c029fe..73e82c577c 100644
--- a/src/widgets/kernel/qformlayout.cpp
+++ b/src/widgets/kernel/qformlayout.cpp
@@ -1033,7 +1033,7 @@ QLayoutItem* QFormLayoutPrivate::replaceAt(int index, QLayoutItem *newitem)
\li \b{Adherence to the different platform's look and feel guidelines.}
For example, the
- \l{http://developer.apple.com/library/mac/#documentation/UserExperience/Conceptual/AppleHIGuidelines/Intro/Intro.html}{Mac OS X Aqua} and KDE guidelines specify that the
+ \l{http://developer.apple.com/library/mac/#documentation/UserExperience/Conceptual/AppleHIGuidelines/Intro/Intro.html}{\macos Aqua} and KDE guidelines specify that the
labels should be right-aligned, whereas Windows and GNOME
applications normally use left-alignment.
@@ -1076,7 +1076,7 @@ QLayoutItem* QFormLayoutPrivate::replaceAt(int index, QLayoutItem *newitem)
corresponds to what we would get using a two-column
QGridLayout.)
\li Style based on the
- \l{http://developer.apple.com/library/mac/#documentation/UserExperience/Conceptual/AppleHIGuidelines/Intro/Intro.html}{Mac OS X Aqua} guidelines. Labels are right-aligned,
+ \l{http://developer.apple.com/library/mac/#documentation/UserExperience/Conceptual/AppleHIGuidelines/Intro/Intro.html}{\macos Aqua} guidelines. Labels are right-aligned,
the fields don't grow beyond their size hint, and the
form is horizontally centered.
\li Recommended style for
diff --git a/src/widgets/kernel/qopenglwidget.cpp b/src/widgets/kernel/qopenglwidget.cpp
index 124c8c000a..147e0774e7 100644
--- a/src/widgets/kernel/qopenglwidget.cpp
+++ b/src/widgets/kernel/qopenglwidget.cpp
@@ -112,7 +112,7 @@ QT_BEGIN_NAMESPACE
\note Calling QSurfaceFormat::setDefaultFormat() before constructing
the QApplication instance is mandatory on some platforms (for example,
- OS X) when an OpenGL core profile context is requested. This is to
+ \macos) when an OpenGL core profile context is requested. This is to
ensure that resource sharing between contexts stays functional as all
internal contexts are created using the correct version and profile.
@@ -467,7 +467,7 @@ QT_BEGIN_NAMESPACE
recommended to limit the usage of this approach to cases where there
is no other choice. Note that this option is not suitable for most
embedded and mobile platforms, and it is known to have issues on
- certain desktop platforms (e.g. OS X) too. The stable,
+ certain desktop platforms (e.g. \macos) too. The stable,
cross-platform solution is always QOpenGLWidget.
\e{OpenGL is a trademark of Silicon Graphics, Inc. in the United States and other
diff --git a/src/widgets/kernel/qsizepolicy.cpp b/src/widgets/kernel/qsizepolicy.cpp
index 66fa350f81..e902bb522c 100644
--- a/src/widgets/kernel/qsizepolicy.cpp
+++ b/src/widgets/kernel/qsizepolicy.cpp
@@ -247,7 +247,7 @@ QSizePolicy::ControlType QSizePolicy::controlType() const
The control type specifies the type of the widget for which this
size policy applies. It is used by some styles, notably
QMacStyle, to insert proper spacing between widgets. For example,
- the Mac OS X Aqua guidelines specify that push buttons should be
+ the \macos Aqua guidelines specify that push buttons should be
separated by 12 pixels, whereas vertically stacked radio buttons
only require 6 pixels.
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index e0b8024f9a..d0971443ba 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -2516,7 +2516,7 @@ QWidget *QWidget::find(WId id)
If a widget is non-native (alien) and winId() is invoked on it, that widget
will be provided a native handle.
- On OS X, the type returned depends on which framework Qt was linked
+ On \macos, the type returned depends on which framework Qt was linked
against. If Qt is using Carbon, the {WId} is actually an HIViewRef. If Qt
is using Cocoa, {WId} is a pointer to an NSView.
@@ -2643,7 +2643,7 @@ QWindow *QWidget::windowHandle() const
The style sheet contains a textual description of customizations to the
widget's style, as described in the \l{Qt Style Sheets} document.
- Since Qt 4.5, Qt style sheets fully supports OS X.
+ Since Qt 4.5, Qt style sheets fully supports \macos.
\warning Qt style sheets are currently not supported for custom QStyle
subclasses. We plan to address this in some future release.
@@ -5136,7 +5136,7 @@ void QWidget::render(QPaintDevice *target, const QPoint &targetOffset,
Transformations and settings applied to the \a painter will be used
when rendering.
- \note The \a painter must be active. On OS X the widget will be
+ \note The \a painter must be active. On \macos the widget will be
rendered into a QPixmap and then drawn by the \a painter.
\sa QPainter::device()
@@ -6280,7 +6280,7 @@ QString QWidget::windowIconText() const
If the window title is set at any point, then the window title takes precedence and
will be shown instead of the file path string.
- Additionally, on OS X, this has an added benefit that it sets the
+ Additionally, on \macos, this has an added benefit that it sets the
\l{http://developer.apple.com/documentation/UserExperience/Conceptual/OSXHIGuidelines/XHIGWindows/chapter_17_section_3.html}{proxy icon}
for the window, assuming that the file path exists.
@@ -11319,7 +11319,7 @@ bool QWidget::testAttribute_helper(Qt::WidgetAttribute attribute) const
By default the value of this property is 1.0.
- This feature is available on Embedded Linux, OS X, Windows,
+ This feature is available on Embedded Linux, \macos, Windows,
and X11 platforms that support the Composite extension.
This feature is not available on Windows CE.
@@ -11382,7 +11382,7 @@ void QWidgetPrivate::setWindowOpacity_sys(qreal level)
A modified window is a window whose content has changed but has
not been saved to disk. This flag will have different effects
- varied by the platform. On OS X the close button will have a
+ varied by the platform. On \macos the close button will have a
modified look; on other platforms, the window title will have an
'*' (asterisk).
@@ -12531,7 +12531,7 @@ static void releaseMouseGrabOfWidget(QWidget *widget)
\note On Windows, grabMouse() only works when the mouse is inside a window
owned by the process.
- On OS X, grabMouse() only works when the mouse is inside the frame of that widget.
+ On \macos, grabMouse() only works when the mouse is inside the frame of that widget.
\sa releaseMouse(), grabKeyboard(), releaseKeyboard()
*/
@@ -13003,7 +13003,7 @@ QDebug operator<<(QDebug debug, const QWidget *widget)
This function will return 0 if no painter context can be established, or if the handle
could not be created.
- \warning This function is only available on OS X.
+ \warning This function is only available on \macos.
*/
/*! \fn Qt::HANDLE QWidget::macQDHandle() const
\internal
@@ -13012,7 +13012,7 @@ QDebug operator<<(QDebug debug, const QWidget *widget)
This function will return 0 if QuickDraw is not supported, or if the handle could
not be created.
- \warning This function is only available on OS X.
+ \warning This function is only available on \macos.
*/
/*! \fn const QX11Info &QWidget::x11Info() const
\internal
diff --git a/src/widgets/kernel/qwidget.h b/src/widgets/kernel/qwidget.h
index 2a71710143..bca89fe2c5 100644
--- a/src/widgets/kernel/qwidget.h
+++ b/src/widgets/kernel/qwidget.h
@@ -676,6 +676,7 @@ protected:
void destroy(bool destroyWindow = true,
bool destroySubWindows = true);
+ friend class QDataWidgetMapperPrivate; // for access to focusNextPrevChild
virtual bool focusNextPrevChild(bool next);
inline bool focusNextChild() { return focusNextPrevChild(true); }
inline bool focusPreviousChild() { return focusNextPrevChild(false); }
diff --git a/src/widgets/kernel/qwidgetaction.cpp b/src/widgets/kernel/qwidgetaction.cpp
index ce91116c4d..6eebaca42c 100644
--- a/src/widgets/kernel/qwidgetaction.cpp
+++ b/src/widgets/kernel/qwidgetaction.cpp
@@ -85,8 +85,8 @@ QT_BEGIN_NAMESPACE
Note that it is up to the widget to activate the action, for example by
reimplementing mouse event handlers and calling QAction::trigger().
- \b {OS X}: If you add a widget to a menu in the application's menu
- bar on OS X, the widget will be added and it will function but with some
+ \b {\macos}: If you add a widget to a menu in the application's menu
+ bar on \macos, the widget will be added and it will function but with some
limitations:
\list 1
\li The widget is reparented away from the QMenu to the native menu
@@ -96,7 +96,7 @@ QT_BEGIN_NAMESPACE
\li Due to Apple's design, mouse tracking on the widget currently does
not work.
\li Connecting the triggered() signal to a slot that opens a modal
- dialog will cause a crash in Mac OS X 10.4 (known bug acknowledged
+ dialog will cause a crash in \macos 10.4 (known bug acknowledged
by Apple), a workaround is to use a QueuedConnection instead of a
DirectConnection.
\endlist
diff --git a/src/widgets/styles/qmacstyle.qdoc b/src/widgets/styles/qmacstyle.qdoc
index 5d597b53a4..f8bd1f57a9 100644
--- a/src/widgets/styles/qmacstyle.qdoc
+++ b/src/widgets/styles/qmacstyle.qdoc
@@ -28,7 +28,7 @@
/*!
\class QMacStyle
- \brief The QMacStyle class provides a OS X style using the Apple Appearance Manager.
+ \brief The QMacStyle class provides a \macos style using the Apple Appearance Manager.
\ingroup appearance
\inmodule QtWidgets
@@ -36,10 +36,10 @@
This class is implemented as a wrapper to the HITheme
APIs, allowing applications to be styled according to the current
- theme in use on OS X. This is done by having primitives
- in QStyle implemented in terms of what OS X would normally theme.
+ theme in use on \macos. This is done by having primitives
+ in QStyle implemented in terms of what \macos would normally theme.
- \warning This style is only available on OS X because it relies on the
+ \warning This style is only available on \macos because it relies on the
HITheme APIs.
There are additional issues that should be taken
@@ -56,7 +56,7 @@
involve horizontal and vertical widget alignment and widget size
(covered below).
- \li Widget size - OS X allows widgets to have specific fixed sizes. Qt
+ \li Widget size - \macos allows widgets to have specific fixed sizes. Qt
does not fully implement this behavior so as to maintain cross-platform
compatibility. As a result some widgets sizes may be inappropriate (and
subsequently not rendered correctly by the HITheme APIs).The
@@ -75,7 +75,7 @@
There are other issues that need to be considered in the feel of
your application (including the general color scheme to match the
Aqua colors). The Guidelines mentioned above will remain current
- with new advances and design suggestions for OS X.
+ with new advances and design suggestions for \macos.
Note that the functions provided by QMacStyle are
reimplementations of QStyle functions; see QStyle for their
diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm
index 5b455a4e5c..47a6156662 100644
--- a/src/widgets/styles/qmacstyle_mac.mm
+++ b/src/widgets/styles/qmacstyle_mac.mm
@@ -7194,7 +7194,7 @@ static CGColorSpaceRef qt_mac_colorSpaceForDeviceType(const QPaintDevice *paintD
returned if it can't be obtained. It is the caller's responsibility to
CGContextRelease the context when finished using it.
- \warning This function is only available on OS X.
+ \warning This function is only available on \macos.
\warning This function is duplicated in the Cocoa platform plugin.
*/
diff --git a/src/widgets/styles/qstyle.cpp b/src/widgets/styles/qstyle.cpp
index 93bc00f662..01d972af65 100644
--- a/src/widgets/styles/qstyle.cpp
+++ b/src/widgets/styles/qstyle.cpp
@@ -104,7 +104,7 @@ static int unpackControlTypes(QSizePolicy::ControlTypes controls, QSizePolicy::C
The style gets all the information it needs to render the
graphical element from the QStyleOption class. The widget is
passed as the last argument in case the style needs it to perform
- special effects (such as animated default buttons on OS X),
+ special effects (such as animated default buttons on \macos),
but it isn't mandatory. In fact, QStyle can be used to draw on any
paint device (not just widgets), in which case the widget argument
is a zero pointer.
@@ -203,7 +203,7 @@ static int unpackControlTypes(QSizePolicy::ControlTypes controls, QSizePolicy::C
QStyle gets all the information it needs to render the graphical
element from QStyleOption. The widget is passed as the last
argument in case the style needs it to perform special effects
- (such as animated default buttons on OS X), but it isn't
+ (such as animated default buttons on \macos), but it isn't
mandatory. In fact, you can use QStyle to draw on any paint
device, not just widgets, by setting the QPainter properly.
@@ -1736,7 +1736,7 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment,
desktop platforms.
\value SH_Menu_SubMenuUniDirection Since Qt 5.5. If the cursor has
- to move towards the submenu (like it is on OS X), or if the
+ to move towards the submenu (like it is on \macos), or if the
cursor can move in any direction as long as it reaches the
submenu before the sloppy timeout.
diff --git a/src/widgets/styles/qstyleoption.cpp b/src/widgets/styles/qstyleoption.cpp
index 73e6f69041..71cf2fb267 100644
--- a/src/widgets/styles/qstyleoption.cpp
+++ b/src/widgets/styles/qstyleoption.cpp
@@ -1750,7 +1750,7 @@ QStyleOptionMenuItem::QStyleOptionMenuItem(int version)
\value DefaultItem A menu item that is the default action as specified with \l QMenu::defaultAction().
\value Separator A menu separator.
\value SubMenu Indicates the menu item points to a sub-menu.
- \value Scroller A popup menu scroller (currently only used on OS X).
+ \value Scroller A popup menu scroller (currently only used on \macos).
\value TearOff A tear-off handle for the menu.
\value Margin The margin of the menu.
\value EmptyArea The empty area of the menu.
diff --git a/src/widgets/styles/styles.pri b/src/widgets/styles/styles.pri
index 1805e4a8af..7b9497172c 100644
--- a/src/widgets/styles/styles.pri
+++ b/src/widgets/styles/styles.pri
@@ -35,12 +35,6 @@ SOURCES += \
RESOURCES += styles/qstyle.qrc
-contains( styles, all ) {
- styles = fusion mac windows windowsxp windowsvista
-}
-
-!macx:styles -= mac
-
contains( styles, mac ) {
HEADERS += \
styles/qmacstyle_mac_p.h \
@@ -55,10 +49,6 @@ contains( styles, windowsvista ) {
HEADERS += styles/qwindowsvistastyle_p.h
HEADERS += styles/qwindowsvistastyle_p_p.h
SOURCES += styles/qwindowsvistastyle.cpp
- !contains( styles, windowsxp ) {
- message( windowsvista requires windowsxp )
- styles += windowsxp
- }
} else {
DEFINES += QT_NO_STYLE_WINDOWSVISTA
}
@@ -67,10 +57,6 @@ contains( styles, windowsxp ) {
HEADERS += styles/qwindowsxpstyle_p.h
HEADERS += styles/qwindowsxpstyle_p_p.h
SOURCES += styles/qwindowsxpstyle.cpp
- !contains( styles, windows ) {
- message( windowsxp requires windows )
- styles += windows
- }
} else {
DEFINES += QT_NO_STYLE_WINDOWSXP
}
diff --git a/src/widgets/util/qscroller.cpp b/src/widgets/util/qscroller.cpp
index f3b442928a..9973940c16 100644
--- a/src/widgets/util/qscroller.cpp
+++ b/src/widgets/util/qscroller.cpp
@@ -564,7 +564,7 @@ void QScroller::stop()
\note Please note that this value should be physically correct. The actual DPI settings
that Qt returns for the display may be reported wrongly on purpose by the underlying
- windowing system, for example on OS X.
+ windowing system, for example on \macos.
*/
QPointF QScroller::pixelPerMeter() const
{
diff --git a/src/widgets/util/qsystemtrayicon.cpp b/src/widgets/util/qsystemtrayicon.cpp
index 7b0ecc6972..2a418167f1 100644
--- a/src/widgets/util/qsystemtrayicon.cpp
+++ b/src/widgets/util/qsystemtrayicon.cpp
@@ -82,9 +82,9 @@ QT_BEGIN_NAMESPACE
\li All X11 desktop environments that implement the D-Bus
\l{http://www.freedesktop.org/wiki/Specifications/StatusNotifierItem/StatusNotifierItem}
specification, including recent versions of KDE and Unity.
- \li All supported versions of OS X. Note that the Growl
+ \li All supported versions of \macos. Note that the Growl
notification system must be installed for
- QSystemTrayIcon::showMessage() to display messages on Mac OS X prior to 10.8 (Mountain Lion).
+ QSystemTrayIcon::showMessage() to display messages on \macos prior to 10.8 (Mountain Lion).
\endlist
To check whether a system tray is present on the user's desktop,
@@ -163,7 +163,7 @@ QSystemTrayIcon::~QSystemTrayIcon()
The menu will pop up when the user requests the context menu for the system
tray icon by clicking the mouse button.
- On OS X, this is currenly converted to a NSMenu, so the
+ On \macos, this is currenly converted to a NSMenu, so the
aboutToHide() signal is not emitted.
\note The system tray icon does not take ownership of the menu. You must
@@ -323,7 +323,7 @@ bool QSystemTrayIcon::event(QEvent *e)
This signal is emitted when the message displayed using showMessage()
was clicked by the user.
- Currently this signal is not sent on OS X.
+ Currently this signal is not sent on \macos.
\note We follow Microsoft Windows XP/Vista behavior, so the
signal is also emitted when the user clicks on a tray icon with
@@ -374,7 +374,7 @@ bool QSystemTrayIcon::supportsMessages()
On Windows, the \a millisecondsTimeoutHint is usually ignored by the system
when the application has focus.
- On OS X, the Growl notification system must be installed for this function to
+ On \macos, the Growl notification system must be installed for this function to
display messages.
Has been turned into a slot in Qt 5.2.
@@ -731,9 +731,8 @@ void QSystemTrayIconPrivate::addPlatformMenu(QMenu *menu) const
// The recursion depth is the same as menu depth, so should not
// be higher than 3 levels.
- QListIterator<QAction *> it(menu->actions());
- while (it.hasNext()) {
- QAction *action = it.next();
+ const auto actions = menu->actions();
+ for (QAction *action : actions) {
if (action->menu())
addPlatformMenu(action->menu());
}
diff --git a/src/widgets/util/util.pri b/src/widgets/util/util.pri
index 700831771d..cb19c1fc95 100644
--- a/src/widgets/util/util.pri
+++ b/src/widgets/util/util.pri
@@ -29,7 +29,7 @@ SOURCES += \
win32:!winrt {
SOURCES += util/qsystemtrayicon_win.cpp
-} else:contains(QT_CONFIG, xcb) {
+} else: qtConfig(xcb) {
SOURCES += util/qsystemtrayicon_x11.cpp
} else {
SOURCES += util/qsystemtrayicon_qpa.cpp
diff --git a/src/widgets/widgets/qdialogbuttonbox.cpp b/src/widgets/widgets/qdialogbuttonbox.cpp
index 0d369eb28c..657eda3c68 100644
--- a/src/widgets/widgets/qdialogbuttonbox.cpp
+++ b/src/widgets/widgets/qdialogbuttonbox.cpp
@@ -124,7 +124,7 @@ QT_BEGIN_NAMESPACE
\endtable
Additionally, button boxes that contain only buttons with ActionRole or
- HelpRole can be considered modeless and have an alternate look on OS X:
+ HelpRole can be considered modeless and have an alternate look on \macos:
\table
\row \li modeless horizontal MacLayout
@@ -579,7 +579,7 @@ QDialogButtonBox::~QDialogButtonBox()
contained in the button box.
\value WinLayout Use a policy appropriate for applications on Windows.
- \value MacLayout Use a policy appropriate for applications on OS X.
+ \value MacLayout Use a policy appropriate for applications on \macos.
\value KdeLayout Use a policy appropriate for applications on KDE.
\value GnomeLayout Use a policy appropriate for applications on GNOME.
diff --git a/src/widgets/widgets/qmaccocoaviewcontainer_mac.mm b/src/widgets/widgets/qmaccocoaviewcontainer_mac.mm
index 2d19780461..725cc637d6 100644
--- a/src/widgets/widgets/qmaccocoaviewcontainer_mac.mm
+++ b/src/widgets/widgets/qmaccocoaviewcontainer_mac.mm
@@ -49,7 +49,7 @@
\class QMacCocoaViewContainer
\since 4.5
- \brief The QMacCocoaViewContainer class provides a widget for OS X that can be used to wrap arbitrary
+ \brief The QMacCocoaViewContainer class provides a widget for \macos that can be used to wrap arbitrary
Cocoa views (i.e., NSView subclasses) and insert them into Qt hierarchies.
\ingroup advanced
@@ -64,10 +64,10 @@
of the underlying NSView.
QMacCocoaViewContainer works regardless if Qt is built against Carbon or
- Cocoa. However, QCocoaContainerView requires Mac OS X 10.5 or better to be
+ Cocoa. However, QCocoaContainerView requires \macos 10.5 or better to be
used with Carbon.
- It should be also noted that at the low level on OS X, there is a
+ It should be also noted that at the low level on \macos, there is a
difference between windows (top-levels) and view (widgets that are inside a
window). For this reason, make sure that the NSView that you are wrapping
doesn't end up as a top-level. The best way to ensure this is to make sure
diff --git a/src/widgets/widgets/qmacnativewidget_mac.h b/src/widgets/widgets/qmacnativewidget_mac.h
index 44e793f174..84389f16df 100644
--- a/src/widgets/widgets/qmacnativewidget_mac.h
+++ b/src/widgets/widgets/qmacnativewidget_mac.h
@@ -47,7 +47,6 @@ Q_FORWARD_DECLARE_OBJC_CLASS(NSView);
QT_BEGIN_NAMESPACE
-class QMacNativeWidgetPrivate;
class Q_WIDGETS_EXPORT QMacNativeWidget : public QWidget
{
Q_OBJECT
@@ -60,9 +59,6 @@ public:
protected:
bool event(QEvent *ev);
-
-private:
- Q_DECLARE_PRIVATE(QMacNativeWidget)
};
QT_END_NAMESPACE
diff --git a/src/widgets/widgets/qmacnativewidget_mac.mm b/src/widgets/widgets/qmacnativewidget_mac.mm
index b6c5179989..936bd35187 100644
--- a/src/widgets/widgets/qmacnativewidget_mac.mm
+++ b/src/widgets/widgets/qmacnativewidget_mac.mm
@@ -48,13 +48,13 @@
/*!
\class QMacNativeWidget
\since 4.5
- \brief The QMacNativeWidget class provides a widget for OS X that provides
+ \brief The QMacNativeWidget class provides a widget for \macos that provides
a way to put Qt widgets into Cocoa hierarchies.
\ingroup advanced
\inmodule QtWidgets
- On OS X, there is a difference between a window and view;
+ On \macos, there is a difference between a window and view;
normally expressed as widgets in Qt. Qt makes assumptions about its
parent-child hierarchy that make it complex to put an arbitrary Qt widget
into a hierarchy of "normal" views from Apple frameworks. QMacNativeWidget
diff --git a/src/widgets/widgets/qmainwindow.cpp b/src/widgets/widgets/qmainwindow.cpp
index c31e9750bf..2477510520 100644
--- a/src/widgets/widgets/qmainwindow.cpp
+++ b/src/widgets/widgets/qmainwindow.cpp
@@ -1559,7 +1559,7 @@ bool QMainWindow::event(QEvent *event)
/*!
\property QMainWindow::unifiedTitleAndToolBarOnMac
- \brief whether the window uses the unified title and toolbar look on OS X
+ \brief whether the window uses the unified title and toolbar look on \macos
Note that the Qt 5 implementation has several limitations compared to Qt 4:
\list
diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp
index 2131025c8d..5cea9a9ea2 100644
--- a/src/widgets/widgets/qmenu.cpp
+++ b/src/widgets/widgets/qmenu.cpp
@@ -1441,7 +1441,7 @@ void QMenu::initStyleOption(QStyleOptionMenuItem *option, const QAction *action)
do not support the signals: aboutToHide (), aboutToShow () and hovered ().
It is not possible to display an icon in a native menu on Windows Mobile.
- \section1 QMenu on OS X with Qt Build Against Cocoa
+ \section1 QMenu on \macos with Qt Build Against Cocoa
QMenu can be inserted only once in a menu/menubar. Subsequent insertions will
have no effect or will result in a disabled menu item.
diff --git a/src/widgets/widgets/qmenu_mac.mm b/src/widgets/widgets/qmenu_mac.mm
index d48041b385..fef1eb2cf4 100644
--- a/src/widgets/widgets/qmenu_mac.mm
+++ b/src/widgets/widgets/qmenu_mac.mm
@@ -73,7 +73,7 @@ inline QPlatformNativeInterface::NativeResourceForIntegrationFunction resolvePla
/*!
\since 5.2
- Returns the native NSMenu for this menu. Available on OS X only.
+ Returns the native NSMenu for this menu. Available on \macos only.
\note Qt sets the delegate on the native menu. If you need to set your own
delegate, make sure you save the original one and forward any calls to it.
@@ -94,7 +94,7 @@ NSMenu *QMenu::toNSMenu()
\since 5.2
Set this menu to be the dock menu available by option-clicking
- on the application dock icon. Available on OS X only.
+ on the application dock icon. Available on \macos only.
*/
void QMenu::setAsDockMenu()
{
@@ -112,7 +112,7 @@ void QMenu::setAsDockMenu()
\deprecated
Sets this \a menu to be the dock menu available by option-clicking
- on the application dock icon. Available on OS X only.
+ on the application dock icon. Available on \macos only.
Deprecated; use \l QMenu::setAsDockMenu() instead.
*/
@@ -142,7 +142,7 @@ void QMenuPrivate::moveWidgetToPlatformItem(QWidget *widget, QPlatformMenuItem*
/*!
\since 5.2
- Returns the native NSMenu for this menu bar. Available on OS X only.
+ Returns the native NSMenu for this menu bar. Available on \macos only.
\note Qt may set the delegate on the native menu bar. If you need to set your
own delegate, make sure you save the original one and forward any calls to it.
diff --git a/src/widgets/widgets/qmenubar.cpp b/src/widgets/widgets/qmenubar.cpp
index 3a90e14655..45b7b3091a 100644
--- a/src/widgets/widgets/qmenubar.cpp
+++ b/src/widgets/widgets/qmenubar.cpp
@@ -612,15 +612,15 @@ void QMenuBar::initStyleOption(QStyleOptionMenuItem *option, const QAction *acti
for items in the menu bar are only shown when the \uicontrol{Alt} key is
pressed.
- \section1 QMenuBar on OS X
+ \section1 QMenuBar on \macos
- QMenuBar on OS X is a wrapper for using the system-wide menu bar.
+ QMenuBar on \macos is a wrapper for using the system-wide menu bar.
If you have multiple menu bars in one dialog the outermost menu bar
(normally inside a widget with widget flag Qt::Window) will
be used for the system-wide menu bar.
- Qt for OS X also provides a menu bar merging feature to make
- QMenuBar conform more closely to accepted OS X menu bar layout.
+ Qt for \macos also provides a menu bar merging feature to make
+ QMenuBar conform more closely to accepted \macos menu bar layout.
The merging functionality is based on string matching the title of
a QMenu entry. These strings are translated (using QObject::tr())
in the "QMenuBar" context. If an entry is moved its slots will still
@@ -659,7 +659,7 @@ void QMenuBar::initStyleOption(QStyleOptionMenuItem *option, const QAction *acti
\b{Note:} The text used for the application name in the menu
bar is obtained from the value set in the \c{Info.plist} file in
- the application's bundle. See \l{Qt for OS X - Deployment}
+ the application's bundle. See \l{Qt for macOS - Deployment}
for more information.
\section1 QMenuBar on Windows CE
@@ -889,7 +889,7 @@ void QMenuBar::setActiveAction(QAction *act)
/*!
Removes all the actions from the menu bar.
- \note On OS X, menu items that have been merged to the system
+ \note On \macos, menu items that have been merged to the system
menu bar are not removed by this function. One way to handle this
would be to remove the extra actions yourself. You can set the
\l{QAction::MenuRole}{menu role} on the different menus, so that
@@ -1794,7 +1794,7 @@ QWidget *QMenuBar::cornerWidget(Qt::Corner corner) const
\since 4.6
This property specifies whether or not the menubar should be used as a native menubar on platforms
- that support it. The currently supported platforms are OS X and Windows CE. On these platforms
+ that support it. The currently supported platforms are \macos and Windows CE. On these platforms
if this property is \c true, the menubar is used in the native menubar and is not in the window of
its parent, if false the menubar remains in the window. On other platforms the value of this
attribute has no effect.
diff --git a/src/widgets/widgets/qrubberband.cpp b/src/widgets/widgets/qrubberband.cpp
index 13aa66dec7..123c955684 100644
--- a/src/widgets/widgets/qrubberband.cpp
+++ b/src/widgets/widgets/qrubberband.cpp
@@ -132,7 +132,7 @@ void QRubberBand::initStyleOption(QStyleOptionRubberBand *option) const
By default a rectangular rubber band (\a s is \c Rectangle) will
use a mask, so that a small border of the rectangle is all
- that is visible. Some styles (e.g., native OS X) will
+ that is visible. Some styles (e.g., native \macos) will
change this and call QWidget::setWindowOpacity() to make a
semi-transparent filled selection rectangle.
*/
diff --git a/src/widgets/widgets/qtabbar.cpp b/src/widgets/widgets/qtabbar.cpp
index fe04299b92..d56c6b39d1 100644
--- a/src/widgets/widgets/qtabbar.cpp
+++ b/src/widgets/widgets/qtabbar.cpp
@@ -140,60 +140,59 @@ void QTabBarPrivate::updateMacBorderMetrics()
}
/*!
- Initialize \a option with the values from the tab at \a tabIndex. This method
- is useful for subclasses when they need a QStyleOptionTab,
- but don't want to fill in all the information themselves.
-
- \sa QStyleOption::initFrom(), QTabWidget::initStyleOption()
+ \internal
+ This is basically QTabBar::initStyleOption() but
+ without the expensive QFontMetrics::elidedText() call.
*/
-void QTabBar::initStyleOption(QStyleOptionTab *option, int tabIndex) const
+
+void QTabBarPrivate::initBasicStyleOption(QStyleOptionTab *option, int tabIndex) const
{
- Q_D(const QTabBar);
- int totalTabs = d->tabList.size();
+ Q_Q(const QTabBar);
+ const int totalTabs = tabList.size();
if (!option || (tabIndex < 0 || tabIndex >= totalTabs))
return;
- const QTabBarPrivate::Tab &tab = d->tabList.at(tabIndex);
- option->initFrom(this);
+ const QTabBarPrivate::Tab &tab = tabList.at(tabIndex);
+ option->initFrom(q);
option->state &= ~(QStyle::State_HasFocus | QStyle::State_MouseOver);
- option->rect = tabRect(tabIndex);
- bool isCurrent = tabIndex == d->currentIndex;
+ option->rect = q->tabRect(tabIndex);
+ const bool isCurrent = tabIndex == currentIndex;
option->row = 0;
- if (tabIndex == d->pressedIndex)
+ if (tabIndex == pressedIndex)
option->state |= QStyle::State_Sunken;
if (isCurrent)
option->state |= QStyle::State_Selected;
- if (isCurrent && hasFocus())
+ if (isCurrent && q->hasFocus())
option->state |= QStyle::State_HasFocus;
if (!tab.enabled)
option->state &= ~QStyle::State_Enabled;
- if (isActiveWindow())
+ if (q->isActiveWindow())
option->state |= QStyle::State_Active;
- if (!d->dragInProgress && option->rect == d->hoverRect)
+ if (!dragInProgress && option->rect == hoverRect)
option->state |= QStyle::State_MouseOver;
- option->shape = d->shape;
+ option->shape = shape;
option->text = tab.text;
if (tab.textColor.isValid())
- option->palette.setColor(foregroundRole(), tab.textColor);
+ option->palette.setColor(q->foregroundRole(), tab.textColor);
option->icon = tab.icon;
- option->iconSize = iconSize(); // Will get the default value then.
+ option->iconSize = q->iconSize(); // Will get the default value then.
option->leftButtonSize = tab.leftWidget ? tab.leftWidget->size() : QSize();
option->rightButtonSize = tab.rightWidget ? tab.rightWidget->size() : QSize();
- option->documentMode = d->documentMode;
+ option->documentMode = documentMode;
- if (tabIndex > 0 && tabIndex - 1 == d->currentIndex)
+ if (tabIndex > 0 && tabIndex - 1 == currentIndex)
option->selectedPosition = QStyleOptionTab::PreviousIsSelected;
- else if (tabIndex + 1 < totalTabs && tabIndex + 1 == d->currentIndex)
+ else if (tabIndex + 1 < totalTabs && tabIndex + 1 == currentIndex)
option->selectedPosition = QStyleOptionTab::NextIsSelected;
else
option->selectedPosition = QStyleOptionTab::NotAdjacent;
- bool paintBeginning = (tabIndex == 0) || (d->dragInProgress && tabIndex == d->pressedIndex + 1);
- bool paintEnd = (tabIndex == totalTabs - 1) || (d->dragInProgress && tabIndex == d->pressedIndex - 1);
+ const bool paintBeginning = (tabIndex == 0) || (dragInProgress && tabIndex == pressedIndex + 1);
+ const bool paintEnd = (tabIndex == totalTabs - 1) || (dragInProgress && tabIndex == pressedIndex - 1);
if (paintBeginning) {
if (paintEnd)
option->position = QStyleOptionTab::OnlyOneTab;
@@ -206,7 +205,7 @@ void QTabBar::initStyleOption(QStyleOptionTab *option, int tabIndex) const
}
#ifndef QT_NO_TABWIDGET
- if (const QTabWidget *tw = qobject_cast<const QTabWidget *>(parentWidget())) {
+ if (const QTabWidget *tw = qobject_cast<const QTabWidget *>(q->parentWidget())) {
option->features |= QStyleOptionTab::HasFrame;
if (tw->cornerWidget(Qt::TopLeftCorner) || tw->cornerWidget(Qt::BottomLeftCorner))
option->cornerWidgets |= QStyleOptionTab::LeftCornerWidget;
@@ -214,6 +213,19 @@ void QTabBar::initStyleOption(QStyleOptionTab *option, int tabIndex) const
option->cornerWidgets |= QStyleOptionTab::RightCornerWidget;
}
#endif
+}
+
+/*!
+ Initialize \a option with the values from the tab at \a tabIndex. This method
+ is useful for subclasses when they need a QStyleOptionTab,
+ but don't want to fill in all the information themselves.
+
+ \sa QStyleOption::initFrom(), QTabWidget::initStyleOption()
+*/
+void QTabBar::initStyleOption(QStyleOptionTab *option, int tabIndex) const
+{
+ Q_D(const QTabBar);
+ d->initBasicStyleOption(option, tabIndex);
QRect textRect = style()->subElementRect(QStyle::SE_TabBarTabText, option, this);
option->text = fontMetrics().elidedText(option->text, d->elideMode, textRect.width(),
@@ -1094,6 +1106,7 @@ void QTabBar::setTabText(int index, const QString &text)
{
Q_D(QTabBar);
if (QTabBarPrivate::Tab *tab = d->at(index)) {
+ d->textSizes.remove(tab->text);
tab->text = text;
#ifndef QT_NO_SHORTCUT
releaseShortcut(tab->shortcutId);
@@ -1453,7 +1466,7 @@ QSize QTabBar::tabSizeHint(int index) const
Q_D(const QTabBar);
if (const QTabBarPrivate::Tab *tab = d->at(index)) {
QStyleOptionTab opt;
- initStyleOption(&opt, index);
+ d->initBasicStyleOption(&opt, index);
opt.text = d->tabList.at(index).text;
QSize iconSize = tab->icon.isNull() ? QSize(0, 0) : opt.iconSize;
int hframe = style()->pixelMetric(QStyle::PM_TabBarTabHSpace, &opt, this);
@@ -1479,13 +1492,16 @@ QSize QTabBar::tabSizeHint(int index) const
if (!opt.icon.isNull())
padding += 4;
+ QHash<QString, QSize>::iterator it = d->textSizes.find(tab->text);
+ if (it == d->textSizes.end())
+ it = d->textSizes.insert(tab->text, fm.size(Qt::TextShowMnemonic, tab->text));
+ const int textWidth = it.value().width();
QSize csz;
if (verticalTabs(d->shape)) {
csz = QSize( qMax(maxWidgetWidth, qMax(fm.height(), iconSize.height())) + vframe,
- fm.size(Qt::TextShowMnemonic, tab->text).width() + iconSize.width() + hframe + widgetHeight + padding);
+ textWidth + iconSize.width() + hframe + widgetHeight + padding);
} else {
- csz = QSize(fm.size(Qt::TextShowMnemonic, tab->text).width() + iconSize.width() + hframe
- + widgetWidth + padding,
+ csz = QSize(textWidth + iconSize.width() + hframe + widgetWidth + padding,
qMax(maxWidgetHeight, qMax(fm.height(), iconSize.height())) + vframe);
}
@@ -2157,15 +2173,21 @@ void QTabBarPrivate::setCurrentNextEnabledIndex(int offset)
void QTabBar::changeEvent(QEvent *event)
{
Q_D(QTabBar);
- if (event->type() == QEvent::StyleChange) {
+ switch (event->type()) {
+ case QEvent::StyleChange:
if (!d->elideModeSetByUser)
d->elideMode = Qt::TextElideMode(style()->styleHint(QStyle::SH_TabBar_ElideMode, 0, this));
if (!d->useScrollButtonsSetByUser)
d->useScrollButtons = !style()->styleHint(QStyle::SH_TabBar_PreferNoArrows, 0, this);
+ // fallthrough
+ case QEvent::FontChange:
+ d->textSizes.clear();
d->refresh();
- } else if (event->type() == QEvent::FontChange) {
- d->refresh();
+ break;
+ default:
+ break;
}
+
QWidget::changeEvent(event);
}
@@ -2208,6 +2230,7 @@ void QTabBar::setElideMode(Qt::TextElideMode mode)
Q_D(QTabBar);
d->elideMode = mode;
d->elideModeSetByUser = true;
+ d->textSizes.clear();
d->refresh();
}
@@ -2398,7 +2421,7 @@ void QTabBar::setMovable(bool movable)
\since 4.5
This property is used as a hint for styles to draw the tabs in a different
- way then they would normally look in a tab widget. On OS X this will
+ way then they would normally look in a tab widget. On \macos this will
look similar to the tabs in Safari or Leopard's Terminal.app.
\sa QTabWidget::documentMode
diff --git a/src/widgets/widgets/qtabbar_p.h b/src/widgets/widgets/qtabbar_p.h
index 04adf96881..0e9dce84b3 100644
--- a/src/widgets/widgets/qtabbar_p.h
+++ b/src/widgets/widgets/qtabbar_p.h
@@ -169,6 +169,7 @@ public:
#endif //QT_NO_ANIMATION
};
QList<Tab> tabList;
+ mutable QHash<QString, QSize> textSizes;
int calculateNewPosition(int from, int to, int index) const;
void slide(int from, int to);
@@ -202,6 +203,8 @@ public:
void autoHideTabs();
QRect normalizedScrollRect(int index = -1);
+ void initBasicStyleOption(QStyleOptionTab *option, int tabIndex) const;
+
void makeVisible(int index);
QSize iconSize;
Qt::TextElideMode elideMode;
diff --git a/src/widgets/widgets/qtabwidget.cpp b/src/widgets/widgets/qtabwidget.cpp
index 3ddf4df624..5dce76056c 100644
--- a/src/widgets/widgets/qtabwidget.cpp
+++ b/src/widgets/widgets/qtabwidget.cpp
@@ -1322,7 +1322,7 @@ void QTabWidget::setUsesScrollButtons(bool useButtons)
/*!
\property QTabWidget::documentMode
\brief Whether or not the tab widget is rendered in a mode suitable for document
- pages. This is the same as document mode on OS X.
+ pages. This is the same as document mode on \macos.
\since 4.5
When this property is set the tab widget frame is not rendered. This mode is useful
diff --git a/src/widgets/widgets/qtoolbar.cpp b/src/widgets/widgets/qtoolbar.cpp
index b93cefd867..61bc6d19cf 100644
--- a/src/widgets/widgets/qtoolbar.cpp
+++ b/src/widgets/widgets/qtoolbar.cpp
@@ -405,7 +405,7 @@ void QToolBarPrivate::plug(const QRect &r)
When a toolbar is resized in such a way that it is too small to
show all the items it contains, an extension button will appear as
the last item in the toolbar. Pressing the extension button will
- pop up a menu containing the items that does not currently fit in
+ pop up a menu containing the items that do not currently fit in
the toolbar.
When a QToolBar is not a child of a QMainWindow, it loses the ability
diff --git a/src/widgets/widgets/qtoolbutton.cpp b/src/widgets/widgets/qtoolbutton.cpp
index aef4634a9a..8b40325a24 100644
--- a/src/widgets/widgets/qtoolbutton.cpp
+++ b/src/widgets/widgets/qtoolbutton.cpp
@@ -876,7 +876,7 @@ QToolButton::ToolButtonPopupMode QToolButton::popupMode() const
The default is disabled (i.e. false).
- This property is currently ignored on OS X when using QMacStyle.
+ This property is currently ignored on \macos when using QMacStyle.
*/
void QToolButton::setAutoRaise(bool enable)
{
diff --git a/src/winmain/winmain.pro b/src/winmain/winmain.pro
index 2bb7529456..4140ae48de 100644
--- a/src/winmain/winmain.pro
+++ b/src/winmain/winmain.pro
@@ -10,7 +10,7 @@ QT = core
DEFINES += QT_NO_FOREACH
-contains(QT_CONFIG, debug_and_release): CONFIG += build_all
+qtConfig(debug_and_release): CONFIG += build_all
win32-msvc*:QMAKE_CFLAGS_DEBUG -= -Zi
win32-msvc*:QMAKE_CXXFLAGS_DEBUG -= -Zi
diff --git a/sync.profile b/sync.profile
index 1d1c08fc0f..0860c7692a 100644
--- a/sync.profile
+++ b/sync.profile
@@ -64,8 +64,8 @@ my @internal_zlib_headers = ( "crc32.h", "deflate.h", "gzguts.h", "inffast.h", "
my @zlib_headers = ( "zconf.h", "zlib.h" );
@ignore_headers = ( @internal_zlib_headers );
@ignore_for_include_check = ( "qsystemdetection.h", "qcompilerdetection.h", "qprocessordetection.h", @zlib_headers, @angle_headers);
-@ignore_for_qt_begin_namespace_check = ( "qconfig.h", "qconfig-dist.h", "qconfig-large.h", "qconfig-medium.h", "qconfig-minimal.h", "qconfig-small.h", "qfeatures.h", "qatomic_arch.h", "qatomic_windowsce.h", "qt_windows.h", "qatomic_macosx.h", @zlib_headers, @angle_headers);
-%inject_headers = ( "$basedir/src/corelib/global" => [ "qconfig.h", "qfeatures.h" ] );
+@ignore_for_qt_begin_namespace_check = ( "qt_windows.h", @zlib_headers, @angle_headers);
+%inject_headers = ( "$basedir/src/corelib/global" => [ "qconfig.h", "qconfig_p.h", "qfeatures.h" ] );
# Module dependencies.
# Every module that is required to build this module should have one entry.
# Each of the module version specifiers can take one of the following values:
diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro
index 8a3c39e9b1..cadd97fb3a 100644
--- a/tests/auto/auto.pro
+++ b/tests/auto/auto.pro
@@ -34,7 +34,7 @@ cross_compile: SUBDIRS -= tools cmake installed_cma
# Disable the QtDBus tests if we can't connect to the session bus
!cross_compile:qtHaveModule(dbus) {
!system("dbus-send --session --type=signal / local.AutotestCheck.Hello >/dev/null 2>&1") {
- contains(QT_CONFIG, dbus-linked): \
+ qtConfig(dbus-linked): \
error("QtDBus is enabled but session bus is not available. Please check the installation.")
else: \
warning("QtDBus is enabled with runtime support, but session bus is not available. Skipping QtDBus tests.")
diff --git a/tests/auto/corelib/global/qflags/qflags.pro b/tests/auto/corelib/global/qflags/qflags.pro
index 29dfb0684c..c3c11fa81b 100644
--- a/tests/auto/corelib/global/qflags/qflags.pro
+++ b/tests/auto/corelib/global/qflags/qflags.pro
@@ -2,5 +2,5 @@ CONFIG += testcase
TARGET = tst_qflags
QT = core testlib
SOURCES = tst_qflags.cpp
-contains(QT_CONFIG, c++11): CONFIG += c++11
-contains(QT_CONFIG, c++14): CONFIG += c++14
+qtConfig(c++11): CONFIG += c++11
+qtConfig(c++14): CONFIG += c++14
diff --git a/tests/auto/corelib/global/qlogging/test/test.pro b/tests/auto/corelib/global/qlogging/test/test.pro
index b5b75be3a6..93eee7307a 100644
--- a/tests/auto/corelib/global/qlogging/test/test.pro
+++ b/tests/auto/corelib/global/qlogging/test/test.pro
@@ -1,7 +1,7 @@
CONFIG += testcase
CONFIG -= app_bundle debug_and_release_target
-contains(QT_CONFIG, c++11): CONFIG += c++11
-contains(QT_CONFIG, c++14): CONFIG += c++14
+qtConfig(c++11): CONFIG += c++11
+qtConfig(c++14): CONFIG += c++14
TARGET = ../tst_qlogging
QT = core testlib
SOURCES = ../tst_qlogging.cpp
diff --git a/tests/auto/corelib/io/io.pro b/tests/auto/corelib/io/io.pro
index 24c762ed84..0542833456 100644
--- a/tests/auto/corelib/io/io.pro
+++ b/tests/auto/corelib/io/io.pro
@@ -49,14 +49,14 @@ SUBDIRS=\
qprocess \
qtextstream
-!contains(QT_CONFIG, private_tests): SUBDIRS -= \
+!qtConfig(private_tests): SUBDIRS -= \
qabstractfileengine \
qfileinfo \
qipaddress \
qurlinternal \
qloggingregistry
-win32:!contains(QT_CONFIG, private_tests): SUBDIRS -= \
+win32:!qtConfig(private_tests): SUBDIRS -= \
qfilesystementry
winrt: SUBDIRS -= \
diff --git a/tests/auto/corelib/io/qfile/tst_qfile.cpp b/tests/auto/corelib/io/qfile/tst_qfile.cpp
index 4c9986d50e..021d581aac 100644
--- a/tests/auto/corelib/io/qfile/tst_qfile.cpp
+++ b/tests/auto/corelib/io/qfile/tst_qfile.cpp
@@ -155,10 +155,12 @@ private slots:
void copyRemovesTemporaryFile() const;
void copyShouldntOverwrite();
void copyFallback();
+#ifndef Q_OS_WINRT
void link();
void linkToDir();
void absolutePathLinkToRelativePath();
void readBrokenLink();
+#endif
void readTextFile_data();
void readTextFile();
void readTextFile2();
@@ -568,7 +570,7 @@ void tst_QFile::open()
QSKIP("Running this test as root doesn't make sense");
#endif
-#if defined(Q_OS_WIN32)
+#if defined(Q_OS_WIN32) || defined(Q_OS_WINRT)
QEXPECT_FAIL("noreadfile", "Windows does not currently support non-readable files.", Abort);
#endif
if (filename.isEmpty())
@@ -1226,7 +1228,7 @@ void tst_QFile::permissions()
QFile::remove(file);
}
-#ifdef Q_OS_WIN
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
if (qt_ntfs_permission_lookup)
QEXPECT_FAIL("readonly", "QTBUG-25630", Abort);
#endif
@@ -1413,6 +1415,7 @@ static QString getWorkingDirectoryForLink(const QString &linkFileName)
}
#endif
+#ifndef Q_OS_WINRT
void tst_QFile::link()
{
QFile::remove("myLink.lnk");
@@ -1433,7 +1436,7 @@ void tst_QFile::link()
QCOMPARE(QFile::symLinkTarget("myLink.lnk"), referenceTarget);
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN)
QString wd = getWorkingDirectoryForLink(info2.absoluteFilePath());
QCOMPARE(QDir::fromNativeSeparators(wd), QDir::cleanPath(info1.absolutePath()));
#endif
@@ -1487,6 +1490,7 @@ void tst_QFile::readBrokenLink()
QVERIFY(QFile::link("ole/..", "myLink2.lnk"));
QCOMPARE(QFileInfo("myLink2.lnk").symLinkTarget(), QDir::currentPath());
}
+#endif // Q_OS_WINRT
void tst_QFile::readTextFile_data()
{
@@ -2505,7 +2509,7 @@ void tst_QFile::rename()
\since 4.5
Some special files have QFile::atEnd() returning true, even though there is
- more data available. True for corner cases, as well as some mounts on OS X.
+ more data available. True for corner cases, as well as some mounts on \macos.
Here, we reproduce that condition by having a QFile sub-class with this
peculiar atEnd() behavior.
diff --git a/tests/auto/corelib/io/qprocess/tst_qprocess.cpp b/tests/auto/corelib/io/qprocess/tst_qprocess.cpp
index 0bc1e77925..3f3533c9a1 100644
--- a/tests/auto/corelib/io/qprocess/tst_qprocess.cpp
+++ b/tests/auto/corelib/io/qprocess/tst_qprocess.cpp
@@ -734,6 +734,7 @@ void tst_QProcess::restartProcess()
void tst_QProcess::closeWriteChannel()
{
+ QByteArray testData("Data to read");
QProcess more;
more.start("testProcessEOF/testProcessEOF");
@@ -741,19 +742,21 @@ void tst_QProcess::closeWriteChannel()
QVERIFY(!more.waitForReadyRead(250));
QCOMPARE(more.error(), QProcess::Timedout);
- QVERIFY(more.write("Data to read") != -1);
+ QCOMPARE(more.write(testData), qint64(testData.size()));
QVERIFY(!more.waitForReadyRead(250));
QCOMPARE(more.error(), QProcess::Timedout);
more.closeWriteChannel();
-
- QVERIFY(more.waitForReadyRead(5000));
- QVERIFY(more.readAll().startsWith("Data to read"));
+ // During closeWriteChannel() call, we might also get an I/O completion
+ // on the read pipe. So, take this into account before waiting for
+ // the new incoming data.
+ while (more.bytesAvailable() < testData.size())
+ QVERIFY(more.waitForReadyRead(5000));
+ QCOMPARE(more.readAll(), testData);
if (more.state() == QProcess::Running)
- more.write("q");
- QVERIFY(more.waitForFinished(5000));
+ QVERIFY(more.waitForFinished(5000));
QCOMPARE(more.exitStatus(), QProcess::NormalExit);
QCOMPARE(more.exitCode(), 0);
}
diff --git a/tests/auto/corelib/io/qurl/tst_qurl.cpp b/tests/auto/corelib/io/qurl/tst_qurl.cpp
index e982660bef..f589fe1d6d 100644
--- a/tests/auto/corelib/io/qurl/tst_qurl.cpp
+++ b/tests/auto/corelib/io/qurl/tst_qurl.cpp
@@ -898,13 +898,11 @@ void tst_QUrl::resolving_data()
// Some parsers allow the scheme name to be present in a relative URI
// reference if it is the same as the base URI scheme. This is
- // considered to be a loophole in prior specifications of partial URI
- // [RFC1630]. Its use should be avoided, but is allowed for backward
- // compatibility.
- // For strict parsers :
-// QTest::newRow("http:g [for strict parsers]") << QString::fromLatin1("http://a/b/c/d;p?q") << QString::fromLatin1("http:g") << QString::fromLatin1("http:g");
- // For backward compatibility :
- QTest::newRow("http:g [for backward compatibility]") << QString::fromLatin1("http://a/b/c/d;p?q") << QString::fromLatin1("http:g") << QString::fromLatin1("http://a/b/c/g");
+ // considered to be a loophole in prior specifications of partial URI [RFC1630],
+ //QTest::newRow("http:g [for backward compatibility]") << QString::fromLatin1("http://a/b/c/d;p?q") << QString::fromLatin1("http:g") << QString::fromLatin1("http://a/b/c/g");
+ // However we don't do that anymore, as per RFC3986, in order for the data:subpage testcase below to work.
+ QTest::newRow("http:g") << QString::fromLatin1("http://a/b/c/d;p?q") << QString::fromLatin1("http:g") << QString::fromLatin1("http:g");
+ QTest::newRow("data:subpage") << QString::fromLatin1("data:text/plain, main page") << QString::fromLatin1("data:text/plain, subpage") << QString::fromLatin1("data:text/plain, subpage");
// Resolve relative with relative
QTest::newRow("../a (1)") << QString::fromLatin1("b") << QString::fromLatin1("../a") << QString::fromLatin1("a");
@@ -916,6 +914,10 @@ void tst_QUrl::resolving_data()
QTest::newRow("../a (6)") << QString::fromLatin1("/b/a") << QString::fromLatin1("../a") << QString::fromLatin1("/a");
QTest::newRow("../a (7)") << QString::fromLatin1("/b/c/a") << QString::fromLatin1("../a") << QString::fromLatin1("/b/a");
QTest::newRow("../a (8)") << QString::fromLatin1("/b") << QString::fromLatin1("/a") << QString::fromLatin1("/a");
+
+ // More tests from KDE
+ QTest::newRow("brackets") << QString::fromLatin1("http://www.calorieking.com/personal/diary/") << QString::fromLatin1("/personal/diary/rpc.php?C=jsrs1&F=getDiaryDay&P0=[2006-3-8]&U=1141858921458") << QString::fromLatin1("http://www.calorieking.com/personal/diary/rpc.php?C=jsrs1&F=getDiaryDay&P0=[2006-3-8]&U=1141858921458");
+ QTest::newRow("javascript")<< QString::fromLatin1("http://www.youtube.com/?v=JvOSnRD5aNk") << QString::fromLatin1("javascript:window.location+\"__flashplugin_unique__\"") << QString::fromLatin1("javascript:window.location+%22__flashplugin_unique__%22");
}
void tst_QUrl::resolving()
diff --git a/tests/auto/corelib/io/qurlinternal/qurlinternal.pro b/tests/auto/corelib/io/qurlinternal/qurlinternal.pro
index ae5e023446..3828512dce 100644
--- a/tests/auto/corelib/io/qurlinternal/qurlinternal.pro
+++ b/tests/auto/corelib/io/qurlinternal/qurlinternal.pro
@@ -1,5 +1,5 @@
CONFIG += testcase
-requires(contains(QT_CONFIG,private_tests))
+requires(qtConfig(private_tests))
TARGET = tst_qurlinternal
SOURCES += tst_qurlinternal.cpp ../../codecs/utf8/utf8data.cpp
QT = core core-private testlib
diff --git a/tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp b/tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp
index 8e2d583961..38e3c6890d 100644
--- a/tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp
+++ b/tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp
@@ -143,6 +143,7 @@ private slots:
void noMapAfterSourceDelete();
void forwardDropApi();
void canDropMimeData();
+ void filterHint();
protected:
void buildHierarchy(const QStringList &data, QAbstractItemModel *model);
@@ -2128,17 +2129,23 @@ void tst_QSortFilterProxyModel::changeSourceDataForwardsRoles_qtbug35440()
QModelIndex index;
+ // QStringListModel doesn't distinguish between edit and display roles,
+ // so changing one always changes the other, too.
+ QVector<int> expectedChangedRoles;
+ expectedChangedRoles.append(Qt::DisplayRole);
+ expectedChangedRoles.append(Qt::EditRole);
+
index = model.index(0, 0);
QVERIFY(index.isValid());
model.setData(index, QStringLiteral("teststring"), Qt::DisplayRole);
QCOMPARE(spy.length(), 1);
- QCOMPARE(spy.at(0).at(2).value<QVector<int> >(), QVector<int>() << Qt::DisplayRole);
+ QCOMPARE(spy.at(0).at(2).value<QVector<int> >(), expectedChangedRoles);
index = model.index(1, 0);
QVERIFY(index.isValid());
model.setData(index, QStringLiteral("teststring2"), Qt::EditRole);
QCOMPARE(spy.length(), 2);
- QCOMPARE(spy.at(1).at(2).value<QVector<int> >(), QVector<int>() << Qt::EditRole);
+ QCOMPARE(spy.at(1).at(2).value<QVector<int> >(), expectedChangedRoles);
}
void tst_QSortFilterProxyModel::sortFilterRole()
@@ -3802,6 +3809,12 @@ void tst_QSortFilterProxyModel::moveSourceRows()
QCOMPARE(filterBeforeParents.size(), 1);
QCOMPARE(filterAfterParents.size(), 1);
+ QCOMPARE(
+ filterBeforeParentLayoutSpy.first().at(1).value<QAbstractItemModel::LayoutChangeHint>(),
+ QAbstractItemModel::NoLayoutChangeHint);
+ QCOMPARE(filterAfterParentLayoutSpy.first().at(1).value<QAbstractItemModel::LayoutChangeHint>(),
+ QAbstractItemModel::NoLayoutChangeHint);
+
QCOMPARE(filterBothBeforeParentLayoutSpy.size(), 0);
QCOMPARE(filterBothAfterParentLayoutSpy.size(), 0);
}
@@ -4123,5 +4136,50 @@ void tst_QSortFilterProxyModel::resortingDoesNotBreakTreeModels()
QCOMPARE(proxy.rowCount(pi1), 1);
}
+void tst_QSortFilterProxyModel::filterHint()
+{
+ // test that a filtering model does not emit layoutChanged with a hint
+ QStringListModel model(QStringList() << "one"
+ << "two"
+ << "three"
+ << "four"
+ << "five"
+ << "six");
+ QSortFilterProxyModel proxy1;
+ proxy1.setSourceModel(&model);
+ proxy1.setSortRole(Qt::DisplayRole);
+ proxy1.setDynamicSortFilter(true);
+ proxy1.sort(0);
+
+ QSortFilterProxyModel proxy2;
+ proxy2.setSourceModel(&proxy1);
+ proxy2.setFilterRole(Qt::DisplayRole);
+ proxy2.setFilterRegExp("^[^ ]*$");
+ proxy2.setDynamicSortFilter(true);
+
+ QSignalSpy proxy1BeforeSpy(&proxy1, &QSortFilterProxyModel::layoutAboutToBeChanged);
+ QSignalSpy proxy1AfterSpy(&proxy1, &QSortFilterProxyModel::layoutChanged);
+ QSignalSpy proxy2BeforeSpy(&proxy2, &QSortFilterProxyModel::layoutAboutToBeChanged);
+ QSignalSpy proxy2AfterSpy(&proxy2, &QSortFilterProxyModel::layoutChanged);
+
+ model.setData(model.index(2), QStringLiteral("modified three"), Qt::DisplayRole);
+
+ // The first proxy was re-sorted as one item as changed.
+ QCOMPARE(proxy1BeforeSpy.size(), 1);
+ QCOMPARE(proxy1BeforeSpy.first().at(1).value<QAbstractItemModel::LayoutChangeHint>(),
+ QAbstractItemModel::VerticalSortHint);
+ QCOMPARE(proxy1AfterSpy.size(), 1);
+ QCOMPARE(proxy1AfterSpy.first().at(1).value<QAbstractItemModel::LayoutChangeHint>(),
+ QAbstractItemModel::VerticalSortHint);
+
+ // But the second proxy must not have the VerticalSortHint since an item was filtered
+ QCOMPARE(proxy2BeforeSpy.size(), 1);
+ QCOMPARE(proxy2BeforeSpy.first().at(1).value<QAbstractItemModel::LayoutChangeHint>(),
+ QAbstractItemModel::NoLayoutChangeHint);
+ QCOMPARE(proxy2AfterSpy.size(), 1);
+ QCOMPARE(proxy2AfterSpy.first().at(1).value<QAbstractItemModel::LayoutChangeHint>(),
+ QAbstractItemModel::NoLayoutChangeHint);
+}
+
QTEST_MAIN(tst_QSortFilterProxyModel)
#include "tst_qsortfilterproxymodel.moc"
diff --git a/tests/auto/corelib/itemmodels/qstringlistmodel/tst_qstringlistmodel.cpp b/tests/auto/corelib/itemmodels/qstringlistmodel/tst_qstringlistmodel.cpp
index 61dda782d8..f99241da3b 100644
--- a/tests/auto/corelib/itemmodels/qstringlistmodel/tst_qstringlistmodel.cpp
+++ b/tests/auto/corelib/itemmodels/qstringlistmodel/tst_qstringlistmodel.cpp
@@ -35,6 +35,8 @@
#include "qmodellistener.h"
#include <qstringlistmodel.h>
+#include <algorithm>
+
void QModelListener::rowsAboutToBeRemovedOrInserted(const QModelIndex & parent, int start, int end )
{
for (int i = 0; start + i <= end; i++) {
@@ -75,6 +77,9 @@ private slots:
void rowsAboutToBeInserted_rowsInserted();
void rowsAboutToBeInserted_rowsInserted_data();
+
+ void setData_emits_both_roles_data();
+ void setData_emits_both_roles();
};
void tst_QStringListModel::rowsAboutToBeRemoved_rowsRemoved_data()
@@ -129,22 +134,19 @@ void tst_QStringListModel::rowsAboutToBeRemoved_rowsRemoved()
QFETCH(QStringList, aboutto);
QFETCH(QStringList, res);
- QStringListModel *model = new QStringListModel(input);
- QModelListener *pListener = new QModelListener(&aboutto, &res, model);
- pListener->connect(model, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)),
- pListener, SLOT(rowsAboutToBeRemovedOrInserted(QModelIndex,int,int)) );
+ QStringListModel model(input);
+ QModelListener listener(&aboutto, &res, &model);
+ connect(&model, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)),
+ &listener, SLOT(rowsAboutToBeRemovedOrInserted(QModelIndex,int,int)));
- pListener->connect(model, SIGNAL(rowsRemoved(QModelIndex,int,int)),
- pListener, SLOT(rowsRemovedOrInserted(QModelIndex,int,int)) );
+ connect(&model, SIGNAL(rowsRemoved(QModelIndex,int,int)),
+ &listener, SLOT(rowsRemovedOrInserted(QModelIndex,int,int)));
- model->removeRows(row,count);
+ model.removeRows(row, count);
// At this point, control goes to our connected slots inn this order:
// 1. rowsAboutToBeRemovedOrInserted
// 2. rowsRemovedOrInserted
// Control returns here
-
- delete pListener;
- delete model;
}
void tst_QStringListModel::rowsAboutToBeInserted_rowsInserted_data()
@@ -193,22 +195,59 @@ void tst_QStringListModel::rowsAboutToBeInserted_rowsInserted()
QFETCH(QStringList, aboutto);
QFETCH(QStringList, res);
- QStringListModel *model = new QStringListModel(input);
- QModelListener *pListener = new QModelListener(&aboutto, &res, model);
- connect(model, SIGNAL(rowsAboutToBeInserted(QModelIndex,int,int)),
- pListener, SLOT(rowsAboutToBeRemovedOrInserted(QModelIndex,int,int)) );
+ QStringListModel model(input);
+ QModelListener listener(&aboutto, &res, &model);
+ connect(&model, SIGNAL(rowsAboutToBeInserted(QModelIndex,int,int)),
+ &listener, SLOT(rowsAboutToBeRemovedOrInserted(QModelIndex,int,int)));
- connect(model, SIGNAL(rowsInserted(QModelIndex,int,int)),
- pListener, SLOT(rowsRemovedOrInserted(QModelIndex,int,int)) );
+ connect(&model, SIGNAL(rowsInserted(QModelIndex,int,int)),
+ &listener, SLOT(rowsRemovedOrInserted(QModelIndex,int,int)));
- model->insertRows(row,count);
+ model.insertRows(row, count);
// At this point, control goes to our connected slots inn this order:
// 1. rowsAboutToBeRemovedOrInserted
// 2. rowsRemovedOrInserted
// Control returns here
+}
- delete pListener;
- delete model;
+void tst_QStringListModel::setData_emits_both_roles_data()
+{
+ QTest::addColumn<int>("row");
+ QTest::addColumn<QString>("data");
+ QTest::addColumn<int>("role");
+
+#define ROW(row, string, role) \
+ QTest::newRow(#row " -> " string) << row << QString(string) << int(Qt::role)
+ ROW(0, "1", EditRole);
+ ROW(1, "2", DisplayRole);
+#undef ROW
+}
+
+template <class C>
+C sorted(C c)
+{
+ std::sort(c.begin(), c.end());
+ return qMove(c);
+}
+
+void tst_QStringListModel::setData_emits_both_roles()
+{
+ QFETCH(int, row);
+ QFETCH(QString, data);
+ QFETCH(int, role);
+
+ QStringListModel model(QStringList() << "one" << "two");
+ QVector<int> expected;
+ expected.reserve(2);
+ expected.append(Qt::DisplayRole);
+ expected.append(Qt::EditRole);
+
+ QSignalSpy spy(&model, &QAbstractItemModel::dataChanged);
+ QVERIFY(spy.isValid());
+ model.setData(model.index(row, 0), data, role);
+ QCOMPARE(spy.size(), 1);
+ QCOMPARE(sorted(spy.at(0).at(2).value<QVector<int> >()),
+ expected);
}
QTEST_MAIN(tst_QStringListModel)
diff --git a/tests/auto/corelib/json/json.pro b/tests/auto/corelib/json/json.pro
index b3038d7ca1..dc9cd3e383 100644
--- a/tests/auto/corelib/json/json.pro
+++ b/tests/auto/corelib/json/json.pro
@@ -6,7 +6,7 @@ CONFIG += testcase
!android:TESTDATA += bom.json test.json test.bjson test3.json test2.json
else:RESOURCES += json.qrc
-!contains(QT_CONFIG, doubleconversion):!contains(QT_CONFIG, system-doubleconversion) {
+!qtConfig(doubleconversion):!qtConfig(system-doubleconversion) {
DEFINES += QT_NO_DOUBLECONVERSION
}
diff --git a/tests/auto/corelib/kernel/kernel.pro b/tests/auto/corelib/kernel/kernel.pro
index 431d483339..75b98bcd09 100644
--- a/tests/auto/corelib/kernel/kernel.pro
+++ b/tests/auto/corelib/kernel/kernel.pro
@@ -1,6 +1,7 @@
TEMPLATE=subdirs
SUBDIRS=\
qcoreapplication \
+ qdeadlinetimer \
qelapsedtimer \
qeventdispatcher \
qeventloop \
@@ -32,11 +33,11 @@ SUBDIRS=\
qobject \
qsocketnotifier
-!contains(QT_CONFIG, private_tests): SUBDIRS -= \
+!qtConfig(private_tests): SUBDIRS -= \
qsocketnotifier \
qsharedmemory
# This test is only applicable on Windows
!win32*|winrt: SUBDIRS -= qwineventnotifier
-android|uikit: SUBDIRS -= qsharedmemory qsystemsemaphore
+android|uikit: SUBDIRS -= qclipboard qobject qsharedmemory qsystemsemaphore
diff --git a/tests/auto/corelib/kernel/qcoreapplication/qcoreapplication.pro b/tests/auto/corelib/kernel/qcoreapplication/qcoreapplication.pro
index a49bb9ae1f..d166351490 100644
--- a/tests/auto/corelib/kernel/qcoreapplication/qcoreapplication.pro
+++ b/tests/auto/corelib/kernel/qcoreapplication/qcoreapplication.pro
@@ -3,4 +3,4 @@ TARGET = tst_qcoreapplication
QT = core testlib core-private
SOURCES = tst_qcoreapplication.cpp
HEADERS = tst_qcoreapplication.h
-requires(contains(QT_CONFIG,private_tests))
+requires(qtConfig(private_tests))
diff --git a/tests/auto/corelib/kernel/qdeadlinetimer/qdeadlinetimer.pro b/tests/auto/corelib/kernel/qdeadlinetimer/qdeadlinetimer.pro
new file mode 100644
index 0000000000..12ad7dabc2
--- /dev/null
+++ b/tests/auto/corelib/kernel/qdeadlinetimer/qdeadlinetimer.pro
@@ -0,0 +1,5 @@
+CONFIG += testcase
+TARGET = tst_qdeadlinetimer
+QT = core testlib
+SOURCES = tst_qdeadlinetimer.cpp
+
diff --git a/tests/auto/corelib/kernel/qdeadlinetimer/tst_qdeadlinetimer.cpp b/tests/auto/corelib/kernel/qdeadlinetimer/tst_qdeadlinetimer.cpp
new file mode 100644
index 0000000000..7642604cfe
--- /dev/null
+++ b/tests/auto/corelib/kernel/qdeadlinetimer/tst_qdeadlinetimer.cpp
@@ -0,0 +1,625 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 Intel Corporation.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtCore/QString>
+#include <QtCore/QTime>
+#include <QtCore/QDeadlineTimer>
+#include <QtTest/QtTest>
+
+#if QT_HAS_INCLUDE(<chrono>)
+# include <chrono>
+#endif
+
+static const int minResolution = 100; // the minimum resolution for the tests
+
+Q_DECLARE_METATYPE(Qt::TimerType)
+
+class tst_QDeadlineTimer : public QObject
+{
+ Q_OBJECT
+
+private Q_SLOTS:
+ void initTestCase_data();
+ void basics();
+ void foreverness();
+ void current();
+ void deadlines();
+ void setDeadline();
+ void expire();
+ void stdchrono();
+};
+
+void tst_QDeadlineTimer::initTestCase_data()
+{
+ qRegisterMetaType<Qt::TimerType>();
+ QTest::addColumn<Qt::TimerType>("timerType");
+ QTest::newRow("precise") << Qt::PreciseTimer;
+ QTest::newRow("coarse") << Qt::CoarseTimer;
+}
+
+void tst_QDeadlineTimer::basics()
+{
+ QDeadlineTimer deadline;
+ QCOMPARE(deadline.timerType(), Qt::CoarseTimer);
+
+ QFETCH_GLOBAL(Qt::TimerType, timerType);
+ deadline = QDeadlineTimer(timerType);
+ QCOMPARE(deadline.timerType(), timerType);
+ QVERIFY(!deadline.isForever());
+ QCOMPARE(deadline, QDeadlineTimer(timerType));
+ QVERIFY(!(deadline != QDeadlineTimer(timerType)));
+ QVERIFY(!(deadline < QDeadlineTimer()));
+ QVERIFY(deadline <= QDeadlineTimer());
+ QVERIFY(deadline >= QDeadlineTimer());
+ QVERIFY(!(deadline > QDeadlineTimer()));
+ QVERIFY(!(deadline < deadline));
+ QVERIFY(deadline <= deadline);
+ QVERIFY(deadline >= deadline);
+ QVERIFY(!(deadline > deadline));
+
+ // should have expired, but we may be running too early after boot
+ QTRY_VERIFY_WITH_TIMEOUT(deadline.hasExpired(), 100);
+
+ QCOMPARE(deadline.remainingTime(), qint64(0));
+ QCOMPARE(deadline.remainingTimeNSecs(), qint64(0));
+ QCOMPARE(deadline.deadline(), qint64(0));
+ QCOMPARE(deadline.deadlineNSecs(), qint64(0));
+
+ deadline.setRemainingTime(0, timerType);
+ QCOMPARE(deadline.remainingTime(), qint64(0));
+ QCOMPARE(deadline.remainingTimeNSecs(), qint64(0));
+ QVERIFY(deadline.deadline() != 0);
+ QVERIFY(deadline.deadline() != std::numeric_limits<qint64>::max());
+ QVERIFY(deadline.deadlineNSecs() != 0);
+ QVERIFY(deadline.deadlineNSecs() != std::numeric_limits<qint64>::max());
+
+ deadline.setPreciseRemainingTime(0, 0, timerType);
+ QCOMPARE(deadline.remainingTime(), qint64(0));
+ QCOMPARE(deadline.remainingTimeNSecs(), qint64(0));
+ QVERIFY(deadline.deadline() != 0);
+ QVERIFY(deadline.deadline() != std::numeric_limits<qint64>::max());
+ QVERIFY(deadline.deadlineNSecs() != 0);
+ QVERIFY(deadline.deadlineNSecs() != std::numeric_limits<qint64>::max());
+
+ deadline.setDeadline(0, timerType);
+ QCOMPARE(deadline.remainingTime(), qint64(0));
+ QCOMPARE(deadline.remainingTimeNSecs(), qint64(0));
+ QCOMPARE(deadline.deadline(), qint64(0));
+ QCOMPARE(deadline.deadlineNSecs(), qint64(0));
+
+ deadline.setPreciseDeadline(0, 0, timerType);
+ QCOMPARE(deadline.remainingTime(), qint64(0));
+ QCOMPARE(deadline.remainingTimeNSecs(), qint64(0));
+ QCOMPARE(deadline.deadline(), qint64(0));
+ QCOMPARE(deadline.deadlineNSecs(), qint64(0));
+}
+
+void tst_QDeadlineTimer::foreverness()
+{
+ QFETCH_GLOBAL(Qt::TimerType, timerType);
+ // we don't check whether timerType() is our type since it's possible it detects it's forever
+
+ QDeadlineTimer deadline = QDeadlineTimer::Forever;
+ QCOMPARE(deadline.timerType(), Qt::CoarseTimer);
+ QVERIFY(deadline.isForever());
+ QVERIFY(!deadline.hasExpired());
+ QCOMPARE(deadline.remainingTime(), qint64(-1));
+ QCOMPARE(deadline.remainingTimeNSecs(), qint64(-1));
+ QCOMPARE(deadline.deadline(), std::numeric_limits<qint64>::max());
+ QCOMPARE(deadline.deadlineNSecs(), std::numeric_limits<qint64>::max());
+
+ deadline = QDeadlineTimer(-1, timerType);
+ QVERIFY(deadline.isForever());
+ QVERIFY(!deadline.hasExpired());
+ QCOMPARE(deadline.remainingTime(), qint64(-1));
+ QCOMPARE(deadline.remainingTimeNSecs(), qint64(-1));
+ QCOMPARE(deadline.deadline(), std::numeric_limits<qint64>::max());
+ QCOMPARE(deadline.deadlineNSecs(), std::numeric_limits<qint64>::max());
+
+ deadline.setRemainingTime(-1, timerType);
+ QVERIFY(deadline.isForever());
+ QVERIFY(!deadline.hasExpired());
+ QCOMPARE(deadline.remainingTime(), qint64(-1));
+ QCOMPARE(deadline.remainingTimeNSecs(), qint64(-1));
+ QCOMPARE(deadline.deadline(), std::numeric_limits<qint64>::max());
+ QCOMPARE(deadline.deadlineNSecs(), std::numeric_limits<qint64>::max());
+
+ deadline.setPreciseRemainingTime(-1, 0, timerType);
+ QVERIFY(deadline.isForever());
+ QVERIFY(!deadline.hasExpired());
+ QCOMPARE(deadline.remainingTime(), qint64(-1));
+ QCOMPARE(deadline.remainingTimeNSecs(), qint64(-1));
+ QCOMPARE(deadline.deadline(), std::numeric_limits<qint64>::max());
+ QCOMPARE(deadline.deadlineNSecs(), std::numeric_limits<qint64>::max());
+
+ deadline.setPreciseRemainingTime(-1, -1, timerType);
+ QVERIFY(deadline.isForever());
+ QVERIFY(!deadline.hasExpired());
+ QCOMPARE(deadline.remainingTime(), qint64(-1));
+ QCOMPARE(deadline.remainingTimeNSecs(), qint64(-1));
+ QCOMPARE(deadline.deadline(), std::numeric_limits<qint64>::max());
+ QCOMPARE(deadline.deadlineNSecs(), std::numeric_limits<qint64>::max());
+
+ deadline.setDeadline(std::numeric_limits<qint64>::max(), timerType);
+ QVERIFY(deadline.isForever());
+ QVERIFY(!deadline.hasExpired());
+ QCOMPARE(deadline.remainingTime(), qint64(-1));
+ QCOMPARE(deadline.remainingTimeNSecs(), qint64(-1));
+ QCOMPARE(deadline.deadline(), std::numeric_limits<qint64>::max());
+ QCOMPARE(deadline.deadlineNSecs(), std::numeric_limits<qint64>::max());
+
+ deadline.setPreciseDeadline(std::numeric_limits<qint64>::max(), 0, timerType);
+ QVERIFY(deadline.isForever());
+ QVERIFY(!deadline.hasExpired());
+ QCOMPARE(deadline.remainingTime(), qint64(-1));
+ QCOMPARE(deadline.remainingTimeNSecs(), qint64(-1));
+ QCOMPARE(deadline.deadline(), std::numeric_limits<qint64>::max());
+ QCOMPARE(deadline.deadlineNSecs(), std::numeric_limits<qint64>::max());
+
+ QCOMPARE(deadline, deadline);
+ QVERIFY(!(deadline < deadline));
+ QVERIFY(deadline <= deadline);
+ QVERIFY(deadline >= deadline);
+ QVERIFY(!(deadline > deadline));
+
+ // adding to forever must still be forever
+ QDeadlineTimer deadline2 = deadline + 1;
+ QVERIFY(deadline2.isForever());
+ QVERIFY(!deadline2.hasExpired());
+ QCOMPARE(deadline2.remainingTime(), qint64(-1));
+ QCOMPARE(deadline2.remainingTimeNSecs(), qint64(-1));
+ QCOMPARE(deadline2.deadline(), std::numeric_limits<qint64>::max());
+ QCOMPARE(deadline2.deadlineNSecs(), std::numeric_limits<qint64>::max());
+ QCOMPARE(deadline2.timerType(), deadline.timerType());
+
+ QCOMPARE(deadline2 - deadline, qint64(0));
+ QCOMPARE(deadline2, deadline);
+ QVERIFY(!(deadline2 < deadline));
+ QVERIFY(deadline2 <= deadline);
+ QVERIFY(deadline2 >= deadline);
+ QVERIFY(!(deadline2 > deadline));
+
+ // subtracting from forever is *also* forever
+ deadline2 = deadline - 1;
+ QVERIFY(deadline2.isForever());
+ QVERIFY(!deadline2.hasExpired());
+ QCOMPARE(deadline2.remainingTime(), qint64(-1));
+ QCOMPARE(deadline2.remainingTimeNSecs(), qint64(-1));
+ QCOMPARE(deadline2.deadline(), std::numeric_limits<qint64>::max());
+ QCOMPARE(deadline2.deadlineNSecs(), std::numeric_limits<qint64>::max());
+ QCOMPARE(deadline2.timerType(), deadline.timerType());
+
+ QCOMPARE(deadline2 - deadline, qint64(0));
+ QCOMPARE(deadline2, deadline);
+ QVERIFY(!(deadline2 < deadline));
+ QVERIFY(deadline2 <= deadline);
+ QVERIFY(deadline2 >= deadline);
+ QVERIFY(!(deadline2 > deadline));
+
+ // compare and order against a default-constructed object
+ QDeadlineTimer expired;
+ QVERIFY(!(deadline == expired));
+ QVERIFY(deadline != expired);
+ QVERIFY(!(deadline < expired));
+ QVERIFY(!(deadline <= expired));
+ QVERIFY(deadline >= expired);
+ QVERIFY(deadline > expired);
+}
+
+void tst_QDeadlineTimer::current()
+{
+ QFETCH_GLOBAL(Qt::TimerType, timerType);
+ auto deadline = QDeadlineTimer::current(timerType);
+ QVERIFY(deadline.hasExpired());
+ QVERIFY(!deadline.isForever());
+ QCOMPARE(deadline.timerType(), timerType);
+ QCOMPARE(deadline.remainingTime(), qint64(0));
+ QCOMPARE(deadline.remainingTimeNSecs(), qint64(0));
+ QVERIFY(deadline.deadline() != 0);
+ QVERIFY(deadline.deadline() != std::numeric_limits<qint64>::max());
+ QVERIFY(deadline.deadlineNSecs() != 0);
+ QVERIFY(deadline.deadlineNSecs() != std::numeric_limits<qint64>::max());
+
+ // subtracting from current should be "more expired"
+ QDeadlineTimer earlierDeadline = deadline - 1;
+ QVERIFY(earlierDeadline.hasExpired());
+ QVERIFY(!earlierDeadline.isForever());
+ QCOMPARE(earlierDeadline.timerType(), timerType);
+ QCOMPARE(earlierDeadline.remainingTime(), qint64(0));
+ QCOMPARE(earlierDeadline.remainingTimeNSecs(), qint64(0));
+ QVERIFY(earlierDeadline.deadline() != 0);
+ QVERIFY(earlierDeadline.deadline() != std::numeric_limits<qint64>::max());
+ QVERIFY(earlierDeadline.deadlineNSecs() != 0);
+ QVERIFY(earlierDeadline.deadlineNSecs() != std::numeric_limits<qint64>::max());
+ QCOMPARE(earlierDeadline.deadline(), deadline.deadline() - 1);
+ QCOMPARE(earlierDeadline.deadlineNSecs(), deadline.deadlineNSecs() - 1000*1000);
+
+ QCOMPARE(earlierDeadline - deadline, qint64(-1));
+ QVERIFY(earlierDeadline != deadline);
+ QVERIFY(earlierDeadline < deadline);
+ QVERIFY(earlierDeadline <= deadline);
+ QVERIFY(!(earlierDeadline >= deadline));
+ QVERIFY(!(earlierDeadline > deadline));
+}
+
+void tst_QDeadlineTimer::deadlines()
+{
+ QFETCH_GLOBAL(Qt::TimerType, timerType);
+
+ QDeadlineTimer deadline(4 * minResolution, timerType);
+ QVERIFY(!deadline.hasExpired());
+ QVERIFY(!deadline.isForever());
+ QCOMPARE(deadline.timerType(), timerType);
+ QVERIFY(deadline.remainingTime() > (3 * minResolution));
+ QVERIFY(deadline.remainingTime() <= (4 * minResolution));
+ QVERIFY(deadline.remainingTimeNSecs() > (3000000 * minResolution));
+ QVERIFY(deadline.remainingTimeNSecs() <= (4000000 * minResolution));
+ QVERIFY(deadline.deadline() != 0);
+ QVERIFY(deadline.deadline() != std::numeric_limits<qint64>::max());
+ QVERIFY(deadline.deadlineNSecs() != 0);
+ QVERIFY(deadline.deadlineNSecs() != std::numeric_limits<qint64>::max());
+
+ deadline.setRemainingTime(4 * minResolution, timerType);
+ QVERIFY(!deadline.hasExpired());
+ QVERIFY(!deadline.isForever());
+ QCOMPARE(deadline.timerType(), timerType);
+ QVERIFY(deadline.remainingTime() > (3 * minResolution));
+ QVERIFY(deadline.remainingTime() <= (4 * minResolution));
+ QVERIFY(deadline.remainingTimeNSecs() > (3000000 * minResolution));
+ QVERIFY(deadline.remainingTimeNSecs() <= (4000000 * minResolution));
+ QVERIFY(deadline.deadline() != 0);
+ QVERIFY(deadline.deadline() != std::numeric_limits<qint64>::max());
+ QVERIFY(deadline.deadlineNSecs() != 0);
+ QVERIFY(deadline.deadlineNSecs() != std::numeric_limits<qint64>::max());
+
+ deadline.setPreciseRemainingTime(0, 4000000 * minResolution, timerType);
+ QVERIFY(!deadline.hasExpired());
+ QVERIFY(!deadline.isForever());
+ QCOMPARE(deadline.timerType(), timerType);
+ QVERIFY(deadline.remainingTime() > (3 * minResolution));
+ QVERIFY(deadline.remainingTime() <= (4 * minResolution));
+ QVERIFY(deadline.remainingTimeNSecs() > (3000000 * minResolution));
+ QVERIFY(deadline.remainingTimeNSecs() <= (4000000 * minResolution));
+ QVERIFY(deadline.deadline() != 0);
+ QVERIFY(deadline.deadline() != std::numeric_limits<qint64>::max());
+ QVERIFY(deadline.deadlineNSecs() != 0);
+ QVERIFY(deadline.deadlineNSecs() != std::numeric_limits<qint64>::max());
+
+ deadline.setPreciseRemainingTime(1, 0, timerType); // 1 sec
+ QVERIFY(!deadline.hasExpired());
+ QVERIFY(!deadline.isForever());
+ QCOMPARE(deadline.timerType(), timerType);
+ QVERIFY(deadline.remainingTime() > (1000 - minResolution));
+ QVERIFY(deadline.remainingTime() <= 1000);
+ QVERIFY(deadline.remainingTimeNSecs() > (1000 - minResolution)*1000*1000);
+ QVERIFY(deadline.remainingTimeNSecs() <= (1000*1000*1000));
+ QVERIFY(deadline.deadline() != 0);
+ QVERIFY(deadline.deadline() != std::numeric_limits<qint64>::max());
+ QVERIFY(deadline.deadlineNSecs() != 0);
+ QVERIFY(deadline.deadlineNSecs() != std::numeric_limits<qint64>::max());
+
+ // adding to a future deadline must still be further in the future
+ QDeadlineTimer laterDeadline = deadline + 1;
+ QVERIFY(!laterDeadline.hasExpired());
+ QVERIFY(!laterDeadline.isForever());
+ QCOMPARE(laterDeadline.timerType(), timerType);
+ QVERIFY(laterDeadline.remainingTime() > (1000 - minResolution));
+ QVERIFY(laterDeadline.remainingTime() <= 1001);
+ QVERIFY(laterDeadline.remainingTimeNSecs() > (1001 - minResolution)*1000*1000);
+ QVERIFY(laterDeadline.remainingTimeNSecs() <= (1001*1000*1000));
+ QVERIFY(laterDeadline.deadline() != 0);
+ QVERIFY(laterDeadline.deadline() != std::numeric_limits<qint64>::max());
+ QVERIFY(laterDeadline.deadlineNSecs() != 0);
+ QVERIFY(laterDeadline.deadlineNSecs() != std::numeric_limits<qint64>::max());
+ QCOMPARE(laterDeadline.deadline(), deadline.deadline() + 1);
+ QCOMPARE(laterDeadline.deadlineNSecs(), deadline.deadlineNSecs() + 1000*1000);
+
+ QCOMPARE(laterDeadline - deadline, qint64(1));
+ QVERIFY(laterDeadline != deadline);
+ QVERIFY(!(laterDeadline < deadline));
+ QVERIFY(!(laterDeadline <= deadline));
+ QVERIFY(laterDeadline >= deadline);
+ QVERIFY(laterDeadline > deadline);
+
+ // compare and order against a default-constructed object
+ QDeadlineTimer expired;
+ QVERIFY(!(deadline == expired));
+ QVERIFY(deadline != expired);
+ QVERIFY(!(deadline < expired));
+ QVERIFY(!(deadline <= expired));
+ QVERIFY(deadline >= expired);
+ QVERIFY(deadline > expired);
+
+ // compare and order against a forever deadline
+ QDeadlineTimer forever_(QDeadlineTimer::Forever);
+ QVERIFY(!(deadline == forever_));
+ QVERIFY(deadline != forever_);
+ QVERIFY(deadline < forever_);
+ QVERIFY(deadline <= forever_);
+ QVERIFY(!(deadline >= forever_));
+ QVERIFY(!(deadline > forever_));
+}
+
+void tst_QDeadlineTimer::setDeadline()
+{
+ QFETCH_GLOBAL(Qt::TimerType, timerType);
+ auto now = QDeadlineTimer::current(timerType);
+ QDeadlineTimer deadline;
+
+ deadline.setDeadline(now.deadline(), timerType);
+ QVERIFY(deadline.hasExpired());
+ QVERIFY(!deadline.isForever());
+ QCOMPARE(deadline.timerType(), timerType);
+ QCOMPARE(deadline.remainingTime(), qint64(0));
+ QCOMPARE(deadline.remainingTimeNSecs(), qint64(0));
+ QCOMPARE(deadline.deadline(), now.deadline());
+ // don't check deadlineNSecs!
+
+ deadline.setPreciseDeadline(now.deadlineNSecs() / (1000 * 1000 * 1000),
+ now.deadlineNSecs() % (1000 * 1000 * 1000), timerType);
+ QVERIFY(deadline.hasExpired());
+ QVERIFY(!deadline.isForever());
+ QCOMPARE(deadline.timerType(), timerType);
+ QCOMPARE(deadline.remainingTime(), qint64(0));
+ QCOMPARE(deadline.remainingTimeNSecs(), qint64(0));
+ QCOMPARE(deadline.deadline(), now.deadline());
+ QCOMPARE(deadline.deadlineNSecs(), now.deadlineNSecs());
+
+ now = QDeadlineTimer::current(timerType);
+ deadline.setDeadline(now.deadline() + 4 * minResolution, timerType);
+ QVERIFY(!deadline.hasExpired());
+ QVERIFY(!deadline.isForever());
+ QCOMPARE(deadline.timerType(), timerType);
+ QVERIFY(deadline.remainingTime() > (3 * minResolution));
+ QVERIFY(deadline.remainingTime() <= (4 * minResolution));
+ QVERIFY(deadline.remainingTimeNSecs() > (3000000 * minResolution));
+ QVERIFY(deadline.remainingTimeNSecs() <= (4000000 * minResolution));
+ QCOMPARE(deadline.deadline(), now.deadline() + 4 * minResolution); // yes, it's exact
+ // don't check deadlineNSecs!
+
+ now = QDeadlineTimer::current(timerType);
+ qint64 nsec = now.deadlineNSecs() + 4000000 * minResolution;
+ deadline.setPreciseDeadline(nsec / (1000 * 1000 * 1000),
+ nsec % (1000 * 1000 * 1000), timerType);
+ QVERIFY(!deadline.hasExpired());
+ QVERIFY(!deadline.isForever());
+ QCOMPARE(deadline.timerType(), timerType);
+ QVERIFY(deadline.remainingTime() > (3 * minResolution));
+ QVERIFY(deadline.remainingTime() <= (4 * minResolution));
+ QVERIFY(deadline.remainingTimeNSecs() > (3000000 * minResolution));
+ QVERIFY(deadline.remainingTimeNSecs() <= (4000000 * minResolution));
+ QCOMPARE(deadline.deadline(), nsec / (1000 * 1000));
+ QCOMPARE(deadline.deadlineNSecs(), nsec);
+}
+
+void tst_QDeadlineTimer::expire()
+{
+ QFETCH_GLOBAL(Qt::TimerType, timerType);
+
+ QDeadlineTimer deadline(minResolution, timerType);
+ QVERIFY(!deadline.hasExpired());
+ QVERIFY(!deadline.isForever());
+
+ qint64 previousDeadline = deadline.deadlineNSecs();
+
+ QTest::qSleep(2 * minResolution);
+
+ QCOMPARE(deadline.remainingTime(), qint64(0));
+ QCOMPARE(deadline.remainingTimeNSecs(), qint64(0));
+ QVERIFY(deadline.deadline() != 0);
+ QVERIFY(deadline.deadline() != std::numeric_limits<qint64>::max());
+ QVERIFY(deadline.deadlineNSecs() != 0);
+ QVERIFY(deadline.deadlineNSecs() != std::numeric_limits<qint64>::max());
+ QCOMPARE(deadline.deadlineNSecs(), previousDeadline);
+}
+
+void tst_QDeadlineTimer::stdchrono()
+{
+#if !QT_HAS_INCLUDE(<chrono>)
+ QSKIP("std::chrono not found on this system");
+#else
+ using namespace std::chrono;
+ QFETCH_GLOBAL(Qt::TimerType, timerType);
+
+ // create some forevers
+ QDeadlineTimer deadline = milliseconds::max();
+ QVERIFY(deadline.isForever());
+ deadline = milliseconds::max();
+ QVERIFY(deadline.isForever());
+ deadline.setRemainingTime(milliseconds::max(), timerType);
+ QVERIFY(deadline.isForever());
+ QCOMPARE(deadline.timerType(), timerType);
+ deadline = nanoseconds::max();
+ QVERIFY(deadline.isForever());
+ deadline.setRemainingTime(nanoseconds::max(), timerType);
+ QVERIFY(deadline.isForever());
+ QCOMPARE(deadline.timerType(), timerType);
+ deadline = hours::max();
+ QVERIFY(deadline.isForever());
+ deadline.setRemainingTime(hours::max(), timerType);
+ QVERIFY(deadline.isForever());
+ QCOMPARE(deadline.timerType(), timerType);
+
+ deadline = time_point<system_clock>::max();
+ QVERIFY(deadline.isForever());
+ deadline.setDeadline(time_point<system_clock>::max(), timerType);
+ QVERIFY(deadline.isForever());
+ QCOMPARE(deadline.timerType(), timerType);
+ deadline = time_point<steady_clock>::max();
+ QVERIFY(deadline.isForever());
+ deadline.setDeadline(time_point<steady_clock>::max(), timerType);
+ QVERIFY(deadline.isForever());
+ QCOMPARE(deadline.timerType(), timerType);
+
+ QVERIFY(deadline == time_point<steady_clock>::max());
+ QVERIFY(deadline == time_point<system_clock>::max());
+ QCOMPARE(deadline.remainingTimeAsDuration(), nanoseconds::max());
+
+ // make it expired
+ deadline = time_point<system_clock>();
+ QVERIFY(deadline.hasExpired());
+ deadline.setDeadline(time_point<system_clock>(), timerType);
+ QVERIFY(deadline.hasExpired());
+ QCOMPARE(deadline.timerType(), timerType);
+ deadline = time_point<steady_clock>();
+ QVERIFY(deadline.hasExpired());
+ deadline.setDeadline(time_point<steady_clock>(), timerType);
+ QVERIFY(deadline.hasExpired());
+ QCOMPARE(deadline.timerType(), timerType);
+
+ QCOMPARE(deadline.remainingTimeAsDuration(), nanoseconds::zero());
+
+ auto steady_before = steady_clock::now();
+ auto system_before = system_clock::now();
+
+ QTest::qSleep(minResolution);
+ auto now = QDeadlineTimer::current(timerType);
+ QTest::qSleep(minResolution);
+
+ auto steady_after = steady_clock::now();
+ auto system_after = system_clock::now();
+
+ {
+ auto diff = duration_cast<milliseconds>(steady_after - now.deadline<steady_clock>());
+ QVERIFY2(diff.count() > minResolution/2, QByteArray::number(qint64(diff.count())));
+ QVERIFY2(diff.count() < 3*minResolution/2, QByteArray::number(qint64(diff.count())));
+ QDeadlineTimer dt_after(steady_after, timerType);
+ QVERIFY2(now < dt_after,
+ ("now = " + QLocale().toString(now.deadlineNSecs()) +
+ "; after = " + QLocale().toString(dt_after.deadlineNSecs())).toLatin1());
+
+ diff = duration_cast<milliseconds>(now.deadline<steady_clock>() - steady_before);
+ QVERIFY2(diff.count() > minResolution/2, QByteArray::number(qint64(diff.count())));
+ QVERIFY2(diff.count() < 3*minResolution/2, QByteArray::number(qint64(diff.count())));
+ QDeadlineTimer dt_before(steady_before, timerType);
+ QVERIFY2(now > dt_before,
+ ("now = " + QLocale().toString(now.deadlineNSecs()) +
+ "; before = " + QLocale().toString(dt_before.deadlineNSecs())).toLatin1());
+ }
+ {
+ auto diff = duration_cast<milliseconds>(system_after - now.deadline<system_clock>());
+ QVERIFY2(diff.count() > minResolution/2, QByteArray::number(qint64(diff.count())));
+ QVERIFY2(diff.count() < 3*minResolution/2, QByteArray::number(qint64(diff.count())));
+ QDeadlineTimer dt_after(system_after, timerType);
+ QVERIFY2(now < dt_after,
+ ("now = " + QLocale().toString(now.deadlineNSecs()) +
+ "; after = " + QLocale().toString(dt_after.deadlineNSecs())).toLatin1());
+
+ diff = duration_cast<milliseconds>(now.deadline<system_clock>() - system_before);
+ QVERIFY2(diff.count() > minResolution/2, QByteArray::number(qint64(diff.count())));
+ QVERIFY2(diff.count() < 3*minResolution/2, QByteArray::number(qint64(diff.count())));
+ QDeadlineTimer dt_before(system_before, timerType);
+ QVERIFY2(now > dt_before,
+ ("now = " + QLocale().toString(now.deadlineNSecs()) +
+ "; before = " + QLocale().toString(dt_before.deadlineNSecs())).toLatin1());
+ }
+
+ // make it regular
+ now = QDeadlineTimer::current(timerType);
+ deadline.setRemainingTime(milliseconds(4 * minResolution), timerType);
+ QVERIFY(!deadline.hasExpired());
+ QVERIFY(!deadline.isForever());
+ QCOMPARE(deadline.timerType(), timerType);
+ QVERIFY(deadline.remainingTimeAsDuration() > milliseconds(3 * minResolution));
+ QVERIFY(deadline.remainingTimeAsDuration() < milliseconds(5 * minResolution));
+ QVERIFY(deadline.remainingTimeAsDuration() > nanoseconds(3000000 * minResolution));
+ QVERIFY(deadline.remainingTimeAsDuration() < nanoseconds(5000000 * minResolution));
+ QVERIFY(deadline.deadline<steady_clock>() > (steady_clock::now() + milliseconds(3 * minResolution)));
+ QVERIFY(deadline.deadline<steady_clock>() < (steady_clock::now() + milliseconds(5 * minResolution)));
+ QVERIFY(deadline.deadline<system_clock>() > (system_clock::now() + milliseconds(3 * minResolution)));
+ QVERIFY(deadline.deadline<system_clock>() < (system_clock::now() + milliseconds(5 * minResolution)));
+ if (timerType == Qt::CoarseTimer) {
+ QVERIFY(deadline > (now + milliseconds(3 * minResolution)));
+ QVERIFY(deadline < (now + milliseconds(5 * minResolution)));
+ QVERIFY(deadline > (now + nanoseconds(3000000 * minResolution)));
+ QVERIFY(deadline < (now + nanoseconds(5000000 * minResolution)));
+ QVERIFY(deadline > milliseconds(3 * minResolution));
+ QVERIFY(deadline < milliseconds(5 * minResolution));
+ QVERIFY(deadline > nanoseconds(3000000 * minResolution));
+ QVERIFY(deadline < nanoseconds(5000000 * minResolution));
+ QVERIFY(deadline >= steady_clock::now());
+ QVERIFY(deadline >= system_clock::now());
+ }
+
+ now = QDeadlineTimer::current(timerType);
+ deadline = QDeadlineTimer(seconds(1), timerType);
+ QVERIFY(!deadline.hasExpired());
+ QVERIFY(!deadline.isForever());
+ QCOMPARE(deadline.timerType(), timerType);
+ QVERIFY(deadline.remainingTimeAsDuration() > (seconds(1) - milliseconds(minResolution)));
+ QVERIFY(deadline.remainingTimeAsDuration() <= seconds(1));
+ QVERIFY(deadline.deadline<steady_clock>() > (steady_clock::now() + seconds(1) - milliseconds(minResolution)));
+ QVERIFY(deadline.deadline<steady_clock>() <= (steady_clock::now() + seconds(1) + milliseconds(minResolution)));
+ QVERIFY(deadline.deadline<system_clock>() > (system_clock::now() + seconds(1) - milliseconds(minResolution)));
+ QVERIFY(deadline.deadline<system_clock>() <= (system_clock::now() + seconds(1) + milliseconds(minResolution)));
+ if (timerType == Qt::CoarseTimer) {
+ QVERIFY(deadline > (seconds(1) - milliseconds(minResolution)));
+ QVERIFY(deadline <= seconds(1));
+ }
+
+ now = QDeadlineTimer::current(timerType);
+ deadline.setRemainingTime(hours(1), timerType);
+ QVERIFY(!deadline.hasExpired());
+ QVERIFY(!deadline.isForever());
+ QCOMPARE(deadline.timerType(), timerType);
+ QVERIFY(deadline.remainingTimeAsDuration() > (hours(1) - milliseconds(minResolution)));
+ QVERIFY(deadline.remainingTimeAsDuration() <= hours(1));
+ QVERIFY(deadline.deadline<steady_clock>() > (steady_clock::now() + hours(1) - milliseconds(minResolution)));
+ QVERIFY(deadline.deadline<steady_clock>() <= (steady_clock::now() + hours(1) + milliseconds(minResolution)));
+ QVERIFY(deadline.deadline<system_clock>() > (system_clock::now() + hours(1) - milliseconds(minResolution)));
+ QVERIFY(deadline.deadline<system_clock>() <= (system_clock::now() + hours(1) + milliseconds(minResolution)));
+
+ now = QDeadlineTimer::current(timerType);
+ deadline.setDeadline(system_clock::now() + seconds(1), timerType);
+ QVERIFY(!deadline.hasExpired());
+ QVERIFY(!deadline.isForever());
+ QCOMPARE(deadline.timerType(), timerType);
+ QVERIFY(deadline.remainingTimeAsDuration() > (seconds(1) - milliseconds(minResolution)));
+ QVERIFY(deadline.remainingTimeAsDuration() <= seconds(1));
+ QVERIFY(deadline.deadline<steady_clock>() > (steady_clock::now() + seconds(1) - milliseconds(minResolution)));
+ QVERIFY(deadline.deadline<steady_clock>() <= (steady_clock::now() + seconds(1) + milliseconds(minResolution)));
+ QVERIFY(deadline.deadline<system_clock>() > (system_clock::now() + seconds(1) - milliseconds(minResolution)));
+ QVERIFY(deadline.deadline<system_clock>() <= (system_clock::now() + seconds(1) + milliseconds(minResolution)));
+
+ now = QDeadlineTimer::current(timerType);
+ deadline.setDeadline(steady_clock::now() + seconds(1), timerType);
+ QVERIFY(!deadline.hasExpired());
+ QVERIFY(!deadline.isForever());
+ QCOMPARE(deadline.timerType(), timerType);
+ QVERIFY(deadline.remainingTimeAsDuration() > (seconds(1) - milliseconds(minResolution)));
+ QVERIFY(deadline.remainingTimeAsDuration() <= seconds(1));
+ QVERIFY(deadline.deadline<steady_clock>() > (steady_clock::now() + seconds(1) - milliseconds(minResolution)));
+ QVERIFY(deadline.deadline<steady_clock>() <= (steady_clock::now() + seconds(1) + milliseconds(minResolution)));
+ QVERIFY(deadline.deadline<system_clock>() > (system_clock::now() + seconds(1) - milliseconds(minResolution)));
+ QVERIFY(deadline.deadline<system_clock>() <= (system_clock::now() + seconds(1) + milliseconds(minResolution)));
+#endif
+}
+
+QTEST_MAIN(tst_QDeadlineTimer)
+
+#include "tst_qdeadlinetimer.moc"
diff --git a/tests/auto/corelib/kernel/qeventloop/qeventloop.pro b/tests/auto/corelib/kernel/qeventloop/qeventloop.pro
index 50072dc612..295a42aa9c 100644
--- a/tests/auto/corelib/kernel/qeventloop/qeventloop.pro
+++ b/tests/auto/corelib/kernel/qeventloop/qeventloop.pro
@@ -5,4 +5,4 @@ SOURCES = $$PWD/tst_qeventloop.cpp
win32:!winrt: LIBS += -luser32
-contains(QT_CONFIG, glib): DEFINES += HAVE_GLIB
+qtConfig(glib): DEFINES += HAVE_GLIB
diff --git a/tests/auto/corelib/kernel/qsocketnotifier/qsocketnotifier.pro b/tests/auto/corelib/kernel/qsocketnotifier/qsocketnotifier.pro
index 58e4b98af7..04806de5f7 100644
--- a/tests/auto/corelib/kernel/qsocketnotifier/qsocketnotifier.pro
+++ b/tests/auto/corelib/kernel/qsocketnotifier/qsocketnotifier.pro
@@ -3,6 +3,6 @@ TARGET = tst_qsocketnotifier
QT = core-private network-private testlib
SOURCES = tst_qsocketnotifier.cpp
-requires(contains(QT_CONFIG,private_tests))
+requires(qtConfig(private_tests))
include(../../../network/socket/platformsocketengine/platformsocketengine.pri)
diff --git a/tests/auto/corelib/kernel/qvariant/qvariant.pro b/tests/auto/corelib/kernel/qvariant/qvariant.pro
index 33e8b6e2ad..96071f9f73 100644
--- a/tests/auto/corelib/kernel/qvariant/qvariant.pro
+++ b/tests/auto/corelib/kernel/qvariant/qvariant.pro
@@ -5,7 +5,7 @@ INCLUDEPATH += $$PWD/../../../other/qvariant_common
SOURCES = tst_qvariant.cpp
RESOURCES += qvariant.qrc
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
-contains(QT_CONFIG, c++11): CONFIG += c++11
-!contains(QT_CONFIG, doubleconversion):!contains(QT_CONFIG, system-doubleconversion) {
+qtConfig(c++11): CONFIG += c++11
+!qtConfig(doubleconversion):!qtConfig(system-doubleconversion) {
DEFINES += QT_NO_DOUBLECONVERSION
}
diff --git a/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp b/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp
index 262d8ad44b..75fa424ab1 100644
--- a/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp
+++ b/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp
@@ -275,6 +275,7 @@ private slots:
void metaEnums();
void compareSanity_data();
void compareSanity();
+ void compareRich();
void accessSequentialContainerKey();
@@ -4775,6 +4776,60 @@ void tst_QVariant::compareSanity()
}
}
+static void richComparison(const QVariant& less, const QVariant& more)
+{
+ QVERIFY(less.type() == more.type());
+
+ QVERIFY(less < more);
+ QVERIFY(!(more < less));
+
+ QVERIFY(more > less);
+ QVERIFY(!(less > more));
+
+ QVERIFY(less <= more);
+ QVERIFY(!(more <= less));
+ QVERIFY(less <= less);
+
+ QVERIFY(more >= less);
+ QVERIFY(!(less >= more));
+ QVERIFY(more >= more);
+}
+
+void tst_QVariant::compareRich()
+{
+ richComparison(QUuid("{49d8ad2a-2ee8-4c3d-949f-1b5a3765ddf0}"),
+ QUuid("{f6d56824-16e9-4543-a375-add2877c2d05}"));
+ richComparison(QByteArray::fromRawData("a", 1),
+ QByteArray::fromRawData("b", 1));
+ richComparison(QStringLiteral("a"), QStringLiteral("b"));
+ richComparison(QLatin1String("a"), QLatin1String("b"));
+ richComparison(QChar('a'), QChar('b'));
+ richComparison(QDate(2016, 7, 23), QDate(2016, 7, 24));
+ richComparison(QTime(0, 0), QTime(0, 1));
+ richComparison(QDateTime(QDate(2016, 7, 23), QTime(0, 0)),
+ QDateTime(QDate(2016, 7, 23), QTime(0, 1)));
+
+ richComparison(QStringList(), QStringList() << QStringLiteral("a"));
+ richComparison(QStringList(), QStringList() << QStringLiteral("a")
+ << QStringLiteral("b"));
+ richComparison(QStringList() << QStringLiteral("a"),
+ QStringList() << QStringLiteral("b"));
+ richComparison(QStringList() << QStringLiteral("a"),
+ QStringList() << QStringLiteral("b")
+ << QStringLiteral("c"));
+ richComparison(QStringList() << QStringLiteral("a")
+ << QStringLiteral("c"),
+ QStringList() << QStringLiteral("b"));
+ richComparison(QStringList() << QStringLiteral("a")
+ << QStringLiteral("c"),
+ QStringList() << QStringLiteral("b")
+ << QStringLiteral("d"));
+ richComparison(QStringList() << QStringLiteral("a")
+ << QStringLiteral("c"),
+ QStringList() << QStringLiteral("a")
+ << QStringLiteral("d"));
+}
+
void tst_QVariant::accessSequentialContainerKey()
{
QString nameResult;
diff --git a/tests/auto/corelib/mimetypes/mimetypes.pro b/tests/auto/corelib/mimetypes/mimetypes.pro
index 9063d677e7..9dd091374f 100644
--- a/tests/auto/corelib/mimetypes/mimetypes.pro
+++ b/tests/auto/corelib/mimetypes/mimetypes.pro
@@ -4,5 +4,5 @@ SUBDIRS = \
qmimetype \
qmimedatabase
-!contains(QT_CONFIG, private_tests): SUBDIRS -= \
+!qtConfig(private_tests): SUBDIRS -= \
qmimetype
diff --git a/tests/auto/corelib/plugin/qpluginloader/qpluginloader.pro b/tests/auto/corelib/plugin/qpluginloader/qpluginloader.pro
index 83d00f7cd8..c681f5585c 100644
--- a/tests/auto/corelib/plugin/qpluginloader/qpluginloader.pro
+++ b/tests/auto/corelib/plugin/qpluginloader/qpluginloader.pro
@@ -5,7 +5,7 @@ SUBDIRS = lib \
theplugin \
tst
!android: !win32: !mac: SUBDIRS += almostplugin
-macx-*: contains(QT_CONFIG, private_tests): SUBDIRS += machtest
+macx-*: qtConfig(private_tests): SUBDIRS += machtest
TARGET = tst_qpluginloader
# no special install rule for subdir
diff --git a/tests/auto/corelib/plugin/qpluginloader/tst/tst.pro b/tests/auto/corelib/plugin/qpluginloader/tst/tst.pro
index 101392927c..5f9fa6664b 100644
--- a/tests/auto/corelib/plugin/qpluginloader/tst/tst.pro
+++ b/tests/auto/corelib/plugin/qpluginloader/tst/tst.pro
@@ -1,7 +1,7 @@
CONFIG += testcase
TARGET = ../tst_qpluginloader
QT = core testlib
-contains(QT_CONFIG, private_tests): QT += core-private
+qtConfig(private_tests): QT += core-private
SOURCES = ../tst_qpluginloader.cpp ../fakeplugin.cpp
HEADERS = ../theplugin/plugininterface.h
CONFIG -= app_bundle
diff --git a/tests/auto/corelib/thread/qthreadstorage/tst_qthreadstorage.cpp b/tests/auto/corelib/thread/qthreadstorage/tst_qthreadstorage.cpp
index 4e582cc346..49a3b3e4db 100644
--- a/tests/auto/corelib/thread/qthreadstorage/tst_qthreadstorage.cpp
+++ b/tests/auto/corelib/thread/qthreadstorage/tst_qthreadstorage.cpp
@@ -200,6 +200,13 @@ void testAdoptedThreadStorageWin(void *p)
}
QObject::connect(QThread::currentThread(), SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()));
}
+#ifdef Q_OS_WINRT
+unsigned __stdcall testAdoptedThreadStorageWinRT(void *p)
+{
+ testAdoptedThreadStorageWin(p);
+ return 0;
+}
+#endif
void *testAdoptedThreadStorageUnix(void *pointers)
{
testAdoptedThreadStorageWin(pointers);
@@ -217,7 +224,12 @@ void tst_QThreadStorage::adoptedThreads()
const int state = pthread_create(&thread, 0, testAdoptedThreadStorageUnix, &pointers);
QCOMPARE(state, 0);
pthread_join(thread, 0);
-#elif defined Q_OS_WIN && !defined(Q_OS_WINRT)
+#elif defined Q_OS_WINRT
+ HANDLE thread;
+ thread = (HANDLE) _beginthreadex(NULL, 0, testAdoptedThreadStorageWinRT, &pointers, 0, 0);
+ QVERIFY(thread);
+ WaitForSingleObjectEx(thread, INFINITE, FALSE);
+#elif defined Q_OS_WIN
HANDLE thread;
thread = (HANDLE)_beginthread(testAdoptedThreadStorageWin, 0, &pointers);
QVERIFY(thread);
diff --git a/tests/auto/corelib/tools/qcollator/qcollator.pro b/tests/auto/corelib/tools/qcollator/qcollator.pro
index ed879ee70e..7725194e3d 100644
--- a/tests/auto/corelib/tools/qcollator/qcollator.pro
+++ b/tests/auto/corelib/tools/qcollator/qcollator.pro
@@ -3,4 +3,4 @@ TARGET = tst_qcollator
QT = core testlib
SOURCES = tst_qcollator.cpp
DEFINES += QT_NO_CAST_TO_ASCII
-contains(QT_CONFIG,icu):DEFINES += QT_USE_ICU
+qtConfig(icu): DEFINES += QT_USE_ICU
diff --git a/tests/auto/corelib/tools/qfreelist/qfreelist.pro b/tests/auto/corelib/tools/qfreelist/qfreelist.pro
index fb108338bd..4825987bcf 100644
--- a/tests/auto/corelib/tools/qfreelist/qfreelist.pro
+++ b/tests/auto/corelib/tools/qfreelist/qfreelist.pro
@@ -2,4 +2,4 @@ CONFIG += testcase
TARGET = tst_qfreelist
QT = core-private testlib
SOURCES = tst_qfreelist.cpp
-!contains(QT_CONFIG,private_tests): SOURCES += $$QT_SOURCE_TREE/src/corelib/tools/qfreelist.cpp
+!qtConfig(private_tests): SOURCES += $$QT_SOURCE_TREE/src/corelib/tools/qfreelist.cpp
diff --git a/tests/auto/corelib/tools/qlatin1string/qlatin1string.pro b/tests/auto/corelib/tools/qlatin1string/qlatin1string.pro
index a996dab23e..61054b40e4 100644
--- a/tests/auto/corelib/tools/qlatin1string/qlatin1string.pro
+++ b/tests/auto/corelib/tools/qlatin1string/qlatin1string.pro
@@ -3,7 +3,7 @@ TARGET = tst_qlatin1string
QT = core testlib
SOURCES = tst_qlatin1string.cpp
DEFINES += QT_NO_CAST_TO_ASCII
-contains(QT_CONFIG,c++11): CONFIG += c++11
-contains(QT_CONFIG,c++14): CONFIG += c++14
+qtConfig(c++11): CONFIG += c++11
+qtConfig(c++14): CONFIG += c++14
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/auto/corelib/tools/qlocale/test/test.pro b/tests/auto/corelib/tools/qlocale/test/test.pro
index d9004d1eb6..595ee258e7 100644
--- a/tests/auto/corelib/tools/qlocale/test/test.pro
+++ b/tests/auto/corelib/tools/qlocale/test/test.pro
@@ -4,7 +4,7 @@ QT = core testlib core-private
embedded: QT += gui
SOURCES = ../tst_qlocale.cpp
-!contains(QT_CONFIG, doubleconversion):!contains(QT_CONFIG, system-doubleconversion) {
+!qtConfig(doubleconversion):!qtConfig(system-doubleconversion) {
DEFINES += QT_NO_DOUBLECONVERSION
}
diff --git a/tests/auto/corelib/tools/qregularexpression/qregularexpression.pro b/tests/auto/corelib/tools/qregularexpression/qregularexpression.pro
index c030f04a27..e1840808ff 100644
--- a/tests/auto/corelib/tools/qregularexpression/qregularexpression.pro
+++ b/tests/auto/corelib/tools/qregularexpression/qregularexpression.pro
@@ -1,3 +1,3 @@
TEMPLATE = subdirs
SUBDIRS = defaultoptimize forceoptimize
-contains(QT_CONFIG,private_tests):SUBDIRS += alwaysoptimize
+qtConfig(private_tests): SUBDIRS += alwaysoptimize
diff --git a/tests/auto/corelib/tools/qstring/qstring.pro b/tests/auto/corelib/tools/qstring/qstring.pro
index 1ff9a4fc9e..a94ad3405a 100644
--- a/tests/auto/corelib/tools/qstring/qstring.pro
+++ b/tests/auto/corelib/tools/qstring/qstring.pro
@@ -3,11 +3,11 @@ TARGET = tst_qstring
QT = core testlib
SOURCES = tst_qstring.cpp
DEFINES += QT_NO_CAST_TO_ASCII
-contains(QT_CONFIG,icu):DEFINES += QT_USE_ICU
-contains(QT_CONFIG,c++11): CONFIG += c++11
+qtConfig(icu): DEFINES += QT_USE_ICU
+qtConfig(c++11): CONFIG += c++11
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
-!contains(QT_CONFIG, doubleconversion):!contains(QT_CONFIG, system-doubleconversion) {
+!qtConfig(doubleconversion):!qtConfig(system-doubleconversion) {
DEFINES += QT_NO_DOUBLECONVERSION
}
diff --git a/tests/auto/corelib/tools/qstring/tst_qstring.cpp b/tests/auto/corelib/tools/qstring/tst_qstring.cpp
index 2e35c961c6..a0a872710c 100644
--- a/tests/auto/corelib/tools/qstring/tst_qstring.cpp
+++ b/tests/auto/corelib/tools/qstring/tst_qstring.cpp
@@ -123,7 +123,7 @@ template <>
class Arg<QStringRef> : ArgBase
{
QStringRef ref() const
- { return this->pinned.isNull() ? QStringRef() : this->pinned.midRef(0) ; }
+ { return QStringRef(&pinned); }
public:
explicit Arg(const char *str) : ArgBase(str) {}
@@ -499,6 +499,8 @@ private slots:
void fromLocal8Bit();
void local8Bit_data();
void local8Bit();
+ void invalidToLocal8Bit_data();
+ void invalidToLocal8Bit();
void nullFromLocal8Bit();
void fromLatin1Roundtrip_data();
void fromLatin1Roundtrip();
@@ -4293,6 +4295,66 @@ void tst_QString::local8Bit()
QCOMPARE(local8Bit.toLocal8Bit(), QByteArray(result));
}
+void tst_QString::invalidToLocal8Bit_data()
+{
+ QTest::addColumn<QString>("unicode");
+ QTest::addColumn<QByteArray>("expect"); // Initial validly-converted prefix
+
+ {
+ const QChar malformed[] = { 'A', 0xd800, 'B', 0 };
+ const char expected[] = "A";
+ QTest::newRow("LoneHighSurrogate")
+ << QString(malformed, sizeof(malformed) / sizeof(QChar))
+ // Don't include the terminating '\0' of expected:
+ << QByteArray(expected, sizeof(expected) / sizeof(char) - 1);
+ }
+ {
+ const QChar malformed[] = { 'A', 0xdc00, 'B', 0 };
+ const char expected[] = "A";
+ QTest::newRow("LoneLowSurrogate")
+ << QString(malformed, sizeof(malformed) / sizeof(QChar))
+ << QByteArray(expected, sizeof(expected) / sizeof(char) - 1);
+ }
+ {
+ const QChar malformed[] = { 'A', 0xd800, 0xd801, 'B', 0 };
+ const char expected[] = "A";
+ QTest::newRow("DoubleHighSurrogate")
+ << QString(malformed, sizeof(malformed) / sizeof(QChar))
+ << QByteArray(expected, sizeof(expected) / sizeof(char) - 1);
+ }
+ {
+ const QChar malformed[] = { 'A', 0xdc00, 0xdc01, 'B', 0 };
+ const char expected[] = "A";
+ QTest::newRow("DoubleLowSurrogate")
+ << QString(malformed, sizeof(malformed) / sizeof(QChar))
+ << QByteArray(expected, sizeof(expected) / sizeof(char) - 1);
+ }
+ {
+ const QChar malformed[] = { 'A', 0xdc00, 0xd800, 'B', 0 };
+ const char expected[] = "A";
+ QTest::newRow("ReversedSurrogates") // low before high
+ << QString(malformed, sizeof(malformed) / sizeof(QChar))
+ << QByteArray(expected, sizeof(expected) / sizeof(char) - 1);
+ }
+}
+
+void tst_QString::invalidToLocal8Bit()
+{
+ QFETCH(QString, unicode);
+ QFETCH(QByteArray, expect);
+ QByteArray local = unicode.toLocal8Bit();
+ /*
+ The main concern of this test is to check that any error-reporting that
+ toLocal8Bit() prompts on failure isn't dependent on outputting the data
+ it's converting via toLocal8Bit(), which would be apt to recurse. So the
+ real purpose of this QVERIFY(), for all that we should indeed check we get
+ the borked output that matches what we can reliably expect (despite
+ variation in how codecs respond to errors), is to verify that we got here
+ - i.e. we didn't crash in such a recursive stack over-flow.
+ */
+ QVERIFY(local.startsWith(expect));
+}
+
void tst_QString::nullFromLocal8Bit()
{
QString a;
diff --git a/tests/auto/corelib/tools/qstringapisymmetry/qstringapisymmetry.pro b/tests/auto/corelib/tools/qstringapisymmetry/qstringapisymmetry.pro
index 76e89c9acd..bc38b17949 100644
--- a/tests/auto/corelib/tools/qstringapisymmetry/qstringapisymmetry.pro
+++ b/tests/auto/corelib/tools/qstringapisymmetry/qstringapisymmetry.pro
@@ -2,4 +2,4 @@ CONFIG += testcase
TARGET = tst_qstringapisymmetry
QT = core testlib
SOURCES = tst_qstringapisymmetry.cpp
-contains(QT_CONFIG,c++14): CONFIG += c++14
+qtConfig(c++14): CONFIG += c++14
diff --git a/tests/auto/corelib/tools/qtimezone/qtimezone.pro b/tests/auto/corelib/tools/qtimezone/qtimezone.pro
index 4459ed6020..afc4c59dfe 100644
--- a/tests/auto/corelib/tools/qtimezone/qtimezone.pro
+++ b/tests/auto/corelib/tools/qtimezone/qtimezone.pro
@@ -2,6 +2,6 @@ CONFIG += testcase
TARGET = tst_qtimezone
QT = core-private testlib
SOURCES = tst_qtimezone.cpp
-contains(QT_CONFIG,icu) {
+qtConfig(icu) {
DEFINES += QT_USE_ICU
}
diff --git a/tests/auto/corelib/tools/qvector/qvector.pro b/tests/auto/corelib/tools/qvector/qvector.pro
index d49516923f..b9a4ae747b 100644
--- a/tests/auto/corelib/tools/qvector/qvector.pro
+++ b/tests/auto/corelib/tools/qvector/qvector.pro
@@ -1,5 +1,5 @@
CONFIG += testcase
-contains(QT_CONFIG, c++11):CONFIG += c++11
+qtConfig(c++11): CONFIG += c++11
TARGET = tst_qvector
QT = core testlib
SOURCES = $$PWD/tst_qvector.cpp
diff --git a/tests/auto/corelib/tools/qversionnumber/qversionnumber.pro b/tests/auto/corelib/tools/qversionnumber/qversionnumber.pro
index 834fc85a29..e2ae91cb64 100644
--- a/tests/auto/corelib/tools/qversionnumber/qversionnumber.pro
+++ b/tests/auto/corelib/tools/qversionnumber/qversionnumber.pro
@@ -1,6 +1,6 @@
CONFIG += testcase
-contains(QT_CONFIG, c++11):CONFIG += c++11
-contains(QT_CONFIG, c++14):CONFIG += c++14
+qtConfig(c++11): CONFIG += c++11
+qtConfig(c++14): CONFIG += c++14
TARGET = tst_qversionnumber
QT = core testlib
SOURCES = tst_qversionnumber.cpp
diff --git a/tests/auto/dbus/dbus.pro b/tests/auto/dbus/dbus.pro
index c5cddee5f5..1769583fca 100644
--- a/tests/auto/dbus/dbus.pro
+++ b/tests/auto/dbus/dbus.pro
@@ -26,6 +26,6 @@ SUBDIRS+=\
qdbusthreading \
qdbusxmlparser
-!contains(QT_CONFIG,private_tests): SUBDIRS -= \
+!qtConfig(private_tests): SUBDIRS -= \
qdbusmarshall \
diff --git a/tests/auto/dbus/qdbusconnection/tst_qdbusconnection.cpp b/tests/auto/dbus/qdbusconnection/tst_qdbusconnection.cpp
index 602de58b2c..95daa256b5 100644
--- a/tests/auto/dbus/qdbusconnection/tst_qdbusconnection.cpp
+++ b/tests/auto/dbus/qdbusconnection/tst_qdbusconnection.cpp
@@ -1087,6 +1087,16 @@ void tst_QDBusConnection::connectSignal()
QTest::qWait(100);
QCOMPARE(recv.argumentReceived, signal.arguments().at(0).toString());
QCOMPARE(recv.signalsReceived, 1);
+
+ // confirm that we are, indeed, a unique connection
+ recv.argumentReceived.clear();
+ recv.signalsReceived = 0;
+ QVERIFY(!con.connect(con.baseService(), signal.path(), signal.interface(),
+ signal.member(), "s", &recv, SLOT(oneSlot(QString))));
+ QVERIFY(con.send(signal));
+ QTest::qWait(100);
+ QCOMPARE(recv.argumentReceived, signal.arguments().at(0).toString());
+ QCOMPARE(recv.signalsReceived, 1);
}
void tst_QDBusConnection::slotsWithLessParameters()
@@ -1118,6 +1128,15 @@ void tst_QDBusConnection::slotsWithLessParameters()
QTest::qWait(100);
QCOMPARE(recv.argumentReceived, QString());
QCOMPARE(recv.signalsReceived, 1);
+
+ // confirm that we are, indeed, a unique connection
+ recv.signalsReceived = 0;
+ QVERIFY(!con.connect(con.baseService(), signal.path(), signal.interface(),
+ signal.member(), "s", &recv, SLOT(oneSlot())));
+ QVERIFY(con.send(signal));
+ QTest::qWait(100);
+ QCOMPARE(recv.argumentReceived, QString());
+ QCOMPARE(recv.signalsReceived, 1);
}
void SignalReceiver::secondCallWithCallback()
diff --git a/tests/auto/dbus/qdbusmarshall/qdbusmarshall.pro b/tests/auto/dbus/qdbusmarshall/qdbusmarshall.pro
index e9a41c0fb4..caedb5a0f2 100644
--- a/tests/auto/dbus/qdbusmarshall/qdbusmarshall.pro
+++ b/tests/auto/dbus/qdbusmarshall/qdbusmarshall.pro
@@ -6,4 +6,4 @@ SUBDIRS = qpong qdbusmarshall
QT = core-private testlib
-requires(contains(QT_CONFIG,private_tests))
+requires(qtConfig(private_tests))
diff --git a/tests/auto/dbus/qdbusmarshall/qdbusmarshall/qdbusmarshall.pro b/tests/auto/dbus/qdbusmarshall/qdbusmarshall/qdbusmarshall.pro
index 21e665fa37..031cc252c8 100644
--- a/tests/auto/dbus/qdbusmarshall/qdbusmarshall/qdbusmarshall.pro
+++ b/tests/auto/dbus/qdbusmarshall/qdbusmarshall/qdbusmarshall.pro
@@ -5,10 +5,9 @@ DESTDIR = ./
QT = core-private dbus-private testlib
-contains(QT_CONFIG, dbus-linked) {
+qtConfig(dbus-linked) {
DEFINES += QT_LINKED_LIBDBUS
- LIBS += $$QMAKE_LIBS_DBUS
- QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_DBUS
+ QMAKE_USE += dbus
} else {
SOURCES += ../../../../../src/dbus/qdbus_symbols.cpp
}
diff --git a/tests/auto/dbus/qdbustype/qdbustype.pro b/tests/auto/dbus/qdbustype/qdbustype.pro
index e65b9ec5b3..75a9980732 100644
--- a/tests/auto/dbus/qdbustype/qdbustype.pro
+++ b/tests/auto/dbus/qdbustype/qdbustype.pro
@@ -2,10 +2,9 @@ CONFIG += testcase parallel_test
TARGET = tst_qdbustype
QT = core-private dbus-private testlib
SOURCES += tst_qdbustype.cpp
-contains(QT_CONFIG, dbus-linked) {
+qtConfig(dbus-linked) {
DEFINES += QT_LINKED_LIBDBUS
- LIBS += $$QMAKE_LIBS_DBUS
- QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_DBUS
+ QMAKE_USE += dbus
} else {
SOURCES += ../../../../src/dbus/qdbus_symbols.cpp
}
diff --git a/tests/auto/gui/gui.pro b/tests/auto/gui/gui.pro
index d6aa5e01ae..8d8a2df393 100644
--- a/tests/auto/gui/gui.pro
+++ b/tests/auto/gui/gui.pro
@@ -13,4 +13,4 @@ SUBDIRS = \
util \
itemmodels \
-!contains(QT_CONFIG, opengl(es2)?): SUBDIRS -= qopengl qopenglconfig
+!qtConfig(opengl(es2)?): SUBDIRS -= qopengl qopenglconfig
diff --git a/tests/auto/gui/image/image.pro b/tests/auto/gui/image/image.pro
index 9199763c40..5a74df4c78 100644
--- a/tests/auto/gui/image/image.pro
+++ b/tests/auto/gui/image/image.pro
@@ -14,6 +14,6 @@ SUBDIRS=\
!qtHaveModule(network): SUBDIRS -= \
qimagereader
-!contains(QT_CONFIG, private_tests): SUBDIRS -= \
+!qtConfig(private_tests): SUBDIRS -= \
qpixmapcache \
diff --git a/tests/auto/gui/image/qimage/qimage.pro b/tests/auto/gui/image/qimage/qimage.pro
index 36d64a275f..39ce4e26cb 100644
--- a/tests/auto/gui/image/qimage/qimage.pro
+++ b/tests/auto/gui/image/qimage/qimage.pro
@@ -3,7 +3,7 @@ TARGET = tst_qimage
SOURCES += tst_qimage.cpp
QT += core-private gui-private testlib
-contains(QT_CONFIG, c++11): CONFIG += c++11
+qtConfig(c++11): CONFIG += c++11
android: RESOURCES+=qimage.qrc
diff --git a/tests/auto/gui/image/qimage/tst_qimage.cpp b/tests/auto/gui/image/qimage/tst_qimage.cpp
index 18812fd090..a1ab812aaa 100644
--- a/tests/auto/gui/image/qimage/tst_qimage.cpp
+++ b/tests/auto/gui/image/qimage/tst_qimage.cpp
@@ -39,6 +39,10 @@
#include <private/qimage_p.h>
#include <private/qdrawhelper_p.h>
+#ifdef Q_OS_DARWIN
+#include <CoreGraphics/CoreGraphics.h>
+#endif
+
Q_DECLARE_METATYPE(QImage::Format)
Q_DECLARE_METATYPE(Qt::GlobalColor)
@@ -201,6 +205,11 @@ private slots:
void ditherGradient_data();
void ditherGradient();
+#ifdef Q_OS_DARWIN
+ void toCGImage_data();
+ void toCGImage();
+#endif
+
private:
const QString m_prefix;
};
@@ -3307,5 +3316,41 @@ void tst_QImage::ditherGradient()
QVERIFY(observedGradientSteps >= minimumExpectedGradient);
}
+#ifdef Q_OS_DARWIN
+
+void tst_QImage::toCGImage_data()
+{
+ QTest::addColumn<QImage::Format>("format");
+ QTest::addColumn<bool>("supported");
+
+ // Populate test data with supported status for all QImage formats.
+ QSet<QImage::Format> supported =
+ { QImage::Format_ARGB32, QImage::Format_RGB32, QImage::Format_RGBA8888_Premultiplied,
+ QImage::Format_RGBA8888, QImage::Format_RGBX8888, QImage::Format_ARGB32_Premultiplied };
+
+ for (int i = QImage::Format_Invalid; i < QImage::Format_Grayscale8; ++i) {
+ QTest::newRow(qPrintable(formatToString(QImage::Format(i))))
+ << QImage::Format(i) << supported.contains(QImage::Format(i));
+ }
+}
+
+// Verify that toCGImage() returns a valid CGImageRef for supported image formats.
+void tst_QImage::toCGImage()
+{
+ QFETCH(QImage::Format, format);
+ QFETCH(bool, supported);
+
+ QImage qimage(64, 64, format);
+ qimage.fill(Qt::red);
+
+ CGImageRef cgimage = qimage.toCGImage();
+ QCOMPARE(cgimage != nullptr, supported);
+
+ CGImageRelease(cgimage);
+}
+
+#endif
+
+
QTEST_GUILESS_MAIN(tst_QImage)
#include "tst_qimage.moc"
diff --git a/tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp b/tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp
index 9e747f8b11..b66eef5759 100644
--- a/tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp
+++ b/tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp
@@ -55,9 +55,6 @@ class tst_QImageWriter : public QObject
{
Q_OBJECT
-public:
- virtual ~tst_QImageWriter();
-
public slots:
void initTestCase();
@@ -155,16 +152,6 @@ void tst_QImageWriter::getSetCheck()
QCOMPARE(1.1f, obj1.gamma());
}
-tst_QImageWriter::~tst_QImageWriter()
-{
- QDir dir(prefix);
- QStringList filesToDelete = dir.entryList(QStringList() << "gen-*" , QDir::NoDotAndDotDot | QDir::Files);
- foreach( QString file, filesToDelete) {
- QFile::remove(dir.absoluteFilePath(file));
- }
-
-}
-
void tst_QImageWriter::writeImage_data()
{
QTest::addColumn<QString>("fileName");
diff --git a/tests/auto/gui/image/qmovie/qmovie.pro b/tests/auto/gui/image/qmovie/qmovie.pro
index 4a741ec154..6a7e23be99 100644
--- a/tests/auto/gui/image/qmovie/qmovie.pro
+++ b/tests/auto/gui/image/qmovie/qmovie.pro
@@ -5,8 +5,8 @@ qtHaveModule(widgets): QT += widgets
SOURCES += tst_qmovie.cpp
MOC_DIR=tmp
-contains(QT_CONFIG, gif):DEFINES += QTEST_HAVE_GIF
-contains(QT_CONFIG, jpeg):DEFINES += QTEST_HAVE_JPEG
+qtConfig(gif): DEFINES += QTEST_HAVE_GIF
+qtConfig(jpeg): DEFINES += QTEST_HAVE_JPEG
RESOURCES += resources.qrc
TESTDATA += animations/*
diff --git a/tests/auto/gui/kernel/kernel.pro b/tests/auto/gui/kernel/kernel.pro
index 317d8c1ff9..631962ad34 100644
--- a/tests/auto/gui/kernel/kernel.pro
+++ b/tests/auto/gui/kernel/kernel.pro
@@ -34,4 +34,6 @@ win32:!winrt:qtHaveModule(network): SUBDIRS += noqteventloop
!qtHaveModule(network): SUBDIRS -= \
qguieventloop
-!contains(QT_CONFIG, opengl(es2)?): SUBDIRS -= qopenglwindow
+!qtConfig(opengl(es2)?): SUBDIRS -= qopenglwindow
+
+uikit: SUBDIRS -= qclipboard
diff --git a/tests/auto/gui/kernel/noqteventloop/noqteventloop.pro b/tests/auto/gui/kernel/noqteventloop/noqteventloop.pro
index 5e4875d1e7..7e98704aea 100644
--- a/tests/auto/gui/kernel/noqteventloop/noqteventloop.pro
+++ b/tests/auto/gui/kernel/noqteventloop/noqteventloop.pro
@@ -5,4 +5,4 @@ QT += core-private network gui-private testlib
SOURCES += tst_noqteventloop.cpp
-contains(QT_CONFIG,dynamicgl):win32:!winrt: LIBS += -luser32
+qtConfig(dynamicgl):win32:!winrt: LIBS += -luser32
diff --git a/tests/auto/gui/kernel/qwindow/qwindow.pro b/tests/auto/gui/kernel/qwindow/qwindow.pro
index f975e00ffa..844b3e8507 100644
--- a/tests/auto/gui/kernel/qwindow/qwindow.pro
+++ b/tests/auto/gui/kernel/qwindow/qwindow.pro
@@ -5,4 +5,4 @@ QT += core-private gui-private testlib
SOURCES += tst_qwindow.cpp
-contains(QT_CONFIG,dynamicgl):win32:!winrt: LIBS += -luser32
+qtConfig(dynamicgl):win32:!winrt: LIBS += -luser32
diff --git a/tests/auto/gui/painting/painting.pro b/tests/auto/gui/painting/painting.pro
index 0f7595c871..831fffab30 100644
--- a/tests/auto/gui/painting/painting.pro
+++ b/tests/auto/gui/painting/painting.pro
@@ -16,7 +16,7 @@ SUBDIRS=\
qwmatrix \
qpolygon \
-!contains(QT_CONFIG, private_tests): SUBDIRS -= \
+!qtConfig(private_tests): SUBDIRS -= \
qpathclipper \
diff --git a/tests/auto/gui/painting/qcolor/tst_qcolor.cpp b/tests/auto/gui/painting/qcolor/tst_qcolor.cpp
index cffa444c97..00e7436c0f 100644
--- a/tests/auto/gui/painting/qcolor/tst_qcolor.cpp
+++ b/tests/auto/gui/painting/qcolor/tst_qcolor.cpp
@@ -279,6 +279,8 @@ void tst_QColor::name_data()
QTest::newRow("global color darkMagenta") << QColor(Qt::darkMagenta) << "#800080" << QColor::HexRgb;
QTest::newRow("global color darkYellow") << QColor(Qt::darkYellow) << "#808000" << QColor::HexRgb;
QTest::newRow("transparent red") << QColor(255, 0, 0, 102) << "#66ff0000" << QColor::HexArgb;
+ QTest::newRow("fully_transparent_green_rgb") << QColor(0, 0, 255, 0) << "#0000ff" << QColor::HexRgb;
+ QTest::newRow("fully_transparent_green_argb") << QColor(0, 0, 255, 0) << "#000000ff" << QColor::HexArgb;
}
void tst_QColor::name()
diff --git a/tests/auto/gui/painting/qpathclipper/qpathclipper.pro b/tests/auto/gui/painting/qpathclipper/qpathclipper.pro
index e153460bf2..671220f94b 100644
--- a/tests/auto/gui/painting/qpathclipper/qpathclipper.pro
+++ b/tests/auto/gui/painting/qpathclipper/qpathclipper.pro
@@ -5,6 +5,6 @@ HEADERS += paths.h
SOURCES += tst_qpathclipper.cpp paths.cpp
QT += gui-private testlib
-requires(contains(QT_CONFIG,private_tests))
+requires(qtConfig(private_tests))
unix:!darwin:!haiku:!integrity: LIBS += -lm
diff --git a/tests/auto/gui/qopengl/qopengl.pro b/tests/auto/gui/qopengl/qopengl.pro
index a4ef016e39..aaef6e5125 100644
--- a/tests/auto/gui/qopengl/qopengl.pro
+++ b/tests/auto/gui/qopengl/qopengl.pro
@@ -8,4 +8,4 @@ QT += gui-private core-private testlib
SOURCES += tst_qopengl.cpp
-linux:contains(QT_CONFIG, xcb-glx):contains(QT_CONFIG, xcb-xlib):!contains(QT_CONFIG, egl): DEFINES += USE_GLX
+linux:qtConfig(xcb-glx):qtConfig(xcb-xlib):!qtConfig(egl): DEFINES += USE_GLX
diff --git a/tests/auto/gui/text/qabstracttextdocumentlayout/BLACKLIST b/tests/auto/gui/text/qabstracttextdocumentlayout/BLACKLIST
deleted file mode 100644
index fa033cee09..0000000000
--- a/tests/auto/gui/text/qabstracttextdocumentlayout/BLACKLIST
+++ /dev/null
@@ -1,7 +0,0 @@
-#QTBUG-53648
-[imageAt]
-opensuse-42.1
-rhel-7.2
-#QTBUG-52991
-[formatAt]
-opensuse-42.1
diff --git a/tests/auto/gui/text/qabstracttextdocumentlayout/tst_qabstracttextdocumentlayout.cpp b/tests/auto/gui/text/qabstracttextdocumentlayout/tst_qabstracttextdocumentlayout.cpp
index 9542d306ba..be3ef968ef 100644
--- a/tests/auto/gui/text/qabstracttextdocumentlayout/tst_qabstracttextdocumentlayout.cpp
+++ b/tests/auto/gui/text/qabstracttextdocumentlayout/tst_qabstracttextdocumentlayout.cpp
@@ -194,7 +194,7 @@ void tst_QAbstractTextDocumentLayout::imageAt()
QCOMPARE(documentLayout->anchorAt(imagePoint), QString("link"));
// imageAt on start returns nothing (there's the "foo" text)
- QPointF fooPoint(fooBr.width() + blockStart.x(), (fooBr.height() / 2) + blockStart.y());
+ QPointF fooPoint(blockStart.x() + (fooBr.width() / 2), (fooBr.height() / 2) + blockStart.y());
QCOMPARE(documentLayout->imageAt(fooPoint), QString());
}
@@ -221,7 +221,7 @@ void tst_QAbstractTextDocumentLayout::formatAt()
QVERIFY(format.isImageFormat());
// move over the unformatted "foo" text)
- QPointF fooPoint(fooBr.width() + blockStart.x(), (fooBr.height() / 2) + blockStart.y());
+ QPointF fooPoint(blockStart.x() + (fooBr.width() / 2), (fooBr.height() / 2) + blockStart.y());
format = documentLayout->formatAt(fooPoint);
QVERIFY(format.isCharFormat());
QVERIFY(!format.toCharFormat().isAnchor());
diff --git a/tests/auto/gui/text/qcssparser/qcssparser.pro b/tests/auto/gui/text/qcssparser/qcssparser.pro
index b92859d4fb..e2bb3eeea8 100644
--- a/tests/auto/gui/text/qcssparser/qcssparser.pro
+++ b/tests/auto/gui/text/qcssparser/qcssparser.pro
@@ -3,7 +3,7 @@ TARGET = tst_qcssparser
SOURCES += tst_qcssparser.cpp
QT += xml gui-private testlib
-requires(contains(QT_CONFIG,private_tests))
+requires(qtConfig(private_tests))
DEFINES += SRCDIR=\\\"$$PWD\\\"
android {
diff --git a/tests/auto/gui/text/qstatictext/qstatictext.pro b/tests/auto/gui/text/qstatictext/qstatictext.pro
index 0f4906ce4d..09d0dd4126 100644
--- a/tests/auto/gui/text/qstatictext/qstatictext.pro
+++ b/tests/auto/gui/text/qstatictext/qstatictext.pro
@@ -4,4 +4,4 @@ QT += testlib
SOURCES += tst_qstatictext.cpp
-contains(QT_CONFIG, private_tests): QT += core-private gui-private
+qtConfig(private_tests): QT += core-private gui-private
diff --git a/tests/auto/gui/text/qtextpiecetable/qtextpiecetable.pro b/tests/auto/gui/text/qtextpiecetable/qtextpiecetable.pro
index 1419e32012..0bbe0c8c4e 100644
--- a/tests/auto/gui/text/qtextpiecetable/qtextpiecetable.pro
+++ b/tests/auto/gui/text/qtextpiecetable/qtextpiecetable.pro
@@ -6,5 +6,5 @@ SOURCES += tst_qtextpiecetable.cpp
HEADERS += ../qtextdocument/common.h
requires(!win32)
-requires(contains(QT_CONFIG,private_tests))
+requires(qtConfig(private_tests))
diff --git a/tests/auto/gui/text/qzip/tst_qzip.cpp b/tests/auto/gui/text/qzip/tst_qzip.cpp
index 50e9a0f0ef..c0bf5fef8e 100644
--- a/tests/auto/gui/text/qzip/tst_qzip.cpp
+++ b/tests/auto/gui/text/qzip/tst_qzip.cpp
@@ -50,7 +50,7 @@ void tst_QZip::basicUnpack()
QZipReader::FileInfo fi = files.at(0);
QVERIFY(fi.isValid());
- QCOMPARE(fi.filePath, QString("test/"));
+ QCOMPARE(fi.filePath, QString("test"));
QCOMPARE(uint(fi.isDir), (uint) 1);
QCOMPARE(uint(fi.isFile), (uint) 0);
QCOMPARE(uint(fi.isSymLink), (uint) 0);
diff --git a/tests/auto/gui/text/text.pro b/tests/auto/gui/text/text.pro
index dc67794a98..bb4984767f 100644
--- a/tests/auto/gui/text/text.pro
+++ b/tests/auto/gui/text/text.pro
@@ -22,13 +22,15 @@ SUBDIRS=\
qtextpiecetable \
qtextscriptengine \
qtexttable \
-
-contains(QT_CONFIG, OdfWriter):SUBDIRS += qzip qtextodfwriter
+ qzip \
+ qtextodfwriter
win32:SUBDIRS -= qtextpiecetable
-!contains(QT_CONFIG, private_tests): SUBDIRS -= \
+!qtConfig(private_tests): SUBDIRS -= \
qfontcache \
qcssparser \
qtextlayout \
qtextpiecetable \
+ qzip \
+ qtextodfwriter
diff --git a/tests/auto/network/access/access.pro b/tests/auto/network/access/access.pro
index ef0aeac3c8..1d78cf253b 100644
--- a/tests/auto/network/access/access.pro
+++ b/tests/auto/network/access/access.pro
@@ -12,17 +12,12 @@ SUBDIRS=\
qftp \
qhttpnetworkreply \
qabstractnetworkcache \
- hpack
+ hpack \
+ http2
-!contains(QT_CONFIG, private_tests): SUBDIRS -= \
+!qtConfig(private_tests): SUBDIRS -= \
qhttpnetworkconnection \
qhttpnetworkreply \
qftp \
- hpack
-
-contains(QT_CONFIG, openssl) | contains(QT_CONFIG, openssl-linked) {
- contains(QT_CONFIG, private_tests) {
- SUBDIRS += \
- http2
- }
-}
+ hpack \
+ http2
diff --git a/tests/auto/network/access/http2/http2.pro b/tests/auto/network/access/http2/http2.pro
index 5dd8bdf9ae..e130f30784 100644
--- a/tests/auto/network/access/http2/http2.pro
+++ b/tests/auto/network/access/http2/http2.pro
@@ -1,7 +1,6 @@
QT += core core-private network network-private testlib
CONFIG += testcase parallel_test c++11
-TEMPLATE = app
TARGET = tst_http2
HEADERS += http2srv.h
SOURCES += tst_http2.cpp http2srv.cpp
diff --git a/tests/auto/network/access/http2/http2srv.cpp b/tests/auto/network/access/http2/http2srv.cpp
index eb09569cdd..f919937fc3 100644..100755
--- a/tests/auto/network/access/http2/http2srv.cpp
+++ b/tests/auto/network/access/http2/http2srv.cpp
@@ -33,9 +33,14 @@
#include "http2srv.h"
+#ifndef QT_NO_SSL
#include <QtNetwork/qsslconfiguration.h>
-#include <QtNetwork/qhostaddress.h>
+#include <QtNetwork/qsslsocket.h>
#include <QtNetwork/qsslkey.h>
+#endif
+
+#include <QtNetwork/qtcpsocket.h>
+
#include <QtCore/qdebug.h>
#include <QtCore/qlist.h>
#include <QtCore/qfile.h>
@@ -60,8 +65,9 @@ inline bool is_valid_client_stream(quint32 streamID)
}
-Http2Server::Http2Server(const Http2Settings &ss, const Http2Settings &cs)
- : serverSettings(ss)
+Http2Server::Http2Server(bool h2c, const Http2Settings &ss, const Http2Settings &cs)
+ : serverSettings(ss),
+ clearTextHTTP2(h2c)
{
for (const auto &s : cs)
expectedClientSettings[quint16(s.identifier)] = s.value;
@@ -97,6 +103,11 @@ void Http2Server::setResponseBody(const QByteArray &body)
void Http2Server::startServer()
{
+#ifdef QT_NO_SSL
+ // Let the test fail with timeout.
+ if (!clearTextHTTP2)
+ return;
+#endif
if (listen())
emit serverStarted(serverPort());
}
@@ -109,14 +120,14 @@ void Http2Server::sendServerSettings()
if (!serverSettings.size())
return;
- outboundFrame.start(FrameType::SETTINGS, FrameFlag::EMPTY, connectionStreamID);
+ writer.start(FrameType::SETTINGS, FrameFlag::EMPTY, connectionStreamID);
for (const auto &s : serverSettings) {
- outboundFrame.append(s.identifier);
- outboundFrame.append(s.value);
+ writer.append(s.identifier);
+ writer.append(s.value);
if (s.identifier == Settings::INITIAL_WINDOW_SIZE_ID)
streamRecvWindowSize = s.value;
}
- outboundFrame.write(*socket);
+ writer.write(*socket);
// Now, let's update our peer on a session recv window size:
const quint32 updatedSize = 10 * streamRecvWindowSize;
if (sessionRecvWindowSize < updatedSize) {
@@ -134,19 +145,19 @@ void Http2Server::sendGOAWAY(quint32 streamID, quint32 error, quint32 lastStream
{
Q_ASSERT(socket);
- outboundFrame.start(FrameType::GOAWAY, FrameFlag::EMPTY, streamID);
- outboundFrame.append(lastStreamID);
- outboundFrame.append(error);
- outboundFrame.write(*socket);
+ writer.start(FrameType::GOAWAY, FrameFlag::EMPTY, streamID);
+ writer.append(lastStreamID);
+ writer.append(error);
+ writer.write(*socket);
}
void Http2Server::sendRST_STREAM(quint32 streamID, quint32 error)
{
Q_ASSERT(socket);
- outboundFrame.start(FrameType::RST_STREAM, FrameFlag::EMPTY, streamID);
- outboundFrame.append(error);
- outboundFrame.write(*socket);
+ writer.start(FrameType::RST_STREAM, FrameFlag::EMPTY, streamID);
+ writer.append(error);
+ writer.write(*socket);
}
void Http2Server::sendDATA(quint32 streamID, quint32 windowSize)
@@ -160,19 +171,17 @@ void Http2Server::sendDATA(quint32 streamID, quint32 windowSize)
Q_ASSERT(offset < quint32(responseBody.size()));
const quint32 bytes = std::min<quint32>(windowSize, responseBody.size() - offset);
- outboundFrame.start(FrameType::DATA, FrameFlag::EMPTY, streamID);
+ const quint32 frameSizeLimit(clientSetting(Settings::MAX_FRAME_SIZE_ID, Http2::maxFrameSize));
+ const uchar *src = reinterpret_cast<const uchar *>(responseBody.constData() + offset);
const bool last = offset + bytes == quint32(responseBody.size());
- const quint32 frameSizeLimit(clientSetting(Settings::MAX_FRAME_SIZE_ID, Http2::maxFrameSize));
- outboundFrame.writeDATA(*socket, frameSizeLimit,
- reinterpret_cast<const uchar *>(responseBody.constData() + offset),
- bytes);
+ writer.start(FrameType::DATA, FrameFlag::EMPTY, streamID);
+ writer.writeDATA(*socket, frameSizeLimit, src, bytes);
if (last) {
- outboundFrame.start(FrameType::DATA, FrameFlag::END_STREAM, streamID);
- outboundFrame.setPayloadSize(0);
- outboundFrame.write(*socket);
-
+ writer.start(FrameType::DATA, FrameFlag::END_STREAM, streamID);
+ writer.setPayloadSize(0);
+ writer.write(*socket);
suspendedStreams.erase(it);
activeRequests.erase(streamID);
@@ -187,38 +196,52 @@ void Http2Server::sendWINDOW_UPDATE(quint32 streamID, quint32 delta)
{
Q_ASSERT(socket);
- outboundFrame.start(FrameType::WINDOW_UPDATE, FrameFlag::EMPTY, streamID);
- outboundFrame.append(delta);
- outboundFrame.write(*socket);
+ writer.start(FrameType::WINDOW_UPDATE, FrameFlag::EMPTY, streamID);
+ writer.append(delta);
+ writer.write(*socket);
}
void Http2Server::incomingConnection(qintptr socketDescriptor)
{
- socket.reset(new QSslSocket);
- // Add HTTP2 as supported protocol:
- auto conf = QSslConfiguration::defaultConfiguration();
- auto protos = conf.allowedNextProtocols();
- protos.prepend(QSslConfiguration::ALPNProtocolHTTP2);
- conf.setAllowedNextProtocols(protos);
- socket->setSslConfiguration(conf);
- // SSL-related setup ...
- socket->setPeerVerifyMode(QSslSocket::VerifyNone);
- socket->setProtocol(QSsl::TlsV1_2OrLater);
- connect(socket.data(), SIGNAL(sslErrors(QList<QSslError>)),
- this, SLOT(ignoreErrorSlot()));
- QFile file(SRCDIR "certs/fluke.key");
- file.open(QIODevice::ReadOnly);
- QSslKey key(file.readAll(), QSsl::Rsa, QSsl::Pem, QSsl::PrivateKey);
- socket->setPrivateKey(key);
- auto localCert = QSslCertificate::fromPath(SRCDIR "certs/fluke.cert");
- socket->setLocalCertificateChain(localCert);
- socket->setSocketDescriptor(socketDescriptor, QAbstractSocket::ConnectedState);
- // Stop listening.
- close();
- // Start SSL handshake and ALPN:
- connect(socket.data(), SIGNAL(encrypted()),
- this, SLOT(connectionEncrypted()));
- socket->startServerEncryption();
+ if (clearTextHTTP2) {
+ socket.reset(new QTcpSocket);
+ const bool set = socket->setSocketDescriptor(socketDescriptor);
+ Q_UNUSED(set) Q_ASSERT(set);
+ // Stop listening:
+ close();
+ QMetaObject::invokeMethod(this, "connectionEstablished",
+ Qt::QueuedConnection);
+ } else {
+#ifndef QT_NO_SSL
+ socket.reset(new QSslSocket);
+ QSslSocket *sslSocket = static_cast<QSslSocket *>(socket.data());
+ // Add HTTP2 as supported protocol:
+ auto conf = QSslConfiguration::defaultConfiguration();
+ auto protos = conf.allowedNextProtocols();
+ protos.prepend(QSslConfiguration::ALPNProtocolHTTP2);
+ conf.setAllowedNextProtocols(protos);
+ sslSocket->setSslConfiguration(conf);
+ // SSL-related setup ...
+ sslSocket->setPeerVerifyMode(QSslSocket::VerifyNone);
+ sslSocket->setProtocol(QSsl::TlsV1_2OrLater);
+ connect(sslSocket, SIGNAL(sslErrors(QList<QSslError>)),
+ this, SLOT(ignoreErrorSlot()));
+ QFile file(SRCDIR "certs/fluke.key");
+ file.open(QIODevice::ReadOnly);
+ QSslKey key(file.readAll(), QSsl::Rsa, QSsl::Pem, QSsl::PrivateKey);
+ sslSocket->setPrivateKey(key);
+ auto localCert = QSslCertificate::fromPath(SRCDIR "certs/fluke.cert");
+ sslSocket->setLocalCertificateChain(localCert);
+ sslSocket->setSocketDescriptor(socketDescriptor, QAbstractSocket::ConnectedState);
+ // Stop listening.
+ close();
+ // Start SSL handshake and ALPN:
+ connect(sslSocket, SIGNAL(encrypted()), this, SLOT(connectionEstablished()));
+ sslSocket->startServerEncryption();
+#else
+ Q_UNREACHABLE();
+#endif
+ }
}
quint32 Http2Server::clientSetting(Http2::Settings identifier, quint32 defaultValue)
@@ -229,7 +252,7 @@ quint32 Http2Server::clientSetting(Http2::Settings identifier, quint32 defaultVa
return defaultValue;
}
-void Http2Server::connectionEncrypted()
+void Http2Server::connectionEstablished()
{
using namespace Http2;
@@ -250,7 +273,9 @@ void Http2Server::connectionEncrypted()
void Http2Server::ignoreErrorSlot()
{
- socket->ignoreSslErrors();
+#ifndef QT_NO_SSL
+ static_cast<QSslSocket *>(socket.data())->ignoreSslErrors();
+#endif
}
// Now HTTP2 "server" part:
@@ -273,7 +298,7 @@ void Http2Server::readReady()
if (waitingClientPreface) {
handleConnectionPreface();
} else {
- const auto status = inboundFrame.read(*socket);
+ const auto status = reader.read(*socket);
switch (status) {
case FrameStatus::incompleteFrame:
break;
@@ -324,9 +349,11 @@ void Http2Server::handleIncomingFrame()
// 7. RST_STREAM
// 8. GOAWAY
+ inboundFrame = std::move(reader.inboundFrame());
+
if (continuedRequest.size()) {
- if (inboundFrame.type != FrameType::CONTINUATION ||
- inboundFrame.streamID != continuedRequest.front().streamID) {
+ if (inboundFrame.type() != FrameType::CONTINUATION ||
+ inboundFrame.streamID() != continuedRequest.front().streamID()) {
sendGOAWAY(connectionStreamID, PROTOCOL_ERROR, connectionStreamID);
emit invalidFrame();
connectionError = true;
@@ -334,7 +361,7 @@ void Http2Server::handleIncomingFrame()
}
}
- switch (inboundFrame.type) {
+ switch (inboundFrame.type()) {
case FrameType::SETTINGS:
handleSETTINGS();
break;
@@ -366,9 +393,9 @@ void Http2Server::handleSETTINGS()
{
// SETTINGS is either a part of the connection preface,
// or a SETTINGS ACK.
- Q_ASSERT(inboundFrame.type == FrameType::SETTINGS);
+ Q_ASSERT(inboundFrame.type() == FrameType::SETTINGS);
- if (inboundFrame.flags.testFlag(FrameFlag::ACK)) {
+ if (inboundFrame.flags().testFlag(FrameFlag::ACK)) {
if (!waitingClientAck || inboundFrame.dataSize()) {
emit invalidFrame();
connectionError = true;
@@ -409,17 +436,17 @@ void Http2Server::handleSETTINGS()
}
// Send SETTINGS ACK:
- outboundFrame.start(FrameType::SETTINGS, FrameFlag::ACK, connectionStreamID);
- outboundFrame.write(*socket);
+ writer.start(FrameType::SETTINGS, FrameFlag::ACK, connectionStreamID);
+ writer.write(*socket);
waitingClientSettings = false;
emit clientPrefaceOK();
}
void Http2Server::handleDATA()
{
- Q_ASSERT(inboundFrame.type == FrameType::DATA);
+ Q_ASSERT(inboundFrame.type() == FrameType::DATA);
- const auto streamID = inboundFrame.streamID;
+ const auto streamID = inboundFrame.streamID();
if (!is_valid_client_stream(streamID) ||
closedStreams.find(streamID) != closedStreams.end()) {
@@ -429,7 +456,8 @@ void Http2Server::handleDATA()
return;
}
- if (sessionCurrRecvWindow < inboundFrame.payloadSize) {
+ const auto payloadSize = inboundFrame.payloadSize();
+ if (sessionCurrRecvWindow < payloadSize) {
// Client does not respect our session window size!
emit invalidRequest(streamID);
connectionError = true;
@@ -441,20 +469,21 @@ void Http2Server::handleDATA()
if (it == streamWindows.end())
it = streamWindows.insert(std::make_pair(streamID, streamRecvWindowSize)).first;
- if (it->second < inboundFrame.payloadSize) {
+
+ if (it->second < payloadSize) {
emit invalidRequest(streamID);
connectionError = true;
sendGOAWAY(connectionStreamID, FLOW_CONTROL_ERROR, connectionStreamID);
return;
}
- it->second -= inboundFrame.payloadSize;
+ it->second -= payloadSize;
if (it->second < streamRecvWindowSize / 2) {
sendWINDOW_UPDATE(streamID, streamRecvWindowSize / 2);
it->second += streamRecvWindowSize / 2;
}
- sessionCurrRecvWindow -= inboundFrame.payloadSize;
+ sessionCurrRecvWindow -= payloadSize;
if (sessionCurrRecvWindow < sessionRecvWindowSize / 2) {
// This is some quite naive and trivial logic on when to update.
@@ -463,7 +492,7 @@ void Http2Server::handleDATA()
sessionCurrRecvWindow += sessionRecvWindowSize / 2;
}
- if (inboundFrame.flags.testFlag(FrameFlag::END_STREAM)) {
+ if (inboundFrame.flags().testFlag(FrameFlag::END_STREAM)) {
closedStreams.insert(streamID); // Enter "half-closed remote" state.
streamWindows.erase(it);
emit receivedData(streamID);
@@ -472,7 +501,7 @@ void Http2Server::handleDATA()
void Http2Server::handleWINDOW_UPDATE()
{
- const auto streamID = inboundFrame.streamID;
+ const auto streamID = inboundFrame.streamID();
if (!streamID) // We ignore this for now to keep things simple.
return;
@@ -502,9 +531,9 @@ void Http2Server::sendResponse(quint32 streamID, bool emptyBody)
{
Q_ASSERT(activeRequests.find(streamID) != activeRequests.end());
- outboundFrame.start(FrameType::HEADERS, FrameFlag::END_HEADERS, streamID);
+ writer.start(FrameType::HEADERS, FrameFlag::END_HEADERS, streamID);
if (emptyBody)
- outboundFrame.addFlag(FrameFlag::END_STREAM);
+ writer.addFlag(FrameFlag::END_STREAM);
HttpHeader header = {{":status", "200"}};
if (!emptyBody) {
@@ -512,13 +541,13 @@ void Http2Server::sendResponse(quint32 streamID, bool emptyBody)
QString("%1").arg(responseBody.size()).toLatin1()));
}
- HPack::BitOStream ostream(outboundFrame.rawFrameBuffer());
+ HPack::BitOStream ostream(writer.outboundFrame().buffer);
const bool result = encoder.encodeResponse(ostream, header);
Q_ASSERT(result);
Q_UNUSED(result)
const quint32 maxFrameSize(clientSetting(Settings::MAX_FRAME_SIZE_ID, Http2::maxFrameSize));
- outboundFrame.writeHEADERS(*socket, maxFrameSize);
+ writer.writeHEADERS(*socket, maxFrameSize);
if (!emptyBody) {
Q_ASSERT(suspendedStreams.find(streamID) == suspendedStreams.end());
@@ -538,7 +567,7 @@ void Http2Server::processRequest()
{
Q_ASSERT(continuedRequest.size());
- if (!continuedRequest.back().flags.testFlag(FrameFlag::END_HEADERS))
+ if (!continuedRequest.back().flags().testFlag(FrameFlag::END_HEADERS))
return;
// We test here:
@@ -546,7 +575,7 @@ void Http2Server::processRequest()
// 2. has priority set and dependency (it's 0x0 at the moment).
// 3. header can be decompressed.
const auto &headersFrame = continuedRequest.front();
- const auto streamID = headersFrame.streamID;
+ const auto streamID = headersFrame.streamID();
if (!is_valid_client_stream(streamID)) {
emit invalidRequest(streamID);
connectionError = true;
@@ -600,12 +629,12 @@ void Http2Server::processRequest()
return;
}
- continuedRequest.clear();
// Actually, if needed, we can do a comparison here.
activeRequests[streamID] = decoder.decodedHeader();
- if (headersFrame.flags.testFlag(FrameFlag::END_STREAM))
+ if (headersFrame.flags().testFlag(FrameFlag::END_STREAM))
emit receivedRequest(streamID);
// else - we're waiting for incoming DATA frames ...
+ continuedRequest.clear();
}
QT_END_NAMESPACE
diff --git a/tests/auto/network/access/http2/http2srv.h b/tests/auto/network/access/http2/http2srv.h
index 00cfde944b..73b1d80f8e 100644..100755
--- a/tests/auto/network/access/http2/http2srv.h
+++ b/tests/auto/network/access/http2/http2srv.h
@@ -33,9 +33,9 @@
#include <QtNetwork/private/http2frames_p.h>
#include <QtNetwork/private/hpack_p.h>
+#include <QtNetwork/qabstractsocket.h>
#include <QtCore/qscopedpointer.h>
#include <QtNetwork/qtcpserver.h>
-#include <QtNetwork/qsslsocket.h>
#include <QtCore/qbytearray.h>
#include <QtCore/qglobal.h>
@@ -62,7 +62,7 @@ class Http2Server : public QTcpServer
{
Q_OBJECT
public:
- Http2Server(const Http2Settings &serverSettings,
+ Http2Server(bool clearText, const Http2Settings &serverSettings,
const Http2Settings &clientSettings);
~Http2Server();
@@ -105,7 +105,7 @@ Q_SIGNALS:
void windowUpdate(quint32 streamID);
private slots:
- void connectionEncrypted();
+ void connectionEstablished();
void readReady();
private:
@@ -113,7 +113,7 @@ private:
quint32 clientSetting(Http2::Settings identifier, quint32 defaultValue);
- QScopedPointer<QSslSocket> socket;
+ QScopedPointer<QAbstractSocket> socket;
// Connection preface:
bool waitingClientPreface = false;
@@ -126,10 +126,11 @@ private:
bool connectionError = false;
- Http2::FrameReader inboundFrame;
- Http2::FrameWriter outboundFrame;
+ Http2::FrameReader reader;
+ Http2::Frame inboundFrame;
+ Http2::FrameWriter writer;
- using FrameSequence = std::vector<Http2::FrameReader>;
+ using FrameSequence = std::vector<Http2::Frame>;
FrameSequence continuedRequest;
std::map<quint32, quint32> streamWindows;
@@ -155,6 +156,7 @@ private:
quint32 streamRecvWindowSize = Http2::defaultSessionWindowSize;
QByteArray responseBody;
+ bool clearTextHTTP2 = false;
protected slots:
void ignoreErrorSlot();
diff --git a/tests/auto/network/access/http2/tst_http2.cpp b/tests/auto/network/access/http2/tst_http2.cpp
index dbb89db0f9..582a103b2e 100644
--- a/tests/auto/network/access/http2/tst_http2.cpp
+++ b/tests/auto/network/access/http2/tst_http2.cpp
@@ -49,7 +49,9 @@
// At the moment our HTTP/2 imlpementation requires ALPN and this means OpenSSL.
#if !defined(QT_NO_OPENSSL) && OPENSSL_VERSION_NUMBER >= 0x10002000L && !defined(OPENSSL_NO_TLSEXT)
-#define QT_ALPN
+const bool clearTextHTTP2 = false;
+#else
+const bool clearTextHTTP2 = true;
#endif
QT_BEGIN_NAMESPACE
@@ -139,9 +141,6 @@ tst_Http2::~tst_Http2()
void tst_Http2::singleRequest()
{
-#ifndef QT_ALPN
- QSKIP("This test requires ALPN support");
-#endif
clearHTTP2State();
serverPort = 0;
@@ -154,7 +153,9 @@ void tst_Http2::singleRequest()
QVERIFY(serverPort != 0);
- const QUrl url(QString("https://127.0.0.1:%1/index.html").arg(serverPort));
+ const QString urlAsString(clearTextHTTP2 ? QString("http://127.0.0.1:%1/index.html")
+ : QString("https://127.0.0.1:%1/index.html"));
+ const QUrl url(urlAsString.arg(serverPort));
QNetworkRequest request(url);
request.setAttribute(QNetworkRequest::HTTP2AllowedAttribute, QVariant(true));
@@ -179,9 +180,6 @@ void tst_Http2::singleRequest()
void tst_Http2::multipleRequests()
{
-#ifndef QT_ALPN
- QSKIP("This test requires ALPN support");
-#endif
clearHTTP2State();
serverPort = 0;
@@ -216,16 +214,12 @@ void tst_Http2::multipleRequests()
void tst_Http2::flowControlClientSide()
{
-#ifndef QT_ALPN
- QSKIP("This test requires ALPN support");
-#endif
// Create a server but impose limits:
// 1. Small MAX frame size, so we test CONTINUATION frames.
// 2. Small client windows so server responses cause client streams
// to suspend and server sends WINDOW_UPDATE frames.
// 3. Few concurrent streams, to test protocol handler can resume
// suspended requests.
-
using namespace Http2;
clearHTTP2State();
@@ -238,7 +232,7 @@ void tst_Http2::flowControlClientSide()
auto srv = newServer(serverSettings);
- const QByteArray respond(int(Http2::defaultSessionWindowSize * 100), 'x');
+ const QByteArray respond(int(Http2::defaultSessionWindowSize * 50), 'x');
srv->setResponseBody(respond);
QMetaObject::invokeMethod(srv, "startServer", Qt::QueuedConnection);
@@ -249,7 +243,7 @@ void tst_Http2::flowControlClientSide()
for (int i = 0; i < nRequests; ++i)
sendRequest(i);
- runEventLoop(10000);
+ runEventLoop(120000);
QVERIFY(nRequests == 0);
QVERIFY(prefaceOK);
@@ -261,9 +255,6 @@ void tst_Http2::flowControlClientSide()
void tst_Http2::flowControlServerSide()
{
-#ifndef QT_ALPN
- QSKIP("This test requires ALPN support");
-#endif
// Quite aggressive test:
// low MAX_FRAME_SIZE forces a lot of small DATA frames,
// payload size exceedes stream/session RECV window sizes
@@ -281,7 +272,7 @@ void tst_Http2::flowControlServerSide()
auto srv = newServer(serverSettings);
- const QByteArray payload(int(Http2::defaultSessionWindowSize * 1000), 'x');
+ const QByteArray payload(int(Http2::defaultSessionWindowSize * 500), 'x');
QMetaObject::invokeMethod(srv, "startServer", Qt::QueuedConnection);
@@ -333,7 +324,7 @@ Http2Server *tst_Http2::newServer(const Http2Settings &serverSettings)
// Client's settings are fixed by qhttp2protocolhandler.
const Http2Settings clientSettings = {{Settings::MAX_FRAME_SIZE_ID, quint32(Http2::maxFrameSize)},
{Settings::ENABLE_PUSH_ID, quint32(0)}};
- auto srv = new Http2Server(serverSettings, clientSettings);
+ auto srv = new Http2Server(clearTextHTTP2, serverSettings, clientSettings);
using Srv = Http2Server;
using Cl = tst_Http2;
@@ -357,7 +348,8 @@ void tst_Http2::sendRequest(int streamNumber,
QNetworkRequest::Priority priority,
const QByteArray &payload)
{
- static const QString urlAsString("https://127.0.0.1:%1/stream%2.html");
+ static const QString urlAsString(clearTextHTTP2 ? "http://127.0.0.1:%1/stream%2.html"
+ : "https://127.0.0.1:%1/stream%2.html");
const QUrl url(urlAsString.arg(serverPort).arg(streamNumber));
QNetworkRequest request(url);
diff --git a/tests/auto/network/access/qftp/qftp.pro b/tests/auto/network/access/qftp/qftp.pro
index 6f1a4a7543..1959c1acac 100644
--- a/tests/auto/network/access/qftp/qftp.pro
+++ b/tests/auto/network/access/qftp/qftp.pro
@@ -2,5 +2,5 @@ CONFIG += testcase
TARGET = tst_qftp
SOURCES += tst_qftp.cpp
-requires(contains(QT_CONFIG,private_tests))
+requires(qtConfig(private_tests))
QT = core network network-private testlib
diff --git a/tests/auto/network/access/qhttpnetworkconnection/qhttpnetworkconnection.pro b/tests/auto/network/access/qhttpnetworkconnection/qhttpnetworkconnection.pro
index bd20fd33dd..d32b651b86 100644
--- a/tests/auto/network/access/qhttpnetworkconnection/qhttpnetworkconnection.pro
+++ b/tests/auto/network/access/qhttpnetworkconnection/qhttpnetworkconnection.pro
@@ -1,6 +1,6 @@
CONFIG += testcase
TARGET = tst_qhttpnetworkconnection
SOURCES += tst_qhttpnetworkconnection.cpp
-requires(contains(QT_CONFIG,private_tests))
+requires(qtConfig(private_tests))
QT = core-private network-private testlib
diff --git a/tests/auto/network/access/qhttpnetworkreply/qhttpnetworkreply.pro b/tests/auto/network/access/qhttpnetworkreply/qhttpnetworkreply.pro
index 1810a38f6e..31570e6f01 100644
--- a/tests/auto/network/access/qhttpnetworkreply/qhttpnetworkreply.pro
+++ b/tests/auto/network/access/qhttpnetworkreply/qhttpnetworkreply.pro
@@ -1,6 +1,6 @@
CONFIG += testcase
TARGET = tst_qhttpnetworkreply
SOURCES += tst_qhttpnetworkreply.cpp
-requires(contains(QT_CONFIG,private_tests))
+requires(qtConfig(private_tests))
QT = core-private network-private testlib
diff --git a/tests/auto/network/access/qnetworkreply/test/test.pro b/tests/auto/network/access/qnetworkreply/test/test.pro
index 772bb55990..47e7f5ed15 100644
--- a/tests/auto/network/access/qnetworkreply/test/test.pro
+++ b/tests/auto/network/access/qnetworkreply/test/test.pro
@@ -10,7 +10,7 @@ RESOURCES += ../qnetworkreply.qrc
TESTDATA += ../empty ../rfc3252.txt ../resource ../bigfile ../*.jpg ../certs \
../index.html ../smb-file.txt
-contains(QT_CONFIG,xcb): CONFIG+=insignificant_test # unstable, QTBUG-21102
+qtConfig(xcb): CONFIG+=insignificant_test # unstable, QTBUG-21102
win32:CONFIG += insignificant_test # QTBUG-24226
!winrt: TEST_HELPER_INSTALLS = ../echo/echo
diff --git a/tests/auto/network/kernel/kernel.pro b/tests/auto/network/kernel/kernel.pro
index 6c3a234de5..42df80dfa1 100644
--- a/tests/auto/network/kernel/kernel.pro
+++ b/tests/auto/network/kernel/kernel.pro
@@ -18,7 +18,7 @@ winrt: SUBDIRS -= \
osx: SUBDIRS -= \ # QTBUG-41847
qhostinfo \
-!contains(QT_CONFIG, private_tests): SUBDIRS -= \
+!qtConfig(private_tests): SUBDIRS -= \
qauthenticator \
qhostinfo \
diff --git a/tests/auto/network/kernel/qauthenticator/qauthenticator.pro b/tests/auto/network/kernel/qauthenticator/qauthenticator.pro
index 5e4759b690..5038eea9af 100644
--- a/tests/auto/network/kernel/qauthenticator/qauthenticator.pro
+++ b/tests/auto/network/kernel/qauthenticator/qauthenticator.pro
@@ -1,6 +1,6 @@
CONFIG += testcase
TARGET = tst_qauthenticator
-requires(contains(QT_CONFIG,private_tests))
+requires(qtConfig(private_tests))
QT = core network-private testlib
SOURCES += tst_qauthenticator.cpp
DEFINES += SRCDIR=\\\"$$PWD/\\\"
diff --git a/tests/auto/network/kernel/qhostinfo/qhostinfo.pro b/tests/auto/network/kernel/qhostinfo/qhostinfo.pro
index 4ea415c529..67a37faeb5 100644
--- a/tests/auto/network/kernel/qhostinfo/qhostinfo.pro
+++ b/tests/auto/network/kernel/qhostinfo/qhostinfo.pro
@@ -3,7 +3,7 @@ TARGET = tst_qhostinfo
SOURCES += tst_qhostinfo.cpp
-requires(contains(QT_CONFIG,private_tests))
+requires(qtConfig(private_tests))
QT = core-private network-private testlib
win32:LIBS += -lws2_32
diff --git a/tests/auto/network/socket/platformsocketengine/platformsocketengine.pri b/tests/auto/network/socket/platformsocketengine/platformsocketengine.pri
index 6c7857ea1d..46c722deba 100644
--- a/tests/auto/network/socket/platformsocketengine/platformsocketengine.pri
+++ b/tests/auto/network/socket/platformsocketengine/platformsocketengine.pri
@@ -6,7 +6,7 @@ INCLUDEPATH += $$QNETWORK_SRC
win32:LIBS += -lws2_32
-unix:contains(QT_CONFIG, reduce_exports) {
+unix:qtConfig(reduce_exports) {
SOURCES += $$QNETWORK_SRC/socket/qnativesocketengine_unix.cpp
SOURCES += $$QNETWORK_SRC/socket/qnativesocketengine.cpp
SOURCES += $$QNETWORK_SRC/socket/qabstractsocketengine.cpp
diff --git a/tests/auto/network/socket/platformsocketengine/platformsocketengine.pro b/tests/auto/network/socket/platformsocketengine/platformsocketengine.pro
index eee762037d..ab96bb444e 100644
--- a/tests/auto/network/socket/platformsocketengine/platformsocketengine.pro
+++ b/tests/auto/network/socket/platformsocketengine/platformsocketengine.pro
@@ -4,7 +4,7 @@ SOURCES += tst_platformsocketengine.cpp
include(../platformsocketengine/platformsocketengine.pri)
-requires(contains(QT_CONFIG,private_tests))
+requires(qtConfig(private_tests))
MOC_DIR=tmp
diff --git a/tests/auto/network/socket/platformsocketengine/tst_platformsocketengine.cpp b/tests/auto/network/socket/platformsocketengine/tst_platformsocketengine.cpp
index bc9d3cc9bf..43b5422635 100644
--- a/tests/auto/network/socket/platformsocketengine/tst_platformsocketengine.cpp
+++ b/tests/auto/network/socket/platformsocketengine/tst_platformsocketengine.cpp
@@ -111,6 +111,7 @@ void tst_PlatformSocketEngine::construction()
QCOMPARE(socketDevice.peerAddress(), QHostAddress());
QCOMPARE(socketDevice.peerPort(), quint16(0));
QCOMPARE(socketDevice.error(), QAbstractSocket::UnknownSocketError);
+ QCOMPARE(socketDevice.option(QNativeSocketEngine::NonBlockingSocketOption), -1);
QTest::ignoreMessage(QtWarningMsg, PLATFORMSOCKETENGINESTRING "::bytesAvailable() was called in QAbstractSocket::UnconnectedState");
QCOMPARE(socketDevice.bytesAvailable(), -1);
diff --git a/tests/auto/network/socket/qhttpsocketengine/qhttpsocketengine.pro b/tests/auto/network/socket/qhttpsocketengine/qhttpsocketengine.pro
index 12ce576e23..56a4fb8aee 100644
--- a/tests/auto/network/socket/qhttpsocketengine/qhttpsocketengine.pro
+++ b/tests/auto/network/socket/qhttpsocketengine/qhttpsocketengine.pro
@@ -7,6 +7,6 @@ include(../platformsocketengine/platformsocketengine.pri)
MOC_DIR=tmp
-requires(contains(QT_CONFIG,private_tests))
+requires(qtConfig(private_tests))
QT = core-private network-private testlib
diff --git a/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp b/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp
index 00e01094a4..8cc06a77ba 100644
--- a/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp
+++ b/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp
@@ -181,6 +181,7 @@ private slots:
void slotConnected()
{
QCOMPARE(state(), QLocalSocket::ConnectedState);
+ QVERIFY(isOpen());
}
void slotDisconnected()
{
diff --git a/tests/auto/network/socket/qsocks5socketengine/qsocks5socketengine.pro b/tests/auto/network/socket/qsocks5socketengine/qsocks5socketengine.pro
index f3c24e19fd..71ceafa133 100644
--- a/tests/auto/network/socket/qsocks5socketengine/qsocks5socketengine.pro
+++ b/tests/auto/network/socket/qsocks5socketengine/qsocks5socketengine.pro
@@ -10,4 +10,4 @@ MOC_DIR=tmp
QT = core-private network-private testlib
-requires(contains(QT_CONFIG,private_tests))
+requires(qtConfig(private_tests))
diff --git a/tests/auto/network/socket/qtcpsocket/qtcpsocket.pro b/tests/auto/network/socket/qtcpsocket/qtcpsocket.pro
index 5686f4a697..1183b23556 100644
--- a/tests/auto/network/socket/qtcpsocket/qtcpsocket.pro
+++ b/tests/auto/network/socket/qtcpsocket/qtcpsocket.pro
@@ -3,4 +3,4 @@ TEMPLATE = subdirs
SUBDIRS = test
!vxworks: SUBDIRS += stressTest
-requires(contains(QT_CONFIG,private_tests))
+requires(qtConfig(private_tests))
diff --git a/tests/auto/network/socket/socket.pro b/tests/auto/network/socket/socket.pro
index 75f9e3f3a0..307f7e92de 100644
--- a/tests/auto/network/socket/socket.pro
+++ b/tests/auto/network/socket/socket.pro
@@ -10,13 +10,13 @@ SUBDIRS=\
platformsocketengine \
qsctpsocket \
-!contains(QT_CONFIG, private_tests): SUBDIRS -= \
+!qtConfig(private_tests): SUBDIRS -= \
platformsocketengine \
qtcpsocket \
qhttpsocketengine \
qsocks5socketengine \
-!contains(QT_CONFIG, sctp): SUBDIRS -= \
+!qtConfig(sctp): SUBDIRS -= \
qsctpsocket \
winrt: SUBDIRS -= \
diff --git a/tests/auto/network/ssl/qssldiffiehellmanparameters/tst_qssldiffiehellmanparameters.cpp b/tests/auto/network/ssl/qssldiffiehellmanparameters/tst_qssldiffiehellmanparameters.cpp
index 32cc982a65..f3b9003fbb 100644
--- a/tests/auto/network/ssl/qssldiffiehellmanparameters/tst_qssldiffiehellmanparameters.cpp
+++ b/tests/auto/network/ssl/qssldiffiehellmanparameters/tst_qssldiffiehellmanparameters.cpp
@@ -81,7 +81,7 @@ void tst_QSslDiffieHellmanParameters::constructionDefault()
void tst_QSslDiffieHellmanParameters::constructionDER()
{
// Uniquely generated with 'openssl dhparam -outform DER -out out.der -check -2 4096'
- QSslDiffieHellmanParameters dh(QByteArray::fromBase64(QByteArrayLiteral(
+ const auto dh = QSslDiffieHellmanParameters::fromEncoded(QByteArray::fromBase64(QByteArrayLiteral(
"MIICCAKCAgEAsbQYx57ZlyEyWF8jD5WYEswGR2aTVFsHqP3026SdyTwcjY+YlMOae0EagK"
"jDA0UlPcih1kguQOvOVgyc5gI3YbBb4pCNEdy048xITlsdqG7qC3+2VvFR3vfixEbQQll9"
"2cGIIneD/36p7KJcDnBNUwwWj/VJKhTwelTfKTj2T39si9xGMkqZiQuCaXRk6vSKZ4ZDPk"
@@ -103,7 +103,7 @@ void tst_QSslDiffieHellmanParameters::constructionDER()
void tst_QSslDiffieHellmanParameters::constructionPEM()
{
// Uniquely generated with 'openssl dhparam -outform PEM -out out.pem -check -2 4096'
- QSslDiffieHellmanParameters dh(QByteArrayLiteral(
+ const auto dh = QSslDiffieHellmanParameters::fromEncoded(QByteArrayLiteral(
"-----BEGIN DH PARAMETERS-----\n"
"MIICCAKCAgEA9QTdqhQkbGuhWzBsW5X475AjjrITpg1BHX5+mp1sstUd84Lshq1T\n"
"+S2QQQtdl25EPoUblpyyLAf8krFSH4YwR7jjLWklA8paDOwRYod0zLmVZ1Wx6og3\n"
@@ -128,7 +128,7 @@ void tst_QSslDiffieHellmanParameters::constructionPEM()
void tst_QSslDiffieHellmanParameters::unsafe512Bits()
{
// Uniquely generated with 'openssl dhparam -outform PEM -out out.pem -check -2 512'
- QSslDiffieHellmanParameters dh(QByteArrayLiteral(
+ const auto dh = QSslDiffieHellmanParameters::fromEncoded(QByteArrayLiteral(
"-----BEGIN DH PARAMETERS-----\n"
"MEYCQQCf8goDn56akiliAtEL1ZG7VH+9wfLxsv8/B1emTUG+rMKB1yaVAU7HaAiM\n"
"Gtmo2bAWUqBczUTOTzqmWTm28P6bAgEC\n"
@@ -145,7 +145,7 @@ void tst_QSslDiffieHellmanParameters::unsafeNonPrime()
{
// Uniquely generated with 'openssl dhparam -outform DER -out out.der -check -2 1024'
// and then modified by hand to make P not be a prime number.
- QSslDiffieHellmanParameters dh(QByteArray::fromBase64(QByteArrayLiteral(
+ const auto dh = QSslDiffieHellmanParameters::fromEncoded(QByteArray::fromBase64(QByteArrayLiteral(
"MIGHAoGBALLcOLg+ow8TMnbCUeNjwys6wUTIH9mn4ZSeIbD6qvCsJgg4cUxXwJQmPY"
"Xl15AsKXgkXWh0n+/N6tjH0sSRJnzDvN2H3KxFLKkvxmBYrDOJMdCuMgZD50aOsVyd"
"vholAW9zilkoYkB6sqwxY1Z2dbpTWajCsUAWZQ0AIP4Y5nesAgEC"
diff --git a/tests/auto/network/ssl/qsslkey/qsslkey.pro b/tests/auto/network/ssl/qsslkey/qsslkey.pro
index 52377a9005..8c3877631a 100644
--- a/tests/auto/network/ssl/qsslkey/qsslkey.pro
+++ b/tests/auto/network/ssl/qsslkey/qsslkey.pro
@@ -3,7 +3,7 @@ CONFIG += testcase
SOURCES += tst_qsslkey.cpp
win32:LIBS += -lws2_32
QT = core network testlib
-contains(QT_CONFIG, private_tests) {
+qtConfig(private_tests) {
QT += core-private network-private
}
diff --git a/tests/auto/network/ssl/qsslsocket/qsslsocket.pro b/tests/auto/network/ssl/qsslsocket/qsslsocket.pro
index 9a525408fd..5c92ca833a 100644
--- a/tests/auto/network/ssl/qsslsocket/qsslsocket.pro
+++ b/tests/auto/network/ssl/qsslsocket/qsslsocket.pro
@@ -15,11 +15,11 @@ win32 {
}
# OpenSSL support
-contains(QT_CONFIG, openssl) | contains(QT_CONFIG, openssl-linked) {
+qtConfig(openssl)|qtConfig(openssl-linked) {
# Add optional SSL libs
LIBS += $$OPENSSL_LIBS
}
DEFINES += SRCDIR=\\\"$$PWD/\\\"
-requires(contains(QT_CONFIG,private_tests))
+requires(qtConfig(private_tests))
diff --git a/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp b/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp
index bf38a09aeb..03ddd4d6f8 100644
--- a/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp
+++ b/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp
@@ -57,7 +57,7 @@
#include "private/qsslconfiguration_p.h"
Q_DECLARE_METATYPE(QSslSocket::SslMode)
-typedef QList<QSslError::SslError> SslErrorList;
+typedef QVector<QSslError::SslError> SslErrorList;
Q_DECLARE_METATYPE(SslErrorList)
Q_DECLARE_METATYPE(QSslError)
Q_DECLARE_METATYPE(QSslKey)
@@ -386,14 +386,14 @@ void tst_QSslSocket::cleanup()
#ifndef QT_NO_SSL
QSslSocketPtr tst_QSslSocket::newSocket()
{
- QSslSocket *socket = new QSslSocket;
+ const auto socket = QSslSocketPtr::create();
proxyAuthCalled = 0;
- connect(socket, SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)),
+ connect(socket.data(), SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)),
SLOT(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)),
Qt::DirectConnection);
- return QSslSocketPtr(socket);
+ return socket;
}
#endif
@@ -633,7 +633,8 @@ void tst_QSslSocket::sslErrors()
// check the SSL errors contain HostNameMismatch and an error due to
// the certificate being self-signed
SslErrorList sslErrors;
- foreach (const QSslError &err, socket->sslErrors())
+ const auto socketSslErrors = socket->sslErrors();
+ for (const QSslError &err : socketSslErrors)
sslErrors << err.error();
qSort(sslErrors);
QVERIFY(sslErrors.contains(QSslError::HostNameMismatch));
@@ -642,7 +643,8 @@ void tst_QSslSocket::sslErrors()
// check the same errors were emitted by sslErrors
QVERIFY(!sslErrorsSpy.isEmpty());
SslErrorList emittedErrors;
- foreach (const QSslError &err, qvariant_cast<QList<QSslError> >(sslErrorsSpy.first().first()))
+ const auto sslErrorsSpyErrors = qvariant_cast<QList<QSslError> >(qAsConst(sslErrorsSpy).first().first());
+ for (const QSslError &err : sslErrorsSpyErrors)
emittedErrors << err.error();
qSort(emittedErrors);
QCOMPARE(sslErrors, emittedErrors);
@@ -651,7 +653,7 @@ void tst_QSslSocket::sslErrors()
QVERIFY(!peerVerifyErrorSpy.isEmpty());
SslErrorList peerErrors;
const QList<QVariantList> &peerVerifyList = peerVerifyErrorSpy;
- foreach (const QVariantList &args, peerVerifyList)
+ for (const QVariantList &args : peerVerifyList)
peerErrors << qvariant_cast<QSslError>(args.first()).error();
qSort(peerErrors);
QCOMPARE(sslErrors, peerErrors);
@@ -1261,8 +1263,8 @@ void tst_QSslSocket::protocolServerSide()
QEventLoop loop;
QTimer::singleShot(5000, &loop, SLOT(quit()));
- QSslSocketPtr client(new QSslSocket);
- socket = client.data();
+ QSslSocket client;
+ socket = &client;
QFETCH(QSsl::SslProtocol, clientProtocol);
socket->setProtocol(clientProtocol);
// upon SSL wrong version error, error will be triggered, not sslErrors
@@ -1270,14 +1272,14 @@ void tst_QSslSocket::protocolServerSide()
connect(socket, SIGNAL(sslErrors(QList<QSslError>)), this, SLOT(ignoreErrorSlot()));
connect(socket, SIGNAL(encrypted()), &loop, SLOT(quit()));
- client->connectToHostEncrypted(QHostAddress(QHostAddress::LocalHost).toString(), server.serverPort());
+ client.connectToHostEncrypted(QHostAddress(QHostAddress::LocalHost).toString(), server.serverPort());
loop.exec();
QFETCH(bool, works);
QAbstractSocket::SocketState expectedState = (works) ? QAbstractSocket::ConnectedState : QAbstractSocket::UnconnectedState;
- QCOMPARE(int(client->state()), int(expectedState));
- QCOMPARE(client->isEncrypted(), works);
+ QCOMPARE(int(client.state()), int(expectedState));
+ QCOMPARE(client.isEncrypted(), works);
}
#ifndef QT_NO_OPENSSL
@@ -1302,8 +1304,8 @@ void tst_QSslSocket::serverCipherPreferences()
QEventLoop loop;
QTimer::singleShot(5000, &loop, SLOT(quit()));
- QSslSocketPtr client(new QSslSocket);
- socket = client.data();
+ QSslSocket client;
+ socket = &client;
socket->setCiphers("AES256-SHA:AES128-SHA");
// upon SSL wrong version error, error will be triggered, not sslErrors
@@ -1311,12 +1313,12 @@ void tst_QSslSocket::serverCipherPreferences()
connect(socket, SIGNAL(sslErrors(QList<QSslError>)), this, SLOT(ignoreErrorSlot()));
connect(socket, SIGNAL(encrypted()), &loop, SLOT(quit()));
- client->connectToHostEncrypted(QHostAddress(QHostAddress::LocalHost).toString(), server.serverPort());
+ client.connectToHostEncrypted(QHostAddress(QHostAddress::LocalHost).toString(), server.serverPort());
loop.exec();
- QVERIFY(client->isEncrypted());
- QCOMPARE(client->sessionCipher().name(), QString("AES128-SHA"));
+ QVERIFY(client.isEncrypted());
+ QCOMPARE(client.sessionCipher().name(), QString("AES128-SHA"));
}
{
@@ -1331,8 +1333,8 @@ void tst_QSslSocket::serverCipherPreferences()
QEventLoop loop;
QTimer::singleShot(5000, &loop, SLOT(quit()));
- QSslSocketPtr client(new QSslSocket);
- socket = client.data();
+ QSslSocket client;
+ socket = &client;
socket->setCiphers("AES256-SHA:AES128-SHA");
// upon SSL wrong version error, error will be triggered, not sslErrors
@@ -1340,12 +1342,12 @@ void tst_QSslSocket::serverCipherPreferences()
connect(socket, SIGNAL(sslErrors(QList<QSslError>)), this, SLOT(ignoreErrorSlot()));
connect(socket, SIGNAL(encrypted()), &loop, SLOT(quit()));
- client->connectToHostEncrypted(QHostAddress(QHostAddress::LocalHost).toString(), server.serverPort());
+ client.connectToHostEncrypted(QHostAddress(QHostAddress::LocalHost).toString(), server.serverPort());
loop.exec();
- QVERIFY(client->isEncrypted());
- QCOMPARE(client->sessionCipher().name(), QString("AES256-SHA"));
+ QVERIFY(client.isEncrypted());
+ QCOMPARE(client.sessionCipher().name(), QString("AES256-SHA"));
}
}
@@ -1402,7 +1404,8 @@ void tst_QSslSocket::setLocalCertificateChain()
QEventLoop loop;
QTimer::singleShot(5000, &loop, SLOT(quit()));
- socket = new QSslSocket();
+ const QScopedPointer<QSslSocket, QScopedPointerDeleteLater> client(new QSslSocket);
+ socket = client.data();
connect(socket, SIGNAL(encrypted()), &loop, SLOT(quit()));
connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), &loop, SLOT(quit()));
connect(socket, SIGNAL(sslErrors(QList<QSslError>)), this, SLOT(ignoreErrorSlot()));
@@ -1414,8 +1417,6 @@ void tst_QSslSocket::setLocalCertificateChain()
QCOMPARE(chain.size(), 2);
QCOMPARE(chain[0].serialNumber(), QByteArray("10:a0:ad:77:58:f6:6e:ae:46:93:a3:43:f9:59:8a:9e"));
QCOMPARE(chain[1].serialNumber(), QByteArray("3b:eb:99:c5:ea:d8:0b:5d:0b:97:5d:4f:06:75:4b:e1"));
-
- socket->deleteLater();
}
void tst_QSslSocket::setPrivateKey()
@@ -1437,21 +1438,21 @@ void tst_QSslSocket::setSocketDescriptor()
QEventLoop loop;
QTimer::singleShot(5000, &loop, SLOT(quit()));
- QSslSocketPtr client(new QSslSocket);
- socket = client.data();;
+ QSslSocket client;
+ socket = &client;
connect(socket, SIGNAL(sslErrors(QList<QSslError>)), this, SLOT(ignoreErrorSlot()));
connect(socket, SIGNAL(encrypted()), &loop, SLOT(quit()));
- client->connectToHostEncrypted(QHostAddress(QHostAddress::LocalHost).toString(), server.serverPort());
+ client.connectToHostEncrypted(QHostAddress(QHostAddress::LocalHost).toString(), server.serverPort());
loop.exec();
- QCOMPARE(client->state(), QAbstractSocket::ConnectedState);
- QVERIFY(client->isEncrypted());
- QVERIFY(!client->peerAddress().isNull());
- QVERIFY(client->peerPort() != 0);
- QVERIFY(!client->localAddress().isNull());
- QVERIFY(client->localPort() != 0);
+ QCOMPARE(client.state(), QAbstractSocket::ConnectedState);
+ QVERIFY(client.isEncrypted());
+ QVERIFY(!client.peerAddress().isNull());
+ QVERIFY(client.peerPort() != 0);
+ QVERIFY(!client.localAddress().isNull());
+ QVERIFY(client.localPort() != 0);
}
void tst_QSslSocket::setSslConfiguration_data()
@@ -2878,16 +2879,16 @@ void tst_QSslSocket::dhServer()
QEventLoop loop;
QTimer::singleShot(5000, &loop, SLOT(quit()));
- QSslSocketPtr client(new QSslSocket);
- socket = client.data();
+ QSslSocket client;
+ socket = &client;
connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), &loop, SLOT(quit()));
connect(socket, SIGNAL(sslErrors(QList<QSslError>)), this, SLOT(ignoreErrorSlot()));
connect(socket, SIGNAL(encrypted()), &loop, SLOT(quit()));
- client->connectToHostEncrypted(QHostAddress(QHostAddress::LocalHost).toString(), server.serverPort());
+ client.connectToHostEncrypted(QHostAddress(QHostAddress::LocalHost).toString(), server.serverPort());
loop.exec();
- QCOMPARE(client->state(), QAbstractSocket::ConnectedState);
+ QCOMPARE(client.state(), QAbstractSocket::ConnectedState);
}
#ifndef QT_NO_OPENSSL
@@ -2912,17 +2913,17 @@ void tst_QSslSocket::dhServerCustomParamsNull()
QEventLoop loop;
QTimer::singleShot(5000, &loop, SLOT(quit()));
- QSslSocketPtr client(new QSslSocket);
- socket = client.data();
+ QSslSocket client;
+ socket = &client;
connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), &loop, SLOT(quit()));
connect(socket, SIGNAL(sslErrors(QList<QSslError>)), this, SLOT(ignoreErrorSlot()));
connect(socket, SIGNAL(encrypted()), &loop, SLOT(quit()));
- client->connectToHostEncrypted(QHostAddress(QHostAddress::LocalHost).toString(), server.serverPort());
+ client.connectToHostEncrypted(QHostAddress(QHostAddress::LocalHost).toString(), server.serverPort());
loop.exec();
- QVERIFY(client->state() != QAbstractSocket::ConnectedState);
+ QVERIFY(client.state() != QAbstractSocket::ConnectedState);
}
#endif // QT_NO_OPENSSL
@@ -2942,7 +2943,7 @@ void tst_QSslSocket::dhServerCustomParams()
QSslConfiguration cfg = server.config;
// Custom 2048-bit DH parameters generated with 'openssl dhparam -outform DER -out out.der -check -2 2048'
- QSslDiffieHellmanParameters dh(QByteArray::fromBase64(QByteArrayLiteral(
+ const auto dh = QSslDiffieHellmanParameters::fromEncoded(QByteArray::fromBase64(QByteArrayLiteral(
"MIIBCAKCAQEAvVA7b8keTfjFutCtTJmP/pnQfw/prKa+GMed/pBWjrC4N1YwnI8h/A861d9WE/VWY7XMTjvjX3/0"
"aaU8wEe0EXNpFdlTH+ZMQctQTSJOyQH0RCTwJfDGPCPT9L+c9GKwEKWORH38Earip986HJc0w3UbnfIwXUdsWHiXi"
"Z6r3cpyBmTKlsXTFiDVAOUXSiO8d/zOb6zHZbDfyB/VbtZRmnA7TXVn9oMzC0g9+FXHdrV4K+XfdvNZdCegvoAZiy"
@@ -2957,17 +2958,17 @@ void tst_QSslSocket::dhServerCustomParams()
QEventLoop loop;
QTimer::singleShot(5000, &loop, SLOT(quit()));
- QSslSocketPtr client(new QSslSocket);
- socket = client.data();
+ QSslSocket client;
+ socket = &client;
connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), &loop, SLOT(quit()));
connect(socket, SIGNAL(sslErrors(QList<QSslError>)), this, SLOT(ignoreErrorSlot()));
connect(socket, SIGNAL(encrypted()), &loop, SLOT(quit()));
- client->connectToHostEncrypted(QHostAddress(QHostAddress::LocalHost).toString(), server.serverPort());
+ client.connectToHostEncrypted(QHostAddress(QHostAddress::LocalHost).toString(), server.serverPort());
loop.exec();
- QVERIFY(client->state() == QAbstractSocket::ConnectedState);
+ QVERIFY(client.state() == QAbstractSocket::ConnectedState);
}
#endif // QT_NO_OPENSSL
@@ -2989,16 +2990,16 @@ void tst_QSslSocket::ecdhServer()
QEventLoop loop;
QTimer::singleShot(5000, &loop, SLOT(quit()));
- QSslSocketPtr client(new QSslSocket);
- socket = client.data();
+ QSslSocket client;
+ socket = &client;
connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), &loop, SLOT(quit()));
connect(socket, SIGNAL(sslErrors(QList<QSslError>)), this, SLOT(ignoreErrorSlot()));
connect(socket, SIGNAL(encrypted()), &loop, SLOT(quit()));
- client->connectToHostEncrypted(QHostAddress(QHostAddress::LocalHost).toString(), server.serverPort());
+ client.connectToHostEncrypted(QHostAddress(QHostAddress::LocalHost).toString(), server.serverPort());
loop.exec();
- QCOMPARE(client->state(), QAbstractSocket::ConnectedState);
+ QCOMPARE(client.state(), QAbstractSocket::ConnectedState);
}
void tst_QSslSocket::verifyClientCertificate_data()
@@ -3100,16 +3101,16 @@ void tst_QSslSocket::verifyClientCertificate()
QFETCH(QList<QSslCertificate>, clientCerts);
QFETCH(QSslKey, clientKey);
- QSslSocketPtr client(new QSslSocket);
- client->setLocalCertificateChain(clientCerts);
- client->setPrivateKey(clientKey);
- socket = client.data();
+ QSslSocket client;
+ client.setLocalCertificateChain(clientCerts);
+ client.setPrivateKey(clientKey);
+ socket = &client;
connect(socket, SIGNAL(sslErrors(QList<QSslError>)), this, SLOT(ignoreErrorSlot()));
connect(socket, SIGNAL(disconnected()), &loop, SLOT(quit()));
connect(socket, SIGNAL(encrypted()), &loop, SLOT(quit()));
- client->connectToHostEncrypted(QHostAddress(QHostAddress::LocalHost).toString(), server.serverPort());
+ client.connectToHostEncrypted(QHostAddress(QHostAddress::LocalHost).toString(), server.serverPort());
loop.exec();
@@ -3131,8 +3132,8 @@ void tst_QSslSocket::verifyClientCertificate()
}
// check client socket
- QCOMPARE(int(client->state()), int(expectedState));
- QCOMPARE(client->isEncrypted(), works);
+ QCOMPARE(int(client.state()), int(expectedState));
+ QCOMPARE(client.isEncrypted(), works);
}
void tst_QSslSocket::setEmptyDefaultConfiguration() // this test should be last, as it has some side effects
@@ -3280,7 +3281,7 @@ void tst_QSslSocket::simplePskConnect()
bool pskCipherFound = false;
const QList<QSslCipher> supportedCiphers = QSslSocket::supportedCiphers();
- foreach (const QSslCipher &cipher, supportedCiphers) {
+ for (const QSslCipher &cipher : supportedCiphers) {
if (cipher.name() == PSK_CIPHER_WITHOUT_AUTH) {
pskCipherFound = true;
break;
diff --git a/tests/auto/network/ssl/qsslsocket_onDemandCertificates_member/qsslsocket_onDemandCertificates_member.pro b/tests/auto/network/ssl/qsslsocket_onDemandCertificates_member/qsslsocket_onDemandCertificates_member.pro
index 4ea878f840..c862b3d3ae 100644
--- a/tests/auto/network/ssl/qsslsocket_onDemandCertificates_member/qsslsocket_onDemandCertificates_member.pro
+++ b/tests/auto/network/ssl/qsslsocket_onDemandCertificates_member/qsslsocket_onDemandCertificates_member.pro
@@ -17,4 +17,4 @@ win32 {
DEFINES += SRCDIR=\\\"$$PWD/\\\"
-requires(contains(QT_CONFIG,private_tests))
+requires(qtConfig(private_tests))
diff --git a/tests/auto/network/ssl/qsslsocket_onDemandCertificates_static/qsslsocket_onDemandCertificates_static.pro b/tests/auto/network/ssl/qsslsocket_onDemandCertificates_static/qsslsocket_onDemandCertificates_static.pro
index d69ea7fb3d..c27a58fcd2 100644
--- a/tests/auto/network/ssl/qsslsocket_onDemandCertificates_static/qsslsocket_onDemandCertificates_static.pro
+++ b/tests/auto/network/ssl/qsslsocket_onDemandCertificates_static/qsslsocket_onDemandCertificates_static.pro
@@ -16,4 +16,4 @@ win32 {
DEFINES += SRCDIR=\\\"$$PWD/\\\"
-requires(contains(QT_CONFIG,private_tests))
+requires(qtConfig(private_tests))
diff --git a/tests/auto/network/ssl/ssl.pro b/tests/auto/network/ssl/ssl.pro
index df7c10ed19..65e35ea4c0 100644
--- a/tests/auto/network/ssl/ssl.pro
+++ b/tests/auto/network/ssl/ssl.pro
@@ -6,8 +6,8 @@ SUBDIRS=\
qsslerror \
qsslkey \
-contains(QT_CONFIG, ssl) | contains(QT_CONFIG, openssl) | contains(QT_CONFIG, openssl-linked) {
- contains(QT_CONFIG, private_tests) {
+qtConfig(ssl)|qtConfig(openssl)|qtConfig(openssl-linked) {
+ qtConfig(private_tests) {
SUBDIRS += \
qsslsocket \
qsslsocket_onDemandCertificates_member \
@@ -19,8 +19,8 @@ winrt: SUBDIRS -= \
qsslsocket_onDemandCertificates_member \
qsslsocket_onDemandCertificates_static \
-contains(QT_CONFIG, ssl) | contains(QT_CONFIG, openssl) | contains(QT_CONFIG, openssl-linked) {
- contains(QT_CONFIG, private_tests) {
+qtConfig(ssl)|qtConfig(openssl)|qtConfig(openssl-linked) {
+ qtConfig(private_tests) {
SUBDIRS += qasn1element \
qssldiffiehellmanparameters
}
diff --git a/tests/auto/opengl/qglthreads/qglthreads.pro b/tests/auto/opengl/qglthreads/qglthreads.pro
index ab8bda741e..9aa21fb3a2 100644
--- a/tests/auto/opengl/qglthreads/qglthreads.pro
+++ b/tests/auto/opengl/qglthreads/qglthreads.pro
@@ -5,10 +5,3 @@ QT += opengl widgets testlib gui-private core-private
HEADERS += tst_qglthreads.h
SOURCES += tst_qglthreads.cpp
-
-x11 {
- LIBS += $$QMAKE_LIBS_X11
-}
-
-
-
diff --git a/tests/auto/other/compiler/compiler.pro b/tests/auto/other/compiler/compiler.pro
index 19f86582e9..5a00e53878 100644
--- a/tests/auto/other/compiler/compiler.pro
+++ b/tests/auto/other/compiler/compiler.pro
@@ -3,7 +3,7 @@ TARGET = tst_compiler
SOURCES += tst_compiler.cpp baseclass.cpp derivedclass.cpp othersource.cpp
HEADERS += baseclass.h derivedclass.h
QT = core testlib
-contains(QT_CONFIG, c++11): CONFIG += c++11
-contains(QT_CONFIG, c++14): CONFIG += c++14
+qtConfig(c++11): CONFIG += c++11
+qtConfig(c++14): CONFIG += c++14
diff --git a/tests/auto/other/other.pro b/tests/auto/other/other.pro
index 3b264e6b72..94b5847b2e 100644
--- a/tests/auto/other/other.pro
+++ b/tests/auto/other/other.pro
@@ -51,9 +51,9 @@ cross_compile: SUBDIRS -= \
atwrapper \
compiler
-!contains(QT_CONFIG, accessibility): SUBDIRS -= qaccessibility
+!qtConfig(accessibility): SUBDIRS -= qaccessibility
-!contains(QT_CONFIG, accessibility-atspi-bridge): SUBDIRS -= qaccessibilitylinux
+!qtConfig(accessibility-atspi-bridge): SUBDIRS -= qaccessibilitylinux
!mac: SUBDIRS -= \
macgui \
diff --git a/tests/auto/other/qaccessibility/qaccessibility.pro b/tests/auto/other/qaccessibility/qaccessibility.pro
index f697aee38f..fb9de6f450 100644
--- a/tests/auto/other/qaccessibility/qaccessibility.pro
+++ b/tests/auto/other/qaccessibility/qaccessibility.pro
@@ -1,6 +1,6 @@
CONFIG += testcase
TARGET = tst_qaccessibility
-requires(contains(QT_CONFIG,accessibility))
+requires(qtConfig(accessibility))
QT += testlib core-private gui-private widgets-private
SOURCES += tst_qaccessibility.cpp
HEADERS += accessiblewidgets.h
diff --git a/tests/auto/tools/moc/tst_moc.cpp b/tests/auto/tools/moc/tst_moc.cpp
index dc28422294..714ae19a10 100644
--- a/tests/auto/tools/moc/tst_moc.cpp
+++ b/tests/auto/tools/moc/tst_moc.cpp
@@ -78,6 +78,73 @@ const char *string_hash_hash = STRING_HASH_HASH("baz");
Q_DECLARE_METATYPE(const QMetaObject*);
+namespace TestNonQNamespace {
+
+struct TestGadget {
+ Q_GADGET
+ Q_CLASSINFO("key", "value")
+public:
+ enum class TestGEnum1 {
+ Key1 = 11,
+ Key2
+ };
+ Q_ENUM(TestGEnum1)
+
+ enum class TestGEnum2 {
+ Key1 = 17,
+ Key2
+ };
+ Q_ENUM(TestGEnum2)
+};
+
+}
+
+namespace TestQNamespace {
+ Q_NAMESPACE
+ enum class TestEnum1 {
+ Key1 = 11,
+ Key2
+ };
+ Q_ENUM_NS(TestEnum1)
+
+ enum class TestEnum2 {
+ Key1 = 17,
+ Key2
+ };
+ Q_ENUM_NS(TestEnum2)
+
+ // try to dizzy moc by adding a struct in between
+ struct TestGadget {
+ Q_GADGET
+ public:
+ enum class TestGEnum1 {
+ Key1 = 13,
+ Key2
+ };
+ enum class TestGEnum2 {
+ Key1 = 23,
+ Key2
+ };
+ Q_ENUM(TestGEnum1)
+ Q_ENUM(TestGEnum2)
+ };
+
+ enum class TestFlag1 {
+ None = 0,
+ Flag1 = 1,
+ Flag2 = 2,
+ Any = Flag1 | Flag2
+ };
+ Q_FLAG_NS(TestFlag1)
+
+ enum class TestFlag2 {
+ None = 0,
+ Flag1 = 4,
+ Flag2 = 8,
+ Any = Flag1 | Flag2
+ };
+ Q_FLAG_NS(TestFlag2)
+}
QT_USE_NAMESPACE
@@ -627,6 +694,7 @@ private slots:
void gadgetHierarchy();
void optionsFileError_data();
void optionsFileError();
+ void testQNamespace();
signals:
void sigWithUnsignedArg(unsigned foo);
@@ -2007,6 +2075,13 @@ void tst_Moc::warnings_data()
<< QString()
<< QString("standard input:5: Error: Class declaration lacks Q_OBJECT macro.");
+ QTest::newRow("Namespace declaration lacks Q_NAMESPACE macro.")
+ << QByteArray("namespace X {\nQ_CLASSINFO(\"key\",\"value\")\nenum class MyEnum {Key1 = 1}\nQ_ENUMS(MyEnum)\n}\n")
+ << QStringList()
+ << 1
+ << QString()
+ << QString("standard input:1: Error: Namespace declaration lacks Q_NAMESPACE macro.");
+
QTest::newRow("Invalid macro definition")
<< QByteArray("#define Foo(a, b, c) a b c #a #b #c a##b##c #d\n Foo(45, 42, 39);")
<< QStringList()
@@ -3637,6 +3712,41 @@ void tst_Moc::optionsFileError()
#endif
}
+static void checkEnum(const QMetaEnum &enumerator, const QByteArray &name, const QVector<QPair<QByteArray, int >> &keys)
+{
+ QCOMPARE(name, QByteArray{enumerator.name()});
+ QCOMPARE(keys.size(), enumerator.keyCount());
+ for (int i = 0; i < enumerator.keyCount(); ++i) {
+ QCOMPARE(keys[i].first, QByteArray{enumerator.key(i)});
+ QCOMPARE(keys[i].second, enumerator.value(i));
+ }
+}
+
+void tst_Moc::testQNamespace()
+{
+ QCOMPARE(TestQNamespace::staticMetaObject.enumeratorCount(), 4);
+ checkEnum(TestQNamespace::staticMetaObject.enumerator(0), "TestEnum1",
+ {{"Key1", 11}, {"Key2", 12}});
+ checkEnum(TestQNamespace::staticMetaObject.enumerator(1), "TestEnum2",
+ {{"Key1", 17}, {"Key2", 18}});
+ checkEnum(TestQNamespace::staticMetaObject.enumerator(2), "TestFlag1",
+ {{"None", 0}, {"Flag1", 1}, {"Flag2", 2}, {"Any", 1 | 2}});
+ checkEnum(TestQNamespace::staticMetaObject.enumerator(3), "TestFlag2",
+ {{"None", 0}, {"Flag1", 4}, {"Flag2", 8}, {"Any", 4 | 8}});
+
+ QCOMPARE(TestQNamespace::TestGadget::staticMetaObject.enumeratorCount(), 2);
+ checkEnum(TestQNamespace::TestGadget::staticMetaObject.enumerator(0), "TestGEnum1",
+ {{"Key1", 13}, {"Key2", 14}});
+ checkEnum(TestQNamespace::TestGadget::staticMetaObject.enumerator(1), "TestGEnum2",
+ {{"Key1", 23}, {"Key2", 24}});
+
+ QMetaEnum meta = QMetaEnum::fromType<TestQNamespace::TestEnum1>();
+ QVERIFY(meta.isValid());
+ QCOMPARE(meta.name(), "TestEnum1");
+ QCOMPARE(meta.enclosingMetaObject(), &TestQNamespace::staticMetaObject);
+ QCOMPARE(meta.keyCount(), 2);
+}
+
QTEST_MAIN(tst_Moc)
// the generated code must compile with QT_NO_KEYWORDS
diff --git a/tests/auto/tools/qmakelib/evaltest.cpp b/tests/auto/tools/qmakelib/evaltest.cpp
index 21c1759b08..1cd5c71531 100644
--- a/tests/auto/tools/qmakelib/evaltest.cpp
+++ b/tests/auto/tools/qmakelib/evaltest.cpp
@@ -1326,9 +1326,9 @@ void tst_qmakelib::addReplaceFunctions(const QString &qindir)
<< true;
QTest::newRow("$$system(): bad number of arguments")
- << "VAR = $$system(1, 2, 3)"
+ << "VAR = $$system(1, 2, 3, 4)"
<< "VAR ="
- << "##:1: system(execute) requires one or two arguments."
+ << "##:1: system(command, [mode], [stsvar]) requires one to three arguments."
<< true;
QTest::newRow("$$unique()")
@@ -2346,12 +2346,18 @@ void tst_qmakelib::addTestFunctions(const QString &qindir)
<< "Project WARNING: World, be warned!"
<< true;
- QTest::newRow("error()")
+ QTest::newRow("error(message)")
<< "error('World, you FAIL!'): OK = 1\nOKE = 1"
<< "OK = UNDEF\nOKE = UNDEF"
<< "Project ERROR: World, you FAIL!"
<< false;
+ QTest::newRow("error(empty)")
+ << "error(): OK = 1\nOKE = 1"
+ << "OK = UNDEF\nOKE = UNDEF"
+ << ""
+ << false;
+
QTest::newRow("if(error())")
<< "if(error(\\'World, you FAIL!\\')): OK = 1\nOKE = 1"
<< "OK = UNDEF\nOKE = UNDEF"
diff --git a/tests/auto/tools/uic/baseline/imagedialog.ui.h b/tests/auto/tools/uic/baseline/imagedialog.ui.h
index c02c40c2c1..99e853b7a8 100644
--- a/tests/auto/tools/uic/baseline/imagedialog.ui.h
+++ b/tests/auto/tools/uic/baseline/imagedialog.ui.h
@@ -155,7 +155,7 @@ public:
vboxLayout->addLayout(gridLayout);
- spacerItem = new QSpacerItem(QSizePolicy::Minimum, QSizePolicy::Expanding);
+ spacerItem = new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding);
vboxLayout->addItem(spacerItem);
@@ -166,7 +166,7 @@ public:
hboxLayout->setContentsMargins(1, 1, 1, 1);
hboxLayout->setObjectName(QStringLiteral("hboxLayout"));
hboxLayout->setObjectName(QStringLiteral(""));
- spacerItem1 = new QSpacerItem(QSizePolicy::Expanding, QSizePolicy::Minimum);
+ spacerItem1 = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum);
hboxLayout->addItem(spacerItem1);
diff --git a/tests/auto/tools/uic/baseline/newdynamicpropertydialog.ui.h b/tests/auto/tools/uic/baseline/newdynamicpropertydialog.ui.h
index ca7bd253a8..3c4e0ba09e 100644
--- a/tests/auto/tools/uic/baseline/newdynamicpropertydialog.ui.h
+++ b/tests/auto/tools/uic/baseline/newdynamicpropertydialog.ui.h
@@ -91,7 +91,7 @@ public:
verticalLayout->addLayout(formLayout);
- spacerItem = new QSpacerItem(QSizePolicy::Minimum, QSizePolicy::Expanding);
+ spacerItem = new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding);
verticalLayout->addItem(spacerItem);
diff --git a/tests/auto/widgets/dialogs/dialogs.pro b/tests/auto/widgets/dialogs/dialogs.pro
index c6667824d9..cf548f2dea 100644
--- a/tests/auto/widgets/dialogs/dialogs.pro
+++ b/tests/auto/widgets/dialogs/dialogs.pro
@@ -13,7 +13,7 @@ SUBDIRS=\
qsidebar \
qwizard \
-!contains(QT_CONFIG, private_tests): SUBDIRS -= \
+!qtConfig(private_tests): SUBDIRS -= \
qsidebar \
mac:qinputdialog.CONFIG += no_check_target # QTBUG-25496
diff --git a/tests/auto/widgets/graphicsview/graphicsview.pro b/tests/auto/widgets/graphicsview/graphicsview.pro
index dce3c6dda9..e99897a4f6 100644
--- a/tests/auto/widgets/graphicsview/graphicsview.pro
+++ b/tests/auto/widgets/graphicsview/graphicsview.pro
@@ -19,7 +19,7 @@ SUBDIRS=\
qgraphicsview \
qgraphicswidget \
-!contains(QT_CONFIG, private_tests): SUBDIRS -= \
+!qtConfig(private_tests): SUBDIRS -= \
qgraphicsanchorlayout \
qgraphicsanchorlayout1 \
qgraphicsitem \
diff --git a/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp b/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
index a3aa90168a..6faeb10ce7 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
@@ -392,6 +392,7 @@ void tst_QGraphicsProxyWidget::setWidget()
QGraphicsScene scene;
QGraphicsView view(&scene);
view.show();
+ QScopedPointer<QStyle> style(QStyleFactory::create(QLatin1String("Fusion")));
QVERIFY(QTest::qWaitForWindowExposed(&view));
QPointer<SubQGraphicsProxyWidget> proxy = new SubQGraphicsProxyWidget;
SubQGraphicsProxyWidget parentProxy;
@@ -414,7 +415,7 @@ void tst_QGraphicsProxyWidget::setWidget()
#endif
widget->setPalette(QPalette(Qt::magenta));
widget->setLayoutDirection(Qt::RightToLeft);
- widget->setStyle(QStyleFactory::create(QLatin1String("Fusion")));
+ widget->setStyle(style.data());
widget->setFont(QFont("Times"));
widget->setVisible(true);
QApplication::setActiveWindow(widget);
diff --git a/tests/auto/widgets/graphicsview/qgraphicssceneindex/qgraphicssceneindex.pro b/tests/auto/widgets/graphicsview/qgraphicssceneindex/qgraphicssceneindex.pro
index 3b74ab0c75..42c260d480 100644
--- a/tests/auto/widgets/graphicsview/qgraphicssceneindex/qgraphicssceneindex.pro
+++ b/tests/auto/widgets/graphicsview/qgraphicssceneindex/qgraphicssceneindex.pro
@@ -1,6 +1,6 @@
CONFIG += testcase
TARGET = tst_qgraphicssceneindex
-requires(contains(QT_CONFIG,private_tests))
+requires(qtConfig(private_tests))
QT += widgets widgets-private testlib
QT += core-private gui-private
SOURCES += tst_qgraphicssceneindex.cpp
diff --git a/tests/auto/widgets/itemviews/itemviews.pro b/tests/auto/widgets/itemviews/itemviews.pro
index 2bd8ec43d3..af0b6aeef0 100644
--- a/tests/auto/widgets/itemviews/itemviews.pro
+++ b/tests/auto/widgets/itemviews/itemviews.pro
@@ -17,7 +17,7 @@ SUBDIRS=\
qtreewidget \
qtreewidgetitemiterator \
-!contains(QT_CONFIG, private_tests): SUBDIRS -= \
+!qtConfig(private_tests): SUBDIRS -= \
qcolumnview \
qlistwidget \
diff --git a/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp b/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp
index 1050fa2561..7412637354 100644
--- a/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp
+++ b/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp
@@ -77,108 +77,6 @@ static inline void moveCursorAway(const QWidget *topLevel)
#endif
}
-class TestView : public QAbstractItemView
-{
- Q_OBJECT
-public:
- inline void tst_dataChanged(const QModelIndex &tl, const QModelIndex &br)
- { dataChanged(tl, br); }
- inline void tst_setHorizontalStepsPerItem(int steps)
- { setHorizontalStepsPerItem(steps); }
- inline int tst_horizontalStepsPerItem() const
- { return horizontalStepsPerItem(); }
- inline void tst_setVerticalStepsPerItem(int steps)
- { setVerticalStepsPerItem(steps); }
- inline int tst_verticalStepsPerItem() const
- { return verticalStepsPerItem(); }
-
- inline void tst_rowsInserted(const QModelIndex &parent, int start, int end)
- { rowsInserted(parent, start, end); }
- inline void tst_rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end)
- { rowsAboutToBeRemoved(parent, start, end); }
- inline void tst_selectionChanged(const QItemSelection &selected,
- const QItemSelection &deselected)
- { selectionChanged(selected, deselected); }
- inline void tst_currentChanged(const QModelIndex &current, const QModelIndex &previous)
- { currentChanged(current, previous); }
- inline void tst_updateEditorData()
- { updateEditorData(); }
- inline void tst_updateEditorGeometries()
- { updateEditorGeometries(); }
- inline void tst_updateGeometries()
- { updateGeometries(); }
- inline void tst_verticalScrollbarAction(int action)
- { verticalScrollbarAction(action); }
- inline void tst_horizontalScrollbarAction(int action)
- { horizontalScrollbarAction(action); }
- inline void tst_verticalScrollbarValueChanged(int value)
- { verticalScrollbarValueChanged(value); }
- inline void tst_horizontalScrollbarValueChanged(int value)
- { horizontalScrollbarValueChanged(value); }
- inline void tst_closeEditor(QWidget *editor, QAbstractItemDelegate::EndEditHint hint)
- { closeEditor(editor, hint); }
- inline void tst_commitData(QWidget *editor)
- { commitData(editor); }
- inline void tst_editorDestroyed(QObject *editor)
- { editorDestroyed(editor); }
- enum tst_CursorAction {
- MoveUp = QAbstractItemView::MoveUp,
- MoveDown = QAbstractItemView::MoveDown,
- MoveLeft = QAbstractItemView::MoveLeft,
- MoveRight = QAbstractItemView::MoveRight,
- MoveHome = QAbstractItemView::MoveHome,
- MoveEnd = QAbstractItemView::MoveEnd,
- MovePageUp = QAbstractItemView::MovePageUp,
- MovePageDown = QAbstractItemView::MovePageDown,
- MoveNext = QAbstractItemView::MoveNext,
- MovePrevious = QAbstractItemView::MovePrevious
- };
- inline QModelIndex tst_moveCursor(tst_CursorAction cursorAction,
- Qt::KeyboardModifiers modifiers)
- { return moveCursor(QAbstractItemView::CursorAction(cursorAction), modifiers); }
- inline int tst_horizontalOffset() const
- { return horizontalOffset(); }
- inline int tst_verticalOffset() const
- { return verticalOffset(); }
- inline bool tst_isIndexHidden(const QModelIndex &index) const
- { return isIndexHidden(index); }
- inline void tst_setSelection(const QRect &rect, QItemSelectionModel::SelectionFlags command)
- { setSelection(rect, command); }
- inline QRegion tst_visualRegionForSelection(const QItemSelection &selection) const
- { return visualRegionForSelection(selection); }
- inline QModelIndexList tst_selectedIndexes() const
- { return selectedIndexes(); }
- inline bool tst_edit(const QModelIndex &index, EditTrigger trigger, QEvent *event)
- { return edit(index, trigger, event); }
- inline QItemSelectionModel::SelectionFlags tst_selectionCommand(const QModelIndex &index,
- const QEvent *event = 0) const
- { return selectionCommand(index, event); }
-#ifndef QT_NO_DRAGANDDROP
- inline void tst_startDrag(Qt::DropActions supportedActions)
- { startDrag(supportedActions); }
-#endif
- inline QStyleOptionViewItem tst_viewOptions() const
- { return viewOptions(); }
- enum tst_State {
- NoState = QAbstractItemView::NoState,
- DraggingState = QAbstractItemView::DraggingState,
- DragSelectingState = QAbstractItemView::DragSelectingState,
- EditingState = QAbstractItemView::EditingState,
- ExpandingState = QAbstractItemView::ExpandingState,
- CollapsingState = QAbstractItemView::CollapsingState
- };
- inline tst_State tst_state() const
- { return (tst_State)state(); }
- inline void tst_setState(tst_State state)
- { setState(QAbstractItemView::State(state)); }
- inline void tst_startAutoScroll()
- { startAutoScroll(); }
- inline void tst_stopAutoScroll()
- { stopAutoScroll(); }
- inline void tst_doAutoScroll()
- { doAutoScroll(); }
-};
-
class GeometriesTestView : public QTableView
{
Q_OBJECT
@@ -194,7 +92,7 @@ class tst_QAbstractItemView : public QObject
Q_OBJECT
public:
- void basic_tests(TestView *view);
+ void basic_tests(QAbstractItemView *view);
private slots:
void cleanup();
@@ -278,7 +176,7 @@ public:
void tst_QAbstractItemView::getSetCheck()
{
QListView view;
- TestView *obj1 = reinterpret_cast<TestView*>(&view);
+ QAbstractItemView *obj1 = &view;
// QAbstractItemDelegate * QAbstractItemView::itemDelegate()
// void QAbstractItemView::setItemDelegate(QAbstractItemDelegate *)
MyAbstractItemDelegate *var1 = new MyAbstractItemDelegate;
@@ -329,18 +227,18 @@ void tst_QAbstractItemView::getSetCheck()
// State QAbstractItemView::state()
// void QAbstractItemView::setState(State)
- obj1->tst_setState(TestView::tst_State(TestView::NoState));
- QCOMPARE(TestView::tst_State(TestView::NoState), obj1->tst_state());
- obj1->tst_setState(TestView::tst_State(TestView::DraggingState));
- QCOMPARE(TestView::tst_State(TestView::DraggingState), obj1->tst_state());
- obj1->tst_setState(TestView::tst_State(TestView::DragSelectingState));
- QCOMPARE(TestView::tst_State(TestView::DragSelectingState), obj1->tst_state());
- obj1->tst_setState(TestView::tst_State(TestView::EditingState));
- QCOMPARE(TestView::tst_State(TestView::EditingState), obj1->tst_state());
- obj1->tst_setState(TestView::tst_State(TestView::ExpandingState));
- QCOMPARE(TestView::tst_State(TestView::ExpandingState), obj1->tst_state());
- obj1->tst_setState(TestView::tst_State(TestView::CollapsingState));
- QCOMPARE(TestView::tst_State(TestView::CollapsingState), obj1->tst_state());
+ obj1->setState(QAbstractItemView::NoState);
+ QCOMPARE(QAbstractItemView::NoState, obj1->state());
+ obj1->setState(QAbstractItemView::DraggingState);
+ QCOMPARE(QAbstractItemView::DraggingState, obj1->state());
+ obj1->setState(QAbstractItemView::DragSelectingState);
+ QCOMPARE(QAbstractItemView::DragSelectingState, obj1->state());
+ obj1->setState(QAbstractItemView::EditingState);
+ QCOMPARE(QAbstractItemView::EditingState, obj1->state());
+ obj1->setState(QAbstractItemView::ExpandingState);
+ QCOMPARE(QAbstractItemView::ExpandingState, obj1->state());
+ obj1->setState(QAbstractItemView::CollapsingState);
+ QCOMPARE(QAbstractItemView::CollapsingState, obj1->state());
// QWidget QAbstractScrollArea::viewport()
// void setViewport(QWidget*)
@@ -394,7 +292,7 @@ void tst_QAbstractItemView::emptyModels()
QVERIFY(!view->selectionModel());
//QVERIFY(view->itemDelegate() != 0);
- basic_tests(reinterpret_cast<TestView*>(view.data()));
+ basic_tests(view.data());
}
void tst_QAbstractItemView::setModel_data()
@@ -431,10 +329,10 @@ void tst_QAbstractItemView::setModel()
QStandardItemModel model(20,20);
view->setModel(0);
view->setModel(&model);
- basic_tests(reinterpret_cast<TestView*>(view.data()));
+ basic_tests(view.data());
}
-void tst_QAbstractItemView::basic_tests(TestView *view)
+void tst_QAbstractItemView::basic_tests(QAbstractItemView *view)
{
// setSelectionModel
// Will assert as it should
@@ -559,73 +457,73 @@ void tst_QAbstractItemView::basic_tests(TestView *view)
view->setCurrentIndex(QModelIndex());
// protected methods
- view->tst_dataChanged(QModelIndex(), QModelIndex());
- view->tst_rowsInserted(QModelIndex(), -1, -1);
- view->tst_rowsAboutToBeRemoved(QModelIndex(), -1, -1);
- view->tst_selectionChanged(QItemSelection(), QItemSelection());
+ view->dataChanged(QModelIndex(), QModelIndex());
+ view->rowsInserted(QModelIndex(), -1, -1);
+ view->rowsAboutToBeRemoved(QModelIndex(), -1, -1);
+ view->selectionChanged(QItemSelection(), QItemSelection());
if (view->model()){
- view->tst_currentChanged(QModelIndex(), QModelIndex());
- view->tst_currentChanged(QModelIndex(), view->model()->index(0,0));
+ view->currentChanged(QModelIndex(), QModelIndex());
+ view->currentChanged(QModelIndex(), view->model()->index(0,0));
}
- view->tst_updateEditorData();
- view->tst_updateEditorGeometries();
- view->tst_updateGeometries();
- view->tst_verticalScrollbarAction(QAbstractSlider::SliderSingleStepAdd);
- view->tst_horizontalScrollbarAction(QAbstractSlider::SliderSingleStepAdd);
- view->tst_verticalScrollbarValueChanged(10);
- view->tst_horizontalScrollbarValueChanged(10);
- view->tst_closeEditor(0, QAbstractItemDelegate::NoHint);
- view->tst_commitData(0);
- view->tst_editorDestroyed(0);
-
- view->tst_setHorizontalStepsPerItem(2);
- view->tst_horizontalStepsPerItem();
- view->tst_setVerticalStepsPerItem(2);
- view->tst_verticalStepsPerItem();
+ view->updateEditorData();
+ view->updateEditorGeometries();
+ view->updateGeometries();
+ view->verticalScrollbarAction(QAbstractSlider::SliderSingleStepAdd);
+ view->horizontalScrollbarAction(QAbstractSlider::SliderSingleStepAdd);
+ view->verticalScrollbarValueChanged(10);
+ view->horizontalScrollbarValueChanged(10);
+ view->closeEditor(0, QAbstractItemDelegate::NoHint);
+ view->commitData(0);
+ view->editorDestroyed(0);
+
+ view->setHorizontalStepsPerItem(2);
+ view->horizontalStepsPerItem();
+ view->setVerticalStepsPerItem(2);
+ view->verticalStepsPerItem();
// Will assert as it should
// view->setIndexWidget(QModelIndex(), 0);
- view->tst_moveCursor(TestView::MoveUp, Qt::NoModifier);
- view->tst_horizontalOffset();
- view->tst_verticalOffset();
+ view->moveCursor(QAbstractItemView::MoveUp, Qt::NoModifier);
+ view->horizontalOffset();
+ view->verticalOffset();
-// view->tst_isIndexHidden(QModelIndex()); // will (correctly) assert
+// view->isIndexHidden(QModelIndex()); // will (correctly) assert
if(view->model())
- view->tst_isIndexHidden(view->model()->index(0,0));
+ view->isIndexHidden(view->model()->index(0,0));
- view->tst_setSelection(QRect(0, 0, 10, 10), QItemSelectionModel::ClearAndSelect);
- view->tst_setSelection(QRect(-1, -1, -1, -1), QItemSelectionModel::ClearAndSelect);
- view->tst_visualRegionForSelection(QItemSelection());
- view->tst_selectedIndexes();
+ view->setSelection(QRect(0, 0, 10, 10), QItemSelectionModel::ClearAndSelect);
+ view->setSelection(QRect(-1, -1, -1, -1), QItemSelectionModel::ClearAndSelect);
+ view->visualRegionForSelection(QItemSelection());
+ view->selectedIndexes();
- view->tst_edit(QModelIndex(), QAbstractItemView::NoEditTriggers, 0);
+ view->edit(QModelIndex(), QAbstractItemView::NoEditTriggers, 0);
- view->tst_selectionCommand(QModelIndex(), 0);
+ view->selectionCommand(QModelIndex(), 0);
#ifndef QT_NO_DRAGANDDROP
if (!view->model())
- view->tst_startDrag(Qt::CopyAction);
-
- view->tst_viewOptions();
-
- view->tst_setState(TestView::NoState);
- QVERIFY(view->tst_state()==TestView::NoState);
- view->tst_setState(TestView::DraggingState);
- QVERIFY(view->tst_state()==TestView::DraggingState);
- view->tst_setState(TestView::DragSelectingState);
- QVERIFY(view->tst_state()==TestView::DragSelectingState);
- view->tst_setState(TestView::EditingState);
- QVERIFY(view->tst_state()==TestView::EditingState);
- view->tst_setState(TestView::ExpandingState);
- QVERIFY(view->tst_state()==TestView::ExpandingState);
- view->tst_setState(TestView::CollapsingState);
- QVERIFY(view->tst_state()==TestView::CollapsingState);
+ view->startDrag(Qt::CopyAction);
+
+ view->viewOptions();
+
+ view->setState(QAbstractItemView::NoState);
+ QVERIFY(view->state()==QAbstractItemView::NoState);
+ view->setState(QAbstractItemView::DraggingState);
+ QVERIFY(view->state()==QAbstractItemView::DraggingState);
+ view->setState(QAbstractItemView::DragSelectingState);
+ QVERIFY(view->state()==QAbstractItemView::DragSelectingState);
+ view->setState(QAbstractItemView::EditingState);
+ QVERIFY(view->state()==QAbstractItemView::EditingState);
+ view->setState(QAbstractItemView::ExpandingState);
+ QVERIFY(view->state()==QAbstractItemView::ExpandingState);
+ view->setState(QAbstractItemView::CollapsingState);
+ QVERIFY(view->state()==QAbstractItemView::CollapsingState);
#endif
- view->tst_startAutoScroll();
- view->tst_stopAutoScroll();
- view->tst_doAutoScroll();
+ view->startAutoScroll();
+ view->stopAutoScroll();
+ view->doAutoScroll();
// testing mouseFoo and key functions
// QTest::mousePress(view, Qt::LeftButton, Qt::NoModifier, QPoint(0,0));
@@ -760,11 +658,11 @@ void tst_QAbstractItemView::selectAll()
QTableView view;
view.setModel(&model);
- TestView *tst_view = (TestView*)&view;
+ QAbstractItemView *tst_view = &view;
- QCOMPARE(tst_view->tst_selectedIndexes().count(), 0);
+ QCOMPARE(tst_view->selectedIndexes().count(), 0);
view.selectAll();
- QCOMPARE(tst_view->tst_selectedIndexes().count(), 4*4);
+ QCOMPARE(tst_view->selectedIndexes().count(), 4*4);
}
void tst_QAbstractItemView::ctrlA()
@@ -773,11 +671,11 @@ void tst_QAbstractItemView::ctrlA()
QTableView view;
view.setModel(&model);
- TestView *tst_view = (TestView*)&view;
+ QAbstractItemView *tst_view = &view;
- QCOMPARE(tst_view->tst_selectedIndexes().count(), 0);
+ QCOMPARE(tst_view->selectedIndexes().count(), 0);
QTest::keyClick(&view, Qt::Key_A, Qt::ControlModifier);
- QCOMPARE(tst_view->tst_selectedIndexes().count(), 4*4);
+ QCOMPARE(tst_view->selectedIndexes().count(), 4*4);
}
void tst_QAbstractItemView::persistentEditorFocus()
@@ -1590,9 +1488,9 @@ void tst_QAbstractItemView::testDelegateDestroyEditor()
MyAbstractItemDelegate delegate;
table.setItemDelegate(&delegate);
table.edit(table.model()->index(1, 1));
- TestView *tv = reinterpret_cast<TestView*>(&table);
+ QAbstractItemView *tv = &table;
QVERIFY(!delegate.calledVirtualDtor);
- tv->tst_closeEditor(delegate.openedEditor, QAbstractItemDelegate::NoHint);
+ tv->closeEditor(delegate.openedEditor, QAbstractItemDelegate::NoHint);
QVERIFY(delegate.calledVirtualDtor);
}
@@ -2069,11 +1967,18 @@ void tst_QAbstractItemView::QTBUG50535_update_on_new_selection_model()
{
public:
ListView()
- : m_paintEventsCount(0)
+ : m_paintEventsCount(0), m_deselectedMustBeEmpty(false), m_selectionChangedOk(true)
{
}
+ void setSelectionModel(QItemSelectionModel *model) Q_DECL_OVERRIDE
+ {
+ m_deselectedMustBeEmpty = !selectionModel() || !model || selectionModel()->model() != model->model();
+ QListView::setSelectionModel(model);
+ m_deselectedMustBeEmpty = false;
+ }
int m_paintEventsCount;
+ bool selectionChangedOk() const { return m_selectionChangedOk; }
protected:
bool viewportEvent(QEvent *event) Q_DECL_OVERRIDE
@@ -2082,6 +1987,24 @@ void tst_QAbstractItemView::QTBUG50535_update_on_new_selection_model()
++m_paintEventsCount;
return QListView::viewportEvent(event);
}
+
+ void selectionChanged(const QItemSelection &selected,
+ const QItemSelection &deselected) Q_DECL_OVERRIDE
+ {
+ if (m_deselectedMustBeEmpty && !deselected.isEmpty())
+ m_selectionChangedOk = false;
+
+ // Make sure both selections belong to the same model
+ foreach (const QModelIndex &nmi, selected.indexes()) {
+ foreach (const QModelIndex &omi, deselected.indexes()) {
+ m_selectionChangedOk = m_selectionChangedOk && (nmi.model() == omi.model());
+ }
+ }
+ QListView::selectionChanged(selected, deselected);
+ }
+ private:
+ bool m_deselectedMustBeEmpty;
+ bool m_selectionChangedOk;
};
// keep the current/selected row in the "low range", i.e. be sure it's visible, otherwise we
@@ -2092,7 +2015,7 @@ void tst_QAbstractItemView::QTBUG50535_update_on_new_selection_model()
view.selectionModel()->setCurrentIndex(model.index(1, 0), QItemSelectionModel::SelectCurrent);
view.show();
QVERIFY(QTest::qWaitForWindowExposed(&view));
-
+ QVERIFY(view.selectionChangedOk());
QItemSelectionModel selectionModel(&model);
selectionModel.setCurrentIndex(model.index(2, 0), QItemSelectionModel::Current);
@@ -2100,6 +2023,7 @@ void tst_QAbstractItemView::QTBUG50535_update_on_new_selection_model()
int oldPaintEventsCount = view.m_paintEventsCount;
view.setSelectionModel(&selectionModel);
QTRY_VERIFY(view.m_paintEventsCount > oldPaintEventsCount);
+ QVERIFY(view.selectionChangedOk());
QItemSelectionModel selectionModel2(&model);
@@ -2109,6 +2033,19 @@ void tst_QAbstractItemView::QTBUG50535_update_on_new_selection_model()
oldPaintEventsCount = view.m_paintEventsCount;
view.setSelectionModel(&selectionModel2);
QTRY_VERIFY(view.m_paintEventsCount > oldPaintEventsCount);
+ QVERIFY(view.selectionChangedOk());
+
+ // Tests QAbstractItemView::selectionChanged
+ QStandardItemModel model1;
+ for (int i = 0; i < 10; ++i)
+ model1.appendRow(new QStandardItem(QString::number(i)));
+ view.setModel(&model1);
+
+ QItemSelectionModel selectionModel1(&model1);
+ selectionModel1.select(model1.index(0, 0), QItemSelectionModel::ClearAndSelect);
+ selectionModel1.setCurrentIndex(model1.index(1, 0), QItemSelectionModel::Current);
+ view.setSelectionModel(&selectionModel1);
+ QVERIFY(view.selectionChangedOk());
}
void tst_QAbstractItemView::testSelectionModelInSyncWithView()
diff --git a/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp b/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp
index bc8b08997f..32a324b888 100644
--- a/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp
+++ b/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp
@@ -2991,6 +2991,11 @@ void tst_QHeaderView::stretchAndRestoreLastSection()
header.swapSections(1, 11);
QCOMPARE(header.sectionSize(1), someOtherSectionSize);
+ // Clear and re-add. This triggers a different code path than seColumnCount(0)
+ m.clear();
+ m.setColumnCount(3);
+ QVERIFY(header.sectionSize(2) >= biggerSizeThanAnySection);
+
// Test import/export of the original (not stretched) sectionSize.
m.setColumnCount(0);
m.setColumnCount(10);
diff --git a/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp b/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp
index 81ce1deca4..c7b7ffaf95 100644
--- a/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp
+++ b/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp
@@ -31,7 +31,7 @@
#include <QtTest/QtTest>
#include <QtGui/QtGui>
#include <QtWidgets/QtWidgets>
-#include <private/qabstractitemview_p.h>
+#include <private/qtreeview_p.h>
#ifndef QT_NO_DRAGANDDROP
Q_DECLARE_METATYPE(QAbstractItemView::DragDropMode)
@@ -57,49 +57,6 @@ static void initStandardTreeModel(QStandardItemModel *model)
model->insertRow(2, item);
}
-class tst_QTreeView;
-struct PublicView : public QTreeView
-{
- friend class tst_QTreeView;
- inline void executeDelayedItemsLayout()
- { QTreeView::executeDelayedItemsLayout(); }
-
- enum PublicCursorAction {
- MoveUp = QAbstractItemView::MoveUp,
- MoveDown = QAbstractItemView::MoveDown,
- MoveLeft = QAbstractItemView::MoveLeft,
- MoveRight = QAbstractItemView::MoveRight,
- MoveHome = QAbstractItemView::MoveHome,
- MoveEnd = QAbstractItemView::MoveEnd,
- MovePageUp = QAbstractItemView::MovePageUp,
- MovePageDown = QAbstractItemView::MovePageDown,
- MoveNext = QAbstractItemView::MoveNext,
- MovePrevious = QAbstractItemView::MovePrevious
- };
-
- // enum PublicCursorAction and moveCursor() are protected in QTreeView.
- inline QModelIndex doMoveCursor(PublicCursorAction ca, Qt::KeyboardModifiers kbm)
- { return QTreeView::moveCursor((CursorAction)ca, kbm); }
-
- inline void setSelection(const QRect &rect, QItemSelectionModel::SelectionFlags command)
- {
- QTreeView::setSelection(rect, command);
- }
- inline int state()
- {
- return QTreeView::state();
- }
-
- inline int rowHeight(QModelIndex idx) { return QTreeView::rowHeight(idx); }
- inline int indexRowSizeHint(const QModelIndex &index) const { return QTreeView::indexRowSizeHint(index); }
-
- inline QModelIndexList selectedIndexes() const { return QTreeView::selectedIndexes(); }
-
- inline QStyleOptionViewItem viewOptions() const { return QTreeView::viewOptions(); }
- inline int sizeHintForColumn(int column) const { return QTreeView::sizeHintForColumn(column); }
- QAbstractItemViewPrivate* aiv_priv() { return static_cast<QAbstractItemViewPrivate*>(d_ptr.data()); }
-};
-
// Make a widget frameless to prevent size constraints of title bars
// from interfering (Windows).
static inline void setFrameless(QWidget *w)
@@ -631,33 +588,34 @@ void tst_QTreeView::dragDropModeFromDragEnabledAndAcceptDrops_data()
QTest::addColumn<bool>("dragEnabled");
QTest::addColumn<bool>("acceptDrops");
QTest::addColumn<QAbstractItemView::DragDropMode>("dragDropMode");
- QTest::addColumn<QAbstractItemView::DragDropMode>("setBehavior");
-
- QTest::newRow("NoDragDrop -1") << false << false << QAbstractItemView::NoDragDrop << QAbstractItemView::DragDropMode(-1);
- QTest::newRow("NoDragDrop 0") << false << false << QAbstractItemView::NoDragDrop << QAbstractItemView::NoDragDrop;
- QTest::newRow("NoDragDrop 1") << false << false << QAbstractItemView::NoDragDrop << QAbstractItemView::DragOnly;
- QTest::newRow("NoDragDrop 2") << false << false << QAbstractItemView::NoDragDrop << QAbstractItemView::DropOnly;
- QTest::newRow("NoDragDrop 3") << false << false << QAbstractItemView::NoDragDrop << QAbstractItemView::DragDrop;
- QTest::newRow("NoDragDrop 4") << false << false << QAbstractItemView::NoDragDrop << QAbstractItemView::InternalMove;
- QTest::newRow("DragOnly -1") << true << false << QAbstractItemView::DragOnly << QAbstractItemView::DragDropMode(-1);
- QTest::newRow("DragOnly 0") << true << false << QAbstractItemView::DragOnly << QAbstractItemView::NoDragDrop;
- QTest::newRow("DragOnly 1") << true << false << QAbstractItemView::DragOnly << QAbstractItemView::DragOnly;
- QTest::newRow("DragOnly 2") << true << false << QAbstractItemView::DragOnly << QAbstractItemView::DropOnly;
- QTest::newRow("DragOnly 3") << true << false << QAbstractItemView::DragOnly << QAbstractItemView::DragDrop;
- QTest::newRow("DragOnly 4") << true << false << QAbstractItemView::DragOnly << QAbstractItemView::InternalMove;
- QTest::newRow("DropOnly -1") << false << true << QAbstractItemView::DropOnly << QAbstractItemView::DragDropMode(-1);
- QTest::newRow("DropOnly 0") << false << true << QAbstractItemView::DropOnly << QAbstractItemView::NoDragDrop;
- QTest::newRow("DropOnly 1") << false << true << QAbstractItemView::DropOnly << QAbstractItemView::DragOnly;
- QTest::newRow("DropOnly 2") << false << true << QAbstractItemView::DropOnly << QAbstractItemView::DropOnly;
- QTest::newRow("DropOnly 3") << false << true << QAbstractItemView::DropOnly << QAbstractItemView::DragDrop;
- QTest::newRow("DropOnly 4") << false << true << QAbstractItemView::DropOnly << QAbstractItemView::InternalMove;
- QTest::newRow("DragDrop -1") << true << true << QAbstractItemView::DragDrop << QAbstractItemView::DragDropMode(-1);
- QTest::newRow("DragDrop 0") << true << true << QAbstractItemView::DragDrop << QAbstractItemView::DragDropMode(-1);
- QTest::newRow("DragDrop 1") << true << true << QAbstractItemView::DragDrop << QAbstractItemView::NoDragDrop;
- QTest::newRow("DragDrop 2") << true << true << QAbstractItemView::DragDrop << QAbstractItemView::DragOnly;
- QTest::newRow("DragDrop 3") << true << true << QAbstractItemView::DragDrop << QAbstractItemView::DropOnly;
- QTest::newRow("DragDrop 4") << true << true << QAbstractItemView::DragDrop << QAbstractItemView::DragDrop;
- QTest::newRow("DragDrop 5") << true << true << QAbstractItemView::InternalMove << QAbstractItemView::InternalMove;
+ QTest::addColumn<bool>("setBehavior");
+ QTest::addColumn<QAbstractItemView::DragDropMode>("behavior");
+
+ QTest::newRow("NoDragDrop -1") << false << false << QAbstractItemView::NoDragDrop << false << QAbstractItemView::DragDropMode();
+ QTest::newRow("NoDragDrop 0") << false << false << QAbstractItemView::NoDragDrop << true << QAbstractItemView::NoDragDrop;
+ QTest::newRow("NoDragDrop 1") << false << false << QAbstractItemView::NoDragDrop << true << QAbstractItemView::DragOnly;
+ QTest::newRow("NoDragDrop 2") << false << false << QAbstractItemView::NoDragDrop << true << QAbstractItemView::DropOnly;
+ QTest::newRow("NoDragDrop 3") << false << false << QAbstractItemView::NoDragDrop << true << QAbstractItemView::DragDrop;
+ QTest::newRow("NoDragDrop 4") << false << false << QAbstractItemView::NoDragDrop << true << QAbstractItemView::InternalMove;
+ QTest::newRow("DragOnly -1") << true << false << QAbstractItemView::DragOnly << false << QAbstractItemView::DragDropMode();
+ QTest::newRow("DragOnly 0") << true << false << QAbstractItemView::DragOnly << true << QAbstractItemView::NoDragDrop;
+ QTest::newRow("DragOnly 1") << true << false << QAbstractItemView::DragOnly << true << QAbstractItemView::DragOnly;
+ QTest::newRow("DragOnly 2") << true << false << QAbstractItemView::DragOnly << true << QAbstractItemView::DropOnly;
+ QTest::newRow("DragOnly 3") << true << false << QAbstractItemView::DragOnly << true << QAbstractItemView::DragDrop;
+ QTest::newRow("DragOnly 4") << true << false << QAbstractItemView::DragOnly << true << QAbstractItemView::InternalMove;
+ QTest::newRow("DropOnly -1") << false << true << QAbstractItemView::DropOnly << false << QAbstractItemView::DragDropMode();
+ QTest::newRow("DropOnly 0") << false << true << QAbstractItemView::DropOnly << true << QAbstractItemView::NoDragDrop;
+ QTest::newRow("DropOnly 1") << false << true << QAbstractItemView::DropOnly << true << QAbstractItemView::DragOnly;
+ QTest::newRow("DropOnly 2") << false << true << QAbstractItemView::DropOnly << true << QAbstractItemView::DropOnly;
+ QTest::newRow("DropOnly 3") << false << true << QAbstractItemView::DropOnly << true << QAbstractItemView::DragDrop;
+ QTest::newRow("DropOnly 4") << false << true << QAbstractItemView::DropOnly << true << QAbstractItemView::InternalMove;
+ QTest::newRow("DragDrop -1") << true << true << QAbstractItemView::DragDrop << false << QAbstractItemView::DragDropMode();
+ QTest::newRow("DragDrop 0") << true << true << QAbstractItemView::DragDrop << false << QAbstractItemView::DragDropMode();
+ QTest::newRow("DragDrop 1") << true << true << QAbstractItemView::DragDrop << true << QAbstractItemView::NoDragDrop;
+ QTest::newRow("DragDrop 2") << true << true << QAbstractItemView::DragDrop << true << QAbstractItemView::DragOnly;
+ QTest::newRow("DragDrop 3") << true << true << QAbstractItemView::DragDrop << true << QAbstractItemView::DropOnly;
+ QTest::newRow("DragDrop 4") << true << true << QAbstractItemView::DragDrop << true << QAbstractItemView::DragDrop;
+ QTest::newRow("DragDrop 5") << true << true << QAbstractItemView::InternalMove << true << QAbstractItemView::InternalMove;
}
void tst_QTreeView::dragDropModeFromDragEnabledAndAcceptDrops()
@@ -665,13 +623,14 @@ void tst_QTreeView::dragDropModeFromDragEnabledAndAcceptDrops()
QFETCH(bool, acceptDrops);
QFETCH(bool, dragEnabled);
QFETCH(QAbstractItemView::DragDropMode, dragDropMode);
- QFETCH(QAbstractItemView::DragDropMode, setBehavior);
+ QFETCH(bool, setBehavior);
+ QFETCH(QAbstractItemView::DragDropMode, behavior);
QTreeView view;
QCOMPARE(view.dragDropMode(), QAbstractItemView::NoDragDrop);
- if (setBehavior != QAbstractItemView::DragDropMode(-1))
- view.setDragDropMode(setBehavior);
+ if (setBehavior)
+ view.setDragDropMode(behavior);
view.setAcceptDrops(acceptDrops);
view.setDragEnabled(dragEnabled);
@@ -1743,7 +1702,7 @@ void tst_QTreeView::moveCursor()
QFETCH(bool, scrollPerPixel);
QtTestModel model(8, 6);
- PublicView view;
+ QTreeView view;
view.setUniformRowHeights(uniformRowHeights);
view.setModel(&model);
view.setRowHidden(0, QModelIndex(), true);
@@ -1762,7 +1721,7 @@ void tst_QTreeView::moveCursor()
QCOMPARE(view.currentIndex(), expected);
//then pressing down should go to the next line
- QModelIndex actual = view.doMoveCursor(PublicView::MoveDown, Qt::NoModifier);
+ QModelIndex actual = view.moveCursor(QTreeView::MoveDown, Qt::NoModifier);
expected = model.index(2, 1, QModelIndex());
QCOMPARE(actual, expected);
@@ -1771,7 +1730,7 @@ void tst_QTreeView::moveCursor()
// PageUp was broken with uniform row heights turned on
view.setCurrentIndex(model.index(1, 0));
- actual = view.doMoveCursor(PublicView::MovePageUp, Qt::NoModifier);
+ actual = view.moveCursor(QTreeView::MovePageUp, Qt::NoModifier);
expected = model.index(0, 0, QModelIndex());
QCOMPARE(actual, expected);
@@ -1870,7 +1829,7 @@ void tst_QTreeView::setSelection()
QtTestModel model(10, 5);
model.levels = 1;
model.setDecorationsEnabled(true);
- PublicView view;
+ QTreeView view;
view.resize(400, 300);
view.show();
view.setRootIsDecorated(false);
@@ -2058,7 +2017,7 @@ void tst_QTreeView::rowsAboutToBeRemoved()
}
}
- PublicView view;
+ QTreeView view;
view.setModel(&model);
view.show();
QModelIndex index = model.index(0,0, QModelIndex());
@@ -2072,7 +2031,7 @@ void tst_QTreeView::rowsAboutToBeRemoved()
QSignalSpy spy1(&model, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)));
model.removeRows(1,1);
- QCOMPARE(view.state(), 0);
+ QCOMPARE(int(view.state()), 0);
// Should not be 5 (or any other number for that sake :)
QCOMPARE(spy1.count(), 1);
@@ -2175,7 +2134,7 @@ void tst_QTreeView::rowsAboutToBeRemoved_move()
view.resize(600,800);
view.show();
view.doItemsLayout();
- static_cast<PublicView *>(&view)->executeDelayedItemsLayout();
+ static_cast<QTreeView *>(&view)->executeDelayedItemsLayout();
parent = indexThatWantsToLiveButWillDieDieITellYou.parent();
QCOMPARE(view.isExpanded(indexThatWantsToLiveButWillDieDieITellYou), true);
QCOMPARE(parent.isValid(), true);
@@ -2283,7 +2242,7 @@ void tst_QTreeView::spanningItems()
{
QtTestModel model;
model.rows = model.cols = 10;
- PublicView view;
+ QTreeView view;
view.setModel(&model);
view.show();
@@ -2422,7 +2381,7 @@ void tst_QTreeView::selectionWithHiddenItems()
void tst_QTreeView::selectAll()
{
QStandardItemModel model(4,4);
- PublicView view2;
+ QTreeView view2;
view2.setModel(&model);
view2.setSelectionMode(QAbstractItemView::ExtendedSelection);
view2.selectAll(); // Should work with an empty model
@@ -2431,13 +2390,13 @@ void tst_QTreeView::selectAll()
for (int i = 0; i < model.rowCount(); ++i)
model.setData(model.index(i,0), QLatin1String("row ") + QString::number(i));
- PublicView view;
+ QTreeView view;
view.setModel(&model);
int selectedCount = view.selectedIndexes().count();
view.selectAll();
QCOMPARE(view.selectedIndexes().count(), selectedCount);
- PublicView view3;
+ QTreeView view3;
view3.setModel(&model);
view3.setSelectionMode(QAbstractItemView::NoSelection);
view3.selectAll();
@@ -2800,7 +2759,7 @@ void tst_QTreeView::evilModel()
{
QFETCH(bool, visible);
// init
- PublicView view;
+ QTreeView view;
EvilModel model;
view.setModel(&model);
view.setVisible(visible);
@@ -2858,7 +2817,7 @@ void tst_QTreeView::evilModel()
view.setSelection(rect, QItemSelectionModel::Select);
model.change();
- view.doMoveCursor(PublicView::MoveDown, Qt::NoModifier);
+ view.moveCursor(QTreeView::MoveDown, Qt::NoModifier);
model.change();
view.resizeColumnToContents(1);
@@ -2969,7 +2928,7 @@ void tst_QTreeView::evilModel()
void tst_QTreeView::indexRowSizeHint()
{
QStandardItemModel model(10, 1);
- PublicView view;
+ QTreeView view;
view.setModel(&model);
@@ -3015,7 +2974,7 @@ void tst_QTreeView::renderToPixmap_data()
void tst_QTreeView::renderToPixmap()
{
QFETCH(int, row);
- PublicView view;
+ QTreeView view;
QStandardItemModel model;
model.appendRow(new QStandardItem("Spanning"));
@@ -3031,7 +2990,7 @@ void tst_QTreeView::renderToPixmap()
// We select the index at row=1 for coverage.
QItemSelection sel(model.index(row,0), model.index(row,1));
QRect rect;
- view.aiv_priv()->renderToPixmap(sel.indexes(), &rect);
+ view.d_func()->renderToPixmap(sel.indexes(), &rect);
}
#endif
}
@@ -3093,7 +3052,7 @@ void tst_QTreeView::styleOptionViewItem()
bool allCollapsed;
};
- PublicView view;
+ QTreeView view;
QStandardItemModel model;
view.setModel(&model);
MyDelegate delegate;
@@ -3149,7 +3108,7 @@ void tst_QTreeView::styleOptionViewItem()
delegate.count = 0;
QItemSelection sel(model.index(0,0), model.index(0,modelColumns-1));
QRect rect;
- view.aiv_priv()->renderToPixmap(sel.indexes(), &rect);
+ view.d_func()->renderToPixmap(sel.indexes(), &rect);
if (delegate.count != visibleColumns) {
qDebug() << rect << view.rect() << view.isVisible();
}
@@ -3177,7 +3136,7 @@ void tst_QTreeView::styleOptionViewItem()
delegate.count = 0;
QItemSelection sel(model.index(0,0), model.index(0,modelColumns-1));
QRect rect;
- view.aiv_priv()->renderToPixmap(sel.indexes(), &rect);
+ view.d_func()->renderToPixmap(sel.indexes(), &rect);
if (delegate.count != visibleColumns) {
qDebug() << rect << view.rect() << view.isVisible();
}
@@ -4139,7 +4098,7 @@ void tst_QTreeView::taskQTBUG_13567_removeLastItemRegression()
// Note: define QT_BUILD_INTERNAL to run this test
void tst_QTreeView::taskQTBUG_25333_adjustViewOptionsForIndex()
{
- PublicView view;
+ QTreeView view;
QStandardItemModel model;
QStandardItem *item1 = new QStandardItem("Item1");
QStandardItem *item2 = new QStandardItem("Item2");
@@ -4165,9 +4124,9 @@ void tst_QTreeView::taskQTBUG_25333_adjustViewOptionsForIndex()
{
QStyleOptionViewItem option;
- view.aiv_priv()->adjustViewOptionsForIndex(&option, model.indexFromItem(item1));
+ view.d_func()->adjustViewOptionsForIndex(&option, model.indexFromItem(item1));
- view.aiv_priv()->adjustViewOptionsForIndex(&option, model.indexFromItem(item3));
+ view.d_func()->adjustViewOptionsForIndex(&option, model.indexFromItem(item3));
}
#endif
@@ -4273,7 +4232,7 @@ void tst_QTreeView::quickExpandCollapse()
//this unit tests makes sure the state after the animation is restored correctly
//after starting a 2nd animation while the first one was still on-going
//this tests that the stateBeforeAnimation is not set to AnimatingState
- PublicView tree;
+ QTreeView tree;
tree.setAnimated(true);
QStandardItemModel model;
QStandardItem *root = new QStandardItem("root");
@@ -4287,13 +4246,13 @@ void tst_QTreeView::quickExpandCollapse()
tree.show();
QTest::qWaitForWindowExposed(&tree);
- int initialState = tree.state();
+ const QAbstractItemView::State initialState = tree.state();
tree.expand(rootIndex);
- QCOMPARE(tree.state(), (int)PublicView::AnimatingState);
+ QCOMPARE(tree.state(), QTreeView::AnimatingState);
tree.collapse(rootIndex);
- QCOMPARE(tree.state(), (int)PublicView::AnimatingState);
+ QCOMPARE(tree.state(), QTreeView::AnimatingState);
QTest::qWait(500); //the animation lasts for 250ms max so 500 should be enough
diff --git a/tests/auto/widgets/kernel/qwidget/BLACKLIST b/tests/auto/widgets/kernel/qwidget/BLACKLIST
index 3346fb131c..6fe6bd2f67 100644
--- a/tests/auto/widgets/kernel/qwidget/BLACKLIST
+++ b/tests/auto/widgets/kernel/qwidget/BLACKLIST
@@ -3,6 +3,7 @@
ubuntu-14.04
[saveRestoreGeometry]
ubuntu-14.04
+ubuntu-16.04
[restoreVersion1Geometry]
ubuntu-14.04
osx
diff --git a/tests/auto/widgets/kernel/qwidget/qwidget.pro b/tests/auto/widgets/kernel/qwidget/qwidget.pro
index ba4e51a416..499ca65516 100644
--- a/tests/auto/widgets/kernel/qwidget/qwidget.pro
+++ b/tests/auto/widgets/kernel/qwidget/qwidget.pro
@@ -16,8 +16,4 @@ mac {
OBJECTIVE_SOURCES += tst_qwidget_mac_helpers.mm
}
-x11 {
- LIBS += $$QMAKE_LIBS_X11
-}
-
win32:!winrt: LIBS += -luser32 -lgdi32
diff --git a/tests/auto/widgets/kernel/qwidget_window/qwidget_window.pro b/tests/auto/widgets/kernel/qwidget_window/qwidget_window.pro
index 8672c363a2..a6248dfd16 100644
--- a/tests/auto/widgets/kernel/qwidget_window/qwidget_window.pro
+++ b/tests/auto/widgets/kernel/qwidget_window/qwidget_window.pro
@@ -2,8 +2,3 @@ CONFIG += testcase
TARGET = tst_qwidget_window
QT += widgets testlib core-private gui-private
SOURCES += tst_qwidget_window.cpp
-
-x11 {
- LIBS += $$QMAKE_LIBS_X11
-}
-
diff --git a/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp b/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp
index a59dd8c80e..6aaac6d135 100644
--- a/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp
+++ b/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp
@@ -332,8 +332,9 @@ void tst_QWidget_window::tst_showWithoutActivating()
else if (platformName != QStringLiteral("xcb")
&& platformName != QStringLiteral("windows")
&& platformName != QStringLiteral("ios")
- && platformName != QStringLiteral("tvos"))
- QSKIP("Qt::WA_ShowWithoutActivating is currently supported only on xcb, windows, and ios/tvos platforms.");
+ && platformName != QStringLiteral("tvos")
+ && platformName != QStringLiteral("watchos"))
+ QSKIP("Qt::WA_ShowWithoutActivating is currently supported only on xcb, windows, and ios/tvos/watchos platforms.");
QWidget w1;
w1.setAttribute(Qt::WA_ShowWithoutActivating);
diff --git a/tests/auto/widgets/styles/qstylesheetstyle/qstylesheetstyle.pro b/tests/auto/widgets/styles/qstylesheetstyle/qstylesheetstyle.pro
index c96004bd5d..7d9a8576d3 100644
--- a/tests/auto/widgets/styles/qstylesheetstyle/qstylesheetstyle.pro
+++ b/tests/auto/widgets/styles/qstylesheetstyle/qstylesheetstyle.pro
@@ -5,4 +5,4 @@ QT += widgets widgets-private gui-private testlib
SOURCES += tst_qstylesheetstyle.cpp
RESOURCES += resources.qrc
-requires(contains(QT_CONFIG,private_tests))
+requires(qtConfig(private_tests))
diff --git a/tests/auto/widgets/styles/styles.pro b/tests/auto/widgets/styles/styles.pro
index 952a659eaa..9d7464cb5b 100644
--- a/tests/auto/widgets/styles/styles.pro
+++ b/tests/auto/widgets/styles/styles.pro
@@ -5,7 +5,7 @@ SUBDIRS=\
qstyleoption \
qstylesheetstyle \
-!contains(QT_CONFIG, private_tests): SUBDIRS -= \
+!qtConfig(private_tests): SUBDIRS -= \
qstylesheetstyle \
# This test can only be run on Mac OS:
diff --git a/tests/auto/widgets/widgets/widgets.pro b/tests/auto/widgets/widgets/widgets.pro
index 0651583867..a8e8f6d865 100644
--- a/tests/auto/widgets/widgets/widgets.pro
+++ b/tests/auto/widgets/widgets/widgets.pro
@@ -48,10 +48,10 @@ SUBDIRS=\
qtoolbutton \
# The following tests depend on private API:
-!contains(QT_CONFIG, private_tests): SUBDIRS -= \
+!qtConfig(private_tests): SUBDIRS -= \
qcombobox \
qmainwindow \
qtextedit \
qtoolbar \
-contains(QT_CONFIG, opengl): SUBDIRS += qopenglwidget
+qtConfig(opengl): SUBDIRS += qopenglwidget
diff --git a/tests/benchmarks/corelib/thread/qreadwritelock/qreadwritelock.pro b/tests/benchmarks/corelib/thread/qreadwritelock/qreadwritelock.pro
new file mode 100644
index 0000000000..86102adecd
--- /dev/null
+++ b/tests/benchmarks/corelib/thread/qreadwritelock/qreadwritelock.pro
@@ -0,0 +1,6 @@
+TEMPLATE = app
+TARGET = tst_bench_qreadwritelock
+QT = core testlib
+SOURCES += tst_qreadwritelock.cpp
+CONFIG += c++14 # for std::shared_timed_mutex
+
diff --git a/tests/benchmarks/corelib/thread/qreadwritelock/tst_qreadwritelock.cpp b/tests/benchmarks/corelib/thread/qreadwritelock/tst_qreadwritelock.cpp
new file mode 100644
index 0000000000..bdec6c3a0a
--- /dev/null
+++ b/tests/benchmarks/corelib/thread/qreadwritelock/tst_qreadwritelock.cpp
@@ -0,0 +1,183 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 Olivier Goffart <ogoffart@woboq.com>
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtCore/QtCore>
+#include <QtTest/QtTest>
+#include <mutex>
+#if QT_HAS_INCLUDE(<shared_mutex>)
+#if __cplusplus > 201103L
+#include <shared_mutex>
+#endif
+#endif
+
+// Wrapers that take pointers instead of reference to have the same interface as Qt
+template <typename T>
+struct LockerWrapper : T
+{
+ LockerWrapper(typename T::mutex_type *mtx)
+ : T(*mtx)
+ {
+ }
+};
+
+int threadCount;
+
+class tst_QReadWriteLock : public QObject
+{
+ Q_OBJECT
+public:
+ tst_QReadWriteLock()
+ {
+ // at least 2 threads, even on single cpu/core machines
+ threadCount = qMax(2, QThread::idealThreadCount());
+ qDebug("thread count: %d", threadCount);
+ }
+
+private slots:
+ void uncontended_data();
+ void uncontended();
+ void readOnly_data();
+ void readOnly();
+ // void readWrite();
+};
+
+struct FunctionPtrHolder
+{
+ FunctionPtrHolder(QFunctionPointer value = nullptr)
+ : value(value)
+ {
+ }
+ QFunctionPointer value;
+};
+Q_DECLARE_METATYPE(FunctionPtrHolder)
+
+struct FakeLock
+{
+ FakeLock(volatile int *i) { *i = 0; }
+};
+
+enum { Iterations = 1000000 };
+
+template <typename Mutex, typename Locker>
+void testUncontended()
+{
+ Mutex lock;
+ QBENCHMARK {
+ for (int i = 0; i < Iterations; ++i) {
+ Locker locker(&lock);
+ }
+ }
+}
+
+void tst_QReadWriteLock::uncontended_data()
+{
+ QTest::addColumn<FunctionPtrHolder>("holder");
+
+ QTest::newRow("nothing") << FunctionPtrHolder(testUncontended<int, FakeLock>);
+ QTest::newRow("QMutex") << FunctionPtrHolder(testUncontended<QMutex, QMutexLocker>);
+ QTest::newRow("QReadWriteLock, read")
+ << FunctionPtrHolder(testUncontended<QReadWriteLock, QReadLocker>);
+ QTest::newRow("QReadWriteLock, write")
+ << FunctionPtrHolder(testUncontended<QReadWriteLock, QWriteLocker>);
+ QTest::newRow("std::mutex") << FunctionPtrHolder(
+ testUncontended<std::mutex, LockerWrapper<std::unique_lock<std::mutex>>>);
+#if defined __cpp_lib_shared_timed_mutex
+ QTest::newRow("std::shared_timed_mutex, read") << FunctionPtrHolder(
+ testUncontended<std::shared_timed_mutex,
+ LockerWrapper<std::shared_lock<std::shared_timed_mutex>>>);
+ QTest::newRow("std::shared_timed_mutex, write") << FunctionPtrHolder(
+ testUncontended<std::shared_timed_mutex,
+ LockerWrapper<std::unique_lock<std::shared_timed_mutex>>>);
+#endif
+}
+
+void tst_QReadWriteLock::uncontended()
+{
+ QFETCH(FunctionPtrHolder, holder);
+ holder.value();
+}
+
+static QHash<QString, QString> global_hash;
+
+template <typename Mutex, typename Locker>
+void testReadOnly()
+{
+ struct Thread : QThread
+ {
+ Mutex *lock;
+ void run()
+ {
+ for (int i = 0; i < Iterations; ++i) {
+ QString s = QString::number(i); // Do something outside the lock
+ Locker locker(lock);
+ global_hash.contains(s);
+ }
+ }
+ };
+ Mutex lock;
+ QVector<QThread *> threads;
+ for (int i = 0; i < threadCount; ++i) {
+ auto t = new Thread;
+ t->lock = &lock;
+ threads.append(t);
+ }
+ QBENCHMARK {
+ for (auto t : threads) {
+ t->start();
+ }
+ for (auto t : threads) {
+ t->wait();
+ }
+ }
+ qDeleteAll(threads);
+}
+
+void tst_QReadWriteLock::readOnly_data()
+{
+ QTest::addColumn<FunctionPtrHolder>("holder");
+
+ QTest::newRow("nothing") << FunctionPtrHolder(testReadOnly<int, FakeLock>);
+ QTest::newRow("QMutex") << FunctionPtrHolder(testReadOnly<QMutex, QMutexLocker>);
+ QTest::newRow("QReadWriteLock") << FunctionPtrHolder(testReadOnly<QReadWriteLock, QReadLocker>);
+ QTest::newRow("std::mutex") << FunctionPtrHolder(
+ testReadOnly<std::mutex, LockerWrapper<std::unique_lock<std::mutex>>>);
+#if defined __cpp_lib_shared_timed_mutex
+ QTest::newRow("std::shared_timed_mutex") << FunctionPtrHolder(
+ testReadOnly<std::shared_timed_mutex,
+ LockerWrapper<std::shared_lock<std::shared_timed_mutex>>>);
+#endif
+}
+
+void tst_QReadWriteLock::readOnly()
+{
+ QFETCH(FunctionPtrHolder, holder);
+ holder.value();
+}
+
+QTEST_MAIN(tst_QReadWriteLock)
+#include "tst_qreadwritelock.moc"
diff --git a/tests/benchmarks/corelib/thread/thread.pro b/tests/benchmarks/corelib/thread/thread.pro
index 4e602ceb4e..6b3009bd0c 100644
--- a/tests/benchmarks/corelib/thread/thread.pro
+++ b/tests/benchmarks/corelib/thread/thread.pro
@@ -1,6 +1,7 @@
TEMPLATE = subdirs
SUBDIRS = \
qmutex \
+ qreadwritelock \
qthreadstorage \
qthreadpool \
qwaitcondition \
diff --git a/tests/benchmarks/dbus/qdbustype/qdbustype.pro b/tests/benchmarks/dbus/qdbustype/qdbustype.pro
index 8d2f45edf8..70f803f56f 100644
--- a/tests/benchmarks/dbus/qdbustype/qdbustype.pro
+++ b/tests/benchmarks/dbus/qdbustype/qdbustype.pro
@@ -1,10 +1,9 @@
TARGET = tst_bench_qdbustype
QT -= gui
QT += core-private dbus-private testlib
-contains(QT_CONFIG, dbus-linked) {
+qtConfig(dbus-linked) {
DEFINES += QT_LINKED_LIBDBUS
- LIBS += $$QMAKE_LIBS_DBUS
- QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_DBUS
+ QMAKE_USE += dbus
} else {
SOURCES += ../../../../src/dbus/qdbus_symbols.cpp
}
diff --git a/tests/benchmarks/gui/image/qimageconversion/qimageconversion.pro b/tests/benchmarks/gui/image/qimageconversion/qimageconversion.pro
index 7da38e8e60..828f36348d 100644
--- a/tests/benchmarks/gui/image/qimageconversion/qimageconversion.pro
+++ b/tests/benchmarks/gui/image/qimageconversion/qimageconversion.pro
@@ -3,6 +3,6 @@ TARGET = tst_bench_imageConversion
QT += testlib
SOURCES += tst_qimageconversion.cpp
-contains(QT_CONFIG, gif):DEFINES += QTEST_HAVE_GIF
-contains(QT_CONFIG, jpeg):DEFINES += QTEST_HAVE_JPEG
-contains(QT_CONFIG, c++11): CONFIG += c++11
+qtConfig(gif): DEFINES += QTEST_HAVE_GIF
+qtConfig(jpeg): DEFINES += QTEST_HAVE_JPEG
+qtConfig(c++11): CONFIG += c++11
diff --git a/tests/benchmarks/gui/image/qimagereader/qimagereader.pro b/tests/benchmarks/gui/image/qimagereader/qimagereader.pro
index b60618d7ec..7de1eedbdf 100644
--- a/tests/benchmarks/gui/image/qimagereader/qimagereader.pro
+++ b/tests/benchmarks/gui/image/qimagereader/qimagereader.pro
@@ -5,6 +5,6 @@ TARGET = tst_bench_qimagereader
SOURCES += tst_qimagereader.cpp
-contains(QT_CONFIG, gif):DEFINES += QTEST_HAVE_GIF
-contains(QT_CONFIG, jpeg):DEFINES += QTEST_HAVE_JPEG
+qtConfig(gif): DEFINES += QTEST_HAVE_GIF
+qtConfig(jpeg): DEFINES += QTEST_HAVE_JPEG
QT += network
diff --git a/tests/benchmarks/gui/painting/painting.pro b/tests/benchmarks/gui/painting/painting.pro
index 0eb7fa92a7..cdcfc9b318 100644
--- a/tests/benchmarks/gui/painting/painting.pro
+++ b/tests/benchmarks/gui/painting/painting.pro
@@ -1,5 +1,6 @@
TEMPLATE = subdirs
SUBDIRS = \
+ qcolor \
qpainter \
qregion \
qtransform \
diff --git a/tests/benchmarks/gui/painting/qcolor/qcolor.pro b/tests/benchmarks/gui/painting/qcolor/qcolor.pro
new file mode 100644
index 0000000000..5ceb702323
--- /dev/null
+++ b/tests/benchmarks/gui/painting/qcolor/qcolor.pro
@@ -0,0 +1,7 @@
+QT += testlib
+QT += gui-private
+
+TEMPLATE = app
+TARGET = tst_bench_qcolor
+
+SOURCES += tst_qcolor.cpp
diff --git a/tests/benchmarks/gui/painting/qcolor/tst_qcolor.cpp b/tests/benchmarks/gui/painting/qcolor/tst_qcolor.cpp
new file mode 100644
index 0000000000..b67fa450d7
--- /dev/null
+++ b/tests/benchmarks/gui/painting/qcolor/tst_qcolor.cpp
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author David Faure <david.faure@kdab.com>
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL21$
+** 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 http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://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 2.1 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <qtest.h>
+#include <QColor>
+
+
+class tst_QColor : public QObject
+{
+ Q_OBJECT
+
+private slots:
+ void nameRgb();
+ void nameArgb();
+};
+
+void tst_QColor::nameRgb()
+{
+ QColor color(128, 255, 10);
+ QCOMPARE(color.name(), QStringLiteral("#80ff0a"));
+ QBENCHMARK {
+ color.name();
+ }
+}
+
+void tst_QColor::nameArgb()
+{
+ QColor color(128, 255, 0, 102);
+ QCOMPARE(color.name(QColor::HexArgb), QStringLiteral("#6680ff00"));
+ QBENCHMARK {
+ color.name(QColor::HexArgb);
+ }
+}
+
+QTEST_MAIN(tst_QColor)
+
+#include "tst_qcolor.moc"
diff --git a/tests/benchmarks/network/kernel/kernel.pro b/tests/benchmarks/network/kernel/kernel.pro
index 53ec370d60..7b18eefda2 100644
--- a/tests/benchmarks/network/kernel/kernel.pro
+++ b/tests/benchmarks/network/kernel/kernel.pro
@@ -1,4 +1,4 @@
TEMPLATE = subdirs
-contains(QT_CONFIG,private_tests):SUBDIRS += \
+qtConfig(private_tests): SUBDIRS += \
qhostinfo
diff --git a/tests/benchmarks/network/network.pro b/tests/benchmarks/network/network.pro
index ec812407f7..01b3b80ef4 100644
--- a/tests/benchmarks/network/network.pro
+++ b/tests/benchmarks/network/network.pro
@@ -8,7 +8,7 @@ TRUSTED_BENCHMARKS += \
kernel/qhostinfo \
socket/qtcpserver
-contains(QT_CONFIG, openssl) {
+qtConfig(openssl) {
SUBDIRS += ssl
TRUSTED_BENCHMARKS += ssl/qsslsocket
}
diff --git a/tests/manual/manual.pro b/tests/manual/manual.pro
index b9789c354d..2fe96c2f93 100644
--- a/tests/manual/manual.pro
+++ b/tests/manual/manual.pro
@@ -53,11 +53,11 @@ dialogs \
windowtransparency \
unc
-!contains(QT_CONFIG, openssl):!contains(QT_CONFIG, openssl-linked):SUBDIRS -= qssloptions
+!qtConfig(openssl):!qtConfig(openssl-linked): SUBDIRS -= qssloptions
-contains(QT_CONFIG, opengl) {
+qtConfig(opengl) {
SUBDIRS += qopengltextureblitter
- contains(QT_CONFIG, egl): SUBDIRS += qopenglcontext
+ qtConfig(egl): SUBDIRS += qopenglcontext
}
win32: SUBDIRS -= network_remote_stresstest network_stresstest
diff --git a/tests/tests.pro b/tests/tests.pro
index 22f606bbc6..346102ab7b 100644
--- a/tests/tests.pro
+++ b/tests/tests.pro
@@ -4,4 +4,4 @@ SUBDIRS = auto
# benchmarks in debug mode is rarely sensible
# benchmarks are not sensible for code coverage (here with tool testcocoon)
-!uikit:!testcocoon:contains(QT_CONFIG,release):SUBDIRS += benchmarks
+!uikit:!testcocoon:contains(QT_CONFIG, release): SUBDIRS += benchmarks
diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp
index d8c27af884..83807cef2b 100644
--- a/tools/configure/configureapp.cpp
+++ b/tools/configure/configureapp.cpp
@@ -76,7 +76,7 @@ static inline void promptKeyPress()
exit(0); // Exit cleanly for Ctrl+C
}
-Configure::Configure(int& argc, char** argv) : verbose(0)
+Configure::Configure(int& argc, char** argv)
{
// Default values for indentation
optionIndent = 4;
@@ -92,11 +92,6 @@ Configure::Configure(int& argc, char** argv) : verbose(0)
outputWidth = 79;
int i;
- /*
- ** Set up the initial state, the default
- */
- dictionary[ "CONFIGCMD" ] = argv[ 0 ];
-
for (i = 1; i < argc; i++)
configCmdLine += argv[ i ];
@@ -122,11 +117,9 @@ Configure::Configure(int& argc, char** argv) : verbose(0)
QDir(buildPath).mkpath("bin");
buildDir.mkpath("mkspecs");
+ buildDir.mkpath("config.tests");
}
- defaultBuildParts << QStringLiteral("libs") << QStringLiteral("tools") << QStringLiteral("examples");
- allBuildParts = defaultBuildParts;
- allBuildParts << QStringLiteral("tests");
dictionary[ "QT_INSTALL_PREFIX" ] = installPath;
dictionary[ "QMAKESPEC" ] = getenv("QMAKESPEC");
@@ -137,53 +130,7 @@ Configure::Configure(int& argc, char** argv) : verbose(0)
dictionary[ "QMAKESPEC_FROM" ] = "env";
}
- dictionary[ "BUILD_QMAKE" ] = "yes";
- dictionary[ "QMAKE_INTERNAL" ] = "no";
- dictionary[ "WIDGETS" ] = "yes";
- dictionary[ "GUI" ] = "yes";
- dictionary[ "RTTI" ] = "yes";
- dictionary[ "STRIP" ] = "yes";
- dictionary[ "PCH" ] = "yes";
- dictionary[ "SEPARATE_DEBUG_INFO" ] = "no";
- dictionary[ "SSE2" ] = "auto";
- dictionary[ "SSE3" ] = "auto";
- dictionary[ "SSSE3" ] = "auto";
- dictionary[ "SSE4_1" ] = "auto";
- dictionary[ "SSE4_2" ] = "auto";
- dictionary[ "AVX" ] = "auto";
- dictionary[ "AVX2" ] = "auto";
- dictionary[ "AVX512" ] = "auto";
dictionary[ "SYNCQT" ] = "auto";
- dictionary[ "WMF_BACKEND" ] = "no";
- dictionary[ "WMSDK" ] = "auto";
- dictionary[ "QML_DEBUG" ] = "yes";
- dictionary[ "PLUGIN_MANIFESTS" ] = "no";
- dictionary[ "DIRECTWRITE" ] = "auto";
- dictionary[ "DIRECTWRITE2" ] = "auto";
- dictionary[ "DIRECT2D" ] = "no";
- dictionary[ "NIS" ] = "no";
- dictionary[ "NEON" ] = "auto";
- dictionary[ "LARGE_FILE" ] = "yes";
- dictionary[ "FONT_CONFIG" ] = "no";
- dictionary[ "POSIX_IPC" ] = "no";
- dictionary[ "QT_GLIB" ] = "no";
- dictionary[ "QT_ICONV" ] = "auto";
- dictionary[ "QT_EVDEV" ] = "auto";
- dictionary[ "QT_MTDEV" ] = "auto";
- dictionary[ "QT_TSLIB" ] = "auto";
- dictionary[ "QT_INOTIFY" ] = "auto";
- dictionary[ "QT_EVENTFD" ] = "auto";
- dictionary[ "QT_CUPS" ] = "auto";
- dictionary[ "CFG_GCC_SYSROOT" ] = "yes";
- dictionary[ "SLOG2" ] = "no";
- dictionary[ "QNX_IMF" ] = "no";
- dictionary[ "PPS" ] = "no";
- dictionary[ "LGMON" ] = "no";
- dictionary[ "SYSTEM_PROXIES" ] = "yes";
- dictionary[ "SCTP" ] = "no";
- dictionary[ "WERROR" ] = "auto";
- dictionary[ "QREAL" ] = "double";
- dictionary[ "ATOMIC64" ] = "auto";
//Only used when cross compiling.
dictionary[ "QT_INSTALL_SETTINGS" ] = "/etc/xdg";
@@ -218,70 +165,8 @@ Configure::Configure(int& argc, char** argv) : verbose(0)
dictionary[ "REDO" ] = "no";
- dictionary[ "BUILD" ] = "debug";
- dictionary[ "BUILDALL" ] = "auto"; // Means yes, but not explicitly
- dictionary[ "FORCEDEBUGINFO" ] = "no";
- dictionary[ "RELEASE_TOOLS" ] = "no";
-
dictionary[ "BUILDTYPE" ] = "none";
- dictionary[ "BUILDDEV" ] = "no";
-
- dictionary[ "COMPILE_EXAMPLES" ] = "yes";
-
- dictionary[ "C++STD" ] = "auto";
-
- dictionary[ "USE_GOLD_LINKER" ] = "no";
-
- dictionary[ "ENABLE_NEW_DTAGS" ] = "no";
-
- dictionary[ "SHARED" ] = "yes";
-
- dictionary[ "STATIC_RUNTIME" ] = "no";
-
- dictionary[ "SYSTEM_ZLIB" ] = "auto";
-
- dictionary[ "PCRE" ] = "auto";
-
- dictionary[ "ICU" ] = "no";
-
- dictionary[ "ANGLE" ] = "auto";
- dictionary[ "DYNAMICGL" ] = "no";
-
- dictionary[ "GIF" ] = "yes";
- dictionary[ "JPEG" ] = "yes";
- dictionary[ "PNG" ] = "yes";
- dictionary[ "LIBJPEG" ] = "auto";
- dictionary[ "LIBPNG" ] = "auto";
- dictionary[ "DOUBLECONVERSION" ] = "auto";
- dictionary[ "FREETYPE" ] = "yes";
- dictionary[ "FREETYPE_FROM" ] = "default";
- dictionary[ "HARFBUZZ" ] = "qt";
-
- dictionary[ "ACCESSIBILITY" ] = "yes";
- dictionary[ "OPENGL" ] = "yes";
- dictionary[ "OPENGL_ES_2" ] = "yes";
- dictionary[ "SSL" ] = "auto";
- dictionary[ "OPENSSL" ] = "auto";
- dictionary[ "LIBPROXY" ] = "no";
- dictionary[ "DBUS" ] = "auto";
-
- dictionary[ "STYLE_WINDOWS" ] = "yes";
- dictionary[ "STYLE_WINDOWSXP" ] = "auto";
- dictionary[ "STYLE_WINDOWSVISTA" ] = "auto";
- dictionary[ "STYLE_FUSION" ] = "yes";
-
- dictionary[ "SQL_MYSQL" ] = "no";
- dictionary[ "SQL_ODBC" ] = "no";
- dictionary[ "SQL_OCI" ] = "no";
- dictionary[ "SQL_PSQL" ] = "no";
- dictionary[ "SQL_TDS" ] = "no";
- dictionary[ "SQL_DB2" ] = "no";
- dictionary[ "SQL_SQLITE" ] = "auto";
- dictionary[ "SQL_SQLITE_LIB" ] = "qt";
- dictionary[ "SQL_SQLITE2" ] = "no";
- dictionary[ "SQL_IBASE" ] = "no";
-
QString tmp = dictionary[ "QMAKESPEC" ];
if (tmp.contains("\\")) {
tmp = tmp.mid(tmp.lastIndexOf("\\") + 1);
@@ -289,19 +174,6 @@ Configure::Configure(int& argc, char** argv) : verbose(0)
tmp = tmp.mid(tmp.lastIndexOf("/") + 1);
}
dictionary[ "QMAKESPEC" ] = tmp;
-
- dictionary[ "INCREDIBUILD_XGE" ] = "auto";
- dictionary[ "LTCG" ] = "no";
- dictionary[ "NATIVE_GESTURES" ] = "yes";
- dictionary[ "MSVC_MP" ] = "no";
-
- if (dictionary["QMAKESPEC"].startsWith("win32-g++")) {
- const QString zero = QStringLiteral("0");
- const QStringList parts = Environment::gccVersion().split(QLatin1Char('.'));
- dictionary["QT_GCC_MAJOR_VERSION"] = parts.value(0, zero);
- dictionary["QT_GCC_MINOR_VERSION"] = parts.value(1, zero);
- dictionary["QT_GCC_PATCH_VERSION"] = parts.value(2, zero);
- }
}
Configure::~Configure()
@@ -319,34 +191,6 @@ QString Configure::formatPath(const QString &path)
return ret;
}
-QString Configure::formatPaths(const QStringList &paths)
-{
- QString ret;
- foreach (const QString &path, paths) {
- if (!ret.isEmpty())
- ret += QLatin1Char(' ');
- ret += formatPath(path);
- }
- return ret;
-}
-
-// We could use QDir::homePath() + "/.qt-license", but
-// that will only look in the first of $HOME,$USERPROFILE
-// or $HOMEDRIVE$HOMEPATH. So, here we try'em all to be
-// more forgiving for the end user..
-QString Configure::firstLicensePath()
-{
- QStringList allPaths;
- allPaths << "./.qt-license"
- << QString::fromLocal8Bit(getenv("HOME")) + "/.qt-license"
- << QString::fromLocal8Bit(getenv("USERPROFILE")) + "/.qt-license"
- << QString::fromLocal8Bit(getenv("HOMEDRIVE")) + QString::fromLocal8Bit(getenv("HOMEPATH")) + "/.qt-license";
- for (int i = 0; i< allPaths.count(); ++i)
- if (QFile::exists(allPaths.at(i)))
- return allPaths.at(i);
- return QString();
-}
-
// #### somehow I get a compiler error about vc++ reaching the nesting limit without
// undefining the ansi for scoping.
#ifdef for
@@ -390,115 +234,12 @@ void Configure::parseCmdLine()
}
for (; i<configCmdLine.size(); ++i) {
- bool continueElse[] = {false, false};
- if (configCmdLine.at(i) == "-help"
- || configCmdLine.at(i) == "-h"
- || configCmdLine.at(i) == "-?")
- dictionary[ "HELP" ] = "yes";
-
- else if (configCmdLine.at(i) == "-v" || configCmdLine.at(i) == "-verbose") {
- ++verbose;
- }
-
- else if (configCmdLine.at(i) == "-qreal") {
- ++i;
- if (i == argCount)
- break;
- QString s = dictionary[ "QREAL" ] = configCmdLine.at(i);
- if (s == "float") {
- dictionary[ "QREAL_STRING" ] = "\"float\"";
- } else {
- // escape
- s = s.simplified();
- s = '"' + s.toLatin1().toPercentEncoding(QByteArray(), "-._~", '_') + '"';
- dictionary[ "QREAL_STRING" ] = s;
- }
- }
-
- else if (configCmdLine.at(i) == "-release") {
- dictionary[ "BUILD" ] = "release";
- if (dictionary[ "BUILDALL" ] == "auto")
- dictionary[ "BUILDALL" ] = "no";
- } else if (configCmdLine.at(i) == "-debug") {
- dictionary[ "BUILD" ] = "debug";
- if (dictionary[ "BUILDALL" ] == "auto")
- dictionary[ "BUILDALL" ] = "no";
- } else if (configCmdLine.at(i) == "-debug-and-release")
- dictionary[ "BUILDALL" ] = "yes";
- else if (configCmdLine.at(i) == "-force-debug-info")
- dictionary[ "FORCEDEBUGINFO" ] = "yes";
- else if (configCmdLine.at(i) == "-no-separate-debug-info")
- dictionary[ "SEPARATE_DEBUG_INFO" ] = "no";
- else if (configCmdLine.at(i) == "-separate-debug-info")
- dictionary[ "SEPARATE_DEBUG_INFO" ] = "yes";
- else if (configCmdLine.at(i) == "-optimized-tools")
- dictionary[ "RELEASE_TOOLS" ] = "yes";
- else if (configCmdLine.at(i) == "-no-optimized-tools")
- dictionary[ "RELEASE_TOOLS" ] = "no";
-
- else if (configCmdLine.at(i) == "-compile-examples") {
- dictionary[ "COMPILE_EXAMPLES" ] = "yes";
- } else if (configCmdLine.at(i) == "-no-compile-examples") {
- dictionary[ "COMPILE_EXAMPLES" ] = "no";
- }
-
- else if (configCmdLine.at(i) == "-c++std") {
- ++i;
- if (i == argCount)
- break;
-
- QString level = configCmdLine.at(i);
- if (level == "c++11" || level == "c++14" || level == "c++1z"
- || level == "auto") {
- dictionary[ "C++STD" ] = level;
- } else if (level == "11" || level == "14" || level == "1z") {
- dictionary[ "C++STD" ] = "c++" + level;
- } else {
- dictionary[ "DONE" ] = "error";
- cout << "ERROR: invalid C++ standard " << level
- << "; valid options are: c++11 c++14 c++1z auto" << endl;
- return;
- }
- }
-
-
- else if (configCmdLine.at(i) == "-use-gold-linker")
- dictionary[ "USE_GOLD_LINKER" ] = "yes";
- else if (configCmdLine.at(i) == "-no-use-gold-linker")
- dictionary[ "USE_GOLD_LINKER" ] = "no";
- else if (configCmdLine.at(i) == "-enable-new-dtags")
- dictionary[ "ENABLE_NEW_DTAGS" ] = "yes";
- else if (configCmdLine.at(i) == "-disable-new-dtags")
- dictionary[ "ENABLE_NEW_DTAGS" ] = "no";
- else if (configCmdLine.at(i) == "-shared")
- dictionary[ "SHARED" ] = "yes";
- else if (configCmdLine.at(i) == "-static")
- dictionary[ "SHARED" ] = "no";
- else if (configCmdLine.at(i) == "-static-runtime")
- dictionary[ "STATIC_RUNTIME" ] = "yes";
- else if (configCmdLine.at(i) == "-developer-build")
- dictionary[ "BUILDDEV" ] = "yes";
- else if (configCmdLine.at(i) == "-opensource") {
+ if (configCmdLine.at(i) == "-opensource") {
dictionary[ "BUILDTYPE" ] = "opensource";
}
else if (configCmdLine.at(i) == "-commercial") {
dictionary[ "BUILDTYPE" ] = "commercial";
}
- else if (configCmdLine.at(i) == "-ltcg") {
- dictionary[ "LTCG" ] = "yes";
- }
- else if (configCmdLine.at(i) == "-no-ltcg") {
- dictionary[ "LTCG" ] = "no";
- }
- else if (configCmdLine.at(i) == "-mp") {
- dictionary[ "MSVC_MP" ] = "yes";
- }
- else if (configCmdLine.at(i) == "-no-mp") {
- dictionary[ "MSVC_MP" ] = "no";
- }
- else if (configCmdLine.at(i) == "-force-asserts") {
- dictionary[ "FORCE_ASSERTS" ] = "yes";
- }
else if (configCmdLine.at(i) == "-platform") {
++i;
if (i == argCount)
@@ -517,450 +258,15 @@ void Configure::parseCmdLine()
devOpt.append("\n").append(option);
else
devOpt = option;
-
- } else if (configCmdLine.at(i) == "-qt-zlib") {
- dictionary[ "SYSTEM_ZLIB" ] = "no";
- } else if (configCmdLine.at(i) == "-system-zlib") {
- dictionary[ "SYSTEM_ZLIB" ] = "yes";
- }
-
- else if (configCmdLine.at(i) == "-qt-pcre") {
- dictionary[ "PCRE" ] = "qt";
- } else if (configCmdLine.at(i) == "-system-pcre") {
- dictionary[ "PCRE" ] = "system";
- }
-
- else if (configCmdLine.at(i) == "-icu") {
- dictionary[ "ICU" ] = "yes";
- } else if (configCmdLine.at(i) == "-no-icu") {
- dictionary[ "ICU" ] = "no";
- }
-
- else if (configCmdLine.at(i) == "-angle") {
- dictionary[ "ANGLE" ] = "yes";
- dictionary[ "ANGLE_FROM" ] = "commandline";
- } else if (configCmdLine.at(i) == "-no-angle") {
- dictionary[ "ANGLE" ] = "no";
- dictionary[ "ANGLE_FROM" ] = "commandline";
- }
-
- // Image formats --------------------------------------------
- else if (configCmdLine.at(i) == "-no-gif")
- dictionary[ "GIF" ] = "no";
-
- else if (configCmdLine.at(i) == "-no-libjpeg") {
- dictionary[ "JPEG" ] = "no";
- dictionary[ "LIBJPEG" ] = "no";
- } else if (configCmdLine.at(i) == "-qt-libjpeg") {
- dictionary[ "LIBJPEG" ] = "qt";
- } else if (configCmdLine.at(i) == "-system-libjpeg") {
- dictionary[ "LIBJPEG" ] = "system";
- }
-
- else if (configCmdLine.at(i) == "-no-libpng") {
- dictionary[ "PNG" ] = "no";
- dictionary[ "LIBPNG" ] = "no";
- } else if (configCmdLine.at(i) == "-qt-libpng") {
- dictionary[ "LIBPNG" ] = "qt";
- } else if (configCmdLine.at(i) == "-system-libpng") {
- dictionary[ "LIBPNG" ] = "system";
- }
-
- // Double Conversion -----------------------------------------
- else if (configCmdLine.at(i) == "-no-doubleconversion")
- dictionary[ "DOUBLECONVERSION" ] = "no";
- else if (configCmdLine.at(i) == "-qt-doubleconversion")
- dictionary[ "DOUBLECONVERSION" ] = "qt";
- else if (configCmdLine.at(i) == "-system-doubleconversion")
- dictionary[ "DOUBLECONVERSION" ] = "system";
-
- // Text Rendering --------------------------------------------
- else if (configCmdLine.at(i) == "-no-freetype") {
- dictionary[ "FREETYPE" ] = "no";
- dictionary[ "FREETYPE_FROM" ] = "commandline";
- } else if (configCmdLine.at(i) == "-qt-freetype") {
- dictionary[ "FREETYPE" ] = "yes";
- dictionary[ "FREETYPE_FROM" ] = "commandline";
- } else if (configCmdLine.at(i) == "-system-freetype") {
- dictionary[ "FREETYPE" ] = "system";
- dictionary[ "FREETYPE_FROM" ] = "commandline";
- }
-
- else if (configCmdLine.at(i) == "-no-harfbuzz")
- dictionary[ "HARFBUZZ" ] = "no";
- else if (configCmdLine.at(i) == "-qt-harfbuzz")
- dictionary[ "HARFBUZZ" ] = "qt";
- else if (configCmdLine.at(i) == "-system-harfbuzz")
- dictionary[ "HARFBUZZ" ] = "system";
-
- // Styles ---------------------------------------------------
- else if (configCmdLine.at(i) == "-qt-style-windows")
- dictionary[ "STYLE_WINDOWS" ] = "yes";
- else if (configCmdLine.at(i) == "-no-style-windows")
- dictionary[ "STYLE_WINDOWS" ] = "no";
-
- else if (configCmdLine.at(i) == "-qt-style-windowsxp")
- dictionary[ "STYLE_WINDOWSXP" ] = "yes";
- else if (configCmdLine.at(i) == "-no-style-windowsxp")
- dictionary[ "STYLE_WINDOWSXP" ] = "no";
-
- else if (configCmdLine.at(i) == "-qt-style-windowsvista")
- dictionary[ "STYLE_WINDOWSVISTA" ] = "yes";
- else if (configCmdLine.at(i) == "-no-style-windowsvista")
- dictionary[ "STYLE_WINDOWSVISTA" ] = "no";
-
- else if (configCmdLine.at(i) == "-qt-style-fusion")
- dictionary[ "STYLE_FUSION" ] = "yes";
- else if (configCmdLine.at(i) == "-no-style-fusion")
- dictionary[ "STYLE_FUSION" ] = "no";
-
- // Work around compiler nesting limitation
- else
- continueElse[1] = true;
- if (!continueElse[1]) {
- }
-
- // OpenGL Support -------------------------------------------
- else if (configCmdLine.at(i) == "-no-opengl") {
- dictionary[ "OPENGL" ] = "no";
- dictionary[ "OPENGL_ES_2" ] = "no";
- } else if (configCmdLine.at(i) == "-opengl-es-2") {
- dictionary[ "OPENGL" ] = "yes";
- dictionary[ "OPENGL_ES_2" ] = "yes";
- } else if (configCmdLine.at(i) == "-opengl") {
- dictionary[ "OPENGL" ] = "yes";
- i++;
- if (i == argCount)
- break;
-
- dictionary[ "OPENGL_ES_2" ] = "no";
- if ( configCmdLine.at(i) == "es2" ) {
- dictionary[ "OPENGL_ES_2" ] = "yes";
- } else if ( configCmdLine.at(i) == "desktop" ) {
- // OPENGL=yes suffices
- } else if ( configCmdLine.at(i) == "dynamic" ) {
- dictionary[ "DYNAMICGL" ] = "yes";
- } else {
- cout << "Argument passed to -opengl option is not valid." << endl;
- dictionary[ "DONE" ] = "error";
- break;
- }
- }
-
- // Databases ------------------------------------------------
- else if (configCmdLine.at(i) == "-sql-mysql" || configCmdLine.at(i) == "-plugin-sql-mysql")
- dictionary[ "SQL_MYSQL" ] = "yes";
- else if (configCmdLine.at(i) == "-no-sql-mysql")
- dictionary[ "SQL_MYSQL" ] = "no";
-
- else if (configCmdLine.at(i) == "-sql-odbc" || configCmdLine.at(i) == "-plugin-sql-odbc")
- dictionary[ "SQL_ODBC" ] = "yes";
- else if (configCmdLine.at(i) == "-no-sql-odbc")
- dictionary[ "SQL_ODBC" ] = "no";
-
- else if (configCmdLine.at(i) == "-sql-oci" || configCmdLine.at(i) == "-plugin-sql-oci")
- dictionary[ "SQL_OCI" ] = "yes";
- else if (configCmdLine.at(i) == "-no-sql-oci")
- dictionary[ "SQL_OCI" ] = "no";
-
- else if (configCmdLine.at(i) == "-sql-psql" || configCmdLine.at(i) == "-plugin-sql-psql")
- dictionary[ "SQL_PSQL" ] = "yes";
- else if (configCmdLine.at(i) == "-no-sql-psql")
- dictionary[ "SQL_PSQL" ] = "no";
-
- else if (configCmdLine.at(i) == "-sql-tds" || configCmdLine.at(i) == "-plugin-sql-tds")
- dictionary[ "SQL_TDS" ] = "yes";
- else if (configCmdLine.at(i) == "-no-sql-tds")
- dictionary[ "SQL_TDS" ] = "no";
-
- else if (configCmdLine.at(i) == "-sql-db2")
- dictionary[ "SQL_DB2" ] = "yes";
- else if (configCmdLine.at(i) == "-plugin-sql-db2")
- dictionary[ "SQL_DB2" ] = "plugin";
- else if (configCmdLine.at(i) == "-no-sql-db2")
- dictionary[ "SQL_DB2" ] = "no";
-
- else if (configCmdLine.at(i) == "-sql-sqlite" || configCmdLine.at(i) == "-plugin-sql-sqlite")
- dictionary[ "SQL_SQLITE" ] = "yes";
- else if (configCmdLine.at(i) == "-no-sql-sqlite")
- dictionary[ "SQL_SQLITE" ] = "no";
- else if (configCmdLine.at(i) == "-system-sqlite")
- dictionary[ "SQL_SQLITE_LIB" ] = "system";
- else if (configCmdLine.at(i) == "-sql-sqlite2" || configCmdLine.at(i) == "-plugin-sql-sqlite2")
- dictionary[ "SQL_SQLITE2" ] = "yes";
- else if (configCmdLine.at(i) == "-no-sql-sqlite2")
- dictionary[ "SQL_SQLITE2" ] = "no";
-
- else if (configCmdLine.at(i) == "-sql-ibase" || configCmdLine.at(i) == "-plugin-sql-ibase")
- dictionary[ "SQL_IBASE" ] = "yes";
- else if (configCmdLine.at(i) == "-no-sql-ibase")
- dictionary[ "SQL_IBASE" ] = "no";
-
- else if (configCmdLine.at(i) == "-no-incredibuild-xge")
- dictionary[ "INCREDIBUILD_XGE" ] = "no";
- else if (configCmdLine.at(i) == "-incredibuild-xge")
- dictionary[ "INCREDIBUILD_XGE" ] = "yes";
- else if (configCmdLine.at(i) == "-native-gestures")
- dictionary[ "NATIVE_GESTURES" ] = "yes";
- else if (configCmdLine.at(i) == "-no-native-gestures")
- dictionary[ "NATIVE_GESTURES" ] = "no";
- // Others ---------------------------------------------------
- else if (configCmdLine.at(i) == "-widgets")
- dictionary[ "WIDGETS" ] = "yes";
- else if (configCmdLine.at(i) == "-no-widgets")
- dictionary[ "WIDGETS" ] = "no";
-
- else if (configCmdLine.at(i) == "-gui")
- dictionary[ "GUI" ] = "yes";
- else if (configCmdLine.at(i) == "-no-gui")
- dictionary[ "GUI" ] = "no";
-
- else if (configCmdLine.at(i) == "-rtti")
- dictionary[ "RTTI" ] = "yes";
- else if (configCmdLine.at(i) == "-no-rtti")
- dictionary[ "RTTI" ] = "no";
-
- else if (configCmdLine.at(i) == "-strip")
- dictionary[ "STRIP" ] = "yes";
- else if (configCmdLine.at(i) == "-no-strip")
- dictionary[ "STRIP" ] = "no";
-
- else if (configCmdLine.at(i) == "-pch")
- dictionary[ "PCH" ] = "yes";
- else if (configCmdLine.at(i) == "-no-pch")
- dictionary[ "PCH" ] = "no";
-
- else if (configCmdLine.at(i) == "-accessibility")
- dictionary[ "ACCESSIBILITY" ] = "yes";
- else if (configCmdLine.at(i) == "-no-accessibility") {
- dictionary[ "ACCESSIBILITY" ] = "no";
- cout << "Setting accessibility to NO" << endl;
- }
-
- else if (configCmdLine.at(i) == "-no-sse2")
- dictionary[ "SSE2" ] = "no";
- else if (configCmdLine.at(i) == "-sse2")
- dictionary[ "SSE2" ] = "yes";
- else if (configCmdLine.at(i) == "-no-sse3")
- dictionary[ "SSE3" ] = "no";
- else if (configCmdLine.at(i) == "-sse3")
- dictionary[ "SSE3" ] = "yes";
- else if (configCmdLine.at(i) == "-no-ssse3")
- dictionary[ "SSSE3" ] = "no";
- else if (configCmdLine.at(i) == "-ssse3")
- dictionary[ "SSSE3" ] = "yes";
- else if (configCmdLine.at(i) == "-no-sse4.1")
- dictionary[ "SSE4_1" ] = "no";
- else if (configCmdLine.at(i) == "-sse4.1")
- dictionary[ "SSE4_1" ] = "yes";
- else if (configCmdLine.at(i) == "-no-sse4.2")
- dictionary[ "SSE4_2" ] = "no";
- else if (configCmdLine.at(i) == "-sse4.2")
- dictionary[ "SSE4_2" ] = "yes";
- else if (configCmdLine.at(i) == "-no-avx")
- dictionary[ "AVX" ] = "no";
- else if (configCmdLine.at(i) == "-avx")
- dictionary[ "AVX" ] = "yes";
- else if (configCmdLine.at(i) == "-no-avx2")
- dictionary[ "AVX2" ] = "no";
- else if (configCmdLine.at(i) == "-avx2")
- dictionary[ "AVX2" ] = "yes";
- else if (configCmdLine.at(i) == "-no-avx512")
- dictionary[ "AVX512" ] = "";
- else if (configCmdLine.at(i) == "-avx512")
- dictionary[ "AVX512" ] = "auto";
-
- else if (configCmdLine.at(i) == "-no-ssl") {
- dictionary[ "SSL"] = "no";
- } else if (configCmdLine.at(i) == "-ssl") {
- dictionary[ "SSL" ] = "yes";
- } else if (configCmdLine.at(i) == "-no-openssl") {
- dictionary[ "OPENSSL"] = "no";
- } else if (configCmdLine.at(i) == "-openssl") {
- dictionary[ "OPENSSL" ] = "yes";
- dictionary[ "SSL" ] = "yes";
- } else if (configCmdLine.at(i) == "-openssl-linked") {
- dictionary[ "OPENSSL" ] = "linked";
- dictionary[ "SSL" ] = "yes";
- } else if (configCmdLine.at(i) == "-no-libproxy") {
- dictionary[ "LIBPROXY"] = "no";
- } else if (configCmdLine.at(i) == "-libproxy") {
- dictionary[ "LIBPROXY" ] = "yes";
- } else if (configCmdLine.at(i) == "-no-qdbus") {
- dictionary[ "DBUS" ] = "no";
- } else if (configCmdLine.at(i) == "-qdbus") {
- dictionary[ "DBUS" ] = "auto";
- } else if (configCmdLine.at(i) == "-no-dbus") {
- dictionary[ "DBUS" ] = "no";
- } else if (configCmdLine.at(i) == "-dbus") {
- dictionary[ "DBUS" ] = "auto";
- } else if (configCmdLine.at(i) == "-dbus-linked") {
- dictionary[ "DBUS" ] = "linked";
- } else if (configCmdLine.at(i) == "-dbus-runtime") {
- dictionary[ "DBUS" ] = "runtime";
- } else if (configCmdLine.at(i) == "-wmf-backend") {
- dictionary[ "WMF_BACKEND" ] = "yes";
- } else if (configCmdLine.at(i) == "-no-wmf-backend") {
- dictionary[ "WMF_BACKEND" ] = "no";
- } else if (configCmdLine.at(i) == "-no-qml-debug") {
- dictionary[ "QML_DEBUG" ] = "no";
- } else if (configCmdLine.at(i) == "-qml-debug") {
- dictionary[ "QML_DEBUG" ] = "yes";
- } else if (configCmdLine.at(i) == "-no-plugin-manifests") {
- dictionary[ "PLUGIN_MANIFESTS" ] = "no";
- } else if (configCmdLine.at(i) == "-plugin-manifests") {
- dictionary[ "PLUGIN_MANIFESTS" ] = "yes";
- } else if (configCmdLine.at(i) == "-no-slog2") {
- dictionary[ "SLOG2" ] = "no";
- } else if (configCmdLine.at(i) == "-slog2") {
- dictionary[ "SLOG2" ] = "yes";
- } else if (configCmdLine.at(i) == "-no-imf") {
- dictionary[ "QNX_IMF" ] = "no";
- } else if (configCmdLine.at(i) == "-imf") {
- dictionary[ "QNX_IMF" ] = "yes";
- } else if (configCmdLine.at(i) == "-no-pps") {
- dictionary[ "PPS" ] = "no";
- } else if (configCmdLine.at(i) == "-pps") {
- dictionary[ "PPS" ] = "yes";
- } else if (configCmdLine.at(i) == "-no-lgmon") {
- dictionary[ "LGMON" ] = "no";
- } else if (configCmdLine.at(i) == "-lgmon") {
- dictionary[ "LGMON" ] = "yes";
- } else if (configCmdLine.at(i) == "-no-system-proxies") {
- dictionary[ "SYSTEM_PROXIES" ] = "no";
- } else if (configCmdLine.at(i) == "-system-proxies") {
- dictionary[ "SYSTEM_PROXIES" ] = "yes";
- } else if (configCmdLine.at(i) == "-no-sctp") {
- dictionary[ "SCTP" ] = "no";
- } else if (configCmdLine.at(i) == "-sctp") {
- dictionary[ "SCTP" ] = "yes";
- } else if (configCmdLine.at(i) == "-warnings-are-errors" ||
- configCmdLine.at(i) == "-Werror") {
- dictionary[ "WERROR" ] = "yes";
- } else if (configCmdLine.at(i) == "-no-warnings-are-errors") {
- dictionary[ "WERROR" ] = "no";
- } else if (configCmdLine.at(i) == "-no-headersclean") {
- dictionary[ "HEADERSCLEAN" ] = "no";
- } else if (configCmdLine.at(i) == "-headersclean") {
- dictionary[ "HEADERSCLEAN" ] = "yes";
- } else if (configCmdLine.at(i) == "-no-eventfd") {
- dictionary[ "QT_EVENTFD" ] = "no";
- } else if (configCmdLine.at(i) == "-eventfd") {
- dictionary[ "QT_EVENTFD" ] = "yes";
}
- // Work around compiler nesting limitation
- else
- continueElse[0] = true;
- if (!continueElse[0]) {
- }
-
- else if (configCmdLine.at(i) == "-internal")
- dictionary[ "QMAKE_INTERNAL" ] = "yes";
-
else if (configCmdLine.at(i) == "-no-syncqt")
dictionary[ "SYNCQT" ] = "no";
- else if (configCmdLine.at(i) == "-no-qmake")
- dictionary[ "BUILD_QMAKE" ] = "no";
- else if (configCmdLine.at(i) == "-qmake")
- dictionary[ "BUILD_QMAKE" ] = "yes";
-
- else if (configCmdLine.at(i) == "-qtnamespace") {
- ++i;
- if (i == argCount)
- break;
- dictionary[ "QT_NAMESPACE" ] = configCmdLine.at(i);
- } else if (configCmdLine.at(i) == "-qtlibinfix") {
- ++i;
- if (i == argCount)
- break;
- dictionary[ "QT_LIBINFIX" ] = configCmdLine.at(i);
- } else if (configCmdLine.at(i) == "-D") {
- ++i;
- if (i == argCount)
- break;
- qmakeDefines += configCmdLine.at(i);
- } else if (configCmdLine.at(i) == "-I") {
- ++i;
- if (i == argCount)
- break;
- qmakeIncludes += configCmdLine.at(i);
- } else if (configCmdLine.at(i) == "-L") {
- ++i;
- if (i == argCount)
- break;
- QFileInfo checkDirectory(configCmdLine.at(i));
- if (!checkDirectory.isDir()) {
- cout << "Argument passed to -L option is not a directory path. Did you mean the -l option?" << endl;
- dictionary[ "DONE" ] = "error";
- break;
- }
- qmakeLibs += configCmdLine.at(i);
- } else if (configCmdLine.at(i).startsWith("OPENSSL_LIBS=")) {
- opensslLibs = configCmdLine.at(i);
- } else if (configCmdLine.at(i).startsWith("OPENSSL_LIBS_DEBUG=")) {
- opensslLibsDebug = configCmdLine.at(i);
- } else if (configCmdLine.at(i).startsWith("OPENSSL_LIBS_RELEASE=")) {
- opensslLibsRelease = configCmdLine.at(i);
- } else if (configCmdLine.at(i).startsWith("OPENSSL_PATH=")) {
- opensslPath = QDir::fromNativeSeparators(configCmdLine.at(i).section("=", 1));
- } else if (configCmdLine.at(i).startsWith("PSQL_LIBS=")) {
- psqlLibs = configCmdLine.at(i);
- } else if (configCmdLine.at(i).startsWith("SYBASE=")) {
- sybase = configCmdLine.at(i);
- } else if (configCmdLine.at(i).startsWith("SYBASE_LIBS=")) {
- sybaseLibs = configCmdLine.at(i);
- } else if (configCmdLine.at(i).startsWith("DBUS_PATH=")) {
- dbusPath = QDir::fromNativeSeparators(configCmdLine.at(i).section("=", 1));
- } else if (configCmdLine.at(i).startsWith("DBUS_HOST_PATH=")) {
- dbusHostPath = QDir::fromNativeSeparators(configCmdLine.at(i).section("=", 1));
- } else if (configCmdLine.at(i).startsWith("MYSQL_PATH=")) {
- mysqlPath = QDir::fromNativeSeparators(configCmdLine.at(i).section("=", 1));
- } else if (configCmdLine.at(i).startsWith("ZLIB_LIBS=")) {
- zlibLibs = QDir::fromNativeSeparators(configCmdLine.at(i));
- }
-
else if (configCmdLine.at(i) == "-confirm-license") {
dictionary["LICENSE_CONFIRMED"] = "yes";
}
- else if (configCmdLine.at(i) == "-make") {
- ++i;
- if (i == argCount)
- break;
- QString part = configCmdLine.at(i);
- if (!allBuildParts.contains(part)) {
- cout << "Unknown part " << part << " passed to -make." << endl;
- dictionary["DONE"] = "error";
- }
- buildParts += part;
- } else if (configCmdLine.at(i) == "-nomake") {
- ++i;
- if (i == argCount)
- break;
- QString part = configCmdLine.at(i);
- if (!allBuildParts.contains(part)) {
- cout << "Unknown part " << part << " passed to -nomake." << endl;
- dictionary["DONE"] = "error";
- }
- nobuildParts += part;
- }
-
- else if (configCmdLine.at(i) == "-skip") {
- ++i;
- if (i == argCount)
- break;
- QString mod = configCmdLine.at(i);
- if (!mod.startsWith(QLatin1String("qt")))
- mod.insert(0, QStringLiteral("qt"));
- if (!QFileInfo(sourcePath + "/../" + mod).isDir()) {
- cout << "Attempting to skip non-existent module " << mod << "." << endl;
- dictionary["DONE"] = "error";
- }
- skipModules += mod;
- }
-
// Directories ----------------------------------------------
else if (configCmdLine.at(i) == "-prefix") {
++i;
@@ -1066,9 +372,6 @@ void Configure::parseCmdLine()
break;
dictionary[ "CFG_SYSROOT" ] = configCmdLine.at(i);
}
- else if (configCmdLine.at(i) == "-no-gcc-sysroot") {
- dictionary[ "CFG_GCC_SYSROOT" ] = "no";
- }
else if (configCmdLine.at(i) == "-hostprefix") {
++i;
@@ -1113,91 +416,10 @@ void Configure::parseCmdLine()
dictionary[ "MAKE" ] = configCmdLine.at(i);
}
- else if (configCmdLine.at(i).indexOf(QRegExp("^-(en|dis)able-")) != -1) {
- // Scan to see if any specific modules and drivers are enabled or disabled
- for (QStringList::Iterator module = modules.begin(); module != modules.end(); ++module) {
- if (configCmdLine.at(i) == QString("-enable-") + (*module)) {
- enabledModules += (*module);
- break;
- }
- else if (configCmdLine.at(i) == QString("-disable-") + (*module)) {
- disabledModules += (*module);
- break;
- }
- }
- }
-
- else if (configCmdLine.at(i) == "-directwrite") {
- dictionary["DIRECTWRITE"] = "yes";
- } else if (configCmdLine.at(i) == "-no-directwrite") {
- dictionary["DIRECTWRITE"] = "no";
- }
-
- else if (configCmdLine.at(i) == "-direct2d") {
- dictionary["DIRECT2D"] = "yes";
- } else if (configCmdLine.at(i) == "-no-direct2d") {
- dictionary["DIRECT2D"] = "no";
- }
-
- else if (configCmdLine.at(i) == "-nis") {
- dictionary["NIS"] = "yes";
- } else if (configCmdLine.at(i) == "-no-nis") {
- dictionary["NIS"] = "no";
- }
-
- else if (configCmdLine.at(i) == "-cups") {
- dictionary["QT_CUPS"] = "yes";
- } else if (configCmdLine.at(i) == "-no-cups") {
- dictionary["QT_CUPS"] = "no";
- }
-
- else if (configCmdLine.at(i) == "-iconv") {
- dictionary["QT_ICONV"] = "yes";
- } else if (configCmdLine.at(i) == "-no-iconv") {
- dictionary["QT_ICONV"] = "no";
- } else if (configCmdLine.at(i) == "-sun-iconv") {
- dictionary["QT_ICONV"] = "sun";
- } else if (configCmdLine.at(i) == "-gnu-iconv") {
- dictionary["QT_ICONV"] = "gnu";
- }
-
- else if (configCmdLine.at(i) == "-no-evdev") {
- dictionary[ "QT_EVDEV" ] = "no";
- } else if (configCmdLine.at(i) == "-evdev") {
- dictionary[ "QT_EVDEV" ] = "yes";
- }
-
- else if (configCmdLine.at(i) == "-no-mtdev") {
- dictionary[ "QT_MTDEV" ] = "no";
- } else if (configCmdLine.at(i) == "-mtdev") {
- dictionary[ "QT_MTDEV" ] = "yes";
- }
-
- else if (configCmdLine.at(i) == "-inotify") {
- dictionary["QT_INOTIFY"] = "yes";
- } else if (configCmdLine.at(i) == "-no-inotify") {
- dictionary["QT_INOTIFY"] = "no";
- }
-
- else if (configCmdLine.at(i) == "-fontconfig") {
- dictionary["FONT_CONFIG"] = "yes";
- } else if (configCmdLine.at(i) == "-no-fontconfig") {
- dictionary["FONT_CONFIG"] = "no";
- }
-
- else if (configCmdLine.at(i) == "-posix-ipc") {
- dictionary["POSIX_IPC"] = "yes";
- }
-
- else if (configCmdLine.at(i) == "-glib") {
- dictionary["QT_GLIB"] = "yes";
- }
-
else if (configCmdLine.at(i) == "-sysconfdir") {
++i;
if (i == argCount)
break;
-
dictionary["QT_INSTALL_SETTINGS"] = configCmdLine.at(i);
}
@@ -1226,7 +448,6 @@ void Configure::parseCmdLine()
++i;
if (i == argCount)
break;
-
dictionary[ "ANDROID_HOST" ] = configCmdLine.at(i);
}
@@ -1249,12 +470,6 @@ void Configure::parseCmdLine()
} else if (configCmdLine.at(i) == "-android-style-assets") {
dictionary[ "ANDROID_STYLE_ASSETS" ] = "yes";
}
-
- else {
- dictionary[ "DONE" ] = "error";
- cout << "Unknown option " << configCmdLine.at(i) << endl;
- break;
- }
}
// Ensure that QMAKESPEC exists in the mkspecs folder
@@ -1326,1136 +541,18 @@ void Configure::parseCmdLine()
}
}
- // Allow tests for private classes to be compiled against internal builds
- if (dictionary["BUILDDEV"] == "yes") {
- qtConfig << "private_tests";
- if (dictionary["WERROR"] != "no")
- qmakeConfig << "warnings_are_errors";
- if (dictionary["HEADERSCLEAN"] != "no")
- qmakeConfig << "headersclean";
- } else {
- if (dictionary["WERROR"] == "yes")
- qmakeConfig << "warnings_are_errors";
- if (dictionary["HEADERSCLEAN"] == "yes")
- qmakeConfig << "headersclean";
- }
-
- if (dictionary["FORCE_ASSERTS"] == "yes")
- qtConfig += "force_asserts";
-
- for (QStringList::Iterator dis = disabledModules.begin(); dis != disabledModules.end(); ++dis) {
- modules.removeAll((*dis));
- }
- for (QStringList::Iterator ena = enabledModules.begin(); ena != enabledModules.end(); ++ena) {
- if (modules.indexOf((*ena)) == -1)
- modules += (*ena);
- }
- qtConfig += modules;
-
- for (QStringList::Iterator it = disabledModules.begin(); it != disabledModules.end(); ++it)
- qtConfig.removeAll(*it);
-
- if ((dictionary[ "REDO" ] != "yes") && (dictionary[ "HELP" ] != "yes")
- && (dictionary[ "DONE" ] != "error"))
+ if ((dictionary["REDO"] != "yes") && (dictionary["DONE"] != "error"))
saveCmdLine();
}
-void Configure::validateArgs()
-{
-}
-
-// Output helper functions --------------------------------[ Start ]-
-/*!
- Determines the length of a string token.
-*/
-static int tokenLength(const char *str)
-{
- if (*str == 0)
- return 0;
-
- const char *nextToken = strpbrk(str, " _/\n\r");
- if (nextToken == str || !nextToken)
- return 1;
-
- return int(nextToken - str);
-}
-
-/*!
- Prints out a string which starts at position \a startingAt, and
- indents each wrapped line with \a wrapIndent characters.
- The wrap point is set to the console width, unless that width
- cannot be determined, or is too small.
-*/
-void Configure::desc(const char *description, int startingAt, int wrapIndent)
-{
- int linePos = startingAt;
-
- bool firstLine = true;
- const char *nextToken = description;
- while (*nextToken) {
- int nextTokenLen = tokenLength(nextToken);
- if (*nextToken == '\n' // Wrap on newline, duh
- || (linePos + nextTokenLen > outputWidth)) // Wrap at outputWidth
- {
- printf("\n");
- linePos = 0;
- firstLine = false;
- if (*nextToken == '\n')
- ++nextToken;
- continue;
- }
- if (!firstLine && linePos < wrapIndent) { // Indent to wrapIndent
- printf("%*s", wrapIndent , "");
- linePos = wrapIndent;
- if (*nextToken == ' ') {
- ++nextToken;
- continue;
- }
- }
- printf("%.*s", nextTokenLen, nextToken);
- linePos += nextTokenLen;
- nextToken += nextTokenLen;
- }
-}
-
-/*!
- Prints out an option with its description wrapped at the
- description starting point. If \a skipIndent is true, the
- indentation to the option is not outputted (used by marked option
- version of desc()). Extra spaces between option and its
- description is filled with\a fillChar, if there's available
- space.
-*/
-void Configure::desc(const char *option, const char *description, bool skipIndent, char fillChar)
-{
- if (!skipIndent)
- printf("%*s", optionIndent, "");
-
- int remaining = descIndent - optionIndent - int(strlen(option));
- int wrapIndent = descIndent + qMax(0, 1 - remaining);
- printf("%s", option);
-
- if (remaining > 2) {
- printf(" "); // Space in front
- for (int i = remaining; i > 2; --i)
- printf("%c", fillChar); // Fill, if available space
- }
- printf(" "); // Space between option and description
-
- desc(description, wrapIndent, wrapIndent);
- printf("\n");
-}
-
-/*!
- Same as above, except it also marks an option with an '*', if
- the option is default action.
-*/
-void Configure::desc(const char *mark_option, const char *mark, const char *option, const char *description, char fillChar)
-{
- const QString markedAs = dictionary.value(mark_option);
- if (markedAs == "auto" && markedAs == mark) // both "auto", always => +
- printf(" + ");
- else if (markedAs == "auto") // setting marked as "auto" and option is default => +
- printf(" %c " , (defaultTo(mark_option) == QLatin1String(mark))? '+' : ' ');
- else if (QLatin1String(mark) == "auto" && markedAs != "no") // description marked as "auto" and option is available => +
- printf(" %c " , checkAvailability(mark_option) ? '+' : ' ');
- else // None are "auto", (markedAs == mark) => *
- printf(" %c " , markedAs == QLatin1String(mark) ? '*' : ' ');
-
- desc(option, description, true, fillChar);
-}
-
/*!
Modifies the default configuration based on given -platform option.
Eg. switches to different default styles for Windows CE.
*/
void Configure::applySpecSpecifics()
{
- if (dictionary.contains("XQMAKESPEC")) {
- //Disable building tools when cross compiling.
- nobuildParts << "tools";
- }
-
- if (dictionary.value("XQMAKESPEC").startsWith("winphone") || dictionary.value("XQMAKESPEC").startsWith("winrt")) {
- dictionary[ "STYLE_WINDOWSXP" ] = "no";
- dictionary[ "STYLE_WINDOWSVISTA" ] = "no";
- dictionary[ "LIBJPEG" ] = "qt";
- dictionary[ "LIBPNG" ] = "qt";
- dictionary[ "FREETYPE" ] = "yes";
- dictionary[ "SSL" ] = "yes";
- dictionary[ "OPENSSL" ] = "no";
- dictionary[ "DBUS" ] = "no";
- dictionary[ "SYSTEM_ZLIB" ] = "no";
- dictionary[ "PCRE" ] = "qt";
- dictionary[ "ICU" ] = "qt";
- dictionary[ "LARGE_FILE" ] = "no";
- } else if (dictionary.value("XQMAKESPEC").startsWith("linux")) { //TODO actually wrong.
- //TODO
- dictionary[ "STYLE_WINDOWSXP" ] = "no";
- dictionary[ "STYLE_WINDOWSVISTA" ] = "no";
- dictionary[ "KBD_DRIVERS" ] = "tty";
- dictionary[ "GFX_DRIVERS" ] = "linuxfb";
- dictionary[ "MOUSE_DRIVERS" ] = "pc linuxtp";
- dictionary[ "OPENGL" ] = "no";
- dictionary[ "DBUS"] = "no";
- dictionary[ "QT_INOTIFY" ] = "no";
- dictionary[ "QT_CUPS" ] = "no";
- dictionary[ "QT_GLIB" ] = "no";
- dictionary[ "QT_ICONV" ] = "no";
- dictionary[ "QT_EVDEV" ] = "no";
- dictionary[ "QT_MTDEV" ] = "no";
- dictionary[ "FONT_CONFIG" ] = "auto";
- dictionary[ "ANGLE" ] = "no";
-
- dictionary["DECORATIONS"] = "default windows styled";
- } else if (platform() == QNX) {
- dictionary[ "REDUCE_EXPORTS" ] = "yes";
- dictionary["STACK_PROTECTOR_STRONG"] = "auto";
- dictionary["SLOG2"] = "auto";
- dictionary["QNX_IMF"] = "auto";
- dictionary["PPS"] = "auto";
- dictionary["LGMON"] = "auto";
- dictionary["QT_XKBCOMMON"] = "no";
- dictionary[ "ANGLE" ] = "no";
- dictionary[ "DYNAMICGL" ] = "no";
- dictionary[ "FONT_CONFIG" ] = "auto";
- dictionary[ "ICU" ] = "auto";
- dictionary[ "POLL" ] = "poll";
- dictionary[ "ZLIB" ] = "system";
- } else if (platform() == ANDROID) {
- dictionary[ "REDUCE_EXPORTS" ] = "yes";
- dictionary[ "BUILD" ] = "release";
- dictionary[ "BUILDALL" ] = "no";
- dictionary[ "LARGE_FILE" ] = "no";
- dictionary[ "ANGLE" ] = "no";
- dictionary[ "DYNAMICGL" ] = "no";
- dictionary[ "REDUCE_RELOCATIONS" ] = "yes";
- dictionary[ "QT_GETIFADDRS" ] = "no";
- dictionary[ "QT_XKBCOMMON" ] = "no";
+ if (platform() == ANDROID)
dictionary["ANDROID_STYLE_ASSETS"] = "yes";
- dictionary[ "STYLE_ANDROID" ] = "yes";
- dictionary[ "POLL" ] = "poll";
- dictionary[ "ZLIB" ] = "system";
- }
-}
-
-// Output helper functions ---------------------------------[ Stop ]-
-
-
-bool Configure::displayHelp()
-{
- if (dictionary[ "HELP" ] == "yes") {
- desc("Usage: configure [options]\n\n", 0, 7);
-
- desc("Installation options:\n\n");
-
- desc("These are optional, but you may specify install directories.\n\n", 0, 1);
-
- desc( "-prefix <dir>", "The deployment directory, as seen on the target device.\n"
- "(default %CD%)\n");
-
- desc( "-extprefix <dir>", "The installation directory, as seen on the host machine.\n"
- "(default SYSROOT/PREFIX)\n");
-
- desc( "-hostprefix [dir]", "The installation directory for build tools running on the\n"
- "host machine. If [dir] is not given, the current build\n"
- "directory will be used. (default EXTPREFIX)\n");
-
- desc("You may use these to change the layout of the install. Note that all directories\n"
- "except -sysconfdir should be located under -prefix/-hostprefix:\n\n");
-
- desc( "-bindir <dir>", "User executables will be installed to <dir>\n(default PREFIX/bin)");
- desc( "-libdir <dir>", "Libraries will be installed to <dir>\n(default PREFIX/lib)");
- desc( "-headerdir <dir>", "Headers will be installed to <dir>\n(default PREFIX/include)");
- desc( "-archdatadir <dir>", "Architecture-dependent data used by Qt will be installed to <dir>\n(default PREFIX)");
- desc( "-libexecdir <dir>", "Program executables will be installed to <dir>\n(default ARCHDATADIR/bin)");
- desc( "-plugindir <dir>", "Plugins will be installed to <dir>\n(default ARCHDATADIR/plugins)");
- desc( "-importdir <dir>", "Imports for QML1 will be installed to <dir>\n(default ARCHDATADIR/imports)");
- desc( "-qmldir <dir>", "Imports for QML2 will be installed to <dir>\n(default ARCHDATADIR/qml)");
- desc( "-datadir <dir>", "Data used by Qt programs will be installed to <dir>\n(default PREFIX)");
- desc( "-docdir <dir>", "Documentation will be installed to <dir>\n(default DATADIR/doc)");
- desc( "-translationdir <dir>", "Translations of Qt programs will be installed to <dir>\n(default DATADIR/translations)");
- desc( "-examplesdir <dir>", "Examples will be installed to <dir>\n(default PREFIX/examples)");
- desc( "-testsdir <dir>", "Tests will be installed to <dir>\n(default PREFIX/tests)\n");
-
- desc( "-hostbindir <dir>", "Host executables will be installed to <dir>\n(default HOSTPREFIX/bin)");
- desc( "-hostlibdir <dir>", "Host libraries will be installed to <dir>\n(default HOSTPREFIX/lib)");
- desc( "-hostdatadir <dir>", "Data used by qmake will be installed to <dir>\n(default HOSTPREFIX)");
-
- desc("\nConfigure options:\n\n");
-
- desc(" The defaults (*) are usually acceptable. A plus (+) denotes a default value"
- " that needs to be evaluated. If the evaluation succeeds, the feature is"
- " included. Here is a short explanation of each option:\n\n", 0, 1);
-
- desc("BUILD", "release","-release", "Compile and link Qt with debugging turned off.");
- desc("BUILD", "debug", "-debug", "Compile and link Qt with debugging turned on.");
- desc("BUILDALL", "yes", "-debug-and-release", "Compile and link two Qt libraries, with and without debugging turned on.\n");
-
- desc("FORCEDEBUGINFO", "yes","-force-debug-info", "Create symbol files for release builds.");
- desc("SEPARATE_DEBUG_INFO", "yes","-separate-debug-info", "Strip debug information into a separate file.\n");
-
- desc("BUILDDEV", "yes", "-developer-build", "Compile and link Qt with Qt developer options (including auto-tests exporting)\n");
-
- desc("RELEASE_TOOLS", "yes", "-optimized-tools", "Build optimized host tools even in debug build.");
- desc("RELEASE_TOOLS", "no", "-no-optimized-tools", "Do not build optimized host tools even in debug build.\n");
-
- desc("OPENSOURCE", "opensource", "-opensource", "Compile and link the Open-Source Edition of Qt.");
- desc("COMMERCIAL", "commercial", "-commercial", "Compile and link the Commercial Edition of Qt.\n");
-
- desc( "-c++std <edition>", "Compile Qt with C++ standard edition (c++11, c++14, c++1z)\n"
- "Default: highest supported. This option is not supported for MSVC.\n");
-
- desc("USE_GOLD_LINKER", "yes", "-use-gold-linker", "Link using the GNU gold linker (gcc only).");
- desc("USE_GOLD_LINKER", "no", "-no-use-gold-linker", "Do not link using the GNU gold linker.\n");
-
- desc("ENABLE_NEW_DTAGS", "yes", "-enable-new-dtags", "Use new DTAGS for RPATH (Linux only).");
- desc("ENABLE_NEW_DTAGS", "no", "-disable-new-dtags", "Do not use new DTAGS for RPATH.\n");
-
- desc("SHARED", "yes", "-shared", "Create and use shared Qt libraries.");
- desc("SHARED", "no", "-static", "Create and use static Qt libraries.\n");
-
- desc("STATIC_RUNTIME", "no", "-static-runtime","Statically link the C/C++ runtime library.\n");
-
- desc("LTCG", "yes", "-ltcg", "Use Link Time Code Generation. (Release builds only)");
- desc("LTCG", "no", "-no-ltcg", "Do not use Link Time Code Generation.\n");
-
- desc( "-make <part>", "Add part to the list of parts to be built at make time");
- for (int i=0; i<defaultBuildParts.size(); ++i)
- desc( "", qPrintable(QString(" %1").arg(defaultBuildParts.at(i))), false, ' ');
- desc( "-nomake <part>", "Exclude part from the list of parts to be built.\n");
-
- desc( "-skip <module>", "Exclude an entire module from the build.\n");
-
- desc( "-no-compile-examples", "Install only the sources of examples.\n");
-
- desc("WIDGETS", "no", "-no-widgets", "Disable Qt Widgets module.\n");
- desc("GUI", "no", "-no-gui", "Disable Qt GUI module.\n");
-
- desc("ACCESSIBILITY", "no", "-no-accessibility", "Disable accessibility support.\n");
- desc( "", "Disabling accessibility is not recommended, as it will break QStyle\n"
- "and may break other internal parts of Qt.\n"
- "With this switch you create a source incompatible version of Qt,\n"
- "which is unsupported.\n");
- desc("ACCESSIBILITY", "yes", "-accessibility", "Enable accessibility support.\n");
-
- desc( "-no-sql-<driver>", "Disable SQL <driver> entirely, by default none are turned on.");
- desc( "-qt-sql-<driver>", "Enable a SQL <driver> in the Qt Library.");
- desc( "-plugin-sql-<driver>", "Enable SQL <driver> as a plugin to be linked to at run time.\n"
- "Available values for <driver>:");
- desc("SQL_MYSQL", "auto", "", " mysql", ' ');
- desc("SQL_PSQL", "auto", "", " psql", ' ');
- desc("SQL_OCI", "auto", "", " oci", ' ');
- desc("SQL_ODBC", "auto", "", " odbc", ' ');
- desc("SQL_TDS", "auto", "", " tds", ' ');
- desc("SQL_DB2", "auto", "", " db2", ' ');
- desc("SQL_SQLITE", "auto", "", " sqlite", ' ');
- desc("SQL_SQLITE2", "auto", "", " sqlite2", ' ');
- desc("SQL_IBASE", "auto", "", " ibase", ' ');
- desc( "", "(drivers marked with a '+' have been detected as available on this system)\n", false, ' ');
-
- desc( "-system-sqlite", "Use sqlite from the operating system.\n");
-
- desc("OPENGL", "no","-no-opengl", "Do not support OpenGL.");
- desc("OPENGL", "no","-opengl <api>", "Enable OpenGL support with specified API version.\n"
- "Available values for <api>:");
- desc("", "no", "", " desktop - Enable support for Desktop OpenGL", ' ');
- desc("", "no", "", " dynamic - Enable support for dynamically loaded OpenGL (either desktop or ES)", ' ');
- desc("OPENGL_ES_2", "yes", "", " es2 - Enable support for OpenGL ES 2.0\n", ' ');
-
- desc( "-force-asserts", "Activate asserts in release mode.\n");
- desc( "-platform <spec>", "The operating system and compiler you are building on.\n(default %QMAKESPEC%)\n");
- desc( "-xplatform <spec>", "The operating system and compiler you are cross compiling to.\n");
- desc( "", "See the README file for a list of supported operating systems and compilers.\n", false, ' ');
-
- desc( "-sysroot <dir>", "Sets <dir> as the target compiler's and qmake's sysroot and also sets pkg-config paths.");
- desc( "-no-gcc-sysroot", "When using -sysroot, it disables the passing of --sysroot to the compiler.\n");
-
- desc( "-qconfig <local>", "Use src/corelib/global/qconfig-<local>.h rather than the\n"
- "default 'full'.\n");
-
- desc("NIS", "no", "-no-nis", "Do not compile NIS support.");
- desc("NIS", "yes", "-nis", "Compile NIS support.\n");
-
- desc("QT_ICONV", "disable", "-no-iconv", "Do not enable support for iconv(3).");
- desc("QT_ICONV", "yes", "-iconv", "Enable support for iconv(3).");
- desc("QT_ICONV", "yes", "-sun-iconv", "Enable support for iconv(3) using sun-iconv.");
- desc("QT_ICONV", "yes", "-gnu-iconv", "Enable support for iconv(3) using gnu-libiconv.\n");
-
- desc("QT_EVDEV", "no", "-no-evdev", "Do not enable support for evdev.");
- desc("QT_EVDEV", "yes", "-evdev", "Enable support for evdev.");
-
- desc("QT_MTDEV", "no", "-no-mtdev", "Do not enable support for mtdev.");
- desc("QT_MTDEV", "yes", "-mtdev", "Enable support for mtdev.");
-
- desc("QT_INOTIFY", "yes", "-inotify", "Explicitly enable Qt inotify(7) support.");
- desc("QT_INOTIFY", "no", "-no-inotify", "Explicitly disable Qt inotify(7) support.\n");
-
- desc("QT_EVENTFD", "yes", "-eventfd", "Enable eventfd(7) support in the UNIX event loop.");
- desc("QT_EVENTFD", "no", "-no-eventfd", "Disable eventfd(7) support in the UNIX event loop.\n");
-
- desc("POSIX_IPC", "yes", "-posix-ipc", "Enable POSIX IPC.\n");
-
- desc("QT_GLIB", "yes", "-glib", "Compile Glib support.\n");
-
- desc("QT_INSTALL_SETTINGS", "auto", "-sysconfdir <dir>", "Settings used by Qt programs will be looked for in\n<dir>.\n");
-
- desc("SYSTEM_PROXIES", "yes", "-system-proxies", "Use system network proxies by default.");
- desc("SYSTEM_PROXIES", "no", "-no-system-proxies", "Do not use system network proxies by default.\n");
-
- desc("SCTP", "yes", "-sctp", "Compile SCTP support.");
- desc("SCTP", "no", "-no-sctp", "Do not compile SCTP network protocol support.\n");
-
- desc("WERROR", "yes", "-warnings-are-errors", "Make warnings be treated as errors.");
- desc("WERROR", "no", "-no-warnings-are-errors","Make warnings be treated normally.");
-
- desc( "-qtnamespace <name>", "Wraps all Qt library code in 'namespace name {...}'.");
- desc( "-qtlibinfix <infix>", "Renames all Qt* libs to Qt*<infix>.\n");
- desc( "-D <define>", "Add an explicit define to the preprocessor.");
- desc( "-I <includepath>", "Add an explicit include path.");
- desc( "-L <librarypath>", "Add an explicit library path.");
-
- desc("PCH", "no", "-no-pch", "Do not use precompiled header support.");
- desc("PCH", "yes", "-pch", "Use precopmiled header support.\n");
-
- desc( "-help, -h, -?", "Display this information.\n");
-
- // 3rd party stuff options go below here --------------------------------------------------------------------------------
- desc("Third Party Libraries:\n\n");
-
- desc("SYSTEM_ZLIB", "no", "-qt-zlib", "Use the zlib bundled with Qt.");
- desc("SYSTEM_ZLIB", "yes", "-system-zlib", "Use zlib from the operating system.\nSee http://www.gzip.org/zlib\n");
-
- desc("PCRE", "qt", "-qt-pcre", "Use the PCRE library bundled with Qt.");
- desc("PCRE", "system", "-system-pcre", "Use the PCRE library from the operating system.\nSee http://pcre.org/\n");
-
- desc("ICU", "yes", "-icu", "Use the ICU library.");
- desc("ICU", "no", "-no-icu", "Do not use the ICU library.\nSee http://site.icu-project.org/\n");
-
- desc("GIF", "no", "-no-gif", "Do not compile GIF reading support.\n");
-
- desc("LIBPNG", "no", "-no-libpng", "Do not compile PNG support.");
- desc("LIBPNG", "qt", "-qt-libpng", "Use the libpng bundled with Qt.");
- desc("LIBPNG", "system","-system-libpng", "Use libpng from the operating system.\nSee http://www.libpng.org/pub/png\n");
-
- desc("LIBJPEG", "no", "-no-libjpeg", "Do not compile JPEG support.");
- desc("LIBJPEG", "qt", "-qt-libjpeg", "Use the libjpeg bundled with Qt.");
- desc("LIBJPEG", "system","-system-libjpeg", "Use libjpeg from the operating system.\nSee http://www.ijg.org\n");
-
- desc("DOUBLECONVERSION", "no", "-no-doubleconversion", "Use sscanf_l and snprintf_l for (imprecise) double conversion.");
- desc("DOUBLECONVERSION", "qt", "-qt-doubleconversion", "Use the libdouble-conversion bundled with Qt.");
- desc("DOUBLECONVERSION", "system", "-system-doubleconversion", "Use the libdouble-conversion provided by the system.");
-
- desc("FREETYPE", "no", "-no-freetype", "Do not compile in Freetype2 support.");
- desc("FREETYPE", "yes", "-qt-freetype", "Use the libfreetype bundled with Qt.");
- desc("FREETYPE", "system","-system-freetype", "Use the libfreetype provided by the system.\n");
-
- desc("FONT_CONFIG", "yes", "-fontconfig", "Build with FontConfig support.");
- desc("FONT_CONFIG", "no", "-no-fontconfig", "Do not build with FontConfig support.\n");
-
- desc("HARFBUZZ", "no", "-no-harfbuzz", "Do not compile in HarfBuzz-NG support.");
- desc("HARFBUZZ", "qt", "-qt-harfbuzz", "Use HarfBuzz-NG bundled with Qt to do text shaping.\n"
- "It can still be disabled by setting\n"
- "the QT_HARFBUZZ environment variable to \"old\".");
- desc("HARFBUZZ", "system","-system-harfbuzz", "Use HarfBuzz-NG from the operating system\n"
- "to do text shaping. It can still be disabled\n"
- "by setting the QT_HARFBUZZ environment variable to \"old\".\n"
- "See http://www.harfbuzz.org\n");
-
- if (platform() == QNX) {
- desc("SLOG2", "yes", "-slog2", "Compile with slog2 support.");
- desc("SLOG2", "no", "-no-slog2", "Do not compile with slog2 support.");
- desc("QNX_IMF", "yes", "-imf", "Compile with imf support.");
- desc("QNX_IMF", "no", "-no-imf", "Do not compile with imf support.");
- desc("PPS", "yes", "-pps", "Compile with PPS support.");
- desc("PPS", "no", "-no-pps", "Do not compile with PPS support.");
- desc("LGMON", "yes", "-lgmon", "Compile with lgmon support.");
- desc("LGMON", "no", "-no-lgmon", "Do not compile with lgmon support.\n");
- }
-
- desc("ANGLE", "yes", "-angle", "Use the ANGLE implementation of OpenGL ES 2.0.");
- desc("ANGLE", "no", "-no-angle", "Do not use ANGLE.\nSee https://chromium.googlesource.com/angle/angle/+/master/README.md\n");
- // Qt\Windows only options go below here --------------------------------------------------------------------------------
- desc("\nQt for Windows only:\n\n");
-
- desc("INCREDIBUILD_XGE", "no", "-no-incredibuild-xge", "Do not add IncrediBuild XGE distribution commands to custom build steps.");
- desc("INCREDIBUILD_XGE", "yes", "-incredibuild-xge", "Add IncrediBuild XGE distribution commands to custom build steps. This will distribute MOC and UIC steps, and other custom buildsteps which are added to the INCREDIBUILD_XGE variable.\n(The IncrediBuild distribution commands are only added to Visual Studio projects)\n");
-
- desc("PLUGIN_MANIFESTS", "no", "-no-plugin-manifests", "Do not embed manifests in plugins.");
- desc("PLUGIN_MANIFESTS", "yes", "-plugin-manifests", "Embed manifests in plugins.\n");
- desc("BUILD_QMAKE", "no", "-no-qmake", "Do not compile qmake.");
- desc("BUILD_QMAKE", "yes", "-qmake", "Compile qmake.\n");
-
- desc( "-qreal [double|float]", "typedef qreal to the specified type. The default is double.\n"
- "Note that changing this flag affects binary compatibility.\n");
-
- desc("RTTI", "no", "-no-rtti", "Do not compile runtime type information.");
- desc("RTTI", "yes", "-rtti", "Compile runtime type information.");
- desc("STRIP", "no", "-no-strip", "Do not strip libraries and executables of debug info when installing.");
- desc("STRIP", "yes", "-strip", "Strip libraries and executables of debug info when installing.\n");
-
- desc("SSE2", "no", "-no-sse2", "Do not compile with use of SSE2 instructions.");
- desc("SSE2", "yes", "-sse2", "Compile with use of SSE2 instructions.");
- desc("SSE3", "no", "-no-sse3", "Do not compile with use of SSE3 instructions.");
- desc("SSE3", "yes", "-sse3", "Compile with use of SSE3 instructions.");
- desc("SSSE3", "no", "-no-ssse3", "Do not compile with use of SSSE3 instructions.");
- desc("SSSE3", "yes", "-ssse3", "Compile with use of SSSE3 instructions.");
- desc("SSE4_1", "no", "-no-sse4.1", "Do not compile with use of SSE4.1 instructions.");
- desc("SSE4_1", "yes", "-sse4.1", "Compile with use of SSE4.1 instructions.");
- desc("SSE4_2", "no", "-no-sse4.2", "Do not compile with use of SSE4.2 instructions.");
- desc("SSE4_2", "yes", "-sse4.2", "Compile with use of SSE4.2 instructions.");
- desc("AVX", "no", "-no-avx", "Do not compile with use of AVX instructions.");
- desc("AVX", "yes", "-avx", "Compile with use of AVX instructions.");
- desc("AVX2", "no", "-no-avx2", "Do not compile with use of AVX2 instructions.");
- desc("AVX2", "yes", "-avx2", "Compile with use of AVX2 instructions.\n");
- desc("AVX512", "no", "-no-avx512", "Do not compile with use of AVX512 instructions.");
- desc("AVX512", "yes", "-avx512", "Compile with use of AVX512 instructions.\n");
- desc("SSL", "no", "-no-ssl", "Do not compile support for SSL.");
- desc("SSL", "yes", "-ssl", "Enable run-time SSL support.");
- desc("OPENSSL", "no", "-no-openssl", "Do not compile support for OpenSSL.");
- desc("OPENSSL", "yes", "-openssl", "Enable run-time OpenSSL support.");
- desc("OPENSSL", "linked","-openssl-linked", "Enable linked OpenSSL support.\n");
- desc("LIBPROXY", "no", "-no-libproxy", "Do not compile in libproxy support.");
- desc("LIBPROXY", "yes", "-libproxy", "Compile in libproxy support (for cross compilation targets).\n");
- desc("DBUS", "no", "-no-dbus", "Do not compile in D-Bus support.");
- desc("DBUS", "linked", "-dbus-linked", "Compile in D-Bus support and link to libdbus-1.\n");
- desc("DBUS", "runtime", "-dbus-runtime", "Compile in D-Bus support and load libdbus-1\ndynamically.");
- desc("WMF_BACKEND", "no","-no-wmf-backend", "Do not compile in the windows media foundation backend\ninto Qt Multimedia.");
- desc("WMF_BACKEND", "yes","-wmf-backend", "Compile in the windows media foundation backend into Qt Multimedia.\n");
- desc("QML_DEBUG", "no", "-no-qml-debug", "Do not build the in-process QML debugging support.");
- desc("QML_DEBUG", "yes", "-qml-debug", "Build the in-process QML debugging support.\n");
- desc("DIRECTWRITE", "no", "-no-directwrite", "Do not build support for DirectWrite font rendering.");
- desc("DIRECTWRITE", "yes", "-directwrite", "Build support for DirectWrite font rendering.\n");
-
- desc("DIRECT2D", "no", "-no-direct2d", "Do not build the Direct2D platform plugin.");
- desc("DIRECT2D", "yes", "-direct2d", "Build the Direct2D platform plugin (experimental,\n"
- "requires Direct2D availability on target systems,\n"
- "e.g. Windows 7 with Platform Update, Windows 8, etc.)\n");
-
- desc( "-no-style-<style>", "Disable <style> entirely.");
- desc( "-qt-style-<style>", "Enable <style> in the Qt Library.\nAvailable styles: ");
-
- desc("STYLE_WINDOWS", "yes", "", " windows", ' ');
- desc("STYLE_WINDOWSXP", "auto", "", " windowsxp", ' ');
- desc("STYLE_WINDOWSVISTA", "auto", "", " windowsvista", ' ');
- desc("STYLE_FUSION", "yes", "", " fusion", ' ');
- desc("NATIVE_GESTURES", "no", "-no-native-gestures", "Do not use native gestures on Windows 7.");
- desc("NATIVE_GESTURES", "yes", "-native-gestures", "Use native gestures on Windows 7.\n");
- desc("MSVC_MP", "no", "-no-mp", "Do not use multiple processors for compiling with MSVC");
- desc("MSVC_MP", "yes", "-mp", "Use multiple processors for compiling with MSVC (-MP).\n");
-
- desc( "-redo", "Run configure with the same parameters as last time.\n");
- desc( "-v, -verbose", "Run configure tests with verbose output.\n");
- return true;
- }
- return false;
-}
-
-// Locate a file and return its containing directory.
-QString Configure::locateFile(const QString &fileName) const
-{
- const QString mkspec = dictionary.contains(QStringLiteral("XQMAKESPEC"))
- ? dictionary[QStringLiteral("XQMAKESPEC")] : dictionary[QStringLiteral("QMAKESPEC")];
- const QString file = fileName.toLower();
- QStringList pathList;
- if (file.endsWith(".h")) {
- static const QStringList headerPaths =
- Environment::headerPaths(Environment::compilerFromQMakeSpec(mkspec));
- pathList = qmakeIncludes;
- pathList += headerPaths;
- } else if (file.endsWith(".lib") || file.endsWith(".a")) {
- static const QStringList libPaths =
- Environment::libraryPaths(Environment::compilerFromQMakeSpec(mkspec));
- pathList = libPaths;
- } else {
- // Fallback for .exe and .dll (latter are not covered by QStandardPaths).
- static const QStringList exePaths = Environment::path();
- pathList = exePaths;
- }
- return Environment::findFileInPaths(file, pathList);
-}
-
-/*!
- Default value for options marked as "auto" if the test passes.
- (Used both by the autoDetection() below, and the desc() function
- to mark (+) the default option of autodetecting options.
-*/
-QString Configure::defaultTo(const QString &option)
-{
- // We prefer using the system version of the 3rd party libs
- if (option == "PCRE"
- || option == "LIBJPEG"
- || option == "LIBPNG")
- return "system";
-
- // These database drivers and image formats can be built-in or plugins.
- // Prefer plugins when Qt is shared.
- if (dictionary[ "SHARED" ] == "yes") {
- if (option == "SQL_MYSQL"
- || option == "SQL_MYSQL"
- || option == "SQL_ODBC"
- || option == "SQL_OCI"
- || option == "SQL_PSQL"
- || option == "SQL_TDS"
- || option == "SQL_DB2"
- || option == "SQL_SQLITE"
- || option == "SQL_SQLITE2"
- || option == "SQL_IBASE")
- return "yes";
- }
-
- // By default we do not want to compile OCI driver when compiling with
- // MinGW, due to lack of such support from Oracle. It prob. won't work.
- // (Customer may force the use though)
- if (dictionary["QMAKESPEC"].endsWith("-g++")
- && option == "SQL_OCI")
- return "no";
-
- // keep 'auto' default for msvc, since we can't set the language supported
- if (option == "C++STD"
- && dictionary["QMAKESPEC"].contains("msvc"))
- return "auto";
-
- if (option == "SYNCQT"
- && (!QFile::exists(sourcePath + "/.git")))
- return "no";
-
- return "yes";
-}
-
-bool Configure::checkAngleAvailability(QString *errorMessage /* = 0 */) const
-{
- // 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.
- const QString directXSdk = Environment::detectDirectXSdk();
- const Compiler compiler = Environment::compilerFromQMakeSpec(dictionary[QStringLiteral("QMAKESPEC")]);
- const QString compilerHeader = QStringLiteral("d3dcompiler.h");
- if (!findFile(compilerHeader)) {
- if (errorMessage)
- *errorMessage = QString::fromLatin1("The header '%1' could not be found.").arg(compilerHeader);
- return false;
- }
- if (dictionary["SSE2"] != "no") {
- const QString intrinHeader = QStringLiteral("intrin.h"); // Not present on MinGW-32
- if (!findFile(intrinHeader)) {
- if (errorMessage)
- *errorMessage = QString::fromLatin1("The header '%1' required for SSE2 could not be found.").arg(intrinHeader);
- return false;
- }
- }
-
- const QString directXLibrary = QStringLiteral("d3d11.lib"); // Ensures at least the June 2010 DXSDK is present
- if (!findFile(directXLibrary)) {
- if (errorMessage)
- *errorMessage = QString::fromLatin1("The library '%1' could not be found.").arg(directXLibrary);
- return false;
- }
- const QString fxcBinary = QStringLiteral("fxc.exe");
- QStringList additionalPaths;
- if (!directXSdk.isEmpty())
- additionalPaths.push_back(directXSdk + QStringLiteral("/Utilities/bin/x86"));
- QString fxcPath = QStandardPaths::findExecutable(fxcBinary, additionalPaths);
- if (fxcPath.isEmpty()) {
- if (errorMessage)
- *errorMessage = QString::fromLatin1("The shader compiler '%1' could not be found.").arg(fxcBinary);
- return false;
- }
- return true;
-}
-
-QString Configure::checkAvx512Availability()
-{
- static const char avx512features[][5] = { "cd", "er", "pf", "bw", "dq", "vl", "ifma", "vbmi" };
-
- // try AVX512 Foundation. No Foundation, nothing else works.
- if (!tryCompileProject("common/avx512", "AVX512=F"))
- return QString();
-
- QString available = "avx512f";
- for (size_t i = 0; i < sizeof(avx512features)/sizeof(avx512features[0]); ++i) {
- if (tryCompileProject("common/avx512", QStringLiteral("AVX512=%0").arg(avx512features[i]).toUpper())) {
- available += " avx512";
- available += avx512features[i];
- }
- }
- return available;
-}
-
-/*!
- Checks the system for the availability of a feature.
- Returns true if the feature is available, else false.
-*/
-
-bool Configure::checkAvailability(const QString &part)
-{
- bool available = false;
- if (part == "STYLE_WINDOWSXP")
- available = (platform() == WINDOWS) && findFile("uxtheme.h");
-
- else if (part == "OBJCOPY")
- available = tryCompileProject("unix/objcopy");
-
- else if (part == "ATOMIC64")
- available = tryCompileProject("common/atomic64");
-
- else if (part == "ATOMIC64-LIBATOMIC")
- available = tryCompileProject("common/atomic64", "LIBS+=-latomic");
-
- else if (part == "ATOMICFPTR")
- available = tryCompileProject("common/atomicfptr");
-
- else if (part == "SYSTEM_ZLIB")
- available = findFile("zlib.h");
-
- else if (part == "PCRE")
- available = findFile("pcre.h");
-
- else if (part == "ICU")
- available = tryCompileProject("unix/icu");
-
- else if (part == "HARFBUZZ")
- available = tryCompileProject("unix/harfbuzz");
-
- else if (part == "LIBJPEG")
- available = findFile("jpeglib.h");
- else if (part == "LIBPNG")
- available = findFile("png.h");
- else if (part == "SQL_MYSQL")
- available = findFile("mysql.h") && findFile("libmySQL.lib");
- else if (part == "SQL_ODBC")
- available = findFile("sql.h") && findFile("sqlext.h") && findFile("odbc32.lib");
- else if (part == "SQL_OCI")
- available = findFile("oci.h") && findFile("oci.lib");
- else if (part == "SQL_PSQL")
- available = findFile("libpq-fe.h") && findFile("libpq.lib") && findFile("ws2_32.lib") && findFile("advapi32.lib");
- else if (part == "SQL_TDS")
- available = findFile("sybfront.h") && findFile("sybdb.h") && findFile("ntwdblib.lib");
- else if (part == "SQL_DB2")
- available = findFile("sqlcli.h") && findFile("sqlcli1.h") && findFile("db2cli.lib");
- else if (part == "SQL_SQLITE")
- available = true; // Built in, we have a fork
- else if (part == "SQL_SQLITE_LIB") {
- if (dictionary[ "SQL_SQLITE_LIB" ] == "system") {
- if (platform() == QNX) {
- available = true;
- dictionary[ "QMAKE_LIBS_SQLITE" ] += "-lsqlite3 -lz";
- } else {
- available = findFile("sqlite3.h") && findFile("sqlite3.lib");
- if (available)
- dictionary[ "QMAKE_LIBS_SQLITE" ] += "sqlite3.lib";
- }
- } else {
- available = true;
- }
- } else if (part == "SQL_SQLITE2")
- available = findFile("sqlite.h") && findFile("sqlite.lib");
- else if (part == "SQL_IBASE")
- available = findFile("ibase.h") && (findFile("gds32_ms.lib") || findFile("gds32.lib"));
- else if (part == "SSE2")
- available = tryCompileProject("common/sse2");
- else if (part == "SSE3")
- available = tryCompileProject("common/sse3");
- else if (part == "SSSE3")
- available = tryCompileProject("common/ssse3");
- else if (part == "SSE4_1")
- available = tryCompileProject("common/sse4_1");
- else if (part == "SSE4_2")
- available = tryCompileProject("common/sse4_2");
- else if (part == "AVX")
- available = tryCompileProject("common/avx");
- else if (part == "AVX2")
- available = tryCompileProject("common/avx2");
- else if (part == "OPENSSL")
- available = findFile("openssl\\ssl.h");
- else if (part == "LIBPROXY")
- available = dictionary.contains("XQMAKESPEC") && tryCompileProject("common/libproxy");
- else if (part == "DBUS")
- available = findFile("dbus\\dbus.h");
- else if (part == "INCREDIBUILD_XGE") {
- available = !QStandardPaths::findExecutable(QStringLiteral("BuildConsole.exe")).isEmpty()
- && !QStandardPaths::findExecutable(QStringLiteral("xgConsole.exe")).isEmpty();
- } else if (part == "WMSDK") {
- available = findFile("wmsdk.h");
- } else if (part == "WMF_BACKEND") {
- available = findFile("mfapi.h") && findFile("mf.lib");
- } else if (part == "DIRECTWRITE") {
- available = tryCompileProject("win/directwrite");
- } else if (part == "DIRECTWRITE2") {
- available = tryCompileProject("win/directwrite2");
- } else if (part == "DIRECT2D") {
- available = tryCompileProject("qpa/direct2d");
- } else if (part == "ICONV") {
- available = tryCompileProject("unix/iconv") || tryCompileProject("unix/gnu-libiconv");
- } else if (part == "EVDEV") {
- available = tryCompileProject("unix/evdev");
- } else if (part == "MTDEV") {
- available = tryCompileProject("unix/mtdev");
- } else if (part == "TSLIB") {
- available = tryCompileProject("unix/tslib");
- } else if (part == "INOTIFY") {
- available = tryCompileProject("unix/inotify");
- } else if (part == "QT_EVENTFD") {
- available = tryCompileProject("unix/eventfd");
- } else if (part == "CUPS") {
- available = (platform() != WINDOWS) && (platform() != WINDOWS_RT) && tryCompileProject("unix/cups");
- } else if (part == "STACK_PROTECTOR_STRONG") {
- available = (platform() == QNX) && compilerSupportsFlag("qcc -fstack-protector-strong");
- } else if (part == "SLOG2") {
- available = tryCompileProject("unix/slog2");
- } else if (part == "QNX_IMF") {
- available = tryCompileProject("unix/qqnx_imf");
- } else if (part == "PPS") {
- available = (platform() == QNX) && tryCompileProject("unix/pps");
- } else if (part == "LGMON") {
- available = (platform() == QNX) && tryCompileProject("unix/lgmon");
- } else if (part == "SCTP") {
- available = tryCompileProject("unix/sctp");
- } else if (part == "NEON") {
- available = dictionary["QT_CPU_FEATURES"].contains("neon");
- } else if (part == "FONT_CONFIG") {
- available = tryCompileProject("unix/fontconfig");
- } else if (part == "DOUBLECONVERSION") {
- available = tryCompileProject("unix/doubleconversion");
- }
-
- return available;
-}
-
-/*
- Autodetect options marked as "auto".
-*/
-void Configure::autoDetection()
-{
- cout << "Running configuration tests..." << endl;
-
- // Auto-detect CPU architectures.
- detectArch();
-
- if (dictionary["C++STD"] == "auto" && !dictionary["QMAKESPEC"].contains("msvc")) {
- if (!tryCompileProject("common/c++14")) {
- dictionary["C++STD"] = "c++11";
- } else if (!tryCompileProject("common/c++1z")) {
- dictionary["C++STD"] = "c++14";
- } else {
- dictionary["C++STD"] = "c++1z";
- }
- }
-
- if (dictionary["ATOMIC64"] == "auto")
- dictionary["ATOMIC64"] = checkAvailability("ATOMIC64") ? "yes" :
- checkAvailability("ATOMIC64-LIBATOMIC") ? "libatomic" : "no";
-
- // special case:
- if (!checkAvailability("ATOMICFPTR")) {
- dictionary["DONE"] = "error";
- cout << "ERROR: detected an std::atomic implementation that fails for function pointers." << endl
- << "Please apply the patch corresponding to your Standard Library vendor, found in" << endl
- << sourcePath << "/config.tests/common/atomicfptr" << endl;
- return;
- }
-
- // Style detection
- if (dictionary["STYLE_WINDOWSXP"] == "auto")
- dictionary["STYLE_WINDOWSXP"] = checkAvailability("STYLE_WINDOWSXP") ? defaultTo("STYLE_WINDOWSXP") : "no";
- if (dictionary["STYLE_WINDOWSVISTA"] == "auto") // Vista style has the same requirements as XP style
- dictionary["STYLE_WINDOWSVISTA"] = checkAvailability("STYLE_WINDOWSXP") ? defaultTo("STYLE_WINDOWSVISTA") : "no";
-
- // Compression detection
- if (dictionary["SYSTEM_ZLIB"] == "auto")
- dictionary["SYSTEM_ZLIB"] = checkAvailability("SYSTEM_ZLIB") ? "yes" : "no";
-
- // PCRE detection
- if (dictionary["PCRE"] == "auto")
- dictionary["PCRE"] = checkAvailability("PCRE") ? defaultTo("PCRE") : "qt";
-
- // ICU detection
- if (dictionary["ICU"] == "auto")
- dictionary["ICU"] = checkAvailability("ICU") ? "yes" : "no";
-
- // ANGLE detection
- if (dictionary["ANGLE"] == "auto") {
- if (dictionary["OPENGL_ES_2"] == "yes" || dictionary["DYNAMICGL"] == "yes") {
- QString err;
- dictionary["ANGLE"] = checkAngleAvailability(&err) ? "yes" : "no";
- dictionary["ANGLE_FROM"] = "detected";
- dictionary["ANGLE_ERR"] = err;
- } else {
- dictionary["ANGLE"] = "no";
- }
- }
-
- // Image format detection
- if (dictionary["LIBJPEG"] == "auto")
- dictionary["LIBJPEG"] = checkAvailability("LIBJPEG") ? defaultTo("LIBJPEG") : "qt";
- if (dictionary["LIBPNG"] == "auto")
- dictionary["LIBPNG"] = checkAvailability("LIBPNG") ? defaultTo("LIBPNG") : "qt";
-
- // SQL detection (not on by default)
- if (dictionary["SQL_MYSQL"] == "auto")
- dictionary["SQL_MYSQL"] = checkAvailability("SQL_MYSQL") ? defaultTo("SQL_MYSQL") : "no";
- if (dictionary["SQL_ODBC"] == "auto")
- dictionary["SQL_ODBC"] = checkAvailability("SQL_ODBC") ? defaultTo("SQL_ODBC") : "no";
- if (dictionary["SQL_OCI"] == "auto")
- dictionary["SQL_OCI"] = checkAvailability("SQL_OCI") ? defaultTo("SQL_OCI") : "no";
- if (dictionary["SQL_PSQL"] == "auto")
- dictionary["SQL_PSQL"] = checkAvailability("SQL_PSQL") ? defaultTo("SQL_PSQL") : "no";
- if (dictionary["SQL_TDS"] == "auto")
- dictionary["SQL_TDS"] = checkAvailability("SQL_TDS") ? defaultTo("SQL_TDS") : "no";
- if (dictionary["SQL_DB2"] == "auto")
- dictionary["SQL_DB2"] = checkAvailability("SQL_DB2") ? defaultTo("SQL_DB2") : "no";
- if (dictionary["SQL_SQLITE"] == "auto")
- dictionary["SQL_SQLITE"] = checkAvailability("SQL_SQLITE") ? defaultTo("SQL_SQLITE") : "no";
- if (dictionary["SQL_SQLITE_LIB"] == "system")
- if (!checkAvailability("SQL_SQLITE_LIB"))
- dictionary["SQL_SQLITE_LIB"] = "no";
- if (dictionary["SQL_SQLITE2"] == "auto")
- dictionary["SQL_SQLITE2"] = checkAvailability("SQL_SQLITE2") ? defaultTo("SQL_SQLITE2") : "no";
- if (dictionary["SQL_IBASE"] == "auto")
- dictionary["SQL_IBASE"] = checkAvailability("SQL_IBASE") ? defaultTo("SQL_IBASE") : "no";
- if (dictionary["SSE2"] == "auto")
- dictionary["SSE2"] = checkAvailability("SSE2") ? "yes" : "no";
- if (dictionary["SSE3"] == "auto")
- dictionary["SSE3"] = checkAvailability("SSE3") ? "yes" : "no";
- if (dictionary["SSSE3"] == "auto")
- dictionary["SSSE3"] = checkAvailability("SSSE3") ? "yes" : "no";
- if (dictionary["SSE4_1"] == "auto")
- dictionary["SSE4_1"] = checkAvailability("SSE4_1") ? "yes" : "no";
- if (dictionary["SSE4_2"] == "auto")
- dictionary["SSE4_2"] = checkAvailability("SSE4_2") ? "yes" : "no";
- if (dictionary["AVX"] == "auto")
- dictionary["AVX"] = checkAvailability("AVX") ? "yes" : "no";
- if (dictionary["AVX2"] == "auto")
- dictionary["AVX2"] = checkAvailability("AVX2") ? "yes" : "no";
- if (dictionary["AVX512"] == "auto")
- dictionary["AVX512"] = checkAvx512Availability();
- if (dictionary["NEON"] == "auto")
- dictionary["NEON"] = checkAvailability("NEON") ? "yes" : "no";
- if (dictionary["SSL"] == "auto") {
- if (platform() == WINDOWS_RT) {
- dictionary["SSL"] = "yes";
- } else {
- // On Desktop Windows openssl and ssl always have the same value (for now). OpenSSL is
- // the only backend and if it is available and should be built, that also means that
- // SSL support in general is enabled.
- if (dictionary["OPENSSL"] == "auto")
- dictionary["OPENSSL"] = checkAvailability("OPENSSL") ? "yes" : "no";
- dictionary["SSL"] = dictionary["OPENSSL"];
- }
- }
- if (dictionary["OPENSSL"] == "auto")
- dictionary["OPENSSL"] = checkAvailability("OPENSSL") ? "yes" : "no";
- if (dictionary["LIBPROXY"] == "auto")
- dictionary["LIBPROXY"] = checkAvailability("LIBPROXY") ? "yes" : "no";
- if (dictionary["DBUS"] == "auto")
- dictionary["DBUS"] = checkAvailability("DBUS") ? "linked" : "runtime";
- if (dictionary["QML_DEBUG"] == "auto")
- dictionary["QML_DEBUG"] = dictionary["QML"] == "yes" ? "yes" : "no";
- if (dictionary["WMF_BACKEND"] == "auto")
- dictionary["WMF_BACKEND"] = checkAvailability("WMF_BACKEND") ? "yes" : "no";
- if (dictionary["WMSDK"] == "auto")
- dictionary["WMSDK"] = checkAvailability("WMSDK") ? "yes" : "no";
-
- // Detection of IncrediBuild buildconsole
- if (dictionary["INCREDIBUILD_XGE"] == "auto")
- dictionary["INCREDIBUILD_XGE"] = checkAvailability("INCREDIBUILD_XGE") ? "yes" : "no";
-
- // Detection of iconv support
- if (dictionary["QT_ICONV"] == "auto")
- dictionary["QT_ICONV"] = checkAvailability("ICONV") ? "yes" : "no";
-
- // Detection of evdev support
- if (dictionary["QT_EVDEV"] == "auto")
- dictionary["QT_EVDEV"] = checkAvailability("EVDEV") ? "yes" : "no";
-
- // Detection of mtdev support
- if (dictionary["QT_MTDEV"] == "auto")
- dictionary["QT_MTDEV"] = checkAvailability("MTDEV") ? "yes" : "no";
-
- // Detection of tslib support
- if (dictionary["QT_TSLIB"] == "auto")
- dictionary["QT_TSLIB"] = checkAvailability("TSLIB") ? "yes" : "no";
-
- // Detection of inotify
- if (dictionary["QT_INOTIFY"] == "auto")
- dictionary["QT_INOTIFY"] = checkAvailability("INOTIFY") ? "yes" : "no";
-
- // Detection of cups support
- if (dictionary["QT_CUPS"] == "auto")
- dictionary["QT_CUPS"] = checkAvailability("CUPS") ? "yes" : "no";
-
- // Detection of -fstack-protector-strong support
- if (dictionary["STACK_PROTECTOR_STRONG"] == "auto")
- dictionary["STACK_PROTECTOR_STRONG"] = checkAvailability("STACK_PROTECTOR_STRONG") ? "yes" : "no";
-
- if (platform() == QNX && dictionary["SLOG2"] == "auto") {
- dictionary["SLOG2"] = checkAvailability("SLOG2") ? "yes" : "no";
- }
-
- if (platform() == QNX && dictionary["QNX_IMF"] == "auto") {
- dictionary["QNX_IMF"] = checkAvailability("QNX_IMF") ? "yes" : "no";
- }
-
- if (dictionary["PPS"] == "auto") {
- dictionary["PPS"] = checkAvailability("PPS") ? "yes" : "no";
- }
-
- if (platform() == QNX && dictionary["LGMON"] == "auto") {
- dictionary["LGMON"] = checkAvailability("LGMON") ? "yes" : "no";
- }
-
- if (dictionary["SCTP"] == "auto") {
- dictionary["SCTP"] = checkAvailability("SCTP") ? "yes" : "no";
- }
-
- if (dictionary["QT_EVENTFD"] == "auto")
- dictionary["QT_EVENTFD"] = checkAvailability("QT_EVENTFD") ? "yes" : "no";
-
- if (dictionary["FONT_CONFIG"] == "auto")
- dictionary["FONT_CONFIG"] = checkAvailability("FONT_CONFIG") ? "yes" : "no";
-
- if ((dictionary["FONT_CONFIG"] == "yes") && (dictionary["FREETYPE_FROM"] == "default"))
- dictionary["FREETYPE"] = "system";
-
- if (dictionary["DOUBLECONVERSION"] == "auto")
- dictionary["DOUBLECONVERSION"] = checkAvailability("DOUBLECONVERSION") ? "system" : "qt";
-
- if (dictionary["DIRECTWRITE"] == "auto")
- dictionary["DIRECTWRITE"] = checkAvailability("DIRECTWRITE") ? "yes" : "no";
-
- if (dictionary["DIRECTWRITE"] == "no")
- dictionary["DIRECTWRITE2"] = "no";
- else if (dictionary["DIRECTWRITE2"] == "auto")
- dictionary["DIRECTWRITE2"] = checkAvailability("DIRECTWRITE2") ? "yes" : "no";
-
- // Mark all unknown "auto" to the default value..
- for (QMap<QString,QString>::iterator i = dictionary.begin(); i != dictionary.end(); ++i) {
- if (i.value() == "auto")
- i.value() = defaultTo(i.key());
- }
-
- cout << "Done running configuration tests." << endl;
-}
-
-bool Configure::verifyConfiguration()
-{
- bool prompt = false;
- if (dictionary["C++STD"] != "auto"
- && dictionary["QMAKESPEC"].contains("msvc")) {
- cout << "WARNING: It is not possible to change the C++ standard edition with MSVC compilers. "
- "Therefore, the option -c++std " << dictionary["C++STD"] << " was ignored." << endl << endl;
- dictionary["C++STD"] = "auto";
- }
-
- if (dictionary["STATIC_RUNTIME"] == "yes" && dictionary["SHARED"] == "yes") {
- cout << "ERROR: -static-runtime requires -static" << endl << endl;
- dictionary[ "DONE" ] = "error";
- }
-
- if (dictionary["SEPARATE_DEBUG_INFO"] == "yes") {
- if (dictionary[ "SHARED" ] == "no") {
- cout << "ERROR: -separate-debug-info is incompatible with -static" << endl << endl;
- dictionary[ "DONE" ] = "error";
- } else if (dictionary[ "BUILD" ] != "debug"
- && dictionary[ "BUILDALL" ] == "no"
- && dictionary[ "FORCEDEBUGINFO" ] == "no") {
- cout << "ERROR: -separate-debug-info needs -debug, -debug-and-release, or -force-debug-info" << endl << endl;
- dictionary[ "DONE" ] = "error";
- } else if (dictionary["SEPARATE_DEBUG_INFO"] == "yes" && !checkAvailability("OBJCOPY")) {
- cout << "ERROR: -separate-debug-info was requested but this binutils does not support it." << endl;
- dictionary[ "DONE" ] = "error";
- }
- }
-
- if (dictionary["SQL_SQLITE_LIB"] == "no" && dictionary["SQL_SQLITE"] != "no") {
- cout << "WARNING: Configure could not detect the presence of a system SQLite3 lib." << endl
- << "Configure will therefore continue with the SQLite3 lib bundled with Qt." << endl;
- dictionary["SQL_SQLITE_LIB"] = "qt"; // Set to Qt's bundled lib an continue
- prompt = true;
- }
- if (dictionary["QMAKESPEC"].endsWith("-g++")
- && dictionary["SQL_OCI"] != "no") {
- cout << "WARNING: Qt does not support compiling the Oracle database driver with" << endl
- << "MinGW, due to lack of such support from Oracle. Consider disabling the" << endl
- << "Oracle driver, as the current build will most likely fail." << endl;
- prompt = true;
- }
- if (0 != dictionary["ARM_FPU_TYPE"].size()) {
- QStringList l= QStringList()
- << "softvfp"
- << "softvfp+vfpv2"
- << "vfpv2";
- if (!(l.contains(dictionary["ARM_FPU_TYPE"])))
- cout << QString("WARNING: Using unsupported fpu flag: %1").arg(dictionary["ARM_FPU_TYPE"]) << endl;
- }
- if (dictionary["DIRECTWRITE"] == "yes" && !checkAvailability("DIRECTWRITE")) {
- cout << "WARNING: To be able to compile the DirectWrite font engine you will" << endl
- << "need the Microsoft DirectWrite and Microsoft Direct2D development" << endl
- << "files such as headers and libraries." << endl;
- prompt = true;
- }
-
- if (dictionary["DIRECT2D"] == "yes" && !checkAvailability("DIRECT2D")) {
- cout << "WARNING: To be able to build the Direct2D platform plugin you will" << endl
- << "need the Microsoft DirectWrite and Microsoft Direct2D development" << endl
- << "files such as headers and libraries." << endl;
- prompt = true;
- }
-
- if (dictionary["ANGLE"] == "no") {
- if (dictionary["ANGLE_FROM"] == "detected") {
- QString errorMessage = dictionary["ANGLE_ERR"];
- cout << "WARNING: The DirectX SDK could not be detected:" << endl
- << " " << qPrintable(errorMessage) << endl
- << "Disabling the ANGLE backend." << endl;
- prompt = true;
- }
- if (dictionary["OPENGL_ES_2"] == "yes"
- && (platform() == WINDOWS || platform() == WINDOWS_RT)) {
- cout << endl << "WARNING: Using OpenGL ES 2.0 without ANGLE." << endl
- << "Specify -opengl desktop to use Open GL." << endl
- << "The build will most likely fail." << endl;
- prompt = true;
- }
- } else if (dictionary["ANGLE_FROM"] == "commandline") {
- QString errorMessage;
- if (!checkAngleAvailability(&errorMessage)) {
- cout << "WARNING: ANGLE specified, but the DirectX SDK could not be detected:" << endl
- << " " << qPrintable(errorMessage) << endl
- << "The build will most likely fail." << endl;
- }
- }
-
- if (dictionary["OPENGL"] == "no" || dictionary["OPENGL_ES_2"] == "no") {
- if (dictionary.value("XQMAKESPEC").startsWith("winphone") ||
- dictionary.value("XQMAKESPEC").startsWith("winrt")) {
- cout << "ERROR: Only '-opengl es2' is valid for WinRT." << endl;
- dictionary[ "DONE" ] = "error";
- }
- }
-
- if ((dictionary["FONT_CONFIG"] == "yes") && (dictionary["FREETYPE_FROM"] == "commandline")) {
- if (dictionary["FREETYPE"] == "yes") {
- cout << "WARNING: Bundled FreeType can't be used."
- " FontConfig use requires system FreeType." << endl;
- dictionary["FREETYPE"] = "system";
- dictionary["FREETYPE_FROM"] = "override";
- prompt = true;
- } else if (dictionary["FREETYPE"] == "no") {
- cout << "WARNING: FreeType can't be disabled."
- " FontConfig use requires system FreeType." << endl;
- dictionary["FREETYPE"] = "system";
- dictionary["FREETYPE_FROM"] = "override";
- prompt = true;
- }
- }
-
- if (prompt)
- promptKeyPress();
-
- return true;
}
void Configure::prepareConfigTests()
@@ -2477,665 +574,6 @@ void Configure::prepareConfigTests()
}
}
-void Configure::generateOutputVars()
-{
- // Generate variables for output
- QString build = dictionary[ "BUILD" ];
- bool buildAll = (dictionary[ "BUILDALL" ] == "yes");
- if (build == "debug") {
- if (buildAll)
- qtConfig += "debug_and_release build_all release";
- qtConfig += "debug";
- } else if (build == "release") {
- if (buildAll)
- qtConfig += "debug_and_release build_all debug";
- qtConfig += "release";
- }
- if (dictionary[ "RELEASE_TOOLS" ] == "yes")
- qtConfig += "release_tools";
-
- if (dictionary[ "PCH" ] == "yes")
- qmakeConfig += "precompile_header";
- else
- qmakeVars += "CONFIG -= precompile_header";
-
- if (dictionary[ "C++STD" ] == "c++11")
- qtConfig += "c++11";
- else if (dictionary[ "C++STD" ] == "c++14")
- qtConfig += "c++11 c++14";
- else if (dictionary[ "C++STD" ] == "c++1z")
- qtConfig += "c++11 c++14 c++1z";
-
- if (dictionary[ "USE_GOLD_LINKER" ] == "yes")
- qmakeConfig += "use_gold_linker";
-
- if (dictionary[ "ENABLE_NEW_DTAGS" ] == "yes")
- qmakeConfig += "enable_new_dtags";
-
- if (dictionary[ "SHARED" ] == "no")
- qtConfig += "static";
- else
- qtConfig += "shared";
-
- if (dictionary[ "STATIC_RUNTIME" ] == "yes")
- qtConfig += "static_runtime";
-
- if (dictionary[ "GUI" ] == "no") {
- qtConfig += "no-gui";
- dictionary [ "WIDGETS" ] = "no";
- }
-
- if (dictionary[ "WIDGETS" ] == "no")
- qtConfig += "no-widgets";
-
- // Compression --------------------------------------------------
- if (dictionary[ "SYSTEM_ZLIB" ] == "yes")
- qtConfig += "system-zlib";
-
- // PCRE ---------------------------------------------------------
- if (dictionary[ "PCRE" ] == "qt")
- qmakeConfig += "pcre";
-
- // ICU ---------------------------------------------------------
- if (dictionary[ "ICU" ] == "yes")
- qtConfig += "icu";
-
- // ANGLE --------------------------------------------------------
- if (dictionary[ "ANGLE" ] != "no") {
- qtConfig += "angle";
- }
-
- // Dynamic OpenGL loading ---------------------------------------
- if (dictionary[ "DYNAMICGL" ] != "no") {
- qtConfig += "dynamicgl";
- }
-
- // Image formates -----------------------------------------------
- if (dictionary[ "GIF" ] == "yes")
- qtConfig += "gif";
-
- if (dictionary[ "JPEG" ] == "yes")
- qtConfig += "jpeg";
- if (dictionary[ "LIBJPEG" ] == "system")
- qtConfig += "system-jpeg";
-
- if (dictionary[ "PNG" ] == "yes")
- qtConfig += "png";
- if (dictionary[ "LIBPNG" ] == "system")
- qtConfig += "system-png";
-
- // Double conversion -----------------------------------------------
- if (dictionary[ "DOUBLECONVERSION" ] != "no")
- qtConfig += "doubleconversion";
- if (dictionary[ "DOUBLECONVERSION" ] == "system")
- qtConfig += "system-doubleconversion";
-
- // Text rendering --------------------------------------------------
- if (dictionary[ "FREETYPE" ] != "no")
- qtConfig += "freetype";
- if (dictionary[ "FREETYPE" ] == "system")
- qtConfig += "system-freetype";
-
- if (dictionary[ "HARFBUZZ" ] != "no")
- qtConfig += "harfbuzz";
- if (dictionary[ "HARFBUZZ" ] == "system")
- qtConfig += "system-harfbuzz";
-
- // Styles -------------------------------------------------------
- if (dictionary[ "STYLE_WINDOWS" ] == "yes")
- qmakeStyles += "windows";
-
- if (dictionary[ "STYLE_FUSION" ] == "yes")
- qmakeStyles += "fusion";
-
- if (dictionary[ "STYLE_WINDOWSXP" ] == "yes")
- qmakeStyles += "windowsxp";
-
- if (dictionary[ "STYLE_WINDOWSVISTA" ] == "yes")
- qmakeStyles += "windowsvista";
-
- if (dictionary[ "STYLE_ANDROID" ] == "yes")
- qmakeStyles += "android";
-
- // Databases ----------------------------------------------------
- if (dictionary[ "SQL_MYSQL" ] == "yes")
- qmakeSql += "mysql";
- if (dictionary[ "SQL_ODBC" ] == "yes")
- qmakeSql += "odbc";
- if (dictionary[ "SQL_OCI" ] == "yes")
- qmakeSql += "oci";
- if (dictionary[ "SQL_PSQL" ] == "yes")
- qmakeSql += "psql";
- if (dictionary[ "SQL_TDS" ] == "yes")
- qmakeSql += "tds";
- if (dictionary[ "SQL_DB2" ] == "yes")
- qmakeSql += "db2";
- if (dictionary[ "SQL_SQLITE2" ] == "yes")
- qmakeSql += "sqlite2";
- if (dictionary[ "SQL_IBASE" ] == "yes")
- qmakeSql += "ibase";
- if (dictionary[ "SQL_SQLITE" ] == "yes")
- qmakeSql += "sqlite";
-
- if (dictionary[ "SQL_SQLITE_LIB" ] == "system")
- qmakeConfig += "system-sqlite";
-
- // Other options ------------------------------------------------
- if (dictionary[ "BUILDALL" ] == "yes") {
- qtConfig += "build_all";
- }
- if (dictionary[ "SEPARATE_DEBUG_INFO" ] == "yes")
- qtConfig += "separate_debug_info";
- if (dictionary[ "FORCEDEBUGINFO" ] == "yes")
- qmakeConfig += "force_debug_info";
- qmakeConfig += dictionary[ "BUILD" ];
-
- if (buildParts.isEmpty()) {
- buildParts = defaultBuildParts;
-
- if (dictionary["BUILDDEV"] == "yes")
- buildParts += "tests";
- }
- while (!nobuildParts.isEmpty())
- buildParts.removeAll(nobuildParts.takeFirst());
- if (!buildParts.contains("libs"))
- buildParts += "libs";
- buildParts.removeDuplicates();
- if (dictionary[ "COMPILE_EXAMPLES" ] == "yes")
- qmakeConfig += "compile_examples";
-
- if (dictionary["MSVC_MP"] == "yes")
- qmakeConfig += "msvc_mp";
-
- if (dictionary["ATOMIC64"] == "libatomic")
- qmakeConfig += "atomic64-libatomic";
-
- if (dictionary[ "ACCESSIBILITY" ] == "yes")
- qtConfig += "accessibility";
-
- if (!qmakeLibs.isEmpty())
- qmakeVars += "EXTRA_LIBDIR += " + formatPaths(qmakeLibs);
-
- if (!dictionary["QMAKE_LIBS_SQLITE"].isEmpty())
- qmakeVars += "QMAKE_LIBS_SQLITE += " + dictionary["QMAKE_LIBS_SQLITE"];
-
- if (dictionary[ "OPENGL" ] == "yes")
- qtConfig += "opengl";
-
- if (dictionary["OPENGL_ES_2"] == "yes") {
- qtConfig += "opengles2";
- qtConfig += "egl";
- }
-
- if (dictionary[ "SSL" ] == "yes")
- qtConfig += "ssl";
-
- if (dictionary[ "OPENSSL" ] == "yes")
- qtConfig += "openssl";
- else if (dictionary[ "OPENSSL" ] == "linked")
- qtConfig += "openssl-linked";
-
- if (dictionary[ "LIBPROXY" ] == "yes")
- qtConfig += "libproxy";
-
- if (dictionary[ "DBUS" ] == "runtime")
- qtConfig += "dbus";
- else if (dictionary[ "DBUS" ] == "linked")
- qtConfig += "dbus dbus-linked";
-
- if (dictionary["QML_DEBUG"] == "no")
- qtConfig += "no-qml-debug";
-
- if (dictionary["WMF_BACKEND"] == "yes")
- qtConfig += "wmf-backend";
-
- if (dictionary["DIRECTWRITE"] == "yes")
- qtConfig += "directwrite";
-
- if (dictionary["DIRECTWRITE2"] == "yes")
- qtConfig += "directwrite2";
-
- if (dictionary["DIRECT2D"] == "yes")
- qtConfig += "direct2d";
-
- if (dictionary[ "NATIVE_GESTURES" ] == "yes")
- qtConfig += "native-gestures";
-
- if (dictionary["NIS"] == "yes")
- qtConfig += "nis";
-
- if (dictionary["QT_CUPS"] == "yes")
- qtConfig += "cups";
-
- if (dictionary["QT_ICONV"] != "no")
- qtConfig += "iconv";
- if (dictionary["QT_ICONV"] == "sun")
- qtConfig += "sun-libiconv";
- else if (dictionary["QT_ICONV"] == "gnu")
- qtConfig += "gnu-libiconv";
-
- if (dictionary["QT_EVDEV"] == "yes")
- qtConfig += "evdev";
-
- if (dictionary["QT_MTDEV"] == "yes")
- qtConfig += "mtdev";
-
- if (dictionary[ "QT_TSLIB" ] == "yes")
- qtConfig += "tslib";
-
- if (dictionary["QT_INOTIFY"] == "yes")
- qtConfig += "inotify";
-
- if (dictionary["QT_EVENTFD"] == "yes")
- qtConfig += "eventfd";
-
- if (dictionary["FONT_CONFIG"] == "yes") {
- qtConfig += "fontconfig";
- qmakeVars += "QMAKE_CFLAGS_FONTCONFIG =";
- qmakeVars += "QMAKE_LIBS_FONTCONFIG = -lfreetype -lfontconfig";
- }
-
- if (dictionary["QT_GLIB"] == "yes")
- qtConfig += "glib";
-
- if (dictionary["STACK_PROTECTOR_STRONG"] == "yes")
- qtConfig += "stack-protector-strong";
-
- if (dictionary["REDUCE_EXPORTS"] == "yes")
- qtConfig += "reduce_exports";
-
- if (!dictionary["POLL"].isEmpty())
- qtConfig += "poll_" + dictionary["POLL"];
-
- // We currently have no switch for QtConcurrent, so add it unconditionally.
- qtConfig += "concurrent";
-
- if (dictionary[ "SYSTEM_PROXIES" ] == "yes")
- qtConfig += "system-proxies";
-
- if (dictionary[ "SCTP" ] == "yes")
- qtConfig += "sctp";
-
- if (dictionary.contains("XQMAKESPEC") && (dictionary["QMAKESPEC"] != dictionary["XQMAKESPEC"])) {
- qmakeConfig += "cross_compile";
- dictionary["CROSS_COMPILE"] = "yes";
- }
-
- // Directories and settings for .qmake.cache --------------------
-
- if (dictionary.contains("XQMAKESPEC") && dictionary[ "XQMAKESPEC" ].startsWith("linux"))
- qtConfig += "rpath";
-
- if (!qmakeDefines.isEmpty())
- qmakeVars += QString("EXTRA_DEFINES += ") + qmakeDefines.join(' ');
- if (!qmakeIncludes.isEmpty())
- qmakeVars += QString("EXTRA_INCLUDEPATH += ") + formatPaths(qmakeIncludes);
- if (!opensslLibs.isEmpty())
- qmakeVars += opensslLibs;
- if (dictionary[ "OPENSSL" ] == "linked") {
- if (!opensslLibsDebug.isEmpty() || !opensslLibsRelease.isEmpty()) {
- if (opensslLibsDebug.isEmpty() || opensslLibsRelease.isEmpty()) {
- cout << "Error: either both or none of OPENSSL_LIBS_DEBUG/_RELEASE must be defined." << endl;
- exit(1);
- }
- qmakeVars += opensslLibsDebug;
- qmakeVars += opensslLibsRelease;
- } else if (opensslLibs.isEmpty()) {
- qmakeVars += QString("OPENSSL_LIBS = -lssleay32 -llibeay32");
- }
- if (!opensslPath.isEmpty()) {
- qmakeVars += QString("OPENSSL_CFLAGS += -I%1/include").arg(opensslPath);
- qmakeVars += QString("OPENSSL_LIBS += -L%1/lib").arg(opensslPath);
- }
- }
- if (dictionary[ "DBUS" ] == "linked") {
- if (!dbusPath.isEmpty()) {
- qmakeVars += QString("QMAKE_CFLAGS_DBUS = -I%1/include").arg(dbusPath);
- qmakeVars += QString("QMAKE_LIBS_DBUS = -L%1/lib").arg(dbusPath);
- if (dbusHostPath.isEmpty())
- qmakeVars += QString("QT_HOST_CFLAGS_DBUS = -I%1/include").arg(dbusPath);
- }
- if (!dbusHostPath.isEmpty())
- qmakeVars += QString("QT_HOST_CFLAGS_DBUS = -I%1/include").arg(dbusHostPath);
- }
- if (dictionary[ "SQL_MYSQL" ] != "no" && !mysqlPath.isEmpty()) {
- qmakeVars += QString("QMAKE_CFLAGS_MYSQL = -I%1/include").arg(mysqlPath);
- qmakeVars += QString("QMAKE_LIBS_MYSQL = -L%1/lib").arg(mysqlPath);
- }
- if (!psqlLibs.isEmpty())
- qmakeVars += QString("QMAKE_LIBS_PSQL=") + psqlLibs.section("=", 1);
- if (!zlibLibs.isEmpty())
- qmakeVars += zlibLibs;
-
- {
- QStringList lflagsTDS;
- if (!sybase.isEmpty())
- lflagsTDS += QString("-L") + formatPath(sybase.section("=", 1) + "/lib");
- if (!sybaseLibs.isEmpty())
- lflagsTDS += sybaseLibs.section("=", 1);
- if (!lflagsTDS.isEmpty())
- qmakeVars += QString("QMAKE_LIBS_TDS=") + lflagsTDS.join(' ');
- }
-
- if (!qmakeSql.isEmpty())
- qmakeVars += QString("sql-drivers += ") + qmakeSql.join(' ');
- if (!qmakeStyles.isEmpty())
- qmakeVars += QString("styles += ") + qmakeStyles.join(' ');
- if (!qmakeStylePlugins.isEmpty())
- qmakeVars += QString("style-plugins += ") + qmakeStylePlugins.join(' ');
-
- if (!dictionary[ "QMAKESPEC" ].length()) {
- cout << "Configure could not detect your compiler. QMAKESPEC must either" << endl
- << "be defined as an environment variable, or specified as an" << endl
- << "argument with -platform" << endl;
-
- QStringList winPlatforms;
- QDir mkspecsDir(sourcePath + "/mkspecs");
- const QFileInfoList &specsList = mkspecsDir.entryInfoList();
- for (int i = 0; i < specsList.size(); ++i) {
- const QFileInfo &fi = specsList.at(i);
- if (fi.fileName().left(5) == "win32") {
- winPlatforms += fi.fileName();
- }
- }
- cout << "Available platforms are: " << qPrintable(winPlatforms.join(", ")) << endl;
- dictionary[ "DONE" ] = "error";
- }
-}
-
-void Configure::generateCachefile()
-{
- // Generate qmodule.pri, which is loaded only by Qt modules
- {
- FileWriter moduleStream(buildPath + "/mkspecs/qmodule.pri");
-
- moduleStream << "QT_BUILD_PARTS += " << buildParts.join(' ') << endl;
- if (!skipModules.isEmpty())
- moduleStream << "QT_SKIP_MODULES += " << skipModules.join(' ') << endl;
- moduleStream << endl;
-
- moduleStream << "host_build {" << endl;
- moduleStream << " QT_CPU_FEATURES." << dictionary["QT_HOST_ARCH"] <<
- " = " << dictionary["QT_HOST_CPU_FEATURES"] << endl;
- moduleStream << "} else {" << endl;
- moduleStream << " QT_CPU_FEATURES." << dictionary["QT_ARCH"] <<
- " = " << dictionary["QT_CPU_FEATURES"] << endl;
- moduleStream << "}" << endl;
- moduleStream << "QT_COORD_TYPE += " << dictionary["QREAL"] << endl;
-
- if (dictionary["QT_XKBCOMMON"] == "no")
- moduleStream << "DEFINES += QT_NO_XKBCOMMON" << endl;
-
- // embedded
- if (!dictionary["KBD_DRIVERS"].isEmpty())
- moduleStream << "kbd-drivers += "<< dictionary["KBD_DRIVERS"]<<endl;
- if (!dictionary["GFX_DRIVERS"].isEmpty())
- moduleStream << "gfx-drivers += "<< dictionary["GFX_DRIVERS"]<<endl;
- if (!dictionary["MOUSE_DRIVERS"].isEmpty())
- moduleStream << "mouse-drivers += "<< dictionary["MOUSE_DRIVERS"]<<endl;
- if (!dictionary["DECORATIONS"].isEmpty())
- moduleStream << "decorations += "<<dictionary["DECORATIONS"]<<endl;
-
- moduleStream << "CONFIG += " << qmakeConfig.join(' ');
- if (dictionary[ "SSE2" ] == "yes")
- moduleStream << " sse2";
- if (dictionary[ "SSE3" ] == "yes")
- moduleStream << " sse3";
- if (dictionary[ "SSSE3" ] == "yes")
- moduleStream << " ssse3";
- if (dictionary[ "SSE4_1" ] == "yes")
- moduleStream << " sse4_1";
- if (dictionary[ "SSE4_2" ] == "yes")
- moduleStream << " sse4_2";
- if (dictionary[ "AVX" ] == "yes")
- moduleStream << " avx";
- if (dictionary[ "AVX2" ] == "yes")
- moduleStream << " avx2";
- if (!dictionary[ "AVX512" ].isEmpty())
- moduleStream << ' ' << dictionary[ "AVX512" ];
- if (dictionary[ "NEON" ] == "yes")
- moduleStream << " neon";
- if (dictionary[ "LARGE_FILE" ] == "yes")
- moduleStream << " largefile";
- if (dictionary[ "STRIP" ] == "no")
- moduleStream << " nostrip";
- if (dictionary[ "LTCG" ] == "yes")
- moduleStream << " ltcg";
- moduleStream << endl;
-
- for (QStringList::Iterator var = qmakeVars.begin(); var != qmakeVars.end(); ++var)
- moduleStream << (*var) << endl;
-
- if (!moduleStream.flush())
- dictionary[ "DONE" ] = "error";
- }
-}
-
-void Configure::addSysroot(QString *command)
-{
- const QString &sysroot = dictionary["CFG_SYSROOT"];
- if (!sysroot.isEmpty() && dictionary["CFG_GCC_SYSROOT"] == "yes") {
- command->append(" QMAKE_LFLAGS+=--sysroot=" + sysroot);
- command->append(" QMAKE_CXXFLAGS+=--sysroot=" + sysroot);
- }
-}
-
-struct ArchData {
- bool isHost;
- const char *qmakespec;
- const char *key;
- const char *subarchKey;
- const char *type;
- ArchData() {}
- ArchData(bool h, const char *t, const char *qm, const char *k, const char *sak)
- : isHost(h), qmakespec(qm), key(k), subarchKey(sak), type(t)
- {}
-};
-
-/*
- Runs qmake on config.tests/arch/arch.pro, which will detect the target arch
- for the compiler we are using
-*/
-void Configure::detectArch()
-{
- QString oldpwd = QDir::currentPath();
-
- QString newpwd = QString("%1/config.tests/arch").arg(buildPath);
- if (!QDir().exists(newpwd) && !QDir().mkpath(newpwd)) {
- cout << "Failed to create directory " << qPrintable(QDir::toNativeSeparators(newpwd)) << endl;
- dictionary["DONE"] = "error";
- return;
- }
- if (!QDir::setCurrent(newpwd)) {
- cout << "Failed to change working directory to " << qPrintable(QDir::toNativeSeparators(newpwd)) << endl;
- dictionary["DONE"] = "error";
- return;
- }
-
- QVector<ArchData> qmakespecs;
- if (dictionary.contains("XQMAKESPEC"))
- qmakespecs << ArchData(false, "target", "XQMAKESPEC", "QT_ARCH", "QT_CPU_FEATURES");
- qmakespecs << ArchData(true, "host", "QMAKESPEC", "QT_HOST_ARCH", "QT_HOST_CPU_FEATURES");
-
- for (int i = 0; i < qmakespecs.count(); ++i) {
- const ArchData &data = qmakespecs.at(i);
- QString qmakespec = dictionary.value(data.qmakespec);
- QString key = data.key;
- QString subarchKey = data.subarchKey;
-
- // run qmake
- QString command = QString("%1 -spec %2 %3")
- .arg(QDir::toNativeSeparators(QDir(newpwd).relativeFilePath(buildPath + "/bin/qmake.exe")),
- QDir::toNativeSeparators(qmakespec),
- QDir::toNativeSeparators(sourcePath + "/config.tests/arch/arch"
- + (data.isHost ? "_host" : "") + ".pro"));
-
- if (!data.isHost) {
- if (qmakespec.startsWith("winrt") || qmakespec.startsWith("winphone"))
- command.append(" QMAKE_LFLAGS+=/ENTRY:main");
- addSysroot(&command);
- }
-
- int returnValue = 0;
- Environment::execute(command, &returnValue);
- if (returnValue != 0) {
- cout << "QMake failed!" << endl;
- dictionary["DONE"] = "error";
- return;
- }
-
- // compile
- command = dictionary[ "MAKE" ];
- if (command.contains("nmake") || command.contains("jom"))
- command += " /NOLOGO";
- command += " -s";
- Environment::execute(command);
-
- // find the executable that was generated
- QString arch_exe;
- if (qmakespec.startsWith("android")) {
- arch_exe = "libarch.so";
- } else {
- arch_exe = "arch.exe";
- }
- QFile exe(arch_exe);
- if (!exe.open(QFile::ReadOnly)) { // no Text, this is binary
- exe.setFileName("arch");
- if (!exe.open(QFile::ReadOnly)) {
- cout << "Could not find output file '" << qPrintable(arch_exe) << "' or 'arch' in " << qPrintable(newpwd) << " : " << qPrintable(exe.errorString()) << endl;
- dictionary["DONE"] = "error";
- return;
- }
- }
- QByteArray exeContents = exe.readAll();
- exe.close();
-
- static const char archMagic[] = "==Qt=magic=Qt== Architecture:";
- int magicPos = exeContents.indexOf(archMagic);
- if (magicPos == -1) {
- cout << "Internal error, could not find the architecture of the "
- << data.type << " executable" << endl;
- dictionary["DONE"] = "error";
- return;
- }
- //cout << "Found magic at offset 0x" << hex << magicPos << endl;
-
- // the conversion from QByteArray will stop at the ending NUL anyway
- QString arch = QString::fromLatin1(exeContents.constData() + magicPos
- + sizeof(archMagic) - 1);
- dictionary[key] = arch;
-
- static const char subarchMagic[] = "==Qt=magic=Qt== Sub-architecture:";
- magicPos = exeContents.indexOf(subarchMagic);
- if (magicPos == -1) {
- cout << "Internal error, could not find the sub-architecture of the "
- << data.type << " executable" << endl;
- dictionary["DONE"] = "error";
- return;
- }
-
- QString subarch = QString::fromLatin1(exeContents.constData() + magicPos
- + sizeof(subarchMagic) - 1);
- dictionary[subarchKey] = subarch;
-
- //cout << "Detected arch '" << qPrintable(arch) << "'\n";
- //cout << "Detected sub-arch '" << qPrintable(subarch) << "'\n";
-
- // clean up
- Environment::execute(command + " distclean");
- }
-
- if (!dictionary.contains("QT_HOST_ARCH"))
- dictionary["QT_HOST_ARCH"] = "unknown";
- if (!dictionary.contains("QT_ARCH")) {
- dictionary["QT_ARCH"] = dictionary["QT_HOST_ARCH"];
- dictionary["QT_CPU_FEATURES"] = dictionary["QT_HOST_CPU_FEATURES"];
- }
-
- QDir::setCurrent(oldpwd);
-}
-
-bool Configure::tryCompileProject(const QString &projectPath, const QString &extraOptions,
- bool distClean)
-{
- QString oldpwd = QDir::currentPath();
-
- QString newpwd = QString("%1/config.tests/%2").arg(buildPath, projectPath);
- if (!QDir().exists(newpwd) && !QDir().mkpath(newpwd)) {
- cout << "Failed to create directory " << qPrintable(QDir::toNativeSeparators(newpwd)) << endl;
- dictionary["DONE"] = "error";
- return false;
- }
- if (!QDir::setCurrent(newpwd)) {
- cout << "Failed to change working directory to " << qPrintable(QDir::toNativeSeparators(newpwd)) << endl;
- dictionary["DONE"] = "error";
- return false;
- }
-
- // run qmake
- QString command = QString("%1 %2 %3")
- .arg(QDir::toNativeSeparators(QDir(newpwd).relativeFilePath(buildPath + "/bin/qmake.exe")),
- QDir::toNativeSeparators(sourcePath + "/config.tests/" + projectPath),
- extraOptions);
-
- if (dictionary.contains("XQMAKESPEC")) {
- const QString qmakespec = dictionary["XQMAKESPEC"];
- if (qmakespec.startsWith("winrt") || qmakespec.startsWith("winphone"))
- command.append(" QMAKE_LFLAGS+=/ENTRY:main");
- addSysroot(&command);
- }
-
- if (verbose)
- cout << qPrintable(command) << endl;
- else
- command += " 2>&1";
-
- int code = 0;
- QString output = Environment::execute(command, &code);
- //cout << output << endl;
-
- if (code == 0) {
- // compile
- command = dictionary[ "MAKE" ];
- if (command.contains("nmake") || command.contains("jom"))
- command += " /NOLOGO";
- if (verbose)
- cout << qPrintable(command) << endl;
- else
- command += " -s 2>&1";
- output = Environment::execute(command, &code);
- //cout << output << endl;
-
- // clean up
- if (distClean)
- Environment::execute(command + " distclean 2>&1");
- }
-
- QDir::setCurrent(oldpwd);
- return code == 0;
-}
-
-bool Configure::compilerSupportsFlag(const QString &compilerAndArgs)
-{
- QFile file("conftest.cpp");
- if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
- cout << "could not open temp file for writing" << endl;
- return false;
- }
- if (!file.write("int main() { return 0; }\r\n")) {
- cout << "could not write to temp file" << endl;
- return false;
- }
- file.close();
- // compilerAndArgs contains compiler because there is no way to query it
- QString command = compilerAndArgs + " -o conftest-out.o conftest.cpp";
- int code = 0;
- QString output = Environment::execute(command, &code);
- file.remove();
- QFile::remove("conftest-out.o");
- return code == 0;
-}
-
void Configure::generateQDevicePri()
{
FileWriter deviceStream(buildPath + "/mkspecs/qdevice.pri");
@@ -3178,256 +616,6 @@ void Configure::generateQDevicePri()
dictionary[ "DONE" ] = "error";
}
-void Configure::generateQConfigPri()
-{
- // Generate qconfig.pri
- {
- FileWriter configStream(buildPath + "/mkspecs/qconfig.pri");
-
- configStream << "CONFIG+= ";
- configStream << dictionary[ "BUILD" ];
- configStream << (dictionary[ "SHARED" ] == "no" ? " static" : " shared");
-
- if (dictionary["STATIC_RUNTIME"] == "yes")
- configStream << " static_runtime";
- if (dictionary[ "RTTI" ] == "yes")
- configStream << " rtti";
- if (dictionary["INCREDIBUILD_XGE"] == "yes")
- configStream << " incredibuild_xge";
- if (dictionary["PLUGIN_MANIFESTS"] == "no")
- configStream << " no_plugin_manifest";
- if (dictionary["CROSS_COMPILE"] == "yes")
- configStream << " cross_compile";
-
- if (dictionary[ "SLOG2" ] == "yes")
- configStream << " slog2";
-
- if (dictionary[ "QNX_IMF" ] == "yes")
- configStream << " qqnx_imf";
-
- if (dictionary[ "PPS" ] == "yes")
- configStream << " qqnx_pps";
-
- if (dictionary[ "LGMON" ] == "yes")
- configStream << " lgmon";
-
- if (dictionary["ANDROID_STYLE_ASSETS"] == "yes")
- configStream << " android-style-assets";
-
- configStream << endl;
- configStream << "host_build {" << endl;
- configStream << " QT_ARCH = " << dictionary["QT_HOST_ARCH"] << endl;
- configStream << " QT_TARGET_ARCH = " << dictionary["QT_ARCH"] << endl;
- configStream << "} else {" << endl;
- configStream << " QT_ARCH = " << dictionary["QT_ARCH"] << endl;
- configStream << "}" << endl;
- configStream << "QT_CONFIG += " << qtConfig.join(' ') << endl;
-
- configStream << "#versioning " << endl
- << "QT_VERSION = " << dictionary["VERSION"] << endl
- << "QT_MAJOR_VERSION = " << dictionary["VERSION_MAJOR"] << endl
- << "QT_MINOR_VERSION = " << dictionary["VERSION_MINOR"] << endl
- << "QT_PATCH_VERSION = " << dictionary["VERSION_PATCH"] << endl;
-
- configStream << endl
- << "QT_EDITION = " << dictionary["EDITION"] << endl;
-
- if (dictionary["EDITION"] != "OpenSource" && dictionary["EDITION"] != "Preview") {
- configStream << "QT_LICHECK = " << dictionary["LICHECK"] << endl;
- configStream << "QT_RELEASE_DATE = " << dictionary["RELEASEDATE"] << endl;
- }
-
- if (!dictionary["CFG_SYSROOT"].isEmpty() && dictionary["CFG_GCC_SYSROOT"] == "yes") {
- configStream << endl
- << "# sysroot" << endl
- << "!host_build {" << endl
- << " QMAKE_CFLAGS += --sysroot=$$[QT_SYSROOT]" << endl
- << " QMAKE_CXXFLAGS += --sysroot=$$[QT_SYSROOT]" << endl
- << " QMAKE_LFLAGS += --sysroot=$$[QT_SYSROOT]" << endl
- << "}" << endl;
- }
-
- if (!dictionary["QMAKE_RPATHDIR"].isEmpty())
- configStream << "QMAKE_RPATHDIR += " << formatPath(dictionary["QMAKE_RPATHDIR"]) << endl;
-
- if (!dictionary["QT_LIBINFIX"].isEmpty())
- configStream << "QT_LIBINFIX = " << dictionary["QT_LIBINFIX"] << endl;
-
- if (!dictionary["QT_NAMESPACE"].isEmpty())
- configStream << "#namespaces" << endl << "QT_NAMESPACE = " << dictionary["QT_NAMESPACE"] << endl;
-
- if (dictionary[ "SHARED" ] == "no")
- configStream << "QT_DEFAULT_QPA_PLUGIN = q" << qpaPlatformName() << endl;
-
- if (!dictionary["QT_GCC_MAJOR_VERSION"].isEmpty()) {
- configStream << "QT_GCC_MAJOR_VERSION = " << dictionary["QT_GCC_MAJOR_VERSION"] << endl
- << "QT_GCC_MINOR_VERSION = " << dictionary["QT_GCC_MINOR_VERSION"] << endl
- << "QT_GCC_PATCH_VERSION = " << dictionary["QT_GCC_PATCH_VERSION"] << endl;
- }
-
- if (dictionary.value("XQMAKESPEC").startsWith("wince")) {
- configStream << "#Qt for Windows CE c-runtime deployment" << endl
- << "QT_CE_C_RUNTIME = " << formatPath(dictionary["CE_CRT"]) << endl;
- }
-
- if (!configStream.flush())
- dictionary[ "DONE" ] = "error";
- }
-}
-
-QString Configure::addDefine(QString def)
-{
- QString result, defNeg, defD = def;
-
- defD.replace(QRegExp("=.*"), "");
- def.replace(QRegExp("="), " ");
-
- if (def.startsWith("QT_NO_")) {
- defNeg = defD;
- defNeg.replace("QT_NO_", "QT_");
- } else if (def.startsWith("QT_")) {
- defNeg = defD;
- defNeg.replace("QT_", "QT_NO_");
- }
-
- if (defNeg.isEmpty()) {
- result = "#ifndef $DEFD\n"
- "# define $DEF\n"
- "#endif\n\n";
- } else {
- result = "#if defined($DEFD) && defined($DEFNEG)\n"
- "# undef $DEFD\n"
- "#elif !defined($DEFD)\n"
- "# define $DEF\n"
- "#endif\n\n";
- }
- result.replace("$DEFNEG", defNeg);
- result.replace("$DEFD", defD);
- result.replace("$DEF", def);
- return result;
-}
-
-void Configure::generateConfigfiles()
-{
- {
- FileWriter tmpStream(buildPath + "/src/corelib/global/qconfig.h");
-
- tmpStream << "#define QT_VERSION_MAJOR " << dictionary["VERSION_MAJOR"] << endl
- << "#define QT_VERSION_MINOR " << dictionary["VERSION_MINOR"] << endl
- << "#define QT_VERSION_PATCH " << dictionary["VERSION_PATCH"] << endl
- << "#define QT_VERSION_STR \"" << dictionary["VERSION"] << "\"\n"
- << endl;
- tmpStream << endl;
-
- if (dictionary[ "SHARED" ] == "no") {
- tmpStream << "/* Qt was configured for a static build */" << endl
- << "#if !defined(QT_SHARED) && !defined(QT_STATIC)" << endl
- << "# define QT_STATIC" << endl
- << "#endif" << endl
- << endl;
- }
- tmpStream << "/* License information */" << endl;
- tmpStream << "#define QT_PRODUCT_LICENSEE \"" << dictionary[ "LICENSEE" ] << "\"" << endl;
- tmpStream << "#define QT_PRODUCT_LICENSE \"" << dictionary[ "EDITION" ] << "\"" << endl;
- tmpStream << endl;
- if (dictionary["BUILDDEV"] == "yes") {
- dictionary["QMAKE_INTERNAL"] = "yes";
- tmpStream << "/* Used for example to export symbols for the certain autotests*/" << endl;
- tmpStream << "#define QT_BUILD_INTERNAL" << endl;
- tmpStream << endl;
- }
-
- tmpStream << endl << "// Compiler sub-arch support" << endl;
- if (dictionary[ "SSE2" ] == "yes")
- tmpStream << "#define QT_COMPILER_SUPPORTS_SSE2 1" << endl;
- if (dictionary[ "SSE3" ] == "yes")
- tmpStream << "#define QT_COMPILER_SUPPORTS_SSE3 1" << endl;
- if (dictionary[ "SSSE3" ] == "yes")
- tmpStream << "#define QT_COMPILER_SUPPORTS_SSSE3 1" << endl;
- if (dictionary[ "SSE4_1" ] == "yes")
- tmpStream << "#define QT_COMPILER_SUPPORTS_SSE4_1 1" << endl;
- if (dictionary[ "SSE4_2" ] == "yes")
- tmpStream << "#define QT_COMPILER_SUPPORTS_SSE4_2 1" << endl;
- if (dictionary[ "AVX" ] == "yes")
- tmpStream << "#define QT_COMPILER_SUPPORTS_AVX 1" << endl;
- if (dictionary[ "AVX2" ] == "yes")
- tmpStream << "#define QT_COMPILER_SUPPORTS_AVX2 1" << endl;
- foreach (const QString &avx512feature, dictionary[ "AVX512" ].split(' ', QString::SkipEmptyParts))
- tmpStream << "#define QT_COMPILER_SUPPRTS_" << avx512feature.toUpper() << " 1" << endl;
-
- if (dictionary["QREAL"] != "double") {
- tmpStream << "#define QT_COORD_TYPE " << dictionary["QREAL"] << endl;
- tmpStream << "#define QT_COORD_TYPE_STRING " << dictionary["QREAL_STRING"] << endl;
- }
-
- tmpStream << endl << "// Compile time features" << endl;
-
- QStringList qconfigList;
- if (dictionary["STYLE_WINDOWS"] != "yes") qconfigList += "QT_NO_STYLE_WINDOWS";
- if (dictionary["STYLE_FUSION"] != "yes") qconfigList += "QT_NO_STYLE_FUSION";
- if (dictionary["STYLE_WINDOWSXP"] != "yes" && dictionary["STYLE_WINDOWSVISTA"] != "yes")
- qconfigList += "QT_NO_STYLE_WINDOWSXP";
- if (dictionary["STYLE_WINDOWSVISTA"] != "yes") qconfigList += "QT_NO_STYLE_WINDOWSVISTA";
-
- if (dictionary["PNG"] != "yes") qconfigList += "QT_NO_IMAGEFORMAT_PNG";
-
- if (dictionary["ACCESSIBILITY"] == "no") qconfigList += "QT_NO_ACCESSIBILITY";
- if (dictionary["WIDGETS"] == "no") qconfigList += "QT_NO_WIDGETS";
- if (dictionary["GUI"] == "no") qconfigList += "QT_NO_GUI";
- if (dictionary["OPENGL"] == "no") qconfigList += "QT_NO_OPENGL";
- if (dictionary["SSL"] == "no") qconfigList += "QT_NO_SSL";
- if (dictionary["OPENSSL"] == "no") qconfigList += "QT_NO_OPENSSL";
- if (dictionary["OPENSSL"] == "linked") qconfigList += "QT_LINKED_OPENSSL";
- if (dictionary["DBUS"] == "no") qconfigList += "QT_NO_DBUS";
- if (dictionary["FREETYPE"] == "no") qconfigList += "QT_NO_FREETYPE";
- if (dictionary["HARFBUZZ"] == "no") qconfigList += "QT_NO_HARFBUZZ";
- if (dictionary["NATIVE_GESTURES"] == "no") qconfigList += "QT_NO_NATIVE_GESTURES";
-
- if (dictionary["OPENGL_ES_2"] == "yes") qconfigList += "QT_OPENGL_ES";
- if (dictionary["OPENGL_ES_2"] == "yes") qconfigList += "QT_OPENGL_ES_2";
- if (dictionary["DYNAMICGL"] == "yes") qconfigList += "QT_OPENGL_DYNAMIC";
-
- if (dictionary["POSIX_IPC"] == "yes")
- qconfigList += "QT_POSIX_IPC";
- else if ((platform() != ANDROID) && (platform() != WINDOWS) && (platform() != WINDOWS_RT))
- qconfigList << "QT_NO_SYSTEMSEMAPHORE" << "QT_NO_SHAREDMEMORY";
-
- if (dictionary["FONT_CONFIG"] == "no") qconfigList += "QT_NO_FONTCONFIG";
-
- if (dictionary["NIS"] == "yes")
- qconfigList += "QT_NIS";
- else
- qconfigList += "QT_NO_NIS";
-
- if (dictionary["SCTP"] == "no") qconfigList += "QT_NO_SCTP";
-
- if (dictionary["LARGE_FILE"] == "yes") qconfigList += "QT_LARGEFILE_SUPPORT=64";
- if (dictionary["QT_CUPS"] == "no") qconfigList += "QT_NO_CUPS";
- if (dictionary["QT_ICONV"] == "no") qconfigList += "QT_NO_ICONV";
- if (dictionary["QT_EVDEV"] == "no") qconfigList += "QT_NO_EVDEV";
- if (dictionary["QT_MTDEV"] == "no") qconfigList += "QT_NO_MTDEV";
- if (dictionary["QT_TSLIB"] == "no") qconfigList += "QT_NO_TSLIB";
- if (dictionary["QT_GLIB"] == "no") qconfigList += "QT_NO_GLIB";
- if (dictionary["QT_INOTIFY"] == "no") qconfigList += "QT_NO_INOTIFY";
- if (dictionary["QT_EVENTFD"] == "no") qconfigList += "QT_NO_EVENTFD";
- if (dictionary["ATOMIC64"] == "no") qconfigList += "QT_NO_STD_ATOMIC64";
-
- if (dictionary["REDUCE_EXPORTS"] == "yes") qconfigList += "QT_VISIBILITY_AVAILABLE";
- if (dictionary["REDUCE_RELOCATIONS"] == "yes") qconfigList += "QT_REDUCE_RELOCATIONS";
- if (dictionary["QT_GETIFADDRS"] == "no") qconfigList += "QT_NO_GETIFADDRS";
-
- qconfigList.sort();
- for (int i = 0; i < qconfigList.count(); ++i)
- tmpStream << addDefine(qconfigList.at(i));
-
- tmpStream<<"#define QT_QPA_DEFAULT_PLATFORM_NAME \"" << qpaPlatformName() << "\""<<endl;
-
- if (!tmpStream.flush())
- dictionary[ "DONE" ] = "error";
- }
-
-}
-
QString Configure::formatConfigPath(const char *var)
{
QString val = dictionary[var];
@@ -3438,230 +626,10 @@ QString Configure::formatConfigPath(const char *var)
return QDir::toNativeSeparators(val);
}
-void Configure::displayConfig()
-{
- fstream sout;
- sout.open(QString(buildPath + "/config.summary").toLocal8Bit().constData(),
- ios::in | ios::out | ios::trunc);
-
- // Give some feedback
- sout << "Environment:" << endl;
- QString env = QString::fromLocal8Bit(getenv("INCLUDE")).replace(QRegExp("[;,]"), "\n ");
- if (env.isEmpty())
- env = "Unset";
- sout << " INCLUDE=\n " << env << endl;
- env = QString::fromLocal8Bit(getenv("LIB")).replace(QRegExp("[;,]"), "\n ");
- if (env.isEmpty())
- env = "Unset";
- sout << " LIB=\n " << env << endl;
- env = QString::fromLocal8Bit(getenv("PATH")).replace(QRegExp("[;,]"), "\n ");
- if (env.isEmpty())
- env = "Unset";
- sout << " PATH=\n " << env << endl;
-
- if (dictionary[QStringLiteral("EDITION")] != QLatin1String("OpenSource")) {
- QString l1 = dictionary[ "LICENSEE" ];
- QString l2 = dictionary[ "LICENSEID" ];
- QString l3 = dictionary["EDITION"] + ' ' + "Edition";
- QString l4 = dictionary[ "EXPIRYDATE" ];
- sout << "Licensee...................." << (l1.isNull() ? "" : l1) << endl;
- sout << "License ID.................." << (l2.isNull() ? "" : l2) << endl;
- sout << "Product license............." << (l3.isNull() ? "" : l3) << endl;
- sout << "Expiry Date................." << (l4.isNull() ? "" : l4) << endl;
- sout << endl;
- }
-
- sout << "Configuration:" << endl;
- sout << " " << qmakeConfig.join("\n ") << endl;
- sout << "Qt Configuration:" << endl;
- sout << " " << qtConfig.join("\n ") << endl;
- sout << endl;
-
- if (dictionary.contains("XQMAKESPEC"))
- sout << "QMAKESPEC..................." << dictionary[ "XQMAKESPEC" ] << " (" << dictionary["QMAKESPEC_FROM"] << ")" << endl;
- else
- sout << "QMAKESPEC..................." << dictionary[ "QMAKESPEC" ] << " (" << dictionary["QMAKESPEC_FROM"] << ")" << endl;
- sout << "Architecture................" << dictionary["QT_ARCH"]
- << ", features:" << dictionary["QT_CPU_FEATURES"] << endl;
- sout << "Host Architecture..........." << dictionary["QT_HOST_ARCH"]
- << ", features:" << dictionary["QT_HOST_CPU_FEATURES"] << endl;
- sout << "Maketool...................." << dictionary[ "MAKE" ] << endl;
- if (dictionary[ "BUILDALL" ] == "yes") {
- sout << "Debug build................." << "yes (combined)" << endl;
- sout << "Default build..............." << dictionary[ "BUILD" ] << endl;
- } else {
- sout << "Debug......................." << (dictionary[ "BUILD" ] == "debug" ? "yes" : "no") << endl;
- }
- if (dictionary[ "BUILD" ] == "release" || dictionary[ "BUILDALL" ] == "yes")
- sout << "Force debug info............" << dictionary[ "FORCEDEBUGINFO" ] << endl;
- if (dictionary[ "BUILD" ] == "debug")
- sout << "Force optimized tools......." << dictionary[ "RELEASE_TOOLS" ] << endl;
- sout << "C++ language standard......." << dictionary[ "C++STD" ] << endl;
- sout << "Link Time Code Generation..." << dictionary[ "LTCG" ] << endl;
- sout << "Using PCH .................." << dictionary[ "PCH" ] << endl;
- sout << "Accessibility support......." << dictionary[ "ACCESSIBILITY" ] << endl;
- sout << "RTTI support................" << dictionary[ "RTTI" ] << endl;
- sout << "SSE support................."
- << (dictionary[ "SSE2" ] == "no" ? "<none>" : "SSE2")
- << (dictionary[ "SSE3" ] == "no" ? "" : " SSE3")
- << (dictionary[ "SSSE3" ] == "no" ? "" : " SSSE3")
- << (dictionary[ "SSE4_1" ] == "no" ? "" : " SSE4.1")
- << (dictionary[ "SSE4_2" ] == "no" ? "" : " SSE4.2")
- << endl;
- sout << "AVX support................."
- << (dictionary[ "AVX" ] == "no" ? "<none>" : "AVX")
- << (dictionary[ "AVX2" ] == "no" ? "" : " AVX2")
- << endl;
- sout << "AVX512 support.............."
- << (dictionary[ "AVX512" ].isEmpty() ? QString("<none>") : dictionary[ "AVX512" ].toUpper()) << endl;
- sout << "NEON support................" << dictionary[ "NEON" ] << endl;
- sout << "OpenGL support.............." << dictionary[ "OPENGL" ] << endl;
- sout << "NIS support................." << dictionary[ "NIS" ] << endl;
- sout << "Iconv support..............." << dictionary[ "QT_ICONV" ] << endl;
- sout << "Evdev support..............." << dictionary[ "QT_EVDEV" ] << endl;
- sout << "Mtdev support..............." << dictionary[ "QT_MTDEV" ] << endl;
- sout << "Inotify support............." << dictionary[ "QT_INOTIFY" ] << endl;
- sout << "eventfd(7) support.........." << dictionary[ "QT_EVENTFD" ] << endl;
- sout << "Glib support................" << dictionary[ "QT_GLIB" ] << endl;
- sout << "CUPS support................" << dictionary[ "QT_CUPS" ] << endl;
- sout << "SSL support................." << dictionary[ "SSL" ] << endl;
- sout << "OpenSSL support............." << dictionary[ "OPENSSL" ] << endl;
- sout << "libproxy support............" << dictionary[ "LIBPROXY" ] << endl;
- sout << "Qt D-Bus support............" << dictionary[ "DBUS" ] << endl;
- sout << "Qt Widgets module support..." << dictionary[ "WIDGETS" ] << endl;
- sout << "Qt GUI module support......." << dictionary[ "GUI" ] << endl;
- sout << "QML debugging..............." << dictionary[ "QML_DEBUG" ] << endl;
- sout << "DirectWrite support........." << dictionary[ "DIRECTWRITE" ] << endl;
- sout << "DirectWrite 2 support......." << dictionary[ "DIRECTWRITE2" ] << endl;
- sout << "Use system proxies.........." << dictionary[ "SYSTEM_PROXIES" ] << endl;
- sout << "SCTP support................" << dictionary[ "SCTP" ] << endl;
- sout << endl;
-
- sout << "QPA Backends:" << endl;
- sout << " GDI....................." << "yes" << endl;
- sout << " Direct2D................" << dictionary[ "DIRECT2D" ] << endl;
- sout << endl;
-
- sout << "Third Party Libraries:" << endl;
- sout << " ZLIB support............" << (dictionary[ "SYSTEM_ZLIB" ] == QLatin1String("yes") ? QLatin1String("system") : QLatin1String("qt")) << endl;
- sout << " GIF support............." << dictionary[ "GIF" ] << endl;
- sout << " JPEG support............" << dictionary[ "JPEG" ] << " (" << dictionary[ "LIBJPEG" ] << ")" << endl;
- sout << " PNG support............." << dictionary[ "PNG" ] << " (" << dictionary[ "LIBPNG" ] << ")" << endl;
- sout << " DoubleConversion........" << dictionary[ "DOUBLECONVERSION" ] << endl;
- sout << " FreeType support........" << dictionary[ "FREETYPE" ] << endl;
- sout << " Fontconfig support......" << dictionary[ "FONT_CONFIG" ] << endl;
- sout << " HarfBuzz support........" << dictionary[ "HARFBUZZ" ] << endl;
- sout << " PCRE support............" << dictionary[ "PCRE" ] << endl;
- sout << " ICU support............." << dictionary[ "ICU" ] << endl;
- if (platform() == QNX) {
- sout << " SLOG2 support..........." << dictionary[ "SLOG2" ] << endl;
- sout << " IMF support............." << dictionary[ "QNX_IMF" ] << endl;
- sout << " PPS support............." << dictionary[ "PPS" ] << endl;
- sout << " LGMON support..........." << dictionary[ "LGMON" ] << endl;
- }
- sout << " ANGLE..................." << dictionary[ "ANGLE" ] << endl;
- sout << " Dynamic OpenGL.........." << dictionary[ "DYNAMICGL" ] << endl;
- sout << endl;
-
- sout << "Styles:" << endl;
- sout << " Windows................." << dictionary[ "STYLE_WINDOWS" ] << endl;
- sout << " Windows XP.............." << dictionary[ "STYLE_WINDOWSXP" ] << endl;
- sout << " Windows Vista..........." << dictionary[ "STYLE_WINDOWSVISTA" ] << endl;
- sout << " Fusion.................." << dictionary[ "STYLE_FUSION" ] << endl;
- sout << endl;
-
- sout << "Sql Drivers:" << endl;
- sout << " ODBC...................." << dictionary[ "SQL_ODBC" ] << endl;
- sout << " MySQL..................." << dictionary[ "SQL_MYSQL" ] << endl;
- sout << " OCI....................." << dictionary[ "SQL_OCI" ] << endl;
- sout << " PostgreSQL.............." << dictionary[ "SQL_PSQL" ] << endl;
- sout << " TDS....................." << dictionary[ "SQL_TDS" ] << endl;
- sout << " DB2....................." << dictionary[ "SQL_DB2" ] << endl;
- sout << " SQLite.................." << dictionary[ "SQL_SQLITE" ] << " (" << dictionary[ "SQL_SQLITE_LIB" ] << ")" << endl;
- sout << " SQLite2................." << dictionary[ "SQL_SQLITE2" ] << endl;
- sout << " InterBase..............." << dictionary[ "SQL_IBASE" ] << endl;
- sout << endl;
-
- sout << "Sources are in.............." << QDir::toNativeSeparators(sourcePath) << endl;
- sout << "Build is done in............" << QDir::toNativeSeparators(buildPath) << endl;
- sout << "Install prefix.............." << QDir::toNativeSeparators(dictionary["QT_INSTALL_PREFIX"]) << endl;
- sout << "Headers installed to........" << formatConfigPath("QT_REL_INSTALL_HEADERS") << endl;
- sout << "Libraries installed to......" << formatConfigPath("QT_REL_INSTALL_LIBS") << endl;
- sout << "Arch-dep. data to..........." << formatConfigPath("QT_REL_INSTALL_ARCHDATA") << endl;
- sout << "Plugins installed to........" << formatConfigPath("QT_REL_INSTALL_PLUGINS") << endl;
- sout << "Library execs installed to.." << formatConfigPath("QT_REL_INSTALL_LIBEXECS") << endl;
- sout << "QML1 imports installed to..." << formatConfigPath("QT_REL_INSTALL_IMPORTS") << endl;
- sout << "QML2 imports installed to..." << formatConfigPath("QT_REL_INSTALL_QML") << endl;
- sout << "Binaries installed to......." << formatConfigPath("QT_REL_INSTALL_BINS") << endl;
- sout << "Arch-indep. data to........." << formatConfigPath("QT_REL_INSTALL_DATA") << endl;
- sout << "Docs installed to..........." << formatConfigPath("QT_REL_INSTALL_DOCS") << endl;
- sout << "Translations installed to..." << formatConfigPath("QT_REL_INSTALL_TRANSLATIONS") << endl;
- sout << "Examples installed to......." << formatConfigPath("QT_REL_INSTALL_EXAMPLES") << endl;
- sout << "Tests installed to.........." << formatConfigPath("QT_REL_INSTALL_TESTS") << endl;
-
- if (checkAvailability("INCREDIBUILD_XGE"))
- sout << "Using IncrediBuild XGE......" << dictionary["INCREDIBUILD_XGE"] << endl;
- if (!qmakeDefines.isEmpty()) {
- sout << "Defines.....................";
- for (QStringList::Iterator defs = qmakeDefines.begin(); defs != qmakeDefines.end(); ++defs)
- sout << (*defs) << " ";
- sout << endl;
- }
- if (!qmakeIncludes.isEmpty()) {
- sout << "Include paths...............";
- for (QStringList::Iterator incs = qmakeIncludes.begin(); incs != qmakeIncludes.end(); ++incs)
- sout << (*incs) << " ";
- sout << endl;
- }
- if (!qmakeLibs.isEmpty()) {
- sout << "Additional libraries........";
- for (QStringList::Iterator libs = qmakeLibs.begin(); libs != qmakeLibs.end(); ++libs)
- sout << (*libs) << " ";
- sout << endl;
- }
- if (dictionary[ "QMAKE_INTERNAL" ] == "yes") {
- sout << "Using internal configuration." << endl;
- }
- if (dictionary[ "SHARED" ] == "no") {
- sout << "WARNING: Using static linking will disable the use of plugins." << endl;
- sout << " Make sure you compile ALL needed modules into the library." << endl;
- }
- if (dictionary[ "OPENSSL" ] == "linked") {
- if (!opensslLibsDebug.isEmpty() || !opensslLibsRelease.isEmpty()) {
- sout << "Using OpenSSL libraries:" << endl;
- sout << " debug : " << opensslLibsDebug << endl;
- sout << " release: " << opensslLibsRelease << endl;
- sout << " both : " << opensslLibs << endl;
- } else if (opensslLibs.isEmpty()) {
- sout << "NOTE: When linking against OpenSSL, you can override the default" << endl;
- sout << "library names through OPENSSL_LIBS and optionally OPENSSL_LIBS_DEBUG/OPENSSL_LIBS_RELEASE" << endl;
- sout << "For example:" << endl;
- sout << " configure -openssl-linked OPENSSL_LIBS=\"-lssleay32 -llibeay32\"" << endl;
- }
- }
- if (dictionary["RELEASE_TOOLS"] == "yes" && dictionary["BUILD"] != "debug" ) {
- sout << endl
- << "NOTE: -optimized-tools is not useful in -release mode." << endl;
- }
- if (!dictionary["PREFIX_COMPLAINTS"].isEmpty()) {
- sout << endl
- << dictionary["PREFIX_COMPLAINTS"] << endl
- << endl;
- }
-
- // display config.summary
- sout.seekg(0, ios::beg);
- while (sout.good()) {
- string str;
- getline(sout, str);
- cout << str << endl;
- }
-}
-
void Configure::generateHeaders()
{
if (dictionary["SYNCQT"] == "auto")
- dictionary["SYNCQT"] = defaultTo("SYNCQT");
+ dictionary["SYNCQT"] = QFile::exists(sourcePath + "/.git") ? "yes" : "no";
if (dictionary["SYNCQT"] == "yes") {
if (!QStandardPaths::findExecutable(QStringLiteral("perl.exe")).isEmpty()) {
@@ -3898,7 +866,7 @@ void Configure::generateQConfigCpp()
void Configure::buildQmake()
{
- if (dictionary[ "BUILD_QMAKE" ] == "yes") {
+ {
QStringList args;
// Build qmake
@@ -4044,6 +1012,58 @@ void Configure::buildQmake()
}
+void Configure::configure()
+{
+ static const char * const files[] = { "qmodule", "qconfig" };
+
+ for (int i = 0; i < 2; i++) {
+ QFile file(buildPath + "/mkspecs/" + files[i] + ".pri");
+ QString oldfn = file.fileName() + ".old";
+ if (file.exists() && !QFileInfo::exists(oldfn))
+ QFile::rename(file.fileName(), oldfn);
+ if (!file.open(QFile::WriteOnly | QFile::Text)) {
+ cout << "Failed to create file " << qPrintable(file.fileName()) << endl;
+ dictionary[ "DONE" ] = "error";
+ return;
+ }
+ file.close();
+ }
+
+ FileWriter ci(buildPath + "/config.tests/configure.cfg");
+ ci << "# Feature defaults set by configure command line\n"
+ << "config.input.qt_edition = " << dictionary["EDITION"] << "\n"
+ << "config.input.qt_licheck = " << dictionary["LICHECK"] << "\n"
+ << "config.input.qt_release_date = " << dictionary["RELEASEDATE"];
+ if (!ci.flush()) {
+ dictionary[ "DONE" ] = "error";
+ return;
+ }
+
+ QStringList args;
+ args << buildPath + "/bin/qmake"
+ << "-o" << "Makefile.cfg"
+ << sourcePath + "/configure.pri"
+ << "--" << configCmdLine;
+
+ if (int exitCode = Environment::execute(args, QStringList(), QStringList())) {
+ cout << "Qmake failed, return code " << exitCode << endl << endl;
+ dictionary[ "DONE" ] = "error";
+ }
+
+ for (int i = 0; i < 2; i++) {
+ QFile file(buildPath + "/mkspecs/" + files[i] + ".pri");
+ QFile oldFile(file.fileName() + ".old");
+ if (oldFile.open(QIODevice::ReadOnly | QIODevice::Text)
+ && file.open(QIODevice::ReadOnly | QIODevice::Text)
+ && oldFile.readAll() == file.readAll()) {
+ file.remove();
+ oldFile.rename(file.fileName());
+ } else {
+ oldFile.remove();
+ }
+ }
+}
+
void Configure::generateMakefiles()
{
QString pwd = QDir::currentPath();
@@ -4066,43 +1086,6 @@ void Configure::generateMakefiles()
QDir::setCurrent(pwd);
}
-void Configure::showSummary()
-{
- QString make = dictionary[ "MAKE" ];
- cout << endl << endl << "Qt is now configured for building. Just run " << qPrintable(make) << "." << endl;
- cout << "To reconfigure, run " << qPrintable(make) << " confclean and configure." << endl << endl;
-}
-
-Configure::ProjectType Configure::projectType(const QString& proFileName)
-{
- QFile proFile(proFileName);
- if (proFile.open(QFile::ReadOnly)) {
- QString buffer = proFile.readLine(1024);
- while (!buffer.isEmpty()) {
- QStringList segments = buffer.split(QRegExp("\\s"));
- QStringList::Iterator it = segments.begin();
-
- if (segments.size() >= 3) {
- QString keyword = (*it++);
- QString operation = (*it++);
- QString value = (*it++);
-
- if (keyword == "TEMPLATE") {
- if (value == "lib")
- return Lib;
- else if (value == "subdirs")
- return Subdirs;
- }
- }
- // read next line
- buffer = proFile.readLine(1024);
- }
- proFile.close();
- }
- // Default to app handling
- return App;
-}
-
bool Configure::showLicense(QString orgLicenseFile)
{
if (dictionary["LICENSE_CONFIRMED"] == "yes") {
@@ -4240,20 +1223,22 @@ void Configure::readLicense()
void Configure::reloadCmdLine(int idx)
{
if (dictionary[ "REDO" ] == "yes") {
- QFile inFile(buildPath + "/configure.cache");
- if (inFile.open(QFile::ReadOnly)) {
- QTextStream inStream(&inFile);
- while (!inStream.atEnd())
- configCmdLine.insert(idx++, inStream.readLine().trimmed());
- inFile.close();
+ QFile inFile(buildPath + "/config.opt");
+ if (!inFile.open(QFile::ReadOnly)) {
+ inFile.setFileName(buildPath + "/configure.cache");
+ if (!inFile.open(QFile::ReadOnly))
+ return;
}
+ QTextStream inStream(&inFile);
+ while (!inStream.atEnd())
+ configCmdLine.insert(idx++, inStream.readLine().trimmed());
}
}
void Configure::saveCmdLine()
{
if (dictionary[ "REDO" ] != "yes") {
- QFile outFile(buildPath + "/configure.cache");
+ QFile outFile(buildPath + "/config.opt");
if (outFile.open(QFile::WriteOnly | QFile::Text)) {
QTextStream outStream(&outFile);
for (QStringList::Iterator it = configCmdLine.begin(); it != configCmdLine.end(); ++it) {
@@ -4292,26 +1277,8 @@ QString Configure::platformName() const
}
}
-QString Configure::qpaPlatformName() const
-{
- switch (platform()) {
- default:
- case WINDOWS:
- return QStringLiteral("windows");
- case WINDOWS_RT:
- return QStringLiteral("winrt");
- case QNX:
- return QStringLiteral("qnx");
- case ANDROID:
- return QStringLiteral("android");
- case OTHER:
- return QStringLiteral("xcb");
- }
-}
-
int Configure::platform() const
{
- const QString qMakeSpec = dictionary.value("QMAKESPEC");
const QString xQMakeSpec = dictionary.value("XQMAKESPEC");
if ((xQMakeSpec.startsWith("winphone") || xQMakeSpec.startsWith("winrt")))
diff --git a/tools/configure/configureapp.h b/tools/configure/configureapp.h
index 3469b89fc1..6af83d44cd 100644
--- a/tools/configure/configureapp.h
+++ b/tools/configure/configureapp.h
@@ -43,92 +43,33 @@ public:
~Configure();
void parseCmdLine();
- void validateArgs();
- bool displayHelp();
- QString defaultTo(const QString &option);
- bool checkAvailability(const QString &part);
void generateQConfigCpp();
void buildQmake();
- void autoDetection();
- bool verifyConfiguration();
- void generateOutputVars();
+ void prepareConfigureInput();
+ void configure();
+
void generateHeaders();
- void generateCachefile();
- void displayConfig();
void generateMakefiles();
- void generateConfigfiles();
- void detectArch();
- void generateQConfigPri();
void generateQDevicePri();
void prepareConfigTests();
- void showSummary();
- QString firstLicensePath();
bool showLicense(QString licenseFile);
void readLicense();
- QString addDefine(QString def);
-
- enum ProjectType {
- App,
- Lib,
- Subdirs
- };
-
- ProjectType projectType( const QString& proFileName );
bool isDone();
bool isOk();
int platform() const;
QString platformName() const;
- QString qpaPlatformName() const;
private:
- bool checkAngleAvailability(QString *errorMessage = 0) const;
- QString checkAvx512Availability();
-
int verbose;
// Our variable dictionaries
QMap<QString,QString> dictionary;
- QStringList allBuildParts;
- QStringList defaultBuildParts;
- QStringList buildParts;
- QStringList nobuildParts;
- QStringList skipModules;
- QStringList licensedModules;
- QStringList allSqlDrivers;
- QStringList disabledModules;
- QStringList enabledModules;
- QStringList modules;
-// QStringList sqlDrivers;
QStringList configCmdLine;
- QStringList qmakeConfig;
- QStringList qtConfig;
-
- QStringList qmakeSql;
- QStringList qmakeSqlPlugins;
-
- QStringList qmakeStyles;
- QStringList qmakeStylePlugins;
-
- QStringList qmakeVars;
- QStringList qmakeDefines;
- QStringList qmakeIncludes;
- QStringList qmakeLibs;
- QString opensslLibs;
- QString opensslLibsDebug;
- QString opensslLibsRelease;
- QString opensslPath;
- QString dbusPath;
- QString dbusHostPath;
- QString mysqlPath;
- QString psqlLibs;
- QString zlibLibs;
- QString sybase;
- QString sybaseLibs;
QString outputLine;
@@ -147,22 +88,10 @@ private:
void addConfStr(int group, const QString &val);
QString formatPath(const QString &path);
- QString formatPaths(const QStringList &paths);
- QString locateFile(const QString &fileName) const;
- bool findFile(const QString &fileName) const { return !locateFile(fileName).isEmpty(); }
- static QString findFileInPaths(const QString &fileName, const QStringList &paths);
void reloadCmdLine(int idx);
void saveCmdLine();
- void addSysroot(QString *command);
- bool tryCompileProject(const QString &projectPath, const QString &extraOptions = QString(),
- bool distClean = true);
- bool compilerSupportsFlag(const QString &compilerAndArgs);
-
- void desc(const char *description, int startingAt = 0, int wrapIndent = 0);
- void desc(const char *option, const char *description, bool skipIndent = false, char fillChar = '.');
- void desc(const char *mark_option, const char *mark, const char *option, const char *description, char fillChar = '.');
void applySpecSpecifics();
QString formatConfigPath(const char *var);
diff --git a/tools/configure/environment.cpp b/tools/configure/environment.cpp
index 5189883901..78298f1068 100644
--- a/tools/configure/environment.cpp
+++ b/tools/configure/environment.cpp
@@ -118,35 +118,6 @@ QString Environment::detectQMakeSpec()
return spec;
}
-Compiler Environment::compilerFromQMakeSpec(const QString &qmakeSpec)
-{
- if (qmakeSpec == QLatin1String("win32-msvc2015"))
- return CC_MSVC2015;
- if (qmakeSpec == QLatin1String("win32-msvc2013"))
- return CC_MSVC2013;
- if (qmakeSpec == QLatin1String("win32-msvc2012"))
- return CC_MSVC2012;
- if (qmakeSpec == QLatin1String("win32-icc"))
- return CC_INTEL;
- if (qmakeSpec == QLatin1String("win32-g++"))
- return CC_MINGW;
- if (qmakeSpec == QLatin1String("win32-borland"))
- return CC_BORLAND;
- return CC_UNKNOWN;
-}
-
-QString Environment::gccVersion()
-{
- CompilerInfo *info = compilerInfo(CC_MINGW);
- int returnValue = 0;
- QString version = execute(QStringLiteral("%1 -dumpversion").arg(info->executable), &returnValue);
- if (returnValue != 0) {
- cout << "Could not get mingw version" << returnValue << qPrintable(version);
- version.resize(0);
- }
- return version;
-}
-
/*!
Returns the enum of the compiler which was detected on the system.
The compilers are detected in the order as entered into the
@@ -431,189 +402,4 @@ QString Environment::execute(const QString &command, int *returnCode)
return output;
}
-/*!
- Copies the \a srcDir contents into \a destDir.
-
- Returns true if copying was successful.
-*/
-bool Environment::cpdir(const QString &srcDir, const QString &destDir)
-{
- QString cleanSrcName = QDir::cleanPath(srcDir);
- QString cleanDstName = QDir::cleanPath(destDir);
-
-#ifdef CONFIGURE_DEBUG_CP_DIR
- qDebug() << "Attempt to cpdir " << cleanSrcName << "->" << cleanDstName;
-#endif
- if(!QFile::exists(cleanDstName) && !QDir().mkpath(cleanDstName)) {
- qDebug() << "cpdir: Failure to create " << cleanDstName;
- return false;
- }
-
- bool result = true;
- QDir dir = QDir(cleanSrcName);
- QFileInfoList allEntries = dir.entryInfoList(QDir::AllDirs | QDir::Files | QDir::NoDotAndDotDot);
- for (int i = 0; result && (i < allEntries.count()); ++i) {
- QFileInfo entry = allEntries.at(i);
- bool intermediate = true;
- if (entry.isDir()) {
- intermediate = cpdir(QString("%1/%2").arg(cleanSrcName).arg(entry.fileName()),
- QString("%1/%2").arg(cleanDstName).arg(entry.fileName()));
- } else {
- QString destFile = QString("%1/%2").arg(cleanDstName).arg(entry.fileName());
-#ifdef CONFIGURE_DEBUG_CP_DIR
- qDebug() << "About to cp (file)" << entry.absoluteFilePath() << "->" << destFile;
-#endif
- QFile::remove(destFile);
- intermediate = QFile::copy(entry.absoluteFilePath(), destFile);
- SetFileAttributes((wchar_t*)destFile.utf16(), FILE_ATTRIBUTE_NORMAL);
- }
- if (!intermediate) {
- qDebug() << "cpdir: Failure for " << entry.fileName() << entry.isDir();
- result = false;
- }
- }
- return result;
-}
-
-bool Environment::rmdir(const QString &name)
-{
- bool result = true;
- QString cleanName = QDir::cleanPath(name);
-
- QDir dir = QDir(cleanName);
- QFileInfoList allEntries = dir.entryInfoList(QDir::AllDirs | QDir::Files | QDir::NoDotAndDotDot);
- for (int i = 0; result && (i < allEntries.count()); ++i) {
- QFileInfo entry = allEntries.at(i);
- if (entry.isDir()) {
- result &= rmdir(entry.absoluteFilePath());
- } else {
- result &= QFile::remove(entry.absoluteFilePath());
- }
- }
- result &= dir.rmdir(cleanName);
- return result;
-}
-
-static QStringList splitPathList(const QString &path)
-{
-#if defined(Q_OS_WIN)
- QRegExp splitReg(QStringLiteral("[;,]"));
-#else
- QRegExp splitReg(QStringLiteral("[:]"));
-#endif
- QStringList result = path.split(splitReg, QString::SkipEmptyParts);
- const QStringList::iterator end = result.end();
- for (QStringList::iterator it = result.begin(); it != end; ++it) {
- // Remove any leading or trailing ", this is commonly used in the environment
- // variables
- if (it->startsWith('"'))
- it->remove(0, 1);
- if (it->endsWith('"'))
- it->chop(1);
- *it = QDir::cleanPath(*it);
- if (it->endsWith(QLatin1Char('/')))
- it->chop(1);
- }
- return result;
-}
-
-QString Environment::findFileInPaths(const QString &fileName, const QStringList &paths)
-{
- if (!paths.isEmpty()) {
- QDir d;
- const QChar separator = QDir::separator();
- foreach (const QString &path, paths)
- if (d.exists(path + separator + fileName))
- return path;
- }
- return QString();
-}
-
-QStringList Environment::path()
-{
- return splitPathList(QString::fromLocal8Bit(qgetenv("PATH")));
-}
-
-static QStringList mingwPaths(const QString &mingwPath, const QString &pathName)
-{
- QStringList ret;
- QDir mingwDir(mingwPath);
- const QFileInfoList subdirs = mingwDir.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot);
- for (int i = 0 ;i < subdirs.length(); ++i) {
- const QFileInfo &fi = subdirs.at(i);
- const QString name = fi.fileName();
- if (name == pathName)
- ret += fi.absoluteFilePath();
- else if (name.contains(QLatin1String("mingw"))) {
- ret += fi.absoluteFilePath() + QLatin1Char('/') + pathName;
- }
- }
- return ret;
-}
-
-// Return MinGW location from "c:\mingw\bin" -> "c:\mingw"
-static inline QString detectMinGW()
-{
- const QString gcc = QStandardPaths::findExecutable(QLatin1String("g++.exe"));
- return gcc.isEmpty() ?
- gcc : QFileInfo(QFileInfo(gcc).absolutePath()).absolutePath();
-}
-
-// Detect Direct X SDK up tp June 2010. Included in Windows Kit 8.
-QString Environment::detectDirectXSdk()
-{
- const QByteArray directXSdkEnv = qgetenv("DXSDK_DIR");
- if (directXSdkEnv.isEmpty())
- return QString();
- QString directXSdk = QDir::cleanPath(QString::fromLocal8Bit(directXSdkEnv));
- if (directXSdk.endsWith(QLatin1Char('/')))
- directXSdk.truncate(directXSdk.size() - 1);
- return directXSdk;
-}
-
-QStringList Environment::headerPaths(Compiler compiler)
-{
- QStringList headerPaths;
- if (compiler == CC_MINGW) {
- const QString mingwPath = detectMinGW();
- headerPaths = mingwPaths(mingwPath, QLatin1String("include"));
- // Additional compiler paths
- const QFileInfoList mingwConfigs = QDir(mingwPath + QLatin1String("/lib/gcc")).entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot);
- for (int i = 0; i < mingwConfigs.length(); ++i) {
- const QDir mingwLibDir = mingwConfigs.at(i).absoluteFilePath();
- foreach (const QFileInfo &version, mingwLibDir.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot))
- headerPaths += version.absoluteFilePath() + QLatin1String("/include");
- }
- } else {
- headerPaths = splitPathList(QString::fromLocal8Bit(getenv("INCLUDE")));
- }
-
- // Add Direct X SDK for ANGLE
- const QString directXSdk = detectDirectXSdk();
- if (!directXSdk.isEmpty()) // Add Direct X SDK for ANGLE
- headerPaths += directXSdk + QLatin1String("/include");
- return headerPaths;
-}
-
-QStringList Environment::libraryPaths(Compiler compiler)
-{
- QStringList libraryPaths;
- if (compiler == CC_MINGW) {
- libraryPaths = mingwPaths(detectMinGW(), "lib");
- } else {
- libraryPaths = splitPathList(QString::fromLocal8Bit(qgetenv("LIB")));
- }
-
- // Add Direct X SDK for ANGLE
- const QString directXSdk = detectDirectXSdk();
- if (!directXSdk.isEmpty()) {
-#ifdef Q_OS_WIN64
- libraryPaths += directXSdk + QLatin1String("/lib/x64");
-#else
- libraryPaths += directXSdk + QLatin1String("/lib/x86");
-#endif
- }
- return libraryPaths;
-}
-
QT_END_NAMESPACE
diff --git a/tools/configure/environment.h b/tools/configure/environment.h
index 893e33c76f..d14961b5ac 100644
--- a/tools/configure/environment.h
+++ b/tools/configure/environment.h
@@ -50,20 +50,9 @@ class Environment
public:
static Compiler detectCompiler();
static QString detectQMakeSpec();
- static Compiler compilerFromQMakeSpec(const QString &qmakeSpec);
- static QString gccVersion();
static int execute(QStringList arguments, const QStringList &additionalEnv, const QStringList &removeEnv);
static QString execute(const QString &command, int *returnCode = 0);
- static bool cpdir(const QString &srcDir, const QString &destDir);
- static bool rmdir(const QString &name);
-
- static QString findFileInPaths(const QString &fileName, const QStringList &paths);
- static QStringList path();
-
- static QString detectDirectXSdk();
- static QStringList headerPaths(Compiler compiler);
- static QStringList libraryPaths(Compiler compiler);
private:
static Compiler detectedCompiler;
diff --git a/tools/configure/main.cpp b/tools/configure/main.cpp
index d4f654150e..ac521f42e4 100644
--- a/tools/configure/main.cpp
+++ b/tools/configure/main.cpp
@@ -42,11 +42,8 @@ int runConfigure( int argc, char** argv )
return 3;
app.parseCmdLine();
- app.validateArgs();
if (!app.isOk())
return 3;
- if( app.displayHelp() )
- return 1;
// Read license now, and exit if it doesn't pass.
// This lets the user see the command-line options of configure
@@ -78,29 +75,12 @@ int runConfigure( int argc, char** argv )
if (!app.isOk())
return 3;
- // Auto-detect modules and settings.
- app.autoDetection();
-
- // After reading all command-line arguments, and doing all the
- // auto-detection, it's time to do some last minute validation.
- // If the validation fails, we cannot continue.
- if (!app.verifyConfiguration())
+ // run qmake based configure
+ app.configure();
+ if (!app.isOk())
return 3;
- app.generateOutputVars();
-
- if( !app.isDone() )
- app.generateCachefile();
- if( !app.isDone() )
- app.generateConfigfiles();
- if (!app.isDone())
- app.generateQConfigPri();
- if (!app.isDone())
- app.displayConfig();
- if( !app.isDone() )
- app.generateMakefiles();
- if( !app.isDone() )
- app.showSummary();
+ app.generateMakefiles();
if( !app.isOk() )
return 2;