summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-04-04 23:01:17 +0000
committerThe Qt Project <gerrit-noreply@qt-project.org>2019-04-04 23:01:17 +0000
commited485243b594a730cebee4d76847e0f556d369f4 (patch)
tree545dd98a3138782df786f742cac02bc63113eaf6
parent8d7c97d428cdf89c3419a4e13b62a9849feefce9 (diff)
parenteb606d85b3f1548445cfd1fee43f882da88fb6e7 (diff)
Merge "Merge remote-tracking branch 'origin/5.13' into dev" into refs/staging/dev
-rw-r--r--configure.pri7
-rw-r--r--dist/changes-5.12.2105
-rw-r--r--examples/corelib/serialization/convert/xmlconverter.cpp6
-rw-r--r--examples/corelib/tools/doc/src/customtype.qdoc7
-rw-r--r--examples/vulkan/hellovulkancubes/renderer.cpp7
-rw-r--r--examples/widgets/desktop/systray/main.cpp2
-rw-r--r--examples/widgets/dialogs/classwizard/main.cpp2
-rw-r--r--examples/widgets/dialogs/licensewizard/main.cpp2
-rw-r--r--examples/widgets/dialogs/standarddialogs/main.cpp1
-rw-r--r--examples/widgets/dialogs/trivialwizard/trivialwizard.cpp2
-rw-r--r--examples/widgets/statemachine/factorial/main.cpp3
-rw-r--r--mkspecs/common/ghs-integrity-armv8.conf4
-rw-r--r--mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in1
-rw-r--r--mkspecs/features/qml_module.prf20
-rw-r--r--mkspecs/features/qt_configure.prf17
-rw-r--r--mkspecs/features/resources.prf8
-rw-r--r--mkspecs/wasm-emscripten/qmake.conf12
-rw-r--r--mkspecs/win32-clang-msvc/qmake.conf22
-rw-r--r--mkspecs/win32-g++/qmake.conf4
-rw-r--r--qmake/generators/win32/msvc_nmake.cpp21
-rw-r--r--qmake/main.cpp26
-rw-r--r--src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java13
-rw-r--r--src/android/templates/AndroidManifest.xml6
-rw-r--r--src/corelib/Qt5CoreMacros.cmake4
-rw-r--r--src/corelib/animation/qabstractanimation.cpp18
-rw-r--r--src/corelib/codecs/qtextcodec.cpp4
-rw-r--r--src/corelib/codecs/qutfcodec.cpp4
-rw-r--r--src/corelib/codecs/qutfcodec_p.h2
-rw-r--r--src/corelib/configure.json23
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_global_qglobal.cpp6
-rw-r--r--src/corelib/doc/src/datastreamformat.qdoc402
-rw-r--r--src/corelib/global/global.pri1
-rw-r--r--src/corelib/global/minimum-linux_p.h6
-rw-r--r--src/corelib/global/qcompilerdetection.h13
-rw-r--r--src/corelib/global/qflags.h84
-rw-r--r--src/corelib/global/qfloat16.cpp33
-rw-r--r--src/corelib/global/qfloat16.h84
-rw-r--r--src/corelib/global/qglobal.cpp18
-rw-r--r--src/corelib/global/qglobal.h32
-rw-r--r--src/corelib/global/qglobalstatic.h2
-rw-r--r--src/corelib/global/qlibraryinfo.cpp4
-rw-r--r--src/corelib/global/qlibraryinfo.h4
-rw-r--r--src/corelib/global/qlogging.cpp6
-rw-r--r--src/corelib/global/qlogging.h4
-rw-r--r--src/corelib/global/qnamespace.h6
-rw-r--r--src/corelib/global/qnumeric_p.h6
-rw-r--r--src/corelib/global/qrandom.cpp25
-rw-r--r--src/corelib/global/qrandom.h6
-rw-r--r--src/corelib/io/qdebug.h2
-rw-r--r--src/corelib/io/qdir.h6
-rw-r--r--src/corelib/io/qfileinfo.h4
-rw-r--r--src/corelib/io/qfilesystemengine_win.cpp4
-rw-r--r--src/corelib/io/qprocess.cpp4
-rw-r--r--src/corelib/io/qprocess.h4
-rw-r--r--src/corelib/io/qstandardpaths_unix.cpp2
-rw-r--r--src/corelib/io/qstorageinfo.h4
-rw-r--r--src/corelib/io/qtemporaryfile.cpp4
-rw-r--r--src/corelib/io/qurl.cpp2
-rw-r--r--src/corelib/io/qurl.h10
-rw-r--r--src/corelib/io/qurlquery.cpp2
-rw-r--r--src/corelib/io/qurlquery.h8
-rw-r--r--src/corelib/io/qurlrecode.cpp2
-rw-r--r--src/corelib/io/qwindowspipereader.cpp4
-rw-r--r--src/corelib/io/qwindowspipewriter.cpp4
-rw-r--r--src/corelib/itemmodels/qabstractitemmodel.cpp14
-rw-r--r--src/corelib/itemmodels/qabstractitemmodel.h38
-rw-r--r--src/corelib/itemmodels/qconcatenatetablesproxymodel.cpp2
-rw-r--r--src/corelib/itemmodels/qitemselectionmodel.h8
-rw-r--r--src/corelib/kernel/qabstracteventdispatcher.cpp2
-rw-r--r--src/corelib/kernel/qcore_unix_p.h2
-rw-r--r--src/corelib/kernel/qcoreapplication.cpp4
-rw-r--r--src/corelib/kernel/qcoreevent.cpp8
-rw-r--r--src/corelib/kernel/qcoreevent.h2
-rw-r--r--src/corelib/kernel/qdeadlinetimer.cpp24
-rw-r--r--src/corelib/kernel/qdeadlinetimer.h50
-rw-r--r--src/corelib/kernel/qelapsedtimer.cpp6
-rw-r--r--src/corelib/kernel/qelapsedtimer.h30
-rw-r--r--src/corelib/kernel/qelapsedtimer_generic.cpp22
-rw-r--r--src/corelib/kernel/qelapsedtimer_mac.cpp24
-rw-r--r--src/corelib/kernel/qelapsedtimer_unix.cpp24
-rw-r--r--src/corelib/kernel/qelapsedtimer_win.cpp22
-rw-r--r--src/corelib/kernel/qeventdispatcher_unix_p.h12
-rw-r--r--src/corelib/kernel/qfunctions_fake_env_p.h4
-rw-r--r--src/corelib/kernel/qmetaobject.cpp6
-rw-r--r--src/corelib/kernel/qmetaobject_p.h2
-rw-r--r--src/corelib/kernel/qmetatype.cpp2
-rw-r--r--src/corelib/kernel/qobject.cpp546
-rw-r--r--src/corelib/kernel/qobject.h32
-rw-r--r--src/corelib/kernel/qobject_p.h172
-rw-r--r--src/corelib/kernel/qobjectdefs.h14
-rw-r--r--src/corelib/kernel/qobjectdefs_impl.h4
-rw-r--r--src/corelib/kernel/qsignalmapper.cpp2
-rw-r--r--src/corelib/kernel/qtestsupport_core.cpp2
-rw-r--r--src/corelib/kernel/qtimer.h2
-rw-r--r--src/corelib/kernel/qtranslator.cpp3
-rw-r--r--src/corelib/kernel/qvariant.cpp2
-rw-r--r--src/corelib/kernel/qvariant.h72
-rw-r--r--src/corelib/mimetypes/mimetypes.pri2
-rw-r--r--src/corelib/mimetypes/qmimeglobpattern_p.h2
-rw-r--r--src/corelib/mimetypes/qmimemagicrule_p.h2
-rw-r--r--src/corelib/mimetypes/qmimemagicrulematcher_p.h2
-rw-r--r--src/corelib/mimetypes/qmimeprovider.cpp2
-rw-r--r--src/corelib/mimetypes/qmimetype.cpp2
-rw-r--r--src/corelib/mimetypes/qmimetype.h8
-rw-r--r--src/corelib/platform/wasm/qstdweb.cpp2
-rw-r--r--src/corelib/plugin/qlibrary.cpp8
-rw-r--r--src/corelib/plugin/qpluginloader.cpp2
-rw-r--r--src/corelib/plugin/quuid.cpp16
-rw-r--r--src/corelib/plugin/quuid.h44
-rw-r--r--src/corelib/serialization/qjson_p.h12
-rw-r--r--src/corelib/serialization/qjsonarray.h6
-rw-r--r--src/corelib/serialization/qjsondocument.h6
-rw-r--r--src/corelib/serialization/qjsonobject.h6
-rw-r--r--src/corelib/serialization/qjsonvalue.h6
-rw-r--r--src/corelib/serialization/qtextstream.h4
-rw-r--r--src/corelib/serialization/qxmlstream.h24
-rw-r--r--src/corelib/statemachine/qstatemachine_p.h12
-rw-r--r--src/corelib/thread/qatomic.h18
-rw-r--r--src/corelib/thread/qatomic_bootstrap.h10
-rw-r--r--src/corelib/thread/qatomic_cxx11.h86
-rw-r--r--src/corelib/thread/qatomic_msvc.h94
-rw-r--r--src/corelib/thread/qbasicatomic.h194
-rw-r--r--src/corelib/thread/qfutex_p.h2
-rw-r--r--src/corelib/thread/qgenericatomic.h98
-rw-r--r--src/corelib/thread/qmutex.cpp14
-rw-r--r--src/corelib/thread/qmutex.h54
-rw-r--r--src/corelib/thread/qmutex_linux.cpp8
-rw-r--r--src/corelib/thread/qmutex_mac.cpp2
-rw-r--r--src/corelib/thread/qmutex_p.h4
-rw-r--r--src/corelib/thread/qmutex_unix.cpp4
-rw-r--r--src/corelib/thread/qmutex_win.cpp2
-rw-r--r--src/corelib/thread/qorderedmutexlocker_p.h2
-rw-r--r--src/corelib/thread/qreadwritelock.h36
-rw-r--r--src/corelib/thread/qsemaphore.h14
-rw-r--r--src/corelib/thread/qthread.cpp6
-rw-r--r--src/corelib/thread/qthread.h4
-rw-r--r--src/corelib/thread/qthread_p.h4
-rw-r--r--src/corelib/thread/qthread_unix.cpp4
-rw-r--r--src/corelib/thread/qthread_win.cpp8
-rw-r--r--src/corelib/tools/qalgorithms.h62
-rw-r--r--src/corelib/tools/qarraydata.cpp6
-rw-r--r--src/corelib/tools/qarraydata.h10
-rw-r--r--src/corelib/tools/qarraydatapointer.h8
-rw-r--r--src/corelib/tools/qbitarray.h10
-rw-r--r--src/corelib/tools/qbytearray.cpp6
-rw-r--r--src/corelib/tools/qbytearray.h52
-rw-r--r--src/corelib/tools/qbytearraymatcher.cpp2
-rw-r--r--src/corelib/tools/qbytearraymatcher.h14
-rw-r--r--src/corelib/tools/qcache.h4
-rw-r--r--src/corelib/tools/qchar.cpp56
-rw-r--r--src/corelib/tools/qchar.h250
-rw-r--r--src/corelib/tools/qcollator.h10
-rw-r--r--src/corelib/tools/qcommandlineoption.cpp4
-rw-r--r--src/corelib/tools/qcommandlineoption.h4
-rw-r--r--src/corelib/tools/qdatetime.cpp27
-rw-r--r--src/corelib/tools/qdatetime.h18
-rw-r--r--src/corelib/tools/qeasingcurve.h6
-rw-r--r--src/corelib/tools/qhash.cpp26
-rw-r--r--src/corelib/tools/qhash.h24
-rw-r--r--src/corelib/tools/qhashfunctions.h52
-rw-r--r--src/corelib/tools/qiterator.h4
-rw-r--r--src/corelib/tools/qlinkedlist.h44
-rw-r--r--src/corelib/tools/qlist.h98
-rw-r--r--src/corelib/tools/qlocale.cpp8
-rw-r--r--src/corelib/tools/qlocale.h8
-rw-r--r--src/corelib/tools/qlocale_p.h12
-rw-r--r--src/corelib/tools/qmap.h18
-rw-r--r--src/corelib/tools/qmargins.h208
-rw-r--r--src/corelib/tools/qpoint.h6
-rw-r--r--src/corelib/tools/qqueue.h2
-rw-r--r--src/corelib/tools/qrect.cpp26
-rw-r--r--src/corelib/tools/qrect.h624
-rw-r--r--src/corelib/tools/qrefcount.h16
-rw-r--r--src/corelib/tools/qregexp.cpp4
-rw-r--r--src/corelib/tools/qregexp.h8
-rw-r--r--src/corelib/tools/qregularexpression.cpp2
-rw-r--r--src/corelib/tools/qregularexpression.h16
-rw-r--r--src/corelib/tools/qringbuffer_p.h14
-rw-r--r--src/corelib/tools/qscopedpointer.h36
-rw-r--r--src/corelib/tools/qscopedvaluerollback.h14
-rw-r--r--src/corelib/tools/qscopeguard.h17
-rw-r--r--src/corelib/tools/qset.h28
-rw-r--r--src/corelib/tools/qshareddata.h24
-rw-r--r--src/corelib/tools/qsharedpointer.cpp2
-rw-r--r--src/corelib/tools/qsharedpointer_impl.h98
-rw-r--r--src/corelib/tools/qsize.cpp8
-rw-r--r--src/corelib/tools/qsize.h254
-rw-r--r--src/corelib/tools/qstack.h2
-rw-r--r--src/corelib/tools/qstring.cpp100
-rw-r--r--src/corelib/tools/qstring.h422
-rw-r--r--src/corelib/tools/qstringalgorithms.h44
-rw-r--r--src/corelib/tools/qstringbuilder.cpp2
-rw-r--r--src/corelib/tools/qstringbuilder.h6
-rw-r--r--src/corelib/tools/qstringlist.h6
-rw-r--r--src/corelib/tools/qstringliteral.h2
-rw-r--r--src/corelib/tools/qstringview.h84
-rw-r--r--src/corelib/tools/qtimezone.cpp2
-rw-r--r--src/corelib/tools/qtimezone.h6
-rw-r--r--src/corelib/tools/qtimezoneprivate_p.h5
-rw-r--r--src/corelib/tools/qtimezoneprivate_tz.cpp50
-rw-r--r--src/corelib/tools/qtools_p.h14
-rw-r--r--src/corelib/tools/qunicodetables.cpp16
-rw-r--r--src/corelib/tools/qunicodetables_p.h20
-rw-r--r--src/corelib/tools/qvector.h40
-rw-r--r--src/corelib/tools/qversionnumber.cpp4
-rw-r--r--src/corelib/tools/qversionnumber.h42
-rw-r--r--src/dbus/qdbusabstractinterface.cpp4
-rw-r--r--src/dbus/qdbusintegrator_p.h19
-rw-r--r--src/gui/image/qiconloader.cpp5
-rw-r--r--src/gui/image/qimage.cpp47
-rw-r--r--src/gui/image/qimage.h4
-rw-r--r--src/gui/image/qimage_neon.cpp66
-rw-r--r--src/gui/image/qimage_p.h6
-rw-r--r--src/gui/image/qpixmap.cpp15
-rw-r--r--src/gui/image/qplatformpixmap.cpp1
-rw-r--r--src/gui/kernel/qplatformgraphicsbuffer.h2
-rw-r--r--src/gui/kernel/qplatformintegration.cpp81
-rw-r--r--src/gui/kernel/qplatformintegration.h6
-rw-r--r--src/gui/kernel/qplatformscreen.cpp3
-rw-r--r--src/gui/kernel/qplatformwindow.cpp7
-rw-r--r--src/gui/kernel/qscreen.cpp20
-rw-r--r--src/gui/kernel/qscreen.h1
-rw-r--r--src/gui/kernel/qwindow.cpp14
-rw-r--r--src/gui/kernel/qwindow_p.h10
-rw-r--r--src/gui/kernel/qwindowsysteminterface.cpp61
-rw-r--r--src/gui/kernel/qwindowsysteminterface.h4
-rw-r--r--src/gui/opengl/qopengltexture.cpp29
-rw-r--r--src/gui/painting/painting.pri6
-rw-r--r--src/gui/painting/qbrush.cpp12
-rw-r--r--src/gui/painting/qdrawhelper_neon.cpp13
-rw-r--r--src/gui/painting/qoutlinemapper.cpp5
-rw-r--r--src/gui/painting/qplatformbackingstore.cpp5
-rw-r--r--src/gui/text/qsyntaxhighlighter.cpp7
-rw-r--r--src/gui/text/qtextcursor.cpp23
-rw-r--r--src/gui/text/qtextdocument_p.cpp18
-rw-r--r--src/gui/text/qtextdocument_p.h2
-rw-r--r--src/gui/text/qtextdocumentlayout.cpp81
-rw-r--r--src/gui/text/qtextengine.cpp2
-rw-r--r--src/network/access/qabstractnetworkcache.cpp4
-rw-r--r--src/network/access/qhttp2protocolhandler.cpp2
-rw-r--r--src/network/access/qnetworkaccesscachebackend.cpp17
-rw-r--r--src/network/access/qnetworkaccessmanager.cpp3
-rw-r--r--src/network/access/qnetworkreplyhttpimpl.cpp14
-rw-r--r--src/network/access/qnetworkreplywasmimpl.cpp22
-rw-r--r--src/network/configure.json4
-rw-r--r--src/network/ssl/qsslkey_openssl.cpp9
-rw-r--r--src/network/ssl/qsslkey_qt.cpp2
-rw-r--r--src/network/ssl/qsslkey_winrt.cpp9
-rw-r--r--src/network/ssl/qsslsocket_openssl_symbols.cpp10
-rw-r--r--src/network/ssl/qsslsocket_openssl_symbols_p.h5
-rw-r--r--src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp2
-rw-r--r--src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm21
-rw-r--r--src/platformsupport/fontdatabases/windows/qwindowsfontengine.cpp25
-rw-r--r--src/platformsupport/glxconvenience/qglxconvenience.cpp4
-rw-r--r--src/platformsupport/input/tslib/qtslib.cpp10
-rw-r--r--src/platformsupport/input/tslib/qtslib_p.h9
-rw-r--r--src/platformsupport/input/xkbcommon/xkbcommon.pro2
-rw-r--r--src/plugins/platforminputcontexts/ibus/ibus.pro2
-rw-r--r--src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp14
-rw-r--r--src/plugins/platforminputcontexts/platforminputcontexts.pro11
-rw-r--r--src/plugins/platforms/android/qandroidplatformintegration.cpp2
-rw-r--r--src/plugins/platforms/bsdfb/qbsdfbintegration.cpp5
-rw-r--r--src/plugins/platforms/cocoa/cocoa.pro4
-rw-r--r--src/plugins/platforms/cocoa/qcocoabackingstore.h52
-rw-r--r--src/plugins/platforms/cocoa/qcocoabackingstore.mm543
-rw-r--r--src/plugins/platforms/cocoa/qcocoaintegration.mm17
-rw-r--r--src/plugins/platforms/cocoa/qcocoamenu.mm3
-rw-r--r--src/plugins/platforms/cocoa/qcocoasystemsettings.mm3
-rw-r--r--src/plugins/platforms/cocoa/qiosurfacegraphicsbuffer.h (renamed from src/corelib/global/qfloat16_p.h)78
-rw-r--r--src/plugins/platforms/cocoa/qiosurfacegraphicsbuffer.mm188
-rw-r--r--src/plugins/platforms/cocoa/qnsview_drawing.mm9
-rw-r--r--src/plugins/platforms/cocoa/qnsview_mouse.mm5
-rw-r--r--src/plugins/platforms/directfb/qdirectfb_egl.cpp3
-rw-r--r--src/plugins/platforms/directfb/qdirectfbintegration.cpp3
-rw-r--r--src/plugins/platforms/eglfs/api/qeglfsdeviceintegration.cpp4
-rw-r--r--src/plugins/platforms/eglfs/api/qeglfsintegration.cpp12
-rw-r--r--src/plugins/platforms/eglfs/api/qeglfsintegration_p.h3
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_emu/qeglfsemulatorintegration.cpp6
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp2
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsdevice.cpp2
-rw-r--r--src/plugins/platforms/haiku/qhaikuintegration.cpp5
-rw-r--r--src/plugins/platforms/integrity/qintegrityfbintegration.cpp6
-rw-r--r--src/plugins/platforms/ios/qiosintegration.h4
-rw-r--r--src/plugins/platforms/ios/qiosintegration.mm4
-rw-r--r--src/plugins/platforms/ios/qiosscreen.mm10
-rw-r--r--src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp5
-rw-r--r--src/plugins/platforms/linuxfb/qlinuxfbintegration.h2
-rw-r--r--src/plugins/platforms/minimal/qminimalintegration.cpp3
-rw-r--r--src/plugins/platforms/minimalegl/qminimaleglintegration.cpp5
-rw-r--r--src/plugins/platforms/offscreen/qoffscreenintegration.cpp3
-rw-r--r--src/plugins/platforms/openwfd/qopenwfdintegration.cpp11
-rw-r--r--src/plugins/platforms/openwfd/qopenwfdintegration.h2
-rw-r--r--src/plugins/platforms/openwfd/qopenwfdport.cpp4
-rw-r--r--src/plugins/platforms/qnx/qqnxintegration.cpp6
-rw-r--r--src/plugins/platforms/vnc/qvncintegration.cpp5
-rw-r--r--src/plugins/platforms/wasm/qtloader.js29
-rw-r--r--src/plugins/platforms/wasm/qwasmclipboard.cpp38
-rw-r--r--src/plugins/platforms/wasm/qwasmcompositor.cpp4
-rw-r--r--src/plugins/platforms/wasm/qwasmcompositor.h2
-rw-r--r--src/plugins/platforms/wasm/qwasmeventtranslator.cpp64
-rw-r--r--src/plugins/platforms/wasm/qwasmintegration.cpp77
-rw-r--r--src/plugins/platforms/wasm/qwasmintegration.h13
-rw-r--r--src/plugins/platforms/wasm/qwasmservices.cpp45
-rw-r--r--src/plugins/platforms/wasm/qwasmservices.h45
-rw-r--r--src/plugins/platforms/wasm/wasm.pro6
-rw-r--r--src/plugins/platforms/wasm/wasm_shell.html8
-rw-r--r--src/plugins/platforms/windows/qwindowsintegration.h3
-rw-r--r--src/plugins/platforms/windows/qwindowsscreen.cpp8
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.cpp13
-rw-r--r--src/plugins/platforms/winrt/qwinrtintegration.cpp4
-rw-r--r--src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp18
-rw-r--r--src/plugins/platforms/xcb/nativepainting/qbackingstore_x11.cpp4
-rw-r--r--src/plugins/platforms/xcb/nativepainting/qpaintengine_x11.cpp17
-rw-r--r--src/plugins/platforms/xcb/nativepainting/qpixmap_x11.cpp14
-rw-r--r--src/plugins/platforms/xcb/nativepainting/qpixmap_x11_p.h5
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection.cpp3
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection_basic.h3
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection_screens.cpp12
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection_xi2.cpp30
-rw-r--r--src/plugins/platforms/xcb/qxcbintegration.h2
-rw-r--r--src/plugins/platforms/xcb/qxcbnativeinterface.cpp7
-rw-r--r--src/plugins/sqldrivers/configure.pri4
-rw-r--r--src/plugins/styles/mac/qmacstyle_mac.mm176
-rw-r--r--src/sql/kernel/qsqlerror.cpp2
-rw-r--r--src/testlib/qappletestlogger.cpp130
-rw-r--r--src/testlib/qappletestlogger_p.h7
-rw-r--r--src/testlib/qsignaldumper.cpp6
-rw-r--r--src/testlib/qtestcase.cpp72
-rw-r--r--src/tools/androiddeployqt/main.cpp2
-rw-r--r--src/tools/uic/cpp/cppwriteincludes.h6
-rw-r--r--src/tools/uic/cpp/cppwriteinitialization.cpp37
-rw-r--r--src/tools/uic/driver.cpp23
-rw-r--r--src/tools/uic/driver.h3
-rw-r--r--src/widgets/dialogs/qdialog.h10
-rw-r--r--src/widgets/doc/src/widgets-and-layouts/styles.qdoc2
-rw-r--r--src/widgets/itemviews/qlistwidget.h3
-rw-r--r--src/widgets/itemviews/qtablewidget.cpp2
-rw-r--r--src/widgets/kernel/mac.pri5
-rw-r--r--src/widgets/kernel/qgesturemanager.cpp5
-rw-r--r--src/widgets/kernel/qgesturerecognizer.cpp6
-rw-r--r--src/widgets/kernel/qwidget.cpp7
-rw-r--r--src/widgets/kernel/qwidgetwindow.cpp7
-rw-r--r--src/widgets/styles/qstyle.cpp4
-rw-r--r--src/widgets/styles/qstylesheetstyle.cpp9
-rw-r--r--src/widgets/widgets/qabstractspinbox.cpp16
-rw-r--r--src/widgets/widgets/qdockwidget.cpp28
-rw-r--r--src/widgets/widgets/qdockwidget_p.h28
-rw-r--r--src/widgets/widgets/qmainwindowlayout.cpp27
-rw-r--r--src/widgets/widgets/qspinbox.cpp4
-rw-r--r--src/widgets/widgets/qsplashscreen.cpp13
-rw-r--r--src/widgets/widgets/qsplitter.cpp8
-rw-r--r--tests/auto/corelib/global/qnumeric/tst_qnumeric.cpp2
-rw-r--r--tests/auto/corelib/itemmodels/qidentityproxymodel/tst_qidentityproxymodel.cpp5
-rw-r--r--tests/auto/corelib/itemmodels/qitemmodel/tst_qitemmodel.cpp3
-rw-r--r--tests/auto/corelib/itemmodels/qsortfilterproxymodel_common/tst_qsortfilterproxymodel.cpp45
-rw-r--r--tests/auto/corelib/itemmodels/qsortfilterproxymodel_common/tst_qsortfilterproxymodel.h3
-rw-r--r--tests/auto/corelib/kernel/qobject/tst_qobject.cpp7
-rw-r--r--tests/auto/corelib/kernel/qtimer/BLACKLIST5
-rw-r--r--tests/auto/corelib/serialization/qdatastream_core_pixmap/qdatastream_core_pixmap.pro4
-rw-r--r--tests/auto/corelib/serialization/qdatastream_core_pixmap/tst_qdatastream_core_pixmap.cpp68
-rw-r--r--tests/auto/corelib/serialization/serialization.pro1
-rw-r--r--tests/auto/corelib/thread/qthread/tst_qthread.cpp2
-rw-r--r--tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp1
-rw-r--r--tests/auto/corelib/tools/qdate/tst_qdate.cpp32
-rw-r--r--tests/auto/corelib/tools/qlocale/tst_qlocale.cpp43
-rw-r--r--tests/auto/corelib/tools/qscopedvaluerollback/tst_qscopedvaluerollback.cpp13
-rw-r--r--tests/auto/corelib/tools/qtime/tst_qtime.cpp5
-rw-r--r--tests/auto/corelib/tools/qtimezone/tst_qtimezone.cpp4
-rw-r--r--tests/auto/corelib/tools/tools.pro1
-rw-r--r--tests/auto/gui/image/qimage/tst_qimage.cpp55
-rw-r--r--tests/auto/gui/image/qpixmap/tst_qpixmap.cpp34
-rw-r--r--tests/auto/gui/painting/qbrush/tst_qbrush.cpp2
-rw-r--r--tests/auto/network/access/qabstractnetworkcache/tst_qabstractnetworkcache.cpp9
-rw-r--r--tests/auto/network/access/qnetworkcookiejar/tst_qnetworkcookiejar.cpp3
-rw-r--r--tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp31
-rw-r--r--tests/auto/network/kernel/qhostinfo/BLACKLIST2
-rw-r--r--tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp96
-rw-r--r--tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp4
-rw-r--r--tests/auto/network/ssl/qsslsocket_onDemandCertificates_member/BLACKLIST2
-rw-r--r--tests/auto/other/gestures/BLACKLIST1
-rw-r--r--tests/auto/other/qobjectrace/tst_qobjectrace.cpp12
-rw-r--r--tests/auto/sql/kernel/qsqlerror/tst_qsqlerror.cpp24
-rw-r--r--tests/auto/testlib/selftests/expected_globaldata.lightxml155
-rw-r--r--tests/auto/testlib/selftests/expected_globaldata.tap77
-rw-r--r--tests/auto/testlib/selftests/expected_globaldata.teamcity47
-rw-r--r--tests/auto/testlib/selftests/expected_globaldata.txt94
-rw-r--r--tests/auto/testlib/selftests/expected_globaldata.xml155
-rw-r--r--tests/auto/testlib/selftests/expected_globaldata.xunitxml128
-rw-r--r--tests/auto/testlib/selftests/expected_signaldumper.lightxml578
-rw-r--r--tests/auto/testlib/selftests/expected_signaldumper.tap151
-rw-r--r--tests/auto/testlib/selftests/expected_signaldumper.teamcity61
-rw-r--r--tests/auto/testlib/selftests/expected_signaldumper.txt149
-rw-r--r--tests/auto/testlib/selftests/expected_signaldumper.xml581
-rw-r--r--tests/auto/testlib/selftests/expected_signaldumper.xunitxml284
-rwxr-xr-xtests/auto/testlib/selftests/generate_expected_output.py12
-rw-r--r--tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp44
-rw-r--r--tests/auto/testlib/selftests/selftests.pri1
-rw-r--r--tests/auto/testlib/selftests/signaldumper/signaldumper.pro9
-rw-r--r--tests/auto/testlib/selftests/signaldumper/tst_signaldumper.cpp417
-rw-r--r--tests/auto/testlib/selftests/tst_selftests.cpp27
-rw-r--r--tests/auto/tools/qmake/testcompiler.cpp12
-rw-r--r--tests/auto/tools/qmake/testcompiler.h8
-rw-r--r--tests/auto/tools/qmake/testdata/simple_app/simple_app.pro5
-rw-r--r--tests/auto/tools/qmake/testdata/subdirs/simple_dll/simple_dll.pro1
-rw-r--r--tests/auto/tools/qmake/tst_qmake.cpp128
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsitem/BLACKLIST3
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp2
-rw-r--r--tests/auto/widgets/kernel/qwidget/BLACKLIST1
-rw-r--r--tests/auto/widgets/widgets/qdoublespinbox/tst_qdoublespinbox.cpp12
-rw-r--r--tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp2
-rw-r--r--tests/auto/widgets/widgets/qsizegrip/tst_qsizegrip.cpp59
-rw-r--r--tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp12
-rw-r--r--tests/benchmarks/corelib/kernel/kernel.pro3
-rw-r--r--tests/benchmarks/corelib/kernel/qtimer_vs_qmetaobject/tst_qtimer_vs_qmetaobject.cpp67
-rw-r--r--tests/manual/cocoa/noclickthrough/main.cpp48
-rw-r--r--tests/manual/cocoa/noclickthrough/noclickthrough.pro4
-rw-r--r--tests/manual/dialogs/filedialogpanel.cpp4
-rw-r--r--tests/manual/dialogs/main.cpp4
-rw-r--r--tests/manual/dialogs/printdialogpanel.cpp12
-rw-r--r--util/unicode/main.cpp14
420 files changed, 8655 insertions, 4433 deletions
diff --git a/configure.pri b/configure.pri
index d8ca93d839..d8d0260fa0 100644
--- a/configure.pri
+++ b/configure.pri
@@ -465,7 +465,9 @@ defineTest(reloadSpec) {
$$[QT_HOST_DATA/src]/mkspecs/features/mac/toolchain.prf \
$$[QT_HOST_DATA/src]/mkspecs/features/toolchain.prf
- _SAVED_CONFIG = $$CONFIG
+ saved_variables = CONFIG QMAKE_CXXFLAGS
+ for (name, saved_variables): \
+ _SAVED_$$name = $$eval($$name)
load(spec_pre)
# qdevice.pri gets written too late (and we can't write it early
# enough, as it's populated in stages, with later ones depending
@@ -474,7 +476,8 @@ defineTest(reloadSpec) {
eval($$l)
include($$QMAKESPEC/qmake.conf)
load(spec_post)
- CONFIG += $$_SAVED_CONFIG
+ for (name, saved_variables): \
+ $$name += $$eval(_SAVED_$$name)
load(default_pre)
# ensure pristine environment for configuration. again.
diff --git a/dist/changes-5.12.2 b/dist/changes-5.12.2
new file mode 100644
index 0000000000..dc61d135a7
--- /dev/null
+++ b/dist/changes-5.12.2
@@ -0,0 +1,105 @@
+Qt 5.12.2 is a bug-fix release. It maintains both forward and backward
+compatibility (source and binary) with Qt 5.12.0 through 5.12.1.
+
+For more details, refer to the online documentation included in this
+distribution. The documentation is also available online:
+
+https://doc.qt.io/qt-5/index.html
+
+The Qt version 5.12 series is binary compatible with the 5.11.x series.
+Applications compiled for 5.11 will continue to run with 5.12.
+
+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.
+
+****************************************************************************
+* Important Behavior Changes *
+****************************************************************************
+
+ - QtTestLib:
+ * [QTBUG-72928] Blacklisting of tests will be taken into account for
+ XPASS and XFAIL. A blacklisted test that causes an XPASS will no
+ longer be a fail.
+
+****************************************************************************
+* QtCore *
+****************************************************************************
+
+ - [QTBUG-72885] Fixed a number of warnings with Clang or Clang-Tidy in
+ Qt headers related to alignment of Qt private classes.
+
+ - QDate, QTime and QDateTime;
+ * [QTBUG-51208] Corrected documentation of how non-placeholder
+ characters are handled in format patterns passed to toString().
+
+ - QCoreApplication:
+ * [QTBUG-57171] Fixed an out-of-bounds access if the translatable
+ string passed to tr() ended in '%'.
+
+ - QFileInfo:
+ * [QTBUG-72644] Fixed a bug that would cause QFileInfo to report an
+ link incorrectly as a non-link.
+
+ - QLocale:
+ * Fixed a crash if qDebug() is used after main() has exited.
+ * [QTBUG-73403] Fixed a race condition in getting the system locale
+ (possible regression from Qt 5.11.x)
+
+ - QSysInfo:
+ * Fixed a bug on BSD systems in getting the machineUniqueId().
+ * Fixed a bug on Windows in 32-bit applications getting the
+ machineUniqueId() when the OS is 64-bit.
+
+ - QWaitCondition:
+ * Fixed handling of wait(QDeadlineTimer::Forever) on 32-bit platforms.
+
+****************************************************************************
+* QtWidgets *
+****************************************************************************
+
+ - ItemViews:
+ * Fixed a regression with wrongly drawn centered/right aligned item
+ texts
+
+****************************************************************************
+* Third-Party Code *
+****************************************************************************
+
+ - libpng was updated to version 1.6.36
+
+****************************************************************************
+* Freetype *
+****************************************************************************
+
+ - Upgraded bundled Freetype version to 2.9.1. This also adds support for
+ the latest emoji font in use on Android 9.
+
+****************************************************************************
+* Android *
+****************************************************************************
+
+ - Added the --no-strip command line option to androiddeployqt.
+
+ - qmake:
+ * Can now set the version name and code for Android using
+ ANDROID_VERSION_NAME and ANDROID_VERSION_CODE respectively in the pro
+ file.
+
+****************************************************************************
+* Windows *
+****************************************************************************
+
+ - Fixed an issue where loading fonts from files or data would sometimes
+ mistakenly classify them as oblique.
+
+****************************************************************************
+* qmake *
+****************************************************************************
+
+ - [QTBUG-27079] A new feature "cmdline" was added that implies "CONFIG +=
+ console" and "CONFIG -= app_bundle".
diff --git a/examples/corelib/serialization/convert/xmlconverter.cpp b/examples/corelib/serialization/convert/xmlconverter.cpp
index 62908273ce..e62801bf76 100644
--- a/examples/corelib/serialization/convert/xmlconverter.cpp
+++ b/examples/corelib/serialization/convert/xmlconverter.cpp
@@ -70,7 +70,7 @@ static QVariant variantFromXml(QXmlStreamReader &xml, Converter::Options options
static QVariantList listFromXml(QXmlStreamReader &xml, Converter::Options options)
{
QVariantList list;
- while (!xml.atEnd() && !xml.isEndElement()) {
+ while (!xml.atEnd() && !(xml.isEndElement() && xml.name() == QLatin1String("list"))) {
xml.readNext();
switch (xml.tokenType()) {
case QXmlStreamReader::StartElement:
@@ -107,7 +107,7 @@ static QVariantList listFromXml(QXmlStreamReader &xml, Converter::Options option
static VariantOrderedMap::value_type mapEntryFromXml(QXmlStreamReader &xml, Converter::Options options)
{
QVariant key, value;
- while (!xml.atEnd() && !xml.isEndElement()) {
+ while (!xml.atEnd() && !(xml.isEndElement() && xml.name() == QLatin1String("entry"))) {
xml.readNext();
switch (xml.tokenType()) {
case QXmlStreamReader::StartElement:
@@ -150,7 +150,7 @@ static QVariant mapFromXml(QXmlStreamReader &xml, Converter::Options options)
QVariantMap map1;
VariantOrderedMap map2;
- while (!xml.atEnd() && !xml.isEndElement()) {
+ while (!xml.atEnd() && !(xml.isEndElement() && xml.name() == QLatin1String("map"))) {
xml.readNext();
switch (xml.tokenType()) {
case QXmlStreamReader::StartElement:
diff --git a/examples/corelib/tools/doc/src/customtype.qdoc b/examples/corelib/tools/doc/src/customtype.qdoc
index 91b814808a..7ccfc95c70 100644
--- a/examples/corelib/tools/doc/src/customtype.qdoc
+++ b/examples/corelib/tools/doc/src/customtype.qdoc
@@ -117,8 +117,8 @@
\snippet tools/customtype/main.cpp storing a custom value
- Alternatively, the QVariant::fromValue() and qVariantSetValue() functions
- can be used if you are using a compiler without support for member template
+ Alternatively, the QVariant::fromValue() function can be used if
+ you are using a compiler without support for member template
functions.
The value can be retrieved using the QVariant::value() member template
@@ -126,9 +126,6 @@
\snippet tools/customtype/main.cpp retrieving a custom value
- Alternatively, the qVariantValue() template function can be used if
- you are using a compiler without support for member template functions.
-
\section1 Further Reading
The custom \c Message type can also be used with direct signal-slot
diff --git a/examples/vulkan/hellovulkancubes/renderer.cpp b/examples/vulkan/hellovulkancubes/renderer.cpp
index 5ada79ce79..f104d79002 100644
--- a/examples/vulkan/hellovulkancubes/renderer.cpp
+++ b/examples/vulkan/hellovulkancubes/renderer.cpp
@@ -49,6 +49,7 @@
****************************************************************************/
#include "renderer.h"
+#include "qrandom.h"
#include <QVulkanFunctions>
#include <QtConcurrentRun>
#include <QTime>
@@ -77,8 +78,6 @@ Renderer::Renderer(VulkanWindow *w, int initialCount)
m_cam(QVector3D(0.0f, 0.0f, 20.0f)), // starting camera position
m_instCount(initialCount)
{
- qsrand(QTime(0, 0, 0).secsTo(QTime::currentTime()));
-
m_floorModel.translate(0, -5, 0);
m_floorModel.rotate(-90, 1, 0, 0);
m_floorModel.scale(20, 100, 1);
@@ -793,7 +792,9 @@ void Renderer::ensureInstanceBuffer()
qDebug("Preparing instances %d..%d", m_preparedInstCount, m_instCount - 1);
char *p = m_instData.data();
p += m_preparedInstCount * PER_INSTANCE_DATA_SIZE;
- auto gen = [](float a, float b) { return float((qrand() % int(b - a + 1)) + a); };
+ auto gen = [](int a, int b) {
+ return float(QRandomGenerator::global()->bounded(double(b - a)) + a);
+ };
for (int i = m_preparedInstCount; i < m_instCount; ++i) {
// Apply a random translation to each instance of the mesh.
float t[] = { gen(-5, 5), gen(-4, 6), gen(-30, 5) };
diff --git a/examples/widgets/desktop/systray/main.cpp b/examples/widgets/desktop/systray/main.cpp
index 4e3e628767..2d91e4ac36 100644
--- a/examples/widgets/desktop/systray/main.cpp
+++ b/examples/widgets/desktop/systray/main.cpp
@@ -59,6 +59,8 @@ int main(int argc, char *argv[])
{
Q_INIT_RESOURCE(systray);
+ QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
+
QApplication app(argc, argv);
if (!QSystemTrayIcon::isSystemTrayAvailable()) {
diff --git a/examples/widgets/dialogs/classwizard/main.cpp b/examples/widgets/dialogs/classwizard/main.cpp
index 72eb1ae6ec..03ffe97a23 100644
--- a/examples/widgets/dialogs/classwizard/main.cpp
+++ b/examples/widgets/dialogs/classwizard/main.cpp
@@ -59,6 +59,8 @@ int main(int argc, char *argv[])
{
Q_INIT_RESOURCE(classwizard);
+ QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
+
QApplication app(argc, argv);
#ifndef QT_NO_TRANSLATION
diff --git a/examples/widgets/dialogs/licensewizard/main.cpp b/examples/widgets/dialogs/licensewizard/main.cpp
index 025b79243c..ed46e792d0 100644
--- a/examples/widgets/dialogs/licensewizard/main.cpp
+++ b/examples/widgets/dialogs/licensewizard/main.cpp
@@ -59,6 +59,8 @@ int main(int argc, char *argv[])
{
Q_INIT_RESOURCE(licensewizard);
+ QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
+
QApplication app(argc, argv);
#ifndef QT_NO_TRANSLATION
diff --git a/examples/widgets/dialogs/standarddialogs/main.cpp b/examples/widgets/dialogs/standarddialogs/main.cpp
index 150d07318e..a0cded4f47 100644
--- a/examples/widgets/dialogs/standarddialogs/main.cpp
+++ b/examples/widgets/dialogs/standarddialogs/main.cpp
@@ -59,6 +59,7 @@
int main(int argc, char *argv[])
{
+ QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
QApplication app(argc, argv);
QGuiApplication::setApplicationDisplayName(Dialog::tr("Standard Dialogs"));
diff --git a/examples/widgets/dialogs/trivialwizard/trivialwizard.cpp b/examples/widgets/dialogs/trivialwizard/trivialwizard.cpp
index fe49bf6304..ce13a59b0c 100644
--- a/examples/widgets/dialogs/trivialwizard/trivialwizard.cpp
+++ b/examples/widgets/dialogs/trivialwizard/trivialwizard.cpp
@@ -123,6 +123,8 @@ QWizardPage *createConclusionPage()
int main(int argc, char *argv[])
//! [9] //! [11]
{
+ QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
+
QApplication app(argc, argv);
#ifndef QT_NO_TRANSLATION
diff --git a/examples/widgets/statemachine/factorial/main.cpp b/examples/widgets/statemachine/factorial/main.cpp
index 2d25822828..e9431596fe 100644
--- a/examples/widgets/statemachine/factorial/main.cpp
+++ b/examples/widgets/statemachine/factorial/main.cpp
@@ -49,7 +49,6 @@
****************************************************************************/
#include <QtCore>
-#include <stdio.h>
//! [0]
class Factorial : public QObject
@@ -143,7 +142,7 @@ public:
void onTransition(QEvent *) override
{
- fprintf(stdout, "%d\n", m_fact->property("fac").toInt());
+ qInfo() << m_fact->property("fac").toInt();
}
private:
diff --git a/mkspecs/common/ghs-integrity-armv8.conf b/mkspecs/common/ghs-integrity-armv8.conf
index ee4ce458de..e454cfd245 100644
--- a/mkspecs/common/ghs-integrity-armv8.conf
+++ b/mkspecs/common/ghs-integrity-armv8.conf
@@ -17,8 +17,8 @@ os_directory = $$(INTEGRITY_DIR)
isEmpty(os_directory): \
error("This qmakespec requires $INTEGRITY_DIR to be set")
-QMAKE_CC = cxintarm64 -U__ARM_NEON__ -U__ARM_NEON -bsp $$bsp_name -os_dir $$os_directory -non_shared
-QMAKE_CXX = cxintarm64 -U__ARM_NEON__ -U__ARM_NEON -bsp $$bsp_name -os_dir $$os_directory -non_shared
+QMAKE_CC = cxintarm64 -bsp $$bsp_name -os_dir $$os_directory -non_shared
+QMAKE_CXX = cxintarm64 -bsp $$bsp_name -os_dir $$os_directory -non_shared
QMAKE_LINK = $$QMAKE_CXX
QMAKE_AR = $$QMAKE_CXX -archive -o
diff --git a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
index d6773d6e98..b643e5edf9 100644
--- a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
+++ b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
@@ -62,6 +62,7 @@ function(_qt5_$${CMAKE_MODULE_NAME}_process_prl_file prl_file_location Configura
set(_search_paths)
string(REPLACE \"\\$\\$[QT_INSTALL_LIBS]\" \"${_qt5_install_libs}\" _static_depends \"${_static_depends}\")
foreach(_flag ${_static_depends})
+ string(REPLACE \"\\\"\" \"\" _flag ${_flag})
if(_flag MATCHES \"^-l(.*)$\")
# Handle normal libraries passed as -lfoo
set(_lib \"${CMAKE_MATCH_1}\")
diff --git a/mkspecs/features/qml_module.prf b/mkspecs/features/qml_module.prf
index bd84ce597a..dbf5b74355 100644
--- a/mkspecs/features/qml_module.prf
+++ b/mkspecs/features/qml_module.prf
@@ -13,7 +13,14 @@ equals(TEMPLATE, app): TEMPLATE = aux
isEmpty(TARGETPATH): error("Must set TARGETPATH (QML import name)")
-qmldir_file = $$_PRO_FILE_PWD_/qmldir
+!isEmpty(DYNAMIC_QMLDIR) {
+ qmldir_path = $$OUT_PWD
+ write_file($${qmldir_path}/qmldir, DYNAMIC_QMLDIR)|error("Aborting.")
+} else {
+ qmldir_path = $$_PRO_FILE_PWD_
+}
+
+qmldir_file = $${qmldir_path}/qmldir
fq_qml_files =
for(qmlf, QML_FILES): fq_qml_files += $$absolute_path($$qmlf, $$_PRO_FILE_PWD_)
@@ -42,13 +49,20 @@ builtin_resources {
}
# Install rules
-qmldir.base = $$_PRO_FILE_PWD_
+qmldir.base = $$qmldir_path
# Tools need qmldir and plugins.qmltypes always installed on the file system
-qmldir.files = $$qmldir_file $$fq_aux_qml_files
+
+qmldir.files = $$qmldir_file
install_qml_files: qmldir.files += $$fq_qml_files
qmldir.path = $$[QT_INSTALL_QML]/$$TARGETPATH
INSTALLS += qmldir
+qmlfiles.base = $$_PRO_FILE_PWD_
+qmlfiles.files = $$fq_aux_qml_files
+install_qml_files: qmlfiles.files += $$fq_qml_files
+qmlfiles.path = $${qmldir.path}
+INSTALLS += qmlfiles
+
!debug_and_release|!build_all|CONFIG(release, debug|release) {
!prefix_build {
COPIES += qmldir
diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf
index 3f6914e243..168a8e64f2 100644
--- a/mkspecs/features/qt_configure.prf
+++ b/mkspecs/features/qt_configure.prf
@@ -61,6 +61,13 @@ defineTest(qtConfCommandlineSetInput) {
val = $${2}
!isEmpty($${currentConfig}.commandline.options.$${arg}.name): \
arg = $$eval($${currentConfig}.commandline.options.$${arg}.name)
+ !isEmpty(config.input.$$arg) {
+ oldval = $$eval(config.input.$$arg)
+ equals(oldval, $$val): \
+ qtConfAddNote("Option '$$arg' with value '$$val' was specified twice")
+ else: \
+ qtConfAddNote("Overriding option '$$arg' with '$$val' (was: '$$oldval')")
+ }
config.input.$$arg = $$val
export(config.input.$$arg)
@@ -544,7 +551,15 @@ defineTest(qtConfResolveLibs) {
} else: contains(l, "^-l.*") {
lib = $$replace(l, "^-l", )
lcan =
- unix {
+ integrity:contains(lib, "^.*\\.a") {
+ # INTEGRITY compiler searches for exact filename
+ # if -l argument has .a suffix
+ lcan += $${lib}
+ } else: contains(lib, "^:.*") {
+ # Use exact filename when -l:filename syntax is used.
+ lib ~= s/^://
+ lcan += $${lib}
+ } else: unix {
# Under UNIX, we look for actual shared libraries, in addition
# to static ones.
shexts = $$QMAKE_EXTENSION_SHLIB $$QMAKE_EXTENSIONS_AUX_SHLIB
diff --git a/mkspecs/features/resources.prf b/mkspecs/features/resources.prf
index bb2a55b93d..fa8ff1fb58 100644
--- a/mkspecs/features/resources.prf
+++ b/mkspecs/features/resources.prf
@@ -28,6 +28,7 @@ for(resource, RESOURCES) {
!exists($$absolute_path($$resource, $$_PRO_FILE_PWD_)): \
warning("Failure to find: $$resource")
qmake_immediate.files += $$resource
+ OTHER_FILES *= $$resource
}
RESOURCES -= $$resource
next()
@@ -57,6 +58,7 @@ for(resource, RESOURCES) {
alias = $$relative_path($$file, $$abs_base)
resource_file_content += \
"<file alias=\"$$xml_escape($$alias)\">$$xml_escape($$file)</file>"
+ OTHER_FILES *= $$file
}
}
@@ -73,9 +75,11 @@ for(resource, RESOURCES) {
}
!isEmpty(RESOURCES):contains(TEMPLATE, .*lib):plugin:static {
- resource_init_function = $$lower($$basename(TARGET))_plugin_resource_init
+ pluginBaseName = $$basename(TARGET)
+ pluginName = $$lower($$replace(pluginBaseName, [-], _))
+ resource_init_function = $${pluginName}_plugin_resource_init
DEFINES += "QT_PLUGIN_RESOURCE_INIT_FUNCTION=$$resource_init_function"
- RESOURCE_INIT_CPP = $$OUT_PWD/$$lower($$basename(TARGET))_plugin_resources.cpp
+ RESOURCE_INIT_CPP = $$OUT_PWD/$${pluginName}_plugin_resources.cpp
GENERATED_SOURCES += $$RESOURCE_INIT_CPP
QMAKE_DISTCLEAN += $$RESOURCE_INIT_CPP
diff --git a/mkspecs/wasm-emscripten/qmake.conf b/mkspecs/wasm-emscripten/qmake.conf
index 855d84c039..c80f2bfb92 100644
--- a/mkspecs/wasm-emscripten/qmake.conf
+++ b/mkspecs/wasm-emscripten/qmake.conf
@@ -32,15 +32,6 @@ EMCC_COMMON_LFLAGS = \
--bind \
-s \"BINARYEN_TRAP_MODE=\'clamp\'\"
-EMCC_USE_PORTS_FLAGS = \
- -s USE_FREETYPE=1 \
- -s USE_ZLIB=1
-
-# libpng does not build for WASM_OBJECT_FILES=1, see
-# https://github.com/emscripten-core/emscripten/issues/8143
-equals(WASM_OBJECT_FILES, 0):\
- EMCC_USE_PORTS_FLAGS += -s USE_LIBPNG=1
-
# The -s arguments can also be used with release builds,
# but are here in debug for clarity.
EMCC_COMMON_LFLAGS_DEBUG = \
@@ -87,9 +78,6 @@ QMAKE_COMPILER += emscripten
QMAKE_CC = emcc
QMAKE_CXX = em++
-QMAKE_CFLAGS += $$EMCC_USE_PORTS_FLAGS
-QMAKE_CXXFLAGS += $$EMCC_USE_PORTS_FLAGS
-
QMAKE_LINK = $$QMAKE_CXX
QMAKE_LINK_SHLIB = $$QMAKE_CXX
QMAKE_LINK_C = $$QMAKE_CC
diff --git a/mkspecs/win32-clang-msvc/qmake.conf b/mkspecs/win32-clang-msvc/qmake.conf
index eb6fbee26d..1cf1f31712 100644
--- a/mkspecs/win32-clang-msvc/qmake.conf
+++ b/mkspecs/win32-clang-msvc/qmake.conf
@@ -13,19 +13,19 @@ QMAKE_CFLAGS_SSE4_1 = -msse4.1
QMAKE_CFLAGS_SSE4_2 = -msse4.2
QMAKE_CFLAGS_AVX = -mavx
QMAKE_CFLAGS_AVX2 = -mavx2
-QMAKE_CFLAGS_F16C = -mf16c
-QMAKE_CFLAGS_RDRND = -mrdrnd
-QMAKE_CFLAGS_AVX512F = -mavx512f
-QMAKE_CFLAGS_AVX512ER = -mavx512er
-QMAKE_CFLAGS_AVX512CD = -mavx512cd
-QMAKE_CFLAGS_AVX512PF = -mavx512pf
-QMAKE_CFLAGS_AVX512DQ = -mavx512dq
-QMAKE_CFLAGS_AVX512BW = -mavx512bw
-QMAKE_CFLAGS_AVX512VL = -mavx512vl
+QMAKE_CFLAGS_F16C = -mf16c
+QMAKE_CFLAGS_RDRND = -mrdrnd
+QMAKE_CFLAGS_AVX512F = -mavx512f
+QMAKE_CFLAGS_AVX512ER = -mavx512er
+QMAKE_CFLAGS_AVX512CD = -mavx512cd
+QMAKE_CFLAGS_AVX512PF = -mavx512pf
+QMAKE_CFLAGS_AVX512DQ = -mavx512dq
+QMAKE_CFLAGS_AVX512BW = -mavx512bw
+QMAKE_CFLAGS_AVX512VL = -mavx512vl
QMAKE_CFLAGS_AVX512IFMA = -mavx512ifma
QMAKE_CFLAGS_AVX512VBMI = -mavx512vbmi
-QMAKE_CFLAGS_AESNI = -maes
-QMAKE_CFLAGS_SHANI = -msha
+QMAKE_CFLAGS_AESNI = -maes
+QMAKE_CFLAGS_SHANI = -msha
QMAKE_COMPILER += clang_cl llvm
diff --git a/mkspecs/win32-g++/qmake.conf b/mkspecs/win32-g++/qmake.conf
index 9bd2f5525f..5de482f23b 100644
--- a/mkspecs/win32-g++/qmake.conf
+++ b/mkspecs/win32-g++/qmake.conf
@@ -23,4 +23,8 @@ QMAKE_CXXFLAGS_WARN_ON = $$QMAKE_CFLAGS_WARN_ON
QMAKE_LINK = $${CROSS_COMPILE}g++
QMAKE_LINK_C = $${CROSS_COMPILE}gcc
+QMAKE_CFLAGS_LTCG = -flto
+QMAKE_CXXFLAGS_LTCG = $$QMAKE_CFLAGS_LTCG
+QMAKE_LFLAGS_LTCG = $$QMAKE_CFLAGS_LTCG
+
load(qt_config)
diff --git a/qmake/generators/win32/msvc_nmake.cpp b/qmake/generators/win32/msvc_nmake.cpp
index a6e850a036..f295705e2e 100644
--- a/qmake/generators/win32/msvc_nmake.cpp
+++ b/qmake/generators/win32/msvc_nmake.cpp
@@ -95,7 +95,9 @@ QString NmakeMakefileGenerator::defaultInstall(const QString &t)
if (project->isActiveConfig("debug_info")) {
if (t == "dlltarget" || project->values(ProKey(t + ".CONFIG")).indexOf("no_dll") == -1) {
- QString pdb_target = project->first("TARGET") + project->first("TARGET_VERSION_EXT") + ".pdb";
+ const QFileInfo targetFileInfo = project->first("DESTDIR") + project->first("TARGET")
+ + project->first("TARGET_EXT");
+ const QString pdb_target = targetFileInfo.completeBaseName() + ".pdb";
QString src_targ = (project->isEmpty("DESTDIR") ? QString("$(DESTDIR)") : project->first("DESTDIR")) + pdb_target;
QString dst_targ = filePrefixRoot(root, fileFixify(targetdir + pdb_target, FileFixifyAbsolute));
if(!ret.isEmpty())
@@ -252,15 +254,16 @@ void NmakeMakefileGenerator::init()
project->values("PRECOMPILED_PCH_C") = ProStringList(precompPchC);
}
- ProString tgt = project->first("DESTDIR")
- + project->first("TARGET") + project->first("TARGET_VERSION_EXT");
- if(project->isActiveConfig("shared")) {
- project->values("QMAKE_CLEAN").append(tgt + ".exp");
- project->values("QMAKE_DISTCLEAN").append(tgt + ".lib");
+ const QFileInfo targetFileInfo = project->first("DESTDIR") + project->first("TARGET")
+ + project->first("TARGET_EXT");
+ const ProString targetBase = targetFileInfo.path() + '/' + targetFileInfo.completeBaseName();
+ if (project->first("TEMPLATE") == "lib" && project->isActiveConfig("shared")) {
+ project->values("QMAKE_CLEAN").append(targetBase + ".exp");
+ project->values("QMAKE_DISTCLEAN").append(targetBase + ".lib");
}
if (project->isActiveConfig("debug_info")) {
QString pdbfile;
- QString distPdbFile = tgt + ".pdb";
+ QString distPdbFile = targetBase + ".pdb";
if (project->isActiveConfig("staticlib")) {
// For static libraries, the compiler's pdb file and the dist pdb file are the same.
pdbfile = distPdbFile;
@@ -276,8 +279,8 @@ void NmakeMakefileGenerator::init()
project->values("QMAKE_DISTCLEAN").append(distPdbFile);
}
if (project->isActiveConfig("debug")) {
- project->values("QMAKE_CLEAN").append(tgt + ".ilk");
- project->values("QMAKE_CLEAN").append(tgt + ".idb");
+ project->values("QMAKE_CLEAN").append(targetBase + ".ilk");
+ project->values("QMAKE_CLEAN").append(targetBase + ".idb");
} else {
ProStringList &defines = project->values("DEFINES");
if (!defines.contains("NDEBUG"))
diff --git a/qmake/main.cpp b/qmake/main.cpp
index a4ef79227b..e5f7032554 100644
--- a/qmake/main.cpp
+++ b/qmake/main.cpp
@@ -260,31 +260,25 @@ static int installFile(const QString &source, const QString &target, bool exe =
return 3;
}
+ QFileDevice::Permissions targetPermissions = QFileDevice::ReadOwner | QFileDevice::WriteOwner
+ | QFileDevice::ReadUser | QFileDevice::WriteUser
+ | QFileDevice::ReadGroup | QFileDevice::ReadOther;
if (exe) {
- if (!targetFile.setPermissions(sourceFile.permissions() | QFileDevice::ExeOwner | QFileDevice::ExeUser |
- QFileDevice::ExeGroup | QFileDevice::ExeOther)) {
- fprintf(stderr, "Error setting execute permissions on %s: %s\n",
- qPrintable(target), qPrintable(targetFile.errorString()));
- return 3;
- }
+ targetPermissions |= QFileDevice::ExeOwner | QFileDevice::ExeUser |
+ QFileDevice::ExeGroup | QFileDevice::ExeOther;
+ }
+ if (!targetFile.setPermissions(targetPermissions)) {
+ fprintf(stderr, "Error setting permissions on %s: %s\n",
+ qPrintable(target), qPrintable(targetFile.errorString()));
+ return 3;
}
// Copy file times
QString error;
-#ifdef Q_OS_WIN
- const QFile::Permissions permissions = targetFile.permissions();
- const bool readOnly = !(permissions & QFile::WriteUser);
- if (readOnly)
- targetFile.setPermissions(permissions | QFile::WriteUser);
-#endif
if (!IoUtils::touchFile(target, sourceFile.fileName(), &error)) {
fprintf(stderr, "%s", qPrintable(error));
return 3;
}
-#ifdef Q_OS_WIN
- if (readOnly)
- targetFile.setPermissions(permissions);
-#endif
return 0;
}
diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java b/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java
index 1cbb8fe117..8fa889fa31 100644
--- a/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java
+++ b/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java
@@ -765,11 +765,19 @@ public class QtActivityDelegate
}
m_layout = new QtLayout(m_activity, startApplication);
+ int orientation = m_activity.getResources().getConfiguration().orientation;
+
try {
ActivityInfo info = m_activity.getPackageManager().getActivityInfo(m_activity.getComponentName(), PackageManager.GET_META_DATA);
- if (info.metaData.containsKey("android.app.splash_screen_drawable")) {
+
+ String splashScreenKey = "android.app.splash_screen_drawable_"
+ + (orientation == Configuration.ORIENTATION_LANDSCAPE ? "landscape" : "portrait");
+ if (!info.metaData.containsKey(splashScreenKey))
+ splashScreenKey = "android.app.splash_screen_drawable";
+
+ if (info.metaData.containsKey(splashScreenKey)) {
m_splashScreenSticky = info.metaData.containsKey("android.app.splash_screen_sticky") && info.metaData.getBoolean("android.app.splash_screen_sticky");
- int id = info.metaData.getInt("android.app.splash_screen_drawable");
+ int id = info.metaData.getInt(splashScreenKey);
m_splashScreen = new ImageView(m_activity);
m_splashScreen.setImageDrawable(m_activity.getResources().getDrawable(id));
m_splashScreen.setScaleType(ImageView.ScaleType.FIT_XY);
@@ -789,7 +797,6 @@ public class QtActivityDelegate
new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT));
- int orientation = m_activity.getResources().getConfiguration().orientation;
int rotation = m_activity.getWindowManager().getDefaultDisplay().getRotation();
boolean rot90 = (rotation == Surface.ROTATION_90 || rotation == Surface.ROTATION_270);
boolean currentlyLandscape = (orientation == Configuration.ORIENTATION_LANDSCAPE);
diff --git a/src/android/templates/AndroidManifest.xml b/src/android/templates/AndroidManifest.xml
index f4b99e0895..aed8a3c888 100644
--- a/src/android/templates/AndroidManifest.xml
+++ b/src/android/templates/AndroidManifest.xml
@@ -52,6 +52,12 @@
<!-- Messages maps -->
<!-- Splash screen -->
+ <!-- Orientation-specific (portrait/landscape) data is checked first. If not available for current orientation,
+ then android.app.splash_screen_drawable. For best results, use together with splash_screen_sticky and
+ use hideSplashScreen() with a fade-out animation from Qt Android Extras to hide the splash screen when you
+ are done populating your window with content. -->
+ <!-- meta-data android:name="android.app.splash_screen_drawable_portrait" android:resource="@drawable/logo_portrait" / -->
+ <!-- meta-data android:name="android.app.splash_screen_drawable_landscape" android:resource="@drawable/logo_landscape" / -->
<!-- meta-data android:name="android.app.splash_screen_drawable" android:resource="@drawable/logo"/ -->
<!-- meta-data android:name="android.app.splash_screen_sticky" android:value="true"/ -->
<!-- Splash screen -->
diff --git a/src/corelib/Qt5CoreMacros.cmake b/src/corelib/Qt5CoreMacros.cmake
index a7b579165c..78b99f5bfe 100644
--- a/src/corelib/Qt5CoreMacros.cmake
+++ b/src/corelib/Qt5CoreMacros.cmake
@@ -321,10 +321,10 @@ function(QT5_ADD_BIG_RESOURCES outfiles )
add_custom_command(OUTPUT ${tmpoutfile}
COMMAND ${Qt5Core_RCC_EXECUTABLE} ${rcc_options} --name ${outfilename} --pass 1 --output ${tmpoutfile} ${infile}
DEPENDS ${infile} ${_rc_depends} "${out_depends}" VERBATIM)
- set_source_files_properties(${tmpoutfile} PROPERTIES SKIP_AUTOMOC ON)
- set_source_files_properties(${tmpoutfile} PROPERTIES SKIP_AUTOUIC ON)
add_custom_target(big_resources_${outfilename} ALL DEPENDS ${tmpoutfile})
add_library(rcc_object_${outfilename} OBJECT ${tmpoutfile})
+ set_target_properties(rcc_object_${outfilename} PROPERTIES AUTOMOC OFF)
+ set_target_properties(rcc_object_${outfilename} PROPERTIES AUTOUIC OFF)
add_dependencies(rcc_object_${outfilename} big_resources_${outfilename})
add_custom_command(OUTPUT ${outfile}
COMMAND ${Qt5Core_RCC_EXECUTABLE}
diff --git a/src/corelib/animation/qabstractanimation.cpp b/src/corelib/animation/qabstractanimation.cpp
index 9d7a256191..0be37b7dca 100644
--- a/src/corelib/animation/qabstractanimation.cpp
+++ b/src/corelib/animation/qabstractanimation.cpp
@@ -152,6 +152,7 @@
#include <QtCore/qthreadstorage.h>
#include <QtCore/qcoreevent.h>
#include <QtCore/qpointer.h>
+#include <QtCore/qscopedvaluerollback.h>
#define DEFAULT_TIMER_INTERVAL 16
#define PAUSE_TIMER_COARSE_THRESHOLD 2000
@@ -315,14 +316,13 @@ void QUnifiedTimer::updateAnimationTimers(qint64 currentTick)
//* it might happen in some cases that the delta is negative because the animation driver
// advances faster than time.elapsed()
if (delta > 0) {
- insideTick = true;
+ QScopedValueRollback<bool> guard(insideTick, true);
if (profilerCallback)
profilerCallback(delta);
for (currentAnimationIdx = 0; currentAnimationIdx < animationTimers.count(); ++currentAnimationIdx) {
QAbstractAnimationTimer *animation = animationTimers.at(currentAnimationIdx);
animation->updateAnimationsTime(delta);
}
- insideTick = false;
currentAnimationIdx = 0;
}
}
@@ -361,10 +361,11 @@ void QUnifiedTimer::localRestart()
void QUnifiedTimer::restart()
{
- insideRestart = true;
- for (int i = 0; i < animationTimers.count(); ++i)
- animationTimers.at(i)->restartAnimationTimer();
- insideRestart = false;
+ {
+ QScopedValueRollback<bool> guard(insideRestart, true);
+ for (int i = 0; i < animationTimers.count(); ++i)
+ animationTimers.at(i)->restartAnimationTimer();
+ }
localRestart();
}
@@ -599,14 +600,13 @@ void QAnimationTimer::updateAnimationsTime(qint64 delta)
//it might happen in some cases that the time doesn't change because events are delayed
//when the CPU load is high
if (delta) {
- insideTick = true;
+ QScopedValueRollback<bool> guard(insideTick, true);
for (currentAnimationIdx = 0; currentAnimationIdx < animations.count(); ++currentAnimationIdx) {
QAbstractAnimation *animation = animations.at(currentAnimationIdx);
int elapsed = QAbstractAnimationPrivate::get(animation)->totalCurrentTime
+ (animation->direction() == QAbstractAnimation::Forward ? delta : -delta);
animation->setCurrentTime(elapsed);
}
- insideTick = false;
currentAnimationIdx = 0;
}
}
@@ -1085,7 +1085,7 @@ QAbstractAnimation::State QAbstractAnimation::state() const
/*!
If this animation is part of a QAnimationGroup, this function returns a
- pointer to the group; otherwise, it returns 0.
+ pointer to the group; otherwise, it returns \nullptr.
\sa QAnimationGroup::addAnimation()
*/
diff --git a/src/corelib/codecs/qtextcodec.cpp b/src/corelib/codecs/qtextcodec.cpp
index e2598b7858..602b97e32e 100644
--- a/src/corelib/codecs/qtextcodec.cpp
+++ b/src/corelib/codecs/qtextcodec.cpp
@@ -1061,7 +1061,7 @@ QString QTextDecoder::toUnicode(const char *chars, int len)
}
// in qstring.cpp:
-void qt_from_latin1(ushort *dst, const char *str, size_t size) Q_DECL_NOTHROW;
+void qt_from_latin1(ushort *dst, const char *str, size_t size) noexcept;
/*! \overload
@@ -1242,7 +1242,7 @@ QTextCodec *QTextCodec::codecForUtfText(const QByteArray &ba)
\obsolete
Returns the codec used by QObject::tr() on its argument. If this
- function returns 0 (the default), tr() assumes Latin-1.
+ function returns \nullptr (the default), tr() assumes Latin-1.
*/
/*!
diff --git a/src/corelib/codecs/qutfcodec.cpp b/src/corelib/codecs/qutfcodec.cpp
index 643c8ee475..85736fdf02 100644
--- a/src/corelib/codecs/qutfcodec.cpp
+++ b/src/corelib/codecs/qutfcodec.cpp
@@ -54,7 +54,7 @@ static const uchar utf8bom[] = { 0xef, 0xbb, 0xbf };
#if (defined(__SSE2__) && defined(QT_COMPILER_SUPPORTS_SSE2)) \
|| (defined(__ARM_NEON__) && defined(Q_PROCESSOR_ARM_64))
-static Q_ALWAYS_INLINE uint qBitScanReverse(unsigned v) Q_DECL_NOTHROW
+static Q_ALWAYS_INLINE uint qBitScanReverse(unsigned v) noexcept
{
uint result = qCountLeadingZeroBits(v);
// Now Invert the result: clz will count *down* from the msb to the lsb, so the msb index is 31
@@ -504,7 +504,7 @@ QString QUtf8::convertToUnicode(const char *chars, int len)
This function never throws.
*/
-QChar *QUtf8::convertToUnicode(QChar *buffer, const char *chars, int len) Q_DECL_NOTHROW
+QChar *QUtf8::convertToUnicode(QChar *buffer, const char *chars, int len) noexcept
{
ushort *dst = reinterpret_cast<ushort *>(buffer);
const uchar *src = reinterpret_cast<const uchar *>(chars);
diff --git a/src/corelib/codecs/qutfcodec_p.h b/src/corelib/codecs/qutfcodec_p.h
index b24283ac5e..083e16317a 100644
--- a/src/corelib/codecs/qutfcodec_p.h
+++ b/src/corelib/codecs/qutfcodec_p.h
@@ -291,7 +291,7 @@ enum DataEndianness
struct QUtf8
{
- static QChar *convertToUnicode(QChar *, const char *, int) Q_DECL_NOTHROW;
+ static QChar *convertToUnicode(QChar *, const char *, int) noexcept;
static QString convertToUnicode(const char *, int);
static QString convertToUnicode(const char *, int, QTextCodec::ConverterState *);
static QByteArray convertFromUnicode(const QChar *, int);
diff --git a/src/corelib/configure.json b/src/corelib/configure.json
index 81768507f6..a6091d4825 100644
--- a/src/corelib/configure.json
+++ b/src/corelib/configure.json
@@ -11,6 +11,7 @@
"icu": "boolean",
"inotify": "boolean",
"journald": "boolean",
+ "mimetype-database": "boolean",
"pcre": { "type": "enum", "values": [ "no", "qt", "system" ] },
"posix-ipc": { "type": "boolean", "name": "ipc_posix" },
"pps": { "type": "boolean", "name": "qqnx_pps" },
@@ -374,6 +375,16 @@
]
}
},
+ "glibc": {
+ "label": "GNU libc",
+ "type": "compile",
+ "test": {
+ "include": "stdlib.h",
+ "main": [
+ "return __GLIBC__;"
+ ]
+ }
+ },
"inotify": {
"label": "inotify",
"type": "compile",
@@ -593,6 +604,12 @@
"condition": "libs.glib",
"output": [ "privateFeature", "feature" ]
},
+ "glibc": {
+ "label": "GNU libc",
+ "autoDetect": "config.linux",
+ "condition": "tests.glibc",
+ "output": [ "privateFeature" ]
+ },
"iconv": {
"label": "iconv",
"purpose": "Provides internationalization on Unix.",
@@ -662,6 +679,11 @@
"condition": "features.textcodec",
"output": [ "publicFeature", "feature" ]
},
+ "mimetype-database": {
+ "label": "Built-in copy of the MIME database",
+ "condition": "features.mimetype",
+ "output": [ "privateFeature" ]
+ },
"pcre2": {
"label": "PCRE2",
"disable": "input.pcre == 'no' || input.pcre == 'system'",
@@ -1036,6 +1058,7 @@ Please apply the patch corresponding to your Standard Library vendor, found in
"glib",
"iconv",
"icu",
+ "mimetype-database",
{
"message": "Tracing backend",
"type": "firstAvailableFeature",
diff --git a/src/corelib/doc/snippets/code/src_corelib_global_qglobal.cpp b/src/corelib/doc/snippets/code/src_corelib_global_qglobal.cpp
index 03904659f5..eb75a29ca2 100644
--- a/src/corelib/doc/snippets/code/src_corelib_global_qglobal.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_global_qglobal.cpp
@@ -773,16 +773,16 @@ bool readConfiguration(const QFile &file)
//! [qdecloverride]
// generate error if this doesn't actually override anything:
- virtual void MyWidget::paintEvent(QPaintEvent*) Q_DECL_OVERRIDE;
+ virtual void MyWidget::paintEvent(QPaintEvent*) override;
//! [qdecloverride]
//! [qdeclfinal-1]
// more-derived classes no longer permitted to override this:
- virtual void MyWidget::paintEvent(QPaintEvent*) Q_DECL_FINAL;
+ virtual void MyWidget::paintEvent(QPaintEvent*) final;
//! [qdeclfinal-1]
//! [qdeclfinal-2]
- class QRect Q_DECL_FINAL { // cannot be derived from
+ class QRect final { // cannot be derived from
// ...
};
//! [qdeclfinal-2]
diff --git a/src/corelib/doc/src/datastreamformat.qdoc b/src/corelib/doc/src/datastreamformat.qdoc
index 73ca51974d..d6b60f10ce 100644
--- a/src/corelib/doc/src/datastreamformat.qdoc
+++ b/src/corelib/doc/src/datastreamformat.qdoc
@@ -28,357 +28,71 @@
/*!
\page datastreamformat.html
\title Serializing Qt Data Types
- \brief Representations of data types that can be serialized by QDataStream.
+ \brief List of data types that can be serialized by QDataStream.
- The \l QDataStream allows you to serialize some of the Qt data types.
- The table below lists the data types that QDataStream can serialize
- and how they are represented. The format described below is
- \l{QDataStream::setVersion()}{version 13}.
+ The \l QDataStream class allows you to serialize the Qt data types
+ listed in this section as of \l{QDataStream::setVersion()}{version 18}.
It is always best to cast integers to a Qt integer type, such as
- qint16 or quint32, when reading and writing. This ensures that
+ \l{qint16} or \l{quint32}, when reading and writing. This ensures that
you always know exactly what size integers you are reading and
writing, no matter what the underlying platform and architecture
the application happens to be running on.
- \table
- \row \li bool
- \li \list
- \li boolean
- \endlist
- \row \li qint8
- \li \list
- \li signed byte
- \endlist
- \row \li qint16
- \li \list
- \li signed 16-bit integer
- \endlist
- \row \li qint32
- \li \list
- \li signed 32-bit integer
- \endlist
- \row \li qint64
- \li \list
- \li signed 64-bit integer
- \endlist
- \row \li quint8
- \li \list
- \li unsigned byte
- \endlist
- \row \li quint16
- \li \list
- \li unsigned 16-bit integer
- \endlist
- \row \li quint32
- \li \list
- \li unsigned 32-bit integer
- \endlist
- \row \li quint64
- \li \list
- \li unsigned 64-bit integer
- \endlist
- \row \li \c float
- \li \list
- \li 32-bit floating point number using the standard IEEE 754 format
- \endlist
- \row \li \c double
- \li \list
- \li 64-bit floating point number using the standard IEEE 754 format
- \endlist
- \row \li \c {const char *}
- \li \list
- \li The string length (quint32)
- \li The string bytes, excluding the terminating 0
- \endlist
- \row \li QBitArray
- \li \list
- \li The array size (quint32)
- \li The array bits, i.e. (size + 7)/8 bytes
- \endlist
- \row \li QBrush
- \li \list
- \li The brush style (quint8)
- \li The brush color (QColor)
- \li If style is CustomPattern, the brush pixmap (QPixmap)
- \endlist
- \row \li QByteArray
- \li \list
- \li If the byte array is null: 0xFFFFFFFF (quint32)
- \li Otherwise: the array size (quint32) followed by the array bytes, i.e. size bytes
- \endlist
- \row \li \l QColor
- \li \list
- \li Color spec (qint8)
- \li Alpha value (quint16)
- \li Red value (quint16)
- \li Green value (quint16)
- \li Blue value (quint16)
- \li Pad value (quint16)
- \endlist
- \row \li QCursor
- \li \list
- \li Shape ID (qint16)
- \li If shape is BitmapCursor: The bitmap (QPixmap), mask (QPixmap), and hot spot (QPoint)
- \endlist
- \row \li QDate
- \li \list
- \li Julian day (quint32)
- \endlist
- \row \li QDateTime
- \li \list
- \li Date (QDate)
- \li Time (QTime)
- \li The \l{Qt::TimeSpec}{time spec}
- offsetFromUtc (qint32) if Qt::TimeSpec is offsetFromUtc
- TimeZone(QTimeZone) if Qt::TimeSpec is TimeZone
- \endlist
- \row \li QEasingCurve
- \li \list
- \li type (quint8)
- \li func (quint64)
- \li hasConfig (bool)
- \li If hasConfig is true then these fields follow:
- \li list
- \li period (double)
- \li amplitude (double)
- \li overshoot (double)
- \endlist
- \row \li QFont
- \li \list
- \li The family (QString)
- \li The style name (QString)
- \li The point size (double)
- \li The pixel size (qint32)
- \li The style hint (quint8)
- \li The style strategy (quint16)
- \li The char set (quint8)
- \li The weight (quint8)
- \li The font bits (quint8)
- \li The font stretch (quint16)
- \li The extended font bits (quint8)
- \li The letter spacing (double)
- \li The word spacing (double)
- \li The hinting preference (quint8)
- \endlist
- \row \li QHash<Key, T>
- \li \list
- \li The number of items (quint32)
- \li For all items, the key (Key) and value (T)
- \endlist
- \row \li QIcon
- \li \list
- \li The number of pixmap entries (quint32)
- \li For all pixmap entries:
- \list
- \li The pixmap (QPixmap)
- \li The file name (QString)
- \li The pixmap size (QSize)
- \li The \l{QIcon::Mode}{mode} (quint32)
- \li The \l{QIcon::State}{state} (quint32)
- \endlist
- \endlist
- \row \li QImage
- \li \list
- \li If the image is null a "null image" marker is saved;
- otherwise the image is saved in PNG or BMP format (depending
- on the stream version). If you want control of the format,
- stream the image into a QBuffer (using QImageIOHandler/QImageIOPlugin) and stream
- that.
- \endlist
- \row \li QKeySequence
- \li \list
- \li A QList<int>, where each integer is a key in the key sequence
- \endlist
- \row \li QLinkedList<T>
- \li \list
- \li The number of items (quint32)
- \li The items (T)
- \endlist
- \row \li QList<T>
- \li \list
- \li The number of items (quint32)
- \li The items (T)
- \endlist
- \row \li QMap<Key, T>
- \li \list
- \li The number of items (quint32)
- \li For all items, the key (Key) and value (T)
- \endlist
- \row \li QMargins
- \li \list
- \li left (int)
- \li top (int)
- \li right (int)
- \li bottom (int)
- \endlist
- \row \li QMatrix
- \li \list
- \li m11 (double)
- \li m12 (double)
- \li m21 (double)
- \li m22 (double)
- \li dx (double)
- \li dy (double)
- \endlist
- \row \li QMatrix4x4
- \li \list
- \li m11 (float)
- \li m12 (float)
- \li m13 (float)
- \li m14 (float)
- \li m21 (float)
- \li m22 (float)
- \li m23 (float)
- \li m24 (float)
- \li m31 (float)
- \li m32 (float)
- \li m33 (float)
- \li m34 (float)
- \li m41 (float)
- \li m42 (float)
- \li m43 (float)
- \li m44 (float)
- \endlist
- \row \li QPair<T1, T2>
- \li \list
- \li first (T1)
- \li second (T2)
- \endlist
- \row \li QPalette
- \li The disabled, active, and inactive color groups, each of which consists
- of the following:
- \list
- \li foreground (QBrush)
- \li button (QBrush)
- \li light (QBrush)
- \li midlight (QBrush)
- \li dark (QBrush)
- \li mid (QBrush)
- \li text (QBrush)
- \li brightText (QBrush)
- \li buttonText (QBrush)
- \li base (QBrush)
- \li background (QBrush)
- \li shadow (QBrush)
- \li highlight (QBrush)
- \li highlightedText (QBrush)
- \li link (QBrush)
- \li linkVisited (QBrush)
- \endlist
- \row \li QPen
- \li \list
- \li The pen styles (quint8)
- \li The pen width (quint16)
- \li The pen color (QColor)
- \endlist
- \row \li QPicture
- \li \list
- \li The size of the picture data (quint32)
- \li The raw bytes of picture data (char)
- \endlist
- \row \li QPixmap
- \li \list
- \li Save it as a PNG image.
- \endlist
- \row \li QPoint
- \li \list
- \li The x coordinate (qint32)
- \li The y coordinate (qint32)
- \endlist
- \row \li QQuaternion
- \li \list
- \li The scalar component (float)
- \li The x coordinate (float)
- \li The y coordinate (float)
- \li The z coordinate (float)
- \endlist
- \row \li QRect
- \li \list
- \li left (qint32)
- \li top (qint32)
- \li right (qint32)
- \li bottom (qint32)
- \endlist
- \row \li QRegExp
- \li \list
- \li The regexp pattern (QString)
- \li Case sensitivity (quint8)
- \li Regular expression syntax (quint8)
- \li Minimal matching (quint8)
- \endlist
- \row \li QRegularExpression
- \li \list
- \li The regular expression pattern (QString)
- \li The pattern options (quint32)
- \endlist
- \row \li QRegion
- \li \list
- \li The size of the data, i.e. 8 + 16 * (number of rectangles) (quint32)
- \li 10 (qint32)
- \li The number of rectangles (quint32)
- \li The rectangles in sequential order (QRect)
- \endlist
- \row \li QSize
- \li \list
- \li width (qint32)
- \li height (qint32)
- \endlist
- \row \li QString
- \li \list
- \li If the string is null: 0xFFFFFFFF (quint32)
- \li Otherwise: The string length in bytes (quint32) followed by the data in UTF-16
- \endlist
- \row \li QTime
- \li \list
- \li Milliseconds since midnight (quint32)
- \endlist
- \row \li QTransform
- \li \list
- \li m11 (double)
- \li m12 (double)
- \li m13 (double)
- \li m21 (double)
- \li m22 (double)
- \li m23 (double)
- \li m31 (double)
- \li m32 (double)
- \li m33 (double)
- \endlist
- \row \li QUrl
- \li \list
- \li Holds an URL (QString)
- \endlist
- \row \li QVariant
- \li \list
- \li The type of the data (quint32)
- \li The null flag (qint8)
- \li The data of the specified type
- \endlist
- \row \li QVector2D
- \li \list
- \li the x coordinate (float)
- \li the y coordinate (float)
- \endlist
- \row \li QVector3D
- \li \list
- \li the x coordinate (float)
- \li the y coordinate (float)
- \li the z coordinate (float)
- \endlist
- \row \li QVector4D
- \li \list
- \li the x coordinate (float)
- \li the y coordinate (float)
- \li the z coordinate (float)
- \li the w coordinate (float)
- \endlist
- \row \li QVector<T>
- \li \list
- \li The number of items (quint32)
- \li The items (T)
- \endlist
- \endtable
+ \list
+ \li bool
+ \li \l{qint8}
+ \li \l{qint16}
+ \li \l{qint32}
+ \li \l{qint64}
+ \li \l{quint8}
+ \li \l{quint16}
+ \li \l{quint32}
+ \li \l{quint64}
+ \li \c float
+ \li \c double
+ \li \c {const char *}
+ \li QBitArray
+ \li QBrush
+ \li QByteArray
+ \li QColor
+ \li QCursor
+ \li QDate
+ \li QDateTime
+ \li QEasingCurve
+ \li QFont
+ \li QGenericMatrix
+ \li QHash<Key, T>
+ \li QIcon
+ \li QImage
+ \li QKeySequence
+ \li QLinkedList<T>
+ \li QList<T>
+ \li QMap<Key, T>
+ \li QMargins
+ \li QMatrix4x4
+ \li QPair<T1, T2>
+ \li QPalette
+ \li QPen
+ \li QPicture
+ \li QPixmap
+ \li QPoint
+ \li QQuaternion
+ \li QRect
+ \li QRegExp
+ \li QRegularExpression
+ \li QRegion
+ \li QSize
+ \li QString
+ \li QTime
+ \li QTransform
+ \li QUrl
+ \li QVariant
+ \li QVector2D
+ \li QVector3D
+ \li QVector4D
+ \li QVector<T>
+ \endlist
\sa {JSON Support in Qt}
*/
diff --git a/src/corelib/global/global.pri b/src/corelib/global/global.pri
index 029357ff43..428c674307 100644
--- a/src/corelib/global/global.pri
+++ b/src/corelib/global/global.pri
@@ -12,7 +12,6 @@ HEADERS += \
global/qendian_p.h \
global/qnumeric_p.h \
global/qnumeric.h \
- global/qfloat16_p.h \
global/qfloat16.h \
global/qglobalstatic.h \
global/qlibraryinfo.h \
diff --git a/src/corelib/global/minimum-linux_p.h b/src/corelib/global/minimum-linux_p.h
index 9c074e13ba..5112015663 100644
--- a/src/corelib/global/minimum-linux_p.h
+++ b/src/corelib/global/minimum-linux_p.h
@@ -78,7 +78,11 @@ QT_BEGIN_NAMESPACE
* - statx 4.11 QT_CONFIG(statx)
*/
-#if QT_CONFIG(statx)
+#if QT_CONFIG(statx) && !QT_CONFIG(glibc)
+// if using glibc, the statx() function in sysdeps/unix/sysv/linux/statx.c
+// falls back to stat() for us.
+// (Using QT_CONFIG(glibc) instead of __GLIBC__ because the macros aren't
+// defined in assembler mode)
# define MINLINUX_MAJOR 4
# define MINLINUX_MINOR 11
# define MINLINUX_PATCH 0
diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h
index 345ab9e8ad..e47f284a42 100644
--- a/src/corelib/global/qcompilerdetection.h
+++ b/src/corelib/global/qcompilerdetection.h
@@ -110,12 +110,6 @@
# define Q_CC_INTEL __INTEL_COMPILER
# endif
-/* only defined for MSVC since that's the only compiler that actually optimizes for this */
-/* might get overridden further down when Q_COMPILER_NOEXCEPT is detected */
-# ifdef __cplusplus
-# define Q_DECL_NOTHROW throw()
-# endif
-
#elif defined(__BORLANDC__) || defined(__TURBOC__)
# define Q_CC_BOR
# define Q_INLINE_TEMPLATE
@@ -1128,16 +1122,11 @@
#ifdef Q_COMPILER_NOEXCEPT
# define Q_DECL_NOEXCEPT noexcept
# define Q_DECL_NOEXCEPT_EXPR(x) noexcept(x)
-# ifdef Q_DECL_NOTHROW
-# undef Q_DECL_NOTHROW /* override with C++11 noexcept if available */
-# endif
#else
# define Q_DECL_NOEXCEPT
# define Q_DECL_NOEXCEPT_EXPR(x)
#endif
-#ifndef Q_DECL_NOTHROW
-# define Q_DECL_NOTHROW Q_DECL_NOEXCEPT
-#endif
+#define Q_DECL_NOTHROW Q_DECL_NOEXCEPT
#if defined(Q_COMPILER_ALIGNOF)
# undef Q_ALIGNOF
diff --git a/src/corelib/global/qflags.h b/src/corelib/global/qflags.h
index e9fee5f23e..65f4892472 100644
--- a/src/corelib/global/qflags.h
+++ b/src/corelib/global/qflags.h
@@ -54,21 +54,21 @@ class QFlag
{
int i;
public:
- Q_DECL_CONSTEXPR inline QFlag(int value) Q_DECL_NOTHROW : i(value) {}
- Q_DECL_CONSTEXPR inline operator int() const Q_DECL_NOTHROW { return i; }
+ Q_DECL_CONSTEXPR inline QFlag(int value) noexcept : i(value) {}
+ Q_DECL_CONSTEXPR inline operator int() const noexcept { return i; }
#if !defined(Q_CC_MSVC)
// Microsoft Visual Studio has buggy behavior when it comes to
// unsigned enums: even if the enum is unsigned, the enum tags are
// always signed
# if !defined(__LP64__) && !defined(Q_CLANG_QDOC)
- Q_DECL_CONSTEXPR inline QFlag(long value) Q_DECL_NOTHROW : i(int(value)) {}
- Q_DECL_CONSTEXPR inline QFlag(ulong value) Q_DECL_NOTHROW : i(int(long(value))) {}
+ Q_DECL_CONSTEXPR inline QFlag(long value) noexcept : i(int(value)) {}
+ Q_DECL_CONSTEXPR inline QFlag(ulong value) noexcept : i(int(long(value))) {}
# endif
- Q_DECL_CONSTEXPR inline QFlag(uint value) Q_DECL_NOTHROW : i(int(value)) {}
- Q_DECL_CONSTEXPR inline QFlag(short value) Q_DECL_NOTHROW : i(int(value)) {}
- Q_DECL_CONSTEXPR inline QFlag(ushort value) Q_DECL_NOTHROW : i(int(uint(value))) {}
- Q_DECL_CONSTEXPR inline operator uint() const Q_DECL_NOTHROW { return uint(i); }
+ Q_DECL_CONSTEXPR inline QFlag(uint value) noexcept : i(int(value)) {}
+ Q_DECL_CONSTEXPR inline QFlag(short value) noexcept : i(int(value)) {}
+ Q_DECL_CONSTEXPR inline QFlag(ushort value) noexcept : i(int(uint(value))) {}
+ Q_DECL_CONSTEXPR inline operator uint() const noexcept { return uint(i); }
#endif
};
Q_DECLARE_TYPEINFO(QFlag, Q_PRIMITIVE_TYPE);
@@ -77,12 +77,12 @@ class QIncompatibleFlag
{
int i;
public:
- Q_DECL_CONSTEXPR inline explicit QIncompatibleFlag(int i) Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR inline operator int() const Q_DECL_NOTHROW { return i; }
+ Q_DECL_CONSTEXPR inline explicit QIncompatibleFlag(int i) noexcept;
+ Q_DECL_CONSTEXPR inline operator int() const noexcept { return i; }
};
Q_DECLARE_TYPEINFO(QIncompatibleFlag, Q_PRIMITIVE_TYPE);
-Q_DECL_CONSTEXPR inline QIncompatibleFlag::QIncompatibleFlag(int value) Q_DECL_NOTHROW : i(value) {}
+Q_DECL_CONSTEXPR inline QIncompatibleFlag::QIncompatibleFlag(int value) noexcept : i(value) {}
#ifndef Q_NO_TYPESAFE_FLAGS
@@ -117,38 +117,38 @@ public:
Q_DECL_CONSTEXPR inline QFlags(const QFlags &other);
Q_DECL_CONSTEXPR inline QFlags &operator=(const QFlags &other);
#endif
- Q_DECL_CONSTEXPR inline QFlags(Enum flags) Q_DECL_NOTHROW : i(Int(flags)) {}
- Q_DECL_CONSTEXPR inline QFlags(Zero = Q_NULLPTR) Q_DECL_NOTHROW : i(0) {}
- Q_DECL_CONSTEXPR inline QFlags(QFlag flag) Q_DECL_NOTHROW : i(flag) {}
+ Q_DECL_CONSTEXPR inline QFlags(Enum flags) noexcept : i(Int(flags)) {}
+ Q_DECL_CONSTEXPR inline QFlags(Zero = nullptr) noexcept : i(0) {}
+ Q_DECL_CONSTEXPR inline QFlags(QFlag flag) noexcept : i(flag) {}
#ifdef Q_COMPILER_INITIALIZER_LISTS
- Q_DECL_CONSTEXPR inline QFlags(std::initializer_list<Enum> flags) Q_DECL_NOTHROW
+ Q_DECL_CONSTEXPR inline QFlags(std::initializer_list<Enum> flags) noexcept
: i(initializer_list_helper(flags.begin(), flags.end())) {}
#endif
- Q_DECL_RELAXED_CONSTEXPR inline QFlags &operator&=(int mask) Q_DECL_NOTHROW { i &= mask; return *this; }
- Q_DECL_RELAXED_CONSTEXPR inline QFlags &operator&=(uint mask) Q_DECL_NOTHROW { i &= mask; return *this; }
- Q_DECL_RELAXED_CONSTEXPR inline QFlags &operator&=(Enum mask) Q_DECL_NOTHROW { i &= Int(mask); return *this; }
- Q_DECL_RELAXED_CONSTEXPR inline QFlags &operator|=(QFlags other) Q_DECL_NOTHROW { i |= other.i; return *this; }
- Q_DECL_RELAXED_CONSTEXPR inline QFlags &operator|=(Enum other) Q_DECL_NOTHROW { i |= Int(other); return *this; }
- Q_DECL_RELAXED_CONSTEXPR inline QFlags &operator^=(QFlags other) Q_DECL_NOTHROW { i ^= other.i; return *this; }
- Q_DECL_RELAXED_CONSTEXPR inline QFlags &operator^=(Enum other) Q_DECL_NOTHROW { i ^= Int(other); return *this; }
-
- Q_DECL_CONSTEXPR inline operator Int() const Q_DECL_NOTHROW { return i; }
-
- Q_DECL_CONSTEXPR inline QFlags operator|(QFlags other) const Q_DECL_NOTHROW { return QFlags(QFlag(i | other.i)); }
- Q_DECL_CONSTEXPR inline QFlags operator|(Enum other) const Q_DECL_NOTHROW { return QFlags(QFlag(i | Int(other))); }
- Q_DECL_CONSTEXPR inline QFlags operator^(QFlags other) const Q_DECL_NOTHROW { return QFlags(QFlag(i ^ other.i)); }
- Q_DECL_CONSTEXPR inline QFlags operator^(Enum other) const Q_DECL_NOTHROW { return QFlags(QFlag(i ^ Int(other))); }
- Q_DECL_CONSTEXPR inline QFlags operator&(int mask) const Q_DECL_NOTHROW { return QFlags(QFlag(i & mask)); }
- Q_DECL_CONSTEXPR inline QFlags operator&(uint mask) const Q_DECL_NOTHROW { return QFlags(QFlag(i & mask)); }
- Q_DECL_CONSTEXPR inline QFlags operator&(Enum other) const Q_DECL_NOTHROW { return QFlags(QFlag(i & Int(other))); }
- Q_DECL_CONSTEXPR inline QFlags operator~() const Q_DECL_NOTHROW { return QFlags(QFlag(~i)); }
-
- Q_DECL_CONSTEXPR inline bool operator!() const Q_DECL_NOTHROW { return !i; }
-
- Q_DECL_CONSTEXPR inline bool testFlag(Enum flag) const Q_DECL_NOTHROW { return (i & Int(flag)) == Int(flag) && (Int(flag) != 0 || i == Int(flag) ); }
- Q_DECL_RELAXED_CONSTEXPR inline QFlags &setFlag(Enum flag, bool on = true) Q_DECL_NOTHROW
+ Q_DECL_RELAXED_CONSTEXPR inline QFlags &operator&=(int mask) noexcept { i &= mask; return *this; }
+ Q_DECL_RELAXED_CONSTEXPR inline QFlags &operator&=(uint mask) noexcept { i &= mask; return *this; }
+ Q_DECL_RELAXED_CONSTEXPR inline QFlags &operator&=(Enum mask) noexcept { i &= Int(mask); return *this; }
+ Q_DECL_RELAXED_CONSTEXPR inline QFlags &operator|=(QFlags other) noexcept { i |= other.i; return *this; }
+ Q_DECL_RELAXED_CONSTEXPR inline QFlags &operator|=(Enum other) noexcept { i |= Int(other); return *this; }
+ Q_DECL_RELAXED_CONSTEXPR inline QFlags &operator^=(QFlags other) noexcept { i ^= other.i; return *this; }
+ Q_DECL_RELAXED_CONSTEXPR inline QFlags &operator^=(Enum other) noexcept { i ^= Int(other); return *this; }
+
+ Q_DECL_CONSTEXPR inline operator Int() const noexcept { return i; }
+
+ Q_DECL_CONSTEXPR inline QFlags operator|(QFlags other) const noexcept { return QFlags(QFlag(i | other.i)); }
+ Q_DECL_CONSTEXPR inline QFlags operator|(Enum other) const noexcept { return QFlags(QFlag(i | Int(other))); }
+ Q_DECL_CONSTEXPR inline QFlags operator^(QFlags other) const noexcept { return QFlags(QFlag(i ^ other.i)); }
+ Q_DECL_CONSTEXPR inline QFlags operator^(Enum other) const noexcept { return QFlags(QFlag(i ^ Int(other))); }
+ Q_DECL_CONSTEXPR inline QFlags operator&(int mask) const noexcept { return QFlags(QFlag(i & mask)); }
+ Q_DECL_CONSTEXPR inline QFlags operator&(uint mask) const noexcept { return QFlags(QFlag(i & mask)); }
+ Q_DECL_CONSTEXPR inline QFlags operator&(Enum other) const noexcept { return QFlags(QFlag(i & Int(other))); }
+ Q_DECL_CONSTEXPR inline QFlags operator~() const noexcept { return QFlags(QFlag(~i)); }
+
+ Q_DECL_CONSTEXPR inline bool operator!() const noexcept { return !i; }
+
+ Q_DECL_CONSTEXPR inline bool testFlag(Enum flag) const noexcept { return (i & Int(flag)) == Int(flag) && (Int(flag) != 0 || i == Int(flag) ); }
+ Q_DECL_RELAXED_CONSTEXPR inline QFlags &setFlag(Enum flag, bool on = true) noexcept
{
return on ? (*this |= flag) : (*this &= ~Int(flag));
}
@@ -157,7 +157,7 @@ private:
#ifdef Q_COMPILER_INITIALIZER_LISTS
Q_DECL_CONSTEXPR static inline Int initializer_list_helper(typename std::initializer_list<Enum>::const_iterator it,
typename std::initializer_list<Enum>::const_iterator end)
- Q_DECL_NOTHROW
+ noexcept
{
return (it == end ? Int(0) : (Int(*it) | initializer_list_helper(it + 1, end)));
}
@@ -172,13 +172,13 @@ typedef QFlags<Enum> Flags;
#endif
#define Q_DECLARE_INCOMPATIBLE_FLAGS(Flags) \
-Q_DECL_CONSTEXPR inline QIncompatibleFlag operator|(Flags::enum_type f1, int f2) Q_DECL_NOTHROW \
+Q_DECL_CONSTEXPR inline QIncompatibleFlag operator|(Flags::enum_type f1, int f2) noexcept \
{ return QIncompatibleFlag(int(f1) | f2); }
#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags) \
-Q_DECL_CONSTEXPR inline QFlags<Flags::enum_type> operator|(Flags::enum_type f1, Flags::enum_type f2) Q_DECL_NOTHROW \
+Q_DECL_CONSTEXPR inline QFlags<Flags::enum_type> operator|(Flags::enum_type f1, Flags::enum_type f2) noexcept \
{ return QFlags<Flags::enum_type>(f1) | f2; } \
-Q_DECL_CONSTEXPR inline QFlags<Flags::enum_type> operator|(Flags::enum_type f1, QFlags<Flags::enum_type> f2) Q_DECL_NOTHROW \
+Q_DECL_CONSTEXPR inline QFlags<Flags::enum_type> operator|(Flags::enum_type f1, QFlags<Flags::enum_type> f2) noexcept \
{ return f2 | f1; } Q_DECLARE_INCOMPATIBLE_FLAGS(Flags)
diff --git a/src/corelib/global/qfloat16.cpp b/src/corelib/global/qfloat16.cpp
index fd608efe55..680268c59b 100644
--- a/src/corelib/global/qfloat16.cpp
+++ b/src/corelib/global/qfloat16.cpp
@@ -37,7 +37,7 @@
**
****************************************************************************/
-#include "qfloat16_p.h"
+#include "qfloat16.h"
#include "private/qsimd_p.h"
QT_BEGIN_NAMESPACE
@@ -65,28 +65,31 @@ QT_BEGIN_NAMESPACE
*/
/*!
- Returns true if the \c qfloat16 \a {f} is equivalent to infinity.
+ \fn bool qIsInf(qfloat16 f)
\relates <QFloat16>
+ Returns true if the \c qfloat16 \a {f} is equivalent to infinity.
+
\sa qIsInf
*/
-Q_REQUIRED_RESULT bool qIsInf(qfloat16 f) Q_DECL_NOTHROW { return qt_is_inf(f); }
/*!
- Returns true if the \c qfloat16 \a {f} is not a number (NaN).
+ \fn bool qIsNaN(qfloat16 f)
\relates <QFloat16>
+ Returns true if the \c qfloat16 \a {f} is not a number (NaN).
+
\sa qIsNaN
*/
-Q_REQUIRED_RESULT bool qIsNaN(qfloat16 f) Q_DECL_NOTHROW { return qt_is_nan(f); }
/*!
- Returns true if the \c qfloat16 \a {f} is a finite number.
+ \fn bool qIsFinite(qfloat16 f)
\relates <QFloat16>
+ Returns true if the \c qfloat16 \a {f} is a finite number.
+
\sa qIsFinite
*/
-Q_REQUIRED_RESULT bool qIsFinite(qfloat16 f) Q_DECL_NOTHROW { return qt_is_finite(f); }
/*! \fn int qRound(qfloat16 value)
\relates <QFloat16>
@@ -129,8 +132,8 @@ extern "C" {
# define f16cextern extern
#endif
-f16cextern void qFloatToFloat16_fast(quint16 *out, const float *in, qsizetype len) Q_DECL_NOTHROW;
-f16cextern void qFloatFromFloat16_fast(float *out, const quint16 *in, qsizetype len) Q_DECL_NOTHROW;
+f16cextern void qFloatToFloat16_fast(quint16 *out, const float *in, qsizetype len) noexcept;
+f16cextern void qFloatFromFloat16_fast(float *out, const quint16 *in, qsizetype len) noexcept;
#undef f16cextern
}
@@ -141,7 +144,7 @@ static inline bool hasFastF16()
return true;
}
-static void qFloatToFloat16_fast(quint16 *out, const float *in, qsizetype len) Q_DECL_NOTHROW
+static void qFloatToFloat16_fast(quint16 *out, const float *in, qsizetype len) noexcept
{
__fp16 *out_f16 = reinterpret_cast<__fp16 *>(out);
qsizetype i = 0;
@@ -151,7 +154,7 @@ static void qFloatToFloat16_fast(quint16 *out, const float *in, qsizetype len) Q
out_f16[i] = __fp16(in[i]);
}
-static void qFloatFromFloat16_fast(float *out, const quint16 *in, qsizetype len) Q_DECL_NOTHROW
+static void qFloatFromFloat16_fast(float *out, const quint16 *in, qsizetype len) noexcept
{
const __fp16 *in_f16 = reinterpret_cast<const __fp16 *>(in);
qsizetype i = 0;
@@ -166,12 +169,12 @@ static inline bool hasFastF16()
return false;
}
-static void qFloatToFloat16_fast(quint16 *, const float *, qsizetype) Q_DECL_NOTHROW
+static void qFloatToFloat16_fast(quint16 *, const float *, qsizetype) noexcept
{
Q_UNREACHABLE();
}
-static void qFloatFromFloat16_fast(float *, const quint16 *, qsizetype) Q_DECL_NOTHROW
+static void qFloatFromFloat16_fast(float *, const quint16 *, qsizetype) noexcept
{
Q_UNREACHABLE();
}
@@ -183,7 +186,7 @@ static void qFloatFromFloat16_fast(float *, const quint16 *, qsizetype) Q_DECL_N
Converts \a len floats from \a in to qfloat16 and stores them in \a out.
Both \a in and \a out must have \a len allocated entries.
*/
-Q_CORE_EXPORT void qFloatToFloat16(qfloat16 *out, const float *in, qsizetype len) Q_DECL_NOTHROW
+Q_CORE_EXPORT void qFloatToFloat16(qfloat16 *out, const float *in, qsizetype len) noexcept
{
if (hasFastF16())
return qFloatToFloat16_fast(reinterpret_cast<quint16 *>(out), in, len);
@@ -199,7 +202,7 @@ Q_CORE_EXPORT void qFloatToFloat16(qfloat16 *out, const float *in, qsizetype len
Converts \a len qfloat16 from \a in to floats and stores them in \a out.
Both \a in and \a out must have \a len allocated entries.
*/
-Q_CORE_EXPORT void qFloatFromFloat16(float *out, const qfloat16 *in, qsizetype len) Q_DECL_NOTHROW
+Q_CORE_EXPORT void qFloatFromFloat16(float *out, const qfloat16 *in, qsizetype len) noexcept
{
if (hasFastF16())
return qFloatFromFloat16_fast(out, reinterpret_cast<const quint16 *>(in), len);
diff --git a/src/corelib/global/qfloat16.h b/src/corelib/global/qfloat16.h
index 42cb1357f1..243aea98be 100644
--- a/src/corelib/global/qfloat16.h
+++ b/src/corelib/global/qfloat16.h
@@ -67,10 +67,14 @@ QT_BEGIN_NAMESPACE
class qfloat16
{
public:
- Q_DECL_CONSTEXPR inline qfloat16() Q_DECL_NOTHROW : b16(0) { }
- inline qfloat16(float f) Q_DECL_NOTHROW;
- inline operator float() const Q_DECL_NOTHROW;
-
+ constexpr inline qfloat16() noexcept : b16(0) {}
+ inline qfloat16(float f) noexcept;
+ inline operator float() const noexcept;
+
+ // Support for qIs{Inf,NaN,Finite}:
+ bool isInf() const noexcept { return ((b16 >> 8) & 0x7e) == 0x7c; }
+ bool isNaN() const noexcept { return ((b16 >> 8) & 0x7e) == 0x7e; }
+ bool isFinite() const noexcept { return ((b16 >> 8) & 0x7c) != 0x7c; }
private:
quint16 b16;
@@ -80,27 +84,29 @@ private:
Q_CORE_EXPORT static const quint32 basetable[];
Q_CORE_EXPORT static const quint32 shifttable[];
- friend bool qIsNull(qfloat16 f) Q_DECL_NOTHROW;
- friend qfloat16 operator-(qfloat16 a) Q_DECL_NOTHROW;
+ friend bool qIsNull(qfloat16 f) noexcept;
+ friend qfloat16 operator-(qfloat16 a) noexcept;
};
Q_DECLARE_TYPEINFO(qfloat16, Q_PRIMITIVE_TYPE);
-Q_CORE_EXPORT void qFloatToFloat16(qfloat16 *, const float *, qsizetype length) Q_DECL_NOTHROW;
-Q_CORE_EXPORT void qFloatFromFloat16(float *, const qfloat16 *, qsizetype length) Q_DECL_NOTHROW;
+Q_CORE_EXPORT void qFloatToFloat16(qfloat16 *, const float *, qsizetype length) noexcept;
+Q_CORE_EXPORT void qFloatFromFloat16(float *, const qfloat16 *, qsizetype length) noexcept;
-Q_REQUIRED_RESULT Q_CORE_EXPORT bool qIsInf(qfloat16 f) Q_DECL_NOTHROW; // complements qnumeric.h
-Q_REQUIRED_RESULT Q_CORE_EXPORT bool qIsNaN(qfloat16 f) Q_DECL_NOTHROW; // complements qnumeric.h
-Q_REQUIRED_RESULT Q_CORE_EXPORT bool qIsFinite(qfloat16 f) Q_DECL_NOTHROW; // complements qnumeric.h
+// Complement qnumeric.h:
+Q_REQUIRED_RESULT inline bool qIsInf(qfloat16 f) noexcept { return f.isInf(); }
+Q_REQUIRED_RESULT inline bool qIsNaN(qfloat16 f) noexcept { return f.isNaN(); }
+Q_REQUIRED_RESULT inline bool qIsFinite(qfloat16 f) noexcept { return f.isFinite(); }
+// Q_REQUIRED_RESULT quint32 qFloatDistance(qfloat16 a, qfloat16 b);
// The remainder of these utility functions complement qglobal.h
-Q_REQUIRED_RESULT inline int qRound(qfloat16 d) Q_DECL_NOTHROW
+Q_REQUIRED_RESULT inline int qRound(qfloat16 d) noexcept
{ return qRound(static_cast<float>(d)); }
-Q_REQUIRED_RESULT inline qint64 qRound64(qfloat16 d) Q_DECL_NOTHROW
+Q_REQUIRED_RESULT inline qint64 qRound64(qfloat16 d) noexcept
{ return qRound64(static_cast<float>(d)); }
-Q_REQUIRED_RESULT inline bool qFuzzyCompare(qfloat16 p1, qfloat16 p2) Q_DECL_NOTHROW
+Q_REQUIRED_RESULT inline bool qFuzzyCompare(qfloat16 p1, qfloat16 p2) noexcept
{
float f1 = static_cast<float>(p1);
float f2 = static_cast<float>(p2);
@@ -113,19 +119,19 @@ Q_REQUIRED_RESULT inline bool qFuzzyCompare(qfloat16 p1, qfloat16 p2) Q_DECL_NOT
return (qAbs(f1 - f2) * 102.5f <= qMin(qAbs(f1), qAbs(f2)));
}
-Q_REQUIRED_RESULT inline bool qIsNull(qfloat16 f) Q_DECL_NOTHROW
+Q_REQUIRED_RESULT inline bool qIsNull(qfloat16 f) noexcept
{
return (f.b16 & static_cast<quint16>(0x7fff)) == 0;
}
-inline int qIntCast(qfloat16 f) Q_DECL_NOTHROW
+inline int qIntCast(qfloat16 f) noexcept
{ return int(static_cast<float>(f)); }
#ifndef Q_QDOC
QT_WARNING_PUSH
QT_WARNING_DISABLE_CLANG("-Wc99-extensions")
QT_WARNING_DISABLE_GCC("-Wold-style-cast")
-inline qfloat16::qfloat16(float f) Q_DECL_NOTHROW
+inline qfloat16::qfloat16(float f) noexcept
{
#if defined(QT_COMPILER_SUPPORTS_F16C) && defined(__F16C__)
__m128 packsingle = _mm_set_ss(f);
@@ -143,7 +149,7 @@ inline qfloat16::qfloat16(float f) Q_DECL_NOTHROW
}
QT_WARNING_POP
-inline qfloat16::operator float() const Q_DECL_NOTHROW
+inline qfloat16::operator float() const noexcept
{
#if defined(QT_COMPILER_SUPPORTS_F16C) && defined(__F16C__)
__m128i packhalf = _mm_cvtsi32_si128(b16);
@@ -163,23 +169,23 @@ inline qfloat16::operator float() const Q_DECL_NOTHROW
}
#endif
-inline qfloat16 operator-(qfloat16 a) Q_DECL_NOTHROW
+inline qfloat16 operator-(qfloat16 a) noexcept
{
qfloat16 f;
f.b16 = a.b16 ^ quint16(0x8000);
return f;
}
-inline qfloat16 operator+(qfloat16 a, qfloat16 b) Q_DECL_NOTHROW { return qfloat16(static_cast<float>(a) + static_cast<float>(b)); }
-inline qfloat16 operator-(qfloat16 a, qfloat16 b) Q_DECL_NOTHROW { return qfloat16(static_cast<float>(a) - static_cast<float>(b)); }
-inline qfloat16 operator*(qfloat16 a, qfloat16 b) Q_DECL_NOTHROW { return qfloat16(static_cast<float>(a) * static_cast<float>(b)); }
-inline qfloat16 operator/(qfloat16 a, qfloat16 b) Q_DECL_NOTHROW { return qfloat16(static_cast<float>(a) / static_cast<float>(b)); }
+inline qfloat16 operator+(qfloat16 a, qfloat16 b) noexcept { return qfloat16(static_cast<float>(a) + static_cast<float>(b)); }
+inline qfloat16 operator-(qfloat16 a, qfloat16 b) noexcept { return qfloat16(static_cast<float>(a) - static_cast<float>(b)); }
+inline qfloat16 operator*(qfloat16 a, qfloat16 b) noexcept { return qfloat16(static_cast<float>(a) * static_cast<float>(b)); }
+inline qfloat16 operator/(qfloat16 a, qfloat16 b) noexcept { return qfloat16(static_cast<float>(a) / static_cast<float>(b)); }
#define QF16_MAKE_ARITH_OP_FP(FP, OP) \
- inline FP operator OP(qfloat16 lhs, FP rhs) Q_DECL_NOTHROW { return static_cast<FP>(lhs) OP rhs; } \
- inline FP operator OP(FP lhs, qfloat16 rhs) Q_DECL_NOTHROW { return lhs OP static_cast<FP>(rhs); }
+ inline FP operator OP(qfloat16 lhs, FP rhs) noexcept { return static_cast<FP>(lhs) OP rhs; } \
+ inline FP operator OP(FP lhs, qfloat16 rhs) noexcept { return lhs OP static_cast<FP>(rhs); }
#define QF16_MAKE_ARITH_OP_EQ_FP(FP, OP_EQ, OP) \
- inline qfloat16& operator OP_EQ(qfloat16& lhs, FP rhs) Q_DECL_NOTHROW \
+ inline qfloat16& operator OP_EQ(qfloat16& lhs, FP rhs) noexcept \
{ lhs = qfloat16(float(static_cast<FP>(lhs) OP rhs)); return lhs; }
#define QF16_MAKE_ARITH_OP(FP) \
QF16_MAKE_ARITH_OP_FP(FP, +) \
@@ -197,8 +203,8 @@ QF16_MAKE_ARITH_OP(float)
#undef QF16_MAKE_ARITH_OP_FP
#define QF16_MAKE_ARITH_OP_INT(OP) \
- inline double operator OP(qfloat16 lhs, int rhs) Q_DECL_NOTHROW { return static_cast<double>(lhs) OP rhs; } \
- inline double operator OP(int lhs, qfloat16 rhs) Q_DECL_NOTHROW { return lhs OP static_cast<double>(rhs); }
+ inline double operator OP(qfloat16 lhs, int rhs) noexcept { return static_cast<double>(lhs) OP rhs; } \
+ inline double operator OP(int lhs, qfloat16 rhs) noexcept { return lhs OP static_cast<double>(rhs); }
QF16_MAKE_ARITH_OP_INT(+)
QF16_MAKE_ARITH_OP_INT(-)
QF16_MAKE_ARITH_OP_INT(*)
@@ -209,16 +215,16 @@ QT_WARNING_PUSH
QT_WARNING_DISABLE_CLANG("-Wfloat-equal")
QT_WARNING_DISABLE_GCC("-Wfloat-equal")
-inline bool operator>(qfloat16 a, qfloat16 b) Q_DECL_NOTHROW { return static_cast<float>(a) > static_cast<float>(b); }
-inline bool operator<(qfloat16 a, qfloat16 b) Q_DECL_NOTHROW { return static_cast<float>(a) < static_cast<float>(b); }
-inline bool operator>=(qfloat16 a, qfloat16 b) Q_DECL_NOTHROW { return static_cast<float>(a) >= static_cast<float>(b); }
-inline bool operator<=(qfloat16 a, qfloat16 b) Q_DECL_NOTHROW { return static_cast<float>(a) <= static_cast<float>(b); }
-inline bool operator==(qfloat16 a, qfloat16 b) Q_DECL_NOTHROW { return static_cast<float>(a) == static_cast<float>(b); }
-inline bool operator!=(qfloat16 a, qfloat16 b) Q_DECL_NOTHROW { return static_cast<float>(a) != static_cast<float>(b); }
+inline bool operator>(qfloat16 a, qfloat16 b) noexcept { return static_cast<float>(a) > static_cast<float>(b); }
+inline bool operator<(qfloat16 a, qfloat16 b) noexcept { return static_cast<float>(a) < static_cast<float>(b); }
+inline bool operator>=(qfloat16 a, qfloat16 b) noexcept { return static_cast<float>(a) >= static_cast<float>(b); }
+inline bool operator<=(qfloat16 a, qfloat16 b) noexcept { return static_cast<float>(a) <= static_cast<float>(b); }
+inline bool operator==(qfloat16 a, qfloat16 b) noexcept { return static_cast<float>(a) == static_cast<float>(b); }
+inline bool operator!=(qfloat16 a, qfloat16 b) noexcept { return static_cast<float>(a) != static_cast<float>(b); }
#define QF16_MAKE_BOOL_OP_FP(FP, OP) \
- inline bool operator OP(qfloat16 lhs, FP rhs) Q_DECL_NOTHROW { return static_cast<FP>(lhs) OP rhs; } \
- inline bool operator OP(FP lhs, qfloat16 rhs) Q_DECL_NOTHROW { return lhs OP static_cast<FP>(rhs); }
+ inline bool operator OP(qfloat16 lhs, FP rhs) noexcept { return static_cast<FP>(lhs) OP rhs; } \
+ inline bool operator OP(FP lhs, qfloat16 rhs) noexcept { return lhs OP static_cast<FP>(rhs); }
#define QF16_MAKE_BOOL_OP(FP) \
QF16_MAKE_BOOL_OP_FP(FP, <) \
QF16_MAKE_BOOL_OP_FP(FP, >) \
@@ -233,8 +239,8 @@ QF16_MAKE_BOOL_OP(float)
#undef QF16_MAKE_BOOL_OP_FP
#define QF16_MAKE_BOOL_OP_INT(OP) \
- inline bool operator OP(qfloat16 a, int b) Q_DECL_NOTHROW { return static_cast<float>(a) OP b; } \
- inline bool operator OP(int a, qfloat16 b) Q_DECL_NOTHROW { return a OP static_cast<float>(b); }
+ inline bool operator OP(qfloat16 a, int b) noexcept { return static_cast<float>(a) OP b; } \
+ inline bool operator OP(int a, qfloat16 b) noexcept { return a OP static_cast<float>(b); }
QF16_MAKE_BOOL_OP_INT(>)
QF16_MAKE_BOOL_OP_INT(<)
QF16_MAKE_BOOL_OP_INT(>=)
@@ -248,7 +254,7 @@ QT_WARNING_POP
/*!
\internal
*/
-Q_REQUIRED_RESULT inline bool qFuzzyIsNull(qfloat16 f) Q_DECL_NOTHROW
+Q_REQUIRED_RESULT inline bool qFuzzyIsNull(qfloat16 f) noexcept
{
return qAbs(static_cast<float>(f)) <= 0.001f;
}
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index 7879109930..d95064af27 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -1147,12 +1147,12 @@ Q_STATIC_ASSERT((std::is_same<qsizetype, qptrdiff>::value));
\sa QT_VERSION_STR, QLibraryInfo::version()
*/
-const char *qVersion() Q_DECL_NOTHROW
+const char *qVersion() noexcept
{
return QT_VERSION_STR;
}
-bool qSharedBuild() Q_DECL_NOTHROW
+bool qSharedBuild() noexcept
{
#ifdef QT_SHARED
return true;
@@ -3206,7 +3206,7 @@ QByteArray QSysInfo::bootUniqueId()
The Q_CHECK_PTR macro calls this function if an allocation check
fails.
*/
-void qt_check_pointer(const char *n, int l) Q_DECL_NOTHROW
+void qt_check_pointer(const char *n, int l) noexcept
{
// make separate printing calls so that the first one may flush;
// the second one could want to allocate memory (fputs prints a
@@ -3233,7 +3233,7 @@ void qBadAlloc()
Allows you to call std::terminate() without including <exception>.
Called internally from QT_TERMINATE_ON_EXCEPTION
*/
-Q_NORETURN void qTerminate() Q_DECL_NOTHROW
+Q_NORETURN void qTerminate() noexcept
{
std::terminate();
}
@@ -3242,7 +3242,7 @@ Q_NORETURN void qTerminate() Q_DECL_NOTHROW
/*
The Q_ASSERT macro calls this function when the test fails.
*/
-void qt_assert(const char *assertion, const char *file, int line) Q_DECL_NOTHROW
+void qt_assert(const char *assertion, const char *file, int line) noexcept
{
QMessageLogger(file, line, nullptr).fatal("ASSERT: \"%s\" in file %s, line %d", assertion, file, line);
}
@@ -3250,7 +3250,7 @@ void qt_assert(const char *assertion, const char *file, int line) Q_DECL_NOTHROW
/*
The Q_ASSERT_X macro calls this function when the test fails.
*/
-void qt_assert_x(const char *where, const char *what, const char *file, int line) Q_DECL_NOTHROW
+void qt_assert_x(const char *where, const char *what, const char *file, int line) noexcept
{
QMessageLogger(file, line, nullptr).fatal("ASSERT failure in %s: \"%s\", file %s, line %d", where, what, file, line);
}
@@ -3457,7 +3457,7 @@ QString qEnvironmentVariable(const char *varName)
\sa qgetenv(), qEnvironmentVariable(), qEnvironmentVariableIsSet()
*/
-bool qEnvironmentVariableIsEmpty(const char *varName) Q_DECL_NOEXCEPT
+bool qEnvironmentVariableIsEmpty(const char *varName) noexcept
{
QMutexLocker locker(&environmentMutex);
#ifdef Q_CC_MSVC
@@ -3492,7 +3492,7 @@ bool qEnvironmentVariableIsEmpty(const char *varName) Q_DECL_NOEXCEPT
\sa qgetenv(), qEnvironmentVariable(), qEnvironmentVariableIsSet()
*/
-int qEnvironmentVariableIntValue(const char *varName, bool *ok) Q_DECL_NOEXCEPT
+int qEnvironmentVariableIntValue(const char *varName, bool *ok) noexcept
{
static const int NumBinaryDigitsPerOctalDigit = 3;
static const int MaxDigitsForOctalInt =
@@ -3561,7 +3561,7 @@ int qEnvironmentVariableIntValue(const char *varName, bool *ok) Q_DECL_NOEXCEPT
\sa qgetenv(), qEnvironmentVariable(), qEnvironmentVariableIsEmpty()
*/
-bool qEnvironmentVariableIsSet(const char *varName) Q_DECL_NOEXCEPT
+bool qEnvironmentVariableIsSet(const char *varName) noexcept
{
QMutexLocker locker(&environmentMutex);
#ifdef Q_CC_MSVC
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index 6f51c25747..a0207b483d 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -411,7 +411,7 @@ typedef double qreal;
#if !defined(QT_NAMESPACE) && defined(__cplusplus) && !defined(Q_QDOC)
extern "C"
#endif
-Q_CORE_EXPORT Q_DECL_CONST_FUNCTION const char *qVersion(void) Q_DECL_NOTHROW;
+Q_CORE_EXPORT Q_DECL_CONST_FUNCTION const char *qVersion(void) Q_DECL_NOEXCEPT;
#if defined(__cplusplus)
@@ -730,7 +730,7 @@ inline void qt_noop(void) {}
# define QT_CATCH(A) catch (A)
# define QT_THROW(A) throw A
# define QT_RETHROW throw
-Q_NORETURN Q_DECL_COLD_FUNCTION Q_CORE_EXPORT void qTerminate() Q_DECL_NOTHROW;
+Q_NORETURN Q_DECL_COLD_FUNCTION Q_CORE_EXPORT void qTerminate() noexcept;
# ifdef Q_COMPILER_NOEXCEPT
# define QT_TERMINATE_ON_EXCEPTION(expr) do { expr; } while (false)
# else
@@ -738,7 +738,7 @@ Q_NORETURN Q_DECL_COLD_FUNCTION Q_CORE_EXPORT void qTerminate() Q_DECL_NOTHROW;
# endif
#endif
-Q_CORE_EXPORT Q_DECL_CONST_FUNCTION bool qSharedBuild() Q_DECL_NOTHROW;
+Q_CORE_EXPORT Q_DECL_CONST_FUNCTION bool qSharedBuild() noexcept;
#ifndef Q_OUTOFLINE_TEMPLATE
# define Q_OUTOFLINE_TEMPLATE
@@ -781,7 +781,7 @@ Q_CORE_EXPORT QString qt_error_string(int errorCode = -1);
Q_NORETURN
#endif
Q_DECL_COLD_FUNCTION
-Q_CORE_EXPORT void qt_assert(const char *assertion, const char *file, int line) Q_DECL_NOTHROW;
+Q_CORE_EXPORT void qt_assert(const char *assertion, const char *file, int line) noexcept;
#if !defined(Q_ASSERT)
# if defined(QT_NO_DEBUG) && !defined(QT_FORCE_ASSERTS)
@@ -799,7 +799,7 @@ Q_CORE_EXPORT void qt_assert(const char *assertion, const char *file, int line)
Q_NORETURN
#endif
Q_DECL_COLD_FUNCTION
-Q_CORE_EXPORT void qt_assert_x(const char *where, const char *what, const char *file, int line) Q_DECL_NOTHROW;
+Q_CORE_EXPORT void qt_assert_x(const char *where, const char *what, const char *file, int line) noexcept;
#if !defined(Q_ASSERT_X)
# if defined(QT_NO_DEBUG) && !defined(QT_FORCE_ASSERTS)
@@ -809,7 +809,7 @@ Q_CORE_EXPORT void qt_assert_x(const char *where, const char *what, const char *
# endif
#endif
-Q_NORETURN Q_CORE_EXPORT void qt_check_pointer(const char *, int) Q_DECL_NOTHROW;
+Q_NORETURN Q_CORE_EXPORT void qt_check_pointer(const char *, int) noexcept;
Q_DECL_COLD_FUNCTION
Q_CORE_EXPORT void qBadAlloc();
@@ -968,7 +968,7 @@ QT_WARNING_DISABLE_MSVC(4530) /* C++ exception handler used, but unwind semantic
// this adds const to non-const objects (like std::as_const)
template <typename T>
-Q_DECL_CONSTEXPR typename std::add_const<T>::type &qAsConst(T &t) Q_DECL_NOTHROW { return t; }
+Q_DECL_CONSTEXPR typename std::add_const<T>::type &qAsConst(T &t) noexcept { return t; }
// prevent rvalue arguments:
template <typename T>
void qAsConst(const T &&) Q_DECL_EQ_DELETE;
@@ -1130,11 +1130,11 @@ template <typename... Args>
struct QNonConstOverload
{
template <typename R, typename T>
- Q_DECL_CONSTEXPR auto operator()(R (T::*ptr)(Args...)) const Q_DECL_NOTHROW -> decltype(ptr)
+ Q_DECL_CONSTEXPR auto operator()(R (T::*ptr)(Args...)) const noexcept -> decltype(ptr)
{ return ptr; }
template <typename R, typename T>
- static Q_DECL_CONSTEXPR auto of(R (T::*ptr)(Args...)) Q_DECL_NOTHROW -> decltype(ptr)
+ static Q_DECL_CONSTEXPR auto of(R (T::*ptr)(Args...)) noexcept -> decltype(ptr)
{ return ptr; }
};
@@ -1142,11 +1142,11 @@ template <typename... Args>
struct QConstOverload
{
template <typename R, typename T>
- Q_DECL_CONSTEXPR auto operator()(R (T::*ptr)(Args...) const) const Q_DECL_NOTHROW -> decltype(ptr)
+ Q_DECL_CONSTEXPR auto operator()(R (T::*ptr)(Args...) const) const noexcept -> decltype(ptr)
{ return ptr; }
template <typename R, typename T>
- static Q_DECL_CONSTEXPR auto of(R (T::*ptr)(Args...) const) Q_DECL_NOTHROW -> decltype(ptr)
+ static Q_DECL_CONSTEXPR auto of(R (T::*ptr)(Args...) const) noexcept -> decltype(ptr)
{ return ptr; }
};
@@ -1159,11 +1159,11 @@ struct QOverload : QConstOverload<Args...>, QNonConstOverload<Args...>
using QNonConstOverload<Args...>::operator();
template <typename R>
- Q_DECL_CONSTEXPR auto operator()(R (*ptr)(Args...)) const Q_DECL_NOTHROW -> decltype(ptr)
+ Q_DECL_CONSTEXPR auto operator()(R (*ptr)(Args...)) const noexcept -> decltype(ptr)
{ return ptr; }
template <typename R>
- static Q_DECL_CONSTEXPR auto of(R (*ptr)(Args...)) Q_DECL_NOTHROW -> decltype(ptr)
+ static Q_DECL_CONSTEXPR auto of(R (*ptr)(Args...)) noexcept -> decltype(ptr)
{ return ptr; }
};
@@ -1184,9 +1184,9 @@ Q_CORE_EXPORT QString qEnvironmentVariable(const char *varName, const QString &d
Q_CORE_EXPORT bool qputenv(const char *varName, const QByteArray& value);
Q_CORE_EXPORT bool qunsetenv(const char *varName);
-Q_CORE_EXPORT bool qEnvironmentVariableIsEmpty(const char *varName) Q_DECL_NOEXCEPT;
-Q_CORE_EXPORT bool qEnvironmentVariableIsSet(const char *varName) Q_DECL_NOEXCEPT;
-Q_CORE_EXPORT int qEnvironmentVariableIntValue(const char *varName, bool *ok=nullptr) Q_DECL_NOEXCEPT;
+Q_CORE_EXPORT bool qEnvironmentVariableIsEmpty(const char *varName) noexcept;
+Q_CORE_EXPORT bool qEnvironmentVariableIsSet(const char *varName) noexcept;
+Q_CORE_EXPORT int qEnvironmentVariableIntValue(const char *varName, bool *ok=nullptr) noexcept;
inline int qIntCast(double f) { return int(f); }
inline int qIntCast(float f) { return int(f); }
diff --git a/src/corelib/global/qglobalstatic.h b/src/corelib/global/qglobalstatic.h
index f5c46e9392..4f89876793 100644
--- a/src/corelib/global/qglobalstatic.h
+++ b/src/corelib/global/qglobalstatic.h
@@ -79,7 +79,7 @@ enum GuardValues {
Q_GLOBAL_STATIC_INTERNAL_DECORATION Type *innerFunction() \
{ \
struct HolderBase { \
- ~HolderBase() Q_DECL_NOTHROW \
+ ~HolderBase() noexcept \
{ if (guard.load() == QtGlobalStatic::Initialized) \
guard.store(QtGlobalStatic::Destroyed); } \
}; \
diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp
index 88cc5b0b01..c3eb469767 100644
--- a/src/corelib/global/qlibraryinfo.cpp
+++ b/src/corelib/global/qlibraryinfo.cpp
@@ -350,7 +350,7 @@ QLibraryInfo::buildDate()
\since 5.3
*/
-const char *QLibraryInfo::build() Q_DECL_NOTHROW
+const char *QLibraryInfo::build() noexcept
{
return QT_BUILD_STR;
}
@@ -377,7 +377,7 @@ QLibraryInfo::isDebugBuild()
\sa qVersion()
*/
-QVersionNumber QLibraryInfo::version() Q_DECL_NOTHROW
+QVersionNumber QLibraryInfo::version() noexcept
{
return QVersionNumber(QT_VERSION_MAJOR, QT_VERSION_MINOR, QT_VERSION_PATCH);
}
diff --git a/src/corelib/global/qlibraryinfo.h b/src/corelib/global/qlibraryinfo.h
index 80fc5bd4fc..20fd3897f7 100644
--- a/src/corelib/global/qlibraryinfo.h
+++ b/src/corelib/global/qlibraryinfo.h
@@ -62,12 +62,12 @@ public:
#endif // QT_DEPRECATED_SINCE(5, 5)
#endif // datestring
- static const char * build() Q_DECL_NOTHROW;
+ static const char * build() noexcept;
static bool isDebugBuild();
#ifndef QT_BOOTSTRAPPED
- static QVersionNumber version() Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
+ static QVersionNumber version() noexcept Q_DECL_CONST_FUNCTION;
#endif
enum LibraryLocation
diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp
index b2093101fa..a4d86e393b 100644
--- a/src/corelib/global/qlogging.cpp
+++ b/src/corelib/global/qlogging.cpp
@@ -346,7 +346,7 @@ using namespace QtPrivate;
*/
#if defined(Q_CC_MSVC) && defined(QT_DEBUG) && defined(_DEBUG) && defined(_CRT_ERROR)
-static inline void convert_to_wchar_t_elided(wchar_t *d, size_t space, const char *s) Q_DECL_NOEXCEPT
+static inline void convert_to_wchar_t_elided(wchar_t *d, size_t space, const char *s) noexcept
{
size_t len = qstrlen(s);
if (len + 1 > space) {
@@ -529,7 +529,7 @@ QDebug QMessageLogger::debug(QMessageLogger::CategoryFunction catFunc) const
\sa QNoDebug, qDebug()
*/
-QNoDebug QMessageLogger::noDebug() const Q_DECL_NOTHROW
+QNoDebug QMessageLogger::noDebug() const noexcept
{
return QNoDebug();
}
@@ -875,7 +875,7 @@ QDebug QMessageLogger::critical(QMessageLogger::CategoryFunction catFunc) const
\sa qFatal()
*/
-void QMessageLogger::fatal(const char *msg, ...) const Q_DECL_NOTHROW
+void QMessageLogger::fatal(const char *msg, ...) const noexcept
{
QString message;
diff --git a/src/corelib/global/qlogging.h b/src/corelib/global/qlogging.h
index dded09999b..8f39780112 100644
--- a/src/corelib/global/qlogging.h
+++ b/src/corelib/global/qlogging.h
@@ -121,7 +121,7 @@ public:
Q_NORETURN
#endif
Q_DECL_COLD_FUNCTION
- void fatal(const char *msg, ...) const Q_DECL_NOTHROW Q_ATTRIBUTE_FORMAT_PRINTF(2, 3);
+ void fatal(const char *msg, ...) const noexcept Q_ATTRIBUTE_FORMAT_PRINTF(2, 3);
#ifndef QT_NO_DEBUG_STREAM
QDebug debug() const;
@@ -137,7 +137,7 @@ public:
QDebug critical(const QLoggingCategory &cat) const;
QDebug critical(CategoryFunction catFunc) const;
- QNoDebug noDebug() const Q_DECL_NOTHROW;
+ QNoDebug noDebug() const noexcept;
#endif // QT_NO_DEBUG_STREAM
private:
diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h
index 6488426e64..610d7e4db7 100644
--- a/src/corelib/global/qnamespace.h
+++ b/src/corelib/global/qnamespace.h
@@ -50,10 +50,10 @@ QT_BEGIN_NAMESPACE
#if !defined(Q_QDOC) && !defined(Q_MOC_RUN)
struct QMetaObject;
-const QMetaObject *qt_getQtMetaObject() Q_DECL_NOEXCEPT; // defined in qobject.h (which can't be included here)
+const QMetaObject *qt_getQtMetaObject() noexcept; // defined in qobject.h (which can't be included here)
#define QT_Q_ENUM(ENUM) \
- inline const QMetaObject *qt_getEnumMetaObject(ENUM) Q_DECL_NOEXCEPT { return qt_getQtMetaObject(); } \
- inline Q_DECL_CONSTEXPR const char *qt_getEnumName(ENUM) Q_DECL_NOEXCEPT { return #ENUM; }
+ inline const QMetaObject *qt_getEnumMetaObject(ENUM) noexcept { return qt_getQtMetaObject(); } \
+ inline Q_DECL_CONSTEXPR const char *qt_getEnumName(ENUM) noexcept { return #ENUM; }
#define QT_Q_FLAG(ENUM) QT_Q_ENUM(ENUM)
#else
#define QT_Q_ENUM Q_ENUM
diff --git a/src/corelib/global/qnumeric_p.h b/src/corelib/global/qnumeric_p.h
index 56e670c477..21f9cfbef0 100644
--- a/src/corelib/global/qnumeric_p.h
+++ b/src/corelib/global/qnumeric_p.h
@@ -126,7 +126,7 @@ Q_DECL_CONST_FUNCTION static inline int fpclassify(float f) { return std::fpclas
#endif
}
-Q_DECL_CONSTEXPR Q_DECL_CONST_FUNCTION static inline double qt_inf() Q_DECL_NOEXCEPT
+Q_DECL_CONSTEXPR Q_DECL_CONST_FUNCTION static inline double qt_inf() noexcept
{
Q_STATIC_ASSERT_X(std::numeric_limits<double>::has_infinity,
"platform has no definition for infinity for type double");
@@ -134,7 +134,7 @@ Q_DECL_CONSTEXPR Q_DECL_CONST_FUNCTION static inline double qt_inf() Q_DECL_NOEX
}
// Signaling NaN
-Q_DECL_CONSTEXPR Q_DECL_CONST_FUNCTION static inline double qt_snan() Q_DECL_NOEXCEPT
+Q_DECL_CONSTEXPR Q_DECL_CONST_FUNCTION static inline double qt_snan() noexcept
{
Q_STATIC_ASSERT_X(std::numeric_limits<double>::has_signaling_NaN,
"platform has no definition for signaling NaN for type double");
@@ -142,7 +142,7 @@ Q_DECL_CONSTEXPR Q_DECL_CONST_FUNCTION static inline double qt_snan() Q_DECL_NOE
}
// Quiet NaN
-Q_DECL_CONSTEXPR Q_DECL_CONST_FUNCTION static inline double qt_qnan() Q_DECL_NOEXCEPT
+Q_DECL_CONSTEXPR Q_DECL_CONST_FUNCTION static inline double qt_qnan() noexcept
{
Q_STATIC_ASSERT_X(std::numeric_limits<double>::has_quiet_NaN,
"platform has no definition for quiet NaN for type double");
diff --git a/src/corelib/global/qrandom.cpp b/src/corelib/global/qrandom.cpp
index 6cc46bcf39..2ee8f0dd01 100644
--- a/src/corelib/global/qrandom.cpp
+++ b/src/corelib/global/qrandom.cpp
@@ -91,7 +91,7 @@ DECLSPEC_IMPORT BOOLEAN WINAPI SystemFunction036(PVOID RandomBuffer, ULONG Rando
QT_BEGIN_NAMESPACE
#if defined(Q_PROCESSOR_X86) && QT_COMPILER_SUPPORTS_HERE(RDRND)
-static qsizetype qt_random_cpu(void *buffer, qsizetype count) Q_DECL_NOTHROW;
+static qsizetype qt_random_cpu(void *buffer, qsizetype count) noexcept;
# ifdef Q_PROCESSOR_X86_64
# define _rdrandXX_step _rdrand64_step
@@ -99,7 +99,7 @@ static qsizetype qt_random_cpu(void *buffer, qsizetype count) Q_DECL_NOTHROW;
# define _rdrandXX_step _rdrand32_step
# endif
-static QT_FUNCTION_TARGET(RDRND) qsizetype qt_random_cpu(void *buffer, qsizetype count) Q_DECL_NOTHROW
+static QT_FUNCTION_TARGET(RDRND) qsizetype qt_random_cpu(void *buffer, qsizetype count) noexcept
{
unsigned *ptr = reinterpret_cast<unsigned *>(buffer);
unsigned *end = ptr + count;
@@ -134,7 +134,7 @@ enum {
struct QRandomGenerator::SystemGenerator
{
#if QT_CONFIG(getentropy)
- static qsizetype fillBuffer(void *buffer, qsizetype count) Q_DECL_NOTHROW
+ static qsizetype fillBuffer(void *buffer, qsizetype count) noexcept
{
// getentropy can read at most 256 bytes, so break the reading
qsizetype read = 0;
@@ -204,13 +204,13 @@ struct QRandomGenerator::SystemGenerator
}
#elif defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
- qsizetype fillBuffer(void *buffer, qsizetype count) Q_DECL_NOTHROW
+ qsizetype fillBuffer(void *buffer, qsizetype count) noexcept
{
auto RtlGenRandom = SystemFunction036;
return RtlGenRandom(buffer, ULONG(count)) ? count: 0;
}
#elif defined(Q_OS_WINRT)
- qsizetype fillBuffer(void *, qsizetype) Q_DECL_NOTHROW
+ qsizetype fillBuffer(void *, qsizetype) noexcept
{
// always use the fallback
return 0;
@@ -242,7 +242,7 @@ struct QRandomGenerator::SystemGenerator
#if defined(Q_OS_WIN)
static void fallback_update_seed(unsigned) {}
-static void fallback_fill(quint32 *ptr, qsizetype left) Q_DECL_NOTHROW
+static void fallback_fill(quint32 *ptr, qsizetype left) noexcept
{
// on Windows, rand_s is a high-quality random number generator
// and it requires no seeding
@@ -254,14 +254,14 @@ static void fallback_fill(quint32 *ptr, qsizetype left) Q_DECL_NOTHROW
}
#elif QT_CONFIG(getentropy)
static void fallback_update_seed(unsigned) {}
-static void fallback_fill(quint32 *, qsizetype) Q_DECL_NOTHROW
+static void fallback_fill(quint32 *, qsizetype) noexcept
{
// no fallback necessary, getentropy cannot fail under normal circumstances
Q_UNREACHABLE();
}
#elif defined(Q_OS_BSD4) && !defined(__GLIBC__)
static void fallback_update_seed(unsigned) {}
-static void fallback_fill(quint32 *ptr, qsizetype left) Q_DECL_NOTHROW
+static void fallback_fill(quint32 *ptr, qsizetype left) noexcept
{
// BSDs have arc4random(4) and these work even in chroot(2)
arc4random_buf(ptr, left * sizeof(*ptr));
@@ -280,7 +280,7 @@ Q_NEVER_INLINE
#ifdef Q_CC_GNU
__attribute__((cold)) // this function is pretty big, so optimize for size
#endif
-static void fallback_fill(quint32 *ptr, qsizetype left) Q_DECL_NOTHROW
+static void fallback_fill(quint32 *ptr, qsizetype left) noexcept
{
quint32 scratch[12]; // see element count below
quint32 *end = scratch;
@@ -930,7 +930,7 @@ inline QRandomGenerator::SystemGenerator &QRandomGenerator::SystemGenerator::sel
*/
/*!
- \fn quint32 QRandomGenerator::bounded(int highest)
+ \fn int QRandomGenerator::bounded(int highest)
\overload
Generates one random 32-bit quantity in the range between 0 (inclusive) and
@@ -957,7 +957,6 @@ inline QRandomGenerator::SystemGenerator &QRandomGenerator::SystemGenerator::sel
\snippet code/src_corelib_global_qrandom.cpp 14
-
Note that this function cannot be used to obtain values in the full 32-bit
range of quint32. Instead, use generate().
@@ -965,7 +964,7 @@ inline QRandomGenerator::SystemGenerator &QRandomGenerator::SystemGenerator::sel
*/
/*!
- \fn quint32 QRandomGenerator::bounded(int lowest, int highest)
+ \fn int QRandomGenerator::bounded(int lowest, int highest)
\overload
Generates one random 32-bit quantity in the range between \a lowest
@@ -1168,7 +1167,7 @@ QRandomGenerator &QRandomGenerator::operator=(const QRandomGenerator &other)
return *this;
}
-QRandomGenerator::QRandomGenerator(std::seed_seq &sseq) Q_DECL_NOTHROW
+QRandomGenerator::QRandomGenerator(std::seed_seq &sseq) noexcept
: type(MersenneTwister)
{
Q_ASSERT(this != system());
diff --git a/src/corelib/global/qrandom.h b/src/corelib/global/qrandom.h
index 46d3e0e152..2f72528266 100644
--- a/src/corelib/global/qrandom.h
+++ b/src/corelib/global/qrandom.h
@@ -68,7 +68,7 @@ public:
QRandomGenerator(const quint32 *seedBuffer, qsizetype len)
: QRandomGenerator(seedBuffer, seedBuffer + len)
{}
- Q_CORE_EXPORT QRandomGenerator(std::seed_seq &sseq) Q_DECL_NOTHROW;
+ Q_CORE_EXPORT QRandomGenerator(std::seed_seq &sseq) noexcept;
Q_CORE_EXPORT QRandomGenerator(const quint32 *begin, const quint32 *end);
// copy constructor & assignment operator (move unnecessary)
@@ -165,7 +165,7 @@ public:
typedef quint32 result_type;
result_type operator()() { return generate(); }
void seed(quint32 s = 1) { *this = { s }; }
- void seed(std::seed_seq &sseq) Q_DECL_NOTHROW { *this = { sseq }; }
+ void seed(std::seed_seq &sseq) noexcept { *this = { sseq }; }
Q_CORE_EXPORT void discard(unsigned long long z);
static Q_DECL_CONSTEXPR result_type min() { return std::numeric_limits<result_type>::min(); }
static Q_DECL_CONSTEXPR result_type max() { return std::numeric_limits<result_type>::max(); }
@@ -228,7 +228,7 @@ public:
QRandomGenerator64(const quint32 *seedBuffer, qsizetype len)
: QRandomGenerator(seedBuffer, len)
{}
- QRandomGenerator64(std::seed_seq &sseq) Q_DECL_NOTHROW
+ QRandomGenerator64(std::seed_seq &sseq) noexcept
: QRandomGenerator(sseq)
{}
QRandomGenerator64(const quint32 *begin, const quint32 *end)
diff --git a/src/corelib/io/qdebug.h b/src/corelib/io/qdebug.h
index 91fde75fa5..ea2d57370d 100644
--- a/src/corelib/io/qdebug.h
+++ b/src/corelib/io/qdebug.h
@@ -116,7 +116,7 @@ public:
inline QDebug(const QDebug &o):stream(o.stream) { ++stream->ref; }
inline QDebug &operator=(const QDebug &other);
~QDebug();
- inline void swap(QDebug &other) Q_DECL_NOTHROW { qSwap(stream, other.stream); }
+ inline void swap(QDebug &other) noexcept { qSwap(stream, other.stream); }
QDebug &resetFormat();
diff --git a/src/corelib/io/qdir.h b/src/corelib/io/qdir.h
index 9abb833ab1..547ac163c7 100644
--- a/src/corelib/io/qdir.h
+++ b/src/corelib/io/qdir.h
@@ -110,10 +110,10 @@ public:
QDir &operator=(const QString &path);
#endif
#ifdef Q_COMPILER_RVALUE_REFS
- QDir &operator=(QDir &&other) Q_DECL_NOTHROW { swap(other); return *this; }
+ QDir &operator=(QDir &&other) noexcept { swap(other); return *this; }
#endif
- void swap(QDir &other) Q_DECL_NOTHROW
+ void swap(QDir &other) noexcept
{ qSwap(d_ptr, other.d_ptr); }
void setPath(const QString &path);
@@ -190,7 +190,7 @@ public:
static QFileInfoList drives();
- Q_DECL_CONSTEXPR static inline QChar listSeparator() Q_DECL_NOTHROW
+ Q_DECL_CONSTEXPR static inline QChar listSeparator() noexcept
{
#if defined(Q_OS_WIN)
return QLatin1Char(';');
diff --git a/src/corelib/io/qfileinfo.h b/src/corelib/io/qfileinfo.h
index baea18fab1..bd9e1d216f 100644
--- a/src/corelib/io/qfileinfo.h
+++ b/src/corelib/io/qfileinfo.h
@@ -68,10 +68,10 @@ public:
QFileInfo &operator=(const QFileInfo &fileinfo);
#ifdef Q_COMPILER_RVALUE_REFS
- QFileInfo &operator=(QFileInfo &&other) Q_DECL_NOTHROW { swap(other); return *this; }
+ QFileInfo &operator=(QFileInfo &&other) noexcept { swap(other); return *this; }
#endif
- void swap(QFileInfo &other) Q_DECL_NOTHROW
+ void swap(QFileInfo &other) noexcept
{ qSwap(d_ptr, other.d_ptr); }
bool operator==(const QFileInfo &fileinfo) const;
diff --git a/src/corelib/io/qfilesystemengine_win.cpp b/src/corelib/io/qfilesystemengine_win.cpp
index 3f4b46573b..2020e34f93 100644
--- a/src/corelib/io/qfilesystemengine_win.cpp
+++ b/src/corelib/io/qfilesystemengine_win.cpp
@@ -555,7 +555,7 @@ typedef struct _FILE_ID_INFO {
#endif // if defined (Q_CC_MINGW) && WINVER < 0x0602
-// File ID for Windows up to version 7.
+// File ID for Windows up to version 7 and FAT32 drives
static inline QByteArray fileId(HANDLE handle)
{
#ifndef Q_OS_WINRT
@@ -588,6 +588,8 @@ QByteArray fileIdWin8(HANDLE handle)
result += ':';
// Note: MinGW-64's definition of FILE_ID_128 differs from the MSVC one.
result += QByteArray(reinterpret_cast<const char *>(&infoEx.FileId), int(sizeof(infoEx.FileId))).toHex();
+ } else {
+ result = fileId(handle); // GetFileInformationByHandleEx() is observed to fail for FAT32, QTBUG-74759
}
return result;
#else // !QT_BOOTSTRAPPED && !QT_BUILD_QMAKE
diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp
index d5d67d86f3..c7635cc7b4 100644
--- a/src/corelib/io/qprocess.cpp
+++ b/src/corelib/io/qprocess.cpp
@@ -42,6 +42,7 @@
#include <qdebug.h>
#include <qdir.h>
+#include <qscopedvaluerollback.h>
#if defined(Q_OS_WIN)
#include <qtimer.h>
#endif
@@ -1062,9 +1063,8 @@ bool QProcessPrivate::tryReadFromChannel(Channel *channel)
if (currentReadChannel == channelIdx) {
didRead = true;
if (!emittedReadyRead) {
- emittedReadyRead = true;
+ QScopedValueRollback<bool> guard(emittedReadyRead, true);
emit q->readyRead();
- emittedReadyRead = false;
}
}
emit q->channelReadyRead(int(channelIdx));
diff --git a/src/corelib/io/qprocess.h b/src/corelib/io/qprocess.h
index a2e3c01f7c..83b7138ff9 100644
--- a/src/corelib/io/qprocess.h
+++ b/src/corelib/io/qprocess.h
@@ -73,11 +73,11 @@ public:
QProcessEnvironment(const QProcessEnvironment &other);
~QProcessEnvironment();
#ifdef Q_COMPILER_RVALUE_REFS
- QProcessEnvironment &operator=(QProcessEnvironment && other) Q_DECL_NOTHROW { swap(other); return *this; }
+ QProcessEnvironment &operator=(QProcessEnvironment && other) noexcept { swap(other); return *this; }
#endif
QProcessEnvironment &operator=(const QProcessEnvironment &other);
- void swap(QProcessEnvironment &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+ void swap(QProcessEnvironment &other) noexcept { qSwap(d, other.d); }
bool operator==(const QProcessEnvironment &other) const;
inline bool operator!=(const QProcessEnvironment &other) const
diff --git a/src/corelib/io/qstandardpaths_unix.cpp b/src/corelib/io/qstandardpaths_unix.cpp
index 748ce67dac..eaa545b4fd 100644
--- a/src/corelib/io/qstandardpaths_unix.cpp
+++ b/src/corelib/io/qstandardpaths_unix.cpp
@@ -134,7 +134,9 @@ QString QStandardPaths::writableLocation(StandardLocation type)
return QString();
}
}
+#ifndef Q_OS_WASM
qWarning("QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '%s'", qPrintable(xdgRuntimeDir));
+#endif
} else {
fileInfo.setFile(xdgRuntimeDir);
if (!fileInfo.exists()) {
diff --git a/src/corelib/io/qstorageinfo.h b/src/corelib/io/qstorageinfo.h
index 4ab7a353ef..addcbb2990 100644
--- a/src/corelib/io/qstorageinfo.h
+++ b/src/corelib/io/qstorageinfo.h
@@ -63,10 +63,10 @@ public:
QStorageInfo &operator=(const QStorageInfo &other);
#ifdef Q_COMPILER_RVALUE_REFS
- QStorageInfo &operator=(QStorageInfo &&other) Q_DECL_NOTHROW { swap(other); return *this; }
+ QStorageInfo &operator=(QStorageInfo &&other) noexcept { swap(other); return *this; }
#endif
- inline void swap(QStorageInfo &other) Q_DECL_NOTHROW
+ inline void swap(QStorageInfo &other) noexcept
{ qSwap(d, other.d); }
void setPath(const QString &path);
diff --git a/src/corelib/io/qtemporaryfile.cpp b/src/corelib/io/qtemporaryfile.cpp
index 35bb465a04..ced08a9a87 100644
--- a/src/corelib/io/qtemporaryfile.cpp
+++ b/src/corelib/io/qtemporaryfile.cpp
@@ -908,8 +908,8 @@ QTemporaryFile *QTemporaryFile::createNativeFile(QFile &file)
qint64 old_off = 0;
if(wasOpen)
old_off = file.pos();
- else
- file.open(QIODevice::ReadOnly);
+ else if (!file.open(QIODevice::ReadOnly))
+ return nullptr;
//dump data
QTemporaryFile *ret = new QTemporaryFile;
if (ret->open()) {
diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp
index 6d82981fd6..b4090f710e 100644
--- a/src/corelib/io/qurl.cpp
+++ b/src/corelib/io/qurl.cpp
@@ -4159,7 +4159,7 @@ QList<QUrl> QUrl::fromStringList(const QStringList &urls, ParsingMode mode)
\relates QHash
\since 5.0
*/
-uint qHash(const QUrl &url, uint seed) Q_DECL_NOTHROW
+uint qHash(const QUrl &url, uint seed) noexcept
{
if (!url.d)
return qHash(-1, seed); // the hash of an unset port (-1)
diff --git a/src/corelib/io/qurl.h b/src/corelib/io/qurl.h
index 5062ef7905..70e549c1a9 100644
--- a/src/corelib/io/qurl.h
+++ b/src/corelib/io/qurl.h
@@ -119,7 +119,7 @@ class QTypeInfo<QUrlTwoFlags<E1, E2> > : public QTypeInfoMerger<QUrlTwoFlags<E1,
class QUrl;
// qHash is a friend, but we can't use default arguments for friends (§8.3.6.4)
-Q_CORE_EXPORT uint qHash(const QUrl &url, uint seed = 0) Q_DECL_NOTHROW;
+Q_CORE_EXPORT uint qHash(const QUrl &url, uint seed = 0) noexcept;
class Q_CORE_EXPORT QUrl
{
@@ -183,14 +183,14 @@ public:
QUrl &operator=(const QString &url);
#endif
#ifdef Q_COMPILER_RVALUE_REFS
- QUrl(QUrl &&other) Q_DECL_NOTHROW : d(other.d)
+ QUrl(QUrl &&other) noexcept : d(other.d)
{ other.d = nullptr; }
- inline QUrl &operator=(QUrl &&other) Q_DECL_NOTHROW
+ inline QUrl &operator=(QUrl &&other) noexcept
{ qSwap(d, other.d); return *this; }
#endif
~QUrl();
- inline void swap(QUrl &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+ inline void swap(QUrl &other) noexcept { qSwap(d, other.d); }
void setUrl(const QString &url, ParsingMode mode = TolerantMode);
QString url(FormattingOptions options = FormattingOptions(PrettyDecoded)) const;
@@ -361,7 +361,7 @@ public:
static QList<QUrl> fromStringList(const QStringList &uris, ParsingMode mode = TolerantMode);
static void setIdnWhitelist(const QStringList &);
- friend Q_CORE_EXPORT uint qHash(const QUrl &url, uint seed) Q_DECL_NOTHROW;
+ friend Q_CORE_EXPORT uint qHash(const QUrl &url, uint seed) noexcept;
private:
QUrlPrivate *d;
diff --git a/src/corelib/io/qurlquery.cpp b/src/corelib/io/qurlquery.cpp
index 10c3f836c8..d76107abfd 100644
--- a/src/corelib/io/qurlquery.cpp
+++ b/src/corelib/io/qurlquery.cpp
@@ -434,7 +434,7 @@ bool QUrlQuery::operator ==(const QUrlQuery &other) const
Returns the hash value for \a key,
using \a seed to seed the calculation.
*/
-uint qHash(const QUrlQuery &key, uint seed) Q_DECL_NOTHROW
+uint qHash(const QUrlQuery &key, uint seed) noexcept
{
if (const QUrlQueryPrivate *d = key.d) {
QtPrivate::QHashCombine hash;
diff --git a/src/corelib/io/qurlquery.h b/src/corelib/io/qurlquery.h
index e3688aae2c..2a497dc8da 100644
--- a/src/corelib/io/qurlquery.h
+++ b/src/corelib/io/qurlquery.h
@@ -52,7 +52,7 @@
QT_BEGIN_NAMESPACE
-Q_CORE_EXPORT uint qHash(const QUrlQuery &key, uint seed = 0) Q_DECL_NOTHROW;
+Q_CORE_EXPORT uint qHash(const QUrlQuery &key, uint seed = 0) noexcept;
class QUrlQueryPrivate;
class Q_CORE_EXPORT QUrlQuery
@@ -71,7 +71,7 @@ public:
QUrlQuery(const QUrlQuery &other);
QUrlQuery &operator=(const QUrlQuery &other);
#ifdef Q_COMPILER_RVALUE_REFS
- QUrlQuery &operator=(QUrlQuery &&other) Q_DECL_NOTHROW { swap(other); return *this; }
+ QUrlQuery &operator=(QUrlQuery &&other) noexcept { swap(other); return *this; }
#endif
~QUrlQuery();
@@ -79,7 +79,7 @@ public:
bool operator!=(const QUrlQuery &other) const
{ return !(*this == other); }
- void swap(QUrlQuery &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+ void swap(QUrlQuery &other) noexcept { qSwap(d, other.d); }
bool isEmpty() const;
bool isDetached() const;
@@ -111,7 +111,7 @@ public:
private:
friend class QUrl;
- friend Q_CORE_EXPORT uint qHash(const QUrlQuery &key, uint seed) Q_DECL_NOTHROW;
+ friend Q_CORE_EXPORT uint qHash(const QUrlQuery &key, uint seed) noexcept;
QSharedDataPointer<QUrlQueryPrivate> d;
public:
typedef QSharedDataPointer<QUrlQueryPrivate> DataPtr;
diff --git a/src/corelib/io/qurlrecode.cpp b/src/corelib/io/qurlrecode.cpp
index 443ae18b21..f23480c755 100644
--- a/src/corelib/io/qurlrecode.cpp
+++ b/src/corelib/io/qurlrecode.cpp
@@ -692,7 +692,7 @@ qt_urlRecode(QString &appendTo, const QChar *begin, const QChar *end,
}
// qstring.cpp
-bool qt_is_ascii(const char *&ptr, const char *end) Q_DECL_NOTHROW;
+bool qt_is_ascii(const char *&ptr, const char *end) noexcept;
/*!
\internal
diff --git a/src/corelib/io/qwindowspipereader.cpp b/src/corelib/io/qwindowspipereader.cpp
index 15c9f52cf3..1f03ac5d5a 100644
--- a/src/corelib/io/qwindowspipereader.cpp
+++ b/src/corelib/io/qwindowspipereader.cpp
@@ -40,6 +40,7 @@
#include "qwindowspipereader_p.h"
#include "qiodevice_p.h"
#include <qelapsedtimer.h>
+#include <qscopedvaluerollback.h>
QT_BEGIN_NAMESPACE
@@ -301,9 +302,8 @@ void QWindowsPipeReader::emitPendingReadyRead()
{
if (readyReadPending) {
readyReadPending = false;
- inReadyRead = true;
+ QScopedValueRollback<bool> guard(inReadyRead, true);
emit readyRead();
- inReadyRead = false;
}
}
diff --git a/src/corelib/io/qwindowspipewriter.cpp b/src/corelib/io/qwindowspipewriter.cpp
index 92e8b6db52..32536f495b 100644
--- a/src/corelib/io/qwindowspipewriter.cpp
+++ b/src/corelib/io/qwindowspipewriter.cpp
@@ -39,6 +39,7 @@
#include "qwindowspipewriter_p.h"
#include "qiodevice_p.h"
+#include <qscopedvaluerollback.h>
QT_BEGIN_NAMESPACE
@@ -111,9 +112,8 @@ void QWindowsPipeWriter::emitPendingBytesWrittenValue()
emit canWrite();
if (!inBytesWritten) {
- inBytesWritten = true;
+ QScopedValueRollback<bool> guard(inBytesWritten, true);
emit bytesWritten(bytes);
- inBytesWritten = false;
}
}
}
diff --git a/src/corelib/itemmodels/qabstractitemmodel.cpp b/src/corelib/itemmodels/qabstractitemmodel.cpp
index abd86f2b49..18f0f6f55f 100644
--- a/src/corelib/itemmodels/qabstractitemmodel.cpp
+++ b/src/corelib/itemmodels/qabstractitemmodel.cpp
@@ -2355,6 +2355,7 @@ QModelIndexList QAbstractItemModel::match(const QModelIndex &start, int role,
bool wrap = flags & Qt::MatchWrap;
bool allHits = (hits == -1);
QString text; // only convert to a string if it is needed
+ const int column = start.column();
QModelIndex p = parent(start);
int from = start.row();
int to = rowCount(p);
@@ -2362,7 +2363,7 @@ QModelIndexList QAbstractItemModel::match(const QModelIndex &start, int role,
// iterates twice if wrapping
for (int i = 0; (wrap && i < 2) || (!wrap && i < 1); ++i) {
for (int r = from; (r < to) && (allHits || result.count() < hits); ++r) {
- QModelIndex idx = index(r, start.column(), p);
+ QModelIndex idx = index(r, column, p);
if (!idx.isValid())
continue;
QVariant v = data(idx, role);
@@ -2401,10 +2402,13 @@ QModelIndexList QAbstractItemModel::match(const QModelIndex &start, int role,
result.append(idx);
}
}
- if (recurse && hasChildren(idx)) { // search the hierarchy
- result += match(index(0, idx.column(), idx), role,
- (text.isEmpty() ? value : text),
- (allHits ? -1 : hits - result.count()), flags);
+ if (recurse) {
+ const auto parent = column != 0 ? idx.sibling(idx.row(), 0) : idx;
+ if (hasChildren(parent)) { // search the hierarchy
+ result += match(index(0, column, parent), role,
+ (text.isEmpty() ? value : text),
+ (allHits ? -1 : hits - result.count()), flags);
+ }
}
}
// prepare for the next iteration
diff --git a/src/corelib/itemmodels/qabstractitemmodel.h b/src/corelib/itemmodels/qabstractitemmodel.h
index c34876d1d6..496f583c22 100644
--- a/src/corelib/itemmodels/qabstractitemmodel.h
+++ b/src/corelib/itemmodels/qabstractitemmodel.h
@@ -57,12 +57,12 @@ class Q_CORE_EXPORT QModelIndex
{
friend class QAbstractItemModel;
public:
- Q_DECL_CONSTEXPR inline QModelIndex() Q_DECL_NOTHROW : r(-1), c(-1), i(0), m(nullptr) {}
+ Q_DECL_CONSTEXPR inline QModelIndex() noexcept : r(-1), c(-1), i(0), m(nullptr) {}
// compiler-generated copy/move ctors/assignment operators are fine!
- Q_DECL_CONSTEXPR inline int row() const Q_DECL_NOTHROW { return r; }
- Q_DECL_CONSTEXPR inline int column() const Q_DECL_NOTHROW { return c; }
- Q_DECL_CONSTEXPR inline quintptr internalId() const Q_DECL_NOTHROW { return i; }
- inline void *internalPointer() const Q_DECL_NOTHROW { return reinterpret_cast<void*>(i); }
+ Q_DECL_CONSTEXPR inline int row() const noexcept { return r; }
+ Q_DECL_CONSTEXPR inline int column() const noexcept { return c; }
+ Q_DECL_CONSTEXPR inline quintptr internalId() const noexcept { return i; }
+ inline void *internalPointer() const noexcept { return reinterpret_cast<void*>(i); }
inline QModelIndex parent() const;
inline QModelIndex sibling(int row, int column) const;
inline QModelIndex siblingAtColumn(int column) const;
@@ -72,13 +72,13 @@ public:
#endif
inline QVariant data(int role = Qt::DisplayRole) const;
inline Qt::ItemFlags flags() const;
- Q_DECL_CONSTEXPR inline const QAbstractItemModel *model() const Q_DECL_NOTHROW { return m; }
- Q_DECL_CONSTEXPR inline bool isValid() const Q_DECL_NOTHROW { return (r >= 0) && (c >= 0) && (m != nullptr); }
- Q_DECL_CONSTEXPR inline bool operator==(const QModelIndex &other) const Q_DECL_NOTHROW
+ Q_DECL_CONSTEXPR inline const QAbstractItemModel *model() const noexcept { return m; }
+ Q_DECL_CONSTEXPR inline bool isValid() const noexcept { return (r >= 0) && (c >= 0) && (m != nullptr); }
+ Q_DECL_CONSTEXPR inline bool operator==(const QModelIndex &other) const noexcept
{ return (other.r == r) && (other.i == i) && (other.c == c) && (other.m == m); }
- Q_DECL_CONSTEXPR inline bool operator!=(const QModelIndex &other) const Q_DECL_NOTHROW
+ Q_DECL_CONSTEXPR inline bool operator!=(const QModelIndex &other) const noexcept
{ return !(*this == other); }
- Q_DECL_CONSTEXPR inline bool operator<(const QModelIndex &other) const Q_DECL_NOTHROW
+ Q_DECL_CONSTEXPR inline bool operator<(const QModelIndex &other) const noexcept
{
return r < other.r
|| (r == other.r && (c < other.c
@@ -86,9 +86,9 @@ public:
|| (i == other.i && std::less<const QAbstractItemModel *>()(m, other.m))))));
}
private:
- inline QModelIndex(int arow, int acolumn, void *ptr, const QAbstractItemModel *amodel) Q_DECL_NOTHROW
+ inline QModelIndex(int arow, int acolumn, void *ptr, const QAbstractItemModel *amodel) noexcept
: r(arow), c(acolumn), i(reinterpret_cast<quintptr>(ptr)), m(amodel) {}
- Q_DECL_CONSTEXPR inline QModelIndex(int arow, int acolumn, quintptr id, const QAbstractItemModel *amodel) Q_DECL_NOTHROW
+ Q_DECL_CONSTEXPR inline QModelIndex(int arow, int acolumn, quintptr id, const QAbstractItemModel *amodel) noexcept
: r(arow), c(acolumn), i(id), m(amodel) {}
int r, c;
quintptr i;
@@ -103,7 +103,7 @@ Q_CORE_EXPORT QDebug operator<<(QDebug, const QModelIndex &);
class QPersistentModelIndexData;
// qHash is a friend, but we can't use default arguments for friends (§8.3.6.4)
-uint qHash(const QPersistentModelIndex &index, uint seed = 0) Q_DECL_NOTHROW;
+uint qHash(const QPersistentModelIndex &index, uint seed = 0) noexcept;
class Q_CORE_EXPORT QPersistentModelIndex
{
@@ -118,12 +118,12 @@ public:
{ return !operator==(other); }
QPersistentModelIndex &operator=(const QPersistentModelIndex &other);
#ifdef Q_COMPILER_RVALUE_REFS
- inline QPersistentModelIndex(QPersistentModelIndex &&other) Q_DECL_NOTHROW
+ inline QPersistentModelIndex(QPersistentModelIndex &&other) noexcept
: d(other.d) { other.d = nullptr; }
- inline QPersistentModelIndex &operator=(QPersistentModelIndex &&other) Q_DECL_NOTHROW
+ inline QPersistentModelIndex &operator=(QPersistentModelIndex &&other) noexcept
{ qSwap(d, other.d); return *this; }
#endif
- inline void swap(QPersistentModelIndex &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+ inline void swap(QPersistentModelIndex &other) noexcept { qSwap(d, other.d); }
bool operator==(const QModelIndex &other) const;
bool operator!=(const QModelIndex &other) const;
QPersistentModelIndex &operator=(const QModelIndex &other);
@@ -143,14 +143,14 @@ public:
bool isValid() const;
private:
QPersistentModelIndexData *d;
- friend uint qHash(const QPersistentModelIndex &, uint seed) Q_DECL_NOTHROW;
+ friend uint qHash(const QPersistentModelIndex &, uint seed) noexcept;
#ifndef QT_NO_DEBUG_STREAM
friend Q_CORE_EXPORT QDebug operator<<(QDebug, const QPersistentModelIndex &);
#endif
};
Q_DECLARE_SHARED(QPersistentModelIndex)
-inline uint qHash(const QPersistentModelIndex &index, uint seed) Q_DECL_NOTHROW
+inline uint qHash(const QPersistentModelIndex &index, uint seed) noexcept
{ return qHash(index.d, seed); }
@@ -464,7 +464,7 @@ inline QVariant QModelIndex::data(int arole) const
inline Qt::ItemFlags QModelIndex::flags() const
{ return m ? m->flags(*this) : Qt::ItemFlags(); }
-inline uint qHash(const QModelIndex &index) Q_DECL_NOTHROW
+inline uint qHash(const QModelIndex &index) noexcept
{ return uint((uint(index.row()) << 4) + index.column() + index.internalId()); }
QT_END_NAMESPACE
diff --git a/src/corelib/itemmodels/qconcatenatetablesproxymodel.cpp b/src/corelib/itemmodels/qconcatenatetablesproxymodel.cpp
index a20024f468..0319d215a1 100644
--- a/src/corelib/itemmodels/qconcatenatetablesproxymodel.cpp
+++ b/src/corelib/itemmodels/qconcatenatetablesproxymodel.cpp
@@ -55,7 +55,7 @@ public:
struct SourceModelForRowResult
{
- SourceModelForRowResult() : sourceModel(Q_NULLPTR), sourceRow(-1) {}
+ SourceModelForRowResult() : sourceModel(nullptr), sourceRow(-1) {}
QAbstractItemModel *sourceModel;
int sourceRow;
};
diff --git a/src/corelib/itemmodels/qitemselectionmodel.h b/src/corelib/itemmodels/qitemselectionmodel.h
index 1c924053a5..e5cd24817b 100644
--- a/src/corelib/itemmodels/qitemselectionmodel.h
+++ b/src/corelib/itemmodels/qitemselectionmodel.h
@@ -61,9 +61,9 @@ public:
inline QItemSelectionRange(const QItemSelectionRange &other)
: tl(other.tl), br(other.br) {}
# ifdef Q_COMPILER_RVALUE_REFS
- QItemSelectionRange(QItemSelectionRange &&other) Q_DECL_NOTHROW
+ QItemSelectionRange(QItemSelectionRange &&other) noexcept
: tl(std::move(other.tl)), br(std::move(other.br)) {}
- QItemSelectionRange &operator=(QItemSelectionRange &&other) Q_DECL_NOTHROW
+ QItemSelectionRange &operator=(QItemSelectionRange &&other) noexcept
{ tl = std::move(other.tl); br = std::move(other.br); return *this; }
# endif
QItemSelectionRange &operator=(const QItemSelectionRange &other)
@@ -72,7 +72,7 @@ public:
QItemSelectionRange(const QModelIndex &topL, const QModelIndex &bottomR) : tl(topL), br(bottomR) {}
explicit QItemSelectionRange(const QModelIndex &index) : tl(index), br(tl) {}
- void swap(QItemSelectionRange &other) Q_DECL_NOTHROW
+ void swap(QItemSelectionRange &other) noexcept
{
qSwap(tl, other.tl);
qSwap(br, other.br);
@@ -249,7 +249,7 @@ Q_TEMPLATE_EXTERN template class Q_CORE_EXPORT QList<QItemSelectionRange>;
class Q_CORE_EXPORT QItemSelection : public QList<QItemSelectionRange>
{
public:
- QItemSelection() Q_DECL_NOTHROW : QList<QItemSelectionRange>() {}
+ QItemSelection() noexcept : QList<QItemSelectionRange>() {}
QItemSelection(const QModelIndex &topLeft, const QModelIndex &bottomRight);
// reusing QList::swap() here is OK!
diff --git a/src/corelib/kernel/qabstracteventdispatcher.cpp b/src/corelib/kernel/qabstracteventdispatcher.cpp
index 0ecfc7a8c7..186c2e743b 100644
--- a/src/corelib/kernel/qabstracteventdispatcher.cpp
+++ b/src/corelib/kernel/qabstracteventdispatcher.cpp
@@ -162,7 +162,7 @@ QAbstractEventDispatcher::~QAbstractEventDispatcher()
Returns a pointer to the event dispatcher object for the specified
\a thread. If \a thread is zero, the current thread is used. If no
event dispatcher exists for the specified thread, this function
- returns 0.
+ returns \nullptr.
\b{Note:} If Qt is built without thread support, the \a thread
argument is ignored.
diff --git a/src/corelib/kernel/qcore_unix_p.h b/src/corelib/kernel/qcore_unix_p.h
index 32ef6408c2..7f58813535 100644
--- a/src/corelib/kernel/qcore_unix_p.h
+++ b/src/corelib/kernel/qcore_unix_p.h
@@ -347,7 +347,7 @@ static inline pid_t qt_safe_waitpid(pid_t pid, int *status, int options)
#endif
// in qelapsedtimer_mac.cpp or qtimestamp_unix.cpp
-timespec qt_gettime() Q_DECL_NOTHROW;
+timespec qt_gettime() noexcept;
void qt_nanosleep(timespec amount);
QByteArray qt_readlink(const char *path);
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
index 5da33a5aae..4100fad28e 100644
--- a/src/corelib/kernel/qcoreapplication.cpp
+++ b/src/corelib/kernel/qcoreapplication.cpp
@@ -369,7 +369,7 @@ uint QCoreApplicationPrivate::attribs =
(1 << Qt::AA_SynthesizeMouseForUnhandledTabletEvents);
struct QCoreApplicationData {
- QCoreApplicationData() Q_DECL_NOTHROW {
+ QCoreApplicationData() noexcept {
applicationNameSet = false;
applicationVersionSet = false;
}
@@ -2917,7 +2917,7 @@ bool QCoreApplication::hasPendingEvents()
/*!
Returns a pointer to the event dispatcher object for the main thread. If no
- event dispatcher exists for the thread, this function returns 0.
+ event dispatcher exists for the thread, this function returns \nullptr.
*/
QAbstractEventDispatcher *QCoreApplication::eventDispatcher()
{
diff --git a/src/corelib/kernel/qcoreevent.cpp b/src/corelib/kernel/qcoreevent.cpp
index cacbb1e495..aabd32b4a8 100644
--- a/src/corelib/kernel/qcoreevent.cpp
+++ b/src/corelib/kernel/qcoreevent.cpp
@@ -421,7 +421,7 @@ struct QBasicAtomicBitField {
QBasicAtomicInteger<uint> next;
QBasicAtomicInteger<uint> data[NumInts];
- bool allocateSpecific(int which) Q_DECL_NOTHROW
+ bool allocateSpecific(int which) noexcept
{
QBasicAtomicInteger<uint> &entry = data[which / BitsPerInt];
const uint old = entry.load();
@@ -437,7 +437,7 @@ struct QBasicAtomicBitField {
// loop.
}
- int allocateNext() Q_DECL_NOTHROW
+ int allocateNext() noexcept
{
// Unroll loop to iterate over ints, then bits? Would save
// potentially a lot of cmpxchgs, because we can scan the
@@ -463,7 +463,7 @@ typedef QBasicAtomicBitField<QEvent::MaxUser - QEvent::User + 1> UserEventTypeRe
static UserEventTypeRegistry userEventTypeRegistry;
-static inline int registerEventTypeZeroBased(int id) Q_DECL_NOTHROW
+static inline int registerEventTypeZeroBased(int id) noexcept
{
// if the type hint hasn't been registered yet, take it:
if (id < UserEventTypeRegistry::NumBits && id >= 0 && userEventTypeRegistry.allocateSpecific(id))
@@ -486,7 +486,7 @@ static inline int registerEventTypeZeroBased(int id) Q_DECL_NOTHROW
Returns -1 if all available values are already taken or the
program is shutting down.
*/
-int QEvent::registerEventType(int hint) Q_DECL_NOTHROW
+int QEvent::registerEventType(int hint) noexcept
{
const int result = registerEventTypeZeroBased(QEvent::MaxUser - hint);
return result < 0 ? -1 : QEvent::MaxUser - result ;
diff --git a/src/corelib/kernel/qcoreevent.h b/src/corelib/kernel/qcoreevent.h
index ac974ba411..05af1a6132 100644
--- a/src/corelib/kernel/qcoreevent.h
+++ b/src/corelib/kernel/qcoreevent.h
@@ -307,7 +307,7 @@ public:
inline void accept() { m_accept = true; }
inline void ignore() { m_accept = false; }
- static int registerEventType(int hint = -1) Q_DECL_NOTHROW;
+ static int registerEventType(int hint = -1) noexcept;
protected:
QEventPrivate *d;
diff --git a/src/corelib/kernel/qdeadlinetimer.cpp b/src/corelib/kernel/qdeadlinetimer.cpp
index 6aa886cfe1..e0d9d9de73 100644
--- a/src/corelib/kernel/qdeadlinetimer.cpp
+++ b/src/corelib/kernel/qdeadlinetimer.cpp
@@ -188,7 +188,7 @@ Q_DECL_CONST_FUNCTION static inline QPair<qint64, qint64> toSecsAndNSecs(qint64
\sa hasExpired(), isForever(), remainingTime(), setRemainingTime()
*/
-QDeadlineTimer::QDeadlineTimer(qint64 msecs, Qt::TimerType type) Q_DECL_NOTHROW
+QDeadlineTimer::QDeadlineTimer(qint64 msecs, Qt::TimerType type) noexcept
: t2(0)
{
setRemainingTime(msecs, type);
@@ -260,7 +260,7 @@ QDeadlineTimer::QDeadlineTimer(qint64 msecs, Qt::TimerType type) Q_DECL_NOTHROW
\sa setPreciseRemainingTime(), hasExpired(), isForever(), remainingTime()
*/
-void QDeadlineTimer::setRemainingTime(qint64 msecs, Qt::TimerType timerType) Q_DECL_NOTHROW
+void QDeadlineTimer::setRemainingTime(qint64 msecs, Qt::TimerType timerType) noexcept
{
if (msecs == -1)
*this = QDeadlineTimer(Forever, timerType);
@@ -279,7 +279,7 @@ void QDeadlineTimer::setRemainingTime(qint64 msecs, Qt::TimerType timerType) Q_D
\sa setRemainingTime(), hasExpired(), isForever(), remainingTime()
*/
-void QDeadlineTimer::setPreciseRemainingTime(qint64 secs, qint64 nsecs, Qt::TimerType timerType) Q_DECL_NOTHROW
+void QDeadlineTimer::setPreciseRemainingTime(qint64 secs, qint64 nsecs, Qt::TimerType timerType) noexcept
{
if (secs == -1) {
*this = QDeadlineTimer(Forever, timerType);
@@ -342,7 +342,7 @@ void QDeadlineTimer::setPreciseRemainingTime(qint64 secs, qint64 nsecs, Qt::Time
\sa isForever(), remainingTime()
*/
-bool QDeadlineTimer::hasExpired() const Q_DECL_NOTHROW
+bool QDeadlineTimer::hasExpired() const noexcept
{
if (isForever())
return false;
@@ -389,7 +389,7 @@ void QDeadlineTimer::setTimerType(Qt::TimerType timerType)
\sa remainingTimeNSecs(), isForever(), hasExpired()
*/
-qint64 QDeadlineTimer::remainingTime() const Q_DECL_NOTHROW
+qint64 QDeadlineTimer::remainingTime() const noexcept
{
qint64 ns = remainingTimeNSecs();
return ns <= 0 ? ns : (ns + 999999) / (1000 * 1000);
@@ -403,7 +403,7 @@ qint64 QDeadlineTimer::remainingTime() const Q_DECL_NOTHROW
\sa remainingTime(), isForever(), hasExpired()
*/
-qint64 QDeadlineTimer::remainingTimeNSecs() const Q_DECL_NOTHROW
+qint64 QDeadlineTimer::remainingTimeNSecs() const noexcept
{
if (isForever())
return -1;
@@ -416,7 +416,7 @@ qint64 QDeadlineTimer::remainingTimeNSecs() const Q_DECL_NOTHROW
Same as remainingTimeNSecs, but may return negative remaining times. Does
not deal with Forever.
*/
-qint64 QDeadlineTimer::rawRemainingTimeNSecs() const Q_DECL_NOTHROW
+qint64 QDeadlineTimer::rawRemainingTimeNSecs() const noexcept
{
QDeadlineTimer now = current(timerType());
if (QDeadlineTimerNanosecondsInT2)
@@ -444,7 +444,7 @@ qint64 QDeadlineTimer::rawRemainingTimeNSecs() const Q_DECL_NOTHROW
\sa remainingTime(), deadlineNSecs(), setDeadline()
*/
-qint64 QDeadlineTimer::deadline() const Q_DECL_NOTHROW
+qint64 QDeadlineTimer::deadline() const noexcept
{
if (isForever())
return t1;
@@ -471,7 +471,7 @@ qint64 QDeadlineTimer::deadline() const Q_DECL_NOTHROW
\sa remainingTime(), deadlineNSecs()
*/
-qint64 QDeadlineTimer::deadlineNSecs() const Q_DECL_NOTHROW
+qint64 QDeadlineTimer::deadlineNSecs() const noexcept
{
if (isForever())
return t1;
@@ -492,7 +492,7 @@ qint64 QDeadlineTimer::deadlineNSecs() const Q_DECL_NOTHROW
\sa setPreciseDeadline(), deadline(), deadlineNSecs(), setRemainingTime()
*/
-void QDeadlineTimer::setDeadline(qint64 msecs, Qt::TimerType timerType) Q_DECL_NOTHROW
+void QDeadlineTimer::setDeadline(qint64 msecs, Qt::TimerType timerType) noexcept
{
if (msecs == (std::numeric_limits<qint64>::max)()) {
setPreciseDeadline(msecs, 0, timerType); // msecs == MAX implies Forever
@@ -513,7 +513,7 @@ void QDeadlineTimer::setDeadline(qint64 msecs, Qt::TimerType timerType) Q_DECL_N
\sa setDeadline(), deadline(), deadlineNSecs(), setRemainingTime()
*/
-void QDeadlineTimer::setPreciseDeadline(qint64 secs, qint64 nsecs, Qt::TimerType timerType) Q_DECL_NOTHROW
+void QDeadlineTimer::setPreciseDeadline(qint64 secs, qint64 nsecs, Qt::TimerType timerType) noexcept
{
type = timerType;
if (secs == (std::numeric_limits<qint64>::max)() || nsecs == (std::numeric_limits<qint64>::max)()) {
@@ -534,7 +534,7 @@ void QDeadlineTimer::setPreciseDeadline(qint64 secs, qint64 nsecs, Qt::TimerType
\note if \a dt was created as expired, its deadline is indeterminate and
adding an amount of time may or may not cause it to become unexpired.
*/
-QDeadlineTimer QDeadlineTimer::addNSecs(QDeadlineTimer dt, qint64 nsecs) Q_DECL_NOTHROW
+QDeadlineTimer QDeadlineTimer::addNSecs(QDeadlineTimer dt, qint64 nsecs) noexcept
{
if (dt.isForever() || nsecs == (std::numeric_limits<qint64>::max)()) {
dt = QDeadlineTimer(Forever, dt.timerType());
diff --git a/src/corelib/kernel/qdeadlinetimer.h b/src/corelib/kernel/qdeadlinetimer.h
index 1a4ee04a96..8032ee9018 100644
--- a/src/corelib/kernel/qdeadlinetimer.h
+++ b/src/corelib/kernel/qdeadlinetimer.h
@@ -63,49 +63,49 @@ class Q_CORE_EXPORT QDeadlineTimer
public:
enum ForeverConstant { Forever };
- Q_DECL_CONSTEXPR QDeadlineTimer(Qt::TimerType type_ = Qt::CoarseTimer) Q_DECL_NOTHROW
+ Q_DECL_CONSTEXPR QDeadlineTimer(Qt::TimerType type_ = Qt::CoarseTimer) noexcept
: t1(0), t2(0), type(type_) {}
- Q_DECL_CONSTEXPR QDeadlineTimer(ForeverConstant, Qt::TimerType type_ = Qt::CoarseTimer) Q_DECL_NOTHROW
+ Q_DECL_CONSTEXPR QDeadlineTimer(ForeverConstant, Qt::TimerType type_ = Qt::CoarseTimer) noexcept
: t1(std::numeric_limits<qint64>::max()), t2(0), type(type_) {}
- explicit QDeadlineTimer(qint64 msecs, Qt::TimerType type = Qt::CoarseTimer) Q_DECL_NOTHROW;
+ explicit QDeadlineTimer(qint64 msecs, Qt::TimerType type = Qt::CoarseTimer) noexcept;
- void swap(QDeadlineTimer &other) Q_DECL_NOTHROW
+ void swap(QDeadlineTimer &other) noexcept
{ qSwap(t1, other.t1); qSwap(t2, other.t2); qSwap(type, other.type); }
- Q_DECL_CONSTEXPR bool isForever() const Q_DECL_NOTHROW
+ Q_DECL_CONSTEXPR bool isForever() const noexcept
{ return t1 == (std::numeric_limits<qint64>::max)(); }
- bool hasExpired() const Q_DECL_NOTHROW;
+ bool hasExpired() const noexcept;
- Qt::TimerType timerType() const Q_DECL_NOTHROW
+ Qt::TimerType timerType() const noexcept
{ return Qt::TimerType(type & 0xff); }
void setTimerType(Qt::TimerType type);
- qint64 remainingTime() const Q_DECL_NOTHROW;
- qint64 remainingTimeNSecs() const Q_DECL_NOTHROW;
- void setRemainingTime(qint64 msecs, Qt::TimerType type = Qt::CoarseTimer) Q_DECL_NOTHROW;
+ qint64 remainingTime() const noexcept;
+ qint64 remainingTimeNSecs() const noexcept;
+ void setRemainingTime(qint64 msecs, Qt::TimerType type = Qt::CoarseTimer) noexcept;
void setPreciseRemainingTime(qint64 secs, qint64 nsecs = 0,
- Qt::TimerType type = Qt::CoarseTimer) Q_DECL_NOTHROW;
+ Qt::TimerType type = Qt::CoarseTimer) noexcept;
- qint64 deadline() const Q_DECL_NOTHROW Q_DECL_PURE_FUNCTION;
- qint64 deadlineNSecs() const Q_DECL_NOTHROW Q_DECL_PURE_FUNCTION;
- void setDeadline(qint64 msecs, Qt::TimerType timerType = Qt::CoarseTimer) Q_DECL_NOTHROW;
+ qint64 deadline() const noexcept Q_DECL_PURE_FUNCTION;
+ qint64 deadlineNSecs() const noexcept Q_DECL_PURE_FUNCTION;
+ void setDeadline(qint64 msecs, Qt::TimerType timerType = Qt::CoarseTimer) noexcept;
void setPreciseDeadline(qint64 secs, qint64 nsecs = 0,
- Qt::TimerType type = Qt::CoarseTimer) Q_DECL_NOTHROW;
+ Qt::TimerType type = Qt::CoarseTimer) noexcept;
- 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;
+ static QDeadlineTimer addNSecs(QDeadlineTimer dt, qint64 nsecs) noexcept Q_DECL_PURE_FUNCTION;
+ static QDeadlineTimer current(Qt::TimerType timerType = Qt::CoarseTimer) noexcept;
- friend bool operator==(QDeadlineTimer d1, QDeadlineTimer d2) Q_DECL_NOTHROW
+ friend bool operator==(QDeadlineTimer d1, QDeadlineTimer d2) noexcept
{ return d1.t1 == d2.t1 && d1.t2 == d2.t2; }
- friend bool operator!=(QDeadlineTimer d1, QDeadlineTimer d2) Q_DECL_NOTHROW
+ friend bool operator!=(QDeadlineTimer d1, QDeadlineTimer d2) noexcept
{ return !(d1 == d2); }
- friend bool operator<(QDeadlineTimer d1, QDeadlineTimer d2) Q_DECL_NOTHROW
+ friend bool operator<(QDeadlineTimer d1, QDeadlineTimer d2) noexcept
{ return d1.t1 < d2.t1 || (d1.t1 == d2.t1 && d1.t2 < d2.t2); }
- friend bool operator<=(QDeadlineTimer d1, QDeadlineTimer d2) Q_DECL_NOTHROW
+ friend bool operator<=(QDeadlineTimer d1, QDeadlineTimer d2) noexcept
{ return d1 == d2 || d1 < d2; }
- friend bool operator>(QDeadlineTimer d1, QDeadlineTimer d2) Q_DECL_NOTHROW
+ friend bool operator>(QDeadlineTimer d1, QDeadlineTimer d2) noexcept
{ return d2 < d1; }
- friend bool operator>=(QDeadlineTimer d1, QDeadlineTimer d2) Q_DECL_NOTHROW
+ friend bool operator>=(QDeadlineTimer d1, QDeadlineTimer d2) noexcept
{ return !(d1 < d2); }
friend QDeadlineTimer operator+(QDeadlineTimer dt, qint64 msecs)
@@ -160,7 +160,7 @@ public:
setPreciseRemainingTime(0, std::chrono::nanoseconds(remaining).count(), type_);
}
- std::chrono::nanoseconds remainingTimeAsDuration() const Q_DECL_NOTHROW
+ std::chrono::nanoseconds remainingTimeAsDuration() const noexcept
{
if (isForever())
return std::chrono::nanoseconds::max();
@@ -186,7 +186,7 @@ private:
unsigned t2;
unsigned type;
- qint64 rawRemainingTimeNSecs() const Q_DECL_NOTHROW;
+ qint64 rawRemainingTimeNSecs() const noexcept;
public:
// This is not a public function, it's here only for Qt's internal convenience...
diff --git a/src/corelib/kernel/qelapsedtimer.cpp b/src/corelib/kernel/qelapsedtimer.cpp
index e578b5b8b3..adb554b624 100644
--- a/src/corelib/kernel/qelapsedtimer.cpp
+++ b/src/corelib/kernel/qelapsedtimer.cpp
@@ -236,7 +236,7 @@ static const qint64 invalidData = Q_INT64_C(0x8000000000000000);
\sa isValid(), start(), restart()
*/
-void QElapsedTimer::invalidate() Q_DECL_NOTHROW
+void QElapsedTimer::invalidate() noexcept
{
t1 = t2 = invalidData;
}
@@ -247,7 +247,7 @@ void QElapsedTimer::invalidate() Q_DECL_NOTHROW
\sa invalidate(), start(), restart()
*/
-bool QElapsedTimer::isValid() const Q_DECL_NOTHROW
+bool QElapsedTimer::isValid() const noexcept
{
return t1 != invalidData && t2 != invalidData;
}
@@ -260,7 +260,7 @@ bool QElapsedTimer::isValid() const Q_DECL_NOTHROW
\sa elapsed(), QDeadlineTimer
*/
-bool QElapsedTimer::hasExpired(qint64 timeout) const Q_DECL_NOTHROW
+bool QElapsedTimer::hasExpired(qint64 timeout) const noexcept
{
// if timeout is -1, quint64(timeout) is LLINT_MAX, so this will be
// considered as never expired
diff --git a/src/corelib/kernel/qelapsedtimer.h b/src/corelib/kernel/qelapsedtimer.h
index 7954b41bf4..873847f6b6 100644
--- a/src/corelib/kernel/qelapsedtimer.h
+++ b/src/corelib/kernel/qelapsedtimer.h
@@ -62,28 +62,28 @@ public:
{
}
- static ClockType clockType() Q_DECL_NOTHROW;
- static bool isMonotonic() Q_DECL_NOTHROW;
+ static ClockType clockType() noexcept;
+ static bool isMonotonic() noexcept;
- void start() Q_DECL_NOTHROW;
- qint64 restart() Q_DECL_NOTHROW;
- void invalidate() Q_DECL_NOTHROW;
- bool isValid() const Q_DECL_NOTHROW;
+ void start() noexcept;
+ qint64 restart() noexcept;
+ void invalidate() noexcept;
+ bool isValid() const noexcept;
- qint64 nsecsElapsed() const Q_DECL_NOTHROW;
- qint64 elapsed() const Q_DECL_NOTHROW;
- bool hasExpired(qint64 timeout) const Q_DECL_NOTHROW;
+ qint64 nsecsElapsed() const noexcept;
+ qint64 elapsed() const noexcept;
+ bool hasExpired(qint64 timeout) const noexcept;
- qint64 msecsSinceReference() const Q_DECL_NOTHROW;
- qint64 msecsTo(const QElapsedTimer &other) const Q_DECL_NOTHROW;
- qint64 secsTo(const QElapsedTimer &other) const Q_DECL_NOTHROW;
+ qint64 msecsSinceReference() const noexcept;
+ qint64 msecsTo(const QElapsedTimer &other) const noexcept;
+ qint64 secsTo(const QElapsedTimer &other) const noexcept;
- bool operator==(const QElapsedTimer &other) const Q_DECL_NOTHROW
+ bool operator==(const QElapsedTimer &other) const noexcept
{ return t1 == other.t1 && t2 == other.t2; }
- bool operator!=(const QElapsedTimer &other) const Q_DECL_NOTHROW
+ bool operator!=(const QElapsedTimer &other) const noexcept
{ return !(*this == other); }
- friend bool Q_CORE_EXPORT operator<(const QElapsedTimer &v1, const QElapsedTimer &v2) Q_DECL_NOTHROW;
+ friend bool Q_CORE_EXPORT operator<(const QElapsedTimer &v1, const QElapsedTimer &v2) noexcept;
private:
qint64 t1;
diff --git a/src/corelib/kernel/qelapsedtimer_generic.cpp b/src/corelib/kernel/qelapsedtimer_generic.cpp
index fdeb385188..fe959e3c94 100644
--- a/src/corelib/kernel/qelapsedtimer_generic.cpp
+++ b/src/corelib/kernel/qelapsedtimer_generic.cpp
@@ -48,7 +48,7 @@ QT_BEGIN_NAMESPACE
\sa isMonotonic()
*/
-QElapsedTimer::ClockType QElapsedTimer::clockType() Q_DECL_NOTHROW
+QElapsedTimer::ClockType QElapsedTimer::clockType() noexcept
{
return SystemTime;
}
@@ -60,7 +60,7 @@ QElapsedTimer::ClockType QElapsedTimer::clockType() Q_DECL_NOTHROW
\sa clockType(), QElapsedTimer::ClockType
*/
-bool QElapsedTimer::isMonotonic() Q_DECL_NOTHROW
+bool QElapsedTimer::isMonotonic() noexcept
{
return false;
}
@@ -75,7 +75,7 @@ bool QElapsedTimer::isMonotonic() Q_DECL_NOTHROW
\sa restart(), invalidate(), elapsed()
*/
-void QElapsedTimer::start() Q_DECL_NOTHROW
+void QElapsedTimer::start() noexcept
{
restart();
}
@@ -97,7 +97,7 @@ void QElapsedTimer::start() Q_DECL_NOTHROW
\sa start(), invalidate(), elapsed(), isValid()
*/
-qint64 QElapsedTimer::restart() Q_DECL_NOTHROW
+qint64 QElapsedTimer::restart() noexcept
{
qint64 old = t1;
t1 = QDateTime::currentMSecsSinceEpoch();
@@ -118,7 +118,7 @@ qint64 QElapsedTimer::restart() Q_DECL_NOTHROW
\sa start(), restart(), hasExpired(), invalidate()
*/
-qint64 QElapsedTimer::nsecsElapsed() const Q_DECL_NOTHROW
+qint64 QElapsedTimer::nsecsElapsed() const noexcept
{
return elapsed() * 1000000;
}
@@ -132,7 +132,7 @@ qint64 QElapsedTimer::nsecsElapsed() const Q_DECL_NOTHROW
\sa start(), restart(), hasExpired(), isValid(), invalidate()
*/
-qint64 QElapsedTimer::elapsed() const Q_DECL_NOTHROW
+qint64 QElapsedTimer::elapsed() const noexcept
{
return QDateTime::currentMSecsSinceEpoch() - t1;
}
@@ -152,7 +152,7 @@ qint64 QElapsedTimer::elapsed() const Q_DECL_NOTHROW
\sa clockType(), elapsed()
*/
-qint64 QElapsedTimer::msecsSinceReference() const Q_DECL_NOTHROW
+qint64 QElapsedTimer::msecsSinceReference() const noexcept
{
return t1;
}
@@ -167,7 +167,7 @@ qint64 QElapsedTimer::msecsSinceReference() const Q_DECL_NOTHROW
\sa secsTo(), elapsed()
*/
-qint64 QElapsedTimer::msecsTo(const QElapsedTimer &other) const Q_DECL_NOTHROW
+qint64 QElapsedTimer::msecsTo(const QElapsedTimer &other) const noexcept
{
qint64 diff = other.t1 - t1;
return diff;
@@ -183,7 +183,7 @@ qint64 QElapsedTimer::msecsTo(const QElapsedTimer &other) const Q_DECL_NOTHROW
\sa msecsTo(), elapsed()
*/
-qint64 QElapsedTimer::secsTo(const QElapsedTimer &other) const Q_DECL_NOTHROW
+qint64 QElapsedTimer::secsTo(const QElapsedTimer &other) const noexcept
{
return msecsTo(other) / 1000;
}
@@ -197,12 +197,12 @@ qint64 QElapsedTimer::secsTo(const QElapsedTimer &other) const Q_DECL_NOTHROW
and the other isn't. However, two invalid timers are equal and thus this
function will return false.
*/
-bool operator<(const QElapsedTimer &v1, const QElapsedTimer &v2) Q_DECL_NOTHROW
+bool operator<(const QElapsedTimer &v1, const QElapsedTimer &v2) noexcept
{
return v1.t1 < v2.t1;
}
-QDeadlineTimer QDeadlineTimer::current(Qt::TimerType timerType) Q_DECL_NOTHROW
+QDeadlineTimer QDeadlineTimer::current(Qt::TimerType timerType) noexcept
{
QDeadlineTimer result;
result.t1 = QDateTime::currentMSecsSinceEpoch() * 1000 * 1000;
diff --git a/src/corelib/kernel/qelapsedtimer_mac.cpp b/src/corelib/kernel/qelapsedtimer_mac.cpp
index 7490693991..5370cf7b3d 100644
--- a/src/corelib/kernel/qelapsedtimer_mac.cpp
+++ b/src/corelib/kernel/qelapsedtimer_mac.cpp
@@ -58,12 +58,12 @@ typedef __int128_t LargeInt;
typedef qint64 LargeInt;
#endif
-QElapsedTimer::ClockType QElapsedTimer::clockType() Q_DECL_NOTHROW
+QElapsedTimer::ClockType QElapsedTimer::clockType() noexcept
{
return MachAbsoluteTime;
}
-bool QElapsedTimer::isMonotonic() Q_DECL_NOTHROW
+bool QElapsedTimer::isMonotonic() noexcept
{
return true;
}
@@ -87,7 +87,7 @@ static qint64 absoluteToMSecs(qint64 cpuTime)
return absoluteToNSecs(cpuTime) / 1000000;
}
-timespec qt_gettime() Q_DECL_NOTHROW
+timespec qt_gettime() noexcept
{
timespec tv;
@@ -107,13 +107,13 @@ void qt_nanosleep(timespec amount)
EINTR_LOOP(r, nanosleep(&amount, &amount));
}
-void QElapsedTimer::start() Q_DECL_NOTHROW
+void QElapsedTimer::start() noexcept
{
t1 = mach_absolute_time();
t2 = 0;
}
-qint64 QElapsedTimer::restart() Q_DECL_NOTHROW
+qint64 QElapsedTimer::restart() noexcept
{
qint64 old = t1;
t1 = mach_absolute_time();
@@ -122,39 +122,39 @@ qint64 QElapsedTimer::restart() Q_DECL_NOTHROW
return absoluteToMSecs(t1 - old);
}
-qint64 QElapsedTimer::nsecsElapsed() const Q_DECL_NOTHROW
+qint64 QElapsedTimer::nsecsElapsed() const noexcept
{
uint64_t cpu_time = mach_absolute_time();
return absoluteToNSecs(cpu_time - t1);
}
-qint64 QElapsedTimer::elapsed() const Q_DECL_NOTHROW
+qint64 QElapsedTimer::elapsed() const noexcept
{
uint64_t cpu_time = mach_absolute_time();
return absoluteToMSecs(cpu_time - t1);
}
-qint64 QElapsedTimer::msecsSinceReference() const Q_DECL_NOTHROW
+qint64 QElapsedTimer::msecsSinceReference() const noexcept
{
return absoluteToMSecs(t1);
}
-qint64 QElapsedTimer::msecsTo(const QElapsedTimer &other) const Q_DECL_NOTHROW
+qint64 QElapsedTimer::msecsTo(const QElapsedTimer &other) const noexcept
{
return absoluteToMSecs(other.t1 - t1);
}
-qint64 QElapsedTimer::secsTo(const QElapsedTimer &other) const Q_DECL_NOTHROW
+qint64 QElapsedTimer::secsTo(const QElapsedTimer &other) const noexcept
{
return msecsTo(other) / 1000;
}
-bool operator<(const QElapsedTimer &v1, const QElapsedTimer &v2) Q_DECL_NOTHROW
+bool operator<(const QElapsedTimer &v1, const QElapsedTimer &v2) noexcept
{
return v1.t1 < v2.t1;
}
-QDeadlineTimer QDeadlineTimer::current(Qt::TimerType timerType) Q_DECL_NOTHROW
+QDeadlineTimer QDeadlineTimer::current(Qt::TimerType timerType) noexcept
{
Q_STATIC_ASSERT(!QDeadlineTimerNanosecondsInT2);
QDeadlineTimer result;
diff --git a/src/corelib/kernel/qelapsedtimer_unix.cpp b/src/corelib/kernel/qelapsedtimer_unix.cpp
index e166d4e3d2..ccc2eeafa3 100644
--- a/src/corelib/kernel/qelapsedtimer_unix.cpp
+++ b/src/corelib/kernel/qelapsedtimer_unix.cpp
@@ -150,12 +150,12 @@ static int unixCheckClockType()
#endif
}
-bool QElapsedTimer::isMonotonic() Q_DECL_NOTHROW
+bool QElapsedTimer::isMonotonic() noexcept
{
return clockType() == MonotonicClock;
}
-QElapsedTimer::ClockType QElapsedTimer::clockType() Q_DECL_NOTHROW
+QElapsedTimer::ClockType QElapsedTimer::clockType() noexcept
{
return unixCheckClockType() == CLOCK_REALTIME ? SystemTime : MonotonicClock;
}
@@ -169,7 +169,7 @@ static inline void do_gettime(qint64 *sec, qint64 *frac)
}
// used in qcore_unix.cpp and qeventdispatcher_unix.cpp
-struct timespec qt_gettime() Q_DECL_NOTHROW
+struct timespec qt_gettime() noexcept
{
qint64 sec, frac;
do_gettime(&sec, &frac);
@@ -204,17 +204,17 @@ static qint64 elapsedAndRestart(qint64 sec, qint64 frac,
return (sec * Q_INT64_C(1000000000) + frac) / Q_INT64_C(1000000);
}
-void QElapsedTimer::start() Q_DECL_NOTHROW
+void QElapsedTimer::start() noexcept
{
do_gettime(&t1, &t2);
}
-qint64 QElapsedTimer::restart() Q_DECL_NOTHROW
+qint64 QElapsedTimer::restart() noexcept
{
return elapsedAndRestart(t1, t2, &t1, &t2);
}
-qint64 QElapsedTimer::nsecsElapsed() const Q_DECL_NOTHROW
+qint64 QElapsedTimer::nsecsElapsed() const noexcept
{
qint64 sec, frac;
do_gettime(&sec, &frac);
@@ -223,34 +223,34 @@ qint64 QElapsedTimer::nsecsElapsed() const Q_DECL_NOTHROW
return sec * Q_INT64_C(1000000000) + frac;
}
-qint64 QElapsedTimer::elapsed() const Q_DECL_NOTHROW
+qint64 QElapsedTimer::elapsed() const noexcept
{
return nsecsElapsed() / Q_INT64_C(1000000);
}
-qint64 QElapsedTimer::msecsSinceReference() const Q_DECL_NOTHROW
+qint64 QElapsedTimer::msecsSinceReference() const noexcept
{
return t1 * Q_INT64_C(1000) + t2 / Q_INT64_C(1000000);
}
-qint64 QElapsedTimer::msecsTo(const QElapsedTimer &other) const Q_DECL_NOTHROW
+qint64 QElapsedTimer::msecsTo(const QElapsedTimer &other) const noexcept
{
qint64 secs = other.t1 - t1;
qint64 fraction = other.t2 - t2;
return (secs * Q_INT64_C(1000000000) + fraction) / Q_INT64_C(1000000);
}
-qint64 QElapsedTimer::secsTo(const QElapsedTimer &other) const Q_DECL_NOTHROW
+qint64 QElapsedTimer::secsTo(const QElapsedTimer &other) const noexcept
{
return other.t1 - t1;
}
-bool operator<(const QElapsedTimer &v1, const QElapsedTimer &v2) Q_DECL_NOTHROW
+bool operator<(const QElapsedTimer &v1, const QElapsedTimer &v2) noexcept
{
return v1.t1 < v2.t1 || (v1.t1 == v2.t1 && v1.t2 < v2.t2);
}
-QDeadlineTimer QDeadlineTimer::current(Qt::TimerType timerType) Q_DECL_NOTHROW
+QDeadlineTimer QDeadlineTimer::current(Qt::TimerType timerType) noexcept
{
Q_STATIC_ASSERT(QDeadlineTimerNanosecondsInT2);
QDeadlineTimer result;
diff --git a/src/corelib/kernel/qelapsedtimer_win.cpp b/src/corelib/kernel/qelapsedtimer_win.cpp
index a63290d2f8..d8a50a8277 100644
--- a/src/corelib/kernel/qelapsedtimer_win.cpp
+++ b/src/corelib/kernel/qelapsedtimer_win.cpp
@@ -110,25 +110,25 @@ quint64 qt_msectime()
return ticksToNanoseconds(getTickCount()) / 1000000;
}
-QElapsedTimer::ClockType QElapsedTimer::clockType() Q_DECL_NOTHROW
+QElapsedTimer::ClockType QElapsedTimer::clockType() noexcept
{
resolveCounterFrequency();
return counterFrequency > 0 ? PerformanceCounter : TickCounter;
}
-bool QElapsedTimer::isMonotonic() Q_DECL_NOTHROW
+bool QElapsedTimer::isMonotonic() noexcept
{
return true;
}
-void QElapsedTimer::start() Q_DECL_NOTHROW
+void QElapsedTimer::start() noexcept
{
t1 = getTickCount();
t2 = 0;
}
-qint64 QElapsedTimer::restart() Q_DECL_NOTHROW
+qint64 QElapsedTimer::restart() noexcept
{
qint64 oldt1 = t1;
t1 = getTickCount();
@@ -136,40 +136,40 @@ qint64 QElapsedTimer::restart() Q_DECL_NOTHROW
return ticksToNanoseconds(t1 - oldt1) / 1000000;
}
-qint64 QElapsedTimer::nsecsElapsed() const Q_DECL_NOTHROW
+qint64 QElapsedTimer::nsecsElapsed() const noexcept
{
qint64 elapsed = getTickCount() - t1;
return ticksToNanoseconds(elapsed);
}
-qint64 QElapsedTimer::elapsed() const Q_DECL_NOTHROW
+qint64 QElapsedTimer::elapsed() const noexcept
{
qint64 elapsed = getTickCount() - t1;
return ticksToNanoseconds(elapsed) / 1000000;
}
-qint64 QElapsedTimer::msecsSinceReference() const Q_DECL_NOTHROW
+qint64 QElapsedTimer::msecsSinceReference() const noexcept
{
return ticksToNanoseconds(t1) / 1000000;
}
-qint64 QElapsedTimer::msecsTo(const QElapsedTimer &other) const Q_DECL_NOTHROW
+qint64 QElapsedTimer::msecsTo(const QElapsedTimer &other) const noexcept
{
qint64 difference = other.t1 - t1;
return ticksToNanoseconds(difference) / 1000000;
}
-qint64 QElapsedTimer::secsTo(const QElapsedTimer &other) const Q_DECL_NOTHROW
+qint64 QElapsedTimer::secsTo(const QElapsedTimer &other) const noexcept
{
return msecsTo(other) / 1000;
}
-bool operator<(const QElapsedTimer &v1, const QElapsedTimer &v2) Q_DECL_NOTHROW
+bool operator<(const QElapsedTimer &v1, const QElapsedTimer &v2) noexcept
{
return (v1.t1 - v2.t1) < 0;
}
-QDeadlineTimer QDeadlineTimer::current(Qt::TimerType timerType) Q_DECL_NOTHROW
+QDeadlineTimer QDeadlineTimer::current(Qt::TimerType timerType) noexcept
{
Q_STATIC_ASSERT(!QDeadlineTimerNanosecondsInT2);
QDeadlineTimer result;
diff --git a/src/corelib/kernel/qeventdispatcher_unix_p.h b/src/corelib/kernel/qeventdispatcher_unix_p.h
index 8cfa4bbdf7..f37edfc967 100644
--- a/src/corelib/kernel/qeventdispatcher_unix_p.h
+++ b/src/corelib/kernel/qeventdispatcher_unix_p.h
@@ -64,10 +64,10 @@ class QEventDispatcherUNIXPrivate;
struct Q_CORE_EXPORT QSocketNotifierSetUNIX final
{
- inline QSocketNotifierSetUNIX() Q_DECL_NOTHROW;
+ inline QSocketNotifierSetUNIX() noexcept;
- inline bool isEmpty() const Q_DECL_NOTHROW;
- inline short events() const Q_DECL_NOTHROW;
+ inline bool isEmpty() const noexcept;
+ inline short events() const noexcept;
QSocketNotifier *notifiers[3];
};
@@ -150,19 +150,19 @@ public:
QAtomicInt interrupt; // bool
};
-inline QSocketNotifierSetUNIX::QSocketNotifierSetUNIX() Q_DECL_NOTHROW
+inline QSocketNotifierSetUNIX::QSocketNotifierSetUNIX() noexcept
{
notifiers[0] = nullptr;
notifiers[1] = nullptr;
notifiers[2] = nullptr;
}
-inline bool QSocketNotifierSetUNIX::isEmpty() const Q_DECL_NOTHROW
+inline bool QSocketNotifierSetUNIX::isEmpty() const noexcept
{
return !notifiers[0] && !notifiers[1] && !notifiers[2];
}
-inline short QSocketNotifierSetUNIX::events() const Q_DECL_NOTHROW
+inline short QSocketNotifierSetUNIX::events() const noexcept
{
short result = 0;
diff --git a/src/corelib/kernel/qfunctions_fake_env_p.h b/src/corelib/kernel/qfunctions_fake_env_p.h
index 7010d2cf5d..68d17ed4a1 100644
--- a/src/corelib/kernel/qfunctions_fake_env_p.h
+++ b/src/corelib/kernel/qfunctions_fake_env_p.h
@@ -72,8 +72,8 @@ Q_DECLARE_TYPEINFO(Variable, Q_MOVABLE_TYPE);
struct NameEquals {
typedef bool result_type;
const char *name;
- explicit NameEquals(const char *name) Q_DECL_NOTHROW : name(name) {}
- result_type operator()(const Variable &other) const Q_DECL_NOTHROW
+ explicit NameEquals(const char *name) noexcept : name(name) {}
+ result_type operator()(const Variable &other) const noexcept
{ return qstrcmp(other.name, name) == 0; }
};
diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp
index 8309bd22c2..3bcad8cf32 100644
--- a/src/corelib/kernel/qmetaobject.cpp
+++ b/src/corelib/kernel/qmetaobject.cpp
@@ -335,7 +335,7 @@ const char *QMetaObject::className() const
\since 5.7
*/
-bool QMetaObject::inherits(const QMetaObject *metaObject) const Q_DECL_NOEXCEPT
+bool QMetaObject::inherits(const QMetaObject *metaObject) const noexcept
{
const QMetaObject *m = this;
do {
@@ -349,7 +349,7 @@ bool QMetaObject::inherits(const QMetaObject *metaObject) const Q_DECL_NOEXCEPT
\internal
Returns \a obj if object \a obj inherits from this
- meta-object; otherwise returns 0.
+ meta-object; otherwise returns \nullptr.
*/
QObject *QMetaObject::cast(QObject *obj) const
{
@@ -361,7 +361,7 @@ QObject *QMetaObject::cast(QObject *obj) const
\internal
Returns \a obj if object \a obj inherits from this
- meta-object; otherwise returns 0.
+ meta-object; otherwise returns \nullptr.
*/
const QObject *QMetaObject::cast(const QObject *obj) const
{
diff --git a/src/corelib/kernel/qmetaobject_p.h b/src/corelib/kernel/qmetaobject_p.h
index 26d86fdf14..0cd9da2eac 100644
--- a/src/corelib/kernel/qmetaobject_p.h
+++ b/src/corelib/kernel/qmetaobject_p.h
@@ -232,7 +232,7 @@ struct QMetaObjectPrivate
const QMetaObject *smeta,
const QObject *receiver, int method_index, void **slot,
DisconnectType = DisconnectAll);
- static inline bool disconnectHelper(QObjectPrivate::Connection *c,
+ static inline bool disconnectHelper(QObjectPrivate::ConnectionData *connections, int signalIndex,
const QObject *receiver, int method_index, void **slot,
QBasicMutex *senderMutex, DisconnectType = DisconnectAll);
#endif
diff --git a/src/corelib/kernel/qmetatype.cpp b/src/corelib/kernel/qmetatype.cpp
index 45d0b5df6c..19bda7e8d6 100644
--- a/src/corelib/kernel/qmetatype.cpp
+++ b/src/corelib/kernel/qmetatype.cpp
@@ -915,7 +915,7 @@ template <int... TypeIds> struct MetaTypeOffsets<QtPrivate::IndexesList<TypeIds.
short offsets[sizeof...(TypeIds)];
constexpr MetaTypeOffsets() : offsets{calculateOffsetForTypeId(TypeIds)...} {}
- const char *operator[](int typeId) const Q_DECL_NOTHROW
+ const char *operator[](int typeId) const noexcept
{
short o = offsets[typeId];
return o < 0 ? nullptr : metaTypeStrings + o;
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index 268f3949fd..73b655cb36 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2019 The Qt Company Ltd.
** Copyright (C) 2016 Intel Corporation.
** Copyright (C) 2013 Olivier Goffart <ogoffart@woboq.com>
** Contact: https://www.qt.io/licensing/
@@ -265,13 +265,13 @@ bool QObjectPrivate::isSender(const QObject *receiver, const char *signal) const
if (signal_index < 0 || !cd)
return false;
QBasicMutexLocker locker(signalSlotLock(q));
- if (signal_index < cd->signalVector.count()) {
- const QObjectPrivate::Connection *c = cd->signalVector.at(signal_index).first;
+ if (signal_index < cd->signalVectorCount()) {
+ const QObjectPrivate::Connection *c = cd->signalVector.load()->at(signal_index).first.load();
while (c) {
- if (c->receiver == receiver)
+ if (c->receiver.load() == receiver)
return true;
- c = c->nextConnectionList;
+ c = c->nextConnectionList.load();
}
}
return false;
@@ -280,20 +280,19 @@ bool QObjectPrivate::isSender(const QObject *receiver, const char *signal) const
// Used by QAccessibleWidget
QObjectList QObjectPrivate::receiverList(const char *signal) const
{
- Q_Q(const QObject);
QObjectList returnValue;
int signal_index = signalIndex(signal);
ConnectionData *cd = connections.load();
if (signal_index < 0 || !cd)
return returnValue;
- QBasicMutexLocker locker(signalSlotLock(q));
- if (signal_index < cd->signalVector.count()) {
- const QObjectPrivate::Connection *c = cd->signalVector.at(signal_index).first;
+ if (signal_index < cd->signalVectorCount()) {
+ const QObjectPrivate::Connection *c = cd->signalVector.load()->at(signal_index).first.load();
while (c) {
- if (c->receiver)
- returnValue << c->receiver;
- c = c->nextConnectionList;
+ QObject *r = c->receiver.load();
+ if (r)
+ returnValue << r;
+ c = c->nextConnectionList.load();
}
}
return returnValue;
@@ -327,20 +326,20 @@ void QObjectPrivate::addConnection(int signal, Connection *c)
Q_ASSERT(c->sender == q_ptr);
ensureConnectionData();
ConnectionData *cd = connections.load();
- if (signal >= cd->signalVector.count())
- cd->signalVector.resize(signal + 1);
+ cd->resizeSignalVector(signal + 1);
ConnectionList &connectionList = cd->connectionsForSignal(signal);
- if (connectionList.last) {
- connectionList.last->nextConnectionList = c;
+ if (connectionList.last.load()) {
+ Q_ASSERT(connectionList.last.load()->receiver.load());
+ connectionList.last.load()->nextConnectionList.store(c);
} else {
- connectionList.first = c;
+ connectionList.first.store(c);
}
- connectionList.last = c;
+ c->id = ++cd->currentConnectionId;
+ c->prevConnectionList = connectionList.last.load();
+ connectionList.last.store(c);
- cleanConnectionLists();
-
- QObjectPrivate *rd = QObjectPrivate::get(c->receiver);
+ QObjectPrivate *rd = QObjectPrivate::get(c->receiver.load());
rd->ensureConnectionData();
c->prev = &(rd->connections.load()->senders);
@@ -350,39 +349,99 @@ void QObjectPrivate::addConnection(int signal, Connection *c)
c->next->prev = &c->next;
}
-void QObjectPrivate::cleanConnectionLists()
+void QObjectPrivate::ConnectionData::removeConnection(QObjectPrivate::Connection *c)
{
- ConnectionData *cd = connections.load();
- if (cd->dirty && cd->ref == 1) {
- // remove broken connections
- for (int signal = -1; signal < cd->signalVector.count(); ++signal) {
- ConnectionList &connectionList = cd->connectionsForSignal(signal);
-
- // Set to the last entry in the connection list that was *not*
- // deleted. This is needed to update the list's last pointer
- // at the end of the cleanup.
- QObjectPrivate::Connection *last = 0;
-
- QObjectPrivate::Connection **prev = &connectionList.first;
- QObjectPrivate::Connection *c = *prev;
- while (c) {
- if (c->receiver) {
- last = c;
- prev = &c->nextConnectionList;
- c = *prev;
- } else {
- QObjectPrivate::Connection *next = c->nextConnectionList;
- *prev = next;
- c->deref();
- c = next;
- }
- }
+ Q_ASSERT(c->receiver.load());
+ ConnectionList &connections = signalVector.load()->at(c->signal_index);
+ c->receiver.store(nullptr);
+ QThreadData *td = c->receiverThreadData.load();
+ if (td)
+ td->deref();
+ c->receiverThreadData.store(nullptr);
+
+#ifndef QT_NO_DEBUG
+ bool found = false;
+ for (Connection *cc = connections.first.load(); cc; cc = cc->nextConnectionList.load()) {
+ if (cc == c) {
+ found = true;
+ break;
+ }
+ }
+ Q_ASSERT(found);
+#endif
+
+ // remove from the senders linked list
+ *c->prev = c->next;
+ if (c->next)
+ c->next->prev = c->prev;
+ c->prev = nullptr;
+
+ if (connections.first.load() == c)
+ connections.first.store(c->nextConnectionList.load());
+ if (connections.last.load() == c)
+ connections.last.store(c->prevConnectionList);
+ Q_ASSERT(signalVector.load()->at(c->signal_index).first.load() != c);
+ Q_ASSERT(signalVector.load()->at(c->signal_index).last.load() != c);
+
+ // keep c->nextConnectionList intact, as it might still get accessed by activate
+ Connection *n = c->nextConnectionList.load();
+ if (n)
+ n->prevConnectionList = c->prevConnectionList;
+ if (c->prevConnectionList)
+ c->prevConnectionList->nextConnectionList.store(n);
+ c->prevConnectionList = nullptr;
+
+ Q_ASSERT(c != orphaned.load());
+ // add c to orphanedConnections
+ c->nextInOrphanList = orphaned.load();
+ orphaned.store(c);
+
+#ifndef QT_NO_DEBUG
+ found = false;
+ for (Connection *cc = connections.first.load(); cc; cc = cc->nextConnectionList.load()) {
+ if (cc == c) {
+ found = true;
+ break;
+ }
+ }
+ Q_ASSERT(!found);
+#endif
+
+}
+
+void QObjectPrivate::ConnectionData::cleanOrphanedConnectionsImpl(QObject *sender)
+{
+ ConnectionOrSignalVector *c = nullptr;
+ {
+ QBasicMutexLocker l(signalSlotLock(sender));
+ if (ref > 1)
+ return;
- // Correct the connection list's last pointer.
- // As conectionList.last could equal last, this could be a noop
- connectionList.last = last;
+ // Since ref == 1, no activate() is in process since we locked the mutex. That implies,
+ // that nothing can reference the orphaned connection objects anymore and they can
+ // be safely deleted
+ c = orphaned.load();
+ orphaned.store(nullptr);
+ }
+ deleteOrphaned(c);
+}
+
+void QObjectPrivate::ConnectionData::deleteOrphaned(QObjectPrivate::ConnectionOrSignalVector *o)
+{
+ while (o) {
+ QObjectPrivate::ConnectionOrSignalVector *next = nullptr;
+ if (SignalVector *v = ConnectionOrSignalVector::asSignalVector(o)) {
+ next = v->nextInOrphanList;
+ free(v);
+ } else {
+ QObjectPrivate::Connection *c = static_cast<Connection *>(o);
+ next = c->nextInOrphanList;
+ Q_ASSERT(!c->receiver.load());
+ Q_ASSERT(!c->prev);
+ c->freeSlotObject();
+ c->deref();
}
- cd->dirty = false;
+ o = next;
}
}
@@ -400,16 +459,19 @@ bool QObjectPrivate::isSignalConnected(uint signalIndex, bool checkDeclarative)
ConnectionData *cd = connections.load();
if (!cd)
return false;
+ SignalVector *signalVector = cd->signalVector.load();
+ if (!signalVector)
+ return false;
- if (cd->allsignals.first)
+ if (signalVector->at(-1).first.load())
return true;
- if (signalIndex < uint(cd->signalVector.count())) {
- const QObjectPrivate::Connection *c = cd->signalVector.at(signalIndex).first;
+ if (signalIndex < uint(cd->signalVectorCount())) {
+ const QObjectPrivate::Connection *c = signalVector->at(signalIndex).first.load();
while (c) {
- if (c->receiver)
+ if (c->receiver.load())
return true;
- c = c->nextConnectionList;
+ c = c->nextConnectionList.load();
}
}
return false;
@@ -420,17 +482,30 @@ bool QObjectPrivate::maybeSignalConnected(uint signalIndex) const
ConnectionData *cd = connections.load();
if (!cd)
return false;
+ SignalVector *signalVector = cd->signalVector.load();
+ if (!signalVector)
+ return false;
- if (cd->allsignals.first)
+ if (signalVector->at(-1).first)
return true;
- if (signalIndex < uint(cd->signalVector.count())) {
- const QObjectPrivate::Connection *c = cd->signalVector.at(signalIndex).first;
+ if (signalIndex < uint(cd->signalVectorCount())) {
+ const QObjectPrivate::Connection *c = signalVector->at(signalIndex).first;
return c != nullptr;
}
return false;
}
+/*!
+ \internal
+ */
+QAbstractMetaCallEvent::~QAbstractMetaCallEvent()
+{
+#if QT_CONFIG(thread)
+ if (semaphore_)
+ semaphore_->release();
+#endif
+}
/*!
\internal
@@ -438,8 +513,8 @@ bool QObjectPrivate::maybeSignalConnected(uint signalIndex) const
QMetaCallEvent::QMetaCallEvent(ushort method_offset, ushort method_relative, QObjectPrivate::StaticMetaCallFunction callFunction,
const QObject *sender, int signalId,
int nargs, int *types, void **args, QSemaphore *semaphore)
- : QEvent(MetaCall), slotObj_(0), sender_(sender), signalId_(signalId),
- nargs_(nargs), types_(types), args_(args), semaphore_(semaphore),
+ : QAbstractMetaCallEvent(sender, signalId, semaphore),
+ slotObj_(nullptr), nargs_(nargs), types_(types), args_(args),
callFunction_(callFunction), method_offset_(method_offset), method_relative_(method_relative)
{ }
@@ -448,9 +523,9 @@ QMetaCallEvent::QMetaCallEvent(ushort method_offset, ushort method_relative, QOb
*/
QMetaCallEvent::QMetaCallEvent(QtPrivate::QSlotObjectBase *slotO, const QObject *sender, int signalId,
int nargs, int *types, void **args, QSemaphore *semaphore)
- : QEvent(MetaCall), slotObj_(slotO), sender_(sender), signalId_(signalId),
- nargs_(nargs), types_(types), args_(args), semaphore_(semaphore),
- callFunction_(0), method_offset_(0), method_relative_(ushort(-1))
+ : QAbstractMetaCallEvent(sender, signalId, semaphore),
+ slotObj_(slotO), nargs_(nargs), types_(types), args_(args),
+ callFunction_(nullptr), method_offset_(0), method_relative_(ushort(-1))
{
if (slotObj_)
slotObj_->ref();
@@ -469,10 +544,6 @@ QMetaCallEvent::~QMetaCallEvent()
free(types_);
free(args_);
}
-#if QT_CONFIG(thread)
- if (semaphore_)
- semaphore_->release();
-#endif
if (slotObj_)
slotObj_->destroyIfLastRef();
}
@@ -900,52 +971,27 @@ QObject::~QObject()
QBasicMutexLocker locker(signalSlotMutex);
// disconnect all receivers
- int receiverCount = cd->signalVector.count();
+ int receiverCount = cd->signalVectorCount();
for (int signal = -1; signal < receiverCount; ++signal) {
QObjectPrivate::ConnectionList &connectionList = cd->connectionsForSignal(signal);
- while (QObjectPrivate::Connection *c = connectionList.first) {
- if (!c->receiver) {
- connectionList.first = c->nextConnectionList;
- c->deref();
- continue;
- }
+ while (QObjectPrivate::Connection *c = connectionList.first.load()) {
+ Q_ASSERT(c->receiver);
- QBasicMutex *m = signalSlotLock(c->receiver);
+ QBasicMutex *m = signalSlotLock(c->receiver.load());
bool needToUnlock = QOrderedMutexLocker::relock(signalSlotMutex, m);
-
if (c->receiver) {
- *c->prev = c->next;
- if (c->next) c->next->prev = c->prev;
+ cd->removeConnection(c);
+ Q_ASSERT(connectionList.first.load() != c);
}
- c->receiver = 0;
if (needToUnlock)
m->unlock();
-
- connectionList.first = c->nextConnectionList;
-
- // The destroy operation must happen outside the lock
- if (c->isSlotObject) {
- c->isSlotObject = false;
- locker.unlock();
- c->slotObj->destroyIfLastRef();
- locker.relock();
- }
- c->deref();
}
}
/* Disconnect all senders:
- * This loop basically just does
- * for (node = d->senders; node; node = node->next) { ... }
- *
- * We need to temporarily unlock the receiver mutex to destroy the functors or to lock the
- * sender's mutex. And when the mutex is released, node->next might be destroyed by another
- * thread. That's why we set node->prev to &node, that way, if node is destroyed, node will
- * be updated.
*/
- QObjectPrivate::Connection *node = cd->senders;
- while (node) {
+ while (QObjectPrivate::Connection *node = cd->senders) {
Q_ASSERT(node->receiver);
QObject *sender = node->sender;
// Send disconnectNotify before removing the connection from sender's connection list.
@@ -953,19 +999,17 @@ QObject::~QObject()
// and not finish until we release it.
sender->disconnectNotify(QMetaObjectPrivate::signal(sender->metaObject(), node->signal_index));
QBasicMutex *m = signalSlotLock(sender);
- node->prev = &node;
bool needToUnlock = QOrderedMutexLocker::relock(signalSlotMutex, m);
//the node has maybe been removed while the mutex was unlocked in relock?
- if (!node || node->sender != sender) {
+ if (node != cd->senders) {
// We hold the wrong mutex
Q_ASSERT(needToUnlock);
m->unlock();
continue;
}
- node->receiver = 0;
+
QObjectPrivate::ConnectionData *senderData = sender->d_func()->connections.load();
- if (senderData)
- senderData->dirty = true;
+ Q_ASSERT(senderData);
QtPrivate::QSlotObjectBase *slotObj = nullptr;
if (node->isSlotObject) {
@@ -973,20 +1017,20 @@ QObject::~QObject()
node->isSlotObject = false;
}
- node = node->next;
+ senderData->removeConnection(node);
if (needToUnlock)
m->unlock();
if (slotObj) {
- if (node)
- node->prev = &node;
locker.unlock();
slotObj->destroyIfLastRef();
locker.relock();
}
}
- cd->objectDeleted = true;
+ // invalidate all connections on the object and make sure
+ // activate() will skip them
+ cd->currentConnectionId.store(0);
}
if (cd && !cd->ref.deref())
delete cd;
@@ -1217,7 +1261,7 @@ bool QObject::event(QEvent *e)
case QEvent::MetaCall:
{
- QMetaCallEvent *mce = static_cast<QMetaCallEvent*>(e);
+ QAbstractMetaCallEvent *mce = static_cast<QAbstractMetaCallEvent*>(e);
if (!d_func()->connections.load()) {
QBasicMutexLocker locker(signalSlotLock(this));
@@ -1383,7 +1427,7 @@ bool QObject::eventFilter(QObject * /* watched */, QEvent * /* event */)
\sa signalsBlocked(), QSignalBlocker
*/
-bool QObject::blockSignals(bool block) Q_DECL_NOTHROW
+bool QObject::blockSignals(bool block) noexcept
{
Q_D(QObject);
bool previous = d->blockSig;
@@ -1478,6 +1522,9 @@ void QObject::moveToThread(QThread *targetThread)
if (!targetData)
targetData = new QThreadData(0);
+ // make sure nobody adds/removes connections to this object while we're moving it
+ QMutexLocker l(signalSlotLock(this));
+
QOrderedMutexLocker locker(&currentData->postEventList.mutex,
&targetData->postEventList.mutex);
@@ -1528,9 +1575,29 @@ void QObjectPrivate::setThreadData_helper(QThreadData *currentData, QThreadData
// the current emitting thread shouldn't restore currentSender after calling moveToThread()
ConnectionData *cd = connections.load();
- if (cd && cd->currentSender) {
- cd->currentSender->receiverDeleted();
- cd->currentSender = nullptr;
+ if (cd) {
+ if (cd->currentSender) {
+ cd->currentSender->receiverDeleted();
+ cd->currentSender = nullptr;
+ }
+
+ // adjust the receiverThreadId values in the Connections
+ if (cd) {
+ auto *c = cd->senders;
+ while (c) {
+ QObject *r = c->receiver.load();
+ if (r) {
+ Q_ASSERT(r == q);
+ targetData->ref();
+ QThreadData *old = c->receiverThreadData.load();
+ if (old)
+ old->deref();
+ c->receiverThreadData.store(targetData);
+ }
+ c = c->next;
+ }
+ }
+
}
// set new thread data
@@ -2316,7 +2383,7 @@ static void err_info_about_objects(const char * func,
/*!
Returns a pointer to the object that sent the signal, if called in
- a slot activated by a signal; otherwise it returns 0. The pointer
+ a slot activated by a signal; otherwise it returns \nullptr. The pointer
is valid only during the execution of the slot that calls this
function from this object's thread context.
@@ -2448,12 +2515,11 @@ int QObject::receivers(const char *signal) const
QObjectPrivate::ConnectionData *cd = d->connections.load();
QBasicMutexLocker locker(signalSlotLock(this));
- if (cd && signal_index < cd->signalVector.count()) {
- const QObjectPrivate::Connection *c =
- cd->signalVector.at(signal_index).first;
+ if (cd && signal_index < cd->signalVectorCount()) {
+ const QObjectPrivate::Connection *c = cd->signalVector.load()->at(signal_index).first.load();
while (c) {
- receivers += c->receiver ? 1 : 0;
- c = c->nextConnectionList;
+ receivers += c->receiver.load() ? 1 : 0;
+ c = c->nextConnectionList.load();
}
}
}
@@ -3264,15 +3330,15 @@ QObjectPrivate::Connection *QMetaObjectPrivate::connect(const QObject *sender,
QObjectPrivate::ConnectionData *scd = QObjectPrivate::get(s)->connections.load();
if (type & Qt::UniqueConnection && scd) {
- if (scd->signalVector.count() > signal_index) {
- const QObjectPrivate::Connection *c2 = scd->signalVector.at(signal_index).first;
+ if (scd->signalVectorCount() > signal_index) {
+ const QObjectPrivate::Connection *c2 = scd->signalVector.load()->at(signal_index).first.load();
int method_index_absolute = method_index + method_offset;
while (c2) {
- if (!c2->isSlotObject && c2->receiver == receiver && c2->method() == method_index_absolute)
+ if (!c2->isSlotObject && c2->receiver.load() == receiver && c2->method() == method_index_absolute)
return nullptr;
- c2 = c2->nextConnectionList;
+ c2 = c2->nextConnectionList.load();
}
}
type &= Qt::UniqueConnection - 1;
@@ -3281,13 +3347,15 @@ QObjectPrivate::Connection *QMetaObjectPrivate::connect(const QObject *sender,
QScopedPointer<QObjectPrivate::Connection> c(new QObjectPrivate::Connection);
c->sender = s;
c->signal_index = signal_index;
- c->receiver = r;
+ c->receiver.store(r);
+ QThreadData *td = r->d_func()->threadData;
+ td->ref();
+ c->receiverThreadData.store(td);
c->method_relative = method_index;
c->method_offset = method_offset;
c->connectionType = type;
c->isSlotObject = false;
c->argumentTypes.store(types);
- c->nextConnectionList = 0;
c->callFunction = callFunction;
QObjectPrivate::get(s)->addConnection(signal_index, c.data());
@@ -3333,47 +3401,38 @@ bool QMetaObject::disconnectOne(const QObject *sender, int signal_index,
\internal
Helper function to remove the connection from the senders list and setting the receivers to 0
*/
-bool QMetaObjectPrivate::disconnectHelper(QObjectPrivate::Connection *c,
+bool QMetaObjectPrivate::disconnectHelper(QObjectPrivate::ConnectionData *connections, int signalIndex,
const QObject *receiver, int method_index, void **slot,
QBasicMutex *senderMutex, DisconnectType disconnectType)
{
bool success = false;
+
+ auto &connectionList = connections->connectionsForSignal(signalIndex);
+ auto *c = connectionList.first.load();
while (c) {
- if (c->receiver
- && (receiver == 0 || (c->receiver == receiver
+ QObject *r = c->receiver.load();
+ if (r && (receiver == nullptr || (r == receiver
&& (method_index < 0 || (!c->isSlotObject && c->method() == method_index))
- && (slot == 0 || (c->isSlotObject && c->slotObj->compare(slot)))))) {
+ && (slot == nullptr || (c->isSlotObject && c->slotObj->compare(slot)))))) {
bool needToUnlock = false;
QBasicMutex *receiverMutex = nullptr;
- if (c->receiver) {
- receiverMutex = signalSlotLock(c->receiver);
+ if (r) {
+ receiverMutex = signalSlotLock(r);
// need to relock this receiver and sender in the correct order
needToUnlock = QOrderedMutexLocker::relock(senderMutex, receiverMutex);
}
- if (c->receiver) {
- *c->prev = c->next;
- if (c->next)
- c->next->prev = c->prev;
- }
+ if (c->receiver.load())
+ connections->removeConnection(c);
if (needToUnlock)
receiverMutex->unlock();
- c->receiver = 0;
-
- if (c->isSlotObject) {
- c->isSlotObject = false;
- senderMutex->unlock();
- c->slotObj->destroyIfLastRef();
- senderMutex->lock();
- }
-
success = true;
if (disconnectType == DisconnectOne)
return success;
}
- c = c->nextConnectionList;
+ c = c->nextConnectionList.load();
}
return success;
}
@@ -3406,24 +3465,20 @@ bool QMetaObjectPrivate::disconnect(const QObject *sender,
if (signal_index < 0) {
// remove from all connection lists
- for (int sig_index = -1; sig_index < scd->signalVector.count(); ++sig_index) {
- QObjectPrivate::Connection *c = scd->connectionsForSignal(sig_index).first;
- if (disconnectHelper(c, receiver, method_index, slot, senderMutex, disconnectType)) {
+ for (int sig_index = -1; sig_index < scd->signalVectorCount(); ++sig_index) {
+ if (disconnectHelper(connections.data(), sig_index, receiver, method_index, slot, senderMutex, disconnectType))
success = true;
- scd->dirty = true;
- }
}
- } else if (signal_index < scd->signalVector.count()) {
- QObjectPrivate::Connection *c = scd->signalVector.at(signal_index).first;
- if (disconnectHelper(c, receiver, method_index, slot, senderMutex, disconnectType)) {
+ } else if (signal_index < scd->signalVectorCount()) {
+ if (disconnectHelper(connections.data(), signal_index, receiver, method_index, slot, senderMutex, disconnectType))
success = true;
- scd->dirty = true;
- }
}
}
locker.unlock();
if (success) {
+ scd->cleanOrphanedConnections(s);
+
QMetaMethod smethod = QMetaObjectPrivate::signal(smeta, signal_index);
if (smethod.isValid())
s->disconnectNotify(smethod);
@@ -3539,8 +3594,7 @@ void QMetaObject::connectSlotsByName(QObject *o)
\a signal must be in the signal index range (see QObjectPrivate::signalIndex()).
*/
-static void queued_activate(QObject *sender, int signal, QObjectPrivate::Connection *c, void **argv,
- QBasicMutexLocker &locker)
+static void queued_activate(QObject *sender, int signal, QObjectPrivate::Connection *c, void **argv)
{
const int *argumentTypes = c->argumentTypes.load();
if (!argumentTypes) {
@@ -3570,27 +3624,25 @@ static void queued_activate(QObject *sender, int signal, QObjectPrivate::Connect
for (int n = 1; n < nargs; ++n)
types[n] = argumentTypes[n-1];
- locker.unlock();
for (int n = 1; n < nargs; ++n)
args[n] = QMetaType::create(types[n], argv[n]);
- locker.relock();
-
- if (!c->receiver) {
- locker.unlock();
- // we have been disconnected while the mutex was unlocked
- for (int n = 1; n < nargs; ++n)
- QMetaType::destroy(types[n], args[n]);
- free(types);
- free(args);
- locker.relock();
- return;
- }
+ }
+
+ QBasicMutexLocker locker(signalSlotLock(c->receiver.load()));
+ if (!c->receiver.load()) {
+ // the connection has been disconnected before we got the lock
+ locker.unlock();
+ for (int n = 1; n < nargs; ++n)
+ QMetaType::destroy(types[n], args[n]);
+ free(types);
+ free(args);
+ return;
}
QMetaCallEvent *ev = c->isSlotObject ?
new QMetaCallEvent(c->slotObj, sender, signal, nargs, types, args) :
new QMetaCallEvent(c->method_offset, c->method_relative, c->callFunction, sender, signal, nargs, types, args);
- QCoreApplication::postEvent(c->receiver, ev);
+ QCoreApplication::postEvent(c->receiver.load(), ev);
}
template <bool callbacks_enabled>
@@ -3630,38 +3682,53 @@ void doActivate(QObject *sender, int signal_index, void **argv)
signal_spy_set->signal_begin_callback(sender, signal_index, argv);
Q_TRACE(QMetaObject_activate_begin_signal, sender, signal_index);
+ bool senderDeleted = false;
{
- QBasicMutexLocker locker(signalSlotLock(sender));
Q_ASSERT(sp->connections);
QObjectPrivate::ConnectionDataPointer connections(sp->connections.load());
+ QObjectPrivate::SignalVector *signalVector = connections->signalVector.load();
const QObjectPrivate::ConnectionList *list;
- if (signal_index < connections->signalVector.count())
- list = &connections->signalVector.at(signal_index);
+ if (signal_index < signalVector->count())
+ list = &signalVector->at(signal_index);
else
- list = &connections->allsignals;
+ list = &signalVector->at(-1);
Qt::HANDLE currentThreadId = QThread::currentThreadId();
+ bool inSenderThread = currentThreadId == QObjectPrivate::get(sender)->threadData->threadId.load();
+ // We need to check against the highest connection id to ensure that signals added
+ // during the signal emission are not emitted in this emission.
+ uint highestConnectionId = connections->currentConnectionId.load();
do {
- QObjectPrivate::Connection *c = list->first;
- if (!c) continue;
- // We need to check against last here to ensure that signals added
- // during the signal emission are not emitted in this emission.
- QObjectPrivate::Connection *last = list->last;
+ QObjectPrivate::Connection *c = list->first.load();
+ if (!c)
+ continue;
do {
- if (!c->receiver)
+ QObject * const receiver = c->receiver.load();
+ if (!receiver)
+ continue;
+
+ QThreadData *td = c->receiverThreadData.load();
+ if (!td)
continue;
- QObject * const receiver = c->receiver;
- const bool receiverInSameThread = currentThreadId == QObjectPrivate::get(receiver)->threadData->threadId.load();
+ bool receiverInSameThread;
+ if (inSenderThread) {
+ receiverInSameThread = currentThreadId == td->threadId.load();
+ } else {
+ // need to lock before reading the threadId, because moveToThread() could interfere
+ QMutexLocker lock(signalSlotLock(receiver));
+ receiverInSameThread = currentThreadId == td->threadId.load();
+ }
+
// determine if this connection should be sent immediately or
// put into the event queue
if ((c->connectionType == Qt::AutoConnection && !receiverInSameThread)
|| (c->connectionType == Qt::QueuedConnection)) {
- queued_activate(sender, signal_index, c, argv, locker);
+ queued_activate(sender, signal_index, c, argv);
continue;
#if QT_CONFIG(thread)
} else if (c->connectionType == Qt::BlockingQueuedConnection) {
@@ -3672,13 +3739,16 @@ void doActivate(QObject *sender, int signal_index, void **argv)
receiver->metaObject()->className(), receiver);
}
QSemaphore semaphore;
- QMetaCallEvent *ev = c->isSlotObject ?
- new QMetaCallEvent(c->slotObj, sender, signal_index, 0, 0, argv, &semaphore) :
- new QMetaCallEvent(c->method_offset, c->method_relative, c->callFunction, sender, signal_index, 0, 0, argv, &semaphore);
- QCoreApplication::postEvent(receiver, ev);
- locker.unlock();
+ {
+ QBasicMutexLocker locker(signalSlotLock(sender));
+ if (!c->receiver)
+ continue;
+ QMetaCallEvent *ev = c->isSlotObject ?
+ new QMetaCallEvent(c->slotObj, sender, signal_index, 0, 0, argv, &semaphore) :
+ new QMetaCallEvent(c->method_offset, c->method_relative, c->callFunction, sender, signal_index, 0, 0, argv, &semaphore);
+ QCoreApplication::postEvent(receiver, ev);
+ }
semaphore.acquire();
- locker.relock();
continue;
#endif
}
@@ -3688,22 +3758,13 @@ void doActivate(QObject *sender, int signal_index, void **argv)
if (c->isSlotObject) {
c->slotObj->ref();
QScopedPointer<QtPrivate::QSlotObjectBase, QSlotObjectBaseDeleter> obj(c->slotObj);
- locker.unlock();
Q_TRACE(QMetaObject_activate_begin_slot_functor, obj.data());
obj->call(receiver, argv);
Q_TRACE(QMetaObject_activate_end_slot_functor, obj.data());
-
- // Make sure the slot object gets destroyed before the mutex is locked again, as the
- // destructor of the slot object might also lock a mutex from the signalSlotLock() mutex pool,
- // and that would deadlock if the pool happens to return the same mutex.
- obj.reset();
-
- locker.relock();
} else if (c->callFunction && c->method_offset <= receiver->metaObject()->methodOffset()) {
//we compare the vtable to make sure we are not in the destructor of the object.
const int method_relative = c->method_relative;
const auto callFunction = c->callFunction;
- locker.unlock();
const int methodIndex = (Q_HAS_TRACEPOINTS || callbacks_enabled) ? c->method() : 0;
if (callbacks_enabled && signal_spy_set->slot_begin_callback != nullptr)
signal_spy_set->slot_begin_callback(receiver, methodIndex, argv);
@@ -3714,10 +3775,8 @@ void doActivate(QObject *sender, int signal_index, void **argv)
Q_TRACE(QMetaObject_activate_end_slot, receiver, methodIndex);
if (callbacks_enabled && signal_spy_set->slot_end_callback != nullptr)
signal_spy_set->slot_end_callback(receiver, methodIndex);
- locker.relock();
} else {
const int method = c->method_relative + c->method_offset;
- locker.unlock();
if (callbacks_enabled && signal_spy_set->slot_begin_callback != nullptr) {
signal_spy_set->slot_begin_callback(receiver, method, argv);
@@ -3729,21 +3788,18 @@ void doActivate(QObject *sender, int signal_index, void **argv)
Q_TRACE(QMetaObject_activate_end_slot, receiver, method);
if (callbacks_enabled && signal_spy_set->slot_end_callback != nullptr)
signal_spy_set->slot_end_callback(receiver, method);
-
- locker.relock();
}
+ } while ((c = c->nextConnectionList.load()) != nullptr && c->id <= highestConnectionId);
- if (connections->objectDeleted)
- break;
- } while (c != last && (c = c->nextConnectionList) != 0);
-
- if (connections->objectDeleted)
- break;
- } while (list != &connections->allsignals &&
+ } while (list != &signalVector->at(-1) &&
//start over for all signals;
- ((list = &connections->allsignals), true));
+ ((list = &signalVector->at(-1)), true));
+ if (connections->currentConnectionId.load() == 0)
+ senderDeleted = true;
}
+ if (!senderDeleted)
+ sp->connections.load()->cleanOrphanedConnections(sender);
if (callbacks_enabled && signal_spy_set->signal_end_callback != nullptr)
signal_spy_set->signal_end_callback(sender, signal_index);
@@ -4038,31 +4094,34 @@ void QObject::dumpObjectInfo() const
qDebug(" SIGNALS OUT");
QObjectPrivate::ConnectionData *cd = d->connections.load();
- if (cd && cd->signalVector.count()) {
- for (int signal_index = 0; signal_index < cd->signalVector.count(); ++signal_index) {
+ if (cd && cd->signalVectorCount()) {
+ QObjectPrivate::SignalVector *signalVector = cd->signalVector.load();
+ for (int signal_index = 0; signal_index < signalVector->count(); ++signal_index) {
+ const QObjectPrivate::Connection *c = signalVector->at(signal_index).first.load();
+ if (!c)
+ continue;
const QMetaMethod signal = QMetaObjectPrivate::signal(metaObject(), signal_index);
qDebug(" signal: %s", signal.methodSignature().constData());
// receivers
- const QObjectPrivate::Connection *c = cd->signalVector.at(signal_index).first;
while (c) {
- if (!c->receiver) {
+ if (!c->receiver.load()) {
qDebug(" <Disconnected receiver>");
- c = c->nextConnectionList;
+ c = c->nextConnectionList.load();
continue;
}
if (c->isSlotObject) {
qDebug(" <functor or function pointer>");
- c = c->nextConnectionList;
+ c = c->nextConnectionList.load();
continue;
}
- const QMetaObject *receiverMetaObject = c->receiver->metaObject();
+ const QMetaObject *receiverMetaObject = c->receiver.load()->metaObject();
const QMetaMethod method = receiverMetaObject->method(c->method());
qDebug(" --> %s::%s %s",
receiverMetaObject->className(),
- c->receiver->objectName().isEmpty() ? "unnamed" : qPrintable(c->receiver->objectName()),
+ c->receiver.load()->objectName().isEmpty() ? "unnamed" : qPrintable(c->receiver.load()->objectName()),
method.methodSignature().constData());
- c = c->nextConnectionList;
+ c = c->nextConnectionList.load();
}
}
} else {
@@ -4810,15 +4869,15 @@ QMetaObject::Connection QObjectPrivate::connectImpl(const QObject *sender, int s
if (type & Qt::UniqueConnection && slot && QObjectPrivate::get(s)->connections.load()) {
QObjectPrivate::ConnectionData *connections = QObjectPrivate::get(s)->connections.load();
- if (connections->signalVector.count() > signal_index) {
- const QObjectPrivate::Connection *c2 = connections->signalVector.at(signal_index).first;
+ if (connections->signalVectorCount() > signal_index) {
+ const QObjectPrivate::Connection *c2 = connections->signalVector.load()->at(signal_index).first.load();
while (c2) {
- if (c2->receiver == receiver && c2->isSlotObject && c2->slotObj->compare(slot)) {
+ if (c2->receiver.load() == receiver && c2->isSlotObject && c2->slotObj->compare(slot)) {
slotObj->destroyIfLastRef();
return QMetaObject::Connection();
}
- c2 = c2->nextConnectionList;
+ c2 = c2->nextConnectionList.load();
}
}
type = static_cast<Qt::ConnectionType>(type ^ Qt::UniqueConnection);
@@ -4827,7 +4886,10 @@ QMetaObject::Connection QObjectPrivate::connectImpl(const QObject *sender, int s
QScopedPointer<QObjectPrivate::Connection> c(new QObjectPrivate::Connection);
c->sender = s;
c->signal_index = signal_index;
- c->receiver = r;
+ QThreadData *td = r->d_func()->threadData;
+ td->ref();
+ c->receiverThreadData.store(td);
+ c->receiver.store(r);
c->slotObj = slotObj;
c->connectionType = type;
c->isSlotObject = true;
@@ -4859,30 +4921,30 @@ bool QObject::disconnect(const QMetaObject::Connection &connection)
{
QObjectPrivate::Connection *c = static_cast<QObjectPrivate::Connection *>(connection.d_ptr);
- if (!c || !c->receiver)
+ if (!c)
+ return false;
+ QObject *receiver = c->receiver.load();
+ if (!receiver)
return false;
QBasicMutex *senderMutex = signalSlotLock(c->sender);
- QBasicMutex *receiverMutex = signalSlotLock(c->receiver);
+ QBasicMutex *receiverMutex = signalSlotLock(receiver);
+ QObjectPrivate::ConnectionData *connections;
{
QOrderedMutexLocker locker(senderMutex, receiverMutex);
- QObjectPrivate::ConnectionData *connections = QObjectPrivate::get(c->sender)->connections.load();
- Q_ASSERT(connections);
- connections->dirty = true;
+ // load receiver once again and recheck to ensure nobody else has removed the connection in the meantime
+ receiver = c->receiver.load();
+ if (!receiver)
+ return false;
- *c->prev = c->next;
- if (c->next)
- c->next->prev = c->prev;
- c->receiver = nullptr;
+ connections = QObjectPrivate::get(c->sender)->connections.load();
+ Q_ASSERT(connections);
+ connections->removeConnection(c);
}
- // destroy the QSlotObject, if possible
- if (c->isSlotObject) {
- c->slotObj->destroyIfLastRef();
- c->isSlotObject = false;
- }
+ connections->cleanOrphanedConnections(c->sender);
c->sender->disconnectNotify(QMetaObjectPrivate::signal(c->sender->metaObject(),
c->signal_index));
@@ -5069,7 +5131,7 @@ bool QMetaObject::Connection::isConnected_helper() const
Q_ASSERT(d_ptr); // we're only called from operator RestrictedBool() const
QObjectPrivate::Connection *c = static_cast<QObjectPrivate::Connection *>(d_ptr);
- return c->receiver;
+ return c->receiver.load();
}
diff --git a/src/corelib/kernel/qobject.h b/src/corelib/kernel/qobject.h
index 63c5a9ad73..6d7b9521c2 100644
--- a/src/corelib/kernel/qobject.h
+++ b/src/corelib/kernel/qobject.h
@@ -142,8 +142,8 @@ public:
inline bool isWidgetType() const { return d_ptr->isWidget; }
inline bool isWindowType() const { return d_ptr->isWindow; }
- inline bool signalsBlocked() const Q_DECL_NOTHROW { return d_ptr->blockSig; }
- bool blockSignals(bool b) Q_DECL_NOTHROW;
+ inline bool signalsBlocked() const noexcept { return d_ptr->blockSig; }
+ bool blockSignals(bool b) noexcept;
QThread *thread() const;
void moveToThread(QThread *thread);
@@ -436,7 +436,7 @@ protected:
QScopedPointer<QObjectData> d_ptr;
static const QMetaObject staticQtMetaObject;
- friend inline const QMetaObject *qt_getQtMetaObject() Q_DECL_NOEXCEPT;
+ friend inline const QMetaObject *qt_getQtMetaObject() noexcept;
friend struct QMetaObject;
friend struct QMetaObjectPrivate;
@@ -467,7 +467,7 @@ inline QMetaObject::Connection QObject::connect(const QObject *asender, const ch
const char *amember, Qt::ConnectionType atype) const
{ return connect(asender, asignal, this, amember, atype); }
-inline const QMetaObject *qt_getQtMetaObject() Q_DECL_NOEXCEPT
+inline const QMetaObject *qt_getQtMetaObject() noexcept
{ return &QObject::staticQtMetaObject; }
#ifndef QT_NO_USERDATA
@@ -540,17 +540,17 @@ Q_CORE_EXPORT QDebug operator<<(QDebug, const QObject *);
class QSignalBlocker
{
public:
- inline explicit QSignalBlocker(QObject *o) Q_DECL_NOTHROW;
- inline explicit QSignalBlocker(QObject &o) Q_DECL_NOTHROW;
+ inline explicit QSignalBlocker(QObject *o) noexcept;
+ inline explicit QSignalBlocker(QObject &o) noexcept;
inline ~QSignalBlocker();
#ifdef Q_COMPILER_RVALUE_REFS
- inline QSignalBlocker(QSignalBlocker &&other) Q_DECL_NOTHROW;
- inline QSignalBlocker &operator=(QSignalBlocker &&other) Q_DECL_NOTHROW;
+ inline QSignalBlocker(QSignalBlocker &&other) noexcept;
+ inline QSignalBlocker &operator=(QSignalBlocker &&other) noexcept;
#endif
- inline void reblock() Q_DECL_NOTHROW;
- inline void unblock() Q_DECL_NOTHROW;
+ inline void reblock() noexcept;
+ inline void unblock() noexcept;
private:
Q_DISABLE_COPY(QSignalBlocker)
QObject * m_o;
@@ -558,20 +558,20 @@ private:
bool m_inhibited;
};
-QSignalBlocker::QSignalBlocker(QObject *o) Q_DECL_NOTHROW
+QSignalBlocker::QSignalBlocker(QObject *o) noexcept
: m_o(o),
m_blocked(o && o->blockSignals(true)),
m_inhibited(false)
{}
-QSignalBlocker::QSignalBlocker(QObject &o) Q_DECL_NOTHROW
+QSignalBlocker::QSignalBlocker(QObject &o) noexcept
: m_o(&o),
m_blocked(o.blockSignals(true)),
m_inhibited(false)
{}
#ifdef Q_COMPILER_RVALUE_REFS
-QSignalBlocker::QSignalBlocker(QSignalBlocker &&other) Q_DECL_NOTHROW
+QSignalBlocker::QSignalBlocker(QSignalBlocker &&other) noexcept
: m_o(other.m_o),
m_blocked(other.m_blocked),
m_inhibited(other.m_inhibited)
@@ -579,7 +579,7 @@ QSignalBlocker::QSignalBlocker(QSignalBlocker &&other) Q_DECL_NOTHROW
other.m_o = nullptr;
}
-QSignalBlocker &QSignalBlocker::operator=(QSignalBlocker &&other) Q_DECL_NOTHROW
+QSignalBlocker &QSignalBlocker::operator=(QSignalBlocker &&other) noexcept
{
if (this != &other) {
// if both *this and other block the same object's signals:
@@ -602,13 +602,13 @@ QSignalBlocker::~QSignalBlocker()
m_o->blockSignals(m_blocked);
}
-void QSignalBlocker::reblock() Q_DECL_NOTHROW
+void QSignalBlocker::reblock() noexcept
{
if (m_o) m_o->blockSignals(true);
m_inhibited = false;
}
-void QSignalBlocker::unblock() Q_DECL_NOTHROW
+void QSignalBlocker::unblock() noexcept
{
if (m_o) m_o->blockSignals(m_blocked);
m_inhibited = true;
diff --git a/src/corelib/kernel/qobject_p.h b/src/corelib/kernel/qobject_p.h
index 863689fddd..2fb11ecc64 100644
--- a/src/corelib/kernel/qobject_p.h
+++ b/src/corelib/kernel/qobject_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2017 The Qt Company Ltd.
+** Copyright (C) 2019 The Qt Company Ltd.
** Copyright (C) 2013 Olivier Goffart <ogoffart@woboq.com>
** Contact: https://www.qt.io/licensing/
**
@@ -124,45 +124,76 @@ public:
};
typedef void (*StaticMetaCallFunction)(QObject *, QMetaObject::Call, int, void **);
- struct Connection
+ struct Connection;
+ struct SignalVector;
+
+ struct ConnectionOrSignalVector {
+ union {
+ // linked list of orphaned connections that need cleaning up
+ ConnectionOrSignalVector *nextInOrphanList;
+ // linked list of connections connected to slots in this object
+ Connection *next;
+ };
+
+ static SignalVector *asSignalVector(ConnectionOrSignalVector *c) {
+ if (reinterpret_cast<quintptr>(c) & 1)
+ return reinterpret_cast<SignalVector *>(reinterpret_cast<quintptr>(c) & ~quintptr(1u));
+ return nullptr;
+ }
+ static Connection *fromSignalVector(SignalVector *v) {
+ return reinterpret_cast<Connection *>(reinterpret_cast<quintptr>(v) | quintptr(1u));
+ }
+ };
+
+ struct Connection : public ConnectionOrSignalVector
{
+ // linked list of connections connected to slots in this object, next is in base class
+ Connection **prev;
+ // linked list of connections connected to signals in this object
+ QAtomicPointer<Connection> nextConnectionList;
+ Connection *prevConnectionList;
+
QObject *sender;
- QObject *receiver;
+ QAtomicPointer<QObject> receiver;
+ QAtomicPointer<QThreadData> receiverThreadData;
union {
StaticMetaCallFunction callFunction;
QtPrivate::QSlotObjectBase *slotObj;
};
- // The next pointer for the singly-linked ConnectionList
- Connection *nextConnectionList;
- //senders linked list
- Connection *next;
- Connection **prev;
QAtomicPointer<const int> argumentTypes;
QAtomicInt ref_;
+ uint id = 0;
ushort method_offset;
ushort method_relative;
- uint signal_index : 27; // In signal range (see QObjectPrivate::signalIndex())
+ int signal_index : 27; // In signal range (see QObjectPrivate::signalIndex())
ushort connectionType : 3; // 0 == auto, 1 == direct, 2 == queued, 4 == blocking
ushort isSlotObject : 1;
ushort ownArgumentTypes : 1;
- Connection() : nextConnectionList(nullptr), ref_(2), ownArgumentTypes(true) {
+ Connection() : ref_(2), ownArgumentTypes(true) {
//ref_ is 2 for the use in the internal lists, and for the use in QMetaObject::Connection
}
~Connection();
int method() const { Q_ASSERT(!isSlotObject); return method_offset + method_relative; }
void ref() { ref_.ref(); }
+ void freeSlotObject()
+ {
+ if (isSlotObject) {
+ slotObj->destroyIfLastRef();
+ isSlotObject = false;
+ }
+ }
void deref() {
if (!ref_.deref()) {
- Q_ASSERT(!receiver);
+ Q_ASSERT(!receiver.load());
+ Q_ASSERT(!isSlotObject);
delete this;
}
}
};
// ConnectionList is a singly-linked list
struct ConnectionList {
- ConnectionList() : first(nullptr), last(nullptr) {}
- Connection *first;
- Connection *last;
+ QAtomicPointer<Connection> first;
+ QAtomicPointer<Connection> last;
};
struct Sender
@@ -195,6 +226,22 @@ public:
int signal;
};
+ struct SignalVector : public ConnectionOrSignalVector {
+ quintptr allocated;
+ // ConnectionList signals[]
+ ConnectionList &at(int i)
+ {
+ return reinterpret_cast<ConnectionList *>(this + 1)[i + 1];
+ }
+ const ConnectionList &at(int i) const
+ {
+ return reinterpret_cast<const ConnectionList *>(this + 1)[i + 1];
+ }
+ int count() { return static_cast<int>(allocated); }
+ };
+
+
+
/*
This contains the all connections from and to an object.
@@ -210,25 +257,65 @@ public:
linked list.
*/
struct ConnectionData {
- bool objectDeleted = false; //the QObject owner of this vector has been destroyed while the vector was inUse
- struct Ref {
- int _ref = 0;
- void ref() { ++_ref; }
- int deref() { return --_ref; }
- operator int() const { return _ref; }
- };
-
- Ref ref;
- bool dirty = false; //some Connection have been disconnected (their receiver is 0) but not removed from the list yet
- ConnectionList allsignals;
- QVector<ConnectionList> signalVector;
+ // the id below is used to avoid activating new connections. When the object gets
+ // deleted it's set to 0, so that signal emission stops
+ QAtomicInteger<uint> currentConnectionId;
+ QAtomicInt ref;
+ QAtomicPointer<SignalVector> signalVector;
Connection *senders = nullptr;
Sender *currentSender = nullptr; // object currently activating the object
+ QAtomicPointer<Connection> orphaned;
+
+ ~ConnectionData()
+ {
+ deleteOrphaned(orphaned.load());
+ SignalVector *v = signalVector.load();
+ if (v)
+ free(v);
+ }
+
+ // must be called on the senders connection data
+ // assumes the senders and receivers lock are held
+ void removeConnection(Connection *c);
+ void cleanOrphanedConnections(QObject *sender)
+ {
+ if (orphaned.load() && ref == 1)
+ cleanOrphanedConnectionsImpl(sender);
+ }
+ void cleanOrphanedConnectionsImpl(QObject *sender);
ConnectionList &connectionsForSignal(int signal)
{
- return signal < 0 ? allsignals : signalVector[signal];
+ return signalVector.load()->at(signal);
+ }
+
+ void resizeSignalVector(uint size) {
+ SignalVector *vector = this->signalVector.load();
+ if (vector && vector->allocated > size)
+ return;
+ size = (size + 7) & ~7;
+ SignalVector *newVector = reinterpret_cast<SignalVector *>(malloc(sizeof(SignalVector) + (size + 1) * sizeof(ConnectionList)));
+ int start = -1;
+ if (vector) {
+ memcpy(newVector, vector, sizeof(SignalVector) + (vector->allocated + 1) * sizeof(ConnectionList));
+ start = vector->count();
+ }
+ for (int i = start; i < int(size); ++i)
+ newVector->at(i) = ConnectionList();
+ newVector->next = nullptr;
+ newVector->allocated = size;
+
+ signalVector.store(newVector);
+ if (vector) {
+ vector->nextInOrphanList = orphaned.load();
+ orphaned.store(ConnectionOrSignalVector::fromSignalVector(vector));
+ }
}
+ int signalVectorCount() const {
+ return signalVector ? signalVector.load()->count() : -1;
+ }
+
+ static void deleteOrphaned(ConnectionOrSignalVector *c);
};
QObjectPrivate(int version = QObjectPrivateVersion);
@@ -245,7 +332,6 @@ public:
QObjectList senderList() const;
void addConnection(int signal, Connection *c);
- void cleanConnectionLists();
static QObjectPrivate *get(QObject *o) {
return o->d_func();
@@ -396,7 +482,26 @@ Q_DECLARE_TYPEINFO(QObjectPrivate::Connection, Q_MOVABLE_TYPE);
Q_DECLARE_TYPEINFO(QObjectPrivate::Sender, Q_MOVABLE_TYPE);
class QSemaphore;
-class Q_CORE_EXPORT QMetaCallEvent : public QEvent
+class Q_CORE_EXPORT QAbstractMetaCallEvent : public QEvent
+{
+public:
+ QAbstractMetaCallEvent(const QObject *sender, int signalId, QSemaphore *semaphore = nullptr)
+ : QEvent(MetaCall), signalId_(signalId), sender_(sender), semaphore_(semaphore)
+ {}
+ ~QAbstractMetaCallEvent();
+
+ virtual void placeMetaCall(QObject *object) = 0;
+
+ inline const QObject *sender() const { return sender_; }
+ inline int signalId() const { return signalId_; }
+
+private:
+ int signalId_;
+ const QObject *sender_;
+ QSemaphore *semaphore_;
+};
+
+class Q_CORE_EXPORT QMetaCallEvent : public QAbstractMetaCallEvent
{
public:
QMetaCallEvent(ushort method_offset, ushort method_relative, QObjectPrivate::StaticMetaCallFunction callFunction , const QObject *sender, int signalId,
@@ -407,23 +512,18 @@ public:
QMetaCallEvent(QtPrivate::QSlotObjectBase *slotObj, const QObject *sender, int signalId,
int nargs = 0, int *types = nullptr, void **args = nullptr, QSemaphore *semaphore = nullptr);
- ~QMetaCallEvent();
+ ~QMetaCallEvent() override;
inline int id() const { return method_offset_ + method_relative_; }
- inline const QObject *sender() const { return sender_; }
- inline int signalId() const { return signalId_; }
inline void **args() const { return args_; }
- virtual void placeMetaCall(QObject *object);
+ virtual void placeMetaCall(QObject *object) override;
private:
QtPrivate::QSlotObjectBase *slotObj_;
- const QObject *sender_;
- int signalId_;
int nargs_;
int *types_;
void **args_;
- QSemaphore *semaphore_;
QObjectPrivate::StaticMetaCallFunction callFunction_;
ushort method_offset_;
ushort method_relative_;
diff --git a/src/corelib/kernel/qobjectdefs.h b/src/corelib/kernel/qobjectdefs.h
index d7ed2b0282..a437a994fd 100644
--- a/src/corelib/kernel/qobjectdefs.h
+++ b/src/corelib/kernel/qobjectdefs.h
@@ -119,13 +119,13 @@ class QString;
#define Q_ENUMS(x) QT_ANNOTATE_CLASS(qt_enums, x)
#define Q_FLAGS(x) QT_ANNOTATE_CLASS(qt_enums, x)
#define Q_ENUM_IMPL(ENUM) \
- friend Q_DECL_CONSTEXPR const QMetaObject *qt_getEnumMetaObject(ENUM) Q_DECL_NOEXCEPT { return &staticMetaObject; } \
- friend Q_DECL_CONSTEXPR const char *qt_getEnumName(ENUM) Q_DECL_NOEXCEPT { return #ENUM; }
+ friend Q_DECL_CONSTEXPR const QMetaObject *qt_getEnumMetaObject(ENUM) noexcept { return &staticMetaObject; } \
+ friend Q_DECL_CONSTEXPR const char *qt_getEnumName(ENUM) noexcept { return #ENUM; }
#define Q_ENUM(x) Q_ENUMS(x) Q_ENUM_IMPL(x)
#define Q_FLAG(x) Q_FLAGS(x) Q_ENUM_IMPL(x)
#define Q_ENUM_NS_IMPL(ENUM) \
- inline Q_DECL_CONSTEXPR const QMetaObject *qt_getEnumMetaObject(ENUM) Q_DECL_NOEXCEPT { return &staticMetaObject; } \
- inline Q_DECL_CONSTEXPR const char *qt_getEnumName(ENUM) Q_DECL_NOEXCEPT { return #ENUM; }
+ inline Q_DECL_CONSTEXPR const QMetaObject *qt_getEnumMetaObject(ENUM) noexcept { return &staticMetaObject; } \
+ inline Q_DECL_CONSTEXPR const char *qt_getEnumName(ENUM) noexcept { return #ENUM; }
#define Q_ENUM_NS(x) Q_ENUMS(x) Q_ENUM_NS_IMPL(x)
#define Q_FLAG_NS(x) Q_FLAGS(x) Q_ENUM_NS_IMPL(x)
#define Q_SCRIPTABLE QT_ANNOTATE_FUNCTION(qt_scriptable)
@@ -340,7 +340,7 @@ struct Q_CORE_EXPORT QMetaObject
const char *className() const;
const QMetaObject *superClass() const;
- bool inherits(const QMetaObject *metaObject) const Q_DECL_NOEXCEPT;
+ bool inherits(const QMetaObject *metaObject) const noexcept;
QObject *cast(QObject *obj) const;
const QObject *cast(const QObject *obj) const;
@@ -605,8 +605,8 @@ public:
operator RestrictedBool() const { return d_ptr && isConnected_helper() ? &Connection::d_ptr : nullptr; }
#endif
- Connection(Connection &&o) Q_DECL_NOTHROW : d_ptr(o.d_ptr) { o.d_ptr = nullptr; }
- Connection &operator=(Connection &&other) Q_DECL_NOTHROW
+ Connection(Connection &&o) noexcept : d_ptr(o.d_ptr) { o.d_ptr = nullptr; }
+ Connection &operator=(Connection &&other) noexcept
{ qSwap(d_ptr, other.d_ptr); return *this; }
};
diff --git a/src/corelib/kernel/qobjectdefs_impl.h b/src/corelib/kernel/qobjectdefs_impl.h
index aa6bd84e95..31ecc8b20d 100644
--- a/src/corelib/kernel/qobjectdefs_impl.h
+++ b/src/corelib/kernel/qobjectdefs_impl.h
@@ -386,8 +386,8 @@ namespace QtPrivate {
public:
explicit QSlotObjectBase(ImplFn fn) : m_ref(1), m_impl(fn) {}
- inline int ref() Q_DECL_NOTHROW { return m_ref.ref(); }
- inline void destroyIfLastRef() Q_DECL_NOTHROW
+ inline int ref() noexcept { return m_ref.ref(); }
+ inline void destroyIfLastRef() noexcept
{ if (!m_ref.deref()) m_impl(Destroy, this, nullptr, nullptr, nullptr); }
inline bool compare(void **a) { bool ret = false; m_impl(Compare, this, nullptr, a, &ret); return ret; }
diff --git a/src/corelib/kernel/qsignalmapper.cpp b/src/corelib/kernel/qsignalmapper.cpp
index d56965281e..02a1281f92 100644
--- a/src/corelib/kernel/qsignalmapper.cpp
+++ b/src/corelib/kernel/qsignalmapper.cpp
@@ -61,7 +61,7 @@ public:
/*!
\class QSignalMapper
\inmodule QtCore
- \obsolete
+ \obsolete The recommended solution is connecting the signal to a lambda.
\brief The QSignalMapper class bundles signals from identifiable senders.
\ingroup objectmodel
diff --git a/src/corelib/kernel/qtestsupport_core.cpp b/src/corelib/kernel/qtestsupport_core.cpp
index c54b933f94..7bd81ed498 100644
--- a/src/corelib/kernel/qtestsupport_core.cpp
+++ b/src/corelib/kernel/qtestsupport_core.cpp
@@ -102,7 +102,7 @@ Q_CORE_EXPORT void QTest::qWait(int ms)
int remaining = ms;
do {
QCoreApplication::processEvents(QEventLoop::AllEvents, remaining);
- QCoreApplication::sendPostedEvents(Q_NULLPTR, QEvent::DeferredDelete);
+ QCoreApplication::sendPostedEvents(nullptr, QEvent::DeferredDelete);
remaining = timer.remainingTime();
if (remaining <= 0)
break;
diff --git a/src/corelib/kernel/qtimer.h b/src/corelib/kernel/qtimer.h
index 66f317c567..ae5552f1c9 100644
--- a/src/corelib/kernel/qtimer.h
+++ b/src/corelib/kernel/qtimer.h
@@ -218,7 +218,7 @@ private:
inline int startTimer(int){ return -1;}
inline void killTimer(int){}
- static Q_DECL_CONSTEXPR Qt::TimerType defaultTypeFor(int msecs) Q_DECL_NOTHROW
+ static Q_DECL_CONSTEXPR Qt::TimerType defaultTypeFor(int msecs) noexcept
{ return msecs >= 2000 ? Qt::CoarseTimer : Qt::PreciseTimer; }
static void singleShotImpl(int msec, Qt::TimerType timerType,
const QObject *receiver, QtPrivate::QSlotObjectBase *slotObj);
diff --git a/src/corelib/kernel/qtranslator.cpp b/src/corelib/kernel/qtranslator.cpp
index dc39490ab0..a2111a084f 100644
--- a/src/corelib/kernel/qtranslator.cpp
+++ b/src/corelib/kernel/qtranslator.cpp
@@ -66,6 +66,7 @@
#endif
#include <stdlib.h>
+#include <new>
#include "qobject_p.h"
@@ -585,7 +586,7 @@ bool QTranslatorPrivate::do_load(const QString &realname, const QString &directo
#endif // QT_USE_MMAP
if (!ok) {
- d->unmapPointer = new char[d->unmapLength];
+ d->unmapPointer = new (std::nothrow) char[d->unmapLength];
if (d->unmapPointer) {
file.seek(0);
qint64 readResult = file.read(d->unmapPointer, d->unmapLength);
diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp
index 77d2c8cbe1..cd4e233af0 100644
--- a/src/corelib/kernel/qvariant.cpp
+++ b/src/corelib/kernel/qvariant.cpp
@@ -4282,6 +4282,7 @@ QDebug operator<<(QDebug dbg, const QVariant::Type p)
\sa fromValue()
*/
+#if QT_DEPRECATED_SINCE(5, 14)
/*!
\fn template<typename T> QVariant qVariantFromValue(const T &value)
\relates QVariant
@@ -4319,6 +4320,7 @@ QDebug operator<<(QDebug dbg, const QVariant::Type p)
\sa QVariant::setValue()
*/
+#endif
/*!
\fn template<typename T> T qvariant_cast(const QVariant &value)
diff --git a/src/corelib/kernel/qvariant.h b/src/corelib/kernel/qvariant.h
index f95502e75f..6b35bfa9e9 100644
--- a/src/corelib/kernel/qvariant.h
+++ b/src/corelib/kernel/qvariant.h
@@ -92,9 +92,6 @@ class QUrl;
class QVariant;
class QVariantComparisonHelper;
-template <typename T>
-inline QVariant qVariantFromValue(const T &);
-
template<typename T>
inline T qvariant_cast(const QVariant &);
@@ -204,7 +201,7 @@ class Q_CORE_EXPORT QVariant
LastType = 0xffffffff // need this so that gcc >= 3.4 allocates 32 bits for Type
};
- QVariant() Q_DECL_NOTHROW : d() {}
+ QVariant() noexcept : d() {}
~QVariant();
QVariant(Type type);
QVariant(int typeId, const void *copy);
@@ -271,13 +268,13 @@ class Q_CORE_EXPORT QVariant
QVariant& operator=(const QVariant &other);
#ifdef Q_COMPILER_RVALUE_REFS
- inline QVariant(QVariant &&other) Q_DECL_NOTHROW : d(other.d)
+ inline QVariant(QVariant &&other) noexcept : d(other.d)
{ other.d = Private(); }
- inline QVariant &operator=(QVariant &&other) Q_DECL_NOTHROW
+ inline QVariant &operator=(QVariant &&other) noexcept
{ qSwap(d, other.d); return *this; }
#endif
- inline void swap(QVariant &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+ inline void swap(QVariant &other) noexcept { qSwap(d, other.d); }
Type type() const;
int userType() const;
@@ -365,7 +362,7 @@ class Q_CORE_EXPORT QVariant
template<typename T>
static inline QVariant fromValue(const T &value)
- { return qVariantFromValue(value); }
+ { return QVariant(qMetaTypeId<T>(), &value, QTypeInfo<T>::isPointer); }
#if QT_HAS_INCLUDE(<variant>) && __cplusplus >= 201703L
template<typename... Types>
@@ -390,15 +387,15 @@ class Q_CORE_EXPORT QVariant
};
struct Private
{
- inline Private() Q_DECL_NOTHROW : type(Invalid), is_shared(false), is_null(true)
+ inline Private() noexcept : type(Invalid), is_shared(false), is_null(true)
{ data.ptr = nullptr; }
// Internal constructor for initialized variants.
- explicit inline Private(uint variantType) Q_DECL_NOTHROW
+ explicit inline Private(uint variantType) noexcept
: type(variantType), is_shared(false), is_null(false)
{}
- inline Private(const Private &other) Q_DECL_NOTHROW
+ inline Private(const Private &other) noexcept
: data(other.data), type(other.type),
is_shared(other.is_shared), is_null(other.is_null)
{}
@@ -516,50 +513,61 @@ public:
inline const DataPtr &data_ptr() const { return d; }
};
+#if QT_DEPRECATED_SINCE(5, 14)
template <typename T>
+QT_DEPRECATED_X("Use QVariant::fromValue() instead.")
inline QVariant qVariantFromValue(const T &t)
{
- return QVariant(qMetaTypeId<T>(), &t, QTypeInfo<T>::isPointer);
+ return QVariant::fromValue(t);
+}
+
+template <typename T>
+QT_DEPRECATED_X("Use QVariant::setValue() instead.")
+inline void qVariantSetValue(QVariant &v, const T &t)
+{
+ v.setValue(t);
}
+#endif
-template <>
-inline QVariant qVariantFromValue(const QVariant &t) { return t; }
+template<>
+inline QVariant QVariant::fromValue(const QVariant &value)
+{
+ return value;
+}
#if QT_HAS_INCLUDE(<variant>) && __cplusplus >= 201703L
-template <>
-inline QVariant qVariantFromValue(const std::monostate &) { return QVariant(); }
+template<>
+inline QVariant QVariant::fromValue(const std::monostate &)
+{
+ return QVariant();
+}
#endif
-template <typename T>
-inline void qVariantSetValue(QVariant &v, const T &t)
+inline bool QVariant::isValid() const { return d.type != Invalid; }
+
+template<typename T>
+inline void QVariant::setValue(const T &avalue)
{
- //if possible we reuse the current QVariant private
+ // If possible we reuse the current QVariant private.
const uint type = qMetaTypeId<T>();
- QVariant::Private &d = v.data_ptr();
- if (v.isDetached() && (type == d.type || (type <= uint(QVariant::Char) && d.type <= uint(QVariant::Char)))) {
+ if (isDetached() && (type == d.type || (type <= uint(QVariant::Char) && d.type <= uint(QVariant::Char)))) {
d.type = type;
d.is_null = false;
T *old = reinterpret_cast<T*>(d.is_shared ? d.data.shared->ptr : &d.data.ptr);
if (QTypeInfo<T>::isComplex)
old->~T();
- new (old) T(t); //call the copy constructor
+ new (old) T(avalue); // call the copy constructor
} else {
- v = QVariant(type, &t, QTypeInfo<T>::isPointer);
+ *this = QVariant(type, &avalue, QTypeInfo<T>::isPointer);
}
}
-template <>
-inline void qVariantSetValue<QVariant>(QVariant &v, const QVariant &t)
+template<>
+inline void QVariant::setValue(const QVariant &avalue)
{
- v = t;
+ *this = avalue;
}
-inline bool QVariant::isValid() const { return d.type != Invalid; }
-
-template<typename T>
-inline void QVariant::setValue(const T &avalue)
-{ qVariantSetValue(*this, avalue); }
-
#ifndef QT_NO_DATASTREAM
Q_CORE_EXPORT QDataStream& operator>> (QDataStream& s, QVariant& p);
Q_CORE_EXPORT QDataStream& operator<< (QDataStream& s, const QVariant& p);
diff --git a/src/corelib/mimetypes/mimetypes.pri b/src/corelib/mimetypes/mimetypes.pri
index 870b6c65a5..62bbe348e4 100644
--- a/src/corelib/mimetypes/mimetypes.pri
+++ b/src/corelib/mimetypes/mimetypes.pri
@@ -21,5 +21,5 @@ qtConfig(mimetype) {
mimetypes/qmimeglobpattern.cpp \
mimetypes/qmimeprovider.cpp
- RESOURCES += mimetypes/mimetypes.qrc
+ qtConfig(mimetype-database): RESOURCES += mimetypes/mimetypes.qrc
}
diff --git a/src/corelib/mimetypes/qmimeglobpattern_p.h b/src/corelib/mimetypes/qmimeglobpattern_p.h
index bb6f64320b..cf27d6ab30 100644
--- a/src/corelib/mimetypes/qmimeglobpattern_p.h
+++ b/src/corelib/mimetypes/qmimeglobpattern_p.h
@@ -88,7 +88,7 @@ public:
{
}
- void swap(QMimeGlobPattern &other) Q_DECL_NOTHROW
+ void swap(QMimeGlobPattern &other) noexcept
{
qSwap(m_pattern, other.m_pattern);
qSwap(m_mimeType, other.m_mimeType);
diff --git a/src/corelib/mimetypes/qmimemagicrule_p.h b/src/corelib/mimetypes/qmimemagicrule_p.h
index 6962a6ca59..5091d483b6 100644
--- a/src/corelib/mimetypes/qmimemagicrule_p.h
+++ b/src/corelib/mimetypes/qmimemagicrule_p.h
@@ -69,7 +69,7 @@ public:
QMimeMagicRule(const QString &typeStr, const QByteArray &value, const QString &offsets,
const QByteArray &mask, QString *errorString);
- void swap(QMimeMagicRule &other) Q_DECL_NOTHROW
+ void swap(QMimeMagicRule &other) noexcept
{
qSwap(m_type, other.m_type);
qSwap(m_value, other.m_value);
diff --git a/src/corelib/mimetypes/qmimemagicrulematcher_p.h b/src/corelib/mimetypes/qmimemagicrulematcher_p.h
index 5e74e2e3fc..fe714987e6 100644
--- a/src/corelib/mimetypes/qmimemagicrulematcher_p.h
+++ b/src/corelib/mimetypes/qmimemagicrulematcher_p.h
@@ -66,7 +66,7 @@ class QMimeMagicRuleMatcher
public:
explicit QMimeMagicRuleMatcher(const QString &mime, unsigned priority = 65535);
- void swap(QMimeMagicRuleMatcher &other) Q_DECL_NOTHROW
+ void swap(QMimeMagicRuleMatcher &other) noexcept
{
qSwap(m_list, other.m_list);
qSwap(m_priority, other.m_priority);
diff --git a/src/corelib/mimetypes/qmimeprovider.cpp b/src/corelib/mimetypes/qmimeprovider.cpp
index 5e1447aaa9..7e2696b719 100644
--- a/src/corelib/mimetypes/qmimeprovider.cpp
+++ b/src/corelib/mimetypes/qmimeprovider.cpp
@@ -54,7 +54,9 @@
static void initResources()
{
+#if QT_CONFIG(mimetype_database)
Q_INIT_RESOURCE(mimetypes);
+#endif
}
QT_BEGIN_NAMESPACE
diff --git a/src/corelib/mimetypes/qmimetype.cpp b/src/corelib/mimetypes/qmimetype.cpp
index 55c7de0c87..cf01c9503b 100644
--- a/src/corelib/mimetypes/qmimetype.cpp
+++ b/src/corelib/mimetypes/qmimetype.cpp
@@ -192,7 +192,7 @@ bool QMimeType::operator==(const QMimeType &other) const
Returns the hash value for \a key, using
\a seed to seed the calculation.
*/
-uint qHash(const QMimeType &key, uint seed) Q_DECL_NOTHROW
+uint qHash(const QMimeType &key, uint seed) noexcept
{
return qHash(key.d->name, seed);
}
diff --git a/src/corelib/mimetypes/qmimetype.h b/src/corelib/mimetypes/qmimetype.h
index 8287f1434b..c496af7d58 100644
--- a/src/corelib/mimetypes/qmimetype.h
+++ b/src/corelib/mimetypes/qmimetype.h
@@ -55,7 +55,7 @@ class QMimeTypePrivate;
class QStringList;
class QMimeType;
-Q_CORE_EXPORT uint qHash(const QMimeType &key, uint seed = 0) Q_DECL_NOTHROW;
+Q_CORE_EXPORT uint qHash(const QMimeType &key, uint seed = 0) noexcept;
class Q_CORE_EXPORT QMimeType
{
@@ -79,9 +79,9 @@ public:
QMimeType(const QMimeType &other);
QMimeType &operator=(const QMimeType &other);
#ifdef Q_COMPILER_RVALUE_REFS
- QMimeType &operator=(QMimeType &&other) Q_DECL_NOTHROW { swap(other); return *this; }
+ QMimeType &operator=(QMimeType &&other) noexcept { swap(other); return *this; }
#endif
- void swap(QMimeType &other) Q_DECL_NOTHROW
+ void swap(QMimeType &other) noexcept
{
qSwap(d, other.d);
}
@@ -121,7 +121,7 @@ protected:
friend class QMimeXMLProvider;
friend class QMimeBinaryProvider;
friend class QMimeTypePrivate;
- friend Q_CORE_EXPORT uint qHash(const QMimeType &key, uint seed) Q_DECL_NOTHROW;
+ friend Q_CORE_EXPORT uint qHash(const QMimeType &key, uint seed) noexcept;
QExplicitlySharedDataPointer<QMimeTypePrivate> d;
};
diff --git a/src/corelib/platform/wasm/qstdweb.cpp b/src/corelib/platform/wasm/qstdweb.cpp
index 1afd91d860..198ce897ca 100644
--- a/src/corelib/platform/wasm/qstdweb.cpp
+++ b/src/corelib/platform/wasm/qstdweb.cpp
@@ -227,7 +227,7 @@ std::string EventCallback::contextPropertyName(const std::string &eventName)
return std::string("data-qtEventCallbackContext") + eventName;
}
-EMSCRIPTEN_BINDINGS(QtStdwebCalback) {
+EMSCRIPTEN_BINDINGS(qtStdwebCalback) {
emscripten::function("qtStdWebEventCallbackActivate", &EventCallback::activate);
}
diff --git a/src/corelib/plugin/qlibrary.cpp b/src/corelib/plugin/qlibrary.cpp
index 6635286f76..0e32776c71 100644
--- a/src/corelib/plugin/qlibrary.cpp
+++ b/src/corelib/plugin/qlibrary.cpp
@@ -999,7 +999,7 @@ void QLibrary::setFileNameAndVersion(const QString &fileName, const QString &ver
/*!
Returns the address of the exported symbol \a symbol. The library is
- loaded if necessary. The function returns 0 if the symbol could
+ loaded if necessary. The function returns \nullptr if the symbol could
not be resolved or if the library could not be loaded.
Example:
@@ -1032,7 +1032,7 @@ QFunctionPointer QLibrary::resolve(const char *symbol)
include the platform-specific file suffix; (see \l{fileName}). The
library remains loaded until the application exits.
- The function returns 0 if the symbol could not be resolved or if
+ The function returns \nullptr if the symbol could not be resolved or if
the library could not be loaded.
\sa resolve()
@@ -1052,7 +1052,7 @@ QFunctionPointer QLibrary::resolve(const QString &fileName, const char *symbol)
(see \l{fileName}). The library remains loaded until the application exits.
\a verNum is ignored on Windows.
- The function returns 0 if the symbol could not be resolved or if
+ The function returns \nullptr if the symbol could not be resolved or if
the library could not be loaded.
\sa resolve()
@@ -1073,7 +1073,7 @@ QFunctionPointer QLibrary::resolve(const QString &fileName, int verNum, const ch
(see \l{fileName}). The library remains loaded until the application exits.
\a version is ignored on Windows.
- The function returns 0 if the symbol could not be resolved or if
+ The function returns \nullptr if the symbol could not be resolved or if
the library could not be loaded.
\sa resolve()
diff --git a/src/corelib/plugin/qpluginloader.cpp b/src/corelib/plugin/qpluginloader.cpp
index 0f94bb6adf..00480198bd 100644
--- a/src/corelib/plugin/qpluginloader.cpp
+++ b/src/corelib/plugin/qpluginloader.cpp
@@ -174,7 +174,7 @@ QPluginLoader::~QPluginLoader()
/*!
Returns the root component object of the plugin. The plugin is
- loaded if necessary. The function returns 0 if the plugin could
+ loaded if necessary. The function returns \nullptr if the plugin could
not be loaded or if the root component object could not be
instantiated.
diff --git a/src/corelib/plugin/quuid.cpp b/src/corelib/plugin/quuid.cpp
index 8bb5e1463a..83873edf6f 100644
--- a/src/corelib/plugin/quuid.cpp
+++ b/src/corelib/plugin/quuid.cpp
@@ -397,7 +397,7 @@ QUuid::QUuid(const QString &text)
\sa toString(), QUuid()
*/
-QUuid QUuid::fromString(QStringView text) Q_DECL_NOTHROW
+QUuid QUuid::fromString(QStringView text) noexcept
{
if (text.size() > MaxStringUuidLength)
text = text.left(MaxStringUuidLength); // text.truncate(MaxStringUuidLength);
@@ -427,7 +427,7 @@ QUuid QUuid::fromString(QStringView text) Q_DECL_NOTHROW
\sa toString(), QUuid()
*/
-QUuid QUuid::fromString(QLatin1String text) Q_DECL_NOTHROW
+QUuid QUuid::fromString(QLatin1String text) noexcept
{
if (Q_UNLIKELY(text.size() < MaxStringUuidLength - 2
|| (text.front() == QLatin1Char('{') && text.size() < MaxStringUuidLength - 1))) {
@@ -864,7 +864,7 @@ QDataStream &operator>>(QDataStream &s, QUuid &id)
Returns \c true if this is the null UUID
{00000000-0000-0000-0000-000000000000}; otherwise returns \c false.
*/
-bool QUuid::isNull() const Q_DECL_NOTHROW
+bool QUuid::isNull() const noexcept
{
return data4[0] == 0 && data4[1] == 0 && data4[2] == 0 && data4[3] == 0 &&
data4[4] == 0 && data4[5] == 0 && data4[6] == 0 && data4[7] == 0 &&
@@ -913,7 +913,7 @@ bool QUuid::isNull() const Q_DECL_NOTHROW
\sa version()
*/
-QUuid::Variant QUuid::variant() const Q_DECL_NOTHROW
+QUuid::Variant QUuid::variant() const noexcept
{
if (isNull())
return VarUnknown;
@@ -934,7 +934,7 @@ QUuid::Variant QUuid::variant() const Q_DECL_NOTHROW
\sa variant()
*/
-QUuid::Version QUuid::version() const Q_DECL_NOTHROW
+QUuid::Version QUuid::version() const noexcept
{
// Check the 4 MSB of data3
Version ver = (Version)(data3>>12);
@@ -957,7 +957,7 @@ QUuid::Version QUuid::version() const Q_DECL_NOTHROW
\sa variant()
*/
-bool QUuid::operator<(const QUuid &other) const Q_DECL_NOTHROW
+bool QUuid::operator<(const QUuid &other) const noexcept
{
if (variant() != other.variant())
return variant() < other.variant();
@@ -984,7 +984,7 @@ bool QUuid::operator<(const QUuid &other) const Q_DECL_NOTHROW
\sa variant()
*/
-bool QUuid::operator>(const QUuid &other) const Q_DECL_NOTHROW
+bool QUuid::operator>(const QUuid &other) const noexcept
{
return other < *this;
}
@@ -1089,7 +1089,7 @@ QDebug operator<<(QDebug dbg, const QUuid &id)
\relates QUuid
Returns a hash of the UUID \a uuid, using \a seed to seed the calculation.
*/
-uint qHash(const QUuid &uuid, uint seed) Q_DECL_NOTHROW
+uint qHash(const QUuid &uuid, uint seed) noexcept
{
return uuid.data1 ^ uuid.data2 ^ (uuid.data3 << 16)
^ ((uuid.data4[0] << 24) | (uuid.data4[1] << 16) | (uuid.data4[2] << 8) | uuid.data4[3])
diff --git a/src/corelib/plugin/quuid.h b/src/corelib/plugin/quuid.h
index 08a1843640..713ca070c8 100644
--- a/src/corelib/plugin/quuid.h
+++ b/src/corelib/plugin/quuid.h
@@ -93,13 +93,13 @@ public:
#if defined(Q_COMPILER_UNIFORM_INIT) && !defined(Q_CLANG_QDOC)
- Q_DECL_CONSTEXPR QUuid() Q_DECL_NOTHROW : data1(0), data2(0), data3(0), data4{0,0,0,0,0,0,0,0} {}
+ Q_DECL_CONSTEXPR QUuid() noexcept : data1(0), data2(0), data3(0), data4{0,0,0,0,0,0,0,0} {}
Q_DECL_CONSTEXPR QUuid(uint l, ushort w1, ushort w2, uchar b1, uchar b2, uchar b3,
- uchar b4, uchar b5, uchar b6, uchar b7, uchar b8) Q_DECL_NOTHROW
+ uchar b4, uchar b5, uchar b6, uchar b7, uchar b8) noexcept
: data1(l), data2(w1), data3(w2), data4{b1, b2, b3, b4, b5, b6, b7, b8} {}
#else
- QUuid() Q_DECL_NOTHROW
+ QUuid() noexcept
{
data1 = 0;
data2 = 0;
@@ -107,7 +107,7 @@ public:
for(int i = 0; i < 8; i++)
data4[i] = 0;
}
- QUuid(uint l, ushort w1, ushort w2, uchar b1, uchar b2, uchar b3, uchar b4, uchar b5, uchar b6, uchar b7, uchar b8) Q_DECL_NOTHROW
+ QUuid(uint l, ushort w1, ushort w2, uchar b1, uchar b2, uchar b3, uchar b4, uchar b5, uchar b6, uchar b7, uchar b8) noexcept
{
data1 = l;
data2 = w1;
@@ -124,8 +124,8 @@ public:
#endif
QUuid(const QString &);
- static QUuid fromString(QStringView string) Q_DECL_NOTHROW;
- static QUuid fromString(QLatin1String string) Q_DECL_NOTHROW;
+ static QUuid fromString(QStringView string) noexcept;
+ static QUuid fromString(QLatin1String string) noexcept;
QUuid(const char *);
QString toString() const;
QString toString(StringFormat mode) const; // ### Qt6: merge with previous
@@ -134,9 +134,9 @@ public:
QByteArray toByteArray(StringFormat mode) const; // ### Qt6: merge with previous
QByteArray toRfc4122() const;
static QUuid fromRfc4122(const QByteArray &);
- bool isNull() const Q_DECL_NOTHROW;
+ bool isNull() const noexcept;
- Q_DECL_RELAXED_CONSTEXPR bool operator==(const QUuid &orig) const Q_DECL_NOTHROW
+ Q_DECL_RELAXED_CONSTEXPR bool operator==(const QUuid &orig) const noexcept
{
if (data1 != orig.data1 || data2 != orig.data2 ||
data3 != orig.data3)
@@ -149,24 +149,24 @@ public:
return true;
}
- Q_DECL_RELAXED_CONSTEXPR bool operator!=(const QUuid &orig) const Q_DECL_NOTHROW
+ Q_DECL_RELAXED_CONSTEXPR bool operator!=(const QUuid &orig) const noexcept
{
return !(*this == orig);
}
- bool operator<(const QUuid &other) const Q_DECL_NOTHROW;
- bool operator>(const QUuid &other) const Q_DECL_NOTHROW;
+ bool operator<(const QUuid &other) const noexcept;
+ bool operator>(const QUuid &other) const noexcept;
#if defined(Q_OS_WIN) || defined(Q_CLANG_QDOC)
// On Windows we have a type GUID that is used by the platform API, so we
// provide convenience operators to cast from and to this type.
#if defined(Q_COMPILER_UNIFORM_INIT) && !defined(Q_CLANG_QDOC)
- Q_DECL_CONSTEXPR QUuid(const GUID &guid) Q_DECL_NOTHROW
+ Q_DECL_CONSTEXPR QUuid(const GUID &guid) noexcept
: data1(guid.Data1), data2(guid.Data2), data3(guid.Data3),
data4{guid.Data4[0], guid.Data4[1], guid.Data4[2], guid.Data4[3],
guid.Data4[4], guid.Data4[5], guid.Data4[6], guid.Data4[7]} {}
#else
- QUuid(const GUID &guid) Q_DECL_NOTHROW
+ QUuid(const GUID &guid) noexcept
{
data1 = guid.Data1;
data2 = guid.Data2;
@@ -176,24 +176,24 @@ public:
}
#endif
- Q_DECL_RELAXED_CONSTEXPR QUuid &operator=(const GUID &guid) Q_DECL_NOTHROW
+ Q_DECL_RELAXED_CONSTEXPR QUuid &operator=(const GUID &guid) noexcept
{
*this = QUuid(guid);
return *this;
}
- Q_DECL_RELAXED_CONSTEXPR operator GUID() const Q_DECL_NOTHROW
+ Q_DECL_RELAXED_CONSTEXPR operator GUID() const noexcept
{
GUID guid = { data1, data2, data3, { data4[0], data4[1], data4[2], data4[3], data4[4], data4[5], data4[6], data4[7] } };
return guid;
}
- Q_DECL_RELAXED_CONSTEXPR bool operator==(const GUID &guid) const Q_DECL_NOTHROW
+ Q_DECL_RELAXED_CONSTEXPR bool operator==(const GUID &guid) const noexcept
{
return *this == QUuid(guid);
}
- Q_DECL_RELAXED_CONSTEXPR bool operator!=(const GUID &guid) const Q_DECL_NOTHROW
+ Q_DECL_RELAXED_CONSTEXPR bool operator!=(const GUID &guid) const noexcept
{
return !(*this == guid);
}
@@ -216,8 +216,8 @@ public:
}
- QUuid::Variant variant() const Q_DECL_NOTHROW;
- QUuid::Version version() const Q_DECL_NOTHROW;
+ QUuid::Variant variant() const noexcept;
+ QUuid::Version version() const noexcept;
#if defined(Q_OS_DARWIN) || defined(Q_CLANG_QDOC)
static QUuid fromCFUUID(CFUUIDRef uuid);
@@ -243,11 +243,11 @@ Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QUuid &);
Q_CORE_EXPORT QDebug operator<<(QDebug, const QUuid &);
#endif
-Q_CORE_EXPORT uint qHash(const QUuid &uuid, uint seed = 0) Q_DECL_NOTHROW;
+Q_CORE_EXPORT uint qHash(const QUuid &uuid, uint seed = 0) noexcept;
-inline bool operator<=(const QUuid &lhs, const QUuid &rhs) Q_DECL_NOTHROW
+inline bool operator<=(const QUuid &lhs, const QUuid &rhs) noexcept
{ return !(rhs < lhs); }
-inline bool operator>=(const QUuid &lhs, const QUuid &rhs) Q_DECL_NOTHROW
+inline bool operator>=(const QUuid &lhs, const QUuid &rhs) noexcept
{ return !(lhs < rhs); }
QT_END_NAMESPACE
diff --git a/src/corelib/serialization/qjson_p.h b/src/corelib/serialization/qjson_p.h
index a9e7059cbe..85fb2a1254 100644
--- a/src/corelib/serialization/qjson_p.h
+++ b/src/corelib/serialization/qjson_p.h
@@ -304,7 +304,7 @@ public:
return *this;
}
- QLatin1String toQLatin1String() const Q_DECL_NOTHROW {
+ QLatin1String toQLatin1String() const noexcept {
return QLatin1String(d->latin1, d->length);
}
@@ -339,23 +339,23 @@ public:
};
#define DEF_OP(op) \
- inline bool operator op(Latin1String lhs, Latin1String rhs) Q_DECL_NOTHROW \
+ inline bool operator op(Latin1String lhs, Latin1String rhs) noexcept \
{ \
return lhs.toQLatin1String() op rhs.toQLatin1String(); \
} \
- inline bool operator op(QLatin1String lhs, Latin1String rhs) Q_DECL_NOTHROW \
+ inline bool operator op(QLatin1String lhs, Latin1String rhs) noexcept \
{ \
return lhs op rhs.toQLatin1String(); \
} \
- inline bool operator op(Latin1String lhs, QLatin1String rhs) Q_DECL_NOTHROW \
+ inline bool operator op(Latin1String lhs, QLatin1String rhs) noexcept \
{ \
return lhs.toQLatin1String() op rhs; \
} \
- inline bool operator op(const QString &lhs, Latin1String rhs) Q_DECL_NOTHROW \
+ inline bool operator op(const QString &lhs, Latin1String rhs) noexcept \
{ \
return lhs op rhs.toQLatin1String(); \
} \
- inline bool operator op(Latin1String lhs, const QString &rhs) Q_DECL_NOTHROW \
+ inline bool operator op(Latin1String lhs, const QString &rhs) noexcept \
{ \
return lhs.toQLatin1String() op rhs; \
} \
diff --git a/src/corelib/serialization/qjsonarray.h b/src/corelib/serialization/qjsonarray.h
index ba346fb848..86b7bf9d76 100644
--- a/src/corelib/serialization/qjsonarray.h
+++ b/src/corelib/serialization/qjsonarray.h
@@ -72,7 +72,7 @@ public:
QJsonArray(const QJsonArray &other);
QJsonArray &operator =(const QJsonArray &other);
- QJsonArray(QJsonArray &&other) Q_DECL_NOTHROW
+ QJsonArray(QJsonArray &&other) noexcept
: d(other.d),
a(other.a)
{
@@ -80,7 +80,7 @@ public:
other.a = nullptr;
}
- QJsonArray &operator =(QJsonArray &&other) Q_DECL_NOTHROW
+ QJsonArray &operator =(QJsonArray &&other) noexcept
{
swap(other);
return *this;
@@ -115,7 +115,7 @@ public:
bool operator==(const QJsonArray &other) const;
bool operator!=(const QJsonArray &other) const;
- void swap(QJsonArray &other) Q_DECL_NOTHROW
+ void swap(QJsonArray &other) noexcept
{
qSwap(d, other.d);
qSwap(a, other.a);
diff --git a/src/corelib/serialization/qjsondocument.h b/src/corelib/serialization/qjsondocument.h
index a749439b7d..a8006a6cc5 100644
--- a/src/corelib/serialization/qjsondocument.h
+++ b/src/corelib/serialization/qjsondocument.h
@@ -93,19 +93,19 @@ public:
QJsonDocument(const QJsonDocument &other);
QJsonDocument &operator =(const QJsonDocument &other);
- QJsonDocument(QJsonDocument &&other) Q_DECL_NOTHROW
+ QJsonDocument(QJsonDocument &&other) noexcept
: d(other.d)
{
other.d = nullptr;
}
- QJsonDocument &operator =(QJsonDocument &&other) Q_DECL_NOTHROW
+ QJsonDocument &operator =(QJsonDocument &&other) noexcept
{
swap(other);
return *this;
}
- void swap(QJsonDocument &other) Q_DECL_NOTHROW
+ void swap(QJsonDocument &other) noexcept
{
qSwap(d, other.d);
}
diff --git a/src/corelib/serialization/qjsonobject.h b/src/corelib/serialization/qjsonobject.h
index 80fe6b2f3f..92d45cc838 100644
--- a/src/corelib/serialization/qjsonobject.h
+++ b/src/corelib/serialization/qjsonobject.h
@@ -74,20 +74,20 @@ public:
QJsonObject(const QJsonObject &other);
QJsonObject &operator =(const QJsonObject &other);
- QJsonObject(QJsonObject &&other) Q_DECL_NOTHROW
+ QJsonObject(QJsonObject &&other) noexcept
: d(other.d), o(other.o)
{
other.d = nullptr;
other.o = nullptr;
}
- QJsonObject &operator =(QJsonObject &&other) Q_DECL_NOTHROW
+ QJsonObject &operator =(QJsonObject &&other) noexcept
{
swap(other);
return *this;
}
- void swap(QJsonObject &other) Q_DECL_NOTHROW
+ void swap(QJsonObject &other) noexcept
{
qSwap(d, other.d);
qSwap(o, other.o);
diff --git a/src/corelib/serialization/qjsonvalue.h b/src/corelib/serialization/qjsonvalue.h
index 0339eb59f7..37d84f9e60 100644
--- a/src/corelib/serialization/qjsonvalue.h
+++ b/src/corelib/serialization/qjsonvalue.h
@@ -92,7 +92,7 @@ public:
QJsonValue(const QJsonValue &other);
QJsonValue &operator =(const QJsonValue &other);
- QJsonValue(QJsonValue &&other) Q_DECL_NOTHROW
+ QJsonValue(QJsonValue &&other) noexcept
: ui(other.ui),
d(other.d),
t(other.t)
@@ -102,13 +102,13 @@ public:
other.t = Null;
}
- QJsonValue &operator =(QJsonValue &&other) Q_DECL_NOTHROW
+ QJsonValue &operator =(QJsonValue &&other) noexcept
{
swap(other);
return *this;
}
- void swap(QJsonValue &other) Q_DECL_NOTHROW
+ void swap(QJsonValue &other) noexcept
{
qSwap(ui, other.ui);
qSwap(d, other.d);
diff --git a/src/corelib/serialization/qtextstream.h b/src/corelib/serialization/qtextstream.h
index 7673e5d87e..4efa84f1f1 100644
--- a/src/corelib/serialization/qtextstream.h
+++ b/src/corelib/serialization/qtextstream.h
@@ -213,8 +213,8 @@ typedef void (QTextStream::*QTSMFC)(QChar); // manipulator w/QChar argument
class Q_CORE_EXPORT QTextStreamManipulator
{
public:
- Q_DECL_CONSTEXPR QTextStreamManipulator(QTSMFI m, int a) Q_DECL_NOTHROW : mf(m), mc(nullptr), arg(a), ch() {}
- Q_DECL_CONSTEXPR QTextStreamManipulator(QTSMFC m, QChar c) Q_DECL_NOTHROW : mf(nullptr), mc(m), arg(-1), ch(c) {}
+ Q_DECL_CONSTEXPR QTextStreamManipulator(QTSMFI m, int a) noexcept : mf(m), mc(nullptr), arg(a), ch() {}
+ Q_DECL_CONSTEXPR QTextStreamManipulator(QTSMFC m, QChar c) noexcept : mf(nullptr), mc(m), arg(-1), ch(c) {}
void exec(QTextStream &s) { if (mf) { (s.*mf)(arg); } else { (s.*mc)(ch); } }
private:
diff --git a/src/corelib/serialization/qxmlstream.h b/src/corelib/serialization/qxmlstream.h
index d30c6bc01f..fedd149fd0 100644
--- a/src/corelib/serialization/qxmlstream.h
+++ b/src/corelib/serialization/qxmlstream.h
@@ -60,16 +60,16 @@ public:
:m_string(aString.string()?*aString.string():QString()), m_position(aString.position()), m_size(aString.size()){}
QXmlStreamStringRef(const QString &aString) : m_string(aString), m_position(0), m_size(m_string.size()) {}
#ifdef Q_COMPILER_RVALUE_REFS
- QXmlStreamStringRef(QString &&aString) Q_DECL_NOTHROW : m_string(std::move(aString)), m_position(0), m_size(m_string.size()) {}
+ QXmlStreamStringRef(QString &&aString) noexcept : m_string(std::move(aString)), m_position(0), m_size(m_string.size()) {}
#endif
#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
QXmlStreamStringRef(const QXmlStreamStringRef &other) // = default
: m_string(other.m_string), m_position(other.m_position), m_size(other.m_size) {}
#ifdef Q_COMPILER_RVALUE_REFS
- QXmlStreamStringRef(QXmlStreamStringRef &&other) Q_DECL_NOTHROW // = default
+ QXmlStreamStringRef(QXmlStreamStringRef &&other) noexcept // = default
: m_string(std::move(other.m_string)), m_position(other.m_position), m_size(other.m_size) {}
- QXmlStreamStringRef &operator=(QXmlStreamStringRef &&other) Q_DECL_NOTHROW // = default
+ QXmlStreamStringRef &operator=(QXmlStreamStringRef &&other) noexcept // = default
{ swap(other); return *this; }
#endif
QXmlStreamStringRef &operator=(const QXmlStreamStringRef &other) // = default
@@ -79,7 +79,7 @@ public:
// ### Qt 5, since that would change the way its passed to functions. In Qt 6, remove all.
#endif // Qt < 6.0
- void swap(QXmlStreamStringRef &other) Q_DECL_NOTHROW
+ void swap(QXmlStreamStringRef &other) noexcept
{
qSwap(m_string, other.m_string);
qSwap(m_position, other.m_position);
@@ -112,7 +112,7 @@ public:
QXmlStreamAttribute(const QString &namespaceUri, const QString &name, const QString &value);
QXmlStreamAttribute(const QXmlStreamAttribute &);
#ifdef Q_COMPILER_RVALUE_REFS
- QXmlStreamAttribute(QXmlStreamAttribute &&other) Q_DECL_NOTHROW // = default;
+ QXmlStreamAttribute(QXmlStreamAttribute &&other) noexcept // = default;
: m_name(std::move(other.m_name)),
m_namespaceUri(std::move(other.m_namespaceUri)),
m_qualifiedName(std::move(other.m_qualifiedName)),
@@ -122,7 +122,7 @@ public:
{
other.reserved = nullptr;
}
- QXmlStreamAttribute &operator=(QXmlStreamAttribute &&other) Q_DECL_NOTHROW // = default;
+ QXmlStreamAttribute &operator=(QXmlStreamAttribute &&other) noexcept // = default;
{
m_name = std::move(other.m_name);
m_namespaceUri = std::move(other.m_namespaceUri);
@@ -199,14 +199,14 @@ public:
QXmlStreamNamespaceDeclaration();
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QXmlStreamNamespaceDeclaration(const QXmlStreamNamespaceDeclaration &);
- QXmlStreamNamespaceDeclaration(QXmlStreamNamespaceDeclaration &&other) Q_DECL_NOTHROW // = default
+ QXmlStreamNamespaceDeclaration(QXmlStreamNamespaceDeclaration &&other) noexcept // = default
: m_prefix(std::move(other.m_prefix)),
m_namespaceUri(std::move(other.m_namespaceUri)),
reserved(other.reserved)
{
other.reserved = nullptr;
}
- QXmlStreamNamespaceDeclaration &operator=(QXmlStreamNamespaceDeclaration &&other) Q_DECL_NOTHROW // = default
+ QXmlStreamNamespaceDeclaration &operator=(QXmlStreamNamespaceDeclaration &&other) noexcept // = default
{
m_prefix = std::move(other.m_prefix);
m_namespaceUri = std::move(other.m_namespaceUri);
@@ -242,7 +242,7 @@ public:
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
~QXmlStreamNotationDeclaration();
QXmlStreamNotationDeclaration(const QXmlStreamNotationDeclaration &);
- QXmlStreamNotationDeclaration(QXmlStreamNotationDeclaration &&other) Q_DECL_NOTHROW // = default
+ QXmlStreamNotationDeclaration(QXmlStreamNotationDeclaration &&other) noexcept // = default
: m_name(std::move(other.m_name)),
m_systemId(std::move(other.m_systemId)),
m_publicId(std::move(other.m_publicId)),
@@ -251,7 +251,7 @@ public:
other.reserved = nullptr;
}
QXmlStreamNotationDeclaration& operator=(const QXmlStreamNotationDeclaration &);
- QXmlStreamNotationDeclaration &operator=(QXmlStreamNotationDeclaration &&other) Q_DECL_NOTHROW // = default
+ QXmlStreamNotationDeclaration &operator=(QXmlStreamNotationDeclaration &&other) noexcept // = default
{
m_name = std::move(other.m_name);
m_systemId = std::move(other.m_systemId);
@@ -287,7 +287,7 @@ public:
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
~QXmlStreamEntityDeclaration();
QXmlStreamEntityDeclaration(const QXmlStreamEntityDeclaration &);
- QXmlStreamEntityDeclaration(QXmlStreamEntityDeclaration &&other) Q_DECL_NOTHROW // = default
+ QXmlStreamEntityDeclaration(QXmlStreamEntityDeclaration &&other) noexcept // = default
: m_name(std::move(other.m_name)),
m_notationName(std::move(other.m_notationName)),
m_systemId(std::move(other.m_systemId)),
@@ -298,7 +298,7 @@ public:
other.reserved = nullptr;
}
QXmlStreamEntityDeclaration& operator=(const QXmlStreamEntityDeclaration &);
- QXmlStreamEntityDeclaration &operator=(QXmlStreamEntityDeclaration &&other) Q_DECL_NOTHROW // = default
+ QXmlStreamEntityDeclaration &operator=(QXmlStreamEntityDeclaration &&other) noexcept // = default
{
m_name = std::move(other.m_name);
m_notationName = std::move(other.m_notationName);
diff --git a/src/corelib/statemachine/qstatemachine_p.h b/src/corelib/statemachine/qstatemachine_p.h
index 93756f0e66..3dc48a1c58 100644
--- a/src/corelib/statemachine/qstatemachine_p.h
+++ b/src/corelib/statemachine/qstatemachine_p.h
@@ -222,14 +222,14 @@ public:
{ return qHash(qMakePair(key.obj, key.prop), seed); }
friend uint qHash(const RestorableId &key) noexcept(noexcept(qHash(key, 0U)))
{ return qHash(key, 0U); }
- friend bool operator==(const RestorableId &lhs, const RestorableId &rhs) Q_DECL_NOTHROW
+ friend bool operator==(const RestorableId &lhs, const RestorableId &rhs) noexcept
{ return lhs.obj == rhs.obj && lhs.prop == rhs.prop; }
- friend bool operator!=(const RestorableId &lhs, const RestorableId &rhs) Q_DECL_NOTHROW
+ friend bool operator!=(const RestorableId &lhs, const RestorableId &rhs) noexcept
{ return !operator==(lhs, rhs); }
public:
- explicit RestorableId(QObject *o, QByteArray p) Q_DECL_NOTHROW : guard(o), obj(o), prop(qMove(p)) {}
- QObject *object() const Q_DECL_NOTHROW { return guard; }
- QByteArray propertyName() const Q_DECL_NOTHROW { return prop; }
+ explicit RestorableId(QObject *o, QByteArray p) noexcept : guard(o), obj(o), prop(qMove(p)) {}
+ QObject *object() const noexcept { return guard; }
+ QByteArray propertyName() const noexcept { return prop; }
};
QHash<QAbstractState*, QHash<RestorableId, QVariant> > registeredRestorablesForState;
bool hasRestorable(QAbstractState *state, QObject *object, const QByteArray &propertyName) const;
@@ -271,7 +271,7 @@ public:
QList<QAbstractAnimation*> handledAnimations;
QList<QAbstractAnimation*> localResetEndValues;
- void swap(InitializeAnimationResult &other) Q_DECL_NOTHROW
+ void swap(InitializeAnimationResult &other) noexcept
{
qSwap(handledAnimations, other.handledAnimations);
qSwap(localResetEndValues, other.localResetEndValues);
diff --git a/src/corelib/thread/qatomic.h b/src/corelib/thread/qatomic.h
index f842534c38..280ce96b76 100644
--- a/src/corelib/thread/qatomic.h
+++ b/src/corelib/thread/qatomic.h
@@ -57,15 +57,15 @@ class QAtomicInteger : public QBasicAtomicInteger<T>
public:
// Non-atomic API
#ifdef QT_BASIC_ATOMIC_HAS_CONSTRUCTORS
- constexpr QAtomicInteger(T value = 0) Q_DECL_NOTHROW : QBasicAtomicInteger<T>(value) {}
+ constexpr QAtomicInteger(T value = 0) noexcept : QBasicAtomicInteger<T>(value) {}
#else
- inline QAtomicInteger(T value = 0) Q_DECL_NOTHROW
+ inline QAtomicInteger(T value = 0) noexcept
{
this->_q_value = value;
}
#endif
- inline QAtomicInteger(const QAtomicInteger &other) Q_DECL_NOTHROW
+ inline QAtomicInteger(const QAtomicInteger &other) noexcept
#ifdef QT_BASIC_ATOMIC_HAS_CONSTRUCTORS
: QBasicAtomicInteger<T>()
#endif
@@ -73,7 +73,7 @@ public:
this->storeRelease(other.loadAcquire());
}
- inline QAtomicInteger &operator=(const QAtomicInteger &other) Q_DECL_NOTHROW
+ inline QAtomicInteger &operator=(const QAtomicInteger &other) noexcept
{
this->storeRelease(other.loadAcquire());
return *this;
@@ -159,7 +159,7 @@ public:
#ifdef QT_BASIC_ATOMIC_HAS_CONSTRUCTORS
constexpr
#endif
- QAtomicInt(int value = 0) Q_DECL_NOTHROW : QAtomicInteger<int>(value) {}
+ QAtomicInt(int value = 0) noexcept : QAtomicInteger<int>(value) {}
};
// High-level atomic pointer operations
@@ -168,14 +168,14 @@ class QAtomicPointer : public QBasicAtomicPointer<T>
{
public:
#ifdef QT_BASIC_ATOMIC_HAS_CONSTRUCTORS
- constexpr QAtomicPointer(T *value = nullptr) Q_DECL_NOTHROW : QBasicAtomicPointer<T>(value) {}
+ constexpr QAtomicPointer(T *value = nullptr) noexcept : QBasicAtomicPointer<T>(value) {}
#else
- inline QAtomicPointer(T *value = nullptr) Q_DECL_NOTHROW
+ inline QAtomicPointer(T *value = nullptr) noexcept
{
this->store(value);
}
#endif
- inline QAtomicPointer(const QAtomicPointer<T> &other) Q_DECL_NOTHROW
+ inline QAtomicPointer(const QAtomicPointer<T> &other) noexcept
#ifdef QT_BASIC_ATOMIC_HAS_CONSTRUCTORS
: QBasicAtomicPointer<T>()
#endif
@@ -183,7 +183,7 @@ public:
this->storeRelease(other.loadAcquire());
}
- inline QAtomicPointer<T> &operator=(const QAtomicPointer<T> &other) Q_DECL_NOTHROW
+ inline QAtomicPointer<T> &operator=(const QAtomicPointer<T> &other) noexcept
{
this->storeRelease(other.loadAcquire());
return *this;
diff --git a/src/corelib/thread/qatomic_bootstrap.h b/src/corelib/thread/qatomic_bootstrap.h
index 27a67fb2ee..c4279ee7b1 100644
--- a/src/corelib/thread/qatomic_bootstrap.h
+++ b/src/corelib/thread/qatomic_bootstrap.h
@@ -56,16 +56,16 @@ template <typename T> struct QAtomicOps: QGenericAtomicOps<QAtomicOps<T> >
{
typedef T Type;
- static bool ref(T &_q_value) Q_DECL_NOTHROW
+ static bool ref(T &_q_value) noexcept
{
return ++_q_value != 0;
}
- static bool deref(T &_q_value) Q_DECL_NOTHROW
+ static bool deref(T &_q_value) noexcept
{
return --_q_value != 0;
}
- static bool testAndSetRelaxed(T &_q_value, T expectedValue, T newValue, T *currentValue = nullptr) Q_DECL_NOTHROW
+ static bool testAndSetRelaxed(T &_q_value, T expectedValue, T newValue, T *currentValue = nullptr) noexcept
{
if (currentValue)
*currentValue = _q_value;
@@ -76,7 +76,7 @@ template <typename T> struct QAtomicOps: QGenericAtomicOps<QAtomicOps<T> >
return false;
}
- static T fetchAndStoreRelaxed(T &_q_value, T newValue) Q_DECL_NOTHROW
+ static T fetchAndStoreRelaxed(T &_q_value, T newValue) noexcept
{
T tmp = _q_value;
_q_value = newValue;
@@ -84,7 +84,7 @@ template <typename T> struct QAtomicOps: QGenericAtomicOps<QAtomicOps<T> >
}
template <typename AdditiveType> static
- T fetchAndAddRelaxed(T &_q_value, AdditiveType valueToAdd) Q_DECL_NOTHROW
+ T fetchAndAddRelaxed(T &_q_value, AdditiveType valueToAdd) noexcept
{
T returnValue = _q_value;
_q_value += valueToAdd;
diff --git a/src/corelib/thread/qatomic_cxx11.h b/src/corelib/thread/qatomic_cxx11.h
index 2fc0bf5419..32d27734fc 100644
--- a/src/corelib/thread/qatomic_cxx11.h
+++ b/src/corelib/thread/qatomic_cxx11.h
@@ -222,43 +222,43 @@ template <typename X> struct QAtomicOps
typedef std::atomic<X> Type;
template <typename T> static inline
- T load(const std::atomic<T> &_q_value) Q_DECL_NOTHROW
+ T load(const std::atomic<T> &_q_value) noexcept
{
return _q_value.load(std::memory_order_relaxed);
}
template <typename T> static inline
- T load(const volatile std::atomic<T> &_q_value) Q_DECL_NOTHROW
+ T load(const volatile std::atomic<T> &_q_value) noexcept
{
return _q_value.load(std::memory_order_relaxed);
}
template <typename T> static inline
- T loadAcquire(const std::atomic<T> &_q_value) Q_DECL_NOTHROW
+ T loadAcquire(const std::atomic<T> &_q_value) noexcept
{
return _q_value.load(std::memory_order_acquire);
}
template <typename T> static inline
- T loadAcquire(const volatile std::atomic<T> &_q_value) Q_DECL_NOTHROW
+ T loadAcquire(const volatile std::atomic<T> &_q_value) noexcept
{
return _q_value.load(std::memory_order_acquire);
}
template <typename T> static inline
- void store(std::atomic<T> &_q_value, T newValue) Q_DECL_NOTHROW
+ void store(std::atomic<T> &_q_value, T newValue) noexcept
{
_q_value.store(newValue, std::memory_order_relaxed);
}
template <typename T> static inline
- void storeRelease(std::atomic<T> &_q_value, T newValue) Q_DECL_NOTHROW
+ void storeRelease(std::atomic<T> &_q_value, T newValue) noexcept
{
_q_value.store(newValue, std::memory_order_release);
}
- static inline Q_DECL_CONSTEXPR bool isReferenceCountingNative() Q_DECL_NOTHROW { return isTestAndSetNative(); }
- static inline Q_DECL_CONSTEXPR bool isReferenceCountingWaitFree() Q_DECL_NOTHROW { return false; }
+ static inline Q_DECL_CONSTEXPR bool isReferenceCountingNative() noexcept { return isTestAndSetNative(); }
+ static inline Q_DECL_CONSTEXPR bool isReferenceCountingWaitFree() noexcept { return false; }
template <typename T>
static inline bool ref(std::atomic<T> &_q_value)
{
@@ -266,17 +266,17 @@ template <typename X> struct QAtomicOps
}
template <typename T>
- static inline bool deref(std::atomic<T> &_q_value) Q_DECL_NOTHROW
+ static inline bool deref(std::atomic<T> &_q_value) noexcept
{
return --_q_value != 0;
}
- static inline Q_DECL_CONSTEXPR bool isTestAndSetNative() Q_DECL_NOTHROW
+ static inline Q_DECL_CONSTEXPR bool isTestAndSetNative() noexcept
{ return QAtomicTraits<sizeof(X)>::isLockFree(); }
- static inline Q_DECL_CONSTEXPR bool isTestAndSetWaitFree() Q_DECL_NOTHROW { return false; }
+ static inline Q_DECL_CONSTEXPR bool isTestAndSetWaitFree() noexcept { return false; }
template <typename T>
- static bool testAndSetRelaxed(std::atomic<T> &_q_value, T expectedValue, T newValue, T *currentValue = nullptr) Q_DECL_NOTHROW
+ static bool testAndSetRelaxed(std::atomic<T> &_q_value, T expectedValue, T newValue, T *currentValue = nullptr) noexcept
{
bool tmp = _q_value.compare_exchange_strong(expectedValue, newValue, std::memory_order_relaxed, std::memory_order_relaxed);
if (currentValue)
@@ -285,7 +285,7 @@ template <typename X> struct QAtomicOps
}
template <typename T>
- static bool testAndSetAcquire(std::atomic<T> &_q_value, T expectedValue, T newValue, T *currentValue = nullptr) Q_DECL_NOTHROW
+ static bool testAndSetAcquire(std::atomic<T> &_q_value, T expectedValue, T newValue, T *currentValue = nullptr) noexcept
{
bool tmp = _q_value.compare_exchange_strong(expectedValue, newValue, std::memory_order_acquire, std::memory_order_acquire);
if (currentValue)
@@ -294,7 +294,7 @@ template <typename X> struct QAtomicOps
}
template <typename T>
- static bool testAndSetRelease(std::atomic<T> &_q_value, T expectedValue, T newValue, T *currentValue = nullptr) Q_DECL_NOTHROW
+ static bool testAndSetRelease(std::atomic<T> &_q_value, T expectedValue, T newValue, T *currentValue = nullptr) noexcept
{
bool tmp = _q_value.compare_exchange_strong(expectedValue, newValue, std::memory_order_release, std::memory_order_relaxed);
if (currentValue)
@@ -303,7 +303,7 @@ template <typename X> struct QAtomicOps
}
template <typename T>
- static bool testAndSetOrdered(std::atomic<T> &_q_value, T expectedValue, T newValue, T *currentValue = nullptr) Q_DECL_NOTHROW
+ static bool testAndSetOrdered(std::atomic<T> &_q_value, T expectedValue, T newValue, T *currentValue = nullptr) noexcept
{
bool tmp = _q_value.compare_exchange_strong(expectedValue, newValue, std::memory_order_acq_rel, std::memory_order_acquire);
if (currentValue)
@@ -311,152 +311,152 @@ template <typename X> struct QAtomicOps
return tmp;
}
- static inline Q_DECL_CONSTEXPR bool isFetchAndStoreNative() Q_DECL_NOTHROW { return isTestAndSetNative(); }
- static inline Q_DECL_CONSTEXPR bool isFetchAndStoreWaitFree() Q_DECL_NOTHROW { return false; }
+ static inline Q_DECL_CONSTEXPR bool isFetchAndStoreNative() noexcept { return isTestAndSetNative(); }
+ static inline Q_DECL_CONSTEXPR bool isFetchAndStoreWaitFree() noexcept { return false; }
template <typename T>
- static T fetchAndStoreRelaxed(std::atomic<T> &_q_value, T newValue) Q_DECL_NOTHROW
+ static T fetchAndStoreRelaxed(std::atomic<T> &_q_value, T newValue) noexcept
{
return _q_value.exchange(newValue, std::memory_order_relaxed);
}
template <typename T>
- static T fetchAndStoreAcquire(std::atomic<T> &_q_value, T newValue) Q_DECL_NOTHROW
+ static T fetchAndStoreAcquire(std::atomic<T> &_q_value, T newValue) noexcept
{
return _q_value.exchange(newValue, std::memory_order_acquire);
}
template <typename T>
- static T fetchAndStoreRelease(std::atomic<T> &_q_value, T newValue) Q_DECL_NOTHROW
+ static T fetchAndStoreRelease(std::atomic<T> &_q_value, T newValue) noexcept
{
return _q_value.exchange(newValue, std::memory_order_release);
}
template <typename T>
- static T fetchAndStoreOrdered(std::atomic<T> &_q_value, T newValue) Q_DECL_NOTHROW
+ static T fetchAndStoreOrdered(std::atomic<T> &_q_value, T newValue) noexcept
{
return _q_value.exchange(newValue, std::memory_order_acq_rel);
}
- static inline Q_DECL_CONSTEXPR bool isFetchAndAddNative() Q_DECL_NOTHROW { return isTestAndSetNative(); }
- static inline Q_DECL_CONSTEXPR bool isFetchAndAddWaitFree() Q_DECL_NOTHROW { return false; }
+ static inline Q_DECL_CONSTEXPR bool isFetchAndAddNative() noexcept { return isTestAndSetNative(); }
+ static inline Q_DECL_CONSTEXPR bool isFetchAndAddWaitFree() noexcept { return false; }
template <typename T> static inline
- T fetchAndAddRelaxed(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
+ T fetchAndAddRelaxed(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) noexcept
{
return _q_value.fetch_add(valueToAdd, std::memory_order_relaxed);
}
template <typename T> static inline
- T fetchAndAddAcquire(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
+ T fetchAndAddAcquire(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) noexcept
{
return _q_value.fetch_add(valueToAdd, std::memory_order_acquire);
}
template <typename T> static inline
- T fetchAndAddRelease(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
+ T fetchAndAddRelease(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) noexcept
{
return _q_value.fetch_add(valueToAdd, std::memory_order_release);
}
template <typename T> static inline
- T fetchAndAddOrdered(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
+ T fetchAndAddOrdered(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) noexcept
{
return _q_value.fetch_add(valueToAdd, std::memory_order_acq_rel);
}
template <typename T> static inline
- T fetchAndSubRelaxed(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
+ T fetchAndSubRelaxed(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) noexcept
{
return _q_value.fetch_sub(valueToAdd, std::memory_order_relaxed);
}
template <typename T> static inline
- T fetchAndSubAcquire(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
+ T fetchAndSubAcquire(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) noexcept
{
return _q_value.fetch_sub(valueToAdd, std::memory_order_acquire);
}
template <typename T> static inline
- T fetchAndSubRelease(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
+ T fetchAndSubRelease(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) noexcept
{
return _q_value.fetch_sub(valueToAdd, std::memory_order_release);
}
template <typename T> static inline
- T fetchAndSubOrdered(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
+ T fetchAndSubOrdered(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) noexcept
{
return _q_value.fetch_sub(valueToAdd, std::memory_order_acq_rel);
}
template <typename T> static inline
- T fetchAndAndRelaxed(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
+ T fetchAndAndRelaxed(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) noexcept
{
return _q_value.fetch_and(valueToAdd, std::memory_order_relaxed);
}
template <typename T> static inline
- T fetchAndAndAcquire(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
+ T fetchAndAndAcquire(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) noexcept
{
return _q_value.fetch_and(valueToAdd, std::memory_order_acquire);
}
template <typename T> static inline
- T fetchAndAndRelease(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
+ T fetchAndAndRelease(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) noexcept
{
return _q_value.fetch_and(valueToAdd, std::memory_order_release);
}
template <typename T> static inline
- T fetchAndAndOrdered(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
+ T fetchAndAndOrdered(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) noexcept
{
return _q_value.fetch_and(valueToAdd, std::memory_order_acq_rel);
}
template <typename T> static inline
- T fetchAndOrRelaxed(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
+ T fetchAndOrRelaxed(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) noexcept
{
return _q_value.fetch_or(valueToAdd, std::memory_order_relaxed);
}
template <typename T> static inline
- T fetchAndOrAcquire(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
+ T fetchAndOrAcquire(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) noexcept
{
return _q_value.fetch_or(valueToAdd, std::memory_order_acquire);
}
template <typename T> static inline
- T fetchAndOrRelease(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
+ T fetchAndOrRelease(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) noexcept
{
return _q_value.fetch_or(valueToAdd, std::memory_order_release);
}
template <typename T> static inline
- T fetchAndOrOrdered(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
+ T fetchAndOrOrdered(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) noexcept
{
return _q_value.fetch_or(valueToAdd, std::memory_order_acq_rel);
}
template <typename T> static inline
- T fetchAndXorRelaxed(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
+ T fetchAndXorRelaxed(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) noexcept
{
return _q_value.fetch_xor(valueToAdd, std::memory_order_relaxed);
}
template <typename T> static inline
- T fetchAndXorAcquire(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
+ T fetchAndXorAcquire(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) noexcept
{
return _q_value.fetch_xor(valueToAdd, std::memory_order_acquire);
}
template <typename T> static inline
- T fetchAndXorRelease(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
+ T fetchAndXorRelease(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) noexcept
{
return _q_value.fetch_xor(valueToAdd, std::memory_order_release);
}
template <typename T> static inline
- T fetchAndXorOrdered(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
+ T fetchAndXorOrdered(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) noexcept
{
return _q_value.fetch_xor(valueToAdd, std::memory_order_acq_rel);
}
diff --git a/src/corelib/thread/qatomic_msvc.h b/src/corelib/thread/qatomic_msvc.h
index 5eae2bdc48..67b5224cd7 100644
--- a/src/corelib/thread/qatomic_msvc.h
+++ b/src/corelib/thread/qatomic_msvc.h
@@ -269,24 +269,24 @@ template <> struct QAtomicWindowsType<4> { typedef long Type; };
template <int N> struct QAtomicOpsBySize : QGenericAtomicOps<QAtomicOpsBySize<N> >
{
- static inline Q_DECL_CONSTEXPR bool isReferenceCountingNative() Q_DECL_NOTHROW { return true; }
- static inline Q_DECL_CONSTEXPR bool isReferenceCountingWaitFree() Q_DECL_NOTHROW { return true; }
- template <typename T> static bool ref(T &_q_value) Q_DECL_NOTHROW;
- template <typename T> static bool deref(T &_q_value) Q_DECL_NOTHROW;
-
- static inline Q_DECL_CONSTEXPR bool isTestAndSetNative() Q_DECL_NOTHROW { return true; }
- static inline Q_DECL_CONSTEXPR bool isTestAndSetWaitFree() Q_DECL_NOTHROW { return true; }
- template <typename T> static bool testAndSetRelaxed(T &_q_value, T expectedValue, T newValue) Q_DECL_NOTHROW;
+ static inline Q_DECL_CONSTEXPR bool isReferenceCountingNative() noexcept { return true; }
+ static inline Q_DECL_CONSTEXPR bool isReferenceCountingWaitFree() noexcept { return true; }
+ template <typename T> static bool ref(T &_q_value) noexcept;
+ template <typename T> static bool deref(T &_q_value) noexcept;
+
+ static inline Q_DECL_CONSTEXPR bool isTestAndSetNative() noexcept { return true; }
+ static inline Q_DECL_CONSTEXPR bool isTestAndSetWaitFree() noexcept { return true; }
+ template <typename T> static bool testAndSetRelaxed(T &_q_value, T expectedValue, T newValue) noexcept;
template <typename T>
- static bool testAndSetRelaxed(T &_q_value, T expectedValue, T newValue, T *currentValue) Q_DECL_NOTHROW;
+ static bool testAndSetRelaxed(T &_q_value, T expectedValue, T newValue, T *currentValue) noexcept;
- static inline Q_DECL_CONSTEXPR bool isFetchAndStoreNative() Q_DECL_NOTHROW { return true; }
- static inline Q_DECL_CONSTEXPR bool isFetchAndStoreWaitFree() Q_DECL_NOTHROW { return true; }
- template <typename T> static T fetchAndStoreRelaxed(T &_q_value, T newValue) Q_DECL_NOTHROW;
+ static inline Q_DECL_CONSTEXPR bool isFetchAndStoreNative() noexcept { return true; }
+ static inline Q_DECL_CONSTEXPR bool isFetchAndStoreWaitFree() noexcept { return true; }
+ template <typename T> static T fetchAndStoreRelaxed(T &_q_value, T newValue) noexcept;
- static inline Q_DECL_CONSTEXPR bool isFetchAndAddNative() Q_DECL_NOTHROW { return true; }
- static inline Q_DECL_CONSTEXPR bool isFetchAndAddWaitFree() Q_DECL_NOTHROW { return true; }
- template <typename T> static T fetchAndAddRelaxed(T &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW;
+ static inline Q_DECL_CONSTEXPR bool isFetchAndAddNative() noexcept { return true; }
+ static inline Q_DECL_CONSTEXPR bool isFetchAndAddWaitFree() noexcept { return true; }
+ template <typename T> static T fetchAndAddRelaxed(T &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) noexcept;
private:
typedef typename QAtomicWindowsType<N>::Type Type;
@@ -303,76 +303,76 @@ struct QAtomicOps : QAtomicOpsBySize<sizeof(T)>
};
template<> template<typename T>
-inline bool QAtomicOpsBySize<4>::ref(T &_q_value) Q_DECL_NOTHROW
+inline bool QAtomicOpsBySize<4>::ref(T &_q_value) noexcept
{
return QT_INTERLOCKED_FUNCTION(Increment)(atomic(&_q_value)) != 0;
}
template<> template<typename T>
-inline bool QAtomicOpsBySize<4>::deref(T &_q_value) Q_DECL_NOTHROW
+inline bool QAtomicOpsBySize<4>::deref(T &_q_value) noexcept
{
return QT_INTERLOCKED_FUNCTION(Decrement)(atomic(&_q_value)) != 0;
}
template<> template<typename T>
-inline bool QAtomicOpsBySize<4>::testAndSetRelaxed(T &_q_value, T expectedValue, T newValue) Q_DECL_NOTHROW
+inline bool QAtomicOpsBySize<4>::testAndSetRelaxed(T &_q_value, T expectedValue, T newValue) noexcept
{
return QT_INTERLOCKED_FUNCTION(CompareExchange)(atomic(&_q_value), value(newValue), value(expectedValue)) == value(expectedValue);
}
template<> template <typename T>
-inline bool QAtomicOpsBySize<4>::testAndSetRelaxed(T &_q_value, T expectedValue, T newValue, T *currentValue) Q_DECL_NOTHROW
+inline bool QAtomicOpsBySize<4>::testAndSetRelaxed(T &_q_value, T expectedValue, T newValue, T *currentValue) noexcept
{
*currentValue = T(QT_INTERLOCKED_FUNCTION(CompareExchange)(atomic(&_q_value), newValue, expectedValue));
return *currentValue == expectedValue;
}
template<> template<typename T>
-inline T QAtomicOpsBySize<4>::fetchAndStoreRelaxed(T &_q_value, T newValue) Q_DECL_NOTHROW
+inline T QAtomicOpsBySize<4>::fetchAndStoreRelaxed(T &_q_value, T newValue) noexcept
{
return QT_INTERLOCKED_FUNCTION(Exchange)(atomic(&_q_value), value(newValue));
}
template<> template<typename T>
-inline T QAtomicOpsBySize<4>::fetchAndAddRelaxed(T &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
+inline T QAtomicOpsBySize<4>::fetchAndAddRelaxed(T &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) noexcept
{
return QT_INTERLOCKED_FUNCTION(ExchangeAdd)(atomic(&_q_value), value<T>(valueToAdd * QAtomicAdditiveType<T>::AddScale));
}
#ifdef Q_ATOMIC_INT16_IS_SUPPORTED
template<> template<typename T>
-inline bool QAtomicOpsBySize<2>::ref(T &_q_value) Q_DECL_NOTHROW
+inline bool QAtomicOpsBySize<2>::ref(T &_q_value) noexcept
{
return QT_INTERLOCKED_FUNCTION(Increment16)(atomic(&_q_value)) != 0;
}
template<> template<typename T>
-inline bool QAtomicOpsBySize<2>::deref(T &_q_value) Q_DECL_NOTHROW
+inline bool QAtomicOpsBySize<2>::deref(T &_q_value) noexcept
{
return QT_INTERLOCKED_FUNCTION(Decrement16)(atomic(&_q_value)) != 0;
}
template<> template<typename T>
-inline bool QAtomicOpsBySize<2>::testAndSetRelaxed(T &_q_value, T expectedValue, T newValue) Q_DECL_NOTHROW
+inline bool QAtomicOpsBySize<2>::testAndSetRelaxed(T &_q_value, T expectedValue, T newValue) noexcept
{
return QT_INTERLOCKED_FUNCTION(CompareExchange16)(atomic(&_q_value), value(newValue), value(expectedValue)) == value(expectedValue);
}
template<> template <typename T>
-inline bool QAtomicOpsBySize<2>::testAndSetRelaxed(T &_q_value, T expectedValue, T newValue, T *currentValue) Q_DECL_NOTHROW
+inline bool QAtomicOpsBySize<2>::testAndSetRelaxed(T &_q_value, T expectedValue, T newValue, T *currentValue) noexcept
{
*currentValue = T(QT_INTERLOCKED_FUNCTION(CompareExchange16)(atomic(&_q_value), newValue, expectedValue));
return *currentValue == expectedValue;
}
template<> template<typename T>
-inline T QAtomicOpsBySize<2>::fetchAndStoreRelaxed(T &_q_value, T newValue) Q_DECL_NOTHROW
+inline T QAtomicOpsBySize<2>::fetchAndStoreRelaxed(T &_q_value, T newValue) noexcept
{
return QT_INTERLOCKED_FUNCTION(Exchange16)(atomic(&_q_value), value(newValue));
}
template<> template<typename T>
-inline T QAtomicOpsBySize<2>::fetchAndAddRelaxed(T &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
+inline T QAtomicOpsBySize<2>::fetchAndAddRelaxed(T &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) noexcept
{
return QT_INTERLOCKED_FUNCTION(ExchangeAdd16)(atomic(&_q_value), value<T>(valueToAdd * QAtomicAdditiveType<T>::AddScale));
}
@@ -380,38 +380,38 @@ inline T QAtomicOpsBySize<2>::fetchAndAddRelaxed(T &_q_value, typename QAtomicAd
#ifdef Q_ATOMIC_INT64_IS_SUPPORTED
template<> template<typename T>
-inline bool QAtomicOpsBySize<8>::ref(T &_q_value) Q_DECL_NOTHROW
+inline bool QAtomicOpsBySize<8>::ref(T &_q_value) noexcept
{
return QT_INTERLOCKED_FUNCTION(Increment64)(atomic(&_q_value)) != 0;
}
template<> template<typename T>
-inline bool QAtomicOpsBySize<8>::deref(T &_q_value) Q_DECL_NOTHROW
+inline bool QAtomicOpsBySize<8>::deref(T &_q_value) noexcept
{
return QT_INTERLOCKED_FUNCTION(Decrement64)(atomic(&_q_value)) != 0;
}
template<> template<typename T>
-inline bool QAtomicOpsBySize<8>::testAndSetRelaxed(T &_q_value, T expectedValue, T newValue) Q_DECL_NOTHROW
+inline bool QAtomicOpsBySize<8>::testAndSetRelaxed(T &_q_value, T expectedValue, T newValue) noexcept
{
return QT_INTERLOCKED_FUNCTION(CompareExchange64)(atomic(&_q_value), value(newValue), value(expectedValue)) == value(expectedValue);
}
template<> template <typename T>
-inline bool QAtomicOpsBySize<8>::testAndSetRelaxed(T &_q_value, T expectedValue, T newValue, T *currentValue) Q_DECL_NOTHROW
+inline bool QAtomicOpsBySize<8>::testAndSetRelaxed(T &_q_value, T expectedValue, T newValue, T *currentValue) noexcept
{
*currentValue = T(QT_INTERLOCKED_FUNCTION(CompareExchange64)(atomic(&_q_value), newValue, expectedValue));
return *currentValue == expectedValue;
}
template<> template<typename T>
-inline T QAtomicOpsBySize<8>::fetchAndStoreRelaxed(T &_q_value, T newValue) Q_DECL_NOTHROW
+inline T QAtomicOpsBySize<8>::fetchAndStoreRelaxed(T &_q_value, T newValue) noexcept
{
return QT_INTERLOCKED_FUNCTION(Exchange64)(atomic(&_q_value), value(newValue));
}
template<> template<typename T>
-inline T QAtomicOpsBySize<8>::fetchAndAddRelaxed(T &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
+inline T QAtomicOpsBySize<8>::fetchAndAddRelaxed(T &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) noexcept
{
return QT_INTERLOCKED_FUNCTION(ExchangeAdd64)(atomic(&_q_value), value<T>(valueToAdd * QAtomicAdditiveType<T>::AddScale));
}
@@ -423,41 +423,41 @@ struct QAtomicOps<T *> : QGenericAtomicOps<QAtomicOps<T *> >
{
typedef T *Type;
- static inline Q_DECL_CONSTEXPR bool isTestAndSetNative() Q_DECL_NOTHROW { return true; }
- static inline Q_DECL_CONSTEXPR bool isTestAndSetWaitFree() Q_DECL_NOTHROW { return true; }
- static bool testAndSetRelaxed(T *&_q_value, T *expectedValue, T *newValue) Q_DECL_NOTHROW;
- static bool testAndSetRelaxed(T *&_q_value, T *expectedValue, T *newValue, T **currentValue) Q_DECL_NOTHROW;
+ static inline Q_DECL_CONSTEXPR bool isTestAndSetNative() noexcept { return true; }
+ static inline Q_DECL_CONSTEXPR bool isTestAndSetWaitFree() noexcept { return true; }
+ static bool testAndSetRelaxed(T *&_q_value, T *expectedValue, T *newValue) noexcept;
+ static bool testAndSetRelaxed(T *&_q_value, T *expectedValue, T *newValue, T **currentValue) noexcept;
- static inline Q_DECL_CONSTEXPR bool isFetchAndStoreNative() Q_DECL_NOTHROW { return true; }
- static inline Q_DECL_CONSTEXPR bool isFetchAndStoreWaitFree() Q_DECL_NOTHROW { return true; }
- static T *fetchAndStoreRelaxed(T *&_q_value, T *newValue) Q_DECL_NOTHROW;
+ static inline Q_DECL_CONSTEXPR bool isFetchAndStoreNative() noexcept { return true; }
+ static inline Q_DECL_CONSTEXPR bool isFetchAndStoreWaitFree() noexcept { return true; }
+ static T *fetchAndStoreRelaxed(T *&_q_value, T *newValue) noexcept;
- static inline Q_DECL_CONSTEXPR bool isFetchAndAddNative() Q_DECL_NOTHROW { return true; }
- static inline Q_DECL_CONSTEXPR bool isFetchAndAddWaitFree() Q_DECL_NOTHROW { return true; }
- static T *fetchAndAddRelaxed(T *&_q_value, qptrdiff valueToAdd) Q_DECL_NOTHROW;
+ static inline Q_DECL_CONSTEXPR bool isFetchAndAddNative() noexcept { return true; }
+ static inline Q_DECL_CONSTEXPR bool isFetchAndAddWaitFree() noexcept { return true; }
+ static T *fetchAndAddRelaxed(T *&_q_value, qptrdiff valueToAdd) noexcept;
};
template <typename T>
-inline bool QAtomicOps<T *>::testAndSetRelaxed(T *&_q_value, T *expectedValue, T *newValue) Q_DECL_NOTHROW
+inline bool QAtomicOps<T *>::testAndSetRelaxed(T *&_q_value, T *expectedValue, T *newValue) noexcept
{
return QT_INTERLOCKED_COMPARE_EXCHANGE_POINTER(&_q_value, newValue, expectedValue) == expectedValue;
}
template <typename T>
-inline bool QAtomicOps<T *>::testAndSetRelaxed(T *&_q_value, T *expectedValue, T *newValue, T **currentValue) Q_DECL_NOTHROW
+inline bool QAtomicOps<T *>::testAndSetRelaxed(T *&_q_value, T *expectedValue, T *newValue, T **currentValue) noexcept
{
*currentValue = reinterpret_cast<T *>(QT_INTERLOCKED_COMPARE_EXCHANGE_POINTER(&_q_value, newValue, expectedValue));
return *currentValue == expectedValue;
}
template <typename T>
-inline T *QAtomicOps<T *>::fetchAndStoreRelaxed(T *&_q_value, T *newValue) Q_DECL_NOTHROW
+inline T *QAtomicOps<T *>::fetchAndStoreRelaxed(T *&_q_value, T *newValue) noexcept
{
return reinterpret_cast<T *>(QT_INTERLOCKED_EXCHANGE_POINTER(&_q_value, newValue));
}
template <typename T>
-inline T *QAtomicOps<T *>::fetchAndAddRelaxed(T *&_q_value, qptrdiff valueToAdd) Q_DECL_NOTHROW
+inline T *QAtomicOps<T *>::fetchAndAddRelaxed(T *&_q_value, qptrdiff valueToAdd) noexcept
{
return reinterpret_cast<T *>(QT_INTERLOCKED_EXCHANGE_ADD_POINTER(&_q_value, valueToAdd * sizeof(T)));
}
diff --git a/src/corelib/thread/qbasicatomic.h b/src/corelib/thread/qbasicatomic.h
index a0304697b8..ad6cba04dd 100644
--- a/src/corelib/thread/qbasicatomic.h
+++ b/src/corelib/thread/qbasicatomic.h
@@ -100,125 +100,125 @@ public:
// Everything below is either implemented in ../arch/qatomic_XXX.h or (as fallback) in qgenericatomic.h
- T load() const Q_DECL_NOTHROW { return Ops::load(_q_value); }
- void store(T newValue) Q_DECL_NOTHROW { Ops::store(_q_value, newValue); }
+ T load() const noexcept { return Ops::load(_q_value); }
+ void store(T newValue) noexcept { Ops::store(_q_value, newValue); }
- T loadAcquire() const Q_DECL_NOTHROW { return Ops::loadAcquire(_q_value); }
- void storeRelease(T newValue) Q_DECL_NOTHROW { Ops::storeRelease(_q_value, newValue); }
- operator T() const Q_DECL_NOTHROW { return loadAcquire(); }
- T operator=(T newValue) Q_DECL_NOTHROW { storeRelease(newValue); return newValue; }
+ T loadAcquire() const noexcept { return Ops::loadAcquire(_q_value); }
+ void storeRelease(T newValue) noexcept { Ops::storeRelease(_q_value, newValue); }
+ operator T() const noexcept { return loadAcquire(); }
+ T operator=(T newValue) noexcept { storeRelease(newValue); return newValue; }
- static Q_DECL_CONSTEXPR bool isReferenceCountingNative() Q_DECL_NOTHROW { return Ops::isReferenceCountingNative(); }
- static Q_DECL_CONSTEXPR bool isReferenceCountingWaitFree() Q_DECL_NOTHROW { return Ops::isReferenceCountingWaitFree(); }
+ static Q_DECL_CONSTEXPR bool isReferenceCountingNative() noexcept { return Ops::isReferenceCountingNative(); }
+ static Q_DECL_CONSTEXPR bool isReferenceCountingWaitFree() noexcept { return Ops::isReferenceCountingWaitFree(); }
- bool ref() Q_DECL_NOTHROW { return Ops::ref(_q_value); }
- bool deref() Q_DECL_NOTHROW { return Ops::deref(_q_value); }
+ bool ref() noexcept { return Ops::ref(_q_value); }
+ bool deref() noexcept { return Ops::deref(_q_value); }
- static Q_DECL_CONSTEXPR bool isTestAndSetNative() Q_DECL_NOTHROW { return Ops::isTestAndSetNative(); }
- static Q_DECL_CONSTEXPR bool isTestAndSetWaitFree() Q_DECL_NOTHROW { return Ops::isTestAndSetWaitFree(); }
+ static Q_DECL_CONSTEXPR bool isTestAndSetNative() noexcept { return Ops::isTestAndSetNative(); }
+ static Q_DECL_CONSTEXPR bool isTestAndSetWaitFree() noexcept { return Ops::isTestAndSetWaitFree(); }
- bool testAndSetRelaxed(T expectedValue, T newValue) Q_DECL_NOTHROW
+ bool testAndSetRelaxed(T expectedValue, T newValue) noexcept
{ return Ops::testAndSetRelaxed(_q_value, expectedValue, newValue); }
- bool testAndSetAcquire(T expectedValue, T newValue) Q_DECL_NOTHROW
+ bool testAndSetAcquire(T expectedValue, T newValue) noexcept
{ return Ops::testAndSetAcquire(_q_value, expectedValue, newValue); }
- bool testAndSetRelease(T expectedValue, T newValue) Q_DECL_NOTHROW
+ bool testAndSetRelease(T expectedValue, T newValue) noexcept
{ return Ops::testAndSetRelease(_q_value, expectedValue, newValue); }
- bool testAndSetOrdered(T expectedValue, T newValue) Q_DECL_NOTHROW
+ bool testAndSetOrdered(T expectedValue, T newValue) noexcept
{ return Ops::testAndSetOrdered(_q_value, expectedValue, newValue); }
- bool testAndSetRelaxed(T expectedValue, T newValue, T &currentValue) Q_DECL_NOTHROW
+ bool testAndSetRelaxed(T expectedValue, T newValue, T &currentValue) noexcept
{ return Ops::testAndSetRelaxed(_q_value, expectedValue, newValue, &currentValue); }
- bool testAndSetAcquire(T expectedValue, T newValue, T &currentValue) Q_DECL_NOTHROW
+ bool testAndSetAcquire(T expectedValue, T newValue, T &currentValue) noexcept
{ return Ops::testAndSetAcquire(_q_value, expectedValue, newValue, &currentValue); }
- bool testAndSetRelease(T expectedValue, T newValue, T &currentValue) Q_DECL_NOTHROW
+ bool testAndSetRelease(T expectedValue, T newValue, T &currentValue) noexcept
{ return Ops::testAndSetRelease(_q_value, expectedValue, newValue, &currentValue); }
- bool testAndSetOrdered(T expectedValue, T newValue, T &currentValue) Q_DECL_NOTHROW
+ bool testAndSetOrdered(T expectedValue, T newValue, T &currentValue) noexcept
{ return Ops::testAndSetOrdered(_q_value, expectedValue, newValue, &currentValue); }
- static Q_DECL_CONSTEXPR bool isFetchAndStoreNative() Q_DECL_NOTHROW { return Ops::isFetchAndStoreNative(); }
- static Q_DECL_CONSTEXPR bool isFetchAndStoreWaitFree() Q_DECL_NOTHROW { return Ops::isFetchAndStoreWaitFree(); }
+ static Q_DECL_CONSTEXPR bool isFetchAndStoreNative() noexcept { return Ops::isFetchAndStoreNative(); }
+ static Q_DECL_CONSTEXPR bool isFetchAndStoreWaitFree() noexcept { return Ops::isFetchAndStoreWaitFree(); }
- T fetchAndStoreRelaxed(T newValue) Q_DECL_NOTHROW
+ T fetchAndStoreRelaxed(T newValue) noexcept
{ return Ops::fetchAndStoreRelaxed(_q_value, newValue); }
- T fetchAndStoreAcquire(T newValue) Q_DECL_NOTHROW
+ T fetchAndStoreAcquire(T newValue) noexcept
{ return Ops::fetchAndStoreAcquire(_q_value, newValue); }
- T fetchAndStoreRelease(T newValue) Q_DECL_NOTHROW
+ T fetchAndStoreRelease(T newValue) noexcept
{ return Ops::fetchAndStoreRelease(_q_value, newValue); }
- T fetchAndStoreOrdered(T newValue) Q_DECL_NOTHROW
+ T fetchAndStoreOrdered(T newValue) noexcept
{ return Ops::fetchAndStoreOrdered(_q_value, newValue); }
- static Q_DECL_CONSTEXPR bool isFetchAndAddNative() Q_DECL_NOTHROW { return Ops::isFetchAndAddNative(); }
- static Q_DECL_CONSTEXPR bool isFetchAndAddWaitFree() Q_DECL_NOTHROW { return Ops::isFetchAndAddWaitFree(); }
+ static Q_DECL_CONSTEXPR bool isFetchAndAddNative() noexcept { return Ops::isFetchAndAddNative(); }
+ static Q_DECL_CONSTEXPR bool isFetchAndAddWaitFree() noexcept { return Ops::isFetchAndAddWaitFree(); }
- T fetchAndAddRelaxed(T valueToAdd) Q_DECL_NOTHROW
+ T fetchAndAddRelaxed(T valueToAdd) noexcept
{ return Ops::fetchAndAddRelaxed(_q_value, valueToAdd); }
- T fetchAndAddAcquire(T valueToAdd) Q_DECL_NOTHROW
+ T fetchAndAddAcquire(T valueToAdd) noexcept
{ return Ops::fetchAndAddAcquire(_q_value, valueToAdd); }
- T fetchAndAddRelease(T valueToAdd) Q_DECL_NOTHROW
+ T fetchAndAddRelease(T valueToAdd) noexcept
{ return Ops::fetchAndAddRelease(_q_value, valueToAdd); }
- T fetchAndAddOrdered(T valueToAdd) Q_DECL_NOTHROW
+ T fetchAndAddOrdered(T valueToAdd) noexcept
{ return Ops::fetchAndAddOrdered(_q_value, valueToAdd); }
- T fetchAndSubRelaxed(T valueToAdd) Q_DECL_NOTHROW
+ T fetchAndSubRelaxed(T valueToAdd) noexcept
{ return Ops::fetchAndSubRelaxed(_q_value, valueToAdd); }
- T fetchAndSubAcquire(T valueToAdd) Q_DECL_NOTHROW
+ T fetchAndSubAcquire(T valueToAdd) noexcept
{ return Ops::fetchAndSubAcquire(_q_value, valueToAdd); }
- T fetchAndSubRelease(T valueToAdd) Q_DECL_NOTHROW
+ T fetchAndSubRelease(T valueToAdd) noexcept
{ return Ops::fetchAndSubRelease(_q_value, valueToAdd); }
- T fetchAndSubOrdered(T valueToAdd) Q_DECL_NOTHROW
+ T fetchAndSubOrdered(T valueToAdd) noexcept
{ return Ops::fetchAndSubOrdered(_q_value, valueToAdd); }
- T fetchAndAndRelaxed(T valueToAdd) Q_DECL_NOTHROW
+ T fetchAndAndRelaxed(T valueToAdd) noexcept
{ return Ops::fetchAndAndRelaxed(_q_value, valueToAdd); }
- T fetchAndAndAcquire(T valueToAdd) Q_DECL_NOTHROW
+ T fetchAndAndAcquire(T valueToAdd) noexcept
{ return Ops::fetchAndAndAcquire(_q_value, valueToAdd); }
- T fetchAndAndRelease(T valueToAdd) Q_DECL_NOTHROW
+ T fetchAndAndRelease(T valueToAdd) noexcept
{ return Ops::fetchAndAndRelease(_q_value, valueToAdd); }
- T fetchAndAndOrdered(T valueToAdd) Q_DECL_NOTHROW
+ T fetchAndAndOrdered(T valueToAdd) noexcept
{ return Ops::fetchAndAndOrdered(_q_value, valueToAdd); }
- T fetchAndOrRelaxed(T valueToAdd) Q_DECL_NOTHROW
+ T fetchAndOrRelaxed(T valueToAdd) noexcept
{ return Ops::fetchAndOrRelaxed(_q_value, valueToAdd); }
- T fetchAndOrAcquire(T valueToAdd) Q_DECL_NOTHROW
+ T fetchAndOrAcquire(T valueToAdd) noexcept
{ return Ops::fetchAndOrAcquire(_q_value, valueToAdd); }
- T fetchAndOrRelease(T valueToAdd) Q_DECL_NOTHROW
+ T fetchAndOrRelease(T valueToAdd) noexcept
{ return Ops::fetchAndOrRelease(_q_value, valueToAdd); }
- T fetchAndOrOrdered(T valueToAdd) Q_DECL_NOTHROW
+ T fetchAndOrOrdered(T valueToAdd) noexcept
{ return Ops::fetchAndOrOrdered(_q_value, valueToAdd); }
- T fetchAndXorRelaxed(T valueToAdd) Q_DECL_NOTHROW
+ T fetchAndXorRelaxed(T valueToAdd) noexcept
{ return Ops::fetchAndXorRelaxed(_q_value, valueToAdd); }
- T fetchAndXorAcquire(T valueToAdd) Q_DECL_NOTHROW
+ T fetchAndXorAcquire(T valueToAdd) noexcept
{ return Ops::fetchAndXorAcquire(_q_value, valueToAdd); }
- T fetchAndXorRelease(T valueToAdd) Q_DECL_NOTHROW
+ T fetchAndXorRelease(T valueToAdd) noexcept
{ return Ops::fetchAndXorRelease(_q_value, valueToAdd); }
- T fetchAndXorOrdered(T valueToAdd) Q_DECL_NOTHROW
+ T fetchAndXorOrdered(T valueToAdd) noexcept
{ return Ops::fetchAndXorOrdered(_q_value, valueToAdd); }
- T operator++() Q_DECL_NOTHROW
+ T operator++() noexcept
{ return fetchAndAddOrdered(1) + 1; }
- T operator++(int) Q_DECL_NOTHROW
+ T operator++(int) noexcept
{ return fetchAndAddOrdered(1); }
- T operator--() Q_DECL_NOTHROW
+ T operator--() noexcept
{ return fetchAndSubOrdered(1) - 1; }
- T operator--(int) Q_DECL_NOTHROW
+ T operator--(int) noexcept
{ return fetchAndSubOrdered(1); }
- T operator+=(T v) Q_DECL_NOTHROW
+ T operator+=(T v) noexcept
{ return fetchAndAddOrdered(v) + v; }
- T operator-=(T v) Q_DECL_NOTHROW
+ T operator-=(T v) noexcept
{ return fetchAndSubOrdered(v) - v; }
- T operator&=(T v) Q_DECL_NOTHROW
+ T operator&=(T v) noexcept
{ return fetchAndAndOrdered(v) & v; }
- T operator|=(T v) Q_DECL_NOTHROW
+ T operator|=(T v) noexcept
{ return fetchAndOrOrdered(v) | v; }
- T operator^=(T v) Q_DECL_NOTHROW
+ T operator^=(T v) noexcept
{ return fetchAndXorOrdered(v) ^ v; }
#ifdef QT_BASIC_ATOMIC_HAS_CONSTRUCTORS
QBasicAtomicInteger() = default;
- constexpr QBasicAtomicInteger(T value) Q_DECL_NOTHROW : _q_value(value) {}
+ constexpr QBasicAtomicInteger(T value) noexcept : _q_value(value) {}
QBasicAtomicInteger(const QBasicAtomicInteger &) = delete;
QBasicAtomicInteger &operator=(const QBasicAtomicInteger &) = delete;
QBasicAtomicInteger &operator=(const QBasicAtomicInteger &) volatile = delete;
@@ -236,85 +236,85 @@ public:
AtomicType _q_value;
- Type load() const Q_DECL_NOTHROW { return Ops::load(_q_value); }
- void store(Type newValue) Q_DECL_NOTHROW { Ops::store(_q_value, newValue); }
- operator Type() const Q_DECL_NOTHROW { return loadAcquire(); }
- Type operator=(Type newValue) Q_DECL_NOTHROW { storeRelease(newValue); return newValue; }
+ Type load() const noexcept { return Ops::load(_q_value); }
+ void store(Type newValue) noexcept { Ops::store(_q_value, newValue); }
+ operator Type() const noexcept { return loadAcquire(); }
+ Type operator=(Type newValue) noexcept { storeRelease(newValue); return newValue; }
// Atomic API, implemented in qatomic_XXX.h
- Type loadAcquire() const Q_DECL_NOTHROW { return Ops::loadAcquire(_q_value); }
- void storeRelease(Type newValue) Q_DECL_NOTHROW { Ops::storeRelease(_q_value, newValue); }
+ Type loadAcquire() const noexcept { return Ops::loadAcquire(_q_value); }
+ void storeRelease(Type newValue) noexcept { Ops::storeRelease(_q_value, newValue); }
- static Q_DECL_CONSTEXPR bool isTestAndSetNative() Q_DECL_NOTHROW { return Ops::isTestAndSetNative(); }
- static Q_DECL_CONSTEXPR bool isTestAndSetWaitFree() Q_DECL_NOTHROW { return Ops::isTestAndSetWaitFree(); }
+ static Q_DECL_CONSTEXPR bool isTestAndSetNative() noexcept { return Ops::isTestAndSetNative(); }
+ static Q_DECL_CONSTEXPR bool isTestAndSetWaitFree() noexcept { return Ops::isTestAndSetWaitFree(); }
- bool testAndSetRelaxed(Type expectedValue, Type newValue) Q_DECL_NOTHROW
+ bool testAndSetRelaxed(Type expectedValue, Type newValue) noexcept
{ return Ops::testAndSetRelaxed(_q_value, expectedValue, newValue); }
- bool testAndSetAcquire(Type expectedValue, Type newValue) Q_DECL_NOTHROW
+ bool testAndSetAcquire(Type expectedValue, Type newValue) noexcept
{ return Ops::testAndSetAcquire(_q_value, expectedValue, newValue); }
- bool testAndSetRelease(Type expectedValue, Type newValue) Q_DECL_NOTHROW
+ bool testAndSetRelease(Type expectedValue, Type newValue) noexcept
{ return Ops::testAndSetRelease(_q_value, expectedValue, newValue); }
- bool testAndSetOrdered(Type expectedValue, Type newValue) Q_DECL_NOTHROW
+ bool testAndSetOrdered(Type expectedValue, Type newValue) noexcept
{ return Ops::testAndSetOrdered(_q_value, expectedValue, newValue); }
- bool testAndSetRelaxed(Type expectedValue, Type newValue, Type &currentValue) Q_DECL_NOTHROW
+ bool testAndSetRelaxed(Type expectedValue, Type newValue, Type &currentValue) noexcept
{ return Ops::testAndSetRelaxed(_q_value, expectedValue, newValue, &currentValue); }
- bool testAndSetAcquire(Type expectedValue, Type newValue, Type &currentValue) Q_DECL_NOTHROW
+ bool testAndSetAcquire(Type expectedValue, Type newValue, Type &currentValue) noexcept
{ return Ops::testAndSetAcquire(_q_value, expectedValue, newValue, &currentValue); }
- bool testAndSetRelease(Type expectedValue, Type newValue, Type &currentValue) Q_DECL_NOTHROW
+ bool testAndSetRelease(Type expectedValue, Type newValue, Type &currentValue) noexcept
{ return Ops::testAndSetRelease(_q_value, expectedValue, newValue, &currentValue); }
- bool testAndSetOrdered(Type expectedValue, Type newValue, Type &currentValue) Q_DECL_NOTHROW
+ bool testAndSetOrdered(Type expectedValue, Type newValue, Type &currentValue) noexcept
{ return Ops::testAndSetOrdered(_q_value, expectedValue, newValue, &currentValue); }
- static Q_DECL_CONSTEXPR bool isFetchAndStoreNative() Q_DECL_NOTHROW { return Ops::isFetchAndStoreNative(); }
- static Q_DECL_CONSTEXPR bool isFetchAndStoreWaitFree() Q_DECL_NOTHROW { return Ops::isFetchAndStoreWaitFree(); }
+ static Q_DECL_CONSTEXPR bool isFetchAndStoreNative() noexcept { return Ops::isFetchAndStoreNative(); }
+ static Q_DECL_CONSTEXPR bool isFetchAndStoreWaitFree() noexcept { return Ops::isFetchAndStoreWaitFree(); }
- Type fetchAndStoreRelaxed(Type newValue) Q_DECL_NOTHROW
+ Type fetchAndStoreRelaxed(Type newValue) noexcept
{ return Ops::fetchAndStoreRelaxed(_q_value, newValue); }
- Type fetchAndStoreAcquire(Type newValue) Q_DECL_NOTHROW
+ Type fetchAndStoreAcquire(Type newValue) noexcept
{ return Ops::fetchAndStoreAcquire(_q_value, newValue); }
- Type fetchAndStoreRelease(Type newValue) Q_DECL_NOTHROW
+ Type fetchAndStoreRelease(Type newValue) noexcept
{ return Ops::fetchAndStoreRelease(_q_value, newValue); }
- Type fetchAndStoreOrdered(Type newValue) Q_DECL_NOTHROW
+ Type fetchAndStoreOrdered(Type newValue) noexcept
{ return Ops::fetchAndStoreOrdered(_q_value, newValue); }
- static Q_DECL_CONSTEXPR bool isFetchAndAddNative() Q_DECL_NOTHROW { return Ops::isFetchAndAddNative(); }
- static Q_DECL_CONSTEXPR bool isFetchAndAddWaitFree() Q_DECL_NOTHROW { return Ops::isFetchAndAddWaitFree(); }
+ static Q_DECL_CONSTEXPR bool isFetchAndAddNative() noexcept { return Ops::isFetchAndAddNative(); }
+ static Q_DECL_CONSTEXPR bool isFetchAndAddWaitFree() noexcept { return Ops::isFetchAndAddWaitFree(); }
- Type fetchAndAddRelaxed(qptrdiff valueToAdd) Q_DECL_NOTHROW
+ Type fetchAndAddRelaxed(qptrdiff valueToAdd) noexcept
{ return Ops::fetchAndAddRelaxed(_q_value, valueToAdd); }
- Type fetchAndAddAcquire(qptrdiff valueToAdd) Q_DECL_NOTHROW
+ Type fetchAndAddAcquire(qptrdiff valueToAdd) noexcept
{ return Ops::fetchAndAddAcquire(_q_value, valueToAdd); }
- Type fetchAndAddRelease(qptrdiff valueToAdd) Q_DECL_NOTHROW
+ Type fetchAndAddRelease(qptrdiff valueToAdd) noexcept
{ return Ops::fetchAndAddRelease(_q_value, valueToAdd); }
- Type fetchAndAddOrdered(qptrdiff valueToAdd) Q_DECL_NOTHROW
+ Type fetchAndAddOrdered(qptrdiff valueToAdd) noexcept
{ return Ops::fetchAndAddOrdered(_q_value, valueToAdd); }
- Type fetchAndSubRelaxed(qptrdiff valueToAdd) Q_DECL_NOTHROW
+ Type fetchAndSubRelaxed(qptrdiff valueToAdd) noexcept
{ return Ops::fetchAndSubRelaxed(_q_value, valueToAdd); }
- Type fetchAndSubAcquire(qptrdiff valueToAdd) Q_DECL_NOTHROW
+ Type fetchAndSubAcquire(qptrdiff valueToAdd) noexcept
{ return Ops::fetchAndSubAcquire(_q_value, valueToAdd); }
- Type fetchAndSubRelease(qptrdiff valueToAdd) Q_DECL_NOTHROW
+ Type fetchAndSubRelease(qptrdiff valueToAdd) noexcept
{ return Ops::fetchAndSubRelease(_q_value, valueToAdd); }
- Type fetchAndSubOrdered(qptrdiff valueToAdd) Q_DECL_NOTHROW
+ Type fetchAndSubOrdered(qptrdiff valueToAdd) noexcept
{ return Ops::fetchAndSubOrdered(_q_value, valueToAdd); }
- Type operator++() Q_DECL_NOTHROW
+ Type operator++() noexcept
{ return fetchAndAddOrdered(1) + 1; }
- Type operator++(int) Q_DECL_NOTHROW
+ Type operator++(int) noexcept
{ return fetchAndAddOrdered(1); }
- Type operator--() Q_DECL_NOTHROW
+ Type operator--() noexcept
{ return fetchAndSubOrdered(1) - 1; }
- Type operator--(int) Q_DECL_NOTHROW
+ Type operator--(int) noexcept
{ return fetchAndSubOrdered(1); }
- Type operator+=(qptrdiff valueToAdd) Q_DECL_NOTHROW
+ Type operator+=(qptrdiff valueToAdd) noexcept
{ return fetchAndAddOrdered(valueToAdd) + valueToAdd; }
- Type operator-=(qptrdiff valueToSub) Q_DECL_NOTHROW
+ Type operator-=(qptrdiff valueToSub) noexcept
{ return fetchAndSubOrdered(valueToSub) - valueToSub; }
#ifdef QT_BASIC_ATOMIC_HAS_CONSTRUCTORS
QBasicAtomicPointer() = default;
- constexpr QBasicAtomicPointer(Type value) Q_DECL_NOTHROW : _q_value(value) {}
+ constexpr QBasicAtomicPointer(Type value) noexcept : _q_value(value) {}
QBasicAtomicPointer(const QBasicAtomicPointer &) = delete;
QBasicAtomicPointer &operator=(const QBasicAtomicPointer &) = delete;
QBasicAtomicPointer &operator=(const QBasicAtomicPointer &) volatile = delete;
diff --git a/src/corelib/thread/qfutex_p.h b/src/corelib/thread/qfutex_p.h
index 483664c783..136f6bca8c 100644
--- a/src/corelib/thread/qfutex_p.h
+++ b/src/corelib/thread/qfutex_p.h
@@ -85,7 +85,7 @@ QT_BEGIN_NAMESPACE
namespace QtLinuxFutex {
constexpr inline bool futexAvailable() { return true; }
inline int _q_futex(int *addr, int op, int val, quintptr val2 = 0,
- int *addr2 = nullptr, int val3 = 0) Q_DECL_NOTHROW
+ int *addr2 = nullptr, int val3 = 0) noexcept
{
// we use __NR_futex because some libcs (like Android's bionic) don't
// provide SYS_futex etc.
diff --git a/src/corelib/thread/qgenericatomic.h b/src/corelib/thread/qgenericatomic.h
index 89c4fe9a11..f8333e7de6 100644
--- a/src/corelib/thread/qgenericatomic.h
+++ b/src/corelib/thread/qgenericatomic.h
@@ -72,32 +72,32 @@ template <typename BaseClass> struct QGenericAtomicOps
{
template <typename T> struct AtomicType { typedef T Type; typedef T *PointerType; };
- template <typename T> static void acquireMemoryFence(const T &_q_value) Q_DECL_NOTHROW
+ template <typename T> static void acquireMemoryFence(const T &_q_value) noexcept
{
BaseClass::orderedMemoryFence(_q_value);
}
- template <typename T> static void releaseMemoryFence(const T &_q_value) Q_DECL_NOTHROW
+ template <typename T> static void releaseMemoryFence(const T &_q_value) noexcept
{
BaseClass::orderedMemoryFence(_q_value);
}
- template <typename T> static void orderedMemoryFence(const T &) Q_DECL_NOTHROW
+ template <typename T> static void orderedMemoryFence(const T &) noexcept
{
}
template <typename T> static Q_ALWAYS_INLINE
- T load(const T &_q_value) Q_DECL_NOTHROW
+ T load(const T &_q_value) noexcept
{
return _q_value;
}
template <typename T, typename X> static Q_ALWAYS_INLINE
- void store(T &_q_value, X newValue) Q_DECL_NOTHROW
+ void store(T &_q_value, X newValue) noexcept
{
_q_value = newValue;
}
template <typename T> static Q_ALWAYS_INLINE
- T loadAcquire(const T &_q_value) Q_DECL_NOTHROW
+ T loadAcquire(const T &_q_value) noexcept
{
T tmp = *static_cast<const volatile T *>(&_q_value);
BaseClass::acquireMemoryFence(_q_value);
@@ -105,24 +105,24 @@ template <typename BaseClass> struct QGenericAtomicOps
}
template <typename T, typename X> static Q_ALWAYS_INLINE
- void storeRelease(T &_q_value, X newValue) Q_DECL_NOTHROW
+ void storeRelease(T &_q_value, X newValue) noexcept
{
BaseClass::releaseMemoryFence(_q_value);
*static_cast<volatile T *>(&_q_value) = newValue;
}
- static inline Q_DECL_CONSTEXPR bool isReferenceCountingNative() Q_DECL_NOTHROW
+ static inline Q_DECL_CONSTEXPR bool isReferenceCountingNative() noexcept
{ return BaseClass::isFetchAndAddNative(); }
- static inline Q_DECL_CONSTEXPR bool isReferenceCountingWaitFree() Q_DECL_NOTHROW
+ static inline Q_DECL_CONSTEXPR bool isReferenceCountingWaitFree() noexcept
{ return BaseClass::isFetchAndAddWaitFree(); }
template <typename T> static Q_ALWAYS_INLINE
- bool ref(T &_q_value) Q_DECL_NOTHROW
+ bool ref(T &_q_value) noexcept
{
return BaseClass::fetchAndAddRelaxed(_q_value, 1) != T(-1);
}
template <typename T> static Q_ALWAYS_INLINE
- bool deref(T &_q_value) Q_DECL_NOTHROW
+ bool deref(T &_q_value) noexcept
{
return BaseClass::fetchAndAddRelaxed(_q_value, -1) != 1;
}
@@ -130,16 +130,16 @@ template <typename BaseClass> struct QGenericAtomicOps
#if 0
// These functions have no default implementation
// Archictectures must implement them
- static inline Q_DECL_CONSTEXPR bool isTestAndSetNative() Q_DECL_NOTHROW;
- static inline Q_DECL_CONSTEXPR bool isTestAndSetWaitFree() Q_DECL_NOTHROW;
+ static inline Q_DECL_CONSTEXPR bool isTestAndSetNative() noexcept;
+ static inline Q_DECL_CONSTEXPR bool isTestAndSetWaitFree() noexcept;
template <typename T, typename X> static inline
- bool testAndSetRelaxed(T &_q_value, X expectedValue, X newValue) Q_DECL_NOTHROW;
+ bool testAndSetRelaxed(T &_q_value, X expectedValue, X newValue) noexcept;
template <typename T, typename X> static inline
- bool testAndSetRelaxed(T &_q_value, X expectedValue, X newValue, X *currentValue) Q_DECL_NOTHROW;
+ bool testAndSetRelaxed(T &_q_value, X expectedValue, X newValue, X *currentValue) noexcept;
#endif
template <typename T, typename X> static Q_ALWAYS_INLINE
- bool testAndSetAcquire(T &_q_value, X expectedValue, X newValue) Q_DECL_NOTHROW
+ bool testAndSetAcquire(T &_q_value, X expectedValue, X newValue) noexcept
{
bool tmp = BaseClass::testAndSetRelaxed(_q_value, expectedValue, newValue);
BaseClass::acquireMemoryFence(_q_value);
@@ -147,21 +147,21 @@ template <typename BaseClass> struct QGenericAtomicOps
}
template <typename T, typename X> static Q_ALWAYS_INLINE
- bool testAndSetRelease(T &_q_value, X expectedValue, X newValue) Q_DECL_NOTHROW
+ bool testAndSetRelease(T &_q_value, X expectedValue, X newValue) noexcept
{
BaseClass::releaseMemoryFence(_q_value);
return BaseClass::testAndSetRelaxed(_q_value, expectedValue, newValue);
}
template <typename T, typename X> static Q_ALWAYS_INLINE
- bool testAndSetOrdered(T &_q_value, X expectedValue, X newValue) Q_DECL_NOTHROW
+ bool testAndSetOrdered(T &_q_value, X expectedValue, X newValue) noexcept
{
BaseClass::orderedMemoryFence(_q_value);
return BaseClass::testAndSetRelaxed(_q_value, expectedValue, newValue);
}
template <typename T, typename X> static Q_ALWAYS_INLINE
- bool testAndSetAcquire(T &_q_value, X expectedValue, X newValue, X *currentValue) Q_DECL_NOTHROW
+ bool testAndSetAcquire(T &_q_value, X expectedValue, X newValue, X *currentValue) noexcept
{
bool tmp = BaseClass::testAndSetRelaxed(_q_value, expectedValue, newValue, currentValue);
BaseClass::acquireMemoryFence(_q_value);
@@ -169,24 +169,24 @@ template <typename BaseClass> struct QGenericAtomicOps
}
template <typename T, typename X> static Q_ALWAYS_INLINE
- bool testAndSetRelease(T &_q_value, X expectedValue, X newValue, X *currentValue) Q_DECL_NOTHROW
+ bool testAndSetRelease(T &_q_value, X expectedValue, X newValue, X *currentValue) noexcept
{
BaseClass::releaseMemoryFence(_q_value);
return BaseClass::testAndSetRelaxed(_q_value, expectedValue, newValue, currentValue);
}
template <typename T, typename X> static Q_ALWAYS_INLINE
- bool testAndSetOrdered(T &_q_value, X expectedValue, X newValue, X *currentValue) Q_DECL_NOTHROW
+ bool testAndSetOrdered(T &_q_value, X expectedValue, X newValue, X *currentValue) noexcept
{
BaseClass::orderedMemoryFence(_q_value);
return BaseClass::testAndSetRelaxed(_q_value, expectedValue, newValue, currentValue);
}
- static inline Q_DECL_CONSTEXPR bool isFetchAndStoreNative() Q_DECL_NOTHROW { return false; }
- static inline Q_DECL_CONSTEXPR bool isFetchAndStoreWaitFree() Q_DECL_NOTHROW { return false; }
+ static inline Q_DECL_CONSTEXPR bool isFetchAndStoreNative() noexcept { return false; }
+ static inline Q_DECL_CONSTEXPR bool isFetchAndStoreWaitFree() noexcept { return false; }
template <typename T, typename X> static Q_ALWAYS_INLINE
- T fetchAndStoreRelaxed(T &_q_value, X newValue) Q_DECL_NOTHROW
+ T fetchAndStoreRelaxed(T &_q_value, X newValue) noexcept
{
// implement fetchAndStore on top of testAndSet
Q_FOREVER {
@@ -197,7 +197,7 @@ template <typename BaseClass> struct QGenericAtomicOps
}
template <typename T, typename X> static Q_ALWAYS_INLINE
- T fetchAndStoreAcquire(T &_q_value, X newValue) Q_DECL_NOTHROW
+ T fetchAndStoreAcquire(T &_q_value, X newValue) noexcept
{
T tmp = BaseClass::fetchAndStoreRelaxed(_q_value, newValue);
BaseClass::acquireMemoryFence(_q_value);
@@ -205,23 +205,23 @@ template <typename BaseClass> struct QGenericAtomicOps
}
template <typename T, typename X> static Q_ALWAYS_INLINE
- T fetchAndStoreRelease(T &_q_value, X newValue) Q_DECL_NOTHROW
+ T fetchAndStoreRelease(T &_q_value, X newValue) noexcept
{
BaseClass::releaseMemoryFence(_q_value);
return BaseClass::fetchAndStoreRelaxed(_q_value, newValue);
}
template <typename T, typename X> static Q_ALWAYS_INLINE
- T fetchAndStoreOrdered(T &_q_value, X newValue) Q_DECL_NOTHROW
+ T fetchAndStoreOrdered(T &_q_value, X newValue) noexcept
{
BaseClass::orderedMemoryFence(_q_value);
return BaseClass::fetchAndStoreRelaxed(_q_value, newValue);
}
- static inline Q_DECL_CONSTEXPR bool isFetchAndAddNative() Q_DECL_NOTHROW { return false; }
- static inline Q_DECL_CONSTEXPR bool isFetchAndAddWaitFree() Q_DECL_NOTHROW { return false; }
+ static inline Q_DECL_CONSTEXPR bool isFetchAndAddNative() noexcept { return false; }
+ static inline Q_DECL_CONSTEXPR bool isFetchAndAddWaitFree() noexcept { return false; }
template <typename T> static Q_ALWAYS_INLINE
- T fetchAndAddRelaxed(T &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
+ T fetchAndAddRelaxed(T &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) noexcept
{
// implement fetchAndAdd on top of testAndSet
Q_FOREVER {
@@ -232,7 +232,7 @@ template <typename BaseClass> struct QGenericAtomicOps
}
template <typename T> static Q_ALWAYS_INLINE
- T fetchAndAddAcquire(T &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
+ T fetchAndAddAcquire(T &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) noexcept
{
T tmp = BaseClass::fetchAndAddRelaxed(_q_value, valueToAdd);
BaseClass::acquireMemoryFence(_q_value);
@@ -240,14 +240,14 @@ template <typename BaseClass> struct QGenericAtomicOps
}
template <typename T> static Q_ALWAYS_INLINE
- T fetchAndAddRelease(T &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
+ T fetchAndAddRelease(T &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) noexcept
{
BaseClass::releaseMemoryFence(_q_value);
return BaseClass::fetchAndAddRelaxed(_q_value, valueToAdd);
}
template <typename T> static Q_ALWAYS_INLINE
- T fetchAndAddOrdered(T &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
+ T fetchAndAddOrdered(T &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) noexcept
{
BaseClass::orderedMemoryFence(_q_value);
return BaseClass::fetchAndAddRelaxed(_q_value, valueToAdd);
@@ -256,7 +256,7 @@ template <typename BaseClass> struct QGenericAtomicOps
QT_WARNING_PUSH
QT_WARNING_DISABLE_MSVC(4146) // unary minus operator applied to unsigned type, result still unsigned
template <typename T> static Q_ALWAYS_INLINE
- T fetchAndSubRelaxed(T &_q_value, typename QAtomicAdditiveType<T>::AdditiveT operand) Q_DECL_NOTHROW
+ T fetchAndSubRelaxed(T &_q_value, typename QAtomicAdditiveType<T>::AdditiveT operand) noexcept
{
// implement fetchAndSub on top of fetchAndAdd
return fetchAndAddRelaxed(_q_value, -operand);
@@ -264,7 +264,7 @@ QT_WARNING_DISABLE_MSVC(4146) // unary minus operator applied to unsigned type
QT_WARNING_POP
template <typename T> static Q_ALWAYS_INLINE
- T fetchAndSubAcquire(T &_q_value, typename QAtomicAdditiveType<T>::AdditiveT operand) Q_DECL_NOTHROW
+ T fetchAndSubAcquire(T &_q_value, typename QAtomicAdditiveType<T>::AdditiveT operand) noexcept
{
T tmp = BaseClass::fetchAndSubRelaxed(_q_value, operand);
BaseClass::acquireMemoryFence(_q_value);
@@ -272,21 +272,21 @@ QT_WARNING_POP
}
template <typename T> static Q_ALWAYS_INLINE
- T fetchAndSubRelease(T &_q_value, typename QAtomicAdditiveType<T>::AdditiveT operand) Q_DECL_NOTHROW
+ T fetchAndSubRelease(T &_q_value, typename QAtomicAdditiveType<T>::AdditiveT operand) noexcept
{
BaseClass::releaseMemoryFence(_q_value);
return BaseClass::fetchAndSubRelaxed(_q_value, operand);
}
template <typename T> static Q_ALWAYS_INLINE
- T fetchAndSubOrdered(T &_q_value, typename QAtomicAdditiveType<T>::AdditiveT operand) Q_DECL_NOTHROW
+ T fetchAndSubOrdered(T &_q_value, typename QAtomicAdditiveType<T>::AdditiveT operand) noexcept
{
BaseClass::orderedMemoryFence(_q_value);
return BaseClass::fetchAndSubRelaxed(_q_value, operand);
}
template <typename T> static Q_ALWAYS_INLINE
- T fetchAndAndRelaxed(T &_q_value, typename std::enable_if<QTypeInfo<T>::isIntegral, T>::type operand) Q_DECL_NOTHROW
+ T fetchAndAndRelaxed(T &_q_value, typename std::enable_if<QTypeInfo<T>::isIntegral, T>::type operand) noexcept
{
// implement fetchAndAnd on top of testAndSet
T tmp = BaseClass::load(_q_value);
@@ -297,7 +297,7 @@ QT_WARNING_POP
}
template <typename T> static Q_ALWAYS_INLINE
- T fetchAndAndAcquire(T &_q_value, typename std::enable_if<QTypeInfo<T>::isIntegral, T>::type operand) Q_DECL_NOTHROW
+ T fetchAndAndAcquire(T &_q_value, typename std::enable_if<QTypeInfo<T>::isIntegral, T>::type operand) noexcept
{
T tmp = BaseClass::fetchAndAndRelaxed(_q_value, operand);
BaseClass::acquireMemoryFence(_q_value);
@@ -305,21 +305,21 @@ QT_WARNING_POP
}
template <typename T> static Q_ALWAYS_INLINE
- T fetchAndAndRelease(T &_q_value, typename std::enable_if<QTypeInfo<T>::isIntegral, T>::type operand) Q_DECL_NOTHROW
+ T fetchAndAndRelease(T &_q_value, typename std::enable_if<QTypeInfo<T>::isIntegral, T>::type operand) noexcept
{
BaseClass::releaseMemoryFence(_q_value);
return BaseClass::fetchAndAndRelaxed(_q_value, operand);
}
template <typename T> static Q_ALWAYS_INLINE
- T fetchAndAndOrdered(T &_q_value, typename std::enable_if<QTypeInfo<T>::isIntegral, T>::type operand) Q_DECL_NOTHROW
+ T fetchAndAndOrdered(T &_q_value, typename std::enable_if<QTypeInfo<T>::isIntegral, T>::type operand) noexcept
{
BaseClass::orderedMemoryFence(_q_value);
return BaseClass::fetchAndAndRelaxed(_q_value, operand);
}
template <typename T> static Q_ALWAYS_INLINE
- T fetchAndOrRelaxed(T &_q_value, typename std::enable_if<QTypeInfo<T>::isIntegral, T>::type operand) Q_DECL_NOTHROW
+ T fetchAndOrRelaxed(T &_q_value, typename std::enable_if<QTypeInfo<T>::isIntegral, T>::type operand) noexcept
{
// implement fetchAndOr on top of testAndSet
T tmp = BaseClass::load(_q_value);
@@ -330,7 +330,7 @@ QT_WARNING_POP
}
template <typename T> static Q_ALWAYS_INLINE
- T fetchAndOrAcquire(T &_q_value, typename std::enable_if<QTypeInfo<T>::isIntegral, T>::type operand) Q_DECL_NOTHROW
+ T fetchAndOrAcquire(T &_q_value, typename std::enable_if<QTypeInfo<T>::isIntegral, T>::type operand) noexcept
{
T tmp = BaseClass::fetchAndOrRelaxed(_q_value, operand);
BaseClass::acquireMemoryFence(_q_value);
@@ -338,21 +338,21 @@ QT_WARNING_POP
}
template <typename T> static Q_ALWAYS_INLINE
- T fetchAndOrRelease(T &_q_value, typename std::enable_if<QTypeInfo<T>::isIntegral, T>::type operand) Q_DECL_NOTHROW
+ T fetchAndOrRelease(T &_q_value, typename std::enable_if<QTypeInfo<T>::isIntegral, T>::type operand) noexcept
{
BaseClass::releaseMemoryFence(_q_value);
return BaseClass::fetchAndOrRelaxed(_q_value, operand);
}
template <typename T> static Q_ALWAYS_INLINE
- T fetchAndOrOrdered(T &_q_value, typename std::enable_if<QTypeInfo<T>::isIntegral, T>::type operand) Q_DECL_NOTHROW
+ T fetchAndOrOrdered(T &_q_value, typename std::enable_if<QTypeInfo<T>::isIntegral, T>::type operand) noexcept
{
BaseClass::orderedMemoryFence(_q_value);
return BaseClass::fetchAndOrRelaxed(_q_value, operand);
}
template <typename T> static Q_ALWAYS_INLINE
- T fetchAndXorRelaxed(T &_q_value, typename std::enable_if<QTypeInfo<T>::isIntegral, T>::type operand) Q_DECL_NOTHROW
+ T fetchAndXorRelaxed(T &_q_value, typename std::enable_if<QTypeInfo<T>::isIntegral, T>::type operand) noexcept
{
// implement fetchAndXor on top of testAndSet
T tmp = BaseClass::load(_q_value);
@@ -363,7 +363,7 @@ QT_WARNING_POP
}
template <typename T> static Q_ALWAYS_INLINE
- T fetchAndXorAcquire(T &_q_value, typename std::enable_if<QTypeInfo<T>::isIntegral, T>::type operand) Q_DECL_NOTHROW
+ T fetchAndXorAcquire(T &_q_value, typename std::enable_if<QTypeInfo<T>::isIntegral, T>::type operand) noexcept
{
T tmp = BaseClass::fetchAndXorRelaxed(_q_value, operand);
BaseClass::acquireMemoryFence(_q_value);
@@ -371,14 +371,14 @@ QT_WARNING_POP
}
template <typename T> static Q_ALWAYS_INLINE
- T fetchAndXorRelease(T &_q_value, typename std::enable_if<QTypeInfo<T>::isIntegral, T>::type operand) Q_DECL_NOTHROW
+ T fetchAndXorRelease(T &_q_value, typename std::enable_if<QTypeInfo<T>::isIntegral, T>::type operand) noexcept
{
BaseClass::releaseMemoryFence(_q_value);
return BaseClass::fetchAndXorRelaxed(_q_value, operand);
}
template <typename T> static Q_ALWAYS_INLINE
- T fetchAndXorOrdered(T &_q_value, typename std::enable_if<QTypeInfo<T>::isIntegral, T>::type operand) Q_DECL_NOTHROW
+ T fetchAndXorOrdered(T &_q_value, typename std::enable_if<QTypeInfo<T>::isIntegral, T>::type operand) noexcept
{
BaseClass::orderedMemoryFence(_q_value);
return BaseClass::fetchAndXorRelaxed(_q_value, operand);
diff --git a/src/corelib/thread/qmutex.cpp b/src/corelib/thread/qmutex.cpp
index 3881ac017e..4f55e50fe5 100644
--- a/src/corelib/thread/qmutex.cpp
+++ b/src/corelib/thread/qmutex.cpp
@@ -82,7 +82,7 @@ public:
QMutex mutex;
bool lock(int timeout) QT_MUTEX_LOCK_NOEXCEPT;
- void unlock() Q_DECL_NOTHROW;
+ void unlock() noexcept;
};
/*
@@ -329,7 +329,7 @@ bool QMutex::tryLock(int timeout) QT_MUTEX_LOCK_NOEXCEPT
\sa lock()
*/
-void QMutex::unlock() Q_DECL_NOTHROW
+void QMutex::unlock() noexcept
{
QMutexData *current;
if (fastTryUnlock(current))
@@ -348,7 +348,7 @@ void QMutex::unlock() Q_DECL_NOTHROW
Returns \c true if the mutex is recursive.
*/
-bool QBasicMutex::isRecursive() Q_DECL_NOTHROW
+bool QBasicMutex::isRecursive() noexcept
{
return QT_PREPEND_NAMESPACE(isRecursive)(d_ptr.loadAcquire());
}
@@ -358,7 +358,7 @@ bool QBasicMutex::isRecursive() Q_DECL_NOTHROW
Returns \c true if the mutex is recursive.
*/
-bool QBasicMutex::isRecursive() const Q_DECL_NOTHROW
+bool QBasicMutex::isRecursive() const noexcept
{
return QT_PREPEND_NAMESPACE(isRecursive)(d_ptr.loadAcquire());
}
@@ -600,7 +600,7 @@ bool QBasicMutex::lockInternal(int timeout) QT_MUTEX_LOCK_NOEXCEPT
/*!
\internal
*/
-void QBasicMutex::unlockInternal() Q_DECL_NOTHROW
+void QBasicMutex::unlockInternal() noexcept
{
QMutexData *copy = d_ptr.loadAcquire();
Q_ASSERT(copy); //we must be locked
@@ -675,7 +675,7 @@ void QMutexPrivate::release()
}
// atomically subtract "value" to the waiters, and remove the QMutexPrivate::BigNumber flag
-void QMutexPrivate::derefWaiters(int value) Q_DECL_NOTHROW
+void QMutexPrivate::derefWaiters(int value) noexcept
{
int old_waiters;
int new_waiters;
@@ -716,7 +716,7 @@ inline bool QRecursiveMutexPrivate::lock(int timeout) QT_MUTEX_LOCK_NOEXCEPT
/*!
\internal
*/
-inline void QRecursiveMutexPrivate::unlock() Q_DECL_NOTHROW
+inline void QRecursiveMutexPrivate::unlock() noexcept
{
if (count > 0) {
count--;
diff --git a/src/corelib/thread/qmutex.h b/src/corelib/thread/qmutex.h
index 837355a602..d7796092d1 100644
--- a/src/corelib/thread/qmutex.h
+++ b/src/corelib/thread/qmutex.h
@@ -57,7 +57,7 @@ QT_BEGIN_NAMESPACE
#if QT_CONFIG(thread) || defined(Q_CLANG_QDOC)
#ifdef Q_OS_LINUX
-# define QT_MUTEX_LOCK_NOEXCEPT Q_DECL_NOTHROW
+# define QT_MUTEX_LOCK_NOEXCEPT noexcept
#else
# define QT_MUTEX_LOCK_NOEXCEPT
#endif
@@ -80,39 +80,39 @@ public:
}
// BasicLockable concept
- inline void unlock() Q_DECL_NOTHROW {
+ inline void unlock() noexcept {
Q_ASSERT(d_ptr.load()); //mutex must be locked
if (!fastTryUnlock())
unlockInternal();
}
- bool tryLock() Q_DECL_NOTHROW {
+ bool tryLock() noexcept {
return fastTryLock();
}
// Lockable concept
- bool try_lock() Q_DECL_NOTHROW { return tryLock(); }
+ bool try_lock() noexcept { return tryLock(); }
- bool isRecursive() Q_DECL_NOTHROW; //### Qt6: remove me
- bool isRecursive() const Q_DECL_NOTHROW;
+ bool isRecursive() noexcept; //### Qt6: remove me
+ bool isRecursive() const noexcept;
private:
- inline bool fastTryLock() Q_DECL_NOTHROW {
+ inline bool fastTryLock() noexcept {
return d_ptr.testAndSetAcquire(nullptr, dummyLocked());
}
- inline bool fastTryUnlock() Q_DECL_NOTHROW {
+ inline bool fastTryUnlock() noexcept {
return d_ptr.testAndSetRelease(dummyLocked(), nullptr);
}
- inline bool fastTryLock(QMutexData *&current) Q_DECL_NOTHROW {
+ inline bool fastTryLock(QMutexData *&current) noexcept {
return d_ptr.testAndSetAcquire(nullptr, dummyLocked(), current);
}
- inline bool fastTryUnlock(QMutexData *&current) Q_DECL_NOTHROW {
+ inline bool fastTryUnlock(QMutexData *&current) noexcept {
return d_ptr.testAndSetRelease(dummyLocked(), nullptr, current);
}
void lockInternal() QT_MUTEX_LOCK_NOEXCEPT;
bool lockInternal(int timeout) QT_MUTEX_LOCK_NOEXCEPT;
- void unlockInternal() Q_DECL_NOTHROW;
+ void unlockInternal() noexcept;
QBasicAtomicPointer<QMutexData> d_ptr;
static inline QMutexData *dummyLocked() {
@@ -134,7 +134,7 @@ public:
void lock() QT_MUTEX_LOCK_NOEXCEPT;
bool tryLock(int timeout = 0) QT_MUTEX_LOCK_NOEXCEPT;
// BasicLockable concept
- void unlock() Q_DECL_NOTHROW;
+ void unlock() noexcept;
// Lockable concept
bool try_lock() QT_MUTEX_LOCK_NOEXCEPT { return tryLock(); }
@@ -158,7 +158,7 @@ public:
}
#endif
- bool isRecursive() const Q_DECL_NOTHROW
+ bool isRecursive() const noexcept
{ return QBasicMutex::isRecursive(); }
private:
@@ -212,7 +212,7 @@ public:
#endif
inline ~QMutexLocker() { unlock(); }
- inline void unlock() Q_DECL_NOTHROW
+ inline void unlock() noexcept
{
if ((val & quintptr(1u)) == quintptr(1u)) {
val &= ~quintptr(1u);
@@ -257,24 +257,24 @@ class Q_CORE_EXPORT QMutex
public:
enum RecursionMode { NonRecursive, Recursive };
- inline Q_DECL_CONSTEXPR explicit QMutex(RecursionMode = NonRecursive) Q_DECL_NOTHROW { }
+ inline Q_DECL_CONSTEXPR explicit QMutex(RecursionMode = NonRecursive) noexcept { }
- inline void lock() Q_DECL_NOTHROW {}
- inline bool tryLock(int timeout = 0) Q_DECL_NOTHROW { Q_UNUSED(timeout); return true; }
- inline bool try_lock() Q_DECL_NOTHROW { return true; }
- inline void unlock() Q_DECL_NOTHROW {}
- inline bool isRecursive() const Q_DECL_NOTHROW { return true; }
+ inline void lock() noexcept {}
+ inline bool tryLock(int timeout = 0) noexcept { Q_UNUSED(timeout); return true; }
+ inline bool try_lock() noexcept { return true; }
+ inline void unlock() noexcept {}
+ inline bool isRecursive() const noexcept { return true; }
#if QT_HAS_INCLUDE(<chrono>)
template <class Rep, class Period>
- inline bool try_lock_for(std::chrono::duration<Rep, Period> duration) Q_DECL_NOTHROW
+ inline bool try_lock_for(std::chrono::duration<Rep, Period> duration) noexcept
{
Q_UNUSED(duration);
return true;
}
template<class Clock, class Duration>
- inline bool try_lock_until(std::chrono::time_point<Clock, Duration> timePoint) Q_DECL_NOTHROW
+ inline bool try_lock_until(std::chrono::time_point<Clock, Duration> timePoint) noexcept
{
Q_UNUSED(timePoint);
return true;
@@ -288,12 +288,12 @@ private:
class Q_CORE_EXPORT QMutexLocker
{
public:
- inline explicit QMutexLocker(QMutex *) Q_DECL_NOTHROW {}
- inline ~QMutexLocker() Q_DECL_NOTHROW {}
+ inline explicit QMutexLocker(QMutex *) noexcept {}
+ inline ~QMutexLocker() noexcept {}
- inline void unlock() Q_DECL_NOTHROW {}
- void relock() Q_DECL_NOTHROW {}
- inline QMutex *mutex() const Q_DECL_NOTHROW { return nullptr; }
+ inline void unlock() noexcept {}
+ void relock() noexcept {}
+ inline QMutex *mutex() const noexcept { return nullptr; }
private:
Q_DISABLE_COPY(QMutexLocker)
diff --git a/src/corelib/thread/qmutex_linux.cpp b/src/corelib/thread/qmutex_linux.cpp
index 507e72cb76..b006ff1033 100644
--- a/src/corelib/thread/qmutex_linux.cpp
+++ b/src/corelib/thread/qmutex_linux.cpp
@@ -106,7 +106,7 @@ static inline QMutexData *dummyFutexValue()
}
template <bool IsTimed> static inline
-bool lockInternal_helper(QBasicAtomicPointer<QMutexData> &d_ptr, int timeout = -1, QElapsedTimer *elapsedTimer = 0) Q_DECL_NOTHROW
+bool lockInternal_helper(QBasicAtomicPointer<QMutexData> &d_ptr, int timeout = -1, QElapsedTimer *elapsedTimer = 0) noexcept
{
if (!IsTimed)
timeout = -1;
@@ -153,13 +153,13 @@ bool lockInternal_helper(QBasicAtomicPointer<QMutexData> &d_ptr, int timeout = -
return true;
}
-void QBasicMutex::lockInternal() Q_DECL_NOTHROW
+void QBasicMutex::lockInternal() noexcept
{
Q_ASSERT(!isRecursive());
lockInternal_helper<false>(d_ptr);
}
-bool QBasicMutex::lockInternal(int timeout) Q_DECL_NOTHROW
+bool QBasicMutex::lockInternal(int timeout) noexcept
{
Q_ASSERT(!isRecursive());
QElapsedTimer elapsedTimer;
@@ -167,7 +167,7 @@ bool QBasicMutex::lockInternal(int timeout) Q_DECL_NOTHROW
return lockInternal_helper<true>(d_ptr, timeout, &elapsedTimer);
}
-void QBasicMutex::unlockInternal() Q_DECL_NOTHROW
+void QBasicMutex::unlockInternal() noexcept
{
QMutexData *d = d_ptr.load();
Q_ASSERT(d); //we must be locked
diff --git a/src/corelib/thread/qmutex_mac.cpp b/src/corelib/thread/qmutex_mac.cpp
index 9a8d9bc750..923f89f697 100644
--- a/src/corelib/thread/qmutex_mac.cpp
+++ b/src/corelib/thread/qmutex_mac.cpp
@@ -79,7 +79,7 @@ bool QMutexPrivate::wait(int timeout)
return (r == KERN_SUCCESS);
}
-void QMutexPrivate::wakeUp() Q_DECL_NOTHROW
+void QMutexPrivate::wakeUp() noexcept
{
semaphore_signal(mach_semaphore);
}
diff --git a/src/corelib/thread/qmutex_p.h b/src/corelib/thread/qmutex_p.h
index ec9bfc1152..5025f836b9 100644
--- a/src/corelib/thread/qmutex_p.h
+++ b/src/corelib/thread/qmutex_p.h
@@ -92,7 +92,7 @@ public:
QMutexPrivate();
bool wait(int timeout = -1);
- void wakeUp() Q_DECL_NOTHROW;
+ void wakeUp() noexcept;
// Control the lifetime of the privates
QAtomicInt refCount;
@@ -125,7 +125,7 @@ public:
when the mutex is unlocked.
*/
enum { BigNumber = 0x100000 }; //Must be bigger than the possible number of waiters (number of threads)
- void derefWaiters(int value) Q_DECL_NOTHROW;
+ void derefWaiters(int value) noexcept;
//platform specific stuff
#if defined(Q_OS_MAC)
diff --git a/src/corelib/thread/qmutex_unix.cpp b/src/corelib/thread/qmutex_unix.cpp
index 3ee24a292c..a92ac4f943 100644
--- a/src/corelib/thread/qmutex_unix.cpp
+++ b/src/corelib/thread/qmutex_unix.cpp
@@ -99,7 +99,7 @@ bool QMutexPrivate::wait(int timeout)
return true;
}
-void QMutexPrivate::wakeUp() Q_DECL_NOTHROW
+void QMutexPrivate::wakeUp() noexcept
{
report_error(sem_post(&semaphore), "QMutex::unlock", "sem_post");
}
@@ -146,7 +146,7 @@ bool QMutexPrivate::wait(int timeout)
return ret;
}
-void QMutexPrivate::wakeUp() Q_DECL_NOTHROW
+void QMutexPrivate::wakeUp() noexcept
{
report_error(pthread_mutex_lock(&mutex), "QMutex::unlock", "mutex lock");
wakeup = true;
diff --git a/src/corelib/thread/qmutex_win.cpp b/src/corelib/thread/qmutex_win.cpp
index 3c314a4c0c..e221bc89cb 100644
--- a/src/corelib/thread/qmutex_win.cpp
+++ b/src/corelib/thread/qmutex_win.cpp
@@ -64,7 +64,7 @@ bool QMutexPrivate::wait(int timeout)
return (WaitForSingleObjectEx(event, timeout < 0 ? INFINITE : timeout, FALSE) == WAIT_OBJECT_0);
}
-void QMutexPrivate::wakeUp() Q_DECL_NOTHROW
+void QMutexPrivate::wakeUp() noexcept
{ SetEvent(event); }
QT_END_NAMESPACE
diff --git a/src/corelib/thread/qorderedmutexlocker_p.h b/src/corelib/thread/qorderedmutexlocker_p.h
index 5b2c7ab112..e0a67388d4 100644
--- a/src/corelib/thread/qorderedmutexlocker_p.h
+++ b/src/corelib/thread/qorderedmutexlocker_p.h
@@ -129,7 +129,7 @@ public:
}
inline ~QBasicMutexLocker() { if (isLocked) unlock(); }
- inline void unlock() Q_DECL_NOTHROW
+ inline void unlock() noexcept
{
isLocked = false;
m->unlock();
diff --git a/src/corelib/thread/qreadwritelock.h b/src/corelib/thread/qreadwritelock.h
index 65fa76fd6d..139fde9214 100644
--- a/src/corelib/thread/qreadwritelock.h
+++ b/src/corelib/thread/qreadwritelock.h
@@ -180,18 +180,18 @@ class Q_CORE_EXPORT QReadWriteLock
{
public:
enum RecursionMode { NonRecursive, Recursive };
- inline explicit QReadWriteLock(RecursionMode = NonRecursive) Q_DECL_NOTHROW { }
+ inline explicit QReadWriteLock(RecursionMode = NonRecursive) noexcept { }
inline ~QReadWriteLock() { }
- static inline void lockForRead() Q_DECL_NOTHROW { }
- static inline bool tryLockForRead() Q_DECL_NOTHROW { return true; }
- static inline bool tryLockForRead(int timeout) Q_DECL_NOTHROW { Q_UNUSED(timeout); return true; }
+ static inline void lockForRead() noexcept { }
+ static inline bool tryLockForRead() noexcept { return true; }
+ static inline bool tryLockForRead(int timeout) noexcept { Q_UNUSED(timeout); return true; }
- static inline void lockForWrite() Q_DECL_NOTHROW { }
- static inline bool tryLockForWrite() Q_DECL_NOTHROW { return true; }
- static inline bool tryLockForWrite(int timeout) Q_DECL_NOTHROW { Q_UNUSED(timeout); return true; }
+ static inline void lockForWrite() noexcept { }
+ static inline bool tryLockForWrite() noexcept { return true; }
+ static inline bool tryLockForWrite(int timeout) noexcept { Q_UNUSED(timeout); return true; }
- static inline void unlock() Q_DECL_NOTHROW { }
+ static inline void unlock() noexcept { }
private:
Q_DISABLE_COPY(QReadWriteLock)
@@ -200,12 +200,12 @@ private:
class Q_CORE_EXPORT QReadLocker
{
public:
- inline QReadLocker(QReadWriteLock *) Q_DECL_NOTHROW { }
- inline ~QReadLocker() Q_DECL_NOTHROW { }
+ inline QReadLocker(QReadWriteLock *) noexcept { }
+ inline ~QReadLocker() noexcept { }
- static inline void unlock() Q_DECL_NOTHROW { }
- static inline void relock() Q_DECL_NOTHROW { }
- static inline QReadWriteLock *readWriteLock() Q_DECL_NOTHROW { return nullptr; }
+ static inline void unlock() noexcept { }
+ static inline void relock() noexcept { }
+ static inline QReadWriteLock *readWriteLock() noexcept { return nullptr; }
private:
Q_DISABLE_COPY(QReadLocker)
@@ -214,12 +214,12 @@ private:
class Q_CORE_EXPORT QWriteLocker
{
public:
- inline explicit QWriteLocker(QReadWriteLock *) Q_DECL_NOTHROW { }
- inline ~QWriteLocker() Q_DECL_NOTHROW { }
+ inline explicit QWriteLocker(QReadWriteLock *) noexcept { }
+ inline ~QWriteLocker() noexcept { }
- static inline void unlock() Q_DECL_NOTHROW { }
- static inline void relock() Q_DECL_NOTHROW { }
- static inline QReadWriteLock *readWriteLock() Q_DECL_NOTHROW { return nullptr; }
+ static inline void unlock() noexcept { }
+ static inline void relock() noexcept { }
+ static inline QReadWriteLock *readWriteLock() noexcept { return nullptr; }
private:
Q_DISABLE_COPY(QWriteLocker)
diff --git a/src/corelib/thread/qsemaphore.h b/src/corelib/thread/qsemaphore.h
index b830ff1bfd..58c12997ad 100644
--- a/src/corelib/thread/qsemaphore.h
+++ b/src/corelib/thread/qsemaphore.h
@@ -75,14 +75,14 @@ class QSemaphoreReleaser
{
public:
QSemaphoreReleaser() = default;
- explicit QSemaphoreReleaser(QSemaphore &sem, int n = 1) Q_DECL_NOTHROW
+ explicit QSemaphoreReleaser(QSemaphore &sem, int n = 1) noexcept
: m_sem(&sem), m_n(n) {}
- explicit QSemaphoreReleaser(QSemaphore *sem, int n = 1) Q_DECL_NOTHROW
+ explicit QSemaphoreReleaser(QSemaphore *sem, int n = 1) noexcept
: m_sem(sem), m_n(n) {}
- QSemaphoreReleaser(QSemaphoreReleaser &&other) Q_DECL_NOTHROW
+ QSemaphoreReleaser(QSemaphoreReleaser &&other) noexcept
: m_sem(other.m_sem), m_n(other.m_n)
{ other.m_sem = nullptr; }
- QSemaphoreReleaser &operator=(QSemaphoreReleaser &&other) Q_DECL_NOTHROW
+ QSemaphoreReleaser &operator=(QSemaphoreReleaser &&other) noexcept
{ QSemaphoreReleaser moved(std::move(other)); swap(moved); return *this; }
~QSemaphoreReleaser()
@@ -91,16 +91,16 @@ public:
m_sem->release(m_n);
}
- void swap(QSemaphoreReleaser &other) Q_DECL_NOTHROW
+ void swap(QSemaphoreReleaser &other) noexcept
{
qSwap(m_sem, other.m_sem);
qSwap(m_n, other.m_n);
}
- QSemaphore *semaphore() const Q_DECL_NOTHROW
+ QSemaphore *semaphore() const noexcept
{ return m_sem; }
- QSemaphore *cancel() Q_DECL_NOTHROW
+ QSemaphore *cancel() noexcept
{
QSemaphore *old = m_sem;
m_sem = nullptr;
diff --git a/src/corelib/thread/qthread.cpp b/src/corelib/thread/qthread.cpp
index b023ae9ed2..b9b9f3e354 100644
--- a/src/corelib/thread/qthread.cpp
+++ b/src/corelib/thread/qthread.cpp
@@ -839,7 +839,7 @@ bool QThread::event(QEvent* event)
return QObject::event(event);
}
-Qt::HANDLE QThread::currentThreadId() Q_DECL_NOTHROW
+Qt::HANDLE QThread::currentThreadId() noexcept
{
return Qt::HANDLE(currentThread());
}
@@ -849,7 +849,7 @@ QThread *QThread::currentThread()
return QThreadData::current()->thread;
}
-int QThread::idealThreadCount() Q_DECL_NOTHROW
+int QThread::idealThreadCount() noexcept
{
return 1;
}
@@ -920,7 +920,7 @@ QThreadPrivate::~QThreadPrivate()
\since 5.0
Returns a pointer to the event dispatcher object for the thread. If no event
- dispatcher exists for the thread, this function returns 0.
+ dispatcher exists for the thread, this function returns \nullptr.
*/
QAbstractEventDispatcher *QThread::eventDispatcher() const
{
diff --git a/src/corelib/thread/qthread.h b/src/corelib/thread/qthread.h
index b6c5bf47d0..8e92d75401 100644
--- a/src/corelib/thread/qthread.h
+++ b/src/corelib/thread/qthread.h
@@ -70,9 +70,9 @@ class Q_CORE_EXPORT QThread : public QObject
{
Q_OBJECT
public:
- static Qt::HANDLE currentThreadId() Q_DECL_NOTHROW Q_DECL_PURE_FUNCTION;
+ static Qt::HANDLE currentThreadId() noexcept Q_DECL_PURE_FUNCTION;
static QThread *currentThread();
- static int idealThreadCount() Q_DECL_NOTHROW;
+ static int idealThreadCount() noexcept;
static void yieldCurrentThread();
explicit QThread(QObject *parent = nullptr);
diff --git a/src/corelib/thread/qthread_p.h b/src/corelib/thread/qthread_p.h
index e614ddd004..209225de98 100644
--- a/src/corelib/thread/qthread_p.h
+++ b/src/corelib/thread/qthread_p.h
@@ -187,8 +187,8 @@ public:
#endif // Q_OS_UNIX
#ifdef Q_OS_WIN
- static unsigned int __stdcall start(void *) Q_DECL_NOEXCEPT;
- static void finish(void *, bool lockAnyway=true) Q_DECL_NOEXCEPT;
+ static unsigned int __stdcall start(void *) noexcept;
+ static void finish(void *, bool lockAnyway=true) noexcept;
Qt::HANDLE handle;
unsigned int id;
diff --git a/src/corelib/thread/qthread_unix.cpp b/src/corelib/thread/qthread_unix.cpp
index a13f8ca215..8328e514a8 100644
--- a/src/corelib/thread/qthread_unix.cpp
+++ b/src/corelib/thread/qthread_unix.cpp
@@ -443,7 +443,7 @@ void QThreadPrivate::finish(void *arg)
** QThread
*************************************************************************/
-Qt::HANDLE QThread::currentThreadId() Q_DECL_NOTHROW
+Qt::HANDLE QThread::currentThreadId() noexcept
{
// requires a C cast here otherwise we run into trouble on AIX
return to_HANDLE(pthread_self());
@@ -454,7 +454,7 @@ Qt::HANDLE QThread::currentThreadId() Q_DECL_NOTHROW
# define _SC_NPROCESSORS_ONLN 84
#endif
-int QThread::idealThreadCount() Q_DECL_NOTHROW
+int QThread::idealThreadCount() noexcept
{
int cores = 1;
diff --git a/src/corelib/thread/qthread_win.cpp b/src/corelib/thread/qthread_win.cpp
index e56fe2c6ae..ee73280707 100644
--- a/src/corelib/thread/qthread_win.cpp
+++ b/src/corelib/thread/qthread_win.cpp
@@ -372,7 +372,7 @@ QAbstractEventDispatcher *QThreadPrivate::createEventDispatcher(QThreadData *dat
#if QT_CONFIG(thread)
-unsigned int __stdcall QT_ENSURE_STACK_ALIGNED_FOR_SSE QThreadPrivate::start(void *arg) Q_DECL_NOEXCEPT
+unsigned int __stdcall QT_ENSURE_STACK_ALIGNED_FOR_SSE QThreadPrivate::start(void *arg) noexcept
{
QThread *thr = reinterpret_cast<QThread *>(arg);
QThreadData *data = QThreadData::get2(thr);
@@ -406,7 +406,7 @@ unsigned int __stdcall QT_ENSURE_STACK_ALIGNED_FOR_SSE QThreadPrivate::start(voi
return 0;
}
-void QThreadPrivate::finish(void *arg, bool lockAnyway) Q_DECL_NOEXCEPT
+void QThreadPrivate::finish(void *arg, bool lockAnyway) noexcept
{
QThread *thr = reinterpret_cast<QThread *>(arg);
QThreadPrivate *d = thr->d_func();
@@ -447,12 +447,12 @@ void QThreadPrivate::finish(void *arg, bool lockAnyway) Q_DECL_NOEXCEPT
** QThread
*************************************************************************/
-Qt::HANDLE QThread::currentThreadId() Q_DECL_NOTHROW
+Qt::HANDLE QThread::currentThreadId() noexcept
{
return reinterpret_cast<Qt::HANDLE>(quintptr(GetCurrentThreadId()));
}
-int QThread::idealThreadCount() Q_DECL_NOTHROW
+int QThread::idealThreadCount() noexcept
{
SYSTEM_INFO sysinfo;
#ifndef Q_OS_WINRT
diff --git a/src/corelib/tools/qalgorithms.h b/src/corelib/tools/qalgorithms.h
index 0146e22fa3..f1243b5c61 100644
--- a/src/corelib/tools/qalgorithms.h
+++ b/src/corelib/tools/qalgorithms.h
@@ -533,7 +533,7 @@ QT_DEPRECATED_X("Use std::binary_search") Q_OUTOFLINE_TEMPLATE RandomAccessItera
#if defined QT_HAS_CONSTEXPR_BUILTINS
#if defined(Q_CC_GNU) || defined(Q_CC_CLANG)
# define QT_HAS_BUILTIN_CTZS
-Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_ctzs(quint16 v) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_ctzs(quint16 v) noexcept
{
# if QT_HAS_BUILTIN(__builtin_ctzs)
return __builtin_ctzs(v);
@@ -542,7 +542,7 @@ Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_ctzs(quint16 v) Q_DECL_NOTHROW
# endif
}
#define QT_HAS_BUILTIN_CLZS
-Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_clzs(quint16 v) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_clzs(quint16 v) noexcept
{
# if QT_HAS_BUILTIN(__builtin_clzs)
return __builtin_clzs(v);
@@ -551,40 +551,40 @@ Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_clzs(quint16 v) Q_DECL_NOTHROW
# endif
}
#define QT_HAS_BUILTIN_CTZ
-Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_ctz(quint32 v) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_ctz(quint32 v) noexcept
{
return __builtin_ctz(v);
}
#define QT_HAS_BUILTIN_CLZ
-Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_clz(quint32 v) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_clz(quint32 v) noexcept
{
return __builtin_clz(v);
}
#define QT_HAS_BUILTIN_CTZLL
-Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_ctzll(quint64 v) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_ctzll(quint64 v) noexcept
{
return __builtin_ctzll(v);
}
#define QT_HAS_BUILTIN_CLZLL
-Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_clzll(quint64 v) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_clzll(quint64 v) noexcept
{
return __builtin_clzll(v);
}
#define QALGORITHMS_USE_BUILTIN_POPCOUNT
-Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_popcount(quint32 v) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_popcount(quint32 v) noexcept
{
return __builtin_popcount(v);
}
-Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_popcount(quint8 v) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_popcount(quint8 v) noexcept
{
return __builtin_popcount(v);
}
-Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_popcount(quint16 v) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_popcount(quint16 v) noexcept
{
return __builtin_popcount(v);
}
#define QALGORITHMS_USE_BUILTIN_POPCOUNTLL
-Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_popcountll(quint64 v) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_popcountll(quint64 v) noexcept
{
return __builtin_popcountll(v);
}
@@ -630,12 +630,12 @@ Q_ALWAYS_INLINE unsigned long qt_builtin_clzll(quint64 val)
}
#endif // MSVC 64bit
# define QT_HAS_BUILTIN_CTZS
-Q_ALWAYS_INLINE uint qt_builtin_ctzs(quint16 v) Q_DECL_NOTHROW
+Q_ALWAYS_INLINE uint qt_builtin_ctzs(quint16 v) noexcept
{
return qt_builtin_ctz(v);
}
#define QT_HAS_BUILTIN_CLZS
-Q_ALWAYS_INLINE uint qt_builtin_clzs(quint16 v) Q_DECL_NOTHROW
+Q_ALWAYS_INLINE uint qt_builtin_clzs(quint16 v) noexcept
{
return qt_builtin_clz(v) - 16U;
}
@@ -652,19 +652,19 @@ Q_ALWAYS_INLINE uint qt_builtin_clzs(quint16 v) Q_DECL_NOTHROW
#if defined(__AVX__) || defined(__SSE4_2__) || defined(__POPCNT__)
#define QALGORITHMS_USE_BUILTIN_POPCOUNT
#define QALGORITHMS_USE_BUILTIN_POPCOUNTLL
-Q_ALWAYS_INLINE uint qt_builtin_popcount(quint32 v) Q_DECL_NOTHROW
+Q_ALWAYS_INLINE uint qt_builtin_popcount(quint32 v) noexcept
{
return __popcnt(v);
}
-Q_ALWAYS_INLINE uint qt_builtin_popcount(quint8 v) Q_DECL_NOTHROW
+Q_ALWAYS_INLINE uint qt_builtin_popcount(quint8 v) noexcept
{
return __popcnt16(v);
}
-Q_ALWAYS_INLINE uint qt_builtin_popcount(quint16 v) Q_DECL_NOTHROW
+Q_ALWAYS_INLINE uint qt_builtin_popcount(quint16 v) noexcept
{
return __popcnt16(v);
}
-Q_ALWAYS_INLINE uint qt_builtin_popcountll(quint64 v) Q_DECL_NOTHROW
+Q_ALWAYS_INLINE uint qt_builtin_popcountll(quint64 v) noexcept
{
#if Q_PROCESSOR_WORDSIZE == 8
return __popcnt64(v);
@@ -685,7 +685,7 @@ Q_ALWAYS_INLINE uint qt_builtin_popcountll(quint64 v) Q_DECL_NOTHROW
} //namespace QAlgorithmsPrivate
-Q_DECL_CONST_FUNCTION QT_POPCOUNT_CONSTEXPR inline uint qPopulationCount(quint32 v) Q_DECL_NOTHROW
+Q_DECL_CONST_FUNCTION QT_POPCOUNT_CONSTEXPR inline uint qPopulationCount(quint32 v) noexcept
{
#ifdef QALGORITHMS_USE_BUILTIN_POPCOUNT
return QAlgorithmsPrivate::qt_builtin_popcount(v);
@@ -698,7 +698,7 @@ Q_DECL_CONST_FUNCTION QT_POPCOUNT_CONSTEXPR inline uint qPopulationCount(quint32
#endif
}
-Q_DECL_CONST_FUNCTION QT_POPCOUNT_CONSTEXPR inline uint qPopulationCount(quint8 v) Q_DECL_NOTHROW
+Q_DECL_CONST_FUNCTION QT_POPCOUNT_CONSTEXPR inline uint qPopulationCount(quint8 v) noexcept
{
#ifdef QALGORITHMS_USE_BUILTIN_POPCOUNT
return QAlgorithmsPrivate::qt_builtin_popcount(v);
@@ -708,7 +708,7 @@ Q_DECL_CONST_FUNCTION QT_POPCOUNT_CONSTEXPR inline uint qPopulationCount(quint8
#endif
}
-Q_DECL_CONST_FUNCTION QT_POPCOUNT_CONSTEXPR inline uint qPopulationCount(quint16 v) Q_DECL_NOTHROW
+Q_DECL_CONST_FUNCTION QT_POPCOUNT_CONSTEXPR inline uint qPopulationCount(quint16 v) noexcept
{
#ifdef QALGORITHMS_USE_BUILTIN_POPCOUNT
return QAlgorithmsPrivate::qt_builtin_popcount(v);
@@ -719,7 +719,7 @@ Q_DECL_CONST_FUNCTION QT_POPCOUNT_CONSTEXPR inline uint qPopulationCount(quint16
#endif
}
-Q_DECL_CONST_FUNCTION QT_POPCOUNT_CONSTEXPR inline uint qPopulationCount(quint64 v) Q_DECL_NOTHROW
+Q_DECL_CONST_FUNCTION QT_POPCOUNT_CONSTEXPR inline uint qPopulationCount(quint64 v) noexcept
{
#ifdef QALGORITHMS_USE_BUILTIN_POPCOUNTLL
return QAlgorithmsPrivate::qt_builtin_popcountll(v);
@@ -734,7 +734,7 @@ Q_DECL_CONST_FUNCTION QT_POPCOUNT_CONSTEXPR inline uint qPopulationCount(quint64
#endif
}
-Q_DECL_CONST_FUNCTION QT_POPCOUNT_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) noexcept
{
return qPopulationCount(static_cast<quint64>(v));
}
@@ -744,7 +744,7 @@ Q_DECL_CONST_FUNCTION QT_POPCOUNT_CONSTEXPR inline uint qPopulationCount(long un
#endif
#undef QT_POPCOUNT_CONSTEXPR
-Q_DECL_RELAXED_CONSTEXPR inline uint qCountTrailingZeroBits(quint32 v) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline uint qCountTrailingZeroBits(quint32 v) noexcept
{
#if defined(QT_HAS_BUILTIN_CTZ)
return v ? QAlgorithmsPrivate::qt_builtin_ctz(v) : 32U;
@@ -762,7 +762,7 @@ Q_DECL_RELAXED_CONSTEXPR inline uint qCountTrailingZeroBits(quint32 v) Q_DECL_NO
#endif
}
-Q_DECL_RELAXED_CONSTEXPR inline uint qCountTrailingZeroBits(quint8 v) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline uint qCountTrailingZeroBits(quint8 v) noexcept
{
#if defined(QT_HAS_BUILTIN_CTZ)
return v ? QAlgorithmsPrivate::qt_builtin_ctz(v) : 8U;
@@ -777,7 +777,7 @@ Q_DECL_RELAXED_CONSTEXPR inline uint qCountTrailingZeroBits(quint8 v) Q_DECL_NOT
#endif
}
-Q_DECL_RELAXED_CONSTEXPR inline uint qCountTrailingZeroBits(quint16 v) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline uint qCountTrailingZeroBits(quint16 v) noexcept
{
#if defined(QT_HAS_BUILTIN_CTZS)
return v ? QAlgorithmsPrivate::qt_builtin_ctzs(v) : 16U;
@@ -793,7 +793,7 @@ Q_DECL_RELAXED_CONSTEXPR inline uint qCountTrailingZeroBits(quint16 v) Q_DECL_NO
#endif
}
-Q_DECL_RELAXED_CONSTEXPR inline uint qCountTrailingZeroBits(quint64 v) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline uint qCountTrailingZeroBits(quint64 v) noexcept
{
#if defined(QT_HAS_BUILTIN_CTZLL)
return v ? QAlgorithmsPrivate::qt_builtin_ctzll(v) : 64;
@@ -804,12 +804,12 @@ Q_DECL_RELAXED_CONSTEXPR inline uint qCountTrailingZeroBits(quint64 v) Q_DECL_NO
#endif
}
-Q_DECL_RELAXED_CONSTEXPR inline uint qCountTrailingZeroBits(unsigned long v) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline uint qCountTrailingZeroBits(unsigned long v) noexcept
{
return qCountTrailingZeroBits(QIntegerForSizeof<long>::Unsigned(v));
}
-Q_DECL_RELAXED_CONSTEXPR inline uint qCountLeadingZeroBits(quint32 v) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline uint qCountLeadingZeroBits(quint32 v) noexcept
{
#if defined(QT_HAS_BUILTIN_CLZ)
return v ? QAlgorithmsPrivate::qt_builtin_clz(v) : 32U;
@@ -824,7 +824,7 @@ Q_DECL_RELAXED_CONSTEXPR inline uint qCountLeadingZeroBits(quint32 v) Q_DECL_NOT
#endif
}
-QT_POPCOUNT_RELAXED_CONSTEXPR inline uint qCountLeadingZeroBits(quint8 v) Q_DECL_NOTHROW
+QT_POPCOUNT_RELAXED_CONSTEXPR inline uint qCountLeadingZeroBits(quint8 v) noexcept
{
#if defined(QT_HAS_BUILTIN_CLZ)
return v ? QAlgorithmsPrivate::qt_builtin_clz(v)-24U : 8U;
@@ -836,7 +836,7 @@ QT_POPCOUNT_RELAXED_CONSTEXPR inline uint qCountLeadingZeroBits(quint8 v) Q_DECL
#endif
}
-QT_POPCOUNT_RELAXED_CONSTEXPR inline uint qCountLeadingZeroBits(quint16 v) Q_DECL_NOTHROW
+QT_POPCOUNT_RELAXED_CONSTEXPR inline uint qCountLeadingZeroBits(quint16 v) noexcept
{
#if defined(QT_HAS_BUILTIN_CLZS)
return v ? QAlgorithmsPrivate::qt_builtin_clzs(v) : 16U;
@@ -849,7 +849,7 @@ QT_POPCOUNT_RELAXED_CONSTEXPR inline uint qCountLeadingZeroBits(quint16 v) Q_DEC
#endif
}
-QT_POPCOUNT_RELAXED_CONSTEXPR inline uint qCountLeadingZeroBits(quint64 v) Q_DECL_NOTHROW
+QT_POPCOUNT_RELAXED_CONSTEXPR inline uint qCountLeadingZeroBits(quint64 v) noexcept
{
#if defined(QT_HAS_BUILTIN_CLZLL)
return v ? QAlgorithmsPrivate::qt_builtin_clzll(v) : 64U;
@@ -864,7 +864,7 @@ QT_POPCOUNT_RELAXED_CONSTEXPR inline uint qCountLeadingZeroBits(quint64 v) Q_DEC
#endif
}
-QT_POPCOUNT_RELAXED_CONSTEXPR inline uint qCountLeadingZeroBits(unsigned long v) Q_DECL_NOTHROW
+QT_POPCOUNT_RELAXED_CONSTEXPR inline uint qCountLeadingZeroBits(unsigned long v) noexcept
{
return qCountLeadingZeroBits(QIntegerForSizeof<long>::Unsigned(v));
}
diff --git a/src/corelib/tools/qarraydata.cpp b/src/corelib/tools/qarraydata.cpp
index a91d833e3b..bcc0688a91 100644
--- a/src/corelib/tools/qarraydata.cpp
+++ b/src/corelib/tools/qarraydata.cpp
@@ -87,7 +87,7 @@ static QArrayData *reallocateData(QArrayData *header, size_t allocSize, uint opt
}
QArrayData *QArrayData::allocate(size_t objectSize, size_t alignment,
- size_t capacity, AllocationOptions options) Q_DECL_NOTHROW
+ size_t capacity, AllocationOptions options) noexcept
{
// Alignment is a power of two
Q_ASSERT(alignment >= Q_ALIGNOF(QArrayData)
@@ -135,7 +135,7 @@ QArrayData *QArrayData::allocate(size_t objectSize, size_t alignment,
}
QArrayData *QArrayData::reallocateUnaligned(QArrayData *data, size_t objectSize, size_t capacity,
- AllocationOptions options) Q_DECL_NOTHROW
+ AllocationOptions options) noexcept
{
Q_ASSERT(data);
Q_ASSERT(data->isMutable());
@@ -150,7 +150,7 @@ QArrayData *QArrayData::reallocateUnaligned(QArrayData *data, size_t objectSize,
}
void QArrayData::deallocate(QArrayData *data, size_t objectSize,
- size_t alignment) Q_DECL_NOTHROW
+ size_t alignment) noexcept
{
// Alignment is a power of two
Q_ASSERT(alignment >= Q_ALIGNOF(QArrayData)
diff --git a/src/corelib/tools/qarraydata.h b/src/corelib/tools/qarraydata.h
index a642fb9b39..f78b9be2db 100644
--- a/src/corelib/tools/qarraydata.h
+++ b/src/corelib/tools/qarraydata.h
@@ -113,14 +113,14 @@ struct Q_CORE_EXPORT QArrayData
}
Q_REQUIRED_RESULT static QArrayData *allocate(size_t objectSize, size_t alignment,
- size_t capacity, AllocationOptions options = Default) Q_DECL_NOTHROW;
+ size_t capacity, AllocationOptions options = Default) noexcept;
Q_REQUIRED_RESULT static QArrayData *reallocateUnaligned(QArrayData *data, size_t objectSize,
- size_t newCapacity, AllocationOptions newOptions = Default) Q_DECL_NOTHROW;
+ size_t newCapacity, AllocationOptions newOptions = Default) noexcept;
static void deallocate(QArrayData *data, size_t objectSize,
- size_t alignment) Q_DECL_NOTHROW;
+ size_t alignment) noexcept;
static const QArrayData shared_null[2];
- static QArrayData *sharedNull() Q_DECL_NOTHROW { return const_cast<QArrayData*>(shared_null); }
+ static QArrayData *sharedNull() noexcept { return const_cast<QArrayData*>(shared_null); }
};
Q_DECLARE_OPERATORS_FOR_FLAGS(QArrayData::AllocationOptions)
@@ -254,7 +254,7 @@ struct QTypedArrayData
return result;
}
- static QTypedArrayData *sharedNull() Q_DECL_NOTHROW
+ static QTypedArrayData *sharedNull() noexcept
{
Q_STATIC_ASSERT(sizeof(QTypedArrayData) == sizeof(QArrayData));
return static_cast<QTypedArrayData *>(QArrayData::sharedNull());
diff --git a/src/corelib/tools/qarraydatapointer.h b/src/corelib/tools/qarraydatapointer.h
index 51cfa6e849..bce8fc8ddc 100644
--- a/src/corelib/tools/qarraydatapointer.h
+++ b/src/corelib/tools/qarraydatapointer.h
@@ -52,7 +52,7 @@ private:
typedef QArrayDataOps<T> DataOps;
public:
- QArrayDataPointer() Q_DECL_NOTHROW
+ QArrayDataPointer() noexcept
: d(Data::sharedNull())
{
}
@@ -83,13 +83,13 @@ public:
}
#ifdef Q_COMPILER_RVALUE_REFS
- QArrayDataPointer(QArrayDataPointer &&other) Q_DECL_NOTHROW
+ QArrayDataPointer(QArrayDataPointer &&other) noexcept
: d(other.d)
{
other.d = Data::sharedNull();
}
- QArrayDataPointer &operator=(QArrayDataPointer &&other) Q_DECL_NOTHROW
+ QArrayDataPointer &operator=(QArrayDataPointer &&other) noexcept
{
QArrayDataPointer moved(std::move(other));
this->swap(moved);
@@ -150,7 +150,7 @@ public:
bool isSharable() const { return d->isSharable(); }
#endif
- void swap(QArrayDataPointer &other) Q_DECL_NOTHROW
+ void swap(QArrayDataPointer &other) noexcept
{
qSwap(d, other.d);
}
diff --git a/src/corelib/tools/qbitarray.h b/src/corelib/tools/qbitarray.h
index ff40bf5654..78beff0d42 100644
--- a/src/corelib/tools/qbitarray.h
+++ b/src/corelib/tools/qbitarray.h
@@ -50,21 +50,21 @@ class Q_CORE_EXPORT QBitArray
{
friend Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, const QBitArray &);
friend Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QBitArray &);
- friend Q_CORE_EXPORT uint qHash(const QBitArray &key, uint seed) Q_DECL_NOTHROW;
+ friend Q_CORE_EXPORT uint qHash(const QBitArray &key, uint seed) noexcept;
QByteArray d;
public:
- inline QBitArray() Q_DECL_NOTHROW {}
+ inline QBitArray() noexcept {}
explicit QBitArray(int size, bool val = false);
QBitArray(const QBitArray &other) : d(other.d) {}
inline QBitArray &operator=(const QBitArray &other) { d = other.d; return *this; }
#ifdef Q_COMPILER_RVALUE_REFS
- inline QBitArray(QBitArray &&other) Q_DECL_NOTHROW : d(std::move(other.d)) {}
- inline QBitArray &operator=(QBitArray &&other) Q_DECL_NOTHROW
+ inline QBitArray(QBitArray &&other) noexcept : d(std::move(other.d)) {}
+ inline QBitArray &operator=(QBitArray &&other) noexcept
{ qSwap(d, other.d); return *this; }
#endif
- inline void swap(QBitArray &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+ inline void swap(QBitArray &other) noexcept { qSwap(d, other.d); }
inline int size() const { return (d.size() << 3) - *d.constData(); }
inline int count() const { return (d.size() << 3) - *d.constData(); }
diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp
index 8bf20350d6..a5a473acf4 100644
--- a/src/corelib/tools/qbytearray.cpp
+++ b/src/corelib/tools/qbytearray.cpp
@@ -165,7 +165,7 @@ int qFindByteArray(
This function returns SIZE_MAX (~0) on overflow or if the memory block size
would not fit an int.
*/
-size_t qCalculateBlockSize(size_t elementCount, size_t elementSize, size_t headerSize) Q_DECL_NOTHROW
+size_t qCalculateBlockSize(size_t elementCount, size_t elementSize, size_t headerSize) noexcept
{
unsigned count = unsigned(elementCount);
unsigned size = unsigned(elementSize);
@@ -206,7 +206,7 @@ size_t qCalculateBlockSize(size_t elementCount, size_t elementSize, size_t heade
needed.
*/
CalculateGrowingBlockSizeResult
-qCalculateGrowingBlockSize(size_t elementCount, size_t elementSize, size_t headerSize) Q_DECL_NOTHROW
+qCalculateGrowingBlockSize(size_t elementCount, size_t elementSize, size_t headerSize) noexcept
{
CalculateGrowingBlockSizeResult result = {
std::numeric_limits<size_t>::max(),std::numeric_limits<size_t>::max()
@@ -1281,7 +1281,7 @@ QByteArray qUncompress(const uchar* data, int nbytes)
Assigns \a other to this byte array and returns a reference to
this byte array.
*/
-QByteArray &QByteArray::operator=(const QByteArray & other) Q_DECL_NOTHROW
+QByteArray &QByteArray::operator=(const QByteArray & other) noexcept
{
other.d->ref.ref();
if (!d->ref.deref())
diff --git a/src/corelib/tools/qbytearray.h b/src/corelib/tools/qbytearray.h
index 8ee3a29ecc..318d773eb6 100644
--- a/src/corelib/tools/qbytearray.h
+++ b/src/corelib/tools/qbytearray.h
@@ -168,22 +168,22 @@ public:
};
Q_DECLARE_FLAGS(Base64Options, Base64Option)
- inline QByteArray() Q_DECL_NOTHROW;
+ inline QByteArray() noexcept;
QByteArray(const char *, int size = -1);
QByteArray(int size, char c);
QByteArray(int size, Qt::Initialization);
- inline QByteArray(const QByteArray &) Q_DECL_NOTHROW;
+ inline QByteArray(const QByteArray &) noexcept;
inline ~QByteArray();
- QByteArray &operator=(const QByteArray &) Q_DECL_NOTHROW;
+ QByteArray &operator=(const QByteArray &) noexcept;
QByteArray &operator=(const char *str);
#ifdef Q_COMPILER_RVALUE_REFS
- inline QByteArray(QByteArray && other) Q_DECL_NOTHROW : d(other.d) { other.d = Data::sharedNull(); }
- inline QByteArray &operator=(QByteArray &&other) Q_DECL_NOTHROW
+ inline QByteArray(QByteArray && other) noexcept : d(other.d) { other.d = Data::sharedNull(); }
+ inline QByteArray &operator=(QByteArray &&other) noexcept
{ qSwap(d, other.d); return *this; }
#endif
- inline void swap(QByteArray &other) Q_DECL_NOTHROW
+ inline void swap(QByteArray &other) noexcept
{ qSwap(d, other.d); }
inline int size() const;
@@ -472,7 +472,7 @@ public:
Q_DECLARE_OPERATORS_FOR_FLAGS(QByteArray::Base64Options)
-inline QByteArray::QByteArray() Q_DECL_NOTHROW : d(Data::sharedNull()) { }
+inline QByteArray::QByteArray() noexcept : d(Data::sharedNull()) { }
inline QByteArray::~QByteArray() { if (!d->ref.deref()) Data::deallocate(d); }
inline int QByteArray::size() const
{ return d->size; }
@@ -502,7 +502,7 @@ inline void QByteArray::detach()
{ if (d->ref.isShared() || (d->offset != sizeof(QByteArrayData))) reallocData(uint(d->size) + 1u, d->detachFlags()); }
inline bool QByteArray::isDetached() const
{ return !d->ref.isShared(); }
-inline QByteArray::QByteArray(const QByteArray &a) Q_DECL_NOTHROW : d(a.d)
+inline QByteArray::QByteArray(const QByteArray &a) noexcept : d(a.d)
{ d->ref.ref(); }
inline int QByteArray::capacity() const
@@ -617,41 +617,41 @@ inline int QByteArray::compare(const QByteArray &a, Qt::CaseSensitivity cs) cons
return cs == Qt::CaseSensitive ? qstrcmp(*this, a) :
qstrnicmp(data(), size(), a.data(), a.size());
}
-inline bool operator==(const QByteArray &a1, const QByteArray &a2) Q_DECL_NOTHROW
+inline bool operator==(const QByteArray &a1, const QByteArray &a2) noexcept
{ return (a1.size() == a2.size()) && (memcmp(a1.constData(), a2.constData(), a1.size())==0); }
-inline bool operator==(const QByteArray &a1, const char *a2) Q_DECL_NOTHROW
+inline bool operator==(const QByteArray &a1, const char *a2) noexcept
{ return a2 ? qstrcmp(a1,a2) == 0 : a1.isEmpty(); }
-inline bool operator==(const char *a1, const QByteArray &a2) Q_DECL_NOTHROW
+inline bool operator==(const char *a1, const QByteArray &a2) noexcept
{ return a1 ? qstrcmp(a1,a2) == 0 : a2.isEmpty(); }
-inline bool operator!=(const QByteArray &a1, const QByteArray &a2) Q_DECL_NOTHROW
+inline bool operator!=(const QByteArray &a1, const QByteArray &a2) noexcept
{ return !(a1==a2); }
-inline bool operator!=(const QByteArray &a1, const char *a2) Q_DECL_NOTHROW
+inline bool operator!=(const QByteArray &a1, const char *a2) noexcept
{ return a2 ? qstrcmp(a1,a2) != 0 : !a1.isEmpty(); }
-inline bool operator!=(const char *a1, const QByteArray &a2) Q_DECL_NOTHROW
+inline bool operator!=(const char *a1, const QByteArray &a2) noexcept
{ return a1 ? qstrcmp(a1,a2) != 0 : !a2.isEmpty(); }
-inline bool operator<(const QByteArray &a1, const QByteArray &a2) Q_DECL_NOTHROW
+inline bool operator<(const QByteArray &a1, const QByteArray &a2) noexcept
{ return qstrcmp(a1, a2) < 0; }
- inline bool operator<(const QByteArray &a1, const char *a2) Q_DECL_NOTHROW
+ inline bool operator<(const QByteArray &a1, const char *a2) noexcept
{ return qstrcmp(a1, a2) < 0; }
-inline bool operator<(const char *a1, const QByteArray &a2) Q_DECL_NOTHROW
+inline bool operator<(const char *a1, const QByteArray &a2) noexcept
{ return qstrcmp(a1, a2) < 0; }
-inline bool operator<=(const QByteArray &a1, const QByteArray &a2) Q_DECL_NOTHROW
+inline bool operator<=(const QByteArray &a1, const QByteArray &a2) noexcept
{ return qstrcmp(a1, a2) <= 0; }
-inline bool operator<=(const QByteArray &a1, const char *a2) Q_DECL_NOTHROW
+inline bool operator<=(const QByteArray &a1, const char *a2) noexcept
{ return qstrcmp(a1, a2) <= 0; }
-inline bool operator<=(const char *a1, const QByteArray &a2) Q_DECL_NOTHROW
+inline bool operator<=(const char *a1, const QByteArray &a2) noexcept
{ return qstrcmp(a1, a2) <= 0; }
-inline bool operator>(const QByteArray &a1, const QByteArray &a2) Q_DECL_NOTHROW
+inline bool operator>(const QByteArray &a1, const QByteArray &a2) noexcept
{ return qstrcmp(a1, a2) > 0; }
-inline bool operator>(const QByteArray &a1, const char *a2) Q_DECL_NOTHROW
+inline bool operator>(const QByteArray &a1, const char *a2) noexcept
{ return qstrcmp(a1, a2) > 0; }
-inline bool operator>(const char *a1, const QByteArray &a2) Q_DECL_NOTHROW
+inline bool operator>(const char *a1, const QByteArray &a2) noexcept
{ return qstrcmp(a1, a2) > 0; }
-inline bool operator>=(const QByteArray &a1, const QByteArray &a2) Q_DECL_NOTHROW
+inline bool operator>=(const QByteArray &a1, const QByteArray &a2) noexcept
{ return qstrcmp(a1, a2) >= 0; }
-inline bool operator>=(const QByteArray &a1, const char *a2) Q_DECL_NOTHROW
+inline bool operator>=(const QByteArray &a1, const char *a2) noexcept
{ return qstrcmp(a1, a2) >= 0; }
-inline bool operator>=(const char *a1, const QByteArray &a2) Q_DECL_NOTHROW
+inline bool operator>=(const char *a1, const QByteArray &a2) noexcept
{ return qstrcmp(a1, a2) >= 0; }
#if !defined(QT_USE_QSTRINGBUILDER)
inline const QByteArray operator+(const QByteArray &a1, const QByteArray &a2)
diff --git a/src/corelib/tools/qbytearraymatcher.cpp b/src/corelib/tools/qbytearraymatcher.cpp
index 72f0e0519d..d2eb4e0e3c 100644
--- a/src/corelib/tools/qbytearraymatcher.cpp
+++ b/src/corelib/tools/qbytearraymatcher.cpp
@@ -404,7 +404,7 @@ int qFindByteArray(
/*!
\internal
*/
-int QStaticByteArrayMatcherBase::indexOfIn(const char *needle, uint nlen, const char *haystack, int hlen, int from) const Q_DECL_NOTHROW
+int QStaticByteArrayMatcherBase::indexOfIn(const char *needle, uint nlen, const char *haystack, int hlen, int from) const noexcept
{
if (from < 0)
from = 0;
diff --git a/src/corelib/tools/qbytearraymatcher.h b/src/corelib/tools/qbytearraymatcher.h
index dafaea9c12..0eedfc1d20 100644
--- a/src/corelib/tools/qbytearraymatcher.h
+++ b/src/corelib/tools/qbytearraymatcher.h
@@ -90,15 +90,15 @@ class QStaticByteArrayMatcherBase
uchar data[256];
} m_skiptable;
protected:
- explicit Q_DECL_RELAXED_CONSTEXPR QStaticByteArrayMatcherBase(const char *pattern, uint n) Q_DECL_NOTHROW
+ explicit Q_DECL_RELAXED_CONSTEXPR QStaticByteArrayMatcherBase(const char *pattern, uint n) noexcept
: m_skiptable(generate(pattern, n)) {}
// compiler-generated copy/more ctors/assignment operators are ok!
// compiler-generated dtor is ok!
- Q_CORE_EXPORT int indexOfIn(const char *needle, uint nlen, const char *haystack, int hlen, int from) const Q_DECL_NOTHROW;
+ Q_CORE_EXPORT int indexOfIn(const char *needle, uint nlen, const char *haystack, int hlen, int from) const noexcept;
private:
- static Q_DECL_RELAXED_CONSTEXPR Skiptable generate(const char *pattern, uint n) Q_DECL_NOTHROW
+ static Q_DECL_RELAXED_CONSTEXPR Skiptable generate(const char *pattern, uint n) noexcept
{
const auto uchar_max = (std::numeric_limits<uchar>::max)();
uchar max = n > uchar_max ? uchar_max : n;
@@ -140,23 +140,23 @@ class QStaticByteArrayMatcher : QStaticByteArrayMatcherBase
char m_pattern[N];
Q_STATIC_ASSERT_X(N > 2, "QStaticByteArrayMatcher makes no sense for finding a single-char pattern");
public:
- explicit Q_DECL_RELAXED_CONSTEXPR QStaticByteArrayMatcher(const char (&patternToMatch)[N]) Q_DECL_NOTHROW
+ explicit Q_DECL_RELAXED_CONSTEXPR QStaticByteArrayMatcher(const char (&patternToMatch)[N]) noexcept
: QStaticByteArrayMatcherBase(patternToMatch, N - 1), m_pattern()
{
for (uint i = 0; i < N; ++i)
m_pattern[i] = patternToMatch[i];
}
- int indexIn(const QByteArray &haystack, int from = 0) const Q_DECL_NOTHROW
+ int indexIn(const QByteArray &haystack, int from = 0) const noexcept
{ return this->indexOfIn(m_pattern, N - 1, haystack.data(), haystack.size(), from); }
- int indexIn(const char *haystack, int hlen, int from = 0) const Q_DECL_NOTHROW
+ int indexIn(const char *haystack, int hlen, int from = 0) const noexcept
{ return this->indexOfIn(m_pattern, N - 1, haystack, hlen, from); }
QByteArray pattern() const { return QByteArray(m_pattern, int(N - 1)); }
};
template <uint N>
-Q_DECL_RELAXED_CONSTEXPR QStaticByteArrayMatcher<N> qMakeStaticByteArrayMatcher(const char (&pattern)[N]) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR QStaticByteArrayMatcher<N> qMakeStaticByteArrayMatcher(const char (&pattern)[N]) noexcept
{ return QStaticByteArrayMatcher<N>(pattern); }
QT_END_NAMESPACE
diff --git a/src/corelib/tools/qcache.h b/src/corelib/tools/qcache.h
index b558a8358d..4fcde46fbc 100644
--- a/src/corelib/tools/qcache.h
+++ b/src/corelib/tools/qcache.h
@@ -89,7 +89,7 @@ class QCache
Q_DISABLE_COPY(QCache)
public:
- inline explicit QCache(int maxCost = 100) Q_DECL_NOTHROW;
+ inline explicit QCache(int maxCost = 100) noexcept;
inline ~QCache() { clear(); }
inline int maxCost() const { return mx; }
@@ -116,7 +116,7 @@ private:
};
template <class Key, class T>
-inline QCache<Key, T>::QCache(int amaxCost) Q_DECL_NOTHROW
+inline QCache<Key, T>::QCache(int amaxCost) noexcept
: f(nullptr), l(nullptr), mx(amaxCost), total(0) {}
template <class Key, class T>
diff --git a/src/corelib/tools/qchar.cpp b/src/corelib/tools/qchar.cpp
index 47c853084b..d6061defc3 100644
--- a/src/corelib/tools/qchar.cpp
+++ b/src/corelib/tools/qchar.cpp
@@ -733,7 +733,7 @@ QT_BEGIN_NAMESPACE
Note that this gives no indication of whether the character is
available in a particular font.
*/
-bool QChar::isPrint(uint ucs4) Q_DECL_NOTHROW
+bool QChar::isPrint(uint ucs4) noexcept
{
if (ucs4 > LastValidCodePoint)
return false;
@@ -766,7 +766,7 @@ bool QChar::isPrint(uint ucs4) Q_DECL_NOTHROW
/*!
\internal
*/
-bool QT_FASTCALL QChar::isSpace_helper(uint ucs4) Q_DECL_NOTHROW
+bool QT_FASTCALL QChar::isSpace_helper(uint ucs4) noexcept
{
if (ucs4 > LastValidCodePoint)
return false;
@@ -792,7 +792,7 @@ bool QT_FASTCALL QChar::isSpace_helper(uint ucs4) Q_DECL_NOTHROW
Returns \c true if the UCS-4-encoded character specified by \a ucs4 is
a mark (Mark_* categories); otherwise returns \c false.
*/
-bool QChar::isMark(uint ucs4) Q_DECL_NOTHROW
+bool QChar::isMark(uint ucs4) noexcept
{
if (ucs4 > LastValidCodePoint)
return false;
@@ -816,7 +816,7 @@ bool QChar::isMark(uint ucs4) Q_DECL_NOTHROW
Returns \c true if the UCS-4-encoded character specified by \a ucs4 is
a punctuation mark (Punctuation_* categories); otherwise returns \c false.
*/
-bool QChar::isPunct(uint ucs4) Q_DECL_NOTHROW
+bool QChar::isPunct(uint ucs4) noexcept
{
if (ucs4 > LastValidCodePoint)
return false;
@@ -844,7 +844,7 @@ bool QChar::isPunct(uint ucs4) Q_DECL_NOTHROW
Returns \c true if the UCS-4-encoded character specified by \a ucs4 is
a symbol (Symbol_* categories); otherwise returns \c false.
*/
-bool QChar::isSymbol(uint ucs4) Q_DECL_NOTHROW
+bool QChar::isSymbol(uint ucs4) noexcept
{
if (ucs4 > LastValidCodePoint)
return false;
@@ -874,7 +874,7 @@ bool QChar::isSymbol(uint ucs4) Q_DECL_NOTHROW
/*!
\internal
*/
-bool QT_FASTCALL QChar::isLetter_helper(uint ucs4) Q_DECL_NOTHROW
+bool QT_FASTCALL QChar::isLetter_helper(uint ucs4) noexcept
{
if (ucs4 > LastValidCodePoint)
return false;
@@ -909,7 +909,7 @@ bool QT_FASTCALL QChar::isLetter_helper(uint ucs4) Q_DECL_NOTHROW
/*!
\internal
*/
-bool QT_FASTCALL QChar::isNumber_helper(uint ucs4) Q_DECL_NOTHROW
+bool QT_FASTCALL QChar::isNumber_helper(uint ucs4) noexcept
{
if (ucs4 > LastValidCodePoint)
return false;
@@ -938,7 +938,7 @@ bool QT_FASTCALL QChar::isNumber_helper(uint ucs4) Q_DECL_NOTHROW
/*!
\internal
*/
-bool QT_FASTCALL QChar::isLetterOrNumber_helper(uint ucs4) Q_DECL_NOTHROW
+bool QT_FASTCALL QChar::isLetterOrNumber_helper(uint ucs4) noexcept
{
if (ucs4 > LastValidCodePoint)
return false;
@@ -1101,7 +1101,7 @@ bool QT_FASTCALL QChar::isLetterOrNumber_helper(uint ucs4) Q_DECL_NOTHROW
Returns the numeric value of the digit specified by the UCS-4-encoded
character, \a ucs4, or -1 if the character is not a digit.
*/
-int QChar::digitValue(uint ucs4) Q_DECL_NOTHROW
+int QChar::digitValue(uint ucs4) noexcept
{
if (ucs4 > LastValidCodePoint)
return -1;
@@ -1118,7 +1118,7 @@ int QChar::digitValue(uint ucs4) Q_DECL_NOTHROW
\overload
Returns the category of the UCS-4-encoded character specified by \a ucs4.
*/
-QChar::Category QChar::category(uint ucs4) Q_DECL_NOTHROW
+QChar::Category QChar::category(uint ucs4) noexcept
{
if (ucs4 > LastValidCodePoint)
return QChar::Other_NotAssigned;
@@ -1135,7 +1135,7 @@ QChar::Category QChar::category(uint ucs4) Q_DECL_NOTHROW
\overload
Returns the direction of the UCS-4-encoded character specified by \a ucs4.
*/
-QChar::Direction QChar::direction(uint ucs4) Q_DECL_NOTHROW
+QChar::Direction QChar::direction(uint ucs4) noexcept
{
if (ucs4 > LastValidCodePoint)
return QChar::DirL;
@@ -1158,7 +1158,7 @@ QChar::Direction QChar::direction(uint ucs4) Q_DECL_NOTHROW
character specified by \a ucs4
(needed for certain languages such as Arabic or Syriac).
*/
-QChar::JoiningType QChar::joiningType(uint ucs4) Q_DECL_NOTHROW
+QChar::JoiningType QChar::joiningType(uint ucs4) noexcept
{
if (ucs4 > LastValidCodePoint)
return QChar::Joining_None;
@@ -1181,7 +1181,7 @@ QChar::JoiningType QChar::joiningType(uint ucs4) Q_DECL_NOTHROW
Returns information about the joining properties of the UCS-4-encoded
character specified by \a ucs4 (needed for certain languages such as Arabic).
*/
-QChar::Joining QChar::joining(uint ucs4) Q_DECL_NOTHROW
+QChar::Joining QChar::joining(uint ucs4) noexcept
{
if (ucs4 > LastValidCodePoint)
return QChar::OtherJoining;
@@ -1217,7 +1217,7 @@ QChar::Joining QChar::joining(uint ucs4) Q_DECL_NOTHROW
\sa mirroredChar()
*/
-bool QChar::hasMirrored(uint ucs4) Q_DECL_NOTHROW
+bool QChar::hasMirrored(uint ucs4) noexcept
{
if (ucs4 > LastValidCodePoint)
return false;
@@ -1299,7 +1299,7 @@ bool QChar::hasMirrored(uint ucs4) Q_DECL_NOTHROW
\sa hasMirrored()
*/
-uint QChar::mirroredChar(uint ucs4) Q_DECL_NOTHROW
+uint QChar::mirroredChar(uint ucs4) noexcept
{
if (ucs4 > LastValidCodePoint)
return ucs4;
@@ -1383,7 +1383,7 @@ QString QChar::decomposition(uint ucs4)
Returns the tag defining the composition of the UCS-4-encoded character
specified by \a ucs4. Returns QChar::NoDecomposition if no decomposition exists.
*/
-QChar::Decomposition QChar::decompositionTag(uint ucs4) Q_DECL_NOTHROW
+QChar::Decomposition QChar::decompositionTag(uint ucs4) noexcept
{
if (ucs4 >= Hangul_SBase && ucs4 < Hangul_SBase + Hangul_SCount)
return QChar::Canonical;
@@ -1409,7 +1409,7 @@ QChar::Decomposition QChar::decompositionTag(uint ucs4) Q_DECL_NOTHROW
Returns the combining class for the UCS-4-encoded character specified by
\a ucs4, as defined in the Unicode standard.
*/
-unsigned char QChar::combiningClass(uint ucs4) Q_DECL_NOTHROW
+unsigned char QChar::combiningClass(uint ucs4) noexcept
{
if (ucs4 > LastValidCodePoint)
return 0;
@@ -1430,7 +1430,7 @@ unsigned char QChar::combiningClass(uint ucs4) Q_DECL_NOTHROW
Returns the Unicode script property value for the character specified in
its UCS-4-encoded form as \a ucs4.
*/
-QChar::Script QChar::script(uint ucs4) Q_DECL_NOTHROW
+QChar::Script QChar::script(uint ucs4) noexcept
{
if (ucs4 > LastValidCodePoint)
return QChar::Script_Unknown;
@@ -1448,7 +1448,7 @@ QChar::Script QChar::script(uint ucs4) Q_DECL_NOTHROW
Returns the Unicode version that introduced the character specified in
its UCS-4-encoded form as \a ucs4.
*/
-QChar::UnicodeVersion QChar::unicodeVersion(uint ucs4) Q_DECL_NOTHROW
+QChar::UnicodeVersion QChar::unicodeVersion(uint ucs4) noexcept
{
if (ucs4 > LastValidCodePoint)
return QChar::Unicode_Unassigned;
@@ -1458,14 +1458,14 @@ QChar::UnicodeVersion QChar::unicodeVersion(uint ucs4) Q_DECL_NOTHROW
/*!
Returns the most recent supported Unicode version.
*/
-QChar::UnicodeVersion QChar::currentUnicodeVersion() Q_DECL_NOTHROW
+QChar::UnicodeVersion QChar::currentUnicodeVersion() noexcept
{
return UNICODE_DATA_VERSION;
}
template <typename Traits, typename T>
-Q_DECL_CONST_FUNCTION static inline T convertCase_helper(T uc) Q_DECL_NOTHROW
+Q_DECL_CONST_FUNCTION static inline T convertCase_helper(T uc) noexcept
{
const QUnicodeTables::Properties *prop = qGetProp(uc);
@@ -1491,7 +1491,7 @@ Q_DECL_CONST_FUNCTION static inline T convertCase_helper(T uc) Q_DECL_NOTHROW
by \a ucs4 if the character is uppercase or titlecase; otherwise returns
the character itself.
*/
-uint QChar::toLower(uint ucs4) Q_DECL_NOTHROW
+uint QChar::toLower(uint ucs4) noexcept
{
if (ucs4 > LastValidCodePoint)
return ucs4;
@@ -1511,7 +1511,7 @@ uint QChar::toLower(uint ucs4) Q_DECL_NOTHROW
by \a ucs4 if the character is lowercase or titlecase; otherwise returns
the character itself.
*/
-uint QChar::toUpper(uint ucs4) Q_DECL_NOTHROW
+uint QChar::toUpper(uint ucs4) noexcept
{
if (ucs4 > LastValidCodePoint)
return ucs4;
@@ -1531,7 +1531,7 @@ uint QChar::toUpper(uint ucs4) Q_DECL_NOTHROW
by \a ucs4 if the character is lowercase or uppercase; otherwise returns
the character itself.
*/
-uint QChar::toTitleCase(uint ucs4) Q_DECL_NOTHROW
+uint QChar::toTitleCase(uint ucs4) noexcept
{
if (ucs4 > LastValidCodePoint)
return ucs4;
@@ -1546,7 +1546,7 @@ static inline uint foldCase(const ushort *ch, const ushort *start)
return convertCase_helper<QUnicodeTables::CasefoldTraits>(ucs4);
}
-static inline uint foldCase(uint ch, uint &last) Q_DECL_NOTHROW
+static inline uint foldCase(uint ch, uint &last) noexcept
{
uint ucs4 = ch;
if (QChar::isLowSurrogate(ucs4) && QChar::isHighSurrogate(last))
@@ -1555,12 +1555,12 @@ static inline uint foldCase(uint ch, uint &last) Q_DECL_NOTHROW
return convertCase_helper<QUnicodeTables::CasefoldTraits>(ucs4);
}
-static inline ushort foldCase(ushort ch) Q_DECL_NOTHROW
+static inline ushort foldCase(ushort ch) noexcept
{
return convertCase_helper<QUnicodeTables::CasefoldTraits>(ch);
}
-static inline QChar foldCase(QChar ch) Q_DECL_NOTHROW
+static inline QChar foldCase(QChar ch) noexcept
{
return QChar(foldCase(ch.unicode()));
}
@@ -1577,7 +1577,7 @@ static inline QChar foldCase(QChar ch) Q_DECL_NOTHROW
Returns the case folded equivalent of the UCS-4-encoded character specified
by \a ucs4. For most Unicode characters this is the same as toLower().
*/
-uint QChar::toCaseFolded(uint ucs4) Q_DECL_NOTHROW
+uint QChar::toCaseFolded(uint ucs4) noexcept
{
if (ucs4 > LastValidCodePoint)
return ucs4;
diff --git a/src/corelib/tools/qchar.h b/src/corelib/tools/qchar.h
index 8590b91ba3..be344838ed 100644
--- a/src/corelib/tools/qchar.h
+++ b/src/corelib/tools/qchar.h
@@ -50,9 +50,9 @@ class QString;
struct QLatin1Char
{
public:
- Q_DECL_CONSTEXPR inline explicit QLatin1Char(char c) Q_DECL_NOTHROW : ch(c) {}
- Q_DECL_CONSTEXPR inline char toLatin1() const Q_DECL_NOTHROW { return ch; }
- Q_DECL_CONSTEXPR inline ushort unicode() const Q_DECL_NOTHROW { return ushort(uchar(ch)); }
+ Q_DECL_CONSTEXPR inline explicit QLatin1Char(char c) noexcept : ch(c) {}
+ Q_DECL_CONSTEXPR inline char toLatin1() const noexcept { return ch; }
+ Q_DECL_CONSTEXPR inline ushort unicode() const noexcept { return ushort(uchar(ch)); }
private:
char ch;
@@ -78,30 +78,30 @@ public:
LastValidCodePoint = 0x10ffff
};
- Q_DECL_CONSTEXPR QChar() Q_DECL_NOTHROW : ucs(0) {}
- Q_DECL_CONSTEXPR QChar(ushort rc) Q_DECL_NOTHROW : ucs(rc) {} // implicit
- Q_DECL_CONSTEXPR QChar(uchar c, uchar r) Q_DECL_NOTHROW : ucs(ushort((r << 8) | c)) {}
- Q_DECL_CONSTEXPR QChar(short rc) Q_DECL_NOTHROW : ucs(ushort(rc)) {} // implicit
- Q_DECL_CONSTEXPR QChar(uint rc) Q_DECL_NOTHROW : ucs(ushort(rc & 0xffff)) {}
- Q_DECL_CONSTEXPR QChar(int rc) Q_DECL_NOTHROW : ucs(ushort(rc & 0xffff)) {}
- Q_DECL_CONSTEXPR QChar(SpecialCharacter s) Q_DECL_NOTHROW : ucs(ushort(s)) {} // implicit
- Q_DECL_CONSTEXPR QChar(QLatin1Char ch) Q_DECL_NOTHROW : ucs(ch.unicode()) {} // implicit
+ Q_DECL_CONSTEXPR QChar() noexcept : ucs(0) {}
+ Q_DECL_CONSTEXPR QChar(ushort rc) noexcept : ucs(rc) {} // implicit
+ Q_DECL_CONSTEXPR QChar(uchar c, uchar r) noexcept : ucs(ushort((r << 8) | c)) {}
+ Q_DECL_CONSTEXPR QChar(short rc) noexcept : ucs(ushort(rc)) {} // implicit
+ Q_DECL_CONSTEXPR QChar(uint rc) noexcept : ucs(ushort(rc & 0xffff)) {}
+ Q_DECL_CONSTEXPR QChar(int rc) noexcept : ucs(ushort(rc & 0xffff)) {}
+ Q_DECL_CONSTEXPR QChar(SpecialCharacter s) noexcept : ucs(ushort(s)) {} // implicit
+ Q_DECL_CONSTEXPR QChar(QLatin1Char ch) noexcept : ucs(ch.unicode()) {} // implicit
#if defined(Q_COMPILER_UNICODE_STRINGS)
- Q_DECL_CONSTEXPR QChar(char16_t ch) Q_DECL_NOTHROW : ucs(ushort(ch)) {} // implicit
+ Q_DECL_CONSTEXPR QChar(char16_t ch) noexcept : ucs(ushort(ch)) {} // implicit
#endif
#if defined(Q_OS_WIN)
Q_STATIC_ASSERT(sizeof(wchar_t) == sizeof(ushort));
#endif
#if defined(Q_OS_WIN) || defined(Q_CLANG_QDOC)
# if !defined(_WCHAR_T_DEFINED) || defined(_NATIVE_WCHAR_T_DEFINED)
- Q_DECL_CONSTEXPR QChar(wchar_t ch) Q_DECL_NOTHROW : ucs(ushort(ch)) {} // implicit
+ Q_DECL_CONSTEXPR QChar(wchar_t ch) noexcept : ucs(ushort(ch)) {} // implicit
# endif
#endif
#ifndef QT_NO_CAST_FROM_ASCII
- QT_ASCII_CAST_WARN Q_DECL_CONSTEXPR explicit QChar(char c) Q_DECL_NOTHROW : ucs(uchar(c)) { }
+ QT_ASCII_CAST_WARN Q_DECL_CONSTEXPR explicit QChar(char c) noexcept : ucs(uchar(c)) { }
#ifndef QT_RESTRICTED_CAST_FROM_ASCII
- QT_ASCII_CAST_WARN Q_DECL_CONSTEXPR explicit QChar(uchar c) Q_DECL_NOTHROW : ucs(c) { }
+ QT_ASCII_CAST_WARN Q_DECL_CONSTEXPR explicit QChar(uchar c) noexcept : ucs(c) { }
#endif
#endif
// Unicode information
@@ -411,11 +411,11 @@ public:
};
// ****** WHEN ADDING FUNCTIONS, CONSIDER ADDING TO QCharRef TOO
- inline Category category() const Q_DECL_NOTHROW { return QChar::category(ucs); }
- inline Direction direction() const Q_DECL_NOTHROW { return QChar::direction(ucs); }
- inline JoiningType joiningType() const Q_DECL_NOTHROW { return QChar::joiningType(ucs); }
+ inline Category category() const noexcept { return QChar::category(ucs); }
+ inline Direction direction() const noexcept { return QChar::direction(ucs); }
+ inline JoiningType joiningType() const noexcept { return QChar::joiningType(ucs); }
#if QT_DEPRECATED_SINCE(5, 3)
- QT_DEPRECATED inline Joining joining() const Q_DECL_NOTHROW
+ QT_DEPRECATED inline Joining joining() const noexcept
{
switch (QChar::joiningType(ucs)) {
case QChar::Joining_Causing: return QChar::Center;
@@ -428,198 +428,198 @@ public:
}
}
#endif
- inline unsigned char combiningClass() const Q_DECL_NOTHROW { return QChar::combiningClass(ucs); }
+ inline unsigned char combiningClass() const noexcept { return QChar::combiningClass(ucs); }
- inline QChar mirroredChar() const Q_DECL_NOTHROW { return QChar::mirroredChar(ucs); }
- inline bool hasMirrored() const Q_DECL_NOTHROW { return QChar::hasMirrored(ucs); }
+ inline QChar mirroredChar() const noexcept { return QChar::mirroredChar(ucs); }
+ inline bool hasMirrored() const noexcept { return QChar::hasMirrored(ucs); }
QString decomposition() const;
- inline Decomposition decompositionTag() const Q_DECL_NOTHROW { return QChar::decompositionTag(ucs); }
+ inline Decomposition decompositionTag() const noexcept { return QChar::decompositionTag(ucs); }
- inline int digitValue() const Q_DECL_NOTHROW { return QChar::digitValue(ucs); }
- inline QChar toLower() const Q_DECL_NOTHROW { return QChar::toLower(ucs); }
- inline QChar toUpper() const Q_DECL_NOTHROW { return QChar::toUpper(ucs); }
- inline QChar toTitleCase() const Q_DECL_NOTHROW { return QChar::toTitleCase(ucs); }
- inline QChar toCaseFolded() const Q_DECL_NOTHROW { return QChar::toCaseFolded(ucs); }
+ inline int digitValue() const noexcept { return QChar::digitValue(ucs); }
+ inline QChar toLower() const noexcept { return QChar::toLower(ucs); }
+ inline QChar toUpper() const noexcept { return QChar::toUpper(ucs); }
+ inline QChar toTitleCase() const noexcept { return QChar::toTitleCase(ucs); }
+ inline QChar toCaseFolded() const noexcept { return QChar::toCaseFolded(ucs); }
- inline Script script() const Q_DECL_NOTHROW { return QChar::script(ucs); }
+ inline Script script() const noexcept { return QChar::script(ucs); }
- inline UnicodeVersion unicodeVersion() const Q_DECL_NOTHROW { return QChar::unicodeVersion(ucs); }
+ inline UnicodeVersion unicodeVersion() const noexcept { return QChar::unicodeVersion(ucs); }
#if QT_DEPRECATED_SINCE(5, 0)
- QT_DEPRECATED Q_DECL_CONSTEXPR inline char toAscii() const Q_DECL_NOTHROW { return toLatin1(); }
+ QT_DEPRECATED Q_DECL_CONSTEXPR inline char toAscii() const noexcept { return toLatin1(); }
#endif
- Q_DECL_CONSTEXPR inline char toLatin1() const Q_DECL_NOTHROW { return ucs > 0xff ? '\0' : char(ucs); }
- Q_DECL_CONSTEXPR inline ushort unicode() const Q_DECL_NOTHROW { return ucs; }
- Q_DECL_RELAXED_CONSTEXPR inline ushort &unicode() Q_DECL_NOTHROW { return ucs; }
+ Q_DECL_CONSTEXPR inline char toLatin1() const noexcept { return ucs > 0xff ? '\0' : char(ucs); }
+ Q_DECL_CONSTEXPR inline ushort unicode() const noexcept { return ucs; }
+ Q_DECL_RELAXED_CONSTEXPR inline ushort &unicode() noexcept { return ucs; }
#if QT_DEPRECATED_SINCE(5, 0)
- QT_DEPRECATED static Q_DECL_CONSTEXPR inline QChar fromAscii(char c) Q_DECL_NOTHROW
+ QT_DEPRECATED static Q_DECL_CONSTEXPR inline QChar fromAscii(char c) noexcept
{ return fromLatin1(c); }
#endif
- static Q_DECL_CONSTEXPR inline QChar fromLatin1(char c) Q_DECL_NOTHROW { return QChar(ushort(uchar(c))); }
-
- Q_DECL_CONSTEXPR inline bool isNull() const Q_DECL_NOTHROW { return ucs == 0; }
-
- inline bool isPrint() const Q_DECL_NOTHROW { return QChar::isPrint(ucs); }
- Q_DECL_CONSTEXPR inline bool isSpace() const Q_DECL_NOTHROW { return QChar::isSpace(ucs); }
- inline bool isMark() const Q_DECL_NOTHROW { return QChar::isMark(ucs); }
- inline bool isPunct() const Q_DECL_NOTHROW { return QChar::isPunct(ucs); }
- inline bool isSymbol() const Q_DECL_NOTHROW { return QChar::isSymbol(ucs); }
- Q_DECL_CONSTEXPR inline bool isLetter() const Q_DECL_NOTHROW { return QChar::isLetter(ucs); }
- Q_DECL_CONSTEXPR inline bool isNumber() const Q_DECL_NOTHROW { return QChar::isNumber(ucs); }
- Q_DECL_CONSTEXPR inline bool isLetterOrNumber() const Q_DECL_NOTHROW { return QChar::isLetterOrNumber(ucs); }
- Q_DECL_CONSTEXPR inline bool isDigit() const Q_DECL_NOTHROW { return QChar::isDigit(ucs); }
- Q_DECL_CONSTEXPR inline bool isLower() const Q_DECL_NOTHROW { return QChar::isLower(ucs); }
- Q_DECL_CONSTEXPR inline bool isUpper() const Q_DECL_NOTHROW { return QChar::isUpper(ucs); }
- Q_DECL_CONSTEXPR inline bool isTitleCase() const Q_DECL_NOTHROW { return QChar::isTitleCase(ucs); }
-
- Q_DECL_CONSTEXPR inline bool isNonCharacter() const Q_DECL_NOTHROW { return QChar::isNonCharacter(ucs); }
- Q_DECL_CONSTEXPR inline bool isHighSurrogate() const Q_DECL_NOTHROW { return QChar::isHighSurrogate(ucs); }
- Q_DECL_CONSTEXPR inline bool isLowSurrogate() const Q_DECL_NOTHROW { return QChar::isLowSurrogate(ucs); }
- Q_DECL_CONSTEXPR inline bool isSurrogate() const Q_DECL_NOTHROW { return QChar::isSurrogate(ucs); }
-
- Q_DECL_CONSTEXPR inline uchar cell() const Q_DECL_NOTHROW { return uchar(ucs & 0xff); }
- Q_DECL_CONSTEXPR inline uchar row() const Q_DECL_NOTHROW { return uchar((ucs>>8)&0xff); }
- Q_DECL_RELAXED_CONSTEXPR inline void setCell(uchar acell) Q_DECL_NOTHROW { ucs = ushort((ucs & 0xff00) + acell); }
- Q_DECL_RELAXED_CONSTEXPR inline void setRow(uchar arow) Q_DECL_NOTHROW { ucs = ushort((ushort(arow)<<8) + (ucs&0xff)); }
-
- static Q_DECL_CONSTEXPR inline bool isNonCharacter(uint ucs4) Q_DECL_NOTHROW
+ static Q_DECL_CONSTEXPR inline QChar fromLatin1(char c) noexcept { return QChar(ushort(uchar(c))); }
+
+ Q_DECL_CONSTEXPR inline bool isNull() const noexcept { return ucs == 0; }
+
+ inline bool isPrint() const noexcept { return QChar::isPrint(ucs); }
+ Q_DECL_CONSTEXPR inline bool isSpace() const noexcept { return QChar::isSpace(ucs); }
+ inline bool isMark() const noexcept { return QChar::isMark(ucs); }
+ inline bool isPunct() const noexcept { return QChar::isPunct(ucs); }
+ inline bool isSymbol() const noexcept { return QChar::isSymbol(ucs); }
+ Q_DECL_CONSTEXPR inline bool isLetter() const noexcept { return QChar::isLetter(ucs); }
+ Q_DECL_CONSTEXPR inline bool isNumber() const noexcept { return QChar::isNumber(ucs); }
+ Q_DECL_CONSTEXPR inline bool isLetterOrNumber() const noexcept { return QChar::isLetterOrNumber(ucs); }
+ Q_DECL_CONSTEXPR inline bool isDigit() const noexcept { return QChar::isDigit(ucs); }
+ Q_DECL_CONSTEXPR inline bool isLower() const noexcept { return QChar::isLower(ucs); }
+ Q_DECL_CONSTEXPR inline bool isUpper() const noexcept { return QChar::isUpper(ucs); }
+ Q_DECL_CONSTEXPR inline bool isTitleCase() const noexcept { return QChar::isTitleCase(ucs); }
+
+ Q_DECL_CONSTEXPR inline bool isNonCharacter() const noexcept { return QChar::isNonCharacter(ucs); }
+ Q_DECL_CONSTEXPR inline bool isHighSurrogate() const noexcept { return QChar::isHighSurrogate(ucs); }
+ Q_DECL_CONSTEXPR inline bool isLowSurrogate() const noexcept { return QChar::isLowSurrogate(ucs); }
+ Q_DECL_CONSTEXPR inline bool isSurrogate() const noexcept { return QChar::isSurrogate(ucs); }
+
+ Q_DECL_CONSTEXPR inline uchar cell() const noexcept { return uchar(ucs & 0xff); }
+ Q_DECL_CONSTEXPR inline uchar row() const noexcept { return uchar((ucs>>8)&0xff); }
+ Q_DECL_RELAXED_CONSTEXPR inline void setCell(uchar acell) noexcept { ucs = ushort((ucs & 0xff00) + acell); }
+ Q_DECL_RELAXED_CONSTEXPR inline void setRow(uchar arow) noexcept { ucs = ushort((ushort(arow)<<8) + (ucs&0xff)); }
+
+ static Q_DECL_CONSTEXPR inline bool isNonCharacter(uint ucs4) noexcept
{
return ucs4 >= 0xfdd0 && (ucs4 <= 0xfdef || (ucs4 & 0xfffe) == 0xfffe);
}
- static Q_DECL_CONSTEXPR inline bool isHighSurrogate(uint ucs4) Q_DECL_NOTHROW
+ static Q_DECL_CONSTEXPR inline bool isHighSurrogate(uint ucs4) noexcept
{
return ((ucs4 & 0xfffffc00) == 0xd800);
}
- static Q_DECL_CONSTEXPR inline bool isLowSurrogate(uint ucs4) Q_DECL_NOTHROW
+ static Q_DECL_CONSTEXPR inline bool isLowSurrogate(uint ucs4) noexcept
{
return ((ucs4 & 0xfffffc00) == 0xdc00);
}
- static Q_DECL_CONSTEXPR inline bool isSurrogate(uint ucs4) Q_DECL_NOTHROW
+ static Q_DECL_CONSTEXPR inline bool isSurrogate(uint ucs4) noexcept
{
return (ucs4 - 0xd800u < 2048u);
}
- static Q_DECL_CONSTEXPR inline bool requiresSurrogates(uint ucs4) Q_DECL_NOTHROW
+ static Q_DECL_CONSTEXPR inline bool requiresSurrogates(uint ucs4) noexcept
{
return (ucs4 >= 0x10000);
}
- static Q_DECL_CONSTEXPR inline uint surrogateToUcs4(ushort high, ushort low) Q_DECL_NOTHROW
+ static Q_DECL_CONSTEXPR inline uint surrogateToUcs4(ushort high, ushort low) noexcept
{
return (uint(high)<<10) + low - 0x35fdc00;
}
- static Q_DECL_CONSTEXPR inline uint surrogateToUcs4(QChar high, QChar low) Q_DECL_NOTHROW
+ static Q_DECL_CONSTEXPR inline uint surrogateToUcs4(QChar high, QChar low) noexcept
{
return surrogateToUcs4(high.ucs, low.ucs);
}
- static Q_DECL_CONSTEXPR inline ushort highSurrogate(uint ucs4) Q_DECL_NOTHROW
+ static Q_DECL_CONSTEXPR inline ushort highSurrogate(uint ucs4) noexcept
{
return ushort((ucs4>>10) + 0xd7c0);
}
- static Q_DECL_CONSTEXPR inline ushort lowSurrogate(uint ucs4) Q_DECL_NOTHROW
+ static Q_DECL_CONSTEXPR inline ushort lowSurrogate(uint ucs4) noexcept
{
return ushort(ucs4%0x400 + 0xdc00);
}
- static Category QT_FASTCALL category(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
- static Direction QT_FASTCALL direction(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
- static JoiningType QT_FASTCALL joiningType(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
+ static Category QT_FASTCALL category(uint ucs4) noexcept Q_DECL_CONST_FUNCTION;
+ static Direction QT_FASTCALL direction(uint ucs4) noexcept Q_DECL_CONST_FUNCTION;
+ static JoiningType QT_FASTCALL joiningType(uint ucs4) noexcept Q_DECL_CONST_FUNCTION;
#if QT_DEPRECATED_SINCE(5, 3)
- QT_DEPRECATED static Joining QT_FASTCALL joining(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
+ QT_DEPRECATED static Joining QT_FASTCALL joining(uint ucs4) noexcept Q_DECL_CONST_FUNCTION;
#endif
- static unsigned char QT_FASTCALL combiningClass(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
+ static unsigned char QT_FASTCALL combiningClass(uint ucs4) noexcept Q_DECL_CONST_FUNCTION;
- static uint QT_FASTCALL mirroredChar(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
- static bool QT_FASTCALL hasMirrored(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
+ static uint QT_FASTCALL mirroredChar(uint ucs4) noexcept Q_DECL_CONST_FUNCTION;
+ static bool QT_FASTCALL hasMirrored(uint ucs4) noexcept Q_DECL_CONST_FUNCTION;
static QString QT_FASTCALL decomposition(uint ucs4);
- static Decomposition QT_FASTCALL decompositionTag(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
+ static Decomposition QT_FASTCALL decompositionTag(uint ucs4) noexcept Q_DECL_CONST_FUNCTION;
- static int QT_FASTCALL digitValue(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
- static uint QT_FASTCALL toLower(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
- static uint QT_FASTCALL toUpper(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
- static uint QT_FASTCALL toTitleCase(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
- static uint QT_FASTCALL toCaseFolded(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
+ static int QT_FASTCALL digitValue(uint ucs4) noexcept Q_DECL_CONST_FUNCTION;
+ static uint QT_FASTCALL toLower(uint ucs4) noexcept Q_DECL_CONST_FUNCTION;
+ static uint QT_FASTCALL toUpper(uint ucs4) noexcept Q_DECL_CONST_FUNCTION;
+ static uint QT_FASTCALL toTitleCase(uint ucs4) noexcept Q_DECL_CONST_FUNCTION;
+ static uint QT_FASTCALL toCaseFolded(uint ucs4) noexcept Q_DECL_CONST_FUNCTION;
- static Script QT_FASTCALL script(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
+ static Script QT_FASTCALL script(uint ucs4) noexcept Q_DECL_CONST_FUNCTION;
- static UnicodeVersion QT_FASTCALL unicodeVersion(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
+ static UnicodeVersion QT_FASTCALL unicodeVersion(uint ucs4) noexcept Q_DECL_CONST_FUNCTION;
- static UnicodeVersion QT_FASTCALL currentUnicodeVersion() Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
+ static UnicodeVersion QT_FASTCALL currentUnicodeVersion() noexcept Q_DECL_CONST_FUNCTION;
- static bool QT_FASTCALL isPrint(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
- static Q_DECL_CONSTEXPR inline bool isSpace(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION
+ static bool QT_FASTCALL isPrint(uint ucs4) noexcept Q_DECL_CONST_FUNCTION;
+ static Q_DECL_CONSTEXPR inline bool isSpace(uint ucs4) noexcept Q_DECL_CONST_FUNCTION
{
// note that [0x09..0x0d] + 0x85 are exceptional Cc-s and must be handled explicitly
return ucs4 == 0x20 || (ucs4 <= 0x0d && ucs4 >= 0x09)
|| (ucs4 > 127 && (ucs4 == 0x85 || ucs4 == 0xa0 || QChar::isSpace_helper(ucs4)));
}
- static bool QT_FASTCALL isMark(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
- static bool QT_FASTCALL isPunct(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
- static bool QT_FASTCALL isSymbol(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
- static Q_DECL_CONSTEXPR inline bool isLetter(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION
+ static bool QT_FASTCALL isMark(uint ucs4) noexcept Q_DECL_CONST_FUNCTION;
+ static bool QT_FASTCALL isPunct(uint ucs4) noexcept Q_DECL_CONST_FUNCTION;
+ static bool QT_FASTCALL isSymbol(uint ucs4) noexcept Q_DECL_CONST_FUNCTION;
+ static Q_DECL_CONSTEXPR inline bool isLetter(uint ucs4) noexcept Q_DECL_CONST_FUNCTION
{
return (ucs4 >= 'A' && ucs4 <= 'z' && (ucs4 >= 'a' || ucs4 <= 'Z'))
|| (ucs4 > 127 && QChar::isLetter_helper(ucs4));
}
- static Q_DECL_CONSTEXPR inline bool isNumber(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION
+ static Q_DECL_CONSTEXPR inline bool isNumber(uint ucs4) noexcept Q_DECL_CONST_FUNCTION
{ return (ucs4 <= '9' && ucs4 >= '0') || (ucs4 > 127 && QChar::isNumber_helper(ucs4)); }
- static Q_DECL_CONSTEXPR inline bool isLetterOrNumber(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION
+ static Q_DECL_CONSTEXPR inline bool isLetterOrNumber(uint ucs4) noexcept Q_DECL_CONST_FUNCTION
{
return (ucs4 >= 'A' && ucs4 <= 'z' && (ucs4 >= 'a' || ucs4 <= 'Z'))
|| (ucs4 >= '0' && ucs4 <= '9')
|| (ucs4 > 127 && QChar::isLetterOrNumber_helper(ucs4));
}
- static Q_DECL_CONSTEXPR inline bool isDigit(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION
+ static Q_DECL_CONSTEXPR inline bool isDigit(uint ucs4) noexcept Q_DECL_CONST_FUNCTION
{ return (ucs4 <= '9' && ucs4 >= '0') || (ucs4 > 127 && QChar::category(ucs4) == Number_DecimalDigit); }
- static Q_DECL_CONSTEXPR inline bool isLower(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION
+ static Q_DECL_CONSTEXPR inline bool isLower(uint ucs4) noexcept Q_DECL_CONST_FUNCTION
{ return (ucs4 <= 'z' && ucs4 >= 'a') || (ucs4 > 127 && QChar::category(ucs4) == Letter_Lowercase); }
- static Q_DECL_CONSTEXPR inline bool isUpper(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION
+ static Q_DECL_CONSTEXPR inline bool isUpper(uint ucs4) noexcept Q_DECL_CONST_FUNCTION
{ return (ucs4 <= 'Z' && ucs4 >= 'A') || (ucs4 > 127 && QChar::category(ucs4) == Letter_Uppercase); }
- static Q_DECL_CONSTEXPR inline bool isTitleCase(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION
+ static Q_DECL_CONSTEXPR inline bool isTitleCase(uint ucs4) noexcept Q_DECL_CONST_FUNCTION
{ return ucs4 > 127 && QChar::category(ucs4) == Letter_Titlecase; }
private:
- static bool QT_FASTCALL isSpace_helper(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
- static bool QT_FASTCALL isLetter_helper(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
- static bool QT_FASTCALL isNumber_helper(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
- static bool QT_FASTCALL isLetterOrNumber_helper(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
+ static bool QT_FASTCALL isSpace_helper(uint ucs4) noexcept Q_DECL_CONST_FUNCTION;
+ static bool QT_FASTCALL isLetter_helper(uint ucs4) noexcept Q_DECL_CONST_FUNCTION;
+ static bool QT_FASTCALL isNumber_helper(uint ucs4) noexcept Q_DECL_CONST_FUNCTION;
+ static bool QT_FASTCALL isLetterOrNumber_helper(uint ucs4) noexcept Q_DECL_CONST_FUNCTION;
#ifdef QT_NO_CAST_FROM_ASCII
- QChar(char c) Q_DECL_NOTHROW;
- QChar(uchar c) Q_DECL_NOTHROW;
+ QChar(char c) noexcept;
+ QChar(uchar c) noexcept;
#endif
- friend Q_DECL_CONSTEXPR bool operator==(QChar, QChar) Q_DECL_NOTHROW;
- friend Q_DECL_CONSTEXPR bool operator< (QChar, QChar) Q_DECL_NOTHROW;
+ friend Q_DECL_CONSTEXPR bool operator==(QChar, QChar) noexcept;
+ friend Q_DECL_CONSTEXPR bool operator< (QChar, QChar) noexcept;
ushort ucs;
};
Q_DECLARE_TYPEINFO(QChar, Q_MOVABLE_TYPE);
-Q_DECL_CONSTEXPR inline bool operator==(QChar c1, QChar c2) Q_DECL_NOTHROW { return c1.ucs == c2.ucs; }
-Q_DECL_CONSTEXPR inline bool operator< (QChar c1, QChar c2) Q_DECL_NOTHROW { return c1.ucs < c2.ucs; }
+Q_DECL_CONSTEXPR inline bool operator==(QChar c1, QChar c2) noexcept { return c1.ucs == c2.ucs; }
+Q_DECL_CONSTEXPR inline bool operator< (QChar c1, QChar c2) noexcept { return c1.ucs < c2.ucs; }
-Q_DECL_CONSTEXPR inline bool operator!=(QChar c1, QChar c2) Q_DECL_NOTHROW { return !operator==(c1, c2); }
-Q_DECL_CONSTEXPR inline bool operator>=(QChar c1, QChar c2) Q_DECL_NOTHROW { return !operator< (c1, c2); }
-Q_DECL_CONSTEXPR inline bool operator> (QChar c1, QChar c2) Q_DECL_NOTHROW { return operator< (c2, c1); }
-Q_DECL_CONSTEXPR inline bool operator<=(QChar c1, QChar c2) Q_DECL_NOTHROW { return !operator< (c2, c1); }
+Q_DECL_CONSTEXPR inline bool operator!=(QChar c1, QChar c2) noexcept { return !operator==(c1, c2); }
+Q_DECL_CONSTEXPR inline bool operator>=(QChar c1, QChar c2) noexcept { return !operator< (c1, c2); }
+Q_DECL_CONSTEXPR inline bool operator> (QChar c1, QChar c2) noexcept { return operator< (c2, c1); }
+Q_DECL_CONSTEXPR inline bool operator<=(QChar c1, QChar c2) noexcept { return !operator< (c2, c1); }
-Q_DECL_CONSTEXPR inline bool operator==(QChar lhs, std::nullptr_t) Q_DECL_NOTHROW { return lhs.isNull(); }
-Q_DECL_CONSTEXPR inline bool operator< (QChar, std::nullptr_t) Q_DECL_NOTHROW { return false; }
-Q_DECL_CONSTEXPR inline bool operator==(std::nullptr_t, QChar rhs) Q_DECL_NOTHROW { return rhs.isNull(); }
-Q_DECL_CONSTEXPR inline bool operator< (std::nullptr_t, QChar rhs) Q_DECL_NOTHROW { return !rhs.isNull(); }
+Q_DECL_CONSTEXPR inline bool operator==(QChar lhs, std::nullptr_t) noexcept { return lhs.isNull(); }
+Q_DECL_CONSTEXPR inline bool operator< (QChar, std::nullptr_t) noexcept { return false; }
+Q_DECL_CONSTEXPR inline bool operator==(std::nullptr_t, QChar rhs) noexcept { return rhs.isNull(); }
+Q_DECL_CONSTEXPR inline bool operator< (std::nullptr_t, QChar rhs) noexcept { return !rhs.isNull(); }
-Q_DECL_CONSTEXPR inline bool operator!=(QChar lhs, std::nullptr_t) Q_DECL_NOTHROW { return !operator==(lhs, nullptr); }
-Q_DECL_CONSTEXPR inline bool operator>=(QChar lhs, std::nullptr_t) Q_DECL_NOTHROW { return !operator< (lhs, nullptr); }
-Q_DECL_CONSTEXPR inline bool operator> (QChar lhs, std::nullptr_t) Q_DECL_NOTHROW { return operator< (nullptr, lhs); }
-Q_DECL_CONSTEXPR inline bool operator<=(QChar lhs, std::nullptr_t) Q_DECL_NOTHROW { return !operator< (nullptr, lhs); }
+Q_DECL_CONSTEXPR inline bool operator!=(QChar lhs, std::nullptr_t) noexcept { return !operator==(lhs, nullptr); }
+Q_DECL_CONSTEXPR inline bool operator>=(QChar lhs, std::nullptr_t) noexcept { return !operator< (lhs, nullptr); }
+Q_DECL_CONSTEXPR inline bool operator> (QChar lhs, std::nullptr_t) noexcept { return operator< (nullptr, lhs); }
+Q_DECL_CONSTEXPR inline bool operator<=(QChar lhs, std::nullptr_t) noexcept { return !operator< (nullptr, lhs); }
-Q_DECL_CONSTEXPR inline bool operator!=(std::nullptr_t, QChar rhs) Q_DECL_NOTHROW { return !operator==(nullptr, rhs); }
-Q_DECL_CONSTEXPR inline bool operator>=(std::nullptr_t, QChar rhs) Q_DECL_NOTHROW { return !operator< (nullptr, rhs); }
-Q_DECL_CONSTEXPR inline bool operator> (std::nullptr_t, QChar rhs) Q_DECL_NOTHROW { return operator< (rhs, nullptr); }
-Q_DECL_CONSTEXPR inline bool operator<=(std::nullptr_t, QChar rhs) Q_DECL_NOTHROW { return !operator< (rhs, nullptr); }
+Q_DECL_CONSTEXPR inline bool operator!=(std::nullptr_t, QChar rhs) noexcept { return !operator==(nullptr, rhs); }
+Q_DECL_CONSTEXPR inline bool operator>=(std::nullptr_t, QChar rhs) noexcept { return !operator< (nullptr, rhs); }
+Q_DECL_CONSTEXPR inline bool operator> (std::nullptr_t, QChar rhs) noexcept { return operator< (rhs, nullptr); }
+Q_DECL_CONSTEXPR inline bool operator<=(std::nullptr_t, QChar rhs) noexcept { return !operator< (rhs, nullptr); }
#ifndef QT_NO_DATASTREAM
Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, QChar);
diff --git a/src/corelib/tools/qcollator.h b/src/corelib/tools/qcollator.h
index 700de739bb..6c76ef038f 100644
--- a/src/corelib/tools/qcollator.h
+++ b/src/corelib/tools/qcollator.h
@@ -58,10 +58,10 @@ public:
~QCollatorSortKey();
QCollatorSortKey &operator=(const QCollatorSortKey &other);
#ifdef Q_COMPILER_RVALUE_REFS
- inline QCollatorSortKey &operator=(QCollatorSortKey &&other) Q_DECL_NOTHROW
+ inline QCollatorSortKey &operator=(QCollatorSortKey &&other) noexcept
{ swap(other); return *this; }
#endif
- void swap(QCollatorSortKey &other) Q_DECL_NOTHROW
+ void swap(QCollatorSortKey &other) noexcept
{ d.swap(other.d); }
int compare(const QCollatorSortKey &key) const;
@@ -88,13 +88,13 @@ public:
~QCollator();
QCollator &operator=(const QCollator &);
#ifdef Q_COMPILER_RVALUE_REFS
- QCollator(QCollator &&other) Q_DECL_NOTHROW
+ QCollator(QCollator &&other) noexcept
: d(other.d) { other.d = nullptr; }
- QCollator &operator=(QCollator &&other) Q_DECL_NOTHROW
+ QCollator &operator=(QCollator &&other) noexcept
{ swap(other); return *this; }
#endif
- void swap(QCollator &other) Q_DECL_NOTHROW
+ void swap(QCollator &other) noexcept
{ qSwap(d, other.d); }
void setLocale(const QLocale &locale);
diff --git a/src/corelib/tools/qcommandlineoption.cpp b/src/corelib/tools/qcommandlineoption.cpp
index c2b86014ba..aff684fad2 100644
--- a/src/corelib/tools/qcommandlineoption.cpp
+++ b/src/corelib/tools/qcommandlineoption.cpp
@@ -254,7 +254,7 @@ namespace {
typedef QString argument_type;
Q_NEVER_INLINE
- result_type operator()(const QString &name) const Q_DECL_NOEXCEPT
+ result_type operator()(const QString &name) const noexcept
{
if (Q_UNLIKELY(name.isEmpty()))
return warn("be empty");
@@ -271,7 +271,7 @@ namespace {
}
Q_NEVER_INLINE
- static bool warn(const char *what) Q_DECL_NOEXCEPT
+ static bool warn(const char *what) noexcept
{
qWarning("QCommandLineOption: Option names cannot %s", what);
return true;
diff --git a/src/corelib/tools/qcommandlineoption.h b/src/corelib/tools/qcommandlineoption.h
index 276be042de..643427f6fb 100644
--- a/src/corelib/tools/qcommandlineoption.h
+++ b/src/corelib/tools/qcommandlineoption.h
@@ -72,10 +72,10 @@ public:
QCommandLineOption &operator=(const QCommandLineOption &other);
#ifdef Q_COMPILER_RVALUE_REFS
- QCommandLineOption &operator=(QCommandLineOption &&other) Q_DECL_NOTHROW { swap(other); return *this; }
+ QCommandLineOption &operator=(QCommandLineOption &&other) noexcept { swap(other); return *this; }
#endif
- void swap(QCommandLineOption &other) Q_DECL_NOTHROW
+ void swap(QCommandLineOption &other) noexcept
{ qSwap(d, other.d); }
QStringList names() const;
diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp
index fafe7731ce..969065ffee 100644
--- a/src/corelib/tools/qdatetime.cpp
+++ b/src/corelib/tools/qdatetime.cpp
@@ -256,7 +256,7 @@ static QString toOffsetString(Qt::DateFormat format, int offset)
#if QT_CONFIG(datestring)
// Parse offset in [+-]HH[[:]mm] format
-static int fromOffsetString(const QStringRef &offsetString, bool *valid) Q_DECL_NOTHROW
+static int fromOffsetString(const QStringRef &offsetString, bool *valid) noexcept
{
*valid = false;
@@ -1464,9 +1464,8 @@ bool QDate::isLeapYear(int y)
/*!
\fn QTime::QTime()
- Constructs a null time object. A null time can be a QTime(0, 0, 0, 0)
- (i.e., midnight) object, except that isNull() returns \c true and isValid()
- returns \c false.
+ Constructs a null time object. For a null time, isNull() returns \c true and
+ isValid() returns \c false. If you need a zero time, use QTime(0, 0).
\sa isNull(), isValid()
*/
@@ -3143,7 +3142,7 @@ QDateTime::QDateTime() noexcept(Data::CanBeSmall)
*/
QDateTime::QDateTime(const QDate &date)
- : d(QDateTimePrivate::create(date, QTime(0, 0, 0), Qt::LocalTime, 0))
+ : d(QDateTimePrivate::create(date, QTime(0, 0), Qt::LocalTime, 0))
{
}
@@ -3211,7 +3210,7 @@ QDateTime::QDateTime(const QDate &date, const QTime &time, const QTimeZone &time
/*!
Constructs a copy of the \a other datetime.
*/
-QDateTime::QDateTime(const QDateTime &other) Q_DECL_NOTHROW
+QDateTime::QDateTime(const QDateTime &other) noexcept
: d(other.d)
{
}
@@ -3221,7 +3220,7 @@ QDateTime::QDateTime(const QDateTime &other) Q_DECL_NOTHROW
Moves the content of the temporary \a other datetime to this object and
leaves \a other in an unspecified (but proper) state.
*/
-QDateTime::QDateTime(QDateTime &&other) Q_DECL_NOTHROW
+QDateTime::QDateTime(QDateTime &&other) noexcept
: d(std::move(other.d))
{
}
@@ -3238,7 +3237,7 @@ QDateTime::~QDateTime()
copy.
*/
-QDateTime &QDateTime::operator=(const QDateTime &other) Q_DECL_NOTHROW
+QDateTime &QDateTime::operator=(const QDateTime &other) noexcept
{
d = other.d;
return *this;
@@ -4466,7 +4465,7 @@ QDateTime QDateTime::currentDateTimeUtc()
return QDateTime(d, t, Qt::UTC);
}
-qint64 QDateTime::currentMSecsSinceEpoch() Q_DECL_NOTHROW
+qint64 QDateTime::currentMSecsSinceEpoch() noexcept
{
SYSTEMTIME st;
memset(&st, 0, sizeof(SYSTEMTIME));
@@ -4477,7 +4476,7 @@ qint64 QDateTime::currentMSecsSinceEpoch() Q_DECL_NOTHROW
- julianDayFromDate(1970, 1, 1)) * Q_INT64_C(86400000);
}
-qint64 QDateTime::currentSecsSinceEpoch() Q_DECL_NOTHROW
+qint64 QDateTime::currentSecsSinceEpoch() noexcept
{
SYSTEMTIME st;
memset(&st, 0, sizeof(SYSTEMTIME));
@@ -4509,7 +4508,7 @@ QDateTime QDateTime::currentDateTimeUtc()
return fromMSecsSinceEpoch(currentMSecsSinceEpoch(), Qt::UTC);
}
-qint64 QDateTime::currentMSecsSinceEpoch() Q_DECL_NOTHROW
+qint64 QDateTime::currentMSecsSinceEpoch() noexcept
{
// posix compliant system
// we have milliseconds
@@ -4518,7 +4517,7 @@ qint64 QDateTime::currentMSecsSinceEpoch() Q_DECL_NOTHROW
return qint64(tv.tv_sec) * Q_INT64_C(1000) + tv.tv_usec / 1000;
}
-qint64 QDateTime::currentSecsSinceEpoch() Q_DECL_NOTHROW
+qint64 QDateTime::currentSecsSinceEpoch() noexcept
{
struct timeval tv;
gettimeofday(&tv, 0);
@@ -5415,7 +5414,7 @@ uint qHash(const QDateTime &key, uint seed)
Returns the hash value for the \a key, using \a seed to seed the calculation.
*/
-uint qHash(const QDate &key, uint seed) Q_DECL_NOTHROW
+uint qHash(const QDate &key, uint seed) noexcept
{
return qHash(key.toJulianDay(), seed);
}
@@ -5426,7 +5425,7 @@ uint qHash(const QDate &key, uint seed) Q_DECL_NOTHROW
Returns the hash value for the \a key, using \a seed to seed the calculation.
*/
-uint qHash(const QTime &key, uint seed) Q_DECL_NOTHROW
+uint qHash(const QTime &key, uint seed) noexcept
{
return qHash(key.msecsSinceStartOfDay(), seed);
}
diff --git a/src/corelib/tools/qdatetime.h b/src/corelib/tools/qdatetime.h
index 66947881c8..fc901234ec 100644
--- a/src/corelib/tools/qdatetime.h
+++ b/src/corelib/tools/qdatetime.h
@@ -266,16 +266,16 @@ public:
#if QT_CONFIG(timezone)
QDateTime(const QDate &date, const QTime &time, const QTimeZone &timeZone);
#endif // timezone
- QDateTime(const QDateTime &other) Q_DECL_NOTHROW;
- QDateTime(QDateTime &&other) Q_DECL_NOTHROW;
+ QDateTime(const QDateTime &other) noexcept;
+ QDateTime(QDateTime &&other) noexcept;
~QDateTime();
#ifdef Q_COMPILER_RVALUE_REFS
- QDateTime &operator=(QDateTime &&other) Q_DECL_NOTHROW { swap(other); return *this; }
+ QDateTime &operator=(QDateTime &&other) noexcept { swap(other); return *this; }
#endif
- QDateTime &operator=(const QDateTime &other) Q_DECL_NOTHROW;
+ QDateTime &operator=(const QDateTime &other) noexcept;
- void swap(QDateTime &other) Q_DECL_NOTHROW { qSwap(d.d, other.d.d); }
+ void swap(QDateTime &other) noexcept { qSwap(d.d, other.d.d); }
bool isNull() const;
bool isValid() const;
@@ -366,8 +366,8 @@ public:
static QDateTime fromSecsSinceEpoch(qint64 secs, const QTimeZone &timeZone);
#endif
- static qint64 currentMSecsSinceEpoch() Q_DECL_NOTHROW;
- static qint64 currentSecsSinceEpoch() Q_DECL_NOTHROW;
+ static qint64 currentMSecsSinceEpoch() noexcept;
+ static qint64 currentSecsSinceEpoch() noexcept;
#if defined(Q_OS_DARWIN) || defined(Q_QDOC)
static QDateTime fromCFDate(CFDateRef date);
@@ -410,8 +410,8 @@ Q_CORE_EXPORT QDebug operator<<(QDebug, const QDateTime &);
// QDateTime is not noexcept for now -- to be revised once
// timezone and calendaring support is added
Q_CORE_EXPORT uint qHash(const QDateTime &key, uint seed = 0);
-Q_CORE_EXPORT uint qHash(const QDate &key, uint seed = 0) Q_DECL_NOTHROW;
-Q_CORE_EXPORT uint qHash(const QTime &key, uint seed = 0) Q_DECL_NOTHROW;
+Q_CORE_EXPORT uint qHash(const QDate &key, uint seed = 0) noexcept;
+Q_CORE_EXPORT uint qHash(const QTime &key, uint seed = 0) noexcept;
QT_END_NAMESPACE
diff --git a/src/corelib/tools/qeasingcurve.h b/src/corelib/tools/qeasingcurve.h
index 74bde5825a..1791f19199 100644
--- a/src/corelib/tools/qeasingcurve.h
+++ b/src/corelib/tools/qeasingcurve.h
@@ -81,12 +81,12 @@ public:
QEasingCurve &operator=(const QEasingCurve &other)
{ if ( this != &other ) { QEasingCurve copy(other); swap(copy); } return *this; }
#ifdef Q_COMPILER_RVALUE_REFS
- QEasingCurve(QEasingCurve &&other) Q_DECL_NOTHROW : d_ptr(other.d_ptr) { other.d_ptr = nullptr; }
- QEasingCurve &operator=(QEasingCurve &&other) Q_DECL_NOTHROW
+ QEasingCurve(QEasingCurve &&other) noexcept : d_ptr(other.d_ptr) { other.d_ptr = nullptr; }
+ QEasingCurve &operator=(QEasingCurve &&other) noexcept
{ qSwap(d_ptr, other.d_ptr); return *this; }
#endif
- void swap(QEasingCurve &other) Q_DECL_NOTHROW { qSwap(d_ptr, other.d_ptr); }
+ void swap(QEasingCurve &other) noexcept { qSwap(d_ptr, other.d_ptr); }
bool operator==(const QEasingCurve &other) const;
inline bool operator!=(const QEasingCurve &other) const
diff --git a/src/corelib/tools/qhash.cpp b/src/corelib/tools/qhash.cpp
index 32e9a4269c..dd22a38be1 100644
--- a/src/corelib/tools/qhash.cpp
+++ b/src/corelib/tools/qhash.cpp
@@ -197,7 +197,7 @@ static uint crc32(...)
}
#endif
-static inline uint hash(const uchar *p, size_t len, uint seed) Q_DECL_NOTHROW
+static inline uint hash(const uchar *p, size_t len, uint seed) noexcept
{
uint h = seed;
@@ -210,12 +210,12 @@ static inline uint hash(const uchar *p, size_t len, uint seed) Q_DECL_NOTHROW
return h;
}
-uint qHashBits(const void *p, size_t len, uint seed) Q_DECL_NOTHROW
+uint qHashBits(const void *p, size_t len, uint seed) noexcept
{
return hash(static_cast<const uchar*>(p), int(len), seed);
}
-static inline uint hash(const QChar *p, size_t len, uint seed) Q_DECL_NOTHROW
+static inline uint hash(const QChar *p, size_t len, uint seed) noexcept
{
uint h = seed;
@@ -228,29 +228,29 @@ static inline uint hash(const QChar *p, size_t len, uint seed) Q_DECL_NOTHROW
return h;
}
-uint qHash(const QByteArray &key, uint seed) Q_DECL_NOTHROW
+uint qHash(const QByteArray &key, uint seed) noexcept
{
return hash(reinterpret_cast<const uchar *>(key.constData()), size_t(key.size()), seed);
}
#if QT_STRINGVIEW_LEVEL < 2
-uint qHash(const QString &key, uint seed) Q_DECL_NOTHROW
+uint qHash(const QString &key, uint seed) noexcept
{
return hash(key.unicode(), size_t(key.size()), seed);
}
-uint qHash(const QStringRef &key, uint seed) Q_DECL_NOTHROW
+uint qHash(const QStringRef &key, uint seed) noexcept
{
return hash(key.unicode(), size_t(key.size()), seed);
}
#endif
-uint qHash(QStringView key, uint seed) Q_DECL_NOTHROW
+uint qHash(QStringView key, uint seed) noexcept
{
return hash(key.data(), key.size(), seed);
}
-uint qHash(const QBitArray &bitArray, uint seed) Q_DECL_NOTHROW
+uint qHash(const QBitArray &bitArray, uint seed) noexcept
{
int m = bitArray.d.size() - 1;
uint result = hash(reinterpret_cast<const uchar *>(bitArray.d.constData()),
@@ -264,7 +264,7 @@ uint qHash(const QBitArray &bitArray, uint seed) Q_DECL_NOTHROW
return result;
}
-uint qHash(QLatin1String key, uint seed) Q_DECL_NOTHROW
+uint qHash(QLatin1String key, uint seed) noexcept
{
return hash(reinterpret_cast<const uchar *>(key.data()), size_t(key.size()), seed);
}
@@ -398,7 +398,7 @@ void qSetGlobalQHashSeed(int newSeed)
This function can hash discontiguous memory by invoking it on each chunk,
passing the previous's result in the next call's \a chained argument.
*/
-uint qt_hash(QStringView key, uint chained) Q_DECL_NOTHROW
+uint qt_hash(QStringView key, uint chained) noexcept
{
auto n = key.size();
auto p = key.utf16();
@@ -938,7 +938,7 @@ void QHashData::checkSanity()
Returns the hash value for the \a key, using \a seed to seed the calculation.
*/
-uint qHash(float key, uint seed) Q_DECL_NOTHROW
+uint qHash(float key, uint seed) noexcept
{
return key != 0.0f ? hash(reinterpret_cast<const uchar *>(&key), sizeof(key), seed) : seed ;
}
@@ -948,7 +948,7 @@ uint qHash(float key, uint seed) Q_DECL_NOTHROW
Returns the hash value for the \a key, using \a seed to seed the calculation.
*/
-uint qHash(double key, uint seed) Q_DECL_NOTHROW
+uint qHash(double key, uint seed) noexcept
{
return key != 0.0 ? hash(reinterpret_cast<const uchar *>(&key), sizeof(key), seed) : seed ;
}
@@ -959,7 +959,7 @@ uint qHash(double key, uint seed) Q_DECL_NOTHROW
Returns the hash value for the \a key, using \a seed to seed the calculation.
*/
-uint qHash(long double key, uint seed) Q_DECL_NOTHROW
+uint qHash(long double key, uint seed) noexcept
{
return key != 0.0L ? hash(reinterpret_cast<const uchar *>(&key), sizeof(key), seed) : seed ;
}
diff --git a/src/corelib/tools/qhash.h b/src/corelib/tools/qhash.h
index 7e6506f796..120ee9cc85 100644
--- a/src/corelib/tools/qhash.h
+++ b/src/corelib/tools/qhash.h
@@ -240,7 +240,7 @@ class QHash
static inline int alignOfNode() { return qMax<int>(sizeof(void*), Q_ALIGNOF(Node)); }
public:
- inline QHash() Q_DECL_NOTHROW : d(const_cast<QHashData *>(&QHashData::shared_null)) { }
+ inline QHash() noexcept : d(const_cast<QHashData *>(&QHashData::shared_null)) { }
#ifdef Q_COMPILER_INITIALIZER_LISTS
inline QHash(std::initializer_list<std::pair<Key,T> > list)
: d(const_cast<QHashData *>(&QHashData::shared_null))
@@ -255,11 +255,11 @@ public:
QHash &operator=(const QHash &other);
#ifdef Q_COMPILER_RVALUE_REFS
- QHash(QHash &&other) Q_DECL_NOTHROW : d(other.d) { other.d = const_cast<QHashData *>(&QHashData::shared_null); }
- QHash &operator=(QHash &&other) Q_DECL_NOTHROW
+ QHash(QHash &&other) noexcept : d(other.d) { other.d = const_cast<QHashData *>(&QHashData::shared_null); }
+ QHash &operator=(QHash &&other) noexcept
{ QHash moved(std::move(other)); swap(moved); return *this; }
#endif
- void swap(QHash &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+ void swap(QHash &other) noexcept { qSwap(d, other.d); }
bool operator==(const QHash &other) const;
bool operator!=(const QHash &other) const { return !(*this == other); }
@@ -473,7 +473,7 @@ public:
inline const_key_value_iterator constKeyValueEnd() const { return const_key_value_iterator(end()); }
QPair<iterator, iterator> equal_range(const Key &key);
- QPair<const_iterator, const_iterator> equal_range(const Key &key) const Q_DECL_NOTHROW;
+ QPair<const_iterator, const_iterator> equal_range(const Key &key) const noexcept;
iterator erase(iterator it) { return erase(const_iterator(it.i)); }
iterator erase(const_iterator it);
@@ -512,11 +512,11 @@ private:
static void duplicateNode(QHashData::Node *originalNode, void *newNode);
- bool isValidIterator(const iterator &it) const Q_DECL_NOTHROW
+ bool isValidIterator(const iterator &it) const noexcept
{ return isValidNode(it.i); }
- bool isValidIterator(const const_iterator &it) const Q_DECL_NOTHROW
+ bool isValidIterator(const const_iterator &it) const noexcept
{ return isValidNode(it.i); }
- bool isValidNode(QHashData::Node *node) const Q_DECL_NOTHROW
+ bool isValidNode(QHashData::Node *node) const noexcept
{
#if defined(QT_DEBUG) && !defined(Q_HASH_NO_ITERATOR_DEBUG)
while (node->next)
@@ -993,7 +993,7 @@ QPair<typename QHash<Key, T>::iterator, typename QHash<Key, T>::iterator> QHash<
}
template <class Key, class T>
-QPair<typename QHash<Key, T>::const_iterator, typename QHash<Key, T>::const_iterator> QHash<Key, T>::equal_range(const Key &akey) const Q_DECL_NOTHROW
+QPair<typename QHash<Key, T>::const_iterator, typename QHash<Key, T>::const_iterator> QHash<Key, T>::equal_range(const Key &akey) const noexcept
{
Node *node = *findNode(akey);
const_iterator firstIt = const_iterator(node);
@@ -1020,7 +1020,7 @@ template <class Key, class T>
class QMultiHash : public QHash<Key, T>
{
public:
- QMultiHash() Q_DECL_NOTHROW {}
+ QMultiHash() noexcept {}
#ifdef Q_COMPILER_INITIALIZER_LISTS
inline QMultiHash(std::initializer_list<std::pair<Key,T> > list)
{
@@ -1034,9 +1034,9 @@ public:
QMultiHash(const QHash<Key, T> &other) : QHash<Key, T>(other) {}
#ifdef Q_COMPILER_RVALUE_REFS
- QMultiHash(QHash<Key, T> &&other) Q_DECL_NOTHROW : QHash<Key, T>(std::move(other)) {}
+ QMultiHash(QHash<Key, T> &&other) noexcept : QHash<Key, T>(std::move(other)) {}
#endif
- void swap(QMultiHash &other) Q_DECL_NOTHROW { QHash<Key, T>::swap(other); } // prevent QMultiHash<->QHash swaps
+ void swap(QMultiHash &other) noexcept { QHash<Key, T>::swap(other); } // prevent QMultiHash<->QHash swaps
inline typename QHash<Key, T>::iterator replace(const Key &key, const T &value)
{ return QHash<Key, T>::insert(key, value); }
diff --git a/src/corelib/tools/qhashfunctions.h b/src/corelib/tools/qhashfunctions.h
index 1d30e71053..5e714806ff 100644
--- a/src/corelib/tools/qhashfunctions.h
+++ b/src/corelib/tools/qhashfunctions.h
@@ -67,49 +67,49 @@ class QLatin1String;
Q_CORE_EXPORT int qGlobalQHashSeed();
Q_CORE_EXPORT void qSetGlobalQHashSeed(int newSeed);
-Q_CORE_EXPORT Q_DECL_PURE_FUNCTION uint qHashBits(const void *p, size_t size, uint seed = 0) Q_DECL_NOTHROW;
-
-Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(char key, uint seed = 0) Q_DECL_NOTHROW { return uint(key) ^ seed; }
-Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(uchar key, uint seed = 0) Q_DECL_NOTHROW { return uint(key) ^ seed; }
-Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(signed char key, uint seed = 0) Q_DECL_NOTHROW { return uint(key) ^ seed; }
-Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(ushort key, uint seed = 0) Q_DECL_NOTHROW { return uint(key) ^ seed; }
-Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(short key, uint seed = 0) Q_DECL_NOTHROW { return uint(key) ^ seed; }
-Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(uint key, uint seed = 0) Q_DECL_NOTHROW { return key ^ seed; }
-Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(int key, uint seed = 0) Q_DECL_NOTHROW { return uint(key) ^ seed; }
-Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(ulong key, uint seed = 0) Q_DECL_NOTHROW
+Q_CORE_EXPORT Q_DECL_PURE_FUNCTION uint qHashBits(const void *p, size_t size, uint seed = 0) noexcept;
+
+Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(char key, uint seed = 0) noexcept { return uint(key) ^ seed; }
+Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(uchar key, uint seed = 0) noexcept { return uint(key) ^ seed; }
+Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(signed char key, uint seed = 0) noexcept { return uint(key) ^ seed; }
+Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(ushort key, uint seed = 0) noexcept { return uint(key) ^ seed; }
+Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(short key, uint seed = 0) noexcept { return uint(key) ^ seed; }
+Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(uint key, uint seed = 0) noexcept { return key ^ seed; }
+Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(int key, uint seed = 0) noexcept { return uint(key) ^ seed; }
+Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(ulong key, uint seed = 0) noexcept
{
return (sizeof(ulong) > sizeof(uint))
? (uint(((key >> (8 * sizeof(uint) - 1)) ^ key) & (~0U)) ^ seed)
: (uint(key & (~0U)) ^ seed);
}
-Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(long key, uint seed = 0) Q_DECL_NOTHROW { return qHash(ulong(key), seed); }
-Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(quint64 key, uint seed = 0) Q_DECL_NOTHROW
+Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(long key, uint seed = 0) noexcept { return qHash(ulong(key), seed); }
+Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(quint64 key, uint seed = 0) noexcept
{
return uint(((key >> (8 * sizeof(uint) - 1)) ^ key) & (~0U)) ^ seed;
}
-Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(qint64 key, uint seed = 0) Q_DECL_NOTHROW { return qHash(quint64(key), seed); }
-Q_CORE_EXPORT Q_DECL_CONST_FUNCTION uint qHash(float key, uint seed = 0) Q_DECL_NOTHROW;
-Q_CORE_EXPORT Q_DECL_CONST_FUNCTION uint qHash(double key, uint seed = 0) Q_DECL_NOTHROW;
+Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(qint64 key, uint seed = 0) noexcept { return qHash(quint64(key), seed); }
+Q_CORE_EXPORT Q_DECL_CONST_FUNCTION uint qHash(float key, uint seed = 0) noexcept;
+Q_CORE_EXPORT Q_DECL_CONST_FUNCTION uint qHash(double key, uint seed = 0) noexcept;
#if !defined(Q_OS_DARWIN) || defined(Q_CLANG_QDOC)
-Q_CORE_EXPORT Q_DECL_CONST_FUNCTION uint qHash(long double key, uint seed = 0) Q_DECL_NOTHROW;
+Q_CORE_EXPORT Q_DECL_CONST_FUNCTION uint qHash(long double key, uint seed = 0) noexcept;
#endif
-Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(const QChar key, uint seed = 0) Q_DECL_NOTHROW { return qHash(key.unicode(), seed); }
-Q_CORE_EXPORT Q_DECL_PURE_FUNCTION uint qHash(const QByteArray &key, uint seed = 0) Q_DECL_NOTHROW;
+Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(const QChar key, uint seed = 0) noexcept { return qHash(key.unicode(), seed); }
+Q_CORE_EXPORT Q_DECL_PURE_FUNCTION uint qHash(const QByteArray &key, uint seed = 0) noexcept;
#if QT_STRINGVIEW_LEVEL < 2
-Q_CORE_EXPORT Q_DECL_PURE_FUNCTION uint qHash(const QString &key, uint seed = 0) Q_DECL_NOTHROW;
-Q_CORE_EXPORT Q_DECL_PURE_FUNCTION uint qHash(const QStringRef &key, uint seed = 0) Q_DECL_NOTHROW;
+Q_CORE_EXPORT Q_DECL_PURE_FUNCTION uint qHash(const QString &key, uint seed = 0) noexcept;
+Q_CORE_EXPORT Q_DECL_PURE_FUNCTION uint qHash(const QStringRef &key, uint seed = 0) noexcept;
#endif
-Q_CORE_EXPORT Q_DECL_PURE_FUNCTION uint qHash(QStringView key, uint seed = 0) Q_DECL_NOTHROW;
-Q_CORE_EXPORT Q_DECL_PURE_FUNCTION uint qHash(const QBitArray &key, uint seed = 0) Q_DECL_NOTHROW;
-Q_CORE_EXPORT Q_DECL_PURE_FUNCTION uint qHash(QLatin1String key, uint seed = 0) Q_DECL_NOTHROW;
-Q_CORE_EXPORT Q_DECL_PURE_FUNCTION uint qt_hash(QStringView key, uint chained = 0) Q_DECL_NOTHROW;
+Q_CORE_EXPORT Q_DECL_PURE_FUNCTION uint qHash(QStringView key, uint seed = 0) noexcept;
+Q_CORE_EXPORT Q_DECL_PURE_FUNCTION uint qHash(const QBitArray &key, uint seed = 0) noexcept;
+Q_CORE_EXPORT Q_DECL_PURE_FUNCTION uint qHash(QLatin1String key, uint seed = 0) noexcept;
+Q_CORE_EXPORT Q_DECL_PURE_FUNCTION uint qt_hash(QStringView key, uint chained = 0) noexcept;
-Q_DECL_CONST_FUNCTION inline uint qHash(std::nullptr_t, uint seed = 0) Q_DECL_NOTHROW
+Q_DECL_CONST_FUNCTION inline uint qHash(std::nullptr_t, uint seed = 0) noexcept
{
return qHash(reinterpret_cast<quintptr>(nullptr), seed);
}
-template <class T> inline uint qHash(const T *key, uint seed = 0) Q_DECL_NOTHROW
+template <class T> inline uint qHash(const T *key, uint seed = 0) noexcept
{
return qHash(reinterpret_cast<quintptr>(key), seed);
}
diff --git a/src/corelib/tools/qiterator.h b/src/corelib/tools/qiterator.h
index f659e88b5e..82212c3eb5 100644
--- a/src/corelib/tools/qiterator.h
+++ b/src/corelib/tools/qiterator.h
@@ -197,8 +197,8 @@ public:
return std::pair<Key, T>(i.key(), i.value());
}
- friend bool operator==(QKeyValueIterator lhs, QKeyValueIterator rhs) Q_DECL_NOEXCEPT { return lhs.i == rhs.i; }
- friend bool operator!=(QKeyValueIterator lhs, QKeyValueIterator rhs) Q_DECL_NOEXCEPT { return lhs.i != rhs.i; }
+ friend bool operator==(QKeyValueIterator lhs, QKeyValueIterator rhs) noexcept { return lhs.i == rhs.i; }
+ friend bool operator!=(QKeyValueIterator lhs, QKeyValueIterator rhs) noexcept { return lhs.i != rhs.i; }
inline QKeyValueIterator &operator++() { ++i; return *this; }
inline QKeyValueIterator operator++(int) { return QKeyValueIterator(i++);}
diff --git a/src/corelib/tools/qlinkedlist.h b/src/corelib/tools/qlinkedlist.h
index 1e6d4df474..91367a74b3 100644
--- a/src/corelib/tools/qlinkedlist.h
+++ b/src/corelib/tools/qlinkedlist.h
@@ -80,7 +80,7 @@ class QLinkedList
union { QLinkedListData *d; QLinkedListNode<T> *e; };
public:
- inline QLinkedList() Q_DECL_NOTHROW : d(const_cast<QLinkedListData *>(&QLinkedListData::shared_null)) { }
+ inline QLinkedList() noexcept : d(const_cast<QLinkedListData *>(&QLinkedListData::shared_null)) { }
inline QLinkedList(const QLinkedList<T> &l) : d(l.d) { d->ref.ref(); if (!d->sharable) detach(); }
#if defined(Q_COMPILER_INITIALIZER_LISTS)
inline QLinkedList(std::initializer_list<T> list)
@@ -92,12 +92,12 @@ public:
~QLinkedList();
QLinkedList<T> &operator=(const QLinkedList<T> &);
#ifdef Q_COMPILER_RVALUE_REFS
- QLinkedList(QLinkedList<T> &&other) Q_DECL_NOTHROW
+ QLinkedList(QLinkedList<T> &&other) noexcept
: d(other.d) { other.d = const_cast<QLinkedListData *>(&QLinkedListData::shared_null); }
- QLinkedList<T> &operator=(QLinkedList<T> &&other) Q_DECL_NOTHROW
+ QLinkedList<T> &operator=(QLinkedList<T> &&other) noexcept
{ QLinkedList moved(std::move(other)); swap(moved); return *this; }
#endif
- inline void swap(QLinkedList<T> &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+ inline void swap(QLinkedList<T> &other) noexcept { qSwap(d, other.d); }
bool operator==(const QLinkedList<T> &l) const;
inline bool operator!=(const QLinkedList<T> &l) const { return !(*this == l); }
@@ -137,10 +137,10 @@ public:
inline iterator() : i(nullptr) {}
inline iterator(Node *n) : i(n) {}
#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
- iterator(const iterator &other) Q_DECL_NOTHROW : i(other.i) {}
- iterator &operator=(const iterator &other) Q_DECL_NOTHROW { i = other.i; return *this; }
- iterator(iterator &&other) Q_DECL_NOTHROW : i(other.i) {}
- iterator &operator=(iterator &&other) Q_DECL_NOTHROW { return *this = other; }
+ iterator(const iterator &other) noexcept : i(other.i) {}
+ iterator &operator=(const iterator &other) noexcept { i = other.i; return *this; }
+ iterator(iterator &&other) noexcept : i(other.i) {}
+ iterator &operator=(iterator &&other) noexcept { return *this = other; }
#endif
inline T &operator*() const { return i->t; }
inline T *operator->() const { return &i->t; }
@@ -176,10 +176,10 @@ public:
inline const_iterator(Node *n) : i(n) {}
inline const_iterator(iterator ci) : i(ci.i){}
#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
- const_iterator(const const_iterator &other) Q_DECL_NOTHROW : i(other.i) {}
- const_iterator &operator=(const const_iterator &other) Q_DECL_NOTHROW { i = other.i; return *this; }
- const_iterator(const_iterator &&other) Q_DECL_NOTHROW : i(other.i) {}
- const_iterator &operator=(const_iterator &&other) Q_DECL_NOTHROW { return *this = other; }
+ const_iterator(const const_iterator &other) noexcept : i(other.i) {}
+ const_iterator &operator=(const const_iterator &other) noexcept { i = other.i; return *this; }
+ const_iterator(const_iterator &&other) noexcept : i(other.i) {}
+ const_iterator &operator=(const_iterator &&other) noexcept { return *this = other; }
#endif
inline const T &operator*() const { return i->t; }
inline const T *operator->() const { return &i->t; }
@@ -203,20 +203,20 @@ public:
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
inline iterator begin() { detach(); return e->n; }
- inline const_iterator begin() const Q_DECL_NOTHROW { return e->n; }
- inline const_iterator cbegin() const Q_DECL_NOTHROW { return e->n; }
- inline const_iterator constBegin() const Q_DECL_NOTHROW { return e->n; }
+ inline const_iterator begin() const noexcept { return e->n; }
+ inline const_iterator cbegin() const noexcept { return e->n; }
+ inline const_iterator constBegin() const noexcept { return e->n; }
inline iterator end() { detach(); return e; }
- inline const_iterator end() const Q_DECL_NOTHROW { return e; }
- inline const_iterator cend() const Q_DECL_NOTHROW { return e; }
- inline const_iterator constEnd() const Q_DECL_NOTHROW { return e; }
+ inline const_iterator end() const noexcept { return e; }
+ inline const_iterator cend() const noexcept { return e; }
+ inline const_iterator constEnd() const noexcept { return e; }
reverse_iterator rbegin() { return reverse_iterator(end()); }
reverse_iterator rend() { return reverse_iterator(begin()); }
- const_reverse_iterator rbegin() const Q_DECL_NOTHROW { return const_reverse_iterator(end()); }
- const_reverse_iterator rend() const Q_DECL_NOTHROW { return const_reverse_iterator(begin()); }
- const_reverse_iterator crbegin() const Q_DECL_NOTHROW { return const_reverse_iterator(end()); }
- const_reverse_iterator crend() const Q_DECL_NOTHROW { return const_reverse_iterator(begin()); }
+ const_reverse_iterator rbegin() const noexcept { return const_reverse_iterator(end()); }
+ const_reverse_iterator rend() const noexcept { return const_reverse_iterator(begin()); }
+ const_reverse_iterator crbegin() const noexcept { return const_reverse_iterator(end()); }
+ const_reverse_iterator crend() const noexcept { return const_reverse_iterator(begin()); }
iterator insert(iterator before, const T &t);
iterator erase(iterator pos);
diff --git a/src/corelib/tools/qlist.h b/src/corelib/tools/qlist.h
index 7532997c93..77d8df4a88 100644
--- a/src/corelib/tools/qlist.h
+++ b/src/corelib/tools/qlist.h
@@ -111,11 +111,11 @@ struct Q_CORE_EXPORT QListData {
void remove(int i);
void remove(int i, int n);
void move(int from, int to);
- inline int size() const Q_DECL_NOTHROW { return d->end - d->begin; }
- inline bool isEmpty() const Q_DECL_NOTHROW { return d->end == d->begin; }
- inline void **at(int i) const Q_DECL_NOTHROW { return d->array + d->begin + i; }
- inline void **begin() const Q_DECL_NOTHROW { return d->array + d->begin; }
- inline void **end() const Q_DECL_NOTHROW { return d->array + d->end; }
+ inline int size() const noexcept { return d->end - d->begin; }
+ inline bool isEmpty() const noexcept { return d->end == d->begin; }
+ inline void **at(int i) const noexcept { return d->array + d->begin + i; }
+ inline void **begin() const noexcept { return d->array + d->begin; }
+ inline void **end() const noexcept { return d->array + d->end; }
};
namespace QtPrivate {
@@ -156,17 +156,17 @@ private:
union { QListData p; QListData::Data *d; };
public:
- inline QList() Q_DECL_NOTHROW : d(const_cast<QListData::Data *>(&QListData::shared_null)) { }
+ inline QList() noexcept : d(const_cast<QListData::Data *>(&QListData::shared_null)) { }
QList(const QList<T> &l);
~QList();
QList<T> &operator=(const QList<T> &l);
#ifdef Q_COMPILER_RVALUE_REFS
- inline QList(QList<T> &&other) Q_DECL_NOTHROW
+ inline QList(QList<T> &&other) noexcept
: d(other.d) { other.d = const_cast<QListData::Data *>(&QListData::shared_null); }
- inline QList &operator=(QList<T> &&other) Q_DECL_NOTHROW
+ inline QList &operator=(QList<T> &&other) noexcept
{ QList moved(std::move(other)); swap(moved); return *this; }
#endif
- inline void swap(QList<T> &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+ inline void swap(QList<T> &other) noexcept { qSwap(d, other.d); }
#ifdef Q_COMPILER_INITIALIZER_LISTS
inline QList(std::initializer_list<T> args)
: d(const_cast<QListData::Data *>(&QListData::shared_null))
@@ -175,7 +175,7 @@ public:
bool operator==(const QList<T> &l) const;
inline bool operator!=(const QList<T> &l) const { return !(*this == l); }
- inline int size() const Q_DECL_NOTHROW { return p.size(); }
+ inline int size() const noexcept { return p.size(); }
inline void detach() { if (d->ref.isShared()) detach_helper(); }
@@ -198,9 +198,9 @@ public:
d->ref.setSharable(sharable);
}
#endif
- inline bool isSharedWith(const QList<T> &other) const Q_DECL_NOTHROW { return d == other.d; }
+ inline bool isSharedWith(const QList<T> &other) const noexcept { return d == other.d; }
- inline bool isEmpty() const Q_DECL_NOTHROW { return p.isEmpty(); }
+ inline bool isEmpty() const noexcept { return p.isEmpty(); }
void clear();
@@ -243,34 +243,34 @@ public:
typedef T *pointer;
typedef T &reference;
- inline iterator() Q_DECL_NOTHROW : i(nullptr) {}
- inline iterator(Node *n) Q_DECL_NOTHROW : i(n) {}
+ inline iterator() noexcept : i(nullptr) {}
+ inline iterator(Node *n) noexcept : i(n) {}
#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
// can't remove it in Qt 5, since doing so would make the type trivial,
// which changes the way it's passed to functions by value.
- inline iterator(const iterator &o) Q_DECL_NOTHROW : i(o.i){}
+ inline iterator(const iterator &o) noexcept : i(o.i){}
#endif
inline T &operator*() const { return i->t(); }
inline T *operator->() const { return &i->t(); }
inline T &operator[](difference_type j) const { return i[j].t(); }
- inline bool operator==(const iterator &o) const Q_DECL_NOTHROW { return i == o.i; }
- inline bool operator!=(const iterator &o) const Q_DECL_NOTHROW { return i != o.i; }
- inline bool operator<(const iterator& other) const Q_DECL_NOTHROW { return i < other.i; }
- inline bool operator<=(const iterator& other) const Q_DECL_NOTHROW { return i <= other.i; }
- inline bool operator>(const iterator& other) const Q_DECL_NOTHROW { return i > other.i; }
- inline bool operator>=(const iterator& other) const Q_DECL_NOTHROW { return i >= other.i; }
+ inline bool operator==(const iterator &o) const noexcept { return i == o.i; }
+ inline bool operator!=(const iterator &o) const noexcept { return i != o.i; }
+ inline bool operator<(const iterator& other) const noexcept { return i < other.i; }
+ inline bool operator<=(const iterator& other) const noexcept { return i <= other.i; }
+ inline bool operator>(const iterator& other) const noexcept { return i > other.i; }
+ inline bool operator>=(const iterator& other) const noexcept { return i >= other.i; }
#ifndef QT_STRICT_ITERATORS
- inline bool operator==(const const_iterator &o) const Q_DECL_NOTHROW
+ inline bool operator==(const const_iterator &o) const noexcept
{ return i == o.i; }
- inline bool operator!=(const const_iterator &o) const Q_DECL_NOTHROW
+ inline bool operator!=(const const_iterator &o) const noexcept
{ return i != o.i; }
- inline bool operator<(const const_iterator& other) const Q_DECL_NOTHROW
+ inline bool operator<(const const_iterator& other) const noexcept
{ return i < other.i; }
- inline bool operator<=(const const_iterator& other) const Q_DECL_NOTHROW
+ inline bool operator<=(const const_iterator& other) const noexcept
{ return i <= other.i; }
- inline bool operator>(const const_iterator& other) const Q_DECL_NOTHROW
+ inline bool operator>(const const_iterator& other) const noexcept
{ return i > other.i; }
- inline bool operator>=(const const_iterator& other) const Q_DECL_NOTHROW
+ inline bool operator>=(const const_iterator& other) const noexcept
{ return i >= other.i; }
#endif
inline iterator &operator++() { ++i; return *this; }
@@ -296,27 +296,27 @@ public:
typedef const T *pointer;
typedef const T &reference;
- inline const_iterator() Q_DECL_NOTHROW : i(nullptr) {}
- inline const_iterator(Node *n) Q_DECL_NOTHROW : i(n) {}
+ inline const_iterator() noexcept : i(nullptr) {}
+ inline const_iterator(Node *n) noexcept : i(n) {}
#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
// can't remove it in Qt 5, since doing so would make the type trivial,
// which changes the way it's passed to functions by value.
- inline const_iterator(const const_iterator &o) Q_DECL_NOTHROW : i(o.i) {}
+ inline const_iterator(const const_iterator &o) noexcept : i(o.i) {}
#endif
#ifdef QT_STRICT_ITERATORS
- inline explicit const_iterator(const iterator &o) Q_DECL_NOTHROW : i(o.i) {}
+ inline explicit const_iterator(const iterator &o) noexcept : i(o.i) {}
#else
- inline const_iterator(const iterator &o) Q_DECL_NOTHROW : i(o.i) {}
+ inline const_iterator(const iterator &o) noexcept : i(o.i) {}
#endif
inline const T &operator*() const { return i->t(); }
inline const T *operator->() const { return &i->t(); }
inline const T &operator[](difference_type j) const { return i[j].t(); }
- inline bool operator==(const const_iterator &o) const Q_DECL_NOTHROW { return i == o.i; }
- inline bool operator!=(const const_iterator &o) const Q_DECL_NOTHROW { return i != o.i; }
- inline bool operator<(const const_iterator& other) const Q_DECL_NOTHROW { return i < other.i; }
- inline bool operator<=(const const_iterator& other) const Q_DECL_NOTHROW { return i <= other.i; }
- inline bool operator>(const const_iterator& other) const Q_DECL_NOTHROW { return i > other.i; }
- inline bool operator>=(const const_iterator& other) const Q_DECL_NOTHROW { return i >= other.i; }
+ inline bool operator==(const const_iterator &o) const noexcept { return i == o.i; }
+ inline bool operator!=(const const_iterator &o) const noexcept { return i != o.i; }
+ inline bool operator<(const const_iterator& other) const noexcept { return i < other.i; }
+ inline bool operator<=(const const_iterator& other) const noexcept { return i <= other.i; }
+ inline bool operator>(const const_iterator& other) const noexcept { return i > other.i; }
+ inline bool operator>=(const const_iterator& other) const noexcept { return i >= other.i; }
inline const_iterator &operator++() { ++i; return *this; }
inline const_iterator operator++(int) { Node *n = i; ++i; return n; }
inline const_iterator &operator--() { i--; return *this; }
@@ -334,19 +334,19 @@ public:
typedef std::reverse_iterator<iterator> reverse_iterator;
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
inline iterator begin() { detach(); return reinterpret_cast<Node *>(p.begin()); }
- inline const_iterator begin() const Q_DECL_NOTHROW { return reinterpret_cast<Node *>(p.begin()); }
- inline const_iterator cbegin() const Q_DECL_NOTHROW { return reinterpret_cast<Node *>(p.begin()); }
- inline const_iterator constBegin() const Q_DECL_NOTHROW { return reinterpret_cast<Node *>(p.begin()); }
+ inline const_iterator begin() const noexcept { return reinterpret_cast<Node *>(p.begin()); }
+ inline const_iterator cbegin() const noexcept { return reinterpret_cast<Node *>(p.begin()); }
+ inline const_iterator constBegin() const noexcept { return reinterpret_cast<Node *>(p.begin()); }
inline iterator end() { detach(); return reinterpret_cast<Node *>(p.end()); }
- inline const_iterator end() const Q_DECL_NOTHROW { return reinterpret_cast<Node *>(p.end()); }
- inline const_iterator cend() const Q_DECL_NOTHROW { return reinterpret_cast<Node *>(p.end()); }
- inline const_iterator constEnd() const Q_DECL_NOTHROW { return reinterpret_cast<Node *>(p.end()); }
+ inline const_iterator end() const noexcept { return reinterpret_cast<Node *>(p.end()); }
+ inline const_iterator cend() const noexcept { return reinterpret_cast<Node *>(p.end()); }
+ inline const_iterator constEnd() const noexcept { return reinterpret_cast<Node *>(p.end()); }
reverse_iterator rbegin() { return reverse_iterator(end()); }
reverse_iterator rend() { return reverse_iterator(begin()); }
- const_reverse_iterator rbegin() const Q_DECL_NOTHROW { return const_reverse_iterator(end()); }
- const_reverse_iterator rend() const Q_DECL_NOTHROW { return const_reverse_iterator(begin()); }
- const_reverse_iterator crbegin() const Q_DECL_NOTHROW { return const_reverse_iterator(end()); }
- const_reverse_iterator crend() const Q_DECL_NOTHROW { return const_reverse_iterator(begin()); }
+ const_reverse_iterator rbegin() const noexcept { return const_reverse_iterator(end()); }
+ const_reverse_iterator rend() const noexcept { return const_reverse_iterator(begin()); }
+ const_reverse_iterator crbegin() const noexcept { return const_reverse_iterator(end()); }
+ const_reverse_iterator crend() const noexcept { return const_reverse_iterator(begin()); }
iterator insert(iterator before, const T &t);
iterator erase(iterator pos);
iterator erase(iterator first, iterator last);
@@ -423,7 +423,7 @@ private:
void node_copy(Node *from, Node *to, Node *src);
void node_destruct(Node *from, Node *to);
- bool isValidIterator(const iterator &i) const Q_DECL_NOTHROW
+ bool isValidIterator(const iterator &i) const noexcept
{
const std::less<const Node *> less = {};
return !less(i.i, cbegin().i) && !less(cend().i, i.i);
diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp
index ebb6c97975..9a3929c4a7 100644
--- a/src/corelib/tools/qlocale.cpp
+++ b/src/corelib/tools/qlocale.cpp
@@ -94,7 +94,7 @@ QT_BEGIN_INCLUDE_NAMESPACE
#include "qlocale_data_p.h"
QT_END_INCLUDE_NAMESPACE
-QLocale::Language QLocalePrivate::codeToLanguage(QStringView code) Q_DECL_NOTHROW
+QLocale::Language QLocalePrivate::codeToLanguage(QStringView code) noexcept
{
const auto len = code.size();
if (len != 2 && len != 3)
@@ -138,7 +138,7 @@ QLocale::Language QLocalePrivate::codeToLanguage(QStringView code) Q_DECL_NOTHRO
return QLocale::C;
}
-QLocale::Script QLocalePrivate::codeToScript(QStringView code) Q_DECL_NOTHROW
+QLocale::Script QLocalePrivate::codeToScript(QStringView code) noexcept
{
const auto len = code.size();
if (len != 4)
@@ -158,7 +158,7 @@ QLocale::Script QLocalePrivate::codeToScript(QStringView code) Q_DECL_NOTHROW
return QLocale::AnyScript;
}
-QLocale::Country QLocalePrivate::codeToCountry(QStringView code) Q_DECL_NOTHROW
+QLocale::Country QLocalePrivate::codeToCountry(QStringView code) noexcept
{
const auto len = code.size();
if (len != 2 && len != 3)
@@ -982,7 +982,7 @@ bool QLocale::operator!=(const QLocale &other) const
Returns the hash value for \a key, using
\a seed to seed the calculation.
*/
-uint qHash(const QLocale &key, uint seed) Q_DECL_NOTHROW
+uint qHash(const QLocale &key, uint seed) noexcept
{
QtPrivate::QHashCombine hash;
seed = hash(seed, key.d->m_data);
diff --git a/src/corelib/tools/qlocale.h b/src/corelib/tools/qlocale.h
index 2b4f131552..cb462db770 100644
--- a/src/corelib/tools/qlocale.h
+++ b/src/corelib/tools/qlocale.h
@@ -59,7 +59,7 @@ class QTextStreamPrivate;
class QLocalePrivate;
-Q_CORE_EXPORT uint qHash(const QLocale &key, uint seed = 0) Q_DECL_NOTHROW;
+Q_CORE_EXPORT uint qHash(const QLocale &key, uint seed = 0) noexcept;
class Q_CORE_EXPORT QLocale
{
@@ -940,12 +940,12 @@ public:
QLocale(Language language, Script script, Country country);
QLocale(const QLocale &other);
#ifdef Q_COMPILER_RVALUE_REFS
- QLocale &operator=(QLocale &&other) Q_DECL_NOTHROW { swap(other); return *this; }
+ QLocale &operator=(QLocale &&other) noexcept { swap(other); return *this; }
#endif
QLocale &operator=(const QLocale &other);
~QLocale();
- void swap(QLocale &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+ void swap(QLocale &other) noexcept { qSwap(d, other.d); }
Language language() const;
Script script() const;
@@ -1108,7 +1108,7 @@ private:
QLocale(QLocalePrivate &dd);
friend class QLocalePrivate;
friend class QSystemLocale;
- friend Q_CORE_EXPORT uint qHash(const QLocale &key, uint seed) Q_DECL_NOTHROW;
+ friend Q_CORE_EXPORT uint qHash(const QLocale &key, uint seed) noexcept;
QSharedDataPointer<QLocalePrivate> d;
};
diff --git a/src/corelib/tools/qlocale_p.h b/src/corelib/tools/qlocale_p.h
index 1e8dc28fbf..de973d5eac 100644
--- a/src/corelib/tools/qlocale_p.h
+++ b/src/corelib/tools/qlocale_p.h
@@ -254,10 +254,8 @@ public:
const float huge = std::numeric_limits<float>::infinity();
return d < 0 ? -huge : huge;
}
- if (std::fabs(d) >= std::numeric_limits<double>::min() // i.e. d != 0
- && std::fabs(d) < std::numeric_limits<float>::min()) {
- // Values smaller than std::numeric_limits<double>::min() have
- // failed already; match them.
+ if (d != 0 && float(d) == 0) {
+ // Values that underflow double already failed. Match them:
if (ok != 0)
*ok = false;
return 0;
@@ -367,9 +365,9 @@ public:
static QLatin1String languageToCode(QLocale::Language language);
static QLatin1String scriptToCode(QLocale::Script script);
static QLatin1String countryToCode(QLocale::Country country);
- static QLocale::Language codeToLanguage(QStringView code) Q_DECL_NOTHROW;
- static QLocale::Script codeToScript(QStringView code) Q_DECL_NOTHROW;
- static QLocale::Country codeToCountry(QStringView code) Q_DECL_NOTHROW;
+ static QLocale::Language codeToLanguage(QStringView code) noexcept;
+ static QLocale::Script codeToScript(QStringView code) noexcept;
+ static QLocale::Country codeToCountry(QStringView code) noexcept;
static void getLangAndCountry(const QString &name, QLocale::Language &lang,
QLocale::Script &script, QLocale::Country &cntry);
diff --git a/src/corelib/tools/qmap.h b/src/corelib/tools/qmap.h
index 1cf9299e26..103124f4ad 100644
--- a/src/corelib/tools/qmap.h
+++ b/src/corelib/tools/qmap.h
@@ -100,10 +100,10 @@ struct Q_CORE_EXPORT QMapNodeBase
template <typename T>
static typename std::enable_if<QTypeInfo<T>::isComplex>::type
- callDestructorIfNecessary(T &t) Q_DECL_NOTHROW { Q_UNUSED(t); t.~T(); } // Q_UNUSED: silence MSVC unused 't' warning
+ callDestructorIfNecessary(T &t) noexcept { Q_UNUSED(t); t.~T(); } // Q_UNUSED: silence MSVC unused 't' warning
template <typename T>
static typename std::enable_if<!QTypeInfo<T>::isComplex>::type
- callDestructorIfNecessary(T &) Q_DECL_NOTHROW {}
+ callDestructorIfNecessary(T &) noexcept {}
};
template <class Key, class T>
@@ -325,7 +325,7 @@ class QMap
QMapData<Key, T> *d;
public:
- inline QMap() Q_DECL_NOTHROW : d(static_cast<QMapData<Key, T> *>(const_cast<QMapDataBase *>(&QMapDataBase::shared_null))) { }
+ inline QMap() noexcept : d(static_cast<QMapData<Key, T> *>(const_cast<QMapDataBase *>(&QMapDataBase::shared_null))) { }
#ifdef Q_COMPILER_INITIALIZER_LISTS
inline QMap(std::initializer_list<std::pair<Key,T> > list)
: d(static_cast<QMapData<Key, T> *>(const_cast<QMapDataBase *>(&QMapDataBase::shared_null)))
@@ -340,17 +340,17 @@ public:
QMap<Key, T> &operator=(const QMap<Key, T> &other);
#ifdef Q_COMPILER_RVALUE_REFS
- inline QMap(QMap<Key, T> &&other) Q_DECL_NOTHROW
+ inline QMap(QMap<Key, T> &&other) noexcept
: d(other.d)
{
other.d = static_cast<QMapData<Key, T> *>(
const_cast<QMapDataBase *>(&QMapDataBase::shared_null));
}
- inline QMap<Key, T> &operator=(QMap<Key, T> &&other) Q_DECL_NOTHROW
+ inline QMap<Key, T> &operator=(QMap<Key, T> &&other) noexcept
{ QMap moved(std::move(other)); swap(moved); return *this; }
#endif
- inline void swap(QMap<Key, T> &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+ inline void swap(QMap<Key, T> &other) noexcept { qSwap(d, other.d); }
explicit QMap(const typename std::map<Key, T> &other);
std::map<Key, T> toStdMap() const;
@@ -1187,7 +1187,7 @@ template <class Key, class T>
class QMultiMap : public QMap<Key, T>
{
public:
- QMultiMap() Q_DECL_NOTHROW {}
+ QMultiMap() noexcept {}
#ifdef Q_COMPILER_INITIALIZER_LISTS
inline QMultiMap(std::initializer_list<std::pair<Key,T> > list)
{
@@ -1197,9 +1197,9 @@ public:
#endif
QMultiMap(const QMap<Key, T> &other) : QMap<Key, T>(other) {}
#ifdef Q_COMPILER_RVALUE_REFS
- QMultiMap(QMap<Key, T> &&other) Q_DECL_NOTHROW : QMap<Key, T>(std::move(other)) {}
+ QMultiMap(QMap<Key, T> &&other) noexcept : QMap<Key, T>(std::move(other)) {}
#endif
- void swap(QMultiMap<Key, T> &other) Q_DECL_NOTHROW { QMap<Key, T>::swap(other); }
+ void swap(QMultiMap<Key, T> &other) noexcept { QMap<Key, T>::swap(other); }
inline typename QMap<Key, T>::iterator replace(const Key &key, const T &value)
{ return QMap<Key, T>::insert(key, value); }
diff --git a/src/corelib/tools/qmargins.h b/src/corelib/tools/qmargins.h
index 0c73235d26..447037daaa 100644
--- a/src/corelib/tools/qmargins.h
+++ b/src/corelib/tools/qmargins.h
@@ -51,28 +51,28 @@ QT_BEGIN_NAMESPACE
class QMargins
{
public:
- Q_DECL_CONSTEXPR QMargins() Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR QMargins(int left, int top, int right, int bottom) Q_DECL_NOTHROW;
-
- Q_DECL_CONSTEXPR bool isNull() const Q_DECL_NOTHROW;
-
- Q_DECL_CONSTEXPR int left() const Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR int top() const Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR int right() const Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR int bottom() const Q_DECL_NOTHROW;
-
- Q_DECL_RELAXED_CONSTEXPR void setLeft(int left) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR void setTop(int top) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR void setRight(int right) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR void setBottom(int bottom) Q_DECL_NOTHROW;
-
- Q_DECL_RELAXED_CONSTEXPR QMargins &operator+=(const QMargins &margins) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR QMargins &operator-=(const QMargins &margins) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR QMargins &operator+=(int) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR QMargins &operator-=(int) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR QMargins &operator*=(int) Q_DECL_NOTHROW;
+ Q_DECL_CONSTEXPR QMargins() noexcept;
+ Q_DECL_CONSTEXPR QMargins(int left, int top, int right, int bottom) noexcept;
+
+ Q_DECL_CONSTEXPR bool isNull() const noexcept;
+
+ Q_DECL_CONSTEXPR int left() const noexcept;
+ Q_DECL_CONSTEXPR int top() const noexcept;
+ Q_DECL_CONSTEXPR int right() const noexcept;
+ Q_DECL_CONSTEXPR int bottom() const noexcept;
+
+ Q_DECL_RELAXED_CONSTEXPR void setLeft(int left) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR void setTop(int top) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR void setRight(int right) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR void setBottom(int bottom) noexcept;
+
+ Q_DECL_RELAXED_CONSTEXPR QMargins &operator+=(const QMargins &margins) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR QMargins &operator-=(const QMargins &margins) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR QMargins &operator+=(int) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR QMargins &operator-=(int) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR QMargins &operator*=(int) noexcept;
Q_DECL_RELAXED_CONSTEXPR QMargins &operator/=(int);
- Q_DECL_RELAXED_CONSTEXPR QMargins &operator*=(qreal) Q_DECL_NOTHROW;
+ Q_DECL_RELAXED_CONSTEXPR QMargins &operator*=(qreal) noexcept;
Q_DECL_RELAXED_CONSTEXPR QMargins &operator/=(qreal);
private:
@@ -81,8 +81,8 @@ private:
int m_right;
int m_bottom;
- friend Q_DECL_CONSTEXPR inline bool operator==(const QMargins &, const QMargins &) Q_DECL_NOTHROW;
- friend Q_DECL_CONSTEXPR inline bool operator!=(const QMargins &, const QMargins &) Q_DECL_NOTHROW;
+ friend Q_DECL_CONSTEXPR inline bool operator==(const QMargins &, const QMargins &) noexcept;
+ friend Q_DECL_CONSTEXPR inline bool operator!=(const QMargins &, const QMargins &) noexcept;
};
Q_DECLARE_TYPEINFO(QMargins, Q_MOVABLE_TYPE);
@@ -99,40 +99,40 @@ Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QMargins &);
QMargins inline functions
*****************************************************************************/
-Q_DECL_CONSTEXPR inline QMargins::QMargins() Q_DECL_NOTHROW : m_left(0), m_top(0), m_right(0), m_bottom(0) {}
+Q_DECL_CONSTEXPR inline QMargins::QMargins() noexcept : m_left(0), m_top(0), m_right(0), m_bottom(0) {}
-Q_DECL_CONSTEXPR inline QMargins::QMargins(int aleft, int atop, int aright, int abottom) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QMargins::QMargins(int aleft, int atop, int aright, int abottom) noexcept
: m_left(aleft), m_top(atop), m_right(aright), m_bottom(abottom) {}
-Q_DECL_CONSTEXPR inline bool QMargins::isNull() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline bool QMargins::isNull() const noexcept
{ return m_left==0 && m_top==0 && m_right==0 && m_bottom==0; }
-Q_DECL_CONSTEXPR inline int QMargins::left() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline int QMargins::left() const noexcept
{ return m_left; }
-Q_DECL_CONSTEXPR inline int QMargins::top() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline int QMargins::top() const noexcept
{ return m_top; }
-Q_DECL_CONSTEXPR inline int QMargins::right() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline int QMargins::right() const noexcept
{ return m_right; }
-Q_DECL_CONSTEXPR inline int QMargins::bottom() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline int QMargins::bottom() const noexcept
{ return m_bottom; }
-Q_DECL_RELAXED_CONSTEXPR inline void QMargins::setLeft(int aleft) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QMargins::setLeft(int aleft) noexcept
{ m_left = aleft; }
-Q_DECL_RELAXED_CONSTEXPR inline void QMargins::setTop(int atop) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QMargins::setTop(int atop) noexcept
{ m_top = atop; }
-Q_DECL_RELAXED_CONSTEXPR inline void QMargins::setRight(int aright) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QMargins::setRight(int aright) noexcept
{ m_right = aright; }
-Q_DECL_RELAXED_CONSTEXPR inline void QMargins::setBottom(int abottom) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QMargins::setBottom(int abottom) noexcept
{ m_bottom = abottom; }
-Q_DECL_CONSTEXPR inline bool operator==(const QMargins &m1, const QMargins &m2) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline bool operator==(const QMargins &m1, const QMargins &m2) noexcept
{
return
m1.m_left == m2.m_left &&
@@ -141,7 +141,7 @@ Q_DECL_CONSTEXPR inline bool operator==(const QMargins &m1, const QMargins &m2)
m1.m_bottom == m2.m_bottom;
}
-Q_DECL_CONSTEXPR inline bool operator!=(const QMargins &m1, const QMargins &m2) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline bool operator!=(const QMargins &m1, const QMargins &m2) noexcept
{
return
m1.m_left != m2.m_left ||
@@ -150,55 +150,55 @@ Q_DECL_CONSTEXPR inline bool operator!=(const QMargins &m1, const QMargins &m2)
m1.m_bottom != m2.m_bottom;
}
-Q_DECL_CONSTEXPR inline QMargins operator+(const QMargins &m1, const QMargins &m2) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QMargins operator+(const QMargins &m1, const QMargins &m2) noexcept
{
return QMargins(m1.left() + m2.left(), m1.top() + m2.top(),
m1.right() + m2.right(), m1.bottom() + m2.bottom());
}
-Q_DECL_CONSTEXPR inline QMargins operator-(const QMargins &m1, const QMargins &m2) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QMargins operator-(const QMargins &m1, const QMargins &m2) noexcept
{
return QMargins(m1.left() - m2.left(), m1.top() - m2.top(),
m1.right() - m2.right(), m1.bottom() - m2.bottom());
}
-Q_DECL_CONSTEXPR inline QMargins operator+(const QMargins &lhs, int rhs) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QMargins operator+(const QMargins &lhs, int rhs) noexcept
{
return QMargins(lhs.left() + rhs, lhs.top() + rhs,
lhs.right() + rhs, lhs.bottom() + rhs);
}
-Q_DECL_CONSTEXPR inline QMargins operator+(int lhs, const QMargins &rhs) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QMargins operator+(int lhs, const QMargins &rhs) noexcept
{
return QMargins(rhs.left() + lhs, rhs.top() + lhs,
rhs.right() + lhs, rhs.bottom() + lhs);
}
-Q_DECL_CONSTEXPR inline QMargins operator-(const QMargins &lhs, int rhs) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QMargins operator-(const QMargins &lhs, int rhs) noexcept
{
return QMargins(lhs.left() - rhs, lhs.top() - rhs,
lhs.right() - rhs, lhs.bottom() - rhs);
}
-Q_DECL_CONSTEXPR inline QMargins operator*(const QMargins &margins, int factor) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QMargins operator*(const QMargins &margins, int factor) noexcept
{
return QMargins(margins.left() * factor, margins.top() * factor,
margins.right() * factor, margins.bottom() * factor);
}
-Q_DECL_CONSTEXPR inline QMargins operator*(int factor, const QMargins &margins) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QMargins operator*(int factor, const QMargins &margins) noexcept
{
return QMargins(margins.left() * factor, margins.top() * factor,
margins.right() * factor, margins.bottom() * factor);
}
-Q_DECL_CONSTEXPR inline QMargins operator*(const QMargins &margins, qreal factor) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QMargins operator*(const QMargins &margins, qreal factor) noexcept
{
return QMargins(qRound(margins.left() * factor), qRound(margins.top() * factor),
qRound(margins.right() * factor), qRound(margins.bottom() * factor));
}
-Q_DECL_CONSTEXPR inline QMargins operator*(qreal factor, const QMargins &margins) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QMargins operator*(qreal factor, const QMargins &margins) noexcept
{
return QMargins(qRound(margins.left() * factor), qRound(margins.top() * factor),
qRound(margins.right() * factor), qRound(margins.bottom() * factor));
@@ -216,17 +216,17 @@ Q_DECL_CONSTEXPR inline QMargins operator/(const QMargins &margins, qreal diviso
qRound(margins.right() / divisor), qRound(margins.bottom() / divisor));
}
-Q_DECL_RELAXED_CONSTEXPR inline QMargins &QMargins::operator+=(const QMargins &margins) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline QMargins &QMargins::operator+=(const QMargins &margins) noexcept
{
return *this = *this + margins;
}
-Q_DECL_RELAXED_CONSTEXPR inline QMargins &QMargins::operator-=(const QMargins &margins) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline QMargins &QMargins::operator-=(const QMargins &margins) noexcept
{
return *this = *this - margins;
}
-Q_DECL_RELAXED_CONSTEXPR inline QMargins &QMargins::operator+=(int margin) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline QMargins &QMargins::operator+=(int margin) noexcept
{
m_left += margin;
m_top += margin;
@@ -235,7 +235,7 @@ Q_DECL_RELAXED_CONSTEXPR inline QMargins &QMargins::operator+=(int margin) Q_DEC
return *this;
}
-Q_DECL_RELAXED_CONSTEXPR inline QMargins &QMargins::operator-=(int margin) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline QMargins &QMargins::operator-=(int margin) noexcept
{
m_left -= margin;
m_top -= margin;
@@ -244,7 +244,7 @@ Q_DECL_RELAXED_CONSTEXPR inline QMargins &QMargins::operator-=(int margin) Q_DEC
return *this;
}
-Q_DECL_RELAXED_CONSTEXPR inline QMargins &QMargins::operator*=(int factor) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline QMargins &QMargins::operator*=(int factor) noexcept
{
return *this = *this * factor;
}
@@ -254,7 +254,7 @@ Q_DECL_RELAXED_CONSTEXPR inline QMargins &QMargins::operator/=(int divisor)
return *this = *this / divisor;
}
-Q_DECL_RELAXED_CONSTEXPR inline QMargins &QMargins::operator*=(qreal factor) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline QMargins &QMargins::operator*=(qreal factor) noexcept
{
return *this = *this * factor;
}
@@ -264,12 +264,12 @@ Q_DECL_RELAXED_CONSTEXPR inline QMargins &QMargins::operator/=(qreal divisor)
return *this = *this / divisor;
}
-Q_DECL_CONSTEXPR inline QMargins operator+(const QMargins &margins) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QMargins operator+(const QMargins &margins) noexcept
{
return margins;
}
-Q_DECL_CONSTEXPR inline QMargins operator-(const QMargins &margins) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QMargins operator-(const QMargins &margins) noexcept
{
return QMargins(-margins.left(), -margins.top(), -margins.right(), -margins.bottom());
}
@@ -285,30 +285,30 @@ Q_CORE_EXPORT QDebug operator<<(QDebug, const QMargins &);
class QMarginsF
{
public:
- Q_DECL_CONSTEXPR QMarginsF() Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR QMarginsF(qreal left, qreal top, qreal right, qreal bottom) Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR QMarginsF(const QMargins &margins) Q_DECL_NOTHROW;
-
- Q_DECL_CONSTEXPR bool isNull() const Q_DECL_NOTHROW;
-
- Q_DECL_CONSTEXPR qreal left() const Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR qreal top() const Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR qreal right() const Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR qreal bottom() const Q_DECL_NOTHROW;
-
- Q_DECL_RELAXED_CONSTEXPR void setLeft(qreal left) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR void setTop(qreal top) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR void setRight(qreal right) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR void setBottom(qreal bottom) Q_DECL_NOTHROW;
-
- Q_DECL_RELAXED_CONSTEXPR QMarginsF &operator+=(const QMarginsF &margins) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR QMarginsF &operator-=(const QMarginsF &margins) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR QMarginsF &operator+=(qreal addend) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR QMarginsF &operator-=(qreal subtrahend) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR QMarginsF &operator*=(qreal factor) Q_DECL_NOTHROW;
+ Q_DECL_CONSTEXPR QMarginsF() noexcept;
+ Q_DECL_CONSTEXPR QMarginsF(qreal left, qreal top, qreal right, qreal bottom) noexcept;
+ Q_DECL_CONSTEXPR QMarginsF(const QMargins &margins) noexcept;
+
+ Q_DECL_CONSTEXPR bool isNull() const noexcept;
+
+ Q_DECL_CONSTEXPR qreal left() const noexcept;
+ Q_DECL_CONSTEXPR qreal top() const noexcept;
+ Q_DECL_CONSTEXPR qreal right() const noexcept;
+ Q_DECL_CONSTEXPR qreal bottom() const noexcept;
+
+ Q_DECL_RELAXED_CONSTEXPR void setLeft(qreal left) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR void setTop(qreal top) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR void setRight(qreal right) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR void setBottom(qreal bottom) noexcept;
+
+ Q_DECL_RELAXED_CONSTEXPR QMarginsF &operator+=(const QMarginsF &margins) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR QMarginsF &operator-=(const QMarginsF &margins) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR QMarginsF &operator+=(qreal addend) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR QMarginsF &operator-=(qreal subtrahend) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR QMarginsF &operator*=(qreal factor) noexcept;
Q_DECL_RELAXED_CONSTEXPR QMarginsF &operator/=(qreal divisor);
- Q_DECL_CONSTEXPR inline QMargins toMargins() const Q_DECL_NOTHROW;
+ Q_DECL_CONSTEXPR inline QMargins toMargins() const noexcept;
private:
qreal m_left;
@@ -332,44 +332,44 @@ Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QMarginsF &);
QMarginsF inline functions
*****************************************************************************/
-Q_DECL_CONSTEXPR inline QMarginsF::QMarginsF() Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QMarginsF::QMarginsF() noexcept
: m_left(0), m_top(0), m_right(0), m_bottom(0) {}
-Q_DECL_CONSTEXPR inline QMarginsF::QMarginsF(qreal aleft, qreal atop, qreal aright, qreal abottom) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QMarginsF::QMarginsF(qreal aleft, qreal atop, qreal aright, qreal abottom) noexcept
: m_left(aleft), m_top(atop), m_right(aright), m_bottom(abottom) {}
-Q_DECL_CONSTEXPR inline QMarginsF::QMarginsF(const QMargins &margins) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QMarginsF::QMarginsF(const QMargins &margins) noexcept
: m_left(margins.left()), m_top(margins.top()), m_right(margins.right()), m_bottom(margins.bottom()) {}
-Q_DECL_CONSTEXPR inline bool QMarginsF::isNull() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline bool QMarginsF::isNull() const noexcept
{ return qFuzzyIsNull(m_left) && qFuzzyIsNull(m_top) && qFuzzyIsNull(m_right) && qFuzzyIsNull(m_bottom); }
-Q_DECL_CONSTEXPR inline qreal QMarginsF::left() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline qreal QMarginsF::left() const noexcept
{ return m_left; }
-Q_DECL_CONSTEXPR inline qreal QMarginsF::top() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline qreal QMarginsF::top() const noexcept
{ return m_top; }
-Q_DECL_CONSTEXPR inline qreal QMarginsF::right() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline qreal QMarginsF::right() const noexcept
{ return m_right; }
-Q_DECL_CONSTEXPR inline qreal QMarginsF::bottom() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline qreal QMarginsF::bottom() const noexcept
{ return m_bottom; }
-Q_DECL_RELAXED_CONSTEXPR inline void QMarginsF::setLeft(qreal aleft) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QMarginsF::setLeft(qreal aleft) noexcept
{ m_left = aleft; }
-Q_DECL_RELAXED_CONSTEXPR inline void QMarginsF::setTop(qreal atop) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QMarginsF::setTop(qreal atop) noexcept
{ m_top = atop; }
-Q_DECL_RELAXED_CONSTEXPR inline void QMarginsF::setRight(qreal aright) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QMarginsF::setRight(qreal aright) noexcept
{ m_right = aright; }
-Q_DECL_RELAXED_CONSTEXPR inline void QMarginsF::setBottom(qreal abottom) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QMarginsF::setBottom(qreal abottom) noexcept
{ m_bottom = abottom; }
-Q_DECL_CONSTEXPR inline bool operator==(const QMarginsF &lhs, const QMarginsF &rhs) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline bool operator==(const QMarginsF &lhs, const QMarginsF &rhs) noexcept
{
return qFuzzyCompare(lhs.left(), rhs.left())
&& qFuzzyCompare(lhs.top(), rhs.top())
@@ -377,48 +377,48 @@ Q_DECL_CONSTEXPR inline bool operator==(const QMarginsF &lhs, const QMarginsF &r
&& qFuzzyCompare(lhs.bottom(), rhs.bottom());
}
-Q_DECL_CONSTEXPR inline bool operator!=(const QMarginsF &lhs, const QMarginsF &rhs) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline bool operator!=(const QMarginsF &lhs, const QMarginsF &rhs) noexcept
{
return !operator==(lhs, rhs);
}
-Q_DECL_CONSTEXPR inline QMarginsF operator+(const QMarginsF &lhs, const QMarginsF &rhs) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QMarginsF operator+(const QMarginsF &lhs, const QMarginsF &rhs) noexcept
{
return QMarginsF(lhs.left() + rhs.left(), lhs.top() + rhs.top(),
lhs.right() + rhs.right(), lhs.bottom() + rhs.bottom());
}
-Q_DECL_CONSTEXPR inline QMarginsF operator-(const QMarginsF &lhs, const QMarginsF &rhs) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QMarginsF operator-(const QMarginsF &lhs, const QMarginsF &rhs) noexcept
{
return QMarginsF(lhs.left() - rhs.left(), lhs.top() - rhs.top(),
lhs.right() - rhs.right(), lhs.bottom() - rhs.bottom());
}
-Q_DECL_CONSTEXPR inline QMarginsF operator+(const QMarginsF &lhs, qreal rhs) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QMarginsF operator+(const QMarginsF &lhs, qreal rhs) noexcept
{
return QMarginsF(lhs.left() + rhs, lhs.top() + rhs,
lhs.right() + rhs, lhs.bottom() + rhs);
}
-Q_DECL_CONSTEXPR inline QMarginsF operator+(qreal lhs, const QMarginsF &rhs) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QMarginsF operator+(qreal lhs, const QMarginsF &rhs) noexcept
{
return QMarginsF(rhs.left() + lhs, rhs.top() + lhs,
rhs.right() + lhs, rhs.bottom() + lhs);
}
-Q_DECL_CONSTEXPR inline QMarginsF operator-(const QMarginsF &lhs, qreal rhs) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QMarginsF operator-(const QMarginsF &lhs, qreal rhs) noexcept
{
return QMarginsF(lhs.left() - rhs, lhs.top() - rhs,
lhs.right() - rhs, lhs.bottom() - rhs);
}
-Q_DECL_CONSTEXPR inline QMarginsF operator*(const QMarginsF &lhs, qreal rhs) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QMarginsF operator*(const QMarginsF &lhs, qreal rhs) noexcept
{
return QMarginsF(lhs.left() * rhs, lhs.top() * rhs,
lhs.right() * rhs, lhs.bottom() * rhs);
}
-Q_DECL_CONSTEXPR inline QMarginsF operator*(qreal lhs, const QMarginsF &rhs) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QMarginsF operator*(qreal lhs, const QMarginsF &rhs) noexcept
{
return QMarginsF(rhs.left() * lhs, rhs.top() * lhs,
rhs.right() * lhs, rhs.bottom() * lhs);
@@ -430,17 +430,17 @@ Q_DECL_CONSTEXPR inline QMarginsF operator/(const QMarginsF &lhs, qreal divisor)
lhs.right() / divisor, lhs.bottom() / divisor);
}
-Q_DECL_RELAXED_CONSTEXPR inline QMarginsF &QMarginsF::operator+=(const QMarginsF &margins) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline QMarginsF &QMarginsF::operator+=(const QMarginsF &margins) noexcept
{
return *this = *this + margins;
}
-Q_DECL_RELAXED_CONSTEXPR inline QMarginsF &QMarginsF::operator-=(const QMarginsF &margins) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline QMarginsF &QMarginsF::operator-=(const QMarginsF &margins) noexcept
{
return *this = *this - margins;
}
-Q_DECL_RELAXED_CONSTEXPR inline QMarginsF &QMarginsF::operator+=(qreal addend) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline QMarginsF &QMarginsF::operator+=(qreal addend) noexcept
{
m_left += addend;
m_top += addend;
@@ -449,7 +449,7 @@ Q_DECL_RELAXED_CONSTEXPR inline QMarginsF &QMarginsF::operator+=(qreal addend) Q
return *this;
}
-Q_DECL_RELAXED_CONSTEXPR inline QMarginsF &QMarginsF::operator-=(qreal subtrahend) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline QMarginsF &QMarginsF::operator-=(qreal subtrahend) noexcept
{
m_left -= subtrahend;
m_top -= subtrahend;
@@ -458,7 +458,7 @@ Q_DECL_RELAXED_CONSTEXPR inline QMarginsF &QMarginsF::operator-=(qreal subtrahen
return *this;
}
-Q_DECL_RELAXED_CONSTEXPR inline QMarginsF &QMarginsF::operator*=(qreal factor) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline QMarginsF &QMarginsF::operator*=(qreal factor) noexcept
{
return *this = *this * factor;
}
@@ -468,17 +468,17 @@ Q_DECL_RELAXED_CONSTEXPR inline QMarginsF &QMarginsF::operator/=(qreal divisor)
return *this = *this / divisor;
}
-Q_DECL_CONSTEXPR inline QMarginsF operator+(const QMarginsF &margins) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QMarginsF operator+(const QMarginsF &margins) noexcept
{
return margins;
}
-Q_DECL_CONSTEXPR inline QMarginsF operator-(const QMarginsF &margins) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QMarginsF operator-(const QMarginsF &margins) noexcept
{
return QMarginsF(-margins.left(), -margins.top(), -margins.right(), -margins.bottom());
}
-Q_DECL_CONSTEXPR inline QMargins QMarginsF::toMargins() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QMargins QMarginsF::toMargins() const noexcept
{
return QMargins(qRound(m_left), qRound(m_top), qRound(m_right), qRound(m_bottom));
}
diff --git a/src/corelib/tools/qpoint.h b/src/corelib/tools/qpoint.h
index d7323f7707..34df673b93 100644
--- a/src/corelib/tools/qpoint.h
+++ b/src/corelib/tools/qpoint.h
@@ -94,7 +94,7 @@ public:
friend Q_DECL_CONSTEXPR inline const QPoint operator/(const QPoint &, qreal);
#if defined(Q_OS_DARWIN) || defined(Q_QDOC)
- Q_REQUIRED_RESULT CGPoint toCGPoint() const Q_DECL_NOTHROW;
+ Q_REQUIRED_RESULT CGPoint toCGPoint() const noexcept;
#endif
private:
@@ -256,8 +256,8 @@ public:
Q_DECL_CONSTEXPR QPoint toPoint() const;
#if defined(Q_OS_DARWIN) || defined(Q_QDOC)
- Q_REQUIRED_RESULT static QPointF fromCGPoint(CGPoint point) Q_DECL_NOTHROW;
- Q_REQUIRED_RESULT CGPoint toCGPoint() const Q_DECL_NOTHROW;
+ Q_REQUIRED_RESULT static QPointF fromCGPoint(CGPoint point) noexcept;
+ Q_REQUIRED_RESULT CGPoint toCGPoint() const noexcept;
#endif
private:
diff --git a/src/corelib/tools/qqueue.h b/src/corelib/tools/qqueue.h
index b55f210577..16229759ee 100644
--- a/src/corelib/tools/qqueue.h
+++ b/src/corelib/tools/qqueue.h
@@ -50,7 +50,7 @@ class QQueue : public QList<T>
{
public:
// compiler-generated special member functions are fine!
- inline void swap(QQueue<T> &other) Q_DECL_NOTHROW { QList<T>::swap(other); } // prevent QList<->QQueue swaps
+ inline void swap(QQueue<T> &other) noexcept { QList<T>::swap(other); } // prevent QList<->QQueue swaps
#ifndef Q_QDOC
// bring in QList::swap(int, int). We cannot say using QList<T>::swap,
// because we don't want to make swap(QList&) available.
diff --git a/src/corelib/tools/qrect.cpp b/src/corelib/tools/qrect.cpp
index 6e51deebea..d622f92530 100644
--- a/src/corelib/tools/qrect.cpp
+++ b/src/corelib/tools/qrect.cpp
@@ -300,7 +300,7 @@ QT_BEGIN_NAMESPACE
\sa isValid(), isEmpty()
*/
-QRect QRect::normalized() const Q_DECL_NOTHROW
+QRect QRect::normalized() const noexcept
{
QRect r;
if (x2 < x1 - 1) { // swap bad x values
@@ -820,7 +820,7 @@ QRect QRect::normalized() const Q_DECL_NOTHROW
\sa intersects()
*/
-bool QRect::contains(const QPoint &p, bool proper) const Q_DECL_NOTHROW
+bool QRect::contains(const QPoint &p, bool proper) const noexcept
{
int l, r;
if (x2 < x1 - 1) {
@@ -884,7 +884,7 @@ bool QRect::contains(const QPoint &p, bool proper) const Q_DECL_NOTHROW
rectangle (not on the edge).
*/
-bool QRect::contains(const QRect &r, bool proper) const Q_DECL_NOTHROW
+bool QRect::contains(const QRect &r, bool proper) const noexcept
{
if (isNull() || r.isNull())
return false;
@@ -962,7 +962,7 @@ bool QRect::contains(const QRect &r, bool proper) const Q_DECL_NOTHROW
\sa operator|=(), united()
*/
-QRect QRect::operator|(const QRect &r) const Q_DECL_NOTHROW
+QRect QRect::operator|(const QRect &r) const noexcept
{
if (isNull())
return r;
@@ -1033,7 +1033,7 @@ QRect QRect::operator|(const QRect &r) const Q_DECL_NOTHROW
\sa operator&=(), intersected()
*/
-QRect QRect::operator&(const QRect &r) const Q_DECL_NOTHROW
+QRect QRect::operator&(const QRect &r) const noexcept
{
if (isNull() || r.isNull())
return QRect();
@@ -1112,7 +1112,7 @@ QRect QRect::operator&(const QRect &r) const Q_DECL_NOTHROW
\sa contains()
*/
-bool QRect::intersects(const QRect &r) const Q_DECL_NOTHROW
+bool QRect::intersects(const QRect &r) const noexcept
{
if (isNull() || r.isNull())
return false;
@@ -1540,7 +1540,7 @@ QDebug operator<<(QDebug dbg, const QRect &r)
\sa isValid(), isEmpty()
*/
-QRectF QRectF::normalized() const Q_DECL_NOTHROW
+QRectF QRectF::normalized() const noexcept
{
QRectF r = *this;
if (r.w < 0) {
@@ -1964,7 +1964,7 @@ QRectF QRectF::normalized() const Q_DECL_NOTHROW
\sa intersects()
*/
-bool QRectF::contains(const QPointF &p) const Q_DECL_NOTHROW
+bool QRectF::contains(const QPointF &p) const noexcept
{
qreal l = xp;
qreal r = xp;
@@ -2010,7 +2010,7 @@ bool QRectF::contains(const QPointF &p) const Q_DECL_NOTHROW
otherwise returns \c false.
*/
-bool QRectF::contains(const QRectF &r) const Q_DECL_NOTHROW
+bool QRectF::contains(const QRectF &r) const noexcept
{
qreal l1 = xp;
qreal r1 = xp;
@@ -2148,7 +2148,7 @@ bool QRectF::contains(const QRectF &r) const Q_DECL_NOTHROW
\sa united(), operator|=()
*/
-QRectF QRectF::operator|(const QRectF &r) const Q_DECL_NOTHROW
+QRectF QRectF::operator|(const QRectF &r) const noexcept
{
if (isNull())
return r;
@@ -2217,7 +2217,7 @@ QRectF QRectF::operator|(const QRectF &r) const Q_DECL_NOTHROW
\sa operator&=(), intersected()
*/
-QRectF QRectF::operator&(const QRectF &r) const Q_DECL_NOTHROW
+QRectF QRectF::operator&(const QRectF &r) const noexcept
{
qreal l1 = xp;
qreal r1 = xp;
@@ -2302,7 +2302,7 @@ QRectF QRectF::operator&(const QRectF &r) const Q_DECL_NOTHROW
\sa contains()
*/
-bool QRectF::intersects(const QRectF &r) const Q_DECL_NOTHROW
+bool QRectF::intersects(const QRectF &r) const noexcept
{
qreal l1 = xp;
qreal r1 = xp;
@@ -2369,7 +2369,7 @@ bool QRectF::intersects(const QRectF &r) const Q_DECL_NOTHROW
\sa toRect()
*/
-QRect QRectF::toAlignedRect() const Q_DECL_NOTHROW
+QRect QRectF::toAlignedRect() const noexcept
{
int xmin = int(qFloor(xp));
int xmax = int(qCeil(xp + w));
diff --git a/src/corelib/tools/qrect.h b/src/corelib/tools/qrect.h
index 3b40055b5a..7aa2312f38 100644
--- a/src/corelib/tools/qrect.h
+++ b/src/corelib/tools/qrect.h
@@ -57,104 +57,104 @@ QT_BEGIN_NAMESPACE
class Q_CORE_EXPORT QRect
{
public:
- Q_DECL_CONSTEXPR QRect() Q_DECL_NOTHROW : x1(0), y1(0), x2(-1), y2(-1) {}
- Q_DECL_CONSTEXPR QRect(const QPoint &topleft, const QPoint &bottomright) Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR QRect(const QPoint &topleft, const QSize &size) Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR QRect(int left, int top, int width, int height) Q_DECL_NOTHROW;
-
- Q_DECL_CONSTEXPR inline bool isNull() const Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR inline bool isEmpty() const Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR inline bool isValid() const Q_DECL_NOTHROW;
-
- Q_DECL_CONSTEXPR inline int left() const Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR inline int top() const Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR inline int right() const Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR inline int bottom() const Q_DECL_NOTHROW;
- Q_REQUIRED_RESULT QRect normalized() const Q_DECL_NOTHROW;
-
- Q_DECL_CONSTEXPR inline int x() const Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR inline int y() const Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void setLeft(int pos) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void setTop(int pos) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void setRight(int pos) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void setBottom(int pos) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void setX(int x) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void setY(int y) Q_DECL_NOTHROW;
-
- Q_DECL_RELAXED_CONSTEXPR inline void setTopLeft(const QPoint &p) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void setBottomRight(const QPoint &p) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void setTopRight(const QPoint &p) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void setBottomLeft(const QPoint &p) Q_DECL_NOTHROW;
-
- Q_DECL_CONSTEXPR inline QPoint topLeft() const Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR inline QPoint bottomRight() const Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR inline QPoint topRight() const Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR inline QPoint bottomLeft() const Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR inline QPoint center() const Q_DECL_NOTHROW;
-
- Q_DECL_RELAXED_CONSTEXPR inline void moveLeft(int pos) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void moveTop(int pos) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void moveRight(int pos) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void moveBottom(int pos) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void moveTopLeft(const QPoint &p) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void moveBottomRight(const QPoint &p) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void moveTopRight(const QPoint &p) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void moveBottomLeft(const QPoint &p) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void moveCenter(const QPoint &p) Q_DECL_NOTHROW;
-
- Q_DECL_RELAXED_CONSTEXPR inline void translate(int dx, int dy) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void translate(const QPoint &p) Q_DECL_NOTHROW;
- Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QRect translated(int dx, int dy) const Q_DECL_NOTHROW;
- Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QRect translated(const QPoint &p) const Q_DECL_NOTHROW;
- Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QRect transposed() const Q_DECL_NOTHROW;
-
- Q_DECL_RELAXED_CONSTEXPR inline void moveTo(int x, int t) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void moveTo(const QPoint &p) Q_DECL_NOTHROW;
-
- Q_DECL_RELAXED_CONSTEXPR inline void setRect(int x, int y, int w, int h) Q_DECL_NOTHROW;
+ Q_DECL_CONSTEXPR QRect() noexcept : x1(0), y1(0), x2(-1), y2(-1) {}
+ Q_DECL_CONSTEXPR QRect(const QPoint &topleft, const QPoint &bottomright) noexcept;
+ Q_DECL_CONSTEXPR QRect(const QPoint &topleft, const QSize &size) noexcept;
+ Q_DECL_CONSTEXPR QRect(int left, int top, int width, int height) noexcept;
+
+ Q_DECL_CONSTEXPR inline bool isNull() const noexcept;
+ Q_DECL_CONSTEXPR inline bool isEmpty() const noexcept;
+ Q_DECL_CONSTEXPR inline bool isValid() const noexcept;
+
+ Q_DECL_CONSTEXPR inline int left() const noexcept;
+ Q_DECL_CONSTEXPR inline int top() const noexcept;
+ Q_DECL_CONSTEXPR inline int right() const noexcept;
+ Q_DECL_CONSTEXPR inline int bottom() const noexcept;
+ Q_REQUIRED_RESULT QRect normalized() const noexcept;
+
+ Q_DECL_CONSTEXPR inline int x() const noexcept;
+ Q_DECL_CONSTEXPR inline int y() const noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void setLeft(int pos) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void setTop(int pos) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void setRight(int pos) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void setBottom(int pos) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void setX(int x) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void setY(int y) noexcept;
+
+ Q_DECL_RELAXED_CONSTEXPR inline void setTopLeft(const QPoint &p) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void setBottomRight(const QPoint &p) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void setTopRight(const QPoint &p) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void setBottomLeft(const QPoint &p) noexcept;
+
+ Q_DECL_CONSTEXPR inline QPoint topLeft() const noexcept;
+ Q_DECL_CONSTEXPR inline QPoint bottomRight() const noexcept;
+ Q_DECL_CONSTEXPR inline QPoint topRight() const noexcept;
+ Q_DECL_CONSTEXPR inline QPoint bottomLeft() const noexcept;
+ Q_DECL_CONSTEXPR inline QPoint center() const noexcept;
+
+ Q_DECL_RELAXED_CONSTEXPR inline void moveLeft(int pos) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void moveTop(int pos) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void moveRight(int pos) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void moveBottom(int pos) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void moveTopLeft(const QPoint &p) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void moveBottomRight(const QPoint &p) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void moveTopRight(const QPoint &p) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void moveBottomLeft(const QPoint &p) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void moveCenter(const QPoint &p) noexcept;
+
+ Q_DECL_RELAXED_CONSTEXPR inline void translate(int dx, int dy) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void translate(const QPoint &p) noexcept;
+ Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QRect translated(int dx, int dy) const noexcept;
+ Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QRect translated(const QPoint &p) const noexcept;
+ Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QRect transposed() const noexcept;
+
+ Q_DECL_RELAXED_CONSTEXPR inline void moveTo(int x, int t) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void moveTo(const QPoint &p) noexcept;
+
+ Q_DECL_RELAXED_CONSTEXPR inline void setRect(int x, int y, int w, int h) noexcept;
Q_DECL_RELAXED_CONSTEXPR inline void getRect(int *x, int *y, int *w, int *h) const;
- Q_DECL_RELAXED_CONSTEXPR inline void setCoords(int x1, int y1, int x2, int y2) Q_DECL_NOTHROW;
+ Q_DECL_RELAXED_CONSTEXPR inline void setCoords(int x1, int y1, int x2, int y2) noexcept;
Q_DECL_RELAXED_CONSTEXPR inline void getCoords(int *x1, int *y1, int *x2, int *y2) const;
- Q_DECL_RELAXED_CONSTEXPR inline void adjust(int x1, int y1, int x2, int y2) Q_DECL_NOTHROW;
- Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QRect adjusted(int x1, int y1, int x2, int y2) const Q_DECL_NOTHROW;
-
- Q_DECL_CONSTEXPR inline QSize size() const Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR inline int width() const Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR inline int height() const Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void setWidth(int w) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void setHeight(int h) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void setSize(const QSize &s) Q_DECL_NOTHROW;
-
- QRect operator|(const QRect &r) const Q_DECL_NOTHROW;
- QRect operator&(const QRect &r) const Q_DECL_NOTHROW;
- inline QRect& operator|=(const QRect &r) Q_DECL_NOTHROW;
- inline QRect& operator&=(const QRect &r) Q_DECL_NOTHROW;
-
- bool contains(const QRect &r, bool proper = false) const Q_DECL_NOTHROW;
- bool contains(const QPoint &p, bool proper=false) const Q_DECL_NOTHROW;
- inline bool contains(int x, int y) const Q_DECL_NOTHROW;
- inline bool contains(int x, int y, bool proper) const Q_DECL_NOTHROW;
- Q_REQUIRED_RESULT inline QRect united(const QRect &other) const Q_DECL_NOTHROW;
- Q_REQUIRED_RESULT inline QRect intersected(const QRect &other) const Q_DECL_NOTHROW;
- bool intersects(const QRect &r) const Q_DECL_NOTHROW;
-
- Q_DECL_CONSTEXPR inline QRect marginsAdded(const QMargins &margins) const Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR inline QRect marginsRemoved(const QMargins &margins) const Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline QRect &operator+=(const QMargins &margins) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline QRect &operator-=(const QMargins &margins) Q_DECL_NOTHROW;
+ Q_DECL_RELAXED_CONSTEXPR inline void adjust(int x1, int y1, int x2, int y2) noexcept;
+ Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QRect adjusted(int x1, int y1, int x2, int y2) const noexcept;
+
+ Q_DECL_CONSTEXPR inline QSize size() const noexcept;
+ Q_DECL_CONSTEXPR inline int width() const noexcept;
+ Q_DECL_CONSTEXPR inline int height() const noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void setWidth(int w) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void setHeight(int h) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void setSize(const QSize &s) noexcept;
+
+ QRect operator|(const QRect &r) const noexcept;
+ QRect operator&(const QRect &r) const noexcept;
+ inline QRect& operator|=(const QRect &r) noexcept;
+ inline QRect& operator&=(const QRect &r) noexcept;
+
+ bool contains(const QRect &r, bool proper = false) const noexcept;
+ bool contains(const QPoint &p, bool proper=false) const noexcept;
+ inline bool contains(int x, int y) const noexcept;
+ inline bool contains(int x, int y, bool proper) const noexcept;
+ Q_REQUIRED_RESULT inline QRect united(const QRect &other) const noexcept;
+ Q_REQUIRED_RESULT inline QRect intersected(const QRect &other) const noexcept;
+ bool intersects(const QRect &r) const noexcept;
+
+ Q_DECL_CONSTEXPR inline QRect marginsAdded(const QMargins &margins) const noexcept;
+ Q_DECL_CONSTEXPR inline QRect marginsRemoved(const QMargins &margins) const noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline QRect &operator+=(const QMargins &margins) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline QRect &operator-=(const QMargins &margins) noexcept;
#if QT_DEPRECATED_SINCE(5, 0)
- Q_REQUIRED_RESULT QT_DEPRECATED QRect unite(const QRect &r) const Q_DECL_NOTHROW { return united(r); }
- Q_REQUIRED_RESULT QT_DEPRECATED QRect intersect(const QRect &r) const Q_DECL_NOTHROW { return intersected(r); }
+ Q_REQUIRED_RESULT QT_DEPRECATED QRect unite(const QRect &r) const noexcept { return united(r); }
+ Q_REQUIRED_RESULT QT_DEPRECATED QRect intersect(const QRect &r) const noexcept { return intersected(r); }
#endif
- friend Q_DECL_CONSTEXPR inline bool operator==(const QRect &, const QRect &) Q_DECL_NOTHROW;
- friend Q_DECL_CONSTEXPR inline bool operator!=(const QRect &, const QRect &) Q_DECL_NOTHROW;
+ friend Q_DECL_CONSTEXPR inline bool operator==(const QRect &, const QRect &) noexcept;
+ friend Q_DECL_CONSTEXPR inline bool operator!=(const QRect &, const QRect &) noexcept;
#if defined(Q_OS_DARWIN) || defined(Q_QDOC)
- Q_REQUIRED_RESULT CGRect toCGRect() const Q_DECL_NOTHROW;
+ Q_REQUIRED_RESULT CGRect toCGRect() const noexcept;
#endif
private:
@@ -165,8 +165,8 @@ private:
};
Q_DECLARE_TYPEINFO(QRect, Q_MOVABLE_TYPE);
-Q_DECL_CONSTEXPR inline bool operator==(const QRect &, const QRect &) Q_DECL_NOTHROW;
-Q_DECL_CONSTEXPR inline bool operator!=(const QRect &, const QRect &) Q_DECL_NOTHROW;
+Q_DECL_CONSTEXPR inline bool operator==(const QRect &, const QRect &) noexcept;
+Q_DECL_CONSTEXPR inline bool operator!=(const QRect &, const QRect &) noexcept;
/*****************************************************************************
@@ -181,97 +181,97 @@ Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QRect &);
QRect inline member functions
*****************************************************************************/
-Q_DECL_CONSTEXPR inline QRect::QRect(int aleft, int atop, int awidth, int aheight) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QRect::QRect(int aleft, int atop, int awidth, int aheight) noexcept
: x1(aleft), y1(atop), x2(aleft + awidth - 1), y2(atop + aheight - 1) {}
-Q_DECL_CONSTEXPR inline QRect::QRect(const QPoint &atopLeft, const QPoint &abottomRight) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QRect::QRect(const QPoint &atopLeft, const QPoint &abottomRight) noexcept
: x1(atopLeft.x()), y1(atopLeft.y()), x2(abottomRight.x()), y2(abottomRight.y()) {}
-Q_DECL_CONSTEXPR inline QRect::QRect(const QPoint &atopLeft, const QSize &asize) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QRect::QRect(const QPoint &atopLeft, const QSize &asize) noexcept
: x1(atopLeft.x()), y1(atopLeft.y()), x2(atopLeft.x()+asize.width() - 1), y2(atopLeft.y()+asize.height() - 1) {}
-Q_DECL_CONSTEXPR inline bool QRect::isNull() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline bool QRect::isNull() const noexcept
{ return x2 == x1 - 1 && y2 == y1 - 1; }
-Q_DECL_CONSTEXPR inline bool QRect::isEmpty() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline bool QRect::isEmpty() const noexcept
{ return x1 > x2 || y1 > y2; }
-Q_DECL_CONSTEXPR inline bool QRect::isValid() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline bool QRect::isValid() const noexcept
{ return x1 <= x2 && y1 <= y2; }
-Q_DECL_CONSTEXPR inline int QRect::left() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline int QRect::left() const noexcept
{ return x1; }
-Q_DECL_CONSTEXPR inline int QRect::top() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline int QRect::top() const noexcept
{ return y1; }
-Q_DECL_CONSTEXPR inline int QRect::right() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline int QRect::right() const noexcept
{ return x2; }
-Q_DECL_CONSTEXPR inline int QRect::bottom() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline int QRect::bottom() const noexcept
{ return y2; }
-Q_DECL_CONSTEXPR inline int QRect::x() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline int QRect::x() const noexcept
{ return x1; }
-Q_DECL_CONSTEXPR inline int QRect::y() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline int QRect::y() const noexcept
{ return y1; }
-Q_DECL_RELAXED_CONSTEXPR inline void QRect::setLeft(int pos) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRect::setLeft(int pos) noexcept
{ x1 = pos; }
-Q_DECL_RELAXED_CONSTEXPR inline void QRect::setTop(int pos) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRect::setTop(int pos) noexcept
{ y1 = pos; }
-Q_DECL_RELAXED_CONSTEXPR inline void QRect::setRight(int pos) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRect::setRight(int pos) noexcept
{ x2 = pos; }
-Q_DECL_RELAXED_CONSTEXPR inline void QRect::setBottom(int pos) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRect::setBottom(int pos) noexcept
{ y2 = pos; }
-Q_DECL_RELAXED_CONSTEXPR inline void QRect::setTopLeft(const QPoint &p) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRect::setTopLeft(const QPoint &p) noexcept
{ x1 = p.x(); y1 = p.y(); }
-Q_DECL_RELAXED_CONSTEXPR inline void QRect::setBottomRight(const QPoint &p) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRect::setBottomRight(const QPoint &p) noexcept
{ x2 = p.x(); y2 = p.y(); }
-Q_DECL_RELAXED_CONSTEXPR inline void QRect::setTopRight(const QPoint &p) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRect::setTopRight(const QPoint &p) noexcept
{ x2 = p.x(); y1 = p.y(); }
-Q_DECL_RELAXED_CONSTEXPR inline void QRect::setBottomLeft(const QPoint &p) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRect::setBottomLeft(const QPoint &p) noexcept
{ x1 = p.x(); y2 = p.y(); }
-Q_DECL_RELAXED_CONSTEXPR inline void QRect::setX(int ax) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRect::setX(int ax) noexcept
{ x1 = ax; }
-Q_DECL_RELAXED_CONSTEXPR inline void QRect::setY(int ay) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRect::setY(int ay) noexcept
{ y1 = ay; }
-Q_DECL_CONSTEXPR inline QPoint QRect::topLeft() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QPoint QRect::topLeft() const noexcept
{ return QPoint(x1, y1); }
-Q_DECL_CONSTEXPR inline QPoint QRect::bottomRight() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QPoint QRect::bottomRight() const noexcept
{ return QPoint(x2, y2); }
-Q_DECL_CONSTEXPR inline QPoint QRect::topRight() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QPoint QRect::topRight() const noexcept
{ return QPoint(x2, y1); }
-Q_DECL_CONSTEXPR inline QPoint QRect::bottomLeft() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QPoint QRect::bottomLeft() const noexcept
{ return QPoint(x1, y2); }
-Q_DECL_CONSTEXPR inline QPoint QRect::center() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QPoint QRect::center() const noexcept
{ return QPoint(int((qint64(x1)+x2)/2), int((qint64(y1)+y2)/2)); } // cast avoids overflow on addition
-Q_DECL_CONSTEXPR inline int QRect::width() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline int QRect::width() const noexcept
{ return x2 - x1 + 1; }
-Q_DECL_CONSTEXPR inline int QRect::height() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline int QRect::height() const noexcept
{ return y2 - y1 + 1; }
-Q_DECL_CONSTEXPR inline QSize QRect::size() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QSize QRect::size() const noexcept
{ return QSize(width(), height()); }
-Q_DECL_RELAXED_CONSTEXPR inline void QRect::translate(int dx, int dy) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRect::translate(int dx, int dy) noexcept
{
x1 += dx;
y1 += dy;
@@ -279,7 +279,7 @@ Q_DECL_RELAXED_CONSTEXPR inline void QRect::translate(int dx, int dy) Q_DECL_NOT
y2 += dy;
}
-Q_DECL_RELAXED_CONSTEXPR inline void QRect::translate(const QPoint &p) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRect::translate(const QPoint &p) noexcept
{
x1 += p.x();
y1 += p.y();
@@ -287,16 +287,16 @@ Q_DECL_RELAXED_CONSTEXPR inline void QRect::translate(const QPoint &p) Q_DECL_NO
y2 += p.y();
}
-Q_DECL_CONSTEXPR inline QRect QRect::translated(int dx, int dy) const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QRect QRect::translated(int dx, int dy) const noexcept
{ return QRect(QPoint(x1 + dx, y1 + dy), QPoint(x2 + dx, y2 + dy)); }
-Q_DECL_CONSTEXPR inline QRect QRect::translated(const QPoint &p) const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QRect QRect::translated(const QPoint &p) const noexcept
{ return QRect(QPoint(x1 + p.x(), y1 + p.y()), QPoint(x2 + p.x(), y2 + p.y())); }
-Q_DECL_CONSTEXPR inline QRect QRect::transposed() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QRect QRect::transposed() const noexcept
{ return QRect(topLeft(), size().transposed()); }
-Q_DECL_RELAXED_CONSTEXPR inline void QRect::moveTo(int ax, int ay) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRect::moveTo(int ax, int ay) noexcept
{
x2 += ax - x1;
y2 += ay - y1;
@@ -304,7 +304,7 @@ Q_DECL_RELAXED_CONSTEXPR inline void QRect::moveTo(int ax, int ay) Q_DECL_NOTHRO
y1 = ay;
}
-Q_DECL_RELAXED_CONSTEXPR inline void QRect::moveTo(const QPoint &p) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRect::moveTo(const QPoint &p) noexcept
{
x2 += p.x() - x1;
y2 += p.y() - y1;
@@ -312,49 +312,49 @@ Q_DECL_RELAXED_CONSTEXPR inline void QRect::moveTo(const QPoint &p) Q_DECL_NOTHR
y1 = p.y();
}
-Q_DECL_RELAXED_CONSTEXPR inline void QRect::moveLeft(int pos) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRect::moveLeft(int pos) noexcept
{ x2 += (pos - x1); x1 = pos; }
-Q_DECL_RELAXED_CONSTEXPR inline void QRect::moveTop(int pos) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRect::moveTop(int pos) noexcept
{ y2 += (pos - y1); y1 = pos; }
-Q_DECL_RELAXED_CONSTEXPR inline void QRect::moveRight(int pos) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRect::moveRight(int pos) noexcept
{
x1 += (pos - x2);
x2 = pos;
}
-Q_DECL_RELAXED_CONSTEXPR inline void QRect::moveBottom(int pos) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRect::moveBottom(int pos) noexcept
{
y1 += (pos - y2);
y2 = pos;
}
-Q_DECL_RELAXED_CONSTEXPR inline void QRect::moveTopLeft(const QPoint &p) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRect::moveTopLeft(const QPoint &p) noexcept
{
moveLeft(p.x());
moveTop(p.y());
}
-Q_DECL_RELAXED_CONSTEXPR inline void QRect::moveBottomRight(const QPoint &p) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRect::moveBottomRight(const QPoint &p) noexcept
{
moveRight(p.x());
moveBottom(p.y());
}
-Q_DECL_RELAXED_CONSTEXPR inline void QRect::moveTopRight(const QPoint &p) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRect::moveTopRight(const QPoint &p) noexcept
{
moveRight(p.x());
moveTop(p.y());
}
-Q_DECL_RELAXED_CONSTEXPR inline void QRect::moveBottomLeft(const QPoint &p) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRect::moveBottomLeft(const QPoint &p) noexcept
{
moveLeft(p.x());
moveBottom(p.y());
}
-Q_DECL_RELAXED_CONSTEXPR inline void QRect::moveCenter(const QPoint &p) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRect::moveCenter(const QPoint &p) noexcept
{
int w = x2 - x1;
int h = y2 - y1;
@@ -372,7 +372,7 @@ Q_DECL_RELAXED_CONSTEXPR inline void QRect::getRect(int *ax, int *ay, int *aw, i
*ah = y2 - y1 + 1;
}
-Q_DECL_RELAXED_CONSTEXPR inline void QRect::setRect(int ax, int ay, int aw, int ah) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRect::setRect(int ax, int ay, int aw, int ah) noexcept
{
x1 = ax;
y1 = ay;
@@ -388,7 +388,7 @@ Q_DECL_RELAXED_CONSTEXPR inline void QRect::getCoords(int *xp1, int *yp1, int *x
*yp2 = y2;
}
-Q_DECL_RELAXED_CONSTEXPR inline void QRect::setCoords(int xp1, int yp1, int xp2, int yp2) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRect::setCoords(int xp1, int yp1, int xp2, int yp2) noexcept
{
x1 = xp1;
y1 = yp1;
@@ -396,10 +396,10 @@ Q_DECL_RELAXED_CONSTEXPR inline void QRect::setCoords(int xp1, int yp1, int xp2,
y2 = yp2;
}
-Q_DECL_CONSTEXPR inline QRect QRect::adjusted(int xp1, int yp1, int xp2, int yp2) const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QRect QRect::adjusted(int xp1, int yp1, int xp2, int yp2) const noexcept
{ return QRect(QPoint(x1 + xp1, y1 + yp1), QPoint(x2 + xp2, y2 + yp2)); }
-Q_DECL_RELAXED_CONSTEXPR inline void QRect::adjust(int dx1, int dy1, int dx2, int dy2) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRect::adjust(int dx1, int dy1, int dx2, int dy2) noexcept
{
x1 += dx1;
y1 += dy1;
@@ -407,97 +407,97 @@ Q_DECL_RELAXED_CONSTEXPR inline void QRect::adjust(int dx1, int dy1, int dx2, in
y2 += dy2;
}
-Q_DECL_RELAXED_CONSTEXPR inline void QRect::setWidth(int w) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRect::setWidth(int w) noexcept
{ x2 = (x1 + w - 1); }
-Q_DECL_RELAXED_CONSTEXPR inline void QRect::setHeight(int h) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRect::setHeight(int h) noexcept
{ y2 = (y1 + h - 1); }
-Q_DECL_RELAXED_CONSTEXPR inline void QRect::setSize(const QSize &s) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRect::setSize(const QSize &s) noexcept
{
x2 = (s.width() + x1 - 1);
y2 = (s.height() + y1 - 1);
}
-inline bool QRect::contains(int ax, int ay, bool aproper) const Q_DECL_NOTHROW
+inline bool QRect::contains(int ax, int ay, bool aproper) const noexcept
{
return contains(QPoint(ax, ay), aproper);
}
-inline bool QRect::contains(int ax, int ay) const Q_DECL_NOTHROW
+inline bool QRect::contains(int ax, int ay) const noexcept
{
return contains(QPoint(ax, ay), false);
}
-inline QRect& QRect::operator|=(const QRect &r) Q_DECL_NOTHROW
+inline QRect& QRect::operator|=(const QRect &r) noexcept
{
*this = *this | r;
return *this;
}
-inline QRect& QRect::operator&=(const QRect &r) Q_DECL_NOTHROW
+inline QRect& QRect::operator&=(const QRect &r) noexcept
{
*this = *this & r;
return *this;
}
-inline QRect QRect::intersected(const QRect &other) const Q_DECL_NOTHROW
+inline QRect QRect::intersected(const QRect &other) const noexcept
{
return *this & other;
}
-inline QRect QRect::united(const QRect &r) const Q_DECL_NOTHROW
+inline QRect QRect::united(const QRect &r) const noexcept
{
return *this | r;
}
-Q_DECL_CONSTEXPR inline bool operator==(const QRect &r1, const QRect &r2) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline bool operator==(const QRect &r1, const QRect &r2) noexcept
{
return r1.x1==r2.x1 && r1.x2==r2.x2 && r1.y1==r2.y1 && r1.y2==r2.y2;
}
-Q_DECL_CONSTEXPR inline bool operator!=(const QRect &r1, const QRect &r2) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline bool operator!=(const QRect &r1, const QRect &r2) noexcept
{
return r1.x1!=r2.x1 || r1.x2!=r2.x2 || r1.y1!=r2.y1 || r1.y2!=r2.y2;
}
-Q_DECL_CONSTEXPR inline QRect operator+(const QRect &rectangle, const QMargins &margins) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QRect operator+(const QRect &rectangle, const QMargins &margins) noexcept
{
return QRect(QPoint(rectangle.left() - margins.left(), rectangle.top() - margins.top()),
QPoint(rectangle.right() + margins.right(), rectangle.bottom() + margins.bottom()));
}
-Q_DECL_CONSTEXPR inline QRect operator+(const QMargins &margins, const QRect &rectangle) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QRect operator+(const QMargins &margins, const QRect &rectangle) noexcept
{
return QRect(QPoint(rectangle.left() - margins.left(), rectangle.top() - margins.top()),
QPoint(rectangle.right() + margins.right(), rectangle.bottom() + margins.bottom()));
}
-Q_DECL_CONSTEXPR inline QRect operator-(const QRect &lhs, const QMargins &rhs) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QRect operator-(const QRect &lhs, const QMargins &rhs) noexcept
{
return QRect(QPoint(lhs.left() + rhs.left(), lhs.top() + rhs.top()),
QPoint(lhs.right() - rhs.right(), lhs.bottom() - rhs.bottom()));
}
-Q_DECL_CONSTEXPR inline QRect QRect::marginsAdded(const QMargins &margins) const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QRect QRect::marginsAdded(const QMargins &margins) const noexcept
{
return QRect(QPoint(x1 - margins.left(), y1 - margins.top()),
QPoint(x2 + margins.right(), y2 + margins.bottom()));
}
-Q_DECL_CONSTEXPR inline QRect QRect::marginsRemoved(const QMargins &margins) const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QRect QRect::marginsRemoved(const QMargins &margins) const noexcept
{
return QRect(QPoint(x1 + margins.left(), y1 + margins.top()),
QPoint(x2 - margins.right(), y2 - margins.bottom()));
}
-Q_DECL_RELAXED_CONSTEXPR inline QRect &QRect::operator+=(const QMargins &margins) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline QRect &QRect::operator+=(const QMargins &margins) noexcept
{
*this = marginsAdded(margins);
return *this;
}
-Q_DECL_RELAXED_CONSTEXPR inline QRect &QRect::operator-=(const QMargins &margins) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline QRect &QRect::operator-=(const QMargins &margins) noexcept
{
*this = marginsRemoved(margins);
return *this;
@@ -511,110 +511,110 @@ Q_CORE_EXPORT QDebug operator<<(QDebug, const QRect &);
class Q_CORE_EXPORT QRectF
{
public:
- Q_DECL_CONSTEXPR QRectF() Q_DECL_NOTHROW : xp(0.), yp(0.), w(0.), h(0.) {}
- Q_DECL_CONSTEXPR QRectF(const QPointF &topleft, const QSizeF &size) Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR QRectF(const QPointF &topleft, const QPointF &bottomRight) Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR QRectF(qreal left, qreal top, qreal width, qreal height) Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR QRectF(const QRect &rect) Q_DECL_NOTHROW;
-
- Q_DECL_CONSTEXPR inline bool isNull() const Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR inline bool isEmpty() const Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR inline bool isValid() const Q_DECL_NOTHROW;
- Q_REQUIRED_RESULT QRectF normalized() const Q_DECL_NOTHROW;
-
- Q_DECL_CONSTEXPR inline qreal left() const Q_DECL_NOTHROW { return xp; }
- Q_DECL_CONSTEXPR inline qreal top() const Q_DECL_NOTHROW { return yp; }
- Q_DECL_CONSTEXPR inline qreal right() const Q_DECL_NOTHROW { return xp + w; }
- Q_DECL_CONSTEXPR inline qreal bottom() const Q_DECL_NOTHROW { return yp + h; }
-
- Q_DECL_CONSTEXPR inline qreal x() const Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR inline qreal y() const Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void setLeft(qreal pos) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void setTop(qreal pos) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void setRight(qreal pos) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void setBottom(qreal pos) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void setX(qreal pos) Q_DECL_NOTHROW { setLeft(pos); }
- Q_DECL_RELAXED_CONSTEXPR inline void setY(qreal pos) Q_DECL_NOTHROW { setTop(pos); }
-
- Q_DECL_CONSTEXPR inline QPointF topLeft() const Q_DECL_NOTHROW { return QPointF(xp, yp); }
- Q_DECL_CONSTEXPR inline QPointF bottomRight() const Q_DECL_NOTHROW { return QPointF(xp+w, yp+h); }
- Q_DECL_CONSTEXPR inline QPointF topRight() const Q_DECL_NOTHROW { return QPointF(xp+w, yp); }
- Q_DECL_CONSTEXPR inline QPointF bottomLeft() const Q_DECL_NOTHROW { return QPointF(xp, yp+h); }
- Q_DECL_CONSTEXPR inline QPointF center() const Q_DECL_NOTHROW;
-
- Q_DECL_RELAXED_CONSTEXPR inline void setTopLeft(const QPointF &p) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void setBottomRight(const QPointF &p) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void setTopRight(const QPointF &p) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void setBottomLeft(const QPointF &p) Q_DECL_NOTHROW;
-
- Q_DECL_RELAXED_CONSTEXPR inline void moveLeft(qreal pos) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void moveTop(qreal pos) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void moveRight(qreal pos) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void moveBottom(qreal pos) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void moveTopLeft(const QPointF &p) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void moveBottomRight(const QPointF &p) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void moveTopRight(const QPointF &p) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void moveBottomLeft(const QPointF &p) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void moveCenter(const QPointF &p) Q_DECL_NOTHROW;
-
- Q_DECL_RELAXED_CONSTEXPR inline void translate(qreal dx, qreal dy) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void translate(const QPointF &p) Q_DECL_NOTHROW;
-
- Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QRectF translated(qreal dx, qreal dy) const Q_DECL_NOTHROW;
- Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QRectF translated(const QPointF &p) const Q_DECL_NOTHROW;
-
- Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QRectF transposed() const Q_DECL_NOTHROW;
-
- Q_DECL_RELAXED_CONSTEXPR inline void moveTo(qreal x, qreal y) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void moveTo(const QPointF &p) Q_DECL_NOTHROW;
-
- Q_DECL_RELAXED_CONSTEXPR inline void setRect(qreal x, qreal y, qreal w, qreal h) Q_DECL_NOTHROW;
+ Q_DECL_CONSTEXPR QRectF() noexcept : xp(0.), yp(0.), w(0.), h(0.) {}
+ Q_DECL_CONSTEXPR QRectF(const QPointF &topleft, const QSizeF &size) noexcept;
+ Q_DECL_CONSTEXPR QRectF(const QPointF &topleft, const QPointF &bottomRight) noexcept;
+ Q_DECL_CONSTEXPR QRectF(qreal left, qreal top, qreal width, qreal height) noexcept;
+ Q_DECL_CONSTEXPR QRectF(const QRect &rect) noexcept;
+
+ Q_DECL_CONSTEXPR inline bool isNull() const noexcept;
+ Q_DECL_CONSTEXPR inline bool isEmpty() const noexcept;
+ Q_DECL_CONSTEXPR inline bool isValid() const noexcept;
+ Q_REQUIRED_RESULT QRectF normalized() const noexcept;
+
+ Q_DECL_CONSTEXPR inline qreal left() const noexcept { return xp; }
+ Q_DECL_CONSTEXPR inline qreal top() const noexcept { return yp; }
+ Q_DECL_CONSTEXPR inline qreal right() const noexcept { return xp + w; }
+ Q_DECL_CONSTEXPR inline qreal bottom() const noexcept { return yp + h; }
+
+ Q_DECL_CONSTEXPR inline qreal x() const noexcept;
+ Q_DECL_CONSTEXPR inline qreal y() const noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void setLeft(qreal pos) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void setTop(qreal pos) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void setRight(qreal pos) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void setBottom(qreal pos) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void setX(qreal pos) noexcept { setLeft(pos); }
+ Q_DECL_RELAXED_CONSTEXPR inline void setY(qreal pos) noexcept { setTop(pos); }
+
+ Q_DECL_CONSTEXPR inline QPointF topLeft() const noexcept { return QPointF(xp, yp); }
+ Q_DECL_CONSTEXPR inline QPointF bottomRight() const noexcept { return QPointF(xp+w, yp+h); }
+ Q_DECL_CONSTEXPR inline QPointF topRight() const noexcept { return QPointF(xp+w, yp); }
+ Q_DECL_CONSTEXPR inline QPointF bottomLeft() const noexcept { return QPointF(xp, yp+h); }
+ Q_DECL_CONSTEXPR inline QPointF center() const noexcept;
+
+ Q_DECL_RELAXED_CONSTEXPR inline void setTopLeft(const QPointF &p) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void setBottomRight(const QPointF &p) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void setTopRight(const QPointF &p) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void setBottomLeft(const QPointF &p) noexcept;
+
+ Q_DECL_RELAXED_CONSTEXPR inline void moveLeft(qreal pos) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void moveTop(qreal pos) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void moveRight(qreal pos) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void moveBottom(qreal pos) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void moveTopLeft(const QPointF &p) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void moveBottomRight(const QPointF &p) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void moveTopRight(const QPointF &p) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void moveBottomLeft(const QPointF &p) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void moveCenter(const QPointF &p) noexcept;
+
+ Q_DECL_RELAXED_CONSTEXPR inline void translate(qreal dx, qreal dy) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void translate(const QPointF &p) noexcept;
+
+ Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QRectF translated(qreal dx, qreal dy) const noexcept;
+ Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QRectF translated(const QPointF &p) const noexcept;
+
+ Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QRectF transposed() const noexcept;
+
+ Q_DECL_RELAXED_CONSTEXPR inline void moveTo(qreal x, qreal y) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void moveTo(const QPointF &p) noexcept;
+
+ Q_DECL_RELAXED_CONSTEXPR inline void setRect(qreal x, qreal y, qreal w, qreal h) noexcept;
Q_DECL_RELAXED_CONSTEXPR inline void getRect(qreal *x, qreal *y, qreal *w, qreal *h) const;
- Q_DECL_RELAXED_CONSTEXPR inline void setCoords(qreal x1, qreal y1, qreal x2, qreal y2) Q_DECL_NOTHROW;
+ Q_DECL_RELAXED_CONSTEXPR inline void setCoords(qreal x1, qreal y1, qreal x2, qreal y2) noexcept;
Q_DECL_RELAXED_CONSTEXPR inline void getCoords(qreal *x1, qreal *y1, qreal *x2, qreal *y2) const;
- Q_DECL_RELAXED_CONSTEXPR inline void adjust(qreal x1, qreal y1, qreal x2, qreal y2) Q_DECL_NOTHROW;
- Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QRectF adjusted(qreal x1, qreal y1, qreal x2, qreal y2) const Q_DECL_NOTHROW;
-
- Q_DECL_CONSTEXPR inline QSizeF size() const Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR inline qreal width() const Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR inline qreal height() const Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void setWidth(qreal w) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void setHeight(qreal h) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void setSize(const QSizeF &s) Q_DECL_NOTHROW;
-
- QRectF operator|(const QRectF &r) const Q_DECL_NOTHROW;
- QRectF operator&(const QRectF &r) const Q_DECL_NOTHROW;
- inline QRectF& operator|=(const QRectF &r) Q_DECL_NOTHROW;
- inline QRectF& operator&=(const QRectF &r) Q_DECL_NOTHROW;
-
- bool contains(const QRectF &r) const Q_DECL_NOTHROW;
- bool contains(const QPointF &p) const Q_DECL_NOTHROW;
- inline bool contains(qreal x, qreal y) const Q_DECL_NOTHROW;
- Q_REQUIRED_RESULT inline QRectF united(const QRectF &other) const Q_DECL_NOTHROW;
- Q_REQUIRED_RESULT inline QRectF intersected(const QRectF &other) const Q_DECL_NOTHROW;
- bool intersects(const QRectF &r) const Q_DECL_NOTHROW;
-
- Q_DECL_CONSTEXPR inline QRectF marginsAdded(const QMarginsF &margins) const Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR inline QRectF marginsRemoved(const QMarginsF &margins) const Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline QRectF &operator+=(const QMarginsF &margins) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline QRectF &operator-=(const QMarginsF &margins) Q_DECL_NOTHROW;
+ Q_DECL_RELAXED_CONSTEXPR inline void adjust(qreal x1, qreal y1, qreal x2, qreal y2) noexcept;
+ Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QRectF adjusted(qreal x1, qreal y1, qreal x2, qreal y2) const noexcept;
+
+ Q_DECL_CONSTEXPR inline QSizeF size() const noexcept;
+ Q_DECL_CONSTEXPR inline qreal width() const noexcept;
+ Q_DECL_CONSTEXPR inline qreal height() const noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void setWidth(qreal w) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void setHeight(qreal h) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void setSize(const QSizeF &s) noexcept;
+
+ QRectF operator|(const QRectF &r) const noexcept;
+ QRectF operator&(const QRectF &r) const noexcept;
+ inline QRectF& operator|=(const QRectF &r) noexcept;
+ inline QRectF& operator&=(const QRectF &r) noexcept;
+
+ bool contains(const QRectF &r) const noexcept;
+ bool contains(const QPointF &p) const noexcept;
+ inline bool contains(qreal x, qreal y) const noexcept;
+ Q_REQUIRED_RESULT inline QRectF united(const QRectF &other) const noexcept;
+ Q_REQUIRED_RESULT inline QRectF intersected(const QRectF &other) const noexcept;
+ bool intersects(const QRectF &r) const noexcept;
+
+ Q_DECL_CONSTEXPR inline QRectF marginsAdded(const QMarginsF &margins) const noexcept;
+ Q_DECL_CONSTEXPR inline QRectF marginsRemoved(const QMarginsF &margins) const noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline QRectF &operator+=(const QMarginsF &margins) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline QRectF &operator-=(const QMarginsF &margins) noexcept;
#if QT_DEPRECATED_SINCE(5, 0)
- Q_REQUIRED_RESULT QT_DEPRECATED QRectF unite(const QRectF &r) const Q_DECL_NOTHROW { return united(r); }
- Q_REQUIRED_RESULT QT_DEPRECATED QRectF intersect(const QRectF &r) const Q_DECL_NOTHROW { return intersected(r); }
+ Q_REQUIRED_RESULT QT_DEPRECATED QRectF unite(const QRectF &r) const noexcept { return united(r); }
+ Q_REQUIRED_RESULT QT_DEPRECATED QRectF intersect(const QRectF &r) const noexcept { return intersected(r); }
#endif
- friend Q_DECL_CONSTEXPR inline bool operator==(const QRectF &, const QRectF &) Q_DECL_NOTHROW;
- friend Q_DECL_CONSTEXPR inline bool operator!=(const QRectF &, const QRectF &) Q_DECL_NOTHROW;
+ friend Q_DECL_CONSTEXPR inline bool operator==(const QRectF &, const QRectF &) noexcept;
+ friend Q_DECL_CONSTEXPR inline bool operator!=(const QRectF &, const QRectF &) noexcept;
- Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QRect toRect() const Q_DECL_NOTHROW;
- Q_REQUIRED_RESULT QRect toAlignedRect() const Q_DECL_NOTHROW;
+ Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QRect toRect() const noexcept;
+ Q_REQUIRED_RESULT QRect toAlignedRect() const noexcept;
#if defined(Q_OS_DARWIN) || defined(Q_QDOC)
- Q_REQUIRED_RESULT static QRectF fromCGRect(CGRect rect) Q_DECL_NOTHROW;
- Q_REQUIRED_RESULT CGRect toCGRect() const Q_DECL_NOTHROW;
+ Q_REQUIRED_RESULT static QRectF fromCGRect(CGRect rect) noexcept;
+ Q_REQUIRED_RESULT CGRect toCGRect() const noexcept;
#endif
private:
@@ -625,8 +625,8 @@ private:
};
Q_DECLARE_TYPEINFO(QRectF, Q_MOVABLE_TYPE);
-Q_DECL_CONSTEXPR inline bool operator==(const QRectF &, const QRectF &) Q_DECL_NOTHROW;
-Q_DECL_CONSTEXPR inline bool operator!=(const QRectF &, const QRectF &) Q_DECL_NOTHROW;
+Q_DECL_CONSTEXPR inline bool operator==(const QRectF &, const QRectF &) noexcept;
+Q_DECL_CONSTEXPR inline bool operator!=(const QRectF &, const QRectF &) noexcept;
/*****************************************************************************
@@ -641,23 +641,23 @@ Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QRectF &);
QRectF inline member functions
*****************************************************************************/
-Q_DECL_CONSTEXPR inline QRectF::QRectF(qreal aleft, qreal atop, qreal awidth, qreal aheight) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QRectF::QRectF(qreal aleft, qreal atop, qreal awidth, qreal aheight) noexcept
: xp(aleft), yp(atop), w(awidth), h(aheight)
{
}
-Q_DECL_CONSTEXPR inline QRectF::QRectF(const QPointF &atopLeft, const QSizeF &asize) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QRectF::QRectF(const QPointF &atopLeft, const QSizeF &asize) noexcept
: xp(atopLeft.x()), yp(atopLeft.y()), w(asize.width()), h(asize.height())
{
}
-Q_DECL_CONSTEXPR inline QRectF::QRectF(const QPointF &atopLeft, const QPointF &abottomRight) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QRectF::QRectF(const QPointF &atopLeft, const QPointF &abottomRight) noexcept
: xp(atopLeft.x()), yp(atopLeft.y()), w(abottomRight.x() - atopLeft.x()), h(abottomRight.y() - atopLeft.y())
{
}
-Q_DECL_CONSTEXPR inline QRectF::QRectF(const QRect &r) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QRectF::QRectF(const QRect &r) noexcept
: xp(r.x()), yp(r.y()), w(r.width()), h(r.height())
{
}
@@ -666,117 +666,117 @@ QT_WARNING_PUSH
QT_WARNING_DISABLE_CLANG("-Wfloat-equal")
QT_WARNING_DISABLE_GCC("-Wfloat-equal")
-Q_DECL_CONSTEXPR inline bool QRectF::isNull() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline bool QRectF::isNull() const noexcept
{ return w == 0. && h == 0.; }
-Q_DECL_CONSTEXPR inline bool QRectF::isEmpty() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline bool QRectF::isEmpty() const noexcept
{ return w <= 0. || h <= 0.; }
QT_WARNING_POP
-Q_DECL_CONSTEXPR inline bool QRectF::isValid() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline bool QRectF::isValid() const noexcept
{ return w > 0. && h > 0.; }
-Q_DECL_CONSTEXPR inline qreal QRectF::x() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline qreal QRectF::x() const noexcept
{ return xp; }
-Q_DECL_CONSTEXPR inline qreal QRectF::y() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline qreal QRectF::y() const noexcept
{ return yp; }
-Q_DECL_RELAXED_CONSTEXPR inline void QRectF::setLeft(qreal pos) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRectF::setLeft(qreal pos) noexcept
{ qreal diff = pos - xp; xp += diff; w -= diff; }
-Q_DECL_RELAXED_CONSTEXPR inline void QRectF::setRight(qreal pos) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRectF::setRight(qreal pos) noexcept
{ w = pos - xp; }
-Q_DECL_RELAXED_CONSTEXPR inline void QRectF::setTop(qreal pos) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRectF::setTop(qreal pos) noexcept
{ qreal diff = pos - yp; yp += diff; h -= diff; }
-Q_DECL_RELAXED_CONSTEXPR inline void QRectF::setBottom(qreal pos) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRectF::setBottom(qreal pos) noexcept
{ h = pos - yp; }
-Q_DECL_RELAXED_CONSTEXPR inline void QRectF::setTopLeft(const QPointF &p) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRectF::setTopLeft(const QPointF &p) noexcept
{ setLeft(p.x()); setTop(p.y()); }
-Q_DECL_RELAXED_CONSTEXPR inline void QRectF::setTopRight(const QPointF &p) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRectF::setTopRight(const QPointF &p) noexcept
{ setRight(p.x()); setTop(p.y()); }
-Q_DECL_RELAXED_CONSTEXPR inline void QRectF::setBottomLeft(const QPointF &p) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRectF::setBottomLeft(const QPointF &p) noexcept
{ setLeft(p.x()); setBottom(p.y()); }
-Q_DECL_RELAXED_CONSTEXPR inline void QRectF::setBottomRight(const QPointF &p) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRectF::setBottomRight(const QPointF &p) noexcept
{ setRight(p.x()); setBottom(p.y()); }
-Q_DECL_CONSTEXPR inline QPointF QRectF::center() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QPointF QRectF::center() const noexcept
{ return QPointF(xp + w/2, yp + h/2); }
-Q_DECL_RELAXED_CONSTEXPR inline void QRectF::moveLeft(qreal pos) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRectF::moveLeft(qreal pos) noexcept
{ xp = pos; }
-Q_DECL_RELAXED_CONSTEXPR inline void QRectF::moveTop(qreal pos) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRectF::moveTop(qreal pos) noexcept
{ yp = pos; }
-Q_DECL_RELAXED_CONSTEXPR inline void QRectF::moveRight(qreal pos) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRectF::moveRight(qreal pos) noexcept
{ xp = pos - w; }
-Q_DECL_RELAXED_CONSTEXPR inline void QRectF::moveBottom(qreal pos) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRectF::moveBottom(qreal pos) noexcept
{ yp = pos - h; }
-Q_DECL_RELAXED_CONSTEXPR inline void QRectF::moveTopLeft(const QPointF &p) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRectF::moveTopLeft(const QPointF &p) noexcept
{ moveLeft(p.x()); moveTop(p.y()); }
-Q_DECL_RELAXED_CONSTEXPR inline void QRectF::moveTopRight(const QPointF &p) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRectF::moveTopRight(const QPointF &p) noexcept
{ moveRight(p.x()); moveTop(p.y()); }
-Q_DECL_RELAXED_CONSTEXPR inline void QRectF::moveBottomLeft(const QPointF &p) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRectF::moveBottomLeft(const QPointF &p) noexcept
{ moveLeft(p.x()); moveBottom(p.y()); }
-Q_DECL_RELAXED_CONSTEXPR inline void QRectF::moveBottomRight(const QPointF &p) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRectF::moveBottomRight(const QPointF &p) noexcept
{ moveRight(p.x()); moveBottom(p.y()); }
-Q_DECL_RELAXED_CONSTEXPR inline void QRectF::moveCenter(const QPointF &p) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRectF::moveCenter(const QPointF &p) noexcept
{ xp = p.x() - w/2; yp = p.y() - h/2; }
-Q_DECL_CONSTEXPR inline qreal QRectF::width() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline qreal QRectF::width() const noexcept
{ return w; }
-Q_DECL_CONSTEXPR inline qreal QRectF::height() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline qreal QRectF::height() const noexcept
{ return h; }
-Q_DECL_CONSTEXPR inline QSizeF QRectF::size() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QSizeF QRectF::size() const noexcept
{ return QSizeF(w, h); }
-Q_DECL_RELAXED_CONSTEXPR inline void QRectF::translate(qreal dx, qreal dy) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRectF::translate(qreal dx, qreal dy) noexcept
{
xp += dx;
yp += dy;
}
-Q_DECL_RELAXED_CONSTEXPR inline void QRectF::translate(const QPointF &p) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRectF::translate(const QPointF &p) noexcept
{
xp += p.x();
yp += p.y();
}
-Q_DECL_RELAXED_CONSTEXPR inline void QRectF::moveTo(qreal ax, qreal ay) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRectF::moveTo(qreal ax, qreal ay) noexcept
{
xp = ax;
yp = ay;
}
-Q_DECL_RELAXED_CONSTEXPR inline void QRectF::moveTo(const QPointF &p) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRectF::moveTo(const QPointF &p) noexcept
{
xp = p.x();
yp = p.y();
}
-Q_DECL_CONSTEXPR inline QRectF QRectF::translated(qreal dx, qreal dy) const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QRectF QRectF::translated(qreal dx, qreal dy) const noexcept
{ return QRectF(xp + dx, yp + dy, w, h); }
-Q_DECL_CONSTEXPR inline QRectF QRectF::translated(const QPointF &p) const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QRectF QRectF::translated(const QPointF &p) const noexcept
{ return QRectF(xp + p.x(), yp + p.y(), w, h); }
-Q_DECL_CONSTEXPR inline QRectF QRectF::transposed() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QRectF QRectF::transposed() const noexcept
{ return QRectF(topLeft(), size().transposed()); }
Q_DECL_RELAXED_CONSTEXPR inline void QRectF::getRect(qreal *ax, qreal *ay, qreal *aaw, qreal *aah) const
@@ -787,7 +787,7 @@ Q_DECL_RELAXED_CONSTEXPR inline void QRectF::getRect(qreal *ax, qreal *ay, qreal
*aah = this->h;
}
-Q_DECL_RELAXED_CONSTEXPR inline void QRectF::setRect(qreal ax, qreal ay, qreal aaw, qreal aah) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRectF::setRect(qreal ax, qreal ay, qreal aaw, qreal aah) noexcept
{
this->xp = ax;
this->yp = ay;
@@ -803,7 +803,7 @@ Q_DECL_RELAXED_CONSTEXPR inline void QRectF::getCoords(qreal *xp1, qreal *yp1, q
*yp2 = yp + h;
}
-Q_DECL_RELAXED_CONSTEXPR inline void QRectF::setCoords(qreal xp1, qreal yp1, qreal xp2, qreal yp2) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRectF::setCoords(qreal xp1, qreal yp1, qreal xp2, qreal yp2) noexcept
{
xp = xp1;
yp = yp1;
@@ -811,105 +811,105 @@ Q_DECL_RELAXED_CONSTEXPR inline void QRectF::setCoords(qreal xp1, qreal yp1, qre
h = yp2 - yp1;
}
-Q_DECL_RELAXED_CONSTEXPR inline void QRectF::adjust(qreal xp1, qreal yp1, qreal xp2, qreal yp2) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRectF::adjust(qreal xp1, qreal yp1, qreal xp2, qreal yp2) noexcept
{ xp += xp1; yp += yp1; w += xp2 - xp1; h += yp2 - yp1; }
-Q_DECL_CONSTEXPR inline QRectF QRectF::adjusted(qreal xp1, qreal yp1, qreal xp2, qreal yp2) const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QRectF QRectF::adjusted(qreal xp1, qreal yp1, qreal xp2, qreal yp2) const noexcept
{ return QRectF(xp + xp1, yp + yp1, w + xp2 - xp1, h + yp2 - yp1); }
-Q_DECL_RELAXED_CONSTEXPR inline void QRectF::setWidth(qreal aw) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRectF::setWidth(qreal aw) noexcept
{ this->w = aw; }
-Q_DECL_RELAXED_CONSTEXPR inline void QRectF::setHeight(qreal ah) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRectF::setHeight(qreal ah) noexcept
{ this->h = ah; }
-Q_DECL_RELAXED_CONSTEXPR inline void QRectF::setSize(const QSizeF &s) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRectF::setSize(const QSizeF &s) noexcept
{
w = s.width();
h = s.height();
}
-inline bool QRectF::contains(qreal ax, qreal ay) const Q_DECL_NOTHROW
+inline bool QRectF::contains(qreal ax, qreal ay) const noexcept
{
return contains(QPointF(ax, ay));
}
-inline QRectF& QRectF::operator|=(const QRectF &r) Q_DECL_NOTHROW
+inline QRectF& QRectF::operator|=(const QRectF &r) noexcept
{
*this = *this | r;
return *this;
}
-inline QRectF& QRectF::operator&=(const QRectF &r) Q_DECL_NOTHROW
+inline QRectF& QRectF::operator&=(const QRectF &r) noexcept
{
*this = *this & r;
return *this;
}
-inline QRectF QRectF::intersected(const QRectF &r) const Q_DECL_NOTHROW
+inline QRectF QRectF::intersected(const QRectF &r) const noexcept
{
return *this & r;
}
-inline QRectF QRectF::united(const QRectF &r) const Q_DECL_NOTHROW
+inline QRectF QRectF::united(const QRectF &r) const noexcept
{
return *this | r;
}
-Q_DECL_CONSTEXPR inline bool operator==(const QRectF &r1, const QRectF &r2) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline bool operator==(const QRectF &r1, const QRectF &r2) noexcept
{
return qFuzzyCompare(r1.xp, r2.xp) && qFuzzyCompare(r1.yp, r2.yp)
&& qFuzzyCompare(r1.w, r2.w) && qFuzzyCompare(r1.h, r2.h);
}
-Q_DECL_CONSTEXPR inline bool operator!=(const QRectF &r1, const QRectF &r2) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline bool operator!=(const QRectF &r1, const QRectF &r2) noexcept
{
return !qFuzzyCompare(r1.xp, r2.xp) || !qFuzzyCompare(r1.yp, r2.yp)
|| !qFuzzyCompare(r1.w, r2.w) || !qFuzzyCompare(r1.h, r2.h);
}
-Q_DECL_CONSTEXPR inline QRect QRectF::toRect() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QRect QRectF::toRect() const noexcept
{
return QRect(QPoint(qRound(xp), qRound(yp)), QPoint(qRound(xp + w) - 1, qRound(yp + h) - 1));
}
-Q_DECL_CONSTEXPR inline QRectF operator+(const QRectF &lhs, const QMarginsF &rhs) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QRectF operator+(const QRectF &lhs, const QMarginsF &rhs) noexcept
{
return QRectF(QPointF(lhs.left() - rhs.left(), lhs.top() - rhs.top()),
QSizeF(lhs.width() + rhs.left() + rhs.right(), lhs.height() + rhs.top() + rhs.bottom()));
}
-Q_DECL_CONSTEXPR inline QRectF operator+(const QMarginsF &lhs, const QRectF &rhs) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QRectF operator+(const QMarginsF &lhs, const QRectF &rhs) noexcept
{
return QRectF(QPointF(rhs.left() - lhs.left(), rhs.top() - lhs.top()),
QSizeF(rhs.width() + lhs.left() + lhs.right(), rhs.height() + lhs.top() + lhs.bottom()));
}
-Q_DECL_CONSTEXPR inline QRectF operator-(const QRectF &lhs, const QMarginsF &rhs) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QRectF operator-(const QRectF &lhs, const QMarginsF &rhs) noexcept
{
return QRectF(QPointF(lhs.left() + rhs.left(), lhs.top() + rhs.top()),
QSizeF(lhs.width() - rhs.left() - rhs.right(), lhs.height() - rhs.top() - rhs.bottom()));
}
-Q_DECL_CONSTEXPR inline QRectF QRectF::marginsAdded(const QMarginsF &margins) const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QRectF QRectF::marginsAdded(const QMarginsF &margins) const noexcept
{
return QRectF(QPointF(xp - margins.left(), yp - margins.top()),
QSizeF(w + margins.left() + margins.right(), h + margins.top() + margins.bottom()));
}
-Q_DECL_CONSTEXPR inline QRectF QRectF::marginsRemoved(const QMarginsF &margins) const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QRectF QRectF::marginsRemoved(const QMarginsF &margins) const noexcept
{
return QRectF(QPointF(xp + margins.left(), yp + margins.top()),
QSizeF(w - margins.left() - margins.right(), h - margins.top() - margins.bottom()));
}
-Q_DECL_RELAXED_CONSTEXPR inline QRectF &QRectF::operator+=(const QMarginsF &margins) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline QRectF &QRectF::operator+=(const QMarginsF &margins) noexcept
{
*this = marginsAdded(margins);
return *this;
}
-Q_DECL_RELAXED_CONSTEXPR inline QRectF &QRectF::operator-=(const QMarginsF &margins) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline QRectF &QRectF::operator-=(const QMarginsF &margins) noexcept
{
*this = marginsRemoved(margins);
return *this;
diff --git a/src/corelib/tools/qrefcount.h b/src/corelib/tools/qrefcount.h
index 9586c3a79a..71adb41f28 100644
--- a/src/corelib/tools/qrefcount.h
+++ b/src/corelib/tools/qrefcount.h
@@ -51,7 +51,7 @@ namespace QtPrivate
class RefCount
{
public:
- inline bool ref() Q_DECL_NOTHROW {
+ inline bool ref() noexcept {
int count = atomic.load();
#if !defined(QT_NO_UNSHARABLE_CONTAINERS)
if (count == 0) // !isSharable
@@ -62,7 +62,7 @@ public:
return true;
}
- inline bool deref() Q_DECL_NOTHROW {
+ inline bool deref() noexcept {
int count = atomic.load();
#if !defined(QT_NO_UNSHARABLE_CONTAINERS)
if (count == 0) // !isSharable
@@ -74,7 +74,7 @@ public:
}
#if !defined(QT_NO_UNSHARABLE_CONTAINERS)
- bool setSharable(bool sharable) Q_DECL_NOTHROW
+ bool setSharable(bool sharable) noexcept
{
Q_ASSERT(!isShared());
if (sharable)
@@ -83,27 +83,27 @@ public:
return atomic.testAndSetRelaxed(1, 0);
}
- bool isSharable() const Q_DECL_NOTHROW
+ bool isSharable() const noexcept
{
// Sharable === Shared ownership.
return atomic.load() != 0;
}
#endif
- bool isStatic() const Q_DECL_NOTHROW
+ bool isStatic() const noexcept
{
// Persistent object, never deleted
return atomic.load() == -1;
}
- bool isShared() const Q_DECL_NOTHROW
+ bool isShared() const noexcept
{
int count = atomic.load();
return (count != 1) && (count != 0);
}
- void initializeOwned() Q_DECL_NOTHROW { atomic.store(1); }
- void initializeUnsharable() Q_DECL_NOTHROW { atomic.store(0); }
+ void initializeOwned() noexcept { atomic.store(1); }
+ void initializeUnsharable() noexcept { atomic.store(0); }
QBasicAtomicInt atomic;
};
diff --git a/src/corelib/tools/qregexp.cpp b/src/corelib/tools/qregexp.cpp
index 589eb74520..d970843dea 100644
--- a/src/corelib/tools/qregexp.cpp
+++ b/src/corelib/tools/qregexp.cpp
@@ -890,7 +890,7 @@ static bool operator==(const QRegExpEngineKey &key1, const QRegExpEngineKey &key
&& key1.cs == key2.cs;
}
-static uint qHash(const QRegExpEngineKey &key, uint seed = 0) Q_DECL_NOTHROW
+static uint qHash(const QRegExpEngineKey &key, uint seed = 0) noexcept
{
QtPrivate::QHashCombine hash;
seed = hash(seed, key.pattern);
@@ -4046,7 +4046,7 @@ bool QRegExp::operator==(const QRegExp &rx) const
Returns the hash value for \a key, using
\a seed to seed the calculation.
*/
-uint qHash(const QRegExp &key, uint seed) Q_DECL_NOTHROW
+uint qHash(const QRegExp &key, uint seed) noexcept
{
QtPrivate::QHashCombine hash;
seed = hash(seed, key.priv->engineKey);
diff --git a/src/corelib/tools/qregexp.h b/src/corelib/tools/qregexp.h
index b3fa242168..c043a06496 100644
--- a/src/corelib/tools/qregexp.h
+++ b/src/corelib/tools/qregexp.h
@@ -53,7 +53,7 @@ struct QRegExpPrivate;
class QStringList;
class QRegExp;
-Q_CORE_EXPORT uint qHash(const QRegExp &key, uint seed = 0) Q_DECL_NOTHROW;
+Q_CORE_EXPORT uint qHash(const QRegExp &key, uint seed = 0) noexcept;
class Q_CORE_EXPORT QRegExp
{
@@ -74,9 +74,9 @@ public:
~QRegExp();
QRegExp &operator=(const QRegExp &rx);
#ifdef Q_COMPILER_RVALUE_REFS
- QRegExp &operator=(QRegExp &&other) Q_DECL_NOTHROW { swap(other); return *this; }
+ QRegExp &operator=(QRegExp &&other) noexcept { swap(other); return *this; }
#endif
- void swap(QRegExp &other) Q_DECL_NOTHROW { qSwap(priv, other.priv); }
+ void swap(QRegExp &other) noexcept { qSwap(priv, other.priv); }
bool operator==(const QRegExp &rx) const;
inline bool operator!=(const QRegExp &rx) const { return !operator==(rx); }
@@ -112,7 +112,7 @@ public:
static QString escape(const QString &str);
- friend Q_CORE_EXPORT uint qHash(const QRegExp &key, uint seed) Q_DECL_NOTHROW;
+ friend Q_CORE_EXPORT uint qHash(const QRegExp &key, uint seed) noexcept;
private:
QRegExpPrivate *priv;
diff --git a/src/corelib/tools/qregularexpression.cpp b/src/corelib/tools/qregularexpression.cpp
index bdaa2d3243..ca1a866842 100644
--- a/src/corelib/tools/qregularexpression.cpp
+++ b/src/corelib/tools/qregularexpression.cpp
@@ -1810,7 +1810,7 @@ bool QRegularExpression::operator==(const QRegularExpression &re) const
Returns the hash value for \a key, using
\a seed to seed the calculation.
*/
-uint qHash(const QRegularExpression &key, uint seed) Q_DECL_NOTHROW
+uint qHash(const QRegularExpression &key, uint seed) noexcept
{
QtPrivate::QHashCombine hash;
seed = hash(seed, key.d->pattern);
diff --git a/src/corelib/tools/qregularexpression.h b/src/corelib/tools/qregularexpression.h
index f9e7029550..f16b7e91be 100644
--- a/src/corelib/tools/qregularexpression.h
+++ b/src/corelib/tools/qregularexpression.h
@@ -59,7 +59,7 @@ class QRegularExpressionMatchIterator;
struct QRegularExpressionPrivate;
class QRegularExpression;
-Q_CORE_EXPORT uint qHash(const QRegularExpression &key, uint seed = 0) Q_DECL_NOTHROW;
+Q_CORE_EXPORT uint qHash(const QRegularExpression &key, uint seed = 0) noexcept;
class Q_CORE_EXPORT QRegularExpression
{
@@ -88,11 +88,11 @@ public:
QRegularExpression &operator=(const QRegularExpression &re);
#ifdef Q_COMPILER_RVALUE_REFS
- QRegularExpression &operator=(QRegularExpression &&re) Q_DECL_NOTHROW
+ QRegularExpression &operator=(QRegularExpression &&re) noexcept
{ d.swap(re.d); return *this; }
#endif
- void swap(QRegularExpression &other) Q_DECL_NOTHROW { d.swap(other.d); }
+ void swap(QRegularExpression &other) noexcept { d.swap(other.d); }
QString pattern() const;
void setPattern(const QString &pattern);
@@ -157,7 +157,7 @@ private:
friend class QRegularExpressionMatch;
friend struct QRegularExpressionMatchPrivate;
friend class QRegularExpressionMatchIterator;
- friend Q_CORE_EXPORT uint qHash(const QRegularExpression &key, uint seed) Q_DECL_NOTHROW;
+ friend Q_CORE_EXPORT uint qHash(const QRegularExpression &key, uint seed) noexcept;
QRegularExpression(QRegularExpressionPrivate &dd);
QExplicitlySharedDataPointer<QRegularExpressionPrivate> d;
@@ -188,10 +188,10 @@ public:
QRegularExpressionMatch &operator=(const QRegularExpressionMatch &match);
#ifdef Q_COMPILER_RVALUE_REFS
- QRegularExpressionMatch &operator=(QRegularExpressionMatch &&match) Q_DECL_NOTHROW
+ QRegularExpressionMatch &operator=(QRegularExpressionMatch &&match) noexcept
{ d.swap(match.d); return *this; }
#endif
- void swap(QRegularExpressionMatch &other) Q_DECL_NOTHROW { d.swap(other.d); }
+ void swap(QRegularExpressionMatch &other) noexcept { d.swap(other.d); }
QRegularExpression regularExpression() const;
QRegularExpression::MatchType matchType() const;
@@ -258,10 +258,10 @@ public:
QRegularExpressionMatchIterator(const QRegularExpressionMatchIterator &iterator);
QRegularExpressionMatchIterator &operator=(const QRegularExpressionMatchIterator &iterator);
#ifdef Q_COMPILER_RVALUE_REFS
- QRegularExpressionMatchIterator &operator=(QRegularExpressionMatchIterator &&iterator) Q_DECL_NOTHROW
+ QRegularExpressionMatchIterator &operator=(QRegularExpressionMatchIterator &&iterator) noexcept
{ d.swap(iterator.d); return *this; }
#endif
- void swap(QRegularExpressionMatchIterator &other) Q_DECL_NOTHROW { d.swap(other.d); }
+ void swap(QRegularExpressionMatchIterator &other) noexcept { d.swap(other.d); }
bool isValid() const;
diff --git a/src/corelib/tools/qringbuffer_p.h b/src/corelib/tools/qringbuffer_p.h
index 76ab4a5b62..838cb31697 100644
--- a/src/corelib/tools/qringbuffer_p.h
+++ b/src/corelib/tools/qringbuffer_p.h
@@ -65,11 +65,11 @@ class QRingChunk
{
public:
// initialization and cleanup
- inline QRingChunk() Q_DECL_NOTHROW :
+ inline QRingChunk() noexcept :
headOffset(0), tailOffset(0)
{
}
- inline QRingChunk(const QRingChunk &other) Q_DECL_NOTHROW :
+ inline QRingChunk(const QRingChunk &other) noexcept :
chunk(other.chunk), headOffset(other.headOffset), tailOffset(other.tailOffset)
{
}
@@ -77,30 +77,30 @@ public:
chunk(alloc, Qt::Uninitialized), headOffset(0), tailOffset(0)
{
}
- explicit inline QRingChunk(const QByteArray &qba) Q_DECL_NOTHROW :
+ explicit inline QRingChunk(const QByteArray &qba) noexcept :
chunk(qba), headOffset(0), tailOffset(qba.size())
{
}
- inline QRingChunk &operator=(const QRingChunk &other) Q_DECL_NOTHROW
+ inline QRingChunk &operator=(const QRingChunk &other) noexcept
{
chunk = other.chunk;
headOffset = other.headOffset;
tailOffset = other.tailOffset;
return *this;
}
- inline QRingChunk(QRingChunk &&other) Q_DECL_NOTHROW :
+ inline QRingChunk(QRingChunk &&other) noexcept :
chunk(other.chunk), headOffset(other.headOffset), tailOffset(other.tailOffset)
{
other.headOffset = other.tailOffset = 0;
}
- inline QRingChunk &operator=(QRingChunk &&other) Q_DECL_NOTHROW
+ inline QRingChunk &operator=(QRingChunk &&other) noexcept
{
swap(other);
return *this;
}
- inline void swap(QRingChunk &other) Q_DECL_NOTHROW
+ inline void swap(QRingChunk &other) noexcept
{
chunk.swap(other.chunk);
qSwap(headOffset, other.headOffset);
diff --git a/src/corelib/tools/qscopedpointer.h b/src/corelib/tools/qscopedpointer.h
index a91043faba..af0c0ed336 100644
--- a/src/corelib/tools/qscopedpointer.h
+++ b/src/corelib/tools/qscopedpointer.h
@@ -97,7 +97,7 @@ class QScopedPointer
{
typedef T *QScopedPointer:: *RestrictedBool;
public:
- explicit QScopedPointer(T *p = nullptr) Q_DECL_NOTHROW : d(p)
+ explicit QScopedPointer(T *p = nullptr) noexcept : d(p)
{
}
@@ -113,12 +113,12 @@ public:
return *d;
}
- T *operator->() const Q_DECL_NOTHROW
+ T *operator->() const noexcept
{
return d;
}
- bool operator!() const Q_DECL_NOTHROW
+ bool operator!() const noexcept
{
return !d;
}
@@ -129,23 +129,23 @@ public:
return isNull() ? nullptr : &QScopedPointer::d;
}
#else
- operator RestrictedBool() const Q_DECL_NOTHROW
+ operator RestrictedBool() const noexcept
{
return isNull() ? nullptr : &QScopedPointer::d;
}
#endif
- T *data() const Q_DECL_NOTHROW
+ T *data() const noexcept
{
return d;
}
- T *get() const Q_DECL_NOTHROW
+ T *get() const noexcept
{
return d;
}
- bool isNull() const Q_DECL_NOTHROW
+ bool isNull() const noexcept
{
return !d;
}
@@ -159,14 +159,14 @@ public:
Cleanup::cleanup(oldD);
}
- T *take() Q_DECL_NOTHROW
+ T *take() noexcept
{
T *oldD = d;
d = nullptr;
return oldD;
}
- void swap(QScopedPointer<T, Cleanup> &other) Q_DECL_NOTHROW
+ void swap(QScopedPointer<T, Cleanup> &other) noexcept
{
qSwap(d, other.d);
}
@@ -181,43 +181,43 @@ private:
};
template <class T, class Cleanup>
-inline bool operator==(const QScopedPointer<T, Cleanup> &lhs, const QScopedPointer<T, Cleanup> &rhs) Q_DECL_NOTHROW
+inline bool operator==(const QScopedPointer<T, Cleanup> &lhs, const QScopedPointer<T, Cleanup> &rhs) noexcept
{
return lhs.data() == rhs.data();
}
template <class T, class Cleanup>
-inline bool operator!=(const QScopedPointer<T, Cleanup> &lhs, const QScopedPointer<T, Cleanup> &rhs) Q_DECL_NOTHROW
+inline bool operator!=(const QScopedPointer<T, Cleanup> &lhs, const QScopedPointer<T, Cleanup> &rhs) noexcept
{
return lhs.data() != rhs.data();
}
template <class T, class Cleanup>
-inline bool operator==(const QScopedPointer<T, Cleanup> &lhs, std::nullptr_t) Q_DECL_NOTHROW
+inline bool operator==(const QScopedPointer<T, Cleanup> &lhs, std::nullptr_t) noexcept
{
return lhs.isNull();
}
template <class T, class Cleanup>
-inline bool operator==(std::nullptr_t, const QScopedPointer<T, Cleanup> &rhs) Q_DECL_NOTHROW
+inline bool operator==(std::nullptr_t, const QScopedPointer<T, Cleanup> &rhs) noexcept
{
return rhs.isNull();
}
template <class T, class Cleanup>
-inline bool operator!=(const QScopedPointer<T, Cleanup> &lhs, std::nullptr_t) Q_DECL_NOTHROW
+inline bool operator!=(const QScopedPointer<T, Cleanup> &lhs, std::nullptr_t) noexcept
{
return !lhs.isNull();
}
template <class T, class Cleanup>
-inline bool operator!=(std::nullptr_t, const QScopedPointer<T, Cleanup> &rhs) Q_DECL_NOTHROW
+inline bool operator!=(std::nullptr_t, const QScopedPointer<T, Cleanup> &rhs) noexcept
{
return !rhs.isNull();
}
template <class T, class Cleanup>
-inline void swap(QScopedPointer<T, Cleanup> &p1, QScopedPointer<T, Cleanup> &p2) Q_DECL_NOTHROW
+inline void swap(QScopedPointer<T, Cleanup> &p1, QScopedPointer<T, Cleanup> &p2) noexcept
{ p1.swap(p2); }
template <typename T, typename Cleanup = QScopedPointerArrayDeleter<T> >
@@ -244,7 +244,7 @@ public:
return this->d[i];
}
- void swap(QScopedArrayPointer &other) Q_DECL_NOTHROW // prevent QScopedPointer <->QScopedArrayPointer swaps
+ void swap(QScopedArrayPointer &other) noexcept // prevent QScopedPointer <->QScopedArrayPointer swaps
{ QScopedPointer<T, Cleanup>::swap(other); }
private:
@@ -263,7 +263,7 @@ private:
};
template <typename T, typename Cleanup>
-inline void swap(QScopedArrayPointer<T, Cleanup> &lhs, QScopedArrayPointer<T, Cleanup> &rhs) Q_DECL_NOTHROW
+inline void swap(QScopedArrayPointer<T, Cleanup> &lhs, QScopedArrayPointer<T, Cleanup> &rhs) noexcept
{ lhs.swap(rhs); }
QT_END_NAMESPACE
diff --git a/src/corelib/tools/qscopedvaluerollback.h b/src/corelib/tools/qscopedvaluerollback.h
index 5f76269388..f904b8dfcb 100644
--- a/src/corelib/tools/qscopedvaluerollback.h
+++ b/src/corelib/tools/qscopedvaluerollback.h
@@ -48,20 +48,20 @@ template <typename T>
class QScopedValueRollback
{
public:
- explicit QScopedValueRollback(T &var) :
- varRef(var), oldValue(var)
+ explicit QScopedValueRollback(T &var)
+ : varRef(var), oldValue(var)
{
}
- explicit QScopedValueRollback(T &var, T value) :
- varRef(var), oldValue(var)
+ explicit QScopedValueRollback(T &var, T value)
+ : varRef(var), oldValue(std::move(var))
{
- varRef = qMove(value);
+ varRef = std::move(value);
}
~QScopedValueRollback()
{
- varRef = qMove(oldValue);
+ varRef = std::move(oldValue);
}
void commit()
@@ -70,7 +70,7 @@ public:
}
private:
- T& varRef;
+ T &varRef;
T oldValue;
Q_DISABLE_COPY(QScopedValueRollback)
diff --git a/src/corelib/tools/qscopeguard.h b/src/corelib/tools/qscopeguard.h
index 31100fcabb..41d0a6af68 100644
--- a/src/corelib/tools/qscopeguard.h
+++ b/src/corelib/tools/qscopeguard.h
@@ -50,10 +50,15 @@ template <typename F> class QScopeGuard;
template <typename F> QScopeGuard<F> qScopeGuard(F f);
template <typename F>
-class QScopeGuard
+class
+#ifndef __INTEL_COMPILER
+// error #2621: attribute "__warn_unused_result__" does not apply here
+Q_REQUIRED_RESULT
+#endif
+QScopeGuard
{
public:
- QScopeGuard(QScopeGuard &&other) Q_DECL_NOEXCEPT
+ QScopeGuard(QScopeGuard &&other) noexcept
: m_func(std::move(other.m_func))
, m_invoke(other.m_invoke)
{
@@ -66,13 +71,13 @@ public:
m_func();
}
- void dismiss() Q_DECL_NOEXCEPT
+ void dismiss() noexcept
{
m_invoke = false;
}
private:
- explicit QScopeGuard(F f) Q_DECL_NOEXCEPT
+ explicit QScopeGuard(F f) noexcept
: m_func(std::move(f))
{
}
@@ -86,6 +91,10 @@ private:
template <typename F>
+#ifndef __INTEL_COMPILER
+// Causes "error #3058: GNU attributes on a template redeclaration have no effect"
+Q_REQUIRED_RESULT
+#endif
QScopeGuard<F> qScopeGuard(F f)
{
return QScopeGuard<F>(std::move(f));
diff --git a/src/corelib/tools/qset.h b/src/corelib/tools/qset.h
index 323942e1bf..aa915f7ed1 100644
--- a/src/corelib/tools/qset.h
+++ b/src/corelib/tools/qset.h
@@ -56,7 +56,7 @@ class QSet
typedef QHash<T, QHashDummyValue> Hash;
public:
- inline QSet() Q_DECL_NOTHROW {}
+ inline QSet() noexcept {}
#ifdef Q_COMPILER_INITIALIZER_LISTS
inline QSet(std::initializer_list<T> list)
{
@@ -68,7 +68,7 @@ public:
// compiler-generated copy/move ctor/assignment operators are fine!
// compiler-generated destructor is fine!
- inline void swap(QSet<T> &other) Q_DECL_NOTHROW { q_hash.swap(other.q_hash); }
+ inline void swap(QSet<T> &other) noexcept { q_hash.swap(other.q_hash); }
inline bool operator==(const QSet<T> &other) const
{ return q_hash == other.q_hash; }
@@ -176,20 +176,20 @@ public:
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
inline iterator begin() { return q_hash.begin(); }
- inline const_iterator begin() const Q_DECL_NOTHROW { return q_hash.begin(); }
- inline const_iterator cbegin() const Q_DECL_NOTHROW { return q_hash.begin(); }
- inline const_iterator constBegin() const Q_DECL_NOTHROW { return q_hash.constBegin(); }
+ inline const_iterator begin() const noexcept { return q_hash.begin(); }
+ inline const_iterator cbegin() const noexcept { return q_hash.begin(); }
+ inline const_iterator constBegin() const noexcept { return q_hash.constBegin(); }
inline iterator end() { return q_hash.end(); }
- inline const_iterator end() const Q_DECL_NOTHROW { return q_hash.end(); }
- inline const_iterator cend() const Q_DECL_NOTHROW { return q_hash.end(); }
- inline const_iterator constEnd() const Q_DECL_NOTHROW { return q_hash.constEnd(); }
+ inline const_iterator end() const noexcept { return q_hash.end(); }
+ inline const_iterator cend() const noexcept { return q_hash.end(); }
+ inline const_iterator constEnd() const noexcept { return q_hash.constEnd(); }
reverse_iterator rbegin() { return reverse_iterator(end()); }
reverse_iterator rend() { return reverse_iterator(begin()); }
- const_reverse_iterator rbegin() const Q_DECL_NOTHROW { return const_reverse_iterator(end()); }
- const_reverse_iterator rend() const Q_DECL_NOTHROW { return const_reverse_iterator(begin()); }
- const_reverse_iterator crbegin() const Q_DECL_NOTHROW { return const_reverse_iterator(end()); }
- const_reverse_iterator crend() const Q_DECL_NOTHROW { return const_reverse_iterator(begin()); }
+ const_reverse_iterator rbegin() const noexcept { return const_reverse_iterator(end()); }
+ const_reverse_iterator rend() const noexcept { return const_reverse_iterator(begin()); }
+ const_reverse_iterator crbegin() const noexcept { return const_reverse_iterator(end()); }
+ const_reverse_iterator crend() const noexcept { return const_reverse_iterator(begin()); }
iterator erase(iterator i)
{ return erase(m2c(i)); }
@@ -252,14 +252,14 @@ public:
private:
Hash q_hash;
- static const_iterator m2c(iterator it) Q_DECL_NOTHROW
+ static const_iterator m2c(iterator it) noexcept
{ return const_iterator(typename Hash::const_iterator(it.i.i)); }
bool isValidIterator(const iterator &i) const
{
return q_hash.isValidIterator(reinterpret_cast<const typename Hash::iterator&>(i));
}
- bool isValidIterator(const const_iterator &i) const Q_DECL_NOTHROW
+ bool isValidIterator(const const_iterator &i) const noexcept
{
return q_hash.isValidIterator(reinterpret_cast<const typename Hash::const_iterator&>(i));
}
diff --git a/src/corelib/tools/qshareddata.h b/src/corelib/tools/qshareddata.h
index 6930cb96a5..cbaa1aa3c4 100644
--- a/src/corelib/tools/qshareddata.h
+++ b/src/corelib/tools/qshareddata.h
@@ -88,7 +88,7 @@ public:
inline QSharedDataPointer() { d = nullptr; }
inline ~QSharedDataPointer() { if (d && !d->ref.deref()) delete d; }
- explicit QSharedDataPointer(T *data) Q_DECL_NOTHROW;
+ explicit QSharedDataPointer(T *data) noexcept;
inline QSharedDataPointer(const QSharedDataPointer<T> &o) : d(o.d) { if (d) d->ref.ref(); }
inline QSharedDataPointer<T> & operator=(const QSharedDataPointer<T> &o) {
if (o.d != d) {
@@ -113,8 +113,8 @@ public:
return *this;
}
#ifdef Q_COMPILER_RVALUE_REFS
- QSharedDataPointer(QSharedDataPointer &&o) Q_DECL_NOTHROW : d(o.d) { o.d = nullptr; }
- inline QSharedDataPointer<T> &operator=(QSharedDataPointer<T> &&other) Q_DECL_NOTHROW
+ QSharedDataPointer(QSharedDataPointer &&o) noexcept : d(o.d) { o.d = nullptr; }
+ inline QSharedDataPointer<T> &operator=(QSharedDataPointer<T> &&other) noexcept
{
QSharedDataPointer moved(std::move(other));
swap(moved);
@@ -124,7 +124,7 @@ public:
inline bool operator!() const { return !d; }
- inline void swap(QSharedDataPointer &other) Q_DECL_NOTHROW
+ inline void swap(QSharedDataPointer &other) noexcept
{ qSwap(d, other.d); }
protected:
@@ -181,7 +181,7 @@ public:
inline QExplicitlySharedDataPointer() { d = nullptr; }
inline ~QExplicitlySharedDataPointer() { if (d && !d->ref.deref()) delete d; }
- explicit QExplicitlySharedDataPointer(T *data) Q_DECL_NOTHROW;
+ explicit QExplicitlySharedDataPointer(T *data) noexcept;
inline QExplicitlySharedDataPointer(const QExplicitlySharedDataPointer<T> &o) : d(o.d) { if (d) d->ref.ref(); }
template<class X>
@@ -219,8 +219,8 @@ public:
return *this;
}
#ifdef Q_COMPILER_RVALUE_REFS
- inline QExplicitlySharedDataPointer(QExplicitlySharedDataPointer &&o) Q_DECL_NOTHROW : d(o.d) { o.d = nullptr; }
- inline QExplicitlySharedDataPointer<T> &operator=(QExplicitlySharedDataPointer<T> &&other) Q_DECL_NOTHROW
+ inline QExplicitlySharedDataPointer(QExplicitlySharedDataPointer &&o) noexcept : d(o.d) { o.d = nullptr; }
+ inline QExplicitlySharedDataPointer<T> &operator=(QExplicitlySharedDataPointer<T> &&other) noexcept
{
QExplicitlySharedDataPointer moved(std::move(other));
swap(moved);
@@ -230,7 +230,7 @@ public:
inline bool operator!() const { return !d; }
- inline void swap(QExplicitlySharedDataPointer &other) Q_DECL_NOTHROW
+ inline void swap(QExplicitlySharedDataPointer &other) noexcept
{ qSwap(d, other.d); }
protected:
@@ -243,7 +243,7 @@ private:
};
template <class T>
-Q_INLINE_TEMPLATE QSharedDataPointer<T>::QSharedDataPointer(T *adata) Q_DECL_NOTHROW
+Q_INLINE_TEMPLATE QSharedDataPointer<T>::QSharedDataPointer(T *adata) noexcept
: d(adata)
{ if (d) d->ref.ref(); }
@@ -280,7 +280,7 @@ Q_OUTOFLINE_TEMPLATE void QExplicitlySharedDataPointer<T>::detach_helper()
}
template <class T>
-Q_INLINE_TEMPLATE QExplicitlySharedDataPointer<T>::QExplicitlySharedDataPointer(T *adata) Q_DECL_NOTHROW
+Q_INLINE_TEMPLATE QExplicitlySharedDataPointer<T>::QExplicitlySharedDataPointer(T *adata) noexcept
: d(adata)
{ if (d) d->ref.ref(); }
@@ -317,12 +317,12 @@ namespace std {
QT_BEGIN_NAMESPACE
template <class T>
-Q_INLINE_TEMPLATE uint qHash(const QSharedDataPointer<T> &ptr, uint seed = 0) Q_DECL_NOTHROW
+Q_INLINE_TEMPLATE uint qHash(const QSharedDataPointer<T> &ptr, uint seed = 0) noexcept
{
return qHash(ptr.data(), seed);
}
template <class T>
-Q_INLINE_TEMPLATE uint qHash(const QExplicitlySharedDataPointer<T> &ptr, uint seed = 0) Q_DECL_NOTHROW
+Q_INLINE_TEMPLATE uint qHash(const QExplicitlySharedDataPointer<T> &ptr, uint seed = 0) noexcept
{
return qHash(ptr.data(), seed);
}
diff --git a/src/corelib/tools/qsharedpointer.cpp b/src/corelib/tools/qsharedpointer.cpp
index 8bc0dc8a74..62b76c5bb7 100644
--- a/src/corelib/tools/qsharedpointer.cpp
+++ b/src/corelib/tools/qsharedpointer.cpp
@@ -875,7 +875,7 @@
\b without ensuring that it cannot get deleted. To have that guarantee,
use toStrongRef(), which returns a QSharedPointer object. If this
function can determine that the pointer has already been deleted, it
- returns 0.
+ returns \nullptr.
It is ok to obtain the value of the pointer and using that value itself,
like for example in debugging statements:
diff --git a/src/corelib/tools/qsharedpointer_impl.h b/src/corelib/tools/qsharedpointer_impl.h
index bccf8c5740..81d8dcd839 100644
--- a/src/corelib/tools/qsharedpointer_impl.h
+++ b/src/corelib/tools/qsharedpointer_impl.h
@@ -303,18 +303,18 @@ public:
typedef const value_type &const_reference;
typedef qptrdiff difference_type;
- T *data() const Q_DECL_NOTHROW { return value; }
- T *get() const Q_DECL_NOTHROW { return value; }
- bool isNull() const Q_DECL_NOTHROW { return !data(); }
- operator RestrictedBool() const Q_DECL_NOTHROW { return isNull() ? nullptr : &QSharedPointer::value; }
- bool operator !() const Q_DECL_NOTHROW { return isNull(); }
+ T *data() const noexcept { return value; }
+ T *get() const noexcept { return value; }
+ bool isNull() const noexcept { return !data(); }
+ operator RestrictedBool() const noexcept { return isNull() ? nullptr : &QSharedPointer::value; }
+ bool operator !() const noexcept { return isNull(); }
T &operator*() const { return *data(); }
- T *operator->() const Q_DECL_NOTHROW { return data(); }
+ T *operator->() const noexcept { return data(); }
- Q_DECL_CONSTEXPR QSharedPointer() Q_DECL_NOTHROW : value(nullptr), d(nullptr) { }
+ Q_DECL_CONSTEXPR QSharedPointer() noexcept : value(nullptr), d(nullptr) { }
~QSharedPointer() { deref(); }
- Q_DECL_CONSTEXPR QSharedPointer(std::nullptr_t) Q_DECL_NOTHROW : value(nullptr), d(nullptr) { }
+ Q_DECL_CONSTEXPR QSharedPointer(std::nullptr_t) noexcept : value(nullptr), d(nullptr) { }
template <class X>
inline explicit QSharedPointer(X *ptr) : value(ptr) // noexcept
@@ -327,22 +327,22 @@ public:
template <typename Deleter>
QSharedPointer(std::nullptr_t, Deleter) : value(nullptr), d(nullptr) { }
- QSharedPointer(const QSharedPointer &other) Q_DECL_NOTHROW : value(other.value), d(other.d)
+ QSharedPointer(const QSharedPointer &other) noexcept : value(other.value), d(other.d)
{ if (d) ref(); }
- QSharedPointer &operator=(const QSharedPointer &other) Q_DECL_NOTHROW
+ QSharedPointer &operator=(const QSharedPointer &other) noexcept
{
QSharedPointer copy(other);
swap(copy);
return *this;
}
#ifdef Q_COMPILER_RVALUE_REFS
- QSharedPointer(QSharedPointer &&other) Q_DECL_NOTHROW
+ QSharedPointer(QSharedPointer &&other) noexcept
: value(other.value), d(other.d)
{
other.d = nullptr;
other.value = nullptr;
}
- QSharedPointer &operator=(QSharedPointer &&other) Q_DECL_NOTHROW
+ QSharedPointer &operator=(QSharedPointer &&other) noexcept
{
QSharedPointer moved(std::move(other));
swap(moved);
@@ -350,7 +350,7 @@ public:
}
template <class X>
- QSharedPointer(QSharedPointer<X> &&other) Q_DECL_NOTHROW
+ QSharedPointer(QSharedPointer<X> &&other) noexcept
: value(other.value), d(other.d)
{
other.d = nullptr;
@@ -358,7 +358,7 @@ public:
}
template <class X>
- QSharedPointer &operator=(QSharedPointer<X> &&other) Q_DECL_NOTHROW
+ QSharedPointer &operator=(QSharedPointer<X> &&other) noexcept
{
QSharedPointer moved(std::move(other));
swap(moved);
@@ -368,7 +368,7 @@ public:
#endif
template <class X>
- QSharedPointer(const QSharedPointer<X> &other) Q_DECL_NOTHROW : value(other.value), d(other.d)
+ QSharedPointer(const QSharedPointer<X> &other) noexcept : value(other.value), d(other.d)
{ if (d) ref(); }
template <class X>
@@ -456,9 +456,9 @@ public:
private:
explicit QSharedPointer(Qt::Initialization) {}
- void deref() Q_DECL_NOTHROW
+ void deref() noexcept
{ deref(d); }
- static void deref(Data *dd) Q_DECL_NOTHROW
+ static void deref(Data *dd) noexcept
{
if (!dd) return;
if (!dd->strongref.deref()) {
@@ -499,7 +499,7 @@ private:
enableSharedFromThis(ptr);
}
- void internalSwap(QSharedPointer &other) Q_DECL_NOTHROW
+ void internalSwap(QSharedPointer &other) noexcept
{
qSwap(d, other.d);
qSwap(this->value, other.value);
@@ -512,7 +512,7 @@ public:
template <class X> friend class QWeakPointer;
template <class X, class Y> friend QSharedPointer<X> QtSharedPointer::copyAndSetPointer(X * ptr, const QSharedPointer<Y> &src);
#endif
- void ref() const Q_DECL_NOTHROW { d->weakref.ref(); d->strongref.ref(); }
+ void ref() const noexcept { d->weakref.ref(); d->strongref.ref(); }
inline void internalSet(Data *o, T *actual)
{
@@ -563,12 +563,12 @@ public:
typedef const value_type &const_reference;
typedef qptrdiff difference_type;
- bool isNull() const Q_DECL_NOTHROW { return d == nullptr || d->strongref.load() == 0 || value == nullptr; }
- operator RestrictedBool() const Q_DECL_NOTHROW { return isNull() ? nullptr : &QWeakPointer::value; }
- bool operator !() const Q_DECL_NOTHROW { return isNull(); }
- T *data() const Q_DECL_NOTHROW { return d == nullptr || d->strongref.load() == 0 ? nullptr : value; }
+ bool isNull() const noexcept { return d == nullptr || d->strongref.load() == 0 || value == nullptr; }
+ operator RestrictedBool() const noexcept { return isNull() ? nullptr : &QWeakPointer::value; }
+ bool operator !() const noexcept { return isNull(); }
+ T *data() const noexcept { return d == nullptr || d->strongref.load() == 0 ? nullptr : value; }
- inline QWeakPointer() Q_DECL_NOTHROW : d(nullptr), value(nullptr) { }
+ inline QWeakPointer() noexcept : d(nullptr), value(nullptr) { }
inline ~QWeakPointer() { if (d && !d->weakref.deref()) delete d; }
#ifndef QT_NO_QOBJECT
@@ -586,26 +586,26 @@ public:
{ return *this = QWeakPointer(ptr); }
#endif
- QWeakPointer(const QWeakPointer &other) Q_DECL_NOTHROW : d(other.d), value(other.value)
+ QWeakPointer(const QWeakPointer &other) noexcept : d(other.d), value(other.value)
{ if (d) d->weakref.ref(); }
#ifdef Q_COMPILER_RVALUE_REFS
- QWeakPointer(QWeakPointer &&other) Q_DECL_NOTHROW
+ QWeakPointer(QWeakPointer &&other) noexcept
: d(other.d), value(other.value)
{
other.d = nullptr;
other.value = nullptr;
}
- QWeakPointer &operator=(QWeakPointer &&other) Q_DECL_NOTHROW
+ QWeakPointer &operator=(QWeakPointer &&other) noexcept
{ QWeakPointer moved(std::move(other)); swap(moved); return *this; }
#endif
- QWeakPointer &operator=(const QWeakPointer &other) Q_DECL_NOTHROW
+ QWeakPointer &operator=(const QWeakPointer &other) noexcept
{
QWeakPointer copy(other);
swap(copy);
return *this;
}
- void swap(QWeakPointer &other) Q_DECL_NOTHROW
+ void swap(QWeakPointer &other) noexcept
{
qSwap(this->d, other.d);
qSwap(this->value, other.value);
@@ -633,11 +633,11 @@ public:
}
template <class X>
- bool operator==(const QWeakPointer<X> &o) const Q_DECL_NOTHROW
+ bool operator==(const QWeakPointer<X> &o) const noexcept
{ return d == o.d && value == static_cast<const T *>(o.value); }
template <class X>
- bool operator!=(const QWeakPointer<X> &o) const Q_DECL_NOTHROW
+ bool operator!=(const QWeakPointer<X> &o) const noexcept
{ return !(*this == o); }
template <class X>
@@ -653,11 +653,11 @@ public:
}
template <class X>
- bool operator==(const QSharedPointer<X> &o) const Q_DECL_NOTHROW
+ bool operator==(const QSharedPointer<X> &o) const noexcept
{ return d == o.d; }
template <class X>
- bool operator!=(const QSharedPointer<X> &o) const Q_DECL_NOTHROW
+ bool operator!=(const QSharedPointer<X> &o) const noexcept
{ return !(*this == o); }
inline void clear() { *this = QWeakPointer(); }
@@ -739,92 +739,92 @@ public:
// operator== and operator!=
//
template <class T, class X>
-bool operator==(const QSharedPointer<T> &ptr1, const QSharedPointer<X> &ptr2) Q_DECL_NOTHROW
+bool operator==(const QSharedPointer<T> &ptr1, const QSharedPointer<X> &ptr2) noexcept
{
return ptr1.data() == ptr2.data();
}
template <class T, class X>
-bool operator!=(const QSharedPointer<T> &ptr1, const QSharedPointer<X> &ptr2) Q_DECL_NOTHROW
+bool operator!=(const QSharedPointer<T> &ptr1, const QSharedPointer<X> &ptr2) noexcept
{
return ptr1.data() != ptr2.data();
}
template <class T, class X>
-bool operator==(const QSharedPointer<T> &ptr1, const X *ptr2) Q_DECL_NOTHROW
+bool operator==(const QSharedPointer<T> &ptr1, const X *ptr2) noexcept
{
return ptr1.data() == ptr2;
}
template <class T, class X>
-bool operator==(const T *ptr1, const QSharedPointer<X> &ptr2) Q_DECL_NOTHROW
+bool operator==(const T *ptr1, const QSharedPointer<X> &ptr2) noexcept
{
return ptr1 == ptr2.data();
}
template <class T, class X>
-bool operator!=(const QSharedPointer<T> &ptr1, const X *ptr2) Q_DECL_NOTHROW
+bool operator!=(const QSharedPointer<T> &ptr1, const X *ptr2) noexcept
{
return !(ptr1 == ptr2);
}
template <class T, class X>
-bool operator!=(const T *ptr1, const QSharedPointer<X> &ptr2) Q_DECL_NOTHROW
+bool operator!=(const T *ptr1, const QSharedPointer<X> &ptr2) noexcept
{
return !(ptr2 == ptr1);
}
template <class T, class X>
-bool operator==(const QSharedPointer<T> &ptr1, const QWeakPointer<X> &ptr2) Q_DECL_NOTHROW
+bool operator==(const QSharedPointer<T> &ptr1, const QWeakPointer<X> &ptr2) noexcept
{
return ptr2 == ptr1;
}
template <class T, class X>
-bool operator!=(const QSharedPointer<T> &ptr1, const QWeakPointer<X> &ptr2) Q_DECL_NOTHROW
+bool operator!=(const QSharedPointer<T> &ptr1, const QWeakPointer<X> &ptr2) noexcept
{
return ptr2 != ptr1;
}
template<class T>
-inline bool operator==(const QSharedPointer<T> &lhs, std::nullptr_t) Q_DECL_NOTHROW
+inline bool operator==(const QSharedPointer<T> &lhs, std::nullptr_t) noexcept
{
return lhs.isNull();
}
template<class T>
-inline bool operator!=(const QSharedPointer<T> &lhs, std::nullptr_t) Q_DECL_NOTHROW
+inline bool operator!=(const QSharedPointer<T> &lhs, std::nullptr_t) noexcept
{
return !lhs.isNull();
}
template<class T>
-inline bool operator==(std::nullptr_t, const QSharedPointer<T> &rhs) Q_DECL_NOTHROW
+inline bool operator==(std::nullptr_t, const QSharedPointer<T> &rhs) noexcept
{
return rhs.isNull();
}
template<class T>
-inline bool operator!=(std::nullptr_t, const QSharedPointer<T> &rhs) Q_DECL_NOTHROW
+inline bool operator!=(std::nullptr_t, const QSharedPointer<T> &rhs) noexcept
{
return !rhs.isNull();
}
template<class T>
-inline bool operator==(const QWeakPointer<T> &lhs, std::nullptr_t) Q_DECL_NOTHROW
+inline bool operator==(const QWeakPointer<T> &lhs, std::nullptr_t) noexcept
{
return lhs.isNull();
}
template<class T>
-inline bool operator!=(const QWeakPointer<T> &lhs, std::nullptr_t) Q_DECL_NOTHROW
+inline bool operator!=(const QWeakPointer<T> &lhs, std::nullptr_t) noexcept
{
return !lhs.isNull();
}
template<class T>
-inline bool operator==(std::nullptr_t, const QWeakPointer<T> &rhs) Q_DECL_NOTHROW
+inline bool operator==(std::nullptr_t, const QWeakPointer<T> &rhs) noexcept
{
return rhs.isNull();
}
template<class T>
-inline bool operator!=(std::nullptr_t, const QWeakPointer<T> &rhs) Q_DECL_NOTHROW
+inline bool operator!=(std::nullptr_t, const QWeakPointer<T> &rhs) noexcept
{
return !rhs.isNull();
}
diff --git a/src/corelib/tools/qsize.cpp b/src/corelib/tools/qsize.cpp
index 3e97947ad2..fe508ad459 100644
--- a/src/corelib/tools/qsize.cpp
+++ b/src/corelib/tools/qsize.cpp
@@ -163,7 +163,7 @@ QT_BEGIN_NAMESPACE
\sa setWidth(), setHeight(), transposed()
*/
-void QSize::transpose() Q_DECL_NOTHROW
+void QSize::transpose() noexcept
{
qSwap(wd, ht);
}
@@ -222,7 +222,7 @@ void QSize::transpose() Q_DECL_NOTHROW
Return a size scaled to a rectangle with the given size \a s,
according to the specified \a mode.
*/
-QSize QSize::scaled(const QSize &s, Qt::AspectRatioMode mode) const Q_DECL_NOTHROW
+QSize QSize::scaled(const QSize &s, Qt::AspectRatioMode mode) const noexcept
{
if (mode == Qt::IgnoreAspectRatio || wd == 0 || ht == 0) {
return s;
@@ -594,7 +594,7 @@ QDebug operator<<(QDebug dbg, const QSize &s)
\sa setWidth(), setHeight(), transposed()
*/
-void QSizeF::transpose() Q_DECL_NOTHROW
+void QSizeF::transpose() noexcept
{
qSwap(wd, ht);
}
@@ -653,7 +653,7 @@ void QSizeF::transpose() Q_DECL_NOTHROW
Returns a size scaled to a rectangle with the given size \a s,
according to the specified \a mode.
*/
-QSizeF QSizeF::scaled(const QSizeF &s, Qt::AspectRatioMode mode) const Q_DECL_NOTHROW
+QSizeF QSizeF::scaled(const QSizeF &s, Qt::AspectRatioMode mode) const noexcept
{
if (mode == Qt::IgnoreAspectRatio || qIsNull(wd) || qIsNull(ht)) {
return s;
diff --git a/src/corelib/tools/qsize.h b/src/corelib/tools/qsize.h
index bb29dca7c4..4114609856 100644
--- a/src/corelib/tools/qsize.h
+++ b/src/corelib/tools/qsize.h
@@ -52,46 +52,46 @@ QT_BEGIN_NAMESPACE
class Q_CORE_EXPORT QSize
{
public:
- Q_DECL_CONSTEXPR QSize() Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR QSize(int w, int h) Q_DECL_NOTHROW;
-
- Q_DECL_CONSTEXPR inline bool isNull() const Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR inline bool isEmpty() const Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR inline bool isValid() const Q_DECL_NOTHROW;
-
- Q_DECL_CONSTEXPR inline int width() const Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR inline int height() const Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void setWidth(int w) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void setHeight(int h) Q_DECL_NOTHROW;
- void transpose() Q_DECL_NOTHROW;
- Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QSize transposed() const Q_DECL_NOTHROW;
-
- inline void scale(int w, int h, Qt::AspectRatioMode mode) Q_DECL_NOTHROW;
- inline void scale(const QSize &s, Qt::AspectRatioMode mode) Q_DECL_NOTHROW;
- Q_REQUIRED_RESULT QSize scaled(int w, int h, Qt::AspectRatioMode mode) const Q_DECL_NOTHROW;
- Q_REQUIRED_RESULT QSize scaled(const QSize &s, Qt::AspectRatioMode mode) const Q_DECL_NOTHROW;
-
- Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QSize expandedTo(const QSize &) const Q_DECL_NOTHROW;
- Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QSize boundedTo(const QSize &) const Q_DECL_NOTHROW;
-
- Q_DECL_RELAXED_CONSTEXPR inline int &rwidth() Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline int &rheight() Q_DECL_NOTHROW;
-
- Q_DECL_RELAXED_CONSTEXPR inline QSize &operator+=(const QSize &) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline QSize &operator-=(const QSize &) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline QSize &operator*=(qreal c) Q_DECL_NOTHROW;
+ Q_DECL_CONSTEXPR QSize() noexcept;
+ Q_DECL_CONSTEXPR QSize(int w, int h) noexcept;
+
+ Q_DECL_CONSTEXPR inline bool isNull() const noexcept;
+ Q_DECL_CONSTEXPR inline bool isEmpty() const noexcept;
+ Q_DECL_CONSTEXPR inline bool isValid() const noexcept;
+
+ Q_DECL_CONSTEXPR inline int width() const noexcept;
+ Q_DECL_CONSTEXPR inline int height() const noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void setWidth(int w) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void setHeight(int h) noexcept;
+ void transpose() noexcept;
+ Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QSize transposed() const noexcept;
+
+ inline void scale(int w, int h, Qt::AspectRatioMode mode) noexcept;
+ inline void scale(const QSize &s, Qt::AspectRatioMode mode) noexcept;
+ Q_REQUIRED_RESULT QSize scaled(int w, int h, Qt::AspectRatioMode mode) const noexcept;
+ Q_REQUIRED_RESULT QSize scaled(const QSize &s, Qt::AspectRatioMode mode) const noexcept;
+
+ Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QSize expandedTo(const QSize &) const noexcept;
+ Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QSize boundedTo(const QSize &) const noexcept;
+
+ Q_DECL_RELAXED_CONSTEXPR inline int &rwidth() noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline int &rheight() noexcept;
+
+ Q_DECL_RELAXED_CONSTEXPR inline QSize &operator+=(const QSize &) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline QSize &operator-=(const QSize &) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline QSize &operator*=(qreal c) noexcept;
inline QSize &operator/=(qreal c);
- friend inline Q_DECL_CONSTEXPR bool operator==(const QSize &, const QSize &) Q_DECL_NOTHROW;
- friend inline Q_DECL_CONSTEXPR bool operator!=(const QSize &, const QSize &) Q_DECL_NOTHROW;
- friend inline Q_DECL_CONSTEXPR const QSize operator+(const QSize &, const QSize &) Q_DECL_NOTHROW;
- friend inline Q_DECL_CONSTEXPR const QSize operator-(const QSize &, const QSize &) Q_DECL_NOTHROW;
- friend inline Q_DECL_CONSTEXPR const QSize operator*(const QSize &, qreal) Q_DECL_NOTHROW;
- friend inline Q_DECL_CONSTEXPR const QSize operator*(qreal, const QSize &) Q_DECL_NOTHROW;
+ friend inline Q_DECL_CONSTEXPR bool operator==(const QSize &, const QSize &) noexcept;
+ friend inline Q_DECL_CONSTEXPR bool operator!=(const QSize &, const QSize &) noexcept;
+ friend inline Q_DECL_CONSTEXPR const QSize operator+(const QSize &, const QSize &) noexcept;
+ friend inline Q_DECL_CONSTEXPR const QSize operator-(const QSize &, const QSize &) noexcept;
+ friend inline Q_DECL_CONSTEXPR const QSize operator*(const QSize &, qreal) noexcept;
+ friend inline Q_DECL_CONSTEXPR const QSize operator*(qreal, const QSize &) noexcept;
friend inline const QSize operator/(const QSize &, qreal);
#if defined(Q_OS_DARWIN) || defined(Q_QDOC)
- Q_REQUIRED_RESULT CGSize toCGSize() const Q_DECL_NOTHROW;
+ Q_REQUIRED_RESULT CGSize toCGSize() const noexcept;
#endif
private:
@@ -114,74 +114,74 @@ Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QSize &);
QSize inline functions
*****************************************************************************/
-Q_DECL_CONSTEXPR inline QSize::QSize() Q_DECL_NOTHROW : wd(-1), ht(-1) {}
+Q_DECL_CONSTEXPR inline QSize::QSize() noexcept : wd(-1), ht(-1) {}
-Q_DECL_CONSTEXPR inline QSize::QSize(int w, int h) Q_DECL_NOTHROW : wd(w), ht(h) {}
+Q_DECL_CONSTEXPR inline QSize::QSize(int w, int h) noexcept : wd(w), ht(h) {}
-Q_DECL_CONSTEXPR inline bool QSize::isNull() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline bool QSize::isNull() const noexcept
{ return wd==0 && ht==0; }
-Q_DECL_CONSTEXPR inline bool QSize::isEmpty() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline bool QSize::isEmpty() const noexcept
{ return wd<1 || ht<1; }
-Q_DECL_CONSTEXPR inline bool QSize::isValid() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline bool QSize::isValid() const noexcept
{ return wd>=0 && ht>=0; }
-Q_DECL_CONSTEXPR inline int QSize::width() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline int QSize::width() const noexcept
{ return wd; }
-Q_DECL_CONSTEXPR inline int QSize::height() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline int QSize::height() const noexcept
{ return ht; }
-Q_DECL_RELAXED_CONSTEXPR inline void QSize::setWidth(int w) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QSize::setWidth(int w) noexcept
{ wd = w; }
-Q_DECL_RELAXED_CONSTEXPR inline void QSize::setHeight(int h) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QSize::setHeight(int h) noexcept
{ ht = h; }
-Q_DECL_CONSTEXPR inline QSize QSize::transposed() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QSize QSize::transposed() const noexcept
{ return QSize(ht, wd); }
-inline void QSize::scale(int w, int h, Qt::AspectRatioMode mode) Q_DECL_NOTHROW
+inline void QSize::scale(int w, int h, Qt::AspectRatioMode mode) noexcept
{ scale(QSize(w, h), mode); }
-inline void QSize::scale(const QSize &s, Qt::AspectRatioMode mode) Q_DECL_NOTHROW
+inline void QSize::scale(const QSize &s, Qt::AspectRatioMode mode) noexcept
{ *this = scaled(s, mode); }
-inline QSize QSize::scaled(int w, int h, Qt::AspectRatioMode mode) const Q_DECL_NOTHROW
+inline QSize QSize::scaled(int w, int h, Qt::AspectRatioMode mode) const noexcept
{ return scaled(QSize(w, h), mode); }
-Q_DECL_RELAXED_CONSTEXPR inline int &QSize::rwidth() Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline int &QSize::rwidth() noexcept
{ return wd; }
-Q_DECL_RELAXED_CONSTEXPR inline int &QSize::rheight() Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline int &QSize::rheight() noexcept
{ return ht; }
-Q_DECL_RELAXED_CONSTEXPR inline QSize &QSize::operator+=(const QSize &s) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline QSize &QSize::operator+=(const QSize &s) noexcept
{ wd+=s.wd; ht+=s.ht; return *this; }
-Q_DECL_RELAXED_CONSTEXPR inline QSize &QSize::operator-=(const QSize &s) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline QSize &QSize::operator-=(const QSize &s) noexcept
{ wd-=s.wd; ht-=s.ht; return *this; }
-Q_DECL_RELAXED_CONSTEXPR inline QSize &QSize::operator*=(qreal c) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline QSize &QSize::operator*=(qreal c) noexcept
{ wd = qRound(wd*c); ht = qRound(ht*c); return *this; }
-Q_DECL_CONSTEXPR inline bool operator==(const QSize &s1, const QSize &s2) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline bool operator==(const QSize &s1, const QSize &s2) noexcept
{ return s1.wd == s2.wd && s1.ht == s2.ht; }
-Q_DECL_CONSTEXPR inline bool operator!=(const QSize &s1, const QSize &s2) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline bool operator!=(const QSize &s1, const QSize &s2) noexcept
{ return s1.wd != s2.wd || s1.ht != s2.ht; }
-Q_DECL_CONSTEXPR inline const QSize operator+(const QSize & s1, const QSize & s2) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline const QSize operator+(const QSize & s1, const QSize & s2) noexcept
{ return QSize(s1.wd+s2.wd, s1.ht+s2.ht); }
-Q_DECL_CONSTEXPR inline const QSize operator-(const QSize &s1, const QSize &s2) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline const QSize operator-(const QSize &s1, const QSize &s2) noexcept
{ return QSize(s1.wd-s2.wd, s1.ht-s2.ht); }
-Q_DECL_CONSTEXPR inline const QSize operator*(const QSize &s, qreal c) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline const QSize operator*(const QSize &s, qreal c) noexcept
{ return QSize(qRound(s.wd*c), qRound(s.ht*c)); }
-Q_DECL_CONSTEXPR inline const QSize operator*(qreal c, const QSize &s) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline const QSize operator*(qreal c, const QSize &s) noexcept
{ return QSize(qRound(s.wd*c), qRound(s.ht*c)); }
inline QSize &QSize::operator/=(qreal c)
@@ -197,12 +197,12 @@ inline const QSize operator/(const QSize &s, qreal c)
return QSize(qRound(s.wd/c), qRound(s.ht/c));
}
-Q_DECL_CONSTEXPR inline QSize QSize::expandedTo(const QSize & otherSize) const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QSize QSize::expandedTo(const QSize & otherSize) const noexcept
{
return QSize(qMax(wd,otherSize.wd), qMax(ht,otherSize.ht));
}
-Q_DECL_CONSTEXPR inline QSize QSize::boundedTo(const QSize & otherSize) const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QSize QSize::boundedTo(const QSize & otherSize) const noexcept
{
return QSize(qMin(wd,otherSize.wd), qMin(ht,otherSize.ht));
}
@@ -215,50 +215,50 @@ Q_CORE_EXPORT QDebug operator<<(QDebug, const QSize &);
class Q_CORE_EXPORT QSizeF
{
public:
- Q_DECL_CONSTEXPR QSizeF() Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR QSizeF(const QSize &sz) Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR QSizeF(qreal w, qreal h) Q_DECL_NOTHROW;
-
- inline bool isNull() const Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR inline bool isEmpty() const Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR inline bool isValid() const Q_DECL_NOTHROW;
-
- Q_DECL_CONSTEXPR inline qreal width() const Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR inline qreal height() const Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void setWidth(qreal w) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void setHeight(qreal h) Q_DECL_NOTHROW;
- void transpose() Q_DECL_NOTHROW;
- Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QSizeF transposed() const Q_DECL_NOTHROW;
-
- inline void scale(qreal w, qreal h, Qt::AspectRatioMode mode) Q_DECL_NOTHROW;
- inline void scale(const QSizeF &s, Qt::AspectRatioMode mode) Q_DECL_NOTHROW;
- Q_REQUIRED_RESULT QSizeF scaled(qreal w, qreal h, Qt::AspectRatioMode mode) const Q_DECL_NOTHROW;
- Q_REQUIRED_RESULT QSizeF scaled(const QSizeF &s, Qt::AspectRatioMode mode) const Q_DECL_NOTHROW;
-
- Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QSizeF expandedTo(const QSizeF &) const Q_DECL_NOTHROW;
- Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QSizeF boundedTo(const QSizeF &) const Q_DECL_NOTHROW;
-
- Q_DECL_RELAXED_CONSTEXPR inline qreal &rwidth() Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline qreal &rheight() Q_DECL_NOTHROW;
-
- Q_DECL_RELAXED_CONSTEXPR inline QSizeF &operator+=(const QSizeF &) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline QSizeF &operator-=(const QSizeF &) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline QSizeF &operator*=(qreal c) Q_DECL_NOTHROW;
+ Q_DECL_CONSTEXPR QSizeF() noexcept;
+ Q_DECL_CONSTEXPR QSizeF(const QSize &sz) noexcept;
+ Q_DECL_CONSTEXPR QSizeF(qreal w, qreal h) noexcept;
+
+ inline bool isNull() const noexcept;
+ Q_DECL_CONSTEXPR inline bool isEmpty() const noexcept;
+ Q_DECL_CONSTEXPR inline bool isValid() const noexcept;
+
+ Q_DECL_CONSTEXPR inline qreal width() const noexcept;
+ Q_DECL_CONSTEXPR inline qreal height() const noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void setWidth(qreal w) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void setHeight(qreal h) noexcept;
+ void transpose() noexcept;
+ Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QSizeF transposed() const noexcept;
+
+ inline void scale(qreal w, qreal h, Qt::AspectRatioMode mode) noexcept;
+ inline void scale(const QSizeF &s, Qt::AspectRatioMode mode) noexcept;
+ Q_REQUIRED_RESULT QSizeF scaled(qreal w, qreal h, Qt::AspectRatioMode mode) const noexcept;
+ Q_REQUIRED_RESULT QSizeF scaled(const QSizeF &s, Qt::AspectRatioMode mode) const noexcept;
+
+ Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QSizeF expandedTo(const QSizeF &) const noexcept;
+ Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QSizeF boundedTo(const QSizeF &) const noexcept;
+
+ Q_DECL_RELAXED_CONSTEXPR inline qreal &rwidth() noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline qreal &rheight() noexcept;
+
+ Q_DECL_RELAXED_CONSTEXPR inline QSizeF &operator+=(const QSizeF &) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline QSizeF &operator-=(const QSizeF &) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline QSizeF &operator*=(qreal c) noexcept;
inline QSizeF &operator/=(qreal c);
- friend Q_DECL_CONSTEXPR inline bool operator==(const QSizeF &, const QSizeF &) Q_DECL_NOTHROW;
- friend Q_DECL_CONSTEXPR inline bool operator!=(const QSizeF &, const QSizeF &) Q_DECL_NOTHROW;
- friend Q_DECL_CONSTEXPR inline const QSizeF operator+(const QSizeF &, const QSizeF &) Q_DECL_NOTHROW;
- friend Q_DECL_CONSTEXPR inline const QSizeF operator-(const QSizeF &, const QSizeF &) Q_DECL_NOTHROW;
- friend Q_DECL_CONSTEXPR inline const QSizeF operator*(const QSizeF &, qreal) Q_DECL_NOTHROW;
- friend Q_DECL_CONSTEXPR inline const QSizeF operator*(qreal, const QSizeF &) Q_DECL_NOTHROW;
+ friend Q_DECL_CONSTEXPR inline bool operator==(const QSizeF &, const QSizeF &) noexcept;
+ friend Q_DECL_CONSTEXPR inline bool operator!=(const QSizeF &, const QSizeF &) noexcept;
+ friend Q_DECL_CONSTEXPR inline const QSizeF operator+(const QSizeF &, const QSizeF &) noexcept;
+ friend Q_DECL_CONSTEXPR inline const QSizeF operator-(const QSizeF &, const QSizeF &) noexcept;
+ friend Q_DECL_CONSTEXPR inline const QSizeF operator*(const QSizeF &, qreal) noexcept;
+ friend Q_DECL_CONSTEXPR inline const QSizeF operator*(qreal, const QSizeF &) noexcept;
friend inline const QSizeF operator/(const QSizeF &, qreal);
- Q_DECL_CONSTEXPR inline QSize toSize() const Q_DECL_NOTHROW;
+ Q_DECL_CONSTEXPR inline QSize toSize() const noexcept;
#if defined(Q_OS_DARWIN) || defined(Q_QDOC)
- Q_REQUIRED_RESULT static QSizeF fromCGSize(CGSize size) Q_DECL_NOTHROW;
- Q_REQUIRED_RESULT CGSize toCGSize() const Q_DECL_NOTHROW;
+ Q_REQUIRED_RESULT static QSizeF fromCGSize(CGSize size) noexcept;
+ Q_REQUIRED_RESULT CGSize toCGSize() const noexcept;
#endif
private:
@@ -282,76 +282,76 @@ Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QSizeF &);
QSizeF inline functions
*****************************************************************************/
-Q_DECL_CONSTEXPR inline QSizeF::QSizeF() Q_DECL_NOTHROW : wd(-1.), ht(-1.) {}
+Q_DECL_CONSTEXPR inline QSizeF::QSizeF() noexcept : wd(-1.), ht(-1.) {}
-Q_DECL_CONSTEXPR inline QSizeF::QSizeF(const QSize &sz) Q_DECL_NOTHROW : wd(sz.width()), ht(sz.height()) {}
+Q_DECL_CONSTEXPR inline QSizeF::QSizeF(const QSize &sz) noexcept : wd(sz.width()), ht(sz.height()) {}
-Q_DECL_CONSTEXPR inline QSizeF::QSizeF(qreal w, qreal h) Q_DECL_NOTHROW : wd(w), ht(h) {}
+Q_DECL_CONSTEXPR inline QSizeF::QSizeF(qreal w, qreal h) noexcept : wd(w), ht(h) {}
-inline bool QSizeF::isNull() const Q_DECL_NOTHROW
+inline bool QSizeF::isNull() const noexcept
{ return qIsNull(wd) && qIsNull(ht); }
-Q_DECL_CONSTEXPR inline bool QSizeF::isEmpty() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline bool QSizeF::isEmpty() const noexcept
{ return wd <= 0. || ht <= 0.; }
-Q_DECL_CONSTEXPR inline bool QSizeF::isValid() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline bool QSizeF::isValid() const noexcept
{ return wd >= 0. && ht >= 0.; }
-Q_DECL_CONSTEXPR inline qreal QSizeF::width() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline qreal QSizeF::width() const noexcept
{ return wd; }
-Q_DECL_CONSTEXPR inline qreal QSizeF::height() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline qreal QSizeF::height() const noexcept
{ return ht; }
-Q_DECL_RELAXED_CONSTEXPR inline void QSizeF::setWidth(qreal w) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QSizeF::setWidth(qreal w) noexcept
{ wd = w; }
-Q_DECL_RELAXED_CONSTEXPR inline void QSizeF::setHeight(qreal h) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QSizeF::setHeight(qreal h) noexcept
{ ht = h; }
-Q_DECL_CONSTEXPR inline QSizeF QSizeF::transposed() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QSizeF QSizeF::transposed() const noexcept
{ return QSizeF(ht, wd); }
-inline void QSizeF::scale(qreal w, qreal h, Qt::AspectRatioMode mode) Q_DECL_NOTHROW
+inline void QSizeF::scale(qreal w, qreal h, Qt::AspectRatioMode mode) noexcept
{ scale(QSizeF(w, h), mode); }
-inline void QSizeF::scale(const QSizeF &s, Qt::AspectRatioMode mode) Q_DECL_NOTHROW
+inline void QSizeF::scale(const QSizeF &s, Qt::AspectRatioMode mode) noexcept
{ *this = scaled(s, mode); }
-inline QSizeF QSizeF::scaled(qreal w, qreal h, Qt::AspectRatioMode mode) const Q_DECL_NOTHROW
+inline QSizeF QSizeF::scaled(qreal w, qreal h, Qt::AspectRatioMode mode) const noexcept
{ return scaled(QSizeF(w, h), mode); }
-Q_DECL_RELAXED_CONSTEXPR inline qreal &QSizeF::rwidth() Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline qreal &QSizeF::rwidth() noexcept
{ return wd; }
-Q_DECL_RELAXED_CONSTEXPR inline qreal &QSizeF::rheight() Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline qreal &QSizeF::rheight() noexcept
{ return ht; }
-Q_DECL_RELAXED_CONSTEXPR inline QSizeF &QSizeF::operator+=(const QSizeF &s) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline QSizeF &QSizeF::operator+=(const QSizeF &s) noexcept
{ wd += s.wd; ht += s.ht; return *this; }
-Q_DECL_RELAXED_CONSTEXPR inline QSizeF &QSizeF::operator-=(const QSizeF &s) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline QSizeF &QSizeF::operator-=(const QSizeF &s) noexcept
{ wd -= s.wd; ht -= s.ht; return *this; }
-Q_DECL_RELAXED_CONSTEXPR inline QSizeF &QSizeF::operator*=(qreal c) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline QSizeF &QSizeF::operator*=(qreal c) noexcept
{ wd *= c; ht *= c; return *this; }
-Q_DECL_CONSTEXPR inline bool operator==(const QSizeF &s1, const QSizeF &s2) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline bool operator==(const QSizeF &s1, const QSizeF &s2) noexcept
{ return qFuzzyCompare(s1.wd, s2.wd) && qFuzzyCompare(s1.ht, s2.ht); }
-Q_DECL_CONSTEXPR inline bool operator!=(const QSizeF &s1, const QSizeF &s2) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline bool operator!=(const QSizeF &s1, const QSizeF &s2) noexcept
{ return !qFuzzyCompare(s1.wd, s2.wd) || !qFuzzyCompare(s1.ht, s2.ht); }
-Q_DECL_CONSTEXPR inline const QSizeF operator+(const QSizeF & s1, const QSizeF & s2) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline const QSizeF operator+(const QSizeF & s1, const QSizeF & s2) noexcept
{ return QSizeF(s1.wd+s2.wd, s1.ht+s2.ht); }
-Q_DECL_CONSTEXPR inline const QSizeF operator-(const QSizeF &s1, const QSizeF &s2) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline const QSizeF operator-(const QSizeF &s1, const QSizeF &s2) noexcept
{ return QSizeF(s1.wd-s2.wd, s1.ht-s2.ht); }
-Q_DECL_CONSTEXPR inline const QSizeF operator*(const QSizeF &s, qreal c) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline const QSizeF operator*(const QSizeF &s, qreal c) noexcept
{ return QSizeF(s.wd*c, s.ht*c); }
-Q_DECL_CONSTEXPR inline const QSizeF operator*(qreal c, const QSizeF &s) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline const QSizeF operator*(qreal c, const QSizeF &s) noexcept
{ return QSizeF(s.wd*c, s.ht*c); }
inline QSizeF &QSizeF::operator/=(qreal c)
@@ -367,17 +367,17 @@ inline const QSizeF operator/(const QSizeF &s, qreal c)
return QSizeF(s.wd/c, s.ht/c);
}
-Q_DECL_CONSTEXPR inline QSizeF QSizeF::expandedTo(const QSizeF & otherSize) const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QSizeF QSizeF::expandedTo(const QSizeF & otherSize) const noexcept
{
return QSizeF(qMax(wd,otherSize.wd), qMax(ht,otherSize.ht));
}
-Q_DECL_CONSTEXPR inline QSizeF QSizeF::boundedTo(const QSizeF & otherSize) const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QSizeF QSizeF::boundedTo(const QSizeF & otherSize) const noexcept
{
return QSizeF(qMin(wd,otherSize.wd), qMin(ht,otherSize.ht));
}
-Q_DECL_CONSTEXPR inline QSize QSizeF::toSize() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QSize QSizeF::toSize() const noexcept
{
return QSize(qRound(wd), qRound(ht));
}
diff --git a/src/corelib/tools/qstack.h b/src/corelib/tools/qstack.h
index bf04935b50..e59212aa2a 100644
--- a/src/corelib/tools/qstack.h
+++ b/src/corelib/tools/qstack.h
@@ -50,7 +50,7 @@ class QStack : public QVector<T>
{
public:
// compiler-generated special member functions are fine!
- inline void swap(QStack<T> &other) Q_DECL_NOTHROW { QVector<T>::swap(other); } // prevent QVector<->QStack swaps
+ inline void swap(QStack<T> &other) noexcept { QVector<T>::swap(other); } // prevent QVector<->QStack swaps
inline void push(const T &t) { QVector<T>::append(t); }
T pop();
T &top();
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp
index 65519d1f98..74debd8cfa 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -155,7 +155,7 @@ static inline bool qt_ends_with(QStringView haystack, QStringView needle, Qt::Ca
static inline bool qt_ends_with(QStringView haystack, QLatin1String needle, Qt::CaseSensitivity cs);
static inline bool qt_ends_with(QStringView haystack, QChar needle, Qt::CaseSensitivity cs);
-qsizetype QtPrivate::qustrlen(const ushort *str) Q_DECL_NOTHROW
+qsizetype QtPrivate::qustrlen(const ushort *str) noexcept
{
qsizetype result = 0;
@@ -453,7 +453,7 @@ static Q_ALWAYS_INLINE __m128i mm_load8_zero_extend(const void *ptr)
// Note: ptr on output may be off by one and point to a preceding US-ASCII
// character. Usually harmless.
-bool qt_is_ascii(const char *&ptr, const char *end) Q_DECL_NOTHROW
+bool qt_is_ascii(const char *&ptr, const char *end) noexcept
{
#if defined(__SSE2__)
// Testing for the high bit can be done efficiently with just PMOVMSKB
@@ -509,7 +509,7 @@ bool qt_is_ascii(const char *&ptr, const char *end) Q_DECL_NOTHROW
return true;
}
-bool QtPrivate::isAscii(QLatin1String s) Q_DECL_NOTHROW
+bool QtPrivate::isAscii(QLatin1String s) noexcept
{
const char *ptr = s.begin();
const char *end = s.end();
@@ -536,7 +536,7 @@ static bool isAscii(const QChar *&ptr, const QChar *end)
return true;
}
-bool QtPrivate::isAscii(QStringView s) Q_DECL_NOTHROW
+bool QtPrivate::isAscii(QStringView s) noexcept
{
const QChar *ptr = s.begin();
const QChar *end = s.end();
@@ -544,7 +544,7 @@ bool QtPrivate::isAscii(QStringView s) Q_DECL_NOTHROW
return isAscii(ptr, end);
}
-bool QtPrivate::isLatin1(QStringView s) Q_DECL_NOTHROW
+bool QtPrivate::isLatin1(QStringView s) noexcept
{
const QChar *ptr = s.begin();
const QChar *end = s.end();
@@ -584,7 +584,7 @@ bool QtPrivate::isLatin1(QStringView s) Q_DECL_NOTHROW
}
// conversion between Latin 1 and UTF-16
-void qt_from_latin1(ushort *dst, const char *str, size_t size) Q_DECL_NOTHROW
+void qt_from_latin1(ushort *dst, const char *str, size_t size) noexcept
{
/* SIMD:
* Unpacking with SSE has been shown to improve performance on recent CPUs
@@ -1141,7 +1141,7 @@ static int ucstrncmp(const QChar *a, const uchar *c, size_t l)
}
template <typename Number>
-Q_DECL_CONSTEXPR int lencmp(Number lhs, Number rhs) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR int lencmp(Number lhs, Number rhs) noexcept
{
return lhs == rhs ? 0 :
lhs > rhs ? 1 :
@@ -1165,7 +1165,7 @@ static int ucstrcmp(const QChar *a, size_t alen, const char *b, size_t blen)
return cmp ? cmp : lencmp(alen, blen);
}
-static int qt_compare_strings(QStringView lhs, QStringView rhs, Qt::CaseSensitivity cs) Q_DECL_NOTHROW
+static int qt_compare_strings(QStringView lhs, QStringView rhs, Qt::CaseSensitivity cs) noexcept
{
if (cs == Qt::CaseSensitive)
return ucstrcmp(lhs.begin(), lhs.size(), rhs.begin(), rhs.size());
@@ -1173,7 +1173,7 @@ static int qt_compare_strings(QStringView lhs, QStringView rhs, Qt::CaseSensitiv
return ucstricmp(lhs.begin(), lhs.end(), rhs.begin(), rhs.end());
}
-static int qt_compare_strings(QStringView lhs, QLatin1String rhs, Qt::CaseSensitivity cs) Q_DECL_NOTHROW
+static int qt_compare_strings(QStringView lhs, QLatin1String rhs, Qt::CaseSensitivity cs) noexcept
{
if (cs == Qt::CaseSensitive)
return ucstrcmp(lhs.begin(), lhs.size(), rhs.begin(), rhs.size());
@@ -1181,12 +1181,12 @@ static int qt_compare_strings(QStringView lhs, QLatin1String rhs, Qt::CaseSensit
return ucstricmp(lhs.begin(), lhs.end(), rhs.begin(), rhs.end());
}
-static int qt_compare_strings(QLatin1String lhs, QStringView rhs, Qt::CaseSensitivity cs) Q_DECL_NOTHROW
+static int qt_compare_strings(QLatin1String lhs, QStringView rhs, Qt::CaseSensitivity cs) noexcept
{
return -qt_compare_strings(rhs, lhs, cs);
}
-static int qt_compare_strings(QLatin1String lhs, QLatin1String rhs, Qt::CaseSensitivity cs) Q_DECL_NOTHROW
+static int qt_compare_strings(QLatin1String lhs, QLatin1String rhs, Qt::CaseSensitivity cs) noexcept
{
if (cs == Qt::CaseInsensitive)
return qstrnicmp(lhs.data(), lhs.size(), rhs.data(), rhs.size());
@@ -1211,7 +1211,7 @@ static int qt_compare_strings(QLatin1String lhs, QLatin1String rhs, Qt::CaseSens
of the characters and is very fast, but is not what a human would expect.
Consider sorting user-visible strings with QString::localeAwareCompare().
*/
-int QtPrivate::compareStrings(QStringView lhs, QStringView rhs, Qt::CaseSensitivity cs) Q_DECL_NOTHROW
+int QtPrivate::compareStrings(QStringView lhs, QStringView rhs, Qt::CaseSensitivity cs) noexcept
{
return qt_compare_strings(lhs, rhs, cs);
}
@@ -1231,7 +1231,7 @@ int QtPrivate::compareStrings(QStringView lhs, QStringView rhs, Qt::CaseSensitiv
of the characters and is very fast, but is not what a human would expect.
Consider sorting user-visible strings with QString::localeAwareCompare().
*/
-int QtPrivate::compareStrings(QStringView lhs, QLatin1String rhs, Qt::CaseSensitivity cs) Q_DECL_NOTHROW
+int QtPrivate::compareStrings(QStringView lhs, QLatin1String rhs, Qt::CaseSensitivity cs) noexcept
{
return qt_compare_strings(lhs, rhs, cs);
}
@@ -1251,7 +1251,7 @@ int QtPrivate::compareStrings(QStringView lhs, QLatin1String rhs, Qt::CaseSensit
of the characters and is very fast, but is not what a human would expect.
Consider sorting user-visible strings with QString::localeAwareCompare().
*/
-int QtPrivate::compareStrings(QLatin1String lhs, QStringView rhs, Qt::CaseSensitivity cs) Q_DECL_NOTHROW
+int QtPrivate::compareStrings(QLatin1String lhs, QStringView rhs, Qt::CaseSensitivity cs) noexcept
{
return qt_compare_strings(lhs, rhs, cs);
}
@@ -1271,7 +1271,7 @@ int QtPrivate::compareStrings(QLatin1String lhs, QStringView rhs, Qt::CaseSensit
of the characters and is very fast, but is not what a human would expect.
Consider sorting user-visible strings with QString::localeAwareCompare().
*/
-int QtPrivate::compareStrings(QLatin1String lhs, QLatin1String rhs, Qt::CaseSensitivity cs) Q_DECL_NOTHROW
+int QtPrivate::compareStrings(QLatin1String lhs, QLatin1String rhs, Qt::CaseSensitivity cs) noexcept
{
return qt_compare_strings(lhs, rhs, cs);
}
@@ -2367,7 +2367,7 @@ void QString::expand(int i)
string.
*/
-QString &QString::operator=(const QString &other) Q_DECL_NOTHROW
+QString &QString::operator=(const QString &other) noexcept
{
other.d->ref.ref();
if (!d->ref.deref())
@@ -3353,7 +3353,7 @@ QString &QString::replace(QChar c, QLatin1String after, Qt::CaseSensitivity cs)
expect. Consider sorting user-interface strings with
localeAwareCompare().
*/
-bool operator==(const QString &s1, const QString &s2) Q_DECL_NOTHROW
+bool operator==(const QString &s1, const QString &s2) noexcept
{
if (s1.d->size != s2.d->size)
return false;
@@ -3366,7 +3366,7 @@ bool operator==(const QString &s1, const QString &s2) Q_DECL_NOTHROW
Returns \c true if this string is equal to \a other; otherwise
returns \c false.
*/
-bool QString::operator==(QLatin1String other) const Q_DECL_NOTHROW
+bool QString::operator==(QLatin1String other) const noexcept
{
if (d->size != other.size())
return false;
@@ -3418,7 +3418,7 @@ bool QString::operator==(QLatin1String other) const Q_DECL_NOTHROW
expect. Consider sorting user-interface strings using the
QString::localeAwareCompare() function.
*/
-bool operator<(const QString &s1, const QString &s2) Q_DECL_NOTHROW
+bool operator<(const QString &s1, const QString &s2) noexcept
{
return qt_compare_strings(s1, s2, Qt::CaseSensitive) < 0;
}
@@ -3429,7 +3429,7 @@ bool operator<(const QString &s1, const QString &s2) Q_DECL_NOTHROW
Returns \c true if this string is lexically less than the parameter
string called \a other; otherwise returns \c false.
*/
-bool QString::operator<(QLatin1String other) const Q_DECL_NOTHROW
+bool QString::operator<(QLatin1String other) const noexcept
{
return qt_compare_strings(*this, other, Qt::CaseSensitive) < 0;
}
@@ -3538,7 +3538,7 @@ bool QString::operator<(QLatin1String other) const Q_DECL_NOTHROW
Returns \c true if this string is lexically greater than the parameter
string \a other; otherwise returns \c false.
*/
-bool QString::operator>(QLatin1String other) const Q_DECL_NOTHROW
+bool QString::operator>(QLatin1String other) const noexcept
{
return qt_compare_strings(*this, other, Qt::CaseSensitive) > 0;
}
@@ -5668,7 +5668,7 @@ QString QString::simplified_helper(QString &str)
namespace {
template <typename StringView>
- StringView qt_trimmed(StringView s) Q_DECL_NOTHROW
+ StringView qt_trimmed(StringView s) noexcept
{
auto begin = s.begin();
auto end = s.end();
@@ -5692,12 +5692,12 @@ namespace {
\sa QString::trimmed(), QStringView::trimmed(), QLatin1String::trimmed()
*/
-QStringView QtPrivate::trimmed(QStringView s) Q_DECL_NOTHROW
+QStringView QtPrivate::trimmed(QStringView s) noexcept
{
return qt_trimmed(s);
}
-QLatin1String QtPrivate::trimmed(QLatin1String s) Q_DECL_NOTHROW
+QLatin1String QtPrivate::trimmed(QLatin1String s) noexcept
{
return qt_trimmed(s);
}
@@ -6235,7 +6235,7 @@ QString& QString::fill(QChar ch, int size)
Same as compare(*this, \a other, \a cs).
*/
-int QString::compare(const QString &other, Qt::CaseSensitivity cs) const Q_DECL_NOTHROW
+int QString::compare(const QString &other, Qt::CaseSensitivity cs) const noexcept
{
return qt_compare_strings(*this, other, cs);
}
@@ -6246,7 +6246,7 @@ int QString::compare(const QString &other, Qt::CaseSensitivity cs) const Q_DECL_
\since 4.5
*/
int QString::compare_helper(const QChar *data1, int length1, const QChar *data2, int length2,
- Qt::CaseSensitivity cs) Q_DECL_NOTHROW
+ Qt::CaseSensitivity cs) noexcept
{
Q_ASSERT(length1 >= 0);
Q_ASSERT(length2 >= 0);
@@ -6261,7 +6261,7 @@ int QString::compare_helper(const QChar *data1, int length1, const QChar *data2,
Same as compare(*this, \a other, \a cs).
*/
-int QString::compare(QLatin1String other, Qt::CaseSensitivity cs) const Q_DECL_NOTHROW
+int QString::compare(QLatin1String other, Qt::CaseSensitivity cs) const noexcept
{
return qt_compare_strings(*this, other, cs);
}
@@ -6307,7 +6307,7 @@ int QString::compare_helper(const QChar *data1, int length1, const char *data2,
\since 4.5
*/
int QString::compare_helper(const QChar *data1, int length1, QLatin1String s2,
- Qt::CaseSensitivity cs) Q_DECL_NOTHROW
+ Qt::CaseSensitivity cs) noexcept
{
Q_ASSERT(length1 >= 0);
Q_ASSERT(data1 || length1 == 0);
@@ -6801,7 +6801,7 @@ static void append_utf8(QString &qs, const char *cs, int len)
qs.resize(newEnd - qs.constData());
}
-static uint parse_flag_characters(const char * &c) Q_DECL_NOTHROW
+static uint parse_flag_characters(const char * &c) noexcept
{
uint flags = QLocaleData::ZeroPadExponent;
while (true) {
@@ -6838,7 +6838,7 @@ static int parse_field_width(const char * &c)
enum LengthMod { lm_none, lm_hh, lm_h, lm_l, lm_ll, lm_L, lm_j, lm_z, lm_t };
-static inline bool can_consume(const char * &c, char ch) Q_DECL_NOTHROW
+static inline bool can_consume(const char * &c, char ch) noexcept
{
if (*c == ch) {
++c;
@@ -6847,7 +6847,7 @@ static inline bool can_consume(const char * &c, char ch) Q_DECL_NOTHROW
return false;
}
-static LengthMod parse_length_modifier(const char * &c) Q_DECL_NOTHROW
+static LengthMod parse_length_modifier(const char * &c) noexcept
{
switch (*c++) {
case 'h': return can_consume(c, 'h') ? lm_hh : lm_h;
@@ -8810,7 +8810,7 @@ namespace {
struct Part
{
Part() : stringRef(), number(0) {}
- Part(const QString &s, int pos, int len, int num = -1) Q_DECL_NOTHROW
+ Part(const QString &s, int pos, int len, int num = -1) noexcept
: stringRef(&s, pos, len), number(num) {}
QStringRef stringRef;
@@ -10379,7 +10379,7 @@ QString QStringRef::toString() const {
Returns \c true if string reference \a s1 is lexically equal to string reference \a s2; otherwise
returns \c false.
*/
-bool operator==(const QStringRef &s1,const QStringRef &s2) Q_DECL_NOTHROW
+bool operator==(const QStringRef &s1,const QStringRef &s2) noexcept
{
return s1.size() == s2.size() && qt_compare_strings(s1, s2, Qt::CaseSensitive) == 0;
}
@@ -10389,7 +10389,7 @@ bool operator==(const QStringRef &s1,const QStringRef &s2) Q_DECL_NOTHROW
Returns \c true if string \a s1 is lexically equal to string reference \a s2; otherwise
returns \c false.
*/
-bool operator==(const QString &s1,const QStringRef &s2) Q_DECL_NOTHROW
+bool operator==(const QString &s1,const QStringRef &s2) noexcept
{
return s1.size() == s2.size() && qt_compare_strings(s1, s2, Qt::CaseSensitive) == 0;
}
@@ -10399,7 +10399,7 @@ bool operator==(const QString &s1,const QStringRef &s2) Q_DECL_NOTHROW
Returns \c true if string \a s1 is lexically equal to string reference \a s2; otherwise
returns \c false.
*/
-bool operator==(QLatin1String s1, const QStringRef &s2) Q_DECL_NOTHROW
+bool operator==(QLatin1String s1, const QStringRef &s2) noexcept
{
if (s1.size() != s2.size())
return false;
@@ -10418,7 +10418,7 @@ bool operator==(QLatin1String s1, const QStringRef &s2) Q_DECL_NOTHROW
expect. Consider sorting user-interface strings using the
QString::localeAwareCompare() function.
*/
-bool operator<(const QStringRef &s1,const QStringRef &s2) Q_DECL_NOTHROW
+bool operator<(const QStringRef &s1,const QStringRef &s2) noexcept
{
return qt_compare_strings(s1, s2, Qt::CaseSensitive) < 0;
}
@@ -11553,7 +11553,7 @@ static inline qsizetype qt_string_count(QStringView haystack, QChar ch,
}
template <typename Haystack, typename Needle>
-bool qt_starts_with_impl(Haystack haystack, Needle needle, Qt::CaseSensitivity cs) Q_DECL_NOTHROW
+bool qt_starts_with_impl(Haystack haystack, Needle needle, Qt::CaseSensitivity cs) noexcept
{
if (haystack.isNull())
return needle.isNull(); // historical behavior, consider changing in ### Qt 6.
@@ -11605,28 +11605,28 @@ static inline bool qt_starts_with(QStringView haystack, QChar needle, Qt::CaseSe
\sa QtPrivate::endsWith(), QString::endsWith(), QStringView::endsWith(), QLatin1String::endsWith()
*/
-bool QtPrivate::startsWith(QStringView haystack, QStringView needle, Qt::CaseSensitivity cs) Q_DECL_NOTHROW
+bool QtPrivate::startsWith(QStringView haystack, QStringView needle, Qt::CaseSensitivity cs) noexcept
{
return qt_starts_with_impl(haystack, needle, cs);
}
-bool QtPrivate::startsWith(QStringView haystack, QLatin1String needle, Qt::CaseSensitivity cs) Q_DECL_NOTHROW
+bool QtPrivate::startsWith(QStringView haystack, QLatin1String needle, Qt::CaseSensitivity cs) noexcept
{
return qt_starts_with_impl(haystack, needle, cs);
}
-bool QtPrivate::startsWith(QLatin1String haystack, QStringView needle, Qt::CaseSensitivity cs) Q_DECL_NOTHROW
+bool QtPrivate::startsWith(QLatin1String haystack, QStringView needle, Qt::CaseSensitivity cs) noexcept
{
return qt_starts_with_impl(haystack, needle, cs);
}
-bool QtPrivate::startsWith(QLatin1String haystack, QLatin1String needle, Qt::CaseSensitivity cs) Q_DECL_NOTHROW
+bool QtPrivate::startsWith(QLatin1String haystack, QLatin1String needle, Qt::CaseSensitivity cs) noexcept
{
return qt_starts_with_impl(haystack, needle, cs);
}
template <typename Haystack, typename Needle>
-bool qt_ends_with_impl(Haystack haystack, Needle needle, Qt::CaseSensitivity cs) Q_DECL_NOTHROW
+bool qt_ends_with_impl(Haystack haystack, Needle needle, Qt::CaseSensitivity cs) noexcept
{
if (haystack.isNull())
return needle.isNull(); // historical behavior, consider changing in ### Qt 6.
@@ -11678,22 +11678,22 @@ static inline bool qt_ends_with(QStringView haystack, QChar needle, Qt::CaseSens
\sa QtPrivate::startsWith(), QString::endsWith(), QStringView::endsWith(), QLatin1String::endsWith()
*/
-bool QtPrivate::endsWith(QStringView haystack, QStringView needle, Qt::CaseSensitivity cs) Q_DECL_NOTHROW
+bool QtPrivate::endsWith(QStringView haystack, QStringView needle, Qt::CaseSensitivity cs) noexcept
{
return qt_ends_with_impl(haystack, needle, cs);
}
-bool QtPrivate::endsWith(QStringView haystack, QLatin1String needle, Qt::CaseSensitivity cs) Q_DECL_NOTHROW
+bool QtPrivate::endsWith(QStringView haystack, QLatin1String needle, Qt::CaseSensitivity cs) noexcept
{
return qt_ends_with_impl(haystack, needle, cs);
}
-bool QtPrivate::endsWith(QLatin1String haystack, QStringView needle, Qt::CaseSensitivity cs) Q_DECL_NOTHROW
+bool QtPrivate::endsWith(QLatin1String haystack, QStringView needle, Qt::CaseSensitivity cs) noexcept
{
return qt_ends_with_impl(haystack, needle, cs);
}
-bool QtPrivate::endsWith(QLatin1String haystack, QLatin1String needle, Qt::CaseSensitivity cs) Q_DECL_NOTHROW
+bool QtPrivate::endsWith(QLatin1String haystack, QLatin1String needle, Qt::CaseSensitivity cs) noexcept
{
return qt_ends_with_impl(haystack, needle, cs);
}
@@ -11707,7 +11707,7 @@ bool QtPrivate::endsWith(QLatin1String haystack, QLatin1String needle, Qt::CaseS
position \a from. Returns -1 if \a ch could not be found.
*/
-qsizetype QtPrivate::findChar(QStringView str, QChar ch, qsizetype from, Qt::CaseSensitivity cs) Q_DECL_NOTHROW
+qsizetype QtPrivate::findChar(QStringView str, QChar ch, qsizetype from, Qt::CaseSensitivity cs) noexcept
{
if (from < 0)
from = qMax(from + str.size(), qsizetype(0));
@@ -11731,7 +11731,7 @@ qsizetype QtPrivate::findChar(QStringView str, QChar ch, qsizetype from, Qt::Cas
return -1;
}
-qsizetype QtPrivate::findString(QStringView haystack0, qsizetype from, QStringView needle0, Qt::CaseSensitivity cs) Q_DECL_NOTHROW
+qsizetype QtPrivate::findString(QStringView haystack0, qsizetype from, QStringView needle0, Qt::CaseSensitivity cs) noexcept
{
const qsizetype l = haystack0.size();
const qsizetype sl = needle0.size();
@@ -11806,7 +11806,7 @@ qsizetype QtPrivate::findString(QStringView haystack0, qsizetype from, QStringVi
return -1;
}
-qsizetype QtPrivate::findString(QStringView haystack, qsizetype from, QLatin1String needle, Qt::CaseSensitivity cs) Q_DECL_NOTHROW
+qsizetype QtPrivate::findString(QStringView haystack, qsizetype from, QLatin1String needle, Qt::CaseSensitivity cs) noexcept
{
if (haystack.size() < needle.size())
return -1;
@@ -12271,7 +12271,7 @@ QString QString::toHtmlEscaped() const
/*!
\internal
*/
-void QAbstractConcatenable::appendLatin1To(const char *a, int len, QChar *out) Q_DECL_NOTHROW
+void QAbstractConcatenable::appendLatin1To(const char *a, int len, QChar *out) noexcept
{
qt_from_latin1(reinterpret_cast<ushort *>(out), a, uint(len));
}
diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h
index e9a205dfdf..a526a6537a 100644
--- a/src/corelib/tools/qstring.h
+++ b/src/corelib/tools/qstring.h
@@ -91,19 +91,19 @@ template <typename T> class QVector;
class QLatin1String
{
public:
- Q_DECL_CONSTEXPR inline QLatin1String() Q_DECL_NOTHROW : m_size(0), m_data(nullptr) {}
- Q_DECL_CONSTEXPR inline explicit QLatin1String(const char *s) Q_DECL_NOTHROW : m_size(s ? int(strlen(s)) : 0), m_data(s) {}
+ Q_DECL_CONSTEXPR inline QLatin1String() noexcept : m_size(0), m_data(nullptr) {}
+ Q_DECL_CONSTEXPR inline explicit QLatin1String(const char *s) noexcept : m_size(s ? int(strlen(s)) : 0), m_data(s) {}
Q_DECL_CONSTEXPR explicit QLatin1String(const char *f, const char *l)
: QLatin1String(f, int(l - f)) {}
- Q_DECL_CONSTEXPR inline explicit QLatin1String(const char *s, int sz) Q_DECL_NOTHROW : m_size(sz), m_data(s) {}
- inline explicit QLatin1String(const QByteArray &s) Q_DECL_NOTHROW : m_size(int(qstrnlen(s.constData(), s.size()))), m_data(s.constData()) {}
+ Q_DECL_CONSTEXPR inline explicit QLatin1String(const char *s, int sz) noexcept : m_size(sz), m_data(s) {}
+ inline explicit QLatin1String(const QByteArray &s) noexcept : m_size(int(qstrnlen(s.constData(), s.size()))), m_data(s.constData()) {}
- Q_DECL_CONSTEXPR const char *latin1() const Q_DECL_NOTHROW { return m_data; }
- Q_DECL_CONSTEXPR int size() const Q_DECL_NOTHROW { return m_size; }
- Q_DECL_CONSTEXPR const char *data() const Q_DECL_NOTHROW { return m_data; }
+ Q_DECL_CONSTEXPR const char *latin1() const noexcept { return m_data; }
+ Q_DECL_CONSTEXPR int size() const noexcept { return m_size; }
+ Q_DECL_CONSTEXPR const char *data() const noexcept { return m_data; }
- Q_DECL_CONSTEXPR bool isNull() const Q_DECL_NOTHROW { return !data(); }
- Q_DECL_CONSTEXPR bool isEmpty() const Q_DECL_NOTHROW { return !size(); }
+ Q_DECL_CONSTEXPR bool isNull() const noexcept { return !data(); }
+ Q_DECL_CONSTEXPR bool isEmpty() const noexcept { return !size(); }
Q_DECL_CONSTEXPR QLatin1Char at(int i) const
{ return Q_ASSERT(i >= 0), Q_ASSERT(i < size()), QLatin1Char(m_data[i]); }
@@ -112,22 +112,22 @@ public:
Q_REQUIRED_RESULT Q_DECL_CONSTEXPR QLatin1Char front() const { return at(0); }
Q_REQUIRED_RESULT Q_DECL_CONSTEXPR QLatin1Char back() const { return at(size() - 1); }
- Q_REQUIRED_RESULT bool startsWith(QStringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_DECL_NOTHROW
+ Q_REQUIRED_RESULT bool startsWith(QStringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept
{ return QtPrivate::startsWith(*this, s, cs); }
- Q_REQUIRED_RESULT bool startsWith(QLatin1String s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_DECL_NOTHROW
+ Q_REQUIRED_RESULT bool startsWith(QLatin1String s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept
{ return QtPrivate::startsWith(*this, s, cs); }
- Q_REQUIRED_RESULT Q_DECL_CONSTEXPR bool startsWith(QChar c) const Q_DECL_NOTHROW
+ Q_REQUIRED_RESULT Q_DECL_CONSTEXPR bool startsWith(QChar c) const noexcept
{ return !isEmpty() && front() == c; }
- Q_REQUIRED_RESULT inline bool startsWith(QChar c, Qt::CaseSensitivity cs) const Q_DECL_NOTHROW
+ Q_REQUIRED_RESULT inline bool startsWith(QChar c, Qt::CaseSensitivity cs) const noexcept
{ return QtPrivate::startsWith(*this, QStringView(&c, 1), cs); }
- Q_REQUIRED_RESULT bool endsWith(QStringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_DECL_NOTHROW
+ Q_REQUIRED_RESULT bool endsWith(QStringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept
{ return QtPrivate::endsWith(*this, s, cs); }
- Q_REQUIRED_RESULT bool endsWith(QLatin1String s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_DECL_NOTHROW
+ Q_REQUIRED_RESULT bool endsWith(QLatin1String s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept
{ return QtPrivate::endsWith(*this, s, cs); }
- Q_REQUIRED_RESULT Q_DECL_CONSTEXPR bool endsWith(QChar c) const Q_DECL_NOTHROW
+ Q_REQUIRED_RESULT Q_DECL_CONSTEXPR bool endsWith(QChar c) const noexcept
{ return !isEmpty() && back() == c; }
- Q_REQUIRED_RESULT inline bool endsWith(QChar c, Qt::CaseSensitivity cs) const Q_DECL_NOTHROW
+ Q_REQUIRED_RESULT inline bool endsWith(QChar c, Qt::CaseSensitivity cs) const noexcept
{ return QtPrivate::endsWith(*this, QStringView(&c, 1), cs); }
using value_type = const char;
@@ -138,18 +138,18 @@ public:
using difference_type = int; // violates Container concept requirements
using size_type = int; // violates Container concept requirements
- Q_DECL_CONSTEXPR const_iterator begin() const Q_DECL_NOTHROW { return data(); }
- Q_DECL_CONSTEXPR const_iterator cbegin() const Q_DECL_NOTHROW { return data(); }
- Q_DECL_CONSTEXPR const_iterator end() const Q_DECL_NOTHROW { return data() + size(); }
- Q_DECL_CONSTEXPR const_iterator cend() const Q_DECL_NOTHROW { return data() + size(); }
+ Q_DECL_CONSTEXPR const_iterator begin() const noexcept { return data(); }
+ Q_DECL_CONSTEXPR const_iterator cbegin() const noexcept { return data(); }
+ Q_DECL_CONSTEXPR const_iterator end() const noexcept { return data() + size(); }
+ Q_DECL_CONSTEXPR const_iterator cend() const noexcept { return data() + size(); }
using reverse_iterator = std::reverse_iterator<iterator>;
using const_reverse_iterator = reverse_iterator;
- const_reverse_iterator rbegin() const Q_DECL_NOTHROW { return const_reverse_iterator(end()); }
- const_reverse_iterator crbegin() const Q_DECL_NOTHROW { return const_reverse_iterator(end()); }
- const_reverse_iterator rend() const Q_DECL_NOTHROW { return const_reverse_iterator(begin()); }
- const_reverse_iterator crend() const Q_DECL_NOTHROW { return const_reverse_iterator(begin()); }
+ const_reverse_iterator rbegin() const noexcept { return const_reverse_iterator(end()); }
+ const_reverse_iterator crbegin() const noexcept { return const_reverse_iterator(end()); }
+ const_reverse_iterator rend() const noexcept { return const_reverse_iterator(begin()); }
+ const_reverse_iterator crend() const noexcept { return const_reverse_iterator(begin()); }
Q_DECL_CONSTEXPR QLatin1String mid(int pos) const
{ return Q_ASSERT(pos >= 0), Q_ASSERT(pos <= size()), QLatin1String(m_data + pos, m_size - pos); }
@@ -167,14 +167,14 @@ public:
Q_DECL_RELAXED_CONSTEXPR void truncate(int n)
{ Q_ASSERT(n >= 0); Q_ASSERT(n <= size()); m_size = n; }
- Q_REQUIRED_RESULT QLatin1String trimmed() const Q_DECL_NOTHROW { return QtPrivate::trimmed(*this); }
+ Q_REQUIRED_RESULT QLatin1String trimmed() const noexcept { return QtPrivate::trimmed(*this); }
- inline bool operator==(const QString &s) const Q_DECL_NOTHROW;
- inline bool operator!=(const QString &s) const Q_DECL_NOTHROW;
- inline bool operator>(const QString &s) const Q_DECL_NOTHROW;
- inline bool operator<(const QString &s) const Q_DECL_NOTHROW;
- inline bool operator>=(const QString &s) const Q_DECL_NOTHROW;
- inline bool operator<=(const QString &s) const Q_DECL_NOTHROW;
+ inline bool operator==(const QString &s) const noexcept;
+ inline bool operator!=(const QString &s) const noexcept;
+ inline bool operator>(const QString &s) const noexcept;
+ inline bool operator<(const QString &s) const noexcept;
+ inline bool operator>=(const QString &s) const noexcept;
+ inline bool operator<=(const QString &s) const noexcept;
#if !defined(QT_NO_CAST_FROM_ASCII) && !defined(QT_RESTRICTED_CAST_FROM_ASCII)
inline QT_ASCII_CAST_WARN bool operator==(const char *s) const;
@@ -204,15 +204,15 @@ typedef QLatin1String QLatin1Literal;
//
// QLatin1String inline implementations
//
-inline bool QtPrivate::isLatin1(QLatin1String) Q_DECL_NOTHROW
+inline bool QtPrivate::isLatin1(QLatin1String) noexcept
{ return true; }
//
// QStringView members that require QLatin1String:
//
-bool QStringView::startsWith(QLatin1String s, Qt::CaseSensitivity cs) const Q_DECL_NOTHROW
+bool QStringView::startsWith(QLatin1String s, Qt::CaseSensitivity cs) const noexcept
{ return QtPrivate::startsWith(*this, s, cs); }
-bool QStringView::endsWith(QLatin1String s, Qt::CaseSensitivity cs) const Q_DECL_NOTHROW
+bool QStringView::endsWith(QLatin1String s, Qt::CaseSensitivity cs) const noexcept
{ return QtPrivate::endsWith(*this, s, cs); }
class Q_CORE_EXPORT QString
@@ -220,22 +220,22 @@ class Q_CORE_EXPORT QString
public:
typedef QStringData Data;
- inline QString() Q_DECL_NOTHROW;
+ inline QString() noexcept;
explicit QString(const QChar *unicode, int size = -1);
QString(QChar c);
QString(int size, QChar c);
inline QString(QLatin1String latin1);
- inline QString(const QString &) Q_DECL_NOTHROW;
+ inline QString(const QString &) noexcept;
inline ~QString();
QString &operator=(QChar c);
- QString &operator=(const QString &) Q_DECL_NOTHROW;
+ QString &operator=(const QString &) noexcept;
QString &operator=(QLatin1String latin1);
#ifdef Q_COMPILER_RVALUE_REFS
- inline QString(QString && other) Q_DECL_NOTHROW : d(other.d) { other.d = Data::sharedNull(); }
- inline QString &operator=(QString &&other) Q_DECL_NOTHROW
+ inline QString(QString && other) noexcept : d(other.d) { other.d = Data::sharedNull(); }
+ inline QString &operator=(QString &&other) noexcept
{ qSwap(d, other.d); return *this; }
#endif
- inline void swap(QString &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+ inline void swap(QString &other) noexcept { qSwap(d, other.d); }
inline int size() const { return d->size; }
inline int count() const { return d->size; }
inline int length() const;
@@ -399,7 +399,7 @@ public:
bool startsWith(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
bool startsWith(const QStringRef &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
#endif
- Q_REQUIRED_RESULT bool startsWith(QStringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_DECL_NOTHROW
+ Q_REQUIRED_RESULT bool startsWith(QStringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept
{ return QtPrivate::startsWith(*this, s, cs); }
bool startsWith(QLatin1String s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
bool startsWith(QChar c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
@@ -408,7 +408,7 @@ public:
bool endsWith(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
bool endsWith(const QStringRef &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
#endif
- Q_REQUIRED_RESULT bool endsWith(QStringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_DECL_NOTHROW
+ Q_REQUIRED_RESULT bool endsWith(QStringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept
{ return QtPrivate::endsWith(*this, s, cs); }
bool endsWith(QLatin1String s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
bool endsWith(QChar c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
@@ -613,25 +613,25 @@ public:
inline QString &setUtf16(const ushort *utf16, int size);
#if QT_STRINGVIEW_LEVEL < 2
- int compare(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_DECL_NOTHROW;
- inline int compare(const QStringRef &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_DECL_NOTHROW;
+ int compare(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept;
+ inline int compare(const QStringRef &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept;
#endif
- int compare(QLatin1String other, Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_DECL_NOTHROW;
- inline int compare(QStringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_DECL_NOTHROW;
+ int compare(QLatin1String other, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept;
+ inline int compare(QStringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept;
static inline int compare(const QString &s1, const QString &s2,
- Qt::CaseSensitivity cs = Qt::CaseSensitive) Q_DECL_NOTHROW
+ Qt::CaseSensitivity cs = Qt::CaseSensitive) noexcept
{ return s1.compare(s2, cs); }
static inline int compare(const QString &s1, QLatin1String s2,
- Qt::CaseSensitivity cs = Qt::CaseSensitive) Q_DECL_NOTHROW
+ Qt::CaseSensitivity cs = Qt::CaseSensitive) noexcept
{ return s1.compare(s2, cs); }
static inline int compare(QLatin1String s1, const QString &s2,
- Qt::CaseSensitivity cs = Qt::CaseSensitive) Q_DECL_NOTHROW
+ Qt::CaseSensitivity cs = Qt::CaseSensitive) noexcept
{ return -s2.compare(s1, cs); }
static int compare(const QString &s1, const QStringRef &s2,
- Qt::CaseSensitivity = Qt::CaseSensitive) Q_DECL_NOTHROW;
+ Qt::CaseSensitivity = Qt::CaseSensitive) noexcept;
int localeAwareCompare(const QString& s) const;
static int localeAwareCompare(const QString& s1, const QString& s2)
@@ -671,19 +671,19 @@ public:
static QString number(qulonglong, int base=10);
static QString number(double, char f='g', int prec=6);
- friend Q_CORE_EXPORT bool operator==(const QString &s1, const QString &s2) Q_DECL_NOTHROW;
- friend Q_CORE_EXPORT bool operator<(const QString &s1, const QString &s2) Q_DECL_NOTHROW;
- friend inline bool operator>(const QString &s1, const QString &s2) Q_DECL_NOTHROW { return s2 < s1; }
- friend inline bool operator!=(const QString &s1, const QString &s2) Q_DECL_NOTHROW { return !(s1 == s2); }
- friend inline bool operator<=(const QString &s1, const QString &s2) Q_DECL_NOTHROW { return !(s1 > s2); }
- friend inline bool operator>=(const QString &s1, const QString &s2) Q_DECL_NOTHROW { return !(s1 < s2); }
+ friend Q_CORE_EXPORT bool operator==(const QString &s1, const QString &s2) noexcept;
+ friend Q_CORE_EXPORT bool operator<(const QString &s1, const QString &s2) noexcept;
+ friend inline bool operator>(const QString &s1, const QString &s2) noexcept { return s2 < s1; }
+ friend inline bool operator!=(const QString &s1, const QString &s2) noexcept { return !(s1 == s2); }
+ friend inline bool operator<=(const QString &s1, const QString &s2) noexcept { return !(s1 > s2); }
+ friend inline bool operator>=(const QString &s1, const QString &s2) noexcept { return !(s1 < s2); }
- bool operator==(QLatin1String s) const Q_DECL_NOTHROW;
- bool operator<(QLatin1String s) const Q_DECL_NOTHROW;
- bool operator>(QLatin1String s) const Q_DECL_NOTHROW;
- inline bool operator!=(QLatin1String s) const Q_DECL_NOTHROW { return !operator==(s); }
- inline bool operator<=(QLatin1String s) const Q_DECL_NOTHROW { return !operator>(s); }
- inline bool operator>=(QLatin1String s) const Q_DECL_NOTHROW { return !operator<(s); }
+ bool operator==(QLatin1String s) const noexcept;
+ bool operator<(QLatin1String s) const noexcept;
+ bool operator>(QLatin1String s) const noexcept;
+ inline bool operator!=(QLatin1String s) const noexcept { return !operator==(s); }
+ inline bool operator<=(QLatin1String s) const noexcept { return !operator>(s); }
+ inline bool operator>=(QLatin1String s) const noexcept { return !operator<(s); }
// ASCII compatibility
#if defined(QT_RESTRICTED_CAST_FROM_ASCII)
@@ -844,15 +844,15 @@ private:
Data *d;
- friend inline bool operator==(QChar, const QString &) Q_DECL_NOTHROW;
- friend inline bool operator< (QChar, const QString &) Q_DECL_NOTHROW;
- friend inline bool operator> (QChar, const QString &) Q_DECL_NOTHROW;
- friend inline bool operator==(QChar, const QStringRef &) Q_DECL_NOTHROW;
- friend inline bool operator< (QChar, const QStringRef &) Q_DECL_NOTHROW;
- friend inline bool operator> (QChar, const QStringRef &) Q_DECL_NOTHROW;
- friend inline bool operator==(QChar, QLatin1String) Q_DECL_NOTHROW;
- friend inline bool operator< (QChar, QLatin1String) Q_DECL_NOTHROW;
- friend inline bool operator> (QChar, QLatin1String) Q_DECL_NOTHROW;
+ friend inline bool operator==(QChar, const QString &) noexcept;
+ friend inline bool operator< (QChar, const QString &) noexcept;
+ friend inline bool operator> (QChar, const QString &) noexcept;
+ friend inline bool operator==(QChar, const QStringRef &) noexcept;
+ friend inline bool operator< (QChar, const QStringRef &) noexcept;
+ friend inline bool operator> (QChar, const QStringRef &) noexcept;
+ friend inline bool operator==(QChar, QLatin1String) noexcept;
+ friend inline bool operator< (QChar, QLatin1String) noexcept;
+ friend inline bool operator> (QChar, QLatin1String) noexcept;
void reallocData(uint alloc, bool grow = false);
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
@@ -861,13 +861,13 @@ private:
QString multiArg(int numArgs, const QString **args) const;
static int compare_helper(const QChar *data1, int length1,
const QChar *data2, int length2,
- Qt::CaseSensitivity cs = Qt::CaseSensitive) Q_DECL_NOTHROW;
+ Qt::CaseSensitivity cs = Qt::CaseSensitive) noexcept;
static int compare_helper(const QChar *data1, int length1,
const char *data2, int length2,
Qt::CaseSensitivity cs = Qt::CaseSensitive);
static int compare_helper(const QChar *data1, int length1,
QLatin1String s2,
- Qt::CaseSensitivity cs = Qt::CaseSensitive) Q_DECL_NOTHROW;
+ Qt::CaseSensitivity cs = Qt::CaseSensitive) noexcept;
static int localeAwareCompare_helper(const QChar *data1, int length1,
const QChar *data2, int length2);
static QString toLower_helper(const QString &str);
@@ -956,7 +956,7 @@ inline bool QString::isDetached() const
{ return !d->ref.isShared(); }
inline void QString::clear()
{ if (!isNull()) *this = QString(); }
-inline QString::QString(const QString &other) Q_DECL_NOTHROW : d(other.d)
+inline QString::QString(const QString &other) noexcept : d(other.d)
{ Q_ASSERT(&other != this); d->ref.ref(); }
inline int QString::capacity() const
{ return d->alloc ? d->alloc - 1 : 0; }
@@ -1128,7 +1128,7 @@ inline void QCharRef::setRow(uchar arow) { QChar(*this).setRow(arow); }
inline void QCharRef::setCell(uchar acell) { QChar(*this).setCell(acell); }
-inline QString::QString() Q_DECL_NOTHROW : d(Data::sharedNull()) {}
+inline QString::QString() noexcept : d(Data::sharedNull()) {}
inline QString::~QString() { if (!d->ref.deref()) Data::deallocate(d); }
inline void QString::reserve(int asize)
@@ -1200,34 +1200,34 @@ QT_DEPRECATED_X("use !QString::isNull()")
inline bool operator!=(const QString &s, QString::Null) { return !s.isNull(); }
#endif
-inline bool operator==(QLatin1String s1, QLatin1String s2) Q_DECL_NOTHROW
+inline bool operator==(QLatin1String s1, QLatin1String s2) noexcept
{ return s1.size() == s2.size() && (!s1.size() || !memcmp(s1.latin1(), s2.latin1(), s1.size())); }
-inline bool operator!=(QLatin1String s1, QLatin1String s2) Q_DECL_NOTHROW
+inline bool operator!=(QLatin1String s1, QLatin1String s2) noexcept
{ return !operator==(s1, s2); }
-inline bool operator<(QLatin1String s1, QLatin1String s2) Q_DECL_NOTHROW
+inline bool operator<(QLatin1String s1, QLatin1String s2) noexcept
{
const int len = qMin(s1.size(), s2.size());
const int r = len ? memcmp(s1.latin1(), s2.latin1(), len) : 0;
return r < 0 || (r == 0 && s1.size() < s2.size());
}
-inline bool operator>(QLatin1String s1, QLatin1String s2) Q_DECL_NOTHROW
+inline bool operator>(QLatin1String s1, QLatin1String s2) noexcept
{ return operator<(s2, s1); }
-inline bool operator<=(QLatin1String s1, QLatin1String s2) Q_DECL_NOTHROW
+inline bool operator<=(QLatin1String s1, QLatin1String s2) noexcept
{ return !operator>(s1, s2); }
-inline bool operator>=(QLatin1String s1, QLatin1String s2) Q_DECL_NOTHROW
+inline bool operator>=(QLatin1String s1, QLatin1String s2) noexcept
{ return !operator<(s1, s2); }
-inline bool QLatin1String::operator==(const QString &s) const Q_DECL_NOTHROW
+inline bool QLatin1String::operator==(const QString &s) const noexcept
{ return s == *this; }
-inline bool QLatin1String::operator!=(const QString &s) const Q_DECL_NOTHROW
+inline bool QLatin1String::operator!=(const QString &s) const noexcept
{ return s != *this; }
-inline bool QLatin1String::operator>(const QString &s) const Q_DECL_NOTHROW
+inline bool QLatin1String::operator>(const QString &s) const noexcept
{ return s < *this; }
-inline bool QLatin1String::operator<(const QString &s) const Q_DECL_NOTHROW
+inline bool QLatin1String::operator<(const QString &s) const noexcept
{ return s > *this; }
-inline bool QLatin1String::operator>=(const QString &s) const Q_DECL_NOTHROW
+inline bool QLatin1String::operator>=(const QString &s) const noexcept
{ return s <= *this; }
-inline bool QLatin1String::operator<=(const QString &s) const Q_DECL_NOTHROW
+inline bool QLatin1String::operator<=(const QString &s) const noexcept
{ return s >= *this; }
#if !defined(QT_NO_CAST_FROM_ASCII) && !defined(QT_RESTRICTED_CAST_FROM_ASCII)
@@ -1434,14 +1434,14 @@ public:
#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
// ### Qt 6: remove all of these, the implicit ones are fine
- QStringRef(const QStringRef &other) Q_DECL_NOTHROW
+ QStringRef(const QStringRef &other) noexcept
:m_string(other.m_string), m_position(other.m_position), m_size(other.m_size)
{}
#ifdef Q_COMPILER_RVALUE_REFS
- QStringRef(QStringRef &&other) Q_DECL_NOTHROW : m_string(other.m_string), m_position(other.m_position), m_size(other.m_size) {}
- QStringRef &operator=(QStringRef &&other) Q_DECL_NOTHROW { return *this = other; }
+ QStringRef(QStringRef &&other) noexcept : m_string(other.m_string), m_position(other.m_position), m_size(other.m_size) {}
+ QStringRef &operator=(QStringRef &&other) noexcept { return *this = other; }
#endif
- QStringRef &operator=(const QStringRef &other) Q_DECL_NOTHROW
+ QStringRef &operator=(const QStringRef &other) noexcept
{
m_string = other.m_string; m_position = other.m_position;
m_size = other.m_size; return *this;
@@ -1484,8 +1484,8 @@ public:
Q_REQUIRED_RESULT QStringRef chopped(int n) const
{ Q_ASSERT(n >= 0); Q_ASSERT(n <= size()); return left(size() - n); }
- void truncate(int pos) Q_DECL_NOTHROW { m_size = qBound(0, pos, m_size); }
- void chop(int n) Q_DECL_NOTHROW
+ void truncate(int pos) noexcept { m_size = qBound(0, pos, m_size); }
+ void chop(int n) noexcept
{
if (n >= m_size)
m_size = 0;
@@ -1495,7 +1495,7 @@ public:
bool isRightToLeft() const;
- Q_REQUIRED_RESULT bool startsWith(QStringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_DECL_NOTHROW
+ Q_REQUIRED_RESULT bool startsWith(QStringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept
{ return QtPrivate::startsWith(*this, s, cs); }
bool startsWith(QLatin1String s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
bool startsWith(QChar c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
@@ -1504,7 +1504,7 @@ public:
bool startsWith(const QStringRef &c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
#endif
- Q_REQUIRED_RESULT bool endsWith(QStringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_DECL_NOTHROW
+ Q_REQUIRED_RESULT bool endsWith(QStringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept
{ return QtPrivate::endsWith(*this, s, cs); }
bool endsWith(QLatin1String s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
bool endsWith(QChar c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
@@ -1567,19 +1567,19 @@ public:
inline QT_ASCII_CAST_WARN bool operator>=(const char *s) const;
#endif
- int compare(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_DECL_NOTHROW;
- int compare(const QStringRef &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_DECL_NOTHROW;
- int compare(QLatin1String s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_DECL_NOTHROW;
+ int compare(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept;
+ int compare(const QStringRef &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept;
+ int compare(QLatin1String s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept;
#if !defined(QT_NO_CAST_FROM_ASCII) && !defined(QT_RESTRICTED_CAST_FROM_ASCII)
int compare(const QByteArray &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
{ return QString::compare_helper(unicode(), size(), s.data(), qstrnlen(s.data(), s.size()), cs); }
#endif
static int compare(const QStringRef &s1, const QString &s2,
- Qt::CaseSensitivity = Qt::CaseSensitive) Q_DECL_NOTHROW;
+ Qt::CaseSensitivity = Qt::CaseSensitive) noexcept;
static int compare(const QStringRef &s1, const QStringRef &s2,
- Qt::CaseSensitivity = Qt::CaseSensitive) Q_DECL_NOTHROW;
+ Qt::CaseSensitivity = Qt::CaseSensitive) noexcept;
static int compare(const QStringRef &s1, QLatin1String s2,
- Qt::CaseSensitivity cs = Qt::CaseSensitive) Q_DECL_NOTHROW;
+ Qt::CaseSensitivity cs = Qt::CaseSensitive) noexcept;
int localeAwareCompare(const QString &s) const;
int localeAwareCompare(const QStringRef &s) const;
@@ -1610,162 +1610,162 @@ inline QStringRef::QStringRef(const QString *aString)
:m_string(aString), m_position(0), m_size(aString?aString->size() : 0){}
// QStringRef <> QStringRef
-Q_CORE_EXPORT bool operator==(const QStringRef &s1, const QStringRef &s2) Q_DECL_NOTHROW;
-inline bool operator!=(const QStringRef &s1, const QStringRef &s2) Q_DECL_NOTHROW
+Q_CORE_EXPORT bool operator==(const QStringRef &s1, const QStringRef &s2) noexcept;
+inline bool operator!=(const QStringRef &s1, const QStringRef &s2) noexcept
{ return !(s1 == s2); }
-Q_CORE_EXPORT bool operator<(const QStringRef &s1, const QStringRef &s2) Q_DECL_NOTHROW;
-inline bool operator>(const QStringRef &s1, const QStringRef &s2) Q_DECL_NOTHROW
+Q_CORE_EXPORT bool operator<(const QStringRef &s1, const QStringRef &s2) noexcept;
+inline bool operator>(const QStringRef &s1, const QStringRef &s2) noexcept
{ return s2 < s1; }
-inline bool operator<=(const QStringRef &s1, const QStringRef &s2) Q_DECL_NOTHROW
+inline bool operator<=(const QStringRef &s1, const QStringRef &s2) noexcept
{ return !(s1 > s2); }
-inline bool operator>=(const QStringRef &s1, const QStringRef &s2) Q_DECL_NOTHROW
+inline bool operator>=(const QStringRef &s1, const QStringRef &s2) noexcept
{ return !(s1 < s2); }
// QString <> QStringRef
-Q_CORE_EXPORT bool operator==(const QString &lhs, const QStringRef &rhs) Q_DECL_NOTHROW;
-inline bool operator!=(const QString &lhs, const QStringRef &rhs) Q_DECL_NOTHROW { return lhs.compare(rhs) != 0; }
-inline bool operator< (const QString &lhs, const QStringRef &rhs) Q_DECL_NOTHROW { return lhs.compare(rhs) < 0; }
-inline bool operator> (const QString &lhs, const QStringRef &rhs) Q_DECL_NOTHROW { return lhs.compare(rhs) > 0; }
-inline bool operator<=(const QString &lhs, const QStringRef &rhs) Q_DECL_NOTHROW { return lhs.compare(rhs) <= 0; }
-inline bool operator>=(const QString &lhs, const QStringRef &rhs) Q_DECL_NOTHROW { return lhs.compare(rhs) >= 0; }
-
-inline bool operator==(const QStringRef &lhs, const QString &rhs) Q_DECL_NOTHROW { return rhs == lhs; }
-inline bool operator!=(const QStringRef &lhs, const QString &rhs) Q_DECL_NOTHROW { return rhs != lhs; }
-inline bool operator< (const QStringRef &lhs, const QString &rhs) Q_DECL_NOTHROW { return rhs > lhs; }
-inline bool operator> (const QStringRef &lhs, const QString &rhs) Q_DECL_NOTHROW { return rhs < lhs; }
-inline bool operator<=(const QStringRef &lhs, const QString &rhs) Q_DECL_NOTHROW { return rhs >= lhs; }
-inline bool operator>=(const QStringRef &lhs, const QString &rhs) Q_DECL_NOTHROW { return rhs <= lhs; }
+Q_CORE_EXPORT bool operator==(const QString &lhs, const QStringRef &rhs) noexcept;
+inline bool operator!=(const QString &lhs, const QStringRef &rhs) noexcept { return lhs.compare(rhs) != 0; }
+inline bool operator< (const QString &lhs, const QStringRef &rhs) noexcept { return lhs.compare(rhs) < 0; }
+inline bool operator> (const QString &lhs, const QStringRef &rhs) noexcept { return lhs.compare(rhs) > 0; }
+inline bool operator<=(const QString &lhs, const QStringRef &rhs) noexcept { return lhs.compare(rhs) <= 0; }
+inline bool operator>=(const QString &lhs, const QStringRef &rhs) noexcept { return lhs.compare(rhs) >= 0; }
+
+inline bool operator==(const QStringRef &lhs, const QString &rhs) noexcept { return rhs == lhs; }
+inline bool operator!=(const QStringRef &lhs, const QString &rhs) noexcept { return rhs != lhs; }
+inline bool operator< (const QStringRef &lhs, const QString &rhs) noexcept { return rhs > lhs; }
+inline bool operator> (const QStringRef &lhs, const QString &rhs) noexcept { return rhs < lhs; }
+inline bool operator<=(const QStringRef &lhs, const QString &rhs) noexcept { return rhs >= lhs; }
+inline bool operator>=(const QStringRef &lhs, const QString &rhs) noexcept { return rhs <= lhs; }
#if QT_STRINGVIEW_LEVEL < 2
-inline int QString::compare(const QStringRef &s, Qt::CaseSensitivity cs) const Q_DECL_NOTHROW
+inline int QString::compare(const QStringRef &s, Qt::CaseSensitivity cs) const noexcept
{ return QString::compare_helper(constData(), length(), s.constData(), s.length(), cs); }
#endif
-inline int QString::compare(QStringView s, Qt::CaseSensitivity cs) const Q_DECL_NOTHROW
+inline int QString::compare(QStringView s, Qt::CaseSensitivity cs) const noexcept
{ return -s.compare(*this, cs); }
-inline int QString::compare(const QString &s1, const QStringRef &s2, Qt::CaseSensitivity cs) Q_DECL_NOTHROW
+inline int QString::compare(const QString &s1, const QStringRef &s2, Qt::CaseSensitivity cs) noexcept
{ return QString::compare_helper(s1.constData(), s1.length(), s2.constData(), s2.length(), cs); }
-inline int QStringRef::compare(const QString &s, Qt::CaseSensitivity cs) const Q_DECL_NOTHROW
+inline int QStringRef::compare(const QString &s, Qt::CaseSensitivity cs) const noexcept
{ return QString::compare_helper(constData(), length(), s.constData(), s.length(), cs); }
-inline int QStringRef::compare(const QStringRef &s, Qt::CaseSensitivity cs) const Q_DECL_NOTHROW
+inline int QStringRef::compare(const QStringRef &s, Qt::CaseSensitivity cs) const noexcept
{ return QString::compare_helper(constData(), length(), s.constData(), s.length(), cs); }
-inline int QStringRef::compare(QLatin1String s, Qt::CaseSensitivity cs) const Q_DECL_NOTHROW
+inline int QStringRef::compare(QLatin1String s, Qt::CaseSensitivity cs) const noexcept
{ return QString::compare_helper(constData(), length(), s, cs); }
-inline int QStringRef::compare(const QStringRef &s1, const QString &s2, Qt::CaseSensitivity cs) Q_DECL_NOTHROW
+inline int QStringRef::compare(const QStringRef &s1, const QString &s2, Qt::CaseSensitivity cs) noexcept
{ return QString::compare_helper(s1.constData(), s1.length(), s2.constData(), s2.length(), cs); }
-inline int QStringRef::compare(const QStringRef &s1, const QStringRef &s2, Qt::CaseSensitivity cs) Q_DECL_NOTHROW
+inline int QStringRef::compare(const QStringRef &s1, const QStringRef &s2, Qt::CaseSensitivity cs) noexcept
{ return QString::compare_helper(s1.constData(), s1.length(), s2.constData(), s2.length(), cs); }
-inline int QStringRef::compare(const QStringRef &s1, QLatin1String s2, Qt::CaseSensitivity cs) Q_DECL_NOTHROW
+inline int QStringRef::compare(const QStringRef &s1, QLatin1String s2, Qt::CaseSensitivity cs) noexcept
{ return QString::compare_helper(s1.constData(), s1.length(), s2, cs); }
// QLatin1String <> QStringRef
-Q_CORE_EXPORT bool operator==(QLatin1String lhs, const QStringRef &rhs) Q_DECL_NOTHROW;
-inline bool operator!=(QLatin1String lhs, const QStringRef &rhs) Q_DECL_NOTHROW { return rhs.compare(lhs) != 0; }
-inline bool operator< (QLatin1String lhs, const QStringRef &rhs) Q_DECL_NOTHROW { return rhs.compare(lhs) > 0; }
-inline bool operator> (QLatin1String lhs, const QStringRef &rhs) Q_DECL_NOTHROW { return rhs.compare(lhs) < 0; }
-inline bool operator<=(QLatin1String lhs, const QStringRef &rhs) Q_DECL_NOTHROW { return rhs.compare(lhs) >= 0; }
-inline bool operator>=(QLatin1String lhs, const QStringRef &rhs) Q_DECL_NOTHROW { return rhs.compare(lhs) <= 0; }
-
-inline bool operator==(const QStringRef &lhs, QLatin1String rhs) Q_DECL_NOTHROW { return rhs == lhs; }
-inline bool operator!=(const QStringRef &lhs, QLatin1String rhs) Q_DECL_NOTHROW { return rhs != lhs; }
-inline bool operator< (const QStringRef &lhs, QLatin1String rhs) Q_DECL_NOTHROW { return rhs > lhs; }
-inline bool operator> (const QStringRef &lhs, QLatin1String rhs) Q_DECL_NOTHROW { return rhs < lhs; }
-inline bool operator<=(const QStringRef &lhs, QLatin1String rhs) Q_DECL_NOTHROW { return rhs >= lhs; }
-inline bool operator>=(const QStringRef &lhs, QLatin1String rhs) Q_DECL_NOTHROW { return rhs <= lhs; }
+Q_CORE_EXPORT bool operator==(QLatin1String lhs, const QStringRef &rhs) noexcept;
+inline bool operator!=(QLatin1String lhs, const QStringRef &rhs) noexcept { return rhs.compare(lhs) != 0; }
+inline bool operator< (QLatin1String lhs, const QStringRef &rhs) noexcept { return rhs.compare(lhs) > 0; }
+inline bool operator> (QLatin1String lhs, const QStringRef &rhs) noexcept { return rhs.compare(lhs) < 0; }
+inline bool operator<=(QLatin1String lhs, const QStringRef &rhs) noexcept { return rhs.compare(lhs) >= 0; }
+inline bool operator>=(QLatin1String lhs, const QStringRef &rhs) noexcept { return rhs.compare(lhs) <= 0; }
+
+inline bool operator==(const QStringRef &lhs, QLatin1String rhs) noexcept { return rhs == lhs; }
+inline bool operator!=(const QStringRef &lhs, QLatin1String rhs) noexcept { return rhs != lhs; }
+inline bool operator< (const QStringRef &lhs, QLatin1String rhs) noexcept { return rhs > lhs; }
+inline bool operator> (const QStringRef &lhs, QLatin1String rhs) noexcept { return rhs < lhs; }
+inline bool operator<=(const QStringRef &lhs, QLatin1String rhs) noexcept { return rhs >= lhs; }
+inline bool operator>=(const QStringRef &lhs, QLatin1String rhs) noexcept { return rhs <= lhs; }
// QChar <> QString
-inline bool operator==(QChar lhs, const QString &rhs) Q_DECL_NOTHROW
+inline bool operator==(QChar lhs, const QString &rhs) noexcept
{ return rhs.size() == 1 && lhs == rhs.front(); }
-inline bool operator< (QChar lhs, const QString &rhs) Q_DECL_NOTHROW
+inline bool operator< (QChar lhs, const QString &rhs) noexcept
{ return QString::compare_helper(&lhs, 1, rhs.data(), rhs.size()) < 0; }
-inline bool operator> (QChar lhs, const QString &rhs) Q_DECL_NOTHROW
+inline bool operator> (QChar lhs, const QString &rhs) noexcept
{ return QString::compare_helper(&lhs, 1, rhs.data(), rhs.size()) > 0; }
-inline bool operator!=(QChar lhs, const QString &rhs) Q_DECL_NOTHROW { return !(lhs == rhs); }
-inline bool operator<=(QChar lhs, const QString &rhs) Q_DECL_NOTHROW { return !(lhs > rhs); }
-inline bool operator>=(QChar lhs, const QString &rhs) Q_DECL_NOTHROW { return !(lhs < rhs); }
+inline bool operator!=(QChar lhs, const QString &rhs) noexcept { return !(lhs == rhs); }
+inline bool operator<=(QChar lhs, const QString &rhs) noexcept { return !(lhs > rhs); }
+inline bool operator>=(QChar lhs, const QString &rhs) noexcept { return !(lhs < rhs); }
-inline bool operator==(const QString &lhs, QChar rhs) Q_DECL_NOTHROW { return rhs == lhs; }
-inline bool operator!=(const QString &lhs, QChar rhs) Q_DECL_NOTHROW { return !(rhs == lhs); }
-inline bool operator< (const QString &lhs, QChar rhs) Q_DECL_NOTHROW { return rhs > lhs; }
-inline bool operator> (const QString &lhs, QChar rhs) Q_DECL_NOTHROW { return rhs < lhs; }
-inline bool operator<=(const QString &lhs, QChar rhs) Q_DECL_NOTHROW { return !(rhs < lhs); }
-inline bool operator>=(const QString &lhs, QChar rhs) Q_DECL_NOTHROW { return !(rhs > lhs); }
+inline bool operator==(const QString &lhs, QChar rhs) noexcept { return rhs == lhs; }
+inline bool operator!=(const QString &lhs, QChar rhs) noexcept { return !(rhs == lhs); }
+inline bool operator< (const QString &lhs, QChar rhs) noexcept { return rhs > lhs; }
+inline bool operator> (const QString &lhs, QChar rhs) noexcept { return rhs < lhs; }
+inline bool operator<=(const QString &lhs, QChar rhs) noexcept { return !(rhs < lhs); }
+inline bool operator>=(const QString &lhs, QChar rhs) noexcept { return !(rhs > lhs); }
// QChar <> QStringRef
-inline bool operator==(QChar lhs, const QStringRef &rhs) Q_DECL_NOTHROW
+inline bool operator==(QChar lhs, const QStringRef &rhs) noexcept
{ return rhs.size() == 1 && lhs == rhs.front(); }
-inline bool operator< (QChar lhs, const QStringRef &rhs) Q_DECL_NOTHROW
+inline bool operator< (QChar lhs, const QStringRef &rhs) noexcept
{ return QString::compare_helper(&lhs, 1, rhs.data(), rhs.size()) < 0; }
-inline bool operator> (QChar lhs, const QStringRef &rhs) Q_DECL_NOTHROW
+inline bool operator> (QChar lhs, const QStringRef &rhs) noexcept
{ return QString::compare_helper(&lhs, 1, rhs.data(), rhs.size()) > 0; }
-inline bool operator!=(QChar lhs, const QStringRef &rhs) Q_DECL_NOTHROW { return !(lhs == rhs); }
-inline bool operator<=(QChar lhs, const QStringRef &rhs) Q_DECL_NOTHROW { return !(lhs > rhs); }
-inline bool operator>=(QChar lhs, const QStringRef &rhs) Q_DECL_NOTHROW { return !(lhs < rhs); }
+inline bool operator!=(QChar lhs, const QStringRef &rhs) noexcept { return !(lhs == rhs); }
+inline bool operator<=(QChar lhs, const QStringRef &rhs) noexcept { return !(lhs > rhs); }
+inline bool operator>=(QChar lhs, const QStringRef &rhs) noexcept { return !(lhs < rhs); }
-inline bool operator==(const QStringRef &lhs, QChar rhs) Q_DECL_NOTHROW { return rhs == lhs; }
-inline bool operator!=(const QStringRef &lhs, QChar rhs) Q_DECL_NOTHROW { return !(rhs == lhs); }
-inline bool operator< (const QStringRef &lhs, QChar rhs) Q_DECL_NOTHROW { return rhs > lhs; }
-inline bool operator> (const QStringRef &lhs, QChar rhs) Q_DECL_NOTHROW { return rhs < lhs; }
-inline bool operator<=(const QStringRef &lhs, QChar rhs) Q_DECL_NOTHROW { return !(rhs < lhs); }
-inline bool operator>=(const QStringRef &lhs, QChar rhs) Q_DECL_NOTHROW { return !(rhs > lhs); }
+inline bool operator==(const QStringRef &lhs, QChar rhs) noexcept { return rhs == lhs; }
+inline bool operator!=(const QStringRef &lhs, QChar rhs) noexcept { return !(rhs == lhs); }
+inline bool operator< (const QStringRef &lhs, QChar rhs) noexcept { return rhs > lhs; }
+inline bool operator> (const QStringRef &lhs, QChar rhs) noexcept { return rhs < lhs; }
+inline bool operator<=(const QStringRef &lhs, QChar rhs) noexcept { return !(rhs < lhs); }
+inline bool operator>=(const QStringRef &lhs, QChar rhs) noexcept { return !(rhs > lhs); }
// QChar <> QLatin1String
-inline bool operator==(QChar lhs, QLatin1String rhs) Q_DECL_NOTHROW
+inline bool operator==(QChar lhs, QLatin1String rhs) noexcept
{ return rhs.size() == 1 && lhs == rhs.front(); }
-inline bool operator< (QChar lhs, QLatin1String rhs) Q_DECL_NOTHROW
+inline bool operator< (QChar lhs, QLatin1String rhs) noexcept
{ return QString::compare_helper(&lhs, 1, rhs) < 0; }
-inline bool operator> (QChar lhs, QLatin1String rhs) Q_DECL_NOTHROW
+inline bool operator> (QChar lhs, QLatin1String rhs) noexcept
{ return QString::compare_helper(&lhs, 1, rhs) > 0; }
-inline bool operator!=(QChar lhs, QLatin1String rhs) Q_DECL_NOTHROW { return !(lhs == rhs); }
-inline bool operator<=(QChar lhs, QLatin1String rhs) Q_DECL_NOTHROW { return !(lhs > rhs); }
-inline bool operator>=(QChar lhs, QLatin1String rhs) Q_DECL_NOTHROW { return !(lhs < rhs); }
+inline bool operator!=(QChar lhs, QLatin1String rhs) noexcept { return !(lhs == rhs); }
+inline bool operator<=(QChar lhs, QLatin1String rhs) noexcept { return !(lhs > rhs); }
+inline bool operator>=(QChar lhs, QLatin1String rhs) noexcept { return !(lhs < rhs); }
-inline bool operator==(QLatin1String lhs, QChar rhs) Q_DECL_NOTHROW { return rhs == lhs; }
-inline bool operator!=(QLatin1String lhs, QChar rhs) Q_DECL_NOTHROW { return !(rhs == lhs); }
-inline bool operator< (QLatin1String lhs, QChar rhs) Q_DECL_NOTHROW { return rhs > lhs; }
-inline bool operator> (QLatin1String lhs, QChar rhs) Q_DECL_NOTHROW { return rhs < lhs; }
-inline bool operator<=(QLatin1String lhs, QChar rhs) Q_DECL_NOTHROW { return !(rhs < lhs); }
-inline bool operator>=(QLatin1String lhs, QChar rhs) Q_DECL_NOTHROW { return !(rhs > lhs); }
+inline bool operator==(QLatin1String lhs, QChar rhs) noexcept { return rhs == lhs; }
+inline bool operator!=(QLatin1String lhs, QChar rhs) noexcept { return !(rhs == lhs); }
+inline bool operator< (QLatin1String lhs, QChar rhs) noexcept { return rhs > lhs; }
+inline bool operator> (QLatin1String lhs, QChar rhs) noexcept { return rhs < lhs; }
+inline bool operator<=(QLatin1String lhs, QChar rhs) noexcept { return !(rhs < lhs); }
+inline bool operator>=(QLatin1String lhs, QChar rhs) noexcept { return !(rhs > lhs); }
// QStringView <> QStringView
-inline bool operator==(QStringView lhs, QStringView rhs) Q_DECL_NOTHROW { return lhs.size() == rhs.size() && QtPrivate::compareStrings(lhs, rhs) == 0; }
-inline bool operator!=(QStringView lhs, QStringView rhs) Q_DECL_NOTHROW { return !(lhs == rhs); }
-inline bool operator< (QStringView lhs, QStringView rhs) Q_DECL_NOTHROW { return QtPrivate::compareStrings(lhs, rhs) < 0; }
-inline bool operator<=(QStringView lhs, QStringView rhs) Q_DECL_NOTHROW { return QtPrivate::compareStrings(lhs, rhs) <= 0; }
-inline bool operator> (QStringView lhs, QStringView rhs) Q_DECL_NOTHROW { return QtPrivate::compareStrings(lhs, rhs) > 0; }
-inline bool operator>=(QStringView lhs, QStringView rhs) Q_DECL_NOTHROW { return QtPrivate::compareStrings(lhs, rhs) >= 0; }
+inline bool operator==(QStringView lhs, QStringView rhs) noexcept { return lhs.size() == rhs.size() && QtPrivate::compareStrings(lhs, rhs) == 0; }
+inline bool operator!=(QStringView lhs, QStringView rhs) noexcept { return !(lhs == rhs); }
+inline bool operator< (QStringView lhs, QStringView rhs) noexcept { return QtPrivate::compareStrings(lhs, rhs) < 0; }
+inline bool operator<=(QStringView lhs, QStringView rhs) noexcept { return QtPrivate::compareStrings(lhs, rhs) <= 0; }
+inline bool operator> (QStringView lhs, QStringView rhs) noexcept { return QtPrivate::compareStrings(lhs, rhs) > 0; }
+inline bool operator>=(QStringView lhs, QStringView rhs) noexcept { return QtPrivate::compareStrings(lhs, rhs) >= 0; }
// QStringView <> QChar
-inline bool operator==(QStringView lhs, QChar rhs) Q_DECL_NOTHROW { return lhs == QStringView(&rhs, 1); }
-inline bool operator!=(QStringView lhs, QChar rhs) Q_DECL_NOTHROW { return lhs != QStringView(&rhs, 1); }
-inline bool operator< (QStringView lhs, QChar rhs) Q_DECL_NOTHROW { return lhs < QStringView(&rhs, 1); }
-inline bool operator<=(QStringView lhs, QChar rhs) Q_DECL_NOTHROW { return lhs <= QStringView(&rhs, 1); }
-inline bool operator> (QStringView lhs, QChar rhs) Q_DECL_NOTHROW { return lhs > QStringView(&rhs, 1); }
-inline bool operator>=(QStringView lhs, QChar rhs) Q_DECL_NOTHROW { return lhs >= QStringView(&rhs, 1); }
-
-inline bool operator==(QChar lhs, QStringView rhs) Q_DECL_NOTHROW { return QStringView(&lhs, 1) == rhs; }
-inline bool operator!=(QChar lhs, QStringView rhs) Q_DECL_NOTHROW { return QStringView(&lhs, 1) != rhs; }
-inline bool operator< (QChar lhs, QStringView rhs) Q_DECL_NOTHROW { return QStringView(&lhs, 1) < rhs; }
-inline bool operator<=(QChar lhs, QStringView rhs) Q_DECL_NOTHROW { return QStringView(&lhs, 1) <= rhs; }
-inline bool operator> (QChar lhs, QStringView rhs) Q_DECL_NOTHROW { return QStringView(&lhs, 1) > rhs; }
-inline bool operator>=(QChar lhs, QStringView rhs) Q_DECL_NOTHROW { return QStringView(&lhs, 1) >= rhs; }
+inline bool operator==(QStringView lhs, QChar rhs) noexcept { return lhs == QStringView(&rhs, 1); }
+inline bool operator!=(QStringView lhs, QChar rhs) noexcept { return lhs != QStringView(&rhs, 1); }
+inline bool operator< (QStringView lhs, QChar rhs) noexcept { return lhs < QStringView(&rhs, 1); }
+inline bool operator<=(QStringView lhs, QChar rhs) noexcept { return lhs <= QStringView(&rhs, 1); }
+inline bool operator> (QStringView lhs, QChar rhs) noexcept { return lhs > QStringView(&rhs, 1); }
+inline bool operator>=(QStringView lhs, QChar rhs) noexcept { return lhs >= QStringView(&rhs, 1); }
+
+inline bool operator==(QChar lhs, QStringView rhs) noexcept { return QStringView(&lhs, 1) == rhs; }
+inline bool operator!=(QChar lhs, QStringView rhs) noexcept { return QStringView(&lhs, 1) != rhs; }
+inline bool operator< (QChar lhs, QStringView rhs) noexcept { return QStringView(&lhs, 1) < rhs; }
+inline bool operator<=(QChar lhs, QStringView rhs) noexcept { return QStringView(&lhs, 1) <= rhs; }
+inline bool operator> (QChar lhs, QStringView rhs) noexcept { return QStringView(&lhs, 1) > rhs; }
+inline bool operator>=(QChar lhs, QStringView rhs) noexcept { return QStringView(&lhs, 1) >= rhs; }
// QStringView <> QLatin1String
-inline bool operator==(QStringView lhs, QLatin1String rhs) Q_DECL_NOTHROW { return lhs.size() == rhs.size() && QtPrivate::compareStrings(lhs, rhs) == 0; }
-inline bool operator!=(QStringView lhs, QLatin1String rhs) Q_DECL_NOTHROW { return !(lhs == rhs); }
-inline bool operator< (QStringView lhs, QLatin1String rhs) Q_DECL_NOTHROW { return QtPrivate::compareStrings(lhs, rhs) < 0; }
-inline bool operator<=(QStringView lhs, QLatin1String rhs) Q_DECL_NOTHROW { return QtPrivate::compareStrings(lhs, rhs) <= 0; }
-inline bool operator> (QStringView lhs, QLatin1String rhs) Q_DECL_NOTHROW { return QtPrivate::compareStrings(lhs, rhs) > 0; }
-inline bool operator>=(QStringView lhs, QLatin1String rhs) Q_DECL_NOTHROW { return QtPrivate::compareStrings(lhs, rhs) >= 0; }
-
-inline bool operator==(QLatin1String lhs, QStringView rhs) Q_DECL_NOTHROW { return lhs.size() == rhs.size() && QtPrivate::compareStrings(lhs, rhs) == 0; }
-inline bool operator!=(QLatin1String lhs, QStringView rhs) Q_DECL_NOTHROW { return !(lhs == rhs); }
-inline bool operator< (QLatin1String lhs, QStringView rhs) Q_DECL_NOTHROW { return QtPrivate::compareStrings(lhs, rhs) < 0; }
-inline bool operator<=(QLatin1String lhs, QStringView rhs) Q_DECL_NOTHROW { return QtPrivate::compareStrings(lhs, rhs) <= 0; }
-inline bool operator> (QLatin1String lhs, QStringView rhs) Q_DECL_NOTHROW { return QtPrivate::compareStrings(lhs, rhs) > 0; }
-inline bool operator>=(QLatin1String lhs, QStringView rhs) Q_DECL_NOTHROW { return QtPrivate::compareStrings(lhs, rhs) >= 0; }
+inline bool operator==(QStringView lhs, QLatin1String rhs) noexcept { return lhs.size() == rhs.size() && QtPrivate::compareStrings(lhs, rhs) == 0; }
+inline bool operator!=(QStringView lhs, QLatin1String rhs) noexcept { return !(lhs == rhs); }
+inline bool operator< (QStringView lhs, QLatin1String rhs) noexcept { return QtPrivate::compareStrings(lhs, rhs) < 0; }
+inline bool operator<=(QStringView lhs, QLatin1String rhs) noexcept { return QtPrivate::compareStrings(lhs, rhs) <= 0; }
+inline bool operator> (QStringView lhs, QLatin1String rhs) noexcept { return QtPrivate::compareStrings(lhs, rhs) > 0; }
+inline bool operator>=(QStringView lhs, QLatin1String rhs) noexcept { return QtPrivate::compareStrings(lhs, rhs) >= 0; }
+
+inline bool operator==(QLatin1String lhs, QStringView rhs) noexcept { return lhs.size() == rhs.size() && QtPrivate::compareStrings(lhs, rhs) == 0; }
+inline bool operator!=(QLatin1String lhs, QStringView rhs) noexcept { return !(lhs == rhs); }
+inline bool operator< (QLatin1String lhs, QStringView rhs) noexcept { return QtPrivate::compareStrings(lhs, rhs) < 0; }
+inline bool operator<=(QLatin1String lhs, QStringView rhs) noexcept { return QtPrivate::compareStrings(lhs, rhs) <= 0; }
+inline bool operator> (QLatin1String lhs, QStringView rhs) noexcept { return QtPrivate::compareStrings(lhs, rhs) > 0; }
+inline bool operator>=(QLatin1String lhs, QStringView rhs) noexcept { return QtPrivate::compareStrings(lhs, rhs) >= 0; }
#if !defined(QT_NO_CAST_FROM_ASCII) && !defined(QT_RESTRICTED_CAST_FROM_ASCII)
// QStringRef <> QByteArray
diff --git a/src/corelib/tools/qstringalgorithms.h b/src/corelib/tools/qstringalgorithms.h
index e94f725598..8e7fc0af9b 100644
--- a/src/corelib/tools/qstringalgorithms.h
+++ b/src/corelib/tools/qstringalgorithms.h
@@ -56,31 +56,31 @@ template <typename T> class QVector;
namespace QtPrivate {
-Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION qsizetype qustrlen(const ushort *str) Q_DECL_NOTHROW;
+Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION qsizetype qustrlen(const ushort *str) noexcept;
Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION const ushort *qustrchr(QStringView str, ushort ch) noexcept;
-Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION int compareStrings(QStringView lhs, QStringView rhs, Qt::CaseSensitivity cs = Qt::CaseSensitive) Q_DECL_NOTHROW;
-Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION int compareStrings(QStringView lhs, QLatin1String rhs, Qt::CaseSensitivity cs = Qt::CaseSensitive) Q_DECL_NOTHROW;
-Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION int compareStrings(QLatin1String lhs, QStringView rhs, Qt::CaseSensitivity cs = Qt::CaseSensitive) Q_DECL_NOTHROW;
-Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION int compareStrings(QLatin1String lhs, QLatin1String rhs, Qt::CaseSensitivity cs = Qt::CaseSensitive) Q_DECL_NOTHROW;
+Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION int compareStrings(QStringView lhs, QStringView rhs, Qt::CaseSensitivity cs = Qt::CaseSensitive) noexcept;
+Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION int compareStrings(QStringView lhs, QLatin1String rhs, Qt::CaseSensitivity cs = Qt::CaseSensitive) noexcept;
+Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION int compareStrings(QLatin1String lhs, QStringView rhs, Qt::CaseSensitivity cs = Qt::CaseSensitive) noexcept;
+Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION int compareStrings(QLatin1String lhs, QLatin1String rhs, Qt::CaseSensitivity cs = Qt::CaseSensitive) noexcept;
-Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool startsWith(QStringView haystack, QStringView needle, Qt::CaseSensitivity cs = Qt::CaseSensitive) Q_DECL_NOTHROW;
-Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool startsWith(QStringView haystack, QLatin1String needle, Qt::CaseSensitivity cs = Qt::CaseSensitive) Q_DECL_NOTHROW;
-Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool startsWith(QLatin1String haystack, QStringView needle, Qt::CaseSensitivity cs = Qt::CaseSensitive) Q_DECL_NOTHROW;
-Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool startsWith(QLatin1String haystack, QLatin1String needle, Qt::CaseSensitivity cs = Qt::CaseSensitive) Q_DECL_NOTHROW;
+Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool startsWith(QStringView haystack, QStringView needle, Qt::CaseSensitivity cs = Qt::CaseSensitive) noexcept;
+Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool startsWith(QStringView haystack, QLatin1String needle, Qt::CaseSensitivity cs = Qt::CaseSensitive) noexcept;
+Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool startsWith(QLatin1String haystack, QStringView needle, Qt::CaseSensitivity cs = Qt::CaseSensitive) noexcept;
+Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool startsWith(QLatin1String haystack, QLatin1String needle, Qt::CaseSensitivity cs = Qt::CaseSensitive) noexcept;
-Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool endsWith(QStringView haystack, QStringView needle, Qt::CaseSensitivity cs = Qt::CaseSensitive) Q_DECL_NOTHROW;
-Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool endsWith(QStringView haystack, QLatin1String needle, Qt::CaseSensitivity cs = Qt::CaseSensitive) Q_DECL_NOTHROW;
-Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool endsWith(QLatin1String haystack, QStringView needle, Qt::CaseSensitivity cs = Qt::CaseSensitive) Q_DECL_NOTHROW;
-Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool endsWith(QLatin1String haystack, QLatin1String needle, Qt::CaseSensitivity cs = Qt::CaseSensitive) Q_DECL_NOTHROW;
+Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool endsWith(QStringView haystack, QStringView needle, Qt::CaseSensitivity cs = Qt::CaseSensitive) noexcept;
+Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool endsWith(QStringView haystack, QLatin1String needle, Qt::CaseSensitivity cs = Qt::CaseSensitive) noexcept;
+Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool endsWith(QLatin1String haystack, QStringView needle, Qt::CaseSensitivity cs = Qt::CaseSensitive) noexcept;
+Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool endsWith(QLatin1String haystack, QLatin1String needle, Qt::CaseSensitivity cs = Qt::CaseSensitive) noexcept;
-Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION qsizetype findChar(QStringView str, QChar ch, qsizetype from, Qt::CaseSensitivity cs = Qt::CaseSensitive) Q_DECL_NOTHROW;
-Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION qsizetype findString(QStringView haystack, qsizetype from, QStringView needle, Qt::CaseSensitivity cs = Qt::CaseSensitive) Q_DECL_NOTHROW;
-Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION qsizetype findString(QStringView haystack, qsizetype from, QLatin1String needle, Qt::CaseSensitivity cs = Qt::CaseSensitive) Q_DECL_NOTHROW;
+Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION qsizetype findChar(QStringView str, QChar ch, qsizetype from, Qt::CaseSensitivity cs = Qt::CaseSensitive) noexcept;
+Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION qsizetype findString(QStringView haystack, qsizetype from, QStringView needle, Qt::CaseSensitivity cs = Qt::CaseSensitive) noexcept;
+Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION qsizetype findString(QStringView haystack, qsizetype from, QLatin1String needle, Qt::CaseSensitivity cs = Qt::CaseSensitive) noexcept;
-Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION QStringView trimmed(QStringView s) Q_DECL_NOTHROW;
-Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION QLatin1String trimmed(QLatin1String s) Q_DECL_NOTHROW;
+Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION QStringView trimmed(QStringView s) noexcept;
+Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION QLatin1String trimmed(QLatin1String s) noexcept;
Q_REQUIRED_RESULT Q_CORE_EXPORT QByteArray convertToLatin1(QStringView str);
Q_REQUIRED_RESULT Q_CORE_EXPORT QByteArray convertToUtf8(QStringView str);
@@ -88,10 +88,10 @@ Q_REQUIRED_RESULT Q_CORE_EXPORT QByteArray convertToLocal8Bit(QStringView str);
Q_REQUIRED_RESULT Q_CORE_EXPORT QVector<uint> convertToUcs4(QStringView str);
Q_REQUIRED_RESULT Q_CORE_EXPORT bool isRightToLeft(QStringView string);
-Q_REQUIRED_RESULT Q_CORE_EXPORT bool isAscii(QLatin1String s) Q_DECL_NOTHROW;
-Q_REQUIRED_RESULT Q_CORE_EXPORT bool isAscii(QStringView s) Q_DECL_NOTHROW;
-Q_REQUIRED_RESULT bool isLatin1(QLatin1String s) Q_DECL_NOTHROW; // in qstring.h
-Q_REQUIRED_RESULT Q_CORE_EXPORT bool isLatin1(QStringView s) Q_DECL_NOTHROW;
+Q_REQUIRED_RESULT Q_CORE_EXPORT bool isAscii(QLatin1String s) noexcept;
+Q_REQUIRED_RESULT Q_CORE_EXPORT bool isAscii(QStringView s) noexcept;
+Q_REQUIRED_RESULT bool isLatin1(QLatin1String s) noexcept; // in qstring.h
+Q_REQUIRED_RESULT Q_CORE_EXPORT bool isLatin1(QStringView s) noexcept;
} // namespace QtPRivate
diff --git a/src/corelib/tools/qstringbuilder.cpp b/src/corelib/tools/qstringbuilder.cpp
index 8afc83819b..cf443ec369 100644
--- a/src/corelib/tools/qstringbuilder.cpp
+++ b/src/corelib/tools/qstringbuilder.cpp
@@ -124,7 +124,7 @@ QT_BEGIN_NAMESPACE
/*!
\internal
*/
-void QAbstractConcatenable::convertFromAscii(const char *a, int len, QChar *&out) Q_DECL_NOTHROW
+void QAbstractConcatenable::convertFromAscii(const char *a, int len, QChar *&out) noexcept
{
if (Q_UNLIKELY(len == -1)) {
if (!a)
diff --git a/src/corelib/tools/qstringbuilder.h b/src/corelib/tools/qstringbuilder.h
index 1d96d70637..79ed10c7a8 100644
--- a/src/corelib/tools/qstringbuilder.h
+++ b/src/corelib/tools/qstringbuilder.h
@@ -58,12 +58,12 @@ QT_BEGIN_NAMESPACE
struct Q_CORE_EXPORT QAbstractConcatenable
{
protected:
- static void convertFromAscii(const char *a, int len, QChar *&out) Q_DECL_NOTHROW;
- static inline void convertFromAscii(char a, QChar *&out) Q_DECL_NOTHROW
+ static void convertFromAscii(const char *a, int len, QChar *&out) noexcept;
+ static inline void convertFromAscii(char a, QChar *&out) noexcept
{
*out++ = QLatin1Char(a);
}
- static void appendLatin1To(const char *a, int len, QChar *out) Q_DECL_NOTHROW;
+ static void appendLatin1To(const char *a, int len, QChar *out) noexcept;
};
template <typename T> struct QConcatenable {};
diff --git a/src/corelib/tools/qstringlist.h b/src/corelib/tools/qstringlist.h
index b6c48488df..6387161269 100644
--- a/src/corelib/tools/qstringlist.h
+++ b/src/corelib/tools/qstringlist.h
@@ -100,11 +100,11 @@ class QStringList : public QList<QString>
{
#endif
public:
- inline QStringList() Q_DECL_NOTHROW { }
+ inline QStringList() noexcept { }
inline explicit QStringList(const QString &i) { append(i); }
inline QStringList(const QList<QString> &l) : QList<QString>(l) { }
#ifdef Q_COMPILER_RVALUE_REFS
- inline QStringList(QList<QString> &&l) Q_DECL_NOTHROW : QList<QString>(std::move(l)) { }
+ inline QStringList(QList<QString> &&l) noexcept : QList<QString>(std::move(l)) { }
#endif
#ifdef Q_COMPILER_INITIALIZER_LISTS
inline QStringList(std::initializer_list<QString> args) : QList<QString>(args) { }
@@ -113,7 +113,7 @@ public:
QStringList &operator=(const QList<QString> &other)
{ QList<QString>::operator=(other); return *this; }
#ifdef Q_COMPILER_RVALUE_REFS
- QStringList &operator=(QList<QString> &&other) Q_DECL_NOTHROW
+ QStringList &operator=(QList<QString> &&other) noexcept
{ QList<QString>::operator=(std::move(other)); return *this; }
#endif
diff --git a/src/corelib/tools/qstringliteral.h b/src/corelib/tools/qstringliteral.h
index 64296b89fc..603f19c0b4 100644
--- a/src/corelib/tools/qstringliteral.h
+++ b/src/corelib/tools/qstringliteral.h
@@ -63,7 +63,7 @@ Q_STATIC_ASSERT_X(sizeof(qunicodechar) == 2,
#define QT_UNICODE_LITERAL(str) u"" str
#define QStringLiteral(str) \
- ([]() Q_DECL_NOEXCEPT -> QString { \
+ ([]() noexcept -> QString { \
enum { Size = sizeof(QT_UNICODE_LITERAL(str))/2 - 1 }; \
static const QStaticStringData<Size> qstring_literal = { \
Q_STATIC_STRING_DATA_HEADER_INITIALIZER(Size), \
diff --git a/src/corelib/tools/qstringview.h b/src/corelib/tools/qstringview.h
index 4a900b5e89..5b6d63b71c 100644
--- a/src/corelib/tools/qstringview.h
+++ b/src/corelib/tools/qstringview.h
@@ -139,13 +139,13 @@ private:
using if_compatible_qstring_like = typename std::enable_if<std::is_same<T, QString>::value || std::is_same<T, QStringRef>::value, bool>::type;
template <typename Char, size_t N>
- static Q_DECL_CONSTEXPR qsizetype lengthHelperArray(const Char (&)[N]) Q_DECL_NOTHROW
+ static Q_DECL_CONSTEXPR qsizetype lengthHelperArray(const Char (&)[N]) noexcept
{
return qsizetype(N - 1);
}
template <typename Char>
- static qsizetype lengthHelperPointer(const Char *str) Q_DECL_NOTHROW
+ static qsizetype lengthHelperPointer(const Char *str) noexcept
{
#if defined(Q_CC_GNU) && !defined(Q_CC_CLANG) && !defined(Q_CC_INTEL)
if (__builtin_constant_p(*str)) {
@@ -157,21 +157,21 @@ private:
#endif
return QtPrivate::qustrlen(reinterpret_cast<const ushort *>(str));
}
- static qsizetype lengthHelperPointer(const QChar *str) Q_DECL_NOTHROW
+ static qsizetype lengthHelperPointer(const QChar *str) noexcept
{
return QtPrivate::qustrlen(reinterpret_cast<const ushort *>(str));
}
template <typename Char>
- static const storage_type *castHelper(const Char *str) Q_DECL_NOTHROW
+ static const storage_type *castHelper(const Char *str) noexcept
{ return reinterpret_cast<const storage_type*>(str); }
- static Q_DECL_CONSTEXPR const storage_type *castHelper(const storage_type *str) Q_DECL_NOTHROW
+ static Q_DECL_CONSTEXPR const storage_type *castHelper(const storage_type *str) noexcept
{ return str; }
public:
- Q_DECL_CONSTEXPR QStringView() Q_DECL_NOTHROW
+ Q_DECL_CONSTEXPR QStringView() noexcept
: m_size(0), m_data(nullptr) {}
- Q_DECL_CONSTEXPR QStringView(std::nullptr_t) Q_DECL_NOTHROW
+ Q_DECL_CONSTEXPR QStringView(std::nullptr_t) noexcept
: QStringView() {}
template <typename Char, if_compatible_char<Char> = true>
@@ -185,38 +185,38 @@ public:
#ifdef Q_CLANG_QDOC
template <typename Char, size_t N>
- Q_DECL_CONSTEXPR QStringView(const Char (&array)[N]) Q_DECL_NOTHROW;
+ Q_DECL_CONSTEXPR QStringView(const Char (&array)[N]) noexcept;
template <typename Char>
- Q_DECL_CONSTEXPR QStringView(const Char *str) Q_DECL_NOTHROW;
+ Q_DECL_CONSTEXPR QStringView(const Char *str) noexcept;
#else
template <typename Array, if_compatible_array<Array> = true>
- Q_DECL_CONSTEXPR QStringView(const Array &str) Q_DECL_NOTHROW
+ Q_DECL_CONSTEXPR QStringView(const Array &str) noexcept
: QStringView(str, lengthHelperArray(str)) {}
template <typename Pointer, if_compatible_pointer<Pointer> = true>
- Q_DECL_CONSTEXPR QStringView(const Pointer &str) Q_DECL_NOTHROW
+ Q_DECL_CONSTEXPR QStringView(const Pointer &str) noexcept
: QStringView(str, str ? lengthHelperPointer(str) : 0) {}
#endif
#ifdef Q_CLANG_QDOC
- QStringView(const QString &str) Q_DECL_NOTHROW;
- QStringView(const QStringRef &str) Q_DECL_NOTHROW;
+ QStringView(const QString &str) noexcept;
+ QStringView(const QStringRef &str) noexcept;
#else
template <typename String, if_compatible_qstring_like<String> = true>
- QStringView(const String &str) Q_DECL_NOTHROW
+ QStringView(const String &str) noexcept
: QStringView(str.isNull() ? nullptr : str.data(), qsizetype(str.size())) {}
#endif
template <typename StdBasicString, if_compatible_string<StdBasicString> = true>
- QStringView(const StdBasicString &str) Q_DECL_NOTHROW
+ QStringView(const StdBasicString &str) noexcept
: QStringView(str.data(), qsizetype(str.size())) {}
Q_REQUIRED_RESULT inline QString toString() const; // defined in qstring.h
- Q_REQUIRED_RESULT Q_DECL_CONSTEXPR qsizetype size() const Q_DECL_NOTHROW { return m_size; }
- Q_REQUIRED_RESULT const_pointer data() const Q_DECL_NOTHROW { return reinterpret_cast<const_pointer>(m_data); }
- Q_REQUIRED_RESULT Q_DECL_CONSTEXPR const storage_type *utf16() const Q_DECL_NOTHROW { return m_data; }
+ Q_REQUIRED_RESULT Q_DECL_CONSTEXPR qsizetype size() const noexcept { return m_size; }
+ Q_REQUIRED_RESULT const_pointer data() const noexcept { return reinterpret_cast<const_pointer>(m_data); }
+ Q_REQUIRED_RESULT Q_DECL_CONSTEXPR const storage_type *utf16() const noexcept { return m_data; }
Q_REQUIRED_RESULT Q_DECL_CONSTEXPR QChar operator[](qsizetype n) const
{ return Q_ASSERT(n >= 0), Q_ASSERT(n < size()), QChar(m_data[n]); }
@@ -248,28 +248,28 @@ public:
Q_DECL_RELAXED_CONSTEXPR void chop(qsizetype n)
{ Q_ASSERT(n >= 0); Q_ASSERT(n <= size()); m_size -= n; }
- Q_REQUIRED_RESULT QStringView trimmed() const Q_DECL_NOTHROW { return QtPrivate::trimmed(*this); }
+ Q_REQUIRED_RESULT QStringView trimmed() const noexcept { return QtPrivate::trimmed(*this); }
- Q_REQUIRED_RESULT int compare(QStringView other, Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_DECL_NOTHROW
+ Q_REQUIRED_RESULT int compare(QStringView other, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept
{ return QtPrivate::compareStrings(*this, other, cs); }
- Q_REQUIRED_RESULT bool startsWith(QStringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_DECL_NOTHROW
+ Q_REQUIRED_RESULT bool startsWith(QStringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept
{ return QtPrivate::startsWith(*this, s, cs); }
- Q_REQUIRED_RESULT inline bool startsWith(QLatin1String s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_DECL_NOTHROW;
- Q_REQUIRED_RESULT bool startsWith(QChar c) const Q_DECL_NOTHROW
+ Q_REQUIRED_RESULT inline bool startsWith(QLatin1String s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept;
+ Q_REQUIRED_RESULT bool startsWith(QChar c) const noexcept
{ return !empty() && front() == c; }
- Q_REQUIRED_RESULT bool startsWith(QChar c, Qt::CaseSensitivity cs) const Q_DECL_NOTHROW
+ Q_REQUIRED_RESULT bool startsWith(QChar c, Qt::CaseSensitivity cs) const noexcept
{ return QtPrivate::startsWith(*this, QStringView(&c, 1), cs); }
- Q_REQUIRED_RESULT bool endsWith(QStringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_DECL_NOTHROW
+ Q_REQUIRED_RESULT bool endsWith(QStringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept
{ return QtPrivate::endsWith(*this, s, cs); }
- Q_REQUIRED_RESULT inline bool endsWith(QLatin1String s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_DECL_NOTHROW;
- Q_REQUIRED_RESULT bool endsWith(QChar c) const Q_DECL_NOTHROW
+ Q_REQUIRED_RESULT inline bool endsWith(QLatin1String s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept;
+ Q_REQUIRED_RESULT bool endsWith(QChar c) const noexcept
{ return !empty() && back() == c; }
- Q_REQUIRED_RESULT bool endsWith(QChar c, Qt::CaseSensitivity cs) const Q_DECL_NOTHROW
+ Q_REQUIRED_RESULT bool endsWith(QChar c, Qt::CaseSensitivity cs) const noexcept
{ return QtPrivate::endsWith(*this, QStringView(&c, 1), cs); }
- Q_REQUIRED_RESULT bool isRightToLeft() const Q_DECL_NOTHROW
+ Q_REQUIRED_RESULT bool isRightToLeft() const noexcept
{ return QtPrivate::isRightToLeft(*this); }
Q_REQUIRED_RESULT Q_CORE_EXPORT int toWCharArray(wchar_t *array) const;
@@ -277,24 +277,24 @@ public:
//
// STL compatibility API:
//
- Q_REQUIRED_RESULT const_iterator begin() const Q_DECL_NOTHROW { return data(); }
- Q_REQUIRED_RESULT const_iterator end() const Q_DECL_NOTHROW { return data() + size(); }
- Q_REQUIRED_RESULT const_iterator cbegin() const Q_DECL_NOTHROW { return begin(); }
- Q_REQUIRED_RESULT const_iterator cend() const Q_DECL_NOTHROW { return end(); }
- Q_REQUIRED_RESULT const_reverse_iterator rbegin() const Q_DECL_NOTHROW { return const_reverse_iterator(end()); }
- Q_REQUIRED_RESULT const_reverse_iterator rend() const Q_DECL_NOTHROW { return const_reverse_iterator(begin()); }
- Q_REQUIRED_RESULT const_reverse_iterator crbegin() const Q_DECL_NOTHROW { return rbegin(); }
- Q_REQUIRED_RESULT const_reverse_iterator crend() const Q_DECL_NOTHROW { return rend(); }
-
- Q_REQUIRED_RESULT Q_DECL_CONSTEXPR bool empty() const Q_DECL_NOTHROW { return size() == 0; }
+ Q_REQUIRED_RESULT const_iterator begin() const noexcept { return data(); }
+ Q_REQUIRED_RESULT const_iterator end() const noexcept { return data() + size(); }
+ Q_REQUIRED_RESULT const_iterator cbegin() const noexcept { return begin(); }
+ Q_REQUIRED_RESULT const_iterator cend() const noexcept { return end(); }
+ Q_REQUIRED_RESULT const_reverse_iterator rbegin() const noexcept { return const_reverse_iterator(end()); }
+ Q_REQUIRED_RESULT const_reverse_iterator rend() const noexcept { return const_reverse_iterator(begin()); }
+ Q_REQUIRED_RESULT const_reverse_iterator crbegin() const noexcept { return rbegin(); }
+ Q_REQUIRED_RESULT const_reverse_iterator crend() const noexcept { return rend(); }
+
+ Q_REQUIRED_RESULT Q_DECL_CONSTEXPR bool empty() const noexcept { return size() == 0; }
Q_REQUIRED_RESULT Q_DECL_CONSTEXPR QChar front() const { return Q_ASSERT(!empty()), QChar(m_data[0]); }
Q_REQUIRED_RESULT Q_DECL_CONSTEXPR QChar back() const { return Q_ASSERT(!empty()), QChar(m_data[m_size - 1]); }
//
// Qt compatibility API:
//
- Q_REQUIRED_RESULT Q_DECL_CONSTEXPR bool isNull() const Q_DECL_NOTHROW { return !m_data; }
- Q_REQUIRED_RESULT Q_DECL_CONSTEXPR bool isEmpty() const Q_DECL_NOTHROW { return empty(); }
+ Q_REQUIRED_RESULT Q_DECL_CONSTEXPR bool isNull() const noexcept { return !m_data; }
+ Q_REQUIRED_RESULT Q_DECL_CONSTEXPR bool isEmpty() const noexcept { return empty(); }
Q_REQUIRED_RESULT Q_DECL_CONSTEXPR int length() const /* not nothrow! */
{ return Q_ASSERT(int(size()) == size()), int(size()); }
Q_REQUIRED_RESULT Q_DECL_CONSTEXPR QChar first() const { return front(); }
@@ -308,7 +308,7 @@ Q_DECLARE_TYPEINFO(QStringView, Q_PRIMITIVE_TYPE);
template <typename QStringLike, typename std::enable_if<
std::is_same<QStringLike, QString>::value || std::is_same<QStringLike, QStringRef>::value,
bool>::type = true>
-inline QStringView qToStringViewIgnoringNull(const QStringLike &s) Q_DECL_NOTHROW
+inline QStringView qToStringViewIgnoringNull(const QStringLike &s) noexcept
{ return QStringView(s.data(), s.size()); }
QT_END_NAMESPACE
diff --git a/src/corelib/tools/qtimezone.cpp b/src/corelib/tools/qtimezone.cpp
index cbc6b50c98..ef323de14a 100644
--- a/src/corelib/tools/qtimezone.cpp
+++ b/src/corelib/tools/qtimezone.cpp
@@ -317,7 +317,7 @@ Q_GLOBAL_STATIC(QTimeZoneSingleton, global_tz);
Create a null/invalid time zone instance.
*/
-QTimeZone::QTimeZone() Q_DECL_NOTHROW
+QTimeZone::QTimeZone() noexcept
: d(0)
{
}
diff --git a/src/corelib/tools/qtimezone.h b/src/corelib/tools/qtimezone.h
index 29d8a4dbe5..ca98986ec1 100644
--- a/src/corelib/tools/qtimezone.h
+++ b/src/corelib/tools/qtimezone.h
@@ -89,7 +89,7 @@ public:
};
typedef QVector<OffsetData> OffsetDataList;
- QTimeZone() Q_DECL_NOTHROW;
+ QTimeZone() noexcept;
explicit QTimeZone(const QByteArray &ianaId);
explicit QTimeZone(int offsetSeconds);
/*implicit*/ QTimeZone(const QByteArray &zoneId, int offsetSeconds, const QString &name,
@@ -100,10 +100,10 @@ public:
QTimeZone &operator=(const QTimeZone &other);
#ifdef Q_COMPILER_RVALUE_REFS
- QTimeZone &operator=(QTimeZone &&other) Q_DECL_NOTHROW { swap(other); return *this; }
+ QTimeZone &operator=(QTimeZone &&other) noexcept { swap(other); return *this; }
#endif
- void swap(QTimeZone &other) Q_DECL_NOTHROW
+ void swap(QTimeZone &other) noexcept
{ d.swap(other.d); }
bool operator==(const QTimeZone &other) const;
diff --git a/src/corelib/tools/qtimezoneprivate_p.h b/src/corelib/tools/qtimezoneprivate_p.h
index c9a5726216..b5e9286f6a 100644
--- a/src/corelib/tools/qtimezoneprivate_p.h
+++ b/src/corelib/tools/qtimezoneprivate_p.h
@@ -282,9 +282,9 @@ struct QTzTransitionRule
quint8 abbreviationIndex;
};
Q_DECLARE_TYPEINFO(QTzTransitionRule, Q_PRIMITIVE_TYPE);
-Q_DECL_CONSTEXPR inline bool operator==(const QTzTransitionRule &lhs, const QTzTransitionRule &rhs) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline bool operator==(const QTzTransitionRule &lhs, const QTzTransitionRule &rhs) noexcept
{ return lhs.stdOffset == rhs.stdOffset && lhs.dstOffset == rhs.dstOffset && lhs.abbreviationIndex == rhs.abbreviationIndex; }
-Q_DECL_CONSTEXPR inline bool operator!=(const QTzTransitionRule &lhs, const QTzTransitionRule &rhs) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline bool operator!=(const QTzTransitionRule &lhs, const QTzTransitionRule &rhs) noexcept
{ return !operator==(lhs, rhs); }
class Q_AUTOTEST_EXPORT QTzTimeZonePrivate final : public QTimeZonePrivate
@@ -331,6 +331,7 @@ public:
private:
void init(const QByteArray &ianaId);
+ QVector<QTimeZonePrivate::Data> getPosixTransitions(qint64 msNear) const;
Data dataForTzTransition(QTzTransitionTime tran) const;
QVector<QTzTransitionTime> m_tranTimes;
diff --git a/src/corelib/tools/qtimezoneprivate_tz.cpp b/src/corelib/tools/qtimezoneprivate_tz.cpp
index bed62a02bd..6105c93a23 100644
--- a/src/corelib/tools/qtimezoneprivate_tz.cpp
+++ b/src/corelib/tools/qtimezoneprivate_tz.cpp
@@ -467,7 +467,7 @@ struct PosixZone
static PosixZone invalid() { return {QString(), InvalidOffset}; }
static PosixZone parse(const char *&pos, const char *end);
- bool hasValidOffset() const Q_DECL_NOTHROW { return offset != InvalidOffset; }
+ bool hasValidOffset() const noexcept { return offset != InvalidOffset; }
};
} // unnamed namespace
@@ -943,19 +943,21 @@ QTimeZonePrivate::Data QTzTimeZonePrivate::dataForTzTransition(QTzTransitionTime
return data;
}
-QTimeZonePrivate::Data QTzTimeZonePrivate::data(qint64 forMSecsSinceEpoch) const
+QVector<QTimeZonePrivate::Data> QTzTimeZonePrivate::getPosixTransitions(qint64 msNear) const
{
- // If we have no rules (so probably an invalid tz), return invalid data:
- if (!m_tranTimes.size())
- return invalidData();
+ const int year = QDateTime::fromMSecsSinceEpoch(msNear, Qt::UTC).date().year();
+ // The Data::atMSecsSinceEpoch of the single entry if zone is constant:
+ qint64 atTime = m_tranTimes.isEmpty() ? msNear : m_tranTimes.last().atMSecsSinceEpoch;
+ return calculatePosixTransitions(m_posixRule, year - 1, year + 1, atTime);
+}
- // If the required time is after the last transition and we have a POSIX rule then use it
- if (m_tranTimes.last().atMSecsSinceEpoch < forMSecsSinceEpoch
+QTimeZonePrivate::Data QTzTimeZonePrivate::data(qint64 forMSecsSinceEpoch) const
+{
+ // If the required time is after the last transition (or there were none)
+ // and we have a POSIX rule then use it:
+ if ((m_tranTimes.isEmpty() || m_tranTimes.last().atMSecsSinceEpoch < forMSecsSinceEpoch)
&& !m_posixRule.isEmpty() && forMSecsSinceEpoch >= 0) {
- const int year = QDateTime::fromMSecsSinceEpoch(forMSecsSinceEpoch, Qt::UTC).date().year();
- QVector<QTimeZonePrivate::Data> posixTrans =
- calculatePosixTransitions(m_posixRule, year - 1, year + 1,
- m_tranTimes.last().atMSecsSinceEpoch);
+ QVector<QTimeZonePrivate::Data> posixTrans = getPosixTransitions(forMSecsSinceEpoch);
auto it = std::partition_point(posixTrans.cbegin(), posixTrans.cend(),
[forMSecsSinceEpoch] (const QTimeZonePrivate::Data &at) {
return at.atMSecsSinceEpoch <= forMSecsSinceEpoch;
@@ -986,13 +988,11 @@ bool QTzTimeZonePrivate::hasTransitions() const
QTimeZonePrivate::Data QTzTimeZonePrivate::nextTransition(qint64 afterMSecsSinceEpoch) const
{
- // If the required time is after the last transition and we have a POSIX rule then use it
- if (m_tranTimes.size() > 0 && m_tranTimes.last().atMSecsSinceEpoch < afterMSecsSinceEpoch
+ // If the required time is after the last transition (or there were none)
+ // and we have a POSIX rule then use it:
+ if ((m_tranTimes.isEmpty() || m_tranTimes.last().atMSecsSinceEpoch < afterMSecsSinceEpoch)
&& !m_posixRule.isEmpty() && afterMSecsSinceEpoch >= 0) {
- const int year = QDateTime::fromMSecsSinceEpoch(afterMSecsSinceEpoch, Qt::UTC).date().year();
- QVector<QTimeZonePrivate::Data> posixTrans =
- calculatePosixTransitions(m_posixRule, year - 1, year + 1,
- m_tranTimes.last().atMSecsSinceEpoch);
+ QVector<QTimeZonePrivate::Data> posixTrans = getPosixTransitions(afterMSecsSinceEpoch);
auto it = std::partition_point(posixTrans.cbegin(), posixTrans.cend(),
[afterMSecsSinceEpoch] (const QTimeZonePrivate::Data &at) {
return at.atMSecsSinceEpoch <= afterMSecsSinceEpoch;
@@ -1011,19 +1011,19 @@ QTimeZonePrivate::Data QTzTimeZonePrivate::nextTransition(qint64 afterMSecsSince
QTimeZonePrivate::Data QTzTimeZonePrivate::previousTransition(qint64 beforeMSecsSinceEpoch) const
{
- // If the required time is after the last transition and we have a POSIX rule then use it
- if (m_tranTimes.size() > 0 && m_tranTimes.last().atMSecsSinceEpoch < beforeMSecsSinceEpoch
+ // If the required time is after the last transition (or there were none)
+ // and we have a POSIX rule then use it:
+ if ((m_tranTimes.isEmpty() || m_tranTimes.last().atMSecsSinceEpoch < beforeMSecsSinceEpoch)
&& !m_posixRule.isEmpty() && beforeMSecsSinceEpoch > 0) {
- const int year = QDateTime::fromMSecsSinceEpoch(beforeMSecsSinceEpoch, Qt::UTC).date().year();
- QVector<QTimeZonePrivate::Data> posixTrans =
- calculatePosixTransitions(m_posixRule, year - 1, year + 1,
- m_tranTimes.last().atMSecsSinceEpoch);
+ QVector<QTimeZonePrivate::Data> posixTrans = getPosixTransitions(beforeMSecsSinceEpoch);
auto it = std::partition_point(posixTrans.cbegin(), posixTrans.cend(),
[beforeMSecsSinceEpoch] (const QTimeZonePrivate::Data &at) {
return at.atMSecsSinceEpoch < beforeMSecsSinceEpoch;
});
- Q_ASSERT(it > posixTrans.cbegin());
- return *--it;
+ if (it > posixTrans.cbegin())
+ return *--it;
+ // It fell between the last transition (if any) and the first of the POSIX rule:
+ return m_tranTimes.isEmpty() ? invalidData() : dataForTzTransition(m_tranTimes.last());
}
// Otherwise if we can find a valid tran then use its rule
diff --git a/src/corelib/tools/qtools_p.h b/src/corelib/tools/qtools_p.h
index 17d2ab852a..b239987871 100644
--- a/src/corelib/tools/qtools_p.h
+++ b/src/corelib/tools/qtools_p.h
@@ -57,17 +57,17 @@
QT_BEGIN_NAMESPACE
namespace QtMiscUtils {
-Q_DECL_CONSTEXPR inline char toHexUpper(uint value) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline char toHexUpper(uint value) noexcept
{
return "0123456789ABCDEF"[value & 0xF];
}
-Q_DECL_CONSTEXPR inline char toHexLower(uint value) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline char toHexLower(uint value) noexcept
{
return "0123456789abcdef"[value & 0xF];
}
-Q_DECL_CONSTEXPR inline int fromHex(uint c) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline int fromHex(uint c) noexcept
{
return ((c >= '0') && (c <= '9')) ? int(c - '0') :
((c >= 'A') && (c <= 'F')) ? int(c - 'A' + 10) :
@@ -75,12 +75,12 @@ Q_DECL_CONSTEXPR inline int fromHex(uint c) Q_DECL_NOTHROW
/* otherwise */ -1;
}
-Q_DECL_CONSTEXPR inline char toOct(uint value) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline char toOct(uint value) noexcept
{
return '0' + char(value & 0x7);
}
-Q_DECL_CONSTEXPR inline int fromOct(uint c) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline int fromOct(uint c) noexcept
{
return ((c >= '0') && (c <= '7')) ? int(c - '0') : -1;
}
@@ -98,9 +98,9 @@ struct CalculateGrowingBlockSizeResult {
// implemented in qbytearray.cpp
size_t Q_CORE_EXPORT Q_DECL_CONST_FUNCTION
-qCalculateBlockSize(size_t elementCount, size_t elementSize, size_t headerSize = 0) Q_DECL_NOTHROW;
+qCalculateBlockSize(size_t elementCount, size_t elementSize, size_t headerSize = 0) noexcept;
CalculateGrowingBlockSizeResult Q_CORE_EXPORT Q_DECL_CONST_FUNCTION
-qCalculateGrowingBlockSize(size_t elementCount, size_t elementSize, size_t headerSize = 0) Q_DECL_NOTHROW ;
+qCalculateGrowingBlockSize(size_t elementCount, size_t elementSize, size_t headerSize = 0) noexcept ;
QT_END_NAMESPACE
diff --git a/src/corelib/tools/qunicodetables.cpp b/src/corelib/tools/qunicodetables.cpp
index 4c4821802d..d57b39ff1f 100644
--- a/src/corelib/tools/qunicodetables.cpp
+++ b/src/corelib/tools/qunicodetables.cpp
@@ -8803,42 +8803,42 @@ static const Properties uc_properties[] = {
{ 12, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 12, 0 }
};
-Q_DECL_CONST_FUNCTION static inline const Properties *qGetProp(uint ucs4) Q_DECL_NOTHROW
+Q_DECL_CONST_FUNCTION static inline const Properties *qGetProp(uint ucs4) noexcept
{
return uc_properties + GET_PROP_INDEX(ucs4);
}
-Q_DECL_CONST_FUNCTION static inline const Properties *qGetProp(ushort ucs2) Q_DECL_NOTHROW
+Q_DECL_CONST_FUNCTION static inline const Properties *qGetProp(ushort ucs2) noexcept
{
return uc_properties + GET_PROP_INDEX_UCS2(ucs2);
}
-Q_DECL_CONST_FUNCTION Q_CORE_EXPORT const Properties * QT_FASTCALL properties(uint ucs4) Q_DECL_NOTHROW
+Q_DECL_CONST_FUNCTION Q_CORE_EXPORT const Properties * QT_FASTCALL properties(uint ucs4) noexcept
{
return qGetProp(ucs4);
}
-Q_DECL_CONST_FUNCTION Q_CORE_EXPORT const Properties * QT_FASTCALL properties(ushort ucs2) Q_DECL_NOTHROW
+Q_DECL_CONST_FUNCTION Q_CORE_EXPORT const Properties * QT_FASTCALL properties(ushort ucs2) noexcept
{
return qGetProp(ucs2);
}
-Q_CORE_EXPORT GraphemeBreakClass QT_FASTCALL graphemeBreakClass(uint ucs4) Q_DECL_NOTHROW
+Q_CORE_EXPORT GraphemeBreakClass QT_FASTCALL graphemeBreakClass(uint ucs4) noexcept
{
return static_cast<GraphemeBreakClass>(qGetProp(ucs4)->graphemeBreakClass);
}
-Q_CORE_EXPORT WordBreakClass QT_FASTCALL wordBreakClass(uint ucs4) Q_DECL_NOTHROW
+Q_CORE_EXPORT WordBreakClass QT_FASTCALL wordBreakClass(uint ucs4) noexcept
{
return static_cast<WordBreakClass>(qGetProp(ucs4)->wordBreakClass);
}
-Q_CORE_EXPORT SentenceBreakClass QT_FASTCALL sentenceBreakClass(uint ucs4) Q_DECL_NOTHROW
+Q_CORE_EXPORT SentenceBreakClass QT_FASTCALL sentenceBreakClass(uint ucs4) noexcept
{
return static_cast<SentenceBreakClass>(qGetProp(ucs4)->sentenceBreakClass);
}
-Q_CORE_EXPORT LineBreakClass QT_FASTCALL lineBreakClass(uint ucs4) Q_DECL_NOTHROW
+Q_CORE_EXPORT LineBreakClass QT_FASTCALL lineBreakClass(uint ucs4) noexcept
{
return static_cast<LineBreakClass>(qGetProp(ucs4)->lineBreakClass);
}
diff --git a/src/corelib/tools/qunicodetables_p.h b/src/corelib/tools/qunicodetables_p.h
index 3f2e91a9b2..cb7a211cb6 100644
--- a/src/corelib/tools/qunicodetables_p.h
+++ b/src/corelib/tools/qunicodetables_p.h
@@ -93,8 +93,8 @@ struct Properties {
ushort script : 8;
};
-Q_CORE_EXPORT const Properties * QT_FASTCALL properties(uint ucs4) Q_DECL_NOTHROW;
-Q_CORE_EXPORT const Properties * QT_FASTCALL properties(ushort ucs2) Q_DECL_NOTHROW;
+Q_CORE_EXPORT const Properties * QT_FASTCALL properties(uint ucs4) noexcept;
+Q_CORE_EXPORT const Properties * QT_FASTCALL properties(ushort ucs2) noexcept;
struct LowercaseTraits
{
@@ -209,20 +209,20 @@ enum LineBreakClass {
NumLineBreakClasses
};
-Q_CORE_EXPORT GraphemeBreakClass QT_FASTCALL graphemeBreakClass(uint ucs4) Q_DECL_NOTHROW;
-inline GraphemeBreakClass graphemeBreakClass(QChar ch) Q_DECL_NOTHROW
+Q_CORE_EXPORT GraphemeBreakClass QT_FASTCALL graphemeBreakClass(uint ucs4) noexcept;
+inline GraphemeBreakClass graphemeBreakClass(QChar ch) noexcept
{ return graphemeBreakClass(ch.unicode()); }
-Q_CORE_EXPORT WordBreakClass QT_FASTCALL wordBreakClass(uint ucs4) Q_DECL_NOTHROW;
-inline WordBreakClass wordBreakClass(QChar ch) Q_DECL_NOTHROW
+Q_CORE_EXPORT WordBreakClass QT_FASTCALL wordBreakClass(uint ucs4) noexcept;
+inline WordBreakClass wordBreakClass(QChar ch) noexcept
{ return wordBreakClass(ch.unicode()); }
-Q_CORE_EXPORT SentenceBreakClass QT_FASTCALL sentenceBreakClass(uint ucs4) Q_DECL_NOTHROW;
-inline SentenceBreakClass sentenceBreakClass(QChar ch) Q_DECL_NOTHROW
+Q_CORE_EXPORT SentenceBreakClass QT_FASTCALL sentenceBreakClass(uint ucs4) noexcept;
+inline SentenceBreakClass sentenceBreakClass(QChar ch) noexcept
{ return sentenceBreakClass(ch.unicode()); }
-Q_CORE_EXPORT LineBreakClass QT_FASTCALL lineBreakClass(uint ucs4) Q_DECL_NOTHROW;
-inline LineBreakClass lineBreakClass(QChar ch) Q_DECL_NOTHROW
+Q_CORE_EXPORT LineBreakClass QT_FASTCALL lineBreakClass(uint ucs4) noexcept;
+inline LineBreakClass lineBreakClass(QChar ch) noexcept
{ return lineBreakClass(ch.unicode()); }
} // namespace QUnicodeTables
diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h
index a51b37d02d..8aa78ccb1e 100644
--- a/src/corelib/tools/qvector.h
+++ b/src/corelib/tools/qvector.h
@@ -65,18 +65,18 @@ class QVector
Data *d;
public:
- inline QVector() Q_DECL_NOTHROW : d(Data::sharedNull()) { }
+ inline QVector() noexcept : d(Data::sharedNull()) { }
explicit QVector(int size);
QVector(int size, const T &t);
inline QVector(const QVector<T> &v);
inline ~QVector() { if (!d->ref.deref()) freeData(d); }
QVector<T> &operator=(const QVector<T> &v);
#if defined(Q_COMPILER_RVALUE_REFS) || defined(Q_CLANG_QDOC)
- QVector(QVector<T> &&other) Q_DECL_NOTHROW : d(other.d) { other.d = Data::sharedNull(); }
- QVector<T> &operator=(QVector<T> &&other) Q_DECL_NOTHROW
+ QVector(QVector<T> &&other) noexcept : d(other.d) { other.d = Data::sharedNull(); }
+ QVector<T> &operator=(QVector<T> &&other) noexcept
{ QVector moved(std::move(other)); swap(moved); return *this; }
#endif
- void swap(QVector<T> &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+ void swap(QVector<T> &other) noexcept { qSwap(d, other.d); }
#ifdef Q_COMPILER_INITIALIZER_LISTS
inline QVector(std::initializer_list<T> args);
QVector<T> &operator=(std::initializer_list<T> args);
@@ -209,29 +209,29 @@ public:
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
#if !defined(QT_STRICT_ITERATORS) || defined(Q_CLANG_QDOC)
inline iterator begin() { detach(); return d->begin(); }
- inline const_iterator begin() const Q_DECL_NOTHROW { return d->constBegin(); }
- inline const_iterator cbegin() const Q_DECL_NOTHROW { return d->constBegin(); }
- inline const_iterator constBegin() const Q_DECL_NOTHROW { return d->constBegin(); }
+ inline const_iterator begin() const noexcept { return d->constBegin(); }
+ inline const_iterator cbegin() const noexcept { return d->constBegin(); }
+ inline const_iterator constBegin() const noexcept { return d->constBegin(); }
inline iterator end() { detach(); return d->end(); }
- inline const_iterator end() const Q_DECL_NOTHROW { return d->constEnd(); }
- inline const_iterator cend() const Q_DECL_NOTHROW { return d->constEnd(); }
- inline const_iterator constEnd() const Q_DECL_NOTHROW { return d->constEnd(); }
+ inline const_iterator end() const noexcept { return d->constEnd(); }
+ inline const_iterator cend() const noexcept { return d->constEnd(); }
+ inline const_iterator constEnd() const noexcept { return d->constEnd(); }
#else
inline iterator begin(iterator = iterator()) { detach(); return d->begin(); }
- inline const_iterator begin(const_iterator = const_iterator()) const Q_DECL_NOTHROW { return d->constBegin(); }
- inline const_iterator cbegin(const_iterator = const_iterator()) const Q_DECL_NOTHROW { return d->constBegin(); }
- inline const_iterator constBegin(const_iterator = const_iterator()) const Q_DECL_NOTHROW { return d->constBegin(); }
+ inline const_iterator begin(const_iterator = const_iterator()) const noexcept { return d->constBegin(); }
+ inline const_iterator cbegin(const_iterator = const_iterator()) const noexcept { return d->constBegin(); }
+ inline const_iterator constBegin(const_iterator = const_iterator()) const noexcept { return d->constBegin(); }
inline iterator end(iterator = iterator()) { detach(); return d->end(); }
- inline const_iterator end(const_iterator = const_iterator()) const Q_DECL_NOTHROW { return d->constEnd(); }
- inline const_iterator cend(const_iterator = const_iterator()) const Q_DECL_NOTHROW { return d->constEnd(); }
- inline const_iterator constEnd(const_iterator = const_iterator()) const Q_DECL_NOTHROW { return d->constEnd(); }
+ inline const_iterator end(const_iterator = const_iterator()) const noexcept { return d->constEnd(); }
+ inline const_iterator cend(const_iterator = const_iterator()) const noexcept { return d->constEnd(); }
+ inline const_iterator constEnd(const_iterator = const_iterator()) const noexcept { return d->constEnd(); }
#endif
reverse_iterator rbegin() { return reverse_iterator(end()); }
reverse_iterator rend() { return reverse_iterator(begin()); }
- const_reverse_iterator rbegin() const Q_DECL_NOTHROW { return const_reverse_iterator(end()); }
- const_reverse_iterator rend() const Q_DECL_NOTHROW { return const_reverse_iterator(begin()); }
- const_reverse_iterator crbegin() const Q_DECL_NOTHROW { return const_reverse_iterator(end()); }
- const_reverse_iterator crend() const Q_DECL_NOTHROW { return const_reverse_iterator(begin()); }
+ const_reverse_iterator rbegin() const noexcept { return const_reverse_iterator(end()); }
+ const_reverse_iterator rend() const noexcept { return const_reverse_iterator(begin()); }
+ const_reverse_iterator crbegin() const noexcept { return const_reverse_iterator(end()); }
+ const_reverse_iterator crend() const noexcept { return const_reverse_iterator(begin()); }
iterator insert(iterator before, int n, const T &x);
inline iterator insert(iterator before, const T &x) { return insert(before, 1, x); }
inline iterator insert(iterator before, T &&x);
diff --git a/src/corelib/tools/qversionnumber.cpp b/src/corelib/tools/qversionnumber.cpp
index b96e48252e..6fcb9f50e9 100644
--- a/src/corelib/tools/qversionnumber.cpp
+++ b/src/corelib/tools/qversionnumber.cpp
@@ -235,7 +235,7 @@ QVersionNumber QVersionNumber::normalized() const
\sa commonPrefix()
*/
-bool QVersionNumber::isPrefixOf(const QVersionNumber &other) const Q_DECL_NOTHROW
+bool QVersionNumber::isPrefixOf(const QVersionNumber &other) const noexcept
{
if (segmentCount() > other.segmentCount())
return false;
@@ -259,7 +259,7 @@ bool QVersionNumber::isPrefixOf(const QVersionNumber &other) const Q_DECL_NOTHRO
\snippet qversionnumber/main.cpp 1
*/
-int QVersionNumber::compare(const QVersionNumber &v1, const QVersionNumber &v2) Q_DECL_NOTHROW
+int QVersionNumber::compare(const QVersionNumber &v1, const QVersionNumber &v2) noexcept
{
int commonlen;
diff --git a/src/corelib/tools/qversionnumber.h b/src/corelib/tools/qversionnumber.h
index 1bfb4aab39..d51947c091 100644
--- a/src/corelib/tools/qversionnumber.h
+++ b/src/corelib/tools/qversionnumber.h
@@ -87,7 +87,7 @@ class QVersionNumber
};
// set the InlineSegmentMarker and set length to zero
- SegmentStorage() Q_DECL_NOTHROW : dummy(1) {}
+ SegmentStorage() noexcept : dummy(1) {}
SegmentStorage(const QVector<int> &seg)
{
@@ -120,13 +120,13 @@ class QVersionNumber
}
#ifdef Q_COMPILER_RVALUE_REFS
- SegmentStorage(SegmentStorage &&other) Q_DECL_NOTHROW
+ SegmentStorage(SegmentStorage &&other) noexcept
: dummy(other.dummy)
{
other.dummy = 1;
}
- SegmentStorage &operator=(SegmentStorage &&other) Q_DECL_NOTHROW
+ SegmentStorage &operator=(SegmentStorage &&other) noexcept
{
qSwap(dummy, other.dummy);
return *this;
@@ -153,10 +153,10 @@ class QVersionNumber
~SegmentStorage() { if (isUsingPointer()) delete pointer_segments; }
- bool isUsingPointer() const Q_DECL_NOTHROW
+ bool isUsingPointer() const noexcept
{ return (inline_segments[InlineSegmentMarker] & 1) == 0; }
- int size() const Q_DECL_NOTHROW
+ int size() const noexcept
{ return isUsingPointer() ? pointer_segments->size() : (inline_segments[InlineSegmentMarker] >> 1); }
void setInlineSize(int len)
@@ -218,7 +218,7 @@ class QVersionNumber
} m_segments;
public:
- inline QVersionNumber() Q_DECL_NOTHROW
+ inline QVersionNumber() noexcept
: m_segments()
{}
inline explicit QVersionNumber(const QVector<int> &seg)
@@ -248,34 +248,34 @@ public:
inline explicit QVersionNumber(int maj, int min, int mic)
{ m_segments.setSegments(3, maj, min, mic); }
- Q_REQUIRED_RESULT inline bool isNull() const Q_DECL_NOTHROW
+ Q_REQUIRED_RESULT inline bool isNull() const noexcept
{ return segmentCount() == 0; }
- Q_REQUIRED_RESULT inline bool isNormalized() const Q_DECL_NOTHROW
+ Q_REQUIRED_RESULT inline bool isNormalized() const noexcept
{ return isNull() || segmentAt(segmentCount() - 1) != 0; }
- Q_REQUIRED_RESULT inline int majorVersion() const Q_DECL_NOTHROW
+ Q_REQUIRED_RESULT inline int majorVersion() const noexcept
{ return segmentAt(0); }
- Q_REQUIRED_RESULT inline int minorVersion() const Q_DECL_NOTHROW
+ Q_REQUIRED_RESULT inline int minorVersion() const noexcept
{ return segmentAt(1); }
- Q_REQUIRED_RESULT inline int microVersion() const Q_DECL_NOTHROW
+ Q_REQUIRED_RESULT inline int microVersion() const noexcept
{ return segmentAt(2); }
Q_REQUIRED_RESULT Q_CORE_EXPORT QVersionNumber normalized() const;
Q_REQUIRED_RESULT Q_CORE_EXPORT QVector<int> segments() const;
- Q_REQUIRED_RESULT inline int segmentAt(int index) const Q_DECL_NOTHROW
+ Q_REQUIRED_RESULT inline int segmentAt(int index) const noexcept
{ return (m_segments.size() > index) ? m_segments.at(index) : 0; }
- Q_REQUIRED_RESULT inline int segmentCount() const Q_DECL_NOTHROW
+ Q_REQUIRED_RESULT inline int segmentCount() const noexcept
{ return m_segments.size(); }
- Q_REQUIRED_RESULT Q_CORE_EXPORT bool isPrefixOf(const QVersionNumber &other) const Q_DECL_NOTHROW;
+ Q_REQUIRED_RESULT Q_CORE_EXPORT bool isPrefixOf(const QVersionNumber &other) const noexcept;
- Q_REQUIRED_RESULT Q_CORE_EXPORT static int compare(const QVersionNumber &v1, const QVersionNumber &v2) Q_DECL_NOTHROW;
+ Q_REQUIRED_RESULT Q_CORE_EXPORT static int compare(const QVersionNumber &v1, const QVersionNumber &v2) noexcept;
Q_REQUIRED_RESULT Q_CORE_EXPORT static Q_DECL_PURE_FUNCTION QVersionNumber commonPrefix(const QVersionNumber &v1, const QVersionNumber &v2);
@@ -299,22 +299,22 @@ Q_DECLARE_TYPEINFO(QVersionNumber, Q_MOVABLE_TYPE);
Q_CORE_EXPORT QDebug operator<<(QDebug, const QVersionNumber &version);
#endif
-Q_REQUIRED_RESULT inline bool operator> (const QVersionNumber &lhs, const QVersionNumber &rhs) Q_DECL_NOTHROW
+Q_REQUIRED_RESULT inline bool operator> (const QVersionNumber &lhs, const QVersionNumber &rhs) noexcept
{ return QVersionNumber::compare(lhs, rhs) > 0; }
-Q_REQUIRED_RESULT inline bool operator>=(const QVersionNumber &lhs, const QVersionNumber &rhs) Q_DECL_NOTHROW
+Q_REQUIRED_RESULT inline bool operator>=(const QVersionNumber &lhs, const QVersionNumber &rhs) noexcept
{ return QVersionNumber::compare(lhs, rhs) >= 0; }
-Q_REQUIRED_RESULT inline bool operator< (const QVersionNumber &lhs, const QVersionNumber &rhs) Q_DECL_NOTHROW
+Q_REQUIRED_RESULT inline bool operator< (const QVersionNumber &lhs, const QVersionNumber &rhs) noexcept
{ return QVersionNumber::compare(lhs, rhs) < 0; }
-Q_REQUIRED_RESULT inline bool operator<=(const QVersionNumber &lhs, const QVersionNumber &rhs) Q_DECL_NOTHROW
+Q_REQUIRED_RESULT inline bool operator<=(const QVersionNumber &lhs, const QVersionNumber &rhs) noexcept
{ return QVersionNumber::compare(lhs, rhs) <= 0; }
-Q_REQUIRED_RESULT inline bool operator==(const QVersionNumber &lhs, const QVersionNumber &rhs) Q_DECL_NOTHROW
+Q_REQUIRED_RESULT inline bool operator==(const QVersionNumber &lhs, const QVersionNumber &rhs) noexcept
{ return QVersionNumber::compare(lhs, rhs) == 0; }
-Q_REQUIRED_RESULT inline bool operator!=(const QVersionNumber &lhs, const QVersionNumber &rhs) Q_DECL_NOTHROW
+Q_REQUIRED_RESULT inline bool operator!=(const QVersionNumber &lhs, const QVersionNumber &rhs) noexcept
{ return QVersionNumber::compare(lhs, rhs) != 0; }
QT_END_NAMESPACE
diff --git a/src/dbus/qdbusabstractinterface.cpp b/src/dbus/qdbusabstractinterface.cpp
index 148bd54147..d49959d8e2 100644
--- a/src/dbus/qdbusabstractinterface.cpp
+++ b/src/dbus/qdbusabstractinterface.cpp
@@ -66,11 +66,11 @@ namespace {
// of to QDBusAbstractInterface::customEvent.
// See solution in Patch Set 1 of this change in the Qt Gerrit servers.
// (https://codereview.qt-project.org/#/c/126384/1)
-class DisconnectRelayEvent : public QMetaCallEvent
+class DisconnectRelayEvent : public QAbstractMetaCallEvent
{
public:
DisconnectRelayEvent(QObject *sender, const QMetaMethod &m)
- : QMetaCallEvent(0, 0, nullptr, sender, m.methodIndex())
+ : QAbstractMetaCallEvent(sender, m.methodIndex())
{}
void placeMetaCall(QObject *object) override
diff --git a/src/dbus/qdbusintegrator_p.h b/src/dbus/qdbusintegrator_p.h
index a6f7651c73..87db910d25 100644
--- a/src/dbus/qdbusintegrator_p.h
+++ b/src/dbus/qdbusintegrator_p.h
@@ -101,36 +101,37 @@ struct QDBusSlotCache
Q_DECLARE_SHARED(QDBusSlotCache::Data)
Q_DECLARE_SHARED(QDBusSlotCache)
-class QDBusCallDeliveryEvent: public QMetaCallEvent
+class QDBusCallDeliveryEvent: public QAbstractMetaCallEvent
{
public:
QDBusCallDeliveryEvent(const QDBusConnection &c, int id, QObject *sender,
const QDBusMessage &msg, const QVector<int> &types, int f = 0)
- : QMetaCallEvent(0, id, nullptr, sender, -1), connection(c), message(msg), metaTypes(types), flags(f)
+ : QAbstractMetaCallEvent(sender, -1), connection(c), message(msg), metaTypes(types), id(id), flags(f)
{ }
void placeMetaCall(QObject *object) override
{
- QDBusConnectionPrivate::d(connection)->deliverCall(object, flags, message, metaTypes, id());
+ QDBusConnectionPrivate::d(connection)->deliverCall(object, flags, message, metaTypes, id);
}
private:
QDBusConnection connection; // just for refcounting
QDBusMessage message;
QVector<int> metaTypes;
+ int id;
int flags;
};
-class QDBusActivateObjectEvent: public QMetaCallEvent
+class QDBusActivateObjectEvent: public QAbstractMetaCallEvent
{
public:
QDBusActivateObjectEvent(const QDBusConnection &c, QObject *sender,
const QDBusConnectionPrivate::ObjectTreeNode &n,
int p, const QDBusMessage &m, QSemaphore *s = nullptr)
- : QMetaCallEvent(0, ushort(-1), nullptr, sender, -1, 0, nullptr, nullptr, s), connection(c), node(n),
+ : QAbstractMetaCallEvent(sender, -1, s), connection(c), node(n),
pathStartPos(p), message(m), handled(false)
{ }
- ~QDBusActivateObjectEvent();
+ ~QDBusActivateObjectEvent() override;
void placeMetaCall(QObject *) override;
@@ -142,15 +143,15 @@ private:
bool handled;
};
-class QDBusSpyCallEvent : public QMetaCallEvent
+class QDBusSpyCallEvent : public QAbstractMetaCallEvent
{
public:
typedef void (*Hook)(const QDBusMessage&);
QDBusSpyCallEvent(QDBusConnectionPrivate *cp, const QDBusConnection &c, const QDBusMessage &msg,
const Hook *hooks, int count)
- : QMetaCallEvent(0, 0, nullptr, cp, 0), conn(c), msg(msg), hooks(hooks), hookCount(count)
+ : QAbstractMetaCallEvent(cp, 0), conn(c), msg(msg), hooks(hooks), hookCount(count)
{}
- ~QDBusSpyCallEvent();
+ ~QDBusSpyCallEvent() override;
void placeMetaCall(QObject *) override;
static inline void invokeSpyHooks(const QDBusMessage &msg, const Hook *hooks, int hookCount);
diff --git a/src/gui/image/qiconloader.cpp b/src/gui/image/qiconloader.cpp
index a9adde8c8d..1d0c93f26f 100644
--- a/src/gui/image/qiconloader.cpp
+++ b/src/gui/image/qiconloader.cpp
@@ -629,7 +629,10 @@ void QIconLoaderEngine::ensureLoaded()
void QIconLoaderEngine::paint(QPainter *painter, const QRect &rect,
QIcon::Mode mode, QIcon::State state)
{
- QSize pixmapSize = rect.size();
+ const qreal dpr = !qApp->testAttribute(Qt::AA_UseHighDpiPixmaps) ?
+ qreal(1.0) : painter->device()->devicePixelRatioF();
+
+ QSize pixmapSize = rect.size() * dpr;
painter->drawPixmap(rect, pixmap(pixmapSize, mode, state));
}
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp
index 18125460c7..8b2db6d346 100644
--- a/src/gui/image/qimage.cpp
+++ b/src/gui/image/qimage.cpp
@@ -127,7 +127,7 @@ QImageData * QImageData::create(const QSize &size, QImage::Format format)
int height = size.height();
int depth = qt_depthForFormat(format);
auto params = calculateImageParameters(width, height, depth);
- if (params.bytesPerLine < 0)
+ if (!params.isValid())
return nullptr;
QScopedPointer<QImageData> d(new QImageData);
@@ -786,7 +786,7 @@ QImageData *QImageData::create(uchar *data, int width, int height, int bpl, QIm
const int depth = qt_depthForFormat(format);
auto params = calculateImageParameters(width, height, depth);
- if (params.totalSize < 0)
+ if (!params.isValid())
return nullptr;
if (bpl > 0) {
@@ -1094,16 +1094,32 @@ void QImage::detach()
}
-static void copyMetadata(QImageData *dst, const QImageData *src)
+static void copyPhysicalMetadata(QImageData *dst, const QImageData *src)
{
- // Doesn't copy colortable and alpha_clut, or offset.
dst->dpmx = src->dpmx;
dst->dpmy = src->dpmy;
dst->devicePixelRatio = src->devicePixelRatio;
+}
+
+static void copyMetadata(QImageData *dst, const QImageData *src)
+{
+ // Doesn't copy colortable and alpha_clut, or offset.
+ copyPhysicalMetadata(dst, src);
dst->text = src->text;
dst->colorSpace = src->colorSpace;
}
+static void copyMetadata(QImage *dst, const QImage &src)
+{
+ dst->setDotsPerMeterX(src.dotsPerMeterX());
+ dst->setDotsPerMeterY(src.dotsPerMeterY());
+ dst->setDevicePixelRatio(src.devicePixelRatio());
+ const auto textKeys = src.textKeys();
+ for (const auto &key: textKeys)
+ dst->setText(key, src.text(key));
+
+}
+
/*!
\fn QImage QImage::copy(int x, int y, int width, int height) const
\overload
@@ -1492,10 +1508,17 @@ qsizetype QImage::sizeInBytes() const
\sa scanLine()
*/
+#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
+qsizetype QImage::bytesPerLine() const
+{
+ return d ? d->bytes_per_line : 0;
+}
+#else
int QImage::bytesPerLine() const
{
return d ? d->bytes_per_line : 0;
}
+#endif
/*!
@@ -2948,8 +2971,10 @@ QImage QImage::createAlphaMask(Qt::ImageConversionFlags flags) const
}
QImage mask(d->width, d->height, Format_MonoLSB);
- if (!mask.isNull())
+ if (!mask.isNull()) {
dither_to_Mono(mask.d, d, flags, true);
+ copyPhysicalMetadata(mask.d, d);
+ }
return mask;
}
@@ -3067,6 +3092,7 @@ QImage QImage::createHeuristicMask(bool clipTight) const
#undef PIX
+ copyPhysicalMetadata(m.d, d);
return m;
}
#endif //QT_NO_IMAGE_HEURISTIC_MASK
@@ -3110,6 +3136,8 @@ QImage QImage::createMaskFromColor(QRgb color, Qt::MaskMode mode) const
}
if (mode == Qt::MaskOutColor)
maskImage.invertPixels();
+
+ copyPhysicalMetadata(maskImage.d, d);
return maskImage;
}
@@ -4681,8 +4709,7 @@ QImage QImage::smoothScaled(int w, int h) const {
static QImage rotated90(const QImage &image)
{
QImage out(image.height(), image.width(), image.format());
- out.setDotsPerMeterX(image.dotsPerMeterY());
- out.setDotsPerMeterY(image.dotsPerMeterX());
+ copyMetadata(&out, image);
if (image.colorCount() > 0)
out.setColorTable(image.colorTable());
int w = image.width();
@@ -4710,8 +4737,7 @@ static QImage rotated180(const QImage &image)
return image.mirrored(true, true);
QImage out(image.width(), image.height(), image.format());
- out.setDotsPerMeterX(image.dotsPerMeterY());
- out.setDotsPerMeterY(image.dotsPerMeterX());
+ copyMetadata(&out, image);
if (image.colorCount() > 0)
out.setColorTable(image.colorTable());
int w = image.width();
@@ -4723,8 +4749,7 @@ static QImage rotated180(const QImage &image)
static QImage rotated270(const QImage &image)
{
QImage out(image.height(), image.width(), image.format());
- out.setDotsPerMeterX(image.dotsPerMeterY());
- out.setDotsPerMeterY(image.dotsPerMeterX());
+ copyMetadata(&out, image);
if (image.colorCount() > 0)
out.setColorTable(image.colorTable());
int w = image.width();
diff --git a/src/gui/image/qimage.h b/src/gui/image/qimage.h
index b09e69c839..af7e6988cb 100644
--- a/src/gui/image/qimage.h
+++ b/src/gui/image/qimage.h
@@ -228,7 +228,11 @@ public:
uchar *scanLine(int);
const uchar *scanLine(int) const;
const uchar *constScanLine(int) const;
+#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
+ qsizetype bytesPerLine() const;
+#else
int bytesPerLine() const;
+#endif
bool valid(int x, int y) const;
bool valid(const QPoint &pt) const;
diff --git a/src/gui/image/qimage_neon.cpp b/src/gui/image/qimage_neon.cpp
index 57a24edeca..9dbcb11db5 100644
--- a/src/gui/image/qimage_neon.cpp
+++ b/src/gui/image/qimage_neon.cpp
@@ -52,65 +52,41 @@ Q_GUI_EXPORT void QT_FASTCALL qt_convert_rgb888_to_rgb32_neon(quint32 *dst, cons
const quint32 *const end = dst + len;
- // align dst on 64 bits
- const int offsetToAlignOn8Bytes = (reinterpret_cast<quintptr>(dst) >> 2) & 0x1;
- for (int i = 0; i < offsetToAlignOn8Bytes; ++i) {
+ // align dst on 128 bits
+ const int offsetToAlignOn16Bytes = (reinterpret_cast<quintptr>(dst) >> 2) & 0x3;
+ for (int i = 0; i < offsetToAlignOn16Bytes; ++i) {
*dst++ = qRgb(src[0], src[1], src[2]);
src += 3;
}
- if ((len - offsetToAlignOn8Bytes) >= 8) {
- const quint32 *const simdEnd = end - 7;
-#if !defined(Q_PROCESSOR_ARM_64)
- register uint8x8_t fullVector asm ("d3") = vdup_n_u8(0xff);
- do {
+ if ((len - offsetToAlignOn16Bytes) >= 16) {
+ const quint32 *const simdEnd = end - 15;
+ uint8x16x4_t dstVector;
#if Q_BYTE_ORDER == Q_BIG_ENDIAN
- asm volatile (
- "vld3.8 { d4, d5, d6 }, [%[SRC]] !\n\t"
- "vst4.8 { d3, d4, d5, d6 }, [%[DST],:64] !\n\t"
- : [DST]"+r" (dst), [SRC]"+r" (src)
- : "w"(fullVector)
- : "memory", "d4", "d5", "d6"
- );
+ dstVector.val[0] = vdupq_n_u8(0xff);
#else
- asm volatile (
- "vld3.8 { d0, d1, d2 }, [%[SRC]] !\n\t"
- "vswp d0, d2\n\t"
- "vst4.8 { d0, d1, d2, d3 }, [%[DST],:64] !\n\t"
- : [DST]"+r" (dst), [SRC]"+r" (src)
- : "w"(fullVector)
- : "memory", "d0", "d1", "d2"
- );
+ dstVector.val[3] = vdupq_n_u8(0xff);
#endif
- } while (dst < simdEnd);
-#else
- register uint8x8_t fullVector asm ("v3") = vdup_n_u8(0xff);
do {
+ uint8x16x3_t srcVector = vld3q_u8(src);
+ src += 3 * 16;
#if Q_BYTE_ORDER == Q_BIG_ENDIAN
- asm volatile (
- "ld3 { v4.8b, v5.8b, v6.8b }, [%[SRC]], #24 \n\t"
- "st4 { v3.8b, v4.8b, v5.8b, v6.8b }, [%[DST]], #32 \n\t"
- : [DST]"+r" (dst), [SRC]"+r" (src)
- : "w"(fullVector)
- : "memory", "v4", "v5", "v6"
- );
+ dstVector.val[1] = srcVector.val[0];
+ dstVector.val[2] = srcVector.val[1];
+ dstVector.val[3] = srcVector.val[2];
#else
- asm volatile (
- "ld3 { v0.8b, v1.8b, v2.8b }, [%[SRC]], #24 \n\t"
- "mov v4.8b, v2.8b\n\t"
- "mov v2.8b, v0.8b\n\t"
- "mov v0.8b, v4.8b\n\t"
- "st4 { v0.8b, v1.8b, v2.8b, v3.8b }, [%[DST]], #32 \n\t"
- : [DST]"+r" (dst), [SRC]"+r" (src)
- : "w"(fullVector)
- : "memory", "v0", "v1", "v2", "v4"
- );
+ dstVector.val[0] = srcVector.val[2];
+ dstVector.val[1] = srcVector.val[1];
+ dstVector.val[2] = srcVector.val[0];
#endif
+ vst4q_u8(reinterpret_cast<uint8_t*>(dst), dstVector);
+ dst += 16;
} while (dst < simdEnd);
-#endif
}
- while (dst != end) {
+ int i = 0;
+ int length = end - dst;
+ SIMD_EPILOGUE(i, length, 15) {
*dst++ = qRgb(src[0], src[1], src[2]);
src += 3;
}
diff --git a/src/gui/image/qimage_p.h b/src/gui/image/qimage_p.h
index 1e0578a0f4..9da6acd0a7 100644
--- a/src/gui/image/qimage_p.h
+++ b/src/gui/image/qimage_p.h
@@ -113,6 +113,7 @@ struct Q_GUI_EXPORT QImageData { // internal image data
struct ImageSizeParameters {
qsizetype bytesPerLine;
qsizetype totalSize;
+ bool isValid() const { return bytesPerLine > 0 && totalSize > 0; }
};
static ImageSizeParameters calculateImageParameters(qsizetype width, qsizetype height, qsizetype depth);
};
@@ -139,6 +140,11 @@ QImageData::calculateImageParameters(qsizetype width, qsizetype height, qsizetyp
qsizetype dummy;
if (mul_overflow(height, qsizetype(sizeof(uchar *)), &dummy))
return invalid; // why is this here?
+#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
+ // Disallow images where width * depth calculations might overflow
+ if (width > (INT_MAX - 31) / depth)
+ return invalid;
+#endif
return { bytes_per_line, total_size };
}
diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp
index 2ef1d09422..5b4d218603 100644
--- a/src/gui/image/qpixmap.cpp
+++ b/src/gui/image/qpixmap.cpp
@@ -1552,6 +1552,11 @@ QPixmap QPixmap::fromImage(const QImage &image, Qt::ImageConversionFlags flags)
if (image.isNull())
return QPixmap();
+ if (Q_UNLIKELY(!qobject_cast<QGuiApplication *>(QCoreApplication::instance()))) {
+ qWarning("QPixmap::fromImage: QPixmap cannot be created without a QGuiApplication");
+ return QPixmap();
+ }
+
QScopedPointer<QPlatformPixmap> data(QGuiApplicationPrivate::platformIntegration()->createPlatformPixmap(QPlatformPixmap::PixmapType));
data->fromImage(image, flags);
return QPixmap(data.take());
@@ -1574,6 +1579,11 @@ QPixmap QPixmap::fromImageInPlace(QImage &image, Qt::ImageConversionFlags flags)
if (image.isNull())
return QPixmap();
+ if (Q_UNLIKELY(!qobject_cast<QGuiApplication *>(QCoreApplication::instance()))) {
+ qWarning("QPixmap::fromImageInPlace: QPixmap cannot be created without a QGuiApplication");
+ return QPixmap();
+ }
+
QScopedPointer<QPlatformPixmap> data(QGuiApplicationPrivate::platformIntegration()->createPlatformPixmap(QPlatformPixmap::PixmapType));
data->fromImageInPlace(image, flags);
return QPixmap(data.take());
@@ -1593,6 +1603,11 @@ QPixmap QPixmap::fromImageInPlace(QImage &image, Qt::ImageConversionFlags flags)
*/
QPixmap QPixmap::fromImageReader(QImageReader *imageReader, Qt::ImageConversionFlags flags)
{
+ if (Q_UNLIKELY(!qobject_cast<QGuiApplication *>(QCoreApplication::instance()))) {
+ qWarning("QPixmap::fromImageReader: QPixmap cannot be created without a QGuiApplication");
+ return QPixmap();
+ }
+
QScopedPointer<QPlatformPixmap> data(QGuiApplicationPrivate::platformIntegration()->createPlatformPixmap(QPlatformPixmap::PixmapType));
data->fromImageReader(imageReader, flags);
return QPixmap(data.take());
diff --git a/src/gui/image/qplatformpixmap.cpp b/src/gui/image/qplatformpixmap.cpp
index 2209c3de4d..a2e01147c4 100644
--- a/src/gui/image/qplatformpixmap.cpp
+++ b/src/gui/image/qplatformpixmap.cpp
@@ -178,6 +178,7 @@ QBitmap QPlatformPixmap::mask() const
if (mask.isNull()) // allocation failed
return QBitmap();
+ mask.setDevicePixelRatio(devicePixelRatio());
mask.setColorCount(2);
mask.setColor(0, QColor(Qt::color0).rgba());
mask.setColor(1, QColor(Qt::color1).rgba());
diff --git a/src/gui/kernel/qplatformgraphicsbuffer.h b/src/gui/kernel/qplatformgraphicsbuffer.h
index 65c24bebc9..9004116ea4 100644
--- a/src/gui/kernel/qplatformgraphicsbuffer.h
+++ b/src/gui/kernel/qplatformgraphicsbuffer.h
@@ -71,12 +71,14 @@ public:
TextureAccess = 0x04,
HWCompositor = 0x08
};
+ Q_ENUM(AccessType);
Q_DECLARE_FLAGS(AccessTypes, AccessType);
enum Origin {
OriginBottomLeft,
OriginTopLeft
};
+ Q_ENUM(Origin);
~QPlatformGraphicsBuffer();
diff --git a/src/gui/kernel/qplatformintegration.cpp b/src/gui/kernel/qplatformintegration.cpp
index 199ef0de07..490cfc6178 100644
--- a/src/gui/kernel/qplatformintegration.cpp
+++ b/src/gui/kernel/qplatformintegration.cpp
@@ -462,87 +462,6 @@ QList<int> QPlatformIntegration::possibleKeys(const QKeyEvent *) const
return QList<int>();
}
-/*!
- Should be called by the implementation whenever a new screen is added.
-
- The first screen added will be the primary screen, used for default-created
- windows, GL contexts, and other resources unless otherwise specified.
-
- This adds the screen to QGuiApplication::screens(), and emits the
- QGuiApplication::screenAdded() signal.
-
- The screen should be deleted by calling QPlatformIntegration::destroyScreen().
-*/
-void QPlatformIntegration::screenAdded(QPlatformScreen *ps, bool isPrimary)
-{
- QScreen *screen = new QScreen(ps);
-
- if (isPrimary) {
- QGuiApplicationPrivate::screen_list.prepend(screen);
- } else {
- QGuiApplicationPrivate::screen_list.append(screen);
- }
-
- QGuiApplicationPrivate::resetCachedDevicePixelRatio();
-
- emit qGuiApp->screenAdded(screen);
-
- if (isPrimary)
- emit qGuiApp->primaryScreenChanged(screen);
-}
-
-/*!
- Just removes the screen, call destroyScreen instead.
-
- \sa destroyScreen()
-*/
-
-void QPlatformIntegration::removeScreen(QScreen *screen)
-{
- const bool wasPrimary = (!QGuiApplicationPrivate::screen_list.isEmpty() && QGuiApplicationPrivate::screen_list.at(0) == screen);
- QGuiApplicationPrivate::screen_list.removeOne(screen);
-
- QGuiApplicationPrivate::resetCachedDevicePixelRatio();
-
- if (wasPrimary && qGuiApp && !QGuiApplicationPrivate::screen_list.isEmpty())
- emit qGuiApp->primaryScreenChanged(QGuiApplicationPrivate::screen_list.at(0));
-}
-
-/*!
- Should be called by the implementation whenever a screen is removed.
-
- This removes the screen from QGuiApplication::screens(), and deletes it.
-
- Failing to call this and manually deleting the QPlatformScreen instead may
- lead to a crash due to a pure virtual call.
-*/
-void QPlatformIntegration::destroyScreen(QPlatformScreen *screen)
-{
- QScreen *qScreen = screen->screen();
- removeScreen(qScreen);
- delete qScreen;
- delete screen;
-}
-
-/*!
- Should be called whenever the primary screen changes.
-
- When the screen specified as primary changes, this method will notify
- QGuiApplication and emit the QGuiApplication::primaryScreenChanged signal.
- */
-
-void QPlatformIntegration::setPrimaryScreen(QPlatformScreen *newPrimary)
-{
- QScreen* newPrimaryScreen = newPrimary->screen();
- int idx = QGuiApplicationPrivate::screen_list.indexOf(newPrimaryScreen);
- Q_ASSERT(idx >= 0);
- if (idx == 0)
- return;
-
- QGuiApplicationPrivate::screen_list.swapItemsAt(0, idx);
- emit qGuiApp->primaryScreenChanged(newPrimaryScreen);
-}
-
QStringList QPlatformIntegration::themeNames() const
{
return QStringList();
diff --git a/src/gui/kernel/qplatformintegration.h b/src/gui/kernel/qplatformintegration.h
index 8ece390420..b764bd2617 100644
--- a/src/gui/kernel/qplatformintegration.h
+++ b/src/gui/kernel/qplatformintegration.h
@@ -192,8 +192,6 @@ public:
#endif
virtual void setApplicationIcon(const QIcon &icon) const;
- void removeScreen(QScreen *screen);
-
virtual void beep() const;
#if QT_CONFIG(vulkan) || defined(Q_CLANG_QDOC)
@@ -202,10 +200,6 @@ public:
protected:
QPlatformIntegration() = default;
-
- void screenAdded(QPlatformScreen *screen, bool isPrimary = false);
- void destroyScreen(QPlatformScreen *screen);
- void setPrimaryScreen(QPlatformScreen *newPrimary);
};
QT_END_NAMESPACE
diff --git a/src/gui/kernel/qplatformscreen.cpp b/src/gui/kernel/qplatformscreen.cpp
index b7b312e89e..9c5876550a 100644
--- a/src/gui/kernel/qplatformscreen.cpp
+++ b/src/gui/kernel/qplatformscreen.cpp
@@ -61,8 +61,7 @@ QPlatformScreen::~QPlatformScreen()
{
Q_D(QPlatformScreen);
if (d->screen) {
- qWarning("Manually deleting a QPlatformScreen. Call QPlatformIntegration::destroyScreen instead.");
- QGuiApplicationPrivate::platformIntegration()->removeScreen(d->screen);
+ qWarning("Manually deleting a QPlatformScreen. Call QWindowSystemInterface::handleScreenRemoved instead.");
delete d->screen;
}
}
diff --git a/src/gui/kernel/qplatformwindow.cpp b/src/gui/kernel/qplatformwindow.cpp
index d6f90c9254..562289a8c9 100644
--- a/src/gui/kernel/qplatformwindow.cpp
+++ b/src/gui/kernel/qplatformwindow.cpp
@@ -708,10 +708,11 @@ QRect QPlatformWindow::initialGeometry(const QWindow *w,
const QScreen *screen = effectiveScreen(w);
if (!screen)
return initialGeometry;
+ const auto *wp = qt_window_private(const_cast<QWindow*>(w));
QRect rect(QHighDpi::fromNativePixels(initialGeometry, w));
- rect.setSize(fixInitialSize(rect.size(), w, defaultWidth, defaultHeight));
- if (qt_window_private(const_cast<QWindow*>(w))->positionAutomatic
- && w->type() != Qt::Popup) {
+ if (wp->resizeAutomatic)
+ rect.setSize(fixInitialSize(rect.size(), w, defaultWidth, defaultHeight));
+ if (wp->positionAutomatic && w->type() != Qt::Popup) {
const QRect availableGeometry = screen->availableGeometry();
// Center unless the geometry ( + unknown window frame) is too large for the screen).
if (rect.height() < (availableGeometry.height() * 8) / 9
diff --git a/src/gui/kernel/qscreen.cpp b/src/gui/kernel/qscreen.cpp
index f208eb02be..952023dd1b 100644
--- a/src/gui/kernel/qscreen.cpp
+++ b/src/gui/kernel/qscreen.cpp
@@ -106,9 +106,18 @@ void QScreenPrivate::setPlatformScreen(QPlatformScreen *screen)
*/
QScreen::~QScreen()
{
- if (!qApp)
+ // Remove screen
+ const bool wasPrimary = QGuiApplication::primaryScreen() == this;
+ QGuiApplicationPrivate::screen_list.removeOne(this);
+ QGuiApplicationPrivate::resetCachedDevicePixelRatio();
+
+ if (!qGuiApp)
return;
+ QScreen *newPrimaryScreen = QGuiApplication::primaryScreen();
+ if (wasPrimary && newPrimaryScreen)
+ emit qGuiApp->primaryScreenChanged(newPrimaryScreen);
+
// Allow clients to manage windows that are affected by the screen going
// away, before we fall back to moving them to the primary screen.
emit qApp->screenRemoved(this);
@@ -116,11 +125,8 @@ QScreen::~QScreen()
if (QGuiApplication::closingDown())
return;
- QScreen *primaryScreen = QGuiApplication::primaryScreen();
- if (this == primaryScreen)
- return;
-
- bool movingFromVirtualSibling = primaryScreen && primaryScreen->handle()->virtualSiblings().contains(handle());
+ bool movingFromVirtualSibling = newPrimaryScreen
+ && newPrimaryScreen->handle()->virtualSiblings().contains(handle());
// Move any leftover windows to the primary screen
const auto allWindows = QGuiApplication::allWindows();
@@ -129,7 +135,7 @@ QScreen::~QScreen()
continue;
const bool wasVisible = window->isVisible();
- window->setScreen(primaryScreen);
+ window->setScreen(newPrimaryScreen);
// Re-show window if moved from a virtual sibling screen. Otherwise
// leave it up to the application developer to show the window.
diff --git a/src/gui/kernel/qscreen.h b/src/gui/kernel/qscreen.h
index 8c9b16e08e..14392d3036 100644
--- a/src/gui/kernel/qscreen.h
+++ b/src/gui/kernel/qscreen.h
@@ -169,6 +169,7 @@ private:
friend class QPlatformIntegration;
friend class QPlatformScreen;
friend class QHighDpiScaling;
+ friend class QWindowSystemInterface;
};
#ifndef QT_NO_DEBUG_STREAM
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp
index 6e0c2de240..19a5d39ad5 100644
--- a/src/gui/kernel/qwindow.cpp
+++ b/src/gui/kernel/qwindow.cpp
@@ -1922,9 +1922,6 @@ void QWindowPrivate::destroy()
resizeEventPending = true;
receivedExpose = false;
exposed = false;
-
- if (wasVisible)
- maybeQuitOnLastWindowClosed();
}
/*!
@@ -2313,8 +2310,17 @@ bool QWindow::event(QEvent *ev)
#endif
case QEvent::Close:
- if (ev->isAccepted())
+ if (ev->isAccepted()) {
+ Q_D(QWindow);
+ bool wasVisible = isVisible();
destroy();
+ if (wasVisible) {
+ // FIXME: This check for visibility is a workaround for both QWidgetWindow
+ // and QWindow having logic to emit lastWindowClosed, and possibly quit the
+ // application. We should find a better way to handle this.
+ d->maybeQuitOnLastWindowClosed();
+ }
+ }
break;
case QEvent::Expose:
diff --git a/src/gui/kernel/qwindow_p.h b/src/gui/kernel/qwindow_p.h
index 1098321135..cc1cc24525 100644
--- a/src/gui/kernel/qwindow_p.h
+++ b/src/gui/kernel/qwindow_p.h
@@ -90,6 +90,7 @@ public:
, receivedExpose(false)
, positionPolicy(WindowFrameExclusive)
, positionAutomatic(true)
+ , resizeAutomatic(true)
, contentOrientation(Qt::PrimaryOrientation)
, opacity(qreal(1.0))
, minimumSize(0, 0)
@@ -156,11 +157,15 @@ public:
virtual void processSafeAreaMarginsChanged() {};
bool isPopup() const { return (windowFlags & Qt::WindowType_Mask) == Qt::Popup; }
+ void setAutomaticPositionAndResizeEnabled(bool a)
+ { positionAutomatic = resizeAutomatic = a; }
static QWindowPrivate *get(QWindow *window) { return window->d_func(); }
static Qt::WindowState effectiveState(Qt::WindowStates);
+ virtual bool allowClickThrough(const QPoint &) const { return true; }
+
QWindow::SurfaceType surfaceType;
Qt::WindowFlags windowFlags;
QWindow *parentWindow;
@@ -179,6 +184,11 @@ public:
bool receivedExpose;
PositionPolicy positionPolicy;
bool positionAutomatic;
+ // resizeAutomatic suppresses resizing by QPlatformWindow::initialGeometry().
+ // It also indicates that width/height=0 is acceptable (for example, for
+ // the QRollEffect widget) and is thus not cleared in setGeometry().
+ // An alternative approach might be using -1,-1 as a default size.
+ bool resizeAutomatic;
Qt::ScreenOrientation contentOrientation;
qreal opacity;
QRegion mask;
diff --git a/src/gui/kernel/qwindowsysteminterface.cpp b/src/gui/kernel/qwindowsysteminterface.cpp
index 8e6e3ce618..6f3edb10b4 100644
--- a/src/gui/kernel/qwindowsysteminterface.cpp
+++ b/src/gui/kernel/qwindowsysteminterface.cpp
@@ -780,6 +780,67 @@ QT_DEFINE_QPA_EVENT_HANDLER(void, handleTouchCancelEvent, QWindow *window, ulong
QWindowSystemInterfacePrivate::handleWindowSystemEvent<Delivery>(e);
}
+/*!
+ Should be called by the implementation whenever a new screen is added.
+
+ The first screen added will be the primary screen, used for default-created
+ windows, GL contexts, and other resources unless otherwise specified.
+
+ This adds the screen to QGuiApplication::screens(), and emits the
+ QGuiApplication::screenAdded() signal.
+
+ The screen should be deleted by calling QWindowSystemInterface::handleScreenRemoved().
+*/
+void QWindowSystemInterface::handleScreenAdded(QPlatformScreen *ps, bool isPrimary)
+{
+ QScreen *screen = new QScreen(ps);
+
+ if (isPrimary)
+ QGuiApplicationPrivate::screen_list.prepend(screen);
+ else
+ QGuiApplicationPrivate::screen_list.append(screen);
+
+ QGuiApplicationPrivate::resetCachedDevicePixelRatio();
+
+ emit qGuiApp->screenAdded(screen);
+
+ if (isPrimary)
+ emit qGuiApp->primaryScreenChanged(screen);
+}
+
+/*!
+ Should be called by the implementation whenever a screen is removed.
+
+ This removes the screen from QGuiApplication::screens(), and deletes it.
+
+ Failing to call this and manually deleting the QPlatformScreen instead may
+ lead to a crash due to a pure virtual call.
+*/
+void QWindowSystemInterface::handleScreenRemoved(QPlatformScreen *platformScreen)
+{
+ // Important to keep this order since the QSceen doesn't own the platform screen
+ delete platformScreen->screen();
+ delete platformScreen;
+}
+
+/*!
+ Should be called whenever the primary screen changes.
+
+ When the screen specified as primary changes, this method will notify
+ QGuiApplication and emit the QGuiApplication::primaryScreenChanged signal.
+ */
+void QWindowSystemInterface::handlePrimaryScreenChanged(QPlatformScreen *newPrimary)
+{
+ QScreen *newPrimaryScreen = newPrimary->screen();
+ int indexOfScreen = QGuiApplicationPrivate::screen_list.indexOf(newPrimaryScreen);
+ Q_ASSERT(indexOfScreen >= 0);
+ if (indexOfScreen == 0)
+ return;
+
+ QGuiApplicationPrivate::screen_list.swapItemsAt(0, indexOfScreen);
+ emit qGuiApp->primaryScreenChanged(newPrimaryScreen);
+}
+
void QWindowSystemInterface::handleScreenOrientationChange(QScreen *screen, Qt::ScreenOrientation orientation)
{
QWindowSystemInterfacePrivate::ScreenOrientationEvent *e =
diff --git a/src/gui/kernel/qwindowsysteminterface.h b/src/gui/kernel/qwindowsysteminterface.h
index 03b3bd16f0..fd70eda9ff 100644
--- a/src/gui/kernel/qwindowsysteminterface.h
+++ b/src/gui/kernel/qwindowsysteminterface.h
@@ -237,6 +237,10 @@ public:
#endif
// Changes to the screen
+ static void handleScreenAdded(QPlatformScreen *screen, bool isPrimary = false);
+ static void handleScreenRemoved(QPlatformScreen *screen);
+ static void handlePrimaryScreenChanged(QPlatformScreen *newPrimary);
+
static void handleScreenOrientationChange(QScreen *screen, Qt::ScreenOrientation newOrientation);
static void handleScreenGeometryChange(QScreen *screen, const QRect &newGeometry, const QRect &newAvailableGeometry);
static void handleScreenLogicalDotsPerInchChange(QScreen *screen, qreal newDpiX, qreal newDpiY);
diff --git a/src/gui/opengl/qopengltexture.cpp b/src/gui/opengl/qopengltexture.cpp
index 1e4d627e2a..61a6202017 100644
--- a/src/gui/opengl/qopengltexture.cpp
+++ b/src/gui/opengl/qopengltexture.cpp
@@ -3530,6 +3530,35 @@ void QOpenGLTexture::setData(int xOffset, int yOffset, int zOffset,
This overload is to be used to update a part of the texture. Parameters \a
xOffset, \a yOffset, \a zOffset specify the texel offsets within the
texture. Parameters \a width, \a height and \a depth specify the dimensions
+ of the sub image. The mip map level the sub image we want to
+ update is specified with \a mipLevel.
+
+ The structure of the pixel data pointed to by \a data is specified by \a
+ sourceFormat and \a sourceType. The pixel data upload can optionally be
+ controlled by \a options.
+*/
+void QOpenGLTexture::setData(int xOffset, int yOffset, int zOffset,
+ int width, int height, int depth,
+ int mipLevel,
+ PixelFormat sourceFormat, PixelType sourceType,
+ const void *data, const QOpenGLPixelTransferOptions * const options)
+{
+ Q_D(QOpenGLTexture);
+ Q_ASSERT(d->textureId);
+ d->setData(xOffset, yOffset, zOffset,
+ width, height, depth,
+ mipLevel, 0, 1,
+ QOpenGLTexture::CubeMapPositiveX, sourceFormat,
+ sourceType, data, options);
+}
+
+/*!
+ \since 5.14
+ \overload
+
+ This overload is to be used to update a part of the texture. Parameters \a
+ xOffset, \a yOffset, \a zOffset specify the texel offsets within the
+ texture. Parameters \a width, \a height and \a depth specify the dimensions
of the sub image. The mip map level and layerof the sub image we want to
update are specified with \a mipLevel and \a layer.
diff --git a/src/gui/painting/painting.pri b/src/gui/painting/painting.pri
index 0e2dfed9ab..972cf387ff 100644
--- a/src/gui/painting/painting.pri
+++ b/src/gui/painting/painting.pri
@@ -143,9 +143,11 @@ ARCH_HASWELL_SOURCES += painting/qdrawhelper_avx2.cpp
NEON_SOURCES += painting/qdrawhelper_neon.cpp painting/qimagescale_neon.cpp
NEON_HEADERS += painting/qdrawhelper_neon_p.h
-NEON_ASM += ../3rdparty/pixman/pixman-arm-neon-asm.S painting/qdrawhelper_neon_asm.S
!uikit:!win32:contains(QT_ARCH, "arm"): CONFIG += no_clang_integrated_as
-!uikit:!win32:!contains(QT_ARCH, "arm64"): DEFINES += ENABLE_PIXMAN_DRAWHELPERS
+!uikit:!win32:!integrity:!contains(QT_ARCH, "arm64") {
+ NEON_ASM += ../3rdparty/pixman/pixman-arm-neon-asm.S painting/qdrawhelper_neon_asm.S
+ DEFINES += ENABLE_PIXMAN_DRAWHELPERS
+}
MIPS_DSP_SOURCES += painting/qdrawhelper_mips_dsp.cpp
MIPS_DSP_HEADERS += painting/qdrawhelper_mips_dsp_p.h painting/qt_mips_asm_dsp_p.h
diff --git a/src/gui/painting/qbrush.cpp b/src/gui/painting/qbrush.cpp
index abfa8d41bb..ed575abf54 100644
--- a/src/gui/painting/qbrush.cpp
+++ b/src/gui/painting/qbrush.cpp
@@ -545,9 +545,11 @@ QBrush::QBrush(const QBrush &other)
*/
QBrush::QBrush(const QGradient &gradient)
{
- Q_ASSERT_X(gradient.type() != QGradient::NoGradient, "QBrush::QBrush",
- "QGradient should not be used directly, use the linear, radial\n"
- "or conical gradients instead");
+ if (Q_UNLIKELY(gradient.type() == QGradient::NoGradient)) {
+ d.reset(nullBrushInstance());
+ d->ref.ref();
+ return;
+ }
const Qt::BrushStyle enum_table[] = {
Qt::LinearGradientPattern,
@@ -1376,8 +1378,10 @@ QGradient::QGradient(Preset preset)
}();
const QJsonValue presetData = jsonPresets[preset - 1];
- if (!presetData.isObject())
+ if (!presetData.isObject()) {
+ qWarning("QGradient: Undefined preset %i", preset);
return;
+ }
m_type = LinearGradient;
setCoordinateMode(ObjectMode);
diff --git a/src/gui/painting/qdrawhelper_neon.cpp b/src/gui/painting/qdrawhelper_neon.cpp
index 3fcbcfd053..8196a87b24 100644
--- a/src/gui/painting/qdrawhelper_neon.cpp
+++ b/src/gui/painting/qdrawhelper_neon.cpp
@@ -50,7 +50,18 @@ QT_BEGIN_NAMESPACE
void qt_memfill32(quint32 *dest, quint32 value, qsizetype count)
{
const int epilogueSize = count % 16;
-#if !defined(Q_PROCESSOR_ARM_64)
+#if defined(Q_CC_GHS) || defined(Q_CC_MSVC)
+ // inline assembler free version:
+ if (count >= 16) {
+ quint32 *const neonEnd = dest + count - epilogueSize;
+ const uint32x4_t valueVector1 = vdupq_n_u32(value);
+ const uint32x4x4_t valueVector4 = { valueVector1, valueVector1, valueVector1, valueVector1 };
+ do {
+ vst4q_u32(dest, valueVector4);
+ dest += 16;
+ } while (dest != neonEnd);
+ }
+#elif !defined(Q_PROCESSOR_ARM_64)
if (count >= 16) {
quint32 *const neonEnd = dest + count - epilogueSize;
register uint32x4_t valueVector1 asm ("q0") = vdupq_n_u32(value);
diff --git a/src/gui/painting/qoutlinemapper.cpp b/src/gui/painting/qoutlinemapper.cpp
index b2d02182c3..2074f98069 100644
--- a/src/gui/painting/qoutlinemapper.cpp
+++ b/src/gui/painting/qoutlinemapper.cpp
@@ -42,6 +42,7 @@
#include "qbezier_p.h"
#include "qmath.h"
#include "qpainterpath_p.h"
+#include "qscopedvaluerollback.h"
#include <stdlib.h>
@@ -354,7 +355,7 @@ void QOutlineMapper::clipElements(const QPointF *elements,
// instead of going through convenience functionallity, but since
// this part of code hardly every used, it shouldn't matter.
- m_in_clip_elements = true;
+ QScopedValueRollback<bool> in_clip_elements(m_in_clip_elements, true);
QPainterPath path;
@@ -397,8 +398,6 @@ void QOutlineMapper::clipElements(const QPointF *elements,
convertPath(clippedPath);
m_transform = oldTransform;
}
-
- m_in_clip_elements = false;
}
QT_END_NAMESPACE
diff --git a/src/gui/painting/qplatformbackingstore.cpp b/src/gui/painting/qplatformbackingstore.cpp
index afb4613ba5..c71d82546a 100644
--- a/src/gui/painting/qplatformbackingstore.cpp
+++ b/src/gui/painting/qplatformbackingstore.cpp
@@ -446,6 +446,11 @@ void QPlatformBackingStore::composeAndFlush(QWindow *window, const QRegion &regi
d_ptr->blitter->setRedBlueSwizzle(false);
}
+ // There is no way to tell if the OpenGL-rendered content is premultiplied or not.
+ // For compatibility, assume that it is not, and use normal alpha blend always.
+ if (d_ptr->premultiplied)
+ funcs->glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE);
+
// Textures for renderToTexture widgets that have WA_AlwaysStackOnTop set.
for (int i = 0; i < textures->count(); ++i) {
if (textures->flags(i).testFlag(QPlatformTextureList::StacksOnTop))
diff --git a/src/gui/text/qsyntaxhighlighter.cpp b/src/gui/text/qsyntaxhighlighter.cpp
index 102a776ed3..cf584f6980 100644
--- a/src/gui/text/qsyntaxhighlighter.cpp
+++ b/src/gui/text/qsyntaxhighlighter.cpp
@@ -45,6 +45,7 @@
#include <private/qtextdocument_p.h>
#include <qtextlayout.h>
#include <qpointer.h>
+#include <qscopedvaluerollback.h>
#include <qtextobject.h>
#include <qtextcursor.h>
#include <qdebug.h>
@@ -68,14 +69,14 @@ public:
void reformatBlocks(int from, int charsRemoved, int charsAdded);
void reformatBlock(const QTextBlock &block);
- inline void rehighlight(QTextCursor &cursor, QTextCursor::MoveOperation operation) {
- inReformatBlocks = true;
+ inline void rehighlight(QTextCursor &cursor, QTextCursor::MoveOperation operation)
+ {
+ QScopedValueRollback<bool> bg(inReformatBlocks, true);
cursor.beginEditBlock();
int from = cursor.position();
cursor.movePosition(operation);
reformatBlocks(from, 0, cursor.position() - from);
cursor.endEditBlock();
- inReformatBlocks = false;
}
inline void _q_delayedRehighlight() {
diff --git a/src/gui/text/qtextcursor.cpp b/src/gui/text/qtextcursor.cpp
index 7719a2e6da..c88497840f 100644
--- a/src/gui/text/qtextcursor.cpp
+++ b/src/gui/text/qtextcursor.cpp
@@ -1145,6 +1145,15 @@ bool QTextCursor::isNull() const
\a pos using a \c MoveMode specified by \a m. The cursor is positioned
between characters.
+ \note The "characters" in this case refer to the string of QChar
+ objects, i.e. 16-bit Unicode characters, and \a pos is considered
+ an index into this string. This does not necessarily correspond to
+ individual graphemes in the writing system, as a single grapheme may
+ be represented by multiple Unicode characters, such as in the case
+ of surrogate pairs, linguistic ligatures or diacritics. For a more
+ generic approach to navigating the document, use movePosition(),
+ which will respect the actual grapheme boundaries in the text.
+
\sa position(), movePosition(), anchor()
*/
void QTextCursor::setPosition(int pos, MoveMode m)
@@ -1176,6 +1185,13 @@ void QTextCursor::setPosition(int pos, MoveMode m)
Returns the absolute position of the cursor within the document.
The cursor is positioned between characters.
+ \note The "characters" in this case refer to the string of QChar
+ objects, i.e. 16-bit Unicode characters, and the position is considered
+ an index into this string. This does not necessarily correspond to
+ individual graphemes in the writing system, as a single grapheme may
+ be represented by multiple Unicode characters, such as in the case
+ of surrogate pairs, linguistic ligatures or diacritics.
+
\sa setPosition(), movePosition(), anchor(), positionInBlock()
*/
int QTextCursor::position() const
@@ -1192,6 +1208,13 @@ int QTextCursor::position() const
This is equivalent to \c{ position() - block().position()}.
+ \note The "characters" in this case refer to the string of QChar
+ objects, i.e. 16-bit Unicode characters, and the position is considered
+ an index into this string. This does not necessarily correspond to
+ individual graphemes in the writing system, as a single grapheme may
+ be represented by multiple Unicode characters, such as in the case
+ of surrogate pairs, linguistic ligatures or diacritics.
+
\sa position()
*/
int QTextCursor::positionInBlock() const
diff --git a/src/gui/text/qtextdocument_p.cpp b/src/gui/text/qtextdocument_p.cpp
index c0a0c1a177..0e3c8d0e83 100644
--- a/src/gui/text/qtextdocument_p.cpp
+++ b/src/gui/text/qtextdocument_p.cpp
@@ -40,6 +40,7 @@
#include <private/qtools_p.h>
#include <qdebug.h>
+#include <qscopedvaluerollback.h>
#include "qtextdocument_p.h"
#include "qtextdocument.h"
#include <qtextformat.h>
@@ -274,9 +275,10 @@ void QTextDocumentPrivate::clear()
rtFrame = 0;
init();
cursors = oldCursors;
- inContentsChange = true;
- emit q->contentsChange(0, len, 0);
- inContentsChange = false;
+ {
+ QScopedValueRollback<bool> bg(inContentsChange, true);
+ emit q->contentsChange(0, len, 0);
+ }
if (lout)
lout->documentChanged(0, len, 0);
} QT_CATCH(...) {
@@ -309,9 +311,10 @@ void QTextDocumentPrivate::setLayout(QAbstractTextDocumentLayout *layout)
it->free();
emit q->documentLayoutChanged();
- inContentsChange = true;
- emit q->contentsChange(0, 0, length());
- inContentsChange = false;
+ {
+ QScopedValueRollback<bool> bg(inContentsChange, true);
+ emit q->contentsChange(0, 0, length());
+ }
if (lout)
lout->documentChanged(0, 0, length());
}
@@ -1213,9 +1216,8 @@ void QTextDocumentPrivate::finishEdit()
if (lout && docChangeFrom >= 0) {
if (!inContentsChange) {
- inContentsChange = true;
+ QScopedValueRollback<bool> bg(inContentsChange, true);
emit q->contentsChange(docChangeFrom, docChangeOldLength, docChangeLength);
- inContentsChange = false;
}
lout->documentChanged(docChangeFrom, docChangeOldLength, docChangeLength);
}
diff --git a/src/gui/text/qtextdocument_p.h b/src/gui/text/qtextdocument_p.h
index d95f5bef6a..a8e17bfc08 100644
--- a/src/gui/text/qtextdocument_p.h
+++ b/src/gui/text/qtextdocument_p.h
@@ -339,6 +339,7 @@ private:
int lastBlockCount;
public:
+ bool inContentsChange;
QTextOption defaultTextOption;
Qt::CursorMoveStyle defaultCursorMoveStyle;
#ifndef QT_NO_CSSPARSER
@@ -346,7 +347,6 @@ public:
#endif
int maximumBlockCount;
uint needsEnsureMaximumBlockCount : 1;
- uint inContentsChange : 1;
uint blockCursorAdjustment : 1;
QSizeF pageSize;
QString title;
diff --git a/src/gui/text/qtextdocumentlayout.cpp b/src/gui/text/qtextdocumentlayout.cpp
index 323253c70d..2e1a2b5bff 100644
--- a/src/gui/text/qtextdocumentlayout.cpp
+++ b/src/gui/text/qtextdocumentlayout.cpp
@@ -58,23 +58,17 @@
#include <limits.h>
#include <qbasictimer.h>
#include "private/qfunctions_p.h"
+#include <qloggingcategory.h>
#include <algorithm>
-// #define LAYOUT_DEBUG
-
-#ifdef LAYOUT_DEBUG
-#define LDEBUG qDebug()
-#define INC_INDENT debug_indent += " "
-#define DEC_INDENT debug_indent = debug_indent.left(debug_indent.length()-2)
-#else
-#define LDEBUG if(0) qDebug()
-#define INC_INDENT do {} while(0)
-#define DEC_INDENT do {} while(0)
-#endif
-
QT_BEGIN_NAMESPACE
+Q_LOGGING_CATEGORY(lcDraw, "qt.text.drawing")
+Q_LOGGING_CATEGORY(lcHit, "qt.text.hittest")
+Q_LOGGING_CATEGORY(lcLayout, "qt.text.layout")
+Q_LOGGING_CATEGORY(lcTable, "qt.text.layout.table")
+
// ################ should probably add frameFormatChange notification!
struct QTextLayoutStruct;
@@ -583,16 +577,16 @@ QTextDocumentLayoutPrivate::hitTest(QTextFrame *frame, const QFixedPoint &point,
QTextFrame *rootFrame = docPrivate->rootFrame();
-// LDEBUG << "checking frame" << frame->firstPosition() << "point=" << point
-// << "position" << fd->position << "size" << fd->size;
+ qCDebug(lcHit) << "checking frame" << frame->firstPosition() << "point=" << point.toPointF()
+ << "position" << fd->position.toPointF() << "size" << fd->size.toSizeF();
if (frame != rootFrame) {
if (relativePoint.y < 0 || relativePoint.x < 0) {
*position = frame->firstPosition() - 1;
-// LDEBUG << "before pos=" << *position;
+ qCDebug(lcHit) << "before pos=" << *position;
return PointBefore;
} else if (relativePoint.y > fd->size.height || relativePoint.x > fd->size.width) {
*position = frame->lastPosition() + 1;
-// LDEBUG << "after pos=" << *position;
+ qCDebug(lcHit) << "after pos=" << *position;
return PointAfter;
}
}
@@ -666,8 +660,6 @@ QTextDocumentLayoutPrivate::HitPoint
QTextDocumentLayoutPrivate::hitTest(QTextFrame::Iterator it, HitPoint hit, const QFixedPoint &p,
int *position, QTextLayout **l, Qt::HitTestAccuracy accuracy) const
{
- INC_INDENT;
-
for (; !it.atEnd(); ++it) {
QTextFrame *c = it.currentFrame();
HitPoint hp;
@@ -693,8 +685,7 @@ QTextDocumentLayoutPrivate::hitTest(QTextFrame::Iterator it, HitPoint hit, const
}
}
- DEC_INDENT;
-// LDEBUG << "inside=" << hit << " pos=" << *position;
+ qCDebug(lcHit) << "inside=" << hit << " pos=" << *position;
return hit;
}
@@ -741,15 +732,14 @@ QTextDocumentLayoutPrivate::hitTest(const QTextBlock &bl, const QFixedPoint &poi
QTextLayout *tl = bl.layout();
QRectF textrect = tl->boundingRect();
textrect.translate(tl->position());
-// LDEBUG << " checking block" << bl.position() << "point=" << point
-// << " tlrect" << textrect;
+ qCDebug(lcHit) << " checking block" << bl.position() << "point=" << point.toPointF() << " tlrect" << textrect;
*position = bl.position();
if (point.y.toReal() < textrect.top()) {
-// LDEBUG << " before pos=" << *position;
+ qCDebug(lcHit) << " before pos=" << *position;
return PointBefore;
} else if (point.y.toReal() > textrect.bottom()) {
*position += bl.length();
-// LDEBUG << " after pos=" << *position;
+ qCDebug(lcHit) << " after pos=" << *position;
return PointAfter;
}
@@ -781,7 +771,7 @@ QTextDocumentLayoutPrivate::hitTest(const QTextBlock &bl, const QFixedPoint &poi
}
*position += off;
-// LDEBUG << " inside=" << hit << " pos=" << *position;
+ qCDebug(lcHit) << " inside=" << hit << " pos=" << *position;
return hit;
}
@@ -944,8 +934,7 @@ void QTextDocumentLayoutPrivate::drawFrame(const QPointF &offset, QPainter *pain
|| off.x() > context.clip.right() || off.x() + fd->size.width.toReal() < context.clip.left()))
return;
-// LDEBUG << debug_indent << "drawFrame" << frame->firstPosition() << "--" << frame->lastPosition() << "at" << offset;
-// INC_INDENT;
+ qCDebug(lcDraw) << "drawFrame" << frame->firstPosition() << "--" << frame->lastPosition() << "at" << offset;
// if the cursor is /on/ a table border we may need to repaint it
// afterwards, as we usually draw the decoration first
@@ -1076,8 +1065,6 @@ void QTextDocumentLayoutPrivate::drawFrame(const QPointF &offset, QPainter *pain
painter->setPen(oldPen);
}
-// DEC_INDENT;
-
return;
}
@@ -1280,7 +1267,7 @@ void QTextDocumentLayoutPrivate::drawBlock(const QPointF &offset, QPainter *pain
r.translate(offset + tl->position());
if (!bl.isVisible() || (context.clip.isValid() && (r.bottom() < context.clip.y() || r.top() > context.clip.bottom())))
return;
-// LDEBUG << debug_indent << "drawBlock" << bl.position() << "at" << offset << "br" << tl->boundingRect();
+ qCDebug(lcDraw) << "drawBlock" << bl.position() << "at" << offset << "br" << tl->boundingRect();
QTextBlockFormat blockFormat = bl.blockFormat();
@@ -1512,7 +1499,7 @@ QTextLayoutStruct QTextDocumentLayoutPrivate::layoutCell(QTextTable *t, const QT
int layoutFrom, int layoutTo, QTextTableData *td,
QFixed absoluteTableY, bool withPageBreaks)
{
- LDEBUG << "layoutCell";
+ qCDebug(lcTable) << "layoutCell";
QTextLayoutStruct layoutStruct;
layoutStruct.frame = t;
layoutStruct.minimumWidth = 0;
@@ -1587,7 +1574,7 @@ QTextLayoutStruct QTextDocumentLayoutPrivate::layoutCell(QTextTable *t, const QT
QRectF QTextDocumentLayoutPrivate::layoutTable(QTextTable *table, int layoutFrom, int layoutTo, QFixed parentY)
{
- LDEBUG << "layoutTable";
+ qCDebug(lcTable) << "layoutTable from" << layoutFrom << "to" << layoutTo << "parentY" << parentY;
QTextTableData *td = static_cast<QTextTableData *>(data(table));
Q_ASSERT(td->sizeDirty);
const int rows = table->rows();
@@ -1709,6 +1696,7 @@ recalc_minmax_widths:
if (length.type() == QTextLength::FixedLength) {
td->minWidths[i] = td->widths[i] = qMax(scaleToDevice(QFixed::fromReal(length.rawValue())), td->minWidths.at(i));
remainingWidth -= td->widths.at(i);
+ qCDebug(lcTable) << "column" << i << "has width constraint" << td->minWidths.at(i) << "px, remaining width now" << remainingWidth;
} else if (length.type() == QTextLength::PercentageLength) {
totalPercentage += QFixed::fromReal(length.rawValue());
} else if (length.type() == QTextLength::VariableLength) {
@@ -1716,6 +1704,7 @@ recalc_minmax_widths:
td->widths[i] = td->minWidths.at(i);
remainingWidth -= td->minWidths.at(i);
+ qCDebug(lcTable) << "column" << i << "has variable width, min" << td->minWidths.at(i) << "remaining width now" << remainingWidth;
}
totalMinWidth += td->minWidths.at(i);
}
@@ -1735,6 +1724,8 @@ recalc_minmax_widths:
} else {
td->widths[i] = td->minWidths.at(i);
}
+ qCDebug(lcTable) << "column" << i << "has width constraint" << columnWidthConstraints.at(i).rawValue()
+ << "%, allocated width" << td->widths[i] << "remaining width now" << remainingWidth;
remainingWidth -= td->widths.at(i);
}
}
@@ -1978,9 +1969,12 @@ relayout:
td->minimumWidth += rightMargin - td->border;
td->maximumWidth = td->columnPositions.at(0);
- for (int i = 0; i < columns; ++i)
+ for (int i = 0; i < columns; ++i) {
if (td->maxWidths.at(i) != QFIXED_MAX)
td->maximumWidth += td->maxWidths.at(i) + 2 * td->border + cellSpacing;
+ qCDebug(lcTable) << "column" << i << "has final width" << td->widths.at(i).toReal()
+ << "min" << td->minWidths.at(i).toReal() << "max" << td->maxWidths.at(i).toReal();
+ }
td->maximumWidth += rightMargin - td->border;
td->updateTableSize();
@@ -2052,9 +2046,8 @@ void QTextDocumentLayoutPrivate::positionFloat(QTextFrame *frame, QTextLine *cur
QRectF QTextDocumentLayoutPrivate::layoutFrame(QTextFrame *f, int layoutFrom, int layoutTo, QFixed parentY)
{
- LDEBUG << "layoutFrame (pre)";
+ qCDebug(lcLayout, "layoutFrame (%d--%d), parent=%p", f->firstPosition(), f->lastPosition(), f->parentFrame());
Q_ASSERT(data(f)->sizeDirty);
-// qDebug("layouting frame (%d--%d), parent=%p", f->firstPosition(), f->lastPosition(), f->parentFrame());
QTextFrameFormat fformat = f->frameFormat();
@@ -2076,9 +2069,8 @@ QRectF QTextDocumentLayoutPrivate::layoutFrame(QTextFrame *f, int layoutFrom, in
QRectF QTextDocumentLayoutPrivate::layoutFrame(QTextFrame *f, int layoutFrom, int layoutTo, QFixed frameWidth, QFixed frameHeight, QFixed parentY)
{
- LDEBUG << "layoutFrame from=" << layoutFrom << "to=" << layoutTo;
+ qCDebug(lcLayout, "layoutFrame (%d--%d), parent=%p", f->firstPosition(), f->lastPosition(), f->parentFrame());
Q_ASSERT(data(f)->sizeDirty);
-// qDebug("layouting frame (%d--%d), parent=%p", f->firstPosition(), f->lastPosition(), f->parentFrame());
QTextFrameData *fd = data(f);
QFixed newContentsWidth;
@@ -2165,8 +2157,8 @@ QRectF QTextDocumentLayoutPrivate::layoutFrame(QTextFrame *f, int layoutFrom, in
layoutStruct.maximumWidth = QFIXED_MAX;
layoutStruct.fullLayout = fullLayout || (fd->oldContentsWidth != newContentsWidth);
layoutStruct.updateRect = QRectF(QPointF(0, 0), QSizeF(qreal(INT_MAX), qreal(INT_MAX)));
- LDEBUG << "layoutStruct: x_left" << layoutStruct.x_left << "x_right" << layoutStruct.x_right
- << "fullLayout" << layoutStruct.fullLayout;
+ qCDebug(lcLayout) << "layoutStruct: x_left" << layoutStruct.x_left << "x_right" << layoutStruct.x_right
+ << "fullLayout" << layoutStruct.fullLayout;
fd->oldContentsWidth = newContentsWidth;
layoutStruct.pageHeight = QFixed::fromReal(document->pageSize().height());
@@ -2220,7 +2212,7 @@ QRectF QTextDocumentLayoutPrivate::layoutFrame(QTextFrame *f, int layoutFrom, in
void QTextDocumentLayoutPrivate::layoutFlow(QTextFrame::Iterator it, QTextLayoutStruct *layoutStruct,
int layoutFrom, int layoutTo, QFixed width)
{
- LDEBUG << "layoutFlow from=" << layoutFrom << "to=" << layoutTo;
+ qCDebug(lcLayout) << "layoutFlow from=" << layoutFrom << "to=" << layoutTo;
QTextFrameData *fd = data(layoutStruct->frame);
fd->currentLayoutStruct = layoutStruct;
@@ -2578,9 +2570,8 @@ void QTextDocumentLayoutPrivate::layoutBlock(const QTextBlock &bl, int blockPosi
QTextLayout *tl = bl.layout();
const int blockLength = bl.length();
- LDEBUG << "layoutBlock from=" << layoutFrom << "to=" << layoutTo;
-
-// qDebug() << "layoutBlock; width" << layoutStruct->x_right - layoutStruct->x_left << "(maxWidth is btw" << tl->maximumWidth() << ')';
+ qCDebug(lcLayout) << "layoutBlock from=" << layoutFrom << "to=" << layoutTo
+ << "; width" << layoutStruct->x_right - layoutStruct->x_left << "(maxWidth is btw" << tl->maximumWidth() << ')';
if (previousBlockFormat) {
qreal margin = qMax(blockFormat.topMargin(), previousBlockFormat->bottomMargin());
@@ -2612,7 +2603,7 @@ void QTextDocumentLayoutPrivate::layoutBlock(const QTextBlock &bl, int blockPosi
// force relayout if we cross a page boundary
|| (layoutStruct->pageHeight != QFIXED_MAX && layoutStruct->absoluteY() + QFixed::fromReal(tl->boundingRect().height()) > layoutStruct->pageBottom)) {
- LDEBUG << " do layout";
+ qCDebug(lcLayout) << "do layout";
QTextOption option = docPrivate->defaultTextOption;
option.setTextDirection(dir);
option.setTabs( blockFormat.tabPositions() );
@@ -2741,7 +2732,7 @@ void QTextDocumentLayoutPrivate::layoutBlock(const QTextBlock &bl, int blockPosi
const int cnt = tl->lineCount();
QFixed bottom;
for (int i = 0; i < cnt; ++i) {
- LDEBUG << "going to move text line" << i;
+ qCDebug(lcLayout) << "going to move text line" << i;
QTextLine line = tl->lineAt(i);
layoutStruct->contentsWidth
= qMax(layoutStruct->contentsWidth, QFixed::fromReal(line.x() + tl->lineAt(i).naturalTextWidth()) + totalRightMargin);
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp
index 130d506975..2616a42022 100644
--- a/src/gui/text/qtextengine.cpp
+++ b/src/gui/text/qtextengine.cpp
@@ -1754,7 +1754,7 @@ int QTextEngine::shapeTextWithHarfbuzzNG(const QScriptItem &si,
#ifdef Q_OS_DARWIN
if (actualFontEngine->type() == QFontEngine::Mac) {
- if (actualFontEngine->fontDef.stretch != 100) {
+ if (actualFontEngine->fontDef.stretch != 100 && actualFontEngine->fontDef.stretch != QFont::AnyStretch) {
QFixed stretch = QFixed(int(actualFontEngine->fontDef.stretch)) / QFixed(100);
for (uint i = 0; i < num_glyphs; ++i)
g.advances[i] *= stretch;
diff --git a/src/network/access/qabstractnetworkcache.cpp b/src/network/access/qabstractnetworkcache.cpp
index 0b94dff61e..4e217294c4 100644
--- a/src/network/access/qabstractnetworkcache.cpp
+++ b/src/network/access/qabstractnetworkcache.cpp
@@ -191,8 +191,8 @@ bool QNetworkCacheMetaData::isValid() const
Some cache implementations can keep these cache items in memory for performance reasons,
but for security reasons they should not be written to disk.
- Specifically with http, documents marked with Pragma: no-cache, or have a Cache-control set to
- no-store or no-cache or any https document that doesn't have "Cache-control: public" set will
+ Specifically with http, documents with Cache-control set to no-store or any
+ https document that doesn't have "Cache-control: public" set will
set the saveToDisk to false.
\sa setSaveToDisk()
diff --git a/src/network/access/qhttp2protocolhandler.cpp b/src/network/access/qhttp2protocolhandler.cpp
index d5221a4934..35aee6e3e1 100644
--- a/src/network/access/qhttp2protocolhandler.cpp
+++ b/src/network/access/qhttp2protocolhandler.cpp
@@ -198,7 +198,7 @@ QHttp2ProtocolHandler::QHttp2ProtocolHandler(QHttpNetworkConnectionChannel *chan
}
}
- if (!channel->ssl) {
+ if (!channel->ssl && m_connection->connectionType() != QHttpNetworkConnection::ConnectionTypeHTTP2Direct) {
// We upgraded from HTTP/1.1 to HTTP/2. channel->request was already sent
// as HTTP/1.1 request. The response with status code 101 triggered
// protocol switch and now we are waiting for the real response, sent
diff --git a/src/network/access/qnetworkaccesscachebackend.cpp b/src/network/access/qnetworkaccesscachebackend.cpp
index 0c9a88596d..22fdc5bb0b 100644
--- a/src/network/access/qnetworkaccesscachebackend.cpp
+++ b/src/network/access/qnetworkaccesscachebackend.cpp
@@ -87,15 +87,16 @@ bool QNetworkAccessCacheBackend::sendCacheContents()
setAttribute(QNetworkRequest::HttpReasonPhraseAttribute, attributes.value(QNetworkRequest::HttpReasonPhraseAttribute));
// set the raw headers
- QNetworkCacheMetaData::RawHeaderList rawHeaders = item.rawHeaders();
- QNetworkCacheMetaData::RawHeaderList::ConstIterator it = rawHeaders.constBegin(),
- end = rawHeaders.constEnd();
- for ( ; it != end; ++it) {
- if (it->first.toLower() == "cache-control" &&
- it->second.toLower().contains("must-revalidate")) {
- return false;
+ const QNetworkCacheMetaData::RawHeaderList rawHeaders = item.rawHeaders();
+ for (const auto &header : rawHeaders) {
+ if (header.first.toLower() == "cache-control") {
+ const QByteArray cacheControlValue = header.second.toLower();
+ if (cacheControlValue.contains("must-revalidate")
+ || cacheControlValue.contains("no-cache")) {
+ return false;
+ }
}
- setRawHeader(it->first, it->second);
+ setRawHeader(header.first, header.second);
}
// handle a possible redirect
diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp
index 62c915908b..50b9488594 100644
--- a/src/network/access/qnetworkaccessmanager.cpp
+++ b/src/network/access/qnetworkaccessmanager.cpp
@@ -1390,7 +1390,8 @@ QNetworkReply *QNetworkAccessManager::createRequest(QNetworkAccessManager::Opera
QString scheme = req.url().scheme();
#ifdef Q_OS_WASM
- if (scheme == QLatin1String("http") || scheme == QLatin1String("https")) {
+ // Support http, https, and relateive urls
+ if (scheme == QLatin1String("http") || scheme == QLatin1String("https") || scheme.isEmpty()) {
QNetworkReplyWasmImpl *reply = new QNetworkReplyWasmImpl(this);
QNetworkReplyWasmImplPrivate *priv = reply->d_func();
priv->manager = this;
diff --git a/src/network/access/qnetworkreplyhttpimpl.cpp b/src/network/access/qnetworkreplyhttpimpl.cpp
index 9ae94afc5a..f801ef0c88 100644
--- a/src/network/access/qnetworkreplyhttpimpl.cpp
+++ b/src/network/access/qnetworkreplyhttpimpl.cpp
@@ -524,6 +524,8 @@ bool QNetworkReplyHttpImplPrivate::loadFromCacheIfAllowed(QHttpNetworkRequest &h
QHash<QByteArray, QByteArray> cacheControl = parseHttpOptionHeader(it->second);
if (cacheControl.contains("must-revalidate"))
return false;
+ if (cacheControl.contains("no-cache"))
+ return false;
}
QDateTime currentDateTime = QDateTime::currentDateTimeUtc();
@@ -1731,18 +1733,8 @@ QNetworkCacheMetaData QNetworkReplyHttpImplPrivate::fetchCacheMetaData(const QNe
if (httpRequest.operation() == QHttpNetworkRequest::Get) {
canDiskCache = true;
- // 14.32
- // HTTP/1.1 caches SHOULD treat "Pragma: no-cache" as if the client
- // had sent "Cache-Control: no-cache".
- it = cacheHeaders.findRawHeader("pragma");
- if (it != cacheHeaders.rawHeaders.constEnd()
- && it->second == "no-cache")
- canDiskCache = false;
-
// HTTP/1.1. Check the Cache-Control header
- if (cacheControl.contains("no-cache"))
- canDiskCache = false;
- else if (cacheControl.contains("no-store"))
+ if (cacheControl.contains("no-store"))
canDiskCache = false;
// responses to POST might be cacheable
diff --git a/src/network/access/qnetworkreplywasmimpl.cpp b/src/network/access/qnetworkreplywasmimpl.cpp
index f347cc0479..bb6ef07741 100644
--- a/src/network/access/qnetworkreplywasmimpl.cpp
+++ b/src/network/access/qnetworkreplywasmimpl.cpp
@@ -117,7 +117,7 @@ static void q_loadCallback(val event)
val blob = xhr["response"];
val reader = val::global("FileReader").new_();
- reader.set("onload", val::module_property("QNetworkReplyWasmImplPrivate_readBinary"));
+ reader.set("onload", val::module_property("qt_QNetworkReplyWasmImplPrivate_readBinary"));
reader.set("data-handler", xhr["data-handler"]);
reader.call<void>("readAsArrayBuffer", blob);
@@ -174,12 +174,12 @@ static void q_readBinary(val event)
QCoreApplication::processEvents();
}
-EMSCRIPTEN_BINDINGS(network_module) {
- function("QNetworkReplyWasmImplPrivate_requestErrorCallback", q_requestErrorCallback);
- function("QNetworkReplyWasmImplPrivate_progressCallback", q_progressCallback);
- function("QNetworkReplyWasmImplPrivate_loadCallback", q_loadCallback);
- function("QNetworkReplyWasmImplPrivate_responseHeadersCallback", q_responseHeadersCallback);
- function("QNetworkReplyWasmImplPrivate_readBinary", q_readBinary);
+EMSCRIPTEN_BINDINGS(qtNetworkModule) {
+ function("qt_QNetworkReplyWasmImplPrivate_requestErrorCallback", q_requestErrorCallback);
+ function("qt_QNetworkReplyWasmImplPrivate_progressCallback", q_progressCallback);
+ function("qt_QNetworkReplyWasmImplPrivate_loadCallback", q_loadCallback);
+ function("qt_QNetworkReplyWasmImplPrivate_responseHeadersCallback", q_responseHeadersCallback);
+ function("qt_QNetworkReplyWasmImplPrivate_readBinary", q_readBinary);
}
QNetworkReplyWasmImplPrivate::QNetworkReplyWasmImplPrivate()
@@ -332,10 +332,10 @@ void QNetworkReplyWasmImplPrivate::doSendRequest()
m_xhr.call<void>("open", verb, request.url().toString().toStdString());
- m_xhr.set("onerror", val::module_property("QNetworkReplyWasmImplPrivate_requestErrorCallback"));
- m_xhr.set("onload", val::module_property("QNetworkReplyWasmImplPrivate_loadCallback"));
- m_xhr.set("onprogress", val::module_property("QNetworkReplyWasmImplPrivate_progressCallback"));
- m_xhr.set("onreadystatechange", val::module_property("QNetworkReplyWasmImplPrivate_responseHeadersCallback"));
+ m_xhr.set("onerror", val::module_property("qt_QNetworkReplyWasmImplPrivate_requestErrorCallback"));
+ m_xhr.set("onload", val::module_property("qt_QNetworkReplyWasmImplPrivate_loadCallback"));
+ m_xhr.set("onprogress", val::module_property("qt_QNetworkReplyWasmImplPrivate_progressCallback"));
+ m_xhr.set("onreadystatechange", val::module_property("qt_QNetworkReplyWasmImplPrivate_responseHeadersCallback"));
m_xhr.set("data-handler", val(quintptr(reinterpret_cast<void *>(this))));
diff --git a/src/network/configure.json b/src/network/configure.json
index be9e35c7fe..56805da7b2 100644
--- a/src/network/configure.json
+++ b/src/network/configure.json
@@ -86,11 +86,11 @@
"sources": [
{ "type": "openssl" },
{
- "libs": "-lssleay32 -llibeay32",
+ "libs": "-lssleay32 -llibeay32 -lUser32 -lWs2_32 -lAdvapi32 -lGdi32",
"condition": "config.win32"
},
{
- "libs": "-llibssl -llibcrypto",
+ "libs": "-llibssl -llibcrypto -lUser32 -lWs2_32 -lAdvapi32 -lCrypt32",
"condition": "config.msvc"
},
{
diff --git a/src/network/ssl/qsslkey_openssl.cpp b/src/network/ssl/qsslkey_openssl.cpp
index dfb80bd829..888058df22 100644
--- a/src/network/ssl/qsslkey_openssl.cpp
+++ b/src/network/ssl/qsslkey_openssl.cpp
@@ -334,12 +334,13 @@ static QByteArray doCrypt(QSslKeyPrivate::Cipher cipher, const QByteArray &data,
#endif
break;
case QSslKeyPrivate::Aes128Cbc:
+ type = q_EVP_aes_128_cbc();
+ break;
case QSslKeyPrivate::Aes192Cbc:
+ type = q_EVP_aes_192_cbc();
+ break;
case QSslKeyPrivate::Aes256Cbc:
- // Just to avoid compiler warnings/errors. OpenSSL uses a different
- // codepath when reading encrypted keys, and they all correctly
- // deduce the cipher and know how to derive a key.
- Q_UNREACHABLE();
+ type = q_EVP_aes_256_cbc();
break;
}
diff --git a/src/network/ssl/qsslkey_qt.cpp b/src/network/ssl/qsslkey_qt.cpp
index 1b2d9a49aa..2662418a05 100644
--- a/src/network/ssl/qsslkey_qt.cpp
+++ b/src/network/ssl/qsslkey_qt.cpp
@@ -413,14 +413,12 @@ void QSslKeyPrivate::decodePem(const QByteArray &pem, const QByteArray &passPhra
cipher = DesEde3Cbc;
} else if (dekInfo.first() == "RC2-CBC") {
cipher = Rc2Cbc;
-#if defined(QT_SECURETRANSPORT) || QT_CONFIG(schannel)
} else if (dekInfo.first() == "AES-128-CBC") {
cipher = Aes128Cbc;
} else if (dekInfo.first() == "AES-192-CBC") {
cipher = Aes192Cbc;
} else if (dekInfo.first() == "AES-256-CBC") {
cipher = Aes256Cbc;
-#endif // QT_SECURETRANSPORT || schannel
} else {
clear(deepClear);
return;
diff --git a/src/network/ssl/qsslkey_winrt.cpp b/src/network/ssl/qsslkey_winrt.cpp
index f2ed813965..69eaaa387f 100644
--- a/src/network/ssl/qsslkey_winrt.cpp
+++ b/src/network/ssl/qsslkey_winrt.cpp
@@ -83,6 +83,15 @@ struct SslKeyGlobal
hr = keyProviderFactory->OpenAlgorithm(HString::MakeReference(L"RC2_CBC").Get(),
&keyProviders[QSslKeyPrivate::Rc2Cbc]);
Q_ASSERT_SUCCEEDED(hr);
+ hr = keyProviderFactory->OpenAlgorithm(HString::MakeReference(L"AES_CBC").Get(),
+ &keyProviders[QSslKeyPrivate::Aes128Cbc]);
+ Q_ASSERT_SUCCEEDED(hr);
+ hr = keyProviderFactory->OpenAlgorithm(HString::MakeReference(L"AES_CBC").Get(),
+ &keyProviders[QSslKeyPrivate::Aes192Cbc]);
+ Q_ASSERT_SUCCEEDED(hr);
+ hr = keyProviderFactory->OpenAlgorithm(HString::MakeReference(L"AES_CBC").Get(),
+ &keyProviders[QSslKeyPrivate::Aes256Cbc]);
+ Q_ASSERT_SUCCEEDED(hr);
hr = GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Security_Cryptography_CryptographicBuffer).Get(),
&bufferFactory);
diff --git a/src/network/ssl/qsslsocket_openssl_symbols.cpp b/src/network/ssl/qsslsocket_openssl_symbols.cpp
index f136c92a65..e04d45c10c 100644
--- a/src/network/ssl/qsslsocket_openssl_symbols.cpp
+++ b/src/network/ssl/qsslsocket_openssl_symbols.cpp
@@ -359,6 +359,11 @@ DEFINEFUNC(const EVP_CIPHER *, EVP_des_ede3_cbc, DUMMYARG, DUMMYARG, return null
#ifndef OPENSSL_NO_RC2
DEFINEFUNC(const EVP_CIPHER *, EVP_rc2_cbc, DUMMYARG, DUMMYARG, return nullptr, return)
#endif
+#ifndef OPENSSL_NO_AES
+DEFINEFUNC(const EVP_CIPHER *, EVP_aes_128_cbc, DUMMYARG, DUMMYARG, return nullptr, return)
+DEFINEFUNC(const EVP_CIPHER *, EVP_aes_192_cbc, DUMMYARG, DUMMYARG, return nullptr, return)
+DEFINEFUNC(const EVP_CIPHER *, EVP_aes_256_cbc, DUMMYARG, DUMMYARG, return nullptr, return)
+#endif
DEFINEFUNC(const EVP_MD *, EVP_sha1, DUMMYARG, DUMMYARG, return nullptr, return)
DEFINEFUNC3(int, EVP_PKEY_assign, EVP_PKEY *a, a, int b, b, char *c, c, return -1, return)
DEFINEFUNC2(int, EVP_PKEY_set1_RSA, EVP_PKEY *a, a, RSA *b, b, return -1, return)
@@ -1179,6 +1184,11 @@ bool q_resolveOpenSslSymbols()
#ifndef OPENSSL_NO_RC2
RESOLVEFUNC(EVP_rc2_cbc)
#endif
+#ifndef OPENSSL_NO_AES
+ RESOLVEFUNC(EVP_aes_128_cbc)
+ RESOLVEFUNC(EVP_aes_192_cbc)
+ RESOLVEFUNC(EVP_aes_256_cbc)
+#endif
RESOLVEFUNC(EVP_sha1)
RESOLVEFUNC(EVP_PKEY_assign)
RESOLVEFUNC(EVP_PKEY_set1_RSA)
diff --git a/src/network/ssl/qsslsocket_openssl_symbols_p.h b/src/network/ssl/qsslsocket_openssl_symbols_p.h
index 59b6e53940..fcf96dbd47 100644
--- a/src/network/ssl/qsslsocket_openssl_symbols_p.h
+++ b/src/network/ssl/qsslsocket_openssl_symbols_p.h
@@ -281,6 +281,11 @@ const EVP_CIPHER *q_EVP_des_ede3_cbc();
#ifndef OPENSSL_NO_RC2
const EVP_CIPHER *q_EVP_rc2_cbc();
#endif
+#ifndef OPENSSL_NO_AES
+const EVP_CIPHER *q_EVP_aes_128_cbc();
+const EVP_CIPHER *q_EVP_aes_192_cbc();
+const EVP_CIPHER *q_EVP_aes_256_cbc();
+#endif
Q_AUTOTEST_EXPORT const EVP_MD *q_EVP_sha1();
int q_EVP_PKEY_assign(EVP_PKEY *a, int b, char *c);
Q_AUTOTEST_EXPORT int q_EVP_PKEY_set1_RSA(EVP_PKEY *a, RSA *b);
diff --git a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp
index aa8f9a892a..e545d54ec2 100644
--- a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp
+++ b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp
@@ -908,7 +908,7 @@ QFont QFontconfigDatabase::defaultFont() const
void QFontconfigDatabase::setupFontEngine(QFontEngineFT *engine, const QFontDef &fontDef) const
{
bool antialias = !(fontDef.styleStrategy & QFont::NoAntialias);
- bool forcedAntialiasSetting = !antialias;
+ bool forcedAntialiasSetting = !antialias || QHighDpiScaling::isActive();
const QPlatformServices *services = QGuiApplicationPrivate::platformIntegration()->services();
bool useXftConf = false;
diff --git a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
index 7957cd130a..25e7c6df72 100644
--- a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
+++ b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
@@ -491,9 +491,11 @@ void QCoreTextFontEngine::draw(CGContextRef ctx, qreal x, qreal y, const QTextIt
struct ConvertPathInfo
{
- ConvertPathInfo(QPainterPath *newPath, const QPointF &newPos) : path(newPath), pos(newPos) {}
+ ConvertPathInfo(QPainterPath *newPath, const QPointF &newPos, qreal newStretch = 1.0) :
+ path(newPath), pos(newPos), stretch(newStretch) {}
QPainterPath *path;
QPointF pos;
+ qreal stretch;
};
static void convertCGPathToQPainterPath(void *info, const CGPathElement *element)
@@ -501,25 +503,25 @@ static void convertCGPathToQPainterPath(void *info, const CGPathElement *element
ConvertPathInfo *myInfo = static_cast<ConvertPathInfo *>(info);
switch(element->type) {
case kCGPathElementMoveToPoint:
- myInfo->path->moveTo(element->points[0].x + myInfo->pos.x(),
+ myInfo->path->moveTo((element->points[0].x * myInfo->stretch) + myInfo->pos.x(),
element->points[0].y + myInfo->pos.y());
break;
case kCGPathElementAddLineToPoint:
- myInfo->path->lineTo(element->points[0].x + myInfo->pos.x(),
+ myInfo->path->lineTo((element->points[0].x * myInfo->stretch) + myInfo->pos.x(),
element->points[0].y + myInfo->pos.y());
break;
case kCGPathElementAddQuadCurveToPoint:
- myInfo->path->quadTo(element->points[0].x + myInfo->pos.x(),
+ myInfo->path->quadTo((element->points[0].x * myInfo->stretch) + myInfo->pos.x(),
element->points[0].y + myInfo->pos.y(),
- element->points[1].x + myInfo->pos.x(),
+ (element->points[1].x * myInfo->stretch) + myInfo->pos.x(),
element->points[1].y + myInfo->pos.y());
break;
case kCGPathElementAddCurveToPoint:
- myInfo->path->cubicTo(element->points[0].x + myInfo->pos.x(),
+ myInfo->path->cubicTo((element->points[0].x * myInfo->stretch) + myInfo->pos.x(),
element->points[0].y + myInfo->pos.y(),
- element->points[1].x + myInfo->pos.x(),
+ (element->points[1].x * myInfo->stretch) + myInfo->pos.x(),
element->points[1].y + myInfo->pos.y(),
- element->points[2].x + myInfo->pos.x(),
+ (element->points[2].x * myInfo->stretch) + myInfo->pos.x(),
element->points[2].y + myInfo->pos.y());
break;
case kCGPathElementCloseSubpath:
@@ -543,9 +545,10 @@ void QCoreTextFontEngine::addGlyphsToPath(glyph_t *glyphs, QFixedPoint *position
if (synthesisFlags & QFontEngine::SynthesizedItalic)
cgMatrix = CGAffineTransformConcat(cgMatrix, CGAffineTransformMake(1, 0, -SYNTHETIC_ITALIC_SKEW, 1, 0, 0));
+ qreal stretch = fontDef.stretch ? qreal(fontDef.stretch) / 100 : 1.0;
for (int i = 0; i < nGlyphs; ++i) {
QCFType<CGPathRef> cgpath = CTFontCreatePathForGlyph(ctfont, glyphs[i], &cgMatrix);
- ConvertPathInfo info(path, positions[i].toPointF());
+ ConvertPathInfo info(path, positions[i].toPointF(), stretch);
CGPathApply(cgpath, &info, convertCGPathToQPainterPath);
}
}
diff --git a/src/platformsupport/fontdatabases/windows/qwindowsfontengine.cpp b/src/platformsupport/fontdatabases/windows/qwindowsfontengine.cpp
index d1d11883c1..2ae378c558 100644
--- a/src/platformsupport/fontdatabases/windows/qwindowsfontengine.cpp
+++ b/src/platformsupport/fontdatabases/windows/qwindowsfontengine.cpp
@@ -702,8 +702,8 @@ static inline double qt_fixed_to_double(const FIXED &p) {
return ((p.value << 16) + p.fract) / 65536.0;
}
-static inline QPointF qt_to_qpointf(const POINTFX &pt, qreal scale) {
- return QPointF(qt_fixed_to_double(pt.x) * scale, -qt_fixed_to_double(pt.y) * scale);
+static inline QPointF qt_to_qpointf(const POINTFX &pt, qreal scale, qreal stretch) {
+ return QPointF(qt_fixed_to_double(pt.x) * scale * stretch, -qt_fixed_to_double(pt.y) * scale);
}
#ifndef GGO_UNHINTED
@@ -711,7 +711,8 @@ static inline QPointF qt_to_qpointf(const POINTFX &pt, qreal scale) {
#endif
static bool addGlyphToPath(glyph_t glyph, const QFixedPoint &position, HDC hdc,
- QPainterPath *path, bool ttf, glyph_metrics_t *metric = 0, qreal scale = 1)
+ QPainterPath *path, bool ttf, glyph_metrics_t *metric = 0,
+ qreal scale = 1.0, qreal stretch = 1.0)
{
MAT2 mat;
mat.eM11.value = mat.eM22.value = 1;
@@ -761,7 +762,7 @@ static bool addGlyphToPath(glyph_t glyph, const QFixedPoint &position, HDC hdc,
while (headerOffset < bufferSize) {
const TTPOLYGONHEADER *ttph = reinterpret_cast<const TTPOLYGONHEADER *>(dataBuffer + headerOffset);
- QPointF lastPoint(qt_to_qpointf(ttph->pfxStart, scale));
+ QPointF lastPoint(qt_to_qpointf(ttph->pfxStart, scale, stretch));
path->moveTo(lastPoint + oset);
offset += sizeof(TTPOLYGONHEADER);
while (offset < headerOffset + ttph->cb) {
@@ -769,7 +770,7 @@ static bool addGlyphToPath(glyph_t glyph, const QFixedPoint &position, HDC hdc,
switch (curve->wType) {
case TT_PRIM_LINE: {
for (int i=0; i<curve->cpfx; ++i) {
- QPointF p = qt_to_qpointf(curve->apfx[i], scale) + oset;
+ QPointF p = qt_to_qpointf(curve->apfx[i], scale, stretch) + oset;
path->lineTo(p);
}
break;
@@ -779,8 +780,8 @@ static bool addGlyphToPath(glyph_t glyph, const QFixedPoint &position, HDC hdc,
QPointF prev(elm.x, elm.y);
QPointF endPoint;
for (int i=0; i<curve->cpfx - 1; ++i) {
- QPointF p1 = qt_to_qpointf(curve->apfx[i], scale) + oset;
- QPointF p2 = qt_to_qpointf(curve->apfx[i+1], scale) + oset;
+ QPointF p1 = qt_to_qpointf(curve->apfx[i], scale, stretch) + oset;
+ QPointF p2 = qt_to_qpointf(curve->apfx[i+1], scale, stretch) + oset;
if (i < curve->cpfx - 2) {
endPoint = QPointF((p1.x() + p2.x()) / 2, (p1.y() + p2.y()) / 2);
} else {
@@ -795,9 +796,9 @@ static bool addGlyphToPath(glyph_t glyph, const QFixedPoint &position, HDC hdc,
}
case TT_PRIM_CSPLINE: {
for (int i=0; i<curve->cpfx; ) {
- QPointF p2 = qt_to_qpointf(curve->apfx[i++], scale) + oset;
- QPointF p3 = qt_to_qpointf(curve->apfx[i++], scale) + oset;
- QPointF p4 = qt_to_qpointf(curve->apfx[i++], scale) + oset;
+ QPointF p2 = qt_to_qpointf(curve->apfx[i++], scale, stretch) + oset;
+ QPointF p3 = qt_to_qpointf(curve->apfx[i++], scale, stretch) + oset;
+ QPointF p4 = qt_to_qpointf(curve->apfx[i++], scale, stretch) + oset;
path->cubicTo(p2, p3, p4);
}
break;
@@ -829,9 +830,11 @@ void QWindowsFontEngine::addGlyphsToPath(glyph_t *glyphs, QFixedPoint *positions
HDC hdc = m_fontEngineData->hdc;
HGDIOBJ oldfont = SelectObject(hdc, hf);
+ qreal scale = qreal(fontDef.pixelSize) / unitsPerEm;
+ qreal stretch = fontDef.stretch ? qreal(fontDef.stretch) / 100 : 1.0;
for(int i = 0; i < nglyphs; ++i) {
if (!addGlyphToPath(glyphs[i], positions[i], hdc, path, ttf, /*metric*/0,
- qreal(fontDef.pixelSize) / unitsPerEm)) {
+ scale, stretch)) {
// Some windows fonts, like "Modern", are vector stroke
// fonts, which are reported as TMPF_VECTOR but do not
// support GetGlyphOutline, and thus we set this bit so
diff --git a/src/platformsupport/glxconvenience/qglxconvenience.cpp b/src/platformsupport/glxconvenience/qglxconvenience.cpp
index 40521ef6da..6458454336 100644
--- a/src/platformsupport/glxconvenience/qglxconvenience.cpp
+++ b/src/platformsupport/glxconvenience/qglxconvenience.cpp
@@ -223,6 +223,7 @@ GLXFBConfig qglx_findConfig(Display *display, int screen , QSurfaceFormat format
continue;
}
+ QXlibPointer<XVisualInfo> visual(glXGetVisualFromFBConfig(display, candidate));
int actualRed;
int actualGreen;
int actualBlue;
@@ -231,7 +232,8 @@ GLXFBConfig qglx_findConfig(Display *display, int screen , QSurfaceFormat format
glXGetFBConfigAttrib(display, candidate, GLX_GREEN_SIZE, &actualGreen);
glXGetFBConfigAttrib(display, candidate, GLX_BLUE_SIZE, &actualBlue);
glXGetFBConfigAttrib(display, candidate, GLX_ALPHA_SIZE, &actualAlpha);
-
+ // Sometimes the visuals don't have a depth that includes the alpha channel.
+ actualAlpha = qMin(actualAlpha, visual->depth - actualRed - actualGreen - actualBlue);
if (requestedRed && actualRed < requestedRed)
continue;
diff --git a/src/platformsupport/input/tslib/qtslib.cpp b/src/platformsupport/input/tslib/qtslib.cpp
index 75ac3c50e0..f8fdc151ec 100644
--- a/src/platformsupport/input/tslib/qtslib.cpp
+++ b/src/platformsupport/input/tslib/qtslib.cpp
@@ -57,7 +57,7 @@ QTsLibMouseHandler::QTsLibMouseHandler(const QString &key,
const QString &specification,
QObject *parent)
: QObject(parent),
- m_notify(0), m_x(0), m_y(0), m_pressed(0), m_rawMode(false)
+ m_rawMode(!key.compare(QLatin1String("TslibRaw"), Qt::CaseInsensitive))
{
qCDebug(qLcTsLib) << "Initializing tslib plugin" << key << specification;
setObjectName(QLatin1String("TSLib Mouse Handler"));
@@ -79,13 +79,11 @@ QTsLibMouseHandler::QTsLibMouseHandler(const QString &key,
if (ts_config(m_dev))
qErrnoWarning(errno, "ts_config() failed");
- m_rawMode = !key.compare(QLatin1String("TslibRaw"), Qt::CaseInsensitive);
-
int fd = ts_fd(m_dev);
if (fd >= 0) {
qCDebug(qLcTsLib) << "tslib device is" << device;
m_notify = new QSocketNotifier(fd, QSocketNotifier::Read, this);
- connect(m_notify, SIGNAL(activated(int)), this, SLOT(readMouseData()));
+ connect(m_notify, &QSocketNotifier::activated, this, &QTsLibMouseHandler::readMouseData);
} else {
qErrnoWarning(errno, "tslib: Cannot open input device %s", device.constData());
}
@@ -129,7 +127,9 @@ void QTsLibMouseHandler::readMouseData()
}
QPoint pos(x, y);
- QWindowSystemInterface::handleMouseEvent(0, pos, pos, pressed ? Qt::LeftButton : Qt::NoButton);
+ QWindowSystemInterface::handleMouseEvent(nullptr, pos, pos,
+ pressed ? Qt::LeftButton : Qt::NoButton,
+ Qt::NoButton, QEvent::None);
m_x = x;
m_y = y;
diff --git a/src/platformsupport/input/tslib/qtslib_p.h b/src/platformsupport/input/tslib/qtslib_p.h
index 0c08fb6a3d..ffd60cd0e3 100644
--- a/src/platformsupport/input/tslib/qtslib_p.h
+++ b/src/platformsupport/input/tslib/qtslib_p.h
@@ -71,11 +71,12 @@ private slots:
void readMouseData();
private:
- QSocketNotifier * m_notify;
+ QSocketNotifier * m_notify = nullptr;
tsdev *m_dev;
- int m_x, m_y;
- bool m_pressed;
- bool m_rawMode;
+ int m_x = 0;
+ int m_y = 0;
+ bool m_pressed = false;
+ const bool m_rawMode;
};
QT_END_NAMESPACE
diff --git a/src/platformsupport/input/xkbcommon/xkbcommon.pro b/src/platformsupport/input/xkbcommon/xkbcommon.pro
index 2f5d132b5c..22b16ae44a 100644
--- a/src/platformsupport/input/xkbcommon/xkbcommon.pro
+++ b/src/platformsupport/input/xkbcommon/xkbcommon.pro
@@ -7,7 +7,7 @@ CONFIG += static internal_module
DEFINES += QT_NO_CAST_FROM_ASCII
PRECOMPILED_HEADER = ../../../corelib/global/qt_pch.h
-QMAKE_USE_PRIVATE += xkbcommon
+QMAKE_USE += xkbcommon
HEADERS += \
qxkbcommon_p.h
diff --git a/src/plugins/platforminputcontexts/ibus/ibus.pro b/src/plugins/platforminputcontexts/ibus/ibus.pro
index 52836bb8b6..9ba2297e38 100644
--- a/src/plugins/platforminputcontexts/ibus/ibus.pro
+++ b/src/plugins/platforminputcontexts/ibus/ibus.pro
@@ -1,6 +1,6 @@
TARGET = ibusplatforminputcontextplugin
-QT += dbus gui-private
+QT += dbus gui-private xkbcommon_support-private
SOURCES += $$PWD/qibusplatforminputcontext.cpp \
$$PWD/qibusproxy.cpp \
$$PWD/qibusproxyportal.cpp \
diff --git a/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp b/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp
index 7e66439ea7..f2429f24ff 100644
--- a/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp
+++ b/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp
@@ -51,6 +51,8 @@
#include <QtGui/private/qguiapplication_p.h>
+#include <QtXkbCommonSupport/private/qxkbcommon_p.h>
+
#include "qibusproxy.h"
#include "qibusproxyportal.h"
#include "qibusinputcontextproxy.h"
@@ -335,14 +337,12 @@ void QIBusPlatformInputContext::forwardKeyEvent(uint keyval, uint keycode, uint
if (!input)
return;
- if (debug)
- qDebug() << "forwardKeyEvent" << keyval << keycode << state;
-
QEvent::Type type = QEvent::KeyPress;
if (state & IBUS_RELEASE_MASK)
type = QEvent::KeyRelease;
state &= ~IBUS_RELEASE_MASK;
+ keycode += 8;
Qt::KeyboardModifiers modifiers = Qt::NoModifier;
if (state & IBUS_SHIFT_MASK)
@@ -354,7 +354,13 @@ void QIBusPlatformInputContext::forwardKeyEvent(uint keyval, uint keycode, uint
if (state & IBUS_META_MASK)
modifiers |= Qt::MetaModifier;
- QKeyEvent event(type, keyval, modifiers, QString(keyval));
+ int qtcode = QXkbCommon::keysymToQtKey(keyval, modifiers);
+ QString text = QXkbCommon::lookupStringNoKeysymTransformations(keyval);
+
+ if (debug)
+ qDebug() << "forwardKeyEvent" << keyval << keycode << state << modifiers << qtcode << text;
+
+ QKeyEvent event(type, qtcode, modifiers, keycode, keyval, state, text);
QCoreApplication::sendEvent(input, &event);
}
diff --git a/src/plugins/platforminputcontexts/platforminputcontexts.pro b/src/plugins/platforminputcontexts/platforminputcontexts.pro
index 68f6792377..56a39a49e7 100644
--- a/src/plugins/platforminputcontexts/platforminputcontexts.pro
+++ b/src/plugins/platforminputcontexts/platforminputcontexts.pro
@@ -1,10 +1,11 @@
TEMPLATE = subdirs
QT_FOR_CONFIG += gui-private
-qtHaveModule(dbus) {
-!mac:!win32:SUBDIRS += ibus
-}
-
-qtConfig(xkbcommon): SUBDIRS += compose
+qtConfig(xkbcommon) {
+ SUBDIRS += compose
+ qtHaveModule(dbus) {
+ !macos:!win32:SUBDIRS += ibus
+ }
+}
diff --git a/src/plugins/platforms/android/qandroidplatformintegration.cpp b/src/plugins/platforms/android/qandroidplatformintegration.cpp
index 763b294660..e0c437be27 100644
--- a/src/plugins/platforms/android/qandroidplatformintegration.cpp
+++ b/src/plugins/platforms/android/qandroidplatformintegration.cpp
@@ -173,7 +173,7 @@ QAndroidPlatformIntegration::QAndroidPlatformIntegration(const QStringList &para
qFatal("Could not bind GL_ES API");
m_primaryScreen = new QAndroidPlatformScreen();
- screenAdded(m_primaryScreen);
+ QWindowSystemInterface::handleScreenAdded(m_primaryScreen);
m_primaryScreen->setPhysicalSize(QSize(m_defaultPhysicalSizeWidth, m_defaultPhysicalSizeHeight));
m_primaryScreen->setSize(QSize(m_defaultScreenWidth, m_defaultScreenHeight));
m_primaryScreen->setAvailableGeometry(QRect(0, 0, m_defaultGeometryWidth, m_defaultGeometryHeight));
diff --git a/src/plugins/platforms/bsdfb/qbsdfbintegration.cpp b/src/plugins/platforms/bsdfb/qbsdfbintegration.cpp
index 6a7d445e69..e4c90d26af 100644
--- a/src/plugins/platforms/bsdfb/qbsdfbintegration.cpp
+++ b/src/plugins/platforms/bsdfb/qbsdfbintegration.cpp
@@ -53,6 +53,7 @@
#include <QtGui/private/qguiapplication_p.h>
#include <qpa/qplatforminputcontext.h>
#include <qpa/qplatforminputcontextfactory_p.h>
+#include <qpa/qwindowsysteminterface.h>
#if QT_CONFIG(tslib)
#include <QtInputSupport/private/qtslib_p.h>
@@ -69,13 +70,13 @@ QBsdFbIntegration::QBsdFbIntegration(const QStringList &paramList)
QBsdFbIntegration::~QBsdFbIntegration()
{
- destroyScreen(m_primaryScreen.take());
+ QWindowSystemInterface::handleScreenRemoved(m_primaryScreen.take());
}
void QBsdFbIntegration::initialize()
{
if (m_primaryScreen->initialize())
- screenAdded(m_primaryScreen.data());
+ QWindowSystemInterface::handleScreenAdded(m_primaryScreen.data());
else
qWarning("bsdfb: Failed to initialize screen");
diff --git a/src/plugins/platforms/cocoa/cocoa.pro b/src/plugins/platforms/cocoa/cocoa.pro
index 8d65cf328f..083b7c1655 100644
--- a/src/plugins/platforms/cocoa/cocoa.pro
+++ b/src/plugins/platforms/cocoa/cocoa.pro
@@ -33,6 +33,7 @@ SOURCES += main.mm \
qcocoaintrospection.mm \
qcocoakeymapper.mm \
qcocoamimetypes.mm \
+ qiosurfacegraphicsbuffer.mm \
messages.cpp
HEADERS += qcocoaintegration.h \
@@ -67,6 +68,7 @@ HEADERS += qcocoaintegration.h \
qcocoaintrospection.h \
qcocoakeymapper.h \
messages.h \
+ qiosurfacegraphicsbuffer.h \
qcocoamimetypes.h
qtConfig(opengl.*) {
@@ -81,7 +83,7 @@ qtConfig(vulkan) {
RESOURCES += qcocoaresources.qrc
-LIBS += -framework AppKit -framework CoreServices -framework Carbon -framework IOKit -framework QuartzCore -framework CoreVideo -framework Metal -lcups
+LIBS += -framework AppKit -framework CoreServices -framework Carbon -framework IOKit -framework QuartzCore -framework CoreVideo -framework Metal -framework IOSurface -lcups
QT += \
core-private gui-private \
diff --git a/src/plugins/platforms/cocoa/qcocoabackingstore.h b/src/plugins/platforms/cocoa/qcocoabackingstore.h
index b4cd506513..508f24d578 100644
--- a/src/plugins/platforms/cocoa/qcocoabackingstore.h
+++ b/src/plugins/platforms/cocoa/qcocoabackingstore.h
@@ -44,13 +44,16 @@
#include <private/qcore_mac_p.h>
+#include <QScopedPointer>
+#include "qiosurfacegraphicsbuffer.h"
+
QT_BEGIN_NAMESPACE
-class QCocoaBackingStore : public QRasterBackingStore
+class QNSWindowBackingStore : public QRasterBackingStore
{
public:
- QCocoaBackingStore(QWindow *window);
- ~QCocoaBackingStore();
+ QNSWindowBackingStore(QWindow *window);
+ ~QNSWindowBackingStore();
void flush(QWindow *, const QRegion &, const QPoint &) override;
@@ -60,6 +63,49 @@ private:
void redrawRoundedBottomCorners(CGRect) const;
};
+class QCALayerBackingStore : public QPlatformBackingStore
+{
+public:
+ QCALayerBackingStore(QWindow *window);
+ ~QCALayerBackingStore();
+
+ void resize(const QSize &size, const QRegion &staticContents) override;
+
+ void beginPaint(const QRegion &region) override;
+ QPaintDevice *paintDevice() override;
+ void endPaint() override;
+
+ void flush(QWindow *, const QRegion &, const QPoint &) override;
+ void composeAndFlush(QWindow *window, const QRegion &region, const QPoint &offset,
+ QPlatformTextureList *textures, bool translucentBackground) override;
+
+ QPlatformGraphicsBuffer *graphicsBuffer() const override;
+
+private:
+ QSize m_requestedSize;
+ QRegion m_paintedRegion;
+
+ class GraphicsBuffer : public QIOSurfaceGraphicsBuffer
+ {
+ public:
+ GraphicsBuffer(const QSize &size, qreal devicePixelRatio,
+ const QPixelFormat &format, QCFType<CGColorSpaceRef> colorSpace);
+
+ QRegion dirtyRegion; // In unscaled coordinates
+ QImage *asImage();
+
+ private:
+ qreal m_devicePixelRatio;
+ QImage m_image;
+ };
+
+ void ensureBackBuffer();
+ bool recreateBackBufferIfNeeded();
+ bool prepareForFlush();
+
+ std::list<std::unique_ptr<GraphicsBuffer>> m_buffers;
+};
+
QT_END_NAMESPACE
#endif
diff --git a/src/plugins/platforms/cocoa/qcocoabackingstore.mm b/src/plugins/platforms/cocoa/qcocoabackingstore.mm
index 81a0a7d040..8e4e928bc5 100644
--- a/src/plugins/platforms/cocoa/qcocoabackingstore.mm
+++ b/src/plugins/platforms/cocoa/qcocoabackingstore.mm
@@ -42,24 +42,28 @@
#include "qcocoawindow.h"
#include "qcocoahelpers.h"
+#include <QtCore/qmath.h>
+
+#include <QuartzCore/CATransaction.h>
+
QT_BEGIN_NAMESPACE
-QCocoaBackingStore::QCocoaBackingStore(QWindow *window)
+QNSWindowBackingStore::QNSWindowBackingStore(QWindow *window)
: QRasterBackingStore(window)
{
}
-QCocoaBackingStore::~QCocoaBackingStore()
+QNSWindowBackingStore::~QNSWindowBackingStore()
{
}
-bool QCocoaBackingStore::windowHasUnifiedToolbar() const
+bool QNSWindowBackingStore::windowHasUnifiedToolbar() const
{
Q_ASSERT(window()->handle());
return static_cast<QCocoaWindow *>(window()->handle())->m_drawContentBorderGradient;
}
-QImage::Format QCocoaBackingStore::format() const
+QImage::Format QNSWindowBackingStore::format() const
{
if (windowHasUnifiedToolbar())
return QImage::Format_ARGB32_Premultiplied;
@@ -78,7 +82,7 @@ QImage::Format QCocoaBackingStore::format() const
coordinates, and the \a offset will be the child window's offset in relation
to the backingstore's top level window.
*/
-void QCocoaBackingStore::flush(QWindow *window, const QRegion &region, const QPoint &offset)
+void QNSWindowBackingStore::flush(QWindow *window, const QRegion &region, const QPoint &offset)
{
if (m_image.isNull())
return;
@@ -103,131 +107,113 @@ void QCocoaBackingStore::flush(QWindow *window, const QRegion &region, const QPo
qCDebug(lcQpaBackingStore) << "Flushing" << region << "of" << view << qPrintable(targetViewDescription);
}
- // Prevent potentially costly color conversion by assigning the display color space
- // to the backingstore image. This does not copy the underlying image data.
- CGColorSpaceRef displayColorSpace = view.window.screen.colorSpace.CGColorSpace;
- QCFType<CGImageRef> cgImage = CGImageCreateCopyWithColorSpace(
- QCFType<CGImageRef>(m_image.toCGImage()), displayColorSpace);
-
- if (view.layer) {
- // In layer-backed mode, locking focus on a view does not give the right
- // view transformation, and doesn't give us a graphics context to render
- // via when drawing outside of the display cycle. Instead we tell AppKit
- // that we want to update the layer's content, via [NSView wantsUpdateLayer],
- // which result in AppKit not creating a backingstore for each layer, and
- // we then directly set the layer's backingstore (content) to our backingstore,
- // masked to the part of the subview that is relevant.
- // FIXME: Figure out if there's a way to do partial updates
- view.layer.contents = (__bridge id)static_cast<CGImageRef>(cgImage);
- if (view != topLevelView) {
- const CGSize topLevelSize = topLevelView.bounds.size;
- view.layer.contentsRect = CGRectApplyAffineTransform(
- [view convertRect:view.bounds toView:topLevelView],
- // The contentsRect is in unit coordinate system
- CGAffineTransformMakeScale(1.0 / topLevelSize.width, 1.0 / topLevelSize.height));
- }
- } else {
- // Normally a NSView is drawn via drawRect, as part of the display cycle in the
- // main runloop, via setNeedsDisplay and friends. AppKit will lock focus on each
- // individual view, starting with the top level and then traversing any subviews,
- // calling drawRect for each of them. This pull model results in expose events
- // sent to Qt, which result in drawing to the backingstore and flushing it.
- // Qt may also decide to paint and flush the backingstore via e.g. timers,
- // or other events such as mouse events, in which case we're in a push model.
- // If there is no focused view, it means we're in the latter case, and need
- // to manually flush the NSWindow after drawing to its graphic context.
- const bool drawingOutsideOfDisplayCycle = ![NSView focusView];
-
- // We also need to ensure the flushed view has focus, so that the graphics
- // context is set up correctly (coordinate system, clipping, etc). Outside
- // of the normal display cycle there is no focused view, as explained above,
- // so we have to handle it manually. There's also a corner case inside the
- // normal display cycle due to way QWidgetBackingStore composits native child
- // widgets, where we'll get a flush of a native child during the drawRect of
- // its parent/ancestor, and the parent/ancestor being the one locked by AppKit.
- // In this case we also need to lock and unlock focus manually.
- const bool shouldHandleViewLockManually = [NSView focusView] != view;
- if (shouldHandleViewLockManually && ![view lockFocusIfCanDraw]) {
- qWarning() << "failed to lock focus of" << view;
- return;
- }
+ // Normally a NSView is drawn via drawRect, as part of the display cycle in the
+ // main runloop, via setNeedsDisplay and friends. AppKit will lock focus on each
+ // individual view, starting with the top level and then traversing any subviews,
+ // calling drawRect for each of them. This pull model results in expose events
+ // sent to Qt, which result in drawing to the backingstore and flushing it.
+ // Qt may also decide to paint and flush the backingstore via e.g. timers,
+ // or other events such as mouse events, in which case we're in a push model.
+ // If there is no focused view, it means we're in the latter case, and need
+ // to manually flush the NSWindow after drawing to its graphic context.
+ const bool drawingOutsideOfDisplayCycle = ![NSView focusView];
+
+ // We also need to ensure the flushed view has focus, so that the graphics
+ // context is set up correctly (coordinate system, clipping, etc). Outside
+ // of the normal display cycle there is no focused view, as explained above,
+ // so we have to handle it manually. There's also a corner case inside the
+ // normal display cycle due to way QWidgetBackingStore composits native child
+ // widgets, where we'll get a flush of a native child during the drawRect of
+ // its parent/ancestor, and the parent/ancestor being the one locked by AppKit.
+ // In this case we also need to lock and unlock focus manually.
+ const bool shouldHandleViewLockManually = [NSView focusView] != view;
+ if (shouldHandleViewLockManually && ![view lockFocusIfCanDraw]) {
+ qWarning() << "failed to lock focus of" << view;
+ return;
+ }
- const qreal devicePixelRatio = m_image.devicePixelRatio();
+ const qreal devicePixelRatio = m_image.devicePixelRatio();
- // If the flushed window is a content view, and we're filling the drawn area
- // completely, or it doesn't have a window background we need to preserve,
- // we can get away with copying instead of blending the backing store.
- QCocoaWindow *cocoaWindow = static_cast<QCocoaWindow *>(window->handle());
- const NSCompositingOperation compositingOperation = cocoaWindow->isContentView()
- && (cocoaWindow->isOpaque() || view.window.backgroundColor == NSColor.clearColor)
- ? NSCompositingOperationCopy : NSCompositingOperationSourceOver;
+ // If the flushed window is a content view, and we're filling the drawn area
+ // completely, or it doesn't have a window background we need to preserve,
+ // we can get away with copying instead of blending the backing store.
+ QCocoaWindow *cocoaWindow = static_cast<QCocoaWindow *>(window->handle());
+ const NSCompositingOperation compositingOperation = cocoaWindow->isContentView()
+ && (cocoaWindow->isOpaque() || view.window.backgroundColor == NSColor.clearColor)
+ ? NSCompositingOperationCopy : NSCompositingOperationSourceOver;
#ifdef QT_DEBUG
- static bool debugBackingStoreFlush = [[NSUserDefaults standardUserDefaults]
- boolForKey:@"QtCocoaDebugBackingStoreFlush"];
+ static bool debugBackingStoreFlush = [[NSUserDefaults standardUserDefaults]
+ boolForKey:@"QtCocoaDebugBackingStoreFlush"];
#endif
- // -------------------------------------------------------------------------
+ // -------------------------------------------------------------------------
- // The current contexts is typically a NSWindowGraphicsContext, but can be
- // NSBitmapGraphicsContext e.g. when debugging the view hierarchy in Xcode.
- // If we need to distinguish things here in the future, we can use e.g.
- // [NSGraphicsContext drawingToScreen], or the attributes of the context.
- NSGraphicsContext *graphicsContext = [NSGraphicsContext currentContext];
- Q_ASSERT_X(graphicsContext, "QCocoaBackingStore",
- "Focusing the view should give us a current graphics context");
+ // The current contexts is typically a NSWindowGraphicsContext, but can be
+ // NSBitmapGraphicsContext e.g. when debugging the view hierarchy in Xcode.
+ // If we need to distinguish things here in the future, we can use e.g.
+ // [NSGraphicsContext drawingToScreen], or the attributes of the context.
+ NSGraphicsContext *graphicsContext = [NSGraphicsContext currentContext];
+ Q_ASSERT_X(graphicsContext, "QCocoaBackingStore",
+ "Focusing the view should give us a current graphics context");
- // Create temporary image to use for blitting, without copying image data
- NSImage *backingStoreImage = [[[NSImage alloc] initWithCGImage:cgImage size:NSZeroSize] autorelease];
+ // Prevent potentially costly color conversion by assigning the display color space
+ // to the backingstore image. This does not copy the underlying image data.
+ CGColorSpaceRef displayColorSpace = view.window.screen.colorSpace.CGColorSpace;
+ QCFType<CGImageRef> cgImage = CGImageCreateCopyWithColorSpace(
+ QCFType<CGImageRef>(m_image.toCGImage()), displayColorSpace);
- QRegion clippedRegion = region;
- for (QWindow *w = window; w; w = w->parent()) {
- if (!w->mask().isEmpty()) {
- clippedRegion &= w == window ? w->mask()
- : w->mask().translated(window->mapFromGlobal(w->mapToGlobal(QPoint(0, 0))));
- }
+ // Create temporary image to use for blitting, without copying image data
+ NSImage *backingStoreImage = [[[NSImage alloc] initWithCGImage:cgImage size:NSZeroSize] autorelease];
+
+ QRegion clippedRegion = region;
+ for (QWindow *w = window; w; w = w->parent()) {
+ if (!w->mask().isEmpty()) {
+ clippedRegion &= w == window ? w->mask()
+ : w->mask().translated(window->mapFromGlobal(w->mapToGlobal(QPoint(0, 0))));
}
+ }
- for (const QRect &viewLocalRect : clippedRegion) {
- QPoint backingStoreOffset = viewLocalRect.topLeft() + offset;
- QRect backingStoreRect(backingStoreOffset * devicePixelRatio, viewLocalRect.size() * devicePixelRatio);
- if (graphicsContext.flipped) // Flip backingStoreRect to match graphics context
- backingStoreRect.moveTop(m_image.height() - (backingStoreRect.y() + backingStoreRect.height()));
+ for (const QRect &viewLocalRect : clippedRegion) {
+ QPoint backingStoreOffset = viewLocalRect.topLeft() + offset;
+ QRect backingStoreRect(backingStoreOffset * devicePixelRatio, viewLocalRect.size() * devicePixelRatio);
+ if (graphicsContext.flipped) // Flip backingStoreRect to match graphics context
+ backingStoreRect.moveTop(m_image.height() - (backingStoreRect.y() + backingStoreRect.height()));
- CGRect viewRect = viewLocalRect.toCGRect();
+ CGRect viewRect = viewLocalRect.toCGRect();
- if (windowHasUnifiedToolbar())
- NSDrawWindowBackground(viewRect);
+ if (windowHasUnifiedToolbar())
+ NSDrawWindowBackground(viewRect);
- [backingStoreImage drawInRect:viewRect fromRect:backingStoreRect.toCGRect()
- operation:compositingOperation fraction:1.0 respectFlipped:YES hints:nil];
+ [backingStoreImage drawInRect:viewRect fromRect:backingStoreRect.toCGRect()
+ operation:compositingOperation fraction:1.0 respectFlipped:YES hints:nil];
#ifdef QT_DEBUG
- if (Q_UNLIKELY(debugBackingStoreFlush)) {
- [[NSColor colorWithCalibratedRed:drand48() green:drand48() blue:drand48() alpha:0.3] set];
- [NSBezierPath fillRect:viewRect];
-
- if (drawingOutsideOfDisplayCycle) {
- [[[NSColor magentaColor] colorWithAlphaComponent:0.5] set];
- [NSBezierPath strokeLineFromPoint:viewLocalRect.topLeft().toCGPoint()
- toPoint:viewLocalRect.bottomRight().toCGPoint()];
- }
+ if (Q_UNLIKELY(debugBackingStoreFlush)) {
+ [[NSColor colorWithCalibratedRed:drand48() green:drand48() blue:drand48() alpha:0.3] set];
+ [NSBezierPath fillRect:viewRect];
+
+ if (drawingOutsideOfDisplayCycle) {
+ [[[NSColor magentaColor] colorWithAlphaComponent:0.5] set];
+ [NSBezierPath strokeLineFromPoint:viewLocalRect.topLeft().toCGPoint()
+ toPoint:viewLocalRect.bottomRight().toCGPoint()];
}
-#endif
}
+#endif
+ }
- // -------------------------------------------------------------------------
+ // -------------------------------------------------------------------------
- if (shouldHandleViewLockManually)
- [view unlockFocus];
+ if (shouldHandleViewLockManually)
+ [view unlockFocus];
- if (drawingOutsideOfDisplayCycle) {
- redrawRoundedBottomCorners([view convertRect:region.boundingRect().toCGRect() toView:nil]);
- [view.window flushWindow];
- }
+ if (drawingOutsideOfDisplayCycle) {
+ redrawRoundedBottomCorners([view convertRect:region.boundingRect().toCGRect() toView:nil]);
+ [view.window flushWindow];
}
- // Done flushing to either CALayer or NSWindow backingstore
+
+ // Done flushing to NSWindow backingstore
QCocoaWindow *topLevelCocoaWindow = static_cast<QCocoaWindow *>(topLevelWindow->handle());
if (Q_UNLIKELY(topLevelCocoaWindow->m_needsInvalidateShadow)) {
@@ -251,7 +237,7 @@ void QCocoaBackingStore::flush(QWindow *window, const QRegion &region, const QPo
https://trac.webkit.org/changeset/85376/webkit
*/
-void QCocoaBackingStore::redrawRoundedBottomCorners(CGRect windowRect) const
+void QNSWindowBackingStore::redrawRoundedBottomCorners(CGRect windowRect) const
{
#if !defined(QT_APPLE_NO_PRIVATE_APIS)
Q_ASSERT(this->window()->handle());
@@ -285,4 +271,345 @@ void QCocoaBackingStore::redrawRoundedBottomCorners(CGRect windowRect) const
#endif
}
+// ----------------------------------------------------------------------------
+
+// https://stackoverflow.com/a/52722575/2761869
+template<class R>
+struct backwards_t {
+ R r;
+ constexpr auto begin() const { using std::rbegin; return rbegin(r); }
+ constexpr auto begin() { using std::rbegin; return rbegin(r); }
+ constexpr auto end() const { using std::rend; return rend(r); }
+ constexpr auto end() { using std::rend; return rend(r); }
+};
+template<class R>
+constexpr backwards_t<R> backwards(R&& r) { return {std::forward<R>(r)}; }
+
+QCALayerBackingStore::QCALayerBackingStore(QWindow *window)
+ : QPlatformBackingStore(window)
+{
+ qCDebug(lcQpaBackingStore) << "Creating QCALayerBackingStore for" << window;
+ m_buffers.resize(1);
+}
+
+QCALayerBackingStore::~QCALayerBackingStore()
+{
+}
+
+void QCALayerBackingStore::resize(const QSize &size, const QRegion &staticContents)
+{
+ qCDebug(lcQpaBackingStore) << "Resize requested to" << size;
+
+ if (!staticContents.isNull())
+ qCWarning(lcQpaBackingStore) << "QCALayerBackingStore does not support static contents";
+
+ m_requestedSize = size;
+}
+
+void QCALayerBackingStore::beginPaint(const QRegion &region)
+{
+ Q_UNUSED(region);
+
+ QMacAutoReleasePool pool;
+
+ qCInfo(lcQpaBackingStore) << "Beginning paint of" << region << "into backingstore of" << m_requestedSize;
+
+ ensureBackBuffer(); // Find an unused back buffer, or reserve space for a new one
+
+ const bool bufferWasRecreated = recreateBackBufferIfNeeded();
+
+ m_buffers.back()->lock(QPlatformGraphicsBuffer::SWWriteAccess);
+
+ // Although undocumented, QBackingStore::beginPaint expects the painted region
+ // to be cleared before use if the window has a surface format with an alpha.
+ // Fresh IOSurfaces are already cleared, so we don't need to clear those.
+ if (!bufferWasRecreated && window()->format().hasAlpha()) {
+ qCDebug(lcQpaBackingStore) << "Clearing" << region << "before use";
+ QPainter painter(m_buffers.back()->asImage());
+ painter.setCompositionMode(QPainter::CompositionMode_Source);
+ for (const QRect &rect : region)
+ painter.fillRect(rect, Qt::transparent);
+ }
+
+ m_paintedRegion += region;
+}
+
+void QCALayerBackingStore::ensureBackBuffer()
+{
+ if (window()->format().swapBehavior() == QSurfaceFormat::SingleBuffer)
+ return;
+
+ // The current back buffer may have been assigned to a layer in a previous flush,
+ // but we deferred the swap. Do it now if the surface has been picked up by CA.
+ if (m_buffers.back() && m_buffers.back()->isInUse() && m_buffers.back() != m_buffers.front()) {
+ qCInfo(lcQpaBackingStore) << "Back buffer has been picked up by CA, swapping to front";
+ std::swap(m_buffers.back(), m_buffers.front());
+ }
+
+ if (Q_UNLIKELY(lcQpaBackingStore().isDebugEnabled())) {
+ // ┌───────┬───────┬───────┬─────┬──────┐
+ // │ front ┊ spare ┊ spare ┊ ... ┊ back │
+ // └───────┴───────┴───────┴─────┴──────┘
+ for (const auto &buffer : m_buffers) {
+ qCDebug(lcQpaBackingStore).nospace() << " "
+ << (buffer == m_buffers.front() ? "front" :
+ buffer == m_buffers.back() ? " back" :
+ "spare"
+ ) << ": " << buffer.get();
+ }
+ }
+
+ // Ensure our back buffer is ready to draw into. If not, find a buffer that
+ // is not in use, or reserve space for a new buffer if none can be found.
+ for (auto &buffer : backwards(m_buffers)) {
+ if (!buffer || !buffer->isInUse()) {
+ // Buffer is okey to use, swap if necessary
+ if (buffer != m_buffers.back())
+ std::swap(buffer, m_buffers.back());
+ qCDebug(lcQpaBackingStore) << "Using back buffer" << m_buffers.back().get();
+
+ static const int kMaxSwapChainDepth = 3;
+ if (m_buffers.size() > kMaxSwapChainDepth) {
+ qCDebug(lcQpaBackingStore) << "Reducing swap chain depth to" << kMaxSwapChainDepth;
+ m_buffers.erase(std::next(m_buffers.begin(), 1), std::prev(m_buffers.end(), 2));
+ }
+
+ break;
+ } else if (buffer == m_buffers.front()) {
+ // We've exhausted the available buffers, make room for a new one
+ const int swapChainDepth = m_buffers.size() + 1;
+ qCDebug(lcQpaBackingStore) << "Available buffers exhausted, increasing swap chain depth to" << swapChainDepth;
+ m_buffers.resize(swapChainDepth);
+ break;
+ }
+ }
+
+ Q_ASSERT(!m_buffers.back() || !m_buffers.back()->isInUse());
+}
+
+// Disabled until performance issue on 5K iMac Pro has been investigated further,
+// as rounding up during resize will typically result in full screen buffer sizes
+// and low frame rate also for smaller window sizes.
+#define USE_LAZY_BUFFER_ALLOCATION_DURING_LIVE_WINDOW_RESIZE 0
+
+bool QCALayerBackingStore::recreateBackBufferIfNeeded()
+{
+ const qreal devicePixelRatio = window()->devicePixelRatio();
+ QSize requestedBufferSize = m_requestedSize * devicePixelRatio;
+
+ const NSView *backingStoreView = static_cast<QCocoaWindow *>(window()->handle())->view();
+ Q_UNUSED(backingStoreView);
+
+ auto bufferSizeMismatch = [&](const QSize requested, const QSize actual) {
+#if USE_LAZY_BUFFER_ALLOCATION_DURING_LIVE_WINDOW_RESIZE
+ if (backingStoreView.inLiveResize) {
+ // Prevent over-eager buffer allocation during window resize by reusing larger buffers
+ return requested.width() > actual.width() || requested.height() > actual.height();
+ }
+#endif
+ return requested != actual;
+ };
+
+ if (!m_buffers.back() || bufferSizeMismatch(requestedBufferSize, m_buffers.back()->size())) {
+#if USE_LAZY_BUFFER_ALLOCATION_DURING_LIVE_WINDOW_RESIZE
+ if (backingStoreView.inLiveResize) {
+ // Prevent over-eager buffer allocation during window resize by rounding up
+ QSize nativeScreenSize = window()->screen()->geometry().size() * devicePixelRatio;
+ requestedBufferSize = QSize(qNextPowerOfTwo(requestedBufferSize.width()),
+ qNextPowerOfTwo(requestedBufferSize.height())).boundedTo(nativeScreenSize);
+ }
+#endif
+
+ qCInfo(lcQpaBackingStore) << "Creating surface of" << requestedBufferSize
+ << "based on requested" << m_requestedSize << "and dpr =" << devicePixelRatio;
+
+ static auto pixelFormat = QImage::toPixelFormat(QImage::Format_ARGB32_Premultiplied);
+
+ NSView *view = static_cast<QCocoaWindow *>(window()->handle())->view();
+ auto colorSpace = QCFType<CGColorSpaceRef>::constructFromGet(view.window.screen.colorSpace.CGColorSpace);
+
+ m_buffers.back().reset(new GraphicsBuffer(requestedBufferSize, devicePixelRatio, pixelFormat, colorSpace));
+ return true;
+ }
+
+ return false;
+}
+
+QPaintDevice *QCALayerBackingStore::paintDevice()
+{
+ Q_ASSERT(m_buffers.back());
+ return m_buffers.back()->asImage();
+}
+
+void QCALayerBackingStore::endPaint()
+{
+ qCInfo(lcQpaBackingStore) << "Paint ended with painted region" << m_paintedRegion;
+ m_buffers.back()->unlock();
+}
+
+void QCALayerBackingStore::flush(QWindow *flushedWindow, const QRegion &region, const QPoint &offset)
+{
+ Q_UNUSED(region);
+ Q_UNUSED(offset);
+
+ if (!prepareForFlush())
+ return;
+
+ QMacAutoReleasePool pool;
+
+ NSView *backingStoreView = static_cast<QCocoaWindow *>(window()->handle())->view();
+ NSView *flushedView = static_cast<QCocoaWindow *>(flushedWindow->handle())->view();
+
+ id backBufferSurface = (__bridge id)m_buffers.back()->surface();
+ if (flushedView.layer.contents == backBufferSurface) {
+ // We've managed to paint to the back buffer again before Core Animation had time
+ // to flush the transaction and persist the layer changes to the window server.
+ // The layer already knows about the back buffer, and we don't need to re-apply
+ // it to pick up the surface changes, so bail out early.
+ qCInfo(lcQpaBackingStore).nospace() << "Skipping flush of " << flushedView
+ << ", layer already reflects back buffer";
+ return;
+ }
+
+ // Trigger a new display cycle if there isn't one. This ensures that our layer updates
+ // are committed as part of a display-cycle instead of on the next runloop pass. This
+ // means CA won't try to throttle us if we flush too fast, and we'll coalesce our flush
+ // with other pending view and layer updates.
+ backingStoreView.window.viewsNeedDisplay = YES;
+
+ if (window()->format().swapBehavior() == QSurfaceFormat::SingleBuffer) {
+ // The private API [CALayer reloadValueForKeyPath:@"contents"] would be preferable,
+ // but barring any side effects or performance issues we opt for the hammer for now.
+ flushedView.layer.contents = nil;
+ }
+
+ qCInfo(lcQpaBackingStore) << "Flushing" << backBufferSurface
+ << "to" << flushedView.layer << "of" << flushedView;
+
+ flushedView.layer.contents = backBufferSurface;
+
+ if (flushedView != backingStoreView) {
+ const CGSize backingStoreSize = backingStoreView.bounds.size;
+ flushedView.layer.contentsRect = CGRectApplyAffineTransform(
+ [flushedView convertRect:flushedView.bounds toView:backingStoreView],
+ // The contentsRect is in unit coordinate system
+ CGAffineTransformMakeScale(1.0 / backingStoreSize.width, 1.0 / backingStoreSize.height));
+ }
+
+ // Since we may receive multiple flushes before a new frame is started, we do not
+ // swap any buffers just yet. Instead we check in the next beginPaint if the layer's
+ // surface is in use, and if so swap to an unused surface as the new back buffer.
+
+ // Note: Ideally CoreAnimation would mark a surface as in use the moment we assign
+ // it to a layer, but as that's not the case we may end up painting to the same back
+ // buffer once more if we are painting faster than CA can ship the surfaces over to
+ // the window server.
+}
+
+void QCALayerBackingStore::composeAndFlush(QWindow *window, const QRegion &region, const QPoint &offset,
+ QPlatformTextureList *textures, bool translucentBackground)
+{
+ if (!prepareForFlush())
+ return;
+
+ QPlatformBackingStore::composeAndFlush(window, region, offset, textures, translucentBackground);
+}
+
+QPlatformGraphicsBuffer *QCALayerBackingStore::graphicsBuffer() const
+{
+ return m_buffers.back().get();
+}
+
+bool QCALayerBackingStore::prepareForFlush()
+{
+ if (!m_buffers.back()) {
+ qCWarning(lcQpaBackingStore) << "Tried to flush backingstore without painting to it first";
+ return false;
+ }
+
+ // Update dirty state of buffers based on what was painted. The back buffer will be
+ // less dirty, since we painted to it, while other buffers will become more dirty.
+ // This allows us to minimize copies between front and back buffers on swap in the
+ // cases where the painted region overlaps with the previous frame (front buffer).
+ for (const auto &buffer : m_buffers) {
+ if (buffer == m_buffers.back())
+ buffer->dirtyRegion -= m_paintedRegion;
+ else
+ buffer->dirtyRegion += m_paintedRegion;
+ }
+
+ // After painting, the back buffer is only guaranteed to have content for the painted
+ // region, and may still have dirty areas that need to be synced up with the front buffer,
+ // if we have one. We know that the front buffer is always up to date.
+ if (!m_buffers.back()->dirtyRegion.isEmpty() && m_buffers.front() != m_buffers.back()) {
+ QRegion preserveRegion = m_buffers.back()->dirtyRegion;
+ qCDebug(lcQpaBackingStore) << "Preserving" << preserveRegion << "from front to back buffer";
+
+ m_buffers.front()->lock(QPlatformGraphicsBuffer::SWReadAccess);
+ const QImage *frontBuffer = m_buffers.front()->asImage();
+
+ const QRect frontSurfaceBounds(QPoint(0, 0), m_buffers.front()->size());
+ const qreal sourceDevicePixelRatio = frontBuffer->devicePixelRatio();
+
+ m_buffers.back()->lock(QPlatformGraphicsBuffer::SWWriteAccess);
+ QPainter painter(m_buffers.back()->asImage());
+ painter.setCompositionMode(QPainter::CompositionMode_Source);
+
+ // Let painter operate in device pixels, to make it easier to compare coordinates
+ const qreal targetDevicePixelRatio = painter.device()->devicePixelRatio();
+ painter.scale(1.0 / targetDevicePixelRatio, 1.0 / targetDevicePixelRatio);
+
+ for (const QRect &rect : preserveRegion) {
+ QRect sourceRect(rect.topLeft() * sourceDevicePixelRatio, rect.size() * sourceDevicePixelRatio);
+ QRect targetRect(rect.topLeft() * targetDevicePixelRatio, rect.size() * targetDevicePixelRatio);
+
+#ifdef QT_DEBUG
+ if (Q_UNLIKELY(!frontSurfaceBounds.contains(sourceRect.bottomRight()))) {
+ qCWarning(lcQpaBackingStore) << "Front buffer too small to preserve"
+ << QRegion(sourceRect).subtracted(frontSurfaceBounds);
+ }
+#endif
+ painter.drawImage(targetRect, *frontBuffer, sourceRect);
+ }
+
+ m_buffers.back()->unlock();
+ m_buffers.front()->unlock();
+
+ // The back buffer is now completely in sync, ready to be presented
+ m_buffers.back()->dirtyRegion = QRegion();
+ }
+
+ // Prepare for another round of painting
+ m_paintedRegion = QRegion();
+
+ return true;
+}
+
+// ----------------------------------------------------------------------------
+
+QCALayerBackingStore::GraphicsBuffer::GraphicsBuffer(const QSize &size, qreal devicePixelRatio,
+ const QPixelFormat &format, QCFType<CGColorSpaceRef> colorSpace)
+ : QIOSurfaceGraphicsBuffer(size, format, colorSpace)
+ , dirtyRegion(0, 0, size.width() / devicePixelRatio, size.height() / devicePixelRatio)
+ , m_devicePixelRatio(devicePixelRatio)
+{
+}
+
+QImage *QCALayerBackingStore::GraphicsBuffer::asImage()
+{
+ if (m_image.isNull()) {
+ qCDebug(lcQpaBackingStore) << "Setting up paint device for" << this;
+ CFRetain(surface());
+ m_image = QImage(data(), size().width(), size().height(),
+ bytesPerLine(), QImage::toImageFormat(format()),
+ QImageCleanupFunction(CFRelease), surface());
+ m_image.setDevicePixelRatio(m_devicePixelRatio);
+ }
+
+ Q_ASSERT_X(m_image.constBits() == data(), "QCALayerBackingStore",
+ "IOSurfaces should have have a fixed location in memory once created");
+
+ return &m_image;
+}
+
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/cocoa/qcocoaintegration.mm b/src/plugins/platforms/cocoa/qcocoaintegration.mm
index affbee35b7..fb3d05d3e4 100644
--- a/src/plugins/platforms/cocoa/qcocoaintegration.mm
+++ b/src/plugins/platforms/cocoa/qcocoaintegration.mm
@@ -244,7 +244,7 @@ QCocoaIntegration::~QCocoaIntegration()
// Delete screens in reverse order to avoid crash in case of multiple screens
while (!mScreens.isEmpty()) {
- destroyScreen(mScreens.takeLast());
+ QWindowSystemInterface::handleScreenRemoved(mScreens.takeLast());
}
clearToolbars();
@@ -304,7 +304,7 @@ void QCocoaIntegration::updateScreens()
screen = new QCocoaScreen(i);
mScreens.append(screen);
qCDebug(lcQpaScreen) << "Adding" << screen;
- screenAdded(screen);
+ QWindowSystemInterface::handleScreenAdded(screen);
}
siblings << screen;
}
@@ -321,7 +321,7 @@ void QCocoaIntegration::updateScreens()
// Prevent stale references to NSScreen during destroy
screen->m_screenIndex = -1;
qCDebug(lcQpaScreen) << "Removing" << screen;
- destroyScreen(screen);
+ QWindowSystemInterface::handleScreenRemoved(screen);
}
}
@@ -407,7 +407,16 @@ QPlatformOpenGLContext *QCocoaIntegration::createPlatformOpenGLContext(QOpenGLCo
QPlatformBackingStore *QCocoaIntegration::createPlatformBackingStore(QWindow *window) const
{
- return new QCocoaBackingStore(window);
+ QCocoaWindow *platformWindow = static_cast<QCocoaWindow*>(window->handle());
+ if (!platformWindow) {
+ qWarning() << window << "must be created before being used with a backingstore";
+ return nullptr;
+ }
+
+ if (platformWindow->view().layer)
+ return new QCALayerBackingStore(window);
+ else
+ return new QNSWindowBackingStore(window);
}
QAbstractEventDispatcher *QCocoaIntegration::createEventDispatcher() const
diff --git a/src/plugins/platforms/cocoa/qcocoamenu.mm b/src/plugins/platforms/cocoa/qcocoamenu.mm
index 7b96fca3f9..f34988721d 100644
--- a/src/plugins/platforms/cocoa/qcocoamenu.mm
+++ b/src/plugins/platforms/cocoa/qcocoamenu.mm
@@ -250,6 +250,9 @@ void QCocoaMenu::syncMenuItem_helper(QPlatformMenuItem *menuItem, bool menubarUp
if (wasMerged) {
oldItem.enabled = NO;
oldItem.hidden = YES;
+ oldItem.keyEquivalent = @"";
+ oldItem.keyEquivalentModifierMask = NSEventModifierFlagCommand;
+
} else {
[m_nativeMenu removeItem:oldItem];
}
diff --git a/src/plugins/platforms/cocoa/qcocoasystemsettings.mm b/src/plugins/platforms/cocoa/qcocoasystemsettings.mm
index aef2c6cf48..9b6dc94d33 100644
--- a/src/plugins/platforms/cocoa/qcocoasystemsettings.mm
+++ b/src/plugins/platforms/cocoa/qcocoasystemsettings.mm
@@ -158,10 +158,13 @@ QHash<QPlatformTheme::Palette, QPalette*> qt_mac_createRolePalettes()
pal.setColor(QPalette::Inactive, QPalette::WindowText, qc);
pal.setColor(QPalette::Active, QPalette::HighlightedText, qc);
pal.setColor(QPalette::Inactive, QPalette::HighlightedText, qc);
+ pal.setColor(QPalette::Active, QPalette::ButtonText, qc);
+ pal.setColor(QPalette::Inactive, QPalette::ButtonText, qc);
qc = qt_mac_toQColor(mac_widget_colors[i].inactive);
pal.setColor(QPalette::Disabled, QPalette::Text, qc);
pal.setColor(QPalette::Disabled, QPalette::WindowText, qc);
pal.setColor(QPalette::Disabled, QPalette::HighlightedText, qc);
+ pal.setColor(QPalette::Disabled, QPalette::ButtonText, qc);
}
if (mac_widget_colors[i].paletteRole == QPlatformTheme::MenuPalette
|| mac_widget_colors[i].paletteRole == QPlatformTheme::MenuBarPalette) {
diff --git a/src/corelib/global/qfloat16_p.h b/src/plugins/platforms/cocoa/qiosurfacegraphicsbuffer.h
index f3fc96e119..872773cb7a 100644
--- a/src/corelib/global/qfloat16_p.h
+++ b/src/plugins/platforms/cocoa/qiosurfacegraphicsbuffer.h
@@ -1,9 +1,9 @@
/****************************************************************************
**
-** Copyright (C) 2016 by Southwest Research Institute (R)
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtCore module of the Qt Toolkit.
+** This file is part of the plugins of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -37,59 +37,41 @@
**
****************************************************************************/
-#ifndef QFLOAT16_P_H
-#define QFLOAT16_P_H
+#ifndef QIOSURFACEGRAPHICSBUFFER_H
+#define QIOSURFACEGRAPHICSBUFFER_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/qfloat16.h>
-#include <QtCore/qsysinfo.h>
+#include <qpa/qplatformgraphicsbuffer.h>
+#include <private/qcore_mac_p.h>
QT_BEGIN_NAMESPACE
-static inline bool qt_is_inf(qfloat16 d) Q_DECL_NOTHROW
+class QIOSurfaceGraphicsBuffer : public QPlatformGraphicsBuffer
{
- bool is_inf;
- uchar *ch = (uchar *)&d;
- if (QSysInfo::ByteOrder == QSysInfo::BigEndian)
- is_inf = (ch[0] & 0x7c) == 0x7c && (ch[0] & 0x02) == 0;
- else
- is_inf = (ch[1] & 0x7c) == 0x7c && (ch[1] & 0x02) == 0;
- return is_inf;
-}
+public:
+ QIOSurfaceGraphicsBuffer(const QSize &size, const QPixelFormat &format, QCFType<CGColorSpaceRef> colorSpace);
+ ~QIOSurfaceGraphicsBuffer();
-static inline bool qt_is_nan(qfloat16 d) Q_DECL_NOTHROW
-{
- bool is_nan;
- uchar *ch = (uchar *)&d;
- if (QSysInfo::ByteOrder == QSysInfo::BigEndian)
- is_nan = (ch[0] & 0x7c) == 0x7c && (ch[0] & 0x02) != 0;
- else
- is_nan = (ch[1] & 0x7c) == 0x7c && (ch[1] & 0x02) != 0;
- return is_nan;
-}
+ const uchar *data() const override;
+ uchar *data() override;
+ int bytesPerLine() const override;
-static inline bool qt_is_finite(qfloat16 d) Q_DECL_NOTHROW
-{
- bool is_finite;
- uchar *ch = (uchar *)&d;
- if (QSysInfo::ByteOrder == QSysInfo::BigEndian)
- is_finite = (ch[0] & 0x7c) != 0x7c;
- else
- is_finite = (ch[1] & 0x7c) != 0x7c;
- return is_finite;
-}
+ IOSurfaceRef surface();
+ bool isInUse() const;
+
+protected:
+ bool doLock(AccessTypes access, const QRect &rect) override;
+ void doUnlock() override;
+
+private:
+ QCFType<IOSurfaceRef> m_surface;
+
+ friend QDebug operator<<(QDebug, const QIOSurfaceGraphicsBuffer *);
+};
+#ifndef QT_NO_DEBUG_STREAM
+QDebug operator<<(QDebug, const QIOSurfaceGraphicsBuffer *);
+#endif
QT_END_NAMESPACE
-#endif // QFLOAT16_P_H
+#endif // QIOSURFACEGRAPHICSBUFFER_H
diff --git a/src/plugins/platforms/cocoa/qiosurfacegraphicsbuffer.mm b/src/plugins/platforms/cocoa/qiosurfacegraphicsbuffer.mm
new file mode 100644
index 0000000000..a367487e85
--- /dev/null
+++ b/src/plugins/platforms/cocoa/qiosurfacegraphicsbuffer.mm
@@ -0,0 +1,188 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qiosurfacegraphicsbuffer.h"
+
+#include <QtCore/qdebug.h>
+#include <QtCore/qloggingcategory.h>
+
+#include <CoreGraphics/CoreGraphics.h>
+#include <IOSurface/IOSurface.h>
+
+// CGColorSpaceCopyPropertyList is available on 10.12 and above,
+// but was only added in the 10.14 SDK, so declare it just in case.
+extern "C" CFPropertyListRef CGColorSpaceCopyPropertyList(CGColorSpaceRef space);
+
+QT_BEGIN_NAMESPACE
+
+Q_LOGGING_CATEGORY(lcQpaIOSurface, "qt.qpa.backingstore.iosurface");
+
+QIOSurfaceGraphicsBuffer::QIOSurfaceGraphicsBuffer(const QSize &size, const QPixelFormat &format, QCFType<CGColorSpaceRef> colorSpace)
+ : QPlatformGraphicsBuffer(size, format)
+{
+ const size_t width = size.width();
+ const size_t height = size.height();
+
+ Q_ASSERT(width <= IOSurfaceGetPropertyMaximum(kIOSurfaceWidth));
+ Q_ASSERT(height <= IOSurfaceGetPropertyMaximum(kIOSurfaceHeight));
+
+ static const char bytesPerElement = 4;
+
+ const size_t bytesPerRow = IOSurfaceAlignProperty(kIOSurfaceBytesPerRow, width * bytesPerElement);
+ const size_t totalBytes = IOSurfaceAlignProperty(kIOSurfaceAllocSize, height * bytesPerRow);
+
+ NSDictionary *options = @{
+ (id)kIOSurfaceWidth: @(width),
+ (id)kIOSurfaceHeight: @(height),
+ (id)kIOSurfacePixelFormat: @(unsigned('BGRA')),
+ (id)kIOSurfaceBytesPerElement: @(bytesPerElement),
+ (id)kIOSurfaceBytesPerRow: @(bytesPerRow),
+ (id)kIOSurfaceAllocSize: @(totalBytes),
+ };
+
+ m_surface = IOSurfaceCreate((CFDictionaryRef)options);
+ Q_ASSERT(m_surface);
+
+ Q_ASSERT(size_t(bytesPerLine()) == bytesPerRow);
+ Q_ASSERT(size_t(byteCount()) == totalBytes);
+
+ if (colorSpace) {
+ IOSurfaceSetValue(m_surface, CFSTR("IOSurfaceColorSpace"),
+ QCFType<CFPropertyListRef>(CGColorSpaceCopyPropertyList(colorSpace)));
+ }
+}
+
+QIOSurfaceGraphicsBuffer::~QIOSurfaceGraphicsBuffer()
+{
+}
+
+const uchar *QIOSurfaceGraphicsBuffer::data() const
+{
+ return (const uchar *)IOSurfaceGetBaseAddress(m_surface);
+}
+
+uchar *QIOSurfaceGraphicsBuffer::data()
+{
+ return (uchar *)IOSurfaceGetBaseAddress(m_surface);
+}
+
+int QIOSurfaceGraphicsBuffer::bytesPerLine() const
+{
+ return IOSurfaceGetBytesPerRow(m_surface);
+}
+
+IOSurfaceRef QIOSurfaceGraphicsBuffer::surface()
+{
+ return m_surface;
+}
+
+bool QIOSurfaceGraphicsBuffer::isInUse() const
+{
+ return IOSurfaceIsInUse(m_surface);
+}
+
+IOSurfaceLockOptions lockOptionsForAccess(QPlatformGraphicsBuffer::AccessTypes access)
+{
+ IOSurfaceLockOptions lockOptions = 0;
+ if (!(access & QPlatformGraphicsBuffer::SWWriteAccess))
+ lockOptions |= kIOSurfaceLockReadOnly;
+ return lockOptions;
+}
+
+bool QIOSurfaceGraphicsBuffer::doLock(AccessTypes access, const QRect &rect)
+{
+ Q_UNUSED(rect);
+ Q_ASSERT(!isLocked());
+
+ qCDebug(lcQpaIOSurface) << "Locking" << this << "for" << access;
+
+ // FIXME: Teach QPlatformBackingStore::composeAndFlush about non-2D texture
+ // targets, so that we can use CGLTexImageIOSurface2D to support TextureAccess.
+ if (access & (TextureAccess | HWCompositor))
+ return false;
+
+ auto lockOptions = lockOptionsForAccess(access);
+
+ // Try without read-back first
+ lockOptions |= kIOSurfaceLockAvoidSync;
+ kern_return_t ret = IOSurfaceLock(m_surface, lockOptions, nullptr);
+ if (ret == kIOSurfaceSuccess)
+ return true;
+
+ if (ret == kIOReturnCannotLock) {
+ qCWarning(lcQpaIOSurface) << "Locking of" << this << "requires read-back";
+ lockOptions ^= kIOSurfaceLockAvoidSync;
+ ret = IOSurfaceLock(m_surface, lockOptions, nullptr);
+ }
+
+ if (ret != kIOSurfaceSuccess) {
+ qCWarning(lcQpaIOSurface) << "Failed to lock" << this << ret;
+ return false;
+ }
+
+ return true;
+}
+
+void QIOSurfaceGraphicsBuffer::doUnlock()
+{
+ qCDebug(lcQpaIOSurface) << "Unlocking" << this << "from" << isLocked();
+
+ auto lockOptions = lockOptionsForAccess(isLocked());
+ bool success = IOSurfaceUnlock(m_surface, lockOptions, nullptr) == kIOSurfaceSuccess;
+ Q_ASSERT_X(success, "QIOSurfaceGraphicsBuffer", "Unlocking surface should succeed");
+}
+
+#ifndef QT_NO_DEBUG_STREAM
+QDebug operator<<(QDebug debug, const QIOSurfaceGraphicsBuffer *graphicsBuffer)
+{
+ QDebugStateSaver saver(debug);
+ debug.nospace();
+ debug << "QIOSurfaceGraphicsBuffer(" << (const void *)graphicsBuffer;
+ if (graphicsBuffer) {
+ debug << ", surface=" << graphicsBuffer->m_surface;
+ debug << ", size=" << graphicsBuffer->size();
+ debug << ", isLocked=" << bool(graphicsBuffer->isLocked());
+ debug << ", isInUse=" << graphicsBuffer->isInUse();
+ }
+ debug << ')';
+ return debug;
+}
+#endif // !QT_NO_DEBUG_STREAM
+
+QT_END_NAMESPACE
diff --git a/src/plugins/platforms/cocoa/qnsview_drawing.mm b/src/plugins/platforms/cocoa/qnsview_drawing.mm
index 6db5ed8bad..cb1799b039 100644
--- a/src/plugins/platforms/cocoa/qnsview_drawing.mm
+++ b/src/plugins/platforms/cocoa/qnsview_drawing.mm
@@ -163,6 +163,15 @@
return NSViewLayerContentsRedrawDuringViewResize;
}
+#if 0 // Disabled until we enable lazy backingstore resizing
+- (NSViewLayerContentsPlacement)layerContentsPlacement
+{
+ // Always place the layer at top left without any automatic scaling,
+ // so that we can re-use larger layers when resizing a window down.
+ return NSViewLayerContentsPlacementTopLeft;
+}
+#endif
+
- (void)updateMetalLayerDrawableSize:(CAMetalLayer *)layer
{
CGSize drawableSize = layer.bounds.size;
diff --git a/src/plugins/platforms/cocoa/qnsview_mouse.mm b/src/plugins/platforms/cocoa/qnsview_mouse.mm
index 6e3cff2b48..0ab09b97d3 100644
--- a/src/plugins/platforms/cocoa/qnsview_mouse.mm
+++ b/src/plugins/platforms/cocoa/qnsview_mouse.mm
@@ -197,6 +197,11 @@
return NO;
if ([self isTransparentForUserInput])
return NO;
+ QPointF windowPoint;
+ QPointF screenPoint;
+ [self convertFromScreen:[NSEvent mouseLocation] toWindowPoint: &windowPoint andScreenPoint: &screenPoint];
+ if (!qt_window_private(m_platformWindow->window())->allowClickThrough(screenPoint.toPoint()))
+ return NO;
return YES;
}
diff --git a/src/plugins/platforms/directfb/qdirectfb_egl.cpp b/src/plugins/platforms/directfb/qdirectfb_egl.cpp
index dad553c890..d3c95f0b65 100644
--- a/src/plugins/platforms/directfb/qdirectfb_egl.cpp
+++ b/src/plugins/platforms/directfb/qdirectfb_egl.cpp
@@ -44,6 +44,7 @@
#include <QtGui/QOpenGLContext>
#include <qpa/qplatformopenglcontext.h>
+#include <qpa/qwindowsysteminterface.h>
#include <QtGui/QScreen>
#include <QtEglSupport/private/qeglplatformcontext_p.h>
@@ -248,7 +249,7 @@ QPlatformOpenGLContext *QDirectFbIntegrationEGL::createPlatformOpenGLContext(QOp
void QDirectFbIntegrationEGL::initializeScreen()
{
m_primaryScreen.reset(new QDirectFbScreenEGL(0));
- screenAdded(m_primaryScreen.data());
+ QWindowSystemInterface::handleScreenAdded(m_primaryScreen.data());
}
bool QDirectFbIntegrationEGL::hasCapability(QPlatformIntegration::Capability cap) const
diff --git a/src/plugins/platforms/directfb/qdirectfbintegration.cpp b/src/plugins/platforms/directfb/qdirectfbintegration.cpp
index cdf340da7a..73e308da53 100644
--- a/src/plugins/platforms/directfb/qdirectfbintegration.cpp
+++ b/src/plugins/platforms/directfb/qdirectfbintegration.cpp
@@ -56,6 +56,7 @@
#include <QtCore/QThread>
#include <QtCore/QAbstractEventDispatcher>
#include <qpa/qplatforminputcontextfactory_p.h>
+#include <qpa/qwindowsysteminterface.h>
QT_BEGIN_NAMESPACE
@@ -113,7 +114,7 @@ void QDirectFbIntegration::initializeDirectFB()
void QDirectFbIntegration::initializeScreen()
{
m_primaryScreen.reset(new QDirectFbScreen(0));
- screenAdded(m_primaryScreen.data());
+ QWindowSystemInterface::handleScreenAdded(m_primaryScreen.data());
}
void QDirectFbIntegration::initializeInput()
diff --git a/src/plugins/platforms/eglfs/api/qeglfsdeviceintegration.cpp b/src/plugins/platforms/eglfs/api/qeglfsdeviceintegration.cpp
index 0a3a37863a..81bad45cd2 100644
--- a/src/plugins/platforms/eglfs/api/qeglfsdeviceintegration.cpp
+++ b/src/plugins/platforms/eglfs/api/qeglfsdeviceintegration.cpp
@@ -200,10 +200,8 @@ void QEglFSDeviceIntegration::screenInit()
void QEglFSDeviceIntegration::screenDestroy()
{
QGuiApplication *app = qGuiApp;
- QEglFSIntegration *platformIntegration = static_cast<QEglFSIntegration *>(
- QGuiApplicationPrivate::platformIntegration());
while (!app->screens().isEmpty())
- platformIntegration->removeScreen(app->screens().constLast()->handle());
+ QWindowSystemInterface::handleScreenRemoved(app->screens().constLast()->handle());
}
QSizeF QEglFSDeviceIntegration::physicalScreenSize() const
diff --git a/src/plugins/platforms/eglfs/api/qeglfsintegration.cpp b/src/plugins/platforms/eglfs/api/qeglfsintegration.cpp
index 8ccb0ef2cd..48469b0f8c 100644
--- a/src/plugins/platforms/eglfs/api/qeglfsintegration.cpp
+++ b/src/plugins/platforms/eglfs/api/qeglfsintegration.cpp
@@ -120,16 +120,6 @@ QEglFSIntegration::QEglFSIntegration()
initResources();
}
-void QEglFSIntegration::addScreen(QPlatformScreen *screen, bool isPrimary)
-{
- screenAdded(screen, isPrimary);
-}
-
-void QEglFSIntegration::removeScreen(QPlatformScreen *screen)
-{
- destroyScreen(screen);
-}
-
void QEglFSIntegration::initialize()
{
qt_egl_device_integration()->platformInit();
@@ -147,7 +137,7 @@ void QEglFSIntegration::initialize()
m_vtHandler.reset(new QFbVtHandler);
if (qt_egl_device_integration()->usesDefaultScreen())
- addScreen(new QEglFSScreen(display()));
+ QWindowSystemInterface::handleScreenAdded(new QEglFSScreen(display()));
else
qt_egl_device_integration()->screenInit();
diff --git a/src/plugins/platforms/eglfs/api/qeglfsintegration_p.h b/src/plugins/platforms/eglfs/api/qeglfsintegration_p.h
index 4b4585d33c..898b322834 100644
--- a/src/plugins/platforms/eglfs/api/qeglfsintegration_p.h
+++ b/src/plugins/platforms/eglfs/api/qeglfsintegration_p.h
@@ -103,9 +103,6 @@ public:
QFbVtHandler *vtHandler() { return m_vtHandler.data(); }
- void addScreen(QPlatformScreen *screen, bool isPrimary = false);
- void removeScreen(QPlatformScreen *screen);
-
private:
EGLNativeDisplayType nativeDisplay() const;
void createInputHandlers();
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_emu/qeglfsemulatorintegration.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_emu/qeglfsemulatorintegration.cpp
index 5e2708e958..cb7844aff0 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_emu/qeglfsemulatorintegration.cpp
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_emu/qeglfsemulatorintegration.cpp
@@ -45,6 +45,8 @@
#include <QtEglSupport/private/qeglconvenience_p.h>
#include <QtEglSupport/private/qeglplatformcontext_p.h>
+#include <qpa/qwindowsysteminterface.h>
+
#include <QtCore/QJsonDocument>
#include <QtCore/QJsonArray>
#include <QtCore/QJsonParseError>
@@ -80,8 +82,6 @@ bool QEglFSEmulatorIntegration::usesDefaultScreen()
void QEglFSEmulatorIntegration::screenInit()
{
- QEglFSIntegration *integration = static_cast<QEglFSIntegration *>(QGuiApplicationPrivate::platformIntegration());
-
// Use qgsGetDisplays() call to retrieve the available screens from the Emulator
if (getDisplays) {
QByteArray displaysInfo = getDisplays();
@@ -93,7 +93,7 @@ void QEglFSEmulatorIntegration::screenInit()
QJsonArray screenArray = displaysDocument.array();
for (auto screenValue : screenArray) {
if (screenValue.isObject())
- integration->addScreen(new QEglFSEmulatorScreen(screenValue.toObject()));
+ QWindowSystemInterface::handleScreenAdded(new QEglFSEmulatorScreen(screenValue.toObject()));
}
}
} else {
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp
index 9f4c9f5703..ef732f9832 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp
@@ -310,7 +310,7 @@ QKmsDevice *QEglFSKmsEglDeviceIntegration::createDevice()
if (Q_UNLIKELY(!deviceName))
qFatal("Failed to query device name from EGLDevice");
- return new QEglFSKmsEglDevice(this, screenConfig(), deviceName);
+ return new QEglFSKmsEglDevice(this, screenConfig(), QLatin1String(deviceName));
}
bool QEglFSKmsEglDeviceIntegration::query_egl_device()
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsdevice.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsdevice.cpp
index b073577797..4f0b0d7725 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsdevice.cpp
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsdevice.cpp
@@ -58,7 +58,7 @@ void QEglFSKmsDevice::registerScreen(QPlatformScreen *screen,
QEglFSKmsScreen *s = static_cast<QEglFSKmsScreen *>(screen);
s->setVirtualPosition(virtualPos);
s->setVirtualSiblings(virtualSiblings);
- static_cast<QEglFSIntegration *>(QGuiApplicationPrivate::platformIntegration())->addScreen(s, isPrimary);
+ QWindowSystemInterface::handleScreenAdded(s, isPrimary);
}
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/haiku/qhaikuintegration.cpp b/src/plugins/platforms/haiku/qhaikuintegration.cpp
index 8bd2171794..44df6ae8f5 100644
--- a/src/plugins/platforms/haiku/qhaikuintegration.cpp
+++ b/src/plugins/platforms/haiku/qhaikuintegration.cpp
@@ -49,6 +49,7 @@
#include <QCoreApplication>
#include <QFileInfo>
#include <qpa/qplatformwindow.h>
+#include <qpa/qwindowsysteminterface.h>
#include <QtEventDispatcherSupport/private/qgenericunixeventdispatcher_p.h>
#include <Application.h>
@@ -81,12 +82,12 @@ QHaikuIntegration::QHaikuIntegration(const QStringList &parameters)
m_services = new QHaikuServices;
// notify system about available screen
- screenAdded(m_screen);
+ QWindowSystemInterface::handleScreenAdded(m_screen);
}
QHaikuIntegration::~QHaikuIntegration()
{
- destroyScreen(m_screen);
+ QWindowSystemInterface::handleScreenRemoved(m_screen);
m_screen = nullptr;
delete m_services;
diff --git a/src/plugins/platforms/integrity/qintegrityfbintegration.cpp b/src/plugins/platforms/integrity/qintegrityfbintegration.cpp
index ae802bb1fa..3ad31dc562 100644
--- a/src/plugins/platforms/integrity/qintegrityfbintegration.cpp
+++ b/src/plugins/platforms/integrity/qintegrityfbintegration.cpp
@@ -51,7 +51,7 @@
#include <QtGui/private/qguiapplication_p.h>
#include <qpa/qplatforminputcontextfactory_p.h>
-
+#include <qpa/qwindowsysteminterface.h>
QT_BEGIN_NAMESPACE
@@ -64,13 +64,13 @@ QIntegrityFbIntegration::QIntegrityFbIntegration(const QStringList &paramList)
QIntegrityFbIntegration::~QIntegrityFbIntegration()
{
- destroyScreen(m_primaryScreen);
+ QWindowSystemInterface::handleScreenRemoved(m_primaryScreen);
}
void QIntegrityFbIntegration::initialize()
{
if (m_primaryScreen->initialize())
- screenAdded(m_primaryScreen);
+ QWindowSystemInterface::handleScreenAdded(m_primaryScreen);
else
qWarning("integrityfb: Failed to initialize screen");
diff --git a/src/plugins/platforms/ios/qiosintegration.h b/src/plugins/platforms/ios/qiosintegration.h
index 818250fcee..eeb44b54d3 100644
--- a/src/plugins/platforms/ios/qiosintegration.h
+++ b/src/plugins/platforms/ios/qiosintegration.h
@@ -92,10 +92,6 @@ public:
QPlatformAccessibility *accessibility() const override;
#endif
- // Called from Objective-C class QIOSScreenTracker, which can't be friended
- void addScreen(QPlatformScreen *screen) { screenAdded(screen); }
- void destroyScreen(QPlatformScreen *screen) { QPlatformIntegration::destroyScreen(screen); }
-
void beep() const override;
static QIOSIntegration *instance();
diff --git a/src/plugins/platforms/ios/qiosintegration.mm b/src/plugins/platforms/ios/qiosintegration.mm
index bec8354fcc..9eca0eaad3 100644
--- a/src/plugins/platforms/ios/qiosintegration.mm
+++ b/src/plugins/platforms/ios/qiosintegration.mm
@@ -107,7 +107,7 @@ void QIOSIntegration::initialize()
}
for (UIScreen *screen in screens)
- addScreen(new QIOSScreen(screen));
+ QWindowSystemInterface::handleScreenAdded(new QIOSScreen(screen));
// Depends on a primary screen being present
m_inputContext = new QIOSInputContext;
@@ -143,7 +143,7 @@ QIOSIntegration::~QIOSIntegration()
m_inputContext = 0;
foreach (QScreen *screen, QGuiApplication::screens())
- destroyScreen(screen->handle());
+ QWindowSystemInterface::handleScreenRemoved(screen->handle());
delete m_platformServices;
m_platformServices = 0;
diff --git a/src/plugins/platforms/ios/qiosscreen.mm b/src/plugins/platforms/ios/qiosscreen.mm
index 4f753be21a..9aba658479 100644
--- a/src/plugins/platforms/ios/qiosscreen.mm
+++ b/src/plugins/platforms/ios/qiosscreen.mm
@@ -50,6 +50,7 @@
#include <QtGui/private/qwindow_p.h>
#include <private/qcoregraphics_p.h>
+#include <qpa/qwindowsysteminterface.h>
#include <sys/sysctl.h>
@@ -105,10 +106,10 @@ static QIOSScreen* qtPlatformScreenFor(UIScreen *uiScreen)
+ (void)screenConnected:(NSNotification*)notification
{
- QIOSIntegration *integration = QIOSIntegration::instance();
- Q_ASSERT_X(integration, Q_FUNC_INFO, "Screen connected before QIOSIntegration creation");
+ Q_ASSERT_X(QIOSIntegration::instance(), Q_FUNC_INFO,
+ "Screen connected before QIOSIntegration creation");
- integration->addScreen(new QIOSScreen([notification object]));
+ QWindowSystemInterface::handleScreenAdded(new QIOSScreen([notification object]));
}
+ (void)screenDisconnected:(NSNotification*)notification
@@ -116,8 +117,7 @@ static QIOSScreen* qtPlatformScreenFor(UIScreen *uiScreen)
QIOSScreen *screen = qtPlatformScreenFor([notification object]);
Q_ASSERT_X(screen, Q_FUNC_INFO, "Screen disconnected that we didn't know about");
- QIOSIntegration *integration = QIOSIntegration::instance();
- integration->destroyScreen(screen);
+ QWindowSystemInterface::handleScreenRemoved(screen);
}
+ (void)screenModeChanged:(NSNotification*)notification
diff --git a/src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp b/src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp
index 9e38900bcd..68843aa4c5 100644
--- a/src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp
+++ b/src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp
@@ -54,6 +54,7 @@
#include <QtGui/private/qguiapplication_p.h>
#include <qpa/qplatforminputcontextfactory_p.h>
+#include <qpa/qwindowsysteminterface.h>
#if QT_CONFIG(libinput)
#include <QtInputSupport/private/qlibinputhandler_p.h>
@@ -89,13 +90,13 @@ QLinuxFbIntegration::QLinuxFbIntegration(const QStringList &paramList)
QLinuxFbIntegration::~QLinuxFbIntegration()
{
- destroyScreen(m_primaryScreen);
+ QWindowSystemInterface::handleScreenRemoved(m_primaryScreen);
}
void QLinuxFbIntegration::initialize()
{
if (m_primaryScreen->initialize())
- screenAdded(m_primaryScreen);
+ QWindowSystemInterface::handleScreenAdded(m_primaryScreen);
else
qWarning("linuxfb: Failed to initialize screen");
diff --git a/src/plugins/platforms/linuxfb/qlinuxfbintegration.h b/src/plugins/platforms/linuxfb/qlinuxfbintegration.h
index 7a871b3812..af6bd1d630 100644
--- a/src/plugins/platforms/linuxfb/qlinuxfbintegration.h
+++ b/src/plugins/platforms/linuxfb/qlinuxfbintegration.h
@@ -72,7 +72,7 @@ public:
QList<QPlatformScreen *> screens() const;
- QFunctionPointer platformFunction(const QByteArray &function) const Q_DECL_OVERRIDE;
+ QFunctionPointer platformFunction(const QByteArray &function) const override;
private:
void createInputHandlers();
diff --git a/src/plugins/platforms/minimal/qminimalintegration.cpp b/src/plugins/platforms/minimal/qminimalintegration.cpp
index 0c04608fca..f457f69f11 100644
--- a/src/plugins/platforms/minimal/qminimalintegration.cpp
+++ b/src/plugins/platforms/minimal/qminimalintegration.cpp
@@ -43,6 +43,7 @@
#include <QtGui/private/qpixmap_raster_p.h>
#include <QtGui/private/qguiapplication_p.h>
#include <qpa/qplatformwindow.h>
+#include <qpa/qwindowsysteminterface.h>
#include <QtFontDatabaseSupport/private/qfreetypefontdatabase_p.h>
#if defined(Q_OS_WINRT)
@@ -108,7 +109,7 @@ QMinimalIntegration::QMinimalIntegration(const QStringList &parameters)
mPrimaryScreen->mDepth = 32;
mPrimaryScreen->mFormat = QImage::Format_ARGB32_Premultiplied;
- screenAdded(mPrimaryScreen);
+ QWindowSystemInterface::handleScreenAdded(mPrimaryScreen);
}
QMinimalIntegration::~QMinimalIntegration()
diff --git a/src/plugins/platforms/minimalegl/qminimaleglintegration.cpp b/src/plugins/platforms/minimalegl/qminimaleglintegration.cpp
index da58441d67..a0d35a80cd 100644
--- a/src/plugins/platforms/minimalegl/qminimaleglintegration.cpp
+++ b/src/plugins/platforms/minimalegl/qminimaleglintegration.cpp
@@ -58,6 +58,7 @@
#include <QtGui/QSurfaceFormat>
#include <QtGui/QOpenGLContext>
#include <QtGui/QScreen>
+#include <qpa/qwindowsysteminterface.h>
// this is where EGL headers are pulled in, make sure it is last
#include "qminimaleglscreen.h"
@@ -90,7 +91,7 @@ protected:
QMinimalEglIntegration::QMinimalEglIntegration()
: mFontDb(new QGenericUnixFontDatabase()), mScreen(new QMinimalEglScreen(EGL_DEFAULT_DISPLAY))
{
- screenAdded(mScreen);
+ QWindowSystemInterface::handleScreenAdded(mScreen);
#ifdef QEGL_EXTRA_DEBUG
qWarning("QMinimalEglIntegration\n");
@@ -99,7 +100,7 @@ QMinimalEglIntegration::QMinimalEglIntegration()
QMinimalEglIntegration::~QMinimalEglIntegration()
{
- destroyScreen(mScreen);
+ QWindowSystemInterface::handleScreenRemoved(mScreen);
delete mFontDb;
}
diff --git a/src/plugins/platforms/offscreen/qoffscreenintegration.cpp b/src/plugins/platforms/offscreen/qoffscreenintegration.cpp
index f2933b7179..869e9228cd 100644
--- a/src/plugins/platforms/offscreen/qoffscreenintegration.cpp
+++ b/src/plugins/platforms/offscreen/qoffscreenintegration.cpp
@@ -63,6 +63,7 @@
#include <qpa/qplatforminputcontextfactory_p.h>
#include <qpa/qplatforminputcontext.h>
#include <qpa/qplatformtheme.h>
+#include <qpa/qwindowsysteminterface.h>
#include <qpa/qplatformservices.h>
@@ -121,7 +122,7 @@ QOffscreenIntegration::QOffscreenIntegration()
#endif
m_services.reset(new QPlatformServices);
- screenAdded(new QOffscreenScreen);
+ QWindowSystemInterface::handleScreenAdded(new QOffscreenScreen);
}
QOffscreenIntegration::~QOffscreenIntegration()
diff --git a/src/plugins/platforms/openwfd/qopenwfdintegration.cpp b/src/plugins/platforms/openwfd/qopenwfdintegration.cpp
index 4850ca2e45..c5dc40a206 100644
--- a/src/plugins/platforms/openwfd/qopenwfdintegration.cpp
+++ b/src/plugins/platforms/openwfd/qopenwfdintegration.cpp
@@ -50,6 +50,7 @@
#include <QtGui/private/qguiapplication_p.h>
#include <QtGui/QOpenGLContext>
#include <QtGui/QScreen>
+#include <qpa/qwindowsysteminterface.h>
#include <QtEventDispatcherSupport/private/qgenericunixeventdispatcher_p.h>
#include <QtFontDatabaseSupport/private/qgenericunixfontdatabase_p.h>
@@ -135,13 +136,3 @@ QPlatformPrinterSupport * QOpenWFDIntegration::printerSupport() const
{
return mPrinterSupport;
}
-
-void QOpenWFDIntegration::addScreen(QOpenWFDScreen *screen)
-{
- screenAdded(screen);
-}
-
-void QOpenWFDIntegration::destroyScreen(QOpenWFDScreen *screen)
-{
- QPlatformIntegration::destroyScreen(screen);
-}
diff --git a/src/plugins/platforms/openwfd/qopenwfdintegration.h b/src/plugins/platforms/openwfd/qopenwfdintegration.h
index 1ce1001bed..444aaccaaf 100644
--- a/src/plugins/platforms/openwfd/qopenwfdintegration.h
+++ b/src/plugins/platforms/openwfd/qopenwfdintegration.h
@@ -68,8 +68,6 @@ public:
QPlatformPrinterSupport *printerSupport() const;
- void addScreen(QOpenWFDScreen *screen);
- void destroyScreen(QOpenWFDScreen *screen);
private:
QList<QPlatformScreen *> mScreens;
QList<QOpenWFDDevice *>mDevices;
diff --git a/src/plugins/platforms/openwfd/qopenwfdport.cpp b/src/plugins/platforms/openwfd/qopenwfdport.cpp
index 33254fe83c..34b4439958 100644
--- a/src/plugins/platforms/openwfd/qopenwfdport.cpp
+++ b/src/plugins/platforms/openwfd/qopenwfdport.cpp
@@ -133,7 +133,7 @@ void QOpenWFDPort::attach()
wfdBindPipelineToPort(mDevice->handle(),mPort,mPipeline);
mScreen = new QOpenWFDScreen(this);
- mDevice->integration()->addScreen(mScreen);
+ QWindowSystemInterface::handleScreenAdded(mScreen);
mAttached = true;
}
@@ -145,7 +145,7 @@ void QOpenWFDPort::detach()
mAttached = false;
mOn = false;
- mDevice->integration()->destroyScreen(mScreen);
+ QWindowSystemInterface::handleScreenRemoved(mScreen);
wfdDestroyPipeline(mDevice->handle(),mPipeline);
mPipelineId = WFD_INVALID_PIPELINE_ID;
diff --git a/src/plugins/platforms/qnx/qqnxintegration.cpp b/src/plugins/platforms/qnx/qqnxintegration.cpp
index a996e765c4..a45dcabeb7 100644
--- a/src/plugins/platforms/qnx/qqnxintegration.cpp
+++ b/src/plugins/platforms/qnx/qqnxintegration.cpp
@@ -649,7 +649,7 @@ void QQnxIntegration::createDisplay(screen_display_t display, bool isPrimary)
{
QQnxScreen *screen = new QQnxScreen(m_screenContext, display, isPrimary);
m_screens.append(screen);
- screenAdded(screen);
+ QWindowSystemInterface::handleScreenAdded(screen);
screen->adjustOrientation();
QObject::connect(m_screenEventHandler, SIGNAL(newWindowCreated(void*)),
@@ -669,14 +669,14 @@ void QQnxIntegration::removeDisplay(QQnxScreen *screen)
Q_CHECK_PTR(screen);
Q_ASSERT(m_screens.contains(screen));
m_screens.removeAll(screen);
- destroyScreen(screen);
+ QWindowSystemInterface::handleScreenRemoved(screen);
}
void QQnxIntegration::destroyDisplays()
{
qIntegrationDebug();
Q_FOREACH (QQnxScreen *screen, m_screens) {
- QPlatformIntegration::destroyScreen(screen);
+ QWindowSystemInterface::handleScreenRemoved(screen);
}
m_screens.clear();
}
diff --git a/src/plugins/platforms/vnc/qvncintegration.cpp b/src/plugins/platforms/vnc/qvncintegration.cpp
index 1e2cf6292c..c7a796464a 100644
--- a/src/plugins/platforms/vnc/qvncintegration.cpp
+++ b/src/plugins/platforms/vnc/qvncintegration.cpp
@@ -52,6 +52,7 @@
#include <QtGui/private/qguiapplication_p.h>
#include <qpa/qplatforminputcontextfactory_p.h>
#include <private/qinputdevicemanager_p_p.h>
+#include <qpa/qwindowsysteminterface.h>
#include <QtCore/QRegularExpression>
@@ -77,13 +78,13 @@ QVncIntegration::QVncIntegration(const QStringList &paramList)
QVncIntegration::~QVncIntegration()
{
delete m_server;
- destroyScreen(m_primaryScreen);
+ QWindowSystemInterface::handleScreenRemoved(m_primaryScreen);
}
void QVncIntegration::initialize()
{
if (m_primaryScreen->initialize())
- screenAdded(m_primaryScreen);
+ QWindowSystemInterface::handleScreenAdded(m_primaryScreen);
else
qWarning("vnc: Failed to initialize screen");
diff --git a/src/plugins/platforms/wasm/qtloader.js b/src/plugins/platforms/wasm/qtloader.js
index 049eb1c35e..2db7723ae2 100644
--- a/src/plugins/platforms/wasm/qtloader.js
+++ b/src/plugins/platforms/wasm/qtloader.js
@@ -118,6 +118,12 @@
// "Exited", iff crashed is false.
// exitText
// Abort/exit message.
+// addCanvasElement
+// Add canvas at run-time. Adds a corresponding QScreen,
+// removeCanvasElement
+// Remove canvas at run-time. Removes the corresponding QScreen.
+// resizeCanvasElement
+// Signals to the application that a canvas has been resized.
var Module = {}
@@ -158,6 +164,7 @@ function QtLoader(config)
// Set contentEditable in order to enable clipboard events; hide the resulting focus frame.
canvas.contentEditable = true;
canvas.style.outline = "0px solid transparent";
+ canvas.style.caretColor = "transparent";
canvas.style.cursor = "default";
return canvas;
@@ -227,6 +234,9 @@ function QtLoader(config)
publicAPI.canLoadApplication = canLoadQt();
publicAPI.status = undefined;
publicAPI.loadEmscriptenModule = loadEmscriptenModule;
+ publicAPI.addCanvasElement = addCanvasElement;
+ publicAPI.removeCanvasElement = removeCanvasElement;
+ publicAPI.resizeCanvasElement = resizeCanvasElement;
restartCount = 0;
@@ -528,6 +538,25 @@ function QtLoader(config)
window.setTimeout(function() { handleStatusChange(); }, 0);
}
+ function addCanvasElement(element) {
+ if (publicAPI.status == "Running")
+ Module.qtAddCanvasElement(element);
+ else
+ console.log("Error: addCanvasElement can only be called in the Running state");
+ }
+
+ function removeCanvasElement(element) {
+ if (publicAPI.status == "Running")
+ Module.qtRemoveCanvasElement(element);
+ else
+ console.log("Error: removeCanvasElement can only be called in the Running state");
+ }
+
+ function resizeCanvasElement(element) {
+ if (publicAPI.status == "Running")
+ Module.qtResizeCanvasElement(element);
+ }
+
setStatus("Created");
return publicAPI;
diff --git a/src/plugins/platforms/wasm/qwasmclipboard.cpp b/src/plugins/platforms/wasm/qwasmclipboard.cpp
index 7a7b253b19..d4a1e4dd50 100644
--- a/src/plugins/platforms/wasm/qwasmclipboard.cpp
+++ b/src/plugins/platforms/wasm/qwasmclipboard.cpp
@@ -76,8 +76,8 @@ static void qClipboardCutTo(val event)
}
val module = val::global("Module");
- val clipdata = module.call<val>("getClipboardData");
- val clipFormat = module.call<val>("getClipboardFormat");
+ val clipdata = module.call<val>("qtGetClipboardData");
+ val clipFormat = module.call<val>("qtGetClipboardFormat");
event["clipboardData"].call<void>("setData", clipFormat, clipdata);
event.call<void>("preventDefault");
}
@@ -91,8 +91,8 @@ static void qClipboardCopyTo(val event)
}
val module = val::global("Module");
- val clipdata = module.call<val>("getClipboardData");
- val clipFormat = module.call<val>("getClipboardFormat");
+ val clipdata = module.call<val>("qtGetClipboardData");
+ val clipFormat = module.call<val>("qtGetClipboardFormat");
event["clipboardData"].call<void>("setData", clipFormat, clipdata);
event.call<void>("preventDefault");
}
@@ -101,7 +101,7 @@ static void qClipboardPasteTo(val event)
{
bool hasClipboardApi = QWasmIntegration::get()->getWasmClipboard()->hasClipboardApi;
val clipdata = hasClipboardApi ?
- val::global("Module").call<val>("getClipboardData") :
+ val::global("Module").call<val>("qtGetClipboardData") :
event["clipboardData"].call<val>("getData", std::string("text"));
const std::string data = clipdata.as<std::string>();
@@ -113,14 +113,14 @@ static void qClipboardPasteTo(val event)
}
}
-EMSCRIPTEN_BINDINGS(clipboard_module) {
- function("getClipboardData", &getClipboardData);
- function("getClipboardFormat", &getClipboardFormat);
- function("pasteClipboardData", &pasteClipboardData);
- function("qClipboardPromiseResolve", &qClipboardPromiseResolve);
- function("qClipboardCutTo", &qClipboardCutTo);
- function("qClipboardCopyTo", &qClipboardCopyTo);
- function("qClipboardPasteTo", &qClipboardPasteTo);
+EMSCRIPTEN_BINDINGS(qtClipboardModule) {
+ function("qtGetClipboardData", &getClipboardData);
+ function("qtGetClipboardFormat", &getClipboardFormat);
+ function("qtPasteClipboardData", &pasteClipboardData);
+ function("qtClipboardPromiseResolve", &qClipboardPromiseResolve);
+ function("qtClipboardCutTo", &qClipboardCutTo);
+ function("qtClipboardCopyTo", &qClipboardCopyTo);
+ function("qtClipboardPasteTo", &qClipboardPasteTo);
}
QWasmClipboard::QWasmClipboard()
@@ -200,11 +200,11 @@ void QWasmClipboard::installEventHandlers(const QString &canvasId)
// Fallback path for browsers which do not support direct clipboard access
val canvas = val::global(canvasId.toUtf8().constData());
canvas.call<void>("addEventListener", std::string("cut"),
- val::module_property("qClipboardCutTo"));
+ val::module_property("qtClipboardCutTo"));
canvas.call<void>("addEventListener", std::string("copy"),
- val::module_property("qClipboardCopyTo"));
+ val::module_property("qtClipboardCopyTo"));
canvas.call<void>("addEventListener", std::string("paste"),
- val::module_property("qClipboardPasteTo"));
+ val::module_property("qtClipboardPasteTo"));
}
void QWasmClipboard::readTextFromClipboard()
@@ -212,7 +212,7 @@ void QWasmClipboard::readTextFromClipboard()
if (QWasmIntegration::get()->getWasmClipboard()->hasClipboardApi) {
val navigator = val::global("navigator");
val textPromise = navigator["clipboard"].call<val>("readText");
- val readTextResolve = val::global("Module")["qClipboardPromiseResolve"];
+ val readTextResolve = val::global("Module")["qtClipboardPromiseResolve"];
textPromise.call<val>("then", readTextResolve);
}
}
@@ -221,8 +221,8 @@ void QWasmClipboard::writeTextToClipboard()
{
if (QWasmIntegration::get()->getWasmClipboard()->hasClipboardApi) {
val module = val::global("Module");
- val txt = module.call<val>("getClipboardData");
- val format = module.call<val>("getClipboardFormat");
+ val txt = module.call<val>("qtGetClipboardData");
+ val format = module.call<val>("qtGetClipboardFormat");
val navigator = val::global("navigator");
navigator["clipboard"].call<void>("writeText", txt.as<std::string>());
}
diff --git a/src/plugins/platforms/wasm/qwasmcompositor.cpp b/src/plugins/platforms/wasm/qwasmcompositor.cpp
index 90cc20789d..e6a69c4814 100644
--- a/src/plugins/platforms/wasm/qwasmcompositor.cpp
+++ b/src/plugins/platforms/wasm/qwasmcompositor.cpp
@@ -193,7 +193,7 @@ void QWasmCompositor::requestRedraw()
QCoreApplication::postEvent(this, new QEvent(QEvent::UpdateRequest));
}
-QWindow *QWasmCompositor::windowAt(QPoint p, int padding) const
+QWindow *QWasmCompositor::windowAt(QPoint globalPoint, int padding) const
{
int index = m_windowStack.count() - 1;
// qDebug() << "window at" << "point" << p << "window count" << index;
@@ -205,7 +205,7 @@ QWindow *QWasmCompositor::windowAt(QPoint p, int padding) const
QRect geometry = compositedWindow.window->windowFrameGeometry()
.adjusted(-padding, -padding, padding, padding);
- if (compositedWindow.visible && geometry.contains(p))
+ if (compositedWindow.visible && geometry.contains(globalPoint))
return m_windowStack.at(index)->window();
--index;
}
diff --git a/src/plugins/platforms/wasm/qwasmcompositor.h b/src/plugins/platforms/wasm/qwasmcompositor.h
index ed6facdcc3..3104573073 100644
--- a/src/plugins/platforms/wasm/qwasmcompositor.h
+++ b/src/plugins/platforms/wasm/qwasmcompositor.h
@@ -116,7 +116,7 @@ public:
void redrawWindowContent();
void requestRedraw();
- QWindow *windowAt(QPoint p, int padding = 0) const;
+ QWindow *windowAt(QPoint globalPoint, int padding = 0) const;
QWindow *keyWindow() const;
bool event(QEvent *event);
diff --git a/src/plugins/platforms/wasm/qwasmeventtranslator.cpp b/src/plugins/platforms/wasm/qwasmeventtranslator.cpp
index 63a764e741..f4ca49997a 100644
--- a/src/plugins/platforms/wasm/qwasmeventtranslator.cpp
+++ b/src/plugins/platforms/wasm/qwasmeventtranslator.cpp
@@ -316,8 +316,8 @@ static void mouseWheelEvent(emscripten::val event) {
}
}
-EMSCRIPTEN_BINDINGS(mouse_module) {
- function("mouseWheelEvent", &mouseWheelEvent);
+EMSCRIPTEN_BINDINGS(qtMouseModule) {
+ function("qtMouseWheelEvent", &mouseWheelEvent);
}
QWasmEventTranslator::QWasmEventTranslator(QWasmScreen *screen)
@@ -358,7 +358,7 @@ void QWasmEventTranslator::initEventHandlers()
emscripten::val::global(canvasId).call<void>("addEventListener",
std::string("wheel"),
- val::module_property("mouseWheelEvent"));
+ val::module_property("qtMouseWheelEvent"));
}
}
@@ -549,22 +549,22 @@ void resizeWindow(QWindow *window, QWasmWindow::ResizeMode mode,
void QWasmEventTranslator::processMouse(int eventType, const EmscriptenMouseEvent *mouseEvent)
{
auto timestamp = mouseEvent->timestamp;
- QPoint point(mouseEvent->targetX, mouseEvent->targetY);
+ QPoint targetPoint(mouseEvent->targetX, mouseEvent->targetY);
+ QPoint globalPoint = screen()->geometry().topLeft() + targetPoint;
QEvent::Type buttonEventType = QEvent::None;
-
Qt::MouseButton button = translateMouseButton(mouseEvent->button);
Qt::KeyboardModifiers modifiers = translateMouseEventModifier(mouseEvent);
- QWindow *window2 = screen()->compositor()->windowAt(point, 5);
- if (window2 != nullptr)
- lastWindow = window2;
-
- QWasmWindow *htmlWindow = static_cast<QWasmWindow*>(window2->handle());
+ QWindow *window2 = screen()->compositor()->windowAt(globalPoint, 5);
+ if (window2 == nullptr)
+ return;
+ lastWindow = window2;
- bool interior = window2 && window2->geometry().contains(point);
+ QPoint localPoint = window2->mapFromGlobal(globalPoint);
+ bool interior = window2->geometry().contains(globalPoint);
- QPoint localPoint(point.x() - window2->geometry().x(), point.y() - window2->geometry().y());
+ QWasmWindow *htmlWindow = static_cast<QWasmWindow*>(window2->handle());
switch (eventType) {
case EMSCRIPTEN_EVENT_MOUSEDOWN:
{
@@ -580,18 +580,18 @@ void QWasmEventTranslator::processMouse(int eventType, const EmscriptenMouseEven
pressedWindow = window2;
buttonEventType = QEvent::MouseButtonPress;
if (!(htmlWindow->m_windowState & Qt::WindowFullScreen) && !(htmlWindow->m_windowState & Qt::WindowMaximized)) {
- if (htmlWindow && window2->flags().testFlag(Qt::WindowTitleHint) && htmlWindow->isPointOnTitle(point))
+ if (htmlWindow && window2->flags().testFlag(Qt::WindowTitleHint) && htmlWindow->isPointOnTitle(globalPoint))
draggedWindow = window2;
- else if (htmlWindow && htmlWindow->isPointOnResizeRegion(point)) {
+ else if (htmlWindow && htmlWindow->isPointOnResizeRegion(globalPoint)) {
draggedWindow = window2;
- resizeMode = htmlWindow->resizeModeAtPoint(point);
- resizePoint = point;
+ resizeMode = htmlWindow->resizeModeAtPoint(globalPoint);
+ resizePoint = globalPoint;
resizeStartRect = window2->geometry();
}
}
}
- htmlWindow->injectMousePressed(localPoint, point, button, modifiers);
+ htmlWindow->injectMousePressed(localPoint, globalPoint, button, modifiers);
break;
}
case EMSCRIPTEN_EVENT_MOUSEUP:
@@ -611,7 +611,7 @@ void QWasmEventTranslator::processMouse(int eventType, const EmscriptenMouseEven
}
if (oldWindow)
- oldWindow->injectMouseReleased(localPoint, point, button, modifiers);
+ oldWindow->injectMouseReleased(localPoint, globalPoint, button, modifiers);
break;
}
case EMSCRIPTEN_EVENT_MOUSEMOVE: // drag event
@@ -640,7 +640,7 @@ void QWasmEventTranslator::processMouse(int eventType, const EmscriptenMouseEven
}
if (window2 && interior) {
QWindowSystemInterface::handleMouseEvent<QWindowSystemInterface::SynchronousDelivery>(
- window2, timestamp, localPoint, point, pressedButtons, button, buttonEventType, modifiers);
+ window2, timestamp, localPoint, globalPoint, pressedButtons, button, buttonEventType, modifiers);
}
}
@@ -675,11 +675,13 @@ int QWasmEventTranslator::wheel_cb(int eventType, const EmscriptenWheelEvent *wh
QWasmEventTranslator *translator = (QWasmEventTranslator*)userData;
Qt::KeyboardModifiers modifiers = translator->translateMouseEventModifier(&mouseEvent);
auto timestamp = mouseEvent.timestamp;
- QPoint globalPoint(mouseEvent.canvasX, mouseEvent.canvasY);
+ QPoint targetPoint(mouseEvent.targetX, mouseEvent.targetY);
+ QPoint globalPoint = eventTranslator->screen()->geometry().topLeft() + targetPoint;
QWindow *window2 = eventTranslator->screen()->compositor()->windowAt(globalPoint, 5);
-
- QPoint localPoint(globalPoint.x() - window2->geometry().x(), globalPoint.y() - window2->geometry().y());
+ if (!window2)
+ return 0;
+ QPoint localPoint = window2->mapFromGlobal(globalPoint);
QPoint pixelDelta;
@@ -709,24 +711,28 @@ int QWasmEventTranslator::handleTouch(int eventType, const EmscriptenTouchEvent
const EmscriptenTouchPoint *touches = &touchEvent->touches[i];
- QPoint point(touches->targetX, touches->targetY);
- window2 = this->screen()->compositor()->windowAt(point, 5);
+ QPoint targetPoint(touches->targetX, touches->targetY);
+ QPoint globalPoint = screen()->geometry().topLeft() + targetPoint;
+
+ window2 = this->screen()->compositor()->windowAt(globalPoint, 5);
+ if (window2 == nullptr)
+ continue;
+
QWindowSystemInterface::TouchPoint touchPoint;
touchPoint.area = QRect(0, 0, 8, 8);
touchPoint.id = touches->identifier;
touchPoint.pressure = 1.0;
- const QPointF screenPos(point);
-
- touchPoint.area.moveCenter(screenPos);
+ touchPoint.area.moveCenter(globalPoint);
const auto tp = pressedTouchIds.constFind(touchPoint.id);
if (tp != pressedTouchIds.constEnd())
touchPoint.normalPosition = tp.value();
- QPointF normalPosition(screenPos.x() / window2->width(),
- screenPos.y() / window2->height());
+ QPointF localPoint = QPointF(window2->mapFromGlobal(globalPoint));
+ QPointF normalPosition(localPoint.x() / window2->width(),
+ localPoint.y() / window2->height());
const bool stationaryTouchPoint = (normalPosition == touchPoint.normalPosition);
touchPoint.normalPosition = normalPosition;
diff --git a/src/plugins/platforms/wasm/qwasmintegration.cpp b/src/plugins/platforms/wasm/qwasmintegration.cpp
index 1964cefdad..e601d553f2 100644
--- a/src/plugins/platforms/wasm/qwasmintegration.cpp
+++ b/src/plugins/platforms/wasm/qwasmintegration.cpp
@@ -34,6 +34,7 @@
#include "qwasmopenglcontext.h"
#include "qwasmtheme.h"
#include "qwasmclipboard.h"
+#include "qwasmservices.h"
#include "qwasmwindow.h"
#ifndef QT_NO_OPENGL
@@ -56,21 +57,42 @@
using namespace emscripten;
QT_BEGIN_NAMESPACE
-void browserBeforeUnload(emscripten::val)
+static void browserBeforeUnload(emscripten::val)
{
QWasmIntegration::QWasmBrowserExit();
}
-EMSCRIPTEN_BINDINGS(my_module)
+static void addCanvasElement(emscripten::val canvas)
{
- function("browserBeforeUnload", &browserBeforeUnload);
+ QString canvasId = QString::fromStdString(canvas["id"].as<std::string>());
+ QWasmIntegration::get()->addScreen(canvasId);
+}
+
+static void removeCanvasElement(emscripten::val canvas)
+{
+ QString canvasId = QString::fromStdString(canvas["id"].as<std::string>());
+ QWasmIntegration::get()->removeScreen(canvasId);
+}
+
+static void resizeCanvasElement(emscripten::val canvas)
+{
+ QString canvasId = QString::fromStdString(canvas["id"].as<std::string>());
+ QWasmIntegration::get()->resizeScreen(canvasId);
+}
+
+EMSCRIPTEN_BINDINGS(qtQWasmIntegraton)
+{
+ function("qtBrowserBeforeUnload", &browserBeforeUnload);
+ function("qtAddCanvasElement", &addCanvasElement);
+ function("qtRemoveCanvasElement", &removeCanvasElement);
+ function("qtResizeCanvasElement", &resizeCanvasElement);
}
QWasmIntegration *QWasmIntegration::s_instance;
QWasmIntegration::QWasmIntegration()
: m_fontDb(nullptr),
- m_eventDispatcher(nullptr),
+ m_desktopServices(nullptr),
m_clipboard(new QWasmClipboard)
{
s_instance = this;
@@ -92,13 +114,18 @@ QWasmIntegration::QWasmIntegration()
addScreen(canvasId);
}
- emscripten::val::global("window").set("onbeforeunload", val::module_property("browserBeforeUnload"));
+ emscripten::val::global("window").set("onbeforeunload", val::module_property("qtBrowserBeforeUnload"));
}
QWasmIntegration::~QWasmIntegration()
{
delete m_fontDb;
- qDeleteAll(m_screens);
+ delete m_desktopServices;
+
+ for (auto it = m_screens.constBegin(); it != m_screens.constEnd(); ++it)
+ QWindowSystemInterface::handleScreenRemoved(*it);
+ m_screens.clear();
+
s_instance = nullptr;
}
@@ -113,7 +140,7 @@ bool QWasmIntegration::hasCapability(QPlatformIntegration::Capability cap) const
switch (cap) {
case ThreadedPixmaps: return true;
case OpenGL: return true;
- case ThreadedOpenGL: return true;
+ case ThreadedOpenGL: return false;
case RasterGLSurface: return false; // to enable this you need to fix qopenglwidget and quickwidget for wasm
case MultipleWindows: return true;
case WindowManagement: return true;
@@ -161,9 +188,21 @@ QAbstractEventDispatcher *QWasmIntegration::createEventDispatcher() const
QVariant QWasmIntegration::styleHint(QPlatformIntegration::StyleHint hint) const
{
+ if (hint == ShowIsFullScreen)
+ return true;
+
return QPlatformIntegration::styleHint(hint);
}
+Qt::WindowState QWasmIntegration::defaultWindowState(Qt::WindowFlags flags) const
+{
+ // Don't maximize dialogs
+ if (flags & Qt::Dialog & ~Qt::Window)
+ return Qt::WindowNoState;
+
+ return QPlatformIntegration::defaultWindowState(flags);
+}
+
QStringList QWasmIntegration::themeNames() const
{
return QStringList() << QLatin1String("webassembly");
@@ -176,22 +215,34 @@ QPlatformTheme *QWasmIntegration::createPlatformTheme(const QString &name) const
return QPlatformIntegration::createPlatformTheme(name);
}
-QPlatformClipboard* QWasmIntegration::clipboard() const
+QPlatformServices *QWasmIntegration::services() const
{
- return m_clipboard;
+ if (m_desktopServices == nullptr)
+ m_desktopServices = new QWasmServices();
+ return m_desktopServices;
}
-QVector<QWasmScreen *> QWasmIntegration::screens()
+QPlatformClipboard* QWasmIntegration::clipboard() const
{
- return m_screens;
+ return m_clipboard;
}
void QWasmIntegration::addScreen(const QString &canvasId)
{
QWasmScreen *screen = new QWasmScreen(canvasId);
m_clipboard->installEventHandlers(canvasId);
- m_screens.append(screen);
- screenAdded(screen);
+ m_screens.insert(canvasId, screen);
+ QWindowSystemInterface::handleScreenAdded(screen);
+}
+
+void QWasmIntegration::removeScreen(const QString &canvasId)
+{
+ QWindowSystemInterface::handleScreenRemoved(m_screens.take(canvasId));
+}
+
+void QWasmIntegration::resizeScreen(const QString &canvasId)
+{
+ m_screens.value(canvasId)->updateQScreenAndCanvasRenderSize();
}
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/wasm/qwasmintegration.h b/src/plugins/platforms/wasm/qwasmintegration.h
index 5c0ac0b297..11d8d0f7f5 100644
--- a/src/plugins/platforms/wasm/qwasmintegration.h
+++ b/src/plugins/platforms/wasm/qwasmintegration.h
@@ -50,6 +50,7 @@ class QWasmScreen;
class QWasmCompositor;
class QWasmBackingStore;
class QWasmClipboard;
+class QWasmServices;
class QWasmIntegration : public QObject, public QPlatformIntegration
{
@@ -67,24 +68,26 @@ public:
QPlatformFontDatabase *fontDatabase() const override;
QAbstractEventDispatcher *createEventDispatcher() const override;
QVariant styleHint(QPlatformIntegration::StyleHint hint) const override;
+ Qt::WindowState defaultWindowState(Qt::WindowFlags flags) const override;
QStringList themeNames() const override;
QPlatformTheme *createPlatformTheme(const QString &name) const override;
+ QPlatformServices *services() const override;
QPlatformClipboard *clipboard() const override;
-
- QVector<QWasmScreen *>screens();
QWasmClipboard *getWasmClipboard() { return m_clipboard; }
static QWasmIntegration *get() { return s_instance; }
static void QWasmBrowserExit();
-private:
void addScreen(const QString &canvasId);
+ void removeScreen(const QString &canvasId);
+ void resizeScreen(const QString &canvasId);
+private:
mutable QWasmFontDatabase *m_fontDb;
- mutable QWasmEventDispatcher *m_eventDispatcher;
+ mutable QWasmServices *m_desktopServices;
mutable QHash<QWindow *, QWasmBackingStore *> m_backingStores;
- QVector<QWasmScreen *> m_screens;
+ QHash<QString, QWasmScreen *> m_screens;
mutable QWasmClipboard *m_clipboard;
static QWasmIntegration *s_instance;
};
diff --git a/src/plugins/platforms/wasm/qwasmservices.cpp b/src/plugins/platforms/wasm/qwasmservices.cpp
new file mode 100644
index 0000000000..9328b8c065
--- /dev/null
+++ b/src/plugins/platforms/wasm/qwasmservices.cpp
@@ -0,0 +1,45 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 or (at your option) 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.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-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qwasmservices.h"
+#include <QtCore/QUrl>
+#include <QtCore/QDebug>
+
+#include <emscripten/val.h>
+
+QT_BEGIN_NAMESPACE
+
+bool QWasmServices::openUrl(const QUrl &url)
+{
+ QByteArray utf8Url = url.toString().toUtf8();
+ emscripten::val::global("window").call<void>("open", emscripten::val(utf8Url.constData()), emscripten::val("_blank"));
+ return true;
+}
+
+QT_END_NAMESPACE
diff --git a/src/plugins/platforms/wasm/qwasmservices.h b/src/plugins/platforms/wasm/qwasmservices.h
new file mode 100644
index 0000000000..3b37f21f82
--- /dev/null
+++ b/src/plugins/platforms/wasm/qwasmservices.h
@@ -0,0 +1,45 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 or (at your option) 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.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-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QWASMDESKTOPSERVICES_H
+#define QWASMDESKTOPSERVICES_H
+
+#include <qpa/qplatformservices.h>
+
+QT_BEGIN_NAMESPACE
+
+class QWasmServices : public QPlatformServices
+{
+public:
+ bool openUrl(const QUrl &url) override;
+};
+
+QT_END_NAMESPACE
+
+#endif // QWASMDESKTOPSERVICES_H
diff --git a/src/plugins/platforms/wasm/wasm.pro b/src/plugins/platforms/wasm/wasm.pro
index 5aa6dfccf3..9b98445c68 100644
--- a/src/plugins/platforms/wasm/wasm.pro
+++ b/src/plugins/platforms/wasm/wasm.pro
@@ -19,7 +19,8 @@ SOURCES = \
qwasmcursor.cpp \
qwasmopenglcontext.cpp \
qwasmtheme.cpp \
- qwasmclipboard.cpp
+ qwasmclipboard.cpp \
+ qwasmservices.cpp
HEADERS = \
qwasmintegration.h \
@@ -33,7 +34,8 @@ HEADERS = \
qwasmcursor.h \
qwasmopenglcontext.h \
qwasmtheme.h \
- qwasmclipboard.h
+ qwasmclipboard.h \
+ qwasmservices.h
wasmfonts.files = \
../../../3rdparty/wasm/Vera.ttf \
diff --git a/src/plugins/platforms/wasm/wasm_shell.html b/src/plugins/platforms/wasm/wasm_shell.html
index 39bb711b6b..f7c856d63d 100644
--- a/src/plugins/platforms/wasm/wasm_shell.html
+++ b/src/plugins/platforms/wasm/wasm_shell.html
@@ -11,7 +11,7 @@
/* The contenteditable property is set to true for the canvas in order to support
clipboard events. Hide the resulting focus frame and set the cursor back to
the default cursor. */
- canvas { outline: 0px solid transparent; cursor:default }
+ canvas { outline: 0px solid transparent; caret-color: transparent; cursor:default }
</style>
</head>
<body onload="init()">
@@ -27,9 +27,9 @@
<script type='text/javascript'>
function init() {
- var spinner = document.getElementById('qtspinner');
- var canvas = document.getElementById('qtcanvas');
- var status = document.getElementById('qtstatus')
+ var spinner = document.querySelector('#qtspinner');
+ var canvas = document.querySelector('#qtcanvas');
+ var status = document.querySelector('#qtstatus')
var qtLoader = QtLoader({
canvasElements : [canvas],
diff --git a/src/plugins/platforms/windows/qwindowsintegration.h b/src/plugins/platforms/windows/qwindowsintegration.h
index da86852766..e28b2c2fb3 100644
--- a/src/plugins/platforms/windows/qwindowsintegration.h
+++ b/src/plugins/platforms/windows/qwindowsintegration.h
@@ -107,9 +107,6 @@ public:
static QWindowsIntegration *instance() { return m_instance; }
- inline void emitScreenAdded(QPlatformScreen *s, bool isPrimary = false) { screenAdded(s, isPrimary); }
- inline void emitDestroyScreen(QPlatformScreen *s) { destroyScreen(s); }
-
unsigned options() const;
void beep() const override;
diff --git a/src/plugins/platforms/windows/qwindowsscreen.cpp b/src/plugins/platforms/windows/qwindowsscreen.cpp
index a161dc46e9..0520f88935 100644
--- a/src/plugins/platforms/windows/qwindowsscreen.cpp
+++ b/src/plugins/platforms/windows/qwindowsscreen.cpp
@@ -121,7 +121,7 @@ BOOL QT_WIN_CALLBACK monitorEnumCallback(HMONITOR hMonitor, HDC, LPRECT, LPARAM
QWindowsScreenData data;
if (monitorData(hMonitor, &data)) {
WindowsScreenDataList *result = reinterpret_cast<WindowsScreenDataList *>(p);
- // QPlatformIntegration::screenAdded() documentation specifies that first
+ // QWindowSystemInterface::handleScreenAdded() documentation specifies that first
// added screen will be the primary screen, so order accordingly.
// Note that the side effect of this policy is that there is no way to change primary
// screen reported by Qt, unless we want to delete all existing screens and add them
@@ -521,7 +521,7 @@ void QWindowsScreenManager::removeScreen(int index)
if (movedWindowCount)
QWindowSystemInterface::flushWindowSystemEvents();
}
- QWindowsIntegration::instance()->emitDestroyScreen(m_screens.takeAt(index));
+ QWindowSystemInterface::handleScreenRemoved(m_screens.takeAt(index));
}
/*!
@@ -541,7 +541,7 @@ bool QWindowsScreenManager::handleScreenChanges()
} else {
QWindowsScreen *newScreen = new QWindowsScreen(newData);
m_screens.push_back(newScreen);
- QWindowsIntegration::instance()->emitScreenAdded(newScreen,
+ QWindowSystemInterface::handleScreenAdded(newScreen,
newData.flags & QWindowsScreenData::PrimaryScreen);
qCDebug(lcQpaWindows) << "New Monitor: " << newData;
} // exists
@@ -561,7 +561,7 @@ void QWindowsScreenManager::clearScreens()
{
// Delete screens in reverse order to avoid crash in case of multiple screens
while (!m_screens.isEmpty())
- QWindowsIntegration::instance()->emitDestroyScreen(m_screens.takeLast());
+ QWindowSystemInterface::handleScreenRemoved(m_screens.takeLast());
}
const QWindowsScreen *QWindowsScreenManager::screenAtDp(const QPoint &p) const
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp
index 8bf090bf03..338e594c7b 100644
--- a/src/plugins/platforms/windows/qwindowswindow.cpp
+++ b/src/plugins/platforms/windows/qwindowswindow.cpp
@@ -1132,7 +1132,8 @@ QWindowCreationContext::QWindowCreationContext(const QWindow *w,
// TODO: No concept of WA_wasMoved yet that would indicate a
// CW_USEDEFAULT unless set. For now, assume that 0,0 means 'default'
// for toplevels.
- if (geometry.isValid()) {
+ if (geometry.isValid()
+ || !qt_window_private(const_cast<QWindow *>(w))->resizeAutomatic) {
frameX = geometry.x();
frameY = geometry.y();
const QMargins effectiveMargins = margins + customMargins;
@@ -1759,15 +1760,12 @@ void QWindowsWindow::checkForScreenChanged()
QPlatformScreen *currentScreen = screen();
const auto &screenManager = QWindowsContext::instance()->screenManager();
- // QTBUG-62971: When dragging a window by its border, detect by mouse position
- // to prevent it from oscillating between screens when it resizes
- const QWindowsScreen *newScreen = testFlag(ResizeMoveActive)
- ? screenManager.screenAtDp(QWindowsCursor::mousePosition())
- : screenManager.screenForHwnd(m_data.hwnd);
+ const QWindowsScreen *newScreen = screenManager.screenForHwnd(m_data.hwnd);
if (newScreen != nullptr && newScreen != currentScreen) {
qCDebug(lcQpaWindows).noquote().nospace() << __FUNCTION__
<< ' ' << window() << " \"" << currentScreen->name()
<< "\"->\"" << newScreen->name() << '"';
+ setFlag(SynchronousGeometryChangeEvent);
QWindowSystemInterface::handleWindowScreenChanged(window(), newScreen->screen());
}
}
@@ -1786,11 +1784,14 @@ void QWindowsWindow::handleGeometryChange()
fireExpose(QRect(QPoint(0, 0), m_data.geometry.size()), true);
}
+ const bool wasSync = testFlag(SynchronousGeometryChangeEvent);
checkForScreenChanged();
if (testFlag(SynchronousGeometryChangeEvent))
QWindowSystemInterface::flushWindowSystemEvents(QEventLoop::ExcludeUserInputEvents);
+ if (!wasSync)
+ clearFlag(SynchronousGeometryChangeEvent);
qCDebug(lcQpaEvents) << __FUNCTION__ << this << window() << m_data.geometry;
}
diff --git a/src/plugins/platforms/winrt/qwinrtintegration.cpp b/src/plugins/platforms/winrt/qwinrtintegration.cpp
index 78cbc3aec3..27d3746933 100644
--- a/src/plugins/platforms/winrt/qwinrtintegration.cpp
+++ b/src/plugins/platforms/winrt/qwinrtintegration.cpp
@@ -133,7 +133,7 @@ QWinRTIntegration::QWinRTIntegration() : d_ptr(new QWinRTIntegrationPrivate)
});
d->inputContext.reset(new QWinRTInputContext(d->mainScreen));
- screenAdded(d->mainScreen);
+ QWindowSystemInterface::handleScreenAdded(d->mainScreen);
d->platformServices = new QWinRTServices;
d->clipboard = new QWinRTClipboard;
#if QT_CONFIG(accessibility)
@@ -154,7 +154,7 @@ QWinRTIntegration::~QWinRTIntegration()
Q_ASSERT_SUCCEEDED(hr);
}
- destroyScreen(d->mainScreen);
+ QWindowSystemInterface::handleScreenRemoved(d->mainScreen);
Windows::Foundation::Uninitialize();
}
diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp
index d42a33c22b..476de6d1e5 100644
--- a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp
+++ b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp
@@ -652,6 +652,12 @@ static const char *qglx_threadedgl_blacklist_renderer[] = {
0
};
+static const char *qglx_threadedgl_blacklist_vendor[] = {
+ "llvmpipe", // QTCREATORBUG-10666
+ "nouveau", // https://bugs.freedesktop.org/show_bug.cgi?id=91632
+ nullptr
+};
+
void QGLXContext::queryDummyContext()
{
if (m_queriedDummyContext)
@@ -710,6 +716,18 @@ void QGLXContext::queryDummyContext()
}
}
}
+ if (const char *vendor = (const char *) glGetString(GL_VENDOR)) {
+ for (int i = 0; qglx_threadedgl_blacklist_vendor[i]; ++i) {
+ if (strstr(vendor, qglx_threadedgl_blacklist_vendor[i]) != 0) {
+ qCDebug(lcQpaGl).nospace() << "Multithreaded OpenGL disabled: "
+ "blacklisted vendor \""
+ << qglx_threadedgl_blacklist_vendor[i]
+ << "\"";
+ m_supportsThreading = false;
+ break;
+ }
+ }
+ }
if (glxvendor && m_supportsThreading) {
// Blacklist Mesa drivers due to QTCREATORBUG-10875 (crash in creator),
diff --git a/src/plugins/platforms/xcb/nativepainting/qbackingstore_x11.cpp b/src/plugins/platforms/xcb/nativepainting/qbackingstore_x11.cpp
index ed482e5dae..bbc156fc53 100644
--- a/src/plugins/platforms/xcb/nativepainting/qbackingstore_x11.cpp
+++ b/src/plugins/platforms/xcb/nativepainting/qbackingstore_x11.cpp
@@ -192,6 +192,10 @@ bool QXcbNativeBackingStore::scroll(const QRegion &area, int dx, int dy)
void QXcbNativeBackingStore::beginPaint(const QRegion &region)
{
+ QX11PlatformPixmap *x11pm = qt_x11Pixmap(m_pixmap);
+ if (x11pm)
+ x11pm->setIsBackingStore(true);
+
#if QT_CONFIG(xrender)
if (m_translucentBackground) {
const QVector<XRectangle> xrects = qt_region_to_xrectangles(region);
diff --git a/src/plugins/platforms/xcb/nativepainting/qpaintengine_x11.cpp b/src/plugins/platforms/xcb/nativepainting/qpaintengine_x11.cpp
index 2688d6e884..8d958aae94 100644
--- a/src/plugins/platforms/xcb/nativepainting/qpaintengine_x11.cpp
+++ b/src/plugins/platforms/xcb/nativepainting/qpaintengine_x11.cpp
@@ -200,6 +200,7 @@ public:
uint has_pattern : 1;
uint has_alpha_pen : 1;
uint has_alpha_brush : 1;
+ uint use_sysclip : 1;
uint render_hints;
const QXcbX11Info *xinfo;
@@ -701,6 +702,9 @@ bool QX11PaintEngine::begin(QPaintDevice *pdev)
d->xlibMaxLinePoints = 32762; // a safe number used to avoid, call to XMaxRequestSize(d->dpy) - 3;
d->opacity = 1;
+ QX11PlatformPixmap *x11pm = paintDevice()->devType() == QInternal::Pixmap ? qt_x11Pixmap(*static_cast<QPixmap *>(paintDevice())) : nullptr;
+ d->use_sysclip = paintDevice()->devType() == QInternal::Widget || (x11pm ? x11pm->isBackingStore() : false);
+
// Set up the polygon clipper. Note: This will only work in
// polyline mode as long as we have a buffer zone, since a
// polyline may be clipped into several non-connected polylines.
@@ -1472,7 +1476,7 @@ void QX11PaintEngine::updatePen(const QPen &pen)
}
if (!d->has_clipping) { // if clipping is set the paintevent clip region is merged with the clip region
- QRegion sysClip = systemClip();
+ QRegion sysClip = d->use_sysclip ? systemClip() : QRegion();
if (!sysClip.isEmpty())
x11SetClipRegion(d->dpy, d->gc, 0, d->picture, sysClip);
else
@@ -1603,7 +1607,7 @@ void QX11PaintEngine::updateBrush(const QBrush &brush, const QPointF &origin)
vals.fill_style = s;
XChangeGC(d->dpy, d->gc_brush, mask, &vals);
if (!d->has_clipping) {
- QRegion sysClip = systemClip();
+ QRegion sysClip = d->use_sysclip ? systemClip() : QRegion();
if (!sysClip.isEmpty())
x11SetClipRegion(d->dpy, d->gc_brush, 0, d->picture, sysClip);
else
@@ -2223,7 +2227,7 @@ void QX11PaintEngine::updateMatrix(const QTransform &mtx)
void QX11PaintEngine::updateClipRegion_dev(const QRegion &clipRegion, Qt::ClipOperation op)
{
Q_D(QX11PaintEngine);
- QRegion sysClip = systemClip();
+ QRegion sysClip = d->use_sysclip ? systemClip() : QRegion();
if (op == Qt::NoClip) {
d->has_clipping = false;
d->crgn = sysClip;
@@ -2641,6 +2645,13 @@ bool QXRenderGlyphCache::addGlyphs(const QTextItemInt &ti,
if (glyph == 0 || glyph->format != glyphFormat())
return false;
+ if (glyph->format == QFontEngine::Format_Mono) {
+ // Must convert bitmap from msb to lsb bit order
+ QImage img(glyph->data, glyph->width, glyph->height, QImage::Format_Mono);
+ img = img.convertToFormat(QImage::Format_MonoLSB);
+ memcpy(glyph->data, img.constBits(), static_cast<size_t>(img.sizeInBytes()));
+ }
+
set->setGlyph(glyphs[i], spp, glyph);
Q_ASSERT(glyph->data || glyph->width == 0 || glyph->height == 0);
diff --git a/src/plugins/platforms/xcb/nativepainting/qpixmap_x11.cpp b/src/plugins/platforms/xcb/nativepainting/qpixmap_x11.cpp
index 86c87e5e30..b1ce39f363 100644
--- a/src/plugins/platforms/xcb/nativepainting/qpixmap_x11.cpp
+++ b/src/plugins/platforms/xcb/nativepainting/qpixmap_x11.cpp
@@ -1772,6 +1772,20 @@ XID QX11PlatformPixmap::createBitmapFromImage(const QImage &image)
return hd;
}
+bool QX11PlatformPixmap::isBackingStore() const
+{
+ return (flags & IsBackingStore);
+}
+
+void QX11PlatformPixmap::setIsBackingStore(bool on)
+{
+ if (on)
+ flags |= IsBackingStore;
+ else {
+ flags &= ~IsBackingStore;
+ }
+}
+
#if QT_CONFIG(xrender)
void QX11PlatformPixmap::convertToARGB32(bool preserveContents)
{
diff --git a/src/plugins/platforms/xcb/nativepainting/qpixmap_x11_p.h b/src/plugins/platforms/xcb/nativepainting/qpixmap_x11_p.h
index 7392cbfccf..9c0ba98300 100644
--- a/src/plugins/platforms/xcb/nativepainting/qpixmap_x11_p.h
+++ b/src/plugins/platforms/xcb/nativepainting/qpixmap_x11_p.h
@@ -90,6 +90,8 @@ public:
void convertToARGB32(bool preserveContents = true);
#endif
+ bool isBackingStore() const;
+ void setIsBackingStore(bool on);
private:
friend class QX11PaintEngine;
friend const QXcbX11Info &qt_x11Info(const QPixmap &pixmap);
@@ -110,7 +112,8 @@ private:
Uninitialized = 0x1,
Readonly = 0x2,
InvertedWhenBoundToTexture = 0x4,
- GlSurfaceCreatedWithAlpha = 0x8
+ GlSurfaceCreatedWithAlpha = 0x8,
+ IsBackingStore = 0x10
};
uint flags;
diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp
index e35b97dab4..d27a288feb 100644
--- a/src/plugins/platforms/xcb/qxcbconnection.cpp
+++ b/src/plugins/platforms/xcb/qxcbconnection.cpp
@@ -152,10 +152,9 @@ QXcbConnection::~QXcbConnection()
if (m_eventQueue)
delete m_eventQueue;
- QXcbIntegration *integration = QXcbIntegration::instance();
// Delete screens in reverse order to avoid crash in case of multiple screens
while (!m_screens.isEmpty())
- integration->destroyScreen(m_screens.takeLast());
+ QWindowSystemInterface::handleScreenRemoved(m_screens.takeLast());
while (!m_virtualDesktops.isEmpty())
delete m_virtualDesktops.takeLast();
diff --git a/src/plugins/platforms/xcb/qxcbconnection_basic.h b/src/plugins/platforms/xcb/qxcbconnection_basic.h
index b76aba2789..1bd4310562 100644
--- a/src/plugins/platforms/xcb/qxcbconnection_basic.h
+++ b/src/plugins/platforms/xcb/qxcbconnection_basic.h
@@ -40,6 +40,7 @@
#define QXCBBASICCONNECTION_H
#include "qxcbatom.h"
+#include "qxcbexport.h"
#include <QtCore/QPair>
#include <QtCore/QObject>
@@ -55,7 +56,7 @@ QT_BEGIN_NAMESPACE
Q_DECLARE_LOGGING_CATEGORY(lcQpaXcb)
-class QXcbBasicConnection : public QObject
+class Q_XCB_EXPORT QXcbBasicConnection : public QObject
{
Q_OBJECT
public:
diff --git a/src/plugins/platforms/xcb/qxcbconnection_screens.cpp b/src/plugins/platforms/xcb/qxcbconnection_screens.cpp
index 4bafe83156..9ba71ada37 100644
--- a/src/plugins/platforms/xcb/qxcbconnection_screens.cpp
+++ b/src/plugins/platforms/xcb/qxcbconnection_screens.cpp
@@ -44,6 +44,8 @@
#include <QtCore/QString>
#include <QtCore/QList>
+#include <qpa/qwindowsysteminterface.h>
+
#include <xcb/xinerama.h>
void QXcbConnection::xrandrSelectEvents()
@@ -211,7 +213,7 @@ void QXcbConnection::updateScreen(QXcbScreen *screen, const xcb_randr_output_cha
m_screens.swapItemsAt(0, idx);
}
screen->virtualDesktop()->setPrimaryScreen(screen);
- QXcbIntegration::instance()->setPrimaryScreen(screen);
+ QWindowSystemInterface::handlePrimaryScreenChanged(screen);
}
}
}
@@ -234,7 +236,7 @@ QXcbScreen *QXcbConnection::createScreen(QXcbVirtualDesktop *virtualDesktop,
m_screens.append(screen);
}
virtualDesktop->addScreen(screen);
- QXcbIntegration::instance()->screenAdded(screen, screen->isPrimary());
+ QWindowSystemInterface::handleScreenAdded(screen, screen->isPrimary());
return screen;
}
@@ -261,10 +263,10 @@ void QXcbConnection::destroyScreen(QXcbScreen *screen)
const int idx = m_screens.indexOf(newPrimary);
if (idx > 0)
m_screens.swapItemsAt(0, idx);
- QXcbIntegration::instance()->setPrimaryScreen(newPrimary);
+ QWindowSystemInterface::handlePrimaryScreenChanged(newPrimary);
}
- QXcbIntegration::instance()->destroyScreen(screen);
+ QWindowSystemInterface::handleScreenRemoved(screen);
}
}
@@ -406,7 +408,7 @@ void QXcbConnection::initializeScreens()
// Push the screens to QGuiApplication
for (QXcbScreen *screen : qAsConst(m_screens)) {
qCDebug(lcQpaScreen) << "adding" << screen << "(Primary:" << screen->isPrimary() << ")";
- QXcbIntegration::instance()->screenAdded(screen, screen->isPrimary());
+ QWindowSystemInterface::handleScreenAdded(screen, screen->isPrimary());
}
qCDebug(lcQpaScreen) << "primary output is" << qAsConst(m_screens).first()->name();
diff --git a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
index 78ef7760af..e4da207b00 100644
--- a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
+++ b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
@@ -1208,6 +1208,11 @@ bool QXcbConnection::xi2HandleTabletEvent(const void *event, TabletData *tabletD
return handled;
}
+inline qreal scaleOneValuator(qreal normValue, qreal screenMin, qreal screenSize)
+{
+ return screenMin + normValue * screenSize;
+}
+
void QXcbConnection::xi2ReportTabletEvent(const void *event, TabletData *tabletData)
{
auto *ev = reinterpret_cast<const qt_xcb_input_device_event_t *>(event);
@@ -1220,6 +1225,17 @@ void QXcbConnection::xi2ReportTabletEvent(const void *event, TabletData *tabletD
QPointF global(fixed1616ToReal(ev->root_x), fixed1616ToReal(ev->root_y));
double pressure = 0, rotation = 0, tangentialPressure = 0;
int xTilt = 0, yTilt = 0;
+ static const bool useValuators = !qEnvironmentVariableIsSet("QT_XCB_TABLET_LEGACY_COORDINATES");
+
+ // Valuators' values are relative to the physical size of the current virtual
+ // screen. Therefore we cannot use QScreen/QWindow geometry and should use
+ // QPlatformWindow/QPlatformScreen instead.
+ QRect physicalScreenArea;
+ if (Q_LIKELY(useValuators)) {
+ const QList<QPlatformScreen *> siblings = window->screen()->handle()->virtualSiblings();
+ for (const QPlatformScreen *screen : siblings)
+ physicalScreenArea |= screen->geometry();
+ }
for (QHash<int, TabletData::ValuatorClassInfo>::iterator it = tabletData->valuatorInfo.begin(),
ite = tabletData->valuatorInfo.end(); it != ite; ++it) {
@@ -1228,6 +1244,20 @@ void QXcbConnection::xi2ReportTabletEvent(const void *event, TabletData *tabletD
xi2GetValuatorValueIfSet(event, classInfo.number, &classInfo.curVal);
double normalizedValue = (classInfo.curVal - classInfo.minVal) / (classInfo.maxVal - classInfo.minVal);
switch (valuator) {
+ case QXcbAtom::AbsX:
+ if (Q_LIKELY(useValuators)) {
+ const qreal value = scaleOneValuator(normalizedValue, physicalScreenArea.x(), physicalScreenArea.width());
+ global.setX(value);
+ local.setX(value - window->handle()->geometry().x());
+ }
+ break;
+ case QXcbAtom::AbsY:
+ if (Q_LIKELY(useValuators)) {
+ qreal value = scaleOneValuator(normalizedValue, physicalScreenArea.y(), physicalScreenArea.height());
+ global.setY(value);
+ local.setY(value - window->handle()->geometry().y());
+ }
+ break;
case QXcbAtom::AbsPressure:
pressure = normalizedValue;
break;
diff --git a/src/plugins/platforms/xcb/qxcbintegration.h b/src/plugins/platforms/xcb/qxcbintegration.h
index f13e232291..571726c354 100644
--- a/src/plugins/platforms/xcb/qxcbintegration.h
+++ b/src/plugins/platforms/xcb/qxcbintegration.h
@@ -137,8 +137,6 @@ private:
QScopedPointer<QPlatformServices> m_services;
- friend class QXcbConnection; // access QPlatformIntegration::screenAdded()
-
mutable QByteArray m_wmClass;
const char *m_instanceName;
bool m_canGrab;
diff --git a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp
index 4d526a6bda..899081e752 100644
--- a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp
+++ b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp
@@ -412,12 +412,15 @@ void *QXcbNativeInterface::atspiBus()
auto reply = Q_XCB_REPLY(xcb_get_property, defaultConnection->xcb_connection(),
false, defaultConnection->rootWindow(),
atspiBusAtom, XCB_ATOM_STRING, 0, 128);
- Q_ASSERT(!reply->bytes_after);
+ if (!reply)
+ return nullptr;
+
char *data = (char *)xcb_get_property_value(reply.get());
int length = xcb_get_property_value_length(reply.get());
return new QByteArray(data, length);
}
- return 0;
+
+ return nullptr;
}
void QXcbNativeInterface::setAppTime(QScreen* screen, xcb_timestamp_t time)
diff --git a/src/plugins/sqldrivers/configure.pri b/src/plugins/sqldrivers/configure.pri
index 84c8114c7b..be6a930e52 100644
--- a/src/plugins/sqldrivers/configure.pri
+++ b/src/plugins/sqldrivers/configure.pri
@@ -2,7 +2,7 @@
defineTest(qtConfLibrary_psqlConfig) {
pg_config = $$config.input.psql_config
- isEmpty(pg_config): \
+ isEmpty(pg_config):!cross_compile: \
pg_config = $$qtConfFindInPath("pg_config")
!win32:!isEmpty(pg_config) {
qtRunLoggedCommand("$$pg_config --libdir", libdir)|return(false)
@@ -33,7 +33,7 @@ defineTest(qtConfLibrary_psqlEnv) {
defineTest(qtConfLibrary_mysqlConfig) {
mysql_config = $$config.input.mysql_config
- isEmpty(mysql_config): \
+ isEmpty(mysql_config):!cross_compile: \
mysql_config = $$qtConfFindInPath("mysql_config")
!isEmpty(mysql_config) {
qtRunLoggedCommand("$$mysql_config --version", version)|return(false)
diff --git a/src/plugins/styles/mac/qmacstyle_mac.mm b/src/plugins/styles/mac/qmacstyle_mac.mm
index 9602340f9d..d0e05c1e20 100644
--- a/src/plugins/styles/mac/qmacstyle_mac.mm
+++ b/src/plugins/styles/mac/qmacstyle_mac.mm
@@ -356,15 +356,44 @@ static const qreal titleBarButtonSpacing = 8;
// active: window is active
// selected: tab is selected
// hovered: tab is hovered
-static const QColor tabBarTabBackgroundActive(190, 190, 190);
-static const QColor tabBarTabBackgroundActiveHovered(178, 178, 178);
-static const QColor tabBarTabBackgroundActiveSelected(211, 211, 211);
-static const QColor tabBarTabBackground(227, 227, 227);
-static const QColor tabBarTabBackgroundSelected(246, 246, 246);
-static const QColor tabBarTabLineActive(160, 160, 160);
-static const QColor tabBarTabLineActiveHovered(150, 150, 150);
-static const QColor tabBarTabLine(210, 210, 210);
-static const QColor tabBarTabLineSelected(189, 189, 189);
+bool isDarkMode() { return qt_mac_applicationIsInDarkMode(); }
+
+static const QColor lightTabBarTabBackgroundActive(190, 190, 190);
+static const QColor darkTabBarTabBackgroundActive(38, 38, 38);
+static const QColor tabBarTabBackgroundActive() { return isDarkMode() ? darkTabBarTabBackgroundActive : lightTabBarTabBackgroundActive; }
+
+static const QColor lightTabBarTabBackgroundActiveHovered(178, 178, 178);
+static const QColor darkTabBarTabBackgroundActiveHovered(32, 32, 32);
+static const QColor tabBarTabBackgroundActiveHovered() { return isDarkMode() ? darkTabBarTabBackgroundActiveHovered : lightTabBarTabBackgroundActiveHovered; }
+
+static const QColor lightTabBarTabBackgroundActiveSelected(211, 211, 211);
+static const QColor darkTabBarTabBackgroundActiveSelected(52, 52, 52);
+static const QColor tabBarTabBackgroundActiveSelected() { return isDarkMode() ? darkTabBarTabBackgroundActiveSelected : lightTabBarTabBackgroundActiveSelected; }
+
+static const QColor lightTabBarTabBackground(227, 227, 227);
+static const QColor darkTabBarTabBackground(38, 38, 38);
+static const QColor tabBarTabBackground() { return isDarkMode() ? darkTabBarTabBackground : lightTabBarTabBackground; }
+
+static const QColor lightTabBarTabBackgroundSelected(246, 246, 246);
+static const QColor darkTabBarTabBackgroundSelected(52, 52, 52);
+static const QColor tabBarTabBackgroundSelected() { return isDarkMode() ? darkTabBarTabBackgroundSelected : lightTabBarTabBackgroundSelected; }
+
+static const QColor lightTabBarTabLineActive(160, 160, 160);
+static const QColor darkTabBarTabLineActive(90, 90, 90);
+static const QColor tabBarTabLineActive() { return isDarkMode() ? darkTabBarTabLineActive : lightTabBarTabLineActive; }
+
+static const QColor lightTabBarTabLineActiveHovered(150, 150, 150);
+static const QColor darkTabBarTabLineActiveHovered(90, 90, 90);
+static const QColor tabBarTabLineActiveHovered() { return isDarkMode() ? darkTabBarTabLineActiveHovered : lightTabBarTabLineActiveHovered; }
+
+static const QColor lightTabBarTabLine(210, 210, 210);
+static const QColor darkTabBarTabLine(90, 90, 90);
+static const QColor tabBarTabLine() { return isDarkMode() ? darkTabBarTabLine : lightTabBarTabLine; }
+
+static const QColor lightTabBarTabLineSelected(189, 189, 189);
+static const QColor darkTabBarTabLineSelected(90, 90, 90);
+static const QColor tabBarTabLineSelected() { return isDarkMode() ? darkTabBarTabLineSelected : lightTabBarTabLineSelected; }
+
static const QColor tabBarCloseButtonBackgroundHovered(162, 162, 162);
static const QColor tabBarCloseButtonBackgroundPressed(153, 153, 153);
static const QColor tabBarCloseButtonBackgroundSelectedHovered(192, 192, 192);
@@ -561,7 +590,7 @@ void drawTabShape(QPainter *p, const QStyleOptionTab *tabOpt, bool isUnified, in
const bool active = (tabOpt->state & QStyle::State_Active);
const bool selected = (tabOpt->state & QStyle::State_Selected);
- const QRect bodyRect(1, 1, width - 2, height - 2);
+ const QRect bodyRect(1, 2, width - 2, height - 3);
const QRect topLineRect(1, 0, width - 2, 1);
const QRect bottomLineRect(1, height - 1, width - 2, 1);
if (selected) {
@@ -572,27 +601,27 @@ void drawTabShape(QPainter *p, const QStyleOptionTab *tabOpt, bool isUnified, in
p->fillRect(tabRect, QColor(Qt::transparent));
p->restore();
} else if (active) {
- p->fillRect(bodyRect, tabBarTabBackgroundActiveSelected);
+ p->fillRect(bodyRect, tabBarTabBackgroundActiveSelected());
// top line
- p->fillRect(topLineRect, tabBarTabLineSelected);
+ p->fillRect(topLineRect, tabBarTabLineSelected());
} else {
- p->fillRect(bodyRect, tabBarTabBackgroundSelected);
+ p->fillRect(bodyRect, tabBarTabBackgroundSelected());
}
} else {
// when the mouse is over non selected tabs they get a new color
const bool hover = (tabOpt->state & QStyle::State_MouseOver);
if (hover) {
// fill body
- p->fillRect(bodyRect, tabBarTabBackgroundActiveHovered);
+ p->fillRect(bodyRect, tabBarTabBackgroundActiveHovered());
// bottom line
- p->fillRect(bottomLineRect, tabBarTabLineActiveHovered);
+ p->fillRect(bottomLineRect, isDarkMode() ? QColor(Qt::black) : tabBarTabLineActiveHovered());
}
}
// separator lines between tabs
const QRect leftLineRect(0, 1, 1, height - 2);
const QRect rightLineRect(width - 1, 1, 1, height - 2);
- const QColor separatorLineColor = active ? tabBarTabLineActive : tabBarTabLine;
+ const QColor separatorLineColor = active ? tabBarTabLineActive() : tabBarTabLine();
p->fillRect(leftLineRect, separatorLineColor);
p->fillRect(rightLineRect, separatorLineColor);
}
@@ -612,17 +641,20 @@ void drawTabBase(QPainter *p, const QStyleOptionTabBarBase *tbb, const QWidget *
// fill body
const QRect bodyRect(0, 1, width, height - 1);
- const QColor bodyColor = active ? tabBarTabBackgroundActive : tabBarTabBackground;
+ const QColor bodyColor = active ? tabBarTabBackgroundActive() : tabBarTabBackground();
p->fillRect(bodyRect, bodyColor);
// top line
const QRect topLineRect(0, 0, width, 1);
- const QColor topLineColor = active ? tabBarTabLineActive : tabBarTabLine;
+ const QColor topLineColor = active ? tabBarTabLineActive() : tabBarTabLine();
p->fillRect(topLineRect, topLineColor);
// bottom line
const QRect bottomLineRect(0, height - 1, width, 1);
- const QColor bottomLineColor = active ? tabBarTabLineActive : tabBarTabLine;
+ bool isDocument = false;
+ if (const QTabBar *tabBar = qobject_cast<const QTabBar*>(w))
+ isDocument = tabBar->documentMode();
+ const QColor bottomLineColor = isDocument && isDarkMode() ? QColor(Qt::black) : active ? tabBarTabLineActive() : tabBarTabLine();
p->fillRect(bottomLineRect, bottomLineColor);
}
#endif
@@ -1124,6 +1156,66 @@ static QStyleHelper::WidgetSizePolicy qt_aqua_guess_size(const QWidget *widg, QS
}
#endif
+static NSColor *qt_convertColorForContext(CGContextRef context, NSColor *color)
+{
+ Q_ASSERT(color);
+ Q_ASSERT(context);
+
+ CGColorSpaceRef targetCGColorSpace = CGBitmapContextGetColorSpace(context);
+ NSColorSpace *targetNSColorSpace = [[NSColorSpace alloc] initWithCGColorSpace:targetCGColorSpace];
+ NSColor *adjusted = [color colorUsingColorSpace:targetNSColorSpace];
+ [targetNSColorSpace release];
+
+ return adjusted;
+}
+
+static NSColor *qt_colorForContext(CGContextRef context, const CGFloat (&rgba)[4])
+{
+ Q_ASSERT(context);
+
+ auto colorSpace = CGBitmapContextGetColorSpace(context);
+ if (!colorSpace)
+ return nil;
+
+ return qt_convertColorForContext(context, [NSColor colorWithSRGBRed:rgba[0] green:rgba[1] blue:rgba[2] alpha:rgba[3]]);
+}
+
+static void qt_drawDisclosureButton(CGContextRef context, NSInteger state, bool selected, CGRect rect)
+{
+ Q_ASSERT(context);
+
+ static const CGFloat gray[] = {0.55, 0.55, 0.55, 0.97};
+ static const CGFloat white[] = {1.0, 1.0, 1.0, 0.9};
+
+ NSColor *fillColor = qt_colorForContext(context, selected ? white : gray);
+ [fillColor setFill];
+
+ if (state == NSOffState) {
+ static NSBezierPath *triangle = [[NSBezierPath alloc] init];
+ [triangle removeAllPoints];
+ // In off state, a disclosure button is an equilateral triangle
+ // ('pointing' to the right) with a bound rect that can be described
+ // as NSMakeRect(0, 0, 8, 9). Inside the 'rect' it's translated by
+ // (2, 4).
+ [triangle moveToPoint:NSMakePoint(rect.origin.x + 2, rect.origin.y + 4)];
+ [triangle lineToPoint:NSMakePoint(rect.origin.x + 2, rect.origin.y + 4 + 9)];
+ [triangle lineToPoint:NSMakePoint(rect.origin.x + 2 + 8, rect.origin.y + 4 + 4.5)];
+ [triangle closePath];
+ [triangle fill];
+ } else {
+ static NSBezierPath *openTriangle = [[NSBezierPath alloc] init];
+ [openTriangle removeAllPoints];
+ // In 'on' state, the button is an equilateral triangle (looking down)
+ // with the bounding rect NSMakeRect(0, 0, 9, 8). Inside the 'rect'
+ // it's translated by (1, 4).
+ [openTriangle moveToPoint:NSMakePoint(rect.origin.x + 1, rect.origin.y + 4 + 8)];
+ [openTriangle lineToPoint:NSMakePoint(rect.origin.x + 1 + 9, rect.origin.y + 4 + 8)];
+ [openTriangle lineToPoint:NSMakePoint(rect.origin.x + 1 + 4.5, rect.origin.y + 4)];
+ [openTriangle closePath];
+ [openTriangle fill];
+ }
+}
+
void QMacStylePrivate::drawFocusRing(QPainter *p, const QRectF &targetRect, int hMargin, int vMargin, const CocoaControl &cw) const
{
QPainterPath focusRingPath;
@@ -1227,11 +1319,17 @@ void QMacStylePrivate::drawFocusRing(QPainter *p, const QRectF &targetRect, int
Q_UNREACHABLE();
}
- const auto focusRingColor = qt_mac_toQColor(NSColor.keyboardFocusIndicatorColor.CGColor);
+ auto focusRingColor = qt_mac_toQColor(NSColor.keyboardFocusIndicatorColor.CGColor);
+ if (!qt_mac_applicationIsInDarkMode()) {
+ // This color already has alpha ~ 0.25, this value is too small - the ring is
+ // very pale and nothing like the native one. 0.39 makes it better (not ideal
+ // anyway). The color seems to be correct in dark more without any modification.
+ focusRingColor.setAlphaF(0.39);
+ }
p->save();
p->setRenderHint(QPainter::Antialiasing);
- p->setOpacity(0.5);
+
if (cw.type == SegmentedControl_First) {
// TODO Flip left-right
}
@@ -3203,8 +3301,15 @@ void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPai
CGContextScaleCTM(cg, 1, -1);
CGContextTranslateCTM(cg, -rect.origin.x, -rect.origin.y);
- [triangleCell drawBezelWithFrame:NSRectFromCGRect(rect) inView:[triangleCell controlView]];
-
+ if (QOperatingSystemVersion::current() >= QOperatingSystemVersion::MacOSMojave && !qt_mac_applicationIsInDarkMode()) {
+ // When the real system theme is one of the 'Dark' themes, and an application forces the 'Aqua' theme,
+ // under some conditions (see QTBUG-74515 for more details) NSButtonCell seems to select the 'Dark'
+ // code path and is becoming transparent, thus 'invisible' on the white background. To workaround this,
+ // we draw the disclose triangle manually:
+ qt_drawDisclosureButton(cg, triangleCell.state, (opt->state & State_Selected) && viewHasFocus, rect);
+ } else {
+ [triangleCell drawBezelWithFrame:NSRectFromCGRect(rect) inView:[triangleCell controlView]];
+ }
d->restoreNSGraphicsContext(cg);
break; }
@@ -3306,18 +3411,20 @@ void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPai
case PE_IndicatorTabClose: {
// Make close button visible only on the hovered tab.
QTabBar *tabBar = qobject_cast<QTabBar*>(w->parentWidget());
+ const QWidget *closeBtn = w;
if (!tabBar) {
// QStyleSheetStyle instead of CloseButton (which has
// a QTabBar as a parent widget) uses the QTabBar itself:
tabBar = qobject_cast<QTabBar *>(const_cast<QWidget*>(w));
+ closeBtn = decltype(closeBtn)(property("_q_styleSheetRealCloseButton").value<void *>());
}
if (tabBar) {
const bool documentMode = tabBar->documentMode();
const QTabBarPrivate *tabBarPrivate = static_cast<QTabBarPrivate *>(QObjectPrivate::get(tabBar));
const int hoveredTabIndex = tabBarPrivate->hoveredTabIndex();
if (!documentMode ||
- (hoveredTabIndex != -1 && ((w == tabBar->tabButton(hoveredTabIndex, QTabBar::LeftSide)) ||
- (w == tabBar->tabButton(hoveredTabIndex, QTabBar::RightSide))))) {
+ (hoveredTabIndex != -1 && ((closeBtn == tabBar->tabButton(hoveredTabIndex, QTabBar::LeftSide)) ||
+ (closeBtn == tabBar->tabButton(hoveredTabIndex, QTabBar::RightSide))))) {
const bool hover = (opt->state & State_MouseOver);
const bool selected = (opt->state & State_Selected);
const bool pressed = (opt->state & State_Sunken);
@@ -3536,7 +3643,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
if (tbstyle == Qt::ToolButtonTextOnly
|| (tbstyle != Qt::ToolButtonTextOnly && !down)) {
QPen pen = p->pen();
- QColor light = down ? Qt::black : Qt::white;
+ QColor light = down || isDarkMode() ? Qt::black : Qt::white;
light.setAlphaF(0.375f);
p->setPen(light);
p->drawText(cr.adjusted(0, 1, 0, 1), alignment, tb->text);
@@ -3958,6 +4065,11 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
if (!tabBar->tabTextColor(tabBar->currentIndex()).isValid())
myTab.palette.setColor(QPalette::WindowText, Qt::white);
+ if (myTab.documentMode && isDarkMode()) {
+ bool active = (myTab.state & State_Selected) && (myTab.state & State_Active);
+ myTab.palette.setColor(QPalette::WindowText, active ? Qt::white : Qt::gray);
+ }
+
int heightOffset = 0;
if (verticalTabs) {
heightOffset = -1;
@@ -4213,7 +4325,8 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
d->setupNSGraphicsContext(cgCtx, YES);
[s.toNSString() drawInRect:textRect
- withAttributes:@{ NSFontAttributeName:f, NSForegroundColorAttributeName:c }];
+ withAttributes:@{ NSFontAttributeName:f, NSForegroundColorAttributeName:c,
+ NSObliquenessAttributeName: [NSNumber numberWithDouble: myFont.italic() ? 0.3 : 0.0]}];
d->restoreNSGraphicsContext(cgCtx);
} else {
@@ -4444,16 +4557,17 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
p->fillRect(opt->rect, linearGrad);
p->save();
+ QRect toolbarRect = isDarkMode ? opt->rect.adjusted(0, 0, 0, 1) : opt->rect;
if (opt->state & State_Horizontal) {
p->setPen(isDarkMode ? darkModeSeparatorLine : mainWindowGradientBegin.lighter(114));
- p->drawLine(opt->rect.topLeft(), opt->rect.topRight());
+ p->drawLine(toolbarRect.topLeft(), toolbarRect.topRight());
p->setPen(isDarkMode ? darkModeSeparatorLine :mainWindowGradientEnd.darker(114));
- p->drawLine(opt->rect.bottomLeft(), opt->rect.bottomRight());
+ p->drawLine(toolbarRect.bottomLeft(), toolbarRect.bottomRight());
} else {
p->setPen(isDarkMode ? darkModeSeparatorLine : mainWindowGradientBegin.lighter(114));
- p->drawLine(opt->rect.topLeft(), opt->rect.bottomLeft());
+ p->drawLine(toolbarRect.topLeft(), toolbarRect.bottomLeft());
p->setPen(isDarkMode ? darkModeSeparatorLine : mainWindowGradientEnd.darker(114));
- p->drawLine(opt->rect.topRight(), opt->rect.bottomRight());
+ p->drawLine(toolbarRect.topRight(), toolbarRect.bottomRight());
}
p->restore();
diff --git a/src/sql/kernel/qsqlerror.cpp b/src/sql/kernel/qsqlerror.cpp
index 41ea497ad7..7a1a91948c 100644
--- a/src/sql/kernel/qsqlerror.cpp
+++ b/src/sql/kernel/qsqlerror.cpp
@@ -365,7 +365,7 @@ QString QSqlError::nativeErrorCode() const
QString QSqlError::text() const
{
QString result = d->databaseError;
- if (!d->databaseError.endsWith(QLatin1String("\n")))
+ if (!d->databaseError.isEmpty() && !d->driverError.isEmpty() && !d->databaseError.endsWith(QLatin1String("\n")))
result += QLatin1Char(' ');
result += d->driverError;
return result;
diff --git a/src/testlib/qappletestlogger.cpp b/src/testlib/qappletestlogger.cpp
index 959ff6cf64..dfeadebdef 100644
--- a/src/testlib/qappletestlogger.cpp
+++ b/src/testlib/qappletestlogger.cpp
@@ -83,56 +83,56 @@ void QAppleTestLogger::leaveTestFunction()
testFunctionActivity.leave();
}
-typedef QPair<QtMsgType, const char *> IncidentClassification;
-static IncidentClassification incidentTypeToClassification(QAbstractTestLogger::IncidentTypes type)
+struct MessageData
{
- switch (type) {
- case QAbstractTestLogger::Pass:
- return IncidentClassification(QtInfoMsg, "pass");
- case QAbstractTestLogger::XFail:
- return IncidentClassification(QtInfoMsg, "xfail");
- case QAbstractTestLogger::Fail:
- return IncidentClassification(QtCriticalMsg, "fail");
- case QAbstractTestLogger::XPass:
- return IncidentClassification(QtInfoMsg, "xpass");
- case QAbstractTestLogger::BlacklistedPass:
- return IncidentClassification(QtWarningMsg, "bpass");
- case QAbstractTestLogger::BlacklistedFail:
- return IncidentClassification(QtInfoMsg, "bfail");
- case QAbstractTestLogger::BlacklistedXPass:
- return IncidentClassification(QtWarningMsg, "bxpass");
- case QAbstractTestLogger::BlacklistedXFail:
- return IncidentClassification(QtInfoMsg, "bxfail");
+ QtMsgType messageType = QtFatalMsg;
+ const char *categorySuffix = nullptr;
+
+ void generateCategory(QTestCharBuffer *category)
+ {
+ if (categorySuffix)
+ QTest::qt_asprintf(category, "qt.test.%s", categorySuffix);
+ else
+ QTest::qt_asprintf(category, "qt.test");
}
- return IncidentClassification(QtFatalMsg, nullptr);
-}
+};
+
void QAppleTestLogger::addIncident(IncidentTypes type, const char *description,
const char *file, int line)
{
-
- IncidentClassification incidentClassification = incidentTypeToClassification(type);
+ MessageData messageData = [=]() {
+ switch (type) {
+ case QAbstractTestLogger::Pass:
+ return MessageData{QtInfoMsg, "pass"};
+ case QAbstractTestLogger::XFail:
+ return MessageData{QtInfoMsg, "xfail"};
+ case QAbstractTestLogger::Fail:
+ return MessageData{QtCriticalMsg, "fail"};
+ case QAbstractTestLogger::XPass:
+ return MessageData{QtInfoMsg, "xpass"};
+ case QAbstractTestLogger::BlacklistedPass:
+ return MessageData{QtWarningMsg, "bpass"};
+ case QAbstractTestLogger::BlacklistedFail:
+ return MessageData{QtInfoMsg, "bfail"};
+ case QAbstractTestLogger::BlacklistedXPass:
+ return MessageData{QtWarningMsg, "bxpass"};
+ case QAbstractTestLogger::BlacklistedXFail:
+ return MessageData{QtInfoMsg, "bxfail"};
+ }
+ Q_UNREACHABLE();
+ }();
QTestCharBuffer category;
- QTest::qt_asprintf(&category, "qt.test.%s", incidentClassification.second);
- QMessageLogContext context(file, line, /* function = */ nullptr, category.data());
+ messageData.generateCategory(&category);
- QTestCharBuffer subsystemBuffer;
- // It would be nice to have the data tag as part of the subsystem too, but that
- // will for some tests results in hundreds of thousands of log objects being
- // created, so we limit the subsystem to test functions, which we can hope
- // are reasonably limited.
- generateTestIdentifier(&subsystemBuffer, TestObject | TestFunction);
- QString subsystem = QString::fromLatin1(subsystemBuffer.data());
+ QMessageLogContext context(file, line, /* function = */ nullptr, category.data());
- // We still want the full identifier as part of the message though
- QTestCharBuffer testIdentifier;
- generateTestIdentifier(&testIdentifier);
- QString message = QString::fromLatin1(testIdentifier.data());
+ QString message = testIdentifier();
if (qstrlen(description))
message += QLatin1Char('\n') % QString::fromLatin1(description);
- AppleUnifiedLogger::messageHandler(incidentClassification.first, context, message, subsystem);
+ AppleUnifiedLogger::messageHandler(messageData.messageType, context, message, subsystem());
}
void QAppleTestLogger::addMessage(QtMsgType type, const QMessageLogContext &context, const QString &message)
@@ -140,6 +140,62 @@ void QAppleTestLogger::addMessage(QtMsgType type, const QMessageLogContext &cont
AppleUnifiedLogger::messageHandler(type, context, message);
}
+void QAppleTestLogger::addMessage(MessageTypes type, const QString &message, const char *file, int line)
+{
+ MessageData messageData = [=]() {
+ switch (type) {
+ case QAbstractTestLogger::Warn:
+ case QAbstractTestLogger::QWarning:
+ return MessageData{QtWarningMsg, nullptr};
+ case QAbstractTestLogger::QDebug:
+ return MessageData{QtDebugMsg, nullptr};
+ case QAbstractTestLogger::QSystem:
+ return MessageData{QtWarningMsg, "system"};
+ case QAbstractTestLogger::QFatal:
+ return MessageData{QtFatalMsg, nullptr};
+ case QAbstractTestLogger::Skip:
+ return MessageData{QtInfoMsg, "skip"};
+ case QAbstractTestLogger::Info:
+ case QAbstractTestLogger::QInfo:
+ return MessageData{QtInfoMsg, nullptr};
+ }
+ Q_UNREACHABLE();
+ }();
+
+ QTestCharBuffer category;
+ messageData.generateCategory(&category);
+
+ QMessageLogContext context(file, line, /* function = */ nullptr, category.data());
+ QString msg = message;
+
+ if (type == Skip) {
+ if (!message.isNull())
+ msg.prepend(testIdentifier() + QLatin1Char('\n'));
+ else
+ msg = testIdentifier();
+ }
+
+ AppleUnifiedLogger::messageHandler(messageData.messageType, context, msg, subsystem());
+}
+
+QString QAppleTestLogger::subsystem() const
+{
+ QTestCharBuffer buffer;
+ // It would be nice to have the data tag as part of the subsystem too, but that
+ // will for some tests result in hundreds of thousands of log objects being
+ // created, so we limit the subsystem to test functions, which we can hope
+ // are reasonably limited.
+ generateTestIdentifier(&buffer, TestObject | TestFunction);
+ return QString::fromLatin1(buffer.data());
+}
+
+QString QAppleTestLogger::testIdentifier() const
+{
+ QTestCharBuffer buffer;
+ generateTestIdentifier(&buffer);
+ return QString::fromLatin1(buffer.data());
+}
+
#endif // QT_USE_APPLE_UNIFIED_LOGGING
QT_END_NAMESPACE
diff --git a/src/testlib/qappletestlogger_p.h b/src/testlib/qappletestlogger_p.h
index 4217f4e6a2..62c6d95c5a 100644
--- a/src/testlib/qappletestlogger_p.h
+++ b/src/testlib/qappletestlogger_p.h
@@ -73,11 +73,14 @@ public:
void addMessage(QtMsgType, const QMessageLogContext &,
const QString &) override;
void addMessage(MessageTypes type, const QString &message,
- const char *file = 0, int line = 0) override
- { Q_UNUSED(type); Q_UNUSED(message); Q_UNUSED(file); Q_UNUSED(line); Q_UNREACHABLE(); }
+ const char *file = 0, int line = 0) override;
void addBenchmarkResult(const QBenchmarkResult &result) override
{ Q_UNUSED(result); }
+
+private:
+ QString subsystem() const;
+ QString testIdentifier() const;
};
#endif
diff --git a/src/testlib/qsignaldumper.cpp b/src/testlib/qsignaldumper.cpp
index b3360b4e6c..d0b6d0dd3f 100644
--- a/src/testlib/qsignaldumper.cpp
+++ b/src/testlib/qsignaldumper.cpp
@@ -87,7 +87,7 @@ static void qSignalDumperCallback(QObject *caller, int signal_index, void **argv
str += objname.toLocal8Bit();
if (!objname.isEmpty())
str += ' ';
- str += QByteArray::number(quintptr(caller), 16);
+ str += QByteArray::number(quintptr(caller), 16).rightJustified(8, '0');
str += ") ";
str += member.name();
@@ -105,7 +105,7 @@ static void qSignalDumperCallback(QObject *caller, int signal_index, void **argv
str += '@';
quintptr addr = quintptr(*reinterpret_cast<void **>(argv[i + 1]));
- str.append(QByteArray::number(addr, 16));
+ str.append(QByteArray::number(addr, 16).rightJustified(8, '0'));
} else if (typeId != QMetaType::UnknownType) {
Q_ASSERT(typeId != QMetaType::Void); // void parameter => metaobject is corrupt
str.append(arg)
@@ -144,7 +144,7 @@ static void qSignalDumperCallbackSlot(QObject *caller, int method_index, void **
str += objname.toLocal8Bit();
if (!objname.isEmpty())
str += ' ';
- str += QByteArray::number(quintptr(caller), 16);
+ str += QByteArray::number(quintptr(caller), 16).rightJustified(8, '0');
str += ") ";
str += member.methodSignature();
diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp
index d9f8dd7805..a202add2ae 100644
--- a/src/testlib/qtestcase.cpp
+++ b/src/testlib/qtestcase.cpp
@@ -1095,7 +1095,7 @@ bool TestMethods::invokeTest(int index, const char *data, WatchDog *watchDog) co
const int globalDataCount = gTable->dataCount();
int curGlobalDataIndex = 0;
- /* For each test function that has a *_data() table/function, do: */
+ /* For each entry in the global data table, do: */
do {
if (!gTable->isEmpty())
QTestResult::setCurrentGlobalTestData(gTable->testData(curGlobalDataIndex));
@@ -1103,50 +1103,50 @@ bool TestMethods::invokeTest(int index, const char *data, WatchDog *watchDog) co
if (curGlobalDataIndex == 0) {
qsnprintf(member, 512, "%s_data()", name.constData());
invokeMethod(QTest::currentTestObject, member);
+ if (QTestResult::skipCurrentTest())
+ break;
}
bool foundFunction = false;
- if (!QTestResult::skipCurrentTest()) {
- int curDataIndex = 0;
- const int dataCount = table.dataCount();
-
- // Data tag requested but none available?
- if (data && !dataCount) {
- // Let empty data tag through.
- if (!*data)
- data = 0;
- else {
- fprintf(stderr, "Unknown testdata for function %s(): '%s'\n", name.constData(), data);
- fprintf(stderr, "Function has no testdata.\n");
- return false;
- }
+ int curDataIndex = 0;
+ const int dataCount = table.dataCount();
+
+ // Data tag requested but none available?
+ if (data && !dataCount) {
+ // Let empty data tag through.
+ if (!*data)
+ data = 0;
+ else {
+ fprintf(stderr, "Unknown testdata for function %s(): '%s'\n", name.constData(), data);
+ fprintf(stderr, "Function has no testdata.\n");
+ return false;
}
+ }
- /* For each entry in the data table, do: */
- do {
- QTestResult::setSkipCurrentTest(false);
- QTestResult::setBlacklistCurrentTest(false);
- if (!data || !qstrcmp(data, table.testData(curDataIndex)->dataTag())) {
- foundFunction = true;
+ /* For each entry in this test's data table, do: */
+ do {
+ QTestResult::setSkipCurrentTest(false);
+ QTestResult::setBlacklistCurrentTest(false);
+ if (!data || !qstrcmp(data, table.testData(curDataIndex)->dataTag())) {
+ foundFunction = true;
- QTestPrivate::checkBlackLists(name.constData(), dataCount ? table.testData(curDataIndex)->dataTag() : 0);
+ QTestPrivate::checkBlackLists(name.constData(), dataCount ? table.testData(curDataIndex)->dataTag() : 0);
- QTestDataSetter s(curDataIndex >= dataCount ? static_cast<QTestData *>(0)
- : table.testData(curDataIndex));
+ QTestDataSetter s(curDataIndex >= dataCount ? static_cast<QTestData *>(0)
+ : table.testData(curDataIndex));
- QTestPrivate::qtestMouseButtons = Qt::NoButton;
- if (watchDog)
- watchDog->beginTest();
- invokeTestOnData(index);
- if (watchDog)
- watchDog->testFinished();
+ QTestPrivate::qtestMouseButtons = Qt::NoButton;
+ if (watchDog)
+ watchDog->beginTest();
+ invokeTestOnData(index);
+ if (watchDog)
+ watchDog->testFinished();
- if (data)
- break;
- }
- ++curDataIndex;
- } while (curDataIndex < dataCount);
- }
+ if (data)
+ break;
+ }
+ ++curDataIndex;
+ } while (curDataIndex < dataCount);
if (data && !foundFunction) {
fprintf(stderr, "Unknown testdata for function %s: '%s()'\n", name.constData(), data);
diff --git a/src/tools/androiddeployqt/main.cpp b/src/tools/androiddeployqt/main.cpp
index fd7f72eebf..3af5237f3d 100644
--- a/src/tools/androiddeployqt/main.cpp
+++ b/src/tools/androiddeployqt/main.cpp
@@ -900,7 +900,7 @@ bool readInputFile(Options *options)
options->extraPlugins = extraPlugins.toString().split(QLatin1Char(','));
}
- {
+ if (!options->auxMode) {
const QJsonValue stdcppPath = jsonObject.value(QStringLiteral("stdcpp-path"));
if (stdcppPath.isUndefined()) {
fprintf(stderr, "No stdcpp-path defined in json file.\n");
diff --git a/src/tools/uic/cpp/cppwriteincludes.h b/src/tools/uic/cpp/cppwriteincludes.h
index 7f03849798..e9247f4cc4 100644
--- a/src/tools/uic/cpp/cppwriteincludes.h
+++ b/src/tools/uic/cpp/cppwriteincludes.h
@@ -58,9 +58,9 @@ struct WriteIncludes : public TreeWalker
//
// actions
//
- void acceptActionGroup(DomActionGroup *node) Q_DECL_OVERRIDE;
- void acceptAction(DomAction *node) Q_DECL_OVERRIDE;
- void acceptActionRef(DomActionRef *node) Q_DECL_OVERRIDE;
+ void acceptActionGroup(DomActionGroup *node) override;
+ void acceptAction(DomAction *node) override;
+ void acceptActionRef(DomActionRef *node) override;
//
// custom widgets
diff --git a/src/tools/uic/cpp/cppwriteinitialization.cpp b/src/tools/uic/cpp/cppwriteinitialization.cpp
index 2fb3e502c5..881c48daea 100644
--- a/src/tools/uic/cpp/cppwriteinitialization.cpp
+++ b/src/tools/uic/cpp/cppwriteinitialization.cpp
@@ -1069,28 +1069,29 @@ void WriteInitialization::acceptActionRef(DomActionRef *node)
}
const QString varName = m_driver->findOrInsertWidget(m_widgetChain.top());
- const bool isSeparator = actionName == QLatin1String("separator");
- bool isMenu = false;
- if (const DomWidget *w = m_driver->widgetByName(actionName)) {
- isMenu = m_uic->isMenu(w->attributeClass());
- } else if (!(m_driver->actionByName(actionName) || isSeparator)) {
- fprintf(stderr, "%s: Warning: action `%s' not declared\n",
- qPrintable(m_option.messagePrefix()),
- actionName.toLatin1().data());
+ if (m_widgetChain.top() && actionName == QLatin1String("separator")) {
+ // separator is always reserved!
+ m_actionOut << m_indent << varName << "->addSeparator();\n";
return;
}
- if (m_widgetChain.top() && isSeparator) {
- // separator is always reserved!
- m_actionOut << m_indent << varName << "->addSeparator();\n";
+ const DomWidget *domWidget = m_driver->widgetByName(actionName);
+ if (domWidget && m_uic->isMenu(domWidget->attributeClass())) {
+ m_actionOut << m_indent << varName << "->addAction("
+ << m_driver->findOrInsertWidget(domWidget) << "->menuAction());\n";
return;
}
- if (isMenu)
- actionName += QLatin1String("->menuAction()");
+ const DomAction *domAction = m_driver->actionByName(actionName);
+ if (!domAction) {
+ fprintf(stderr, "%s: Warning: action `%s' not declared\n",
+ qPrintable(m_option.messagePrefix()), qPrintable(actionName));
+ return;
+ }
- m_actionOut << m_indent << varName << "->addAction(" << actionName << ");\n";
+ m_actionOut << m_indent << varName << "->addAction("
+ << m_driver->findOrInsertAction(domAction) << ");\n";
}
QString WriteInitialization::writeStringListProperty(const DomStringList *list) const
@@ -2430,13 +2431,11 @@ QTextStream &WriteInitialization::autoTrOutput(const DomString *str, const QStri
QString WriteInitialization::findDeclaration(const QString &name)
{
- const QString normalized = Driver::normalizedName(name);
-
- if (const DomWidget *widget = m_driver->widgetByName(normalized))
+ if (const DomWidget *widget = m_driver->widgetByName(name))
return m_driver->findOrInsertWidget(widget);
- if (const DomAction *action = m_driver->actionByName(normalized))
+ if (const DomAction *action = m_driver->actionByName(name))
return m_driver->findOrInsertAction(action);
- if (const DomButtonGroup *group = m_driver->findButtonGroup(normalized))
+ if (const DomButtonGroup *group = m_driver->findButtonGroup(name))
return m_driver->findOrInsertButtonGroup(group);
return QString();
}
diff --git a/src/tools/uic/driver.cpp b/src/tools/uic/driver.cpp
index 03fa1e17cf..7d690cd2fe 100644
--- a/src/tools/uic/driver.cpp
+++ b/src/tools/uic/driver.cpp
@@ -51,6 +51,17 @@ static inline QString actionClass() { return QStringLiteral("QAction"); }
static inline QString buttonGroupClass() { return QStringLiteral("QButtonGroup"); }
template <class DomClass>
+const DomClass *Driver::findByAttributeName(const DomObjectHash<DomClass> &domHash,
+ const QString &name) const
+{
+ for (auto it = domHash.cbegin(), end = domHash.cend(); it != end; ++it) {
+ if (it.key()->attributeName() == name)
+ return it.key();
+ }
+ return nullptr;
+}
+
+template <class DomClass>
QString Driver::findOrInsert(DomObjectHash<DomClass> *domHash, const DomClass *dom,
const QString &className)
{
@@ -111,11 +122,7 @@ QString Driver::findOrInsertButtonGroup(const DomButtonGroup *ui_group)
// Find a group by its non-uniqified name
const DomButtonGroup *Driver::findButtonGroup(const QString &attributeName) const
{
- for (auto it = m_buttonGroups.cbegin(), end = m_buttonGroups.cend(); it != end; ++it) {
- if (it.key()->attributeName() == attributeName)
- return it.key();
- }
- return nullptr;
+ return findByAttributeName(m_buttonGroups, attributeName);
}
@@ -288,17 +295,17 @@ bool Driver::uic(const QString &fileName, QTextStream *out)
const DomWidget *Driver::widgetByName(const QString &name) const
{
- return m_widgets.key(name);
+ return findByAttributeName(m_widgets, name);
}
const DomActionGroup *Driver::actionGroupByName(const QString &name) const
{
- return m_actionGroups.key(name);
+ return findByAttributeName(m_actionGroups, name);
}
const DomAction *Driver::actionByName(const QString &name) const
{
- return m_actions.key(name);
+ return findByAttributeName(m_actions, name);
}
QT_END_NAMESPACE
diff --git a/src/tools/uic/driver.h b/src/tools/uic/driver.h
index 69206e1608..1e50f78746 100644
--- a/src/tools/uic/driver.h
+++ b/src/tools/uic/driver.h
@@ -95,6 +95,9 @@ private:
template <class DomClass> using DomObjectHash = QHash<const DomClass *, QString>;
template <class DomClass>
+ const DomClass *findByAttributeName(const DomObjectHash<DomClass> &domHash,
+ const QString &name) const;
+ template <class DomClass>
QString findOrInsert(DomObjectHash<DomClass> *domHash, const DomClass *dom, const QString &className);
Option m_option;
diff --git a/src/widgets/dialogs/qdialog.h b/src/widgets/dialogs/qdialog.h
index ce57ce5de7..ce2194a1de 100644
--- a/src/widgets/dialogs/qdialog.h
+++ b/src/widgets/dialogs/qdialog.h
@@ -70,10 +70,10 @@ public:
void setVisible(bool visible) override;
#if QT_DEPRECATED_SINCE(5, 13)
- QT_DEPRECATED void setOrientation(Qt::Orientation orientation);
- QT_DEPRECATED Qt::Orientation orientation() const;
- QT_DEPRECATED void setExtension(QWidget* extension);
- QT_DEPRECATED QWidget* extension() const;
+ QT_DEPRECATED_X("Use show/hide on the affected widget instead") void setOrientation(Qt::Orientation orientation);
+ QT_DEPRECATED_X("Use show/hide on the affected widget instead") Qt::Orientation orientation() const;
+ QT_DEPRECATED_X("Use show/hide on the affected widget instead") void setExtension(QWidget* extension);
+ QT_DEPRECATED_X("Use show/hide on the affected widget instead") QWidget* extension() const;
#endif
QSize sizeHint() const override;
@@ -98,7 +98,7 @@ public Q_SLOTS:
virtual void reject();
#if QT_DEPRECATED_SINCE(5, 13)
- QT_DEPRECATED void showExtension(bool);
+ QT_DEPRECATED_X("Use show/hide on the affected widget instead") void showExtension(bool);
#endif
protected:
diff --git a/src/widgets/doc/src/widgets-and-layouts/styles.qdoc b/src/widgets/doc/src/widgets-and-layouts/styles.qdoc
index a9d95bc02c..645da5bca2 100644
--- a/src/widgets/doc/src/widgets-and-layouts/styles.qdoc
+++ b/src/widgets/doc/src/widgets-and-layouts/styles.qdoc
@@ -286,7 +286,7 @@
QStyleOption to a subclass (e.g., QStyleOptionFocusRect). For
safety, you can use qstyleoption_cast() to ensure that the
pointer type is correct. If the object isn't of the right type,
- qstyleoption_cast() returns 0. For example:
+ qstyleoption_cast() returns \nullptr. For example:
\snippet code/doc_src_qt4-styles.cpp 0
diff --git a/src/widgets/itemviews/qlistwidget.h b/src/widgets/itemviews/qlistwidget.h
index c093d13e6d..c102b144df 100644
--- a/src/widgets/itemviews/qlistwidget.h
+++ b/src/widgets/itemviews/qlistwidget.h
@@ -118,10 +118,11 @@ public:
QT_DEPRECATED_X ("Use QListWidgetItem::background() instead")
inline QColor backgroundColor() const
{ return qvariant_cast<QColor>(data(Qt::BackgroundRole)); }
+#endif
+ // no QT_DEPRECATED_SINCE because it is a virtual function
QT_DEPRECATED_X ("Use QListWidgetItem::setBackground() instead")
virtual void setBackgroundColor(const QColor &color)
{ setData(Qt::BackgroundRole, color); }
-#endif
inline QBrush background() const
{ return qvariant_cast<QBrush>(data(Qt::BackgroundRole)); }
diff --git a/src/widgets/itemviews/qtablewidget.cpp b/src/widgets/itemviews/qtablewidget.cpp
index f99d69d37c..ec4897a7ae 100644
--- a/src/widgets/itemviews/qtablewidget.cpp
+++ b/src/widgets/itemviews/qtablewidget.cpp
@@ -1860,7 +1860,7 @@ void QTableWidgetPrivate::_q_dataChanged(const QModelIndex &topLeft,
\fn QTableWidgetItem *QTableWidget::itemAt(int ax, int ay) const
Returns the item at the position equivalent to QPoint(\a{ax}, \a{ay}) in
- the table widget's coordinate system, or returns 0 if the specified point
+ the table widget's coordinate system, or returns \nullptr if the specified point
is not covered by an item in the table widget.
\sa item()
diff --git a/src/widgets/kernel/mac.pri b/src/widgets/kernel/mac.pri
index f7e7aa869a..d21e5d4a74 100644
--- a/src/widgets/kernel/mac.pri
+++ b/src/widgets/kernel/mac.pri
@@ -1,4 +1 @@
-macos {
- LIBS_PRIVATE += -framework AppKit -lz
- *-mwerks:INCLUDEPATH += compat
-}
+macos: LIBS_PRIVATE += -framework AppKit -lz
diff --git a/src/widgets/kernel/qgesturemanager.cpp b/src/widgets/kernel/qgesturemanager.cpp
index 57d6994c88..cd27c9c5be 100644
--- a/src/widgets/kernel/qgesturemanager.cpp
+++ b/src/widgets/kernel/qgesturemanager.cpp
@@ -143,11 +143,6 @@ Qt::GestureType QGestureManager::registerGestureRecognizer(QGestureRecognizer *r
void QGestureManager::unregisterGestureRecognizer(Qt::GestureType type)
{
QList<QGestureRecognizer *> list = m_recognizers.values(type);
- while (QGestureRecognizer *recognizer = m_recognizers.take(type)) {
- // ensuring an entry exists causes the recognizer to be deleted on destruction of the manager
- auto &gestures = m_obsoleteGestures[recognizer];
- Q_UNUSED(gestures);
- }
foreach (QGesture *g, m_gestureToRecognizer.keys()) {
QGestureRecognizer *recognizer = m_gestureToRecognizer.value(g);
if (list.contains(recognizer)) {
diff --git a/src/widgets/kernel/qgesturerecognizer.cpp b/src/widgets/kernel/qgesturerecognizer.cpp
index 65c46a5e56..75d091ce4e 100644
--- a/src/widgets/kernel/qgesturerecognizer.cpp
+++ b/src/widgets/kernel/qgesturerecognizer.cpp
@@ -41,6 +41,7 @@
#include "private/qgesture_p.h"
#include "private/qgesturemanager_p.h"
+#include "private/qapplication_p.h"
#ifndef QT_NO_GESTURES
@@ -231,6 +232,11 @@ Qt::GestureType QGestureRecognizer::registerRecognizer(QGestureRecognizer *recog
*/
void QGestureRecognizer::unregisterRecognizer(Qt::GestureType type)
{
+ auto qAppPriv = QApplicationPrivate::instance();
+ if (!qAppPriv)
+ return;
+ if (!qAppPriv->gestureManager)
+ return;
QGestureManager::instance()->unregisterGestureRecognizer(type);
}
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index 90a23f7cd4..74b18d9991 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -1538,14 +1538,19 @@ void QWidgetPrivate::createTLSysExtra()
extra->topextra->window->setMaximumSize(QSize(extra->maxw, extra->maxh));
if (extra->topextra->opacity != 255 && q->isWindow())
extra->topextra->window->setOpacity(qreal(extra->topextra->opacity) / qreal(255));
+
+ const bool isTipLabel = q->inherits("QTipLabel");
+ const bool isAlphaWidget = !isTipLabel && q->inherits("QAlphaWidget");
#ifdef Q_OS_WIN
// Pass on native parent handle for Widget embedded into Active X.
const QVariant activeXNativeParentHandle = q->property(activeXNativeParentHandleProperty);
if (activeXNativeParentHandle.isValid())
extra->topextra->window->setProperty(activeXNativeParentHandleProperty, activeXNativeParentHandle);
- if (q->inherits("QTipLabel") || q->inherits("QAlphaWidget"))
+ if (isTipLabel || isAlphaWidget)
extra->topextra->window->setProperty("_q_windowsDropShadow", QVariant(true));
#endif
+ if (isTipLabel || isAlphaWidget || q->inherits("QRollEffect"))
+ qt_window_private(extra->topextra->window)->setAutomaticPositionAndResizeEnabled(false);
}
}
diff --git a/src/widgets/kernel/qwidgetwindow.cpp b/src/widgets/kernel/qwidgetwindow.cpp
index c6f22aa21a..f44f63d71b 100644
--- a/src/widgets/kernel/qwidgetwindow.cpp
+++ b/src/widgets/kernel/qwidgetwindow.cpp
@@ -106,6 +106,7 @@ public:
if (QWidget *widget = q->widget())
QWidgetPrivate::get(widget)->updateContentsRect();
}
+ bool allowClickThrough(const QPoint &) const override;
};
QRectF QWidgetWindowPrivate::closestAcceptableGeometry(const QRectF &rect) const
@@ -221,6 +222,12 @@ static inline bool shouldBePropagatedToWidget(QEvent *event)
}
}
+bool QWidgetWindowPrivate::allowClickThrough(const QPoint &globalPos) const
+{
+ QWidget *w = QApplication::widgetAt(globalPos);
+ return w && !w->testAttribute(Qt::WA_MacNoClickThrough);
+}
+
bool QWidgetWindow::event(QEvent *event)
{
if (!m_widget)
diff --git a/src/widgets/styles/qstyle.cpp b/src/widgets/styles/qstyle.cpp
index ac4fb7fbd1..97ec1d3f19 100644
--- a/src/widgets/styles/qstyle.cpp
+++ b/src/widgets/styles/qstyle.cpp
@@ -1971,8 +1971,8 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment,
\value SH_Widget_Animate Deprecated. Use \l{SH_Widget_Animation_Duration} instead.
- \value SH_Splitter_OpaqueResize Determines if resizing is opaque
- This enum value has been introduced in Qt 5.2
+ \value SH_Splitter_OpaqueResize Determines if widgets are resized dynamically (opaquely) while
+ interactively moving the splitter. This enum value was introduced in Qt 5.2.
\value SH_TabBar_ChangeCurrentDelay Determines the delay before the current
tab is changed while dragging over the tabbar, in milliseconds. This
diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp
index 25d3755e12..f5a3724100 100644
--- a/src/widgets/styles/qstylesheetstyle.cpp
+++ b/src/widgets/styles/qstylesheetstyle.cpp
@@ -4598,8 +4598,12 @@ void QStyleSheetStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *op
break;
#if QT_CONFIG(tabbar)
case PE_IndicatorTabClose:
- if (w)
+ if (w) {
+ // QMacStyle needs a real widget, not its parent - to implement
+ // 'document mode' properly, drawing nothing if a tab is not hovered.
+ baseStyle()->setProperty("_q_styleSheetRealCloseButton", QVariant::fromValue((void *)w));
w = w->parentWidget(); //match on the QTabBar instead of the CloseButton
+ }
pseudoElement = PseudoElement_TabBarTabCloseButton;
#endif
@@ -4617,6 +4621,9 @@ void QStyleSheetStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *op
} else {
baseStyle()->drawPrimitive(pe, opt, p, w);
}
+
+ if (baseStyle()->property("_q_styleSheetRealCloseButton").toBool())
+ baseStyle()->setProperty("_q_styleSheetRealCloseButton", QVariant(QVariant::Invalid));
}
QPixmap QStyleSheetStyle::generatedIconPixmap(QIcon::Mode iconMode, const QPixmap& pixmap,
diff --git a/src/widgets/widgets/qabstractspinbox.cpp b/src/widgets/widgets/qabstractspinbox.cpp
index 54caa26fb6..c617525c45 100644
--- a/src/widgets/widgets/qabstractspinbox.cpp
+++ b/src/widgets/widgets/qabstractspinbox.cpp
@@ -2030,8 +2030,8 @@ QVariant operator+(const QVariant &arg1, const QVariant &arg2)
#if QT_CONFIG(datetimeparser)
case QVariant::DateTime: {
QDateTime a2 = arg2.toDateTime();
- QDateTime a1 = arg1.toDateTime().addDays(QDATETIMEEDIT_DATETIME_MIN.daysTo(a2));
- a1.setTime(a1.time().addMSecs(QTime().msecsTo(a2.time())));
+ QDateTime a1 = arg1.toDateTime().addDays(QDATETIMEEDIT_DATE_MIN.daysTo(a2.date()));
+ a1.setTime(a1.time().addMSecs(a2.time().msecsSinceStartOfDay()));
ret = QVariant(a1);
break;
}
@@ -2093,11 +2093,11 @@ QVariant operator*(const QVariant &arg1, double multiplier)
#if QT_CONFIG(datetimeparser)
case QVariant::DateTime: {
double days = QDATETIMEEDIT_DATE_MIN.daysTo(arg1.toDateTime().date()) * multiplier;
- int daysInt = (int)days;
+ const qint64 daysInt = qint64(days);
days -= daysInt;
- long msecs = (long)((QDATETIMEEDIT_TIME_MIN.msecsTo(arg1.toDateTime().time()) * multiplier)
- + (days * (24 * 3600 * 1000)));
- ret = QDateTime(QDate().addDays(int(days)), QTime().addMSecs(msecs));
+ qint64 msecs = qint64(arg1.toDateTime().time().msecsSinceStartOfDay() * multiplier
+ + days * (24 * 3600 * 1000));
+ ret = QDateTime(QDATETIMEEDIT_DATE_MIN.addDays(daysInt), QTime::fromMSecsSinceStartOfDay(msecs));
break;
}
#endif // datetimeparser
@@ -2127,8 +2127,8 @@ double operator/(const QVariant &arg1, const QVariant &arg2)
case QVariant::DateTime:
a1 = QDATETIMEEDIT_DATE_MIN.daysTo(arg1.toDate());
a2 = QDATETIMEEDIT_DATE_MIN.daysTo(arg2.toDate());
- a1 += (double)QDATETIMEEDIT_TIME_MIN.msecsTo(arg1.toDateTime().time()) / (long)(3600 * 24 * 1000);
- a2 += (double)QDATETIMEEDIT_TIME_MIN.msecsTo(arg2.toDateTime().time()) / (long)(3600 * 24 * 1000);
+ a1 += arg1.toDateTime().time().msecsSinceStartOfDay() / (36e5 * 24);
+ a2 += arg2.toDateTime().time().msecsSinceStartOfDay() / (36e5 * 24);
break;
#endif // datetimeparser
default: break;
diff --git a/src/widgets/widgets/qdockwidget.cpp b/src/widgets/widgets/qdockwidget.cpp
index ba8bd90da6..4041c730b8 100644
--- a/src/widgets/widgets/qdockwidget.cpp
+++ b/src/widgets/widgets/qdockwidget.cpp
@@ -67,18 +67,21 @@ extern QString qt_setWindowTitle_helperHelper(const QString&, const QWidget*); /
// qmainwindow.cpp
extern QMainWindowLayout *qt_mainwindow_layout(const QMainWindow *window);
-static inline QMainWindowLayout *qt_mainwindow_layout_from_dock(const QDockWidget *dock)
+static const QMainWindow *mainwindow_from_dock(const QDockWidget *dock)
{
- const QWidget *p = dock->parentWidget();
- while (p) {
- const QMainWindow *window = qobject_cast<const QMainWindow*>(p);
- if (window)
- return qt_mainwindow_layout(window);
- p = p->parentWidget();
+ for (const QWidget *p = dock->parentWidget(); p; p = p->parentWidget()) {
+ if (const QMainWindow *window = qobject_cast<const QMainWindow*>(p))
+ return window;
}
return nullptr;
}
+static inline QMainWindowLayout *qt_mainwindow_layout_from_dock(const QDockWidget *dock)
+{
+ auto mainWindow = mainwindow_from_dock(dock);
+ return mainWindow ? qt_mainwindow_layout(mainWindow) : nullptr;
+}
+
static inline bool hasFeature(const QDockWidgetPrivate *priv, QDockWidget::DockWidgetFeature feature)
{ return (priv->features & feature) == feature; }
@@ -839,8 +842,9 @@ void QDockWidgetPrivate::endDrag(bool abort)
q->releaseMouse();
if (state->dragging) {
- QMainWindowLayout *mwLayout = qt_mainwindow_layout_from_dock(q);
- Q_ASSERT(mwLayout != 0);
+ const QMainWindow *mainWindow = mainwindow_from_dock(q);
+ Q_ASSERT(mainWindow != nullptr);
+ QMainWindowLayout *mwLayout = qt_mainwindow_layout(mainWindow);
if (abort || !mwLayout->plug(state->widgetItem)) {
if (hasFeature(this, QDockWidget::DockWidgetFloatable)) {
@@ -861,8 +865,12 @@ void QDockWidgetPrivate::endDrag(bool abort)
} else {
setResizerActive(false);
}
- if (q->isFloating()) // Might not be floating when dragging a QDockWidgetGroupWindow
+ if (q->isFloating()) { // Might not be floating when dragging a QDockWidgetGroupWindow
undockedGeometry = q->geometry();
+#if QT_CONFIG(tabwidget)
+ tabPosition = mwLayout->tabPosition(mainWindow->dockWidgetArea(q));
+#endif
+ }
q->activateWindow();
} else {
// The tab was not plugged back in the QMainWindow but the QDockWidget cannot
diff --git a/src/widgets/widgets/qdockwidget_p.h b/src/widgets/widgets/qdockwidget_p.h
index 2543f10f97..bc6ac86c45 100644
--- a/src/widgets/widgets/qdockwidget_p.h
+++ b/src/widgets/widgets/qdockwidget_p.h
@@ -57,6 +57,10 @@
#include "QtWidgets/qboxlayout.h"
#include "QtWidgets/qdockwidget.h"
+#if QT_CONFIG(tabwidget)
+# include "QtWidgets/qtabwidget.h"
+#endif
+
QT_REQUIRE_CONFIG(dockwidget);
QT_BEGIN_NAMESPACE
@@ -81,28 +85,26 @@ class QDockWidgetPrivate : public QWidgetPrivate
};
public:
- inline QDockWidgetPrivate()
- : QWidgetPrivate(), state(nullptr),
- features(QDockWidget::DockWidgetClosable
- | QDockWidget::DockWidgetMovable
- | QDockWidget::DockWidgetFloatable),
- allowedAreas(Qt::AllDockWidgetAreas), resizer(nullptr)
- { }
-
void init();
void _q_toggleView(bool); // private slot
void _q_toggleTopLevel(); // private slot
void updateButtons();
- DragState *state;
- QDockWidget::DockWidgetFeatures features;
- Qt::DockWidgetAreas allowedAreas;
+#if QT_CONFIG(tabwidget)
+ QTabWidget::TabPosition tabPosition = QTabWidget::North;
+#endif
+
+ DragState *state = nullptr;
+
+ QDockWidget::DockWidgetFeatures features = QDockWidget::DockWidgetClosable
+ | QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetFloatable;
+ Qt::DockWidgetAreas allowedAreas = Qt::AllDockWidgetAreas;
QFont font;
#ifndef QT_NO_ACTION
- QAction *toggleViewAction;
+ QAction *toggleViewAction = nullptr;
#endif
// QMainWindow *findMainWindow(QWidget *widget) const;
@@ -129,7 +131,7 @@ public:
bool isAnimating() const;
private:
- QWidgetResizeHandler *resizer;
+ QWidgetResizeHandler *resizer = nullptr;
};
class Q_WIDGETS_EXPORT QDockWidgetLayout : public QLayout
diff --git a/src/widgets/widgets/qmainwindowlayout.cpp b/src/widgets/widgets/qmainwindowlayout.cpp
index ed054c7e9a..f54835f23b 100644
--- a/src/widgets/widgets/qmainwindowlayout.cpp
+++ b/src/widgets/widgets/qmainwindowlayout.cpp
@@ -2525,6 +2525,30 @@ void QMainWindowLayout::updateGapIndicator()
#endif // QT_CONFIG(rubberband)
}
+static QTabBar::Shape tabwidgetPositionToTabBarShape(QWidget *w)
+{
+ QTabBar::Shape result = QTabBar::RoundedSouth;
+#if QT_CONFIG(tabwidget)
+ if (qobject_cast<QDockWidget *>(w)) {
+ switch (static_cast<QDockWidgetPrivate *>(qt_widget_private(w))->tabPosition) {
+ case QTabWidget::North:
+ result = QTabBar::RoundedNorth;
+ break;
+ case QTabWidget::South:
+ result = QTabBar::RoundedSouth;
+ break;
+ case QTabWidget::West:
+ result = QTabBar::RoundedWest;
+ break;
+ case QTabWidget::East:
+ result = QTabBar::RoundedEast;
+ break;
+ }
+ }
+#endif // tabwidget
+ return result;
+}
+
void QMainWindowLayout::hover(QLayoutItem *widgetItem, const QPoint &mousePos)
{
if (!parentWidget()->isVisible() || parentWidget()->isMinimized()
@@ -2573,8 +2597,9 @@ void QMainWindowLayout::hover(QLayoutItem *widgetItem, const QPoint &mousePos)
QDockWidgetGroupWindow *floatingTabs = createTabbedDockWindow(); // FIXME
floatingTabs->setGeometry(dropTo->geometry());
QDockAreaLayoutInfo *info = floatingTabs->layoutInfo();
+ const QTabBar::Shape shape = tabwidgetPositionToTabBarShape(dropTo);
*info = QDockAreaLayoutInfo(&layoutState.dockAreaLayout.sep, QInternal::LeftDock,
- Qt::Horizontal, QTabBar::RoundedSouth,
+ Qt::Horizontal, shape,
static_cast<QMainWindow *>(parentWidget()));
info->tabbed = true;
QLayout *parentLayout = dropTo->parentWidget()->layout();
diff --git a/src/widgets/widgets/qspinbox.cpp b/src/widgets/widgets/qspinbox.cpp
index 40044223e2..97a3a12336 100644
--- a/src/widgets/widgets/qspinbox.cpp
+++ b/src/widgets/widgets/qspinbox.cpp
@@ -751,6 +751,10 @@ void QDoubleSpinBox::setPrefix(const QString &prefix)
d->prefix = prefix;
d->updateEdit();
+
+ d->cachedSizeHint = QSize();
+ d->cachedMinimumSizeHint = QSize(); // minimumSizeHint cares about the prefix
+ updateGeometry();
}
/*!
diff --git a/src/widgets/widgets/qsplashscreen.cpp b/src/widgets/widgets/qsplashscreen.cpp
index 4af4f90119..bf6bf1c7c9 100644
--- a/src/widgets/widgets/qsplashscreen.cpp
+++ b/src/widgets/widgets/qsplashscreen.cpp
@@ -289,8 +289,7 @@ void QSplashScreen::setPixmap(const QPixmap &pixmap)
// 1) If a QDesktopScreenWidget is found in the parent hierarchy, use that (see docs on
// QSplashScreen(QWidget *, QPixmap).
// 2) If a widget with associated QWindow is found, use that
-// 3) When nothing can be found, do not position the widget, allowing for
-// QPlatformWindow::initialGeometry() to center it over the cursor
+// 3) When nothing can be found, try to center it over the cursor
static inline int screenNumberOf(const QDesktopScreenWidget *dsw)
{
@@ -307,7 +306,15 @@ const QScreen *QSplashScreenPrivate::screenFor(const QWidget *w)
if (QWindow *window = p->windowHandle())
return window->screen();
}
- return nullptr;
+#if QT_CONFIG(cursor)
+ // Note: We could rely on QPlatformWindow::initialGeometry() to center it
+ // over the cursor, but not all platforms (namely Android) use that.
+ if (QGuiApplication::screens().size() > 1) {
+ if (auto screenAtCursor = QGuiApplication::screenAt(QCursor::pos()))
+ return screenAtCursor;
+ }
+#endif // cursor
+ return QGuiApplication::primaryScreen();
}
void QSplashScreenPrivate::setPixmap(const QPixmap &p, const QScreen *screen)
diff --git a/src/widgets/widgets/qsplitter.cpp b/src/widgets/widgets/qsplitter.cpp
index 98bb23caad..de838a8f93 100644
--- a/src/widgets/widgets/qsplitter.cpp
+++ b/src/widgets/widgets/qsplitter.cpp
@@ -161,11 +161,10 @@ Qt::Orientation QSplitterHandle::orientation() const
/*!
- Returns \c true if widgets are resized dynamically (opaquely), otherwise
- returns \c false. This value is controlled by the QSplitter.
+ Returns \c true if widgets are resized dynamically (opaquely) while interactively moving the
+ splitter. Otherwise returns \c false. This value is controlled by the QSplitter.
\sa QSplitter::opaqueResize()
-
*/
bool QSplitterHandle::opaqueResize() const
{
@@ -1483,7 +1482,8 @@ int QSplitter::closestLegalPosition(int pos, int index)
/*!
\property QSplitter::opaqueResize
- \brief whether resizing is opaque
+ Returns \c true if widgets are resized dynamically (opaquely) while interactively moving the
+ splitter. Otherwise returns \c false.
The default resize behavior is style dependent (determined by the
SH_Splitter_OpaqueResize style hint). However, you can override it
diff --git a/tests/auto/corelib/global/qnumeric/tst_qnumeric.cpp b/tests/auto/corelib/global/qnumeric/tst_qnumeric.cpp
index e567e465f7..0a84b1fdd8 100644
--- a/tests/auto/corelib/global/qnumeric/tst_qnumeric.cpp
+++ b/tests/auto/corelib/global/qnumeric/tst_qnumeric.cpp
@@ -508,13 +508,13 @@ template <typename Int> static void mulOverflow_template()
QCOMPARE(mul_overflow(Int(max / 2), Int(3), &r), true);
QCOMPARE(mul_overflow(mid1, Int(mid2 + 1), &r), true);
QCOMPARE(mul_overflow(Int(max / 2 + 2), Int(2), &r), true);
+ QCOMPARE(mul_overflow(Int(max - max / 2), Int(2), &r), true);
QCOMPARE(mul_overflow(Int(1ULL << (std::numeric_limits<Int>::digits - 1)), Int(2), &r), true);
if (min) {
QCOMPARE(mul_overflow(min, Int(2), &r), true);
QCOMPARE(mul_overflow(Int(min / 2), Int(3), &r), true);
QCOMPARE(mul_overflow(Int(min / 2 - 1), Int(2), &r), true);
- QCOMPARE(mul_overflow(Int(min + min/2), Int(2), &r), true);
}
#endif
}
diff --git a/tests/auto/corelib/itemmodels/qidentityproxymodel/tst_qidentityproxymodel.cpp b/tests/auto/corelib/itemmodels/qidentityproxymodel/tst_qidentityproxymodel.cpp
index 262c6dd9c8..c76052a38b 100644
--- a/tests/auto/corelib/itemmodels/qidentityproxymodel/tst_qidentityproxymodel.cpp
+++ b/tests/auto/corelib/itemmodels/qidentityproxymodel/tst_qidentityproxymodel.cpp
@@ -32,10 +32,13 @@
#include <QStandardItemModel>
#include <QStringListModel>
#include <QTest>
+#include <QLoggingCategory>
#include "dynamictreemodel.h"
#include "qidentityproxymodel.h"
+Q_LOGGING_CATEGORY(lcItemModels, "qt.corelib.tests.itemmodels")
+
class DataChangedModel : public QAbstractListModel
{
public:
@@ -390,7 +393,7 @@ void dump(QAbstractItemModel* model, QString const& indent = " - ", QModelIndex
for (auto row = 0; row < model->rowCount(parent); ++row)
{
auto idx = model->index(row, 0, parent);
- qDebug() << (indent + idx.data().toString());
+ qCDebug(lcItemModels) << (indent + idx.data().toString());
dump(model, indent + "- ", idx);
}
}
diff --git a/tests/auto/corelib/itemmodels/qitemmodel/tst_qitemmodel.cpp b/tests/auto/corelib/itemmodels/qitemmodel/tst_qitemmodel.cpp
index da13b9f33f..b9deb7b6a9 100644
--- a/tests/auto/corelib/itemmodels/qitemmodel/tst_qitemmodel.cpp
+++ b/tests/auto/corelib/itemmodels/qitemmodel/tst_qitemmodel.cpp
@@ -125,6 +125,7 @@ private:
tst_QItemModel::tst_QItemModel()
{
qRegisterMetaType<QAbstractItemModel::LayoutChangeHint>();
+ qRegisterMetaType<QList<QPersistentModelIndex>>();
}
void tst_QItemModel::init()
@@ -181,7 +182,7 @@ void tst_QItemModel::nonDestructiveBasicTest()
currentModel->hasChildren(QModelIndex());
currentModel->hasIndex(0, 0);
currentModel->headerData(0, Qt::Horizontal);
- currentModel->index(0,0), QModelIndex();
+ currentModel->index(0,0);
currentModel->itemData(QModelIndex());
QVariant cache;
currentModel->match(QModelIndex(), -1, cache);
diff --git a/tests/auto/corelib/itemmodels/qsortfilterproxymodel_common/tst_qsortfilterproxymodel.cpp b/tests/auto/corelib/itemmodels/qsortfilterproxymodel_common/tst_qsortfilterproxymodel.cpp
index 82cd26971b..ccce5a44e5 100644
--- a/tests/auto/corelib/itemmodels/qsortfilterproxymodel_common/tst_qsortfilterproxymodel.cpp
+++ b/tests/auto/corelib/itemmodels/qsortfilterproxymodel_common/tst_qsortfilterproxymodel.cpp
@@ -38,6 +38,8 @@
#include <qdebug.h>
+Q_LOGGING_CATEGORY(lcItemModels, "qt.corelib.tests.itemmodels")
+
// Testing get/set functions
void tst_QSortFilterProxyModel::getSetCheck()
{
@@ -2361,6 +2363,45 @@ void tst_QSortFilterProxyModel::match()
QCOMPARE(indexes.at(i).row(), expectedProxyItems.at(i));
}
+QList<QStandardItem *> createStandardItemList(const QString &prefix, int n)
+{
+ QList<QStandardItem *> result;
+ for (int i = 0; i < n; ++i)
+ result.append(new QStandardItem(prefix + QString::number(i)));
+ return result;
+}
+
+// QTBUG-73864, recursive search in a tree model.
+
+void tst_QSortFilterProxyModel::matchTree()
+{
+ QStandardItemModel model(0, 2);
+ // Header00 Header01
+ // Header10 Header11
+ // Item00 Item01
+ // Item10 Item11
+ model.appendRow(createStandardItemList(QLatin1String("Header0"), 2));
+ auto headerRow = createStandardItemList(QLatin1String("Header1"), 2);
+ model.appendRow(headerRow);
+ headerRow.first()->appendRow(createStandardItemList(QLatin1String("Item0"), 2));
+ headerRow.first()->appendRow(createStandardItemList(QLatin1String("Item1"), 2));
+
+ auto item11 = model.match(model.index(1, 1), Qt::DisplayRole, QLatin1String("Item11"), 20,
+ Qt::MatchRecursive).value(0);
+ QVERIFY(item11.isValid());
+ QCOMPARE(item11.data().toString(), QLatin1String("Item11"));
+
+ // Repeat in proxy model
+ QSortFilterProxyModel proxy;
+ proxy.setSourceModel(&model);
+ auto proxyItem11 = proxy.match(proxy.index(1, 1), Qt::DisplayRole, QLatin1String("Item11"), 20,
+ Qt::MatchRecursive).value(0);
+ QVERIFY(proxyItem11.isValid());
+ QCOMPARE(proxyItem11.data().toString(), QLatin1String("Item11"));
+
+ QCOMPARE(proxy.mapToSource(proxyItem11).internalId(), item11.internalId());
+}
+
void tst_QSortFilterProxyModel::insertIntoChildrenlessItem()
{
QStandardItemModel model;
@@ -4277,7 +4318,7 @@ public:
QModelIndex index(int, int, const QModelIndex& parent = QModelIndex()) const override
{
// QTBUG-44962: Would we always expect the parent to belong to the model
- qDebug() << parent.model() << this;
+ qCDebug(lcItemModels) << parent.model() << this;
Q_ASSERT(!parent.isValid() || parent.model() == this);
quintptr parentId = (parent.isValid()) ? parent.internalId() : 0;
@@ -4363,7 +4404,7 @@ void tst_QSortFilterProxyModel::sourceLayoutChangeLeavesValidPersistentIndexes()
// The use of qDebug here makes sufficient use of the heap to
// cause corruption at runtime with normal use on linux (before
// the fix). valgrind confirms the fix.
- qDebug() << persistentIndex.parent();
+ qCDebug(lcItemModels) << persistentIndex.parent();
QVERIFY(persistentIndex.parent().isValid());
}
diff --git a/tests/auto/corelib/itemmodels/qsortfilterproxymodel_common/tst_qsortfilterproxymodel.h b/tests/auto/corelib/itemmodels/qsortfilterproxymodel_common/tst_qsortfilterproxymodel.h
index 82d4b7344e..8ae97165b8 100644
--- a/tests/auto/corelib/itemmodels/qsortfilterproxymodel_common/tst_qsortfilterproxymodel.h
+++ b/tests/auto/corelib/itemmodels/qsortfilterproxymodel_common/tst_qsortfilterproxymodel.h
@@ -109,6 +109,7 @@ private slots:
void selectionFilteredOut();
void match_data();
void match();
+ void matchTree();
void insertIntoChildrenlessItem();
void invalidateMappedChildren();
void insertRowIntoFilteredParent();
@@ -186,4 +187,6 @@ private:
Q_DECLARE_METATYPE(QAbstractItemModel::LayoutChangeHint)
+Q_DECLARE_LOGGING_CATEGORY(lcItemModels)
+
#endif // TST_QSORTFILTERPROXYMODEL_H
diff --git a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp
index b823ca2aab..f51fb9bf49 100644
--- a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp
+++ b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp
@@ -3411,12 +3411,11 @@ void tst_QObject::disconnectSelfInSlotAndDeleteAfterEmit()
void tst_QObject::dumpObjectInfo()
{
QObject a, b;
- QObject::connect(&a, SIGNAL(destroyed(QObject*)), &b, SLOT(deleteLater()));
- a.disconnect(&b);
+ QObject::connect(&a, &QObject::destroyed, &b, &QObject::deleteLater);
QTest::ignoreMessage(QtDebugMsg, "OBJECT QObject::unnamed");
QTest::ignoreMessage(QtDebugMsg, " SIGNALS OUT");
QTest::ignoreMessage(QtDebugMsg, " signal: destroyed(QObject*)");
- QTest::ignoreMessage(QtDebugMsg, " <Disconnected receiver>");
+ QTest::ignoreMessage(QtDebugMsg, " <functor or function pointer>");
QTest::ignoreMessage(QtDebugMsg, " SIGNALS IN");
QTest::ignoreMessage(QtDebugMsg, " <None>");
a.dumpObjectInfo(); // should not crash
@@ -7575,8 +7574,6 @@ void tst_QObject::functorReferencesConnection()
// top-level + the one in the 3 others lambdas
QCOMPARE(countedStructObjectsCount, 4);
QObject::disconnect(*c2);
- // the one in the c2's lambda is gone
- QCOMPARE(countedStructObjectsCount, 3);
slot1Called++;
});
connect(&obj, &GetSenderObject::aSignal, [] {}); // just a dummy signal to fill the connection list
diff --git a/tests/auto/corelib/kernel/qtimer/BLACKLIST b/tests/auto/corelib/kernel/qtimer/BLACKLIST
new file mode 100644
index 0000000000..16cbab4587
--- /dev/null
+++ b/tests/auto/corelib/kernel/qtimer/BLACKLIST
@@ -0,0 +1,5 @@
+[remainingTime]
+windows
+osx
+[basic_chrono]
+osx
diff --git a/tests/auto/corelib/serialization/qdatastream_core_pixmap/qdatastream_core_pixmap.pro b/tests/auto/corelib/serialization/qdatastream_core_pixmap/qdatastream_core_pixmap.pro
new file mode 100644
index 0000000000..7e003304af
--- /dev/null
+++ b/tests/auto/corelib/serialization/qdatastream_core_pixmap/qdatastream_core_pixmap.pro
@@ -0,0 +1,4 @@
+CONFIG += testcase
+TARGET = tst_qdatastream_core_pixmap
+QT += testlib
+SOURCES = tst_qdatastream_core_pixmap.cpp
diff --git a/tests/auto/corelib/serialization/qdatastream_core_pixmap/tst_qdatastream_core_pixmap.cpp b/tests/auto/corelib/serialization/qdatastream_core_pixmap/tst_qdatastream_core_pixmap.cpp
new file mode 100644
index 0000000000..c931016a61
--- /dev/null
+++ b/tests/auto/corelib/serialization/qdatastream_core_pixmap/tst_qdatastream_core_pixmap.cpp
@@ -0,0 +1,68 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtTest/QtTest>
+#include <QtGui/QBitmap>
+#include <QtGui/QPalette>
+#include <QtGui/QPixmap>
+#include <QtGui/QPicture>
+#include <QtGui/QTextLength>
+#include <QtGui/QPainter>
+#include <QtGui/QPen>
+
+class tst_QDataStream : public QObject
+{
+Q_OBJECT
+
+private slots:
+ void stream_with_pixmap();
+
+};
+
+void tst_QDataStream::stream_with_pixmap()
+{
+ // This is a QVariantMap with a 3x3 red QPixmap and two strings inside
+ const QByteArray ba = QByteArray::fromBase64("AAAAAwAAAAIAegAAAAoAAAAACgB0AGgAZQByAGUAAAACAHAAAABBAAAAAAGJUE5HDQoaCgAAAA1JSERSAAAAAwAAAAMIAgAAANlKIugAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAAQSURBVAiZY/zPAAVMDJgsAB1bAQXZn5ieAAAAAElFTkSuQmCCAAAAAgBhAAAACgAAAAAKAGgAZQBsAGwAbw==");
+ QImage dummy; // Needed to make sure qtGui is loaded
+
+ QTest::ignoreMessage(QtWarningMsg, "QPixmap::fromImageInPlace: QPixmap cannot be created without a QGuiApplication");
+
+ QVariantMap map;
+ QDataStream d(ba);
+ d.setVersion(QDataStream::Qt_5_12);
+ d >> map;
+
+ QCOMPARE(map["a"].toString(), QString("hello"));
+ QCOMPARE(map["p"].value<QPixmap>(), QPixmap()); // the pixmap is null because this is not a QGuiApplication
+ QCOMPARE(map["z"].toString(), QString("there"));
+}
+
+QTEST_GUILESS_MAIN(tst_QDataStream)
+
+#include "tst_qdatastream_core_pixmap.moc"
+
diff --git a/tests/auto/corelib/serialization/serialization.pro b/tests/auto/corelib/serialization/serialization.pro
index 9187de1bc5..9638178cdc 100644
--- a/tests/auto/corelib/serialization/serialization.pro
+++ b/tests/auto/corelib/serialization/serialization.pro
@@ -6,6 +6,7 @@ SUBDIRS = \
qcborvalue \
qcborvalue_json \
qdatastream \
+ qdatastream_core_pixmap \
qtextstream \
qxmlstream
diff --git a/tests/auto/corelib/thread/qthread/tst_qthread.cpp b/tests/auto/corelib/thread/qthread/tst_qthread.cpp
index d73dcc1b6d..f72b662c94 100644
--- a/tests/auto/corelib/thread/qthread/tst_qthread.cpp
+++ b/tests/auto/corelib/thread/qthread/tst_qthread.cpp
@@ -1330,6 +1330,8 @@ void tst_QThread::quitLock()
QCOMPARE(job->thread(), &thread);
loop.exec();
QVERIFY(exitThreadCalled);
+
+ delete job;
}
void tst_QThread::create()
diff --git a/tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp b/tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp
index 838431cd5a..27b49602fc 100644
--- a/tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp
+++ b/tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp
@@ -1322,6 +1322,7 @@ void tst_QThreadPool::waitForDoneAfterTake()
QRunnable *runnable = createTask(emptyFunct);
manager.start(runnable);
QVERIFY(manager.tryTake(runnable));
+ delete runnable;
}
// Add another runnable that will not be removed
diff --git a/tests/auto/corelib/tools/qdate/tst_qdate.cpp b/tests/auto/corelib/tools/qdate/tst_qdate.cpp
index ce1e5730dd..c17af8741b 100644
--- a/tests/auto/corelib/tools/qdate/tst_qdate.cpp
+++ b/tests/auto/corelib/tools/qdate/tst_qdate.cpp
@@ -83,6 +83,7 @@ private slots:
void negativeYear() const;
void printNegativeYear() const;
void roundtripGermanLocale() const;
+#if QT_CONFIG(textdate)
void shortDayName() const;
void standaloneShortDayName() const;
void longDayName() const;
@@ -91,6 +92,7 @@ private slots:
void standaloneShortMonthName() const;
void longMonthName() const;
void standaloneLongMonthName() const;
+#endif // textdate
void roundtrip() const;
void qdebug() const;
private:
@@ -1038,18 +1040,18 @@ void tst_QDate::fromStringFormat_data()
// Undo this (inline the C-locale versions) for ### Qt 6
// Get localized names:
- QString january = QDate::longMonthName(1);
- QString february = QDate::longMonthName(2);
- QString march = QDate::longMonthName(3);
- QString august = QDate::longMonthName(8);
- QString mon = QDate::shortDayName(1);
- QString monday = QDate::longDayName(1);
- QString tuesday = QDate::longDayName(2);
- QString wednesday = QDate::longDayName(3);
- QString thursday = QDate::longDayName(4);
- QString friday = QDate::longDayName(5);
- QString saturday = QDate::longDayName(6);
- QString sunday = QDate::longDayName(7);
+ QString january = QLocale::system().monthName(1, QLocale::LongFormat);
+ QString february = QLocale::system().monthName(2, QLocale::LongFormat);
+ QString march = QLocale::system().monthName(3, QLocale::LongFormat);
+ QString august = QLocale::system().monthName(8, QLocale::LongFormat);
+ QString mon = QLocale::system().dayName(1, QLocale::ShortFormat);
+ QString monday = QLocale::system().dayName(1, QLocale::LongFormat);
+ QString tuesday = QLocale::system().dayName(2, QLocale::LongFormat);
+ QString wednesday = QLocale::system().dayName(3, QLocale::LongFormat);
+ QString thursday = QLocale::system().dayName(4, QLocale::LongFormat);
+ QString friday = QLocale::system().dayName(5, QLocale::LongFormat);
+ QString saturday = QLocale::system().dayName(6, QLocale::LongFormat);
+ QString sunday = QLocale::system().dayName(7, QLocale::LongFormat);
QTest::newRow("data0") << QString("") << QString("") << defDate();
QTest::newRow("data1") << QString(" ") << QString("") << invalidDate();
@@ -1305,6 +1307,10 @@ void tst_QDate::roundtripGermanLocale() const
theDateTime.fromString(theDateTime.toString(Qt::TextDate), Qt::TextDate);
}
+#if QT_CONFIG(textdate)
+QT_WARNING_PUSH // the methods tested here are all deprecated
+QT_WARNING_DISABLE_GCC("-Wdeprecated-declarations")
+
void tst_QDate::shortDayName() const
{
QCOMPARE(QDate::shortDayName(0), QString());
@@ -1432,6 +1438,8 @@ void tst_QDate::standaloneLongMonthName() const
QCOMPARE(QDate::longMonthName(i, QDate::StandaloneFormat), locale.standaloneMonthName(i, QLocale::LongFormat));
}
}
+QT_WARNING_POP
+#endif // textdate
void tst_QDate::roundtrip() const
{
diff --git a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp
index 9bb0c6811d..0b41af3371 100644
--- a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp
+++ b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp
@@ -952,29 +952,42 @@ void tst_QLocale::stringToDouble()
void tst_QLocale::stringToFloat_data()
{
+ using Bounds = std::numeric_limits<float>;
toReal_data();
- if (std::numeric_limits<float>::has_infinity) {
- double huge = std::numeric_limits<float>::infinity();
- QTest::newRow("C inf") << QString("C") << QString("inf") << true << huge;
- QTest::newRow("C +inf") << QString("C") << QString("+inf") << true << +huge;
- QTest::newRow("C -inf") << QString("C") << QString("-inf") << true << -huge;
+ const QString C(QStringLiteral("C"));
+ if (Bounds::has_infinity) {
+ double huge = Bounds::infinity();
+ QTest::newRow("C inf") << C << QString("inf") << true << huge;
+ QTest::newRow("C +inf") << C << QString("+inf") << true << +huge;
+ QTest::newRow("C -inf") << C << QString("-inf") << true << -huge;
// Overflow float, but not double:
- QTest::newRow("C big") << QString("C") << QString("3.5e38") << false << huge;
- QTest::newRow("C -big") << QString("C") << QString("-3.5e38") << false << -huge;
+ QTest::newRow("C big") << C << QString("3.5e38") << false << huge;
+ QTest::newRow("C -big") << C << QString("-3.5e38") << false << -huge;
// Overflow double, too:
- QTest::newRow("C huge") << QString("C") << QString("2e308") << false << huge;
- QTest::newRow("C -huge") << QString("C") << QString("-2e308") << false << -huge;
+ QTest::newRow("C huge") << C << QString("2e308") << false << huge;
+ QTest::newRow("C -huge") << C << QString("-2e308") << false << -huge;
}
- if (std::numeric_limits<float>::has_quiet_NaN)
- QTest::newRow("C qnan") << QString("C") << QString("NaN") << true << double(std::numeric_limits<float>::quiet_NaN());
+ if (Bounds::has_quiet_NaN)
+ QTest::newRow("C qnan") << C << QString("NaN") << true << double(Bounds::quiet_NaN());
+
+ // Minimal float: shouldn't underflow
+ QTest::newRow("C float min")
+ << C << QLocale::c().toString(Bounds::denorm_min()) << true << double(Bounds::denorm_min());
+ QTest::newRow("C float -min")
+ << C << QLocale::c().toString(-Bounds::denorm_min()) << true << -double(Bounds::denorm_min());
// Underflow float, but not double:
- QTest::newRow("C small") << QString("C") << QString("1e-45") << false << 0.;
- QTest::newRow("C -small") << QString("C") << QString("-1e-45") << false << 0.;
+ QTest::newRow("C small") << C << QString("7e-46") << false << 0.;
+ QTest::newRow("C -small") << C << QString("-7e-46") << false << 0.;
+ using Double = std::numeric_limits<double>;
+ QTest::newRow("C double min")
+ << C << QLocale::c().toString(Double::denorm_min()) << false << 0.0;
+ QTest::newRow("C double -min")
+ << C << QLocale::c().toString(-Double::denorm_min()) << false << 0.0;
// Underflow double, too:
- QTest::newRow("C tiny") << QString("C") << QString("2e-324") << false << 0.;
- QTest::newRow("C -tiny") << QString("C") << QString("-2e-324") << false << 0.;
+ QTest::newRow("C tiny") << C << QString("2e-324") << false << 0.;
+ QTest::newRow("C -tiny") << C << QString("-2e-324") << false << 0.;
}
void tst_QLocale::stringToFloat()
diff --git a/tests/auto/corelib/tools/qscopedvaluerollback/tst_qscopedvaluerollback.cpp b/tests/auto/corelib/tools/qscopedvaluerollback/tst_qscopedvaluerollback.cpp
index 656dd6a6e3..9b607db608 100644
--- a/tests/auto/corelib/tools/qscopedvaluerollback/tst_qscopedvaluerollback.cpp
+++ b/tests/auto/corelib/tools/qscopedvaluerollback/tst_qscopedvaluerollback.cpp
@@ -46,6 +46,7 @@ private Q_SLOTS:
void rollbackToPreviousCommit();
void exceptions();
void earlyExitScope();
+ void moveOnly();
private:
void earlyExitScope_helper(int exitpoint, int &member);
};
@@ -190,5 +191,17 @@ void tst_QScopedValueRollback::earlyExitScope_helper(int exitpoint, int& member)
r.commit();
}
+void tst_QScopedValueRollback::moveOnly()
+{
+ std::unique_ptr<int> uniquePtr;
+ std::unique_ptr<int> newVal(new int(5));
+ QVERIFY(!uniquePtr);
+ {
+ QScopedValueRollback<std::unique_ptr<int>> r(uniquePtr, std::move(newVal));
+ QVERIFY(uniquePtr);
+ }
+ QVERIFY(!uniquePtr);
+}
+
QTEST_MAIN(tst_QScopedValueRollback)
#include "tst_qscopedvaluerollback.moc"
diff --git a/tests/auto/corelib/tools/qtime/tst_qtime.cpp b/tests/auto/corelib/tools/qtime/tst_qtime.cpp
index 3e5724213e..3403c5bf7f 100644
--- a/tests/auto/corelib/tools/qtime/tst_qtime.cpp
+++ b/tests/auto/corelib/tools/qtime/tst_qtime.cpp
@@ -95,8 +95,9 @@ void tst_QTime::addSecs_data()
QTest::newRow("Data0") << QTime(0,0,0) << 200 << QTime(0,3,20);
QTest::newRow("Data1") << QTime(0,0,0) << 20 << QTime(0,0,20);
- QTest::newRow("overflow") << QTime(0,0,0) << (INT_MAX / 1000 + 1)
- << QTime(0,0,0).addSecs((INT_MAX / 1000 + 1) % 86400);
+ QTest::newRow("overflow")
+ << QTime(0,0,0) << (INT_MAX / 1000 + 1)
+ << QTime::fromMSecsSinceStartOfDay(((INT_MAX / 1000 + 1) % 86400) * 1000);
}
void tst_QTime::addSecs()
diff --git a/tests/auto/corelib/tools/qtimezone/tst_qtimezone.cpp b/tests/auto/corelib/tools/qtimezone/tst_qtimezone.cpp
index fc4cb717ec..e1bb3149c6 100644
--- a/tests/auto/corelib/tools/qtimezone/tst_qtimezone.cpp
+++ b/tests/auto/corelib/tools/qtimezone/tst_qtimezone.cpp
@@ -538,6 +538,8 @@ void tst_QTimeZone::checkOffset_data()
int year, month, day, hour, min, sec;
int std, dst;
} table[] = {
+ // Zone with no transitions (QTBUG-74614, when TZ backend uses minimalist data)
+ { "Etc/UTC", "epoch", 1970, 1, 1, 0, 0, 0, 0, 0 },
// Kiev: regression test for QTBUG-64122 (on MS):
{ "Europe/Kiev", "summer", 2017, 10, 27, 12, 0, 0, 2 * 3600, 3600 },
{ "Europe/Kiev", "winter", 2017, 10, 29, 12, 0, 0, 2 * 3600, 0 }
@@ -550,6 +552,8 @@ void tst_QTimeZone::checkOffset_data()
<< QDateTime(QDate(entry.year, entry.month, entry.day),
QTime(entry.hour, entry.min, entry.sec), zone)
<< entry.dst + entry.std << entry.std << entry.dst;
+ } else {
+ qWarning("Skipping %s@%s test as zone is invalid", entry.zone, entry.nick);
}
}
}
diff --git a/tests/auto/corelib/tools/tools.pro b/tests/auto/corelib/tools/tools.pro
index 2a975e67d1..c6da33cce0 100644
--- a/tests/auto/corelib/tools/tools.pro
+++ b/tests/auto/corelib/tools/tools.pro
@@ -46,6 +46,7 @@ SUBDIRS=\
qringbuffer \
qscopedpointer \
qscopedvaluerollback \
+ qscopeguard \
qset \
qsharedpointer \
qsize \
diff --git a/tests/auto/gui/image/qimage/tst_qimage.cpp b/tests/auto/gui/image/qimage/tst_qimage.cpp
index 361055ce67..4d41b5e873 100644
--- a/tests/auto/gui/image/qimage/tst_qimage.cpp
+++ b/tests/auto/gui/image/qimage/tst_qimage.cpp
@@ -230,6 +230,8 @@ private slots:
void convertColorTable();
+ void wideImage();
+
#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
void toWinHBITMAP_data();
void toWinHBITMAP();
@@ -3282,11 +3284,46 @@ void tst_QImage::metadataPassthrough()
QCOMPARE(mirrored.dotsPerMeterY(), a.dotsPerMeterY());
QCOMPARE(mirrored.devicePixelRatio(), a.devicePixelRatio());
+ QTransform t;
+ t.rotate(90);
+ QImage rotated = a.transformed(t);
+ QCOMPARE(rotated.text(QStringLiteral("Test")), a.text(QStringLiteral("Test")));
+ QCOMPARE(rotated.dotsPerMeterX(), a.dotsPerMeterX());
+ QCOMPARE(rotated.dotsPerMeterY(), a.dotsPerMeterY());
+ QCOMPARE(rotated.devicePixelRatio(), a.devicePixelRatio());
+
QImage swapped = a.rgbSwapped();
QCOMPARE(swapped.text(QStringLiteral("Test")), a.text(QStringLiteral("Test")));
QCOMPARE(swapped.dotsPerMeterX(), a.dotsPerMeterX());
QCOMPARE(swapped.dotsPerMeterY(), a.dotsPerMeterY());
QCOMPARE(swapped.devicePixelRatio(), a.devicePixelRatio());
+
+ QImage converted = a.convertToFormat(QImage::Format_RGB32);
+ QCOMPARE(converted.text(QStringLiteral("Test")), a.text(QStringLiteral("Test")));
+ QCOMPARE(converted.dotsPerMeterX(), a.dotsPerMeterX());
+ QCOMPARE(converted.dotsPerMeterY(), a.dotsPerMeterY());
+ QCOMPARE(converted.devicePixelRatio(), a.devicePixelRatio());
+
+ QImage copied = a.copy(0, 0, a.width() / 2, a.height() / 2);
+ QCOMPARE(copied.text(QStringLiteral("Test")), a.text(QStringLiteral("Test")));
+ QCOMPARE(copied.dotsPerMeterX(), a.dotsPerMeterX());
+ QCOMPARE(copied.dotsPerMeterY(), a.dotsPerMeterY());
+ QCOMPARE(copied.devicePixelRatio(), a.devicePixelRatio());
+
+ QImage alphaMask = a.createAlphaMask();
+ QCOMPARE(alphaMask.dotsPerMeterX(), a.dotsPerMeterX());
+ QCOMPARE(alphaMask.dotsPerMeterY(), a.dotsPerMeterY());
+ QCOMPARE(alphaMask.devicePixelRatio(), a.devicePixelRatio());
+
+ QImage heuristicMask = a.createHeuristicMask();
+ QCOMPARE(heuristicMask.dotsPerMeterX(), a.dotsPerMeterX());
+ QCOMPARE(heuristicMask.dotsPerMeterY(), a.dotsPerMeterY());
+ QCOMPARE(heuristicMask.devicePixelRatio(), a.devicePixelRatio());
+
+ QImage maskFromColor = a.createMaskFromColor(qRgb(0, 0, 0));
+ QCOMPARE(maskFromColor.dotsPerMeterX(), a.dotsPerMeterX());
+ QCOMPARE(maskFromColor.dotsPerMeterY(), a.dotsPerMeterY());
+ QCOMPARE(maskFromColor.devicePixelRatio(), a.devicePixelRatio());
}
void tst_QImage::pixelColor()
@@ -3559,6 +3596,24 @@ void tst_QImage::convertColorTable()
QCOMPARE(rgb32.pixel(0,0), 0xffffffff);
}
+void tst_QImage::wideImage()
+{
+ // QTBUG-73731 and QTBUG-73732
+ QImage i(538994187, 2, QImage::Format_ARGB32);
+ QImage i2(32, 32, QImage::Format_ARGB32);
+ i2.fill(Qt::white);
+
+ // Test that it doesn't crash:
+ QPainter painter(&i);
+ // With the composition mode is SourceOver out it's an invalid write
+ // With the composition mode is Source it's an invalid read
+ painter.drawImage(0, 0, i2);
+ painter.setCompositionMode(QPainter::CompositionMode_Source);
+ painter.drawImage(0, 0, i2);
+
+ // Qt6: Test that it actually works on 64bit architectures.
+}
+
#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
QT_BEGIN_NAMESPACE
Q_GUI_EXPORT HBITMAP qt_imageToWinHBITMAP(const QImage &p, int hbitmapFormat = 0);
diff --git a/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp b/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp
index 9a338ad55a..4d31d80246 100644
--- a/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp
+++ b/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp
@@ -121,6 +121,7 @@ private slots:
void copy();
void deepCopyPreservesDpr();
+ void dprPassthrough();
void depthOfNullObjects();
void transformed();
@@ -1169,6 +1170,39 @@ void tst_QPixmap::deepCopyPreservesDpr()
QCOMPARE(dest.devicePixelRatio(), dpr);
}
+void tst_QPixmap::dprPassthrough()
+{
+ const qreal dpr = 2;
+ QPixmap src(32, 32);
+ src.setDevicePixelRatio(dpr);
+ src.fill(Qt::transparent);
+ QCOMPARE(src.devicePixelRatio(), dpr);
+
+ QImage img = src.toImage();
+ QCOMPARE(img.devicePixelRatio(), dpr);
+
+ QPixmap pm(1, 1);
+ pm.convertFromImage(img);
+ QCOMPARE(pm.devicePixelRatio(), dpr);
+
+ QBitmap heuristicMask = src.createHeuristicMask();
+ QCOMPARE(heuristicMask.devicePixelRatio(), dpr);
+
+ QBitmap maskFromColor = src.createMaskFromColor(Qt::white);
+ QCOMPARE(maskFromColor.devicePixelRatio(), dpr);
+
+ QBitmap mask = src.mask();
+ QCOMPARE(mask.devicePixelRatio(), dpr);
+
+ QPixmap scaled = src.scaled(16, 16);
+ QCOMPARE(scaled.devicePixelRatio(), dpr);
+
+ QTransform t;
+ t.rotate(90);
+ QPixmap transformed = src.transformed(t);
+ QCOMPARE(transformed.devicePixelRatio(), dpr);
+}
+
void tst_QPixmap::depthOfNullObjects()
{
QBitmap b1;
diff --git a/tests/auto/gui/painting/qbrush/tst_qbrush.cpp b/tests/auto/gui/painting/qbrush/tst_qbrush.cpp
index cd3eaa1478..ce6ce15767 100644
--- a/tests/auto/gui/painting/qbrush/tst_qbrush.cpp
+++ b/tests/auto/gui/painting/qbrush/tst_qbrush.cpp
@@ -345,6 +345,8 @@ void tst_QBrush::gradientPresets()
QGradient invalidPreset(QGradient::Preset(-1));
QCOMPARE(invalidPreset.type(), QGradient::NoGradient);
+ QBrush brush(invalidPreset);
+ QCOMPARE(brush.style(), Qt::NoBrush);
}
void fill(QPaintDevice *pd) {
diff --git a/tests/auto/network/access/qabstractnetworkcache/tst_qabstractnetworkcache.cpp b/tests/auto/network/access/qabstractnetworkcache/tst_qabstractnetworkcache.cpp
index 92384e85bc..182e3e9547 100644
--- a/tests/auto/network/access/qabstractnetworkcache/tst_qabstractnetworkcache.cpp
+++ b/tests/auto/network/access/qabstractnetworkcache/tst_qabstractnetworkcache.cpp
@@ -256,9 +256,14 @@ void tst_QAbstractNetworkCache::cacheControl_data()
QTest::newRow("200-1") << QNetworkRequest::PreferNetwork << "httpcachetest_cachecontrol-expire.cgi" << false;
QTest::newRow("200-2") << QNetworkRequest::AlwaysNetwork << "httpcachetest_cachecontrol.cgi?no-cache" << AlwaysFalse;
- QTest::newRow("200-3") << QNetworkRequest::PreferNetwork << "httpcachetest_cachecontrol.cgi?no-cache" << false;
+ QTest::newRow("200-3") << QNetworkRequest::PreferNetwork << "httpcachetest_cachecontrol.cgi?no-cache" << true;
QTest::newRow("200-4") << QNetworkRequest::AlwaysCache << "httpcachetest_cachecontrol.cgi?no-cache" << false;
- QTest::newRow("200-5") << QNetworkRequest::PreferCache << "httpcachetest_cachecontrol.cgi?no-cache" << false;
+ QTest::newRow("200-5") << QNetworkRequest::PreferCache << "httpcachetest_cachecontrol.cgi?no-cache" << true;
+
+ QTest::newRow("200-6") << QNetworkRequest::AlwaysNetwork << "httpcachetest_cachecontrol.cgi?no-store" << AlwaysFalse;
+ QTest::newRow("200-7") << QNetworkRequest::PreferNetwork << "httpcachetest_cachecontrol.cgi?no-store" << false;
+ QTest::newRow("200-8") << QNetworkRequest::AlwaysCache << "httpcachetest_cachecontrol.cgi?no-store" << false;
+ QTest::newRow("200-9") << QNetworkRequest::PreferCache << "httpcachetest_cachecontrol.cgi?no-store" << false;
QTest::newRow("304-0") << QNetworkRequest::PreferNetwork << "httpcachetest_cachecontrol.cgi?max-age=1000" << true;
diff --git a/tests/auto/network/access/qnetworkcookiejar/tst_qnetworkcookiejar.cpp b/tests/auto/network/access/qnetworkcookiejar/tst_qnetworkcookiejar.cpp
index 6c3443a735..45abb6aa05 100644
--- a/tests/auto/network/access/qnetworkcookiejar/tst_qnetworkcookiejar.cpp
+++ b/tests/auto/network/access/qnetworkcookiejar/tst_qnetworkcookiejar.cpp
@@ -60,12 +60,15 @@ private slots:
class MyCookieJar: public QNetworkCookieJar
{
public:
+ ~MyCookieJar() override;
inline QList<QNetworkCookie> allCookies() const
{ return QNetworkCookieJar::allCookies(); }
inline void setAllCookies(const QList<QNetworkCookie> &cookieList)
{ QNetworkCookieJar::setAllCookies(cookieList); }
};
+MyCookieJar::~MyCookieJar() = default;
+
void tst_QNetworkCookieJar::getterSetter()
{
MyCookieJar jar;
diff --git a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
index 0d6828797a..eb956bec30 100644
--- a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
+++ b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
@@ -123,7 +123,7 @@ class tst_QNetworkReply: public QObject
if (!seedCreated) {
seedCreated = true; // not thread-safe, but who cares
}
- return QString::number(QTime(0, 0, 0).msecsTo(QTime::currentTime()))
+ return QString::number(QTime::currentTime().msecsSinceStartOfDay())
+ QLatin1Char('-') + QString::number(QCoreApplication::applicationPid())
+ QLatin1Char('-') + QString::number(QRandomGenerator::global()->generate());
}
@@ -3976,7 +3976,7 @@ void tst_QNetworkReply::ioGetFromHttpWithCache_data()
"HTTP/1.0 200\r\n"
"Connection: keep-alive\r\n"
"Content-Type: text/plain\r\n"
- "Cache-control: no-cache\r\n"
+ "Cache-control: no-store\r\n"
"Content-length: 8\r\n"
"\r\n"
"Reloaded";
@@ -4002,6 +4002,33 @@ void tst_QNetworkReply::ioGetFromHttpWithCache_data()
content.second = "Not-reloaded";
content.first.setLastModified(past);
+ // "no-cache"
+ rawHeaders.clear();
+ rawHeaders << QNetworkCacheMetaData::RawHeader("Date", QLocale::c().toString(past, dateFormat).toLatin1())
+ << QNetworkCacheMetaData::RawHeader("Cache-control", "no-cache");
+ content.first.setRawHeaders(rawHeaders);
+ content.first.setLastModified(past);
+ content.first.setExpirationDate(future);
+
+ // "no-cache" does not mean "no cache", just that we must consult remote first
+ QTest::newRow("no-cache,200,always-network")
+ << reply200 << "Reloaded" << content << int(QNetworkRequest::AlwaysNetwork) << QStringList() << false << true;
+ QTest::newRow("no-cache,200,prefer-network")
+ << reply200 << "Reloaded" << content << int(QNetworkRequest::PreferNetwork) << QStringList() << false << true;
+ QTest::newRow("no-cache,200,prefer-cache")
+ << reply200 << "Reloaded" << content << int(QNetworkRequest::PreferCache) << QStringList() << false << true;
+ // We're not allowed by the spec to deliver cached data without checking if it is still
+ // up-to-date.
+ QTest::newRow("no-cache,200,always-cache")
+ << reply200 << QString() << content << int(QNetworkRequest::AlwaysCache) << QStringList() << false << false;
+
+ QTest::newRow("no-cache,304,prefer-network")
+ << reply304 << "Not-reloaded" << content << int(QNetworkRequest::PreferNetwork) << QStringList() << true << true;
+ QTest::newRow("no-cache,304,prefer-cache")
+ << reply304 << "Not-reloaded" << content << int(QNetworkRequest::PreferCache) << QStringList() << true << true;
+ QTest::newRow("no-cache,304,always-cache")
+ << reply304 << QString() << content << int(QNetworkRequest::AlwaysCache) << QStringList() << false << false;
+
//
// Set to expired
//
diff --git a/tests/auto/network/kernel/qhostinfo/BLACKLIST b/tests/auto/network/kernel/qhostinfo/BLACKLIST
index 87c5fe991f..cd4d4eb03c 100644
--- a/tests/auto/network/kernel/qhostinfo/BLACKLIST
+++ b/tests/auto/network/kernel/qhostinfo/BLACKLIST
@@ -4,3 +4,5 @@
windows ci
[blockingLookup:a-plus-aaaa]
windows ci
+[reverseLookup:google-public-dns-a.google.com]
+ci
diff --git a/tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp b/tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp
index 059efae63d..f94756ed73 100644
--- a/tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp
+++ b/tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp
@@ -474,11 +474,11 @@ void tst_QSslKey::passphraseChecks_data()
QTest::newRow("DES") << QString(testDataDir + "rsa-with-passphrase-des.pem") << pass;
QTest::newRow("3DES") << QString(testDataDir + "rsa-with-passphrase-3des.pem") << pass;
QTest::newRow("RC2") << QString(testDataDir + "rsa-with-passphrase-rc2.pem") << pass;
-#if (!defined(QT_NO_OPENSSL) && !defined(OPENSSL_NO_AES)) || defined(QT_SECURETRANSPORT) || QT_CONFIG(schannel)
+#if (!defined(QT_NO_OPENSSL) && !defined(OPENSSL_NO_AES)) || (defined(QT_NO_OPENSSL) && QT_CONFIG(ssl))
QTest::newRow("AES128") << QString(testDataDir + "rsa-with-passphrase-aes128.pem") << aesPass;
QTest::newRow("AES192") << QString(testDataDir + "rsa-with-passphrase-aes192.pem") << aesPass;
QTest::newRow("AES256") << QString(testDataDir + "rsa-with-passphrase-aes256.pem") << aesPass;
-#endif
+#endif // (OpenSSL && AES) || generic backend
}
void tst_QSslKey::passphraseChecks()
@@ -562,79 +562,135 @@ void tst_QSslKey::encrypt_data()
QTest::addColumn<QByteArray>("key");
QTest::addColumn<QByteArray>("plainText");
QTest::addColumn<QByteArray>("cipherText");
+ QTest::addColumn<QByteArray>("iv");
+ QByteArray iv("abcdefgh");
QTest::newRow("DES-CBC, length 0")
<< QSslKeyPrivate::DesCbc << QByteArray("01234567")
<< QByteArray()
- << QByteArray::fromHex("956585228BAF9B1F");
+ << QByteArray::fromHex("956585228BAF9B1F")
+ << iv;
QTest::newRow("DES-CBC, length 1")
<< QSslKeyPrivate::DesCbc << QByteArray("01234567")
<< QByteArray(1, 'a')
- << QByteArray::fromHex("E6880AF202BA3C12");
+ << QByteArray::fromHex("E6880AF202BA3C12")
+ << iv;
QTest::newRow("DES-CBC, length 2")
<< QSslKeyPrivate::DesCbc << QByteArray("01234567")
<< QByteArray(2, 'a')
- << QByteArray::fromHex("A82492386EED6026");
+ << QByteArray::fromHex("A82492386EED6026")
+ << iv;
QTest::newRow("DES-CBC, length 3")
<< QSslKeyPrivate::DesCbc << QByteArray("01234567")
<< QByteArray(3, 'a')
- << QByteArray::fromHex("90B76D5B79519CBA");
+ << QByteArray::fromHex("90B76D5B79519CBA")
+ << iv;
QTest::newRow("DES-CBC, length 4")
<< QSslKeyPrivate::DesCbc << QByteArray("01234567")
<< QByteArray(4, 'a')
- << QByteArray::fromHex("63E3DD6FED87052A");
+ << QByteArray::fromHex("63E3DD6FED87052A")
+ << iv;
QTest::newRow("DES-CBC, length 5")
<< QSslKeyPrivate::DesCbc << QByteArray("01234567")
<< QByteArray(5, 'a')
- << QByteArray::fromHex("03ACDB0EACBDFA94");
+ << QByteArray::fromHex("03ACDB0EACBDFA94")
+ << iv;
QTest::newRow("DES-CBC, length 6")
<< QSslKeyPrivate::DesCbc << QByteArray("01234567")
<< QByteArray(6, 'a')
- << QByteArray::fromHex("7D95024E42A3A88A");
+ << QByteArray::fromHex("7D95024E42A3A88A")
+ << iv;
QTest::newRow("DES-CBC, length 7")
<< QSslKeyPrivate::DesCbc << QByteArray("01234567")
<< QByteArray(7, 'a')
- << QByteArray::fromHex("5003436B8A8E42E9");
+ << QByteArray::fromHex("5003436B8A8E42E9")
+ << iv;
QTest::newRow("DES-CBC, length 8")
<< QSslKeyPrivate::DesCbc << QByteArray("01234567")
<< QByteArray(8, 'a')
- << QByteArray::fromHex("E4C1F054BF5521C0A4A0FD4A2BC6C1B1");
+ << QByteArray::fromHex("E4C1F054BF5521C0A4A0FD4A2BC6C1B1")
+ << iv;
QTest::newRow("DES-EDE3-CBC, length 0")
<< QSslKeyPrivate::DesEde3Cbc << QByteArray("0123456789abcdefghijklmn")
<< QByteArray()
- << QByteArray::fromHex("3B2B4CD0B0FD495F");
+ << QByteArray::fromHex("3B2B4CD0B0FD495F")
+ << iv;
QTest::newRow("DES-EDE3-CBC, length 8")
<< QSslKeyPrivate::DesEde3Cbc << QByteArray("0123456789abcdefghijklmn")
<< QByteArray(8, 'a')
- << QByteArray::fromHex("F2A5A87763C54A72A3224103D90CDB03");
+ << QByteArray::fromHex("F2A5A87763C54A72A3224103D90CDB03")
+ << iv;
QTest::newRow("RC2-40-CBC, length 0")
<< QSslKeyPrivate::Rc2Cbc << QByteArray("01234")
<< QByteArray()
- << QByteArray::fromHex("6D05D52392FF6E7A");
+ << QByteArray::fromHex("6D05D52392FF6E7A")
+ << iv;
QTest::newRow("RC2-40-CBC, length 8")
<< QSslKeyPrivate::Rc2Cbc << QByteArray("01234")
<< QByteArray(8, 'a')
- << QByteArray::fromHex("75768E64C5749072A5D168F3AFEB0005");
+ << QByteArray::fromHex("75768E64C5749072A5D168F3AFEB0005")
+ << iv;
QTest::newRow("RC2-64-CBC, length 0")
<< QSslKeyPrivate::Rc2Cbc << QByteArray("01234567")
<< QByteArray()
- << QByteArray::fromHex("ADAE6BF70F420130");
+ << QByteArray::fromHex("ADAE6BF70F420130")
+ << iv;
QTest::newRow("RC2-64-CBC, length 8")
<< QSslKeyPrivate::Rc2Cbc << QByteArray("01234567")
<< QByteArray(8, 'a')
- << QByteArray::fromHex("C7BF5C80AFBE9FBEFBBB9FD935F6D0DF");
+ << QByteArray::fromHex("C7BF5C80AFBE9FBEFBBB9FD935F6D0DF")
+ << iv;
QTest::newRow("RC2-128-CBC, length 0")
<< QSslKeyPrivate::Rc2Cbc << QByteArray("012345679abcdefg")
<< QByteArray()
- << QByteArray::fromHex("1E965D483A13C8FB");
+ << QByteArray::fromHex("1E965D483A13C8FB")
+ << iv;
QTest::newRow("RC2-128-CBC, length 8")
<< QSslKeyPrivate::Rc2Cbc << QByteArray("012345679abcdefg")
<< QByteArray(8, 'a')
- << QByteArray::fromHex("5AEC1A5B295660B02613454232F7DECE");
+ << QByteArray::fromHex("5AEC1A5B295660B02613454232F7DECE")
+ << iv;
+
+#if (!defined(QT_NO_OPENSSL) && !defined(OPENSSL_NO_AES)) || (defined(QT_NO_OPENSSL) && QT_CONFIG(ssl))
+ // AES needs a longer IV
+ iv = QByteArray("abcdefghijklmnop");
+ QTest::newRow("AES-128-CBC, length 0")
+ << QSslKeyPrivate::Aes128Cbc << QByteArray("012345679abcdefg")
+ << QByteArray()
+ << QByteArray::fromHex("28DE1A9AA26601C30DD2527407121D1A")
+ << iv;
+ QTest::newRow("AES-128-CBC, length 8")
+ << QSslKeyPrivate::Aes128Cbc << QByteArray("012345679abcdefg")
+ << QByteArray(8, 'a')
+ << QByteArray::fromHex("08E880B1BA916F061C1E801D7F44D0EC")
+ << iv;
+
+ QTest::newRow("AES-192-CBC, length 0")
+ << QSslKeyPrivate::Aes192Cbc << QByteArray("0123456789abcdefghijklmn")
+ << QByteArray()
+ << QByteArray::fromHex("E169E0E205CDC2BA895B7CF6097673B1")
+ << iv;
+ QTest::newRow("AES-192-CBC, length 8")
+ << QSslKeyPrivate::Aes192Cbc << QByteArray("0123456789abcdefghijklmn")
+ << QByteArray(8, 'a')
+ << QByteArray::fromHex("3A227D6A3A13237316D30AA17FF9B0A7")
+ << iv;
+
+ QTest::newRow("AES-256-CBC, length 0")
+ << QSslKeyPrivate::Aes256Cbc << QByteArray("0123456789abcdefghijklmnopqrstuv")
+ << QByteArray()
+ << QByteArray::fromHex("4BAACAA0D22199C97DE206C465B7B14A")
+ << iv;
+ QTest::newRow("AES-256-CBC, length 8")
+ << QSslKeyPrivate::Aes256Cbc << QByteArray("0123456789abcdefghijklmnopqrstuv")
+ << QByteArray(8, 'a')
+ << QByteArray::fromHex("879C8C25EC135CDF0B14490A0A7C2F67")
+ << iv;
+#endif // (OpenSSL && AES) || generic backend
}
void tst_QSslKey::encrypt()
@@ -643,7 +699,7 @@ void tst_QSslKey::encrypt()
QFETCH(QByteArray, key);
QFETCH(QByteArray, plainText);
QFETCH(QByteArray, cipherText);
- QByteArray iv("abcdefgh");
+ QFETCH(QByteArray, iv);
#if defined(Q_OS_WINRT) || QT_CONFIG(schannel)
QEXPECT_FAIL("RC2-40-CBC, length 0", "WinRT/Schannel treats RC2 as 128-bit", Abort);
diff --git a/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp b/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp
index 96c2f8ec42..7912063bc8 100644
--- a/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp
+++ b/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp
@@ -2139,7 +2139,7 @@ protected:
// delayed reading data
QTest::qSleep(100);
- if (!socket->waitForReadyRead(2000))
+ if (!socket->waitForReadyRead(2000) && socket->bytesAvailable() == 0)
return; // error
socket->readAll();
dataReadSemaphore.release();
@@ -2210,7 +2210,7 @@ void tst_QSslSocket::waitForMinusOne()
socket.write("How are you doing?");
QVERIFY(socket.bytesToWrite() != 0);
QVERIFY(socket.waitForBytesWritten(-1));
- QVERIFY(server.dataReadSemaphore.tryAcquire(1, 2000));
+ QVERIFY(server.dataReadSemaphore.tryAcquire(1, 2500));
// third verification: it should wait for 100 ms:
QVERIFY(socket.waitForReadyRead(-1));
diff --git a/tests/auto/network/ssl/qsslsocket_onDemandCertificates_member/BLACKLIST b/tests/auto/network/ssl/qsslsocket_onDemandCertificates_member/BLACKLIST
deleted file mode 100644
index c9b628d79b..0000000000
--- a/tests/auto/network/ssl/qsslsocket_onDemandCertificates_member/BLACKLIST
+++ /dev/null
@@ -1,2 +0,0 @@
-[onDemandRootCertLoadingMemberMethods]
-linux
diff --git a/tests/auto/other/gestures/BLACKLIST b/tests/auto/other/gestures/BLACKLIST
index 269bac5750..c465ff316e 100644
--- a/tests/auto/other/gestures/BLACKLIST
+++ b/tests/auto/other/gestures/BLACKLIST
@@ -1,5 +1,6 @@
[]
rhel-7.4
+rhel-7.6
ubuntu-18.04
[customGesture]
# QTBUG-67254
diff --git a/tests/auto/other/qobjectrace/tst_qobjectrace.cpp b/tests/auto/other/qobjectrace/tst_qobjectrace.cpp
index 0d656e223c..22782f6b09 100644
--- a/tests/auto/other/qobjectrace/tst_qobjectrace.cpp
+++ b/tests/auto/other/qobjectrace/tst_qobjectrace.cpp
@@ -378,6 +378,10 @@ public:
connect(timer, &QTimer::timeout, this, &DeleteReceiverRaceReceiver::onTimeout);
timer->start(1);
}
+ ~DeleteReceiverRaceReceiver()
+ {
+ delete receiver;
+ }
void onTimeout()
{
@@ -428,12 +432,12 @@ void tst_QObjectRace::disconnectRace()
for (int i = 0; i < ThreadCount; ++i) {
threads[i]->requestInterruption();
- QVERIFY(threads[i]->wait(300));
+ QVERIFY(threads[i]->wait());
delete threads[i];
}
senderThread->quit();
- QVERIFY(senderThread->wait(300));
+ QVERIFY(senderThread->wait());
}
QCOMPARE(countedStructObjectsCount.load(), 0u);
@@ -453,11 +457,11 @@ void tst_QObjectRace::disconnectRace()
QTest::qWait(TimeLimit);
senderThread->requestInterruption();
- QVERIFY(senderThread->wait(300));
+ QVERIFY(senderThread->wait());
for (int i = 0; i < ThreadCount; ++i) {
threads[i]->quit();
- QVERIFY(threads[i]->wait(300));
+ QVERIFY(threads[i]->wait());
delete threads[i];
}
}
diff --git a/tests/auto/sql/kernel/qsqlerror/tst_qsqlerror.cpp b/tests/auto/sql/kernel/qsqlerror/tst_qsqlerror.cpp
index 08c6039e37..be0285537e 100644
--- a/tests/auto/sql/kernel/qsqlerror/tst_qsqlerror.cpp
+++ b/tests/auto/sql/kernel/qsqlerror/tst_qsqlerror.cpp
@@ -46,6 +46,7 @@ private slots:
void construction();
void moveOperator();
void operators();
+ void qtbug_74575();
};
tst_QSqlError::tst_QSqlError()
@@ -113,6 +114,7 @@ void tst_QSqlError::construction()
QVERIFY(!obj4.isValid());
QCOMPARE(obj4.driverText(), QString());
QCOMPARE(obj4.databaseText(), QString());
+ QCOMPARE(obj4.text(), QString());
QCOMPARE(obj4.type(), QSqlError::NoError);
QCOMPARE(obj4.number(), -1);
QCOMPARE(obj4.nativeErrorCode(), QString());
@@ -180,6 +182,28 @@ void tst_QSqlError::operators()
QVERIFY(error1 != error3);
}
+void tst_QSqlError::qtbug_74575()
+{
+ const QString driverText(QStringLiteral("drivertext"));
+ const QString databaseText(QStringLiteral("databasetext"));
+ const QString databaseTextNewline(QStringLiteral("databasetext\n"));
+
+ QSqlError error1(driverText, databaseText,
+ QSqlError::UnknownError, QStringLiteral("123"));
+ QCOMPARE(error1.text(), databaseText + QLatin1Char(' ') + driverText);
+
+ QSqlError error2(QString(), databaseText,
+ QSqlError::UnknownError, QStringLiteral("123"));
+ QCOMPARE(error2.text(), databaseText);
+
+ QSqlError error3(driverText, QString(),
+ QSqlError::UnknownError, QStringLiteral("123"));
+ QCOMPARE(error3.text(), driverText);
+
+ QSqlError error4(driverText, databaseTextNewline,
+ QSqlError::UnknownError, QStringLiteral("123"));
+ QCOMPARE(error4.text(), databaseTextNewline + driverText);
+}
QTEST_MAIN(tst_QSqlError)
#include "tst_qsqlerror.moc"
diff --git a/tests/auto/testlib/selftests/expected_globaldata.lightxml b/tests/auto/testlib/selftests/expected_globaldata.lightxml
index f66c4c552d..1212e4b364 100644
--- a/tests/auto/testlib/selftests/expected_globaldata.lightxml
+++ b/tests/auto/testlib/selftests/expected_globaldata.lightxml
@@ -12,174 +12,195 @@
</TestFunction>
<TestFunction name="testGlobal">
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[1:local 1]]></DataTag>
- <Description><![CDATA[init testGlobal local 1]]></Description>
+ <DataTag><![CDATA[global=false:local=false]]></DataTag>
+ <Description><![CDATA[init testGlobal local=false]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[1:local 1]]></DataTag>
+ <DataTag><![CDATA[global=false:local=false]]></DataTag>
<Description><![CDATA[global: false]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[1:local 1]]></DataTag>
+ <DataTag><![CDATA[global=false:local=false]]></DataTag>
<Description><![CDATA[local: false]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[1:local 1]]></DataTag>
- <Description><![CDATA[cleanup testGlobal local 1]]></Description>
+ <DataTag><![CDATA[global=false:local=false]]></DataTag>
+ <Description><![CDATA[cleanup testGlobal local=false]]></Description>
</Message>
<Incident type="pass" file="" line="0">
- <DataTag><![CDATA[1:local 1]]></DataTag>
+ <DataTag><![CDATA[global=false:local=false]]></DataTag>
</Incident>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[1:local 2]]></DataTag>
- <Description><![CDATA[init testGlobal local 2]]></Description>
+ <DataTag><![CDATA[global=false:local=true]]></DataTag>
+ <Description><![CDATA[init testGlobal local=true]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[1:local 2]]></DataTag>
+ <DataTag><![CDATA[global=false:local=true]]></DataTag>
<Description><![CDATA[global: false]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[1:local 2]]></DataTag>
+ <DataTag><![CDATA[global=false:local=true]]></DataTag>
<Description><![CDATA[local: true]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[1:local 2]]></DataTag>
- <Description><![CDATA[cleanup testGlobal local 2]]></Description>
+ <DataTag><![CDATA[global=false:local=true]]></DataTag>
+ <Description><![CDATA[cleanup testGlobal local=true]]></Description>
</Message>
<Incident type="pass" file="" line="0">
- <DataTag><![CDATA[1:local 2]]></DataTag>
+ <DataTag><![CDATA[global=false:local=true]]></DataTag>
</Incident>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[2:local 1]]></DataTag>
- <Description><![CDATA[init testGlobal local 1]]></Description>
+ <DataTag><![CDATA[global=true:local=false]]></DataTag>
+ <Description><![CDATA[init testGlobal local=false]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[2:local 1]]></DataTag>
+ <DataTag><![CDATA[global=true:local=false]]></DataTag>
<Description><![CDATA[global: true]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[2:local 1]]></DataTag>
+ <DataTag><![CDATA[global=true:local=false]]></DataTag>
<Description><![CDATA[local: false]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[2:local 1]]></DataTag>
- <Description><![CDATA[cleanup testGlobal local 1]]></Description>
+ <DataTag><![CDATA[global=true:local=false]]></DataTag>
+ <Description><![CDATA[cleanup testGlobal local=false]]></Description>
</Message>
<Incident type="pass" file="" line="0">
- <DataTag><![CDATA[2:local 1]]></DataTag>
+ <DataTag><![CDATA[global=true:local=false]]></DataTag>
</Incident>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[2:local 2]]></DataTag>
- <Description><![CDATA[init testGlobal local 2]]></Description>
+ <DataTag><![CDATA[global=true:local=true]]></DataTag>
+ <Description><![CDATA[init testGlobal local=true]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[2:local 2]]></DataTag>
+ <DataTag><![CDATA[global=true:local=true]]></DataTag>
<Description><![CDATA[global: true]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[2:local 2]]></DataTag>
+ <DataTag><![CDATA[global=true:local=true]]></DataTag>
<Description><![CDATA[local: true]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[2:local 2]]></DataTag>
- <Description><![CDATA[cleanup testGlobal local 2]]></Description>
+ <DataTag><![CDATA[global=true:local=true]]></DataTag>
+ <Description><![CDATA[cleanup testGlobal local=true]]></Description>
</Message>
<Incident type="pass" file="" line="0">
- <DataTag><![CDATA[2:local 2]]></DataTag>
+ <DataTag><![CDATA[global=true:local=true]]></DataTag>
</Incident>
<Duration msecs="0"/>
</TestFunction>
<TestFunction name="skip">
<Message type="skip" file="qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp" line="0">
- <DataTag><![CDATA[1]]></DataTag>
+ <DataTag><![CDATA[global=false]]></DataTag>
<Description><![CDATA[skipping]]></Description>
</Message>
<Duration msecs="0"/>
</TestFunction>
<TestFunction name="skipLocal">
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[1:local 1]]></DataTag>
- <Description><![CDATA[init skipLocal local 1]]></Description>
+ <DataTag><![CDATA[global=false:local=false]]></DataTag>
+ <Description><![CDATA[init skipLocal local=false]]></Description>
</Message>
<Message type="skip" file="qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp" line="0">
- <DataTag><![CDATA[1:local 1]]></DataTag>
+ <DataTag><![CDATA[global=false:local=false]]></DataTag>
<Description><![CDATA[skipping]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[1:local 1]]></DataTag>
- <Description><![CDATA[cleanup skipLocal local 1]]></Description>
+ <DataTag><![CDATA[global=false:local=false]]></DataTag>
+ <Description><![CDATA[cleanup skipLocal local=false]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[1:local 2]]></DataTag>
- <Description><![CDATA[init skipLocal local 2]]></Description>
+ <DataTag><![CDATA[global=false:local=true]]></DataTag>
+ <Description><![CDATA[init skipLocal local=true]]></Description>
</Message>
<Message type="skip" file="qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp" line="0">
- <DataTag><![CDATA[1:local 2]]></DataTag>
+ <DataTag><![CDATA[global=false:local=true]]></DataTag>
<Description><![CDATA[skipping]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[1:local 2]]></DataTag>
- <Description><![CDATA[cleanup skipLocal local 2]]></Description>
+ <DataTag><![CDATA[global=false:local=true]]></DataTag>
+ <Description><![CDATA[cleanup skipLocal local=true]]></Description>
+</Message>
+<Message type="qdebug" file="" line="0">
+ <DataTag><![CDATA[global=true:local=false]]></DataTag>
+ <Description><![CDATA[init skipLocal local=false]]></Description>
+</Message>
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp" line="0">
+ <DataTag><![CDATA[global=true:local=false]]></DataTag>
+ <Description><![CDATA[skipping]]></Description>
+</Message>
+<Message type="qdebug" file="" line="0">
+ <DataTag><![CDATA[global=true:local=false]]></DataTag>
+ <Description><![CDATA[cleanup skipLocal local=false]]></Description>
+</Message>
+<Message type="qdebug" file="" line="0">
+ <DataTag><![CDATA[global=true:local=true]]></DataTag>
+ <Description><![CDATA[init skipLocal local=true]]></Description>
+</Message>
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp" line="0">
+ <DataTag><![CDATA[global=true:local=true]]></DataTag>
+ <Description><![CDATA[skipping]]></Description>
+</Message>
+<Message type="qdebug" file="" line="0">
+ <DataTag><![CDATA[global=true:local=true]]></DataTag>
+ <Description><![CDATA[cleanup skipLocal local=true]]></Description>
</Message>
<Duration msecs="0"/>
</TestFunction>
<TestFunction name="skipSingle">
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[1:local 1]]></DataTag>
- <Description><![CDATA[init skipSingle local 1]]></Description>
+ <DataTag><![CDATA[global=false:local=false]]></DataTag>
+ <Description><![CDATA[init skipSingle local=false]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[1:local 1]]></DataTag>
+ <DataTag><![CDATA[global=false:local=false]]></DataTag>
<Description><![CDATA[global: false local: false]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[1:local 1]]></DataTag>
- <Description><![CDATA[cleanup skipSingle local 1]]></Description>
+ <DataTag><![CDATA[global=false:local=false]]></DataTag>
+ <Description><![CDATA[cleanup skipSingle local=false]]></Description>
</Message>
<Incident type="pass" file="" line="0">
- <DataTag><![CDATA[1:local 1]]></DataTag>
+ <DataTag><![CDATA[global=false:local=false]]></DataTag>
</Incident>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[1:local 2]]></DataTag>
- <Description><![CDATA[init skipSingle local 2]]></Description>
+ <DataTag><![CDATA[global=false:local=true]]></DataTag>
+ <Description><![CDATA[init skipSingle local=true]]></Description>
</Message>
-<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[1:local 2]]></DataTag>
- <Description><![CDATA[global: false local: true]]></Description>
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp" line="0">
+ <DataTag><![CDATA[global=false:local=true]]></DataTag>
+ <Description><![CDATA[Skipping]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[1:local 2]]></DataTag>
- <Description><![CDATA[cleanup skipSingle local 2]]></Description>
+ <DataTag><![CDATA[global=false:local=true]]></DataTag>
+ <Description><![CDATA[cleanup skipSingle local=true]]></Description>
</Message>
-<Incident type="pass" file="" line="0">
- <DataTag><![CDATA[1:local 2]]></DataTag>
-</Incident>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[2:local 1]]></DataTag>
- <Description><![CDATA[init skipSingle local 1]]></Description>
+ <DataTag><![CDATA[global=true:local=false]]></DataTag>
+ <Description><![CDATA[init skipSingle local=false]]></Description>
</Message>
<Message type="skip" file="qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp" line="0">
- <DataTag><![CDATA[2:local 1]]></DataTag>
- <Description><![CDATA[skipping]]></Description>
+ <DataTag><![CDATA[global=true:local=false]]></DataTag>
+ <Description><![CDATA[Skipping]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[2:local 1]]></DataTag>
- <Description><![CDATA[cleanup skipSingle local 1]]></Description>
+ <DataTag><![CDATA[global=true:local=false]]></DataTag>
+ <Description><![CDATA[cleanup skipSingle local=false]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[2:local 2]]></DataTag>
- <Description><![CDATA[init skipSingle local 2]]></Description>
+ <DataTag><![CDATA[global=true:local=true]]></DataTag>
+ <Description><![CDATA[init skipSingle local=true]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[2:local 2]]></DataTag>
+ <DataTag><![CDATA[global=true:local=true]]></DataTag>
<Description><![CDATA[global: true local: true]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[2:local 2]]></DataTag>
- <Description><![CDATA[cleanup skipSingle local 2]]></Description>
+ <DataTag><![CDATA[global=true:local=true]]></DataTag>
+ <Description><![CDATA[cleanup skipSingle local=true]]></Description>
</Message>
<Incident type="pass" file="" line="0">
- <DataTag><![CDATA[2:local 2]]></DataTag>
+ <DataTag><![CDATA[global=true:local=true]]></DataTag>
</Incident>
<Duration msecs="0"/>
</TestFunction>
diff --git a/tests/auto/testlib/selftests/expected_globaldata.tap b/tests/auto/testlib/selftests/expected_globaldata.tap
index 580cf3a7a8..4d61b7437b 100644
--- a/tests/auto/testlib/selftests/expected_globaldata.tap
+++ b/tests/auto/testlib/selftests/expected_globaldata.tap
@@ -2,51 +2,56 @@ TAP version 13
# tst_globaldata
# initTestCase initTestCase (null)
ok 1 - initTestCase()
-# init testGlobal local 1
+# init testGlobal local=false
# global: false
# local: false
-# cleanup testGlobal local 1
-ok 2 - testGlobal(1:local 1)
-# init testGlobal local 2
+# cleanup testGlobal local=false
+ok 2 - testGlobal(global=false:local=false)
+# init testGlobal local=true
# global: false
# local: true
-# cleanup testGlobal local 2
-ok 3 - testGlobal(1:local 2)
-# init testGlobal local 1
+# cleanup testGlobal local=true
+ok 3 - testGlobal(global=false:local=true)
+# init testGlobal local=false
# global: true
# local: false
-# cleanup testGlobal local 1
-ok 4 - testGlobal(2:local 1)
-# init testGlobal local 2
+# cleanup testGlobal local=false
+ok 4 - testGlobal(global=true:local=false)
+# init testGlobal local=true
# global: true
# local: true
-# cleanup testGlobal local 2
-ok 5 - testGlobal(2:local 2)
-ok 6 - skip(1) # SKIP skipping
-# init skipLocal local 1
-ok 7 - skipLocal(1:local 1) # SKIP skipping
-# cleanup skipLocal local 1
-# init skipLocal local 2
-ok 8 - skipLocal(1:local 2) # SKIP skipping
-# cleanup skipLocal local 2
-# init skipSingle local 1
+# cleanup testGlobal local=true
+ok 5 - testGlobal(global=true:local=true)
+ok 6 - skip(global=false) # SKIP skipping
+# init skipLocal local=false
+ok 7 - skipLocal(global=false:local=false) # SKIP skipping
+# cleanup skipLocal local=false
+# init skipLocal local=true
+ok 8 - skipLocal(global=false:local=true) # SKIP skipping
+# cleanup skipLocal local=true
+# init skipLocal local=false
+ok 9 - skipLocal(global=true:local=false) # SKIP skipping
+# cleanup skipLocal local=false
+# init skipLocal local=true
+ok 10 - skipLocal(global=true:local=true) # SKIP skipping
+# cleanup skipLocal local=true
+# init skipSingle local=false
# global: false local: false
-# cleanup skipSingle local 1
-ok 9 - skipSingle(1:local 1)
-# init skipSingle local 2
-# global: false local: true
-# cleanup skipSingle local 2
-ok 10 - skipSingle(1:local 2)
-# init skipSingle local 1
-ok 11 - skipSingle(2:local 1) # SKIP skipping
-# cleanup skipSingle local 1
-# init skipSingle local 2
+# cleanup skipSingle local=false
+ok 11 - skipSingle(global=false:local=false)
+# init skipSingle local=true
+ok 12 - skipSingle(global=false:local=true) # SKIP Skipping
+# cleanup skipSingle local=true
+# init skipSingle local=false
+ok 13 - skipSingle(global=true:local=false) # SKIP Skipping
+# cleanup skipSingle local=false
+# init skipSingle local=true
# global: true local: true
-# cleanup skipSingle local 2
-ok 12 - skipSingle(2:local 2)
+# cleanup skipSingle local=true
+ok 14 - skipSingle(global=true:local=true)
# cleanupTestCase cleanupTestCase (null)
-ok 13 - cleanupTestCase()
-1..13
-# tests 13
-# pass 9
+ok 15 - cleanupTestCase()
+1..15
+# tests 15
+# pass 8
# fail 0
diff --git a/tests/auto/testlib/selftests/expected_globaldata.teamcity b/tests/auto/testlib/selftests/expected_globaldata.teamcity
index 5d623a3285..f76f6090ba 100644
--- a/tests/auto/testlib/selftests/expected_globaldata.teamcity
+++ b/tests/auto/testlib/selftests/expected_globaldata.teamcity
@@ -2,30 +2,31 @@
##teamcity[testStarted name='initTestCase()' flowId='tst_globaldata']
##teamcity[testStdOut name='initTestCase()' out='QDEBUG: initTestCase initTestCase (null)' flowId='tst_globaldata']
##teamcity[testFinished name='initTestCase()' flowId='tst_globaldata']
-##teamcity[testStarted name='testGlobal(local 1)' flowId='tst_globaldata']
-##teamcity[testStdOut name='testGlobal(local 1)' out='QDEBUG: init testGlobal local 1|nQDEBUG: global: false|nQDEBUG: local: false|nQDEBUG: cleanup testGlobal local 1' flowId='tst_globaldata']
-##teamcity[testFinished name='testGlobal(local 1)' flowId='tst_globaldata']
-##teamcity[testStarted name='testGlobal(local 2)' flowId='tst_globaldata']
-##teamcity[testStdOut name='testGlobal(local 2)' out='QDEBUG: init testGlobal local 2|nQDEBUG: global: false|nQDEBUG: local: true|nQDEBUG: cleanup testGlobal local 2' flowId='tst_globaldata']
-##teamcity[testFinished name='testGlobal(local 2)' flowId='tst_globaldata']
-##teamcity[testStarted name='testGlobal(local 1)' flowId='tst_globaldata']
-##teamcity[testStdOut name='testGlobal(local 1)' out='QDEBUG: init testGlobal local 1|nQDEBUG: global: true|nQDEBUG: local: false|nQDEBUG: cleanup testGlobal local 1' flowId='tst_globaldata']
-##teamcity[testFinished name='testGlobal(local 1)' flowId='tst_globaldata']
-##teamcity[testStarted name='testGlobal(local 2)' flowId='tst_globaldata']
-##teamcity[testStdOut name='testGlobal(local 2)' out='QDEBUG: init testGlobal local 2|nQDEBUG: global: true|nQDEBUG: local: true|nQDEBUG: cleanup testGlobal local 2' flowId='tst_globaldata']
-##teamcity[testFinished name='testGlobal(local 2)' flowId='tst_globaldata']
+##teamcity[testStarted name='testGlobal(local=false)' flowId='tst_globaldata']
+##teamcity[testStdOut name='testGlobal(local=false)' out='QDEBUG: init testGlobal local=false|nQDEBUG: global: false|nQDEBUG: local: false|nQDEBUG: cleanup testGlobal local=false' flowId='tst_globaldata']
+##teamcity[testFinished name='testGlobal(local=false)' flowId='tst_globaldata']
+##teamcity[testStarted name='testGlobal(local=true)' flowId='tst_globaldata']
+##teamcity[testStdOut name='testGlobal(local=true)' out='QDEBUG: init testGlobal local=true|nQDEBUG: global: false|nQDEBUG: local: true|nQDEBUG: cleanup testGlobal local=true' flowId='tst_globaldata']
+##teamcity[testFinished name='testGlobal(local=true)' flowId='tst_globaldata']
+##teamcity[testStarted name='testGlobal(local=false)' flowId='tst_globaldata']
+##teamcity[testStdOut name='testGlobal(local=false)' out='QDEBUG: init testGlobal local=false|nQDEBUG: global: true|nQDEBUG: local: false|nQDEBUG: cleanup testGlobal local=false' flowId='tst_globaldata']
+##teamcity[testFinished name='testGlobal(local=false)' flowId='tst_globaldata']
+##teamcity[testStarted name='testGlobal(local=true)' flowId='tst_globaldata']
+##teamcity[testStdOut name='testGlobal(local=true)' out='QDEBUG: init testGlobal local=true|nQDEBUG: global: true|nQDEBUG: local: true|nQDEBUG: cleanup testGlobal local=true' flowId='tst_globaldata']
+##teamcity[testFinished name='testGlobal(local=true)' flowId='tst_globaldata']
##teamcity[testIgnored name='skip()' message='skipping |[Loc: qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp(0)|]' flowId='tst_globaldata']
-##teamcity[testIgnored name='skipLocal(local 1)' message='skipping |[Loc: qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp(0)|]' flowId='tst_globaldata']
-##teamcity[testIgnored name='skipLocal(local 2)' message='skipping |[Loc: qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp(0)|]' flowId='tst_globaldata']
-##teamcity[testStarted name='skipSingle(local 1)' flowId='tst_globaldata']
-##teamcity[testStdOut name='skipSingle(local 1)' out='QDEBUG: init skipLocal local 1|nQDEBUG: cleanup skipLocal local 1|nQDEBUG: init skipLocal local 2|nQDEBUG: cleanup skipLocal local 2|nQDEBUG: init skipSingle local 1|nQDEBUG: global: false local: false|nQDEBUG: cleanup skipSingle local 1' flowId='tst_globaldata']
-##teamcity[testFinished name='skipSingle(local 1)' flowId='tst_globaldata']
-##teamcity[testStarted name='skipSingle(local 2)' flowId='tst_globaldata']
-##teamcity[testStdOut name='skipSingle(local 2)' out='QDEBUG: init skipSingle local 2|nQDEBUG: global: false local: true|nQDEBUG: cleanup skipSingle local 2' flowId='tst_globaldata']
-##teamcity[testFinished name='skipSingle(local 2)' flowId='tst_globaldata']
-##teamcity[testIgnored name='skipSingle(local 1)' message='skipping |[Loc: qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp(0)|]' flowId='tst_globaldata']
-##teamcity[testStdOut name='skipSingle(local 2)' out='QDEBUG: init skipSingle local 1|nQDEBUG: cleanup skipSingle local 1|nQDEBUG: init skipSingle local 2|nQDEBUG: global: true local: true|nQDEBUG: cleanup skipSingle local 2' flowId='tst_globaldata']
-##teamcity[testFinished name='skipSingle(local 2)' flowId='tst_globaldata']
+##teamcity[testIgnored name='skipLocal(local=false)' message='skipping |[Loc: qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp(0)|]' flowId='tst_globaldata']
+##teamcity[testIgnored name='skipLocal(local=true)' message='skipping |[Loc: qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp(0)|]' flowId='tst_globaldata']
+##teamcity[testIgnored name='skipLocal(local=false)' message='skipping |[Loc: qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp(0)|]' flowId='tst_globaldata']
+##teamcity[testIgnored name='skipLocal(local=true)' message='skipping |[Loc: qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp(0)|]' flowId='tst_globaldata']
+##teamcity[testStarted name='skipSingle(local=false)' flowId='tst_globaldata']
+##teamcity[testStdOut name='skipSingle(local=false)' out='QDEBUG: init skipLocal local=false|nQDEBUG: cleanup skipLocal local=false|nQDEBUG: init skipLocal local=true|nQDEBUG: cleanup skipLocal local=true|nQDEBUG: init skipLocal local=false|nQDEBUG: cleanup skipLocal local=false|nQDEBUG: init skipLocal local=true|nQDEBUG: cleanup skipLocal local=true|nQDEBUG: init skipSingle local=false|nQDEBUG: global: false local: false|nQDEBUG: cleanup skipSingle local=false' flowId='tst_globaldata']
+##teamcity[testFinished name='skipSingle(local=false)' flowId='tst_globaldata']
+##teamcity[testIgnored name='skipSingle(local=true)' message='Skipping |[Loc: qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp(0)|]' flowId='tst_globaldata']
+##teamcity[testIgnored name='skipSingle(local=false)' message='Skipping |[Loc: qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp(0)|]' flowId='tst_globaldata']
+##teamcity[testStarted name='skipSingle(local=true)' flowId='tst_globaldata']
+##teamcity[testStdOut name='skipSingle(local=true)' out='QDEBUG: init skipSingle local=true|nQDEBUG: cleanup skipSingle local=true|nQDEBUG: init skipSingle local=false|nQDEBUG: cleanup skipSingle local=false|nQDEBUG: init skipSingle local=true|nQDEBUG: global: true local: true|nQDEBUG: cleanup skipSingle local=true' flowId='tst_globaldata']
+##teamcity[testFinished name='skipSingle(local=true)' flowId='tst_globaldata']
##teamcity[testStarted name='cleanupTestCase()' flowId='tst_globaldata']
##teamcity[testStdOut name='cleanupTestCase()' out='QDEBUG: cleanupTestCase cleanupTestCase (null)' flowId='tst_globaldata']
##teamcity[testFinished name='cleanupTestCase()' flowId='tst_globaldata']
diff --git a/tests/auto/testlib/selftests/expected_globaldata.txt b/tests/auto/testlib/selftests/expected_globaldata.txt
index b12f4a2a69..016b5e8299 100644
--- a/tests/auto/testlib/selftests/expected_globaldata.txt
+++ b/tests/auto/testlib/selftests/expected_globaldata.txt
@@ -2,53 +2,61 @@
Config: Using QtTest library
QDEBUG : tst_globaldata::initTestCase() initTestCase initTestCase (null)
PASS : tst_globaldata::initTestCase()
-QDEBUG : tst_globaldata::testGlobal(1:local 1) init testGlobal local 1
-QDEBUG : tst_globaldata::testGlobal(1:local 1) global: false
-QDEBUG : tst_globaldata::testGlobal(1:local 1) local: false
-QDEBUG : tst_globaldata::testGlobal(1:local 1) cleanup testGlobal local 1
-PASS : tst_globaldata::testGlobal(1:local 1)
-QDEBUG : tst_globaldata::testGlobal(1:local 2) init testGlobal local 2
-QDEBUG : tst_globaldata::testGlobal(1:local 2) global: false
-QDEBUG : tst_globaldata::testGlobal(1:local 2) local: true
-QDEBUG : tst_globaldata::testGlobal(1:local 2) cleanup testGlobal local 2
-PASS : tst_globaldata::testGlobal(1:local 2)
-QDEBUG : tst_globaldata::testGlobal(2:local 1) init testGlobal local 1
-QDEBUG : tst_globaldata::testGlobal(2:local 1) global: true
-QDEBUG : tst_globaldata::testGlobal(2:local 1) local: false
-QDEBUG : tst_globaldata::testGlobal(2:local 1) cleanup testGlobal local 1
-PASS : tst_globaldata::testGlobal(2:local 1)
-QDEBUG : tst_globaldata::testGlobal(2:local 2) init testGlobal local 2
-QDEBUG : tst_globaldata::testGlobal(2:local 2) global: true
-QDEBUG : tst_globaldata::testGlobal(2:local 2) local: true
-QDEBUG : tst_globaldata::testGlobal(2:local 2) cleanup testGlobal local 2
-PASS : tst_globaldata::testGlobal(2:local 2)
-SKIP : tst_globaldata::skip(1) skipping
+QDEBUG : tst_globaldata::testGlobal(global=false:local=false) init testGlobal local=false
+QDEBUG : tst_globaldata::testGlobal(global=false:local=false) global: false
+QDEBUG : tst_globaldata::testGlobal(global=false:local=false) local: false
+QDEBUG : tst_globaldata::testGlobal(global=false:local=false) cleanup testGlobal local=false
+PASS : tst_globaldata::testGlobal(global=false:local=false)
+QDEBUG : tst_globaldata::testGlobal(global=false:local=true) init testGlobal local=true
+QDEBUG : tst_globaldata::testGlobal(global=false:local=true) global: false
+QDEBUG : tst_globaldata::testGlobal(global=false:local=true) local: true
+QDEBUG : tst_globaldata::testGlobal(global=false:local=true) cleanup testGlobal local=true
+PASS : tst_globaldata::testGlobal(global=false:local=true)
+QDEBUG : tst_globaldata::testGlobal(global=true:local=false) init testGlobal local=false
+QDEBUG : tst_globaldata::testGlobal(global=true:local=false) global: true
+QDEBUG : tst_globaldata::testGlobal(global=true:local=false) local: false
+QDEBUG : tst_globaldata::testGlobal(global=true:local=false) cleanup testGlobal local=false
+PASS : tst_globaldata::testGlobal(global=true:local=false)
+QDEBUG : tst_globaldata::testGlobal(global=true:local=true) init testGlobal local=true
+QDEBUG : tst_globaldata::testGlobal(global=true:local=true) global: true
+QDEBUG : tst_globaldata::testGlobal(global=true:local=true) local: true
+QDEBUG : tst_globaldata::testGlobal(global=true:local=true) cleanup testGlobal local=true
+PASS : tst_globaldata::testGlobal(global=true:local=true)
+SKIP : tst_globaldata::skip(global=false) skipping
Loc: [qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp(0)]
-QDEBUG : tst_globaldata::skipLocal(1:local 1) init skipLocal local 1
-SKIP : tst_globaldata::skipLocal(1:local 1) skipping
+QDEBUG : tst_globaldata::skipLocal(global=false:local=false) init skipLocal local=false
+SKIP : tst_globaldata::skipLocal(global=false:local=false) skipping
Loc: [qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp(0)]
-QDEBUG : tst_globaldata::skipLocal(1:local 1) cleanup skipLocal local 1
-QDEBUG : tst_globaldata::skipLocal(1:local 2) init skipLocal local 2
-SKIP : tst_globaldata::skipLocal(1:local 2) skipping
+QDEBUG : tst_globaldata::skipLocal(global=false:local=false) cleanup skipLocal local=false
+QDEBUG : tst_globaldata::skipLocal(global=false:local=true) init skipLocal local=true
+SKIP : tst_globaldata::skipLocal(global=false:local=true) skipping
Loc: [qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp(0)]
-QDEBUG : tst_globaldata::skipLocal(1:local 2) cleanup skipLocal local 2
-QDEBUG : tst_globaldata::skipSingle(1:local 1) init skipSingle local 1
-QDEBUG : tst_globaldata::skipSingle(1:local 1) global: false local: false
-QDEBUG : tst_globaldata::skipSingle(1:local 1) cleanup skipSingle local 1
-PASS : tst_globaldata::skipSingle(1:local 1)
-QDEBUG : tst_globaldata::skipSingle(1:local 2) init skipSingle local 2
-QDEBUG : tst_globaldata::skipSingle(1:local 2) global: false local: true
-QDEBUG : tst_globaldata::skipSingle(1:local 2) cleanup skipSingle local 2
-PASS : tst_globaldata::skipSingle(1:local 2)
-QDEBUG : tst_globaldata::skipSingle(2:local 1) init skipSingle local 1
-SKIP : tst_globaldata::skipSingle(2:local 1) skipping
+QDEBUG : tst_globaldata::skipLocal(global=false:local=true) cleanup skipLocal local=true
+QDEBUG : tst_globaldata::skipLocal(global=true:local=false) init skipLocal local=false
+SKIP : tst_globaldata::skipLocal(global=true:local=false) skipping
Loc: [qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp(0)]
-QDEBUG : tst_globaldata::skipSingle(2:local 1) cleanup skipSingle local 1
-QDEBUG : tst_globaldata::skipSingle(2:local 2) init skipSingle local 2
-QDEBUG : tst_globaldata::skipSingle(2:local 2) global: true local: true
-QDEBUG : tst_globaldata::skipSingle(2:local 2) cleanup skipSingle local 2
-PASS : tst_globaldata::skipSingle(2:local 2)
+QDEBUG : tst_globaldata::skipLocal(global=true:local=false) cleanup skipLocal local=false
+QDEBUG : tst_globaldata::skipLocal(global=true:local=true) init skipLocal local=true
+SKIP : tst_globaldata::skipLocal(global=true:local=true) skipping
+ Loc: [qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp(0)]
+QDEBUG : tst_globaldata::skipLocal(global=true:local=true) cleanup skipLocal local=true
+QDEBUG : tst_globaldata::skipSingle(global=false:local=false) init skipSingle local=false
+QDEBUG : tst_globaldata::skipSingle(global=false:local=false) global: false local: false
+QDEBUG : tst_globaldata::skipSingle(global=false:local=false) cleanup skipSingle local=false
+PASS : tst_globaldata::skipSingle(global=false:local=false)
+QDEBUG : tst_globaldata::skipSingle(global=false:local=true) init skipSingle local=true
+SKIP : tst_globaldata::skipSingle(global=false:local=true) Skipping
+ Loc: [qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp(0)]
+QDEBUG : tst_globaldata::skipSingle(global=false:local=true) cleanup skipSingle local=true
+QDEBUG : tst_globaldata::skipSingle(global=true:local=false) init skipSingle local=false
+SKIP : tst_globaldata::skipSingle(global=true:local=false) Skipping
+ Loc: [qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp(0)]
+QDEBUG : tst_globaldata::skipSingle(global=true:local=false) cleanup skipSingle local=false
+QDEBUG : tst_globaldata::skipSingle(global=true:local=true) init skipSingle local=true
+QDEBUG : tst_globaldata::skipSingle(global=true:local=true) global: true local: true
+QDEBUG : tst_globaldata::skipSingle(global=true:local=true) cleanup skipSingle local=true
+PASS : tst_globaldata::skipSingle(global=true:local=true)
QDEBUG : tst_globaldata::cleanupTestCase() cleanupTestCase cleanupTestCase (null)
PASS : tst_globaldata::cleanupTestCase()
-Totals: 9 passed, 0 failed, 4 skipped, 0 blacklisted, 0ms
+Totals: 8 passed, 0 failed, 7 skipped, 0 blacklisted, 0ms
********* Finished testing of tst_globaldata *********
diff --git a/tests/auto/testlib/selftests/expected_globaldata.xml b/tests/auto/testlib/selftests/expected_globaldata.xml
index 0f705ef352..9aa48c8f16 100644
--- a/tests/auto/testlib/selftests/expected_globaldata.xml
+++ b/tests/auto/testlib/selftests/expected_globaldata.xml
@@ -14,174 +14,195 @@
</TestFunction>
<TestFunction name="testGlobal">
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[1:local 1]]></DataTag>
- <Description><![CDATA[init testGlobal local 1]]></Description>
+ <DataTag><![CDATA[global=false:local=false]]></DataTag>
+ <Description><![CDATA[init testGlobal local=false]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[1:local 1]]></DataTag>
+ <DataTag><![CDATA[global=false:local=false]]></DataTag>
<Description><![CDATA[global: false]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[1:local 1]]></DataTag>
+ <DataTag><![CDATA[global=false:local=false]]></DataTag>
<Description><![CDATA[local: false]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[1:local 1]]></DataTag>
- <Description><![CDATA[cleanup testGlobal local 1]]></Description>
+ <DataTag><![CDATA[global=false:local=false]]></DataTag>
+ <Description><![CDATA[cleanup testGlobal local=false]]></Description>
</Message>
<Incident type="pass" file="" line="0">
- <DataTag><![CDATA[1:local 1]]></DataTag>
+ <DataTag><![CDATA[global=false:local=false]]></DataTag>
</Incident>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[1:local 2]]></DataTag>
- <Description><![CDATA[init testGlobal local 2]]></Description>
+ <DataTag><![CDATA[global=false:local=true]]></DataTag>
+ <Description><![CDATA[init testGlobal local=true]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[1:local 2]]></DataTag>
+ <DataTag><![CDATA[global=false:local=true]]></DataTag>
<Description><![CDATA[global: false]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[1:local 2]]></DataTag>
+ <DataTag><![CDATA[global=false:local=true]]></DataTag>
<Description><![CDATA[local: true]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[1:local 2]]></DataTag>
- <Description><![CDATA[cleanup testGlobal local 2]]></Description>
+ <DataTag><![CDATA[global=false:local=true]]></DataTag>
+ <Description><![CDATA[cleanup testGlobal local=true]]></Description>
</Message>
<Incident type="pass" file="" line="0">
- <DataTag><![CDATA[1:local 2]]></DataTag>
+ <DataTag><![CDATA[global=false:local=true]]></DataTag>
</Incident>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[2:local 1]]></DataTag>
- <Description><![CDATA[init testGlobal local 1]]></Description>
+ <DataTag><![CDATA[global=true:local=false]]></DataTag>
+ <Description><![CDATA[init testGlobal local=false]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[2:local 1]]></DataTag>
+ <DataTag><![CDATA[global=true:local=false]]></DataTag>
<Description><![CDATA[global: true]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[2:local 1]]></DataTag>
+ <DataTag><![CDATA[global=true:local=false]]></DataTag>
<Description><![CDATA[local: false]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[2:local 1]]></DataTag>
- <Description><![CDATA[cleanup testGlobal local 1]]></Description>
+ <DataTag><![CDATA[global=true:local=false]]></DataTag>
+ <Description><![CDATA[cleanup testGlobal local=false]]></Description>
</Message>
<Incident type="pass" file="" line="0">
- <DataTag><![CDATA[2:local 1]]></DataTag>
+ <DataTag><![CDATA[global=true:local=false]]></DataTag>
</Incident>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[2:local 2]]></DataTag>
- <Description><![CDATA[init testGlobal local 2]]></Description>
+ <DataTag><![CDATA[global=true:local=true]]></DataTag>
+ <Description><![CDATA[init testGlobal local=true]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[2:local 2]]></DataTag>
+ <DataTag><![CDATA[global=true:local=true]]></DataTag>
<Description><![CDATA[global: true]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[2:local 2]]></DataTag>
+ <DataTag><![CDATA[global=true:local=true]]></DataTag>
<Description><![CDATA[local: true]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[2:local 2]]></DataTag>
- <Description><![CDATA[cleanup testGlobal local 2]]></Description>
+ <DataTag><![CDATA[global=true:local=true]]></DataTag>
+ <Description><![CDATA[cleanup testGlobal local=true]]></Description>
</Message>
<Incident type="pass" file="" line="0">
- <DataTag><![CDATA[2:local 2]]></DataTag>
+ <DataTag><![CDATA[global=true:local=true]]></DataTag>
</Incident>
<Duration msecs="0"/>
</TestFunction>
<TestFunction name="skip">
<Message type="skip" file="qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp" line="0">
- <DataTag><![CDATA[1]]></DataTag>
+ <DataTag><![CDATA[global=false]]></DataTag>
<Description><![CDATA[skipping]]></Description>
</Message>
<Duration msecs="0"/>
</TestFunction>
<TestFunction name="skipLocal">
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[1:local 1]]></DataTag>
- <Description><![CDATA[init skipLocal local 1]]></Description>
+ <DataTag><![CDATA[global=false:local=false]]></DataTag>
+ <Description><![CDATA[init skipLocal local=false]]></Description>
</Message>
<Message type="skip" file="qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp" line="0">
- <DataTag><![CDATA[1:local 1]]></DataTag>
+ <DataTag><![CDATA[global=false:local=false]]></DataTag>
<Description><![CDATA[skipping]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[1:local 1]]></DataTag>
- <Description><![CDATA[cleanup skipLocal local 1]]></Description>
+ <DataTag><![CDATA[global=false:local=false]]></DataTag>
+ <Description><![CDATA[cleanup skipLocal local=false]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[1:local 2]]></DataTag>
- <Description><![CDATA[init skipLocal local 2]]></Description>
+ <DataTag><![CDATA[global=false:local=true]]></DataTag>
+ <Description><![CDATA[init skipLocal local=true]]></Description>
</Message>
<Message type="skip" file="qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp" line="0">
- <DataTag><![CDATA[1:local 2]]></DataTag>
+ <DataTag><![CDATA[global=false:local=true]]></DataTag>
<Description><![CDATA[skipping]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[1:local 2]]></DataTag>
- <Description><![CDATA[cleanup skipLocal local 2]]></Description>
+ <DataTag><![CDATA[global=false:local=true]]></DataTag>
+ <Description><![CDATA[cleanup skipLocal local=true]]></Description>
+</Message>
+<Message type="qdebug" file="" line="0">
+ <DataTag><![CDATA[global=true:local=false]]></DataTag>
+ <Description><![CDATA[init skipLocal local=false]]></Description>
+</Message>
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp" line="0">
+ <DataTag><![CDATA[global=true:local=false]]></DataTag>
+ <Description><![CDATA[skipping]]></Description>
+</Message>
+<Message type="qdebug" file="" line="0">
+ <DataTag><![CDATA[global=true:local=false]]></DataTag>
+ <Description><![CDATA[cleanup skipLocal local=false]]></Description>
+</Message>
+<Message type="qdebug" file="" line="0">
+ <DataTag><![CDATA[global=true:local=true]]></DataTag>
+ <Description><![CDATA[init skipLocal local=true]]></Description>
+</Message>
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp" line="0">
+ <DataTag><![CDATA[global=true:local=true]]></DataTag>
+ <Description><![CDATA[skipping]]></Description>
+</Message>
+<Message type="qdebug" file="" line="0">
+ <DataTag><![CDATA[global=true:local=true]]></DataTag>
+ <Description><![CDATA[cleanup skipLocal local=true]]></Description>
</Message>
<Duration msecs="0"/>
</TestFunction>
<TestFunction name="skipSingle">
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[1:local 1]]></DataTag>
- <Description><![CDATA[init skipSingle local 1]]></Description>
+ <DataTag><![CDATA[global=false:local=false]]></DataTag>
+ <Description><![CDATA[init skipSingle local=false]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[1:local 1]]></DataTag>
+ <DataTag><![CDATA[global=false:local=false]]></DataTag>
<Description><![CDATA[global: false local: false]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[1:local 1]]></DataTag>
- <Description><![CDATA[cleanup skipSingle local 1]]></Description>
+ <DataTag><![CDATA[global=false:local=false]]></DataTag>
+ <Description><![CDATA[cleanup skipSingle local=false]]></Description>
</Message>
<Incident type="pass" file="" line="0">
- <DataTag><![CDATA[1:local 1]]></DataTag>
+ <DataTag><![CDATA[global=false:local=false]]></DataTag>
</Incident>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[1:local 2]]></DataTag>
- <Description><![CDATA[init skipSingle local 2]]></Description>
+ <DataTag><![CDATA[global=false:local=true]]></DataTag>
+ <Description><![CDATA[init skipSingle local=true]]></Description>
</Message>
-<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[1:local 2]]></DataTag>
- <Description><![CDATA[global: false local: true]]></Description>
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp" line="0">
+ <DataTag><![CDATA[global=false:local=true]]></DataTag>
+ <Description><![CDATA[Skipping]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[1:local 2]]></DataTag>
- <Description><![CDATA[cleanup skipSingle local 2]]></Description>
+ <DataTag><![CDATA[global=false:local=true]]></DataTag>
+ <Description><![CDATA[cleanup skipSingle local=true]]></Description>
</Message>
-<Incident type="pass" file="" line="0">
- <DataTag><![CDATA[1:local 2]]></DataTag>
-</Incident>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[2:local 1]]></DataTag>
- <Description><![CDATA[init skipSingle local 1]]></Description>
+ <DataTag><![CDATA[global=true:local=false]]></DataTag>
+ <Description><![CDATA[init skipSingle local=false]]></Description>
</Message>
<Message type="skip" file="qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp" line="0">
- <DataTag><![CDATA[2:local 1]]></DataTag>
- <Description><![CDATA[skipping]]></Description>
+ <DataTag><![CDATA[global=true:local=false]]></DataTag>
+ <Description><![CDATA[Skipping]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[2:local 1]]></DataTag>
- <Description><![CDATA[cleanup skipSingle local 1]]></Description>
+ <DataTag><![CDATA[global=true:local=false]]></DataTag>
+ <Description><![CDATA[cleanup skipSingle local=false]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[2:local 2]]></DataTag>
- <Description><![CDATA[init skipSingle local 2]]></Description>
+ <DataTag><![CDATA[global=true:local=true]]></DataTag>
+ <Description><![CDATA[init skipSingle local=true]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[2:local 2]]></DataTag>
+ <DataTag><![CDATA[global=true:local=true]]></DataTag>
<Description><![CDATA[global: true local: true]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[2:local 2]]></DataTag>
- <Description><![CDATA[cleanup skipSingle local 2]]></Description>
+ <DataTag><![CDATA[global=true:local=true]]></DataTag>
+ <Description><![CDATA[cleanup skipSingle local=true]]></Description>
</Message>
<Incident type="pass" file="" line="0">
- <DataTag><![CDATA[2:local 2]]></DataTag>
+ <DataTag><![CDATA[global=true:local=true]]></DataTag>
</Incident>
<Duration msecs="0"/>
</TestFunction>
diff --git a/tests/auto/testlib/selftests/expected_globaldata.xunitxml b/tests/auto/testlib/selftests/expected_globaldata.xunitxml
index bdd7e3f00a..de184c2fdd 100644
--- a/tests/auto/testlib/selftests/expected_globaldata.xunitxml
+++ b/tests/auto/testlib/selftests/expected_globaldata.xunitxml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<testsuite errors="37" failures="0" tests="6" name="tst_globaldata">
+<testsuite errors="43" failures="0" tests="6" name="tst_globaldata">
<properties>
<property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/>
<property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/>
@@ -9,88 +9,100 @@
<!-- message="initTestCase initTestCase (null)" type="qdebug" -->
</testcase>
<testcase result="pass" name="testGlobal">
- <!-- tag="1:local 1" message="init testGlobal local 1" type="qdebug" -->
- <!-- tag="1:local 1" message="global: false" type="qdebug" -->
- <!-- tag="1:local 1" message="local: false" type="qdebug" -->
- <!-- tag="1:local 1" message="cleanup testGlobal local 1" type="qdebug" -->
- <!-- tag="1:local 2" message="init testGlobal local 2" type="qdebug" -->
- <!-- tag="1:local 2" message="global: false" type="qdebug" -->
- <!-- tag="1:local 2" message="local: true" type="qdebug" -->
- <!-- tag="1:local 2" message="cleanup testGlobal local 2" type="qdebug" -->
- <!-- tag="2:local 1" message="init testGlobal local 1" type="qdebug" -->
- <!-- tag="2:local 1" message="global: true" type="qdebug" -->
- <!-- tag="2:local 1" message="local: false" type="qdebug" -->
- <!-- tag="2:local 1" message="cleanup testGlobal local 1" type="qdebug" -->
- <!-- tag="2:local 2" message="init testGlobal local 2" type="qdebug" -->
- <!-- tag="2:local 2" message="global: true" type="qdebug" -->
- <!-- tag="2:local 2" message="local: true" type="qdebug" -->
- <!-- tag="2:local 2" message="cleanup testGlobal local 2" type="qdebug" -->
+ <!-- tag="global=false:local=false" message="init testGlobal local=false" type="qdebug" -->
+ <!-- tag="global=false:local=false" message="global: false" type="qdebug" -->
+ <!-- tag="global=false:local=false" message="local: false" type="qdebug" -->
+ <!-- tag="global=false:local=false" message="cleanup testGlobal local=false" type="qdebug" -->
+ <!-- tag="global=false:local=true" message="init testGlobal local=true" type="qdebug" -->
+ <!-- tag="global=false:local=true" message="global: false" type="qdebug" -->
+ <!-- tag="global=false:local=true" message="local: true" type="qdebug" -->
+ <!-- tag="global=false:local=true" message="cleanup testGlobal local=true" type="qdebug" -->
+ <!-- tag="global=true:local=false" message="init testGlobal local=false" type="qdebug" -->
+ <!-- tag="global=true:local=false" message="global: true" type="qdebug" -->
+ <!-- tag="global=true:local=false" message="local: false" type="qdebug" -->
+ <!-- tag="global=true:local=false" message="cleanup testGlobal local=false" type="qdebug" -->
+ <!-- tag="global=true:local=true" message="init testGlobal local=true" type="qdebug" -->
+ <!-- tag="global=true:local=true" message="global: true" type="qdebug" -->
+ <!-- tag="global=true:local=true" message="local: true" type="qdebug" -->
+ <!-- tag="global=true:local=true" message="cleanup testGlobal local=true" type="qdebug" -->
</testcase>
<testcase name="skip">
- <!-- tag="1" message="skipping" type="skip" -->
+ <!-- tag="global=false" message="skipping" type="skip" -->
</testcase>
<testcase name="skipLocal">
- <!-- tag="1:local 1" message="init skipLocal local 1" type="qdebug" -->
- <!-- tag="1:local 1" message="skipping" type="skip" -->
- <!-- tag="1:local 1" message="cleanup skipLocal local 1" type="qdebug" -->
- <!-- tag="1:local 2" message="init skipLocal local 2" type="qdebug" -->
- <!-- tag="1:local 2" message="skipping" type="skip" -->
- <!-- tag="1:local 2" message="cleanup skipLocal local 2" type="qdebug" -->
+ <!-- tag="global=false:local=false" message="init skipLocal local=false" type="qdebug" -->
+ <!-- tag="global=false:local=false" message="skipping" type="skip" -->
+ <!-- tag="global=false:local=false" message="cleanup skipLocal local=false" type="qdebug" -->
+ <!-- tag="global=false:local=true" message="init skipLocal local=true" type="qdebug" -->
+ <!-- tag="global=false:local=true" message="skipping" type="skip" -->
+ <!-- tag="global=false:local=true" message="cleanup skipLocal local=true" type="qdebug" -->
+ <!-- tag="global=true:local=false" message="init skipLocal local=false" type="qdebug" -->
+ <!-- tag="global=true:local=false" message="skipping" type="skip" -->
+ <!-- tag="global=true:local=false" message="cleanup skipLocal local=false" type="qdebug" -->
+ <!-- tag="global=true:local=true" message="init skipLocal local=true" type="qdebug" -->
+ <!-- tag="global=true:local=true" message="skipping" type="skip" -->
+ <!-- tag="global=true:local=true" message="cleanup skipLocal local=true" type="qdebug" -->
</testcase>
<testcase result="pass" name="skipSingle">
- <!-- tag="1:local 1" message="init skipSingle local 1" type="qdebug" -->
- <!-- tag="1:local 1" message="global: false local: false" type="qdebug" -->
- <!-- tag="1:local 1" message="cleanup skipSingle local 1" type="qdebug" -->
- <!-- tag="1:local 2" message="init skipSingle local 2" type="qdebug" -->
- <!-- tag="1:local 2" message="global: false local: true" type="qdebug" -->
- <!-- tag="1:local 2" message="cleanup skipSingle local 2" type="qdebug" -->
- <!-- tag="2:local 1" message="init skipSingle local 1" type="qdebug" -->
- <!-- tag="2:local 1" message="skipping" type="skip" -->
- <!-- tag="2:local 1" message="cleanup skipSingle local 1" type="qdebug" -->
- <!-- tag="2:local 2" message="init skipSingle local 2" type="qdebug" -->
- <!-- tag="2:local 2" message="global: true local: true" type="qdebug" -->
- <!-- tag="2:local 2" message="cleanup skipSingle local 2" type="qdebug" -->
+ <!-- tag="global=false:local=false" message="init skipSingle local=false" type="qdebug" -->
+ <!-- tag="global=false:local=false" message="global: false local: false" type="qdebug" -->
+ <!-- tag="global=false:local=false" message="cleanup skipSingle local=false" type="qdebug" -->
+ <!-- tag="global=false:local=true" message="init skipSingle local=true" type="qdebug" -->
+ <!-- tag="global=false:local=true" message="Skipping" type="skip" -->
+ <!-- tag="global=false:local=true" message="cleanup skipSingle local=true" type="qdebug" -->
+ <!-- tag="global=true:local=false" message="init skipSingle local=false" type="qdebug" -->
+ <!-- tag="global=true:local=false" message="Skipping" type="skip" -->
+ <!-- tag="global=true:local=false" message="cleanup skipSingle local=false" type="qdebug" -->
+ <!-- tag="global=true:local=true" message="init skipSingle local=true" type="qdebug" -->
+ <!-- tag="global=true:local=true" message="global: true local: true" type="qdebug" -->
+ <!-- tag="global=true:local=true" message="cleanup skipSingle local=true" type="qdebug" -->
</testcase>
<testcase result="pass" name="cleanupTestCase">
<!-- message="cleanupTestCase cleanupTestCase (null)" type="qdebug" -->
</testcase>
<system-err>
<![CDATA[initTestCase initTestCase (null)]]>
-<![CDATA[init testGlobal local 1]]>
+<![CDATA[init testGlobal local=false]]>
<![CDATA[global: false]]>
<![CDATA[local: false]]>
-<![CDATA[cleanup testGlobal local 1]]>
-<![CDATA[init testGlobal local 2]]>
+<![CDATA[cleanup testGlobal local=false]]>
+<![CDATA[init testGlobal local=true]]>
<![CDATA[global: false]]>
<![CDATA[local: true]]>
-<![CDATA[cleanup testGlobal local 2]]>
-<![CDATA[init testGlobal local 1]]>
+<![CDATA[cleanup testGlobal local=true]]>
+<![CDATA[init testGlobal local=false]]>
<![CDATA[global: true]]>
<![CDATA[local: false]]>
-<![CDATA[cleanup testGlobal local 1]]>
-<![CDATA[init testGlobal local 2]]>
+<![CDATA[cleanup testGlobal local=false]]>
+<![CDATA[init testGlobal local=true]]>
<![CDATA[global: true]]>
<![CDATA[local: true]]>
-<![CDATA[cleanup testGlobal local 2]]>
+<![CDATA[cleanup testGlobal local=true]]>
<![CDATA[skipping]]>
-<![CDATA[init skipLocal local 1]]>
+<![CDATA[init skipLocal local=false]]>
<![CDATA[skipping]]>
-<![CDATA[cleanup skipLocal local 1]]>
-<![CDATA[init skipLocal local 2]]>
+<![CDATA[cleanup skipLocal local=false]]>
+<![CDATA[init skipLocal local=true]]>
<![CDATA[skipping]]>
-<![CDATA[cleanup skipLocal local 2]]>
-<![CDATA[init skipSingle local 1]]>
-<![CDATA[global: false local: false]]>
-<![CDATA[cleanup skipSingle local 1]]>
-<![CDATA[init skipSingle local 2]]>
-<![CDATA[global: false local: true]]>
-<![CDATA[cleanup skipSingle local 2]]>
-<![CDATA[init skipSingle local 1]]>
+<![CDATA[cleanup skipLocal local=true]]>
+<![CDATA[init skipLocal local=false]]>
+<![CDATA[skipping]]>
+<![CDATA[cleanup skipLocal local=false]]>
+<![CDATA[init skipLocal local=true]]>
<![CDATA[skipping]]>
-<![CDATA[cleanup skipSingle local 1]]>
-<![CDATA[init skipSingle local 2]]>
+<![CDATA[cleanup skipLocal local=true]]>
+<![CDATA[init skipSingle local=false]]>
+<![CDATA[global: false local: false]]>
+<![CDATA[cleanup skipSingle local=false]]>
+<![CDATA[init skipSingle local=true]]>
+<![CDATA[Skipping]]>
+<![CDATA[cleanup skipSingle local=true]]>
+<![CDATA[init skipSingle local=false]]>
+<![CDATA[Skipping]]>
+<![CDATA[cleanup skipSingle local=false]]>
+<![CDATA[init skipSingle local=true]]>
<![CDATA[global: true local: true]]>
-<![CDATA[cleanup skipSingle local 2]]>
+<![CDATA[cleanup skipSingle local=true]]>
<![CDATA[cleanupTestCase cleanupTestCase (null)]]>
</system-err>
</testsuite>
diff --git a/tests/auto/testlib/selftests/expected_signaldumper.lightxml b/tests/auto/testlib/selftests/expected_signaldumper.lightxml
new file mode 100644
index 0000000000..f68834e1a2
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_signaldumper.lightxml
@@ -0,0 +1,578 @@
+<Environment>
+ <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>
+ <QtBuild/>
+ <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion>
+</Environment>
+<TestFunction name="initTestCase">
+<Message type="info" file="" line="0">
+ <Description><![CDATA[Signal: QThread(_POINTER_) started ()]]></Description>
+</Message>
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="noConnections">
+<Message type="info" file="" line="0">
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="oneSlot">
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+</Incident>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="oneSlotOldSyntax">
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Slot: SignalSlotClass(_POINTER_) slotWithParameters(int,char)]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+</Incident>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="twoSlots">
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+</Incident>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="twoSlotsOldSyntax">
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Slot: SignalSlotClass(_POINTER_) slotWithParameters(int,char)]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Slot: SignalSlotClass(_POINTER_) slotWithParameters(int,char)]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+</Incident>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="signalForwarding">
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Signal: SignalSlotClass(_POINTER_) nestedSignal ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Signal: SignalSlotClass(_POINTER_) nestedSignalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Signal: SignalSlotClass(_POINTER_) nestedSignal ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+</Incident>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) nestedSignal ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) nestedSignalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) nestedSignal ()]]></Description>
+</Message>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="signalForwardingOldSyntax">
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Slot: SignalSlotClass(_POINTER_) nestedSignal()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Signal: SignalSlotClass(_POINTER_) nestedSignal ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Slot: SignalSlotClass(_POINTER_) nestedSignalWithParameters(int,char)]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Signal: SignalSlotClass(_POINTER_) nestedSignalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Slot: SignalSlotClass(_POINTER_) nestedSignal()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Signal: SignalSlotClass(_POINTER_) nestedSignal ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+</Incident>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) nestedSignal ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) nestedSignalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) nestedSignal ()]]></Description>
+</Message>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="slotEmittingSignal">
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Signal: SignalSlotClass(_POINTER_) nestedSignal ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+</Incident>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) nestedSignal ()]]></Description>
+</Message>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="slotEmittingSignalOldSyntax">
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Slot: SignalSlotClass(_POINTER_) emitSecondSignal()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Signal: SignalSlotClass(_POINTER_) nestedSignal ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+</Incident>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) nestedSignal ()]]></Description>
+</Message>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="variousTypes">
+<Message type="info" file="" line="0">
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) qStringSignal (QString(Test string))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) qStringRefSignal ((QString&)@_POINTER_)]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) qStringConstRefSignal (QString(Test string))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) qByteArraySignal (QByteArray(Test bytearray))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) qListSignal (QList<int>())]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) qVectorSignal (QVector<int>())]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) qVectorRefSignal ((QVector<int>&)@_POINTER_)]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) qVectorConstRefSignal (QVector<int>())]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) qVectorConstPointerSignal ((const QVector<int>*)_POINTER_)]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) qVectorPointerConstSignal ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) qVariantSignal (QVariant())]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) qVariantSignal (QVariant())]]></Description>
+</Message>
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="cleanupTestCase">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<Message type="info" file="" line="0">
+ <Description><![CDATA[Signal: QThread(_POINTER_) finished ()]]></Description>
+</Message>
+<Duration msecs="0"/>
diff --git a/tests/auto/testlib/selftests/expected_signaldumper.tap b/tests/auto/testlib/selftests/expected_signaldumper.tap
new file mode 100644
index 0000000000..04d7d94745
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_signaldumper.tap
@@ -0,0 +1,151 @@
+TAP version 13
+# tst_Signaldumper
+# Signal: QThread(_POINTER_) started ()
+ok 1 - initTestCase()
+# Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()
+# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+ok 2 - noConnections()
+# Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+ok 3 - oneSlot(direct)
+# Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+ok 4 - oneSlot(queued)
+# Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()
+# Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+# Slot: SignalSlotClass(_POINTER_) slotWithParameters(int,char)
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+# Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+ok 5 - oneSlotOldSyntax(direct)
+# Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+ok 6 - oneSlotOldSyntax(queued)
+# Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+ok 7 - twoSlots(direct)
+# Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+ok 8 - twoSlots(queued)
+# Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()
+# Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()
+# Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+# Slot: SignalSlotClass(_POINTER_) slotWithParameters(int,char)
+# Slot: SignalSlotClass(_POINTER_) slotWithParameters(int,char)
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+# Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()
+# Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+ok 9 - twoSlotsOldSyntax(direct)
+# Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+ok 10 - twoSlotsOldSyntax(queued)
+# Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()
+# Signal: SignalSlotClass(_POINTER_) nestedSignal ()
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+# Signal: SignalSlotClass(_POINTER_) nestedSignalWithParameters (int(242), char(m))
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+# Signal: SignalSlotClass(_POINTER_) nestedSignal ()
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+ok 11 - signalForwarding(direct)
+# Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+# Signal: SignalSlotClass(_POINTER_) nestedSignal ()
+# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+# Signal: SignalSlotClass(_POINTER_) nestedSignalWithParameters (int(242), char(m))
+# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+# Signal: SignalSlotClass(_POINTER_) nestedSignal ()
+ok 12 - signalForwarding(queued)
+# Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()
+# Slot: SignalSlotClass(_POINTER_) nestedSignal()
+# Signal: SignalSlotClass(_POINTER_) nestedSignal ()
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+# Slot: SignalSlotClass(_POINTER_) nestedSignalWithParameters(int,char)
+# Signal: SignalSlotClass(_POINTER_) nestedSignalWithParameters (int(242), char(m))
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+# Slot: SignalSlotClass(_POINTER_) nestedSignal()
+# Signal: SignalSlotClass(_POINTER_) nestedSignal ()
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+ok 13 - signalForwardingOldSyntax(direct)
+# Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+# Signal: SignalSlotClass(_POINTER_) nestedSignal ()
+# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+# Signal: SignalSlotClass(_POINTER_) nestedSignalWithParameters (int(242), char(m))
+# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+# Signal: SignalSlotClass(_POINTER_) nestedSignal ()
+ok 14 - signalForwardingOldSyntax(queued)
+# Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()
+# Signal: SignalSlotClass(_POINTER_) nestedSignal ()
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+ok 15 - slotEmittingSignal(direct)
+# Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+# Signal: SignalSlotClass(_POINTER_) nestedSignal ()
+ok 16 - slotEmittingSignal(queued)
+# Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()
+# Slot: SignalSlotClass(_POINTER_) emitSecondSignal()
+# Signal: SignalSlotClass(_POINTER_) nestedSignal ()
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+ok 17 - slotEmittingSignalOldSyntax(direct)
+# Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+# Signal: SignalSlotClass(_POINTER_) nestedSignal ()
+ok 18 - slotEmittingSignalOldSyntax(queued)
+# Signal: SignalSlotClass(_POINTER_) qStringSignal (QString(Test string))
+# Signal: SignalSlotClass(_POINTER_) qStringRefSignal ((QString&)@_POINTER_)
+# Signal: SignalSlotClass(_POINTER_) qStringConstRefSignal (QString(Test string))
+# Signal: SignalSlotClass(_POINTER_) qByteArraySignal (QByteArray(Test bytearray))
+# Signal: SignalSlotClass(_POINTER_) qListSignal (QList<int>())
+# Signal: SignalSlotClass(_POINTER_) qVectorSignal (QVector<int>())
+# Signal: SignalSlotClass(_POINTER_) qVectorRefSignal ((QVector<int>&)@_POINTER_)
+# Signal: SignalSlotClass(_POINTER_) qVectorConstRefSignal (QVector<int>())
+# Signal: SignalSlotClass(_POINTER_) qVectorConstPointerSignal ((const QVector<int>*)_POINTER_)
+# Signal: SignalSlotClass(_POINTER_) qVectorPointerConstSignal ()
+# Signal: SignalSlotClass(_POINTER_) qVariantSignal (QVariant())
+# Signal: SignalSlotClass(_POINTER_) qVariantSignal (QVariant())
+ok 19 - variousTypes()
+ok 20 - cleanupTestCase()
+# Signal: QThread(_POINTER_) finished ()
+1..20
+# tests 20
+# pass 20
+# fail 0
diff --git a/tests/auto/testlib/selftests/expected_signaldumper.teamcity b/tests/auto/testlib/selftests/expected_signaldumper.teamcity
new file mode 100644
index 0000000000..3b8cf8c54f
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_signaldumper.teamcity
@@ -0,0 +1,61 @@
+##teamcity[testSuiteStarted name='tst_Signaldumper' flowId='tst_Signaldumper']
+##teamcity[testStarted name='initTestCase()' flowId='tst_Signaldumper']
+##teamcity[testStdOut name='initTestCase()' out='INFO: Signal: QThread(_POINTER_) started ()' flowId='tst_Signaldumper']
+##teamcity[testFinished name='initTestCase()' flowId='tst_Signaldumper']
+##teamcity[testStarted name='noConnections()' flowId='tst_Signaldumper']
+##teamcity[testStdOut name='noConnections()' out='INFO: Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))' flowId='tst_Signaldumper']
+##teamcity[testFinished name='noConnections()' flowId='tst_Signaldumper']
+##teamcity[testStarted name='oneSlot(direct)' flowId='tst_Signaldumper']
+##teamcity[testStdOut name='oneSlot(direct)' out='INFO: Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()' flowId='tst_Signaldumper']
+##teamcity[testFinished name='oneSlot(direct)' flowId='tst_Signaldumper']
+##teamcity[testStarted name='oneSlot(queued)' flowId='tst_Signaldumper']
+##teamcity[testStdOut name='oneSlot(queued)' out='INFO: Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()' flowId='tst_Signaldumper']
+##teamcity[testFinished name='oneSlot(queued)' flowId='tst_Signaldumper']
+##teamcity[testStarted name='oneSlotOldSyntax(direct)' flowId='tst_Signaldumper']
+##teamcity[testStdOut name='oneSlotOldSyntax(direct)' out='INFO: Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()|nINFO: Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))|nINFO: Slot: SignalSlotClass(_POINTER_) slotWithParameters(int,char)|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))|nINFO: Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()' flowId='tst_Signaldumper']
+##teamcity[testFinished name='oneSlotOldSyntax(direct)' flowId='tst_Signaldumper']
+##teamcity[testStarted name='oneSlotOldSyntax(queued)' flowId='tst_Signaldumper']
+##teamcity[testStdOut name='oneSlotOldSyntax(queued)' out='INFO: Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()' flowId='tst_Signaldumper']
+##teamcity[testFinished name='oneSlotOldSyntax(queued)' flowId='tst_Signaldumper']
+##teamcity[testStarted name='twoSlots(direct)' flowId='tst_Signaldumper']
+##teamcity[testStdOut name='twoSlots(direct)' out='INFO: Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()' flowId='tst_Signaldumper']
+##teamcity[testFinished name='twoSlots(direct)' flowId='tst_Signaldumper']
+##teamcity[testStarted name='twoSlots(queued)' flowId='tst_Signaldumper']
+##teamcity[testStdOut name='twoSlots(queued)' out='INFO: Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()' flowId='tst_Signaldumper']
+##teamcity[testFinished name='twoSlots(queued)' flowId='tst_Signaldumper']
+##teamcity[testStarted name='twoSlotsOldSyntax(direct)' flowId='tst_Signaldumper']
+##teamcity[testStdOut name='twoSlotsOldSyntax(direct)' out='INFO: Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()|nINFO: Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()|nINFO: Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))|nINFO: Slot: SignalSlotClass(_POINTER_) slotWithParameters(int,char)|nINFO: Slot: SignalSlotClass(_POINTER_) slotWithParameters(int,char)|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))|nINFO: Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()|nINFO: Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()' flowId='tst_Signaldumper']
+##teamcity[testFinished name='twoSlotsOldSyntax(direct)' flowId='tst_Signaldumper']
+##teamcity[testStarted name='twoSlotsOldSyntax(queued)' flowId='tst_Signaldumper']
+##teamcity[testStdOut name='twoSlotsOldSyntax(queued)' out='INFO: Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()' flowId='tst_Signaldumper']
+##teamcity[testFinished name='twoSlotsOldSyntax(queued)' flowId='tst_Signaldumper']
+##teamcity[testStarted name='signalForwarding(direct)' flowId='tst_Signaldumper']
+##teamcity[testStdOut name='signalForwarding(direct)' out='INFO: Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()|nINFO: Signal: SignalSlotClass(_POINTER_) nestedSignal ()|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))|nINFO: Signal: SignalSlotClass(_POINTER_) nestedSignalWithParameters (int(242), char(m))|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))|nINFO: Signal: SignalSlotClass(_POINTER_) nestedSignal ()|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()' flowId='tst_Signaldumper']
+##teamcity[testFinished name='signalForwarding(direct)' flowId='tst_Signaldumper']
+##teamcity[testStarted name='signalForwarding(queued)' flowId='tst_Signaldumper']
+##teamcity[testStdOut name='signalForwarding(queued)' out='INFO: Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) nestedSignal ()|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) nestedSignalWithParameters (int(242), char(m))|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) nestedSignal ()' flowId='tst_Signaldumper']
+##teamcity[testFinished name='signalForwarding(queued)' flowId='tst_Signaldumper']
+##teamcity[testStarted name='signalForwardingOldSyntax(direct)' flowId='tst_Signaldumper']
+##teamcity[testStdOut name='signalForwardingOldSyntax(direct)' out='INFO: Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()|nINFO: Slot: SignalSlotClass(_POINTER_) nestedSignal()|nINFO: Signal: SignalSlotClass(_POINTER_) nestedSignal ()|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))|nINFO: Slot: SignalSlotClass(_POINTER_) nestedSignalWithParameters(int,char)|nINFO: Signal: SignalSlotClass(_POINTER_) nestedSignalWithParameters (int(242), char(m))|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))|nINFO: Slot: SignalSlotClass(_POINTER_) nestedSignal()|nINFO: Signal: SignalSlotClass(_POINTER_) nestedSignal ()|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()' flowId='tst_Signaldumper']
+##teamcity[testFinished name='signalForwardingOldSyntax(direct)' flowId='tst_Signaldumper']
+##teamcity[testStarted name='signalForwardingOldSyntax(queued)' flowId='tst_Signaldumper']
+##teamcity[testStdOut name='signalForwardingOldSyntax(queued)' out='INFO: Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) nestedSignal ()|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) nestedSignalWithParameters (int(242), char(m))|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) nestedSignal ()' flowId='tst_Signaldumper']
+##teamcity[testFinished name='signalForwardingOldSyntax(queued)' flowId='tst_Signaldumper']
+##teamcity[testStarted name='slotEmittingSignal(direct)' flowId='tst_Signaldumper']
+##teamcity[testStdOut name='slotEmittingSignal(direct)' out='INFO: Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()|nINFO: Signal: SignalSlotClass(_POINTER_) nestedSignal ()|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()' flowId='tst_Signaldumper']
+##teamcity[testFinished name='slotEmittingSignal(direct)' flowId='tst_Signaldumper']
+##teamcity[testStarted name='slotEmittingSignal(queued)' flowId='tst_Signaldumper']
+##teamcity[testStdOut name='slotEmittingSignal(queued)' out='INFO: Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) nestedSignal ()' flowId='tst_Signaldumper']
+##teamcity[testFinished name='slotEmittingSignal(queued)' flowId='tst_Signaldumper']
+##teamcity[testStarted name='slotEmittingSignalOldSyntax(direct)' flowId='tst_Signaldumper']
+##teamcity[testStdOut name='slotEmittingSignalOldSyntax(direct)' out='INFO: Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()|nINFO: Slot: SignalSlotClass(_POINTER_) emitSecondSignal()|nINFO: Signal: SignalSlotClass(_POINTER_) nestedSignal ()|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()' flowId='tst_Signaldumper']
+##teamcity[testFinished name='slotEmittingSignalOldSyntax(direct)' flowId='tst_Signaldumper']
+##teamcity[testStarted name='slotEmittingSignalOldSyntax(queued)' flowId='tst_Signaldumper']
+##teamcity[testStdOut name='slotEmittingSignalOldSyntax(queued)' out='INFO: Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) nestedSignal ()' flowId='tst_Signaldumper']
+##teamcity[testFinished name='slotEmittingSignalOldSyntax(queued)' flowId='tst_Signaldumper']
+##teamcity[testStarted name='variousTypes()' flowId='tst_Signaldumper']
+##teamcity[testStdOut name='variousTypes()' out='INFO: Signal: SignalSlotClass(_POINTER_) qStringSignal (QString(Test string))|nINFO: Signal: SignalSlotClass(_POINTER_) qStringRefSignal ((QString&)@_POINTER_)|nINFO: Signal: SignalSlotClass(_POINTER_) qStringConstRefSignal (QString(Test string))|nINFO: Signal: SignalSlotClass(_POINTER_) qByteArraySignal (QByteArray(Test bytearray))|nINFO: Signal: SignalSlotClass(_POINTER_) qListSignal (QList<int>())|nINFO: Signal: SignalSlotClass(_POINTER_) qVectorSignal (QVector<int>())|nINFO: Signal: SignalSlotClass(_POINTER_) qVectorRefSignal ((QVector<int>&)@_POINTER_)|nINFO: Signal: SignalSlotClass(_POINTER_) qVectorConstRefSignal (QVector<int>())|nINFO: Signal: SignalSlotClass(_POINTER_) qVectorConstPointerSignal ((const QVector<int>*)_POINTER_)|nINFO: Signal: SignalSlotClass(_POINTER_) qVectorPointerConstSignal ()|nINFO: Signal: SignalSlotClass(_POINTER_) qVariantSignal (QVariant())|nINFO: Signal: SignalSlotClass(_POINTER_) qVariantSignal (QVariant())' flowId='tst_Signaldumper']
+##teamcity[testFinished name='variousTypes()' flowId='tst_Signaldumper']
+##teamcity[testStarted name='cleanupTestCase()' flowId='tst_Signaldumper']
+##teamcity[testFinished name='cleanupTestCase()' flowId='tst_Signaldumper']
+##teamcity[testSuiteFinished name='tst_Signaldumper' flowId='tst_Signaldumper']
diff --git a/tests/auto/testlib/selftests/expected_signaldumper.txt b/tests/auto/testlib/selftests/expected_signaldumper.txt
new file mode 100644
index 0000000000..f89c31afe5
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_signaldumper.txt
@@ -0,0 +1,149 @@
+********* Start testing of tst_Signaldumper *********
+Config: Using QtTest library
+INFO : tst_Signaldumper::initTestCase() Signal: QThread(_POINTER_) started ()
+PASS : tst_Signaldumper::initTestCase()
+INFO : tst_Signaldumper::noConnections() Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()
+INFO : tst_Signaldumper::noConnections() Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+PASS : tst_Signaldumper::noConnections()
+INFO : tst_Signaldumper::oneSlot(direct) Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()
+INFO : tst_Signaldumper::oneSlot(direct) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+INFO : tst_Signaldumper::oneSlot(direct) Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+INFO : tst_Signaldumper::oneSlot(direct) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+INFO : tst_Signaldumper::oneSlot(direct) Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+INFO : tst_Signaldumper::oneSlot(direct) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+PASS : tst_Signaldumper::oneSlot(direct)
+INFO : tst_Signaldumper::oneSlot(queued) Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()
+INFO : tst_Signaldumper::oneSlot(queued) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+INFO : tst_Signaldumper::oneSlot(queued) Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+INFO : tst_Signaldumper::oneSlot(queued) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+INFO : tst_Signaldumper::oneSlot(queued) Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+INFO : tst_Signaldumper::oneSlot(queued) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+PASS : tst_Signaldumper::oneSlot(queued)
+INFO : tst_Signaldumper::oneSlotOldSyntax(direct) Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()
+INFO : tst_Signaldumper::oneSlotOldSyntax(direct) Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()
+INFO : tst_Signaldumper::oneSlotOldSyntax(direct) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+INFO : tst_Signaldumper::oneSlotOldSyntax(direct) Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+INFO : tst_Signaldumper::oneSlotOldSyntax(direct) Slot: SignalSlotClass(_POINTER_) slotWithParameters(int,char)
+INFO : tst_Signaldumper::oneSlotOldSyntax(direct) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+INFO : tst_Signaldumper::oneSlotOldSyntax(direct) Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+INFO : tst_Signaldumper::oneSlotOldSyntax(direct) Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()
+INFO : tst_Signaldumper::oneSlotOldSyntax(direct) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+PASS : tst_Signaldumper::oneSlotOldSyntax(direct)
+INFO : tst_Signaldumper::oneSlotOldSyntax(queued) Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()
+INFO : tst_Signaldumper::oneSlotOldSyntax(queued) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+INFO : tst_Signaldumper::oneSlotOldSyntax(queued) Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+INFO : tst_Signaldumper::oneSlotOldSyntax(queued) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+INFO : tst_Signaldumper::oneSlotOldSyntax(queued) Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+INFO : tst_Signaldumper::oneSlotOldSyntax(queued) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+PASS : tst_Signaldumper::oneSlotOldSyntax(queued)
+INFO : tst_Signaldumper::twoSlots(direct) Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()
+INFO : tst_Signaldumper::twoSlots(direct) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+INFO : tst_Signaldumper::twoSlots(direct) Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+INFO : tst_Signaldumper::twoSlots(direct) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+INFO : tst_Signaldumper::twoSlots(direct) Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+INFO : tst_Signaldumper::twoSlots(direct) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+PASS : tst_Signaldumper::twoSlots(direct)
+INFO : tst_Signaldumper::twoSlots(queued) Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()
+INFO : tst_Signaldumper::twoSlots(queued) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+INFO : tst_Signaldumper::twoSlots(queued) Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+INFO : tst_Signaldumper::twoSlots(queued) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+INFO : tst_Signaldumper::twoSlots(queued) Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+INFO : tst_Signaldumper::twoSlots(queued) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+PASS : tst_Signaldumper::twoSlots(queued)
+INFO : tst_Signaldumper::twoSlotsOldSyntax(direct) Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()
+INFO : tst_Signaldumper::twoSlotsOldSyntax(direct) Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()
+INFO : tst_Signaldumper::twoSlotsOldSyntax(direct) Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()
+INFO : tst_Signaldumper::twoSlotsOldSyntax(direct) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+INFO : tst_Signaldumper::twoSlotsOldSyntax(direct) Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+INFO : tst_Signaldumper::twoSlotsOldSyntax(direct) Slot: SignalSlotClass(_POINTER_) slotWithParameters(int,char)
+INFO : tst_Signaldumper::twoSlotsOldSyntax(direct) Slot: SignalSlotClass(_POINTER_) slotWithParameters(int,char)
+INFO : tst_Signaldumper::twoSlotsOldSyntax(direct) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+INFO : tst_Signaldumper::twoSlotsOldSyntax(direct) Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+INFO : tst_Signaldumper::twoSlotsOldSyntax(direct) Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()
+INFO : tst_Signaldumper::twoSlotsOldSyntax(direct) Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()
+INFO : tst_Signaldumper::twoSlotsOldSyntax(direct) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+PASS : tst_Signaldumper::twoSlotsOldSyntax(direct)
+INFO : tst_Signaldumper::twoSlotsOldSyntax(queued) Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()
+INFO : tst_Signaldumper::twoSlotsOldSyntax(queued) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+INFO : tst_Signaldumper::twoSlotsOldSyntax(queued) Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+INFO : tst_Signaldumper::twoSlotsOldSyntax(queued) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+INFO : tst_Signaldumper::twoSlotsOldSyntax(queued) Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+INFO : tst_Signaldumper::twoSlotsOldSyntax(queued) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+PASS : tst_Signaldumper::twoSlotsOldSyntax(queued)
+INFO : tst_Signaldumper::signalForwarding(direct) Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()
+INFO : tst_Signaldumper::signalForwarding(direct) Signal: SignalSlotClass(_POINTER_) nestedSignal ()
+INFO : tst_Signaldumper::signalForwarding(direct) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+INFO : tst_Signaldumper::signalForwarding(direct) Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+INFO : tst_Signaldumper::signalForwarding(direct) Signal: SignalSlotClass(_POINTER_) nestedSignalWithParameters (int(242), char(m))
+INFO : tst_Signaldumper::signalForwarding(direct) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+INFO : tst_Signaldumper::signalForwarding(direct) Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+INFO : tst_Signaldumper::signalForwarding(direct) Signal: SignalSlotClass(_POINTER_) nestedSignal ()
+INFO : tst_Signaldumper::signalForwarding(direct) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+PASS : tst_Signaldumper::signalForwarding(direct)
+INFO : tst_Signaldumper::signalForwarding(queued) Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()
+INFO : tst_Signaldumper::signalForwarding(queued) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+INFO : tst_Signaldumper::signalForwarding(queued) Signal: SignalSlotClass(_POINTER_) nestedSignal ()
+INFO : tst_Signaldumper::signalForwarding(queued) Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+INFO : tst_Signaldumper::signalForwarding(queued) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+INFO : tst_Signaldumper::signalForwarding(queued) Signal: SignalSlotClass(_POINTER_) nestedSignalWithParameters (int(242), char(m))
+INFO : tst_Signaldumper::signalForwarding(queued) Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+INFO : tst_Signaldumper::signalForwarding(queued) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+INFO : tst_Signaldumper::signalForwarding(queued) Signal: SignalSlotClass(_POINTER_) nestedSignal ()
+PASS : tst_Signaldumper::signalForwarding(queued)
+INFO : tst_Signaldumper::signalForwardingOldSyntax(direct) Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()
+INFO : tst_Signaldumper::signalForwardingOldSyntax(direct) Slot: SignalSlotClass(_POINTER_) nestedSignal()
+INFO : tst_Signaldumper::signalForwardingOldSyntax(direct) Signal: SignalSlotClass(_POINTER_) nestedSignal ()
+INFO : tst_Signaldumper::signalForwardingOldSyntax(direct) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+INFO : tst_Signaldumper::signalForwardingOldSyntax(direct) Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+INFO : tst_Signaldumper::signalForwardingOldSyntax(direct) Slot: SignalSlotClass(_POINTER_) nestedSignalWithParameters(int,char)
+INFO : tst_Signaldumper::signalForwardingOldSyntax(direct) Signal: SignalSlotClass(_POINTER_) nestedSignalWithParameters (int(242), char(m))
+INFO : tst_Signaldumper::signalForwardingOldSyntax(direct) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+INFO : tst_Signaldumper::signalForwardingOldSyntax(direct) Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+INFO : tst_Signaldumper::signalForwardingOldSyntax(direct) Slot: SignalSlotClass(_POINTER_) nestedSignal()
+INFO : tst_Signaldumper::signalForwardingOldSyntax(direct) Signal: SignalSlotClass(_POINTER_) nestedSignal ()
+INFO : tst_Signaldumper::signalForwardingOldSyntax(direct) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+PASS : tst_Signaldumper::signalForwardingOldSyntax(direct)
+INFO : tst_Signaldumper::signalForwardingOldSyntax(queued) Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()
+INFO : tst_Signaldumper::signalForwardingOldSyntax(queued) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+INFO : tst_Signaldumper::signalForwardingOldSyntax(queued) Signal: SignalSlotClass(_POINTER_) nestedSignal ()
+INFO : tst_Signaldumper::signalForwardingOldSyntax(queued) Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+INFO : tst_Signaldumper::signalForwardingOldSyntax(queued) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+INFO : tst_Signaldumper::signalForwardingOldSyntax(queued) Signal: SignalSlotClass(_POINTER_) nestedSignalWithParameters (int(242), char(m))
+INFO : tst_Signaldumper::signalForwardingOldSyntax(queued) Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+INFO : tst_Signaldumper::signalForwardingOldSyntax(queued) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+INFO : tst_Signaldumper::signalForwardingOldSyntax(queued) Signal: SignalSlotClass(_POINTER_) nestedSignal ()
+PASS : tst_Signaldumper::signalForwardingOldSyntax(queued)
+INFO : tst_Signaldumper::slotEmittingSignal(direct) Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()
+INFO : tst_Signaldumper::slotEmittingSignal(direct) Signal: SignalSlotClass(_POINTER_) nestedSignal ()
+INFO : tst_Signaldumper::slotEmittingSignal(direct) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+PASS : tst_Signaldumper::slotEmittingSignal(direct)
+INFO : tst_Signaldumper::slotEmittingSignal(queued) Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()
+INFO : tst_Signaldumper::slotEmittingSignal(queued) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+INFO : tst_Signaldumper::slotEmittingSignal(queued) Signal: SignalSlotClass(_POINTER_) nestedSignal ()
+PASS : tst_Signaldumper::slotEmittingSignal(queued)
+INFO : tst_Signaldumper::slotEmittingSignalOldSyntax(direct) Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()
+INFO : tst_Signaldumper::slotEmittingSignalOldSyntax(direct) Slot: SignalSlotClass(_POINTER_) emitSecondSignal()
+INFO : tst_Signaldumper::slotEmittingSignalOldSyntax(direct) Signal: SignalSlotClass(_POINTER_) nestedSignal ()
+INFO : tst_Signaldumper::slotEmittingSignalOldSyntax(direct) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+PASS : tst_Signaldumper::slotEmittingSignalOldSyntax(direct)
+INFO : tst_Signaldumper::slotEmittingSignalOldSyntax(queued) Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()
+INFO : tst_Signaldumper::slotEmittingSignalOldSyntax(queued) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+INFO : tst_Signaldumper::slotEmittingSignalOldSyntax(queued) Signal: SignalSlotClass(_POINTER_) nestedSignal ()
+PASS : tst_Signaldumper::slotEmittingSignalOldSyntax(queued)
+INFO : tst_Signaldumper::variousTypes() Signal: SignalSlotClass(_POINTER_) qStringSignal (QString(Test string))
+INFO : tst_Signaldumper::variousTypes() Signal: SignalSlotClass(_POINTER_) qStringRefSignal ((QString&)@_POINTER_)
+INFO : tst_Signaldumper::variousTypes() Signal: SignalSlotClass(_POINTER_) qStringConstRefSignal (QString(Test string))
+INFO : tst_Signaldumper::variousTypes() Signal: SignalSlotClass(_POINTER_) qByteArraySignal (QByteArray(Test bytearray))
+INFO : tst_Signaldumper::variousTypes() Signal: SignalSlotClass(_POINTER_) qListSignal (QList<int>())
+INFO : tst_Signaldumper::variousTypes() Signal: SignalSlotClass(_POINTER_) qVectorSignal (QVector<int>())
+INFO : tst_Signaldumper::variousTypes() Signal: SignalSlotClass(_POINTER_) qVectorRefSignal ((QVector<int>&)@_POINTER_)
+INFO : tst_Signaldumper::variousTypes() Signal: SignalSlotClass(_POINTER_) qVectorConstRefSignal (QVector<int>())
+INFO : tst_Signaldumper::variousTypes() Signal: SignalSlotClass(_POINTER_) qVectorConstPointerSignal ((const QVector<int>*)_POINTER_)
+INFO : tst_Signaldumper::variousTypes() Signal: SignalSlotClass(_POINTER_) qVectorPointerConstSignal ()
+INFO : tst_Signaldumper::variousTypes() Signal: SignalSlotClass(_POINTER_) qVariantSignal (QVariant())
+INFO : tst_Signaldumper::variousTypes() Signal: SignalSlotClass(_POINTER_) qVariantSignal (QVariant())
+PASS : tst_Signaldumper::variousTypes()
+PASS : tst_Signaldumper::cleanupTestCase()
+INFO : tst_Signaldumper::UnknownTestFunc() Signal: QThread(_POINTER_) finished ()
+Totals: 20 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms
+********* Finished testing of tst_Signaldumper *********
diff --git a/tests/auto/testlib/selftests/expected_signaldumper.xml b/tests/auto/testlib/selftests/expected_signaldumper.xml
new file mode 100644
index 0000000000..82959c62df
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_signaldumper.xml
@@ -0,0 +1,581 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<TestCase name="tst_Signaldumper">
+<Environment>
+ <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>
+ <QtBuild/>
+ <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion>
+</Environment>
+<TestFunction name="initTestCase">
+<Message type="info" file="" line="0">
+ <Description><![CDATA[Signal: QThread(_POINTER_) started ()]]></Description>
+</Message>
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="noConnections">
+<Message type="info" file="" line="0">
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="oneSlot">
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+</Incident>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="oneSlotOldSyntax">
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Slot: SignalSlotClass(_POINTER_) slotWithParameters(int,char)]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+</Incident>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="twoSlots">
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+</Incident>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="twoSlotsOldSyntax">
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Slot: SignalSlotClass(_POINTER_) slotWithParameters(int,char)]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Slot: SignalSlotClass(_POINTER_) slotWithParameters(int,char)]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+</Incident>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="signalForwarding">
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Signal: SignalSlotClass(_POINTER_) nestedSignal ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Signal: SignalSlotClass(_POINTER_) nestedSignalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Signal: SignalSlotClass(_POINTER_) nestedSignal ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+</Incident>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) nestedSignal ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) nestedSignalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) nestedSignal ()]]></Description>
+</Message>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="signalForwardingOldSyntax">
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Slot: SignalSlotClass(_POINTER_) nestedSignal()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Signal: SignalSlotClass(_POINTER_) nestedSignal ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Slot: SignalSlotClass(_POINTER_) nestedSignalWithParameters(int,char)]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Signal: SignalSlotClass(_POINTER_) nestedSignalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Slot: SignalSlotClass(_POINTER_) nestedSignal()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Signal: SignalSlotClass(_POINTER_) nestedSignal ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+</Incident>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) nestedSignal ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) nestedSignalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) nestedSignal ()]]></Description>
+</Message>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="slotEmittingSignal">
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Signal: SignalSlotClass(_POINTER_) nestedSignal ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+</Incident>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) nestedSignal ()]]></Description>
+</Message>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="slotEmittingSignalOldSyntax">
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Slot: SignalSlotClass(_POINTER_) emitSecondSignal()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Signal: SignalSlotClass(_POINTER_) nestedSignal ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+</Incident>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) nestedSignal ()]]></Description>
+</Message>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="variousTypes">
+<Message type="info" file="" line="0">
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) qStringSignal (QString(Test string))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) qStringRefSignal ((QString&)@_POINTER_)]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) qStringConstRefSignal (QString(Test string))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) qByteArraySignal (QByteArray(Test bytearray))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) qListSignal (QList<int>())]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) qVectorSignal (QVector<int>())]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) qVectorRefSignal ((QVector<int>&)@_POINTER_)]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) qVectorConstRefSignal (QVector<int>())]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) qVectorConstPointerSignal ((const QVector<int>*)_POINTER_)]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) qVectorPointerConstSignal ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) qVariantSignal (QVariant())]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) qVariantSignal (QVariant())]]></Description>
+</Message>
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="cleanupTestCase">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<Message type="info" file="" line="0">
+ <Description><![CDATA[Signal: QThread(_POINTER_) finished ()]]></Description>
+</Message>
+<Duration msecs="0"/>
+</TestCase>
diff --git a/tests/auto/testlib/selftests/expected_signaldumper.xunitxml b/tests/auto/testlib/selftests/expected_signaldumper.xunitxml
new file mode 100644
index 0000000000..930dc97262
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_signaldumper.xunitxml
@@ -0,0 +1,284 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<testsuite errors="125" failures="0" tests="12" name="tst_Signaldumper">
+ <properties>
+ <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/>
+ <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/>
+ <property value="" name="QtBuild"/>
+ </properties>
+ <testcase result="pass" name="initTestCase">
+ <!-- message="Signal: QThread(_POINTER_) started ()" type="info" -->
+ </testcase>
+ <testcase result="pass" name="noConnections">
+ <!-- message="Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()" type="info" -->
+ <!-- message="Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))" type="info" -->
+ </testcase>
+ <testcase result="pass" name="oneSlot">
+ <!-- tag="direct" message="Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()" type="info" -->
+ <!-- tag="direct" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ <!-- tag="direct" message="Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))" type="info" -->
+ <!-- tag="direct" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ <!-- tag="direct" message="Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))" type="info" -->
+ <!-- tag="direct" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ <!-- tag="queued" message="Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()" type="info" -->
+ <!-- tag="queued" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ <!-- tag="queued" message="Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))" type="info" -->
+ <!-- tag="queued" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ <!-- tag="queued" message="Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))" type="info" -->
+ <!-- tag="queued" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ </testcase>
+ <testcase result="pass" name="oneSlotOldSyntax">
+ <!-- tag="direct" message="Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()" type="info" -->
+ <!-- tag="direct" message=" Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()" type="info" -->
+ <!-- tag="direct" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ <!-- tag="direct" message="Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))" type="info" -->
+ <!-- tag="direct" message=" Slot: SignalSlotClass(_POINTER_) slotWithParameters(int,char)" type="info" -->
+ <!-- tag="direct" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ <!-- tag="direct" message="Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))" type="info" -->
+ <!-- tag="direct" message=" Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()" type="info" -->
+ <!-- tag="direct" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ <!-- tag="queued" message="Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()" type="info" -->
+ <!-- tag="queued" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ <!-- tag="queued" message="Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))" type="info" -->
+ <!-- tag="queued" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ <!-- tag="queued" message="Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))" type="info" -->
+ <!-- tag="queued" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ </testcase>
+ <testcase result="pass" name="twoSlots">
+ <!-- tag="direct" message="Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()" type="info" -->
+ <!-- tag="direct" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ <!-- tag="direct" message="Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))" type="info" -->
+ <!-- tag="direct" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ <!-- tag="direct" message="Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))" type="info" -->
+ <!-- tag="direct" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ <!-- tag="queued" message="Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()" type="info" -->
+ <!-- tag="queued" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ <!-- tag="queued" message="Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))" type="info" -->
+ <!-- tag="queued" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ <!-- tag="queued" message="Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))" type="info" -->
+ <!-- tag="queued" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ </testcase>
+ <testcase result="pass" name="twoSlotsOldSyntax">
+ <!-- tag="direct" message="Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()" type="info" -->
+ <!-- tag="direct" message=" Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()" type="info" -->
+ <!-- tag="direct" message=" Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()" type="info" -->
+ <!-- tag="direct" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ <!-- tag="direct" message="Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))" type="info" -->
+ <!-- tag="direct" message=" Slot: SignalSlotClass(_POINTER_) slotWithParameters(int,char)" type="info" -->
+ <!-- tag="direct" message=" Slot: SignalSlotClass(_POINTER_) slotWithParameters(int,char)" type="info" -->
+ <!-- tag="direct" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ <!-- tag="direct" message="Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))" type="info" -->
+ <!-- tag="direct" message=" Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()" type="info" -->
+ <!-- tag="direct" message=" Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()" type="info" -->
+ <!-- tag="direct" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ <!-- tag="queued" message="Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()" type="info" -->
+ <!-- tag="queued" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ <!-- tag="queued" message="Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))" type="info" -->
+ <!-- tag="queued" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ <!-- tag="queued" message="Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))" type="info" -->
+ <!-- tag="queued" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ </testcase>
+ <testcase result="pass" name="signalForwarding">
+ <!-- tag="direct" message="Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()" type="info" -->
+ <!-- tag="direct" message=" Signal: SignalSlotClass(_POINTER_) nestedSignal ()" type="info" -->
+ <!-- tag="direct" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ <!-- tag="direct" message="Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))" type="info" -->
+ <!-- tag="direct" message=" Signal: SignalSlotClass(_POINTER_) nestedSignalWithParameters (int(242), char(m))" type="info" -->
+ <!-- tag="direct" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ <!-- tag="direct" message="Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))" type="info" -->
+ <!-- tag="direct" message=" Signal: SignalSlotClass(_POINTER_) nestedSignal ()" type="info" -->
+ <!-- tag="direct" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ <!-- tag="queued" message="Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()" type="info" -->
+ <!-- tag="queued" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ <!-- tag="queued" message="Signal: SignalSlotClass(_POINTER_) nestedSignal ()" type="info" -->
+ <!-- tag="queued" message="Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))" type="info" -->
+ <!-- tag="queued" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ <!-- tag="queued" message="Signal: SignalSlotClass(_POINTER_) nestedSignalWithParameters (int(242), char(m))" type="info" -->
+ <!-- tag="queued" message="Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))" type="info" -->
+ <!-- tag="queued" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ <!-- tag="queued" message="Signal: SignalSlotClass(_POINTER_) nestedSignal ()" type="info" -->
+ </testcase>
+ <testcase result="pass" name="signalForwardingOldSyntax">
+ <!-- tag="direct" message="Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()" type="info" -->
+ <!-- tag="direct" message=" Slot: SignalSlotClass(_POINTER_) nestedSignal()" type="info" -->
+ <!-- tag="direct" message=" Signal: SignalSlotClass(_POINTER_) nestedSignal ()" type="info" -->
+ <!-- tag="direct" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ <!-- tag="direct" message="Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))" type="info" -->
+ <!-- tag="direct" message=" Slot: SignalSlotClass(_POINTER_) nestedSignalWithParameters(int,char)" type="info" -->
+ <!-- tag="direct" message=" Signal: SignalSlotClass(_POINTER_) nestedSignalWithParameters (int(242), char(m))" type="info" -->
+ <!-- tag="direct" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ <!-- tag="direct" message="Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))" type="info" -->
+ <!-- tag="direct" message=" Slot: SignalSlotClass(_POINTER_) nestedSignal()" type="info" -->
+ <!-- tag="direct" message=" Signal: SignalSlotClass(_POINTER_) nestedSignal ()" type="info" -->
+ <!-- tag="direct" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ <!-- tag="queued" message="Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()" type="info" -->
+ <!-- tag="queued" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ <!-- tag="queued" message="Signal: SignalSlotClass(_POINTER_) nestedSignal ()" type="info" -->
+ <!-- tag="queued" message="Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))" type="info" -->
+ <!-- tag="queued" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ <!-- tag="queued" message="Signal: SignalSlotClass(_POINTER_) nestedSignalWithParameters (int(242), char(m))" type="info" -->
+ <!-- tag="queued" message="Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))" type="info" -->
+ <!-- tag="queued" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ <!-- tag="queued" message="Signal: SignalSlotClass(_POINTER_) nestedSignal ()" type="info" -->
+ </testcase>
+ <testcase result="pass" name="slotEmittingSignal">
+ <!-- tag="direct" message="Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()" type="info" -->
+ <!-- tag="direct" message=" Signal: SignalSlotClass(_POINTER_) nestedSignal ()" type="info" -->
+ <!-- tag="direct" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ <!-- tag="queued" message="Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()" type="info" -->
+ <!-- tag="queued" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ <!-- tag="queued" message="Signal: SignalSlotClass(_POINTER_) nestedSignal ()" type="info" -->
+ </testcase>
+ <testcase result="pass" name="slotEmittingSignalOldSyntax">
+ <!-- tag="direct" message="Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()" type="info" -->
+ <!-- tag="direct" message=" Slot: SignalSlotClass(_POINTER_) emitSecondSignal()" type="info" -->
+ <!-- tag="direct" message=" Signal: SignalSlotClass(_POINTER_) nestedSignal ()" type="info" -->
+ <!-- tag="direct" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ <!-- tag="queued" message="Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()" type="info" -->
+ <!-- tag="queued" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ <!-- tag="queued" message="Signal: SignalSlotClass(_POINTER_) nestedSignal ()" type="info" -->
+ </testcase>
+ <testcase result="pass" name="variousTypes">
+ <!-- message="Signal: SignalSlotClass(_POINTER_) qStringSignal (QString(Test string))" type="info" -->
+ <!-- message="Signal: SignalSlotClass(_POINTER_) qStringRefSignal ((QString&amp;)@_POINTER_)" type="info" -->
+ <!-- message="Signal: SignalSlotClass(_POINTER_) qStringConstRefSignal (QString(Test string))" type="info" -->
+ <!-- message="Signal: SignalSlotClass(_POINTER_) qByteArraySignal (QByteArray(Test bytearray))" type="info" -->
+ <!-- message="Signal: SignalSlotClass(_POINTER_) qListSignal (QList&lt;int&gt;())" type="info" -->
+ <!-- message="Signal: SignalSlotClass(_POINTER_) qVectorSignal (QVector&lt;int&gt;())" type="info" -->
+ <!-- message="Signal: SignalSlotClass(_POINTER_) qVectorRefSignal ((QVector&lt;int&gt;&amp;)@_POINTER_)" type="info" -->
+ <!-- message="Signal: SignalSlotClass(_POINTER_) qVectorConstRefSignal (QVector&lt;int&gt;())" type="info" -->
+ <!-- message="Signal: SignalSlotClass(_POINTER_) qVectorConstPointerSignal ((const QVector&lt;int&gt;*)_POINTER_)" type="info" -->
+ <!-- message="Signal: SignalSlotClass(_POINTER_) qVectorPointerConstSignal ()" type="info" -->
+ <!-- message="Signal: SignalSlotClass(_POINTER_) qVariantSignal (QVariant())" type="info" -->
+ <!-- message="Signal: SignalSlotClass(_POINTER_) qVariantSignal (QVariant())" type="info" -->
+ </testcase>
+ <testcase result="pass" name="cleanupTestCase">
+ <!-- message="Signal: QThread(_POINTER_) finished ()" type="info" -->
+ </testcase>
+ <system-err>
+<![CDATA[Signal: QThread(_POINTER_) started ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]>
+<![CDATA[ Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]>
+<![CDATA[ Slot: SignalSlotClass(_POINTER_) slotWithParameters(int,char)]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]>
+<![CDATA[ Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]>
+<![CDATA[ Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()]]>
+<![CDATA[ Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]>
+<![CDATA[ Slot: SignalSlotClass(_POINTER_) slotWithParameters(int,char)]]>
+<![CDATA[ Slot: SignalSlotClass(_POINTER_) slotWithParameters(int,char)]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]>
+<![CDATA[ Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()]]>
+<![CDATA[ Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]>
+<![CDATA[ Signal: SignalSlotClass(_POINTER_) nestedSignal ()]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]>
+<![CDATA[ Signal: SignalSlotClass(_POINTER_) nestedSignalWithParameters (int(242), char(m))]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]>
+<![CDATA[ Signal: SignalSlotClass(_POINTER_) nestedSignal ()]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) nestedSignal ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) nestedSignalWithParameters (int(242), char(m))]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) nestedSignal ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]>
+<![CDATA[ Slot: SignalSlotClass(_POINTER_) nestedSignal()]]>
+<![CDATA[ Signal: SignalSlotClass(_POINTER_) nestedSignal ()]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]>
+<![CDATA[ Slot: SignalSlotClass(_POINTER_) nestedSignalWithParameters(int,char)]]>
+<![CDATA[ Signal: SignalSlotClass(_POINTER_) nestedSignalWithParameters (int(242), char(m))]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]>
+<![CDATA[ Slot: SignalSlotClass(_POINTER_) nestedSignal()]]>
+<![CDATA[ Signal: SignalSlotClass(_POINTER_) nestedSignal ()]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) nestedSignal ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) nestedSignalWithParameters (int(242), char(m))]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) nestedSignal ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]>
+<![CDATA[ Signal: SignalSlotClass(_POINTER_) nestedSignal ()]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) nestedSignal ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]>
+<![CDATA[ Slot: SignalSlotClass(_POINTER_) emitSecondSignal()]]>
+<![CDATA[ Signal: SignalSlotClass(_POINTER_) nestedSignal ()]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) nestedSignal ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) qStringSignal (QString(Test string))]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) qStringRefSignal ((QString&)@_POINTER_)]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) qStringConstRefSignal (QString(Test string))]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) qByteArraySignal (QByteArray(Test bytearray))]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) qListSignal (QList<int>())]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) qVectorSignal (QVector<int>())]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) qVectorRefSignal ((QVector<int>&)@_POINTER_)]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) qVectorConstRefSignal (QVector<int>())]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) qVectorConstPointerSignal ((const QVector<int>*)_POINTER_)]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) qVectorPointerConstSignal ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) qVariantSignal (QVariant())]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) qVariantSignal (QVariant())]]>
+<![CDATA[Signal: QThread(_POINTER_) finished ()]]>
+ </system-err>
+</testsuite>
diff --git a/tests/auto/testlib/selftests/generate_expected_output.py b/tests/auto/testlib/selftests/generate_expected_output.py
index 9ec87c8fc6..48ecbf0289 100755
--- a/tests/auto/testlib/selftests/generate_expected_output.py
+++ b/tests/auto/testlib/selftests/generate_expected_output.py
@@ -92,6 +92,17 @@ class Cleaner (object):
(r'(Loc: \[[^[\]()]+)\(\d+\)', r'\1(0)'), # txt
(r'(\[Loc: [^[\]()]+)\(\d+\)', r'\1(0)'), # teamcity
(r'(<(?:Incident|Message)\b.*\bfile=.*\bline=)"\d+"', r'\1"0"'), # lightxml, xml
+ # Pointers printed by signal dumper:
+ (r'\(\b[a-f0-9]{8,}\b\)', r'(_POINTER_)'),
+ # Example/for reference:
+ # ((QString&)@55f5fbb8dd40)
+ # ((const QVector<int>*)7ffd671d4558)
+ (r'\((\((?:const )?\w+(?:<[^>]+>)?[*&]*\)@?)\b[a-f\d]{8,}\b\)', r'(\1_POINTER_)'),
+ # For xml output there is no '<', '>' or '&', so we need an alternate version for that:
+ # ((QVector&lt;int&gt;&amp;)@5608b455e640)
+ (r'\((\((?:const )?\w+(?:&lt;(?:[^&]|&(?!gt;))*&gt;)?(?:\*|&amp;)?\)@?)[a-z\d]+\b\)', r'(\1_POINTER_)'),
+ # QEventDispatcher{Glib,Win32,etc.}
+ (r'\bQEventDispatcher\w+\b', r'QEventDispatcherPlatform'),
),
precook = re.compile):
"""Private implementation details of __init__()."""
@@ -296,6 +307,7 @@ def generateTestData(testname, clean,
"benchlibcounting": "-eventcounter",
"printdatatags": "-datatags",
"printdatatagswithglobaltags": "-datatags",
+ "signaldumper": "-vs",
"silent": "-silent",
"verbose1": "-v1",
"verbose2": "-v2",
diff --git a/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp b/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp
index 6c0ae1f43c..3c5c2c8f37 100644
--- a/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp
+++ b/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp
@@ -66,9 +66,10 @@ void tst_globaldata::initTestCase()
void tst_globaldata::initTestCase_data()
{
- QTest::addColumn<bool>("booli");
- QTest::newRow("1") << false;
- QTest::newRow("2") << true;
+ // QFETCH_GLOBAL shall iterate these, for every test:
+ QTest::addColumn<bool>("global");
+ QTest::newRow("global=false") << false;
+ QTest::newRow("global=true") << true;
}
void tst_globaldata::cleanupTestCase()
@@ -94,41 +95,42 @@ void tst_globaldata::cleanup()
void tst_globaldata::testGlobal_data()
{
- QTest::addColumn<bool>("booll");
- QTest::newRow("local 1") << false;
- QTest::newRow("local 2") << true;
+ QTest::addColumn<bool>("local");
+ QTest::newRow("local=false") << false;
+ QTest::newRow("local=true") << true;
}
void tst_globaldata::testGlobal()
{
- QFETCH_GLOBAL(bool, booli);
- qDebug() << "global:" << booli;
- QFETCH(bool, booll);
- qDebug() << "local:" << booll;
+ QFETCH_GLOBAL(bool, global);
+ qDebug() << "global:" << global;
+ QFETCH(bool, local);
+ qDebug() << "local:" << local;
}
void tst_globaldata::skip_data()
{
- QTest::addColumn<bool>("booll");
- QTest::newRow("local 1") << false;
- QTest::newRow("local 2") << true;
-
+ testGlobal_data();
QSKIP("skipping");
}
void tst_globaldata::skip()
{
- qDebug() << "this line should never be reached";
+ // A skip in _data() causes the whole test to be skipped, for all global rows.
+ QVERIFY(!"This line should never be reached.");
}
void tst_globaldata::skipSingle()
{
- QFETCH_GLOBAL(bool, booli);
- QFETCH(bool, booll);
-
- if (booli && !booll)
- QSKIP("skipping");
- qDebug() << "global:" << booli << "local:" << booll;
+ QFETCH_GLOBAL(bool, global);
+ QFETCH(bool, local);
+
+ // A skip in the last run of one global row used to suppress the test in the
+ // next global row (where a skip in an earlier run of the first row did not).
+ if (global ^ local)
+ QSKIP("Skipping");
+ qDebug() << "global:" << global << "local:" << local;
+ QCOMPARE(global, local);
}
void tst_globaldata::skipLocal()
diff --git a/tests/auto/testlib/selftests/selftests.pri b/tests/auto/testlib/selftests/selftests.pri
index 57b41bb5fc..2cad0b7e17 100644
--- a/tests/auto/testlib/selftests/selftests.pri
+++ b/tests/auto/testlib/selftests/selftests.pri
@@ -36,6 +36,7 @@ SUBPROGRAMS = \
printdatatagswithglobaltags \
qexecstringlist \
silent \
+ signaldumper \
singleskip \
skip \
skipcleanup \
diff --git a/tests/auto/testlib/selftests/signaldumper/signaldumper.pro b/tests/auto/testlib/selftests/signaldumper/signaldumper.pro
new file mode 100644
index 0000000000..8780b18419
--- /dev/null
+++ b/tests/auto/testlib/selftests/signaldumper/signaldumper.pro
@@ -0,0 +1,9 @@
+SOURCES += tst_signaldumper.cpp
+QT = core testlib-private
+
+macos:CONFIG -= app_bundle
+CONFIG -= debug_and_release_target
+
+TARGET = signaldumper
+
+include($$QT_SOURCE_TREE/src/testlib/selfcover.pri)
diff --git a/tests/auto/testlib/selftests/signaldumper/tst_signaldumper.cpp b/tests/auto/testlib/selftests/signaldumper/tst_signaldumper.cpp
new file mode 100644
index 0000000000..f6cd0d510e
--- /dev/null
+++ b/tests/auto/testlib/selftests/signaldumper/tst_signaldumper.cpp
@@ -0,0 +1,417 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtCore/QCoreApplication>
+#include <QtTest/QtTest>
+#include <private/qtestlog_p.h>
+
+class tst_Signaldumper : public QObject
+{
+ Q_OBJECT
+
+ void addConnectionTypeData();
+
+private slots:
+ void noConnections();
+ void oneSlot_data();
+ void oneSlot();
+ void oneSlotOldSyntax_data();
+ void oneSlotOldSyntax();
+ void twoSlots_data();
+ void twoSlots();
+ void twoSlotsOldSyntax_data();
+ void twoSlotsOldSyntax();
+ void signalForwarding_data();
+ void signalForwarding();
+ void signalForwardingOldSyntax_data();
+ void signalForwardingOldSyntax();
+ void slotEmittingSignal_data();
+ void slotEmittingSignal();
+ void slotEmittingSignalOldSyntax_data();
+ void slotEmittingSignalOldSyntax();
+
+ void variousTypes();
+};
+
+void tst_Signaldumper::addConnectionTypeData()
+{
+ QTest::addColumn<Qt::ConnectionType>("connectionType");
+ QTest::newRow("direct") << Qt::ConnectionType::DirectConnection;
+ QTest::newRow("queued") << Qt::ConnectionType::QueuedConnection;
+}
+
+/*
+ Simple class to keep the slots and signals separate from the test
+*/
+class SignalSlotClass : public QObject
+{
+ Q_OBJECT
+
+public:
+ SignalSlotClass();
+
+public slots:
+ void slotWithoutParameters() {}
+ void slotWithParameters(int i, char c) { Q_UNUSED(i); Q_UNUSED(c); }
+ void emitSecondSignal() { emit nestedSignal(); }
+
+signals:
+ void signalWithoutParameters();
+ void signalWithParameters(int i, char c);
+
+ void nestedSignal();
+ void nestedSignalWithParameters(int i, char c);
+
+ // For the "variousTypes" test
+ void qStringSignal(QString string);
+ void qStringRefSignal(QString &string);
+ void qStringConstRefSignal(const QString &string);
+ void qByteArraySignal(QByteArray byteArray);
+ void qListSignal(QList<int> list);
+ void qVectorSignal(QVector<int> vector);
+ void qVectorRefSignal(QVector<int> &vector);
+ void qVectorConstRefSignal(const QVector<int> &vector);
+ void qVectorConstPointerSignal(const QVector<int> *vector);
+ void qVectorPointerConstSignal(QVector<int> *const vector);
+ void qVariantSignal(QVariant variant);
+};
+
+SignalSlotClass::SignalSlotClass()
+{
+ // For printing signal argument in "variousTypes" test
+ qRegisterMetaType<QVector<int>>();
+ qRegisterMetaType<QList<int>>();
+}
+
+void tst_Signaldumper::noConnections()
+{
+ SignalSlotClass signalSlotOwner;
+
+ emit signalSlotOwner.signalWithoutParameters();
+ emit signalSlotOwner.signalWithParameters(242, 'm');
+}
+
+void tst_Signaldumper::oneSlot_data()
+{
+ addConnectionTypeData();
+}
+
+void tst_Signaldumper::oneSlot()
+{
+ QFETCH(Qt::ConnectionType, connectionType);
+
+ SignalSlotClass signalSlotOwner;
+ // parameterless to parameterless
+ auto connection = connect(&signalSlotOwner, &SignalSlotClass::signalWithoutParameters,
+ &signalSlotOwner, &SignalSlotClass::slotWithoutParameters, connectionType);
+ emit signalSlotOwner.signalWithoutParameters();
+
+ QCoreApplication::processEvents();
+ disconnect(connection);
+
+ // parameters to parameters
+ connection = connect(&signalSlotOwner, &SignalSlotClass::signalWithParameters,
+ &signalSlotOwner, &SignalSlotClass::slotWithParameters, connectionType);
+ emit signalSlotOwner.signalWithParameters(242, 'm');
+
+ QCoreApplication::processEvents();
+ disconnect(connection);
+
+ // parameters to no parameters
+ connection = connect(&signalSlotOwner, &SignalSlotClass::signalWithParameters,
+ &signalSlotOwner, &SignalSlotClass::slotWithoutParameters, connectionType);
+ emit signalSlotOwner.signalWithParameters(242, 'm');
+
+ QCoreApplication::processEvents();
+ disconnect(connection);
+}
+
+void tst_Signaldumper::oneSlotOldSyntax_data()
+{
+ addConnectionTypeData();
+}
+
+void tst_Signaldumper::oneSlotOldSyntax()
+{
+ QFETCH(Qt::ConnectionType, connectionType);
+
+ SignalSlotClass signalSlotOwner;
+ // parameterless to parameterless
+ auto connection = connect(&signalSlotOwner, SIGNAL(signalWithoutParameters()),
+ &signalSlotOwner, SLOT(slotWithoutParameters()), connectionType);
+ emit signalSlotOwner.signalWithoutParameters();
+
+ QCoreApplication::processEvents();
+ disconnect(connection);
+
+ // parameters to parameters
+ connection = connect(&signalSlotOwner, SIGNAL(signalWithParameters(int, char)),
+ &signalSlotOwner, SLOT(slotWithParameters(int, char)), connectionType);
+ emit signalSlotOwner.signalWithParameters(242, 'm');
+
+ QCoreApplication::processEvents();
+ disconnect(connection);
+
+ // parameters to no parameters
+ connection = connect(&signalSlotOwner, SIGNAL(signalWithParameters(int, char)),
+ &signalSlotOwner, SLOT(slotWithoutParameters()), connectionType);
+ emit signalSlotOwner.signalWithParameters(242, 'm');
+
+ QCoreApplication::processEvents();
+ disconnect(connection);
+}
+
+void tst_Signaldumper::twoSlots_data()
+{
+ addConnectionTypeData();
+}
+
+void tst_Signaldumper::twoSlots()
+{
+ QFETCH(Qt::ConnectionType, connectionType);
+
+ // Now, instead of creating two slots or two objects, we will just do the same connection twice.
+ // The same slot will then be invoked twice.
+
+ SignalSlotClass signalSlotOwner;
+ // parameterless to parameterless
+ auto connection = connect(&signalSlotOwner, &SignalSlotClass::signalWithoutParameters,
+ &signalSlotOwner, &SignalSlotClass::slotWithoutParameters, connectionType);
+ auto connection2 = connect(&signalSlotOwner, &SignalSlotClass::signalWithoutParameters,
+ &signalSlotOwner, &SignalSlotClass::slotWithoutParameters, connectionType);
+ emit signalSlotOwner.signalWithoutParameters();
+
+ QCoreApplication::processEvents();
+ disconnect(connection);
+ disconnect(connection2);
+
+ // parameters to parameters
+ connection = connect(&signalSlotOwner, &SignalSlotClass::signalWithParameters,
+ &signalSlotOwner, &SignalSlotClass::slotWithParameters, connectionType);
+ connection2 = connect(&signalSlotOwner, &SignalSlotClass::signalWithParameters,
+ &signalSlotOwner, &SignalSlotClass::slotWithParameters, connectionType);
+ emit signalSlotOwner.signalWithParameters(242, 'm');
+
+ QCoreApplication::processEvents();
+ disconnect(connection);
+ disconnect(connection2);
+
+ // parameters to no parameters
+ connection = connect(&signalSlotOwner, &SignalSlotClass::signalWithParameters,
+ &signalSlotOwner, &SignalSlotClass::slotWithoutParameters, connectionType);
+ connection2 = connect(&signalSlotOwner, &SignalSlotClass::signalWithParameters,
+ &signalSlotOwner, &SignalSlotClass::slotWithoutParameters, connectionType);
+ emit signalSlotOwner.signalWithParameters(242, 'm');
+
+ QCoreApplication::processEvents();
+ disconnect(connection);
+ disconnect(connection2);
+}
+
+void tst_Signaldumper::twoSlotsOldSyntax_data()
+{
+ addConnectionTypeData();
+}
+
+void tst_Signaldumper::twoSlotsOldSyntax()
+{
+ QFETCH(Qt::ConnectionType, connectionType);
+
+ // Now, instead of creating two slots or two objects, we will just do the same connection twice.
+ // The same slot will then be invoked twice.
+
+ SignalSlotClass signalSlotOwner;
+ // parameterless to parameterless
+ auto connection = connect(&signalSlotOwner, SIGNAL(signalWithoutParameters()),
+ &signalSlotOwner, SLOT(slotWithoutParameters()), connectionType);
+ auto connection2 = connect(&signalSlotOwner, SIGNAL(signalWithoutParameters()),
+ &signalSlotOwner, SLOT(slotWithoutParameters()), connectionType);
+ emit signalSlotOwner.signalWithoutParameters();
+
+ QCoreApplication::processEvents();
+ disconnect(connection);
+ disconnect(connection2);
+
+ // parameters to parameters
+ connection = connect(&signalSlotOwner, SIGNAL(signalWithParameters(int, char)),
+ &signalSlotOwner, SLOT(slotWithParameters(int, char)), connectionType);
+ connection2 = connect(&signalSlotOwner, SIGNAL(signalWithParameters(int, char)),
+ &signalSlotOwner, SLOT(slotWithParameters(int, char)), connectionType);
+ emit signalSlotOwner.signalWithParameters(242, 'm');
+
+ QCoreApplication::processEvents();
+ disconnect(connection);
+ disconnect(connection2);
+
+ // parameters to no parameters
+ connection = connect(&signalSlotOwner, SIGNAL(signalWithParameters(int, char)),
+ &signalSlotOwner, SLOT(slotWithoutParameters()), connectionType);
+ connection2 = connect(&signalSlotOwner, SIGNAL(signalWithParameters(int, char)),
+ &signalSlotOwner, SLOT(slotWithoutParameters()), connectionType);
+ emit signalSlotOwner.signalWithParameters(242, 'm');
+
+ QCoreApplication::processEvents();
+ disconnect(connection);
+ disconnect(connection2);
+}
+
+void tst_Signaldumper::signalForwarding_data()
+{
+ addConnectionTypeData();
+}
+
+void tst_Signaldumper::signalForwarding()
+{
+ QFETCH(Qt::ConnectionType, connectionType);
+
+ SignalSlotClass signalSlotOwner;
+
+ // parameterless signal to parameterless signal
+ auto connection = connect(&signalSlotOwner, &SignalSlotClass::signalWithoutParameters,
+ &signalSlotOwner, &SignalSlotClass::nestedSignal, connectionType);
+ emit signalSlotOwner.signalWithoutParameters();
+
+ QCoreApplication::processEvents();
+ disconnect(connection);
+
+ // parameter(full) signal to parameter(full) signal
+ connection = connect(&signalSlotOwner, &SignalSlotClass::signalWithParameters,
+ &signalSlotOwner, &SignalSlotClass::nestedSignalWithParameters, connectionType);
+ emit signalSlotOwner.signalWithParameters(242, 'm');
+
+ QCoreApplication::processEvents();
+ disconnect(connection);
+
+ // parameter(full) signal to parameterless signal
+ connection = connect(&signalSlotOwner, &SignalSlotClass::signalWithParameters,
+ &signalSlotOwner, &SignalSlotClass::nestedSignal, connectionType);
+ emit signalSlotOwner.signalWithParameters(242, 'm');
+
+ QCoreApplication::processEvents();
+ disconnect(connection);
+}
+
+void tst_Signaldumper::signalForwardingOldSyntax_data()
+{
+ addConnectionTypeData();
+}
+
+void tst_Signaldumper::signalForwardingOldSyntax()
+{
+ QFETCH(Qt::ConnectionType, connectionType);
+
+ SignalSlotClass signalSlotOwner;
+
+ // parameterless signal to parameterless signal
+ auto connection = connect(&signalSlotOwner, SIGNAL(signalWithoutParameters()),
+ &signalSlotOwner, SIGNAL(nestedSignal()), connectionType);
+ emit signalSlotOwner.signalWithoutParameters();
+
+ QCoreApplication::processEvents();
+ disconnect(connection);
+
+ // parameter(full) signal to parameter(full) signal
+ connection = connect(&signalSlotOwner, SIGNAL(signalWithParameters(int, char)),
+ &signalSlotOwner, SIGNAL(nestedSignalWithParameters(int, char)), connectionType);
+ emit signalSlotOwner.signalWithParameters(242, 'm');
+
+ QCoreApplication::processEvents();
+ disconnect(connection);
+
+ // parameter(full) signal to parameterless signal
+ connection = connect(&signalSlotOwner, SIGNAL(signalWithParameters(int, char)),
+ &signalSlotOwner, SIGNAL(nestedSignal()), connectionType);
+ emit signalSlotOwner.signalWithParameters(242, 'm');
+
+ QCoreApplication::processEvents();
+ disconnect(connection);
+}
+
+void tst_Signaldumper::slotEmittingSignal_data()
+{
+ addConnectionTypeData();
+}
+
+void tst_Signaldumper::slotEmittingSignal()
+{
+ QFETCH(Qt::ConnectionType, connectionType);
+
+ SignalSlotClass signalSlotOwner;
+
+ auto connection = connect(&signalSlotOwner, &SignalSlotClass::signalWithoutParameters,
+ &signalSlotOwner, &SignalSlotClass::emitSecondSignal, connectionType);
+ emit signalSlotOwner.signalWithoutParameters();
+ QCoreApplication::processEvents();
+ disconnect(connection);
+}
+
+void tst_Signaldumper::slotEmittingSignalOldSyntax_data()
+{
+ addConnectionTypeData();
+}
+
+void tst_Signaldumper::slotEmittingSignalOldSyntax()
+{
+ QFETCH(Qt::ConnectionType, connectionType);
+
+ SignalSlotClass signalSlotOwner;
+
+ auto connection = connect(&signalSlotOwner, SIGNAL(signalWithoutParameters()),
+ &signalSlotOwner, SLOT(emitSecondSignal()), connectionType);
+ emit signalSlotOwner.signalWithoutParameters();
+ QCoreApplication::processEvents();
+ disconnect(connection);
+}
+
+void tst_Signaldumper::variousTypes()
+{
+ SignalSlotClass signalSlotOwner;
+ QString string = QString::fromLatin1("Test string");
+ emit signalSlotOwner.qStringSignal(string);
+ emit signalSlotOwner.qStringRefSignal(string);
+ emit signalSlotOwner.qStringConstRefSignal(string);
+ emit signalSlotOwner.qByteArraySignal(QByteArray("Test bytearray"));
+
+ QList<int> list{1, 2, 3, 242};
+ emit signalSlotOwner.qListSignal(list);
+
+ QVector<int> vector{1, 2, 3, 242};
+ emit signalSlotOwner.qVectorSignal(vector);
+ emit signalSlotOwner.qVectorRefSignal(vector);
+ emit signalSlotOwner.qVectorConstRefSignal(vector);
+ emit signalSlotOwner.qVectorConstPointerSignal(&vector);
+ emit signalSlotOwner.qVectorPointerConstSignal(&vector);
+
+ QVariant variant = 24;
+ emit signalSlotOwner.qVariantSignal(variant);
+ variant = QVariant(string);
+ emit signalSlotOwner.qVariantSignal(variant);
+}
+
+QTEST_MAIN(tst_Signaldumper)
+#include "tst_signaldumper.moc"
diff --git a/tests/auto/testlib/selftests/tst_selftests.cpp b/tests/auto/testlib/selftests/tst_selftests.cpp
index 3a242d0493..1326b96177 100644
--- a/tests/auto/testlib/selftests/tst_selftests.cpp
+++ b/tests/auto/testlib/selftests/tst_selftests.cpp
@@ -487,6 +487,7 @@ void tst_Selftests::runSubTest_data()
<< "printdatatags"
<< "printdatatagswithglobaltags"
<< "qexecstringlist"
+ << "signaldumper"
<< "silent"
<< "singleskip"
<< "skip"
@@ -552,6 +553,9 @@ void tst_Selftests::runSubTest_data()
else if (subtest == "printdatatagswithglobaltags") {
arguments << "-datatags";
}
+ else if (subtest == "signaldumper") {
+ arguments << "-vs";
+ }
else if (subtest == "silent") {
arguments << "-silent";
}
@@ -952,6 +956,29 @@ bool tst_Selftests::compareLine(const QString &logger, const QString &subdir,
if (actualLine.startsWith(QLatin1String("Totals:")) && expectedLine.startsWith(QLatin1String("Totals:")))
return true;
+ const QLatin1String pointerPlaceholder("_POINTER_");
+ if (expectedLine.contains(pointerPlaceholder)
+ && (expectedLine.contains(QLatin1String("Signal: "))
+ || expectedLine.contains(QLatin1String("Slot: ")))) {
+ QString actual = actualLine;
+ // We don't care about the pointer of the object to whom the signal belongs, so we
+ // replace it with _POINTER_, e.g.:
+ // Signal: SignalSlotClass(7ffd72245410) signalWithoutParameters ()
+ // Signal: QThread(7ffd72245410) started ()
+ // After this instance pointer we may have further pointers and
+ // references (with an @ prefix) as parameters of the signal or
+ // slot being invoked.
+ // Signal: SignalSlotClass(_POINTER_) qStringRefSignal ((QString&)@55f5fbb8dd40)
+ actual.replace(QRegularExpression("\\b[a-f0-9]{8,}\\b"), pointerPlaceholder);
+ // Also change QEventDispatcher{Glib,Win32,etc.} to QEventDispatcherPlatform
+ actual.replace(QRegularExpression("\\b(QEventDispatcher)\\w+\\b"), QLatin1String("\\1Platform"));
+ if (actual != expectedLine) {
+ *errorMessage = msgMismatch(actual, expectedLine);
+ return false;
+ }
+ return true;
+ }
+
*errorMessage = msgMismatch(actualLine, expectedLine);
return false;
}
diff --git a/tests/auto/tools/qmake/testcompiler.cpp b/tests/auto/tools/qmake/testcompiler.cpp
index da76b3f2ca..0a7ba3b40b 100644
--- a/tests/auto/tools/qmake/testcompiler.cpp
+++ b/tests/auto/tools/qmake/testcompiler.cpp
@@ -31,7 +31,7 @@
#include <QProcess>
#include <QDir>
-static QString targetName( BuildType buildMode, const QString& target, const QString& version )
+QString TestCompiler::targetName(BuildType buildMode, const QString& target, const QString& version)
{
Q_UNUSED(version);
QString targetName = target;
@@ -67,7 +67,9 @@ static QString targetName( BuildType buildMode, const QString& target, const QSt
break;
case Dll: // dll
targetName.prepend("lib");
- targetName.append("." + version + ".dylib");
+ if (!version.isEmpty())
+ targetName.append('.' + version);
+ targetName.append(".dylib");
break;
case Lib: // lib
targetName.prepend("lib");
@@ -255,7 +257,8 @@ bool TestCompiler::qmakeProject( const QString &workDir, const QString &proName
return runCommand(qmakeCmd_, QStringList() << "-project" << "-o" << projectFile << "DESTDIR=./");
}
-bool TestCompiler::qmake( const QString &workDir, const QString &proName, const QString &buildDir )
+bool TestCompiler::qmake(const QString &workDir, const QString &proName, const QString &buildDir,
+ const QStringList &additionalArguments)
{
QDir D;
D.setCurrent( workDir );
@@ -272,7 +275,8 @@ bool TestCompiler::qmake( const QString &workDir, const QString &proName, const
makeFile += "Makefile";
// Now start qmake and generate the makefile
- return runCommand(qmakeCmd_, QStringList(qmakeArgs_) << projectFile << "-o" << makeFile);
+ return runCommand(qmakeCmd_, QStringList(qmakeArgs_) << projectFile << "-o" << makeFile
+ << additionalArguments);
}
bool TestCompiler::make( const QString &workPath, const QString &target, bool expectFail )
diff --git a/tests/auto/tools/qmake/testcompiler.h b/tests/auto/tools/qmake/testcompiler.h
index a46c9b6b6a..50232669c0 100644
--- a/tests/auto/tools/qmake/testcompiler.h
+++ b/tests/auto/tools/qmake/testcompiler.h
@@ -49,6 +49,8 @@ public:
void resetEnvironment();
void addToEnvironment( QString varAssignment );
+ static QString targetName(BuildType buildMode, const QString& target, const QString& version);
+
// executes a make clean in the specified workPath
bool makeClean( const QString &workPath );
// executes a make dist clean in the specified workPath
@@ -56,11 +58,13 @@ public:
// executes a qmake -project on the specified workDir
bool qmakeProject( const QString &workDir, const QString &proName );
// executes a qmake on proName in the specified workDir, output goes to buildDir or workDir if it's null
- bool qmake( const QString &workDir, const QString &proName, const QString &buildDir = QString() );
+ bool qmake(const QString &workDir, const QString &proName, const QString &buildDir = QString(),
+ const QStringList &additionalArguments = QStringList());
// executes a make in the specified workPath, with an optional target (eg. install)
bool make( const QString &workPath, const QString &target = QString(), bool expectFail = false );
// checks if the executable exists in destDir
- bool exists( const QString &destDir, const QString &exeName, BuildType buildType, const QString &version );
+ bool exists(const QString &destDir, const QString &exeName, BuildType buildType,
+ const QString &version = QString());
// removes the makefile
bool removeMakefile( const QString &workPath );
// removes the project file specified by 'project' on the 'workPath'
diff --git a/tests/auto/tools/qmake/testdata/simple_app/simple_app.pro b/tests/auto/tools/qmake/testdata/simple_app/simple_app.pro
index 0e78a91f46..f089ac14fc 100644
--- a/tests/auto/tools/qmake/testdata/simple_app/simple_app.pro
+++ b/tests/auto/tools/qmake/testdata/simple_app/simple_app.pro
@@ -5,3 +5,8 @@ SOURCES = test_file.cpp \
RESOURCES = test.qrc
TARGET = "simple app"
DESTDIR = "dest dir"
+
+target.path = $$OUT_PWD/dist
+INSTALLS += target
+
+!build_pass:msvc:CONFIG(debug, debug|release):message("check for pdb, please")
diff --git a/tests/auto/tools/qmake/testdata/subdirs/simple_dll/simple_dll.pro b/tests/auto/tools/qmake/testdata/subdirs/simple_dll/simple_dll.pro
index 4e362bb918..d13f49bb89 100644
--- a/tests/auto/tools/qmake/testdata/subdirs/simple_dll/simple_dll.pro
+++ b/tests/auto/tools/qmake/testdata/subdirs/simple_dll/simple_dll.pro
@@ -6,7 +6,6 @@ DEFINES += SIMPLEDLL_MAKEDLL
HEADERS = simple.h
SOURCES = simple.cpp
-VERSION = 1.0.0
INCLUDEPATH += . tmp
MOC_DIR = tmp
OBJECTS_DIR = tmp
diff --git a/tests/auto/tools/qmake/tst_qmake.cpp b/tests/auto/tools/qmake/tst_qmake.cpp
index 10aabcf196..cacee30c86 100644
--- a/tests/auto/tools/qmake/tst_qmake.cpp
+++ b/tests/auto/tools/qmake/tst_qmake.cpp
@@ -30,9 +30,11 @@
#include "testcompiler.h"
+#include <QDir>
+#include <QDirIterator>
#include <QObject>
#include <QStandardPaths>
-#include <QDir>
+#include <QTemporaryDir>
#if defined(DEBUG_BUILD)
# define DIR_INFIX "debug/"
@@ -46,12 +48,17 @@ class tst_qmake : public QObject
{
Q_OBJECT
+public:
+ tst_qmake();
+
private slots:
void initTestCase();
+ void cleanupTestCase();
void cleanup();
void simple_app();
void simple_app_shadowbuild();
void simple_app_shadowbuild2();
+ void simple_app_versioned();
void simple_lib();
void simple_dll();
void subdirs();
@@ -78,11 +85,41 @@ private slots:
private:
TestCompiler test_compiler;
+ QTemporaryDir tempWorkDir;
QString base_path;
+ const QString origCurrentDirPath;
};
+tst_qmake::tst_qmake()
+ : tempWorkDir(QDir::tempPath() + "/tst_qmake"),
+ origCurrentDirPath(QDir::currentPath())
+{
+}
+
+static void copyDir(const QString &sourceDirPath, const QString &targetDirPath)
+{
+ QDir currentDir;
+ QDirIterator dit(sourceDirPath, QDir::Dirs | QDir::NoDotAndDotDot | QDir::Hidden);
+ while (dit.hasNext()) {
+ dit.next();
+ const QString targetPath = targetDirPath + QLatin1Char('/') + dit.fileName();
+ currentDir.mkpath(targetPath);
+ copyDir(dit.filePath(), targetPath);
+ }
+
+ QDirIterator fit(sourceDirPath, QDir::Files | QDir::Hidden);
+ while (fit.hasNext()) {
+ fit.next();
+ const QString targetPath = targetDirPath + QLatin1Char('/') + fit.fileName();
+ QFile::remove(targetPath); // allowed to fail
+ QFile src(fit.filePath());
+ QVERIFY2(src.copy(targetPath), qPrintable(src.errorString()));
+ }
+}
+
void tst_qmake::initTestCase()
{
+ QVERIFY2(tempWorkDir.isValid(), qPrintable(tempWorkDir.errorString()));
QString binpath = QLibraryInfo::location(QLibraryInfo::BinariesPath);
QString cmd = QString("%1/qmake").arg(binpath);
#ifdef Q_CC_MSVC
@@ -99,13 +136,31 @@ void tst_qmake::initTestCase()
#else
test_compiler.setBaseCommands( "make", cmd );
#endif
- //Detect the location of the testdata
- QString subProgram = QLatin1String("testdata/simple_app/main.cpp");
- base_path = QFINDTESTDATA(subProgram);
- if (base_path.lastIndexOf(subProgram) > 0)
- base_path = base_path.left(base_path.lastIndexOf(subProgram));
- else
- base_path = QCoreApplication::applicationDirPath();
+ const QString testDataSubDir = QStringLiteral("testdata");
+ const QString subProgram = testDataSubDir + QLatin1String("/simple_app/main.cpp");
+ QString testDataPath = QFINDTESTDATA(subProgram);
+ if (!testDataPath.endsWith(subProgram))
+ QFAIL("Cannot find test data directory.");
+ testDataPath.chop(subProgram.length() - testDataSubDir.length());
+
+ QString userWorkDir = qgetenv("TST_QMAKE_BUILD_DIR");
+ if (userWorkDir.isEmpty()) {
+ base_path = tempWorkDir.path();
+ } else {
+ if (!QFile::exists(userWorkDir)) {
+ QFAIL(qUtf8Printable(QStringLiteral("TST_QMAKE_BUILD_DIR %1 does not exist.")
+ .arg(userWorkDir)));
+ }
+ base_path = userWorkDir;
+ }
+
+ copyDir(testDataPath, base_path + QLatin1Char('/') + testDataSubDir);
+}
+
+void tst_qmake::cleanupTestCase()
+{
+ // On Windows, ~QTemporaryDir fails to remove the directory if we're still in there.
+ QDir::setCurrent(origCurrentDirPath);
}
void tst_qmake::cleanup()
@@ -119,10 +174,15 @@ void tst_qmake::simple_app()
{
QString workDir = base_path + "/testdata/simple_app";
QString destDir = workDir + "/dest dir";
+ QString installDir = workDir + "/dist";
- QVERIFY( test_compiler.qmake( workDir, "simple_app" ));
+ QVERIFY( test_compiler.qmake( workDir, "simple_app", QString() ));
QVERIFY( test_compiler.make( workDir ));
QVERIFY( test_compiler.exists( destDir, "simple app", Exe, "1.0.0" ));
+
+ QVERIFY(test_compiler.make(workDir, "install"));
+ QVERIFY(test_compiler.exists(installDir, "simple app", Exe, "1.0.0"));
+
QVERIFY( test_compiler.makeClean( workDir ));
QVERIFY( test_compiler.exists( destDir, "simple app", Exe, "1.0.0" )); // Should still exist after a make clean
QVERIFY( test_compiler.makeDistClean( workDir ));
@@ -162,6 +222,40 @@ void tst_qmake::simple_app_shadowbuild2()
QVERIFY( test_compiler.removeMakefile( buildDir ) );
}
+void tst_qmake::simple_app_versioned()
+{
+ QString workDir = base_path + "/testdata/simple_app";
+ QString buildDir = base_path + "/testdata/simple_app_versioned_build";
+ QString destDir = buildDir + "/dest dir";
+ QString installDir = buildDir + "/dist";
+
+ QString version = "4.5.6";
+ QVERIFY(test_compiler.qmake(workDir, "simple_app", buildDir, QStringList{ "VERSION=" + version }));
+ QString qmakeOutput = test_compiler.commandOutput();
+ QVERIFY(test_compiler.make(buildDir));
+ QVERIFY(test_compiler.exists(destDir, "simple app", Exe, version));
+
+ QString pdbFilePath;
+ bool checkPdb = qmakeOutput.contains("Project MESSAGE: check for pdb, please");
+ if (checkPdb) {
+ QString targetBase = QFileInfo(TestCompiler::targetName(Exe, "simple app", version))
+ .completeBaseName();
+ pdbFilePath = destDir + '/' + targetBase + ".pdb";
+ QVERIFY2(QFile::exists(pdbFilePath), qPrintable(pdbFilePath));
+ QVERIFY(test_compiler.make(buildDir, "install"));
+ QString installedPdbFilePath = installDir + '/' + targetBase + ".pdb";
+ QVERIFY2(QFile::exists(installedPdbFilePath), qPrintable(installedPdbFilePath));
+ }
+
+ QVERIFY(test_compiler.makeClean(buildDir));
+ QVERIFY(test_compiler.exists(destDir, "simple app", Exe, version));
+ QVERIFY(test_compiler.makeDistClean(buildDir));
+ QVERIFY(!test_compiler.exists(destDir, "simple app", Exe, version));
+ if (checkPdb)
+ QVERIFY(!QFile::exists(pdbFilePath));
+ QVERIFY(test_compiler.removeMakefile(buildDir));
+}
+
void tst_qmake::simple_dll()
{
QString workDir = base_path + "/testdata/simple_dll";
@@ -205,12 +299,12 @@ void tst_qmake::subdirs()
D.remove( workDir + "/simple_dll/Makefile");
QVERIFY( test_compiler.qmake( workDir, "subdirs" ));
QVERIFY( test_compiler.make( workDir ));
- QVERIFY( test_compiler.exists( workDir + "/simple_app/dest dir", "simple app", Exe, "1.0.0" ));
- QVERIFY( test_compiler.exists( workDir + "/simple_dll/dest dir", "simple dll", Dll, "1.0.0" ));
+ QVERIFY( test_compiler.exists(workDir + "/simple_app/dest dir", "simple app", Exe));
+ QVERIFY( test_compiler.exists(workDir + "/simple_dll/dest dir", "simple dll", Dll));
QVERIFY( test_compiler.makeClean( workDir ));
// Should still exist after a make clean
- QVERIFY( test_compiler.exists( workDir + "/simple_app/dest dir", "simple app", Exe, "1.0.0" ));
- QVERIFY( test_compiler.exists( workDir + "/simple_dll/dest dir", "simple dll", Dll, "1.0.0" ));
+ QVERIFY( test_compiler.exists(workDir + "/simple_app/dest dir", "simple app", Exe));
+ QVERIFY( test_compiler.exists(workDir + "/simple_dll/dest dir", "simple dll", Dll));
// Since subdirs templates do not have a make dist clean, we should clean up ourselves
// properly
QVERIFY( test_compiler.makeDistClean( workDir ));
@@ -500,8 +594,8 @@ void tst_qmake::resources()
QVERIFY(test_compiler.qmake(workDir, "resources"));
{
- QFile qrcFile(workDir + "/.rcc/" DIR_INFIX "qmake_pro_file.qrc");
- QVERIFY(qrcFile.exists());
+ QFile qrcFile(workDir + '/' + DIR_INFIX "qmake_pro_file.qrc");
+ QVERIFY2(qrcFile.exists(), qPrintable(qrcFile.fileName()));
QVERIFY(qrcFile.open(QFile::ReadOnly));
QByteArray qrcXml = qrcFile.readAll();
QVERIFY(qrcXml.contains("alias=\"resources.pro\""));
@@ -509,7 +603,7 @@ void tst_qmake::resources()
}
{
- QFile qrcFile(workDir + "/.rcc/" DIR_INFIX "qmake_subdir.qrc");
+ QFile qrcFile(workDir + '/' + DIR_INFIX "qmake_subdir.qrc");
QVERIFY(qrcFile.exists());
QVERIFY(qrcFile.open(QFile::ReadOnly));
QByteArray qrcXml = qrcFile.readAll();
@@ -517,7 +611,7 @@ void tst_qmake::resources()
}
{
- QFile qrcFile(workDir + "/.rcc/" DIR_INFIX "qmake_qmake_immediate.qrc");
+ QFile qrcFile(workDir + '/' + DIR_INFIX "qmake_qmake_immediate.qrc");
QVERIFY(qrcFile.exists());
QVERIFY(qrcFile.open(QFile::ReadOnly));
QByteArray qrcXml = qrcFile.readAll();
diff --git a/tests/auto/widgets/graphicsview/qgraphicsitem/BLACKLIST b/tests/auto/widgets/graphicsview/qgraphicsitem/BLACKLIST
new file mode 100644
index 0000000000..e760042def
--- /dev/null
+++ b/tests/auto/widgets/graphicsview/qgraphicsitem/BLACKLIST
@@ -0,0 +1,3 @@
+# QTBUG-74760
+[sorting]
+opensuse-42.3
diff --git a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
index 55139ff99a..28df3a3c38 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
@@ -4075,6 +4075,8 @@ void tst_QGraphicsView::update()
QTRY_COMPARE(view.lastUpdateRegions.at(0), QRegion(updateRect) & viewportRect);
}
QTRY_VERIFY(!viewPrivate->fullUpdatePending);
+#else
+ Q_UNUSED(updateRect);
#endif
}
diff --git a/tests/auto/widgets/kernel/qwidget/BLACKLIST b/tests/auto/widgets/kernel/qwidget/BLACKLIST
index 1f68308bbe..3287d67875 100644
--- a/tests/auto/widgets/kernel/qwidget/BLACKLIST
+++ b/tests/auto/widgets/kernel/qwidget/BLACKLIST
@@ -10,6 +10,7 @@ osx
ubuntu-16.04
ubuntu-18.04
rhel-7.4
+rhel-7.6
osx
[focusProxyAndInputMethods]
linux
diff --git a/tests/auto/widgets/widgets/qdoublespinbox/tst_qdoublespinbox.cpp b/tests/auto/widgets/widgets/qdoublespinbox/tst_qdoublespinbox.cpp
index b1610c297d..b101f47bcd 100644
--- a/tests/auto/widgets/widgets/qdoublespinbox/tst_qdoublespinbox.cpp
+++ b/tests/auto/widgets/widgets/qdoublespinbox/tst_qdoublespinbox.cpp
@@ -326,14 +326,26 @@ void tst_QDoubleSpinBox::setPrefixSuffix()
QDoubleSpinBox spin(0);
spin.setDecimals(decimals);
+ const QSize size1 = spin.sizeHint();
spin.setPrefix(prefix);
+ const QSize size2 = spin.sizeHint();
spin.setSuffix(suffix);
+ const QSize size3 = spin.sizeHint();
spin.setValue(value);
if (show)
spin.show();
QCOMPARE(spin.text(), expectedText);
QCOMPARE(spin.cleanText(), expectedCleanText);
+
+ if (!prefix.isEmpty() && !suffix.isEmpty()) {
+ QVERIFY(size1.width() < size2.width());
+ QVERIFY(size2.width() < size3.width());
+ spin.setSuffix(QString());
+ QCOMPARE(spin.sizeHint(), size2);
+ spin.setPrefix(QString());
+ QCOMPARE(spin.sizeHint(), size1);
+ }
}
void tst_QDoubleSpinBox::valueChangedHelper(const QString &text)
diff --git a/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp b/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp
index 1acf07301c..ea96322654 100644
--- a/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp
+++ b/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp
@@ -1343,8 +1343,10 @@ void tst_QMainWindow::restoreState()
{
QMainWindow mw;
QToolBar tb(&mw);
+ tb.setObjectName(QLatin1String("toolBar"));
mw.addToolBar(Qt::TopToolBarArea, &tb);
QDockWidget dw(&mw);
+ dw.setObjectName(QLatin1String("dock"));
mw.addDockWidget(Qt::LeftDockWidgetArea, &dw);
QByteArray state;
diff --git a/tests/auto/widgets/widgets/qsizegrip/tst_qsizegrip.cpp b/tests/auto/widgets/widgets/qsizegrip/tst_qsizegrip.cpp
index 4cc1810cd4..f4b91265a4 100644
--- a/tests/auto/widgets/widgets/qsizegrip/tst_qsizegrip.cpp
+++ b/tests/auto/widgets/widgets/qsizegrip/tst_qsizegrip.cpp
@@ -59,25 +59,22 @@ class tst_QSizeGrip : public QObject
{
Q_OBJECT
public slots:
- void initTestCase();
- void cleanupTestCase();
+ void cleanup();
private slots:
void hideAndShowOnWindowStateChange_data();
void hideAndShowOnWindowStateChange();
void orientation();
void dontCrashOnTLWChange();
-
-private:
- QLineEdit *dummyWidget;
};
class TestWidget : public QWidget
{
public:
- TestWidget(QWidget *parent = 0, Qt::WindowFlags flags = 0) : QWidget(parent, flags) {}
- QSize sizeHint() const { return QSize(300, 200); }
- void changeEvent(QEvent *event)
+ using QWidget::QWidget;
+
+ QSize sizeHint() const override { return QSize(300, 200); }
+ void changeEvent(QEvent *event) override
{
QWidget::changeEvent(event);
if (isWindow() && event->type() == QEvent::WindowStateChange)
@@ -85,16 +82,9 @@ public:
}
};
-void tst_QSizeGrip::initTestCase()
-{
- dummyWidget = new QLineEdit;
- dummyWidget->show();
-}
-
-void tst_QSizeGrip::cleanupTestCase()
+void tst_QSizeGrip::cleanup()
{
- delete dummyWidget;
- dummyWidget = 0;
+ QVERIFY(QApplication::topLevelWidgets().isEmpty());
}
void tst_QSizeGrip::hideAndShowOnWindowStateChange_data()
@@ -111,46 +101,45 @@ void tst_QSizeGrip::hideAndShowOnWindowStateChange()
QSKIP("Broken on WinRT - QTBUG-68297");
#endif
- QWidget *parentWidget = windowType == Qt::Window ? 0 : new QWidget;
- TestWidget *widget = new TestWidget(parentWidget, Qt::WindowFlags(windowType));
- QSizeGrip *sizeGrip = new QSizeGrip(widget);
+ QScopedPointer<QWidget> parentWidget;
+ if (windowType != Qt::Window)
+ parentWidget.reset(new QWidget);
+ QScopedPointer<TestWidget> widget(new TestWidget(parentWidget.data(), Qt::WindowFlags(windowType)));
+ QSizeGrip *sizeGrip = new QSizeGrip(widget.data());
// Normal.
if (parentWidget)
parentWidget->show();
else
widget->show();
- QVERIFY(sizeGrip->isVisible());
+ QTRY_VERIFY(sizeGrip->isVisible());
widget->showFullScreen();
- QVERIFY(!sizeGrip->isVisible());
+ QTRY_VERIFY(!sizeGrip->isVisible());
widget->showNormal();
- QVERIFY(sizeGrip->isVisible());
+ QTRY_VERIFY(sizeGrip->isVisible());
widget->showMaximized();
#ifndef Q_OS_MAC
- QVERIFY(!sizeGrip->isVisible());
+ QTRY_VERIFY(!sizeGrip->isVisible());
#else
QEXPECT_FAIL("", "QTBUG-23681", Abort);
QVERIFY(sizeGrip->isVisible());
#endif
widget->showNormal();
- QVERIFY(sizeGrip->isVisible());
+ QTRY_VERIFY(sizeGrip->isVisible());
sizeGrip->hide();
- QVERIFY(!sizeGrip->isVisible());
+ QTRY_VERIFY(!sizeGrip->isVisible());
widget->showFullScreen();
widget->showNormal();
- QVERIFY(!sizeGrip->isVisible());
+ QTRY_VERIFY(!sizeGrip->isVisible());
widget->showMaximized();
widget->showNormal();
- QVERIFY(!sizeGrip->isVisible());
-
- delete widget;
- delete parentWidget;
+ QTRY_VERIFY(!sizeGrip->isVisible());
}
void tst_QSizeGrip::orientation()
@@ -196,10 +185,10 @@ void tst_QSizeGrip::dontCrashOnTLWChange()
QMdiArea mdiArea;
mdiArea.show();
- QMainWindow *mw = new QMainWindow();
- QMdiSubWindow *mdi = mdiArea.addSubWindow(mw);
+ QScopedPointer<QMainWindow> mw(new QMainWindow);
+ QMdiSubWindow *mdi = mdiArea.addSubWindow(mw.data());
mw->statusBar()->setSizeGripEnabled(true);
- mdiArea.removeSubWindow(mw);
+ mdiArea.removeSubWindow(mw.data());
delete mdi;
mw->show();
@@ -209,7 +198,7 @@ void tst_QSizeGrip::dontCrashOnTLWChange()
QEXPECT_FAIL("", "Broken on WinRT - QTBUG-68297", Abort);
#endif
QVERIFY(QTest::qWaitForWindowExposed(&mdiArea));
- QVERIFY(QTest::qWaitForWindowExposed(mw));
+ QVERIFY(QTest::qWaitForWindowExposed(mw.data()));
}
QTEST_MAIN(tst_QSizeGrip)
diff --git a/tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp b/tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp
index 7174c274f9..b9d6888263 100644
--- a/tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp
+++ b/tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp
@@ -462,8 +462,11 @@ void tst_QSpinBox::setPrefixSuffix()
QFETCH(bool, show);
QSpinBox spin(0);
+ const QSize size1 = spin.sizeHint();
spin.setPrefix(prefix);
+ const QSize size2 = spin.sizeHint();
spin.setSuffix(suffix);
+ const QSize size3 = spin.sizeHint();
spin.setValue(value);
if (show)
spin.show();
@@ -472,6 +475,15 @@ void tst_QSpinBox::setPrefixSuffix()
QCOMPARE(spin.suffix(), suffix);
QCOMPARE(spin.text(), expectedText);
QCOMPARE(spin.cleanText(), expectedCleanText);
+
+ if (!prefix.isEmpty() && !suffix.isEmpty()) {
+ QVERIFY(size1.width() < size2.width());
+ QVERIFY(size2.width() < size3.width());
+ spin.setSuffix(QString());
+ QCOMPARE(spin.sizeHint(), size2);
+ spin.setPrefix(QString());
+ QCOMPARE(spin.sizeHint(), size1);
+ }
}
void tst_QSpinBox::textChangedHelper(const QString &text)
diff --git a/tests/benchmarks/corelib/kernel/kernel.pro b/tests/benchmarks/corelib/kernel/kernel.pro
index 02eeeaa254..92f7174419 100644
--- a/tests/benchmarks/corelib/kernel/kernel.pro
+++ b/tests/benchmarks/corelib/kernel/kernel.pro
@@ -5,7 +5,8 @@ SUBDIRS = \
qmetatype \
qobject \
qvariant \
- qcoreapplication
+ qcoreapplication \
+ qtimer_vs_qmetaobject
!qtHaveModule(widgets): SUBDIRS -= \
qmetaobject \
diff --git a/tests/benchmarks/corelib/kernel/qtimer_vs_qmetaobject/tst_qtimer_vs_qmetaobject.cpp b/tests/benchmarks/corelib/kernel/qtimer_vs_qmetaobject/tst_qtimer_vs_qmetaobject.cpp
index 66a29780f0..07976aa056 100644
--- a/tests/benchmarks/corelib/kernel/qtimer_vs_qmetaobject/tst_qtimer_vs_qmetaobject.cpp
+++ b/tests/benchmarks/corelib/kernel/qtimer_vs_qmetaobject/tst_qtimer_vs_qmetaobject.cpp
@@ -35,8 +35,8 @@ class qtimer_vs_qmetaobject : public QObject
{
Q_OBJECT
private slots:
- void testZeroTimerSingleShot();
- void testQueuedInvokeMethod();
+ void bench();
+ void bench_data();
};
class InvokeCounter : public QObject {
@@ -53,28 +53,69 @@ protected:
int count;
};
-void qtimer_vs_qmetaobject::testZeroTimerSingleShot()
+void qtimer_vs_qmetaobject::bench()
{
+ QFETCH(int, type);
+
+ std::function<void(InvokeCounter*)> invoke;
+ if (type == 0) {
+ invoke = [](InvokeCounter* invokeCounter) {
+ QTimer::singleShot(0, invokeCounter, SLOT(invokeSlot()));
+ };
+ } else if (type == 1) {
+ invoke = [](InvokeCounter* invokeCounter) {
+ QTimer::singleShot(0, invokeCounter, &InvokeCounter::invokeSlot);
+ };
+ } else if (type == 2) {
+ invoke = [](InvokeCounter* invokeCounter) {
+ QTimer::singleShot(0, invokeCounter, [invokeCounter]() {
+ invokeCounter->invokeSlot();
+ });
+ };
+ } else if (type == 3) {
+ invoke = [](InvokeCounter* invokeCounter) {
+ QTimer::singleShot(0, [invokeCounter]() {
+ invokeCounter->invokeSlot();
+ });
+ };
+ } else if (type == 4) {
+ invoke = [](InvokeCounter* invokeCounter) {
+ QMetaObject::invokeMethod(invokeCounter, "invokeSlot", Qt::QueuedConnection);
+ };
+ } else if (type == 5) {
+ invoke = [](InvokeCounter* invokeCounter) {
+ QMetaObject::invokeMethod(invokeCounter, &InvokeCounter::invokeSlot, Qt::QueuedConnection);
+ };
+ } else if (type == 6) {
+ invoke = [](InvokeCounter* invokeCounter) {
+ QMetaObject::invokeMethod(invokeCounter, [invokeCounter]() {
+ invokeCounter->invokeSlot();
+ }, Qt::QueuedConnection);
+ };
+ } else {
+ QFAIL("unhandled data tag");
+ }
+
QBENCHMARK {
InvokeCounter invokeCounter;
for(int i = 0; i < INVOKE_COUNT; ++i) {
- QTimer::singleShot(0, &invokeCounter, SLOT(invokeSlot()));
+ invoke(&invokeCounter);
}
QTestEventLoop::instance().enterLoop(10);
QVERIFY(!QTestEventLoop::instance().timeout());
}
}
-void qtimer_vs_qmetaobject::testQueuedInvokeMethod()
+void qtimer_vs_qmetaobject::bench_data()
{
- QBENCHMARK {
- InvokeCounter invokeCounter;
- for(int i = 0; i < INVOKE_COUNT; ++i) {
- QMetaObject::invokeMethod(&invokeCounter, "invokeSlot", Qt::QueuedConnection);
- }
- QTestEventLoop::instance().enterLoop(10);
- QVERIFY(!QTestEventLoop::instance().timeout());
- }
+ QTest::addColumn<int>("type");
+ QTest::addRow("singleShot_slot") << 0;
+ QTest::addRow("singleShot_pmf") << 1;
+ QTest::addRow("singleShot_functor") << 2;
+ QTest::addRow("singleShot_functor_noctx") << 3;
+ QTest::addRow("invokeMethod_string") << 4;
+ QTest::addRow("invokeMethod_pmf") << 5;
+ QTest::addRow("invokeMethod_functor") << 6;
}
diff --git a/tests/manual/cocoa/noclickthrough/main.cpp b/tests/manual/cocoa/noclickthrough/main.cpp
new file mode 100644
index 0000000000..eee7729999
--- /dev/null
+++ b/tests/manual/cocoa/noclickthrough/main.cpp
@@ -0,0 +1,48 @@
+/****************************************************************************
+ **
+ ** Copyright (C) 2019 The Qt Company Ltd.
+ ** Contact: https://www.qt.io/licensing/
+ **
+ ** This file is part of the test suite of the Qt Toolkit.
+ **
+ ** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+ ** Commercial License Usage
+ ** Licensees holding valid commercial Qt licenses may use this file in
+ ** accordance with the commercial license agreement provided with the
+ ** Software or, alternatively, in accordance with the terms contained in
+ ** a written agreement between you and The Qt Company. For licensing terms
+ ** and conditions see https://www.qt.io/terms-conditions. For further
+ ** information use the contact form at https://www.qt.io/contact-us.
+ **
+ ** GNU General Public License Usage
+ ** Alternatively, this file may be used under the terms of the GNU
+ ** General Public License version 3 as published by the Free Software
+ ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+ ** included in the packaging of this file. Please review the following
+ ** information to ensure the GNU General Public License requirements will
+ ** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+ **
+ ** $QT_END_LICENSE$
+ **
+ ****************************************************************************/
+
+#include <QtWidgets>
+
+int main(int argc, char **argv)
+{
+ QApplication a(argc, argv);
+ QWidget w;
+ QVBoxLayout *vbox = new QVBoxLayout;
+ QLabel *label = new QLabel("Make the window inactive, but visible.\n"
+ "Then click on the Two item.\n"
+ "The item should not be selected, but the window should be active.");
+ vbox->addWidget(label);
+ QListWidget *list = new QListWidget;
+ list->addItems(QStringList() << "One" << "Two" << "Three");
+ list->selectionModel()->select(list->model()->index(0, 0), QItemSelectionModel::Select);
+ list->viewport()->setAttribute(Qt::WA_MacNoClickThrough);
+ vbox->addWidget(list);
+ w.setLayout(vbox);
+ w.show();
+ return a.exec();
+}
diff --git a/tests/manual/cocoa/noclickthrough/noclickthrough.pro b/tests/manual/cocoa/noclickthrough/noclickthrough.pro
new file mode 100644
index 0000000000..a8e30cb146
--- /dev/null
+++ b/tests/manual/cocoa/noclickthrough/noclickthrough.pro
@@ -0,0 +1,4 @@
+QT += widgets
+TEMPLATE = app
+TARGET = noclickthrough
+SOURCES += main.cpp
diff --git a/tests/manual/dialogs/filedialogpanel.cpp b/tests/manual/dialogs/filedialogpanel.cpp
index e628dd2265..800baae45e 100644
--- a/tests/manual/dialogs/filedialogpanel.cpp
+++ b/tests/manual/dialogs/filedialogpanel.cpp
@@ -438,9 +438,9 @@ void FileDialogPanel::restoreDefaults()
setComboBoxValue(m_viewMode, d.viewMode());
m_showDirsOnly->setChecked(d.testOption(QFileDialog::ShowDirsOnly));
m_allowedSchemes->setText(QString());
- m_confirmOverWrite->setChecked(d.confirmOverwrite());
+ m_confirmOverWrite->setChecked(!d.testOption(QFileDialog::DontConfirmOverwrite));
m_nameFilterDetailsVisible->setChecked(!d.testOption(QFileDialog::HideNameFilterDetails));
- m_resolveSymLinks->setChecked(d.resolveSymlinks());
+ m_resolveSymLinks->setChecked(!d.testOption(QFileDialog::DontResolveSymlinks));
m_readOnly->setChecked(d.isReadOnly());
m_native->setChecked(true);
m_customDirIcons->setChecked(d.testOption(QFileDialog::DontUseCustomDirectoryIcons));
diff --git a/tests/manual/dialogs/main.cpp b/tests/manual/dialogs/main.cpp
index 2676ceeb52..07df8f5cf4 100644
--- a/tests/manual/dialogs/main.cpp
+++ b/tests/manual/dialogs/main.cpp
@@ -126,6 +126,10 @@ void MainWindow::aboutDialog()
int main(int argc, char *argv[])
{
+#if QT_VERSION >= 0x050600
+ QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
+#endif
+
for (int a = 1; a < argc; ++a) {
if (!qstrcmp(argv[a], "-n")) {
qDebug("AA_DontUseNativeDialogs");
diff --git a/tests/manual/dialogs/printdialogpanel.cpp b/tests/manual/dialogs/printdialogpanel.cpp
index d999dbc30c..8d64d2f6a6 100644
--- a/tests/manual/dialogs/printdialogpanel.cpp
+++ b/tests/manual/dialogs/printdialogpanel.cpp
@@ -55,6 +55,10 @@
#include <QTextStream>
#include <QDir>
+#if QT_VERSION >= 0x050000
+# include <QScreen>
+#endif
+
const FlagData printerModeComboData[] =
{
{"ScreenResolution", QPrinter::ScreenResolution},
@@ -705,7 +709,13 @@ void PrintDialogPanel::showPreviewDialog()
{
applySettings(m_printer.data());
PrintPreviewDialog dialog(m_printer.data(), this);
- dialog.resize(QApplication::desktop()->availableGeometry().size() * 4/ 5);
+#if QT_VERSION >= 0x050000
+ const int screenNumber = QApplication::desktop()->screenNumber(this);
+ const QSize availableSize = QGuiApplication::screens().at(screenNumber)->availableSize();
+#else
+ const QSize availableSize = QApplication::desktop()->availableGeometry().size();
+#endif
+ dialog.resize(availableSize * 4/ 5);
if (dialog.exec() == QDialog::Accepted)
retrieveSettings(m_printer.data());
}
diff --git a/util/unicode/main.cpp b/util/unicode/main.cpp
index 00c69de008..22a4405ca9 100644
--- a/util/unicode/main.cpp
+++ b/util/unicode/main.cpp
@@ -798,6 +798,9 @@ static const char *property_string =
" signed short mirrorDiff : 16;\n"
" ushort lowerCaseSpecial : 1;\n"
" signed short lowerCaseDiff : 15;\n"
+ "#ifdef Q_OS_WASM\n"
+ " unsigned char : 0; //wasm 64 packing trick\n"
+ "#endif\n"
" ushort upperCaseSpecial : 1;\n"
" signed short upperCaseDiff : 15;\n"
" ushort titleCaseSpecial : 1;\n"
@@ -806,6 +809,9 @@ static const char *property_string =
" signed short caseFoldDiff : 15;\n"
" ushort unicodeVersion : 8; /* 5 used */\n"
" ushort nfQuickCheck : 8;\n" // could be narrowed
+ "#ifdef Q_OS_WASM\n"
+ " unsigned char : 0; //wasm 64 packing trick\n"
+ "#endif\n"
" ushort graphemeBreakClass : 5; /* 5 used */\n"
" ushort wordBreakClass : 5; /* 5 used */\n"
" ushort sentenceBreakClass : 8; /* 4 used */\n"
@@ -2470,10 +2476,6 @@ static QByteArray createPropertyInfo()
out += ", ";
out += QByteArray::number( p.lowerCaseDiff );
out += ", ";
- out += "#ifdef Q_OS_WASM \n";
-// " unsigned char : 0; //wasm 64 packing trick QTBUG-65259\n"
- out += "#endif \n";
- out += ", ";
// " ushort upperCaseSpecial : 1;\n"
// " signed short upperCaseDiff : 15;\n"
out += QByteArray::number( p.upperCaseSpecial );
@@ -2498,10 +2500,6 @@ static QByteArray createPropertyInfo()
// " ushort nfQuickCheck : 8;\n"
out += QByteArray::number( p.nfQuickCheck );
out += ", ";
- out += "#ifdef Q_OS_WASM \n";
-// " unsigned char : 0; //wasm 64 packing trick QTBUG-65259\n"
- out += "#endif \n";
- out += ", ";
// " ushort graphemeBreakClass : 5; /* 5 used */\n"
// " ushort wordBreakClass : 5; /* 5 used */\n"
// " ushort sentenceBreakClass : 8; /* 4 used */\n"