summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-12-13 09:36:26 +0100
committerLiang Qi <liang.qi@qt.io>2016-12-13 09:39:20 +0100
commit6755ec891a1740110c48895afd53d39e8370704a (patch)
tree982606f3bc582262e4b315a63f55ccb141fff97b
parent449204f8c0d6679ae0e58dbb8a30b8a86fbdb4ec (diff)
parent00c9ec63a552d040e851b561c11428fabf1a2b08 (diff)
Merge remote-tracking branch 'origin/5.8' into dev
Conflicts: configure qmake/Makefile.unix.macos qmake/Makefile.unix.win32 qmake/generators/win32/msvc_vcproj.cpp src/3rdparty/pcre/qt_attribution.json src/corelib/io/qsettings.cpp src/corelib/kernel/qdeadlinetimer.cpp src/platformsupport/kmsconvenience/qkmsdevice.cpp src/platformsupport/kmsconvenience/qkmsdevice_p.h src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.cpp src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldevicescreen.cpp src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsdevice.cpp src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsscreen.h tests/manual/qstorageinfo/printvolumes.cpp tools/configure/configureapp.cpp Change-Id: Ibaabcc8e965c44926f9fb018466e8b132b8df49e
-rwxr-xr-xconfigure314
-rw-r--r--configure.json14
-rw-r--r--configure.pri179
-rw-r--r--dist/changes-5.7.1221
-rw-r--r--doc/src/images/analogclock-example.pngbin14556 -> 6571 bytes
-rw-r--r--doc/src/images/calculator-example.pngbin10742 -> 12653 bytes
-rw-r--r--doc/src/images/calendarwidgetexample.pngbin38434 -> 20752 bytes
-rw-r--r--doc/src/images/charactermap-example.pngbin27937 -> 16452 bytes
-rw-r--r--doc/src/images/codeeditor-example.pngbin9202 -> 14994 bytes
-rw-r--r--doc/src/images/digitalclock-example.pngbin6603 -> 1376 bytes
-rw-r--r--doc/src/images/groupbox-example.pngbin18620 -> 9706 bytes
-rw-r--r--doc/src/images/imageviewer-example.pngbin168586 -> 252124 bytes
-rw-r--r--doc/src/images/lineedits-example.pngbin14584 -> 8237 bytes
-rw-r--r--doc/src/images/movie-example.pngbin12361 -> 22648 bytes
-rw-r--r--doc/src/images/scribble-example.pngbin19910 -> 5304 bytes
-rw-r--r--doc/src/images/spinboxes-example.pngbin24842 -> 21874 bytes
-rw-r--r--doc/src/images/styles-enabledwood.pngbin130767 -> 136903 bytes
-rw-r--r--doc/src/images/tetrix-example.pngbin9980 -> 5396 bytes
-rw-r--r--doc/src/images/wiggly-example.pngbin6546 -> 8456 bytes
-rw-r--r--doc/src/images/windowflags-example.pngbin22945 -> 38998 bytes
-rw-r--r--examples/network/multistreamserver/server.cpp2
-rw-r--r--examples/widgets/animation/appchooser/main.cpp6
-rw-r--r--examples/widgets/animation/moveblocks/main.cpp10
-rw-r--r--examples/widgets/animation/states/main.cpp2
-rw-r--r--examples/widgets/animation/stickman/graphicsview.h2
-rw-r--r--examples/widgets/animation/stickman/lifecycle.cpp4
-rw-r--r--examples/widgets/animation/stickman/rectbutton.h6
-rw-r--r--examples/widgets/animation/stickman/stickman.h4
-rw-r--r--examples/widgets/animation/sub-attaq/boat.h2
-rw-r--r--examples/widgets/animation/sub-attaq/boat_p.h6
-rw-r--r--examples/widgets/animation/sub-attaq/states.h6
-rw-r--r--examples/widgets/animation/sub-attaq/submarine.h2
-rw-r--r--examples/widgets/desktop/systray/doc/images/systemtray-editor.pngbin18147 -> 25407 bytes
-rw-r--r--examples/widgets/desktop/systray/doc/src/systray.qdoc5
-rw-r--r--examples/widgets/doc/images/systemtray-editor.pngbin18147 -> 25407 bytes
-rw-r--r--examples/widgets/doc/src/analogclock.qdoc3
-rw-r--r--examples/widgets/doc/src/calculator.qdoc6
-rw-r--r--examples/widgets/doc/src/calendarwidget.qdoc2
-rw-r--r--examples/widgets/doc/src/charactermap.qdoc3
-rw-r--r--examples/widgets/doc/src/codeeditor.qdoc2
-rw-r--r--examples/widgets/doc/src/digitalclock.qdoc3
-rw-r--r--examples/widgets/doc/src/groupbox.qdoc2
-rw-r--r--examples/widgets/doc/src/imageviewer.qdoc3
-rw-r--r--examples/widgets/doc/src/lineedits.qdoc2
-rw-r--r--examples/widgets/doc/src/movie.qdoc2
-rw-r--r--examples/widgets/doc/src/shapedclock.qdoc2
-rw-r--r--examples/widgets/doc/src/sliders.qdoc3
-rw-r--r--examples/widgets/doc/src/spinboxes.qdoc2
-rw-r--r--examples/widgets/doc/src/styles.qdoc3
-rw-r--r--examples/widgets/doc/src/stylesheet.qdoc3
-rw-r--r--examples/widgets/doc/src/tetrix.qdoc2
-rw-r--r--examples/widgets/doc/src/wiggly.qdoc3
-rw-r--r--examples/widgets/doc/src/windowflags.qdoc3
-rw-r--r--examples/widgets/graphicsview/boxes/glbuffers.h14
-rw-r--r--examples/widgets/graphicsview/boxes/qtbox.h32
-rw-r--r--examples/widgets/graphicsview/boxes/scene.h26
-rw-r--r--examples/widgets/graphicsview/chip/view.cpp2
-rw-r--r--examples/widgets/graphicsview/dragdroprobot/main.cpp2
-rw-r--r--examples/widgets/graphicsview/weatheranchorlayout/main.cpp2
-rw-r--r--examples/widgets/itemviews/frozencolumn/freezetablewidget.h4
-rw-r--r--examples/widgets/painting/fontsampler/mainwindow.cpp4
-rw-r--r--examples/widgets/painting/fontsampler/mainwindow.h2
-rw-r--r--examples/widgets/richtext/textedit/textedit.h2
-rw-r--r--examples/widgets/statemachine/factorial/main.cpp8
-rw-r--r--examples/widgets/statemachine/pingpong/main.cpp10
-rw-r--r--examples/widgets/statemachine/trafficlight/main.cpp2
-rw-r--r--mkspecs/android-clang/qmake.conf3
-rw-r--r--mkspecs/features/moc.prf3
-rw-r--r--mkspecs/features/qt.prf9
-rw-r--r--mkspecs/features/qt_app.prf2
-rw-r--r--mkspecs/features/qt_build_config.prf16
-rw-r--r--mkspecs/features/qt_configure.prf16
-rw-r--r--mkspecs/features/qt_example_installs.prf3
-rw-r--r--mkspecs/features/qt_module_headers.prf11
-rw-r--r--mkspecs/win32-msvc2017/qmake.conf10
-rw-r--r--mkspecs/win32-msvc2017/qplatformdefs.h34
-rw-r--r--qmake/Makefile.unix9
-rw-r--r--qmake/Makefile.unix.macos17
-rw-r--r--qmake/Makefile.unix.mingw27
-rw-r--r--qmake/Makefile.unix.unix11
-rw-r--r--qmake/Makefile.unix.win3221
-rw-r--r--qmake/Makefile.win3216
-rw-r--r--qmake/doc/src/qmake-manual.qdoc6
-rw-r--r--qmake/generators/makefile.cpp2
-rw-r--r--qmake/generators/win32/mingw_make.cpp9
-rw-r--r--qmake/generators/win32/msvc_nmake.cpp9
-rw-r--r--qmake/generators/win32/msvc_objectmodel.cpp9
-rw-r--r--qmake/generators/win32/msvc_objectmodel.h13
-rw-r--r--qmake/generators/win32/msvc_vcproj.cpp18
-rw-r--r--qmake/generators/win32/winmakefile.cpp24
-rw-r--r--qmake/library/qmakeevaluator.cpp13
-rw-r--r--qmake/qmake.pro1
-rw-r--r--src/3rdparty/angle/qt_attribution.json8
-rw-r--r--src/3rdparty/forkfd/LICENSE1
-rw-r--r--src/3rdparty/forkfd/qt_attribution.json2
-rw-r--r--src/3rdparty/freebsd/qt_attribution.json10
-rw-r--r--src/3rdparty/sha3/qt_attribution.json2
-rw-r--r--src/concurrent/qtconcurrentfilterkernel.h28
-rw-r--r--src/concurrent/qtconcurrentiteratekernel.h6
-rw-r--r--src/concurrent/qtconcurrentmapkernel.h22
-rw-r--r--src/concurrent/qtconcurrentreducekernel.h2
-rw-r--r--src/concurrent/qtconcurrentrunbase.h6
-rw-r--r--src/concurrent/qtconcurrentstoredfunctioncall.h148
-rw-r--r--src/corelib/Qt5Config.cmake.in12
-rw-r--r--src/corelib/Qt5ModuleLocation.cmake.in15
-rw-r--r--src/corelib/Qt5ModuleLocationForInstall.cmake.in4
-rw-r--r--src/corelib/codecs/codecs.pri6
-rw-r--r--src/corelib/codecs/qiconvcodec.cpp56
-rw-r--r--src/corelib/codecs/qiconvcodec_p.h8
-rw-r--r--src/corelib/codecs/qsimplecodec_p.h10
-rw-r--r--src/corelib/codecs/qtextcodec.cpp24
-rw-r--r--src/corelib/configure.json34
-rw-r--r--src/corelib/corelib.pro21
-rw-r--r--src/corelib/global/global.pri12
-rw-r--r--src/corelib/global/qcompilerdetection.h9
-rw-r--r--src/corelib/global/qconfig-bootstrapped.h5
-rw-r--r--src/corelib/global/qglobal.cpp6
-rw-r--r--src/corelib/global/qglobal.h26
-rw-r--r--src/corelib/global/qlibraryinfo.cpp4
-rw-r--r--src/corelib/global/qlogging.cpp25
-rw-r--r--src/corelib/io/PSL-LICENSE.txt373
-rw-r--r--src/corelib/io/qdir.cpp126
-rw-r--r--src/corelib/io/qfile_p.h2
-rw-r--r--src/corelib/io/qfilesystemengine_unix.cpp20
-rw-r--r--src/corelib/io/qresource.cpp126
-rw-r--r--src/corelib/io/qresource.h1
-rw-r--r--src/corelib/io/qsettings.cpp72
-rw-r--r--src/corelib/io/qt_attribution.json29
-rw-r--r--src/corelib/io/qtemporaryfile_p.h14
-rw-r--r--src/corelib/io/qurl.cpp6
-rw-r--r--src/corelib/io/qurltlds_p.h.INFO3
-rw-r--r--src/corelib/json/qjsonparser.cpp5
-rw-r--r--src/corelib/json/qjsonparser_p.h5
-rw-r--r--src/corelib/kernel/kernel.pri3
-rw-r--r--src/corelib/kernel/qcore_unix.cpp14
-rw-r--r--src/corelib/kernel/qdeadlinetimer.h14
-rw-r--r--src/corelib/kernel/qelapsedtimer.cpp2
-rw-r--r--src/corelib/kernel/qeventdispatcher_winrt.cpp11
-rw-r--r--src/corelib/kernel/qobjectdefs_impl.h10
-rw-r--r--src/corelib/kernel/qvariant.cpp4
-rw-r--r--src/corelib/mimetypes/qmimedatabase.cpp2
-rw-r--r--src/corelib/mimetypes/qmimetypeparser_p.h10
-rw-r--r--src/corelib/statemachine/qhistorystate_p.h4
-rw-r--r--src/corelib/thread/qbasicatomic.h5
-rw-r--r--src/corelib/thread/qfutureinterface.cpp109
-rw-r--r--src/corelib/thread/qfutureinterface_p.h2
-rw-r--r--src/corelib/thread/qmutex.cpp4
-rw-r--r--src/corelib/thread/qmutex.h38
-rw-r--r--src/corelib/tools/qalgorithms.h39
-rw-r--r--src/corelib/tools/qcollator_p.h6
-rw-r--r--src/corelib/tools/qcommandlineoption.h2
-rw-r--r--src/corelib/tools/qdatetime.cpp2
-rw-r--r--src/corelib/tools/qdatetimeparser.cpp2
-rw-r--r--src/corelib/tools/qdatetimeparser_p.h84
-rw-r--r--src/corelib/tools/qlocale.cpp4
-rw-r--r--src/corelib/tools/qlocale_p.h2
-rw-r--r--src/corelib/tools/qmap.cpp4
-rw-r--r--src/corelib/tools/qmap.h11
-rw-r--r--src/corelib/tools/qstring.cpp110
-rw-r--r--src/corelib/tools/qtimezone.cpp12
-rw-r--r--src/corelib/tools/qtimezoneprivate.cpp2
-rw-r--r--src/corelib/tools/qtimezoneprivate_p.h12
-rw-r--r--src/corelib/tools/qtimezoneprivate_tz.cpp20
-rw-r--r--src/corelib/tools/qvarlengtharray.h3
-rw-r--r--src/corelib/tools/tools.pri1
-rw-r--r--src/dbus/qdbuspendingreply.h4
-rw-r--r--src/dbus/qdbusreply.h2
-rw-r--r--src/gui/configure.json13
-rw-r--r--src/gui/image/qimage.h3
-rw-r--r--src/gui/image/qimage_sse2.cpp59
-rw-r--r--src/gui/image/qxbmhandler.cpp13
-rw-r--r--src/gui/kernel/qguiapplication.cpp2
-rw-r--r--src/gui/kernel/qguiapplication_p.h1
-rw-r--r--src/gui/kernel/qkeysequence.cpp4
-rw-r--r--src/gui/kernel/qplatformnativeinterface.cpp1
-rw-r--r--src/gui/math3d/qmatrix4x4.h42
-rw-r--r--src/gui/math3d/qquaternion.h5
-rw-r--r--src/gui/opengl/opengl.pri1
-rw-r--r--src/gui/opengl/qopenglshadercache_meego_p.h450
-rw-r--r--src/gui/opengl/qopenglshadercache_p.h5
-rw-r--r--src/gui/opengl/qopengltexture.cpp170
-rw-r--r--src/gui/opengl/qopengltexture.h28
-rw-r--r--src/gui/painting/qblendfunctions.cpp30
-rw-r--r--src/gui/painting/qcolor.cpp8
-rw-r--r--src/gui/painting/qcoregraphics.mm7
-rw-r--r--src/gui/painting/qcoregraphics_p.h2
-rw-r--r--src/gui/painting/qdrawhelper.cpp257
-rw-r--r--src/gui/painting/qdrawhelper_avx2.cpp8
-rw-r--r--src/gui/painting/qdrawhelper_neon.cpp2
-rw-r--r--src/gui/painting/qdrawhelper_sse2.cpp11
-rw-r--r--src/gui/text/qcssparser.cpp1
-rw-r--r--src/gui/text/qfontdatabase.cpp10
-rw-r--r--src/gui/text/qfontengine.cpp11
-rw-r--r--src/gui/text/qfontengine_p.h1
-rw-r--r--src/gui/text/qharfbuzzng_p.h3
-rw-r--r--src/gui/text/qinputcontrol.cpp82
-rw-r--r--src/gui/text/qinputcontrol_p.h76
-rw-r--r--src/gui/text/qtextengine.cpp19
-rw-r--r--src/gui/text/qtextengine_p.h2
-rw-r--r--src/gui/text/text.pri10
-rw-r--r--src/network/access/qnetworkaccessmanager.cpp2
-rw-r--r--src/network/configure.json2
-rw-r--r--src/network/kernel/qnetworkproxy.cpp8
-rw-r--r--src/network/socket/qabstractsocket.cpp13
-rw-r--r--src/network/socket/qabstractsocket_p.h12
-rw-r--r--src/network/socket/qlocalsocket_p.h4
-rw-r--r--src/network/socket/qnativesocketengine.cpp6
-rw-r--r--src/network/socket/qnativesocketengine_winrt.cpp84
-rw-r--r--src/network/socket/qsctpserver.cpp28
-rw-r--r--src/network/socket/qsctpserver.h4
-rw-r--r--src/network/socket/qsctpserver_p.h2
-rw-r--r--src/network/socket/qsctpsocket.cpp44
-rw-r--r--src/network/socket/qsctpsocket.h6
-rw-r--r--src/network/socket/qsctpsocket_p.h2
-rw-r--r--src/network/ssl/qsslsocket.cpp2
-rw-r--r--src/opengl/gl2paintengineex/qglgradientcache_p.h4
-rw-r--r--src/opengl/gl2paintengineex/qglshadercache_meego_p.h450
-rw-r--r--src/opengl/gl2paintengineex/qglshadercache_p.h5
-rw-r--r--src/opengl/opengl.pro3
-rw-r--r--src/opengl/qglpixelbuffer_p.h10
-rw-r--r--src/platformsupport/eglconvenience/qeglstreamconvenience_p.h4
-rw-r--r--src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm37
-rw-r--r--src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h2
-rw-r--r--src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp217
-rw-r--r--src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_ft.cpp105
-rw-r--r--src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_p.h25
-rw-r--r--src/platformsupport/fontdatabases/windows/qwindowsfontengine.cpp16
-rw-r--r--src/platformsupport/fontdatabases/winrt/qwinrtfontdatabase.cpp22
-rw-r--r--src/platformsupport/fontdatabases/winrt/qwinrtfontdatabase_p.h16
-rw-r--r--src/platformsupport/kmsconvenience/qkmsdevice.cpp38
-rw-r--r--src/platformsupport/kmsconvenience/qkmsdevice_p.h3
-rw-r--r--src/platformsupport/services/genericunix/qgenericunixservices.cpp3
-rw-r--r--src/platformsupport/themes/genericunix/dbusmenu/qdbusmenuconnection.cpp9
-rw-r--r--src/platformsupport/themes/genericunix/dbusmenu/qdbusmenuconnection_p.h2
-rw-r--r--src/platformsupport/themes/genericunix/dbustray/qdbustrayicon.cpp11
-rw-r--r--src/platformsupport/themes/genericunix/dbustray/qdbustrayicon_p.h1
-rw-r--r--src/plugins/platforms/android/androidplatformplugin.cpp2
-rw-r--r--src/plugins/platforms/android/qandroidassetsfileenginehandler.cpp34
-rw-r--r--src/plugins/platforms/android/qandroidassetsfileenginehandler.h2
-rw-r--r--src/plugins/platforms/android/qandroideventdispatcher.h2
-rw-r--r--src/plugins/platforms/android/qandroidinputcontext.h24
-rw-r--r--src/plugins/platforms/android/qandroidplatformaccessibility.h2
-rw-r--r--src/plugins/platforms/android/qandroidplatformbackingstore.h8
-rw-r--r--src/plugins/platforms/android/qandroidplatformclipboard.h6
-rw-r--r--src/plugins/platforms/android/qandroidplatformdialoghelpers.h8
-rw-r--r--src/plugins/platforms/android/qandroidplatformfontdatabase.h10
-rw-r--r--src/plugins/platforms/android/qandroidplatformforeignwindow.h12
-rw-r--r--src/plugins/platforms/android/qandroidplatformintegration.cpp6
-rw-r--r--src/plugins/platforms/android/qandroidplatformintegration.h34
-rw-r--r--src/plugins/platforms/android/qandroidplatformmenu.h28
-rw-r--r--src/plugins/platforms/android/qandroidplatformmenubar.h10
-rw-r--r--src/plugins/platforms/android/qandroidplatformmenuitem.h28
-rw-r--r--src/plugins/platforms/android/qandroidplatformopenglcontext.cpp5
-rw-r--r--src/plugins/platforms/android/qandroidplatformopenglcontext.h8
-rw-r--r--src/plugins/platforms/android/qandroidplatformopenglwindow.h10
-rw-r--r--src/plugins/platforms/android/qandroidplatformscreen.h22
-rw-r--r--src/plugins/platforms/android/qandroidplatformservices.h6
-rw-r--r--src/plugins/platforms/android/qandroidplatformtheme.h20
-rw-r--r--src/plugins/platforms/android/qandroidplatformwindow.h22
-rw-r--r--src/plugins/platforms/android/qandroidsystemlocale.h4
-rw-r--r--src/plugins/platforms/cocoa/COCOA_LICENSE.txt29
-rw-r--r--src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm14
-rw-r--r--src/plugins/platforms/cocoa/qcocoaintegration.mm14
-rw-r--r--src/plugins/platforms/cocoa/qcocoamenuitem.mm2
-rw-r--r--src/plugins/platforms/cocoa/qt_attribution.json13
-rw-r--r--src/plugins/platforms/direct2d/qwindowsdirect2dpaintengine.cpp2
-rw-r--r--src/plugins/platforms/eglfs/api/qeglfsintegration.cpp2
-rw-r--r--src/plugins/platforms/eglfs/api/qeglfswindow.cpp2
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.cpp37
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp42
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldevicescreen.cpp35
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_mali/qeglfsmaliintegration.cpp4
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_x11/qeglfsx11integration.cpp2
-rw-r--r--src/plugins/platforms/qnx/main.h2
-rw-r--r--src/plugins/platforms/qnx/qqnxclipboard.cpp6
-rw-r--r--src/plugins/platforms/qnx/qqnxclipboard.h4
-rw-r--r--src/plugins/platforms/qnx/qqnxcursor.h6
-rw-r--r--src/plugins/platforms/qnx/qqnxeglwindow.h6
-rw-r--r--src/plugins/platforms/qnx/qqnxglcontext.h12
-rw-r--r--src/plugins/platforms/qnx/qqnxinputcontext_imf.h24
-rw-r--r--src/plugins/platforms/qnx/qqnxinputcontext_noimf.h18
-rw-r--r--src/plugins/platforms/qnx/qqnxintegration.h24
-rw-r--r--src/plugins/platforms/qnx/qqnxnativeinterface.h12
-rw-r--r--src/plugins/platforms/qnx/qqnxnavigatorpps.h2
-rw-r--r--src/plugins/platforms/qnx/qqnxrasterbackingstore.h12
-rw-r--r--src/plugins/platforms/qnx/qqnxrasterwindow.h6
-rw-r--r--src/plugins/platforms/qnx/qqnxscreen.h24
-rw-r--r--src/plugins/platforms/qnx/qqnxscreeneventhandler.h2
-rw-r--r--src/plugins/platforms/qnx/qqnxscreeneventthread.h2
-rw-r--r--src/plugins/platforms/qnx/qqnxservices.h4
-rw-r--r--src/plugins/platforms/qnx/qqnxvirtualkeyboardpps.h6
-rw-r--r--src/plugins/platforms/qnx/qqnxwindow.h22
-rw-r--r--src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.cpp2
-rw-r--r--src/plugins/platforms/windows/qwin10helpers.cpp167
-rw-r--r--src/plugins/platforms/windows/qwin10helpers.h52
-rw-r--r--src/plugins/platforms/windows/qwindowsclipboard.h2
-rw-r--r--src/plugins/platforms/windows/qwindowsintegration.cpp7
-rw-r--r--src/plugins/platforms/windows/qwindowskeymapper.cpp3
-rw-r--r--src/plugins/platforms/windows/windows.pri4
-rw-r--r--src/plugins/platforms/winrt/main.cpp2
-rw-r--r--src/plugins/platforms/winrt/qwinrtbackingstore.h12
-rw-r--r--src/plugins/platforms/winrt/qwinrtclipboard.h6
-rw-r--r--src/plugins/platforms/winrt/qwinrtcursor.h4
-rw-r--r--src/plugins/platforms/winrt/qwinrtdrag.h10
-rw-r--r--src/plugins/platforms/winrt/qwinrteglcontext.h12
-rw-r--r--src/plugins/platforms/winrt/qwinrteventdispatcher.h4
-rw-r--r--src/plugins/platforms/winrt/qwinrtfiledialoghelper.h24
-rw-r--r--src/plugins/platforms/winrt/qwinrtfileengine.h34
-rw-r--r--src/plugins/platforms/winrt/qwinrtinputcontext.h8
-rw-r--r--src/plugins/platforms/winrt/qwinrtintegration.h34
-rw-r--r--src/plugins/platforms/winrt/qwinrtmessagedialoghelper.h6
-rw-r--r--src/plugins/platforms/winrt/qwinrtscreen.h20
-rw-r--r--src/plugins/platforms/winrt/qwinrtservices.h4
-rw-r--r--src/plugins/platforms/winrt/qwinrttheme.h6
-rw-r--r--src/plugins/platforms/winrt/qwinrtwindow.h22
-rw-r--r--src/plugins/platforms/xcb/gl_integrations/qxcbglintegrationfactory.cpp23
-rw-r--r--src/plugins/platforms/xcb/gl_integrations/qxcbglintegrationfactory.h1
-rw-r--r--src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglintegration.h10
-rw-r--r--src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglnativeinterfacehandler.h6
-rw-r--r--src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglwindow.h6
-rw-r--r--src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.h18
-rw-r--r--src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxintegration.h14
-rw-r--r--src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxnativeinterfacehandler.h2
-rw-r--r--src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxwindow.h2
-rw-r--r--src/plugins/platforms/xcb/qxcbbackingstore.cpp12
-rw-r--r--src/plugins/platforms/xcb/qxcbbackingstore.h18
-rw-r--r--src/plugins/platforms/xcb/qxcbclipboard.cpp8
-rw-r--r--src/plugins/platforms/xcb/qxcbclipboard.h8
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection.cpp3
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection.h13
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection_xi2.cpp40
-rw-r--r--src/plugins/platforms/xcb/qxcbcursor.h6
-rw-r--r--src/plugins/platforms/xcb/qxcbdrag.cpp6
-rw-r--r--src/plugins/platforms/xcb/qxcbdrag.h18
-rw-r--r--src/plugins/platforms/xcb/qxcbintegration.cpp8
-rw-r--r--src/plugins/platforms/xcb/qxcbintegration.h44
-rw-r--r--src/plugins/platforms/xcb/qxcbmain.cpp2
-rw-r--r--src/plugins/platforms/xcb/qxcbnativeinterface.h24
-rw-r--r--src/plugins/platforms/xcb/qxcbscreen.h28
-rw-r--r--src/plugins/platforms/xcb/qxcbsessionmanager.h16
-rw-r--r--src/plugins/platforms/xcb/qxcbsystemtraytracker.h2
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.cpp12
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.h92
-rw-r--r--src/plugins/platforms/xcb/qxcbxsettings.h2
-rw-r--r--src/plugins/sqldrivers/mysql/qsql_mysql.cpp2
-rw-r--r--src/printsupport/dialogs/qabstractprintdialog.h2
-rw-r--r--src/printsupport/kernel/kernel.pri2
-rw-r--r--src/printsupport/kernel/qpaintengine_alpha_p.h16
-rw-r--r--src/printsupport/kernel/qpaintengine_preview_p.h30
-rw-r--r--src/sql/models/qsqlrelationaldelegate.h4
-rw-r--r--src/src.pro8
-rw-r--r--src/testlib/doc/snippets/code/doc_src_qsignalspy.cpp2
-rw-r--r--src/testlib/doc/src/qttestlib-manual.qdoc29
-rw-r--r--src/testlib/qbenchmarkevent_p.h18
-rw-r--r--src/testlib/qbenchmarktimemeasurers_p.h32
-rw-r--r--src/testlib/qbenchmarkvalgrind_p.h16
-rw-r--r--src/testlib/qplaintestlogger_p.h14
-rw-r--r--src/testlib/qteamcitylogger_p.h14
-rw-r--r--src/testlib/qtestcase.cpp19
-rw-r--r--src/testlib/qtestcase.h2
-rw-r--r--src/testlib/qtestevent.h16
-rw-r--r--src/testlib/qtesteventloop.h2
-rw-r--r--src/testlib/qxctestlogger.mm2
-rw-r--r--src/testlib/qxmltestlogger_p.h14
-rw-r--r--src/testlib/qxunittestlogger_p.h14
-rw-r--r--src/tools/moc/moc.cpp5
-rw-r--r--src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp39
-rw-r--r--src/tools/rcc/rcc.cpp46
-rw-r--r--src/tools/rcc/rcc.h1
-rw-r--r--src/tools/uic/qclass_lib_map.h6
-rw-r--r--src/widgets/accessible/itemviews.cpp42
-rw-r--r--src/widgets/accessible/itemviews_p.h2
-rw-r--r--src/widgets/configure.json12
-rw-r--r--src/widgets/dialogs/qdialog.h18
-rw-r--r--src/widgets/dialogs/qwizard.cpp55
-rw-r--r--src/widgets/dialogs/qwizard_win.cpp7
-rw-r--r--src/widgets/dialogs/qwizard_win_p.h4
-rw-r--r--src/widgets/graphicsview/qgraphicsproxywidget_p.h2
-rw-r--r--src/widgets/graphicsview/qgraphicswidget_p.cpp2
-rw-r--r--src/widgets/itemviews/qabstractitemview_p.h14
-rw-r--r--src/widgets/itemviews/qheaderview_p.h2
-rw-r--r--src/widgets/itemviews/qitemeditorfactory.h4
-rw-r--r--src/widgets/itemviews/qlistview_p.h94
-rw-r--r--src/widgets/itemviews/qlistwidget_p.h26
-rw-r--r--src/widgets/itemviews/qtablewidget_p.h38
-rw-r--r--src/widgets/itemviews/qtreeview.cpp2
-rw-r--r--src/widgets/itemviews/qtreeview_p.h14
-rw-r--r--src/widgets/kernel/qapplication_p.h1
-rw-r--r--src/widgets/kernel/qformlayout.cpp25
-rw-r--r--src/widgets/kernel/qlayoutitem.h48
-rw-r--r--src/widgets/kernel/qwidget.h10
-rw-r--r--src/widgets/styles/qandroidstyle.cpp4
-rw-r--r--src/widgets/styles/qandroidstyle_p.h4
-rw-r--r--src/widgets/styles/qfusionstyle.cpp4
-rw-r--r--src/widgets/styles/qfusionstyle_p.h4
-rw-r--r--src/widgets/styles/qfusionstyle_p_p.h4
-rw-r--r--src/widgets/styles/qmacstyle_mac_p.h2
-rw-r--r--src/widgets/styles/qstylefactory.cpp34
-rw-r--r--src/widgets/styles/qstyleoption.cpp5
-rw-r--r--src/widgets/styles/qstylesheetstyle.cpp4
-rw-r--r--src/widgets/styles/qwindowsstyle.cpp4
-rw-r--r--src/widgets/styles/qwindowsstyle_p.h4
-rw-r--r--src/widgets/styles/qwindowsstyle_p_p.h4
-rw-r--r--src/widgets/styles/qwindowsvistastyle.cpp2
-rw-r--r--src/widgets/styles/qwindowsvistastyle_p.h4
-rw-r--r--src/widgets/styles/qwindowsvistastyle_p_p.h4
-rw-r--r--src/widgets/styles/qwindowsxpstyle.cpp2
-rw-r--r--src/widgets/styles/qwindowsxpstyle_p.h4
-rw-r--r--src/widgets/styles/qwindowsxpstyle_p_p.h4
-rw-r--r--src/widgets/styles/styles.pri38
-rw-r--r--src/widgets/util/qflickgesture_p.h6
-rw-r--r--src/widgets/widgets/qabstractspinbox.h40
-rw-r--r--src/widgets/widgets/qabstractspinbox_p.h4
-rw-r--r--src/widgets/widgets/qcombobox.cpp6
-rw-r--r--src/widgets/widgets/qcombobox_p.h46
-rw-r--r--src/widgets/widgets/qdatetimeedit.h26
-rw-r--r--src/widgets/widgets/qdatetimeedit_p.h8
-rw-r--r--src/widgets/widgets/qdockwidget.cpp4
-rw-r--r--src/widgets/widgets/qlineedit.cpp2
-rw-r--r--src/widgets/widgets/qmacnativewidget_mac.h4
-rw-r--r--src/widgets/widgets/qmdiarea.cpp2
-rw-r--r--src/widgets/widgets/qmdisubwindow.cpp24
-rw-r--r--src/widgets/widgets/qmdisubwindow_p.h2
-rw-r--r--src/widgets/widgets/qmenubar.h36
-rw-r--r--src/widgets/widgets/qpushbutton.h3
-rw-r--r--src/widgets/widgets/qspinbox.h10
-rw-r--r--src/widgets/widgets/qwidgetlinecontrol.cpp18
-rw-r--r--src/widgets/widgets/qwidgetlinecontrol_p.h6
-rw-r--r--src/widgets/widgets/qwidgettextcontrol.cpp17
-rw-r--r--src/widgets/widgets/qwidgettextcontrol_p.h3
-rw-r--r--tests/auto/corelib/global/qhooks/tst_qhooks.cpp70
-rw-r--r--tests/auto/corelib/io/qdir/tst_qdir.cpp23
-rw-r--r--tests/auto/corelib/io/qfile/tst_qfile.cpp8
-rw-r--r--tests/auto/corelib/io/qresourceengine/tst_qresourceengine.cpp15
-rw-r--r--tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp14
-rw-r--r--tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp20
-rw-r--r--tests/auto/corelib/io/qurl/tst_qurl.cpp50
-rw-r--r--tests/auto/corelib/kernel/qobject/tst_qobject.cpp40
-rw-r--r--tests/auto/corelib/thread/qmutex/tst_qmutex.cpp114
-rw-r--r--tests/auto/corelib/thread/qthread/tst_qthread.cpp4
-rw-r--r--tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp4
-rw-r--r--tests/auto/corelib/tools/qchar/tst_qchar.cpp5
-rw-r--r--tests/auto/corelib/tools/qstring/tst_qstring.cpp17
-rw-r--r--tests/auto/gui/painting/qpainter/tst_qpainter.cpp36
-rw-r--r--tests/auto/gui/text/qfont/tst_qfont.cpp1
-rw-r--r--tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp4
-rw-r--r--tests/auto/gui/text/qinputcontrol/qinputcontrol.pro7
-rw-r--r--tests/auto/gui/text/qinputcontrol/tst_qinputcontrol.cpp100
-rw-r--r--tests/auto/gui/text/qstatictext/tst_qstatictext.cpp2
-rw-r--r--tests/auto/gui/text/text.pro3
-rw-r--r--tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp2
-rw-r--r--tests/auto/network/socket/qsctpsocket/tst_qsctpsocket.cpp16
-rw-r--r--tests/auto/network/socket/qtcpserver/tst_qtcpserver.cpp7
-rw-r--r--tests/auto/network/socket/qtcpsocket/stressTest/Test.cpp3
-rw-r--r--tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp7
-rw-r--r--tests/auto/other/lancelot/scripts/pixmap_rotation.qps5
-rw-r--r--tests/auto/other/lancelot/scripts/pixmap_rotation2.qps8
-rw-r--r--tests/auto/other/qaccessibility/tst_qaccessibility.cpp5
-rw-r--r--tests/auto/other/qprocess_and_guieventloop/write-read-write/main.cpp4
-rw-r--r--tests/auto/sql/kernel/qsql/tst_qsql.cpp1
-rw-r--r--tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp44
-rw-r--r--tests/auto/testlib/selftests/tst_selftests.cpp4
-rw-r--r--tests/auto/tools/rcc/data/images/images.expected10
-rw-r--r--tests/auto/tools/rcc/tst_rcc.cpp17
-rw-r--r--tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp6
-rw-r--r--tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp10
-rw-r--r--tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp2
-rw-r--r--tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp2
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp4
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp214
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsitemanimation/tst_qgraphicsitemanimation.cpp6
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicslayout/tst_qgraphicslayout.cpp6
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicslayoutitem/tst_qgraphicslayoutitem.cpp2
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp2
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp4
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp24
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp8
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp34
-rw-r--r--tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp2
-rw-r--r--tests/auto/widgets/itemviews/qcolumnview/tst_qcolumnview.cpp6
-rw-r--r--tests/auto/widgets/itemviews/qdatawidgetmapper/tst_qdatawidgetmapper.cpp10
-rw-r--r--tests/auto/widgets/itemviews/qlistwidget/tst_qlistwidget.cpp20
-rw-r--r--tests/auto/widgets/itemviews/qtablewidget/tst_qtablewidget.cpp12
-rw-r--r--tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp14
-rw-r--r--tests/auto/widgets/itemviews/qtreewidget/tst_qtreewidget.cpp18
-rw-r--r--tests/auto/widgets/itemviews/qtreewidgetitemiterator/tst_qtreewidgetitemiterator.cpp4
-rw-r--r--tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp42
-rw-r--r--tests/auto/widgets/kernel/qlayout/tst_qlayout.cpp2
-rw-r--r--tests/auto/widgets/kernel/qstackedlayout/tst_qstackedlayout.cpp6
-rw-r--r--tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp56
-rw-r--r--tests/auto/widgets/kernel/qwindowcontainer/tst_qwindowcontainer.cpp2
-rw-r--r--tests/auto/widgets/styles/qstyleoption/tst_qstyleoption.cpp2
-rw-r--r--tests/auto/widgets/util/qundogroup/tst_qundogroup.cpp14
-rw-r--r--tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp6
-rw-r--r--tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp2
-rw-r--r--tests/auto/widgets/widgets/qdockwidget/tst_qdockwidget.cpp4
-rw-r--r--tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp4
-rw-r--r--tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp18
-rw-r--r--tests/manual/qstorageinfo/printvolumes.cpp2
-rw-r--r--tests/manual/windowflags/controllerwindow.cpp237
-rw-r--r--tests/manual/windowflags/controllerwindow.h39
-rw-r--r--tests/manual/windowflags/main.cpp8
-rw-r--r--tests/manual/windowflags/previewwindow.cpp271
-rw-r--r--tests/manual/windowflags/previewwindow.h31
-rw-r--r--tools/configure/Makefile.mingw4
-rw-r--r--tools/configure/Makefile.win324
-rw-r--r--tools/configure/configure.pro4
-rw-r--r--tools/configure/configureapp.cpp334
-rw-r--r--tools/configure/configureapp.h8
-rw-r--r--tools/configure/environment.cpp33
-rw-r--r--tools/configure/environment.h5
-rw-r--r--tools/configure/main.cpp7
-rw-r--r--tools/configure/tools.cpp85
-rw-r--r--tools/configure/tools.h43
514 files changed, 5926 insertions, 4843 deletions
diff --git a/configure b/configure
index 3e9004a5d0..c297bca9e8 100755
--- a/configure
+++ b/configure
@@ -399,14 +399,6 @@ HostVar()
UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
-UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
-
-# detect the "echo without newline" style. usage: echo $ECHO_N "<string>$ECHO_C"
-if echo '\c' | grep '\c' >/dev/null; then
- ECHO_N=-n
-else
- ECHO_C='\c'
-fi
BUILD_ON_MAC=no
if [ -d /System/Library/Frameworks/Carbon.framework ]; then
@@ -470,7 +462,6 @@ unset QTDIR
# initalize internal variables
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 macOS, iOS, tvOS, or watchOS
@@ -479,7 +470,7 @@ 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
+PLATFORM=
OPT_CONFIRM_LICENSE=no
OPT_SHADOW=maybe
OPT_VERBOSE=no
@@ -512,8 +503,6 @@ QT_HOST_LIBS=
QT_HOST_DATA=
QT_EXT_PREFIX=
-# default qpa platform
-
# Android vars
if [ -z "$ANDROID_SDK_ROOT" ]; then
if [ "$UNAME_SYSTEM" = "Darwin" ] && [ -d "$HOME/Library/Android/sdk" ]; then
@@ -547,7 +536,6 @@ CFG_DEFAULT_ANDROID_NDK_HOST=$ANDROID_NDK_HOST
# parse the arguments, setting things to "yes" or "no"
while [ "$#" -gt 0 ]; do
CURRENT_OPT="$1"
- UNKNOWN_ARG=no
case "$1" in
#Autoconf style options
--enable-*)
@@ -676,10 +664,6 @@ while [ "$#" -gt 0 ]; do
extprefix)
QT_EXT_PREFIX="$VAL"
;;
- pkg-config)
- ;;
- force-pkg-config)
- ;;
docdir)
QT_INSTALL_DOCS="$VAL"
;;
@@ -816,12 +800,6 @@ while [ "$#" -gt 0 ]; do
android-toolchain-version)
CFG_DEFAULT_ANDROID_NDK_TOOLCHAIN_VERSION="$VAL"
;;
- android-style-assets)
- # Required to be able to show the correct license text
- if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
- CFG_ANDROID_STYLE_ASSETS="$VAL"
- fi
- ;;
*)
;;
esac
@@ -1034,168 +1012,6 @@ case "$XPLATFORM" in
esac
#-------------------------------------------------------------------------------
-# check the license
-#-------------------------------------------------------------------------------
-
-if [ "$COMMERCIAL_USER" = "ask" ]; then
- while true; do
- echo "Which edition of Qt do you want to use ?"
- echo
- echo "Type 'c' if you want to use the Commercial Edition."
- echo "Type 'o' if you want to use the Open Source Edition."
- echo
- read commercial
- echo
- if [ "$commercial" = "c" ]; then
- COMMERCIAL_USER="yes"
- OPT_CMDLINE="$OPT_CMDLINE
--commercial"
- break
- elif [ "$commercial" = "o" ]; then
- COMMERCIAL_USER="no"
- OPT_CMDLINE="$OPT_CMDLINE
--opensource"
- break
- fi
- done
-fi
-
-if [ -f "$relpath"/LICENSE.PREVIEW.COMMERCIAL ] && [ $COMMERCIAL_USER = "yes" ]; then
- # Commercial preview release
- Licensee="Preview"
- Edition="Preview"
- EditionString="Technology Preview"
-elif [ $COMMERCIAL_USER = "yes" ]; then
- if [ $UNAME_SYSTEM = "Linux" ]; then
- case "$PLATFORM" in
- *-32)
- Licheck=licheck32
- ;;
- *-64)
- Licheck=licheck64
- ;;
- *)
- if file -L /bin/sh | grep -q "64-bit" ; then
- Licheck=licheck64
- else
- Licheck=licheck32
- fi
- ;;
- esac
- elif [ $UNAME_SYSTEM = "Darwin" ]; then
- Licheck=licheck_mac
- else
- echo >&2 "Host operating system not supported by this edition of Qt."
- exit 1
- fi
- if [ -x "$relpath/bin/$Licheck" ]; then
- LicheckOutput=`$relpath/bin/$Licheck $OPT_CONFIRM_LICENSE $relpath $outpath\
- $PLATFORM $XPLATFORM`
- if [ $? -ne 0 ]; then
- exit 1
- else
- eval "$LicheckOutput"
- fi
- else
- echo
- echo "Error: This is the Open Source version of Qt."
- echo "If you want to use Enterprise features of Qt,"
- echo "use the contact form at http://www.qt.io/contact-us"
- echo "to purchase a license."
- echo
- exit 1
- fi
-elif [ $COMMERCIAL_USER = "no" ]; then
- # Open Source edition - may only be used under the terms of the LGPLv3 or GPLv2.
- Licensee="Open Source"
- Edition="OpenSource"
- EditionString="Open Source"
-fi
-
-if [ "$Edition" = "OpenSource" ] || [ "$Edition" = "Preview" ]; then
- echo
- echo "This is the Qt ${EditionString} Edition."
- echo
-fi
-
-if [ "$Edition" = "OpenSource" ]; then
- while true; do
- if [ "$CFG_ANDROID_STYLE_ASSETS" = "no" ] || [ "$XPLATFORM_ANDROID" = "no" ]; then
- echo "You are licensed to use this software under the terms of"
- echo "the GNU Lesser General Public License (LGPL) version 3."
- echo "You are also licensed to use this software under the terms of"
- echo "the GNU General Public License (GPL) version 2."
- affix="either"
- showGPL2="yes"
- else
- echo "You are licensed to use this software under the terms of"
- echo "the GNU Lesser General Public License (LGPL) version 3."
- showGPL2="no"
- affix="the"
- fi
-
- echo
- if [ "$OPT_CONFIRM_LICENSE" = "yes" ]; then
- echo "You have already accepted the terms of the $EditionString license."
- acceptance=yes
- else
- if [ -f "$relpath/LICENSE.LGPL3" ]; then
- echo "Type 'L' to view the GNU Lesser General Public License version 3."
- fi
- if [ "$showGPL2" = "yes" ]; then
- echo "Type 'G' to view the GNU General Public License version 2."
- fi
- echo "Type 'yes' to accept this license offer."
- echo "Type 'no' to decline this license offer."
- echo
- echo $ECHO_N "Do you accept the terms of $affix license? $ECHO_C"
- read acceptance
- fi
- echo
- if [ "$acceptance" = "yes" ] || [ "$acceptance" = "y" ]; then
- break
- elif [ "$acceptance" = "no" ]; then
- echo "You are not licensed to use this software."
- echo
- exit 1
- elif [ "$acceptance" = "L" ]; then
- more "$relpath/LICENSE.LGPL3"
- elif [ "$acceptance" = "G" ] && [ "$showGPL2" = "yes" ]; then
- more "$relpath/LICENSE.GPL2"
- fi
- done
-elif [ "$Edition" = "Preview" ]; then
- TheLicense=`head -n 1 "$relpath/LICENSE.PREVIEW.COMMERCIAL"`
- while true; do
-
- if [ "$OPT_CONFIRM_LICENSE" = "yes" ]; then
- echo "You have already accepted the terms of the $EditionString license."
- acceptance=yes
- else
- echo "You are licensed to use this software under the terms of"
- echo "the $TheLicense"
- echo
- echo "Type '?' to read the Preview License."
- echo "Type 'yes' to accept this license offer."
- echo "Type 'no' to decline this license offer."
- echo
- echo $ECHO_N "Do you accept the terms of the license? $ECHO_C"
- read acceptance
- fi
- echo
- if [ "$acceptance" = "yes" ]; then
- break
- elif [ "$acceptance" = "no" ] ;then
- echo "You are not licensed to use this software."
- echo
- exit 0
- elif [ "$acceptance" = "?" ]; then
- more "$relpath/LICENSE.PREVIEW.COMMERCIAL"
- fi
- done
-fi
-
-#-------------------------------------------------------------------------------
# command line and environment validation
#-------------------------------------------------------------------------------
@@ -1332,8 +1148,6 @@ if [ "$OPT_SHADOW" = "yes" ]; then
[ "$OPT_VERBOSE" = "yes" ] && echo "Performing shadow build..."
fi
-# if the source tree is different from the build tree,
-# symlink or copy part of the sources
if [ "$OPT_SHADOW" = "yes" ]; then
echo "Preparing build tree..."
@@ -1646,35 +1460,19 @@ setBootstrapVariable()
}
# build qmake
-if true; then ###[ '!' -f "$outpath/bin/qmake" ];
echo "Creating qmake..."
-
mkdir -p "$outpath/qmake" || exit
- # fix makefiles
- for mkfile in GNUmakefile Makefile; do
- EXTRA_LFLAGS=
- EXTRA_CFLAGS=
- in_mkfile="${mkfile}.in"
- if [ "$mkfile" = "Makefile" ]; then
-# if which qmake >/dev/null 2>&1 && [ -f qmake/qmake.pro ]; then
-# (cd qmake && qmake) >/dev/null 2>&1 && continue
-# fi
- in_mkfile="${mkfile}.unix"
- fi
- in_mkfile="$relpath/qmake/$in_mkfile"
- mkfile="$outpath/qmake/$mkfile"
+
+ in_mkfile=$relpath/qmake/Makefile.unix
+ mkfile=$outpath/qmake/Makefile
if [ -f "$mkfile" ]; then
[ "$CFG_DEV" = "yes" ] && "$WHICH" chflags >/dev/null 2>&1 && chflags nouchg "$mkfile"
rm -f "$mkfile"
fi
- [ -f "$in_mkfile" ] || continue
echo "########################################################################" > "$mkfile"
echo "## This file was autogenerated by configure, all changes will be lost ##" >> "$mkfile"
echo "########################################################################" >> "$mkfile"
- EXTRA_OBJS=
- EXTRA_SRCS=
- EXTRA_CFLAGS="\$(QMAKE_CFLAGS) \$(QMAKE_CFLAGS_SPLIT_SECTIONS)"
EXTRA_CXXFLAGS="\$(QMAKE_CXXFLAGS) \$(QMAKE_CXXFLAGS_CXX11) \$(QMAKE_CXXFLAGS_SPLIT_SECTIONS)"
EXTRA_LFLAGS="\$(QMAKE_LFLAGS) \$(QMAKE_LFLAGS_GCSECTIONS)"
@@ -1685,8 +1483,6 @@ if true; then ###[ '!' -f "$outpath/bin/qmake" ];
[ "$CFG_SILENT" = "yes" ] && CC_TRANSFORM='s,^,\@,' || CC_TRANSFORM=
setBootstrapVariable QMAKE_CC CC "$CC_TRANSFORM"
setBootstrapVariable QMAKE_CXX CXX "$CC_TRANSFORM"
- setBootstrapVariable QMAKE_CFLAGS
- setBootstrapVariable QMAKE_CFLAGS_SPLIT_SECTIONS
setBootstrapVariable QMAKE_CXXFLAGS
setBootstrapVariable QMAKE_CXXFLAGS_CXX11
setBootstrapVariable QMAKE_CXXFLAGS_SPLIT_SECTIONS
@@ -1694,73 +1490,13 @@ if true; then ###[ '!' -f "$outpath/bin/qmake" ];
setBootstrapVariable QMAKE_LFLAGS_GCSECTIONS
if [ "$CFG_DEBUG" = "no" ] || [ "$CFG_RELEASE_TOOLS" = "yes" ]; then
- setBootstrapVariable QMAKE_CFLAGS_RELEASE
setBootstrapVariable QMAKE_CXXFLAGS_RELEASE
- EXTRA_CFLAGS="$EXTRA_CFLAGS \$(QMAKE_CFLAGS_RELEASE)"
EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS \$(QMAKE_CXXFLAGS_RELEASE)"
else
- setBootstrapVariable QMAKE_CFLAGS_DEBUG
setBootstrapVariable QMAKE_CXXFLAGS_DEBUG
- EXTRA_CFLAGS="$EXTRA_CFLAGS \$(QMAKE_CFLAGS_DEBUG)"
EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS \$(QMAKE_CXXFLAGS_DEBUG)"
fi
- case `basename "$PLATFORM"` in
- win32-g++*)
- EXTRA_CFLAGS="$EXTRA_CFLAGS -DUNICODE"
- EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS -DUNICODE"
- EXTRA_OBJS="qfilesystemengine_win.o \
- qfilesystemiterator_win.o \
- qfsfileengine_win.o \
- qlocale_win.o \
- qsettings_win.o \
- qoperatingsystemversion_win.o \
- qsystemlibrary.o \
- registry.o"
- EXTRA_SRCS="\"\$(SOURCE_PATH)/src/corelib/corelib/io/qfilesystemengine_win.cpp\" \
- \"\$(SOURCE_PATH)/src/corelib/global/qoperatingsystemversion_win.cpp\" \
- \"\$(SOURCE_PATH)/src/corelib/io/qfilesystemiterator_win.cpp\" \
- \"\$(SOURCE_PATH)/src/corelib/io/qfsfileengine_win.cpp\" \
- \"\$(SOURCE_PATH)/src/corelib/io/qsettings_win.cpp\" \
- \"\$(SOURCE_PATH)/src/corelib/tools/qlocale_win.cpp\" \
- \"\$(SOURCE_PATH)/src/corelib/plugin/qsystemlibrary.cpp\" \
- \"\$(SOURCE_PATH)/tools/shared/windows/registry.cpp\""
- EXTRA_LFLAGS="$EXTRA_LFLAGS -static -s -lole32 -luuid -ladvapi32 -lkernel32"
- EXEEXT=".exe"
- ;;
- *)
- EXTRA_OBJS="qfilesystemengine_unix.o \
- qfilesystemiterator_unix.o \
- qfsfileengine_unix.o \
- qlocale_unix.o"
- EXTRA_SRCS="\"\$(SOURCE_PATH)/src/corelib/io/qfilesystemengine_unix.cpp\" \
- \"\$(SOURCE_PATH)/src/corelib/io/qfilesystemiterator_unix.cpp\" \
- \"\$(SOURCE_PATH)/src/corelib/io/qfsfileengine_unix.cpp\" \
- \"\$(SOURCE_PATH)/src/corelib/tools/qlocale_unix.cpp\""
- EXEEXT=
- ;;
- esac
- if [ "$BUILD_ON_MAC" = "yes" ]; then
- echo "COCOA_LFLAGS =-framework Foundation -framework CoreServices" >>"$mkfile"
- echo "CARBON_LFLAGS =-framework ApplicationServices" >>"$mkfile"
- echo "CARBON_CFLAGS =-fconstant-cfstrings" >>"$mkfile"
- EXTRA_LFLAGS="$EXTRA_LFLAGS \$(COCOA_LFLAGS)"
- EXTRA_LFLAGS="$EXTRA_LFLAGS \$(CARBON_LFLAGS)"
- EXTRA_CFLAGS="$EXTRA_CFLAGS \$(CARBON_CFLAGS)"
- EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS \$(CARBON_CFLAGS)"
- EXTRA_OBJS="$EXTRA_OBJS \
- qsettings_mac.o \
- qcore_mac.o \
- qoperatingsystemversion_darwin.o \
- qcore_foundation.o"
- EXTRA_SRCS="$EXTRA_SRCS \
- \"\$(SOURCE_PATH)/src/corelib/io/qsettings_mac.cpp\" \
- \"\$(SOURCE_PATH)/src/corelib/kernel/qcore_mac.cpp\" \
- \"\$(SOURCE_PATH)/src/corelib/global/qoperatingsystemversion_darwin.mm\" \
- \"\$(SOURCE_PATH)/src/corelib/kernel/qcore_foundation.mm\""
- fi
-
- echo >>"$mkfile"
adjrelpath=`echo "$relpath" | sed 's/ /\\\\\\\\ /g'`
adjoutpath=`echo "$outpath" | sed 's/ /\\\\\\\\ /g'`
adjqmakespec=`echo "$QMAKESPEC" | sed 's/ /\\\\\\\\ /g'`
@@ -1777,15 +1513,24 @@ if true; then ###[ '!' -f "$outpath/bin/qmake" ];
echo "QT_MAJOR_VERSION = $QT_MAJOR_VERSION" >> "$mkfile"
echo "QT_MINOR_VERSION = $QT_MINOR_VERSION" >> "$mkfile"
echo "QT_PATCH_VERSION = $QT_PATCH_VERSION" >> "$mkfile"
- echo "EXTRA_CFLAGS = $EXTRA_CFLAGS" >> "$mkfile"
- echo "EXTRA_CXXFLAGS = $EXTRA_CXXFLAGS" >> "$mkfile"
- echo "QTOBJS =" $EXTRA_OBJS >> "$mkfile"
- echo "QTSRCS =" $EXTRA_SRCS >> "$mkfile"
- echo "LFLAGS = $EXTRA_LFLAGS" >> "$mkfile"
- echo "EXEEXT = $EXEEXT" >> "$mkfile"
+ echo "CONFIG_CXXFLAGS = $EXTRA_CXXFLAGS" >> "$mkfile"
+ echo "CONFIG_LFLAGS = $EXTRA_LFLAGS" >> "$mkfile"
echo "RM_F = rm -f" >> "$mkfile"
echo "RM_RF = rm -rf" >> "$mkfile"
+ case `basename "$PLATFORM"` in
+ win32-g++*)
+ cat "$in_mkfile.win32" >> "$mkfile"
+ ;;
+ *)
+ cat "$in_mkfile.unix" >> "$mkfile"
+ if [ "$BUILD_ON_MAC" = "yes" ]; then
+ cat "$in_mkfile.macos" >> "$mkfile"
+ fi
+ ;;
+ esac
+ echo >>"$mkfile"
+
if [ "$BUILD_ON_MAC" = "yes" ]; then
echo "EXTRA_CXXFLAGS += -MMD" >> "$mkfile"
cat "$in_mkfile" >> "$mkfile"
@@ -1799,7 +1544,6 @@ if true; then ###[ '!' -f "$outpath/bin/qmake" ];
rm "$mkfile.tmp"
fi
fi
- done
if [ "$OPT_VERBOSE" = yes ]; then
# Show the output of make
@@ -1817,7 +1561,6 @@ if true; then ###[ '!' -f "$outpath/bin/qmake" ];
fi
echo "Done."
fi
-fi # Build qmake
#-------------------------------------------------------------------------------
# create a qt.conf for the Qt build tree itself
@@ -1904,16 +1647,6 @@ fi
# run configure tests
#-------------------------------------------------------------------------------
-# copy some variables that are still being computed in the shell script into an input file for configure
-# This should go away in the future
-
-cat > "$outpath/config.tests/configure.cfg" <<EOF
-# Feature defaults set by configure command line
-config.input.qt_edition = $Edition
-config.input.qt_licheck = $Licheck
-config.input.qt_release_date = $ReleaseDate
-EOF
-
# recreate command line for qmake
set -f
SAVED_IFS=$IFS
@@ -1939,6 +1672,15 @@ fi
# finally save the executed command to another script
#-------------------------------------------------------------------------------
if [ $CFG_REDO = no ]; then
+ if [ "$COMMERCIAL_USER" = "ask" ]; then
+ if grep '^QT_EDITION = OpenSource$' "$outpath/mkspecs/qconfig.pri" >/dev/null 2>&1; then
+ OPT_CMDLINE="$OPT_CMDLINE
+-opensource"
+ else
+ OPT_CMDLINE="$OPT_CMDLINE
+-commercial"
+ fi
+ fi
if [ "$OPT_CONFIRM_LICENSE" = "no" ]; then
OPT_CMDLINE="$OPT_CMDLINE
-confirm-license"
diff --git a/configure.json b/configure.json
index 6b44867b79..1bf59eb71d 100644
--- a/configure.json
+++ b/configure.json
@@ -56,6 +56,7 @@
"android-toolchain-version": "string",
"accessibility": "boolean",
+ "android-style-assets": "boolean",
"avx": "boolean",
"avx2": "boolean",
"avx512": { "type": "boolean", "name": "avx512f" },
@@ -417,6 +418,12 @@
},
"features": {
+ "android-style-assets": {
+ "label": "Android Style Assets",
+ "condition": "config.android",
+ "output": [ "privateFeature" ],
+ "comment": "This belongs into gui, but the license check needs it here already."
+ },
"shared": {
"label": "Building shared libraries",
"autoDetect": "!config.uikit",
@@ -516,7 +523,7 @@
},
"release_tools": {
"label": "Compile tools in release mode",
- "autoDetect": "!features.debug",
+ "autoDetect": "features.debug",
"output": [ "privateFeature", "publicQtConfig" ]
},
"simulator_and_device": {
@@ -965,6 +972,11 @@
"earlyReport": [
{
+ "type": "fatal",
+ "condition": "!call.licenseCheck",
+ "message": "You are not licensed to use this software."
+ },
+ {
"type": "warning",
"condition": "input.debug_and_release == 'yes' && !config.darwin && !config.win32",
"message": "-debug-and-release is only supported on Darwin and Windows platforms.
diff --git a/configure.pri b/configure.pri
index 19719736a9..526b09e965 100644
--- a/configure.pri
+++ b/configure.pri
@@ -1,3 +1,7 @@
+# this must be done outside any function
+QT_SOURCE_TREE = $$PWD
+QT_BUILD_TREE = $$shadowed($$PWD)
+
# custom command line handling
defineTest(qtConfCommandline_qmakeArgs) {
@@ -63,6 +67,165 @@ defineReplace(qtConfFunc_crossCompile) {
return(false)
}
+defineReplace(qtConfFunc_licenseCheck) {
+ exists($$QT_SOURCE_TREE/LICENSE.LGPL3)|exists($$QT_SOURCE_TREE/LICENSE.GPL2): \
+ hasOpenSource = true
+ else: \
+ hasOpenSource = false
+ exists($$QT_SOURCE_TREE/LICENSE.PREVIEW.COMMERCIAL)|exists($$QT_SOURCE_TREE/bin/licheck*): \
+ hasCommercial = true
+ else: \
+ hasCommercial = false
+
+ commercial = $$config.input.commercial
+ isEmpty(commercial) {
+ $$hasOpenSource {
+ $$hasCommercial {
+ logn()
+ logn("Selecting Qt Edition.")
+ logn()
+ logn("Type 'c' if you want to use the Commercial Edition.")
+ logn("Type 'o' if you want to use the Open Source Edition.")
+ logn()
+ for(ever) {
+ val = $$lower($$prompt("Which edition of Qt do you want to use? ", false))
+ equals(val, c) {
+ commercial = yes
+ } else: equals(val, o) {
+ commercial = no
+ } else {
+ next()
+ }
+ break()
+ }
+ } else {
+ commercial = no
+ }
+ } else {
+ !$$hasCommercial: \
+ qtConfFatalError("No license files and no licheck executables found." \
+ "Cannot proceed. Try re-installing Qt.")
+ commercial = yes
+ }
+ }
+
+ equals(commercial, no) {
+ !$$hasOpenSource: \
+ qtConfFatalError("This is the Qt Commercial Edition." \
+ "Cannot proceed with -opensource.")
+
+ logn()
+ logn("This is the Qt Open Source Edition.")
+
+ EditionString = "Open Source"
+ config.input.qt_edition = OpenSource
+ export(config.input.qt_edition)
+ } else {
+ !$$hasCommercial: \
+ qtConfFatalError("This is the Qt Open Source Edition." \
+ "Cannot proceed with -commercial.")
+
+ exists($$QT_SOURCE_TREE/LICENSE.PREVIEW.COMMERCIAL) {
+ logn()
+ logn("This is the Qt Technology Preview Edition.")
+
+ EditionString = "Technology Preview"
+ config.input.qt_edition = Preview
+ export(config.input.qt_edition)
+ } else {
+ equals(QMAKE_HOST.os, Linux) {
+ equals(QMAKE_HOST.arch, x86): \
+ Licheck = licheck32
+ else: \
+ Licheck = licheck64
+ } else: equals(QMAKE_HOST.os, Darwin) {
+ Licheck = licheck_mac
+ } else: equals(QMAKE_HOST.os, Windows) {
+ Licheck = licheck.exe
+ } else {
+ qtConfFatalError("Host operating system not supported by this edition of Qt.")
+ }
+
+ !qtRunLoggedCommand("$$system_quote($$QT_SOURCE_TREE/bin/$$Licheck) \
+ $$eval(config.input.confirm-license) \
+ $$system_quote($$QT_SOURCE_TREE) $$system_quote($$QT_BUILD_TREE) \
+ $$[QMAKE_SPEC] $$[QMAKE_XSPEC]", \
+ LicheckOutput): \
+ return(false)
+ eval($$LicheckOutput)
+ config.input.qt_edition = $$Edition
+ config.input.qt_licheck = $$Licheck
+ config.input.qt_release_date = $$ReleaseDate
+ export(config.input.qt_edition)
+ export(config.input.qt_licheck)
+ export(config.input.qt_release_date)
+ return(true)
+ }
+ }
+
+ !isEmpty(config.input.confirm-license) {
+ logn()
+ logn("You have already accepted the terms of the $$EditionString license.")
+ return(true)
+ }
+
+ affix = the
+ equals(commercial, no) {
+ theLicense = "GNU Lesser General Public License (LGPL) version 3"
+ showWhat = "Type 'L' to view the GNU Lesser General Public License version 3 (LGPLv3)."
+ gpl2Ok = false
+ winrt {
+ notTheLicense = "Note: GPL version 2 is not available on WinRT."
+ } else: $$qtConfEvaluate("features.android-style-assets") {
+ notTheLicense = "Note: GPL version 2 is not available due to using Android style assets."
+ } else {
+ theLicense += "or the GNU General Public License (GPL) version 2"
+ showWhat += "Type 'G' to view the GNU General Public License version 2 (GPLv2)."
+ gpl2Ok = true
+ affix = either
+ }
+ } else {
+ theLicense = $$cat($$QT_SOURCE_TREE/LICENSE.PREVIEW.COMMERCIAL, lines)
+ theLicense = $$first(theLicense)
+ showWhat = "Type '?' to view the $${theLicense}."
+ }
+ msg = \
+ " " \
+ "You are licensed to use this software under the terms of" \
+ "the "$$theLicense"." \
+ $$notTheLicense \
+ " " \
+ $$showWhat \
+ "Type 'y' to accept this license offer." \
+ "Type 'n' to decline this license offer." \
+ " "
+
+ for(ever) {
+ logn($$join(msg, $$escape_expand(\\n)))
+ for(ever) {
+ val = $$lower($$prompt("Do you accept the terms of $$affix license? ", false))
+ equals(val, y)|equals(val, yes) {
+ logn()
+ return(true)
+ } else: equals(val, n)|equals(val, no) {
+ return(false)
+ } else: equals(commercial, yes):equals(val, ?) {
+ licenseFile = $$QT_SOURCE_TREE/LICENSE.PREVIEW.COMMERCIAL
+ } else: equals(commercial, no):equals(val, l) {
+ licenseFile = $$QT_SOURCE_TREE/LICENSE.LGPL3
+ } else: equals(commercial, no):equals(val, g):$$gpl2Ok {
+ licenseFile = $$QT_SOURCE_TREE/LICENSE.GPL2
+ } else {
+ next()
+ }
+ break()
+ }
+ system("more $$system_quote($$system_path($$licenseFile))")
+ logn()
+ logn()
+ }
+}
+
# custom tests
defineTest(qtConfTest_architecture) {
@@ -510,12 +673,19 @@ defineTest(qtConfReport_buildParts) {
qtConfReportPadded($${1}, $$qtConfEvaluate("tests.build_parts.value"))
}
+defineReplace(qtConfReportArch) {
+ arch = $$qtConfEvaluate('tests.$${1}.arch')
+ subarch = $$qtConfEvaluate('tests.$${1}.subarch')
+ isEmpty(subarch): subarch = <none>
+ return("$$arch, CPU features: $$subarch")
+}
+
defineTest(qtConfReport_buildTypeAndConfig) {
!$$qtConfEvaluate("features.cross_compile") {
- qtConfAddReport("Build type: $$qtConfEvaluate('tests.architecture.arch')")
+ qtConfAddReport("Build type: $$[QMAKE_SPEC] ($$qtConfReportArch(architecture))")
} else {
- qtConfAddReport("Building on: $$qtConfEvaluate('tests.host_architecture.arch')")
- qtConfAddReport("Building for: $$qtConfEvaluate('tests.architecture.arch')")
+ qtConfAddReport("Building on: $$[QMAKE_SPEC] ($$qtConfReportArch(host_architecture))")
+ qtConfAddReport("Building for: $$[QMAKE_XSPEC] ($$qtConfReportArch(architecture))")
}
qtConfAddReport()
qtConfAddReport("Configuration: $$eval($${currentConfig}.output.privatePro.append.CONFIG) $$eval($${currentConfig}.output.publicPro.append.QT_CONFIG)")
@@ -552,6 +722,3 @@ discard_from($$[QT_HOST_DATA/get]/mkspecs/qmodule.pri)
QMAKE_POST_CONFIGURE += \
"include(\$\$[QT_HOST_DATA/get]/mkspecs/qconfig.pri)" \
"include(\$\$[QT_HOST_DATA/get]/mkspecs/qmodule.pri)"
-
-# load and process input from configure.sh/.exe
-include($$shadowed($$PWD)/config.tests/configure.cfg)
diff --git a/dist/changes-5.7.1 b/dist/changes-5.7.1
new file mode 100644
index 0000000000..83065f01c1
--- /dev/null
+++ b/dist/changes-5.7.1
@@ -0,0 +1,221 @@
+Qt 5.7.1 is a bug-fix release. It maintains both forward and backward
+compatibility (source and binary) with Qt 5.7.0.
+
+For more details, refer to the online documentation included in this
+distribution. The documentation is also available online:
+
+http://doc.qt.io/qt-5/index.html
+
+The Qt version 5.7 series is binary compatible with the 5.6.x series.
+Applications compiled for 5.6 will continue to run with 5.7.
+
+Some of the changes listed in this file include issue tracking numbers
+corresponding to tasks in the Qt Bug Tracker:
+
+https://bugreports.qt.io/
+
+Each of these identifiers can be entered in the bug tracker to obtain more
+information about a particular change.
+
+This release contains all fixes included in the Qt 5.6.2 release.
+
+****************************************************************************
+* Important Behavior Changes *
+****************************************************************************
+
+ - [QTBUG-45031] The NSURLConnection backend of QNetworkAccessManager has
+ been removed, since SecureTransport is the default SSL backend on iOS
+ and is enabled by default. This means that building with -no-openssl
+ -no-securetransport will no longer provide SSL capabilities on iOS.
+
+ - QtCore / QDataStream:
+ * [QTBUG-54022] Incomplete reads of Qt containers are now handled same
+ way as for primitive types, meaning that previous errors are latched.
+
+****************************************************************************
+* Library *
+****************************************************************************
+
+QtCore
+------
+
+ - QLockFile:
+ * Fixed permissions on lock files on Unix to allow for adjustments via
+ umask.
+
+ - QMimeType:
+ * [QTBUG-50776] QMimeType::comment() now uses the default locale rather
+ than system locale, so that applications can control which language is
+ being used.
+
+ - QUrl:
+ * QUrl::resolved() no longer treats a URL with a scheme as a relative URL
+ if it matches this URL's scheme. For now it still treats "file:name.txt"
+ as relative for compatibility, but be warned that in Qt 5.8 it will no
+ longer consider those to be relative. Both isRelative() and RFC 3986 say
+ that such URLs are not relative, so starting from Qt 5.8, resolved() will
+ return them as is.
+
+ - QXmlStreamReader:
+ * Fixed a bug in the XML parser that prevented to load XML that
+ contained invalid characters for XML 1.0.
+
+ - QXmlStreamWriter:
+ * Fixed a bug that prevented the generation of valid XML files when
+ using encoding with 8 bit per character but not ASCII compatible.
+ QXMLStreamWriter generated XML markup using always ASCII in this case.
+
+QtGui
+-----
+
+ - QGuiApplication:
+ * [QTBUG-51703] Fixed a bug that would cause QGuiApplication::sync() to
+ be left undefined for Qt builds without session management support.
+
+ - QIconLoaderEngine:
+ * Fixed theme lookup for scalable entries
+
+ - QTextDocument:
+ * [QTBUG-48182] Fixed a bug that would return a wrong position when
+ searching backward from the end of the document.
+
+ - Text:
+ * [QTBUG-49452] Fixed a performance regression in Freetype engine that
+ was introduced in Qt 5.5.
+ * [QTBUG-53911] Fixed a crash that could happen if you were doing many
+ different text layouts with different fonts and superscript or
+ subscript alignment.
+ * [QTBUG-42033] Fixed bug where a QTextLayout with
+ ShowLineAndParagraphSeparators would modify the layout's input string.
+ * [QTBUG-54180] Fixed performance regression when rapidly switching
+ between a large set of fonts.
+
+QtNetwork
+---------
+
+- QSslSocket:
+ * [QTBUG-55170] Fixed a bug in SecureTransport backend that would cause
+ a memory usage growth in case 'readBufferMaxSize' is set.
+ * [QTBUG-52975] Fixed a bug in SecureTransport backend where transmit
+ was using invalid SSL context and reporting (incorrectly) some irrelevant
+ errors as a result.
+
+QtSql
+-----
+
+ - [QTBUG-53969][QTBUG-53237] Fixed QSqlQuery::prepare value truncation
+ error when using UNSIGNED values in a MySQL database.
+
+QtWidgets
+---------
+
+ - QAbstractItemDelegate:
+ * [QTBUG-16469] Show localized detailed tooltips and "What's this?"
+ texts.
+
+ - QTreeView:
+ * [QTBUG-52793] Fixed a key navigation bug when the columns were
+ reordered.
+
+****************************************************************************
+* Platform-specific Changes *
+****************************************************************************
+
+Android
+-------
+
+ - [QTBUG-50724] Added support for clang compiler
+ - [QTBUG-53511] Fixed CJK font resolution on Android 7.
+
+FreeBSD
+-------
+
+ - The freebsd-g++ mkspec was moved back and no longer requires the
+ "unsupported/" prefix, matching the FreeBSD ports tree, as FreeBSD 9.3
+ still defaults to using GCC. Users of GCC that did not previously use
+ the ports patch will need to adapt their build scripts and drop the
+ "unsupported/" prefix.
+
+Linux
+-----
+
+- [QTBUG-54733] It is now possible to opt out from installing signal
+ handlers when running with eglfs and linuxfb by setting the
+ QT_QPA_NO_SIGNAL_HANDLER environment variable to a non-zero value.
+- [QTBUG-55140] xcb with EGL and OpenGL ES, as well as eglfs with the
+ eglfs_x11 backend, are now supported on DRIVE CX boards when using the
+ linux-drive-cx-g++ device spec.
+
+
+Windows
+-------
+
+ - [QTBUG-41186] QWindow::fromWinId() may return 0 when passing invalid
+ window handles.
+ - [QTBUG-55595] Fixed crash when loading color fonts from data.
+ - [QTBUG-55097] Fixed rendering Adobe/Mozilla format color fonts with
+ other colors than black after Windows 10 Anniversary update.
+ - [QTBUG-54494] Fixed stretch when combined with either no or vertical
+ hinting preference or a device pixel ratio different from 1.
+ - [QTBUG-51024] Fixed height of text bounding box when using no or
+ vertical hinting preference, or when the device pixel ratio is
+ different from 1.
+
+****************************************************************************
+* Tools *
+****************************************************************************
+
+configure & build system
+------------------------
+
+ - [QTBUG-35886][QTBUG-51417] Fixed Fontconfig vs. system FreeType
+ configuration.
+ - [QTBUG-43784][X11] Fixed detection of GLX with -qt-xcb.
+ - [QTBUG-51534][Windows] The configure.exe bootstrapping now prefers
+ cl over clang-cl, to avoid header incompatibility problems.
+ - [QTBUG-52940] Fixed missing plugins.qmltypes files in static builds.
+ - [QTBUG-52951] Fixed dynamic library support detection for platforms
+ without libdl.
+ - [QTBUG-53038] Fixed running of configure tests outside qtbase when
+ cross compiling on Windows (for example for Android).
+ - [QTBUG-53312] The flags supplied by the configure -D/-I/-L/-l options
+ are now applied after Qt's own flags. This helps in some cases when
+ the provided paths contain files which conflict with the Qt build.
+ - [QTBUG-53926] Fixed linkage of QML plugins in static prefix builds.
+ - [QTBUG-55011][Unix] Fixed -no-pkg-config being ignored by some
+ configure tests, which led to build failures later on.
+ - Fixed configure tests outside qtbase when $MAKEFLAGS contains the
+ -i flag.
+ - [Android] Some unused plugins are not built anymore.
+ - [MinGW] Added support for -separate-debug-info.
+ - [Unix] Added configure -no-opengles3 option.
+ - [Unix] Fixed MySQL detection/use on RHEL 6.6.
+
+qmake
+-----
+
+ - [QTBUG-41830] Fixed nested custom functions inheriting their callers'
+ arguments.
+ - [QTBUG-53895][MSVC] Started using separate PDB files for compiling
+ and linking.
+ - [QTBUG-54036][Darwin] Fixed installation of debug symbols.
+ - [QTBUG-54299] Various QMAKE_EXTRA_COMPILERS' .depends entries are now
+ appended to rather than overwritten.
+ - [QTBUG-54346][MSys/Apple] Fixed detection of QMAKE_DEFAULT_{INC,LIB}DIRS.
+ - [QTBUG-54550] Fixed access to freed memory in $$absolute_path().
+ - [QTBUG-54674] The obsolete -target xp is now properly rejected.
+ - [QTBUG-55183][nmake] _WINDLL is now automatically defined when building
+ a DLL, consistently with Visual Studio.
+ - [QTBUG-55505] Fixed build of projects with spaces in the source or build
+ path against static builds of Qt.
+ - [QTBUG-55649][QTBUG-55915][Xcode] Fixed support for Xcode 8.
+ - [QTBUG-56162][MinGW] Fixed -release -force-debug-info missing both
+ optimization and debug info.
+ - Fixed several cases where the error() function would not abort qmake.
+ - Interrupting a command run via system() will now abort qmake as well.
+ - The packagesExist() function will now warn when used when Qt was
+ configured with -no-pkg-config.
+ - [Android] The default compiler flags were adjusted to match newer
+ NDK versions.
+ - [Darwin] Fixed detection of QMAKE_DEFAULT_INCDIRS.
+ - [Darwin][make] Added support for building Xcode asset catalogs.
diff --git a/doc/src/images/analogclock-example.png b/doc/src/images/analogclock-example.png
index b195f8bf24..2319c2891b 100644
--- a/doc/src/images/analogclock-example.png
+++ b/doc/src/images/analogclock-example.png
Binary files differ
diff --git a/doc/src/images/calculator-example.png b/doc/src/images/calculator-example.png
index 6f1158d733..9771c4132a 100644
--- a/doc/src/images/calculator-example.png
+++ b/doc/src/images/calculator-example.png
Binary files differ
diff --git a/doc/src/images/calendarwidgetexample.png b/doc/src/images/calendarwidgetexample.png
index 464be90999..407d9ed46c 100644
--- a/doc/src/images/calendarwidgetexample.png
+++ b/doc/src/images/calendarwidgetexample.png
Binary files differ
diff --git a/doc/src/images/charactermap-example.png b/doc/src/images/charactermap-example.png
index c1f25a5b83..cceb9a85d8 100644
--- a/doc/src/images/charactermap-example.png
+++ b/doc/src/images/charactermap-example.png
Binary files differ
diff --git a/doc/src/images/codeeditor-example.png b/doc/src/images/codeeditor-example.png
index b17640695d..32cf94779f 100644
--- a/doc/src/images/codeeditor-example.png
+++ b/doc/src/images/codeeditor-example.png
Binary files differ
diff --git a/doc/src/images/digitalclock-example.png b/doc/src/images/digitalclock-example.png
index 917035a0f0..21fa33b258 100644
--- a/doc/src/images/digitalclock-example.png
+++ b/doc/src/images/digitalclock-example.png
Binary files differ
diff --git a/doc/src/images/groupbox-example.png b/doc/src/images/groupbox-example.png
index 443f812340..56f95fa8b1 100644
--- a/doc/src/images/groupbox-example.png
+++ b/doc/src/images/groupbox-example.png
Binary files differ
diff --git a/doc/src/images/imageviewer-example.png b/doc/src/images/imageviewer-example.png
index 69b4f7ade7..922aa8b92c 100644
--- a/doc/src/images/imageviewer-example.png
+++ b/doc/src/images/imageviewer-example.png
Binary files differ
diff --git a/doc/src/images/lineedits-example.png b/doc/src/images/lineedits-example.png
index ff5e3184ad..6db951cd4a 100644
--- a/doc/src/images/lineedits-example.png
+++ b/doc/src/images/lineedits-example.png
Binary files differ
diff --git a/doc/src/images/movie-example.png b/doc/src/images/movie-example.png
index 713f56347e..81f2cdd6ef 100644
--- a/doc/src/images/movie-example.png
+++ b/doc/src/images/movie-example.png
Binary files differ
diff --git a/doc/src/images/scribble-example.png b/doc/src/images/scribble-example.png
index 54091baa6b..497865e44c 100644
--- a/doc/src/images/scribble-example.png
+++ b/doc/src/images/scribble-example.png
Binary files differ
diff --git a/doc/src/images/spinboxes-example.png b/doc/src/images/spinboxes-example.png
index 14c42d2404..432ff10a9b 100644
--- a/doc/src/images/spinboxes-example.png
+++ b/doc/src/images/spinboxes-example.png
Binary files differ
diff --git a/doc/src/images/styles-enabledwood.png b/doc/src/images/styles-enabledwood.png
index 168c1d2d2c..4f3a746ef9 100644
--- a/doc/src/images/styles-enabledwood.png
+++ b/doc/src/images/styles-enabledwood.png
Binary files differ
diff --git a/doc/src/images/tetrix-example.png b/doc/src/images/tetrix-example.png
index c9764dcccd..2c3dade394 100644
--- a/doc/src/images/tetrix-example.png
+++ b/doc/src/images/tetrix-example.png
Binary files differ
diff --git a/doc/src/images/wiggly-example.png b/doc/src/images/wiggly-example.png
index b20fbc445d..5ac0d856b3 100644
--- a/doc/src/images/wiggly-example.png
+++ b/doc/src/images/wiggly-example.png
Binary files differ
diff --git a/doc/src/images/windowflags-example.png b/doc/src/images/windowflags-example.png
index 9028b9b0d1..89730bcc7e 100644
--- a/doc/src/images/windowflags-example.png
+++ b/doc/src/images/windowflags-example.png
Binary files differ
diff --git a/examples/network/multistreamserver/server.cpp b/examples/network/multistreamserver/server.cpp
index 3b06c0fd37..1d18514c0e 100644
--- a/examples/network/multistreamserver/server.cpp
+++ b/examples/network/multistreamserver/server.cpp
@@ -66,7 +66,7 @@ Server::Server(QWidget *parent)
setWindowTitle(tr("Multi-stream Server"));
sctpServer = new QSctpServer(this);
- sctpServer->setMaxChannelCount(NumberOfChannels);
+ sctpServer->setMaximumChannelCount(NumberOfChannels);
statusLabel = new QLabel;
QPushButton *quitButton = new QPushButton(tr("Quit"));
diff --git a/examples/widgets/animation/appchooser/main.cpp b/examples/widgets/animation/appchooser/main.cpp
index c9821450c9..71c869f6a2 100644
--- a/examples/widgets/animation/appchooser/main.cpp
+++ b/examples/widgets/animation/appchooser/main.cpp
@@ -67,12 +67,12 @@ public:
painter->drawPixmap(QPointF(), p);
}
- virtual void mousePressEvent(QGraphicsSceneMouseEvent *) override
+ void mousePressEvent(QGraphicsSceneMouseEvent *) override
{
emit clicked();
}
- virtual void setGeometry(const QRectF &rect) override
+ void setGeometry(const QRectF &rect) override
{
QGraphicsWidget::setGeometry(rect);
@@ -98,7 +98,7 @@ public:
{
}
- virtual void resizeEvent(QResizeEvent *) override
+ void resizeEvent(QResizeEvent *) override
{
fitInView(sceneRect(), Qt::KeepAspectRatio);
}
diff --git a/examples/widgets/animation/moveblocks/main.cpp b/examples/widgets/animation/moveblocks/main.cpp
index f85211ef88..a9b95808a5 100644
--- a/examples/widgets/animation/moveblocks/main.cpp
+++ b/examples/widgets/animation/moveblocks/main.cpp
@@ -98,14 +98,14 @@ public:
protected:
//![14]
- virtual bool eventTest(QEvent *event) override
+ bool eventTest(QEvent *event) override
{
return (event->type() == QEvent::Type(StateSwitchEvent::StateSwitchType))
&& (static_cast<StateSwitchEvent *>(event)->rand() == m_rand);
}
//![14]
- virtual void onTransition(QEvent *) override {}
+ void onTransition(QEvent *) override {}
private:
int m_rand;
@@ -122,7 +122,7 @@ public:
//![10]
//![11]
- virtual void onEntry(QEvent *) override
+ void onEntry(QEvent *) override
{
int n;
while ((n = (qrand() % m_stateCount + 1)) == m_lastIndex)
@@ -130,7 +130,7 @@ public:
m_lastIndex = n;
machine()->postEvent(new StateSwitchEvent(n));
}
- virtual void onExit(QEvent *) override {}
+ void onExit(QEvent *) override {}
//![11]
//![12]
@@ -174,7 +174,7 @@ public:
}
protected:
- virtual void resizeEvent(QResizeEvent *event) override
+ void resizeEvent(QResizeEvent *event) override
{
fitInView(scene()->sceneRect());
QGraphicsView::resizeEvent(event);
diff --git a/examples/widgets/animation/states/main.cpp b/examples/widgets/animation/states/main.cpp
index a3c7256933..14d193c301 100644
--- a/examples/widgets/animation/states/main.cpp
+++ b/examples/widgets/animation/states/main.cpp
@@ -79,7 +79,7 @@ public:
{
}
- virtual void resizeEvent(QResizeEvent *) override
+ void resizeEvent(QResizeEvent *) override
{
fitInView(sceneRect(), Qt::KeepAspectRatio);
}
diff --git a/examples/widgets/animation/stickman/graphicsview.h b/examples/widgets/animation/stickman/graphicsview.h
index 4b9b8fc028..56396bb780 100644
--- a/examples/widgets/animation/stickman/graphicsview.h
+++ b/examples/widgets/animation/stickman/graphicsview.h
@@ -61,7 +61,7 @@ public:
GraphicsView(QWidget *parent = 0);
protected:
- virtual void resizeEvent(QResizeEvent *event) override;
+ void resizeEvent(QResizeEvent *event) override;
void keyPressEvent(QKeyEvent *) override;
signals:
diff --git a/examples/widgets/animation/stickman/lifecycle.cpp b/examples/widgets/animation/stickman/lifecycle.cpp
index 0ece4f3932..253af22b2d 100644
--- a/examples/widgets/animation/stickman/lifecycle.cpp
+++ b/examples/widgets/animation/stickman/lifecycle.cpp
@@ -70,7 +70,7 @@ public:
setTargetState(target);
}
- virtual bool eventTest(QEvent *e) override
+ bool eventTest(QEvent *e) override
{
if (QSignalTransition::eventTest(e)) {
QVariant key = static_cast<QStateMachine::SignalEvent*>(e)->arguments().at(0);
@@ -95,7 +95,7 @@ public:
startTimer(1000);
}
- virtual bool eventTest(QEvent *e) override
+ bool eventTest(QEvent *e) override
{
return QEventTransition::eventTest(e) && ((qrand() % 50) == 0);
}
diff --git a/examples/widgets/animation/stickman/rectbutton.h b/examples/widgets/animation/stickman/rectbutton.h
index 864a2c179e..ab47bad0f7 100644
--- a/examples/widgets/animation/stickman/rectbutton.h
+++ b/examples/widgets/animation/stickman/rectbutton.h
@@ -60,13 +60,13 @@ public:
RectButton(QString buttonText);
~RectButton();
- virtual QRectF boundingRect() const override;
- virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
+ QRectF boundingRect() const override;
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
protected:
QString m_ButtonText;
- virtual void mousePressEvent (QGraphicsSceneMouseEvent *event) override;
+ void mousePressEvent (QGraphicsSceneMouseEvent *event) override;
signals:
void clicked();
diff --git a/examples/widgets/animation/stickman/stickman.h b/examples/widgets/animation/stickman/stickman.h
index b5fbd14872..f2311a0358 100644
--- a/examples/widgets/animation/stickman/stickman.h
+++ b/examples/widgets/animation/stickman/stickman.h
@@ -69,8 +69,8 @@ public:
StickMan();
~StickMan();
- virtual QRectF boundingRect() const override;
- virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
+ QRectF boundingRect() const override;
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
int nodeCount() const;
Node *node(int idx) const;
diff --git a/examples/widgets/animation/sub-attaq/boat.h b/examples/widgets/animation/sub-attaq/boat.h
index 24b004a108..a75e2b1474 100644
--- a/examples/widgets/animation/sub-attaq/boat.h
+++ b/examples/widgets/animation/sub-attaq/boat.h
@@ -86,7 +86,7 @@ public:
void updateBoatMovement();
- virtual int type() const override;
+ int type() const override;
signals:
void boatDestroyed();
diff --git a/examples/widgets/animation/sub-attaq/boat_p.h b/examples/widgets/animation/sub-attaq/boat_p.h
index 5cad6bde96..de11ff9555 100644
--- a/examples/widgets/animation/sub-attaq/boat_p.h
+++ b/examples/widgets/animation/sub-attaq/boat_p.h
@@ -81,7 +81,7 @@ public:
{
}
protected:
- virtual bool eventTest(QEvent *event) override
+ bool eventTest(QEvent *event) override
{
if (!QKeyEventTransition::eventTest(event))
return false;
@@ -100,7 +100,7 @@ public:
{
}
protected:
- virtual bool eventTest(QEvent *event) override
+ bool eventTest(QEvent *event) override
{
if (!QKeyEventTransition::eventTest(event))
return false;
@@ -131,7 +131,7 @@ public:
{
}
protected:
- virtual bool eventTest(QEvent *event) override
+ bool eventTest(QEvent *event) override
{
if (!QKeyEventTransition::eventTest(event))
return false;
diff --git a/examples/widgets/animation/sub-attaq/states.h b/examples/widgets/animation/sub-attaq/states.h
index 1d50abbf02..cd68e319c2 100644
--- a/examples/widgets/animation/sub-attaq/states.h
+++ b/examples/widgets/animation/sub-attaq/states.h
@@ -152,7 +152,7 @@ class UpdateScoreTransition : public QSignalTransition
public:
UpdateScoreTransition(GraphicsScene *scene, PlayState *game, QAbstractState *target);
protected:
- virtual bool eventTest(QEvent *event) override;
+ bool eventTest(QEvent *event) override;
private:
PlayState * game;
GraphicsScene *scene;
@@ -164,7 +164,7 @@ class WinTransition : public QSignalTransition
public:
WinTransition(GraphicsScene *scene, PlayState *game, QAbstractState *target);
protected:
- virtual bool eventTest(QEvent *event) override;
+ bool eventTest(QEvent *event) override;
private:
PlayState * game;
GraphicsScene *scene;
@@ -176,7 +176,7 @@ private:
public:
CustomSpaceTransition(QWidget *widget, PlayState *game, QEvent::Type type, int key);
protected:
- virtual bool eventTest(QEvent *event) override;
+ bool eventTest(QEvent *event) override;
private:
PlayState *game;
};
diff --git a/examples/widgets/animation/sub-attaq/submarine.h b/examples/widgets/animation/sub-attaq/submarine.h
index abfdca6195..d145c9cbee 100644
--- a/examples/widgets/animation/sub-attaq/submarine.h
+++ b/examples/widgets/animation/sub-attaq/submarine.h
@@ -81,7 +81,7 @@ public:
void launchTorpedo(int speed);
void destroy();
- virtual int type() const override;
+ int type() const override;
QGraphicsRotation *rotation() const { return graphicsRotation; }
diff --git a/examples/widgets/desktop/systray/doc/images/systemtray-editor.png b/examples/widgets/desktop/systray/doc/images/systemtray-editor.png
index fb15dea8cb..f7c23db28a 100644
--- a/examples/widgets/desktop/systray/doc/images/systemtray-editor.png
+++ b/examples/widgets/desktop/systray/doc/images/systemtray-editor.png
Binary files differ
diff --git a/examples/widgets/desktop/systray/doc/src/systray.qdoc b/examples/widgets/desktop/systray/doc/src/systray.qdoc
index b89fed72e0..fe397f83df 100644
--- a/examples/widgets/desktop/systray/doc/src/systray.qdoc
+++ b/examples/widgets/desktop/systray/doc/src/systray.qdoc
@@ -32,7 +32,8 @@
\brief The System Tray Icon example shows how to add an icon with a menu
and popup messages to a desktop environment's system tray.
- \image systemtray-example.png Screenshot of the System Tray Icon.
+ \borderedimage systemtray-example.png
+ \caption Screenshot of the System Tray Icon
Modern operating systems usually provide a special area on the
desktop, called the system tray or notification area, where
@@ -42,7 +43,7 @@
the main application window (i.e., an editor for the system tray
icon) and the associated icon.
- \image systemtray-editor.png
+ \borderedimage systemtray-editor.png
The editor allows the user to choose the preferred icon as well as
set the balloon message's type and duration. The user can also
diff --git a/examples/widgets/doc/images/systemtray-editor.png b/examples/widgets/doc/images/systemtray-editor.png
index fb15dea8cb..f7c23db28a 100644
--- a/examples/widgets/doc/images/systemtray-editor.png
+++ b/examples/widgets/doc/images/systemtray-editor.png
Binary files differ
diff --git a/examples/widgets/doc/src/analogclock.qdoc b/examples/widgets/doc/src/analogclock.qdoc
index d59f9070c5..ff65f97730 100644
--- a/examples/widgets/doc/src/analogclock.qdoc
+++ b/examples/widgets/doc/src/analogclock.qdoc
@@ -32,7 +32,8 @@
\brief The Analog Clock example shows how to draw the contents of a
custom widget.
- \image analogclock-example.png Screenshot of the Analog Clock example
+ \borderedimage analogclock-example.png
+ \caption Screenshot of the Analog Clock example
This example also demonstrates how the transformation and scaling
features of QPainter can be used to make drawing custom widgets
diff --git a/examples/widgets/doc/src/calculator.qdoc b/examples/widgets/doc/src/calculator.qdoc
index 4ee1248e6c..83d85a7fe8 100644
--- a/examples/widgets/doc/src/calculator.qdoc
+++ b/examples/widgets/doc/src/calculator.qdoc
@@ -33,7 +33,8 @@
functionality of a calculator widget, and how to use QGridLayout
to place child widgets in a grid.
- \image calculator-example.png Screenshot of the Calculator example
+ \borderedimage calculator-example.png
+ \caption Screenshot of the Calculator example
The example consists of two classes:
@@ -370,6 +371,7 @@
QSizePolicy::Expanding in the constructor and if we didn't
reimplement QWidget::sizeHint().
- \image calculator-ugly.png The Calculator example with default size policies and size hints
+ \borderedimage calculator-ugly.png
+ \caption The Calculator example with default size policies and size hints
*/
diff --git a/examples/widgets/doc/src/calendarwidget.qdoc b/examples/widgets/doc/src/calendarwidget.qdoc
index 8ab73668cf..c2d86d830c 100644
--- a/examples/widgets/doc/src/calendarwidget.qdoc
+++ b/examples/widgets/doc/src/calendarwidget.qdoc
@@ -31,7 +31,7 @@
\ingroup examples-widgets
\brief The Calendar Widget example shows use of QCalendarWidget.
- \image calendarwidgetexample.png
+ \borderedimage calendarwidgetexample.png
QCalendarWidget displays one calendar month
at a time and lets the user select a date.
diff --git a/examples/widgets/doc/src/charactermap.qdoc b/examples/widgets/doc/src/charactermap.qdoc
index ec6a2c6fe3..3cf4a1210b 100644
--- a/examples/widgets/doc/src/charactermap.qdoc
+++ b/examples/widgets/doc/src/charactermap.qdoc
@@ -38,7 +38,8 @@ copied into the clipboard, and pasted into other applications. The
purpose behind this sort of tool is to allow users to enter characters
that may be unavailable or difficult to locate on their keyboards.
-\image charactermap-example.png Screenshot of the Character Map example
+\borderedimage charactermap-example.png
+\caption Screenshot of the Character Map example
The example consists of the following classes:
diff --git a/examples/widgets/doc/src/codeeditor.qdoc b/examples/widgets/doc/src/codeeditor.qdoc
index bcc3564eb9..7f09f4bba0 100644
--- a/examples/widgets/doc/src/codeeditor.qdoc
+++ b/examples/widgets/doc/src/codeeditor.qdoc
@@ -32,7 +32,7 @@
\brief The Code Editor example shows how to create a simple editor that
has line numbers and that highlights the current line.
- \image codeeditor-example.png
+ \borderedimage codeeditor-example.png
As can be seen from the image, the editor displays the line
numbers in an area to the left of the area for editing. The editor
diff --git a/examples/widgets/doc/src/digitalclock.qdoc b/examples/widgets/doc/src/digitalclock.qdoc
index aa0d898ec9..aff349adb8 100644
--- a/examples/widgets/doc/src/digitalclock.qdoc
+++ b/examples/widgets/doc/src/digitalclock.qdoc
@@ -32,7 +32,8 @@
\brief The Digital Clock example shows how to use QLCDNumber to display a
number with LCD-like digits.
- \image digitalclock-example.png Screenshot of the Digital Clock example
+ \borderedimage digitalclock-example.png
+ \caption Screenshot of the Digital Clock example
This example also demonstrates how QTimer can be used to update a widget
at regular intervals.
diff --git a/examples/widgets/doc/src/groupbox.qdoc b/examples/widgets/doc/src/groupbox.qdoc
index d567f57272..b9da2f05f4 100644
--- a/examples/widgets/doc/src/groupbox.qdoc
+++ b/examples/widgets/doc/src/groupbox.qdoc
@@ -40,7 +40,7 @@
Group boxes are usually used to organize check boxes and radio
buttons into exclusive groups.
- \image groupbox-example.png
+ \borderedimage groupbox-example.png
The Group Boxes example consists of a single \c Window class that
is used to show four group boxes: an exclusive radio button group,
diff --git a/examples/widgets/doc/src/imageviewer.qdoc b/examples/widgets/doc/src/imageviewer.qdoc
index 02fc4cd56f..91b6385356 100644
--- a/examples/widgets/doc/src/imageviewer.qdoc
+++ b/examples/widgets/doc/src/imageviewer.qdoc
@@ -44,7 +44,8 @@
can be used to implement zooming and scaling features. In
addition the example shows how to use QPainter to print an image.
- \image imageviewer-example.png Screenshot of the Image Viewer example
+ \borderedimage imageviewer-example.png
+ \caption Screenshot of the Image Viewer example
With the Image Viewer application, the users can view an image of
their choice. The \uicontrol File menu gives the user the possibility
diff --git a/examples/widgets/doc/src/lineedits.qdoc b/examples/widgets/doc/src/lineedits.qdoc
index 906ec76962..5cf321bbb1 100644
--- a/examples/widgets/doc/src/lineedits.qdoc
+++ b/examples/widgets/doc/src/lineedits.qdoc
@@ -34,7 +34,7 @@
on the input and output supplied by the user.
- \image lineedits-example.png
+ \borderedimage lineedits-example.png
The example consists of a single \c Window class, containing a selection of
line edits with different input constraints and display properties that can be
diff --git a/examples/widgets/doc/src/movie.qdoc b/examples/widgets/doc/src/movie.qdoc
index a5c06ce93a..2363383ffe 100644
--- a/examples/widgets/doc/src/movie.qdoc
+++ b/examples/widgets/doc/src/movie.qdoc
@@ -36,5 +36,5 @@
a simple animation without the added complexity of a multimedia
framework to install and deploy.
- \image movie-example.png
+ \borderedimage movie-example.png
*/
diff --git a/examples/widgets/doc/src/shapedclock.qdoc b/examples/widgets/doc/src/shapedclock.qdoc
index 9e21e519fe..2e5d8b1496 100644
--- a/examples/widgets/doc/src/shapedclock.qdoc
+++ b/examples/widgets/doc/src/shapedclock.qdoc
@@ -32,7 +32,7 @@
\brief The Shaped Clock example shows how to apply a widget mask to a top-level
widget to produce a shaped window.
- \image shapedclock-example.png
+ \borderedimage shapedclock-example.png
Widget masks are used to customize the shapes of top-level widgets by restricting
the available area for painting. On some window systems, setting certain window flags
diff --git a/examples/widgets/doc/src/sliders.qdoc b/examples/widgets/doc/src/sliders.qdoc
index b8ef2ace39..eb9a932c76 100644
--- a/examples/widgets/doc/src/sliders.qdoc
+++ b/examples/widgets/doc/src/sliders.qdoc
@@ -43,7 +43,8 @@
The example also demonstrates how signals and slots can be used to
synchronize the behavior of two or more widgets.
- \image sliders-example.png Screenshot of the Sliders example
+ \borderedimage sliders-example.png
+ \caption Screenshot of the Sliders example
The Sliders example consists of two classes:
diff --git a/examples/widgets/doc/src/spinboxes.qdoc b/examples/widgets/doc/src/spinboxes.qdoc
index 2be6321782..4478ce12d2 100644
--- a/examples/widgets/doc/src/spinboxes.qdoc
+++ b/examples/widgets/doc/src/spinboxes.qdoc
@@ -33,7 +33,7 @@
spin boxes available in Qt, from a simple QSpinBox widget to more complex
editors like the QDateTimeEdit widget.
- \image spinboxes-example.png
+ \borderedimage spinboxes-example.png
The example consists of a single \c Window class that is used to display the
different spin box-based widgets available with Qt.
diff --git a/examples/widgets/doc/src/styles.qdoc b/examples/widgets/doc/src/styles.qdoc
index abab595434..4fea8f3bfc 100644
--- a/examples/widgets/doc/src/styles.qdoc
+++ b/examples/widgets/doc/src/styles.qdoc
@@ -32,7 +32,8 @@
\brief The Styles example illustrates how to create custom widget
drawing styles using Qt, and demonstrates Qt's predefined styles.
- \image styles-enabledwood.png Screenshot of the Styles example
+ \borderedimage styles-enabledwood.png
+ \caption Screenshot of the Styles example
A style in Qt is a subclass of QStyle or of one of its
subclasses. Styles perform drawing on behalf of widgets. Qt
diff --git a/examples/widgets/doc/src/stylesheet.qdoc b/examples/widgets/doc/src/stylesheet.qdoc
index de330ce131..0016836f0d 100644
--- a/examples/widgets/doc/src/stylesheet.qdoc
+++ b/examples/widgets/doc/src/stylesheet.qdoc
@@ -31,6 +31,7 @@
\ingroup examples-widgets
\brief The Style Sheet Example shows how to use style sheets.
- \image stylesheet-pagefold.png Screen Shot of the Pagefold style sheet
+ \borderedimage stylesheet-pagefold.png
+ \caption Screen Shot of the Pagefold style sheet
*/
diff --git a/examples/widgets/doc/src/tetrix.qdoc b/examples/widgets/doc/src/tetrix.qdoc
index 12aa23606b..ddcf95013b 100644
--- a/examples/widgets/doc/src/tetrix.qdoc
+++ b/examples/widgets/doc/src/tetrix.qdoc
@@ -31,7 +31,7 @@
\ingroup examples-widgets
\brief The Tetrix example is a Qt version of the classic Tetrix game.
- \image tetrix-example.png
+ \borderedimage tetrix-example.png
The object of the game is to stack pieces dropped from the top of the
playing area so that they fill entire rows at the bottom of the playing area.
diff --git a/examples/widgets/doc/src/wiggly.qdoc b/examples/widgets/doc/src/wiggly.qdoc
index bf14f7ba0d..f330b016df 100644
--- a/examples/widgets/doc/src/wiggly.qdoc
+++ b/examples/widgets/doc/src/wiggly.qdoc
@@ -34,7 +34,8 @@
addition, the example demonstrates how to use QFontMetrics to
determine the size of text on screen.
- \image wiggly-example.png Screenshot of the Wiggly example
+ \borderedimage wiggly-example.png
+ \caption Screenshot of the Wiggly example
QBasicTimer is a low-level class for timers. Unlike QTimer,
QBasicTimer doesn't inherit from QObject; instead of emitting a
diff --git a/examples/widgets/doc/src/windowflags.qdoc b/examples/widgets/doc/src/windowflags.qdoc
index 636c605370..3fe00cd266 100644
--- a/examples/widgets/doc/src/windowflags.qdoc
+++ b/examples/widgets/doc/src/windowflags.qdoc
@@ -41,7 +41,8 @@
A widget's flags are stored in a Qt::WindowFlags type which stores
an OR combination of the flags.
- \image windowflags-example.png Screenshot of the Window Flags example
+ \borderedimage windowflags-example.png
+ \caption Screenshot of the Window Flags example
The example consists of two classes:
diff --git a/examples/widgets/graphicsview/boxes/glbuffers.h b/examples/widgets/graphicsview/boxes/glbuffers.h
index 0c2ff43c7e..03c24a91d3 100644
--- a/examples/widgets/graphicsview/boxes/glbuffers.h
+++ b/examples/widgets/graphicsview/boxes/glbuffers.h
@@ -110,8 +110,8 @@ public:
GLTexture2D(int width, int height);
explicit GLTexture2D(const QString& fileName, int width = 0, int height = 0);
void load(int width, int height, QRgb *data);
- virtual void bind() override;
- virtual void unbind() override;
+ void bind() override;
+ void unbind() override;
};
class GLTexture3D : public GLTexture
@@ -121,8 +121,8 @@ public:
// TODO: Implement function below
//GLTexture3D(const QString& fileName, int width = 0, int height = 0);
void load(int width, int height, int depth, QRgb *data);
- virtual void bind() override;
- virtual void unbind() override;
+ void bind() override;
+ void unbind() override;
};
class GLTextureCube : public GLTexture
@@ -131,8 +131,8 @@ public:
GLTextureCube(int size);
explicit GLTextureCube(const QStringList& fileNames, int size = 0);
void load(int size, int face, QRgb *data);
- virtual void bind() override;
- virtual void unbind() override;
+ void bind() override;
+ void unbind() override;
};
// TODO: Define and implement class below
@@ -146,7 +146,7 @@ public:
void begin(int face);
// end rendering
void end();
- virtual bool failed() const override {return m_failed || m_fbo.failed();}
+ bool failed() const override { return m_failed || m_fbo.failed(); }
static void getViewMatrix(QMatrix4x4& mat, int face);
static void getProjectionMatrix(QMatrix4x4& mat, float nearZ, float farZ);
diff --git a/examples/widgets/graphicsview/boxes/qtbox.h b/examples/widgets/graphicsview/boxes/qtbox.h
index e283dccfb4..f8ee9bdb0a 100644
--- a/examples/widgets/graphicsview/boxes/qtbox.h
+++ b/examples/widgets/graphicsview/boxes/qtbox.h
@@ -63,18 +63,18 @@ public:
ItemBase(int size, int x, int y);
virtual ~ItemBase();
- virtual QRectF boundingRect() const override;
- virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
+ QRectF boundingRect() const override;
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
protected:
virtual ItemBase *createNew(int size, int x, int y) = 0;
- virtual void contextMenuEvent(QGraphicsSceneContextMenuEvent *event) override;
- virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override;
- virtual void hoverMoveEvent(QGraphicsSceneHoverEvent *event) override;
- virtual void mousePressEvent(QGraphicsSceneMouseEvent *event) override;
- virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override;
- virtual void keyPressEvent(QKeyEvent *event) override;
- virtual void wheelEvent(QGraphicsSceneWheelEvent *event) override;
- virtual int type() const override;
+ void contextMenuEvent(QGraphicsSceneContextMenuEvent *event) override;
+ void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override;
+ void hoverMoveEvent(QGraphicsSceneHoverEvent *event) override;
+ void mousePressEvent(QGraphicsSceneMouseEvent *event) override;
+ void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override;
+ void keyPressEvent(QKeyEvent *event) override;
+ void wheelEvent(QGraphicsSceneWheelEvent *event) override;
+ int type() const override;
bool isInResizeArea(const QPointF &pos);
static void duplicateSelectedItems(QGraphicsScene *scene);
@@ -92,9 +92,9 @@ class QtBox : public ItemBase
public:
QtBox(int size, int x, int y);
virtual ~QtBox();
- virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
protected:
- virtual ItemBase *createNew(int size, int x, int y) override;
+ ItemBase *createNew(int size, int x, int y) override;
private:
QVector3D m_vertices[8];
QVector3D m_texCoords[4];
@@ -106,9 +106,9 @@ class CircleItem : public ItemBase
{
public:
CircleItem(int size, int x, int y);
- virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
protected:
- virtual ItemBase *createNew(int size, int x, int y) override;
+ ItemBase *createNew(int size, int x, int y) override;
QColor m_color;
};
@@ -117,9 +117,9 @@ class SquareItem : public ItemBase
{
public:
SquareItem(int size, int x, int y);
- virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
protected:
- virtual ItemBase *createNew(int size, int x, int y) override;
+ ItemBase *createNew(int size, int x, int y) override;
QPixmap m_image;
};
diff --git a/examples/widgets/graphicsview/boxes/scene.h b/examples/widgets/graphicsview/boxes/scene.h
index b76fb1057c..a2ba1d0b5a 100644
--- a/examples/widgets/graphicsview/boxes/scene.h
+++ b/examples/widgets/graphicsview/boxes/scene.h
@@ -81,13 +81,13 @@ class ColorEdit : public ParameterEdit
public:
ColorEdit(QRgb initialColor, int id);
QRgb color() const {return m_color;}
- virtual void emitChange() override { emit colorChanged(m_color, m_id); }
+ void emitChange() override { emit colorChanged(m_color, m_id); }
public slots:
void editDone();
signals:
void colorChanged(QRgb color, int id);
protected:
- virtual void mousePressEvent(QMouseEvent *event) override;
+ void mousePressEvent(QMouseEvent *event) override;
void setColor(QRgb color); // also emits colorChanged()
private:
QGraphicsScene *m_dialogParentScene;
@@ -103,7 +103,7 @@ class FloatEdit : public ParameterEdit
public:
FloatEdit(float initialValue, int id);
float value() const {return m_value;}
- virtual void emitChange() override { emit valueChanged(m_value, m_id); }
+ void emitChange() override { emit valueChanged(m_value, m_id); }
public slots:
void editDone();
signals:
@@ -120,9 +120,9 @@ class GraphicsWidget : public QGraphicsProxyWidget
public:
GraphicsWidget() : QGraphicsProxyWidget(0, Qt::Window) {}
protected:
- virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value) override;
- virtual void resizeEvent(QGraphicsSceneResizeEvent *event) override;
- virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
+ QVariant itemChange(GraphicsItemChange change, const QVariant &value) override;
+ void resizeEvent(QGraphicsSceneResizeEvent *event) override;
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
};
class TwoSidedGraphicsWidget : public QObject
@@ -162,7 +162,7 @@ signals:
void shaderChanged(int);
void doubleClicked();
protected:
- virtual void mouseDoubleClickEvent(QMouseEvent *event) override;
+ void mouseDoubleClickEvent(QMouseEvent *event) override;
QVector<QByteArray> m_parameterNames;
QComboBox *m_textureCombo;
@@ -189,7 +189,7 @@ signals:
void doubleClicked();
void newItemTriggered(ItemDialog::ItemType type);
protected:
- virtual void mouseDoubleClickEvent(QMouseEvent *event) override;
+ void mouseDoubleClickEvent(QMouseEvent *event) override;
};
class Scene : public QGraphicsScene
@@ -198,7 +198,7 @@ class Scene : public QGraphicsScene
public:
Scene(int width, int height, int maxTextureSize);
~Scene();
- virtual void drawBackground(QPainter *painter, const QRectF &rect) override;
+ void drawBackground(QPainter *painter, const QRectF &rect) override;
public slots:
void setShader(int index);
@@ -214,10 +214,10 @@ protected:
void defaultStates();
void renderCubemaps();
- virtual void mousePressEvent(QGraphicsSceneMouseEvent *event) override;
- virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override;
- virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override;
- virtual void wheelEvent(QGraphicsSceneWheelEvent * event) override;
+ void mousePressEvent(QGraphicsSceneMouseEvent *event) override;
+ void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override;
+ void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override;
+ void wheelEvent(QGraphicsSceneWheelEvent * event) override;
private:
void initGL();
QPointF pixelPosToViewPos(const QPointF& p);
diff --git a/examples/widgets/graphicsview/chip/view.cpp b/examples/widgets/graphicsview/chip/view.cpp
index 7a26227628..62aa25b575 100644
--- a/examples/widgets/graphicsview/chip/view.cpp
+++ b/examples/widgets/graphicsview/chip/view.cpp
@@ -50,10 +50,8 @@
#include "view.h"
-#ifndef QT_NO_PRINTER
#include <QPrinter>
#include <QPrintDialog>
-#endif
#ifndef QT_NO_OPENGL
#include <QtOpenGL>
#else
diff --git a/examples/widgets/graphicsview/dragdroprobot/main.cpp b/examples/widgets/graphicsview/dragdroprobot/main.cpp
index ff3758ac60..20cec92d26 100644
--- a/examples/widgets/graphicsview/dragdroprobot/main.cpp
+++ b/examples/widgets/graphicsview/dragdroprobot/main.cpp
@@ -63,7 +63,7 @@ public:
}
protected:
- virtual void resizeEvent(QResizeEvent *) override
+ void resizeEvent(QResizeEvent *) override
{
}
};
diff --git a/examples/widgets/graphicsview/weatheranchorlayout/main.cpp b/examples/widgets/graphicsview/weatheranchorlayout/main.cpp
index ec1f73bf9c..81db2780b4 100644
--- a/examples/widgets/graphicsview/weatheranchorlayout/main.cpp
+++ b/examples/widgets/graphicsview/weatheranchorlayout/main.cpp
@@ -69,7 +69,7 @@ public:
{
}
- virtual void resizeEvent(QResizeEvent *event) override
+ void resizeEvent(QResizeEvent *event) override
{
w->setGeometry(0, 0, event->size().width(), event->size().height());
}
diff --git a/examples/widgets/itemviews/frozencolumn/freezetablewidget.h b/examples/widgets/itemviews/frozencolumn/freezetablewidget.h
index 51c46fb7e7..69a90dab54 100644
--- a/examples/widgets/itemviews/frozencolumn/freezetablewidget.h
+++ b/examples/widgets/itemviews/frozencolumn/freezetablewidget.h
@@ -63,8 +63,8 @@ public:
protected:
- virtual void resizeEvent(QResizeEvent *event) override;
- virtual QModelIndex moveCursor(CursorAction cursorAction, Qt::KeyboardModifiers modifiers) override;
+ void resizeEvent(QResizeEvent *event) override;
+ QModelIndex moveCursor(CursorAction cursorAction, Qt::KeyboardModifiers modifiers) override;
void scrollTo (const QModelIndex & index, ScrollHint hint = EnsureVisible) override;
private:
diff --git a/examples/widgets/painting/fontsampler/mainwindow.cpp b/examples/widgets/painting/fontsampler/mainwindow.cpp
index 394a65b41e..5aecea4968 100644
--- a/examples/widgets/painting/fontsampler/mainwindow.cpp
+++ b/examples/widgets/painting/fontsampler/mainwindow.cpp
@@ -49,11 +49,7 @@
****************************************************************************/
#include <QtWidgets>
-#ifndef QT_NO_PRINTER
-#include <QPrinter>
-#include <QPrintDialog>
#include <QPrintPreviewDialog>
-#endif
#include "mainwindow.h"
diff --git a/examples/widgets/painting/fontsampler/mainwindow.h b/examples/widgets/painting/fontsampler/mainwindow.h
index e79da07326..6d73e84ea3 100644
--- a/examples/widgets/painting/fontsampler/mainwindow.h
+++ b/examples/widgets/painting/fontsampler/mainwindow.h
@@ -52,6 +52,8 @@
#define MAINWINDOW_H
#include "ui_mainwindowbase.h"
+#include <QPrinter>
+#include <QPrintDialog>
QT_BEGIN_NAMESPACE
class QPrinter;
diff --git a/examples/widgets/richtext/textedit/textedit.h b/examples/widgets/richtext/textedit/textedit.h
index e5f04e706c..ae0b13a4cc 100644
--- a/examples/widgets/richtext/textedit/textedit.h
+++ b/examples/widgets/richtext/textedit/textedit.h
@@ -78,7 +78,7 @@ public slots:
void fileNew();
protected:
- virtual void closeEvent(QCloseEvent *e) override;
+ void closeEvent(QCloseEvent *e) override;
private slots:
void fileOpen();
diff --git a/examples/widgets/statemachine/factorial/main.cpp b/examples/widgets/statemachine/factorial/main.cpp
index d0d61cb7df..919988051f 100644
--- a/examples/widgets/statemachine/factorial/main.cpp
+++ b/examples/widgets/statemachine/factorial/main.cpp
@@ -103,7 +103,7 @@ public:
: QSignalTransition(fact, SIGNAL(xChanged(int))), m_fact(fact)
{}
- virtual bool eventTest(QEvent *e) override
+ bool eventTest(QEvent *e) override
{
if (!QSignalTransition::eventTest(e))
return false;
@@ -111,7 +111,7 @@ public:
return se->arguments().at(0).toInt() > 1;
}
- virtual void onTransition(QEvent *e) override
+ void onTransition(QEvent *e) override
{
QStateMachine::SignalEvent *se = static_cast<QStateMachine::SignalEvent*>(e);
int x = se->arguments().at(0).toInt();
@@ -133,7 +133,7 @@ public:
: QSignalTransition(fact, SIGNAL(xChanged(int))), m_fact(fact)
{}
- virtual bool eventTest(QEvent *e) override
+ bool eventTest(QEvent *e) override
{
if (!QSignalTransition::eventTest(e))
return false;
@@ -141,7 +141,7 @@ public:
return se->arguments().at(0).toInt() <= 1;
}
- virtual void onTransition(QEvent *) override
+ void onTransition(QEvent *) override
{
fprintf(stdout, "%d\n", m_fact->property("fac").toInt());
}
diff --git a/examples/widgets/statemachine/pingpong/main.cpp b/examples/widgets/statemachine/pingpong/main.cpp
index 8c3b9f674b..c09060c502 100644
--- a/examples/widgets/statemachine/pingpong/main.cpp
+++ b/examples/widgets/statemachine/pingpong/main.cpp
@@ -75,7 +75,7 @@ public:
: QState(parent) {}
protected:
- virtual void onEntry(QEvent *) override
+ void onEntry(QEvent *) override
{
machine()->postEvent(new PingEvent());
fprintf(stdout, "ping?\n");
@@ -90,10 +90,10 @@ public:
PongTransition() {}
protected:
- virtual bool eventTest(QEvent *e) override {
+ bool eventTest(QEvent *e) override {
return (e->type() == QEvent::User+3);
}
- virtual void onTransition(QEvent *) override
+ void onTransition(QEvent *) override
{
machine()->postDelayedEvent(new PingEvent(), 500);
fprintf(stdout, "ping?\n");
@@ -108,10 +108,10 @@ public:
PingTransition() {}
protected:
- virtual bool eventTest(QEvent *e) override {
+ bool eventTest(QEvent *e) override {
return (e->type() == QEvent::User+2);
}
- virtual void onTransition(QEvent *) override
+ void onTransition(QEvent *) override
{
machine()->postDelayedEvent(new PongEvent(), 500);
fprintf(stdout, "pong!\n");
diff --git a/examples/widgets/statemachine/trafficlight/main.cpp b/examples/widgets/statemachine/trafficlight/main.cpp
index 143f2a9324..21df91d8b0 100644
--- a/examples/widgets/statemachine/trafficlight/main.cpp
+++ b/examples/widgets/statemachine/trafficlight/main.cpp
@@ -74,7 +74,7 @@ public slots:
void turnOn() { setOn(true); }
protected:
- virtual void paintEvent(QPaintEvent *) override
+ void paintEvent(QPaintEvent *) override
{
if (!m_on)
return;
diff --git a/mkspecs/android-clang/qmake.conf b/mkspecs/android-clang/qmake.conf
index b25a4399f3..3e621c7d77 100644
--- a/mkspecs/android-clang/qmake.conf
+++ b/mkspecs/android-clang/qmake.conf
@@ -1,4 +1,4 @@
-# qmake configuration for building with android-g++
+# qmake configuration for building with android-clang
MAKEFILE_GENERATOR = UNIX
QMAKE_PLATFORM = android
QMAKE_COMPILER = gcc clang llvm
@@ -6,6 +6,7 @@ QMAKE_COMPILER = gcc clang llvm
CONFIG += android_install unversioned_soname unversioned_libname plugin_with_soname android_deployment_settings
include(../common/linux.conf)
+include(../common/gcc-base-unix.conf)
include(../common/clang.conf)
include(../common/android-base-head.conf)
diff --git a/mkspecs/features/moc.prf b/mkspecs/features/moc.prf
index 0bc7482ec7..333d06f63a 100644
--- a/mkspecs/features/moc.prf
+++ b/mkspecs/features/moc.prf
@@ -32,7 +32,8 @@ if(gcc|intel_icl|msvc):!rim_qcc:!uikit:if(!macos|count(QMAKE_APPLE_DEVICE_ARCHS,
gcc: moc_predefs.commands = $$QMAKE_CXX $$QMAKE_CXXFLAGS -dM -E -o ${QMAKE_FILE_OUT} ${QMAKE_FILE_IN}
else:intel_icl: moc_predefs.commands = $$QMAKE_CXX $$QMAKE_CXXFLAGS -QdM -P -Fi${QMAKE_FILE_OUT} ${QMAKE_FILE_IN}
else:msvc {
- moc_predefs.commands += $$QMAKE_CXX -Bx$$QMAKE_QMAKE $$QMAKE_CXXFLAGS -E ${QMAKE_FILE_IN} 2>NUL >${QMAKE_FILE_OUT}
+ moc_predefs.commands += $$QMAKE_CXX -Bx$$shell_quote($$shell_path($$QMAKE_QMAKE)) $$QMAKE_CXXFLAGS \
+ -E ${QMAKE_FILE_IN} 2>NUL >${QMAKE_FILE_OUT}
} else: error("Oops, I messed up")
moc_predefs.output = $$MOC_DIR/moc_predefs.h
moc_predefs.input = MOC_PREDEF_FILE
diff --git a/mkspecs/features/qt.prf b/mkspecs/features/qt.prf
index 07b7565f48..634757a653 100644
--- a/mkspecs/features/qt.prf
+++ b/mkspecs/features/qt.prf
@@ -194,13 +194,8 @@ qt_module_deps = $$resolve_depends(qt_module_deps, "QT.")
# static builds: link qml import plugins into the app.
contains(qt_module_deps, qml): \
qtConfig(static):contains(TEMPLATE, .*app):!host_build:!no_import_scan {
- !isEmpty(QTREPOS) {
- for (qrep, QTREPOS): \
- exists($$qrep/qml): \
- QMLPATHS += $$qrep/qml
- } else {
- QMLPATHS += $$[QT_INSTALL_QML/get]
- }
+ exists($$[QT_INSTALL_QML/get]): \
+ QMLPATHS *= $$[QT_INSTALL_QML/get]
# run qmlimportscanner
qtPrepareTool(QMLIMPORTSCANNER, qmlimportscanner, , system)
diff --git a/mkspecs/features/qt_app.prf b/mkspecs/features/qt_app.prf
index 87e32d6d42..cb84ae0da8 100644
--- a/mkspecs/features/qt_app.prf
+++ b/mkspecs/features/qt_app.prf
@@ -37,6 +37,8 @@ INSTALLS += target
load(qt_targets)
load(qt_common)
+qtSetQmlPath()
+
no_launch_target: return()
load(resolve_target)
diff --git a/mkspecs/features/qt_build_config.prf b/mkspecs/features/qt_build_config.prf
index f543b47351..8b1034a2d8 100644
--- a/mkspecs/features/qt_build_config.prf
+++ b/mkspecs/features/qt_build_config.prf
@@ -52,6 +52,22 @@ QMAKE_DIR_REPLACE_SANE = PRECOMPILED_DIR OBJECTS_DIR MOC_DIR RCC_DIR UI_DIR
unset(modpath)
}
+defineTest(qtSetQmlPath) {
+ !qtConfig(static)|host_build|no_import_scan: \
+ return()
+ deps = $$replace(QT, -private$, _private)
+ deps = $$resolve_depends(deps, "QT.")
+ !contains(deps, qml): \
+ return()
+
+ isEmpty(QTREPOS): \
+ QTREPOS = $$shadowed($$dirname(_QMAKE_CONF_))
+ for (qrep, QTREPOS): \
+ exists($$qrep/qml): \
+ QMLPATHS += $$qrep/qml
+ export(QMLPATHS)
+}
+
# Apply extra compiler flags passed via configure last.
CONFIG = qt_build_extra $$CONFIG
diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf
index 1181566fec..9b3deff331 100644
--- a/mkspecs/features/qt_configure.prf
+++ b/mkspecs/features/qt_configure.prf
@@ -22,12 +22,18 @@ defineTest(qtConfAddWarning) {
defineTest(qtConfAddError) {
QT_CONFIGURE_ERRORS += "ERROR: $$join(1, $$escape_expand(\\n))"
export(QT_CONFIGURE_ERRORS)
- equals(2, log) {
+ equals(2, log):qt_conf_tests_allowed {
CONFIG += mention_config_log
export(CONFIG)
}
}
+defineTest(qtConfFatalError) {
+ qtConfAddError($$1, $$2)
+ qtConfPrintReport()
+ error()
+}
+
defineTest(qtConfCommandlineSetInput) {
arg = $${1}
val = $${2}
@@ -782,9 +788,7 @@ defineTest(qtConfTest_compile) {
defineTest(qtConfTest_verifySpec) {
qtConfTest_compile($$1): return(true)
- qtConfAddError("Cannot compile a minimal program. The toolchain or QMakeSpec is broken.", log)
- qtConfPrintReport()
- error()
+ qtConfFatalError("Cannot compile a minimal program. The toolchain or QMakeSpec is broken.", log)
}
defineTest(qtConfTest_files) {
@@ -1314,6 +1318,10 @@ defineTest(qtConfReport_error) {
qtConfAddError($${1}, log)
}
+defineTest(qtConfReport_fatal) {
+ qtConfFatalError($${1})
+}
+
defineTest(qtConfCreateReportRecurse) {
equals(2, false) {
indent = ""
diff --git a/mkspecs/features/qt_example_installs.prf b/mkspecs/features/qt_example_installs.prf
index 4c68cfd72f..0a008374e5 100644
--- a/mkspecs/features/qt_example_installs.prf
+++ b/mkspecs/features/qt_example_installs.prf
@@ -9,6 +9,9 @@
# We mean it.
#
+contains(TEMPLATE, .*app): \
+ qtSetQmlPath()
+
contains(TEMPLATE, "vc.*"): return()
defineTest(addInstallFiles) {
diff --git a/mkspecs/features/qt_module_headers.prf b/mkspecs/features/qt_module_headers.prf
index 790a4ee29e..a0be15c4a0 100644
--- a/mkspecs/features/qt_module_headers.prf
+++ b/mkspecs/features/qt_module_headers.prf
@@ -204,9 +204,20 @@ headersclean:!internal_module {
!contains(QT_ARCH, arm):!contains(QT_ARCH, mips): \
hcleanFLAGS += -Wcast-align
+ greaterThan(QT_CLANG_MAJOR_VERSION, 3) {
+ hcleanFLAGS += -Wdouble-promotion
+ } greaterThan(QT_CLANG_MAJOR_VERSION, 2):greaterThan(QT_CLANG_MINOR_VERSION, 7) {
+ hcleanFLAGS += -Wdouble-promotion
+ }
+
!clang {
# options accepted only by GCC
+ greaterThan(QT_GCC_MAJOR_VERSION, 4) {
+ hcleanFLAGS += -Wdouble-promotion
+ } greaterThan(QT_GCC_MAJOR_VERSION, 3):greaterThan(QT_GCC_MINOR_VERSION, 4) {
+ hcleanFLAGS += -Wdouble-promotion
+ }
c++11 {
# only enabled for actual c++11 builds due to
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52806
diff --git a/mkspecs/win32-msvc2017/qmake.conf b/mkspecs/win32-msvc2017/qmake.conf
new file mode 100644
index 0000000000..b8351eb3fe
--- /dev/null
+++ b/mkspecs/win32-msvc2017/qmake.conf
@@ -0,0 +1,10 @@
+#
+# qmake configuration for win32-msvc2017
+#
+# Written for Microsoft Visual C++ 2017
+#
+
+MSC_VER = 1910
+MSVC_VER = 15.0
+include(../common/msvc-desktop.conf)
+load(qt_config)
diff --git a/mkspecs/win32-msvc2017/qplatformdefs.h b/mkspecs/win32-msvc2017/qplatformdefs.h
new file mode 100644
index 0000000000..7100e3aa41
--- /dev/null
+++ b/mkspecs/win32-msvc2017/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 "../win32-msvc2005/qplatformdefs.h"
diff --git a/qmake/Makefile.unix b/qmake/Makefile.unix
index 425fe62ef6..33ec2508e2 100644
--- a/qmake/Makefile.unix
+++ b/qmake/Makefile.unix
@@ -20,7 +20,7 @@ QOBJS=qtextcodec.o qutfcodec.o qstring.o qstring_compat.o qstringbuilder.o qtext
qvariant.o qvsnprintf.o qlocale.o qlocale_tools.o qlinkedlist.o qnumeric.o \
qcryptographichash.o qxmlstream.o qxmlutils.o qlogging.o qoperatingsystemversion.o \
qjson.o qjsondocument.o qjsonparser.o qjsonarray.o qjsonobject.o qjsonvalue.o \
- $(QTOBJS)
+ $(QTOBJS) $(QTOBJS2)
#all sources, used for the depend target
@@ -92,11 +92,11 @@ DEPEND_SRC = \
$(SOURCE_PATH)/src/corelib/json/qjsonarray.cpp \
$(SOURCE_PATH)/src/corelib/json/qjsonobject.cpp \
$(SOURCE_PATH)/src/corelib/json/qjsonvalue.cpp \
- $(QTSRCS)
+ $(QTSRCS) $(QTSRCS2)
CPPFLAGS = -g $(EXTRA_CPPFLAGS) \
-I$(QMKSRC) -I$(QMKLIBSRC) -I$(QMKSRC)/generators -I$(QMKSRC)/generators/unix -I$(QMKSRC)/generators/win32 \
- -I$(QMKSRC)/generators/mac -I$(QMKSRC)/generators/integrity \
+ -I$(QMKSRC)/generators/mac \
-I$(INC_PATH) -I$(INC_PATH)/QtCore \
-I$(INC_PATH)/QtCore/$(QT_VERSION) -I$(INC_PATH)/QtCore/$(QT_VERSION)/QtCore \
-I$(BUILD_PATH)/src/corelib/global \
@@ -106,7 +106,8 @@ CPPFLAGS = -g $(EXTRA_CPPFLAGS) \
-DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED -DPROEVALUATOR_FULL \
-DQT_NO_FOREACH
-CXXFLAGS = $(EXTRA_CXXFLAGS) $(CPPFLAGS)
+CXXFLAGS = $(EXTRA_CXXFLAGS) $(CONFIG_CXXFLAGS) $(CPPFLAGS)
+LFLAGS = $(EXTRA_LFLAGS) $(CONFIG_LFLAGS)
first all: $(BUILD_PATH)/bin/qmake$(EXEEXT)
qmake: $(BUILD_PATH)/bin/qmake$(EXEEXT)
diff --git a/qmake/Makefile.unix.macos b/qmake/Makefile.unix.macos
new file mode 100644
index 0000000000..2708d2aab5
--- /dev/null
+++ b/qmake/Makefile.unix.macos
@@ -0,0 +1,17 @@
+COCOA_LFLAGS = -framework Foundation -framework CoreServices
+CARBON_LFLAGS = -framework ApplicationServices
+CARBON_CFLAGS = -fconstant-cfstrings
+
+EXTRA_CXXFLAGS = $(CARBON_CFLAGS)
+EXTRA_LFLAGS = $(COCOA_LFLAGS) $(CARBON_LFLAGS)
+
+QTOBJS2 = \
+ qsettings_mac.o \
+ qcore_mac.o \
+ qoperatingsystemversion_darwin.o \
+ qcore_foundation.o
+QTSRCS2 = \
+ $(SOURCE_PATH)/src/corelib/io/qsettings_mac.cpp \
+ $(SOURCE_PATH)/src/corelib/kernel/qcore_mac.cpp \
+ $(SOURCE_PATH)/src/corelib/global/qoperatingsystemversion_darwin.mm \
+ $(SOURCE_PATH)/src/corelib/kernel/qcore_foundation.mm
diff --git a/qmake/Makefile.unix.mingw b/qmake/Makefile.unix.mingw
new file mode 100644
index 0000000000..2c52c07dca
--- /dev/null
+++ b/qmake/Makefile.unix.mingw
@@ -0,0 +1,27 @@
+# SHELL is the full path of sh.exe, unless
+# 1) it is found in the current directory
+# 2) it is not found at all
+# 3) it is overridden on the command line with an existing file
+# ... otherwise it is always sh.exe. Specifically, SHELL from the
+# environment has no effect.
+#
+# This check will fail if SHELL is explicitly set to a not
+# sh-compatible shell. This is not a problem, because configure.bat
+# will not do that.
+ifeq ($(SHELL), sh.exe)
+ ifeq ($(wildcard $(CURDIR)/sh.exe), )
+ SH = 0
+ else
+ SH = 1
+ endif
+else
+ SH = 1
+endif
+
+ifeq ($(SH), 1)
+ RM_F = rm -f
+ RM_RF = rm -rf
+else
+ RM_F = del /f
+ RM_RF = rmdir /s /q
+endif
diff --git a/qmake/Makefile.unix.unix b/qmake/Makefile.unix.unix
new file mode 100644
index 0000000000..63eba4f5a5
--- /dev/null
+++ b/qmake/Makefile.unix.unix
@@ -0,0 +1,11 @@
+EXEEXT =
+QTOBJS = \
+ qfilesystemengine_unix.o \
+ qfilesystemiterator_unix.o \
+ qfsfileengine_unix.o \
+ qlocale_unix.o
+QTSRCS = \
+ $(SOURCE_PATH)/src/corelib/io/qfilesystemengine_unix.cpp \
+ $(SOURCE_PATH)/src/corelib/io/qfilesystemiterator_unix.cpp \
+ $(SOURCE_PATH)/src/corelib/io/qfsfileengine_unix.cpp \
+ $(SOURCE_PATH)/src/corelib/tools/qlocale_unix.cpp
diff --git a/qmake/Makefile.unix.win32 b/qmake/Makefile.unix.win32
new file mode 100644
index 0000000000..b2d8a0b1af
--- /dev/null
+++ b/qmake/Makefile.unix.win32
@@ -0,0 +1,21 @@
+EXEEXT = .exe
+EXTRA_CXXFLAGS = -DUNICODE
+EXTRA_LFLAGS = -static -s -lole32 -luuid -ladvapi32 -lkernel32
+QTOBJS = \
+ qfilesystemengine_win.o \
+ qfilesystemiterator_win.o \
+ qfsfileengine_win.o \
+ qlocale_win.o \
+ qsettings_win.o \
+ qoperatingsystemversion_win.o \
+ qsystemlibrary.o \
+ registry.o
+QTSRCS = \
+ $(SOURCE_PATH)/src/corelib/global/qoperatingsystemversion_win.cpp \
+ $(SOURCE_PATH)/src/corelib/io/qfilesystemengine_win.cpp \
+ $(SOURCE_PATH)/src/corelib/io/qfilesystemiterator_win.cpp \
+ $(SOURCE_PATH)/src/corelib/io/qfsfileengine_win.cpp \
+ $(SOURCE_PATH)/src/corelib/io/qsettings_win.cpp \
+ $(SOURCE_PATH)/src/corelib/tools/qlocale_win.cpp \
+ $(SOURCE_PATH)/src/corelib/plugin/qsystemlibrary.cpp \
+ $(SOURCE_PATH)/tools/shared/windows/registry.cpp
diff --git a/qmake/Makefile.win32 b/qmake/Makefile.win32
index f023dc9e3f..db8572839e 100644
--- a/qmake/Makefile.win32
+++ b/qmake/Makefile.win32
@@ -23,7 +23,7 @@ CXX = cl
LINKER = link
! if "$(QMAKESPEC)" == "win32-msvc2013"
CFLAGS_EXTRA = /MP /D_CRT_SECURE_NO_WARNINGS /D_SCL_SECURE_NO_WARNINGS $(CFLAGS_CRT)
-! elseif "$(QMAKESPEC)" == "win32-msvc2015" || "$(QMAKESPEC)" == "win32-clang-msvc2015"
+! elseif "$(QMAKESPEC)" == "win32-msvc2015" || "$(QMAKESPEC)" == "win32-msvc2017" || "$(QMAKESPEC)" == "win32-clang-msvc2015"
CFLAGS_EXTRA = /MP /D_CRT_SECURE_NO_WARNINGS /D_SCL_SECURE_NO_WARNINGS /Zc:strictStrings /w44456 /w44457 /w44458 /wd4577 $(CFLAGS_CRT)
! else
! error Unsupported compiler for this Makefile
@@ -38,7 +38,7 @@ PCH_OBJECT = qmake_pch.obj
CFLAGS_BARE = -c -Fo./ -Fdqmake.pdb \
-W3 -nologo -O1 \
$(CFLAGS_EXTRA) \
- -I$(QMKSRC) -I$(QMKSRC)\library -I$(QMKSRC)\generators -I$(QMKSRC)\generators\unix -I$(QMKSRC)\generators\win32 -I$(QMKSRC)\generators\mac -I$(QMKSRC)\generators\integrity \
+ -I$(QMKSRC) -I$(QMKSRC)\library -I$(QMKSRC)\generators -I$(QMKSRC)\generators\unix -I$(QMKSRC)\generators\win32 -I$(QMKSRC)\generators\mac \
-I$(INC_PATH) -I$(INC_PATH)\QtCore -I$(INC_PATH)\QtCore\$(QT_VERSION) -I$(INC_PATH)\QtCore\$(QT_VERSION)\QtCore \
-I$(BUILD_PATH)\src\corelib\global \
-I$(SOURCE_PATH)\mkspecs\$(QMAKESPEC) \
@@ -149,18 +149,9 @@ distclean:: clean
-del $(BUILD_PATH)\bin\qmake.exe
-del Makefile
-.c.obj:
- $(CXX) $(CFLAGS) $<
-
.cpp.obj:
$(CXX) $(CXXFLAGS) $<
-.cc.obj:
- $(CXX) $(CXXFLAGS) $<
-
-.cxx.obj:
- $(CXX) $(CXXFLAGS) $<
-
$(OBJS): $(PCH_OBJECT)
$(QTOBJS): $(PCH_OBJECT)
@@ -176,9 +167,6 @@ qmake_pch.obj:
{$(SOURCE_PATH)\qmake\generators\mac}.cpp{}.obj::
$(CXX) $(CXXFLAGS) $<
-{$(SOURCE_PATH)\qmake\generators\integrity}.cpp{}.obj::
- $(CXX) $(CXXFLAGS) $<
-
{$(SOURCE_PATH)\qmake\generators\unix}.cpp{}.obj::
$(CXX) $(CXXFLAGS) $<
diff --git a/qmake/doc/src/qmake-manual.qdoc b/qmake/doc/src/qmake-manual.qdoc
index aa6c8b35cc..c3c878ebb8 100644
--- a/qmake/doc/src/qmake-manual.qdoc
+++ b/qmake/doc/src/qmake-manual.qdoc
@@ -2057,6 +2057,12 @@
value of this variable is typically handled by qmake or
\l{#QMAKESPEC}{qmake.conf} and rarely needs to be modified.
+ \section1 QMAKE_OBJECTIVE_CFLAGS
+
+ Specifies the Objective C/C++ compiler flags for building
+ a project. These flags are used in addition to QMAKE_CFLAGS and
+ QMAKE_CXXFLAGS.
+
\section1 QMAKE_POST_LINK
Specifies the command to execute after linking the \l{TARGET}
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
index 4450e619b9..1ba2587bd0 100644
--- a/qmake/generators/makefile.cpp
+++ b/qmake/generators/makefile.cpp
@@ -1839,7 +1839,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
QString dep_cd_cmd;
if (!tmp_dep_cmd.isEmpty()) {
dep_cd_cmd = QLatin1String("cd ")
- + escapeFilePath(Option::fixPathToLocalOS(Option::output_dir, false))
+ + IoUtils::shellQuote(Option::fixPathToLocalOS(Option::output_dir, false))
+ QLatin1String(" && ");
}
const ProStringList &vars = project->values(ProKey(*it + ".variables"));
diff --git a/qmake/generators/win32/mingw_make.cpp b/qmake/generators/win32/mingw_make.cpp
index 382b10c37b..e3d76cd76e 100644
--- a/qmake/generators/win32/mingw_make.cpp
+++ b/qmake/generators/win32/mingw_make.cpp
@@ -308,7 +308,12 @@ void MingwMakefileGenerator::writeBuildRulesPart(QTextStream &t)
{
t << "first: all\n";
t << "all: " << escapeDependencyPath(fileFixify(Option::output.fileName()))
- << ' ' << depVar("ALL_DEPS") << " $(DESTDIR_TARGET)\n\n";
+ << ' ' << depVar("ALL_DEPS");
+ if (project->first("TEMPLATE") == "aux") {
+ t << "\n\n";
+ return;
+ }
+ t << " $(DESTDIR_TARGET)\n\n";
t << "$(DESTDIR_TARGET): " << depVar("PRE_TARGETDEPS") << " $(OBJECTS) " << depVar("POST_TARGETDEPS");
if(!project->isEmpty("QMAKE_PRE_LINK"))
t << "\n\t" <<var("QMAKE_PRE_LINK");
@@ -318,7 +323,7 @@ void MingwMakefileGenerator::writeBuildRulesPart(QTextStream &t)
} else {
t << "\n\t" << objectsLinkLine << " " ;
}
- } else if (project->first("TEMPLATE") != "aux") {
+ } else {
t << "\n\t$(LINKER) $(LFLAGS) " << var("QMAKE_LINK_O_FLAG") << "$(DESTDIR_TARGET) " << objectsLinkLine << " $(LIBS)";
}
if(!project->isEmpty("QMAKE_POST_LINK"))
diff --git a/qmake/generators/win32/msvc_nmake.cpp b/qmake/generators/win32/msvc_nmake.cpp
index 1739f66453..3a4f6242b2 100644
--- a/qmake/generators/win32/msvc_nmake.cpp
+++ b/qmake/generators/win32/msvc_nmake.cpp
@@ -517,7 +517,12 @@ void NmakeMakefileGenerator::writeBuildRulesPart(QTextStream &t)
t << "first: all\n";
t << "all: " << escapeDependencyPath(fileFixify(Option::output.fileName()))
- << ' ' << depVar("ALL_DEPS") << " $(DESTDIR_TARGET)\n\n";
+ << ' ' << depVar("ALL_DEPS");
+ if (templateName == "aux") {
+ t << "\n\n";
+ return;
+ }
+ t << " $(DESTDIR_TARGET)\n\n";
t << "$(DESTDIR_TARGET): " << depVar("PRE_TARGETDEPS") << " $(OBJECTS) " << depVar("POST_TARGETDEPS");
if(!project->isEmpty("QMAKE_PRE_LINK"))
@@ -526,7 +531,7 @@ void NmakeMakefileGenerator::writeBuildRulesPart(QTextStream &t)
t << "\n\t$(LIBAPP) $(LIBFLAGS) " << var("QMAKE_LINK_O_FLAG") << "$(DESTDIR_TARGET) @<<\n\t "
<< "$(OBJECTS)"
<< "\n<<";
- } else if (templateName != "aux") {
+ } else {
const bool embedManifest = ((templateName == "app" && project->isActiveConfig("embed_manifest_exe"))
|| (templateName == "lib" && project->isActiveConfig("embed_manifest_dll")
&& !(project->isActiveConfig("plugin") && project->isActiveConfig("no_plugin_manifest"))
diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp
index f219130e18..1fb83d719e 100644
--- a/qmake/generators/win32/msvc_objectmodel.cpp
+++ b/qmake/generators/win32/msvc_objectmodel.cpp
@@ -29,9 +29,14 @@
#include "msvc_objectmodel.h"
#include "msvc_vcproj.h"
#include "msvc_vcxproj.h"
+
+#include <ioutils.h>
+
#include <qscopedpointer.h>
#include <qfileinfo.h>
+using namespace QMakeInternal;
+
QT_BEGIN_NAMESPACE
static DotNET vsVersionFromString(const char *versionString)
@@ -2173,7 +2178,6 @@ VCConfiguration::VCConfiguration()
compiler.config = this;
linker.config = this;
idl.config = this;
- custom.config = this;
}
// VCFilter ---------------------------------------------------------
@@ -2347,7 +2351,7 @@ bool VCFilter::addExtraCompiler(const VCFilterFile &info)
tmp_dep_cmd, inFile, out, MakefileGenerator::LocalShell);
if(Project->canExecute(dep_cmd)) {
dep_cmd.prepend(QLatin1String("cd ")
- + Project->escapeFilePath(Option::fixPathToLocalOS(Option::output_dir, false))
+ + IoUtils::shellQuote(Option::fixPathToLocalOS(Option::output_dir, false))
+ QLatin1String(" && "));
if (FILE *proc = QT_POPEN(dep_cmd.toLatin1().constData(), QT_POPEN_READ)) {
QString indeps;
@@ -2896,7 +2900,6 @@ void VCProjectWriter::write(XmlOutput &xml, const VCConfiguration &tool)
<< attrE(_UseOfMfc, tool.UseOfMfc)
<< attrT(_WholeProgramOptimization, tool.WholeProgramOptimization);
write(xml, tool.compiler);
- write(xml, tool.custom);
if (tool.ConfigurationType == typeStaticLibrary)
write(xml, tool.librarian);
else
diff --git a/qmake/generators/win32/msvc_objectmodel.h b/qmake/generators/win32/msvc_objectmodel.h
index 35bc3913a8..025112701b 100644
--- a/qmake/generators/win32/msvc_objectmodel.h
+++ b/qmake/generators/win32/msvc_objectmodel.h
@@ -51,7 +51,8 @@ enum DotNET {
NET2010 = 0xa0,
NET2012 = 0xb0,
NET2013 = 0xc0,
- NET2015 = 0xd0
+ NET2015 = 0xd0,
+ NET2017 = 0xe0
};
DotNET vsVersionFromString(const ProString &versionString);
@@ -896,7 +897,6 @@ public:
VCLinkerTool linker;
VCLibrarianTool librarian;
VCManifestTool manifestTool;
- VCCustomBuildTool custom;
VCMIDLTool idl;
VCPostBuildEventTool postBuild;
VCPreBuildEventTool preBuild;
@@ -912,24 +912,15 @@ struct VCFilterFile
{ excludeFromBuild = false; }
VCFilterFile(const QString &filename, bool exclude = false )
{ file = filename; excludeFromBuild = exclude; }
- VCFilterFile(const QString &filename, const QString &additional, bool exclude = false )
- { file = filename; excludeFromBuild = exclude; additionalFile = additional; }
- bool operator==(const VCFilterFile &other){
- return file == other.file
- && additionalFile == other.additionalFile
- && excludeFromBuild == other.excludeFromBuild;
- }
bool excludeFromBuild;
QString file;
- QString additionalFile; // For tools like MOC
};
#ifndef QT_NO_DEBUG_OUTPUT
inline QDebug operator<<(QDebug dbg, const VCFilterFile &p)
{
dbg.nospace() << "VCFilterFile(file(" << p.file
- << ") additionalFile(" << p.additionalFile
<< ") excludeFromBuild(" << p.excludeFromBuild << "))" << endl;
return dbg.space();
}
diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp
index 77cb554ec6..a5ee42a449 100644
--- a/qmake/generators/win32/msvc_vcproj.cpp
+++ b/qmake/generators/win32/msvc_vcproj.cpp
@@ -29,15 +29,21 @@
#include "msvc_vcproj.h"
#include "option.h"
#include "xmloutput.h"
+
+#include <ioutils.h>
+
#include <qdir.h>
#include <qdiriterator.h>
#include <qcryptographichash.h>
#include <qhash.h>
#include <quuid.h>
+
#include <stdlib.h>
//#define DEBUG_SOLUTION_GEN
+using namespace QMakeInternal;
+
QT_BEGIN_NAMESPACE
// Filter GUIDs (Do NOT change these!) ------------------------------
const char _GUIDSourceFiles[] = "{4FC737F1-C7A5-4376-A066-2A32D752A2FF}";
@@ -66,6 +72,8 @@ const char _slnHeader120[] = "Microsoft Visual Studio Solution File, Format
"\n# Visual Studio 2013";
const char _slnHeader140[] = "Microsoft Visual Studio Solution File, Format Version 12.00"
"\n# Visual Studio 2015";
+const char _slnHeader141[] = "Microsoft Visual Studio Solution File, Format Version 12.00"
+ "\n# Visual Studio 2017";
// The following UUID _may_ change for later servicepacks...
// If so we need to search through the registry at
// HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\7.0\Projects
@@ -294,6 +302,8 @@ QString VcprojGenerator::retrievePlatformToolSet() const
return QStringLiteral("v120") + suffix;
case NET2015:
return QStringLiteral("v140") + suffix;
+ case NET2017:
+ return QStringLiteral("v141") + suffix;
default:
return QString();
}
@@ -521,6 +531,9 @@ void VcprojGenerator::writeSubDirs(QTextStream &t)
}
switch (vcProject.Configuration.CompilerVersion) {
+ case NET2017:
+ t << _slnHeader141;
+ break;
case NET2015:
t << _slnHeader140;
break;
@@ -843,6 +856,9 @@ void VcprojGenerator::initProject()
// Own elements -----------------------------
vcProject.Name = project->first("QMAKE_ORIG_TARGET").toQString();
switch (vcProject.Configuration.CompilerVersion) {
+ case NET2017:
+ vcProject.Version = "15.00";
+ break;
case NET2015:
vcProject.Version = "14.00";
break;
@@ -1448,7 +1464,7 @@ void VcprojGenerator::initResourceFiles()
dep_cmd = Option::fixPathToLocalOS(dep_cmd, true, false);
if(canExecute(dep_cmd)) {
dep_cmd.prepend(QLatin1String("cd ")
- + escapeFilePath(Option::fixPathToLocalOS(Option::output_dir, false))
+ + IoUtils::shellQuote(Option::fixPathToLocalOS(Option::output_dir, false))
+ QLatin1String(" && "));
if (FILE *proc = QT_POPEN(dep_cmd.toLatin1().constData(), QT_POPEN_READ)) {
QString indeps;
diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp
index af9fe520f1..48df4ff916 100644
--- a/qmake/generators/win32/winmakefile.cpp
+++ b/qmake/generators/win32/winmakefile.cpp
@@ -568,16 +568,18 @@ void Win32MakefileGenerator::writeStandardParts(QTextStream &t)
t << "####### Build rules\n\n";
writeBuildRulesPart(t);
- if(project->isActiveConfig("shared") && !project->values("DLLDESTDIR").isEmpty()) {
- const ProStringList &dlldirs = project->values("DLLDESTDIR");
- for (ProStringList::ConstIterator dlldir = dlldirs.begin(); dlldir != dlldirs.end(); ++dlldir) {
- t << "\t-$(COPY_FILE) $(DESTDIR_TARGET) "
- << escapeFilePath(Option::fixPathToTargetOS((*dlldir).toQString(), false)) << endl;
+ if (project->first("TEMPLATE") != "aux") {
+ if (project->isActiveConfig("shared") && !project->values("DLLDESTDIR").isEmpty()) {
+ const ProStringList &dlldirs = project->values("DLLDESTDIR");
+ for (ProStringList::ConstIterator dlldir = dlldirs.begin(); dlldir != dlldirs.end(); ++dlldir) {
+ t << "\t-$(COPY_FILE) $(DESTDIR_TARGET) "
+ << escapeFilePath(Option::fixPathToTargetOS((*dlldir).toQString(), false)) << endl;
+ }
}
- }
- t << endl;
+ t << endl;
- writeRcFilePart(t);
+ writeRcFilePart(t);
+ }
writeMakeQmake(t);
@@ -601,8 +603,10 @@ void Win32MakefileGenerator::writeStandardParts(QTextStream &t)
const ProStringList &quc = project->values("QMAKE_EXTRA_COMPILERS");
for (ProStringList::ConstIterator it = quc.begin(); it != quc.end(); ++it) {
const ProStringList &inputs = project->values(ProKey(*it + ".input"));
- for (ProStringList::ConstIterator input = inputs.begin(); input != inputs.end(); ++input)
- t << escapeFilePath(*input) << ' ';
+ for (ProStringList::ConstIterator input = inputs.begin(); input != inputs.end(); ++input) {
+ const ProStringList &val = project->values((*input).toKey());
+ t << escapeFilePaths(val).join(' ') << ' ';
+ }
}
}
t << endl << endl;
diff --git a/qmake/library/qmakeevaluator.cpp b/qmake/library/qmakeevaluator.cpp
index dd10afa023..fd24cf209d 100644
--- a/qmake/library/qmakeevaluator.cpp
+++ b/qmake/library/qmakeevaluator.cpp
@@ -971,6 +971,13 @@ static ProString msvcBinDirToQMakeArch(QString subdir)
subdir = subdir.toLower();
if (subdir == QLatin1String("amd64"))
return ProString("x86_64");
+ // Since 2017 the folder structure from here is HostX64|X86/x64|x86
+ idx = subdir.indexOf(QLatin1Char('\\'));
+ if (idx == -1)
+ return ProString("x86");
+ subdir.remove(0, idx + 1);
+ if (subdir == QLatin1String("x64"))
+ return ProString("x86_64");
return ProString(subdir);
}
@@ -1052,8 +1059,12 @@ void QMakeEvaluator::loadDefaults()
vars[ProKey("QMAKE_HOST.arch")] << archStr;
# if defined(Q_CC_MSVC) // ### bogus condition, but nobody x-builds for msvc with a different qmake
+ // Since VS 2017 we need VCToolsInstallDir instead of VCINSTALLDIR
+ QString vcInstallDir = m_option->getEnv(QLatin1String("VCToolsInstallDir"));
+ if (vcInstallDir.isEmpty())
+ vcInstallDir = m_option->getEnv(QLatin1String("VCINSTALLDIR"));
vars[ProKey("QMAKE_TARGET.arch")] = msvcArchitecture(
- m_option->getEnv(QLatin1String("VCINSTALLDIR")),
+ vcInstallDir,
m_option->getEnv(QLatin1String("PATH")));
# endif
#elif defined(Q_OS_UNIX)
diff --git a/qmake/qmake.pro b/qmake/qmake.pro
index 74cefb07aa..1472aef3e4 100644
--- a/qmake/qmake.pro
+++ b/qmake/qmake.pro
@@ -27,7 +27,6 @@ INCLUDEPATH += . \
generators/unix \
generators/win32 \
generators/mac \
- generators/integrity \
../tools/shared
include(qmake.pri)
diff --git a/src/3rdparty/angle/qt_attribution.json b/src/3rdparty/angle/qt_attribution.json
index 230f30940b..e35e1f0eb9 100644
--- a/src/3rdparty/angle/qt_attribution.json
+++ b/src/3rdparty/angle/qt_attribution.json
@@ -12,7 +12,7 @@
},
{
"Id": "angle-arrayboundsclamper",
- "Name": "ANGLE Array Bounds Clamper for WebKit",
+ "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.",
@@ -25,7 +25,7 @@
},
{
"Id": "angle-murmurhash",
- "Name": "Murmurhash (as part of ANGLE)",
+ "Name": "ANGLE: Murmurhash",
"QDocModule": "qtgui",
"QtUsage": "Used on Windows to implement OpenGL ES on top of DirectX. Configure with -no-opengl, or -opengl desktop to exclude.",
@@ -36,7 +36,7 @@
},
{
"Id": "angle-systeminfo",
- "Name": "Systeminfo (as part of ANGLE)",
+ "Name": "ANGLE: Systeminfo",
"QDocModule": "qtgui",
"QtUsage": "Used on Windows to implement OpenGL ES on top of DirectX. Configure with -no-opengl, or -opengl desktop to exclude.",
@@ -48,7 +48,7 @@
},
{
"Id": "angle-trace_event",
- "Name": "trace_event (as part of ANGLE)",
+ "Name": "ANGLE: trace_event",
"QDocModule": "qtgui",
"QtUsage": "Used on Windows to implement OpenGL ES on top of DirectX. Configure with -no-opengl, or -opengl desktop to exclude.",
diff --git a/src/3rdparty/forkfd/LICENSE b/src/3rdparty/forkfd/LICENSE
index 351ebf705d..36ab612951 100644
--- a/src/3rdparty/forkfd/LICENSE
+++ b/src/3rdparty/forkfd/LICENSE
@@ -1,4 +1,5 @@
Copyright (C) 2016 Intel Corporation.
+Copyright (C) 2015 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/src/3rdparty/forkfd/qt_attribution.json b/src/3rdparty/forkfd/qt_attribution.json
index 89f25f4870..f004116753 100644
--- a/src/3rdparty/forkfd/qt_attribution.json
+++ b/src/3rdparty/forkfd/qt_attribution.json
@@ -7,6 +7,6 @@
"License": "MIT License",
"LicenseId": "MIT",
"LicenseFile": "LICENSE",
- "Copyright": "Copyright (C) 2013-2016 Intel Corporation
+ "Copyright": "Copyright (C) 2016 Intel Corporation
Copyright (C) 2015 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com"
}
diff --git a/src/3rdparty/freebsd/qt_attribution.json b/src/3rdparty/freebsd/qt_attribution.json
index 40c337cc67..57f425cdbc 100644
--- a/src/3rdparty/freebsd/qt_attribution.json
+++ b/src/3rdparty/freebsd/qt_attribution.json
@@ -4,14 +4,10 @@
"QDocModule": "qtcore",
"QtUsage": "Used in Qt Core.",
+ "Description": "strtoll() and strtoull() are functions for converting a string to (unsigned) long long integer.",
"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."
+ "Copyright": "Copyright (c) 1992, 1993 The Regents of the University of California.
+Copyright (c) 2011 The FreeBSD Foundation"
}
diff --git a/src/3rdparty/sha3/qt_attribution.json b/src/3rdparty/sha3/qt_attribution.json
index 13e6e971d9..4866be32ea 100644
--- a/src/3rdparty/sha3/qt_attribution.json
+++ b/src/3rdparty/sha3/qt_attribution.json
@@ -4,6 +4,7 @@
"Name": "Secure Hash Algorithm SHA-3 - brg_endian",
"QDocModule": "qtcore",
"QtUsage": "Used in Qt Core (QCryptographicHash).",
+ "Files": "brg_endian.h",
"Description": "SHA-3, originally known as Keccak, is a cryptographic hash function.",
"License": "BSD 3-clause \"New\" or \"Revised\" License",
@@ -16,6 +17,7 @@
"Name": "Secure Hash Algorithm SHA-3 - Keccak",
"QDocModule": "qtcore",
"QtUsage": "Used in Qt Core (QCryptographicHash).",
+ "Files": "KeccakF-1600-32-rvk.macros KeccakF-1600-32.macros KeccakF-1600-64.macros KeccakF-1600-interface.h KeccakF-1600-opt32.c KeccakF-1600-opt64.c KeccakF-1600-unrolling.macros KeccakNISTInterface.c KeccakNISTInterface.h KeccakSponge.c KeccakSponge.h",
"Description": "SHA-3, originally known as Keccak, is a cryptographic hash function.",
"License": "Creative Commons Zero v1.0 Universal",
diff --git a/src/concurrent/qtconcurrentfilterkernel.h b/src/concurrent/qtconcurrentfilterkernel.h
index 1e875e3d38..bd474fc0c9 100644
--- a/src/concurrent/qtconcurrentfilterkernel.h
+++ b/src/concurrent/qtconcurrentfilterkernel.h
@@ -96,7 +96,7 @@ public:
reducer(OrderedReduce)
{ }
- bool runIteration(typename Sequence::const_iterator it, int index, T *)
+ bool runIteration(typename Sequence::const_iterator it, int index, T *) override
{
IntermediateResults<typename Sequence::value_type> results;
results.begin = index;
@@ -109,7 +109,7 @@ public:
return false;
}
- bool runIterations(typename Sequence::const_iterator sequenceBeginIterator, int begin, int end, T *)
+ bool runIterations(typename Sequence::const_iterator sequenceBeginIterator, int begin, int end, T *) override
{
IntermediateResults<typename Sequence::value_type> results;
results.begin = begin;
@@ -129,18 +129,18 @@ public:
return false;
}
- void finish()
+ void finish() override
{
reducer.finish(reduce, reducedResult);
sequence = reducedResult;
}
- inline bool shouldThrottleThread()
+ inline bool shouldThrottleThread() override
{
return IterateKernelType::shouldThrottleThread() || reducer.shouldThrottle();
}
- inline bool shouldStartThread()
+ inline bool shouldStartThread() override
{
return IterateKernelType::shouldStartThread() && reducer.shouldStartThread();
}
@@ -183,7 +183,7 @@ public:
{ }
#endif
- bool runIteration(Iterator it, int index, ReducedResultType *)
+ bool runIteration(Iterator it, int index, ReducedResultType *) override
{
IntermediateResults<typename qValueType<Iterator>::value_type> results;
results.begin = index;
@@ -196,7 +196,7 @@ public:
return false;
}
- bool runIterations(Iterator sequenceBeginIterator, int begin, int end, ReducedResultType *)
+ bool runIterations(Iterator sequenceBeginIterator, int begin, int end, ReducedResultType *) override
{
IntermediateResults<typename qValueType<Iterator>::value_type> results;
results.begin = begin;
@@ -215,24 +215,24 @@ public:
return false;
}
- void finish()
+ void finish() override
{
reducer.finish(reduce, reducedResult);
}
- inline bool shouldThrottleThread()
+ inline bool shouldThrottleThread() override
{
return IterateKernelType::shouldThrottleThread() || reducer.shouldThrottle();
}
- inline bool shouldStartThread()
+ inline bool shouldStartThread() override
{
return IterateKernelType::shouldStartThread() && reducer.shouldStartThread();
}
typedef ReducedResultType ReturnType;
typedef ReducedResultType ResultType;
- ReducedResultType *result()
+ ReducedResultType *result() override
{
return &reducedResult;
}
@@ -255,14 +255,14 @@ public:
: IterateKernelType(begin, end), keep(_keep)
{ }
- void start()
+ void start() override
{
if (this->futureInterface)
this->futureInterface->setFilterMode(true);
IterateKernelType::start();
}
- bool runIteration(Iterator it, int index, T *)
+ bool runIteration(Iterator it, int index, T *) override
{
if (keep(*it))
this->reportResult(&(*it), index);
@@ -271,7 +271,7 @@ public:
return false;
}
- bool runIterations(Iterator sequenceBeginIterator, int begin, int end, T *)
+ bool runIterations(Iterator sequenceBeginIterator, int begin, int end, T *) override
{
const int count = end - begin;
IntermediateResults<typename qValueType<Iterator>::value_type> results;
diff --git a/src/concurrent/qtconcurrentiteratekernel.h b/src/concurrent/qtconcurrentiteratekernel.h
index b4360abd26..dbd000e8ba 100644
--- a/src/concurrent/qtconcurrentiteratekernel.h
+++ b/src/concurrent/qtconcurrentiteratekernel.h
@@ -197,14 +197,14 @@ public:
virtual bool runIterations(Iterator _begin, int beginIndex, int endIndex, T *results)
{ Q_UNUSED(_begin); Q_UNUSED(beginIndex); Q_UNUSED(endIndex); Q_UNUSED(results); return false; }
- void start()
+ void start() override
{
progressReportingEnabled = this->isProgressReportingEnabled();
if (progressReportingEnabled && iterationCount > 0)
this->setProgressRange(0, iterationCount);
}
- bool shouldStartThread()
+ bool shouldStartThread() override
{
if (forIteration)
return (currentIndex.load() < iterationCount) && !this->shouldThrottleThread();
@@ -212,7 +212,7 @@ public:
return (iteratorThreads.load() == 0);
}
- ThreadFunctionResult threadFunction()
+ ThreadFunctionResult threadFunction() override
{
if (forIteration)
return this->forThreadFunction();
diff --git a/src/concurrent/qtconcurrentmapkernel.h b/src/concurrent/qtconcurrentmapkernel.h
index ad5ef93684..fa162f7c34 100644
--- a/src/concurrent/qtconcurrentmapkernel.h
+++ b/src/concurrent/qtconcurrentmapkernel.h
@@ -64,13 +64,13 @@ public:
: IterateKernel<Iterator, void>(begin, end), map(_map)
{ }
- bool runIteration(Iterator it, int, void *)
+ bool runIteration(Iterator it, int, void *) override
{
map(*it);
return false;
}
- bool runIterations(Iterator sequenceBeginIterator, int beginIndex, int endIndex, void *)
+ bool runIterations(Iterator sequenceBeginIterator, int beginIndex, int endIndex, void *) override
{
Iterator it = sequenceBeginIterator;
std::advance(it, beginIndex);
@@ -108,7 +108,7 @@ public:
: reducedResult(initialValue), map(_map), reduce(_reduce)
{ }
- bool runIteration(Iterator it, int index, ReducedResultType *)
+ bool runIteration(Iterator it, int index, ReducedResultType *) override
{
IntermediateResults<typename MapFunctor::result_type> results;
results.begin = index;
@@ -119,7 +119,7 @@ public:
return false;
}
- bool runIterations(Iterator sequenceBeginIterator, int begin, int end, ReducedResultType *)
+ bool runIterations(Iterator sequenceBeginIterator, int begin, int end, ReducedResultType *) override
{
IntermediateResults<typename MapFunctor::result_type> results;
results.begin = begin;
@@ -137,23 +137,23 @@ public:
return false;
}
- void finish()
+ void finish() override
{
reducer.finish(reduce, reducedResult);
}
- bool shouldThrottleThread()
+ bool shouldThrottleThread() override
{
return IterateKernel<Iterator, ReducedResultType>::shouldThrottleThread() || reducer.shouldThrottle();
}
- bool shouldStartThread()
+ bool shouldStartThread() override
{
return IterateKernel<Iterator, ReducedResultType>::shouldStartThread() && reducer.shouldStartThread();
}
typedef ReducedResultType ResultType;
- ReducedResultType *result()
+ ReducedResultType *result() override
{
return &reducedResult;
}
@@ -171,13 +171,13 @@ public:
MappedEachKernel(Iterator begin, Iterator end, MapFunctor _map)
: IterateKernel<Iterator, T>(begin, end), map(_map) { }
- bool runIteration(Iterator it, int, T *result)
+ bool runIteration(Iterator it, int, T *result) override
{
*result = map(*it);
return true;
}
- bool runIterations(Iterator sequenceBeginIterator, int begin, int end, T *results)
+ bool runIterations(Iterator sequenceBeginIterator, int begin, int end, T *results) override
{
Iterator it = sequenceBeginIterator;
@@ -216,7 +216,7 @@ struct SequenceHolder1 : public Base
Sequence sequence;
- void finish()
+ void finish() override
{
Base::finish();
// Clear the sequence to make sure all temporaries are destroyed
diff --git a/src/concurrent/qtconcurrentreducekernel.h b/src/concurrent/qtconcurrentreducekernel.h
index 2cbf30dffb..c5003a2a0e 100644
--- a/src/concurrent/qtconcurrentreducekernel.h
+++ b/src/concurrent/qtconcurrentreducekernel.h
@@ -230,7 +230,7 @@ struct SequenceHolder2 : public Base
Sequence sequence;
- void finish()
+ void finish() override
{
Base::finish();
// Clear the sequence to make sure all temporaries are destroyed
diff --git a/src/concurrent/qtconcurrentrunbase.h b/src/concurrent/qtconcurrentrunbase.h
index 734fd54f70..303838b73e 100644
--- a/src/concurrent/qtconcurrentrunbase.h
+++ b/src/concurrent/qtconcurrentrunbase.h
@@ -88,7 +88,7 @@ public:
return theFuture;
}
- void run() {}
+ void run() override {}
virtual void runFunctor() = 0;
};
@@ -96,7 +96,7 @@ template <typename T>
class RunFunctionTask : public RunFunctionTaskBase<T>
{
public:
- void run()
+ void run() override
{
if (this->isCanceled()) {
this->reportFinished();
@@ -124,7 +124,7 @@ template <>
class RunFunctionTask<void> : public RunFunctionTaskBase<void>
{
public:
- void run()
+ void run() override
{
if (this->isCanceled()) {
this->reportFinished();
diff --git a/src/concurrent/qtconcurrentstoredfunctioncall.h b/src/concurrent/qtconcurrentstoredfunctioncall.h
index 0afce17f74..750ece1ef1 100644
--- a/src/concurrent/qtconcurrentstoredfunctioncall.h
+++ b/src/concurrent/qtconcurrentstoredfunctioncall.h
@@ -57,7 +57,7 @@ struct StoredFunctorCall0: public RunFunctionTask<T>
{
inline StoredFunctorCall0(FunctionPointer _function)
: function(_function) {}
- void runFunctor() { this->result = function(); }
+ void runFunctor() override { this->result = function(); }
FunctionPointer function;
};
@@ -67,7 +67,7 @@ struct StoredFunctorCall0<void, FunctionPointer>: public RunFunctionTask<void>
{
inline StoredFunctorCall0(FunctionPointer _function)
: function(_function) {}
- void runFunctor() { function(); }
+ void runFunctor() override { function(); }
FunctionPointer function;
};
@@ -77,7 +77,7 @@ struct StoredFunctorPointerCall0: public RunFunctionTask<T>
{
inline StoredFunctorPointerCall0(FunctionPointer * _function)
: function(_function) {}
- void runFunctor() { this->result =(*function)(); }
+ void runFunctor() override { this->result =(*function)(); }
FunctionPointer * function;
};
@@ -87,7 +87,7 @@ struct VoidStoredFunctorPointerCall0: public RunFunctionTask<T>
{
inline VoidStoredFunctorPointerCall0(FunctionPointer * _function)
: function(_function) {}
- void runFunctor() {(*function)(); }
+ void runFunctor() override { (*function)(); }
FunctionPointer * function;
};
@@ -106,7 +106,7 @@ public:
StoredMemberFunctionCall0(T (Class::*_fn)() , const Class &_object)
: fn(_fn), object(_object){ }
- void runFunctor()
+ void runFunctor() override
{
this->result = (object.*fn)();
}
@@ -122,7 +122,7 @@ public:
VoidStoredMemberFunctionCall0(T (Class::*_fn)() , const Class &_object)
: fn(_fn), object(_object){ }
- void runFunctor()
+ void runFunctor() override
{
(object.*fn)();
}
@@ -145,7 +145,7 @@ public:
StoredConstMemberFunctionCall0(T (Class::*_fn)() const, const Class &_object)
: fn(_fn), object(_object){ }
- void runFunctor()
+ void runFunctor() override
{
this->result = (object.*fn)();
}
@@ -161,7 +161,7 @@ public:
VoidStoredConstMemberFunctionCall0(T (Class::*_fn)() const, const Class &_object)
: fn(_fn), object(_object){ }
- void runFunctor()
+ void runFunctor() override
{
(object.*fn)();
}
@@ -184,7 +184,7 @@ public:
StoredMemberFunctionPointerCall0(T (Class::*_fn)() , Class *_object)
: fn(_fn), object(_object){ }
- void runFunctor()
+ void runFunctor() override
{
this->result = (object->*fn)();
}
@@ -200,7 +200,7 @@ public:
VoidStoredMemberFunctionPointerCall0(T (Class::*_fn)() , Class *_object)
: fn(_fn), object(_object){ }
- void runFunctor()
+ void runFunctor() override
{
(object->*fn)();
}
@@ -223,7 +223,7 @@ public:
StoredConstMemberFunctionPointerCall0(T (Class::*_fn)() const, Class const *_object)
: fn(_fn), object(_object){ }
- void runFunctor()
+ void runFunctor() override
{
this->result = (object->*fn)();
}
@@ -239,7 +239,7 @@ public:
VoidStoredConstMemberFunctionPointerCall0(T (Class::*_fn)() const, Class const *_object)
: fn(_fn), object(_object){ }
- void runFunctor()
+ void runFunctor() override
{
(object->*fn)();
}
@@ -260,7 +260,7 @@ struct StoredFunctorCall1: public RunFunctionTask<T>
{
inline StoredFunctorCall1(FunctionPointer _function, const Arg1 &_arg1)
: function(_function), arg1(_arg1) {}
- void runFunctor() { this->result = function(arg1); }
+ void runFunctor() override { this->result = function(arg1); }
FunctionPointer function;
Arg1 arg1;
};
@@ -270,7 +270,7 @@ struct StoredFunctorCall1<void, FunctionPointer, Arg1>: public RunFunctionTask<v
{
inline StoredFunctorCall1(FunctionPointer _function, const Arg1 &_arg1)
: function(_function), arg1(_arg1) {}
- void runFunctor() { function(arg1); }
+ void runFunctor() override { function(arg1); }
FunctionPointer function;
Arg1 arg1;
};
@@ -280,7 +280,7 @@ struct StoredFunctorPointerCall1: public RunFunctionTask<T>
{
inline StoredFunctorPointerCall1(FunctionPointer * _function, const Arg1 &_arg1)
: function(_function), arg1(_arg1) {}
- void runFunctor() { this->result =(*function)(arg1); }
+ void runFunctor() override { this->result =(*function)(arg1); }
FunctionPointer * function;
Arg1 arg1;
};
@@ -290,7 +290,7 @@ struct VoidStoredFunctorPointerCall1: public RunFunctionTask<T>
{
inline VoidStoredFunctorPointerCall1(FunctionPointer * _function, const Arg1 &_arg1)
: function(_function), arg1(_arg1) {}
- void runFunctor() {(*function)(arg1); }
+ void runFunctor() override { (*function)(arg1); }
FunctionPointer * function;
Arg1 arg1;
};
@@ -309,7 +309,7 @@ public:
StoredMemberFunctionCall1(T (Class::*_fn)(Param1) , const Class &_object, const Arg1 &_arg1)
: fn(_fn), object(_object), arg1(_arg1){ }
- void runFunctor()
+ void runFunctor() override
{
this->result = (object.*fn)(arg1);
}
@@ -325,7 +325,7 @@ public:
VoidStoredMemberFunctionCall1(T (Class::*_fn)(Param1) , const Class &_object, const Arg1 &_arg1)
: fn(_fn), object(_object), arg1(_arg1){ }
- void runFunctor()
+ void runFunctor() override
{
(object.*fn)(arg1);
}
@@ -348,7 +348,7 @@ public:
StoredConstMemberFunctionCall1(T (Class::*_fn)(Param1) const, const Class &_object, const Arg1 &_arg1)
: fn(_fn), object(_object), arg1(_arg1){ }
- void runFunctor()
+ void runFunctor() override
{
this->result = (object.*fn)(arg1);
}
@@ -364,7 +364,7 @@ public:
VoidStoredConstMemberFunctionCall1(T (Class::*_fn)(Param1) const, const Class &_object, const Arg1 &_arg1)
: fn(_fn), object(_object), arg1(_arg1){ }
- void runFunctor()
+ void runFunctor() override
{
(object.*fn)(arg1);
}
@@ -387,7 +387,7 @@ public:
StoredMemberFunctionPointerCall1(T (Class::*_fn)(Param1) , Class *_object, const Arg1 &_arg1)
: fn(_fn), object(_object), arg1(_arg1){ }
- void runFunctor()
+ void runFunctor() override
{
this->result = (object->*fn)(arg1);
}
@@ -403,7 +403,7 @@ public:
VoidStoredMemberFunctionPointerCall1(T (Class::*_fn)(Param1) , Class *_object, const Arg1 &_arg1)
: fn(_fn), object(_object), arg1(_arg1){ }
- void runFunctor()
+ void runFunctor() override
{
(object->*fn)(arg1);
}
@@ -426,7 +426,7 @@ public:
StoredConstMemberFunctionPointerCall1(T (Class::*_fn)(Param1) const, Class const *_object, const Arg1 &_arg1)
: fn(_fn), object(_object), arg1(_arg1){ }
- void runFunctor()
+ void runFunctor() override
{
this->result = (object->*fn)(arg1);
}
@@ -442,7 +442,7 @@ public:
VoidStoredConstMemberFunctionPointerCall1(T (Class::*_fn)(Param1) const, Class const *_object, const Arg1 &_arg1)
: fn(_fn), object(_object), arg1(_arg1){ }
- void runFunctor()
+ void runFunctor() override
{
(object->*fn)(arg1);
}
@@ -463,7 +463,7 @@ struct StoredFunctorCall2: public RunFunctionTask<T>
{
inline StoredFunctorCall2(FunctionPointer _function, const Arg1 &_arg1, const Arg2 &_arg2)
: function(_function), arg1(_arg1), arg2(_arg2) {}
- void runFunctor() { this->result = function(arg1, arg2); }
+ void runFunctor() override { this->result = function(arg1, arg2); }
FunctionPointer function;
Arg1 arg1; Arg2 arg2;
};
@@ -473,7 +473,7 @@ struct StoredFunctorCall2<void, FunctionPointer, Arg1, Arg2>: public RunFunction
{
inline StoredFunctorCall2(FunctionPointer _function, const Arg1 &_arg1, const Arg2 &_arg2)
: function(_function), arg1(_arg1), arg2(_arg2) {}
- void runFunctor() { function(arg1, arg2); }
+ void runFunctor() override { function(arg1, arg2); }
FunctionPointer function;
Arg1 arg1; Arg2 arg2;
};
@@ -483,7 +483,7 @@ struct StoredFunctorPointerCall2: public RunFunctionTask<T>
{
inline StoredFunctorPointerCall2(FunctionPointer * _function, const Arg1 &_arg1, const Arg2 &_arg2)
: function(_function), arg1(_arg1), arg2(_arg2) {}
- void runFunctor() { this->result =(*function)(arg1, arg2); }
+ void runFunctor() override { this->result =(*function)(arg1, arg2); }
FunctionPointer * function;
Arg1 arg1; Arg2 arg2;
};
@@ -493,7 +493,7 @@ struct VoidStoredFunctorPointerCall2: public RunFunctionTask<T>
{
inline VoidStoredFunctorPointerCall2(FunctionPointer * _function, const Arg1 &_arg1, const Arg2 &_arg2)
: function(_function), arg1(_arg1), arg2(_arg2) {}
- void runFunctor() {(*function)(arg1, arg2); }
+ void runFunctor() override { (*function)(arg1, arg2); }
FunctionPointer * function;
Arg1 arg1; Arg2 arg2;
};
@@ -512,7 +512,7 @@ public:
StoredMemberFunctionCall2(T (Class::*_fn)(Param1, Param2) , const Class &_object, const Arg1 &_arg1, const Arg2 &_arg2)
: fn(_fn), object(_object), arg1(_arg1), arg2(_arg2){ }
- void runFunctor()
+ void runFunctor() override
{
this->result = (object.*fn)(arg1, arg2);
}
@@ -528,7 +528,7 @@ public:
VoidStoredMemberFunctionCall2(T (Class::*_fn)(Param1, Param2) , const Class &_object, const Arg1 &_arg1, const Arg2 &_arg2)
: fn(_fn), object(_object), arg1(_arg1), arg2(_arg2){ }
- void runFunctor()
+ void runFunctor() override
{
(object.*fn)(arg1, arg2);
}
@@ -551,7 +551,7 @@ public:
StoredConstMemberFunctionCall2(T (Class::*_fn)(Param1, Param2) const, const Class &_object, const Arg1 &_arg1, const Arg2 &_arg2)
: fn(_fn), object(_object), arg1(_arg1), arg2(_arg2){ }
- void runFunctor()
+ void runFunctor() override
{
this->result = (object.*fn)(arg1, arg2);
}
@@ -567,7 +567,7 @@ public:
VoidStoredConstMemberFunctionCall2(T (Class::*_fn)(Param1, Param2) const, const Class &_object, const Arg1 &_arg1, const Arg2 &_arg2)
: fn(_fn), object(_object), arg1(_arg1), arg2(_arg2){ }
- void runFunctor()
+ void runFunctor() override
{
(object.*fn)(arg1, arg2);
}
@@ -590,7 +590,7 @@ public:
StoredMemberFunctionPointerCall2(T (Class::*_fn)(Param1, Param2) , Class *_object, const Arg1 &_arg1, const Arg2 &_arg2)
: fn(_fn), object(_object), arg1(_arg1), arg2(_arg2){ }
- void runFunctor()
+ void runFunctor() override
{
this->result = (object->*fn)(arg1, arg2);
}
@@ -606,7 +606,7 @@ public:
VoidStoredMemberFunctionPointerCall2(T (Class::*_fn)(Param1, Param2) , Class *_object, const Arg1 &_arg1, const Arg2 &_arg2)
: fn(_fn), object(_object), arg1(_arg1), arg2(_arg2){ }
- void runFunctor()
+ void runFunctor() override
{
(object->*fn)(arg1, arg2);
}
@@ -629,7 +629,7 @@ public:
StoredConstMemberFunctionPointerCall2(T (Class::*_fn)(Param1, Param2) const, Class const *_object, const Arg1 &_arg1, const Arg2 &_arg2)
: fn(_fn), object(_object), arg1(_arg1), arg2(_arg2){ }
- void runFunctor()
+ void runFunctor() override
{
this->result = (object->*fn)(arg1, arg2);
}
@@ -645,7 +645,7 @@ public:
VoidStoredConstMemberFunctionPointerCall2(T (Class::*_fn)(Param1, Param2) const, Class const *_object, const Arg1 &_arg1, const Arg2 &_arg2)
: fn(_fn), object(_object), arg1(_arg1), arg2(_arg2){ }
- void runFunctor()
+ void runFunctor() override
{
(object->*fn)(arg1, arg2);
}
@@ -666,7 +666,7 @@ struct StoredFunctorCall3: public RunFunctionTask<T>
{
inline StoredFunctorCall3(FunctionPointer _function, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3)
: function(_function), arg1(_arg1), arg2(_arg2), arg3(_arg3) {}
- void runFunctor() { this->result = function(arg1, arg2, arg3); }
+ void runFunctor() override { this->result = function(arg1, arg2, arg3); }
FunctionPointer function;
Arg1 arg1; Arg2 arg2; Arg3 arg3;
};
@@ -676,7 +676,7 @@ struct StoredFunctorCall3<void, FunctionPointer, Arg1, Arg2, Arg3>: public RunFu
{
inline StoredFunctorCall3(FunctionPointer _function, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3)
: function(_function), arg1(_arg1), arg2(_arg2), arg3(_arg3) {}
- void runFunctor() { function(arg1, arg2, arg3); }
+ void runFunctor() override { function(arg1, arg2, arg3); }
FunctionPointer function;
Arg1 arg1; Arg2 arg2; Arg3 arg3;
};
@@ -686,7 +686,7 @@ struct StoredFunctorPointerCall3: public RunFunctionTask<T>
{
inline StoredFunctorPointerCall3(FunctionPointer * _function, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3)
: function(_function), arg1(_arg1), arg2(_arg2), arg3(_arg3) {}
- void runFunctor() { this->result =(*function)(arg1, arg2, arg3); }
+ void runFunctor() override { this->result =(*function)(arg1, arg2, arg3); }
FunctionPointer * function;
Arg1 arg1; Arg2 arg2; Arg3 arg3;
};
@@ -696,7 +696,7 @@ struct VoidStoredFunctorPointerCall3: public RunFunctionTask<T>
{
inline VoidStoredFunctorPointerCall3(FunctionPointer * _function, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3)
: function(_function), arg1(_arg1), arg2(_arg2), arg3(_arg3) {}
- void runFunctor() {(*function)(arg1, arg2, arg3); }
+ void runFunctor() override { (*function)(arg1, arg2, arg3); }
FunctionPointer * function;
Arg1 arg1; Arg2 arg2; Arg3 arg3;
};
@@ -715,7 +715,7 @@ public:
StoredMemberFunctionCall3(T (Class::*_fn)(Param1, Param2, Param3) , const Class &_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3)
: fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3){ }
- void runFunctor()
+ void runFunctor() override
{
this->result = (object.*fn)(arg1, arg2, arg3);
}
@@ -731,7 +731,7 @@ public:
VoidStoredMemberFunctionCall3(T (Class::*_fn)(Param1, Param2, Param3) , const Class &_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3)
: fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3){ }
- void runFunctor()
+ void runFunctor() override
{
(object.*fn)(arg1, arg2, arg3);
}
@@ -754,7 +754,7 @@ public:
StoredConstMemberFunctionCall3(T (Class::*_fn)(Param1, Param2, Param3) const, const Class &_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3)
: fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3){ }
- void runFunctor()
+ void runFunctor() override
{
this->result = (object.*fn)(arg1, arg2, arg3);
}
@@ -770,7 +770,7 @@ public:
VoidStoredConstMemberFunctionCall3(T (Class::*_fn)(Param1, Param2, Param3) const, const Class &_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3)
: fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3){ }
- void runFunctor()
+ void runFunctor() override
{
(object.*fn)(arg1, arg2, arg3);
}
@@ -793,7 +793,7 @@ public:
StoredMemberFunctionPointerCall3(T (Class::*_fn)(Param1, Param2, Param3) , Class *_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3)
: fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3){ }
- void runFunctor()
+ void runFunctor() override
{
this->result = (object->*fn)(arg1, arg2, arg3);
}
@@ -809,7 +809,7 @@ public:
VoidStoredMemberFunctionPointerCall3(T (Class::*_fn)(Param1, Param2, Param3) , Class *_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3)
: fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3){ }
- void runFunctor()
+ void runFunctor() override
{
(object->*fn)(arg1, arg2, arg3);
}
@@ -832,7 +832,7 @@ public:
StoredConstMemberFunctionPointerCall3(T (Class::*_fn)(Param1, Param2, Param3) const, Class const *_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3)
: fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3){ }
- void runFunctor()
+ void runFunctor() override
{
this->result = (object->*fn)(arg1, arg2, arg3);
}
@@ -848,7 +848,7 @@ public:
VoidStoredConstMemberFunctionPointerCall3(T (Class::*_fn)(Param1, Param2, Param3) const, Class const *_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3)
: fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3){ }
- void runFunctor()
+ void runFunctor() override
{
(object->*fn)(arg1, arg2, arg3);
}
@@ -869,7 +869,7 @@ struct StoredFunctorCall4: public RunFunctionTask<T>
{
inline StoredFunctorCall4(FunctionPointer _function, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4)
: function(_function), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4) {}
- void runFunctor() { this->result = function(arg1, arg2, arg3, arg4); }
+ void runFunctor() override { this->result = function(arg1, arg2, arg3, arg4); }
FunctionPointer function;
Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4;
};
@@ -879,7 +879,7 @@ struct StoredFunctorCall4<void, FunctionPointer, Arg1, Arg2, Arg3, Arg4>: public
{
inline StoredFunctorCall4(FunctionPointer _function, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4)
: function(_function), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4) {}
- void runFunctor() { function(arg1, arg2, arg3, arg4); }
+ void runFunctor() override { function(arg1, arg2, arg3, arg4); }
FunctionPointer function;
Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4;
};
@@ -889,7 +889,7 @@ struct StoredFunctorPointerCall4: public RunFunctionTask<T>
{
inline StoredFunctorPointerCall4(FunctionPointer * _function, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4)
: function(_function), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4) {}
- void runFunctor() { this->result =(*function)(arg1, arg2, arg3, arg4); }
+ void runFunctor() override { this->result =(*function)(arg1, arg2, arg3, arg4); }
FunctionPointer * function;
Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4;
};
@@ -899,7 +899,7 @@ struct VoidStoredFunctorPointerCall4: public RunFunctionTask<T>
{
inline VoidStoredFunctorPointerCall4(FunctionPointer * _function, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4)
: function(_function), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4) {}
- void runFunctor() {(*function)(arg1, arg2, arg3, arg4); }
+ void runFunctor() override { (*function)(arg1, arg2, arg3, arg4); }
FunctionPointer * function;
Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4;
};
@@ -918,7 +918,7 @@ public:
StoredMemberFunctionCall4(T (Class::*_fn)(Param1, Param2, Param3, Param4) , const Class &_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4)
: fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4){ }
- void runFunctor()
+ void runFunctor() override
{
this->result = (object.*fn)(arg1, arg2, arg3, arg4);
}
@@ -934,7 +934,7 @@ public:
VoidStoredMemberFunctionCall4(T (Class::*_fn)(Param1, Param2, Param3, Param4) , const Class &_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4)
: fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4){ }
- void runFunctor()
+ void runFunctor() override
{
(object.*fn)(arg1, arg2, arg3, arg4);
}
@@ -957,7 +957,7 @@ public:
StoredConstMemberFunctionCall4(T (Class::*_fn)(Param1, Param2, Param3, Param4) const, const Class &_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4)
: fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4){ }
- void runFunctor()
+ void runFunctor() override
{
this->result = (object.*fn)(arg1, arg2, arg3, arg4);
}
@@ -973,7 +973,7 @@ public:
VoidStoredConstMemberFunctionCall4(T (Class::*_fn)(Param1, Param2, Param3, Param4) const, const Class &_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4)
: fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4){ }
- void runFunctor()
+ void runFunctor() override
{
(object.*fn)(arg1, arg2, arg3, arg4);
}
@@ -996,7 +996,7 @@ public:
StoredMemberFunctionPointerCall4(T (Class::*_fn)(Param1, Param2, Param3, Param4) , Class *_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4)
: fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4){ }
- void runFunctor()
+ void runFunctor() override
{
this->result = (object->*fn)(arg1, arg2, arg3, arg4);
}
@@ -1012,7 +1012,7 @@ public:
VoidStoredMemberFunctionPointerCall4(T (Class::*_fn)(Param1, Param2, Param3, Param4) , Class *_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4)
: fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4){ }
- void runFunctor()
+ void runFunctor() override
{
(object->*fn)(arg1, arg2, arg3, arg4);
}
@@ -1035,7 +1035,7 @@ public:
StoredConstMemberFunctionPointerCall4(T (Class::*_fn)(Param1, Param2, Param3, Param4) const, Class const *_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4)
: fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4){ }
- void runFunctor()
+ void runFunctor() override
{
this->result = (object->*fn)(arg1, arg2, arg3, arg4);
}
@@ -1051,7 +1051,7 @@ public:
VoidStoredConstMemberFunctionPointerCall4(T (Class::*_fn)(Param1, Param2, Param3, Param4) const, Class const *_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4)
: fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4){ }
- void runFunctor()
+ void runFunctor() override
{
(object->*fn)(arg1, arg2, arg3, arg4);
}
@@ -1072,7 +1072,7 @@ struct StoredFunctorCall5: public RunFunctionTask<T>
{
inline StoredFunctorCall5(FunctionPointer _function, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4, const Arg5 &_arg5)
: function(_function), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4), arg5(_arg5) {}
- void runFunctor() { this->result = function(arg1, arg2, arg3, arg4, arg5); }
+ void runFunctor() override { this->result = function(arg1, arg2, arg3, arg4, arg5); }
FunctionPointer function;
Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; Arg5 arg5;
};
@@ -1082,7 +1082,7 @@ struct StoredFunctorCall5<void, FunctionPointer, Arg1, Arg2, Arg3, Arg4, Arg5>:
{
inline StoredFunctorCall5(FunctionPointer _function, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4, const Arg5 &_arg5)
: function(_function), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4), arg5(_arg5) {}
- void runFunctor() { function(arg1, arg2, arg3, arg4, arg5); }
+ void runFunctor() override { function(arg1, arg2, arg3, arg4, arg5); }
FunctionPointer function;
Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; Arg5 arg5;
};
@@ -1092,7 +1092,7 @@ struct StoredFunctorPointerCall5: public RunFunctionTask<T>
{
inline StoredFunctorPointerCall5(FunctionPointer * _function, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4, const Arg5 &_arg5)
: function(_function), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4), arg5(_arg5) {}
- void runFunctor() { this->result =(*function)(arg1, arg2, arg3, arg4, arg5); }
+ void runFunctor() override { this->result =(*function)(arg1, arg2, arg3, arg4, arg5); }
FunctionPointer * function;
Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; Arg5 arg5;
};
@@ -1102,7 +1102,7 @@ struct VoidStoredFunctorPointerCall5: public RunFunctionTask<T>
{
inline VoidStoredFunctorPointerCall5(FunctionPointer * _function, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4, const Arg5 &_arg5)
: function(_function), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4), arg5(_arg5) {}
- void runFunctor() {(*function)(arg1, arg2, arg3, arg4, arg5); }
+ void runFunctor() override {(*function)(arg1, arg2, arg3, arg4, arg5); }
FunctionPointer * function;
Arg1 arg1; Arg2 arg2; Arg3 arg3; Arg4 arg4; Arg5 arg5;
};
@@ -1121,7 +1121,7 @@ public:
StoredMemberFunctionCall5(T (Class::*_fn)(Param1, Param2, Param3, Param4, Param5) , const Class &_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4, const Arg5 &_arg5)
: fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4), arg5(_arg5){ }
- void runFunctor()
+ void runFunctor() override
{
this->result = (object.*fn)(arg1, arg2, arg3, arg4, arg5);
}
@@ -1137,7 +1137,7 @@ public:
VoidStoredMemberFunctionCall5(T (Class::*_fn)(Param1, Param2, Param3, Param4, Param5) , const Class &_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4, const Arg5 &_arg5)
: fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4), arg5(_arg5){ }
- void runFunctor()
+ void runFunctor() override
{
(object.*fn)(arg1, arg2, arg3, arg4, arg5);
}
@@ -1160,7 +1160,7 @@ public:
StoredConstMemberFunctionCall5(T (Class::*_fn)(Param1, Param2, Param3, Param4, Param5) const, const Class &_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4, const Arg5 &_arg5)
: fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4), arg5(_arg5){ }
- void runFunctor()
+ void runFunctor() override
{
this->result = (object.*fn)(arg1, arg2, arg3, arg4, arg5);
}
@@ -1176,7 +1176,7 @@ public:
VoidStoredConstMemberFunctionCall5(T (Class::*_fn)(Param1, Param2, Param3, Param4, Param5) const, const Class &_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4, const Arg5 &_arg5)
: fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4), arg5(_arg5){ }
- void runFunctor()
+ void runFunctor() override
{
(object.*fn)(arg1, arg2, arg3, arg4, arg5);
}
@@ -1199,7 +1199,7 @@ public:
StoredMemberFunctionPointerCall5(T (Class::*_fn)(Param1, Param2, Param3, Param4, Param5) , Class *_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4, const Arg5 &_arg5)
: fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4), arg5(_arg5){ }
- void runFunctor()
+ void runFunctor() override
{
this->result = (object->*fn)(arg1, arg2, arg3, arg4, arg5);
}
@@ -1215,7 +1215,7 @@ public:
VoidStoredMemberFunctionPointerCall5(T (Class::*_fn)(Param1, Param2, Param3, Param4, Param5) , Class *_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4, const Arg5 &_arg5)
: fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4), arg5(_arg5){ }
- void runFunctor()
+ void runFunctor() override
{
(object->*fn)(arg1, arg2, arg3, arg4, arg5);
}
@@ -1238,7 +1238,7 @@ public:
StoredConstMemberFunctionPointerCall5(T (Class::*_fn)(Param1, Param2, Param3, Param4, Param5) const, Class const *_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4, const Arg5 &_arg5)
: fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4), arg5(_arg5){ }
- void runFunctor()
+ void runFunctor() override
{
this->result = (object->*fn)(arg1, arg2, arg3, arg4, arg5);
}
@@ -1254,7 +1254,7 @@ public:
VoidStoredConstMemberFunctionPointerCall5(T (Class::*_fn)(Param1, Param2, Param3, Param4, Param5) const, Class const *_object, const Arg1 &_arg1, const Arg2 &_arg2, const Arg3 &_arg3, const Arg4 &_arg4, const Arg5 &_arg5)
: fn(_fn), object(_object), arg1(_arg1), arg2(_arg2), arg3(_arg3), arg4(_arg4), arg5(_arg5){ }
- void runFunctor()
+ void runFunctor() override
{
(object->*fn)(arg1, arg2, arg3, arg4, arg5);
}
@@ -1276,7 +1276,7 @@ class StoredFunctorCall : public RunFunctionTask<T>
{
public:
StoredFunctorCall(const Functor &f) : functor(f) { }
- void runFunctor()
+ void runFunctor() override
{
this->result = functor();
}
@@ -1288,7 +1288,7 @@ class StoredFunctorCall<void, Functor> : public RunFunctionTask<void>
{
public:
StoredFunctorCall(const Functor &f) : functor(f) { }
- void runFunctor()
+ void runFunctor() override
{
functor();
}
diff --git a/src/corelib/Qt5Config.cmake.in b/src/corelib/Qt5Config.cmake.in
index a872d0e917..75b53485b7 100644
--- a/src/corelib/Qt5Config.cmake.in
+++ b/src/corelib/Qt5Config.cmake.in
@@ -22,18 +22,24 @@ get_filename_component(_qt5_install_prefix \"${CMAKE_CURRENT_LIST_DIR}/..\" ABSO
set(_Qt5_NOTFOUND_MESSAGE)
+include(${CMAKE_CURRENT_LIST_DIR}/Qt5ModuleLocation.cmake)
+
foreach(module ${Qt5_FIND_COMPONENTS})
find_package(Qt5${module}
${_Qt5_FIND_PARTS_QUIET}
${_Qt5_FIND_PARTS_REQUIRED}
- PATHS \"${_qt5_install_prefix}\" NO_DEFAULT_PATH
+ PATHS ${_qt5_module_paths} NO_DEFAULT_PATH
)
if (NOT Qt5${module}_FOUND)
+ string(CONFIGURE ${_qt5_module_location_template} _expected_module_location @ONLY)
+
if (Qt5_FIND_REQUIRED_${module})
- set(_Qt5_NOTFOUND_MESSAGE \"${_Qt5_NOTFOUND_MESSAGE}Failed to find Qt5 component \\\"${module}\\\" config file at \\\"${_qt5_install_prefix}/Qt5${module}/Qt5${module}Config.cmake\\\"\\n\")
+ set(_Qt5_NOTFOUND_MESSAGE \"${_Qt5_NOTFOUND_MESSAGE}Failed to find Qt5 component \\\"${module}\\\" config file at \\\"${_expected_module_location}\\\"\\n\")
elseif(NOT Qt5_FIND_QUIETLY)
- message(WARNING \"Failed to find Qt5 component \\\"${module}\\\" config file at \\\"${_qt5_install_prefix}/Qt5${module}/Qt5${module}Config.cmake\\\"\")
+ message(WARNING \"Failed to find Qt5 component \\\"${module}\\\" config file at \\\"${_expected_module_location}\\\"\")
endif()
+
+ unset(_expected_module_location)
endif()
endforeach()
diff --git a/src/corelib/Qt5ModuleLocation.cmake.in b/src/corelib/Qt5ModuleLocation.cmake.in
new file mode 100644
index 0000000000..5065ada56e
--- /dev/null
+++ b/src/corelib/Qt5ModuleLocation.cmake.in
@@ -0,0 +1,15 @@
+!!IF !isEmpty(_QMAKE_SUPER_CACHE_)
+get_filename_component(_qt5_root_dir \"${CMAKE_CURRENT_LIST_DIR}/../../../..\" ABSOLUTE)
+
+file(GLOB qtmodules ${_qt5_root_dir} "${_qt5_root_dir}/*")
+foreach(qtmodule ${qtmodules})
+ if(IS_DIRECTORY ${qtmodule})
+ list(APPEND _qt5_module_paths ${qtmodule})
+ endif()
+endforeach()
+!!ELSE
+set(_qt5_root_dir ${_qt5_install_prefix})
+set(_qt5_module_paths ${_qt5_install_prefix})
+!!ENDIF
+
+set(_qt5_module_location_template ${_qt5_root_dir})
diff --git a/src/corelib/Qt5ModuleLocationForInstall.cmake.in b/src/corelib/Qt5ModuleLocationForInstall.cmake.in
new file mode 100644
index 0000000000..e401b1fe34
--- /dev/null
+++ b/src/corelib/Qt5ModuleLocationForInstall.cmake.in
@@ -0,0 +1,4 @@
+set(_qt5_root_dir ${_qt5_install_prefix})
+set(_qt5_module_paths ${_qt5_install_prefix})
+
+set(_qt5_module_location_template ${_qt5_install_prefix}/Qt5@module@/Qt5@module@Config.cmake)
diff --git a/src/corelib/codecs/codecs.pri b/src/corelib/codecs/codecs.pri
index 4fa778d042..dc8974d13f 100644
--- a/src/corelib/codecs/codecs.pri
+++ b/src/corelib/codecs/codecs.pri
@@ -43,12 +43,8 @@ qtConfig(icu) {
qtConfig(iconv) {
HEADERS += codecs/qiconvcodec_p.h
SOURCES += codecs/qiconvcodec.cpp
- qtConfig(gnu-libiconv) {
- DEFINES += GNU_LIBICONV
+ qtConfig(gnu-libiconv): \
QMAKE_USE_PRIVATE += iconv
- } else: qtConfig(sun-libiconv) {
- DEFINES += GNU_LIBICONV
- }
}
win32 {
diff --git a/src/corelib/codecs/qiconvcodec.cpp b/src/corelib/codecs/qiconvcodec.cpp
index 845155dce0..e4fb359f2c 100644
--- a/src/corelib/codecs/qiconvcodec.cpp
+++ b/src/corelib/codecs/qiconvcodec.cpp
@@ -37,7 +37,9 @@
**
****************************************************************************/
-#ifndef QT_NO_ICONV
+#include <QtCore/private/qglobal_p.h>
+
+QT_REQUIRE_CONFIG(iconv);
#include "qiconvcodec_p.h"
#include "qtextcodec_p.h"
@@ -62,7 +64,7 @@
#elif defined(Q_OS_AIX)
# define NO_BOM
# define UTF16 "UCS-2"
-#elif defined(Q_OS_FREEBSD) || defined(Q_OS_MAC)
+#elif defined(Q_OS_FREEBSD)
# define NO_BOM
# if Q_BYTE_ORDER == Q_BIG_ENDIAN
# define UTF16 "UTF-16BE"
@@ -73,19 +75,6 @@
# define UTF16 "UTF-16"
#endif
-#if defined(Q_OS_MAC)
-#ifndef GNU_LIBICONV
-#define GNU_LIBICONV
-#endif
-typedef iconv_t (*Ptr_iconv_open) (const char*, const char*);
-typedef size_t (*Ptr_iconv) (iconv_t, const char **, size_t *, char **, size_t *);
-typedef int (*Ptr_iconv_close) (iconv_t);
-
-static Ptr_iconv_open ptr_iconv_open = 0;
-static Ptr_iconv ptr_iconv = 0;
-static Ptr_iconv_close ptr_iconv_close = 0;
-#endif
-
QT_BEGIN_NAMESPACE
QIconvCodec::QIconvCodec()
@@ -103,33 +92,6 @@ void QIconvCodec::init() const
fprintf(stderr, "QIconvCodec::convertToUnicode: internal error, UTF-16 codec not found\n");
utf16Codec = reinterpret_cast<QTextCodec *>(~0);
}
-#if defined(Q_OS_MAC)
- if (ptr_iconv_open == 0) {
- QLibrary libiconv(QLatin1String("/usr/lib/libiconv"));
- libiconv.setLoadHints(QLibrary::ExportExternalSymbolsHint);
-
- ptr_iconv_open = reinterpret_cast<Ptr_iconv_open>(libiconv.resolve("libiconv_open"));
- if (!ptr_iconv_open)
- ptr_iconv_open = reinterpret_cast<Ptr_iconv_open>(libiconv.resolve("iconv_open"));
- ptr_iconv = reinterpret_cast<Ptr_iconv>(libiconv.resolve("libiconv"));
- if (!ptr_iconv)
- ptr_iconv = reinterpret_cast<Ptr_iconv>(libiconv.resolve("iconv"));
- ptr_iconv_close = reinterpret_cast<Ptr_iconv_close>(libiconv.resolve("libiconv_close"));
- if (!ptr_iconv_close)
- ptr_iconv_close = reinterpret_cast<Ptr_iconv_close>(libiconv.resolve("iconv_close"));
-
- Q_ASSERT_X(ptr_iconv_open && ptr_iconv && ptr_iconv_close,
- "QIconvCodec::QIconvCodec()",
- "internal error, could not resolve the iconv functions");
-
-# undef iconv_open
-# define iconv_open ptr_iconv_open
-# undef iconv
-# define iconv ptr_iconv
-# undef iconv_close
-# define iconv_close ptr_iconv_close
- }
-#endif
}
QIconvCodec::~QIconvCodec()
@@ -221,7 +183,7 @@ QString QIconvCodec::convertToUnicode(const char* chars, int len, ConverterState
IconvState *state = *pstate;
size_t inBytesLeft = len;
// best case assumption, each byte is converted into one UTF-16 character, plus 2 bytes for the BOM
-#ifdef GNU_LIBICONV
+#if !QT_CONFIG(posix_libiconv)
// GNU doesn't disagree with POSIX :/
const char *inBytes = chars;
#else
@@ -320,7 +282,7 @@ static bool setByteOrder(iconv_t cd)
size_t outBytesLeft = sizeof buf;
size_t inBytesLeft = sizeof bom;
-#if defined(GNU_LIBICONV)
+#if !QT_CONFIG(posix_libiconv)
const char **inBytesPtr = const_cast<const char **>(&inBytes);
#else
char **inBytesPtr = &inBytes;
@@ -342,7 +304,7 @@ QByteArray QIconvCodec::convertFromUnicode(const QChar *uc, int len, ConverterSt
char *outBytes;
size_t inBytesLeft;
-#if defined(GNU_LIBICONV)
+#if !QT_CONFIG(posix_libiconv)
const char **inBytesPtr = const_cast<const char **>(&inBytes);
#else
char **inBytesPtr = &inBytes;
@@ -472,7 +434,7 @@ iconv_t QIconvCodec::createIconv_t(const char *to, const char *from) const
init();
iconv_t cd = (iconv_t) -1;
-#if defined(__GLIBC__) || defined(GNU_LIBICONV) || defined(Q_OS_QNX)
+#if defined(__GLIBC__) || !QT_CONFIG(posix_libiconv) || defined(Q_OS_QNX)
#if defined(Q_OS_QNX)
// on QNX the default locale is UTF-8, and an empty string will cause iconv_open to fail
static const char empty_codeset[] = "UTF-8";
@@ -562,5 +524,3 @@ iconv_t QIconvCodec::createIconv_t(const char *to, const char *from) const
}
QT_END_NAMESPACE
-
-#endif /* #ifndef QT_NO_ICONV */
diff --git a/src/corelib/codecs/qiconvcodec_p.h b/src/corelib/codecs/qiconvcodec_p.h
index 238351bc81..9b8500538b 100644
--- a/src/corelib/codecs/qiconvcodec_p.h
+++ b/src/corelib/codecs/qiconvcodec_p.h
@@ -54,13 +54,9 @@
#include <QtCore/private/qglobal_p.h>
#include "qtextcodec.h"
-#if defined(Q_OS_UNIX) && !defined(QT_NO_ICONV) && !defined(QT_BOOTSTRAPPED)
+QT_REQUIRE_CONFIG(iconv);
-#ifdef Q_OS_MAC
-typedef void * iconv_t;
-#else
#include <iconv.h>
-#endif
QT_BEGIN_NAMESPACE
@@ -100,6 +96,4 @@ public:
QT_END_NAMESPACE
-#endif // Q_OS_UNIX && !QT_NO_ICONV && !QT_BOOTSTRAPPED
-
#endif // QICONVCODEC_P_H
diff --git a/src/corelib/codecs/qsimplecodec_p.h b/src/corelib/codecs/qsimplecodec_p.h
index d268a9f5b8..188c3f3cb4 100644
--- a/src/corelib/codecs/qsimplecodec_p.h
+++ b/src/corelib/codecs/qsimplecodec_p.h
@@ -67,12 +67,12 @@ public:
explicit QSimpleTextCodec(int);
~QSimpleTextCodec();
- QString convertToUnicode(const char *, int, ConverterState *) const;
- QByteArray convertFromUnicode(const QChar *, int, ConverterState *) const;
+ QString convertToUnicode(const char *, int, ConverterState *) const override;
+ QByteArray convertFromUnicode(const QChar *, int, ConverterState *) const override;
- QByteArray name() const;
- QList<QByteArray> aliases() const;
- int mibEnum() const;
+ QByteArray name() const override;
+ QList<QByteArray> aliases() const override;
+ int mibEnum() const override;
private:
int forwardIndex;
diff --git a/src/corelib/codecs/qtextcodec.cpp b/src/corelib/codecs/qtextcodec.cpp
index 5098ac4242..aed3532024 100644
--- a/src/corelib/codecs/qtextcodec.cpp
+++ b/src/corelib/codecs/qtextcodec.cpp
@@ -58,10 +58,10 @@
#if !defined(QT_BOOTSTRAPPED)
# include "qtsciicodec_p.h"
# include "qisciicodec_p.h"
-#if defined(QT_USE_ICU)
+#if QT_CONFIG(icu)
#include "qicucodec_p.h"
#else
-#if !defined(QT_NO_ICONV)
+#if QT_CONFIG(iconv)
# include "qiconvcodec_p.h"
#endif
#ifdef Q_OS_WIN
@@ -79,7 +79,7 @@
# endif // !Q_OS_INTEGRITY
#endif // !QT_NO_BIG_CODECS
-#endif // QT_USE_ICU
+#endif // icu
#endif // QT_BOOTSTRAPPED
#include "qmutex.h"
@@ -99,7 +99,7 @@ typedef QList<QByteArray>::ConstIterator ByteArrayListConstIt;
Q_GLOBAL_STATIC_WITH_ARGS(QMutex, textCodecsMutex, (QMutex::Recursive));
QMutex *qTextCodecsMutex() { return textCodecsMutex(); }
-#if !defined(QT_USE_ICU)
+#if !QT_CONFIG(icu)
static char qtolower(char c)
{ if (c >= 'A' && c <= 'Z') return c + 0x20; return c; }
static bool qisalnum(char c)
@@ -184,7 +184,7 @@ static QTextCodec *setupLocaleMapper()
if (charset)
locale = QTextCodec::codecForName(charset);
#endif
-#if !defined(QT_NO_ICONV) && !defined(QT_BOOTSTRAPPED)
+#if QT_CONFIG(iconv)
if (!locale) {
// no builtin codec for the locale found, let's try using iconv
(void) new QIconvCodec();
@@ -286,7 +286,7 @@ static void setup()
(void)new QBig5Codec;
(void)new QBig5hkscsCodec;
# endif // !QT_NO_BIG_CODECS && !Q_OS_INTEGRITY
-#if !defined(QT_NO_ICONV)
+#if QT_CONFIG(iconv)
(void) new QIconvCodec;
#endif
#if defined(Q_OS_WIN32)
@@ -306,7 +306,7 @@ static void setup()
}
#else
static void setup() {}
-#endif // QT_USE_ICU
+#endif // icu
/*!
\enum QTextCodec::ConversionFlag
@@ -519,7 +519,7 @@ QTextCodec *QTextCodec::codecForName(const QByteArray &name)
return 0;
setup();
-#ifndef QT_USE_ICU
+#if !QT_CONFIG(icu)
QTextCodecCache *cache = &globalData->codecCache;
QTextCodec *codec;
if (cache) {
@@ -586,7 +586,7 @@ QTextCodec* QTextCodec::codecForMib(int mib)
}
}
-#ifdef QT_USE_ICU
+#if QT_CONFIG(icu)
return QIcuCodec::codecForMibUnlocked(mib);
#else
return 0;
@@ -618,7 +618,7 @@ QList<QByteArray> QTextCodec::availableCodecs()
codecs += (*it)->aliases();
}
-#ifdef QT_USE_ICU
+#if QT_CONFIG(icu)
codecs += QIcuCodec::availableCodecs();
#endif
@@ -634,7 +634,7 @@ QList<QByteArray> QTextCodec::availableCodecs()
*/
QList<int> QTextCodec::availableMibs()
{
-#ifdef QT_USE_ICU
+#if QT_CONFIG(icu)
return QIcuCodec::availableMibs();
#else
QMutexLocker locker(textCodecsMutex());
@@ -688,7 +688,7 @@ QTextCodec* QTextCodec::codecForLocale()
QTextCodec *codec = globalData->codecForLocale.loadAcquire();
if (!codec) {
-#ifdef QT_USE_ICU
+#if QT_CONFIG(icu)
textCodecsMutex()->lock();
codec = QIcuCodec::defaultCodecUnlocked();
textCodecsMutex()->unlock();
diff --git a/src/corelib/configure.json b/src/corelib/configure.json
index 02e82d686b..f4162956d3 100644
--- a/src/corelib/configure.json
+++ b/src/corelib/configure.json
@@ -245,21 +245,21 @@
"label": "iconv",
"purpose": "Provides internationalization on Unix.",
"section": "Internationalization",
- "condition": "features.posix-libiconv || features.sun-libiconv || features.gnu-libiconv",
+ "condition": "!features.icu && (features.posix-libiconv || features.sun-libiconv || features.gnu-libiconv)",
"output": [ "privateFeature", "feature" ]
},
"posix-libiconv": {
"label": "POSIX iconv",
"enable": "input.iconv == 'posix'",
"disable": "input.iconv == 'sun' || input.iconv == 'gnu' || input.iconv == 'no'",
- "condition": "!config.win32 && !config.qnx && !config.android && !config.darwin && tests.posix-iconv"
+ "condition": "!config.win32 && !config.qnx && !config.android && !config.darwin && tests.posix-iconv",
+ "output": [ "privateFeature" ]
},
"sun-libiconv": {
"label": "SUN iconv",
"enable": "input.iconv == 'sun'",
"disable": "input.iconv == 'posix' || input.iconv == 'gnu' || input.iconv == 'no'",
- "condition": "!config.win32 && !config.qnx && !config.android && !config.darwin && !features.posix-libiconv && tests.sun-iconv",
- "output": [ "privateFeature", "publicQtConfig" ]
+ "condition": "!config.win32 && !config.qnx && !config.android && !config.darwin && !features.posix-libiconv && tests.sun-iconv"
},
"gnu-libiconv": {
"label": "GNU iconv",
@@ -289,7 +289,7 @@
"label": "journald",
"autoDetect": false,
"condition": "libs.journald",
- "output": [ "privateConfig" ]
+ "output": [ "privateFeature" ]
},
"std-atomic64": {
"label": "64 bit atomic operations",
@@ -355,27 +355,16 @@
"condition": "features.statemachine",
"output": [ "publicFeature" ]
},
- "sharedmemory": {
- "label": "Enable QSharedMemory",
- "condition": "config.android || config.win32 || tests.ipc_sysv || tests.ipc_posix",
- "output": [ { "type": "define", "negative": true, "name": "QT_NO_SHAREDMEMORY" } ]
- },
"slog2": {
"label": "slog2",
"condition": "libs.slog2",
- "emitIf": "config.qnx",
- "output": [ "privateConfig" ]
+ "output": [ "privateFeature" ]
},
"syslog": {
"label": "syslog",
"autoDetect": false,
"condition": "tests.syslog",
- "output": [ "privateConfig" ]
- },
- "systemsemaphore": {
- "label": "Enable QSystemSemaphore",
- "condition": "config.android || config.win32 || tests.ipc_sysv || tests.ipc_posix",
- "output": [ { "type": "define", "negative": true, "name": "QT_NO_SYSTEMSEMAPHORE" } ]
+ "output": [ "privateFeature" ]
},
"threadsafe-cloexec": {
"label": "Threadsafe pipe creation",
@@ -401,12 +390,19 @@
"label": "QSharedMemory",
"purpose": "Provides access to a shared memory segment.",
"section": "Kernel",
+ "condition": [
+ "config.android || config.win32 || (!config.vxworks && (tests.ipc_sysv || tests.ipc_posix))"
+ ],
"output": [ "publicFeature", "feature" ]
},
"systemsemaphore": {
"label": "QSystemSemaphore",
"purpose": "Provides a general counting system semaphore.",
"section": "Kernel",
+ "condition": [
+ "!config.integrity && !config.vxworks",
+ "config.android || config.win32 || tests.ipc_sysv || tests.ipc_posix"
+ ],
"output": [ "publicFeature", "feature" ]
},
"xmlstream": {
@@ -446,6 +442,7 @@
"label": "QProcess",
"purpose": "Supports external process invocation.",
"section": "File I/O",
+ "condition": "!config.winrt && !config.uikit && !config.integrity && !config.vxworks",
"output": [ "publicFeature", "feature" ]
},
"temporaryfile": {
@@ -470,6 +467,7 @@
"label": "QFileSystemWatcher",
"purpose": "Provides an interface for monitoring files and directories for modifications.",
"section": "File I/O",
+ "condition": "!config.winrt",
"output": [ "publicFeature", "feature" ]
},
"filesystemiterator": {
diff --git a/src/corelib/corelib.pro b/src/corelib/corelib.pro
index 616a9641a1..0bd7c9b99d 100644
--- a/src/corelib/corelib.pro
+++ b/src/corelib/corelib.pro
@@ -93,6 +93,12 @@ ctest_macros_file.CONFIG = verbatim
cmake_umbrella_config_file.input = $$PWD/Qt5Config.cmake.in
cmake_umbrella_config_file.output = $$DESTDIR/cmake/Qt5/Qt5Config.cmake
+cmake_umbrella_config_module_location.input = $$PWD/Qt5ModuleLocation.cmake.in
+cmake_umbrella_config_module_location.output = $$DESTDIR/cmake/Qt5/Qt5ModuleLocation.cmake
+
+cmake_umbrella_config_module_location_for_install.input = $$PWD/Qt5ModuleLocationForInstall.cmake.in
+cmake_umbrella_config_module_location_for_install.output = $$DESTDIR/cmake/install/Qt5/Qt5ModuleLocation.cmake
+
cmake_umbrella_config_version_file.input = $$PWD/../../mkspecs/features/data/cmake/Qt5ConfigVersion.cmake.in
cmake_umbrella_config_version_file.output = $$DESTDIR/cmake/Qt5/Qt5ConfigVersion.cmake
@@ -119,10 +125,21 @@ contains(CMAKE_INSTALL_DATA_DIR, "^\\.\\./.*"):!isEmpty(CMAKE_INSTALL_DATA_DIR)
cmake_extras_mkspec_dir_for_install.input = $$PWD/Qt5CoreConfigExtrasMkspecDirForInstall.cmake.in
cmake_extras_mkspec_dir_for_install.output = $$DESTDIR/cmake/install/Qt5Core/Qt5CoreConfigExtrasMkspecDir.cmake
-cmake_qt5_umbrella_module_files.files = $$cmake_umbrella_config_file.output $$cmake_umbrella_config_version_file.output
+cmake_qt5_umbrella_module_files.files = \
+ $$cmake_umbrella_config_file.output \
+ $$cmake_umbrella_config_version_file.output \
+ $$cmake_umbrella_config_module_location_for_install.output
+
cmake_qt5_umbrella_module_files.path = $$[QT_INSTALL_LIBS]/cmake/Qt5
-QMAKE_SUBSTITUTES += ctest_macros_file cmake_umbrella_config_file cmake_umbrella_config_version_file cmake_extras_mkspec_dir cmake_extras_mkspec_dir_for_install
+QMAKE_SUBSTITUTES += \
+ ctest_macros_file \
+ cmake_umbrella_config_file \
+ cmake_umbrella_config_module_location \
+ cmake_umbrella_config_module_location_for_install \
+ cmake_umbrella_config_version_file \
+ cmake_extras_mkspec_dir \
+ cmake_extras_mkspec_dir_for_install
ctest_qt5_module_files.files += $$ctest_macros_file.output $$cmake_extras_mkspec_dir_for_install.output
diff --git a/src/corelib/global/global.pri b/src/corelib/global/global.pri
index bd2e125006..d23706e631 100644
--- a/src/corelib/global/global.pri
+++ b/src/corelib/global/global.pri
@@ -53,19 +53,11 @@ if(linux*|hurd*):!cross_compile:!static:!*-armcc* {
DEFINES += ELF_INTERPRETER=\\\"$$system(LC_ALL=C readelf -l /bin/ls | perl -n -e \'$$prog\')\\\"
}
-slog2 {
+qtConfig(slog2): \
LIBS_PRIVATE += -lslog2
- DEFINES += QT_USE_SLOG2
-}
-journald {
+qtConfig(journald): \
QMAKE_USE_PRIVATE += journald
- DEFINES += QT_USE_JOURNALD
-}
-
-syslog {
- DEFINES += QT_USE_SYSLOG
-}
gcc:ltcg {
versiontagging_compiler.commands = $$QMAKE_CXX -c $(CXXFLAGS) $(INCPATH)
diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h
index 0b2345f8d4..d978c141a4 100644
--- a/src/corelib/global/qcompilerdetection.h
+++ b/src/corelib/global/qcompilerdetection.h
@@ -986,6 +986,9 @@
# define Q_COMPILER_THREADSAFE_STATICS
# define Q_COMPILER_UNIFORM_INIT
# endif
+# if _MSC_VER >= 1910
+# define Q_COMPILER_CONSTEXPR
+# endif
# endif /* __cplusplus */
#endif /* Q_CC_MSVC */
@@ -1270,6 +1273,7 @@
# define QT_WARNING_DISABLE_INTEL(number) __pragma(warning(disable: number))
# define QT_WARNING_DISABLE_CLANG(text)
# define QT_WARNING_DISABLE_GCC(text)
+# define QT_WARNING_DISABLE_DEPRECATED QT_WARNING_DISABLE_INTEL(1786)
#elif defined(Q_CC_INTEL)
/* icc: Intel compiler on Linux or OS X */
# define QT_WARNING_PUSH QT_DO_PRAGMA(warning(push))
@@ -1278,6 +1282,7 @@
# define QT_WARNING_DISABLE_MSVC(number)
# define QT_WARNING_DISABLE_CLANG(text)
# define QT_WARNING_DISABLE_GCC(text)
+# define QT_WARNING_DISABLE_DEPRECATED QT_WARNING_DISABLE_INTEL(1786)
#elif defined(Q_CC_MSVC) && _MSC_VER >= 1500 && !defined(Q_CC_CLANG)
# undef QT_DO_PRAGMA /* not needed */
# define QT_WARNING_PUSH __pragma(warning(push))
@@ -1286,6 +1291,7 @@
# define QT_WARNING_DISABLE_INTEL(number)
# define QT_WARNING_DISABLE_CLANG(text)
# define QT_WARNING_DISABLE_GCC(text)
+# define QT_WARNING_DISABLE_DEPRECATED QT_WARNING_DISABLE_MSVC(4996)
#elif defined(Q_CC_CLANG)
# define QT_WARNING_PUSH QT_DO_PRAGMA(clang diagnostic push)
# define QT_WARNING_POP QT_DO_PRAGMA(clang diagnostic pop)
@@ -1293,6 +1299,7 @@
# define QT_WARNING_DISABLE_GCC(text)
# define QT_WARNING_DISABLE_INTEL(number)
# define QT_WARNING_DISABLE_MSVC(number)
+# define QT_WARNING_DISABLE_DEPRECATED QT_WARNING_DISABLE_CLANG("-Wdeprecated-declarations")
#elif defined(Q_CC_GNU) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 406)
# define QT_WARNING_PUSH QT_DO_PRAGMA(GCC diagnostic push)
# define QT_WARNING_POP QT_DO_PRAGMA(GCC diagnostic pop)
@@ -1300,6 +1307,7 @@
# define QT_WARNING_DISABLE_CLANG(text)
# define QT_WARNING_DISABLE_INTEL(number)
# define QT_WARNING_DISABLE_MSVC(number)
+# define QT_WARNING_DISABLE_DEPRECATED QT_WARNING_DISABLE_GCC("-Wdeprecated-declarations")
#else // All other compilers, GCC < 4.6 and MSVC < 2008
# define QT_WARNING_DISABLE_GCC(text)
# define QT_WARNING_PUSH
@@ -1308,6 +1316,7 @@
# define QT_WARNING_DISABLE_MSVC(number)
# define QT_WARNING_DISABLE_CLANG(text)
# define QT_WARNING_DISABLE_GCC(text)
+# define QT_WARNING_DISABLE_DEPRECATED
#endif
/*
diff --git a/src/corelib/global/qconfig-bootstrapped.h b/src/corelib/global/qconfig-bootstrapped.h
index 3b86e94cdd..d0e45478cc 100644
--- a/src/corelib/global/qconfig-bootstrapped.h
+++ b/src/corelib/global/qconfig-bootstrapped.h
@@ -68,10 +68,15 @@
#define QT_CRYPTOGRAPHICHASH_ONLY_SHA1
#define QT_NO_DATASTREAM
+#define QT_FEATURE_iconv -1
+#define QT_FEATURE_icu -1
+#define QT_FEATURE_journald -1
#define QT_NO_LIBRARY
#define QT_FEATURE_library -1
#define QT_NO_QOBJECT
#define QT_NO_SYSTEMLOCALE
+#define QT_FEATURE_slog2 -1
+#define QT_FEATURE_syslog -1
#define QT_NO_THREAD
#define QT_FEATURE_timezone -1
#define QT_FEATURE_topleveldomain -1
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index e6eee5a1d2..47aca712b7 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -1248,6 +1248,12 @@ bool qSharedBuild() Q_DECL_NOTHROW
\value MV_TVOS_9_2 tvOS 9.2
\value MV_TVOS_10_0 tvOS 10.0
+ \value MV_WATCHOS watchOS (any)
+ \value MV_WATCHOS_2_0 watchOS 2.0
+ \value MV_WATCHOS_2_1 watchOS 2.1
+ \value MV_WATCHOS_2_2 watchOS 2.2
+ \value MV_WATCHOS_3_0 watchOS 3.0
+
\value MV_None Not a Darwin operating system
\sa WinVersion
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index f64ab143ef..4354c85bfe 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -621,32 +621,6 @@ private:
class QDataStream;
-#if defined(Q_OS_VXWORKS)
-# define QT_NO_CRASHHANDLER // no popen
-# define QT_NO_PROCESS // no exec*, no fork
-# define QT_NO_SHAREDMEMORY // only POSIX, no SysV and in the end...
-# define QT_NO_SYSTEMSEMAPHORE // not needed at all in a flat address space
-#endif
-
-#if defined(Q_OS_WINRT)
-# define QT_NO_FILESYSTEMWATCHER
-# define QT_NO_NETWORKPROXY
-# define QT_NO_PROCESS
-# define QT_NO_SOCKETNOTIFIER
-# define QT_NO_SOCKS5
-#endif
-
-#if defined(QT_PLATFORM_UIKIT)
-# define QT_NO_PROCESS
-#endif
-
-#if defined(Q_OS_INTEGRITY)
-# define QT_NO_CRASHHANDLER // no popen
-# define QT_NO_PROCESS // no exec*, no fork
-# define QT_NO_SYSTEMSEMAPHORE // not needed at all in a single AddressSpace
-# define QT_NO_MULTIPROCESS // no system
-#endif
-
inline void qt_noop(void) {}
/* These wrap try/catch so we can switch off exceptions later.
diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp
index 1469f5776b..27fe10a79e 100644
--- a/src/corelib/global/qlibraryinfo.cpp
+++ b/src/corelib/global/qlibraryinfo.cpp
@@ -318,8 +318,10 @@ QLibraryInfo::buildDate()
# define COMPILER_STRING "MSVC 2012"
# elif _MSC_VER < 1900
# define COMPILER_STRING "MSVC 2013"
-# elif _MSC_VER < 2000
+# elif _MSC_VER < 1910
# define COMPILER_STRING "MSVC 2015"
+# elif _MSC_VER < 2000
+# define COMPILER_STRING "MSVC 2017"
# else
# define COMPILER_STRING "MSVC _MSC_VER " QT_STRINGIFY(_MSC_VER)
# endif
diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp
index 0ca6829564..0506d372b6 100644
--- a/src/corelib/global/qlogging.cpp
+++ b/src/corelib/global/qlogging.cpp
@@ -39,6 +39,7 @@
**
****************************************************************************/
+#include "qglobal_p.h"
#include "qlogging.h"
#include "qlist.h"
#include "qbytearray.h"
@@ -59,7 +60,7 @@
#ifdef Q_OS_WIN
#include <qt_windows.h>
#endif
-#ifdef QT_USE_SLOG2
+#if QT_CONFIG(slog2)
#include <slog2.h>
#endif
@@ -67,12 +68,12 @@
#include <android/log.h>
#endif
-#if defined(QT_USE_JOURNALD) && !defined(QT_BOOTSTRAPPED)
+#if QT_CONFIG(journald)
# define SD_JOURNAL_SUPPRESS_LOCATION
# include <systemd/sd-journal.h>
# include <syslog.h>
#endif
-#if defined(QT_USE_SYSLOG) && !defined(QT_BOOTSTRAPPED)
+#if QT_CONFIG(syslog)
# include <syslog.h>
#endif
#ifdef Q_OS_UNIX
@@ -93,7 +94,7 @@
# endif
#endif
-#if defined(QT_USE_SLOG2)
+#if QT_CONFIG(slog2)
extern char *__progname;
#endif
@@ -1281,7 +1282,7 @@ static QString formatBacktraceForLogMessage(const QMessagePattern::BacktracePara
}
#endif // QLOGGING_HAVE_BACKTRACE && !QT_BOOTSTRAPPED
-#if defined(QT_USE_SLOG2)
+#if QT_CONFIG(slog2)
#ifndef QT_LOG_CODE
#define QT_LOG_CODE 9000
#endif
@@ -1330,7 +1331,7 @@ static void slog2_default_handler(QtMsgType msgType, const char *message)
//writes to the slog2 buffer
slog2c(NULL, QT_LOG_CODE, severity, message);
}
-#endif // QT_USE_SLOG2
+#endif // slog2
Q_GLOBAL_STATIC(QMessagePattern, qMessagePattern)
@@ -1479,7 +1480,7 @@ static QBasicAtomicPointer<void (QtMsgType, const char*)> msgHandler = Q_BASIC_A
// pointer to QtMessageHandler debug handler (with context)
static QBasicAtomicPointer<void (QtMsgType, const QMessageLogContext &, const QString &)> messageHandler = Q_BASIC_ATOMIC_INITIALIZER(qDefaultMessageHandler);
-#if defined(QT_USE_JOURNALD) && !defined(QT_BOOTSTRAPPED)
+#if QT_CONFIG(journald)
static void systemd_default_message_handler(QtMsgType type,
const QMessageLogContext &context,
const QString &message)
@@ -1513,7 +1514,7 @@ static void systemd_default_message_handler(QtMsgType type,
}
#endif
-#ifdef QT_USE_SYSLOG
+#if QT_CONFIG(syslog)
static void syslog_default_message_handler(QtMsgType type, const char *message)
{
int priority = LOG_INFO; // Informational
@@ -1577,14 +1578,14 @@ static void qDefaultMessageHandler(QtMsgType type, const QMessageLogContext &con
logMessage.append(QLatin1Char('\n'));
OutputDebugString(reinterpret_cast<const wchar_t *>(logMessage.utf16()));
return;
-#elif defined(QT_USE_SLOG2)
+#elif QT_CONFIG(slog2)
logMessage.append(QLatin1Char('\n'));
slog2_default_handler(type, logMessage.toLocal8Bit().constData());
return;
-#elif defined(QT_USE_JOURNALD) && !defined(QT_BOOTSTRAPPED)
+#elif QT_CONFIG(journald)
systemd_default_message_handler(type, context, logMessage);
return;
-#elif defined(QT_USE_SYSLOG) && !defined(QT_BOOTSTRAPPED)
+#elif QT_CONFIG(syslog)
syslog_default_message_handler(type, logMessage.toUtf8().constData());
return;
#elif defined(Q_OS_ANDROID)
@@ -1779,7 +1780,7 @@ void qErrnoWarning(int code, const char *msg, ...)
\snippet code/src_corelib_global_qglobal.cpp 23
- \sa QtMessageHandler, QtMsgType, qDebug(), qWarning(), qCritical(), qFatal(),
+ \sa QtMessageHandler, QtMsgType, qDebug(), qInfo(), qWarning(), qCritical(), qFatal(),
{Debugging Techniques}
*/
diff --git a/src/corelib/io/PSL-LICENSE.txt b/src/corelib/io/PSL-LICENSE.txt
new file mode 100644
index 0000000000..d0a1fa1482
--- /dev/null
+++ b/src/corelib/io/PSL-LICENSE.txt
@@ -0,0 +1,373 @@
+Mozilla Public License Version 2.0
+==================================
+
+1. Definitions
+--------------
+
+1.1. "Contributor"
+ means each individual or legal entity that creates, contributes to
+ the creation of, or owns Covered Software.
+
+1.2. "Contributor Version"
+ means the combination of the Contributions of others (if any) used
+ by a Contributor and that particular Contributor's Contribution.
+
+1.3. "Contribution"
+ means Covered Software of a particular Contributor.
+
+1.4. "Covered Software"
+ means Source Code Form to which the initial Contributor has attached
+ the notice in Exhibit A, the Executable Form of such Source Code
+ Form, and Modifications of such Source Code Form, in each case
+ including portions thereof.
+
+1.5. "Incompatible With Secondary Licenses"
+ means
+
+ (a) that the initial Contributor has attached the notice described
+ in Exhibit B to the Covered Software; or
+
+ (b) that the Covered Software was made available under the terms of
+ version 1.1 or earlier of the License, but not also under the
+ terms of a Secondary License.
+
+1.6. "Executable Form"
+ means any form of the work other than Source Code Form.
+
+1.7. "Larger Work"
+ means a work that combines Covered Software with other material, in
+ a separate file or files, that is not Covered Software.
+
+1.8. "License"
+ means this document.
+
+1.9. "Licensable"
+ means having the right to grant, to the maximum extent possible,
+ whether at the time of the initial grant or subsequently, any and
+ all of the rights conveyed by this License.
+
+1.10. "Modifications"
+ means any of the following:
+
+ (a) any file in Source Code Form that results from an addition to,
+ deletion from, or modification of the contents of Covered
+ Software; or
+
+ (b) any new file in Source Code Form that contains any Covered
+ Software.
+
+1.11. "Patent Claims" of a Contributor
+ means any patent claim(s), including without limitation, method,
+ process, and apparatus claims, in any patent Licensable by such
+ Contributor that would be infringed, but for the grant of the
+ License, by the making, using, selling, offering for sale, having
+ made, import, or transfer of either its Contributions or its
+ Contributor Version.
+
+1.12. "Secondary License"
+ means either the GNU General Public License, Version 2.0, the GNU
+ Lesser General Public License, Version 2.1, the GNU Affero General
+ Public License, Version 3.0, or any later versions of those
+ licenses.
+
+1.13. "Source Code Form"
+ means the form of the work preferred for making modifications.
+
+1.14. "You" (or "Your")
+ means an individual or a legal entity exercising rights under this
+ License. For legal entities, "You" includes any entity that
+ controls, is controlled by, or is under common control with You. For
+ purposes of this definition, "control" means (a) the power, direct
+ or indirect, to cause the direction or management of such entity,
+ whether by contract or otherwise, or (b) ownership of more than
+ fifty percent (50%) of the outstanding shares or beneficial
+ ownership of such entity.
+
+2. License Grants and Conditions
+--------------------------------
+
+2.1. Grants
+
+Each Contributor hereby grants You a world-wide, royalty-free,
+non-exclusive license:
+
+(a) under intellectual property rights (other than patent or trademark)
+ Licensable by such Contributor to use, reproduce, make available,
+ modify, display, perform, distribute, and otherwise exploit its
+ Contributions, either on an unmodified basis, with Modifications, or
+ as part of a Larger Work; and
+
+(b) under Patent Claims of such Contributor to make, use, sell, offer
+ for sale, have made, import, and otherwise transfer either its
+ Contributions or its Contributor Version.
+
+2.2. Effective Date
+
+The licenses granted in Section 2.1 with respect to any Contribution
+become effective for each Contribution on the date the Contributor first
+distributes such Contribution.
+
+2.3. Limitations on Grant Scope
+
+The licenses granted in this Section 2 are the only rights granted under
+this License. No additional rights or licenses will be implied from the
+distribution or licensing of Covered Software under this License.
+Notwithstanding Section 2.1(b) above, no patent license is granted by a
+Contributor:
+
+(a) for any code that a Contributor has removed from Covered Software;
+ or
+
+(b) for infringements caused by: (i) Your and any other third party's
+ modifications of Covered Software, or (ii) the combination of its
+ Contributions with other software (except as part of its Contributor
+ Version); or
+
+(c) under Patent Claims infringed by Covered Software in the absence of
+ its Contributions.
+
+This License does not grant any rights in the trademarks, service marks,
+or logos of any Contributor (except as may be necessary to comply with
+the notice requirements in Section 3.4).
+
+2.4. Subsequent Licenses
+
+No Contributor makes additional grants as a result of Your choice to
+distribute the Covered Software under a subsequent version of this
+License (see Section 10.2) or under the terms of a Secondary License (if
+permitted under the terms of Section 3.3).
+
+2.5. Representation
+
+Each Contributor represents that the Contributor believes its
+Contributions are its original creation(s) or it has sufficient rights
+to grant the rights to its Contributions conveyed by this License.
+
+2.6. Fair Use
+
+This License is not intended to limit any rights You have under
+applicable copyright doctrines of fair use, fair dealing, or other
+equivalents.
+
+2.7. Conditions
+
+Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
+in Section 2.1.
+
+3. Responsibilities
+-------------------
+
+3.1. Distribution of Source Form
+
+All distribution of Covered Software in Source Code Form, including any
+Modifications that You create or to which You contribute, must be under
+the terms of this License. You must inform recipients that the Source
+Code Form of the Covered Software is governed by the terms of this
+License, and how they can obtain a copy of this License. You may not
+attempt to alter or restrict the recipients' rights in the Source Code
+Form.
+
+3.2. Distribution of Executable Form
+
+If You distribute Covered Software in Executable Form then:
+
+(a) such Covered Software must also be made available in Source Code
+ Form, as described in Section 3.1, and You must inform recipients of
+ the Executable Form how they can obtain a copy of such Source Code
+ Form by reasonable means in a timely manner, at a charge no more
+ than the cost of distribution to the recipient; and
+
+(b) You may distribute such Executable Form under the terms of this
+ License, or sublicense it under different terms, provided that the
+ license for the Executable Form does not attempt to limit or alter
+ the recipients' rights in the Source Code Form under this License.
+
+3.3. Distribution of a Larger Work
+
+You may create and distribute a Larger Work under terms of Your choice,
+provided that You also comply with the requirements of this License for
+the Covered Software. If the Larger Work is a combination of Covered
+Software with a work governed by one or more Secondary Licenses, and the
+Covered Software is not Incompatible With Secondary Licenses, this
+License permits You to additionally distribute such Covered Software
+under the terms of such Secondary License(s), so that the recipient of
+the Larger Work may, at their option, further distribute the Covered
+Software under the terms of either this License or such Secondary
+License(s).
+
+3.4. Notices
+
+You may not remove or alter the substance of any license notices
+(including copyright notices, patent notices, disclaimers of warranty,
+or limitations of liability) contained within the Source Code Form of
+the Covered Software, except that You may alter any license notices to
+the extent required to remedy known factual inaccuracies.
+
+3.5. Application of Additional Terms
+
+You may choose to offer, and to charge a fee for, warranty, support,
+indemnity or liability obligations to one or more recipients of Covered
+Software. However, You may do so only on Your own behalf, and not on
+behalf of any Contributor. You must make it absolutely clear that any
+such warranty, support, indemnity, or liability obligation is offered by
+You alone, and You hereby agree to indemnify every Contributor for any
+liability incurred by such Contributor as a result of warranty, support,
+indemnity or liability terms You offer. You may include additional
+disclaimers of warranty and limitations of liability specific to any
+jurisdiction.
+
+4. Inability to Comply Due to Statute or Regulation
+---------------------------------------------------
+
+If it is impossible for You to comply with any of the terms of this
+License with respect to some or all of the Covered Software due to
+statute, judicial order, or regulation then You must: (a) comply with
+the terms of this License to the maximum extent possible; and (b)
+describe the limitations and the code they affect. Such description must
+be placed in a text file included with all distributions of the Covered
+Software under this License. Except to the extent prohibited by statute
+or regulation, such description must be sufficiently detailed for a
+recipient of ordinary skill to be able to understand it.
+
+5. Termination
+--------------
+
+5.1. The rights granted under this License will terminate automatically
+if You fail to comply with any of its terms. However, if You become
+compliant, then the rights granted under this License from a particular
+Contributor are reinstated (a) provisionally, unless and until such
+Contributor explicitly and finally terminates Your grants, and (b) on an
+ongoing basis, if such Contributor fails to notify You of the
+non-compliance by some reasonable means prior to 60 days after You have
+come back into compliance. Moreover, Your grants from a particular
+Contributor are reinstated on an ongoing basis if such Contributor
+notifies You of the non-compliance by some reasonable means, this is the
+first time You have received notice of non-compliance with this License
+from such Contributor, and You become compliant prior to 30 days after
+Your receipt of the notice.
+
+5.2. If You initiate litigation against any entity by asserting a patent
+infringement claim (excluding declaratory judgment actions,
+counter-claims, and cross-claims) alleging that a Contributor Version
+directly or indirectly infringes any patent, then the rights granted to
+You by any and all Contributors for the Covered Software under Section
+2.1 of this License shall terminate.
+
+5.3. In the event of termination under Sections 5.1 or 5.2 above, all
+end user license agreements (excluding distributors and resellers) which
+have been validly granted by You or Your distributors under this License
+prior to termination shall survive termination.
+
+************************************************************************
+* *
+* 6. Disclaimer of Warranty *
+* ------------------------- *
+* *
+* Covered Software is provided under this License on an "as is" *
+* basis, without warranty of any kind, either expressed, implied, or *
+* statutory, including, without limitation, warranties that the *
+* Covered Software is free of defects, merchantable, fit for a *
+* particular purpose or non-infringing. The entire risk as to the *
+* quality and performance of the Covered Software is with You. *
+* Should any Covered Software prove defective in any respect, You *
+* (not any Contributor) assume the cost of any necessary servicing, *
+* repair, or correction. This disclaimer of warranty constitutes an *
+* essential part of this License. No use of any Covered Software is *
+* authorized under this License except under this disclaimer. *
+* *
+************************************************************************
+
+************************************************************************
+* *
+* 7. Limitation of Liability *
+* -------------------------- *
+* *
+* Under no circumstances and under no legal theory, whether tort *
+* (including negligence), contract, or otherwise, shall any *
+* Contributor, or anyone who distributes Covered Software as *
+* permitted above, be liable to You for any direct, indirect, *
+* special, incidental, or consequential damages of any character *
+* including, without limitation, damages for lost profits, loss of *
+* goodwill, work stoppage, computer failure or malfunction, or any *
+* and all other commercial damages or losses, even if such party *
+* shall have been informed of the possibility of such damages. This *
+* limitation of liability shall not apply to liability for death or *
+* personal injury resulting from such party's negligence to the *
+* extent applicable law prohibits such limitation. Some *
+* jurisdictions do not allow the exclusion or limitation of *
+* incidental or consequential damages, so this exclusion and *
+* limitation may not apply to You. *
+* *
+************************************************************************
+
+8. Litigation
+-------------
+
+Any litigation relating to this License may be brought only in the
+courts of a jurisdiction where the defendant maintains its principal
+place of business and such litigation shall be governed by laws of that
+jurisdiction, without reference to its conflict-of-law provisions.
+Nothing in this Section shall prevent a party's ability to bring
+cross-claims or counter-claims.
+
+9. Miscellaneous
+----------------
+
+This License represents the complete agreement concerning the subject
+matter hereof. If any provision of this License is held to be
+unenforceable, such provision shall be reformed only to the extent
+necessary to make it enforceable. Any law or regulation which provides
+that the language of a contract shall be construed against the drafter
+shall not be used to construe this License against a Contributor.
+
+10. Versions of the License
+---------------------------
+
+10.1. New Versions
+
+Mozilla Foundation is the license steward. Except as provided in Section
+10.3, no one other than the license steward has the right to modify or
+publish new versions of this License. Each version will be given a
+distinguishing version number.
+
+10.2. Effect of New Versions
+
+You may distribute the Covered Software under the terms of the version
+of the License under which You originally received the Covered Software,
+or under the terms of any subsequent version published by the license
+steward.
+
+10.3. Modified Versions
+
+If you create software not governed by this License, and you want to
+create a new license for such software, you may create and use a
+modified version of this License if you rename the license and remove
+any references to the name of the license steward (except to note that
+such modified license differs from this License).
+
+10.4. Distributing Source Code Form that is Incompatible With Secondary
+Licenses
+
+If You choose to distribute Source Code Form that is Incompatible With
+Secondary Licenses under the terms of this version of the License, the
+notice described in Exhibit B of this License must be attached.
+
+Exhibit A - Source Code Form License Notice
+-------------------------------------------
+
+ This Source Code Form is subject to the terms of the Mozilla Public
+ License, v. 2.0. If a copy of the MPL was not distributed with this
+ file, You can obtain one at https://mozilla.org/MPL/2.0/.
+
+If it is not possible or desirable to put the notice in a particular
+file, then You may include the notice in a location (such as a LICENSE
+file in a relevant directory) where a recipient would be likely to look
+for such a notice.
+
+You may add additional accurate notices of copyright ownership.
+
+Exhibit B - "Incompatible With Secondary Licenses" Notice
+---------------------------------------------------------
+
+ This Source Code Form is "Incompatible With Secondary Licenses", as
+ defined by the Mozilla Public License, v. 2.0.
diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp
index 91953ebf26..437f774547 100644
--- a/src/corelib/io/qdir.cpp
+++ b/src/corelib/io/qdir.cpp
@@ -80,6 +80,40 @@ static QString driveSpec(const QString &path)
}
#endif
+enum {
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+ OSSupportsUncPaths = true
+#else
+ OSSupportsUncPaths = false
+#endif
+};
+
+// Return the length of the root part of an absolute path, for use by cleanPath(), cd().
+static int rootLength(const QString &name, bool allowUncPaths)
+{
+ const int len = name.length();
+ // starts with double slash
+ if (allowUncPaths && name.startsWith(QLatin1String("//"))) {
+ // Server name '//server/path' is part of the prefix.
+ const int nextSlash = name.indexOf(QLatin1Char('/'), 2);
+ return nextSlash >= 0 ? nextSlash + 1 : len;
+ }
+#if defined(Q_OS_WINRT)
+ const QString rootPath = QDir::rootPath(); // rootPath contains the trailing slash
+ if (name.startsWith(rootPath, Qt::CaseInsensitive))
+ return rootPath.size();
+#endif // Q_OS_WINRT
+#if defined(Q_OS_WIN)
+ if (len >= 2 && name.at(1) == QLatin1Char(':')) {
+ // Handle a possible drive letter
+ return len > 2 && name.at(2) == QLatin1Char('/') ? 3 : 2;
+ }
+#endif
+ if (name.at(0) == QLatin1Char('/'))
+ return 1;
+ return 0;
+}
+
//************* QDirPrivate
QDirPrivate::QDirPrivate(const QString &path, const QStringList &nameFilters_, QDir::SortFlags sort_, QDir::Filters filters_)
: QSharedData()
@@ -859,6 +893,8 @@ QString QDir::fromNativeSeparators(const QString &pathName)
return pathName;
}
+static QString qt_cleanPath(const QString &path, bool *ok = nullptr);
+
/*!
Changes the QDir's directory to \a dirName.
@@ -879,32 +915,18 @@ bool QDir::cd(const QString &dirName)
return true;
QString newPath;
if (isAbsolutePath(dirName)) {
- newPath = cleanPath(dirName);
+ newPath = qt_cleanPath(dirName);
} else {
- if (isRoot())
- newPath = d->dirEntry.filePath();
- else
- newPath = d->dirEntry.filePath() % QLatin1Char('/');
+ newPath = d->dirEntry.filePath();
+ if (!newPath.endsWith(QLatin1Char('/')))
+ newPath += QLatin1Char('/');
newPath += dirName;
if (dirName.indexOf(QLatin1Char('/')) >= 0
|| dirName == QLatin1String("..")
|| d->dirEntry.filePath() == QLatin1String(".")) {
- newPath = cleanPath(newPath);
-#if defined (Q_OS_UNIX)
- //After cleanPath() if path is "/.." or starts with "/../" it means trying to cd above root.
- if (newPath.startsWith(QLatin1String("/../")) || newPath == QLatin1String("/.."))
-#elif defined (Q_OS_WINRT)
- const QString rootPath = QDir::rootPath();
- if (newPath.size() < rootPath.size() && rootPath.startsWith(newPath))
-#else
- /*
- cleanPath() already took care of replacing '\' with '/'.
- We can't use startsWith here because the letter of the drive is unknown.
- After cleanPath() if path is "[A-Z]:/.." or starts with "[A-Z]:/../" it means trying to cd above root.
- */
-
- if (newPath.midRef(1, 4) == QLatin1String(":/..") && (newPath.length() == 5 || newPath.at(5) == QLatin1Char('/')))
-#endif
+ bool ok;
+ newPath = qt_cleanPath(newPath, &ok);
+ if (!ok)
return false;
/*
If newPath starts with .., we convert it to absolute to
@@ -2051,10 +2073,14 @@ bool QDir::match(const QString &filter, const QString &fileName)
This method is shared with QUrl, so it doesn't deal with QDir::separator(),
nor does it remove the trailing slash, if any.
*/
-Q_AUTOTEST_EXPORT QString qt_normalizePathSegments(const QString &name, bool allowUncPaths)
+Q_AUTOTEST_EXPORT QString qt_normalizePathSegments(const QString &name, bool allowUncPaths,
+ bool *ok = nullptr)
{
const int len = name.length();
+ if (ok)
+ *ok = false;
+
if (len == 0)
return name;
@@ -2066,19 +2092,7 @@ Q_AUTOTEST_EXPORT QString qt_normalizePathSegments(const QString &name, bool all
const QChar *prefix = p;
int up = 0;
- int prefixLength = 0;
-
- if (allowUncPaths && len >= 2 && p[1].unicode() == '/' && p[0].unicode() == '/') {
- // starts with double slash
- prefixLength = 2;
-#ifdef Q_OS_WIN
- } else if (len >= 2 && p[1].unicode() == ':') {
- // remember the drive letter
- prefixLength = (len > 2 && p[2].unicode() == '/') ? 3 : 2;
-#endif
- } else if (p[0].unicode() == '/') {
- prefixLength = 1;
- }
+ const int prefixLength = rootLength(name, allowUncPaths);
p += prefixLength;
i -= prefixLength;
@@ -2131,6 +2145,10 @@ Q_AUTOTEST_EXPORT QString qt_normalizePathSegments(const QString &name, bool all
--up;
}
+ // Indicate failure when ".." are left over for an absolute path.
+ if (ok)
+ *ok = prefixLength == 0 || up == 0;
+
// add remaining '..'
while (up) {
if (used != len && out[used].unicode() != '/') // is not empty and there isn't already a '/'
@@ -2168,32 +2186,16 @@ Q_AUTOTEST_EXPORT QString qt_normalizePathSegments(const QString &name, bool all
return ret;
}
-/*!
- Returns \a path with directory separators normalized (converted to "/") and
- redundant ones removed, and "."s and ".."s resolved (as far as possible).
-
- Symbolic links are kept. This function does not return the
- canonical path, but rather the simplest version of the input.
- For example, "./local" becomes "local", "local/../bin" becomes
- "bin" and "/local/usr/../bin" becomes "/local/bin".
-
- \sa absolutePath(), canonicalPath()
-*/
-QString QDir::cleanPath(const QString &path)
+static QString qt_cleanPath(const QString &path, bool *ok)
{
if (path.isEmpty())
return path;
QString name = path;
- QChar dir_separator = separator();
+ QChar dir_separator = QDir::separator();
if (dir_separator != QLatin1Char('/'))
name.replace(dir_separator, QLatin1Char('/'));
- bool allowUncPaths = false;
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) //allow unc paths
- allowUncPaths = true;
-#endif
-
- QString ret = qt_normalizePathSegments(name, allowUncPaths);
+ QString ret = qt_normalizePathSegments(name, OSSupportsUncPaths, ok);
// Strip away last slash except for root directories
if (ret.length() > 1 && ret.endsWith(QLatin1Char('/'))) {
@@ -2211,6 +2213,22 @@ QString QDir::cleanPath(const QString &path)
}
/*!
+ Returns \a path with directory separators normalized (converted to "/") and
+ redundant ones removed, and "."s and ".."s resolved (as far as possible).
+
+ Symbolic links are kept. This function does not return the
+ canonical path, but rather the simplest version of the input.
+ For example, "./local" becomes "local", "local/../bin" becomes
+ "bin" and "/local/usr/../bin" becomes "/local/bin".
+
+ \sa absolutePath(), canonicalPath()
+*/
+QString QDir::cleanPath(const QString &path)
+{
+ return qt_cleanPath(path);
+}
+
+/*!
Returns \c true if \a path is relative; returns \c false if it is
absolute.
diff --git a/src/corelib/io/qfile_p.h b/src/corelib/io/qfile_p.h
index fd7db3c120..545890c6b3 100644
--- a/src/corelib/io/qfile_p.h
+++ b/src/corelib/io/qfile_p.h
@@ -70,7 +70,7 @@ protected:
bool openExternalFile(int flags, int fd, QFile::FileHandleFlags handleFlags);
bool openExternalFile(int flags, FILE *fh, QFile::FileHandleFlags handleFlags);
- virtual QAbstractFileEngine *engine() const;
+ QAbstractFileEngine *engine() const override;
QString fileName;
};
diff --git a/src/corelib/io/qfilesystemengine_unix.cpp b/src/corelib/io/qfilesystemengine_unix.cpp
index 5de85f9811..1b908eac55 100644
--- a/src/corelib/io/qfilesystemengine_unix.cpp
+++ b/src/corelib/io/qfilesystemengine_unix.cpp
@@ -65,6 +65,13 @@
#include <MobileCoreServices/MobileCoreServices.h>
#endif
+#if defined(Q_OS_DARWIN)
+// We cannot include <Foundation/Foundation.h> (it's an Objective-C header), but
+// we need these declarations:
+Q_FORWARD_DECLARE_OBJC_CLASS(NSString);
+extern "C" NSString *NSTemporaryDirectory();
+#endif
+
QT_BEGIN_NAMESPACE
#if defined(Q_OS_DARWIN)
@@ -703,8 +710,17 @@ QString QFileSystemEngine::tempPath()
return QLatin1String(QT_UNIX_TEMP_PATH_OVERRIDE);
#else
QString temp = QFile::decodeName(qgetenv("TMPDIR"));
- if (temp.isEmpty())
- temp = QLatin1String("/tmp");
+ if (temp.isEmpty()) {
+#if defined(Q_OS_DARWIN) && !defined(QT_BOOTSTRAPPED)
+ if (NSString *nsPath = NSTemporaryDirectory()) {
+ temp = QString::fromCFString((CFStringRef)nsPath);
+ } else {
+#else
+ {
+#endif
+ temp = QLatin1String("/tmp");
+ }
+ }
return QDir::cleanPath(temp);
#endif
}
diff --git a/src/corelib/io/qresource.cpp b/src/corelib/io/qresource.cpp
index 7fe3753da4..febf22639c 100644
--- a/src/corelib/io/qresource.cpp
+++ b/src/corelib/io/qresource.cpp
@@ -49,6 +49,7 @@
#include "qdatetime.h"
#include "qbytearray.h"
#include "qstringlist.h"
+#include "qendian.h"
#include <qshareddata.h>
#include <qplatformdefs.h>
#include "private/qabstractfileengine_p.h"
@@ -101,35 +102,38 @@ class QResourceRoot
Directory = 0x02
};
const uchar *tree, *names, *payloads;
- inline int findOffset(int node) const { return node * 14; } //sizeof each tree element
+ int version;
+ inline int findOffset(int node) const { return node * (14 + (version >= 0x02 ? 8 : 0)); } //sizeof each tree element
uint hash(int node) const;
QString name(int node) const;
short flags(int node) const;
public:
mutable QAtomicInt ref;
- inline QResourceRoot(): tree(0), names(0), payloads(0) {}
- inline QResourceRoot(const uchar *t, const uchar *n, const uchar *d) { setSource(t, n, d); }
+ inline QResourceRoot(): tree(0), names(0), payloads(0), version(0) {}
+ inline QResourceRoot(int version, const uchar *t, const uchar *n, const uchar *d) { setSource(version, t, n, d); }
virtual ~QResourceRoot() { }
int findNode(const QString &path, const QLocale &locale=QLocale()) const;
inline bool isContainer(int node) const { return flags(node) & Directory; }
inline bool isCompressed(int node) const { return flags(node) & Compressed; }
const uchar *data(int node, qint64 *size) const;
+ QDateTime lastModified(int node) const;
QStringList children(int node) const;
virtual QString mappingRoot() const { return QString(); }
bool mappingRootSubdir(const QString &path, QString *match=0) const;
inline bool operator==(const QResourceRoot &other) const
- { return tree == other.tree && names == other.names && payloads == other.payloads; }
+ { return tree == other.tree && names == other.names && payloads == other.payloads && version == other.version; }
inline bool operator!=(const QResourceRoot &other) const
{ return !operator==(other); }
enum ResourceRootType { Resource_Builtin, Resource_File, Resource_Buffer };
virtual ResourceRootType type() const { return Resource_Builtin; }
protected:
- inline void setSource(const uchar *t, const uchar *n, const uchar *d) {
+ inline void setSource(int v, const uchar *t, const uchar *n, const uchar *d) {
tree = t;
names = n;
payloads = d;
+ version = v;
}
};
@@ -231,6 +235,7 @@ public:
mutable qint64 size;
mutable const uchar *data;
mutable QStringList children;
+ mutable QDateTime lastModified;
QResource *q_ptr;
Q_DECLARE_PUBLIC(QResource)
@@ -244,6 +249,7 @@ QResourcePrivate::clear()
data = 0;
size = 0;
children.clear();
+ lastModified = QDateTime();
container = 0;
for(int i = 0; i < related.size(); ++i) {
QResourceRoot *root = related.at(i);
@@ -274,6 +280,7 @@ QResourcePrivate::load(const QString &file)
size = 0;
compressed = 0;
}
+ lastModified = res->lastModified(node);
} else if(res->isContainer(node) != container) {
qWarning("QResourceInfo: Resource [%s] has both data and children!", file.toLatin1().constData());
}
@@ -284,6 +291,7 @@ QResourcePrivate::load(const QString &file)
data = 0;
size = 0;
compressed = 0;
+ lastModified = QDateTime();
res->ref.ref();
related.append(res);
}
@@ -514,6 +522,17 @@ const uchar *QResource::data() const
}
/*!
+ Returns the date and time when the file was last modified before
+ packaging into a resource.
+*/
+QDateTime QResource::lastModified() const
+{
+ Q_D(const QResource);
+ d->ensureInitialized();
+ return d->lastModified;
+}
+
+/*!
Returns \c true if the resource represents a directory and thus may have
children() in it, false if it represents a file.
@@ -588,11 +607,9 @@ inline uint QResourceRoot::hash(int node) const
if(!node) //root
return 0;
const int offset = findOffset(node);
- int name_offset = (tree[offset+0] << 24) + (tree[offset+1] << 16) +
- (tree[offset+2] << 8) + (tree[offset+3] << 0);
+ qint32 name_offset = qFromBigEndian<qint32>(tree + offset);
name_offset += 2; //jump past name length
- return (names[name_offset+0] << 24) + (names[name_offset+1] << 16) +
- (names[name_offset+2] << 8) + (names[name_offset+3] << 0);
+ return qFromBigEndian<quint32>(names + name_offset);
}
inline QString QResourceRoot::name(int node) const
{
@@ -601,10 +618,8 @@ inline QString QResourceRoot::name(int node) const
const int offset = findOffset(node);
QString ret;
- int name_offset = (tree[offset+0] << 24) + (tree[offset+1] << 16) +
- (tree[offset+2] << 8) + (tree[offset+3] << 0);
- const short name_length = (names[name_offset+0] << 8) +
- (names[name_offset+1] << 0);
+ qint32 name_offset = qFromBigEndian<qint32>(tree + offset);
+ const qint16 name_length = qFromBigEndian<qint16>(names + name_offset);
name_offset += 2;
name_offset += 4; //jump past hash
@@ -644,10 +659,8 @@ int QResourceRoot::findNode(const QString &_path, const QLocale &locale) const
return 0;
//the root node is always first
- int child_count = (tree[6] << 24) + (tree[7] << 16) +
- (tree[8] << 8) + (tree[9] << 0);
- int child = (tree[10] << 24) + (tree[11] << 16) +
- (tree[12] << 8) + (tree[13] << 0);
+ qint32 child_count = qFromBigEndian<qint32>(tree + 6);
+ qint32 child = qFromBigEndian<qint32>(tree + 10);
//now iterate up the tree
int node = -1;
@@ -693,18 +706,15 @@ int QResourceRoot::findNode(const QString &_path, const QLocale &locale) const
#endif
offset += 4; //jump past name
- const short flags = (tree[offset+0] << 8) +
- (tree[offset+1] << 0);
+ const qint16 flags = qFromBigEndian<qint16>(tree + offset);
offset += 2;
if(!splitter.hasNext()) {
if(!(flags & Directory)) {
- const short country = (tree[offset+0] << 8) +
- (tree[offset+1] << 0);
+ const qint16 country = qFromBigEndian<qint16>(tree + offset);
offset += 2;
- const short language = (tree[offset+0] << 8) +
- (tree[offset+1] << 0);
+ const qint16 language = qFromBigEndian<qint16>(tree + offset);
offset += 2;
#ifdef DEBUG_RESOURCE_MATCH
qDebug() << " " << "LOCALE" << country << language;
@@ -731,11 +741,9 @@ int QResourceRoot::findNode(const QString &_path, const QLocale &locale) const
if(!(flags & Directory))
return -1;
- child_count = (tree[offset+0] << 24) + (tree[offset+1] << 16) +
- (tree[offset+2] << 8) + (tree[offset+3] << 0);
+ child_count = qFromBigEndian<qint32>(tree + offset);
offset += 4;
- child = (tree[offset+0] << 24) + (tree[offset+1] << 16) +
- (tree[offset+2] << 8) + (tree[offset+3] << 0);
+ child = qFromBigEndian<qint32>(tree + offset);
break;
}
}
@@ -753,7 +761,7 @@ short QResourceRoot::flags(int node) const
if(node == -1)
return 0;
const int offset = findOffset(node) + 4; //jump past name
- return (tree[offset+0] << 8) + (tree[offset+1] << 0);
+ return qFromBigEndian<qint16>(tree + offset);
}
const uchar *QResourceRoot::data(int node, qint64 *size) const
{
@@ -763,16 +771,14 @@ const uchar *QResourceRoot::data(int node, qint64 *size) const
}
int offset = findOffset(node) + 4; //jump past name
- const short flags = (tree[offset+0] << 8) + (tree[offset+1] << 0);
+ const qint16 flags = qFromBigEndian<qint16>(tree + offset);
offset += 2;
offset += 4; //jump past locale
if(!(flags & Directory)) {
- const int data_offset = (tree[offset+0] << 24) + (tree[offset+1] << 16) +
- (tree[offset+2] << 8) + (tree[offset+3] << 0);
- const uint data_length = (payloads[data_offset+0] << 24) + (payloads[data_offset+1] << 16) +
- (payloads[data_offset+2] << 8) + (payloads[data_offset+3] << 0);
+ const qint32 data_offset = qFromBigEndian<qint32>(tree + offset);
+ const quint32 data_length = qFromBigEndian<quint32>(payloads + data_offset);
const uchar *ret = payloads+data_offset+4;
*size = data_length;
return ret;
@@ -780,22 +786,35 @@ const uchar *QResourceRoot::data(int node, qint64 *size) const
*size = 0;
return 0;
}
+
+QDateTime QResourceRoot::lastModified(int node) const
+{
+ if (node == -1 || version < 0x02)
+ return QDateTime();
+
+ const int offset = findOffset(node) + 14;
+
+ const quint64 timeStamp = qFromBigEndian<quint64>(tree + offset);
+ if (timeStamp == 0)
+ return QDateTime();
+
+ return QDateTime::fromMSecsSinceEpoch(timeStamp);
+}
+
QStringList QResourceRoot::children(int node) const
{
if(node == -1)
return QStringList();
int offset = findOffset(node) + 4; //jump past name
- const short flags = (tree[offset+0] << 8) + (tree[offset+1] << 0);
+ const qint16 flags = qFromBigEndian<qint16>(tree + offset);
offset += 2;
QStringList ret;
if(flags & Directory) {
- const int child_count = (tree[offset+0] << 24) + (tree[offset+1] << 16) +
- (tree[offset+2] << 8) + (tree[offset+3] << 0);
+ const qint32 child_count = qFromBigEndian<qint32>(tree + offset);
offset += 4;
- const int child_off = (tree[offset+0] << 24) + (tree[offset+1] << 16) +
- (tree[offset+2] << 8) + (tree[offset+3] << 0);
+ const qint32 child_off = qFromBigEndian<qint32>(tree + offset);
ret.reserve(child_count);
for(int i = child_off; i < child_off+child_count; ++i)
ret << name(i);
@@ -829,9 +848,9 @@ Q_CORE_EXPORT bool qRegisterResourceData(int version, const unsigned char *tree,
const unsigned char *name, const unsigned char *data)
{
QMutexLocker lock(resourceMutex());
- if(version == 0x01 && resourceList()) {
+ if ((version == 0x01 || version == 0x2) && resourceList()) {
bool found = false;
- QResourceRoot res(tree, name, data);
+ QResourceRoot res(version, tree, name, data);
for(int i = 0; i < resourceList()->size(); ++i) {
if(*resourceList()->at(i) == res) {
found = true;
@@ -839,7 +858,7 @@ Q_CORE_EXPORT bool qRegisterResourceData(int version, const unsigned char *tree,
}
}
if(!found) {
- QResourceRoot *root = new QResourceRoot(tree, name, data);
+ QResourceRoot *root = new QResourceRoot(version, tree, name, data);
root->ref.ref();
resourceList()->append(root);
}
@@ -852,8 +871,8 @@ Q_CORE_EXPORT bool qUnregisterResourceData(int version, const unsigned char *tre
const unsigned char *name, const unsigned char *data)
{
QMutexLocker lock(resourceMutex());
- if(version == 0x01 && resourceList()) {
- QResourceRoot res(tree, name, data);
+ if ((version == 0x01 || version == 0x02) && resourceList()) {
+ QResourceRoot res(version, tree, name, data);
for(int i = 0; i < resourceList()->size(); ) {
if(*resourceList()->at(i) == res) {
QResourceRoot *root = resourceList()->takeAt(i);
@@ -899,29 +918,25 @@ public:
}
offset += 4;
- const int version = (b[offset+0] << 24) + (b[offset+1] << 16) +
- (b[offset+2] << 8) + (b[offset+3] << 0);
+ const int version = qFromBigEndian<qint32>(b + offset);
offset += 4;
- const int tree_offset = (b[offset+0] << 24) + (b[offset+1] << 16) +
- (b[offset+2] << 8) + (b[offset+3] << 0);
+ const int tree_offset = qFromBigEndian<qint32>(b + offset);
offset += 4;
- const int data_offset = (b[offset+0] << 24) + (b[offset+1] << 16) +
- (b[offset+2] << 8) + (b[offset+3] << 0);
+ const int data_offset = qFromBigEndian<qint32>(b + offset);
offset += 4;
- const int name_offset = (b[offset+0] << 24) + (b[offset+1] << 16) +
- (b[offset+2] << 8) + (b[offset+3] << 0);
+ const int name_offset = qFromBigEndian<qint32>(b + offset);
offset += 4;
// Some sanity checking for sizes. This is _not_ a security measure.
if (size >= 0 && (tree_offset >= size || data_offset >= size || name_offset >= size))
return false;
- if(version == 0x01) {
+ if (version == 0x01 || version == 0x02) {
buffer = b;
- setSource(b+tree_offset, b+name_offset, b+data_offset);
+ setSource(version, b+tree_offset, b+name_offset, b+data_offset);
return true;
}
return false;
@@ -1430,8 +1445,11 @@ QString QResourceFileEngine::owner(FileOwner) const
return QString();
}
-QDateTime QResourceFileEngine::fileTime(FileTime) const
+QDateTime QResourceFileEngine::fileTime(FileTime time) const
{
+ Q_D(const QResourceFileEngine);
+ if (time == ModificationTime)
+ return d->resource.lastModified();
return QDateTime();
}
diff --git a/src/corelib/io/qresource.h b/src/corelib/io/qresource.h
index a50bbbdaca..895cf0456e 100644
--- a/src/corelib/io/qresource.h
+++ b/src/corelib/io/qresource.h
@@ -69,6 +69,7 @@ public:
bool isCompressed() const;
qint64 size() const;
const uchar *data() const;
+ QDateTime lastModified() const;
static void addSearchPath(const QString &path);
static QStringList searchPaths();
diff --git a/src/corelib/io/qsettings.cpp b/src/corelib/io/qsettings.cpp
index 675b375b22..1a69891d3b 100644
--- a/src/corelib/io/qsettings.cpp
+++ b/src/corelib/io/qsettings.cpp
@@ -97,14 +97,6 @@ using namespace ABI::Windows::Foundation;
using namespace ABI::Windows::Storage;
#endif
-#ifndef CSIDL_COMMON_APPDATA
-#define CSIDL_COMMON_APPDATA 0x0023 // All Users\Application Data
-#endif
-
-#ifndef CSIDL_APPDATA
-#define CSIDL_APPDATA 0x001a // <username>\Application Data
-#endif
-
#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC) && !defined(Q_OS_ANDROID)
#define Q_XDG_PLATFORM
#endif
@@ -970,31 +962,34 @@ void QConfFileSettingsPrivate::initAccess()
}
#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
-static QString windowsConfigPath(int type)
+static QString windowsConfigPath(const KNOWNFOLDERID &type)
{
QString result;
- wchar_t path[MAX_PATH];
- if (SHGetSpecialFolderPath(0, path, type, false))
+ PWSTR path = nullptr;
+ if (SHGetKnownFolderPath(type, KF_FLAG_DONT_VERIFY, NULL, &path) == S_OK) {
result = QString::fromWCharArray(path);
+ CoTaskMemFree(path);
+ }
if (result.isEmpty()) {
- switch (type) {
- case CSIDL_COMMON_APPDATA:
+ if (type == FOLDERID_ProgramData) {
result = QLatin1String("C:\\temp\\qt-common");
- break;
- case CSIDL_APPDATA:
+ } else if (type == FOLDERID_RoamingAppData) {
result = QLatin1String("C:\\temp\\qt-user");
- break;
- default:
- ;
}
}
return result;
}
#elif defined(Q_OS_WINRT) // Q_OS_WIN && !Q_OS_WINRT
-static QString windowsConfigPath(int type)
+
+enum ConfigPathType {
+ ConfigPath_CommonAppData,
+ ConfigPath_UserAppData
+};
+
+static QString windowsConfigPath(ConfigPathType type)
{
static QString result;
while (result.isEmpty()) {
@@ -1017,12 +1012,10 @@ static QString windowsConfigPath(int type)
}
switch (type) {
- case CSIDL_COMMON_APPDATA:
+ case ConfigPath_CommonAppData:
return result + QLatin1String("\\qt-common");
- case CSIDL_APPDATA:
+ case ConfigPath_UserAppData:
return result + QLatin1String("\\qt-user");
- default:
- break;
}
return result;
}
@@ -1079,10 +1072,18 @@ static void initDefaultPaths(QMutexLocker *locker)
Windows registry and the Mac CFPreferences.)
*/
#ifdef Q_OS_WIN
+
+# ifdef Q_OS_WINRT
+ const QString roamingAppDataFolder = windowsConfigPath(ConfigPath_UserAppData);
+ const QString programDataFolder = windowsConfigPath(ConfigPath_CommonAppData);
+# else
+ const QString roamingAppDataFolder = windowsConfigPath(FOLDERID_RoamingAppData);
+ const QString programDataFolder = windowsConfigPath(FOLDERID_ProgramData);
+# endif
pathHash->insert(pathHashKey(QSettings::IniFormat, QSettings::UserScope),
- Path(windowsConfigPath(CSIDL_APPDATA) + QDir::separator(), false));
+ Path(roamingAppDataFolder + QDir::separator(), false));
pathHash->insert(pathHashKey(QSettings::IniFormat, QSettings::SystemScope),
- Path(windowsConfigPath(CSIDL_COMMON_APPDATA) + QDir::separator(), false));
+ Path(programDataFolder + QDir::separator(), false));
#else
const QString userPath = make_user_path();
pathHash->insert(pathHashKey(QSettings::IniFormat, QSettings::UserScope), Path(userPath, false));
@@ -2267,20 +2268,20 @@ void QConfFileSettingsPrivate::ensureSectionParsed(QConfFile *confFile,
On Windows, the following files are used:
\list 1
- \li \c{CSIDL_APPDATA\MySoft\Star Runner.ini}
- \li \c{CSIDL_APPDATA\MySoft.ini}
- \li \c{CSIDL_COMMON_APPDATA\MySoft\Star Runner.ini}
- \li \c{CSIDL_COMMON_APPDATA\MySoft.ini}
+ \li \c{FOLDERID_RoamingAppData\MySoft\Star Runner.ini}
+ \li \c{FOLDERID_RoamingAppData\MySoft.ini}
+ \li \c{FOLDERID_ProgramData\MySoft\Star Runner.ini}
+ \li \c{FOLDERID_ProgramData\MySoft.ini}
\endlist
- The identifiers prefixed by \c{CSIDL_} are special item ID lists to be passed
- to the Win32 API function \c{SHGetSpecialFolderPath()} to obtain the
+ The identifiers prefixed by \c{FOLDERID_} are special item ID lists to be passed
+ to the Win32 API function \c{SHGetKnownFolderPath()} to obtain the
corresponding path.
- \c{CSIDL_APPDATA} usually points to \tt{C:\\Users\\\e{User Name}\\AppData\\Roaming},
+ \c{FOLDERID_RoamingAppData} usually points to \tt{C:\\Users\\\e{User Name}\\AppData\\Roaming},
also shown by the environment variable \c{%APPDATA%}.
- \c{CSIDL_COMMON_APPDATA} usually points to \tt{C:\\ProgramData}.
+ \c{FOLDERID_ProgramData} usually points to \tt{C:\\ProgramData}.
If the file format is IniFormat, this is "Settings/MySoft/Star Runner.ini"
in the application's home directory.
@@ -2740,6 +2741,7 @@ void QSettings::sync()
{
Q_D(QSettings);
d->sync();
+ d->pendingChanges = false;
}
/*!
@@ -3384,8 +3386,8 @@ void QSettings::setUserIniPath(const QString &dir)
\table
\header \li Platform \li Format \li Scope \li Path
- \row \li{1,2} Windows \li{1,2} IniFormat \li UserScope \li \c CSIDL_APPDATA
- \row \li SystemScope \li \c CSIDL_COMMON_APPDATA
+ \row \li{1,2} Windows \li{1,2} IniFormat \li UserScope \li \c FOLDERID_RoamingAppData
+ \row \li SystemScope \li \c FOLDERID_ProgramData
\row \li{1,2} Unix \li{1,2} NativeFormat, IniFormat \li UserScope \li \c $HOME/.config
\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
diff --git a/src/corelib/io/qt_attribution.json b/src/corelib/io/qt_attribution.json
index 2a616a2819..c64f8cae4b 100644
--- a/src/corelib/io/qt_attribution.json
+++ b/src/corelib/io/qt_attribution.json
@@ -1,3 +1,4 @@
+[
{
"Id": "qtemporaryfile",
"Name": "Parts of QTemporaryFile",
@@ -10,4 +11,32 @@
"LicenseId": "BSD-3-Clause",
"LicenseFile": "QTEMPORARYFILE_LICENSE.txt",
"Copyright": "Copyright (c) 1987, 1993 The Regents of the University of California."
+},
+{
+ "Id": "psl",
+ "Name": "The Public Suffix List",
+ "QDocModule": "qtcore",
+ "Description": "The Public Suffix List is an initiative of the Mozilla Project,
+but is maintained as a community resource. It is available for use in any software,
+but was originally created to meet the needs of browser manufacturers.
+It allows browsers to, for example:
+
+- Avoid privacy-damaging \"supercookies\" being set for high-level domain name suffixes
+
+- Highlight the most important part of a domain name in the user interface
+
+- Accurately sort history entries by site",
+
+ "Files": "qurltlds_p.h",
+ "QtUsage": "Used in Qt Core to avoid \"supercookies\" being set in the cookie jar
+supported by Qt (by the QNetworkCookieJar class).",
+
+ "Homepage": "http://publicsuffix.org/",
+ "Version": "Generated on 2016-10-20 from revision 915565885d0fbd25caf7d8b339cd3478f558da94",
+ "License": "Mozilla Public License 2.0",
+ "LicenseFile": "PSL-LICENSE.txt",
+ "LicenseId": "MPL-2.0",
+ "Copyright": "The list was originally provided by Jo Hermans <jo.hermans@gmail.com>.
+It is now maintained on github (https://github.com/publicsuffix/list)."
}
+]
diff --git a/src/corelib/io/qtemporaryfile_p.h b/src/corelib/io/qtemporaryfile_p.h
index d057603034..7f365f0e8a 100644
--- a/src/corelib/io/qtemporaryfile_p.h
+++ b/src/corelib/io/qtemporaryfile_p.h
@@ -70,7 +70,7 @@ protected:
explicit QTemporaryFilePrivate(const QString &templateNameIn);
~QTemporaryFilePrivate();
- QAbstractFileEngine *engine() const;
+ QAbstractFileEngine *engine() const override;
void resetFileEngine() const;
bool autoRemove = true;
@@ -99,14 +99,14 @@ public:
~QTemporaryFileEngine();
bool isReallyOpen() const;
- void setFileName(const QString &file);
+ void setFileName(const QString &file) override;
void setFileTemplate(const QString &fileTemplate);
- bool open(QIODevice::OpenMode flags);
- bool remove();
- bool rename(const QString &newName);
- bool renameOverwrite(const QString &newName);
- bool close();
+ bool open(QIODevice::OpenMode flags) override;
+ bool remove() override;
+ bool rename(const QString &newName) override;
+ bool renameOverwrite(const QString &newName) override;
+ bool close() override;
quint32 fileMode;
bool filePathIsTemplate;
diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp
index 5b34813a71..066052ade9 100644
--- a/src/corelib/io/qurl.cpp
+++ b/src/corelib/io/qurl.cpp
@@ -417,7 +417,8 @@
#include "qurlquery.h"
QT_BEGIN_NAMESPACE
-extern QString qt_normalizePathSegments(const QString &name, bool allowUncPaths); // qdir.cpp
+extern QString qt_normalizePathSegments(const QString &name, bool allowUncPaths,
+ bool *ok = nullptr); // qdir.cpp
inline static bool isHex(char c)
{
@@ -3690,6 +3691,9 @@ bool QUrl::matches(const QUrl &url, FormattingOptions options) const
if ((d->sectionIsPresent & mask) != (url.d->sectionIsPresent & mask))
return false;
+ if (options & QUrl::RemovePath)
+ return true;
+
// Compare paths, after applying path-related options
QString path1;
d->appendPath(path1, options, QUrlPrivate::Path);
diff --git a/src/corelib/io/qurltlds_p.h.INFO b/src/corelib/io/qurltlds_p.h.INFO
index 3f3d808a21..33ccd458bf 100644
--- a/src/corelib/io/qurltlds_p.h.INFO
+++ b/src/corelib/io/qurltlds_p.h.INFO
@@ -9,9 +9,6 @@ Those arrays in qurltlds_p.h are derived from the Public
Suffix List ([2]), which was originally provided by
Jo Hermans <jo.hermans@gmail.com>.
-The file qurltlds_p.h was last generated Thursday,
-October 20th 8:40 2016.
-
----
[1] list: http://mxr.mozilla.org/mozilla-central/source/netwerk/dns/effective_tld_names.dat?raw=1
[2] homepage: http://publicsuffix.org/
diff --git a/src/corelib/json/qjsonparser.cpp b/src/corelib/json/qjsonparser.cpp
index 0eb0d21ecf..39738b90a8 100644
--- a/src/corelib/json/qjsonparser.cpp
+++ b/src/corelib/json/qjsonparser.cpp
@@ -500,9 +500,10 @@ namespace {
memcpy(newValues, data, size*sizeof(QJsonPrivate::Value));
data = newValues;
} else {
- data = static_cast<QJsonPrivate::Value *>(realloc(data, alloc*sizeof(QJsonPrivate::Value)));
- if (!data)
+ void *newValues = realloc(data, alloc * sizeof(QJsonPrivate::Value));
+ if (!newValues)
return false;
+ data = static_cast<QJsonPrivate::Value *>(newValues);
}
return true;
}
diff --git a/src/corelib/json/qjsonparser_p.h b/src/corelib/json/qjsonparser_p.h
index afa2c1a8cf..379256847f 100644
--- a/src/corelib/json/qjsonparser_p.h
+++ b/src/corelib/json/qjsonparser_p.h
@@ -108,11 +108,12 @@ private:
inline int reserveSpace(int space) {
if (current + space >= dataLength) {
dataLength = 2*dataLength + space;
- data = (char *)realloc(data, dataLength);
- if (!data) {
+ char *newData = (char *)realloc(data, dataLength);
+ if (!newData) {
lastError = QJsonParseError::DocumentTooLarge;
return -1;
}
+ data = newData;
}
int pos = current;
current += space;
diff --git a/src/corelib/kernel/kernel.pri b/src/corelib/kernel/kernel.pri
index 7799113d30..61d0f2bdf1 100644
--- a/src/corelib/kernel/kernel.pri
+++ b/src/corelib/kernel/kernel.pri
@@ -151,9 +151,6 @@ unix|integrity {
kernel/qtimerinfo_unix_p.h
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
qtConfig(glib) {
SOURCES += \
diff --git a/src/corelib/kernel/qcore_unix.cpp b/src/corelib/kernel/qcore_unix.cpp
index 2042964427..686143f8c7 100644
--- a/src/corelib/kernel/qcore_unix.cpp
+++ b/src/corelib/kernel/qcore_unix.cpp
@@ -38,6 +38,7 @@
**
****************************************************************************/
+#include <QtCore/private/qglobal_p.h>
#include "qcore_unix_p.h"
#include "qelapsedtimer.h"
@@ -49,9 +50,8 @@
QT_BEGIN_NAMESPACE
-#if !defined(QT_HAVE_PPOLL) && defined(QT_HAVE_POLLTS)
-# define ppoll pollts
-# define QT_HAVE_PPOLL
+#if QT_CONFIG(poll_pollts)
+# define ppoll pollts
#endif
static inline bool time_update(struct timespec *tv, const struct timespec &start,
@@ -64,7 +64,7 @@ static inline bool time_update(struct timespec *tv, const struct timespec &start
return tv->tv_sec >= 0;
}
-#if !defined(QT_HAVE_PPOLL) && defined(QT_HAVE_POLL)
+#if QT_CONFIG(poll_poll)
static inline int timespecToMillisecs(const struct timespec *ts)
{
return (ts == NULL) ? -1 :
@@ -77,9 +77,9 @@ int qt_poll(struct pollfd *fds, nfds_t nfds, const struct timespec *timeout_ts);
static inline int qt_ppoll(struct pollfd *fds, nfds_t nfds, const struct timespec *timeout_ts)
{
-#if defined(QT_HAVE_PPOLL)
- return ::ppoll(fds, nfds, timeout_ts, Q_NULLPTR);
-#elif defined(QT_HAVE_POLL)
+#if QT_CONFIG(poll_ppoll) || QT_CONFIG(poll_pollts)
+ return ::ppoll(fds, nfds, timeout_ts, nullptr);
+#elif QT_CONFIG(poll_poll)
return ::poll(fds, nfds, timespecToMillisecs(timeout_ts));
#else
return qt_poll(fds, nfds, timeout_ts);
diff --git a/src/corelib/kernel/qdeadlinetimer.h b/src/corelib/kernel/qdeadlinetimer.h
index 3b97b89359..aa0f735fcc 100644
--- a/src/corelib/kernel/qdeadlinetimer.h
+++ b/src/corelib/kernel/qdeadlinetimer.h
@@ -62,7 +62,7 @@ public:
: 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)
+ void swap(QDeadlineTimer &other) Q_DECL_NOTHROW
{ qSwap(t1, other.t1); qSwap(t2, other.t2); qSwap(type, other.type); }
Q_DECL_CONSTEXPR bool isForever() const Q_DECL_NOTHROW
@@ -88,17 +88,17 @@ public:
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)
+ friend bool operator==(QDeadlineTimer d1, QDeadlineTimer d2) Q_DECL_NOTHROW
{ return d1.t1 == d2.t1 && d1.t2 == d2.t2; }
- friend bool operator!=(QDeadlineTimer d1, QDeadlineTimer d2)
+ friend bool operator!=(QDeadlineTimer d1, QDeadlineTimer d2) Q_DECL_NOTHROW
{ return !(d1 == d2); }
- friend bool operator<(QDeadlineTimer d1, QDeadlineTimer d2)
+ friend bool operator<(QDeadlineTimer d1, QDeadlineTimer d2) Q_DECL_NOTHROW
{ return d1.t1 < d2.t1 || (d1.t1 == d2.t1 && d1.t2 < d2.t2); }
- friend bool operator<=(QDeadlineTimer d1, QDeadlineTimer d2)
+ friend bool operator<=(QDeadlineTimer d1, QDeadlineTimer d2) Q_DECL_NOTHROW
{ return d1 == d2 || d1 < d2; }
- friend bool operator>(QDeadlineTimer d1, QDeadlineTimer d2)
+ friend bool operator>(QDeadlineTimer d1, QDeadlineTimer d2) Q_DECL_NOTHROW
{ return d2 < d1; }
- friend bool operator>=(QDeadlineTimer d1, QDeadlineTimer d2)
+ friend bool operator>=(QDeadlineTimer d1, QDeadlineTimer d2) Q_DECL_NOTHROW
{ return !(d1 < d2); }
friend QDeadlineTimer operator+(QDeadlineTimer dt, qint64 msecs)
diff --git a/src/corelib/kernel/qelapsedtimer.cpp b/src/corelib/kernel/qelapsedtimer.cpp
index 5e9d1317ac..e578b5b8b3 100644
--- a/src/corelib/kernel/qelapsedtimer.cpp
+++ b/src/corelib/kernel/qelapsedtimer.cpp
@@ -83,7 +83,7 @@ QT_BEGIN_NAMESPACE
\snippet qelapsedtimer/main.cpp 2
- It is often more convenient to use \ref{QDeadlineTimer} in this case, which
+ It is often more convenient to use \l{QDeadlineTimer} in this case, which
counts towards a timeout in the future instead of tracking elapsed time.
\section1 Reference Clocks
diff --git a/src/corelib/kernel/qeventdispatcher_winrt.cpp b/src/corelib/kernel/qeventdispatcher_winrt.cpp
index ff397fc750..33753ed507 100644
--- a/src/corelib/kernel/qeventdispatcher_winrt.cpp
+++ b/src/corelib/kernel/qeventdispatcher_winrt.cpp
@@ -166,7 +166,7 @@ private:
timerIdToHandle.insert(id, handle);
timerIdToCancelHandle.insert(id, cancelHandle);
}
- timerIdToObject.insert(id, obj);
+
const quint64 targetTime = qt_msectime() + interval;
const WinRTTimerInfo info(id, interval, type, obj, targetTime);
QMutexLocker locker(&timerInfoLock);
@@ -587,15 +587,18 @@ bool QEventDispatcherWinRT::event(QEvent *e)
break;
info.inEvent = true;
+ QObject *timerObj = d->timerIdToObject.value(id);
locker.unlock();
QTimerEvent te(id);
- QCoreApplication::sendEvent(d->timerIdToObject.value(id), &te);
+ QCoreApplication::sendEvent(timerObj, &te);
locker.relock();
- // The timer might have been removed in the meanwhile
- if (id >= d->timerInfos.size())
+ // The timer might have been removed in the meanwhile. If the timer was
+ // the last one in the list, id is bigger than the list's size.
+ // Otherwise, the id will just be set to INVALID_TIMER_ID.
+ if (id >= d->timerInfos.size() || info.timerId == INVALID_TIMER_ID)
break;
if (info.interval == 0 && info.inEvent) {
diff --git a/src/corelib/kernel/qobjectdefs_impl.h b/src/corelib/kernel/qobjectdefs_impl.h
index e94e713e1f..79c9c8303e 100644
--- a/src/corelib/kernel/qobjectdefs_impl.h
+++ b/src/corelib/kernel/qobjectdefs_impl.h
@@ -229,8 +229,14 @@ namespace QtPrivate {
(std::is_floating_point<From>::value && std::is_integral<To>::value) ||
(std::is_floating_point<From>::value && std::is_floating_point<To>::value && sizeof(From) > sizeof(To)) ||
((std::is_integral<From>::value || std::is_enum<From>::value) && std::is_floating_point<To>::value) ||
- (std::is_integral<From>::value && std::is_integral<To>::value && (sizeof(From) > sizeof(To) || std::is_signed<From>::value != std::is_signed<To>::value)) ||
- (std::is_enum<From>::value && std::is_integral<To>::value && (sizeof(From) > sizeof(To) || IsEnumUnderlyingTypeSigned<From>::value != std::is_signed<To>::value))
+ (std::is_integral<From>::value && std::is_integral<To>::value
+ && (sizeof(From) > sizeof(To)
+ || (std::is_signed<From>::value ? !std::is_signed<To>::value
+ : (std::is_signed<To>::value && sizeof(From) == sizeof(To))))) ||
+ (std::is_enum<From>::value && std::is_integral<To>::value
+ && (sizeof(From) > sizeof(To)
+ || (IsEnumUnderlyingTypeSigned<From>::value ? !std::is_signed<To>::value
+ : (std::is_signed<To>::value && sizeof(From) == sizeof(To)))))
>
{
};
diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp
index 06a57a94a6..4a4d5b9294 100644
--- a/src/corelib/kernel/qvariant.cpp
+++ b/src/corelib/kernel/qvariant.cpp
@@ -319,7 +319,7 @@ template<typename TInput, typename LiteralWrapper>
inline bool qt_convertToBool(const QVariant::Private *const d)
{
TInput str = v_cast<TInput>(d)->toLower();
- return !(str == LiteralWrapper("0") || str == LiteralWrapper("false") || str.isEmpty());
+ return !(str.isEmpty() || str == LiteralWrapper("0") || str == LiteralWrapper("false"));
}
/*!
@@ -700,7 +700,7 @@ static bool convert(const QVariant::Private *d, int t, void *result, bool *ok)
bool *b = static_cast<bool *>(result);
switch(d->type) {
case QVariant::ByteArray:
- *b = qt_convertToBool<QByteArray, QByteArray>(d);
+ *b = qt_convertToBool<QByteArray, const char*>(d);
break;
case QVariant::String:
*b = qt_convertToBool<QString, QLatin1String>(d);
diff --git a/src/corelib/mimetypes/qmimedatabase.cpp b/src/corelib/mimetypes/qmimedatabase.cpp
index f786b2ae03..448e6117b1 100644
--- a/src/corelib/mimetypes/qmimedatabase.cpp
+++ b/src/corelib/mimetypes/qmimedatabase.cpp
@@ -264,7 +264,7 @@ bool QMimeDatabasePrivate::inherits(const QString &mime, const QString &parent)
\code
<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
- <mime-type type="application/vnd.nokia.qt.qmakeprofile">
+ <mime-type type="application/vnd.qt.qmakeprofile">
<comment xml:lang="en">Qt qmake Profile</comment>
<glob pattern="*.pro" weight="50"/>
</mime-type>
diff --git a/src/corelib/mimetypes/qmimetypeparser_p.h b/src/corelib/mimetypes/qmimetypeparser_p.h
index a502439419..0ce39e701c 100644
--- a/src/corelib/mimetypes/qmimetypeparser_p.h
+++ b/src/corelib/mimetypes/qmimetypeparser_p.h
@@ -108,19 +108,19 @@ public:
explicit QMimeTypeParser(QMimeXMLProvider &provider) : m_provider(provider) {}
protected:
- inline bool process(const QMimeType &t, QString *)
+ inline bool process(const QMimeType &t, QString *) override
{ m_provider.addMimeType(t); return true; }
- inline bool process(const QMimeGlobPattern &glob, QString *)
+ inline bool process(const QMimeGlobPattern &glob, QString *) override
{ m_provider.addGlobPattern(glob); return true; }
- inline void processParent(const QString &child, const QString &parent)
+ inline void processParent(const QString &child, const QString &parent) override
{ m_provider.addParent(child, parent); }
- inline void processAlias(const QString &alias, const QString &name)
+ inline void processAlias(const QString &alias, const QString &name) override
{ m_provider.addAlias(alias, name); }
- inline void processMagicMatcher(const QMimeMagicRuleMatcher &matcher)
+ inline void processMagicMatcher(const QMimeMagicRuleMatcher &matcher) override
{ m_provider.addMagicMatcher(matcher); }
private:
diff --git a/src/corelib/statemachine/qhistorystate_p.h b/src/corelib/statemachine/qhistorystate_p.h
index 4a4442d7dd..d22e5c4aaf 100644
--- a/src/corelib/statemachine/qhistorystate_p.h
+++ b/src/corelib/statemachine/qhistorystate_p.h
@@ -88,8 +88,8 @@ protected:
// state, it will handle this transition as a special case. The history state itself is never
// entered either: either the stored configuration will be used, or the target(s) of this
// transition are used.
- virtual bool eventTest(QEvent *event) { Q_UNUSED(event); return false; }
- virtual void onTransition(QEvent *event) { Q_UNUSED(event); }
+ bool eventTest(QEvent *event) override { Q_UNUSED(event); return false; }
+ void onTransition(QEvent *event) override { Q_UNUSED(event); }
};
QT_END_NAMESPACE
diff --git a/src/corelib/thread/qbasicatomic.h b/src/corelib/thread/qbasicatomic.h
index 447fca44c0..24218e833a 100644
--- a/src/corelib/thread/qbasicatomic.h
+++ b/src/corelib/thread/qbasicatomic.h
@@ -61,6 +61,9 @@
# error "Qt requires C++11 support"
#endif
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_MSVC(4522)
+
QT_BEGIN_NAMESPACE
#if 0
@@ -323,4 +326,6 @@ public:
QT_END_NAMESPACE
+QT_WARNING_POP
+
#endif // QBASICATOMIC_H
diff --git a/src/corelib/thread/qfutureinterface.cpp b/src/corelib/thread/qfutureinterface.cpp
index ce31fe9270..c62b8fd36b 100644
--- a/src/corelib/thread/qfutureinterface.cpp
+++ b/src/corelib/thread/qfutureinterface.cpp
@@ -83,13 +83,33 @@ QFutureInterfaceBase::~QFutureInterfaceBase()
delete d;
}
+static inline int switch_on(QAtomicInt &a, int which)
+{
+ return a.fetchAndOrRelaxed(which) | which;
+}
+
+static inline int switch_off(QAtomicInt &a, int which)
+{
+ return a.fetchAndAndRelaxed(~which) & ~which;
+}
+
+static inline int switch_from_to(QAtomicInt &a, int from, int to)
+{
+ int newValue;
+ int expected = a.load();
+ do {
+ newValue = (expected & ~from) | to;
+ } while (!a.testAndSetRelaxed(expected, newValue, expected));
+ return newValue;
+}
+
void QFutureInterfaceBase::cancel()
{
QMutexLocker locker(&d->m_mutex);
- if (d->state & Canceled)
+ if (d->state.load() & Canceled)
return;
- d->state = State((d->state & ~Paused) | Canceled);
+ switch_from_to(d->state, Paused, Canceled);
d->waitCondition.wakeAll();
d->pausedWaitCondition.wakeAll();
d->sendCallOut(QFutureCallOutEvent(QFutureCallOutEvent::Canceled));
@@ -99,10 +119,10 @@ void QFutureInterfaceBase::setPaused(bool paused)
{
QMutexLocker locker(&d->m_mutex);
if (paused) {
- d->state = State(d->state | Paused);
+ switch_on(d->state, Paused);
d->sendCallOut(QFutureCallOutEvent(QFutureCallOutEvent::Paused));
} else {
- d->state = State(d->state & ~Paused);
+ switch_off(d->state, Paused);
d->pausedWaitCondition.wakeAll();
d->sendCallOut(QFutureCallOutEvent(QFutureCallOutEvent::Resumed));
}
@@ -111,29 +131,24 @@ void QFutureInterfaceBase::setPaused(bool paused)
void QFutureInterfaceBase::togglePaused()
{
QMutexLocker locker(&d->m_mutex);
- if (d->state & Paused) {
- d->state = State(d->state & ~Paused);
+ if (d->state.load() & Paused) {
+ switch_off(d->state, Paused);
d->pausedWaitCondition.wakeAll();
d->sendCallOut(QFutureCallOutEvent(QFutureCallOutEvent::Resumed));
} else {
- d->state = State(d->state | Paused);
+ switch_on(d->state, Paused);
d->sendCallOut(QFutureCallOutEvent(QFutureCallOutEvent::Paused));
}
}
void QFutureInterfaceBase::setThrottled(bool enable)
{
- // bail out if we are not changing the state
- if ((enable && (d->state & Throttled)) || (!enable && !(d->state & Throttled)))
- return;
-
- // lock and change the state
QMutexLocker lock(&d->m_mutex);
if (enable) {
- d->state = State(d->state | Throttled);
+ switch_on(d->state, Throttled);
} else {
- d->state = State(d->state & ~Throttled);
- if (!(d->state & Paused))
+ switch_off(d->state, Throttled);
+ if (!(d->state.load() & Paused))
d->pausedWaitCondition.wakeAll();
}
}
@@ -184,11 +199,15 @@ bool QFutureInterfaceBase::waitForNextResult()
void QFutureInterfaceBase::waitForResume()
{
// return early if possible to avoid taking the mutex lock.
- if ((d->state & Paused) == false || (d->state & Canceled))
- return;
+ {
+ const int state = d->state.load();
+ if (!(state & Paused) || (state & Canceled))
+ return;
+ }
QMutexLocker lock(&d->m_mutex);
- if ((d->state & Paused) == false || (d->state & Canceled))
+ const int state = d->state.load();
+ if (!(state & Paused) || (state & Canceled))
return;
// decrease active thread count since this thread will wait.
@@ -236,7 +255,7 @@ bool QFutureInterfaceBase::isProgressUpdateNeeded() const
void QFutureInterfaceBase::reportStarted()
{
QMutexLocker locker(&d->m_mutex);
- if ((d->state & Started) || (d->state & Canceled) || (d->state & Finished))
+ if (d->state.load() & (Started|Canceled|Finished))
return;
d->setState(State(Started | Running));
@@ -252,11 +271,11 @@ void QFutureInterfaceBase::reportCanceled()
void QFutureInterfaceBase::reportException(const QException &exception)
{
QMutexLocker locker(&d->m_mutex);
- if ((d->state & Canceled) || (d->state & Finished))
+ if (d->state.load() & (Canceled|Finished))
return;
d->m_exceptionStore.setException(exception);
- d->state = State(d->state | Canceled);
+ switch_on(d->state, Canceled);
d->waitCondition.wakeAll();
d->pausedWaitCondition.wakeAll();
d->sendCallOut(QFutureCallOutEvent(QFutureCallOutEvent::Canceled));
@@ -266,8 +285,8 @@ void QFutureInterfaceBase::reportException(const QException &exception)
void QFutureInterfaceBase::reportFinished()
{
QMutexLocker locker(&d->m_mutex);
- if (!(d->state & Finished)) {
- d->state = State((d->state & ~Running) | Finished);
+ if (!isFinished()) {
+ switch_from_to(d->state, Running, Finished);
d->waitCondition.wakeAll();
d->sendCallOut(QFutureCallOutEvent(QFutureCallOutEvent::Finished));
}
@@ -287,7 +306,7 @@ int QFutureInterfaceBase::expectedResultCount()
bool QFutureInterfaceBase::queryState(State state) const
{
- return (d->state & state);
+ return d->state.load() & state;
}
void QFutureInterfaceBase::waitForResult(int resultIndex)
@@ -295,7 +314,7 @@ void QFutureInterfaceBase::waitForResult(int resultIndex)
d->m_exceptionStore.throwPossibleException();
QMutexLocker lock(&d->m_mutex);
- if (!(d->state & Running))
+ if (!isRunning())
return;
lock.unlock();
@@ -305,11 +324,9 @@ void QFutureInterfaceBase::waitForResult(int resultIndex)
lock.relock();
- if (d->state & Running) {
- const int waitIndex = (resultIndex == -1) ? INT_MAX : resultIndex;
- while ((d->state & Running) && d->internal_isResultReadyAt(waitIndex) == false)
- d->waitCondition.wait(&d->m_mutex);
- }
+ const int waitIndex = (resultIndex == -1) ? INT_MAX : resultIndex;
+ while (isRunning() && !d->internal_isResultReadyAt(waitIndex))
+ d->waitCondition.wait(&d->m_mutex);
d->m_exceptionStore.throwPossibleException();
}
@@ -317,7 +334,7 @@ void QFutureInterfaceBase::waitForResult(int resultIndex)
void QFutureInterfaceBase::waitForFinished()
{
QMutexLocker lock(&d->m_mutex);
- const bool alreadyFinished = !(d->state & Running);
+ const bool alreadyFinished = !isRunning();
lock.unlock();
if (!alreadyFinished) {
@@ -325,7 +342,7 @@ void QFutureInterfaceBase::waitForFinished()
lock.relock();
- while (d->state & Running)
+ while (isRunning())
d->waitCondition.wait(&d->m_mutex);
}
@@ -334,7 +351,7 @@ void QFutureInterfaceBase::waitForFinished()
void QFutureInterfaceBase::reportResultsReady(int beginIndex, int endIndex)
{
- if ((d->state & Canceled) || (d->state & Finished) || beginIndex == endIndex)
+ if (beginIndex == endIndex || (d->state.load() & (Canceled|Finished)))
return;
d->waitCondition.wakeAll();
@@ -396,7 +413,7 @@ void QFutureInterfaceBase::setProgressValueAndText(int progressValue,
if (d->m_progressValue >= progressValue)
return;
- if ((d->state & Canceled) || (d->state & Finished))
+ if (d->state.load() & (Canceled|Finished))
return;
if (d->internal_updateProgress(progressValue, progressText)) {
@@ -468,10 +485,10 @@ bool QFutureInterfaceBasePrivate::internal_waitForNextResult()
if (m_results.hasNextResult())
return true;
- while ((state & QFutureInterfaceBase::Running) && m_results.hasNextResult() == false)
+ while ((state.load() & QFutureInterfaceBase::Running) && m_results.hasNextResult() == false)
waitCondition.wait(&m_mutex);
- return (!(state & QFutureInterfaceBase::Canceled) && m_results.hasNextResult());
+ return !(state.load() & QFutureInterfaceBase::Canceled) && m_results.hasNextResult();
}
bool QFutureInterfaceBasePrivate::internal_updateProgress(int progress,
@@ -494,16 +511,16 @@ bool QFutureInterfaceBasePrivate::internal_updateProgress(int progress,
void QFutureInterfaceBasePrivate::internal_setThrottled(bool enable)
{
// bail out if we are not changing the state
- if ((enable && (state & QFutureInterfaceBase::Throttled))
- || (!enable && !(state & QFutureInterfaceBase::Throttled)))
+ if ((enable && (state.load() & QFutureInterfaceBase::Throttled))
+ || (!enable && !(state.load() & QFutureInterfaceBase::Throttled)))
return;
// change the state
if (enable) {
- state = QFutureInterfaceBase::State(state | QFutureInterfaceBase::Throttled);
+ switch_on(state, QFutureInterfaceBase::Throttled);
} else {
- state = QFutureInterfaceBase::State(state & ~QFutureInterfaceBase::Throttled);
- if (!(state & QFutureInterfaceBase::Paused))
+ switch_off(state, QFutureInterfaceBase::Throttled);
+ if (!(state.load() & QFutureInterfaceBase::Paused))
pausedWaitCondition.wakeAll();
}
}
@@ -538,7 +555,7 @@ void QFutureInterfaceBasePrivate::connectOutputInterface(QFutureCallOutInterface
{
QMutexLocker locker(&m_mutex);
- if (state & QFutureInterfaceBase::Started) {
+ if (state.load() & QFutureInterfaceBase::Started) {
interface->postCallOutEvent(QFutureCallOutEvent(QFutureCallOutEvent::Started));
interface->postCallOutEvent(QFutureCallOutEvent(QFutureCallOutEvent::ProgressRange,
m_progressMinimum,
@@ -558,13 +575,13 @@ void QFutureInterfaceBasePrivate::connectOutputInterface(QFutureCallOutInterface
it.batchedAdvance();
}
- if (state & QFutureInterfaceBase::Paused)
+ if (state.load() & QFutureInterfaceBase::Paused)
interface->postCallOutEvent(QFutureCallOutEvent(QFutureCallOutEvent::Paused));
- if (state & QFutureInterfaceBase::Canceled)
+ if (state.load() & QFutureInterfaceBase::Canceled)
interface->postCallOutEvent(QFutureCallOutEvent(QFutureCallOutEvent::Canceled));
- if (state & QFutureInterfaceBase::Finished)
+ if (state.load() & QFutureInterfaceBase::Finished)
interface->postCallOutEvent(QFutureCallOutEvent(QFutureCallOutEvent::Finished));
outputConnections.append(interface);
@@ -583,7 +600,7 @@ void QFutureInterfaceBasePrivate::disconnectOutputInterface(QFutureCallOutInterf
void QFutureInterfaceBasePrivate::setState(QFutureInterfaceBase::State newState)
{
- state = newState;
+ state.store(newState);
}
QT_END_NAMESPACE
diff --git a/src/corelib/thread/qfutureinterface_p.h b/src/corelib/thread/qfutureinterface_p.h
index ee8dfe1354..cf882dd9b4 100644
--- a/src/corelib/thread/qfutureinterface_p.h
+++ b/src/corelib/thread/qfutureinterface_p.h
@@ -162,7 +162,7 @@ public:
int m_progressValue; // TQ
int m_progressMinimum; // TQ
int m_progressMaximum; // TQ
- QFutureInterfaceBase::State state;
+ QAtomicInt state; // reads and writes can happen unprotected, both must be atomic
QElapsedTimer progressTime;
QWaitCondition pausedWaitCondition;
QtPrivate::ResultStoreBase m_results;
diff --git a/src/corelib/thread/qmutex.cpp b/src/corelib/thread/qmutex.cpp
index 6e0fa4eedb..0aee4aeda4 100644
--- a/src/corelib/thread/qmutex.cpp
+++ b/src/corelib/thread/qmutex.cpp
@@ -275,7 +275,7 @@ bool QMutex::tryLock(int timeout) QT_MUTEX_LOCK_NOEXCEPT
Attempts to lock the mutex. This function returns \c true if the lock
was obtained; otherwise it returns \c false. If another thread has
- locked the mutex, this function will wait for at most \a duration
+ locked the mutex, this function will wait for at least \a duration
for the mutex to become available.
Note: Passing a negative duration as the \a duration is equivalent to
@@ -299,7 +299,7 @@ bool QMutex::tryLock(int timeout) QT_MUTEX_LOCK_NOEXCEPT
Attempts to lock the mutex. This function returns \c true if the lock
was obtained; otherwise it returns \c false. If another thread has
- locked the mutex, this function will wait at most until \a timePoint
+ locked the mutex, this function will wait at least until \a timePoint
for the mutex to become available.
Note: Passing a \a timePoint which has already passed is equivalent
diff --git a/src/corelib/thread/qmutex.h b/src/corelib/thread/qmutex.h
index 3a0e22e3bd..056ebdeaa5 100644
--- a/src/corelib/thread/qmutex.h
+++ b/src/corelib/thread/qmutex.h
@@ -46,8 +46,11 @@
#if QT_HAS_INCLUDE(<chrono>)
# include <chrono>
+# include <limits>
#endif
+class tst_QMutex;
+
QT_BEGIN_NAMESPACE
@@ -135,14 +138,7 @@ public:
template <class Rep, class Period>
bool try_lock_for(std::chrono::duration<Rep, Period> duration)
{
- // N4606 § 30.4.1.3 [thread.timedmutex.requirements]/5 specifies that
- // a duration less than or equal to duration.zero() shall result in a
- // try_lock, unlike QMutex's tryLock with a negative duration which
- // results in a lock.
-
- if (duration <= duration.zero())
- return tryLock(0);
- return tryLock(std::chrono::duration_cast<std::chrono::milliseconds>(duration).count());
+ return tryLock(convertToMilliseconds(duration));
}
// TimedLockable concept
@@ -162,6 +158,32 @@ public:
private:
Q_DISABLE_COPY(QMutex)
friend class QMutexLocker;
+ friend class ::tst_QMutex;
+
+#if QT_HAS_INCLUDE(<chrono>)
+ template<class Rep, class Period>
+ static int convertToMilliseconds(std::chrono::duration<Rep, Period> duration)
+ {
+ // N4606 § 30.4.1.3.5 [thread.timedmutex.requirements] specifies that a
+ // duration less than or equal to duration.zero() shall result in a
+ // try_lock, unlike QMutex's tryLock with a negative duration which
+ // results in a lock.
+
+ if (duration <= duration.zero())
+ return 0;
+
+ // when converting from 'duration' to milliseconds, make sure that
+ // the result is not shorter than 'duration':
+ std::chrono::milliseconds wait = std::chrono::duration_cast<std::chrono::milliseconds>(duration);
+ if (wait < duration)
+ wait += std::chrono::milliseconds(1);
+ Q_ASSERT(wait >= duration);
+ const auto ms = wait.count();
+ const auto maxInt = (std::numeric_limits<int>::max)();
+
+ return ms < maxInt ? int(ms) : maxInt;
+ }
+#endif
};
class Q_CORE_EXPORT QMutexLocker
diff --git a/src/corelib/tools/qalgorithms.h b/src/corelib/tools/qalgorithms.h
index 38753a6726..7e846956f5 100644
--- a/src/corelib/tools/qalgorithms.h
+++ b/src/corelib/tools/qalgorithms.h
@@ -48,8 +48,7 @@
QT_BEGIN_NAMESPACE
QT_WARNING_PUSH
-QT_WARNING_DISABLE_GCC("-Wdeprecated-declarations")
-QT_WARNING_DISABLE_CLANG("-Wdeprecated-declarations")
+QT_WARNING_DISABLE_DEPRECATED
/*
Warning: The contents of QAlgorithmsPrivate is not a part of the public Qt API
@@ -590,15 +589,16 @@ Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_popcountll(quint64 v) Q_DECL_NO
return __builtin_popcountll(v);
}
#elif defined(Q_CC_MSVC) && !defined(Q_OS_WINCE) && !defined(Q_PROCESSOR_ARM)
+#define QT_POPCOUNT_CONSTEXPR
#define QT_HAS_BUILTIN_CTZ
-Q_DECL_CONSTEXPR Q_ALWAYS_INLINE unsigned long qt_builtin_ctz(quint32 val)
+Q_ALWAYS_INLINE unsigned long qt_builtin_ctz(quint32 val)
{
unsigned long result;
_BitScanForward(&result, val);
return result;
}
#define QT_HAS_BUILTIN_CLZ
-Q_DECL_CONSTEXPR Q_ALWAYS_INLINE unsigned long qt_builtin_clz(quint32 val)
+Q_ALWAYS_INLINE unsigned long qt_builtin_clz(quint32 val)
{
unsigned long result;
_BitScanReverse(&result, val);
@@ -611,7 +611,7 @@ Q_DECL_CONSTEXPR Q_ALWAYS_INLINE unsigned long qt_builtin_clz(quint32 val)
#if Q_PROCESSOR_WORDSIZE == 8
// These are only defined for 64bit builds.
#define QT_HAS_BUILTIN_CTZLL
-Q_DECL_CONSTEXPR Q_ALWAYS_INLINE unsigned long qt_builtin_ctzll(quint64 val)
+Q_ALWAYS_INLINE unsigned long qt_builtin_ctzll(quint64 val)
{
unsigned long result;
_BitScanForward64(&result, val);
@@ -619,7 +619,7 @@ Q_DECL_CONSTEXPR Q_ALWAYS_INLINE unsigned long qt_builtin_ctzll(quint64 val)
}
// MSVC calls it _BitScanReverse and returns the carry flag, which we don't need
#define QT_HAS_BUILTIN_CLZLL
-Q_DECL_CONSTEXPR Q_ALWAYS_INLINE unsigned long qt_builtin_clzll(quint64 val)
+Q_ALWAYS_INLINE unsigned long qt_builtin_clzll(quint64 val)
{
unsigned long result;
_BitScanReverse64(&result, val);
@@ -629,31 +629,31 @@ Q_DECL_CONSTEXPR Q_ALWAYS_INLINE unsigned long qt_builtin_clzll(quint64 val)
}
#endif // MSVC 64bit
# define QT_HAS_BUILTIN_CTZS
-Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_ctzs(quint16 v) Q_DECL_NOTHROW
+Q_ALWAYS_INLINE uint qt_builtin_ctzs(quint16 v) Q_DECL_NOTHROW
{
return qt_builtin_ctz(v);
}
#define QT_HAS_BUILTIN_CLZS
-Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_clzs(quint16 v) Q_DECL_NOTHROW
+Q_ALWAYS_INLINE uint qt_builtin_clzs(quint16 v) Q_DECL_NOTHROW
{
return qt_builtin_clz(v) - 16U;
}
#define QALGORITHMS_USE_BUILTIN_POPCOUNT
-Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_popcount(quint32 v) Q_DECL_NOTHROW
+Q_ALWAYS_INLINE uint qt_builtin_popcount(quint32 v) Q_DECL_NOTHROW
{
return __popcnt(v);
}
-Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_popcount(quint8 v) Q_DECL_NOTHROW
+Q_ALWAYS_INLINE uint qt_builtin_popcount(quint8 v) Q_DECL_NOTHROW
{
return __popcnt16(v);
}
-Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_popcount(quint16 v) Q_DECL_NOTHROW
+Q_ALWAYS_INLINE uint qt_builtin_popcount(quint16 v) Q_DECL_NOTHROW
{
return __popcnt16(v);
}
#if Q_PROCESSOR_WORDSIZE == 8
#define QALGORITHMS_USE_BUILTIN_POPCOUNTLL
-Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_popcountll(quint64 v) Q_DECL_NOTHROW
+Q_ALWAYS_INLINE uint qt_builtin_popcountll(quint64 v) Q_DECL_NOTHROW
{
return __popcnt64(v);
}
@@ -661,9 +661,13 @@ Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_popcountll(quint64 v) Q_DECL_NO
#endif // MSVC
#endif // QT_HAS_CONSTEXPR_BUILTINS
+#ifndef QT_POPCOUNT_CONSTEXPR
+#define QT_POPCOUNT_CONSTEXPR Q_DECL_CONSTEXPR
+#endif
+
} //namespace QAlgorithmsPrivate
-Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qPopulationCount(quint32 v) Q_DECL_NOTHROW
+Q_DECL_CONST_FUNCTION QT_POPCOUNT_CONSTEXPR inline uint qPopulationCount(quint32 v) Q_DECL_NOTHROW
{
#ifdef QALGORITHMS_USE_BUILTIN_POPCOUNT
return QAlgorithmsPrivate::qt_builtin_popcount(v);
@@ -676,7 +680,7 @@ Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qPopulationCount(quint32 v) Q
#endif
}
-Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qPopulationCount(quint8 v) Q_DECL_NOTHROW
+Q_DECL_CONST_FUNCTION QT_POPCOUNT_CONSTEXPR inline uint qPopulationCount(quint8 v) Q_DECL_NOTHROW
{
#ifdef QALGORITHMS_USE_BUILTIN_POPCOUNT
return QAlgorithmsPrivate::qt_builtin_popcount(v);
@@ -686,7 +690,7 @@ Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qPopulationCount(quint8 v) Q_
#endif
}
-Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qPopulationCount(quint16 v) Q_DECL_NOTHROW
+Q_DECL_CONST_FUNCTION QT_POPCOUNT_CONSTEXPR inline uint qPopulationCount(quint16 v) Q_DECL_NOTHROW
{
#ifdef QALGORITHMS_USE_BUILTIN_POPCOUNT
return QAlgorithmsPrivate::qt_builtin_popcount(v);
@@ -697,7 +701,7 @@ Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qPopulationCount(quint16 v) Q
#endif
}
-Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qPopulationCount(quint64 v) Q_DECL_NOTHROW
+Q_DECL_CONST_FUNCTION QT_POPCOUNT_CONSTEXPR inline uint qPopulationCount(quint64 v) Q_DECL_NOTHROW
{
#ifdef QALGORITHMS_USE_BUILTIN_POPCOUNTLL
return QAlgorithmsPrivate::qt_builtin_popcountll(v);
@@ -712,7 +716,7 @@ Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qPopulationCount(quint64 v) Q
#endif
}
-Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qPopulationCount(long unsigned int v) Q_DECL_NOTHROW
+Q_DECL_CONST_FUNCTION QT_POPCOUNT_CONSTEXPR inline uint qPopulationCount(long unsigned int v) Q_DECL_NOTHROW
{
return qPopulationCount(static_cast<quint64>(v));
}
@@ -720,6 +724,7 @@ Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qPopulationCount(long unsigne
#if defined(Q_CC_GNU) && !defined(Q_CC_CLANG)
#undef QALGORITHMS_USE_BUILTIN_POPCOUNT
#endif
+#undef QT_POPCOUNT_CONSTEXPR
Q_DECL_RELAXED_CONSTEXPR inline uint qCountTrailingZeroBits(quint32 v) Q_DECL_NOTHROW
{
diff --git a/src/corelib/tools/qcollator_p.h b/src/corelib/tools/qcollator_p.h
index fbbce00676..423ba0325a 100644
--- a/src/corelib/tools/qcollator_p.h
+++ b/src/corelib/tools/qcollator_p.h
@@ -55,7 +55,7 @@
#include <QtCore/private/qglobal_p.h>
#include "qcollator.h"
#include <QVector>
-#ifdef QT_USE_ICU
+#if QT_CONFIG(icu)
#include <unicode/ucol.h>
#elif defined(Q_OS_OSX)
#include <CoreServices/CoreServices.h>
@@ -65,7 +65,7 @@
QT_BEGIN_NAMESPACE
-#ifdef QT_USE_ICU
+#if QT_CONFIG(icu)
typedef UCollator *CollatorType;
typedef QByteArray CollatorKeyType;
@@ -90,7 +90,7 @@ class Q_CORE_EXPORT QCollatorPrivate
public:
QAtomicInt ref;
QLocale locale;
-#if defined(Q_OS_WIN) && !defined(QT_USE_ICU)
+#if defined(Q_OS_WIN) && !QT_CONFIG(icu)
#ifdef USE_COMPARESTRINGEX
QString localeName;
#else
diff --git a/src/corelib/tools/qcommandlineoption.h b/src/corelib/tools/qcommandlineoption.h
index 4dcae03ad9..276be042de 100644
--- a/src/corelib/tools/qcommandlineoption.h
+++ b/src/corelib/tools/qcommandlineoption.h
@@ -94,7 +94,7 @@ public:
void setFlags(Flags aflags);
#if QT_DEPRECATED_SINCE(5, 8)
- QT_DEPRECATED_X("Use setFlags() with HiddenFromHelp)")
+ QT_DEPRECATED_X("Use setFlags() with HiddenFromHelp")
void setHidden(bool hidden);
QT_DEPRECATED_X("Use flags() and HiddenFromHelp")
bool isHidden() const;
diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp
index f81c578bc8..d52f03acae 100644
--- a/src/corelib/tools/qdatetime.cpp
+++ b/src/corelib/tools/qdatetime.cpp
@@ -3846,7 +3846,7 @@ QString QDateTime::toString(Qt::DateFormat format) const
\li the abbreviated localized day name (e.g. 'Mon' to 'Sun').
Uses the system locale to localize the name, i.e. QLocale::system().
\row \li dddd
- \li the long localized day name (e.g. 'Monday' to 'Qt::Sunday').
+ \li the long localized day name (e.g. 'Monday' to 'Sunday').
Uses the system locale to localize the name, i.e. QLocale::system().
\row \li M \li the month as number without a leading zero (1-12)
\row \li MM \li the month as number with a leading zero (01-12)
diff --git a/src/corelib/tools/qdatetimeparser.cpp b/src/corelib/tools/qdatetimeparser.cpp
index 3271e2a8c4..621c877174 100644
--- a/src/corelib/tools/qdatetimeparser.cpp
+++ b/src/corelib/tools/qdatetimeparser.cpp
@@ -888,12 +888,12 @@ QDateTimeParser::StateNode QDateTimeParser::parse(QString &input, int &cursorPos
State state = Acceptable;
QDateTime newCurrentValue;
- int pos = 0;
bool conflicts = false;
const int sectionNodesCount = sectionNodes.size();
QDTPDEBUG << "parse" << input;
{
+ int pos = 0;
int year, month, day;
const QDate currentDate = currentValue.date();
const QTime currentTime = currentValue.time();
diff --git a/src/corelib/tools/qdatetimeparser_p.h b/src/corelib/tools/qdatetimeparser_p.h
index 6f381965a9..bc088a5f4c 100644
--- a/src/corelib/tools/qdatetimeparser_p.h
+++ b/src/corelib/tools/qdatetimeparser_p.h
@@ -104,14 +104,6 @@ public:
none.zeroesAdded = 0;
}
virtual ~QDateTimeParser() {}
- enum AmPmFinder {
- Neither = -1,
- AM = 0,
- PM = 1,
- PossibleAM = 2,
- PossiblePM = 3,
- PossibleBoth = 4
- };
enum Section {
NoSection = 0x00000,
@@ -187,33 +179,44 @@ public:
#ifndef QT_NO_DATESTRING
StateNode parse(QString &input, int &cursorPosition, const QDateTime &currentValue, bool fixup) const;
#endif
- int sectionMaxSize(int index) const;
- int sectionSize(int index) const;
- int sectionMaxSize(Section s, int count) const;
- int sectionPos(int index) const;
- int sectionPos(const SectionNode &sn) const;
-
- const SectionNode &sectionNode(int index) const;
- Section sectionType(int index) const;
- QString sectionText(int sectionIndex) const;
- QString sectionText(const QString &text, int sectionIndex, int index) const;
- int getDigit(const QDateTime &dt, int index) const;
- bool setDigit(QDateTime &t, int index, int newval) const;
- int parseSection(const QDateTime &currentValue, int sectionIndex, QString &txt, int &cursorPosition,
- int index, QDateTimeParser::State &state, int *used = 0) const;
- int absoluteMax(int index, const QDateTime &value = QDateTime()) const;
- int absoluteMin(int index) const;
bool parseFormat(const QString &format);
#ifndef QT_NO_DATESTRING
bool fromString(const QString &text, QDate *date, QTime *time) const;
#endif
+ enum FieldInfoFlag {
+ Numeric = 0x01,
+ FixedWidth = 0x02,
+ AllowPartial = 0x04,
+ Fraction = 0x08
+ };
+ Q_DECLARE_FLAGS(FieldInfo, FieldInfoFlag)
+
+ FieldInfo fieldInfo(int index) const;
+
+ void setDefaultLocale(const QLocale &loc) { defaultLocale = loc; }
+ virtual QString displayText() const { return text; }
+
+private:
+ int sectionMaxSize(Section s, int count) const;
+ QString sectionText(const QString &text, int sectionIndex, int index) const;
+ int parseSection(const QDateTime &currentValue, int sectionIndex, QString &txt, int &cursorPosition,
+ int index, QDateTimeParser::State &state, int *used = 0) const;
#ifndef QT_NO_TEXTDATE
int findMonth(const QString &str1, int monthstart, int sectionIndex,
QString *monthName = 0, int *used = 0) const;
int findDay(const QString &str1, int intDaystart, int sectionIndex,
QString *dayName = 0, int *used = 0) const;
#endif
+
+ enum AmPmFinder {
+ Neither = -1,
+ AM = 0,
+ PM = 1,
+ PossibleAM = 2,
+ PossiblePM = 3,
+ PossibleBoth = 4
+ };
AmPmFinder findAmPm(QString &str, int index, int *used = 0) const;
bool potentialValue(const QStringRef &str, int min, int max, int index,
const QDateTime &currentValue, int insert) const;
@@ -223,36 +226,37 @@ public:
return potentialValue(QStringRef(&str), min, max, index, currentValue, insert);
}
+protected: // for the benefit of QDateTimeEditPrivate
+ int sectionSize(int index) const;
+ int sectionMaxSize(int index) const;
+ int sectionPos(int index) const;
+ int sectionPos(const SectionNode &sn) const;
+
+ const SectionNode &sectionNode(int index) const;
+ Section sectionType(int index) const;
+ QString sectionText(int sectionIndex) const;
+ int getDigit(const QDateTime &dt, int index) const;
+ bool setDigit(QDateTime &t, int index, int newval) const;
+
+ int absoluteMax(int index, const QDateTime &value = QDateTime()) const;
+ int absoluteMin(int index) const;
+
bool skipToNextSection(int section, const QDateTime &current, const QStringRef &sectionText) const;
bool skipToNextSection(int section, const QDateTime &current, const QString &sectionText) const
{
return skipToNextSection(section, current, QStringRef(&sectionText));
}
-
QString stateName(State s) const;
-
- enum FieldInfoFlag {
- Numeric = 0x01,
- FixedWidth = 0x02,
- AllowPartial = 0x04,
- Fraction = 0x08
- };
- Q_DECLARE_FLAGS(FieldInfo, FieldInfoFlag)
-
- FieldInfo fieldInfo(int index) const;
-
- void setDefaultLocale(const QLocale &loc) { defaultLocale = loc; }
virtual QDateTime getMinimum() const;
virtual QDateTime getMaximum() const;
virtual int cursorPosition() const { return -1; }
- virtual QString displayText() const { return text; }
virtual QString getAmPmText(AmPm ap, Case cs) const;
virtual QLocale locale() const { return defaultLocale; }
mutable int currentSectionIndex;
Sections display;
/*
- This stores the stores the most recently selected day.
+ This stores the most recently selected day.
It is useful when considering the following scenario:
1. Date is: 31/01/2000
@@ -272,9 +276,7 @@ public:
QString displayFormat;
QLocale defaultLocale;
QVariant::Type parserType;
-
bool fixday;
-
Qt::TimeSpec spec; // spec if used by QDateTimeEdit
Context context;
};
diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp
index ca04c2bd44..77f7ba963b 100644
--- a/src/corelib/tools/qlocale.cpp
+++ b/src/corelib/tools/qlocale.cpp
@@ -2433,7 +2433,7 @@ Qt::LayoutDirection QLocale::textDirection() const
*/
QString QLocale::toUpper(const QString &str) const
{
-#ifdef QT_USE_ICU
+#if QT_CONFIG(icu)
bool ok = true;
QString result = QIcu::toUpper(d->bcp47Name('_'), str, &ok);
if (ok)
@@ -2457,7 +2457,7 @@ QString QLocale::toUpper(const QString &str) const
*/
QString QLocale::toLower(const QString &str) const
{
-#ifdef QT_USE_ICU
+#if QT_CONFIG(icu)
bool ok = true;
const QString result = QIcu::toLower(d->bcp47Name('_'), str, &ok);
if (ok)
diff --git a/src/corelib/tools/qlocale_p.h b/src/corelib/tools/qlocale_p.h
index 74d8e5f381..7749f66b8e 100644
--- a/src/corelib/tools/qlocale_p.h
+++ b/src/corelib/tools/qlocale_p.h
@@ -134,7 +134,7 @@ Q_DECLARE_TYPEINFO(QSystemLocale::QueryType, Q_PRIMITIVE_TYPE);
Q_DECLARE_TYPEINFO(QSystemLocale::CurrencyToStringArgument, Q_MOVABLE_TYPE);
#endif
-#ifdef QT_USE_ICU
+#if QT_CONFIG(icu)
namespace QIcu {
QString toUpper(const QByteArray &localeId, const QString &str, bool *ok);
QString toLower(const QByteArray &localeId, const QString &str, bool *ok);
diff --git a/src/corelib/tools/qmap.cpp b/src/corelib/tools/qmap.cpp
index 406eb31923..94ed47f898 100644
--- a/src/corelib/tools/qmap.cpp
+++ b/src/corelib/tools/qmap.cpp
@@ -399,7 +399,9 @@ void QMapDataBase::freeData(QMapDataBase *d)
With QMap, the items are always sorted by key.
\li The key type of a QHash must provide operator==() and a global
qHash(Key) function. The key type of a QMap must provide
- operator<() specifying a total order.
+ operator<() specifying a total order. Since Qt 5.8.1 it is also safe
+ to use a pointer type as key, even if the underlying operator<()
+ does not provide a total order.
\endlist
Here's an example QMap with QString keys and \c int values:
diff --git a/src/corelib/tools/qmap.h b/src/corelib/tools/qmap.h
index 96ce787446..3f4f034b4e 100644
--- a/src/corelib/tools/qmap.h
+++ b/src/corelib/tools/qmap.h
@@ -51,6 +51,7 @@
#include <map>
#include <new>
+#include <functional>
#ifdef Q_COMPILER_INITIALIZER_LISTS
#include <initializer_list>
@@ -61,11 +62,8 @@ QT_BEGIN_NAMESPACE
/*
QMap uses qMapLessThanKey() to compare keys. The default
implementation uses operator<(). For pointer types,
- qMapLessThanKey() casts the pointers to integers before it
- compares them, because operator<() is undefined on pointers
- that come from different memory blocks. (In practice, this
- is only a problem when running a program such as
- BoundsChecker.)
+ qMapLessThanKey() uses std::less (because operator<() on
+ pointers can be used only between pointers in the same array).
*/
template <class Key> inline bool qMapLessThanKey(const Key &key1, const Key &key2)
@@ -75,8 +73,7 @@ template <class Key> inline bool qMapLessThanKey(const Key &key1, const Key &key
template <class Ptr> inline bool qMapLessThanKey(const Ptr *key1, const Ptr *key2)
{
- Q_STATIC_ASSERT(sizeof(quintptr) == sizeof(const Ptr *));
- return quintptr(key1) < quintptr(key2);
+ return std::less<const Ptr *>()(key1, key2);
}
struct QMapDataBase;
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp
index be6f8af8d7..8cf058f035 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -2316,21 +2316,20 @@ QString &QString::remove(const QString &str, Qt::CaseSensitivity cs)
*/
QString &QString::remove(QChar ch, Qt::CaseSensitivity cs)
{
- int i = 0;
- ushort c = ch.unicode();
- if (cs == Qt::CaseSensitive) {
- while (i < d->size)
- if (d->data()[i] == ch)
- remove(i, 1);
- else
- i++;
- } else {
- c = foldCase(c);
- while (i < d->size)
- if (foldCase(d->data()[i]) == c)
- remove(i, 1);
- else
- i++;
+ const int idx = indexOf(ch, 0, cs);
+ if (idx != -1) {
+ const auto first = begin(); // implicit detach()
+ auto last = end();
+ if (cs == Qt::CaseSensitive) {
+ last = std::remove(first + idx, last, ch);
+ } else {
+ const QChar c = ch.toCaseFolded();
+ auto caseInsensEqual = [c](QChar x) {
+ return c == x.toCaseFolded();
+ };
+ last = std::remove_if(first + idx, last, caseInsensEqual);
+ }
+ resize(last - first);
}
return *this;
}
@@ -3277,6 +3276,23 @@ static int lastIndexOfHelper(const ushort *haystack, int from, const ushort *nee
return -1;
}
+static inline int lastIndexOfHelper(
+ const QStringRef &haystack, int from, const QStringRef &needle, Qt::CaseSensitivity cs)
+{
+ return lastIndexOfHelper(reinterpret_cast<const ushort*>(haystack.unicode()), from,
+ reinterpret_cast<const ushort*>(needle.unicode()), needle.size(), cs);
+}
+
+static inline int lastIndexOfHelper(
+ const QStringRef &haystack, int from, QLatin1String needle, Qt::CaseSensitivity cs)
+{
+ const int size = needle.size();
+ QVarLengthArray<ushort> s(size);
+ qt_from_latin1(s.data(), needle.latin1(), size);
+ return lastIndexOfHelper(reinterpret_cast<const ushort*>(haystack.unicode()), from,
+ s.data(), size, cs);
+}
+
/*!
Returns the index position of the last occurrence of the string \a
str in this string, searching backward from index position \a
@@ -5576,7 +5592,7 @@ int QString::localeAwareCompare(const QString &other) const
return localeAwareCompare_helper(constData(), length(), other.constData(), other.length());
}
-#if defined(QT_USE_ICU) && !defined(Q_OS_WIN32) && !defined(Q_OS_DARWIN)
+#if QT_CONFIG(icu) && !defined(Q_OS_WIN32) && !defined(Q_OS_DARWIN)
Q_GLOBAL_STATIC(QThreadStorage<QCollator>, defaultCollator)
#endif
@@ -5622,7 +5638,7 @@ int QString::localeAwareCompare_helper(const QChar *data1, int length1,
CFRelease(thisString);
CFRelease(otherString);
return result;
-#elif defined(QT_USE_ICU)
+#elif QT_CONFIG(icu)
if (!defaultCollator()->hasLocalData())
defaultCollator()->setLocalData(QCollator());
return defaultCollator()->localData().compare(data1, length1, data2, length2);
@@ -9836,6 +9852,27 @@ int QStringRef::lastIndexOf(QChar ch, int from, Qt::CaseSensitivity cs) const
return qt_last_index_of(unicode(), size(), ch, from, cs);
}
+template<typename T>
+static int last_index_of_impl(const QStringRef &haystack, int from, const T &needle, Qt::CaseSensitivity cs)
+{
+ const int sl = needle.size();
+ if (sl == 1)
+ return haystack.lastIndexOf(needle.at(0), from, cs);
+
+ const int l = haystack.size();
+ if (from < 0)
+ from += l;
+ int delta = l - sl;
+ if (from == l && sl == 0)
+ return from;
+ if (uint(from) >= uint(l) || delta < 0)
+ return -1;
+ if (from > delta)
+ from = delta;
+
+ return lastIndexOfHelper(haystack, from, needle, cs);
+}
+
/*!
\since 4.8
\overload lastIndexOf()
@@ -9853,25 +9890,7 @@ int QStringRef::lastIndexOf(QChar ch, int from, Qt::CaseSensitivity cs) const
*/
int QStringRef::lastIndexOf(QLatin1String str, int from, Qt::CaseSensitivity cs) const
{
- const int sl = str.size();
- if (sl == 1)
- return lastIndexOf(str.at(0), from, cs);
-
- const int l = size();
- if (from < 0)
- from += l;
- int delta = l - sl;
- if (from == l && sl == 0)
- return from;
- if (uint(from) >= uint(l) || delta < 0)
- return -1;
- if (from > delta)
- from = delta;
-
- QVarLengthArray<ushort> s(sl);
- qt_from_latin1(s.data(), str.latin1(), sl);
-
- return lastIndexOfHelper(reinterpret_cast<const ushort*>(unicode()), from, s.data(), sl, cs);
+ return last_index_of_impl(*this, from, str, cs);
}
/*!
@@ -9891,24 +9910,7 @@ int QStringRef::lastIndexOf(QLatin1String str, int from, Qt::CaseSensitivity cs)
*/
int QStringRef::lastIndexOf(const QStringRef &str, int from, Qt::CaseSensitivity cs) const
{
- const int sl = str.size();
- if (sl == 1)
- return lastIndexOf(str.at(0), from, cs);
-
- const int l = size();
- if (from < 0)
- from += l;
- int delta = l - sl;
- if (from == l && sl == 0)
- return from;
- if (uint(from) >= uint(l) || delta < 0)
- return -1;
- if (from > delta)
- from = delta;
-
- return lastIndexOfHelper(reinterpret_cast<const ushort*>(unicode()), from,
- reinterpret_cast<const ushort*>(str.unicode()),
- str.size(), cs);
+ return last_index_of_impl(*this, from, str, cs);
}
/*!
diff --git a/src/corelib/tools/qtimezone.cpp b/src/corelib/tools/qtimezone.cpp
index e423d9af0c..359c2d0bdb 100644
--- a/src/corelib/tools/qtimezone.cpp
+++ b/src/corelib/tools/qtimezone.cpp
@@ -54,11 +54,11 @@ QT_BEGIN_NAMESPACE
static QTimeZonePrivate *newBackendTimeZone()
{
#ifdef QT_NO_SYSTEMLOCALE
-#ifdef QT_USE_ICU
+#if QT_CONFIG(icu)
return new QIcuTimeZonePrivate();
#else
return new QUtcTimeZonePrivate();
-#endif // QT_USE_ICU
+#endif
#else
#if defined Q_OS_MAC
return new QMacTimeZonePrivate();
@@ -69,7 +69,7 @@ static QTimeZonePrivate *newBackendTimeZone()
// Registry based timezone backend not available on WinRT
#elif defined Q_OS_WIN
return new QWinTimeZonePrivate();
-#elif defined QT_USE_ICU
+#elif QT_CONFIG(icu)
return new QIcuTimeZonePrivate();
#else
return new QUtcTimeZonePrivate();
@@ -81,11 +81,11 @@ static QTimeZonePrivate *newBackendTimeZone()
static QTimeZonePrivate *newBackendTimeZone(const QByteArray &ianaId)
{
#ifdef QT_NO_SYSTEMLOCALE
-#ifdef QT_USE_ICU
+#if QT_CONFIG(icu)
return new QIcuTimeZonePrivate(ianaId);
#else
return new QUtcTimeZonePrivate(ianaId);
-#endif // QT_USE_ICU
+#endif
#else
#if defined Q_OS_MAC
return new QMacTimeZonePrivate(ianaId);
@@ -96,7 +96,7 @@ static QTimeZonePrivate *newBackendTimeZone(const QByteArray &ianaId)
// Registry based timezone backend not available on WinRT
#elif defined Q_OS_WIN
return new QWinTimeZonePrivate(ianaId);
-#elif defined QT_USE_ICU
+#elif QT_CONFIG(icu)
return new QIcuTimeZonePrivate(ianaId);
#else
return new QUtcTimeZonePrivate(ianaId);
diff --git a/src/corelib/tools/qtimezoneprivate.cpp b/src/corelib/tools/qtimezoneprivate.cpp
index 8ec675a696..ea8f6d1438 100644
--- a/src/corelib/tools/qtimezoneprivate.cpp
+++ b/src/corelib/tools/qtimezoneprivate.cpp
@@ -725,7 +725,7 @@ template<> QTimeZonePrivate *QSharedDataPointer<QTimeZonePrivate>::clone()
}
/*
- UTC Offset implementation, used when QT_NO_SYSTEMLOCALE set and QT_USE_ICU not set,
+ UTC Offset implementation, used when QT_NO_SYSTEMLOCALE set and ICU is not being used,
or for QDateTimes with a Qt:Spec of Qt::OffsetFromUtc.
*/
diff --git a/src/corelib/tools/qtimezoneprivate_p.h b/src/corelib/tools/qtimezoneprivate_p.h
index 21f1f38fa8..c397c18aac 100644
--- a/src/corelib/tools/qtimezoneprivate_p.h
+++ b/src/corelib/tools/qtimezoneprivate_p.h
@@ -56,9 +56,9 @@
#include "qlocale_p.h"
#include "qvector.h"
-#ifdef QT_USE_ICU
+#if QT_CONFIG(icu)
#include <unicode/ucal.h>
-#endif // QT_USE_ICU
+#endif
#ifdef Q_OS_MAC
#ifdef __OBJC__
@@ -227,7 +227,7 @@ private:
int m_offsetFromUtc;
};
-#ifdef QT_USE_ICU
+#if QT_CONFIG(icu)
class Q_AUTOTEST_EXPORT QIcuTimeZonePrivate Q_DECL_FINAL : public QTimeZonePrivate
{
public:
@@ -268,7 +268,7 @@ private:
UCalendar *m_ucal;
};
-#endif // QT_USE_ICU
+#endif
#if defined Q_OS_UNIX && !defined Q_OS_MAC && !defined Q_OS_ANDROID
struct QTzTransitionTime
@@ -337,9 +337,9 @@ private:
QVector<QTzTransitionTime> m_tranTimes;
QVector<QTzTransitionRule> m_tranRules;
QList<QByteArray> m_abbreviations;
-#ifdef QT_USE_ICU
+#if QT_CONFIG(icu)
mutable QSharedDataPointer<QTimeZonePrivate> m_icu;
-#endif // QT_USE_ICU
+#endif
QByteArray m_posixRule;
};
#endif // Q_OS_UNIX
diff --git a/src/corelib/tools/qtimezoneprivate_tz.cpp b/src/corelib/tools/qtimezoneprivate_tz.cpp
index 747c0042dd..38dff88919 100644
--- a/src/corelib/tools/qtimezoneprivate_tz.cpp
+++ b/src/corelib/tools/qtimezoneprivate_tz.cpp
@@ -598,18 +598,18 @@ static QVector<QTimeZonePrivate::Data> calculatePosixTransitions(const QByteArra
// Create the system default time zone
QTzTimeZonePrivate::QTzTimeZonePrivate()
-#ifdef QT_USE_ICU
+#if QT_CONFIG(icu)
: m_icu(0)
-#endif // QT_USE_ICU
+#endif
{
init(systemTimeZoneId());
}
// Create a named time zone
QTzTimeZonePrivate::QTzTimeZonePrivate(const QByteArray &ianaId)
-#ifdef QT_USE_ICU
+#if QT_CONFIG(icu)
: m_icu(0)
-#endif // QT_USE_ICU
+#endif
{
init(ianaId);
}
@@ -617,9 +617,9 @@ QTzTimeZonePrivate::QTzTimeZonePrivate(const QByteArray &ianaId)
QTzTimeZonePrivate::QTzTimeZonePrivate(const QTzTimeZonePrivate &other)
: QTimeZonePrivate(other), m_tranTimes(other.m_tranTimes),
m_tranRules(other.m_tranRules), m_abbreviations(other.m_abbreviations),
-#ifdef QT_USE_ICU
+#if QT_CONFIG(icu)
m_icu(other.m_icu),
-#endif // QT_USE_ICU
+#endif
m_posixRule(other.m_posixRule)
{
}
@@ -820,7 +820,7 @@ QString QTzTimeZonePrivate::displayName(qint64 atMSecsSinceEpoch,
QTimeZone::NameType nameType,
const QLocale &locale) const
{
-#ifdef QT_USE_ICU
+#if QT_CONFIG(icu)
if (!m_icu)
m_icu = new QIcuTimeZonePrivate(m_id);
// TODO small risk may not match if tran times differ due to outdated files
@@ -830,7 +830,7 @@ QString QTzTimeZonePrivate::displayName(qint64 atMSecsSinceEpoch,
#else
Q_UNUSED(nameType)
Q_UNUSED(locale)
-#endif // QT_USE_ICU
+#endif
return abbreviation(atMSecsSinceEpoch);
}
@@ -838,7 +838,7 @@ QString QTzTimeZonePrivate::displayName(QTimeZone::TimeType timeType,
QTimeZone::NameType nameType,
const QLocale &locale) const
{
-#ifdef QT_USE_ICU
+#if QT_CONFIG(icu)
if (!m_icu)
m_icu = new QIcuTimeZonePrivate(m_id);
// TODO small risk may not match if tran times differ due to outdated files
@@ -849,7 +849,7 @@ QString QTzTimeZonePrivate::displayName(QTimeZone::TimeType timeType,
Q_UNUSED(timeType)
Q_UNUSED(nameType)
Q_UNUSED(locale)
-#endif // QT_USE_ICU
+#endif
// If no ICU available then have to use abbreviations instead
// Abbreviations don't have GenericTime
if (timeType == QTimeZone::GenericTime)
diff --git a/src/corelib/tools/qvarlengtharray.h b/src/corelib/tools/qvarlengtharray.h
index c3ac104399..1530299303 100644
--- a/src/corelib/tools/qvarlengtharray.h
+++ b/src/corelib/tools/qvarlengtharray.h
@@ -76,7 +76,8 @@ public:
QVarLengthArray(std::initializer_list<T> args)
: a(Prealloc), s(0), ptr(reinterpret_cast<T *>(array))
{
- append(args.begin(), args.size());
+ if (args.size())
+ append(args.begin(), args.size());
}
#endif
diff --git a/src/corelib/tools/tools.pri b/src/corelib/tools/tools.pri
index ad41630978..ab5997635a 100644
--- a/src/corelib/tools/tools.pri
+++ b/src/corelib/tools/tools.pri
@@ -144,7 +144,6 @@ qtConfig(icu) {
SOURCES += tools/qlocale_icu.cpp \
tools/qcollator_icu.cpp
- DEFINES += QT_USE_ICU
} else: win32 {
SOURCES += tools/qcollator_win.cpp
} else: macx {
diff --git a/src/dbus/qdbuspendingreply.h b/src/dbus/qdbuspendingreply.h
index 786eab2120..da29894d15 100644
--- a/src/dbus/qdbuspendingreply.h
+++ b/src/dbus/qdbuspendingreply.h
@@ -77,7 +77,7 @@ namespace QDBusPendingReplyTypes {
typedef T1 Type;
};
- template<typename T1> inline int metaTypeFor(T1 * = 0)
+ template<typename T1> inline int metaTypeFor(T1 * = nullptr)
{ return qMetaTypeId<T1>(); }
// specialize for QVariant, allowing it to be used in place of QDBusVariant
template<> inline int metaTypeFor<QVariant>(QVariant *)
@@ -91,7 +91,7 @@ namespace QDBusPendingReplyTypes {
enum { Total = Next::Total + 1 };
static inline void fillMetaTypes(int *p)
{
- *p = metaTypeFor<T1>(0);
+ *p = metaTypeFor<T1>(nullptr);
Next::fillMetaTypes(++p);
}
};
diff --git a/src/dbus/qdbusreply.h b/src/dbus/qdbusreply.h
index b6a454d240..227615024a 100644
--- a/src/dbus/qdbusreply.h
+++ b/src/dbus/qdbusreply.h
@@ -66,7 +66,7 @@ public:
}
inline QDBusReply& operator=(const QDBusMessage &reply)
{
- QVariant data(qMetaTypeId<Type>(), reinterpret_cast<void*>(0));
+ QVariant data(qMetaTypeId<Type>(), nullptr);
qDBusReplyFill(reply, m_error, data);
m_data = qvariant_cast<Type>(data);
return *this;
diff --git a/src/gui/configure.json b/src/gui/configure.json
index 3f139cf02d..7efaaff505 100644
--- a/src/gui/configure.json
+++ b/src/gui/configure.json
@@ -7,7 +7,6 @@
"commandline": {
"options": {
- "android-style-assets": "boolean",
"angle": "boolean",
"direct2d": "boolean",
"directfb": "boolean",
@@ -422,11 +421,6 @@
"condition": "features.accessibility && features.xcb && features.dbus",
"output": [ "privateFeature", "feature" ]
},
- "android-style-assets": {
- "label": "Android Style Assets",
- "condition": "config.android",
- "output": [ "privateFeature" ]
- },
"angle": {
"label": "ANGLE",
"autoDetect": "features.opengles2 || features.opengl-dynamic",
@@ -978,6 +972,13 @@
"section": "Utilities",
"condition": "features.properties",
"output": [ "publicFeature", "feature" ]
+ },
+ "multiprocess": {
+ "label": "Multi process",
+ "description": "Provides support for detecting the desktop environment, launching external processes and opening URLs.",
+ "section": "Utilities",
+ "condition": "!config.integrity",
+ "output": [ "privateFeature" ]
}
},
diff --git a/src/gui/image/qimage.h b/src/gui/image/qimage.h
index 91aaf673d0..fd2298561e 100644
--- a/src/gui/image/qimage.h
+++ b/src/gui/image/qimage.h
@@ -381,8 +381,7 @@ inline void QImage::setPixelColor(const QPoint &pt, const QColor &c) { setPixelC
#if QT_DEPRECATED_SINCE(5, 0)
QT_WARNING_PUSH
-QT_WARNING_DISABLE_GCC("-Wdeprecated-declarations")
-QT_WARNING_DISABLE_MSVC(4996)
+QT_WARNING_DISABLE_DEPRECATED
inline QString QImage::text(const char* key, const char* lang) const
{
diff --git a/src/gui/image/qimage_sse2.cpp b/src/gui/image/qimage_sse2.cpp
index 0fb92e9d43..8f7195e0b5 100644
--- a/src/gui/image/qimage_sse2.cpp
+++ b/src/gui/image/qimage_sse2.cpp
@@ -51,51 +51,66 @@ bool convert_ARGB_to_ARGB_PM_inplace_sse2(QImageData *data, Qt::ImageConversionF
{
Q_ASSERT(data->format == QImage::Format_ARGB32 || data->format == QImage::Format_RGBA8888);
- // extra pixels on each line
- const int spare = data->width & 3;
- // width in pixels of the pad at the end of each line
- const int pad = (data->bytes_per_line >> 2) - data->width;
- const int iter = data->width >> 2;
- int height = data->height;
+ const int width = data->width;
+ const int height = data->height;
+ const int bpl = data->bytes_per_line;
const __m128i alphaMask = _mm_set1_epi32(0xff000000);
const __m128i nullVector = _mm_setzero_si128();
const __m128i half = _mm_set1_epi16(0x80);
const __m128i colorMask = _mm_set1_epi32(0x00ff00ff);
- __m128i *d = reinterpret_cast<__m128i*>(data->data);
- while (height--) {
- const __m128i *end = d + iter;
-
- for (; d != end; ++d) {
- const __m128i srcVector = _mm_loadu_si128(d);
+ uchar *d = data->data;
+ for (int y = 0; y < height; ++y) {
+ int i = 0;
+ quint32 *d32 = reinterpret_cast<quint32 *>(d);
+ ALIGNMENT_PROLOGUE_16BYTES(d, i, width) {
+ const quint32 p = d32[i];
+ if (p <= 0x00ffffff)
+ d32[i] = 0;
+ else if (p < 0xff000000)
+ d32[i] = qPremultiply(p);
+ }
+ __m128i *d128 = reinterpret_cast<__m128i *>(d32 + i);
+ for (; i < (width - 3); i += 4) {
+ const __m128i srcVector = _mm_load_si128(d128);
+#ifdef __SSE4_1__
+ if (_mm_testc_si128(srcVector, alphaMask)) {
+ // opaque, data is unchanged
+ } else if (_mm_testz_si128(srcVector, alphaMask)) {
+ // fully transparent
+ _mm_store_si128(d128, nullVector);
+ } else {
+ const __m128i srcVectorAlpha = _mm_and_si128(srcVector, alphaMask);
+#else
const __m128i srcVectorAlpha = _mm_and_si128(srcVector, alphaMask);
if (_mm_movemask_epi8(_mm_cmpeq_epi32(srcVectorAlpha, alphaMask)) == 0xffff) {
// opaque, data is unchanged
} else if (_mm_movemask_epi8(_mm_cmpeq_epi32(srcVectorAlpha, nullVector)) == 0xffff) {
// fully transparent
- _mm_storeu_si128(d, nullVector);
+ _mm_store_si128(d128, nullVector);
} else {
+#endif
__m128i alphaChannel = _mm_srli_epi32(srcVector, 24);
alphaChannel = _mm_or_si128(alphaChannel, _mm_slli_epi32(alphaChannel, 16));
__m128i result;
BYTE_MUL_SSE2(result, srcVector, alphaChannel, colorMask, half);
result = _mm_or_si128(_mm_andnot_si128(alphaMask, result), srcVectorAlpha);
- _mm_storeu_si128(d, result);
+ _mm_store_si128(d128, result);
}
+ d128++;
}
- QRgb *p = reinterpret_cast<QRgb*>(d);
- QRgb *pe = p+spare;
- for (; p != pe; ++p) {
- if (*p < 0x00ffffff)
- *p = 0;
- else if (*p < 0xff000000)
- *p = qPremultiply(*p);
+ SIMD_EPILOGUE(i, width, 3) {
+ const quint32 p = d32[i];
+ if (p <= 0x00ffffff)
+ d32[i] = 0;
+ else if (p < 0xff000000)
+ d32[i] = qPremultiply(p);
}
- d = reinterpret_cast<__m128i*>(p+pad);
+ d += bpl;
}
if (data->format == QImage::Format_ARGB32)
diff --git a/src/gui/image/qxbmhandler.cpp b/src/gui/image/qxbmhandler.cpp
index eda816f0f2..19015c5dcd 100644
--- a/src/gui/image/qxbmhandler.cpp
+++ b/src/gui/image/qxbmhandler.cpp
@@ -124,17 +124,18 @@ static bool read_xbm_body(QIODevice *device, int w, int h, QImage *outImage)
qint64 readBytes = 0;
+ char *p;
+
// scan for database
- for (;;) {
+ do {
if ((readBytes = device->readLine(buf, buflen)) <= 0) {
// end of file
return false;
}
buf[readBytes] = '\0';
- if (QByteArray::fromRawData(buf, readBytes).contains("0x"))
- break;
- }
+ p = strstr(buf, "0x");
+ } while (!p);
if (outImage->size() != QSize(w, h) || outImage->format() != QImage::Format_MonoLSB) {
*outImage = QImage(w, h, QImage::Format_MonoLSB);
@@ -148,7 +149,6 @@ static bool read_xbm_body(QIODevice *device, int w, int h, QImage *outImage)
int x = 0, y = 0;
uchar *b = outImage->scanLine(0);
- char *p = buf + QByteArray::fromRawData(buf, readBytes).indexOf("0x");
w = (w+7)/8; // byte width
while (y < h) { // for all encoded bytes...
@@ -163,7 +163,8 @@ static bool read_xbm_body(QIODevice *device, int w, int h, QImage *outImage)
} else { // read another line
if ((readBytes = device->readLine(buf,buflen)) <= 0) // EOF ==> truncated image
break;
- p = buf + QByteArray::fromRawData(buf, readBytes).indexOf("0x");
+ buf[readBytes] = '\0';
+ p = strstr(buf, "0x");
}
}
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index bf5f6b5f64..d3f3827d6e 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -1918,7 +1918,7 @@ void QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::Mo
QMouseEvent ev(type, localPoint, localPoint, globalPoint, button, buttons, e->modifiers, e->source);
ev.setTimestamp(e->timestamp);
- if (window->d_func()->blockedByModalWindow) {
+ if (window->d_func()->blockedByModalWindow && !qApp->d_func()->popupActive()) {
// a modal window is blocking this window, don't allow mouse events through
return;
}
diff --git a/src/gui/kernel/qguiapplication_p.h b/src/gui/kernel/qguiapplication_p.h
index 996ea748b0..3804667ef3 100644
--- a/src/gui/kernel/qguiapplication_p.h
+++ b/src/gui/kernel/qguiapplication_p.h
@@ -199,6 +199,7 @@ public:
static void hideModalWindow(QWindow *window);
static void updateBlockedStatus(QWindow *window);
virtual bool isWindowBlocked(QWindow *window, QWindow **blockingWindow = 0) const;
+ virtual bool popupActive() { return false; }
static Qt::MouseButtons buttons;
static ulong mousePressTime;
diff --git a/src/gui/kernel/qkeysequence.cpp b/src/gui/kernel/qkeysequence.cpp
index d59bd63caf..a6bc7d4d9c 100644
--- a/src/gui/kernel/qkeysequence.cpp
+++ b/src/gui/kernel/qkeysequence.cpp
@@ -1528,7 +1528,9 @@ bool QKeySequence::isDetached() const
If the key sequence has no keys, an empty string is returned.
On \macos, the string returned resembles the sequence that is
- shown in the menu bar.
+ shown in the menu bar if \a format is
+ QKeySequence::NativeText; otherwise, the string uses the
+ "portable" format, suitable for writing to a file.
\sa fromString()
*/
diff --git a/src/gui/kernel/qplatformnativeinterface.cpp b/src/gui/kernel/qplatformnativeinterface.cpp
index f48e470d1b..6614d45b12 100644
--- a/src/gui/kernel/qplatformnativeinterface.cpp
+++ b/src/gui/kernel/qplatformnativeinterface.cpp
@@ -38,6 +38,7 @@
****************************************************************************/
#include "qplatformnativeinterface.h"
+#include <QtGui/qcursor.h>
QT_BEGIN_NAMESPACE
diff --git a/src/gui/math3d/qmatrix4x4.h b/src/gui/math3d/qmatrix4x4.h
index 19540308a1..e143884f9d 100644
--- a/src/gui/math3d/qmatrix4x4.h
+++ b/src/gui/math3d/qmatrix4x4.h
@@ -867,9 +867,9 @@ inline QPointF operator*(const QPointF& point, const QMatrix4x4& matrix)
yin * matrix.m[3][1] +
matrix.m[3][3];
if (w == 1.0f) {
- return QPointF(float(x), float(y));
+ return QPointF(qreal(x), qreal(y));
} else {
- return QPointF(float(x / w), float(y / w));
+ return QPointF(qreal(x / w), qreal(y / w));
}
}
@@ -907,33 +907,35 @@ inline QPoint operator*(const QMatrix4x4& matrix, const QPoint& point)
inline QPointF operator*(const QMatrix4x4& matrix, const QPointF& point)
{
- float xin, yin;
- float x, y, w;
+ qreal xin, yin;
+ qreal x, y, w;
xin = point.x();
yin = point.y();
if (matrix.flagBits == QMatrix4x4::Identity) {
return point;
} else if (matrix.flagBits < QMatrix4x4::Rotation2D) {
// Translation | Scale
- return QPointF(xin * matrix.m[0][0] + matrix.m[3][0],
- yin * matrix.m[1][1] + matrix.m[3][1]);
+ return QPointF(xin * qreal(matrix.m[0][0]) + qreal(matrix.m[3][0]),
+ yin * qreal(matrix.m[1][1]) + qreal(matrix.m[3][1]));
} else if (matrix.flagBits < QMatrix4x4::Perspective) {
- return QPointF(xin * matrix.m[0][0] + yin * matrix.m[1][0] + matrix.m[3][0],
- xin * matrix.m[0][1] + yin * matrix.m[1][1] + matrix.m[3][1]);
+ return QPointF(xin * qreal(matrix.m[0][0]) + yin * qreal(matrix.m[1][0]) +
+ qreal(matrix.m[3][0]),
+ xin * qreal(matrix.m[0][1]) + yin * qreal(matrix.m[1][1]) +
+ qreal(matrix.m[3][1]));
} else {
- x = xin * matrix.m[0][0] +
- yin * matrix.m[1][0] +
- matrix.m[3][0];
- y = xin * matrix.m[0][1] +
- yin * matrix.m[1][1] +
- matrix.m[3][1];
- w = xin * matrix.m[0][3] +
- yin * matrix.m[1][3] +
- matrix.m[3][3];
- if (w == 1.0f) {
- return QPointF(float(x), float(y));
+ x = xin * qreal(matrix.m[0][0]) +
+ yin * qreal(matrix.m[1][0]) +
+ qreal(matrix.m[3][0]);
+ y = xin * qreal(matrix.m[0][1]) +
+ yin * qreal(matrix.m[1][1]) +
+ qreal(matrix.m[3][1]);
+ w = xin * qreal(matrix.m[0][3]) +
+ yin * qreal(matrix.m[1][3]) +
+ qreal(matrix.m[3][3]);
+ if (w == 1.0) {
+ return QPointF(qreal(x), qreal(y));
} else {
- return QPointF(float(x / w), float(y / w));
+ return QPointF(qreal(x / w), qreal(y / w));
}
}
}
diff --git a/src/gui/math3d/qquaternion.h b/src/gui/math3d/qquaternion.h
index 21b051e08e..808e0ee6d7 100644
--- a/src/gui/math3d/qquaternion.h
+++ b/src/gui/math3d/qquaternion.h
@@ -202,7 +202,8 @@ inline QQuaternion QQuaternion::inverted() const
double(yp) * double(yp) +
double(zp) * double(zp);
if (!qFuzzyIsNull(len))
- return QQuaternion(wp / len, -xp / len, -yp / len, -zp / len);
+ return QQuaternion(double(wp) / len, double(-xp) / len,
+ double(-yp) / len, double(-zp) / len);
return QQuaternion(0.0f, 0.0f, 0.0f, 0.0f);
}
@@ -251,7 +252,7 @@ inline const QQuaternion operator*(const QQuaternion &q1, const QQuaternion& q2)
float zz = (q1.wp + q1.yp) * (q2.wp - q2.zp);
float ww = (q1.zp + q1.xp) * (q2.xp + q2.yp);
float xx = ww + yy + zz;
- float qq = 0.5 * (xx + (q1.zp - q1.xp) * (q2.xp - q2.yp));
+ float qq = 0.5f * (xx + (q1.zp - q1.xp) * (q2.xp - q2.yp));
float w = qq - ww + (q1.zp - q1.yp) * (q2.yp - q2.zp);
float x = qq - xx + (q1.xp + q1.wp) * (q2.xp + q2.wp);
diff --git a/src/gui/opengl/opengl.pri b/src/gui/opengl/opengl.pri
index e7eff5b7a0..4c778b184e 100644
--- a/src/gui/opengl/opengl.pri
+++ b/src/gui/opengl/opengl.pri
@@ -24,7 +24,6 @@ qtConfig(opengl) {
opengl/qopenglcustomshaderstage_p.h \
opengl/qopengltextureglyphcache_p.h \
opengl/qopenglshadercache_p.h \
- opengl/qopenglshadercache_meego_p.h \
opengl/qopenglversionfunctions.h \
opengl/qopenglversionfunctionsfactory_p.h \
opengl/qopenglvertexarrayobject.h \
diff --git a/src/gui/opengl/qopenglshadercache_meego_p.h b/src/gui/opengl/qopenglshadercache_meego_p.h
deleted file mode 100644
index 0892e1a2a1..0000000000
--- a/src/gui/opengl/qopenglshadercache_meego_p.h
+++ /dev/null
@@ -1,450 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtGui module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//
-// 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.
-//
-
-#ifndef QOPENGLSHADERCACHE_MEEGO_P_H
-#define QOPENGLSHADERCACHE_MEEGO_P_H
-
-#include <QtCore/qopenglobal.h>
-
-#if defined(QT_MEEGO_EXPERIMENTAL_SHADERCACHE) && defined(QT_OPENGL_ES_2)
-
-#include <QtCore/qcryptographichash.h>
-#include <QtCore/qsharedmemory.h>
-#include <QtCore/qsystemsemaphore.h>
-
-#ifndef QT_BOOTSTRAPPED
-# include <GLES2/gl2ext.h>
-#endif
-#if defined(QT_DEBUG) || defined(QT_MEEGO_EXPERIMENTAL_SHADERCACHE_TRACE)
-# include <syslog.h>
-#endif
-
-/*
- This cache stores internal Qt shader programs in shared memory.
-
- This header file is ugly on purpose and can only be included once. It is only to be used
- for the internal shader cache, not as a generic cache for anyone's shaders.
-
- The cache stores either ShaderCacheMaxEntries shader programs or ShaderCacheDataSize kilobytes
- of shader programs, whatever limit is reached first.
-
- The layout of the cache is as outlined in the CachedShaders struct. After some
- integers, an array of headers is reserved, then comes the space for the actual binaries.
-
- Shader Programs are identified by the md5sum of their frag and vertex shader source code.
-
- Shader Programs are never removed. The cache never shrinks or re-shuffles. This is done
- on purpose to ensure minimum amount of locking, no alignment problems and very few write
- operations.
-
- Note: Locking the shader cache could be expensive, because the entire system might hang.
- That's why the cache is immutable to minimize the time we need to keep it locked.
-
- Why is it Meego specific?
-
- First, the size is chosen so that it fits to generic meego usage. Second, on Meego, there's
- always at least one Qt application active (the launcher), so the cache will never be destroyed.
- Only when the last Qt app exits, the cache dies, which should only be when someone kills the
- X11 server. And last but not least it was only tested with Meego's SGX driver.
-
- There's a small tool in src/opengl/util/meego that dumps the contents of the cache.
- */
-
-// anonymous namespace, prevent exporting of the private symbols
-namespace
-{
-
-struct CachedShaderHeader
-{
- /* the index in the data[] member of CachedShaders */
- int index;
- /* the size of the binary shader */
- GLsizei size;
- /* the format of the binary shader */
- GLenum format;
- /* the md5sum of the frag+vertex shaders */
- char md5Sum[16];
-};
-
-enum
-{
- /* The maximum amount of shader programs the cache can hold */
- ShaderCacheMaxEntries = 20
-};
-
-typedef CachedShaderHeader CachedShaderHeaders[ShaderCacheMaxEntries];
-
-enum
-{
- // ShaderCacheDataSize is 20k minus the other data members of CachedShaders
- ShaderCacheDataSize = 1024 * ShaderCacheMaxEntries - sizeof(CachedShaderHeaders) - 2 * sizeof(int)
-};
-
-struct CachedShaders
-{
- /* How much space is still available in the cache */
- inline int availableSize() const { return ShaderCacheDataSize - dataSize; }
-
- /* The current amount of cached shaders */
- int shaderCount;
-
- /* The current amount (in bytes) of cached data */
- int dataSize;
-
- /* The headers describing the shaders */
- CachedShaderHeaders headers;
-
- /* The actual binary data of the shader programs */
- char data[ShaderCacheDataSize];
-};
-
-//#define QT_DEBUG_SHADER_CACHE
-#ifdef QT_DEBUG_SHADER_CACHE
-static QDebug shaderCacheDebug()
-{
- return QDebug(QtDebugMsg);
-}
-#else
-static inline QNoDebug shaderCacheDebug() { return QNoDebug(); }
-#endif
-
-class ShaderCacheSharedMemory
-{
-public:
- ShaderCacheSharedMemory()
- : shm(QLatin1String("qt_gles2_shadercache_" QT_VERSION_STR))
- {
- // we need a system semaphore here, since cache creation and initialization must be atomic
- QSystemSemaphore attachSemaphore(QLatin1String("qt_gles2_shadercache_mutex_" QT_VERSION_STR), 1);
-
- if (!attachSemaphore.acquire()) {
- shaderCacheDebug() << "Unable to require shader cache semaphore:" << attachSemaphore.errorString();
- return;
- }
-
- if (shm.attach()) {
- // success!
- shaderCacheDebug() << "Attached to shader cache";
- } else {
-
- // no cache exists - create and initialize it
- if (shm.create(sizeof(CachedShaders))) {
- shaderCacheDebug() << "Created new shader cache";
- initializeCache();
- } else {
- shaderCacheDebug() << "Unable to create shader cache:" << shm.errorString();
- }
- }
-
- attachSemaphore.release();
- }
-
- inline bool isAttached() const { return shm.isAttached(); }
-
- inline bool lock() { return shm.lock(); }
- inline bool unlock() { return shm.unlock(); }
- inline void *data() { return shm.data(); }
- inline QString errorString() { return shm.errorString(); }
-
- ~ShaderCacheSharedMemory()
- {
- if (!shm.detach())
- shaderCacheDebug() << "Unable to detach shader cache" << shm.errorString();
- }
-
-private:
- void initializeCache()
- {
- // no need to lock the shared memory since we're already protected by the
- // attach system semaphore.
-
- void *data = shm.data();
- Q_ASSERT(data);
-
- memset(data, 0, sizeof(CachedShaders));
- }
-
- QSharedMemory shm;
-};
-
-class ShaderCacheLocker
-{
-public:
- inline ShaderCacheLocker(ShaderCacheSharedMemory *cache)
- : shm(cache->lock() ? cache : (ShaderCacheSharedMemory *)0)
- {
- if (!shm)
- shaderCacheDebug() << "Unable to lock shader cache" << cache->errorString();
- }
-
- inline bool isLocked() const { return shm; }
-
- inline ~ShaderCacheLocker()
- {
- if (!shm)
- return;
- if (!shm->unlock())
- shaderCacheDebug() << "Unable to unlock shader cache" << shm->errorString();
- }
-
-private:
- ShaderCacheSharedMemory *shm;
-};
-
-#ifdef QT_BOOTSTRAPPED
-} // end namespace
-#else
-
-static void traceCacheOverflow(const char *message)
-{
-#if defined(QT_DEBUG) || defined (QT_MEEGO_EXPERIMENTAL_SHADERCACHE_TRACE)
- openlog(qPrintable(QCoreApplication::applicationName()), LOG_PID | LOG_ODELAY, LOG_USER);
- syslog(LOG_DEBUG, message);
- closelog();
-#endif
- shaderCacheDebug() << message;
-}
-
-Q_GLOBAL_STATIC(ShaderCacheSharedMemory, shaderCacheSharedMemory)
-
-/*
- Finds the index of the shader program identified by md5Sum in the cache.
- Note: Does NOT lock the cache for reading, the cache must already be locked!
-
- Returns -1 when no shader was found.
- */
-static int qt_cache_index_unlocked(const QByteArray &md5Sum, CachedShaders *cache)
-{
- for (int i = 0; i < cache->shaderCount; ++i) {
- if (qstrncmp(md5Sum.constData(), cache->headers[i].md5Sum, 16) == 0) {
- return i;
- }
- }
- return -1;
-}
-
-/* Returns the index of the shader identified by md5Sum */
-static int qt_cache_index(const QByteArray &md5Sum)
-{
- ShaderCacheSharedMemory *shm = shaderCacheSharedMemory();
- if (!shm || !shm->isAttached())
- return false;
-
- Q_ASSERT(md5Sum.length() == 16);
-
- ShaderCacheLocker locker(shm);
- if (!locker.isLocked())
- return false;
-
- void *data = shm->data();
- Q_ASSERT(data);
-
- CachedShaders *cache = reinterpret_cast<CachedShaders *>(data);
-
- return qt_cache_index_unlocked(md5Sum, cache);
-}
-
-/* Loads the cached shader at index \a shaderIndex into \a program
- * Note: Since the cache is immutable, this operation doesn't lock the shared memory.
- */
-static bool qt_cached_shader(QOpenGLShaderProgram *program, QOpenGLContext *ctx, int shaderIndex)
-{
- Q_ASSERT(shaderIndex >= 0 && shaderIndex <= ShaderCacheMaxEntries);
- Q_ASSERT(program);
-
- ShaderCacheSharedMemory *shm = shaderCacheSharedMemory();
- if (!shm || !shm->isAttached())
- return false;
-
- void *data = shm->data();
- Q_ASSERT(data);
-
- CachedShaders *cache = reinterpret_cast<CachedShaders *>(data);
-
- shaderCacheDebug() << "fetching cached shader at index" << shaderIndex
- << "dataIndex" << cache->headers[shaderIndex].index
- << "size" << cache->headers[shaderIndex].size
- << "format" << cache->headers[shaderIndex].format;
-
- // call program->programId first, since that resolves the glProgramBinaryOES symbol
- GLuint programId = program->programId();
- glProgramBinaryOES(programId, cache->headers[shaderIndex].format,
- cache->data + cache->headers[shaderIndex].index,
- cache->headers[shaderIndex].size);
-
- return true;
-}
-
-/* Stores the shader program in the cache. Returns false if there's an error with the cache, or
- if the cache is too small to hold the shader. */
-static bool qt_cache_shader(const QOpenGLShaderProgram *shader, QOpenGLContext *ctx, const QByteArray &md5Sum)
-{
- ShaderCacheSharedMemory *shm = shaderCacheSharedMemory();
- if (!shm || !shm->isAttached())
- return false;
-
- void *data = shm->data();
- Q_ASSERT(data);
-
- CachedShaders *cache = reinterpret_cast<CachedShaders *>(data);
-
- ShaderCacheLocker locker(shm);
- if (!locker.isLocked())
- return false;
-
- int cacheIdx = cache->shaderCount;
- if (cacheIdx >= ShaderCacheMaxEntries) {
- traceCacheOverflow("Qt OpenGL shader cache index overflow!");
- return false;
- }
-
- // now that we have the lock on the shared memory, make sure no one
- // inserted the shader already while we were unlocked
- if (qt_cache_index_unlocked(md5Sum, cache) != -1)
- return true; // already cached
-
- shaderCacheDebug() << "Caching shader at index" << cacheIdx;
-
- GLint binaryLength = 0;
- glGetProgramiv(shader->programId(), GL_PROGRAM_BINARY_LENGTH_OES, &binaryLength);
-
- if (!binaryLength) {
- shaderCacheDebug() << "Unable to determine binary shader size!";
- return false;
- }
-
- if (binaryLength > cache->availableSize()) {
- traceCacheOverflow("Qt OpenGL shader cache data overflow!");
- return false;
- }
-
- GLsizei size = 0;
- GLenum format = 0;
- glGetProgramBinaryOES(shader->programId(), binaryLength, &size, &format,
- cache->data + cache->dataSize);
-
- if (!size) {
- shaderCacheDebug() << "Unable to get binary shader!";
- return false;
- }
-
- cache->headers[cacheIdx].index = cache->dataSize;
- cache->dataSize += binaryLength;
- ++cache->shaderCount;
- cache->headers[cacheIdx].size = binaryLength;
- cache->headers[cacheIdx].format = format;
-
- memcpy(cache->headers[cacheIdx].md5Sum, md5Sum.constData(), 16);
-
- shaderCacheDebug() << "cached shader size" << size
- << "format" << format
- << "binarySize" << binaryLength
- << "cache index" << cacheIdx
- << "data index" << cache->headers[cacheIdx].index;
-
- return true;
-}
-
-} // namespace
-
-QT_BEGIN_NAMESPACE
-
-
-class CachedShader
-{
-public:
- CachedShader(const QByteArray &fragSource, const QByteArray &vertexSource)
- : cacheIdx(-1)
- {
- QCryptographicHash md5Hash(QCryptographicHash::Md5);
-
- md5Hash.addData(fragSource);
- md5Hash.addData(vertexSource);
-
- md5Sum = md5Hash.result();
- }
-
- bool isCached()
- {
- return cacheIndex() != -1;
- }
-
- int cacheIndex()
- {
- if (cacheIdx != -1)
- return cacheIdx;
- cacheIdx = qt_cache_index(md5Sum);
- return cacheIdx;
- }
-
- bool load(QOpenGLShaderProgram *program, QOpenGLContext *ctx)
- {
- if (cacheIndex() == -1)
- return false;
- return qt_cached_shader(program, ctx, cacheIdx);
- }
-
- bool store(QOpenGLShaderProgram *program, QOpenGLContext *ctx)
- {
- return qt_cache_shader(program, ctx, md5Sum);
- }
-
-private:
- QByteArray md5Sum;
- int cacheIdx;
-};
-
-
-QT_END_NAMESPACE
-
-#endif
-
-#endif
-#endif
diff --git a/src/gui/opengl/qopenglshadercache_p.h b/src/gui/opengl/qopenglshadercache_p.h
index b4d1d64721..0f730602b0 100644
--- a/src/gui/opengl/qopenglshadercache_p.h
+++ b/src/gui/opengl/qopenglshadercache_p.h
@@ -53,10 +53,6 @@
#include <QtGui/private/qtguiglobal_p.h>
-#if defined(QT_MEEGO_EXPERIMENTAL_SHADERCACHE) && defined(QT_OPENGL_ES_2)
-# include "qopenglshadercache_meego_p.h"
-#else
-
QT_BEGIN_NAMESPACE
@@ -88,4 +84,3 @@ public:
QT_END_NAMESPACE
#endif
-#endif
diff --git a/src/gui/opengl/qopengltexture.cpp b/src/gui/opengl/qopengltexture.cpp
index 0a46eea85d..c9b08f60b1 100644
--- a/src/gui/opengl/qopengltexture.cpp
+++ b/src/gui/opengl/qopengltexture.cpp
@@ -410,6 +410,34 @@ static bool isSizedTextureFormat(QOpenGLTexture::TextureFormat internalFormat)
case QOpenGLTexture::SRGB8_PunchThrough_Alpha1_ETC2:
case QOpenGLTexture::RGBA8_ETC2_EAC:
case QOpenGLTexture::SRGB8_Alpha8_ETC2_EAC:
+ case QOpenGLTexture::RGBA_ASTC_4x4:
+ case QOpenGLTexture::RGBA_ASTC_5x4:
+ case QOpenGLTexture::RGBA_ASTC_5x5:
+ case QOpenGLTexture::RGBA_ASTC_6x5:
+ case QOpenGLTexture::RGBA_ASTC_6x6:
+ case QOpenGLTexture::RGBA_ASTC_8x5:
+ case QOpenGLTexture::RGBA_ASTC_8x6:
+ case QOpenGLTexture::RGBA_ASTC_8x8:
+ case QOpenGLTexture::RGBA_ASTC_10x5:
+ case QOpenGLTexture::RGBA_ASTC_10x6:
+ case QOpenGLTexture::RGBA_ASTC_10x8:
+ case QOpenGLTexture::RGBA_ASTC_10x10:
+ case QOpenGLTexture::RGBA_ASTC_12x10:
+ case QOpenGLTexture::RGBA_ASTC_12x12:
+ case QOpenGLTexture::SRGB8_Alpha8_ASTC_4x4:
+ case QOpenGLTexture::SRGB8_Alpha8_ASTC_5x4:
+ case QOpenGLTexture::SRGB8_Alpha8_ASTC_5x5:
+ case QOpenGLTexture::SRGB8_Alpha8_ASTC_6x5:
+ case QOpenGLTexture::SRGB8_Alpha8_ASTC_6x6:
+ case QOpenGLTexture::SRGB8_Alpha8_ASTC_8x5:
+ case QOpenGLTexture::SRGB8_Alpha8_ASTC_8x6:
+ case QOpenGLTexture::SRGB8_Alpha8_ASTC_8x8:
+ case QOpenGLTexture::SRGB8_Alpha8_ASTC_10x5:
+ case QOpenGLTexture::SRGB8_Alpha8_ASTC_10x6:
+ case QOpenGLTexture::SRGB8_Alpha8_ASTC_10x8:
+ case QOpenGLTexture::SRGB8_Alpha8_ASTC_10x10:
+ case QOpenGLTexture::SRGB8_Alpha8_ASTC_12x10:
+ case QOpenGLTexture::SRGB8_Alpha8_ASTC_12x12:
return true;
case QOpenGLTexture::RGB8_ETC1:
@@ -703,6 +731,36 @@ static QOpenGLTexture::PixelFormat pixelFormatCompatibleWithInternalFormat(QOpen
case QOpenGLTexture::SRGB8_Alpha8_ETC2_EAC:
return QOpenGLTexture::RGBA;
+ case QOpenGLTexture::RGBA_ASTC_4x4:
+ case QOpenGLTexture::RGBA_ASTC_5x4:
+ case QOpenGLTexture::RGBA_ASTC_5x5:
+ case QOpenGLTexture::RGBA_ASTC_6x5:
+ case QOpenGLTexture::RGBA_ASTC_6x6:
+ case QOpenGLTexture::RGBA_ASTC_8x5:
+ case QOpenGLTexture::RGBA_ASTC_8x6:
+ case QOpenGLTexture::RGBA_ASTC_8x8:
+ case QOpenGLTexture::RGBA_ASTC_10x5:
+ case QOpenGLTexture::RGBA_ASTC_10x6:
+ case QOpenGLTexture::RGBA_ASTC_10x8:
+ case QOpenGLTexture::RGBA_ASTC_10x10:
+ case QOpenGLTexture::RGBA_ASTC_12x10:
+ case QOpenGLTexture::RGBA_ASTC_12x12:
+ case QOpenGLTexture::SRGB8_Alpha8_ASTC_4x4:
+ case QOpenGLTexture::SRGB8_Alpha8_ASTC_5x4:
+ case QOpenGLTexture::SRGB8_Alpha8_ASTC_5x5:
+ case QOpenGLTexture::SRGB8_Alpha8_ASTC_6x5:
+ case QOpenGLTexture::SRGB8_Alpha8_ASTC_6x6:
+ case QOpenGLTexture::SRGB8_Alpha8_ASTC_8x5:
+ case QOpenGLTexture::SRGB8_Alpha8_ASTC_8x6:
+ case QOpenGLTexture::SRGB8_Alpha8_ASTC_8x8:
+ case QOpenGLTexture::SRGB8_Alpha8_ASTC_10x5:
+ case QOpenGLTexture::SRGB8_Alpha8_ASTC_10x6:
+ case QOpenGLTexture::SRGB8_Alpha8_ASTC_10x8:
+ case QOpenGLTexture::SRGB8_Alpha8_ASTC_10x10:
+ case QOpenGLTexture::SRGB8_Alpha8_ASTC_12x10:
+ case QOpenGLTexture::SRGB8_Alpha8_ASTC_12x12:
+ return QOpenGLTexture::RGBA;
+
case QOpenGLTexture::DepthFormat:
return QOpenGLTexture::Depth;
@@ -859,6 +917,34 @@ static QOpenGLTexture::PixelType pixelTypeCompatibleWithInternalFormat(QOpenGLTe
case QOpenGLTexture::RGBA8_ETC2_EAC:
case QOpenGLTexture::SRGB8_Alpha8_ETC2_EAC:
case QOpenGLTexture::RGB8_ETC1:
+ case QOpenGLTexture::RGBA_ASTC_4x4:
+ case QOpenGLTexture::RGBA_ASTC_5x4:
+ case QOpenGLTexture::RGBA_ASTC_5x5:
+ case QOpenGLTexture::RGBA_ASTC_6x5:
+ case QOpenGLTexture::RGBA_ASTC_6x6:
+ case QOpenGLTexture::RGBA_ASTC_8x5:
+ case QOpenGLTexture::RGBA_ASTC_8x6:
+ case QOpenGLTexture::RGBA_ASTC_8x8:
+ case QOpenGLTexture::RGBA_ASTC_10x5:
+ case QOpenGLTexture::RGBA_ASTC_10x6:
+ case QOpenGLTexture::RGBA_ASTC_10x8:
+ case QOpenGLTexture::RGBA_ASTC_10x10:
+ case QOpenGLTexture::RGBA_ASTC_12x10:
+ case QOpenGLTexture::RGBA_ASTC_12x12:
+ case QOpenGLTexture::SRGB8_Alpha8_ASTC_4x4:
+ case QOpenGLTexture::SRGB8_Alpha8_ASTC_5x4:
+ case QOpenGLTexture::SRGB8_Alpha8_ASTC_5x5:
+ case QOpenGLTexture::SRGB8_Alpha8_ASTC_6x5:
+ case QOpenGLTexture::SRGB8_Alpha8_ASTC_6x6:
+ case QOpenGLTexture::SRGB8_Alpha8_ASTC_8x5:
+ case QOpenGLTexture::SRGB8_Alpha8_ASTC_8x6:
+ case QOpenGLTexture::SRGB8_Alpha8_ASTC_8x8:
+ case QOpenGLTexture::SRGB8_Alpha8_ASTC_10x5:
+ case QOpenGLTexture::SRGB8_Alpha8_ASTC_10x6:
+ case QOpenGLTexture::SRGB8_Alpha8_ASTC_10x8:
+ case QOpenGLTexture::SRGB8_Alpha8_ASTC_10x10:
+ case QOpenGLTexture::SRGB8_Alpha8_ASTC_12x10:
+ case QOpenGLTexture::SRGB8_Alpha8_ASTC_12x12:
return QOpenGLTexture::UInt8;
case QOpenGLTexture::DepthFormat:
@@ -977,6 +1063,34 @@ static bool isCompressedFormat(QOpenGLTexture::TextureFormat internalFormat)
case QOpenGLTexture::RGBA8_ETC2_EAC:
case QOpenGLTexture::SRGB8_Alpha8_ETC2_EAC:
case QOpenGLTexture::RGB8_ETC1:
+ case QOpenGLTexture::RGBA_ASTC_4x4:
+ case QOpenGLTexture::RGBA_ASTC_5x4:
+ case QOpenGLTexture::RGBA_ASTC_5x5:
+ case QOpenGLTexture::RGBA_ASTC_6x5:
+ case QOpenGLTexture::RGBA_ASTC_6x6:
+ case QOpenGLTexture::RGBA_ASTC_8x5:
+ case QOpenGLTexture::RGBA_ASTC_8x6:
+ case QOpenGLTexture::RGBA_ASTC_8x8:
+ case QOpenGLTexture::RGBA_ASTC_10x5:
+ case QOpenGLTexture::RGBA_ASTC_10x6:
+ case QOpenGLTexture::RGBA_ASTC_10x8:
+ case QOpenGLTexture::RGBA_ASTC_10x10:
+ case QOpenGLTexture::RGBA_ASTC_12x10:
+ case QOpenGLTexture::RGBA_ASTC_12x12:
+ case QOpenGLTexture::SRGB8_Alpha8_ASTC_4x4:
+ case QOpenGLTexture::SRGB8_Alpha8_ASTC_5x4:
+ case QOpenGLTexture::SRGB8_Alpha8_ASTC_5x5:
+ case QOpenGLTexture::SRGB8_Alpha8_ASTC_6x5:
+ case QOpenGLTexture::SRGB8_Alpha8_ASTC_6x6:
+ case QOpenGLTexture::SRGB8_Alpha8_ASTC_8x5:
+ case QOpenGLTexture::SRGB8_Alpha8_ASTC_8x6:
+ case QOpenGLTexture::SRGB8_Alpha8_ASTC_8x8:
+ case QOpenGLTexture::SRGB8_Alpha8_ASTC_10x5:
+ case QOpenGLTexture::SRGB8_Alpha8_ASTC_10x6:
+ case QOpenGLTexture::SRGB8_Alpha8_ASTC_10x8:
+ case QOpenGLTexture::SRGB8_Alpha8_ASTC_10x10:
+ case QOpenGLTexture::SRGB8_Alpha8_ASTC_12x10:
+ case QOpenGLTexture::SRGB8_Alpha8_ASTC_12x12:
return true;
case QOpenGLTexture::DepthFormat:
@@ -2037,6 +2151,34 @@ QOpenGLTexture *QOpenGLTexturePrivate::createTextureView(QOpenGLTexture::Target
\value RGBA8_ETC2_EAC Equivalent to GL_COMPRESSED_RGBA8_ETC2_EAC
\value SRGB8_Alpha8_ETC2_EAC Equivalent to GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC
\value RGB8_ETC1 Equivalent to GL_ETC1_RGB8_OES
+ \value RGBA_ASTC_4x4 Equivalent to GL_COMPRESSED_RGBA_ASTC_4x4_KHR
+ \value RGBA_ASTC_5x4 Equivalent to GL_COMPRESSED_RGBA_ASTC_5x4_KHR
+ \value RGBA_ASTC_5x5 Equivalent to GL_COMPRESSED_RGBA_ASTC_5x5_KHR
+ \value RGBA_ASTC_6x5 Equivalent to GL_COMPRESSED_RGBA_ASTC_6x5_KHR
+ \value RGBA_ASTC_6x6 Equivalent to GL_COMPRESSED_RGBA_ASTC_6x6_KHR
+ \value RGBA_ASTC_8x5 Equivalent to GL_COMPRESSED_RGBA_ASTC_8x5_KHR
+ \value RGBA_ASTC_8x6 Equivalent to GL_COMPRESSED_RGBA_ASTC_8x6_KHR
+ \value RGBA_ASTC_8x8 Equivalent to GL_COMPRESSED_RGBA_ASTC_8x8_KHR
+ \value RGBA_ASTC_10x5 Equivalent to GL_COMPRESSED_RGBA_ASTC_10x5_KHR
+ \value RGBA_ASTC_10x6 Equivalent to GL_COMPRESSED_RGBA_ASTC_10x6_KHR
+ \value RGBA_ASTC_10x8 Equivalent to GL_COMPRESSED_RGBA_ASTC_10x8_KHR
+ \value RGBA_ASTC_10x10 Equivalent to GL_COMPRESSED_RGBA_ASTC_10x10_KHR
+ \value RGBA_ASTC_12x10 Equivalent to GL_COMPRESSED_RGBA_ASTC_12x10_KHR
+ \value RGBA_ASTC_12x12 Equivalent to GL_COMPRESSED_RGBA_ASTC_12x12_KHR
+ \value SRGB8_Alpha8_ASTC_4x4 Equivalent to GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR
+ \value SRGB8_Alpha8_ASTC_5x4 Equivalent to GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR
+ \value SRGB8_Alpha8_ASTC_5x5 Equivalent to GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR
+ \value SRGB8_Alpha8_ASTC_6x5 Equivalent to GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR
+ \value SRGB8_Alpha8_ASTC_6x6 Equivalent to GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR
+ \value SRGB8_Alpha8_ASTC_8x5 Equivalent to GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR
+ \value SRGB8_Alpha8_ASTC_8x6 Equivalent to GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR
+ \value SRGB8_Alpha8_ASTC_8x8 Equivalent to GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR
+ \value SRGB8_Alpha8_ASTC_10x5 Equivalent to GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR
+ \value SRGB8_Alpha8_ASTC_10x6 Equivalent to GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR
+ \value SRGB8_Alpha8_ASTC_10x8 Equivalent to GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR
+ \value SRGB8_Alpha8_ASTC_10x10 Equivalent to GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR
+ \value SRGB8_Alpha8_ASTC_12x10 Equivalent to GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR
+ \value SRGB8_Alpha8_ASTC_12x12 Equivalent to GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR
\value SRGB8 Equivalent to GL_SRGB8
\value SRGB8_Alpha8 Equivalent to GL_SRGB8_ALPHA8
@@ -2592,6 +2734,34 @@ void QOpenGLTexture::setFormat(TextureFormat format)
case RGBAFormat:
case LuminanceFormat:
case LuminanceAlphaFormat:
+ case QOpenGLTexture::RGBA_ASTC_4x4:
+ case QOpenGLTexture::RGBA_ASTC_5x4:
+ case QOpenGLTexture::RGBA_ASTC_5x5:
+ case QOpenGLTexture::RGBA_ASTC_6x5:
+ case QOpenGLTexture::RGBA_ASTC_6x6:
+ case QOpenGLTexture::RGBA_ASTC_8x5:
+ case QOpenGLTexture::RGBA_ASTC_8x6:
+ case QOpenGLTexture::RGBA_ASTC_8x8:
+ case QOpenGLTexture::RGBA_ASTC_10x5:
+ case QOpenGLTexture::RGBA_ASTC_10x6:
+ case QOpenGLTexture::RGBA_ASTC_10x8:
+ case QOpenGLTexture::RGBA_ASTC_10x10:
+ case QOpenGLTexture::RGBA_ASTC_12x10:
+ case QOpenGLTexture::RGBA_ASTC_12x12:
+ case QOpenGLTexture::SRGB8_Alpha8_ASTC_4x4:
+ case QOpenGLTexture::SRGB8_Alpha8_ASTC_5x4:
+ case QOpenGLTexture::SRGB8_Alpha8_ASTC_5x5:
+ case QOpenGLTexture::SRGB8_Alpha8_ASTC_6x5:
+ case QOpenGLTexture::SRGB8_Alpha8_ASTC_6x6:
+ case QOpenGLTexture::SRGB8_Alpha8_ASTC_8x5:
+ case QOpenGLTexture::SRGB8_Alpha8_ASTC_8x6:
+ case QOpenGLTexture::SRGB8_Alpha8_ASTC_8x8:
+ case QOpenGLTexture::SRGB8_Alpha8_ASTC_10x5:
+ case QOpenGLTexture::SRGB8_Alpha8_ASTC_10x6:
+ case QOpenGLTexture::SRGB8_Alpha8_ASTC_10x8:
+ case QOpenGLTexture::SRGB8_Alpha8_ASTC_10x10:
+ case QOpenGLTexture::SRGB8_Alpha8_ASTC_12x10:
+ case QOpenGLTexture::SRGB8_Alpha8_ASTC_12x12:
d->formatClass = FormatClass_Unique;
break;
}
diff --git a/src/gui/opengl/qopengltexture.h b/src/gui/opengl/qopengltexture.h
index 0a948488a6..d0a3bfec8b 100644
--- a/src/gui/opengl/qopengltexture.h
+++ b/src/gui/opengl/qopengltexture.h
@@ -208,6 +208,34 @@ public:
RGBA8_ETC2_EAC = 0x9278, // GL_COMPRESSED_RGBA8_ETC2_EAC
SRGB8_Alpha8_ETC2_EAC = 0x9279, // GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC
RGB8_ETC1 = 0x8D64, // GL_ETC1_RGB8_OES
+ RGBA_ASTC_4x4 = 0x93B0, // GL_COMPRESSED_RGBA_ASTC_4x4_KHR
+ RGBA_ASTC_5x4 = 0x93B1, // GL_COMPRESSED_RGBA_ASTC_5x4_KHR
+ RGBA_ASTC_5x5 = 0x93B2, // GL_COMPRESSED_RGBA_ASTC_5x5_KHR
+ RGBA_ASTC_6x5 = 0x93B3, // GL_COMPRESSED_RGBA_ASTC_6x5_KHR
+ RGBA_ASTC_6x6 = 0x93B4, // GL_COMPRESSED_RGBA_ASTC_6x6_KHR
+ RGBA_ASTC_8x5 = 0x93B5, // GL_COMPRESSED_RGBA_ASTC_8x5_KHR
+ RGBA_ASTC_8x6 = 0x93B6, // GL_COMPRESSED_RGBA_ASTC_8x6_KHR
+ RGBA_ASTC_8x8 = 0x93B7, // GL_COMPRESSED_RGBA_ASTC_8x8_KHR
+ RGBA_ASTC_10x5 = 0x93B8, // GL_COMPRESSED_RGBA_ASTC_10x5_KHR
+ RGBA_ASTC_10x6 = 0x93B9, // GL_COMPRESSED_RGBA_ASTC_10x6_KHR
+ RGBA_ASTC_10x8 = 0x93BA, // GL_COMPRESSED_RGBA_ASTC_10x8_KHR
+ RGBA_ASTC_10x10 = 0x93BB, // GL_COMPRESSED_RGBA_ASTC_10x10_KHR
+ RGBA_ASTC_12x10 = 0x93BC, // GL_COMPRESSED_RGBA_ASTC_12x10_KHR
+ RGBA_ASTC_12x12 = 0x93BD, // GL_COMPRESSED_RGBA_ASTC_12x12_KHR
+ SRGB8_Alpha8_ASTC_4x4 = 0x93D0, // GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR
+ SRGB8_Alpha8_ASTC_5x4 = 0x93D1, // GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR
+ SRGB8_Alpha8_ASTC_5x5 = 0x93D2, // GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR
+ SRGB8_Alpha8_ASTC_6x5 = 0x93D3, // GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR
+ SRGB8_Alpha8_ASTC_6x6 = 0x93D4, // GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR
+ SRGB8_Alpha8_ASTC_8x5 = 0x93D5, // GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR
+ SRGB8_Alpha8_ASTC_8x6 = 0x93D6, // GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR
+ SRGB8_Alpha8_ASTC_8x8 = 0x93D7, // GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR
+ SRGB8_Alpha8_ASTC_10x5 = 0x93D8, // GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR
+ SRGB8_Alpha8_ASTC_10x6 = 0x93D9, // GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR
+ SRGB8_Alpha8_ASTC_10x8 = 0x93DA, // GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR
+ SRGB8_Alpha8_ASTC_10x10 = 0x93DB, // GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR
+ SRGB8_Alpha8_ASTC_12x10 = 0x93DC, // GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR
+ SRGB8_Alpha8_ASTC_12x12 = 0x93DD, // GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR
// sRGB formats
SRGB8 = 0x8C41, // GL_SRGB8
diff --git a/src/gui/painting/qblendfunctions.cpp b/src/gui/painting/qblendfunctions.cpp
index 0a5d458532..a4a091a29f 100644
--- a/src/gui/painting/qblendfunctions.cpp
+++ b/src/gui/painting/qblendfunctions.cpp
@@ -385,19 +385,25 @@ void qt_blend_rgb32_on_rgb32(uchar *destPixels, int dbpl,
destPixels, dbpl, srcPixels, sbpl, w, h, const_alpha);
fflush(stdout);
#endif
-
- if (const_alpha != 256) {
- qt_blend_argb32_on_argb32(destPixels, dbpl, srcPixels, sbpl, w, h, const_alpha);
- return;
- }
-
const uint *src = (const uint *) srcPixels;
uint *dst = (uint *) destPixels;
- int len = w * 4;
- for (int y=0; y<h; ++y) {
- memcpy(dst, src, len);
- dst = (quint32 *)(((uchar *) dst) + dbpl);
- src = (const quint32 *)(((const uchar *) src) + sbpl);
+ if (const_alpha == 256) {
+ const int len = w * 4;
+ for (int y = 0; y < h; ++y) {
+ memcpy(dst, src, len);
+ dst = (quint32 *)(((uchar *) dst) + dbpl);
+ src = (const quint32 *)(((const uchar *) src) + sbpl);
+ }
+ return;
+ } else if (const_alpha != 0) {
+ const_alpha = (const_alpha * 255) >> 8;
+ int ialpha = 255 - const_alpha;
+ for (int y=0; y<h; ++y) {
+ for (int x=0; x<w; ++x)
+ dst[x] = INTERPOLATE_PIXEL_255(dst[x], ialpha, src[x], const_alpha);
+ dst = (quint32 *)(((uchar *) dst) + dbpl);
+ src = (const quint32 *)(((const uchar *) src) + sbpl);
+ }
}
}
@@ -414,7 +420,7 @@ struct Blend_RGB32_on_RGB32_ConstAlpha {
}
inline void write(quint32 *dst, quint32 src) {
- *dst = BYTE_MUL(src, m_alpha) + BYTE_MUL(*dst, m_ialpha);
+ *dst = INTERPOLATE_PIXEL_255(src, m_alpha, *dst, m_ialpha);
}
inline void flush(void *) {}
diff --git a/src/gui/painting/qcolor.cpp b/src/gui/painting/qcolor.cpp
index e3dbf663e1..6a8091bf8b 100644
--- a/src/gui/painting/qcolor.cpp
+++ b/src/gui/painting/qcolor.cpp
@@ -795,12 +795,20 @@ QColor::QColor(Spec spec) Q_DECL_NOTHROW
/*!
\fn QColor::QColor(const char *name)
+
+ Constructs a named color in the same way as setNamedColor() using
+ the given \a name.
+
\overload
\sa setNamedColor(), name(), isValid()
*/
/*!
\fn QColor::QColor(QLatin1String name)
+
+ Constructs a named color in the same way as setNamedColor() using
+ the given \a name.
+
\overload
\since 5.8
\sa setNamedColor(), name(), isValid()
diff --git a/src/gui/painting/qcoregraphics.mm b/src/gui/painting/qcoregraphics.mm
index a29d60ca6e..bf0be7f3d3 100644
--- a/src/gui/painting/qcoregraphics.mm
+++ b/src/gui/painting/qcoregraphics.mm
@@ -147,13 +147,16 @@ NSImage *qt_mac_create_nsimage(const QPixmap &pm)
return nsImage;
}
-NSImage *qt_mac_create_nsimage(const QIcon &icon)
+NSImage *qt_mac_create_nsimage(const QIcon &icon, int defaultSize)
{
if (icon.isNull())
return nil;
NSImage *nsImage = [[NSImage alloc] init];
- foreach (QSize size, icon.availableSizes()) {
+ QList<QSize> availableSizes = icon.availableSizes();
+ if (availableSizes.isEmpty() && defaultSize > 0)
+ availableSizes << QSize(defaultSize, defaultSize);
+ foreach (QSize size, availableSizes) {
QPixmap pm = icon.pixmap(size);
QImage image = pm.toImage();
CGImageRef cgImage = qt_mac_toCGImage(image);
diff --git a/src/gui/painting/qcoregraphics_p.h b/src/gui/painting/qcoregraphics_p.h
index ab2579387e..065910222d 100644
--- a/src/gui/painting/qcoregraphics_p.h
+++ b/src/gui/painting/qcoregraphics_p.h
@@ -58,7 +58,7 @@ QT_BEGIN_NAMESPACE
#ifdef Q_OS_MACOS
Q_GUI_EXPORT NSImage *qt_mac_create_nsimage(const QPixmap &pm);
-Q_GUI_EXPORT NSImage *qt_mac_create_nsimage(const QIcon &icon);
+Q_GUI_EXPORT NSImage *qt_mac_create_nsimage(const QIcon &icon, int defaultSize = 0);
Q_GUI_EXPORT QPixmap qt_mac_toQPixmap(const NSImage *image, const QSizeF &size);
#endif
Q_GUI_EXPORT CGImageRef qt_mac_toCGImage(const QImage &qImage);
diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp
index ae62aeca5f..08f96bd654 100644
--- a/src/gui/painting/qdrawhelper.cpp
+++ b/src/gui/painting/qdrawhelper.cpp
@@ -218,8 +218,8 @@ static const QRgba64 *QT_FASTCALL convertToRGB64(QRgba64 *buffer, const uint *sr
uint green = (src[i] >> greenShift<Format>()) & greenMask;
uint blue = (src[i] >> blueShift<Format>()) & blueMask;
- red = ((red << redLeftShift) | (red >> redRightShift)) << 16;
- green = ((green << greenLeftShift) | (green >> greenRightShift)) << 8;
+ red = ((red << redLeftShift) | (red >> redRightShift));
+ green = ((green << greenLeftShift) | (green >> greenRightShift));
blue = (blue << blueLeftShift) | (blue >> blueRightShift);
buffer[i] = QRgba64::fromRgba(red, green, blue, 255);
}
@@ -581,6 +581,8 @@ static inline void qConvertARGB32PMToARGB64PM_sse2(QRgba64 *buffer, const uint *
int i = 0;
for (; ((uintptr_t)buffer & 0xf) && i < count; ++i) {
uint s = *src++;
+ if (maskAlpha)
+ s = s | 0xff000000;
if (RGBA)
s = RGBA2ARGB(s);
*buffer++ = QRgba64::fromArgb32(s);
@@ -606,6 +608,8 @@ static inline void qConvertARGB32PMToARGB64PM_sse2(QRgba64 *buffer, const uint *
SIMD_EPILOGUE(i, count, 3) {
uint s = *src++;
+ if (maskAlpha)
+ s = s | 0xff000000;
if (RGBA)
s = RGBA2ARGB(s);
*buffer++ = QRgba64::fromArgb32(s);
@@ -837,7 +841,10 @@ static const uint *QT_FASTCALL convertGrayscale8FromARGB32PM(uint *buffer, const
}
template <QPixelLayout::BPP bpp> static
-uint QT_FASTCALL fetchPixel(const uchar *src, int index);
+uint QT_FASTCALL fetchPixel(const uchar *, int)
+{
+ Q_UNREACHABLE();
+}
template <>
inline uint QT_FASTCALL fetchPixel<QPixelLayout::BPP1LSB>(const uchar *src, int index)
@@ -1555,102 +1562,28 @@ static const QRgba64 *QT_FASTCALL fetchUntransformed64(QRgba64 *buffer, const Op
}
}
-// blendType is either BlendTransformed or BlendTransformedTiled
-template<TextureBlendType blendType>
-static const uint *QT_FASTCALL fetchTransformedARGB32PM(uint *buffer, const Operator *, const QSpanData *data,
- int y, int x, int length)
-{
- int image_width = data->texture.width;
- int image_height = data->texture.height;
-
- const qreal cx = x + qreal(0.5);
- const qreal cy = y + qreal(0.5);
-
- const uint *end = buffer + length;
- uint *b = buffer;
- if (data->fast_matrix) {
- // The increment pr x in the scanline
- int fdx = (int)(data->m11 * fixed_scale);
- int fdy = (int)(data->m12 * fixed_scale);
-
- int fx = int((data->m21 * cy
- + data->m11 * cx + data->dx) * fixed_scale);
- int fy = int((data->m22 * cy
- + data->m12 * cx + data->dy) * fixed_scale);
-
- while (b < end) {
- int px = fx >> 16;
- int py = fy >> 16;
-
- if (blendType == BlendTransformedTiled) {
- px %= image_width;
- py %= image_height;
- if (px < 0) px += image_width;
- if (py < 0) py += image_height;
- } else {
- px = qBound(0, px, image_width - 1);
- py = qBound(0, py, image_height - 1);
- }
- *b = reinterpret_cast<const uint *>(data->texture.scanLine(py))[px];
-
- fx += fdx;
- fy += fdy;
- ++b;
- }
- } else {
- const qreal fdx = data->m11;
- const qreal fdy = data->m12;
- const qreal fdw = data->m13;
-
- qreal fx = data->m21 * cy + data->m11 * cx + data->dx;
- qreal fy = data->m22 * cy + data->m12 * cx + data->dy;
- qreal fw = data->m23 * cy + data->m13 * cx + data->m33;
-
- while (b < end) {
- const qreal iw = fw == 0 ? 1 : 1 / fw;
- const qreal tx = fx * iw;
- const qreal ty = fy * iw;
- int px = int(tx) - (tx < 0);
- int py = int(ty) - (ty < 0);
-
- if (blendType == BlendTransformedTiled) {
- px %= image_width;
- py %= image_height;
- if (px < 0) px += image_width;
- if (py < 0) py += image_height;
- } else {
- px = qBound(0, px, image_width - 1);
- py = qBound(0, py, image_height - 1);
- }
- *b = reinterpret_cast<const uint *>(data->texture.scanLine(py))[px];
-
- fx += fdx;
- fy += fdy;
- fw += fdw;
- //force increment to avoid /0
- if (!fw) {
- fw += fdw;
- }
- ++b;
- }
- }
- return buffer;
-}
-
-template<TextureBlendType blendType> /* either BlendTransformed or BlendTransformedTiled */
+template<TextureBlendType blendType, QPixelLayout::BPP bpp>
static const uint *QT_FASTCALL fetchTransformed(uint *buffer, const Operator *, const QSpanData *data,
int y, int x, int length)
{
- int image_width = data->texture.width;
- int image_height = data->texture.height;
+ Q_STATIC_ASSERT(blendType == BlendTransformed || blendType == BlendTransformedTiled);
+ const int image_width = data->texture.width;
+ const int image_height = data->texture.height;
+ const int image_x1 = data->texture.x1;
+ const int image_y1 = data->texture.y1;
+ const int image_x2 = data->texture.x2 - 1;
+ const int image_y2 = data->texture.y2 - 1;
const qreal cx = x + qreal(0.5);
const qreal cy = y + qreal(0.5);
const QPixelLayout *layout = &qPixelLayouts[data->texture.format];
- FetchPixelFunc fetch = qFetchPixel[layout->bpp];
+ if (bpp != QPixelLayout::BPPNone) // Like this to not ICE on GCC 5.3.1
+ Q_ASSERT(layout->bpp == bpp);
+ // When templated 'fetch' should be inlined at compile time:
+ const FetchPixelFunc fetch = (bpp == QPixelLayout::BPPNone) ? qFetchPixel[layout->bpp] : fetchPixel<bpp>;
- const uint *end = buffer + length;
+ uint *const end = buffer + length;
uint *b = buffer;
if (data->fast_matrix) {
// The increment pr x in the scanline
@@ -1672,8 +1605,8 @@ static const uint *QT_FASTCALL fetchTransformed(uint *buffer, const Operator *,
if (px < 0) px += image_width;
if (py < 0) py += image_height;
} else {
- px = qBound(0, px, image_width - 1);
- py = qBound(0, py, image_height - 1);
+ px = qBound(image_x1, px, image_x2);
+ py = qBound(image_y1, py, image_y2);
}
*b = fetch(data->texture.scanLine(py), px);
@@ -1703,8 +1636,8 @@ static const uint *QT_FASTCALL fetchTransformed(uint *buffer, const Operator *,
if (px < 0) px += image_width;
if (py < 0) py += image_height;
} else {
- px = qBound(0, px, image_width - 1);
- py = qBound(0, py, image_height - 1);
+ px = qBound(image_x1, px, image_x2);
+ py = qBound(image_y1, py, image_y2);
}
*b = fetch(data->texture.scanLine(py), px);
@@ -1725,8 +1658,12 @@ template<TextureBlendType blendType> /* either BlendTransformed or BlendTransfo
static const QRgba64 *QT_FASTCALL fetchTransformed64(QRgba64 *buffer, const Operator *, const QSpanData *data,
int y, int x, int length)
{
- int image_width = data->texture.width;
- int image_height = data->texture.height;
+ const int image_width = data->texture.width;
+ const int image_height = data->texture.height;
+ const int image_x1 = data->texture.x1;
+ const int image_y1 = data->texture.y1;
+ const int image_x2 = data->texture.x2 - 1;
+ const int image_y2 = data->texture.y2 - 1;
const qreal cx = x + qreal(0.5);
const qreal cy = y + qreal(0.5);
@@ -1763,8 +1700,8 @@ static const QRgba64 *QT_FASTCALL fetchTransformed64(QRgba64 *buffer, const Oper
if (px < 0) px += image_width;
if (py < 0) py += image_height;
} else {
- px = qBound(0, px, image_width - 1);
- py = qBound(0, py, image_height - 1);
+ px = qBound(image_x1, px, image_x2);
+ py = qBound(image_y1, py, image_y2);
}
buffer32[j] = fetch(data->texture.scanLine(py), px);
@@ -1804,8 +1741,8 @@ static const QRgba64 *QT_FASTCALL fetchTransformed64(QRgba64 *buffer, const Oper
if (px < 0) px += image_width;
if (py < 0) py += image_height;
} else {
- px = qBound(0, px, image_width - 1);
- py = qBound(0, py, image_height - 1);
+ px = qBound(image_x1, px, image_x2);
+ py = qBound(image_y1, py, image_y2);
}
buffer32[j] = fetch(data->texture.scanLine(py), px);
@@ -2307,7 +2244,7 @@ static const uint * QT_FASTCALL fetchTransformedBilinearARGB32PM(uint *buffer, c
}
}
} else { //rotation
- if (std::abs(data->m11) > 8 || std::abs(data->m22) > 8) {
+ if (std::abs(data->m11) < (1./8.) || std::abs(data->m22) < (1./8.)) {
//if we are zooming more than 8 times, we use 8bit precision for the position.
while (b < end) {
int x1 = (fx >> 16);
@@ -2586,12 +2523,17 @@ static const uint * QT_FASTCALL fetchTransformedBilinearARGB32PM(uint *buffer, c
}
// blendType = BlendTransformedBilinear or BlendTransformedBilinearTiled
-template<TextureBlendType blendType>
+template<TextureBlendType blendType, QPixelLayout::BPP bpp>
static const uint *QT_FASTCALL fetchTransformedBilinear(uint *buffer, const Operator *,
const QSpanData *data, int y, int x, int length)
{
const QPixelLayout *layout = &qPixelLayouts[data->texture.format];
const QVector<QRgb> *clut = data->texture.colorTable;
+ if (bpp != QPixelLayout::BPPNone) // Like this to not ICE on GCC 5.3.1
+ Q_ASSERT(layout->bpp == bpp);
+ // When templated 'fetch' should be inlined at compile time:
+ const FetchPixelsFunc fetch = (bpp == QPixelLayout::BPPNone) ? qFetchPixels[layout->bpp] : fetchPixels<bpp>;
+ const FetchPixelFunc fetch1 = (bpp == QPixelLayout::BPPNone) ? qFetchPixel[layout->bpp] : fetchPixel<bpp>;
int image_width = data->texture.width;
int image_height = data->texture.height;
@@ -2629,7 +2571,6 @@ static const uint *QT_FASTCALL fetchTransformedBilinear(uint *buffer, const Oper
// The idea is first to do the interpolation between the row s1 and the row s2
// into an intermediate buffer, then we interpolate between two pixel of this buffer.
- FetchPixelsFunc fetch = qFetchPixels[layout->bpp];
// +1 for the last pixel to interpolate with, and +1 for rounding errors.
uint buf1[buffer_size + 2];
uint buf2[buffer_size + 2];
@@ -2718,7 +2659,6 @@ static const uint *QT_FASTCALL fetchTransformedBilinear(uint *buffer, const Oper
fx += fdx;
}
} else {
- FetchPixelFunc fetch = qFetchPixel[layout->bpp];
uint buf1[buffer_size];
uint buf2[buffer_size];
uint *b = buffer;
@@ -2729,19 +2669,10 @@ static const uint *QT_FASTCALL fetchTransformedBilinear(uint *buffer, const Oper
int x1 = (fx >> 16);
int x2;
fetchTransformedBilinear_pixelBounds<blendType>(image_width, image_x1, image_x2, x1, x2);
-
- if (layout->bpp == QPixelLayout::BPP32) {
- buf1[i * 2 + 0] = ((const uint*)s1)[x1];
- buf1[i * 2 + 1] = ((const uint*)s1)[x2];
- buf2[i * 2 + 0] = ((const uint*)s2)[x1];
- buf2[i * 2 + 1] = ((const uint*)s2)[x2];
- } else {
- buf1[i * 2 + 0] = fetch(s1, x1);
- buf1[i * 2 + 1] = fetch(s1, x2);
- buf2[i * 2 + 0] = fetch(s2, x1);
- buf2[i * 2 + 1] = fetch(s2, x2);
- }
-
+ buf1[i * 2 + 0] = fetch1(s1, x1);
+ buf1[i * 2 + 1] = fetch1(s1, x2);
+ buf2[i * 2 + 0] = fetch1(s2, x1);
+ buf2[i * 2 + 1] = fetch1(s2, x2);
fx += fdx;
}
layout->convertToARGB32PM(buf1, buf1, len * 2, clut, 0);
@@ -2771,7 +2702,6 @@ static const uint *QT_FASTCALL fetchTransformedBilinear(uint *buffer, const Oper
}
}
} else { //rotation
- FetchPixelFunc fetch = qFetchPixel[layout->bpp];
uint buf1[buffer_size];
uint buf2[buffer_size];
uint *b = buffer;
@@ -2790,26 +2720,17 @@ static const uint *QT_FASTCALL fetchTransformedBilinear(uint *buffer, const Oper
const uchar *s1 = data->texture.scanLine(y1);
const uchar *s2 = data->texture.scanLine(y2);
-
- if (layout->bpp == QPixelLayout::BPP32) {
- buf1[i * 2 + 0] = ((const uint*)s1)[x1];
- buf1[i * 2 + 1] = ((const uint*)s1)[x2];
- buf2[i * 2 + 0] = ((const uint*)s2)[x1];
- buf2[i * 2 + 1] = ((const uint*)s2)[x2];
- } else {
- buf1[i * 2 + 0] = fetch(s1, x1);
- buf1[i * 2 + 1] = fetch(s1, x2);
- buf2[i * 2 + 0] = fetch(s2, x1);
- buf2[i * 2 + 1] = fetch(s2, x2);
- }
-
+ buf1[i * 2 + 0] = fetch1(s1, x1);
+ buf1[i * 2 + 1] = fetch1(s1, x2);
+ buf2[i * 2 + 0] = fetch1(s2, x1);
+ buf2[i * 2 + 1] = fetch1(s2, x2);
fx += fdx;
fy += fdy;
}
layout->convertToARGB32PM(buf1, buf1, len * 2, clut, 0);
layout->convertToARGB32PM(buf2, buf2, len * 2, clut, 0);
- if (std::abs(data->m11) > 8 || std::abs(data->m22) > 8) {
+ if (std::abs(data->m11) < (1./8.) || std::abs(data->m22) < (1./8.)) {
//if we are zooming more than 8 times, we use 8bit precision for the position.
for (int i = 0; i < len; ++i) {
int distx = (fracX & 0x0000ffff) >> 8;
@@ -2849,7 +2770,6 @@ static const uint *QT_FASTCALL fetchTransformedBilinear(uint *buffer, const Oper
qreal fy = data->m22 * cy + data->m12 * cx + data->dy;
qreal fw = data->m23 * cy + data->m13 * cx + data->m33;
- FetchPixelFunc fetch = qFetchPixel[layout->bpp];
uint buf1[buffer_size];
uint buf2[buffer_size];
uint *b = buffer;
@@ -2877,18 +2797,10 @@ static const uint *QT_FASTCALL fetchTransformedBilinear(uint *buffer, const Oper
const uchar *s1 = data->texture.scanLine(y1);
const uchar *s2 = data->texture.scanLine(y2);
-
- if (layout->bpp == QPixelLayout::BPP32) {
- buf1[i * 2 + 0] = ((const uint*)s1)[x1];
- buf1[i * 2 + 1] = ((const uint*)s1)[x2];
- buf2[i * 2 + 0] = ((const uint*)s2)[x1];
- buf2[i * 2 + 1] = ((const uint*)s2)[x2];
- } else {
- buf1[i * 2 + 0] = fetch(s1, x1);
- buf1[i * 2 + 1] = fetch(s1, x2);
- buf2[i * 2 + 0] = fetch(s2, x1);
- buf2[i * 2 + 1] = fetch(s2, x2);
- }
+ buf1[i * 2 + 0] = fetch1(s1, x1);
+ buf1[i * 2 + 1] = fetch1(s1, x2);
+ buf2[i * 2 + 0] = fetch1(s2, x1);
+ buf2[i * 2 + 1] = fetch1(s2, x2);
fx += fdx;
fy += fdy;
@@ -3294,23 +3206,32 @@ static SourceFetchProc sourceFetchUntransformed[QImage::NImageFormats] = {
};
static const SourceFetchProc sourceFetchGeneric[NBlendTypes] = {
- fetchUntransformed, // Untransformed
- fetchUntransformed, // Tiled
- fetchTransformed<BlendTransformed>, // Transformed
- fetchTransformed<BlendTransformedTiled>, // TransformedTiled
- fetchTransformedBilinear<BlendTransformedBilinear>, // Bilinear
- fetchTransformedBilinear<BlendTransformedBilinearTiled> // BilinearTiled
+ fetchUntransformed, // Untransformed
+ fetchUntransformed, // Tiled
+ fetchTransformed<BlendTransformed, QPixelLayout::BPPNone>, // Transformed
+ fetchTransformed<BlendTransformedTiled, QPixelLayout::BPPNone>, // TransformedTiled
+ fetchTransformedBilinear<BlendTransformedBilinear, QPixelLayout::BPPNone>, // TransformedBilinear
+ fetchTransformedBilinear<BlendTransformedBilinearTiled, QPixelLayout::BPPNone> // TransformedBilinearTiled
};
static SourceFetchProc sourceFetchARGB32PM[NBlendTypes] = {
fetchUntransformedARGB32PM, // Untransformed
fetchUntransformedARGB32PM, // Tiled
- fetchTransformedARGB32PM<BlendTransformed>, // Transformed
- fetchTransformedARGB32PM<BlendTransformedTiled>, // TransformedTiled
+ fetchTransformed<BlendTransformed, QPixelLayout::BPP32>, // Transformed
+ fetchTransformed<BlendTransformedTiled, QPixelLayout::BPP32>, // TransformedTiled
fetchTransformedBilinearARGB32PM<BlendTransformedBilinear>, // Bilinear
fetchTransformedBilinearARGB32PM<BlendTransformedBilinearTiled> // BilinearTiled
};
+static SourceFetchProc sourceFetchAny32[NBlendTypes] = {
+ fetchUntransformed, // Untransformed
+ fetchUntransformed, // Tiled
+ fetchTransformed<BlendTransformed, QPixelLayout::BPP32>, // Transformed
+ fetchTransformed<BlendTransformedTiled, QPixelLayout::BPP32>, // TransformedTiled
+ fetchTransformedBilinear<BlendTransformedBilinear, QPixelLayout::BPP32>, // TransformedBilinear
+ fetchTransformedBilinear<BlendTransformedBilinearTiled, QPixelLayout::BPP32> // TransformedBilinearTiled
+};
+
static const SourceFetchProc64 sourceFetchGeneric64[NBlendTypes] = {
fetchUntransformed64, // Untransformed
fetchUntransformed64, // Tiled
@@ -3326,6 +3247,8 @@ static inline SourceFetchProc getSourceFetch(TextureBlendType blendType, QImage:
return sourceFetchARGB32PM[blendType];
if (blendType == BlendUntransformed || blendType == BlendTiled)
return sourceFetchUntransformed[format];
+ if (qPixelLayouts[format].bpp == QPixelLayout::BPP32)
+ return sourceFetchAny32[blendType];
return sourceFetchGeneric[blendType];
}
@@ -4718,8 +4641,10 @@ static void blend_transformed_argb(int count, const QSpan *spans, void *userData
CompositionFunction func = functionForMode[data->rasterBuffer->compositionMode];
uint buffer[buffer_size];
- int image_width = data->texture.width;
- int image_height = data->texture.height;
+ const int image_x1 = data->texture.x1;
+ const int image_y1 = data->texture.y1;
+ const int image_x2 = data->texture.x2 - 1;
+ const int image_y2 = data->texture.y2 - 1;
if (data->fast_matrix) {
// The increment pr x in the scanline
@@ -4746,8 +4671,8 @@ static void blend_transformed_argb(int count, const QSpan *spans, void *userData
const uint *end = buffer + l;
uint *b = buffer;
while (b < end) {
- int px = qBound(0, x >> 16, image_width - 1);
- int py = qBound(0, y >> 16, image_height - 1);
+ int px = qBound(image_x1, x >> 16, image_x2);
+ int py = qBound(image_y1, y >> 16, image_y2);
*b = reinterpret_cast<const uint *>(data->texture.scanLine(py))[px];
x += fdx;
@@ -4786,8 +4711,8 @@ static void blend_transformed_argb(int count, const QSpan *spans, void *userData
const qreal iw = w == 0 ? 1 : 1 / w;
const qreal tx = x * iw;
const qreal ty = y * iw;
- const int px = qBound(0, int(tx) - (tx < 0), image_width - 1);
- const int py = qBound(0, int(ty) - (ty < 0), image_height - 1);
+ const int px = qBound(image_x1, int(tx) - (tx < 0), image_x2);
+ const int py = qBound(image_y1, int(ty) - (ty < 0), image_y2);
*b = reinterpret_cast<const uint *>(data->texture.scanLine(py))[px];
x += fdx;
@@ -4819,8 +4744,10 @@ static void blend_transformed_rgb565(int count, const QSpan *spans, void *userDa
}
quint16 buffer[buffer_size];
- const int image_width = data->texture.width;
- const int image_height = data->texture.height;
+ const int image_x1 = data->texture.x1;
+ const int image_y1 = data->texture.y1;
+ const int image_x2 = data->texture.x2 - 1;
+ const int image_y2 = data->texture.y2 - 1;
if (data->fast_matrix) {
// The increment pr x in the scanline
@@ -4858,8 +4785,8 @@ static void blend_transformed_rgb565(int count, const QSpan *spans, void *userDa
const quint16 *end = b + l;
while (b < end) {
- const int px = qBound(0, x >> 16, image_width - 1);
- const int py = qBound(0, y >> 16, image_height - 1);
+ const int px = qBound(image_x1, x >> 16, image_x2);
+ const int py = qBound(image_y1, y >> 16, image_y2);
*b = ((const quint16 *)data->texture.scanLine(py))[px];
++b;
@@ -4917,8 +4844,8 @@ static void blend_transformed_rgb565(int count, const QSpan *spans, void *userDa
const qreal tx = x * iw;
const qreal ty = y * iw;
- const int px = qBound(0, int(tx) - (tx < 0), image_width - 1);
- const int py = qBound(0, int(ty) - (ty < 0), image_height - 1);
+ const int px = qBound(image_x1, int(tx) - (tx < 0), image_x2);
+ const int py = qBound(image_y1, int(ty) - (ty < 0), image_y2);
*b = ((const quint16 *)data->texture.scanLine(py))[px];
++b;
diff --git a/src/gui/painting/qdrawhelper_avx2.cpp b/src/gui/painting/qdrawhelper_avx2.cpp
index acc9bc7ba1..9c1335298e 100644
--- a/src/gui/painting/qdrawhelper_avx2.cpp
+++ b/src/gui/painting/qdrawhelper_avx2.cpp
@@ -267,11 +267,9 @@ void qt_blend_rgb32_on_rgb32_avx2(uchar *destPixels, int dbpl,
// 2) interpolate pixels with AVX2
for (; x < (w - 7); x += 8) {
const __m256i srcVector = _mm256_lddqu_si256((const __m256i *)&src[x]);
- if (!_mm256_testz_si256(srcVector, srcVector)) {
- __m256i dstVector = _mm256_load_si256((__m256i *)&dst[x]);
- INTERPOLATE_PIXEL_255_AVX2(srcVector, dstVector, constAlphaVector, oneMinusConstAlpha, colorMask, half);
- _mm256_store_si256((__m256i *)&dst[x], dstVector);
- }
+ __m256i dstVector = _mm256_load_si256((__m256i *)&dst[x]);
+ INTERPOLATE_PIXEL_255_AVX2(srcVector, dstVector, constAlphaVector, oneMinusConstAlpha, colorMask, half);
+ _mm256_store_si256((__m256i *)&dst[x], dstVector);
}
// 3) Epilogue
diff --git a/src/gui/painting/qdrawhelper_neon.cpp b/src/gui/painting/qdrawhelper_neon.cpp
index d51b43961c..a833520b00 100644
--- a/src/gui/painting/qdrawhelper_neon.cpp
+++ b/src/gui/painting/qdrawhelper_neon.cpp
@@ -523,8 +523,6 @@ void qt_blend_rgb32_on_rgb32_neon(uchar *destPixels, int dbpl,
vst1q_u32((uint32_t *)&dst[x], vcombine_u32(result32_low, result32_high));
}
for (; x<w; ++x) {
- uint s = src[x];
- s = BYTE_MUL(s, const_alpha);
dst[x] = INTERPOLATE_PIXEL_255(src[x], const_alpha, dst[x], one_minus_const_alpha);
}
dst = (quint32 *)(((uchar *) dst) + dbpl);
diff --git a/src/gui/painting/qdrawhelper_sse2.cpp b/src/gui/painting/qdrawhelper_sse2.cpp
index 5ff08e8153..edce70d2d0 100644
--- a/src/gui/painting/qdrawhelper_sse2.cpp
+++ b/src/gui/painting/qdrawhelper_sse2.cpp
@@ -101,7 +101,6 @@ void qt_blend_rgb32_on_rgb32_sse2(uchar *destPixels, int dbpl,
quint32 *dst = (quint32 *) destPixels;
if (const_alpha != 256) {
if (const_alpha != 0) {
- const __m128i nullVector = _mm_set1_epi32(0);
const __m128i half = _mm_set1_epi16(0x80);
const __m128i colorMask = _mm_set1_epi32(0x00ff00ff);
@@ -119,12 +118,10 @@ void qt_blend_rgb32_on_rgb32_sse2(uchar *destPixels, int dbpl,
for (; x < w-3; x += 4) {
__m128i srcVector = _mm_loadu_si128((const __m128i *)&src[x]);
- if (_mm_movemask_epi8(_mm_cmpeq_epi32(srcVector, nullVector)) != 0xffff) {
- const __m128i dstVector = _mm_load_si128((__m128i *)&dst[x]);
- __m128i result;
- INTERPOLATE_PIXEL_255_SSE2(result, srcVector, dstVector, constAlphaVector, oneMinusConstAlpha, colorMask, half);
- _mm_store_si128((__m128i *)&dst[x], result);
- }
+ const __m128i dstVector = _mm_load_si128((__m128i *)&dst[x]);
+ __m128i result;
+ INTERPOLATE_PIXEL_255_SSE2(result, srcVector, dstVector, constAlphaVector, oneMinusConstAlpha, colorMask, half);
+ _mm_store_si128((__m128i *)&dst[x], result);
}
SIMD_EPILOGUE(x, w, 3)
dst[x] = INTERPOLATE_PIXEL_255(src[x], const_alpha, dst[x], one_minus_const_alpha);
diff --git a/src/gui/text/qcssparser.cpp b/src/gui/text/qcssparser.cpp
index 31d832a9ce..a0438bd458 100644
--- a/src/gui/text/qcssparser.cpp
+++ b/src/gui/text/qcssparser.cpp
@@ -2211,6 +2211,7 @@ void Parser::init(const QString &css, bool isFile)
bool Parser::parse(StyleSheet *styleSheet, Qt::CaseSensitivity nameCaseSensitivity)
{
if (testTokenAndEndsWith(ATKEYWORD_SYM, QLatin1String("charset"))) {
+ while (test(S) || test(CDO) || test(CDC)) {}
if (!next(STRING)) return false;
if (!next(SEMICOLON)) return false;
}
diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp
index d2da24ca94..43648d0f7f 100644
--- a/src/gui/text/qfontdatabase.cpp
+++ b/src/gui/text/qfontdatabase.cpp
@@ -406,9 +406,14 @@ QtFontFoundry *QtFontFamily::foundry(const QString &f, bool create)
return foundries[count++];
}
+static inline bool equalsCaseInsensitive(const QString &a, const QString &b)
+{
+ return a.size() == b.size() && a.compare(b, Qt::CaseInsensitive) == 0;
+}
+
bool QtFontFamily::matchesFamilyName(const QString &familyName) const
{
- return name.compare(familyName, Qt::CaseInsensitive) == 0 || aliases.contains(familyName, Qt::CaseInsensitive);
+ return equalsCaseInsensitive(name, familyName) || aliases.contains(familyName, Qt::CaseInsensitive);
}
void QtFontFamily::ensurePopulated()
@@ -947,8 +952,8 @@ QFontEngine *loadSingleEngine(int script,
return 0;
}
+ engine->isSmoothlyScalable = style->smoothScalable;
fontCache->insertEngine(key, engine);
-
return engine;
}
}
@@ -973,6 +978,7 @@ QFontEngine *loadSingleEngine(int script,
return 0;
}
+ engine->isSmoothlyScalable = style->smoothScalable;
fontCache->insertEngine(key, engine);
if (Q_LIKELY(cacheForCommonScript && !engine->symbol)) {
diff --git a/src/gui/text/qfontengine.cpp b/src/gui/text/qfontengine.cpp
index 74ea8d15b7..0b2972f189 100644
--- a/src/gui/text/qfontengine.cpp
+++ b/src/gui/text/qfontengine.cpp
@@ -53,7 +53,7 @@
#include <qendian.h>
#include <private/qstringiterator_p.h>
-#ifdef QT_ENABLE_HARFBUZZ_NG
+#if QT_CONFIG(harfbuzz)
# include "qharfbuzzng_p.h"
# include <harfbuzz/hb-ot.h>
#endif
@@ -93,7 +93,7 @@ static inline bool qSafeFromBigEndian(const uchar *source, const uchar *end, T *
// Harfbuzz helper functions
-#ifdef QT_ENABLE_HARFBUZZ_NG
+#if QT_CONFIG(harfbuzz)
Q_GLOBAL_STATIC_WITH_ARGS(bool, useHarfbuzzNG,(qgetenv("QT_HARFBUZZ") != "old"))
bool qt_useHarfbuzzNG()
@@ -257,6 +257,7 @@ QFontEngine::QFontEngine(Type type)
cache_cost = 0;
fsType = 0;
symbol = false;
+ isSmoothlyScalable = false;
glyphFormat = Format_None;
m_subPixelPositionCount = 0;
@@ -296,7 +297,7 @@ QFixed QFontEngine::underlinePosition() const
void *QFontEngine::harfbuzzFont() const
{
Q_ASSERT(type() != QFontEngine::Multi);
-#ifdef QT_ENABLE_HARFBUZZ_NG
+#if QT_CONFIG(harfbuzz)
if (qt_useHarfbuzzNG())
return hb_qt_font_get_for_engine(const_cast<QFontEngine *>(this));
#endif
@@ -331,7 +332,7 @@ void *QFontEngine::harfbuzzFont() const
void *QFontEngine::harfbuzzFace() const
{
Q_ASSERT(type() != QFontEngine::Multi);
-#ifdef QT_ENABLE_HARFBUZZ_NG
+#if QT_CONFIG(harfbuzz)
if (qt_useHarfbuzzNG())
return hb_qt_face_get_for_engine(const_cast<QFontEngine *>(this));
#endif
@@ -363,7 +364,7 @@ bool QFontEngine::supportsScript(QChar::Script script) const
return true;
}
-#ifdef QT_ENABLE_HARFBUZZ_NG
+#if QT_CONFIG(harfbuzz)
if (qt_useHarfbuzzNG()) {
#if defined(Q_OS_DARWIN)
// in AAT fonts, 'gsub' table is effectively replaced by 'mort'/'morx' table
diff --git a/src/gui/text/qfontengine_p.h b/src/gui/text/qfontengine_p.h
index 42610e9b70..c0e350f755 100644
--- a/src/gui/text/qfontengine_p.h
+++ b/src/gui/text/qfontengine_p.h
@@ -325,6 +325,7 @@ public:
uint cache_cost; // amount of mem used in bytes by the font
uint fsType : 16;
bool symbol;
+ bool isSmoothlyScalable;
struct KernPair {
uint left_right;
QFixed adjust;
diff --git a/src/gui/text/qharfbuzzng_p.h b/src/gui/text/qharfbuzzng_p.h
index 95a21eedb6..fabf222bae 100644
--- a/src/gui/text/qharfbuzzng_p.h
+++ b/src/gui/text/qharfbuzzng_p.h
@@ -53,6 +53,9 @@
//
#include <QtGui/private/qtguiglobal_p.h>
+
+QT_REQUIRE_CONFIG(harfbuzz);
+
#include <QtCore/qchar.h>
#include <harfbuzz/hb.h>
diff --git a/src/gui/text/qinputcontrol.cpp b/src/gui/text/qinputcontrol.cpp
new file mode 100644
index 0000000000..c2c198866a
--- /dev/null
+++ b/src/gui/text/qinputcontrol.cpp
@@ -0,0 +1,82 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE: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 "qinputcontrol_p.h"
+#include <QtGui/qevent.h>
+
+QT_BEGIN_NAMESPACE
+
+QInputControl::QInputControl(Type type, QObject *parent)
+ : QObject(parent)
+ , m_type(type)
+{
+}
+
+QInputControl::QInputControl(Type type, QObjectPrivate &dd, QObject *parent)
+ : QObject(dd, parent)
+ , m_type(type)
+{
+}
+
+bool QInputControl::isAcceptableInput(const QKeyEvent *event) const
+{
+ const QString text = event->text();
+ if (text.isEmpty())
+ return false;
+
+ const QChar c = text.at(0);
+
+ // ZWNJ and ZWJ. This needs to go before the next test, since CTRL+SHIFT is
+ // used to input it on Windows.
+ if (c == QChar(0x200C) || c == QChar(0x200D))
+ return true;
+
+ // QTBUG-35734: ignore Ctrl/Ctrl+Shift; accept only AltGr (Alt+Ctrl) on German keyboards
+ if (event->modifiers() == Qt::ControlModifier
+ || event->modifiers() == (Qt::ShiftModifier | Qt::ControlModifier)) {
+ return false;
+ }
+
+ if (c.isPrint())
+ return true;
+
+ if (c.category() == QChar::Other_PrivateUse)
+ return true;
+
+ if (m_type == TextEdit && c == QLatin1Char('\t'))
+ return true;
+
+ return false;
+}
+
+QT_END_NAMESPACE
diff --git a/src/gui/text/qinputcontrol_p.h b/src/gui/text/qinputcontrol_p.h
new file mode 100644
index 0000000000..3b46067ba9
--- /dev/null
+++ b/src/gui/text/qinputcontrol_p.h
@@ -0,0 +1,76 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE: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 QINPUTCONTROL_P_H
+#define QINPUTCONTROL_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.
+//
+
+#include <QtCore/qobject.h>
+#include <qtguiglobal.h>
+
+QT_BEGIN_NAMESPACE
+
+class QKeyEvent;
+class Q_GUI_EXPORT QInputControl : public QObject
+{
+ Q_OBJECT
+public:
+ enum Type {
+ LineEdit,
+ TextEdit
+ };
+
+ explicit QInputControl(Type type, QObject *parent = nullptr);
+
+ bool isAcceptableInput(const QKeyEvent *event) const;
+
+protected:
+ explicit QInputControl(Type type, QObjectPrivate &dd, QObject *parent = nullptr);
+
+private:
+ const Type m_type;
+};
+
+QT_END_NAMESPACE
+
+#endif // QINPUTCONTROL_P_H
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp
index 742b01dd1f..67cafa53fe 100644
--- a/src/gui/text/qtextengine.cpp
+++ b/src/gui/text/qtextengine.cpp
@@ -37,6 +37,7 @@
**
****************************************************************************/
+#include <QtGui/private/qtguiglobal_p.h>
#include "qdebug.h"
#include "qtextformat.h"
#include "qtextformat_p.h"
@@ -837,7 +838,7 @@ enum JustificationClass {
Justification_Arabic_Kashida = 13 // User-inserted Kashida(U+0640)
};
-#ifdef QT_ENABLE_HARFBUZZ_NG
+#if QT_CONFIG(harfbuzz)
/*
Adds an inter character justification opportunity after the number or letter
@@ -916,7 +917,7 @@ static inline void qt_getJustificationOpportunities(const ushort *string, int le
qt_getDefaultJustificationOpportunities(string, length, g, log_clusters, spaceAs);
}
-#endif // QT_ENABLE_HARFBUZZ_NG
+#endif // harfbuzz
// shape all the items that intersect with the line, taking tab widths into account to find out what text actually fits in the line.
@@ -950,7 +951,7 @@ void QTextEngine::shapeLine(const QScriptLine &line)
}
}
-#ifdef QT_ENABLE_HARFBUZZ_NG
+#if QT_CONFIG(harfbuzz)
extern bool qt_useHarfbuzzNG(); // defined in qfontengine.cpp
#endif
@@ -1063,7 +1064,7 @@ void QTextEngine::shapeText(int item) const
letterSpacing *= font.d->dpi / qt_defaultDpiY();
}
-#ifdef QT_ENABLE_HARFBUZZ_NG
+#if QT_CONFIG(harfbuzz)
if (Q_LIKELY(qt_useHarfbuzzNG()))
si.num_glyphs = shapeTextWithHarfbuzzNG(si, string, itemLength, fontEngine, itemBoundaries, kerningEnabled, letterSpacing != 0);
else
@@ -1079,7 +1080,7 @@ void QTextEngine::shapeText(int item) const
QGlyphLayout glyphs = shapedGlyphs(&si);
-#ifdef QT_ENABLE_HARFBUZZ_NG
+#if QT_CONFIG(harfbuzz)
if (Q_LIKELY(qt_useHarfbuzzNG()))
qt_getJustificationOpportunities(string, itemLength, si, glyphs, logClusters(&si));
#endif
@@ -1119,7 +1120,7 @@ void QTextEngine::shapeText(int item) const
si.width += glyphs.advances[i] * !glyphs.attributes[i].dontPrint;
}
-#ifdef QT_ENABLE_HARFBUZZ_NG
+#if QT_CONFIG(harfbuzz)
QT_BEGIN_INCLUDE_NAMESPACE
@@ -1313,7 +1314,7 @@ int QTextEngine::shapeTextWithHarfbuzzNG(const QScriptItem &si,
return glyphs_shaped;
}
-#endif // QT_ENABLE_HARFBUZZ_NG
+#endif // harfbuzz
QT_BEGIN_INCLUDE_NAMESPACE
@@ -1669,7 +1670,7 @@ void QTextEngine::itemize() const
analysis->flags = QScriptAnalysis::None;
break;
}
-#ifndef QT_ENABLE_HARFBUZZ_NG
+#if !QT_CONFIG(harfbuzz)
analysis->script = hbscript_to_script(script_to_hbscript(analysis->script));
#endif
++uc;
@@ -1678,7 +1679,7 @@ void QTextEngine::itemize() const
if (option.flags() & QTextOption::ShowLineAndParagraphSeparators) {
(analysis-1)->flags = QScriptAnalysis::LineOrParagraphSeparator; // to exclude it from width
}
-#ifdef QT_ENABLE_HARFBUZZ_NG
+#if QT_CONFIG(harfbuzz)
analysis = scriptAnalysis.data();
if (qt_useHarfbuzzNG()) {
// ### pretend HB-old behavior for now
diff --git a/src/gui/text/qtextengine_p.h b/src/gui/text/qtextengine_p.h
index 160e9ce490..f49e2638f5 100644
--- a/src/gui/text/qtextengine_p.h
+++ b/src/gui/text/qtextengine_p.h
@@ -649,7 +649,7 @@ private:
void setBoundary(int strPos) const;
void addRequiredBoundaries() const;
void shapeText(int item) const;
-#ifdef QT_ENABLE_HARFBUZZ_NG
+#if QT_CONFIG(harfbuzz)
int shapeTextWithHarfbuzzNG(const QScriptItem &si,
const ushort *string,
int itemLength,
diff --git a/src/gui/text/text.pri b/src/gui/text/text.pri
index a15793ec2f..abe20abe02 100644
--- a/src/gui/text/text.pri
+++ b/src/gui/text/text.pri
@@ -39,7 +39,8 @@ HEADERS += \
text/qrawfont_p.h \
text/qglyphrun.h \
text/qglyphrun_p.h \
- text/qdistancefield_p.h
+ text/qdistancefield_p.h \
+ text/qinputcontrol_p.h
SOURCES += \
text/qfont.cpp \
@@ -69,7 +70,8 @@ SOURCES += \
text/qstatictext.cpp \
text/qrawfont.cpp \
text/qglyphrun.cpp \
- text/qdistancefield.cpp
+ text/qdistancefield.cpp \
+ text/qinputcontrol.cpp
SOURCES += \
text/qfontengine_qpf2.cpp \
@@ -78,9 +80,7 @@ SOURCES += \
HEADERS += \
text/qplatformfontdatabase.h
-qtConfig(harfbuzz)|qtConfig(system-harfbuzz) {
- DEFINES += QT_ENABLE_HARFBUZZ_NG
-
+qtConfig(harfbuzz) {
QMAKE_USE_PRIVATE += harfbuzz
SOURCES += text/qharfbuzzng.cpp
diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp
index 246b9a7bad..6d5b2400f1 100644
--- a/src/network/access/qnetworkaccessmanager.cpp
+++ b/src/network/access/qnetworkaccessmanager.cpp
@@ -1654,7 +1654,7 @@ void QNetworkAccessManagerPrivate::_q_networkSessionClosed()
QObject::disconnect(networkSession.data(), SIGNAL(closed()), q, SLOT(_q_networkSessionClosed()));
QObject::disconnect(networkSession.data(), SIGNAL(stateChanged(QNetworkSession::State)),
q, SLOT(_q_networkSessionStateChanged(QNetworkSession::State)));
- QObject::disconnect(networkSessionStrongRef.data(), SIGNAL(error(QNetworkSession::SessionError)),
+ QObject::disconnect(networkSession.data(), SIGNAL(error(QNetworkSession::SessionError)),
q, SLOT(_q_networkSessionFailed(QNetworkSession::SessionError)));
networkSessionStrongRef.clear();
diff --git a/src/network/configure.json b/src/network/configure.json
index 30a1c39c0c..1e08aa7c49 100644
--- a/src/network/configure.json
+++ b/src/network/configure.json
@@ -207,12 +207,14 @@
"label": "QNetworkProxy",
"purpose": "Provides network proxy support.",
"section": "Networking",
+ "condition": "!config.winrt",
"output": [ "publicFeature", "feature" ]
},
"socks5": {
"label": "SOCKS5",
"purpose": "Provides SOCKS5 support in QNetworkProxy.",
"section": "Networking",
+ "condition": "!config.winrt",
"output": [ "publicFeature", "feature" ]
},
"networkinterface": {
diff --git a/src/network/kernel/qnetworkproxy.cpp b/src/network/kernel/qnetworkproxy.cpp
index 94719e9c2d..0be8a7f79e 100644
--- a/src/network/kernel/qnetworkproxy.cpp
+++ b/src/network/kernel/qnetworkproxy.cpp
@@ -82,7 +82,9 @@
\section1 SOCKS5
- The SOCKS5 support in Qt 4 is based on \l{http://www.rfc-editor.org/rfc/rfc1928.txt}{RFC 1928} and \l{http://www.rfc-editor.org/rfc/rfc1929.txt}{RFC 1929}.
+ The SOCKS5 support since Qt 4 is based on
+ \l{http://www.rfc-editor.org/rfc/rfc1928.txt}{RFC 1928} and
+ \l{http://www.rfc-editor.org/rfc/rfc1929.txt}{RFC 1929}.
The supported authentication methods are no authentication and
username/password authentication. Both IPv4 and IPv6 are
supported. Domain names are resolved through the SOCKS5 server if
@@ -1515,8 +1517,8 @@ bool QNetworkProxyFactory::usesSystemConfiguration()
Enables the use of the platform-specific proxy settings, and only those.
See systemProxyForQuery() for more information.
- Calling setUseSystemConfiguration(\c{true}) will reset any proxy or
- QNetworkProxyFactory already set.
+ Calling this function with \a enable set to \c true resets any proxy
+ or QNetworkProxyFactory that is already set.
\note See the systemProxyForQuery() documentation for a list of
limitations related to the use of system proxies.
diff --git a/src/network/socket/qabstractsocket.cpp b/src/network/socket/qabstractsocket.cpp
index 6b773e2be9..271b5848c5 100644
--- a/src/network/socket/qabstractsocket.cpp
+++ b/src/network/socket/qabstractsocket.cpp
@@ -1112,10 +1112,15 @@ void QAbstractSocketPrivate::_q_connectToNextAddress()
// Tries to connect to the address. If it succeeds immediately
// (localhost address on BSD or any UDP connect), emit
// connected() and return.
- if (socketEngine->connectToHost(host, port)) {
- //_q_testConnection();
- fetchConnectionParameters();
- return;
+ if (
+#if defined(Q_OS_WINRT) && _MSC_VER >= 1900
+ !qEnvironmentVariableIsEmpty("QT_WINRT_USE_THREAD_NETWORK_CONTEXT") ?
+ socketEngine->connectToHostByName(hostName, port) :
+#endif
+ socketEngine->connectToHost(host, port)) {
+ //_q_testConnection();
+ fetchConnectionParameters();
+ return;
}
// Check that we're in delayed connection state. If not, try
diff --git a/src/network/socket/qabstractsocket_p.h b/src/network/socket/qabstractsocket_p.h
index 1578d7bb35..8a96cb9d48 100644
--- a/src/network/socket/qabstractsocket_p.h
+++ b/src/network/socket/qabstractsocket_p.h
@@ -72,13 +72,13 @@ public:
virtual ~QAbstractSocketPrivate();
// from QAbstractSocketEngineReceiver
- inline void readNotification() { canReadNotification(); }
- inline void writeNotification() { canWriteNotification(); }
- inline void exceptionNotification() {}
- inline void closeNotification() { canCloseNotification(); }
- void connectionNotification();
+ inline void readNotification() override { canReadNotification(); }
+ inline void writeNotification() override { canWriteNotification(); }
+ inline void exceptionNotification() override {}
+ inline void closeNotification() override { canCloseNotification(); }
+ void connectionNotification() override;
#ifndef QT_NO_NETWORKPROXY
- inline void proxyAuthenticationRequired(const QNetworkProxy &proxy, QAuthenticator *authenticator) {
+ inline void proxyAuthenticationRequired(const QNetworkProxy &proxy, QAuthenticator *authenticator) override {
Q_Q(QAbstractSocket);
q->proxyAuthenticationRequired(proxy, authenticator);
}
diff --git a/src/network/socket/qlocalsocket_p.h b/src/network/socket/qlocalsocket_p.h
index 560d74328e..9da37d2af3 100644
--- a/src/network/socket/qlocalsocket_p.h
+++ b/src/network/socket/qlocalsocket_p.h
@@ -99,12 +99,12 @@ public:
QTcpSocket::setSocketError(error);
}
- inline qint64 readData(char *data, qint64 maxSize)
+ inline qint64 readData(char *data, qint64 maxSize) override
{
return QTcpSocket::readData(data, maxSize);
}
- inline qint64 writeData(const char *data, qint64 maxSize)
+ inline qint64 writeData(const char *data, qint64 maxSize) override
{
return QTcpSocket::writeData(data, maxSize);
}
diff --git a/src/network/socket/qnativesocketengine.cpp b/src/network/socket/qnativesocketengine.cpp
index 11d19682d8..928c7fc68f 100644
--- a/src/network/socket/qnativesocketengine.cpp
+++ b/src/network/socket/qnativesocketengine.cpp
@@ -1230,7 +1230,7 @@ public:
{ engine = parent; }
protected:
- bool event(QEvent *);
+ bool event(QEvent *) override;
QNativeSocketEngine *engine;
};
@@ -1262,7 +1262,7 @@ public:
: QSocketNotifier(fd, QSocketNotifier::Write, parent) { engine = parent; }
protected:
- bool event(QEvent *);
+ bool event(QEvent *) override;
QNativeSocketEngine *engine;
};
@@ -1286,7 +1286,7 @@ public:
: QSocketNotifier(fd, QSocketNotifier::Exception, parent) { engine = parent; }
protected:
- bool event(QEvent *);
+ bool event(QEvent *) override;
QNativeSocketEngine *engine;
};
diff --git a/src/network/socket/qnativesocketengine_winrt.cpp b/src/network/socket/qnativesocketengine_winrt.cpp
index 3daca38959..8257eec9ea 100644
--- a/src/network/socket/qnativesocketengine_winrt.cpp
+++ b/src/network/socket/qnativesocketengine_winrt.cpp
@@ -75,6 +75,9 @@ using namespace ABI::Windows::Storage::Streams;
using namespace ABI::Windows::Networking;
using namespace ABI::Windows::Networking::Connectivity;
using namespace ABI::Windows::Networking::Sockets;
+#if _MSC_VER >= 1900
+using namespace ABI::Windows::Security::EnterpriseData;
+#endif
typedef ITypedEventHandler<StreamSocketListener *, StreamSocketListenerConnectionReceivedEventArgs *> ClientConnectedHandler;
typedef ITypedEventHandler<DatagramSocket *, DatagramSocketMessageReceivedEventArgs *> DatagramReceivedHandler;
@@ -84,6 +87,45 @@ typedef IAsyncOperationWithProgress<IBuffer *, UINT32> IAsyncBufferOperation;
QT_BEGIN_NAMESPACE
+#if _MSC_VER >= 1900
+static HRESULT qt_winrt_try_create_thread_network_context(QString host, ComPtr<IThreadNetworkContext> &context)
+{
+ HRESULT hr;
+ ComPtr<IProtectionPolicyManagerStatics> protectionPolicyManager;
+
+ hr = GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Security_EnterpriseData_ProtectionPolicyManager).Get(),
+ &protectionPolicyManager);
+ RETURN_HR_IF_FAILED("Could not access ProtectionPolicyManager statics.");
+
+ ComPtr<IHostNameFactory> hostNameFactory;
+ hr = GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Networking_HostName).Get(),
+ &hostNameFactory);
+ RETURN_HR_IF_FAILED("Could not access HostName factory.");
+
+ ComPtr<IHostName> hostName;
+ HStringReference hostRef(reinterpret_cast<LPCWSTR>(host.utf16()), host.length());
+ hr = hostNameFactory->CreateHostName(hostRef.Get(), &hostName);
+ RETURN_HR_IF_FAILED("Could not create hostname.");
+
+ ComPtr<IAsyncOperation<HSTRING>> op;
+ hr = protectionPolicyManager->GetPrimaryManagedIdentityForNetworkEndpointAsync(hostName.Get(), &op);
+ RETURN_HR_IF_FAILED("Could not get identity operation.");
+
+ HSTRING hIdentity;
+ hr = QWinRTFunctions::await(op, &hIdentity);
+ RETURN_HR_IF_FAILED("Could not wait for identity operation.");
+
+ // Implies there is no need for a network context for this address
+ if (hIdentity == nullptr)
+ return S_OK;
+
+ hr = protectionPolicyManager->CreateCurrentThreadNetworkContext(hIdentity, &context);
+ RETURN_HR_IF_FAILED("Could not create thread network context");
+
+ return S_OK;
+}
+#endif // _MSC_VER >= 1900
+
static inline QString qt_QStringFromHString(const HString &string)
{
UINT32 length;
@@ -316,25 +358,23 @@ bool QNativeSocketEngine::initialize(qintptr socketDescriptor, QAbstractSocket::
// Start processing incoming data
if (d->socketType == QAbstractSocket::TcpSocket) {
- HRESULT hr;
- QEventDispatcherWinRT::runOnXamlThread([&hr, socket, socketState, this]() {
- Q_D(QNativeSocketEngine);
+ HRESULT hr = QEventDispatcherWinRT::runOnXamlThread([d, socket, socketState, this]() {
ComPtr<IBuffer> buffer;
HRESULT hr = g->bufferFactory->Create(READ_BUFFER_SIZE, &buffer);
- RETURN_OK_IF_FAILED("initialize(): Could not create buffer");
+ RETURN_HR_IF_FAILED("initialize(): Could not create buffer");
ComPtr<IInputStream> stream;
hr = socket->get_InputStream(&stream);
- RETURN_OK_IF_FAILED("initialize(): Could not obtain input stream");
+ RETURN_HR_IF_FAILED("initialize(): Could not obtain input stream");
ComPtr<IAsyncBufferOperation> readOp;
hr = stream->ReadAsync(buffer.Get(), READ_BUFFER_SIZE, InputStreamOptions_Partial, readOp.GetAddressOf());
- RETURN_OK_IF_FAILED_WITH_ARGS("initialize(): Failed to read from the socket buffer (%s).",
- socketDescription(this).constData());
+ RETURN_HR_IF_FAILED_WITH_ARGS("initialize(): Failed to read from the socket buffer (%s).",
+ socketDescription(this).constData());
QMutexLocker locker(&d->readOperationsMutex);
d->pendingReadOps.append(readOp);
d->socketState = socketState;
hr = readOp->put_Completed(Callback<SocketReadCompletedHandler>(d, &QNativeSocketEnginePrivate::handleReadyRead).Get());
- RETURN_OK_IF_FAILED_WITH_ARGS("initialize(): Failed to set socket read callback (%s).",
- socketDescription(this).constData());
+ RETURN_HR_IF_FAILED_WITH_ARGS("initialize(): Failed to set socket read callback (%s).",
+ socketDescription(this).constData());
return S_OK;
});
if (FAILED(hr))
@@ -367,9 +407,23 @@ bool QNativeSocketEngine::connectToHost(const QHostAddress &address, quint16 por
bool QNativeSocketEngine::connectToHostByName(const QString &name, quint16 port)
{
Q_D(QNativeSocketEngine);
+ HRESULT hr;
+
+#if _MSC_VER >= 1900
+ ComPtr<IThreadNetworkContext> networkContext;
+ if (!qEnvironmentVariableIsEmpty("QT_WINRT_USE_THREAD_NETWORK_CONTEXT")) {
+ hr = qt_winrt_try_create_thread_network_context(name, networkContext);
+ if (FAILED(hr)) {
+ setError(QAbstractSocket::ConnectionRefusedError, QLatin1String("Could not create thread network context."));
+ d->socketState = QAbstractSocket::ConnectedState;
+ return true;
+ }
+ }
+#endif // _MSC_VER >= 1900
+
HStringReference hostNameRef(reinterpret_cast<LPCWSTR>(name.utf16()));
ComPtr<IHostNameFactory> hostNameFactory;
- HRESULT hr = GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Networking_HostName).Get(),
+ hr = GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Networking_HostName).Get(),
&hostNameFactory);
Q_ASSERT_SUCCEEDED(hr);
ComPtr<IHostName> remoteHost;
@@ -390,6 +444,16 @@ bool QNativeSocketEngine::connectToHostByName(const QString &name, quint16 port)
}
Q_ASSERT_SUCCEEDED(hr);
+#if _MSC_VER >= 1900
+ if (networkContext != nullptr) {
+ ComPtr<IClosable> networkContextCloser;
+ hr = networkContext.As(&networkContextCloser);
+ Q_ASSERT_SUCCEEDED(hr);
+ hr = networkContextCloser->Close();
+ Q_ASSERT_SUCCEEDED(hr);
+ }
+#endif // _MSC_VER >= 1900
+
d->socketState = QAbstractSocket::ConnectingState;
QEventDispatcherWinRT::runOnXamlThread([d, &hr]() {
hr = d->connectOp->put_Completed(Callback<IAsyncActionCompletedHandler>(
diff --git a/src/network/socket/qsctpserver.cpp b/src/network/socket/qsctpserver.cpp
index 24f18e1ee8..77cb997192 100644
--- a/src/network/socket/qsctpserver.cpp
+++ b/src/network/socket/qsctpserver.cpp
@@ -60,7 +60,7 @@
The most common way to use QSctpServer is to construct an object
and set the maximum number of channels that the server is
- prepared to support, by calling setMaxChannelCount(). You can set
+ prepared to support, by calling setMaximumChannelCount(). You can set
the TCP emulation mode by passing a negative argument in this
call. Also, a special value of 0 (the default) indicates to use
the peer's value as the actual number of channels. The new incoming
@@ -102,7 +102,7 @@ QT_BEGIN_NAMESPACE
/*! \internal
*/
QSctpServerPrivate::QSctpServerPrivate()
- : maxChannelCount(0)
+ : maximumChannelCount(0)
{
}
@@ -119,7 +119,7 @@ void QSctpServerPrivate::configureCreatedSocket()
QTcpServerPrivate::configureCreatedSocket();
if (socketEngine)
socketEngine->setOption(QAbstractSocketEngine::MaxStreamsSocketOption,
- maxChannelCount == -1 ? 1 : maxChannelCount);
+ maximumChannelCount == -1 ? 1 : maximumChannelCount);
}
/*!
@@ -128,7 +128,7 @@ void QSctpServerPrivate::configureCreatedSocket()
Sets the datagram operation mode. The \a parent argument is passed
to QObject's constructor.
- \sa setMaxChannelCount(), listen(), setSocketDescriptor()
+ \sa setMaximumChannelCount(), listen(), setSocketDescriptor()
*/
QSctpServer::QSctpServer(QObject *parent)
: QTcpServer(QAbstractSocket::SctpSocket, *new QSctpServerPrivate, parent)
@@ -159,19 +159,19 @@ QSctpServer::~QSctpServer()
Call this method only when QSctpServer is in UnconnectedState.
- \sa maxChannelCount(), QSctpSocket
+ \sa maximumChannelCount(), QSctpSocket
*/
-void QSctpServer::setMaxChannelCount(int count)
+void QSctpServer::setMaximumChannelCount(int count)
{
Q_D(QSctpServer);
if (d->state != QAbstractSocket::UnconnectedState) {
- qWarning("QSctpServer::setMaxChannelCount() is only allowed in UnconnectedState");
+ qWarning("QSctpServer::setMaximumChannelCount() is only allowed in UnconnectedState");
return;
}
#if defined(QSCTPSERVER_DEBUG)
- qDebug("QSctpServer::setMaxChannelCount(%i)", count);
+ qDebug("QSctpServer::setMaximumChannelCount(%i)", count);
#endif
- d->maxChannelCount = count;
+ d->maximumChannelCount = count;
}
/*!
@@ -183,11 +183,11 @@ void QSctpServer::setMaxChannelCount(int count)
Returns -1, if QSctpServer running in TCP emulation mode.
- \sa setMaxChannelCount()
+ \sa setMaximumChannelCount()
*/
-int QSctpServer::maxChannelCount() const
+int QSctpServer::maximumChannelCount() const
{
- return d_func()->maxChannelCount;
+ return d_func()->maximumChannelCount;
}
/*! \reimp
@@ -199,7 +199,7 @@ void QSctpServer::incomingConnection(qintptr socketDescriptor)
#endif
QSctpSocket *socket = new QSctpSocket(this);
- socket->setMaxChannelCount(d_func()->maxChannelCount);
+ socket->setMaximumChannelCount(d_func()->maximumChannelCount);
socket->setSocketDescriptor(socketDescriptor);
addPendingConnection(socket);
}
@@ -234,7 +234,7 @@ QSctpSocket *QSctpServer::nextPendingDatagramConnection()
QSctpSocket *socket = qobject_cast<QSctpSocket *>(i.next());
Q_ASSERT(socket);
- if (socket->inDatagramMode()) {
+ if (socket->isInDatagramMode()) {
i.remove();
Q_ASSERT(d->socketEngine);
d->socketEngine->setReadNotificationEnabled(true);
diff --git a/src/network/socket/qsctpserver.h b/src/network/socket/qsctpserver.h
index fd2ed6f97f..1afdab28a0 100644
--- a/src/network/socket/qsctpserver.h
+++ b/src/network/socket/qsctpserver.h
@@ -57,8 +57,8 @@ public:
explicit QSctpServer(QObject *parent = nullptr);
virtual ~QSctpServer();
- void setMaxChannelCount(int count);
- int maxChannelCount() const;
+ void setMaximumChannelCount(int count);
+ int maximumChannelCount() const;
QSctpSocket *nextPendingDatagramConnection();
diff --git a/src/network/socket/qsctpserver_p.h b/src/network/socket/qsctpserver_p.h
index 32760caffe..274939fc3d 100644
--- a/src/network/socket/qsctpserver_p.h
+++ b/src/network/socket/qsctpserver_p.h
@@ -64,7 +64,7 @@ public:
QSctpServerPrivate();
virtual ~QSctpServerPrivate();
- int maxChannelCount;
+ int maximumChannelCount;
void configureCreatedSocket() Q_DECL_OVERRIDE;
};
diff --git a/src/network/socket/qsctpsocket.cpp b/src/network/socket/qsctpsocket.cpp
index cb07e80299..fe76f64c42 100644
--- a/src/network/socket/qsctpsocket.cpp
+++ b/src/network/socket/qsctpsocket.cpp
@@ -83,14 +83,14 @@
\endlist
To set a continuous byte stream mode, instantiate QSctpSocket and
- call setMaxChannelCount() with a negative value. This gives the
+ call setMaximumChannelCount() with a negative value. This gives the
ability to use QSctpSocket as a regular buffered QTcpSocket. You
can call connectToHost() to initiate connection with endpoint,
write() to transmit and read() to receive data from the peer, but
you cannot distinguish message boundaries.
By default, QSctpSocket operates in datagram mode. Before
- connecting, call setMaxChannelCount() to set the maximum number of
+ connecting, call setMaximumChannelCount() to set the maximum number of
channels that the application is prepared to support. This number
is a parameter negotiated with the remote endpoint and its value
can be bounded by the operating system. The default value of 0
@@ -130,7 +130,7 @@ QT_BEGIN_NAMESPACE
/*! \internal
*/
QSctpSocketPrivate::QSctpSocketPrivate()
- : maxChannelCount(0)
+ : maximumChannelCount(0)
{
}
@@ -150,7 +150,7 @@ bool QSctpSocketPrivate::canReadNotification()
#endif
// Handle TCP emulation mode in the base implementation.
- if (!q->inDatagramMode())
+ if (!q->isInDatagramMode())
return QTcpSocketPrivate::canReadNotification();
const int savedCurrentChannel = currentReadChannel;
@@ -248,7 +248,7 @@ bool QSctpSocketPrivate::writeToSocket()
#endif
// Handle TCP emulation mode in the base implementation.
- if (!q->inDatagramMode())
+ if (!q->isInDatagramMode())
return QTcpSocketPrivate::writeToSocket();
if (!socketEngine)
@@ -331,7 +331,7 @@ void QSctpSocketPrivate::configureCreatedSocket()
{
if (socketEngine)
socketEngine->setOption(QAbstractSocketEngine::MaxStreamsSocketOption,
- maxChannelCount < 0 ? 1 : maxChannelCount);
+ maximumChannelCount < 0 ? 1 : maximumChannelCount);
}
/*!
@@ -340,7 +340,7 @@ void QSctpSocketPrivate::configureCreatedSocket()
Sets the datagram operation mode. The \a parent argument is passed
to QObject's constructor.
- \sa socketType(), setMaxChannelCount()
+ \sa socketType(), setMaximumChannelCount()
*/
QSctpSocket::QSctpSocket(QObject *parent)
: QTcpSocket(SctpSocket, *new QSctpSocketPrivate, parent)
@@ -418,19 +418,19 @@ void QSctpSocket::disconnectFromHost()
Call this method only when QSctpSocket is in UnconnectedState.
- \sa maxChannelCount(), readChannelCount(), writeChannelCount()
+ \sa maximumChannelCount(), readChannelCount(), writeChannelCount()
*/
-void QSctpSocket::setMaxChannelCount(int count)
+void QSctpSocket::setMaximumChannelCount(int count)
{
Q_D(QSctpSocket);
if (d->state != QAbstractSocket::UnconnectedState) {
- qWarning("QSctpSocket::setMaxChannelCount() is only allowed in UnconnectedState");
+ qWarning("QSctpSocket::setMaximumChannelCount() is only allowed in UnconnectedState");
return;
}
#if defined(QSCTPSOCKET_DEBUG)
- qDebug("QSctpSocket::setMaxChannelCount(%i)", count);
+ qDebug("QSctpSocket::setMaximumChannelCount(%i)", count);
#endif
- d->maxChannelCount = qMax(count, -1);
+ d->maximumChannelCount = qMax(count, -1);
}
/*!
@@ -443,22 +443,22 @@ void QSctpSocket::setMaxChannelCount(int count)
Returns -1 if QSctpSocket is running in continuous byte stream
mode.
- \sa setMaxChannelCount(), readChannelCount(), writeChannelCount()
+ \sa setMaximumChannelCount(), readChannelCount(), writeChannelCount()
*/
-int QSctpSocket::maxChannelCount() const
+int QSctpSocket::maximumChannelCount() const
{
- return d_func()->maxChannelCount;
+ return d_func()->maximumChannelCount;
}
/*!
Returns \c true if the socket is running in datagram mode.
- \sa setMaxChannelCount()
+ \sa setMaximumChannelCount()
*/
-bool QSctpSocket::inDatagramMode() const
+bool QSctpSocket::isInDatagramMode() const
{
Q_D(const QSctpSocket);
- return d->maxChannelCount != -1 && d->isBuffered;
+ return d->maximumChannelCount != -1 && d->isBuffered;
}
/*!
@@ -471,13 +471,13 @@ bool QSctpSocket::inDatagramMode() const
On failure, returns a QNetworkDatagram that reports \l
{QNetworkDatagram::isValid()}{not valid}.
- \sa writeDatagram(), inDatagramMode(), currentReadChannel()
+ \sa writeDatagram(), isInDatagramMode(), currentReadChannel()
*/
QNetworkDatagram QSctpSocket::readDatagram()
{
Q_D(QSctpSocket);
- if (!isReadable() || !inDatagramMode()) {
+ if (!isReadable() || !isInDatagramMode()) {
qWarning("QSctpSocket::readDatagram(): operation is not permitted");
return QNetworkDatagram();
}
@@ -507,14 +507,14 @@ QNetworkDatagram QSctpSocket::readDatagram()
Writes a \a datagram to the buffer of the current write channel.
Returns true on success; otherwise returns false.
- \sa readDatagram(), inDatagramMode(), currentWriteChannel()
+ \sa readDatagram(), isInDatagramMode(), currentWriteChannel()
*/
bool QSctpSocket::writeDatagram(const QNetworkDatagram &datagram)
{
Q_D(QSctpSocket);
if (!isWritable() || d->state != QAbstractSocket::ConnectedState || !d->socketEngine
- || !d->socketEngine->isValid() || !inDatagramMode()) {
+ || !d->socketEngine->isValid() || !isInDatagramMode()) {
qWarning("QSctpSocket::writeDatagram(): operation is not permitted");
return false;
}
diff --git a/src/network/socket/qsctpsocket.h b/src/network/socket/qsctpsocket.h
index d5a1f21c04..9bed1890ff 100644
--- a/src/network/socket/qsctpsocket.h
+++ b/src/network/socket/qsctpsocket.h
@@ -59,9 +59,9 @@ public:
void close() Q_DECL_OVERRIDE;
void disconnectFromHost() Q_DECL_OVERRIDE;
- void setMaxChannelCount(int count);
- int maxChannelCount() const;
- bool inDatagramMode() const;
+ void setMaximumChannelCount(int count);
+ int maximumChannelCount() const;
+ bool isInDatagramMode() const;
QNetworkDatagram readDatagram();
bool writeDatagram(const QNetworkDatagram &datagram);
diff --git a/src/network/socket/qsctpsocket_p.h b/src/network/socket/qsctpsocket_p.h
index f38095330f..3f765ebed9 100644
--- a/src/network/socket/qsctpsocket_p.h
+++ b/src/network/socket/qsctpsocket_p.h
@@ -74,7 +74,7 @@ public:
bool writeToSocket() Q_DECL_OVERRIDE;
QByteArray incomingDatagram;
- int maxChannelCount;
+ int maximumChannelCount;
typedef std::deque<QIpPacketHeader> IpHeaderList;
QVector<IpHeaderList> readHeaders;
diff --git a/src/network/ssl/qsslsocket.cpp b/src/network/ssl/qsslsocket.cpp
index 29e1f32815..2fc779b257 100644
--- a/src/network/ssl/qsslsocket.cpp
+++ b/src/network/ssl/qsslsocket.cpp
@@ -2643,7 +2643,7 @@ bool QSslSocketPrivate::rootCertOnDemandLoadingSupported()
*/
QList<QByteArray> QSslSocketPrivate::unixRootCertDirectories()
{
- return QList<QByteArray>() << "/etc/ssl/certs/" // (K)ubuntu, OpenSUSE, Mandriva, MeeGo ...
+ return QList<QByteArray>() << "/etc/ssl/certs/" // (K)ubuntu, OpenSUSE, Mandriva ...
<< "/usr/lib/ssl/certs/" // Gentoo, Mandrake
<< "/usr/share/ssl/" // Centos, Redhat, SuSE
<< "/usr/local/ssl/" // Normal OpenSSL Tarball
diff --git a/src/opengl/gl2paintengineex/qglgradientcache_p.h b/src/opengl/gl2paintengineex/qglgradientcache_p.h
index 1333df316b..3c9da982e9 100644
--- a/src/opengl/gl2paintengineex/qglgradientcache_p.h
+++ b/src/opengl/gl2paintengineex/qglgradientcache_p.h
@@ -83,8 +83,8 @@ public:
GLuint getBuffer(const QGradient &gradient, qreal opacity);
inline int paletteSize() const { return 1024; }
- void invalidateResource();
- void freeResource(QOpenGLContext *ctx);
+ void invalidateResource() override;
+ void freeResource(QOpenGLContext *ctx) override;
private:
inline int maxCacheSize() const { return 60; }
diff --git a/src/opengl/gl2paintengineex/qglshadercache_meego_p.h b/src/opengl/gl2paintengineex/qglshadercache_meego_p.h
deleted file mode 100644
index de75d5ae8c..0000000000
--- a/src/opengl/gl2paintengineex/qglshadercache_meego_p.h
+++ /dev/null
@@ -1,450 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//
-// 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.
-//
-
-#ifndef QGLSHADERCACHE_MEEGO_P_H
-#define QGLSHADERCACHE_MEEGO_P_H
-
-#include <QtCore/qglobal.h>
-
-#if defined(QT_MEEGO_EXPERIMENTAL_SHADERCACHE) && defined(QT_OPENGL_ES_2)
-
-#include <QtCore/qcryptographichash.h>
-#include <QtCore/qsharedmemory.h>
-#include <QtCore/qsystemsemaphore.h>
-
-#ifndef QT_BOOTSTRAPPED
-# include <GLES2/gl2ext.h>
-#endif
-#if defined(QT_DEBUG) || defined(QT_MEEGO_EXPERIMENTAL_SHADERCACHE_TRACE)
-# include <syslog.h>
-#endif
-
-/*
- This cache stores internal Qt shader programs in shared memory.
-
- This header file is ugly on purpose and can only be included once. It is only to be used
- for the internal shader cache, not as a generic cache for anyone's shaders.
-
- The cache stores either ShaderCacheMaxEntries shader programs or ShaderCacheDataSize kilobytes
- of shader programs, whatever limit is reached first.
-
- The layout of the cache is as outlined in the CachedShaders struct. After some
- integers, an array of headers is reserved, then comes the space for the actual binaries.
-
- Shader Programs are identified by the md5sum of their frag and vertex shader source code.
-
- Shader Programs are never removed. The cache never shrinks or re-shuffles. This is done
- on purpose to ensure minimum amount of locking, no alignment problems and very few write
- operations.
-
- Note: Locking the shader cache could be expensive, because the entire system might hang.
- That's why the cache is immutable to minimize the time we need to keep it locked.
-
- Why is it Meego specific?
-
- First, the size is chosen so that it fits to generic meego usage. Second, on Meego, there's
- always at least one Qt application active (the launcher), so the cache will never be destroyed.
- Only when the last Qt app exits, the cache dies, which should only be when someone kills the
- X11 server. And last but not least it was only tested with Meego's SGX driver.
-
- There's a small tool in src/opengl/util/meego that dumps the contents of the cache.
- */
-
-// anonymous namespace, prevent exporting of the private symbols
-namespace
-{
-
-struct CachedShaderHeader
-{
- /* the index in the data[] member of CachedShaders */
- int index;
- /* the size of the binary shader */
- GLsizei size;
- /* the format of the binary shader */
- GLenum format;
- /* the md5sum of the frag+vertex shaders */
- char md5Sum[16];
-};
-
-enum
-{
- /* The maximum amount of shader programs the cache can hold */
- ShaderCacheMaxEntries = 20
-};
-
-typedef CachedShaderHeader CachedShaderHeaders[ShaderCacheMaxEntries];
-
-enum
-{
- // ShaderCacheDataSize is 20k minus the other data members of CachedShaders
- ShaderCacheDataSize = 1024 * ShaderCacheMaxEntries - sizeof(CachedShaderHeaders) - 2 * sizeof(int)
-};
-
-struct CachedShaders
-{
- /* How much space is still available in the cache */
- inline int availableSize() const { return ShaderCacheDataSize - dataSize; }
-
- /* The current amount of cached shaders */
- int shaderCount;
-
- /* The current amount (in bytes) of cached data */
- int dataSize;
-
- /* The headers describing the shaders */
- CachedShaderHeaders headers;
-
- /* The actual binary data of the shader programs */
- char data[ShaderCacheDataSize];
-};
-
-//#define QT_DEBUG_SHADER_CACHE
-#ifdef QT_DEBUG_SHADER_CACHE
-static QDebug shaderCacheDebug()
-{
- return QDebug(QtDebugMsg);
-}
-#else
-static inline QNoDebug shaderCacheDebug() { return QNoDebug(); }
-#endif
-
-class ShaderCacheSharedMemory
-{
-public:
- ShaderCacheSharedMemory()
- : shm(QLatin1String("qt_gles2_shadercache_" QT_VERSION_STR))
- {
- // we need a system semaphore here, since cache creation and initialization must be atomic
- QSystemSemaphore attachSemaphore(QLatin1String("qt_gles2_shadercache_mutex_" QT_VERSION_STR), 1);
-
- if (!attachSemaphore.acquire()) {
- shaderCacheDebug() << "Unable to require shader cache semaphore:" << attachSemaphore.errorString();
- return;
- }
-
- if (shm.attach()) {
- // success!
- shaderCacheDebug() << "Attached to shader cache";
- } else {
-
- // no cache exists - create and initialize it
- if (shm.create(sizeof(CachedShaders))) {
- shaderCacheDebug() << "Created new shader cache";
- initializeCache();
- } else {
- shaderCacheDebug() << "Unable to create shader cache:" << shm.errorString();
- }
- }
-
- attachSemaphore.release();
- }
-
- inline bool isAttached() const { return shm.isAttached(); }
-
- inline bool lock() { return shm.lock(); }
- inline bool unlock() { return shm.unlock(); }
- inline void *data() { return shm.data(); }
- inline QString errorString() { return shm.errorString(); }
-
- ~ShaderCacheSharedMemory()
- {
- if (!shm.detach())
- shaderCacheDebug() << "Unable to detach shader cache" << shm.errorString();
- }
-
-private:
- void initializeCache()
- {
- // no need to lock the shared memory since we're already protected by the
- // attach system semaphore.
-
- void *data = shm.data();
- Q_ASSERT(data);
-
- memset(data, 0, sizeof(CachedShaders));
- }
-
- QSharedMemory shm;
-};
-
-class ShaderCacheLocker
-{
-public:
- inline ShaderCacheLocker(ShaderCacheSharedMemory *cache)
- : shm(cache->lock() ? cache : (ShaderCacheSharedMemory *)0)
- {
- if (!shm)
- shaderCacheDebug() << "Unable to lock shader cache" << cache->errorString();
- }
-
- inline bool isLocked() const { return shm; }
-
- inline ~ShaderCacheLocker()
- {
- if (!shm)
- return;
- if (!shm->unlock())
- shaderCacheDebug() << "Unable to unlock shader cache" << shm->errorString();
- }
-
-private:
- ShaderCacheSharedMemory *shm;
-};
-
-#ifdef QT_BOOTSTRAPPED
-} // end namespace
-#else
-
-static void traceCacheOverflow(const char *message)
-{
-#if defined(QT_DEBUG) || defined (QT_MEEGO_EXPERIMENTAL_SHADERCACHE_TRACE)
- openlog(qPrintable(QCoreApplication::applicationName()), LOG_PID | LOG_ODELAY, LOG_USER);
- syslog(LOG_DEBUG, message);
- closelog();
-#endif
- shaderCacheDebug() << message;
-}
-
-Q_GLOBAL_STATIC(ShaderCacheSharedMemory, shaderCacheSharedMemory)
-
-/*
- Finds the index of the shader program identified by md5Sum in the cache.
- Note: Does NOT lock the cache for reading, the cache must already be locked!
-
- Returns -1 when no shader was found.
- */
-static int qt_cache_index_unlocked(const QByteArray &md5Sum, CachedShaders *cache)
-{
- for (int i = 0; i < cache->shaderCount; ++i) {
- if (qstrncmp(md5Sum.constData(), cache->headers[i].md5Sum, 16) == 0) {
- return i;
- }
- }
- return -1;
-}
-
-/* Returns the index of the shader identified by md5Sum */
-static int qt_cache_index(const QByteArray &md5Sum)
-{
- ShaderCacheSharedMemory *shm = shaderCacheSharedMemory();
- if (!shm || !shm->isAttached())
- return false;
-
- Q_ASSERT(md5Sum.length() == 16);
-
- ShaderCacheLocker locker(shm);
- if (!locker.isLocked())
- return false;
-
- void *data = shm->data();
- Q_ASSERT(data);
-
- CachedShaders *cache = reinterpret_cast<CachedShaders *>(data);
-
- return qt_cache_index_unlocked(md5Sum, cache);
-}
-
-/* Loads the cached shader at index \a shaderIndex into \a program
- * Note: Since the cache is immutable, this operation doesn't lock the shared memory.
- */
-static bool qt_cached_shader(QGLShaderProgram *program, const QGLContext *ctx, int shaderIndex)
-{
- Q_ASSERT(shaderIndex >= 0 && shaderIndex <= ShaderCacheMaxEntries);
- Q_ASSERT(program);
-
- ShaderCacheSharedMemory *shm = shaderCacheSharedMemory();
- if (!shm || !shm->isAttached())
- return false;
-
- void *data = shm->data();
- Q_ASSERT(data);
-
- CachedShaders *cache = reinterpret_cast<CachedShaders *>(data);
-
- shaderCacheDebug() << "fetching cached shader at index" << shaderIndex
- << "dataIndex" << cache->headers[shaderIndex].index
- << "size" << cache->headers[shaderIndex].size
- << "format" << cache->headers[shaderIndex].format;
-
- // call program->programId first, since that resolves the glProgramBinaryOES symbol
- GLuint programId = program->programId();
- glProgramBinaryOES(programId, cache->headers[shaderIndex].format,
- cache->data + cache->headers[shaderIndex].index,
- cache->headers[shaderIndex].size);
-
- return true;
-}
-
-/* Stores the shader program in the cache. Returns false if there's an error with the cache, or
- if the cache is too small to hold the shader. */
-static bool qt_cache_shader(const QGLShaderProgram *shader, const QGLContext *ctx, const QByteArray &md5Sum)
-{
- ShaderCacheSharedMemory *shm = shaderCacheSharedMemory();
- if (!shm || !shm->isAttached())
- return false;
-
- void *data = shm->data();
- Q_ASSERT(data);
-
- CachedShaders *cache = reinterpret_cast<CachedShaders *>(data);
-
- ShaderCacheLocker locker(shm);
- if (!locker.isLocked())
- return false;
-
- int cacheIdx = cache->shaderCount;
- if (cacheIdx >= ShaderCacheMaxEntries) {
- traceCacheOverflow("Qt OpenGL shader cache index overflow!");
- return false;
- }
-
- // now that we have the lock on the shared memory, make sure no one
- // inserted the shader already while we were unlocked
- if (qt_cache_index_unlocked(md5Sum, cache) != -1)
- return true; // already cached
-
- shaderCacheDebug() << "Caching shader at index" << cacheIdx;
-
- GLint binaryLength = 0;
- glGetProgramiv(shader->programId(), GL_PROGRAM_BINARY_LENGTH_OES, &binaryLength);
-
- if (!binaryLength) {
- shaderCacheDebug() << "Unable to determine binary shader size!";
- return false;
- }
-
- if (binaryLength > cache->availableSize()) {
- traceCacheOverflow("Qt OpenGL shader cache data overflow!");
- return false;
- }
-
- GLsizei size = 0;
- GLenum format = 0;
- glGetProgramBinaryOES(shader->programId(), binaryLength, &size, &format,
- cache->data + cache->dataSize);
-
- if (!size) {
- shaderCacheDebug() << "Unable to get binary shader!";
- return false;
- }
-
- cache->headers[cacheIdx].index = cache->dataSize;
- cache->dataSize += binaryLength;
- ++cache->shaderCount;
- cache->headers[cacheIdx].size = binaryLength;
- cache->headers[cacheIdx].format = format;
-
- memcpy(cache->headers[cacheIdx].md5Sum, md5Sum.constData(), 16);
-
- shaderCacheDebug() << "cached shader size" << size
- << "format" << format
- << "binarySize" << binaryLength
- << "cache index" << cacheIdx
- << "data index" << cache->headers[cacheIdx].index;
-
- return true;
-}
-
-} // namespace
-
-QT_BEGIN_NAMESPACE
-
-
-class CachedShader
-{
-public:
- CachedShader(const QByteArray &fragSource, const QByteArray &vertexSource)
- : cacheIdx(-1)
- {
- QCryptographicHash md5Hash(QCryptographicHash::Md5);
-
- md5Hash.addData(fragSource);
- md5Hash.addData(vertexSource);
-
- md5Sum = md5Hash.result();
- }
-
- bool isCached()
- {
- return cacheIndex() != -1;
- }
-
- int cacheIndex()
- {
- if (cacheIdx != -1)
- return cacheIdx;
- cacheIdx = qt_cache_index(md5Sum);
- return cacheIdx;
- }
-
- bool load(QGLShaderProgram *program, const QGLContext *ctx)
- {
- if (cacheIndex() == -1)
- return false;
- return qt_cached_shader(program, ctx, cacheIdx);
- }
-
- bool store(QGLShaderProgram *program, const QGLContext *ctx)
- {
- return qt_cache_shader(program, ctx, md5Sum);
- }
-
-private:
- QByteArray md5Sum;
- int cacheIdx;
-};
-
-
-QT_END_NAMESPACE
-
-#endif
-
-#endif
-#endif
diff --git a/src/opengl/gl2paintengineex/qglshadercache_p.h b/src/opengl/gl2paintengineex/qglshadercache_p.h
index e2ac3f85d7..4204e3e256 100644
--- a/src/opengl/gl2paintengineex/qglshadercache_p.h
+++ b/src/opengl/gl2paintengineex/qglshadercache_p.h
@@ -53,10 +53,6 @@
#include <QtCore/qglobal.h>
-#if defined(QT_MEEGO_EXPERIMENTAL_SHADERCACHE) && defined(QT_OPENGL_ES_2)
-# include "qglshadercache_meego_p.h"
-#else
-
QT_BEGIN_NAMESPACE
@@ -88,4 +84,3 @@ public:
QT_END_NAMESPACE
#endif
-#endif
diff --git a/src/opengl/opengl.pro b/src/opengl/opengl.pro
index 25de6ad670..718a886809 100644
--- a/src/opengl/opengl.pro
+++ b/src/opengl/opengl.pro
@@ -41,8 +41,7 @@ HEADERS += qglshaderprogram.h \
gl2paintengineex/qglengineshadersource_p.h \
gl2paintengineex/qglcustomshaderstage_p.h \
gl2paintengineex/qtextureglyphcache_gl_p.h \
- gl2paintengineex/qglshadercache_p.h \
- gl2paintengineex/qglshadercache_meego_p.h
+ gl2paintengineex/qglshadercache_p.h
SOURCES += qglshaderprogram.cpp \
qgraphicsshadereffect.cpp \
diff --git a/src/opengl/qglpixelbuffer_p.h b/src/opengl/qglpixelbuffer_p.h
index 6416e41773..9125fcfb4b 100644
--- a/src/opengl/qglpixelbuffer_p.h
+++ b/src/opengl/qglpixelbuffer_p.h
@@ -63,11 +63,11 @@ class QOpenGLFramebufferObject;
class QGLPBufferGLPaintDevice : public QGLPaintDevice
{
public:
- virtual QPaintEngine* paintEngine() const {return pbuf->paintEngine();}
- virtual QSize size() const {return pbuf->size();}
- virtual QGLContext* context() const;
- virtual void beginPaint();
- virtual void endPaint();
+ QPaintEngine* paintEngine() const override {return pbuf->paintEngine();}
+ QSize size() const override {return pbuf->size();}
+ QGLContext* context() const override;
+ void beginPaint() override;
+ void endPaint() override;
void setPBuffer(QGLPixelBuffer* pb);
void setFbo(GLuint fbo);
private:
diff --git a/src/platformsupport/eglconvenience/qeglstreamconvenience_p.h b/src/platformsupport/eglconvenience/qeglstreamconvenience_p.h
index 6c84f29613..8c802a0ca1 100644
--- a/src/platformsupport/eglconvenience/qeglstreamconvenience_p.h
+++ b/src/platformsupport/eglconvenience/qeglstreamconvenience_p.h
@@ -105,6 +105,10 @@ typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMKHRPROC) (EGLDisplay dpy, EGLS
typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMU64KHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLuint64KHR *value);
#endif
+#ifndef EGL_KHR_stream_fifo
+#define EGL_STREAM_FIFO_LENGTH_KHR 0x31FC
+#endif
+
#ifndef EGL_KHR_stream_producer_eglsurface
#define EGL_STREAM_BIT_KHR 0x0800
typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATESTREAMPRODUCERSURFACEKHRPROC) (EGLDisplay dpy, EGLConfig config, EGLStreamKHR stream, const EGLint *attrib_list);
diff --git a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
index 78a0c4d0c9..1e29b12ec4 100644
--- a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
+++ b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
@@ -189,11 +189,16 @@ QCoreTextFontDatabase::~QCoreTextFontDatabase()
static CFArrayRef availableFamilyNames()
{
-#if defined(Q_OS_OSX)
- return CTFontManagerCopyAvailableFontFamilyNames();
-#elif defined(QT_PLATFORM_UIKIT)
- return (CFArrayRef) [[UIFont familyNames] retain];
+#if QT_DARWIN_PLATFORM_SDK_EQUAL_OR_ABOVE(1060, 100000, 100000, 30000)
+ if (&CTFontManagerCopyAvailableFontFamilyNames)
+ return CTFontManagerCopyAvailableFontFamilyNames();
#endif
+#if defined(QT_PLATFORM_UIKIT)
+ CFMutableArrayRef familyNames = CFArrayCreateMutableCopy(kCFAllocatorDefault, 0, (CFArrayRef)[UIFont familyNames]);
+ CFArrayAppendValue(familyNames, CFSTR(".PhoneFallback"));
+ return familyNames;
+#endif
+ Q_UNREACHABLE();
}
void QCoreTextFontDatabase::populateFontDatabase()
@@ -207,17 +212,6 @@ void QCoreTextFontDatabase::populateFontDatabase()
for (int i = 0; i < numberOfFamilies; ++i) {
CFStringRef familyNameRef = (CFStringRef) CFArrayGetValueAtIndex(familyNames, i);
QString familyName = QString::fromCFString(familyNameRef);
-
- // Don't populate internal fonts
- if (familyName.startsWith(QLatin1Char('.')) || familyName == QLatin1String("LastResort"))
- continue;
-
-#if defined(Q_OS_IOS) || defined(Q_OS_TVOS)
- // Skip font families with no corresponding fonts
- if (![UIFont fontNamesForFamilyName:(NSString*)familyNameRef].count)
- continue;
-#endif
-
QPlatformFontDatabase::registerFontFamily(familyName);
#if defined(Q_OS_OSX)
@@ -250,7 +244,7 @@ void QCoreTextFontDatabase::populateFamily(const QString &familyName)
const int numFonts = CFArrayGetCount(matchingFonts);
for (int i = 0; i < numFonts; ++i)
- populateFromDescriptor(CTFontDescriptorRef(CFArrayGetValueAtIndex(matchingFonts, i)));
+ populateFromDescriptor(CTFontDescriptorRef(CFArrayGetValueAtIndex(matchingFonts, i)), familyName);
}
struct FontDescription {
@@ -352,13 +346,18 @@ static void getFontDescription(CTFontDescriptorRef font, FontDescription *fd)
}
}
-void QCoreTextFontDatabase::populateFromDescriptor(CTFontDescriptorRef font)
+void QCoreTextFontDatabase::populateFromDescriptor(CTFontDescriptorRef font, const QString &familyName)
{
FontDescription fd;
getFontDescription(font, &fd);
+ // Note: The familyName we are registering, and the family name of the font descriptor, may not
+ // match, as CTFontDescriptorCreateMatchingFontDescriptors will return descriptors for replacement
+ // fonts if a font family does not have any fonts available on the system.
+ QString family = !familyName.isNull() ? familyName : static_cast<QString>(fd.familyName);
+
CFRetain(font);
- QPlatformFontDatabase::registerFont(fd.familyName, fd.styleName, fd.foundryName, fd.weight, fd.style, fd.stretch,
+ QPlatformFontDatabase::registerFont(family, fd.styleName, fd.foundryName, fd.weight, fd.style, fd.stretch,
true /* antialiased */, true /* scalable */,
fd.pixelSize, fd.fixedPitch, fd.writingSystems, (void *) font);
}
@@ -699,7 +698,7 @@ QStringList QCoreTextFontDatabase::addApplicationFont(const QByteArray &fontData
bool QCoreTextFontDatabase::isPrivateFontFamily(const QString &family) const
{
- if (family.startsWith(QLatin1Char('.')))
+ if (family.startsWith(QLatin1Char('.')) || family == QLatin1String("LastResort"))
return true;
return QPlatformFontDatabase::isPrivateFontFamily(family);
diff --git a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h
index 1bc3522bda..3b1be2e6a1 100644
--- a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h
+++ b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h
@@ -92,7 +92,7 @@ public:
const QHash<QPlatformTheme::Font, QFont *> &themeFonts() const;
private:
- void populateFromDescriptor(CTFontDescriptorRef font);
+ void populateFromDescriptor(CTFontDescriptorRef font, const QString &familyName = QString());
#ifndef QT_NO_FREETYPE
bool m_useFreeType;
diff --git a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp b/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp
index d71af4b232..a5779fc291 100644
--- a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp
+++ b/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp
@@ -754,7 +754,7 @@ static inline QFontDatabase::WritingSystem writingSystemFromCharSet(uchar charSe
((quint32)(ch1)) \
)
-bool localizedName(const QString &name)
+bool qt_localizedName(const QString &name)
{
const QChar *c = name.unicode();
for (int i = 0; i < name.length(); ++i) {
@@ -764,24 +764,8 @@ bool localizedName(const QString &name)
return false;
}
-static inline quint16 getUShort(const unsigned char *p)
-{
- quint16 val;
- val = *p++ << 8;
- val |= *p;
-
- return val;
-}
-
namespace {
-struct FontNames {
- QString name; // e.g. "DejaVu Sans Condensed"
- QString style; // e.g. "Italic"
- QString preferredName; // e.g. "DejaVu Sans"
- QString preferredStyle; // e.g. "Condensed Italic"
-};
-
static QString readName(bool unicode, const uchar *string, int length)
{
QString out;
@@ -792,7 +776,7 @@ static QString readName(bool unicode, const uchar *string, int length)
out.resize(length);
QChar *uc = out.data();
for (int i = 0; i < length; ++i)
- uc[i] = getUShort(string + 2*i);
+ uc[i] = qt_getUShort(string + 2*i);
} else {
// Apple Roman
@@ -817,7 +801,7 @@ enum PlatformFieldValue {
PlatformId_Microsoft = 3
};
-static FontNames getCanonicalFontNames(const uchar *table, quint32 bytes)
+FontNames qt_getCanonicalFontNames(const uchar *table, quint32 bytes)
{
FontNames out;
const int NameRecordSize = 12;
@@ -831,11 +815,11 @@ static FontNames getCanonicalFontNames(const uchar *table, quint32 bytes)
if (bytes < 8)
return out;
- if (getUShort(table) != 0)
+ if (qt_getUShort(table) != 0)
return out;
- count = getUShort(table+2);
- string_offset = getUShort(table+4);
+ count = qt_getUShort(table + 2);
+ string_offset = qt_getUShort(table + 4);
names = table + 6;
if (string_offset >= bytes || 6 + count*NameRecordSize > string_offset)
@@ -854,10 +838,10 @@ static FontNames getCanonicalFontNames(const uchar *table, quint32 bytes)
for (int i = 0; i < count; ++i) {
// search for the correct name entries
- quint16 platform_id = getUShort(names + i*NameRecordSize);
- quint16 encoding_id = getUShort(names + 2 + i*NameRecordSize);
- quint16 language_id = getUShort(names + 4 + i*NameRecordSize);
- quint16 name_id = getUShort(names + 6 + i*NameRecordSize);
+ quint16 platform_id = qt_getUShort(names + i*NameRecordSize);
+ quint16 encoding_id = qt_getUShort(names + 2 + i*NameRecordSize);
+ quint16 language_id = qt_getUShort(names + 4 + i*NameRecordSize);
+ quint16 name_id = qt_getUShort(names + 6 + i*NameRecordSize);
PlatformIdType *idType = nullptr;
int *id = nullptr;
@@ -883,8 +867,8 @@ static FontNames getCanonicalFontNames(const uchar *table, quint32 bytes)
continue;
}
- quint16 length = getUShort(names + 8 + i*NameRecordSize);
- quint16 offset = getUShort(names + 10 + i*NameRecordSize);
+ quint16 length = qt_getUShort(names + 8 + i*NameRecordSize);
+ quint16 offset = qt_getUShort(names + 10 + i*NameRecordSize);
if (DWORD(string_offset + offset + length) > bytes)
continue;
@@ -911,8 +895,8 @@ static FontNames getCanonicalFontNames(const uchar *table, quint32 bytes)
if (idStatus[i] == NotFound)
continue;
int id = ids[i];
- quint16 length = getUShort(names + 8 + id * NameRecordSize);
- quint16 offset = getUShort(names + 10 + id * NameRecordSize);
+ quint16 length = qt_getUShort(names + 8 + id * NameRecordSize);
+ quint16 offset = qt_getUShort(names + 10 + id * NameRecordSize);
const unsigned char *string = table + string_offset + offset;
strings[i] = readName(idStatus[i] != Apple, string, length);
}
@@ -926,7 +910,7 @@ static FontNames getCanonicalFontNames(const uchar *table, quint32 bytes)
} // namespace
-QString getEnglishName(const QString &familyName, bool includeStyle = false)
+QString qt_getEnglishName(const QString &familyName, bool includeStyle)
{
QString i18n_name;
QString faceName = familyName;
@@ -965,7 +949,7 @@ QString getEnglishName(const QString &familyName, bool includeStyle = false)
goto error;
{
- const FontNames names = getCanonicalFontNames(table, bytes);
+ const FontNames names = qt_getCanonicalFontNames(table, bytes);
i18n_name = names.name;
if (includeStyle)
i18n_name += QLatin1Char(' ') + names.style;
@@ -980,16 +964,63 @@ error:
return i18n_name;
}
-static bool addFontToDatabase(const QString &familyName, const QString &styleName, uchar charSet,
+// Note this duplicates parts of qt_getEnglishName, we should try to unify the two functions.
+FontNames qt_getCanonicalFontNames(const LOGFONT &lf)
+{
+ FontNames fontNames;
+ HDC hdc = GetDC(0);
+ HFONT hfont = CreateFontIndirect(&lf);
+
+ if (!hfont) {
+ ReleaseDC(0, hdc);
+ return fontNames;
+ }
+
+ HGDIOBJ oldobj = SelectObject(hdc, hfont);
+
+ // get the name table
+ QByteArray table;
+ const DWORD name_tag = MAKE_TAG('n', 'a', 'm', 'e');
+ DWORD bytes = GetFontData(hdc, name_tag, 0, 0, 0);
+ if (bytes != GDI_ERROR) {
+ table.resize(bytes);
+
+ if (GetFontData(hdc, name_tag, 0, table.data(), bytes) != GDI_ERROR)
+ fontNames = qt_getCanonicalFontNames(reinterpret_cast<const uchar*>(table.constData()), bytes);
+ }
+
+ SelectObject(hdc, oldobj);
+ DeleteObject(hfont);
+ ReleaseDC(0, hdc);
+
+ return fontNames;
+}
+
+static QChar *createFontFile(const QString &faceName)
+{
+ QChar *faceNamePtr = nullptr;
+ if (!faceName.isEmpty()) {
+ const int nameLength = qMin(faceName.length(), LF_FACESIZE - 1);
+ faceNamePtr = new QChar[nameLength + 1];
+ memcpy(faceNamePtr, faceName.utf16(), sizeof(wchar_t) * nameLength);
+ faceNamePtr[nameLength] = 0;
+ }
+ return faceNamePtr;
+}
+
+static bool addFontToDatabase(QString familyName,
+ QString styleName,
+ const LOGFONT &logFont,
const TEXTMETRIC *textmetric,
const FONTSIGNATURE *signature,
- int type,
- bool registerAlias)
+ int type)
{
// the "@family" fonts are just the same as "family". Ignore them.
if (familyName.isEmpty() || familyName.at(0) == QLatin1Char('@') || familyName.startsWith(QLatin1String("WST_")))
return false;
+ uchar charSet = logFont.lfCharSet;
+
static const int SMOOTH_SCALABLE = 0xffff;
const QString foundryName; // No such concept.
const bool fixed = !(textmetric->tmPitchAndFamily & TMPF_FIXED_PITCH);
@@ -1018,10 +1049,24 @@ static bool addFontToDatabase(const QString &familyName, const QString &styleNam
qCDebug(lcQpaFonts) << message;
}
#endif
-
QString englishName;
- if (registerAlias && ttf && localizedName(familyName))
- englishName = getEnglishName(familyName);
+ QString faceName;
+
+ QString subFamilyName;
+ QString subFamilyStyle;
+ if (ttf) {
+ // Look-up names registered in the font
+ FontNames canonicalNames = qt_getCanonicalFontNames(logFont);
+ if (qt_localizedName(familyName) && !canonicalNames.name.isEmpty())
+ englishName = canonicalNames.name;
+ if (!canonicalNames.preferredName.isEmpty()) {
+ subFamilyName = familyName;
+ subFamilyStyle = styleName;
+ faceName = familyName; // Remember the original name for later lookups
+ familyName = canonicalNames.preferredName;
+ styleName = canonicalNames.preferredStyle;
+ }
+ }
QSupportedWritingSystems writingSystems;
if (type & TRUETYPE_FONTTYPE) {
@@ -1049,32 +1094,36 @@ static bool addFontToDatabase(const QString &familyName, const QString &styleNam
}
QPlatformFontDatabase::registerFont(familyName, styleName, foundryName, weight,
- style, stretch, antialias, scalable, size, fixed, writingSystems, 0);
+ style, stretch, antialias, scalable, size, fixed, writingSystems, createFontFile(faceName));
+
// add fonts windows can generate for us:
if (weight <= QFont::DemiBold && styleName.isEmpty())
QPlatformFontDatabase::registerFont(familyName, QString(), foundryName, QFont::Bold,
- style, stretch, antialias, scalable, size, fixed, writingSystems, 0);
+ style, stretch, antialias, scalable, size, fixed, writingSystems, createFontFile(faceName));
if (style != QFont::StyleItalic && styleName.isEmpty())
QPlatformFontDatabase::registerFont(familyName, QString(), foundryName, weight,
- QFont::StyleItalic, stretch, antialias, scalable, size, fixed, writingSystems, 0);
+ QFont::StyleItalic, stretch, antialias, scalable, size, fixed, writingSystems, createFontFile(faceName));
if (weight <= QFont::DemiBold && style != QFont::StyleItalic && styleName.isEmpty())
QPlatformFontDatabase::registerFont(familyName, QString(), foundryName, QFont::Bold,
- QFont::StyleItalic, stretch, antialias, scalable, size, fixed, writingSystems, 0);
+ QFont::StyleItalic, stretch, antialias, scalable, size, fixed, writingSystems, createFontFile(faceName));
- if (!englishName.isEmpty())
+ if (!subFamilyName.isEmpty() && familyName != subFamilyName) {
+ QPlatformFontDatabase::registerFont(subFamilyName, subFamilyStyle, foundryName, weight,
+ style, stretch, antialias, scalable, size, fixed, writingSystems, createFontFile(faceName));
+ }
+
+ if (!englishName.isEmpty() && englishName != familyName)
QPlatformFontDatabase::registerAliasToFontFamily(familyName, englishName);
return true;
}
static int QT_WIN_CALLBACK storeFont(const LOGFONT *logFont, const TEXTMETRIC *textmetric,
- DWORD type, LPARAM lParam)
+ DWORD type, LPARAM)
{
const ENUMLOGFONTEX *f = reinterpret_cast<const ENUMLOGFONTEX *>(logFont);
const QString familyName = QString::fromWCharArray(f->elfLogFont.lfFaceName);
const QString styleName = QString::fromWCharArray(f->elfStyle);
- const uchar charSet = f->elfLogFont.lfCharSet;
- const bool registerAlias = bool(lParam);
// NEWTEXTMETRICEX (passed for TT fonts) is a NEWTEXTMETRIC, which according
// to the documentation is identical to a TEXTMETRIC except for the last four
@@ -1082,13 +1131,13 @@ static int QT_WIN_CALLBACK storeFont(const LOGFONT *logFont, const TEXTMETRIC *t
const FONTSIGNATURE *signature = Q_NULLPTR;
if (type & TRUETYPE_FONTTYPE)
signature = &reinterpret_cast<const NEWTEXTMETRICEX *>(textmetric)->ntmFontSig;
- addFontToDatabase(familyName, styleName, charSet, textmetric, signature, type, registerAlias);
+ addFontToDatabase(familyName, styleName, *logFont, textmetric, signature, type);
// keep on enumerating
return 1;
}
-void QWindowsFontDatabase::populateFamily(const QString &familyName, bool registerAlias)
+void QWindowsFontDatabase::populateFamily(const QString &familyName)
{
qCDebug(lcQpaFonts) << familyName;
if (familyName.size() >= LF_FACESIZE) {
@@ -1101,29 +1150,12 @@ void QWindowsFontDatabase::populateFamily(const QString &familyName, bool regist
familyName.toWCharArray(lf.lfFaceName);
lf.lfFaceName[familyName.size()] = 0;
lf.lfPitchAndFamily = 0;
- EnumFontFamiliesEx(dummy, &lf, storeFont, LPARAM(registerAlias), 0);
+ EnumFontFamiliesEx(dummy, &lf, storeFont, 0, 0);
ReleaseDC(0, dummy);
}
-void QWindowsFontDatabase::populateFamily(const QString &familyName)
-{
- populateFamily(familyName, false);
-}
-
-namespace {
-// Context for enumerating system fonts, records whether the default font has been encountered,
-// which is normally not enumerated by EnumFontFamiliesEx().
-struct PopulateFamiliesContext
-{
- PopulateFamiliesContext(const QString &f) : systemDefaultFont(f), seenSystemDefaultFont(false) {}
-
- QString systemDefaultFont;
- bool seenSystemDefaultFont;
-};
-} // namespace
-
-static int QT_WIN_CALLBACK populateFontFamilies(const LOGFONT *logFont, const TEXTMETRIC *textmetric,
- DWORD, LPARAM lparam)
+static int QT_WIN_CALLBACK populateFontFamilies(const LOGFONT *logFont, const TEXTMETRIC *,
+ DWORD, LPARAM)
{
// the "@family" fonts are just the same as "family". Ignore them.
const ENUMLOGFONTEX *f = reinterpret_cast<const ENUMLOGFONTEX *>(logFont);
@@ -1131,22 +1163,6 @@ static int QT_WIN_CALLBACK populateFontFamilies(const LOGFONT *logFont, const TE
if (faceNameW[0] && faceNameW[0] != L'@' && wcsncmp(faceNameW, L"WST_", 4)) {
const QString faceName = QString::fromWCharArray(faceNameW);
QPlatformFontDatabase::registerFontFamily(faceName);
- PopulateFamiliesContext *context = reinterpret_cast<PopulateFamiliesContext *>(lparam);
- if (!context->seenSystemDefaultFont && faceName == context->systemDefaultFont)
- context->seenSystemDefaultFont = true;
-
- // Register current font's english name as alias
- const bool ttf = textmetric->tmPitchAndFamily & TMPF_TRUETYPE;
- if (ttf && localizedName(faceName)) {
- const QString englishName = getEnglishName(faceName);
- if (!englishName.isEmpty()) {
- QPlatformFontDatabase::registerAliasToFontFamily(faceName, englishName);
- // Check whether the system default font name is an alias of the current font family name,
- // as on Chinese Windows, where the system font "SimSun" is an alias to a font registered under a local name
- if (!context->seenSystemDefaultFont && englishName == context->systemDefaultFont)
- context->seenSystemDefaultFont = true;
- }
- }
}
return 1; // continue
}
@@ -1159,12 +1175,10 @@ void QWindowsFontDatabase::populateFontDatabase()
lf.lfCharSet = DEFAULT_CHARSET;
lf.lfFaceName[0] = 0;
lf.lfPitchAndFamily = 0;
- PopulateFamiliesContext context(QWindowsFontDatabase::systemDefaultFont().family());
- EnumFontFamiliesEx(dummy, &lf, populateFontFamilies, reinterpret_cast<LPARAM>(&context), 0);
+ EnumFontFamiliesEx(dummy, &lf, populateFontFamilies, 0, 0);
ReleaseDC(0, dummy);
// Work around EnumFontFamiliesEx() not listing the system font.
- if (!context.seenSystemDefaultFont)
- QPlatformFontDatabase::registerFontFamily(context.systemDefaultFont);
+ QPlatformFontDatabase::registerFontFamily(QWindowsFontDatabase::systemDefaultFont().family());
}
typedef QSharedPointer<QWindowsFontEngineData> QWindowsFontEngineDataPtr;
@@ -1223,7 +1237,8 @@ QFontEngineMulti *QWindowsFontDatabase::fontEngineMulti(QFontEngine *fontEngine,
QFontEngine * QWindowsFontDatabase::fontEngine(const QFontDef &fontDef, void *handle)
{
- QFontEngine *fe = QWindowsFontDatabase::createEngine(fontDef,
+ const QString faceName(static_cast<const QChar*>(handle));
+ QFontEngine *fe = QWindowsFontDatabase::createEngine(fontDef, faceName,
defaultVerticalDPI(),
sharedFontData());
qCDebug(lcQpaFonts) << __FUNCTION__ << "FONTDEF" << fontDef << fe << handle;
@@ -1277,7 +1292,7 @@ QT_WARNING_POP
request.hintingPreference = hintingPreference;
request.stretch = QFont::Unstretched;
- fontEngine = QWindowsFontDatabase::createEngine(request,
+ fontEngine = QWindowsFontDatabase::createEngine(request, QString(),
defaultVerticalDPI(),
sharedFontData());
@@ -1456,7 +1471,7 @@ static void getFamiliesAndSignatures(const QByteArray &fontData,
getFontTable(data, font, MAKE_TAG('n', 'a', 'm', 'e'), &table, &length);
if (!table)
continue;
- FontNames names = getCanonicalFontNames(table, length);
+ FontNames names = qt_getCanonicalFontNames(table, length);
if (names.name.isEmpty())
continue;
@@ -1518,8 +1533,8 @@ QStringList QWindowsFontDatabase::addApplicationFont(const QByteArray &fontData,
TEXTMETRIC textMetrics;
GetTextMetrics(hdc, &textMetrics);
- addFontToDatabase(familyName, styleName, lf.lfCharSet, &textMetrics, &signatures.at(j),
- TRUETYPE_FONTTYPE, true);
+ addFontToDatabase(familyName, styleName, lf, &textMetrics, &signatures.at(j),
+ TRUETYPE_FONTTYPE);
SelectObject(hdc, oldobj);
DeleteObject(hfont);
@@ -1545,7 +1560,7 @@ QStringList QWindowsFontDatabase::addApplicationFont(const QByteArray &fontData,
for (int j = 0; j < families.count(); ++j) {
const QString familyName = families.at(j).name;
familyNames << familyName;
- populateFamily(familyName, true);
+ populateFamily(familyName);
}
}
@@ -1566,8 +1581,10 @@ void QWindowsFontDatabase::removeApplicationFonts()
m_applicationFonts.clear();
}
-void QWindowsFontDatabase::releaseHandle(void * /* handle */)
+void QWindowsFontDatabase::releaseHandle(void *handle)
{
+ const QChar *faceName = reinterpret_cast<const QChar *>(handle);
+ delete[] faceName;
}
QString QWindowsFontDatabase::fontDir() const
@@ -1658,7 +1675,7 @@ static const char *kr_tryFonts[] = {
static const char **tryFonts = 0;
-LOGFONT QWindowsFontDatabase::fontDefToLOGFONT(const QFontDef &request)
+LOGFONT QWindowsFontDatabase::fontDefToLOGFONT(const QFontDef &request, const QString &faceName)
{
LOGFONT lf;
memset(&lf, 0, sizeof(LOGFONT));
@@ -1733,7 +1750,9 @@ LOGFONT QWindowsFontDatabase::fontDefToLOGFONT(const QFontDef &request)
lf.lfPitchAndFamily = DEFAULT_PITCH | hint;
- QString fam = request.family;
+ QString fam = faceName;
+ if (fam.isEmpty())
+ fam = request.family;
if (Q_UNLIKELY(fam.size() >= LF_FACESIZE)) {
qCritical("%s: Family name '%s' is too long.", __FUNCTION__, qPrintable(fam));
fam.truncate(LF_FACESIZE - 1);
@@ -1832,13 +1851,13 @@ QStringList QWindowsFontDatabase::fallbacksForFamily(const QString &family, QFon
}
-QFontEngine *QWindowsFontDatabase::createEngine(const QFontDef &request,
+QFontEngine *QWindowsFontDatabase::createEngine(const QFontDef &request, const QString &faceName,
int dpi,
const QSharedPointer<QWindowsFontEngineData> &data)
{
QFontEngine *fe = 0;
- LOGFONT lf = fontDefToLOGFONT(request);
+ LOGFONT lf = fontDefToLOGFONT(request, faceName);
const bool preferClearTypeAA = lf.lfQuality == CLEARTYPE_QUALITY;
if (request.stretch != 100) {
diff --git a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_ft.cpp b/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_ft.cpp
index 4d973bbf17..df84198862 100644
--- a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_ft.cpp
+++ b/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_ft.cpp
@@ -100,9 +100,6 @@ static FontFile * createFontFile(const QString &fileName, int index)
return fontFile;
}
-extern bool localizedName(const QString &name);
-extern QString getEnglishName(const QString &familyName, bool includeStyle = false);
-
namespace {
struct FontKey
{
@@ -162,19 +159,20 @@ static const FontKey *findFontKey(const QString &name, int *indexIn = Q_NULLPTR)
return Q_NULLPTR;
}
-static bool addFontToDatabase(const QString &faceName,
- const QString &styleName,
+static bool addFontToDatabase(QString familyName,
+ QString styleName,
const QString &fullName,
- uchar charSet,
+ const LOGFONT &logFont,
const TEXTMETRIC *textmetric,
const FONTSIGNATURE *signature,
- int type,
- bool registerAlias)
+ int type)
{
// the "@family" fonts are just the same as "family". Ignore them.
- if (faceName.isEmpty() || faceName.at(0) == QLatin1Char('@') || faceName.startsWith(QLatin1String("WST_")))
+ if (familyName.isEmpty() || familyName.at(0) == QLatin1Char('@') || familyName.startsWith(QLatin1String("WST_")))
return false;
+ uchar charSet = logFont.lfCharSet;
+
static const int SMOOTH_SCALABLE = 0xffff;
const QString foundryName; // No such concept.
const bool fixed = !(textmetric->tmPitchAndFamily & TMPF_FIXED_PITCH);
@@ -190,7 +188,7 @@ static bool addFontToDatabase(const QString &faceName,
if (lcQpaFonts().isDebugEnabled()) {
QString message;
QTextStream str(&message);
- str << __FUNCTION__ << ' ' << faceName << "::" << fullName << ' ' << charSet << " TTF=" << ttf;
+ str << __FUNCTION__ << ' ' << familyName << "::" << fullName << ' ' << charSet << " TTF=" << ttf;
if (type & DEVICE_FONTTYPE)
str << " DEVICE";
if (type & RASTER_FONTTYPE)
@@ -205,8 +203,22 @@ static bool addFontToDatabase(const QString &faceName,
#endif
QString englishName;
- if (registerAlias & ttf && localizedName(faceName))
- englishName = getEnglishName(faceName);
+ QString faceName = familyName;
+
+ QString subFamilyName;
+ QString subFamilyStyle;
+ if (ttf) {
+ // Look-up names registered in the font
+ FontNames canonicalNames = qt_getCanonicalFontNames(logFont);
+ if (qt_localizedName(familyName) && !canonicalNames.name.isEmpty())
+ englishName = canonicalNames.name;
+ if (!canonicalNames.preferredName.isEmpty()) {
+ subFamilyName = familyName;
+ subFamilyStyle = styleName;
+ familyName = canonicalNames.preferredName;
+ styleName = canonicalNames.preferredStyle;
+ }
+ }
QSupportedWritingSystems writingSystems;
if (type & TRUETYPE_FONTTYPE) {
@@ -243,12 +255,10 @@ static bool addFontToDatabase(const QString &faceName,
&& systemLocale.language() != QLocale::English
&& styleName != QLatin1String("Italic")
&& styleName != QLatin1String("Bold")) {
- key = findFontKey(getEnglishName(fullName, true), &index);
+ key = findFontKey(qt_getEnglishName(fullName, true), &index);
}
if (!key)
key = findFontKey(faceName, &index);
- if (!key && !registerAlias && englishName.isEmpty() && localizedName(faceName))
- englishName = getEnglishName(faceName);
if (!key && !englishName.isEmpty())
key = findFontKey(englishName, &index);
if (!key)
@@ -261,24 +271,29 @@ static bool addFontToDatabase(const QString &faceName,
if (!QDir::isAbsolutePath(value))
value.prepend(QFile::decodeName(qgetenv("windir") + "\\Fonts\\"));
- QPlatformFontDatabase::registerFont(faceName, styleName, foundryName, weight, style, stretch,
+ QPlatformFontDatabase::registerFont(familyName, styleName, foundryName, weight, style, stretch,
antialias, scalable, size, fixed, writingSystems, createFontFile(value, index));
// add fonts windows can generate for us:
if (weight <= QFont::DemiBold && styleName.isEmpty())
- QPlatformFontDatabase::registerFont(faceName, QString(), foundryName, QFont::Bold, style, stretch,
+ QPlatformFontDatabase::registerFont(familyName, QString(), foundryName, QFont::Bold, style, stretch,
antialias, scalable, size, fixed, writingSystems, createFontFile(value, index));
if (style != QFont::StyleItalic && styleName.isEmpty())
- QPlatformFontDatabase::registerFont(faceName, QString(), foundryName, weight, QFont::StyleItalic, stretch,
+ QPlatformFontDatabase::registerFont(familyName, QString(), foundryName, weight, QFont::StyleItalic, stretch,
antialias, scalable, size, fixed, writingSystems, createFontFile(value, index));
if (weight <= QFont::DemiBold && style != QFont::StyleItalic && styleName.isEmpty())
- QPlatformFontDatabase::registerFont(faceName, QString(), foundryName, QFont::Bold, QFont::StyleItalic, stretch,
+ QPlatformFontDatabase::registerFont(familyName, QString(), foundryName, QFont::Bold, QFont::StyleItalic, stretch,
antialias, scalable, size, fixed, writingSystems, createFontFile(value, index));
- if (!englishName.isEmpty())
- QPlatformFontDatabase::registerAliasToFontFamily(faceName, englishName);
+ if (!subFamilyName.isEmpty() && familyName != subFamilyName) {
+ QPlatformFontDatabase::registerFont(subFamilyName, subFamilyStyle, foundryName, weight,
+ style, stretch, antialias, scalable, size, fixed, writingSystems, createFontFile(value, index));
+ }
+
+ if (!englishName.isEmpty() && englishName != familyName)
+ QPlatformFontDatabase::registerAliasToFontFamily(familyName, englishName);
return true;
}
@@ -290,7 +305,6 @@ static int QT_WIN_CALLBACK storeFont(const LOGFONT *logFont, const TEXTMETRIC *t
const QString faceName = QString::fromWCharArray(f->elfLogFont.lfFaceName);
const QString styleName = QString::fromWCharArray(f->elfStyle);
const QString fullName = QString::fromWCharArray(f->elfFullName);
- const uchar charSet = f->elfLogFont.lfCharSet;
// NEWTEXTMETRICEX (passed for TT fonts) is a NEWTEXTMETRIC, which according
// to the documentation is identical to a TEXTMETRIC except for the last four
@@ -298,7 +312,7 @@ static int QT_WIN_CALLBACK storeFont(const LOGFONT *logFont, const TEXTMETRIC *t
const FONTSIGNATURE *signature = Q_NULLPTR;
if (type & TRUETYPE_FONTTYPE)
signature = &reinterpret_cast<const NEWTEXTMETRICEX *>(textmetric)->ntmFontSig;
- addFontToDatabase(faceName, styleName, fullName, charSet, textmetric, signature, type, false);
+ addFontToDatabase(faceName, styleName, fullName, *logFont, textmetric, signature, type);
// keep on enumerating
return 1;
@@ -321,30 +335,19 @@ void QWindowsFontDatabaseFT::populateFamily(const QString &familyName)
}
HDC dummy = GetDC(0);
LOGFONT lf;
- lf.lfCharSet = DEFAULT_CHARSET;
+ memset(&lf, 0, sizeof(LOGFONT));
familyName.toWCharArray(lf.lfFaceName);
lf.lfFaceName[familyName.size()] = 0;
+ lf.lfCharSet = DEFAULT_CHARSET;
lf.lfPitchAndFamily = 0;
EnumFontFamiliesEx(dummy, &lf, storeFont, 0, 0);
ReleaseDC(0, dummy);
}
-namespace {
-// Context for enumerating system fonts, records whether the default font has been
-// encountered, which is normally not enumerated.
-struct PopulateFamiliesContext
-{
- PopulateFamiliesContext(const QString &f) : systemDefaultFont(f), seenSystemDefaultFont(false) {}
-
- QString systemDefaultFont;
- bool seenSystemDefaultFont;
-};
-} // namespace
-
// Delayed population of font families
static int QT_WIN_CALLBACK populateFontFamilies(const LOGFONT *logFont, const TEXTMETRIC *textmetric,
- DWORD, LPARAM lparam)
+ DWORD, LPARAM)
{
const ENUMLOGFONTEX *f = reinterpret_cast<const ENUMLOGFONTEX *>(logFont);
// the "@family" fonts are just the same as "family". Ignore them.
@@ -356,27 +359,11 @@ static int QT_WIN_CALLBACK populateFontFamilies(const LOGFONT *logFont, const TE
const FontKey *key = findFontKey(faceName);
if (!key) {
key = findFontKey(QString::fromWCharArray(f->elfFullName));
- if (!key && ttf && localizedName(faceName))
- key = findFontKey(getEnglishName(faceName));
+ if (!key && ttf && qt_localizedName(faceName))
+ key = findFontKey(qt_getEnglishName(faceName));
}
- if (key) {
+ if (key)
QPlatformFontDatabase::registerFontFamily(faceName);
- PopulateFamiliesContext *context = reinterpret_cast<PopulateFamiliesContext *>(lparam);
- if (!context->seenSystemDefaultFont && faceName == context->systemDefaultFont)
- context->seenSystemDefaultFont = true;
-
- // Register current font's english name as alias
- if (ttf && localizedName(faceName)) {
- const QString englishName = getEnglishName(faceName);
- if (!englishName.isEmpty()) {
- QPlatformFontDatabase::registerAliasToFontFamily(faceName, englishName);
- // Check whether the system default font name is an alias of the current font family name,
- // as on Chinese Windows, where the system font "SimSun" is an alias to a font registered under a local name
- if (!context->seenSystemDefaultFont && englishName == context->systemDefaultFont)
- context->seenSystemDefaultFont = true;
- }
- }
- }
}
return 1; // continue
}
@@ -388,12 +375,10 @@ void QWindowsFontDatabaseFT::populateFontDatabase()
lf.lfCharSet = DEFAULT_CHARSET;
lf.lfFaceName[0] = 0;
lf.lfPitchAndFamily = 0;
- PopulateFamiliesContext context(QWindowsFontDatabase::systemDefaultFont().family());
- EnumFontFamiliesEx(dummy, &lf, populateFontFamilies, reinterpret_cast<LPARAM>(&context), 0);
+ EnumFontFamiliesEx(dummy, &lf, populateFontFamilies, 0, 0);
ReleaseDC(0, dummy);
// Work around EnumFontFamiliesEx() not listing the system font
- if (!context.seenSystemDefaultFont)
- QPlatformFontDatabase::registerFontFamily(context.systemDefaultFont);
+ QPlatformFontDatabase::registerFontFamily(QWindowsFontDatabase::systemDefaultFont().family());
}
QFontEngine * QWindowsFontDatabaseFT::fontEngine(const QFontDef &fontDef, void *handle)
diff --git a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_p.h b/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_p.h
index 5a37778be4..15172c09da 100644
--- a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_p.h
+++ b/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_p.h
@@ -112,7 +112,7 @@ public:
static QFont systemDefaultFont();
- static QFontEngine *createEngine(const QFontDef &request,
+ static QFontEngine *createEngine(const QFontDef &request, const QString &faceName,
int dpi,
const QSharedPointer<QWindowsFontEngineData> &data);
@@ -120,7 +120,7 @@ public:
static QFont LOGFONT_to_QFont(const LOGFONT& lf, int verticalDPI = 0);
static qreal fontSmoothingGamma();
- static LOGFONT fontDefToLOGFONT(const QFontDef &fontDef);
+ static LOGFONT fontDefToLOGFONT(const QFontDef &fontDef, const QString &faceName);
static QStringList extraTryFontsForFamily(const QString &family);
static QString familyForStyleHint(QFont::StyleHint styleHint);
@@ -133,7 +133,6 @@ public:
static QString readRegistryString(HKEY parentHandle, const wchar_t *keyPath, const wchar_t *keyName);
private:
- void populateFamily(const QString &familyName, bool registerAlias);
void removeApplicationFonts();
struct WinApplicationFont {
@@ -157,6 +156,26 @@ private:
QDebug operator<<(QDebug, const QFontDef &def);
#endif
+inline quint16 qt_getUShort(const unsigned char *p)
+{
+ quint16 val;
+ val = *p++ << 8;
+ val |= *p;
+
+ return val;
+}
+
+struct FontNames {
+ QString name; // e.g. "DejaVu Sans Condensed"
+ QString style; // e.g. "Italic"
+ QString preferredName; // e.g. "DejaVu Sans"
+ QString preferredStyle; // e.g. "Condensed Italic"
+};
+
+bool qt_localizedName(const QString &name);
+QString qt_getEnglishName(const QString &familyName, bool includeStyle = false);
+FontNames qt_getCanonicalFontNames(const LOGFONT &lf);
+
QT_END_NAMESPACE
#endif // QWINDOWSFONTDATABASE_H
diff --git a/src/platformsupport/fontdatabases/windows/qwindowsfontengine.cpp b/src/platformsupport/fontdatabases/windows/qwindowsfontengine.cpp
index 23bbc291ed..2b7351d124 100644
--- a/src/platformsupport/fontdatabases/windows/qwindowsfontengine.cpp
+++ b/src/platformsupport/fontdatabases/windows/qwindowsfontengine.cpp
@@ -97,15 +97,6 @@ static void resolveGetCharWidthI()
ptrGetCharWidthI = (PtrGetCharWidthI)QSystemLibrary::resolve(QStringLiteral("gdi32"), "GetCharWidthI");
}
-static inline quint16 getUShort(unsigned char *p)
-{
- quint16 val;
- val = *p++ << 8;
- val |= *p;
-
- return val;
-}
-
// general font engine
QFixed QWindowsFontEngine::lineThickness() const
@@ -900,7 +891,7 @@ int QWindowsFontEngine::synthesized() const
SelectObject(hdc, hfont);
uchar data[4];
GetFontData(hdc, HEAD, 44, &data, 4);
- USHORT macStyle = getUShort(data);
+ USHORT macStyle = qt_getUShort(data);
if (tm.tmItalic && !(macStyle & 2))
synthesized_flags = SynthesizedItalic;
if (fontDef.stretch != 100 && ttf)
@@ -1180,9 +1171,10 @@ QFontEngine *QWindowsFontEngine::cloneWithSize(qreal pixelSize) const
if (!uniqueFamilyName.isEmpty())
request.family = uniqueFamilyName;
request.pixelSize = pixelSize;
+ const QString faceName = QString::fromWCharArray(m_logfont.lfFaceName);
QFontEngine *fontEngine =
- QWindowsFontDatabase::createEngine(request,
+ QWindowsFontDatabase::createEngine(request, faceName,
QWindowsFontDatabase::defaultVerticalDPI(),
m_fontEngineData);
if (fontEngine) {
@@ -1245,7 +1237,7 @@ QFontEngine *QWindowsMultiFontEngine::loadEngine(int at)
#ifndef QT_NO_DIRECTWRITE
if (fontEngine->type() == QFontEngine::DirectWrite) {
QWindowsFontEngineDirectWrite *fe = static_cast<QWindowsFontEngineDirectWrite *>(fontEngine);
- lf = QWindowsFontDatabase::fontDefToLOGFONT(fe->fontDef);
+ lf = QWindowsFontDatabase::fontDefToLOGFONT(fe->fontDef, QString());
data = fe->fontEngineData();
} else
diff --git a/src/platformsupport/fontdatabases/winrt/qwinrtfontdatabase.cpp b/src/platformsupport/fontdatabases/winrt/qwinrtfontdatabase.cpp
index f214184c36..9f4b182ece 100644
--- a/src/platformsupport/fontdatabases/winrt/qwinrtfontdatabase.cpp
+++ b/src/platformsupport/fontdatabases/winrt/qwinrtfontdatabase.cpp
@@ -129,6 +129,17 @@ static QFontDatabase::WritingSystem writingSystemFromUnicodeRange(const DWRITE_U
return QFontDatabase::Other;
}
+QWinRTFontDatabase::~QWinRTFontDatabase()
+{
+ qCDebug(lcQpaFonts) << __FUNCTION__;
+
+ foreach (IDWriteFontFile *fontFile, m_fonts.keys())
+ fontFile->Release();
+
+ foreach (IDWriteFontFamily *fontFamily, m_fontFamilies)
+ fontFamily->Release();
+}
+
QString QWinRTFontDatabase::fontDir() const
{
qCDebug(lcQpaFonts) << __FUNCTION__;
@@ -146,17 +157,6 @@ QString QWinRTFontDatabase::fontDir() const
return fontDirectory;
}
-QWinRTFontDatabase::~QWinRTFontDatabase()
-{
- qCDebug(lcQpaFonts) << __FUNCTION__;
-
- foreach (IDWriteFontFile *fontFile, m_fonts.keys())
- fontFile->Release();
-
- foreach (IDWriteFontFamily *fontFamily, m_fontFamilies)
- fontFamily->Release();
-}
-
QFont QWinRTFontDatabase::defaultFont() const
{
return QFont(QStringLiteral("Segoe UI"));
diff --git a/src/platformsupport/fontdatabases/winrt/qwinrtfontdatabase_p.h b/src/platformsupport/fontdatabases/winrt/qwinrtfontdatabase_p.h
index 9559bac0a8..3b803d7613 100644
--- a/src/platformsupport/fontdatabases/winrt/qwinrtfontdatabase_p.h
+++ b/src/platformsupport/fontdatabases/winrt/qwinrtfontdatabase_p.h
@@ -70,16 +70,16 @@ struct FontDescription
class QWinRTFontDatabase : public QBasicFontDatabase
{
public:
- QString fontDir() const;
~QWinRTFontDatabase();
- QFont defaultFont() const Q_DECL_OVERRIDE;
- bool fontsAlwaysScalable() const Q_DECL_OVERRIDE;
- void populateFontDatabase() Q_DECL_OVERRIDE;
- void populateFamily(const QString &familyName) Q_DECL_OVERRIDE;
- QFontEngine *fontEngine(const QFontDef &fontDef, void *handle) Q_DECL_OVERRIDE;
+ QString fontDir() const override;
+ QFont defaultFont() const override;
+ bool fontsAlwaysScalable() const override;
+ void populateFontDatabase() override;
+ void populateFamily(const QString &familyName) override;
+ QFontEngine *fontEngine(const QFontDef &fontDef, void *handle) override;
QStringList fallbacksForFamily(const QString &family, QFont::Style style,
- QFont::StyleHint styleHint, QChar::Script script) const Q_DECL_OVERRIDE;
- void releaseHandle(void *handle) Q_DECL_OVERRIDE;
+ QFont::StyleHint styleHint, QChar::Script script) const override;
+ void releaseHandle(void *handle) override;
private:
QHash<IDWriteFontFile *, FontDescription> m_fonts;
QHash<QString, IDWriteFontFamily *> m_fontFamilies;
diff --git a/src/platformsupport/kmsconvenience/qkmsdevice.cpp b/src/platformsupport/kmsconvenience/qkmsdevice.cpp
index 541fcd155d..319c7f3d9b 100644
--- a/src/platformsupport/kmsconvenience/qkmsdevice.cpp
+++ b/src/platformsupport/kmsconvenience/qkmsdevice.cpp
@@ -332,9 +332,32 @@ QPlatformScreen *QKmsDevice::createScreenForConnector(drmModeResPtr resources,
drmModeGetCrtc(m_dri_fd, crtc_id),
modes,
connector->subpixel,
- connectorProperty(connector, QByteArrayLiteral("DPMS"))
+ connectorProperty(connector, QByteArrayLiteral("DPMS")),
+ false,
+ 0,
+ false
};
+ bool ok;
+ int idx = qEnvironmentVariableIntValue("QT_QPA_EGLFS_KMS_PLANE_INDEX", &ok);
+ if (ok) {
+ drmModePlaneRes *planeResources = drmModeGetPlaneResources(m_dri_fd);
+ if (planeResources) {
+ if (idx >= 0 && idx < int(planeResources->count_planes)) {
+ drmModePlane *plane = drmModeGetPlane(m_dri_fd, planeResources->planes[idx]);
+ if (plane) {
+ output.wants_plane = true;
+ output.plane_id = plane->plane_id;
+ qCDebug(qLcKmsDebug, "Forcing plane index %d, plane id %u (belongs to crtc id %u)",
+ idx, plane->plane_id, plane->crtc_id);
+ drmModeFreePlane(plane);
+ }
+ } else {
+ qWarning("Invalid plane index %d, must be between 0 and %u", idx, planeResources->count_planes - 1);
+ }
+ }
+ }
+
m_crtc_allocator |= (1 << output.crtc_id);
m_connector_allocator |= (1 << output.connector_id);
@@ -410,7 +433,20 @@ void QKmsDevice::createScreens()
QVector<OrderedScreen> screens;
+ int wantedConnectorIndex = -1;
+ bool ok;
+ int idx = qEnvironmentVariableIntValue("QT_QPA_EGLFS_KMS_CONNECTOR_INDEX", &ok);
+ if (ok) {
+ if (idx >= 0 && idx < resources->count_connectors)
+ wantedConnectorIndex = idx;
+ else
+ qWarning("Invalid connector index %d, must be between 0 and %u", idx, resources->count_connectors - 1);
+ }
+
for (int i = 0; i < resources->count_connectors; i++) {
+ if (wantedConnectorIndex >= 0 && i != wantedConnectorIndex)
+ continue;
+
drmModeConnectorPtr connector = drmModeGetConnector(m_dri_fd, resources->connectors[i]);
if (!connector)
continue;
diff --git a/src/platformsupport/kmsconvenience/qkmsdevice_p.h b/src/platformsupport/kmsconvenience/qkmsdevice_p.h
index 36aba49ff2..c41448bc99 100644
--- a/src/platformsupport/kmsconvenience/qkmsdevice_p.h
+++ b/src/platformsupport/kmsconvenience/qkmsdevice_p.h
@@ -106,6 +106,9 @@ struct QKmsOutput
QList<drmModeModeInfo> modes;
int subpixel;
drmModePropertyPtr dpms_prop;
+ bool wants_plane;
+ uint32_t plane_id;
+ bool plane_set;
void restoreMode(QKmsDevice *device);
void cleanup(QKmsDevice *device);
diff --git a/src/platformsupport/services/genericunix/qgenericunixservices.cpp b/src/platformsupport/services/genericunix/qgenericunixservices.cpp
index 5242f00193..a24ab82057 100644
--- a/src/platformsupport/services/genericunix/qgenericunixservices.cpp
+++ b/src/platformsupport/services/genericunix/qgenericunixservices.cpp
@@ -38,6 +38,7 @@
****************************************************************************/
#include "qgenericunixservices_p.h"
+#include <QtGui/private/qtguiglobal_p.h>
#include <QtCore/QStandardPaths>
#include <QtCore/QProcess>
@@ -48,7 +49,7 @@
QT_BEGIN_NAMESPACE
-#ifndef QT_NO_MULTIPROCESS
+#if QT_CONFIG(multiprocess)
enum { debug = 0 };
diff --git a/src/platformsupport/themes/genericunix/dbusmenu/qdbusmenuconnection.cpp b/src/platformsupport/themes/genericunix/dbusmenu/qdbusmenuconnection.cpp
index a9d758209a..352e4dfd56 100644
--- a/src/platformsupport/themes/genericunix/dbusmenu/qdbusmenuconnection.cpp
+++ b/src/platformsupport/themes/genericunix/dbusmenu/qdbusmenuconnection.cpp
@@ -119,13 +119,16 @@ bool QDBusMenuConnection::registerTrayIcon(QDBusTrayIcon *item)
if (item->menu())
registerTrayIconMenu(item);
+ return registerTrayIconWithWatcher(item);
+}
+
+bool QDBusMenuConnection::registerTrayIconWithWatcher(QDBusTrayIcon *item)
+{
QDBusMessage registerMethod = QDBusMessage::createMethodCall(
StatusNotifierWatcherService, StatusNotifierWatcherPath, StatusNotifierWatcherService,
QLatin1String("RegisterStatusNotifierItem"));
registerMethod.setArguments(QVariantList() << item->instanceId());
- success = m_connection.callWithCallback(registerMethod, this, SIGNAL(trayIconRegistered()), SLOT(dbusError(QDBusError)));
-
- return success;
+ return m_connection.callWithCallback(registerMethod, this, SIGNAL(trayIconRegistered()), SLOT(dbusError(QDBusError)));
}
bool QDBusMenuConnection::unregisterTrayIcon(QDBusTrayIcon *item)
diff --git a/src/platformsupport/themes/genericunix/dbusmenu/qdbusmenuconnection_p.h b/src/platformsupport/themes/genericunix/dbusmenu/qdbusmenuconnection_p.h
index ae0595ae3b..c7c3f4bc5b 100644
--- a/src/platformsupport/themes/genericunix/dbusmenu/qdbusmenuconnection_p.h
+++ b/src/platformsupport/themes/genericunix/dbusmenu/qdbusmenuconnection_p.h
@@ -69,11 +69,13 @@ class QDBusMenuConnection : public QObject
public:
QDBusMenuConnection(QObject *parent = 0, const QString &serviceName = QString());
QDBusConnection connection() const { return m_connection; }
+ QDBusServiceWatcher *dbusWatcher() const { return m_dbusWatcher; }
bool isStatusNotifierHostRegistered() const { return m_statusNotifierHostRegistered; }
#ifndef QT_NO_SYSTEMTRAYICON
bool registerTrayIconMenu(QDBusTrayIcon *item);
void unregisterTrayIconMenu(QDBusTrayIcon *item);
bool registerTrayIcon(QDBusTrayIcon *item);
+ bool registerTrayIconWithWatcher(QDBusTrayIcon *item);
bool unregisterTrayIcon(QDBusTrayIcon *item);
#endif // QT_NO_SYSTEMTRAYICON
diff --git a/src/platformsupport/themes/genericunix/dbustray/qdbustrayicon.cpp b/src/platformsupport/themes/genericunix/dbustray/qdbustrayicon.cpp
index a686a33464..5c4157c206 100644
--- a/src/platformsupport/themes/genericunix/dbustray/qdbustrayicon.cpp
+++ b/src/platformsupport/themes/genericunix/dbustray/qdbustrayicon.cpp
@@ -116,6 +116,8 @@ void QDBusTrayIcon::init()
{
qCDebug(qLcTray) << "registering" << m_instanceId;
m_registered = dBusConnection()->registerTrayIcon(this);
+ QObject::connect(dBusConnection()->dbusWatcher(), &QDBusServiceWatcher::serviceRegistered,
+ this, &QDBusTrayIcon::watcherServiceRegistered);
}
void QDBusTrayIcon::cleanup()
@@ -130,6 +132,15 @@ void QDBusTrayIcon::cleanup()
m_registered = false;
}
+void QDBusTrayIcon::watcherServiceRegistered(const QString &serviceName)
+{
+ Q_UNUSED(serviceName);
+ // We have the icon registered, but the watcher has restarted or
+ // changed, so we need to tell it about our icon again
+ if (m_registered)
+ dBusConnection()->registerTrayIconWithWatcher(this);
+}
+
void QDBusTrayIcon::attentionTimerExpired()
{
m_messageTitle = QString();
diff --git a/src/platformsupport/themes/genericunix/dbustray/qdbustrayicon_p.h b/src/platformsupport/themes/genericunix/dbustray/qdbustrayicon_p.h
index 234ff60584..ff1a7ae532 100644
--- a/src/platformsupport/themes/genericunix/dbustray/qdbustrayicon_p.h
+++ b/src/platformsupport/themes/genericunix/dbustray/qdbustrayicon_p.h
@@ -133,6 +133,7 @@ private Q_SLOTS:
void attentionTimerExpired();
void actionInvoked(uint id, const QString &action);
void notificationClosed(uint id, uint reason);
+ void watcherServiceRegistered(const QString &serviceName);
private:
void setStatus(const QString &status);
diff --git a/src/plugins/platforms/android/androidplatformplugin.cpp b/src/plugins/platforms/android/androidplatformplugin.cpp
index 8e365e9a59..297e167f47 100644
--- a/src/plugins/platforms/android/androidplatformplugin.cpp
+++ b/src/plugins/platforms/android/androidplatformplugin.cpp
@@ -47,7 +47,7 @@ class QAndroidPlatformIntegrationPlugin: public QPlatformIntegrationPlugin
Q_OBJECT
Q_PLUGIN_METADATA(IID QPlatformIntegrationFactoryInterface_iid FILE "android.json")
public:
- QPlatformIntegration *create(const QString &key, const QStringList &paramList);
+ QPlatformIntegration *create(const QString &key, const QStringList &paramList) override;
};
diff --git a/src/plugins/platforms/android/qandroidassetsfileenginehandler.cpp b/src/plugins/platforms/android/qandroidassetsfileenginehandler.cpp
index 7e8e1ba9c5..e1dcebfa4c 100644
--- a/src/plugins/platforms/android/qandroidassetsfileenginehandler.cpp
+++ b/src/plugins/platforms/android/qandroidassetsfileenginehandler.cpp
@@ -75,12 +75,12 @@ public:
m_path = path;
}
- virtual QFileInfo currentFileInfo() const
+ QFileInfo currentFileInfo() const override
{
return QFileInfo(currentFilePath());
}
- virtual QString currentFileName() const
+ QString currentFileName() const override
{
if (m_index < 0 || m_index >= m_items.size())
return QString();
@@ -95,12 +95,12 @@ public:
return m_path + currentFileName();
}
- virtual bool hasNext() const
+ bool hasNext() const override
{
return m_items.size() && (m_index < m_items.size() - 1);
}
- virtual QString next()
+ QString next() override
{
if (!hasNext())
return QString();
@@ -137,12 +137,12 @@ public:
close();
}
- virtual bool open(QIODevice::OpenMode openMode)
+ bool open(QIODevice::OpenMode openMode) override
{
return m_assetFile != 0 && (openMode & QIODevice::WriteOnly) == 0;
}
- virtual bool close()
+ bool close() override
{
if (m_assetFile) {
AAsset_close(m_assetFile);
@@ -152,50 +152,50 @@ public:
return false;
}
- virtual qint64 size() const
+ qint64 size() const override
{
if (m_assetFile)
return AAsset_getLength(m_assetFile);
return -1;
}
- virtual qint64 pos() const
+ qint64 pos() const override
{
if (m_assetFile)
return AAsset_seek(m_assetFile, 0, SEEK_CUR);
return -1;
}
- virtual bool seek(qint64 pos)
+ bool seek(qint64 pos) override
{
if (m_assetFile)
return pos == AAsset_seek(m_assetFile, pos, SEEK_SET);
return false;
}
- virtual qint64 read(char *data, qint64 maxlen)
+ qint64 read(char *data, qint64 maxlen) override
{
if (m_assetFile)
return AAsset_read(m_assetFile, data, maxlen);
return -1;
}
- virtual bool isSequential() const
+ bool isSequential() const override
{
return false;
}
- virtual bool caseSensitive() const
+ bool caseSensitive() const override
{
return true;
}
- virtual bool isRelativePath() const
+ bool isRelativePath() const override
{
return false;
}
- virtual FileFlags fileFlags(FileFlags type = FileInfoAll) const
+ FileFlags fileFlags(FileFlags type = FileInfoAll) const override
{
FileFlags flags(ReadOwnerPerm|ReadUserPerm|ReadGroupPerm|ReadOtherPerm|ExistsFlag);
if (m_assetFile)
@@ -206,7 +206,7 @@ public:
return type & flags;
}
- virtual QString fileName(FileName file = DefaultName) const
+ QString fileName(FileName file = DefaultName) const override
{
int pos;
switch (file) {
@@ -231,7 +231,7 @@ public:
}
}
- virtual void setFileName(const QString &file)
+ void setFileName(const QString &file) override
{
if (file == m_fileName)
return;
@@ -243,7 +243,7 @@ public:
close();
}
- virtual Iterator *beginEntryList(QDir::Filters filters, const QStringList &filterNames)
+ Iterator *beginEntryList(QDir::Filters filters, const QStringList &filterNames) override
{
if (!m_assetDir.isNull())
return new AndroidAbstractFileEngineIterator(filters, filterNames, m_assetDir, m_fileName);
diff --git a/src/plugins/platforms/android/qandroidassetsfileenginehandler.h b/src/plugins/platforms/android/qandroidassetsfileenginehandler.h
index b09d8090a4..f99dc9a11a 100644
--- a/src/plugins/platforms/android/qandroidassetsfileenginehandler.h
+++ b/src/plugins/platforms/android/qandroidassetsfileenginehandler.h
@@ -55,7 +55,7 @@ class AndroidAssetsFileEngineHandler: public QAbstractFileEngineHandler
public:
AndroidAssetsFileEngineHandler();
virtual ~AndroidAssetsFileEngineHandler();
- QAbstractFileEngine *create(const QString &fileName) const;
+ QAbstractFileEngine *create(const QString &fileName) const override;
private:
void prepopulateCache() const;
diff --git a/src/plugins/platforms/android/qandroideventdispatcher.h b/src/plugins/platforms/android/qandroideventdispatcher.h
index 86a7e460b3..057a1660c9 100644
--- a/src/plugins/platforms/android/qandroideventdispatcher.h
+++ b/src/plugins/platforms/android/qandroideventdispatcher.h
@@ -56,7 +56,7 @@ public:
void goingToStop(bool stop);
protected:
- bool processEvents(QEventLoop::ProcessEventsFlags flags);
+ bool processEvents(QEventLoop::ProcessEventsFlags flags) override;
private:
QAtomicInt m_stopRequest;
diff --git a/src/plugins/platforms/android/qandroidinputcontext.h b/src/plugins/platforms/android/qandroidinputcontext.h
index 8a33ff71cc..ce0ec8724c 100644
--- a/src/plugins/platforms/android/qandroidinputcontext.h
+++ b/src/plugins/platforms/android/qandroidinputcontext.h
@@ -80,21 +80,21 @@ public:
QAndroidInputContext();
~QAndroidInputContext();
static QAndroidInputContext * androidInputContext();
- bool isValid() const { return true; }
-
- void reset();
- void commit();
- void update(Qt::InputMethodQueries queries);
- void invokeAction(QInputMethod::Action action, int cursorPosition);
- QRectF keyboardRect() const;
- bool isAnimating() const;
- void showInputPanel();
- void hideInputPanel();
- bool isInputPanelVisible() const;
+ bool isValid() const override { return true; }
+
+ void reset() override;
+ void commit() override;
+ void update(Qt::InputMethodQueries queries) override;
+ void invokeAction(QInputMethod::Action action, int cursorPosition) override;
+ QRectF keyboardRect() const override;
+ bool isAnimating() const override;
+ void showInputPanel() override;
+ void hideInputPanel() override;
+ bool isInputPanelVisible() const override;
bool isComposing() const;
void clear();
- void setFocusObject(QObject *object);
+ void setFocusObject(QObject *object) override;
void sendShortcut(const QKeySequence &);
//---------------//
diff --git a/src/plugins/platforms/android/qandroidplatformaccessibility.h b/src/plugins/platforms/android/qandroidplatformaccessibility.h
index 3a428ca1ad..8216c05fa6 100644
--- a/src/plugins/platforms/android/qandroidplatformaccessibility.h
+++ b/src/plugins/platforms/android/qandroidplatformaccessibility.h
@@ -51,7 +51,7 @@ public:
QAndroidPlatformAccessibility();
~QAndroidPlatformAccessibility();
- virtual void notifyAccessibilityUpdate(QAccessibleEvent *event);
+ void notifyAccessibilityUpdate(QAccessibleEvent *event) override;
};
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/android/qandroidplatformbackingstore.h b/src/plugins/platforms/android/qandroidplatformbackingstore.h
index e4a161d608..a3a65aa30e 100644
--- a/src/plugins/platforms/android/qandroidplatformbackingstore.h
+++ b/src/plugins/platforms/android/qandroidplatformbackingstore.h
@@ -50,10 +50,10 @@ class QAndroidPlatformBackingStore : public QPlatformBackingStore
{
public:
explicit QAndroidPlatformBackingStore(QWindow *window);
- virtual QPaintDevice *paintDevice();
- virtual void flush(QWindow *window, const QRegion &region, const QPoint &offset);
- virtual void resize(const QSize &size, const QRegion &staticContents);
- QImage toImage() const { return m_image; }
+ QPaintDevice *paintDevice() override;
+ void flush(QWindow *window, const QRegion &region, const QPoint &offset) override;
+ void resize(const QSize &size, const QRegion &staticContents) override;
+ QImage toImage() const override { return m_image; }
void setBackingStore(QWindow *window);
protected:
QImage m_image;
diff --git a/src/plugins/platforms/android/qandroidplatformclipboard.h b/src/plugins/platforms/android/qandroidplatformclipboard.h
index 47976c1693..dfc3629c10 100644
--- a/src/plugins/platforms/android/qandroidplatformclipboard.h
+++ b/src/plugins/platforms/android/qandroidplatformclipboard.h
@@ -51,9 +51,9 @@ class QAndroidPlatformClipboard: public QPlatformClipboard
public:
QAndroidPlatformClipboard();
- virtual QMimeData *mimeData(QClipboard::Mode mode = QClipboard::Clipboard);
- virtual void setMimeData(QMimeData *data, QClipboard::Mode mode = QClipboard::Clipboard);
- virtual bool supportsMode(QClipboard::Mode mode) const;
+ QMimeData *mimeData(QClipboard::Mode mode = QClipboard::Clipboard) override;
+ void setMimeData(QMimeData *data, QClipboard::Mode mode = QClipboard::Clipboard) override;
+ bool supportsMode(QClipboard::Mode mode) const override;
private:
QMimeData m_mimeData;
diff --git a/src/plugins/platforms/android/qandroidplatformdialoghelpers.h b/src/plugins/platforms/android/qandroidplatformdialoghelpers.h
index 5c3aef2bc1..694b4c7580 100644
--- a/src/plugins/platforms/android/qandroidplatformdialoghelpers.h
+++ b/src/plugins/platforms/android/qandroidplatformdialoghelpers.h
@@ -53,11 +53,11 @@ class QAndroidPlatformMessageDialogHelper: public QPlatformMessageDialogHelper
Q_OBJECT
public:
QAndroidPlatformMessageDialogHelper();
- void exec();
+ void exec() override;
bool show(Qt::WindowFlags windowFlags,
- Qt::WindowModality windowModality,
- QWindow *parent);
- void hide();
+ Qt::WindowModality windowModality,
+ QWindow *parent) override;
+ void hide() override;
public slots:
void dialogResult(int buttonID);
diff --git a/src/plugins/platforms/android/qandroidplatformfontdatabase.h b/src/plugins/platforms/android/qandroidplatformfon