summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.qmake.conf2
-rw-r--r--config_help.txt1
-rwxr-xr-xconfigure4
-rw-r--r--configure.json9
-rw-r--r--examples/network/multistreamclient/chatconsumer.h4
-rw-r--r--examples/network/multistreamclient/movieconsumer.h6
-rw-r--r--examples/network/multistreamclient/timeconsumer.h6
-rw-r--r--examples/network/multistreamserver/chatprovider.h6
-rw-r--r--examples/network/multistreamserver/server.h2
-rw-r--r--examples/network/multistreamserver/timeprovider.h2
-rw-r--r--examples/opengl/computegles31/glwindow.h2
-rw-r--r--examples/opengl/qopenglwindow/background_renderer.cpp6
-rw-r--r--examples/widgets/mainwindows/mainwindow/colorswatch.cpp2
-rw-r--r--examples/widgets/mainwindows/mainwindow/colorswatch.h4
-rw-r--r--examples/widgets/mainwindows/mainwindow/mainwindow.cpp2
-rw-r--r--examples/widgets/mainwindows/mainwindow/mainwindow.h2
-rw-r--r--examples/widgets/mainwindows/mainwindow/toolbar.cpp4
-rw-r--r--examples/widgets/mainwindows/sdi/main.cpp2
-rw-r--r--examples/widgets/tools/codecs/previewform.h2
-rw-r--r--examples/widgets/tools/settingseditor/mainwindow.cpp2
-rw-r--r--examples/widgets/widgets/charactermap/mainwindow.cpp2
-rw-r--r--examples/widgets/widgets/icons/iconpreviewarea.cpp2
-rw-r--r--examples/widgets/widgets/icons/iconpreviewarea.h2
-rw-r--r--examples/widgets/widgets/icons/iconsizespinbox.h2
-rw-r--r--examples/widgets/widgets/icons/imagedelegate.h2
-rw-r--r--examples/widgets/widgets/tablet/mainwindow.cpp2
-rw-r--r--examples/widgets/widgets/tablet/tabletcanvas.cpp9
-rw-r--r--examples/widgets/widgets/tablet/tabletcanvas.h2
-rw-r--r--examples/xml/dombookmarks/xbeltree.h2
-rw-r--r--mkspecs/android-clang/qplatformdefs.h4
-rw-r--r--mkspecs/android-g++/qplatformdefs.h4
-rw-r--r--mkspecs/common/aix/qplatformdefs.h3
-rw-r--r--mkspecs/common/android/qplatformdefs.h4
-rw-r--r--mkspecs/common/bsd/qplatformdefs.h3
-rw-r--r--mkspecs/common/integrity/qplatformdefs.h3
-rw-r--r--mkspecs/common/mac/qplatformdefs.h3
-rw-r--r--mkspecs/common/qnx/qplatformdefs.h3
-rw-r--r--mkspecs/darwin-g++/qplatformdefs.h3
-rw-r--r--mkspecs/features/data/android/dx.bat108
-rw-r--r--mkspecs/features/java.prf27
-rw-r--r--mkspecs/features/qt_plugin.prf2
-rw-r--r--mkspecs/haiku-g++/qplatformdefs.h3
-rw-r--r--mkspecs/hpuxi-g++-64/qplatformdefs.h3
-rw-r--r--mkspecs/hurd-g++/qplatformdefs.h3
-rw-r--r--mkspecs/linux-clang/qplatformdefs.h3
-rw-r--r--mkspecs/linux-g++/qplatformdefs.h3
-rw-r--r--mkspecs/linux-llvm/qplatformdefs.h3
-rw-r--r--mkspecs/linux-lsb-g++/qplatformdefs.h3
-rw-r--r--mkspecs/lynxos-g++/qplatformdefs.h3
-rw-r--r--mkspecs/solaris-cc-64/qplatformdefs.h3
-rw-r--r--mkspecs/solaris-cc/qplatformdefs.h3
-rw-r--r--mkspecs/solaris-g++-64/qplatformdefs.h3
-rw-r--r--mkspecs/solaris-g++/qplatformdefs.h3
-rw-r--r--mkspecs/unsupported/qnx-X11-g++/qplatformdefs.h3
-rw-r--r--src/android/jar/bundledjar.pro3
-rw-r--r--src/android/jar/distributedjar.pro2
-rw-r--r--src/android/jar/jar.pri26
-rw-r--r--src/android/jar/jar.pro30
-rw-r--r--src/concurrent/qtconcurrentiteratekernel.h2
-rw-r--r--src/concurrent/qtconcurrentthreadengine.h6
-rw-r--r--src/corelib/animation/qabstractanimation.h10
-rw-r--r--src/corelib/animation/qabstractanimation_p.h10
-rw-r--r--src/corelib/animation/qanimationgroup.h4
-rw-r--r--src/corelib/animation/qparallelanimationgroup.h12
-rw-r--r--src/corelib/animation/qparallelanimationgroup_p.h2
-rw-r--r--src/corelib/animation/qpauseanimation.h10
-rw-r--r--src/corelib/animation/qpropertyanimation.h10
-rw-r--r--src/corelib/animation/qsequentialanimationgroup.h12
-rw-r--r--src/corelib/animation/qsequentialanimationgroup_p.h4
-rw-r--r--src/corelib/animation/qvariantanimation.h12
-rw-r--r--src/corelib/arch/qatomic_cxx11.h8
-rw-r--r--src/corelib/codecs/qiconvcodec.cpp4
-rw-r--r--src/corelib/codecs/qicucodec_p.h10
-rw-r--r--src/corelib/codecs/qisciicodec_p.h8
-rw-r--r--src/corelib/codecs/qlatincodec_p.h20
-rw-r--r--src/corelib/codecs/qtextcodec.cpp4
-rw-r--r--src/corelib/codecs/qtextcodec.h6
-rw-r--r--src/corelib/codecs/qtsciicodec_p.h8
-rw-r--r--src/corelib/codecs/qutfcodec_p.h52
-rw-r--r--src/corelib/corelib.pro7
-rw-r--r--src/corelib/global/global.pri2
-rw-r--r--src/corelib/global/qcompilerdetection.h29
-rw-r--r--src/corelib/global/qflags.h2
-rw-r--r--src/corelib/global/qfloat16.cpp85
-rw-r--r--src/corelib/global/qfloat16.h3
-rw-r--r--src/corelib/global/qfloat16_f16c.c87
-rw-r--r--src/corelib/global/qglobal.cpp185
-rw-r--r--src/corelib/global/qglobal.h64
-rw-r--r--src/corelib/global/qlogging.h6
-rw-r--r--src/corelib/global/qnamespace.h2
-rw-r--r--src/corelib/global/qnamespace.qdoc5
-rw-r--r--src/corelib/global/qsysinfo.h2
-rw-r--r--src/corelib/global/qsystemdetection.h35
-rw-r--r--src/corelib/global/qversiontagging.cpp10
-rw-r--r--src/corelib/io/qbuffer.cpp4
-rw-r--r--src/corelib/io/qbuffer.h26
-rw-r--r--src/corelib/io/qdatastream.cpp1
-rw-r--r--src/corelib/io/qdatastream.h5
-rw-r--r--src/corelib/io/qdir.cpp1
-rw-r--r--src/corelib/io/qfile.h14
-rw-r--r--src/corelib/io/qfiledevice.h20
-rw-r--r--src/corelib/io/qfiledevice_p.h2
-rw-r--r--src/corelib/io/qfileselector.h2
-rw-r--r--src/corelib/io/qfilesystemiterator_unix.cpp17
-rw-r--r--src/corelib/io/qfilesystemwatcher.h4
-rw-r--r--src/corelib/io/qfilesystemwatcher_fsevents.mm2
-rw-r--r--src/corelib/io/qfilesystemwatcher_inotify_p.h4
-rw-r--r--src/corelib/io/qfilesystemwatcher_polling_p.h4
-rw-r--r--src/corelib/io/qfsfileengine_iterator_p.h8
-rw-r--r--src/corelib/io/qfsfileengine_p.h70
-rw-r--r--src/corelib/io/qiodevice.h2
-rw-r--r--src/corelib/io/qiodevice_p.h4
-rw-r--r--src/corelib/io/qlockfile.cpp31
-rw-r--r--src/corelib/io/qlockfile_p.h16
-rw-r--r--src/corelib/io/qlockfile_unix.cpp2
-rw-r--r--src/corelib/io/qlockfile_win.cpp4
-rw-r--r--src/corelib/io/qnoncontiguousbytedevice_p.h58
-rw-r--r--src/corelib/io/qprocess.h26
-rw-r--r--src/corelib/io/qprocess_p.h2
-rw-r--r--src/corelib/io/qprocess_unix.cpp2
-rw-r--r--src/corelib/io/qprocess_win.cpp4
-rw-r--r--src/corelib/io/qresource.cpp6
-rw-r--r--src/corelib/io/qresource_iterator_p.h6
-rw-r--r--src/corelib/io/qresource_p.h60
-rw-r--r--src/corelib/io/qsavefile.h10
-rw-r--r--src/corelib/io/qsettings.h12
-rw-r--r--src/corelib/io/qsettings_mac.cpp2
-rw-r--r--src/corelib/io/qsettings_p.h18
-rw-r--r--src/corelib/io/qstandardpaths_mac.mm29
-rw-r--r--src/corelib/io/qstorageinfo_mac.cpp6
-rw-r--r--src/corelib/io/qstorageinfo_unix.cpp6
-rw-r--r--src/corelib/io/qstorageinfo_win.cpp4
-rw-r--r--src/corelib/io/qtemporarydir.cpp6
-rw-r--r--src/corelib/io/qtemporarydir.h2
-rw-r--r--src/corelib/io/qtemporaryfile.h4
-rw-r--r--src/corelib/io/qtextstream.h4
-rw-r--r--src/corelib/io/qurl.h2
-rw-r--r--src/corelib/itemmodels/qabstractitemmodel.cpp12
-rw-r--r--src/corelib/itemmodels/qabstractitemmodel.h42
-rw-r--r--src/corelib/itemmodels/qabstractproxymodel.h46
-rw-r--r--src/corelib/itemmodels/qidentityproxymodel.h40
-rw-r--r--src/corelib/itemmodels/qitemselectionmodel.h2
-rw-r--r--src/corelib/itemmodels/qsortfilterproxymodel.cpp2
-rw-r--r--src/corelib/itemmodels/qsortfilterproxymodel.h62
-rw-r--r--src/corelib/itemmodels/qstringlistmodel.h22
-rw-r--r--src/corelib/json/qjsonarray.h4
-rw-r--r--src/corelib/json/qjsondocument.cpp4
-rw-r--r--src/corelib/json/qjsondocument.h6
-rw-r--r--src/corelib/json/qjsonobject.h4
-rw-r--r--src/corelib/json/qjsonvalue.h2
-rw-r--r--src/corelib/kernel/qabstracteventdispatcher.h6
-rw-r--r--src/corelib/kernel/qcore_unix.cpp2
-rw-r--r--src/corelib/kernel/qcore_unix_p.h2
-rw-r--r--src/corelib/kernel/qcoreapplication.cpp2
-rw-r--r--src/corelib/kernel/qcoreapplication.h10
-rw-r--r--src/corelib/kernel/qeventdispatcher_glib_p.h24
-rw-r--r--src/corelib/kernel/qeventdispatcher_unix_p.h26
-rw-r--r--src/corelib/kernel/qeventloop.h4
-rw-r--r--src/corelib/kernel/qfunctions_vxworks.h3
-rw-r--r--src/corelib/kernel/qjni.cpp2
-rw-r--r--src/corelib/kernel/qjnihelpers.cpp14
-rw-r--r--src/corelib/kernel/qjnionload.cpp2
-rw-r--r--src/corelib/kernel/qmetaobject.cpp6
-rw-r--r--src/corelib/kernel/qmetaobject.h38
-rw-r--r--src/corelib/kernel/qmetatype.h92
-rw-r--r--src/corelib/kernel/qobject.cpp6
-rw-r--r--src/corelib/kernel/qobject.h46
-rw-r--r--src/corelib/kernel/qobject_impl.h4
-rw-r--r--src/corelib/kernel/qobject_p.h16
-rw-r--r--src/corelib/kernel/qobjectdefs.h24
-rw-r--r--src/corelib/kernel/qobjectdefs_impl.h6
-rw-r--r--src/corelib/kernel/qsharedmemory.h4
-rw-r--r--src/corelib/kernel/qsocketnotifier.h4
-rw-r--r--src/corelib/kernel/qtimer.cpp2
-rw-r--r--src/corelib/kernel/qtimer.h4
-rw-r--r--src/corelib/kernel/qtranslator.h4
-rw-r--r--src/corelib/kernel/qvariant.h16
-rw-r--r--src/corelib/kernel/qvariant_p.h6
-rw-r--r--src/corelib/kernel/qwineventnotifier.h4
-rw-r--r--src/corelib/mimetypes/qmimemagicrule_p.h2
-rw-r--r--src/corelib/mimetypes/qmimeprovider_p.h38
-rw-r--r--src/corelib/plugin/qlibrary.h8
-rw-r--r--src/corelib/plugin/qpluginloader.h4
-rw-r--r--src/corelib/plugin/quuid.h12
-rw-r--r--src/corelib/statemachine/qabstractstate.h4
-rw-r--r--src/corelib/statemachine/qabstracttransition.cpp2
-rw-r--r--src/corelib/statemachine/qabstracttransition.h4
-rw-r--r--src/corelib/statemachine/qeventtransition.h10
-rw-r--r--src/corelib/statemachine/qfinalstate.h8
-rw-r--r--src/corelib/statemachine/qhistorystate.cpp2
-rw-r--r--src/corelib/statemachine/qhistorystate.h10
-rw-r--r--src/corelib/statemachine/qsignaltransition.h14
-rw-r--r--src/corelib/statemachine/qsignaltransition_p.h2
-rw-r--r--src/corelib/statemachine/qstate.cpp6
-rw-r--r--src/corelib/statemachine/qstate.h10
-rw-r--r--src/corelib/statemachine/qstatemachine.cpp14
-rw-r--r--src/corelib/statemachine/qstatemachine.h12
-rw-r--r--src/corelib/thread/qatomic.h6
-rw-r--r--src/corelib/thread/qbasicatomic.h1
-rw-r--r--src/corelib/thread/qexception.cpp4
-rw-r--r--src/corelib/thread/qexception.h6
-rw-r--r--src/corelib/thread/qfutex_p.h142
-rw-r--r--src/corelib/thread/qfutureinterface.h2
-rw-r--r--src/corelib/thread/qfuturewatcher.h18
-rw-r--r--src/corelib/thread/qfuturewatcher_p.h4
-rw-r--r--src/corelib/thread/qmutex.h10
-rw-r--r--src/corelib/thread/qmutex_linux.cpp83
-rw-r--r--src/corelib/thread/qreadwritelock.h4
-rw-r--r--src/corelib/thread/qresultstore.h4
-rw-r--r--src/corelib/thread/qsemaphore.cpp206
-rw-r--r--src/corelib/thread/qsemaphore.h5
-rw-r--r--src/corelib/thread/qthread.h6
-rw-r--r--src/corelib/thread/qthread_p.h2
-rw-r--r--src/corelib/thread/qthread_unix.cpp3
-rw-r--r--src/corelib/thread/qthreadpool.cpp2
-rw-r--r--src/corelib/thread/qthreadpool.h2
-rw-r--r--src/corelib/thread/thread.pri1
-rw-r--r--src/corelib/tools/qarraydata.h4
-rw-r--r--src/corelib/tools/qbytearray.h20
-rw-r--r--src/corelib/tools/qbytearraylist.h2
-rw-r--r--src/corelib/tools/qcollator.h2
-rw-r--r--src/corelib/tools/qcollator_win.cpp8
-rw-r--r--src/corelib/tools/qdatetime.h2
-rw-r--r--src/corelib/tools/qeasingcurve.cpp20
-rw-r--r--src/corelib/tools/qeasingcurve.h2
-rw-r--r--src/corelib/tools/qhash.h8
-rw-r--r--src/corelib/tools/qlinkedlist.h4
-rw-r--r--src/corelib/tools/qlist.h4
-rw-r--r--src/corelib/tools/qlocale.cpp14
-rw-r--r--src/corelib/tools/qlocale.h32
-rw-r--r--src/corelib/tools/qlocale_tools.cpp5
-rw-r--r--src/corelib/tools/qlocale_tools_p.h1
-rw-r--r--src/corelib/tools/qlocale_win.cpp12
-rw-r--r--src/corelib/tools/qmap.cpp280
-rw-r--r--src/corelib/tools/qmap.h46
-rw-r--r--src/corelib/tools/qringbuffer_p.h2
-rw-r--r--src/corelib/tools/qscopedpointer.cpp7
-rw-r--r--src/corelib/tools/qscopedpointer.h17
-rw-r--r--src/corelib/tools/qshareddata.h12
-rw-r--r--src/corelib/tools/qsharedpointer.cpp9
-rw-r--r--src/corelib/tools/qsharedpointer.h1
-rw-r--r--src/corelib/tools/qsharedpointer_impl.h39
-rw-r--r--src/corelib/tools/qsimd_p.h11
-rw-r--r--src/corelib/tools/qstring.cpp6
-rw-r--r--src/corelib/tools/qstring.h48
-rw-r--r--src/corelib/tools/qtextboundaryfinder.h2
-rw-r--r--src/corelib/tools/qtimeline.h4
-rw-r--r--src/corelib/tools/qtimezoneprivate_p.h183
-rw-r--r--src/corelib/tools/qtimezoneprivate_win.cpp227
-rw-r--r--src/corelib/tools/qversionnumber.h2
-rw-r--r--src/corelib/tools/tools.pri1
-rw-r--r--src/corelib/xml/qxmlstream.cpp79
-rw-r--r--src/corelib/xml/qxmlstream.h2
-rw-r--r--src/dbus/qdbusabstractinterface.cpp4
-rw-r--r--src/dbus/qdbusabstractinterface.h6
-rw-r--r--src/dbus/qdbusargument.h6
-rw-r--r--src/dbus/qdbusconnection.cpp10
-rw-r--r--src/dbus/qdbusconnection.h2
-rw-r--r--src/dbus/qdbusconnection_p.h12
-rw-r--r--src/dbus/qdbusconnectioninterface.h4
-rw-r--r--src/dbus/qdbusconnectionmanager_p.h2
-rw-r--r--src/dbus/qdbusintegrator.cpp29
-rw-r--r--src/dbus/qdbusintegrator_p.h8
-rw-r--r--src/dbus/qdbusinterface.h8
-rw-r--r--src/dbus/qdbusmetatype.cpp12
-rw-r--r--src/dbus/qdbuspendingcall.h4
-rw-r--r--src/dbus/qdbusreply.h2
-rw-r--r--src/dbus/qdbusserver.cpp2
-rw-r--r--src/dbus/qdbusserver.h4
-rw-r--r--src/dbus/qdbusservicewatcher.h4
-rw-r--r--src/dbus/qdbusthreaddebug_p.h40
-rw-r--r--src/dbus/qdbusvirtualobject.h2
-rw-r--r--src/gui/accessible/qaccessible.cpp1
-rw-r--r--src/gui/accessible/qaccessible.h4
-rw-r--r--src/gui/accessible/qaccessiblebridge.h2
-rw-r--r--src/gui/accessible/qaccessiblecache.cpp2
-rw-r--r--src/gui/accessible/qaccessibleobject.h28
-rw-r--r--src/gui/accessible/qaccessibleplugin.h2
-rw-r--r--src/gui/image/qbitmap.h2
-rw-r--r--src/gui/image/qicon.h4
-rw-r--r--src/gui/image/qicon_p.h22
-rw-r--r--src/gui/image/qiconengineplugin.h2
-rw-r--r--src/gui/image/qiconloader_p.h20
-rw-r--r--src/gui/image/qimage.cpp46
-rw-r--r--src/gui/image/qimage.h34
-rw-r--r--src/gui/image/qimageiohandler.h2
-rw-r--r--src/gui/image/qmovie.h6
-rw-r--r--src/gui/image/qpaintengine_pic_p.h22
-rw-r--r--src/gui/image/qpicture.cpp4
-rw-r--r--src/gui/image/qpicture.h14
-rw-r--r--src/gui/image/qpictureformatplugin.h2
-rw-r--r--src/gui/image/qpixmap.h22
-rw-r--r--src/gui/image/qpixmap_blitter_p.h22
-rw-r--r--src/gui/image/qpixmap_raster_p.h38
-rw-r--r--src/gui/image/qpixmapcache.cpp2
-rw-r--r--src/gui/image/qpixmapcache.h2
-rw-r--r--src/gui/itemmodels/qstandarditemmodel.cpp93
-rw-r--r--src/gui/itemmodels/qstandarditemmodel.h50
-rw-r--r--src/gui/itemmodels/qstandarditemmodel_p.h11
-rw-r--r--src/gui/kernel/qcursor.h2
-rw-r--r--src/gui/kernel/qdnd_p.h6
-rw-r--r--src/gui/kernel/qevent.h6
-rw-r--r--src/gui/kernel/qgenericplugin.h2
-rw-r--r--src/gui/kernel/qguiapplication.cpp247
-rw-r--r--src/gui/kernel/qguiapplication.h6
-rw-r--r--src/gui/kernel/qguiapplication_p.h8
-rw-r--r--src/gui/kernel/qhighdpiscaling.cpp6
-rw-r--r--src/gui/kernel/qoffscreensurface.h10
-rw-r--r--src/gui/kernel/qopenglcontext.h2
-rw-r--r--src/gui/kernel/qopenglcontext_p.h8
-rw-r--r--src/gui/kernel/qopenglwindow.cpp10
-rw-r--r--src/gui/kernel/qopenglwindow.h12
-rw-r--r--src/gui/kernel/qpaintdevicewindow.h8
-rw-r--r--src/gui/kernel/qpalette.h2
-rw-r--r--src/gui/kernel/qplatformcursor.cpp2
-rw-r--r--src/gui/kernel/qplatformgraphicsbuffer.cpp4
-rw-r--r--src/gui/kernel/qplatformgraphicsbufferhelper.h2
-rw-r--r--src/gui/kernel/qplatformnativeinterface.cpp4
-rw-r--r--src/gui/kernel/qplatformoffscreensurface.cpp2
-rw-r--r--src/gui/kernel/qplatformoffscreensurface.h4
-rw-r--r--src/gui/kernel/qplatformsurface.h4
-rw-r--r--src/gui/kernel/qplatformwindow.cpp2
-rw-r--r--src/gui/kernel/qplatformwindow.h4
-rw-r--r--src/gui/kernel/qrasterwindow.cpp6
-rw-r--r--src/gui/kernel/qrasterwindow.h6
-rw-r--r--src/gui/kernel/qshapedpixmapdndwindow_p.h2
-rw-r--r--src/gui/kernel/qsimpledrag.cpp2
-rw-r--r--src/gui/kernel/qsimpledrag_p.h14
-rw-r--r--src/gui/kernel/qwindow.h16
-rw-r--r--src/gui/kernel/qwindowsysteminterface.cpp85
-rw-r--r--src/gui/kernel/qwindowsysteminterface.h37
-rw-r--r--src/gui/kernel/qwindowsysteminterface_p.h29
-rw-r--r--src/gui/math3d/qmatrix4x4.h2
-rw-r--r--src/gui/opengl/qopengl.cpp4
-rw-r--r--src/gui/opengl/qopengl.h4
-rw-r--r--src/gui/opengl/qopenglbuffer.h2
-rw-r--r--src/gui/opengl/qopengldebug.h2
-rw-r--r--src/gui/opengl/qopenglengineshadermanager.cpp4
-rw-r--r--src/gui/opengl/qopenglext.h4
-rw-r--r--src/gui/opengl/qopenglextrafunctions.h2
-rw-r--r--src/gui/opengl/qopenglframebufferobject.cpp6
-rw-r--r--src/gui/opengl/qopenglfunctions.cpp4
-rw-r--r--src/gui/opengl/qopenglfunctions.h2
-rw-r--r--src/gui/opengl/qopenglfunctions_1_0.h2
-rw-r--r--src/gui/opengl/qopenglfunctions_1_1.h2
-rw-r--r--src/gui/opengl/qopenglfunctions_1_2.h2
-rw-r--r--src/gui/opengl/qopenglfunctions_1_3.h2
-rw-r--r--src/gui/opengl/qopenglfunctions_1_4.h2
-rw-r--r--src/gui/opengl/qopenglfunctions_1_5.h2
-rw-r--r--src/gui/opengl/qopenglfunctions_2_0.cpp2
-rw-r--r--src/gui/opengl/qopenglfunctions_2_0.h2
-rw-r--r--src/gui/opengl/qopenglfunctions_2_1.cpp2
-rw-r--r--src/gui/opengl/qopenglfunctions_2_1.h2
-rw-r--r--src/gui/opengl/qopenglfunctions_3_0.cpp4
-rw-r--r--src/gui/opengl/qopenglfunctions_3_0.h2
-rw-r--r--src/gui/opengl/qopenglfunctions_3_1.h2
-rw-r--r--src/gui/opengl/qopenglfunctions_3_2_compatibility.cpp4
-rw-r--r--src/gui/opengl/qopenglfunctions_3_2_compatibility.h2
-rw-r--r--src/gui/opengl/qopenglfunctions_3_2_core.h2
-rw-r--r--src/gui/opengl/qopenglfunctions_3_3_compatibility.cpp2
-rw-r--r--src/gui/opengl/qopenglfunctions_3_3_compatibility.h2
-rw-r--r--src/gui/opengl/qopenglfunctions_3_3_core.h2
-rw-r--r--src/gui/opengl/qopenglfunctions_4_0_compatibility.cpp2
-rw-r--r--src/gui/opengl/qopenglfunctions_4_0_compatibility.h2
-rw-r--r--src/gui/opengl/qopenglfunctions_4_0_core.h2
-rw-r--r--src/gui/opengl/qopenglfunctions_4_1_compatibility.cpp2
-rw-r--r--src/gui/opengl/qopenglfunctions_4_1_compatibility.h2
-rw-r--r--src/gui/opengl/qopenglfunctions_4_1_core.h2
-rw-r--r--src/gui/opengl/qopenglfunctions_4_2_compatibility.cpp2
-rw-r--r--src/gui/opengl/qopenglfunctions_4_2_compatibility.h2
-rw-r--r--src/gui/opengl/qopenglfunctions_4_2_core.h2
-rw-r--r--src/gui/opengl/qopenglfunctions_4_3_compatibility.cpp2
-rw-r--r--src/gui/opengl/qopenglfunctions_4_3_compatibility.h2
-rw-r--r--src/gui/opengl/qopenglfunctions_4_3_core.h2
-rw-r--r--src/gui/opengl/qopenglfunctions_4_4_compatibility.h2
-rw-r--r--src/gui/opengl/qopenglfunctions_4_4_core.h2
-rw-r--r--src/gui/opengl/qopenglfunctions_4_5_compatibility.h2
-rw-r--r--src/gui/opengl/qopenglfunctions_4_5_core.h2
-rw-r--r--src/gui/opengl/qopenglfunctions_es2.h2
-rw-r--r--src/gui/opengl/qopenglgradientcache_p.h4
-rw-r--r--src/gui/opengl/qopenglpaintengine_p.h56
-rw-r--r--src/gui/opengl/qopenglshaderprogram.h8
-rw-r--r--src/gui/opengl/qopengltexture.h36
-rw-r--r--src/gui/opengl/qopengltexturecache_p.h4
-rw-r--r--src/gui/opengl/qopengltextureglyphcache_p.h16
-rw-r--r--src/gui/opengl/qopengltimerquery.h4
-rw-r--r--src/gui/opengl/qopenglversionfunctions.h2
-rw-r--r--src/gui/opengl/qopenglvertexarrayobject.h2
-rw-r--r--src/gui/opengl/qopenglvertexarrayobject_p.h8
-rw-r--r--src/gui/painting/qcolor.h16
-rw-r--r--src/gui/painting/qcompositionfunctions.cpp223
-rw-r--r--src/gui/painting/qdrawhelper.cpp2
-rw-r--r--src/gui/painting/qdrawhelper_neon.cpp40
-rw-r--r--src/gui/painting/qdrawhelper_p.h14
-rw-r--r--src/gui/painting/qmatrix.h2
-rw-r--r--src/gui/painting/qpaintengine_blitter_p.h64
-rw-r--r--src/gui/painting/qpaintengine_raster_p.h82
-rw-r--r--src/gui/painting/qpaintengineex_p.h30
-rw-r--r--src/gui/painting/qpainter.cpp2
-rw-r--r--src/gui/painting/qpainter.h8
-rw-r--r--src/gui/painting/qpdf_p.h26
-rw-r--r--src/gui/painting/qpdfwriter.cpp12
-rw-r--r--src/gui/painting/qpen.h2
-rw-r--r--src/gui/painting/qplatformbackingstore.cpp2
-rw-r--r--src/gui/painting/qregion.cpp11
-rw-r--r--src/gui/painting/qtextureglyphcache_p.h6
-rw-r--r--src/gui/painting/qtransform.cpp8
-rw-r--r--src/gui/painting/qtransform.h6
-rw-r--r--src/gui/text/qabstracttextdocumentlayout.h2
-rw-r--r--src/gui/text/qfont.cpp4
-rw-r--r--src/gui/text/qfont_p.h2
-rw-r--r--src/gui/text/qfontdatabase.cpp12
-rw-r--r--src/gui/text/qfontengine.cpp6
-rw-r--r--src/gui/text/qfontengine_p.h92
-rw-r--r--src/gui/text/qfontengine_qpf2_p.h48
-rw-r--r--src/gui/text/qfontmetrics.cpp170
-rw-r--r--src/gui/text/qfontmetrics.h25
-rw-r--r--src/gui/text/qstatictext.cpp18
-rw-r--r--src/gui/text/qtextdocument.h6
-rw-r--r--src/gui/text/qtextdocumentlayout_p.h22
-rw-r--r--src/gui/text/qtextengine.cpp4
-rw-r--r--src/gui/text/qtexthtmlparser.cpp16
-rw-r--r--src/gui/text/qtextimagehandler_p.h4
-rw-r--r--src/gui/text/qtextlayout.h8
-rw-r--r--src/gui/text/qtextobject.h6
-rw-r--r--src/gui/text/qtextodfwriter.cpp4
-rw-r--r--src/gui/text/qtexttable.h4
-rw-r--r--src/gui/text/qtexttable_p.h4
-rw-r--r--src/gui/util/qvalidator.h28
-rw-r--r--src/network/access/access.pri59
-rw-r--r--src/network/access/http2/hpack.cpp22
-rw-r--r--src/network/access/http2/http2streams_p.h2
-rw-r--r--src/network/access/http2/huffman_p.h13
-rw-r--r--src/network/access/qabstractnetworkcache.h2
-rw-r--r--src/network/access/qabstractprotocolhandler.cpp4
-rw-r--r--src/network/access/qabstractprotocolhandler_p.h4
-rw-r--r--src/network/access/qhsts.cpp16
-rw-r--r--src/network/access/qhsts_p.h5
-rw-r--r--src/network/access/qhttp2protocolhandler.cpp7
-rw-r--r--src/network/access/qhttp2protocolhandler_p.h6
-rw-r--r--src/network/access/qhttpmultipart.h6
-rw-r--r--src/network/access/qhttpmultipart_p.h20
-rw-r--r--src/network/access/qhttpnetworkconnection.cpp12
-rw-r--r--src/network/access/qhttpnetworkconnection_p.h7
-rw-r--r--src/network/access/qhttpnetworkconnectionchannel.cpp30
-rw-r--r--src/network/access/qhttpnetworkconnectionchannel_p.h6
-rw-r--r--src/network/access/qhttpnetworkheader.cpp4
-rw-r--r--src/network/access/qhttpnetworkheader_p.h8
-rw-r--r--src/network/access/qhttpnetworkreply.cpp4
-rw-r--r--src/network/access/qhttpnetworkreply_p.h25
-rw-r--r--src/network/access/qhttpnetworkrequest.cpp18
-rw-r--r--src/network/access/qhttpnetworkrequest_p.h29
-rw-r--r--src/network/access/qhttpprotocolhandler.cpp4
-rw-r--r--src/network/access/qhttpprotocolhandler_p.h10
-rw-r--r--src/network/access/qhttpthreaddelegate.cpp12
-rw-r--r--src/network/access/qhttpthreaddelegate_p.h16
-rw-r--r--src/network/access/qnetworkaccessauthenticationmanager.cpp2
-rw-r--r--src/network/access/qnetworkaccesscache_p.h2
-rw-r--r--src/network/access/qnetworkaccesscachebackend_p.h6
-rw-r--r--src/network/access/qnetworkaccessdebugpipebackend_p.h10
-rw-r--r--src/network/access/qnetworkaccessfilebackend_p.h10
-rw-r--r--src/network/access/qnetworkaccessftpbackend.cpp2
-rw-r--r--src/network/access/qnetworkaccessftpbackend_p.h10
-rw-r--r--src/network/access/qnetworkaccessmanager.cpp20
-rw-r--r--src/network/access/qnetworkaccessmanager.h13
-rw-r--r--src/network/access/qnetworkaccessmanager_p.h2
-rw-r--r--src/network/access/qnetworkcookiejar.h2
-rw-r--r--src/network/access/qnetworkdiskcache.h18
-rw-r--r--src/network/access/qnetworkfile_p.h2
-rw-r--r--src/network/access/qnetworkreply.h8
-rw-r--r--src/network/access/qnetworkreplydataimpl_p.h12
-rw-r--r--src/network/access/qnetworkreplyfileimpl_p.h12
-rw-r--r--src/network/access/qnetworkreplyhttpimpl.cpp14
-rw-r--r--src/network/access/qnetworkreplyhttpimpl_p.h28
-rw-r--r--src/network/access/qnetworkreplyimpl_p.h24
-rw-r--r--src/network/access/qnetworkrequest.cpp14
-rw-r--r--src/network/access/qnetworkrequest.h2
-rw-r--r--src/network/access/qspdyprotocolhandler.cpp4
-rw-r--r--src/network/access/qspdyprotocolhandler_p.h12
-rw-r--r--src/network/bearer/qnetworkconfigmanager.h2
-rw-r--r--src/network/bearer/qnetworksession.h6
-rw-r--r--src/network/configure.json34
-rw-r--r--src/network/kernel/kernel.pri29
-rw-r--r--src/network/kernel/qdnslookup.h8
-rw-r--r--src/network/kernel/qdnslookup_p.h4
-rw-r--r--src/network/kernel/qhostaddress.cpp222
-rw-r--r--src/network/kernel/qhostaddress.h6
-rw-r--r--src/network/kernel/qhostaddress_p.h45
-rw-r--r--src/network/kernel/qhostinfo_p.h4
-rw-r--r--src/network/kernel/qhostinfo_unix.cpp74
-rw-r--r--src/network/kernel/qnetworkdatagram.h2
-rw-r--r--src/network/kernel/qnetworkinterface.cpp318
-rw-r--r--src/network/kernel/qnetworkinterface.h43
-rw-r--r--src/network/kernel/qnetworkinterface_linux.cpp443
-rw-r--r--src/network/kernel/qnetworkinterface_p.h23
-rw-r--r--src/network/kernel/qnetworkinterface_uikit_p.h262
-rw-r--r--src/network/kernel/qnetworkinterface_unix.cpp191
-rw-r--r--src/network/kernel/qnetworkinterface_unix_p.h102
-rw-r--r--src/network/kernel/qnetworkinterface_win.cpp58
-rw-r--r--src/network/kernel/qnetworkproxy.cpp12
-rw-r--r--src/network/network.pro2
-rw-r--r--src/network/socket/qabstractsocket.cpp33
-rw-r--r--src/network/socket/qabstractsocket.h27
-rw-r--r--src/network/socket/qabstractsocket_p.h3
-rw-r--r--src/network/socket/qabstractsocketengine_p.h3
-rw-r--r--src/network/socket/qhttpsocketengine.cpp21
-rw-r--r--src/network/socket/qhttpsocketengine_p.h74
-rw-r--r--src/network/socket/qlocalserver.h4
-rw-r--r--src/network/socket/qlocalsocket.h22
-rw-r--r--src/network/socket/qlocalsocket_p.h2
-rw-r--r--src/network/socket/qlocalsocket_tcp.cpp5
-rw-r--r--src/network/socket/qlocalsocket_unix.cpp5
-rw-r--r--src/network/socket/qnativesocketengine_p.h68
-rw-r--r--src/network/socket/qnativesocketengine_unix.cpp30
-rw-r--r--src/network/socket/qnativesocketengine_win.cpp26
-rw-r--r--src/network/socket/qnativesocketengine_winrt.cpp4
-rw-r--r--src/network/socket/qnet_unix_p.h3
-rw-r--r--src/network/socket/qsctpserver.h2
-rw-r--r--src/network/socket/qsctpserver_p.h2
-rw-r--r--src/network/socket/qsctpsocket.h8
-rw-r--r--src/network/socket/qsctpsocket_p.h6
-rw-r--r--src/network/socket/qsocks5socketengine.cpp2
-rw-r--r--src/network/socket/qsocks5socketengine_p.h78
-rw-r--r--src/network/socket/qtcpserver.h6
-rw-r--r--src/network/socket/qtcpserver_p.h12
-rw-r--r--src/network/socket/qtcpsocket.h6
-rw-r--r--src/network/socket/qudpsocket.h4
-rw-r--r--src/network/socket/socket.pri9
-rw-r--r--src/network/ssl/qsslcertificate.h2
-rw-r--r--src/network/ssl/qssldiffiehellmanparameters_openssl.cpp4
-rw-r--r--src/network/ssl/qsslkey_qt.cpp7
-rw-r--r--src/network/ssl/qsslsocket.cpp14
-rw-r--r--src/network/ssl/qsslsocket.h38
-rw-r--r--src/network/ssl/qsslsocket_mac.cpp70
-rw-r--r--src/network/ssl/qsslsocket_mac_p.h16
-rw-r--r--src/network/ssl/qsslsocket_openssl_p.h18
-rw-r--r--src/network/ssl/qsslsocket_openssl_symbols.cpp2
-rw-r--r--src/network/ssl/qsslsocket_openssl_symbols_p.h8
-rw-r--r--src/network/ssl/qsslsocket_opensslpre11.cpp3
-rw-r--r--src/network/ssl/qsslsocket_p.h9
-rw-r--r--src/network/ssl/qsslsocket_winrt.cpp2
-rw-r--r--src/network/ssl/qsslsocket_winrt_p.h16
-rw-r--r--src/opengl/gl2paintengineex/qglengineshadermanager.cpp4
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h56
-rw-r--r--src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h16
-rw-r--r--src/opengl/opengl.pro1
-rw-r--r--src/opengl/qgl.h30
-rw-r--r--src/opengl/qgl_p.h8
-rw-r--r--src/opengl/qglbuffer.h2
-rw-r--r--src/opengl/qglcolormap.h2
-rw-r--r--src/opengl/qglframebufferobject.h6
-rw-r--r--src/opengl/qglframebufferobject_p.h10
-rw-r--r--src/opengl/qglfunctions.cpp4
-rw-r--r--src/opengl/qglfunctions.h6
-rw-r--r--src/opengl/qglpaintdevice_p.h14
-rw-r--r--src/opengl/qglpixelbuffer.h10
-rw-r--r--src/opengl/qglshaderprogram.h12
-rw-r--r--src/opengl/qgraphicsshadereffect.cpp2
-rw-r--r--src/opengl/qgraphicsshadereffect_p.h2
-rw-r--r--src/openglextensions/qopenglextensions.h502
-rw-r--r--src/platformsupport/devicediscovery/qdevicediscovery_dummy_p.h2
-rw-r--r--src/platformsupport/devicediscovery/qdevicediscovery_static_p.h2
-rw-r--r--src/platformsupport/devicediscovery/qdevicediscovery_udev_p.h2
-rw-r--r--src/platformsupport/edid/qedidvendortable_p.h9
-rw-r--r--src/platformsupport/eglconvenience/qeglpbuffer_p.h4
-rw-r--r--src/platformsupport/eglconvenience/qeglplatformcontext_p.h16
-rw-r--r--src/platformsupport/eventdispatchers/qeventdispatcher_glib_p.h2
-rw-r--r--src/platformsupport/eventdispatchers/qwindowsguieventdispatcher_p.h4
-rw-r--r--src/platformsupport/fbconvenience/qfbbackingstore_p.h10
-rw-r--r--src/platformsupport/fbconvenience/qfbscreen_p.h14
-rw-r--r--src/platformsupport/fbconvenience/qfbwindow_p.h20
-rw-r--r--src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp4
-rw-r--r--src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase_p.h18
-rw-r--r--src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig_p.h2
-rw-r--r--src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp10
-rw-r--r--src/platformsupport/fontdatabases/freetype/qfontengine_ft_p.h86
-rw-r--r--src/platformsupport/fontdatabases/freetype/qfreetypefontdatabase_p.h10
-rw-r--r--src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h18
-rw-r--r--src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h74
-rw-r--r--src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp19
-rw-r--r--src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_ft.cpp6
-rw-r--r--src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_ft_p.h14
-rw-r--r--src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_p.h24
-rw-r--r--src/platformsupport/fontdatabases/windows/qwindowsfontengine_p.h72
-rw-r--r--src/platformsupport/fontdatabases/windows/qwindowsfontenginedirectwrite.cpp14
-rw-r--r--src/platformsupport/fontdatabases/windows/qwindowsfontenginedirectwrite_p.h50
-rw-r--r--src/platformsupport/fontdatabases/windows/qwindowsnativeimage.cpp2
-rw-r--r--src/platformsupport/graphics/qrasterbackingstore_p.h10
-rw-r--r--src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp4
-rw-r--r--src/platformsupport/input/evdevmouse/qevdevmousehandler.cpp7
-rw-r--r--src/platformsupport/input/evdevmouse/qevdevmousehandler_p.h6
-rw-r--r--src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp6
-rw-r--r--src/platformsupport/input/evdevmouse/qevdevmousemanager_p.h3
-rw-r--r--src/platformsupport/input/evdevtablet/qevdevtablethandler_p.h2
-rw-r--r--src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp18
-rw-r--r--src/platformsupport/input/evdevtouch/qevdevtouchhandler_p.h8
-rw-r--r--src/platformsupport/input/integrityhid/qintegrityhidmanager.cpp8
-rw-r--r--src/platformsupport/input/libinput/qlibinputhandler.cpp4
-rw-r--r--src/platformsupport/input/libinput/qlibinputkeyboard.cpp6
-rw-r--r--src/platformsupport/input/libinput/qlibinputpointer.cpp11
-rw-r--r--src/platformsupport/input/libinput/qlibinputtouch.cpp6
-rw-r--r--src/platformsupport/kmsconvenience/qkmsdevice.cpp345
-rw-r--r--src/platformsupport/kmsconvenience/qkmsdevice_p.h124
-rw-r--r--src/platformsupport/linuxaccessibility/bridge_p.h2
-rw-r--r--src/platformsupport/platformcompositor/qopenglcompositorbackingstore.cpp6
-rw-r--r--src/platformsupport/platformcompositor/qopenglcompositorbackingstore_p.h12
-rw-r--r--src/platformsupport/platformsupport.pro1
-rw-r--r--src/platformsupport/services/genericunix/qgenericunixservices.cpp107
-rw-r--r--src/platformsupport/services/genericunix/qgenericunixservices_p.h6
-rw-r--r--src/platformsupport/services/services.pro2
-rw-r--r--src/platformsupport/themes/genericunix/dbusmenu/qdbusmenuadaptor.cpp2
-rw-r--r--src/platformsupport/themes/genericunix/dbusmenu/qdbusmenubar_p.h12
-rw-r--r--src/platformsupport/themes/genericunix/dbusmenu/qdbusplatformmenu.cpp10
-rw-r--r--src/platformsupport/themes/genericunix/dbusmenu/qdbusplatformmenu_p.h64
-rw-r--r--src/platformsupport/themes/genericunix/dbustray/qdbustrayicon.cpp18
-rw-r--r--src/platformsupport/themes/genericunix/dbustray/qdbustrayicon_p.h20
-rw-r--r--src/platformsupport/themes/genericunix/qgenericunixthemes.cpp10
-rw-r--r--src/platformsupport/themes/genericunix/qgenericunixthemes_p.h28
-rw-r--r--src/platformsupport/windowsuiautomation/qwindowsuiawrapper.cpp117
-rw-r--r--src/platformsupport/windowsuiautomation/qwindowsuiawrapper_p.h100
-rw-r--r--src/platformsupport/windowsuiautomation/uiaattributeids.h88
-rw-r--r--src/platformsupport/windowsuiautomation/uiaclientinterfaces.h255
-rw-r--r--src/platformsupport/windowsuiautomation/uiacontroltypeids.h85
-rw-r--r--src/platformsupport/windowsuiautomation/uiaerrorids.h51
-rw-r--r--src/platformsupport/windowsuiautomation/uiaeventids.h79
-rw-r--r--src/platformsupport/windowsuiautomation/uiageneralids.h46
-rw-r--r--src/platformsupport/windowsuiautomation/uiapatternids.h78
-rw-r--r--src/platformsupport/windowsuiautomation/uiapropertyids.h212
-rw-r--r--src/platformsupport/windowsuiautomation/uiaserverinterfaces.h352
-rw-r--r--src/platformsupport/windowsuiautomation/uiatypes.h145
-rw-r--r--src/platformsupport/windowsuiautomation/windowsuiautomation.pro23
-rw-r--r--src/plugins/bearer/android/jar/bundledjar.pro3
-rw-r--r--src/plugins/bearer/android/jar/distributedjar.pro2
-rw-r--r--src/plugins/bearer/android/jar/jar.pri11
-rw-r--r--src/plugins/bearer/android/jar/jar.pro15
-rw-r--r--src/plugins/bearer/android/src/main.cpp2
-rw-r--r--src/plugins/bearer/android/src/qandroidbearerengine.h28
-rw-r--r--src/plugins/bearer/generic/main.cpp2
-rw-r--r--src/plugins/bearer/generic/qgenericengine.h18
-rw-r--r--src/plugins/bearer/qnetworksession_impl.h44
-rw-r--r--src/plugins/generic/evdevkeyboard/main.cpp2
-rw-r--r--src/plugins/generic/evdevmouse/main.cpp2
-rw-r--r--src/plugins/generic/evdevtablet/main.cpp2
-rw-r--r--src/plugins/generic/evdevtouch/main.cpp2
-rw-r--r--src/plugins/imageformats/jpeg/qjpeghandler.cpp3
-rw-r--r--src/plugins/platforminputcontexts/compose/qcomposeplatforminputcontext.h10
-rw-r--r--src/plugins/platforminputcontexts/compose/qcomposeplatforminputcontextmain.cpp2
-rw-r--r--src/plugins/platforminputcontexts/ibus/main.cpp2
-rw-r--r--src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp34
-rw-r--r--src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.h20
-rw-r--r--src/plugins/platforms/cocoa/qcocoaaccessibility.h8
-rw-r--r--src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm20
-rw-r--r--src/plugins/platforms/cocoa/qcocoabackingstore.h4
-rw-r--r--src/plugins/platforms/cocoa/qcocoaclipboard.h8
-rw-r--r--src/plugins/platforms/cocoa/qcocoacolordialoghelper.h10
-rw-r--r--src/plugins/platforms/cocoa/qcocoacursor.h6
-rw-r--r--src/plugins/platforms/cocoa/qcocoacursor.mm5
-rw-r--r--src/plugins/platforms/cocoa/qcocoadrag.h4
-rw-r--r--src/plugins/platforms/cocoa/qcocoafiledialoghelper.h22
-rw-r--r--src/plugins/platforms/cocoa/qcocoafontdialoghelper.h10
-rw-r--r--src/plugins/platforms/cocoa/qcocoaglcontext.h14
-rw-r--r--src/plugins/platforms/cocoa/qcocoahelpers.h22
-rw-r--r--src/plugins/platforms/cocoa/qcocoahelpers.mm68
-rw-r--r--src/plugins/platforms/cocoa/qcocoainputcontext.h6
-rw-r--r--src/plugins/platforms/cocoa/qcocoaintegration.h40
-rw-r--r--src/plugins/platforms/cocoa/qcocoamenu.h32
-rw-r--r--src/plugins/platforms/cocoa/qcocoamenubar.h10
-rw-r--r--src/plugins/platforms/cocoa/qcocoamenubar.mm2
-rw-r--r--src/plugins/platforms/cocoa/qcocoamenuitem.h26
-rw-r--r--src/plugins/platforms/cocoa/qcocoanativeinterface.h8
-rw-r--r--src/plugins/platforms/cocoa/qcocoanativeinterface.mm2
-rw-r--r--src/plugins/platforms/cocoa/qcocoaprintdevice.h34
-rw-r--r--src/plugins/platforms/cocoa/qcocoaprintdevice.mm11
-rw-r--r--src/plugins/platforms/cocoa/qcocoaprintersupport.h10
-rw-r--r--src/plugins/platforms/cocoa/qcocoascreen.h40
-rw-r--r--src/plugins/platforms/cocoa/qcocoascreen.mm97
-rw-r--r--src/plugins/platforms/cocoa/qcocoaservices.h4
-rw-r--r--src/plugins/platforms/cocoa/qcocoasystemtrayicon.h18
-rw-r--r--src/plugins/platforms/cocoa/qcocoatheme.h24
-rw-r--r--src/plugins/platforms/cocoa/qcocoatheme.mm6
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.h58
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.mm23
-rw-r--r--src/plugins/platforms/cocoa/qmultitouch_mac.mm3
-rw-r--r--src/plugins/platforms/cocoa/qnsview.mm21
-rw-r--r--src/plugins/platforms/cocoa/qprintengine_mac.mm2
-rw-r--r--src/plugins/platforms/cocoa/qprintengine_mac_p.h4
-rw-r--r--src/plugins/platforms/direct2d/qwindowsdirect2dbackingstore.h10
-rw-r--r--src/plugins/platforms/direct2d/qwindowsdirect2ddevicecontext.cpp2
-rw-r--r--src/plugins/platforms/direct2d/qwindowsdirect2dintegration.cpp2
-rw-r--r--src/plugins/platforms/direct2d/qwindowsdirect2dintegration.h10
-rw-r--r--src/plugins/platforms/direct2d/qwindowsdirect2dnativeinterface.h2
-rw-r--r--src/plugins/platforms/direct2d/qwindowsdirect2dpaintdevice.h6
-rw-r--r--src/plugins/platforms/direct2d/qwindowsdirect2dpaintengine.cpp2
-rw-r--r--src/plugins/platforms/direct2d/qwindowsdirect2dpaintengine.h50
-rw-r--r--src/plugins/platforms/direct2d/qwindowsdirect2dplatformpixmap.h20
-rw-r--r--src/plugins/platforms/direct2d/qwindowsdirect2dwindow.cpp6
-rw-r--r--src/plugins/platforms/direct2d/qwindowsdirect2dwindow.h2
-rw-r--r--src/plugins/platforms/eglfs/api/qeglfsdeviceintegration.cpp16
-rw-r--r--src/plugins/platforms/eglfs/api/qeglfsdeviceintegration_p.h2
-rw-r--r--src/plugins/platforms/eglfs/api/qeglfsintegration.cpp5
-rw-r--r--src/plugins/platforms/eglfs/api/qeglfswindow_p.h2
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/eglfs_kms.pro6
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmcursor.cpp6
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmdevice.cpp50
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmdevice.h12
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmintegration.cpp56
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.cpp240
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.h34
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmwindow.cpp80
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmwindow.h (renamed from src/plugins/platforms/windows/accessible/comutils.h)35
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldevice.cpp2
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp10
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldevicescreen.cpp10
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsintegration.cpp12
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsintegration.h1
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsscreen.cpp47
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsscreen.h8
-rw-r--r--src/plugins/platforms/haiku/main.cpp2
-rw-r--r--src/plugins/platforms/haiku/main.h2
-rw-r--r--src/plugins/platforms/haiku/qhaikuapplication.h4
-rw-r--r--src/plugins/platforms/haiku/qhaikubuffer.cpp6
-rw-r--r--src/plugins/platforms/haiku/qhaikuclipboard.cpp10
-rw-r--r--src/plugins/platforms/haiku/qhaikuclipboard.h10
-rw-r--r--src/plugins/platforms/haiku/qhaikucursor.h2
-rw-r--r--src/plugins/platforms/haiku/qhaikuintegration.cpp6
-rw-r--r--src/plugins/platforms/haiku/qhaikuintegration.h14
-rw-r--r--src/plugins/platforms/haiku/qhaikurasterbackingstore.cpp6
-rw-r--r--src/plugins/platforms/haiku/qhaikurasterbackingstore.h6
-rw-r--r--src/plugins/platforms/haiku/qhaikurasterwindow.cpp4
-rw-r--r--src/plugins/platforms/haiku/qhaikurasterwindow.h16
-rw-r--r--src/plugins/platforms/haiku/qhaikuscreen.cpp8
-rw-r--r--src/plugins/platforms/haiku/qhaikuscreen.h10
-rw-r--r--src/plugins/platforms/haiku/qhaikuservices.h6
-rw-r--r--src/plugins/platforms/haiku/qhaikuwindow.cpp8
-rw-r--r--src/plugins/platforms/haiku/qhaikuwindow.h36
-rw-r--r--src/plugins/platforms/integrity/main.cpp2
-rw-r--r--src/plugins/platforms/integrity/qintegrityfbintegration.h18
-rw-r--r--src/plugins/platforms/integrity/qintegrityfbscreen.h4
-rw-r--r--src/plugins/platforms/integrity/qintegrityhidmanager.cpp8
-rw-r--r--src/plugins/platforms/ios/optional/nsphotolibrarysupport/qiosfileengineassetslibrary.mm8
-rw-r--r--src/plugins/platforms/ios/qiosbackingstore.h2
-rw-r--r--src/plugins/platforms/ios/qiosclipboard.h8
-rw-r--r--src/plugins/platforms/ios/qiosclipboard.mm4
-rw-r--r--src/plugins/platforms/ios/qioscontext.h16
-rw-r--r--src/plugins/platforms/ios/qioseventdispatcher.h4
-rw-r--r--src/plugins/platforms/ios/qiosfiledialog.h22
-rw-r--r--src/plugins/platforms/ios/qiosfiledialog.mm4
-rw-r--r--src/plugins/platforms/ios/qiosinputcontext.h22
-rw-r--r--src/plugins/platforms/ios/qiosintegration.h34
-rw-r--r--src/plugins/platforms/ios/qiosintegration.mm7
-rw-r--r--src/plugins/platforms/ios/qiosmenu.h52
-rw-r--r--src/plugins/platforms/ios/qiosmessagedialog.h6
-rw-r--r--src/plugins/platforms/ios/qiosmessagedialog.mm4
-rw-r--r--src/plugins/platforms/ios/qiosoptionalplugininterface.h2
-rw-r--r--src/plugins/platforms/ios/qiosscreen.h22
-rw-r--r--src/plugins/platforms/ios/qiostextinputoverlay.mm18
-rw-r--r--src/plugins/platforms/ios/qiostheme.h14
-rw-r--r--src/plugins/platforms/ios/qioswindow.h34
-rw-r--r--src/plugins/platforms/ios/quiview.h1
-rw-r--r--src/plugins/platforms/ios/quiview.mm94
-rw-r--r--src/plugins/platforms/linuxfb/main.cpp2
-rw-r--r--src/plugins/platforms/linuxfb/qlinuxfbdrmscreen.cpp76
-rw-r--r--src/plugins/platforms/linuxfb/qlinuxfbintegration.h18
-rw-r--r--src/plugins/platforms/minimal/main.cpp2
-rw-r--r--src/plugins/platforms/minimal/qminimalbackingstore.h6
-rw-r--r--src/plugins/platforms/minimal/qminimalintegration.cpp2
-rw-r--r--src/plugins/platforms/minimal/qminimalintegration.h16
-rw-r--r--src/plugins/platforms/minimalegl/main.cpp2
-rw-r--r--src/plugins/platforms/minimalegl/qminimaleglbackingstore.h10
-rw-r--r--src/plugins/platforms/minimalegl/qminimaleglintegration.cpp4
-rw-r--r--src/plugins/platforms/minimalegl/qminimaleglintegration.h14
-rw-r--r--src/plugins/platforms/minimalegl/qminimaleglscreen.cpp2
-rw-r--r--src/plugins/platforms/minimalegl/qminimaleglscreen.h6
-rw-r--r--src/plugins/platforms/minimalegl/qminimaleglwindow.h4
-rw-r--r--src/plugins/platforms/offscreen/main.cpp2
-rw-r--r--src/plugins/platforms/offscreen/qoffscreencommon.cpp6
-rw-r--r--src/plugins/platforms/offscreen/qoffscreencommon.h20
-rw-r--r--src/plugins/platforms/offscreen/qoffscreenintegration.h18
-rw-r--r--src/plugins/platforms/offscreen/qoffscreenintegration_x11.h18
-rw-r--r--src/plugins/platforms/offscreen/qoffscreenwindow.h12
-rw-r--r--src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp5
-rw-r--r--src/plugins/platforms/qnx/qqnxrasterwindow.cpp7
-rw-r--r--src/plugins/platforms/qnx/qqnxwindow.cpp19
-rw-r--r--src/plugins/platforms/qnx/qqnxwindow.h2
-rw-r--r--src/plugins/platforms/windows/accessible/accessible.pri19
-rw-r--r--src/plugins/platforms/windows/accessible/comutils.cpp280
-rw-r--r--src/plugins/platforms/windows/accessible/iaccessible2.cpp1640
-rw-r--r--src/plugins/platforms/windows/accessible/iaccessible2.h358
-rw-r--r--src/plugins/platforms/windows/accessible/qwindowsaccessibility.cpp245
-rw-r--r--src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.cpp1223
-rw-r--r--src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.h176
-rw-r--r--src/plugins/platforms/windows/qwin10helpers.cpp3
-rw-r--r--src/plugins/platforms/windows/qwindowsbackingstore.cpp2
-rw-r--r--src/plugins/platforms/windows/qwindowscontext.cpp34
-rw-r--r--src/plugins/platforms/windows/qwindowscontext.h14
-rw-r--r--src/plugins/platforms/windows/qwindowscursor.cpp2
-rw-r--r--src/plugins/platforms/windows/qwindowscursor.h6
-rw-r--r--src/plugins/platforms/windows/qwindowsdialoghelpers.cpp29
-rw-r--r--src/plugins/platforms/windows/qwindowseglcontext.h2
-rw-r--r--src/plugins/platforms/windows/qwindowsglcontext.cpp4
-rw-r--r--src/plugins/platforms/windows/qwindowsinputcontext.cpp22
-rw-r--r--src/plugins/platforms/windows/qwindowsinputcontext.h4
-rw-r--r--src/plugins/platforms/windows/qwindowsintegration.cpp14
-rw-r--r--src/plugins/platforms/windows/qwindowsmousehandler.cpp40
-rw-r--r--src/plugins/platforms/windows/qwindowsnativeinterface.cpp4
-rw-r--r--src/plugins/platforms/windows/qwindowsscreen.cpp2
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.cpp25
-rw-r--r--src/plugins/platforms/windows/uiautomation/qwindowsuiaaccessibility.cpp140
-rw-r--r--src/plugins/platforms/windows/uiautomation/qwindowsuiaaccessibility.h (renamed from src/plugins/platforms/windows/accessible/qwindowsaccessibility.h)28
-rw-r--r--src/plugins/platforms/windows/uiautomation/qwindowsuiabaseprovider.cpp81
-rw-r--r--src/plugins/platforms/windows/uiautomation/qwindowsuiabaseprovider.h78
-rw-r--r--src/plugins/platforms/windows/uiautomation/qwindowsuiagriditemprovider.cpp176
-rw-r--r--src/plugins/platforms/windows/uiautomation/qwindowsuiagriditemprovider.h71
-rw-r--r--src/plugins/platforms/windows/uiautomation/qwindowsuiagridprovider.cpp136
-rw-r--r--src/plugins/platforms/windows/uiautomation/qwindowsuiagridprovider.h69
-rw-r--r--src/plugins/platforms/windows/uiautomation/qwindowsuiainvokeprovider.cpp84
-rw-r--r--src/plugins/platforms/windows/uiautomation/qwindowsuiainvokeprovider.h67
-rw-r--r--src/plugins/platforms/windows/uiautomation/qwindowsuiamainprovider.cpp638
-rw-r--r--src/plugins/platforms/windows/uiautomation/qwindowsuiamainprovider.h105
-rw-r--r--src/plugins/platforms/windows/uiautomation/qwindowsuiaprovidercache.cpp106
-rw-r--r--src/plugins/platforms/windows/uiautomation/qwindowsuiaprovidercache.h77
-rw-r--r--src/plugins/platforms/windows/uiautomation/qwindowsuiarangevalueprovider.cpp190
-rw-r--r--src/plugins/platforms/windows/uiautomation/qwindowsuiarangevalueprovider.h73
-rw-r--r--src/plugins/platforms/windows/uiautomation/qwindowsuiaselectionitemprovider.cpp201
-rw-r--r--src/plugins/platforms/windows/uiautomation/qwindowsuiaselectionitemprovider.h71
-rw-r--r--src/plugins/platforms/windows/uiautomation/qwindowsuiaselectionprovider.cpp147
-rw-r--r--src/plugins/platforms/windows/uiautomation/qwindowsuiaselectionprovider.h69
-rw-r--r--src/plugins/platforms/windows/uiautomation/qwindowsuiatableitemprovider.cpp129
-rw-r--r--src/plugins/platforms/windows/uiautomation/qwindowsuiatableitemprovider.h68
-rw-r--r--src/plugins/platforms/windows/uiautomation/qwindowsuiatableprovider.cpp154
-rw-r--r--src/plugins/platforms/windows/uiautomation/qwindowsuiatableprovider.h69
-rw-r--r--src/plugins/platforms/windows/uiautomation/qwindowsuiatextprovider.cpp261
-rw-r--r--src/plugins/platforms/windows/uiautomation/qwindowsuiatextprovider.h80
-rw-r--r--src/plugins/platforms/windows/uiautomation/qwindowsuiatextrangeprovider.cpp554
-rw-r--r--src/plugins/platforms/windows/uiautomation/qwindowsuiatextrangeprovider.h88
-rw-r--r--src/plugins/platforms/windows/uiautomation/qwindowsuiatoggleprovider.cpp105
-rw-r--r--src/plugins/platforms/windows/uiautomation/qwindowsuiatoggleprovider.h68
-rw-r--r--src/plugins/platforms/windows/uiautomation/qwindowsuiautils.cpp221
-rw-r--r--src/plugins/platforms/windows/uiautomation/qwindowsuiautils.h89
-rw-r--r--src/plugins/platforms/windows/uiautomation/qwindowsuiavalueprovider.cpp132
-rw-r--r--src/plugins/platforms/windows/uiautomation/qwindowsuiavalueprovider.h70
-rw-r--r--src/plugins/platforms/windows/uiautomation/uiautomation.pri43
-rw-r--r--src/plugins/platforms/windows/windows.pri4
-rw-r--r--src/plugins/platforms/winrt/qwinrtclipboard.cpp2
-rw-r--r--src/plugins/platforms/winrt/qwinrtcursor.cpp2
-rw-r--r--src/plugins/platforms/winrt/qwinrtdrag.cpp2
-rw-r--r--src/plugins/platforms/winrt/qwinrtfiledialoghelper.cpp2
-rw-r--r--src/plugins/platforms/winrt/qwinrtfileengine.cpp2
-rw-r--r--src/plugins/platforms/winrt/qwinrtscreen.cpp8
-rw-r--r--src/plugins/platforms/winrt/qwinrtwindow.h4
-rw-r--r--src/plugins/platforms/xcb/gl_integrations/qxcbglintegration.h2
-rw-r--r--src/plugins/platforms/xcb/gl_integrations/qxcbnativeinterfacehandler.cpp12
-rw-r--r--src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglintegration.cpp2
-rw-r--r--src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglnativeinterfacehandler.cpp10
-rw-r--r--src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglwindow.cpp2
-rw-r--r--src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp4
-rw-r--r--src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxintegration.cpp2
-rw-r--r--src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxnativeinterfacehandler.cpp2
-rw-r--r--src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxwindow.cpp4
-rw-r--r--src/plugins/platforms/xcb/nativepainting/qbackingstore_x11.cpp6
-rw-r--r--src/plugins/platforms/xcb/nativepainting/qpaintengine_x11_p.h38
-rw-r--r--src/plugins/platforms/xcb/nativepainting/qpixmap_x11_p.h34
-rw-r--r--src/plugins/platforms/xcb/nativepainting/qxcbnativepainting.cpp4
-rw-r--r--src/plugins/platforms/xcb/qxcbbackingstore.cpp205
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection.cpp29
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection.h13
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection_xi2.cpp2
-rw-r--r--src/plugins/platforms/xcb/qxcbcursor.cpp72
-rw-r--r--src/plugins/platforms/xcb/qxcbdrag.cpp6
-rw-r--r--src/plugins/platforms/xcb/qxcbimage.cpp170
-rw-r--r--src/plugins/platforms/xcb/qxcbimage.h4
-rw-r--r--src/plugins/platforms/xcb/qxcbintegration.cpp8
-rw-r--r--src/plugins/platforms/xcb/qxcbnativeinterface.cpp54
-rw-r--r--src/plugins/platforms/xcb/qxcbscreen.cpp6
-rw-r--r--src/plugins/platforms/xcb/qxcbscreen.h2
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.cpp170
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.h12
-rw-r--r--src/plugins/platformthemes/gtk3/main.cpp2
-rw-r--r--src/plugins/platformthemes/gtk3/qgtk3dialoghelpers.h42
-rw-r--r--src/plugins/platformthemes/gtk3/qgtk3theme.h12
-rw-r--r--src/plugins/printsupport/cups/main.cpp2
-rw-r--r--src/plugins/printsupport/cups/qcupsprintengine_p.h8
-rw-r--r--src/plugins/printsupport/cups/qcupsprintersupport_p.h10
-rw-r--r--src/plugins/printsupport/cups/qppdprintdevice.h34
-rw-r--r--src/plugins/printsupport/windows/qwindowsprintdevice.cpp4
-rw-r--r--src/plugins/printsupport/windows/qwindowsprintdevice.h30
-rw-r--r--src/plugins/printsupport/windows/qwindowsprintersupport.h10
-rw-r--r--src/plugins/sqldrivers/db2/qsql_db2.cpp32
-rw-r--r--src/plugins/sqldrivers/db2/qsql_db2_p.h26
-rw-r--r--src/plugins/sqldrivers/ibase/qsql_ibase.cpp16
-rw-r--r--src/plugins/sqldrivers/ibase/qsql_ibase_p.h32
-rw-r--r--src/plugins/sqldrivers/mysql/main.cpp2
-rw-r--r--src/plugins/sqldrivers/mysql/qsql_mysql.cpp32
-rw-r--r--src/plugins/sqldrivers/mysql/qsql_mysql_p.h28
-rw-r--r--src/plugins/sqldrivers/oci/qsql_oci.cpp229
-rw-r--r--src/plugins/sqldrivers/oci/qsql_oci_p.h24
-rw-r--r--src/plugins/sqldrivers/odbc/qsql_odbc.cpp36
-rw-r--r--src/plugins/sqldrivers/odbc/qsql_odbc_p.h28
-rw-r--r--src/plugins/sqldrivers/psql/main.cpp2
-rw-r--r--src/plugins/sqldrivers/psql/qsql_psql.cpp30
-rw-r--r--src/plugins/sqldrivers/psql/qsql_psql_p.h34
-rw-r--r--src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp22
-rw-r--r--src/plugins/sqldrivers/sqlite/qsql_sqlite_p.h30
-rw-r--r--src/plugins/sqldrivers/sqlite/smain.cpp2
-rw-r--r--src/plugins/sqldrivers/sqlite2/qsql_sqlite2.cpp16
-rw-r--r--src/plugins/sqldrivers/sqlite2/qsql_sqlite2_p.h24
-rw-r--r--src/plugins/sqldrivers/tds/qsql_tds.cpp12
-rw-r--r--src/plugins/sqldrivers/tds/qsql_tds_p.h26
-rw-r--r--src/plugins/styles/windowsvista/qwindowsxpstyle.cpp34
-rw-r--r--src/plugins/styles/windowsvista/qwindowsxpstyle_p_p.h8
-rw-r--r--src/printsupport/dialogs/qabstractprintdialog.h4
-rw-r--r--src/printsupport/dialogs/qpagesetupdialog.h10
-rw-r--r--src/printsupport/dialogs/qpagesetupdialog_unix.cpp2
-rw-r--r--src/printsupport/dialogs/qprintdialog.h12
-rw-r--r--src/printsupport/dialogs/qprintdialog_unix.cpp2
-rw-r--r--src/printsupport/dialogs/qprintpreviewdialog.cpp8
-rw-r--r--src/printsupport/dialogs/qprintpreviewdialog.h8
-rw-r--r--src/printsupport/kernel/qprintengine_pdf_p.h16
-rw-r--r--src/printsupport/kernel/qprinter.cpp12
-rw-r--r--src/printsupport/kernel/qprinter.h14
-rw-r--r--src/printsupport/widgets/qprintpreviewwidget.cpp8
-rw-r--r--src/printsupport/widgets/qprintpreviewwidget.h6
-rw-r--r--src/sql/kernel/qsqlcachedresult_p.h20
-rw-r--r--src/sql/kernel/qsqldatabase.h2
-rw-r--r--src/sql/kernel/qsqldriver.h4
-rw-r--r--src/sql/kernel/qsqldriverplugin.h2
-rw-r--r--src/sql/kernel/qsqlnulldriver_p.h52
-rw-r--r--src/sql/models/qsqlrelationaltablemodel.cpp8
-rw-r--r--src/sql/models/qsqlrelationaltablemodel.h24
-rw-r--r--src/sql/models/qsqltablemodel.h30
-rw-r--r--src/testlib/3rdparty/cycle_p.h17
-rw-r--r--src/testlib/qbenchmarkperfevents_p.h20
-rw-r--r--src/testlib/qcsvbenchmarklogger_p.h14
-rw-r--r--src/testlib/qsignalspy.h4
-rw-r--r--src/testlib/qtest.h2
-rw-r--r--src/testlib/qtest_gui.h14
-rw-r--r--src/testlib/qtestaccessible.h8
-rw-r--r--src/testlib/qtestcase.cpp12
-rw-r--r--src/testlib/qtestcase.h14
-rw-r--r--src/testlib/qtesteventloop.h6
-rw-r--r--src/testlib/qtestmouse.h19
-rw-r--r--src/testlib/qtesttable.cpp6
-rw-r--r--src/testlib/qtesttouch.h16
-rw-r--r--src/testlib/qxctestlogger_p.h16
-rw-r--r--src/tools/bootstrap/bootstrap.pro1
-rw-r--r--src/tools/moc/generator.cpp2
-rw-r--r--src/tools/rcc/rcc.cpp6
-rw-r--r--src/tools/uic/cpp/cppwritedeclaration.h14
-rw-r--r--src/tools/uic/cpp/cppwriteincludes.h18
-rw-r--r--src/tools/uic/cpp/cppwriteinitialization.h28
-rw-r--r--src/tools/uic/customwidgetsinfo.h6
-rw-r--r--src/tools/uic/databaseinfo.h4
-rw-r--r--src/tools/uic/validator.h12
-rw-r--r--src/widgets/accessible/complexwidgets.cpp32
-rw-r--r--src/widgets/accessible/complexwidgets_p.h36
-rw-r--r--src/widgets/accessible/itemviews_p.h178
-rw-r--r--src/widgets/accessible/qaccessiblemenu.cpp2
-rw-r--r--src/widgets/accessible/qaccessiblemenu_p.h54
-rw-r--r--src/widgets/accessible/qaccessiblewidget.h36
-rw-r--r--src/widgets/accessible/qaccessiblewidgets_p.h132
-rw-r--r--src/widgets/accessible/rangecontrols.cpp2
-rw-r--r--src/widgets/accessible/rangecontrols_p.h72
-rw-r--r--src/widgets/accessible/simplewidgets.cpp2
-rw-r--r--src/widgets/accessible/simplewidgets_p.h118
-rw-r--r--src/widgets/dialogs/qcolordialog.cpp71
-rw-r--r--src/widgets/dialogs/qcolordialog.h14
-rw-r--r--src/widgets/dialogs/qdialog.h2
-rw-r--r--src/widgets/dialogs/qdialog_p.h2
-rw-r--r--src/widgets/dialogs/qerrormessage.cpp4
-rw-r--r--src/widgets/dialogs/qerrormessage.h6
-rw-r--r--src/widgets/dialogs/qfiledialog.cpp4
-rw-r--r--src/widgets/dialogs/qfiledialog.h38
-rw-r--r--src/widgets/dialogs/qfiledialog_p.h22
-rw-r--r--src/widgets/dialogs/qfileinfogatherer_p.h2
-rw-r--r--src/widgets/dialogs/qfilesystemmodel.h42
-rw-r--r--src/widgets/dialogs/qfontdialog.cpp2
-rw-r--r--src/widgets/dialogs/qfontdialog.h16
-rw-r--r--src/widgets/dialogs/qfontdialog_p.h6
-rw-r--r--src/widgets/dialogs/qfscompleter_p.h4
-rw-r--r--src/widgets/dialogs/qinputdialog.cpp11
-rw-r--r--src/widgets/dialogs/qinputdialog.h22
-rw-r--r--src/widgets/dialogs/qmessagebox.cpp12
-rw-r--r--src/widgets/dialogs/qmessagebox.h18
-rw-r--r--src/widgets/dialogs/qprogressdialog.h14
-rw-r--r--src/widgets/dialogs/qsidebar_p.h20
-rw-r--r--src/widgets/dialogs/qwizard.cpp12
-rw-r--r--src/widgets/dialogs/qwizard.h22
-rw-r--r--src/widgets/dialogs/qwizard_win.cpp5
-rw-r--r--src/widgets/dialogs/qwizard_win_p.h4
-rw-r--r--src/widgets/effects/qgraphicseffect.h26
-rw-r--r--src/widgets/effects/qpixmapfilter_p.h14
-rw-r--r--src/widgets/graphicsview/qgraphicsanchorlayout.h14
-rw-r--r--src/widgets/graphicsview/qgraphicsanchorlayout_p.h4
-rw-r--r--src/widgets/graphicsview/qgraphicsgridlayout.h14
-rw-r--r--src/widgets/graphicsview/qgraphicsgridlayoutengine_p.h14
-rw-r--r--src/widgets/graphicsview/qgraphicsitem.h270
-rw-r--r--src/widgets/graphicsview/qgraphicsitem_p.h22
-rw-r--r--src/widgets/graphicsview/qgraphicsitemanimation.h2
-rw-r--r--src/widgets/graphicsview/qgraphicslayout.h6
-rw-r--r--src/widgets/graphicsview/qgraphicslayoutitem.h2
-rw-r--r--src/widgets/graphicsview/qgraphicslayoutstyleinfo_p.h10
-rw-r--r--src/widgets/graphicsview/qgraphicslinearlayout.h16
-rw-r--r--src/widgets/graphicsview/qgraphicsproxywidget.h66
-rw-r--r--src/widgets/graphicsview/qgraphicsscene.h16
-rw-r--r--src/widgets/graphicsview/qgraphicsscene_bsp.cpp6
-rw-r--r--src/widgets/graphicsview/qgraphicsscenebsptreeindex_p.h20
-rw-r--r--src/widgets/graphicsview/qgraphicsscenelinearindex_p.h10
-rw-r--r--src/widgets/graphicsview/qgraphicstransform.h10
-rw-r--r--src/widgets/graphicsview/qgraphicsview.h56
-rw-r--r--src/widgets/graphicsview/qgraphicswidget.cpp2
-rw-r--r--src/widgets/graphicsview/qgraphicswidget.h34
-rw-r--r--src/widgets/graphicsview/qgraphicswidget_p.h16
-rw-r--r--src/widgets/itemviews/qabstractitemdelegate.h4
-rw-r--r--src/widgets/itemviews/qabstractitemview.h44
-rw-r--r--src/widgets/itemviews/qcolumnview.h40
-rw-r--r--src/widgets/itemviews/qcolumnview_p.h26
-rw-r--r--src/widgets/itemviews/qcolumnviewgrip_p.h10
-rw-r--r--src/widgets/itemviews/qdatawidgetmapper.h2
-rw-r--r--src/widgets/itemviews/qdirmodel.h34
-rw-r--r--src/widgets/itemviews/qheaderview.h56
-rw-r--r--src/widgets/itemviews/qitemdelegate.cpp5
-rw-r--r--src/widgets/itemviews/qitemdelegate.h18
-rw-r--r--src/widgets/itemviews/qitemeditorfactory.cpp4
-rw-r--r--src/widgets/itemviews/qitemeditorfactory_p.h2
-rw-r--r--src/widgets/itemviews/qlistview.h70
-rw-r--r--src/widgets/itemviews/qlistwidget.cpp19
-rw-r--r--src/widgets/itemviews/qlistwidget.h23
-rw-r--r--src/widgets/itemviews/qlistwidget_p.h2
-rw-r--r--src/widgets/itemviews/qstyleditemdelegate.h18
-rw-r--r--src/widgets/itemviews/qtableview.cpp2
-rw-r--r--src/widgets/itemviews/qtableview.h54
-rw-r--r--src/widgets/itemviews/qtablewidget.cpp16
-rw-r--r--src/widgets/itemviews/qtablewidget.h17
-rw-r--r--src/widgets/itemviews/qtreeview.cpp21
-rw-r--r--src/widgets/itemviews/qtreeview.h77
-rw-r--r--src/widgets/itemviews/qtreewidget.cpp4
-rw-r--r--src/widgets/itemviews/qtreewidget.h16
-rw-r--r--src/widgets/itemviews/qtreewidget_p.h40
-rw-r--r--src/widgets/kernel/qaction.h4
-rw-r--r--src/widgets/kernel/qapplication.cpp6
-rw-r--r--src/widgets/kernel/qapplication.h10
-rw-r--r--src/widgets/kernel/qapplication_p.h22
-rw-r--r--src/widgets/kernel/qboxlayout.cpp2
-rw-r--r--src/widgets/kernel/qboxlayout.h28
-rw-r--r--src/widgets/kernel/qdesktopwidget.cpp43
-rw-r--r--src/widgets/kernel/qdesktopwidget.h60
-rw-r--r--src/widgets/kernel/qdesktopwidget.qdoc56
-rw-r--r--src/widgets/kernel/qdesktopwidget_p.h2
-rw-r--r--src/widgets/kernel/qformlayout.cpp2
-rw-r--r--src/widgets/kernel/qformlayout.h28
-rw-r--r--src/widgets/kernel/qgesture.h12
-rw-r--r--src/widgets/kernel/qgridlayout.cpp2
-rw-r--r--src/widgets/kernel/qgridlayout.h26
-rw-r--r--src/widgets/kernel/qlayout.h20
-rw-r--r--src/widgets/kernel/qopenglwidget.cpp26
-rw-r--r--src/widgets/kernel/qopenglwidget.h14
-rw-r--r--src/widgets/kernel/qshortcut.h4
-rw-r--r--src/widgets/kernel/qstackedlayout.cpp2
-rw-r--r--src/widgets/kernel/qstackedlayout.h18
-rw-r--r--src/widgets/kernel/qstandardgestures_p.h30
-rw-r--r--src/widgets/kernel/qtooltip.cpp13
-rw-r--r--src/widgets/kernel/qtooltip.h2
-rw-r--r--src/widgets/kernel/qwhatsthis.cpp14
-rw-r--r--src/widgets/kernel/qwhatsthis.h4
-rw-r--r--src/widgets/kernel/qwidget.cpp14
-rw-r--r--src/widgets/kernel/qwidget.h22
-rw-r--r--src/widgets/kernel/qwidget_p.h22
-rw-r--r--src/widgets/kernel/qwidgetaction.h4
-rw-r--r--src/widgets/kernel/qwidgetbackingstore.cpp2
-rw-r--r--src/widgets/kernel/qwidgetwindow.cpp21
-rw-r--r--src/widgets/kernel/qwidgetwindow_p.h8
-rw-r--r--src/widgets/kernel/qwindowcontainer_p.h2
-rw-r--r--src/widgets/statemachine/qbasickeyeventtransition_p.h4
-rw-r--r--src/widgets/statemachine/qbasicmouseeventtransition_p.h4
-rw-r--r--src/widgets/statemachine/qkeyeventtransition.h8
-rw-r--r--src/widgets/statemachine/qmouseeventtransition.h8
-rw-r--r--src/widgets/styles/qcommonstyle.h46
-rw-r--r--src/widgets/styles/qdrawutil.h20
-rw-r--r--src/widgets/styles/qfusionstyle_p.h42
-rw-r--r--src/widgets/styles/qpixmapstyle_p.h32
-rw-r--r--src/widgets/styles/qproxystyle.h50
-rw-r--r--src/widgets/styles/qstyle.h34
-rw-r--r--src/widgets/styles/qstyleanimation_p.h12
-rw-r--r--src/widgets/styles/qstyleoption.h8
-rw-r--r--src/widgets/styles/qstylepainter.h2
-rw-r--r--src/widgets/styles/qstyleplugin.h2
-rw-r--r--src/widgets/styles/qstylesheetstyle.cpp22
-rw-r--r--src/widgets/styles/qstylesheetstyle_p.h48
-rw-r--r--src/widgets/styles/qwindowsstyle.cpp2
-rw-r--r--src/widgets/styles/qwindowsstyle_p.h30
-rw-r--r--src/widgets/styles/qwindowsstyle_p_p.h2
-rw-r--r--src/widgets/util/qcompleter.h10
-rw-r--r--src/widgets/util/qcompleter_p.h26
-rw-r--r--src/widgets/util/qflickgesture.cpp2
-rw-r--r--src/widgets/util/qscroller.cpp11
-rw-r--r--src/widgets/util/qsystemtrayicon.h6
-rw-r--r--src/widgets/util/qsystemtrayicon_p.h8
-rw-r--r--src/widgets/util/qsystemtrayicon_x11.cpp12
-rw-r--r--src/widgets/util/qundogroup.h2
-rw-r--r--src/widgets/util/qundostack.h6
-rw-r--r--src/widgets/util/qundoview.cpp10
-rw-r--r--src/widgets/util/qundoview.h6
-rw-r--r--src/widgets/widgets.pro1
-rw-r--r--src/widgets/widgets/qabstractbutton.h26
-rw-r--r--src/widgets/widgets/qabstractscrollarea.h38
-rw-r--r--src/widgets/widgets/qabstractscrollarea_p.h2
-rw-r--r--src/widgets/widgets/qabstractslider.h14
-rw-r--r--src/widgets/widgets/qabstractspinbox.h4
-rw-r--r--src/widgets/widgets/qbuttongroup.h2
-rw-r--r--src/widgets/widgets/qcalendarwidget.cpp76
-rw-r--r--src/widgets/widgets/qcalendarwidget.h16
-rw-r--r--src/widgets/widgets/qcheckbox.cpp15
-rw-r--r--src/widgets/widgets/qcheckbox.h20
-rw-r--r--src/widgets/widgets/qcombobox.h38
-rw-r--r--src/widgets/widgets/qcommandlinkbutton.h16
-rw-r--r--src/widgets/widgets/qdatetimeedit.h18
-rw-r--r--src/widgets/widgets/qdatetimeedit_p.h34
-rw-r--r--src/widgets/widgets/qdial.cpp2
-rw-r--r--src/widgets/widgets/qdial.h20
-rw-r--r--src/widgets/widgets/qdialogbuttonbox.h12
-rw-r--r--src/widgets/widgets/qdockwidget.cpp12
-rw-r--r--src/widgets/widgets/qdockwidget.h12
-rw-r--r--src/widgets/widgets/qdockwidget_p.h22
-rw-r--r--src/widgets/widgets/qeffects.cpp13
-rw-r--r--src/widgets/widgets/qfocusframe.h8
-rw-r--r--src/widgets/widgets/qfontcombobox.cpp4
-rw-r--r--src/widgets/widgets/qfontcombobox.h6
-rw-r--r--src/widgets/widgets/qframe.h12
-rw-r--r--src/widgets/widgets/qgroupbox.h24
-rw-r--r--src/widgets/widgets/qkeysequenceedit.h12
-rw-r--r--src/widgets/widgets/qlabel.cpp10
-rw-r--r--src/widgets/widgets/qlabel.h32
-rw-r--r--src/widgets/widgets/qlcdnumber.h10
-rw-r--r--src/widgets/widgets/qlineedit.h42
-rw-r--r--src/widgets/widgets/qlineedit_p.cpp4
-rw-r--r--src/widgets/widgets/qlineedit_p.h4
-rw-r--r--src/widgets/widgets/qmaccocoaviewcontainer_mac.h2
-rw-r--r--src/widgets/widgets/qmacnativewidget_mac.h2
-rw-r--r--src/widgets/widgets/qmainwindow.h6
-rw-r--r--src/widgets/widgets/qmainwindowlayout.cpp22
-rw-r--r--src/widgets/widgets/qmainwindowlayout_p.h26
-rw-r--r--src/widgets/widgets/qmdiarea.cpp4
-rw-r--r--src/widgets/widgets/qmdiarea.h26
-rw-r--r--src/widgets/widgets/qmdiarea_p.h16
-rw-r--r--src/widgets/widgets/qmdisubwindow.cpp26
-rw-r--r--src/widgets/widgets/qmdisubwindow.h46
-rw-r--r--src/widgets/widgets/qmdisubwindow_p.h2
-rw-r--r--src/widgets/widgets/qmenu.cpp23
-rw-r--r--src/widgets/widgets/qmenu.h44
-rw-r--r--src/widgets/widgets/qmenu_p.h6
-rw-r--r--src/widgets/widgets/qmenubar.cpp8
-rw-r--r--src/widgets/widgets/qmenubar.h2
-rw-r--r--src/widgets/widgets/qplaintextedit.cpp43
-rw-r--r--src/widgets/widgets/qplaintextedit.h67
-rw-r--r--src/widgets/widgets/qplaintextedit_p.h18
-rw-r--r--src/widgets/widgets/qprogressbar.h10
-rw-r--r--src/widgets/widgets/qpushbutton.h22
-rw-r--r--src/widgets/widgets/qradiobutton.h16
-rw-r--r--src/widgets/widgets/qrubberband.h14
-rw-r--r--src/widgets/widgets/qscrollarea.h18
-rw-r--r--src/widgets/widgets/qscrollbar.h24
-rw-r--r--src/widgets/widgets/qsizegrip.h22
-rw-r--r--src/widgets/widgets/qslider.h18
-rw-r--r--src/widgets/widgets/qspinbox.cpp12
-rw-r--r--src/widgets/widgets/qspinbox.h4
-rw-r--r--src/widgets/widgets/qsplashscreen.h4
-rw-r--r--src/widgets/widgets/qsplitter.h30
-rw-r--r--src/widgets/widgets/qstackedwidget.h4
-rw-r--r--src/widgets/widgets/qstatusbar.h10
-rw-r--r--src/widgets/widgets/qtabbar.h30
-rw-r--r--src/widgets/widgets/qtabbar_p.h18
-rw-r--r--src/widgets/widgets/qtabwidget.h22
-rw-r--r--src/widgets/widgets/qtextbrowser.cpp2
-rw-r--r--src/widgets/widgets/qtextbrowser.h20
-rw-r--r--src/widgets/widgets/qtextedit.cpp6
-rw-r--r--src/widgets/widgets/qtextedit.h52
-rw-r--r--src/widgets/widgets/qtoolbar.h12
-rw-r--r--src/widgets/widgets/qtoolbarextension_p.h4
-rw-r--r--src/widgets/widgets/qtoolbarlayout_p.h24
-rw-r--r--src/widgets/widgets/qtoolbarseparator_p.h4
-rw-r--r--src/widgets/widgets/qtoolbox.cpp6
-rw-r--r--src/widgets/widgets/qtoolbox.h8
-rw-r--r--src/widgets/widgets/qtoolbutton.h32
-rw-r--r--src/widgets/widgets/qwidgetlinecontrol_p.h2
-rw-r--r--src/widgets/widgets/qwidgetresizehandler_p.h2
-rw-r--r--src/widgets/widgets/qwidgettextcontrol.cpp2
-rw-r--r--src/widgets/widgets/qwidgettextcontrol_p.h8
-rw-r--r--src/winmain/qtmain_win.cpp2
-rw-r--r--src/winmain/qtmain_winrt.cpp18
-rw-r--r--src/xml/dom/qdom.cpp120
-rw-r--r--src/xml/dom/qdom.h16
-rw-r--r--src/xml/sax/qxml.cpp4
-rw-r--r--src/xml/sax/qxml.h118
-rw-r--r--sync.profile1
-rw-r--r--tests/auto/concurrent/qtconcurrentrun/tst_qtconcurrentrun.cpp2
-rw-r--r--tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp10
-rw-r--r--tests/auto/corelib/global/qfloat16/tst_qfloat16.cpp38
-rw-r--r--tests/auto/corelib/global/qglobal/qglobal.c117
-rw-r--r--tests/auto/corelib/global/qglobal/qglobal.pro2
-rw-r--r--tests/auto/corelib/global/qglobal/tst_qglobal.cpp17
-rw-r--r--tests/auto/corelib/io/qfile/tst_qfile.cpp6
-rw-r--r--tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp10
-rw-r--r--tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp107
-rw-r--r--tests/auto/corelib/io/qlockfile/tst_qlockfile.pro2
-rw-r--r--tests/auto/corelib/io/qprocess/tst_qprocess.cpp6
-rw-r--r--tests/auto/corelib/io/qsettings/tst_qsettings.cpp2
-rw-r--r--tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp6
-rw-r--r--tests/auto/corelib/itemmodels/qidentityproxymodel/tst_qidentityproxymodel.cpp2
-rw-r--r--tests/auto/corelib/itemmodels/qitemmodel/tst_qitemmodel.cpp4
-rw-r--r--tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp7
-rw-r--r--tests/auto/corelib/itemmodels/qstringlistmodel/tst_qstringlistmodel.cpp6
-rw-r--r--tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp4
-rw-r--r--tests/auto/corelib/kernel/qmetamethod/tst_qmetamethod.cpp2
-rw-r--r--tests/auto/corelib/kernel/qobject/tst_qobject.cpp8
-rw-r--r--tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp8
-rw-r--r--tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp2
-rw-r--r--tests/auto/corelib/statemachine/qstatemachine/tst_qstatemachine.cpp2
-rw-r--r--tests/auto/corelib/thread/qfuture/tst_qfuture.cpp6
-rw-r--r--tests/auto/corelib/thread/qwaitcondition/tst_qwaitcondition.cpp2
-rw-r--r--tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp6
-rw-r--r--tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp21
-rw-r--r--tests/auto/corelib/tools/qlatin1string/tst_qlatin1string.cpp8
-rw-r--r--tests/auto/corelib/tools/qringbuffer/tst_qringbuffer.cpp2
-rw-r--r--tests/auto/corelib/tools/qscopedpointer/tst_qscopedpointer.cpp6
-rw-r--r--tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp14
-rw-r--r--tests/auto/corelib/tools/qstring/tst_qstring.cpp10
-rw-r--r--tests/auto/corelib/tools/qstringref/tst_qstringref.cpp8
-rw-r--r--tests/auto/corelib/tools/qtimezone/tst_qtimezone.cpp3
-rw-r--r--tests/auto/corelib/tools/qvector/tst_qvector.cpp2
-rw-r--r--tests/auto/corelib/xml/qxmlstream/tst_qxmlstream.cpp46
-rw-r--r--tests/auto/gui/itemmodels/qstandarditemmodel/tst_qstandarditemmodel.cpp62
-rw-r--r--tests/auto/gui/kernel/qopenglwindow/tst_qopenglwindow.cpp16
-rw-r--r--tests/auto/gui/kernel/qrasterwindow/tst_qrasterwindow.cpp2
-rw-r--r--tests/auto/gui/kernel/qtouchevent/tst_qtouchevent.cpp14
-rw-r--r--tests/auto/gui/kernel/qwindow/tst_qwindow.cpp61
-rw-r--r--tests/auto/gui/painting/qcolor/tst_qcolor.cpp3
-rw-r--r--tests/auto/gui/painting/qpainter/tst_qpainter.cpp2
-rw-r--r--tests/auto/gui/qopengl/tst_qopengl.cpp2
-rw-r--r--tests/auto/gui/qvulkan/tst_qvulkan.cpp2
-rw-r--r--tests/auto/gui/text/qcssparser/tst_qcssparser.cpp4
-rw-r--r--tests/auto/gui/text/qfontmetrics/tst_qfontmetrics.cpp4
-rw-r--r--tests/auto/gui/text/qstatictext/tst_qstatictext.cpp14
-rw-r--r--tests/auto/network/access/http2/http2srv.h2
-rw-r--r--tests/auto/network/access/qhttpnetworkreply/tst_qhttpnetworkreply.cpp2
-rw-r--r--tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp18
-rw-r--r--tests/auto/network/kernel/qhostaddress/qhostaddress.pro3
-rw-r--r--tests/auto/network/kernel/qhostaddress/tst_qhostaddress.cpp164
-rw-r--r--tests/auto/network/kernel/qnetworkinterface/BLACKLIST2
-rw-r--r--tests/auto/network/kernel/qnetworkinterface/tst_qnetworkinterface.cpp86
-rw-r--r--tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp2
-rw-r--r--tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp2
-rw-r--r--tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp1
-rw-r--r--tests/auto/other/modeltest/modeltest.cpp170
-rw-r--r--tests/auto/other/modeltest/modeltest.h6
-rw-r--r--tests/auto/other/qaccessibility/accessiblewidgets.h2
-rw-r--r--tests/auto/other/qaccessibility/qaccessibility.pro5
-rw-r--r--tests/auto/other/qaccessibility/tst_qaccessibility.cpp281
-rw-r--r--tests/auto/other/qfocusevent/tst_qfocusevent.cpp4
-rw-r--r--tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp157
-rw-r--r--tests/auto/testlib/selftests/deleteLater/deleteLater.pro7
-rw-r--r--tests/auto/testlib/selftests/deleteLater/tst_deleteLater.cpp87
-rw-r--r--tests/auto/testlib/selftests/deleteLater_noApp/deleteLater_noApp.pro7
-rw-r--r--tests/auto/testlib/selftests/deleteLater_noApp/tst_deleteLater_noApp.cpp88
-rw-r--r--tests/auto/testlib/selftests/expected_alive.txt13
-rw-r--r--tests/auto/testlib/selftests/expected_assert.lightxml8
-rw-r--r--tests/auto/testlib/selftests/expected_assert.teamcity2
-rw-r--r--tests/auto/testlib/selftests/expected_assert.txt6
-rw-r--r--tests/auto/testlib/selftests/expected_assert.xml8
-rw-r--r--tests/auto/testlib/selftests/expected_assert.xunitxml4
-rw-r--r--tests/auto/testlib/selftests/expected_badxml.lightxml8
-rw-r--r--tests/auto/testlib/selftests/expected_badxml.teamcity10
-rw-r--r--tests/auto/testlib/selftests/expected_badxml.txt14
-rw-r--r--tests/auto/testlib/selftests/expected_badxml.xml8
-rw-r--r--tests/auto/testlib/selftests/expected_benchlibcallgrind.lightxml26
-rw-r--r--tests/auto/testlib/selftests/expected_benchlibcallgrind.teamcity9
-rw-r--r--tests/auto/testlib/selftests/expected_benchlibcallgrind.xml32
-rw-r--r--tests/auto/testlib/selftests/expected_benchlibcallgrind.xunitxml25
-rw-r--r--tests/auto/testlib/selftests/expected_benchlibcallgrind_0.txt8
-rw-r--r--tests/auto/testlib/selftests/expected_benchlibcallgrind_1.txt (renamed from tests/auto/testlib/selftests/expected_benchlibcallgrind.txt)0
-rw-r--r--tests/auto/testlib/selftests/expected_benchlibcounting.lightxml14
-rw-r--r--tests/auto/testlib/selftests/expected_benchlibcounting.teamcity12
-rw-r--r--tests/auto/testlib/selftests/expected_benchlibcounting.txt8
-rw-r--r--tests/auto/testlib/selftests/expected_benchlibcounting.xml14
-rw-r--r--tests/auto/testlib/selftests/expected_benchlibeventcounter.lightxml6
-rw-r--r--tests/auto/testlib/selftests/expected_benchlibeventcounter.teamcity20
-rw-r--r--tests/auto/testlib/selftests/expected_benchlibeventcounter.txt4
-rw-r--r--tests/auto/testlib/selftests/expected_benchlibeventcounter.xml6
-rw-r--r--tests/auto/testlib/selftests/expected_benchliboptions.lightxml57
-rw-r--r--tests/auto/testlib/selftests/expected_benchliboptions.teamcity24
-rw-r--r--tests/auto/testlib/selftests/expected_benchliboptions.txt12
-rw-r--r--tests/auto/testlib/selftests/expected_benchliboptions.xml66
-rw-r--r--tests/auto/testlib/selftests/expected_benchliboptions.xunitxml39
-rw-r--r--tests/auto/testlib/selftests/expected_benchlibtickcounter.lightxml8
-rw-r--r--tests/auto/testlib/selftests/expected_benchlibtickcounter.teamcity8
-rw-r--r--tests/auto/testlib/selftests/expected_benchlibtickcounter.txt6
-rw-r--r--tests/auto/testlib/selftests/expected_benchlibtickcounter.xml8
-rw-r--r--tests/auto/testlib/selftests/expected_benchlibwalltime.lightxml14
-rw-r--r--tests/auto/testlib/selftests/expected_benchlibwalltime.teamcity12
-rw-r--r--tests/auto/testlib/selftests/expected_benchlibwalltime.txt8
-rw-r--r--tests/auto/testlib/selftests/expected_benchlibwalltime.xml14
-rw-r--r--tests/auto/testlib/selftests/expected_blacklisted.lightxml66
-rw-r--r--tests/auto/testlib/selftests/expected_blacklisted.teamcity18
-rw-r--r--tests/auto/testlib/selftests/expected_blacklisted.txt16
-rw-r--r--tests/auto/testlib/selftests/expected_blacklisted.xml69
-rw-r--r--tests/auto/testlib/selftests/expected_blacklisted.xunitxml40
-rw-r--r--tests/auto/testlib/selftests/expected_commandlinedata.lightxml20
-rw-r--r--tests/auto/testlib/selftests/expected_commandlinedata.teamcity12
-rw-r--r--tests/auto/testlib/selftests/expected_commandlinedata.txt16
-rw-r--r--tests/auto/testlib/selftests/expected_commandlinedata.xml20
-rw-r--r--tests/auto/testlib/selftests/expected_counting.lightxml62
-rw-r--r--tests/auto/testlib/selftests/expected_counting.teamcity32
-rw-r--r--tests/auto/testlib/selftests/expected_counting.txt36
-rw-r--r--tests/auto/testlib/selftests/expected_counting.xml62
-rw-r--r--tests/auto/testlib/selftests/expected_datatable.lightxml46
-rw-r--r--tests/auto/testlib/selftests/expected_datatable.teamcity26
-rw-r--r--tests/auto/testlib/selftests/expected_datatable.txt30
-rw-r--r--tests/auto/testlib/selftests/expected_datatable.xml46
-rw-r--r--tests/auto/testlib/selftests/expected_datetime.lightxml14
-rw-r--r--tests/auto/testlib/selftests/expected_datetime.teamcity6
-rw-r--r--tests/auto/testlib/selftests/expected_datetime.txt10
-rw-r--r--tests/auto/testlib/selftests/expected_datetime.xml14
-rw-r--r--tests/auto/testlib/selftests/expected_differentexec.lightxml21
-rw-r--r--tests/auto/testlib/selftests/expected_differentexec.teamcity21
-rw-r--r--tests/auto/testlib/selftests/expected_differentexec.txt12
-rw-r--r--tests/auto/testlib/selftests/expected_differentexec.xml21
-rw-r--r--tests/auto/testlib/selftests/expected_differentexec.xunitxml21
-rw-r--r--tests/auto/testlib/selftests/expected_exceptionthrow.lightxml6
-rw-r--r--tests/auto/testlib/selftests/expected_exceptionthrow.teamcity2
-rw-r--r--tests/auto/testlib/selftests/expected_exceptionthrow.txt6
-rw-r--r--tests/auto/testlib/selftests/expected_exceptionthrow.xml6
-rw-r--r--tests/auto/testlib/selftests/expected_expectfail.lightxml56
-rw-r--r--tests/auto/testlib/selftests/expected_expectfail.teamcity26
-rw-r--r--tests/auto/testlib/selftests/expected_expectfail.txt32
-rw-r--r--tests/auto/testlib/selftests/expected_expectfail.xml56
-rw-r--r--tests/auto/testlib/selftests/expected_failcleanup.lightxml8
-rw-r--r--tests/auto/testlib/selftests/expected_failcleanup.teamcity2
-rw-r--r--tests/auto/testlib/selftests/expected_failcleanup.txt6
-rw-r--r--tests/auto/testlib/selftests/expected_failcleanup.xml8
-rw-r--r--tests/auto/testlib/selftests/expected_failinit.lightxml6
-rw-r--r--tests/auto/testlib/selftests/expected_failinit.teamcity2
-rw-r--r--tests/auto/testlib/selftests/expected_failinit.txt6
-rw-r--r--tests/auto/testlib/selftests/expected_failinit.xml6
-rw-r--r--tests/auto/testlib/selftests/expected_failinitdata.lightxml4
-rw-r--r--tests/auto/testlib/selftests/expected_failinitdata.teamcity2
-rw-r--r--tests/auto/testlib/selftests/expected_failinitdata.txt6
-rw-r--r--tests/auto/testlib/selftests/expected_failinitdata.xml4
-rw-r--r--tests/auto/testlib/selftests/expected_fetchbogus.lightxml4
-rw-r--r--tests/auto/testlib/selftests/expected_fetchbogus.teamcity2
-rw-r--r--tests/auto/testlib/selftests/expected_fetchbogus.txt4
-rw-r--r--tests/auto/testlib/selftests/expected_fetchbogus.xml4
-rw-r--r--tests/auto/testlib/selftests/expected_findtestdata.lightxml8
-rw-r--r--tests/auto/testlib/selftests/expected_findtestdata.teamcity2
-rw-r--r--tests/auto/testlib/selftests/expected_findtestdata.txt6
-rw-r--r--tests/auto/testlib/selftests/expected_findtestdata.xml8
-rw-r--r--tests/auto/testlib/selftests/expected_float.lightxml62
-rw-r--r--tests/auto/testlib/selftests/expected_float.teamcity28
-rw-r--r--tests/auto/testlib/selftests/expected_float.txt16
-rw-r--r--tests/auto/testlib/selftests/expected_float.xml65
-rw-r--r--tests/auto/testlib/selftests/expected_float.xunitxml33
-rw-r--r--tests/auto/testlib/selftests/expected_globaldata.lightxml20
-rw-r--r--tests/auto/testlib/selftests/expected_globaldata.teamcity8
-rw-r--r--tests/auto/testlib/selftests/expected_globaldata.txt12
-rw-r--r--tests/auto/testlib/selftests/expected_globaldata.xml20
-rw-r--r--tests/auto/testlib/selftests/expected_longstring.lightxml8
-rw-r--r--tests/auto/testlib/selftests/expected_longstring.teamcity2
-rw-r--r--tests/auto/testlib/selftests/expected_longstring.txt6
-rw-r--r--tests/auto/testlib/selftests/expected_longstring.xml8
-rw-r--r--tests/auto/testlib/selftests/expected_maxwarnings.lightxml6
-rw-r--r--tests/auto/testlib/selftests/expected_maxwarnings.txt4
-rw-r--r--tests/auto/testlib/selftests/expected_maxwarnings.xml6
-rw-r--r--tests/auto/testlib/selftests/expected_multiexec.lightxml90
-rw-r--r--tests/auto/testlib/selftests/expected_multiexec.teamcity40
-rw-r--r--tests/auto/testlib/selftests/expected_multiexec.txt20
-rw-r--r--tests/auto/testlib/selftests/expected_multiexec.xml105
-rw-r--r--tests/auto/testlib/selftests/expected_multiexec.xunitxml60
-rw-r--r--tests/auto/testlib/selftests/expected_pairdiagnostics.lightxml4
-rw-r--r--tests/auto/testlib/selftests/expected_pairdiagnostics.teamcity4
-rw-r--r--tests/auto/testlib/selftests/expected_pairdiagnostics.txt8
-rw-r--r--tests/auto/testlib/selftests/expected_pairdiagnostics.xml14
-rw-r--r--tests/auto/testlib/selftests/expected_qexecstringlist.lightxml75
-rw-r--r--tests/auto/testlib/selftests/expected_qexecstringlist.teamcity57
-rw-r--r--tests/auto/testlib/selftests/expected_qexecstringlist.txt24
-rw-r--r--tests/auto/testlib/selftests/expected_qexecstringlist.xml78
-rw-r--r--tests/auto/testlib/selftests/expected_qexecstringlist.xunitxml55
-rw-r--r--tests/auto/testlib/selftests/expected_silent.lightxml66
-rw-r--r--tests/auto/testlib/selftests/expected_silent.teamcity6
-rw-r--r--tests/auto/testlib/selftests/expected_silent.txt6
-rw-r--r--tests/auto/testlib/selftests/expected_silent.xml69
-rw-r--r--tests/auto/testlib/selftests/expected_silent.xunitxml43
-rw-r--r--tests/auto/testlib/selftests/expected_singleskip.lightxml8
-rw-r--r--tests/auto/testlib/selftests/expected_singleskip.teamcity2
-rw-r--r--tests/auto/testlib/selftests/expected_singleskip.txt6
-rw-r--r--tests/auto/testlib/selftests/expected_singleskip.xml8
-rw-r--r--tests/auto/testlib/selftests/expected_skip.lightxml16
-rw-r--r--tests/auto/testlib/selftests/expected_skip.teamcity6
-rw-r--r--tests/auto/testlib/selftests/expected_skip.txt10
-rw-r--r--tests/auto/testlib/selftests/expected_skip.xml16
-rw-r--r--tests/auto/testlib/selftests/expected_skipcleanup.lightxml8
-rw-r--r--tests/auto/testlib/selftests/expected_skipcleanup.teamcity2
-rw-r--r--tests/auto/testlib/selftests/expected_skipcleanup.txt6
-rw-r--r--tests/auto/testlib/selftests/expected_skipcleanup.xml8
-rw-r--r--tests/auto/testlib/selftests/expected_skipinit.lightxml6
-rw-r--r--tests/auto/testlib/selftests/expected_skipinit.teamcity2
-rw-r--r--tests/auto/testlib/selftests/expected_skipinit.txt6
-rw-r--r--tests/auto/testlib/selftests/expected_skipinit.xml6
-rw-r--r--tests/auto/testlib/selftests/expected_skipinitdata.lightxml4
-rw-r--r--tests/auto/testlib/selftests/expected_skipinitdata.teamcity2
-rw-r--r--tests/auto/testlib/selftests/expected_skipinitdata.txt6
-rw-r--r--tests/auto/testlib/selftests/expected_skipinitdata.xml4
-rw-r--r--tests/auto/testlib/selftests/expected_sleep.lightxml18
-rw-r--r--tests/auto/testlib/selftests/expected_sleep.txt4
-rw-r--r--tests/auto/testlib/selftests/expected_sleep.xml21
-rw-r--r--tests/auto/testlib/selftests/expected_sleep.xunitxml12
-rw-r--r--tests/auto/testlib/selftests/expected_strcmp.lightxml32
-rw-r--r--tests/auto/testlib/selftests/expected_strcmp.teamcity12
-rw-r--r--tests/auto/testlib/selftests/expected_strcmp.txt20
-rw-r--r--tests/auto/testlib/selftests/expected_strcmp.xml32
-rw-r--r--tests/auto/testlib/selftests/expected_subtest.lightxml14
-rw-r--r--tests/auto/testlib/selftests/expected_subtest.teamcity4
-rw-r--r--tests/auto/testlib/selftests/expected_subtest.txt8
-rw-r--r--tests/auto/testlib/selftests/expected_subtest.xml14
-rw-r--r--tests/auto/testlib/selftests/expected_verbose1.lightxml62
-rw-r--r--tests/auto/testlib/selftests/expected_verbose1.teamcity32
-rw-r--r--tests/auto/testlib/selftests/expected_verbose1.txt36
-rw-r--r--tests/auto/testlib/selftests/expected_verbose1.xml62
-rw-r--r--tests/auto/testlib/selftests/expected_verbose2.lightxml98
-rw-r--r--tests/auto/testlib/selftests/expected_verbose2.teamcity56
-rw-r--r--tests/auto/testlib/selftests/expected_verbose2.txt72
-rw-r--r--tests/auto/testlib/selftests/expected_verbose2.xml98
-rw-r--r--tests/auto/testlib/selftests/expected_verifyexceptionthrown.lightxml34
-rw-r--r--tests/auto/testlib/selftests/expected_verifyexceptionthrown.teamcity12
-rw-r--r--tests/auto/testlib/selftests/expected_verifyexceptionthrown.txt16
-rw-r--r--tests/auto/testlib/selftests/expected_verifyexceptionthrown.xml34
-rw-r--r--tests/auto/testlib/selftests/expected_warnings.lightxml12
-rw-r--r--tests/auto/testlib/selftests/expected_warnings.txt4
-rw-r--r--tests/auto/testlib/selftests/expected_warnings.xml12
-rw-r--r--tests/auto/testlib/selftests/expected_xunit.lightxml32
-rw-r--r--tests/auto/testlib/selftests/expected_xunit.teamcity14
-rw-r--r--tests/auto/testlib/selftests/expected_xunit.txt18
-rw-r--r--tests/auto/testlib/selftests/expected_xunit.xml32
-rwxr-xr-xtests/auto/testlib/selftests/generate_expected_output.py8
-rw-r--r--tests/auto/testlib/selftests/selftests.pri2
-rw-r--r--tests/auto/testlib/selftests/selftests.qrc41
-rw-r--r--tests/auto/testlib/selftests/tst_selftests.cpp4
-rw-r--r--tests/auto/tools/moc/cxx11-explicit-override-control.h40
-rw-r--r--tests/auto/tools/moc/moc.pro2
-rw-r--r--tests/auto/tools/moc/tst_moc.cpp8
-rw-r--r--tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp2
-rw-r--r--tests/auto/widgets/dialogs/qinputdialog/tst_qinputdialog.cpp2
-rw-r--r--tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp10
-rw-r--r--tests/auto/widgets/dialogs/qprogressdialog/tst_qprogressdialog.cpp4
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp34
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp2
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp3
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp2
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp12
-rw-r--r--tests/auto/widgets/itemviews/itemviews.pro4
-rw-r--r--tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp12
-rw-r--r--tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp2
-rw-r--r--tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp2
-rw-r--r--tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp46
-rw-r--r--tests/auto/widgets/itemviews/qtreewidget/tst_qtreewidget.cpp2
-rw-r--r--tests/auto/widgets/kernel/qaction/tst_qaction.cpp4
-rw-r--r--tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp2
-rw-r--r--tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp4
-rw-r--r--tests/auto/widgets/kernel/qgesturerecognizer/tst_qgesturerecognizer.cpp2
-rw-r--r--tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp6
-rw-r--r--tests/auto/widgets/kernel/qshortcut/tst_qshortcut.cpp2
-rw-r--r--tests/auto/widgets/kernel/qsizepolicy/tst_qsizepolicy.cpp2
-rw-r--r--tests/auto/widgets/kernel/qtooltip/tst_qtooltip.cpp4
-rw-r--r--tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp10
-rw-r--r--tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp10
-rw-r--r--tests/auto/widgets/styles/qstyle/tst_qstyle.cpp30
-rw-r--r--tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp4
-rw-r--r--tests/auto/widgets/util/qundogroup/tst_qundogroup.cpp19
-rw-r--r--tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp4
-rw-r--r--tests/auto/widgets/widgets/qlabel/tst_qlabel.cpp2
-rw-r--r--tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp4
-rw-r--r--tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp10
-rw-r--r--tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp6
-rw-r--r--tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp16
-rw-r--r--tests/auto/widgets/widgets/qsplitter/tst_qsplitter.cpp2
-rw-r--r--tests/benchmarks/corelib/thread/qthreadpool/tst_qthreadpool.cpp2
-rw-r--r--tests/benchmarks/gui/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp2
-rw-r--r--tests/manual/cocoa/menurama/mainwindow.h2
-rw-r--r--tests/manual/cocoa/menurama/menuramaapplication.cpp2
-rw-r--r--tests/manual/diaglib/logwidget.cpp2
-rw-r--r--tests/manual/foreignwindows/main.cpp6
-rw-r--r--tests/manual/highdpi/dragwidget.h18
-rw-r--r--tests/manual/qlayout/gridwidget.cpp4
-rw-r--r--tests/manual/qlayout/hbwidget.cpp4
-rw-r--r--tests/manual/qlayout/vbwidget.cpp4
-rw-r--r--tests/manual/qscreen/main.cpp8
-rw-r--r--tests/manual/qscreen/propertywatcher.cpp2
-rw-r--r--tests/manual/qscreen/propertywatcher.h2
-rw-r--r--tests/manual/qsysinfo/main.cpp4
-rw-r--r--tests/manual/qtabletevent/regular_widgets/main.cpp37
-rw-r--r--tests/manual/touch/main.cpp12
-rw-r--r--tests/manual/widgets/qgraphicsview/rubberband/rubberbandtest.cpp4
-rw-r--r--tests/manual/widgets/styles/main.cpp6
-rwxr-xr-xutil/edid/qedidvendortable.py9
-rw-r--r--util/glgen/codegenerator.cpp4
1502 files changed, 23276 insertions, 14829 deletions
diff --git a/.qmake.conf b/.qmake.conf
index 5153f8139f..f3a052109f 100644
--- a/.qmake.conf
+++ b/.qmake.conf
@@ -4,4 +4,4 @@ CONFIG += warning_clean
QT_SOURCE_TREE = $$PWD
QT_BUILD_TREE = $$shadowed($$PWD)
-MODULE_VERSION = 5.10.0
+MODULE_VERSION = 5.11.0
diff --git a/config_help.txt b/config_help.txt
index 6b1401c618..ae0bb24520 100644
--- a/config_help.txt
+++ b/config_help.txt
@@ -201,7 +201,6 @@ Component selection:
-dbus-runtime ........ Build Qt D-Bus and dynamically load libdbus-1 [no]
-accessibility ....... Enable accessibility support [yes]
Note: Disabling accessibility is not recommended.
- -qml-debug ........... Enable QML debugging support [yes]
Qt comes with bundled copies of some 3rd party libraries. These are used
by default if auto-detection of the respective system library fails.
diff --git a/configure b/configure
index 08b49a8d12..9757254097 100755
--- a/configure
+++ b/configure
@@ -732,10 +732,6 @@ setBootstrapVariable()
EXTRA_CXXFLAGS="\$(QMAKE_CXXFLAGS) \$(QMAKE_CXXFLAGS_CXX11) \$(QMAKE_CXXFLAGS_SPLIT_SECTIONS)"
EXTRA_LFLAGS="\$(QMAKE_LFLAGS) \$(QMAKE_LFLAGS_GCSECTIONS)"
- if [ "$PLATFORM" = "irix-cc" ] || [ "$PLATFORM" = "irix-cc-64" ]; then
- EXTRA_LFLAGS="$EXTRA_LFLAGS -lm"
- fi
-
[ "$CFG_SILENT" = "yes" ] && CC_TRANSFORM='s,^,\@,' || CC_TRANSFORM=
setBootstrapVariable QMAKE_CC CC "$CC_TRANSFORM"
setBootstrapVariable QMAKE_CXX CXX "$CC_TRANSFORM"
diff --git a/configure.json b/configure.json
index c73369e6f6..a5a64565e1 100644
--- a/configure.json
+++ b/configure.json
@@ -102,7 +102,6 @@
"platform": "string",
"plugin-manifests": "boolean",
"profile": "boolean",
- "qml-debug": "boolean",
"qreal": "string",
"qtlibinfix": { "type": "string", "name": "qt_libinfix" },
"qtnamespace": { "type": "string", "name": "qt_namespace" },
@@ -1235,13 +1234,6 @@
"condition": "libs.libudev",
"output": [ "privateFeature" ]
},
- "qml-debug": {
- "label": "QML debugging",
- "output": [
- "privateFeature",
- { "type": "publicQtConfig", "negative": true }
- ]
- },
"compile_examples": {
"label": "Compile examples",
"output": [ "privateConfig" ]
@@ -1454,7 +1446,6 @@ Configure with '-qreal float' to create a build that is binary-compatible with 5
"section": "Support enabled for",
"entries": [
"pkg-config",
- "qml-debug",
"libudev",
"system-zlib"
]
diff --git a/examples/network/multistreamclient/chatconsumer.h b/examples/network/multistreamclient/chatconsumer.h
index 9e12f99359..e10c0d7850 100644
--- a/examples/network/multistreamclient/chatconsumer.h
+++ b/examples/network/multistreamclient/chatconsumer.h
@@ -64,8 +64,8 @@ class ChatConsumer : public Consumer
public:
explicit ChatConsumer(QObject *parent = nullptr);
- QWidget *widget() Q_DECL_OVERRIDE;
- void readDatagram(const QByteArray &ba) Q_DECL_OVERRIDE;
+ QWidget *widget() override;
+ void readDatagram(const QByteArray &ba) override;
private slots:
void returnPressed();
diff --git a/examples/network/multistreamclient/movieconsumer.h b/examples/network/multistreamclient/movieconsumer.h
index 74321a8505..3f78bf2060 100644
--- a/examples/network/multistreamclient/movieconsumer.h
+++ b/examples/network/multistreamclient/movieconsumer.h
@@ -63,9 +63,9 @@ class MovieConsumer : public Consumer
public:
explicit MovieConsumer(QObject *parent = nullptr);
- QWidget *widget() Q_DECL_OVERRIDE;
- void readDatagram(const QByteArray &ba) Q_DECL_OVERRIDE;
- void serverDisconnected() Q_DECL_OVERRIDE;
+ QWidget *widget() override;
+ void readDatagram(const QByteArray &ba) override;
+ void serverDisconnected() override;
private:
QLabel *label;
diff --git a/examples/network/multistreamclient/timeconsumer.h b/examples/network/multistreamclient/timeconsumer.h
index 3faa4a6b1a..84a7796699 100644
--- a/examples/network/multistreamclient/timeconsumer.h
+++ b/examples/network/multistreamclient/timeconsumer.h
@@ -64,9 +64,9 @@ class TimeConsumer : public Consumer
public:
explicit TimeConsumer(QObject *parent = nullptr);
- QWidget *widget() Q_DECL_OVERRIDE;
- void readDatagram(const QByteArray &ba) Q_DECL_OVERRIDE;
- void serverDisconnected() Q_DECL_OVERRIDE;
+ QWidget *widget() override;
+ void readDatagram(const QByteArray &ba) override;
+ void serverDisconnected() override;
private slots:
void timerTick();
diff --git a/examples/network/multistreamserver/chatprovider.h b/examples/network/multistreamserver/chatprovider.h
index b6ff61a917..c52fa89240 100644
--- a/examples/network/multistreamserver/chatprovider.h
+++ b/examples/network/multistreamserver/chatprovider.h
@@ -59,9 +59,9 @@ class ChatProvider : public Provider
public:
explicit ChatProvider(QObject *parent = nullptr);
- void readDatagram(QSctpSocket &from, const QByteArray &ba) Q_DECL_OVERRIDE;
- void newConnection(QSctpSocket &client) Q_DECL_OVERRIDE;
- void clientDisconnected(QSctpSocket &client) Q_DECL_OVERRIDE;
+ void readDatagram(QSctpSocket &from, const QByteArray &ba) override;
+ void newConnection(QSctpSocket &client) override;
+ void clientDisconnected(QSctpSocket &client) override;
};
#endif
diff --git a/examples/network/multistreamserver/server.h b/examples/network/multistreamserver/server.h
index d9a38e61a4..2380d6ffd6 100644
--- a/examples/network/multistreamserver/server.h
+++ b/examples/network/multistreamserver/server.h
@@ -72,7 +72,7 @@ public:
virtual ~Server();
public slots:
- int exec() Q_DECL_OVERRIDE;
+ int exec() override;
private slots:
void newConnection();
diff --git a/examples/network/multistreamserver/timeprovider.h b/examples/network/multistreamserver/timeprovider.h
index f99cdbc717..a4d08fd67c 100644
--- a/examples/network/multistreamserver/timeprovider.h
+++ b/examples/network/multistreamserver/timeprovider.h
@@ -59,7 +59,7 @@ class TimeProvider : public Provider
public:
explicit TimeProvider(QObject *parent = nullptr);
- void readDatagram(QSctpSocket &from, const QByteArray &ba) Q_DECL_OVERRIDE;
+ void readDatagram(QSctpSocket &from, const QByteArray &ba) override;
};
#endif
diff --git a/examples/opengl/computegles31/glwindow.h b/examples/opengl/computegles31/glwindow.h
index 877f7b732e..f243858a45 100644
--- a/examples/opengl/computegles31/glwindow.h
+++ b/examples/opengl/computegles31/glwindow.h
@@ -86,7 +86,7 @@ public:
void setBlurRadius(float blurRadius);
protected:
- void keyPressEvent(QKeyEvent *e) Q_DECL_OVERRIDE;
+ void keyPressEvent(QKeyEvent *e) override;
void setAnimating(bool animate);
private:
diff --git a/examples/opengl/qopenglwindow/background_renderer.cpp b/examples/opengl/qopenglwindow/background_renderer.cpp
index d57198444e..cba4ae1f2f 100644
--- a/examples/opengl/qopenglwindow/background_renderer.cpp
+++ b/examples/opengl/qopenglwindow/background_renderer.cpp
@@ -146,7 +146,7 @@ void FragmentToy::draw(const QSize &windowSize)
m_fragment_shader.reset(new QOpenGLShader(QOpenGLShader::Fragment));
if (!m_fragment_shader->compileSourceCode(data)) {
qWarning() << "Failed to compile fragment shader:" << m_fragment_shader->log();
- m_fragment_shader.reset(Q_NULLPTR);
+ m_fragment_shader.reset(nullptr);
}
} else {
qWarning() << "Unknown error, no fragment shader";
@@ -198,14 +198,14 @@ void FragmentToy::fileChanged(const QString &path)
m_recompile_shaders = true;
if (m_program) {
m_program->removeShader(m_fragment_shader.data());
- m_fragment_shader.reset(Q_NULLPTR);
+ m_fragment_shader.reset(nullptr);
}
}
} else {
m_recompile_shaders = true;
if (m_program) {
m_program->removeShader(m_fragment_shader.data());
- m_fragment_shader.reset(Q_NULLPTR);
+ m_fragment_shader.reset(nullptr);
}
}
}
diff --git a/examples/widgets/mainwindows/mainwindow/colorswatch.cpp b/examples/widgets/mainwindows/mainwindow/colorswatch.cpp
index c47b80275f..720f9a2085 100644
--- a/examples/widgets/mainwindows/mainwindow/colorswatch.cpp
+++ b/examples/widgets/mainwindows/mainwindow/colorswatch.cpp
@@ -468,7 +468,7 @@ static ColorSwatch *findByName(const QMainWindow *mainWindow, const QString &nam
if (name == dock->objectName())
return dock;
}
- return Q_NULLPTR;
+ return nullptr;
}
void ColorSwatch::splitInto(QAction *action)
diff --git a/examples/widgets/mainwindows/mainwindow/colorswatch.h b/examples/widgets/mainwindows/mainwindow/colorswatch.h
index ec9d9e7372..7f73e46f31 100644
--- a/examples/widgets/mainwindows/mainwindow/colorswatch.h
+++ b/examples/widgets/mainwindows/mainwindow/colorswatch.h
@@ -62,7 +62,7 @@ class ColorSwatch : public QDockWidget
Q_OBJECT
public:
- explicit ColorSwatch(const QString &colorName, QMainWindow *parent = Q_NULLPTR, Qt::WindowFlags flags = 0);
+ explicit ColorSwatch(const QString &colorName, QMainWindow *parent = nullptr, Qt::WindowFlags flags = 0);
void setCustomSizeHint(const QSize &size);
QMenu *colorSwatchMenu() const { return menu; }
@@ -128,7 +128,7 @@ class BlueTitleBar : public QWidget
{
Q_OBJECT
public:
- explicit BlueTitleBar(QWidget *parent = Q_NULLPTR);
+ explicit BlueTitleBar(QWidget *parent = nullptr);
QSize sizeHint() const override { return minimumSizeHint(); }
QSize minimumSizeHint() const override;
diff --git a/examples/widgets/mainwindows/mainwindow/mainwindow.cpp b/examples/widgets/mainwindows/mainwindow/mainwindow.cpp
index afceddfca1..b2c5ccc473 100644
--- a/examples/widgets/mainwindows/mainwindow/mainwindow.cpp
+++ b/examples/widgets/mainwindows/mainwindow/mainwindow.cpp
@@ -382,7 +382,7 @@ void MainWindow::switchLayoutDirection()
class CreateDockWidgetDialog : public QDialog
{
public:
- explicit CreateDockWidgetDialog(QWidget *parent = Q_NULLPTR);
+ explicit CreateDockWidgetDialog(QWidget *parent = nullptr);
QString enteredObjectName() const { return m_objectName->text(); }
Qt::DockWidgetArea location() const;
diff --git a/examples/widgets/mainwindows/mainwindow/mainwindow.h b/examples/widgets/mainwindows/mainwindow/mainwindow.h
index af4f1f5745..9b1af6df80 100644
--- a/examples/widgets/mainwindows/mainwindow/mainwindow.h
+++ b/examples/widgets/mainwindows/mainwindow/mainwindow.h
@@ -64,7 +64,7 @@ public:
typedef QMap<QString, QSize> CustomSizeHintMap;
explicit MainWindow(const CustomSizeHintMap &customSizeHints,
- QWidget *parent = Q_NULLPTR,
+ QWidget *parent = nullptr,
Qt::WindowFlags flags = 0);
public slots:
diff --git a/examples/widgets/mainwindows/mainwindow/toolbar.cpp b/examples/widgets/mainwindows/mainwindow/toolbar.cpp
index 814cfc7f4d..baea124ae4 100644
--- a/examples/widgets/mainwindows/mainwindow/toolbar.cpp
+++ b/examples/widgets/mainwindows/mainwindow/toolbar.cpp
@@ -83,8 +83,8 @@ static QPixmap genIcon(const QSize &iconSize, int number, const QColor &color)
ToolBar::ToolBar(const QString &title, QWidget *parent)
: QToolBar(parent)
- , spinbox(Q_NULLPTR)
- , spinboxAction(Q_NULLPTR)
+ , spinbox(nullptr)
+ , spinboxAction(nullptr)
{
setWindowTitle(title);
setObjectName(title);
diff --git a/examples/widgets/mainwindows/sdi/main.cpp b/examples/widgets/mainwindows/sdi/main.cpp
index bed990d34d..6e29fafd6f 100644
--- a/examples/widgets/mainwindows/sdi/main.cpp
+++ b/examples/widgets/mainwindows/sdi/main.cpp
@@ -67,7 +67,7 @@ int main(int argc, char *argv[])
parser.addPositionalArgument("file", "The file(s) to open.");
parser.process(app);
- MainWindow *mainWin = Q_NULLPTR;
+ MainWindow *mainWin = nullptr;
foreach (const QString &file, parser.positionalArguments()) {
MainWindow *newWin = new MainWindow(file);
newWin->tile(mainWin);
diff --git a/examples/widgets/tools/codecs/previewform.h b/examples/widgets/tools/codecs/previewform.h
index 1846b976de..6335b6539f 100644
--- a/examples/widgets/tools/codecs/previewform.h
+++ b/examples/widgets/tools/codecs/previewform.h
@@ -69,7 +69,7 @@ class PreviewForm : public QDialog
Q_OBJECT
public:
- explicit PreviewForm(QWidget *parent = Q_NULLPTR);
+ explicit PreviewForm(QWidget *parent = nullptr);
void setCodecList(const QList<QTextCodec *> &list);
void setEncodedData(const QByteArray &data);
diff --git a/examples/widgets/tools/settingseditor/mainwindow.cpp b/examples/widgets/tools/settingseditor/mainwindow.cpp
index ab9837c513..a7a1e9b415 100644
--- a/examples/widgets/tools/settingseditor/mainwindow.cpp
+++ b/examples/widgets/tools/settingseditor/mainwindow.cpp
@@ -56,7 +56,7 @@
MainWindow::MainWindow()
: settingsTree(new SettingsTree)
- , locationDialog(Q_NULLPTR)
+ , locationDialog(nullptr)
{
setCentralWidget(settingsTree);
diff --git a/examples/widgets/widgets/charactermap/mainwindow.cpp b/examples/widgets/widgets/charactermap/mainwindow.cpp
index 5f17128a2f..d3ac55483c 100644
--- a/examples/widgets/widgets/charactermap/mainwindow.cpp
+++ b/examples/widgets/widgets/charactermap/mainwindow.cpp
@@ -244,7 +244,7 @@ void MainWindow::updateClipboard()
class FontInfoDialog : public QDialog
{
public:
- explicit FontInfoDialog(QWidget *parent = Q_NULLPTR);
+ explicit FontInfoDialog(QWidget *parent = nullptr);
private:
QString text() const;
diff --git a/examples/widgets/widgets/icons/iconpreviewarea.cpp b/examples/widgets/widgets/icons/iconpreviewarea.cpp
index 35379610c5..9cb54c47f6 100644
--- a/examples/widgets/widgets/icons/iconpreviewarea.cpp
+++ b/examples/widgets/widgets/icons/iconpreviewarea.cpp
@@ -190,7 +190,7 @@ QLabel *IconPreviewArea::createPixmapLabel()
//! [5]
void IconPreviewArea::updatePixmapLabels()
{
- QWindow *window = Q_NULLPTR;
+ QWindow *window = nullptr;
if (const QWidget *nativeParent = nativeParentWidget())
window = nativeParent->windowHandle();
for (int column = 0; column < NumModes; ++column) {
diff --git a/examples/widgets/widgets/icons/iconpreviewarea.h b/examples/widgets/widgets/icons/iconpreviewarea.h
index 3ebb9ed3ce..6ea35a5230 100644
--- a/examples/widgets/widgets/icons/iconpreviewarea.h
+++ b/examples/widgets/widgets/icons/iconpreviewarea.h
@@ -66,7 +66,7 @@ class IconPreviewArea : public QWidget
Q_OBJECT
public:
- explicit IconPreviewArea(QWidget *parent = Q_NULLPTR);
+ explicit IconPreviewArea(QWidget *parent = nullptr);
void setIcon(const QIcon &icon);
void setSize(const QSize &size);
diff --git a/examples/widgets/widgets/icons/iconsizespinbox.h b/examples/widgets/widgets/icons/iconsizespinbox.h
index 96a56e75c9..87415ac5d6 100644
--- a/examples/widgets/widgets/icons/iconsizespinbox.h
+++ b/examples/widgets/widgets/icons/iconsizespinbox.h
@@ -59,7 +59,7 @@ class IconSizeSpinBox : public QSpinBox
Q_OBJECT
public:
- explicit IconSizeSpinBox(QWidget *parent = Q_NULLPTR);
+ explicit IconSizeSpinBox(QWidget *parent = nullptr);
int valueFromText(const QString &text) const override;
QString textFromValue(int value) const override;
diff --git a/examples/widgets/widgets/icons/imagedelegate.h b/examples/widgets/widgets/icons/imagedelegate.h
index 928085d85b..3b76b78339 100644
--- a/examples/widgets/widgets/icons/imagedelegate.h
+++ b/examples/widgets/widgets/icons/imagedelegate.h
@@ -59,7 +59,7 @@ class ImageDelegate : public QItemDelegate
Q_OBJECT
public:
- explicit ImageDelegate(QObject *parent = Q_NULLPTR);
+ explicit ImageDelegate(QObject *parent = nullptr);
//! [0]
//! [1]
diff --git a/examples/widgets/widgets/tablet/mainwindow.cpp b/examples/widgets/widgets/tablet/mainwindow.cpp
index feae16dd83..994666d4de 100644
--- a/examples/widgets/widgets/tablet/mainwindow.cpp
+++ b/examples/widgets/widgets/tablet/mainwindow.cpp
@@ -55,7 +55,7 @@
//! [0]
MainWindow::MainWindow(TabletCanvas *canvas)
- : m_canvas(canvas), m_colorDialog(Q_NULLPTR)
+ : m_canvas(canvas), m_colorDialog(nullptr)
{
createMenus();
setWindowTitle(tr("Tablet Example"));
diff --git a/examples/widgets/widgets/tablet/tabletcanvas.cpp b/examples/widgets/widgets/tablet/tabletcanvas.cpp
index 4b11568dfe..73678ab754 100644
--- a/examples/widgets/widgets/tablet/tabletcanvas.cpp
+++ b/examples/widgets/widgets/tablet/tabletcanvas.cpp
@@ -55,7 +55,7 @@
//! [0]
TabletCanvas::TabletCanvas()
- : QWidget(Q_NULLPTR)
+ : QWidget(nullptr)
, m_alphaChannelValuator(TangentialPressureValuator)
, m_colorSaturationValuator(NoValuator)
, m_lineWidthValuator(PressureValuator)
@@ -119,12 +119,12 @@ void TabletCanvas::tabletEvent(QTabletEvent *event)
case QEvent::TabletRelease:
if (m_deviceDown && event->buttons() == Qt::NoButton)
m_deviceDown = false;
+ update();
break;
default:
break;
}
event->accept();
- update();
}
//! [3]
@@ -154,6 +154,7 @@ void TabletCanvas::paintEvent(QPaintEvent *)
//! [5]
void TabletCanvas::paintPixmap(QPainter &painter, QTabletEvent *event)
{
+ static qreal maxPenRadius = pressureToWidth(1.0);
painter.setRenderHint(QPainter::Antialiasing);
switch (event->device()) {
@@ -169,6 +170,7 @@ void TabletCanvas::paintPixmap(QPainter &painter, QTabletEvent *event)
painter.setBrush(grad);
qreal radius = grad.radius();
painter.drawEllipse(event->posF(), radius, radius);
+ update(QRect(event->pos() - QPoint(radius, radius), QSize(radius * 2, radius * 2)));
}
break;
case QTabletEvent::RotationStylus:
@@ -188,6 +190,7 @@ void TabletCanvas::paintPixmap(QPainter &painter, QTabletEvent *event)
poly << event->posF() - brushAdjust;
poly << event->posF() + brushAdjust;
painter.drawConvexPolygon(poly);
+ update(poly.boundingRect().toRect());
}
break;
//! [6]
@@ -217,6 +220,8 @@ void TabletCanvas::paintPixmap(QPainter &painter, QTabletEvent *event)
case QTabletEvent::Stylus:
painter.setPen(m_pen);
painter.drawLine(lastPoint.pos, event->posF());
+ update(QRect(lastPoint.pos.toPoint(), event->pos()).normalized()
+ .adjusted(-maxPenRadius, -maxPenRadius, maxPenRadius, maxPenRadius));
break;
}
}
diff --git a/examples/widgets/widgets/tablet/tabletcanvas.h b/examples/widgets/widgets/tablet/tabletcanvas.h
index a1b31c65bf..671d5376f8 100644
--- a/examples/widgets/widgets/tablet/tabletcanvas.h
+++ b/examples/widgets/widgets/tablet/tabletcanvas.h
@@ -103,7 +103,7 @@ private:
void initPixmap();
void paintPixmap(QPainter &painter, QTabletEvent *event);
Qt::BrushStyle brushPattern(qreal value);
- qreal pressureToWidth(qreal pressure);
+ static qreal pressureToWidth(qreal pressure);
void updateBrush(const QTabletEvent *event);
void updateCursor(const QTabletEvent *event);
diff --git a/examples/xml/dombookmarks/xbeltree.h b/examples/xml/dombookmarks/xbeltree.h
index f6c7ef8bfe..c58e1148ff 100644
--- a/examples/xml/dombookmarks/xbeltree.h
+++ b/examples/xml/dombookmarks/xbeltree.h
@@ -67,7 +67,7 @@ public:
protected:
#if !defined(QT_NO_CONTEXTMENU) && !defined(QT_NO_CLIPBOARD)
- void contextMenuEvent(QContextMenuEvent *event) Q_DECL_OVERRIDE;
+ void contextMenuEvent(QContextMenuEvent *event) override;
#endif
private slots:
diff --git a/mkspecs/android-clang/qplatformdefs.h b/mkspecs/android-clang/qplatformdefs.h
index 017233658e..b9d987e608 100644
--- a/mkspecs/android-clang/qplatformdefs.h
+++ b/mkspecs/android-clang/qplatformdefs.h
@@ -71,10 +71,6 @@
#include <sys/stat.h>
#include <sys/wait.h>
-#ifndef QT_NO_IPV6IFNAME
-#include <net/if.h>
-#endif
-
#ifndef _GNU_SOURCE
# define _GNU_SOURCE
#endif
diff --git a/mkspecs/android-g++/qplatformdefs.h b/mkspecs/android-g++/qplatformdefs.h
index 068f437c11..a0e80629a4 100644
--- a/mkspecs/android-g++/qplatformdefs.h
+++ b/mkspecs/android-g++/qplatformdefs.h
@@ -71,10 +71,6 @@
#include <sys/stat.h>
#include <sys/wait.h>
-#ifndef QT_NO_IPV6IFNAME
-#include <net/if.h>
-#endif
-
#ifndef _GNU_SOURCE
# define _GNU_SOURCE
#endif
diff --git a/mkspecs/common/aix/qplatformdefs.h b/mkspecs/common/aix/qplatformdefs.h
index 7bb8dfedd2..3606a2f1cb 100644
--- a/mkspecs/common/aix/qplatformdefs.h
+++ b/mkspecs/common/aix/qplatformdefs.h
@@ -75,9 +75,6 @@
#include <sys/stat.h>
#include <sys/wait.h>
#include <netinet/in.h>
-#ifndef QT_NO_IPV6IFNAME
-#include <net/if.h>
-#endif
// Only AIX 4.3 and better support 64-bit
diff --git a/mkspecs/common/android/qplatformdefs.h b/mkspecs/common/android/qplatformdefs.h
index 048eb47c6c..23180c5d3c 100644
--- a/mkspecs/common/android/qplatformdefs.h
+++ b/mkspecs/common/android/qplatformdefs.h
@@ -70,10 +70,6 @@
#include <sys/stat.h>
#include <sys/wait.h>
-#ifndef QT_NO_IPV6IFNAME
-#include <net/if.h>
-#endif
-
#ifndef _GNU_SOURCE
# define _GNU_SOURCE
#endif
diff --git a/mkspecs/common/bsd/qplatformdefs.h b/mkspecs/common/bsd/qplatformdefs.h
index 6c3a00b194..8e976d3290 100644
--- a/mkspecs/common/bsd/qplatformdefs.h
+++ b/mkspecs/common/bsd/qplatformdefs.h
@@ -70,9 +70,6 @@
#include <sys/stat.h>
#include <sys/wait.h>
#include <netinet/in.h>
-#ifndef QT_NO_IPV6IFNAME
-#include <net/if.h>
-#endif
#include "../posix/qplatformdefs.h"
diff --git a/mkspecs/common/integrity/qplatformdefs.h b/mkspecs/common/integrity/qplatformdefs.h
index 7039318f25..f0b4dea8e1 100644
--- a/mkspecs/common/integrity/qplatformdefs.h
+++ b/mkspecs/common/integrity/qplatformdefs.h
@@ -68,9 +68,6 @@
#include <sys/stat.h>
#include <sys/wait.h>
#include <netinet/in.h>
-#ifndef QT_NO_IPV6IFNAME
-#include <net/if.h>
-#endif
// for htonl
#include <arpa/inet.h>
diff --git a/mkspecs/common/mac/qplatformdefs.h b/mkspecs/common/mac/qplatformdefs.h
index 5cacd5a749..1927587097 100644
--- a/mkspecs/common/mac/qplatformdefs.h
+++ b/mkspecs/common/mac/qplatformdefs.h
@@ -70,9 +70,6 @@
#include <sys/wait.h>
#define __APPLE_USE_RFC_3542
#include <netinet/in.h>
-#ifndef QT_NO_IPV6IFNAME
-#include <net/if.h>
-#endif
#include "../posix/qplatformdefs.h"
diff --git a/mkspecs/common/qnx/qplatformdefs.h b/mkspecs/common/qnx/qplatformdefs.h
index 72fc92738c..b30cd96002 100644
--- a/mkspecs/common/qnx/qplatformdefs.h
+++ b/mkspecs/common/qnx/qplatformdefs.h
@@ -73,9 +73,6 @@
#include <sys/stat.h>
#include <sys/wait.h>
#include <netinet/in.h>
-#ifndef QT_NO_IPV6IFNAME
-#include <net/if.h>
-#endif
// for htonl
#include <arpa/inet.h>
diff --git a/mkspecs/darwin-g++/qplatformdefs.h b/mkspecs/darwin-g++/qplatformdefs.h
index 46a9383238..faed56310d 100644
--- a/mkspecs/darwin-g++/qplatformdefs.h
+++ b/mkspecs/darwin-g++/qplatformdefs.h
@@ -68,9 +68,6 @@
#include <sys/stat.h>
#include <sys/wait.h>
#include <netinet/in.h>
-#ifndef QT_NO_IPV6IFNAME
-#include <net/if.h>
-#endif
#include "../common/posix/qplatformdefs.h"
diff --git a/mkspecs/features/data/android/dx.bat b/mkspecs/features/data/android/dx.bat
deleted file mode 100644
index 9816f9607d..0000000000
--- a/mkspecs/features/data/android/dx.bat
+++ /dev/null
@@ -1,108 +0,0 @@
-@echo off
-REM Copyright (C) 2007 The Android Open Source Project
-REM
-REM Licensed under the Apache License, Version 2.0 (the "License");
-REM you may not use this file except in compliance with the License.
-REM You may obtain a copy of the License at
-REM
-REM http://www.apache.org/licenses/LICENSE-2.0
-REM
-REM Unless required by applicable law or agreed to in writing, software
-REM distributed under the License is distributed on an "AS IS" BASIS,
-REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-REM See the License for the specific language governing permissions and
-REM limitations under the License.
-
-REM If/when Google merge:
-REM https://android-review.googlesource.com/#/c/52680/
-REM this file will become redundant.
-
-REM don't modify the caller's environment
-setlocal
-
-REM Locate dx.jar in the directory where dx.bat was found and start it.
-
-REM Set up prog to be the path of this script, including following symlinks,
-REM and set up progdir to be the fully-qualified pathname of its directory.
-set prog=%~f0
-
-if [%1]==[] goto badArgs
-set "dx_jar_path=%1"
-shift /1
-
-if [%1]==[] goto badArgs
-
-REM Use dpZ here to make it more like the Google version.
-for %%F in ("%dx_jar_path%") do set dpZ=%%~dpF
-
-rem Check we have a valid Java.exe in the path.
-set java_exe=
-if exist "%dpZ%..\tools\lib\find_java.bat" call "%dpZ%..\tools\lib\find_java.bat"
-if exist "%dpZ%..\..\tools\lib\find_java.bat" call "%dpZ%..\..\tools\lib\find_java.bat"
-
-if not defined java_exe goto :EOF
-
-set jarfile=dx.jar
-set "frameworkdir=%dpZ%"
-rem frameworkdir must not end with a dir sep.
-set "frameworkdir=%frameworkdir:~0,-1%"
-
-if exist "%frameworkdir%\%jarfile%" goto JarFileOk
- set "frameworkdir=%dpZ%lib"
-
-if exist "%frameworkdir%\%jarfile%" goto JarFileOk
- set "frameworkdir=%dpZ%..\framework"
-
-:JarFileOk
-
-set "jarpath=%frameworkdir%\%jarfile%"
-
-set javaOpts=
-set args=
-
-REM By default, give dx a max heap size of 1 gig and a stack size of 1meg.
-rem This can be overridden by using "-JXmx..." and "-JXss..." options below.
-set defaultXmx=-Xmx1024M
-set defaultXss=-Xss1m
-
-REM Capture all arguments that are not -J options.
-REM Note that when reading the input arguments with %1, the cmd.exe
-REM automagically converts --name=value arguments into 2 arguments "--name"
-REM followed by "value". Dx has been changed to know how to deal with that.
-set params=
-
-:firstArg
-if [%1]==[] goto endArgs
-set a=%~1
-
- if [%defaultXmx%]==[] goto notXmx
- if %a:~0,5% NEQ -JXmx goto notXmx
- set defaultXmx=
- :notXmx
-
- if [%defaultXss%]==[] goto notXss
- if %a:~0,5% NEQ -JXss goto notXss
- set defaultXss=
- :notXss
-
- if %a:~0,2% NEQ -J goto notJ
- set javaOpts=%javaOpts% -%a:~2%
- shift /1
- goto firstArg
-
- :notJ
- set params=%params% %1
- shift /1
- goto firstArg
-
-:endArgs
-
-set javaOpts=%javaOpts% %defaultXmx% %defaultXss%
-call "%java_exe%" %javaOpts% -Djava.ext.dirs="%frameworkdir%" -jar "%jarpath%" %params%
-
-goto :EOF
-
-:badArgs
-echo Usage: dx (for Qt) ^<android_sdk_dx_jar_path^> ^<dx_arguments^>
-echo Example: dx (for Qt) C:\android-sdk\build-tools\17.0.0\dx.jar --dex --output=target.jar .classes
-
diff --git a/mkspecs/features/java.prf b/mkspecs/features/java.prf
index 852954e5ca..f1f5e4c10c 100644
--- a/mkspecs/features/java.prf
+++ b/mkspecs/features/java.prf
@@ -7,10 +7,8 @@ android {
CONFIG += android_app
}
-isEmpty(CLASS_DIR) {
- bundled_jar_file: CLASS_DIR = .classes.bundled
- else: CLASS_DIR = .classes
-}
+isEmpty(CLASS_DIR): \
+ CLASS_DIR = .classes
CONFIG -= qt
@@ -39,26 +37,7 @@ QMAKE_LIBS =
QMAKE_LIBS_OPENGL_ES2 =
QMAKE_LIBDIR =
QMAKE_EXTENSION_SHLIB = jar
-
-# Override linker with dex (for distributable Android archives) or jar (for other java builds)
-android:!bundled_jar_file {
- contains(QMAKE_HOST.os, Windows) {
- # The location where dx.bat expects itself to be found is used as the landmark instead
- # of the base sdk folder.
- # Doing it this way makes this logic more similar to the other platforms and
- # also means that our dx.bat is more like Google's dx.bat
- DEX_BAT = $$ANDROID_SDK_ROOT/platform-tools/dx.bat
- !exists($$DEX_BAT): DEX_BAT = $$ANDROID_SDK_ROOT/build-tools/$$ANDROID_SDK_BUILD_TOOLS_REVISION/dx.bat
- DEX_CMD = $$PWD/data/android/dx $$DEX_BAT
- } else {
- DEX_CMD = $$ANDROID_SDK_ROOT/platform-tools/dx
- !exists($$DEX_CMD): DEX_CMD = $$ANDROID_SDK_ROOT/build-tools/$$ANDROID_SDK_BUILD_TOOLS_REVISION/dx
- !exists($$DEX_CMD): error("The path $$DEX_CMD does not exist. Please set the environment variable ANDROID_BUILD_TOOLS_REVISION to the revision of the build tools installed in your Android SDK.")
- }
- QMAKE_LINK_SHLIB_CMD = $$DEX_CMD --dex --output $(TARGET) $$CLASS_DIR
-} else {
- QMAKE_LINK_SHLIB_CMD = jar cf $(TARGET) -C $$CLASS_DIR .
-}
+QMAKE_LINK_SHLIB_CMD = jar cf $(TARGET) -C $$CLASS_DIR .
# Force link step to always happen, since we are always updating the
# .class files
diff --git a/mkspecs/features/qt_plugin.prf b/mkspecs/features/qt_plugin.prf
index 62e1b69fde..9676244cc2 100644
--- a/mkspecs/features/qt_plugin.prf
+++ b/mkspecs/features/qt_plugin.prf
@@ -95,6 +95,8 @@ TARGET = $$qt5LibraryTarget($$TARGET)
CONFIG += create_cmake
+DEFINES *= QT_DEPRECATED_WARNINGS
+
load(qt_targets)
load(qt_common)
diff --git a/mkspecs/haiku-g++/qplatformdefs.h b/mkspecs/haiku-g++/qplatformdefs.h
index 000541912f..21636c031e 100644
--- a/mkspecs/haiku-g++/qplatformdefs.h
+++ b/mkspecs/haiku-g++/qplatformdefs.h
@@ -67,9 +67,6 @@
#include <sys/stat.h>
#include <sys/wait.h>
#include <netinet/in.h>
-#ifndef QT_NO_IPV6IFNAME
-#include <net/if.h>
-#endif
#include "../common/posix/qplatformdefs.h"
diff --git a/mkspecs/hpuxi-g++-64/qplatformdefs.h b/mkspecs/hpuxi-g++-64/qplatformdefs.h
index 966dfcf8c2..816fd0de6c 100644
--- a/mkspecs/hpuxi-g++-64/qplatformdefs.h
+++ b/mkspecs/hpuxi-g++-64/qplatformdefs.h
@@ -70,9 +70,6 @@
#include <sys/stat.h>
#include <sys/wait.h>
#include <netinet/in.h>
-#ifndef QT_NO_IPV6IFNAME
-#include <net/if.h>
-#endif
#define QT_USE_XOPEN_LFS_EXTENSIONS
#define QT_NO_READDIR64
diff --git a/mkspecs/hurd-g++/qplatformdefs.h b/mkspecs/hurd-g++/qplatformdefs.h
index 9ee7de783b..3c80cbdfad 100644
--- a/mkspecs/hurd-g++/qplatformdefs.h
+++ b/mkspecs/hurd-g++/qplatformdefs.h
@@ -76,9 +76,6 @@
#include <sys/stat.h>
#include <sys/wait.h>
#include <netinet/in.h>
-#ifndef QT_NO_IPV6IFNAME
-#include <net/if.h>
-#endif
#include "../common/posix/qplatformdefs.h"
diff --git a/mkspecs/linux-clang/qplatformdefs.h b/mkspecs/linux-clang/qplatformdefs.h
index d29225f12f..a818d973f0 100644
--- a/mkspecs/linux-clang/qplatformdefs.h
+++ b/mkspecs/linux-clang/qplatformdefs.h
@@ -75,9 +75,6 @@
#include <sys/stat.h>
#include <sys/wait.h>
#include <netinet/in.h>
-#ifndef QT_NO_IPV6IFNAME
-#include <net/if.h>
-#endif
#define QT_USE_XOPEN_LFS_EXTENSIONS
#include "../common/posix/qplatformdefs.h"
diff --git a/mkspecs/linux-g++/qplatformdefs.h b/mkspecs/linux-g++/qplatformdefs.h
index c9c0db7b5e..13523f0702 100644
--- a/mkspecs/linux-g++/qplatformdefs.h
+++ b/mkspecs/linux-g++/qplatformdefs.h
@@ -75,9 +75,6 @@
#include <sys/stat.h>
#include <sys/wait.h>
#include <netinet/in.h>
-#ifndef QT_NO_IPV6IFNAME
-#include <net/if.h>
-#endif
#define QT_USE_XOPEN_LFS_EXTENSIONS
#include "../common/posix/qplatformdefs.h"
diff --git a/mkspecs/linux-llvm/qplatformdefs.h b/mkspecs/linux-llvm/qplatformdefs.h
index 1b2a8997cf..dc750ab1ef 100644
--- a/mkspecs/linux-llvm/qplatformdefs.h
+++ b/mkspecs/linux-llvm/qplatformdefs.h
@@ -76,9 +76,6 @@
#include <sys/stat.h>
#include <sys/wait.h>
#include <netinet/in.h>
-#ifndef QT_NO_IPV6IFNAME
-#include <net/if.h>
-#endif
#define QT_USE_XOPEN_LFS_EXTENSIONS
#include "../common/posix/qplatformdefs.h"
diff --git a/mkspecs/linux-lsb-g++/qplatformdefs.h b/mkspecs/linux-lsb-g++/qplatformdefs.h
index 0ff012aaf3..4c4e53da2a 100644
--- a/mkspecs/linux-lsb-g++/qplatformdefs.h
+++ b/mkspecs/linux-lsb-g++/qplatformdefs.h
@@ -77,9 +77,6 @@
#include <sys/stat.h>
#include <sys/wait.h>
#include <netinet/in.h>
-#ifndef QT_NO_IPV6IFNAME
-#include <net/if.h>
-#endif
// LSB 3.1 defines htonl and friends here
#include <arpa/inet.h>
diff --git a/mkspecs/lynxos-g++/qplatformdefs.h b/mkspecs/lynxos-g++/qplatformdefs.h
index 7231b17840..4339ea2b23 100644
--- a/mkspecs/lynxos-g++/qplatformdefs.h
+++ b/mkspecs/lynxos-g++/qplatformdefs.h
@@ -69,9 +69,6 @@
#include <sys/stat.h>
#include <sys/wait.h>
#include <netinet/in.h>
-#ifndef QT_NO_IPV6IFNAME
-#include <net/if.h>
-#endif
#include "../common/posix/qplatformdefs.h"
diff --git a/mkspecs/solaris-cc-64/qplatformdefs.h b/mkspecs/solaris-cc-64/qplatformdefs.h
index 7a01081933..f430664a9e 100644
--- a/mkspecs/solaris-cc-64/qplatformdefs.h
+++ b/mkspecs/solaris-cc-64/qplatformdefs.h
@@ -70,9 +70,6 @@
#include <sys/stat.h>
#include <sys/wait.h>
#include <netinet/in.h>
-#ifndef QT_NO_IPV6IFNAME
-#include <net/if.h>
-#endif
#define QT_USE_XOPEN_LFS_EXTENSIONS
#include "../common/posix/qplatformdefs.h"
diff --git a/mkspecs/solaris-cc/qplatformdefs.h b/mkspecs/solaris-cc/qplatformdefs.h
index a5ad9005a0..8350836deb 100644
--- a/mkspecs/solaris-cc/qplatformdefs.h
+++ b/mkspecs/solaris-cc/qplatformdefs.h
@@ -70,9 +70,6 @@
#include <sys/stat.h>
#include <sys/wait.h>
#include <netinet/in.h>
-#ifndef QT_NO_IPV6IFNAME
-#include <net/if.h>
-#endif
#define QT_USE_XOPEN_LFS_EXTENSIONS
#include "../common/posix/qplatformdefs.h"
diff --git a/mkspecs/solaris-g++-64/qplatformdefs.h b/mkspecs/solaris-g++-64/qplatformdefs.h
index 7504912a89..ae559183ff 100644
--- a/mkspecs/solaris-g++-64/qplatformdefs.h
+++ b/mkspecs/solaris-g++-64/qplatformdefs.h
@@ -73,9 +73,6 @@
#include <sys/stat.h>
#include <sys/wait.h>
#include <netinet/in.h>
-#ifndef QT_NO_IPV6IFNAME
-#include <net/if.h>
-#endif
#define QT_USE_XOPEN_LFS_EXTENSIONS
#include "../common/posix/qplatformdefs.h"
diff --git a/mkspecs/solaris-g++/qplatformdefs.h b/mkspecs/solaris-g++/qplatformdefs.h
index 112850ee8a..bd14a86b51 100644
--- a/mkspecs/solaris-g++/qplatformdefs.h
+++ b/mkspecs/solaris-g++/qplatformdefs.h
@@ -73,9 +73,6 @@
#include <sys/stat.h>
#include <sys/wait.h>
#include <netinet/in.h>
-#ifndef QT_NO_IPV6IFNAME
-#include <net/if.h>
-#endif
#define QT_USE_XOPEN_LFS_EXTENSIONS
#include "../common/posix/qplatformdefs.h"
diff --git a/mkspecs/unsupported/qnx-X11-g++/qplatformdefs.h b/mkspecs/unsupported/qnx-X11-g++/qplatformdefs.h
index de4a2cc2cb..e090179f52 100644
--- a/mkspecs/unsupported/qnx-X11-g++/qplatformdefs.h
+++ b/mkspecs/unsupported/qnx-X11-g++/qplatformdefs.h
@@ -72,9 +72,6 @@
#include <sys/stat.h>
#include <sys/wait.h>
#include <netinet/in.h>
-#ifndef QT_NO_IPV6IFNAME
-#include <net/if.h>
-#endif
// for htonl
#include <arpa/inet.h>
diff --git a/src/android/jar/bundledjar.pro b/src/android/jar/bundledjar.pro
deleted file mode 100644
index e82c01c51b..0000000000
--- a/src/android/jar/bundledjar.pro
+++ /dev/null
@@ -1,3 +0,0 @@
-TARGET = QtAndroid-bundled
-CONFIG += bundled_jar_file
-include(jar.pri)
diff --git a/src/android/jar/distributedjar.pro b/src/android/jar/distributedjar.pro
deleted file mode 100644
index 15f362f629..0000000000
--- a/src/android/jar/distributedjar.pro
+++ /dev/null
@@ -1,2 +0,0 @@
-TARGET = QtAndroid
-include(jar.pri)
diff --git a/src/android/jar/jar.pri b/src/android/jar/jar.pri
deleted file mode 100644
index 4535880536..0000000000
--- a/src/android/jar/jar.pri
+++ /dev/null
@@ -1,26 +0,0 @@
-CONFIG += java
-DESTDIR = $$[QT_INSTALL_PREFIX/get]/jar
-API_VERSION = android-16
-
-PATHPREFIX = $$PWD/src/org/qtproject/qt5/android/
-
-JAVACLASSPATH += $$PWD/src/
-JAVASOURCES += \
- $$PATHPREFIX/accessibility/QtAccessibilityDelegate.java \
- $$PATHPREFIX/accessibility/QtNativeAccessibility.java \
- $$PATHPREFIX/QtActivityDelegate.java \
- $$PATHPREFIX/QtEditText.java \
- $$PATHPREFIX/QtInputConnection.java \
- $$PATHPREFIX/QtLayout.java \
- $$PATHPREFIX/QtMessageDialogHelper.java \
- $$PATHPREFIX/QtNative.java \
- $$PATHPREFIX/QtNativeLibrariesDir.java \
- $$PATHPREFIX/QtSurface.java \
- $$PATHPREFIX/ExtractStyle.java \
- $$PATHPREFIX/EditMenu.java \
- $$PATHPREFIX/EditPopupMenu.java \
- $$PATHPREFIX/CursorHandle.java
-
-# install
-target.path = $$[QT_INSTALL_PREFIX]/jar
-INSTALLS += target
diff --git a/src/android/jar/jar.pro b/src/android/jar/jar.pro
index 8d19c1b7d6..603e28aeee 100644
--- a/src/android/jar/jar.pro
+++ b/src/android/jar/jar.pro
@@ -1,2 +1,28 @@
-TEMPLATE = subdirs
-SUBDIRS += bundledjar.pro distributedjar.pro
+TARGET = QtAndroid
+
+CONFIG += java
+DESTDIR = $$[QT_INSTALL_PREFIX/get]/jar
+API_VERSION = android-16
+
+PATHPREFIX = $$PWD/src/org/qtproject/qt5/android/
+
+JAVACLASSPATH += $$PWD/src/
+JAVASOURCES += \
+ $$PATHPREFIX/accessibility/QtAccessibilityDelegate.java \
+ $$PATHPREFIX/accessibility/QtNativeAccessibility.java \
+ $$PATHPREFIX/QtActivityDelegate.java \
+ $$PATHPREFIX/QtEditText.java \
+ $$PATHPREFIX/QtInputConnection.java \
+ $$PATHPREFIX/QtLayout.java \
+ $$PATHPREFIX/QtMessageDialogHelper.java \
+ $$PATHPREFIX/QtNative.java \
+ $$PATHPREFIX/QtNativeLibrariesDir.java \
+ $$PATHPREFIX/QtSurface.java \
+ $$PATHPREFIX/ExtractStyle.java \
+ $$PATHPREFIX/EditMenu.java \
+ $$PATHPREFIX/EditPopupMenu.java \
+ $$PATHPREFIX/CursorHandle.java
+
+# install
+target.path = $$[QT_INSTALL_PREFIX]/jar
+INSTALLS += target
diff --git a/src/concurrent/qtconcurrentiteratekernel.h b/src/concurrent/qtconcurrentiteratekernel.h
index dbd000e8ba..082fa9e838 100644
--- a/src/concurrent/qtconcurrentiteratekernel.h
+++ b/src/concurrent/qtconcurrentiteratekernel.h
@@ -159,7 +159,7 @@ public:
inline ResultReporter(ThreadEngine<void> *) { }
inline void reserveSpace(int) { }
inline void reportResults(int) { }
- inline void * getPointer() { return Q_NULLPTR; }
+ inline void * getPointer() { return nullptr; }
};
inline bool selectIteration(std::bidirectional_iterator_tag)
diff --git a/src/concurrent/qtconcurrentthreadengine.h b/src/concurrent/qtconcurrentthreadengine.h
index f915e9adfd..450e7b8d50 100644
--- a/src/concurrent/qtconcurrentthreadengine.h
+++ b/src/concurrent/qtconcurrentthreadengine.h
@@ -113,7 +113,7 @@ private:
void startThreads();
void threadExit();
bool threadThrottleExit();
- void run() Q_DECL_OVERRIDE;
+ void run() override;
virtual void asynchronousFinish() = 0;
#ifndef QT_NO_EXCEPTIONS
void handleException(const QException &exception);
@@ -132,7 +132,7 @@ class ThreadEngine : public virtual ThreadEngineBase
public:
typedef T ResultType;
- virtual T *result() { return Q_NULLPTR; }
+ virtual T *result() { return nullptr; }
QFutureInterface<T> *futureInterfaceTyped()
{
@@ -173,7 +173,7 @@ public:
return future;
}
- void asynchronousFinish() Q_DECL_OVERRIDE
+ void asynchronousFinish() override
{
finish();
futureInterfaceTyped()->reportFinished(result());
diff --git a/src/corelib/animation/qabstractanimation.h b/src/corelib/animation/qabstractanimation.h
index 727b4e7777..0ff6bc5176 100644
--- a/src/corelib/animation/qabstractanimation.h
+++ b/src/corelib/animation/qabstractanimation.h
@@ -82,7 +82,7 @@ public:
DeleteWhenStopped
};
- QAbstractAnimation(QObject *parent = Q_NULLPTR);
+ QAbstractAnimation(QObject *parent = nullptr);
virtual ~QAbstractAnimation();
State state() const;
@@ -117,8 +117,8 @@ public Q_SLOTS:
void setCurrentTime(int msecs);
protected:
- QAbstractAnimation(QAbstractAnimationPrivate &dd, QObject *parent = Q_NULLPTR);
- bool event(QEvent *event) Q_DECL_OVERRIDE;
+ QAbstractAnimation(QAbstractAnimationPrivate &dd, QObject *parent = nullptr);
+ bool event(QEvent *event) override;
virtual void updateCurrentTime(int currentTime) = 0;
virtual void updateState(QAbstractAnimation::State newState, QAbstractAnimation::State oldState);
@@ -136,7 +136,7 @@ class Q_CORE_EXPORT QAnimationDriver : public QObject
Q_DECLARE_PRIVATE(QAnimationDriver)
public:
- QAnimationDriver(QObject *parent = Q_NULLPTR);
+ QAnimationDriver(QObject *parent = nullptr);
~QAnimationDriver();
virtual void advance();
@@ -162,7 +162,7 @@ protected:
virtual void start();
virtual void stop();
- QAnimationDriver(QAnimationDriverPrivate &dd, QObject *parent = Q_NULLPTR);
+ QAnimationDriver(QAnimationDriverPrivate &dd, QObject *parent = nullptr);
private:
friend class QUnifiedTimer;
diff --git a/src/corelib/animation/qabstractanimation_p.h b/src/corelib/animation/qabstractanimation_p.h
index 3b901c4426..5593046e48 100644
--- a/src/corelib/animation/qabstractanimation_p.h
+++ b/src/corelib/animation/qabstractanimation_p.h
@@ -116,7 +116,7 @@ class QDefaultAnimationDriver : public QAnimationDriver
Q_OBJECT
public:
QDefaultAnimationDriver(QUnifiedTimer *timer);
- void timerEvent(QTimerEvent *e) Q_DECL_OVERRIDE;
+ void timerEvent(QTimerEvent *e) override;
private Q_SLOTS:
void startTimer();
@@ -196,7 +196,7 @@ public:
qint64 elapsed() const;
protected:
- void timerEvent(QTimerEvent *) Q_DECL_OVERRIDE;
+ void timerEvent(QTimerEvent *) override;
private Q_SLOTS:
void startTimers();
@@ -265,11 +265,11 @@ public:
*/
static void updateAnimationTimer();
- void restartAnimationTimer() Q_DECL_OVERRIDE;
- void updateAnimationsTime(qint64 delta) Q_DECL_OVERRIDE;
+ void restartAnimationTimer() override;
+ void updateAnimationsTime(qint64 delta) override;
//useful for profiling/debugging
- int runningAnimationCount() Q_DECL_OVERRIDE { return animations.count(); }
+ int runningAnimationCount() override { return animations.count(); }
private Q_SLOTS:
void startAnimations();
diff --git a/src/corelib/animation/qanimationgroup.h b/src/corelib/animation/qanimationgroup.h
index 20be0c0dd4..136ad3ca9f 100644
--- a/src/corelib/animation/qanimationgroup.h
+++ b/src/corelib/animation/qanimationgroup.h
@@ -53,7 +53,7 @@ class Q_CORE_EXPORT QAnimationGroup : public QAbstractAnimation
Q_OBJECT
public:
- QAnimationGroup(QObject *parent = Q_NULLPTR);
+ QAnimationGroup(QObject *parent = nullptr);
~QAnimationGroup();
QAbstractAnimation *animationAt(int index) const;
@@ -67,7 +67,7 @@ public:
protected:
QAnimationGroup(QAnimationGroupPrivate &dd, QObject *parent);
- bool event(QEvent *event) Q_DECL_OVERRIDE;
+ bool event(QEvent *event) override;
private:
Q_DISABLE_COPY(QAnimationGroup)
diff --git a/src/corelib/animation/qparallelanimationgroup.h b/src/corelib/animation/qparallelanimationgroup.h
index 3a00e9fd12..09a439ef24 100644
--- a/src/corelib/animation/qparallelanimationgroup.h
+++ b/src/corelib/animation/qparallelanimationgroup.h
@@ -53,18 +53,18 @@ class Q_CORE_EXPORT QParallelAnimationGroup : public QAnimationGroup
Q_OBJECT
public:
- QParallelAnimationGroup(QObject *parent = Q_NULLPTR);
+ QParallelAnimationGroup(QObject *parent = nullptr);
~QParallelAnimationGroup();
- int duration() const Q_DECL_OVERRIDE;
+ int duration() const override;
protected:
QParallelAnimationGroup(QParallelAnimationGroupPrivate &dd, QObject *parent);
- bool event(QEvent *event) Q_DECL_OVERRIDE;
+ bool event(QEvent *event) override;
- void updateCurrentTime(int currentTime) Q_DECL_OVERRIDE;
- void updateState(QAbstractAnimation::State newState, QAbstractAnimation::State oldState) Q_DECL_OVERRIDE;
- void updateDirection(QAbstractAnimation::Direction direction) Q_DECL_OVERRIDE;
+ void updateCurrentTime(int currentTime) override;
+ void updateState(QAbstractAnimation::State newState, QAbstractAnimation::State oldState) override;
+ void updateDirection(QAbstractAnimation::Direction direction) override;
private:
Q_DISABLE_COPY(QParallelAnimationGroup)
diff --git a/src/corelib/animation/qparallelanimationgroup_p.h b/src/corelib/animation/qparallelanimationgroup_p.h
index 069ba8e51a..1c9c3072f7 100644
--- a/src/corelib/animation/qparallelanimationgroup_p.h
+++ b/src/corelib/animation/qparallelanimationgroup_p.h
@@ -78,7 +78,7 @@ public:
void connectUncontrolledAnimations();
void disconnectUncontrolledAnimations();
- void animationRemoved(int index, QAbstractAnimation *) Q_DECL_OVERRIDE;
+ void animationRemoved(int index, QAbstractAnimation *) override;
// private slot
void _q_uncontrolledAnimationFinished();
diff --git a/src/corelib/animation/qpauseanimation.h b/src/corelib/animation/qpauseanimation.h
index c077164beb..e2095a39d6 100644
--- a/src/corelib/animation/qpauseanimation.h
+++ b/src/corelib/animation/qpauseanimation.h
@@ -54,16 +54,16 @@ class Q_CORE_EXPORT QPauseAnimation : public QAbstractAnimation
Q_OBJECT
Q_PROPERTY(int duration READ duration WRITE setDuration)
public:
- QPauseAnimation(QObject *parent = Q_NULLPTR);
- QPauseAnimation(int msecs, QObject *parent = Q_NULLPTR);
+ QPauseAnimation(QObject *parent = nullptr);
+ QPauseAnimation(int msecs, QObject *parent = nullptr);
~QPauseAnimation();
- int duration() const Q_DECL_OVERRIDE;
+ int duration() const override;
void setDuration(int msecs);
protected:
- bool event(QEvent *e) Q_DECL_OVERRIDE;
- void updateCurrentTime(int) Q_DECL_OVERRIDE;
+ bool event(QEvent *e) override;
+ void updateCurrentTime(int) override;
private:
Q_DISABLE_COPY(QPauseAnimation)
diff --git a/src/corelib/animation/qpropertyanimation.h b/src/corelib/animation/qpropertyanimation.h
index ecc7524884..3270591d1d 100644
--- a/src/corelib/animation/qpropertyanimation.h
+++ b/src/corelib/animation/qpropertyanimation.h
@@ -55,8 +55,8 @@ class Q_CORE_EXPORT QPropertyAnimation : public QVariantAnimation
Q_PROPERTY(QObject* targetObject READ targetObject WRITE setTargetObject)
public:
- QPropertyAnimation(QObject *parent = Q_NULLPTR);
- QPropertyAnimation(QObject *target, const QByteArray &propertyName, QObject *parent = Q_NULLPTR);
+ QPropertyAnimation(QObject *parent = nullptr);
+ QPropertyAnimation(QObject *target, const QByteArray &propertyName, QObject *parent = nullptr);
~QPropertyAnimation();
QObject *targetObject() const;
@@ -66,9 +66,9 @@ public:
void setPropertyName(const QByteArray &propertyName);
protected:
- bool event(QEvent *event) Q_DECL_OVERRIDE;
- void updateCurrentValue(const QVariant &value) Q_DECL_OVERRIDE;
- void updateState(QAbstractAnimation::State newState, QAbstractAnimation::State oldState) Q_DECL_OVERRIDE;
+ bool event(QEvent *event) override;
+ void updateCurrentValue(const QVariant &value) override;
+ void updateState(QAbstractAnimation::State newState, QAbstractAnimation::State oldState) override;
private:
Q_DISABLE_COPY(QPropertyAnimation)
diff --git a/src/corelib/animation/qsequentialanimationgroup.h b/src/corelib/animation/qsequentialanimationgroup.h
index 3caf93b054..1c8e67d256 100644
--- a/src/corelib/animation/qsequentialanimationgroup.h
+++ b/src/corelib/animation/qsequentialanimationgroup.h
@@ -56,25 +56,25 @@ class Q_CORE_EXPORT QSequentialAnimationGroup : public QAnimationGroup
Q_PROPERTY(QAbstractAnimation* currentAnimation READ currentAnimation NOTIFY currentAnimationChanged)
public:
- QSequentialAnimationGroup(QObject *parent = Q_NULLPTR);
+ QSequentialAnimationGroup(QObject *parent = nullptr);
~QSequentialAnimationGroup();
QPauseAnimation *addPause(int msecs);
QPauseAnimation *insertPause(int index, int msecs);
QAbstractAnimation *currentAnimation() const;
- int duration() const Q_DECL_OVERRIDE;
+ int duration() const override;
Q_SIGNALS:
void currentAnimationChanged(QAbstractAnimation *current);
protected:
QSequentialAnimationGroup(QSequentialAnimationGroupPrivate &dd, QObject *parent);
- bool event(QEvent *event) Q_DECL_OVERRIDE;
+ bool event(QEvent *event) override;
- void updateCurrentTime(int) Q_DECL_OVERRIDE;
- void updateState(QAbstractAnimation::State newState, QAbstractAnimation::State oldState) Q_DECL_OVERRIDE;
- void updateDirection(QAbstractAnimation::Direction direction) Q_DECL_OVERRIDE;
+ void updateCurrentTime(int) override;
+ void updateState(QAbstractAnimation::State newState, QAbstractAnimation::State oldState) override;
+ void updateDirection(QAbstractAnimation::Direction direction) override;
private:
Q_DISABLE_COPY(QSequentialAnimationGroup)
diff --git a/src/corelib/animation/qsequentialanimationgroup_p.h b/src/corelib/animation/qsequentialanimationgroup_p.h
index 1b07e1330a..e4f3d9c96a 100644
--- a/src/corelib/animation/qsequentialanimationgroup_p.h
+++ b/src/corelib/animation/qsequentialanimationgroup_p.h
@@ -82,8 +82,8 @@ public:
void setCurrentAnimation(int index, bool intermediate = false);
void activateCurrentAnimation(bool intermediate = false);
- void animationInsertedAt(int index) Q_DECL_OVERRIDE;
- void animationRemoved(int index, QAbstractAnimation *anim) Q_DECL_OVERRIDE;
+ void animationInsertedAt(int index) override;
+ void animationRemoved(int index, QAbstractAnimation *anim) override;
bool atEnd() const;
diff --git a/src/corelib/animation/qvariantanimation.h b/src/corelib/animation/qvariantanimation.h
index f21832b256..ed38979ad0 100644
--- a/src/corelib/animation/qvariantanimation.h
+++ b/src/corelib/animation/qvariantanimation.h
@@ -65,7 +65,7 @@ public:
typedef QPair<qreal, QVariant> KeyValue;
typedef QVector<KeyValue> KeyValues;
- QVariantAnimation(QObject *parent = Q_NULLPTR);
+ QVariantAnimation(QObject *parent = nullptr);
~QVariantAnimation();
QVariant startValue() const;
@@ -82,7 +82,7 @@ public:
QVariant currentValue() const;
- int duration() const Q_DECL_OVERRIDE;
+ int duration() const override;
void setDuration(int msecs);
QEasingCurve easingCurve() const;
@@ -94,11 +94,11 @@ Q_SIGNALS:
void valueChanged(const QVariant &value);
protected:
- QVariantAnimation(QVariantAnimationPrivate &dd, QObject *parent = Q_NULLPTR);
- bool event(QEvent *event) Q_DECL_OVERRIDE;
+ QVariantAnimation(QVariantAnimationPrivate &dd, QObject *parent = nullptr);
+ bool event(QEvent *event) override;
- void updateCurrentTime(int) Q_DECL_OVERRIDE;
- void updateState(QAbstractAnimation::State newState, QAbstractAnimation::State oldState) Q_DECL_OVERRIDE;
+ void updateCurrentTime(int) override;
+ void updateState(QAbstractAnimation::State newState, QAbstractAnimation::State oldState) override;
virtual void updateCurrentValue(const QVariant &value);
virtual QVariant interpolated(const QVariant &from, const QVariant &to, qreal progress) const;
diff --git a/src/corelib/arch/qatomic_cxx11.h b/src/corelib/arch/qatomic_cxx11.h
index 1404849382..2fc0bf5419 100644
--- a/src/corelib/arch/qatomic_cxx11.h
+++ b/src/corelib/arch/qatomic_cxx11.h
@@ -276,7 +276,7 @@ template <typename X> struct QAtomicOps
static inline Q_DECL_CONSTEXPR bool isTestAndSetWaitFree() Q_DECL_NOTHROW { return false; }
template <typename T>
- static bool testAndSetRelaxed(std::atomic<T> &_q_value, T expectedValue, T newValue, T *currentValue = Q_NULLPTR) Q_DECL_NOTHROW
+ static bool testAndSetRelaxed(std::atomic<T> &_q_value, T expectedValue, T newValue, T *currentValue = nullptr) Q_DECL_NOTHROW
{
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 = Q_NULLPTR) Q_DECL_NOTHROW
+ static bool testAndSetAcquire(std::atomic<T> &_q_value, T expectedValue, T newValue, T *currentValue = nullptr) Q_DECL_NOTHROW
{
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 = Q_NULLPTR) Q_DECL_NOTHROW
+ static bool testAndSetRelease(std::atomic<T> &_q_value, T expectedValue, T newValue, T *currentValue = nullptr) Q_DECL_NOTHROW
{
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 = Q_NULLPTR) Q_DECL_NOTHROW
+ static bool testAndSetOrdered(std::atomic<T> &_q_value, T expectedValue, T newValue, T *currentValue = nullptr) Q_DECL_NOTHROW
{
bool tmp = _q_value.compare_exchange_strong(expectedValue, newValue, std::memory_order_acq_rel, std::memory_order_acquire);
if (currentValue)
diff --git a/src/corelib/codecs/qiconvcodec.cpp b/src/corelib/codecs/qiconvcodec.cpp
index d6362b6fbc..330eb7c038 100644
--- a/src/corelib/codecs/qiconvcodec.cpp
+++ b/src/corelib/codecs/qiconvcodec.cpp
@@ -53,7 +53,7 @@ QT_REQUIRE_CONFIG(iconv);
// unistd.h is needed for the _XOPEN_UNIX macro
#include <unistd.h>
-#if defined(_XOPEN_UNIX) && !defined(Q_OS_QNX) && !defined(Q_OS_OSF)
+#if defined(_XOPEN_UNIX) && !defined(Q_OS_QNX)
# include <langinfo.h>
#endif
@@ -447,7 +447,7 @@ iconv_t QIconvCodec::createIconv_t(const char *to, const char *from) const
char *codeset = 0;
#endif
-#if defined(_XOPEN_UNIX) && !defined(Q_OS_QNX) && !defined(Q_OS_OSF)
+#if defined(_XOPEN_UNIX) && !defined(Q_OS_QNX)
if (cd == (iconv_t) -1) {
codeset = nl_langinfo(CODESET);
if (codeset)
diff --git a/src/corelib/codecs/qicucodec_p.h b/src/corelib/codecs/qicucodec_p.h
index 3a373ce5b3..0c2dbe17d6 100644
--- a/src/corelib/codecs/qicucodec_p.h
+++ b/src/corelib/codecs/qicucodec_p.h
@@ -74,12 +74,12 @@ public:
static QTextCodec *codecForNameUnlocked(const char *name);
static QTextCodec *codecForMibUnlocked(int mib);
- QString convertToUnicode(const char *, int, ConverterState *) const Q_DECL_OVERRIDE;
- QByteArray convertFromUnicode(const QChar *, int, ConverterState *) const Q_DECL_OVERRIDE;
+ QString convertToUnicode(const char *, int, ConverterState *) const override;
+ QByteArray convertFromUnicode(const QChar *, int, ConverterState *) const override;
- QByteArray name() const Q_DECL_OVERRIDE;
- QList<QByteArray> aliases() const Q_DECL_OVERRIDE;
- int mibEnum() const Q_DECL_OVERRIDE;
+ QByteArray name() const override;
+ QList<QByteArray> aliases() const override;
+ int mibEnum() const override;
private:
QIcuCodec(const char *name);
diff --git a/src/corelib/codecs/qisciicodec_p.h b/src/corelib/codecs/qisciicodec_p.h
index f92c0091ce..f818e7d83e 100644
--- a/src/corelib/codecs/qisciicodec_p.h
+++ b/src/corelib/codecs/qisciicodec_p.h
@@ -65,11 +65,11 @@ public:
static QTextCodec *create(const char *name);
- QByteArray name() const Q_DECL_OVERRIDE;
- int mibEnum() const Q_DECL_OVERRIDE;
+ QByteArray name() const override;
+ int mibEnum() const override;
- QString convertToUnicode(const char *, int, ConverterState *) const Q_DECL_OVERRIDE;
- QByteArray convertFromUnicode(const QChar *, int, ConverterState *) const Q_DECL_OVERRIDE;
+ QString convertToUnicode(const char *, int, ConverterState *) const override;
+ QByteArray convertFromUnicode(const QChar *, int, ConverterState *) const override;
private:
int idx;
diff --git a/src/corelib/codecs/qlatincodec_p.h b/src/corelib/codecs/qlatincodec_p.h
index 1042c3b80d..3e258e5ae1 100644
--- a/src/corelib/codecs/qlatincodec_p.h
+++ b/src/corelib/codecs/qlatincodec_p.h
@@ -63,12 +63,12 @@ class QLatin1Codec : public QTextCodec
public:
~QLatin1Codec();
- QString convertToUnicode(const char *, int, ConverterState *) const Q_DECL_OVERRIDE;
- QByteArray convertFromUnicode(const QChar *, int, ConverterState *) const Q_DECL_OVERRIDE;
+ QString convertToUnicode(const char *, int, ConverterState *) const override;
+ QByteArray convertFromUnicode(const QChar *, int, ConverterState *) const override;
- QByteArray name() const Q_DECL_OVERRIDE;
- QList<QByteArray> aliases() const Q_DECL_OVERRIDE;
- int mibEnum() const Q_DECL_OVERRIDE;
+ QByteArray name() const override;
+ QList<QByteArray> aliases() const override;
+ int mibEnum() const override;
};
@@ -78,12 +78,12 @@ class QLatin15Codec: public QTextCodec
public:
~QLatin15Codec();
- QString convertToUnicode(const char *, int, ConverterState *) const Q_DECL_OVERRIDE;
- QByteArray convertFromUnicode(const QChar *, int, ConverterState *) const Q_DECL_OVERRIDE;
+ QString convertToUnicode(const char *, int, ConverterState *) const override;
+ QByteArray convertFromUnicode(const QChar *, int, ConverterState *) const override;
- QByteArray name() const Q_DECL_OVERRIDE;
- QList<QByteArray> aliases() const Q_DECL_OVERRIDE;
- int mibEnum() const Q_DECL_OVERRIDE;
+ QByteArray name() const override;
+ QList<QByteArray> aliases() const override;
+ int mibEnum() const override;
};
#endif // QT_NO_TEXTCODEC
diff --git a/src/corelib/codecs/qtextcodec.cpp b/src/corelib/codecs/qtextcodec.cpp
index 4f0cd914ca..1541c498e6 100644
--- a/src/corelib/codecs/qtextcodec.cpp
+++ b/src/corelib/codecs/qtextcodec.cpp
@@ -88,7 +88,7 @@
#include <stdlib.h>
#include <ctype.h>
#include <locale.h>
-#if defined (_XOPEN_UNIX) && !defined(Q_OS_QNX) && !defined(Q_OS_OSF) && !defined(Q_OS_ANDROID)
+#if defined (_XOPEN_UNIX) && !defined(Q_OS_QNX) && !defined(Q_OS_ANDROID)
# include <langinfo.h>
#endif
@@ -180,7 +180,7 @@ static QTextCodec *setupLocaleMapper()
// This is because the builtin utf8 codec is around 5 times faster
// then the using QIconvCodec
-#if defined (_XOPEN_UNIX) && !defined(Q_OS_OSF)
+#if defined (_XOPEN_UNIX)
char *charset = nl_langinfo(CODESET);
if (charset)
locale = QTextCodec::codecForName(charset);
diff --git a/src/corelib/codecs/qtextcodec.h b/src/corelib/codecs/qtextcodec.h
index 5163d37238..8153bebac8 100644
--- a/src/corelib/codecs/qtextcodec.h
+++ b/src/corelib/codecs/qtextcodec.h
@@ -100,7 +100,7 @@ public:
struct Q_CORE_EXPORT ConverterState {
ConverterState(ConversionFlags f = DefaultConversion)
- : flags(f), remainingChars(0), invalidChars(0), d(Q_NULLPTR) { state_data[0] = state_data[1] = state_data[2] = 0; }
+ : flags(f), remainingChars(0), invalidChars(0), d(nullptr) { state_data[0] = state_data[1] = state_data[2] = 0; }
~ConverterState();
ConversionFlags flags;
int remainingChars;
@@ -111,9 +111,9 @@ public:
Q_DISABLE_COPY(ConverterState)
};
- QString toUnicode(const char *in, int length, ConverterState *state = Q_NULLPTR) const
+ QString toUnicode(const char *in, int length, ConverterState *state = nullptr) const
{ return convertToUnicode(in, length, state); }
- QByteArray fromUnicode(const QChar *in, int length, ConverterState *state = Q_NULLPTR) const
+ QByteArray fromUnicode(const QChar *in, int length, ConverterState *state = nullptr) const
{ return convertFromUnicode(in, length, state); }
QTextDecoder* makeDecoder(ConversionFlags flags = DefaultConversion) const;
diff --git a/src/corelib/codecs/qtsciicodec_p.h b/src/corelib/codecs/qtsciicodec_p.h
index 68ab01f7b5..78f9350a19 100644
--- a/src/corelib/codecs/qtsciicodec_p.h
+++ b/src/corelib/codecs/qtsciicodec_p.h
@@ -91,11 +91,11 @@ class QTsciiCodec : public QTextCodec {
public:
~QTsciiCodec();
- QByteArray name() const Q_DECL_OVERRIDE;
- int mibEnum() const Q_DECL_OVERRIDE;
+ QByteArray name() const override;
+ int mibEnum() const override;
- QString convertToUnicode(const char *, int, ConverterState *) const Q_DECL_OVERRIDE;
- QByteArray convertFromUnicode(const QChar *, int, ConverterState *) const Q_DECL_OVERRIDE;
+ QString convertToUnicode(const char *, int, ConverterState *) const override;
+ QByteArray convertFromUnicode(const QChar *, int, ConverterState *) const override;
};
#endif // QT_NO_CODECS
diff --git a/src/corelib/codecs/qutfcodec_p.h b/src/corelib/codecs/qutfcodec_p.h
index 152fe174c4..36752cc909 100644
--- a/src/corelib/codecs/qutfcodec_p.h
+++ b/src/corelib/codecs/qutfcodec_p.h
@@ -310,11 +310,11 @@ class QUtf8Codec : public QTextCodec {
public:
~QUtf8Codec();
- QByteArray name() const Q_DECL_OVERRIDE;
- int mibEnum() const Q_DECL_OVERRIDE;
+ QByteArray name() const override;
+ int mibEnum() const override;
- QString convertToUnicode(const char *, int, ConverterState *) const Q_DECL_OVERRIDE;
- QByteArray convertFromUnicode(const QChar *, int, ConverterState *) const Q_DECL_OVERRIDE;
+ QString convertToUnicode(const char *, int, ConverterState *) const override;
+ QByteArray convertFromUnicode(const QChar *, int, ConverterState *) const override;
void convertToUnicode(QString *target, const char *, int, ConverterState *) const;
};
@@ -324,12 +324,12 @@ public:
QUtf16Codec() { e = DetectEndianness; }
~QUtf16Codec();
- QByteArray name() const Q_DECL_OVERRIDE;
- QList<QByteArray> aliases() const Q_DECL_OVERRIDE;
- int mibEnum() const Q_DECL_OVERRIDE;
+ QByteArray name() const override;
+ QList<QByteArray> aliases() const override;
+ int mibEnum() const override;
- QString convertToUnicode(const char *, int, ConverterState *) const Q_DECL_OVERRIDE;
- QByteArray convertFromUnicode(const QChar *, int, ConverterState *) const Q_DECL_OVERRIDE;
+ QString convertToUnicode(const char *, int, ConverterState *) const override;
+ QByteArray convertFromUnicode(const QChar *, int, ConverterState *) const override;
protected:
DataEndianness e;
@@ -338,17 +338,17 @@ protected:
class QUtf16BECodec : public QUtf16Codec {
public:
QUtf16BECodec() : QUtf16Codec() { e = BigEndianness; }
- QByteArray name() const Q_DECL_OVERRIDE;
- QList<QByteArray> aliases() const Q_DECL_OVERRIDE;
- int mibEnum() const Q_DECL_OVERRIDE;
+ QByteArray name() const override;
+ QList<QByteArray> aliases() const override;
+ int mibEnum() const override;
};
class QUtf16LECodec : public QUtf16Codec {
public:
QUtf16LECodec() : QUtf16Codec() { e = LittleEndianness; }
- QByteArray name() const Q_DECL_OVERRIDE;
- QList<QByteArray> aliases() const Q_DECL_OVERRIDE;
- int mibEnum() const Q_DECL_OVERRIDE;
+ QByteArray name() const override;
+ QList<QByteArray> aliases() const override;
+ int mibEnum() const override;
};
class QUtf32Codec : public QTextCodec {
@@ -356,12 +356,12 @@ public:
QUtf32Codec() { e = DetectEndianness; }
~QUtf32Codec();
- QByteArray name() const Q_DECL_OVERRIDE;
- QList<QByteArray> aliases() const Q_DECL_OVERRIDE;
- int mibEnum() const Q_DECL_OVERRIDE;
+ QByteArray name() const override;
+ QList<QByteArray> aliases() const override;
+ int mibEnum() const override;
- QString convertToUnicode(const char *, int, ConverterState *) const Q_DECL_OVERRIDE;
- QByteArray convertFromUnicode(const QChar *, int, ConverterState *) const Q_DECL_OVERRIDE;
+ QString convertToUnicode(const char *, int, ConverterState *) const override;
+ QByteArray convertFromUnicode(const QChar *, int, ConverterState *) const override;
protected:
DataEndianness e;
@@ -370,17 +370,17 @@ protected:
class QUtf32BECodec : public QUtf32Codec {
public:
QUtf32BECodec() : QUtf32Codec() { e = BigEndianness; }
- QByteArray name() const Q_DECL_OVERRIDE;
- QList<QByteArray> aliases() const Q_DECL_OVERRIDE;
- int mibEnum() const Q_DECL_OVERRIDE;
+ QByteArray name() const override;
+ QList<QByteArray> aliases() const override;
+ int mibEnum() const override;
};
class QUtf32LECodec : public QUtf32Codec {
public:
QUtf32LECodec() : QUtf32Codec() { e = LittleEndianness; }
- QByteArray name() const Q_DECL_OVERRIDE;
- QList<QByteArray> aliases() const Q_DECL_OVERRIDE;
- int mibEnum() const Q_DECL_OVERRIDE;
+ QByteArray name() const override;
+ QList<QByteArray> aliases() const override;
+ int mibEnum() const override;
};
diff --git a/src/corelib/corelib.pro b/src/corelib/corelib.pro
index 6dc11e1a4d..a0d41396dd 100644
--- a/src/corelib/corelib.pro
+++ b/src/corelib/corelib.pro
@@ -10,18 +10,15 @@ CONFIG += $$MODULE_CONFIG
DEFINES += $$MODULE_DEFINES
DEFINES += QT_NO_USING_NAMESPACE QT_NO_FOREACH
win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x67000000
-irix-cc*:QMAKE_CXXFLAGS += -no_prelink -ptused
-CONFIG += optimize_full
+CONFIG += simd optimize_full
QMAKE_DOCS = $$PWD/doc/qtcore.qdocconf
-ANDROID_JAR_DEPENDENCIES = \
- jar/QtAndroid.jar
ANDROID_LIB_DEPENDENCIES = \
plugins/platforms/android/libqtforandroid.so
ANDROID_BUNDLED_JAR_DEPENDENCIES = \
- jar/QtAndroid-bundled.jar
+ jar/QtAndroid.jar
ANDROID_PERMISSIONS = \
android.permission.INTERNET \
android.permission.WRITE_EXTERNAL_STORAGE
diff --git a/src/corelib/global/global.pri b/src/corelib/global/global.pri
index e1ca8828f9..f4f4a75536 100644
--- a/src/corelib/global/global.pri
+++ b/src/corelib/global/global.pri
@@ -39,6 +39,8 @@ SOURCES += \
global/qrandom.cpp \
global/qhooks.cpp
+F16C_SOURCES += global/qfloat16_f16c.c
+
VERSIONTAGGING_SOURCES = global/qversiontagging.cpp
darwin: SOURCES += global/qoperatingsystemversion_darwin.mm
diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h
index 231ac2c9b0..50cf0889c7 100644
--- a/src/corelib/global/qcompilerdetection.h
+++ b/src/corelib/global/qcompilerdetection.h
@@ -651,6 +651,12 @@
# undef Q_COMPILER_CONSTEXPR
# endif
# endif
+# elif defined(__STDC_VERSION__) && __STDC_VERSION__ > 199901L s
+// C11 features supported. Only tested with ICC 17 and up.
+# define Q_COMPILER_STATIC_ASSERT
+# if __has_include(<threads.h>)
+# define Q_COMPILER_THREAD_LOCAL
+# endif
# endif
#endif
@@ -803,6 +809,17 @@
# endif
# endif
+# if defined(__STDC_VERSION__)
+# if __has_feature(c_static_assert)
+# define Q_COMPILER_STATIC_ASSERT
+# endif
+# if __has_feature(c_thread_local) && __has_include(<threads.h>)
+# if !defined(__FreeBSD__) /* FreeBSD clang fails on __cxa_thread_atexit */
+# define Q_COMPILER_THREAD_LOCAL
+# endif
+# endif
+# endif
+
# if defined(__has_warning)
# if __has_warning("-Wunused-private-field")
# define Q_DECL_UNUSED_MEMBER Q_DECL_UNUSED
@@ -898,6 +915,18 @@
# define Q_COMPILER_RETURN_TYPE_DEDUCTION
# endif
# endif
+# if defined(__STDC_VERSION__) && __STDC_VERSION__ > 199901L
+# if Q_CC_GNU >= 407
+ /* C11 features supported in GCC 4.7: */
+# define Q_COMPILER_STATIC_ASSERT
+# endif
+# if Q_CC_GNU >= 409
+ /* C11 features supported in GCC 4.9: */
+# if __has_include(<threads.h>)
+# define Q_COMPILER_THREAD_LOCAL
+# endif
+# endif
+# endif
#endif
#if defined(Q_CC_MSVC)
diff --git a/src/corelib/global/qflags.h b/src/corelib/global/qflags.h
index 72b0a689ff..c22c22d10a 100644
--- a/src/corelib/global/qflags.h
+++ b/src/corelib/global/qflags.h
@@ -118,7 +118,7 @@ public:
Q_DECL_CONSTEXPR inline QFlags &operator=(const QFlags &other);
#endif
Q_DECL_CONSTEXPR inline QFlags(Enum f) Q_DECL_NOTHROW : i(Int(f)) {}
- Q_DECL_CONSTEXPR inline QFlags(Zero = Q_NULLPTR) Q_DECL_NOTHROW : i(0) {}
+ Q_DECL_CONSTEXPR inline QFlags(Zero = nullptr) Q_DECL_NOTHROW : i(0) {}
Q_DECL_CONSTEXPR inline QFlags(QFlag f) Q_DECL_NOTHROW : i(f) {}
#ifdef Q_COMPILER_INITIALIZER_LISTS
diff --git a/src/corelib/global/qfloat16.cpp b/src/corelib/global/qfloat16.cpp
index 89edfc8787..4c9b831469 100644
--- a/src/corelib/global/qfloat16.cpp
+++ b/src/corelib/global/qfloat16.cpp
@@ -38,6 +38,7 @@
****************************************************************************/
#include "qfloat16_p.h"
+#include "private/qsimd_p.h"
QT_BEGIN_NAMESPACE
@@ -113,4 +114,88 @@ Q_REQUIRED_RESULT bool qIsFinite(qfloat16 f) Q_DECL_NOTHROW { return qt_is_finit
exactness is stronger the smaller the numbers are.
*/
+#if QT_COMPILER_SUPPORTS(F16C)
+static inline bool hasFastF16()
+{
+ // All processors with F16C also support AVX, but YMM registers
+ // might not be supported by the OS, or they might be disabled.
+ return qCpuHasFeature(F16C) && qCpuHasFeature(AVX);
+}
+
+extern "C" {
+extern void qFloatToFloat16_fast(quint16 *out, const float *in, qssize_t len) Q_DECL_NOTHROW;
+extern void qFloatFromFloat16_fast(float *out, const quint16 *in, qssize_t len) Q_DECL_NOTHROW;
+}
+
+#elif defined(__ARM_FP16_FORMAT_IEEE) && defined(__ARM_NEON__)
+static inline bool hasFastF16()
+{
+ return true;
+}
+
+static void qFloatToFloat16_fast(quint16 *out, const float *in, qssize_t len) Q_DECL_NOTHROW
+{
+ __fp16 *out_f16 = reinterpret_cast<__fp16 *>(out);
+ qssize_t i = 0;
+ for (; i < len - 3; i += 4)
+ vst1_f16(out_f16 + i, vcvt_f16_f32(vld1q_f32(in + i)));
+ SIMD_EPILOGUE(i, len, 3)
+ out_f16[i] = __fp16(in[i]);
+}
+
+static void qFloatFromFloat16_fast(float *out, const quint16 *in, qssize_t len) Q_DECL_NOTHROW
+{
+ const __fp16 *in_f16 = reinterpret_cast<const __fp16 *>(in);
+ qssize_t i = 0;
+ for (; i < len - 3; i += 4)
+ vst1q_f32(out + i, vcvt_f32_f16(vld1_f16(in_f16 + i)));
+ SIMD_EPILOGUE(i, len, 3)
+ out[i] = float(in_f16[i]);
+}
+#else
+static inline bool hasFastF16()
+{
+ return false;
+}
+
+static void qFloatToFloat16_fast(quint16 *, const float *, qssize_t) Q_DECL_NOTHROW
+{
+ Q_UNREACHABLE();
+}
+
+static void qFloatFromFloat16_fast(float *, const quint16 *, qssize_t) Q_DECL_NOTHROW
+{
+ Q_UNREACHABLE();
+}
+#endif
+/*!
+ \since 5.11
+
+ 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, qssize_t len) Q_DECL_NOTHROW
+{
+ if (hasFastF16())
+ return qFloatToFloat16_fast(reinterpret_cast<quint16 *>(out), in, len);
+
+ for (qssize_t i = 0; i < len; ++i)
+ out[i] = qfloat16(in[i]);
+}
+
+/*!
+ \since 5.11
+
+ 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, qssize_t len) Q_DECL_NOTHROW
+{
+ if (hasFastF16())
+ return qFloatFromFloat16_fast(out, reinterpret_cast<const quint16 *>(in), len);
+
+ for (qssize_t i = 0; i < len; ++i)
+ out[i] = float(in[i]);
+}
+
QT_END_NAMESPACE
diff --git a/src/corelib/global/qfloat16.h b/src/corelib/global/qfloat16.h
index 72e28edf63..bf223bee0c 100644
--- a/src/corelib/global/qfloat16.h
+++ b/src/corelib/global/qfloat16.h
@@ -88,6 +88,9 @@ private:
Q_DECLARE_TYPEINFO(qfloat16, Q_PRIMITIVE_TYPE);
+Q_CORE_EXPORT void qFloatToFloat16(qfloat16 *, const float *, qssize_t length) Q_DECL_NOTHROW;
+Q_CORE_EXPORT void qFloatFromFloat16(float *, const qfloat16 *, qssize_t length) Q_DECL_NOTHROW;
+
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
diff --git a/src/corelib/global/qfloat16_f16c.c b/src/corelib/global/qfloat16_f16c.c
new file mode 100644
index 0000000000..ffd35f8ebc
--- /dev/null
+++ b/src/corelib/global/qfloat16_f16c.c
@@ -0,0 +1,87 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qsimd_p.h"
+
+// The x86 F16C instructions operate on AVX registers, so AVX support is
+// required. We don't need to check for __F16C__ because we this file wouldn't
+// have been compiled if the support was missing in the first place, and not
+// all compilers define it. Technically, we didn't need to check for __AVX__
+// either.
+#if !defined(__AVX__)
+# error "AVX support required"
+#endif
+
+#ifdef __cplusplus
+QT_BEGIN_NAMESPACE
+extern "C" {
+#endif
+
+void qFloatToFloat16_fast(quint16 *out, const float *in, qssize_t len) Q_DECL_NOTHROW
+{
+ qssize_t i = 0;
+ for (; i < len - 7; i += 8)
+ _mm_storeu_si128((__m128i *)(out + i), _mm256_cvtps_ph(_mm256_loadu_ps(in + i), 0));
+ if (i < len - 3) {
+ _mm_storel_epi64((__m128i *)(out + i), _mm_cvtps_ph(_mm_loadu_ps(in + i), 0));
+ i += 4;
+ }
+ // Inlining "qfloat16::qfloat16(float f)":
+ SIMD_EPILOGUE(i, len, 3)
+ out[i] = _mm_extract_epi16(_mm_cvtps_ph(_mm_set_ss(in[i]), 0), 0);
+}
+
+void qFloatFromFloat16_fast(float *out, const quint16 *in, qssize_t len) Q_DECL_NOTHROW
+{
+ qssize_t i = 0;
+ for (; i < len - 7; i += 8)
+ _mm256_storeu_ps(out + i, _mm256_cvtph_ps(_mm_loadu_si128((const __m128i *)(in + i))));
+ if (i < len - 3) {
+ _mm_storeu_ps(out + i, _mm_cvtph_ps(_mm_loadl_epi64((const __m128i *)(in + i))));
+ i += 4;
+ }
+ // Inlining "qfloat16::operator float()":
+ SIMD_EPILOGUE(i, len, 3)
+ out[i] = _mm_cvtss_f32(_mm_cvtph_ps(_mm_cvtsi32_si128(in[i])));
+}
+
+#ifdef __cplusplus
+} // extern "C"
+QT_END_NAMESPACE
+#endif
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index 36b7560398..7200f55777 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
-** Copyright (C) 2016 Intel Corporation.
+** Copyright (C) 2017 Intel Corporation.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
@@ -73,6 +73,10 @@
#include <Ws2tcpip.h>
#endif // Q_OS_WINRT
+#ifdef Q_OS_WIN
+# include <qt_windows.h>
+#endif
+
#if defined(Q_OS_VXWORKS) && defined(_WRS_KERNEL)
# include <envLib.h>
#endif
@@ -1428,13 +1432,6 @@ bool qSharedBuild() Q_DECL_NOTHROW
*/
/*!
- \macro Q_OS_ULTRIX
- \relates <QtGlobal>
-
- Defined on DEC Ultrix.
-*/
-
-/*!
\macro Q_OS_LINUX
\relates <QtGlobal>
@@ -1470,41 +1467,6 @@ bool qSharedBuild() Q_DECL_NOTHROW
*/
/*!
- \macro Q_OS_BSDI
- \relates <QtGlobal>
-
- Defined on BSD/OS.
-*/
-
-/*!
- \macro Q_OS_IRIX
- \relates <QtGlobal>
-
- Defined on SGI Irix.
-*/
-
-/*!
- \macro Q_OS_OSF
- \relates <QtGlobal>
-
- Defined on HP Tru64 UNIX.
-*/
-
-/*!
- \macro Q_OS_SCO
- \relates <QtGlobal>
-
- Defined on SCO OpenServer 5.
-*/
-
-/*!
- \macro Q_OS_UNIXWARE
- \relates <QtGlobal>
-
- Defined on UnixWare 7, Open UNIX 8.
-*/
-
-/*!
\macro Q_OS_AIX
\relates <QtGlobal>
@@ -1519,27 +1481,6 @@ bool qSharedBuild() Q_DECL_NOTHROW
*/
/*!
- \macro Q_OS_DGUX
- \relates <QtGlobal>
-
- Defined on DG/UX.
-*/
-
-/*!
- \macro Q_OS_RELIANT
- \relates <QtGlobal>
-
- Defined on Reliant UNIX.
-*/
-
-/*!
- \macro Q_OS_DYNIX
- \relates <QtGlobal>
-
- Defined on DYNIX/ptx.
-*/
-
-/*!
\macro Q_OS_QNX
\relates <QtGlobal>
@@ -2881,10 +2822,11 @@ QString QSysInfo::prettyProductName()
This function returns the same as QHostInfo::localHostName().
- \sa QHostInfo::localDomainName
+ \sa QHostInfo::localDomainName, machineUniqueId()
*/
QString QSysInfo::machineHostName()
{
+ // the hostname can change, so we can't cache it
#if defined(Q_OS_LINUX)
// gethostname(3) on Linux just calls uname(2), so do it ourselves
// and avoid a memcpy
@@ -2907,6 +2849,119 @@ QString QSysInfo::machineHostName()
}
#endif // QT_BOOTSTRAPPED
+enum {
+ UuidStringLen = sizeof("00000000-0000-0000-0000-000000000000") - 1
+};
+
+/*!
+ \since 5.10
+
+ Returns a unique ID for this machine, if one can be determined. If no
+ unique ID could be determined, this function returns an empty byte array.
+ Unlike machineHostName(), the value returned by this function is likely
+ globally unique.
+
+ A unique ID is useful in network operations to identify this machine for an
+ extended period of time, when the IP address could change or if this
+ machine could have more than one IP address. For example, the ID could be
+ used when communicating with a server or when storing device-specific data
+ in shared network storage.
+
+ Note that on some systems, this value will persist across reboots and on
+ some it will not. Applications should not blindly depend on this fact
+ without verifying the OS capabilities. In particular, on Linux systems,
+ this ID is usually permanent and it matches the D-Bus machine ID, except
+ for nodes without their own storage (replicated nodes).
+
+ \sa machineHostName(), bootUniqueId()
+*/
+QByteArray QSysInfo::machineUniqueId()
+{
+#ifdef Q_OS_BSD4
+ char uuid[UuidStringLen];
+ size_t uuidlen = sizeof(uuid);
+# ifdef KERN_HOSTUUID
+ int name[] = { CTL_KERN, KERN_HOSTUUID };
+ if (sysctl(name, sizeof name / sizeof name[0], &uuid, &uuidlen, nullptr, 0) == 0
+ && uuidlen == sizeof(uuid))
+ return QByteArray(uuid, uuidlen);
+
+# else
+ // Darwin: no fixed value, we need to search by name
+ if (sysctlbyname("kern.uuid", uuid, &uuidlen, nullptr, 0) == 0 && uuidlen == sizeof(uuid))
+ return QByteArray(uuid, uuidlen);
+# endif
+#elif defined(Q_OS_UNIX)
+ // The modern name on Linux is /etc/machine-id, but that path is
+ // unlikely to exist on non-Linux (non-systemd) systems. The old
+ // path is more than enough.
+ static const char fullfilename[] = "/usr/local/var/lib/dbus/machine-id";
+ const char *firstfilename = fullfilename + sizeof("/usr/local") - 1;
+ int fd = qt_safe_open(firstfilename, O_RDONLY);
+ if (fd == -1 && errno == ENOENT)
+ fd = qt_safe_open(fullfilename, O_RDONLY);
+
+ if (fd != -1) {
+ char buffer[32]; // 128 bits, hex-encoded
+ qint64 len = qt_safe_read(fd, buffer, sizeof(buffer));
+ qt_safe_close(fd);
+
+ if (len != -1)
+ return QByteArray(buffer, len);
+ }
+#elif defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+ // Let's poke at the registry
+ HKEY key = NULL;
+ if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\Cryptography", 0, KEY_READ, &key)
+ == ERROR_SUCCESS) {
+ wchar_t buffer[UuidStringLen + 1];
+ DWORD size = sizeof(buffer);
+ bool ok = (RegQueryValueEx(key, L"MachineGuid", NULL, NULL, (LPBYTE)buffer, &size) ==
+ ERROR_SUCCESS);
+ RegCloseKey(key);
+ if (ok)
+ return QStringView(buffer, (size - 1) / 2).toLatin1();
+ }
+#endif
+ return QByteArray();
+}
+
+/*!
+ \since 5.10
+
+ Returns a unique ID for this machine's boot, if one can be determined. If
+ no unique ID could be determined, this function returns an empty byte
+ array. This value is expected to change after every boot and can be
+ considered globally unique.
+
+ This function is currently only implemented for Linux and Apple operating
+ systems.
+
+ \sa machineUniqueId()
+*/
+QByteArray QSysInfo::bootUniqueId()
+{
+#ifdef Q_OS_LINUX
+ // use low-level API here for simplicity
+ int fd = qt_safe_open("/proc/sys/kernel/random/boot_id", O_RDONLY);
+ if (fd != -1) {
+ char uuid[UuidStringLen];
+ qint64 len = qt_safe_read(fd, uuid, sizeof(uuid));
+ qt_safe_close(fd);
+ if (len == UuidStringLen)
+ return QByteArray(uuid, UuidStringLen);
+ }
+#elif defined(Q_OS_DARWIN)
+ // "kern.bootsessionuuid" is only available by name
+ char uuid[UuidStringLen];
+ size_t uuidlen = sizeof(uuid);
+ if (sysctlbyname("kern.bootsessionuuid", uuid, &uuidlen, nullptr, 0) == 0
+ && uuidlen == sizeof(uuid))
+ return QByteArray(uuid, uuidlen);
+#endif
+ return QByteArray();
+};
+
/*!
\macro void Q_ASSERT(bool test)
\relates <QtGlobal>
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index 7b691ca59e..203c9a9da4 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -47,6 +47,7 @@
# include <utility>
#endif
#ifndef __ASSEMBLER__
+# include <assert.h>
# include <stddef.h>
#endif
@@ -105,6 +106,32 @@
# define Q_OF_MACH_O
#endif
+/*
+ Avoid "unused parameter" warnings
+*/
+#define Q_UNUSED(x) (void)x;
+
+#if defined(__cplusplus) && defined(Q_COMPILER_STATIC_ASSERT)
+# define Q_STATIC_ASSERT(Condition) static_assert(bool(Condition), #Condition)
+# define Q_STATIC_ASSERT_X(Condition, Message) static_assert(bool(Condition), Message)
+#elif defined(Q_COMPILER_STATIC_ASSERT)
+// C11 mode - using the _S version in case <assert.h> doesn't do the right thing
+# define Q_STATIC_ASSERT(Condition) _Static_assert(!!(Condition), #Condition)
+# define Q_STATIC_ASSERT_X(Condition, Message) _Static_assert(!!(Condition), Message)
+#else
+// C89 & C99 version
+# define Q_STATIC_ASSERT_PRIVATE_JOIN(A, B) Q_STATIC_ASSERT_PRIVATE_JOIN_IMPL(A, B)
+# define Q_STATIC_ASSERT_PRIVATE_JOIN_IMPL(A, B) A ## B
+# ifdef __COUNTER__
+# define Q_STATIC_ASSERT(Condition) \
+ typedef char Q_STATIC_ASSERT_PRIVATE_JOIN(q_static_assert_result, __COUNTER__) [(Condition) ? 1 : -1];
+# else
+# define Q_STATIC_ASSERT(Condition) \
+ typedef char Q_STATIC_ASSERT_PRIVATE_JOIN(q_static_assert_result, __LINE__) [(Condition) ? 1 : -1];
+# endif /* __COUNTER__ */
+# define Q_STATIC_ASSERT_X(Condition, Message) Q_STATIC_ASSERT(Condition)
+#endif
+
#ifdef __cplusplus
#include <algorithm>
@@ -219,6 +246,15 @@ typedef unsigned long long quint64; /* 64 bit unsigned */
typedef qint64 qlonglong;
typedef quint64 qulonglong;
+#ifndef __cplusplus
+// In C++ mode, we define below using QIntegerForSize template
+Q_STATIC_ASSERT_X(sizeof(ptrdiff_t) == sizeof(size_t), "Weird ptrdiff_t and size_t definitions");
+typedef ptrdiff_t qptrdiff;
+typedef ptrdiff_t qssize_t;
+typedef ptrdiff_t qintptr;
+typedef size_t quintptr;
+#endif
+
/*
Useful type definitions for Qt
*/
@@ -688,11 +724,6 @@ Q_CORE_EXPORT Q_DECL_CONST_FUNCTION bool qSharedBuild() Q_DECL_NOTHROW;
#endif
/*
- Avoid "unused parameter" warnings
-*/
-#define Q_UNUSED(x) (void)x;
-
-/*
Debugging and error handling
*/
@@ -750,27 +781,6 @@ Q_CORE_EXPORT void qt_assert_x(const char *where, const char *what, const char *
# endif
#endif
-
-#ifdef Q_COMPILER_STATIC_ASSERT
-#define Q_STATIC_ASSERT(Condition) static_assert(bool(Condition), #Condition)
-#define Q_STATIC_ASSERT_X(Condition, Message) static_assert(bool(Condition), Message)
-#else
-// Intentionally undefined
-template <bool Test> class QStaticAssertFailure;
-template <> class QStaticAssertFailure<true> {};
-
-#define Q_STATIC_ASSERT_PRIVATE_JOIN(A, B) Q_STATIC_ASSERT_PRIVATE_JOIN_IMPL(A, B)
-#define Q_STATIC_ASSERT_PRIVATE_JOIN_IMPL(A, B) A ## B
-#ifdef __COUNTER__
-#define Q_STATIC_ASSERT(Condition) \
- enum {Q_STATIC_ASSERT_PRIVATE_JOIN(q_static_assert_result, __COUNTER__) = sizeof(QStaticAssertFailure<!!(Condition)>)}
-#else
-#define Q_STATIC_ASSERT(Condition) \
- enum {Q_STATIC_ASSERT_PRIVATE_JOIN(q_static_assert_result, __LINE__) = sizeof(QStaticAssertFailure<!!(Condition)>)}
-#endif /* __COUNTER__ */
-#define Q_STATIC_ASSERT_X(Condition, Message) Q_STATIC_ASSERT(Condition)
-#endif
-
Q_NORETURN Q_CORE_EXPORT void qt_check_pointer(const char *, int) Q_DECL_NOTHROW;
Q_CORE_EXPORT void qBadAlloc();
@@ -1138,7 +1148,7 @@ 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=Q_NULLPTR) Q_DECL_NOEXCEPT;
+Q_CORE_EXPORT int qEnvironmentVariableIntValue(const char *varName, bool *ok=nullptr) Q_DECL_NOEXCEPT;
inline int qIntCast(double f) { return int(f); }
inline int qIntCast(float f) { return int(f); }
diff --git a/src/corelib/global/qlogging.h b/src/corelib/global/qlogging.h
index ec21198784..0c8d7dab38 100644
--- a/src/corelib/global/qlogging.h
+++ b/src/corelib/global/qlogging.h
@@ -64,7 +64,7 @@ class QMessageLogContext
Q_DISABLE_COPY(QMessageLogContext)
public:
Q_DECL_CONSTEXPR QMessageLogContext()
- : version(2), line(0), file(Q_NULLPTR), function(Q_NULLPTR), category(Q_NULLPTR) {}
+ : version(2), line(0), file(nullptr), function(nullptr), category(nullptr) {}
Q_DECL_CONSTEXPR QMessageLogContext(const char *fileName, int lineNumber, const char *functionName, const char *categoryName)
: version(2), line(lineNumber), file(fileName), function(functionName), category(categoryName) {}
@@ -150,9 +150,9 @@ private:
#define QT_MESSAGELOG_LINE __LINE__
#define QT_MESSAGELOG_FUNC Q_FUNC_INFO
#else
- #define QT_MESSAGELOG_FILE Q_NULLPTR
+ #define QT_MESSAGELOG_FILE nullptr
#define QT_MESSAGELOG_LINE 0
- #define QT_MESSAGELOG_FUNC Q_NULLPTR
+ #define QT_MESSAGELOG_FUNC nullptr
#endif
#define qDebug QMessageLogger(QT_MESSAGELOG_FILE, QT_MESSAGELOG_LINE, QT_MESSAGELOG_FUNC).debug
diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h
index ab83730caa..38f194afb5 100644
--- a/src/corelib/global/qnamespace.h
+++ b/src/corelib/global/qnamespace.h
@@ -243,7 +243,7 @@ public:
// size of a multi-variant string.
TextLongestVariant = 0x80000
-#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
+#if QT_DEPRECATED_SINCE(5, 11) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
, TextBypassShaping = 0x100000
#endif
};
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc
index e64fb221d3..c53db50e71 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -3077,9 +3077,8 @@
it is displayed regardless of device type.
The keypad is used to implement a virtual cursor, unless
the device has an analog mouse type of input device (e.g. touchpad)
-
- \note In 4.6, cursor navigation is only implemented for Symbian OS.
- On other platforms, it behaves as NavigationModeNone.
+ \note Cursor navigation is not currently implemented on any platform
+ and behaves as NavigationModeNone.
\sa QApplication::setNavigationMode()
\sa QApplication::navigationMode()
*/
diff --git a/src/corelib/global/qsysinfo.h b/src/corelib/global/qsysinfo.h
index 6b73a17dc5..a3fa0fcb27 100644
--- a/src/corelib/global/qsysinfo.h
+++ b/src/corelib/global/qsysinfo.h
@@ -240,6 +240,8 @@ QT_WARNING_POP
static QString prettyProductName();
static QString machineHostName();
+ static QByteArray machineUniqueId();
+ static QByteArray bootUniqueId();
};
#undef QT_SYSINFO_DEPRECATED_X
diff --git a/src/corelib/global/qsystemdetection.h b/src/corelib/global/qsystemdetection.h
index 4a2c3f79bb..ff0e03108b 100644
--- a/src/corelib/global/qsystemdetection.h
+++ b/src/corelib/global/qsystemdetection.h
@@ -52,30 +52,18 @@
IOS - iOS
WATCHOS - watchOS
TVOS - tvOS
- MSDOS - MS-DOS and Windows
- OS2 - OS/2
- OS2EMX - XFree86 on OS/2 (not PM)
WIN32 - Win32 (Windows 2000/XP/Vista/7 and Windows Server 2003/2008)
- WINRT - WinRT (Windows 8 Runtime)
+ WINRT - WinRT (Windows Runtime)
CYGWIN - Cygwin
SOLARIS - Sun Solaris
HPUX - HP-UX
- ULTRIX - DEC Ultrix
LINUX - Linux [has variants]
FREEBSD - FreeBSD [has variants]
NETBSD - NetBSD
OPENBSD - OpenBSD
- BSDI - BSD/OS
INTERIX - Interix
- IRIX - SGI Irix
- OSF - HP Tru64 UNIX
- SCO - SCO OpenServer 5
- UNIXWARE - UnixWare 7, Open UNIX 8
AIX - AIX
HURD - GNU Hurd
- DGUX - DG/UX
- RELIANT - Reliant UNIX
- DYNIX - DYNIX/ptx
QNX - QNX [has variants]
QNX6 - QNX RTP 6.1
LYNX - LynxOS
@@ -147,10 +135,6 @@
# define Q_OS_SOLARIS
#elif defined(hpux) || defined(__hpux)
# define Q_OS_HPUX
-#elif defined(__ultrix) || defined(ultrix)
-# define Q_OS_ULTRIX
-#elif defined(sinix)
-# define Q_OS_RELIANT
#elif defined(__native_client__)
# define Q_OS_NACL
#elif defined(__linux__) || defined(__linux)
@@ -167,34 +151,17 @@
#elif defined(__OpenBSD__)
# define Q_OS_OPENBSD
# define Q_OS_BSD4
-#elif defined(__bsdi__)
-# define Q_OS_BSDI
-# define Q_OS_BSD4
#elif defined(__INTERIX)
# define Q_OS_INTERIX
# define Q_OS_BSD4
-#elif defined(__sgi)
-# define Q_OS_IRIX
-#elif defined(__osf__)
-# define Q_OS_OSF
#elif defined(_AIX)
# define Q_OS_AIX
#elif defined(__Lynx__)
# define Q_OS_LYNX
#elif defined(__GNU__)
# define Q_OS_HURD
-#elif defined(__DGUX__)
-# define Q_OS_DGUX
#elif defined(__QNXNTO__)
# define Q_OS_QNX
-#elif defined(_SEQUENT_)
-# define Q_OS_DYNIX
-#elif defined(_SCO_DS) /* SCO OpenServer 5 + GCC */
-# define Q_OS_SCO
-#elif defined(__USLC__) /* all SCO platforms + UDK or OUDK */
-# define Q_OS_UNIXWARE
-#elif defined(__svr4__) && defined(i386) /* Open UNIX 8 + GCC */
-# define Q_OS_UNIXWARE
#elif defined(__INTEGRITY)
# define Q_OS_INTEGRITY
#elif defined(VXWORKS) /* there is no "real" VxWorks define - this has to be set in the mkspec! */
diff --git a/src/corelib/global/qversiontagging.cpp b/src/corelib/global/qversiontagging.cpp
index e3d4037a16..cbfd93f135 100644
--- a/src/corelib/global/qversiontagging.cpp
+++ b/src/corelib/global/qversiontagging.cpp
@@ -84,6 +84,16 @@ make_versioned_symbol(SYM, QT_VERSION_MAJOR, 8, "@");
make_versioned_symbol(SYM, QT_VERSION_MAJOR, 9, "@");
#endif
#if QT_VERSION_MINOR > 10
+make_versioned_symbol(SYM, QT_VERSION_MAJOR, 10, "@");
+#endif
+#if QT_VERSION_MINOR > 11
+make_versioned_symbol(SYM, QT_VERSION_MAJOR, 11, "@");
+#endif
+#if QT_VERSION_MINOR > 12
+make_versioned_symbol(SYM, QT_VERSION_MAJOR, 12, "@");
+#endif
+#if QT_VERSION_MINOR > 13
+// We don't expect there will be a Qt 5.13
# error "Please update this file with more Qt versions."
#endif
diff --git a/src/corelib/io/qbuffer.cpp b/src/corelib/io/qbuffer.cpp
index 86dd737809..e0b9c41323 100644
--- a/src/corelib/io/qbuffer.cpp
+++ b/src/corelib/io/qbuffer.cpp
@@ -60,8 +60,8 @@ public:
QByteArray *buf;
QByteArray defaultBuf;
- virtual qint64 peek(char *data, qint64 maxSize) Q_DECL_OVERRIDE;
- virtual QByteArray peek(qint64 maxSize) Q_DECL_OVERRIDE;
+ virtual qint64 peek(char *data, qint64 maxSize) override;
+ virtual QByteArray peek(qint64 maxSize) override;
#ifndef QT_NO_QOBJECT
// private slots
diff --git a/src/corelib/io/qbuffer.h b/src/corelib/io/qbuffer.h
index fd05dff311..39e1e7b39d 100644
--- a/src/corelib/io/qbuffer.h
+++ b/src/corelib/io/qbuffer.h
@@ -57,8 +57,8 @@ class Q_CORE_EXPORT QBuffer : public QIODevice
public:
#ifndef QT_NO_QOBJECT
- explicit QBuffer(QObject *parent = Q_NULLPTR);
- QBuffer(QByteArray *buf, QObject *parent = Q_NULLPTR);
+ explicit QBuffer(QObject *parent = nullptr);
+ QBuffer(QByteArray *buf, QObject *parent = nullptr);
#else
QBuffer();
explicit QBuffer(QByteArray *buf);
@@ -73,22 +73,22 @@ public:
inline void setData(const char *data, int len);
const QByteArray &data() const;
- bool open(OpenMode openMode) Q_DECL_OVERRIDE;
+ bool open(OpenMode openMode) override;
- void close() Q_DECL_OVERRIDE;
- qint64 size() const Q_DECL_OVERRIDE;
- qint64 pos() const Q_DECL_OVERRIDE;
- bool seek(qint64 off) Q_DECL_OVERRIDE;
- bool atEnd() const Q_DECL_OVERRIDE;
- bool canReadLine() const Q_DECL_OVERRIDE;
+ void close() override;
+ qint64 size() const override;
+ qint64 pos() const override;
+ bool seek(qint64 off) override;
+ bool atEnd() const override;
+ bool canReadLine() const override;
protected:
#ifndef QT_NO_QOBJECT
- void connectNotify(const QMetaMethod &) Q_DECL_OVERRIDE;
- void disconnectNotify(const QMetaMethod &) Q_DECL_OVERRIDE;
+ void connectNotify(const QMetaMethod &) override;
+ void disconnectNotify(const QMetaMethod &) override;
#endif
- qint64 readData(char *data, qint64 maxlen) Q_DECL_OVERRIDE;
- qint64 writeData(const char *data, qint64 len) Q_DECL_OVERRIDE;
+ qint64 readData(char *data, qint64 maxlen) override;
+ qint64 writeData(const char *data, qint64 len) override;
private:
Q_DECLARE_PRIVATE(QBuffer)
diff --git a/src/corelib/io/qdatastream.cpp b/src/corelib/io/qdatastream.cpp
index 1486d3630c..5fa5b558ea 100644
--- a/src/corelib/io/qdatastream.cpp
+++ b/src/corelib/io/qdatastream.cpp
@@ -563,6 +563,7 @@ void QDataStream::setByteOrder(ByteOrder bo)
\value Qt_5_8 Same as Qt_5_6
\value Qt_5_9 Same as Qt_5_6
\value Qt_5_10 Same as Qt_5_6
+ \value Qt_5_11 Same as Qt_5_6
\omitvalue Qt_DefaultCompiledVersion
\sa setVersion(), version()
diff --git a/src/corelib/io/qdatastream.h b/src/corelib/io/qdatastream.h
index 0a429d091a..1f1b13686c 100644
--- a/src/corelib/io/qdatastream.h
+++ b/src/corelib/io/qdatastream.h
@@ -97,10 +97,11 @@ public:
Qt_5_8 = Qt_5_7,
Qt_5_9 = Qt_5_8,
Qt_5_10 = Qt_5_9,
-#if QT_VERSION >= 0x050b00
+ Qt_5_11 = Qt_5_10,
+#if QT_VERSION >= 0x050c00
#error Add the datastream version for this Qt version and update Qt_DefaultCompiledVersion
#endif
- Qt_DefaultCompiledVersion = Qt_5_10
+ Qt_DefaultCompiledVersion = Qt_5_11
};
enum ByteOrder {
diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp
index 6d144cb65d..520f98b18f 100644
--- a/src/corelib/io/qdir.cpp
+++ b/src/corelib/io/qdir.cpp
@@ -2087,6 +2087,7 @@ bool QDir::match(const QString &filter, const QString &fileName)
#endif // QT_NO_REGEXP
/*!
+ \internal
Returns \a path with redundant directory separators removed,
and "."s and ".."s resolved (as far as possible).
diff --git a/src/corelib/io/qfile.h b/src/corelib/io/qfile.h
index c5819e8076..e6f3d942fe 100644
--- a/src/corelib/io/qfile.h
+++ b/src/corelib/io/qfile.h
@@ -70,7 +70,7 @@ public:
#endif
~QFile();
- QString fileName() const Q_DECL_OVERRIDE;
+ QString fileName() const override;
void setFileName(const QString &name);
#if defined(Q_OS_DARWIN)
@@ -124,25 +124,25 @@ public:
bool copy(const QString &newName);
static bool copy(const QString &fileName, const QString &newName);
- bool open(OpenMode flags) Q_DECL_OVERRIDE;
+ bool open(OpenMode flags) override;
bool open(FILE *f, OpenMode ioFlags, FileHandleFlags handleFlags=DontCloseHandle);
bool open(int fd, OpenMode ioFlags, FileHandleFlags handleFlags=DontCloseHandle);
- qint64 size() const Q_DECL_OVERRIDE;
+ qint64 size() const override;
- bool resize(qint64 sz) Q_DECL_OVERRIDE;
+ bool resize(qint64 sz) override;
static bool resize(const QString &filename, qint64 sz);
- Permissions permissions() const Q_DECL_OVERRIDE;
+ Permissions permissions() const override;
static Permissions permissions(const QString &filename);
- bool setPermissions(Permissions permissionSpec) Q_DECL_OVERRIDE;
+ bool setPermissions(Permissions permissionSpec) override;
static bool setPermissions(const QString &filename, Permissions permissionSpec);
protected:
#ifdef QT_NO_QOBJECT
QFile(QFilePrivate &dd);
#else
- QFile(QFilePrivate &dd, QObject *parent = Q_NULLPTR);
+ QFile(QFilePrivate &dd, QObject *parent = nullptr);
#endif
private:
diff --git a/src/corelib/io/qfiledevice.h b/src/corelib/io/qfiledevice.h
index e941781c25..af41bec2f6 100644
--- a/src/corelib/io/qfiledevice.h
+++ b/src/corelib/io/qfiledevice.h
@@ -100,19 +100,19 @@ public:
FileError error() const;
void unsetError();
- virtual void close() Q_DECL_OVERRIDE;
+ virtual void close() override;
- bool isSequential() const Q_DECL_OVERRIDE;
+ bool isSequential() const override;
int handle() const;
virtual QString fileName() const;
- qint64 pos() const Q_DECL_OVERRIDE;
- bool seek(qint64 offset) Q_DECL_OVERRIDE;
- bool atEnd() const Q_DECL_OVERRIDE;
+ qint64 pos() const override;
+ bool seek(qint64 offset) override;
+ bool atEnd() const override;
bool flush();
- qint64 size() const Q_DECL_OVERRIDE;
+ qint64 size() const override;
virtual bool resize(qint64 sz);
virtual Permissions permissions() const;
@@ -136,12 +136,12 @@ protected:
QFileDevice(QFileDevicePrivate &dd);
#else
explicit QFileDevice(QObject *parent);
- QFileDevice(QFileDevicePrivate &dd, QObject *parent = Q_NULLPTR);
+ QFileDevice(QFileDevicePrivate &dd, QObject *parent = nullptr);
#endif
- qint64 readData(char *data, qint64 maxlen) Q_DECL_OVERRIDE;
- qint64 writeData(const char *data, qint64 len) Q_DECL_OVERRIDE;
- qint64 readLineData(char *data, qint64 maxlen) Q_DECL_OVERRIDE;
+ qint64 readData(char *data, qint64 maxlen) override;
+ qint64 writeData(const char *data, qint64 len) override;
+ qint64 readLineData(char *data, qint64 maxlen) override;
private:
Q_DISABLE_COPY(QFileDevice)
diff --git a/src/corelib/io/qfiledevice_p.h b/src/corelib/io/qfiledevice_p.h
index 60c51afb7e..47053d01b7 100644
--- a/src/corelib/io/qfiledevice_p.h
+++ b/src/corelib/io/qfiledevice_p.h
@@ -69,7 +69,7 @@ protected:
inline bool ensureFlushed() const;
- bool putCharHelper(char c) Q_DECL_OVERRIDE;
+ bool putCharHelper(char c) override;
void setError(QFileDevice::FileError err);
void setError(QFileDevice::FileError err, const QString &errorString);
diff --git a/src/corelib/io/qfileselector.h b/src/corelib/io/qfileselector.h
index fafb7f7609..c9c2f564f6 100644
--- a/src/corelib/io/qfileselector.h
+++ b/src/corelib/io/qfileselector.h
@@ -50,7 +50,7 @@ class Q_CORE_EXPORT QFileSelector : public QObject
{
Q_OBJECT
public:
- explicit QFileSelector(QObject *parent = Q_NULLPTR);
+ explicit QFileSelector(QObject *parent = nullptr);
~QFileSelector();
QString select(const QString &filePath) const;
diff --git a/src/corelib/io/qfilesystemiterator_unix.cpp b/src/corelib/io/qfilesystemiterator_unix.cpp
index 0d1438f137..a9acf542d4 100644
--- a/src/corelib/io/qfilesystemiterator_unix.cpp
+++ b/src/corelib/io/qfilesystemiterator_unix.cpp
@@ -77,12 +77,19 @@ bool QFileSystemIterator::advance(QFileSystemEntry &fileEntry, QFileSystemMetaDa
if (!dir)
return false;
- dirEntry = QT_READDIR(dir);
+ for (;;) {
+ dirEntry = QT_READDIR(dir);
- if (dirEntry) {
- fileEntry = QFileSystemEntry(nativePath + QByteArray(dirEntry->d_name), QFileSystemEntry::FromNativePath());
- metaData.fillFromDirEnt(*dirEntry);
- return true;
+ if (dirEntry) {
+ // process entries with correct UTF-8 names only
+ if (QFile::encodeName(QFile::decodeName(dirEntry->d_name)) == dirEntry->d_name) {
+ fileEntry = QFileSystemEntry(nativePath + QByteArray(dirEntry->d_name), QFileSystemEntry::FromNativePath());
+ metaData.fillFromDirEnt(*dirEntry);
+ return true;
+ }
+ } else {
+ break;
+ }
}
lastError = errno;
diff --git a/src/corelib/io/qfilesystemwatcher.h b/src/corelib/io/qfilesystemwatcher.h
index 09d4e8e65e..057a20672c 100644
--- a/src/corelib/io/qfilesystemwatcher.h
+++ b/src/corelib/io/qfilesystemwatcher.h
@@ -55,8 +55,8 @@ class Q_CORE_EXPORT QFileSystemWatcher : public QObject
Q_DECLARE_PRIVATE(QFileSystemWatcher)
public:
- QFileSystemWatcher(QObject *parent = Q_NULLPTR);
- QFileSystemWatcher(const QStringList &paths, QObject *parent = Q_NULLPTR);
+ QFileSystemWatcher(QObject *parent = nullptr);
+ QFileSystemWatcher(const QStringList &paths, QObject *parent = nullptr);
~QFileSystemWatcher();
bool addPath(const QString &file);
diff --git a/src/corelib/io/qfilesystemwatcher_fsevents.mm b/src/corelib/io/qfilesystemwatcher_fsevents.mm
index b4517cbac7..792ea387ac 100644
--- a/src/corelib/io/qfilesystemwatcher_fsevents.mm
+++ b/src/corelib/io/qfilesystemwatcher_fsevents.mm
@@ -336,7 +336,7 @@ QStringList QFseventsFileSystemWatcherEngine::addPaths(const QStringList &paths,
QMutexLocker locker(&lock);
- bool wasRunning = stream != Q_NULLPTR;
+ bool wasRunning = stream != nullptr;
bool needsRestart = false;
WatchingState oldState = watchingState;
diff --git a/src/corelib/io/qfilesystemwatcher_inotify_p.h b/src/corelib/io/qfilesystemwatcher_inotify_p.h
index 777d62dc8a..0c873466c8 100644
--- a/src/corelib/io/qfilesystemwatcher_inotify_p.h
+++ b/src/corelib/io/qfilesystemwatcher_inotify_p.h
@@ -70,8 +70,8 @@ public:
static QInotifyFileSystemWatcherEngine *create(QObject *parent);
- QStringList addPaths(const QStringList &paths, QStringList *files, QStringList *directories) Q_DECL_OVERRIDE;
- QStringList removePaths(const QStringList &paths, QStringList *files, QStringList *directories) Q_DECL_OVERRIDE;
+ QStringList addPaths(const QStringList &paths, QStringList *files, QStringList *directories) override;
+ QStringList removePaths(const QStringList &paths, QStringList *files, QStringList *directories) override;
private Q_SLOTS:
void readFromInotify();
diff --git a/src/corelib/io/qfilesystemwatcher_polling_p.h b/src/corelib/io/qfilesystemwatcher_polling_p.h
index 6dff08ac05..4c46633fdf 100644
--- a/src/corelib/io/qfilesystemwatcher_polling_p.h
+++ b/src/corelib/io/qfilesystemwatcher_polling_p.h
@@ -110,8 +110,8 @@ class QPollingFileSystemWatcherEngine : public QFileSystemWatcherEngine
public:
QPollingFileSystemWatcherEngine(QObject *parent);
- QStringList addPaths(const QStringList &paths, QStringList *files, QStringList *directories) Q_DECL_OVERRIDE;
- QStringList removePaths(const QStringList &paths, QStringList *files, QStringList *directories) Q_DECL_OVERRIDE;
+ QStringList addPaths(const QStringList &paths, QStringList *files, QStringList *directories) override;
+ QStringList removePaths(const QStringList &paths, QStringList *files, QStringList *directories) override;
private Q_SLOTS:
void timeout();
diff --git a/src/corelib/io/qfsfileengine_iterator_p.h b/src/corelib/io/qfsfileengine_iterator_p.h
index 7f094ba9d7..bde00bf578 100644
--- a/src/corelib/io/qfsfileengine_iterator_p.h
+++ b/src/corelib/io/qfsfileengine_iterator_p.h
@@ -68,11 +68,11 @@ public:
QFSFileEngineIterator(QDir::Filters filters, const QStringList &filterNames);
~QFSFileEngineIterator();
- QString next() Q_DECL_OVERRIDE;
- bool hasNext() const Q_DECL_OVERRIDE;
+ QString next() override;
+ bool hasNext() const override;
- QString currentFileName() const Q_DECL_OVERRIDE;
- QFileInfo currentFileInfo() const Q_DECL_OVERRIDE;
+ QString currentFileName() const override;
+ QFileInfo currentFileInfo() const override;
private:
void advance() const;
diff --git a/src/corelib/io/qfsfileengine_p.h b/src/corelib/io/qfsfileengine_p.h
index 1f34dfc2be..bf90995fdd 100644
--- a/src/corelib/io/qfsfileengine_p.h
+++ b/src/corelib/io/qfsfileengine_p.h
@@ -71,49 +71,49 @@ public:
explicit QFSFileEngine(const QString &file);
~QFSFileEngine();
- bool open(QIODevice::OpenMode openMode) Q_DECL_OVERRIDE;
+ bool open(QIODevice::OpenMode openMode) override;
bool open(QIODevice::OpenMode flags, FILE *fh);
- bool close() Q_DECL_OVERRIDE;
- bool flush() Q_DECL_OVERRIDE;
- bool syncToDisk() Q_DECL_OVERRIDE;
- qint64 size() const Q_DECL_OVERRIDE;
- qint64 pos() const Q_DECL_OVERRIDE;
- bool seek(qint64) Q_DECL_OVERRIDE;
- bool isSequential() const Q_DECL_OVERRIDE;
- bool remove() Q_DECL_OVERRIDE;
- bool copy(const QString &newName) Q_DECL_OVERRIDE;
- bool rename(const QString &newName) Q_DECL_OVERRIDE;
- bool renameOverwrite(const QString &newName) Q_DECL_OVERRIDE;
- bool link(const QString &newName) Q_DECL_OVERRIDE;
- bool mkdir(const QString &dirName, bool createParentDirectories) const Q_DECL_OVERRIDE;
- bool rmdir(const QString &dirName, bool recurseParentDirectories) const Q_DECL_OVERRIDE;
- bool setSize(qint64 size) Q_DECL_OVERRIDE;
- bool caseSensitive() const Q_DECL_OVERRIDE;
- bool isRelativePath() const Q_DECL_OVERRIDE;
- QStringList entryList(QDir::Filters filters, const QStringList &filterNames) const Q_DECL_OVERRIDE;
- FileFlags fileFlags(FileFlags type) const Q_DECL_OVERRIDE;
- bool setPermissions(uint perms) Q_DECL_OVERRIDE;
+ bool close() override;
+ bool flush() override;
+ bool syncToDisk() override;
+ qint64 size() const override;
+ qint64 pos() const override;
+ bool seek(qint64) override;
+ bool isSequential() const override;
+ bool remove() override;
+ bool copy(const QString &newName) override;
+ bool rename(const QString &newName) override;
+ bool renameOverwrite(const QString &newName) override;
+ bool link(const QString &newName) override;
+ bool mkdir(const QString &dirName, bool createParentDirectories) const override;
+ bool rmdir(const QString &dirName, bool recurseParentDirectories) const override;
+ bool setSize(qint64 size) override;
+ bool caseSensitive() const override;
+ bool isRelativePath() const override;
+ QStringList entryList(QDir::Filters filters, const QStringList &filterNames) const override;
+ FileFlags fileFlags(FileFlags type) const override;
+ bool setPermissions(uint perms) override;
QByteArray id() const override;
- QString fileName(FileName file) const Q_DECL_OVERRIDE;
- uint ownerId(FileOwner) const Q_DECL_OVERRIDE;
- QString owner(FileOwner) const Q_DECL_OVERRIDE;
- bool setFileTime(const QDateTime &newDate, FileTime time) Q_DECL_OVERRIDE;
- QDateTime fileTime(FileTime time) const Q_DECL_OVERRIDE;
- void setFileName(const QString &file) Q_DECL_OVERRIDE;
- int handle() const Q_DECL_OVERRIDE;
+ QString fileName(FileName file) const override;
+ uint ownerId(FileOwner) const override;
+ QString owner(FileOwner) const override;
+ bool setFileTime(const QDateTime &newDate, FileTime time) override;
+ QDateTime fileTime(FileTime time) const override;
+ void setFileName(const QString &file) override;
+ int handle() const override;
#ifndef QT_NO_FILESYSTEMITERATOR
- Iterator *beginEntryList(QDir::Filters filters, const QStringList &filterNames) Q_DECL_OVERRIDE;
- Iterator *endEntryList() Q_DECL_OVERRIDE;
+ Iterator *beginEntryList(QDir::Filters filters, const QStringList &filterNames) override;
+ Iterator *endEntryList() override;
#endif
- qint64 read(char *data, qint64 maxlen) Q_DECL_OVERRIDE;
- qint64 readLine(char *data, qint64 maxlen) Q_DECL_OVERRIDE;
- qint64 write(const char *data, qint64 len) Q_DECL_OVERRIDE;
+ qint64 read(char *data, qint64 maxlen) override;
+ qint64 readLine(char *data, qint64 maxlen) override;
+ qint64 write(const char *data, qint64 len) override;
bool cloneTo(QAbstractFileEngine *target) override;
- bool extension(Extension extension, const ExtensionOption *option = 0, ExtensionReturn *output = 0) Q_DECL_OVERRIDE;
- bool supportsExtension(Extension extension) const Q_DECL_OVERRIDE;
+ bool extension(Extension extension, const ExtensionOption *option = 0, ExtensionReturn *output = 0) override;
+ bool supportsExtension(Extension extension) const override;
//FS only!!
bool open(QIODevice::OpenMode flags, int fd);
diff --git a/src/corelib/io/qiodevice.h b/src/corelib/io/qiodevice.h
index e64a4d0bb1..af37b3fd53 100644
--- a/src/corelib/io/qiodevice.h
+++ b/src/corelib/io/qiodevice.h
@@ -161,7 +161,7 @@ protected:
#ifdef QT_NO_QOBJECT
QIODevice(QIODevicePrivate &dd);
#else
- QIODevice(QIODevicePrivate &dd, QObject *parent = Q_NULLPTR);
+ QIODevice(QIODevicePrivate &dd, QObject *parent = nullptr);
#endif
virtual qint64 readData(char *data, qint64 maxlen) = 0;
virtual qint64 readLineData(char *data, qint64 maxlen);
diff --git a/src/corelib/io/qiodevice_p.h b/src/corelib/io/qiodevice_p.h
index de2aa1597e..15a53a67dc 100644
--- a/src/corelib/io/qiodevice_p.h
+++ b/src/corelib/io/qiodevice_p.h
@@ -88,14 +88,14 @@ public:
class QRingBufferRef {
QRingBuffer *m_buf;
- inline QRingBufferRef() : m_buf(Q_NULLPTR) { }
+ inline QRingBufferRef() : m_buf(nullptr) { }
friend class QIODevicePrivate;
public:
// wrap functions from QRingBuffer
inline void setChunkSize(int size) { Q_ASSERT(m_buf); m_buf->setChunkSize(size); }
inline int chunkSize() const { Q_ASSERT(m_buf); return m_buf->chunkSize(); }
inline qint64 nextDataBlockSize() const { return (m_buf ? m_buf->nextDataBlockSize() : Q_INT64_C(0)); }
- inline const char *readPointer() const { return (m_buf ? m_buf->readPointer() : Q_NULLPTR); }
+ inline const char *readPointer() const { return (m_buf ? m_buf->readPointer() : nullptr); }
inline const char *readPointerAtPosition(qint64 pos, qint64 &length) const { Q_ASSERT(m_buf); return m_buf->readPointerAtPosition(pos, length); }
inline void free(qint64 bytes) { Q_ASSERT(m_buf); m_buf->free(bytes); }
inline char *reserve(qint64 bytes) { Q_ASSERT(m_buf); return m_buf->reserve(bytes); }
diff --git a/src/corelib/io/qlockfile.cpp b/src/corelib/io/qlockfile.cpp
index 129cf01b63..aa84ce6bc1 100644
--- a/src/corelib/io/qlockfile.cpp
+++ b/src/corelib/io/qlockfile.cpp
@@ -56,6 +56,8 @@ struct LockFileInfo
qint64 pid;
QString appname;
QString hostname;
+ QByteArray hostid;
+ QByteArray bootid;
};
}
@@ -331,13 +333,15 @@ QByteArray QLockFilePrivate::lockFileContents() const
// Use operator% from the fast builder to avoid multiple memory allocations.
return QByteArray::number(QCoreApplication::applicationPid()) % '\n'
% processNameByPid(QCoreApplication::applicationPid()).toUtf8() % '\n'
- % machineName().toUtf8() % '\n';
+ % machineName().toUtf8() % '\n'
+ % QSysInfo::machineUniqueId() % '\n'
+ % QSysInfo::bootUniqueId() % '\n';
}
static bool getLockInfo_helper(const QString &fileName, LockFileInfo *info)
{
QFile reader(fileName);
- if (!reader.open(QIODevice::ReadOnly))
+ if (!reader.open(QIODevice::ReadOnly | QIODevice::Text))
return false;
QByteArray pidLine = reader.readLine();
@@ -349,9 +353,17 @@ static bool getLockInfo_helper(const QString &fileName, LockFileInfo *info)
QByteArray hostNameLine = reader.readLine();
hostNameLine.chop(1);
+ // prior to Qt 5.10, only the lines above were recorded
+ QByteArray hostId = reader.readLine();
+ hostId.chop(1);
+ QByteArray bootId = reader.readLine();
+ bootId.chop(1);
+
bool ok;
info->appname = QString::fromUtf8(appNameLine);
info->hostname = QString::fromUtf8(hostNameLine);
+ info->hostid = hostId;
+ info->bootid = bootId;
info->pid = pidLine.toLongLong(&ok);
return ok && info->pid > 0;
}
@@ -360,7 +372,20 @@ bool QLockFilePrivate::isApparentlyStale() const
{
LockFileInfo info;
if (getLockInfo_helper(fileName, &info)) {
- if (info.hostname.isEmpty() || info.hostname == machineName()) {
+ bool sameHost = info.hostname.isEmpty() || info.hostname == machineName();
+ if (!info.hostid.isEmpty()) {
+ // Override with the host ID, if we know it.
+ QByteArray ourHostId = QSysInfo::machineUniqueId();
+ if (!ourHostId.isEmpty())
+ sameHost = (ourHostId == info.hostid);
+ }
+
+ if (sameHost) {
+ if (!info.bootid.isEmpty()) {
+ // If we've rebooted, then the lock is definitely stale.
+ if (info.bootid != QSysInfo::bootUniqueId())
+ return true;
+ }
if (!isProcessRunning(info.pid, info.appname))
return true;
}
diff --git a/src/corelib/io/qlockfile_p.h b/src/corelib/io/qlockfile_p.h
index b41dfb38ad..5b69347206 100644
--- a/src/corelib/io/qlockfile_p.h
+++ b/src/corelib/io/qlockfile_p.h
@@ -55,7 +55,10 @@
#include <QtCore/qlockfile.h>
#include <QtCore/qfile.h>
+#include <qplatformdefs.h>
+
#ifdef Q_OS_WIN
+#include <io.h>
#include <qt_windows.h>
#endif
@@ -96,6 +99,19 @@ public:
int staleLockTime; // "int milliseconds" is big enough for 24 days
QLockFile::LockError lockError;
bool isLocked;
+
+ static int getLockFileHandle(QLockFile *f)
+ {
+ int fd;
+#ifdef Q_OS_WIN
+ // Use of this function on Windows WILL leak a file descriptor.
+ fd = _open_osfhandle(intptr_t(f->d_func()->fileHandle), 0);
+#else
+ fd = f->d_func()->fileHandle;
+#endif
+ QT_LSEEK(fd, 0, SEEK_SET);
+ return fd;
+ }
};
QT_END_NAMESPACE
diff --git a/src/corelib/io/qlockfile_unix.cpp b/src/corelib/io/qlockfile_unix.cpp
index fc01f83e80..418b7d22ba 100644
--- a/src/corelib/io/qlockfile_unix.cpp
+++ b/src/corelib/io/qlockfile_unix.cpp
@@ -147,7 +147,7 @@ static bool setNativeLocks(int fd)
QLockFile::LockError QLockFilePrivate::tryLock_sys()
{
const QByteArray lockFileName = QFile::encodeName(fileName);
- const int fd = qt_safe_open(lockFileName.constData(), O_WRONLY | O_CREAT | O_EXCL, 0666);
+ const int fd = qt_safe_open(lockFileName.constData(), O_RDWR | O_CREAT | O_EXCL, 0666);
if (fd < 0) {
switch (errno) {
case EEXIST:
diff --git a/src/corelib/io/qlockfile_win.cpp b/src/corelib/io/qlockfile_win.cpp
index de64ec0432..6b8028460c 100644
--- a/src/corelib/io/qlockfile_win.cpp
+++ b/src/corelib/io/qlockfile_win.cpp
@@ -68,7 +68,7 @@ QLockFile::LockError QLockFilePrivate::tryLock_sys()
#ifndef Q_OS_WINRT
SECURITY_ATTRIBUTES securityAtts = { sizeof(SECURITY_ATTRIBUTES), NULL, FALSE };
HANDLE fh = CreateFile((const wchar_t*)fileEntry.nativeFilePath().utf16(),
- GENERIC_WRITE,
+ GENERIC_READ | GENERIC_WRITE,
dwShareMode,
&securityAtts,
CREATE_NEW, // error if already exists
@@ -76,7 +76,7 @@ QLockFile::LockError QLockFilePrivate::tryLock_sys()
NULL);
#else // !Q_OS_WINRT
HANDLE fh = CreateFile2((const wchar_t*)fileEntry.nativeFilePath().utf16(),
- GENERIC_WRITE,
+ GENERIC_READ | GENERIC_WRITE,
dwShareMode,
CREATE_NEW, // error if already exists
NULL);
diff --git a/src/corelib/io/qnoncontiguousbytedevice_p.h b/src/corelib/io/qnoncontiguousbytedevice_p.h
index bb0b533831..ebed1120db 100644
--- a/src/corelib/io/qnoncontiguousbytedevice_p.h
+++ b/src/corelib/io/qnoncontiguousbytedevice_p.h
@@ -105,12 +105,12 @@ class QNonContiguousByteDeviceByteArrayImpl : public QNonContiguousByteDevice
public:
QNonContiguousByteDeviceByteArrayImpl(QByteArray *ba);
~QNonContiguousByteDeviceByteArrayImpl();
- const char* readPointer(qint64 maximumLength, qint64 &len) Q_DECL_OVERRIDE;
- bool advanceReadPointer(qint64 amount) Q_DECL_OVERRIDE;
- bool atEnd() const Q_DECL_OVERRIDE;
- bool reset() Q_DECL_OVERRIDE;
- qint64 size() const Q_DECL_OVERRIDE;
- qint64 pos() const Q_DECL_OVERRIDE;
+ const char* readPointer(qint64 maximumLength, qint64 &len) override;
+ bool advanceReadPointer(qint64 amount) override;
+ bool atEnd() const override;
+ bool reset() override;
+ qint64 size() const override;
+ qint64 pos() const override;
protected:
QByteArray* byteArray;
qint64 currentPosition;
@@ -121,12 +121,12 @@ class QNonContiguousByteDeviceRingBufferImpl : public QNonContiguousByteDevice
public:
QNonContiguousByteDeviceRingBufferImpl(QSharedPointer<QRingBuffer> rb);
~QNonContiguousByteDeviceRingBufferImpl();
- const char* readPointer(qint64 maximumLength, qint64 &len) Q_DECL_OVERRIDE;
- bool advanceReadPointer(qint64 amount) Q_DECL_OVERRIDE;
- bool atEnd() const Q_DECL_OVERRIDE;
- bool reset() Q_DECL_OVERRIDE;
- qint64 size() const Q_DECL_OVERRIDE;
- qint64 pos() const Q_DECL_OVERRIDE;
+ const char* readPointer(qint64 maximumLength, qint64 &len) override;
+ bool advanceReadPointer(qint64 amount) override;
+ bool atEnd() const override;
+ bool reset() override;
+ qint64 size() const override;
+ qint64 pos() const override;
protected:
QSharedPointer<QRingBuffer> ringBuffer;
qint64 currentPosition;
@@ -139,12 +139,12 @@ class QNonContiguousByteDeviceIoDeviceImpl : public QNonContiguousByteDevice
public:
QNonContiguousByteDeviceIoDeviceImpl(QIODevice *d);
~QNonContiguousByteDeviceIoDeviceImpl();
- const char* readPointer(qint64 maximumLength, qint64 &len) Q_DECL_OVERRIDE;
- bool advanceReadPointer(qint64 amount) Q_DECL_OVERRIDE;
- bool atEnd() const Q_DECL_OVERRIDE;
- bool reset() Q_DECL_OVERRIDE;
- qint64 size() const Q_DECL_OVERRIDE;
- qint64 pos() const Q_DECL_OVERRIDE;
+ const char* readPointer(qint64 maximumLength, qint64 &len) override;
+ bool advanceReadPointer(qint64 amount) override;
+ bool atEnd() const override;
+ bool reset() override;
+ qint64 size() const override;
+ qint64 pos() const override;
protected:
QIODevice* device;
QByteArray* currentReadBuffer;
@@ -162,11 +162,11 @@ class QNonContiguousByteDeviceBufferImpl : public QNonContiguousByteDevice
public:
QNonContiguousByteDeviceBufferImpl(QBuffer *b);
~QNonContiguousByteDeviceBufferImpl();
- const char* readPointer(qint64 maximumLength, qint64 &len) Q_DECL_OVERRIDE;
- bool advanceReadPointer(qint64 amount) Q_DECL_OVERRIDE;
- bool atEnd() const Q_DECL_OVERRIDE;
- bool reset() Q_DECL_OVERRIDE;
- qint64 size() const Q_DECL_OVERRIDE;
+ const char* readPointer(qint64 maximumLength, qint64 &len) override;
+ bool advanceReadPointer(qint64 amount) override;
+ bool atEnd() const override;
+ bool reset() override;
+ qint64 size() const override;
protected:
QBuffer* buffer;
QByteArray byteArray;
@@ -179,13 +179,13 @@ class QByteDeviceWrappingIoDevice : public QIODevice
public:
QByteDeviceWrappingIoDevice (QNonContiguousByteDevice *bd);
~QByteDeviceWrappingIoDevice ();
- virtual bool isSequential () const Q_DECL_OVERRIDE;
- virtual bool atEnd () const Q_DECL_OVERRIDE;
- virtual bool reset () Q_DECL_OVERRIDE;
- virtual qint64 size () const Q_DECL_OVERRIDE;
+ virtual bool isSequential () const override;
+ virtual bool atEnd () const override;
+ virtual bool reset () override;
+ virtual qint64 size () const override;
protected:
- virtual qint64 readData ( char * data, qint64 maxSize ) Q_DECL_OVERRIDE;
- virtual qint64 writeData ( const char * data, qint64 maxSize ) Q_DECL_OVERRIDE;
+ virtual qint64 readData ( char * data, qint64 maxSize ) override;
+ virtual qint64 writeData ( const char * data, qint64 maxSize ) override;
QNonContiguousByteDevice *byteDevice;
};
diff --git a/src/corelib/io/qprocess.h b/src/corelib/io/qprocess.h
index c8aef2f0b1..474fc87de8 100644
--- a/src/corelib/io/qprocess.h
+++ b/src/corelib/io/qprocess.h
@@ -155,7 +155,7 @@ public:
};
Q_ENUM(ExitStatus)
- explicit QProcess(QObject *parent = Q_NULLPTR);
+ explicit QProcess(QObject *parent = nullptr);
virtual ~QProcess();
void start(const QString &program, const QStringList &arguments, OpenMode mode = ReadWrite);
@@ -164,7 +164,7 @@ public:
#endif
void start(OpenMode mode = ReadWrite);
bool startDetached(qint64 *pid = nullptr);
- bool open(OpenMode mode = ReadWrite) Q_DECL_OVERRIDE;
+ bool open(OpenMode mode = ReadWrite) override;
QString program() const;
void setProgram(const QString &program);
@@ -227,8 +227,8 @@ public:
qint64 processId() const;
bool waitForStarted(int msecs = 30000);
- bool waitForReadyRead(int msecs = 30000) Q_DECL_OVERRIDE;
- bool waitForBytesWritten(int msecs = 30000) Q_DECL_OVERRIDE;
+ bool waitForReadyRead(int msecs = 30000) override;
+ bool waitForBytesWritten(int msecs = 30000) override;
bool waitForFinished(int msecs = 30000);
QByteArray readAllStandardOutput();
@@ -238,12 +238,12 @@ public:
QProcess::ExitStatus exitStatus() const;
// QIODevice
- qint64 bytesAvailable() const Q_DECL_OVERRIDE; // ### Qt6: remove trivial override
- qint64 bytesToWrite() const Q_DECL_OVERRIDE;
- bool isSequential() const Q_DECL_OVERRIDE;
- bool canReadLine() const Q_DECL_OVERRIDE; // ### Qt6: remove trivial override
- void close() Q_DECL_OVERRIDE;
- bool atEnd() const Q_DECL_OVERRIDE; // ### Qt6: remove trivial override
+ qint64 bytesAvailable() const override; // ### Qt6: remove trivial override
+ qint64 bytesToWrite() const override;
+ bool isSequential() const override;
+ bool canReadLine() const override; // ### Qt6: remove trivial override
+ void close() override;
+ bool atEnd() const override; // ### Qt6: remove trivial override
static int execute(const QString &program, const QStringList &arguments);
static int execute(const QString &command);
@@ -253,7 +253,7 @@ public:
#if defined(Q_QDOC)
= QString()
#endif
- , qint64 *pid = Q_NULLPTR);
+ , qint64 *pid = nullptr);
#if !defined(Q_QDOC)
static bool startDetached(const QString &program, const QStringList &arguments); // ### Qt6: merge overloads
#endif
@@ -286,8 +286,8 @@ protected:
virtual void setupChildProcess();
// QIODevice
- qint64 readData(char *data, qint64 maxlen) Q_DECL_OVERRIDE;
- qint64 writeData(const char *data, qint64 len) Q_DECL_OVERRIDE;
+ qint64 readData(char *data, qint64 maxlen) override;
+ qint64 writeData(const char *data, qint64 len) override;
private:
Q_DECLARE_PRIVATE(QProcess)
diff --git a/src/corelib/io/qprocess_p.h b/src/corelib/io/qprocess_p.h
index deb29dca0a..aa7ecbe91d 100644
--- a/src/corelib/io/qprocess_p.h
+++ b/src/corelib/io/qprocess_p.h
@@ -352,7 +352,7 @@ public:
#if defined(Q_OS_UNIX)
void execChild(const char *workingDirectory, char **argv, char **envp);
#endif
- bool processStarted(QString *errorMessage = Q_NULLPTR);
+ bool processStarted(QString *errorMessage = nullptr);
void terminateProcess();
void killProcess();
void findExitCode();
diff --git a/src/corelib/io/qprocess_unix.cpp b/src/corelib/io/qprocess_unix.cpp
index 15752f84b2..68b7a8bf9b 100644
--- a/src/corelib/io/qprocess_unix.cpp
+++ b/src/corelib/io/qprocess_unix.cpp
@@ -885,7 +885,7 @@ bool QProcessPrivate::waitForDeadChild()
// read the process information from our fd
forkfd_info info;
int ret;
- EINTR_LOOP(ret, forkfd_wait(forkfd, &info, Q_NULLPTR));
+ EINTR_LOOP(ret, forkfd_wait(forkfd, &info, nullptr));
exitCode = info.status;
crashed = info.code != CLD_EXITED;
diff --git a/src/corelib/io/qprocess_win.cpp b/src/corelib/io/qprocess_win.cpp
index 8da6d6b16e..6ab806d9fe 100644
--- a/src/corelib/io/qprocess_win.cpp
+++ b/src/corelib/io/qprocess_win.cpp
@@ -114,9 +114,7 @@ static void qt_create_pipe(Q_PIPE *pipe, bool isInputPipe)
dwOpenMode |= PIPE_ACCESS_INBOUND;
dwInputBufferSize = dwPipeBufferSize;
}
- DWORD dwPipeFlags = PIPE_TYPE_BYTE | PIPE_WAIT;
- if (QSysInfo::windowsVersion() >= QSysInfo::WV_VISTA)
- dwPipeFlags |= PIPE_REJECT_REMOTE_CLIENTS;
+ DWORD dwPipeFlags = PIPE_TYPE_BYTE | PIPE_WAIT | PIPE_REJECT_REMOTE_CLIENTS;
hServer = CreateNamedPipe(pipeName,
dwOpenMode,
dwPipeFlags,
diff --git a/src/corelib/io/qresource.cpp b/src/corelib/io/qresource.cpp
index c1187e5145..9a63374e6f 100644
--- a/src/corelib/io/qresource.cpp
+++ b/src/corelib/io/qresource.cpp
@@ -911,8 +911,8 @@ public:
inline QDynamicBufferResourceRoot(const QString &_root) : root(_root), buffer(0) { }
inline ~QDynamicBufferResourceRoot() { }
inline const uchar *mappingBuffer() const { return buffer; }
- virtual QString mappingRoot() const Q_DECL_OVERRIDE { return root; }
- virtual ResourceRootType type() const Q_DECL_OVERRIDE { return Resource_Buffer; }
+ virtual QString mappingRoot() const override { return root; }
+ virtual ResourceRootType type() const override { return Resource_Buffer; }
// size == -1 means "unknown"
bool registerSelf(const uchar *b, int size)
@@ -994,7 +994,7 @@ public:
}
}
QString mappingFile() const { return fileName; }
- virtual ResourceRootType type() const Q_DECL_OVERRIDE { return Resource_File; }
+ virtual ResourceRootType type() const override { return Resource_File; }
bool registerSelf(const QString &f) {
bool fromMM = false;
diff --git a/src/corelib/io/qresource_iterator_p.h b/src/corelib/io/qresource_iterator_p.h
index 6a4e215864..207a88b0ba 100644
--- a/src/corelib/io/qresource_iterator_p.h
+++ b/src/corelib/io/qresource_iterator_p.h
@@ -63,10 +63,10 @@ public:
QResourceFileEngineIterator(QDir::Filters filters, const QStringList &filterNames);
~QResourceFileEngineIterator();
- QString next() Q_DECL_OVERRIDE;
- bool hasNext() const Q_DECL_OVERRIDE;
+ QString next() override;
+ bool hasNext() const override;
- QString currentFileName() const Q_DECL_OVERRIDE;
+ QString currentFileName() const override;
private:
mutable QStringList entries;
diff --git a/src/corelib/io/qresource_p.h b/src/corelib/io/qresource_p.h
index e08ba64d2b..dcfe46704c 100644
--- a/src/corelib/io/qresource_p.h
+++ b/src/corelib/io/qresource_p.h
@@ -64,52 +64,52 @@ public:
explicit QResourceFileEngine(const QString &path);
~QResourceFileEngine();
- virtual void setFileName(const QString &file) Q_DECL_OVERRIDE;
+ virtual void setFileName(const QString &file) override;
- virtual bool open(QIODevice::OpenMode flags) Q_DECL_OVERRIDE ;
- virtual bool close() Q_DECL_OVERRIDE;
- virtual bool flush() Q_DECL_OVERRIDE;
- virtual qint64 size() const Q_DECL_OVERRIDE;
- virtual qint64 pos() const Q_DECL_OVERRIDE;
+ virtual bool open(QIODevice::OpenMode flags) override ;
+ virtual bool close() override;
+ virtual bool flush() override;
+ virtual qint64 size() const override;
+ virtual qint64 pos() const override;
virtual bool atEnd() const;
- virtual bool seek(qint64) Q_DECL_OVERRIDE;
- virtual qint64 read(char *data, qint64 maxlen) Q_DECL_OVERRIDE;
- virtual qint64 write(const char *data, qint64 len) Q_DECL_OVERRIDE;
+ virtual bool seek(qint64) override;
+ virtual qint64 read(char *data, qint64 maxlen) override;
+ virtual qint64 write(const char *data, qint64 len) override;
- virtual bool remove() Q_DECL_OVERRIDE;
- virtual bool copy(const QString &newName) Q_DECL_OVERRIDE;
- virtual bool rename(const QString &newName) Q_DECL_OVERRIDE;
- virtual bool link(const QString &newName) Q_DECL_OVERRIDE;
+ virtual bool remove() override;
+ virtual bool copy(const QString &newName) override;
+ virtual bool rename(const QString &newName) override;
+ virtual bool link(const QString &newName) override;
- virtual bool isSequential() const Q_DECL_OVERRIDE;
+ virtual bool isSequential() const override;
- virtual bool isRelativePath() const Q_DECL_OVERRIDE;
+ virtual bool isRelativePath() const override;
- virtual bool mkdir(const QString &dirName, bool createParentDirectories) const Q_DECL_OVERRIDE;
- virtual bool rmdir(const QString &dirName, bool recurseParentDirectories) const Q_DECL_OVERRIDE;
+ virtual bool mkdir(const QString &dirName, bool createParentDirectories) const override;
+ virtual bool rmdir(const QString &dirName, bool recurseParentDirectories) const override;
- virtual bool setSize(qint64 size) Q_DECL_OVERRIDE;
+ virtual bool setSize(qint64 size) override;
- virtual QStringList entryList(QDir::Filters filters, const QStringList &filterNames) const Q_DECL_OVERRIDE;
+ virtual QStringList entryList(QDir::Filters filters, const QStringList &filterNames) const override;
- virtual bool caseSensitive() const Q_DECL_OVERRIDE;
+ virtual bool caseSensitive() const override;
- virtual FileFlags fileFlags(FileFlags type) const Q_DECL_OVERRIDE;
+ virtual FileFlags fileFlags(FileFlags type) const override;
- virtual bool setPermissions(uint perms) Q_DECL_OVERRIDE;
+ virtual bool setPermissions(uint perms) override;
- virtual QString fileName(QAbstractFileEngine::FileName file) const Q_DECL_OVERRIDE;
+ virtual QString fileName(QAbstractFileEngine::FileName file) const override;
- virtual uint ownerId(FileOwner) const Q_DECL_OVERRIDE;
- virtual QString owner(FileOwner) const Q_DECL_OVERRIDE;
+ virtual uint ownerId(FileOwner) const override;
+ virtual QString owner(FileOwner) const override;
- virtual QDateTime fileTime(FileTime time) const Q_DECL_OVERRIDE;
+ virtual QDateTime fileTime(FileTime time) const override;
- virtual Iterator *beginEntryList(QDir::Filters filters, const QStringList &filterNames) Q_DECL_OVERRIDE;
- virtual Iterator *endEntryList() Q_DECL_OVERRIDE;
+ virtual Iterator *beginEntryList(QDir::Filters filters, const QStringList &filterNames) override;
+ virtual Iterator *endEntryList() override;
- bool extension(Extension extension, const ExtensionOption *option = 0, ExtensionReturn *output = 0) Q_DECL_OVERRIDE;
- bool supportsExtension(Extension extension) const Q_DECL_OVERRIDE;
+ bool extension(Extension extension, const ExtensionOption *option = 0, ExtensionReturn *output = 0) override;
+ bool supportsExtension(Extension extension) const override;
};
QT_END_NAMESPACE
diff --git a/src/corelib/io/qsavefile.h b/src/corelib/io/qsavefile.h
index 09d6e29272..200068d30d 100644
--- a/src/corelib/io/qsavefile.h
+++ b/src/corelib/io/qsavefile.h
@@ -67,15 +67,15 @@ public:
explicit QSaveFile(const QString &name);
#ifndef QT_NO_QOBJECT
- explicit QSaveFile(QObject *parent = Q_NULLPTR);
+ explicit QSaveFile(QObject *parent = nullptr);
explicit QSaveFile(const QString &name, QObject *parent);
#endif
~QSaveFile();
- QString fileName() const Q_DECL_OVERRIDE;
+ QString fileName() const override;
void setFileName(const QString &name);
- bool open(OpenMode flags) Q_DECL_OVERRIDE;
+ bool open(OpenMode flags) override;
bool commit();
void cancelWriting();
@@ -84,10 +84,10 @@ public:
bool directWriteFallback() const;
protected:
- qint64 writeData(const char *data, qint64 len) Q_DECL_OVERRIDE;
+ qint64 writeData(const char *data, qint64 len) override;
private:
- void close() Q_DECL_OVERRIDE;
+ void close() override;
#if !QT_CONFIG(translation)
static QString tr(const char *string) { return QString::fromLatin1(string); }
#endif
diff --git a/src/corelib/io/qsettings.h b/src/corelib/io/qsettings.h
index da5502e5ca..f34e6bea1b 100644
--- a/src/corelib/io/qsettings.h
+++ b/src/corelib/io/qsettings.h
@@ -125,13 +125,13 @@ public:
#ifndef QT_NO_QOBJECT
explicit QSettings(const QString &organization,
- const QString &application = QString(), QObject *parent = Q_NULLPTR);
+ const QString &application = QString(), QObject *parent = nullptr);
QSettings(Scope scope, const QString &organization,
- const QString &application = QString(), QObject *parent = Q_NULLPTR);
+ const QString &application = QString(), QObject *parent = nullptr);
QSettings(Format format, Scope scope, const QString &organization,
- const QString &application = QString(), QObject *parent = Q_NULLPTR);
- QSettings(const QString &fileName, Format format, QObject *parent = Q_NULLPTR);
- explicit QSettings(QObject *parent = Q_NULLPTR);
+ const QString &application = QString(), QObject *parent = nullptr);
+ QSettings(const QString &fileName, Format format, QObject *parent = nullptr);
+ explicit QSettings(QObject *parent = nullptr);
#else
explicit QSettings(const QString &organization,
const QString &application = QString());
@@ -199,7 +199,7 @@ public:
protected:
#ifndef QT_NO_QOBJECT
- bool event(QEvent *event) Q_DECL_OVERRIDE;
+ bool event(QEvent *event) override;
#endif
private:
diff --git a/src/corelib/io/qsettings_mac.cpp b/src/corelib/io/qsettings_mac.cpp
index 2a08ee2e64..aa14d8435a 100644
--- a/src/corelib/io/qsettings_mac.cpp
+++ b/src/corelib/io/qsettings_mac.cpp
@@ -616,7 +616,7 @@ bool QConfFileSettingsPrivate::readPlistFile(const QByteArray &data, ParsedSetti
{
QCFType<CFDataRef> cfData = data.toRawCFData();
QCFType<CFPropertyListRef> propertyList =
- CFPropertyListCreateWithData(kCFAllocatorDefault, cfData, kCFPropertyListImmutable, Q_NULLPTR, Q_NULLPTR);
+ CFPropertyListCreateWithData(kCFAllocatorDefault, cfData, kCFPropertyListImmutable, nullptr, nullptr);
if (!propertyList)
return true;
diff --git a/src/corelib/io/qsettings_p.h b/src/corelib/io/qsettings_p.h
index 7923c24770..d18c96a06c 100644
--- a/src/corelib/io/qsettings_p.h
+++ b/src/corelib/io/qsettings_p.h
@@ -261,17 +261,17 @@ public:
QConfFileSettingsPrivate(const QString &fileName, QSettings::Format format);
~QConfFileSettingsPrivate();
- void remove(const QString &key) Q_DECL_OVERRIDE;
- void set(const QString &key, const QVariant &value) Q_DECL_OVERRIDE;
- bool get(const QString &key, QVariant *value) const Q_DECL_OVERRIDE;
+ void remove(const QString &key) override;
+ void set(const QString &key, const QVariant &value) override;
+ bool get(const QString &key, QVariant *value) const override;
- QStringList children(const QString &prefix, ChildSpec spec) const Q_DECL_OVERRIDE;
+ QStringList children(const QString &prefix, ChildSpec spec) const override;
- void clear() Q_DECL_OVERRIDE;
- void sync() Q_DECL_OVERRIDE;
- void flush() Q_DECL_OVERRIDE;
- bool isWritable() const Q_DECL_OVERRIDE;
- QString fileName() const Q_DECL_OVERRIDE;
+ void clear() override;
+ void sync() override;
+ void flush() override;
+ bool isWritable() const override;
+ QString fileName() const override;
bool readIniFile(const QByteArray &data, UnparsedSettingsMap *unparsedIniSections);
static bool readIniSection(const QSettingsKey &section, const QByteArray &data,
diff --git a/src/corelib/io/qstandardpaths_mac.mm b/src/corelib/io/qstandardpaths_mac.mm
index e25339a7d1..3bb7a7877a 100644
--- a/src/corelib/io/qstandardpaths_mac.mm
+++ b/src/corelib/io/qstandardpaths_mac.mm
@@ -203,28 +203,17 @@ QStringList QStandardPaths::standardLocations(StandardLocation type)
if (type == AppDataLocation || type == AppLocalDataLocation) {
CFBundleRef mainBundle = CFBundleGetMainBundle();
if (mainBundle) {
- CFURLRef bundleUrl = CFBundleCopyBundleURL(mainBundle);
- CFStringRef cfBundlePath = CFURLCopyFileSystemPath(bundleUrl, kCFURLPOSIXPathStyle);
- QString bundlePath = QString::fromCFString(cfBundlePath);
- CFRelease(cfBundlePath);
- CFRelease(bundleUrl);
-
- CFURLRef resourcesUrl = CFBundleCopyResourcesDirectoryURL(mainBundle);
- CFStringRef cfResourcesPath = CFURLCopyFileSystemPath(resourcesUrl,
- kCFURLPOSIXPathStyle);
- QString resourcesPath = QString::fromCFString(cfResourcesPath);
- CFRelease(cfResourcesPath);
- CFRelease(resourcesUrl);
-
- // Handle bundled vs unbundled executables. CFBundleGetMainBundle() returns
- // a valid bundle in both cases. CFBundleCopyResourcesDirectoryURL() returns
- // an absolute path for unbundled executables.
- if (resourcesPath.startsWith(QLatin1Char('/')))
- dirs.append(resourcesPath);
- else
- dirs.append(bundlePath + resourcesPath);
+ if (QCFType<CFURLRef> resourcesURL = CFBundleCopyResourcesDirectoryURL(mainBundle)) {
+ if (QCFType<CFURLRef> absoluteResouresURL = CFURLCopyAbsoluteURL(resourcesURL)) {
+ if (QCFType<CFStringRef> path = CFURLCopyFileSystemPath(absoluteResouresURL,
+ kCFURLPOSIXPathStyle)) {
+ dirs.append(QString::fromCFString(path));
+ }
+ }
+ }
}
}
+
const QString localDir = writableLocation(type);
if (!localDir.isEmpty())
dirs.prepend(localDir);
diff --git a/src/corelib/io/qstorageinfo_mac.cpp b/src/corelib/io/qstorageinfo_mac.cpp
index 0f271f2bc6..8b06543d71 100644
--- a/src/corelib/io/qstorageinfo_mac.cpp
+++ b/src/corelib/io/qstorageinfo_mac.cpp
@@ -112,7 +112,7 @@ void QStorageInfoPrivate::retrieveUrlProperties(bool initRootPath)
QCFType<CFArrayRef> keys = CFArrayCreate(kCFAllocatorDefault,
initRootPath ? rootPathKeys : propertyKeys,
size,
- Q_NULLPTR);
+ nullptr);
if (!keys)
return;
@@ -178,9 +178,9 @@ QList<QStorageInfo> QStorageInfoPrivate::mountedVolumes()
QList<QStorageInfo> volumes;
QCFType<CFURLEnumeratorRef> enumerator;
- enumerator = CFURLEnumeratorCreateForMountedVolumes(Q_NULLPTR,
+ enumerator = CFURLEnumeratorCreateForMountedVolumes(nullptr,
kCFURLEnumeratorSkipInvisibles,
- Q_NULLPTR);
+ nullptr);
CFURLEnumeratorResult result = kCFURLEnumeratorSuccess;
do {
diff --git a/src/corelib/io/qstorageinfo_unix.cpp b/src/corelib/io/qstorageinfo_unix.cpp
index 1fc32e0f2d..cdaa6329f9 100644
--- a/src/corelib/io/qstorageinfo_unix.cpp
+++ b/src/corelib/io/qstorageinfo_unix.cpp
@@ -257,7 +257,7 @@ inline QStorageIterator::~QStorageIterator()
inline bool QStorageIterator::isValid() const
{
- return fp != Q_NULLPTR;
+ return fp != nullptr;
}
inline bool QStorageIterator::next()
@@ -357,12 +357,12 @@ inline QStorageIterator::~QStorageIterator()
inline bool QStorageIterator::isValid() const
{
- return fp != Q_NULLPTR;
+ return fp != nullptr;
}
inline bool QStorageIterator::next()
{
- return ::getmntent_r(fp, &mnt, buffer.data(), buffer.size()) != Q_NULLPTR;
+ return ::getmntent_r(fp, &mnt, buffer.data(), buffer.size()) != nullptr;
}
inline QString QStorageIterator::rootPath() const
diff --git a/src/corelib/io/qstorageinfo_win.cpp b/src/corelib/io/qstorageinfo_win.cpp
index 3830c5480c..8a3db90f87 100644
--- a/src/corelib/io/qstorageinfo_win.cpp
+++ b/src/corelib/io/qstorageinfo_win.cpp
@@ -147,8 +147,8 @@ void QStorageInfoPrivate::retrieveVolumeInfo()
const bool result = ::GetVolumeInformation(reinterpret_cast<const wchar_t *>(path.utf16()),
nameBuffer,
defaultBufferSize,
- Q_NULLPTR,
- Q_NULLPTR,
+ nullptr,
+ nullptr,
&fileSystemFlags,
fileSystemTypeBuffer,
defaultBufferSize);
diff --git a/src/corelib/io/qtemporarydir.cpp b/src/corelib/io/qtemporarydir.cpp
index 2779246c5b..ed52472ab3 100644
--- a/src/corelib/io/qtemporarydir.cpp
+++ b/src/corelib/io/qtemporarydir.cpp
@@ -42,12 +42,12 @@
#ifndef QT_NO_TEMPORARYFILE
+#include "qdebug.h"
#include "qdiriterator.h"
+#include "qpair.h"
#include "qplatformdefs.h"
+#include "qrandom.h"
#include "private/qtemporaryfile_p.h"
-#include <QDebug>
-#include <QPair>
-#include <QRandomGenerator>
#if defined(QT_BUILD_CORE_LIB)
#include "qcoreapplication.h"
diff --git a/src/corelib/io/qtemporarydir.h b/src/corelib/io/qtemporarydir.h
index 3f6b70a2eb..5864ce5cfc 100644
--- a/src/corelib/io/qtemporarydir.h
+++ b/src/corelib/io/qtemporarydir.h
@@ -41,7 +41,7 @@
#define QTEMPORARYDIR_H
#include <QtCore/qdir.h>
-#include <QtCore/QScopedPointer>
+#include <QtCore/qscopedpointer.h>
QT_BEGIN_NAMESPACE
diff --git a/src/corelib/io/qtemporaryfile.h b/src/corelib/io/qtemporaryfile.h
index 7fc5a299fc..90a6a613e6 100644
--- a/src/corelib/io/qtemporaryfile.h
+++ b/src/corelib/io/qtemporaryfile.h
@@ -77,7 +77,7 @@ public:
// ### Hides open(flags)
bool open() { return open(QIODevice::ReadWrite); }
- QString fileName() const Q_DECL_OVERRIDE;
+ QString fileName() const override;
QString fileTemplate() const;
void setFileTemplate(const QString &name);
@@ -95,7 +95,7 @@ public:
static QTemporaryFile *createNativeFile(QFile &file);
protected:
- bool open(OpenMode flags) Q_DECL_OVERRIDE;
+ bool open(OpenMode flags) override;
private:
friend class QFile;
diff --git a/src/corelib/io/qtextstream.h b/src/corelib/io/qtextstream.h
index e72b7942fd..ee0b09419d 100644
--- a/src/corelib/io/qtextstream.h
+++ b/src/corelib/io/qtextstream.h
@@ -212,8 +212,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(Q_NULLPTR), arg(a), ch() {}
- Q_DECL_CONSTEXPR QTextStreamManipulator(QTSMFC m, QChar c) Q_DECL_NOTHROW : mf(Q_NULLPTR), mc(m), arg(-1), ch(c) {}
+ 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) {}
void exec(QTextStream &s) { if (mf) { (s.*mf)(arg); } else { (s.*mc)(ch); } }
private:
diff --git a/src/corelib/io/qurl.h b/src/corelib/io/qurl.h
index 0bb8707ff9..5062ef7905 100644
--- a/src/corelib/io/qurl.h
+++ b/src/corelib/io/qurl.h
@@ -184,7 +184,7 @@ public:
#endif
#ifdef Q_COMPILER_RVALUE_REFS
QUrl(QUrl &&other) Q_DECL_NOTHROW : d(other.d)
- { other.d = Q_NULLPTR; }
+ { other.d = nullptr; }
inline QUrl &operator=(QUrl &&other) Q_DECL_NOTHROW
{ qSwap(d, other.d); return *this; }
#endif
diff --git a/src/corelib/itemmodels/qabstractitemmodel.cpp b/src/corelib/itemmodels/qabstractitemmodel.cpp
index f893cf06e3..44622a0ad9 100644
--- a/src/corelib/itemmodels/qabstractitemmodel.cpp
+++ b/src/corelib/itemmodels/qabstractitemmodel.cpp
@@ -482,12 +482,12 @@ class QEmptyItemModel : public QAbstractItemModel
{
public:
explicit QEmptyItemModel(QObject *parent = 0) : QAbstractItemModel(parent) {}
- QModelIndex index(int, int, const QModelIndex &) const Q_DECL_OVERRIDE { return QModelIndex(); }
- QModelIndex parent(const QModelIndex &) const Q_DECL_OVERRIDE { return QModelIndex(); }
- int rowCount(const QModelIndex &) const Q_DECL_OVERRIDE { return 0; }
- int columnCount(const QModelIndex &) const Q_DECL_OVERRIDE { return 0; }
- bool hasChildren(const QModelIndex &) const Q_DECL_OVERRIDE { return false; }
- QVariant data(const QModelIndex &, int) const Q_DECL_OVERRIDE { return QVariant(); }
+ QModelIndex index(int, int, const QModelIndex &) const override { return QModelIndex(); }
+ QModelIndex parent(const QModelIndex &) const override { return QModelIndex(); }
+ int rowCount(const QModelIndex &) const override { return 0; }
+ int columnCount(const QModelIndex &) const override { return 0; }
+ bool hasChildren(const QModelIndex &) const override { return false; }
+ QVariant data(const QModelIndex &, int) const override { return QVariant(); }
};
Q_GLOBAL_STATIC(QEmptyItemModel, qEmptyModel)
diff --git a/src/corelib/itemmodels/qabstractitemmodel.h b/src/corelib/itemmodels/qabstractitemmodel.h
index a211d8e8ca..cd294ef8fa 100644
--- a/src/corelib/itemmodels/qabstractitemmodel.h
+++ b/src/corelib/itemmodels/qabstractitemmodel.h
@@ -55,7 +55,7 @@ class Q_CORE_EXPORT QModelIndex
{
friend class QAbstractItemModel;
public:
- Q_DECL_CONSTEXPR inline QModelIndex() Q_DECL_NOTHROW : r(-1), c(-1), i(0), m(Q_NULLPTR) {}
+ Q_DECL_CONSTEXPR inline QModelIndex() Q_DECL_NOTHROW : 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; }
@@ -69,7 +69,7 @@ public:
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 != Q_NULLPTR); }
+ 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
{ 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
@@ -115,7 +115,7 @@ public:
QPersistentModelIndex &operator=(const QPersistentModelIndex &other);
#ifdef Q_COMPILER_RVALUE_REFS
inline QPersistentModelIndex(QPersistentModelIndex &&other) Q_DECL_NOTHROW
- : d(other.d) { other.d = Q_NULLPTR; }
+ : d(other.d) { other.d = nullptr; }
inline QPersistentModelIndex &operator=(QPersistentModelIndex &&other) Q_DECL_NOTHROW
{ qSwap(d, other.d); return *this; }
#endif
@@ -171,7 +171,7 @@ class Q_CORE_EXPORT QAbstractItemModel : public QObject
friend class QIdentityProxyModel;
public:
- explicit QAbstractItemModel(QObject *parent = Q_NULLPTR);
+ explicit QAbstractItemModel(QObject *parent = nullptr);
virtual ~QAbstractItemModel();
Q_INVOKABLE bool hasIndex(int row, int column, const QModelIndex &parent = QModelIndex()) const;
@@ -286,9 +286,9 @@ protected Q_SLOTS:
void resetInternalData();
protected:
- QAbstractItemModel(QAbstractItemModelPrivate &dd, QObject *parent = Q_NULLPTR);
+ QAbstractItemModel(QAbstractItemModelPrivate &dd, QObject *parent = nullptr);
- inline QModelIndex createIndex(int row, int column, void *data = Q_NULLPTR) const;
+ inline QModelIndex createIndex(int row, int column, void *data = nullptr) const;
inline QModelIndex createIndex(int row, int column, quintptr id) const;
void encodeData(const QModelIndexList &indexes, QDataStream &stream) const;
@@ -367,15 +367,15 @@ class Q_CORE_EXPORT QAbstractTableModel : public QAbstractItemModel
Q_OBJECT
public:
- explicit QAbstractTableModel(QObject *parent = Q_NULLPTR);
+ explicit QAbstractTableModel(QObject *parent = nullptr);
~QAbstractTableModel();
- QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
- QModelIndex sibling(int row, int column, const QModelIndex &idx) const Q_DECL_OVERRIDE;
+ QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override;
+ QModelIndex sibling(int row, int column, const QModelIndex &idx) const override;
bool dropMimeData(const QMimeData *data, Qt::DropAction action,
- int row, int column, const QModelIndex &parent) Q_DECL_OVERRIDE;
+ int row, int column, const QModelIndex &parent) override;
- Qt::ItemFlags flags(const QModelIndex &index) const Q_DECL_OVERRIDE;
+ Qt::ItemFlags flags(const QModelIndex &index) const override;
using QObject::parent;
@@ -384,8 +384,8 @@ protected:
private:
Q_DISABLE_COPY(QAbstractTableModel)
- QModelIndex parent(const QModelIndex &child) const Q_DECL_OVERRIDE;
- bool hasChildren(const QModelIndex &parent) const Q_DECL_OVERRIDE;
+ QModelIndex parent(const QModelIndex &child) const override;
+ bool hasChildren(const QModelIndex &parent) const override;
};
class Q_CORE_EXPORT QAbstractListModel : public QAbstractItemModel
@@ -393,15 +393,15 @@ class Q_CORE_EXPORT QAbstractListModel : public QAbstractItemModel
Q_OBJECT
public:
- explicit QAbstractListModel(QObject *parent = Q_NULLPTR);
+ explicit QAbstractListModel(QObject *parent = nullptr);
~QAbstractListModel();
- QModelIndex index(int row, int column = 0, const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
- QModelIndex sibling(int row, int column, const QModelIndex &idx) const Q_DECL_OVERRIDE;
+ QModelIndex index(int row, int column = 0, const QModelIndex &parent = QModelIndex()) const override;
+ QModelIndex sibling(int row, int column, const QModelIndex &idx) const override;
bool dropMimeData(const QMimeData *data, Qt::DropAction action,
- int row, int column, const QModelIndex &parent) Q_DECL_OVERRIDE;
+ int row, int column, const QModelIndex &parent) override;
- Qt::ItemFlags flags(const QModelIndex &index) const Q_DECL_OVERRIDE;
+ Qt::ItemFlags flags(const QModelIndex &index) const override;
using QObject::parent;
@@ -410,9 +410,9 @@ protected:
private:
Q_DISABLE_COPY(QAbstractListModel)
- QModelIndex parent(const QModelIndex &child) const Q_DECL_OVERRIDE;
- int columnCount(const QModelIndex &parent) const Q_DECL_OVERRIDE;
- bool hasChildren(const QModelIndex &parent) const Q_DECL_OVERRIDE;
+ QModelIndex parent(const QModelIndex &child) const override;
+ int columnCount(const QModelIndex &parent) const override;
+ bool hasChildren(const QModelIndex &parent) const override;
};
// inline implementations
diff --git a/src/corelib/itemmodels/qabstractproxymodel.h b/src/corelib/itemmodels/qabstractproxymodel.h
index c9eafa09ee..6aa82b21ee 100644
--- a/src/corelib/itemmodels/qabstractproxymodel.h
+++ b/src/corelib/itemmodels/qabstractproxymodel.h
@@ -56,7 +56,7 @@ class Q_CORE_EXPORT QAbstractProxyModel : public QAbstractItemModel
Q_PROPERTY(QAbstractItemModel* sourceModel READ sourceModel WRITE setSourceModel NOTIFY sourceModelChanged)
public:
- explicit QAbstractProxyModel(QObject *parent = Q_NULLPTR);
+ explicit QAbstractProxyModel(QObject *parent = nullptr);
~QAbstractProxyModel();
virtual void setSourceModel(QAbstractItemModel *sourceModel);
@@ -68,34 +68,34 @@ public:
Q_INVOKABLE virtual QItemSelection mapSelectionToSource(const QItemSelection &selection) const;
Q_INVOKABLE virtual QItemSelection mapSelectionFromSource(const QItemSelection &selection) const;
- bool submit() Q_DECL_OVERRIDE;
- void revert() Q_DECL_OVERRIDE;
+ bool submit() override;
+ void revert() override;
- QVariant data(const QModelIndex &proxyIndex, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
- QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
- QMap<int, QVariant> itemData(const QModelIndex &index) const Q_DECL_OVERRIDE;
- Qt::ItemFlags flags(const QModelIndex &index) const Q_DECL_OVERRIDE;
+ QVariant data(const QModelIndex &proxyIndex, int role = Qt::DisplayRole) const override;
+ QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
+ QMap<int, QVariant> itemData(const QModelIndex &index) const override;
+ Qt::ItemFlags flags(const QModelIndex &index) const override;
- bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) Q_DECL_OVERRIDE;
- bool setItemData(const QModelIndex& index, const QMap<int, QVariant> &roles) Q_DECL_OVERRIDE;
- bool setHeaderData(int section, Qt::Orientation orientation, const QVariant &value, int role = Qt::EditRole) Q_DECL_OVERRIDE;
+ bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;
+ bool setItemData(const QModelIndex& index, const QMap<int, QVariant> &roles) override;
+ bool setHeaderData(int section, Qt::Orientation orientation, const QVariant &value, int role = Qt::EditRole) override;
- QModelIndex buddy(const QModelIndex &index) const Q_DECL_OVERRIDE;
- bool canFetchMore(const QModelIndex &parent) const Q_DECL_OVERRIDE;
- void fetchMore(const QModelIndex &parent) Q_DECL_OVERRIDE;
- void sort(int column, Qt::SortOrder order = Qt::AscendingOrder) Q_DECL_OVERRIDE;
- QSize span(const QModelIndex &index) const Q_DECL_OVERRIDE;
- bool hasChildren(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
- QModelIndex sibling(int row, int column, const QModelIndex &idx) const Q_DECL_OVERRIDE;
+ QModelIndex buddy(const QModelIndex &index) const override;
+ bool canFetchMore(const QModelIndex &parent) const override;
+ void fetchMore(const QModelIndex &parent) override;
+ void sort(int column, Qt::SortOrder order = Qt::AscendingOrder) override;
+ QSize span(const QModelIndex &index) const override;
+ bool hasChildren(const QModelIndex &parent = QModelIndex()) const override;
+ QModelIndex sibling(int row, int column, const QModelIndex &idx) const override;
- QMimeData* mimeData(const QModelIndexList &indexes) const Q_DECL_OVERRIDE;
+ QMimeData* mimeData(const QModelIndexList &indexes) const override;
bool canDropMimeData(const QMimeData *data, Qt::DropAction action,
- int row, int column, const QModelIndex &parent) const Q_DECL_OVERRIDE;
+ int row, int column, const QModelIndex &parent) const override;
bool dropMimeData(const QMimeData *data, Qt::DropAction action,
- int row, int column, const QModelIndex &parent) Q_DECL_OVERRIDE;
- QStringList mimeTypes() const Q_DECL_OVERRIDE;
- Qt::DropActions supportedDragActions() const Q_DECL_OVERRIDE;
- Qt::DropActions supportedDropActions() const Q_DECL_OVERRIDE;
+ int row, int column, const QModelIndex &parent) override;
+ QStringList mimeTypes() const override;
+ Qt::DropActions supportedDragActions() const override;
+ Qt::DropActions supportedDropActions() const override;
Q_SIGNALS:
void sourceModelChanged(QPrivateSignal);
diff --git a/src/corelib/itemmodels/qidentityproxymodel.h b/src/corelib/itemmodels/qidentityproxymodel.h
index e93740c1a2..d2b1ed9498 100644
--- a/src/corelib/itemmodels/qidentityproxymodel.h
+++ b/src/corelib/itemmodels/qidentityproxymodel.h
@@ -54,29 +54,29 @@ class Q_CORE_EXPORT QIdentityProxyModel : public QAbstractProxyModel
{
Q_OBJECT
public:
- explicit QIdentityProxyModel(QObject* parent = Q_NULLPTR);
+ explicit QIdentityProxyModel(QObject* parent = nullptr);
~QIdentityProxyModel();
- int columnCount(const QModelIndex& parent = QModelIndex()) const Q_DECL_OVERRIDE;
- QModelIndex index(int row, int column, const QModelIndex& parent = QModelIndex()) const Q_DECL_OVERRIDE;
- QModelIndex mapFromSource(const QModelIndex& sourceIndex) const Q_DECL_OVERRIDE;
- QModelIndex mapToSource(const QModelIndex& proxyIndex) const Q_DECL_OVERRIDE;
- QModelIndex parent(const QModelIndex& child) const Q_DECL_OVERRIDE;
+ int columnCount(const QModelIndex& parent = QModelIndex()) const override;
+ QModelIndex index(int row, int column, const QModelIndex& parent = QModelIndex()) const override;
+ QModelIndex mapFromSource(const QModelIndex& sourceIndex) const override;
+ QModelIndex mapToSource(const QModelIndex& proxyIndex) const override;
+ QModelIndex parent(const QModelIndex& child) const override;
using QObject::parent;
- int rowCount(const QModelIndex& parent = QModelIndex()) const Q_DECL_OVERRIDE;
- QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
- bool dropMimeData(const QMimeData* data, Qt::DropAction action, int row, int column, const QModelIndex& parent) Q_DECL_OVERRIDE;
- QModelIndex sibling(int row, int column, const QModelIndex &idx) const Q_DECL_OVERRIDE;
-
- QItemSelection mapSelectionFromSource(const QItemSelection& selection) const Q_DECL_OVERRIDE;
- QItemSelection mapSelectionToSource(const QItemSelection& selection) const Q_DECL_OVERRIDE;
- QModelIndexList match(const QModelIndex& start, int role, const QVariant& value, int hits = 1, Qt::MatchFlags flags = Qt::MatchFlags(Qt::MatchStartsWith|Qt::MatchWrap)) const Q_DECL_OVERRIDE;
- void setSourceModel(QAbstractItemModel* sourceModel) Q_DECL_OVERRIDE;
-
- bool insertColumns(int column, int count, const QModelIndex& parent = QModelIndex()) Q_DECL_OVERRIDE;
- bool insertRows(int row, int count, const QModelIndex& parent = QModelIndex()) Q_DECL_OVERRIDE;
- bool removeColumns(int column, int count, const QModelIndex& parent = QModelIndex()) Q_DECL_OVERRIDE;
- bool removeRows(int row, int count, const QModelIndex& parent = QModelIndex()) Q_DECL_OVERRIDE;
+ int rowCount(const QModelIndex& parent = QModelIndex()) const override;
+ QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
+ bool dropMimeData(const QMimeData* data, Qt::DropAction action, int row, int column, const QModelIndex& parent) override;
+ QModelIndex sibling(int row, int column, const QModelIndex &idx) const override;
+
+ QItemSelection mapSelectionFromSource(const QItemSelection& selection) const override;
+ QItemSelection mapSelectionToSource(const QItemSelection& selection) const override;
+ QModelIndexList match(const QModelIndex& start, int role, const QVariant& value, int hits = 1, Qt::MatchFlags flags = Qt::MatchFlags(Qt::MatchStartsWith|Qt::MatchWrap)) const override;
+ void setSourceModel(QAbstractItemModel* sourceModel) override;
+
+ bool insertColumns(int column, int count, const QModelIndex& parent = QModelIndex()) override;
+ bool insertRows(int row, int count, const QModelIndex& parent = QModelIndex()) override;
+ bool removeColumns(int column, int count, const QModelIndex& parent = QModelIndex()) override;
+ bool removeRows(int row, int count, const QModelIndex& parent = QModelIndex()) override;
protected:
QIdentityProxyModel(QIdentityProxyModelPrivate &dd, QObject* parent);
diff --git a/src/corelib/itemmodels/qitemselectionmodel.h b/src/corelib/itemmodels/qitemselectionmodel.h
index 9d33303ddc..091c5a21a5 100644
--- a/src/corelib/itemmodels/qitemselectionmodel.h
+++ b/src/corelib/itemmodels/qitemselectionmodel.h
@@ -164,7 +164,7 @@ public:
Q_DECLARE_FLAGS(SelectionFlags, SelectionFlag)
Q_FLAG(SelectionFlags)
- explicit QItemSelectionModel(QAbstractItemModel *model = Q_NULLPTR);
+ explicit QItemSelectionModel(QAbstractItemModel *model = nullptr);
explicit QItemSelectionModel(QAbstractItemModel *model, QObject *parent);
virtual ~QItemSelectionModel();
diff --git a/src/corelib/itemmodels/qsortfilterproxymodel.cpp b/src/corelib/itemmodels/qsortfilterproxymodel.cpp
index ef3281df30..fad980f568 100644
--- a/src/corelib/itemmodels/qsortfilterproxymodel.cpp
+++ b/src/corelib/itemmodels/qsortfilterproxymodel.cpp
@@ -300,7 +300,7 @@ public:
void updateChildrenMapping(const QModelIndex &source_parent, Mapping *parent_mapping,
Qt::Orientation orient, int start, int end, int delta_item_count, bool remove);
- virtual void _q_sourceModelDestroyed() Q_DECL_OVERRIDE;
+ virtual void _q_sourceModelDestroyed() override;
bool needsReorder(const QVector<int> &source_rows, const QModelIndex &source_parent) const;
diff --git a/src/corelib/itemmodels/qsortfilterproxymodel.h b/src/corelib/itemmodels/qsortfilterproxymodel.h
index 6f2e9806ed..2f93836544 100644
--- a/src/corelib/itemmodels/qsortfilterproxymodel.h
+++ b/src/corelib/itemmodels/qsortfilterproxymodel.h
@@ -70,16 +70,16 @@ class Q_CORE_EXPORT QSortFilterProxyModel : public QAbstractProxyModel
Q_PROPERTY(bool recursiveFiltering READ recursiveFiltering WRITE setRecursiveFiltering)
public:
- explicit QSortFilterProxyModel(QObject *parent = Q_NULLPTR);
+ explicit QSortFilterProxyModel(QObject *parent = nullptr);
~QSortFilterProxyModel();
- void setSourceModel(QAbstractItemModel *sourceModel) Q_DECL_OVERRIDE;
+ void setSourceModel(QAbstractItemModel *sourceModel) override;
- QModelIndex mapToSource(const QModelIndex &proxyIndex) const Q_DECL_OVERRIDE;
- QModelIndex mapFromSource(const QModelIndex &sourceIndex) const Q_DECL_OVERRIDE;
+ QModelIndex mapToSource(const QModelIndex &proxyIndex) const override;
+ QModelIndex mapFromSource(const QModelIndex &sourceIndex) const override;
- QItemSelection mapSelectionToSource(const QItemSelection &proxySelection) const Q_DECL_OVERRIDE;
- QItemSelection mapSelectionFromSource(const QItemSelection &sourceSelection) const Q_DECL_OVERRIDE;
+ QItemSelection mapSelectionToSource(const QItemSelection &proxySelection) const override;
+ QItemSelection mapSelectionFromSource(const QItemSelection &sourceSelection) const override;
QRegExp filterRegExp() const;
void setFilterRegExp(const QRegExp &regExp);
@@ -129,44 +129,44 @@ protected:
public:
using QObject::parent;
- QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
- QModelIndex parent(const QModelIndex &child) const Q_DECL_OVERRIDE;
- QModelIndex sibling(int row, int column, const QModelIndex &idx) const Q_DECL_OVERRIDE;
+ QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override;
+ QModelIndex parent(const QModelIndex &child) const override;
+ QModelIndex sibling(int row, int column, const QModelIndex &idx) const override;
- int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
- int columnCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
- bool hasChildren(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
+ int rowCount(const QModelIndex &parent = QModelIndex()) const override;
+ int columnCount(const QModelIndex &parent = QModelIndex()) const override;
+ bool hasChildren(const QModelIndex &parent = QModelIndex()) const override;
- QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
- bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) Q_DECL_OVERRIDE;
+ QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
+ bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;
- QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
+ QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
bool setHeaderData(int section, Qt::Orientation orientation,
- const QVariant &value, int role = Qt::EditRole) Q_DECL_OVERRIDE;
+ const QVariant &value, int role = Qt::EditRole) override;
- QMimeData *mimeData(const QModelIndexList &indexes) const Q_DECL_OVERRIDE;
+ QMimeData *mimeData(const QModelIndexList &indexes) const override;
bool dropMimeData(const QMimeData *data, Qt::DropAction action,
- int row, int column, const QModelIndex &parent) Q_DECL_OVERRIDE;
+ int row, int column, const QModelIndex &parent) override;
- bool insertRows(int row, int count, const QModelIndex &parent = QModelIndex()) Q_DECL_OVERRIDE;
- bool insertColumns(int column, int count, const QModelIndex &parent = QModelIndex()) Q_DECL_OVERRIDE;
- bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()) Q_DECL_OVERRIDE;
- bool removeColumns(int column, int count, const QModelIndex &parent = QModelIndex()) Q_DECL_OVERRIDE;
+ bool insertRows(int row, int count, const QModelIndex &parent = QModelIndex()) override;
+ bool insertColumns(int column, int count, const QModelIndex &parent = QModelIndex()) override;
+ bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()) override;
+ bool removeColumns(int column, int count, const QModelIndex &parent = QModelIndex()) override;
- void fetchMore(const QModelIndex &parent) Q_DECL_OVERRIDE;
- bool canFetchMore(const QModelIndex &parent) const Q_DECL_OVERRIDE;
- Qt::ItemFlags flags(const QModelIndex &index) const Q_DECL_OVERRIDE;
+ void fetchMore(const QModelIndex &parent) override;
+ bool canFetchMore(const QModelIndex &parent) const override;
+ Qt::ItemFlags flags(const QModelIndex &index) const override;
- QModelIndex buddy(const QModelIndex &index) const Q_DECL_OVERRIDE;
+ QModelIndex buddy(const QModelIndex &index) const override;
QModelIndexList match(const QModelIndex &start, int role,
const QVariant &value, int hits = 1,
Qt::MatchFlags flags =
- Qt::MatchFlags(Qt::MatchStartsWith|Qt::MatchWrap)) const Q_DECL_OVERRIDE;
- QSize span(const QModelIndex &index) const Q_DECL_OVERRIDE;
- void sort(int column, Qt::SortOrder order = Qt::AscendingOrder) Q_DECL_OVERRIDE;
+ Qt::MatchFlags(Qt::MatchStartsWith|Qt::MatchWrap)) const override;
+ QSize span(const QModelIndex &index) const override;
+ void sort(int column, Qt::SortOrder order = Qt::AscendingOrder) override;
- QStringList mimeTypes() const Q_DECL_OVERRIDE;
- Qt::DropActions supportedDropActions() const Q_DECL_OVERRIDE;
+ QStringList mimeTypes() const override;
+ Qt::DropActions supportedDropActions() const override;
private:
Q_DECLARE_PRIVATE(QSortFilterProxyModel)
Q_DISABLE_COPY(QSortFilterProxyModel)
diff --git a/src/corelib/itemmodels/qstringlistmodel.h b/src/corelib/itemmodels/qstringlistmodel.h
index 3bda848f48..38da1022ea 100644
--- a/src/corelib/itemmodels/qstringlistmodel.h
+++ b/src/corelib/itemmodels/qstringlistmodel.h
@@ -52,26 +52,26 @@ class Q_CORE_EXPORT QStringListModel : public QAbstractListModel
{
Q_OBJECT
public:
- explicit QStringListModel(QObject *parent = Q_NULLPTR);
- explicit QStringListModel(const QStringList &strings, QObject *parent = Q_NULLPTR);
+ explicit QStringListModel(QObject *parent = nullptr);
+ explicit QStringListModel(const QStringList &strings, QObject *parent = nullptr);
- int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
- QModelIndex sibling(int row, int column, const QModelIndex &idx) const Q_DECL_OVERRIDE;
+ int rowCount(const QModelIndex &parent = QModelIndex()) const override;
+ QModelIndex sibling(int row, int column, const QModelIndex &idx) const override;
- QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
- bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) Q_DECL_OVERRIDE;
+ QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
+ bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;
- Qt::ItemFlags flags(const QModelIndex &index) const Q_DECL_OVERRIDE;
+ Qt::ItemFlags flags(const QModelIndex &index) const override;
- bool insertRows(int row, int count, const QModelIndex &parent = QModelIndex()) Q_DECL_OVERRIDE;
- bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()) Q_DECL_OVERRIDE;
+ bool insertRows(int row, int count, const QModelIndex &parent = QModelIndex()) override;
+ bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()) override;
- void sort(int column, Qt::SortOrder order = Qt::AscendingOrder) Q_DECL_OVERRIDE;
+ void sort(int column, Qt::SortOrder order = Qt::AscendingOrder) override;
QStringList stringList() const;
void setStringList(const QStringList &strings);
- Qt::DropActions supportedDropActions() const Q_DECL_OVERRIDE;
+ Qt::DropActions supportedDropActions() const override;
private:
Q_DISABLE_COPY(QStringListModel)
diff --git a/src/corelib/json/qjsonarray.h b/src/corelib/json/qjsonarray.h
index ddba2ca78e..8d41138c97 100644
--- a/src/corelib/json/qjsonarray.h
+++ b/src/corelib/json/qjsonarray.h
@@ -133,7 +133,7 @@ public:
typedef QJsonValueRef reference;
typedef QJsonValueRefPtr pointer;
- inline iterator() : a(Q_NULLPTR), i(0) { }
+ inline iterator() : a(nullptr), i(0) { }
explicit inline iterator(QJsonArray *array, int index) : a(array), i(index) { }
inline QJsonValueRef operator*() const { return QJsonValueRef(a, i); }
@@ -178,7 +178,7 @@ public:
typedef QJsonValue reference;
typedef QJsonValuePtr pointer;
- inline const_iterator() : a(Q_NULLPTR), i(0) { }
+ inline const_iterator() : a(nullptr), i(0) { }
explicit inline const_iterator(const QJsonArray *array, int index) : a(array), i(index) { }
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
inline const_iterator(const const_iterator &o) : a(o.a), i(o.i) {} // ### Qt 6: Removed so class can be trivially-copyable
diff --git a/src/corelib/json/qjsondocument.cpp b/src/corelib/json/qjsondocument.cpp
index 6469412054..9794bca60d 100644
--- a/src/corelib/json/qjsondocument.cpp
+++ b/src/corelib/json/qjsondocument.cpp
@@ -332,7 +332,7 @@ QVariant QJsonDocument::toVariant() const
\sa fromJson()
*/
-#ifndef QT_JSON_READONLY
+#if !defined(QT_JSON_READONLY) || defined(Q_CLANG_QDOC)
QByteArray QJsonDocument::toJson() const
{
return toJson(Indented);
@@ -369,7 +369,7 @@ QByteArray QJsonDocument::toJson() const
\sa fromJson(), JsonFormat
*/
-#ifndef QT_JSON_READONLY
+#if !defined(QT_JSON_READONLY) || defined(Q_CLANG_QDOC)
QByteArray QJsonDocument::toJson(JsonFormat format) const
{
QByteArray json;
diff --git a/src/corelib/json/qjsondocument.h b/src/corelib/json/qjsondocument.h
index 4e76af21e2..b784890c54 100644
--- a/src/corelib/json/qjsondocument.h
+++ b/src/corelib/json/qjsondocument.h
@@ -129,11 +129,9 @@ public:
Compact
};
- static QJsonDocument fromJson(const QByteArray &json, QJsonParseError *error = Q_NULLPTR);
+ static QJsonDocument fromJson(const QByteArray &json, QJsonParseError *error = nullptr);
-#ifdef Q_QDOC
- QByteArray toJson(JsonFormat format = Indented) const;
-#elif !defined(QT_JSON_READONLY)
+#if !defined(QT_JSON_READONLY) || defined(Q_CLANG_QDOC)
QByteArray toJson() const; //### Merge in Qt6
QByteArray toJson(JsonFormat format) const;
#endif
diff --git a/src/corelib/json/qjsonobject.h b/src/corelib/json/qjsonobject.h
index c77e2164a8..610bce694c 100644
--- a/src/corelib/json/qjsonobject.h
+++ b/src/corelib/json/qjsonobject.h
@@ -135,7 +135,7 @@ public:
typedef QJsonValueRef reference;
typedef QJsonValuePtr pointer;
- Q_DECL_CONSTEXPR inline iterator() : o(Q_NULLPTR), i(0) {}
+ Q_DECL_CONSTEXPR inline iterator() : o(nullptr), i(0) {}
Q_DECL_CONSTEXPR inline iterator(QJsonObject *obj, int index) : o(obj), i(index) {}
inline QString key() const { return o->keyAt(i); }
@@ -178,7 +178,7 @@ public:
typedef QJsonValue reference;
typedef QJsonValuePtr pointer;
- Q_DECL_CONSTEXPR inline const_iterator() : o(Q_NULLPTR), i(0) {}
+ Q_DECL_CONSTEXPR inline const_iterator() : o(nullptr), i(0) {}
Q_DECL_CONSTEXPR inline const_iterator(const QJsonObject *obj, int index)
: o(obj), i(index) {}
inline const_iterator(const iterator &other)
diff --git a/src/corelib/json/qjsonvalue.h b/src/corelib/json/qjsonvalue.h
index 5d5ec72605..96538ebbf9 100644
--- a/src/corelib/json/qjsonvalue.h
+++ b/src/corelib/json/qjsonvalue.h
@@ -82,7 +82,7 @@ public:
QJsonValue(QLatin1String s);
#ifndef QT_NO_CAST_FROM_ASCII
inline QT_ASCII_CAST_WARN QJsonValue(const char *s)
- : d(Q_NULLPTR), t(String) { stringDataFromQStringHelper(QString::fromUtf8(s)); }
+ : d(nullptr), t(String) { stringDataFromQStringHelper(QString::fromUtf8(s)); }
#endif
QJsonValue(const QJsonArray &a);
QJsonValue(const QJsonObject &o);
diff --git a/src/corelib/kernel/qabstracteventdispatcher.h b/src/corelib/kernel/qabstracteventdispatcher.h
index 3a530cf1de..b84e047f3f 100644
--- a/src/corelib/kernel/qabstracteventdispatcher.h
+++ b/src/corelib/kernel/qabstracteventdispatcher.h
@@ -70,10 +70,10 @@ public:
{ }
};
- explicit QAbstractEventDispatcher(QObject *parent = Q_NULLPTR);
+ explicit QAbstractEventDispatcher(QObject *parent = nullptr);
~QAbstractEventDispatcher();
- static QAbstractEventDispatcher *instance(QThread *thread = Q_NULLPTR);
+ static QAbstractEventDispatcher *instance(QThread *thread = nullptr);
virtual bool processEvents(QEventLoop::ProcessEventsFlags flags) = 0;
virtual bool hasPendingEvents() = 0; // ### Qt6: remove, mark final or make protected
@@ -112,7 +112,7 @@ public:
bool filterNativeEvent(const QByteArray &eventType, void *message, long *result);
#if QT_DEPRECATED_SINCE(5, 0)
QT_DEPRECATED bool filterEvent(void *message)
- { return filterNativeEvent("", message, Q_NULLPTR); }
+ { return filterNativeEvent("", message, nullptr); }
#endif
Q_SIGNALS:
diff --git a/src/corelib/kernel/qcore_unix.cpp b/src/corelib/kernel/qcore_unix.cpp
index 3b0da136ca..eb98cbef8f 100644
--- a/src/corelib/kernel/qcore_unix.cpp
+++ b/src/corelib/kernel/qcore_unix.cpp
@@ -130,7 +130,7 @@ int qt_safe_poll(struct pollfd *fds, nfds_t nfds, const struct timespec *timeout
if (!timeout_ts) {
// no timeout -> block forever
int ret;
- EINTR_LOOP(ret, qt_ppoll(fds, nfds, Q_NULLPTR));
+ EINTR_LOOP(ret, qt_ppoll(fds, nfds, nullptr));
return ret;
}
diff --git a/src/corelib/kernel/qcore_unix_p.h b/src/corelib/kernel/qcore_unix_p.h
index f78d2b9f24..e538a7e22b 100644
--- a/src/corelib/kernel/qcore_unix_p.h
+++ b/src/corelib/kernel/qcore_unix_p.h
@@ -362,7 +362,7 @@ Q_CORE_EXPORT int qt_safe_poll(struct pollfd *fds, nfds_t nfds, const struct tim
static inline int qt_poll_msecs(struct pollfd *fds, nfds_t nfds, int timeout)
{
- timespec ts, *pts = Q_NULLPTR;
+ timespec ts, *pts = nullptr;
if (timeout >= 0) {
ts.tv_sec = timeout / 1000;
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
index 350be50082..a3342ecd5f 100644
--- a/src/corelib/kernel/qcoreapplication.cpp
+++ b/src/corelib/kernel/qcoreapplication.cpp
@@ -449,7 +449,7 @@ QCoreApplicationPrivate::QCoreApplicationPrivate(int &aargc, char **aargv, uint
, argv(aargv)
#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
, origArgc(0)
- , origArgv(Q_NULLPTR)
+ , origArgv(nullptr)
#endif
, application_type(QCoreApplicationPrivate::Tty)
#ifndef QT_NO_QOBJECT
diff --git a/src/corelib/kernel/qcoreapplication.h b/src/corelib/kernel/qcoreapplication.h
index 6555733c4e..a886c9d1d2 100644
--- a/src/corelib/kernel/qcoreapplication.h
+++ b/src/corelib/kernel/qcoreapplication.h
@@ -123,7 +123,7 @@ public:
static bool sendEvent(QObject *receiver, QEvent *event);
static void postEvent(QObject *receiver, QEvent *event, int priority = Qt::NormalEventPriority);
- static void sendPostedEvents(QObject *receiver = Q_NULLPTR, int event_type = 0);
+ static void sendPostedEvents(QObject *receiver = nullptr, int event_type = 0);
static void removePostedEvents(QObject *receiver, int eventType = 0);
#if QT_DEPRECATED_SINCE(5, 3)
QT_DEPRECATED static bool hasPendingEvents();
@@ -155,7 +155,7 @@ public:
static QString translate(const char * context,
const char * key,
- const char * disambiguation = Q_NULLPTR,
+ const char * disambiguation = nullptr,
int n = -1);
#if QT_DEPRECATED_SINCE(5, 0)
enum Encoding { UnicodeUTF8, Latin1, DefaultCodec = UnicodeUTF8, CodecForTr = UnicodeUTF8 };
@@ -187,7 +187,7 @@ Q_SIGNALS:
void applicationVersionChanged();
protected:
- bool event(QEvent *) Q_DECL_OVERRIDE;
+ bool event(QEvent *) override;
virtual bool compressEvent(QEvent *, QObject *receiver, QPostEventList *);
#endif // QT_NO_QOBJECT
@@ -241,13 +241,13 @@ inline bool QCoreApplication::sendSpontaneousEvent(QObject *receiver, QEvent *ev
# define QT_DECLARE_DEPRECATED_TR_FUNCTIONS(context)
#else
# define QT_DECLARE_DEPRECATED_TR_FUNCTIONS(context) \
- QT_DEPRECATED static inline QString trUtf8(const char *sourceText, const char *disambiguation = Q_NULLPTR, int n = -1) \
+ QT_DEPRECATED static inline QString trUtf8(const char *sourceText, const char *disambiguation = nullptr, int n = -1) \
{ return QCoreApplication::translate(#context, sourceText, disambiguation, n); }
#endif
#define Q_DECLARE_TR_FUNCTIONS(context) \
public: \
- static inline QString tr(const char *sourceText, const char *disambiguation = Q_NULLPTR, int n = -1) \
+ static inline QString tr(const char *sourceText, const char *disambiguation = nullptr, int n = -1) \
{ return QCoreApplication::translate(#context, sourceText, disambiguation, n); } \
QT_DECLARE_DEPRECATED_TR_FUNCTIONS(context) \
private:
diff --git a/src/corelib/kernel/qeventdispatcher_glib_p.h b/src/corelib/kernel/qeventdispatcher_glib_p.h
index 8e9925d7a5..799f23b14a 100644
--- a/src/corelib/kernel/qeventdispatcher_glib_p.h
+++ b/src/corelib/kernel/qeventdispatcher_glib_p.h
@@ -70,22 +70,22 @@ public:
explicit QEventDispatcherGlib(GMainContext *context, QObject *parent = 0);
~QEventDispatcherGlib();
- bool processEvents(QEventLoop::ProcessEventsFlags flags) Q_DECL_OVERRIDE;
- bool hasPendingEvents() Q_DECL_OVERRIDE;
+ bool processEvents(QEventLoop::ProcessEventsFlags flags) override;
+ bool hasPendingEvents() override;
- void registerSocketNotifier(QSocketNotifier *socketNotifier) Q_DECL_FINAL;
- void unregisterSocketNotifier(QSocketNotifier *socketNotifier) Q_DECL_FINAL;
+ void registerSocketNotifier(QSocketNotifier *socketNotifier) final;
+ void unregisterSocketNotifier(QSocketNotifier *socketNotifier) final;
- void registerTimer(int timerId, int interval, Qt::TimerType timerType, QObject *object) Q_DECL_FINAL;
- bool unregisterTimer(int timerId) Q_DECL_FINAL;
- bool unregisterTimers(QObject *object) Q_DECL_FINAL;
- QList<TimerInfo> registeredTimers(QObject *object) const Q_DECL_FINAL;
+ void registerTimer(int timerId, int interval, Qt::TimerType timerType, QObject *object) final;
+ bool unregisterTimer(int timerId) final;
+ bool unregisterTimers(QObject *object) final;
+ QList<TimerInfo> registeredTimers(QObject *object) const final;
- int remainingTime(int timerId) Q_DECL_FINAL;
+ int remainingTime(int timerId) final;
- void wakeUp() Q_DECL_FINAL;
- void interrupt() Q_DECL_FINAL;
- void flush() Q_DECL_FINAL;
+ void wakeUp() final;
+ void interrupt() final;
+ void flush() final;
static bool versionSupported();
diff --git a/src/corelib/kernel/qeventdispatcher_unix_p.h b/src/corelib/kernel/qeventdispatcher_unix_p.h
index bcf5b10baa..0fd068b074 100644
--- a/src/corelib/kernel/qeventdispatcher_unix_p.h
+++ b/src/corelib/kernel/qeventdispatcher_unix_p.h
@@ -62,7 +62,7 @@ QT_BEGIN_NAMESPACE
class QEventDispatcherUNIXPrivate;
-struct Q_CORE_EXPORT QSocketNotifierSetUNIX Q_DECL_FINAL
+struct Q_CORE_EXPORT QSocketNotifierSetUNIX final
{
inline QSocketNotifierSetUNIX() Q_DECL_NOTHROW;
@@ -105,22 +105,22 @@ public:
explicit QEventDispatcherUNIX(QObject *parent = 0);
~QEventDispatcherUNIX();
- bool processEvents(QEventLoop::ProcessEventsFlags flags) Q_DECL_OVERRIDE;
- bool hasPendingEvents() Q_DECL_OVERRIDE;
+ bool processEvents(QEventLoop::ProcessEventsFlags flags) override;
+ bool hasPendingEvents() override;
- void registerSocketNotifier(QSocketNotifier *notifier) Q_DECL_FINAL;
- void unregisterSocketNotifier(QSocketNotifier *notifier) Q_DECL_FINAL;
+ void registerSocketNotifier(QSocketNotifier *notifier) final;
+ void unregisterSocketNotifier(QSocketNotifier *notifier) final;
- void registerTimer(int timerId, int interval, Qt::TimerType timerType, QObject *object) Q_DECL_FINAL;
- bool unregisterTimer(int timerId) Q_DECL_FINAL;
- bool unregisterTimers(QObject *object) Q_DECL_FINAL;
- QList<TimerInfo> registeredTimers(QObject *object) const Q_DECL_FINAL;
+ void registerTimer(int timerId, int interval, Qt::TimerType timerType, QObject *object) final;
+ bool unregisterTimer(int timerId) final;
+ bool unregisterTimers(QObject *object) final;
+ QList<TimerInfo> registeredTimers(QObject *object) const final;
- int remainingTime(int timerId) Q_DECL_FINAL;
+ int remainingTime(int timerId) final;
- void wakeUp() Q_DECL_FINAL;
- void interrupt() Q_DECL_FINAL;
- void flush() Q_DECL_OVERRIDE;
+ void wakeUp() final;
+ void interrupt() final;
+ void flush() override;
protected:
QEventDispatcherUNIX(QEventDispatcherUNIXPrivate &dd, QObject *parent = 0);
diff --git a/src/corelib/kernel/qeventloop.h b/src/corelib/kernel/qeventloop.h
index e62b1d8419..eb1348220b 100644
--- a/src/corelib/kernel/qeventloop.h
+++ b/src/corelib/kernel/qeventloop.h
@@ -53,7 +53,7 @@ class Q_CORE_EXPORT QEventLoop : public QObject
Q_DECLARE_PRIVATE(QEventLoop)
public:
- explicit QEventLoop(QObject *parent = Q_NULLPTR);
+ explicit QEventLoop(QObject *parent = nullptr);
~QEventLoop();
enum ProcessEventsFlag {
@@ -76,7 +76,7 @@ public:
void wakeUp();
- bool event(QEvent *event) Q_DECL_OVERRIDE;
+ bool event(QEvent *event) override;
public Q_SLOTS:
void quit();
diff --git a/src/corelib/kernel/qfunctions_vxworks.h b/src/corelib/kernel/qfunctions_vxworks.h
index 34630a735b..86f243959f 100644
--- a/src/corelib/kernel/qfunctions_vxworks.h
+++ b/src/corelib/kernel/qfunctions_vxworks.h
@@ -62,9 +62,6 @@
#include <sys/stat.h>
#include <sys/wait.h>
#include <netinet/in.h>
-#ifndef QT_NO_IPV6IFNAME
-#include <net/if.h>
-#endif
// VxWorks has public header mbuf.h which defines following variables for DKM.
// Let's undef those to because they overlap with Qt variable names-
diff --git a/src/corelib/kernel/qjni.cpp b/src/corelib/kernel/qjni.cpp
index 60154328c2..75a2436d9d 100644
--- a/src/corelib/kernel/qjni.cpp
+++ b/src/corelib/kernel/qjni.cpp
@@ -260,7 +260,7 @@ QJNIEnvironmentPrivate::QJNIEnvironmentPrivate()
return;
if (ret == JNI_EDETACHED) { // We need to (re-)attach
- JavaVMAttachArgs args = { JNI_VERSION_1_6, qJniThreadName, Q_NULLPTR };
+ JavaVMAttachArgs args = { JNI_VERSION_1_6, qJniThreadName, nullptr };
if (vm->AttachCurrentThread(&jniEnv, &args) != JNI_OK)
return;
diff --git a/src/corelib/kernel/qjnihelpers.cpp b/src/corelib/kernel/qjnihelpers.cpp
index 02c58858ff..c7109a6506 100644
--- a/src/corelib/kernel/qjnihelpers.cpp
+++ b/src/corelib/kernel/qjnihelpers.cpp
@@ -64,14 +64,14 @@ namespace QtAndroidPrivate {
KeyEventListener::~KeyEventListener() {}
}
-static JavaVM *g_javaVM = Q_NULLPTR;
-static jobject g_jActivity = Q_NULLPTR;
-static jobject g_jService = Q_NULLPTR;
-static jobject g_jClassLoader = Q_NULLPTR;
+static JavaVM *g_javaVM = nullptr;
+static jobject g_jActivity = nullptr;
+static jobject g_jService = nullptr;
+static jobject g_jClassLoader = nullptr;
static jint g_androidSdkVersion = 0;
-static jclass g_jNativeClass = Q_NULLPTR;
-static jmethodID g_runPendingCppRunnablesMethodID = Q_NULLPTR;
-static jmethodID g_hideSplashScreenMethodID = Q_NULLPTR;
+static jclass g_jNativeClass = nullptr;
+static jmethodID g_runPendingCppRunnablesMethodID = nullptr;
+static jmethodID g_hideSplashScreenMethodID = nullptr;
Q_GLOBAL_STATIC(std::deque<QtAndroidPrivate::Runnable>, g_pendingRunnables);
static QBasicMutex g_pendingRunnablesMutex;
diff --git a/src/corelib/kernel/qjnionload.cpp b/src/corelib/kernel/qjnionload.cpp
index 8f60800dba..0550b86553 100644
--- a/src/corelib/kernel/qjnionload.cpp
+++ b/src/corelib/kernel/qjnionload.cpp
@@ -61,7 +61,7 @@ Q_CORE_EXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved)
__android_log_print(ANDROID_LOG_INFO, logTag, "Start");
_JNIEnv uenv;
- uenv.venv = Q_NULLPTR;
+ uenv.venv = nullptr;
if (vm->GetEnv(&uenv.venv, JNI_VERSION_1_6) != JNI_OK)
{
diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp
index f07b463482..f24a511295 100644
--- a/src/corelib/kernel/qmetaobject.cpp
+++ b/src/corelib/kernel/qmetaobject.cpp
@@ -1589,7 +1589,7 @@ bool QMetaObject::invokeMethodImpl(QObject *object, QtPrivate::QSlotObjectBase *
*/
/*!
- \fn bool QMetaObject::invokeMethod(QObject *receiver, PointerToMemberFunction function, Qt::ConnectionType type = Qt::AutoConnection, MemberFunctionReturnType *ret = Q_NULLPTR)
+ \fn bool QMetaObject::invokeMethod(QObject *receiver, PointerToMemberFunction function, Qt::ConnectionType type = Qt::AutoConnection, MemberFunctionReturnType *ret = nullptr)
\since 5.10
@@ -1607,7 +1607,7 @@ bool QMetaObject::invokeMethodImpl(QObject *object, QtPrivate::QSlotObjectBase *
*/
/*!
- \fn bool QMetaObject::invokeMethod(QObject *context, Functor function, Qt::ConnectionType type = Qt::AutoConnection, FunctorReturnType *ret = Q_NULLPTR)
+ \fn bool QMetaObject::invokeMethod(QObject *context, Functor function, Qt::ConnectionType type = Qt::AutoConnection, FunctorReturnType *ret = nullptr)
\since 5.10
@@ -1617,7 +1617,7 @@ bool QMetaObject::invokeMethodImpl(QObject *object, QtPrivate::QSlotObjectBase *
*/
/*!
- \fn bool QMetaObject::invokeMethod(QObject *context, Functor function, FunctorReturnType *ret = Q_NULLPTR)
+ \fn bool QMetaObject::invokeMethod(QObject *context, Functor function, FunctorReturnType *ret = nullptr)
\since 5.10
diff --git a/src/corelib/kernel/qmetaobject.h b/src/corelib/kernel/qmetaobject.h
index 40b2aa6402..51df8faad3 100644
--- a/src/corelib/kernel/qmetaobject.h
+++ b/src/corelib/kernel/qmetaobject.h
@@ -54,7 +54,7 @@ template <typename T> class QList;
class Q_CORE_EXPORT QMetaMethod
{
public:
- Q_DECL_CONSTEXPR inline QMetaMethod() : mobj(Q_NULLPTR), handle(0) {}
+ Q_DECL_CONSTEXPR inline QMetaMethod() : mobj(nullptr), handle(0) {}
QByteArray methodSignature() const;
QByteArray name() const;
@@ -80,7 +80,7 @@ public:
bool invoke(QObject *object,
Qt::ConnectionType connectionType,
QGenericReturnArgument returnValue,
- QGenericArgument val0 = QGenericArgument(Q_NULLPTR),
+ QGenericArgument val0 = QGenericArgument(nullptr),
QGenericArgument val1 = QGenericArgument(),
QGenericArgument val2 = QGenericArgument(),
QGenericArgument val3 = QGenericArgument(),
@@ -92,7 +92,7 @@ public:
QGenericArgument val9 = QGenericArgument()) const;
inline bool invoke(QObject *object,
QGenericReturnArgument returnValue,
- QGenericArgument val0 = QGenericArgument(Q_NULLPTR),
+ QGenericArgument val0 = QGenericArgument(nullptr),
QGenericArgument val1 = QGenericArgument(),
QGenericArgument val2 = QGenericArgument(),
QGenericArgument val3 = QGenericArgument(),
@@ -108,7 +108,7 @@ public:
}
inline bool invoke(QObject *object,
Qt::ConnectionType connectionType,
- QGenericArgument val0 = QGenericArgument(Q_NULLPTR),
+ QGenericArgument val0 = QGenericArgument(nullptr),
QGenericArgument val1 = QGenericArgument(),
QGenericArgument val2 = QGenericArgument(),
QGenericArgument val3 = QGenericArgument(),
@@ -123,7 +123,7 @@ public:
val0, val1, val2, val3, val4, val5, val6, val7, val8, val9);
}
inline bool invoke(QObject *object,
- QGenericArgument val0 = QGenericArgument(Q_NULLPTR),
+ QGenericArgument val0 = QGenericArgument(nullptr),
QGenericArgument val1 = QGenericArgument(),
QGenericArgument val2 = QGenericArgument(),
QGenericArgument val3 = QGenericArgument(),
@@ -140,7 +140,7 @@ public:
bool invokeOnGadget(void *gadget,
QGenericReturnArgument returnValue,
- QGenericArgument val0 = QGenericArgument(Q_NULLPTR),
+ QGenericArgument val0 = QGenericArgument(nullptr),
QGenericArgument val1 = QGenericArgument(),
QGenericArgument val2 = QGenericArgument(),
QGenericArgument val3 = QGenericArgument(),
@@ -151,7 +151,7 @@ public:
QGenericArgument val8 = QGenericArgument(),
QGenericArgument val9 = QGenericArgument()) const;
inline bool invokeOnGadget(void *gadget,
- QGenericArgument val0 = QGenericArgument(Q_NULLPTR),
+ QGenericArgument val0 = QGenericArgument(nullptr),
QGenericArgument val1 = QGenericArgument(),
QGenericArgument val2 = QGenericArgument(),
QGenericArgument val3 = QGenericArgument(),
@@ -166,7 +166,7 @@ public:
val0, val1, val2, val3, val4, val5, val6, val7, val8, val9);
}
- inline bool isValid() const { return mobj != Q_NULLPTR; }
+ inline bool isValid() const { return mobj != nullptr; }
template <typename PointerToMemberFunction>
static inline QMetaMethod fromSignal(PointerToMemberFunction signal)
@@ -183,7 +183,7 @@ private:
// signature() has been renamed to methodSignature() in Qt 5.
// Warning, that function returns a QByteArray; check the life time if
// you convert to char*.
- char *signature(struct renamedInQt5_warning_checkTheLifeTime * = Q_NULLPTR) Q_DECL_EQ_DELETE;
+ char *signature(struct renamedInQt5_warning_checkTheLifeTime * = nullptr) Q_DECL_EQ_DELETE;
#endif
static QMetaMethod fromSignalImpl(const QMetaObject *, void **);
@@ -206,7 +206,7 @@ inline bool operator!=(const QMetaMethod &m1, const QMetaMethod &m2)
class Q_CORE_EXPORT QMetaEnum
{
public:
- Q_DECL_CONSTEXPR inline QMetaEnum() : mobj(Q_NULLPTR), handle(0) {}
+ Q_DECL_CONSTEXPR inline QMetaEnum() : mobj(nullptr), handle(0) {}
const char *name() const;
bool isFlag() const;
@@ -218,14 +218,14 @@ public:
const char *scope() const;
- int keyToValue(const char *key, bool *ok = Q_NULLPTR) const;
+ int keyToValue(const char *key, bool *ok = nullptr) const;
const char* valueToKey(int value) const;
- int keysToValue(const char * keys, bool *ok = Q_NULLPTR) const;
+ int keysToValue(const char * keys, bool *ok = nullptr) const;
QByteArray valueToKeys(int value) const;
inline const QMetaObject *enclosingMetaObject() const { return mobj; }
- inline bool isValid() const { return name() != Q_NULLPTR; }
+ inline bool isValid() const { return name() != nullptr; }
template<typename T> static QMetaEnum fromType() {
Q_STATIC_ASSERT_X(QtPrivate::IsQEnumHelper<T>::Value,
@@ -256,11 +256,11 @@ public:
bool isReadable() const;
bool isWritable() const;
bool isResettable() const;
- bool isDesignable(const QObject *obj = Q_NULLPTR) const;
- bool isScriptable(const QObject *obj = Q_NULLPTR) const;
- bool isStored(const QObject *obj = Q_NULLPTR) const;
- bool isEditable(const QObject *obj = Q_NULLPTR) const;
- bool isUser(const QObject *obj = Q_NULLPTR) const;
+ bool isDesignable(const QObject *obj = nullptr) const;
+ bool isScriptable(const QObject *obj = nullptr) const;
+ bool isStored(const QObject *obj = nullptr) const;
+ bool isEditable(const QObject *obj = nullptr) const;
+ bool isUser(const QObject *obj = nullptr) const;
bool isConstant() const;
bool isFinal() const;
@@ -300,7 +300,7 @@ private:
class Q_CORE_EXPORT QMetaClassInfo
{
public:
- Q_DECL_CONSTEXPR inline QMetaClassInfo() : mobj(Q_NULLPTR), handle(0) {}
+ Q_DECL_CONSTEXPR inline QMetaClassInfo() : mobj(nullptr), handle(0) {}
const char *name() const;
const char *value() const;
inline const QMetaObject *enclosingMetaObject() const { return mobj; }
diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h
index f704c5b21a..47c3a1c6f6 100644
--- a/src/corelib/kernel/qmetatype.h
+++ b/src/corelib/kernel/qmetatype.h
@@ -234,7 +234,7 @@ struct AbstractDebugStreamFunction
{
typedef void (*Stream)(const AbstractDebugStreamFunction *, QDebug&, const void *);
typedef void (*Destroy)(AbstractDebugStreamFunction *);
- explicit AbstractDebugStreamFunction(Stream s = Q_NULLPTR, Destroy d = Q_NULLPTR)
+ explicit AbstractDebugStreamFunction(Stream s = nullptr, Destroy d = nullptr)
: stream(s), destroy(d) {}
Q_DISABLE_COPY(AbstractDebugStreamFunction)
Stream stream;
@@ -264,7 +264,7 @@ struct AbstractComparatorFunction
typedef bool (*LessThan)(const AbstractComparatorFunction *, const void *, const void *);
typedef bool (*Equals)(const AbstractComparatorFunction *, const void *, const void *);
typedef void (*Destroy)(AbstractComparatorFunction *);
- explicit AbstractComparatorFunction(LessThan lt = Q_NULLPTR, Equals e = Q_NULLPTR, Destroy d = Q_NULLPTR)
+ explicit AbstractComparatorFunction(LessThan lt = nullptr, Equals e = nullptr, Destroy d = nullptr)
: lessThan(lt), equals(e), destroy(d) {}
Q_DISABLE_COPY(AbstractComparatorFunction)
LessThan lessThan;
@@ -301,7 +301,7 @@ template<typename T>
struct BuiltInEqualsComparatorFunction : public AbstractComparatorFunction
{
BuiltInEqualsComparatorFunction()
- : AbstractComparatorFunction(Q_NULLPTR, equals, destroy) {}
+ : AbstractComparatorFunction(nullptr, equals, destroy) {}
static bool equals(const AbstractComparatorFunction *, const void *l, const void *r)
{
const T *lhs = static_cast<const T *>(l);
@@ -318,7 +318,7 @@ struct BuiltInEqualsComparatorFunction : public AbstractComparatorFunction
struct AbstractConverterFunction
{
typedef bool (*Converter)(const AbstractConverterFunction *, const void *, void*);
- explicit AbstractConverterFunction(Converter c = Q_NULLPTR)
+ explicit AbstractConverterFunction(Converter c = nullptr)
: convert(c) {}
Q_DISABLE_COPY(AbstractConverterFunction)
Converter convert;
@@ -513,9 +513,9 @@ public:
static TypeFlags typeFlags(int type);
static const QMetaObject *metaObjectForType(int type);
static bool isRegistered(int type);
- static void *create(int type, const void *copy = Q_NULLPTR);
+ static void *create(int type, const void *copy = nullptr);
#if QT_DEPRECATED_SINCE(5, 0)
- QT_DEPRECATED static void *construct(int type, const void *copy = Q_NULLPTR)
+ QT_DEPRECATED static void *construct(int type, const void *copy = nullptr)
{ return create(type, copy); }
#endif
static void destroy(int type, void *data);
@@ -536,9 +536,9 @@ public:
inline TypeFlags flags() const;
inline const QMetaObject *metaObject() const;
- inline void *create(const void *copy = Q_NULLPTR) const;
+ inline void *create(const void *copy = nullptr) const;
inline void destroy(void *data) const;
- inline void *construct(void *where, const void *copy = Q_NULLPTR) const;
+ inline void *construct(void *where, const void *copy = nullptr) const;
inline void destruct(void *data) const;
public:
@@ -617,7 +617,7 @@ public:
return registerConverterFunction(&f, fromTypeId, toTypeId);
}
- // member function as in "double QString::toDouble(bool *ok = Q_NULLPTR) const"
+ // member function as in "double QString::toDouble(bool *ok = nullptr) const"
template<typename From, typename To>
static bool registerConverter(To(From::*function)(bool*) const)
{
@@ -680,9 +680,9 @@ private:
uint sizeExtended() const;
QMetaType::TypeFlags flagsExtended() const;
const QMetaObject *metaObjectExtended() const;
- void *createExtended(const void *copy = Q_NULLPTR) const;
+ void *createExtended(const void *copy = nullptr) const;
void destroyExtended(void *data) const;
- void *constructExtended(void *where, const void *copy = Q_NULLPTR) const;
+ void *constructExtended(void *where, const void *copy = nullptr) const;
void destructExtended(void *data) const;
static bool registerComparatorFunction(const QtPrivate::AbstractComparatorFunction *f, int type);
@@ -782,7 +782,7 @@ struct QMetaTypeFunctionHelper {
template <typename T>
struct QMetaTypeFunctionHelper<T, /* Accepted */ false> {
static void Destruct(void *) {}
- static void *Construct(void *, const void *) { return Q_NULLPTR; }
+ static void *Construct(void *, const void *) { return nullptr; }
#ifndef QT_NO_DATASTREAM
static void Save(QDataStream &, const void *) {}
static void Load(QDataStream &, void *) {}
@@ -1020,7 +1020,7 @@ public:
public:
template<class T> QSequentialIterableImpl(const T*p)
: _iterable(p)
- , _iterator(Q_NULLPTR)
+ , _iterator(nullptr)
, _metaType_id(qMetaTypeId<typename T::value_type>())
, _metaType_flags(QTypeInfo<typename T::value_type>::isPointer)
, _iteratorCapabilities(ContainerAPI<T>::IteratorCapabilities)
@@ -1037,20 +1037,20 @@ public:
}
QSequentialIterableImpl()
- : _iterable(Q_NULLPTR)
- , _iterator(Q_NULLPTR)
+ : _iterable(nullptr)
+ , _iterator(nullptr)
, _metaType_id(QMetaType::UnknownType)
, _metaType_flags(0)
, _iteratorCapabilities(0)
- , _size(Q_NULLPTR)
- , _at(Q_NULLPTR)
- , _moveToBegin(Q_NULLPTR)
- , _moveToEnd(Q_NULLPTR)
- , _advance(Q_NULLPTR)
- , _get(Q_NULLPTR)
- , _destroyIter(Q_NULLPTR)
- , _equalIter(Q_NULLPTR)
- , _copyIter(Q_NULLPTR)
+ , _size(nullptr)
+ , _at(nullptr)
+ , _moveToBegin(nullptr)
+ , _moveToEnd(nullptr)
+ , _advance(nullptr)
+ , _get(nullptr)
+ , _destroyIter(nullptr)
+ , _equalIter(nullptr)
+ , _copyIter(nullptr)
{
}
@@ -1189,7 +1189,7 @@ public:
public:
template<class T> QAssociativeIterableImpl(const T*p)
: _iterable(p)
- , _iterator(Q_NULLPTR)
+ , _iterator(nullptr)
, _metaType_id_key(qMetaTypeId<typename T::key_type>())
, _metaType_flags_key(QTypeInfo<typename T::key_type>::isPointer)
, _metaType_id_value(qMetaTypeId<typename T::mapped_type>())
@@ -1208,22 +1208,22 @@ public:
}
QAssociativeIterableImpl()
- : _iterable(Q_NULLPTR)
- , _iterator(Q_NULLPTR)
+ : _iterable(nullptr)
+ , _iterator(nullptr)
, _metaType_id_key(QMetaType::UnknownType)
, _metaType_flags_key(0)
, _metaType_id_value(QMetaType::UnknownType)
, _metaType_flags_value(0)
- , _size(Q_NULLPTR)
- , _find(Q_NULLPTR)
- , _begin(Q_NULLPTR)
- , _end(Q_NULLPTR)
- , _advance(Q_NULLPTR)
- , _getKey(Q_NULLPTR)
- , _getValue(Q_NULLPTR)
- , _destroyIter(Q_NULLPTR)
- , _equalIter(Q_NULLPTR)
- , _copyIter(Q_NULLPTR)
+ , _size(nullptr)
+ , _find(nullptr)
+ , _begin(nullptr)
+ , _end(nullptr)
+ , _advance(nullptr)
+ , _getKey(nullptr)
+ , _getValue(nullptr)
+ , _destroyIter(nullptr)
+ , _equalIter(nullptr)
+ , _copyIter(nullptr)
{
}
@@ -1292,13 +1292,13 @@ public:
}
QPairVariantInterfaceImpl()
- : _pair(Q_NULLPTR)
+ : _pair(nullptr)
, _metaType_id_first(QMetaType::UnknownType)
, _metaType_flags_first(0)
, _metaType_id_second(QMetaType::UnknownType)
, _metaType_flags_second(0)
- , _getFirst(Q_NULLPTR)
- , _getSecond(Q_NULLPTR)
+ , _getFirst(nullptr)
+ , _getSecond(nullptr)
{
}
@@ -1374,7 +1374,7 @@ namespace QtPrivate
#endif
static no_type checkType(...);
Q_STATIC_ASSERT_X(sizeof(T), "Type argument of Q_DECLARE_METATYPE(T*) must be fully defined");
- enum { Value = sizeof(checkType(static_cast<T*>(Q_NULLPTR))) == sizeof(yes_type) };
+ enum { Value = sizeof(checkType(static_cast<T*>(nullptr))) == sizeof(yes_type) };
};
template<typename T, typename Enable = void>
@@ -1419,12 +1419,12 @@ namespace QtPrivate
template<typename T, typename Enable = void>
struct MetaObjectForType
{
- static inline const QMetaObject *value() { return Q_NULLPTR; }
+ static inline const QMetaObject *value() { return nullptr; }
};
template<>
struct MetaObjectForType<void>
{
- static inline const QMetaObject *value() { return Q_NULLPTR; }
+ static inline const QMetaObject *value() { return nullptr; }
};
template<typename T>
struct MetaObjectForType<T*, typename std::enable_if<IsPointerToTypeDerivedFromQObject<T*>::Value>::type>
@@ -1720,7 +1720,7 @@ int qRegisterNormalizedMetaType(const QT_PREPEND_NAMESPACE(QByteArray) &normaliz
template <typename T>
int qRegisterMetaType(const char *typeName
#ifndef Q_QDOC
- , T * dummy = Q_NULLPTR
+ , T * dummy = nullptr
, typename QtPrivate::MetaTypeDefinedHelper<T, QMetaTypeId2<T>::Defined && !QMetaTypeId2<T>::IsBuiltIn>::DefinedType defined = QtPrivate::MetaTypeDefinedHelper<T, QMetaTypeId2<T>::Defined && !QMetaTypeId2<T>::IsBuiltIn>::Defined
#endif
)
@@ -1737,7 +1737,7 @@ int qRegisterMetaType(const char *typeName
template <typename T>
void qRegisterMetaTypeStreamOperators(const char *typeName
#ifndef Q_QDOC
- , T * /* dummy */ = Q_NULLPTR
+ , T * /* dummy */ = nullptr
#endif
)
{
@@ -2150,7 +2150,7 @@ inline QMetaType::QMetaType(const ExtensionFlag extensionFlags, const QMetaTypeI
, m_loadOp(loadOp)
, m_constructor(constructor)
, m_destructor(destructor)
- , m_extension(Q_NULLPTR)
+ , m_extension(nullptr)
, m_size(size)
, m_typeFlags(theTypeFlags)
, m_extensionFlags(extensionFlags)
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index 3b0f7ead09..aa228af21a 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -998,7 +998,7 @@ QObject::~QObject()
if (senderLists)
senderLists->dirty = true;
- QtPrivate::QSlotObjectBase *slotObj = Q_NULLPTR;
+ QtPrivate::QSlotObjectBase *slotObj = nullptr;
if (node->isSlotObject) {
slotObj = node->slotObj;
node->isSlotObject = false;
@@ -1468,14 +1468,14 @@ void QObject::moveToThread(QThread *targetThread)
}
QThreadData *currentData = QThreadData::current();
- QThreadData *targetData = targetThread ? QThreadData::get2(targetThread) : Q_NULLPTR;
+ QThreadData *targetData = targetThread ? QThreadData::get2(targetThread) : nullptr;
if (d->threadData->thread == 0 && currentData == targetData) {
// one exception to the rule: we allow moving objects with no thread affinity to the current thread
currentData = d->threadData;
} else if (d->threadData != currentData) {
qWarning("QObject::moveToThread: Current thread (%p) is not the object's thread (%p).\n"
"Cannot move to target thread (%p)\n",
- currentData->thread.load(), d->threadData->thread.load(), targetData ? targetData->thread.load() : Q_NULLPTR);
+ currentData->thread.load(), d->threadData->thread.load(), targetData ? targetData->thread.load() : nullptr);
#ifdef Q_OS_MAC
qWarning("You might be loading two sets of Qt binaries into the same process. "
diff --git a/src/corelib/kernel/qobject.h b/src/corelib/kernel/qobject.h
index 2e66daa914..d297109acb 100644
--- a/src/corelib/kernel/qobject.h
+++ b/src/corelib/kernel/qobject.h
@@ -120,23 +120,23 @@ class Q_CORE_EXPORT QObject
Q_DECLARE_PRIVATE(QObject)
public:
- Q_INVOKABLE explicit QObject(QObject *parent=Q_NULLPTR);
+ Q_INVOKABLE explicit QObject(QObject *parent=nullptr);
virtual ~QObject();
virtual bool event(QEvent *event);
virtual bool eventFilter(QObject *watched, QEvent *event);
#ifdef Q_QDOC
- static QString tr(const char *sourceText, const char *comment = Q_NULLPTR, int n = -1);
- static QString trUtf8(const char *sourceText, const char *comment = Q_NULLPTR, int n = -1);
+ static QString tr(const char *sourceText, const char *comment = nullptr, int n = -1);
+ static QString trUtf8(const char *sourceText, const char *comment = nullptr, int n = -1);
virtual const QMetaObject *metaObject() const;
static const QMetaObject staticMetaObject;
#endif
#ifdef QT_NO_TRANSLATION
- static QString tr(const char *sourceText, const char * = Q_NULLPTR, int = -1)
+ static QString tr(const char *sourceText, const char * = nullptr, int = -1)
{ return QString::fromUtf8(sourceText); }
#if QT_DEPRECATED_SINCE(5, 0)
- QT_DEPRECATED static QString trUtf8(const char *sourceText, const char * = Q_NULLPTR, int = -1)
+ QT_DEPRECATED static QString trUtf8(const char *sourceText, const char * = nullptr, int = -1)
{ return QString::fromUtf8(sourceText); }
#endif
#endif //QT_NO_TRANSLATION
@@ -248,7 +248,7 @@ public:
Q_STATIC_ASSERT_X((QtPrivate::AreArgumentsCompatible<typename SlotType::ReturnType, typename SignalType::ReturnType>::value),
"Return type of the slot is not compatible with the return type of the signal.");
- const int *types = Q_NULLPTR;
+ const int *types = nullptr;
if (type == Qt::QueuedConnection || type == Qt::BlockingQueuedConnection)
types = QtPrivate::ConnectionTypes<typename SignalType::Arguments>::types();
@@ -288,11 +288,11 @@ public:
Q_STATIC_ASSERT_X((QtPrivate::AreArgumentsCompatible<typename SlotType::ReturnType, typename SignalType::ReturnType>::value),
"Return type of the slot is not compatible with the return type of the signal.");
- const int *types = Q_NULLPTR;
+ const int *types = nullptr;
if (type == Qt::QueuedConnection || type == Qt::BlockingQueuedConnection)
types = QtPrivate::ConnectionTypes<typename SignalType::Arguments>::types();
- return connectImpl(sender, reinterpret_cast<void **>(&signal), context, Q_NULLPTR,
+ return connectImpl(sender, reinterpret_cast<void **>(&signal), context, nullptr,
new QtPrivate::QStaticSlotObject<Func2,
typename QtPrivate::List_Left<typename SignalType::Arguments, SlotType::ArgumentCount>::Value,
typename SignalType::ReturnType>(slot),
@@ -327,11 +327,11 @@ public:
Q_STATIC_ASSERT_X(QtPrivate::HasQ_OBJECT_Macro<typename SignalType::Object>::Value,
"No Q_OBJECT in the class with the signal");
- const int *types = Q_NULLPTR;
+ const int *types = nullptr;
if (type == Qt::QueuedConnection || type == Qt::BlockingQueuedConnection)
types = QtPrivate::ConnectionTypes<typename SignalType::Arguments>::types();
- return connectImpl(sender, reinterpret_cast<void **>(&signal), context, Q_NULLPTR,
+ return connectImpl(sender, reinterpret_cast<void **>(&signal), context, nullptr,
new QtPrivate::QFunctorSlotObject<Func2, SlotArgumentCount,
typename QtPrivate::List_Left<typename SignalType::Arguments, SlotArgumentCount>::Value,
typename SignalType::ReturnType>(std::move(slot)),
@@ -343,11 +343,11 @@ public:
const QObject *receiver, const char *member);
static bool disconnect(const QObject *sender, const QMetaMethod &signal,
const QObject *receiver, const QMetaMethod &member);
- inline bool disconnect(const char *signal = Q_NULLPTR,
- const QObject *receiver = Q_NULLPTR, const char *member = Q_NULLPTR) const
+ inline bool disconnect(const char *signal = nullptr,
+ const QObject *receiver = nullptr, const char *member = nullptr) const
{ return disconnect(this, signal, receiver, member); }
- inline bool disconnect(const QObject *receiver, const char *member = Q_NULLPTR) const
- { return disconnect(this, Q_NULLPTR, receiver, member); }
+ inline bool disconnect(const QObject *receiver, const char *member = nullptr) const
+ { return disconnect(this, nullptr, receiver, member); }
static bool disconnect(const QMetaObject::Connection &);
#ifdef Q_QDOC
@@ -375,7 +375,7 @@ public:
static inline bool disconnect(const typename QtPrivate::FunctionPointer<Func1>::Object *sender, Func1 signal,
const QObject *receiver, void **zero)
{
- // This is the overload for when one wish to disconnect a signal from any slot. (slot=Q_NULLPTR)
+ // This is the overload for when one wish to disconnect a signal from any slot. (slot=nullptr)
// Since the function template parameter cannot be deduced from '0', we use a
// dummy void ** parameter that must be equal to 0
Q_ASSERT(!zero);
@@ -406,14 +406,14 @@ public:
#endif // QT_NO_USERDATA
Q_SIGNALS:
- void destroyed(QObject * = Q_NULLPTR);
+ void destroyed(QObject * = nullptr);
void objectNameChanged(const QString &objectName, QPrivateSignal);
public:
inline QObject *parent() const { return d_ptr->parent; }
inline bool inherits(const char *classname) const
- { return const_cast<QObject *>(this)->qt_metacast(classname) != Q_NULLPTR; }
+ { return const_cast<QObject *>(this)->qt_metacast(classname) != nullptr; }
public Q_SLOTS:
void deleteLater();
@@ -432,7 +432,7 @@ protected:
virtual void disconnectNotify(const QMetaMethod &signal);
protected:
- QObject(QObjectPrivate &dd, QObject *parent = Q_NULLPTR);
+ QObject(QObjectPrivate &dd, QObject *parent = nullptr);
protected:
QScopedPointer<QObjectData> d_ptr;
@@ -525,16 +525,16 @@ inline T qobject_cast(const QObject *object)
template <class T> inline const char * qobject_interface_iid()
-{ return Q_NULLPTR; }
+{ return nullptr; }
#ifndef Q_MOC_RUN
# define Q_DECLARE_INTERFACE(IFace, IId) \
template <> inline const char *qobject_interface_iid<IFace *>() \
{ return IId; } \
template <> inline IFace *qobject_cast<IFace *>(QObject *object) \
- { return reinterpret_cast<IFace *>((object ? object->qt_metacast(IId) : Q_NULLPTR)); } \
+ { return reinterpret_cast<IFace *>((object ? object->qt_metacast(IId) : nullptr)); } \
template <> inline IFace *qobject_cast<IFace *>(const QObject *object) \
- { return reinterpret_cast<IFace *>((object ? const_cast<QObject *>(object)->qt_metacast(IId) : Q_NULLPTR)); }
+ { return reinterpret_cast<IFace *>((object ? const_cast<QObject *>(object)->qt_metacast(IId) : nullptr)); }
#endif // Q_MOC_RUN
#ifndef QT_NO_DEBUG_STREAM
@@ -580,7 +580,7 @@ QSignalBlocker::QSignalBlocker(QSignalBlocker &&other) Q_DECL_NOTHROW
m_blocked(other.m_blocked),
m_inhibited(other.m_inhibited)
{
- other.m_o = Q_NULLPTR;
+ other.m_o = nullptr;
}
QSignalBlocker &QSignalBlocker::operator=(QSignalBlocker &&other) Q_DECL_NOTHROW
@@ -594,7 +594,7 @@ QSignalBlocker &QSignalBlocker::operator=(QSignalBlocker &&other) Q_DECL_NOTHROW
m_blocked = other.m_blocked;
m_inhibited = other.m_inhibited;
// disable other:
- other.m_o = Q_NULLPTR;
+ other.m_o = nullptr;
}
return *this;
}
diff --git a/src/corelib/kernel/qobject_impl.h b/src/corelib/kernel/qobject_impl.h
index c775d807b1..1a14b93dcd 100644
--- a/src/corelib/kernel/qobject_impl.h
+++ b/src/corelib/kernel/qobject_impl.h
@@ -68,9 +68,9 @@ namespace QtPrivate {
{ enum { Value = QMetaTypeId2<Arg>::Defined && TypesAreDeclaredMetaType<List<Tail...>>::Value }; };
template <typename ArgList, bool Declared = TypesAreDeclaredMetaType<ArgList>::Value > struct ConnectionTypes
- { static const int *types() { return Q_NULLPTR; } };
+ { static const int *types() { return nullptr; } };
template <> struct ConnectionTypes<List<>, true>
- { static const int *types() { return Q_NULLPTR; } };
+ { static const int *types() { return nullptr; } };
template <typename... Args> struct ConnectionTypes<List<Args...>, true>
{ static const int *types() { static const int t[sizeof...(Args) + 1] = { (QtPrivate::QMetaTypeIdHelper<Args>::qt_metatype_id())..., 0 }; return t; } };
diff --git a/src/corelib/kernel/qobject_p.h b/src/corelib/kernel/qobject_p.h
index ad88bcf274..6aea40cf4a 100644
--- a/src/corelib/kernel/qobject_p.h
+++ b/src/corelib/kernel/qobject_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2017 The Qt Company Ltd.
** Copyright (C) 2013 Olivier Goffart <ogoffart@woboq.com>
** Contact: https://www.qt.io/licensing/
**
@@ -145,7 +145,7 @@ public:
ushort connectionType : 3; // 0 == auto, 1 == direct, 2 == queued, 4 == blocking
ushort isSlotObject : 1;
ushort ownArgumentTypes : 1;
- Connection() : nextConnectionList(0), ref_(2), ownArgumentTypes(true) {
+ Connection() : nextConnectionList(nullptr), ref_(2), ownArgumentTypes(true) {
//ref_ is 2 for the use in the internal lists, and for the use in QMetaObject::Connection
}
~Connection();
@@ -160,7 +160,7 @@ public:
};
// ConnectionList is a singly-linked list
struct ConnectionList {
- ConnectionList() : first(0), last(0) {}
+ ConnectionList() : first(nullptr), last(nullptr) {}
Connection *first;
Connection *last;
};
@@ -200,7 +200,7 @@ public:
}
static const QObjectPrivate *get(const QObject *o) { return o->d_func(); }
- int signalIndex(const char *signalName, const QMetaObject **meta = 0) const;
+ int signalIndex(const char *signalName, const QMetaObject **meta = nullptr) const;
inline bool isSignalConnected(uint signalIdx, bool checkDeclarative = true) const;
inline bool isDeclarativeSignalConnected(uint signalIdx) const;
@@ -376,12 +376,12 @@ class Q_CORE_EXPORT QMetaCallEvent : public QEvent
{
public:
QMetaCallEvent(ushort method_offset, ushort method_relative, QObjectPrivate::StaticMetaCallFunction callFunction , const QObject *sender, int signalId,
- int nargs = 0, int *types = 0, void **args = 0, QSemaphore *semaphore = 0);
+ int nargs = 0, int *types = nullptr, void **args = nullptr, QSemaphore *semaphore = nullptr);
/*! \internal
\a signalId is in the signal index range (see QObjectPrivate::signalIndex()).
*/
QMetaCallEvent(QtPrivate::QSlotObjectBase *slotObj, const QObject *sender, int signalId,
- int nargs = 0, int *types = 0, void **args = 0, QSemaphore *semaphore = 0);
+ int nargs = 0, int *types = nullptr, void **args = nullptr, QSemaphore *semaphore = nullptr);
~QMetaCallEvent();
@@ -432,9 +432,9 @@ struct Q_CORE_EXPORT QAbstractDynamicMetaObject : public QDynamicMetaObjectData,
{
~QAbstractDynamicMetaObject();
- virtual QAbstractDynamicMetaObject *toDynamicMetaObject(QObject *) Q_DECL_OVERRIDE { return this; }
+ virtual QAbstractDynamicMetaObject *toDynamicMetaObject(QObject *) override { return this; }
virtual int createProperty(const char *, const char *) { return -1; }
- virtual int metaCall(QObject *, QMetaObject::Call c, int _id, void **a) Q_DECL_OVERRIDE
+ virtual int metaCall(QObject *, QMetaObject::Call c, int _id, void **a) override
{ return metaCall(c, _id, a); }
virtual int metaCall(QMetaObject::Call, int _id, void **) { return _id; } // Compat overload
};
diff --git a/src/corelib/kernel/qobjectdefs.h b/src/corelib/kernel/qobjectdefs.h
index 5fc8937f23..6cd0e82a86 100644
--- a/src/corelib/kernel/qobjectdefs.h
+++ b/src/corelib/kernel/qobjectdefs.h
@@ -137,9 +137,9 @@ class QString;
#ifndef QT_NO_TRANSLATION
// full set of tr functions
# define QT_TR_FUNCTIONS \
- static inline QString tr(const char *s, const char *c = Q_NULLPTR, int n = -1) \
+ static inline QString tr(const char *s, const char *c = nullptr, int n = -1) \
{ return staticMetaObject.tr(s, c, n); } \
- QT_DEPRECATED static inline QString trUtf8(const char *s, const char *c = Q_NULLPTR, int n = -1) \
+ QT_DEPRECATED static inline QString trUtf8(const char *s, const char *c = nullptr, int n = -1) \
{ return staticMetaObject.tr(s, c, n); }
#else
// inherit the ones from QObject
@@ -294,7 +294,7 @@ class QMetaClassInfo;
class Q_CORE_EXPORT QGenericArgument
{
public:
- inline QGenericArgument(const char *aName = Q_NULLPTR, const void *aData = Q_NULLPTR)
+ inline QGenericArgument(const char *aName = nullptr, const void *aData = nullptr)
: _data(aData), _name(aName) {}
inline void *data() const { return const_cast<void *>(_data); }
inline const char *name() const { return _name; }
@@ -307,7 +307,7 @@ private:
class Q_CORE_EXPORT QGenericReturnArgument: public QGenericArgument
{
public:
- inline QGenericReturnArgument(const char *aName = Q_NULLPTR, void *aData = Q_NULLPTR)
+ inline QGenericReturnArgument(const char *aName = nullptr, void *aData = nullptr)
: QGenericArgument(aName, aData)
{}
};
@@ -388,7 +388,7 @@ struct Q_CORE_EXPORT QMetaObject
// internal index-based connect
static Connection connect(const QObject *sender, int signal_index,
const QObject *receiver, int method_index,
- int type = 0, int *types = Q_NULLPTR);
+ int type = 0, int *types = nullptr);
// internal index-based disconnect
static bool disconnect(const QObject *sender, int signal_index,
const QObject *receiver, int method_index);
@@ -405,7 +405,7 @@ struct Q_CORE_EXPORT QMetaObject
static bool invokeMethod(QObject *obj, const char *member,
Qt::ConnectionType,
QGenericReturnArgument ret,
- QGenericArgument val0 = QGenericArgument(Q_NULLPTR),
+ QGenericArgument val0 = QGenericArgument(nullptr),
QGenericArgument val1 = QGenericArgument(),
QGenericArgument val2 = QGenericArgument(),
QGenericArgument val3 = QGenericArgument(),
@@ -418,7 +418,7 @@ struct Q_CORE_EXPORT QMetaObject
static inline bool invokeMethod(QObject *obj, const char *member,
QGenericReturnArgument ret,
- QGenericArgument val0 = QGenericArgument(Q_NULLPTR),
+ QGenericArgument val0 = QGenericArgument(nullptr),
QGenericArgument val1 = QGenericArgument(),
QGenericArgument val2 = QGenericArgument(),
QGenericArgument val3 = QGenericArgument(),
@@ -435,7 +435,7 @@ struct Q_CORE_EXPORT QMetaObject
static inline bool invokeMethod(QObject *obj, const char *member,
Qt::ConnectionType type,
- QGenericArgument val0 = QGenericArgument(Q_NULLPTR),
+ QGenericArgument val0 = QGenericArgument(nullptr),
QGenericArgument val1 = QGenericArgument(),
QGenericArgument val2 = QGenericArgument(),
QGenericArgument val3 = QGenericArgument(),
@@ -451,7 +451,7 @@ struct Q_CORE_EXPORT QMetaObject
}
static inline bool invokeMethod(QObject *obj, const char *member,
- QGenericArgument val0 = QGenericArgument(Q_NULLPTR),
+ QGenericArgument val0 = QGenericArgument(nullptr),
QGenericArgument val1 = QGenericArgument(),
QGenericArgument val2 = QGenericArgument(),
QGenericArgument val3 = QGenericArgument(),
@@ -551,7 +551,7 @@ struct Q_CORE_EXPORT QMetaObject
#endif
- QObject *newInstance(QGenericArgument val0 = QGenericArgument(Q_NULLPTR),
+ QObject *newInstance(QGenericArgument val0 = QGenericArgument(nullptr),
QGenericArgument val1 = QGenericArgument(),
QGenericArgument val2 = QGenericArgument(),
QGenericArgument val3 = QGenericArgument(),
@@ -611,11 +611,11 @@ public:
operator bool() const;
#else
typedef void *Connection::*RestrictedBool;
- operator RestrictedBool() const { return d_ptr && isConnected_helper() ? &Connection::d_ptr : Q_NULLPTR; }
+ operator RestrictedBool() const { return d_ptr && isConnected_helper() ? &Connection::d_ptr : nullptr; }
#endif
#ifdef Q_COMPILER_RVALUE_REFS
- inline Connection(Connection &&o) : d_ptr(o.d_ptr) { o.d_ptr = Q_NULLPTR; }
+ inline Connection(Connection &&o) : d_ptr(o.d_ptr) { o.d_ptr = nullptr; }
inline Connection &operator=(Connection &&other)
{ qSwap(d_ptr, other.d_ptr); return *this; }
#endif
diff --git a/src/corelib/kernel/qobjectdefs_impl.h b/src/corelib/kernel/qobjectdefs_impl.h
index b9f2e47e32..17872d830e 100644
--- a/src/corelib/kernel/qobjectdefs_impl.h
+++ b/src/corelib/kernel/qobjectdefs_impl.h
@@ -372,10 +372,10 @@ namespace QtPrivate {
inline int ref() Q_DECL_NOTHROW { return m_ref.ref(); }
inline void destroyIfLastRef() Q_DECL_NOTHROW
- { if (!m_ref.deref()) m_impl(Destroy, this, Q_NULLPTR, Q_NULLPTR, Q_NULLPTR); }
+ { if (!m_ref.deref()) m_impl(Destroy, this, nullptr, nullptr, nullptr); }
- inline bool compare(void **a) { bool ret = false; m_impl(Compare, this, Q_NULLPTR, a, &ret); return ret; }
- inline void call(QObject *r, void **a) { m_impl(Call, this, r, a, Q_NULLPTR); }
+ inline bool compare(void **a) { bool ret = false; m_impl(Compare, this, nullptr, a, &ret); return ret; }
+ inline void call(QObject *r, void **a) { m_impl(Call, this, r, a, nullptr); }
protected:
~QSlotObjectBase() {}
private:
diff --git a/src/corelib/kernel/qsharedmemory.h b/src/corelib/kernel/qsharedmemory.h
index 0d4edef23d..67cf52ac17 100644
--- a/src/corelib/kernel/qsharedmemory.h
+++ b/src/corelib/kernel/qsharedmemory.h
@@ -74,8 +74,8 @@ public:
UnknownError
};
- QSharedMemory(QObject *parent = Q_NULLPTR);
- QSharedMemory(const QString &key, QObject *parent = Q_NULLPTR);
+ QSharedMemory(QObject *parent = nullptr);
+ QSharedMemory(const QString &key, QObject *parent = nullptr);
~QSharedMemory();
void setKey(const QString &key);
diff --git a/src/corelib/kernel/qsocketnotifier.h b/src/corelib/kernel/qsocketnotifier.h
index 92cdf5be95..38e5f27247 100644
--- a/src/corelib/kernel/qsocketnotifier.h
+++ b/src/corelib/kernel/qsocketnotifier.h
@@ -53,7 +53,7 @@ class Q_CORE_EXPORT QSocketNotifier : public QObject
public:
enum Type { Read, Write, Exception };
- QSocketNotifier(qintptr socket, Type, QObject *parent = Q_NULLPTR);
+ QSocketNotifier(qintptr socket, Type, QObject *parent = nullptr);
~QSocketNotifier();
qintptr socket() const;
@@ -68,7 +68,7 @@ Q_SIGNALS:
void activated(int socket, QPrivateSignal);
protected:
- bool event(QEvent *) Q_DECL_OVERRIDE;
+ bool event(QEvent *) override;
private:
Q_DISABLE_COPY(QSocketNotifier)
diff --git a/src/corelib/kernel/qtimer.cpp b/src/corelib/kernel/qtimer.cpp
index 55f75ab17e..85e95d7f7e 100644
--- a/src/corelib/kernel/qtimer.cpp
+++ b/src/corelib/kernel/qtimer.cpp
@@ -271,7 +271,7 @@ public:
Q_SIGNALS:
void timeout();
protected:
- void timerEvent(QTimerEvent *) Q_DECL_OVERRIDE;
+ void timerEvent(QTimerEvent *) override;
};
QSingleShotTimer::QSingleShotTimer(int msec, Qt::TimerType timerType, const QObject *r, const char *member)
diff --git a/src/corelib/kernel/qtimer.h b/src/corelib/kernel/qtimer.h
index 44ae04f38d..d41573264f 100644
--- a/src/corelib/kernel/qtimer.h
+++ b/src/corelib/kernel/qtimer.h
@@ -63,7 +63,7 @@ class Q_CORE_EXPORT QTimer : public QObject
Q_PROPERTY(Qt::TimerType timerType READ timerType WRITE setTimerType)
Q_PROPERTY(bool active READ isActive)
public:
- explicit QTimer(QObject *parent = Q_NULLPTR);
+ explicit QTimer(QObject *parent = nullptr);
~QTimer();
inline bool isActive() const { return id >= 0; }
@@ -197,7 +197,7 @@ public:
#endif
protected:
- void timerEvent(QTimerEvent *) Q_DECL_OVERRIDE;
+ void timerEvent(QTimerEvent *) override;
private:
Q_DISABLE_COPY(QTimer)
diff --git a/src/corelib/kernel/qtranslator.h b/src/corelib/kernel/qtranslator.h
index 97be16bc90..e7c39191e7 100644
--- a/src/corelib/kernel/qtranslator.h
+++ b/src/corelib/kernel/qtranslator.h
@@ -55,11 +55,11 @@ class Q_CORE_EXPORT QTranslator : public QObject
{
Q_OBJECT
public:
- explicit QTranslator(QObject *parent = Q_NULLPTR);
+ explicit QTranslator(QObject *parent = nullptr);
~QTranslator();
virtual QString translate(const char *context, const char *sourceText,
- const char *disambiguation = Q_NULLPTR, int n = -1) const;
+ const char *disambiguation = nullptr, int n = -1) const;
virtual bool isEmpty() const;
diff --git a/src/corelib/kernel/qvariant.h b/src/corelib/kernel/qvariant.h
index a2c5711993..6d4c163e76 100644
--- a/src/corelib/kernel/qvariant.h
+++ b/src/corelib/kernel/qvariant.h
@@ -284,14 +284,14 @@ class Q_CORE_EXPORT QVariant
void detach();
inline bool isDetached() const;
- int toInt(bool *ok = Q_NULLPTR) const;
- uint toUInt(bool *ok = Q_NULLPTR) const;
- qlonglong toLongLong(bool *ok = Q_NULLPTR) const;
- qulonglong toULongLong(bool *ok = Q_NULLPTR) const;
+ int toInt(bool *ok = nullptr) const;
+ uint toUInt(bool *ok = nullptr) const;
+ qlonglong toLongLong(bool *ok = nullptr) const;
+ qulonglong toULongLong(bool *ok = nullptr) const;
bool toBool() const;
- double toDouble(bool *ok = Q_NULLPTR) const;
- float toFloat(bool *ok = Q_NULLPTR) const;
- qreal toReal(bool *ok = Q_NULLPTR) const;
+ double toDouble(bool *ok = nullptr) const;
+ float toFloat(bool *ok = nullptr) const;
+ qreal toReal(bool *ok = nullptr) const;
QByteArray toByteArray() const;
QBitArray toBitArray() const;
QString toString() const;
@@ -370,7 +370,7 @@ class Q_CORE_EXPORT QVariant
struct Private
{
inline Private() Q_DECL_NOTHROW : type(Invalid), is_shared(false), is_null(true)
- { data.ptr = Q_NULLPTR; }
+ { data.ptr = nullptr; }
// Internal constructor for initialized variants.
explicit inline Private(uint variantType) Q_DECL_NOTHROW
diff --git a/src/corelib/kernel/qvariant_p.h b/src/corelib/kernel/qvariant_p.h
index 75c269d710..b22b7c231e 100644
--- a/src/corelib/kernel/qvariant_p.h
+++ b/src/corelib/kernel/qvariant_p.h
@@ -278,11 +278,11 @@ class QVariantIsNull
Q_STATIC_ASSERT(!HasIsNullMethod<SelfTest2>::Value);
struct SelfTest3 : public SelfTest1 {};
Q_STATIC_ASSERT(HasIsNullMethod<SelfTest3>::Value);
- struct SelfTestFinal1 Q_DECL_FINAL { bool isNull() const; };
+ struct SelfTestFinal1 final { bool isNull() const; };
Q_STATIC_ASSERT(HasIsNullMethod<SelfTestFinal1>::Value);
- struct SelfTestFinal2 Q_DECL_FINAL {};
+ struct SelfTestFinal2 final {};
Q_STATIC_ASSERT(!HasIsNullMethod<SelfTestFinal2>::Value);
- struct SelfTestFinal3 Q_DECL_FINAL : public SelfTest1 {};
+ struct SelfTestFinal3 final : public SelfTest1 {};
Q_STATIC_ASSERT(HasIsNullMethod<SelfTestFinal3>::Value);
template<typename T, bool HasIsNull = HasIsNullMethod<T>::Value>
diff --git a/src/corelib/kernel/qwineventnotifier.h b/src/corelib/kernel/qwineventnotifier.h
index f29f325d13..624e77e638 100644
--- a/src/corelib/kernel/qwineventnotifier.h
+++ b/src/corelib/kernel/qwineventnotifier.h
@@ -54,8 +54,8 @@ class Q_CORE_EXPORT QWinEventNotifier : public QObject
typedef Qt::HANDLE HANDLE;
public:
- explicit QWinEventNotifier(QObject *parent = Q_NULLPTR);
- explicit QWinEventNotifier(HANDLE hEvent, QObject *parent = Q_NULLPTR);
+ explicit QWinEventNotifier(QObject *parent = nullptr);
+ explicit QWinEventNotifier(HANDLE hEvent, QObject *parent = nullptr);
~QWinEventNotifier();
void setHandle(HANDLE hEvent);
diff --git a/src/corelib/mimetypes/qmimemagicrule_p.h b/src/corelib/mimetypes/qmimemagicrule_p.h
index 0c6c1dbcd7..9b27ef2657 100644
--- a/src/corelib/mimetypes/qmimemagicrule_p.h
+++ b/src/corelib/mimetypes/qmimemagicrule_p.h
@@ -90,7 +90,7 @@ public:
int endPos() const { return m_endPos; }
QByteArray mask() const;
- bool isValid() const { return m_matchFunction != Q_NULLPTR; }
+ bool isValid() const { return m_matchFunction != nullptr; }
bool matches(const QByteArray &data) const;
diff --git a/src/corelib/mimetypes/qmimeprovider_p.h b/src/corelib/mimetypes/qmimeprovider_p.h
index 0be01d2fd0..3eae672823 100644
--- a/src/corelib/mimetypes/qmimeprovider_p.h
+++ b/src/corelib/mimetypes/qmimeprovider_p.h
@@ -98,17 +98,17 @@ public:
QMimeBinaryProvider(QMimeDatabasePrivate *db);
virtual ~QMimeBinaryProvider();
- virtual bool isValid() Q_DECL_OVERRIDE;
- virtual QMimeType mimeTypeForName(const QString &name) Q_DECL_OVERRIDE;
- virtual QMimeGlobMatchResult findByFileName(const QString &fileName) Q_DECL_OVERRIDE;
- virtual QStringList parents(const QString &mime) Q_DECL_OVERRIDE;
- virtual QString resolveAlias(const QString &name) Q_DECL_OVERRIDE;
- virtual QStringList listAliases(const QString &name) Q_DECL_OVERRIDE;
- virtual QMimeType findByMagic(const QByteArray &data, int *accuracyPtr) Q_DECL_OVERRIDE;
- virtual QList<QMimeType> allMimeTypes() Q_DECL_OVERRIDE;
- virtual void loadMimeTypePrivate(QMimeTypePrivate &) Q_DECL_OVERRIDE;
- virtual void loadIcon(QMimeTypePrivate &) Q_DECL_OVERRIDE;
- virtual void loadGenericIcon(QMimeTypePrivate &) Q_DECL_OVERRIDE;
+ virtual bool isValid() override;
+ virtual QMimeType mimeTypeForName(const QString &name) override;
+ virtual QMimeGlobMatchResult findByFileName(const QString &fileName) override;
+ virtual QStringList parents(const QString &mime) override;
+ virtual QString resolveAlias(const QString &name) override;
+ virtual QStringList listAliases(const QString &name) override;
+ virtual QMimeType findByMagic(const QByteArray &data, int *accuracyPtr) override;
+ virtual QList<QMimeType> allMimeTypes() override;
+ virtual void loadMimeTypePrivate(QMimeTypePrivate &) override;
+ virtual void loadIcon(QMimeTypePrivate &) override;
+ virtual void loadGenericIcon(QMimeTypePrivate &) override;
private:
struct CacheFile;
@@ -141,14 +141,14 @@ public:
QMimeXMLProvider(QMimeDatabasePrivate *db);
~QMimeXMLProvider();
- virtual bool isValid() Q_DECL_OVERRIDE;
- virtual QMimeType mimeTypeForName(const QString &name) Q_DECL_OVERRIDE;
- virtual QMimeGlobMatchResult findByFileName(const QString &fileName) Q_DECL_OVERRIDE;
- virtual QStringList parents(const QString &mime) Q_DECL_OVERRIDE;
- virtual QString resolveAlias(const QString &name) Q_DECL_OVERRIDE;
- virtual QStringList listAliases(const QString &name) Q_DECL_OVERRIDE;
- virtual QMimeType findByMagic(const QByteArray &data, int *accuracyPtr) Q_DECL_OVERRIDE;
- virtual QList<QMimeType> allMimeTypes() Q_DECL_OVERRIDE;
+ virtual bool isValid() override;
+ virtual QMimeType mimeTypeForName(const QString &name) override;
+ virtual QMimeGlobMatchResult findByFileName(const QString &fileName) override;
+ virtual QStringList parents(const QString &mime) override;
+ virtual QString resolveAlias(const QString &name) override;
+ virtual QStringList listAliases(const QString &name) override;
+ virtual QMimeType findByMagic(const QByteArray &data, int *accuracyPtr) override;
+ virtual QList<QMimeType> allMimeTypes() override;
bool load(const QString &fileName, QString *errorMessage);
diff --git a/src/corelib/plugin/qlibrary.h b/src/corelib/plugin/qlibrary.h
index 89be52aac3..0b37b8b134 100644
--- a/src/corelib/plugin/qlibrary.h
+++ b/src/corelib/plugin/qlibrary.h
@@ -65,10 +65,10 @@ public:
Q_FLAG(LoadHint)
Q_FLAG(LoadHints)
- explicit QLibrary(QObject *parent = Q_NULLPTR);
- explicit QLibrary(const QString& fileName, QObject *parent = Q_NULLPTR);
- explicit QLibrary(const QString& fileName, int verNum, QObject *parent = Q_NULLPTR);
- explicit QLibrary(const QString& fileName, const QString &version, QObject *parent = Q_NULLPTR);
+ explicit QLibrary(QObject *parent = nullptr);
+ explicit QLibrary(const QString& fileName, QObject *parent = nullptr);
+ explicit QLibrary(const QString& fileName, int verNum, QObject *parent = nullptr);
+ explicit QLibrary(const QString& fileName, const QString &version, QObject *parent = nullptr);
~QLibrary();
QFunctionPointer resolve(const char *symbol);
diff --git a/src/corelib/plugin/qpluginloader.h b/src/corelib/plugin/qpluginloader.h
index 80b10f76bf..5e417249a4 100644
--- a/src/corelib/plugin/qpluginloader.h
+++ b/src/corelib/plugin/qpluginloader.h
@@ -59,8 +59,8 @@ class Q_CORE_EXPORT QPluginLoader : public QObject
Q_PROPERTY(QString fileName READ fileName WRITE setFileName)
Q_PROPERTY(QLibrary::LoadHints loadHints READ loadHints WRITE setLoadHints)
public:
- explicit QPluginLoader(QObject *parent = Q_NULLPTR);
- explicit QPluginLoader(const QString &fileName, QObject *parent = Q_NULLPTR);
+ explicit QPluginLoader(QObject *parent = nullptr);
+ explicit QPluginLoader(const QString &fileName, QObject *parent = nullptr);
~QPluginLoader();
QObject *instance();
diff --git a/src/corelib/plugin/quuid.h b/src/corelib/plugin/quuid.h
index 9e1a35f492..ee0a9f9dac 100644
--- a/src/corelib/plugin/quuid.h
+++ b/src/corelib/plugin/quuid.h
@@ -42,7 +42,7 @@
#include <QtCore/qstring.h>
-#if defined(Q_OS_WIN)
+#if defined(Q_OS_WIN) || defined(Q_CLANG_QDOC)
#ifndef GUID_DEFINED
#define GUID_DEFINED
typedef struct _GUID
@@ -55,7 +55,7 @@ typedef struct _GUID
#endif
#endif
-#if defined(Q_OS_DARWIN) || defined(Q_QDOC)
+#if defined(Q_OS_DARWIN) || defined(Q_CLANG_QDOC)
Q_FORWARD_DECLARE_CF_TYPE(CFUUID);
Q_FORWARD_DECLARE_OBJC_CLASS(NSUUID);
#endif
@@ -85,7 +85,7 @@ public:
Sha1 = 5 // 0 1 0 1
};
-#if defined(Q_COMPILER_UNIFORM_INIT) && !defined(Q_QDOC)
+#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(uint l, ushort w1, ushort w2, uchar b1, uchar b2, uchar b3,
@@ -148,10 +148,10 @@ public:
bool operator<(const QUuid &other) const Q_DECL_NOTHROW;
bool operator>(const QUuid &other) const Q_DECL_NOTHROW;
-#if defined(Q_OS_WIN)
+#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_QDOC)
+#if defined(Q_COMPILER_UNIFORM_INIT) && !defined(Q_CLANG_QDOC)
Q_DECL_CONSTEXPR QUuid(const GUID &guid) Q_DECL_NOTHROW
: data1(guid.Data1), data2(guid.Data2), data3(guid.Data3),
data4{guid.Data4[0], guid.Data4[1], guid.Data4[2], guid.Data4[3],
@@ -208,7 +208,7 @@ public:
QUuid::Variant variant() const Q_DECL_NOTHROW;
QUuid::Version version() const Q_DECL_NOTHROW;
-#if defined(Q_OS_DARWIN) || defined(Q_QDOC)
+#if defined(Q_OS_DARWIN) || defined(Q_CLANG_QDOC)
static QUuid fromCFUUID(CFUUIDRef uuid);
CFUUIDRef toCFUUID() const Q_DECL_CF_RETURNS_RETAINED;
static QUuid fromNSUUID(const NSUUID *uuid);
diff --git a/src/corelib/statemachine/qabstractstate.h b/src/corelib/statemachine/qabstractstate.h
index 02c7d9e830..ffc2eaae13 100644
--- a/src/corelib/statemachine/qabstractstate.h
+++ b/src/corelib/statemachine/qabstractstate.h
@@ -68,12 +68,12 @@ Q_SIGNALS:
void activeChanged(bool active);
protected:
- QAbstractState(QState *parent = Q_NULLPTR);
+ QAbstractState(QState *parent = nullptr);
virtual void onEntry(QEvent *event) = 0;
virtual void onExit(QEvent *event) = 0;
- bool event(QEvent *e) Q_DECL_OVERRIDE;
+ bool event(QEvent *e) override;
protected:
QAbstractState(QAbstractStatePrivate &dd, QState *parent);
diff --git a/src/corelib/statemachine/qabstracttransition.cpp b/src/corelib/statemachine/qabstracttransition.cpp
index 53c713d6a8..272e681fb4 100644
--- a/src/corelib/statemachine/qabstracttransition.cpp
+++ b/src/corelib/statemachine/qabstracttransition.cpp
@@ -258,7 +258,7 @@ void QAbstractTransition::setTargetStates(const QList<QAbstractState*> &targets)
// Verify if any of the new target states is a null-pointer:
for (int i = 0; i < targets.size(); ++i) {
- if (targets.at(i) == Q_NULLPTR) {
+ if (targets.at(i) == nullptr) {
qWarning("QAbstractTransition::setTargetStates: target state(s) cannot be null");
return;
}
diff --git a/src/corelib/statemachine/qabstracttransition.h b/src/corelib/statemachine/qabstracttransition.h
index b86d26e969..9b35e0cdb6 100644
--- a/src/corelib/statemachine/qabstracttransition.h
+++ b/src/corelib/statemachine/qabstracttransition.h
@@ -72,7 +72,7 @@ public:
};
Q_ENUM(TransitionType)
- QAbstractTransition(QState *sourceState = Q_NULLPTR);
+ QAbstractTransition(QState *sourceState = nullptr);
virtual ~QAbstractTransition();
QState *sourceState() const;
@@ -102,7 +102,7 @@ protected:
virtual void onTransition(QEvent *event) = 0;
- bool event(QEvent *e) Q_DECL_OVERRIDE;
+ bool event(QEvent *e) override;
protected:
QAbstractTransition(QAbstractTransitionPrivate &dd, QState *parent);
diff --git a/src/corelib/statemachine/qeventtransition.h b/src/corelib/statemachine/qeventtransition.h
index 3c66e72658..ff4a991162 100644
--- a/src/corelib/statemachine/qeventtransition.h
+++ b/src/corelib/statemachine/qeventtransition.h
@@ -54,8 +54,8 @@ class Q_CORE_EXPORT QEventTransition : public QAbstractTransition
Q_PROPERTY(QObject* eventSource READ eventSource WRITE setEventSource)
Q_PROPERTY(QEvent::Type eventType READ eventType WRITE setEventType)
public:
- QEventTransition(QState *sourceState = Q_NULLPTR);
- QEventTransition(QObject *object, QEvent::Type type, QState *sourceState = Q_NULLPTR);
+ QEventTransition(QState *sourceState = nullptr);
+ QEventTransition(QObject *object, QEvent::Type type, QState *sourceState = nullptr);
~QEventTransition();
QObject *eventSource() const;
@@ -65,10 +65,10 @@ public:
void setEventType(QEvent::Type type);
protected:
- bool eventTest(QEvent *event) Q_DECL_OVERRIDE;
- void onTransition(QEvent *event) Q_DECL_OVERRIDE;
+ bool eventTest(QEvent *event) override;
+ void onTransition(QEvent *event) override;
- bool event(QEvent *e) Q_DECL_OVERRIDE;
+ bool event(QEvent *e) override;
protected:
QEventTransition(QEventTransitionPrivate &dd, QState *parent);
diff --git a/src/corelib/statemachine/qfinalstate.h b/src/corelib/statemachine/qfinalstate.h
index 1563bef397..1e52a0411d 100644
--- a/src/corelib/statemachine/qfinalstate.h
+++ b/src/corelib/statemachine/qfinalstate.h
@@ -51,14 +51,14 @@ class Q_CORE_EXPORT QFinalState : public QAbstractState
{
Q_OBJECT
public:
- QFinalState(QState *parent = Q_NULLPTR);
+ QFinalState(QState *parent = nullptr);
~QFinalState();
protected:
- void onEntry(QEvent *event) Q_DECL_OVERRIDE;
- void onExit(QEvent *event) Q_DECL_OVERRIDE;
+ void onEntry(QEvent *event) override;
+ void onExit(QEvent *event) override;
- bool event(QEvent *e) Q_DECL_OVERRIDE;
+ bool event(QEvent *e) override;
protected:
explicit QFinalState(QFinalStatePrivate &dd, QState *parent);
diff --git a/src/corelib/statemachine/qhistorystate.cpp b/src/corelib/statemachine/qhistorystate.cpp
index a179d7c75b..d4fb214a31 100644
--- a/src/corelib/statemachine/qhistorystate.cpp
+++ b/src/corelib/statemachine/qhistorystate.cpp
@@ -203,7 +203,7 @@ void QHistoryState::setDefaultTransition(QAbstractTransition *transition)
QAbstractState *QHistoryState::defaultState() const
{
Q_D(const QHistoryState);
- return d->defaultTransition ? d->defaultTransition->targetState() : Q_NULLPTR;
+ return d->defaultTransition ? d->defaultTransition->targetState() : nullptr;
}
static inline bool isSoleEntry(const QList<QAbstractState*> &states, const QAbstractState * state)
diff --git a/src/corelib/statemachine/qhistorystate.h b/src/corelib/statemachine/qhistorystate.h
index c20053abf6..44f4c5d6d4 100644
--- a/src/corelib/statemachine/qhistorystate.h
+++ b/src/corelib/statemachine/qhistorystate.h
@@ -61,8 +61,8 @@ public:
};
Q_ENUM(HistoryType)
- QHistoryState(QState *parent = Q_NULLPTR);
- QHistoryState(HistoryType type, QState *parent = Q_NULLPTR);
+ QHistoryState(QState *parent = nullptr);
+ QHistoryState(HistoryType type, QState *parent = nullptr);
~QHistoryState();
QAbstractTransition *defaultTransition() const;
@@ -80,10 +80,10 @@ Q_SIGNALS:
void historyTypeChanged(QPrivateSignal);
protected:
- void onEntry(QEvent *event) Q_DECL_OVERRIDE;
- void onExit(QEvent *event) Q_DECL_OVERRIDE;
+ void onEntry(QEvent *event) override;
+ void onExit(QEvent *event) override;
- bool event(QEvent *e) Q_DECL_OVERRIDE;
+ bool event(QEvent *e) override;
private:
Q_DISABLE_COPY(QHistoryState)
diff --git a/src/corelib/statemachine/qsignaltransition.h b/src/corelib/statemachine/qsignaltransition.h
index 97c2916d9a..e785a18c73 100644
--- a/src/corelib/statemachine/qsignaltransition.h
+++ b/src/corelib/statemachine/qsignaltransition.h
@@ -55,17 +55,17 @@ class Q_CORE_EXPORT QSignalTransition : public QAbstractTransition
Q_PROPERTY(QByteArray signal READ signal WRITE setSignal NOTIFY signalChanged)
public:
- QSignalTransition(QState *sourceState = Q_NULLPTR);
+ QSignalTransition(QState *sourceState = nullptr);
QSignalTransition(const QObject *sender, const char *signal,
- QState *sourceState = Q_NULLPTR);
+ QState *sourceState = nullptr);
#ifdef Q_QDOC
template<typename PointerToMemberFunction>
QSignalTransition(const QObject *object, PointerToMemberFunction signal,
- QState *sourceState = Q_NULLPTR);
+ QState *sourceState = nullptr);
#elif defined(Q_COMPILER_DELEGATING_CONSTRUCTORS)
template <typename Func>
QSignalTransition(const typename QtPrivate::FunctionPointer<Func>::Object *obj,
- Func sig, QState *srcState = Q_NULLPTR)
+ Func sig, QState *srcState = nullptr)
: QSignalTransition(obj, QMetaMethod::fromSignal(sig).methodSignature().constData(), srcState)
{
}
@@ -80,10 +80,10 @@ public:
void setSignal(const QByteArray &signal);
protected:
- bool eventTest(QEvent *event) Q_DECL_OVERRIDE;
- void onTransition(QEvent *event) Q_DECL_OVERRIDE;
+ bool eventTest(QEvent *event) override;
+ void onTransition(QEvent *event) override;
- bool event(QEvent *e) Q_DECL_OVERRIDE;
+ bool event(QEvent *e) override;
Q_SIGNALS:
void senderObjectChanged(QPrivateSignal);
diff --git a/src/corelib/statemachine/qsignaltransition_p.h b/src/corelib/statemachine/qsignaltransition_p.h
index f270a5be4a..0666e600a4 100644
--- a/src/corelib/statemachine/qsignaltransition_p.h
+++ b/src/corelib/statemachine/qsignaltransition_p.h
@@ -70,7 +70,7 @@ public:
void unregister();
void maybeRegister();
- virtual void callOnTransition(QEvent *e) Q_DECL_OVERRIDE;
+ virtual void callOnTransition(QEvent *e) override;
const QObject *sender;
QByteArray signal;
diff --git a/src/corelib/statemachine/qstate.cpp b/src/corelib/statemachine/qstate.cpp
index 76dcbf784b..6efa4897d6 100644
--- a/src/corelib/statemachine/qstate.cpp
+++ b/src/corelib/statemachine/qstate.cpp
@@ -396,8 +396,8 @@ public:
: QAbstractTransition()
{ setTargetState(target); }
protected:
- void onTransition(QEvent *) Q_DECL_OVERRIDE {}
- bool eventTest(QEvent *) Q_DECL_OVERRIDE { return true; }
+ void onTransition(QEvent *) override {}
+ bool eventTest(QEvent *) override { return true; }
};
} // namespace
@@ -524,7 +524,7 @@ void QState::setChildMode(ChildMode mode)
if (mode == QState::ParallelStates && d->initialState) {
qWarning("QState::setChildMode: setting the child-mode of state %p to "
"parallel removes the initial state", this);
- d->initialState = Q_NULLPTR;
+ d->initialState = nullptr;
emit initialStateChanged(QState::QPrivateSignal());
}
diff --git a/src/corelib/statemachine/qstate.h b/src/corelib/statemachine/qstate.h
index 33f84c2de0..9f1f07dfcc 100644
--- a/src/corelib/statemachine/qstate.h
+++ b/src/corelib/statemachine/qstate.h
@@ -71,8 +71,8 @@ public:
};
Q_ENUM(RestorePolicy)
- QState(QState *parent = Q_NULLPTR);
- QState(ChildMode childMode, QState *parent = Q_NULLPTR);
+ QState(QState *parent = nullptr);
+ QState(ChildMode childMode, QState *parent = nullptr);
~QState();
QAbstractState *errorState() const;
@@ -116,10 +116,10 @@ Q_SIGNALS:
void errorStateChanged(QPrivateSignal);
protected:
- void onEntry(QEvent *event) Q_DECL_OVERRIDE;
- void onExit(QEvent *event) Q_DECL_OVERRIDE;
+ void onEntry(QEvent *event) override;
+ void onExit(QEvent *event) override;
- bool event(QEvent *e) Q_DECL_OVERRIDE;
+ bool event(QEvent *e) override;
protected:
QState(QStatePrivate &dd, QState *parent);
diff --git a/src/corelib/statemachine/qstatemachine.cpp b/src/corelib/statemachine/qstatemachine.cpp
index 2808ba2ced..e58ddaff44 100644
--- a/src/corelib/statemachine/qstatemachine.cpp
+++ b/src/corelib/statemachine/qstatemachine.cpp
@@ -560,7 +560,7 @@ QList<QAbstractTransition*> QStateMachinePrivate::selectTransitions(QEvent *even
QList<QAbstractTransition*> enabledTransitions;
const_cast<QStateMachine*>(q)->beginSelectTransitions(event);
for (QAbstractState *state : qAsConst(configuration_sorted)) {
- QVector<QState*> lst = getProperAncestors(state, Q_NULLPTR);
+ QVector<QState*> lst = getProperAncestors(state, nullptr);
if (QState *grp = toStandardState(state))
lst.prepend(grp);
bool found = false;
@@ -767,7 +767,7 @@ QSet<QAbstractState*> QStateMachinePrivate::computeExitSet_Unordered(QAbstractTr
QList<QAbstractState *> effectiveTargetStates = getEffectiveTargetStates(t, cache);
QAbstractState *domain = getTransitionDomain(t, effectiveTargetStates, cache);
- if (domain == Q_NULLPTR && !t->targetStates().isEmpty()) {
+ if (domain == nullptr && !t->targetStates().isEmpty()) {
// So we didn't find the least common ancestor for the source and target states of the
// transition. If there were not target states, that would be fine: then the transition
// will fire any events or signals, but not exit the state.
@@ -909,7 +909,7 @@ QAbstractState *QStateMachinePrivate::getTransitionDomain(QAbstractTransition *t
if (effectiveTargetStates.isEmpty())
return 0;
- QAbstractState *domain = Q_NULLPTR;
+ QAbstractState *domain = nullptr;
if (cache->transitionDomain(t, &domain))
return domain;
@@ -1721,8 +1721,8 @@ QAbstractTransition *QStateMachinePrivate::createInitialTransition() const
: QAbstractTransition()
{ setTargetStates(targets); }
protected:
- virtual bool eventTest(QEvent *) Q_DECL_OVERRIDE { return true; }
- virtual void onTransition(QEvent *) Q_DECL_OVERRIDE {}
+ virtual bool eventTest(QEvent *) override { return true; }
+ virtual void onTransition(QEvent *) override {}
};
QState *root = rootState();
@@ -2126,8 +2126,8 @@ public:
: QAbstractTransition()
{ setTargetState(target); }
protected:
- void onTransition(QEvent *) Q_DECL_OVERRIDE { deleteLater(); }
- bool eventTest(QEvent *) Q_DECL_OVERRIDE { return true; }
+ void onTransition(QEvent *) override { deleteLater(); }
+ bool eventTest(QEvent *) override { return true; }
};
} // namespace
diff --git a/src/corelib/statemachine/qstatemachine.h b/src/corelib/statemachine/qstatemachine.h
index 4f31252eed..fd90b86fd5 100644
--- a/src/corelib/statemachine/qstatemachine.h
+++ b/src/corelib/statemachine/qstatemachine.h
@@ -109,8 +109,8 @@ public:
NoCommonAncestorForTransitionError
};
- explicit QStateMachine(QObject *parent = Q_NULLPTR);
- explicit QStateMachine(QState::ChildMode childMode, QObject *parent = Q_NULLPTR);
+ explicit QStateMachine(QObject *parent = nullptr);
+ explicit QStateMachine(QState::ChildMode childMode, QObject *parent = nullptr);
~QStateMachine();
void addState(QAbstractState *state);
@@ -141,7 +141,7 @@ public:
QSet<QAbstractState*> configuration() const;
#if QT_CONFIG(qeventtransition)
- bool eventFilter(QObject *watched, QEvent *event) Q_DECL_OVERRIDE;
+ bool eventFilter(QObject *watched, QEvent *event) override;
#endif
public Q_SLOTS:
@@ -156,8 +156,8 @@ Q_SIGNALS:
protected:
- void onEntry(QEvent *event) Q_DECL_OVERRIDE;
- void onExit(QEvent *event) Q_DECL_OVERRIDE;
+ void onEntry(QEvent *event) override;
+ void onExit(QEvent *event) override;
virtual void beginSelectTransitions(QEvent *event);
virtual void endSelectTransitions(QEvent *event);
@@ -165,7 +165,7 @@ protected:
virtual void beginMicrostep(QEvent *event);
virtual void endMicrostep(QEvent *event);
- bool event(QEvent *e) Q_DECL_OVERRIDE;
+ bool event(QEvent *e) override;
protected:
QStateMachine(QStateMachinePrivate &dd, QObject *parent);
diff --git a/src/corelib/thread/qatomic.h b/src/corelib/thread/qatomic.h
index f9eacbf6f0..f17c38e2fe 100644
--- a/src/corelib/thread/qatomic.h
+++ b/src/corelib/thread/qatomic.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2017 The Qt Company Ltd.
** Copyright (C) 2016 Intel Corporation.
** Contact: https://www.qt.io/licensing/
**
@@ -168,9 +168,9 @@ class QAtomicPointer : public QBasicAtomicPointer<T>
{
public:
#ifdef QT_BASIC_ATOMIC_HAS_CONSTRUCTORS
- constexpr QAtomicPointer(T *value = 0) Q_DECL_NOTHROW : QBasicAtomicPointer<T>(value) {}
+ constexpr QAtomicPointer(T *value = nullptr) Q_DECL_NOTHROW : QBasicAtomicPointer<T>(value) {}
#else
- inline QAtomicPointer(T *value = 0) Q_DECL_NOTHROW
+ inline QAtomicPointer(T *value = nullptr) Q_DECL_NOTHROW
{
this->store(value);
}
diff --git a/src/corelib/thread/qbasicatomic.h b/src/corelib/thread/qbasicatomic.h
index 24218e833a..92db7a6228 100644
--- a/src/corelib/thread/qbasicatomic.h
+++ b/src/corelib/thread/qbasicatomic.h
@@ -90,6 +90,7 @@ template <typename T>
class QBasicAtomicInteger
{
public:
+ typedef T Type;
typedef QAtomicOps<T> Ops;
// static check that this is a valid integer
Q_STATIC_ASSERT_X(QTypeInfo<T>::isIntegral, "template parameter is not an integral type");
diff --git a/src/corelib/thread/qexception.cpp b/src/corelib/thread/qexception.cpp
index 62c2b608d8..e00181e64b 100644
--- a/src/corelib/thread/qexception.cpp
+++ b/src/corelib/thread/qexception.cpp
@@ -171,7 +171,7 @@ public:
};
ExceptionHolder::ExceptionHolder(QException *exception)
-: base(exception ? new Base(exception) : Q_NULLPTR) {}
+: base(exception ? new Base(exception) : nullptr) {}
ExceptionHolder::ExceptionHolder(const ExceptionHolder &other)
: base(other.base)
@@ -188,7 +188,7 @@ ExceptionHolder::~ExceptionHolder()
QException *ExceptionHolder::exception() const
{
if (!base)
- return Q_NULLPTR;
+ return nullptr;
return base->exception;
}
diff --git a/src/corelib/thread/qexception.h b/src/corelib/thread/qexception.h
index b14d386c69..5c43cedffd 100644
--- a/src/corelib/thread/qexception.h
+++ b/src/corelib/thread/qexception.h
@@ -80,8 +80,8 @@ public:
throw()
#endif
;
- void raise() const Q_DECL_OVERRIDE;
- QUnhandledException *clone() const Q_DECL_OVERRIDE;
+ void raise() const override;
+ QUnhandledException *clone() const override;
};
namespace QtPrivate {
@@ -90,7 +90,7 @@ class Base;
class Q_CORE_EXPORT ExceptionHolder
{
public:
- ExceptionHolder(QException *exception = Q_NULLPTR);
+ ExceptionHolder(QException *exception = nullptr);
ExceptionHolder(const ExceptionHolder &other);
void operator=(const ExceptionHolder &other); // ### Qt6: copy-assign operator shouldn't return void. Remove this method and the copy-ctor, they are unneeded.
~ExceptionHolder();
diff --git a/src/corelib/thread/qfutex_p.h b/src/corelib/thread/qfutex_p.h
new file mode 100644
index 0000000000..483664c783
--- /dev/null
+++ b/src/corelib/thread/qfutex_p.h
@@ -0,0 +1,142 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 Intel Corporation.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QFUTEX_P_H
+#define QFUTEX_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <qglobal.h>
+
+QT_BEGIN_NAMESPACE
+
+namespace QtDummyFutex {
+ Q_DECL_CONSTEXPR inline bool futexAvailable() { return false; }
+ template <typename Atomic>
+ inline bool futexWait(Atomic &, typename Atomic::Type, int = 0)
+ { Q_UNREACHABLE(); return false; }
+ template <typename Atomic> inline void futexWakeOne(Atomic &)
+ { Q_UNREACHABLE(); }
+ template <typename Atomic> inline void futexWakeAll(Atomic &)
+ { Q_UNREACHABLE(); }
+}
+
+QT_END_NAMESPACE
+
+#if defined(Q_OS_LINUX) && !defined(QT_LINUXBASE)
+// use Linux mutexes everywhere except for LSB builds
+# include <sys/syscall.h>
+# include <errno.h>
+# include <limits.h>
+# include <unistd.h>
+# include <asm/unistd.h>
+# include <linux/futex.h>
+# define QT_ALWAYS_USE_FUTEX
+
+// if not defined in linux/futex.h
+# define FUTEX_PRIVATE_FLAG 128 // added in v2.6.22
+
+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
+ {
+ // we use __NR_futex because some libcs (like Android's bionic) don't
+ // provide SYS_futex etc.
+ return syscall(__NR_futex, addr, op | FUTEX_PRIVATE_FLAG, val, val2, addr2, val3);
+ }
+ template <typename T> int *addr(T *ptr)
+ {
+ int *int_addr = reinterpret_cast<int *>(ptr);
+#if Q_BYTE_ORDER == Q_BIG_ENDIAN
+ if (sizeof(T) > sizeof(int))
+ int_addr++; //We want a pointer to the least significant half
+#endif
+ return int_addr;
+ }
+
+ template <typename Atomic>
+ inline void futexWait(Atomic &futex, typename Atomic::Type expectedValue)
+ {
+ _q_futex(addr(&futex), FUTEX_WAIT, qintptr(expectedValue));
+ }
+ template <typename Atomic>
+ inline bool futexWait(Atomic &futex, typename Atomic::Type expectedValue, qint64 nstimeout)
+ {
+ struct timespec ts;
+ ts.tv_sec = nstimeout / 1000 / 1000 / 1000;
+ ts.tv_nsec = nstimeout % (1000 * 1000 * 1000);
+ int r = _q_futex(addr(&futex), FUTEX_WAIT, qintptr(expectedValue), quintptr(&ts));
+ return r == 0 || errno != ETIMEDOUT;
+ }
+ template <typename Atomic> inline void futexWakeOne(Atomic &futex)
+ {
+ _q_futex(addr(&futex), FUTEX_WAKE, 1);
+ }
+ template <typename Atomic> inline void futexWakeAll(Atomic &futex)
+ {
+ _q_futex(addr(&futex), FUTEX_WAKE, INT_MAX);
+ }
+ template <typename Atomic> inline
+ void futexWakeOp(Atomic &futex1, int wake1, int wake2, Atomic &futex2, quint32 op)
+ {
+ _q_futex(addr(&futex1), FUTEX_WAKE_OP, wake1, wake2, addr(&futex2), op);
+ }
+}
+namespace QtFutex = QtLinuxFutex;
+QT_END_NAMESPACE
+
+#else
+
+QT_BEGIN_NAMESPACE
+namespace QtFutex = QtDummyFutex;
+QT_END_NAMESPACE
+#endif
+
+#endif // QFUTEX_P_H
diff --git a/src/corelib/thread/qfutureinterface.h b/src/corelib/thread/qfutureinterface.h
index 7b12f51e3e..320c2d7b33 100644
--- a/src/corelib/thread/qfutureinterface.h
+++ b/src/corelib/thread/qfutureinterface.h
@@ -291,7 +291,7 @@ public:
void reportResult(const void *, int) { }
void reportResults(const QVector<void> &, int) { }
- void reportFinished(const void * = Q_NULLPTR) { QFutureInterfaceBase::reportFinished(); }
+ void reportFinished(const void * = nullptr) { QFutureInterfaceBase::reportFinished(); }
};
QT_END_NAMESPACE
diff --git a/src/corelib/thread/qfuturewatcher.h b/src/corelib/thread/qfuturewatcher.h
index 3357e27037..5143db8d2e 100644
--- a/src/corelib/thread/qfuturewatcher.h
+++ b/src/corelib/thread/qfuturewatcher.h
@@ -58,7 +58,7 @@ class Q_CORE_EXPORT QFutureWatcherBase : public QObject
Q_DECLARE_PRIVATE(QFutureWatcherBase)
public:
- explicit QFutureWatcherBase(QObject *parent = Q_NULLPTR);
+ explicit QFutureWatcherBase(QObject *parent = nullptr);
// de-inline dtor
int progressValue() const;
@@ -76,7 +76,7 @@ public:
void setPendingResultsLimit(int limit);
- bool event(QEvent *event) Q_DECL_OVERRIDE;
+ bool event(QEvent *event) override;
Q_SIGNALS:
void started();
@@ -98,8 +98,8 @@ public Q_SLOTS:
void togglePaused();
protected:
- void connectNotify (const QMetaMethod &signal) Q_DECL_OVERRIDE;
- void disconnectNotify (const QMetaMethod &signal) Q_DECL_OVERRIDE;
+ void connectNotify (const QMetaMethod &signal) override;
+ void disconnectNotify (const QMetaMethod &signal) override;
// called from setFuture() implemented in template sub-classes
void connectOutputInterface();
@@ -166,8 +166,8 @@ public Q_SLOTS:
private:
QFuture<T> m_future;
- const QFutureInterfaceBase &futureInterface() const Q_DECL_OVERRIDE { return m_future.d; }
- QFutureInterfaceBase &futureInterface() Q_DECL_OVERRIDE { return m_future.d; }
+ const QFutureInterfaceBase &futureInterface() const override { return m_future.d; }
+ QFutureInterfaceBase &futureInterface() override { return m_future.d; }
};
template <typename T>
@@ -185,7 +185,7 @@ template <>
class QFutureWatcher<void> : public QFutureWatcherBase
{
public:
- explicit QFutureWatcher(QObject *_parent = Q_NULLPTR)
+ explicit QFutureWatcher(QObject *_parent = nullptr)
: QFutureWatcherBase(_parent)
{ }
~QFutureWatcher()
@@ -197,8 +197,8 @@ public:
private:
QFuture<void> m_future;
- const QFutureInterfaceBase &futureInterface() const Q_DECL_OVERRIDE { return m_future.d; }
- QFutureInterfaceBase &futureInterface() Q_DECL_OVERRIDE { return m_future.d; }
+ const QFutureInterfaceBase &futureInterface() const override { return m_future.d; }
+ QFutureInterfaceBase &futureInterface() override { return m_future.d; }
};
Q_INLINE_TEMPLATE void QFutureWatcher<void>::setFuture(const QFuture<void> &_future)
diff --git a/src/corelib/thread/qfuturewatcher_p.h b/src/corelib/thread/qfuturewatcher_p.h
index e83bdaf45a..25d1ef8d25 100644
--- a/src/corelib/thread/qfuturewatcher_p.h
+++ b/src/corelib/thread/qfuturewatcher_p.h
@@ -69,8 +69,8 @@ class QFutureWatcherBasePrivate : public QObjectPrivate,
public:
QFutureWatcherBasePrivate();
- void postCallOutEvent(const QFutureCallOutEvent &callOutEvent) Q_DECL_OVERRIDE;
- void callOutInterfaceDisconnected() Q_DECL_OVERRIDE;
+ void postCallOutEvent(const QFutureCallOutEvent &callOutEvent) override;
+ void callOutInterfaceDisconnected() override;
void sendCallOutEvent(QFutureCallOutEvent *event);
diff --git a/src/corelib/thread/qmutex.h b/src/corelib/thread/qmutex.h
index 3d24379fa9..3dff363541 100644
--- a/src/corelib/thread/qmutex.h
+++ b/src/corelib/thread/qmutex.h
@@ -98,16 +98,16 @@ public:
private:
inline bool fastTryLock() Q_DECL_NOTHROW {
- return d_ptr.testAndSetAcquire(Q_NULLPTR, dummyLocked());
+ return d_ptr.testAndSetAcquire(nullptr, dummyLocked());
}
inline bool fastTryUnlock() Q_DECL_NOTHROW {
- return d_ptr.testAndSetRelease(dummyLocked(), Q_NULLPTR);
+ return d_ptr.testAndSetRelease(dummyLocked(), nullptr);
}
inline bool fastTryLock(QMutexData *&current) Q_DECL_NOTHROW {
- return d_ptr.testAndSetAcquire(Q_NULLPTR, dummyLocked(), current);
+ return d_ptr.testAndSetAcquire(nullptr, dummyLocked(), current);
}
inline bool fastTryUnlock(QMutexData *&current) Q_DECL_NOTHROW {
- return d_ptr.testAndSetRelease(dummyLocked(), Q_NULLPTR, current);
+ return d_ptr.testAndSetRelease(dummyLocked(), nullptr, current);
}
void lockInternal() QT_MUTEX_LOCK_NOEXCEPT;
@@ -293,7 +293,7 @@ public:
inline void unlock() Q_DECL_NOTHROW {}
void relock() Q_DECL_NOTHROW {}
- inline QMutex *mutex() const Q_DECL_NOTHROW { return Q_NULLPTR; }
+ inline QMutex *mutex() const Q_DECL_NOTHROW { return nullptr; }
private:
Q_DISABLE_COPY(QMutexLocker)
diff --git a/src/corelib/thread/qmutex_linux.cpp b/src/corelib/thread/qmutex_linux.cpp
index 5f6e74ac6f..d3d97ea108 100644
--- a/src/corelib/thread/qmutex_linux.cpp
+++ b/src/corelib/thread/qmutex_linux.cpp
@@ -44,15 +44,9 @@
#ifndef QT_NO_THREAD
#include "qatomic.h"
#include "qmutex_p.h"
-#include "qelapsedtimer.h"
+#include "qfutex_p.h"
-#include <linux/futex.h>
-#include <sys/syscall.h>
-#include <unistd.h>
-#include <errno.h>
-#include <asm/unistd.h>
-
-#ifndef QT_LINUX_FUTEX
+#ifndef QT_ALWAYS_USE_FUTEX
# error "Qt build is broken: qmutex_linux.cpp is being built but futex support is not wanted"
#endif
@@ -63,6 +57,8 @@
QT_BEGIN_NAMESPACE
+using namespace QtFutex;
+
/*
* QBasicMutex implementation on Linux with futexes
*
@@ -107,20 +103,6 @@ QT_BEGIN_NAMESPACE
* waiting in the past. We then set the mutex to 0x0 and perform a FUTEX_WAKE.
*/
-static inline int _q_futex(void *addr, int op, int val, const struct timespec *timeout) Q_DECL_NOTHROW
-{
- volatile int *int_addr = reinterpret_cast<volatile int *>(addr);
-#if Q_BYTE_ORDER == Q_BIG_ENDIAN && QT_POINTER_SIZE == 8
- int_addr++; //We want a pointer to the 32 least significant bit of QMutex::d
-#endif
- int *addr2 = 0;
- int val2 = 0;
-
- // we use __NR_futex because some libcs (like Android's bionic) don't
- // provide SYS_futex etc.
- return syscall(__NR_futex, int_addr, op | FUTEX_PRIVATE_FLAG, val, timeout, addr2, val2);
-}
-
static inline QMutexData *dummyFutexValue()
{
return reinterpret_cast<QMutexData *>(quintptr(3));
@@ -136,36 +118,38 @@ bool lockInternal_helper(QBasicAtomicPointer<QMutexData> &d_ptr, int timeout = -
if (timeout == 0)
return false;
- struct timespec ts, *pts = 0;
- if (IsTimed && timeout > 0) {
- ts.tv_sec = timeout / 1000;
- ts.tv_nsec = (timeout % 1000) * 1000 * 1000;
- }
-
// the mutex is locked already, set a bit indicating we're waiting
- while (d_ptr.fetchAndStoreAcquire(dummyFutexValue()) != 0) {
- if (IsTimed && pts == &ts) {
- // recalculate the timeout
- qint64 xtimeout = qint64(timeout) * 1000 * 1000;
- xtimeout -= elapsedTimer->nsecsElapsed();
- if (xtimeout <= 0) {
- // timer expired after we returned
- return false;
- }
- ts.tv_sec = xtimeout / Q_INT64_C(1000) / 1000 / 1000;
- ts.tv_nsec = xtimeout % (Q_INT64_C(1000) * 1000 * 1000);
- }
- if (IsTimed && timeout > 0)
- pts = &ts;
+ if (d_ptr.fetchAndStoreAcquire(dummyFutexValue()) == nullptr)
+ return true;
+ qint64 nstimeout = timeout * Q_INT64_C(1000) * 1000;
+ qint64 remainingTime = nstimeout;
+ forever {
// successfully set the waiting bit, now sleep
- int r = _q_futex(&d_ptr, FUTEX_WAIT, quintptr(dummyFutexValue()), pts);
- if (IsTimed && r != 0 && errno == ETIMEDOUT)
- return false;
+ if (IsTimed && nstimeout >= 0) {
+ bool r = futexWait(d_ptr, dummyFutexValue(), remainingTime);
+ if (!r)
+ return false;
+
+ // we got woken up, so try to acquire the mutex
+ // note we must set to dummyFutexValue because there could be other threads
+ // also waiting
+ if (d_ptr.fetchAndStoreAcquire(dummyFutexValue()) == nullptr)
+ return true;
- // we got woken up, so try to acquire the mutex
- // note we must set to dummyFutexValue because there could be other threads
- // also waiting
+ // recalculate the timeout
+ remainingTime = nstimeout - elapsedTimer->nsecsElapsed();
+ if (remainingTime <= 0)
+ return false;
+ } else {
+ futexWait(d_ptr, dummyFutexValue());
+
+ // we got woken up, so try to acquire the mutex
+ // note we must set to dummyFutexValue because there could be other threads
+ // also waiting
+ if (d_ptr.fetchAndStoreAcquire(dummyFutexValue()) == nullptr)
+ return true;
+ }
}
Q_ASSERT(d_ptr.load());
@@ -195,10 +179,9 @@ void QBasicMutex::unlockInternal() Q_DECL_NOTHROW
Q_ASSERT(!isRecursive());
d_ptr.storeRelease(0);
- _q_futex(&d_ptr, FUTEX_WAKE, 1, 0);
+ futexWakeOne(d_ptr);
}
-
QT_END_NAMESPACE
#endif // QT_NO_THREAD
diff --git a/src/corelib/thread/qreadwritelock.h b/src/corelib/thread/qreadwritelock.h
index 777efdb3bf..ecdb98f2f5 100644
--- a/src/corelib/thread/qreadwritelock.h
+++ b/src/corelib/thread/qreadwritelock.h
@@ -205,7 +205,7 @@ public:
static inline void unlock() Q_DECL_NOTHROW { }
static inline void relock() Q_DECL_NOTHROW { }
- static inline QReadWriteLock *readWriteLock() Q_DECL_NOTHROW { return Q_NULLPTR; }
+ static inline QReadWriteLock *readWriteLock() Q_DECL_NOTHROW { return nullptr; }
private:
Q_DISABLE_COPY(QReadLocker)
@@ -219,7 +219,7 @@ public:
static inline void unlock() Q_DECL_NOTHROW { }
static inline void relock() Q_DECL_NOTHROW { }
- static inline QReadWriteLock *readWriteLock() Q_DECL_NOTHROW { return Q_NULLPTR; }
+ static inline QReadWriteLock *readWriteLock() Q_DECL_NOTHROW { return nullptr; }
private:
Q_DISABLE_COPY(QWriteLocker)
diff --git a/src/corelib/thread/qresultstore.h b/src/corelib/thread/qresultstore.h
index 6c814ef854..5f0cefa133 100644
--- a/src/corelib/thread/qresultstore.h
+++ b/src/corelib/thread/qresultstore.h
@@ -67,8 +67,8 @@ class ResultItem
public:
ResultItem(const void *_result, int _count) : m_count(_count), result(_result) { } // contruct with vector of results
ResultItem(const void *_result) : m_count(0), result(_result) { } // construct with result
- ResultItem() : m_count(0), result(Q_NULLPTR) { }
- bool isValid() const { return result != Q_NULLPTR; }
+ ResultItem() : m_count(0), result(nullptr) { }
+ bool isValid() const { return result != nullptr; }
bool isVector() const { return m_count != 0; }
int count() const { return (m_count == 0) ? 1 : m_count; }
int m_count; // result is either a pointer to a result or to a vector of results,
diff --git a/src/corelib/thread/qsemaphore.cpp b/src/corelib/thread/qsemaphore.cpp
index 37736b3960..012628ef63 100644
--- a/src/corelib/thread/qsemaphore.cpp
+++ b/src/corelib/thread/qsemaphore.cpp
@@ -1,6 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Copyright (C) 2017 Intel Corporation.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
@@ -41,12 +42,15 @@
#ifndef QT_NO_THREAD
#include "qmutex.h"
+#include "qfutex_p.h"
#include "qwaitcondition.h"
#include "qdeadlinetimer.h"
#include "qdatetime.h"
QT_BEGIN_NAMESPACE
+using namespace QtFutex;
+
/*!
\class QSemaphore
\inmodule QtCore
@@ -97,6 +101,117 @@ QT_BEGIN_NAMESPACE
\sa QSemaphoreReleaser, QMutex, QWaitCondition, QThread, {Semaphores Example}
*/
+/*
+ QSemaphore futex operation
+
+ QSemaphore stores a 32-bit integer with the counter of currently available
+ tokens (value between 0 and INT_MAX). When a thread attempts to acquire n
+ tokens and the counter is larger than that, we perform a compare-and-swap
+ with the new count. If that succeeds, the acquisition worked; if not, we
+ loop again because the counter changed. If there were not enough tokens,
+ we'll perform a futex-wait.
+
+ Before we do, we set the high bit in the futex to indicate that semaphore
+ is contended: that is, there's a thread waiting for more tokens. On
+ release() for n tokens, we perform a fetch-and-add of n and then check if
+ that high bit was set. If it was, then we clear that bit and perform a
+ futex-wake on the semaphore to indicate the waiting threads can wake up and
+ acquire tokens. Which ones get woken up is unspecified.
+
+ If the system has the ability to wake up a precise number of threads, has
+ Linux's FUTEX_WAKE_OP functionality, and is 64-bit, we'll use the high word
+ as a copy of the low word, but the sign bit indicating the presence of a
+ thread waiting for multiple tokens. So when releasing n tokens on those
+ systems, we tell the kernel to wake up n single-token threads and all of
+ the multi-token ones, then clear that wait bit. Which threads get woken up
+ is unspecified, but it's likely single-token threads will get woken up
+ first.
+ */
+static const quint32 futexContendedBit = 1U << 31;
+
+static int futexAvailCounter(quintptr v)
+{
+ // the low 31 bits
+ return int(v & (futexContendedBit - 1));
+}
+
+static quintptr futexCounterParcel(int n)
+{
+ // replicate the 31 bits if we're on 64-bit
+ quint64 nn = quint32(n);
+ nn |= (nn << 32);
+ return quintptr(nn);
+}
+
+static QBasicAtomicInteger<quint32> *futexLow32(QBasicAtomicInteger<quintptr> *ptr)
+{
+ auto result = reinterpret_cast<QBasicAtomicInteger<quint32> *>(ptr);
+#if Q_BYTE_ORDER == Q_BIG_ENDIAN && QT_POINTER_SIZE > 4
+ ++result;
+#endif
+ return result;
+}
+
+#ifdef FUTEX_OP
+// quintptr might be 32bit, in which case we want this to be 0, without implicitly casting.
+static const quintptr futexMultiWaiterBit = static_cast<quintptr>(Q_UINT64_C(1) << 63);
+static QBasicAtomicInteger<quint32> *futexHigh32(QBasicAtomicInteger<quintptr> *ptr)
+{
+ auto result = reinterpret_cast<QBasicAtomicInteger<quint32> *>(ptr);
+#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN && QT_POINTER_SIZE > 4
+ ++result;
+#endif
+ return result;
+}
+#endif
+
+template <bool IsTimed> bool futexSemaphoreTryAcquire(QBasicAtomicInteger<quintptr> &u, int n, int timeout)
+{
+ QDeadlineTimer timer(IsTimed ? QDeadlineTimer(timeout) : QDeadlineTimer());
+ quintptr curValue = u.loadAcquire();
+ qint64 remainingTime = timeout * Q_INT64_C(1000) * 1000;
+ forever {
+ int available = futexAvailCounter(curValue);
+ if (available >= n) {
+ // try to acquire
+ quintptr newValue = curValue - futexCounterParcel(n);
+ if (u.testAndSetOrdered(curValue, newValue, curValue))
+ return true; // succeeded!
+ continue;
+ }
+
+ // not enough tokens available, put us to wait
+ if (remainingTime == 0)
+ return false;
+
+ // set the contended and multi-wait bits
+ quintptr bitsToSet = futexContendedBit;
+ auto ptr = futexLow32(&u);
+#ifdef FUTEX_OP
+ if (n > 1 && sizeof(curValue) >= sizeof(int)) {
+ bitsToSet |= futexMultiWaiterBit;
+ ptr = futexHigh32(&u);
+ }
+#endif
+
+ // the value is the same for either branch
+ u.fetchAndOrRelaxed(bitsToSet);
+ curValue |= bitsToSet;
+
+ if (IsTimed && remainingTime > 0) {
+ bool timedout = !futexWait(*ptr, curValue, remainingTime);
+ if (timedout)
+ return false;
+ } else {
+ futexWait(*ptr, curValue);
+ }
+
+ curValue = u.loadAcquire();
+ if (IsTimed)
+ remainingTime = timer.remainingTimeNSecs();
+ }
+}
+
class QSemaphorePrivate {
public:
inline QSemaphorePrivate(int n) : avail(n) { }
@@ -116,7 +231,10 @@ public:
QSemaphore::QSemaphore(int n)
{
Q_ASSERT_X(n >= 0, "QSemaphore", "parameter 'n' must be non-negative");
- d = new QSemaphorePrivate(n);
+ if (futexAvailable())
+ u.store(n);
+ else
+ d = new QSemaphorePrivate(n);
}
/*!
@@ -126,7 +244,10 @@ QSemaphore::QSemaphore(int n)
undefined behavior.
*/
QSemaphore::~QSemaphore()
-{ delete d; }
+{
+ if (!futexAvailable())
+ delete d;
+}
/*!
Tries to acquire \c n resources guarded by the semaphore. If \a n
@@ -138,6 +259,12 @@ QSemaphore::~QSemaphore()
void QSemaphore::acquire(int n)
{
Q_ASSERT_X(n >= 0, "QSemaphore::acquire", "parameter 'n' must be non-negative");
+
+ if (futexAvailable()) {
+ futexSemaphoreTryAcquire<false>(u, n, -1);
+ return;
+ }
+
QMutexLocker locker(&d->mutex);
while (n > d->avail)
d->cond.wait(locker.mutex());
@@ -160,6 +287,69 @@ void QSemaphore::acquire(int n)
void QSemaphore::release(int n)
{
Q_ASSERT_X(n >= 0, "QSemaphore::release", "parameter 'n' must be non-negative");
+
+ if (futexAvailable()) {
+ quintptr prevValue = u.fetchAndAddRelease(futexCounterParcel(n));
+ if (prevValue & futexContendedBit) {
+#ifdef FUTEX_OP
+ if (sizeof(u) == sizeof(int)) {
+ /*
+ On 32-bit systems, all waiters are waiting on the same address,
+ so we'll wake them all and ask the kernel to clear the high bit.
+
+ atomic {
+ int oldval = u;
+ u = oldval & ~(1 << 31);
+ futexWake(u, INT_MAX);
+ if (oldval == 0) // impossible condition
+ futexWake(u, INT_MAX);
+ }
+ */
+ quint32 op = FUTEX_OP_ANDN | FUTEX_OP_OPARG_SHIFT;
+ quint32 oparg = 31;
+ quint32 cmp = FUTEX_OP_CMP_EQ;
+ quint32 cmparg = 0;
+ futexWakeOp(u, INT_MAX, INT_MAX, u, FUTEX_OP(op, oparg, cmp, cmparg));
+ } else {
+ /*
+ On 64-bit systems, the single-token waiters wait on the low half
+ and the multi-token waiters wait on the upper half. So we ask
+ the kernel to wake up n single-token waiters and all multi-token
+ waiters (if any), then clear the multi-token wait bit.
+
+ That means we must clear the contention bit ourselves. See
+ below for handling the race.
+
+ atomic {
+ int oldval = *upper;
+ *upper = oldval & ~(1 << 31);
+ futexWake(lower, n);
+ if (oldval < 0) // sign bit set
+ futexWake(upper, INT_MAX);
+ }
+ */
+ quint32 op = FUTEX_OP_ANDN | FUTEX_OP_OPARG_SHIFT;
+ quint32 oparg = 31;
+ quint32 cmp = FUTEX_OP_CMP_LT;
+ quint32 cmparg = 0;
+ futexLow32(&u)->fetchAndAndRelease(futexContendedBit - 1);
+ futexWakeOp(*futexLow32(&u), n, INT_MAX, *futexHigh32(&u), FUTEX_OP(op, oparg, cmp, cmparg));
+ }
+#else
+ // Unset the bit and wake everyone. There are two possibibilies
+ // under which a thread can set the bit between the AND and the
+ // futexWake:
+ // 1) it did see the new counter value, but it wasn't enough for
+ // its acquisition anyway, so it has to wait;
+ // 2) it did not see the new counter value, in which case its
+ // futexWait will fail.
+ u.fetchAndAndRelease(futexContendedBit - 1);
+ futexWakeAll(u);
+#endif
+ }
+ return;
+ }
+
QMutexLocker locker(&d->mutex);
d->avail += n;
d->cond.wakeAll();
@@ -173,6 +363,9 @@ void QSemaphore::release(int n)
*/
int QSemaphore::available() const
{
+ if (futexAvailable())
+ return futexAvailCounter(u.load());
+
QMutexLocker locker(&d->mutex);
return d->avail;
}
@@ -191,6 +384,10 @@ int QSemaphore::available() const
bool QSemaphore::tryAcquire(int n)
{
Q_ASSERT_X(n >= 0, "QSemaphore::tryAcquire", "parameter 'n' must be non-negative");
+
+ if (futexAvailable())
+ return futexSemaphoreTryAcquire<false>(u, n, 0);
+
QMutexLocker locker(&d->mutex);
if (n > d->avail)
return false;
@@ -222,6 +419,9 @@ bool QSemaphore::tryAcquire(int n, int timeout)
// but QDeadlineTimer only accepts -1.
timeout = qMax(timeout, -1);
+ if (futexAvailable())
+ return futexSemaphoreTryAcquire<true>(u, n, timeout);
+
QDeadlineTimer timer(timeout);
QMutexLocker locker(&d->mutex);
qint64 remainingTime = timer.remainingTime();
diff --git a/src/corelib/thread/qsemaphore.h b/src/corelib/thread/qsemaphore.h
index 9de23173e8..2639085e99 100644
--- a/src/corelib/thread/qsemaphore.h
+++ b/src/corelib/thread/qsemaphore.h
@@ -66,7 +66,10 @@ public:
private:
Q_DISABLE_COPY(QSemaphore)
- QSemaphorePrivate *d;
+ union {
+ QSemaphorePrivate *d;
+ QBasicAtomicInteger<quintptr> u; // ### Qt6: make 64-bit
+ };
};
class QSemaphoreReleaser
diff --git a/src/corelib/thread/qthread.h b/src/corelib/thread/qthread.h
index 03b5424bb6..1f98cb59af 100644
--- a/src/corelib/thread/qthread.h
+++ b/src/corelib/thread/qthread.h
@@ -76,7 +76,7 @@ public:
static int idealThreadCount() Q_DECL_NOTHROW;
static void yieldCurrentThread();
- explicit QThread(QObject *parent = Q_NULLPTR);
+ explicit QThread(QObject *parent = nullptr);
~QThread();
enum Priority {
@@ -110,7 +110,7 @@ public:
QAbstractEventDispatcher *eventDispatcher() const;
void setEventDispatcher(QAbstractEventDispatcher *eventDispatcher);
- bool event(QEvent *event) Q_DECL_OVERRIDE;
+ bool event(QEvent *event) override;
int loopLevel() const;
#ifdef Q_QDOC
@@ -154,7 +154,7 @@ protected:
static void setTerminationEnabled(bool enabled = true);
protected:
- QThread(QThreadPrivate &dd, QObject *parent = Q_NULLPTR);
+ QThread(QThreadPrivate &dd, QObject *parent = nullptr);
private:
Q_DECLARE_PRIVATE(QThread)
diff --git a/src/corelib/thread/qthread_p.h b/src/corelib/thread/qthread_p.h
index f3d4750177..1d38eb0ebf 100644
--- a/src/corelib/thread/qthread_p.h
+++ b/src/corelib/thread/qthread_p.h
@@ -317,7 +317,7 @@ public:
void init();
private:
- void run() Q_DECL_OVERRIDE;
+ void run() override;
};
QT_END_NAMESPACE
diff --git a/src/corelib/thread/qthread_unix.cpp b/src/corelib/thread/qthread_unix.cpp
index 6540f02f34..f839e4449b 100644
--- a/src/corelib/thread/qthread_unix.cpp
+++ b/src/corelib/thread/qthread_unix.cpp
@@ -487,9 +487,6 @@ int QThread::idealThreadCount() Q_DECL_NOTHROW
if (sysctl(mib, 2, &cores, &len, NULL, 0) != 0) {
perror("sysctl");
}
-#elif defined(Q_OS_IRIX)
- // IRIX
- cores = (int)sysconf(_SC_NPROC_ONLN);
#elif defined(Q_OS_INTEGRITY)
#if (__INTEGRITY_MAJOR_VERSION >= 10)
// Integrity V10+ does support multicore CPUs
diff --git a/src/corelib/thread/qthreadpool.cpp b/src/corelib/thread/qthreadpool.cpp
index 8eca3b56e4..157cbeaf4d 100644
--- a/src/corelib/thread/qthreadpool.cpp
+++ b/src/corelib/thread/qthreadpool.cpp
@@ -56,7 +56,7 @@ class QThreadPoolThread : public QThread
{
public:
QThreadPoolThread(QThreadPoolPrivate *manager);
- void run() Q_DECL_OVERRIDE;
+ void run() override;
void registerThreadInactive();
QWaitCondition runnableReady;
diff --git a/src/corelib/thread/qthreadpool.h b/src/corelib/thread/qthreadpool.h
index a65eacc996..606e192768 100644
--- a/src/corelib/thread/qthreadpool.h
+++ b/src/corelib/thread/qthreadpool.h
@@ -62,7 +62,7 @@ class Q_CORE_EXPORT QThreadPool : public QObject
friend class QFutureInterfaceBase;
public:
- QThreadPool(QObject *parent = Q_NULLPTR);
+ QThreadPool(QObject *parent = nullptr);
~QThreadPool();
static QThreadPool *globalInstance();
diff --git a/src/corelib/thread/thread.pri b/src/corelib/thread/thread.pri
index 0a989cfcaf..a4cb2478c6 100644
--- a/src/corelib/thread/thread.pri
+++ b/src/corelib/thread/thread.pri
@@ -22,6 +22,7 @@ HEADERS += thread/qmutex.h \
# private headers
HEADERS += thread/qmutex_p.h \
thread/qmutexpool_p.h \
+ thread/qfutex_p.h \
thread/qfutureinterface_p.h \
thread/qfuturewatcher_p.h \
thread/qorderedmutexlocker_p.h \
diff --git a/src/corelib/tools/qarraydata.h b/src/corelib/tools/qarraydata.h
index 88f0cfb0ea..f0cc56e899 100644
--- a/src/corelib/tools/qarraydata.h
+++ b/src/corelib/tools/qarraydata.h
@@ -139,7 +139,7 @@ struct QTypedArrayData
typedef T *pointer;
typedef T &reference;
- inline iterator() : i(Q_NULLPTR) {}
+ inline iterator() : i(nullptr) {}
inline iterator(T *n) : i(n) {}
inline iterator(const iterator &o): i(o.i){} // #### Qt 6: remove, the implicit version is fine
inline T &operator*() const { return *i; }
@@ -173,7 +173,7 @@ struct QTypedArrayData
typedef const T *pointer;
typedef const T &reference;
- inline const_iterator() : i(Q_NULLPTR) {}
+ inline const_iterator() : i(nullptr) {}
inline const_iterator(const T *n) : i(n) {}
inline const_iterator(const const_iterator &o): i(o.i) {} // #### Qt 6: remove, the default version is fine
inline explicit const_iterator(const iterator &o): i(o.i) {}
diff --git a/src/corelib/tools/qbytearray.h b/src/corelib/tools/qbytearray.h
index 732d3afc17..300f795469 100644
--- a/src/corelib/tools/qbytearray.h
+++ b/src/corelib/tools/qbytearray.h
@@ -340,16 +340,16 @@ public:
inline QT_ASCII_CAST_WARN bool operator>=(const QString &s2) const;
#endif
- short toShort(bool *ok = Q_NULLPTR, int base = 10) const;
- ushort toUShort(bool *ok = Q_NULLPTR, int base = 10) const;
- int toInt(bool *ok = Q_NULLPTR, int base = 10) const;
- uint toUInt(bool *ok = Q_NULLPTR, int base = 10) const;
- long toLong(bool *ok = Q_NULLPTR, int base = 10) const;
- ulong toULong(bool *ok = Q_NULLPTR, int base = 10) const;
- qlonglong toLongLong(bool *ok = Q_NULLPTR, int base = 10) const;
- qulonglong toULongLong(bool *ok = Q_NULLPTR, int base = 10) const;
- float toFloat(bool *ok = Q_NULLPTR) const;
- double toDouble(bool *ok = Q_NULLPTR) const;
+ short toShort(bool *ok = nullptr, int base = 10) const;
+ ushort toUShort(bool *ok = nullptr, int base = 10) const;
+ int toInt(bool *ok = nullptr, int base = 10) const;
+ uint toUInt(bool *ok = nullptr, int base = 10) const;
+ long toLong(bool *ok = nullptr, int base = 10) const;
+ ulong toULong(bool *ok = nullptr, int base = 10) const;
+ qlonglong toLongLong(bool *ok = nullptr, int base = 10) const;
+ qulonglong toULongLong(bool *ok = nullptr, int base = 10) const;
+ float toFloat(bool *ok = nullptr) const;
+ double toDouble(bool *ok = nullptr) const;
QByteArray toBase64(Base64Options options) const;
QByteArray toBase64() const; // ### Qt6 merge with previous
QByteArray toHex() const;
diff --git a/src/corelib/tools/qbytearraylist.h b/src/corelib/tools/qbytearraylist.h
index 501bb2e0d5..ed014dd157 100644
--- a/src/corelib/tools/qbytearraylist.h
+++ b/src/corelib/tools/qbytearraylist.h
@@ -70,7 +70,7 @@ protected:
#endif
public:
inline QByteArray join() const
- { return QtPrivate::QByteArrayList_join(self(), Q_NULLPTR, 0); }
+ { return QtPrivate::QByteArrayList_join(self(), nullptr, 0); }
inline QByteArray join(const QByteArray &sep) const
{ return QtPrivate::QByteArrayList_join(self(), sep.constData(), sep.size()); }
inline QByteArray join(char sep) const
diff --git a/src/corelib/tools/qcollator.h b/src/corelib/tools/qcollator.h
index d81c7c85e3..6fa199cb0f 100644
--- a/src/corelib/tools/qcollator.h
+++ b/src/corelib/tools/qcollator.h
@@ -89,7 +89,7 @@ public:
QCollator &operator=(const QCollator &);
#ifdef Q_COMPILER_RVALUE_REFS
QCollator(QCollator &&other) Q_DECL_NOTHROW
- : d(other.d) { other.d = Q_NULLPTR; }
+ : d(other.d) { other.d = nullptr; }
QCollator &operator=(QCollator &&other) Q_DECL_NOTHROW
{ swap(other); return *this; }
#endif
diff --git a/src/corelib/tools/qcollator_win.cpp b/src/corelib/tools/qcollator_win.cpp
index bce896278e..5a838c1b50 100644
--- a/src/corelib/tools/qcollator_win.cpp
+++ b/src/corelib/tools/qcollator_win.cpp
@@ -70,12 +70,8 @@ void QCollatorPrivate::init()
if (caseSensitivity == Qt::CaseInsensitive)
collator |= NORM_IGNORECASE;
- if (numericMode) {
- if (QSysInfo::windowsVersion() >= QSysInfo::WV_WINDOWS7)
- collator |= SORT_DIGITSASNUMBERS;
- else
- qWarning("Numeric sorting unsupported on Windows versions older than Windows 7.");
- }
+ if (numericMode)
+ collator |= SORT_DIGITSASNUMBERS;
if (ignorePunctuation)
collator |= NORM_IGNORESYMBOLS;
diff --git a/src/corelib/tools/qdatetime.h b/src/corelib/tools/qdatetime.h
index adab47fc1f..a390bce95f 100644
--- a/src/corelib/tools/qdatetime.h
+++ b/src/corelib/tools/qdatetime.h
@@ -79,7 +79,7 @@ public:
int dayOfYear() const;
int daysInMonth() const;
int daysInYear() const;
- int weekNumber(int *yearNum = Q_NULLPTR) const;
+ int weekNumber(int *yearNum = nullptr) const;
#if QT_DEPRECATED_SINCE(5, 11) && !defined QT_NO_TEXTDATE
QT_DEPRECATED_X("Use QLocale::monthName or QLocale::standaloneMonthName")
diff --git a/src/corelib/tools/qeasingcurve.cpp b/src/corelib/tools/qeasingcurve.cpp
index 03bb1a1411..0b8fa4ca74 100644
--- a/src/corelib/tools/qeasingcurve.cpp
+++ b/src/corelib/tools/qeasingcurve.cpp
@@ -496,7 +496,7 @@ struct BezierEase : public QEasingCurveFunction
}
}
- QEasingCurveFunction *copy() const Q_DECL_OVERRIDE
+ QEasingCurveFunction *copy() const override
{
BezierEase *rv = new BezierEase();
rv->_t = _t;
@@ -532,7 +532,7 @@ struct BezierEase : public QEasingCurveFunction
return newT;
}
- qreal value(qreal x) Q_DECL_OVERRIDE
+ qreal value(qreal x) override
{
Q_ASSERT(_bezierCurves.count() % 3 == 0);
@@ -826,7 +826,7 @@ struct TCBEase : public BezierEase
: BezierEase(QEasingCurve::TCBSpline)
{ }
- qreal value(qreal x) Q_DECL_OVERRIDE
+ qreal value(qreal x) override
{
Q_ASSERT(_bezierCurves.count() % 3 == 0);
@@ -846,7 +846,7 @@ struct ElasticEase : public QEasingCurveFunction
: QEasingCurveFunction(type, qreal(0.3), qreal(1.0))
{ }
- QEasingCurveFunction *copy() const Q_DECL_OVERRIDE
+ QEasingCurveFunction *copy() const override
{
ElasticEase *rv = new ElasticEase(_t);
rv->_p = _p;
@@ -856,7 +856,7 @@ struct ElasticEase : public QEasingCurveFunction
return rv;
}
- qreal value(qreal t) Q_DECL_OVERRIDE
+ qreal value(qreal t) override
{
qreal p = (_p < 0) ? qreal(0.3) : _p;
qreal a = (_a < 0) ? qreal(1.0) : _a;
@@ -881,7 +881,7 @@ struct BounceEase : public QEasingCurveFunction
: QEasingCurveFunction(type, qreal(0.3), qreal(1.0))
{ }
- QEasingCurveFunction *copy() const Q_DECL_OVERRIDE
+ QEasingCurveFunction *copy() const override
{
BounceEase *rv = new BounceEase(_t);
rv->_a = _a;
@@ -890,7 +890,7 @@ struct BounceEase : public QEasingCurveFunction
return rv;
}
- qreal value(qreal t) Q_DECL_OVERRIDE
+ qreal value(qreal t) override
{
qreal a = (_a < 0) ? qreal(1.0) : _a;
switch(_t) {
@@ -914,7 +914,7 @@ struct BackEase : public QEasingCurveFunction
: QEasingCurveFunction(type, qreal(0.3), qreal(1.0), qreal(1.70158))
{ }
- QEasingCurveFunction *copy() const Q_DECL_OVERRIDE
+ QEasingCurveFunction *copy() const override
{
BackEase *rv = new BackEase(_t);
rv->_o = _o;
@@ -923,7 +923,7 @@ struct BackEase : public QEasingCurveFunction
return rv;
}
- qreal value(qreal t) Q_DECL_OVERRIDE
+ qreal value(qreal t) override
{
qreal o = (_o < 0) ? qreal(1.70158) : _o;
switch(_t) {
@@ -1488,7 +1488,7 @@ QDataStream &operator>>(QDataStream &stream, QEasingCurve &easing)
bool hasConfig;
stream >> hasConfig;
delete easing.d_ptr->config;
- easing.d_ptr->config = Q_NULLPTR;
+ easing.d_ptr->config = nullptr;
if (hasConfig) {
QEasingCurveFunction *config = curveToFunctionObject(type);
stream >> config->_p;
diff --git a/src/corelib/tools/qeasingcurve.h b/src/corelib/tools/qeasingcurve.h
index ba06de8f9e..74bde5825a 100644
--- a/src/corelib/tools/qeasingcurve.h
+++ b/src/corelib/tools/qeasingcurve.h
@@ -81,7 +81,7 @@ 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 = Q_NULLPTR; }
+ QEasingCurve(QEasingCurve &&other) Q_DECL_NOTHROW : d_ptr(other.d_ptr) { other.d_ptr = nullptr; }
QEasingCurve &operator=(QEasingCurve &&other) Q_DECL_NOTHROW
{ qSwap(d_ptr, other.d_ptr); return *this; }
#endif
diff --git a/src/corelib/tools/qhash.h b/src/corelib/tools/qhash.h
index 715acc77ce..e7ce4b658f 100644
--- a/src/corelib/tools/qhash.h
+++ b/src/corelib/tools/qhash.h
@@ -315,7 +315,7 @@ public:
typedef T *pointer;
typedef T &reference;
- inline iterator() : i(Q_NULLPTR) { }
+ inline iterator() : i(nullptr) { }
explicit inline iterator(void *node) : i(reinterpret_cast<QHashData::Node *>(node)) { }
inline const Key &key() const { return concrete(i)->key; }
@@ -373,7 +373,7 @@ public:
typedef const T *pointer;
typedef const T &reference;
- Q_DECL_CONSTEXPR inline const_iterator() : i(Q_NULLPTR) { }
+ Q_DECL_CONSTEXPR inline const_iterator() : i(nullptr) { }
explicit inline const_iterator(void *node)
: i(reinterpret_cast<QHashData::Node *>(node)) { }
#ifdef QT_STRICT_ITERATORS
@@ -502,7 +502,7 @@ public:
private:
void detach_helper();
void freeData(QHashData *d);
- Node **findNode(const Key &key, uint *hp = Q_NULLPTR) const;
+ Node **findNode(const Key &key, uint *hp = nullptr) const;
Node **findNode(const Key &key, uint h) const;
Node *createNode(uint h, const Key &key, const T &value, Node **nextNode);
void deleteNode(Node *node);
@@ -550,7 +550,7 @@ template <class Key, class T>
Q_INLINE_TEMPLATE void QHash<Key, T>::duplicateNode(QHashData::Node *node, void *newNode)
{
Node *concreteNode = concrete(node);
- new (newNode) Node(concreteNode->key, concreteNode->value, concreteNode->h, Q_NULLPTR);
+ new (newNode) Node(concreteNode->key, concreteNode->value, concreteNode->h, nullptr);
}
template <class Key, class T>
diff --git a/src/corelib/tools/qlinkedlist.h b/src/corelib/tools/qlinkedlist.h
index 9f54ba7825..c8f3f4c8c3 100644
--- a/src/corelib/tools/qlinkedlist.h
+++ b/src/corelib/tools/qlinkedlist.h
@@ -134,7 +134,7 @@ public:
typedef T *pointer;
typedef T &reference;
Node *i;
- inline iterator() : i(Q_NULLPTR) {}
+ 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) {}
@@ -171,7 +171,7 @@ public:
typedef const T *pointer;
typedef const T &reference;
Node *i;
- inline const_iterator() : i(Q_NULLPTR) {}
+ inline const_iterator() : i(nullptr) {}
inline const_iterator(Node *n) : i(n) {}
inline const_iterator(iterator ci) : i(ci.i){}
#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
diff --git a/src/corelib/tools/qlist.h b/src/corelib/tools/qlist.h
index 1042c29460..af7659e995 100644
--- a/src/corelib/tools/qlist.h
+++ b/src/corelib/tools/qlist.h
@@ -231,7 +231,7 @@ public:
typedef T *pointer;
typedef T &reference;
- inline iterator() Q_DECL_NOTHROW : i(Q_NULLPTR) {}
+ inline iterator() Q_DECL_NOTHROW : i(nullptr) {}
inline iterator(Node *n) Q_DECL_NOTHROW : 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,
@@ -283,7 +283,7 @@ public:
typedef const T *pointer;
typedef const T &reference;
- inline const_iterator() Q_DECL_NOTHROW : i(Q_NULLPTR) {}
+ inline const_iterator() Q_DECL_NOTHROW : i(nullptr) {}
inline const_iterator(Node *n) Q_DECL_NOTHROW : 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,
diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp
index 07bc1f8275..179784c7ba 100644
--- a/src/corelib/tools/qlocale.cpp
+++ b/src/corelib/tools/qlocale.cpp
@@ -3151,11 +3151,15 @@ QString QLocaleData::longLongToString(const QChar zero, const QChar group,
negative = false; // neither are negative numbers
}
- QString num_str;
- if (base == 10)
- num_str = qlltoa(l, base, zero);
- else
- num_str = qulltoa(l, base, zero);
+QT_WARNING_PUSH
+ /* "unary minus operator applied to unsigned type, result still unsigned" */
+QT_WARNING_DISABLE_MSVC(4146)
+ /*
+ Negating std::numeric_limits<qlonglong>::min() hits undefined behavior, so
+ taking an absolute value has to cast to unsigned to change sign.
+ */
+ QString num_str = qulltoa(negative ? -qulonglong(l) : qulonglong(l), base, zero);
+QT_WARNING_POP
uint cnt_thousand_sep = 0;
if (flags & ThousandsGroup && base == 10) {
diff --git a/src/corelib/tools/qlocale.h b/src/corelib/tools/qlocale.h
index 54b1a32946..ef7a26ea79 100644
--- a/src/corelib/tools/qlocale.h
+++ b/src/corelib/tools/qlocale.h
@@ -949,23 +949,23 @@ public:
QString nativeCountryName() const;
#if QT_STRINGVIEW_LEVEL < 2
- short toShort(const QString &s, bool *ok = Q_NULLPTR) const;
- ushort toUShort(const QString &s, bool *ok = Q_NULLPTR) const;
- int toInt(const QString &s, bool *ok = Q_NULLPTR) const;
- uint toUInt(const QString &s, bool *ok = Q_NULLPTR) const;
- qlonglong toLongLong(const QString &s, bool *ok = Q_NULLPTR) const;
- qulonglong toULongLong(const QString &s, bool *ok = Q_NULLPTR) const;
- float toFloat(const QString &s, bool *ok = Q_NULLPTR) const;
- double toDouble(const QString &s, bool *ok = Q_NULLPTR) const;
+ short toShort(const QString &s, bool *ok = nullptr) const;
+ ushort toUShort(const QString &s, bool *ok = nullptr) const;
+ int toInt(const QString &s, bool *ok = nullptr) const;
+ uint toUInt(const QString &s, bool *ok = nullptr) const;
+ qlonglong toLongLong(const QString &s, bool *ok = nullptr) const;
+ qulonglong toULongLong(const QString &s, bool *ok = nullptr) const;
+ float toFloat(const QString &s, bool *ok = nullptr) const;
+ double toDouble(const QString &s, bool *ok = nullptr) const;
- short toShort(const QStringRef &s, bool *ok = Q_NULLPTR) const;
- ushort toUShort(const QStringRef &s, bool *ok = Q_NULLPTR) const;
- int toInt(const QStringRef &s, bool *ok = Q_NULLPTR) const;
- uint toUInt(const QStringRef &s, bool *ok = Q_NULLPTR) const;
- qlonglong toLongLong(const QStringRef &s, bool *ok = Q_NULLPTR) const;
- qulonglong toULongLong(const QStringRef &s, bool *ok = Q_NULLPTR) const;
- float toFloat(const QStringRef &s, bool *ok = Q_NULLPTR) const;
- double toDouble(const QStringRef &s, bool *ok = Q_NULLPTR) const;
+ short toShort(const QStringRef &s, bool *ok = nullptr) const;
+ ushort toUShort(const QStringRef &s, bool *ok = nullptr) const;
+ int toInt(const QStringRef &s, bool *ok = nullptr) const;
+ uint toUInt(const QStringRef &s, bool *ok = nullptr) const;
+ qlonglong toLongLong(const QStringRef &s, bool *ok = nullptr) const;
+ qulonglong toULongLong(const QStringRef &s, bool *ok = nullptr) const;
+ float toFloat(const QStringRef &s, bool *ok = nullptr) const;
+ double toDouble(const QStringRef &s, bool *ok = nullptr) const;
#endif
short toShort(QStringView s, bool *ok = nullptr) const;
diff --git a/src/corelib/tools/qlocale_tools.cpp b/src/corelib/tools/qlocale_tools.cpp
index 3e4f37501e..4d969a4723 100644
--- a/src/corelib/tools/qlocale_tools.cpp
+++ b/src/corelib/tools/qlocale_tools.cpp
@@ -456,11 +456,6 @@ QString qulltoa(qulonglong l, int base, const QChar _zero)
return QString(reinterpret_cast<QChar *>(p), 65 - (p - buff));
}
-QString qlltoa(qlonglong l, int base, const QChar zero)
-{
- return qulltoa(l < 0 ? -l : l, base, zero);
-}
-
QString &decimalForm(QChar zero, QChar decimal, QChar group,
QString &digits, int decpt, int precision,
PrecisionMode pm,
diff --git a/src/corelib/tools/qlocale_tools_p.h b/src/corelib/tools/qlocale_tools_p.h
index 6133f67add..742abb4957 100644
--- a/src/corelib/tools/qlocale_tools_p.h
+++ b/src/corelib/tools/qlocale_tools_p.h
@@ -83,7 +83,6 @@ void doubleToAscii(double d, QLocaleData::DoubleForm form, int precision, char *
bool &sign, int &length, int &decpt);
QString qulltoa(qulonglong l, int base, const QChar _zero);
-QString qlltoa(qlonglong l, int base, const QChar zero);
Q_CORE_EXPORT QString qdtoa(qreal d, int *decpt, int *sign);
enum PrecisionMode {
diff --git a/src/corelib/tools/qlocale_win.cpp b/src/corelib/tools/qlocale_win.cpp
index 1d80320d8e..30aefb71c1 100644
--- a/src/corelib/tools/qlocale_win.cpp
+++ b/src/corelib/tools/qlocale_win.cpp
@@ -326,9 +326,7 @@ QVariant QSystemLocalePrivate::timeFormat(QLocale::FormatType type)
{
switch (type) {
case QLocale::ShortFormat:
- if (QSysInfo::windowsVersion() >= QSysInfo::WV_WINDOWS7)
- return winToQtFormat(getLocaleInfo(LOCALE_SSHORTTIME));
- // fall through
+ return winToQtFormat(getLocaleInfo(LOCALE_SSHORTTIME));
case QLocale::LongFormat:
return winToQtFormat(getLocaleInfo(LOCALE_STIMEFORMAT));
case QLocale::NarrowFormat:
@@ -367,7 +365,7 @@ QVariant QSystemLocalePrivate::dayName(int day, QLocale::FormatType type)
if (type == QLocale::LongFormat)
return getLocaleInfo(long_day_map[day]);
- else if (type == QLocale::NarrowFormat && QSysInfo::windowsVersion() >= QSysInfo::WV_VISTA)
+ else if (type == QLocale::NarrowFormat)
return getLocaleInfo(narrow_day_map[day]);
return getLocaleInfo(short_day_map[day]);
}
@@ -425,7 +423,7 @@ QVariant QSystemLocalePrivate::toString(const QTime &time, QLocale::FormatType t
DWORD flags = 0;
// keep the same conditional as timeFormat() above
- if (type == QLocale::ShortFormat && QSysInfo::windowsVersion() >= QSysInfo::WV_WINDOWS7)
+ if (type == QLocale::ShortFormat)
flags = TIME_NOSECONDS;
wchar_t buf[255];
@@ -656,15 +654,11 @@ QVariant QSystemLocalePrivate::uiLanguages()
QVariant QSystemLocalePrivate::nativeLanguageName()
{
- if (QSysInfo::windowsVersion() < QSysInfo::WV_WINDOWS7)
- return getLocaleInfo(LOCALE_SNATIVELANGNAME);
return getLocaleInfo(LOCALE_SNATIVELANGUAGENAME);
}
QVariant QSystemLocalePrivate::nativeCountryName()
{
- if (QSysInfo::windowsVersion() < QSysInfo::WV_WINDOWS7)
- return getLocaleInfo(LOCALE_SNATIVECTRYNAME);
return getLocaleInfo(LOCALE_SNATIVECOUNTRYNAME);
}
diff --git a/src/corelib/tools/qmap.cpp b/src/corelib/tools/qmap.cpp
index afdd30e5c8..5a20c581e9 100644
--- a/src/corelib/tools/qmap.cpp
+++ b/src/corelib/tools/qmap.cpp
@@ -509,7 +509,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa QMapIterator, QMutableMapIterator, QHash, QSet
*/
-/*! \fn QMap::QMap()
+/*! \fn template <class Key, class T> QMap<Key, T>::QMap()
Constructs an empty map.
@@ -517,7 +517,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
*/
/*!
- \fn QMap::QMap(QMap<Key, T> &&other)
+ \fn template <class Key, class T> QMap<Key, T>::QMap(QMap<Key, T> &&other)
Move-constructs a QMap instance, making it point at the same
object that \a other was pointing to.
@@ -525,7 +525,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
\since 5.2
*/
-/*! \fn QMap::QMap(const QMap<Key, T> &other)
+/*! \fn template <class Key, class T> QMap<Key, T>::QMap(const QMap<Key, T> &other)
Constructs a copy of \a other.
@@ -537,14 +537,14 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa operator=()
*/
-/*! \fn QMap::QMap(const std::map<Key, T> & other)
+/*! \fn template <class Key, class T> QMap<Key, T>::QMap(const std::map<Key, T> & other)
Constructs a copy of \a other.
\sa toStdMap()
*/
-/*! \fn QMap::QMap(std::initializer_list<std::pair<Key,T> > list)
+/*! \fn template <class Key, class T> QMap<Key, T>::QMap(std::initializer_list<std::pair<Key,T> > list)
\since 5.1
Constructs a map with a copy of each of the elements in the
@@ -554,45 +554,45 @@ void QMapDataBase::freeData(QMapDataBase *d)
compiled in C++11 mode.
*/
-/*! \fn std::map<Key, T> QMap::toStdMap() const
+/*! \fn template <class Key, class T> std::map<Key, T> QMap<Key, T>::toStdMap() const
Returns an STL map equivalent to this QMap.
*/
-/*! \fn QMap::~QMap()
+/*! \fn template <class Key, class T> QMap<Key, T>::~QMap()
Destroys the map. References to the values in the map, and all
iterators over this map, become invalid.
*/
-/*! \fn QMap<Key, T> &QMap::operator=(const QMap<Key, T> &other)
+/*! \fn template <class Key, class T> QMap<Key, T> &QMap<Key, T>::operator=(const QMap<Key, T> &other)
Assigns \a other to this map and returns a reference to this map.
*/
/*!
- \fn QMap<Key, T> &QMap::operator=(QMap<Key, T> &&other)
+ \fn template <class Key, class T> QMap<Key, T> &QMap<Key, T>::operator=(QMap<Key, T> &&other)
Move-assigns \a other to this QMap instance.
\since 5.2
*/
-/*! \fn void QMap::swap(QMap<Key, T> &other)
+/*! \fn template <class Key, class T> void QMap<Key, T>::swap(QMap<Key, T> &other)
\since 4.8
Swaps map \a other with this map. This operation is very
fast and never fails.
*/
-/*! \fn void QMultiMap::swap(QMultiMap<Key, T> &other)
+/*! \fn template <class Key, class T> void QMultiMap<Key, T>::swap(QMultiMap<Key, T> &other)
\since 4.8
Swaps map \a other with this map. This operation is very
fast and never fails.
*/
-/*! \fn bool QMap::operator==(const QMap<Key, T> &other) const
+/*! \fn template <class Key, class T> bool QMap<Key, T>::operator==(const QMap<Key, T> &other) const
Returns \c true if \a other is equal to this map; otherwise returns
false.
@@ -606,7 +606,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa operator!=()
*/
-/*! \fn bool QMap::operator!=(const QMap<Key, T> &other) const
+/*! \fn template <class Key, class T> bool QMap<Key, T>::operator!=(const QMap<Key, T> &other) const
Returns \c true if \a other is not equal to this map; otherwise
returns \c false.
@@ -620,7 +620,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa operator==()
*/
-/*! \fn int QMap::size() const
+/*! \fn template <class Key, class T> int QMap<Key, T>::size() const
Returns the number of (key, value) pairs in the map.
@@ -628,7 +628,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
*/
/*!
- \fn bool QMap::isEmpty() const
+ \fn template <class Key, class T> bool QMap<Key, T>::isEmpty() const
Returns \c true if the map contains no items; otherwise returns
false.
@@ -636,7 +636,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa size()
*/
-/*! \fn void QMap::detach()
+/*! \fn template <class Key, class T> void QMap<Key, T>::detach()
\internal
@@ -646,7 +646,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa isDetached()
*/
-/*! \fn bool QMap::isDetached() const
+/*! \fn template <class Key, class T> bool QMap<Key, T>::isDetached() const
\internal
@@ -656,24 +656,24 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa detach()
*/
-/*! \fn void QMap::setSharable(bool sharable)
+/*! \fn template <class Key, class T> void QMap<Key, T>::setSharable(bool sharable)
\internal
*/
-/*! \fn bool QMap::isSharedWith(const QMap<Key, T> &other) const
+/*! \fn template <class Key, class T> bool QMap<Key, T>::isSharedWith(const QMap<Key, T> &other) const
\internal
*/
-/*! \fn void QMap::clear()
+/*! \fn template <class Key, class T> void QMap<Key, T>::clear()
Removes all items from the map.
\sa remove()
*/
-/*! \fn int QMap::remove(const Key &key)
+/*! \fn template <class Key, class T> int QMap<Key, T>::remove(const Key &key)
Removes all the items that have the key \a key from the map.
Returns the number of items removed which is usually 1 but will be
@@ -683,7 +683,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa clear(), take(), QMultiMap::remove()
*/
-/*! \fn T QMap::take(const Key &key)
+/*! \fn template <class Key, class T> T QMap<Key, T>::take(const Key &key)
Removes the item with the key \a key from the map and returns
the value associated with it.
@@ -698,7 +698,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa remove()
*/
-/*! \fn bool QMap::contains(const Key &key) const
+/*! \fn template <class Key, class T> bool QMap<Key, T>::contains(const Key &key) const
Returns \c true if the map contains an item with key \a key;
otherwise returns \c false.
@@ -706,7 +706,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa count(), QMultiMap::contains()
*/
-/*! \fn const T QMap::value(const Key &key, const T &defaultValue) const
+/*! \fn template <class Key, class T> const T QMap<Key, T>::value(const Key &key, const T &defaultValue) const
Returns the value associated with the key \a key.
@@ -719,7 +719,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa key(), values(), contains(), operator[]()
*/
-/*! \fn T &QMap::operator[](const Key &key)
+/*! \fn template <class Key, class T> T &QMap<Key, T>::operator[](const Key &key)
Returns the value associated with the key \a key as a modifiable
reference.
@@ -733,14 +733,14 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa insert(), value()
*/
-/*! \fn const T QMap::operator[](const Key &key) const
+/*! \fn template <class Key, class T> const T QMap<Key, T>::operator[](const Key &key) const
\overload
Same as value().
*/
-/*! \fn QList<Key> QMap::uniqueKeys() const
+/*! \fn template <class Key, class T> QList<Key> QMap<Key, T>::uniqueKeys() const
\since 4.2
Returns a list containing all the keys in the map in ascending
@@ -751,7 +751,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa keys(), values()
*/
-/*! \fn QList<Key> QMap::keys() const
+/*! \fn template <class Key, class T> QList<Key> QMap<Key, T>::keys() const
Returns a list containing all the keys in the map in ascending
order. Keys that occur multiple times in the map (because items
@@ -766,7 +766,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa uniqueKeys(), values(), key()
*/
-/*! \fn QList<Key> QMap::keys(const T &value) const
+/*! \fn template <class Key, class T> QList<Key> QMap<Key, T>::keys(const T &value) const
\overload
@@ -779,7 +779,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
*/
/*!
- \fn Key QMap::key(const T &value, const Key &defaultKey) const
+ \fn template <class Key, class T> Key QMap<Key, T>::key(const T &value, const Key &defaultKey) const
\since 4.3
\overload
@@ -795,7 +795,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa value(), keys()
*/
-/*! \fn QList<T> QMap::values() const
+/*! \fn template <class Key, class T> QList<T> QMap<Key, T>::values() const
Returns a list containing all the values in the map, in ascending
order of their keys. If a key is associated with multiple values,
@@ -805,7 +805,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa keys(), value()
*/
-/*! \fn QList<T> QMap::values(const Key &key) const
+/*! \fn template <class Key, class T> QList<T> QMap<Key, T>::values(const Key &key) const
\overload
@@ -816,21 +816,21 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa count(), insertMulti()
*/
-/*! \fn int QMap::count(const Key &key) const
+/*! \fn template <class Key, class T> int QMap<Key, T>::count(const Key &key) const
Returns the number of items associated with key \a key.
\sa contains(), insertMulti(), QMultiMap::count()
*/
-/*! \fn int QMap::count() const
+/*! \fn template <class Key, class T> int QMap<Key, T>::count() const
\overload
Same as size().
*/
-/*! \fn QMap::iterator QMap::begin()
+/*! \fn template <class Key, class T> QMap<Key, T>::iterator QMap<Key, T>::begin()
Returns an \l{STL-style iterators}{STL-style iterator} pointing to the first item in
the map.
@@ -838,12 +838,12 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa constBegin(), end()
*/
-/*! \fn QMap::const_iterator QMap::begin() const
+/*! \fn template <class Key, class T> QMap<Key, T>::const_iterator QMap<Key, T>::begin() const
\overload
*/
-/*! \fn QMap::const_iterator QMap::cbegin() const
+/*! \fn template <class Key, class T> QMap<Key, T>::const_iterator QMap<Key, T>::cbegin() const
\since 5.0
Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first item
@@ -852,7 +852,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa begin(), cend()
*/
-/*! \fn QMap::const_iterator QMap::constBegin() const
+/*! \fn template <class Key, class T> QMap<Key, T>::const_iterator QMap<Key, T>::constBegin() const
Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first item
in the map.
@@ -860,7 +860,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa begin(), constEnd()
*/
-/*! \fn QMap::key_iterator QMap::keyBegin() const
+/*! \fn template <class Key, class T> QMap<Key, T>::key_iterator QMap<Key, T>::keyBegin() const
\since 5.6
Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first key
@@ -869,7 +869,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa keyEnd(), firstKey()
*/
-/*! \fn QMap::iterator QMap::end()
+/*! \fn template <class Key, class T> QMap<Key, T>::iterator QMap<Key, T>::end()
Returns an \l{STL-style iterators}{STL-style iterator} pointing to the imaginary item
after the last item in the map.
@@ -877,12 +877,12 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa begin(), constEnd()
*/
-/*! \fn QMap::const_iterator QMap::end() const
+/*! \fn template <class Key, class T> QMap<Key, T>::const_iterator QMap<Key, T>::end() const
\overload
*/
-/*! \fn QMap::const_iterator QMap::cend() const
+/*! \fn template <class Key, class T> QMap<Key, T>::const_iterator QMap<Key, T>::cend() const
\since 5.0
Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary
@@ -891,7 +891,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa cbegin(), end()
*/
-/*! \fn QMap::const_iterator QMap::constEnd() const
+/*! \fn template <class Key, class T> QMap<Key, T>::const_iterator QMap<Key, T>::constEnd() const
Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary
item after the last item in the map.
@@ -899,7 +899,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa constBegin(), end()
*/
-/*! \fn QMap::key_iterator QMap::keyEnd() const
+/*! \fn template <class Key, class T> QMap<Key, T>::key_iterator QMap<Key, T>::keyEnd() const
\since 5.6
Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary
@@ -909,7 +909,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
*/
-/*! \fn QMap::key_value_iterator QMap::keyValueBegin()
+/*! \fn template <class Key, class T> QMap<Key, T>::key_value_iterator QMap<Key, T>::keyValueBegin()
\since 5.10
Returns an \l{STL-style iterators}{STL-style iterator} pointing to the first entry
@@ -918,7 +918,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa keyValueEnd()
*/
-/*! \fn QMap::key_value_iterator QMap::keyValueEnd()
+/*! \fn template <class Key, class T> QMap<Key, T>::key_value_iterator QMap<Key, T>::keyValueEnd()
\since 5.10
Returns an \l{STL-style iterators}{STL-style iterator} pointing to the imaginary
@@ -927,7 +927,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa keyValueBegin()
*/
-/*! \fn QMap::const_key_value_iterator QMap::keyValueBegin() const
+/*! \fn template <class Key, class T> QMap<Key, T>::const_key_value_iterator QMap<Key, T>::keyValueBegin() const
\since 5.10
Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first entry
@@ -936,7 +936,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa keyValueEnd()
*/
-/*! \fn QMap::const_key_value_iterator QMap::constKeyValueBegin() const
+/*! \fn template <class Key, class T> QMap<Key, T>::const_key_value_iterator QMap<Key, T>::constKeyValueBegin() const
\since 5.10
Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first entry
@@ -945,7 +945,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa keyValueBegin()
*/
-/*! \fn QMap::const_key_value_iterator QMap::keyValueEnd() const
+/*! \fn template <class Key, class T> QMap<Key, T>::const_key_value_iterator QMap<Key, T>::keyValueEnd() const
\since 5.10
Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary
@@ -954,7 +954,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa keyValueBegin()
*/
-/*! \fn QMap::const_key_value_iterator QMap::constKeyValueEnd() const
+/*! \fn template <class Key, class T> QMap<Key, T>::const_key_value_iterator QMap<Key, T>::constKeyValueEnd() const
\since 5.10
Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary
@@ -963,7 +963,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa constKeyValueBegin()
*/
-/*! \fn const Key &QMap::firstKey() const
+/*! \fn template <class Key, class T> const Key &QMap<Key, T>::firstKey() const
\since 5.2
Returns a reference to the smallest key in the map.
@@ -974,7 +974,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa lastKey(), first(), keyBegin(), isEmpty()
*/
-/*! \fn const Key &QMap::lastKey() const
+/*! \fn template <class Key, class T> const Key &QMap<Key, T>::lastKey() const
\since 5.2
Returns a reference to the largest key in the map.
@@ -985,7 +985,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa firstKey(), last(), keyEnd(), isEmpty()
*/
-/*! \fn T &QMap::first()
+/*! \fn template <class Key, class T> T &QMap<Key, T>::first()
\since 5.2
Returns a reference to the first value in the map, that is the value mapped
@@ -996,13 +996,13 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa last(), firstKey(), isEmpty()
*/
-/*! \fn const T &QMap::first() const
+/*! \fn template <class Key, class T> const T &QMap<Key, T>::first() const
\since 5.2
\overload
*/
-/*! \fn T &QMap::last()
+/*! \fn template <class Key, class T> T &QMap<Key, T>::last()
\since 5.2
Returns a reference to the last value in the map, that is the value mapped
@@ -1013,13 +1013,13 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa first(), lastKey(), isEmpty()
*/
-/*! \fn const T &QMap::last() const
+/*! \fn template <class Key, class T> const T &QMap<Key, T>::last() const
\since 5.2
\overload
*/
-/*! \fn QMap::iterator QMap::erase(iterator pos)
+/*! \fn template <class Key, class T> QMap<Key, T>::iterator QMap<Key, T>::erase(iterator pos)
Removes the (key, value) pair pointed to by the iterator \a pos
from the map, and returns an iterator to the next item in the
@@ -1028,7 +1028,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa remove()
*/
-/*! \fn QMap::iterator QMap::find(const Key &key)
+/*! \fn template <class Key, class T> QMap<Key, T>::iterator QMap<Key, T>::find(const Key &key)
Returns an iterator pointing to the item with key \a key in the
map.
@@ -1047,12 +1047,12 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa constFind(), value(), values(), lowerBound(), upperBound(), QMultiMap::find()
*/
-/*! \fn QMap::const_iterator QMap::find(const Key &key) const
+/*! \fn template <class Key, class T> QMap<Key, T>::const_iterator QMap<Key, T>::find(const Key &key) const
\overload
*/
-/*! \fn QMap::const_iterator QMap::constFind(const Key &key) const
+/*! \fn template <class Key, class T> QMap<Key, T>::const_iterator QMap<Key, T>::constFind(const Key &key) const
\since 4.1
Returns an const iterator pointing to the item with key \a key in the
@@ -1064,7 +1064,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa find(), QMultiMap::constFind()
*/
-/*! \fn QMap::iterator QMap::lowerBound(const Key &key)
+/*! \fn template <class Key, class T> QMap<Key, T>::iterator QMap<Key, T>::lowerBound(const Key &key)
Returns an iterator pointing to the first item with key \a key in
the map. If the map contains no item with key \a key, the
@@ -1085,12 +1085,12 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa upperBound(), find()
*/
-/*! \fn QMap::const_iterator QMap::lowerBound(const Key &key) const
+/*! \fn template <class Key, class T> QMap<Key, T>::const_iterator QMap<Key, T>::lowerBound(const Key &key) const
\overload
*/
-/*! \fn QMap::iterator QMap::upperBound(const Key &key)
+/*! \fn template <class Key, class T> QMap<Key, T>::iterator QMap<Key, T>::upperBound(const Key &key)
Returns an iterator pointing to the item that immediately follows
the last item with key \a key in the map. If the map contains no
@@ -1103,12 +1103,12 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa lowerBound(), find()
*/
-/*! \fn QMap::const_iterator QMap::upperBound(const Key &key) const
+/*! \fn template <class Key, class T> QMap<Key, T>::const_iterator QMap<Key, T>::upperBound(const Key &key) const
\overload
*/
-/*! \fn QMap::iterator QMap::insert(const Key &key, const T &value)
+/*! \fn template <class Key, class T> QMap<Key, T>::iterator QMap<Key, T>::insert(const Key &key, const T &value)
Inserts a new item with the key \a key and a value of \a value.
@@ -1121,7 +1121,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa insertMulti()
*/
-/*! \fn QMap::iterator QMap::insert(const_iterator pos, const Key &key, const T &value)
+/*! \fn template <class Key, class T> QMap<Key, T>::iterator QMap<Key, T>::insert(const_iterator pos, const Key &key, const T &value)
\overload
\since 5.1
Inserts a new item with the key \a key and value \a value and with hint \a pos
@@ -1150,7 +1150,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa insertMulti()
*/
-/*! \fn QMap::iterator QMap::insertMulti(const Key &key, const T &value)
+/*! \fn template <class Key, class T> QMap<Key, T>::iterator QMap<Key, T>::insertMulti(const Key &key, const T &value)
Inserts a new item with the key \a key and a value of \a value.
@@ -1162,7 +1162,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa insert(), values()
*/
-/*! \fn QMap::iterator QMap::insertMulti(const_iterator pos, const Key &key, const T &value)
+/*! \fn template <class Key, class T> QMap<Key, T>::iterator QMap<Key, T>::insertMulti(const_iterator pos, const Key &key, const T &value)
\overload
\since 5.1
Inserts a new item with the key \a key and value \a value and with hint \a pos
@@ -1182,7 +1182,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
*/
-/*! \fn QMap<Key, T> &QMap::unite(const QMap<Key, T> &other)
+/*! \fn template <class Key, class T> QMap<Key, T> &QMap<Key, T>::unite(const QMap<Key, T> &other)
Inserts all the items in the \a other map into this map. If a
key is common to both maps, the resulting map will contain the
@@ -1193,12 +1193,12 @@ void QMapDataBase::freeData(QMapDataBase *d)
/*! \typedef QMap::Iterator
- Qt-style synonym for QMap::iterator.
+ Qt-style synonym for QMap<Key, T>::iterator.
*/
/*! \typedef QMap::ConstIterator
- Qt-style synonym for QMap::const_iterator.
+ Qt-style synonym for QMap<Key, T>::const_iterator.
*/
/*! \typedef QMap::difference_type
@@ -1222,7 +1222,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
*/
/*!
- \fn bool QMap::empty() const
+ \fn template <class Key, class T> bool QMap<Key, T>::empty() const
This function is provided for STL compatibility. It is equivalent
to isEmpty(), returning true if the map is empty; otherwise
@@ -1230,14 +1230,14 @@ void QMapDataBase::freeData(QMapDataBase *d)
*/
/*!
- \fn QPair<iterator, iterator> QMap::equal_range(const Key &key)
+ \fn template <class Key, class T> QPair<iterator, iterator> QMap<Key, T>::equal_range(const Key &key)
Returns a pair of iterators delimiting the range of values \c{[first, second)}, that
are stored under \a key.
*/
/*!
- \fn QPair<const_iterator, const_iterator> QMap::equal_range(const Key &key) const
+ \fn template <class Key, class T> QPair<const_iterator, const_iterator> QMap<Key, T>::equal_range(const Key &key) const
\overload
\since 5.6
*/
@@ -1339,7 +1339,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
\internal
*/
-/*! \fn QMap::iterator::iterator()
+/*! \fn template <class Key, class T> QMap<Key, T>::iterator::iterator()
Constructs an uninitialized iterator.
@@ -1350,12 +1350,12 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa QMap::begin(), QMap::end()
*/
-/*! \fn QMap::iterator::iterator(Node *)
+/*! \fn template <class Key, class T> QMap<Key, T>::iterator::iterator(Node *)
\internal
*/
-/*! \fn const Key &QMap::iterator::key() const
+/*! \fn template <class Key, class T> const Key &QMap<Key, T>::iterator::key() const
Returns the current item's key as a const reference.
@@ -1366,7 +1366,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa value()
*/
-/*! \fn T &QMap::iterator::value() const
+/*! \fn template <class Key, class T> T &QMap<Key, T>::iterator::value() const
Returns a modifiable reference to the current item's value.
@@ -1378,7 +1378,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa key(), operator*()
*/
-/*! \fn T &QMap::iterator::operator*() const
+/*! \fn template <class Key, class T> T &QMap<Key, T>::iterator::operator*() const
Returns a modifiable reference to the current item's value.
@@ -1387,7 +1387,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa key()
*/
-/*! \fn T *QMap::iterator::operator->() const
+/*! \fn template <class Key, class T> T *QMap<Key, T>::iterator::operator->() const
Returns a pointer to the current item's value.
@@ -1395,8 +1395,8 @@ void QMapDataBase::freeData(QMapDataBase *d)
*/
/*!
- \fn bool QMap::iterator::operator==(const iterator &other) const
- \fn bool QMap::iterator::operator==(const const_iterator &other) const
+ \fn template <class Key, class T> bool QMap<Key, T>::iterator::operator==(const iterator &other) const
+ \fn template <class Key, class T> bool QMap<Key, T>::iterator::operator==(const const_iterator &other) const
Returns \c true if \a other points to the same item as this
iterator; otherwise returns \c false.
@@ -1405,8 +1405,8 @@ void QMapDataBase::freeData(QMapDataBase *d)
*/
/*!
- \fn bool QMap::iterator::operator!=(const iterator &other) const
- \fn bool QMap::iterator::operator!=(const const_iterator &other) const
+ \fn template <class Key, class T> bool QMap<Key, T>::iterator::operator!=(const iterator &other) const
+ \fn template <class Key, class T> bool QMap<Key, T>::iterator::operator!=(const const_iterator &other) const
Returns \c true if \a other points to a different item than this
iterator; otherwise returns \c false.
@@ -1414,7 +1414,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa operator==()
*/
-/*! \fn QMap::iterator QMap::iterator::operator++()
+/*! \fn template <class Key, class T> QMap<Key, T>::iterator QMap<Key, T>::iterator::operator++()
The prefix ++ operator (\c{++i}) advances the iterator to the
next item in the map and returns an iterator to the new current
@@ -1425,7 +1425,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa operator--()
*/
-/*! \fn QMap::iterator QMap::iterator::operator++(int)
+/*! \fn template <class Key, class T> QMap<Key, T>::iterator QMap<Key, T>::iterator::operator++(int)
\overload
@@ -1434,7 +1434,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
current item.
*/
-/*! \fn QMap::iterator QMap::iterator::operator--()
+/*! \fn template <class Key, class T> QMap<Key, T>::iterator QMap<Key, T>::iterator::operator--()
The prefix -- operator (\c{--i}) makes the preceding item
current and returns an iterator pointing to the new current item.
@@ -1445,7 +1445,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa operator++()
*/
-/*! \fn QMap::iterator QMap::iterator::operator--(int)
+/*! \fn template <class Key, class T> QMap<Key, T>::iterator QMap<Key, T>::iterator::operator--(int)
\overload
@@ -1454,7 +1454,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
current item.
*/
-/*! \fn QMap::iterator QMap::iterator::operator+(int j) const
+/*! \fn template <class Key, class T> QMap<Key, T>::iterator QMap<Key, T>::iterator::operator+(int j) const
Returns an iterator to the item at \a j positions forward from
this iterator. (If \a j is negative, the iterator goes backward.)
@@ -1465,7 +1465,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
*/
-/*! \fn QMap::iterator QMap::iterator::operator-(int j) const
+/*! \fn template <class Key, class T> QMap<Key, T>::iterator QMap<Key, T>::iterator::operator-(int j) const
Returns an iterator to the item at \a j positions backward from
this iterator. (If \a j is negative, the iterator goes forward.)
@@ -1475,7 +1475,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa operator+()
*/
-/*! \fn QMap::iterator &QMap::iterator::operator+=(int j)
+/*! \fn template <class Key, class T> QMap<Key, T>::iterator &QMap<Key, T>::iterator::operator+=(int j)
Advances the iterator by \a j items. (If \a j is negative, the
iterator goes backward.)
@@ -1483,7 +1483,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa operator-=(), operator+()
*/
-/*! \fn QMap::iterator &QMap::iterator::operator-=(int j)
+/*! \fn template <class Key, class T> QMap<Key, T>::iterator &QMap<Key, T>::iterator::operator-=(int j)
Makes the iterator go back by \a j items. (If \a j is negative,
the iterator goes forward.)
@@ -1562,7 +1562,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
\internal
*/
-/*! \fn QMap::const_iterator::const_iterator()
+/*! \fn template <class Key, class T> QMap<Key, T>::const_iterator::const_iterator()
Constructs an uninitialized iterator.
@@ -1573,31 +1573,31 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa QMap::constBegin(), QMap::constEnd()
*/
-/*! \fn QMap::const_iterator::const_iterator(const Node *)
+/*! \fn template <class Key, class T> QMap<Key, T>::const_iterator::const_iterator(const Node *)
\internal
*/
-/*! \fn QMap::const_iterator::const_iterator(const iterator &other)
+/*! \fn template <class Key, class T> QMap<Key, T>::const_iterator::const_iterator(const iterator &other)
Constructs a copy of \a other.
*/
-/*! \fn const Key &QMap::const_iterator::key() const
+/*! \fn template <class Key, class T> const Key &QMap<Key, T>::const_iterator::key() const
Returns the current item's key.
\sa value()
*/
-/*! \fn const T &QMap::const_iterator::value() const
+/*! \fn template <class Key, class T> const T &QMap<Key, T>::const_iterator::value() const
Returns the current item's value.
\sa key(), operator*()
*/
-/*! \fn const T &QMap::const_iterator::operator*() const
+/*! \fn template <class Key, class T> const T &QMap<Key, T>::const_iterator::operator*() const
Returns the current item's value.
@@ -1606,14 +1606,14 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa key()
*/
-/*! \fn const T *QMap::const_iterator::operator->() const
+/*! \fn template <class Key, class T> const T *QMap<Key, T>::const_iterator::operator->() const
Returns a pointer to the current item's value.
\sa value()
*/
-/*! \fn bool QMap::const_iterator::operator==(const const_iterator &other) const
+/*! \fn template <class Key, class T> bool QMap<Key, T>::const_iterator::operator==(const const_iterator &other) const
Returns \c true if \a other points to the same item as this
iterator; otherwise returns \c false.
@@ -1621,7 +1621,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa operator!=()
*/
-/*! \fn bool QMap::const_iterator::operator!=(const const_iterator &other) const
+/*! \fn template <class Key, class T> bool QMap<Key, T>::const_iterator::operator!=(const const_iterator &other) const
Returns \c true if \a other points to a different item than this
iterator; otherwise returns \c false.
@@ -1629,7 +1629,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa operator==()
*/
-/*! \fn QMap::const_iterator QMap::const_iterator::operator++()
+/*! \fn template <class Key, class T> QMap<Key, T>::const_iterator QMap<Key, T>::const_iterator::operator++()
The prefix ++ operator (\c{++i}) advances the iterator to the
next item in the map and returns an iterator to the new current
@@ -1640,7 +1640,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa operator--()
*/
-/*! \fn QMap::const_iterator QMap::const_iterator::operator++(int)
+/*! \fn template <class Key, class T> QMap<Key, T>::const_iterator QMap<Key, T>::const_iterator::operator++(int)
\overload
@@ -1649,7 +1649,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
current item.
*/
-/*! \fn QMap::const_iterator &QMap::const_iterator::operator--()
+/*! \fn template <class Key, class T> QMap<Key, T>::const_iterator &QMap<Key, T>::const_iterator::operator--()
The prefix -- operator (\c{--i}) makes the preceding item
current and returns an iterator pointing to the new current item.
@@ -1660,7 +1660,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa operator++()
*/
-/*! \fn QMap::const_iterator QMap::const_iterator::operator--(int)
+/*! \fn template <class Key, class T> QMap<Key, T>::const_iterator QMap<Key, T>::const_iterator::operator--(int)
\overload
@@ -1669,7 +1669,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
current item.
*/
-/*! \fn QMap::const_iterator QMap::const_iterator::operator+(int j) const
+/*! \fn template <class Key, class T> QMap<Key, T>::const_iterator QMap<Key, T>::const_iterator::operator+(int j) const
Returns an iterator to the item at \a j positions forward from
this iterator. (If \a j is negative, the iterator goes backward.)
@@ -1679,7 +1679,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa operator-()
*/
-/*! \fn QMap::const_iterator QMap::const_iterator::operator-(int j) const
+/*! \fn template <class Key, class T> QMap<Key, T>::const_iterator QMap<Key, T>::const_iterator::operator-(int j) const
Returns an iterator to the item at \a j positions backward from
this iterator. (If \a j is negative, the iterator goes forward.)
@@ -1689,7 +1689,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa operator+()
*/
-/*! \fn QMap::const_iterator &QMap::const_iterator::operator+=(int j)
+/*! \fn template <class Key, class T> QMap<Key, T>::const_iterator &QMap<Key, T>::const_iterator::operator+=(int j)
Advances the iterator by \a j items. (If \a j is negative, the
iterator goes backward.)
@@ -1699,7 +1699,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa operator-=(), operator+()
*/
-/*! \fn QMap::const_iterator &QMap::const_iterator::operator-=(int j)
+/*! \fn template <class Key, class T> QMap<Key, T>::const_iterator &QMap<Key, T>::const_iterator::operator-=(int j)
Makes the iterator go back by \a j items. (If \a j is negative,
the iterator goes forward.)
@@ -1766,17 +1766,17 @@ void QMapDataBase::freeData(QMapDataBase *d)
\internal
*/
-/*! \fn const T &QMap::key_iterator::operator*() const
+/*! \fn template <class Key, class T> const T &QMap<Key, T>::key_iterator::operator*() const
Returns the current item's key.
*/
-/*! \fn const T *QMap::key_iterator::operator->() const
+/*! \fn template <class Key, class T> const T *QMap<Key, T>::key_iterator::operator->() const
Returns a pointer to the current item's key.
*/
-/*! \fn bool QMap::key_iterator::operator==(key_iterator other) const
+/*! \fn template <class Key, class T> bool QMap<Key, T>::key_iterator::operator==(key_iterator other) const
Returns \c true if \a other points to the same item as this
iterator; otherwise returns \c false.
@@ -1784,7 +1784,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa operator!=()
*/
-/*! \fn bool QMap::key_iterator::operator!=(key_iterator other) const
+/*! \fn template <class Key, class T> bool QMap<Key, T>::key_iterator::operator!=(key_iterator other) const
Returns \c true if \a other points to a different item than this
iterator; otherwise returns \c false.
@@ -1793,7 +1793,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
*/
/*!
- \fn QMap::key_iterator &QMap::key_iterator::operator++()
+ \fn template <class Key, class T> QMap<Key, T>::key_iterator &QMap<Key, T>::key_iterator::operator++()
The prefix ++ operator (\c{++i}) advances the iterator to the
next item in the hash and returns an iterator to the new current
@@ -1804,7 +1804,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa operator--()
*/
-/*! \fn QMap::key_iterator QMap::key_iterator::operator++(int)
+/*! \fn template <class Key, class T> QMap<Key, T>::key_iterator QMap<Key, T>::key_iterator::operator++(int)
\overload
@@ -1813,7 +1813,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
item.
*/
-/*! \fn QMap::key_iterator &QMap::key_iterator::operator--()
+/*! \fn template <class Key, class T> QMap<Key, T>::key_iterator &QMap<Key, T>::key_iterator::operator--()
The prefix -- operator (\c{--i}) makes the preceding item
current and returns an iterator pointing to the new current item.
@@ -1824,7 +1824,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa operator++()
*/
-/*! \fn QMap::key_iterator QMap::key_iterator::operator--(int)
+/*! \fn template <class Key, class T> QMap<Key, T>::key_iterator QMap<Key, T>::key_iterator::operator--(int)
\overload
@@ -1833,10 +1833,22 @@ void QMapDataBase::freeData(QMapDataBase *d)
item.
*/
-/*! \fn const_iterator QMap::key_iterator::base() const
+/*! \fn template <class Key, class T> const_iterator QMap<Key, T>::key_iterator::base() const
Returns the underlying const_iterator this key_iterator is based on.
*/
+/*! \typedef QMap::const_key_value_iterator
+ \inmodule QtCore
+ \since 5.10
+ \brief The QMap::const_key_value_iterator typedef provides an STL-style iterator for QMap and QMultiMap.
+
+ QMap::const_key_value_iterator is essentially the same as QMap::const_iterator
+ with the difference that operator*() returns a key/value pair instead of a
+ value.
+
+ \sa QKeyValueIterator
+*/
+
/*! \typedef QMap::key_value_iterator
\inmodule QtCore
\since 5.10
@@ -1849,7 +1861,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa QKeyValueIterator
*/
-/*! \fn QDataStream &operator<<(QDataStream &out, const QMap<Key, T> &map)
+/*! \fn template <class Key, class T> QDataStream &operator<<(QDataStream &out, const QMap<Key, T> &map)
\relates QMap
Writes the map \a map to stream \a out.
@@ -1860,7 +1872,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa{Serializing Qt Data Types}{Format of the QDataStream operators}
*/
-/*! \fn QDataStream &operator>>(QDataStream &in, QMap<Key, T> &map)
+/*! \fn template <class Key, class T> QDataStream &operator>>(QDataStream &in, QMap<Key, T> &map)
\relates QMap
Reads a map from stream \a in into \a map.
@@ -1926,12 +1938,12 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa QMap, QMapIterator, QMutableMapIterator, QMultiHash
*/
-/*! \fn QMultiMap::QMultiMap()
+/*! \fn template <class Key, class T> QMultiMap<Key, T>::QMultiMap()
Constructs an empty map.
*/
-/*! \fn QMultiMap::QMultiMap(std::initializer_list<std::pair<Key,T> > list)
+/*! \fn template <class Key, class T> QMultiMap<Key, T>::QMultiMap(std::initializer_list<std::pair<Key,T> > list)
\since 5.1
Constructs a multi-map with a copy of each of the elements in the
@@ -1941,7 +1953,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
compiled in C++11 mode.
*/
-/*! \fn QMultiMap::QMultiMap(const QMap<Key, T> &other)
+/*! \fn template <class Key, class T> QMultiMap<Key, T>::QMultiMap(const QMap<Key, T> &other)
Constructs a copy of \a other (which can be a QMap or a
QMultiMap).
@@ -1949,7 +1961,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa operator=()
*/
-/*! \fn QMultiMap::iterator QMultiMap::replace(const Key &key, const T &value)
+/*! \fn template <class Key, class T> QMultiMap<Key, T>::iterator QMultiMap<Key, T>::replace(const Key &key, const T &value)
Inserts a new item with the key \a key and a value of \a value.
@@ -1962,7 +1974,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa insert()
*/
-/*! \fn QMultiMap::iterator QMultiMap::insert(const Key &key, const T &value)
+/*! \fn template <class Key, class T> QMultiMap<Key, T>::iterator QMultiMap<Key, T>::insert(const Key &key, const T &value)
Inserts a new item with the key \a key and a value of \a value.
@@ -1974,7 +1986,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa replace()
*/
-/*! \fn QMultiMap::iterator QMultiMap::insert(QMap<Key, T>::const_iterator pos, const Key &key, const T &value)
+/*! \fn template <class Key, class T> typename QMap<Key, T>::iterator QMultiMap<Key, T>::insert(typename QMap<Key, T>::const_iterator pos, const Key &key, const T &value)
\since 5.1
Inserts a new item with the key \a key and value \a value and with hint \a pos
@@ -1991,7 +2003,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
crash but there is also a risk that it will silently corrupt both the map and the \a pos map.
*/
-/*! \fn QMultiMap &QMultiMap::operator+=(const QMultiMap &other)
+/*! \fn template <class Key, class T> QMultiMap &QMultiMap<Key, T>::operator+=(const QMultiMap &other)
Inserts all the items in the \a other map into this map and
returns a reference to this map.
@@ -1999,7 +2011,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa insert(), operator+()
*/
-/*! \fn QMultiMap QMultiMap::operator+(const QMultiMap &other) const
+/*! \fn template <class Key, class T> QMultiMap QMultiMap<Key, T>::operator+(const QMultiMap &other) const
Returns a map that contains all the items in this map in
addition to all the items in \a other. If a key is common to both
@@ -2009,7 +2021,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
*/
/*!
- \fn bool QMultiMap::contains(const Key &key, const T &value) const
+ \fn template <class Key, class T> bool QMultiMap<Key, T>::contains(const Key &key, const T &value) const
\since 4.3
Returns \c true if the map contains an item with key \a key and
@@ -2019,7 +2031,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
*/
/*!
- \fn int QMultiMap::remove(const Key &key, const T &value)
+ \fn template <class Key, class T> int QMultiMap<Key, T>::remove(const Key &key, const T &value)
\since 4.3
Removes all the items that have the key \a key and the value \a
@@ -2029,7 +2041,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
*/
/*!
- \fn int QMultiMap::count(const Key &key, const T &value) const
+ \fn template <class Key, class T> int QMultiMap<Key, T>::count(const Key &key, const T &value) const
\since 4.3
Returns the number of items with key \a key and value \a value.
@@ -2038,7 +2050,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
*/
/*!
- \fn typename QMap<Key, T>::iterator QMultiMap::find(const Key &key, const T &value)
+ \fn template <class Key, class T> typename QMap<Key, T>::iterator QMultiMap<Key, T>::find(const Key &key, const T &value)
\since 4.3
Returns an iterator pointing to the item with key \a key and
@@ -2054,7 +2066,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
*/
/*!
- \fn typename QMap<Key, T>::const_iterator QMultiMap::find(const Key &key, const T &value) const
+ \fn template <class Key, class T> typename QMap<Key, T>::const_iterator QMultiMap<Key, T>::find(const Key &key, const T &value) const
\since 4.3
\overload
@@ -2071,7 +2083,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
*/
/*!
- \fn typename QMap<Key, T>::const_iterator QMultiMap::constFind(const Key &key, const T &value) const
+ \fn template <class Key, class T> typename QMap<Key, T>::const_iterator QMultiMap<Key, T>::constFind(const Key &key, const T &value) const
\since 4.3
Returns an iterator pointing to the item with key \a key and the
diff --git a/src/corelib/tools/qmap.h b/src/corelib/tools/qmap.h
index 16442014ff..fc72c6e32c 100644
--- a/src/corelib/tools/qmap.h
+++ b/src/corelib/tools/qmap.h
@@ -150,7 +150,7 @@ template <class Key, class T>
inline QMapNode<Key, T> *QMapNode<Key, T>::lowerBound(const Key &akey)
{
QMapNode<Key, T> *n = this;
- QMapNode<Key, T> *lastNode = Q_NULLPTR;
+ QMapNode<Key, T> *lastNode = nullptr;
while (n) {
if (!qMapLessThanKey(n->key, akey)) {
lastNode = n;
@@ -166,7 +166,7 @@ template <class Key, class T>
inline QMapNode<Key, T> *QMapNode<Key, T>::upperBound(const Key &akey)
{
QMapNode<Key, T> *n = this;
- QMapNode<Key, T> *lastNode = Q_NULLPTR;
+ QMapNode<Key, T> *lastNode = nullptr;
while (n) {
if (qMapLessThanKey(akey, n->key)) {
lastNode = n;
@@ -220,7 +220,7 @@ struct QMapData : public QMapDataBase
Node *findNode(const Key &akey) const;
void nodeRange(const Key &akey, Node **firstNode, Node **lastNode);
- Node *createNode(const Key &k, const T &v, Node *parent = Q_NULLPTR, bool left = false)
+ Node *createNode(const Key &k, const T &v, Node *parent = nullptr, bool left = false)
{
Node *n = static_cast<Node *>(QMapDataBase::createNode(sizeof(Node), Q_ALIGNOF(Node),
parent, left));
@@ -261,13 +261,13 @@ QMapNode<Key, T> *QMapNode<Key, T>::copy(QMapData<Key, T> *d) const
n->left = leftNode()->copy(d);
n->left->setParent(n);
} else {
- n->left = Q_NULLPTR;
+ n->left = nullptr;
}
if (right) {
n->right = rightNode()->copy(d);
n->right->setParent(n);
} else {
- n->right = Q_NULLPTR;
+ n->right = nullptr;
}
return n;
}
@@ -288,7 +288,7 @@ QMapNode<Key, T> *QMapData<Key, T>::findNode(const Key &akey) const
if (lb && !qMapLessThanKey(akey, lb->key))
return lb;
}
- return Q_NULLPTR;
+ return nullptr;
}
@@ -304,10 +304,10 @@ void QMapData<Key, T>::nodeRange(const Key &akey, QMapNode<Key, T> **firstNode,
} else if (qMapLessThanKey(n->key, akey)) {
n = n->rightNode();
} else {
- *firstNode = n->leftNode() ? n->leftNode()->lowerBound(akey) : Q_NULLPTR;
+ *firstNode = n->leftNode() ? n->leftNode()->lowerBound(akey) : nullptr;
if (!*firstNode)
*firstNode = n;
- *lastNode = n->rightNode() ? n->rightNode()->upperBound(akey) : Q_NULLPTR;
+ *lastNode = n->rightNode() ? n->rightNode()->upperBound(akey) : nullptr;
if (!*lastNode)
*lastNode = l;
return;
@@ -416,7 +416,7 @@ public:
typedef T *pointer;
typedef T &reference;
- inline iterator() : i(Q_NULLPTR) { }
+ inline iterator() : i(nullptr) { }
inline iterator(Node *node) : i(node) { }
inline const Key &key() const { return i->key; }
@@ -473,7 +473,7 @@ public:
typedef const T *pointer;
typedef const T &reference;
- Q_DECL_CONSTEXPR inline const_iterator() : i(Q_NULLPTR) { }
+ Q_DECL_CONSTEXPR inline const_iterator() : i(nullptr) { }
inline const_iterator(const Node *node) : i(node) { }
#ifdef QT_STRICT_ITERATORS
explicit inline const_iterator(const iterator &o)
@@ -695,7 +695,7 @@ Q_INLINE_TEMPLATE int QMap<Key, T>::count(const Key &akey) const
template <class Key, class T>
Q_INLINE_TEMPLATE bool QMap<Key, T>::contains(const Key &akey) const
{
- return d->findNode(akey) != Q_NULLPTR;
+ return d->findNode(akey) != nullptr;
}
template <class Key, class T>
@@ -704,7 +704,7 @@ Q_INLINE_TEMPLATE typename QMap<Key, T>::iterator QMap<Key, T>::insert(const Key
detach();
Node *n = d->root();
Node *y = d->end();
- Node *lastNode = Q_NULLPTR;
+ Node *lastNode = nullptr;
bool left = true;
while (n) {
y = n;
@@ -779,15 +779,15 @@ typename QMap<Key, T>::iterator QMap<Key, T>::insert(const_iterator pos, const K
}
// we need to insert (not overwrite)
- if (prev->right == Q_NULLPTR) {
+ if (prev->right == nullptr) {
Node *z = d->createNode(akey, avalue, prev, false);
return iterator(z);
}
- if (next->left == Q_NULLPTR) {
+ if (next->left == nullptr) {
Node *z = d->createNode(akey, avalue, next, true);
return iterator(z);
}
- Q_ASSERT(false); // We should have prev->right == Q_NULLPTR or next->left == Q_NULLPTR.
+ Q_ASSERT(false); // We should have prev->right == nullptr or next->left == nullptr.
return this->insert(akey, avalue);
}
}
@@ -801,7 +801,7 @@ Q_INLINE_TEMPLATE typename QMap<Key, T>::iterator QMap<Key, T>::insertMulti(cons
Node* y = d->end();
Node* x = static_cast<Node *>(d->root());
bool left = true;
- while (x != Q_NULLPTR) {
+ while (x != nullptr) {
left = !qMapLessThanKey(x->key, akey);
y = x;
x = left ? x->leftNode() : x->rightNode();
@@ -848,15 +848,15 @@ typename QMap<Key, T>::iterator QMap<Key, T>::insertMulti(const_iterator pos, co
return this->insertMulti(akey, avalue); // ignore hint
// Hint is ok - do insert
- if (prev->right == Q_NULLPTR) {
+ if (prev->right == nullptr) {
Node *z = d->createNode(akey, avalue, prev, false);
return iterator(z);
}
- if (next->left == Q_NULLPTR) {
+ if (next->left == nullptr) {
Node *z = d->createNode(akey, avalue, next, true);
return iterator(z);
}
- Q_ASSERT(false); // We should have prev->right == Q_NULLPTR or next->left == Q_NULLPTR.
+ Q_ASSERT(false); // We should have prev->right == nullptr or next->left == nullptr.
return this->insertMulti(akey, avalue);
}
}
@@ -1102,7 +1102,7 @@ Q_OUTOFLINE_TEMPLATE QList<T> QMap<Key, T>::values(const Key &akey) const
template <class Key, class T>
Q_INLINE_TEMPLATE typename QMap<Key, T>::const_iterator QMap<Key, T>::lowerBound(const Key &akey) const
{
- Node *lb = d->root() ? d->root()->lowerBound(akey) : Q_NULLPTR;
+ Node *lb = d->root() ? d->root()->lowerBound(akey) : nullptr;
if (!lb)
lb = d->end();
return const_iterator(lb);
@@ -1112,7 +1112,7 @@ template <class Key, class T>
Q_INLINE_TEMPLATE typename QMap<Key, T>::iterator QMap<Key, T>::lowerBound(const Key &akey)
{
detach();
- Node *lb = d->root() ? d->root()->lowerBound(akey) : Q_NULLPTR;
+ Node *lb = d->root() ? d->root()->lowerBound(akey) : nullptr;
if (!lb)
lb = d->end();
return iterator(lb);
@@ -1122,7 +1122,7 @@ template <class Key, class T>
Q_INLINE_TEMPLATE typename QMap<Key, T>::const_iterator
QMap<Key, T>::upperBound(const Key &akey) const
{
- Node *ub = d->root() ? d->root()->upperBound(akey) : Q_NULLPTR;
+ Node *ub = d->root() ? d->root()->upperBound(akey) : nullptr;
if (!ub)
ub = d->end();
return const_iterator(ub);
@@ -1132,7 +1132,7 @@ template <class Key, class T>
Q_INLINE_TEMPLATE typename QMap<Key, T>::iterator QMap<Key, T>::upperBound(const Key &akey)
{
detach();
- Node *ub = d->root() ? d->root()->upperBound(akey) : Q_NULLPTR;
+ Node *ub = d->root() ? d->root()->upperBound(akey) : nullptr;
if (!ub)
ub = d->end();
return iterator(ub);
diff --git a/src/corelib/tools/qringbuffer_p.h b/src/corelib/tools/qringbuffer_p.h
index 558a456515..1f3f2d3fb0 100644
--- a/src/corelib/tools/qringbuffer_p.h
+++ b/src/corelib/tools/qringbuffer_p.h
@@ -80,7 +80,7 @@ public:
}
inline const char *readPointer() const {
- return bufferSize == 0 ? Q_NULLPTR : (buffers.first().constData() + head);
+ return bufferSize == 0 ? nullptr : (buffers.first().constData() + head);
}
Q_CORE_EXPORT const char *readPointerAtPosition(qint64 pos, qint64 &length) const;
diff --git a/src/corelib/tools/qscopedpointer.cpp b/src/corelib/tools/qscopedpointer.cpp
index 8d84b3beca..f3a4f0ca1f 100644
--- a/src/corelib/tools/qscopedpointer.cpp
+++ b/src/corelib/tools/qscopedpointer.cpp
@@ -146,6 +146,13 @@ QT_BEGIN_NAMESPACE
*/
/*!
+ \fn T *QScopedPointer::get() const
+ \since 5.11
+
+ Same as data().
+*/
+
+/*!
\fn T &QScopedPointer::operator*() const
Provides access to the scoped pointer's object.
diff --git a/src/corelib/tools/qscopedpointer.h b/src/corelib/tools/qscopedpointer.h
index 141a3f8c70..2a4083466b 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 = Q_NULLPTR) Q_DECL_NOTHROW : d(p)
+ explicit QScopedPointer(T *p = nullptr) Q_DECL_NOTHROW : d(p)
{
}
@@ -126,12 +126,12 @@ public:
#if defined(Q_QDOC)
inline operator bool() const
{
- return isNull() ? Q_NULLPTR : &QScopedPointer::d;
+ return isNull() ? nullptr : &QScopedPointer::d;
}
#else
operator RestrictedBool() const Q_DECL_NOTHROW
{
- return isNull() ? Q_NULLPTR : &QScopedPointer::d;
+ return isNull() ? nullptr : &QScopedPointer::d;
}
#endif
@@ -140,12 +140,17 @@ public:
return d;
}
+ T *get() const Q_DECL_NOTHROW
+ {
+ return d;
+ }
+
bool isNull() const Q_DECL_NOTHROW
{
return !d;
}
- void reset(T *other = Q_NULLPTR) Q_DECL_NOEXCEPT_EXPR(noexcept(Cleanup::cleanup(std::declval<T *>())))
+ void reset(T *other = nullptr) Q_DECL_NOEXCEPT_EXPR(noexcept(Cleanup::cleanup(std::declval<T *>())))
{
if (d == other)
return;
@@ -157,7 +162,7 @@ public:
T *take() Q_DECL_NOTHROW
{
T *oldD = d;
- d = Q_NULLPTR;
+ d = nullptr;
return oldD;
}
@@ -221,7 +226,7 @@ class QScopedArrayPointer : public QScopedPointer<T, Cleanup>
template <typename Ptr>
using if_same_type = typename std::enable_if<std::is_same<typename std::remove_cv<T>::type, Ptr>::value, bool>::type;
public:
- inline QScopedArrayPointer() : QScopedPointer<T, Cleanup>(Q_NULLPTR) {}
+ inline QScopedArrayPointer() : QScopedPointer<T, Cleanup>(nullptr) {}
template <typename D, if_same_type<D> = true>
explicit QScopedArrayPointer(D *p)
diff --git a/src/corelib/tools/qshareddata.h b/src/corelib/tools/qshareddata.h
index 13b0032605..dbf0907a0f 100644
--- a/src/corelib/tools/qshareddata.h
+++ b/src/corelib/tools/qshareddata.h
@@ -85,7 +85,7 @@ public:
inline bool operator==(const QSharedDataPointer<T> &other) const { return d == other.d; }
inline bool operator!=(const QSharedDataPointer<T> &other) const { return d != other.d; }
- inline QSharedDataPointer() { d = Q_NULLPTR; }
+ inline QSharedDataPointer() { d = nullptr; }
inline ~QSharedDataPointer() { if (d && !d->ref.deref()) delete d; }
explicit QSharedDataPointer(T *data) Q_DECL_NOTHROW;
@@ -113,7 +113,7 @@ public:
return *this;
}
#ifdef Q_COMPILER_RVALUE_REFS
- QSharedDataPointer(QSharedDataPointer &&o) Q_DECL_NOTHROW : d(o.d) { o.d = Q_NULLPTR; }
+ QSharedDataPointer(QSharedDataPointer &&o) Q_DECL_NOTHROW : d(o.d) { o.d = nullptr; }
inline QSharedDataPointer<T> &operator=(QSharedDataPointer<T> &&other) Q_DECL_NOTHROW
{ qSwap(d, other.d); return *this; }
#endif
@@ -151,17 +151,17 @@ public:
if(d && !d->ref.deref())
delete d;
- d = Q_NULLPTR;
+ d = nullptr;
}
- inline operator bool () const { return d != Q_NULLPTR; }
+ inline operator bool () const { return d != nullptr; }
inline bool operator==(const QExplicitlySharedDataPointer<T> &other) const { return d == other.d; }
inline bool operator!=(const QExplicitlySharedDataPointer<T> &other) const { return d != other.d; }
inline bool operator==(const T *ptr) const { return d == ptr; }
inline bool operator!=(const T *ptr) const { return d != ptr; }
- inline QExplicitlySharedDataPointer() { d = Q_NULLPTR; }
+ inline QExplicitlySharedDataPointer() { d = nullptr; }
inline ~QExplicitlySharedDataPointer() { if (d && !d->ref.deref()) delete d; }
explicit QExplicitlySharedDataPointer(T *data) Q_DECL_NOTHROW;
@@ -202,7 +202,7 @@ public:
return *this;
}
#ifdef Q_COMPILER_RVALUE_REFS
- inline QExplicitlySharedDataPointer(QExplicitlySharedDataPointer &&o) Q_DECL_NOTHROW : d(o.d) { o.d = Q_NULLPTR; }
+ inline QExplicitlySharedDataPointer(QExplicitlySharedDataPointer &&o) Q_DECL_NOTHROW : d(o.d) { o.d = nullptr; }
inline QExplicitlySharedDataPointer<T> &operator=(QExplicitlySharedDataPointer<T> &&other) Q_DECL_NOTHROW
{ qSwap(d, other.d); return *this; }
#endif
diff --git a/src/corelib/tools/qsharedpointer.cpp b/src/corelib/tools/qsharedpointer.cpp
index af09ef6f40..7f1e9ed798 100644
--- a/src/corelib/tools/qsharedpointer.cpp
+++ b/src/corelib/tools/qsharedpointer.cpp
@@ -577,6 +577,15 @@
*/
/*!
+ \fn T *QSharedPointer::get() const
+ \since 5.11
+
+ Same as data().
+
+ This function is provided for API compatibility with \c{std::shared_ptr}.
+*/
+
+/*!
\fn T &QSharedPointer::operator *() const
Provides access to the shared pointer's members.
diff --git a/src/corelib/tools/qsharedpointer.h b/src/corelib/tools/qsharedpointer.h
index 3b86eb238b..98b38b97d3 100644
--- a/src/corelib/tools/qsharedpointer.h
+++ b/src/corelib/tools/qsharedpointer.h
@@ -59,6 +59,7 @@ class QSharedPointer
public:
// basic accessor functions
T *data() const;
+ T *get() const;
bool isNull() const;
operator bool() const;
bool operator!() const;
diff --git a/src/corelib/tools/qsharedpointer_impl.h b/src/corelib/tools/qsharedpointer_impl.h
index ede54c155d..a0e408b94a 100644
--- a/src/corelib/tools/qsharedpointer_impl.h
+++ b/src/corelib/tools/qsharedpointer_impl.h
@@ -303,8 +303,9 @@ public:
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() ? Q_NULLPTR : &QSharedPointer::value; }
+ operator RestrictedBool() const Q_DECL_NOTHROW { return isNull() ? nullptr : &QSharedPointer::value; }
bool operator !() const Q_DECL_NOTHROW { return isNull(); }
T &operator*() const { return *data(); }
T *operator->() const Q_DECL_NOTHROW { return data(); }
@@ -337,8 +338,8 @@ public:
QSharedPointer(QSharedPointer &&other) Q_DECL_NOTHROW
: value(other.value), d(other.d)
{
- other.d = Q_NULLPTR;
- other.value = Q_NULLPTR;
+ other.d = nullptr;
+ other.value = nullptr;
}
QSharedPointer &operator=(QSharedPointer &&other) Q_DECL_NOTHROW
{
@@ -351,8 +352,8 @@ public:
QSharedPointer(QSharedPointer<X> &&other) Q_DECL_NOTHROW
: value(other.value), d(other.d)
{
- other.d = Q_NULLPTR;
- other.value = Q_NULLPTR;
+ other.d = nullptr;
+ other.value = nullptr;
}
template <class X>
@@ -378,7 +379,7 @@ public:
}
template <class X>
- inline QSharedPointer(const QWeakPointer<X> &other) : value(Q_NULLPTR), d(Q_NULLPTR)
+ inline QSharedPointer(const QWeakPointer<X> &other) : value(nullptr), d(nullptr)
{ *this = other; }
template <class X>
@@ -476,7 +477,7 @@ private:
inline void internalConstruct(X *ptr, Deleter deleter)
{
if (!ptr) {
- d = Q_NULLPTR;
+ d = nullptr;
return;
}
@@ -527,14 +528,14 @@ public:
o->weakref.ref();
} else {
o->checkQObjectShared(actual);
- o = Q_NULLPTR;
+ o = nullptr;
}
}
qSwap(d, o);
qSwap(this->value, actual);
if (!d || d->strongref.load() == 0)
- this->value = Q_NULLPTR;
+ this->value = nullptr;
// dereference saved data
deref(o);
@@ -559,19 +560,19 @@ public:
typedef const value_type &const_reference;
typedef qptrdiff difference_type;
- bool isNull() const Q_DECL_NOTHROW { return d == Q_NULLPTR || d->strongref.load() == 0 || value == Q_NULLPTR; }
- operator RestrictedBool() const Q_DECL_NOTHROW { return isNull() ? Q_NULLPTR : &QWeakPointer::value; }
+ 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 == Q_NULLPTR || d->strongref.load() == 0 ? Q_NULLPTR : value; }
+ T *data() const Q_DECL_NOTHROW { return d == nullptr || d->strongref.load() == 0 ? nullptr : value; }
- inline QWeakPointer() Q_DECL_NOTHROW : d(Q_NULLPTR), value(Q_NULLPTR) { }
+ inline QWeakPointer() Q_DECL_NOTHROW : d(nullptr), value(nullptr) { }
inline ~QWeakPointer() { if (d && !d->weakref.deref()) delete d; }
#ifndef QT_NO_QOBJECT
// special constructor that is enabled only if X derives from QObject
#if QT_DEPRECATED_SINCE(5, 0)
template <class X>
- QT_DEPRECATED inline QWeakPointer(X *ptr) : d(ptr ? Data::getAndRef(ptr) : Q_NULLPTR), value(ptr)
+ QT_DEPRECATED inline QWeakPointer(X *ptr) : d(ptr ? Data::getAndRef(ptr) : nullptr), value(ptr)
{ }
#endif
#endif
@@ -588,8 +589,8 @@ public:
QWeakPointer(QWeakPointer &&other) Q_DECL_NOTHROW
: d(other.d), value(other.value)
{
- other.d = Q_NULLPTR;
- other.value = Q_NULLPTR;
+ other.d = nullptr;
+ other.value = nullptr;
}
QWeakPointer &operator=(QWeakPointer &&other) Q_DECL_NOTHROW
{ QWeakPointer moved(std::move(other)); swap(moved); return *this; }
@@ -616,7 +617,7 @@ public:
}
template <class X>
- inline QWeakPointer(const QWeakPointer<X> &o) : d(Q_NULLPTR), value(Q_NULLPTR)
+ inline QWeakPointer(const QWeakPointer<X> &o) : d(nullptr), value(nullptr)
{ *this = o; }
template <class X>
@@ -637,7 +638,7 @@ public:
{ return !(*this == o); }
template <class X>
- inline QWeakPointer(const QSharedPointer<X> &o) : d(Q_NULLPTR), value(Q_NULLPTR)
+ inline QWeakPointer(const QSharedPointer<X> &o) : d(nullptr), value(nullptr)
{ *this = o; }
template <class X>
@@ -681,7 +682,7 @@ public:
#ifndef QT_NO_QOBJECT
template <class X>
- inline QWeakPointer(X *ptr, bool) : d(ptr ? Data::getAndRef(ptr) : Q_NULLPTR), value(ptr)
+ inline QWeakPointer(X *ptr, bool) : d(ptr ? Data::getAndRef(ptr) : nullptr), value(ptr)
{ }
#endif
diff --git a/src/corelib/tools/qsimd_p.h b/src/corelib/tools/qsimd_p.h
index 181da4f7de..a462d7bb58 100644
--- a/src/corelib/tools/qsimd_p.h
+++ b/src/corelib/tools/qsimd_p.h
@@ -53,7 +53,6 @@
//
#include <QtCore/private/qglobal_p.h>
-#include <qatomic.h>
/*
* qt_module_config.prf defines the QT_COMPILER_SUPPORTS_XXX macros.
@@ -333,8 +332,10 @@
# include <arm_acle.h>
#endif
-QT_BEGIN_NAMESPACE
+#ifdef __cplusplus
+#include <qatomic.h>
+QT_BEGIN_NAMESPACE
enum CPUFeatures {
#if defined(Q_PROCESSOR_ARM)
@@ -512,9 +513,11 @@ static inline quint64 qCpuFeatures()
#define ALIGNMENT_PROLOGUE_32BYTES(ptr, i, length) \
for (; i < static_cast<int>(qMin(static_cast<quintptr>(length), ((8 - ((reinterpret_cast<quintptr>(ptr) >> 2) & 0x7)) & 0x7))); ++i)
+QT_END_NAMESPACE
+
+#endif // __cplusplus
+
#define SIMD_EPILOGUE(i, length, max) \
for (int _i = 0; _i < max && i < length; ++i, ++_i)
-QT_END_NAMESPACE
-
#endif // QSIMD_P_H
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp
index c10987a5fe..78b7e69d9c 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -4058,7 +4058,7 @@ int QString::count(const QRegExp& rx) const
*/
int QString::indexOf(const QRegularExpression& re, int from) const
{
- return indexOf(re, from, Q_NULLPTR);
+ return indexOf(re, from, nullptr);
}
/*!
@@ -4109,7 +4109,7 @@ int QString::indexOf(const QRegularExpression &re, int from, QRegularExpressionM
*/
int QString::lastIndexOf(const QRegularExpression &re, int from) const
{
- return lastIndexOf(re, from, Q_NULLPTR);
+ return lastIndexOf(re, from, nullptr);
}
/*!
@@ -4161,7 +4161,7 @@ int QString::lastIndexOf(const QRegularExpression &re, int from, QRegularExpress
*/
bool QString::contains(const QRegularExpression &re) const
{
- return contains(re, Q_NULLPTR);
+ return contains(re, nullptr);
}
/*!
diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h
index fe7e9b050b..b411bdac5a 100644
--- a/src/corelib/tools/qstring.h
+++ b/src/corelib/tools/qstring.h
@@ -91,7 +91,7 @@ template <typename T> class QVector;
class QLatin1String
{
public:
- Q_DECL_CONSTEXPR inline QLatin1String() Q_DECL_NOTHROW : m_size(0), m_data(Q_NULLPTR) {}
+ 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 explicit QLatin1String(const char *f, const char *l)
: QLatin1String(f, int(l - f)) {}
@@ -624,16 +624,16 @@ public:
static int localeAwareCompare(const QString& s1, const QStringRef& s2);
// ### Qt6: make inline except for the long long versions
- short toShort(bool *ok=Q_NULLPTR, int base=10) const;
- ushort toUShort(bool *ok=Q_NULLPTR, int base=10) const;
- int toInt(bool *ok=Q_NULLPTR, int base=10) const;
- uint toUInt(bool *ok=Q_NULLPTR, int base=10) const;
- long toLong(bool *ok=Q_NULLPTR, int base=10) const;
- ulong toULong(bool *ok=Q_NULLPTR, int base=10) const;
- qlonglong toLongLong(bool *ok=Q_NULLPTR, int base=10) const;
- qulonglong toULongLong(bool *ok=Q_NULLPTR, int base=10) const;
- float toFloat(bool *ok=Q_NULLPTR) const;
- double toDouble(bool *ok=Q_NULLPTR) const;
+ short toShort(bool *ok=nullptr, int base=10) const;
+ ushort toUShort(bool *ok=nullptr, int base=10) const;
+ int toInt(bool *ok=nullptr, int base=10) const;
+ uint toUInt(bool *ok=nullptr, int base=10) const;
+ long toLong(bool *ok=nullptr, int base=10) const;
+ ulong toULong(bool *ok=nullptr, int base=10) const;
+ qlonglong toLongLong(bool *ok=nullptr, int base=10) const;
+ qulonglong toULongLong(bool *ok=nullptr, int base=10) const;
+ float toFloat(bool *ok=nullptr) const;
+ double toDouble(bool *ok=nullptr) const;
QString &setNum(short, int base=10);
QString &setNum(ushort, int base=10);
@@ -1417,7 +1417,7 @@ public:
typedef QString::const_reference const_reference;
// ### Qt 6: make this constructor constexpr, after the destructor is made trivial
- inline QStringRef() : m_string(Q_NULLPTR), m_position(0), m_size(0) {}
+ inline QStringRef() : m_string(nullptr), m_position(0), m_size(0) {}
inline QStringRef(const QString *string, int position, int size);
inline QStringRef(const QString *string);
@@ -1533,10 +1533,10 @@ public:
Q_REQUIRED_RESULT QByteArray toLocal8Bit() const;
Q_REQUIRED_RESULT QVector<uint> toUcs4() const;
- inline void clear() { m_string = Q_NULLPTR; m_position = m_size = 0; }
+ inline void clear() { m_string = nullptr; m_position = m_size = 0; }
QString toString() const;
inline bool isEmpty() const { return m_size == 0; }
- inline bool isNull() const { return m_string == Q_NULLPTR || m_string->isNull(); }
+ inline bool isNull() const { return m_string == nullptr || m_string->isNull(); }
QStringRef appendTo(QString *string) const;
@@ -1576,16 +1576,16 @@ public:
static int localeAwareCompare(const QStringRef &s1, const QStringRef &s2);
Q_REQUIRED_RESULT QStringRef trimmed() const;
- short toShort(bool *ok = Q_NULLPTR, int base = 10) const;
- ushort toUShort(bool *ok = Q_NULLPTR, int base = 10) const;
- int toInt(bool *ok = Q_NULLPTR, int base = 10) const;
- uint toUInt(bool *ok = Q_NULLPTR, int base = 10) const;
- long toLong(bool *ok = Q_NULLPTR, int base = 10) const;
- ulong toULong(bool *ok = Q_NULLPTR, int base = 10) const;
- qlonglong toLongLong(bool *ok = Q_NULLPTR, int base = 10) const;
- qulonglong toULongLong(bool *ok = Q_NULLPTR, int base = 10) const;
- float toFloat(bool *ok = Q_NULLPTR) const;
- double toDouble(bool *ok = Q_NULLPTR) const;
+ short toShort(bool *ok = nullptr, int base = 10) const;
+ ushort toUShort(bool *ok = nullptr, int base = 10) const;
+ int toInt(bool *ok = nullptr, int base = 10) const;
+ uint toUInt(bool *ok = nullptr, int base = 10) const;
+ long toLong(bool *ok = nullptr, int base = 10) const;
+ ulong toULong(bool *ok = nullptr, int base = 10) const;
+ qlonglong toLongLong(bool *ok = nullptr, int base = 10) const;
+ qulonglong toULongLong(bool *ok = nullptr, int base = 10) const;
+ float toFloat(bool *ok = nullptr) const;
+ double toDouble(bool *ok = nullptr) const;
};
Q_DECLARE_TYPEINFO(QStringRef, Q_PRIMITIVE_TYPE);
diff --git a/src/corelib/tools/qtextboundaryfinder.h b/src/corelib/tools/qtextboundaryfinder.h
index d021df3f2c..b1e5008f54 100644
--- a/src/corelib/tools/qtextboundaryfinder.h
+++ b/src/corelib/tools/qtextboundaryfinder.h
@@ -74,7 +74,7 @@ public:
Q_DECLARE_FLAGS( BoundaryReasons, BoundaryReason )
QTextBoundaryFinder(BoundaryType type, const QString &string);
- QTextBoundaryFinder(BoundaryType type, const QChar *chars, int length, unsigned char *buffer = Q_NULLPTR, int bufferSize = 0);
+ QTextBoundaryFinder(BoundaryType type, const QChar *chars, int length, unsigned char *buffer = nullptr, int bufferSize = 0);
inline bool isValid() const { return d; }
diff --git a/src/corelib/tools/qtimeline.h b/src/corelib/tools/qtimeline.h
index f0e9a32e4d..d9982bdb58 100644
--- a/src/corelib/tools/qtimeline.h
+++ b/src/corelib/tools/qtimeline.h
@@ -76,7 +76,7 @@ public:
CosineCurve
};
- explicit QTimeLine(int duration = 1000, QObject *parent = Q_NULLPTR);
+ explicit QTimeLine(int duration = 1000, QObject *parent = nullptr);
virtual ~QTimeLine();
State state() const;
@@ -127,7 +127,7 @@ Q_SIGNALS:
void finished(QPrivateSignal);
protected:
- void timerEvent(QTimerEvent *event) Q_DECL_OVERRIDE;
+ void timerEvent(QTimerEvent *event) override;
private:
Q_DISABLE_COPY(QTimeLine)
diff --git a/src/corelib/tools/qtimezoneprivate_p.h b/src/corelib/tools/qtimezoneprivate_p.h
index 74b79dce16..9b7adbbbbe 100644
--- a/src/corelib/tools/qtimezoneprivate_p.h
+++ b/src/corelib/tools/qtimezoneprivate_p.h
@@ -171,7 +171,7 @@ Q_DECLARE_TYPEINFO(QTimeZonePrivate::Data, Q_MOVABLE_TYPE);
template<> QTimeZonePrivate *QSharedDataPointer<QTimeZonePrivate>::clone();
-class Q_AUTOTEST_EXPORT QUtcTimeZonePrivate Q_DECL_FINAL : public QTimeZonePrivate
+class Q_AUTOTEST_EXPORT QUtcTimeZonePrivate final : public QTimeZonePrivate
{
public:
// Create default UTC time zone
@@ -189,26 +189,26 @@ public:
QUtcTimeZonePrivate *clone() const override;
- Data data(qint64 forMSecsSinceEpoch) const Q_DECL_OVERRIDE;
+ Data data(qint64 forMSecsSinceEpoch) const override;
- QLocale::Country country() const Q_DECL_OVERRIDE;
- QString comment() const Q_DECL_OVERRIDE;
+ QLocale::Country country() const override;
+ QString comment() const override;
QString displayName(QTimeZone::TimeType timeType,
QTimeZone::NameType nameType,
- const QLocale &locale) const Q_DECL_OVERRIDE;
- QString abbreviation(qint64 atMSecsSinceEpoch) const Q_DECL_OVERRIDE;
+ const QLocale &locale) const override;
+ QString abbreviation(qint64 atMSecsSinceEpoch) const override;
- int standardTimeOffset(qint64 atMSecsSinceEpoch) const Q_DECL_OVERRIDE;
- int daylightTimeOffset(qint64 atMSecsSinceEpoch) const Q_DECL_OVERRIDE;
+ int standardTimeOffset(qint64 atMSecsSinceEpoch) const override;
+ int daylightTimeOffset(qint64 atMSecsSinceEpoch) const override;
- QByteArray systemTimeZoneId() const Q_DECL_OVERRIDE;
+ QByteArray systemTimeZoneId() const override;
- QList<QByteArray> availableTimeZoneIds() const Q_DECL_OVERRIDE;
- QList<QByteArray> availableTimeZoneIds(QLocale::Country country) const Q_DECL_OVERRIDE;
- QList<QByteArray> availableTimeZoneIds(int utcOffset) const Q_DECL_OVERRIDE;
+ QList<QByteArray> availableTimeZoneIds() const override;
+ QList<QByteArray> availableTimeZoneIds(QLocale::Country country) const override;
+ QList<QByteArray> availableTimeZoneIds(int utcOffset) const override;
- void serialize(QDataStream &ds) const Q_DECL_OVERRIDE;
+ void serialize(QDataStream &ds) const override;
private:
void init(const QByteArray &zoneId);
@@ -224,7 +224,7 @@ private:
};
#if QT_CONFIG(icu)
-class Q_AUTOTEST_EXPORT QIcuTimeZonePrivate Q_DECL_FINAL : public QTimeZonePrivate
+class Q_AUTOTEST_EXPORT QIcuTimeZonePrivate final : public QTimeZonePrivate
{
public:
// Create default time zone
@@ -237,27 +237,27 @@ public:
QIcuTimeZonePrivate *clone() const override;
QString displayName(QTimeZone::TimeType timeType, QTimeZone::NameType nameType,
- const QLocale &locale) const Q_DECL_OVERRIDE;
- QString abbreviation(qint64 atMSecsSinceEpoch) const Q_DECL_OVERRIDE;
+ const QLocale &locale) const override;
+ QString abbreviation(qint64 atMSecsSinceEpoch) const override;
- int offsetFromUtc(qint64 atMSecsSinceEpoch) const Q_DECL_OVERRIDE;
- int standardTimeOffset(qint64 atMSecsSinceEpoch) const Q_DECL_OVERRIDE;
- int daylightTimeOffset(qint64 atMSecsSinceEpoch) const Q_DECL_OVERRIDE;
+ int offsetFromUtc(qint64 atMSecsSinceEpoch) const override;
+ int standardTimeOffset(qint64 atMSecsSinceEpoch) const override;
+ int daylightTimeOffset(qint64 atMSecsSinceEpoch) const override;
- bool hasDaylightTime() const Q_DECL_OVERRIDE;
- bool isDaylightTime(qint64 atMSecsSinceEpoch) const Q_DECL_OVERRIDE;
+ bool hasDaylightTime() const override;
+ bool isDaylightTime(qint64 atMSecsSinceEpoch) const override;
- Data data(qint64 forMSecsSinceEpoch) const Q_DECL_OVERRIDE;
+ Data data(qint64 forMSecsSinceEpoch) const override;
- bool hasTransitions() const Q_DECL_OVERRIDE;
- Data nextTransition(qint64 afterMSecsSinceEpoch) const Q_DECL_OVERRIDE;
- Data previousTransition(qint64 beforeMSecsSinceEpoch) const Q_DECL_OVERRIDE;
+ bool hasTransitions() const override;
+ Data nextTransition(qint64 afterMSecsSinceEpoch) const override;
+ Data previousTransition(qint64 beforeMSecsSinceEpoch) const override;
- QByteArray systemTimeZoneId() const Q_DECL_OVERRIDE;
+ QByteArray systemTimeZoneId() const override;
- QList<QByteArray> availableTimeZoneIds() const Q_DECL_OVERRIDE;
- QList<QByteArray> availableTimeZoneIds(QLocale::Country country) const Q_DECL_OVERRIDE;
- QList<QByteArray> availableTimeZoneIds(int offsetFromUtc) const Q_DECL_OVERRIDE;
+ QList<QByteArray> availableTimeZoneIds() const override;
+ QList<QByteArray> availableTimeZoneIds(QLocale::Country country) const override;
+ QList<QByteArray> availableTimeZoneIds(int offsetFromUtc) const override;
private:
void init(const QByteArray &ianaId);
@@ -285,7 +285,7 @@ Q_DECL_CONSTEXPR inline bool operator==(const QTzTransitionRule &lhs, const QTzT
Q_DECL_CONSTEXPR inline bool operator!=(const QTzTransitionRule &lhs, const QTzTransitionRule &rhs) Q_DECL_NOTHROW
{ return !operator==(lhs, rhs); }
-class Q_AUTOTEST_EXPORT QTzTimeZonePrivate Q_DECL_FINAL : public QTimeZonePrivate
+class Q_AUTOTEST_EXPORT QTzTimeZonePrivate final : public QTimeZonePrivate
{
QTzTimeZonePrivate(const QTzTimeZonePrivate &) = default;
public:
@@ -297,34 +297,34 @@ public:
QTzTimeZonePrivate *clone() const override;
- QLocale::Country country() const Q_DECL_OVERRIDE;
- QString comment() const Q_DECL_OVERRIDE;
+ QLocale::Country country() const override;
+ QString comment() const override;
QString displayName(qint64 atMSecsSinceEpoch,
QTimeZone::NameType nameType,
- const QLocale &locale) const Q_DECL_OVERRIDE;
+ const QLocale &locale) const override;
QString displayName(QTimeZone::TimeType timeType,
QTimeZone::NameType nameType,
- const QLocale &locale) const Q_DECL_OVERRIDE;
- QString abbreviation(qint64 atMSecsSinceEpoch) const Q_DECL_OVERRIDE;
+ const QLocale &locale) const override;
+ QString abbreviation(qint64 atMSecsSinceEpoch) const override;
- int offsetFromUtc(qint64 atMSecsSinceEpoch) const Q_DECL_OVERRIDE;
- int standardTimeOffset(qint64 atMSecsSinceEpoch) const Q_DECL_OVERRIDE;
- int daylightTimeOffset(qint64 atMSecsSinceEpoch) const Q_DECL_OVERRIDE;
+ int offsetFromUtc(qint64 atMSecsSinceEpoch) const override;
+ int standardTimeOffset(qint64 atMSecsSinceEpoch) const override;
+ int daylightTimeOffset(qint64 atMSecsSinceEpoch) const override;
- bool hasDaylightTime() const Q_DECL_OVERRIDE;
- bool isDaylightTime(qint64 atMSecsSinceEpoch) const Q_DECL_OVERRIDE;
+ bool hasDaylightTime() const override;
+ bool isDaylightTime(qint64 atMSecsSinceEpoch) const override;
- Data data(qint64 forMSecsSinceEpoch) const Q_DECL_OVERRIDE;
+ Data data(qint64 forMSecsSinceEpoch) const override;
- bool hasTransitions() const Q_DECL_OVERRIDE;
- Data nextTransition(qint64 afterMSecsSinceEpoch) const Q_DECL_OVERRIDE;
- Data previousTransition(qint64 beforeMSecsSinceEpoch) const Q_DECL_OVERRIDE;
+ bool hasTransitions() const override;
+ Data nextTransition(qint64 afterMSecsSinceEpoch) const override;
+ Data previousTransition(qint64 beforeMSecsSinceEpoch) const override;
- QByteArray systemTimeZoneId() const Q_DECL_OVERRIDE;
+ QByteArray systemTimeZoneId() const override;
- QList<QByteArray> availableTimeZoneIds() const Q_DECL_OVERRIDE;
- QList<QByteArray> availableTimeZoneIds(QLocale::Country country) const Q_DECL_OVERRIDE;
+ QList<QByteArray> availableTimeZoneIds() const override;
+ QList<QByteArray> availableTimeZoneIds(QLocale::Country country) const override;
private:
void init(const QByteArray &ianaId);
@@ -341,7 +341,7 @@ private:
#endif // Q_OS_UNIX
#ifdef Q_OS_MAC
-class Q_AUTOTEST_EXPORT QMacTimeZonePrivate Q_DECL_FINAL : public QTimeZonePrivate
+class Q_AUTOTEST_EXPORT QMacTimeZonePrivate final : public QTimeZonePrivate
{
public:
// Create default time zone
@@ -353,28 +353,28 @@ public:
QMacTimeZonePrivate *clone() const override;
- QString comment() const Q_DECL_OVERRIDE;
+ QString comment() const override;
QString displayName(QTimeZone::TimeType timeType, QTimeZone::NameType nameType,
- const QLocale &locale) const Q_DECL_OVERRIDE;
- QString abbreviation(qint64 atMSecsSinceEpoch) const Q_DECL_OVERRIDE;
+ const QLocale &locale) const override;
+ QString abbreviation(qint64 atMSecsSinceEpoch) const override;
- int offsetFromUtc(qint64 atMSecsSinceEpoch) const Q_DECL_OVERRIDE;
- int standardTimeOffset(qint64 atMSecsSinceEpoch) const Q_DECL_OVERRIDE;
- int daylightTimeOffset(qint64 atMSecsSinceEpoch) const Q_DECL_OVERRIDE;
+ int offsetFromUtc(qint64 atMSecsSinceEpoch) const override;
+ int standardTimeOffset(qint64 atMSecsSinceEpoch) const override;
+ int daylightTimeOffset(qint64 atMSecsSinceEpoch) const override;
- bool hasDaylightTime() const Q_DECL_OVERRIDE;
- bool isDaylightTime(qint64 atMSecsSinceEpoch) const Q_DECL_OVERRIDE;
+ bool hasDaylightTime() const override;
+ bool isDaylightTime(qint64 atMSecsSinceEpoch) const override;
- Data data(qint64 forMSecsSinceEpoch) const Q_DECL_OVERRIDE;
+ Data data(qint64 forMSecsSinceEpoch) const override;
- bool hasTransitions() const Q_DECL_OVERRIDE;
- Data nextTransition(qint64 afterMSecsSinceEpoch) const Q_DECL_OVERRIDE;
- Data previousTransition(qint64 beforeMSecsSinceEpoch) const Q_DECL_OVERRIDE;
+ bool hasTransitions() const override;
+ Data nextTransition(qint64 afterMSecsSinceEpoch) const override;
+ Data previousTransition(qint64 beforeMSecsSinceEpoch) const override;
- QByteArray systemTimeZoneId() const Q_DECL_OVERRIDE;
+ QByteArray systemTimeZoneId() const override;
- QList<QByteArray> availableTimeZoneIds() const Q_DECL_OVERRIDE;
+ QList<QByteArray> availableTimeZoneIds() const override;
NSTimeZone *nsTimeZone() const;
@@ -386,7 +386,7 @@ private:
#endif // Q_OS_MAC
#ifdef Q_OS_WIN
-class Q_AUTOTEST_EXPORT QWinTimeZonePrivate Q_DECL_FINAL : public QTimeZonePrivate
+class Q_AUTOTEST_EXPORT QWinTimeZonePrivate final : public QTimeZonePrivate
{
public:
struct QWinTransitionRule {
@@ -406,32 +406,31 @@ public:
QWinTimeZonePrivate *clone() const override;
- QString comment() const Q_DECL_OVERRIDE;
+ QString comment() const override;
QString displayName(QTimeZone::TimeType timeType, QTimeZone::NameType nameType,
- const QLocale &locale) const Q_DECL_OVERRIDE;
- QString abbreviation(qint64 atMSecsSinceEpoch) const Q_DECL_OVERRIDE;
+ const QLocale &locale) const override;
+ QString abbreviation(qint64 atMSecsSinceEpoch) const override;
- int offsetFromUtc(qint64 atMSecsSinceEpoch) const Q_DECL_OVERRIDE;
- int standardTimeOffset(qint64 atMSecsSinceEpoch) const Q_DECL_OVERRIDE;
- int daylightTimeOffset(qint64 atMSecsSinceEpoch) const Q_DECL_OVERRIDE;
+ int offsetFromUtc(qint64 atMSecsSinceEpoch) const override;
+ int standardTimeOffset(qint64 atMSecsSinceEpoch) const override;
+ int daylightTimeOffset(qint64 atMSecsSinceEpoch) const override;
- bool hasDaylightTime() const Q_DECL_OVERRIDE;
- bool isDaylightTime(qint64 atMSecsSinceEpoch) const Q_DECL_OVERRIDE;
+ bool hasDaylightTime() const override;
+ bool isDaylightTime(qint64 atMSecsSinceEpoch) const override;
- Data data(qint64 forMSecsSinceEpoch) const Q_DECL_OVERRIDE;
+ Data data(qint64 forMSecsSinceEpoch) const override;
- bool hasTransitions() const Q_DECL_OVERRIDE;
- Data nextTransition(qint64 afterMSecsSinceEpoch) const Q_DECL_OVERRIDE;
- Data previousTransition(qint64 beforeMSecsSinceEpoch) const Q_DECL_OVERRIDE;
+ bool hasTransitions() const override;
+ Data nextTransition(qint64 afterMSecsSinceEpoch) const override;
+ Data previousTransition(qint64 beforeMSecsSinceEpoch) const override;
- QByteArray systemTimeZoneId() const Q_DECL_OVERRIDE;
+ QByteArray systemTimeZoneId() const override;
- QList<QByteArray> availableTimeZoneIds() const Q_DECL_OVERRIDE;
+ QList<QByteArray> availableTimeZoneIds() const override;
private:
void init(const QByteArray &ianaId);
- QWinTransitionRule ruleForYear(int year) const;
QTimeZonePrivate::Data ruleToData(const QWinTransitionRule &rule, qint64 atMSecsSinceEpoch,
QTimeZone::TimeType type) const;
@@ -444,7 +443,7 @@ private:
#endif // Q_OS_WIN
#ifdef Q_OS_ANDROID
-class QAndroidTimeZonePrivate Q_DECL_FINAL : public QTimeZonePrivate
+class QAndroidTimeZonePrivate final : public QTimeZonePrivate
{
public:
// Create default time zone
@@ -457,25 +456,25 @@ public:
QAndroidTimeZonePrivate *clone() const override;
QString displayName(QTimeZone::TimeType timeType, QTimeZone::NameType nameType,
- const QLocale &locale) const Q_DECL_OVERRIDE;
- QString abbreviation(qint64 atMSecsSinceEpoch) const Q_DECL_OVERRIDE;
+ const QLocale &locale) const override;
+ QString abbreviation(qint64 atMSecsSinceEpoch) const override;
- int offsetFromUtc(qint64 atMSecsSinceEpoch) const Q_DECL_OVERRIDE;
- int standardTimeOffset(qint64 atMSecsSinceEpoch) const Q_DECL_OVERRIDE;
- int daylightTimeOffset(qint64 atMSecsSinceEpoch) const Q_DECL_OVERRIDE;
+ int offsetFromUtc(qint64 atMSecsSinceEpoch) const override;
+ int standardTimeOffset(qint64 atMSecsSinceEpoch) const override;
+ int daylightTimeOffset(qint64 atMSecsSinceEpoch) const override;
- bool hasDaylightTime() const Q_DECL_OVERRIDE;
- bool isDaylightTime(qint64 atMSecsSinceEpoch) const Q_DECL_OVERRIDE;
+ bool hasDaylightTime() const override;
+ bool isDaylightTime(qint64 atMSecsSinceEpoch) const override;
- Data data(qint64 forMSecsSinceEpoch) const Q_DECL_OVERRIDE;
+ Data data(qint64 forMSecsSinceEpoch) const override;
- bool hasTransitions() const Q_DECL_OVERRIDE;
- Data nextTransition(qint64 afterMSecsSinceEpoch) const Q_DECL_OVERRIDE;
- Data previousTransition(qint64 beforeMSecsSinceEpoch) const Q_DECL_OVERRIDE;
+ bool hasTransitions() const override;
+ Data nextTransition(qint64 afterMSecsSinceEpoch) const override;
+ Data previousTransition(qint64 beforeMSecsSinceEpoch) const override;
- QByteArray systemTimeZoneId() const Q_DECL_OVERRIDE;
+ QByteArray systemTimeZoneId() const override;
- QList<QByteArray> availableTimeZoneIds() const Q_DECL_OVERRIDE;
+ QList<QByteArray> availableTimeZoneIds() const override;
private:
void init(const QByteArray &zoneId);
diff --git a/src/corelib/tools/qtimezoneprivate_win.cpp b/src/corelib/tools/qtimezoneprivate_win.cpp
index a50227d3cc..3bce55925f 100644
--- a/src/corelib/tools/qtimezoneprivate_win.cpp
+++ b/src/corelib/tools/qtimezoneprivate_win.cpp
@@ -259,8 +259,38 @@ static DYNAMIC_TIME_ZONE_INFORMATION dynamicInfoForId(const QByteArray &windowsI
}
return dtzInfo;
}
+
+static QWinTimeZonePrivate::QWinTransitionRule
+readDynamicRule(DYNAMIC_TIME_ZONE_INFORMATION &dtzi, int year, bool *ok)
+{
+ TIME_ZONE_INFORMATION tzi;
+ QWinTimeZonePrivate::QWinTransitionRule rule;
+ *ok = GetTimeZoneInformationForYear(year, &dtzi, &tzi);
+ if (*ok) {
+ rule.startYear = 0;
+ rule.standardTimeBias = tzi.Bias + tzi.StandardBias;
+ rule.daylightTimeBias = tzi.Bias + tzi.DaylightBias - rule.standardTimeBias;
+ rule.standardTimeRule = tzi.StandardDate;
+ rule.daylightTimeRule = tzi.DaylightDate;
+ }
+ return rule;
+}
#endif // QT_USE_REGISTRY_TIMEZONE
+static bool isSameRule(const QWinTimeZonePrivate::QWinTransitionRule &last,
+ const QWinTimeZonePrivate::QWinTransitionRule &rule)
+{
+ // In particular, when this is true and either wYear is 0, so is the other;
+ // so if one rule is recurrent and they're equal, so is the other. If
+ // either rule *isn't* recurrent, it has non-0 wYear which shall be
+ // different from the other's. Note that we don't compare .startYear, since
+ // that will always be different.
+ return equalSystemtime(last.standardTimeRule, rule.standardTimeRule)
+ && equalSystemtime(last.daylightTimeRule, rule.daylightTimeRule)
+ && last.standardTimeBias == rule.standardTimeBias
+ && last.daylightTimeBias == rule.daylightTimeBias;
+}
+
static QList<QByteArray> availableWindowsIds()
{
#ifdef QT_USE_REGISTRY_TIMEZONE
@@ -356,30 +386,33 @@ static inline qint64 timeToMSecs(const QDate &date, const QTime &time)
+ time.msecsSinceStartOfDay();
}
-static void calculateTransitionsForYear(const QWinTimeZonePrivate::QWinTransitionRule &rule, int year,
- qint64 *stdMSecs, qint64 *dstMSecs)
+static qint64 calculateTransitionForYear(const SYSTEMTIME &rule, int year, int bias)
{
// TODO Consider caching the calculated values
- // The local time in Daylight Time when switches to Standard Time
- QDate standardDate = calculateTransitionLocalDate(rule.standardTimeRule, year);
- QTime standardTime = QTime(rule.standardTimeRule.wHour, rule.standardTimeRule.wMinute,
- rule.standardTimeRule.wSecond);
- if (standardDate.isValid() && standardTime.isValid()) {
- *stdMSecs = timeToMSecs(standardDate, standardTime)
- + ((rule.standardTimeBias + rule.daylightTimeBias) * 60000);
- } else {
- *stdMSecs = QTimeZonePrivate::invalidMSecs();
- }
-
- // The local time in Standard Time when switches to Daylight Time
- QDate daylightDate = calculateTransitionLocalDate(rule.daylightTimeRule, year);
- QTime daylightTime = QTime(rule.daylightTimeRule.wHour, rule.daylightTimeRule.wMinute,
- rule.daylightTimeRule.wSecond);
- if (daylightDate.isValid() && daylightTime.isValid())
- *dstMSecs = timeToMSecs(daylightDate, daylightTime) + (rule.standardTimeBias * 60000);
- else
- *dstMSecs = QTimeZonePrivate::invalidMSecs();
-}
+ const QDate date = calculateTransitionLocalDate(rule, year);
+ const QTime time = QTime(rule.wHour, rule.wMinute, rule.wSecond);
+ if (date.isValid() && time.isValid())
+ return timeToMSecs(date, time) + bias * 60000;
+ return QTimeZonePrivate::invalidMSecs();
+}
+
+namespace {
+struct TransitionTimePair
+{
+ // Transition times after the epoch, in ms:
+ qint64 std, dst;
+ TransitionTimePair()
+ : std(QTimeZonePrivate::invalidMSecs()), dst(QTimeZonePrivate::invalidMSecs())
+ {}
+ TransitionTimePair(const QWinTimeZonePrivate::QWinTransitionRule &rule, int year)
+ // The local time in Daylight Time of the switch to Standard Time
+ : std(calculateTransitionForYear(rule.standardTimeRule, year,
+ rule.standardTimeBias + rule.daylightTimeBias)),
+ // The local time in Standard Time of the switch to Daylight Time
+ dst(calculateTransitionForYear(rule.daylightTimeRule, year, rule.standardTimeBias))
+ {}
+};
+} // anonymous namespace
static QLocale::Country userCountry()
{
@@ -390,6 +423,34 @@ static QLocale::Country userCountry()
: QLocale::AnyCountry;
}
+// Index of last rule in rules with .startYear <= year:
+static int ruleIndexForYear(const QList<QWinTimeZonePrivate::QWinTransitionRule> &rules, int year)
+{
+ if (rules.last().startYear <= year)
+ return rules.count() - 1;
+ // We don't have a rule for before the first, but the first is the best we can offer:
+ if (rules.first().startYear > year)
+ return 0;
+
+ // Otherwise, use binary chop:
+ int lo = 0, hi = rules.count();
+ // invariant: rules[i].startYear <= year < rules[hi].startYear
+ // subject to treating rules[rules.count()] as "off the end of time"
+ while (lo + 1 < hi) {
+ const int mid = (lo + hi) / 2;
+ // lo + 2 <= hi, so lo + 1 <= mid <= hi - 1, so lo < mid < hi
+ // In particular, mid < rules.count()
+ const int midYear = rules.at(mid).startYear;
+ if (midYear > year)
+ hi = mid;
+ else if (midYear < year)
+ lo = mid;
+ else // No two rules have the same startYear:
+ return mid;
+ }
+ return lo;
+}
+
// Create the system default time zone
QWinTimeZonePrivate::QWinTimeZonePrivate()
: QTimeZonePrivate()
@@ -453,16 +514,20 @@ void QWinTimeZonePrivate::init(const QByteArray &ianaId)
QWinTransitionRule rule = readRegistryRule(dynamicKey,
(LPCWSTR)QString::number(year).utf16(),
&ruleOk);
- rule.startYear = year;
- if (ruleOk)
+ if (ruleOk
+ // Don't repeat a recurrent rule:
+ && (m_tranRules.isEmpty()
+ || !isSameRule(m_tranRules.last(), rule))) {
+ rule.startYear = m_tranRules.isEmpty() ? MIN_YEAR : year;
m_tranRules.append(rule);
+ }
}
RegCloseKey(dynamicKey);
} else {
// No dynamic data so use the base data
bool ruleOk;
QWinTransitionRule rule = readRegistryRule(baseKey, L"TZI", &ruleOk);
- rule.startYear = 1970;
+ rule.startYear = MIN_YEAR;
if (ruleOk)
m_tranRules.append(rule);
}
@@ -479,20 +544,28 @@ void QWinTimeZonePrivate::init(const QByteArray &ianaId)
DWORD firstYear = 0;
DWORD lastYear = 0;
DYNAMIC_TIME_ZONE_INFORMATION dtzi = dynamicInfoForId(m_windowsId);
- GetDynamicTimeZoneInformationEffectiveYears(&dtzi, &firstYear, &lastYear);
- // If there is no dynamic information, you can still query for
- // year 0, which helps simplifying following part
- for (DWORD year = firstYear; year <= lastYear; ++year) {
- TIME_ZONE_INFORMATION tzi;
- if (!GetTimeZoneInformationForYear(year, &dtzi, &tzi))
- continue;
- QWinTransitionRule rule;
- rule.standardTimeBias = tzi.Bias + tzi.StandardBias;
- rule.daylightTimeBias = tzi.Bias + tzi.DaylightBias - rule.standardTimeBias;
- rule.standardTimeRule = tzi.StandardDate;
- rule.daylightTimeRule = tzi.DaylightDate;
- rule.startYear = year;
- m_tranRules.append(rule);
+ if (GetDynamicTimeZoneInformationEffectiveYears(&dtzi, &firstYear, &lastYear)
+ == ERROR_SUCCESS && firstYear < lastYear) {
+ for (DWORD year = firstYear; year <= lastYear; ++year) {
+ bool ok = false;
+ QWinTransitionRule rule = readDynamicRule(dtzi, year, &ok);
+ if (ok
+ // Don't repeat a recurrent rule
+ && (m_tranRules.isEmpty()
+ || !isSameRule(m_tranRules.last(), rule))) {
+ rule.startYear = m_tranRules.isEmpty() ? MIN_YEAR : year;
+ m_tranRules.append(rule);
+ }
+ }
+ } else {
+ // At least try to get the non-dynamic data:
+ dtzi.DynamicDaylightTimeDisabled = false;
+ bool ok = false;
+ QWinTransitionRule rule = readDynamicRule(dtzi, 1970, &ok);
+ if (ok) {
+ rule.startYear = MIN_YEAR;
+ m_tranRules.append(rule);
+ }
}
}
#endif // QT_USE_REGISTRY_TIMEZONE
@@ -519,7 +592,8 @@ QString QWinTimeZonePrivate::displayName(QTimeZone::TimeType timeType,
Q_UNUSED(locale);
if (nameType == QTimeZone::OffsetName) {
- QWinTransitionRule rule = ruleForYear(QDate::currentDate().year());
+ const QWinTransitionRule &rule =
+ m_tranRules.at(ruleIndexForYear(m_tranRules, QDate::currentDate().year()));
if (timeType == QTimeZone::DaylightTime)
return isoOffsetFormat((rule.standardTimeBias + rule.daylightTimeBias) * -60);
else
@@ -575,22 +649,22 @@ QTimeZonePrivate::Data QWinTimeZonePrivate::data(qint64 forMSecsSinceEpoch) cons
qint64 first;
qint64 second;
qint64 next = maxMSecs();
- qint64 stdMSecs;
- qint64 dstMSecs;
+ TransitionTimePair pair;
QWinTransitionRule rule;
do {
// Convert the transition rules into msecs for the year we want to try
- rule = ruleForYear(year);
+ rule = m_tranRules.at(ruleIndexForYear(m_tranRules, year));
// If no transition rules to calculate then no DST, so just use rule for std
if (rule.standardTimeRule.wMonth == 0 && rule.daylightTimeRule.wMonth == 0)
break;
- calculateTransitionsForYear(rule, year, &stdMSecs, &dstMSecs);
- if (stdMSecs < dstMSecs) {
- first = stdMSecs;
- second = dstMSecs;
+
+ pair = TransitionTimePair(rule, year);
+ if (pair.std < pair.dst) {
+ first = pair.std;
+ second = pair.dst;
} else {
- first = dstMSecs;
- second = stdMSecs;
+ first = pair.dst;
+ second = pair.std;
}
if (forMSecsSinceEpoch >= second && second != invalidMSecs())
next = second;
@@ -600,7 +674,7 @@ QTimeZonePrivate::Data QWinTimeZonePrivate::data(qint64 forMSecsSinceEpoch) cons
--year;
} while (next == maxMSecs() && year >= MIN_YEAR);
- return ruleToData(rule, forMSecsSinceEpoch, (next == dstMSecs) ? QTimeZone::DaylightTime : QTimeZone::StandardTime);
+ return ruleToData(rule, forMSecsSinceEpoch, (next == pair.dst) ? QTimeZone::DaylightTime : QTimeZone::StandardTime);
}
bool QWinTimeZonePrivate::hasTransitions() const
@@ -621,7 +695,7 @@ QTimeZonePrivate::Data QWinTimeZonePrivate::nextTransition(qint64 afterMSecsSinc
// If the required year falls after the last rule start year and the last rule has no
// valid future transition calculations then there is no next transition
if (year > m_tranRules.last().startYear) {
- rule = ruleForYear(year);
+ rule = m_tranRules.at(ruleIndexForYear(m_tranRules, year));
// If the rules have either a fixed year, or no month, then no future trans
if (rule.standardTimeRule.wYear != 0 || rule.daylightTimeRule.wYear != 0
|| rule.standardTimeRule.wMonth == 0 || rule.daylightTimeRule.wMonth == 0) {
@@ -634,22 +708,21 @@ QTimeZonePrivate::Data QWinTimeZonePrivate::nextTransition(qint64 afterMSecsSinc
qint64 first;
qint64 second;
qint64 next = minMSecs();
- qint64 stdMSecs;
- qint64 dstMSecs;
+ TransitionTimePair pair;
do {
// Convert the transition rules into msecs for the year we want to try
- rule = ruleForYear(year);
+ rule = m_tranRules.at(ruleIndexForYear(m_tranRules, year));
// If no transition rules to calculate then no next transition
if (rule.standardTimeRule.wMonth == 0 && rule.daylightTimeRule.wMonth == 0)
return invalidData();
- calculateTransitionsForYear(rule, year, &stdMSecs, &dstMSecs);
+ pair = TransitionTimePair(rule, year);
// Find the first and second transition for the year
- if (stdMSecs < dstMSecs) {
- first = stdMSecs;
- second = dstMSecs;
+ if (pair.std < pair.dst) {
+ first = pair.std;
+ second = pair.dst;
} else {
- first = dstMSecs;
- second = stdMSecs;
+ first = pair.dst;
+ second = pair.std;
}
if (afterMSecsSinceEpoch < first)
next = first;
@@ -662,7 +735,7 @@ QTimeZonePrivate::Data QWinTimeZonePrivate::nextTransition(qint64 afterMSecsSinc
if (next == minMSecs() || next == invalidMSecs())
return invalidData();
- return ruleToData(rule, next, (next == dstMSecs) ? QTimeZone::DaylightTime : QTimeZone::StandardTime);
+ return ruleToData(rule, next, (next == pair.dst) ? QTimeZone::DaylightTime : QTimeZone::StandardTime);
}
QTimeZonePrivate::Data QWinTimeZonePrivate::previousTransition(qint64 beforeMSecsSinceEpoch) const
@@ -674,7 +747,7 @@ QTimeZonePrivate::Data QWinTimeZonePrivate::previousTransition(qint64 beforeMSec
// If the required year falls before the first rule start year and the first rule has no
// valid transition calculations then there is no previous transition
if (year < m_tranRules.first().startYear) {
- rule = ruleForYear(year);
+ rule = m_tranRules.at(ruleIndexForYear(m_tranRules, year));
// If the rules have either a fixed year, or no month, then no previous trans
if (rule.standardTimeRule.wYear != 0 || rule.daylightTimeRule.wYear != 0
|| rule.standardTimeRule.wMonth == 0 || rule.daylightTimeRule.wMonth == 0) {
@@ -685,21 +758,20 @@ QTimeZonePrivate::Data QWinTimeZonePrivate::previousTransition(qint64 beforeMSec
qint64 first;
qint64 second;
qint64 next = maxMSecs();
- qint64 stdMSecs;
- qint64 dstMSecs;
+ TransitionTimePair pair;
do {
// Convert the transition rules into msecs for the year we want to try
- rule = ruleForYear(year);
+ rule = m_tranRules.at(ruleIndexForYear(m_tranRules, year));
// If no transition rules to calculate then no previous transition
if (rule.standardTimeRule.wMonth == 0 && rule.daylightTimeRule.wMonth == 0)
return invalidData();
- calculateTransitionsForYear(rule, year, &stdMSecs, &dstMSecs);
- if (stdMSecs < dstMSecs) {
- first = stdMSecs;
- second = dstMSecs;
+ pair = TransitionTimePair(rule, year);
+ if (pair.std < pair.dst) {
+ first = pair.std;
+ second = pair.dst;
} else {
- first = dstMSecs;
- second = stdMSecs;
+ first = pair.dst;
+ second = pair.std;
}
if (beforeMSecsSinceEpoch > second && second != invalidMSecs())
next = second;
@@ -712,7 +784,7 @@ QTimeZonePrivate::Data QWinTimeZonePrivate::previousTransition(qint64 beforeMSec
if (next == maxMSecs())
return invalidData();
- return ruleToData(rule, next, (next == dstMSecs) ? QTimeZone::DaylightTime : QTimeZone::StandardTime);
+ return ruleToData(rule, next, (next == pair.dst) ? QTimeZone::DaylightTime : QTimeZone::StandardTime);
}
QByteArray QWinTimeZonePrivate::systemTimeZoneId() const
@@ -744,20 +816,11 @@ QList<QByteArray> QWinTimeZonePrivate::availableTimeZoneIds() const
return result;
}
-QWinTimeZonePrivate::QWinTransitionRule QWinTimeZonePrivate::ruleForYear(int year) const
-{
- for (int i = m_tranRules.size() - 1; i >= 0; --i) {
- if (m_tranRules.at(i).startYear <= year)
- return m_tranRules.at(i);
- }
- return m_tranRules.at(0);
-}
-
QTimeZonePrivate::Data QWinTimeZonePrivate::ruleToData(const QWinTransitionRule &rule,
qint64 atMSecsSinceEpoch,
QTimeZone::TimeType type) const
{
- QTimeZonePrivate::Data tran = QTimeZonePrivate::invalidData();
+ Data tran = invalidData();
tran.atMSecsSinceEpoch = atMSecsSinceEpoch;
tran.standardTimeOffset = rule.standardTimeBias * -60;
if (type == QTimeZone::DaylightTime) {
diff --git a/src/corelib/tools/qversionnumber.h b/src/corelib/tools/qversionnumber.h
index 3836bc2119..1bfb4aab39 100644
--- a/src/corelib/tools/qversionnumber.h
+++ b/src/corelib/tools/qversionnumber.h
@@ -281,7 +281,7 @@ public:
Q_REQUIRED_RESULT Q_CORE_EXPORT QString toString() const;
#if QT_STRINGVIEW_LEVEL < 2
- Q_REQUIRED_RESULT Q_CORE_EXPORT static Q_DECL_PURE_FUNCTION QVersionNumber fromString(const QString &string, int *suffixIndex = Q_NULLPTR);
+ Q_REQUIRED_RESULT Q_CORE_EXPORT static Q_DECL_PURE_FUNCTION QVersionNumber fromString(const QString &string, int *suffixIndex = nullptr);
#endif
Q_REQUIRED_RESULT Q_CORE_EXPORT static Q_DECL_PURE_FUNCTION QVersionNumber fromString(QLatin1String string, int *suffixIndex = nullptr);
Q_REQUIRED_RESULT Q_CORE_EXPORT static Q_DECL_PURE_FUNCTION QVersionNumber fromString(QStringView string, int *suffixIndex = nullptr);
diff --git a/src/corelib/tools/tools.pri b/src/corelib/tools/tools.pri
index 2c609098ea..56b30279bd 100644
--- a/src/corelib/tools/tools.pri
+++ b/src/corelib/tools/tools.pri
@@ -223,4 +223,3 @@ TR_EXCLUDE += ../3rdparty/*
# MIPS DSP
MIPS_DSP_ASM += tools/qstring_mips_dsp_asm.S
MIPS_DSP_HEADERS += ../gui/painting/qt_mips_asm_dsp_p.h
-CONFIG += simd
diff --git a/src/corelib/xml/qxmlstream.cpp b/src/corelib/xml/qxmlstream.cpp
index f6ae3571ab..c1ed410de7 100644
--- a/src/corelib/xml/qxmlstream.cpp
+++ b/src/corelib/xml/qxmlstream.cpp
@@ -2980,7 +2980,8 @@ public:
uint inEmptyElement :1;
uint lastWasStartElement :1;
uint wroteSomething :1;
- uint hasError :1;
+ uint hasIoError :1;
+ uint hasEncodingError :1;
uint autoFormatting :1;
uint isCodecASCIICompatible :1;
QByteArray autoFormattingIndent;
@@ -3016,7 +3017,8 @@ QXmlStreamWriterPrivate::QXmlStreamWriterPrivate(QXmlStreamWriter *q)
checkIfASCIICompatibleCodec();
inStartElement = inEmptyElement = false;
wroteSomething = false;
- hasError = false;
+ hasIoError = false;
+ hasEncodingError = false;
lastWasStartElement = false;
lastNamespaceDeclaration = 1;
autoFormatting = false;
@@ -3043,15 +3045,19 @@ void QXmlStreamWriterPrivate::checkIfASCIICompatibleCodec()
void QXmlStreamWriterPrivate::write(const QStringRef &s)
{
if (device) {
- if (hasError)
+ if (hasIoError)
return;
#ifdef QT_NO_TEXTCODEC
QByteArray bytes = s.toLatin1();
#else
QByteArray bytes = encoder->fromUnicode(s.constData(), s.size());
+ if (encoder->hasFailure()) {
+ hasEncodingError = true;
+ return;
+ }
#endif
if (device->write(bytes) != bytes.size())
- hasError = true;
+ hasIoError = true;
}
else if (stringDevice)
s.appendTo(stringDevice);
@@ -3062,15 +3068,19 @@ void QXmlStreamWriterPrivate::write(const QStringRef &s)
void QXmlStreamWriterPrivate::write(const QString &s)
{
if (device) {
- if (hasError)
+ if (hasIoError)
return;
#ifdef QT_NO_TEXTCODEC
QByteArray bytes = s.toLatin1();
#else
QByteArray bytes = encoder->fromUnicode(s);
+ if (encoder->hasFailure()) {
+ hasEncodingError = true;
+ return;
+ }
#endif
if (device->write(bytes) != bytes.size())
- hasError = true;
+ hasIoError = true;
}
else if (stringDevice)
stringDevice->append(s);
@@ -3084,25 +3094,47 @@ void QXmlStreamWriterPrivate::writeEscaped(const QString &s, bool escapeWhitespa
escaped.reserve(s.size());
for ( int i = 0; i < s.size(); ++i ) {
QChar c = s.at(i);
- if (c.unicode() == '<' )
+ switch (c.unicode()) {
+ case '<':
escaped.append(QLatin1String("&lt;"));
- else if (c.unicode() == '>' )
+ break;
+ case '>':
escaped.append(QLatin1String("&gt;"));
- else if (c.unicode() == '&' )
+ break;
+ case '&':
escaped.append(QLatin1String("&amp;"));
- else if (c.unicode() == '\"' )
+ break;
+ case '\"':
escaped.append(QLatin1String("&quot;"));
- else if (escapeWhitespace && c.isSpace()) {
- if (c.unicode() == '\n')
+ break;
+ case '\t':
+ if (escapeWhitespace)
+ escaped.append(QLatin1String("&#9;"));
+ else
+ escaped += c;
+ break;
+ case '\n':
+ if (escapeWhitespace)
escaped.append(QLatin1String("&#10;"));
- else if (c.unicode() == '\r')
+ else
+ escaped += c;
+ break;
+ case '\v':
+ case '\f':
+ hasEncodingError = true;
+ break;
+ case '\r':
+ if (escapeWhitespace)
escaped.append(QLatin1String("&#13;"));
- else if (c.unicode() == '\t')
- escaped.append(QLatin1String("&#9;"));
else
escaped += c;
- } else {
- escaped += QChar(c);
+ break;
+ default:
+ if (c.unicode() > 0x1f && c.unicode() < 0xfffe)
+ escaped += c;
+ else
+ hasEncodingError = true;
+ break;
}
}
write(escaped);
@@ -3112,11 +3144,11 @@ void QXmlStreamWriterPrivate::writeEscaped(const QString &s, bool escapeWhitespa
void QXmlStreamWriterPrivate::write(const char *s, int len)
{
if (device) {
- if (hasError)
+ if (hasIoError)
return;
if (isCodecASCIICompatible) {
if (device->write(s, len) != len)
- hasError = true;
+ hasIoError = true;
return;
}
}
@@ -3400,15 +3432,18 @@ int QXmlStreamWriter::autoFormattingIndent() const
}
/*!
- Returns \c true if the stream failed to write to the underlying device.
+ Returns \c true if writing failed.
+
+ This can happen if the stream failed to write to the underlying
+ device or if the data to be written contained invalid characters.
The error status is never reset. Writes happening after the error
- occurred are ignored, even if the error condition is cleared.
+ occurred may be ignored, even if the error condition is cleared.
*/
bool QXmlStreamWriter::hasError() const
{
Q_D(const QXmlStreamWriter);
- return d->hasError;
+ return d->hasIoError || d->hasEncodingError;
}
/*!
diff --git a/src/corelib/xml/qxmlstream.h b/src/corelib/xml/qxmlstream.h
index bf6ddefcdd..2350d12dd6 100644
--- a/src/corelib/xml/qxmlstream.h
+++ b/src/corelib/xml/qxmlstream.h
@@ -120,7 +120,7 @@ public:
reserved(other.reserved),
m_isDefault(other.m_isDefault)
{
- other.reserved = Q_NULLPTR;
+ other.reserved = nullptr;
}
QXmlStreamAttribute &operator=(QXmlStreamAttribute &&other) Q_DECL_NOTHROW // = default;
{
diff --git a/src/dbus/qdbusabstractinterface.cpp b/src/dbus/qdbusabstractinterface.cpp
index 9f2e688ebb..50a0483231 100644
--- a/src/dbus/qdbusabstractinterface.cpp
+++ b/src/dbus/qdbusabstractinterface.cpp
@@ -70,10 +70,10 @@ class DisconnectRelayEvent : public QMetaCallEvent
{
public:
DisconnectRelayEvent(QObject *sender, const QMetaMethod &m)
- : QMetaCallEvent(0, 0, Q_NULLPTR, sender, m.methodIndex())
+ : QMetaCallEvent(0, 0, nullptr, sender, m.methodIndex())
{}
- void placeMetaCall(QObject *object) Q_DECL_OVERRIDE
+ void placeMetaCall(QObject *object) override
{
QDBusAbstractInterface *iface = static_cast<QDBusAbstractInterface *>(object);
QDBusAbstractInterfacePrivate::finishDisconnectNotify(iface, signalId());
diff --git a/src/dbus/qdbusabstractinterface.h b/src/dbus/qdbusabstractinterface.h
index f859c5ee7d..d6b0870787 100644
--- a/src/dbus/qdbusabstractinterface.h
+++ b/src/dbus/qdbusabstractinterface.h
@@ -67,7 +67,7 @@ class QDBusAbstractInterfacePrivate;
class Q_DBUS_EXPORT QDBusAbstractInterfaceBase: public QObject
{
public:
- int qt_metacall(QMetaObject::Call, int, void**) Q_DECL_OVERRIDE;
+ int qt_metacall(QMetaObject::Call, int, void**) override;
protected:
QDBusAbstractInterfaceBase(QDBusAbstractInterfacePrivate &dd, QObject *parent);
private:
@@ -147,8 +147,8 @@ protected:
const QDBusConnection &connection, QObject *parent);
QDBusAbstractInterface(QDBusAbstractInterfacePrivate &, QObject *parent);
- void connectNotify(const QMetaMethod &signal) Q_DECL_OVERRIDE;
- void disconnectNotify(const QMetaMethod &signal) Q_DECL_OVERRIDE;
+ void connectNotify(const QMetaMethod &signal) override;
+ void disconnectNotify(const QMetaMethod &signal) override;
QVariant internalPropGet(const char *propname) const;
void internalPropSet(const char *propname, const QVariant &value);
QDBusMessage internalConstCall(QDBus::CallMode mode,
diff --git a/src/dbus/qdbusargument.h b/src/dbus/qdbusargument.h
index 5342a79227..a6d4e9cd25 100644
--- a/src/dbus/qdbusargument.h
+++ b/src/dbus/qdbusargument.h
@@ -77,7 +77,7 @@ public:
QDBusArgument();
QDBusArgument(const QDBusArgument &other);
#ifdef Q_COMPILER_RVALUE_REFS
- QDBusArgument(QDBusArgument &&other) Q_DECL_NOTHROW : d(other.d) { other.d = Q_NULLPTR; }
+ QDBusArgument(QDBusArgument &&other) Q_DECL_NOTHROW : d(other.d) { other.d = nullptr; }
QDBusArgument &operator=(QDBusArgument &&other) Q_DECL_NOTHROW { swap(other); return *this; }
#endif
QDBusArgument &operator=(const QDBusArgument &other);
@@ -160,7 +160,7 @@ QT_BEGIN_NAMESPACE
template<typename T> inline T qdbus_cast(const QDBusArgument &arg
#ifndef Q_QDOC
-, T * = Q_NULLPTR
+, T * = nullptr
#endif
)
{
@@ -171,7 +171,7 @@ template<typename T> inline T qdbus_cast(const QDBusArgument &arg
template<typename T> inline T qdbus_cast(const QVariant &v
#ifndef Q_QDOC
-, T * = Q_NULLPTR
+, T * = nullptr
#endif
)
{
diff --git a/src/dbus/qdbusconnection.cpp b/src/dbus/qdbusconnection.cpp
index 75c1e92f96..c95f195aca 100644
--- a/src/dbus/qdbusconnection.cpp
+++ b/src/dbus/qdbusconnection.cpp
@@ -147,7 +147,7 @@ QDBusConnectionManager::QDBusConnectionManager()
// prevent the library from being unloaded on Windows. See comments in the function.
preventDllUnload();
#endif
- defaultBuses[0] = defaultBuses[1] = Q_NULLPTR;
+ defaultBuses[0] = defaultBuses[1] = nullptr;
start();
}
@@ -186,13 +186,13 @@ void QDBusConnectionManager::run()
delete d;
} else {
d->closeConnection();
- d->moveToThread(Q_NULLPTR); // allow it to be deleted in another thread
+ d->moveToThread(nullptr); // allow it to be deleted in another thread
}
}
connectionHash.clear();
// allow deletion from any thread without warning
- moveToThread(Q_NULLPTR);
+ moveToThread(nullptr);
}
QDBusConnectionPrivate *QDBusConnectionManager::connectToBus(QDBusConnection::BusType type, const QString &name,
@@ -1175,7 +1175,7 @@ bool QDBusConnection::unregisterService(const QString &serviceName)
QDBusConnection QDBusConnection::sessionBus()
{
if (_q_manager.isDestroyed())
- return QDBusConnection(Q_NULLPTR);
+ return QDBusConnection(nullptr);
return QDBusConnection(_q_manager()->busConnection(SessionBus));
}
@@ -1189,7 +1189,7 @@ QDBusConnection QDBusConnection::sessionBus()
QDBusConnection QDBusConnection::systemBus()
{
if (_q_manager.isDestroyed())
- return QDBusConnection(Q_NULLPTR);
+ return QDBusConnection(nullptr);
return QDBusConnection(_q_manager()->busConnection(SystemBus));
}
diff --git a/src/dbus/qdbusconnection.h b/src/dbus/qdbusconnection.h
index ba28938b60..0352978989 100644
--- a/src/dbus/qdbusconnection.h
+++ b/src/dbus/qdbusconnection.h
@@ -130,7 +130,7 @@ public:
explicit QDBusConnection(const QString &name);
QDBusConnection(const QDBusConnection &other);
#ifdef Q_COMPILER_RVALUE_REFS
- QDBusConnection(QDBusConnection &&other) Q_DECL_NOTHROW : d(other.d) { other.d = Q_NULLPTR; }
+ QDBusConnection(QDBusConnection &&other) Q_DECL_NOTHROW : d(other.d) { other.d = nullptr; }
QDBusConnection &operator=(QDBusConnection &&other) Q_DECL_NOTHROW { swap(other); return *this; }
#endif
QDBusConnection &operator=(const QDBusConnection &other);
diff --git a/src/dbus/qdbusconnection_p.h b/src/dbus/qdbusconnection_p.h
index d323088779..3043d7378c 100644
--- a/src/dbus/qdbusconnection_p.h
+++ b/src/dbus/qdbusconnection_p.h
@@ -59,7 +59,6 @@
#include <QtCore/qatomic.h>
#include <QtCore/qhash.h>
-#include <QtCore/qmutex.h>
#include <QtCore/qobject.h>
#include <QtCore/qpointer.h>
#include <QtCore/qreadwritelock.h>
@@ -198,7 +197,6 @@ public:
~QDBusConnectionPrivate();
void createBusService();
- void setDispatchEnabled(bool enable);
void setPeer(DBusConnection *connection, const QDBusErrorInternal &error);
void setConnection(DBusConnection *connection, const QDBusErrorInternal &error);
void setServer(QDBusServer *object, DBusServer *server, const QDBusErrorInternal &error);
@@ -271,10 +269,11 @@ private:
void _q_newConnection(QDBusConnectionPrivate *newConnection);
protected:
- void timerEvent(QTimerEvent *e) Q_DECL_OVERRIDE;
+ void timerEvent(QTimerEvent *e) override;
public slots:
// public slots
+ void setDispatchEnabled(bool enable);
void doDispatch();
void socketRead(int);
void socketWrite(int);
@@ -312,9 +311,6 @@ public:
QDBusServer *serverObject;
};
- // the dispatch lock protects everything related to the DBusConnection or DBusServer
- // including the timeouts and watches
- QMutex dispatchLock;
union {
DBusConnection *connection;
DBusServer *server;
@@ -390,7 +386,9 @@ public:
public slots:
void execute()
{
- con->setDispatchEnabled(true);
+ // This call cannot race with something disabling dispatch only because dispatch is
+ // never re-disabled from Qt code on an in-use connection once it has been enabled.
+ QMetaObject::invokeMethod(con, "setDispatchEnabled", Qt::QueuedConnection, Q_ARG(bool, true));
if (!con->ref.deref())
con->deleteLater();
deleteLater();
diff --git a/src/dbus/qdbusconnectioninterface.h b/src/dbus/qdbusconnectioninterface.h
index 37f35dbe81..c7b1573722 100644
--- a/src/dbus/qdbusconnectioninterface.h
+++ b/src/dbus/qdbusconnectioninterface.h
@@ -115,8 +115,8 @@ Q_SIGNALS:
void NameLost(const QString &);
void NameOwnerChanged(const QString &, const QString &, const QString &);
protected:
- void connectNotify(const QMetaMethod &) Q_DECL_OVERRIDE;
- void disconnectNotify(const QMetaMethod &) Q_DECL_OVERRIDE;
+ void connectNotify(const QMetaMethod &) override;
+ void disconnectNotify(const QMetaMethod &) override;
#endif
};
diff --git a/src/dbus/qdbusconnectionmanager_p.h b/src/dbus/qdbusconnectionmanager_p.h
index 1c7dea811d..ac49683cee 100644
--- a/src/dbus/qdbusconnectionmanager_p.h
+++ b/src/dbus/qdbusconnectionmanager_p.h
@@ -85,7 +85,7 @@ signals:
void serverRequested(const QString &address, void *server);
protected:
- void run() Q_DECL_OVERRIDE;
+ void run() override;
private:
void executeConnectionRequest(ConnectionRequestData *data);
diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp
index 16cd021d0d..03de5b0091 100644
--- a/src/dbus/qdbusintegrator.cpp
+++ b/src/dbus/qdbusintegrator.cpp
@@ -150,7 +150,6 @@ static dbus_bool_t qDBusAddTimeout(DBusTimeout *timeout, void *data)
if (Q_UNLIKELY(!q_dbus_timeout_get_enabled(timeout)))
return false;
- QDBusDispatchLocker locker(AddTimeoutAction, d);
Q_ASSERT(d->timeouts.key(timeout, 0) == 0);
int timerId = d->startTimer(q_dbus_timeout_get_interval(timeout));
@@ -172,8 +171,6 @@ static void qDBusRemoveTimeout(DBusTimeout *timeout, void *data)
QDBusConnectionPrivate *d = static_cast<QDBusConnectionPrivate *>(data);
Q_ASSERT(QThread::currentThread() == d->thread());
- QDBusDispatchLocker locker(RemoveTimeoutAction, d);
-
QDBusConnectionPrivate::TimeoutHash::iterator it = d->timeouts.begin();
while (it != d->timeouts.end()) {
if (it.value() == timeout) {
@@ -210,7 +207,6 @@ static dbus_bool_t qDBusAddWatch(DBusWatch *watch, void *data)
QDBusConnectionPrivate::Watcher watcher;
- QDBusDispatchLocker locker(AddWatchAction, d);
if (flags & DBUS_WATCH_READABLE) {
//qDebug("addReadWatch %d", fd);
watcher.watch = watch;
@@ -241,7 +237,6 @@ static void qDBusRemoveWatch(DBusWatch *watch, void *data)
Q_ASSERT(QThread::currentThread() == d->thread());
int fd = q_dbus_watch_get_unix_fd(watch);
- QDBusDispatchLocker locker(RemoveWatchAction, d);
QDBusConnectionPrivate::WatcherHash::iterator i = d->watchers.find(fd);
while (i != d->watchers.end() && i.key() == fd) {
if (i.value().watch == watch) {
@@ -263,8 +258,6 @@ static void qDBusToggleWatch(DBusWatch *watch, void *data)
Q_ASSERT(QThread::currentThread() == d->thread());
int fd = q_dbus_watch_get_unix_fd(watch);
- QDBusDispatchLocker locker(ToggleWatchAction, d);
-
QDBusConnectionPrivate::WatcherHash::iterator i = d->watchers.find(fd);
while (i != d->watchers.end() && i.key() == fd) {
if (i.value().watch == watch) {
@@ -766,7 +759,7 @@ static int findSlot(const QMetaObject *mo, const QByteArray &name, int flags,
*/
void QDBusConnectionPrivate::setDispatchEnabled(bool enable)
{
- QDBusDispatchLocker locker(SetDispatchEnabledAction, this);
+ checkThread();
dispatchEnabled = enable;
if (enable)
emit dispatchStatusChanged();
@@ -1024,7 +1017,7 @@ extern bool qDBusInitThreads();
QDBusConnectionPrivate::QDBusConnectionPrivate(QObject *p)
: QObject(p), ref(1), capabilities(0), mode(InvalidMode), busService(0),
- dispatchLock(QMutex::Recursive), connection(0),
+ connection(0),
rootNode(QString(QLatin1Char('/'))),
anonymousAuthenticationAllowed(false),
dispatchEnabled(true)
@@ -1078,7 +1071,7 @@ QDBusConnectionPrivate::~QDBusConnectionPrivate()
Q_ASSERT(ref.load() == 0);
QObject *obj = (QObject *)busService;
if (obj) {
- disconnect(obj, Q_NULLPTR, this, Q_NULLPTR);
+ disconnect(obj, nullptr, this, nullptr);
delete obj;
}
if (connection)
@@ -1176,7 +1169,6 @@ bool QDBusConnectionPrivate::handleError(const QDBusErrorInternal &error)
void QDBusConnectionPrivate::timerEvent(QTimerEvent *e)
{
{
- QDBusDispatchLocker locker(TimerEventAction, this);
DBusTimeout *timeout = timeouts.value(e->timerId(), 0);
if (timeout)
q_dbus_timeout_handle(timeout);
@@ -1187,7 +1179,6 @@ void QDBusConnectionPrivate::timerEvent(QTimerEvent *e)
void QDBusConnectionPrivate::doDispatch()
{
- QDBusDispatchLocker locker(DoDispatchAction, this);
if (mode == ClientMode || mode == PeerMode) {
while (q_dbus_connection_dispatch(connection) == DBUS_DISPATCH_DATA_REMAINS) ;
if (dispatchEnabled && !pendingMessages.isEmpty()) {
@@ -1205,7 +1196,6 @@ void QDBusConnectionPrivate::doDispatch()
void QDBusConnectionPrivate::socketRead(int fd)
{
- QDBusDispatchLocker locker(SocketReadAction, this);
WatcherHash::ConstIterator it = watchers.constFind(fd);
while (it != watchers.constEnd() && it.key() == fd) {
if (it->watch && it->read && it->read->isEnabled()) {
@@ -1220,7 +1210,6 @@ void QDBusConnectionPrivate::socketRead(int fd)
void QDBusConnectionPrivate::socketWrite(int fd)
{
- QDBusDispatchLocker locker(SocketWriteAction, this);
WatcherHash::ConstIterator it = watchers.constFind(fd);
while (it != watchers.constEnd() && it.key() == fd) {
if (it->watch && it->write && it->write->isEnabled()) {
@@ -1283,10 +1272,7 @@ void QDBusConnectionPrivate::relaySignal(QObject *obj, const QMetaObject *mo, in
//qDBusDebug() << "Emitting signal" << message;
//qDBusDebug() << "for paths:";
q_dbus_message_set_no_reply(msg, true); // the reply would not be delivered to anything
- {
- QDBusDispatchLocker locker(HuntAndEmitAction, this);
- huntAndEmit(connection, msg, obj, rootNode, isScriptable, isAdaptor);
- }
+ huntAndEmit(connection, msg, obj, rootNode, isScriptable, isAdaptor);
q_dbus_message_unref(msg);
}
@@ -1950,7 +1936,7 @@ bool QDBusConnectionPrivate::send(const QDBusMessage& message)
q_dbus_message_set_no_reply(msg, true); // the reply would not be delivered to anything
qDBusDebug() << this << "sending message (no reply):" << message;
- emit messageNeedsSending(Q_NULLPTR, msg);
+ emit messageNeedsSending(nullptr, msg);
return true;
}
@@ -2164,9 +2150,8 @@ void QDBusConnectionPrivate::sendInternal(QDBusPendingCallPrivate *pcall, void *
Q_ASSERT(isNoReply == !!q_dbus_message_get_no_reply(msg));
checkThread();
- QDBusDispatchLocker locker(SendMessageAction, this);
- if (isNoReply && q_dbus_connection_send(connection, msg, Q_NULLPTR)) {
+ if (isNoReply && q_dbus_connection_send(connection, msg, nullptr)) {
// success
} else if (!isNoReply && q_dbus_connection_send_with_reply(connection, msg, &pending, timeout)) {
if (pending) {
@@ -2509,7 +2494,7 @@ QString QDBusConnectionPrivate::getNameOwnerNoCache(const QString &serviceName)
QDBusMessagePrivate::setParametersValidated(msg, true);
msg << serviceName;
- QDBusPendingCallPrivate *pcall = sendWithReplyAsync(msg, Q_NULLPTR, Q_NULLPTR, Q_NULLPTR);
+ QDBusPendingCallPrivate *pcall = sendWithReplyAsync(msg, nullptr, nullptr, nullptr);
if (thread() == QThread::currentThread()) {
// this function may be called in our own thread and
// QDBusPendingCallPrivate::waitForFinished() would deadlock there
diff --git a/src/dbus/qdbusintegrator_p.h b/src/dbus/qdbusintegrator_p.h
index 85a067da1e..3cd029a933 100644
--- a/src/dbus/qdbusintegrator_p.h
+++ b/src/dbus/qdbusintegrator_p.h
@@ -109,7 +109,7 @@ public:
: QMetaCallEvent(0, id, 0, sender, -1), connection(c), message(msg), metaTypes(types), flags(f)
{ }
- void placeMetaCall(QObject *object) Q_DECL_OVERRIDE
+ void placeMetaCall(QObject *object) override
{
QDBusConnectionPrivate::d(connection)->deliverCall(object, flags, message, metaTypes, id());
}
@@ -132,7 +132,7 @@ public:
{ }
~QDBusActivateObjectEvent();
- void placeMetaCall(QObject *) Q_DECL_OVERRIDE;
+ void placeMetaCall(QObject *) override;
private:
QDBusConnection connection; // just for refcounting
@@ -148,10 +148,10 @@ public:
typedef void (*Hook)(const QDBusMessage&);
QDBusSpyCallEvent(QDBusConnectionPrivate *cp, const QDBusConnection &c, const QDBusMessage &msg,
const Hook *hooks, int count)
- : QMetaCallEvent(0, 0, Q_NULLPTR, cp, 0), conn(c), msg(msg), hooks(hooks), hookCount(count)
+ : QMetaCallEvent(0, 0, nullptr, cp, 0), conn(c), msg(msg), hooks(hooks), hookCount(count)
{}
~QDBusSpyCallEvent();
- void placeMetaCall(QObject *) Q_DECL_OVERRIDE;
+ void placeMetaCall(QObject *) override;
static inline void invokeSpyHooks(const QDBusMessage &msg, const Hook *hooks, int hookCount);
QDBusConnection conn; // keeps the refcount in QDBusConnectionPrivate up
diff --git a/src/dbus/qdbusinterface.h b/src/dbus/qdbusinterface.h
index b6c2693400..c147d07d50 100644
--- a/src/dbus/qdbusinterface.h
+++ b/src/dbus/qdbusinterface.h
@@ -59,12 +59,12 @@ private:
public:
QDBusInterface(const QString &service, const QString &path, const QString &interface = QString(),
const QDBusConnection &connection = QDBusConnection::sessionBus(),
- QObject *parent = Q_NULLPTR);
+ QObject *parent = nullptr);
~QDBusInterface();
- virtual const QMetaObject *metaObject() const Q_DECL_OVERRIDE;
- virtual void *qt_metacast(const char *) Q_DECL_OVERRIDE;
- virtual int qt_metacall(QMetaObject::Call, int, void **) Q_DECL_OVERRIDE;
+ virtual const QMetaObject *metaObject() const override;
+ virtual void *qt_metacast(const char *) override;
+ virtual int qt_metacall(QMetaObject::Call, int, void **) override;
private:
Q_DECLARE_PRIVATE(QDBusInterface)
diff --git a/src/dbus/qdbusmetatype.cpp b/src/dbus/qdbusmetatype.cpp
index 6ed6c43e9d..0729a3cbbb 100644
--- a/src/dbus/qdbusmetatype.cpp
+++ b/src/dbus/qdbusmetatype.cpp
@@ -131,6 +131,18 @@ void QDBusMetaTypeId::init()
qDBusRegisterMetaType<QList<QDBusObjectPath> >();
qDBusRegisterMetaType<QList<QDBusSignature> >();
qDBusRegisterMetaType<QList<QDBusUnixFileDescriptor> >();
+
+ qDBusRegisterMetaType<QVector<bool> >();
+ qDBusRegisterMetaType<QVector<short> >();
+ qDBusRegisterMetaType<QVector<ushort> >();
+ qDBusRegisterMetaType<QVector<int> >();
+ qDBusRegisterMetaType<QVector<uint> >();
+ qDBusRegisterMetaType<QVector<qlonglong> >();
+ qDBusRegisterMetaType<QVector<qulonglong> >();
+ qDBusRegisterMetaType<QVector<double> >();
+ qDBusRegisterMetaType<QVector<QDBusObjectPath> >();
+ qDBusRegisterMetaType<QVector<QDBusSignature> >();
+ qDBusRegisterMetaType<QVector<QDBusUnixFileDescriptor> >();
#endif
initialized.store(true);
diff --git a/src/dbus/qdbuspendingcall.h b/src/dbus/qdbuspendingcall.h
index 1e4c6ebfd2..ec8ba6c541 100644
--- a/src/dbus/qdbuspendingcall.h
+++ b/src/dbus/qdbuspendingcall.h
@@ -100,7 +100,7 @@ class Q_DBUS_EXPORT QDBusPendingCallWatcher: public QObject, public QDBusPending
{
Q_OBJECT
public:
- explicit QDBusPendingCallWatcher(const QDBusPendingCall &call, QObject *parent = Q_NULLPTR);
+ explicit QDBusPendingCallWatcher(const QDBusPendingCall &call, QObject *parent = nullptr);
~QDBusPendingCallWatcher();
#ifdef Q_QDOC
@@ -110,7 +110,7 @@ public:
void waitForFinished(); // non-virtual override
Q_SIGNALS:
- void finished(QDBusPendingCallWatcher *self = Q_NULLPTR);
+ void finished(QDBusPendingCallWatcher *self = nullptr);
private:
Q_DECLARE_PRIVATE(QDBusPendingCallWatcher)
diff --git a/src/dbus/qdbusreply.h b/src/dbus/qdbusreply.h
index 227615024a..869687ac85 100644
--- a/src/dbus/qdbusreply.h
+++ b/src/dbus/qdbusreply.h
@@ -130,7 +130,7 @@ private:
template<> inline QDBusReply<QVariant>&
QDBusReply<QVariant>::operator=(const QDBusMessage &reply)
{
- void *null = Q_NULLPTR;
+ void *null = nullptr;
QVariant data(qMetaTypeId<QDBusVariant>(), null);
qDBusReplyFill(reply, m_error, data);
m_data = qvariant_cast<QDBusVariant>(data).variant();
diff --git a/src/dbus/qdbusserver.cpp b/src/dbus/qdbusserver.cpp
index ce55297abb..a2dfb86164 100644
--- a/src/dbus/qdbusserver.cpp
+++ b/src/dbus/qdbusserver.cpp
@@ -116,7 +116,7 @@ QDBusServer::~QDBusServer()
QDBusConnectionManager::instance()->removeConnection(name);
d->serverConnectionNames.clear();
}
- d->serverObject = Q_NULLPTR;
+ d->serverObject = nullptr;
d->ref.store(0);
d->deleteLater();
}
diff --git a/src/dbus/qdbusserver.h b/src/dbus/qdbusserver.h
index ac4dfcb67f..668b8705b1 100644
--- a/src/dbus/qdbusserver.h
+++ b/src/dbus/qdbusserver.h
@@ -57,8 +57,8 @@ class Q_DBUS_EXPORT QDBusServer: public QObject
{
Q_OBJECT
public:
- explicit QDBusServer(const QString &address, QObject *parent = Q_NULLPTR);
- explicit QDBusServer(QObject *parent = Q_NULLPTR);
+ explicit QDBusServer(const QString &address, QObject *parent = nullptr);
+ explicit QDBusServer(QObject *parent = nullptr);
virtual ~QDBusServer();
bool isConnected() const;
diff --git a/src/dbus/qdbusservicewatcher.h b/src/dbus/qdbusservicewatcher.h
index 77573beb5d..2c45c85cb9 100644
--- a/src/dbus/qdbusservicewatcher.h
+++ b/src/dbus/qdbusservicewatcher.h
@@ -64,9 +64,9 @@ public:
Q_DECLARE_FLAGS(WatchMode, WatchModeFlag)
Q_FLAG(WatchMode)
- explicit QDBusServiceWatcher(QObject *parent = Q_NULLPTR);
+ explicit QDBusServiceWatcher(QObject *parent = nullptr);
QDBusServiceWatcher(const QString &service, const QDBusConnection &connection,
- WatchMode watchMode = WatchForOwnerChange, QObject *parent = Q_NULLPTR);
+ WatchMode watchMode = WatchForOwnerChange, QObject *parent = nullptr);
~QDBusServiceWatcher();
QStringList watchedServices() const;
diff --git a/src/dbus/qdbusthreaddebug_p.h b/src/dbus/qdbusthreaddebug_p.h
index 96f389fa49..ad0984e26c 100644
--- a/src/dbus/qdbusthreaddebug_p.h
+++ b/src/dbus/qdbusthreaddebug_p.h
@@ -95,17 +95,6 @@ enum ThreadAction {
PendingCallBlockAction = 28,
SendMessageAction = 29,
HuntAndEmitAction = 30,
-
- AddTimeoutAction = 50,
- RealAddTimeoutAction = 51,
- RemoveTimeoutAction = 52,
- KillTimerAction = 58,
- TimerEventAction = 59,
- AddWatchAction = 60,
- RemoveWatchAction = 61,
- ToggleWatchAction = 62,
- SocketReadAction = 63,
- SocketWriteAction = 64
};
struct QDBusLockerBase
@@ -176,35 +165,6 @@ struct QDBusWriteLocker: QDBusLockerBase
}
};
-struct QDBusMutexLocker: QDBusLockerBase
-{
- QDBusConnectionPrivate *self;
- QMutex *mutex;
- ThreadAction action;
- inline QDBusMutexLocker(ThreadAction a, QDBusConnectionPrivate *s,
- QMutex *m)
- : self(s), mutex(m), action(a)
- {
- reportThreadAction(action, BeforeLock, self);
- mutex->lock();
- reportThreadAction(action, AfterLock, self);
- }
-
- inline ~QDBusMutexLocker()
- {
- reportThreadAction(action, BeforeUnlock, self);
- mutex->unlock();
- reportThreadAction(action, AfterUnlock, self);
- }
-};
-
-struct QDBusDispatchLocker: QDBusMutexLocker
-{
- inline QDBusDispatchLocker(ThreadAction a, QDBusConnectionPrivate *s)
- : QDBusMutexLocker(a, s, &s->dispatchLock)
- { }
-};
-
#if QDBUS_THREAD_DEBUG
# define SEM_ACQUIRE(action, sem) \
do { \
diff --git a/src/dbus/qdbusvirtualobject.h b/src/dbus/qdbusvirtualobject.h
index 1a96d900b4..b69e21b378 100644
--- a/src/dbus/qdbusvirtualobject.h
+++ b/src/dbus/qdbusvirtualobject.h
@@ -56,7 +56,7 @@ class Q_DBUS_EXPORT QDBusVirtualObject : public QObject
{
Q_OBJECT
public:
- explicit QDBusVirtualObject(QObject *parent = Q_NULLPTR);
+ explicit QDBusVirtualObject(QObject *parent = nullptr);
virtual ~QDBusVirtualObject();
virtual QString introspect(const QString &path) const = 0;
diff --git a/src/gui/accessible/qaccessible.cpp b/src/gui/accessible/qaccessible.cpp
index 2db4d46874..3004110e67 100644
--- a/src/gui/accessible/qaccessible.cpp
+++ b/src/gui/accessible/qaccessible.cpp
@@ -1761,7 +1761,6 @@ QAccessibleTextSelectionEvent::~QAccessibleTextSelectionEvent()
/*!
Returns the QAccessibleInterface associated with the event.
- The caller of this function takes ownership of the returned interface.
*/
QAccessibleInterface *QAccessibleEvent::accessibleInterface() const
{
diff --git a/src/gui/accessible/qaccessible.h b/src/gui/accessible/qaccessible.h
index 27756d764d..1309f17efd 100644
--- a/src/gui/accessible/qaccessible.h
+++ b/src/gui/accessible/qaccessible.h
@@ -511,7 +511,7 @@ public:
virtual void virtual_hook(int id, void *data);
virtual void *interface_cast(QAccessible::InterfaceType)
- { return Q_NULLPTR; }
+ { return nullptr; }
protected:
friend class QAccessibleCache;
@@ -682,7 +682,7 @@ public:
}
inline QAccessibleEvent(QAccessibleInterface *iface, QAccessible::Event typ)
- : m_type(typ), m_object(Q_NULLPTR)
+ : m_type(typ), m_object(nullptr)
{
Q_ASSERT(iface);
Q_ASSERT(m_type != QAccessible::ValueChanged);
diff --git a/src/gui/accessible/qaccessiblebridge.h b/src/gui/accessible/qaccessiblebridge.h
index 7429716e65..168889135b 100644
--- a/src/gui/accessible/qaccessiblebridge.h
+++ b/src/gui/accessible/qaccessiblebridge.h
@@ -66,7 +66,7 @@ class Q_GUI_EXPORT QAccessibleBridgePlugin : public QObject
{
Q_OBJECT
public:
- explicit QAccessibleBridgePlugin(QObject *parent = Q_NULLPTR);
+ explicit QAccessibleBridgePlugin(QObject *parent = nullptr);
~QAccessibleBridgePlugin();
virtual QAccessibleBridge *create(const QString &key) = 0;
diff --git a/src/gui/accessible/qaccessiblecache.cpp b/src/gui/accessible/qaccessiblecache.cpp
index 097634c0a3..f4242036ce 100644
--- a/src/gui/accessible/qaccessiblecache.cpp
+++ b/src/gui/accessible/qaccessiblecache.cpp
@@ -54,7 +54,7 @@ static QAccessibleCache *accessibleCache = nullptr;
static void cleanupAccessibleCache()
{
delete accessibleCache;
- accessibleCache = Q_NULLPTR;
+ accessibleCache = nullptr;
}
QAccessibleCache *QAccessibleCache::instance()
diff --git a/src/gui/accessible/qaccessibleobject.h b/src/gui/accessible/qaccessibleobject.h
index dd69dcb081..81479c32ab 100644
--- a/src/gui/accessible/qaccessibleobject.h
+++ b/src/gui/accessible/qaccessibleobject.h
@@ -56,13 +56,13 @@ class Q_GUI_EXPORT QAccessibleObject : public QAccessibleInterface
public:
explicit QAccessibleObject(QObject *object);
- bool isValid() const Q_DECL_OVERRIDE;
- QObject *object() const Q_DECL_OVERRIDE;
+ bool isValid() const override;
+ QObject *object() const override;
// properties
- QRect rect() const Q_DECL_OVERRIDE;
- void setText(QAccessible::Text t, const QString &text) Q_DECL_OVERRIDE;
- QAccessibleInterface *childAt(int x, int y) const Q_DECL_OVERRIDE;
+ QRect rect() const override;
+ void setText(QAccessible::Text t, const QString &text) override;
+ QAccessibleInterface *childAt(int x, int y) const override;
protected:
virtual ~QAccessibleObject();
@@ -77,20 +77,20 @@ class Q_GUI_EXPORT QAccessibleApplication : public QAccessibleObject
public:
QAccessibleApplication();
- QWindow *window() const Q_DECL_OVERRIDE;
+ QWindow *window() const override;
// relations
- int childCount() const Q_DECL_OVERRIDE;
- int indexOfChild(const QAccessibleInterface*) const Q_DECL_OVERRIDE;
- QAccessibleInterface *focusChild() const Q_DECL_OVERRIDE;
+ int childCount() const override;
+ int indexOfChild(const QAccessibleInterface*) const override;
+ QAccessibleInterface *focusChild() const override;
// navigation
- QAccessibleInterface *parent() const Q_DECL_OVERRIDE;
- QAccessibleInterface *child(int index) const Q_DECL_OVERRIDE;
+ QAccessibleInterface *parent() const override;
+ QAccessibleInterface *child(int index) const override;
// properties and state
- QString text(QAccessible::Text t) const Q_DECL_OVERRIDE;
- QAccessible::Role role() const Q_DECL_OVERRIDE;
- QAccessible::State state() const Q_DECL_OVERRIDE;
+ QString text(QAccessible::Text t) const override;
+ QAccessible::Role role() const override;
+ QAccessible::State state() const override;
};
#endif // QT_NO_ACCESSIBILITY
diff --git a/src/gui/accessible/qaccessibleplugin.h b/src/gui/accessible/qaccessibleplugin.h
index 09d4c542d3..68e6a839d8 100644
--- a/src/gui/accessible/qaccessibleplugin.h
+++ b/src/gui/accessible/qaccessibleplugin.h
@@ -60,7 +60,7 @@ class Q_GUI_EXPORT QAccessiblePlugin : public QObject
{
Q_OBJECT
public:
- explicit QAccessiblePlugin(QObject *parent = Q_NULLPTR);
+ explicit QAccessiblePlugin(QObject *parent = nullptr);
~QAccessiblePlugin();
virtual QAccessibleInterface *create(const QString &key, QObject *object) = 0;
diff --git a/src/gui/image/qbitmap.h b/src/gui/image/qbitmap.h
index def59b3f89..6a8c8b3457 100644
--- a/src/gui/image/qbitmap.h
+++ b/src/gui/image/qbitmap.h
@@ -55,7 +55,7 @@ public:
QBitmap(const QPixmap &);
QBitmap(int w, int h);
explicit QBitmap(const QSize &);
- explicit QBitmap(const QString &fileName, const char *format = Q_NULLPTR);
+ explicit QBitmap(const QString &fileName, const char *format = nullptr);
// ### Qt 6: don't inherit QPixmap
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QBitmap(const QBitmap &other) : QPixmap(other) {}
diff --git a/src/gui/image/qicon.h b/src/gui/image/qicon.h
index 40d3e92af9..4832455c9f 100644
--- a/src/gui/image/qicon.h
+++ b/src/gui/image/qicon.h
@@ -63,7 +63,7 @@ public:
#ifdef Q_COMPILER_RVALUE_REFS
QIcon(QIcon &&other) Q_DECL_NOEXCEPT
: d(other.d)
- { other.d = Q_NULLPTR; }
+ { other.d = nullptr; }
#endif
explicit QIcon(const QString &fileName); // file or resource name
explicit QIcon(QIconEngine *engine);
@@ -147,7 +147,7 @@ Q_GUI_EXPORT QDebug operator<<(QDebug dbg, const QIcon &);
#endif
Q_GUI_EXPORT QString qt_findAtNxFile(const QString &baseFileName, qreal targetDevicePixelRatio,
- qreal *sourceDevicePixelRatio = Q_NULLPTR);
+ qreal *sourceDevicePixelRatio = nullptr);
QT_END_NAMESPACE
diff --git a/src/gui/image/qicon_p.h b/src/gui/image/qicon_p.h
index aa358e88af..e384ff9e49 100644
--- a/src/gui/image/qicon_p.h
+++ b/src/gui/image/qicon_p.h
@@ -112,18 +112,18 @@ public:
QPixmapIconEngine();
QPixmapIconEngine(const QPixmapIconEngine &);
~QPixmapIconEngine();
- void paint(QPainter *painter, const QRect &rect, QIcon::Mode mode, QIcon::State state) Q_DECL_OVERRIDE;
- QPixmap pixmap(const QSize &size, QIcon::Mode mode, QIcon::State state) Q_DECL_OVERRIDE;
+ void paint(QPainter *painter, const QRect &rect, QIcon::Mode mode, QIcon::State state) override;
+ QPixmap pixmap(const QSize &size, QIcon::Mode mode, QIcon::State state) override;
QPixmapIconEngineEntry *bestMatch(const QSize &size, QIcon::Mode mode, QIcon::State state, bool sizeOnly);
- QSize actualSize(const QSize &size, QIcon::Mode mode, QIcon::State state) Q_DECL_OVERRIDE;
- void addPixmap(const QPixmap &pixmap, QIcon::Mode mode, QIcon::State state) Q_DECL_OVERRIDE;
- void addFile(const QString &fileName, const QSize &size, QIcon::Mode mode, QIcon::State state) Q_DECL_OVERRIDE;
-
- QString key() const Q_DECL_OVERRIDE;
- QIconEngine *clone() const Q_DECL_OVERRIDE;
- bool read(QDataStream &in) Q_DECL_OVERRIDE;
- bool write(QDataStream &out) const Q_DECL_OVERRIDE;
- void virtual_hook(int id, void *data) Q_DECL_OVERRIDE;
+ QSize actualSize(const QSize &size, QIcon::Mode mode, QIcon::State state) override;
+ void addPixmap(const QPixmap &pixmap, QIcon::Mode mode, QIcon::State state) override;
+ void addFile(const QString &fileName, const QSize &size, QIcon::Mode mode, QIcon::State state) override;
+
+ QString key() const override;
+ QIconEngine *clone() const override;
+ bool read(QDataStream &in) override;
+ bool write(QDataStream &out) const override;
+ void virtual_hook(int id, void *data) override;
private:
QPixmapIconEngineEntry *tryMatch(const QSize &size, QIcon::Mode mode, QIcon::State state);
diff --git a/src/gui/image/qiconengineplugin.h b/src/gui/image/qiconengineplugin.h
index 7a01d3731c..f2a1c0107a 100644
--- a/src/gui/image/qiconengineplugin.h
+++ b/src/gui/image/qiconengineplugin.h
@@ -55,7 +55,7 @@ class Q_GUI_EXPORT QIconEnginePlugin : public QObject
{
Q_OBJECT
public:
- QIconEnginePlugin(QObject *parent = Q_NULLPTR);
+ QIconEnginePlugin(QObject *parent = nullptr);
~QIconEnginePlugin();
virtual QIconEngine *create(const QString &filename = QString()) = 0;
diff --git a/src/gui/image/qiconloader_p.h b/src/gui/image/qiconloader_p.h
index 9398bca585..0007437ee9 100644
--- a/src/gui/image/qiconloader_p.h
+++ b/src/gui/image/qiconloader_p.h
@@ -101,13 +101,13 @@ public:
struct ScalableEntry : public QIconLoaderEngineEntry
{
- QPixmap pixmap(const QSize &size, QIcon::Mode mode, QIcon::State state) Q_DECL_OVERRIDE;
+ QPixmap pixmap(const QSize &size, QIcon::Mode mode, QIcon::State state) override;
QIcon svgIcon;
};
struct PixmapEntry : public QIconLoaderEngineEntry
{
- QPixmap pixmap(const QSize &size, QIcon::Mode mode, QIcon::State state) Q_DECL_OVERRIDE;
+ QPixmap pixmap(const QSize &size, QIcon::Mode mode, QIcon::State state) override;
QPixmap basePixmap;
};
@@ -125,20 +125,20 @@ public:
QIconLoaderEngine(const QString& iconName = QString());
~QIconLoaderEngine();
- void paint(QPainter *painter, const QRect &rect, QIcon::Mode mode, QIcon::State state) Q_DECL_OVERRIDE;
- QPixmap pixmap(const QSize &size, QIcon::Mode mode, QIcon::State state) Q_DECL_OVERRIDE;
- QSize actualSize(const QSize &size, QIcon::Mode mode, QIcon::State state) Q_DECL_OVERRIDE;
- QIconEngine *clone() const Q_DECL_OVERRIDE;
- bool read(QDataStream &in) Q_DECL_OVERRIDE;
- bool write(QDataStream &out) const Q_DECL_OVERRIDE;
+ void paint(QPainter *painter, const QRect &rect, QIcon::Mode mode, QIcon::State state) override;
+ QPixmap pixmap(const QSize &size, QIcon::Mode mode, QIcon::State state) override;
+ QSize actualSize(const QSize &size, QIcon::Mode mode, QIcon::State state) override;
+ QIconEngine *clone() const override;
+ bool read(QDataStream &in) override;
+ bool write(QDataStream &out) const override;
Q_GUI_EXPORT static QIconLoaderEngineEntry *entryForSize(const QThemeIconInfo &info, const QSize &size, int scale = 1);
private:
- QString key() const Q_DECL_OVERRIDE;
+ QString key() const override;
bool hasIcon() const;
void ensureLoaded();
- void virtual_hook(int id, void *data) Q_DECL_OVERRIDE;
+ void virtual_hook(int id, void *data) override;
QIconLoaderEngine(const QIconLoaderEngine &other);
QThemeIconInfo m_info;
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp
index 097033280a..96a1b38d48 100644
--- a/src/gui/image/qimage.cpp
+++ b/src/gui/image/qimage.cpp
@@ -3261,14 +3261,31 @@ QImage QImage::rgbSwapped_helper() const
res.d->colortable[i] = QRgb(((c << 16) & 0xff0000) | ((c >> 16) & 0xff) | (c & 0xff00ff00));
}
break;
- case Format_RGB32:
- case Format_ARGB32:
- case Format_ARGB32_Premultiplied:
-#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN
case Format_RGBX8888:
case Format_RGBA8888:
case Format_RGBA8888_Premultiplied:
+#if Q_BYTE_ORDER == Q_BIG_ENDIAN
+ res = QImage(d->width, d->height, d->format);
+ QIMAGE_SANITYCHECK_MEMORY(res);
+ for (int i = 0; i < d->height; i++) {
+ uint *q = (uint*)res.scanLine(i);
+ const uint *p = (const uint*)constScanLine(i);
+ const uint *end = p + d->width;
+ while (p < end) {
+ uint c = *p;
+ *q = ((c << 16) & 0xff000000) | ((c >> 16) & 0xff00) | (c & 0x00ff00ff);
+ p++;
+ q++;
+ }
+ }
+ break;
+#else
+ // On little-endian rgba8888 is abgr32 and can use same rgb-swap as argb32
+ Q_FALLTHROUGH();
#endif
+ case Format_RGB32:
+ case Format_ARGB32:
+ case Format_ARGB32_Premultiplied:
res = QImage(d->width, d->height, d->format);
QIMAGE_SANITYCHECK_MEMORY(res);
for (int i = 0; i < d->height; i++) {
@@ -3352,14 +3369,27 @@ void QImage::rgbSwapped_inplace()
d->colortable[i] = QRgb(((c << 16) & 0xff0000) | ((c >> 16) & 0xff) | (c & 0xff00ff00));
}
break;
- case Format_RGB32:
- case Format_ARGB32:
- case Format_ARGB32_Premultiplied:
-#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN
case Format_RGBX8888:
case Format_RGBA8888:
case Format_RGBA8888_Premultiplied:
+#if Q_BYTE_ORDER == Q_BIG_ENDIAN
+ for (int i = 0; i < d->height; i++) {
+ uint *p = (uint*)scanLine(i);
+ uint *end = p + d->width;
+ while (p < end) {
+ uint c = *p;
+ *p = ((c << 16) & 0xff000000) | ((c >> 16) & 0xff00) | (c & 0x00ff00ff);
+ p++;
+ }
+ }
+ break;
+#else
+ // On little-endian rgba8888 is abgr32 and can use same rgb-swap as argb32
+ Q_FALLTHROUGH();
#endif
+ case Format_RGB32:
+ case Format_ARGB32:
+ case Format_ARGB32_Premultiplied:
for (int i = 0; i < d->height; i++) {
uint *p = (uint*)scanLine(i);
uint *end = p + d->width;
diff --git a/src/gui/image/qimage.h b/src/gui/image/qimage.h
index 398424f75f..5f2965042f 100644
--- a/src/gui/image/qimage.h
+++ b/src/gui/image/qimage.h
@@ -136,20 +136,20 @@ public:
QImage() Q_DECL_NOEXCEPT;
QImage(const QSize &size, Format format);
QImage(int width, int height, Format format);
- QImage(uchar *data, int width, int height, Format format, QImageCleanupFunction cleanupFunction = Q_NULLPTR, void *cleanupInfo = Q_NULLPTR);
- QImage(const uchar *data, int width, int height, Format format, QImageCleanupFunction cleanupFunction = Q_NULLPTR, void *cleanupInfo = Q_NULLPTR);
- QImage(uchar *data, int width, int height, int bytesPerLine, Format format, QImageCleanupFunction cleanupFunction = Q_NULLPTR, void *cleanupInfo = Q_NULLPTR);
- QImage(const uchar *data, int width, int height, int bytesPerLine, Format format, QImageCleanupFunction cleanupFunction = Q_NULLPTR, void *cleanupInfo = Q_NULLPTR);
+ QImage(uchar *data, int width, int height, Format format, QImageCleanupFunction cleanupFunction = nullptr, void *cleanupInfo = nullptr);
+ QImage(const uchar *data, int width, int height, Format format, QImageCleanupFunction cleanupFunction = nullptr, void *cleanupInfo = nullptr);
+ QImage(uchar *data, int width, int height, int bytesPerLine, Format format, QImageCleanupFunction cleanupFunction = nullptr, void *cleanupInfo = nullptr);
+ QImage(const uchar *data, int width, int height, int bytesPerLine, Format format, QImageCleanupFunction cleanupFunction = nullptr, void *cleanupInfo = nullptr);
#ifndef QT_NO_IMAGEFORMAT_XPM
explicit QImage(const char * const xpm[]);
#endif
- explicit QImage(const QString &fileName, const char *format = Q_NULLPTR);
+ explicit QImage(const QString &fileName, const char *format = nullptr);
QImage(const QImage &);
#ifdef Q_COMPILER_RVALUE_REFS
inline QImage(QImage &&other) Q_DECL_NOEXCEPT
- : QPaintDevice(), d(Q_NULLPTR)
+ : QPaintDevice(), d(nullptr)
{ qSwap(d, other.d); }
#endif
~QImage();
@@ -164,7 +164,7 @@ public:
bool isNull() const;
- int devType() const Q_DECL_OVERRIDE;
+ int devType() const override;
bool operator==(const QImage &) const;
bool operator!=(const QImage &) const;
@@ -294,16 +294,16 @@ public:
bool load(QIODevice *device, const char* format);
- bool load(const QString &fileName, const char *format = Q_NULLPTR);
- bool loadFromData(const uchar *buf, int len, const char *format = Q_NULLPTR);
- inline bool loadFromData(const QByteArray &data, const char *aformat = Q_NULLPTR)
+ bool load(const QString &fileName, const char *format = nullptr);
+ bool loadFromData(const uchar *buf, int len, const char *format = nullptr);
+ inline bool loadFromData(const QByteArray &data, const char *aformat = nullptr)
{ return loadFromData(reinterpret_cast<const uchar *>(data.constData()), data.size(), aformat); }
- bool save(const QString &fileName, const char *format = Q_NULLPTR, int quality = -1) const;
- bool save(QIODevice *device, const char *format = Q_NULLPTR, int quality = -1) const;
+ bool save(const QString &fileName, const char *format = nullptr, int quality = -1) const;
+ bool save(QIODevice *device, const char *format = nullptr, int quality = -1) const;
- static QImage fromData(const uchar *data, int size, const char *format = Q_NULLPTR);
- inline static QImage fromData(const QByteArray &data, const char *format = Q_NULLPTR)
+ static QImage fromData(const uchar *data, int size, const char *format = nullptr);
+ inline static QImage fromData(const QByteArray &data, const char *format = nullptr)
{ return fromData(reinterpret_cast<const uchar *>(data.constData()), data.size(), format); }
#if QT_DEPRECATED_SINCE(5, 0)
@@ -311,7 +311,7 @@ public:
#endif
qint64 cacheKey() const;
- QPaintEngine *paintEngine() const Q_DECL_OVERRIDE;
+ QPaintEngine *paintEngine() const override;
// Auxiliary data
int dotsPerMeterX() const;
@@ -335,7 +335,7 @@ public:
#endif
#if QT_DEPRECATED_SINCE(5, 0)
- QT_DEPRECATED inline QString text(const char *key, const char *lang = Q_NULLPTR) const;
+ QT_DEPRECATED inline QString text(const char *key, const char *lang = nullptr) const;
QT_DEPRECATED inline QList<QImageTextKeyLang> textList() const;
QT_DEPRECATED inline QStringList textLanguages() const;
QT_DEPRECATED inline QString text(const QImageTextKeyLang&) const;
@@ -349,7 +349,7 @@ public:
#endif
protected:
- virtual int metric(PaintDeviceMetric metric) const Q_DECL_OVERRIDE;
+ virtual int metric(PaintDeviceMetric metric) const override;
QImage mirrored_helper(bool horizontal, bool vertical) const;
QImage rgbSwapped_helper() const;
void mirrored_inplace(bool horizontal, bool vertical);
diff --git a/src/gui/image/qimageiohandler.h b/src/gui/image/qimageiohandler.h
index baf9853259..35984dd6a5 100644
--- a/src/gui/image/qimageiohandler.h
+++ b/src/gui/image/qimageiohandler.h
@@ -140,7 +140,7 @@ class Q_GUI_EXPORT QImageIOPlugin : public QObject
{
Q_OBJECT
public:
- explicit QImageIOPlugin(QObject *parent = Q_NULLPTR);
+ explicit QImageIOPlugin(QObject *parent = nullptr);
virtual ~QImageIOPlugin();
enum Capability {
diff --git a/src/gui/image/qmovie.h b/src/gui/image/qmovie.h
index ca559d491b..e13c528894 100644
--- a/src/gui/image/qmovie.h
+++ b/src/gui/image/qmovie.h
@@ -79,9 +79,9 @@ public:
};
Q_ENUM(CacheMode)
- explicit QMovie(QObject *parent = Q_NULLPTR);
- explicit QMovie(QIODevice *device, const QByteArray &format = QByteArray(), QObject *parent = Q_NULLPTR);
- explicit QMovie(const QString &fileName, const QByteArray &format = QByteArray(), QObject *parent = Q_NULLPTR);
+ explicit QMovie(QObject *parent = nullptr);
+ explicit QMovie(QIODevice *device, const QByteArray &format = QByteArray(), QObject *parent = nullptr);
+ explicit QMovie(const QString &fileName, const QByteArray &format = QByteArray(), QObject *parent = nullptr);
~QMovie();
static QList<QByteArray> supportedFormats();
diff --git a/src/gui/image/qpaintengine_pic_p.h b/src/gui/image/qpaintengine_pic_p.h
index 7c690c1498..c3044796ad 100644
--- a/src/gui/image/qpaintengine_pic_p.h
+++ b/src/gui/image/qpaintengine_pic_p.h
@@ -68,10 +68,10 @@ public:
QPicturePaintEngine();
~QPicturePaintEngine();
- bool begin(QPaintDevice *pdev) Q_DECL_OVERRIDE;
- bool end() Q_DECL_OVERRIDE;
+ bool begin(QPaintDevice *pdev) override;
+ bool end() override;
- void updateState(const QPaintEngineState &state) Q_DECL_OVERRIDE;
+ void updateState(const QPaintEngineState &state) override;
void updatePen(const QPen &pen);
void updateBrush(const QBrush &brush);
@@ -86,18 +86,18 @@ public:
void updateClipEnabled(bool enabled);
void updateOpacity(qreal opacity);
- void drawEllipse(const QRectF &rect) Q_DECL_OVERRIDE;
- void drawPath(const QPainterPath &path) Q_DECL_OVERRIDE;
- void drawPolygon(const QPointF *points, int numPoints, PolygonDrawMode mode) Q_DECL_OVERRIDE;
+ void drawEllipse(const QRectF &rect) override;
+ void drawPath(const QPainterPath &path) override;
+ void drawPolygon(const QPointF *points, int numPoints, PolygonDrawMode mode) override;
using QPaintEngine::drawPolygon;
- void drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr) Q_DECL_OVERRIDE;
- void drawTiledPixmap(const QRectF &r, const QPixmap &pixmap, const QPointF &s) Q_DECL_OVERRIDE;
+ void drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr) override;
+ void drawTiledPixmap(const QRectF &r, const QPixmap &pixmap, const QPointF &s) override;
void drawImage(const QRectF &r, const QImage &image, const QRectF &sr,
- Qt::ImageConversionFlags flags = Qt::AutoColor) Q_DECL_OVERRIDE;
- void drawTextItem(const QPointF &p, const QTextItem &ti) Q_DECL_OVERRIDE;
+ Qt::ImageConversionFlags flags = Qt::AutoColor) override;
+ void drawTextItem(const QPointF &p, const QTextItem &ti) override;
- Type type() const Q_DECL_OVERRIDE { return Picture; }
+ Type type() const override { return Picture; }
protected:
QPicturePaintEngine(QPaintEnginePrivate &dptr);
diff --git a/src/gui/image/qpicture.cpp b/src/gui/image/qpicture.cpp
index bf628e7571..7aa221948e 100644
--- a/src/gui/image/qpicture.cpp
+++ b/src/gui/image/qpicture.cpp
@@ -456,8 +456,8 @@ public:
QFakeDevice() { dpi_x = qt_defaultDpiX(); dpi_y = qt_defaultDpiY(); }
void setDpiX(int dpi) { dpi_x = dpi; }
void setDpiY(int dpi) { dpi_y = dpi; }
- QPaintEngine *paintEngine() const Q_DECL_OVERRIDE { return 0; }
- int metric(PaintDeviceMetric m) const Q_DECL_OVERRIDE
+ QPaintEngine *paintEngine() const override { return 0; }
+ int metric(PaintDeviceMetric m) const override
{
switch(m) {
case PdmPhysicalDpiX:
diff --git a/src/gui/image/qpicture.h b/src/gui/image/qpicture.h
index db2b767efe..ec7b4bd7e3 100644
--- a/src/gui/image/qpicture.h
+++ b/src/gui/image/qpicture.h
@@ -62,17 +62,17 @@ public:
bool isNull() const;
- int devType() const Q_DECL_OVERRIDE;
+ int devType() const override;
uint size() const;
const char* data() const;
virtual void setData(const char* data, uint size);
bool play(QPainter *p);
- bool load(QIODevice *dev, const char *format = Q_NULLPTR);
- bool load(const QString &fileName, const char *format = Q_NULLPTR);
- bool save(QIODevice *dev, const char *format = Q_NULLPTR);
- bool save(const QString &fileName, const char *format = Q_NULLPTR);
+ bool load(QIODevice *dev, const char *format = nullptr);
+ bool load(const QString &fileName, const char *format = nullptr);
+ bool save(QIODevice *dev, const char *format = nullptr);
+ bool save(const QString &fileName, const char *format = nullptr);
QRect boundingRect() const;
void setBoundingRect(const QRect &r);
@@ -98,12 +98,12 @@ public:
static QT_DEPRECATED QStringList outputFormatList();
#endif // QT_DEPRECATED_SINCE(5, 10)
- QPaintEngine *paintEngine() const Q_DECL_OVERRIDE;
+ QPaintEngine *paintEngine() const override;
protected:
QPicture(QPicturePrivate &data);
- int metric(PaintDeviceMetric m) const Q_DECL_OVERRIDE;
+ int metric(PaintDeviceMetric m) const override;
private:
bool exec(QPainter *p, QDataStream &ds, int i);
diff --git a/src/gui/image/qpictureformatplugin.h b/src/gui/image/qpictureformatplugin.h
index 32195687c7..3f59c04d79 100644
--- a/src/gui/image/qpictureformatplugin.h
+++ b/src/gui/image/qpictureformatplugin.h
@@ -60,7 +60,7 @@ class Q_GUI_EXPORT QPictureFormatPlugin : public QObject
{
Q_OBJECT
public:
- explicit QPictureFormatPlugin(QObject *parent = Q_NULLPTR);
+ explicit QPictureFormatPlugin(QObject *parent = nullptr);
~QPictureFormatPlugin();
virtual bool loadPicture(const QString &format, const QString &filename, QPicture *pic);
diff --git a/src/gui/image/qpixmap.h b/src/gui/image/qpixmap.h
index d651b57fd5..55cca7a766 100644
--- a/src/gui/image/qpixmap.h
+++ b/src/gui/image/qpixmap.h
@@ -65,7 +65,7 @@ public:
explicit QPixmap(QPlatformPixmap *data);
QPixmap(int w, int h);
explicit QPixmap(const QSize &);
- QPixmap(const QString& fileName, const char *format = Q_NULLPTR, Qt::ImageConversionFlags flags = Qt::AutoColor);
+ QPixmap(const QString& fileName, const char *format = nullptr, Qt::ImageConversionFlags flags = Qt::AutoColor);
#ifndef QT_NO_IMAGEFORMAT_XPM
explicit QPixmap(const char * const xpm[]);
#endif
@@ -83,7 +83,7 @@ public:
operator QVariant() const;
bool isNull() const;
- int devType() const Q_DECL_OVERRIDE;
+ int devType() const override;
int width() const;
int height() const;
@@ -138,19 +138,19 @@ public:
}
#endif
- bool load(const QString& fileName, const char *format = Q_NULLPTR, Qt::ImageConversionFlags flags = Qt::AutoColor);
- bool loadFromData(const uchar *buf, uint len, const char* format = Q_NULLPTR, Qt::ImageConversionFlags flags = Qt::AutoColor);
- inline bool loadFromData(const QByteArray &data, const char* format = Q_NULLPTR, Qt::ImageConversionFlags flags = Qt::AutoColor);
- bool save(const QString& fileName, const char* format = Q_NULLPTR, int quality = -1) const;
- bool save(QIODevice* device, const char* format = Q_NULLPTR, int quality = -1) const;
+ bool load(const QString& fileName, const char *format = nullptr, Qt::ImageConversionFlags flags = Qt::AutoColor);
+ bool loadFromData(const uchar *buf, uint len, const char* format = nullptr, Qt::ImageConversionFlags flags = Qt::AutoColor);
+ inline bool loadFromData(const QByteArray &data, const char* format = nullptr, Qt::ImageConversionFlags flags = Qt::AutoColor);
+ bool save(const QString& fileName, const char* format = nullptr, int quality = -1) const;
+ bool save(QIODevice* device, const char* format = nullptr, int quality = -1) const;
bool convertFromImage(const QImage &img, Qt::ImageConversionFlags flags = Qt::AutoColor);
inline QPixmap copy(int x, int y, int width, int height) const;
QPixmap copy(const QRect &rect = QRect()) const;
- inline void scroll(int dx, int dy, int x, int y, int width, int height, QRegion *exposed = Q_NULLPTR);
- void scroll(int dx, int dy, const QRect &rect, QRegion *exposed = Q_NULLPTR);
+ inline void scroll(int dx, int dy, int x, int y, int width, int height, QRegion *exposed = nullptr);
+ void scroll(int dx, int dy, const QRect &rect, QRegion *exposed = nullptr);
#if QT_DEPRECATED_SINCE(5, 0)
QT_DEPRECATED inline int serialNumber() const { return cacheKey() >> 32; }
@@ -162,7 +162,7 @@ public:
bool isQBitmap() const;
- QPaintEngine *paintEngine() const Q_DECL_OVERRIDE;
+ QPaintEngine *paintEngine() const override;
inline bool operator!() const { return isNull(); }
@@ -172,7 +172,7 @@ public:
#endif
protected:
- int metric(PaintDeviceMetric) const Q_DECL_OVERRIDE;
+ int metric(PaintDeviceMetric) const override;
static QPixmap fromImageInPlace(QImage &image, Qt::ImageConversionFlags flags = Qt::AutoColor);
private:
diff --git a/src/gui/image/qpixmap_blitter_p.h b/src/gui/image/qpixmap_blitter_p.h
index 9889cfb8ec..d70cbcdcc3 100644
--- a/src/gui/image/qpixmap_blitter_p.h
+++ b/src/gui/image/qpixmap_blitter_p.h
@@ -69,17 +69,17 @@ public:
QBlittable *blittable() const;
void setBlittable(QBlittable *blittable);
- void resize(int width, int height) Q_DECL_OVERRIDE;
- int metric(QPaintDevice::PaintDeviceMetric metric) const Q_DECL_OVERRIDE;
- void fill(const QColor &color) Q_DECL_OVERRIDE;
- QImage *buffer() Q_DECL_OVERRIDE;
- QImage toImage() const Q_DECL_OVERRIDE;
- bool hasAlphaChannel() const Q_DECL_OVERRIDE;
- void fromImage(const QImage &image, Qt::ImageConversionFlags flags) Q_DECL_OVERRIDE;
- qreal devicePixelRatio() const Q_DECL_OVERRIDE;
- void setDevicePixelRatio(qreal scaleFactor) Q_DECL_OVERRIDE;
-
- QPaintEngine *paintEngine() const Q_DECL_OVERRIDE;
+ void resize(int width, int height) override;
+ int metric(QPaintDevice::PaintDeviceMetric metric) const override;
+ void fill(const QColor &color) override;
+ QImage *buffer() override;
+ QImage toImage() const override;
+ bool hasAlphaChannel() const override;
+ void fromImage(const QImage &image, Qt::ImageConversionFlags flags) override;
+ qreal devicePixelRatio() const override;
+ void setDevicePixelRatio(qreal scaleFactor) override;
+
+ QPaintEngine *paintEngine() const override;
void markRasterOverlay(const QRectF &);
void markRasterOverlay(const QPointF &, const QTextItem &);
diff --git a/src/gui/image/qpixmap_raster_p.h b/src/gui/image/qpixmap_raster_p.h
index 6ea965a324..cff962181a 100644
--- a/src/gui/image/qpixmap_raster_p.h
+++ b/src/gui/image/qpixmap_raster_p.h
@@ -63,28 +63,28 @@ public:
QRasterPlatformPixmap(PixelType type);
~QRasterPlatformPixmap();
- QPlatformPixmap *createCompatiblePlatformPixmap() const Q_DECL_OVERRIDE;
-
- void resize(int width, int height) Q_DECL_OVERRIDE;
- bool fromData(const uchar *buffer, uint len, const char *format, Qt::ImageConversionFlags flags) Q_DECL_OVERRIDE;
- void fromImage(const QImage &image, Qt::ImageConversionFlags flags) Q_DECL_OVERRIDE;
- void fromImageInPlace(QImage &image, Qt::ImageConversionFlags flags) Q_DECL_OVERRIDE;
- void fromImageReader(QImageReader *imageReader, Qt::ImageConversionFlags flags) Q_DECL_OVERRIDE;
-
- void copy(const QPlatformPixmap *data, const QRect &rect) Q_DECL_OVERRIDE;
- bool scroll(int dx, int dy, const QRect &rect) Q_DECL_OVERRIDE;
- void fill(const QColor &color) Q_DECL_OVERRIDE;
- bool hasAlphaChannel() const Q_DECL_OVERRIDE;
- QImage toImage() const Q_DECL_OVERRIDE;
- QImage toImage(const QRect &rect) const Q_DECL_OVERRIDE;
- QPaintEngine* paintEngine() const Q_DECL_OVERRIDE;
- QImage* buffer() Q_DECL_OVERRIDE;
- qreal devicePixelRatio() const Q_DECL_OVERRIDE;
- void setDevicePixelRatio(qreal scaleFactor) Q_DECL_OVERRIDE;
+ QPlatformPixmap *createCompatiblePlatformPixmap() const override;
+
+ void resize(int width, int height) override;
+ bool fromData(const uchar *buffer, uint len, const char *format, Qt::ImageConversionFlags flags) override;
+ void fromImage(const QImage &image, Qt::ImageConversionFlags flags) override;
+ void fromImageInPlace(QImage &image, Qt::ImageConversionFlags flags) override;
+ void fromImageReader(QImageReader *imageReader, Qt::ImageConversionFlags flags) override;
+
+ void copy(const QPlatformPixmap *data, const QRect &rect) override;
+ bool scroll(int dx, int dy, const QRect &rect) override;
+ void fill(const QColor &color) override;
+ bool hasAlphaChannel() const override;
+ QImage toImage() const override;
+ QImage toImage(const QRect &rect) const override;
+ QPaintEngine* paintEngine() const override;
+ QImage* buffer() override;
+ qreal devicePixelRatio() const override;
+ void setDevicePixelRatio(qreal scaleFactor) override;
protected:
- int metric(QPaintDevice::PaintDeviceMetric metric) const Q_DECL_OVERRIDE;
+ int metric(QPaintDevice::PaintDeviceMetric metric) const override;
void createPixmapForImage(QImage sourceImage, Qt::ImageConversionFlags flags);
void setImage(const QImage &image);
QImage image;
diff --git a/src/gui/image/qpixmapcache.cpp b/src/gui/image/qpixmapcache.cpp
index 742aa31ba9..4b8b1203d6 100644
--- a/src/gui/image/qpixmapcache.cpp
+++ b/src/gui/image/qpixmapcache.cpp
@@ -193,7 +193,7 @@ public:
QPMCache();
~QPMCache();
- void timerEvent(QTimerEvent *) Q_DECL_OVERRIDE;
+ void timerEvent(QTimerEvent *) override;
bool insert(const QString& key, const QPixmap &pixmap, int cost);
QPixmapCache::Key insert(const QPixmap &pixmap, int cost);
bool replace(const QPixmapCache::Key &key, const QPixmap &pixmap, int cost);
diff --git a/src/gui/image/qpixmapcache.h b/src/gui/image/qpixmapcache.h
index 856b82f559..ea10ab1b76 100644
--- a/src/gui/image/qpixmapcache.h
+++ b/src/gui/image/qpixmapcache.h
@@ -56,7 +56,7 @@ public:
Key();
Key(const Key &other);
#ifdef Q_COMPILER_RVALUE_REFS
- Key(Key &&other) Q_DECL_NOTHROW : d(other.d) { other.d = Q_NULLPTR; }
+ Key(Key &&other) Q_DECL_NOTHROW : d(other.d) { other.d = nullptr; }
Key &operator =(Key &&other) Q_DECL_NOTHROW { swap(other); return *this; }
#endif
~Key();
diff --git a/src/gui/itemmodels/qstandarditemmodel.cpp b/src/gui/itemmodels/qstandarditemmodel.cpp
index 07e372b1ae..519995e82a 100644
--- a/src/gui/itemmodels/qstandarditemmodel.cpp
+++ b/src/gui/itemmodels/qstandarditemmodel.cpp
@@ -185,6 +185,72 @@ void QStandardItemPrivate::childDeleted(QStandardItem *child)
emit model->dataChanged(modelIndex, modelIndex);
}
+namespace {
+
+ struct ByNormalizedRole
+ {
+ static int normalizedRole(int role)
+ {
+ return role == Qt::EditRole ? Qt::DisplayRole : role;
+ }
+
+ bool operator()(const QStandardItemData& standardItemData, const std::pair<const int &, const QVariant&>& roleMapIt) const
+ {
+ return standardItemData.role < normalizedRole(roleMapIt.first);
+ }
+ bool operator()(const std::pair<const int&, const QVariant &>& roleMapIt, const QStandardItemData& standardItemData) const
+ {
+ return normalizedRole(roleMapIt.first) < standardItemData.role;
+ }
+
+ };
+
+ /*
+ Based on std::transform with a twist. The inputs are iterators of <int, QVariant> pair.
+ The variant is checked for validity and if not valid, that element is not taken into account
+ which means that the resulting output might be shorter than the input.
+ */
+ template<class Input, class OutputIt>
+ OutputIt roleMapStandardItemDataTransform(Input first1, Input last1, OutputIt d_first)
+ {
+ while (first1 != last1) {
+ if ((*first1).second.isValid())
+ *d_first++ = QStandardItemData(*first1);
+ ++first1;
+ }
+ return d_first;
+ }
+
+
+ /*
+ Based on std::set_union with a twist. The idea is to create a union of both inputs
+ with an additional constraint: if an input contains an invalid variant, it means
+ that this one should not be taken into account for generating the output.
+ */
+ template<class Input1, class Input2,
+ class OutputIt, class Compare>
+ OutputIt roleMapStandardItemDataUnion(Input1 first1, Input1 last1,
+ Input2 first2, Input2 last2,
+ OutputIt d_first, Compare comp)
+ {
+ for (; first1 != last1; ++d_first) {
+ if (first2 == last2) {
+ return roleMapStandardItemDataTransform(first1, last1, d_first);
+ }
+ if (comp(*first2, *first1)) {
+ *d_first = *first2++;
+ } else {
+ if ((*first1).second.isValid())
+ *d_first = QStandardItemData(*first1);
+ if (!comp(*first1, *first2))
+ ++first2;
+ ++first1;
+ }
+ }
+ return std::copy(first2, last2, d_first);
+ }
+}
+
/*!
\internal
*/
@@ -192,18 +258,25 @@ void QStandardItemPrivate::setItemData(const QMap<int, QVariant> &roles)
{
Q_Q(QStandardItem);
- //let's build the vector of new values
+ auto byRole = [](const QStandardItemData& item1, const QStandardItemData& item2) {
+ return item1.role < item2.role;
+ };
+
+ std::sort(values.begin(), values.end(), byRole);
+
+ /*
+ Create a vector of QStandardItemData that will contain the original values
+ if the matching role is not contained in roles, the new value if it is and
+ if the new value is an invalid QVariant, it will be removed.
+ */
QVector<QStandardItemData> newValues;
- for (auto it = roles.begin(), end = roles.end(); it != end; ++it) {
- const QVariant &value = it.value();
- if (value.isValid()) {
- int role = it.key();
- role = (role == Qt::EditRole) ? Qt::DisplayRole : role;
- newValues.append(QStandardItemData(role, value));
- }
- }
+ newValues.reserve(values.size());
+ roleMapStandardItemDataUnion(roles.keyValueBegin(),
+ roles.keyValueEnd(),
+ values.cbegin(), values.cend(),
+ std::back_inserter(newValues), ByNormalizedRole());
- if (values!=newValues) {
+ if (newValues != values) {
values.swap(newValues);
if (model)
model->d_func()->itemChanged(q);
diff --git a/src/gui/itemmodels/qstandarditemmodel.h b/src/gui/itemmodels/qstandarditemmodel.h
index 73107b827c..c54e7b27d9 100644
--- a/src/gui/itemmodels/qstandarditemmodel.h
+++ b/src/gui/itemmodels/qstandarditemmodel.h
@@ -327,45 +327,45 @@ class Q_GUI_EXPORT QStandardItemModel : public QAbstractItemModel
Q_PROPERTY(int sortRole READ sortRole WRITE setSortRole)
public:
- explicit QStandardItemModel(QObject *parent = Q_NULLPTR);
- QStandardItemModel(int rows, int columns, QObject *parent = Q_NULLPTR);
+ explicit QStandardItemModel(QObject *parent = nullptr);
+ QStandardItemModel(int rows, int columns, QObject *parent = nullptr);
~QStandardItemModel();
void setItemRoleNames(const QHash<int,QByteArray> &roleNames);
- QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
- QModelIndex parent(const QModelIndex &child) const Q_DECL_OVERRIDE;
+ QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override;
+ QModelIndex parent(const QModelIndex &child) const override;
- int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
- int columnCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
- bool hasChildren(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
+ int rowCount(const QModelIndex &parent = QModelIndex()) const override;
+ int columnCount(const QModelIndex &parent = QModelIndex()) const override;
+ bool hasChildren(const QModelIndex &parent = QModelIndex()) const override;
// Qt 6: Remove
- QModelIndex sibling(int row, int column, const QModelIndex &idx) const Q_DECL_OVERRIDE;
+ QModelIndex sibling(int row, int column, const QModelIndex &idx) const override;
- QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
- bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) Q_DECL_OVERRIDE;
+ QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
+ bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;
QVariant headerData(int section, Qt::Orientation orientation,
- int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
+ int role = Qt::DisplayRole) const override;
bool setHeaderData(int section, Qt::Orientation orientation, const QVariant &value,
- int role = Qt::EditRole) Q_DECL_OVERRIDE;
+ int role = Qt::EditRole) override;
- bool insertRows(int row, int count, const QModelIndex &parent = QModelIndex()) Q_DECL_OVERRIDE;
- bool insertColumns(int column, int count, const QModelIndex &parent = QModelIndex()) Q_DECL_OVERRIDE;
- bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()) Q_DECL_OVERRIDE;
- bool removeColumns(int column, int count, const QModelIndex &parent = QModelIndex()) Q_DECL_OVERRIDE;
+ bool insertRows(int row, int count, const QModelIndex &parent = QModelIndex()) override;
+ bool insertColumns(int column, int count, const QModelIndex &parent = QModelIndex()) override;
+ bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()) override;
+ bool removeColumns(int column, int count, const QModelIndex &parent = QModelIndex()) override;
- Qt::ItemFlags flags(const QModelIndex &index) const Q_DECL_OVERRIDE;
- Qt::DropActions supportedDropActions() const Q_DECL_OVERRIDE;
+ Qt::ItemFlags flags(const QModelIndex &index) const override;
+ Qt::DropActions supportedDropActions() const override;
- QMap<int, QVariant> itemData(const QModelIndex &index) const Q_DECL_OVERRIDE;
- bool setItemData(const QModelIndex &index, const QMap<int, QVariant> &roles) Q_DECL_OVERRIDE;
+ QMap<int, QVariant> itemData(const QModelIndex &index) const override;
+ bool setItemData(const QModelIndex &index, const QMap<int, QVariant> &roles) override;
void clear();
using QObject::parent;
- void sort(int column, Qt::SortOrder order = Qt::AscendingOrder) Q_DECL_OVERRIDE;
+ void sort(int column, Qt::SortOrder order = Qt::AscendingOrder) override;
QStandardItem *itemFromIndex(const QModelIndex &index) const;
QModelIndex indexFromItem(const QStandardItem *item) const;
@@ -414,15 +414,15 @@ public:
int sortRole() const;
void setSortRole(int role);
- QStringList mimeTypes() const Q_DECL_OVERRIDE;
- QMimeData *mimeData(const QModelIndexList &indexes) const Q_DECL_OVERRIDE;
- bool dropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) Q_DECL_OVERRIDE;
+ QStringList mimeTypes() const override;
+ QMimeData *mimeData(const QModelIndexList &indexes) const override;
+ bool dropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override;
Q_SIGNALS:
void itemChanged(QStandardItem *item);
protected:
- QStandardItemModel(QStandardItemModelPrivate &dd, QObject *parent = Q_NULLPTR);
+ QStandardItemModel(QStandardItemModelPrivate &dd, QObject *parent = nullptr);
private:
friend class QStandardItemPrivate;
diff --git a/src/gui/itemmodels/qstandarditemmodel_p.h b/src/gui/itemmodels/qstandarditemmodel_p.h
index 516cce8613..caee3ea34c 100644
--- a/src/gui/itemmodels/qstandarditemmodel_p.h
+++ b/src/gui/itemmodels/qstandarditemmodel_p.h
@@ -61,6 +61,7 @@
#include <QtCore/qstack.h>
#include <QtCore/qvariant.h>
#include <QtCore/qvector.h>
+#include <QtCore/qdebug.h>
QT_BEGIN_NAMESPACE
@@ -69,6 +70,7 @@ class QStandardItemData
public:
inline QStandardItemData() : role(-1) {}
inline QStandardItemData(int r, const QVariant &v) : role(r), value(v) {}
+ inline QStandardItemData(const std::pair<const int&, const QVariant&> &p) : role(p.first), value(p.second) {}
int role;
QVariant value;
inline bool operator==(const QStandardItemData &other) const { return role == other.role && value == other.value; }
@@ -91,6 +93,15 @@ inline QDataStream &operator<<(QDataStream &out, const QStandardItemData &data)
return out;
}
+inline QDebug &operator<<(QDebug &debug, const QStandardItemData &data)
+{
+ QDebugStateSaver saver(debug);
+ debug.nospace() << data.role
+ << " "
+ << data.value;
+ return debug.space();
+}
+
#endif // QT_NO_DATASTREAM
class QStandardItemPrivate
diff --git a/src/gui/kernel/qcursor.h b/src/gui/kernel/qcursor.h
index ccce3d84ef..d62ee7a053 100644
--- a/src/gui/kernel/qcursor.h
+++ b/src/gui/kernel/qcursor.h
@@ -87,7 +87,7 @@ public:
~QCursor();
QCursor &operator=(const QCursor &cursor);
#ifdef Q_COMPILER_RVALUE_REFS
- QCursor(QCursor &&other) Q_DECL_NOTHROW : d(other.d) { other.d = Q_NULLPTR; }
+ QCursor(QCursor &&other) Q_DECL_NOTHROW : d(other.d) { other.d = nullptr; }
inline QCursor &operator=(QCursor &&other) Q_DECL_NOTHROW
{ swap(other); return *this; }
#endif
diff --git a/src/gui/kernel/qdnd_p.h b/src/gui/kernel/qdnd_p.h
index eaf6c74fd4..e7d83cbbaf 100644
--- a/src/gui/kernel/qdnd_p.h
+++ b/src/gui/kernel/qdnd_p.h
@@ -77,8 +77,8 @@ public:
QInternalMimeData();
~QInternalMimeData();
- bool hasFormat(const QString &mimeType) const Q_DECL_OVERRIDE;
- QStringList formats() const Q_DECL_OVERRIDE;
+ bool hasFormat(const QString &mimeType) const override;
+ QStringList formats() const override;
static bool canReadData(const QString &mimeType);
@@ -87,7 +87,7 @@ public:
static QByteArray renderDataHelper(const QString &mimeType, const QMimeData *data);
protected:
- QVariant retrieveData(const QString &mimeType, QVariant::Type type) const Q_DECL_OVERRIDE;
+ QVariant retrieveData(const QString &mimeType, QVariant::Type type) const override;
virtual bool hasFormat_sys(const QString &mimeType) const = 0;
virtual QStringList formats_sys() const = 0;
diff --git a/src/gui/kernel/qevent.h b/src/gui/kernel/qevent.h
index 372b5f0896..d95da40368 100644
--- a/src/gui/kernel/qevent.h
+++ b/src/gui/kernel/qevent.h
@@ -724,7 +724,7 @@ class Q_GUI_EXPORT QActionEvent : public QEvent
{
QAction *act, *bef;
public:
- QActionEvent(int type, QAction *action, QAction *before = Q_NULLPTR);
+ QActionEvent(int type, QAction *action, QAction *before = nullptr);
~QActionEvent();
inline QAction *action() const { return act; }
@@ -852,7 +852,7 @@ public:
TouchPoint(const TouchPoint &other);
#ifdef Q_COMPILER_RVALUE_REFS
TouchPoint(TouchPoint &&other) Q_DECL_NOEXCEPT
- : d(Q_NULLPTR)
+ : d(nullptr)
{ qSwap(d, other.d); }
TouchPoint &operator=(TouchPoint &&other) Q_DECL_NOEXCEPT
{ qSwap(d, other.d); return *this; }
@@ -940,7 +940,7 @@ public:
#endif
explicit QTouchEvent(QEvent::Type eventType,
- QTouchDevice *device = Q_NULLPTR,
+ QTouchDevice *device = nullptr,
Qt::KeyboardModifiers modifiers = Qt::NoModifier,
Qt::TouchPointStates touchPointStates = Qt::TouchPointStates(),
const QList<QTouchEvent::TouchPoint> &touchPoints = QList<QTouchEvent::TouchPoint>());
diff --git a/src/gui/kernel/qgenericplugin.h b/src/gui/kernel/qgenericplugin.h
index e8aa2e6f32..69b4f29854 100644
--- a/src/gui/kernel/qgenericplugin.h
+++ b/src/gui/kernel/qgenericplugin.h
@@ -52,7 +52,7 @@ class Q_GUI_EXPORT QGenericPlugin : public QObject
{
Q_OBJECT
public:
- explicit QGenericPlugin(QObject *parent = Q_NULLPTR);
+ explicit QGenericPlugin(QObject *parent = nullptr);
~QGenericPlugin();
virtual QObject* create(const QString& name, const QString &spec) = 0;
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index b26567ad0c..f566677ff4 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -190,7 +190,7 @@ QWindow *QGuiApplicationPrivate::focus_window = 0;
static QBasicMutex applicationFontMutex;
QFont *QGuiApplicationPrivate::app_font = 0;
-QStyleHints *QGuiApplicationPrivate::styleHints = Q_NULLPTR;
+QStyleHints *QGuiApplicationPrivate::styleHints = nullptr;
bool QGuiApplicationPrivate::obey_desktop_settings = true;
QInputDeviceManager *QGuiApplicationPrivate::m_inputDeviceManager = 0;
@@ -748,7 +748,7 @@ QString QGuiApplication::desktopFileName()
*/
QWindow *QGuiApplication::modalWindow()
{
- CHECK_QAPP_INSTANCE(Q_NULLPTR)
+ CHECK_QAPP_INSTANCE(nullptr)
if (QGuiApplicationPrivate::self->modalWindowList.isEmpty())
return 0;
return QGuiApplicationPrivate::self->modalWindowList.first();
@@ -1527,7 +1527,7 @@ QGuiApplicationPrivate::~QGuiApplicationPrivate()
cleanupThreadData();
delete QGuiApplicationPrivate::styleHints;
- QGuiApplicationPrivate::styleHints = Q_NULLPTR;
+ QGuiApplicationPrivate::styleHints = nullptr;
delete inputMethod;
qt_cleanupFontDatabase();
@@ -1650,10 +1650,10 @@ QFunctionPointer QGuiApplication::platformFunction(const QByteArray &function)
QPlatformIntegration *pi = QGuiApplicationPrivate::platformIntegration();
if (!pi) {
qWarning("QGuiApplication::platformFunction(): Must construct a QGuiApplication before accessing a platform function");
- return Q_NULLPTR;
+ return nullptr;
}
- return pi->nativeInterface() ? pi->nativeInterface()->platformFunction(function) : Q_NULLPTR;
+ return pi->nativeInterface() ? pi->nativeInterface()->platformFunction(function) : nullptr;
}
/*!
@@ -1736,7 +1736,6 @@ bool QGuiApplicationPrivate::processNativeEvent(QWindow *window, const QByteArra
void QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent *e)
{
switch(e->type) {
- case QWindowSystemInterfacePrivate::FrameStrutMouse:
case QWindowSystemInterfacePrivate::Mouse:
QGuiApplicationPrivate::processMouseEvent(static_cast<QWindowSystemInterfacePrivate::MouseEvent *>(e));
break;
@@ -1843,29 +1842,111 @@ void QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePriv
}
}
+/*! \internal
+
+ History is silent on why Qt splits mouse events that change position and
+ button state at the same time. We believe that this was done to emulate mouse
+ behavior on touch screens. If mouse tracking is enabled, we will get move
+ events before the button is pressed. A touch panel does not generally give
+ move events when not pressed, so without event splitting code path we would
+ only see a press in a new location without any intervening moves. This could
+ confuse code that is written for a real mouse. The same is true for mouse
+ release events that change position, see tst_QWidget::touchEventSynthesizedMouseEvent()
+ and tst_QWindow::generatedMouseMove() auto tests.
+*/
void QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent *e)
{
- QEvent::Type type;
- Qt::MouseButtons stateChange = e->buttons ^ mouse_buttons;
- if (e->globalPos != QGuiApplicationPrivate::lastCursorPosition && (stateChange != Qt::NoButton)) {
- // A mouse event should not change both position and buttons at the same time. Instead we
- // should first send a move event followed by a button changed event. Since this is not the case
- // with the current event, we split it in two.
- QWindowSystemInterfacePrivate::MouseEvent mouseButtonEvent(
- e->window.data(), e->timestamp, e->type, e->localPos, e->globalPos, e->buttons, e->modifiers, e->source);
- if (e->flags & QWindowSystemInterfacePrivate::WindowSystemEvent::Synthetic)
- mouseButtonEvent.flags |= QWindowSystemInterfacePrivate::WindowSystemEvent::Synthetic;
- e->buttons = mouse_buttons;
- processMouseEvent(e);
- processMouseEvent(&mouseButtonEvent);
- return;
+ QEvent::Type type = QEvent::None;
+ Qt::MouseButton button = Qt::NoButton;
+ QWindow *window = e->window.data();
+ bool positionChanged = QGuiApplicationPrivate::lastCursorPosition != e->globalPos;
+ bool mouseMove = false;
+ bool mousePress = false;
+
+ if (e->enhancedMouseEvent()) {
+ type = e->buttonType;
+ button = e->button;
+
+ if (type == QEvent::NonClientAreaMouseMove || type == QEvent::MouseMove)
+ mouseMove = true;
+ else if (type == QEvent::NonClientAreaMouseButtonPress || type == QEvent::MouseButtonPress)
+ mousePress = true;
+
+ if (!mouseMove && positionChanged) {
+ QWindowSystemInterfacePrivate::MouseEvent moveEvent(window, e->timestamp,
+ e->localPos, e->globalPos, e->buttons ^ button, e->modifiers, Qt::NoButton,
+ e->nonClientArea ? QEvent::NonClientAreaMouseMove : QEvent::MouseMove,
+ e->source, e->nonClientArea);
+ if (e->synthetic())
+ moveEvent.flags |= QWindowSystemInterfacePrivate::WindowSystemEvent::Synthetic;
+ processMouseEvent(&moveEvent); // mouse move excluding state change
+ processMouseEvent(e); // the original mouse event
+ return;
+ }
+ } else {
+ Qt::MouseButtons stateChange = e->buttons ^ mouse_buttons;
+ if (positionChanged && (stateChange != Qt::NoButton)) {
+ QWindowSystemInterfacePrivate::MouseEvent moveEvent(window, e->timestamp, e->localPos,
+ e->globalPos, mouse_buttons, e->modifiers, Qt::NoButton, QEvent::None, e->source,
+ e->nonClientArea);
+ if (e->synthetic())
+ moveEvent.flags |= QWindowSystemInterfacePrivate::WindowSystemEvent::Synthetic;
+ processMouseEvent(&moveEvent); // mouse move excluding state change
+ processMouseEvent(e); // the original mouse event
+ return;
+ }
+
+ // In the compatibility path we deduce event type and button that caused the event
+ if (positionChanged) {
+ mouseMove = true;
+ type = e->nonClientArea ? QEvent::NonClientAreaMouseMove : QEvent::MouseMove;
+ } else {
+ // Check to see if a new button has been pressed/released.
+ for (uint mask = Qt::LeftButton; mask <= Qt::MaxMouseButton; mask <<= 1) {
+ if (stateChange & mask) {
+ button = Qt::MouseButton(mask);
+ break;
+ }
+ }
+ if (button == Qt::NoButton) {
+ // Ignore mouse events that don't change the current state. This shouldn't
+ // really happen, getting here can only mean that the stored button state
+ // is out of sync with the actual physical button state.
+ return;
+ }
+ if (button & e->buttons) {
+ mousePress = true;
+ type = e->nonClientArea ? QEvent::NonClientAreaMouseButtonPress
+ : QEvent::MouseButtonPress;
+ } else {
+ type = e->nonClientArea ? QEvent::NonClientAreaMouseButtonRelease
+ : QEvent::MouseButtonRelease;
+ }
+ }
}
- QWindow *window = e->window.data();
modifier_buttons = e->modifiers;
-
QPointF localPoint = e->localPos;
QPointF globalPoint = e->globalPos;
+ bool doubleClick = false;
+
+ if (mouseMove) {
+ QGuiApplicationPrivate::lastCursorPosition = globalPoint;
+ if (qAbs(globalPoint.x() - mousePressX) > mouse_double_click_distance||
+ qAbs(globalPoint.y() - mousePressY) > mouse_double_click_distance)
+ mousePressButton = Qt::NoButton;
+ } else {
+ mouse_buttons = e->buttons;
+ if (mousePress) {
+ ulong doubleClickInterval = static_cast<ulong>(QGuiApplication::styleHints()->mouseDoubleClickInterval());
+ doubleClick = e->timestamp - mousePressTime < doubleClickInterval && button == mousePressButton;
+ mousePressTime = e->timestamp;
+ mousePressButton = button;
+ const QPoint point = QGuiApplicationPrivate::lastCursorPosition.toPoint();
+ mousePressX = point.x();
+ mousePressY = point.y();
+ }
+ }
if (e->nullWindow()) {
window = QGuiApplication::topLevelAt(globalPoint.toPoint());
@@ -1886,44 +1967,6 @@ void QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::Mo
}
}
- Qt::MouseButton button = Qt::NoButton;
- bool doubleClick = false;
- const bool frameStrut = e->type == QWindowSystemInterfacePrivate::FrameStrutMouse;
-
- if (QGuiApplicationPrivate::lastCursorPosition != globalPoint) {
- type = frameStrut ? QEvent::NonClientAreaMouseMove : QEvent::MouseMove;
- QGuiApplicationPrivate::lastCursorPosition = globalPoint;
- if (qAbs(globalPoint.x() - mousePressX) > mouse_double_click_distance||
- qAbs(globalPoint.y() - mousePressY) > mouse_double_click_distance)
- mousePressButton = Qt::NoButton;
- } else { // Check to see if a new button has been pressed/released.
- for (int check = Qt::LeftButton;
- check <= int(Qt::MaxMouseButton);
- check = check << 1) {
- if (check & stateChange) {
- button = Qt::MouseButton(check);
- break;
- }
- }
- if (button == Qt::NoButton) {
- // Ignore mouse events that don't change the current state.
- return;
- }
- mouse_buttons = e->buttons;
- if (button & e->buttons) {
- ulong doubleClickInterval = static_cast<ulong>(QGuiApplication::styleHints()->mouseDoubleClickInterval());
- doubleClick = e->timestamp - mousePressTime < doubleClickInterval && button == mousePressButton;
- type = frameStrut ? QEvent::NonClientAreaMouseButtonPress : QEvent::MouseButtonPress;
- mousePressTime = e->timestamp;
- mousePressButton = button;
- const QPoint point = QGuiApplicationPrivate::lastCursorPosition.toPoint();
- mousePressX = point.x();
- mousePressY = point.y();
- } else {
- type = frameStrut ? QEvent::NonClientAreaMouseButtonRelease : QEvent::MouseButtonRelease;
- }
- }
-
if (!window)
return;
@@ -1934,14 +1977,14 @@ void QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::Mo
const QPointF nativeLocalPoint = QHighDpi::toNativePixels(localPoint, screen);
const QPointF nativeGlobalPoint = QHighDpi::toNativePixels(globalPoint, screen);
QMouseEvent ev(type, nativeLocalPoint, nativeLocalPoint, nativeGlobalPoint,
- button, mouse_buttons, e->modifiers, e->source);
+ button, e->buttons, e->modifiers, e->source);
ev.setTimestamp(e->timestamp);
cursor->pointerEvent(ev);
}
}
#endif
- QMouseEvent ev(type, localPoint, localPoint, globalPoint, button, mouse_buttons, e->modifiers, e->source);
+ QMouseEvent ev(type, localPoint, localPoint, globalPoint, button, e->buttons, e->modifiers, e->source);
ev.setTimestamp(e->timestamp);
if (window->d_func()->blockedByModalWindow && !qApp->d_func()->popupActive()) {
@@ -1957,7 +2000,7 @@ void QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::Mo
QGuiApplication::sendSpontaneousEvent(window, &ev);
e->eventAccepted = ev.isAccepted();
if (!e->synthetic() && !ev.isAccepted()
- && !frameStrut
+ && !e->nonClientArea
&& qApp->testAttribute(Qt::AA_SynthesizeTouchForUnhandledMouseEvents)) {
if (!m_fakeTouchDevice) {
m_fakeTouchDevice = new QTouchDevice;
@@ -1975,7 +2018,7 @@ void QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::Mo
point.state = Qt::TouchPointPressed;
} else if (type == QEvent::MouseButtonRelease && button == Qt::LeftButton) {
point.state = Qt::TouchPointReleased;
- } else if (type == QEvent::MouseMove && (mouse_buttons & Qt::LeftButton)) {
+ } else if (type == QEvent::MouseMove && (e->buttons & Qt::LeftButton)) {
point.state = Qt::TouchPointMoved;
} else {
return;
@@ -1994,9 +2037,9 @@ void QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::Mo
if (doubleClick) {
mousePressButton = Qt::NoButton;
if (!e->window.isNull() || e->nullWindow()) { // QTBUG-36364, check if window closed in response to press
- const QEvent::Type doubleClickType = frameStrut ? QEvent::NonClientAreaMouseButtonDblClick : QEvent::MouseButtonDblClick;
+ const QEvent::Type doubleClickType = e->nonClientArea ? QEvent::NonClientAreaMouseButtonDblClick : QEvent::MouseButtonDblClick;
QMouseEvent dblClickEvent(doubleClickType, localPoint, localPoint, globalPoint,
- button, mouse_buttons, e->modifiers, e->source);
+ button, e->buttons, e->modifiers, e->source);
dblClickEvent.setTimestamp(e->timestamp);
QGuiApplication::sendSpontaneousEvent(window, &dblClickEvent);
}
@@ -2349,7 +2392,7 @@ void QGuiApplicationPrivate::processTabletEvent(QWindowSystemInterfacePrivate::T
localValid = false;
}
if (type == QEvent::TabletRelease)
- pointData.target = Q_NULLPTR;
+ pointData.target = nullptr;
if (!window)
return;
}
@@ -2366,20 +2409,30 @@ void QGuiApplicationPrivate::processTabletEvent(QWindowSystemInterfacePrivate::T
break;
}
}
- QTabletEvent ev(type, local, e->global,
- e->device, e->pointerType, e->pressure, e->xTilt, e->yTilt,
- e->tangentialPressure, e->rotation, e->z,
- e->modifiers, e->uid, button, e->buttons);
- ev.setAccepted(false);
- ev.setTimestamp(e->timestamp);
- QGuiApplication::sendSpontaneousEvent(window, &ev);
+ QTabletEvent tabletEvent(type, local, e->global,
+ e->device, e->pointerType, e->pressure, e->xTilt, e->yTilt,
+ e->tangentialPressure, e->rotation, e->z,
+ e->modifiers, e->uid, button, e->buttons);
+ tabletEvent.setAccepted(false);
+ tabletEvent.setTimestamp(e->timestamp);
+ QGuiApplication::sendSpontaneousEvent(window, &tabletEvent);
pointData.state = e->buttons;
- if (!ev.isAccepted() && !QWindowSystemInterfacePrivate::TabletEvent::platformSynthesizesMouse
- && qApp->testAttribute(Qt::AA_SynthesizeMouseForUnhandledTabletEvents)) {
- QWindowSystemInterfacePrivate::MouseEvent fake(window, e->timestamp, e->local, e->global,
- e->buttons, e->modifiers, Qt::MouseEventSynthesizedByQt);
- fake.flags |= QWindowSystemInterfacePrivate::WindowSystemEvent::Synthetic;
- processMouseEvent(&fake);
+ if (!tabletEvent.isAccepted()
+ && !QWindowSystemInterfacePrivate::TabletEvent::platformSynthesizesMouse
+ && qApp->testAttribute(Qt::AA_SynthesizeMouseForUnhandledTabletEvents)) {
+
+ const QEvent::Type mouseType = [&]() {
+ switch (type) {
+ case QEvent::TabletPress: return QEvent::MouseButtonPress;
+ case QEvent::TabletMove: return QEvent::MouseMove;
+ case QEvent::TabletRelease: return QEvent::MouseButtonRelease;
+ default: Q_UNREACHABLE();
+ }
+ }();
+ QWindowSystemInterfacePrivate::MouseEvent mouseEvent(window, e->timestamp, e->local,
+ e->global, e->buttons, e->modifiers, button, mouseType, Qt::MouseEventSynthesizedByQt);
+ mouseEvent.flags |= QWindowSystemInterfacePrivate::WindowSystemEvent::Synthetic;
+ processMouseEvent(&mouseEvent);
}
#else
Q_UNUSED(e)
@@ -2485,7 +2538,7 @@ void QGuiApplicationPrivate::processTouchEvent(QWindowSystemInterfacePrivate::To
++it;
}
for (QSet<QWindow *>::const_iterator winIt = windowsNeedingCancel.constBegin(),
- winItEnd = windowsNeedingCancel.constEnd(); winIt != winItEnd; ++winIt) {
+ winItEnd = windowsNeedingCancel.constEnd(); winIt != winItEnd; ++winIt) {
touchEvent.setWindow(*winIt);
QGuiApplication::sendSpontaneousEvent(*winIt, &touchEvent);
}
@@ -2498,8 +2551,10 @@ void QGuiApplicationPrivate::processTouchEvent(QWindowSystemInterfacePrivate::To
e->timestamp,
synthIt->pos,
synthIt->screenPos,
- mouse_buttons & ~Qt::LeftButton,
+ Qt::NoButton,
e->modifiers,
+ Qt::LeftButton,
+ QEvent::MouseButtonRelease,
Qt::MouseEventSynthesizedByQt);
fake.flags |= QWindowSystemInterfacePrivate::WindowSystemEvent::Synthetic;
processMouseEvent(&fake);
@@ -2696,25 +2751,41 @@ void QGuiApplicationPrivate::processTouchEvent(QWindowSystemInterfacePrivate::To
if (!e->synthetic() && !touchEvent.isAccepted() && qApp->testAttribute(Qt::AA_SynthesizeMouseForUnhandledTouchEvents)) {
// exclude devices which generate their own mouse events
if (!(touchEvent.device()->capabilities() & QTouchDevice::MouseEmulation)) {
- Qt::MouseButtons b = eventType == QEvent::TouchEnd ? Qt::NoButton : Qt::LeftButton;
- if (b == Qt::NoButton)
+
+ if (eventType == QEvent::TouchEnd)
self->synthesizedMousePoints.clear();
const QList<QTouchEvent::TouchPoint> &touchPoints = touchEvent.touchPoints();
if (eventType == QEvent::TouchBegin)
m_fakeMouseSourcePointId = touchPoints.first().id();
+ const QEvent::Type mouseType = [&]() {
+ switch (eventType) {
+ case QEvent::TouchBegin: return QEvent::MouseButtonPress;
+ case QEvent::TouchUpdate: return QEvent::MouseMove;
+ case QEvent::TouchEnd: return QEvent::MouseButtonRelease;
+ default: Q_UNREACHABLE();
+ }
+ }();
+
+ Qt::MouseButton button = mouseType == QEvent::MouseMove ? Qt::NoButton : Qt::LeftButton;
+ Qt::MouseButtons buttons = mouseType == QEvent::MouseButtonRelease ? Qt::NoButton : Qt::LeftButton;
+
for (int i = 0; i < touchPoints.count(); ++i) {
const QTouchEvent::TouchPoint &touchPoint = touchPoints.at(i);
if (touchPoint.id() == m_fakeMouseSourcePointId) {
- if (b != Qt::NoButton)
+ if (eventType != QEvent::TouchEnd)
self->synthesizedMousePoints.insert(w, SynthesizedMouseData(
touchPoint.pos(), touchPoint.screenPos(), w));
+ // All touch events that are not accepted by the application will be translated to
+ // left mouse button events instead (see AA_SynthesizeMouseForUnhandledTouchEvents docs).
QWindowSystemInterfacePrivate::MouseEvent fake(w, e->timestamp,
touchPoint.pos(),
touchPoint.screenPos(),
- b | (mouse_buttons & ~Qt::LeftButton),
+ buttons,
e->modifiers,
+ button,
+ mouseType,
Qt::MouseEventSynthesizedByQt);
fake.flags |= QWindowSystemInterfacePrivate::WindowSystemEvent::Synthetic;
processMouseEvent(&fake);
@@ -3506,7 +3577,7 @@ Qt::LayoutDirection QGuiApplication::layoutDirection()
#ifndef QT_NO_CURSOR
QCursor *QGuiApplication::overrideCursor()
{
- CHECK_QAPP_INSTANCE(Q_NULLPTR)
+ CHECK_QAPP_INSTANCE(nullptr)
return qGuiApp->d_func()->cursor_list.isEmpty() ? 0 : &qGuiApp->d_func()->cursor_list.first();
}
@@ -3706,7 +3777,7 @@ bool QGuiApplication::desktopSettingsAware()
*/
QInputMethod *QGuiApplication::inputMethod()
{
- CHECK_QAPP_INSTANCE(Q_NULLPTR)
+ CHECK_QAPP_INSTANCE(nullptr)
if (!qGuiApp->d_func()->inputMethod)
qGuiApp->d_func()->inputMethod = new QInputMethod();
return qGuiApp->d_func()->inputMethod;
diff --git a/src/gui/kernel/qguiapplication.h b/src/gui/kernel/qguiapplication.h
index e130553b9d..8560fcf18a 100644
--- a/src/gui/kernel/qguiapplication.h
+++ b/src/gui/kernel/qguiapplication.h
@@ -157,7 +157,7 @@ public:
static Qt::ApplicationState applicationState();
static int exec();
- bool notify(QObject *, QEvent *) Q_DECL_OVERRIDE;
+ bool notify(QObject *, QEvent *) override;
#ifndef QT_NO_SESSIONMANAGER
// session management
@@ -189,8 +189,8 @@ Q_SIGNALS:
void applicationDisplayNameChanged();
protected:
- bool event(QEvent *) Q_DECL_OVERRIDE;
- bool compressEvent(QEvent *, QObject *receiver, QPostEventList *) Q_DECL_OVERRIDE;
+ bool event(QEvent *) override;
+ bool compressEvent(QEvent *, QObject *receiver, QPostEventList *) override;
QGuiApplication(QGuiApplicationPrivate &p);
diff --git a/src/gui/kernel/qguiapplication_p.h b/src/gui/kernel/qguiapplication_p.h
index 014ed861df..b7b847785c 100644
--- a/src/gui/kernel/qguiapplication_p.h
+++ b/src/gui/kernel/qguiapplication_p.h
@@ -85,13 +85,13 @@ public:
void init();
void createPlatformIntegration();
- void createEventDispatcher() Q_DECL_OVERRIDE;
- void eventDispatcherReady() Q_DECL_OVERRIDE;
+ void createEventDispatcher() override;
+ void eventDispatcherReady() override;
virtual void notifyLayoutDirectionChange();
virtual void notifyActiveWindowChange(QWindow *previous);
- virtual bool shouldQuit() Q_DECL_OVERRIDE;
+ virtual bool shouldQuit() override;
bool shouldQuitInternal(const QWindowList &processedWindows);
virtual bool tryCloseAllWindows();
@@ -213,7 +213,7 @@ public:
static bool highDpiScalingUpdated;
struct TabletPointData {
- TabletPointData(qint64 devId = 0) : deviceId(devId), state(Qt::NoButton), target(Q_NULLPTR) {}
+ TabletPointData(qint64 devId = 0) : deviceId(devId), state(Qt::NoButton), target(nullptr) {}
qint64 deviceId;
Qt::MouseButtons state;
QWindow *target;
diff --git a/src/gui/kernel/qhighdpiscaling.cpp b/src/gui/kernel/qhighdpiscaling.cpp
index 085652879c..caef942840 100644
--- a/src/gui/kernel/qhighdpiscaling.cpp
+++ b/src/gui/kernel/qhighdpiscaling.cpp
@@ -129,7 +129,7 @@ static inline qreal initialGlobalScaleFactor()
Note that the functions in this file do not work with the OS scale factor
directly and are limited to converting between device independent and native
- pixels. The OS scale factor is accunted for by QWindow::devicePixelRatio()
+ pixels. The OS scale factor is accounted for by QWindow::devicePixelRatio()
and similar functions.
Configuration Examples:
@@ -168,7 +168,7 @@ static inline qreal initialGlobalScaleFactor()
1) A global scale factor
The QT_SCALE_FACTOR environment variable can be used to set
- a global scale factor for all windows in the processs. This
+ a global scale factor for all windows in the process. This
is useful for testing and debugging (you can simulate any
devicePixelRatio without needing access to special hardware),
and perhaps also for targeting a specific application to
@@ -204,7 +204,7 @@ static inline qreal initialGlobalScaleFactor()
T fromNativePixels(T, QWindow*)
The following classes in QtGui use native pixels, for the convenience of the
- plataform plugins:
+ platform plugins:
QPlatformWindow
QPlatformScreen
QWindowSystemInterface (API only - Events are in device independent pixels)
diff --git a/src/gui/kernel/qoffscreensurface.h b/src/gui/kernel/qoffscreensurface.h
index 3295ae0d40..9d4839cb25 100644
--- a/src/gui/kernel/qoffscreensurface.h
+++ b/src/gui/kernel/qoffscreensurface.h
@@ -59,10 +59,10 @@ class Q_GUI_EXPORT QOffscreenSurface : public QObject, public QSurface
public:
// ### Qt 6: merge overloads
explicit QOffscreenSurface(QScreen *screen, QObject *parent);
- explicit QOffscreenSurface(QScreen *screen = Q_NULLPTR);
+ explicit QOffscreenSurface(QScreen *screen = nullptr);
virtual ~QOffscreenSurface();
- SurfaceType surfaceType() const Q_DECL_OVERRIDE;
+ SurfaceType surfaceType() const override;
void create();
void destroy();
@@ -70,10 +70,10 @@ public:
bool isValid() const;
void setFormat(const QSurfaceFormat &format);
- QSurfaceFormat format() const Q_DECL_OVERRIDE;
+ QSurfaceFormat format() const override;
QSurfaceFormat requestedFormat() const;
- QSize size() const Q_DECL_OVERRIDE;
+ QSize size() const override;
QScreen *screen() const;
void setScreen(QScreen *screen);
@@ -91,7 +91,7 @@ private Q_SLOTS:
private:
- QPlatformSurface *surfaceHandle() const Q_DECL_OVERRIDE;
+ QPlatformSurface *surfaceHandle() const override;
Q_DISABLE_COPY(QOffscreenSurface)
};
diff --git a/src/gui/kernel/qopenglcontext.h b/src/gui/kernel/qopenglcontext.h
index 07153db84e..9cfaa52f17 100644
--- a/src/gui/kernel/qopenglcontext.h
+++ b/src/gui/kernel/qopenglcontext.h
@@ -151,7 +151,7 @@ class Q_GUI_EXPORT QOpenGLContext : public QObject
Q_OBJECT
Q_DECLARE_PRIVATE(QOpenGLContext)
public:
- explicit QOpenGLContext(QObject *parent = Q_NULLPTR);
+ explicit QOpenGLContext(QObject *parent = nullptr);
~QOpenGLContext();
void setFormat(const QSurfaceFormat &format);
diff --git a/src/gui/kernel/qopenglcontext_p.h b/src/gui/kernel/qopenglcontext_p.h
index 9f9b4352fc..4f2f951d61 100644
--- a/src/gui/kernel/qopenglcontext_p.h
+++ b/src/gui/kernel/qopenglcontext_p.h
@@ -114,12 +114,12 @@ public:
GLuint id() const { return m_id; }
protected:
- void invalidateResource() Q_DECL_OVERRIDE
+ void invalidateResource() override
{
m_id = 0;
}
- void freeResource(QOpenGLContext *context) Q_DECL_OVERRIDE;
+ void freeResource(QOpenGLContext *context) override;
private:
GLuint m_id;
@@ -213,7 +213,7 @@ public:
, workaround_missingPrecisionQualifiers(false)
, active_engine(0)
, qgl_current_fbo_invalid(false)
- , qgl_current_fbo(Q_NULLPTR)
+ , qgl_current_fbo(nullptr)
, defaultFboRedirect(0)
{
requestedFormat = QSurfaceFormat::defaultFormat();
@@ -266,7 +266,7 @@ public:
static QOpenGLContextPrivate *get(QOpenGLContext *context)
{
- return context ? context->d_func() : Q_NULLPTR;
+ return context ? context->d_func() : nullptr;
}
#if !defined(QT_NO_DEBUG)
diff --git a/src/gui/kernel/qopenglwindow.cpp b/src/gui/kernel/qopenglwindow.cpp
index 5170c7ab63..cf3d712421 100644
--- a/src/gui/kernel/qopenglwindow.cpp
+++ b/src/gui/kernel/qopenglwindow.cpp
@@ -163,7 +163,7 @@ class QOpenGLWindowPaintDevice : public QOpenGLPaintDevice
{
public:
QOpenGLWindowPaintDevice(QOpenGLWindow *window) : m_window(window) { }
- void ensureActiveTarget() Q_DECL_OVERRIDE;
+ void ensureActiveTarget() override;
QOpenGLWindow *m_window;
};
@@ -188,9 +188,9 @@ public:
void bindFBO();
void initialize();
- void beginPaint(const QRegion &region) Q_DECL_OVERRIDE;
- void endPaint() Q_DECL_OVERRIDE;
- void flush(const QRegion &region) Q_DECL_OVERRIDE;
+ void beginPaint(const QRegion &region) override;
+ void endPaint() override;
+ void flush(const QRegion &region) override;
QOpenGLWindow::UpdateBehavior updateBehavior;
bool hasFboBlit;
@@ -344,7 +344,7 @@ void QOpenGLWindowPaintDevice::ensureActiveTarget()
\sa QOpenGLWindow::UpdateBehavior
*/
QOpenGLWindow::QOpenGLWindow(QOpenGLWindow::UpdateBehavior updateBehavior, QWindow *parent)
- : QPaintDeviceWindow(*(new QOpenGLWindowPrivate(Q_NULLPTR, updateBehavior)), parent)
+ : QPaintDeviceWindow(*(new QOpenGLWindowPrivate(nullptr, updateBehavior)), parent)
{
setSurfaceType(QSurface::OpenGLSurface);
}
diff --git a/src/gui/kernel/qopenglwindow.h b/src/gui/kernel/qopenglwindow.h
index fe236f9538..7b3bf004a3 100644
--- a/src/gui/kernel/qopenglwindow.h
+++ b/src/gui/kernel/qopenglwindow.h
@@ -64,8 +64,8 @@ public:
PartialUpdateBlend
};
- explicit QOpenGLWindow(UpdateBehavior updateBehavior = NoPartialUpdate, QWindow *parent = Q_NULLPTR);
- explicit QOpenGLWindow(QOpenGLContext *shareContext, UpdateBehavior updateBehavior = NoPartialUpdate, QWindow *parent = Q_NULLPTR);
+ explicit QOpenGLWindow(UpdateBehavior updateBehavior = NoPartialUpdate, QWindow *parent = nullptr);
+ explicit QOpenGLWindow(QOpenGLContext *shareContext, UpdateBehavior updateBehavior = NoPartialUpdate, QWindow *parent = nullptr);
~QOpenGLWindow();
UpdateBehavior updateBehavior() const;
@@ -91,10 +91,10 @@ protected:
virtual void paintUnderGL();
virtual void paintOverGL();
- void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
- void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE;
- int metric(PaintDeviceMetric metric) const Q_DECL_OVERRIDE;
- QPaintDevice *redirected(QPoint *) const Q_DECL_OVERRIDE;
+ void paintEvent(QPaintEvent *event) override;
+ void resizeEvent(QResizeEvent *event) override;
+ int metric(PaintDeviceMetric metric) const override;
+ QPaintDevice *redirected(QPoint *) const override;
private:
Q_DISABLE_COPY(QOpenGLWindow)
diff --git a/src/gui/kernel/qpaintdevicewindow.h b/src/gui/kernel/qpaintdevicewindow.h
index 81b41dcdd5..3be078132f 100644
--- a/src/gui/kernel/qpaintdevicewindow.h
+++ b/src/gui/kernel/qpaintdevicewindow.h
@@ -68,14 +68,14 @@ public Q_SLOTS:
protected:
virtual void paintEvent(QPaintEvent *event);
- int metric(PaintDeviceMetric metric) const Q_DECL_OVERRIDE;
- void exposeEvent(QExposeEvent *) Q_DECL_OVERRIDE;
- bool event(QEvent *event) Q_DECL_OVERRIDE;
+ int metric(PaintDeviceMetric metric) const override;
+ void exposeEvent(QExposeEvent *) override;
+ bool event(QEvent *event) override;
QPaintDeviceWindow(QPaintDeviceWindowPrivate &dd, QWindow *parent);
private:
- QPaintEngine *paintEngine() const Q_DECL_OVERRIDE;
+ QPaintEngine *paintEngine() const override;
Q_DISABLE_COPY(QPaintDeviceWindow)
};
diff --git a/src/gui/kernel/qpalette.h b/src/gui/kernel/qpalette.h
index d04fb1f0c5..71f3d0c3b8 100644
--- a/src/gui/kernel/qpalette.h
+++ b/src/gui/kernel/qpalette.h
@@ -70,7 +70,7 @@ public:
#ifdef Q_COMPILER_RVALUE_REFS
QPalette(QPalette &&other) Q_DECL_NOTHROW
: d(other.d), data(other.data)
- { other.d = Q_NULLPTR; }
+ { other.d = nullptr; }
inline QPalette &operator=(QPalette &&other) Q_DECL_NOEXCEPT
{
for_faster_swapping_dont_use = other.for_faster_swapping_dont_use;
diff --git a/src/gui/kernel/qplatformcursor.cpp b/src/gui/kernel/qplatformcursor.cpp
index e6cf6a8216..df78e7d896 100644
--- a/src/gui/kernel/qplatformcursor.cpp
+++ b/src/gui/kernel/qplatformcursor.cpp
@@ -128,7 +128,7 @@ void QPlatformCursor::setPos(const QPoint &pos)
qWarning("This plugin does not support QCursor::setPos()"
"; emulating movement within the application.");
}
- QWindowSystemInterface::handleMouseEvent(0, pos, pos, Qt::NoButton);
+ QWindowSystemInterface::handleMouseEvent(0, pos, pos, Qt::NoButton, Qt::NoButton, QEvent::MouseMove);
}
// End of display and pointer event handling code
diff --git a/src/gui/kernel/qplatformgraphicsbuffer.cpp b/src/gui/kernel/qplatformgraphicsbuffer.cpp
index d42231e958..cc01efd6db 100644
--- a/src/gui/kernel/qplatformgraphicsbuffer.cpp
+++ b/src/gui/kernel/qplatformgraphicsbuffer.cpp
@@ -217,7 +217,7 @@ void QPlatformGraphicsBuffer::unlock()
the memory returned when not having a SWWriteAccess.
*/
const uchar *QPlatformGraphicsBuffer::data() const
-{ return Q_NULLPTR; }
+{ return nullptr; }
/*!
Accessor for the bytes of the buffer. This function needs to be called on a
@@ -226,7 +226,7 @@ const uchar *QPlatformGraphicsBuffer::data() const
*/
uchar *QPlatformGraphicsBuffer::data()
{
- return Q_NULLPTR;
+ return nullptr;
}
/*!
diff --git a/src/gui/kernel/qplatformgraphicsbufferhelper.h b/src/gui/kernel/qplatformgraphicsbufferhelper.h
index 5b7daff65a..6307f54a3e 100644
--- a/src/gui/kernel/qplatformgraphicsbufferhelper.h
+++ b/src/gui/kernel/qplatformgraphicsbufferhelper.h
@@ -47,7 +47,7 @@ QT_BEGIN_NAMESPACE
namespace QPlatformGraphicsBufferHelper {
bool lockAndBindToTexture(QPlatformGraphicsBuffer *graphicsBuffer, bool *swizzleRandB, bool *premultipliedB, const QRect &rect = QRect());
- bool bindSWToTexture(const QPlatformGraphicsBuffer *graphicsBuffer, bool *swizzleRandB = Q_NULLPTR, bool *premultipliedB = Q_NULLPTR, const QRect &rect = QRect());
+ bool bindSWToTexture(const QPlatformGraphicsBuffer *graphicsBuffer, bool *swizzleRandB = nullptr, bool *premultipliedB = nullptr, const QRect &rect = QRect());
}
QT_END_NAMESPACE
diff --git a/src/gui/kernel/qplatformnativeinterface.cpp b/src/gui/kernel/qplatformnativeinterface.cpp
index 6614d45b12..b24541d3ec 100644
--- a/src/gui/kernel/qplatformnativeinterface.cpp
+++ b/src/gui/kernel/qplatformnativeinterface.cpp
@@ -92,7 +92,7 @@ void *QPlatformNativeInterface::nativeResourceForCursor(const QByteArray &resour
{
Q_UNUSED(resource);
Q_UNUSED(cursor);
- return Q_NULLPTR;
+ return nullptr;
}
#endif // !QT_NO_CURSOR
@@ -129,7 +129,7 @@ QPlatformNativeInterface::NativeResourceForBackingStoreFunction QPlatformNativeI
QFunctionPointer QPlatformNativeInterface::platformFunction(const QByteArray &function) const
{
Q_UNUSED(function);
- return Q_NULLPTR;
+ return nullptr;
}
/*!
diff --git a/src/gui/kernel/qplatformoffscreensurface.cpp b/src/gui/kernel/qplatformoffscreensurface.cpp
index 9d35b37c6a..c2952e166c 100644
--- a/src/gui/kernel/qplatformoffscreensurface.cpp
+++ b/src/gui/kernel/qplatformoffscreensurface.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2017 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtGui module of the Qt Toolkit.
diff --git a/src/gui/kernel/qplatformoffscreensurface.h b/src/gui/kernel/qplatformoffscreensurface.h
index be15a98e28..cef0fab7e1 100644
--- a/src/gui/kernel/qplatformoffscreensurface.h
+++ b/src/gui/kernel/qplatformoffscreensurface.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2017 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtGui module of the Qt Toolkit.
@@ -68,7 +68,7 @@ public:
QOffscreenSurface *offscreenSurface() const;
- QPlatformScreen *screen() const;
+ QPlatformScreen *screen() const override;
virtual QSurfaceFormat format() const override;
virtual bool isValid() const;
diff --git a/src/gui/kernel/qplatformsurface.h b/src/gui/kernel/qplatformsurface.h
index 5a1e4fe82d..76e8767a05 100644
--- a/src/gui/kernel/qplatformsurface.h
+++ b/src/gui/kernel/qplatformsurface.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2017 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtGui module of the Qt Toolkit.
@@ -56,6 +56,7 @@
QT_BEGIN_NAMESPACE
+class QPlatformScreen;
class Q_GUI_EXPORT QPlatformSurface
{
@@ -64,6 +65,7 @@ public:
virtual QSurfaceFormat format() const = 0;
QSurface *surface() const;
+ virtual QPlatformScreen *screen() const = 0;
private:
explicit QPlatformSurface(QSurface *surface);
diff --git a/src/gui/kernel/qplatformwindow.cpp b/src/gui/kernel/qplatformwindow.cpp
index ae39411729..2284290d6c 100644
--- a/src/gui/kernel/qplatformwindow.cpp
+++ b/src/gui/kernel/qplatformwindow.cpp
@@ -104,7 +104,7 @@ QPlatformWindow *QPlatformWindow::parent() const
QPlatformScreen *QPlatformWindow::screen() const
{
QScreen *scr = window()->screen();
- return scr ? scr->handle() : Q_NULLPTR;
+ return scr ? scr->handle() : nullptr;
}
/*!
diff --git a/src/gui/kernel/qplatformwindow.h b/src/gui/kernel/qplatformwindow.h
index dff8f618e2..4105ef1c1a 100644
--- a/src/gui/kernel/qplatformwindow.h
+++ b/src/gui/kernel/qplatformwindow.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2017 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtGui module of the Qt Toolkit.
@@ -79,7 +79,7 @@ public:
QWindow *window() const;
QPlatformWindow *parent() const;
- QPlatformScreen *screen() const;
+ QPlatformScreen *screen() const override;
virtual QSurfaceFormat format() const override;
diff --git a/src/gui/kernel/qrasterwindow.cpp b/src/gui/kernel/qrasterwindow.cpp
index 73871e0f39..d06fee62cf 100644
--- a/src/gui/kernel/qrasterwindow.cpp
+++ b/src/gui/kernel/qrasterwindow.cpp
@@ -70,7 +70,7 @@ class QRasterWindowPrivate : public QPaintDeviceWindowPrivate
{
Q_DECLARE_PUBLIC(QRasterWindow)
public:
- void beginPaint(const QRegion &region) Q_DECL_OVERRIDE
+ void beginPaint(const QRegion &region) override
{
Q_Q(QRasterWindow);
const QSize size = q->size();
@@ -81,12 +81,12 @@ public:
backingstore->beginPaint(region);
}
- void endPaint() Q_DECL_OVERRIDE
+ void endPaint() override
{
backingstore->endPaint();
}
- void flush(const QRegion &region) Q_DECL_OVERRIDE
+ void flush(const QRegion &region) override
{
Q_Q(QRasterWindow);
backingstore->flush(region, q);
diff --git a/src/gui/kernel/qrasterwindow.h b/src/gui/kernel/qrasterwindow.h
index 9b29183ad6..9fe01c076b 100644
--- a/src/gui/kernel/qrasterwindow.h
+++ b/src/gui/kernel/qrasterwindow.h
@@ -53,12 +53,12 @@ class Q_GUI_EXPORT QRasterWindow : public QPaintDeviceWindow
Q_DECLARE_PRIVATE(QRasterWindow)
public:
- explicit QRasterWindow(QWindow *parent = Q_NULLPTR);
+ explicit QRasterWindow(QWindow *parent = nullptr);
~QRasterWindow();
protected:
- int metric(PaintDeviceMetric metric) const Q_DECL_OVERRIDE;
- QPaintDevice *redirected(QPoint *) const Q_DECL_OVERRIDE;
+ int metric(PaintDeviceMetric metric) const override;
+ QPaintDevice *redirected(QPoint *) const override;
private:
Q_DISABLE_COPY(QRasterWindow)
diff --git a/src/gui/kernel/qshapedpixmapdndwindow_p.h b/src/gui/kernel/qshapedpixmapdndwindow_p.h
index 2c25ca7c76..477938867c 100644
--- a/src/gui/kernel/qshapedpixmapdndwindow_p.h
+++ b/src/gui/kernel/qshapedpixmapdndwindow_p.h
@@ -71,7 +71,7 @@ public:
void updateGeometry(const QPoint &pos);
protected:
- void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
+ void paintEvent(QPaintEvent *) override;
private:
QPixmap m_pixmap;
diff --git a/src/gui/kernel/qsimpledrag.cpp b/src/gui/kernel/qsimpledrag.cpp
index 99aaed0444..1b56c7d9f2 100644
--- a/src/gui/kernel/qsimpledrag.cpp
+++ b/src/gui/kernel/qsimpledrag.cpp
@@ -97,7 +97,7 @@ QBasicDrag::QBasicDrag() :
m_restoreCursor(false), m_eventLoop(0),
m_executed_drop_action(Qt::IgnoreAction), m_can_drop(false),
m_drag(0), m_drag_icon_window(0), m_useCompositing(true),
- m_screen(Q_NULLPTR)
+ m_screen(nullptr)
{
}
diff --git a/src/gui/kernel/qsimpledrag_p.h b/src/gui/kernel/qsimpledrag_p.h
index 45c13e43b2..4db8eb4505 100644
--- a/src/gui/kernel/qsimpledrag_p.h
+++ b/src/gui/kernel/qsimpledrag_p.h
@@ -72,10 +72,10 @@ class Q_GUI_EXPORT QBasicDrag : public QPlatformDrag, public QObject
public:
virtual ~QBasicDrag();
- virtual Qt::DropAction drag(QDrag *drag) Q_DECL_OVERRIDE;
- void cancelDrag() Q_DECL_OVERRIDE;
+ virtual Qt::DropAction drag(QDrag *drag) override;
+ void cancelDrag() override;
- virtual bool eventFilter(QObject *o, QEvent *e) Q_DECL_OVERRIDE;
+ virtual bool eventFilter(QObject *o, QEvent *e) override;
protected:
QBasicDrag();
@@ -127,10 +127,10 @@ public:
QSimpleDrag();
protected:
- virtual void startDrag() Q_DECL_OVERRIDE;
- virtual void cancel() Q_DECL_OVERRIDE;
- virtual void move(const QPoint &globalPos) Q_DECL_OVERRIDE;
- virtual void drop(const QPoint &globalPos) Q_DECL_OVERRIDE;
+ virtual void startDrag() override;
+ virtual void cancel() override;
+ virtual void move(const QPoint &globalPos) override;
+ virtual void drop(const QPoint &globalPos) override;
private:
QWindow *m_current_window;
diff --git a/src/gui/kernel/qwindow.h b/src/gui/kernel/qwindow.h
index 44ff054fa3..ac5543f884 100644
--- a/src/gui/kernel/qwindow.h
+++ b/src/gui/kernel/qwindow.h
@@ -141,12 +141,12 @@ public:
};
Q_ENUM(AncestorMode)
- explicit QWindow(QScreen *screen = Q_NULLPTR);
+ explicit QWindow(QScreen *screen = nullptr);
explicit QWindow(QWindow *parent);
virtual ~QWindow();
void setSurfaceType(SurfaceType surfaceType);
- SurfaceType surfaceType() const Q_DECL_OVERRIDE;
+ SurfaceType surfaceType() const override;
bool isVisible() const;
@@ -168,7 +168,7 @@ public:
void setModality(Qt::WindowModality modality);
void setFormat(const QSurfaceFormat &format);
- QSurfaceFormat format() const Q_DECL_OVERRIDE;
+ QSurfaceFormat format() const override;
QSurfaceFormat requestedFormat() const;
void setFlags(Qt::WindowFlags flags);
@@ -231,7 +231,7 @@ public:
inline int x() const { return geometry().x(); }
inline int y() const { return geometry().y(); }
- QSize size() const Q_DECL_OVERRIDE { return geometry().size(); }
+ QSize size() const override { return geometry().size(); }
inline QPoint position() const { return geometry().topLeft(); }
void setPosition(const QPoint &pt);
@@ -347,7 +347,7 @@ protected:
virtual void hideEvent(QHideEvent *);
// TODO Qt 6 - add closeEvent virtual handler
- virtual bool event(QEvent *) Q_DECL_OVERRIDE;
+ virtual bool event(QEvent *) override;
virtual void keyPressEvent(QKeyEvent *);
virtual void keyReleaseEvent(QKeyEvent *);
virtual void mousePressEvent(QMouseEvent *);
@@ -367,7 +367,7 @@ protected:
private:
Q_PRIVATE_SLOT(d_func(), void _q_clearAlert())
- QPlatformSurface *surfaceHandle() const Q_DECL_OVERRIDE;
+ QPlatformSurface *surfaceHandle() const override;
Q_DISABLE_COPY(QWindow)
@@ -380,12 +380,12 @@ private:
#ifndef Q_QDOC
template <> inline QWindow *qobject_cast<QWindow*>(QObject *o)
{
- if (!o || !o->isWindowType()) return Q_NULLPTR;
+ if (!o || !o->isWindowType()) return nullptr;
return static_cast<QWindow*>(o);
}
template <> inline const QWindow *qobject_cast<const QWindow*>(const QObject *o)
{
- if (!o || !o->isWindowType()) return Q_NULLPTR;
+ if (!o || !o->isWindowType()) return nullptr;
return static_cast<const QWindow*>(o);
}
#endif // !Q_QDOC
diff --git a/src/gui/kernel/qwindowsysteminterface.cpp b/src/gui/kernel/qwindowsysteminterface.cpp
index 2cecb444c3..a47bac8f39 100644
--- a/src/gui/kernel/qwindowsysteminterface.cpp
+++ b/src/gui/kernel/qwindowsysteminterface.cpp
@@ -341,35 +341,79 @@ void QWindowSystemInterface::handleCloseEvent(QWindow *window, bool *accepted)
\a w == 0 means that the event is in global coords only, \a local will be ignored in this case
*/
+#if QT_DEPRECATED_SINCE(5, 11)
QT_DEFINE_QPA_EVENT_HANDLER(void, handleMouseEvent, QWindow *window, const QPointF &local, const QPointF &global, Qt::MouseButtons b,
Qt::KeyboardModifiers mods, Qt::MouseEventSource source)
{
- unsigned long time = QWindowSystemInterfacePrivate::eventTime.elapsed();
- handleMouseEvent<Delivery>(window, time, local, global, b, mods, source);
+ handleMouseEvent<Delivery>(window, local, global, b, Qt::NoButton, QEvent::None, mods, source);
}
QT_DEFINE_QPA_EVENT_HANDLER(void, handleMouseEvent, QWindow *window, ulong timestamp, const QPointF &local, const QPointF &global, Qt::MouseButtons b,
Qt::KeyboardModifiers mods, Qt::MouseEventSource source)
{
- QWindowSystemInterfacePrivate::MouseEvent * e =
- new QWindowSystemInterfacePrivate::MouseEvent(window, timestamp, QHighDpi::fromNativeLocalPosition(local, window), QHighDpi::fromNativePixels(global, window), b, mods, source);
- QWindowSystemInterfacePrivate::handleWindowSystemEvent<Delivery>(e);
+ handleMouseEvent<Delivery>(window, timestamp, local, global, b, Qt::NoButton, QEvent::None, mods, source);
}
void QWindowSystemInterface::handleFrameStrutMouseEvent(QWindow *window, const QPointF &local, const QPointF &global, Qt::MouseButtons b,
Qt::KeyboardModifiers mods, Qt::MouseEventSource source)
{
- const unsigned long time = QWindowSystemInterfacePrivate::eventTime.elapsed();
- handleFrameStrutMouseEvent(window, time, local, global, b, mods, source);
+ handleFrameStrutMouseEvent(window, local, global, b, Qt::NoButton, QEvent::None, mods, source);
}
void QWindowSystemInterface::handleFrameStrutMouseEvent(QWindow *window, ulong timestamp, const QPointF &local, const QPointF &global, Qt::MouseButtons b,
Qt::KeyboardModifiers mods, Qt::MouseEventSource source)
{
- QWindowSystemInterfacePrivate::MouseEvent * e =
- new QWindowSystemInterfacePrivate::MouseEvent(window, timestamp,
- QWindowSystemInterfacePrivate::FrameStrutMouse,
- QHighDpi::fromNativeLocalPosition(local, window), QHighDpi::fromNativePixels(global, window), b, mods, source);
+ handleFrameStrutMouseEvent(window, timestamp, local, global, b, Qt::NoButton, QEvent::None, mods, source);
+}
+#endif // QT_DEPRECATED_SINCE(5, 11)
+
+QT_DEFINE_QPA_EVENT_HANDLER(void, handleMouseEvent, QWindow *window,
+ const QPointF &local, const QPointF &global, Qt::MouseButtons state,
+ Qt::MouseButton button, QEvent::Type type, Qt::KeyboardModifiers mods,
+ Qt::MouseEventSource source)
+{
+ unsigned long time = QWindowSystemInterfacePrivate::eventTime.elapsed();
+ handleMouseEvent<Delivery>(window, time, local, global, state, button, type, mods, source);
+}
+
+QT_DEFINE_QPA_EVENT_HANDLER(void, handleMouseEvent, QWindow *window, ulong timestamp,
+ const QPointF &local, const QPointF &global, Qt::MouseButtons state,
+ Qt::MouseButton button, QEvent::Type type, Qt::KeyboardModifiers mods,
+ Qt::MouseEventSource source)
+{
+ auto localPos = QHighDpi::fromNativeLocalPosition(local, window);
+ auto globalPos = QHighDpi::fromNativePixels(global, window);
+
+ QWindowSystemInterfacePrivate::MouseEvent *e =
+ new QWindowSystemInterfacePrivate::MouseEvent(window, timestamp, localPos, globalPos,
+ state, mods, button, type, source);
+ QWindowSystemInterfacePrivate::handleWindowSystemEvent<Delivery>(e);
+}
+
+void QWindowSystemInterface::handleFrameStrutMouseEvent(QWindow *window,
+ const QPointF &local, const QPointF &global,
+ Qt::MouseButtons state,
+ Qt::MouseButton button, QEvent::Type type,
+ Qt::KeyboardModifiers mods,
+ Qt::MouseEventSource source)
+{
+ const unsigned long time = QWindowSystemInterfacePrivate::eventTime.elapsed();
+ handleFrameStrutMouseEvent(window, time, local, global, state, button, type, mods, source);
+}
+
+void QWindowSystemInterface::handleFrameStrutMouseEvent(QWindow *window, ulong timestamp,
+ const QPointF &local, const QPointF &global,
+ Qt::MouseButtons state,
+ Qt::MouseButton button, QEvent::Type type,
+ Qt::KeyboardModifiers mods,
+ Qt::MouseEventSource source)
+{
+ auto localPos = QHighDpi::fromNativeLocalPosition(local, window);
+ auto globalPos = QHighDpi::fromNativePixels(global, window);
+
+ QWindowSystemInterfacePrivate::MouseEvent *e =
+ new QWindowSystemInterfacePrivate::MouseEvent(window, timestamp, localPos, globalPos,
+ state, mods, button, type, source, true);
QWindowSystemInterfacePrivate::handleWindowSystemEvent(e);
}
@@ -1007,11 +1051,26 @@ bool QWindowSystemInterface::nonUserInputEventsQueued()
// The following functions are used by testlib, and need to be synchronous to avoid
// race conditions with plugins delivering native events from secondary threads.
+// FIXME: It seems unnecessary to export these wrapper functions, when qtestlib could access
+// QWindowSystemInterface directly (by adding dependency to gui-private), see QTBUG-63146.
+
+Q_GUI_EXPORT void qt_handleMouseEvent(QWindow *window, const QPointF &local, const QPointF &global,
+ Qt::MouseButtons state, Qt::MouseButton button,
+ QEvent::Type type, Qt::KeyboardModifiers mods, int timestamp)
+{
+ const qreal factor = QHighDpiScaling::factor(window);
+ QWindowSystemInterface::handleMouseEvent<QWindowSystemInterface::SynchronousDelivery>(window,
+ timestamp, local * factor, global * factor, state, button, type, mods);
+}
-Q_GUI_EXPORT void qt_handleMouseEvent(QWindow *window, const QPointF &local, const QPointF &global, Qt::MouseButtons b, Qt::KeyboardModifiers mods, int timestamp)
+// Wrapper for compatibility with Qt < 5.11
+// ### Qt6: Remove
+Q_GUI_EXPORT void qt_handleMouseEvent(QWindow *window, const QPointF &local, const QPointF &global,
+ Qt::MouseButtons b, Qt::KeyboardModifiers mods, int timestamp)
{
const qreal factor = QHighDpiScaling::factor(window);
- QWindowSystemInterface::handleMouseEvent<QWindowSystemInterface::SynchronousDelivery>(window, timestamp, local * factor, global * factor, b, mods);
+ QWindowSystemInterface::handleMouseEvent<QWindowSystemInterface::SynchronousDelivery>(window,
+ timestamp, local * factor, global * factor, b, Qt::NoButton, QEvent::None, mods);
}
// Wrapper for compatibility with Qt < 5.6
diff --git a/src/gui/kernel/qwindowsysteminterface.h b/src/gui/kernel/qwindowsysteminterface.h
index b1ca6238cb..960f79b5ba 100644
--- a/src/gui/kernel/qwindowsysteminterface.h
+++ b/src/gui/kernel/qwindowsysteminterface.h
@@ -76,20 +76,47 @@ public:
struct AsynchronousDelivery {};
struct DefaultDelivery {};
+#if QT_DEPRECATED_SINCE(5, 11)
template<typename Delivery = QWindowSystemInterface::DefaultDelivery>
- static void handleMouseEvent(QWindow *window, const QPointF &local, const QPointF &global, Qt::MouseButtons b,
+ QT_DEPRECATED static void handleMouseEvent(QWindow *window, const QPointF &local, const QPointF &global, Qt::MouseButtons b,
Qt::KeyboardModifiers mods = Qt::NoModifier,
Qt::MouseEventSource source = Qt::MouseEventNotSynthesized);
template<typename Delivery = QWindowSystemInterface::DefaultDelivery>
- static void handleMouseEvent(QWindow *window, ulong timestamp, const QPointF &local, const QPointF &global, Qt::MouseButtons b,
+ QT_DEPRECATED static void handleMouseEvent(QWindow *window, ulong timestamp, const QPointF &local, const QPointF &global, Qt::MouseButtons b,
Qt::KeyboardModifiers mods = Qt::NoModifier,
Qt::MouseEventSource source = Qt::MouseEventNotSynthesized);
- static void handleFrameStrutMouseEvent(QWindow *window, const QPointF &local, const QPointF &global, Qt::MouseButtons b,
+
+ QT_DEPRECATED static void handleFrameStrutMouseEvent(QWindow *window, const QPointF &local, const QPointF &global, Qt::MouseButtons b,
Qt::KeyboardModifiers mods = Qt::NoModifier,
Qt::MouseEventSource source = Qt::MouseEventNotSynthesized);
- static void handleFrameStrutMouseEvent(QWindow *window, ulong timestamp, const QPointF &local, const QPointF &global, Qt::MouseButtons b,
+ QT_DEPRECATED static void handleFrameStrutMouseEvent(QWindow *window, ulong timestamp, const QPointF &local, const QPointF &global, Qt::MouseButtons b,
Qt::KeyboardModifiers mods = Qt::NoModifier,
Qt::MouseEventSource source = Qt::MouseEventNotSynthesized);
+#endif
+ template<typename Delivery = QWindowSystemInterface::DefaultDelivery>
+ static void handleMouseEvent(QWindow *window, const QPointF &local, const QPointF &global,
+ Qt::MouseButtons state, Qt::MouseButton button, QEvent::Type type,
+ Qt::KeyboardModifiers mods = Qt::NoModifier,
+ Qt::MouseEventSource source = Qt::MouseEventNotSynthesized);
+ template<typename Delivery = QWindowSystemInterface::DefaultDelivery>
+ static void handleMouseEvent(QWindow *window, ulong timestamp, const QPointF &local,
+ const QPointF &global, Qt::MouseButtons state,
+ Qt::MouseButton button, QEvent::Type type,
+ Qt::KeyboardModifiers mods = Qt::NoModifier,
+ Qt::MouseEventSource source = Qt::MouseEventNotSynthesized);
+
+ static void handleFrameStrutMouseEvent(QWindow *window, const QPointF &local,
+ const QPointF &global, Qt::MouseButtons state,
+ Qt::MouseButton button, QEvent::Type type,
+ Qt::KeyboardModifiers mods = Qt::NoModifier,
+ Qt::MouseEventSource source =
+ Qt::MouseEventNotSynthesized);
+ static void handleFrameStrutMouseEvent(QWindow *window, ulong timestamp, const QPointF &local,
+ const QPointF &global, Qt::MouseButtons state,
+ Qt::MouseButton button, QEvent::Type type,
+ Qt::KeyboardModifiers mods = Qt::NoModifier,
+ Qt::MouseEventSource source =
+ Qt::MouseEventNotSynthesized);
static bool handleShortcutEvent(QWindow *window, ulong timestamp, int k, Qt::KeyboardModifiers mods, quint32 nativeScanCode,
quint32 nativeVirtualKey, quint32 nativeModifiers, const QString & text = QString(), bool autorep = false, ushort count = 1);
@@ -166,7 +193,7 @@ public:
template<typename Delivery = QWindowSystemInterface::DefaultDelivery>
static void handleExposeEvent(QWindow *window, const QRegion &region);
- static void handleCloseEvent(QWindow *window, bool *accepted = Q_NULLPTR);
+ static void handleCloseEvent(QWindow *window, bool *accepted = nullptr);
template<typename Delivery = QWindowSystemInterface::DefaultDelivery>
static void handleEnterEvent(QWindow *window, const QPointF &local = QPointF(), const QPointF& global = QPointF());
diff --git a/src/gui/kernel/qwindowsysteminterface_p.h b/src/gui/kernel/qwindowsysteminterface_p.h
index 6a1360a26a..152ea92919 100644
--- a/src/gui/kernel/qwindowsysteminterface_p.h
+++ b/src/gui/kernel/qwindowsysteminterface_p.h
@@ -75,7 +75,7 @@ public:
ActivatedWindow = 0x05,
WindowStateChanged = 0x06,
Mouse = UserInputEvent | 0x07,
- FrameStrutMouse = UserInputEvent | 0x08,
+ FrameStrutMouse = UserInputEvent | 0x08, // ### Qt6 remove
Wheel = UserInputEvent | 0x09,
Key = UserInputEvent | 0x0a,
Touch = UserInputEvent | 0x0b,
@@ -225,18 +225,27 @@ public:
class MouseEvent : public InputEvent {
public:
- MouseEvent(QWindow * w, ulong time, const QPointF &local, const QPointF &global,
- Qt::MouseButtons b, Qt::KeyboardModifiers mods,
- Qt::MouseEventSource src = Qt::MouseEventNotSynthesized)
- : InputEvent(w, time, Mouse, mods), localPos(local), globalPos(global), buttons(b), source(src) { }
- MouseEvent(QWindow * w, ulong time, EventType t, const QPointF &local, const QPointF &global,
- Qt::MouseButtons b, Qt::KeyboardModifiers mods,
- Qt::MouseEventSource src = Qt::MouseEventNotSynthesized)
- : InputEvent(w, time, t, mods), localPos(local), globalPos(global), buttons(b), source(src) { }
+ MouseEvent(QWindow *w, ulong time, const QPointF &local, const QPointF &global,
+ Qt::MouseButtons state, Qt::KeyboardModifiers mods,
+ Qt::MouseButton b, QEvent::Type type,
+ Qt::MouseEventSource src = Qt::MouseEventNotSynthesized, bool frame = false)
+ : InputEvent(w, time, Mouse, mods), localPos(local), globalPos(global), buttons(state),
+ source(src), nonClientArea(frame), button(b), buttonType(type) { }
+
+ // ### In Qt6 this method can be removed as there won't be need for compatibility code path
+ bool enhancedMouseEvent() const
+ {
+ static const bool disableEnhanced = qEnvironmentVariableIsSet("QT_QPA_DISABLE_ENHANCED_MOUSE");
+ return !disableEnhanced && buttonType != QEvent::None;
+ }
+
QPointF localPos;
QPointF globalPos;
Qt::MouseButtons buttons;
Qt::MouseEventSource source;
+ bool nonClientArea;
+ Qt::MouseButton button;
+ QEvent::Type buttonType;
};
class WheelEvent : public InputEvent {
@@ -513,7 +522,7 @@ public:
static QList<QTouchEvent::TouchPoint>
fromNativeTouchPoints(const QList<QWindowSystemInterface::TouchPoint> &points,
- const QWindow *window, quint8 deviceId, QEvent::Type *type = Q_NULLPTR);
+ const QWindow *window, quint8 deviceId, QEvent::Type *type = nullptr);
static QList<QWindowSystemInterface::TouchPoint>
toNativeTouchPoints(const QList<QTouchEvent::TouchPoint>& pointList,
const QWindow *window);
diff --git a/src/gui/math3d/qmatrix4x4.h b/src/gui/math3d/qmatrix4x4.h
index 97df11a8bd..69c3510659 100644
--- a/src/gui/math3d/qmatrix4x4.h
+++ b/src/gui/math3d/qmatrix4x4.h
@@ -93,7 +93,7 @@ public:
inline void fill(float value);
double determinant() const;
- QMatrix4x4 inverted(bool *invertible = Q_NULLPTR) const;
+ QMatrix4x4 inverted(bool *invertible = nullptr) const;
QMatrix4x4 transposed() const;
QMatrix3x3 normalMatrix() const;
diff --git a/src/gui/opengl/qopengl.cpp b/src/gui/opengl/qopengl.cpp
index 7e663d48bb..3a476978e7 100644
--- a/src/gui/opengl/qopengl.cpp
+++ b/src/gui/opengl/qopengl.cpp
@@ -143,7 +143,7 @@ typedef QJsonArray::ConstIterator JsonArrayConstIt;
static inline bool contains(const QJsonArray &haystack, unsigned needle)
{
for (JsonArrayConstIt it = haystack.constBegin(), cend = haystack.constEnd(); it != cend; ++it) {
- if (needle == it->toString().toUInt(Q_NULLPTR, /* base */ 0))
+ if (needle == it->toString().toUInt(nullptr, /* base */ 0))
return true;
}
return false;
@@ -331,7 +331,7 @@ static bool matches(const QJsonObject &object,
const QJsonValue vendorV = object.value(QLatin1String("vendor_id"));
if (vendorV.isString()) {
- if (gpu.vendorId != vendorV.toString().toUInt(Q_NULLPTR, /* base */ 0))
+ if (gpu.vendorId != vendorV.toString().toUInt(nullptr, /* base */ 0))
return false;
} else {
if (object.contains(QLatin1String("gl_vendor"))) {
diff --git a/src/gui/opengl/qopengl.h b/src/gui/opengl/qopengl.h
index f6c350ba0b..b4657fa118 100644
--- a/src/gui/opengl/qopengl.h
+++ b/src/gui/opengl/qopengl.h
@@ -235,10 +235,6 @@ typedef long long int int64_t;
typedef unsigned long long int uint64_t;
#endif /* __arch64__ */
#endif /* __STDC__ */
-#elif defined( __VMS ) || defined(__sgi)
-#include <inttypes.h>
-#elif defined(__SCO__) || defined(__USLC__)
-#include <stdint.h>
#elif defined(__UNIXOS2__) || defined(__SOL64__)
typedef long int int32_t;
typedef long long int int64_t;
diff --git a/src/gui/opengl/qopenglbuffer.h b/src/gui/opengl/qopenglbuffer.h
index f2dfec3bb4..a810783731 100644
--- a/src/gui/opengl/qopenglbuffer.h
+++ b/src/gui/opengl/qopenglbuffer.h
@@ -124,7 +124,7 @@ public:
void write(int offset, const void *data, int count);
void allocate(const void *data, int count);
- inline void allocate(int count) { allocate(Q_NULLPTR, count); }
+ inline void allocate(int count) { allocate(nullptr, count); }
void *map(QOpenGLBuffer::Access access);
void *mapRange(int offset, int count, QOpenGLBuffer::RangeAccessFlags access);
diff --git a/src/gui/opengl/qopengldebug.h b/src/gui/opengl/qopengldebug.h
index 6b10c36291..556ec175e1 100644
--- a/src/gui/opengl/qopengldebug.h
+++ b/src/gui/opengl/qopengldebug.h
@@ -167,7 +167,7 @@ public:
};
Q_ENUM(LoggingMode)
- explicit QOpenGLDebugLogger(QObject *parent = Q_NULLPTR);
+ explicit QOpenGLDebugLogger(QObject *parent = nullptr);
~QOpenGLDebugLogger();
bool initialize();
diff --git a/src/gui/opengl/qopenglengineshadermanager.cpp b/src/gui/opengl/qopenglengineshadermanager.cpp
index 3a94fa8805..2f7afa4a66 100644
--- a/src/gui/opengl/qopenglengineshadermanager.cpp
+++ b/src/gui/opengl/qopenglengineshadermanager.cpp
@@ -69,13 +69,13 @@ public:
delete m_shaders;
}
- void invalidateResource() Q_DECL_OVERRIDE
+ void invalidateResource() override
{
delete m_shaders;
m_shaders = 0;
}
- void freeResource(QOpenGLContext *) Q_DECL_OVERRIDE
+ void freeResource(QOpenGLContext *) override
{
}
diff --git a/src/gui/opengl/qopenglext.h b/src/gui/opengl/qopenglext.h
index b8b0c31f31..856adb679e 100644
--- a/src/gui/opengl/qopenglext.h
+++ b/src/gui/opengl/qopenglext.h
@@ -1405,10 +1405,6 @@ typedef long long int int64_t;
typedef unsigned long long int uint64_t;
#endif /* __arch64__ */
#endif /* __STDC__ */
-#elif defined( __VMS ) || defined(__sgi)
-#include <inttypes.h>
-#elif defined(__SCO__) || defined(__USLC__)
-#include <stdint.h>
#elif defined(__UNIXOS2__) || defined(__SOL64__)
typedef long int int32_t;
typedef long long int int64_t;
diff --git a/src/gui/opengl/qopenglextrafunctions.h b/src/gui/opengl/qopenglextrafunctions.h
index 81716fb8d3..a68e269065 100644
--- a/src/gui/opengl/qopenglextrafunctions.h
+++ b/src/gui/opengl/qopenglextrafunctions.h
@@ -511,7 +511,7 @@ public:
void glTexStorage3DMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
private:
- static bool isInitialized(const QOpenGLExtraFunctionsPrivate *d) { return d != Q_NULLPTR; }
+ static bool isInitialized(const QOpenGLExtraFunctionsPrivate *d) { return d != nullptr; }
};
diff --git a/src/gui/opengl/qopenglframebufferobject.cpp b/src/gui/opengl/qopenglframebufferobject.cpp
index b56bcd0866..628475a90a 100644
--- a/src/gui/opengl/qopenglframebufferobject.cpp
+++ b/src/gui/opengl/qopenglframebufferobject.cpp
@@ -953,7 +953,7 @@ QOpenGLFramebufferObject::~QOpenGLFramebufferObject()
QOpenGLContextPrivate *contextPrv = QOpenGLContextPrivate::get(QOpenGLContext::currentContext());
if (contextPrv && contextPrv->qgl_current_fbo == this) {
contextPrv->qgl_current_fbo_invalid = true;
- contextPrv->qgl_current_fbo = Q_NULLPTR;
+ contextPrv->qgl_current_fbo = nullptr;
}
}
@@ -1116,7 +1116,7 @@ bool QOpenGLFramebufferObject::release()
QOpenGLContextPrivate *contextPrv = QOpenGLContextPrivate::get(current);
contextPrv->qgl_current_fbo_invalid = true;
- contextPrv->qgl_current_fbo = Q_NULLPTR;
+ contextPrv->qgl_current_fbo = nullptr;
}
return true;
@@ -1472,7 +1472,7 @@ bool QOpenGLFramebufferObject::bindDefault()
if (ctx) {
ctx->functions()->glBindFramebuffer(GL_FRAMEBUFFER, ctx->defaultFramebufferObject());
QOpenGLContextPrivate::get(ctx)->qgl_current_fbo_invalid = true;
- QOpenGLContextPrivate::get(ctx)->qgl_current_fbo = Q_NULLPTR;
+ QOpenGLContextPrivate::get(ctx)->qgl_current_fbo = nullptr;
}
#ifdef QT_DEBUG
else
diff --git a/src/gui/opengl/qopenglfunctions.cpp b/src/gui/opengl/qopenglfunctions.cpp
index 5e3537e47b..739ecacc51 100644
--- a/src/gui/opengl/qopenglfunctions.cpp
+++ b/src/gui/opengl/qopenglfunctions.cpp
@@ -216,13 +216,13 @@ struct QOpenGLFunctionsPrivateEx : public QOpenGLExtensionsPrivate, public QOpen
, m_extensions(-1)
{}
- void invalidateResource() Q_DECL_OVERRIDE
+ void invalidateResource() override
{
m_features = -1;
m_extensions = -1;
}
- void freeResource(QOpenGLContext *) Q_DECL_OVERRIDE
+ void freeResource(QOpenGLContext *) override
{
// no gl resources to free
}
diff --git a/src/gui/opengl/qopenglfunctions.h b/src/gui/opengl/qopenglfunctions.h
index 0a5de2c9af..273ceaddc0 100644
--- a/src/gui/opengl/qopenglfunctions.h
+++ b/src/gui/opengl/qopenglfunctions.h
@@ -413,7 +413,7 @@ public:
protected:
QOpenGLFunctionsPrivate *d_ptr;
- static bool isInitialized(const QOpenGLFunctionsPrivate *d) { return d != Q_NULLPTR; }
+ static bool isInitialized(const QOpenGLFunctionsPrivate *d) { return d != nullptr; }
};
Q_DECLARE_OPERATORS_FOR_FLAGS(QOpenGLFunctions::OpenGLFeatures)
diff --git a/src/gui/opengl/qopenglfunctions_1_0.h b/src/gui/opengl/qopenglfunctions_1_0.h
index 8284604086..cddb7251ed 100644
--- a/src/gui/opengl/qopenglfunctions_1_0.h
+++ b/src/gui/opengl/qopenglfunctions_1_0.h
@@ -65,7 +65,7 @@ public:
QOpenGLFunctions_1_0();
~QOpenGLFunctions_1_0();
- bool initializeOpenGLFunctions() Q_DECL_OVERRIDE;
+ bool initializeOpenGLFunctions() override;
// OpenGL 1.0 core functions
void glViewport(GLint x, GLint y, GLsizei width, GLsizei height);
diff --git a/src/gui/opengl/qopenglfunctions_1_1.h b/src/gui/opengl/qopenglfunctions_1_1.h
index 052d3e93bd..8a9f16ec4c 100644
--- a/src/gui/opengl/qopenglfunctions_1_1.h
+++ b/src/gui/opengl/qopenglfunctions_1_1.h
@@ -65,7 +65,7 @@ public:
QOpenGLFunctions_1_1();
~QOpenGLFunctions_1_1();
- bool initializeOpenGLFunctions() Q_DECL_OVERRIDE;
+ bool initializeOpenGLFunctions() override;
// OpenGL 1.0 core functions
void glViewport(GLint x, GLint y, GLsizei width, GLsizei height);
diff --git a/src/gui/opengl/qopenglfunctions_1_2.h b/src/gui/opengl/qopenglfunctions_1_2.h
index 6b36500a79..7daca0923d 100644
--- a/src/gui/opengl/qopenglfunctions_1_2.h
+++ b/src/gui/opengl/qopenglfunctions_1_2.h
@@ -65,7 +65,7 @@ public:
QOpenGLFunctions_1_2();
~QOpenGLFunctions_1_2();
- bool initializeOpenGLFunctions() Q_DECL_OVERRIDE;
+ bool initializeOpenGLFunctions() override;
// OpenGL 1.0 core functions
void glViewport(GLint x, GLint y, GLsizei width, GLsizei height);
diff --git a/src/gui/opengl/qopenglfunctions_1_3.h b/src/gui/opengl/qopenglfunctions_1_3.h
index 3ed5851d5d..b527b57946 100644
--- a/src/gui/opengl/qopenglfunctions_1_3.h
+++ b/src/gui/opengl/qopenglfunctions_1_3.h
@@ -65,7 +65,7 @@ public:
QOpenGLFunctions_1_3();
~QOpenGLFunctions_1_3();
- bool initializeOpenGLFunctions() Q_DECL_OVERRIDE;
+ bool initializeOpenGLFunctions() override;
// OpenGL 1.0 core functions
void glViewport(GLint x, GLint y, GLsizei width, GLsizei height);
diff --git a/src/gui/opengl/qopenglfunctions_1_4.h b/src/gui/opengl/qopenglfunctions_1_4.h
index 849fad6744..1f3f5a9c0a 100644
--- a/src/gui/opengl/qopenglfunctions_1_4.h
+++ b/src/gui/opengl/qopenglfunctions_1_4.h
@@ -65,7 +65,7 @@ public:
QOpenGLFunctions_1_4();
~QOpenGLFunctions_1_4();
- bool initializeOpenGLFunctions() Q_DECL_OVERRIDE;
+ bool initializeOpenGLFunctions() override;
// OpenGL 1.0 core functions
void glViewport(GLint x, GLint y, GLsizei width, GLsizei height);
diff --git a/src/gui/opengl/qopenglfunctions_1_5.h b/src/gui/opengl/qopenglfunctions_1_5.h
index 18914a8957..d2f5311211 100644
--- a/src/gui/opengl/qopenglfunctions_1_5.h
+++ b/src/gui/opengl/qopenglfunctions_1_5.h
@@ -65,7 +65,7 @@ public:
QOpenGLFunctions_1_5();
~QOpenGLFunctions_1_5();
- bool initializeOpenGLFunctions() Q_DECL_OVERRIDE;
+ bool initializeOpenGLFunctions() override;
// OpenGL 1.0 core functions
void glViewport(GLint x, GLint y, GLsizei width, GLsizei height);
diff --git a/src/gui/opengl/qopenglfunctions_2_0.cpp b/src/gui/opengl/qopenglfunctions_2_0.cpp
index c175b13c5b..212723aa00 100644
--- a/src/gui/opengl/qopenglfunctions_2_0.cpp
+++ b/src/gui/opengl/qopenglfunctions_2_0.cpp
@@ -79,7 +79,7 @@ QOpenGLFunctions_2_0::QOpenGLFunctions_2_0()
, d_1_2_Deprecated(0)
, d_1_3_Deprecated(0)
, d_1_4_Deprecated(0)
- , m_reserved_2_0_Deprecated(Q_NULLPTR)
+ , m_reserved_2_0_Deprecated(nullptr)
{
}
diff --git a/src/gui/opengl/qopenglfunctions_2_0.h b/src/gui/opengl/qopenglfunctions_2_0.h
index 74a91e0ff0..556597a9b3 100644
--- a/src/gui/opengl/qopenglfunctions_2_0.h
+++ b/src/gui/opengl/qopenglfunctions_2_0.h
@@ -65,7 +65,7 @@ public:
QOpenGLFunctions_2_0();
~QOpenGLFunctions_2_0();
- bool initializeOpenGLFunctions() Q_DECL_OVERRIDE;
+ bool initializeOpenGLFunctions() override;
// OpenGL 1.0 core functions
void glViewport(GLint x, GLint y, GLsizei width, GLsizei height);
diff --git a/src/gui/opengl/qopenglfunctions_2_1.cpp b/src/gui/opengl/qopenglfunctions_2_1.cpp
index 4e77efd121..b8b255014c 100644
--- a/src/gui/opengl/qopenglfunctions_2_1.cpp
+++ b/src/gui/opengl/qopenglfunctions_2_1.cpp
@@ -80,7 +80,7 @@ QOpenGLFunctions_2_1::QOpenGLFunctions_2_1()
, d_1_2_Deprecated(0)
, d_1_3_Deprecated(0)
, d_1_4_Deprecated(0)
- , m_reserved_2_0_Deprecated(Q_NULLPTR)
+ , m_reserved_2_0_Deprecated(nullptr)
{
}
diff --git a/src/gui/opengl/qopenglfunctions_2_1.h b/src/gui/opengl/qopenglfunctions_2_1.h
index e9212640f7..f053222c71 100644
--- a/src/gui/opengl/qopenglfunctions_2_1.h
+++ b/src/gui/opengl/qopenglfunctions_2_1.h
@@ -65,7 +65,7 @@ public:
QOpenGLFunctions_2_1();
~QOpenGLFunctions_2_1();
- bool initializeOpenGLFunctions() Q_DECL_OVERRIDE;
+ bool initializeOpenGLFunctions() override;
// OpenGL 1.0 core functions
void glViewport(GLint x, GLint y, GLsizei width, GLsizei height);
diff --git a/src/gui/opengl/qopenglfunctions_3_0.cpp b/src/gui/opengl/qopenglfunctions_3_0.cpp
index 09e3ad09ef..4972c03b1e 100644
--- a/src/gui/opengl/qopenglfunctions_3_0.cpp
+++ b/src/gui/opengl/qopenglfunctions_3_0.cpp
@@ -81,8 +81,8 @@ QOpenGLFunctions_3_0::QOpenGLFunctions_3_0()
, d_1_2_Deprecated(0)
, d_1_3_Deprecated(0)
, d_1_4_Deprecated(0)
- , m_reserved_2_0_Deprecated(Q_NULLPTR)
- , m_reserved_3_0_Deprecated(Q_NULLPTR)
+ , m_reserved_2_0_Deprecated(nullptr)
+ , m_reserved_3_0_Deprecated(nullptr)
{
}
diff --git a/src/gui/opengl/qopenglfunctions_3_0.h b/src/gui/opengl/qopenglfunctions_3_0.h
index 1082d869d1..c592050c24 100644
--- a/src/gui/opengl/qopenglfunctions_3_0.h
+++ b/src/gui/opengl/qopenglfunctions_3_0.h
@@ -65,7 +65,7 @@ public:
QOpenGLFunctions_3_0();
~QOpenGLFunctions_3_0();
- bool initializeOpenGLFunctions() Q_DECL_OVERRIDE;
+ bool initializeOpenGLFunctions() override;
// OpenGL 1.0 core functions
void glViewport(GLint x, GLint y, GLsizei width, GLsizei height);
diff --git a/src/gui/opengl/qopenglfunctions_3_1.h b/src/gui/opengl/qopenglfunctions_3_1.h
index 2691dd29e7..3a8d3891f3 100644
--- a/src/gui/opengl/qopenglfunctions_3_1.h
+++ b/src/gui/opengl/qopenglfunctions_3_1.h
@@ -65,7 +65,7 @@ public:
QOpenGLFunctions_3_1();
~QOpenGLFunctions_3_1();
- bool initializeOpenGLFunctions() Q_DECL_OVERRIDE;
+ bool initializeOpenGLFunctions() override;
// OpenGL 1.0 core functions
void glViewport(GLint x, GLint y, GLsizei width, GLsizei height);
diff --git a/src/gui/opengl/qopenglfunctions_3_2_compatibility.cpp b/src/gui/opengl/qopenglfunctions_3_2_compatibility.cpp
index b90a123bfe..709f65edf8 100644
--- a/src/gui/opengl/qopenglfunctions_3_2_compatibility.cpp
+++ b/src/gui/opengl/qopenglfunctions_3_2_compatibility.cpp
@@ -83,8 +83,8 @@ QOpenGLFunctions_3_2_Compatibility::QOpenGLFunctions_3_2_Compatibility()
, d_1_2_Deprecated(0)
, d_1_3_Deprecated(0)
, d_1_4_Deprecated(0)
- , m_reserved_2_0_Deprecated(Q_NULLPTR)
- , m_reserved_3_0_Deprecated(Q_NULLPTR)
+ , m_reserved_2_0_Deprecated(nullptr)
+ , m_reserved_3_0_Deprecated(nullptr)
{
}
diff --git a/src/gui/opengl/qopenglfunctions_3_2_compatibility.h b/src/gui/opengl/qopenglfunctions_3_2_compatibility.h
index 9f34190721..391e725953 100644
--- a/src/gui/opengl/qopenglfunctions_3_2_compatibility.h
+++ b/src/gui/opengl/qopenglfunctions_3_2_compatibility.h
@@ -65,7 +65,7 @@ public:
QOpenGLFunctions_3_2_Compatibility();
~QOpenGLFunctions_3_2_Compatibility();
- bool initializeOpenGLFunctions() Q_DECL_OVERRIDE;
+ bool initializeOpenGLFunctions() override;
// OpenGL 1.0 core functions
void glViewport(GLint x, GLint y, GLsizei width, GLsizei height);
diff --git a/src/gui/opengl/qopenglfunctions_3_2_core.h b/src/gui/opengl/qopenglfunctions_3_2_core.h
index 2d5ee14bee..1eafb6f441 100644
--- a/src/gui/opengl/qopenglfunctions_3_2_core.h
+++ b/src/gui/opengl/qopenglfunctions_3_2_core.h
@@ -65,7 +65,7 @@ public:
QOpenGLFunctions_3_2_Core();
~QOpenGLFunctions_3_2_Core();
- bool initializeOpenGLFunctions() Q_DECL_OVERRIDE;
+ bool initializeOpenGLFunctions() override;
// OpenGL 1.0 core functions
void glViewport(GLint x, GLint y, GLsizei width, GLsizei height);
diff --git a/src/gui/opengl/qopenglfunctions_3_3_compatibility.cpp b/src/gui/opengl/qopenglfunctions_3_3_compatibility.cpp
index c585f0fc7c..b034391c86 100644
--- a/src/gui/opengl/qopenglfunctions_3_3_compatibility.cpp
+++ b/src/gui/opengl/qopenglfunctions_3_3_compatibility.cpp
@@ -84,7 +84,7 @@ QOpenGLFunctions_3_3_Compatibility::QOpenGLFunctions_3_3_Compatibility()
, d_1_2_Deprecated(0)
, d_1_3_Deprecated(0)
, d_1_4_Deprecated(0)
- , m_reserved_2_0_Deprecated(Q_NULLPTR)
+ , m_reserved_2_0_Deprecated(nullptr)
, d_3_3_Deprecated(0)
{
}
diff --git a/src/gui/opengl/qopenglfunctions_3_3_compatibility.h b/src/gui/opengl/qopenglfunctions_3_3_compatibility.h
index a5c0cab63c..185dd5aab4 100644
--- a/src/gui/opengl/qopenglfunctions_3_3_compatibility.h
+++ b/src/gui/opengl/qopenglfunctions_3_3_compatibility.h
@@ -65,7 +65,7 @@ public:
QOpenGLFunctions_3_3_Compatibility();
~QOpenGLFunctions_3_3_Compatibility();
- bool initializeOpenGLFunctions() Q_DECL_OVERRIDE;
+ bool initializeOpenGLFunctions() override;
// OpenGL 1.0 core functions
void glViewport(GLint x, GLint y, GLsizei width, GLsizei height);
diff --git a/src/gui/opengl/qopenglfunctions_3_3_core.h b/src/gui/opengl/qopenglfunctions_3_3_core.h
index 4f0132d959..47d54d717e 100644
--- a/src/gui/opengl/qopenglfunctions_3_3_core.h
+++ b/src/gui/opengl/qopenglfunctions_3_3_core.h
@@ -65,7 +65,7 @@ public:
QOpenGLFunctions_3_3_Core();
~QOpenGLFunctions_3_3_Core();
- bool initializeOpenGLFunctions() Q_DECL_OVERRIDE;
+ bool initializeOpenGLFunctions() override;
// OpenGL 1.0 core functions
void glViewport(GLint x, GLint y, GLsizei width, GLsizei height);
diff --git a/src/gui/opengl/qopenglfunctions_4_0_compatibility.cpp b/src/gui/opengl/qopenglfunctions_4_0_compatibility.cpp
index b5c423ef0c..4fe4526efc 100644
--- a/src/gui/opengl/qopenglfunctions_4_0_compatibility.cpp
+++ b/src/gui/opengl/qopenglfunctions_4_0_compatibility.cpp
@@ -85,7 +85,7 @@ QOpenGLFunctions_4_0_Compatibility::QOpenGLFunctions_4_0_Compatibility()
, d_1_2_Deprecated(0)
, d_1_3_Deprecated(0)
, d_1_4_Deprecated(0)
- , m_reserved_2_0_Deprecated(Q_NULLPTR)
+ , m_reserved_2_0_Deprecated(nullptr)
, d_3_3_Deprecated(0)
{
}
diff --git a/src/gui/opengl/qopenglfunctions_4_0_compatibility.h b/src/gui/opengl/qopenglfunctions_4_0_compatibility.h
index 1fa5e8a361..c0e42443d3 100644
--- a/src/gui/opengl/qopenglfunctions_4_0_compatibility.h
+++ b/src/gui/opengl/qopenglfunctions_4_0_compatibility.h
@@ -65,7 +65,7 @@ public:
QOpenGLFunctions_4_0_Compatibility();
~QOpenGLFunctions_4_0_Compatibility();
- bool initializeOpenGLFunctions() Q_DECL_OVERRIDE;
+ bool initializeOpenGLFunctions() override;
// OpenGL 1.0 core functions
void glViewport(GLint x, GLint y, GLsizei width, GLsizei height);
diff --git a/src/gui/opengl/qopenglfunctions_4_0_core.h b/src/gui/opengl/qopenglfunctions_4_0_core.h
index 8fd2af2d04..6cb55e86f7 100644
--- a/src/gui/opengl/qopenglfunctions_4_0_core.h
+++ b/src/gui/opengl/qopenglfunctions_4_0_core.h
@@ -65,7 +65,7 @@ public:
QOpenGLFunctions_4_0_Core();
~QOpenGLFunctions_4_0_Core();
- bool initializeOpenGLFunctions() Q_DECL_OVERRIDE;
+ bool initializeOpenGLFunctions() override;
// OpenGL 1.0 core functions
void glViewport(GLint x, GLint y, GLsizei width, GLsizei height);
diff --git a/src/gui/opengl/qopenglfunctions_4_1_compatibility.cpp b/src/gui/opengl/qopenglfunctions_4_1_compatibility.cpp
index 72c60c74b7..41ecb4672a 100644
--- a/src/gui/opengl/qopenglfunctions_4_1_compatibility.cpp
+++ b/src/gui/opengl/qopenglfunctions_4_1_compatibility.cpp
@@ -86,7 +86,7 @@ QOpenGLFunctions_4_1_Compatibility::QOpenGLFunctions_4_1_Compatibility()
, d_1_2_Deprecated(0)
, d_1_3_Deprecated(0)
, d_1_4_Deprecated(0)
- , m_reserved_2_0_Deprecated(Q_NULLPTR)
+ , m_reserved_2_0_Deprecated(nullptr)
, d_3_3_Deprecated(0)
{
}
diff --git a/src/gui/opengl/qopenglfunctions_4_1_compatibility.h b/src/gui/opengl/qopenglfunctions_4_1_compatibility.h
index a284f8e6d3..bee169b50c 100644
--- a/src/gui/opengl/qopenglfunctions_4_1_compatibility.h
+++ b/src/gui/opengl/qopenglfunctions_4_1_compatibility.h
@@ -65,7 +65,7 @@ public:
QOpenGLFunctions_4_1_Compatibility();
~QOpenGLFunctions_4_1_Compatibility();
- bool initializeOpenGLFunctions() Q_DECL_OVERRIDE;
+ bool initializeOpenGLFunctions() override;
// OpenGL 1.0 core functions
void glViewport(GLint x, GLint y, GLsizei width, GLsizei height);
diff --git a/src/gui/opengl/qopenglfunctions_4_1_core.h b/src/gui/opengl/qopenglfunctions_4_1_core.h
index d35db3c839..3a4fd0743b 100644
--- a/src/gui/opengl/qopenglfunctions_4_1_core.h
+++ b/src/gui/opengl/qopenglfunctions_4_1_core.h
@@ -65,7 +65,7 @@ public:
QOpenGLFunctions_4_1_Core();
~QOpenGLFunctions_4_1_Core();
- bool initializeOpenGLFunctions() Q_DECL_OVERRIDE;
+ bool initializeOpenGLFunctions() override;
// OpenGL 1.0 core functions
void glViewport(GLint x, GLint y, GLsizei width, GLsizei height);
diff --git a/src/gui/opengl/qopenglfunctions_4_2_compatibility.cpp b/src/gui/opengl/qopenglfunctions_4_2_compatibility.cpp
index 8398ef0948..fcc049c67b 100644
--- a/src/gui/opengl/qopenglfunctions_4_2_compatibility.cpp
+++ b/src/gui/opengl/qopenglfunctions_4_2_compatibility.cpp
@@ -87,7 +87,7 @@ QOpenGLFunctions_4_2_Compatibility::QOpenGLFunctions_4_2_Compatibility()
, d_1_2_Deprecated(0)
, d_1_3_Deprecated(0)
, d_1_4_Deprecated(0)
- , m_reserved_2_0_Deprecated(Q_NULLPTR)
+ , m_reserved_2_0_Deprecated(nullptr)
, d_3_3_Deprecated(0)
{
}
diff --git a/src/gui/opengl/qopenglfunctions_4_2_compatibility.h b/src/gui/opengl/qopenglfunctions_4_2_compatibility.h
index 7b45859984..6726d5fc44 100644
--- a/src/gui/opengl/qopenglfunctions_4_2_compatibility.h
+++ b/src/gui/opengl/qopenglfunctions_4_2_compatibility.h
@@ -65,7 +65,7 @@ public:
QOpenGLFunctions_4_2_Compatibility();
~QOpenGLFunctions_4_2_Compatibility();
- bool initializeOpenGLFunctions() Q_DECL_OVERRIDE;
+ bool initializeOpenGLFunctions() override;
// OpenGL 1.0 core functions
void glViewport(GLint x, GLint y, GLsizei width, GLsizei height);
diff --git a/src/gui/opengl/qopenglfunctions_4_2_core.h b/src/gui/opengl/qopenglfunctions_4_2_core.h
index 80bb33e7d8..a921329741 100644
--- a/src/gui/opengl/qopenglfunctions_4_2_core.h
+++ b/src/gui/opengl/qopenglfunctions_4_2_core.h
@@ -65,7 +65,7 @@ public:
QOpenGLFunctions_4_2_Core();
~QOpenGLFunctions_4_2_Core();
- bool initializeOpenGLFunctions() Q_DECL_OVERRIDE;
+ bool initializeOpenGLFunctions() override;
// OpenGL 1.0 core functions
void glViewport(GLint x, GLint y, GLsizei width, GLsizei height);
diff --git a/src/gui/opengl/qopenglfunctions_4_3_compatibility.cpp b/src/gui/opengl/qopenglfunctions_4_3_compatibility.cpp
index 19e67c6331..131ebc810f 100644
--- a/src/gui/opengl/qopenglfunctions_4_3_compatibility.cpp
+++ b/src/gui/opengl/qopenglfunctions_4_3_compatibility.cpp
@@ -88,7 +88,7 @@ QOpenGLFunctions_4_3_Compatibility::QOpenGLFunctions_4_3_Compatibility()
, d_1_2_Deprecated(0)
, d_1_3_Deprecated(0)
, d_1_4_Deprecated(0)
- , m_reserved_2_0_Deprecated(Q_NULLPTR)
+ , m_reserved_2_0_Deprecated(nullptr)
, d_3_3_Deprecated(0)
{
}
diff --git a/src/gui/opengl/qopenglfunctions_4_3_compatibility.h b/src/gui/opengl/qopenglfunctions_4_3_compatibility.h
index 515467a38d..b9d4eb1d6f 100644
--- a/src/gui/opengl/qopenglfunctions_4_3_compatibility.h
+++ b/src/gui/opengl/qopenglfunctions_4_3_compatibility.h
@@ -65,7 +65,7 @@ public:
QOpenGLFunctions_4_3_Compatibility();
~QOpenGLFunctions_4_3_Compatibility();
- bool initializeOpenGLFunctions() Q_DECL_OVERRIDE;
+ bool initializeOpenGLFunctions() override;
// OpenGL 1.0 core functions
void glViewport(GLint x, GLint y, GLsizei width, GLsizei height);
diff --git a/src/gui/opengl/qopenglfunctions_4_3_core.h b/src/gui/opengl/qopenglfunctions_4_3_core.h
index 4a700c36d7..da552d64af 100644
--- a/src/gui/opengl/qopenglfunctions_4_3_core.h
+++ b/src/gui/opengl/qopenglfunctions_4_3_core.h
@@ -65,7 +65,7 @@ public:
QOpenGLFunctions_4_3_Core();
~QOpenGLFunctions_4_3_Core();
- bool initializeOpenGLFunctions() Q_DECL_OVERRIDE;
+ bool initializeOpenGLFunctions() override;
// OpenGL 1.0 core functions
void glViewport(GLint x, GLint y, GLsizei width, GLsizei height);
diff --git a/src/gui/opengl/qopenglfunctions_4_4_compatibility.h b/src/gui/opengl/qopenglfunctions_4_4_compatibility.h
index f2d640cdaf..7a05bd802d 100644
--- a/src/gui/opengl/qopenglfunctions_4_4_compatibility.h
+++ b/src/gui/opengl/qopenglfunctions_4_4_compatibility.h
@@ -65,7 +65,7 @@ public:
QOpenGLFunctions_4_4_Compatibility();
~QOpenGLFunctions_4_4_Compatibility();
- bool initializeOpenGLFunctions() Q_DECL_OVERRIDE;
+ bool initializeOpenGLFunctions() override;
// OpenGL 1.0 core functions
void glViewport(GLint x, GLint y, GLsizei width, GLsizei height);
diff --git a/src/gui/opengl/qopenglfunctions_4_4_core.h b/src/gui/opengl/qopenglfunctions_4_4_core.h
index bcb7383a9e..6b29a9659b 100644
--- a/src/gui/opengl/qopenglfunctions_4_4_core.h
+++ b/src/gui/opengl/qopenglfunctions_4_4_core.h
@@ -65,7 +65,7 @@ public:
QOpenGLFunctions_4_4_Core();
~QOpenGLFunctions_4_4_Core();
- bool initializeOpenGLFunctions() Q_DECL_OVERRIDE;
+ bool initializeOpenGLFunctions() override;
// OpenGL 1.0 core functions
void glViewport(GLint x, GLint y, GLsizei width, GLsizei height);
diff --git a/src/gui/opengl/qopenglfunctions_4_5_compatibility.h b/src/gui/opengl/qopenglfunctions_4_5_compatibility.h
index b164538686..7a97085a85 100644
--- a/src/gui/opengl/qopenglfunctions_4_5_compatibility.h
+++ b/src/gui/opengl/qopenglfunctions_4_5_compatibility.h
@@ -65,7 +65,7 @@ public:
QOpenGLFunctions_4_5_Compatibility();
~QOpenGLFunctions_4_5_Compatibility();
- bool initializeOpenGLFunctions() Q_DECL_OVERRIDE;
+ bool initializeOpenGLFunctions() override;
// OpenGL 1.0 core functions
void glViewport(GLint x, GLint y, GLsizei width, GLsizei height);
diff --git a/src/gui/opengl/qopenglfunctions_4_5_core.h b/src/gui/opengl/qopenglfunctions_4_5_core.h
index 0940d8cf61..bb1b17f7b1 100644
--- a/src/gui/opengl/qopenglfunctions_4_5_core.h
+++ b/src/gui/opengl/qopenglfunctions_4_5_core.h
@@ -65,7 +65,7 @@ public:
QOpenGLFunctions_4_5_Core();
~QOpenGLFunctions_4_5_Core();
- bool initializeOpenGLFunctions() Q_DECL_OVERRIDE;
+ bool initializeOpenGLFunctions() override;
// OpenGL 1.0 core functions
void glViewport(GLint x, GLint y, GLsizei width, GLsizei height);
diff --git a/src/gui/opengl/qopenglfunctions_es2.h b/src/gui/opengl/qopenglfunctions_es2.h
index 3b7d2806ea..851eb5951b 100644
--- a/src/gui/opengl/qopenglfunctions_es2.h
+++ b/src/gui/opengl/qopenglfunctions_es2.h
@@ -57,7 +57,7 @@ public:
QOpenGLFunctions_ES2();
~QOpenGLFunctions_ES2();
- bool initializeOpenGLFunctions() Q_DECL_OVERRIDE;
+ bool initializeOpenGLFunctions() override;
// OpenGL ES2 core functions
void glActiveTexture(GLenum texture);
diff --git a/src/gui/opengl/qopenglgradientcache_p.h b/src/gui/opengl/qopenglgradientcache_p.h
index a2ed85c061..cbdbbb0c54 100644
--- a/src/gui/opengl/qopenglgradientcache_p.h
+++ b/src/gui/opengl/qopenglgradientcache_p.h
@@ -85,8 +85,8 @@ public:
GLuint getBuffer(const QGradient &gradient, qreal opacity);
inline int paletteSize() const { return 1024; }
- void invalidateResource() Q_DECL_OVERRIDE;
- void freeResource(QOpenGLContext *ctx) Q_DECL_OVERRIDE;
+ void invalidateResource() override;
+ void freeResource(QOpenGLContext *ctx) override;
private:
inline int maxCacheSize() const { return 60; }
diff --git a/src/gui/opengl/qopenglpaintengine_p.h b/src/gui/opengl/qopenglpaintengine_p.h
index 679b3c0557..0541ce6168 100644
--- a/src/gui/opengl/qopenglpaintengine_p.h
+++ b/src/gui/opengl/qopenglpaintengine_p.h
@@ -116,37 +116,37 @@ public:
QOpenGL2PaintEngineEx();
~QOpenGL2PaintEngineEx();
- bool begin(QPaintDevice *device) Q_DECL_OVERRIDE;
+ bool begin(QPaintDevice *device) override;
void ensureActive();
- bool end() Q_DECL_OVERRIDE;
-
- virtual void clipEnabledChanged() Q_DECL_OVERRIDE;
- virtual void penChanged() Q_DECL_OVERRIDE;
- virtual void brushChanged() Q_DECL_OVERRIDE;
- virtual void brushOriginChanged() Q_DECL_OVERRIDE;
- virtual void opacityChanged() Q_DECL_OVERRIDE;
- virtual void compositionModeChanged() Q_DECL_OVERRIDE;
- virtual void renderHintsChanged() Q_DECL_OVERRIDE;
- virtual void transformChanged() Q_DECL_OVERRIDE;
-
- virtual void drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr) Q_DECL_OVERRIDE;
+ bool end() override;
+
+ virtual void clipEnabledChanged() override;
+ virtual void penChanged() override;
+ virtual void brushChanged() override;
+ virtual void brushOriginChanged() override;
+ virtual void opacityChanged() override;
+ virtual void compositionModeChanged() override;
+ virtual void renderHintsChanged() override;
+ virtual void transformChanged() override;
+
+ virtual void drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr) override;
virtual void drawPixmapFragments(const QPainter::PixmapFragment *fragments, int fragmentCount, const QPixmap &pixmap,
- QPainter::PixmapFragmentHints hints) Q_DECL_OVERRIDE;
+ QPainter::PixmapFragmentHints hints) override;
virtual void drawImage(const QRectF &r, const QImage &pm, const QRectF &sr,
- Qt::ImageConversionFlags flags = Qt::AutoColor) Q_DECL_OVERRIDE;
- virtual void drawTextItem(const QPointF &p, const QTextItem &textItem) Q_DECL_OVERRIDE;
- virtual void fill(const QVectorPath &path, const QBrush &brush) Q_DECL_OVERRIDE;
- virtual void stroke(const QVectorPath &path, const QPen &pen) Q_DECL_OVERRIDE;
- virtual void clip(const QVectorPath &path, Qt::ClipOperation op) Q_DECL_OVERRIDE;
+ Qt::ImageConversionFlags flags = Qt::AutoColor) override;
+ virtual void drawTextItem(const QPointF &p, const QTextItem &textItem) override;
+ virtual void fill(const QVectorPath &path, const QBrush &brush) override;
+ virtual void stroke(const QVectorPath &path, const QPen &pen) override;
+ virtual void clip(const QVectorPath &path, Qt::ClipOperation op) override;
- virtual void drawStaticTextItem(QStaticTextItem *textItem) Q_DECL_OVERRIDE;
+ virtual void drawStaticTextItem(QStaticTextItem *textItem) override;
bool drawTexture(const QRectF &r, GLuint textureId, const QSize &size, const QRectF &sr);
- Type type() const Q_DECL_OVERRIDE { return OpenGL2; }
+ Type type() const override { return OpenGL2; }
- virtual void setState(QPainterState *s) Q_DECL_OVERRIDE;
- virtual QPainterState *createState(QPainterState *orig) const Q_DECL_OVERRIDE;
+ virtual void setState(QPainterState *s) override;
+ virtual QPainterState *createState(QPainterState *orig) const override;
inline QOpenGL2PaintEngineState *state() {
return static_cast<QOpenGL2PaintEngineState *>(QPaintEngineEx::state());
}
@@ -154,16 +154,16 @@ public:
return static_cast<const QOpenGL2PaintEngineState *>(QPaintEngineEx::state());
}
- void beginNativePainting() Q_DECL_OVERRIDE;
- void endNativePainting() Q_DECL_OVERRIDE;
+ void beginNativePainting() override;
+ void endNativePainting() override;
void invalidateState();
void setRenderTextActive(bool);
bool isNativePaintingActive() const;
- bool requiresPretransformedGlyphPositions(QFontEngine *, const QTransform &) const Q_DECL_OVERRIDE { return false; }
- bool shouldDrawCachedGlyphs(QFontEngine *, const QTransform &) const Q_DECL_OVERRIDE;
+ bool requiresPretransformedGlyphPositions(QFontEngine *, const QTransform &) const override { return false; }
+ bool shouldDrawCachedGlyphs(QFontEngine *, const QTransform &) const override;
private:
Q_DISABLE_COPY(QOpenGL2PaintEngineEx)
@@ -265,7 +265,7 @@ public:
void updateClipScissorTest();
void setScissor(const QRect &rect);
void regenerateClip();
- void systemStateChanged() Q_DECL_OVERRIDE;
+ void systemStateChanged() override;
void setVertexAttribArrayEnabled(int arrayIndex, bool enabled = true);
void syncGlState();
diff --git a/src/gui/opengl/qopenglshaderprogram.h b/src/gui/opengl/qopenglshaderprogram.h
index fd4d82ecf9..84eb8d6956 100644
--- a/src/gui/opengl/qopenglshaderprogram.h
+++ b/src/gui/opengl/qopenglshaderprogram.h
@@ -79,7 +79,7 @@ public:
};
Q_DECLARE_FLAGS(ShaderType, ShaderTypeBit)
- explicit QOpenGLShader(QOpenGLShader::ShaderType type, QObject *parent = Q_NULLPTR);
+ explicit QOpenGLShader(QOpenGLShader::ShaderType type, QObject *parent = nullptr);
virtual ~QOpenGLShader();
QOpenGLShader::ShaderType shaderType() const;
@@ -96,7 +96,7 @@ public:
GLuint shaderId() const;
- static bool hasOpenGLShaders(ShaderType type, QOpenGLContext *context = Q_NULLPTR);
+ static bool hasOpenGLShaders(ShaderType type, QOpenGLContext *context = nullptr);
private:
friend class QOpenGLShaderProgram;
@@ -114,7 +114,7 @@ class Q_GUI_EXPORT QOpenGLShaderProgram : public QObject
{
Q_OBJECT
public:
- explicit QOpenGLShaderProgram(QObject *parent = Q_NULLPTR);
+ explicit QOpenGLShaderProgram(QObject *parent = nullptr);
virtual ~QOpenGLShaderProgram();
bool addShader(QOpenGLShader *shader);
@@ -306,7 +306,7 @@ public:
void setUniformValueArray(const char *name, const QMatrix4x3 *values, int count);
void setUniformValueArray(const char *name, const QMatrix4x4 *values, int count);
- static bool hasOpenGLShaderPrograms(QOpenGLContext *context = Q_NULLPTR);
+ static bool hasOpenGLShaderPrograms(QOpenGLContext *context = nullptr);
private Q_SLOTS:
void shaderDestroyed();
diff --git a/src/gui/opengl/qopengltexture.h b/src/gui/opengl/qopengltexture.h
index 12d9b91603..c0c5283374 100644
--- a/src/gui/opengl/qopengltexture.h
+++ b/src/gui/opengl/qopengltexture.h
@@ -459,60 +459,60 @@ public:
#if QT_DEPRECATED_SINCE(5, 3)
QT_DEPRECATED void setData(int mipLevel, int layer, CubeMapFace cubeFace,
PixelFormat sourceFormat, PixelType sourceType,
- void *data, const QOpenGLPixelTransferOptions * const options = Q_NULLPTR);
+ void *data, const QOpenGLPixelTransferOptions * const options = nullptr);
QT_DEPRECATED void setData(int mipLevel, int layer,
PixelFormat sourceFormat, PixelType sourceType,
- void *data, const QOpenGLPixelTransferOptions * const options = Q_NULLPTR);
+ void *data, const QOpenGLPixelTransferOptions * const options = nullptr);
QT_DEPRECATED void setData(int mipLevel,
PixelFormat sourceFormat, PixelType sourceType,
- void *data, const QOpenGLPixelTransferOptions * const options = Q_NULLPTR);
+ void *data, const QOpenGLPixelTransferOptions * const options = nullptr);
QT_DEPRECATED void setData(PixelFormat sourceFormat, PixelType sourceType,
- void *data, const QOpenGLPixelTransferOptions * const options = Q_NULLPTR);
+ void *data, const QOpenGLPixelTransferOptions * const options = nullptr);
#endif // QT_DEPRECATED_SINCE(5, 3)
void setData(int mipLevel, int layer, CubeMapFace cubeFace,
PixelFormat sourceFormat, PixelType sourceType,
- const void *data, const QOpenGLPixelTransferOptions * const options = Q_NULLPTR);
+ const void *data, const QOpenGLPixelTransferOptions * const options = nullptr);
void setData(int mipLevel, int layer, int layerCount, CubeMapFace cubeFace,
PixelFormat sourceFormat, PixelType sourceType,
- const void *data, const QOpenGLPixelTransferOptions * const options = Q_NULLPTR);
+ const void *data, const QOpenGLPixelTransferOptions * const options = nullptr);
void setData(int mipLevel, int layer,
PixelFormat sourceFormat, PixelType sourceType,
- const void *data, const QOpenGLPixelTransferOptions * const options = Q_NULLPTR);
+ const void *data, const QOpenGLPixelTransferOptions * const options = nullptr);
void setData(int mipLevel,
PixelFormat sourceFormat, PixelType sourceType,
- const void *data, const QOpenGLPixelTransferOptions * const options = Q_NULLPTR);
+ const void *data, const QOpenGLPixelTransferOptions * const options = nullptr);
void setData(PixelFormat sourceFormat, PixelType sourceType,
- const void *data, const QOpenGLPixelTransferOptions * const options = Q_NULLPTR);
+ const void *data, const QOpenGLPixelTransferOptions * const options = nullptr);
// Compressed data upload
// ### Qt 6: remove the non-const void * overloads
#if QT_DEPRECATED_SINCE(5, 3)
QT_DEPRECATED void setCompressedData(int mipLevel, int layer, CubeMapFace cubeFace,
int dataSize, void *data,
- const QOpenGLPixelTransferOptions * const options = Q_NULLPTR);
+ const QOpenGLPixelTransferOptions * const options = nullptr);
QT_DEPRECATED void setCompressedData(int mipLevel, int layer,
int dataSize, void *data,
- const QOpenGLPixelTransferOptions * const options = Q_NULLPTR);
+ const QOpenGLPixelTransferOptions * const options = nullptr);
QT_DEPRECATED void setCompressedData(int mipLevel, int dataSize, void *data,
- const QOpenGLPixelTransferOptions * const options = Q_NULLPTR);
+ const QOpenGLPixelTransferOptions * const options = nullptr);
QT_DEPRECATED void setCompressedData(int dataSize, void *data,
- const QOpenGLPixelTransferOptions * const options = Q_NULLPTR);
+ const QOpenGLPixelTransferOptions * const options = nullptr);
#endif // QT_DEPRECATED_SINCE(5, 3)
void setCompressedData(int mipLevel, int layer, CubeMapFace cubeFace,
int dataSize, const void *data,
- const QOpenGLPixelTransferOptions * const options = Q_NULLPTR);
+ const QOpenGLPixelTransferOptions * const options = nullptr);
void setCompressedData(int mipLevel, int layer, int layerCount, CubeMapFace cubeFace,
int dataSize, const void *data,
- const QOpenGLPixelTransferOptions * const options = Q_NULLPTR);
+ const QOpenGLPixelTransferOptions * const options = nullptr);
void setCompressedData(int mipLevel, int layer,
int dataSize, const void *data,
- const QOpenGLPixelTransferOptions * const options = Q_NULLPTR);
+ const QOpenGLPixelTransferOptions * const options = nullptr);
void setCompressedData(int mipLevel, int dataSize, const void *data,
- const QOpenGLPixelTransferOptions * const options = Q_NULLPTR);
+ const QOpenGLPixelTransferOptions * const options = nullptr);
void setCompressedData(int dataSize, const void *data,
- const QOpenGLPixelTransferOptions * const options = Q_NULLPTR);
+ const QOpenGLPixelTransferOptions * const options = nullptr);
// Helpful overloads for setData
void setData(const QImage& image, MipMapGeneration genMipMaps = GenerateMipMaps);
diff --git a/src/gui/opengl/qopengltexturecache_p.h b/src/gui/opengl/qopengltexturecache_p.h
index 4a438c8d95..b9d7df91e3 100644
--- a/src/gui/opengl/qopengltexturecache_p.h
+++ b/src/gui/opengl/qopengltexturecache_p.h
@@ -82,8 +82,8 @@ public:
void invalidate(qint64 key);
- void invalidateResource() Q_DECL_OVERRIDE;
- void freeResource(QOpenGLContext *ctx) Q_DECL_OVERRIDE;
+ void invalidateResource() override;
+ void freeResource(QOpenGLContext *ctx) override;
private:
GLuint bindTexture(QOpenGLContext *context, qint64 key, const QImage &image, QOpenGLTextureCache::BindOptions options);
diff --git a/src/gui/opengl/qopengltextureglyphcache_p.h b/src/gui/opengl/qopengltextureglyphcache_p.h
index 6a1550dbed..0b7b5f6082 100644
--- a/src/gui/opengl/qopengltextureglyphcache_p.h
+++ b/src/gui/opengl/qopengltextureglyphcache_p.h
@@ -81,7 +81,7 @@ public:
#endif
}
- void freeResource(QOpenGLContext *context) Q_DECL_OVERRIDE
+ void freeResource(QOpenGLContext *context) override
{
QOpenGLContext *ctx = context;
#ifdef QT_GL_TEXTURE_GLYPH_CACHE_DEBUG
@@ -93,7 +93,7 @@ public:
ctx->functions()->glDeleteTextures(1, &m_texture);
}
- void invalidateResource() Q_DECL_OVERRIDE
+ void invalidateResource() override
{
m_texture = 0;
m_fbo = 0;
@@ -113,12 +113,12 @@ public:
QOpenGLTextureGlyphCache(QFontEngine::GlyphFormat glyphFormat, const QTransform &matrix);
~QOpenGLTextureGlyphCache();
- virtual void createTextureData(int width, int height) Q_DECL_OVERRIDE;
- virtual void resizeTextureData(int width, int height) Q_DECL_OVERRIDE;
- virtual void fillTexture(const Coord &c, glyph_t glyph, QFixed subPixelPosition) Q_DECL_OVERRIDE;
- virtual int glyphPadding() const Q_DECL_OVERRIDE;
- virtual int maxTextureWidth() const Q_DECL_OVERRIDE;
- virtual int maxTextureHeight() const Q_DECL_OVERRIDE;
+ virtual void createTextureData(int width, int height) override;
+ virtual void resizeTextureData(int width, int height) override;
+ virtual void fillTexture(const Coord &c, glyph_t glyph, QFixed subPixelPosition) override;
+ virtual int glyphPadding() const override;
+ virtual int maxTextureWidth() const override;
+ virtual int maxTextureHeight() const override;
inline GLuint texture() const {
QOpenGLTextureGlyphCache *that = const_cast<QOpenGLTextureGlyphCache *>(this);
diff --git a/src/gui/opengl/qopengltimerquery.h b/src/gui/opengl/qopengltimerquery.h
index 7b9ab850e2..27da74a3fb 100644
--- a/src/gui/opengl/qopengltimerquery.h
+++ b/src/gui/opengl/qopengltimerquery.h
@@ -56,7 +56,7 @@ class Q_GUI_EXPORT QOpenGLTimerQuery : public QObject
Q_OBJECT
public:
- explicit QOpenGLTimerQuery(QObject *parent = Q_NULLPTR);
+ explicit QOpenGLTimerQuery(QObject *parent = nullptr);
~QOpenGLTimerQuery();
bool create();
@@ -84,7 +84,7 @@ class Q_GUI_EXPORT QOpenGLTimeMonitor : public QObject
Q_OBJECT
public:
- explicit QOpenGLTimeMonitor(QObject *parent = Q_NULLPTR);
+ explicit QOpenGLTimeMonitor(QObject *parent = nullptr);
~QOpenGLTimeMonitor();
void setSampleCount(int sampleCount);
diff --git a/src/gui/opengl/qopenglversionfunctions.h b/src/gui/opengl/qopenglversionfunctions.h
index 63209cf392..3af1ed0466 100644
--- a/src/gui/opengl/qopenglversionfunctions.h
+++ b/src/gui/opengl/qopenglversionfunctions.h
@@ -193,7 +193,7 @@ class QAbstractOpenGLFunctionsPrivate
{
public:
QAbstractOpenGLFunctionsPrivate()
- : owningContext(Q_NULLPTR),
+ : owningContext(nullptr),
initialized(false)
{}
diff --git a/src/gui/opengl/qopenglvertexarrayobject.h b/src/gui/opengl/qopenglvertexarrayobject.h
index a8153ea40b..b81ae6a2a9 100644
--- a/src/gui/opengl/qopenglvertexarrayobject.h
+++ b/src/gui/opengl/qopenglvertexarrayobject.h
@@ -56,7 +56,7 @@ class Q_GUI_EXPORT QOpenGLVertexArrayObject : public QObject
Q_OBJECT
public:
- explicit QOpenGLVertexArrayObject(QObject* parent = Q_NULLPTR);
+ explicit QOpenGLVertexArrayObject(QObject* parent = nullptr);
~QOpenGLVertexArrayObject();
bool create();
diff --git a/src/gui/opengl/qopenglvertexarrayobject_p.h b/src/gui/opengl/qopenglvertexarrayobject_p.h
index 937921765b..fd3a6f0f89 100644
--- a/src/gui/opengl/qopenglvertexarrayobject_p.h
+++ b/src/gui/opengl/qopenglvertexarrayobject_p.h
@@ -70,10 +70,10 @@ class QOpenGLVertexArrayObjectHelper
public:
explicit inline QOpenGLVertexArrayObjectHelper(QOpenGLContext *context)
- : GenVertexArrays(Q_NULLPTR)
- , DeleteVertexArrays(Q_NULLPTR)
- , BindVertexArray(Q_NULLPTR)
- , IsVertexArray(Q_NULLPTR)
+ : GenVertexArrays(nullptr)
+ , DeleteVertexArrays(nullptr)
+ , BindVertexArray(nullptr)
+ , IsVertexArray(nullptr)
{
qtInitializeVertexArrayObjectHelper(this, context);
}
diff --git a/src/gui/painting/qcolor.h b/src/gui/painting/qcolor.h
index 0c5ebcbda9..f7a9e9db59 100644
--- a/src/gui/painting/qcolor.h
+++ b/src/gui/painting/qcolor.h
@@ -129,10 +129,10 @@ public:
void setGreenF(qreal green);
void setBlueF(qreal blue);
- void getRgb(int *r, int *g, int *b, int *a = Q_NULLPTR) const;
+ void getRgb(int *r, int *g, int *b, int *a = nullptr) const;
void setRgb(int r, int g, int b, int a = 255);
- void getRgbF(qreal *r, qreal *g, qreal *b, qreal *a = Q_NULLPTR) const;
+ void getRgbF(qreal *r, qreal *g, qreal *b, qreal *a = nullptr) const;
void setRgbF(qreal r, qreal g, qreal b, qreal a = 1.0);
QRgba64 rgba64() const Q_DECL_NOTHROW;
@@ -156,10 +156,10 @@ public:
qreal hsvSaturationF() const Q_DECL_NOTHROW;
qreal valueF() const Q_DECL_NOTHROW;
- void getHsv(int *h, int *s, int *v, int *a = Q_NULLPTR) const;
+ void getHsv(int *h, int *s, int *v, int *a = nullptr) const;
void setHsv(int h, int s, int v, int a = 255);
- void getHsvF(qreal *h, qreal *s, qreal *v, qreal *a = Q_NULLPTR) const;
+ void getHsvF(qreal *h, qreal *s, qreal *v, qreal *a = nullptr) const;
void setHsvF(qreal h, qreal s, qreal v, qreal a = 1.0);
int cyan() const Q_DECL_NOTHROW;
@@ -172,10 +172,10 @@ public:
qreal yellowF() const Q_DECL_NOTHROW;
qreal blackF() const Q_DECL_NOTHROW;
- void getCmyk(int *c, int *m, int *y, int *k, int *a = Q_NULLPTR);
+ void getCmyk(int *c, int *m, int *y, int *k, int *a = nullptr);
void setCmyk(int c, int m, int y, int k, int a = 255);
- void getCmykF(qreal *c, qreal *m, qreal *y, qreal *k, qreal *a = Q_NULLPTR);
+ void getCmykF(qreal *c, qreal *m, qreal *y, qreal *k, qreal *a = nullptr);
void setCmykF(qreal c, qreal m, qreal y, qreal k, qreal a = 1.0);
int hslHue() const Q_DECL_NOTHROW; // 0 <= hue < 360
@@ -186,10 +186,10 @@ public:
qreal hslSaturationF() const Q_DECL_NOTHROW;
qreal lightnessF() const Q_DECL_NOTHROW;
- void getHsl(int *h, int *s, int *l, int *a = Q_NULLPTR) const;
+ void getHsl(int *h, int *s, int *l, int *a = nullptr) const;
void setHsl(int h, int s, int l, int a = 255);
- void getHslF(qreal *h, qreal *s, qreal *l, qreal *a = Q_NULLPTR) const;
+ void getHslF(qreal *h, qreal *s, qreal *l, qreal *a = nullptr) const;
void setHslF(qreal h, qreal s, qreal l, qreal a = 1.0);
QColor toRgb() const Q_DECL_NOTHROW;
diff --git a/src/gui/painting/qcompositionfunctions.cpp b/src/gui/painting/qcompositionfunctions.cpp
index ee05f810f1..339a9749b8 100644
--- a/src/gui/painting/qcompositionfunctions.cpp
+++ b/src/gui/painting/qcompositionfunctions.cpp
@@ -38,16 +38,11 @@
****************************************************************************/
#include <qglobal.h>
-#include <private/qdrawhelper_p.h>
-#include <private/qrgba64_p.h>
+#include "qdrawhelper_p.h"
+#include "qrgba64_p.h"
QT_BEGIN_NAMESPACE
-# define PRELOAD_INIT(x)
-# define PRELOAD_INIT2(x,y)
-# define PRELOAD_COND(x)
-# define PRELOAD_COND2(x,y)
-
/* The constant alpha factor describes an alpha factor that gets applied
to the result of the composition operation combining it with the destination.
@@ -69,24 +64,6 @@ QT_BEGIN_NAMESPACE
where the source is an array of pixels.
*/
-/*
- result = 0
- d = d * cia
-*/
-#define comp_func_Clear_impl(dest, length, const_alpha)\
-{\
- if (const_alpha == 255) {\
- QT_MEMFILL_UINT(dest, length, 0);\
- } else {\
- int ialpha = 255 - const_alpha;\
- PRELOAD_INIT(dest)\
- for (int i = 0; i < length; ++i) {\
- PRELOAD_COND(dest)\
- dest[i] = BYTE_MUL(dest[i], ialpha);\
- }\
- }\
-}
-
#if defined __SSE2__
# define LOAD(ptr) _mm_loadl_epi64(reinterpret_cast<const __m128i *>(ptr))
#ifdef Q_PROCESSOR_X86_64
@@ -117,38 +94,41 @@ QT_BEGIN_NAMESPACE
# define INVALPHA(c) (65535 - ALPHA(c))
#endif
+
+/*
+ result = 0
+ d = d * cia
+*/
void QT_FASTCALL comp_func_solid_Clear(uint *dest, int length, uint, uint const_alpha)
{
- comp_func_Clear_impl(dest, length, const_alpha);
+ if (const_alpha == 255) {
+ qt_memfill32(dest, 0, length);
+ } else {
+ uint ialpha = 255 - const_alpha;
+ for (int i = 0; i < length; ++i)
+ dest[i] = BYTE_MUL(dest[i], ialpha);
+ }
}
void QT_FASTCALL comp_func_solid_Clear_rgb64(QRgba64 *dest, int length, QRgba64, uint const_alpha)
{
- if (const_alpha == 255)
+ if (const_alpha == 255) {
qt_memfill64((quint64*)dest, 0, length);
- else {
- int ialpha = 255 - const_alpha;
- for (int i = 0; i < length; ++i) {
+ } else {
+ uint ialpha = 255 - const_alpha;
+ for (int i = 0; i < length; ++i)
STORE(&dest[i], multiplyAlpha255(LOAD(&dest[i]), ialpha));
- }
}
}
void QT_FASTCALL comp_func_Clear(uint *dest, const uint *, int length, uint const_alpha)
{
- comp_func_Clear_impl(dest, length, const_alpha);
+ comp_func_solid_Clear(dest, length, 0, const_alpha);
}
void QT_FASTCALL comp_func_Clear_rgb64(QRgba64 *dest, const QRgba64 *, int length, uint const_alpha)
{
- if (const_alpha == 255)
- qt_memfill64((quint64*)dest, 0, length);
- else {
- int ialpha = 255 - const_alpha;
- for (int i = 0; i < length; ++i) {
- STORE(&dest[i], multiplyAlpha255(LOAD(&dest[i]), ialpha));
- }
- }
+ comp_func_solid_Clear_rgb64(dest, length, QRgba64(), const_alpha);
}
/*
@@ -158,13 +138,11 @@ void QT_FASTCALL comp_func_Clear_rgb64(QRgba64 *dest, const QRgba64 *, int lengt
void QT_FASTCALL comp_func_solid_Source(uint *dest, int length, uint color, uint const_alpha)
{
if (const_alpha == 255) {
- QT_MEMFILL_UINT(dest, length, color);
+ qt_memfill32(dest, color, length);
} else {
- int ialpha = 255 - const_alpha;
+ uint ialpha = 255 - const_alpha;
color = BYTE_MUL(color, const_alpha);
- PRELOAD_INIT(dest)
for (int i = 0; i < length; ++i) {
- PRELOAD_COND(dest)
dest[i] = color + BYTE_MUL(dest[i], ialpha);
}
}
@@ -175,7 +153,7 @@ void QT_FASTCALL comp_func_solid_Source_rgb64(QRgba64 *dest, int length, QRgba64
if (const_alpha == 255)
qt_memfill64((quint64*)dest, color, length);
else {
- int ialpha = 255 - const_alpha;
+ uint ialpha = 255 - const_alpha;
auto c = multiplyAlpha255(CONVERT(color), const_alpha);
for (int i = 0; i < length; ++i) {
STORE(&dest[i], ADD(c, multiplyAlpha255(LOAD(&dest[i]), ialpha)));
@@ -186,12 +164,10 @@ void QT_FASTCALL comp_func_solid_Source_rgb64(QRgba64 *dest, int length, QRgba64
void QT_FASTCALL comp_func_Source(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
{
if (const_alpha == 255) {
- ::memcpy(dest, src, length * sizeof(uint));
+ ::memcpy(dest, src, size_t(length) * sizeof(uint));
} else {
- int ialpha = 255 - const_alpha;
- PRELOAD_INIT2(dest, src)
+ uint ialpha = 255 - const_alpha;
for (int i = 0; i < length; ++i) {
- PRELOAD_COND2(dest, src)
dest[i] = INTERPOLATE_PIXEL_255(src[i], const_alpha, dest[i], ialpha);
}
}
@@ -200,9 +176,9 @@ void QT_FASTCALL comp_func_Source(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL
void QT_FASTCALL comp_func_Source_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const QRgba64 *Q_DECL_RESTRICT src, int length, uint const_alpha)
{
if (const_alpha == 255)
- ::memcpy(dest, src, length * sizeof(quint64));
+ ::memcpy(dest, src, size_t(length) * sizeof(quint64));
else {
- int ialpha = 255 - const_alpha;
+ uint ialpha = 255 - const_alpha;
for (int i = 0; i < length; ++i) {
STORE(&dest[i], interpolate255(LOAD(&src[i]), const_alpha, LOAD(&dest[i]), ialpha));
}
@@ -234,13 +210,11 @@ void QT_FASTCALL comp_func_Destination_rgb64(QRgba64 *, const QRgba64 *, int, ui
void QT_FASTCALL comp_func_solid_SourceOver(uint *dest, int length, uint color, uint const_alpha)
{
if ((const_alpha & qAlpha(color)) == 255) {
- QT_MEMFILL_UINT(dest, length, color);
+ qt_memfill32(dest, color, length);
} else {
if (const_alpha != 255)
color = BYTE_MUL(color, const_alpha);
- PRELOAD_INIT(dest)
for (int i = 0; i < length; ++i) {
- PRELOAD_COND(dest)
dest[i] = color + BYTE_MUL(dest[i], qAlpha(~color));
}
}
@@ -263,10 +237,8 @@ void QT_FASTCALL comp_func_solid_SourceOver_rgb64(QRgba64 *dest, int length, QRg
void QT_FASTCALL comp_func_SourceOver(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
{
- PRELOAD_INIT2(dest, src)
if (const_alpha == 255) {
for (int i = 0; i < length; ++i) {
- PRELOAD_COND2(dest, src)
uint s = src[i];
if (s >= 0xff000000)
dest[i] = s;
@@ -275,7 +247,6 @@ void QT_FASTCALL comp_func_SourceOver(uint *Q_DECL_RESTRICT dest, const uint *Q_
}
} else {
for (int i = 0; i < length; ++i) {
- PRELOAD_COND2(dest, src)
uint s = BYTE_MUL(src[i], const_alpha);
dest[i] = s + BYTE_MUL(dest[i], qAlpha(~s));
}
@@ -309,9 +280,7 @@ void QT_FASTCALL comp_func_solid_DestinationOver(uint *dest, int length, uint co
{
if (const_alpha != 255)
color = BYTE_MUL(color, const_alpha);
- PRELOAD_INIT(dest)
for (int i = 0; i < length; ++i) {
- PRELOAD_COND(dest)
uint d = dest[i];
dest[i] = d + BYTE_MUL(color, qAlpha(~d));
}
@@ -330,16 +299,13 @@ void QT_FASTCALL comp_func_solid_DestinationOver_rgb64(QRgba64 *dest, int length
void QT_FASTCALL comp_func_DestinationOver(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
{
- PRELOAD_INIT2(dest, src)
if (const_alpha == 255) {
for (int i = 0; i < length; ++i) {
- PRELOAD_COND2(dest, src)
uint d = dest[i];
dest[i] = d + BYTE_MUL(src[i], qAlpha(~d));
}
} else {
for (int i = 0; i < length; ++i) {
- PRELOAD_COND2(dest, src)
uint d = dest[i];
uint s = BYTE_MUL(src[i], const_alpha);
dest[i] = d + BYTE_MUL(s, qAlpha(~d));
@@ -369,17 +335,14 @@ void QT_FASTCALL comp_func_DestinationOver_rgb64(QRgba64 *Q_DECL_RESTRICT dest,
*/
void QT_FASTCALL comp_func_solid_SourceIn(uint *dest, int length, uint color, uint const_alpha)
{
- PRELOAD_INIT(dest)
if (const_alpha == 255) {
for (int i = 0; i < length; ++i) {
- PRELOAD_COND(dest)
dest[i] = BYTE_MUL(color, qAlpha(dest[i]));
}
} else {
color = BYTE_MUL(color, const_alpha);
uint cia = 255 - const_alpha;
for (int i = 0; i < length; ++i) {
- PRELOAD_COND(dest)
uint d = dest[i];
dest[i] = INTERPOLATE_PIXEL_255(color, qAlpha(d), d, cia);
}
@@ -389,32 +352,30 @@ void QT_FASTCALL comp_func_solid_SourceIn(uint *dest, int length, uint color, ui
void QT_FASTCALL comp_func_solid_SourceIn_rgb64(QRgba64 *dest, int length, QRgba64 color, uint const_alpha)
{
if (const_alpha == 255) {
+ auto c = CONVERT(color);
for (int i = 0; i < length; ++i) {
- dest[i] = multiplyAlpha65535(color, dest[i].alpha());
+ STORE(&dest[i], multiplyAlpha65535(c, dest[i].alpha()));
}
} else {
uint ca = const_alpha * 257;
- uint cia = 65535 - ca;
- color = multiplyAlpha65535(color, ca);
+ auto cia = CONST(65535 - ca);
+ auto c = multiplyAlpha65535(CONVERT(color), ca);
for (int i = 0; i < length; ++i) {
- QRgba64 d = dest[i];
- dest[i] = interpolate65535(color, d.alpha(), d, cia);
+ auto d = LOAD(&dest[i]);
+ STORE(&dest[i], interpolate65535(c, ALPHA(d), d, cia));
}
}
}
void QT_FASTCALL comp_func_SourceIn(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
{
- PRELOAD_INIT2(dest, src)
if (const_alpha == 255) {
for (int i = 0; i < length; ++i) {
- PRELOAD_COND2(dest, src)
dest[i] = BYTE_MUL(src[i], qAlpha(dest[i]));
}
} else {
uint cia = 255 - const_alpha;
for (int i = 0; i < length; ++i) {
- PRELOAD_COND2(dest, src)
uint d = dest[i];
uint s = BYTE_MUL(src[i], const_alpha);
dest[i] = INTERPOLATE_PIXEL_255(s, qAlpha(d), d, cia);
@@ -450,9 +411,7 @@ void QT_FASTCALL comp_func_solid_DestinationIn(uint *dest, int length, uint colo
if (const_alpha != 255) {
a = BYTE_MUL(a, const_alpha) + 255 - const_alpha;
}
- PRELOAD_INIT(dest)
for (int i = 0; i < length; ++i) {
- PRELOAD_COND(dest)
dest[i] = BYTE_MUL(dest[i], a);
}
}
@@ -470,16 +429,13 @@ void QT_FASTCALL comp_func_solid_DestinationIn_rgb64(QRgba64 *dest, int length,
void QT_FASTCALL comp_func_DestinationIn(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
{
- PRELOAD_INIT2(dest, src)
if (const_alpha == 255) {
for (int i = 0; i < length; ++i) {
- PRELOAD_COND2(dest, src)
dest[i] = BYTE_MUL(dest[i], qAlpha(src[i]));
}
} else {
- int cia = 255 - const_alpha;
+ uint cia = 255 - const_alpha;
for (int i = 0; i < length; ++i) {
- PRELOAD_COND2(dest, src)
uint a = BYTE_MUL(qAlpha(src[i]), const_alpha) + cia;
dest[i] = BYTE_MUL(dest[i], a);
}
@@ -490,14 +446,14 @@ void QT_FASTCALL comp_func_DestinationIn_rgb64(QRgba64 *Q_DECL_RESTRICT dest, co
{
if (const_alpha == 255) {
for (int i = 0; i < length; ++i) {
- dest[i] = multiplyAlpha65535(dest[i], src[i].alpha());
+ STORE(&dest[i], multiplyAlpha65535(LOAD(&dest[i]), src[i].alpha()));
}
} else {
uint ca = const_alpha * 257;
uint cia = 65535 - ca;
for (int i = 0; i < length; ++i) {
uint a = qt_div_65535(src[i].alpha() * ca) + cia;
- dest[i] = multiplyAlpha65535(dest[i], a);
+ STORE(&dest[i], multiplyAlpha65535(LOAD(&dest[i]), a));
}
}
}
@@ -509,17 +465,14 @@ void QT_FASTCALL comp_func_DestinationIn_rgb64(QRgba64 *Q_DECL_RESTRICT dest, co
void QT_FASTCALL comp_func_solid_SourceOut(uint *dest, int length, uint color, uint const_alpha)
{
- PRELOAD_INIT(dest)
if (const_alpha == 255) {
for (int i = 0; i < length; ++i) {
- PRELOAD_COND(dest)
dest[i] = BYTE_MUL(color, qAlpha(~dest[i]));
}
} else {
color = BYTE_MUL(color, const_alpha);
- int cia = 255 - const_alpha;
+ uint cia = 255 - const_alpha;
for (int i = 0; i < length; ++i) {
- PRELOAD_COND(dest)
uint d = dest[i];
dest[i] = INTERPOLATE_PIXEL_255(color, qAlpha(~d), d, cia);
}
@@ -545,16 +498,13 @@ void QT_FASTCALL comp_func_solid_SourceOut_rgb64(QRgba64 *dest, int length, QRgb
void QT_FASTCALL comp_func_SourceOut(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
{
- PRELOAD_INIT2(dest, src)
if (const_alpha == 255) {
for (int i = 0; i < length; ++i) {
- PRELOAD_COND2(dest, src)
dest[i] = BYTE_MUL(src[i], qAlpha(~dest[i]));
}
} else {
- int cia = 255 - const_alpha;
+ uint cia = 255 - const_alpha;
for (int i = 0; i < length; ++i) {
- PRELOAD_COND2(dest, src)
uint s = BYTE_MUL(src[i], const_alpha);
uint d = dest[i];
dest[i] = INTERPOLATE_PIXEL_255(s, qAlpha(~d), d, cia);
@@ -589,9 +539,7 @@ void QT_FASTCALL comp_func_solid_DestinationOut(uint *dest, int length, uint col
uint a = qAlpha(~color);
if (const_alpha != 255)
a = BYTE_MUL(a, const_alpha) + 255 - const_alpha;
- PRELOAD_INIT(dest)
for (int i = 0; i < length; ++i) {
- PRELOAD_COND(dest)
dest[i] = BYTE_MUL(dest[i], a);
}
}
@@ -609,16 +557,13 @@ void QT_FASTCALL comp_func_solid_DestinationOut_rgb64(QRgba64 *dest, int length,
void QT_FASTCALL comp_func_DestinationOut(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
{
- PRELOAD_INIT2(dest, src)
if (const_alpha == 255) {
for (int i = 0; i < length; ++i) {
- PRELOAD_COND2(dest, src)
dest[i] = BYTE_MUL(dest[i], qAlpha(~src[i]));
}
} else {
- int cia = 255 - const_alpha;
+ uint cia = 255 - const_alpha;
for (int i = 0; i < length; ++i) {
- PRELOAD_COND2(dest, src)
uint sia = BYTE_MUL(qAlpha(~src[i]), const_alpha) + cia;
dest[i] = BYTE_MUL(dest[i], sia);
}
@@ -653,9 +598,7 @@ void QT_FASTCALL comp_func_solid_SourceAtop(uint *dest, int length, uint color,
color = BYTE_MUL(color, const_alpha);
}
uint sia = qAlpha(~color);
- PRELOAD_INIT(dest)
for (int i = 0; i < length; ++i) {
- PRELOAD_COND(dest)
dest[i] = INTERPOLATE_PIXEL_255(color, qAlpha(dest[i]), dest[i], sia);
}
}
@@ -672,17 +615,14 @@ void QT_FASTCALL comp_func_solid_SourceAtop_rgb64(QRgba64 *dest, int length, QRg
void QT_FASTCALL comp_func_SourceAtop(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
{
- PRELOAD_INIT2(dest, src)
if (const_alpha == 255) {
for (int i = 0; i < length; ++i) {
- PRELOAD_COND2(dest, src)
uint s = src[i];
uint d = dest[i];
dest[i] = INTERPOLATE_PIXEL_255(s, qAlpha(d), d, qAlpha(~s));
}
} else {
for (int i = 0; i < length; ++i) {
- PRELOAD_COND2(dest, src)
uint s = BYTE_MUL(src[i], const_alpha);
uint d = dest[i];
dest[i] = INTERPOLATE_PIXEL_255(s, qAlpha(d), d, qAlpha(~s));
@@ -719,9 +659,7 @@ void QT_FASTCALL comp_func_solid_DestinationAtop(uint *dest, int length, uint co
color = BYTE_MUL(color, const_alpha);
a = qAlpha(color) + 255 - const_alpha;
}
- PRELOAD_INIT(dest)
for (int i = 0; i < length; ++i) {
- PRELOAD_COND(dest)
uint d = dest[i];
dest[i] = INTERPOLATE_PIXEL_255(d, a, color, qAlpha(~d));
}
@@ -742,18 +680,15 @@ void QT_FASTCALL comp_func_solid_DestinationAtop_rgb64(QRgba64 *dest, int length
void QT_FASTCALL comp_func_DestinationAtop(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
{
- PRELOAD_INIT2(dest, src)
if (const_alpha == 255) {
for (int i = 0; i < length; ++i) {
- PRELOAD_COND2(dest, src)
uint s = src[i];
uint d = dest[i];
dest[i] = INTERPOLATE_PIXEL_255(d, qAlpha(s), s, qAlpha(~d));
}
} else {
- int cia = 255 - const_alpha;
+ uint cia = 255 - const_alpha;
for (int i = 0; i < length; ++i) {
- PRELOAD_COND2(dest, src)
uint s = BYTE_MUL(src[i], const_alpha);
uint d = dest[i];
uint a = qAlpha(s) + cia;
@@ -771,8 +706,8 @@ void QT_FASTCALL comp_func_DestinationAtop_rgb64(QRgba64 *Q_DECL_RESTRICT dest,
dest[i] = interpolate65535(d, s.alpha(), s, 65535 - d.alpha());
}
} else {
- int ca = const_alpha * 257;
- int cia = 65535 - ca;
+ uint ca = const_alpha * 257;
+ uint cia = 65535 - ca;
for (int i = 0; i < length; ++i) {
QRgba64 s = multiplyAlpha65535(src[i], ca);
QRgba64 d = dest[i];
@@ -794,9 +729,7 @@ void QT_FASTCALL comp_func_solid_XOR(uint *dest, int length, uint color, uint co
color = BYTE_MUL(color, const_alpha);
uint sia = qAlpha(~color);
- PRELOAD_INIT(dest)
for (int i = 0; i < length; ++i) {
- PRELOAD_COND(dest)
uint d = dest[i];
dest[i] = INTERPOLATE_PIXEL_255(color, qAlpha(~d), d, sia);
}
@@ -806,26 +739,24 @@ void QT_FASTCALL comp_func_solid_XOR_rgb64(QRgba64 *dest, int length, QRgba64 co
{
if (const_alpha != 255)
color = multiplyAlpha255(color, const_alpha);
- uint sia = 65535 - color.alpha();
+ auto s = CONVERT(color);
+ auto sia = CONST(65535 - color.alpha());
for (int i = 0; i < length; ++i) {
- QRgba64 d = dest[i];
- dest[i] = interpolate65535(color, 65535 - d.alpha(), d, sia);
+ auto d = LOAD(&dest[i]);
+ STORE(&dest[i], interpolate65535(s, INVALPHA(d), d, sia));
}
}
void QT_FASTCALL comp_func_XOR(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
{
- PRELOAD_INIT2(dest, src)
if (const_alpha == 255) {
for (int i = 0; i < length; ++i) {
- PRELOAD_COND2(dest, src)
uint d = dest[i];
uint s = src[i];
dest[i] = INTERPOLATE_PIXEL_255(s, qAlpha(~d), d, qAlpha(~s));
}
} else {
for (int i = 0; i < length; ++i) {
- PRELOAD_COND2(dest, src)
uint d = dest[i];
uint s = BYTE_MUL(src[i], const_alpha);
dest[i] = INTERPOLATE_PIXEL_255(s, qAlpha(~d), d, qAlpha(~s));
@@ -837,15 +768,15 @@ void QT_FASTCALL comp_func_XOR_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const QRgba6
{
if (const_alpha == 255) {
for (int i = 0; i < length; ++i) {
- QRgba64 d = dest[i];
- QRgba64 s = src[i];
- dest[i] = interpolate65535(s, 65535 - d.alpha(), d, 65535 - s.alpha());
+ auto d = LOAD(&dest[i]);
+ auto s = LOAD(&src[i]);
+ STORE(&dest[i], interpolate65535(s, INVALPHA(d), d, INVALPHA(s)));
}
} else {
for (int i = 0; i < length; ++i) {
- QRgba64 d = dest[i];
- QRgba64 s = multiplyAlpha255(src[i], const_alpha);
- dest[i] = interpolate65535(s, 65535 - d.alpha(), d, 65535 - s.alpha());
+ auto d = LOAD(&dest[i]);
+ auto s = multiplyAlpha255(LOAD(&src[i]), const_alpha);
+ STORE(&dest[i], interpolate65535(s, INVALPHA(d), d, INVALPHA(s)));
}
}
}
@@ -901,9 +832,7 @@ Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_Plus_impl(uint *dest, int
{
uint s = color;
- PRELOAD_INIT(dest)
for (int i = 0; i < length; ++i) {
- PRELOAD_COND(dest)
uint d = dest[i];
d = comp_func_Plus_one_pixel(d, s);
coverage.store(&dest[i], d);
@@ -940,9 +869,7 @@ void QT_FASTCALL comp_func_solid_Plus_rgb64(QRgba64 *dest, int length, QRgba64 c
template <typename T>
Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_Plus_impl(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, const T &coverage)
{
- PRELOAD_INIT2(dest, src)
for (int i = 0; i < length; ++i) {
- PRELOAD_COND2(dest, src)
uint d = dest[i];
uint s = src[i];
@@ -1001,9 +928,7 @@ Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_Multiply_impl(uint *dest,
int sg = qGreen(color);
int sb = qBlue(color);
- PRELOAD_INIT(dest)
for (int i = 0; i < length; ++i) {
- PRELOAD_COND(dest)
uint d = dest[i];
int da = qAlpha(d);
@@ -1060,9 +985,7 @@ void QT_FASTCALL comp_func_solid_Multiply_rgb64(QRgba64 *dest, int length, QRgba
template <typename T>
Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_Multiply_impl(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, const T &coverage)
{
- PRELOAD_INIT2(dest, src)
for (int i = 0; i < length; ++i) {
- PRELOAD_COND2(dest, src)
uint d = dest[i];
uint s = src[i];
@@ -1129,9 +1052,7 @@ Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_Screen_impl(uint *dest, i
int sg = qGreen(color);
int sb = qBlue(color);
- PRELOAD_INIT(dest)
for (int i = 0; i < length; ++i) {
- PRELOAD_COND(dest)
uint d = dest[i];
int da = qAlpha(d);
@@ -1188,9 +1109,7 @@ void QT_FASTCALL comp_func_solid_Screen_rgb64(QRgba64 *dest, int length, QRgba64
template <typename T>
Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_Screen_impl(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, const T &coverage)
{
- PRELOAD_INIT2(dest, src)
for (int i = 0; i < length; ++i) {
- PRELOAD_COND2(dest, src)
uint d = dest[i];
uint s = src[i];
@@ -1277,9 +1196,7 @@ Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_Overlay_impl(uint *dest,
int sg = qGreen(color);
int sb = qBlue(color);
- PRELOAD_INIT(dest)
for (int i = 0; i < length; ++i) {
- PRELOAD_COND(dest)
uint d = dest[i];
int da = qAlpha(d);
@@ -1336,9 +1253,7 @@ void QT_FASTCALL comp_func_solid_Overlay_rgb64(QRgba64 *dest, int length, QRgba6
template <typename T>
Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_Overlay_impl(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, const T &coverage)
{
- PRELOAD_INIT2(dest, src)
for (int i = 0; i < length; ++i) {
- PRELOAD_COND2(dest, src)
uint d = dest[i];
uint s = src[i];
@@ -1415,9 +1330,7 @@ Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_Darken_impl(uint *dest, i
int sg = qGreen(color);
int sb = qBlue(color);
- PRELOAD_INIT(dest)
for (int i = 0; i < length; ++i) {
- PRELOAD_COND(dest)
uint d = dest[i];
int da = qAlpha(d);
@@ -1474,9 +1387,7 @@ void QT_FASTCALL comp_func_solid_Darken_rgb64(QRgba64 *dest, int length, QRgba64
template <typename T>
Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_Darken_impl(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, const T &coverage)
{
- PRELOAD_INIT2(dest, src)
for (int i = 0; i < length; ++i) {
- PRELOAD_COND2(dest, src)
uint d = dest[i];
uint s = src[i];
@@ -1553,9 +1464,7 @@ Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_Lighten_impl(uint *dest,
int sg = qGreen(color);
int sb = qBlue(color);
- PRELOAD_INIT(dest)
for (int i = 0; i < length; ++i) {
- PRELOAD_COND(dest)
uint d = dest[i];
int da = qAlpha(d);
@@ -1612,9 +1521,7 @@ void QT_FASTCALL comp_func_solid_Lighten_rgb64(QRgba64 *dest, int length, QRgba6
template <typename T>
Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_Lighten_impl(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, const T &coverage)
{
- PRELOAD_INIT2(dest, src)
for (int i = 0; i < length; ++i) {
- PRELOAD_COND2(dest, src)
uint d = dest[i];
uint s = src[i];
@@ -1709,9 +1616,7 @@ Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_ColorDodge_impl(uint *des
int sg = qGreen(color);
int sb = qBlue(color);
- PRELOAD_INIT(dest)
for (int i = 0; i < length; ++i) {
- PRELOAD_COND(dest)
uint d = dest[i];
int da = qAlpha(d);
@@ -1768,9 +1673,7 @@ void QT_FASTCALL comp_func_solid_ColorDodge_rgb64(QRgba64 *dest, int length, QRg
template <typename T>
Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_ColorDodge_impl(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, const T &coverage)
{
- PRELOAD_INIT2(dest, src)
for (int i = 0; i < length; ++i) {
- PRELOAD_COND2(dest, src)
uint d = dest[i];
uint s = src[i];
@@ -1865,9 +1768,7 @@ Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_ColorBurn_impl(uint *dest
int sg = qGreen(color);
int sb = qBlue(color);
- PRELOAD_INIT(dest)
for (int i = 0; i < length; ++i) {
- PRELOAD_COND(dest)
uint d = dest[i];
int da = qAlpha(d);
@@ -1924,9 +1825,7 @@ void QT_FASTCALL comp_func_solid_ColorBurn_rgb64(QRgba64 *dest, int length, QRgb
template <typename T>
Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_ColorBurn_impl(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, const T &coverage)
{
- PRELOAD_INIT2(dest, src)
for (int i = 0; i < length; ++i) {
- PRELOAD_COND2(dest, src)
uint d = dest[i];
uint s = src[i];
@@ -2015,9 +1914,7 @@ Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_HardLight_impl(uint *dest
int sg = qGreen(color);
int sb = qBlue(color);
- PRELOAD_INIT(dest)
for (int i = 0; i < length; ++i) {
- PRELOAD_COND(dest)
uint d = dest[i];
int da = qAlpha(d);
@@ -2074,9 +1971,7 @@ void QT_FASTCALL comp_func_solid_HardLight_rgb64(QRgba64 *dest, int length, QRgb
template <typename T>
Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_HardLight_impl(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, const T &coverage)
{
- PRELOAD_INIT2(dest, src)
for (int i = 0; i < length; ++i) {
- PRELOAD_COND2(dest, src)
uint d = dest[i];
uint s = src[i];
@@ -2178,9 +2073,7 @@ Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_SoftLight_impl(uint *dest
int sg = qGreen(color);
int sb = qBlue(color);
- PRELOAD_INIT(dest)
for (int i = 0; i < length; ++i) {
- PRELOAD_COND(dest)
uint d = dest[i];
int da = qAlpha(d);
@@ -2237,9 +2130,7 @@ void QT_FASTCALL comp_func_solid_SoftLight_rgb64(QRgba64 *dest, int length, QRgb
template <typename T>
Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_SoftLight_impl(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, const T &coverage)
{
- PRELOAD_INIT2(dest, src)
for (int i = 0; i < length; ++i) {
- PRELOAD_COND2(dest, src)
uint d = dest[i];
uint s = src[i];
@@ -2316,9 +2207,7 @@ Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_Difference_impl(uint *des
int sg = qGreen(color);
int sb = qBlue(color);
- PRELOAD_INIT(dest)
for (int i = 0; i < length; ++i) {
- PRELOAD_COND(dest)
uint d = dest[i];
int da = qAlpha(d);
@@ -2375,9 +2264,7 @@ void QT_FASTCALL comp_func_solid_Difference_rgb64(QRgba64 *dest, int length, QRg
template <typename T>
Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_Difference_impl(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, const T &coverage)
{
- PRELOAD_INIT2(dest, src)
for (int i = 0; i < length; ++i) {
- PRELOAD_COND2(dest, src)
uint d = dest[i];
uint s = src[i];
@@ -2443,9 +2330,7 @@ Q_STATIC_TEMPLATE_FUNCTION inline void QT_FASTCALL comp_func_solid_Exclusion_imp
int sg = qGreen(color);
int sb = qBlue(color);
- PRELOAD_INIT(dest)
for (int i = 0; i < length; ++i) {
- PRELOAD_COND(dest)
uint d = dest[i];
int da = qAlpha(d);
@@ -2503,9 +2388,7 @@ void QT_FASTCALL comp_func_solid_Exclusion_rgb64(QRgba64 *dest, int length, QRgb
template <typename T>
Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_Exclusion_impl(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, const T &coverage)
{
- PRELOAD_INIT2(dest, src)
for (int i = 0; i < length; ++i) {
- PRELOAD_COND2(dest, src)
uint d = dest[i];
uint s = src[i];
diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp
index 5ec570a5db..149fa124f6 100644
--- a/src/gui/painting/qdrawhelper.cpp
+++ b/src/gui/painting/qdrawhelper.cpp
@@ -6443,7 +6443,7 @@ static void qInitDrawhelperFunctions()
sourceFetchUntransformed[QImage::Format_RGB888] = qt_fetchUntransformed_888_neon;
-#if defined(Q_PROCESSOR_ARM_64) && Q_BYTE_ORDER == Q_LITTLE_ENDIAN
+#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN
extern const uint *QT_FASTCALL convertARGB32ToARGB32PM_neon(uint *buffer, const uint *src, int count,
const QVector<QRgb> *, QDitherInfo *);
extern const uint *QT_FASTCALL convertRGBA8888ToARGB32PM_neon(uint *buffer, const uint *src, int count,
diff --git a/src/gui/painting/qdrawhelper_neon.cpp b/src/gui/painting/qdrawhelper_neon.cpp
index 4cbac009d8..e126f4b670 100644
--- a/src/gui/painting/qdrawhelper_neon.cpp
+++ b/src/gui/painting/qdrawhelper_neon.cpp
@@ -1080,23 +1080,41 @@ const uint * QT_FASTCALL qt_fetchUntransformed_888_neon(uint *buffer, const Oper
return buffer;
}
-#if defined(Q_PROCESSOR_ARM_64) && Q_BYTE_ORDER == Q_LITTLE_ENDIAN
+#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN
template<bool RGBA>
static inline void convertARGBToARGB32PM_neon(uint *buffer, const uint *src, int count)
{
int i = 0;
+#if defined(Q_PROCESSOR_ARM_64)
const uint8x16_t rgbaMask = { 2, 1, 0, 3, 6, 5, 4, 7, 10, 9, 8, 11, 14, 13, 12, 15};
+#else
+ const uint8x8_t rgbaMask = { 2, 1, 0, 3, 6, 5, 4, 7 };
+#endif
const uint8x8_t shuffleMask = { 3, 3, 3, 3, 7, 7, 7, 7};
const uint32x4_t blendMask = vdupq_n_u32(0xff000000);
for (; i < count - 3; i += 4) {
uint32x4_t srcVector = vld1q_u32(src + i);
uint32x4_t alphaVector = vshrq_n_u32(srcVector, 24);
+#if defined(Q_PROCESSOR_ARM_64)
uint32_t alphaSum = vaddvq_u32(alphaVector);
+#else
+ // no vaddvq_u32
+ uint32x2_t tmp = vpadd_u32(vget_low_u32(alphaVector), vget_high_u32(alphaVector));
+ uint32_t alphaSum = vget_lane_u32(vpadd_u32(tmp, tmp), 0);
+#endif
if (alphaSum) {
if (alphaSum != 255 * 4) {
- if (RGBA)
+ if (RGBA) {
+#if defined(Q_PROCESSOR_ARM_64)
srcVector = vreinterpretq_u32_u8(vqtbl1q_u8(vreinterpretq_u8_u32(srcVector), rgbaMask));
+#else
+ // no vqtbl1q_u8
+ const uint8x8_t low = vtbl1_u8(vreinterpret_u8_u32(vget_low_u32(srcVector)), rgbaMask);
+ const uint8x8_t high = vtbl1_u8(vreinterpret_u8_u32(vget_high_u32(srcVector)), rgbaMask);
+ srcVector = vcombine_u32(vreinterpret_u32_u8(low), vreinterpret_u32_u8(high));
+#endif
+ }
const uint8x8_t s1 = vreinterpret_u8_u32(vget_low_u32(srcVector));
const uint8x8_t s2 = vreinterpret_u8_u32(vget_high_u32(srcVector));
const uint8x8_t alpha1 = vtbl1_u8(s1, shuffleMask);
@@ -1110,10 +1128,19 @@ static inline void convertARGBToARGB32PM_neon(uint *buffer, const uint *src, int
const uint32x4_t d = vbslq_u32(blendMask, srcVector, vreinterpretq_u32_u8(vcombine_u8(d1, d2)));
vst1q_u32(buffer + i, d);
} else {
- if (RGBA)
- vst1q_u32(buffer + i, vreinterpretq_u32_u8(vqtbl1q_u8(vreinterpretq_u8_u32(srcVector), rgbaMask)));
- else if (buffer != src)
+ if (RGBA) {
+#if defined(Q_PROCESSOR_ARM_64)
+ srcVector = vreinterpretq_u32_u8(vqtbl1q_u8(vreinterpretq_u8_u32(srcVector), rgbaMask));
+#else
+ // no vqtbl1q_u8
+ const uint8x8_t low = vtbl1_u8(vreinterpret_u8_u32(vget_low_u32(srcVector)), rgbaMask);
+ const uint8x8_t high = vtbl1_u8(vreinterpret_u8_u32(vget_high_u32(srcVector)), rgbaMask);
+ srcVector = vcombine_u32(vreinterpret_u32_u8(low), vreinterpret_u32_u8(high));
+#endif
+ vst1q_u32(buffer + i, srcVector);
+ } else if (buffer != src) {
vst1q_u32(buffer + i, srcVector);
+ }
}
} else {
vst1q_u32(buffer + i, vdupq_n_u32(0));
@@ -1139,7 +1166,8 @@ const uint *QT_FASTCALL convertRGBA8888ToARGB32PM_neon(uint *buffer, const uint
convertARGBToARGB32PM_neon<true>(buffer, src, count);
return buffer;
}
-#endif
+
+#endif // Q_BYTE_ORDER == Q_LITTLE_ENDIAN
QT_END_NAMESPACE
diff --git a/src/gui/painting/qdrawhelper_p.h b/src/gui/painting/qdrawhelper_p.h
index 2be10d2cfb..1dea386da4 100644
--- a/src/gui/painting/qdrawhelper_p.h
+++ b/src/gui/painting/qdrawhelper_p.h
@@ -1160,23 +1160,23 @@ const uint qt_bayer_matrix[16][16] = {
#if Q_PROCESSOR_WORDSIZE == 8 // 64-bit versions
-#define AMIX(mask) (qMin(((qint64(s)&mask) + (qint64(d)&mask)), qint64(mask)))
-#define MIX(mask) (qMin(((qint64(s)&mask) + (qint64(d)&mask)), qint64(mask)))
+#define AMIX(mask) (qMin(((quint64(s)&mask) + (quint64(d)&mask)), quint64(mask)))
+#define MIX(mask) (qMin(((quint64(s)&mask) + (quint64(d)&mask)), quint64(mask)))
#else // 32 bits
// The mask for alpha can overflow over 32 bits
-#define AMIX(mask) quint32(qMin(((qint64(s)&mask) + (qint64(d)&mask)), qint64(mask)))
+#define AMIX(mask) quint32(qMin(((quint64(s)&mask) + (quint64(d)&mask)), quint64(mask)))
#define MIX(mask) (qMin(((quint32(s)&mask) + (quint32(d)&mask)), quint32(mask)))
#endif
-inline int comp_func_Plus_one_pixel_const_alpha(uint d, const uint s, const uint const_alpha, const uint one_minus_const_alpha)
+inline uint comp_func_Plus_one_pixel_const_alpha(uint d, const uint s, const uint const_alpha, const uint one_minus_const_alpha)
{
- const int result = (AMIX(AMASK) | MIX(RMASK) | MIX(GMASK) | MIX(BMASK));
+ const uint result = uint(AMIX(AMASK) | MIX(RMASK) | MIX(GMASK) | MIX(BMASK));
return INTERPOLATE_PIXEL_255(result, const_alpha, d, one_minus_const_alpha);
}
-inline int comp_func_Plus_one_pixel(uint d, const uint s)
+inline uint comp_func_Plus_one_pixel(uint d, const uint s)
{
- const int result = (AMIX(AMASK) | MIX(RMASK) | MIX(GMASK) | MIX(BMASK));
+ const uint result = uint(AMIX(AMASK) | MIX(RMASK) | MIX(GMASK) | MIX(BMASK));
return result;
}
diff --git a/src/gui/painting/qmatrix.h b/src/gui/painting/qmatrix.h
index 15e0ab5be1..74ecef767e 100644
--- a/src/gui/painting/qmatrix.h
+++ b/src/gui/painting/qmatrix.h
@@ -108,7 +108,7 @@ public:
bool isInvertible() const { return !qFuzzyIsNull(_m11*_m22 - _m12*_m21); }
qreal determinant() const { return _m11*_m22 - _m12*_m21; }
- Q_REQUIRED_RESULT QMatrix inverted(bool *invertible = Q_NULLPTR) const;
+ Q_REQUIRED_RESULT QMatrix inverted(bool *invertible = nullptr) const;
bool operator==(const QMatrix &) const;
bool operator!=(const QMatrix &) const;
diff --git a/src/gui/painting/qpaintengine_blitter_p.h b/src/gui/painting/qpaintengine_blitter_p.h
index 40f5347b26..fb5dfe2318 100644
--- a/src/gui/painting/qpaintengine_blitter_p.h
+++ b/src/gui/painting/qpaintengine_blitter_p.h
@@ -67,48 +67,48 @@ class Q_GUI_EXPORT QBlitterPaintEngine : public QRasterPaintEngine
public:
QBlitterPaintEngine(QBlittablePlatformPixmap *p);
- virtual QPaintEngine::Type type() const Q_DECL_OVERRIDE
+ virtual QPaintEngine::Type type() const override
{ return Blitter; }
- virtual bool begin(QPaintDevice *pdev) Q_DECL_OVERRIDE;
- virtual bool end() Q_DECL_OVERRIDE;
+ virtual bool begin(QPaintDevice *pdev) override;
+ virtual bool end() override;
// Call down into QBlittable
- void fill(const QVectorPath &path, const QBrush &brush) Q_DECL_OVERRIDE;
- void fillRect(const QRectF &rect, const QBrush &brush) Q_DECL_OVERRIDE;
- void fillRect(const QRectF &rect, const QColor &color) Q_DECL_OVERRIDE;
- void drawRects(const QRect *rects, int rectCount) Q_DECL_OVERRIDE;
- void drawRects(const QRectF *rects, int rectCount) Q_DECL_OVERRIDE;
- void drawPixmap(const QPointF &p, const QPixmap &pm) Q_DECL_OVERRIDE;
- void drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr) Q_DECL_OVERRIDE;
+ void fill(const QVectorPath &path, const QBrush &brush) override;
+ void fillRect(const QRectF &rect, const QBrush &brush) override;
+ void fillRect(const QRectF &rect, const QColor &color) override;
+ void drawRects(const QRect *rects, int rectCount) override;
+ void drawRects(const QRectF *rects, int rectCount) override;
+ void drawPixmap(const QPointF &p, const QPixmap &pm) override;
+ void drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr) override;
// State tracking
- void setState(QPainterState *s) Q_DECL_OVERRIDE;
- virtual void clipEnabledChanged() Q_DECL_OVERRIDE;
- virtual void penChanged() Q_DECL_OVERRIDE;
- virtual void brushChanged() Q_DECL_OVERRIDE;
- virtual void opacityChanged() Q_DECL_OVERRIDE;
- virtual void compositionModeChanged() Q_DECL_OVERRIDE;
- virtual void renderHintsChanged() Q_DECL_OVERRIDE;
- virtual void transformChanged() Q_DECL_OVERRIDE;
+ void setState(QPainterState *s) override;
+ virtual void clipEnabledChanged() override;
+ virtual void penChanged() override;
+ virtual void brushChanged() override;
+ virtual void opacityChanged() override;
+ virtual void compositionModeChanged() override;
+ virtual void renderHintsChanged() override;
+ virtual void transformChanged() override;
// Override to lock the QBlittable before using raster
- void drawPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode) Q_DECL_OVERRIDE;
- void drawPolygon(const QPoint *points, int pointCount, PolygonDrawMode mode) Q_DECL_OVERRIDE;
- void fillPath(const QPainterPath &path, QSpanData *fillData) Q_DECL_OVERRIDE;
- void fillPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode) Q_DECL_OVERRIDE;
- void drawEllipse(const QRectF &rect) Q_DECL_OVERRIDE;
- void drawImage(const QPointF &p, const QImage &img) Q_DECL_OVERRIDE;
+ void drawPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode) override;
+ void drawPolygon(const QPoint *points, int pointCount, PolygonDrawMode mode) override;
+ void fillPath(const QPainterPath &path, QSpanData *fillData) override;
+ void fillPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode) override;
+ void drawEllipse(const QRectF &rect) override;
+ void drawImage(const QPointF &p, const QImage &img) override;
void drawImage(const QRectF &r, const QImage &pm, const QRectF &sr,
- Qt::ImageConversionFlags flags = Qt::AutoColor) Q_DECL_OVERRIDE;
- void drawTiledPixmap(const QRectF &r, const QPixmap &pm, const QPointF &sr) Q_DECL_OVERRIDE;
- void drawTextItem(const QPointF &p, const QTextItem &textItem) Q_DECL_OVERRIDE;
- void drawPoints(const QPointF *points, int pointCount) Q_DECL_OVERRIDE;
- void drawPoints(const QPoint *points, int pointCount) Q_DECL_OVERRIDE;
- void stroke(const QVectorPath &path, const QPen &pen) Q_DECL_OVERRIDE;
- void drawStaticTextItem(QStaticTextItem *) Q_DECL_OVERRIDE;
+ Qt::ImageConversionFlags flags = Qt::AutoColor) override;
+ void drawTiledPixmap(const QRectF &r, const QPixmap &pm, const QPointF &sr) override;
+ void drawTextItem(const QPointF &p, const QTextItem &textItem) override;
+ void drawPoints(const QPointF *points, int pointCount) override;
+ void drawPoints(const QPoint *points, int pointCount) override;
+ void stroke(const QVectorPath &path, const QPen &pen) override;
+ void drawStaticTextItem(QStaticTextItem *) override;
bool drawCachedGlyphs(int numGlyphs, const glyph_t *glyphs, const QFixedPoint *positions,
- QFontEngine *fontEngine) Q_DECL_OVERRIDE;
+ QFontEngine *fontEngine) override;
};
QT_END_NAMESPACE
diff --git a/src/gui/painting/qpaintengine_raster_p.h b/src/gui/painting/qpaintengine_raster_p.h
index e2e0f821e3..8c6f668d9d 100644
--- a/src/gui/painting/qpaintengine_raster_p.h
+++ b/src/gui/painting/qpaintengine_raster_p.h
@@ -135,20 +135,20 @@ public:
QRasterPaintEngine(QPaintDevice *device);
~QRasterPaintEngine();
- bool begin(QPaintDevice *device) Q_DECL_OVERRIDE;
- bool end() Q_DECL_OVERRIDE;
-
- void penChanged() Q_DECL_OVERRIDE;
- void brushChanged() Q_DECL_OVERRIDE;
- void brushOriginChanged() Q_DECL_OVERRIDE;
- void opacityChanged() Q_DECL_OVERRIDE;
- void compositionModeChanged() Q_DECL_OVERRIDE;
- void renderHintsChanged() Q_DECL_OVERRIDE;
- void transformChanged() Q_DECL_OVERRIDE;
- void clipEnabledChanged() Q_DECL_OVERRIDE;
-
- void setState(QPainterState *s) Q_DECL_OVERRIDE;
- QPainterState *createState(QPainterState *orig) const Q_DECL_OVERRIDE;
+ bool begin(QPaintDevice *device) override;
+ bool end() override;
+
+ void penChanged() override;
+ void brushChanged() override;
+ void brushOriginChanged() override;
+ void opacityChanged() override;
+ void compositionModeChanged() override;
+ void renderHintsChanged() override;
+ void transformChanged() override;
+ void clipEnabledChanged() override;
+
+ void setState(QPainterState *s) override;
+ QPainterState *createState(QPainterState *orig) const override;
inline QRasterPaintEngineState *state() {
return static_cast<QRasterPaintEngineState *>(QPaintEngineEx::state());
}
@@ -164,40 +164,40 @@ public:
virtual void fillPath(const QPainterPath &path, QSpanData *fillData);
virtual void fillPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode);
- void drawPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode) Q_DECL_OVERRIDE;
- void drawPolygon(const QPoint *points, int pointCount, PolygonDrawMode mode) Q_DECL_OVERRIDE;
+ void drawPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode) override;
+ void drawPolygon(const QPoint *points, int pointCount, PolygonDrawMode mode) override;
- void drawEllipse(const QRectF &rect) Q_DECL_OVERRIDE;
+ void drawEllipse(const QRectF &rect) override;
- void fillRect(const QRectF &rect, const QBrush &brush) Q_DECL_OVERRIDE;
- void fillRect(const QRectF &rect, const QColor &color) Q_DECL_OVERRIDE;
+ void fillRect(const QRectF &rect, const QBrush &brush) override;
+ void fillRect(const QRectF &rect, const QColor &color) override;
- void drawRects(const QRect *rects, int rectCount) Q_DECL_OVERRIDE;
- void drawRects(const QRectF *rects, int rectCount) Q_DECL_OVERRIDE;
+ void drawRects(const QRect *rects, int rectCount) override;
+ void drawRects(const QRectF *rects, int rectCount) override;
- void drawPixmap(const QPointF &p, const QPixmap &pm) Q_DECL_OVERRIDE;
- void drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr) Q_DECL_OVERRIDE;
- void drawImage(const QPointF &p, const QImage &img) Q_DECL_OVERRIDE;
+ void drawPixmap(const QPointF &p, const QPixmap &pm) override;
+ void drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr) override;
+ void drawImage(const QPointF &p, const QImage &img) override;
void drawImage(const QRectF &r, const QImage &pm, const QRectF &sr,
- Qt::ImageConversionFlags flags = Qt::AutoColor) Q_DECL_OVERRIDE;
- void drawTiledPixmap(const QRectF &r, const QPixmap &pm, const QPointF &sr) Q_DECL_OVERRIDE;
- void drawTextItem(const QPointF &p, const QTextItem &textItem) Q_DECL_OVERRIDE;
+ Qt::ImageConversionFlags flags = Qt::AutoColor) override;
+ void drawTiledPixmap(const QRectF &r, const QPixmap &pm, const QPointF &sr) override;
+ void drawTextItem(const QPointF &p, const QTextItem &textItem) override;
- void drawLines(const QLine *line, int lineCount) Q_DECL_OVERRIDE;
- void drawLines(const QLineF *line, int lineCount) Q_DECL_OVERRIDE;
+ void drawLines(const QLine *line, int lineCount) override;
+ void drawLines(const QLineF *line, int lineCount) override;
- void drawPoints(const QPointF *points, int pointCount) Q_DECL_OVERRIDE;
- void drawPoints(const QPoint *points, int pointCount) Q_DECL_OVERRIDE;
+ void drawPoints(const QPointF *points, int pointCount) override;
+ void drawPoints(const QPoint *points, int pointCount) override;
- void stroke(const QVectorPath &path, const QPen &pen) Q_DECL_OVERRIDE;
- void fill(const QVectorPath &path, const QBrush &brush) Q_DECL_OVERRIDE;
+ void stroke(const QVectorPath &path, const QPen &pen) override;
+ void fill(const QVectorPath &path, const QBrush &brush) override;
- void clip(const QVectorPath &path, Qt::ClipOperation op) Q_DECL_OVERRIDE;
- void clip(const QRect &rect, Qt::ClipOperation op) Q_DECL_OVERRIDE;
- void clip(const QRegion &region, Qt::ClipOperation op) Q_DECL_OVERRIDE;
+ void clip(const QVectorPath &path, Qt::ClipOperation op) override;
+ void clip(const QRect &rect, Qt::ClipOperation op) override;
+ void clip(const QRegion &region, Qt::ClipOperation op) override;
inline const QClipData *clipData() const;
- void drawStaticTextItem(QStaticTextItem *textItem) Q_DECL_OVERRIDE;
+ void drawStaticTextItem(QStaticTextItem *textItem) override;
virtual bool drawCachedGlyphs(int numGlyphs, const glyph_t *glyphs, const QFixedPoint *positions,
QFontEngine *fontEngine);
@@ -227,12 +227,12 @@ public:
QRasterBuffer *rasterBuffer();
void alphaPenBlt(const void* src, int bpl, int depth, int rx,int ry,int w,int h, bool useGammaCorrection);
- Type type() const Q_DECL_OVERRIDE { return Raster; }
+ Type type() const override { return Raster; }
- QPoint coordinateOffset() const Q_DECL_OVERRIDE;
+ QPoint coordinateOffset() const override;
- bool requiresPretransformedGlyphPositions(QFontEngine *fontEngine, const QTransform &m) const Q_DECL_OVERRIDE;
- bool shouldDrawCachedGlyphs(QFontEngine *fontEngine, const QTransform &m) const Q_DECL_OVERRIDE;
+ bool requiresPretransformedGlyphPositions(QFontEngine *fontEngine, const QTransform &m) const override;
+ bool shouldDrawCachedGlyphs(QFontEngine *fontEngine, const QTransform &m) const override;
protected:
QRasterPaintEngine(QRasterPaintEnginePrivate &d, QPaintDevice *);
diff --git a/src/gui/painting/qpaintengineex_p.h b/src/gui/painting/qpaintengineex_p.h
index 7c2c98140f..b2f8b64029 100644
--- a/src/gui/painting/qpaintengineex_p.h
+++ b/src/gui/painting/qpaintengineex_p.h
@@ -103,36 +103,36 @@ public:
virtual void drawRoundedRect(const QRectF &rect, qreal xrad, qreal yrad, Qt::SizeMode mode);
- virtual void drawRects(const QRect *rects, int rectCount) Q_DECL_OVERRIDE;
- virtual void drawRects(const QRectF *rects, int rectCount) Q_DECL_OVERRIDE;
+ virtual void drawRects(const QRect *rects, int rectCount) override;
+ virtual void drawRects(const QRectF *rects, int rectCount) override;
- virtual void drawLines(const QLine *lines, int lineCount) Q_DECL_OVERRIDE;
- virtual void drawLines(const QLineF *lines, int lineCount) Q_DECL_OVERRIDE;
+ virtual void drawLines(const QLine *lines, int lineCount) override;
+ virtual void drawLines(const QLineF *lines, int lineCount) override;
- virtual void drawEllipse(const QRectF &r) Q_DECL_OVERRIDE;
- virtual void drawEllipse(const QRect &r) Q_DECL_OVERRIDE;
+ virtual void drawEllipse(const QRectF &r) override;
+ virtual void drawEllipse(const QRect &r) override;
- virtual void drawPath(const QPainterPath &path) Q_DECL_OVERRIDE;
+ virtual void drawPath(const QPainterPath &path) override;
- virtual void drawPoints(const QPointF *points, int pointCount) Q_DECL_OVERRIDE;
- virtual void drawPoints(const QPoint *points, int pointCount) Q_DECL_OVERRIDE;
+ virtual void drawPoints(const QPointF *points, int pointCount) override;
+ virtual void drawPoints(const QPoint *points, int pointCount) override;
- virtual void drawPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode) Q_DECL_OVERRIDE;
- virtual void drawPolygon(const QPoint *points, int pointCount, PolygonDrawMode mode) Q_DECL_OVERRIDE;
+ virtual void drawPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode) override;
+ virtual void drawPolygon(const QPoint *points, int pointCount, PolygonDrawMode mode) override;
- virtual void drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr) Q_DECL_OVERRIDE = 0;
+ virtual void drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr) override = 0;
virtual void drawPixmap(const QPointF &pos, const QPixmap &pm);
virtual void drawImage(const QRectF &r, const QImage &pm, const QRectF &sr,
- Qt::ImageConversionFlags flags = Qt::AutoColor) Q_DECL_OVERRIDE = 0;
+ Qt::ImageConversionFlags flags = Qt::AutoColor) override = 0;
virtual void drawImage(const QPointF &pos, const QImage &image);
- virtual void drawTiledPixmap(const QRectF &r, const QPixmap &pixmap, const QPointF &s) Q_DECL_OVERRIDE;
+ virtual void drawTiledPixmap(const QRectF &r, const QPixmap &pixmap, const QPointF &s) override;
virtual void drawPixmapFragments(const QPainter::PixmapFragment *fragments, int fragmentCount, const QPixmap &pixmap,
QFlags<QPainter::PixmapFragmentHint> hints);
- virtual void updateState(const QPaintEngineState &state) Q_DECL_OVERRIDE;
+ virtual void updateState(const QPaintEngineState &state) override;
virtual void drawStaticTextItem(QStaticTextItem *);
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp
index b95f9b18aa..6876a72e6e 100644
--- a/src/gui/painting/qpainter.cpp
+++ b/src/gui/painting/qpainter.cpp
@@ -5850,7 +5850,7 @@ void QPainter::drawText(const QPointF &p, const QString &str, int tf, int justif
if (!d->engine || str.isEmpty() || pen().style() == Qt::NoPen)
return;
-#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
+#if QT_DEPRECATED_SINCE(5, 11) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
if (tf & Qt::TextBypassShaping) {
// Skip complex shaping, shape using glyph advances only
int len = str.length();
diff --git a/src/gui/painting/qpainter.h b/src/gui/painting/qpainter.h
index 64d15d5296..12a9c720a8 100644
--- a/src/gui/painting/qpainter.h
+++ b/src/gui/painting/qpainter.h
@@ -416,9 +416,9 @@ public:
void drawText(const QPointF &p, const QString &str, int tf, int justificationPadding);
- void drawText(const QRectF &r, int flags, const QString &text, QRectF *br = Q_NULLPTR);
- void drawText(const QRect &r, int flags, const QString &text, QRect *br = Q_NULLPTR);
- inline void drawText(int x, int y, int w, int h, int flags, const QString &text, QRect *br = Q_NULLPTR);
+ void drawText(const QRectF &r, int flags, const QString &text, QRectF *br = nullptr);
+ void drawText(const QRect &r, int flags, const QString &text, QRect *br = nullptr);
+ inline void drawText(int x, int y, int w, int h, int flags, const QString &text, QRect *br = nullptr);
void drawText(const QRectF &r, const QString &text, const QTextOption &o = QTextOption());
@@ -461,7 +461,7 @@ public:
static void setRedirected(const QPaintDevice *device, QPaintDevice *replacement,
const QPoint& offset = QPoint());
- static QPaintDevice *redirected(const QPaintDevice *device, QPoint *offset = Q_NULLPTR);
+ static QPaintDevice *redirected(const QPaintDevice *device, QPoint *offset = nullptr);
static void restoreRedirected(const QPaintDevice *device);
void beginNativePainting();
diff --git a/src/gui/painting/qpdf_p.h b/src/gui/painting/qpdf_p.h
index f5bb4e17a8..5a909f2ede 100644
--- a/src/gui/painting/qpdf_p.h
+++ b/src/gui/painting/qpdf_p.h
@@ -186,28 +186,28 @@ public:
void setPdfVersion(PdfVersion version);
// reimplementations QPaintEngine
- bool begin(QPaintDevice *pdev) Q_DECL_OVERRIDE;
- bool end() Q_DECL_OVERRIDE;
+ bool begin(QPaintDevice *pdev) override;
+ bool end() override;
- void drawPoints(const QPointF *points, int pointCount) Q_DECL_OVERRIDE;
- void drawLines(const QLineF *lines, int lineCount) Q_DECL_OVERRIDE;
- void drawRects(const QRectF *rects, int rectCount) Q_DECL_OVERRIDE;
- void drawPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode) Q_DECL_OVERRIDE;
- void drawPath (const QPainterPath & path) Q_DECL_OVERRIDE;
+ void drawPoints(const QPointF *points, int pointCount) override;
+ void drawLines(const QLineF *lines, int lineCount) override;
+ void drawRects(const QRectF *rects, int rectCount) override;
+ void drawPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode) override;
+ void drawPath (const QPainterPath & path) override;
- void drawTextItem(const QPointF &p, const QTextItem &textItem) Q_DECL_OVERRIDE;
+ void drawTextItem(const QPointF &p, const QTextItem &textItem) override;
- void drawPixmap (const QRectF & rectangle, const QPixmap & pixmap, const QRectF & sr) Q_DECL_OVERRIDE;
+ void drawPixmap (const QRectF & rectangle, const QPixmap & pixmap, const QRectF & sr) override;
void drawImage(const QRectF &r, const QImage &pm, const QRectF &sr,
- Qt::ImageConversionFlags flags = Qt::AutoColor) Q_DECL_OVERRIDE;
- void drawTiledPixmap (const QRectF & rectangle, const QPixmap & pixmap, const QPointF & point) Q_DECL_OVERRIDE;
+ Qt::ImageConversionFlags flags = Qt::AutoColor) override;
+ void drawTiledPixmap (const QRectF & rectangle, const QPixmap & pixmap, const QPointF & point) override;
void drawHyperlink(const QRectF &r, const QUrl &url);
- void updateState(const QPaintEngineState &state) Q_DECL_OVERRIDE;
+ void updateState(const QPaintEngineState &state) override;
int metric(QPaintDevice::PaintDeviceMetric metricType) const;
- Type type() const Q_DECL_OVERRIDE;
+ Type type() const override;
// end reimplementations QPaintEngine
// Printer stuff...
diff --git a/src/gui/painting/qpdfwriter.cpp b/src/gui/painting/qpdfwriter.cpp
index 5af465edeb..2f24c7efcb 100644
--- a/src/gui/painting/qpdfwriter.cpp
+++ b/src/gui/painting/qpdfwriter.cpp
@@ -79,7 +79,7 @@ public:
virtual ~QPdfPagedPaintDevicePrivate()
{}
- bool setPageLayout(const QPageLayout &newPageLayout) Q_DECL_OVERRIDE
+ bool setPageLayout(const QPageLayout &newPageLayout) override
{
// Try to set the paint engine page layout
pd->engine->setPageLayout(newPageLayout);
@@ -88,7 +88,7 @@ public:
return m_pageLayout.isEquivalentTo(newPageLayout);
}
- bool setPageSize(const QPageSize &pageSize) Q_DECL_OVERRIDE
+ bool setPageSize(const QPageSize &pageSize) override
{
// Try to set the paint engine page size
pd->engine->setPageSize(pageSize);
@@ -97,7 +97,7 @@ public:
return m_pageLayout.pageSize().isEquivalentTo(pageSize);
}
- bool setPageOrientation(QPageLayout::Orientation orientation) Q_DECL_OVERRIDE
+ bool setPageOrientation(QPageLayout::Orientation orientation) override
{
// Set the print engine value
pd->engine->setPageOrientation(orientation);
@@ -106,12 +106,12 @@ public:
return m_pageLayout.orientation() == orientation;
}
- bool setPageMargins(const QMarginsF &margins) Q_DECL_OVERRIDE
+ bool setPageMargins(const QMarginsF &margins) override
{
return setPageMargins(margins, pageLayout().units());
}
- bool setPageMargins(const QMarginsF &margins, QPageLayout::Unit units) Q_DECL_OVERRIDE
+ bool setPageMargins(const QMarginsF &margins, QPageLayout::Unit units) override
{
// Try to set engine margins
pd->engine->setPageMargins(margins, units);
@@ -120,7 +120,7 @@ public:
return m_pageLayout.margins() == margins && m_pageLayout.units() == units;
}
- QPageLayout pageLayout() const Q_DECL_OVERRIDE
+ QPageLayout pageLayout() const override
{
return pd->engine->pageLayout();
}
diff --git a/src/gui/painting/qpen.h b/src/gui/painting/qpen.h
index d8d99ba800..03abfb3d7d 100644
--- a/src/gui/painting/qpen.h
+++ b/src/gui/painting/qpen.h
@@ -72,7 +72,7 @@ public:
QPen &operator=(const QPen &pen) Q_DECL_NOTHROW;
#ifdef Q_COMPILER_RVALUE_REFS
QPen(QPen &&other) Q_DECL_NOTHROW
- : d(other.d) { other.d = Q_NULLPTR; }
+ : d(other.d) { other.d = nullptr; }
QPen &operator=(QPen &&other) Q_DECL_NOTHROW
{ qSwap(d, other.d); return *this; }
#endif
diff --git a/src/gui/painting/qplatformbackingstore.cpp b/src/gui/painting/qplatformbackingstore.cpp
index 8ab22beb31..09c23fdfa1 100644
--- a/src/gui/painting/qplatformbackingstore.cpp
+++ b/src/gui/painting/qplatformbackingstore.cpp
@@ -704,7 +704,7 @@ void QPlatformBackingStore::endPaint()
*/
QPlatformGraphicsBuffer *QPlatformBackingStore::graphicsBuffer() const
{
- return Q_NULLPTR;
+ return nullptr;
}
/*!
diff --git a/src/gui/painting/qregion.cpp b/src/gui/painting/qregion.cpp
index 3fb6f925b3..1b8aae16e1 100644
--- a/src/gui/painting/qregion.cpp
+++ b/src/gui/painting/qregion.cpp
@@ -2281,7 +2281,14 @@ static void miRegionOp(QRegionPrivate &dest,
dest.vectorize();
- QVector<QRect> oldRects = dest.rects;
+ /*
+ * The following calls are going to detach dest.rects. Since dest might be
+ * aliasing *reg1 and/or *reg2, and we could have active iterators on
+ * reg1->rects and reg2->rects (if the regions have more than 1 rectangle),
+ * take a copy of dest.rects to keep those iteractors valid.
+ */
+ const QVector<QRect> destRectsCopy = dest.rects;
+ Q_UNUSED(destRectsCopy);
dest.numRects = 0;
@@ -3613,7 +3620,7 @@ static void PtsToRegion(int numFullPtBlocks, int iCurPtBlock,
}
if (rowSize) {
- QPoint *next = i ? &pts[2] : (numFullPtBlocks && iCurPtBlock ? CurPtBlock->next->pts : Q_NULLPTR);
+ QPoint *next = i ? &pts[2] : (numFullPtBlocks && iCurPtBlock ? CurPtBlock->next->pts : nullptr);
if (!next || next->y() != pts[0].y()) {
flushRow(row.data(), pts[0].y(), rowSize, reg, &lastRow, &extendTo, &needsExtend);
diff --git a/src/gui/painting/qtextureglyphcache_p.h b/src/gui/painting/qtextureglyphcache_p.h
index 25253b496a..3da28872b1 100644
--- a/src/gui/painting/qtextureglyphcache_p.h
+++ b/src/gui/painting/qtextureglyphcache_p.h
@@ -169,9 +169,9 @@ public:
: QTextureGlyphCache(format, matrix) { }
~QImageTextureGlyphCache();
- virtual void createTextureData(int width, int height) Q_DECL_OVERRIDE;
- virtual void resizeTextureData(int width, int height) Q_DECL_OVERRIDE;
- virtual void fillTexture(const Coord &c, glyph_t glyph, QFixed subPixelPosition) Q_DECL_OVERRIDE;
+ virtual void createTextureData(int width, int height) override;
+ virtual void resizeTextureData(int width, int height) override;
+ virtual void fillTexture(const Coord &c, glyph_t glyph, QFixed subPixelPosition) override;
inline const QImage &image() const { return m_image; }
diff --git a/src/gui/painting/qtransform.cpp b/src/gui/painting/qtransform.cpp
index 7f06915444..7a53c44bc4 100644
--- a/src/gui/painting/qtransform.cpp
+++ b/src/gui/painting/qtransform.cpp
@@ -265,7 +265,7 @@ QTransform::QTransform()
, m_13(0), m_23(0), m_33(1)
, m_type(TxNone)
, m_dirty(TxNone)
- , d(Q_NULLPTR)
+ , d(nullptr)
{
}
@@ -284,7 +284,7 @@ QTransform::QTransform(qreal h11, qreal h12, qreal h13,
, m_13(h13), m_23(h23), m_33(h33)
, m_type(TxNone)
, m_dirty(TxProject)
- , d(Q_NULLPTR)
+ , d(nullptr)
{
}
@@ -301,7 +301,7 @@ QTransform::QTransform(qreal h11, qreal h12, qreal h21,
, m_13(0), m_23(0), m_33(1)
, m_type(TxNone)
, m_dirty(TxShear)
- , d(Q_NULLPTR)
+ , d(nullptr)
{
}
@@ -317,7 +317,7 @@ QTransform::QTransform(const QMatrix &mtx)
m_13(0), m_23(0), m_33(1)
, m_type(TxNone)
, m_dirty(TxShear)
- , d(Q_NULLPTR)
+ , d(nullptr)
{
}
diff --git a/src/gui/painting/qtransform.h b/src/gui/painting/qtransform.h
index 06ae611861..79835b36e2 100644
--- a/src/gui/painting/qtransform.h
+++ b/src/gui/painting/qtransform.h
@@ -116,7 +116,7 @@ public:
qreal m21, qreal m22, qreal m23,
qreal m31, qreal m32, qreal m33);
- Q_REQUIRED_RESULT QTransform inverted(bool *invertible = Q_NULLPTR) const;
+ Q_REQUIRED_RESULT QTransform inverted(bool *invertible = nullptr) const;
Q_REQUIRED_RESULT QTransform adjoint() const;
Q_REQUIRED_RESULT QTransform transposed() const;
@@ -173,7 +173,7 @@ private:
, m_13(h13), m_23(h23), m_33(h33)
, m_type(TxNone)
, m_dirty(TxProject)
- , d(Q_NULLPTR)
+ , d(nullptr)
{
}
inline QTransform(bool)
@@ -181,7 +181,7 @@ private:
, m_13(0), m_23(0), m_33(1)
, m_type(TxNone)
, m_dirty(TxNone)
- , d(Q_NULLPTR)
+ , d(nullptr)
{
}
inline TransformationType inline_type() const;
diff --git a/src/gui/text/qabstracttextdocumentlayout.h b/src/gui/text/qabstracttextdocumentlayout.h
index 438ad6e70b..8fea27f772 100644
--- a/src/gui/text/qabstracttextdocumentlayout.h
+++ b/src/gui/text/qabstracttextdocumentlayout.h
@@ -100,7 +100,7 @@ public:
QTextDocument *document() const;
void registerHandler(int objectType, QObject *component);
- void unregisterHandler(int objectType, QObject *component = Q_NULLPTR);
+ void unregisterHandler(int objectType, QObject *component = nullptr);
QTextObjectInterface *handlerForObject(int objectType) const;
Q_SIGNALS:
diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp
index 438cd3de3a..220e89a0c4 100644
--- a/src/gui/text/qfont.cpp
+++ b/src/gui/text/qfont.cpp
@@ -2849,7 +2849,7 @@ QFontEngine *QFontCache::findEngine(const Key &key)
end = engineCache.end();
if (it == end) return 0;
- Q_ASSERT(it.value().data != Q_NULLPTR);
+ Q_ASSERT(it.value().data != nullptr);
Q_ASSERT(key.multi == (it.value().data->type() == QFontEngine::Multi));
// found... update the hitcount and timestamp
@@ -2872,7 +2872,7 @@ void QFontCache::updateHitCountAndTimeStamp(Engine &value)
void QFontCache::insertEngine(const Key &key, QFontEngine *engine, bool insertMulti)
{
- Q_ASSERT(engine != Q_NULLPTR);
+ Q_ASSERT(engine != nullptr);
Q_ASSERT(key.multi == (engine->type() == QFontEngine::Multi));
#ifdef QFONTCACHE_DEBUG
diff --git a/src/gui/text/qfont_p.h b/src/gui/text/qfont_p.h
index 9e5d0b4329..350ba7ce3c 100644
--- a/src/gui/text/qfont_p.h
+++ b/src/gui/text/qfont_p.h
@@ -282,7 +282,7 @@ public:
private:
void increaseCost(uint cost);
void decreaseCost(uint cost);
- void timerEvent(QTimerEvent *event) Q_DECL_OVERRIDE;
+ void timerEvent(QTimerEvent *event) override;
void decreaseCache();
static const uint min_cost;
diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp
index 2cc071d67b..afbf783c3a 100644
--- a/src/gui/text/qfontdatabase.cpp
+++ b/src/gui/text/qfontdatabase.cpp
@@ -2685,7 +2685,15 @@ QFontEngine *QFontDatabase::findFont(const QFontDef &request, int script)
index = match(multi ? QChar::Script_Common : script, request, family_name, foundry_name, &desc, blackListed);
}
if (index >= 0) {
- engine = loadEngine(script, request, desc.family, desc.foundry, desc.style, desc.size);
+ QFontDef fontDef = request;
+
+ // Don't pass empty family names to the platform font database, since it will then invoke its own matching
+ // and we will be out of sync with the matched font.
+ if (fontDef.family.isEmpty())
+ fontDef.family = desc.family->name;
+
+ engine = loadEngine(script, fontDef, desc.family, desc.foundry, desc.style, desc.size);
+
if (engine)
initFontDef(desc, request, &engine->fontDef, multi);
else
@@ -2775,7 +2783,7 @@ void QFontDatabase::load(const QFontPrivate *d, int script)
if (d->engineData->engines[script])
return;
- QFontEngine *fe = Q_NULLPTR;
+ QFontEngine *fe = nullptr;
req.fallBackFamilies = fallBackFamilies;
if (!req.fallBackFamilies.isEmpty())
diff --git a/src/gui/text/qfontengine.cpp b/src/gui/text/qfontengine.cpp
index e4f9b8b9d4..5be8745b15 100644
--- a/src/gui/text/qfontengine.cpp
+++ b/src/gui/text/qfontengine.cpp
@@ -1080,7 +1080,7 @@ QFontEngineGlyphCache *QFontEngine::glyphCache(const void *context, GlyphFormat
{
const QHash<const void*, GlyphCaches>::const_iterator caches = m_glyphCaches.constFind(context);
if (caches == m_glyphCaches.cend())
- return Q_NULLPTR;
+ return nullptr;
for (GlyphCaches::const_iterator it = caches->begin(), end = caches->end(); it != end; ++it) {
QFontEngineGlyphCache *cache = it->cache.data();
@@ -1088,7 +1088,7 @@ QFontEngineGlyphCache *QFontEngine::glyphCache(const void *context, GlyphFormat
return cache;
}
- return Q_NULLPTR;
+ return nullptr;
}
static inline QFixed kerning(int left, int right, const QFontEngine::KernPair *pairs, int numPairs)
@@ -1234,7 +1234,7 @@ int QFontEngine::glyphCount() const
Qt::HANDLE QFontEngine::handle() const
{
- return Q_NULLPTR;
+ return nullptr;
}
const uchar *QFontEngine::getCMap(const uchar *table, uint tableSize, bool *isSymbolFont, int *cmapSize)
diff --git a/src/gui/text/qfontengine_p.h b/src/gui/text/qfontengine_p.h
index 1ae2e86a93..a411e9ce4c 100644
--- a/src/gui/text/qfontengine_p.h
+++ b/src/gui/text/qfontengine_p.h
@@ -411,27 +411,27 @@ public:
QFontEngineBox(int size);
~QFontEngineBox();
- virtual glyph_t glyphIndex(uint ucs4) const Q_DECL_OVERRIDE;
- virtual bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, ShaperFlags flags) const Q_DECL_OVERRIDE;
- virtual void recalcAdvances(QGlyphLayout *, ShaperFlags) const Q_DECL_OVERRIDE;
+ virtual glyph_t glyphIndex(uint ucs4) const override;
+ virtual bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, ShaperFlags flags) const override;
+ virtual void recalcAdvances(QGlyphLayout *, ShaperFlags) const override;
void draw(QPaintEngine *p, qreal x, qreal y, const QTextItemInt &si);
- virtual void addOutlineToPath(qreal x, qreal y, const QGlyphLayout &glyphs, QPainterPath *path, QTextItem::RenderFlags flags) Q_DECL_OVERRIDE;
+ virtual void addOutlineToPath(qreal x, qreal y, const QGlyphLayout &glyphs, QPainterPath *path, QTextItem::RenderFlags flags) override;
- virtual glyph_metrics_t boundingBox(const QGlyphLayout &glyphs) Q_DECL_OVERRIDE;
- virtual glyph_metrics_t boundingBox(glyph_t glyph) Q_DECL_OVERRIDE;
- virtual QFontEngine *cloneWithSize(qreal pixelSize) const Q_DECL_OVERRIDE;
+ virtual glyph_metrics_t boundingBox(const QGlyphLayout &glyphs) override;
+ virtual glyph_metrics_t boundingBox(glyph_t glyph) override;
+ virtual QFontEngine *cloneWithSize(qreal pixelSize) const override;
- virtual QFixed ascent() const Q_DECL_OVERRIDE;
- virtual QFixed capHeight() const Q_DECL_OVERRIDE;
- virtual QFixed descent() const Q_DECL_OVERRIDE;
- virtual QFixed leading() const Q_DECL_OVERRIDE;
- virtual qreal maxCharWidth() const Q_DECL_OVERRIDE;
- virtual qreal minLeftBearing() const Q_DECL_OVERRIDE { return 0; }
- virtual qreal minRightBearing() const Q_DECL_OVERRIDE { return 0; }
- virtual QImage alphaMapForGlyph(glyph_t) Q_DECL_OVERRIDE;
+ virtual QFixed ascent() const override;
+ virtual QFixed capHeight() const override;
+ virtual QFixed descent() const override;
+ virtual QFixed leading() const override;
+ virtual qreal maxCharWidth() const override;
+ virtual qreal minLeftBearing() const override { return 0; }
+ virtual qreal minRightBearing() const override { return 0; }
+ virtual QImage alphaMapForGlyph(glyph_t) override;
- virtual bool canRender(const QChar *string, int len) const Q_DECL_OVERRIDE;
+ virtual bool canRender(const QChar *string, int len) const override;
inline int size() const { return _size; }
@@ -449,36 +449,36 @@ public:
explicit QFontEngineMulti(QFontEngine *engine, int script, const QStringList &fallbackFamilies = QStringList());
~QFontEngineMulti();
- virtual glyph_t glyphIndex(uint ucs4) const Q_DECL_OVERRIDE;
- virtual bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, ShaperFlags flags) const Q_DECL_OVERRIDE;
-
- virtual glyph_metrics_t boundingBox(const QGlyphLayout &glyphs) Q_DECL_OVERRIDE;
- virtual glyph_metrics_t boundingBox(glyph_t glyph) Q_DECL_OVERRIDE;
-
- virtual void recalcAdvances(QGlyphLayout *, ShaperFlags) const Q_DECL_OVERRIDE;
- virtual void doKerning(QGlyphLayout *, ShaperFlags) const Q_DECL_OVERRIDE;
- virtual void addOutlineToPath(qreal, qreal, const QGlyphLayout &, QPainterPath *, QTextItem::RenderFlags flags) Q_DECL_OVERRIDE;
- virtual void getGlyphBearings(glyph_t glyph, qreal *leftBearing = 0, qreal *rightBearing = 0) Q_DECL_OVERRIDE;
-
- virtual QFixed ascent() const Q_DECL_OVERRIDE;
- virtual QFixed capHeight() const Q_DECL_OVERRIDE;
- virtual QFixed descent() const Q_DECL_OVERRIDE;
- virtual QFixed leading() const Q_DECL_OVERRIDE;
- virtual QFixed xHeight() const Q_DECL_OVERRIDE;
- virtual QFixed averageCharWidth() const Q_DECL_OVERRIDE;
- virtual QImage alphaMapForGlyph(glyph_t) Q_DECL_OVERRIDE;
- virtual QImage alphaMapForGlyph(glyph_t glyph, QFixed subPixelPosition) Q_DECL_OVERRIDE;
- virtual QImage alphaMapForGlyph(glyph_t, const QTransform &t) Q_DECL_OVERRIDE;
- virtual QImage alphaMapForGlyph(glyph_t, QFixed subPixelPosition, const QTransform &t) Q_DECL_OVERRIDE;
- virtual QImage alphaRGBMapForGlyph(glyph_t, QFixed subPixelPosition, const QTransform &t) Q_DECL_OVERRIDE;
-
- virtual QFixed lineThickness() const Q_DECL_OVERRIDE;
- virtual QFixed underlinePosition() const Q_DECL_OVERRIDE;
- virtual qreal maxCharWidth() const Q_DECL_OVERRIDE;
- virtual qreal minLeftBearing() const Q_DECL_OVERRIDE;
- virtual qreal minRightBearing() const Q_DECL_OVERRIDE;
-
- virtual bool canRender(const QChar *string, int len) const Q_DECL_OVERRIDE;
+ virtual glyph_t glyphIndex(uint ucs4) const override;
+ virtual bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, ShaperFlags flags) const override;
+
+ virtual glyph_metrics_t boundingBox(const QGlyphLayout &glyphs) override;
+ virtual glyph_metrics_t boundingBox(glyph_t glyph) override;
+
+ virtual void recalcAdvances(QGlyphLayout *, ShaperFlags) const override;
+ virtual void doKerning(QGlyphLayout *, ShaperFlags) const override;
+ virtual void addOutlineToPath(qreal, qreal, const QGlyphLayout &, QPainterPath *, QTextItem::RenderFlags flags) override;
+ virtual void getGlyphBearings(glyph_t glyph, qreal *leftBearing = 0, qreal *rightBearing = 0) override;
+
+ virtual QFixed ascent() const override;
+ virtual QFixed capHeight() const override;
+ virtual QFixed descent() const override;
+ virtual QFixed leading() const override;
+ virtual QFixed xHeight() const override;
+ virtual QFixed averageCharWidth() const override;
+ virtual QImage alphaMapForGlyph(glyph_t) override;
+ virtual QImage alphaMapForGlyph(glyph_t glyph, QFixed subPixelPosition) override;
+ virtual QImage alphaMapForGlyph(glyph_t, const QTransform &t) override;
+ virtual QImage alphaMapForGlyph(glyph_t, QFixed subPixelPosition, const QTransform &t) override;
+ virtual QImage alphaRGBMapForGlyph(glyph_t, QFixed subPixelPosition, const QTransform &t) override;
+
+ virtual QFixed lineThickness() const override;
+ virtual QFixed underlinePosition() const override;
+ virtual qreal maxCharWidth() const override;
+ virtual qreal minLeftBearing() const override;
+ virtual qreal minRightBearing() const override;
+
+ virtual bool canRender(const QChar *string, int len) const override;
inline int fallbackFamilyCount() const { return m_fallbackFamilies.size(); }
inline QString fallbackFamilyAt(int at) const { return m_fallbackFamilies.at(at); }
diff --git a/src/gui/text/qfontengine_qpf2_p.h b/src/gui/text/qfontengine_qpf2_p.h
index e5c38ffbaf..b2dc620ad1 100644
--- a/src/gui/text/qfontengine_qpf2_p.h
+++ b/src/gui/text/qfontengine_qpf2_p.h
@@ -158,30 +158,30 @@ public:
QFontEngineQPF2(const QFontDef &def, const QByteArray &data);
~QFontEngineQPF2();
- FaceId faceId() const Q_DECL_OVERRIDE { return face_id; }
- bool getSfntTableData(uint tag, uchar *buffer, uint *length) const Q_DECL_OVERRIDE;
-
- virtual glyph_t glyphIndex(uint ucs4) const Q_DECL_OVERRIDE;
- bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, ShaperFlags flags) const Q_DECL_OVERRIDE;
- void recalcAdvances(QGlyphLayout *, ShaperFlags) const Q_DECL_OVERRIDE;
-
- void addOutlineToPath(qreal x, qreal y, const QGlyphLayout &glyphs, QPainterPath *path, QTextItem::RenderFlags flags) Q_DECL_OVERRIDE;
- QImage alphaMapForGlyph(glyph_t t) Q_DECL_OVERRIDE;
-
- glyph_metrics_t boundingBox(const QGlyphLayout &glyphs) Q_DECL_OVERRIDE;
- glyph_metrics_t boundingBox(glyph_t glyph) Q_DECL_OVERRIDE;
-
- QFixed ascent() const Q_DECL_OVERRIDE;
- QFixed capHeight() const Q_DECL_OVERRIDE;
- QFixed descent() const Q_DECL_OVERRIDE;
- QFixed leading() const Q_DECL_OVERRIDE;
- qreal maxCharWidth() const Q_DECL_OVERRIDE;
- qreal minLeftBearing() const Q_DECL_OVERRIDE;
- qreal minRightBearing() const Q_DECL_OVERRIDE;
- QFixed underlinePosition() const Q_DECL_OVERRIDE;
- QFixed lineThickness() const Q_DECL_OVERRIDE;
-
- virtual int glyphCount() const Q_DECL_OVERRIDE { return glyphMapEntries; }
+ FaceId faceId() const override { return face_id; }
+ bool getSfntTableData(uint tag, uchar *buffer, uint *length) const override;
+
+ virtual glyph_t glyphIndex(uint ucs4) const override;
+ bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, ShaperFlags flags) const override;
+ void recalcAdvances(QGlyphLayout *, ShaperFlags) const override;
+
+ void addOutlineToPath(qreal x, qreal y, const QGlyphLayout &glyphs, QPainterPath *path, QTextItem::RenderFlags flags) override;
+ QImage alphaMapForGlyph(glyph_t t) override;
+
+ glyph_metrics_t boundingBox(const QGlyphLayout &glyphs) override;
+ glyph_metrics_t boundingBox(glyph_t glyph) override;
+
+ QFixed ascent() const override;
+ QFixed capHeight() const override;
+ QFixed descent() const override;
+ QFixed leading() const override;
+ qreal maxCharWidth() const override;
+ qreal minLeftBearing() const override;
+ qreal minRightBearing() const override;
+ QFixed underlinePosition() const override;
+ QFixed lineThickness() const override;
+
+ virtual int glyphCount() const override { return glyphMapEntries; }
bool isValid() const;
diff --git a/src/gui/text/qfontmetrics.cpp b/src/gui/text/qfontmetrics.cpp
index 5675d6921d..5ad57b064b 100644
--- a/src/gui/text/qfontmetrics.cpp
+++ b/src/gui/text/qfontmetrics.cpp
@@ -510,6 +510,7 @@ int QFontMetrics::rightBearing(QChar ch) const
return qRound(rb);
}
+#if QT_DEPRECATED_SINCE(5, 11)
/*!
Returns the width in pixels of the first \a len characters of \a
text. If \a len is negative (the default), the entire string is
@@ -520,11 +521,13 @@ int QFontMetrics::rightBearing(QChar ch) const
string will cover whereas width() returns the distance to where
the next string should be drawn.
+ \deprecated in Qt 5.11. Use horizontalAdvance() instead.
+
\sa boundingRect()
*/
int QFontMetrics::width(const QString &text, int len) const
{
- return width(text, len, 0);
+ return horizontalAdvance(text, len);
}
/*!
@@ -532,17 +535,17 @@ int QFontMetrics::width(const QString &text, int len) const
*/
int QFontMetrics::width(const QString &text, int len, int flags) const
{
- int pos = text.indexOf(QLatin1Char('\x9c'));
- if (pos != -1) {
- len = (len < 0) ? pos : qMin(pos, len);
- } else if (len < 0) {
- len = text.length();
- }
- if (len == 0)
- return 0;
-
-#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
+#if QT_DEPRECATED_SINCE(5, 11) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
if (flags & Qt::TextBypassShaping) {
+ int pos = text.indexOf(QLatin1Char('\x9c'));
+ if (pos != -1) {
+ len = (len < 0) ? pos : qMin(pos, len);
+ } else if (len < 0) {
+ len = text.length();
+ }
+ if (len == 0)
+ return 0;
+
// Skip complex shaping, only use advances
int numGlyphs = len;
QVarLengthGlyphLayoutArray glyphs(numGlyphs);
@@ -555,10 +558,11 @@ int QFontMetrics::width(const QString &text, int len, int flags) const
width += glyphs.advances[i];
return qRound(width);
}
+#else
+ Q_UNUSED(flags)
#endif
- QStackTextEngine layout(text, QFont(d.data()));
- return qRound(layout.width(0, len));
+ return horizontalAdvance(text, len);
}
/*!
@@ -577,6 +581,8 @@ int QFontMetrics::width(const QString &text, int len, int flags) const
in this particular font are both negative, while the bearings of
"o" are both positive.
+ \deprecated in Qt 5.11. Use horizontalAdvance() instead.
+
\warning This function will produce incorrect results for Arabic
characters or non-spacing marks in the middle of a string, as the
glyph shaping and positioning of marks that happens when
@@ -587,6 +593,65 @@ int QFontMetrics::width(const QString &text, int len, int flags) const
*/
int QFontMetrics::width(QChar ch) const
{
+ return horizontalAdvance(ch);
+}
+#endif // QT_DEPRECATED_SINCE(5, 11)
+
+/*!
+ Returns the horizontal advance in pixels of the first \a len characters of \a
+ text. If \a len is negative (the default), the entire string is
+ used.
+
+ This is the distance appropriate for drawing a subsequent character
+ after \a text.
+
+ \since 5.11
+
+ \sa boundingRect()
+*/
+int QFontMetrics::horizontalAdvance(const QString &text, int len) const
+{
+ int pos = text.indexOf(QLatin1Char('\x9c'));
+ if (pos != -1) {
+ len = (len < 0) ? pos : qMin(pos, len);
+ } else if (len < 0) {
+ len = text.length();
+ }
+ if (len == 0)
+ return 0;
+
+ QStackTextEngine layout(text, QFont(d.data()));
+ return qRound(layout.width(0, len));
+}
+
+/*!
+ \overload
+
+ \image bearings.png Bearings
+
+ Returns the horizontal advance of character \a ch in pixels. This is a
+ distance appropriate for drawing a subsequent character after \a
+ ch.
+
+ Some of the metrics are described in the image. The
+ central dark rectangles cover the logical horizontalAdvance() of each
+ character. The outer pale rectangles cover the leftBearing() and
+ rightBearing() of each character. Notice that the bearings of "f"
+ in this particular font are both negative, while the bearings of
+ "o" are both positive.
+
+ \warning This function will produce incorrect results for Arabic
+ characters or non-spacing marks in the middle of a string, as the
+ glyph shaping and positioning of marks that happens when
+ processing strings cannot be taken into account. When implementing
+ an interactive text control, use QTextLayout instead.
+
+ \since 5.11
+
+ \sa boundingRect()
+*/
+int QFontMetrics::horizontalAdvance(QChar ch) const
+{
if (QChar::category(ch.unicode()) == QChar::Mark_NonSpacing)
return 0;
@@ -677,7 +742,7 @@ int QFontMetrics::charWidth(const QString &text, int pos) const
rectangle might be different than what the width() method returns.
If you want to know the advance width of the string (to lay out
- a set of strings next to each other), use width() instead.
+ a set of strings next to each other), use horizontalAdvance() instead.
Newline characters are processed as normal characters, \e not as
linebreaks.
@@ -711,7 +776,7 @@ QRect QFontMetrics::boundingRect(const QString &text) const
base line.
\warning The width of the returned rectangle is not the advance width
- of the character. Use boundingRect(const QString &) or width() instead.
+ of the character. Use boundingRect(const QString &) or horizontalAdvance() instead.
\sa width()
*/
@@ -846,7 +911,7 @@ QSize QFontMetrics::size(int flags, const QString &text, int tabStops, int *tabA
rectangle might be different than what the width() method returns.
If you want to know the advance width of the string (to lay out
- a set of strings next to each other), use width() instead.
+ a set of strings next to each other), use horizontalAdvance() instead.
Newline characters are processed as normal characters, \e not as
linebreaks.
@@ -1396,6 +1461,7 @@ qreal QFontMetricsF::rightBearing(QChar ch) const
}
+#if QT_DEPRECATED_SINCE(5, 11)
/*!
Returns the width in pixels of the characters in the given \a text.
@@ -1404,16 +1470,73 @@ qreal QFontMetricsF::rightBearing(QChar ch) const
describing the pixels this string will cover whereas width()
returns the distance to where the next string should be drawn.
+ \deprecated in Qt 5.11. Use horizontalAdvance() instead.
+
\sa boundingRect()
*/
qreal QFontMetricsF::width(const QString &text) const
{
+ return horizontalAdvance(text);
+}
+
+/*!
+ \overload
+
+ \image bearings.png Bearings
+
+ Returns the logical width of character \a ch in pixels. This is a
+ distance appropriate for drawing a subsequent character after \a
+ ch.
+
+ Some of the metrics are described in the image to the right. The
+ central dark rectangles cover the logical width() of each
+ character. The outer pale rectangles cover the leftBearing() and
+ rightBearing() of each character. Notice that the bearings of "f"
+ in this particular font are both negative, while the bearings of
+ "o" are both positive.
+
+ \deprecated in Qt 5.11. Use horizontalAdvance() instead.
+
+ \warning This function will produce incorrect results for Arabic
+ characters or non-spacing marks in the middle of a string, as the
+ glyph shaping and positioning of marks that happens when
+ processing strings cannot be taken into account. When implementing
+ an interactive text control, use QTextLayout instead.
+
+ \sa boundingRect()
+*/
+qreal QFontMetricsF::width(QChar ch) const
+{
+ return horizontalAdvance(ch);
+}
+#endif
+
+/*!
+ Returns the horizontal advance in pixels of the first \a length characters of \a
+ text. If \a length is negative (the default), the entire string is
+ used.
+
+ The advance is the distance appropriate for drawing a subsequent
+ character after \a text.
+
+ \since 5.11
+
+ \sa boundingRect()
+*/
+qreal QFontMetricsF::horizontalAdvance(const QString &text, int length) const
+{
int pos = text.indexOf(QLatin1Char('\x9c'));
- int len = (pos != -1) ? pos : text.length();
+ if (pos != -1)
+ length = (length < 0) ? pos : qMin(pos, length);
+ else if (length < 0)
+ length = text.length();
+
+ if (length == 0)
+ return 0;
QStackTextEngine layout(text, QFont(d.data()));
layout.itemize();
- return layout.width(0, len).toReal();
+ return layout.width(0, length).toReal();
}
/*!
@@ -1421,7 +1544,7 @@ qreal QFontMetricsF::width(const QString &text) const
\image bearings.png Bearings
- Returns the logical width of character \a ch in pixels. This is a
+ Returns the horizontal advance of character \a ch in pixels. This is a
distance appropriate for drawing a subsequent character after \a
ch.
@@ -1438,9 +1561,11 @@ qreal QFontMetricsF::width(const QString &text) const
processing strings cannot be taken into account. When implementing
an interactive text control, use QTextLayout instead.
+ \since 5.11
+
\sa boundingRect()
*/
-qreal QFontMetricsF::width(QChar ch) const
+qreal QFontMetricsF::horizontalAdvance(QChar ch) const
{
if (ch.category() == QChar::Mark_NonSpacing)
return 0.;
@@ -1467,6 +1592,7 @@ qreal QFontMetricsF::width(QChar ch) const
return advance.toReal();
}
+
/*!
Returns the bounding rectangle of the characters in the string
specified by \a text. The bounding rectangle always covers at least
@@ -1477,7 +1603,7 @@ qreal QFontMetricsF::width(QChar ch) const
rectangle might be different than what the width() method returns.
If you want to know the advance width of the string (to lay out
- a set of strings next to each other), use width() instead.
+ a set of strings next to each other), use horizontalAdvance() instead.
Newline characters are processed as normal characters, \e not as
linebreaks.
@@ -1650,7 +1776,7 @@ QSizeF QFontMetricsF::size(int flags, const QString &text, int tabStops, int *ta
rectangle might be different than what the width() method returns.
If you want to know the advance width of the string (to lay out
- a set of strings next to each other), use width() instead.
+ a set of strings next to each other), use horizontalAdvance() instead.
Newline characters are processed as normal characters, \e not as
linebreaks.
diff --git a/src/gui/text/qfontmetrics.h b/src/gui/text/qfontmetrics.h
index 3eac309092..b6167a1d47 100644
--- a/src/gui/text/qfontmetrics.h
+++ b/src/gui/text/qfontmetrics.h
@@ -90,10 +90,16 @@ public:
int leftBearing(QChar) const;
int rightBearing(QChar) const;
+
+#if QT_DEPRECATED_SINCE(5, 11)
int width(const QString &, int len = -1) const;
int width(const QString &, int len, int flags) const;
-
int width(QChar) const;
+#endif
+
+ int horizontalAdvance(const QString &, int len = -1) const;
+ int horizontalAdvance(QChar) const;
+
#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
QT_DEPRECATED int charWidth(const QString &str, int pos) const;
#endif
@@ -101,11 +107,11 @@ public:
QRect boundingRect(QChar) const;
QRect boundingRect(const QString &text) const;
- QRect boundingRect(const QRect &r, int flags, const QString &text, int tabstops = 0, int *tabarray = Q_NULLPTR) const;
+ QRect boundingRect(const QRect &r, int flags, const QString &text, int tabstops = 0, int *tabarray = nullptr) const;
inline QRect boundingRect(int x, int y, int w, int h, int flags, const QString &text,
- int tabstops = 0, int *tabarray = Q_NULLPTR) const
+ int tabstops = 0, int *tabarray = nullptr) const
{ return boundingRect(QRect(x, y, w, h), flags, text, tabstops, tabarray); }
- QSize size(int flags, const QString& str, int tabstops = 0, int *tabarray = Q_NULLPTR) const;
+ QSize size(int flags, const QString& str, int tabstops = 0, int *tabarray = nullptr) const;
QRect tightBoundingRect(const QString &text) const;
@@ -164,14 +170,19 @@ public:
qreal leftBearing(QChar) const;
qreal rightBearing(QChar) const;
- qreal width(const QString &string) const;
+#if QT_DEPRECATED_SINCE(5, 11)
+ qreal width(const QString &string) const;
qreal width(QChar) const;
+#endif
+
+ qreal horizontalAdvance(const QString &string, int length = -1) const;
+ qreal horizontalAdvance(QChar) const;
QRectF boundingRect(const QString &string) const;
QRectF boundingRect(QChar) const;
- QRectF boundingRect(const QRectF &r, int flags, const QString& string, int tabstops = 0, int *tabarray = Q_NULLPTR) const;
- QSizeF size(int flags, const QString& str, int tabstops = 0, int *tabarray = Q_NULLPTR) const;
+ QRectF boundingRect(const QRectF &r, int flags, const QString& string, int tabstops = 0, int *tabarray = nullptr) const;
+ QSizeF size(int flags, const QString& str, int tabstops = 0, int *tabarray = nullptr) const;
QRectF tightBoundingRect(const QString &text) const;
diff --git a/src/gui/text/qstatictext.cpp b/src/gui/text/qstatictext.cpp
index dbc2e6e558..d6f97547c4 100644
--- a/src/gui/text/qstatictext.cpp
+++ b/src/gui/text/qstatictext.cpp
@@ -439,7 +439,7 @@ namespace {
{
}
- virtual void updateState(const QPaintEngineState &newState) Q_DECL_OVERRIDE
+ virtual void updateState(const QPaintEngineState &newState) override
{
if (newState.state() & QPaintEngine::DirtyPen
&& newState.pen().color() != m_currentColor) {
@@ -448,7 +448,7 @@ namespace {
}
}
- virtual void drawTextItem(const QPointF &position, const QTextItem &textItem) Q_DECL_OVERRIDE
+ virtual void drawTextItem(const QPointF &position, const QTextItem &textItem) override
{
const QTextItemInt &ti = static_cast<const QTextItemInt &>(textItem);
@@ -484,15 +484,15 @@ namespace {
m_items.append(currentItem);
}
- virtual void drawPolygon(const QPointF *, int , PolygonDrawMode ) Q_DECL_OVERRIDE
+ virtual void drawPolygon(const QPointF *, int , PolygonDrawMode ) override
{
/* intentionally empty */
}
- virtual bool begin(QPaintDevice *) Q_DECL_OVERRIDE { return true; }
- virtual bool end() Q_DECL_OVERRIDE { return true; }
- virtual void drawPixmap(const QRectF &, const QPixmap &, const QRectF &) Q_DECL_OVERRIDE {}
- virtual Type type() const Q_DECL_OVERRIDE
+ virtual bool begin(QPaintDevice *) override { return true; }
+ virtual bool end() override { return true; }
+ virtual void drawPixmap(const QRectF &, const QPixmap &, const QRectF &) override {}
+ virtual Type type() const override
{
return User;
}
@@ -537,7 +537,7 @@ namespace {
delete m_paintEngine;
}
- int metric(PaintDeviceMetric m) const Q_DECL_OVERRIDE
+ int metric(PaintDeviceMetric m) const override
{
int val;
switch (m) {
@@ -574,7 +574,7 @@ namespace {
return val;
}
- virtual QPaintEngine *paintEngine() const Q_DECL_OVERRIDE
+ virtual QPaintEngine *paintEngine() const override
{
return m_paintEngine;
}
diff --git a/src/gui/text/qtextdocument.h b/src/gui/text/qtextdocument.h
index c2761a39b9..41c578fc1b 100644
--- a/src/gui/text/qtextdocument.h
+++ b/src/gui/text/qtextdocument.h
@@ -116,11 +116,11 @@ class Q_GUI_EXPORT QTextDocument : public QObject
Q_PROPERTY(QUrl baseUrl READ baseUrl WRITE setBaseUrl NOTIFY baseUrlChanged)
public:
- explicit QTextDocument(QObject *parent = Q_NULLPTR);
- explicit QTextDocument(const QString &text, QObject *parent = Q_NULLPTR);
+ explicit QTextDocument(QObject *parent = nullptr);
+ explicit QTextDocument(const QString &text, QObject *parent = nullptr);
~QTextDocument();
- QTextDocument *clone(QObject *parent = Q_NULLPTR) const;
+ QTextDocument *clone(QObject *parent = nullptr) const;
bool isEmpty() const;
virtual void clear();
diff --git a/src/gui/text/qtextdocumentlayout_p.h b/src/gui/text/qtextdocumentlayout_p.h
index 710c49628e..2054ebaa35 100644
--- a/src/gui/text/qtextdocumentlayout_p.h
+++ b/src/gui/text/qtextdocumentlayout_p.h
@@ -73,11 +73,11 @@ public:
explicit QTextDocumentLayout(QTextDocument *doc);
// from the abstract layout
- void draw(QPainter *painter, const PaintContext &context) Q_DECL_OVERRIDE;
- int hitTest(const QPointF &point, Qt::HitTestAccuracy accuracy) const Q_DECL_OVERRIDE;
+ void draw(QPainter *painter, const PaintContext &context) override;
+ int hitTest(const QPointF &point, Qt::HitTestAccuracy accuracy) const override;
- int pageCount() const Q_DECL_OVERRIDE;
- QSizeF documentSize() const Q_DECL_OVERRIDE;
+ int pageCount() const override;
+ QSizeF documentSize() const override;
void setCursorWidth(int width);
int cursorWidth() const;
@@ -88,8 +88,8 @@ public:
// internal for QTextEdit's NoWrap mode
void setViewport(const QRectF &viewport);
- virtual QRectF frameBoundingRect(QTextFrame *frame) const Q_DECL_OVERRIDE;
- virtual QRectF blockBoundingRect(const QTextBlock &block) const Q_DECL_OVERRIDE;
+ virtual QRectF frameBoundingRect(QTextFrame *frame) const override;
+ virtual QRectF blockBoundingRect(const QTextBlock &block) const override;
QRectF tableBoundingRect(QTextTable *table) const;
QRectF tableCellBoundingRect(QTextTable *table, const QTextTableCell &cell) const;
@@ -104,12 +104,12 @@ public:
bool contentHasAlignment() const;
protected:
- void documentChanged(int from, int oldLength, int length) Q_DECL_OVERRIDE;
- void resizeInlineObject(QTextInlineObject item, int posInDocument, const QTextFormat &format) Q_DECL_OVERRIDE;
- void positionInlineObject(QTextInlineObject item, int posInDocument, const QTextFormat &format) Q_DECL_OVERRIDE;
+ void documentChanged(int from, int oldLength, int length) override;
+ void resizeInlineObject(QTextInlineObject item, int posInDocument, const QTextFormat &format) override;
+ void positionInlineObject(QTextInlineObject item, int posInDocument, const QTextFormat &format) override;
void drawInlineObject(QPainter *p, const QRectF &rect, QTextInlineObject item,
- int posInDocument, const QTextFormat &format) Q_DECL_OVERRIDE;
- virtual void timerEvent(QTimerEvent *e) Q_DECL_OVERRIDE;
+ int posInDocument, const QTextFormat &format) override;
+ virtual void timerEvent(QTimerEvent *e) override;
private:
QRectF doLayout(int from, int oldLength, int length);
void layoutFinished();
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp
index faddb3552d..71f02376ac 100644
--- a/src/gui/text/qtextengine.cpp
+++ b/src/gui/text/qtextengine.cpp
@@ -1242,7 +1242,7 @@ int QTextEngine::shapeTextWithHarfbuzzNG(const QScriptItem &si,
{ HB_TAG('h','l','i','g'), !dontLigate, 0, uint(-1) } };
const int num_features = dontLigate ? 5 : 1;
- const char *const *shaper_list = Q_NULLPTR;
+ const char *const *shaper_list = nullptr;
#if defined(Q_OS_DARWIN)
// What's behind QFontEngine::FaceData::user_data isn't compatible between different font engines
// - specifically functions in hb-coretext.cc would run into undefined behavior with data
@@ -1252,7 +1252,7 @@ int QTextEngine::shapeTextWithHarfbuzzNG(const QScriptItem &si,
"graphite2",
"ot",
"fallback",
- Q_NULLPTR
+ nullptr
};
shaper_list = s_shaper_list_without_coretext;
}
diff --git a/src/gui/text/qtexthtmlparser.cpp b/src/gui/text/qtexthtmlparser.cpp
index be10efad8d..9154182df1 100644
--- a/src/gui/text/qtexthtmlparser.cpp
+++ b/src/gui/text/qtexthtmlparser.cpp
@@ -1708,14 +1708,14 @@ public:
inline QTextHtmlStyleSelector(const QTextHtmlParser *parser)
: parser(parser) { nameCaseSensitivity = Qt::CaseInsensitive; }
- virtual QStringList nodeNames(NodePtr node) const Q_DECL_OVERRIDE;
- virtual QString attribute(NodePtr node, const QString &name) const Q_DECL_OVERRIDE;
- virtual bool hasAttributes(NodePtr node) const Q_DECL_OVERRIDE;
- virtual bool isNullNode(NodePtr node) const Q_DECL_OVERRIDE;
- virtual NodePtr parentNode(NodePtr node) const Q_DECL_OVERRIDE;
- virtual NodePtr previousSiblingNode(NodePtr node) const Q_DECL_OVERRIDE;
- virtual NodePtr duplicateNode(NodePtr node) const Q_DECL_OVERRIDE;
- virtual void freeNode(NodePtr node) const Q_DECL_OVERRIDE;
+ virtual QStringList nodeNames(NodePtr node) const override;
+ virtual QString attribute(NodePtr node, const QString &name) const override;
+ virtual bool hasAttributes(NodePtr node) const override;
+ virtual bool isNullNode(NodePtr node) const override;
+ virtual NodePtr parentNode(NodePtr node) const override;
+ virtual NodePtr previousSiblingNode(NodePtr node) const override;
+ virtual NodePtr duplicateNode(NodePtr node) const override;
+ virtual void freeNode(NodePtr node) const override;
private:
const QTextHtmlParser *parser;
diff --git a/src/gui/text/qtextimagehandler_p.h b/src/gui/text/qtextimagehandler_p.h
index a22c91ecbf..339ef0af4f 100644
--- a/src/gui/text/qtextimagehandler_p.h
+++ b/src/gui/text/qtextimagehandler_p.h
@@ -67,8 +67,8 @@ class Q_GUI_EXPORT QTextImageHandler : public QObject,
public:
explicit QTextImageHandler(QObject *parent = 0);
- virtual QSizeF intrinsicSize(QTextDocument *doc, int posInDocument, const QTextFormat &format) Q_DECL_OVERRIDE;
- virtual void drawObject(QPainter *p, const QRectF &rect, QTextDocument *doc, int posInDocument, const QTextFormat &format) Q_DECL_OVERRIDE;
+ virtual QSizeF intrinsicSize(QTextDocument *doc, int posInDocument, const QTextFormat &format) override;
+ virtual void drawObject(QPainter *p, const QRectF &rect, QTextDocument *doc, int posInDocument, const QTextFormat &format) override;
QImage image(QTextDocument *doc, const QTextImageFormat &imageFormat);
};
diff --git a/src/gui/text/qtextlayout.h b/src/gui/text/qtextlayout.h
index 980a099b05..67bc75a6b8 100644
--- a/src/gui/text/qtextlayout.h
+++ b/src/gui/text/qtextlayout.h
@@ -69,7 +69,7 @@ class Q_GUI_EXPORT QTextInlineObject
{
public:
QTextInlineObject(int i, QTextEngine *e) : itm(i), eng(e) {}
- inline QTextInlineObject() : itm(0), eng(Q_NULLPTR) {}
+ inline QTextInlineObject() : itm(0), eng(nullptr) {}
inline bool isValid() const { return eng; }
QRectF rect() const;
@@ -107,7 +107,7 @@ public:
// does itemization
QTextLayout();
QTextLayout(const QString& text);
- QTextLayout(const QString& text, const QFont &font, QPaintDevice *paintdevice = Q_NULLPTR);
+ QTextLayout(const QString& text, const QFont &font, QPaintDevice *paintdevice = nullptr);
QTextLayout(const QTextBlock &b);
~QTextLayout();
@@ -210,7 +210,7 @@ Q_DECLARE_TYPEINFO(QTextLayout::FormatRange, Q_RELOCATABLE_TYPE);
class Q_GUI_EXPORT QTextLine
{
public:
- inline QTextLine() : index(0), eng(Q_NULLPTR) {}
+ inline QTextLine() : index(0), eng(nullptr) {}
inline bool isValid() const { return eng; }
QRectF rect() const;
@@ -255,7 +255,7 @@ public:
int lineNumber() const { return index; }
- void draw(QPainter *p, const QPointF &point, const QTextLayout::FormatRange *selection = Q_NULLPTR) const;
+ void draw(QPainter *p, const QPointF &point, const QTextLayout::FormatRange *selection = nullptr) const;
#if !defined(QT_NO_RAWFONT)
QList<QGlyphRun> glyphRuns(int from = -1, int length = -1) const;
diff --git a/src/gui/text/qtextobject.h b/src/gui/text/qtextobject.h
index a5030de112..7e4efa28f8 100644
--- a/src/gui/text/qtextobject.h
+++ b/src/gui/text/qtextobject.h
@@ -203,7 +203,7 @@ class Q_GUI_EXPORT QTextBlock
friend class QSyntaxHighlighter;
public:
inline QTextBlock(QTextDocumentPrivate *priv, int b) : p(priv), n(b) {}
- inline QTextBlock() : p(Q_NULLPTR), n(0) {}
+ inline QTextBlock() : p(nullptr), n(0) {}
inline QTextBlock(const QTextBlock &o) : p(o.p), n(o.n) {}
inline QTextBlock &operator=(const QTextBlock &o) { p = o.p; n = o.n; return *this; }
@@ -260,7 +260,7 @@ public:
friend class QTextBlock;
iterator(const QTextDocumentPrivate *priv, int begin, int end, int f) : p(priv), b(begin), e(end), n(f) {}
public:
- iterator() : p(Q_NULLPTR), b(0), e(0), n(0) {}
+ iterator() : p(nullptr), b(0), e(0), n(0) {}
#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
iterator(const iterator &o) : p(o.p), b(o.b), e(o.e), n(o.n) {}
#endif
@@ -304,7 +304,7 @@ class Q_GUI_EXPORT QTextFragment
{
public:
inline QTextFragment(const QTextDocumentPrivate *priv, int f, int fe) : p(priv), n(f), ne(fe) {}
- inline QTextFragment() : p(Q_NULLPTR), n(0), ne(0) {}
+ inline QTextFragment() : p(nullptr), n(0), ne(0) {}
inline QTextFragment(const QTextFragment &o) : p(o.p), n(o.n), ne(o.ne) {}
inline QTextFragment &operator=(const QTextFragment &o) { p = o.p; n = o.n; ne = o.ne; return *this; }
diff --git a/src/gui/text/qtextodfwriter.cpp b/src/gui/text/qtextodfwriter.cpp
index 3dd19a6eda..30f5bc1051 100644
--- a/src/gui/text/qtextodfwriter.cpp
+++ b/src/gui/text/qtextodfwriter.cpp
@@ -94,7 +94,7 @@ public:
if (contentStream)
contentStream->close();
}
- virtual void addFile(const QString &, const QString &, const QByteArray &) Q_DECL_OVERRIDE
+ virtual void addFile(const QString &, const QString &, const QByteArray &) override
{
// we ignore this...
}
@@ -137,7 +137,7 @@ public:
zip.close();
}
- virtual void addFile(const QString &fileName, const QString &mimeType, const QByteArray &bytes) Q_DECL_OVERRIDE
+ virtual void addFile(const QString &fileName, const QString &mimeType, const QByteArray &bytes) override
{
zip.addFile(fileName, bytes);
addFile(fileName, mimeType);
diff --git a/src/gui/text/qtexttable.h b/src/gui/text/qtexttable.h
index ee8e974396..156b091b05 100644
--- a/src/gui/text/qtexttable.h
+++ b/src/gui/text/qtexttable.h
@@ -54,7 +54,7 @@ class QTextTablePrivate;
class Q_GUI_EXPORT QTextTableCell
{
public:
- QTextTableCell() : table(Q_NULLPTR) {}
+ QTextTableCell() : table(nullptr) {}
~QTextTableCell() {}
QTextTableCell(const QTextTableCell &o) : table(o.table), fragment(o.fragment) {}
QTextTableCell &operator=(const QTextTableCell &o)
@@ -69,7 +69,7 @@ public:
int rowSpan() const;
int columnSpan() const;
- inline bool isValid() const { return table != Q_NULLPTR; }
+ inline bool isValid() const { return table != nullptr; }
QTextCursor firstCursorPosition() const;
QTextCursor lastCursorPosition() const;
diff --git a/src/gui/text/qtexttable_p.h b/src/gui/text/qtexttable_p.h
index 848537272d..c969e1d5bc 100644
--- a/src/gui/text/qtexttable_p.h
+++ b/src/gui/text/qtexttable_p.h
@@ -65,8 +65,8 @@ public:
~QTextTablePrivate();
static QTextTable *createTable(QTextDocumentPrivate *, int pos, int rows, int cols, const QTextTableFormat &tableFormat);
- void fragmentAdded(QChar type, uint fragment) Q_DECL_OVERRIDE;
- void fragmentRemoved(QChar type, uint fragment) Q_DECL_OVERRIDE;
+ void fragmentAdded(QChar type, uint fragment) override;
+ void fragmentRemoved(QChar type, uint fragment) override;
void update() const;
diff --git a/src/gui/util/qvalidator.h b/src/gui/util/qvalidator.h
index eba4b54672..ad23092537 100644
--- a/src/gui/util/qvalidator.h
+++ b/src/gui/util/qvalidator.h
@@ -59,7 +59,7 @@ class Q_GUI_EXPORT QValidator : public QObject
{
Q_OBJECT
public:
- explicit QValidator(QObject * parent = Q_NULLPTR);
+ explicit QValidator(QObject * parent = nullptr);
~QValidator();
enum State {
@@ -93,12 +93,12 @@ class Q_GUI_EXPORT QIntValidator : public QValidator
Q_PROPERTY(int top READ top WRITE setTop NOTIFY topChanged)
public:
- explicit QIntValidator(QObject * parent = Q_NULLPTR);
- QIntValidator(int bottom, int top, QObject *parent = Q_NULLPTR);
+ explicit QIntValidator(QObject * parent = nullptr);
+ QIntValidator(int bottom, int top, QObject *parent = nullptr);
~QIntValidator();
- QValidator::State validate(QString &, int &) const Q_DECL_OVERRIDE;
- void fixup(QString &input) const Q_DECL_OVERRIDE;
+ QValidator::State validate(QString &, int &) const override;
+ void fixup(QString &input) const override;
void setBottom(int);
void setTop(int);
@@ -130,8 +130,8 @@ class Q_GUI_EXPORT QDoubleValidator : public QValidator
Q_PROPERTY(Notation notation READ notation WRITE setNotation NOTIFY notationChanged)
public:
- explicit QDoubleValidator(QObject * parent = Q_NULLPTR);
- QDoubleValidator(double bottom, double top, int decimals, QObject *parent = Q_NULLPTR);
+ explicit QDoubleValidator(QObject * parent = nullptr);
+ QDoubleValidator(double bottom, double top, int decimals, QObject *parent = nullptr);
~QDoubleValidator();
enum Notation {
@@ -139,7 +139,7 @@ public:
ScientificNotation
};
Q_ENUM(Notation)
- QValidator::State validate(QString &, int &) const Q_DECL_OVERRIDE;
+ QValidator::State validate(QString &, int &) const override;
virtual void setRange(double bottom, double top, int decimals = 0);
void setBottom(double);
@@ -174,11 +174,11 @@ class Q_GUI_EXPORT QRegExpValidator : public QValidator
Q_PROPERTY(QRegExp regExp READ regExp WRITE setRegExp NOTIFY regExpChanged)
public:
- explicit QRegExpValidator(QObject *parent = Q_NULLPTR);
- explicit QRegExpValidator(const QRegExp& rx, QObject *parent = Q_NULLPTR);
+ explicit QRegExpValidator(QObject *parent = nullptr);
+ explicit QRegExpValidator(const QRegExp& rx, QObject *parent = nullptr);
~QRegExpValidator();
- virtual QValidator::State validate(QString& input, int& pos) const Q_DECL_OVERRIDE;
+ virtual QValidator::State validate(QString& input, int& pos) const override;
void setRegExp(const QRegExp& rx);
const QRegExp& regExp() const { return r; }
@@ -204,11 +204,11 @@ class Q_GUI_EXPORT QRegularExpressionValidator : public QValidator
Q_PROPERTY(QRegularExpression regularExpression READ regularExpression WRITE setRegularExpression NOTIFY regularExpressionChanged)
public:
- explicit QRegularExpressionValidator(QObject *parent = Q_NULLPTR);
- explicit QRegularExpressionValidator(const QRegularExpression &re, QObject *parent = Q_NULLPTR);
+ explicit QRegularExpressionValidator(QObject *parent = nullptr);
+ explicit QRegularExpressionValidator(const QRegularExpression &re, QObject *parent = nullptr);
~QRegularExpressionValidator();
- virtual QValidator::State validate(QString &input, int &pos) const Q_DECL_OVERRIDE;
+ virtual QValidator::State validate(QString &input, int &pos) const override;
QRegularExpression regularExpression() const;
diff --git a/src/network/access/access.pri b/src/network/access/access.pri
index e8669dcec8..1d6a04a424 100644
--- a/src/network/access/access.pri
+++ b/src/network/access/access.pri
@@ -1,14 +1,6 @@
# Qt network access module
HEADERS += \
- access/qhttpnetworkheader_p.h \
- access/qhttpnetworkrequest_p.h \
- access/qhttpnetworkreply_p.h \
- access/qhttpnetworkconnection_p.h \
- access/qhttpnetworkconnectionchannel_p.h \
- access/qabstractprotocolhandler_p.h \
- access/qhttpprotocolhandler_p.h \
- access/qspdyprotocolhandler_p.h \
access/qnetworkaccessauthenticationmanager_p.h \
access/qnetworkaccessmanager.h \
access/qnetworkaccessmanager_p.h \
@@ -27,28 +19,15 @@ HEADERS += \
access/qnetworkreply_p.h \
access/qnetworkreplyimpl_p.h \
access/qnetworkreplydataimpl_p.h \
- access/qnetworkreplyhttpimpl_p.h \
access/qnetworkreplyfileimpl_p.h \
access/qabstractnetworkcache_p.h \
access/qabstractnetworkcache.h \
- access/qhttpthreaddelegate_p.h \
- access/qhttpmultipart.h \
- access/qhttpmultipart_p.h \
access/qnetworkfile_p.h \
- access/qhttp2protocolhandler_p.h \
access/qhsts_p.h \
access/qhstspolicy.h \
access/qhstsstore_p.h
SOURCES += \
- access/qhttpnetworkheader.cpp \
- access/qhttpnetworkrequest.cpp \
- access/qhttpnetworkreply.cpp \
- access/qhttpnetworkconnection.cpp \
- access/qhttpnetworkconnectionchannel.cpp \
- access/qabstractprotocolhandler.cpp \
- access/qhttpprotocolhandler.cpp \
- access/qspdyprotocolhandler.cpp \
access/qnetworkaccessauthenticationmanager.cpp \
access/qnetworkaccessmanager.cpp \
access/qnetworkaccesscache.cpp \
@@ -62,13 +41,9 @@ SOURCES += \
access/qnetworkreply.cpp \
access/qnetworkreplyimpl.cpp \
access/qnetworkreplydataimpl.cpp \
- access/qnetworkreplyhttpimpl.cpp \
access/qnetworkreplyfileimpl.cpp \
access/qabstractnetworkcache.cpp \
- access/qhttpthreaddelegate.cpp \
- access/qhttpmultipart.cpp \
access/qnetworkfile.cpp \
- access/qhttp2protocolhandler.cpp \
access/qhsts.cpp \
access/qhstspolicy.cpp \
access/qhstsstore.cpp
@@ -94,4 +69,36 @@ qtConfig(networkdiskcache) {
mac: LIBS_PRIVATE += -framework Security
include($$PWD/../../3rdparty/zlib_dependency.pri)
-include($$PWD/http2/http2.pri)
+
+qtConfig(http) {
+ include($$PWD/http2/http2.pri)
+
+ SOURCES += \
+ access/qabstractprotocolhandler.cpp \
+ access/qhttp2protocolhandler.cpp \
+ access/qhttpmultipart.cpp \
+ access/qhttpnetworkconnection.cpp \
+ access/qhttpnetworkconnectionchannel.cpp \
+ access/qhttpnetworkheader.cpp \
+ access/qhttpnetworkreply.cpp \
+ access/qhttpnetworkrequest.cpp \
+ access/qhttpprotocolhandler.cpp \
+ access/qhttpthreaddelegate.cpp \
+ access/qnetworkreplyhttpimpl.cpp \
+ access/qspdyprotocolhandler.cpp
+
+ HEADERS += \
+ access/qabstractprotocolhandler_p.h \
+ access/qhttp2protocolhandler_p.h \
+ access/qhttpmultipart.h \
+ access/qhttpmultipart_p.h \
+ access/qhttpnetworkconnection_p.h \
+ access/qhttpnetworkconnectionchannel_p.h \
+ access/qhttpnetworkheader_p.h \
+ access/qhttpnetworkreply_p.h \
+ access/qhttpnetworkrequest_p.h \
+ access/qhttpprotocolhandler_p.h \
+ access/qhttpthreaddelegate_p.h \
+ access/qnetworkreplyhttpimpl_p.h \
+ access/qspdyprotocolhandler_p.h
+}
diff --git a/src/network/access/http2/hpack.cpp b/src/network/access/http2/hpack.cpp
index 95e6f9051b..2d324d5092 100644
--- a/src/network/access/http2/hpack.cpp
+++ b/src/network/access/http2/hpack.cpp
@@ -67,18 +67,6 @@ HeaderSize header_size(const HttpHeader &header)
struct BitPattern
{
- BitPattern()
- : value(),
- bitLength()
- {
- }
-
- BitPattern(uchar v, uchar len)
- : value(v),
- bitLength(len)
- {
- }
-
uchar value;
uchar bitLength;
};
@@ -102,11 +90,11 @@ using StreamError = BitIStream::Error;
// It's always 1 or 0 actually, but the number of bits to extract
// from the input stream - differs.
-const BitPattern Indexed(1, 1);
-const BitPattern LiteralIncrementalIndexing(1, 2);
-const BitPattern LiteralNoIndexing(0, 4);
-const BitPattern LiteralNeverIndexing(1, 4);
-const BitPattern SizeUpdate(1, 3);
+const BitPattern Indexed = {1, 1};
+const BitPattern LiteralIncrementalIndexing = {1, 2};
+const BitPattern LiteralNoIndexing = {0, 4};
+const BitPattern LiteralNeverIndexing = {1, 4};
+const BitPattern SizeUpdate = {1, 3};
bool is_literal_field(const BitPattern &pattern)
{
diff --git a/src/network/access/http2/http2streams_p.h b/src/network/access/http2/http2streams_p.h
index 8465486ae8..0be6b3b253 100644
--- a/src/network/access/http2/http2streams_p.h
+++ b/src/network/access/http2/http2streams_p.h
@@ -62,6 +62,8 @@
#include <vector>
+QT_REQUIRE_CONFIG(http);
+
QT_BEGIN_NAMESPACE
class QNonContiguousByteDevice;
diff --git a/src/network/access/http2/huffman_p.h b/src/network/access/http2/huffman_p.h
index 7195661664..c5324d42b1 100644
--- a/src/network/access/http2/huffman_p.h
+++ b/src/network/access/http2/huffman_p.h
@@ -62,19 +62,6 @@ namespace HPack
struct CodeEntry
{
- CodeEntry() : byteValue(),
- huffmanCode(),
- bitLength()
- {
- }
-
- CodeEntry(quint32 val, quint32 code, quint32 len)
- : byteValue(val),
- huffmanCode(code),
- bitLength(len)
- {
- }
-
quint32 byteValue;
quint32 huffmanCode;
quint32 bitLength;
diff --git a/src/network/access/qabstractnetworkcache.h b/src/network/access/qabstractnetworkcache.h
index 33b0bc4ce3..678bae2d6e 100644
--- a/src/network/access/qabstractnetworkcache.h
+++ b/src/network/access/qabstractnetworkcache.h
@@ -131,7 +131,7 @@ public Q_SLOTS:
virtual void clear() = 0;
protected:
- explicit QAbstractNetworkCache(QObject *parent = Q_NULLPTR);
+ explicit QAbstractNetworkCache(QObject *parent = nullptr);
QAbstractNetworkCache(QAbstractNetworkCachePrivate &dd, QObject *parent);
private:
diff --git a/src/network/access/qabstractprotocolhandler.cpp b/src/network/access/qabstractprotocolhandler.cpp
index d408f3b37a..f15dfe6899 100644
--- a/src/network/access/qabstractprotocolhandler.cpp
+++ b/src/network/access/qabstractprotocolhandler.cpp
@@ -40,8 +40,6 @@
#include <private/qabstractprotocolhandler_p.h>
#include <private/qhttpnetworkconnectionchannel_p.h>
-#ifndef QT_NO_HTTP
-
QT_BEGIN_NAMESPACE
QAbstractProtocolHandler::QAbstractProtocolHandler(QHttpNetworkConnectionChannel *channel)
@@ -62,5 +60,3 @@ void QAbstractProtocolHandler::setReply(QHttpNetworkReply *reply)
}
QT_END_NAMESPACE
-
-#endif // QT_NO_HTTP
diff --git a/src/network/access/qabstractprotocolhandler_p.h b/src/network/access/qabstractprotocolhandler_p.h
index 30814d6737..04a07734dd 100644
--- a/src/network/access/qabstractprotocolhandler_p.h
+++ b/src/network/access/qabstractprotocolhandler_p.h
@@ -53,7 +53,7 @@
#include <QtNetwork/private/qtnetworkglobal_p.h>
-#ifndef QT_NO_HTTP
+QT_REQUIRE_CONFIG(http);
QT_BEGIN_NAMESPACE
@@ -81,6 +81,4 @@ protected:
QT_END_NAMESPACE
-#endif // QT_NO_HTTP
-
#endif // QABSTRACTPROTOCOLHANDLER_H
diff --git a/src/network/access/qhsts.cpp b/src/network/access/qhsts.cpp
index 6a731afc2f..43a8a3663e 100644
--- a/src/network/access/qhsts.cpp
+++ b/src/network/access/qhsts.cpp
@@ -136,7 +136,7 @@ void QHstsCache::updateKnownHost(const QString &host, const QDateTime &expires,
return;
}
- knownHosts.insert(pos, hostName, newPolicy);
+ knownHosts.insert(pos, {hostName, newPolicy});
if (hstsStore)
hstsStore->addToObserved(newPolicy);
return;
@@ -144,8 +144,8 @@ void QHstsCache::updateKnownHost(const QString &host, const QDateTime &expires,
if (newPolicy.isExpired())
knownHosts.erase(pos);
- else if (*pos != newPolicy)
- *pos = std::move(newPolicy);
+ else if (pos->second != newPolicy)
+ pos->second = std::move(newPolicy);
else
return;
@@ -185,13 +185,13 @@ bool QHstsCache::isKnownHost(const QUrl &url) const
while (nameToTest.fragment.size()) {
auto const pos = knownHosts.find(nameToTest);
if (pos != knownHosts.end()) {
- if (pos.value().isExpired()) {
+ if (pos->second.isExpired()) {
knownHosts.erase(pos);
if (hstsStore) {
// Inform our store that this policy has expired.
- hstsStore->addToObserved(pos.value());
+ hstsStore->addToObserved(pos->second);
}
- } else if (!superDomainMatch || pos.value().includesSubDomains()) {
+ } else if (!superDomainMatch || pos->second.includesSubDomains()) {
return true;
}
}
@@ -215,9 +215,9 @@ void QHstsCache::clear()
QVector<QHstsPolicy> QHstsCache::policies() const
{
QVector<QHstsPolicy> values;
- values.reserve(knownHosts.size());
+ values.reserve(int(knownHosts.size()));
for (const auto &host : knownHosts)
- values << host;
+ values << host.second;
return values;
}
diff --git a/src/network/access/qhsts_p.h b/src/network/access/qhsts_p.h
index 2feb73b446..bc8708341d 100644
--- a/src/network/access/qhsts_p.h
+++ b/src/network/access/qhsts_p.h
@@ -61,7 +61,8 @@
#include <QtCore/qglobal.h>
#include <QtCore/qpair.h>
#include <QtCore/qurl.h>
-#include <QtCore/qmap.h>
+
+#include <map>
QT_BEGIN_NAMESPACE
@@ -117,7 +118,7 @@ private:
QStringRef fragment;
};
- mutable QMap<HostName, QHstsPolicy> knownHosts;
+ mutable std::map<HostName, QHstsPolicy> knownHosts;
QHstsStore *hstsStore = nullptr;
};
diff --git a/src/network/access/qhttp2protocolhandler.cpp b/src/network/access/qhttp2protocolhandler.cpp
index 42f1343c52..0cdcee6b59 100644
--- a/src/network/access/qhttp2protocolhandler.cpp
+++ b/src/network/access/qhttp2protocolhandler.cpp
@@ -40,8 +40,6 @@
#include "qhttpnetworkconnection_p.h"
#include "qhttp2protocolhandler_p.h"
-#if !defined(QT_NO_HTTP)
-
#include "http2/bitstreams_p.h"
#include <private/qnoncontiguousbytedevice_p.h>
@@ -88,7 +86,8 @@ HPack::HttpHeader build_headers(const QHttpNetworkRequest &request, quint32 maxH
if (size.second > maxHeaderListSize)
return HttpHeader(); // Bad, we cannot send this request ...
- for (const auto &field : request.header()) {
+ const auto requestHeader = request.header();
+ for (const auto &field : requestHeader) {
const HeaderSize delta = entry_size(field.first, field.second);
if (!delta.first) // Overflow???
break;
@@ -1511,5 +1510,3 @@ void QHttp2ProtocolHandler::closeSession()
}
QT_END_NAMESPACE
-
-#endif // !defined(QT_NO_HTTP)
diff --git a/src/network/access/qhttp2protocolhandler_p.h b/src/network/access/qhttp2protocolhandler_p.h
index dd209bd0ef..9165808302 100644
--- a/src/network/access/qhttp2protocolhandler_p.h
+++ b/src/network/access/qhttp2protocolhandler_p.h
@@ -55,8 +55,6 @@
#include <private/qabstractprotocolhandler_p.h>
#include <private/qhttpnetworkrequest_p.h>
-#if !defined(QT_NO_HTTP)
-
#include <private/http2protocol_p.h>
#include <private/http2streams_p.h>
#include <private/http2frames_p.h>
@@ -75,6 +73,8 @@
#include <deque>
#include <set>
+QT_REQUIRE_CONFIG(http);
+
QT_BEGIN_NAMESPACE
class QHttp2ProtocolHandler : public QObject, public QAbstractProtocolHandler
@@ -228,6 +228,4 @@ private:
QT_END_NAMESPACE
-#endif // !defined(QT_NO_HTTP)
-
#endif
diff --git a/src/network/access/qhttpmultipart.h b/src/network/access/qhttpmultipart.h
index 6d4531b099..78585a704d 100644
--- a/src/network/access/qhttpmultipart.h
+++ b/src/network/access/qhttpmultipart.h
@@ -46,6 +46,8 @@
#include <QtCore/QIODevice>
#include <QtNetwork/QNetworkRequest>
+QT_REQUIRE_CONFIG(http);
+
QT_BEGIN_NAMESPACE
@@ -98,8 +100,8 @@ public:
AlternativeType
};
- explicit QHttpMultiPart(QObject *parent = Q_NULLPTR);
- explicit QHttpMultiPart(ContentType contentType, QObject *parent = Q_NULLPTR);
+ explicit QHttpMultiPart(QObject *parent = nullptr);
+ explicit QHttpMultiPart(ContentType contentType, QObject *parent = nullptr);
~QHttpMultiPart();
void append(const QHttpPart &httpPart);
diff --git a/src/network/access/qhttpmultipart_p.h b/src/network/access/qhttpmultipart_p.h
index a03df9cb13..363e0b346c 100644
--- a/src/network/access/qhttpmultipart_p.h
+++ b/src/network/access/qhttpmultipart_p.h
@@ -56,6 +56,8 @@
#include "qnetworkrequest_p.h" // for deriving QHttpPartPrivate from QNetworkHeadersPrivate
#include "private/qobject_p.h"
+QT_REQUIRE_CONFIG(http);
+
QT_BEGIN_NAMESPACE
@@ -124,30 +126,30 @@ public:
~QHttpMultiPartIODevice() {
}
- virtual bool atEnd() const Q_DECL_OVERRIDE {
+ virtual bool atEnd() const override {
return readPointer == size();
}
- virtual qint64 bytesAvailable() const Q_DECL_OVERRIDE {
+ virtual qint64 bytesAvailable() const override {
return size() - readPointer;
}
- virtual void close() Q_DECL_OVERRIDE {
+ virtual void close() override {
readPointer = 0;
partOffsets.clear();
deviceSize = -1;
QIODevice::close();
}
- virtual qint64 bytesToWrite() const Q_DECL_OVERRIDE {
+ virtual qint64 bytesToWrite() const override {
return 0;
}
- virtual qint64 size() const Q_DECL_OVERRIDE;
- virtual bool isSequential() const Q_DECL_OVERRIDE;
- virtual bool reset() Q_DECL_OVERRIDE;
- virtual qint64 readData(char *data, qint64 maxSize) Q_DECL_OVERRIDE;
- virtual qint64 writeData(const char *data, qint64 maxSize) Q_DECL_OVERRIDE;
+ virtual qint64 size() const override;
+ virtual bool isSequential() const override;
+ virtual bool reset() override;
+ virtual qint64 readData(char *data, qint64 maxSize) override;
+ virtual qint64 writeData(const char *data, qint64 maxSize) override;
QHttpMultiPartPrivate *multiPart;
qint64 readPointer;
diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp
index 8fdcc91efc..d24927b922 100644
--- a/src/network/access/qhttpnetworkconnection.cpp
+++ b/src/network/access/qhttpnetworkconnection.cpp
@@ -53,8 +53,6 @@
#include <qpair.h>
#include <qdebug.h>
-#ifndef QT_NO_HTTP
-
#ifndef QT_NO_SSL
# include <private/qsslsocket_p.h>
# include <QtNetwork/qsslkey.h>
@@ -83,10 +81,11 @@ QHttpNetworkConnectionPrivate::QHttpNetworkConnectionPrivate(const QString &host
networkLayerState(Unknown),
hostName(hostName), port(port), encrypt(encrypt), delayIpv4(true)
, activeChannelCount(type == QHttpNetworkConnection::ConnectionTypeHTTP2
+ || type == QHttpNetworkConnection::ConnectionTypeHTTP2Direct
#ifndef QT_NO_SSL
- || type == QHttpNetworkConnection::ConnectionTypeSPDY
+ || type == QHttpNetworkConnection::ConnectionTypeSPDY
#endif
- ? 1 : defaultHttpChannelCount)
+ ? 1 : defaultHttpChannelCount)
, channelCount(defaultHttpChannelCount)
#ifndef QT_NO_NETWORKPROXY
, networkProxy(QNetworkProxy::NoProxy)
@@ -122,7 +121,7 @@ QHttpNetworkConnectionPrivate::~QHttpNetworkConnectionPrivate()
{
for (int i = 0; i < channelCount; ++i) {
if (channels[i].socket) {
- QObject::disconnect(channels[i].socket, Q_NULLPTR, &channels[i], Q_NULLPTR);
+ QObject::disconnect(channels[i].socket, nullptr, &channels[i], nullptr);
channels[i].socket->close();
delete channels[i].socket;
}
@@ -1065,6 +1064,7 @@ void QHttpNetworkConnectionPrivate::_q_startNextRequest()
}
break;
}
+ case QHttpNetworkConnection::ConnectionTypeHTTP2Direct:
case QHttpNetworkConnection::ConnectionTypeHTTP2:
case QHttpNetworkConnection::ConnectionTypeSPDY: {
if (channels[0].spdyRequestsToSend.isEmpty() && channels[0].switchedToHttp2)
@@ -1554,5 +1554,3 @@ void QHttpNetworkConnectionPrivate::emitProxyAuthenticationRequired(const QHttpN
QT_END_NAMESPACE
#include "moc_qhttpnetworkconnection_p.cpp"
-
-#endif // QT_NO_HTTP
diff --git a/src/network/access/qhttpnetworkconnection_p.h b/src/network/access/qhttpnetworkconnection_p.h
index d3450417aa..91827a6eb1 100644
--- a/src/network/access/qhttpnetworkconnection_p.h
+++ b/src/network/access/qhttpnetworkconnection_p.h
@@ -71,7 +71,7 @@
#include <private/qhttpnetworkconnectionchannel_p.h>
-#ifndef QT_NO_HTTP
+QT_REQUIRE_CONFIG(http);
QT_BEGIN_NAMESPACE
@@ -94,7 +94,8 @@ public:
enum ConnectionType {
ConnectionTypeHTTP,
ConnectionTypeSPDY,
- ConnectionTypeHTTP2
+ ConnectionTypeHTTP2,
+ ConnectionTypeHTTP2Direct
};
#ifndef QT_NO_BEARERMANAGEMENT
@@ -295,6 +296,4 @@ public:
QT_END_NAMESPACE
-#endif // QT_NO_HTTP
-
#endif
diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp
index 094a48a603..0ac14c78f6 100644
--- a/src/network/access/qhttpnetworkconnectionchannel.cpp
+++ b/src/network/access/qhttpnetworkconnectionchannel.cpp
@@ -45,8 +45,6 @@
#include <qpair.h>
#include <qdebug.h>
-#ifndef QT_NO_HTTP
-
#include <private/qhttp2protocolhandler_p.h>
#include <private/qhttpprotocolhandler_p.h>
#include <private/qspdyprotocolhandler_p.h>
@@ -438,6 +436,10 @@ void QHttpNetworkConnectionChannel::allDone()
return;
}
+ // For clear text HTTP/2 we tried to upgrade from HTTP/1.1 to HTTP/2; for
+ // ConnectionTypeHTTP2Direct we can never be here in case of failure
+ // (after an attempt to read HTTP/1.1 as HTTP/2 frames) or we have a normal
+ // HTTP/2 response and thus can skip this test:
if (connection->connectionType() == QHttpNetworkConnection::ConnectionTypeHTTP2
&& !ssl && !switchedToHttp2) {
if (Http2::is_protocol_upgraded(*reply)) {
@@ -891,6 +893,14 @@ void QHttpNetworkConnectionChannel::_q_connected()
connection->setSslContext(socketSslContext);
}
#endif
+ } else if (connection->connectionType() == QHttpNetworkConnection::ConnectionTypeHTTP2Direct) {
+ state = QHttpNetworkConnectionChannel::IdleState;
+ protocolHandler.reset(new QHttp2ProtocolHandler(this));
+ if (spdyRequestsToSend.count() > 0) {
+ // In case our peer has sent us its settings (window size, max concurrent streams etc.)
+ // let's give _q_receiveReply a chance to read them first ('invokeMethod', QueuedConnection).
+ QMetaObject::invokeMethod(connection, "_q_startNextRequest", Qt::QueuedConnection);
+ }
} else {
state = QHttpNetworkConnectionChannel::IdleState;
const bool tryProtocolUpgrade = connection->connectionType() == QHttpNetworkConnection::ConnectionTypeHTTP2;
@@ -1125,7 +1135,10 @@ void QHttpNetworkConnectionChannel::_q_encrypted()
QSslSocket *sslSocket = qobject_cast<QSslSocket *>(socket);
Q_ASSERT(sslSocket);
- if (!protocolHandler) {
+ if (!protocolHandler && connection->connectionType() != QHttpNetworkConnection::ConnectionTypeHTTP2Direct) {
+ // ConnectionTypeHTTP2Direct does not rely on ALPN/NPN to negotiate HTTP/2,
+ // after establishing a secure connection we immediately start sending
+ // HTTP/2 frames.
switch (sslSocket->sslConfiguration().nextProtocolNegotiationStatus()) {
case QSslConfiguration::NextProtocolNegotiationNegotiated:
case QSslConfiguration::NextProtocolNegotiationUnsupported: {
@@ -1191,7 +1204,8 @@ void QHttpNetworkConnectionChannel::_q_encrypted()
emitFinishedWithError(QNetworkReply::SslHandshakeFailedError,
"detected unknown Next Protocol Negotiation protocol");
}
- } else if (connection->connectionType() == QHttpNetworkConnection::ConnectionTypeHTTP2) {
+ } else if (connection->connectionType() == QHttpNetworkConnection::ConnectionTypeHTTP2
+ || connection->connectionType() == QHttpNetworkConnection::ConnectionTypeHTTP2Direct) {
// We have to reset QHttp2ProtocolHandler's state machine, it's a new
// connection and the handler's state is unique per connection.
protocolHandler.reset(new QHttp2ProtocolHandler(this));
@@ -1203,10 +1217,12 @@ void QHttpNetworkConnectionChannel::_q_encrypted()
pendingEncrypt = false;
if (connection->connectionType() == QHttpNetworkConnection::ConnectionTypeSPDY ||
- connection->connectionType() == QHttpNetworkConnection::ConnectionTypeHTTP2) {
+ connection->connectionType() == QHttpNetworkConnection::ConnectionTypeHTTP2 ||
+ connection->connectionType() == QHttpNetworkConnection::ConnectionTypeHTTP2Direct) {
// we call setSpdyWasUsed(true) on the replies in the SPDY handler when the request is sent
if (spdyRequestsToSend.count() > 0) {
- // wait for data from the server first (e.g. initial window, max concurrent requests)
+ // In case our peer has sent us its settings (window size, max concurrent streams etc.)
+ // let's give _q_receiveReply a chance to read them first ('invokeMethod', QueuedConnection).
QMetaObject::invokeMethod(connection, "_q_startNextRequest", Qt::QueuedConnection);
}
} else { // HTTP
@@ -1303,5 +1319,3 @@ void QHttpNetworkConnectionChannel::setConnection(QHttpNetworkConnection *c)
QT_END_NAMESPACE
#include "moc_qhttpnetworkconnectionchannel_p.cpp"
-
-#endif // QT_NO_HTTP
diff --git a/src/network/access/qhttpnetworkconnectionchannel_p.h b/src/network/access/qhttpnetworkconnectionchannel_p.h
index 844a7d5d15..e9cdae5653 100644
--- a/src/network/access/qhttpnetworkconnectionchannel_p.h
+++ b/src/network/access/qhttpnetworkconnectionchannel_p.h
@@ -68,8 +68,6 @@
#include <private/qhttpnetworkconnection_p.h>
#include <private/qabstractprotocolhandler_p.h>
-#ifndef QT_NO_HTTP
-
#ifndef QT_NO_SSL
# include <QtNetwork/qsslsocket.h>
# include <QtNetwork/qsslerror.h>
@@ -80,6 +78,8 @@
#include <QtCore/qscopedpointer.h>
+QT_REQUIRE_CONFIG(http);
+
QT_BEGIN_NAMESPACE
class QHttpNetworkRequest;
@@ -216,6 +216,4 @@ public:
QT_END_NAMESPACE
-#endif // QT_NO_HTTP
-
#endif
diff --git a/src/network/access/qhttpnetworkheader.cpp b/src/network/access/qhttpnetworkheader.cpp
index 7199abbf17..19a3dfcfe8 100644
--- a/src/network/access/qhttpnetworkheader.cpp
+++ b/src/network/access/qhttpnetworkheader.cpp
@@ -41,8 +41,6 @@
#include <algorithm>
-#ifndef QT_NO_HTTP
-
QT_BEGIN_NAMESPACE
QHttpNetworkHeaderPrivate::QHttpNetworkHeaderPrivate(const QUrl &newUrl)
@@ -121,5 +119,3 @@ bool QHttpNetworkHeaderPrivate::operator==(const QHttpNetworkHeaderPrivate &othe
QT_END_NAMESPACE
-
-#endif
diff --git a/src/network/access/qhttpnetworkheader_p.h b/src/network/access/qhttpnetworkheader_p.h
index 46aec1dd8c..f46c259919 100644
--- a/src/network/access/qhttpnetworkheader_p.h
+++ b/src/network/access/qhttpnetworkheader_p.h
@@ -53,11 +53,11 @@
#include <QtNetwork/private/qtnetworkglobal_p.h>
-#ifndef QT_NO_HTTP
-
#include <qshareddata.h>
#include <qurl.h>
+QT_REQUIRE_CONFIG(http);
+
QT_BEGIN_NAMESPACE
class Q_AUTOTEST_EXPORT QHttpNetworkHeader
@@ -99,10 +99,6 @@ public:
QT_END_NAMESPACE
-
-#endif // QT_NO_HTTP
-
-
#endif // QHTTPNETWORKHEADER_H
diff --git a/src/network/access/qhttpnetworkreply.cpp b/src/network/access/qhttpnetworkreply.cpp
index 778ba821e8..a657346958 100644
--- a/src/network/access/qhttpnetworkreply.cpp
+++ b/src/network/access/qhttpnetworkreply.cpp
@@ -40,8 +40,6 @@
#include "qhttpnetworkreply_p.h"
#include "qhttpnetworkconnection_p.h"
-#ifndef QT_NO_HTTP
-
#ifndef QT_NO_SSL
# include <QtNetwork/qsslkey.h>
# include <QtNetwork/qsslcipher.h>
@@ -1035,5 +1033,3 @@ void QHttpNetworkReply::ignoreSslErrors(const QList<QSslError> &errors)
QT_END_NAMESPACE
-
-#endif // QT_NO_HTTP
diff --git a/src/network/access/qhttpnetworkreply_p.h b/src/network/access/qhttpnetworkreply_p.h
index faab03f056..863e21ea3e 100644
--- a/src/network/access/qhttpnetworkreply_p.h
+++ b/src/network/access/qhttpnetworkreply_p.h
@@ -53,8 +53,6 @@
#include <QtNetwork/private/qtnetworkglobal_p.h>
-#ifndef QT_NO_HTTP
-
#include <qplatformdefs.h>
#ifndef QT_NO_COMPRESS
@@ -77,6 +75,8 @@ struct z_stream_s;
#include <private/qringbuffer_p.h>
#include <private/qbytedata_p.h>
+QT_REQUIRE_CONFIG(http);
+
QT_BEGIN_NAMESPACE
class QHttpNetworkConnection;
@@ -92,18 +92,18 @@ public:
explicit QHttpNetworkReply(const QUrl &url = QUrl(), QObject *parent = 0);
virtual ~QHttpNetworkReply();
- QUrl url() const Q_DECL_OVERRIDE;
- void setUrl(const QUrl &url) Q_DECL_OVERRIDE;
+ QUrl url() const override;
+ void setUrl(const QUrl &url) override;
- int majorVersion() const Q_DECL_OVERRIDE;
- int minorVersion() const Q_DECL_OVERRIDE;
+ int majorVersion() const override;
+ int minorVersion() const override;
- qint64 contentLength() const Q_DECL_OVERRIDE;
- void setContentLength(qint64 length) Q_DECL_OVERRIDE;
+ qint64 contentLength() const override;
+ void setContentLength(qint64 length) override;
- QList<QPair<QByteArray, QByteArray> > header() const Q_DECL_OVERRIDE;
- QByteArray headerField(const QByteArray &name, const QByteArray &defaultValue = QByteArray()) const Q_DECL_OVERRIDE;
- void setHeaderField(const QByteArray &name, const QByteArray &data) Q_DECL_OVERRIDE;
+ QList<QPair<QByteArray, QByteArray> > header() const override;
+ QByteArray headerField(const QByteArray &name, const QByteArray &defaultValue = QByteArray()) const override;
+ void setHeaderField(const QByteArray &name, const QByteArray &data) override;
void parseHeader(const QByteArray &header); // mainly for testing
QHttpNetworkRequest request() const;
@@ -285,7 +285,4 @@ public:
QT_END_NAMESPACE
-#endif // QT_NO_HTTP
-
-
#endif // QHTTPNETWORKREPLY_H
diff --git a/src/network/access/qhttpnetworkrequest.cpp b/src/network/access/qhttpnetworkrequest.cpp
index 60b566299f..3fcf946945 100644
--- a/src/network/access/qhttpnetworkrequest.cpp
+++ b/src/network/access/qhttpnetworkrequest.cpp
@@ -40,15 +40,13 @@
#include "qhttpnetworkrequest_p.h"
#include "private/qnoncontiguousbytedevice_p.h"
-#ifndef QT_NO_HTTP
-
QT_BEGIN_NAMESPACE
QHttpNetworkRequestPrivate::QHttpNetworkRequestPrivate(QHttpNetworkRequest::Operation op,
QHttpNetworkRequest::Priority pri, const QUrl &newUrl)
: QHttpNetworkHeaderPrivate(newUrl), operation(op), priority(pri), uploadByteDevice(0),
autoDecompress(false), pipeliningAllowed(false), spdyAllowed(false), http2Allowed(false),
- withCredentials(true), preConnect(false), redirectCount(0),
+ http2Direct(false), withCredentials(true), preConnect(false), redirectCount(0),
redirectPolicy(QNetworkRequest::ManualRedirectPolicy)
{
}
@@ -63,6 +61,7 @@ QHttpNetworkRequestPrivate::QHttpNetworkRequestPrivate(const QHttpNetworkRequest
pipeliningAllowed(other.pipeliningAllowed),
spdyAllowed(other.spdyAllowed),
http2Allowed(other.http2Allowed),
+ http2Direct(other.http2Direct),
withCredentials(other.withCredentials),
ssl(other.ssl),
preConnect(other.preConnect),
@@ -85,6 +84,7 @@ bool QHttpNetworkRequestPrivate::operator==(const QHttpNetworkRequestPrivate &ot
&& (pipeliningAllowed == other.pipeliningAllowed)
&& (spdyAllowed == other.spdyAllowed)
&& (http2Allowed == other.http2Allowed)
+ && (http2Direct == other.http2Direct)
// we do not clear the customVerb in setOperation
&& (operation != QHttpNetworkRequest::Custom || (customVerb == other.customVerb))
&& (withCredentials == other.withCredentials)
@@ -350,6 +350,16 @@ void QHttpNetworkRequest::setHTTP2Allowed(bool b)
d->http2Allowed = b;
}
+bool QHttpNetworkRequest::isHTTP2Direct() const
+{
+ return d->http2Direct;
+}
+
+void QHttpNetworkRequest::setHTTP2Direct(bool b)
+{
+ d->http2Direct = b;
+}
+
bool QHttpNetworkRequest::withCredentials() const
{
return d->withCredentials;
@@ -383,5 +393,3 @@ int QHttpNetworkRequest::minorVersion() const
QT_END_NAMESPACE
-#endif
-
diff --git a/src/network/access/qhttpnetworkrequest_p.h b/src/network/access/qhttpnetworkrequest_p.h
index ecf8856ded..2cbb8e255e 100644
--- a/src/network/access/qhttpnetworkrequest_p.h
+++ b/src/network/access/qhttpnetworkrequest_p.h
@@ -52,12 +52,12 @@
//
#include <QtNetwork/private/qtnetworkglobal_p.h>
-#ifndef QT_NO_HTTP
-
#include <private/qhttpnetworkheader_p.h>
#include <QtNetwork/qnetworkrequest.h>
#include <qmetatype.h>
+QT_REQUIRE_CONFIG(http);
+
QT_BEGIN_NAMESPACE
class QNonContiguousByteDevice;
@@ -90,18 +90,18 @@ public:
QHttpNetworkRequest &operator=(const QHttpNetworkRequest &other);
bool operator==(const QHttpNetworkRequest &other) const;
- QUrl url() const Q_DECL_OVERRIDE;
- void setUrl(const QUrl &url) Q_DECL_OVERRIDE;
+ QUrl url() const override;
+ void setUrl(const QUrl &url) override;
- int majorVersion() const Q_DECL_OVERRIDE;
- int minorVersion() const Q_DECL_OVERRIDE;
+ int majorVersion() const override;
+ int minorVersion() const override;
- qint64 contentLength() const Q_DECL_OVERRIDE;
- void setContentLength(qint64 length) Q_DECL_OVERRIDE;
+ qint64 contentLength() const override;
+ void setContentLength(qint64 length) override;
- QList<QPair<QByteArray, QByteArray> > header() const Q_DECL_OVERRIDE;
- QByteArray headerField(const QByteArray &name, const QByteArray &defaultValue = QByteArray()) const Q_DECL_OVERRIDE;
- void setHeaderField(const QByteArray &name, const QByteArray &data) Q_DECL_OVERRIDE;
+ QList<QPair<QByteArray, QByteArray> > header() const override;
+ QByteArray headerField(const QByteArray &name, const QByteArray &defaultValue = QByteArray()) const override;
+ void setHeaderField(const QByteArray &name, const QByteArray &data) override;
Operation operation() const;
void setOperation(Operation operation);
@@ -121,6 +121,9 @@ public:
bool isHTTP2Allowed() const;
void setHTTP2Allowed(bool b);
+ bool isHTTP2Direct() const;
+ void setHTTP2Direct(bool b);
+
bool withCredentials() const;
void setWithCredentials(bool b);
@@ -172,6 +175,7 @@ public:
bool pipeliningAllowed;
bool spdyAllowed;
bool http2Allowed;
+ bool http2Direct;
bool withCredentials;
bool ssl;
bool preConnect;
@@ -184,7 +188,4 @@ QT_END_NAMESPACE
Q_DECLARE_METATYPE(QHttpNetworkRequest)
-#endif // QT_NO_HTTP
-
-
#endif // QHTTPNETWORKREQUEST_H
diff --git a/src/network/access/qhttpprotocolhandler.cpp b/src/network/access/qhttpprotocolhandler.cpp
index 37e8b9bed8..edcbdcbe0e 100644
--- a/src/network/access/qhttpprotocolhandler.cpp
+++ b/src/network/access/qhttpprotocolhandler.cpp
@@ -42,8 +42,6 @@
#include <private/qnoncontiguousbytedevice_p.h>
#include <private/qhttpnetworkconnectionchannel_p.h>
-#ifndef QT_NO_HTTP
-
QT_BEGIN_NAMESPACE
QHttpProtocolHandler::QHttpProtocolHandler(QHttpNetworkConnectionChannel *channel)
@@ -437,5 +435,3 @@ bool QHttpProtocolHandler::sendRequest()
}
QT_END_NAMESPACE
-
-#endif // QT_NO_HTTP
diff --git a/src/network/access/qhttpprotocolhandler_p.h b/src/network/access/qhttpprotocolhandler_p.h
index 863b988be3..8e766604bb 100644
--- a/src/network/access/qhttpprotocolhandler_p.h
+++ b/src/network/access/qhttpprotocolhandler_p.h
@@ -55,7 +55,7 @@
#include <QtNetwork/private/qtnetworkglobal_p.h>
#include <private/qabstractprotocolhandler_p.h>
-#ifndef QT_NO_HTTP
+QT_REQUIRE_CONFIG(http);
QT_BEGIN_NAMESPACE
@@ -64,13 +64,11 @@ public:
QHttpProtocolHandler(QHttpNetworkConnectionChannel *channel);
private:
- virtual void _q_receiveReply() Q_DECL_OVERRIDE;
- virtual void _q_readyRead() Q_DECL_OVERRIDE;
- virtual bool sendRequest() Q_DECL_OVERRIDE;
+ virtual void _q_receiveReply() override;
+ virtual void _q_readyRead() override;
+ virtual bool sendRequest() override;
};
QT_END_NAMESPACE
-#endif // QT_NO_HTTP
-
#endif
diff --git a/src/network/access/qhttpthreaddelegate.cpp b/src/network/access/qhttpthreaddelegate.cpp
index 3204f8da33..0e97acdd9d 100644
--- a/src/network/access/qhttpthreaddelegate.cpp
+++ b/src/network/access/qhttpthreaddelegate.cpp
@@ -50,8 +50,6 @@
#include "private/qnetworkaccesscache_p.h"
#include "private/qnoncontiguousbytedevice_p.h"
-#ifndef QT_NO_HTTP
-
QT_BEGIN_NAMESPACE
static QNetworkReply::NetworkError statusCodeFromHttp(int httpStatusCode, const QUrl &url)
@@ -197,7 +195,7 @@ public:
setShareable(true);
}
- virtual void dispose() Q_DECL_OVERRIDE
+ virtual void dispose() override
{
#if 0 // sample code; do this right with the API
Q_ASSERT(!isWorking());
@@ -292,11 +290,17 @@ void QHttpThreadDelegate::startRequest()
QHttpNetworkConnection::ConnectionType connectionType
= httpRequest.isHTTP2Allowed() ? QHttpNetworkConnection::ConnectionTypeHTTP2
: QHttpNetworkConnection::ConnectionTypeHTTP;
+ if (httpRequest.isHTTP2Direct()) {
+ Q_ASSERT(!httpRequest.isHTTP2Allowed());
+ connectionType = QHttpNetworkConnection::ConnectionTypeHTTP2Direct;
+ }
+
#ifndef QT_NO_SSL
if (ssl && !incomingSslConfiguration.data())
incomingSslConfiguration.reset(new QSslConfiguration);
if (httpRequest.isHTTP2Allowed() && ssl) {
+ // With HTTP2Direct we do not try any protocol negotiation.
QList<QByteArray> protocols;
protocols << QSslConfiguration::ALPNProtocolHTTP2
<< QSslConfiguration::NextProtocolHttp1_1;
@@ -762,6 +766,4 @@ void QHttpThreadDelegate::synchronousProxyAuthenticationRequiredSlot(const QNet
#endif
-#endif // QT_NO_HTTP
-
QT_END_NAMESPACE
diff --git a/src/network/access/qhttpthreaddelegate_p.h b/src/network/access/qhttpthreaddelegate_p.h
index da115d6710..019a8b8b74 100644
--- a/src/network/access/qhttpthreaddelegate_p.h
+++ b/src/network/access/qhttpthreaddelegate_p.h
@@ -68,7 +68,7 @@
#include "qnetworkaccessauthenticationmanager_p.h"
#include <QtNetwork/private/http2protocol_p.h>
-#ifndef QT_NO_HTTP
+QT_REQUIRE_CONFIG(http);
QT_BEGIN_NAMESPACE
@@ -218,12 +218,12 @@ public:
{
}
- qint64 pos() const Q_DECL_OVERRIDE
+ qint64 pos() const override
{
return m_pos;
}
- const char* readPointer(qint64 maximumLength, qint64 &len) Q_DECL_OVERRIDE
+ const char* readPointer(qint64 maximumLength, qint64 &len) override
{
if (m_amount > 0) {
len = m_amount;
@@ -243,7 +243,7 @@ public:
return 0;
}
- bool advanceReadPointer(qint64 a) Q_DECL_OVERRIDE
+ bool advanceReadPointer(qint64 a) override
{
if (m_data == 0)
return false;
@@ -258,7 +258,7 @@ public:
return true;
}
- bool atEnd() const Q_DECL_OVERRIDE
+ bool atEnd() const override
{
if (m_amount > 0)
return false;
@@ -266,7 +266,7 @@ public:
return m_atEnd;
}
- bool reset() Q_DECL_OVERRIDE
+ bool reset() override
{
m_amount = 0;
m_data = 0;
@@ -288,7 +288,7 @@ public:
return b;
}
- qint64 size() const Q_DECL_OVERRIDE
+ qint64 size() const override
{
return m_size;
}
@@ -327,6 +327,4 @@ signals:
QT_END_NAMESPACE
-#endif // QT_NO_HTTP
-
#endif // QHTTPTHREADDELEGATE_H
diff --git a/src/network/access/qnetworkaccessauthenticationmanager.cpp b/src/network/access/qnetworkaccessauthenticationmanager.cpp
index 2b07833cda..b661cc45b3 100644
--- a/src/network/access/qnetworkaccessauthenticationmanager.cpp
+++ b/src/network/access/qnetworkaccessauthenticationmanager.cpp
@@ -95,7 +95,7 @@ public:
}
}
- virtual void dispose() Q_DECL_OVERRIDE { delete this; }
+ virtual void dispose() override { delete this; }
};
#ifndef QT_NO_NETWORKPROXY
diff --git a/src/network/access/qnetworkaccesscache_p.h b/src/network/access/qnetworkaccesscache_p.h
index 3732b5cbb4..69ea649a8a 100644
--- a/src/network/access/qnetworkaccesscache_p.h
+++ b/src/network/access/qnetworkaccesscache_p.h
@@ -106,7 +106,7 @@ signals:
void entryReady(QNetworkAccessCache::CacheableObject *);
protected:
- void timerEvent(QTimerEvent *) Q_DECL_OVERRIDE;
+ void timerEvent(QTimerEvent *) override;
private:
// idea copied from qcache.h
diff --git a/src/network/access/qnetworkaccesscachebackend_p.h b/src/network/access/qnetworkaccesscachebackend_p.h
index 8db1a6b1d5..dfb0ce84d9 100644
--- a/src/network/access/qnetworkaccesscachebackend_p.h
+++ b/src/network/access/qnetworkaccesscachebackend_p.h
@@ -65,12 +65,12 @@ public:
QNetworkAccessCacheBackend();
~QNetworkAccessCacheBackend();
- void open() Q_DECL_OVERRIDE;
- void closeDownstreamChannel() Q_DECL_OVERRIDE;
+ void open() override;
+ void closeDownstreamChannel() override;
void closeUpstreamChannel();
void upstreamReadyRead();
- void downstreamReadyWrite() Q_DECL_OVERRIDE;
+ void downstreamReadyWrite() override;
private:
bool sendCacheContents();
diff --git a/src/network/access/qnetworkaccessdebugpipebackend_p.h b/src/network/access/qnetworkaccessdebugpipebackend_p.h
index 1d1af61dbd..d9a7aabdad 100644
--- a/src/network/access/qnetworkaccessdebugpipebackend_p.h
+++ b/src/network/access/qnetworkaccessdebugpipebackend_p.h
@@ -68,10 +68,10 @@ public:
QNetworkAccessDebugPipeBackend();
virtual ~QNetworkAccessDebugPipeBackend();
- virtual void open() Q_DECL_OVERRIDE;
- virtual void closeDownstreamChannel() Q_DECL_OVERRIDE;
+ virtual void open() override;
+ virtual void closeDownstreamChannel() override;
- virtual void downstreamReadyWrite() Q_DECL_OVERRIDE;
+ virtual void downstreamReadyWrite() override;
protected:
void pushFromSocketToDownstream();
@@ -101,9 +101,9 @@ private:
class QNetworkAccessDebugPipeBackendFactory: public QNetworkAccessBackendFactory
{
public:
- virtual QStringList supportedSchemes() const Q_DECL_OVERRIDE;
+ virtual QStringList supportedSchemes() const override;
virtual QNetworkAccessBackend *create(QNetworkAccessManager::Operation op,
- const QNetworkRequest &request) const Q_DECL_OVERRIDE;
+ const QNetworkRequest &request) const override;
};
#endif // QT_BUILD_INTERNAL
diff --git a/src/network/access/qnetworkaccessfilebackend_p.h b/src/network/access/qnetworkaccessfilebackend_p.h
index 081ff2b9e7..2c01fb1121 100644
--- a/src/network/access/qnetworkaccessfilebackend_p.h
+++ b/src/network/access/qnetworkaccessfilebackend_p.h
@@ -66,10 +66,10 @@ public:
QNetworkAccessFileBackend();
virtual ~QNetworkAccessFileBackend();
- virtual void open() Q_DECL_OVERRIDE;
- virtual void closeDownstreamChannel() Q_DECL_OVERRIDE;
+ virtual void open() override;
+ virtual void closeDownstreamChannel() override;
- virtual void downstreamReadyWrite() Q_DECL_OVERRIDE;
+ virtual void downstreamReadyWrite() override;
public slots:
void uploadReadyReadSlot();
@@ -87,9 +87,9 @@ private:
class QNetworkAccessFileBackendFactory: public QNetworkAccessBackendFactory
{
public:
- virtual QStringList supportedSchemes() const Q_DECL_OVERRIDE;
+ virtual QStringList supportedSchemes() const override;
virtual QNetworkAccessBackend *create(QNetworkAccessManager::Operation op,
- const QNetworkRequest &request) const Q_DECL_OVERRIDE;
+ const QNetworkRequest &request) const override;
};
QT_END_NAMESPACE
diff --git a/src/network/access/qnetworkaccessftpbackend.cpp b/src/network/access/qnetworkaccessftpbackend.cpp
index 0df2569e87..c5404e4221 100644
--- a/src/network/access/qnetworkaccessftpbackend.cpp
+++ b/src/network/access/qnetworkaccessftpbackend.cpp
@@ -94,7 +94,7 @@ public:
setShareable(false);
}
- void dispose() Q_DECL_OVERRIDE
+ void dispose() override
{
connect(this, SIGNAL(done(bool)), this, SLOT(deleteLater()));
close();
diff --git a/src/network/access/qnetworkaccessftpbackend_p.h b/src/network/access/qnetworkaccessftpbackend_p.h
index 0f26d05327..4bd082fb67 100644
--- a/src/network/access/qnetworkaccessftpbackend_p.h
+++ b/src/network/access/qnetworkaccessftpbackend_p.h
@@ -84,10 +84,10 @@ public:
QNetworkAccessFtpBackend();
virtual ~QNetworkAccessFtpBackend();
- virtual void open() Q_DECL_OVERRIDE;
- virtual void closeDownstreamChannel() Q_DECL_OVERRIDE;
+ virtual void open() override;
+ virtual void closeDownstreamChannel() override;
- virtual void downstreamReadyWrite() Q_DECL_OVERRIDE;
+ virtual void downstreamReadyWrite() override;
enum CacheCleanupMode {
ReleaseCachedConnection,
@@ -115,9 +115,9 @@ private:
class QNetworkAccessFtpBackendFactory: public QNetworkAccessBackendFactory
{
public:
- virtual QStringList supportedSchemes() const Q_DECL_OVERRIDE;
+ virtual QStringList supportedSchemes() const override;
virtual QNetworkAccessBackend *create(QNetworkAccessManager::Operation op,
- const QNetworkRequest &request) const Q_DECL_OVERRIDE;
+ const QNetworkRequest &request) const override;
};
QT_END_NAMESPACE
diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp
index 67b765d9e6..6dabe13228 100644
--- a/src/network/access/qnetworkaccessmanager.cpp
+++ b/src/network/access/qnetworkaccessmanager.cpp
@@ -66,10 +66,12 @@
#include "QtNetwork/private/qauthenticator_p.h"
#include "QtNetwork/qsslconfiguration.h"
#include "QtNetwork/qnetworkconfigmanager.h"
-#include "QtNetwork/qhttpmultipart.h"
-#include "qhttpmultipart_p.h"
+#if QT_CONFIG(http)
+#include "qhttpmultipart.h"
+#include "qhttpmultipart_p.h"
#include "qnetworkreplyhttpimpl_p.h"
+#endif
#include "qthread.h"
@@ -469,7 +471,7 @@ QNetworkAccessManager::QNetworkAccessManager(QObject *parent)
qRegisterMetaType<QSslPreSharedKeyAuthenticator *>();
#endif
qRegisterMetaType<QList<QPair<QByteArray,QByteArray> > >();
-#ifndef QT_NO_HTTP
+#if QT_CONFIG(http)
qRegisterMetaType<QHttpNetworkRequest>();
#endif
qRegisterMetaType<QNetworkReply::NetworkError>();
@@ -877,6 +879,7 @@ QNetworkReply *QNetworkAccessManager::post(const QNetworkRequest &request, const
return reply;
}
+#if QT_CONFIG(http)
/*!
\since 4.8
@@ -916,6 +919,7 @@ QNetworkReply *QNetworkAccessManager::put(const QNetworkRequest &request, QHttpM
QNetworkReply *reply = put(newRequest, device);
return reply;
}
+#endif // QT_CONFIG(http)
/*!
Uploads the contents of \a data to the destination \a request and
@@ -1283,6 +1287,7 @@ QNetworkReply *QNetworkAccessManager::sendCustomRequest(const QNetworkRequest &r
return reply;
}
+#if QT_CONFIG(http)
/*!
\since 5.8
@@ -1304,6 +1309,7 @@ QNetworkReply *QNetworkAccessManager::sendCustomRequest(const QNetworkRequest &r
QNetworkReply *reply = sendCustomRequest(newRequest, verb, device);
return reply;
}
+#endif // QT_CONFIG(http)
/*!
Returns a new QNetworkReply object to handle the operation \a op
@@ -1416,7 +1422,7 @@ QNetworkReply *QNetworkAccessManager::createRequest(QNetworkAccessManager::Opera
}
}
-#ifndef QT_NO_HTTP
+#if QT_CONFIG(http)
// Since Qt 5 we use the new QNetworkReplyHttpImpl
if (scheme == QLatin1String("http") || scheme == QLatin1String("preconnect-http")
#ifndef QT_NO_SSL
@@ -1448,7 +1454,7 @@ QNetworkReply *QNetworkAccessManager::createRequest(QNetworkAccessManager::Opera
#endif
return reply;
}
-#endif // QT_NO_HTTP
+#endif // QT_CONFIG(http)
// first step: create the reply
QNetworkReplyImpl *reply = new QNetworkReplyImpl(this);
@@ -1524,7 +1530,7 @@ QStringList QNetworkAccessManager::supportedSchemesImplementation() const
QStringList schemes = d->backendSupportedSchemes();
// Those ones don't exist in backends
-#ifndef QT_NO_HTTP
+#if QT_CONFIG(http)
schemes << QStringLiteral("http");
#ifndef QT_NO_SSL
if (QSslSocket::supportsSsl())
@@ -1990,6 +1996,7 @@ void QNetworkAccessManagerPrivate::_q_networkSessionFailed(QNetworkSession::Sess
#endif // QT_NO_BEARERMANAGEMENT
+#if QT_CONFIG(http)
QNetworkRequest QNetworkAccessManagerPrivate::prepareMultipart(const QNetworkRequest &request, QHttpMultiPart *multiPart)
{
// copy the request, we probably need to add some headers
@@ -2037,6 +2044,7 @@ QNetworkRequest QNetworkAccessManagerPrivate::prepareMultipart(const QNetworkReq
return newRequest;
}
+#endif // QT_CONFIG(http)
QT_END_NAMESPACE
diff --git a/src/network/access/qnetworkaccessmanager.h b/src/network/access/qnetworkaccessmanager.h
index 4806ec0475..a0ce3eddcd 100644
--- a/src/network/access/qnetworkaccessmanager.h
+++ b/src/network/access/qnetworkaccessmanager.h
@@ -100,7 +100,7 @@ public:
Q_ENUM(NetworkAccessibility)
#endif
- explicit QNetworkAccessManager(QObject *parent = Q_NULLPTR);
+ explicit QNetworkAccessManager(QObject *parent = nullptr);
~QNetworkAccessManager();
// ### Qt 6: turn into virtual
@@ -134,14 +134,17 @@ public:
QNetworkReply *get(const QNetworkRequest &request);
QNetworkReply *post(const QNetworkRequest &request, QIODevice *data);
QNetworkReply *post(const QNetworkRequest &request, const QByteArray &data);
- QNetworkReply *post(const QNetworkRequest &request, QHttpMultiPart *multiPart);
QNetworkReply *put(const QNetworkRequest &request, QIODevice *data);
QNetworkReply *put(const QNetworkRequest &request, const QByteArray &data);
- QNetworkReply *put(const QNetworkRequest &request, QHttpMultiPart *multiPart);
QNetworkReply *deleteResource(const QNetworkRequest &request);
- QNetworkReply *sendCustomRequest(const QNetworkRequest &request, const QByteArray &verb, QIODevice *data = Q_NULLPTR);
+ QNetworkReply *sendCustomRequest(const QNetworkRequest &request, const QByteArray &verb, QIODevice *data = nullptr);
QNetworkReply *sendCustomRequest(const QNetworkRequest &request, const QByteArray &verb, const QByteArray &data);
+
+#if QT_CONFIG(http)
+ QNetworkReply *post(const QNetworkRequest &request, QHttpMultiPart *multiPart);
+ QNetworkReply *put(const QNetworkRequest &request, QHttpMultiPart *multiPart);
QNetworkReply *sendCustomRequest(const QNetworkRequest &request, const QByteArray &verb, QHttpMultiPart *multiPart);
+#endif
#ifndef QT_NO_BEARERMANAGEMENT
void setConfiguration(const QNetworkConfiguration &config);
@@ -181,7 +184,7 @@ Q_SIGNALS:
protected:
virtual QNetworkReply *createRequest(Operation op, const QNetworkRequest &request,
- QIODevice *outgoingData = Q_NULLPTR);
+ QIODevice *outgoingData = nullptr);
protected Q_SLOTS:
QStringList supportedSchemesImplementation() const;
diff --git a/src/network/access/qnetworkaccessmanager_p.h b/src/network/access/qnetworkaccessmanager_p.h
index e5257251a4..428110e8bc 100644
--- a/src/network/access/qnetworkaccessmanager_p.h
+++ b/src/network/access/qnetworkaccessmanager_p.h
@@ -164,7 +164,9 @@ public:
#endif
+#if QT_CONFIG(http)
QNetworkRequest prepareMultipart(const QNetworkRequest &request, QHttpMultiPart *multiPart);
+#endif
// this is the cache for storing downloaded files
QAbstractNetworkCache *networkCache;
diff --git a/src/network/access/qnetworkcookiejar.h b/src/network/access/qnetworkcookiejar.h
index f9c1549e20..c3b2200443 100644
--- a/src/network/access/qnetworkcookiejar.h
+++ b/src/network/access/qnetworkcookiejar.h
@@ -54,7 +54,7 @@ class Q_NETWORK_EXPORT QNetworkCookieJar: public QObject
{
Q_OBJECT
public:
- explicit QNetworkCookieJar(QObject *parent = Q_NULLPTR);
+ explicit QNetworkCookieJar(QObject *parent = nullptr);
virtual ~QNetworkCookieJar();
virtual QList<QNetworkCookie> cookiesForUrl(const QUrl &url) const;
diff --git a/src/network/access/qnetworkdiskcache.h b/src/network/access/qnetworkdiskcache.h
index 0e9258f6de..ff7d3192e8 100644
--- a/src/network/access/qnetworkdiskcache.h
+++ b/src/network/access/qnetworkdiskcache.h
@@ -53,7 +53,7 @@ class Q_NETWORK_EXPORT QNetworkDiskCache : public QAbstractNetworkCache
Q_OBJECT
public:
- explicit QNetworkDiskCache(QObject *parent = Q_NULLPTR);
+ explicit QNetworkDiskCache(QObject *parent = nullptr);
~QNetworkDiskCache();
QString cacheDirectory() const;
@@ -62,18 +62,18 @@ public:
qint64 maximumCacheSize() const;
void setMaximumCacheSize(qint64 size);
- qint64 cacheSize() const Q_DECL_OVERRIDE;
- QNetworkCacheMetaData metaData(const QUrl &url) Q_DECL_OVERRIDE;
- void updateMetaData(const QNetworkCacheMetaData &metaData) Q_DECL_OVERRIDE;
- QIODevice *data(const QUrl &url) Q_DECL_OVERRIDE;
- bool remove(const QUrl &url) Q_DECL_OVERRIDE;
- QIODevice *prepare(const QNetworkCacheMetaData &metaData) Q_DECL_OVERRIDE;
- void insert(QIODevice *device) Q_DECL_OVERRIDE;
+ qint64 cacheSize() const override;
+ QNetworkCacheMetaData metaData(const QUrl &url) override;
+ void updateMetaData(const QNetworkCacheMetaData &metaData) override;
+ QIODevice *data(const QUrl &url) override;
+ bool remove(const QUrl &url) override;
+ QIODevice *prepare(const QNetworkCacheMetaData &metaData) override;
+ void insert(QIODevice *device) override;
QNetworkCacheMetaData fileMetaData(const QString &fileName) const;
public Q_SLOTS:
- void clear() Q_DECL_OVERRIDE;
+ void clear() override;
protected:
virtual qint64 expire();
diff --git a/src/network/access/qnetworkfile_p.h b/src/network/access/qnetworkfile_p.h
index dd56b24bd8..e788308d82 100644
--- a/src/network/access/qnetworkfile_p.h
+++ b/src/network/access/qnetworkfile_p.h
@@ -67,7 +67,7 @@ public:
public Q_SLOTS:
void open();
- void close() Q_DECL_OVERRIDE;
+ void close() override;
Q_SIGNALS:
void finished(bool ok);
diff --git a/src/network/access/qnetworkreply.h b/src/network/access/qnetworkreply.h
index d858e07d84..63c2752caf 100644
--- a/src/network/access/qnetworkreply.h
+++ b/src/network/access/qnetworkreply.h
@@ -114,8 +114,8 @@ public:
~QNetworkReply();
// reimplemented from QIODevice
- virtual void close() Q_DECL_OVERRIDE;
- virtual bool isSequential() const Q_DECL_OVERRIDE;
+ virtual void close() override;
+ virtual bool isSequential() const override;
// like QAbstractSocket:
qint64 readBufferSize() const;
@@ -169,9 +169,9 @@ Q_SIGNALS:
void downloadProgress(qint64 bytesReceived, qint64 bytesTotal);
protected:
- explicit QNetworkReply(QObject *parent = Q_NULLPTR);
+ explicit QNetworkReply(QObject *parent = nullptr);
QNetworkReply(QNetworkReplyPrivate &dd, QObject *parent);
- virtual qint64 writeData(const char *data, qint64 len) Q_DECL_OVERRIDE;
+ virtual qint64 writeData(const char *data, qint64 len) override;
void setOperation(QNetworkAccessManager::Operation operation);
void setRequest(const QNetworkRequest &request);
diff --git a/src/network/access/qnetworkreplydataimpl_p.h b/src/network/access/qnetworkreplydataimpl_p.h
index c8b44d7539..81d2110d69 100644
--- a/src/network/access/qnetworkreplydataimpl_p.h
+++ b/src/network/access/qnetworkreplydataimpl_p.h
@@ -67,15 +67,15 @@ class QNetworkReplyDataImpl: public QNetworkReply
public:
QNetworkReplyDataImpl(QObject *parent, const QNetworkRequest &req, const QNetworkAccessManager::Operation op);
~QNetworkReplyDataImpl();
- virtual void abort() Q_DECL_OVERRIDE;
+ virtual void abort() override;
// reimplemented from QNetworkReply
- virtual void close() Q_DECL_OVERRIDE;
- virtual qint64 bytesAvailable() const Q_DECL_OVERRIDE;
- virtual bool isSequential () const Q_DECL_OVERRIDE;
- qint64 size() const Q_DECL_OVERRIDE;
+ virtual void close() override;
+ virtual qint64 bytesAvailable() const override;
+ virtual bool isSequential () const override;
+ qint64 size() const override;
- virtual qint64 readData(char *data, qint64 maxlen) Q_DECL_OVERRIDE;
+ virtual qint64 readData(char *data, qint64 maxlen) override;
Q_DECLARE_PRIVATE(QNetworkReplyDataImpl)
};
diff --git a/src/network/access/qnetworkreplyfileimpl_p.h b/src/network/access/qnetworkreplyfileimpl_p.h
index d6af66152e..55aece0bed 100644
--- a/src/network/access/qnetworkreplyfileimpl_p.h
+++ b/src/network/access/qnetworkreplyfileimpl_p.h
@@ -67,15 +67,15 @@ class QNetworkReplyFileImpl: public QNetworkReply
public:
QNetworkReplyFileImpl(QNetworkAccessManager *manager, const QNetworkRequest &req, const QNetworkAccessManager::Operation op);
~QNetworkReplyFileImpl();
- virtual void abort() Q_DECL_OVERRIDE;
+ virtual void abort() override;
// reimplemented from QNetworkReply
- virtual void close() Q_DECL_OVERRIDE;
- virtual qint64 bytesAvailable() const Q_DECL_OVERRIDE;
- virtual bool isSequential () const Q_DECL_OVERRIDE;
- qint64 size() const Q_DECL_OVERRIDE;
+ virtual void close() override;
+ virtual qint64 bytesAvailable() const override;
+ virtual bool isSequential () const override;
+ qint64 size() const override;
- virtual qint64 readData(char *data, qint64 maxlen) Q_DECL_OVERRIDE;
+ virtual qint64 readData(char *data, qint64 maxlen) override;
private Q_SLOTS:
void fileOpenFinished(bool isOpen);
diff --git a/src/network/access/qnetworkreplyhttpimpl.cpp b/src/network/access/qnetworkreplyhttpimpl.cpp
index 382da0db5a..96016453c2 100644
--- a/src/network/access/qnetworkreplyhttpimpl.cpp
+++ b/src/network/access/qnetworkreplyhttpimpl.cpp
@@ -60,8 +60,6 @@
#include "qnetworkcookiejar.h"
-#ifndef QT_NO_HTTP
-
#include <string.h> // for strchr
QT_BEGIN_NAMESPACE
@@ -773,6 +771,12 @@ void QNetworkReplyHttpImplPrivate::postRequest(const QNetworkRequest &newHttpReq
if (request.attribute(QNetworkRequest::HTTP2AllowedAttribute).toBool())
httpRequest.setHTTP2Allowed(true);
+ if (request.attribute(QNetworkRequest::Http2DirectAttribute).toBool()) {
+ // Intentionally mutually exclusive - cannot be both direct and 'allowed'
+ httpRequest.setHTTP2Direct(true);
+ httpRequest.setHTTP2Allowed(false);
+ }
+
if (static_cast<QNetworkRequest::LoadControl>
(newHttpRequest.attribute(QNetworkRequest::AuthenticationReuseAttribute,
QNetworkRequest::Automatic).toInt()) == QNetworkRequest::Manual)
@@ -1288,7 +1292,9 @@ void QNetworkReplyHttpImplPrivate::replyDownloadMetaData(const QList<QPair<QByte
q->setAttribute(QNetworkRequest::HttpPipeliningWasUsedAttribute, pu);
const QVariant http2Allowed = request.attribute(QNetworkRequest::HTTP2AllowedAttribute);
- if (http2Allowed.isValid() && http2Allowed.toBool()) {
+ const QVariant http2Direct = request.attribute(QNetworkRequest::Http2DirectAttribute);
+ if ((http2Allowed.isValid() && http2Allowed.toBool())
+ || (http2Direct.isValid() && http2Direct.toBool())) {
q->setAttribute(QNetworkRequest::HTTP2WasUsedAttribute, spdyWasUsed);
q->setAttribute(QNetworkRequest::SpdyWasUsedAttribute, false);
} else {
@@ -2375,5 +2381,3 @@ void QNetworkReplyHttpImplPrivate::completeCacheSave()
}
QT_END_NAMESPACE
-
-#endif // QT_NO_HTTP
diff --git a/src/network/access/qnetworkreplyhttpimpl_p.h b/src/network/access/qnetworkreplyhttpimpl_p.h
index 9d47f65ce7..f5f01d0811 100644
--- a/src/network/access/qnetworkreplyhttpimpl_p.h
+++ b/src/network/access/qnetworkreplyhttpimpl_p.h
@@ -72,7 +72,7 @@
#include <QtNetwork/QSslConfiguration>
#endif
-#ifndef QT_NO_HTTP
+QT_REQUIRE_CONFIG(http);
QT_BEGIN_NAMESPACE
@@ -86,14 +86,14 @@ public:
QNetworkReplyHttpImpl(QNetworkAccessManager* const, const QNetworkRequest&, QNetworkAccessManager::Operation&, QIODevice* outgoingData);
virtual ~QNetworkReplyHttpImpl();
- void close() Q_DECL_OVERRIDE;
- void abort() Q_DECL_OVERRIDE;
- qint64 bytesAvailable() const Q_DECL_OVERRIDE;
- bool isSequential () const Q_DECL_OVERRIDE;
- qint64 size() const Q_DECL_OVERRIDE;
- qint64 readData(char*, qint64) Q_DECL_OVERRIDE;
- void setReadBufferSize(qint64 size) Q_DECL_OVERRIDE;
- bool canReadLine () const Q_DECL_OVERRIDE;
+ void close() override;
+ void abort() override;
+ qint64 bytesAvailable() const override;
+ bool isSequential () const override;
+ qint64 size() const override;
+ qint64 readData(char*, qint64) override;
+ void setReadBufferSize(qint64 size) override;
+ bool canReadLine () const override;
Q_DECLARE_PRIVATE(QNetworkReplyHttpImpl)
Q_PRIVATE_SLOT(d_func(), void _q_startOperation())
@@ -141,10 +141,10 @@ public:
#ifndef QT_NO_SSL
protected:
- void ignoreSslErrors() Q_DECL_OVERRIDE;
- void ignoreSslErrorsImplementation(const QList<QSslError> &errors) Q_DECL_OVERRIDE;
- void setSslConfigurationImplementation(const QSslConfiguration &configuration) Q_DECL_OVERRIDE;
- void sslConfigurationImplementation(QSslConfiguration &configuration) const Q_DECL_OVERRIDE;
+ void ignoreSslErrors() override;
+ void ignoreSslErrorsImplementation(const QList<QSslError> &errors) override;
+ void setSslConfigurationImplementation(const QSslConfiguration &configuration) override;
+ void sslConfigurationImplementation(QSslConfiguration &configuration) const override;
#endif
signals:
@@ -315,6 +315,4 @@ public:
QT_END_NAMESPACE
-#endif // QT_NO_HTTP
-
#endif
diff --git a/src/network/access/qnetworkreplyimpl_p.h b/src/network/access/qnetworkreplyimpl_p.h
index 7cd99392d3..f4e8284ab6 100644
--- a/src/network/access/qnetworkreplyimpl_p.h
+++ b/src/network/access/qnetworkreplyimpl_p.h
@@ -76,15 +76,15 @@ class QNetworkReplyImpl: public QNetworkReply
public:
QNetworkReplyImpl(QObject *parent = 0);
~QNetworkReplyImpl();
- virtual void abort() Q_DECL_OVERRIDE;
+ virtual void abort() override;
// reimplemented from QNetworkReply / QIODevice
- virtual void close() Q_DECL_OVERRIDE;
- virtual qint64 bytesAvailable() const Q_DECL_OVERRIDE;
- virtual void setReadBufferSize(qint64 size) Q_DECL_OVERRIDE;
+ virtual void close() override;
+ virtual qint64 bytesAvailable() const override;
+ virtual void setReadBufferSize(qint64 size) override;
- virtual qint64 readData(char *data, qint64 maxlen) Q_DECL_OVERRIDE;
- virtual bool event(QEvent *) Q_DECL_OVERRIDE;
+ virtual qint64 readData(char *data, qint64 maxlen) override;
+ virtual bool event(QEvent *) override;
Q_DECLARE_PRIVATE(QNetworkReplyImpl)
Q_PRIVATE_SLOT(d_func(), void _q_startOperation())
@@ -101,10 +101,10 @@ public:
#ifndef QT_NO_SSL
protected:
- void sslConfigurationImplementation(QSslConfiguration &configuration) const Q_DECL_OVERRIDE;
- void setSslConfigurationImplementation(const QSslConfiguration &configuration) Q_DECL_OVERRIDE;
- virtual void ignoreSslErrors() Q_DECL_OVERRIDE;
- virtual void ignoreSslErrorsImplementation(const QList<QSslError> &errors) Q_DECL_OVERRIDE;
+ void sslConfigurationImplementation(QSslConfiguration &configuration) const override;
+ void setSslConfigurationImplementation(const QSslConfiguration &configuration) override;
+ virtual void ignoreSslErrors() override;
+ virtual void ignoreSslErrorsImplementation(const QList<QSslError> &errors) override;
#endif
};
@@ -219,9 +219,9 @@ public:
QNetworkAccessManager::Operation op);
~QDisabledNetworkReply();
- void abort() Q_DECL_OVERRIDE { }
+ void abort() override { }
protected:
- qint64 readData(char *, qint64) Q_DECL_OVERRIDE { return -1; }
+ qint64 readData(char *, qint64) override { return -1; }
};
#endif
diff --git a/src/network/access/qnetworkrequest.cpp b/src/network/access/qnetworkrequest.cpp
index 60701d45be..99f72a7955 100644
--- a/src/network/access/qnetworkrequest.cpp
+++ b/src/network/access/qnetworkrequest.cpp
@@ -298,6 +298,20 @@ QT_BEGIN_NAMESPACE
This attribute obsoletes FollowRedirectsAttribute.
(This value was introduced in 5.9.)
+ \value Http2DirectAttribute
+ Requests only, type: QMetaType::Bool (default: false)
+ If set, this attribute will force QNetworkAccessManager to use
+ HTTP/2 protocol without initial HTTP/2 protocol negotiation.
+ Use of this attribute implies prior knowledge that a particular
+ server supports HTTP/2. The attribute works with SSL or 'cleartext'
+ HTTP/2. If a server turns out to not support HTTP/2, when HTTP/2 direct
+ was specified, QNetworkAccessManager gives up, without attempting to
+ fall back to HTTP/1.1. If both HTTP2AllowedAttribute and
+ Http2DirectAttribute are set, Http2DirectAttribute takes priority.
+ (This value was introduced in 5.10.)
+
+ \omitvalue ResourceTypeAttribute
+
\value User
Special type. Additional information can be passed in
QVariants with types ranging from User to UserMax. The default
diff --git a/src/network/access/qnetworkrequest.h b/src/network/access/qnetworkrequest.h
index 68d4ae6d6b..e104c139d9 100644
--- a/src/network/access/qnetworkrequest.h
+++ b/src/network/access/qnetworkrequest.h
@@ -92,6 +92,8 @@ public:
HTTP2WasUsedAttribute,
OriginalContentLengthAttribute,
RedirectPolicyAttribute,
+ Http2DirectAttribute,
+ ResourceTypeAttribute, // internal
User = 1000,
UserMax = 32767
diff --git a/src/network/access/qspdyprotocolhandler.cpp b/src/network/access/qspdyprotocolhandler.cpp
index 445a2a1c29..403c01e974 100644
--- a/src/network/access/qspdyprotocolhandler.cpp
+++ b/src/network/access/qspdyprotocolhandler.cpp
@@ -43,7 +43,7 @@
#include <private/qhttpnetworkconnectionchannel_p.h>
#include <QtCore/QtEndian>
-#if !defined(QT_NO_HTTP) && !defined(QT_NO_SSL)
+#if !defined(QT_NO_SSL)
QT_BEGIN_NAMESPACE
@@ -1294,4 +1294,4 @@ qint32 QSpdyProtocolHandler::generateNextStreamID()
QT_END_NAMESPACE
-#endif // !defined(QT_NO_HTTP) && !defined(QT_NO_SSL)
+#endif // !defined(QT_NO_SSL)
diff --git a/src/network/access/qspdyprotocolhandler_p.h b/src/network/access/qspdyprotocolhandler_p.h
index 0a18505b23..dd93a9aba2 100644
--- a/src/network/access/qspdyprotocolhandler_p.h
+++ b/src/network/access/qspdyprotocolhandler_p.h
@@ -58,7 +58,9 @@
#include <zlib.h>
-#if !defined(QT_NO_HTTP) && !defined(QT_NO_SSL)
+QT_REQUIRE_CONFIG(http);
+
+#if !defined(QT_NO_SSL)
QT_BEGIN_NAMESPACE
@@ -101,9 +103,9 @@ public:
Q_DECLARE_FLAGS(SETTINGS_ID_Flags, SETTINGS_ID_Flag)
- virtual void _q_receiveReply() Q_DECL_OVERRIDE;
- virtual void _q_readyRead() Q_DECL_OVERRIDE;
- virtual bool sendRequest() Q_DECL_OVERRIDE;
+ virtual void _q_receiveReply() override;
+ virtual void _q_readyRead() override;
+ virtual bool sendRequest() override;
private slots:
void _q_uploadDataReadyRead();
@@ -223,6 +225,6 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(QSpdyProtocolHandler::SETTINGS_ID_Flags)
QT_END_NAMESPACE
-#endif // !defined(QT_NO_HTTP) && !defined(QT_NO_SSL)
+#endif // !defined(QT_NO_SSL)
#endif // QSPDYPROTOCOLHANDLER_H
diff --git a/src/network/bearer/qnetworkconfigmanager.h b/src/network/bearer/qnetworkconfigmanager.h
index da248bc7d0..e8866999c7 100644
--- a/src/network/bearer/qnetworkconfigmanager.h
+++ b/src/network/bearer/qnetworkconfigmanager.h
@@ -66,7 +66,7 @@ public:
Q_DECLARE_FLAGS(Capabilities, Capability)
- explicit QNetworkConfigurationManager(QObject *parent = Q_NULLPTR);
+ explicit QNetworkConfigurationManager(QObject *parent = nullptr);
virtual ~QNetworkConfigurationManager();
QNetworkConfigurationManager::Capabilities capabilities() const;
diff --git a/src/network/bearer/qnetworksession.h b/src/network/bearer/qnetworksession.h
index d96b8915eb..1b5ae9098b 100644
--- a/src/network/bearer/qnetworksession.h
+++ b/src/network/bearer/qnetworksession.h
@@ -87,7 +87,7 @@ public:
Q_DECLARE_FLAGS(UsagePolicies, UsagePolicy)
- explicit QNetworkSession(const QNetworkConfiguration &connConfig, QObject *parent = Q_NULLPTR);
+ explicit QNetworkSession(const QNetworkConfiguration &connConfig, QObject *parent = nullptr);
virtual ~QNetworkSession();
bool isOpen() const;
@@ -131,8 +131,8 @@ Q_SIGNALS:
void usagePoliciesChanged(QNetworkSession::UsagePolicies usagePolicies);
protected:
- virtual void connectNotify(const QMetaMethod &signal) Q_DECL_OVERRIDE;
- virtual void disconnectNotify(const QMetaMethod &signal) Q_DECL_OVERRIDE;
+ virtual void connectNotify(const QMetaMethod &signal) override;
+ virtual void disconnectNotify(const QMetaMethod &signal) override;
private:
Q_DISABLE_COPY(QNetworkSession)
diff --git a/src/network/configure.json b/src/network/configure.json
index d46fbfc101..ea01e8224d 100644
--- a/src/network/configure.json
+++ b/src/network/configure.json
@@ -116,6 +116,24 @@
},
"use": "network"
},
+ "linux-netlink": {
+ "label": "Linux AF_NETLINK sockets",
+ "type": "compile",
+ "test": {
+ "include": [ "asm/types.h", "linux/netlink.h", "linux/rtnetlink.h", "sys/socket.h" ],
+ "main": [
+ "struct rtattr rta = { };",
+ "struct ifinfomsg ifi = {};",
+ "struct ifaddrmsg ifa = {};",
+ "struct ifa_cacheinfo ci;",
+ "ci.ifa_prefered = ci.ifa_valid = 0;",
+ "(void)RTM_NEWLINK; (void)RTM_NEWADDR;",
+ "(void)IFLA_ADDRESS; (void)IFLA_IFNAME;",
+ "(void)IFA_ADDRESS; (void)IFA_LABEL; (void)IFA_CACHEINFO;",
+ "(void)(IFA_F_SECONDARY | IFA_F_DEPRECATED | IFA_F_PERMANENT | IFA_F_MANAGETEMPADDR);"
+ ]
+ }
+ },
"sctp": {
"label": "SCTP support",
"type": "compile",
@@ -161,6 +179,11 @@
"condition": "libs.libproxy",
"output": [ "privateFeature" ]
},
+ "linux-netlink": {
+ "label": "Linux AF_NETLINK",
+ "condition": "config.linux && tests.linux-netlink",
+ "output": [ "privateFeature" ]
+ },
"openssl": {
"label": "OpenSSL",
"enable": "input.openssl == 'yes' || input.openssl == 'linked' || input.openssl == 'runtime'",
@@ -270,6 +293,12 @@
"section": "Networking",
"condition": "features.temporaryfile",
"output": [ "publicFeature", "feature" ]
+ },
+ "dnslookup": {
+ "label": "QDnsLookup",
+ "purpose": "Provides API for DNS lookups.",
+ "section": "Networking",
+ "output": [ "publicFeature" ]
}
},
@@ -310,6 +339,11 @@ For example:
"getifaddrs", "ipv6ifname", "libproxy",
{
"type": "feature",
+ "args": "linux-netlink",
+ "condition": "config.linux"
+ },
+ {
+ "type": "feature",
"args": "securetransport",
"condition": "config.darwin"
},
diff --git a/src/network/kernel/kernel.pri b/src/network/kernel/kernel.pri
index b822a70e88..11b80d59d5 100644
--- a/src/network/kernel/kernel.pri
+++ b/src/network/kernel/kernel.pri
@@ -7,8 +7,6 @@ HEADERS += kernel/qtnetworkglobal.h \
kernel/qtnetworkglobal_p.h \
kernel/qauthenticator.h \
kernel/qauthenticator_p.h \
- kernel/qdnslookup.h \
- kernel/qdnslookup_p.h \
kernel/qhostaddress.h \
kernel/qhostaddress_p.h \
kernel/qhostinfo.h \
@@ -17,10 +15,10 @@ HEADERS += kernel/qtnetworkglobal.h \
kernel/qnetworkdatagram_p.h \
kernel/qnetworkinterface.h \
kernel/qnetworkinterface_p.h \
+ kernel/qnetworkinterface_unix_p.h \
kernel/qnetworkproxy.h
SOURCES += kernel/qauthenticator.cpp \
- kernel/qdnslookup.cpp \
kernel/qhostaddress.cpp \
kernel/qhostinfo.cpp \
kernel/qnetworkdatagram.cpp \
@@ -32,12 +30,22 @@ qtConfig(ftp) {
SOURCES += kernel/qurlinfo.cpp
}
+qtConfig(dnslookup) {
+ HEADERS += kernel/qdnslookup.h \
+ kernel/qdnslookup_p.h
+
+ SOURCES += kernel/qdnslookup.cpp
+}
+
unix {
- !integrity: SOURCES += kernel/qdnslookup_unix.cpp
- SOURCES += kernel/qhostinfo_unix.cpp kernel/qnetworkinterface_unix.cpp
+ !integrity:qtConfig(dnslookup): SOURCES += kernel/qdnslookup_unix.cpp
+ SOURCES += kernel/qhostinfo_unix.cpp
+
+ qtConfig(linux-netlink): SOURCES += kernel/qnetworkinterface_linux.cpp
+ else: SOURCES += kernel/qnetworkinterface_unix.cpp
}
-android {
+android:qtConfig(dnslookup) {
SOURCES -= kernel/qdnslookup_unix.cpp
SOURCES += kernel/qdnslookup_android.cpp
}
@@ -46,12 +54,12 @@ win32: {
SOURCES += kernel/qhostinfo_win.cpp
!winrt {
- SOURCES += kernel/qdnslookup_win.cpp \
- kernel/qnetworkinterface_win.cpp
+ SOURCES += kernel/qnetworkinterface_win.cpp
+ qtConfig(dnslookup): SOURCES += kernel/qdnslookup_win.cpp
LIBS_PRIVATE += -ldnsapi -liphlpapi
} else {
- SOURCES += kernel/qdnslookup_winrt.cpp \
- kernel/qnetworkinterface_winrt.cpp
+ SOURCES += kernel/qnetworkinterface_winrt.cpp
+ qtConfig(dnslookup): SOURCES += kernel/qdnslookup_winrt.cpp
}
}
@@ -60,6 +68,7 @@ mac {
!uikit: LIBS_PRIVATE += -framework CoreServices -framework SystemConfiguration
}
+uikit:HEADERS += kernel/qnetworkinterface_uikit_p.h
osx:SOURCES += kernel/qnetworkproxy_mac.cpp
else:win32:!winrt: SOURCES += kernel/qnetworkproxy_win.cpp
else: qtConfig(libproxy) {
diff --git a/src/network/kernel/qdnslookup.h b/src/network/kernel/qdnslookup.h
index ead5e650f5..eebd0abe66 100644
--- a/src/network/kernel/qdnslookup.h
+++ b/src/network/kernel/qdnslookup.h
@@ -47,6 +47,8 @@
#include <QtCore/qsharedpointer.h>
#include <QtCore/qstring.h>
+QT_REQUIRE_CONFIG(dnslookup);
+
QT_BEGIN_NAMESPACE
class QHostAddress;
@@ -218,9 +220,9 @@ public:
};
Q_ENUM(Type)
- explicit QDnsLookup(QObject *parent = Q_NULLPTR);
- QDnsLookup(Type type, const QString &name, QObject *parent = Q_NULLPTR);
- QDnsLookup(Type type, const QString &name, const QHostAddress &nameserver, QObject *parent = Q_NULLPTR);
+ explicit QDnsLookup(QObject *parent = nullptr);
+ QDnsLookup(Type type, const QString &name, QObject *parent = nullptr);
+ QDnsLookup(Type type, const QString &name, const QHostAddress &nameserver, QObject *parent = nullptr);
~QDnsLookup();
Error error() const;
diff --git a/src/network/kernel/qdnslookup_p.h b/src/network/kernel/qdnslookup_p.h
index d070286383..4584396efe 100644
--- a/src/network/kernel/qdnslookup_p.h
+++ b/src/network/kernel/qdnslookup_p.h
@@ -60,6 +60,8 @@
#include "QtNetwork/qhostaddress.h"
#include "private/qobject_p.h"
+QT_REQUIRE_CONFIG(dnslookup);
+
QT_BEGIN_NAMESPACE
//#define QDNSLOOKUP_DEBUG
@@ -118,7 +120,7 @@ public:
, requestName(name)
, nameserver(nameserver)
{ }
- void run() Q_DECL_OVERRIDE;
+ void run() override;
signals:
void finished(const QDnsLookupReply &reply);
diff --git a/src/network/kernel/qhostaddress.cpp b/src/network/kernel/qhostaddress.cpp
index a1adc61c4c..bf00c6efce 100644
--- a/src/network/kernel/qhostaddress.cpp
+++ b/src/network/kernel/qhostaddress.cpp
@@ -64,32 +64,6 @@
QT_BEGIN_NAMESPACE
-
-class QHostAddressPrivate : public QSharedData
-{
-public:
- QHostAddressPrivate();
-
- void setAddress(quint32 a_ = 0);
- void setAddress(const quint8 *a_);
- void setAddress(const Q_IPV6ADDR &a_);
-
- bool parse(const QString &ipString);
- void clear();
-
- QString scopeId;
-
- union {
- Q_IPV6ADDR a6; // IPv6 address
- struct { quint64 c[2]; } a6_64;
- struct { quint32 c[4]; } a6_32;
- };
- quint32 a; // IPv4 address
- qint8 protocol;
-
- friend class QHostAddress;
-};
-
QHostAddressPrivate::QHostAddressPrivate()
: a(0), protocol(QAbstractSocket::UnknownNetworkLayerProtocol)
{
@@ -205,6 +179,75 @@ void QHostAddressPrivate::clear()
memset(&a6, 0, sizeof(a6));
}
+AddressClassification QHostAddressPrivate::classify() const
+{
+ if (a) {
+ // This is an IPv4 address or an IPv6 v4-mapped address includes all
+ // IPv6 v4-compat addresses, except for ::ffff:0.0.0.0 (because `a' is
+ // zero). See setAddress(quint8*) below, which calls convertToIpv4(),
+ // for details.
+ // Source: RFC 5735
+ if ((a & 0xff000000U) == 0x7f000000U) // 127.0.0.0/8
+ return LoopbackAddress;
+ if ((a & 0xf0000000U) == 0xe0000000U) // 224.0.0.0/4
+ return MulticastAddress;
+ if ((a & 0xffff0000U) == 0xa9fe0000U) // 169.254.0.0/16
+ return LinkLocalAddress;
+ if ((a & 0xff000000U) == 0) // 0.0.0.0/8 except 0.0.0.0 (handled below)
+ return LocalNetAddress;
+ if ((a & 0xf0000000U) == 0xf0000000U) { // 240.0.0.0/4
+ if (a == 0xffffffffU) // 255.255.255.255
+ return BroadcastAddress;
+ return UnknownAddress;
+ }
+
+ // Not testing for PrivateNetworkAddress and TestNetworkAddress
+ // since we don't need them yet.
+ return GlobalAddress;
+ }
+
+ // As `a' is zero, this address is either ::ffff:0.0.0.0 or a non-v4-mapped IPv6 address.
+ // Source: https://www.iana.org/assignments/ipv6-address-space/ipv6-address-space.xhtml
+ if (a6_64.c[0]) {
+ quint32 high16 = qFromBigEndian(a6_32.c[0]) >> 16;
+ switch (high16 >> 8) {
+ case 0xff: // ff00::/8
+ return MulticastAddress;
+ case 0xfe:
+ switch (high16 & 0xffc0) {
+ case 0xfec0: // fec0::/10
+ return SiteLocalAddress;
+
+ case 0xfe80: // fe80::/10
+ return LinkLocalAddress;
+
+ default: // fe00::/9
+ return UnknownAddress;
+ }
+ case 0xfd: // fc00::/7
+ case 0xfc:
+ return UniqueLocalAddress;
+ default:
+ return GlobalAddress;
+ }
+ }
+
+ quint64 low64 = qFromBigEndian(a6_64.c[1]);
+ if (low64 == 1) // ::1
+ return LoopbackAddress;
+ if (low64 >> 32 == 0xffff) { // ::ffff:0.0.0.0/96
+ Q_ASSERT(quint32(low64) == 0);
+ return LocalNetAddress;
+ }
+ if (low64) // not ::
+ return GlobalAddress;
+
+ if (protocol == QAbstractSocket::UnknownNetworkLayerProtocol)
+ return UnknownAddress;
+
+ // only :: and 0.0.0.0 remain now
+ return LocalNetAddress;
+}
bool QNetmask::setAddress(const QHostAddress &address)
{
@@ -685,7 +728,7 @@ void QHostAddress::setAddress(SpecialAddress address)
*/
quint32 QHostAddress::toIPv4Address() const
{
- return toIPv4Address(Q_NULLPTR);
+ return toIPv4Address(nullptr);
}
/*!
@@ -1154,21 +1197,91 @@ QPair<QHostAddress, int> QHostAddress::parseSubnet(const QString &subnet)
*/
bool QHostAddress::isLoopback() const
{
- if ((d->a & 0xFF000000) == 0x7F000000)
- return true; // v4 range (including IPv6 wrapped IPv4 addresses)
- if (d->protocol == QAbstractSocket::IPv6Protocol) {
-#ifdef __SSE2__
- const __m128i loopback = _mm_setr_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1);
- __m128i ipv6 = _mm_loadu_si128((const __m128i *)d->a6.c);
- __m128i cmp = _mm_cmpeq_epi8(ipv6, loopback);
- return _mm_movemask_epi8(cmp) == 0xffff;
-#else
- if (d->a6_64.c[0] != 0 || qFromBigEndian(d->a6_64.c[1]) != 1)
- return false;
-#endif
- return true;
- }
- return false;
+ return d->classify() == LoopbackAddress;
+}
+
+/*!
+ \since 5.11
+
+ Returns \c true if the address is an IPv4 or IPv6 global address, \c false
+ otherwise. A global address is an address that is not reserved for
+ special purposes (like loopback or multicast) or future purposes.
+
+ Note that IPv6 unique local unicast addresses are considered global
+ addresses (see isUniqueLocalUnicast()), as are IPv4 addresses reserved for
+ local networks by \l {https://tools.ietf.org/html/rfc1918}{RFC 1918}.
+
+ Also note that IPv6 site-local addresses are deprecated and should be
+ considered as global in new applications. This function returns true for
+ site-local addresses too.
+
+ \sa isLoopback(), isSiteLocal(), isUniqueLocalUnicast()
+*/
+bool QHostAddress::isGlobal() const
+{
+ return d->classify() & GlobalAddress; // GlobalAddress is a bit
+}
+
+/*!
+ \since 5.11
+
+ Returns \c true if the address is an IPv4 or IPv6 link-local address, \c
+ false otherwise.
+
+ An IPv4 link-local address is an address in the network 169.254.0.0/16. An
+ IPv6 link-local address is one in the network fe80::/10. See the
+ \l{https://www.iana.org/assignments/ipv6-address-space/ipv6-address-space.xhtml}{IANA
+ IPv6 Address Space} registry for more information.
+
+ \sa isLoopback(), isGlobal(). isMulticast(), isSiteLocal(), isUniqueLocalUnicast()
+*/
+bool QHostAddress::isLinkLocal() const
+{
+ return d->classify() == LinkLocalAddress;
+}
+
+/*!
+ \since 5.11
+
+ Returns \c true if the address is an IPv6 site-local address, \c
+ false otherwise.
+
+ An IPv6 site-local address is one in the network fec0::/10. See the
+ \l{https://www.iana.org/assignments/ipv6-address-space/ipv6-address-space.xhtml}{IANA
+ IPv6 Address Space} registry for more information.
+
+ IPv6 site-local addresses are deprecated and should not be depended upon in
+ new applications. New applications should not depend on this function and
+ should consider site-local addresses the same as global (which is why
+ isGlobal() also returns true). Site-local addresses were replaced by Unique
+ Local Addresses (ULA).
+
+ \sa isLoopback(), isGlobal(), isMulticast(), isLinkLocal(), isUniqueLocalUnicast()
+*/
+bool QHostAddress::isSiteLocal() const
+{
+ return d->classify() == SiteLocalAddress;
+}
+
+/*!
+ \since 5.11
+
+ Returns \c true if the address is an IPv6 unique local unicast address, \c
+ false otherwise.
+
+ An IPv6 unique local unicast address is one in the network fc00::/7. See the
+ \l{https://www.iana.org/assignments/ipv6-address-space/ipv6-address-space.xhtml}
+ {IANA IPv6 Address Space} registry for more information.
+
+ Note that Unique local unicast addresses count as global addresses too. RFC
+ 4193 says that, in practice, "applications may treat these addresses like
+ global scoped addresses." Only routers need care about the distinction.
+
+ \sa isLoopback(), isGlobal(), isMulticast(), isLinkLocal(), isUniqueLocalUnicast()
+*/
+bool QHostAddress::isUniqueLocalUnicast() const
+{
+ return d->classify() == UniqueLocalAddress;
}
/*!
@@ -1176,14 +1289,29 @@ bool QHostAddress::isLoopback() const
Returns \c true if the address is an IPv4 or IPv6 multicast address, \c
false otherwise.
+
+ \sa isLoopback(), isGlobal(), isLinkLocal(), isSiteLocal(), isUniqueLocalUnicast()
*/
bool QHostAddress::isMulticast() const
{
- if ((d->a & 0xF0000000) == 0xE0000000)
- return true; // 224.0.0.0-239.255.255.255 (including v4-mapped IPv6 addresses)
- if (d->protocol == QAbstractSocket::IPv6Protocol)
- return d->a6.c[0] == 0xff;
- return false;
+ return d->classify() == MulticastAddress;
+}
+
+/*!
+ \since 5.11
+
+ Returns \c true if the address is the IPv4 broadcast address, \c false
+ otherwise. The IPv4 broadcast address is 255.255.255.255.
+
+ Note that this function does not return true for an IPv4 network's local
+ broadcast address. For that, please use \l QNetworkInterface to obtain the
+ broadcast addresses of the local machine.
+
+ \sa isLoopback(), isGlobal(), isMulticast(), isLinkLocal(), isUniqueLocalUnicast()
+*/
+bool QHostAddress::isBroadcast() const
+{
+ return d->classify() == BroadcastAddress;
}
#ifndef QT_NO_DEBUG_STREAM
diff --git a/src/network/kernel/qhostaddress.h b/src/network/kernel/qhostaddress.h
index fdbdbfc72c..00555f3d8e 100644
--- a/src/network/kernel/qhostaddress.h
+++ b/src/network/kernel/qhostaddress.h
@@ -148,12 +148,18 @@ public:
bool isInSubnet(const QPair<QHostAddress, int> &subnet) const;
bool isLoopback() const;
+ bool isGlobal() const;
+ bool isLinkLocal() const;
+ bool isSiteLocal() const;
+ bool isUniqueLocalUnicast() const;
bool isMulticast() const;
+ bool isBroadcast() const;
static QPair<QHostAddress, int> parseSubnet(const QString &subnet);
friend Q_NETWORK_EXPORT uint qHash(const QHostAddress &key, uint seed) Q_DECL_NOTHROW;
protected:
+ friend class QHostAddressPrivate;
QExplicitlySharedDataPointer<QHostAddressPrivate> d;
};
Q_DECLARE_OPERATORS_FOR_FLAGS(QHostAddress::ConversionMode)
diff --git a/src/network/kernel/qhostaddress_p.h b/src/network/kernel/qhostaddress_p.h
index 5106760ed9..4dc2989011 100644
--- a/src/network/kernel/qhostaddress_p.h
+++ b/src/network/kernel/qhostaddress_p.h
@@ -57,6 +57,22 @@
QT_BEGIN_NAMESPACE
+enum AddressClassification {
+ LoopbackAddress = 1,
+ LocalNetAddress, // RFC 1122
+ LinkLocalAddress, // RFC 4291 (v6), RFC 3927 (v4)
+ MulticastAddress, // RFC 4291 (v6), RFC 3171 (v4)
+ BroadcastAddress, // RFC 919, 922
+
+ GlobalAddress = 16,
+ TestNetworkAddress, // RFC 3849 (v6), RFC 5737 (v4),
+ PrivateNetworkAddress, // RFC 1918
+ UniqueLocalAddress, // RFC 4193
+ SiteLocalAddress, // RFC 4291 (deprecated by RFC 3879, should be treated as global)
+
+ UnknownAddress = 0 // unclassified or reserved
+};
+
class QNetmask
{
// stores 0-32 for IPv4, 0-128 for IPv6, or 255 for invalid
@@ -85,6 +101,35 @@ public:
{ return n1.length == n2.length; }
};
+class QHostAddressPrivate : public QSharedData
+{
+public:
+ QHostAddressPrivate();
+
+ void setAddress(quint32 a_ = 0);
+ void setAddress(const quint8 *a_);
+ void setAddress(const Q_IPV6ADDR &a_);
+
+ bool parse(const QString &ipString);
+ void clear();
+
+ QString scopeId;
+
+ union {
+ Q_IPV6ADDR a6; // IPv6 address
+ struct { quint64 c[2]; } a6_64;
+ struct { quint32 c[4]; } a6_32;
+ };
+ quint32 a; // IPv4 address
+ qint8 protocol;
+
+ AddressClassification classify() const;
+ static AddressClassification classify(const QHostAddress &address)
+ { return address.d->classify(); }
+
+ friend class QHostAddress;
+};
+
QT_END_NAMESPACE
#endif
diff --git a/src/network/kernel/qhostinfo_p.h b/src/network/kernel/qhostinfo_p.h
index dd46818a19..d1da814e54 100644
--- a/src/network/kernel/qhostinfo_p.h
+++ b/src/network/kernel/qhostinfo_p.h
@@ -194,7 +194,7 @@ public:
QHostInfoRunnable(const QString &hn, int i);
QHostInfoRunnable(const QString &hn, int i, const QObject *receiver,
QtPrivate::QSlotObjectBase *slotObj);
- void run() Q_DECL_OVERRIDE;
+ void run() override;
QString toBeLookedUp;
int id;
@@ -225,7 +225,7 @@ public:
QHostInfoLookupManager();
~QHostInfoLookupManager();
- void clear() Q_DECL_OVERRIDE;
+ void clear() override;
void work();
// called from QHostInfo
diff --git a/src/network/kernel/qhostinfo_unix.cpp b/src/network/kernel/qhostinfo_unix.cpp
index 8d2cffc304..d22608e22f 100644
--- a/src/network/kernel/qhostinfo_unix.cpp
+++ b/src/network/kernel/qhostinfo_unix.cpp
@@ -79,6 +79,11 @@ QT_BEGIN_NAMESPACE
# define Q_ADDRCONFIG AI_ADDRCONFIG
#endif
+enum LibResolvFeature {
+ NeedResInit,
+ NeedResNInit
+};
+
typedef struct __res_state *res_state_ptr;
typedef int (*res_init_proto)(void);
@@ -89,9 +94,29 @@ typedef void (*res_nclose_proto)(res_state_ptr);
static res_nclose_proto local_res_nclose = 0;
static res_state_ptr local_res = 0;
-static bool resolveLibraryInternal()
-{
#if QT_CONFIG(library) && !defined(Q_OS_QNX)
+namespace {
+struct LibResolv
+{
+ enum {
+#ifdef RES_NORELOAD
+ // If RES_NORELOAD is defined, then the libc is capable of watching
+ // /etc/resolv.conf for changes and reloading as necessary. So accept
+ // whatever is configured.
+ ReinitNecessary = false
+#else
+ ReinitNecessary = true
+#endif
+ };
+
+ QLibrary lib;
+ LibResolv();
+ ~LibResolv() { lib.unload(); }
+};
+}
+
+LibResolv::LibResolv()
+{
QLibrary lib;
#ifdef LIBRESOLV_SO
lib.setFileName(QStringLiteral(LIBRESOLV_SO));
@@ -100,32 +125,45 @@ static bool resolveLibraryInternal()
{
lib.setFileName(QLatin1String("resolv"));
if (!lib.load())
- return false;
+ return;
}
- local_res_init = res_init_proto(lib.resolve("__res_init"));
- if (!local_res_init)
- local_res_init = res_init_proto(lib.resolve("res_init"));
-
+ // res_ninit is required for localDomainName()
local_res_ninit = res_ninit_proto(lib.resolve("__res_ninit"));
if (!local_res_ninit)
local_res_ninit = res_ninit_proto(lib.resolve("res_ninit"));
-
- if (!local_res_ninit) {
- // if we can't get a thread-safe context, we have to use the global _res state
- local_res = res_state_ptr(lib.resolve("_res"));
- } else {
+ if (local_res_ninit) {
+ // we must now find res_nclose
local_res_nclose = res_nclose_proto(lib.resolve("res_nclose"));
if (!local_res_nclose)
local_res_nclose = res_nclose_proto(lib.resolve("__res_nclose"));
if (!local_res_nclose)
- local_res_ninit = 0;
+ local_res_ninit = nullptr;
}
-#endif
- return true;
+ if (ReinitNecessary || !local_res_ninit) {
+ local_res_init = res_init_proto(lib.resolve("__res_init"));
+ if (!local_res_init)
+ local_res_init = res_init_proto(lib.resolve("res_init"));
+
+ if (local_res_init && !local_res_ninit) {
+ // if we can't get a thread-safe context, we have to use the global _res state
+ local_res = res_state_ptr(lib.resolve("_res"));
+ }
+ }
+}
+Q_GLOBAL_STATIC(LibResolv, libResolv)
+
+static void resolveLibrary(LibResolvFeature f)
+{
+ if (LibResolv::ReinitNecessary || f == NeedResNInit)
+ libResolv();
+}
+#else // QT_CONFIG(library) || Q_OS_QNX
+static void resolveLibrary(LibResolvFeature)
+{
}
-Q_GLOBAL_STATIC_WITH_ARGS(bool, resolveLibrary, (resolveLibraryInternal()))
+#endif // QT_CONFIG(library) || Q_OS_QNX
QHostInfo QHostInfoAgent::fromName(const QString &hostName)
{
@@ -137,7 +175,7 @@ QHostInfo QHostInfoAgent::fromName(const QString &hostName)
#endif
// Load res_init on demand.
- resolveLibrary();
+ resolveLibrary(NeedResInit);
// If res_init is available, poll it.
if (local_res_init)
@@ -275,7 +313,7 @@ QHostInfo QHostInfoAgent::fromName(const QString &hostName)
QString QHostInfo::localDomainName()
{
#if !defined(Q_OS_VXWORKS) && !defined(Q_OS_ANDROID)
- resolveLibrary();
+ resolveLibrary(NeedResNInit);
if (local_res_ninit) {
// using thread-safe version
res_state_ptr state = res_state_ptr(malloc(sizeof(*state)));
diff --git a/src/network/kernel/qnetworkdatagram.h b/src/network/kernel/qnetworkdatagram.h
index fa994d6170..c7605d67ba 100644
--- a/src/network/kernel/qnetworkdatagram.h
+++ b/src/network/kernel/qnetworkdatagram.h
@@ -63,7 +63,7 @@ public:
QNetworkDatagram(QNetworkDatagram &&other) Q_DECL_NOTHROW
: d(other.d)
- { other.d = Q_NULLPTR; }
+ { other.d = nullptr; }
QNetworkDatagram &operator=(QNetworkDatagram &&other) Q_DECL_NOTHROW
{ swap(other); return *this; }
diff --git a/src/network/kernel/qnetworkinterface.cpp b/src/network/kernel/qnetworkinterface.cpp
index 3857ff87b9..3fb0dc80ee 100644
--- a/src/network/kernel/qnetworkinterface.cpp
+++ b/src/network/kernel/qnetworkinterface.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
-** Copyright (C) 2016 Intel Corporation.
+** Copyright (C) 2017 Intel Corporation.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtNetwork module of the Qt Toolkit.
@@ -59,19 +59,15 @@ static QList<QNetworkInterfacePrivate *> postProcess(QList<QNetworkInterfacePriv
// The math is:
// broadcast = IP | ~netmask
- QList<QNetworkInterfacePrivate *>::Iterator it = list.begin();
- const QList<QNetworkInterfacePrivate *>::Iterator end = list.end();
- for ( ; it != end; ++it) {
- QList<QNetworkAddressEntry>::Iterator addr_it = (*it)->addressEntries.begin();
- const QList<QNetworkAddressEntry>::Iterator addr_end = (*it)->addressEntries.end();
- for ( ; addr_it != addr_end; ++addr_it) {
- if (addr_it->ip().protocol() != QAbstractSocket::IPv4Protocol)
+ for (QNetworkInterfacePrivate *interface : list) {
+ for (QNetworkAddressEntry &address : interface->addressEntries) {
+ if (address.ip().protocol() != QAbstractSocket::IPv4Protocol)
continue;
- if (!addr_it->netmask().isNull() && addr_it->broadcast().isNull()) {
- QHostAddress bcast = addr_it->ip();
- bcast = QHostAddress(bcast.toIPv4Address() | ~addr_it->netmask().toIPv4Address());
- addr_it->setBroadcast(bcast);
+ if (!address.netmask().isNull() && address.broadcast().isNull()) {
+ QHostAddress bcast = address.ip();
+ bcast = QHostAddress(bcast.toIPv4Address() | ~address.netmask().toIPv4Address());
+ address.setBroadcast(bcast);
}
}
}
@@ -91,17 +87,16 @@ QNetworkInterfaceManager::~QNetworkInterfaceManager()
QSharedDataPointer<QNetworkInterfacePrivate> QNetworkInterfaceManager::interfaceFromName(const QString &name)
{
- QList<QSharedDataPointer<QNetworkInterfacePrivate> > interfaceList = allInterfaces();
- QList<QSharedDataPointer<QNetworkInterfacePrivate> >::ConstIterator it = interfaceList.constBegin();
+ const auto interfaceList = allInterfaces();
bool ok;
uint index = name.toUInt(&ok);
- for ( ; it != interfaceList.constEnd(); ++it) {
- if (ok && (*it)->index == int(index))
- return *it;
- else if ((*it)->name == name)
- return *it;
+ for (const auto &interface : interfaceList) {
+ if (ok && interface->index == int(index))
+ return interface;
+ else if (interface->name == name)
+ return interface;
}
return empty;
@@ -109,11 +104,11 @@ QSharedDataPointer<QNetworkInterfacePrivate> QNetworkInterfaceManager::interface
QSharedDataPointer<QNetworkInterfacePrivate> QNetworkInterfaceManager::interfaceFromIndex(int index)
{
- QList<QSharedDataPointer<QNetworkInterfacePrivate> > interfaceList = allInterfaces();
- QList<QSharedDataPointer<QNetworkInterfacePrivate> >::ConstIterator it = interfaceList.constBegin();
- for ( ; it != interfaceList.constEnd(); ++it)
- if ((*it)->index == index)
- return *it;
+ const auto interfaceList = allInterfaces();
+ for (const auto &interface : interfaceList) {
+ if (interface->index == index)
+ return interface;
+ }
return empty;
}
@@ -124,8 +119,15 @@ QList<QSharedDataPointer<QNetworkInterfacePrivate> > QNetworkInterfaceManager::a
QList<QSharedDataPointer<QNetworkInterfacePrivate> > result;
result.reserve(list.size());
- for (QNetworkInterfacePrivate *ptr : list)
+ for (QNetworkInterfacePrivate *ptr : list) {
+ if ((ptr->flags & QNetworkInterface::IsUp) == 0) {
+ // if the network interface isn't UP, the addresses are ineligible for DNS
+ for (auto &addr : ptr->addressEntries)
+ addr.setDnsEligibility(QNetworkAddressEntry::DnsIneligible);
+ }
+
result << QSharedDataPointer<QNetworkInterfacePrivate>(ptr);
+ }
return result;
}
@@ -164,6 +166,32 @@ QString QNetworkInterfacePrivate::makeHwAddress(int len, uchar *data)
*/
/*!
+ \enum QNetworkAddressEntry::DnsEligilibilityStatus
+ \since 5.11
+
+ This enum indicates whether a given host address is eligible to be
+ published in the Domain Name System (DNS) or other similar name resolution
+ mechanisms. In general, an address is suitable for publication if it is an
+ address this machine will be reached at for an indeterminate amount of
+ time, though it need not be permanent. For example, addresses obtained via
+ DHCP are often eligible, but cryptographically-generated temporary IPv6
+ addresses are not.
+
+ \value DnsEligibilityUnknown Qt and the operating system could not determine
+ whether this address should be published or not.
+ The application may need to apply further
+ heuristics if it cannot find any eligible
+ addresses.
+ \value DnsEligible This address is eligible for publication in DNS.
+ \value DnsIneligible This address should not be published in DNS and
+ should not be transmitted to other parties,
+ except maybe as the source address of an outgoing
+ packet.
+
+ \sa dnsEligibility(), setDnsEligibility()
+*/
+
+/*!
Constructs an empty QNetworkAddressEntry object.
*/
QNetworkAddressEntry::QNetworkAddressEntry()
@@ -218,6 +246,39 @@ bool QNetworkAddressEntry::operator==(const QNetworkAddressEntry &other) const
}
/*!
+ \since 5.11
+
+ Returns whether this address is eligible for publication in the Domain Name
+ System (DNS) or similar name resolution mechanisms.
+
+ In general, an address is suitable for publication if it is an address this
+ machine will be reached at for an indeterminate amount of time, though it
+ need not be permanent. For example, addresses obtained via DHCP are often
+ eligible, but cryptographically-generated temporary IPv6 addresses are not.
+
+ On some systems, QNetworkInterface will need to heuristically determine
+ which addresses are eligible.
+
+ \sa isLifetimeKnown(), isPermanent(), setDnsEligibility()
+*/
+QNetworkAddressEntry::DnsEligibilityStatus QNetworkAddressEntry::dnsEligibility() const
+{
+ return d->dnsEligibility;
+}
+
+/*!
+ \since 5.11
+
+ Sets the DNS eligibility flag for this address to \a status.
+
+ \sa dnsEligibility()
+*/
+void QNetworkAddressEntry::setDnsEligibility(DnsEligibilityStatus status)
+{
+ d->dnsEligibility = status;
+}
+
+/*!
\fn bool QNetworkAddressEntry::operator!=(const QNetworkAddressEntry &other) const
Returns \c true if this network address entry is different from \a
@@ -340,6 +401,122 @@ void QNetworkAddressEntry::setBroadcast(const QHostAddress &newBroadcast)
}
/*!
+ \since 5.11
+
+ Returns \c true if the address lifetime is known, \c false if not. If the
+ lifetime is not known, both preferredLifetime() and validityLifetime() will
+ return QDeadlineTimer::Forever.
+
+ \sa preferredLifetime(), validityLifetime(), setAddressLifetime(), clearAddressLifetime()
+*/
+bool QNetworkAddressEntry::isLifetimeKnown() const
+{
+ return d->lifetimeKnown;
+}
+
+/*!
+ \since 5.11
+
+ Returns the deadline when this address becomes deprecated (no longer
+ preferred), if known. If the address lifetime is not known (see
+ isLifetimeKnown()), this function always returns QDeadlineTimer::Forever.
+
+ While an address is preferred, it may be used by the operating system as
+ the source address for new, outgoing packets. After it becomes deprecated,
+ it will remain valid for incoming packets for a while longer until finally
+ removed (see validityLifetime()).
+
+ \sa validityLifetime(), isLifetimeKnown(), setAddressLifetime(), clearAddressLifetime()
+*/
+QDeadlineTimer QNetworkAddressEntry::preferredLifetime() const
+{
+ return d->preferredLifetime;
+}
+
+/*!
+ \since 5.11
+
+ Returns the deadline when this address becomes invalid and will be removed
+ from the networking stack, if known. If the address lifetime is not known
+ (see isLifetimeKnown()), this function always returns
+ QDeadlineTimer::Forever.
+
+ While an address is valid, it will be accepted by the operating system as a
+ valid destination address for this machine. Whether it is used as a source
+ address for new, outgoing packets is controlled by, among other rules, the
+ preferred lifetime (see preferredLifetime()).
+
+ \sa preferredLifetime(), isLifetimeKnown(), setAddressLifetime(), clearAddressLifetime()
+*/
+QDeadlineTimer QNetworkAddressEntry::validityLifetime() const
+{
+ return d->validityLifetime;
+}
+
+/*!
+ \since 5.11
+
+ Sets both the preferred and valid lifetimes for this address to the \a
+ preferred and \a validity deadlines, respectively. After this call,
+ isLifetimeKnown() will return \c true, even if both parameters are
+ QDeadlineTimer::Forever.
+
+ \sa preferredLifetime(), validityLifetime(), isLifetimeKnown(), clearAddressLifetime()
+*/
+void QNetworkAddressEntry::setAddressLifetime(QDeadlineTimer preferred, QDeadlineTimer validity)
+{
+ d->preferredLifetime = preferred;
+ d->validityLifetime = validity;
+ d->lifetimeKnown = true;
+}
+
+/*!
+ \since 5.11
+
+ Resets both the preferred and valid lifetimes for this address. After this
+ call, isLifetimeKnown() will return \c false.
+
+ \sa preferredLifetime(), validityLifetime(), isLifetimeKnown(), setAddressLifetime()
+*/
+void QNetworkAddressEntry::clearAddressLifetime()
+{
+ d->preferredLifetime = QDeadlineTimer::Forever;
+ d->validityLifetime = QDeadlineTimer::Forever;
+ d->lifetimeKnown = false;
+}
+
+/*!
+ \since 5.11
+
+ Returns \c true if this address is permanent on this interface, \c false if
+ it's temporary. A permenant address is one which has no expiration time and
+ is often static (manually configured).
+
+ If this information could not be determined, this function returns \c true.
+
+ \note Depending on the operating system and the networking configuration
+ tool, it is possible for a temporary address to be interpreted as
+ permanent, if the tool did not inform the details correctly to the
+ operating system.
+
+ \sa isLifetimeKnown(), validityLifetime(), isTemporary()
+*/
+bool QNetworkAddressEntry::isPermanent() const
+{
+ return d->validityLifetime.isForever();
+}
+
+/*!
+ \fn bool QNetworkAddressEntry::isTemporary() const
+ \since 5.11
+
+ Returns \c true if this address is temporary on this interface, \c false if
+ it's permanent.
+
+ \sa isLifetimeKnown(), validityLifetime(), isPermanent()
+*/
+
+/*!
\class QNetworkInterface
\brief The QNetworkInterface class provides a listing of the host's IP
addresses and network interfaces.
@@ -396,6 +573,57 @@ void QNetworkAddressEntry::setBroadcast(const QHostAddress &newBroadcast)
*/
/*!
+ \enum QNetworkInterface::InterfaceType
+
+ Specifies the type of hardware (PHY layer, OSI level 1) this interface is,
+ if it could be determined. Interface types that are not among those listed
+ below will generally be listed as Unknown, though future versions of Qt may
+ add new enumeration values.
+
+ The possible values are:
+
+ \value Unknown The interface type could not be determined or is not
+ one of the other listed types.
+ \value Loopback The virtual loopback interface, which is assigned
+ the loopback IP addresses (127.0.0.1, ::1).
+ \value Virtual A type of interface determined to be virtual, but
+ not any of the other possible types. For example,
+ tunnel interfaces are (currently) detected as
+ virtual ones.
+ \value Ethernet IEEE 802.3 Ethernet interfaces, though on many
+ systems other types of IEEE 802 interfaces may also
+ be detected as Ethernet (especially Wi-Fi).
+ \value WiFi IEEE 802.11 Wi-Fi interfaces. Note that on some
+ systems, QNetworkInterface may be unable to
+ distinguish regular Ethernet from Wi-Fi and will
+ not return this enum value.
+ \value Ieee80211 An alias for WiFi.
+ \value CanBus ISO 11898 Controller Area Network bus interfaces,
+ usually found on automotive systems.
+ \value Fddi ANSI X3T12 Fiber Distributed Data Interface, a local area
+ network over optical fibers.
+ \value Ppp Point-to-Point Protocol interfaces, establishing a
+ direct connection between two nodes over a lower
+ transport layer (often serial over radio or physical
+ line).
+ \value Slip Serial Line Internet Protocol interfaces.
+ \value Phonet Interfaces using the Linux Phonet socket family, for
+ communication with cellular modems. See the
+ \l {https://www.kernel.org/doc/Documentation/networking/phonet.txt}{Linux kernel documentation}
+ for more information.
+ \value Ieee802154 IEEE 802.15.4 Personal Area Network interfaces, other
+ than 6LoWPAN (see below).
+ \value SixLoWPAN 6LoWPAN (IPv6 over Low-power Wireless Personal Area
+ Networks) interfaces, which operate on IEEE 802.15.4
+ PHY, but have specific header compression schemes
+ for IPv6 and UDP. This type of interface is often
+ used for mesh networking.
+ \value Ieee80216 IEEE 802.16 Wireless Metropolitan Area Network, also
+ known under the commercial name "WiMAX".
+ \value Ieee1394 IEEE 1394 interfaces (a.k.a. "FireWire").
+*/
+
+/*!
Constructs an empty network interface object.
*/
QNetworkInterface::QNetworkInterface()
@@ -461,6 +689,29 @@ int QNetworkInterface::index() const
}
/*!
+ \since 5.11
+
+ Returns the maximum transmission unit on this interface, if known, or 0
+ otherwise.
+
+ The maximum transmission unit is the largest packet that may be sent on
+ this interface without incurring link-level fragmentation. Applications may
+ use this value to calculate the size of the payload that will fit an
+ unfragmented UDP datagram. Remember to subtract the sizes of headers used
+ in your communication over the interface, e.g. TCP (20 bytes) or UDP (12),
+ IPv4 (20) or IPv6 (40, absent some form of header compression), when
+ computing how big a payload you can transmit. Also note that the MTU along
+ the full path (the Path MTU) to the destination may be smaller than the
+ interface's MTU.
+
+ \sa QUdpSocket
+*/
+int QNetworkInterface::maxTransmissionUnit() const
+{
+ return d ? d->mtu : 0;
+}
+
+/*!
Returns the name of this network interface. On Unix systems, this
is a string containing the type of the interface and optionally a
sequence number, such as "eth0", "lo" or "pcn0". On Windows, it's
@@ -499,6 +750,19 @@ QNetworkInterface::InterfaceFlags QNetworkInterface::flags() const
}
/*!
+ \since 5.11
+
+ Returns the type of this interface, if it could be determined. If it could
+ not be determined, this function returns QNetworkInterface::Unknown.
+
+ \sa hardwareAddress()
+*/
+QNetworkInterface::InterfaceType QNetworkInterface::type() const
+{
+ return d ? d->type : Unknown;
+}
+
+/*!
Returns the low-level hardware address for this interface. On
Ethernet interfaces, this will be a MAC address in string
representation, separated by colons.
@@ -506,6 +770,8 @@ QNetworkInterface::InterfaceFlags QNetworkInterface::flags() const
Other interface types may have other types of hardware
addresses. Implementations should not depend on this function
returning a valid MAC address.
+
+ \sa type()
*/
QString QNetworkInterface::hardwareAddress() const
{
@@ -691,4 +957,6 @@ QDebug operator<<(QDebug debug, const QNetworkInterface &networkInterface)
QT_END_NAMESPACE
+#include "moc_qnetworkinterface.cpp"
+
#endif // QT_NO_NETWORKINTERFACE
diff --git a/src/network/kernel/qnetworkinterface.h b/src/network/kernel/qnetworkinterface.h
index c31621c3cb..f7ef192dc0 100644
--- a/src/network/kernel/qnetworkinterface.h
+++ b/src/network/kernel/qnetworkinterface.h
@@ -49,13 +49,19 @@
QT_BEGIN_NAMESPACE
-
+class QDeadlineTimer;
template<typename T> class QList;
class QNetworkAddressEntryPrivate;
class Q_NETWORK_EXPORT QNetworkAddressEntry
{
public:
+ enum DnsEligibilityStatus : qint8 {
+ DnsEligibilityUnknown = -1,
+ DnsIneligible = 0,
+ DnsEligible = 1
+ };
+
QNetworkAddressEntry();
QNetworkAddressEntry(const QNetworkAddressEntry &other);
#ifdef Q_COMPILER_RVALUE_REFS
@@ -70,6 +76,9 @@ public:
inline bool operator!=(const QNetworkAddressEntry &other) const
{ return !(*this == other); }
+ DnsEligibilityStatus dnsEligibility() const;
+ void setDnsEligibility(DnsEligibilityStatus status);
+
QHostAddress ip() const;
void setIp(const QHostAddress &newIp);
@@ -81,6 +90,14 @@ public:
QHostAddress broadcast() const;
void setBroadcast(const QHostAddress &newBroadcast);
+ bool isLifetimeKnown() const;
+ QDeadlineTimer preferredLifetime() const;
+ QDeadlineTimer validityLifetime() const;
+ void setAddressLifetime(QDeadlineTimer preferred, QDeadlineTimer validity);
+ void clearAddressLifetime();
+ bool isPermanent() const;
+ bool isTemporary() const { return !isPermanent(); }
+
private:
QScopedPointer<QNetworkAddressEntryPrivate> d;
};
@@ -90,6 +107,7 @@ Q_DECLARE_SHARED(QNetworkAddressEntry)
class QNetworkInterfacePrivate;
class Q_NETWORK_EXPORT QNetworkInterface
{
+ Q_GADGET
public:
enum InterfaceFlag {
IsUp = 0x1,
@@ -100,6 +118,27 @@ public:
CanMulticast = 0x20
};
Q_DECLARE_FLAGS(InterfaceFlags, InterfaceFlag)
+ Q_FLAG(InterfaceFlags)
+
+ enum InterfaceType {
+ Loopback = 1,
+ Virtual,
+ Ethernet,
+ Slip,
+ CanBus,
+ Ppp,
+ Fddi,
+ Wifi,
+ Ieee80211 = Wifi, // alias
+ Phonet,
+ Ieee802154,
+ SixLoWPAN, // 6LoWPAN, but we can't start with a digit
+ Ieee80216,
+ Ieee1394,
+
+ Unknown = 0
+ };
+ Q_ENUM(InterfaceType)
QNetworkInterface();
QNetworkInterface(const QNetworkInterface &other);
@@ -114,9 +153,11 @@ public:
bool isValid() const;
int index() const;
+ int maxTransmissionUnit() const;
QString name() const;
QString humanReadableName() const;
InterfaceFlags flags() const;
+ InterfaceType type() const;
QString hardwareAddress() const;
QList<QNetworkAddressEntry> addressEntries() const;
diff --git a/src/network/kernel/qnetworkinterface_linux.cpp b/src/network/kernel/qnetworkinterface_linux.cpp
new file mode 100644
index 0000000000..620ee7202b
--- /dev/null
+++ b/src/network/kernel/qnetworkinterface_linux.cpp
@@ -0,0 +1,443 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 Intel Corporation.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtNetwork module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qnetworkinterface.h"
+#include "qnetworkinterface_p.h"
+#include "qnetworkinterface_unix_p.h"
+
+#include <qendian.h>
+#include <qobjectdefs.h>
+#include <qvarlengtharray.h>
+
+// accordding to rtnetlink(7)
+#include <asm/types.h>
+#include <linux/if.h>
+#include <linux/if_arp.h>
+#include <linux/netlink.h>
+#include <linux/rtnetlink.h>
+#include <linux/wireless.h>
+#include <sys/socket.h>
+
+/* in case these aren't defined in linux/if_arp.h (added since 2.6.28) */
+#define ARPHRD_PHONET 820 /* v2.6.29: PhoNet media type */
+#define ARPHRD_PHONET_PIPE 821 /* v2.6.29: PhoNet pipe header */
+#define ARPHRD_IEEE802154 804 /* v2.6.31 */
+#define ARPHRD_6LOWPAN 825 /* v3.14: IPv6 over LoWPAN */
+
+QT_BEGIN_NAMESPACE
+
+enum {
+ BufferSize = 8192
+};
+
+static QNetworkInterface::InterfaceType probeIfType(int socket, struct ifreq *req, short arptype)
+{
+ switch (ushort(arptype)) {
+ case ARPHRD_LOOPBACK:
+ return QNetworkInterface::Loopback;
+
+ case ARPHRD_ETHER:
+ // check if it's a WiFi interface
+ if (qt_safe_ioctl(socket, SIOCGIWMODE, req) >= 0)
+ return QNetworkInterface::Wifi;
+ return QNetworkInterface::Ethernet;
+
+ case ARPHRD_SLIP:
+ case ARPHRD_CSLIP:
+ case ARPHRD_SLIP6:
+ case ARPHRD_CSLIP6:
+ return QNetworkInterface::Slip;
+
+ case ARPHRD_CAN:
+ return QNetworkInterface::CanBus;
+
+ case ARPHRD_PPP:
+ return QNetworkInterface::Ppp;
+
+ case ARPHRD_FDDI:
+ return QNetworkInterface::Fddi;
+
+ case ARPHRD_IEEE80211:
+ case ARPHRD_IEEE80211_PRISM:
+ case ARPHRD_IEEE80211_RADIOTAP:
+ return QNetworkInterface::Ieee80211;
+
+ case ARPHRD_IEEE802154:
+ return QNetworkInterface::Ieee802154;
+
+ case ARPHRD_PHONET:
+ case ARPHRD_PHONET_PIPE:
+ return QNetworkInterface::Phonet;
+
+ case ARPHRD_6LOWPAN:
+ return QNetworkInterface::SixLoWPAN;
+
+ case ARPHRD_TUNNEL:
+ case ARPHRD_TUNNEL6:
+ case ARPHRD_NONE:
+ case ARPHRD_VOID:
+ return QNetworkInterface::Virtual;
+ }
+ return QNetworkInterface::Unknown;
+}
+
+
+namespace {
+struct NetlinkSocket
+{
+ int sock;
+ NetlinkSocket(int bufferSize)
+ {
+ sock = qt_safe_socket(AF_NETLINK, SOCK_DGRAM, NETLINK_ROUTE);
+ if (Q_UNLIKELY(sock == -1))
+ qErrnoWarning("Could not create AF_NETLINK socket");
+
+ // set buffer length
+ socklen_t len = sizeof(bufferSize);
+ setsockopt(sock, SOL_SOCKET, SO_SNDBUF, &bufferSize, len);
+ }
+
+ ~NetlinkSocket()
+ {
+ if (sock != -1)
+ qt_safe_close(sock);
+ }
+
+ operator int() const { return sock; }
+};
+
+template <typename Lambda> struct ProcessNetlinkRequest
+{
+ using FunctionTraits = QtPrivate::FunctionPointer<decltype(&Lambda::operator())>;
+ using FirstArgument = typename FunctionTraits::Arguments::Car;
+
+ static int expectedTypeForRequest(int rtype)
+ {
+ Q_STATIC_ASSERT(RTM_NEWADDR == RTM_GETADDR - 2);
+ Q_STATIC_ASSERT(RTM_NEWLINK == RTM_GETLINK - 2);
+ Q_ASSERT(rtype == RTM_GETADDR || rtype == RTM_GETLINK);
+ return rtype - 2;
+ }
+
+ void operator()(int sock, nlmsghdr *hdr, char *buf, size_t bufsize, Lambda &&func)
+ {
+ // send the request
+ if (send(sock, hdr, hdr->nlmsg_len, 0) != hdr->nlmsg_len)
+ return;
+
+ // receive and parse the request
+ int expectedType = expectedTypeForRequest(hdr->nlmsg_type);
+ const bool isDump = hdr->nlmsg_flags & NLM_F_DUMP;
+ forever {
+ qssize_t len = recv(sock, buf, bufsize, 0);
+ hdr = reinterpret_cast<struct nlmsghdr *>(buf);
+ if (!NLMSG_OK(hdr, len))
+ return;
+
+ auto arg = reinterpret_cast<FirstArgument>(NLMSG_DATA(hdr));
+ size_t payloadLen = NLMSG_PAYLOAD(hdr, 0);
+
+ // is this a multipart message?
+ Q_ASSERT(isDump == !!(hdr->nlmsg_flags & NLM_F_MULTI));
+ if (!isDump) {
+ // no, single message
+ if (hdr->nlmsg_type == expectedType && payloadLen >= sizeof(FirstArgument))
+ return void(func(arg, payloadLen));
+ } else {
+ // multipart, parse until done
+ do {
+ if (hdr->nlmsg_type == NLMSG_DONE)
+ return;
+ if (hdr->nlmsg_type != expectedType || payloadLen < sizeof(FirstArgument))
+ break;
+ func(arg, payloadLen);
+
+ // NLMSG_NEXT also updates the len variable
+ hdr = NLMSG_NEXT(hdr, len);
+ arg = reinterpret_cast<FirstArgument>(NLMSG_DATA(hdr));
+ payloadLen = NLMSG_PAYLOAD(hdr, 0);
+ } while (NLMSG_OK(hdr, len));
+
+ if (len == 0)
+ continue; // get new datagram
+ }
+
+#ifndef QT_NO_DEBUG
+ if (NLMSG_OK(hdr, len))
+ qWarning("QNetworkInterface/AF_NETLINK: received unknown packet type (%d) or too short (%u)",
+ hdr->nlmsg_type, hdr->nlmsg_len);
+ else
+ qWarning("QNetworkInterface/AF_NETLINK: received invalid packet with size %d", int(len));
+#endif
+ return;
+ }
+ }
+};
+
+template <typename Lambda>
+void processNetlinkRequest(int sock, struct nlmsghdr *hdr, char *buf, size_t bufsize, Lambda &&l)
+{
+ ProcessNetlinkRequest<Lambda>()(sock, hdr, buf, bufsize, std::forward<Lambda>(l));
+}
+}
+
+uint QNetworkInterfaceManager::interfaceIndexFromName(const QString &name)
+{
+ uint index = 0;
+ if (name.length() >= IFNAMSIZ)
+ return index;
+
+ int socket = qt_safe_socket(AF_INET, SOCK_DGRAM, 0);
+ if (socket >= 0) {
+ struct ifreq req;
+ req.ifr_ifindex = 0;
+ strcpy(req.ifr_name, name.toLatin1().constData());
+
+ if (qt_safe_ioctl(socket, SIOCGIFINDEX, &req) >= 0)
+ index = req.ifr_ifindex;
+ qt_safe_close(socket);
+ }
+ return index;
+}
+
+QString QNetworkInterfaceManager::interfaceNameFromIndex(uint index)
+{
+ int socket = qt_safe_socket(AF_INET, SOCK_DGRAM, 0);
+ if (socket >= 0) {
+ struct ifreq req;
+ req.ifr_ifindex = index;
+
+ if (qt_safe_ioctl(socket, SIOCGIFNAME, &req) >= 0) {
+ qt_safe_close(socket);
+ return QString::fromLatin1(req.ifr_name);
+ }
+ qt_safe_close(socket);
+ }
+ return QString();
+}
+
+static QList<QNetworkInterfacePrivate *> getInterfaces(int sock, char *buf)
+{
+ QList<QNetworkInterfacePrivate *> result;
+ struct ifreq req;
+
+ // request all links
+ struct {
+ struct nlmsghdr req;
+ struct ifinfomsg ifi;
+ } ifi_req;
+ memset(&ifi_req, 0, sizeof(ifi_req));
+
+ ifi_req.req.nlmsg_len = sizeof(ifi_req);
+ ifi_req.req.nlmsg_flags = NLM_F_REQUEST | NLM_F_DUMP;
+ ifi_req.req.nlmsg_type = RTM_GETLINK;
+
+ // parse the interfaces
+ processNetlinkRequest(sock, &ifi_req.req, buf, BufferSize, [&](ifinfomsg *ifi, size_t len) {
+ auto iface = new QNetworkInterfacePrivate;
+ iface->index = ifi->ifi_index;
+ iface->flags = convertFlags(ifi->ifi_flags);
+
+ // read attributes
+ auto rta = reinterpret_cast<struct rtattr *>(ifi + 1);
+ len -= sizeof(*ifi);
+ for ( ; RTA_OK(rta, len); rta = RTA_NEXT(rta, len)) {
+ int payloadLen = RTA_PAYLOAD(rta);
+ auto payloadPtr = reinterpret_cast<char *>(RTA_DATA(rta));
+
+ switch (rta->rta_type) {
+ case IFLA_ADDRESS: // link-level address
+ iface->hardwareAddress =
+ iface->makeHwAddress(payloadLen, reinterpret_cast<uchar *>(payloadPtr));
+ break;
+
+ case IFLA_IFNAME: // interface name
+ Q_ASSERT(payloadLen <= int(sizeof(req.ifr_name)));
+ memcpy(req.ifr_name, payloadPtr, payloadLen); // including terminating NUL
+ iface->name = QString::fromLatin1(payloadPtr, payloadLen - 1);
+ break;
+
+ case IFLA_MTU:
+ Q_ASSERT(payloadLen == sizeof(int));
+ iface->mtu = *reinterpret_cast<int *>(payloadPtr);
+ break;
+
+ case IFLA_OPERSTATE: // operational state
+ if (*payloadPtr != IF_OPER_UNKNOWN) {
+ // override the flag
+ iface->flags &= ~QNetworkInterface::IsUp;
+ if (*payloadPtr == IF_OPER_UP)
+ iface->flags |= QNetworkInterface::IsUp;
+ }
+ break;
+ }
+ }
+
+ if (Q_UNLIKELY(iface->name.isEmpty())) {
+ qWarning("QNetworkInterface: found interface %d with no name", iface->index);
+ delete iface;
+ } else {
+ iface->type = probeIfType(sock, &req, ifi->ifi_type);
+ result.append(iface);
+ }
+ });
+ return result;
+}
+
+static void getAddresses(int sock, char *buf, QList<QNetworkInterfacePrivate *> &result)
+{
+ // request all addresses
+ struct {
+ struct nlmsghdr req;
+ struct ifaddrmsg ifa;
+ } ifa_req;
+ memset(&ifa_req, 0, sizeof(ifa_req));
+
+ ifa_req.req.nlmsg_len = sizeof(ifa_req);
+ ifa_req.req.nlmsg_flags = NLM_F_REQUEST | NLM_F_DUMP;
+ ifa_req.req.nlmsg_type = RTM_GETADDR;
+ ifa_req.req.nlmsg_seq = 1;
+
+ // parse the addresses
+ processNetlinkRequest(sock, &ifa_req.req, buf, BufferSize, [&](ifaddrmsg *ifa, size_t len) {
+ if (Q_UNLIKELY(ifa->ifa_family != AF_INET && ifa->ifa_family != AF_INET6)) {
+ // unknown address types
+ return;
+ }
+
+ // find the interface this is relevant to
+ QNetworkInterfacePrivate *iface = nullptr;
+ for (auto candidate : qAsConst(result)) {
+ if (candidate->index != int(ifa->ifa_index))
+ continue;
+ iface = candidate;
+ break;
+ }
+
+ if (Q_UNLIKELY(!iface)) {
+ qWarning("QNetworkInterface/AF_NETLINK: found unknown interface with index %d", ifa->ifa_index);
+ return;
+ }
+
+ QNetworkAddressEntry entry;
+ quint32 flags = ifa->ifa_flags; // may be overwritten by IFA_FLAGS
+
+ auto makeAddress = [=](uchar *ptr, int len) {
+ QHostAddress addr;
+ if (ifa->ifa_family == AF_INET) {
+ Q_ASSERT(len == 4);
+ addr.setAddress(qFromBigEndian<quint32>(ptr));
+ } else {
+ Q_ASSERT(len == 16);
+ addr.setAddress(ptr);
+
+ // do we need a scope ID?
+ if (addr.isLinkLocal())
+ addr.setScopeId(iface->name);
+ }
+ return addr;
+ };
+
+ // read attributes
+ auto rta = reinterpret_cast<struct rtattr *>(ifa + 1);
+ len -= sizeof(*ifa);
+ for ( ; RTA_OK(rta, len); rta = RTA_NEXT(rta, len)) {
+ int payloadLen = RTA_PAYLOAD(rta);
+ auto payloadPtr = reinterpret_cast<uchar *>(RTA_DATA(rta));
+
+ switch (rta->rta_type) {
+ case IFA_ADDRESS: // address
+ entry.setIp(makeAddress(payloadPtr, payloadLen));
+ break;
+
+ case IFA_BROADCAST:
+ Q_ASSERT(ifa->ifa_family == AF_INET);
+ entry.setBroadcast(makeAddress(payloadPtr, payloadLen));
+ break;
+
+ case IFA_CACHEINFO:
+ if (size_t(payloadLen) >= sizeof(ifa_cacheinfo)) {
+ auto cacheinfo = reinterpret_cast<ifa_cacheinfo *>(payloadPtr);
+ auto toDeadline = [](quint32 lifetime) -> QDeadlineTimer {
+ if (lifetime == quint32(-1))
+ return QDeadlineTimer::Forever;
+ return QDeadlineTimer(lifetime * 1000);
+ };
+ entry.setAddressLifetime(toDeadline(cacheinfo->ifa_prefered), toDeadline(cacheinfo->ifa_valid));
+ }
+ break;
+
+ case IFA_FLAGS:
+ Q_ASSERT(payloadLen == 4);
+ flags = qFromUnaligned<quint32>(payloadPtr);
+ break;
+ }
+ }
+
+ // now handle flags
+ QNetworkInterfacePrivate::calculateDnsEligibility(&entry,
+ flags & IFA_F_TEMPORARY,
+ flags & IFA_F_DEPRECATED);
+
+
+ if (!entry.ip().isNull()) {
+ entry.setPrefixLength(ifa->ifa_prefixlen);
+ iface->addressEntries.append(entry);
+ }
+ });
+}
+
+QList<QNetworkInterfacePrivate *> QNetworkInterfaceManager::scan()
+{
+ // open netlink socket
+ QList<QNetworkInterfacePrivate *> result;
+ NetlinkSocket sock(BufferSize);
+ if (Q_UNLIKELY(sock == -1))
+ return result;
+
+ QByteArray buffer(BufferSize, Qt::Uninitialized);
+ char *buf = buffer.data();
+
+ result = getInterfaces(sock, buf);
+ getAddresses(sock, buf, result);
+
+ return result;
+}
+
+QT_END_NAMESPACE
diff --git a/src/network/kernel/qnetworkinterface_p.h b/src/network/kernel/qnetworkinterface_p.h
index 51901eeda8..87a46b75fa 100644
--- a/src/network/kernel/qnetworkinterface_p.h
+++ b/src/network/kernel/qnetworkinterface_p.h
@@ -52,7 +52,9 @@
//
#include <QtNetwork/private/qtnetworkglobal_p.h>
+#include <QtNetwork/qnetworkinterface.h>
#include <QtCore/qatomic.h>
+#include <QtCore/qdeadlinetimer.h>
#include <QtCore/qlist.h>
#include <QtCore/qreadwritelock.h>
#include <QtCore/qstring.h>
@@ -69,7 +71,12 @@ class QNetworkAddressEntryPrivate
public:
QHostAddress address;
QHostAddress broadcast;
+ QDeadlineTimer preferredLifetime = QDeadlineTimer::Forever;
+ QDeadlineTimer validityLifetime = QDeadlineTimer::Forever;
+
QNetmask netmask;
+ bool lifetimeKnown = false;
+ QNetworkAddressEntry::DnsEligibilityStatus dnsEligibility = QNetworkAddressEntry::DnsEligibilityUnknown;
};
class QNetworkInterfacePrivate: public QSharedData
@@ -81,7 +88,9 @@ public:
{ }
int index; // interface index, if know
+ int mtu = 0;
QNetworkInterface::InterfaceFlags flags;
+ QNetworkInterface::InterfaceType type = QNetworkInterface::Unknown;
QString name;
QString friendlyName;
@@ -90,6 +99,20 @@ public:
QList<QNetworkAddressEntry> addressEntries;
static QString makeHwAddress(int len, uchar *data);
+ static void calculateDnsEligibility(QNetworkAddressEntry *entry, bool isTemporary,
+ bool isDeprecated)
+ {
+ // this implements an algorithm that yields the same results as Windows
+ // produces, for the same input (as far as I can test)
+ if (isTemporary || isDeprecated)
+ entry->setDnsEligibility(QNetworkAddressEntry::DnsIneligible);
+
+ AddressClassification cl = QHostAddressPrivate::classify(entry->ip());
+ if (cl == LoopbackAddress || cl == LinkLocalAddress)
+ entry->setDnsEligibility(QNetworkAddressEntry::DnsIneligible);
+ else
+ entry->setDnsEligibility(QNetworkAddressEntry::DnsEligible);
+ }
private:
// disallow copying -- avoid detaching
diff --git a/src/network/kernel/qnetworkinterface_uikit_p.h b/src/network/kernel/qnetworkinterface_uikit_p.h
new file mode 100644
index 0000000000..ea40e74f5c
--- /dev/null
+++ b/src/network/kernel/qnetworkinterface_uikit_p.h
@@ -0,0 +1,262 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtNetwork module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QNETWORKINTERFACE_UIKIT_P_H
+#define QNETWORKINTERFACE_UIKIT_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+// Platform SDK for iOS, tvOS and watchOS is missing those headers:
+// net/if_media.h, netinet/in_var.h, netinet6/in6_var.h This header is
+// a workaround, it provides missing macros and structs.
+
+// <net/if_media.h>:
+
+/*
+ * Ethernet
+ */
+#define IFM_ETHER 0x00000020
+/*
+ * FDDI
+ */
+#define IFM_FDDI 0x00000060
+/*
+ * IEEE 802.11 Wireless
+ */
+#define IFM_IEEE80211 0x00000080
+/*
+ * Masks
+ */
+#define IFM_NMASK 0x000000e0 /* Network type */
+/*
+ * Macros to extract various bits of information from the media word.
+ */
+#define IFM_TYPE(x) ((x) & IFM_NMASK)
+
+// <netinet6/in6_var.h>:
+
+struct in6_addrlifetime {
+ time_t ia6t_expire; /* valid lifetime expiration time */
+ time_t ia6t_preferred; /* preferred lifetime expiration time */
+ u_int32_t ia6t_vltime; /* valid lifetime */
+ u_int32_t ia6t_pltime; /* prefix lifetime */
+};
+
+/*
+ * IPv6 interface statistics, as defined in RFC2465 Ipv6IfStatsEntry (p12).
+ */
+struct in6_ifstat {
+ u_quad_t ifs6_in_receive; /* # of total input datagram */
+ u_quad_t ifs6_in_hdrerr; /* # of datagrams with invalid hdr */
+ u_quad_t ifs6_in_toobig; /* # of datagrams exceeded MTU */
+ u_quad_t ifs6_in_noroute; /* # of datagrams with no route */
+ u_quad_t ifs6_in_addrerr; /* # of datagrams with invalid dst */
+ u_quad_t ifs6_in_protounknown; /* # of datagrams with unknown proto */
+ /* NOTE: increment on final dst if */
+ u_quad_t ifs6_in_truncated; /* # of truncated datagrams */
+ u_quad_t ifs6_in_discard; /* # of discarded datagrams */
+ /* NOTE: fragment timeout is not here */
+ u_quad_t ifs6_in_deliver; /* # of datagrams delivered to ULP */
+ /* NOTE: increment on final dst if */
+ u_quad_t ifs6_out_forward; /* # of datagrams forwarded */
+ /* NOTE: increment on outgoing if */
+ u_quad_t ifs6_out_request; /* # of outgoing datagrams from ULP */
+ /* NOTE: does not include forwrads */
+ u_quad_t ifs6_out_discard; /* # of discarded datagrams */
+ u_quad_t ifs6_out_fragok; /* # of datagrams fragmented */
+ u_quad_t ifs6_out_fragfail; /* # of datagrams failed on fragment */
+ u_quad_t ifs6_out_fragcreat; /* # of fragment datagrams */
+ /* NOTE: this is # after fragment */
+ u_quad_t ifs6_reass_reqd; /* # of incoming fragmented packets */
+ /* NOTE: increment on final dst if */
+ u_quad_t ifs6_reass_ok; /* # of reassembled packets */
+ /* NOTE: this is # after reass */
+ /* NOTE: increment on final dst if */
+ u_quad_t ifs6_atmfrag_rcvd; /* # of atomic fragments received */
+ u_quad_t ifs6_reass_fail; /* # of reass failures */
+ /* NOTE: may not be packet count */
+ /* NOTE: increment on final dst if */
+ u_quad_t ifs6_in_mcast; /* # of inbound multicast datagrams */
+ u_quad_t ifs6_out_mcast; /* # of outbound multicast datagrams */
+
+ u_quad_t ifs6_cantfoward_icmp6; /* # of ICMPv6 packets received for unreachable dest */
+ u_quad_t ifs6_addr_expiry_cnt; /* # of address expiry events (excluding privacy addresses) */
+ u_quad_t ifs6_pfx_expiry_cnt; /* # of prefix expiry events */
+ u_quad_t ifs6_defrtr_expiry_cnt; /* # of default router expiry events */
+};
+
+/*
+ * ICMPv6 interface statistics, as defined in RFC2466 Ipv6IfIcmpEntry.
+ * XXX: I'm not sure if this file is the right place for this structure...
+ */
+struct icmp6_ifstat {
+ /*
+ * Input statistics
+ */
+ /* ipv6IfIcmpInMsgs, total # of input messages */
+ u_quad_t ifs6_in_msg;
+ /* ipv6IfIcmpInErrors, # of input error messages */
+ u_quad_t ifs6_in_error;
+ /* ipv6IfIcmpInDestUnreachs, # of input dest unreach errors */
+ u_quad_t ifs6_in_dstunreach;
+ /* ipv6IfIcmpInAdminProhibs, # of input admin. prohibited errs */
+ u_quad_t ifs6_in_adminprohib;
+ /* ipv6IfIcmpInTimeExcds, # of input time exceeded errors */
+ u_quad_t ifs6_in_timeexceed;
+ /* ipv6IfIcmpInParmProblems, # of input parameter problem errors */
+ u_quad_t ifs6_in_paramprob;
+ /* ipv6IfIcmpInPktTooBigs, # of input packet too big errors */
+ u_quad_t ifs6_in_pkttoobig;
+ /* ipv6IfIcmpInEchos, # of input echo requests */
+ u_quad_t ifs6_in_echo;
+ /* ipv6IfIcmpInEchoReplies, # of input echo replies */
+ u_quad_t ifs6_in_echoreply;
+ /* ipv6IfIcmpInRouterSolicits, # of input router solicitations */
+ u_quad_t ifs6_in_routersolicit;
+ /* ipv6IfIcmpInRouterAdvertisements, # of input router advertisements */
+ u_quad_t ifs6_in_routeradvert;
+ /* ipv6IfIcmpInNeighborSolicits, # of input neighbor solicitations */
+ u_quad_t ifs6_in_neighborsolicit;
+ /* ipv6IfIcmpInNeighborAdvertisements, # of input neighbor advs. */
+ u_quad_t ifs6_in_neighboradvert;
+ /* ipv6IfIcmpInRedirects, # of input redirects */
+ u_quad_t ifs6_in_redirect;
+ /* ipv6IfIcmpInGroupMembQueries, # of input MLD queries */
+ u_quad_t ifs6_in_mldquery;
+ /* ipv6IfIcmpInGroupMembResponses, # of input MLD reports */
+ u_quad_t ifs6_in_mldreport;
+ /* ipv6IfIcmpInGroupMembReductions, # of input MLD done */
+ u_quad_t ifs6_in_mlddone;
+
+ /*
+ * Output statistics. We should solve unresolved routing problem...
+ */
+ /* ipv6IfIcmpOutMsgs, total # of output messages */
+ u_quad_t ifs6_out_msg;
+ /* ipv6IfIcmpOutErrors, # of output error messages */
+ u_quad_t ifs6_out_error;
+ /* ipv6IfIcmpOutDestUnreachs, # of output dest unreach errors */
+ u_quad_t ifs6_out_dstunreach;
+ /* ipv6IfIcmpOutAdminProhibs, # of output admin. prohibited errs */
+ u_quad_t ifs6_out_adminprohib;
+ /* ipv6IfIcmpOutTimeExcds, # of output time exceeded errors */
+ u_quad_t ifs6_out_timeexceed;
+ /* ipv6IfIcmpOutParmProblems, # of output parameter problem errors */
+ u_quad_t ifs6_out_paramprob;
+ /* ipv6IfIcmpOutPktTooBigs, # of output packet too big errors */
+ u_quad_t ifs6_out_pkttoobig;
+ /* ipv6IfIcmpOutEchos, # of output echo requests */
+ u_quad_t ifs6_out_echo;
+ /* ipv6IfIcmpOutEchoReplies, # of output echo replies */
+ u_quad_t ifs6_out_echoreply;
+ /* ipv6IfIcmpOutRouterSolicits, # of output router solicitations */
+ u_quad_t ifs6_out_routersolicit;
+ /* ipv6IfIcmpOutRouterAdvertisements, # of output router advs. */
+ u_quad_t ifs6_out_routeradvert;
+ /* ipv6IfIcmpOutNeighborSolicits, # of output neighbor solicitations */
+ u_quad_t ifs6_out_neighborsolicit;
+ /* ipv6IfIcmpOutNeighborAdvertisements, # of output neighbor advs. */
+ u_quad_t ifs6_out_neighboradvert;
+ /* ipv6IfIcmpOutRedirects, # of output redirects */
+ u_quad_t ifs6_out_redirect;
+ /* ipv6IfIcmpOutGroupMembQueries, # of output MLD queries */
+ u_quad_t ifs6_out_mldquery;
+ /* ipv6IfIcmpOutGroupMembResponses, # of output MLD reports */
+ u_quad_t ifs6_out_mldreport;
+ /* ipv6IfIcmpOutGroupMembReductions, # of output MLD done */
+ u_quad_t ifs6_out_mlddone;
+};
+
+#define SCOPE6_ID_MAX 16
+
+struct in6_ifreq {
+ char ifr_name[IFNAMSIZ];
+ union {
+ struct sockaddr_in6 ifru_addr;
+ struct sockaddr_in6 ifru_dstaddr;
+ int ifru_flags;
+ int ifru_flags6;
+ int ifru_metric;
+ int ifru_intval;
+ caddr_t ifru_data;
+ struct in6_addrlifetime ifru_lifetime;
+ struct in6_ifstat ifru_stat;
+ struct icmp6_ifstat ifru_icmp6stat;
+ u_int32_t ifru_scope_id[SCOPE6_ID_MAX];
+ } ifr_ifru;
+};
+
+#define IN6_IFF_TEMPORARY 0x0080 /* temporary (anonymous) address. */
+#define IN6_IFF_DEPRECATED 0x0010 /* deprecated address */
+
+#define SIOCGIFAFLAG_IN6 _IOWR('i', 73, struct in6_ifreq)
+#define SIOCGIFALIFETIME_IN6 _IOWR('i', 81, struct in6_ifreq)
+
+// The definition below is ONLY a temporary workaround to unblock
+// integrations on CI. MUST be removed ASAP, as soon as SDK is
+// updated. Currently, we have WatchOS SDK 3.2 and it's missing
+// net/if_types.h (unlike SDK 4.0, which has it). Alas, we have to
+// work this around. We only define constants that we use in code.
+
+#if !QT_DARWIN_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_NA, __IPHONE_NA, __TVOS_NA, __WATCHOS_4_0)
+
+#define QT_WATCHOS_OUTDATED_SDK_WORKAROUND
+
+#define IFT_PPP 0x17 /* RFC 1331 */
+#define IFT_LOOP 0x18 /* loopback */
+#define IFT_SLIP 0x1c /* IP over generic TTY */
+
+#define IFT_GIF 0x37 /*0xf0*/
+#define IFT_STF 0x39 /*0xf3*/
+
+#define IFT_IEEE1394 0x90 /* IEEE1394 High Performance SerialBus*/
+
+#endif // WatchOS SDK below 4.0
+
+#endif // QNETWORKINTERFACE_UIKIT_P_H
+
diff --git a/src/network/kernel/qnetworkinterface_unix.cpp b/src/network/kernel/qnetworkinterface_unix.cpp
index afa6b4296e..30bb37319b 100644
--- a/src/network/kernel/qnetworkinterface_unix.cpp
+++ b/src/network/kernel/qnetworkinterface_unix.cpp
@@ -41,30 +41,19 @@
#include "qset.h"
#include "qnetworkinterface.h"
#include "qnetworkinterface_p.h"
+#include "qnetworkinterface_unix_p.h"
#include "qalgorithms.h"
-#include "private/qnet_unix_p.h"
#ifndef QT_NO_NETWORKINTERFACE
-#define IP_MULTICAST // make AIX happy and define IFF_MULTICAST
-
-#include <sys/types.h>
-#include <sys/socket.h>
-
-#ifdef Q_OS_SOLARIS
-# include <sys/sockio.h>
+#if defined(QT_NO_CLOCK_MONOTONIC)
+# include "qdatetime.h"
#endif
-#include <net/if.h>
#if defined(QT_LINUXBASE)
# define QT_NO_GETIFADDRS
#endif
-#ifdef Q_OS_HAIKU
-# include <sys/sockio.h>
-# define IFF_RUNNING 0x0001
-#endif
-
#ifndef QT_NO_GETIFADDRS
# include <ifaddrs.h>
#endif
@@ -103,23 +92,6 @@ static QHostAddress addressFromSockaddr(sockaddr *sa, int ifindex = 0, const QSt
}
-static QNetworkInterface::InterfaceFlags convertFlags(uint rawFlags)
-{
- QNetworkInterface::InterfaceFlags flags = 0;
- flags |= (rawFlags & IFF_UP) ? QNetworkInterface::IsUp : QNetworkInterface::InterfaceFlag(0);
- flags |= (rawFlags & IFF_RUNNING) ? QNetworkInterface::IsRunning : QNetworkInterface::InterfaceFlag(0);
- flags |= (rawFlags & IFF_BROADCAST) ? QNetworkInterface::CanBroadcast : QNetworkInterface::InterfaceFlag(0);
- flags |= (rawFlags & IFF_LOOPBACK) ? QNetworkInterface::IsLoopBack : QNetworkInterface::InterfaceFlag(0);
-#ifdef IFF_POINTOPOINT //cygwin doesn't define IFF_POINTOPOINT
- flags |= (rawFlags & IFF_POINTOPOINT) ? QNetworkInterface::IsPointToPoint : QNetworkInterface::InterfaceFlag(0);
-#endif
-
-#ifdef IFF_MULTICAST
- flags |= (rawFlags & IFF_MULTICAST) ? QNetworkInterface::CanMulticast : QNetworkInterface::InterfaceFlag(0);
-#endif
- return flags;
-}
-
uint QNetworkInterfaceManager::interfaceIndexFromName(const QString &name)
{
#ifndef QT_NO_IPV6IFNAME
@@ -167,6 +139,15 @@ QString QNetworkInterfaceManager::interfaceNameFromIndex(uint index)
return QString::number(uint(index));
}
+static int getMtu(int socket, struct ifreq *req)
+{
+#ifdef SIOCGIFMTU
+ if (qt_safe_ioctl(socket, SIOCGIFMTU, req) == 0)
+ return req->ifr_mtu;
+#endif
+ return 0;
+}
+
#ifdef QT_NO_GETIFADDRS
// getifaddrs not available
@@ -306,6 +287,7 @@ static QList<QNetworkInterfacePrivate *> interfaceListing()
if (qt_safe_ioctl(socket, SIOCGIFFLAGS, &req) >= 0) {
iface->flags = convertFlags(req.ifr_flags);
}
+ iface->mtu = getMtu(socket, &req);
#ifdef SIOCGIFHWADDR
// Get the HW address
@@ -413,14 +395,96 @@ static QList<QNetworkInterfacePrivate *> createInterfaces(ifaddrs *rawList)
return interfaces;
}
+static void getAddressExtraInfo(QNetworkAddressEntry *entry, struct sockaddr *sa, const char *ifname)
+{
+ Q_UNUSED(entry);
+ Q_UNUSED(sa);
+ Q_UNUSED(ifname)
+}
+
# elif defined(Q_OS_BSD4)
QT_BEGIN_INCLUDE_NAMESPACE
# include <net/if_dl.h>
+#if defined(QT_PLATFORM_UIKIT)
+# include "qnetworkinterface_uikit_p.h"
+#if !defined(QT_WATCHOS_OUTDATED_SDK_WORKAROUND)
+// TODO: remove it as soon as SDK is updated on CI!!!
+# include <net/if_types.h>
+#endif
+#else
+# include <net/if_media.h>
+# include <net/if_types.h>
+# include <netinet/in_var.h>
+#endif // QT_PLATFORM_UIKIT
QT_END_INCLUDE_NAMESPACE
+static int openSocket(int &socket)
+{
+ if (socket == -1)
+ socket = qt_safe_socket(AF_INET, SOCK_DGRAM, 0);
+ return socket;
+}
+
+static QNetworkInterface::InterfaceType probeIfType(int socket, int iftype, struct ifmediareq *req)
+{
+ // Determine the interface type.
+
+ // On Darwin, these are #defines, but on FreeBSD they're just an
+ // enum, so we can't #ifdef them. Use the authoritative list from
+ // https://www.iana.org/assignments/smi-numbers/smi-numbers.xhtml#smi-numbers-5
+ switch (iftype) {
+ case IFT_PPP:
+ return QNetworkInterface::Ppp;
+
+ case IFT_LOOP:
+ return QNetworkInterface::Loopback;
+
+ case IFT_SLIP:
+ return QNetworkInterface::Slip;
+
+ case 0x47: // IFT_IEEE80211
+ return QNetworkInterface::Ieee80211;
+
+ case IFT_IEEE1394:
+ return QNetworkInterface::Ieee1394;
+
+ case IFT_GIF:
+ case IFT_STF:
+ return QNetworkInterface::Virtual;
+ }
+
+ // For the remainder (including Ethernet), let's try SIOGIFMEDIA
+ req->ifm_count = 0;
+ if (qt_safe_ioctl(socket, SIOCGIFMEDIA, req) == 0) {
+ // see https://man.openbsd.org/ifmedia.4
+
+ switch (IFM_TYPE(req->ifm_current)) {
+ case IFM_ETHER:
+ return QNetworkInterface::Ethernet;
+
+ case IFM_FDDI:
+ return QNetworkInterface::Fddi;
+
+ case IFM_IEEE80211:
+ return QNetworkInterface::Ieee80211;
+ }
+ }
+
+ return QNetworkInterface::Unknown;
+}
+
static QList<QNetworkInterfacePrivate *> createInterfaces(ifaddrs *rawList)
{
QList<QNetworkInterfacePrivate *> interfaces;
+ union {
+ struct ifmediareq mediareq;
+ struct ifreq req;
+ };
+ int socket = -1;
+
+ // ensure both structs start with the name field, of size IFNAMESIZ
+ Q_STATIC_ASSERT(sizeof(mediareq.ifm_name) == sizeof(req.ifr_name));
+ Q_ASSERT(&mediareq.ifm_name == &req.ifr_name);
// on NetBSD we use AF_LINK and sockaddr_dl
// scan the list for that family
@@ -434,11 +498,68 @@ static QList<QNetworkInterfacePrivate *> createInterfaces(ifaddrs *rawList)
iface->name = QString::fromLatin1(ptr->ifa_name);
iface->flags = convertFlags(ptr->ifa_flags);
iface->hardwareAddress = iface->makeHwAddress(sdl->sdl_alen, (uchar*)LLADDR(sdl));
+
+ strlcpy(mediareq.ifm_name, ptr->ifa_name, sizeof(mediareq.ifm_name));
+ iface->type = probeIfType(openSocket(socket), sdl->sdl_type, &mediareq);
+ iface->mtu = getMtu(socket, &req);
}
+ if (socket != -1)
+ qt_safe_close(socket);
return interfaces;
}
+static void getAddressExtraInfo(QNetworkAddressEntry *entry, struct sockaddr *sa, const char *ifname)
+{
+ // get IPv6 address lifetimes
+ if (sa->sa_family != AF_INET6)
+ return;
+
+ struct in6_ifreq ifr;
+
+ int s6 = qt_safe_socket(AF_INET6, SOCK_DGRAM, 0);
+ if (Q_UNLIKELY(s6 < 0)) {
+ qErrnoWarning("QNetworkInterface: could not create IPv6 socket");
+ return;
+ }
+
+ strlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
+
+ // get flags
+ ifr.ifr_addr = *reinterpret_cast<struct sockaddr_in6 *>(sa);
+ if (qt_safe_ioctl(s6, SIOCGIFAFLAG_IN6, &ifr) < 0) {
+ qt_safe_close(s6);
+ return;
+ }
+ int flags = ifr.ifr_ifru.ifru_flags6;
+ QNetworkInterfacePrivate::calculateDnsEligibility(entry,
+ flags & IN6_IFF_TEMPORARY,
+ flags & IN6_IFF_DEPRECATED);
+
+ // get lifetimes
+ ifr.ifr_addr = *reinterpret_cast<struct sockaddr_in6 *>(sa);
+ if (qt_safe_ioctl(s6, SIOCGIFALIFETIME_IN6, &ifr) < 0) {
+ qt_safe_close(s6);
+ return;
+ }
+ qt_safe_close(s6);
+
+ auto toDeadline = [](time_t when) {
+ QDeadlineTimer deadline = QDeadlineTimer::Forever;
+ if (when) {
+#if defined(QT_NO_CLOCK_MONOTONIC)
+ // no monotonic clock
+ deadline.setPreciseRemainingTime(when - QDateTime::currentSecsSinceEpoch());
+#else
+ deadline.setPreciseDeadline(when);
+#endif
+ }
+ return deadline;
+ };
+ entry->setAddressLifetime(toDeadline(ifr.ifr_ifru.ifru_lifetime.ia6t_preferred),
+ toDeadline(ifr.ifr_ifru.ifru_lifetime.ia6t_expire));
+}
+
# else // Generic version
static QList<QNetworkInterfacePrivate *> createInterfaces(ifaddrs *rawList)
@@ -470,9 +591,14 @@ static QList<QNetworkInterfacePrivate *> createInterfaces(ifaddrs *rawList)
return interfaces;
}
+static void getAddressExtraInfo(QNetworkAddressEntry *entry, struct sockaddr *sa, const char *ifname)
+{
+ Q_UNUSED(entry);
+ Q_UNUSED(sa);
+ Q_UNUSED(ifname)
+}
# endif
-
static QList<QNetworkInterfacePrivate *> interfaceListing()
{
QList<QNetworkInterfacePrivate *> interfaces;
@@ -521,6 +647,7 @@ static QList<QNetworkInterfacePrivate *> interfaceListing()
entry.setNetmask(addressFromSockaddr(ptr->ifa_netmask, iface->index, iface->name));
if (iface->flags & QNetworkInterface::CanBroadcast)
entry.setBroadcast(addressFromSockaddr(ptr->ifa_broadaddr, iface->index, iface->name));
+ getAddressExtraInfo(&entry, ptr->ifa_addr, name.latin1());
iface->addressEntries << entry;
}
diff --git a/src/network/kernel/qnetworkinterface_unix_p.h b/src/network/kernel/qnetworkinterface_unix_p.h
new file mode 100644
index 0000000000..c085194e3c
--- /dev/null
+++ b/src/network/kernel/qnetworkinterface_unix_p.h
@@ -0,0 +1,102 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Copyright (C) 2017 Intel Corporation.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtNetwork module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QNETWORKINTERFACE_UNIX_P_H
+#define QNETWORKINTERFACE_UNIX_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qnetworkinterface_p.h"
+#include "private/qnet_unix_p.h"
+
+#ifndef QT_NO_NETWORKINTERFACE
+
+#define IP_MULTICAST // make AIX happy and define IFF_MULTICAST
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#ifdef Q_OS_SOLARIS
+# include <sys/sockio.h>
+#endif
+#ifdef Q_OS_HAIKU
+# include <sys/sockio.h>
+# define IFF_RUNNING 0x0001
+#endif
+#if QT_CONFIG(linux_netlink)
+// Same as net/if.h but contains other things we need in
+// qnetworkinterface_linux.cpp.
+# include <linux/if.h>
+#else
+# include <net/if.h>
+#endif
+
+QT_BEGIN_NAMESPACE
+
+static QNetworkInterface::InterfaceFlags convertFlags(uint rawFlags)
+{
+ QNetworkInterface::InterfaceFlags flags = 0;
+ flags |= (rawFlags & IFF_UP) ? QNetworkInterface::IsUp : QNetworkInterface::InterfaceFlag(0);
+ flags |= (rawFlags & IFF_RUNNING) ? QNetworkInterface::IsRunning : QNetworkInterface::InterfaceFlag(0);
+ flags |= (rawFlags & IFF_BROADCAST) ? QNetworkInterface::CanBroadcast : QNetworkInterface::InterfaceFlag(0);
+ flags |= (rawFlags & IFF_LOOPBACK) ? QNetworkInterface::IsLoopBack : QNetworkInterface::InterfaceFlag(0);
+#ifdef IFF_POINTOPOINT //cygwin doesn't define IFF_POINTOPOINT
+ flags |= (rawFlags & IFF_POINTOPOINT) ? QNetworkInterface::IsPointToPoint : QNetworkInterface::InterfaceFlag(0);
+#endif
+
+#ifdef IFF_MULTICAST
+ flags |= (rawFlags & IFF_MULTICAST) ? QNetworkInterface::CanMulticast : QNetworkInterface::InterfaceFlag(0);
+#endif
+ return flags;
+}
+
+QT_END_NAMESPACE
+
+#endif // QT_NO_NETWORKINTERFACE
+
+#endif // QNETWORKINTERFACE_UNIX_P_H
diff --git a/src/network/kernel/qnetworkinterface_win.cpp b/src/network/kernel/qnetworkinterface_win.cpp
index 64c3fa6f83..150553f673 100644
--- a/src/network/kernel/qnetworkinterface_win.cpp
+++ b/src/network/kernel/qnetworkinterface_win.cpp
@@ -62,6 +62,10 @@
#include <qt_windows.h>
+// In case these aren't defined
+#define IF_TYPE_IEEE80216_WMAN 237
+#define IF_TYPE_IEEE802154 259
+
QT_BEGIN_NAMESPACE
static QHostAddress addressFromSockaddr(sockaddr *sa)
@@ -147,6 +151,7 @@ static QList<QNetworkInterfacePrivate *> interfaceListing()
else if (ptr->IfIndex != 0)
iface->index = ptr->IfIndex;
+ iface->mtu = qMin<qint64>(ptr->Mtu, INT_MAX);
iface->flags = QNetworkInterface::CanBroadcast;
if (ptr->OperStatus == IfOperStatusUp)
iface->flags |= QNetworkInterface::IsUp | QNetworkInterface::IsRunning;
@@ -155,6 +160,45 @@ static QList<QNetworkInterfacePrivate *> interfaceListing()
if (ptr->IfType == IF_TYPE_PPP)
iface->flags |= QNetworkInterface::IsPointToPoint;
+ switch (ptr->IfType) {
+ case IF_TYPE_ETHERNET_CSMACD:
+ iface->type = QNetworkInterface::Ethernet;
+ break;
+
+ case IF_TYPE_FDDI:
+ iface->type = QNetworkInterface::Fddi;
+ break;
+
+ case IF_TYPE_PPP:
+ iface->type = QNetworkInterface::Ppp;
+ break;
+
+ case IF_TYPE_SLIP:
+ iface->type = QNetworkInterface::Slip;
+ break;
+
+ case IF_TYPE_SOFTWARE_LOOPBACK:
+ iface->type = QNetworkInterface::Loopback;
+ iface->flags |= QNetworkInterface::IsLoopBack;
+ break;
+
+ case IF_TYPE_IEEE80211:
+ iface->type = QNetworkInterface::Ieee80211;
+ break;
+
+ case IF_TYPE_IEEE1394:
+ iface->type = QNetworkInterface::Ieee1394;
+ break;
+
+ case IF_TYPE_IEEE80216_WMAN:
+ iface->type = QNetworkInterface::Ieee80216;
+ break;
+
+ case IF_TYPE_IEEE802154:
+ iface->type = QNetworkInterface::Ieee802154;
+ break;
+ }
+
// use ConvertInterfaceLuidToNameW because that returns a friendlier name, though not
// as "friendly" as FriendlyName below
WCHAR buf[IF_MAX_STRING_SIZE + 1];
@@ -167,9 +211,6 @@ static QList<QNetworkInterfacePrivate *> interfaceListing()
if (ptr->PhysicalAddressLength)
iface->hardwareAddress = iface->makeHwAddress(ptr->PhysicalAddressLength,
ptr->PhysicalAddress);
- else
- // loopback if it has no address
- iface->flags |= QNetworkInterface::IsLoopBack;
// parse the IP (unicast) addresses
for (PIP_ADAPTER_UNICAST_ADDRESS addr = ptr->FirstUnicastAddress; addr; addr = addr->Next) {
@@ -182,6 +223,17 @@ static QList<QNetworkInterfacePrivate *> interfaceListing()
QNetworkAddressEntry entry;
entry.setIp(addressFromSockaddr(addr->Address.lpSockaddr));
entry.setPrefixLength(addr->OnLinkPrefixLength);
+
+ auto toDeadline = [](ULONG lifetime) -> QDeadlineTimer {
+ if (lifetime == 0xffffffffUL)
+ return QDeadlineTimer::Forever;
+ return QDeadlineTimer(lifetime * 1000);
+ };
+ entry.setAddressLifetime(toDeadline(addr->ValidLifetime), toDeadline(addr->PreferredLifetime));
+ entry.setDnsEligibility(addr->Flags & IP_ADAPTER_ADDRESS_DNS_ELIGIBLE ?
+ QNetworkAddressEntry::DnsEligible :
+ QNetworkAddressEntry::DnsIneligible);
+
iface->addressEntries << entry;
}
}
diff --git a/src/network/kernel/qnetworkproxy.cpp b/src/network/kernel/qnetworkproxy.cpp
index 6b53b4b58e..3646a9526a 100644
--- a/src/network/kernel/qnetworkproxy.cpp
+++ b/src/network/kernel/qnetworkproxy.cpp
@@ -230,7 +230,11 @@
#if QT_CONFIG(socks5)
#include "private/qsocks5socketengine_p.h"
#endif
+
+#if QT_CONFIG(http)
#include "private/qhttpsocketengine_p.h"
+#endif
+
#include "qauthenticator.h"
#include "qdebug.h"
#include "qmutex.h"
@@ -256,7 +260,7 @@ public:
#if QT_CONFIG(socks5)
, socks5SocketEngineHandler(0)
#endif
-#ifndef QT_NO_HTTP
+#if QT_CONFIG(http)
, httpSocketEngineHandler(0)
#endif
#ifdef QT_USE_SYSTEM_PROXIES
@@ -268,7 +272,7 @@ public:
#if QT_CONFIG(socks5)
socks5SocketEngineHandler = new QSocks5SocketEngineHandler();
#endif
-#ifndef QT_NO_HTTP
+#if QT_CONFIG(http)
httpSocketEngineHandler = new QHttpSocketEngineHandler();
#endif
}
@@ -280,7 +284,7 @@ public:
#if QT_CONFIG(socks5)
delete socks5SocketEngineHandler;
#endif
-#ifndef QT_NO_HTTP
+#if QT_CONFIG(http)
delete httpSocketEngineHandler;
#endif
}
@@ -340,7 +344,7 @@ private:
#if QT_CONFIG(socks5)
QSocks5SocketEngineHandler *socks5SocketEngineHandler;
#endif
-#ifndef QT_NO_HTTP
+#if QT_CONFIG(http)
QHttpSocketEngineHandler *httpSocketEngineHandler;
#endif
bool useSystemProxies;
diff --git a/src/network/network.pro b/src/network/network.pro
index 98fbf82275..b8272d91d6 100644
--- a/src/network/network.pro
+++ b/src/network/network.pro
@@ -24,8 +24,6 @@ QMAKE_LIBS += $$QMAKE_LIBS_NETWORK
qtConfig(bearermanagement) {
ANDROID_BUNDLED_JAR_DEPENDENCIES = \
- jar/QtAndroidBearer-bundled.jar
- ANDROID_JAR_DEPENDENCIES = \
jar/QtAndroidBearer.jar
ANDROID_LIB_DEPENDENCIES = \
plugins/bearer/libqandroidbearer.so
diff --git a/src/network/socket/qabstractsocket.cpp b/src/network/socket/qabstractsocket.cpp
index 7284b124c5..98baa0c047 100644
--- a/src/network/socket/qabstractsocket.cpp
+++ b/src/network/socket/qabstractsocket.cpp
@@ -387,6 +387,11 @@
(see \l{QAbstractSocket::}{setReadBufferSize()}).
This enum value has been introduced in Qt 5.3.
+ \value PathMtuSocketOption Retrieves the Path Maximum Transmission Unit
+ (PMTU) value currently known by the IP stack, if any. Some IP stacks also
+ allow setting the MTU for transmission.
+ This enum value was introduced in Qt 5.11.
+
Possible values for \e{TypeOfServiceOption} are:
\table
@@ -1354,15 +1359,29 @@ void QAbstractSocketPrivate::fetchConnectionParameters()
}
state = QAbstractSocket::ConnectedState;
- emit q->stateChanged(state);
- emit q->connected();
-
#if defined(QABSTRACTSOCKET_DEBUG)
qDebug("QAbstractSocketPrivate::fetchConnectionParameters() connection to %s:%i established",
host.toString().toLatin1().constData(), port);
#endif
+ emit q->stateChanged(state);
+ emit q->connected();
}
+/*! \internal
+*/
+qint64 QAbstractSocketPrivate::skip(qint64 maxSize)
+{
+ // if we're not connected, return -1 indicating EOF
+ if (!socketEngine || !socketEngine->isValid() || state != QAbstractSocket::ConnectedState)
+ return -1;
+
+ // Caller, QIODevice::skip(), has ensured buffer is empty. So, wait
+ // for more data in buffered mode.
+ if (isBuffered)
+ return 0;
+
+ return QIODevicePrivate::skip(maxSize);
+}
void QAbstractSocketPrivate::pauseSocketNotifiers(QAbstractSocket *socket)
{
@@ -2009,6 +2028,10 @@ void QAbstractSocket::setSocketOption(QAbstractSocket::SocketOption option, cons
case ReceiveBufferSizeSocketOption:
d_func()->socketEngine->setOption(QAbstractSocketEngine::ReceiveBufferSocketOption, value.toInt());
break;
+
+ case PathMtuSocketOption:
+ d_func()->socketEngine->setOption(QAbstractSocketEngine::PathMtuInformation, value.toInt());
+ break;
}
}
@@ -2051,6 +2074,10 @@ QVariant QAbstractSocket::socketOption(QAbstractSocket::SocketOption option)
case ReceiveBufferSizeSocketOption:
ret = d_func()->socketEngine->option(QAbstractSocketEngine::ReceiveBufferSocketOption);
break;
+
+ case PathMtuSocketOption:
+ ret = d_func()->socketEngine->option(QAbstractSocketEngine::PathMtuInformation);
+ break;
}
if (ret == -1)
return QVariant();
diff --git a/src/network/socket/qabstractsocket.h b/src/network/socket/qabstractsocket.h
index 875609aa28..6d5e57ac52 100644
--- a/src/network/socket/qabstractsocket.h
+++ b/src/network/socket/qabstractsocket.h
@@ -120,7 +120,8 @@ public:
MulticastLoopbackOption, // IP_MULTICAST_LOOPBACK
TypeOfServiceOption, //IP_TOS
SendBufferSizeSocketOption, //SO_SNDBUF
- ReceiveBufferSizeSocketOption //SO_RCVBUF
+ ReceiveBufferSizeSocketOption, //SO_RCVBUF
+ PathMtuSocketOption // IP_MTU
};
Q_ENUM(SocketOption)
enum BindFlag {
@@ -154,10 +155,10 @@ public:
bool isValid() const;
- qint64 bytesAvailable() const Q_DECL_OVERRIDE;
- qint64 bytesToWrite() const Q_DECL_OVERRIDE;
+ qint64 bytesAvailable() const override;
+ qint64 bytesToWrite() const override;
- bool canReadLine() const Q_DECL_OVERRIDE; // ### Qt6: remove me
+ bool canReadLine() const override; // ### Qt6: remove me
quint16 localPort() const;
QHostAddress localAddress() const;
@@ -182,15 +183,15 @@ public:
SocketError error() const;
// from QIODevice
- void close() Q_DECL_OVERRIDE;
- bool isSequential() const Q_DECL_OVERRIDE;
- bool atEnd() const Q_DECL_OVERRIDE; // ### Qt6: remove me
+ void close() override;
+ bool isSequential() const override;
+ bool atEnd() const override; // ### Qt6: remove me
bool flush();
// for synchronous access
virtual bool waitForConnected(int msecs = 30000);
- bool waitForReadyRead(int msecs = 30000) Q_DECL_OVERRIDE;
- bool waitForBytesWritten(int msecs = 30000) Q_DECL_OVERRIDE;
+ bool waitForReadyRead(int msecs = 30000) override;
+ bool waitForBytesWritten(int msecs = 30000) override;
virtual bool waitForDisconnected(int msecs = 30000);
#ifndef QT_NO_NETWORKPROXY
@@ -209,9 +210,9 @@ Q_SIGNALS:
#endif
protected:
- qint64 readData(char *data, qint64 maxlen) Q_DECL_OVERRIDE;
- qint64 readLineData(char *data, qint64 maxlen) Q_DECL_OVERRIDE;
- qint64 writeData(const char *data, qint64 len) Q_DECL_OVERRIDE;
+ qint64 readData(char *data, qint64 maxlen) override;
+ qint64 readLineData(char *data, qint64 maxlen) override;
+ qint64 writeData(const char *data, qint64 len) override;
void setSocketState(SocketState state);
void setSocketError(SocketError socketError);
@@ -221,7 +222,7 @@ protected:
void setPeerAddress(const QHostAddress &address);
void setPeerName(const QString &name);
- QAbstractSocket(SocketType socketType, QAbstractSocketPrivate &dd, QObject *parent = Q_NULLPTR);
+ QAbstractSocket(SocketType socketType, QAbstractSocketPrivate &dd, QObject *parent = nullptr);
private:
Q_DECLARE_PRIVATE(QAbstractSocket)
diff --git a/src/network/socket/qabstractsocket_p.h b/src/network/socket/qabstractsocket_p.h
index 5411133ea9..3d788319a8 100644
--- a/src/network/socket/qabstractsocket_p.h
+++ b/src/network/socket/qabstractsocket_p.h
@@ -71,6 +71,9 @@ public:
QAbstractSocketPrivate();
virtual ~QAbstractSocketPrivate();
+ // from QIODevicePrivate
+ qint64 skip(qint64 maxSize) override;
+
// from QAbstractSocketEngineReceiver
inline void readNotification() override { canReadNotification(); }
inline void writeNotification() override { canWriteNotification(); }
diff --git a/src/network/socket/qabstractsocketengine_p.h b/src/network/socket/qabstractsocketengine_p.h
index 0cb519ce90..b15dd73c96 100644
--- a/src/network/socket/qabstractsocketengine_p.h
+++ b/src/network/socket/qabstractsocketengine_p.h
@@ -105,7 +105,8 @@ public:
TypeOfServiceOption,
ReceivePacketInformation,
ReceiveHopLimit,
- MaxStreamsSocketOption
+ MaxStreamsSocketOption,
+ PathMtuInformation
};
enum PacketHeaderOption {
diff --git a/src/network/socket/qhttpsocketengine.cpp b/src/network/socket/qhttpsocketengine.cpp
index 899c02fba6..b543ea7981 100644
--- a/src/network/socket/qhttpsocketengine.cpp
+++ b/src/network/socket/qhttpsocketengine.cpp
@@ -46,7 +46,7 @@
#include "qelapsedtimer.h"
#include "qnetworkinterface.h"
-#if !defined(QT_NO_NETWORKPROXY) && !defined(QT_NO_HTTP)
+#if !defined(QT_NO_NETWORKPROXY)
#include <qdebug.h>
QT_BEGIN_NAMESPACE
@@ -572,18 +572,13 @@ void QHttpSocketEngine::slotSocketReadNotification()
}
if (d->state == ReadResponseContent) {
- char dummybuffer[4096];
- while (d->pendingResponseData) {
- int read = d->socket->read(dummybuffer, qMin(sizeof(dummybuffer), (size_t)d->pendingResponseData));
- if (read == 0)
- return;
- if (read == -1) {
- d->socket->disconnectFromHost();
- emitWriteNotification();
- return;
- }
- d->pendingResponseData -= read;
+ qint64 skipped = d->socket->skip(d->pendingResponseData);
+ if (skipped == -1) {
+ d->socket->disconnectFromHost();
+ emitWriteNotification();
+ return;
}
+ d->pendingResponseData -= uint(skipped);
if (d->pendingResponseData > 0)
return;
if (d->reply->d_func()->statusCode == 407)
@@ -871,4 +866,4 @@ QAbstractSocketEngine *QHttpSocketEngineHandler::createSocketEngine(qintptr, QOb
QT_END_NAMESPACE
-#endif
+#endif // !QT_NO_NETWORKPROXY
diff --git a/src/network/socket/qhttpsocketengine_p.h b/src/network/socket/qhttpsocketengine_p.h
index 07815a7e51..cb7798694a 100644
--- a/src/network/socket/qhttpsocketengine_p.h
+++ b/src/network/socket/qhttpsocketengine_p.h
@@ -57,9 +57,11 @@
#include "qnetworkproxy.h"
#include "private/qauthenticator_p.h"
+QT_REQUIRE_CONFIG(http);
+
QT_BEGIN_NAMESPACE
-#if !defined(QT_NO_NETWORKPROXY) && !defined(QT_NO_HTTP)
+#if !defined(QT_NO_NETWORKPROXY)
class QTcpSocket;
class QHttpNetworkReply;
@@ -80,62 +82,62 @@ public:
QHttpSocketEngine(QObject *parent = 0);
~QHttpSocketEngine();
- bool initialize(QAbstractSocket::SocketType type, QAbstractSocket::NetworkLayerProtocol protocol = QAbstractSocket::IPv4Protocol) Q_DECL_OVERRIDE;
- bool initialize(qintptr socketDescriptor, QAbstractSocket::SocketState socketState = QAbstractSocket::ConnectedState) Q_DECL_OVERRIDE;
+ bool initialize(QAbstractSocket::SocketType type, QAbstractSocket::NetworkLayerProtocol protocol = QAbstractSocket::IPv4Protocol) override;
+ bool initialize(qintptr socketDescriptor, QAbstractSocket::SocketState socketState = QAbstractSocket::ConnectedState) override;
void setProxy(const QNetworkProxy &networkProxy);
- qintptr socketDescriptor() const Q_DECL_OVERRIDE;
+ qintptr socketDescriptor() const override;
- bool isValid() const Q_DECL_OVERRIDE;
+ bool isValid() const override;
bool connectInternal();
- bool connectToHost(const QHostAddress &address, quint16 port) Q_DECL_OVERRIDE;
- bool connectToHostByName(const QString &name, quint16 port) Q_DECL_OVERRIDE;
- bool bind(const QHostAddress &address, quint16 port) Q_DECL_OVERRIDE;
- bool listen() Q_DECL_OVERRIDE;
- int accept() Q_DECL_OVERRIDE;
- void close() Q_DECL_OVERRIDE;
+ bool connectToHost(const QHostAddress &address, quint16 port) override;
+ bool connectToHostByName(const QString &name, quint16 port) override;
+ bool bind(const QHostAddress &address, quint16 port) override;
+ bool listen() override;
+ int accept() override;
+ void close() override;
- qint64 bytesAvailable() const Q_DECL_OVERRIDE;
+ qint64 bytesAvailable() const override;
- qint64 read(char *data, qint64 maxlen) Q_DECL_OVERRIDE;
- qint64 write(const char *data, qint64 len) Q_DECL_OVERRIDE;
+ qint64 read(char *data, qint64 maxlen) override;
+ qint64 write(const char *data, qint64 len) override;
#ifndef QT_NO_UDPSOCKET
#ifndef QT_NO_NETWORKINTERFACE
bool joinMulticastGroup(const QHostAddress &groupAddress,
- const QNetworkInterface &interface) Q_DECL_OVERRIDE;
+ const QNetworkInterface &interface) override;
bool leaveMulticastGroup(const QHostAddress &groupAddress,
- const QNetworkInterface &interface) Q_DECL_OVERRIDE;
- QNetworkInterface multicastInterface() const Q_DECL_OVERRIDE;
- bool setMulticastInterface(const QNetworkInterface &iface) Q_DECL_OVERRIDE;
+ const QNetworkInterface &interface) override;
+ QNetworkInterface multicastInterface() const override;
+ bool setMulticastInterface(const QNetworkInterface &iface) override;
#endif // QT_NO_NETWORKINTERFACE
- bool hasPendingDatagrams() const Q_DECL_OVERRIDE;
- qint64 pendingDatagramSize() const Q_DECL_OVERRIDE;
+ bool hasPendingDatagrams() const override;
+ qint64 pendingDatagramSize() const override;
#endif // QT_NO_UDPSOCKET
qint64 readDatagram(char *data, qint64 maxlen, QIpPacketHeader *,
- PacketHeaderOptions) Q_DECL_OVERRIDE;
- qint64 writeDatagram(const char *data, qint64 len, const QIpPacketHeader &) Q_DECL_OVERRIDE;
- qint64 bytesToWrite() const Q_DECL_OVERRIDE;
+ PacketHeaderOptions) override;
+ qint64 writeDatagram(const char *data, qint64 len, const QIpPacketHeader &) override;
+ qint64 bytesToWrite() const override;
- int option(SocketOption option) const Q_DECL_OVERRIDE;
- bool setOption(SocketOption option, int value) Q_DECL_OVERRIDE;
+ int option(SocketOption option) const override;
+ bool setOption(SocketOption option, int value) override;
- bool waitForRead(int msecs = 30000, bool *timedOut = 0) Q_DECL_OVERRIDE;
- bool waitForWrite(int msecs = 30000, bool *timedOut = 0) Q_DECL_OVERRIDE;
+ bool waitForRead(int msecs = 30000, bool *timedOut = 0) override;
+ bool waitForWrite(int msecs = 30000, bool *timedOut = 0) override;
bool waitForReadOrWrite(bool *readyToRead, bool *readyToWrite,
bool checkRead, bool checkWrite,
- int msecs = 30000, bool *timedOut = 0) Q_DECL_OVERRIDE;
+ int msecs = 30000, bool *timedOut = 0) override;
- bool isReadNotificationEnabled() const Q_DECL_OVERRIDE;
- void setReadNotificationEnabled(bool enable) Q_DECL_OVERRIDE;
- bool isWriteNotificationEnabled() const Q_DECL_OVERRIDE;
- void setWriteNotificationEnabled(bool enable) Q_DECL_OVERRIDE;
- bool isExceptionNotificationEnabled() const Q_DECL_OVERRIDE;
- void setExceptionNotificationEnabled(bool enable) Q_DECL_OVERRIDE;
+ bool isReadNotificationEnabled() const override;
+ void setReadNotificationEnabled(bool enable) override;
+ bool isWriteNotificationEnabled() const override;
+ void setWriteNotificationEnabled(bool enable) override;
+ bool isExceptionNotificationEnabled() const override;
+ void setExceptionNotificationEnabled(bool enable) override;
public slots:
void slotSocketConnected();
@@ -190,8 +192,8 @@ class Q_AUTOTEST_EXPORT QHttpSocketEngineHandler : public QSocketEngineHandler
{
public:
virtual QAbstractSocketEngine *createSocketEngine(QAbstractSocket::SocketType socketType,
- const QNetworkProxy &, QObject *parent) Q_DECL_OVERRIDE;
- virtual QAbstractSocketEngine *createSocketEngine(qintptr socketDescripter, QObject *parent) Q_DECL_OVERRIDE;
+ const QNetworkProxy &, QObject *parent) override;
+ virtual QAbstractSocketEngine *createSocketEngine(qintptr socketDescripter, QObject *parent) override;
};
#endif
diff --git a/src/network/socket/qlocalserver.h b/src/network/socket/qlocalserver.h
index 454ac30c9b..211aa94d85 100644
--- a/src/network/socket/qlocalserver.h
+++ b/src/network/socket/qlocalserver.h
@@ -71,7 +71,7 @@ public:
Q_DECLARE_FLAGS(SocketOptions, SocketOption)
Q_FLAG(SocketOptions)
- explicit QLocalServer(QObject *parent = Q_NULLPTR);
+ explicit QLocalServer(QObject *parent = nullptr);
~QLocalServer();
void close();
@@ -87,7 +87,7 @@ public:
static bool removeServer(const QString &name);
QAbstractSocket::SocketError serverError() const;
void setMaxPendingConnections(int numConnections);
- bool waitForNewConnection(int msec = 0, bool *timedOut = Q_NULLPTR);
+ bool waitForNewConnection(int msec = 0, bool *timedOut = nullptr);
void setSocketOptions(SocketOptions options);
SocketOptions socketOptions() const;
diff --git a/src/network/socket/qlocalsocket.h b/src/network/socket/qlocalsocket.h
index 9905d3a86c..1876a6ac0d 100644
--- a/src/network/socket/qlocalsocket.h
+++ b/src/network/socket/qlocalsocket.h
@@ -79,7 +79,7 @@ public:
ClosingState = QAbstractSocket::ClosingState
};
- QLocalSocket(QObject *parent = Q_NULLPTR);
+ QLocalSocket(QObject *parent = nullptr);
~QLocalSocket();
void connectToServer(OpenMode openMode = ReadWrite);
@@ -91,12 +91,12 @@ public:
QString fullServerName() const;
void abort();
- virtual bool isSequential() const Q_DECL_OVERRIDE;
- virtual qint64 bytesAvailable() const Q_DECL_OVERRIDE;
- virtual qint64 bytesToWrite() const Q_DECL_OVERRIDE;
- virtual bool canReadLine() const Q_DECL_OVERRIDE;
- virtual bool open(OpenMode openMode = ReadWrite) Q_DECL_OVERRIDE;
- virtual void close() Q_DECL_OVERRIDE;
+ virtual bool isSequential() const override;
+ virtual qint64 bytesAvailable() const override;
+ virtual qint64 bytesToWrite() const override;
+ virtual bool canReadLine() const override;
+ virtual bool open(OpenMode openMode = ReadWrite) override;
+ virtual void close() override;
LocalSocketError error() const;
bool flush();
bool isValid() const;
@@ -109,10 +109,10 @@ public:
qintptr socketDescriptor() const;
LocalSocketState state() const;
- bool waitForBytesWritten(int msecs = 30000) Q_DECL_OVERRIDE;
+ bool waitForBytesWritten(int msecs = 30000) override;
bool waitForConnected(int msecs = 30000);
bool waitForDisconnected(int msecs = 30000);
- bool waitForReadyRead(int msecs = 30000) Q_DECL_OVERRIDE;
+ bool waitForReadyRead(int msecs = 30000) override;
Q_SIGNALS:
void connected();
@@ -121,8 +121,8 @@ Q_SIGNALS:
void stateChanged(QLocalSocket::LocalSocketState socketState);
protected:
- virtual qint64 readData(char*, qint64) Q_DECL_OVERRIDE;
- virtual qint64 writeData(const char*, qint64) Q_DECL_OVERRIDE;
+ virtual qint64 readData(char*, qint64) override;
+ virtual qint64 writeData(const char*, qint64) override;
private:
Q_DISABLE_COPY(QLocalSocket)
diff --git a/src/network/socket/qlocalsocket_p.h b/src/network/socket/qlocalsocket_p.h
index eb59af5577..8b72da397f 100644
--- a/src/network/socket/qlocalsocket_p.h
+++ b/src/network/socket/qlocalsocket_p.h
@@ -120,6 +120,7 @@ public:
void init();
#if defined(QT_LOCALSOCKET_TCP)
+ qint64 skip(qint64 maxSize) override;
QLocalUnixSocket* tcpSocket;
bool ownsTcpSocket;
void setSocket(QLocalUnixSocket*);
@@ -139,6 +140,7 @@ public:
QWindowsPipeReader *pipeReader;
QLocalSocket::LocalSocketError error;
#else
+ qint64 skip(qint64 maxSize) override;
QLocalUnixSocket unixSocket;
QString generateErrorString(QLocalSocket::LocalSocketError, const QString &function) const;
void errorOccurred(QLocalSocket::LocalSocketError, const QString &function);
diff --git a/src/network/socket/qlocalsocket_tcp.cpp b/src/network/socket/qlocalsocket_tcp.cpp
index 379cdd096d..41e5b47627 100644
--- a/src/network/socket/qlocalsocket_tcp.cpp
+++ b/src/network/socket/qlocalsocket_tcp.cpp
@@ -83,6 +83,11 @@ void QLocalSocketPrivate::setSocket(QLocalUnixSocket* socket)
tcpSocket->setParent(q);
}
+qint64 QLocalSocketPrivate::skip(qint64 maxSize)
+{
+ return tcpSocket->skip(maxSize);
+}
+
void QLocalSocketPrivate::_q_error(QAbstractSocket::SocketError socketError)
{
Q_Q(QLocalSocket);
diff --git a/src/network/socket/qlocalsocket_unix.cpp b/src/network/socket/qlocalsocket_unix.cpp
index c1d79e8137..d1df26d9f1 100644
--- a/src/network/socket/qlocalsocket_unix.cpp
+++ b/src/network/socket/qlocalsocket_unix.cpp
@@ -88,6 +88,11 @@ void QLocalSocketPrivate::init()
unixSocket.setParent(q);
}
+qint64 QLocalSocketPrivate::skip(qint64 maxSize)
+{
+ return unixSocket.skip(maxSize);
+}
+
void QLocalSocketPrivate::_q_error(QAbstractSocket::SocketError socketError)
{
Q_Q(QLocalSocket);
diff --git a/src/network/socket/qnativesocketengine_p.h b/src/network/socket/qnativesocketengine_p.h
index d488ce150c..aa61b74823 100644
--- a/src/network/socket/qnativesocketengine_p.h
+++ b/src/network/socket/qnativesocketengine_p.h
@@ -128,43 +128,43 @@ public:
QNativeSocketEngine(QObject *parent = 0);
~QNativeSocketEngine();
- bool initialize(QAbstractSocket::SocketType type, QAbstractSocket::NetworkLayerProtocol protocol = QAbstractSocket::IPv4Protocol) Q_DECL_OVERRIDE;
- bool initialize(qintptr socketDescriptor, QAbstractSocket::SocketState socketState = QAbstractSocket::ConnectedState) Q_DECL_OVERRIDE;
+ bool initialize(QAbstractSocket::SocketType type, QAbstractSocket::NetworkLayerProtocol protocol = QAbstractSocket::IPv4Protocol) override;
+ bool initialize(qintptr socketDescriptor, QAbstractSocket::SocketState socketState = QAbstractSocket::ConnectedState) override;
- qintptr socketDescriptor() const Q_DECL_OVERRIDE;
+ qintptr socketDescriptor() const override;
- bool isValid() const Q_DECL_OVERRIDE;
+ bool isValid() const override;
- bool connectToHost(const QHostAddress &address, quint16 port) Q_DECL_OVERRIDE;
- bool connectToHostByName(const QString &name, quint16 port) Q_DECL_OVERRIDE;
- bool bind(const QHostAddress &address, quint16 port) Q_DECL_OVERRIDE;
- bool listen() Q_DECL_OVERRIDE;
- int accept() Q_DECL_OVERRIDE;
- void close() Q_DECL_OVERRIDE;
+ bool connectToHost(const QHostAddress &address, quint16 port) override;
+ bool connectToHostByName(const QString &name, quint16 port) override;
+ bool bind(const QHostAddress &address, quint16 port) override;
+ bool listen() override;
+ int accept() override;
+ void close() override;
- qint64 bytesAvailable() const Q_DECL_OVERRIDE;
+ qint64 bytesAvailable() const override;
- qint64 read(char *data, qint64 maxlen) Q_DECL_OVERRIDE;
- qint64 write(const char *data, qint64 len) Q_DECL_OVERRIDE;
+ qint64 read(char *data, qint64 maxlen) override;
+ qint64 write(const char *data, qint64 len) override;
#ifndef QT_NO_UDPSOCKET
#ifndef QT_NO_NETWORKINTERFACE
bool joinMulticastGroup(const QHostAddress &groupAddress,
- const QNetworkInterface &iface) Q_DECL_OVERRIDE;
+ const QNetworkInterface &iface) override;
bool leaveMulticastGroup(const QHostAddress &groupAddress,
- const QNetworkInterface &iface) Q_DECL_OVERRIDE;
- QNetworkInterface multicastInterface() const Q_DECL_OVERRIDE;
- bool setMulticastInterface(const QNetworkInterface &iface) Q_DECL_OVERRIDE;
+ const QNetworkInterface &iface) override;
+ QNetworkInterface multicastInterface() const override;
+ bool setMulticastInterface(const QNetworkInterface &iface) override;
#endif
- bool hasPendingDatagrams() const Q_DECL_OVERRIDE;
- qint64 pendingDatagramSize() const Q_DECL_OVERRIDE;
+ bool hasPendingDatagrams() const override;
+ qint64 pendingDatagramSize() const override;
#endif // QT_NO_UDPSOCKET
qint64 readDatagram(char *data, qint64 maxlen, QIpPacketHeader * = 0,
- PacketHeaderOptions = WantNone) Q_DECL_OVERRIDE;
- qint64 writeDatagram(const char *data, qint64 len, const QIpPacketHeader &) Q_DECL_OVERRIDE;
- qint64 bytesToWrite() const Q_DECL_OVERRIDE;
+ PacketHeaderOptions = WantNone) override;
+ qint64 writeDatagram(const char *data, qint64 len, const QIpPacketHeader &) override;
+ qint64 bytesToWrite() const override;
#if 0 // currently unused
qint64 receiveBufferSize() const;
@@ -174,21 +174,21 @@ public:
void setSendBufferSize(qint64 bufferSize);
#endif
- int option(SocketOption option) const Q_DECL_OVERRIDE;
- bool setOption(SocketOption option, int value) Q_DECL_OVERRIDE;
+ int option(SocketOption option) const override;
+ bool setOption(SocketOption option, int value) override;
- bool waitForRead(int msecs = 30000, bool *timedOut = 0) Q_DECL_OVERRIDE;
- bool waitForWrite(int msecs = 30000, bool *timedOut = 0) Q_DECL_OVERRIDE;
+ bool waitForRead(int msecs = 30000, bool *timedOut = 0) override;
+ bool waitForWrite(int msecs = 30000, bool *timedOut = 0) override;
bool waitForReadOrWrite(bool *readyToRead, bool *readyToWrite,
bool checkRead, bool checkWrite,
- int msecs = 30000, bool *timedOut = 0) Q_DECL_OVERRIDE;
-
- bool isReadNotificationEnabled() const Q_DECL_OVERRIDE;
- void setReadNotificationEnabled(bool enable) Q_DECL_OVERRIDE;
- bool isWriteNotificationEnabled() const Q_DECL_OVERRIDE;
- void setWriteNotificationEnabled(bool enable) Q_DECL_OVERRIDE;
- bool isExceptionNotificationEnabled() const Q_DECL_OVERRIDE;
- void setExceptionNotificationEnabled(bool enable) Q_DECL_OVERRIDE;
+ int msecs = 30000, bool *timedOut = 0) override;
+
+ bool isReadNotificationEnabled() const override;
+ void setReadNotificationEnabled(bool enable) override;
+ bool isWriteNotificationEnabled() const override;
+ void setWriteNotificationEnabled(bool enable) override;
+ bool isExceptionNotificationEnabled() const override;
+ void setExceptionNotificationEnabled(bool enable) override;
public Q_SLOTS:
// non-virtual override;
diff --git a/src/network/socket/qnativesocketengine_unix.cpp b/src/network/socket/qnativesocketengine_unix.cpp
index cb0a521360..b380b0f7d6 100644
--- a/src/network/socket/qnativesocketengine_unix.cpp
+++ b/src/network/socket/qnativesocketengine_unix.cpp
@@ -226,6 +226,20 @@ static void convertToLevelAndOption(QNativeSocketEngine::SocketOption opt,
#endif
}
break;
+
+ case QNativeSocketEngine::PathMtuInformation:
+ if (socketProtocol == QAbstractSocket::IPv6Protocol || socketProtocol == QAbstractSocket::AnyIPProtocol) {
+#ifdef IPV6_MTU
+ level = IPPROTO_IPV6;
+ n = IPV6_MTU;
+#endif
+ } else {
+#ifdef IP_MTU
+ level = IPPROTO_IP;
+ n = IP_MTU;
+#endif
+ }
+ break;
}
}
@@ -331,6 +345,20 @@ int QNativeSocketEnginePrivate::option(QNativeSocketEngine::SocketOption opt) co
return -1;
}
+ case QNativeSocketEngine::PathMtuInformation:
+#if defined(IPV6_PATHMTU) && !defined(IPV6_MTU)
+ // Prefer IPV6_MTU (handled by convertToLevelAndOption), if available
+ // (Linux); fall back to IPV6_PATHMTU otherwise (FreeBSD):
+ if (socketProtocol == QAbstractSocket::IPv6Protocol) {
+ ip6_mtuinfo mtuinfo;
+ QT_SOCKOPTLEN_T len = sizeof(mtuinfo);
+ if (::getsockopt(socketDescriptor, IPPROTO_IPV6, IPV6_PATHMTU, &mtuinfo, &len) == 0)
+ return int(mtuinfo.ip6m_mtu);
+ return -1;
+ }
+#endif
+ break;
+
default:
break;
}
@@ -420,6 +448,8 @@ bool QNativeSocketEnginePrivate::setOption(QNativeSocketEngine::SocketOption opt
}
#endif
+ if (n == -1)
+ return false;
return ::setsockopt(socketDescriptor, level, n, (char *) &v, sizeof(v)) == 0;
}
diff --git a/src/network/socket/qnativesocketengine_win.cpp b/src/network/socket/qnativesocketengine_win.cpp
index 747fdeb967..e8ab8de469 100644
--- a/src/network/socket/qnativesocketengine_win.cpp
+++ b/src/network/socket/qnativesocketengine_win.cpp
@@ -209,7 +209,7 @@ static inline void qt_socket_getPortAndAddress(SOCKET socketDescriptor, const qt
static void convertToLevelAndOption(QNativeSocketEngine::SocketOption opt,
QAbstractSocket::NetworkLayerProtocol socketProtocol, int &level, int &n)
{
- n = 0;
+ n = -1;
level = SOL_SOCKET; // default
switch (opt) {
@@ -281,6 +281,9 @@ static void convertToLevelAndOption(QNativeSocketEngine::SocketOption opt,
n = IP_HOPLIMIT;
}
break;
+
+ case QAbstractSocketEngine::PathMtuInformation:
+ break; // not supported on Windows
}
}
@@ -471,9 +474,11 @@ int QNativeSocketEnginePrivate::option(QNativeSocketEngine::SocketOption opt) co
QT_SOCKOPTLEN_T len = sizeof(v);
convertToLevelAndOption(opt, socketProtocol, level, n);
- if (getsockopt(socketDescriptor, level, n, (char *) &v, &len) == 0)
- return v;
- WS_ERROR_DEBUG(WSAGetLastError());
+ if (n != -1) {
+ if (getsockopt(socketDescriptor, level, n, (char *) &v, &len) == 0)
+ return v;
+ WS_ERROR_DEBUG(WSAGetLastError());
+ }
return -1;
}
@@ -491,9 +496,7 @@ bool QNativeSocketEnginePrivate::setOption(QNativeSocketEngine::SocketOption opt
switch (opt) {
case QNativeSocketEngine::SendBufferSocketOption:
// see QTBUG-30478 SO_SNDBUF should not be used on Vista or later
- if (QSysInfo::windowsVersion() >= QSysInfo::WV_VISTA)
- return false;
- break;
+ return false;
case QNativeSocketEngine::NonBlockingSocketOption:
{
unsigned long buf = v;
@@ -516,6 +519,8 @@ bool QNativeSocketEnginePrivate::setOption(QNativeSocketEngine::SocketOption opt
int n, level;
convertToLevelAndOption(opt, socketProtocol, level, n);
+ if (n == -1)
+ return false;
if (::setsockopt(socketDescriptor, level, n, (char*)&v, sizeof(v)) != 0) {
WS_ERROR_DEBUG(WSAGetLastError());
return false;
@@ -571,7 +576,6 @@ bool QNativeSocketEnginePrivate::fetchConnectionParameters()
DWORD ipv6only = 0;
QT_SOCKOPTLEN_T optlen = sizeof(ipv6only);
if (localAddress == QHostAddress::AnyIPv6
- && QSysInfo::windowsVersion() >= QSysInfo::WV_6_0
&& !getsockopt(socketDescriptor, IPPROTO_IPV6, IPV6_V6ONLY, (char*)&ipv6only, &optlen )) {
if (!ipv6only) {
socketProtocol = QAbstractSocket::AnyIPProtocol;
@@ -632,10 +636,8 @@ bool QNativeSocketEnginePrivate::nativeConnect(const QHostAddress &address, quin
if ((socketProtocol == QAbstractSocket::IPv6Protocol || socketProtocol == QAbstractSocket::AnyIPProtocol) && address.toIPv4Address()) {
//IPV6_V6ONLY option must be cleared to connect to a V4 mapped address
- if (QSysInfo::windowsVersion() >= QSysInfo::WV_6_0) {
- DWORD ipv6only = 0;
- ipv6only = ::setsockopt(socketDescriptor, IPPROTO_IPV6, IPV6_V6ONLY, (char*)&ipv6only, sizeof(ipv6only) );
- }
+ DWORD ipv6only = 0;
+ ipv6only = ::setsockopt(socketDescriptor, IPPROTO_IPV6, IPV6_V6ONLY, (char*)&ipv6only, sizeof(ipv6only) );
}
forever {
diff --git a/src/network/socket/qnativesocketengine_winrt.cpp b/src/network/socket/qnativesocketengine_winrt.cpp
index b7d7042923..9df5f0c500 100644
--- a/src/network/socket/qnativesocketengine_winrt.cpp
+++ b/src/network/socket/qnativesocketengine_winrt.cpp
@@ -1340,7 +1340,7 @@ QNativeSocketEnginePrivate::QNativeSocketEnginePrivate()
, closingDown(false)
, socketDescriptor(-1)
, worker(new SocketEngineWorker(this))
- , sslSocket(Q_NULLPTR)
+ , sslSocket(nullptr)
, connectionToken( { -1 } )
{
}
@@ -1514,6 +1514,7 @@ int QNativeSocketEnginePrivate::option(QAbstractSocketEngine::SocketOption opt)
case QAbstractSocketEngine::MulticastLoopbackOption:
case QAbstractSocketEngine::TypeOfServiceOption:
case QAbstractSocketEngine::MaxStreamsSocketOption:
+ case QAbstractSocketEngine::PathMtuInformation:
default:
return -1;
}
@@ -1573,6 +1574,7 @@ bool QNativeSocketEnginePrivate::setOption(QAbstractSocketEngine::SocketOption o
case QAbstractSocketEngine::MulticastLoopbackOption:
case QAbstractSocketEngine::TypeOfServiceOption:
case QAbstractSocketEngine::MaxStreamsSocketOption:
+ case QAbstractSocketEngine::PathMtuInformation:
default:
return false;
}
diff --git a/src/network/socket/qnet_unix_p.h b/src/network/socket/qnet_unix_p.h
index 5359872f96..e038352352 100644
--- a/src/network/socket/qnet_unix_p.h
+++ b/src/network/socket/qnet_unix_p.h
@@ -78,7 +78,6 @@ QT_BEGIN_NAMESPACE
# define QT_SOCKOPTLEN_T QT_SOCKLEN_T
#endif
-// UnixWare 7 redefines socket -> _socket
static inline int qt_safe_socket(int domain, int type, int protocol, int flags = 0)
{
Q_ASSERT((flags & ~O_NONBLOCK) == 0);
@@ -105,7 +104,6 @@ static inline int qt_safe_socket(int domain, int type, int protocol, int flags =
#endif
}
-// Tru64 redefines accept -> _accept with _XOPEN_SOURCE_EXTENDED
static inline int qt_safe_accept(int s, struct sockaddr *addr, QT_SOCKLEN_T *addrlen, int flags = 0)
{
Q_ASSERT((flags & ~O_NONBLOCK) == 0);
@@ -137,7 +135,6 @@ static inline int qt_safe_accept(int s, struct sockaddr *addr, QT_SOCKLEN_T *add
#endif
}
-// UnixWare 7 redefines listen -> _listen
static inline int qt_safe_listen(int s, int backlog)
{
return ::listen(s, backlog);
diff --git a/src/network/socket/qsctpserver.h b/src/network/socket/qsctpserver.h
index 1afdab28a0..b678ba053d 100644
--- a/src/network/socket/qsctpserver.h
+++ b/src/network/socket/qsctpserver.h
@@ -63,7 +63,7 @@ public:
QSctpSocket *nextPendingDatagramConnection();
protected:
- void incomingConnection(qintptr handle) Q_DECL_OVERRIDE;
+ void incomingConnection(qintptr handle) override;
private:
Q_DISABLE_COPY(QSctpServer)
diff --git a/src/network/socket/qsctpserver_p.h b/src/network/socket/qsctpserver_p.h
index 274939fc3d..8816cc150e 100644
--- a/src/network/socket/qsctpserver_p.h
+++ b/src/network/socket/qsctpserver_p.h
@@ -66,7 +66,7 @@ public:
int maximumChannelCount;
- void configureCreatedSocket() Q_DECL_OVERRIDE;
+ void configureCreatedSocket() override;
};
#endif // QT_NO_SCTP
diff --git a/src/network/socket/qsctpsocket.h b/src/network/socket/qsctpsocket.h
index 9bed1890ff..5288da6129 100644
--- a/src/network/socket/qsctpsocket.h
+++ b/src/network/socket/qsctpsocket.h
@@ -56,8 +56,8 @@ public:
explicit QSctpSocket(QObject *parent = nullptr);
virtual ~QSctpSocket();
- void close() Q_DECL_OVERRIDE;
- void disconnectFromHost() Q_DECL_OVERRIDE;
+ void close() override;
+ void disconnectFromHost() override;
void setMaximumChannelCount(int count);
int maximumChannelCount() const;
@@ -67,8 +67,8 @@ public:
bool writeDatagram(const QNetworkDatagram &datagram);
protected:
- qint64 readData(char *data, qint64 maxlen) Q_DECL_OVERRIDE;
- qint64 readLineData(char *data, qint64 maxlen) Q_DECL_OVERRIDE;
+ qint64 readData(char *data, qint64 maxlen) override;
+ qint64 readLineData(char *data, qint64 maxlen) override;
private:
Q_DISABLE_COPY(QSctpSocket)
diff --git a/src/network/socket/qsctpsocket_p.h b/src/network/socket/qsctpsocket_p.h
index 3f765ebed9..8f9413cb47 100644
--- a/src/network/socket/qsctpsocket_p.h
+++ b/src/network/socket/qsctpsocket_p.h
@@ -70,8 +70,8 @@ public:
QSctpSocketPrivate();
virtual ~QSctpSocketPrivate();
- bool canReadNotification() Q_DECL_OVERRIDE;
- bool writeToSocket() Q_DECL_OVERRIDE;
+ bool canReadNotification() override;
+ bool writeToSocket() override;
QByteArray incomingDatagram;
int maximumChannelCount;
@@ -80,7 +80,7 @@ public:
QVector<IpHeaderList> readHeaders;
QVector<IpHeaderList> writeHeaders;
- void configureCreatedSocket() Q_DECL_OVERRIDE;
+ void configureCreatedSocket() override;
};
#endif // QT_NO_SCTP
diff --git a/src/network/socket/qsocks5socketengine.cpp b/src/network/socket/qsocks5socketengine.cpp
index fa5f198bf2..a07ea65046 100644
--- a/src/network/socket/qsocks5socketengine.cpp
+++ b/src/network/socket/qsocks5socketengine.cpp
@@ -320,7 +320,7 @@ public:
QSocks5BindData *retrieve(qintptr socketDescriptor);
protected:
- void timerEvent(QTimerEvent * event) Q_DECL_OVERRIDE;
+ void timerEvent(QTimerEvent * event) override;
QMutex mutex;
int sweepTimerId;
diff --git a/src/network/socket/qsocks5socketengine_p.h b/src/network/socket/qsocks5socketengine_p.h
index b248554ae5..1942eff4ca 100644
--- a/src/network/socket/qsocks5socketengine_p.h
+++ b/src/network/socket/qsocks5socketengine_p.h
@@ -68,62 +68,62 @@ public:
QSocks5SocketEngine(QObject *parent = 0);
~QSocks5SocketEngine();
- bool initialize(QAbstractSocket::SocketType type, QAbstractSocket::NetworkLayerProtocol protocol = QAbstractSocket::IPv4Protocol) Q_DECL_OVERRIDE;
- bool initialize(qintptr socketDescriptor, QAbstractSocket::SocketState socketState = QAbstractSocket::ConnectedState) Q_DECL_OVERRIDE;
+ bool initialize(QAbstractSocket::SocketType type, QAbstractSocket::NetworkLayerProtocol protocol = QAbstractSocket::IPv4Protocol) override;
+ bool initialize(qintptr socketDescriptor, QAbstractSocket::SocketState socketState = QAbstractSocket::ConnectedState) override;
void setProxy(const QNetworkProxy &networkProxy);
- qintptr socketDescriptor() const Q_DECL_OVERRIDE;
+ qintptr socketDescriptor() const override;
- bool isValid() const Q_DECL_OVERRIDE;
+ bool isValid() const override;
bool connectInternal();
- bool connectToHost(const QHostAddress &address, quint16 port) Q_DECL_OVERRIDE;
- bool connectToHostByName(const QString &name, quint16 port) Q_DECL_OVERRIDE;
- bool bind(const QHostAddress &address, quint16 port) Q_DECL_OVERRIDE;
- bool listen() Q_DECL_OVERRIDE;
- int accept() Q_DECL_OVERRIDE;
- void close() Q_DECL_OVERRIDE;
+ bool connectToHost(const QHostAddress &address, quint16 port) override;
+ bool connectToHostByName(const QString &name, quint16 port) override;
+ bool bind(const QHostAddress &address, quint16 port) override;
+ bool listen() override;
+ int accept() override;
+ void close() override;
- qint64 bytesAvailable() const Q_DECL_OVERRIDE;
+ qint64 bytesAvailable() const override;
- qint64 read(char *data, qint64 maxlen) Q_DECL_OVERRIDE;
- qint64 write(const char *data, qint64 len) Q_DECL_OVERRIDE;
+ qint64 read(char *data, qint64 maxlen) override;
+ qint64 write(const char *data, qint64 len) override;
#ifndef QT_NO_UDPSOCKET
#ifndef QT_NO_NETWORKINTERFACE
bool joinMulticastGroup(const QHostAddress &groupAddress,
- const QNetworkInterface &interface) Q_DECL_OVERRIDE;
+ const QNetworkInterface &interface) override;
bool leaveMulticastGroup(const QHostAddress &groupAddress,
- const QNetworkInterface &interface) Q_DECL_OVERRIDE;
- QNetworkInterface multicastInterface() const Q_DECL_OVERRIDE;
- bool setMulticastInterface(const QNetworkInterface &iface) Q_DECL_OVERRIDE;
+ const QNetworkInterface &interface) override;
+ QNetworkInterface multicastInterface() const override;
+ bool setMulticastInterface(const QNetworkInterface &iface) override;
#endif // QT_NO_NETWORKINTERFACE
- bool hasPendingDatagrams() const Q_DECL_OVERRIDE;
- qint64 pendingDatagramSize() const Q_DECL_OVERRIDE;
+ bool hasPendingDatagrams() const override;
+ qint64 pendingDatagramSize() const override;
#endif // QT_NO_UDPSOCKET
qint64 readDatagram(char *data, qint64 maxlen, QIpPacketHeader * = 0,
- PacketHeaderOptions = WantNone) Q_DECL_OVERRIDE;
- qint64 writeDatagram(const char *data, qint64 len, const QIpPacketHeader &) Q_DECL_OVERRIDE;
- qint64 bytesToWrite() const Q_DECL_OVERRIDE;
+ PacketHeaderOptions = WantNone) override;
+ qint64 writeDatagram(const char *data, qint64 len, const QIpPacketHeader &) override;
+ qint64 bytesToWrite() const override;
- int option(SocketOption option) const Q_DECL_OVERRIDE;
- bool setOption(SocketOption option, int value) Q_DECL_OVERRIDE;
+ int option(SocketOption option) const override;
+ bool setOption(SocketOption option, int value) override;
- bool waitForRead(int msecs = 30000, bool *timedOut = 0) Q_DECL_OVERRIDE;
- bool waitForWrite(int msecs = 30000, bool *timedOut = 0) Q_DECL_OVERRIDE;
+ bool waitForRead(int msecs = 30000, bool *timedOut = 0) override;
+ bool waitForWrite(int msecs = 30000, bool *timedOut = 0) override;
bool waitForReadOrWrite(bool *readyToRead, bool *readyToWrite,
bool checkRead, bool checkWrite,
- int msecs = 30000, bool *timedOut = 0) Q_DECL_OVERRIDE;
+ int msecs = 30000, bool *timedOut = 0) override;
- bool isReadNotificationEnabled() const Q_DECL_OVERRIDE;
- void setReadNotificationEnabled(bool enable) Q_DECL_OVERRIDE;
- bool isWriteNotificationEnabled() const Q_DECL_OVERRIDE;
- void setWriteNotificationEnabled(bool enable) Q_DECL_OVERRIDE;
- bool isExceptionNotificationEnabled() const Q_DECL_OVERRIDE;
- void setExceptionNotificationEnabled(bool enable) Q_DECL_OVERRIDE;
+ bool isReadNotificationEnabled() const override;
+ void setReadNotificationEnabled(bool enable) override;
+ bool isWriteNotificationEnabled() const override;
+ void setWriteNotificationEnabled(bool enable) override;
+ bool isExceptionNotificationEnabled() const override;
+ void setExceptionNotificationEnabled(bool enable) override;
private:
Q_DECLARE_PRIVATE(QSocks5SocketEngine)
@@ -166,11 +166,11 @@ class QSocks5PasswordAuthenticator : public QSocks5Authenticator
{
public:
QSocks5PasswordAuthenticator(const QString &userName, const QString &password);
- char methodId() Q_DECL_OVERRIDE;
- bool beginAuthenticate(QTcpSocket *socket, bool *completed) Q_DECL_OVERRIDE;
- bool continueAuthenticate(QTcpSocket *socket, bool *completed) Q_DECL_OVERRIDE;
+ char methodId() override;
+ bool beginAuthenticate(QTcpSocket *socket, bool *completed) override;
+ bool continueAuthenticate(QTcpSocket *socket, bool *completed) override;
- QString errorString() Q_DECL_OVERRIDE;
+ QString errorString() override;
private:
QString userName;
@@ -287,8 +287,8 @@ class Q_AUTOTEST_EXPORT QSocks5SocketEngineHandler : public QSocketEngineHandler
{
public:
virtual QAbstractSocketEngine *createSocketEngine(QAbstractSocket::SocketType socketType,
- const QNetworkProxy &, QObject *parent) Q_DECL_OVERRIDE;
- virtual QAbstractSocketEngine *createSocketEngine(qintptr socketDescriptor, QObject *parent) Q_DECL_OVERRIDE;
+ const QNetworkProxy &, QObject *parent) override;
+ virtual QAbstractSocketEngine *createSocketEngine(qintptr socketDescriptor, QObject *parent) override;
};
QT_END_NAMESPACE
diff --git a/src/network/socket/qtcpserver.h b/src/network/socket/qtcpserver.h
index 192cbce54c..37df12919f 100644
--- a/src/network/socket/qtcpserver.h
+++ b/src/network/socket/qtcpserver.h
@@ -58,7 +58,7 @@ class Q_NETWORK_EXPORT QTcpServer : public QObject
{
Q_OBJECT
public:
- explicit QTcpServer(QObject *parent = Q_NULLPTR);
+ explicit QTcpServer(QObject *parent = nullptr);
virtual ~QTcpServer();
bool listen(const QHostAddress &address = QHostAddress::Any, quint16 port = 0);
@@ -75,7 +75,7 @@ public:
qintptr socketDescriptor() const;
bool setSocketDescriptor(qintptr socketDescriptor);
- bool waitForNewConnection(int msec = 0, bool *timedOut = Q_NULLPTR);
+ bool waitForNewConnection(int msec = 0, bool *timedOut = nullptr);
virtual bool hasPendingConnections() const;
virtual QTcpSocket *nextPendingConnection();
@@ -95,7 +95,7 @@ protected:
void addPendingConnection(QTcpSocket* socket);
QTcpServer(QAbstractSocket::SocketType socketType, QTcpServerPrivate &dd,
- QObject *parent = Q_NULLPTR);
+ QObject *parent = nullptr);
Q_SIGNALS:
void newConnection();
diff --git a/src/network/socket/qtcpserver_p.h b/src/network/socket/qtcpserver_p.h
index b7fae4c105..6ee8c5f0b1 100644
--- a/src/network/socket/qtcpserver_p.h
+++ b/src/network/socket/qtcpserver_p.h
@@ -93,13 +93,13 @@ public:
virtual void configureCreatedSocket();
// from QAbstractSocketEngineReceiver
- void readNotification() Q_DECL_OVERRIDE;
- void closeNotification() Q_DECL_OVERRIDE { readNotification(); }
- void writeNotification() Q_DECL_OVERRIDE {}
- void exceptionNotification() Q_DECL_OVERRIDE {}
- void connectionNotification() Q_DECL_OVERRIDE {}
+ void readNotification() override;
+ void closeNotification() override { readNotification(); }
+ void writeNotification() override {}
+ void exceptionNotification() override {}
+ void connectionNotification() override {}
#ifndef QT_NO_NETWORKPROXY
- void proxyAuthenticationRequired(const QNetworkProxy &, QAuthenticator *) Q_DECL_OVERRIDE {}
+ void proxyAuthenticationRequired(const QNetworkProxy &, QAuthenticator *) override {}
#endif
};
diff --git a/src/network/socket/qtcpsocket.h b/src/network/socket/qtcpsocket.h
index 3c3e3b69fd..b2c8bcc884 100644
--- a/src/network/socket/qtcpsocket.h
+++ b/src/network/socket/qtcpsocket.h
@@ -53,13 +53,13 @@ class Q_NETWORK_EXPORT QTcpSocket : public QAbstractSocket
{
Q_OBJECT
public:
- explicit QTcpSocket(QObject *parent = Q_NULLPTR);
+ explicit QTcpSocket(QObject *parent = nullptr);
virtual ~QTcpSocket();
protected:
- QTcpSocket(QTcpSocketPrivate &dd, QObject *parent = Q_NULLPTR);
+ QTcpSocket(QTcpSocketPrivate &dd, QObject *parent = nullptr);
QTcpSocket(QAbstractSocket::SocketType socketType, QTcpSocketPrivate &dd,
- QObject *parent = Q_NULLPTR);
+ QObject *parent = nullptr);
private:
Q_DISABLE_COPY(QTcpSocket)
diff --git a/src/network/socket/qudpsocket.h b/src/network/socket/qudpsocket.h
index 6ef10e2edb..ce4429d1cd 100644
--- a/src/network/socket/qudpsocket.h
+++ b/src/network/socket/qudpsocket.h
@@ -57,7 +57,7 @@ class Q_NETWORK_EXPORT QUdpSocket : public QAbstractSocket
{
Q_OBJECT
public:
- explicit QUdpSocket(QObject *parent = Q_NULLPTR);
+ explicit QUdpSocket(QObject *parent = nullptr);
virtual ~QUdpSocket();
#ifndef QT_NO_NETWORKINTERFACE
@@ -75,7 +75,7 @@ public:
bool hasPendingDatagrams() const;
qint64 pendingDatagramSize() const;
QNetworkDatagram receiveDatagram(qint64 maxSize = -1);
- qint64 readDatagram(char *data, qint64 maxlen, QHostAddress *host = Q_NULLPTR, quint16 *port = Q_NULLPTR);
+ qint64 readDatagram(char *data, qint64 maxlen, QHostAddress *host = nullptr, quint16 *port = nullptr);
qint64 writeDatagram(const QNetworkDatagram &datagram);
qint64 writeDatagram(const char *data, qint64 len, const QHostAddress &host, quint16 port);
diff --git a/src/network/socket/socket.pri b/src/network/socket/socket.pri
index b2ee1a8054..a8a37492b7 100644
--- a/src/network/socket/socket.pri
+++ b/src/network/socket/socket.pri
@@ -1,7 +1,6 @@
# Qt network socket
HEADERS += socket/qabstractsocketengine_p.h \
- socket/qhttpsocketengine_p.h \
socket/qabstractsocket.h \
socket/qabstractsocket_p.h \
socket/qtcpsocket.h \
@@ -11,7 +10,6 @@ HEADERS += socket/qabstractsocketengine_p.h \
socket/qtcpserver_p.h
SOURCES += socket/qabstractsocketengine.cpp \
- socket/qhttpsocketengine.cpp \
socket/qabstractsocket.cpp \
socket/qtcpsocket.cpp \
socket/qudpsocket.cpp \
@@ -26,6 +24,13 @@ qtConfig(socks5) {
socket/qsocks5socketengine.cpp
}
+qtConfig(http) {
+ HEADERS += \
+ socket/qhttpsocketengine_p.h
+ SOURCES += \
+ socket/qhttpsocketengine.cpp
+}
+
# SCTP support.
qtConfig(sctp) {
diff --git a/src/network/ssl/qsslcertificate.h b/src/network/ssl/qsslcertificate.h
index 8b051a5c88..6cd66fd20f 100644
--- a/src/network/ssl/qsslcertificate.h
+++ b/src/network/ssl/qsslcertificate.h
@@ -154,7 +154,7 @@ public:
static bool importPkcs12(QIODevice *device,
QSslKey *key, QSslCertificate *cert,
- QList<QSslCertificate> *caCertificates = Q_NULLPTR,
+ QList<QSslCertificate> *caCertificates = nullptr,
const QByteArray &passPhrase=QByteArray());
Qt::HANDLE handle() const;
diff --git a/src/network/ssl/qssldiffiehellmanparameters_openssl.cpp b/src/network/ssl/qssldiffiehellmanparameters_openssl.cpp
index 5ebad822f1..00e9be91d8 100644
--- a/src/network/ssl/qssldiffiehellmanparameters_openssl.cpp
+++ b/src/network/ssl/qssldiffiehellmanparameters_openssl.cpp
@@ -161,12 +161,12 @@ void QSslDiffieHellmanParametersPrivate::decodePem(const QByteArray &pem)
return;
}
- DH *dh = Q_NULLPTR;
+ DH *dh = nullptr;
q_PEM_read_bio_DHparams(bio, &dh, 0, 0);
if (dh) {
if (isSafeDH(dh)) {
- char *buf = Q_NULLPTR;
+ char *buf = nullptr;
int len = q_i2d_DHparams(dh, reinterpret_cast<unsigned char **>(&buf));
if (len > 0)
derData = QByteArray(buf, len);
diff --git a/src/network/ssl/qsslkey_qt.cpp b/src/network/ssl/qsslkey_qt.cpp
index 3c5dc830d3..817317f303 100644
--- a/src/network/ssl/qsslkey_qt.cpp
+++ b/src/network/ssl/qsslkey_qt.cpp
@@ -43,6 +43,7 @@
#include <QtCore/qdatastream.h>
#include <QtCore/qcryptographichash.h>
+#include <QtCore/qrandom.h>
QT_USE_NAMESPACE
@@ -286,10 +287,8 @@ QByteArray QSslKeyPrivate::toPem(const QByteArray &passPhrase) const
if (type == QSsl::PrivateKey && !passPhrase.isEmpty()) {
// ### use a cryptographically secure random number generator
- QByteArray iv;
- iv.resize(8);
- for (int i = 0; i < iv.size(); ++i)
- iv[i] = (qrand() & 0xff);
+ quint64 random = QRandomGenerator::system()->generate64();
+ QByteArray iv = QByteArray::fromRawData(reinterpret_cast<const char *>(&random), sizeof(random));
Cipher cipher = DesEde3Cbc;
const QByteArray key = deriveKey(cipher, passPhrase, iv);
diff --git a/src/network/ssl/qsslsocket.cpp b/src/network/ssl/qsslsocket.cpp
index adff568f5b..145ae1a3c8 100644
--- a/src/network/ssl/qsslsocket.cpp
+++ b/src/network/ssl/qsslsocket.cpp
@@ -2659,6 +2659,20 @@ QByteArray QSslSocketPrivate::peek(qint64 maxSize)
/*!
\internal
*/
+qint64 QSslSocketPrivate::skip(qint64 maxSize)
+{
+ if (mode == QSslSocket::UnencryptedMode && !autoStartHandshake)
+ return plainSocket->skip(maxSize);
+
+ // In encrypted mode, the SSL backend writes decrypted data directly into the
+ // QIODevice's read buffer. As this buffer is always emptied by the caller,
+ // we need to wait for more incoming data.
+ return (state == QAbstractSocket::ConnectedState) ? Q_INT64_C(0) : Q_INT64_C(-1);
+}
+
+/*!
+ \internal
+*/
bool QSslSocketPrivate::flush()
{
#ifdef QSSLSOCKET_DEBUG
diff --git a/src/network/ssl/qsslsocket.h b/src/network/ssl/qsslsocket.h
index 39e70bccda..c66ebdde54 100644
--- a/src/network/ssl/qsslsocket.h
+++ b/src/network/ssl/qsslsocket.h
@@ -79,22 +79,22 @@ public:
AutoVerifyPeer
};
- explicit QSslSocket(QObject *parent = Q_NULLPTR);
+ explicit QSslSocket(QObject *parent = nullptr);
~QSslSocket();
- void resume() Q_DECL_OVERRIDE; // to continue after proxy authentication required, SSL errors etc.
+ void resume() override; // to continue after proxy authentication required, SSL errors etc.
// Autostarting the SSL client handshake.
void connectToHostEncrypted(const QString &hostName, quint16 port, OpenMode mode = ReadWrite, NetworkLayerProtocol protocol = AnyIPProtocol);
void connectToHostEncrypted(const QString &hostName, quint16 port, const QString &sslPeerName, OpenMode mode = ReadWrite, NetworkLayerProtocol protocol = AnyIPProtocol);
bool setSocketDescriptor(qintptr socketDescriptor, SocketState state = ConnectedState,
- OpenMode openMode = ReadWrite) Q_DECL_OVERRIDE;
+ OpenMode openMode = ReadWrite) override;
using QAbstractSocket::connectToHost;
- void connectToHost(const QString &hostName, quint16 port, OpenMode openMode = ReadWrite, NetworkLayerProtocol protocol = AnyIPProtocol) Q_DECL_OVERRIDE;
- void disconnectFromHost() Q_DECL_OVERRIDE;
+ void connectToHost(const QString &hostName, quint16 port, OpenMode openMode = ReadWrite, NetworkLayerProtocol protocol = AnyIPProtocol) override;
+ void disconnectFromHost() override;
- virtual void setSocketOption(QAbstractSocket::SocketOption option, const QVariant &value) Q_DECL_OVERRIDE;
- virtual QVariant socketOption(QAbstractSocket::SocketOption option) Q_DECL_OVERRIDE;
+ virtual void setSocketOption(QAbstractSocket::SocketOption option, const QVariant &value) override;
+ virtual QVariant socketOption(QAbstractSocket::SocketOption option) override;
SslMode mode() const;
bool isEncrypted() const;
@@ -112,16 +112,16 @@ public:
void setPeerVerifyName(const QString &hostName);
// From QIODevice
- qint64 bytesAvailable() const Q_DECL_OVERRIDE;
- qint64 bytesToWrite() const Q_DECL_OVERRIDE;
- bool canReadLine() const Q_DECL_OVERRIDE;
- void close() Q_DECL_OVERRIDE;
- bool atEnd() const Q_DECL_OVERRIDE;
+ qint64 bytesAvailable() const override;
+ qint64 bytesToWrite() const override;
+ bool canReadLine() const override;
+ void close() override;
+ bool atEnd() const override;
bool flush(); // ### Qt6: remove me (implementation moved to private flush())
void abort();
// From QAbstractSocket:
- void setReadBufferSize(qint64 size) Q_DECL_OVERRIDE;
+ void setReadBufferSize(qint64 size) override;
// Similar to QIODevice's:
qint64 encryptedBytesAvailable() const;
@@ -179,11 +179,11 @@ public:
QT_DEPRECATED_X("Use QSslConfiguration::systemCaCertificates()") static QList<QSslCertificate> systemCaCertificates();
#endif // QT_DEPRECATED_SINCE(5, 5)
- bool waitForConnected(int msecs = 30000) Q_DECL_OVERRIDE;
+ bool waitForConnected(int msecs = 30000) override;
bool waitForEncrypted(int msecs = 30000);
- bool waitForReadyRead(int msecs = 30000) Q_DECL_OVERRIDE;
- bool waitForBytesWritten(int msecs = 30000) Q_DECL_OVERRIDE;
- bool waitForDisconnected(int msecs = 30000) Q_DECL_OVERRIDE;
+ bool waitForReadyRead(int msecs = 30000) override;
+ bool waitForBytesWritten(int msecs = 30000) override;
+ bool waitForDisconnected(int msecs = 30000) override;
QList<QSslError> sslErrors() const;
@@ -209,8 +209,8 @@ Q_SIGNALS:
void preSharedKeyAuthenticationRequired(QSslPreSharedKeyAuthenticator *authenticator);
protected:
- qint64 readData(char *data, qint64 maxlen) Q_DECL_OVERRIDE;
- qint64 writeData(const char *data, qint64 len) Q_DECL_OVERRIDE;
+ qint64 readData(char *data, qint64 maxlen) override;
+ qint64 writeData(const char *data, qint64 len) override;
private:
Q_DECLARE_PRIVATE(QSslSocket)
diff --git a/src/network/ssl/qsslsocket_mac.cpp b/src/network/ssl/qsslsocket_mac.cpp
index 8d2efe74be..5c2bd55198 100644
--- a/src/network/ssl/qsslsocket_mac.cpp
+++ b/src/network/ssl/qsslsocket_mac.cpp
@@ -48,6 +48,7 @@
#include <QtCore/qmessageauthenticationcode.h>
#include <QtCore/qcryptographichash.h>
+#include <QtCore/qsystemdetection.h>
#include <QtCore/qdatastream.h>
#include <QtCore/qsysinfo.h>
#include <QtCore/qvector.h>
@@ -160,14 +161,15 @@ EphemeralSecKeychain::~EphemeralSecKeychain()
}
#endif // Q_OS_MACOS
-}
+
+} // unnamed namespace
static SSLContextRef qt_createSecureTransportContext(QSslSocket::SslMode mode)
{
const bool isServer = mode == QSslSocket::SslServerMode;
const SSLProtocolSide side = isServer ? kSSLServerSide : kSSLClientSide;
// We never use kSSLDatagramType, so it's kSSLStreamType unconditionally.
- SSLContextRef context = SSLCreateContext(Q_NULLPTR, side, kSSLStreamType);
+ SSLContextRef context = SSLCreateContext(nullptr, side, kSSLStreamType);
if (!context)
qCWarning(lcSsl) << "SSLCreateContext failed";
return context;
@@ -356,7 +358,7 @@ void QSslSocketPrivate::resetDefaultEllipticCurves()
}
QSslSocketBackendPrivate::QSslSocketBackendPrivate()
- : context(Q_NULLPTR)
+ : context(nullptr)
{
}
@@ -372,6 +374,43 @@ void QSslSocketBackendPrivate::continueHandshake()
#endif
Q_Q(QSslSocket);
connectionEncrypted = true;
+
+#if QT_DARWIN_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_NA, __IPHONE_11_0, __TVOS_11_0, __WATCHOS_4_0)
+ // Unlike OpenSSL, Secure Transport does not allow to negotiate protocols via
+ // a callback during handshake. We can only set our list of preferred protocols
+ // (and send it during handshake) and then receive what our peer has sent to us.
+ // And here we can finally try to find a match (if any).
+ if (__builtin_available(iOS 11.0, tvOS 11.0, watchOS 4.0, *)) {
+ const auto &requestedProtocols = configuration.nextAllowedProtocols;
+ if (const int requestedCount = requestedProtocols.size()) {
+ configuration.nextProtocolNegotiationStatus = QSslConfiguration::NextProtocolNegotiationNone;
+ configuration.nextNegotiatedProtocol.clear();
+
+ QCFType<CFArrayRef> cfArray;
+ const OSStatus result = SSLCopyALPNProtocols(context, &cfArray);
+ if (result == errSecSuccess && cfArray && CFArrayGetCount(cfArray)) {
+ const int size = CFArrayGetCount(cfArray);
+ QVector<QString> peerProtocols(size);
+ for (int i = 0; i < size; ++i)
+ peerProtocols[i] = QString::fromCFString((CFStringRef)CFArrayGetValueAtIndex(cfArray, i));
+
+ for (int i = 0; i < requestedCount; ++i) {
+ const auto requestedName = QString::fromLatin1(requestedProtocols[i]);
+ for (int j = 0; j < size; ++j) {
+ if (requestedName == peerProtocols[j]) {
+ configuration.nextNegotiatedProtocol = requestedName.toLatin1();
+ configuration.nextProtocolNegotiationStatus = QSslConfiguration::NextProtocolNegotiationNegotiated;
+ break;
+ }
+ }
+ if (configuration.nextProtocolNegotiationStatus == QSslConfiguration::NextProtocolNegotiationNegotiated)
+ break;
+ }
+ }
+ }
+ }
+#endif // QT_DARWIN_PLATFORM_SDK_EQUAL_OR_ABOVE
+
emit q->encrypted();
if (autoStartHandshake && pendingClose) {
pendingClose = false;
@@ -838,6 +877,29 @@ bool QSslSocketBackendPrivate::initSslContext()
return false;
}
+#if QT_DARWIN_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_NA, __IPHONE_11_0, __TVOS_11_0, __WATCHOS_4_0)
+ if (__builtin_available(iOS 11.0, tvOS 11.0, watchOS 4.0, *)) {
+ const auto protocolNames = configuration.nextAllowedProtocols;
+ QCFType<CFMutableArrayRef> cfNames(CFArrayCreateMutable(nullptr, 0, &kCFTypeArrayCallBacks));
+ if (cfNames) {
+ for (const QByteArray &name : protocolNames) {
+ QCFString cfName(QString::fromLatin1(name).toCFString());
+ CFArrayAppendValue(cfNames, cfName);
+ }
+
+ if (CFArrayGetCount(cfNames)) {
+ // Up to the application layer to check that negotiation
+ // failed, and handle this non-TLS error, we do not handle
+ // the result of this call as an error:
+ if (SSLSetALPNProtocols(context, cfNames) != errSecSuccess)
+ qCWarning(lcSsl) << "SSLSetALPNProtocols failed - too long protocol names?";
+ }
+ } else {
+ qCWarning(lcSsl) << "failed to allocate ALPN names array";
+ }
+ }
+#endif // QT_DARWIN_PLATFORM_SDK_EQUAL_OR_ABOVE
+
if (mode == QSslSocket::SslClientMode) {
// enable Server Name Indication (SNI)
QString tlsHostName(verificationPeerName.isEmpty() ? q->peerName() : verificationPeerName);
@@ -885,7 +947,7 @@ bool QSslSocketBackendPrivate::initSslContext()
void QSslSocketBackendPrivate::destroySslContext()
{
- context.reset(Q_NULLPTR);
+ context.reset(nullptr);
}
static QByteArray _q_makePkcs12(const QList<QSslCertificate> &certs, const QSslKey &key, const QString &passPhrase);
diff --git a/src/network/ssl/qsslsocket_mac_p.h b/src/network/ssl/qsslsocket_mac_p.h
index 9e1d18981e..34e30ebb16 100644
--- a/src/network/ssl/qsslsocket_mac_p.h
+++ b/src/network/ssl/qsslsocket_mac_p.h
@@ -86,14 +86,14 @@ public:
virtual ~QSslSocketBackendPrivate();
// Final-overriders (QSslSocketPrivate):
- void continueHandshake() Q_DECL_OVERRIDE;
- void disconnected() Q_DECL_OVERRIDE;
- void disconnectFromHost() Q_DECL_OVERRIDE;
- QSslCipher sessionCipher() const Q_DECL_OVERRIDE;
- QSsl::SslProtocol sessionProtocol() const Q_DECL_OVERRIDE;
- void startClientEncryption() Q_DECL_OVERRIDE;
- void startServerEncryption() Q_DECL_OVERRIDE;
- void transmit() Q_DECL_OVERRIDE;
+ void continueHandshake() override;
+ void disconnected() override;
+ void disconnectFromHost() override;
+ QSslCipher sessionCipher() const override;
+ QSsl::SslProtocol sessionProtocol() const override;
+ void startClientEncryption() override;
+ void startServerEncryption() override;
+ void transmit() override;
static QList<QSslError> verify(QList<QSslCertificate> certificateChain,
const QString &hostName);
diff --git a/src/network/ssl/qsslsocket_openssl_p.h b/src/network/ssl/qsslsocket_openssl_p.h
index 7f9e884045..2a800cdc34 100644
--- a/src/network/ssl/qsslsocket_openssl_p.h
+++ b/src/network/ssl/qsslsocket_openssl_p.h
@@ -132,22 +132,22 @@ public:
#endif
// Platform specific functions
- void startClientEncryption() Q_DECL_OVERRIDE;
- void startServerEncryption() Q_DECL_OVERRIDE;
- void transmit() Q_DECL_OVERRIDE;
+ void startClientEncryption() override;
+ void startServerEncryption() override;
+ void transmit() override;
bool startHandshake();
- void disconnectFromHost() Q_DECL_OVERRIDE;
- void disconnected() Q_DECL_OVERRIDE;
- QSslCipher sessionCipher() const Q_DECL_OVERRIDE;
- QSsl::SslProtocol sessionProtocol() const Q_DECL_OVERRIDE;
- void continueHandshake() Q_DECL_OVERRIDE;
+ void disconnectFromHost() override;
+ void disconnected() override;
+ QSslCipher sessionCipher() const override;
+ QSsl::SslProtocol sessionProtocol() const override;
+ void continueHandshake() override;
bool checkSslErrors();
void storePeerCertificates();
unsigned int tlsPskClientCallback(const char *hint, char *identity, unsigned int max_identity_len, unsigned char *psk, unsigned int max_psk_len);
unsigned int tlsPskServerCallback(const char *identity, unsigned char *psk, unsigned int max_psk_len);
#ifdef Q_OS_WIN
void fetchCaRootForCert(const QSslCertificate &cert);
- void _q_caRootLoaded(QSslCertificate,QSslCertificate) Q_DECL_OVERRIDE;
+ void _q_caRootLoaded(QSslCertificate,QSslCertificate) override;
#endif
Q_AUTOTEST_EXPORT static long setupOpenSslOptions(QSsl::SslProtocol protocol, QSsl::SslOptions sslOptions);
diff --git a/src/network/ssl/qsslsocket_openssl_symbols.cpp b/src/network/ssl/qsslsocket_openssl_symbols.cpp
index 3a236a1300..1b73135935 100644
--- a/src/network/ssl/qsslsocket_openssl_symbols.cpp
+++ b/src/network/ssl/qsslsocket_openssl_symbols.cpp
@@ -1017,7 +1017,7 @@ bool q_resolveOpenSslSymbols()
RESOLVEFUNC(EC_GROUP_get_degree)
#endif
RESOLVEFUNC(BN_num_bits)
-#if OPENSSL_VERSION_NUMBER >= 0x10100000L
+#if QT_CONFIG(opensslv11)
RESOLVEFUNC(BN_is_word)
#endif
RESOLVEFUNC(BN_mod_word)
diff --git a/src/network/ssl/qsslsocket_openssl_symbols_p.h b/src/network/ssl/qsslsocket_openssl_symbols_p.h
index 796bf2d4f5..4cad0231cd 100644
--- a/src/network/ssl/qsslsocket_openssl_symbols_p.h
+++ b/src/network/ssl/qsslsocket_openssl_symbols_p.h
@@ -232,9 +232,10 @@ BIO *q_BIO_new_mem_buf(void *a, int b);
int q_BIO_read(BIO *a, void *b, int c);
Q_AUTOTEST_EXPORT int q_BIO_write(BIO *a, const void *b, int c);
int q_BN_num_bits(const BIGNUM *a);
-#if OPENSSL_VERSION_NUMBER >= 0x10100000L
+
+#if QT_CONFIG(opensslv11)
int q_BN_is_word(BIGNUM *a, BN_ULONG w);
-#else
+#else // opensslv11
// BN_is_word is implemented purely as a
// macro in OpenSSL < 1.1. It doesn't
// call any functions.
@@ -245,7 +246,8 @@ int q_BN_is_word(BIGNUM *a, BN_ULONG w);
//
// Users are required to include <openssl/bn.h>.
#define q_BN_is_word BN_is_word
-#endif // OPENSSL_VERSION_NUMBER >= 0x10100000L
+#endif // !opensslv11
+
BN_ULONG q_BN_mod_word(const BIGNUM *a, BN_ULONG w);
#ifndef OPENSSL_NO_EC
const EC_GROUP* q_EC_KEY_get0_group(const EC_KEY* k);
diff --git a/src/network/ssl/qsslsocket_opensslpre11.cpp b/src/network/ssl/qsslsocket_opensslpre11.cpp
index e51888c5f2..8ad4d5b521 100644
--- a/src/network/ssl/qsslsocket_opensslpre11.cpp
+++ b/src/network/ssl/qsslsocket_opensslpre11.cpp
@@ -290,8 +290,7 @@ void QSslSocketPrivate::ensureCiphersAndCertsLoaded()
//its own cert bundle rather than the system one.
//Same logic that disables the unix on demand cert loading.
//Unlike unix, we do preload the certificates from the cert store.
- if ((QSysInfo::windowsVersion() & QSysInfo::WV_NT_based) >= QSysInfo::WV_6_0)
- s_loadRootCertsOnDemand = true;
+ s_loadRootCertsOnDemand = true;
#endif
}
diff --git a/src/network/ssl/qsslsocket_p.h b/src/network/ssl/qsslsocket_p.h
index 00fda43b7e..ced861805b 100644
--- a/src/network/ssl/qsslsocket_p.h
+++ b/src/network/ssl/qsslsocket_p.h
@@ -170,7 +170,7 @@ public:
static void checkSettingSslContext(QSslSocket*, QSharedPointer<QSslContext>);
static QSharedPointer<QSslContext> sslContext(QSslSocket *socket);
bool isPaused() const;
- bool bind(const QHostAddress &address, quint16, QAbstractSocket::BindMode) Q_DECL_OVERRIDE;
+ bool bind(const QHostAddress &address, quint16, QAbstractSocket::BindMode) override;
void _q_connectedSlot();
void _q_hostFoundSlot();
void _q_disconnectedSlot();
@@ -190,9 +190,10 @@ public:
static QList<QByteArray> unixRootCertDirectories(); // used also by QSslContext
- virtual qint64 peek(char *data, qint64 maxSize) Q_DECL_OVERRIDE;
- virtual QByteArray peek(qint64 maxSize) Q_DECL_OVERRIDE;
- bool flush() Q_DECL_OVERRIDE;
+ virtual qint64 peek(char *data, qint64 maxSize) override;
+ virtual QByteArray peek(qint64 maxSize) override;
+ qint64 skip(qint64 maxSize) override;
+ bool flush() override;
// Platform specific functions
virtual void startClientEncryption() = 0;
diff --git a/src/network/ssl/qsslsocket_winrt.cpp b/src/network/ssl/qsslsocket_winrt.cpp
index ca65f8a015..6c5a09962b 100644
--- a/src/network/ssl/qsslsocket_winrt.cpp
+++ b/src/network/ssl/qsslsocket_winrt.cpp
@@ -518,7 +518,7 @@ HRESULT QSslSocketBackendPrivate::onSslUpgrade(IAsyncAction *action, AsyncStatus
QList<QSslCertificate> peerCertificateChain;
if (certificate) {
ComPtr<IAsyncOperation<CertificateChain *>> op;
- hr = certificate->BuildChainAsync(Q_NULLPTR, &op);
+ hr = certificate->BuildChainAsync(nullptr, &op);
Q_ASSERT_SUCCEEDED(hr);
ComPtr<ICertificateChain> certificateChain;
hr = QWinRTFunctions::await(op, certificateChain.GetAddressOf());
diff --git a/src/network/ssl/qsslsocket_winrt_p.h b/src/network/ssl/qsslsocket_winrt_p.h
index 1043aeee11..030db6d4fa 100644
--- a/src/network/ssl/qsslsocket_winrt_p.h
+++ b/src/network/ssl/qsslsocket_winrt_p.h
@@ -80,14 +80,14 @@ public:
~QSslSocketBackendPrivate();
// Platform specific functions
- void startClientEncryption() Q_DECL_OVERRIDE;
- void startServerEncryption() Q_DECL_OVERRIDE;
- void transmit() Q_DECL_OVERRIDE;
- void disconnectFromHost() Q_DECL_OVERRIDE;
- void disconnected() Q_DECL_OVERRIDE;
- QSslCipher sessionCipher() const Q_DECL_OVERRIDE;
- QSsl::SslProtocol sessionProtocol() const Q_DECL_OVERRIDE;
- void continueHandshake() Q_DECL_OVERRIDE;
+ void startClientEncryption() override;
+ void startServerEncryption() override;
+ void transmit() override;
+ void disconnectFromHost() override;
+ void disconnected() override;
+ QSslCipher sessionCipher() const override;
+ QSsl::SslProtocol sessionProtocol() const override;
+ void continueHandshake() override;
static QList<QSslCipher> defaultCiphers();
static QList<QSslError> verify(const QList<QSslCertificate> &certificateChain, const QString &hostName);
diff --git a/src/opengl/gl2paintengineex/qglengineshadermanager.cpp b/src/opengl/gl2paintengineex/qglengineshadermanager.cpp
index ec673e8726..47e8531959 100644
--- a/src/opengl/gl2paintengineex/qglengineshadermanager.cpp
+++ b/src/opengl/gl2paintengineex/qglengineshadermanager.cpp
@@ -68,13 +68,13 @@ public:
delete m_shaders;
}
- void invalidateResource() Q_DECL_OVERRIDE
+ void invalidateResource() override
{
delete m_shaders;
m_shaders = 0;
}
- void freeResource(QOpenGLContext *) Q_DECL_OVERRIDE
+ void freeResource(QOpenGLContext *) override
{
}
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
index 0f96732278..d1ed621790 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
@@ -108,37 +108,37 @@ public:
QGL2PaintEngineEx();
~QGL2PaintEngineEx();
- bool begin(QPaintDevice *device) Q_DECL_OVERRIDE;
+ bool begin(QPaintDevice *device) override;
void ensureActive();
- bool end() Q_DECL_OVERRIDE;
-
- virtual void clipEnabledChanged() Q_DECL_OVERRIDE;
- virtual void penChanged() Q_DECL_OVERRIDE;
- virtual void brushChanged() Q_DECL_OVERRIDE;
- virtual void brushOriginChanged() Q_DECL_OVERRIDE;
- virtual void opacityChanged() Q_DECL_OVERRIDE;
- virtual void compositionModeChanged() Q_DECL_OVERRIDE;
- virtual void renderHintsChanged() Q_DECL_OVERRIDE;
- virtual void transformChanged() Q_DECL_OVERRIDE;
-
- virtual void drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr) Q_DECL_OVERRIDE;
+ bool end() override;
+
+ virtual void clipEnabledChanged() override;
+ virtual void penChanged() override;
+ virtual void brushChanged() override;
+ virtual void brushOriginChanged() override;
+ virtual void opacityChanged() override;
+ virtual void compositionModeChanged() override;
+ virtual void renderHintsChanged() override;
+ virtual void transformChanged() override;
+
+ virtual void drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr) override;
virtual void drawPixmapFragments(const QPainter::PixmapFragment *fragments, int fragmentCount, const QPixmap &pixmap,
- QPainter::PixmapFragmentHints hints) Q_DECL_OVERRIDE;
+ QPainter::PixmapFragmentHints hints) override;
virtual void drawImage(const QRectF &r, const QImage &pm, const QRectF &sr,
- Qt::ImageConversionFlags flags = Qt::AutoColor) Q_DECL_OVERRIDE;
- virtual void drawTextItem(const QPointF &p, const QTextItem &textItem) Q_DECL_OVERRIDE;
- virtual void fill(const QVectorPath &path, const QBrush &brush) Q_DECL_OVERRIDE;
- virtual void stroke(const QVectorPath &path, const QPen &pen) Q_DECL_OVERRIDE;
- virtual void clip(const QVectorPath &path, Qt::ClipOperation op) Q_DECL_OVERRIDE;
+ Qt::ImageConversionFlags flags = Qt::AutoColor) override;
+ virtual void drawTextItem(const QPointF &p, const QTextItem &textItem) override;
+ virtual void fill(const QVectorPath &path, const QBrush &brush) override;
+ virtual void stroke(const QVectorPath &path, const QPen &pen) override;
+ virtual void clip(const QVectorPath &path, Qt::ClipOperation op) override;
- virtual void drawStaticTextItem(QStaticTextItem *textItem) Q_DECL_OVERRIDE;
+ virtual void drawStaticTextItem(QStaticTextItem *textItem) override;
bool drawTexture(const QRectF &r, GLuint textureId, const QSize &size, const QRectF &sr);
- Type type() const Q_DECL_OVERRIDE { return OpenGL2; }
+ Type type() const override { return OpenGL2; }
- virtual void setState(QPainterState *s) Q_DECL_OVERRIDE;
- virtual QPainterState *createState(QPainterState *orig) const Q_DECL_OVERRIDE;
+ virtual void setState(QPainterState *s) override;
+ virtual QPainterState *createState(QPainterState *orig) const override;
inline QGL2PaintEngineState *state() {
return static_cast<QGL2PaintEngineState *>(QPaintEngineEx::state());
}
@@ -146,16 +146,16 @@ public:
return static_cast<const QGL2PaintEngineState *>(QPaintEngineEx::state());
}
- void beginNativePainting() Q_DECL_OVERRIDE;
- void endNativePainting() Q_DECL_OVERRIDE;
+ void beginNativePainting() override;
+ void endNativePainting() override;
void invalidateState();
void setRenderTextActive(bool);
bool isNativePaintingActive() const;
- bool requiresPretransformedGlyphPositions(QFontEngine *, const QTransform &) const Q_DECL_OVERRIDE { return false; }
- bool shouldDrawCachedGlyphs(QFontEngine *, const QTransform &) const Q_DECL_OVERRIDE;
+ bool requiresPretransformedGlyphPositions(QFontEngine *, const QTransform &) const override { return false; }
+ bool shouldDrawCachedGlyphs(QFontEngine *, const QTransform &) const override;
void setTranslateZ(GLfloat z);
@@ -244,7 +244,7 @@ public:
void updateClipScissorTest();
void setScissor(const QRect &rect);
void regenerateClip();
- void systemStateChanged() Q_DECL_OVERRIDE;
+ void systemStateChanged() override;
static QGLEngineShaderManager* shaderManagerForEngine(QGL2PaintEngineEx *engine) { return engine->d_func()->shaderManager; }
diff --git a/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h b/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h
index 95401d10c1..e76216ef5d 100644
--- a/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h
+++ b/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h
@@ -79,7 +79,7 @@ struct QGLGlyphTexture : public QOpenGLSharedResource
#endif
}
- void freeResource(QOpenGLContext *context) Q_DECL_OVERRIDE
+ void freeResource(QOpenGLContext *context) override
{
const QGLContext *ctx = QGLContext::fromOpenGLContext(context);
#ifdef QT_GL_TEXTURE_GLYPH_CACHE_DEBUG
@@ -93,7 +93,7 @@ struct QGLGlyphTexture : public QOpenGLSharedResource
ctx->contextHandle()->functions()->glDeleteTextures(1, &m_texture);
}
- void invalidateResource() Q_DECL_OVERRIDE
+ void invalidateResource() override
{
m_texture = 0;
m_fbo = 0;
@@ -113,12 +113,12 @@ public:
QGLTextureGlyphCache(QFontEngine::GlyphFormat format, const QTransform &matrix);
~QGLTextureGlyphCache();
- virtual void createTextureData(int width, int height) Q_DECL_OVERRIDE;
- virtual void resizeTextureData(int width, int height) Q_DECL_OVERRIDE;
- virtual void fillTexture(const Coord &c, glyph_t glyph, QFixed subPixelPosition) Q_DECL_OVERRIDE;
- virtual int glyphPadding() const Q_DECL_OVERRIDE;
- virtual int maxTextureWidth() const Q_DECL_OVERRIDE;
- virtual int maxTextureHeight() const Q_DECL_OVERRIDE;
+ virtual void createTextureData(int width, int height) override;
+ virtual void resizeTextureData(int width, int height) override;
+ virtual void fillTexture(const Coord &c, glyph_t glyph, QFixed subPixelPosition) override;
+ virtual int glyphPadding() const override;
+ virtual int maxTextureWidth() const override;
+ virtual int maxTextureHeight() const override;
inline GLuint texture() const {
QGLTextureGlyphCache *that = const_cast<QGLTextureGlyphCache *>(this);
diff --git a/src/opengl/opengl.pro b/src/opengl/opengl.pro
index 016db46405..077b190d3e 100644
--- a/src/opengl/opengl.pro
+++ b/src/opengl/opengl.pro
@@ -5,7 +5,6 @@ DEFINES += QT_NO_USING_NAMESPACE QT_NO_FOREACH
win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x63000000
solaris-cc*:QMAKE_CXXFLAGS_RELEASE -= -O2
-irix-cc*:QMAKE_CXXFLAGS += -no_prelink -ptused
QMAKE_DOCS = $$PWD/doc/qtopengl.qdocconf
diff --git a/src/opengl/qgl.h b/src/opengl/qgl.h
index ab418c191a..902a2a2104 100644
--- a/src/opengl/qgl.h
+++ b/src/opengl/qgl.h
@@ -250,7 +250,7 @@ public:
QGLContext(const QGLFormat& format);
virtual ~QGLContext();
- virtual bool create(const QGLContext* shareContext = Q_NULLPTR);
+ virtual bool create(const QGLContext* shareContext = nullptr);
bool isValid() const;
bool isSharing() const;
void reset();
@@ -318,7 +318,7 @@ public:
QOpenGLContext *contextHandle() const;
protected:
- virtual bool chooseContext(const QGLContext* shareContext = Q_NULLPTR);
+ virtual bool chooseContext(const QGLContext* shareContext = nullptr);
bool deviceIsPixmap() const;
bool windowCreated() const;
@@ -371,12 +371,12 @@ class Q_OPENGL_EXPORT QGLWidget : public QWidget
Q_OBJECT
Q_DECLARE_PRIVATE(QGLWidget)
public:
- explicit QGLWidget(QWidget* parent=Q_NULLPTR,
- const QGLWidget* shareWidget = Q_NULLPTR, Qt::WindowFlags f=Qt::WindowFlags());
- explicit QGLWidget(QGLContext *context, QWidget* parent=Q_NULLPTR,
- const QGLWidget* shareWidget = Q_NULLPTR, Qt::WindowFlags f=Qt::WindowFlags());
- explicit QGLWidget(const QGLFormat& format, QWidget* parent=Q_NULLPTR,
- const QGLWidget* shareWidget = Q_NULLPTR, Qt::WindowFlags f=Qt::WindowFlags());
+ explicit QGLWidget(QWidget* parent=nullptr,
+ const QGLWidget* shareWidget = nullptr, Qt::WindowFlags f=Qt::WindowFlags());
+ explicit QGLWidget(QGLContext *context, QWidget* parent=nullptr,
+ const QGLWidget* shareWidget = nullptr, Qt::WindowFlags f=Qt::WindowFlags());
+ explicit QGLWidget(const QGLFormat& format, QWidget* parent=nullptr,
+ const QGLWidget* shareWidget = nullptr, Qt::WindowFlags f=Qt::WindowFlags());
~QGLWidget();
void qglColor(const QColor& c) const;
@@ -395,7 +395,7 @@ public:
void setFormat(const QGLFormat& format);
QGLContext* context() const;
- void setContext(QGLContext* context, const QGLContext* shareContext = Q_NULLPTR,
+ void setContext(QGLContext* context, const QGLContext* shareContext = nullptr,
bool deleteOldContext = true);
QPixmap renderPixmap(int w = 0, int h = 0, bool useContext = false);
@@ -413,7 +413,7 @@ public:
const QFont & fnt = QFont());
void renderText(double x, double y, double z, const QString & str,
const QFont & fnt = QFont());
- QPaintEngine *paintEngine() const Q_DECL_OVERRIDE;
+ QPaintEngine *paintEngine() const override;
GLuint bindTexture(const QImage &image, GLenum target, GLint format,
QGLContext::BindOptions options);
@@ -437,7 +437,7 @@ public Q_SLOTS:
virtual void updateOverlayGL();
protected:
- bool event(QEvent *) Q_DECL_OVERRIDE;
+ bool event(QEvent *) override;
virtual void initializeGL();
virtual void resizeGL(int w, int h);
virtual void paintGL();
@@ -449,16 +449,16 @@ protected:
void setAutoBufferSwap(bool on);
bool autoBufferSwap() const;
- void paintEvent(QPaintEvent*) Q_DECL_OVERRIDE;
- void resizeEvent(QResizeEvent*) Q_DECL_OVERRIDE;
+ void paintEvent(QPaintEvent*) override;
+ void resizeEvent(QResizeEvent*) override;
virtual void glInit();
virtual void glDraw();
QGLWidget(QGLWidgetPrivate &dd,
const QGLFormat &format = QGLFormat(),
- QWidget *parent = Q_NULLPTR,
- const QGLWidget* shareWidget = Q_NULLPTR,
+ QWidget *parent = nullptr,
+ const QGLWidget* shareWidget = nullptr,
Qt::WindowFlags f = Qt::WindowFlags());
private:
Q_DISABLE_COPY(QGLWidget)
diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h
index 9ab5cd36a2..6b4d83888f 100644
--- a/src/opengl/qgl_p.h
+++ b/src/opengl/qgl_p.h
@@ -140,7 +140,7 @@ public:
void initContext(QGLContext *context, const QGLWidget* shareWidget);
bool renderCxPm(QPixmap *pixmap);
void cleanupColormaps();
- void aboutToDestroy() Q_DECL_OVERRIDE {
+ void aboutToDestroy() override {
if (glcx && !parent_changing)
glcx->reset();
}
@@ -488,12 +488,12 @@ public:
}
protected:
- void invalidateResource() Q_DECL_OVERRIDE
+ void invalidateResource() override
{
m_id = 0;
}
- void freeResource(QOpenGLContext *context) Q_DECL_OVERRIDE
+ void freeResource(QOpenGLContext *context) override
{
if (m_id) {
freeResource(QGLContext::fromOpenGLContext(context), m_id);
@@ -517,7 +517,7 @@ public:
}
protected:
- void freeResource(QGLContext *ctx, GLuint id) Q_DECL_OVERRIDE
+ void freeResource(QGLContext *ctx, GLuint id) override
{
m_func(ctx, id);
}
diff --git a/src/opengl/qglbuffer.h b/src/opengl/qglbuffer.h
index 454036a938..daf5227c66 100644
--- a/src/opengl/qglbuffer.h
+++ b/src/opengl/qglbuffer.h
@@ -109,7 +109,7 @@ public:
void write(int offset, const void *data, int count);
void allocate(const void *data, int count);
- inline void allocate(int count) { allocate(Q_NULLPTR, count); }
+ inline void allocate(int count) { allocate(nullptr, count); }
void *map(QGLBuffer::Access access);
bool unmap();
diff --git a/src/opengl/qglcolormap.h b/src/opengl/qglcolormap.h
index 199ed82534..772e327e34 100644
--- a/src/opengl/qglcolormap.h
+++ b/src/opengl/qglcolormap.h
@@ -69,7 +69,7 @@ public:
int findNearest(QRgb color) const;
protected:
- Qt::HANDLE handle() { return d ? d->cmapHandle : Q_NULLPTR; }
+ Qt::HANDLE handle() { return d ? d->cmapHandle : nullptr; }
void setHandle(Qt::HANDLE ahandle) { d->cmapHandle = ahandle; }
private:
diff --git a/src/opengl/qglframebufferobject.h b/src/opengl/qglframebufferobject.h
index f4b6d1ddc1..c88063cbb5 100644
--- a/src/opengl/qglframebufferobject.h
+++ b/src/opengl/qglframebufferobject.h
@@ -84,7 +84,7 @@ public:
QImage toImage() const;
Attachment attachment() const;
- QPaintEngine *paintEngine() const Q_DECL_OVERRIDE;
+ QPaintEngine *paintEngine() const override;
GLuint handle() const;
static bool bindDefault();
@@ -101,8 +101,8 @@ public:
GLenum filter = GL_NEAREST);
protected:
- int metric(PaintDeviceMetric metric) const Q_DECL_OVERRIDE;
- int devType() const Q_DECL_OVERRIDE { return QInternal::FramebufferObject; }
+ int metric(PaintDeviceMetric metric) const override;
+ int devType() const override { return QInternal::FramebufferObject; }
private:
Q_DISABLE_COPY(QGLFramebufferObject)
diff --git a/src/opengl/qglframebufferobject_p.h b/src/opengl/qglframebufferobject_p.h
index d3af1fdbaa..bf5e21cf0b 100644
--- a/src/opengl/qglframebufferobject_p.h
+++ b/src/opengl/qglframebufferobject_p.h
@@ -106,11 +106,11 @@ public:
class QGLFBOGLPaintDevice : public QGLPaintDevice
{
public:
- virtual QPaintEngine* paintEngine() const Q_DECL_OVERRIDE {return fbo->paintEngine();}
- virtual QSize size() const Q_DECL_OVERRIDE {return fbo->size();}
- virtual QGLContext* context() const Q_DECL_OVERRIDE;
- virtual QGLFormat format() const Q_DECL_OVERRIDE {return fboFormat;}
- virtual bool alphaRequested() const Q_DECL_OVERRIDE { return reqAlpha; }
+ virtual QPaintEngine* paintEngine() const override {return fbo->paintEngine();}
+ virtual QSize size() const override {return fbo->size();}
+ virtual QGLContext* context() const override;
+ virtual QGLFormat format() const override {return fboFormat;}
+ virtual bool alphaRequested() const override { return reqAlpha; }
void setFBO(QGLFramebufferObject* f,
QGLFramebufferObject::Attachment attachment);
diff --git a/src/opengl/qglfunctions.cpp b/src/opengl/qglfunctions.cpp
index a1ea1b1e56..07e1194342 100644
--- a/src/opengl/qglfunctions.cpp
+++ b/src/opengl/qglfunctions.cpp
@@ -159,12 +159,12 @@ struct QGLFunctionsPrivateEx : public QGLFunctionsPrivate, public QOpenGLSharedR
delete funcs;
}
- void invalidateResource() Q_DECL_OVERRIDE
+ void invalidateResource() override
{
m_features = -1;
}
- void freeResource(QOpenGLContext *) Q_DECL_OVERRIDE
+ void freeResource(QOpenGLContext *) override
{
// no gl resources to free
}
diff --git a/src/opengl/qglfunctions.h b/src/opengl/qglfunctions.h
index 211212125e..d8c5249a1a 100644
--- a/src/opengl/qglfunctions.h
+++ b/src/opengl/qglfunctions.h
@@ -76,7 +76,7 @@ public:
QGLFunctions::OpenGLFeatures openGLFeatures() const;
bool hasOpenGLFeature(QGLFunctions::OpenGLFeature feature) const;
- void initializeGLFunctions(const QGLContext *context = Q_NULLPTR);
+ void initializeGLFunctions(const QGLContext *context = nullptr);
void glActiveTexture(GLenum texture);
void glAttachShader(GLuint program, GLuint shader);
@@ -178,14 +178,14 @@ public:
private:
QGLFunctionsPrivate *d_ptr;
- static bool isInitialized(const QGLFunctionsPrivate *d) { return d != Q_NULLPTR; }
+ static bool isInitialized(const QGLFunctionsPrivate *d) { return d != nullptr; }
};
Q_DECLARE_OPERATORS_FOR_FLAGS(QGLFunctions::OpenGLFeatures)
struct QGLFunctionsPrivate
{
- QGLFunctionsPrivate(const QGLContext *context = Q_NULLPTR);
+ QGLFunctionsPrivate(const QGLContext *context = nullptr);
QOpenGLFunctions *funcs;
};
diff --git a/src/opengl/qglpaintdevice_p.h b/src/opengl/qglpaintdevice_p.h
index 3b34b2d244..bfecdabd53 100644
--- a/src/opengl/qglpaintdevice_p.h
+++ b/src/opengl/qglpaintdevice_p.h
@@ -64,7 +64,7 @@ public:
QGLPaintDevice();
virtual ~QGLPaintDevice();
- int devType() const Q_DECL_OVERRIDE {return QInternal::OpenGL;}
+ int devType() const override {return QInternal::OpenGL;}
virtual void beginPaint();
virtual void ensureActiveTarget();
@@ -80,7 +80,7 @@ public:
static QGLPaintDevice* getDevice(QPaintDevice*);
protected:
- int metric(QPaintDevice::PaintDeviceMetric metric) const Q_DECL_OVERRIDE;
+ int metric(QPaintDevice::PaintDeviceMetric metric) const override;
GLuint m_previousFBO;
GLuint m_thisFBO;
};
@@ -93,13 +93,13 @@ class Q_OPENGL_EXPORT QGLWidgetGLPaintDevice : public QGLPaintDevice
public:
QGLWidgetGLPaintDevice();
- virtual QPaintEngine* paintEngine() const Q_DECL_OVERRIDE;
+ virtual QPaintEngine* paintEngine() const override;
// QGLWidgets need to do swapBufers in endPaint:
- virtual void beginPaint() Q_DECL_OVERRIDE;
- virtual void endPaint() Q_DECL_OVERRIDE;
- virtual QSize size() const Q_DECL_OVERRIDE;
- virtual QGLContext* context() const Q_DECL_OVERRIDE;
+ virtual void beginPaint() override;
+ virtual void endPaint() override;
+ virtual QSize size() const override;
+ virtual QGLContext* context() const override;
void setWidget(QGLWidget*);
diff --git a/src/opengl/qglpixelbuffer.h b/src/opengl/qglpixelbuffer.h
index bd30ca2663..f5d7929c35 100644
--- a/src/opengl/qglpixelbuffer.h
+++ b/src/opengl/qglpixelbuffer.h
@@ -53,9 +53,9 @@ class Q_OPENGL_EXPORT QGLPixelBuffer : public QPaintDevice
Q_DECLARE_PRIVATE(QGLPixelBuffer)
public:
QGLPixelBuffer(const QSize &size, const QGLFormat &format = QGLFormat::defaultFormat(),
- QGLWidget *shareWidget = Q_NULLPTR);
+ QGLWidget *shareWidget = nullptr);
QGLPixelBuffer(int width, int height, const QGLFormat &format = QGLFormat::defaultFormat(),
- QGLWidget *shareWidget = Q_NULLPTR);
+ QGLWidget *shareWidget = nullptr);
virtual ~QGLPixelBuffer();
bool isValid() const;
@@ -81,14 +81,14 @@ public:
Qt::HANDLE handle() const;
QImage toImage() const;
- QPaintEngine *paintEngine() const Q_DECL_OVERRIDE;
+ QPaintEngine *paintEngine() const override;
QGLFormat format() const;
static bool hasOpenGLPbuffers();
protected:
- int metric(PaintDeviceMetric metric) const Q_DECL_OVERRIDE;
- int devType() const Q_DECL_OVERRIDE { return QInternal::Pbuffer; }
+ int metric(PaintDeviceMetric metric) const override;
+ int devType() const override { return QInternal::Pbuffer; }
private:
Q_DISABLE_COPY(QGLPixelBuffer)
diff --git a/src/opengl/qglshaderprogram.h b/src/opengl/qglshaderprogram.h
index f95017d09c..3ce88197d2 100644
--- a/src/opengl/qglshaderprogram.h
+++ b/src/opengl/qglshaderprogram.h
@@ -64,8 +64,8 @@ public:
};
Q_DECLARE_FLAGS(ShaderType, ShaderTypeBit)
- explicit QGLShader(QGLShader::ShaderType type, QObject *parent = Q_NULLPTR);
- QGLShader(QGLShader::ShaderType type, const QGLContext *context, QObject *parent = Q_NULLPTR);
+ explicit QGLShader(QGLShader::ShaderType type, QObject *parent = nullptr);
+ QGLShader(QGLShader::ShaderType type, const QGLContext *context, QObject *parent = nullptr);
virtual ~QGLShader();
QGLShader::ShaderType shaderType() const;
@@ -82,7 +82,7 @@ public:
GLuint shaderId() const;
- static bool hasOpenGLShaders(ShaderType type, const QGLContext *context = Q_NULLPTR);
+ static bool hasOpenGLShaders(ShaderType type, const QGLContext *context = nullptr);
private:
friend class QGLShaderProgram;
@@ -100,8 +100,8 @@ class Q_OPENGL_EXPORT QGLShaderProgram : public QObject
{
Q_OBJECT
public:
- explicit QGLShaderProgram(QObject *parent = Q_NULLPTR);
- explicit QGLShaderProgram(const QGLContext *context, QObject *parent = Q_NULLPTR);
+ explicit QGLShaderProgram(QObject *parent = nullptr);
+ explicit QGLShaderProgram(const QGLContext *context, QObject *parent = nullptr);
virtual ~QGLShaderProgram();
bool addShader(QGLShader *shader);
@@ -286,7 +286,7 @@ public:
void setUniformValueArray(const char *name, const QMatrix4x3 *values, int count);
void setUniformValueArray(const char *name, const QMatrix4x4 *values, int count);
- static bool hasOpenGLShaderPrograms(const QGLContext *context = Q_NULLPTR);
+ static bool hasOpenGLShaderPrograms(const QGLContext *context = nullptr);
private Q_SLOTS:
void shaderDestroyed();
diff --git a/src/opengl/qgraphicsshadereffect.cpp b/src/opengl/qgraphicsshadereffect.cpp
index 218f4af866..cf3d307d71 100644
--- a/src/opengl/qgraphicsshadereffect.cpp
+++ b/src/opengl/qgraphicsshadereffect.cpp
@@ -143,7 +143,7 @@ public:
setSource(source);
}
- void setUniforms(QGLShaderProgram *program) Q_DECL_OVERRIDE;
+ void setUniforms(QGLShaderProgram *program) override;
QGraphicsShaderEffect *effect;
};
diff --git a/src/opengl/qgraphicsshadereffect_p.h b/src/opengl/qgraphicsshadereffect_p.h
index d7e0ec51d4..9efcecd25f 100644
--- a/src/opengl/qgraphicsshadereffect_p.h
+++ b/src/opengl/qgraphicsshadereffect_p.h
@@ -74,7 +74,7 @@ public:
void setPixelShaderFragment(const QByteArray& code);
protected:
- void draw(QPainter *painter) Q_DECL_OVERRIDE;
+ void draw(QPainter *painter) override;
void setUniformsDirty();
virtual void setUniforms(QGLShaderProgram *program);
diff --git a/src/openglextensions/qopenglextensions.h b/src/openglextensions/qopenglextensions.h
index 52ebd2fe0f..afbc18f474 100644
--- a/src/openglextensions/qopenglextensions.h
+++ b/src/openglextensions/qopenglextensions.h
@@ -114,7 +114,7 @@ class QOpenGLExtension_3DFX_tbuffer : public QAbstractOpenGLExtension
public:
QOpenGLExtension_3DFX_tbuffer();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glTbufferMask3DFX(GLuint mask);
@@ -142,7 +142,7 @@ class QOpenGLExtension_AMD_debug_output : public QAbstractOpenGLExtension
public:
QOpenGLExtension_AMD_debug_output();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
GLuint glGetDebugMessageLogAMD(GLuint count, GLsizei bufsize, GLenum *categories, GLuint *severities, GLuint *ids, GLsizei *lengths, GLchar *message);
void glDebugMessageCallbackAMD(GLDEBUGPROCAMD callback, GLvoid *userParam);
@@ -191,7 +191,7 @@ class QOpenGLExtension_AMD_draw_buffers_blend : public QAbstractOpenGLExtension
public:
QOpenGLExtension_AMD_draw_buffers_blend();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glBlendEquationSeparateIndexedAMD(GLuint buf, GLenum modeRGB, GLenum modeAlpha);
void glBlendEquationIndexedAMD(GLuint buf, GLenum mode);
@@ -238,7 +238,7 @@ class QOpenGLExtension_AMD_multi_draw_indirect : public QAbstractOpenGLExtension
public:
QOpenGLExtension_AMD_multi_draw_indirect();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glMultiDrawElementsIndirectAMD(GLenum mode, GLenum type, const GLvoid *indirect, GLsizei primcount, GLsizei stride);
void glMultiDrawArraysIndirectAMD(GLenum mode, const GLvoid *indirect, GLsizei primcount, GLsizei stride);
@@ -272,7 +272,7 @@ class QOpenGLExtension_AMD_name_gen_delete : public QAbstractOpenGLExtension
public:
QOpenGLExtension_AMD_name_gen_delete();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
GLboolean glIsNameAMD(GLenum identifier, GLuint name);
void glDeleteNamesAMD(GLenum identifier, GLuint num, const GLuint *names);
@@ -321,7 +321,7 @@ class QOpenGLExtension_AMD_performance_monitor : public QAbstractOpenGLExtension
public:
QOpenGLExtension_AMD_performance_monitor();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glGetPerfMonitorCounterDataAMD(GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten);
void glEndPerfMonitorAMD(GLuint monitor);
@@ -416,7 +416,7 @@ class QOpenGLExtension_AMD_sample_positions : public QAbstractOpenGLExtension
public:
QOpenGLExtension_AMD_sample_positions();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glSetMultisamplefvAMD(GLenum pname, GLuint index, const GLfloat *val);
@@ -441,7 +441,7 @@ class QOpenGLExtension_AMD_sparse_texture : public QAbstractOpenGLExtension
public:
QOpenGLExtension_AMD_sparse_texture();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glTexStorageSparseAMD(GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags);
@@ -466,7 +466,7 @@ class QOpenGLExtension_AMD_stencil_operation_extended : public QAbstractOpenGLEx
public:
QOpenGLExtension_AMD_stencil_operation_extended();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glStencilOpValueAMD(GLenum face, GLuint value);
@@ -492,7 +492,7 @@ class QOpenGLExtension_AMD_vertex_shader_tesselator : public QAbstractOpenGLExte
public:
QOpenGLExtension_AMD_vertex_shader_tesselator();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glTessellationModeAMD(GLenum mode);
void glTessellationFactorAMD(GLfloat factor);
@@ -528,7 +528,7 @@ class QOpenGLExtension_APPLE_element_array : public QAbstractOpenGLExtension
public:
QOpenGLExtension_APPLE_element_array();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glMultiDrawRangeElementArrayAPPLE(GLenum mode, GLuint start, GLuint end, const GLint *first, const GLsizei *count, GLsizei primcount);
void glMultiDrawElementArrayAPPLE(GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);
@@ -588,7 +588,7 @@ class QOpenGLExtension_APPLE_fence : public QAbstractOpenGLExtension
public:
QOpenGLExtension_APPLE_fence();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glFinishObjectAPPLE(GLenum object, GLint name);
GLboolean glTestObjectAPPLE(GLenum object, GLuint name);
@@ -663,7 +663,7 @@ class QOpenGLExtension_APPLE_flush_buffer_range : public QAbstractOpenGLExtensio
public:
QOpenGLExtension_APPLE_flush_buffer_range();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glFlushMappedBufferRangeAPPLE(GLenum target, GLintptr offset, GLsizeiptr size);
void glBufferParameteriAPPLE(GLenum target, GLenum pname, GLint param);
@@ -697,7 +697,7 @@ class QOpenGLExtension_APPLE_object_purgeable : public QAbstractOpenGLExtension
public:
QOpenGLExtension_APPLE_object_purgeable();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glGetObjectParameterivAPPLE(GLenum objectType, GLuint name, GLenum pname, GLint *params);
GLenum glObjectUnpurgeableAPPLE(GLenum objectType, GLuint name, GLenum option);
@@ -737,7 +737,7 @@ class QOpenGLExtension_APPLE_texture_range : public QAbstractOpenGLExtension
public:
QOpenGLExtension_APPLE_texture_range();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glGetTexParameterPointervAPPLE(GLenum target, GLenum pname, GLvoid* *params);
void glTextureRangeAPPLE(GLenum target, GLsizei length, const GLvoid *pointer);
@@ -772,7 +772,7 @@ class QOpenGLExtension_APPLE_vertex_array_object : public QAbstractOpenGLExtensi
public:
QOpenGLExtension_APPLE_vertex_array_object();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
GLboolean glIsVertexArrayAPPLE(GLuint array);
void glGenVertexArraysAPPLE(GLsizei n, GLuint *arrays);
@@ -820,7 +820,7 @@ class QOpenGLExtension_APPLE_vertex_array_range : public QAbstractOpenGLExtensio
public:
QOpenGLExtension_APPLE_vertex_array_range();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glVertexArrayParameteriAPPLE(GLenum pname, GLint param);
void glFlushVertexArrayRangeAPPLE(GLsizei length, GLvoid *pointer);
@@ -865,7 +865,7 @@ class QOpenGLExtension_APPLE_vertex_program_evaluators : public QAbstractOpenGLE
public:
QOpenGLExtension_APPLE_vertex_program_evaluators();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glMapVertexAttrib2fAPPLE(GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points);
void glMapVertexAttrib2dAPPLE(GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points);
@@ -936,7 +936,7 @@ class QOpenGLExtension_ARB_ES2_compatibility : public QAbstractOpenGLExtension
public:
QOpenGLExtension_ARB_ES2_compatibility();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glClearDepthf(GLfloat dd);
void glDepthRangef(GLfloat n, GLfloat f);
@@ -991,7 +991,7 @@ class QOpenGLExtension_ARB_base_instance : public QAbstractOpenGLExtension
public:
QOpenGLExtension_ARB_base_instance();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glDrawElementsInstancedBaseVertexBaseInstance(GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex, GLuint baseinstance);
void glDrawElementsInstancedBaseInstance(GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLuint baseinstance);
@@ -1031,7 +1031,7 @@ class QOpenGLExtension_ARB_blend_func_extended : public QAbstractOpenGLExtension
public:
QOpenGLExtension_ARB_blend_func_extended();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
GLint glGetFragDataIndex(GLuint program, const GLchar *name);
void glBindFragDataLocationIndexed(GLuint program, GLuint colorNumber, GLuint index, const GLchar *name);
@@ -1063,7 +1063,7 @@ class QOpenGLExtension_ARB_cl_event : public QAbstractOpenGLExtension
public:
QOpenGLExtension_ARB_cl_event();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
GLsync glCreateSyncFromCLeventARB(struct _cl_context * context, struct _cl_event * event, GLbitfield flags);
@@ -1089,7 +1089,7 @@ class QOpenGLExtension_ARB_clear_buffer_object : public QAbstractOpenGLExtension
public:
QOpenGLExtension_ARB_clear_buffer_object();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glClearBufferSubData(GLenum target, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data);
void glClearBufferData(GLenum target, GLenum internalformat, GLenum format, GLenum type, const void *data);
@@ -1121,7 +1121,7 @@ class QOpenGLExtension_ARB_color_buffer_float : public QAbstractOpenGLExtension
public:
QOpenGLExtension_ARB_color_buffer_float();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glClampColorARB(GLenum target, GLenum clamp);
@@ -1147,7 +1147,7 @@ class QOpenGLExtension_ARB_compute_shader : public QAbstractOpenGLExtension
public:
QOpenGLExtension_ARB_compute_shader();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glDispatchComputeIndirect(GLintptr indirect);
void glDispatchCompute(GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z);
@@ -1179,7 +1179,7 @@ class QOpenGLExtension_ARB_copy_buffer : public QAbstractOpenGLExtension
public:
QOpenGLExtension_ARB_copy_buffer();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glCopyBufferSubData(GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
@@ -1204,7 +1204,7 @@ class QOpenGLExtension_ARB_copy_image : public QAbstractOpenGLExtension
public:
QOpenGLExtension_ARB_copy_image();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glCopyImageSubData(GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth);
@@ -1232,7 +1232,7 @@ class QOpenGLExtension_ARB_debug_output : public QAbstractOpenGLExtension
public:
QOpenGLExtension_ARB_debug_output();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
GLuint glGetDebugMessageLogARB(GLuint count, GLsizei bufsize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog);
void glDebugMessageCallbackARB(GLDEBUGPROCARB callback, const GLvoid *userParam);
@@ -1278,7 +1278,7 @@ class QOpenGLExtension_ARB_draw_buffers : public QAbstractOpenGLExtension
public:
QOpenGLExtension_ARB_draw_buffers();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glDrawBuffersARB(GLsizei n, const GLenum *bufs);
@@ -1306,7 +1306,7 @@ class QOpenGLExtension_ARB_draw_buffers_blend : public QAbstractOpenGLExtension
public:
QOpenGLExtension_ARB_draw_buffers_blend();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glBlendFuncSeparateiARB(GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
void glBlendFunciARB(GLuint buf, GLenum src, GLenum dst);
@@ -1355,7 +1355,7 @@ class QOpenGLExtension_ARB_draw_elements_base_vertex : public QAbstractOpenGLExt
public:
QOpenGLExtension_ARB_draw_elements_base_vertex();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glMultiDrawElementsBaseVertex(GLenum mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei drawcount, const GLint *basevertex);
void glDrawElementsInstancedBaseVertex(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei instancecount, GLint basevertex);
@@ -1402,7 +1402,7 @@ class QOpenGLExtension_ARB_draw_indirect : public QAbstractOpenGLExtension
public:
QOpenGLExtension_ARB_draw_indirect();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glDrawElementsIndirect(GLenum mode, GLenum type, const GLvoid *indirect);
void glDrawArraysIndirect(GLenum mode, const GLvoid *indirect);
@@ -1435,7 +1435,7 @@ class QOpenGLExtension_ARB_draw_instanced : public QAbstractOpenGLExtension
public:
QOpenGLExtension_ARB_draw_instanced();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glDrawElementsInstancedARB(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount);
void glDrawArraysInstancedARB(GLenum mode, GLint first, GLsizei count, GLsizei primcount);
@@ -1468,7 +1468,7 @@ class QOpenGLExtension_ARB_framebuffer_no_attachments : public QAbstractOpenGLEx
public:
QOpenGLExtension_ARB_framebuffer_no_attachments();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glGetFramebufferParameteriv(GLenum target, GLenum pname, GLint *params);
void glFramebufferParameteri(GLenum target, GLenum pname, GLint param);
@@ -1519,7 +1519,7 @@ class QOpenGLExtension_ARB_framebuffer_object : public QAbstractOpenGLExtension
public:
QOpenGLExtension_ARB_framebuffer_object();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glFramebufferTextureLayer(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
void glRenderbufferStorageMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
@@ -1680,7 +1680,7 @@ class QOpenGLExtension_ARB_geometry_shader4 : public QAbstractOpenGLExtension
public:
QOpenGLExtension_ARB_geometry_shader4();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glFramebufferTextureFaceARB(GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face);
void glFramebufferTextureLayerARB(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
@@ -1728,7 +1728,7 @@ class QOpenGLExtension_ARB_get_program_binary : public QAbstractOpenGLExtension
public:
QOpenGLExtension_ARB_get_program_binary();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glProgramParameteri(GLuint program, GLenum pname, GLint value);
void glProgramBinary(GLuint program, GLenum binaryFormat, const GLvoid *binary, GLsizei length);
@@ -1784,7 +1784,7 @@ class QOpenGLExtension_ARB_gpu_shader_fp64 : public QAbstractOpenGLExtension
public:
QOpenGLExtension_ARB_gpu_shader_fp64();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glGetUniformdv(GLuint program, GLint location, GLdouble *params);
void glUniformMatrix4x3dv(GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
@@ -1928,7 +1928,7 @@ class QOpenGLExtension_ARB_instanced_arrays : public QAbstractOpenGLExtension
public:
QOpenGLExtension_ARB_instanced_arrays();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glVertexAttribDivisorARB(GLuint index, GLuint divisor);
@@ -1953,7 +1953,7 @@ class QOpenGLExtension_ARB_internalformat_query : public QAbstractOpenGLExtensio
public:
QOpenGLExtension_ARB_internalformat_query();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glGetInternalformativ(GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params);
@@ -1978,7 +1978,7 @@ class QOpenGLExtension_ARB_internalformat_query2 : public QAbstractOpenGLExtensi
public:
QOpenGLExtension_ARB_internalformat_query2();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glGetInternalformati64v(GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint64 *params);
@@ -2008,7 +2008,7 @@ class QOpenGLExtension_ARB_invalidate_subdata : public QAbstractOpenGLExtension
public:
QOpenGLExtension_ARB_invalidate_subdata();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glInvalidateSubFramebuffer(GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height);
void glInvalidateFramebuffer(GLenum target, GLsizei numAttachments, const GLenum *attachments);
@@ -2069,7 +2069,7 @@ class QOpenGLExtension_ARB_map_buffer_range : public QAbstractOpenGLExtension
public:
QOpenGLExtension_ARB_map_buffer_range();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glFlushMappedBufferRange(GLenum target, GLintptr offset, GLsizeiptr length);
GLvoid* glMapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
@@ -2105,7 +2105,7 @@ class QOpenGLExtension_ARB_matrix_palette : public QAbstractOpenGLExtension
public:
QOpenGLExtension_ARB_matrix_palette();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glMatrixIndexPointerARB(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
void glMatrixIndexuivARB(GLint size, const GLuint *indices);
@@ -2159,7 +2159,7 @@ class QOpenGLExtension_ARB_multi_draw_indirect : public QAbstractOpenGLExtension
public:
QOpenGLExtension_ARB_multi_draw_indirect();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glMultiDrawElementsIndirect(GLenum mode, GLenum type, const void *indirect, GLsizei drawcount, GLsizei stride);
void glMultiDrawArraysIndirect(GLenum mode, const void *indirect, GLsizei drawcount, GLsizei stride);
@@ -2191,7 +2191,7 @@ class QOpenGLExtension_ARB_multisample : public QAbstractOpenGLExtension
public:
QOpenGLExtension_ARB_multisample();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glSampleCoverageARB(GLfloat value, GLboolean invert);
@@ -2249,7 +2249,7 @@ class QOpenGLExtension_ARB_multitexture : public QAbstractOpenGLExtension
public:
QOpenGLExtension_ARB_multitexture();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glMultiTexCoord4svARB(GLenum target, const GLshort *v);
void glMultiTexCoord4sARB(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
@@ -2512,7 +2512,7 @@ class QOpenGLExtension_ARB_occlusion_query : public QAbstractOpenGLExtension
public:
QOpenGLExtension_ARB_occlusion_query();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glGetQueryObjectuivARB(GLuint id, GLenum pname, GLuint *params);
void glGetQueryObjectivARB(GLuint id, GLenum pname, GLint *params);
@@ -2587,7 +2587,7 @@ class QOpenGLExtension_ARB_point_parameters : public QAbstractOpenGLExtension
public:
QOpenGLExtension_ARB_point_parameters();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glPointParameterfvARB(GLenum pname, const GLfloat *params);
void glPointParameterfARB(GLenum pname, GLfloat param);
@@ -2624,7 +2624,7 @@ class QOpenGLExtension_ARB_program_interface_query : public QAbstractOpenGLExten
public:
QOpenGLExtension_ARB_program_interface_query();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
GLint glGetProgramResourceLocationIndex(GLuint program, GLenum programInterface, const GLchar *name);
GLint glGetProgramResourceLocation(GLuint program, GLenum programInterface, const GLchar *name);
@@ -2684,7 +2684,7 @@ class QOpenGLExtension_ARB_provoking_vertex : public QAbstractOpenGLExtension
public:
QOpenGLExtension_ARB_provoking_vertex();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glProvokingVertex(GLenum mode);
@@ -2728,7 +2728,7 @@ class QOpenGLExtension_ARB_robustness : public QAbstractOpenGLExtension
public:
QOpenGLExtension_ARB_robustness();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glGetnUniformdvARB(GLuint program, GLint location, GLsizei bufSize, GLdouble *params);
void glGetnUniformuivARB(GLuint program, GLint location, GLsizei bufSize, GLuint *params);
@@ -2886,7 +2886,7 @@ class QOpenGLExtension_ARB_sample_shading : public QAbstractOpenGLExtension
public:
QOpenGLExtension_ARB_sample_shading();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glMinSampleShadingARB(GLfloat value);
@@ -2924,7 +2924,7 @@ class QOpenGLExtension_ARB_sampler_objects : public QAbstractOpenGLExtension
public:
QOpenGLExtension_ARB_sampler_objects();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glGetSamplerParameterIuiv(GLuint sampler, GLenum pname, GLuint *params);
void glGetSamplerParameterfv(GLuint sampler, GLenum pname, GLfloat *params);
@@ -3099,7 +3099,7 @@ class QOpenGLExtension_ARB_separate_shader_objects : public QAbstractOpenGLExten
public:
QOpenGLExtension_ARB_separate_shader_objects();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glGetProgramPipelineInfoLog(GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
void glValidateProgramPipeline(GLuint pipeline);
@@ -3537,7 +3537,7 @@ class QOpenGLExtension_ARB_shader_atomic_counters : public QAbstractOpenGLExtens
public:
QOpenGLExtension_ARB_shader_atomic_counters();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glGetActiveAtomicCounterBufferiv(GLuint program, GLuint bufferIndex, GLenum pname, GLint *params);
@@ -3563,7 +3563,7 @@ class QOpenGLExtension_ARB_shader_image_load_store : public QAbstractOpenGLExten
public:
QOpenGLExtension_ARB_shader_image_load_store();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glMemoryBarrier(GLbitfield barriers);
void glBindImageTexture(GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format);
@@ -3633,7 +3633,7 @@ class QOpenGLExtension_ARB_shader_objects : public QAbstractOpenGLExtension
public:
QOpenGLExtension_ARB_shader_objects();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glGetShaderSourceARB(GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source);
void glGetUniformivARB(GLhandleARB programObj, GLint location, GLint *params);
@@ -3924,7 +3924,7 @@ class QOpenGLExtension_ARB_shader_storage_buffer_object : public QAbstractOpenGL
public:
QOpenGLExtension_ARB_shader_storage_buffer_object();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glShaderStorageBlockBinding(GLuint program, GLuint storageBlockIndex, GLuint storageBlockBinding);
@@ -3956,7 +3956,7 @@ class QOpenGLExtension_ARB_shader_subroutine : public QAbstractOpenGLExtension
public:
QOpenGLExtension_ARB_shader_subroutine();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glGetProgramStageiv(GLuint program, GLenum shadertype, GLenum pname, GLint *values);
void glGetUniformSubroutineuiv(GLenum shadertype, GLint location, GLuint *params);
@@ -4035,7 +4035,7 @@ class QOpenGLExtension_ARB_shading_language_include : public QAbstractOpenGLExte
public:
QOpenGLExtension_ARB_shading_language_include();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glGetNamedStringivARB(GLint namelen, const GLchar *name, GLenum pname, GLint *params);
void glGetNamedStringARB(GLint namelen, const GLchar *name, GLsizei bufSize, GLint *stringlen, GLchar *string);
@@ -4101,7 +4101,7 @@ class QOpenGLExtension_ARB_sync : public QAbstractOpenGLExtension
public:
QOpenGLExtension_ARB_sync();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glGetSynciv(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
void glGetInteger64v(GLenum pname, GLint64 *params);
@@ -4169,7 +4169,7 @@ class QOpenGLExtension_ARB_tessellation_shader : public QAbstractOpenGLExtension
public:
QOpenGLExtension_ARB_tessellation_shader();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glPatchParameterfv(GLenum pname, const GLfloat *values);
void glPatchParameteri(GLenum pname, GLint value);
@@ -4201,7 +4201,7 @@ class QOpenGLExtension_ARB_texture_buffer_object : public QAbstractOpenGLExtensi
public:
QOpenGLExtension_ARB_texture_buffer_object();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glTexBufferARB(GLenum target, GLenum internalformat, GLuint buffer);
@@ -4226,7 +4226,7 @@ class QOpenGLExtension_ARB_texture_buffer_range : public QAbstractOpenGLExtensio
public:
QOpenGLExtension_ARB_texture_buffer_range();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glTexBufferRange(GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size);
@@ -4257,7 +4257,7 @@ class QOpenGLExtension_ARB_texture_compression : public QAbstractOpenGLExtension
public:
QOpenGLExtension_ARB_texture_compression();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glGetCompressedTexImageARB(GLenum target, GLint level, GLvoid *img);
void glCompressedTexSubImage1DARB(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
@@ -4327,7 +4327,7 @@ class QOpenGLExtension_ARB_texture_multisample : public QAbstractOpenGLExtension
public:
QOpenGLExtension_ARB_texture_multisample();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glSampleMaski(GLuint index, GLbitfield mask);
void glGetMultisamplefv(GLenum pname, GLuint index, GLfloat *val);
@@ -4375,7 +4375,7 @@ class QOpenGLExtension_ARB_texture_storage : public QAbstractOpenGLExtension
public:
QOpenGLExtension_ARB_texture_storage();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glTexStorage3D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
void glTexStorage2D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
@@ -4415,7 +4415,7 @@ class QOpenGLExtension_ARB_texture_storage_multisample : public QAbstractOpenGLE
public:
QOpenGLExtension_ARB_texture_storage_multisample();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glTexStorage3DMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
void glTexStorage2DMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
@@ -4447,7 +4447,7 @@ class QOpenGLExtension_ARB_texture_view : public QAbstractOpenGLExtension
public:
QOpenGLExtension_ARB_texture_view();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glTextureView(GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers);
@@ -4474,7 +4474,7 @@ class QOpenGLExtension_ARB_timer_query : public QAbstractOpenGLExtension
public:
QOpenGLExtension_ARB_timer_query();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glGetQueryObjectui64v(GLuint id, GLenum pname, GLuint64 *params);
void glGetQueryObjecti64v(GLuint id, GLenum pname, GLint64 *params);
@@ -4519,7 +4519,7 @@ class QOpenGLExtension_ARB_transform_feedback2 : public QAbstractOpenGLExtension
public:
QOpenGLExtension_ARB_transform_feedback2();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glDrawTransformFeedback(GLenum mode, GLuint id);
void glResumeTransformFeedback();
@@ -4589,7 +4589,7 @@ class QOpenGLExtension_ARB_transform_feedback3 : public QAbstractOpenGLExtension
public:
QOpenGLExtension_ARB_transform_feedback3();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glGetQueryIndexediv(GLenum target, GLuint index, GLenum pname, GLint *params);
void glEndQueryIndexed(GLenum target, GLuint index);
@@ -4636,7 +4636,7 @@ class QOpenGLExtension_ARB_transform_feedback_instanced : public QAbstractOpenGL
public:
QOpenGLExtension_ARB_transform_feedback_instanced();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glDrawTransformFeedbackStreamInstanced(GLenum mode, GLuint id, GLuint stream, GLsizei instancecount);
void glDrawTransformFeedbackInstanced(GLenum mode, GLuint id, GLsizei instancecount);
@@ -4671,7 +4671,7 @@ class QOpenGLExtension_ARB_transpose_matrix : public QAbstractOpenGLExtension
public:
QOpenGLExtension_ARB_transpose_matrix();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glMultTransposeMatrixdARB(const GLdouble *m);
void glMultTransposeMatrixfARB(const GLfloat *m);
@@ -4723,7 +4723,7 @@ class QOpenGLExtension_ARB_uniform_buffer_object : public QAbstractOpenGLExtensi
public:
QOpenGLExtension_ARB_uniform_buffer_object();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glUniformBlockBinding(GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);
void glGetActiveUniformBlockName(GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName);
@@ -4793,7 +4793,7 @@ class QOpenGLExtension_ARB_vertex_array_object : public QAbstractOpenGLExtension
public:
QOpenGLExtension_ARB_vertex_array_object();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
GLboolean glIsVertexArray(GLuint array);
void glGenVertexArrays(GLsizei n, GLuint *arrays);
@@ -4848,7 +4848,7 @@ class QOpenGLExtension_ARB_vertex_attrib_64bit : public QAbstractOpenGLExtension
public:
QOpenGLExtension_ARB_vertex_attrib_64bit();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glGetVertexAttribLdv(GLuint index, GLenum pname, GLdouble *params);
void glVertexAttribLPointer(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
@@ -4941,7 +4941,7 @@ class QOpenGLExtension_ARB_vertex_attrib_binding : public QAbstractOpenGLExtensi
public:
QOpenGLExtension_ARB_vertex_attrib_binding();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glVertexBindingDivisor(GLuint bindingindex, GLuint divisor);
void glVertexAttribBinding(GLuint attribindex, GLuint bindingindex);
@@ -5010,7 +5010,7 @@ class QOpenGLExtension_ARB_vertex_blend : public QAbstractOpenGLExtension
public:
QOpenGLExtension_ARB_vertex_blend();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glVertexBlendARB(GLint count);
void glWeightPointerARB(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
@@ -5108,7 +5108,7 @@ class QOpenGLExtension_ARB_vertex_buffer_object : public QAbstractOpenGLExtensio
public:
QOpenGLExtension_ARB_vertex_buffer_object();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glGetBufferPointervARB(GLenum target, GLenum pname, GLvoid* *params);
void glGetBufferParameterivARB(GLenum target, GLenum pname, GLint *params);
@@ -5264,7 +5264,7 @@ class QOpenGLExtension_ARB_vertex_program : public QAbstractOpenGLExtension
public:
QOpenGLExtension_ARB_vertex_program();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
GLboolean glIsProgramARB(GLuint program);
void glGetVertexAttribPointervARB(GLuint index, GLenum pname, GLvoid* *pointer);
@@ -5718,7 +5718,7 @@ class QOpenGLExtension_ARB_vertex_shader : public QAbstractOpenGLExtension
public:
QOpenGLExtension_ARB_vertex_shader();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
GLint glGetAttribLocationARB(GLhandleARB programObj, const GLcharARB *name);
void glGetActiveAttribARB(GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name);
@@ -5794,7 +5794,7 @@ class QOpenGLExtension_ARB_vertex_type_2_10_10_10_rev : public QAbstractOpenGLEx
public:
QOpenGLExtension_ARB_vertex_type_2_10_10_10_rev();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glVertexAttribP4uiv(GLuint index, GLenum type, GLboolean normalized, const GLuint *value);
void glVertexAttribP4ui(GLuint index, GLenum type, GLboolean normalized, GLuint value);
@@ -6087,7 +6087,7 @@ class QOpenGLExtension_ARB_viewport_array : public QAbstractOpenGLExtension
public:
QOpenGLExtension_ARB_viewport_array();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glGetDoublei_v(GLenum target, GLuint index, GLdouble *data);
void glGetFloati_v(GLenum target, GLuint index, GLfloat *data);
@@ -6190,7 +6190,7 @@ class QOpenGLExtension_ARB_window_pos : public QAbstractOpenGLExtension
public:
QOpenGLExtension_ARB_window_pos();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glWindowPos3svARB(const GLshort *v);
void glWindowPos3sARB(GLshort x, GLshort y, GLshort z);
@@ -6320,7 +6320,7 @@ class QOpenGLExtension_ATI_draw_buffers : public QAbstractOpenGLExtension
public:
QOpenGLExtension_ATI_draw_buffers();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glDrawBuffersATI(GLsizei n, const GLenum *bufs);
@@ -6347,7 +6347,7 @@ class QOpenGLExtension_ATI_element_array : public QAbstractOpenGLExtension
public:
QOpenGLExtension_ATI_element_array();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glDrawRangeElementArrayATI(GLenum mode, GLuint start, GLuint end, GLsizei count);
void glDrawElementArrayATI(GLenum mode, GLsizei count);
@@ -6389,7 +6389,7 @@ class QOpenGLExtension_ATI_envmap_bumpmap : public QAbstractOpenGLExtension
public:
QOpenGLExtension_ATI_envmap_bumpmap();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glGetTexBumpParameterfvATI(GLenum pname, GLfloat *param);
void glGetTexBumpParameterivATI(GLenum pname, GLint *param);
@@ -6448,7 +6448,7 @@ class QOpenGLExtension_ATI_fragment_shader : public QAbstractOpenGLExtension
public:
QOpenGLExtension_ATI_fragment_shader();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glSetFragmentShaderConstantATI(GLuint dst, const GLfloat *value);
void glAlphaFragmentOp3ATI(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod);
@@ -6565,7 +6565,7 @@ class QOpenGLExtension_ATI_map_object_buffer : public QAbstractOpenGLExtension
public:
QOpenGLExtension_ATI_map_object_buffer();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glUnmapObjectBufferATI(GLuint buffer);
GLvoid* glMapObjectBufferATI(GLuint buffer);
@@ -6598,7 +6598,7 @@ class QOpenGLExtension_ATI_pn_triangles : public QAbstractOpenGLExtension
public:
QOpenGLExtension_ATI_pn_triangles();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glPNTrianglesfATI(GLenum pname, GLfloat param);
void glPNTrianglesiATI(GLenum pname, GLint param);
@@ -6631,7 +6631,7 @@ class QOpenGLExtension_ATI_separate_stencil : public QAbstractOpenGLExtension
public:
QOpenGLExtension_ATI_separate_stencil();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glStencilFuncSeparateATI(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask);
void glStencilOpSeparateATI(GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
@@ -6674,7 +6674,7 @@ class QOpenGLExtension_ATI_vertex_array_object : public QAbstractOpenGLExtension
public:
QOpenGLExtension_ATI_vertex_array_object();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glGetVariantArrayObjectivATI(GLuint id, GLenum pname, GLint *params);
void glGetVariantArrayObjectfvATI(GLuint id, GLenum pname, GLfloat *params);
@@ -6778,7 +6778,7 @@ class QOpenGLExtension_ATI_vertex_attrib_array_object : public QAbstractOpenGLEx
public:
QOpenGLExtension_ATI_vertex_attrib_array_object();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glGetVertexAttribArrayObjectivATI(GLuint index, GLenum pname, GLint *params);
void glGetVertexAttribArrayObjectfvATI(GLuint index, GLenum pname, GLfloat *params);
@@ -6861,7 +6861,7 @@ class QOpenGLExtension_ATI_vertex_streams : public QAbstractOpenGLExtension
public:
QOpenGLExtension_ATI_vertex_streams();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glVertexBlendEnvfATI(GLenum pname, GLfloat param);
void glVertexBlendEnviATI(GLenum pname, GLint param);
@@ -7196,7 +7196,7 @@ class QOpenGLExtension_EXT_bindable_uniform : public QAbstractOpenGLExtension
public:
QOpenGLExtension_EXT_bindable_uniform();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
GLintptr glGetUniformOffsetEXT(GLuint program, GLint location);
GLint glGetUniformBufferSizeEXT(GLuint program, GLint location);
@@ -7235,7 +7235,7 @@ class QOpenGLExtension_EXT_blend_color : public QAbstractOpenGLExtension
public:
QOpenGLExtension_EXT_blend_color();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glBlendColorEXT(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
@@ -7260,7 +7260,7 @@ class QOpenGLExtension_EXT_blend_equation_separate : public QAbstractOpenGLExten
public:
QOpenGLExtension_EXT_blend_equation_separate();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glBlendEquationSeparateEXT(GLenum modeRGB, GLenum modeAlpha);
@@ -7285,7 +7285,7 @@ class QOpenGLExtension_EXT_blend_func_separate : public QAbstractOpenGLExtension
public:
QOpenGLExtension_EXT_blend_func_separate();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glBlendFuncSeparateEXT(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
@@ -7310,7 +7310,7 @@ class QOpenGLExtension_EXT_blend_minmax : public QAbstractOpenGLExtension
public:
QOpenGLExtension_EXT_blend_minmax();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glBlendEquationEXT(GLenum mode);
@@ -7336,7 +7336,7 @@ class QOpenGLExtension_EXT_color_subtable : public QAbstractOpenGLExtension
public:
QOpenGLExtension_EXT_color_subtable();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glCopyColorSubTableEXT(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);
void glColorSubTableEXT(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data);
@@ -7369,7 +7369,7 @@ class QOpenGLExtension_EXT_compiled_vertex_array : public QAbstractOpenGLExtensi
public:
QOpenGLExtension_EXT_compiled_vertex_array();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glUnlockArraysEXT();
void glLockArraysEXT(GLint first, GLsizei count);
@@ -7413,7 +7413,7 @@ class QOpenGLExtension_EXT_convolution : public QAbstractOpenGLExtension
public:
QOpenGLExtension_EXT_convolution();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glSeparableFilter2DEXT(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column);
void glGetSeparableFilterEXT(GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span);
@@ -7543,7 +7543,7 @@ class QOpenGLExtension_EXT_coordinate_frame : public QAbstractOpenGLExtension
public:
QOpenGLExtension_EXT_coordinate_frame();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glBinormalPointerEXT(GLenum type, GLsizei stride, const GLvoid *pointer);
void glTangentPointerEXT(GLenum type, GLsizei stride, const GLvoid *pointer);
@@ -7719,7 +7719,7 @@ class QOpenGLExtension_EXT_copy_texture : public QAbstractOpenGLExtension
public:
QOpenGLExtension_EXT_copy_texture();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glCopyTexSubImage3DEXT(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
void glCopyTexSubImage2DEXT(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
@@ -7773,7 +7773,7 @@ class QOpenGLExtension_EXT_cull_vertex : public QAbstractOpenGLExtension
public:
QOpenGLExtension_EXT_cull_vertex();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glCullParameterfvEXT(GLenum pname, GLfloat *params);
void glCullParameterdvEXT(GLenum pname, GLdouble *params);
@@ -7805,7 +7805,7 @@ class QOpenGLExtension_EXT_depth_bounds_test : public QAbstractOpenGLExtension
public:
QOpenGLExtension_EXT_depth_bounds_test();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glDepthBoundsEXT(GLclampd zmin, GLclampd zmax);
@@ -8051,7 +8051,7 @@ class QOpenGLExtension_EXT_direct_state_access : public QAbstractOpenGLExtension
public:
QOpenGLExtension_EXT_direct_state_access();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glProgramUniformMatrix4x3dvEXT(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
void glProgramUniformMatrix4x2dvEXT(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value);
@@ -9628,7 +9628,7 @@ class QOpenGLExtension_EXT_draw_buffers2 : public QAbstractOpenGLExtension
public:
QOpenGLExtension_EXT_draw_buffers2();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
GLboolean glIsEnabledIndexedEXT(GLenum target, GLuint index);
void glDisableIndexedEXT(GLenum target, GLuint index);
@@ -9689,7 +9689,7 @@ class QOpenGLExtension_EXT_draw_instanced : public QAbstractOpenGLExtension
public:
QOpenGLExtension_EXT_draw_instanced();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glDrawElementsInstancedEXT(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount);
void glDrawArraysInstancedEXT(GLenum mode, GLint start, GLsizei count, GLsizei primcount);
@@ -9721,7 +9721,7 @@ class QOpenGLExtension_EXT_draw_range_elements : public QAbstractOpenGLExtension
public:
QOpenGLExtension_EXT_draw_range_elements();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glDrawRangeElementsEXT(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
@@ -9750,7 +9750,7 @@ class QOpenGLExtension_EXT_fog_coord : public QAbstractOpenGLExtension
public:
QOpenGLExtension_EXT_fog_coord();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glFogCoordPointerEXT(GLenum type, GLsizei stride, const GLvoid *pointer);
void glFogCoorddvEXT(const GLdouble *coord);
@@ -9803,7 +9803,7 @@ class QOpenGLExtension_EXT_framebuffer_blit : public QAbstractOpenGLExtension
public:
QOpenGLExtension_EXT_framebuffer_blit();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glBlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
@@ -9828,7 +9828,7 @@ class QOpenGLExtension_EXT_framebuffer_multisample : public QAbstractOpenGLExten
public:
QOpenGLExtension_EXT_framebuffer_multisample();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glRenderbufferStorageMultisampleEXT(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
@@ -9869,7 +9869,7 @@ class QOpenGLExtension_EXT_framebuffer_object : public QAbstractOpenGLExtension
public:
QOpenGLExtension_EXT_framebuffer_object();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glGenerateMipmapEXT(GLenum target);
void glGetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment, GLenum pname, GLint *params);
@@ -10006,7 +10006,7 @@ class QOpenGLExtension_EXT_geometry_shader4 : public QAbstractOpenGLExtension
public:
QOpenGLExtension_EXT_geometry_shader4();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glProgramParameteriEXT(GLuint program, GLenum pname, GLint value);
@@ -10032,7 +10032,7 @@ class QOpenGLExtension_EXT_gpu_program_parameters : public QAbstractOpenGLExtens
public:
QOpenGLExtension_EXT_gpu_program_parameters();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glProgramLocalParameters4fvEXT(GLenum target, GLuint index, GLsizei count, const GLfloat *params);
void glProgramEnvParameters4fvEXT(GLenum target, GLuint index, GLsizei count, const GLfloat *params);
@@ -10074,7 +10074,7 @@ class QOpenGLExtension_EXT_gpu_shader4 : public QAbstractOpenGLExtension
public:
QOpenGLExtension_EXT_gpu_shader4();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glUniform4uivEXT(GLint location, GLsizei count, const GLuint *value);
void glUniform3uivEXT(GLint location, GLsizei count, const GLuint *value);
@@ -10178,7 +10178,7 @@ class QOpenGLExtension_EXT_histogram : public QAbstractOpenGLExtension
public:
QOpenGLExtension_EXT_histogram();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glResetMinmaxEXT(GLenum target);
void glResetHistogramEXT(GLenum target);
@@ -10266,7 +10266,7 @@ class QOpenGLExtension_EXT_index_func : public QAbstractOpenGLExtension
public:
QOpenGLExtension_EXT_index_func();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glIndexFuncEXT(GLenum func, GLclampf ref);
@@ -10291,7 +10291,7 @@ class QOpenGLExtension_EXT_index_material : public QAbstractOpenGLExtension
public:
QOpenGLExtension_EXT_index_material();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glIndexMaterialEXT(GLenum face, GLenum mode);
@@ -10318,7 +10318,7 @@ class QOpenGLExtension_EXT_light_texture : public QAbstractOpenGLExtension
public:
QOpenGLExtension_EXT_light_texture();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glTextureMaterialEXT(GLenum face, GLenum mode);
void glTextureLightEXT(GLenum pname);
@@ -10358,7 +10358,7 @@ class QOpenGLExtension_EXT_multi_draw_arrays : public QAbstractOpenGLExtension
public:
QOpenGLExtension_EXT_multi_draw_arrays();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glMultiDrawElementsEXT(GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount);
void glMultiDrawArraysEXT(GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);
@@ -10391,7 +10391,7 @@ class QOpenGLExtension_EXT_multisample : public QAbstractOpenGLExtension
public:
QOpenGLExtension_EXT_multisample();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glSamplePatternEXT(GLenum pattern);
void glSampleMaskEXT(GLclampf value, GLboolean invert);
@@ -10426,7 +10426,7 @@ class QOpenGLExtension_EXT_paletted_texture : public QAbstractOpenGLExtension
public:
QOpenGLExtension_EXT_paletted_texture();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glGetColorTableParameterfvEXT(GLenum target, GLenum pname, GLfloat *params);
void glGetColorTableParameterivEXT(GLenum target, GLenum pname, GLint *params);
@@ -10477,7 +10477,7 @@ class QOpenGLExtension_EXT_pixel_transform : public QAbstractOpenGLExtension
public:
QOpenGLExtension_EXT_pixel_transform();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glGetPixelTransformParameterfvEXT(GLenum target, GLenum pname, GLfloat *params);
void glGetPixelTransformParameterivEXT(GLenum target, GLenum pname, GLint *params);
@@ -10538,7 +10538,7 @@ class QOpenGLExtension_EXT_point_parameters : public QAbstractOpenGLExtension
public:
QOpenGLExtension_EXT_point_parameters();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glPointParameterfvEXT(GLenum pname, const GLfloat *params);
void glPointParameterfEXT(GLenum pname, GLfloat param);
@@ -10570,7 +10570,7 @@ class QOpenGLExtension_EXT_polygon_offset : public QAbstractOpenGLExtension
public:
QOpenGLExtension_EXT_polygon_offset();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glPolygonOffsetEXT(GLfloat factor, GLfloat bias);
@@ -10595,7 +10595,7 @@ class QOpenGLExtension_EXT_provoking_vertex : public QAbstractOpenGLExtension
public:
QOpenGLExtension_EXT_provoking_vertex();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glProvokingVertexEXT(GLenum mode);
@@ -10636,7 +10636,7 @@ class QOpenGLExtension_EXT_secondary_color : public QAbstractOpenGLExtension
public:
QOpenGLExtension_EXT_secondary_color();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glSecondaryColorPointerEXT(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
void glSecondaryColor3usvEXT(const GLushort *v);
@@ -10775,7 +10775,7 @@ class QOpenGLExtension_EXT_separate_shader_objects : public QAbstractOpenGLExten
public:
QOpenGLExtension_EXT_separate_shader_objects();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
GLuint glCreateShaderProgramEXT(GLenum type, const GLchar *string);
void glActiveProgramEXT(GLuint program);
@@ -10815,7 +10815,7 @@ class QOpenGLExtension_EXT_shader_image_load_store : public QAbstractOpenGLExten
public:
QOpenGLExtension_EXT_shader_image_load_store();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glMemoryBarrierEXT(GLbitfield barriers);
void glBindImageTextureEXT(GLuint index, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLint format);
@@ -10847,7 +10847,7 @@ class QOpenGLExtension_EXT_stencil_clear_tag : public QAbstractOpenGLExtension
public:
QOpenGLExtension_EXT_stencil_clear_tag();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glStencilClearTagEXT(GLsizei stencilTagBits, GLuint stencilClearTag);
@@ -10872,7 +10872,7 @@ class QOpenGLExtension_EXT_stencil_two_side : public QAbstractOpenGLExtension
public:
QOpenGLExtension_EXT_stencil_two_side();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glActiveStencilFaceEXT(GLenum face);
@@ -10898,7 +10898,7 @@ class QOpenGLExtension_EXT_subtexture : public QAbstractOpenGLExtension
public:
QOpenGLExtension_EXT_subtexture();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glTexSubImage2DEXT(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
void glTexSubImage1DEXT(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
@@ -10931,7 +10931,7 @@ class QOpenGLExtension_EXT_texture3D : public QAbstractOpenGLExtension
public:
QOpenGLExtension_EXT_texture3D();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glTexSubImage3DEXT(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
void glTexImage3DEXT(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
@@ -10963,7 +10963,7 @@ class QOpenGLExtension_EXT_texture_buffer_object : public QAbstractOpenGLExtensi
public:
QOpenGLExtension_EXT_texture_buffer_object();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glTexBufferEXT(GLenum target, GLenum internalformat, GLuint buffer);
@@ -10993,7 +10993,7 @@ class QOpenGLExtension_EXT_texture_integer : public QAbstractOpenGLExtension
public:
QOpenGLExtension_EXT_texture_integer();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glClearColorIuiEXT(GLuint red, GLuint green, GLuint blue, GLuint alpha);
void glClearColorIiEXT(GLint red, GLint green, GLint blue, GLint alpha);
@@ -11058,7 +11058,7 @@ class QOpenGLExtension_EXT_texture_object : public QAbstractOpenGLExtension
public:
QOpenGLExtension_EXT_texture_object();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glPrioritizeTexturesEXT(GLsizei n, const GLuint *textures, const GLclampf *priorities);
GLboolean glIsTextureEXT(GLuint texture);
@@ -11118,7 +11118,7 @@ class QOpenGLExtension_EXT_texture_perturb_normal : public QAbstractOpenGLExtens
public:
QOpenGLExtension_EXT_texture_perturb_normal();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glTextureNormalEXT(GLenum mode);
@@ -11144,7 +11144,7 @@ class QOpenGLExtension_EXT_timer_query : public QAbstractOpenGLExtension
public:
QOpenGLExtension_EXT_timer_query();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glGetQueryObjectui64vEXT(GLuint id, GLenum pname, GLuint64EXT *params);
void glGetQueryObjecti64vEXT(GLuint id, GLenum pname, GLint64EXT *params);
@@ -11182,7 +11182,7 @@ class QOpenGLExtension_EXT_transform_feedback : public QAbstractOpenGLExtension
public:
QOpenGLExtension_EXT_transform_feedback();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glGetTransformFeedbackVaryingEXT(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
void glTransformFeedbackVaryingsEXT(GLuint program, GLsizei count, const GLchar* *varyings, GLenum bufferMode);
@@ -11257,7 +11257,7 @@ class QOpenGLExtension_EXT_vertex_array : public QAbstractOpenGLExtension
public:
QOpenGLExtension_EXT_vertex_array();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glVertexPointerEXT(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
void glTexCoordPointerEXT(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
@@ -11348,7 +11348,7 @@ class QOpenGLExtension_EXT_vertex_attrib_64bit : public QAbstractOpenGLExtension
public:
QOpenGLExtension_EXT_vertex_attrib_64bit();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glVertexArrayVertexAttribLOffsetEXT(GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset);
void glGetVertexAttribLdvEXT(GLuint index, GLenum pname, GLdouble *params);
@@ -11484,7 +11484,7 @@ class QOpenGLExtension_EXT_vertex_shader : public QAbstractOpenGLExtension
public:
QOpenGLExtension_EXT_vertex_shader();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glGetLocalConstantFloatvEXT(GLuint id, GLenum value, GLfloat *data);
void glGetLocalConstantIntegervEXT(GLuint id, GLenum value, GLint *data);
@@ -11798,7 +11798,7 @@ class QOpenGLExtension_EXT_vertex_weighting : public QAbstractOpenGLExtension
public:
QOpenGLExtension_EXT_vertex_weighting();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glVertexWeightPointerEXT(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
void glVertexWeightfvEXT(const GLfloat *weight);
@@ -11837,7 +11837,7 @@ class QOpenGLExtension_EXT_x11_sync_object : public QAbstractOpenGLExtension
public:
QOpenGLExtension_EXT_x11_sync_object();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
GLsync glImportSyncEXT(GLenum external_sync_type, GLintptr external_sync, GLbitfield flags);
@@ -11862,7 +11862,7 @@ class QOpenGLExtension_GREMEDY_frame_terminator : public QAbstractOpenGLExtensio
public:
QOpenGLExtension_GREMEDY_frame_terminator();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glFrameTerminatorGREMEDY();
@@ -11887,7 +11887,7 @@ class QOpenGLExtension_GREMEDY_string_marker : public QAbstractOpenGLExtension
public:
QOpenGLExtension_GREMEDY_string_marker();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glStringMarkerGREMEDY(GLsizei len, const GLvoid *string);
@@ -11917,7 +11917,7 @@ class QOpenGLExtension_HP_image_transform : public QAbstractOpenGLExtension
public:
QOpenGLExtension_HP_image_transform();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glGetImageTransformParameterfvHP(GLenum target, GLenum pname, GLfloat *params);
void glGetImageTransformParameterivHP(GLenum target, GLenum pname, GLint *params);
@@ -11978,7 +11978,7 @@ class QOpenGLExtension_IBM_multimode_draw_arrays : public QAbstractOpenGLExtensi
public:
QOpenGLExtension_IBM_multimode_draw_arrays();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glMultiModeDrawElementsIBM(const GLenum *mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei primcount, GLint modestride);
void glMultiModeDrawArraysIBM(const GLenum *mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride);
@@ -12017,7 +12017,7 @@ class QOpenGLExtension_IBM_vertex_array_lists : public QAbstractOpenGLExtension
public:
QOpenGLExtension_IBM_vertex_array_lists();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glVertexPointerListIBM(GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
void glTexCoordPointerListIBM(GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride);
@@ -12091,7 +12091,7 @@ class QOpenGLExtension_INGR_blend_func_separate : public QAbstractOpenGLExtensio
public:
QOpenGLExtension_INGR_blend_func_separate();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glBlendFuncSeparateINGR(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
@@ -12119,7 +12119,7 @@ class QOpenGLExtension_INTEL_parallel_arrays : public QAbstractOpenGLExtension
public:
QOpenGLExtension_INTEL_parallel_arrays();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glTexCoordPointervINTEL(GLint size, GLenum type, const GLvoid* *pointer);
void glColorPointervINTEL(GLint size, GLenum type, const GLvoid* *pointer);
@@ -12174,7 +12174,7 @@ class QOpenGLExtension_KHR_debug : public QAbstractOpenGLExtension
public:
QOpenGLExtension_KHR_debug();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glGetObjectPtrLabel(const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label);
void glObjectPtrLabel(const void *ptr, GLsizei length, const GLchar *label);
@@ -12262,7 +12262,7 @@ class QOpenGLExtension_MESA_resize_buffers : public QAbstractOpenGLExtension
public:
QOpenGLExtension_MESA_resize_buffers();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glResizeBuffersMESA();
@@ -12310,7 +12310,7 @@ class QOpenGLExtension_MESA_window_pos : public QAbstractOpenGLExtension
public:
QOpenGLExtension_MESA_window_pos();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glWindowPos4svMESA(const GLshort *v);
void glWindowPos4sMESA(GLshort x, GLshort y, GLshort z, GLshort w);
@@ -12508,7 +12508,7 @@ class QOpenGLExtension_NV_bindless_texture : public QAbstractOpenGLExtension
public:
QOpenGLExtension_NV_bindless_texture();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
GLboolean glIsImageHandleResidentNV(GLuint64 handle);
GLboolean glIsTextureHandleResidentNV(GLuint64 handle);
@@ -12618,7 +12618,7 @@ class QOpenGLExtension_NV_conditional_render : public QAbstractOpenGLExtension
public:
QOpenGLExtension_NV_conditional_render();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glEndConditionalRenderNV();
void glBeginConditionalRenderNV(GLuint id, GLenum mode);
@@ -12650,7 +12650,7 @@ class QOpenGLExtension_NV_copy_image : public QAbstractOpenGLExtension
public:
QOpenGLExtension_NV_copy_image();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glCopyImageSubDataNV(GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
@@ -12677,7 +12677,7 @@ class QOpenGLExtension_NV_depth_buffer_float : public QAbstractOpenGLExtension
public:
QOpenGLExtension_NV_depth_buffer_float();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glDepthBoundsdNV(GLdouble zmin, GLdouble zmax);
void glClearDepthdNV(GLdouble depth);
@@ -12724,7 +12724,7 @@ class QOpenGLExtension_NV_evaluators : public QAbstractOpenGLExtension
public:
QOpenGLExtension_NV_evaluators();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glEvalMapsNV(GLenum target, GLenum mode);
void glGetMapAttribParameterfvNV(GLenum target, GLuint index, GLenum pname, GLfloat *params);
@@ -12807,7 +12807,7 @@ class QOpenGLExtension_NV_explicit_multisample : public QAbstractOpenGLExtension
public:
QOpenGLExtension_NV_explicit_multisample();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glTexRenderbufferNV(GLenum target, GLuint renderbuffer);
void glSampleMaskIndexedNV(GLuint index, GLbitfield mask);
@@ -12852,7 +12852,7 @@ class QOpenGLExtension_NV_fence : public QAbstractOpenGLExtension
public:
QOpenGLExtension_NV_fence();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glSetFenceNV(GLuint fence, GLenum condition);
void glFinishFenceNV(GLuint fence);
@@ -12924,7 +12924,7 @@ class QOpenGLExtension_NV_fragment_program : public QAbstractOpenGLExtension
public:
QOpenGLExtension_NV_fragment_program();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glGetProgramNamedParameterdvNV(GLuint id, GLsizei len, const GLubyte *name, GLdouble *params);
void glGetProgramNamedParameterfvNV(GLuint id, GLsizei len, const GLubyte *name, GLfloat *params);
@@ -12984,7 +12984,7 @@ class QOpenGLExtension_NV_framebuffer_multisample_coverage : public QAbstractOpe
public:
QOpenGLExtension_NV_framebuffer_multisample_coverage();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glRenderbufferStorageMultisampleCoverageNV(GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height);
@@ -13012,7 +13012,7 @@ class QOpenGLExtension_NV_geometry_program4 : public QAbstractOpenGLExtension
public:
QOpenGLExtension_NV_geometry_program4();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glFramebufferTextureFaceEXT(GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face);
void glFramebufferTextureLayerEXT(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
@@ -13073,7 +13073,7 @@ class QOpenGLExtension_NV_gpu_program4 : public QAbstractOpenGLExtension
public:
QOpenGLExtension_NV_gpu_program4();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glGetProgramEnvParameterIuivNV(GLenum target, GLuint index, GLuint *params);
void glGetProgramEnvParameterIivNV(GLenum target, GLuint index, GLint *params);
@@ -13204,7 +13204,7 @@ class QOpenGLExtension_NV_gpu_program5 : public QAbstractOpenGLExtension
public:
QOpenGLExtension_NV_gpu_program5();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glGetProgramSubroutineParameteruivNV(GLenum target, GLuint index, GLuint *param);
void glProgramSubroutineParametersuivNV(GLenum target, GLsizei count, const GLuint *params);
@@ -13268,7 +13268,7 @@ class QOpenGLExtension_NV_gpu_shader5 : public QAbstractOpenGLExtension
public:
QOpenGLExtension_NV_gpu_shader5();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glProgramUniform4ui64vNV(GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
void glProgramUniform3ui64vNV(GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
@@ -13562,7 +13562,7 @@ class QOpenGLExtension_NV_half_float : public QAbstractOpenGLExtension
public:
QOpenGLExtension_NV_half_float();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glVertexAttribs4hvNV(GLuint index, GLsizei n, const GLhalfNV *v);
void glVertexAttribs3hvNV(GLuint index, GLsizei n, const GLhalfNV *v);
@@ -13908,7 +13908,7 @@ class QOpenGLExtension_NV_occlusion_query : public QAbstractOpenGLExtension
public:
QOpenGLExtension_NV_occlusion_query();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glGetOcclusionQueryuivNV(GLuint id, GLenum pname, GLuint *params);
void glGetOcclusionQueryivNV(GLuint id, GLenum pname, GLint *params);
@@ -13977,7 +13977,7 @@ class QOpenGLExtension_NV_parameter_buffer_object : public QAbstractOpenGLExtens
public:
QOpenGLExtension_NV_parameter_buffer_object();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glProgramBufferParametersIuivNV(GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLuint *params);
void glProgramBufferParametersIivNV(GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLint *params);
@@ -14064,7 +14064,7 @@ class QOpenGLExtension_NV_path_rendering : public QAbstractOpenGLExtension
public:
QOpenGLExtension_NV_path_rendering();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
GLboolean glPointAlongPathNV(GLuint path, GLsizei startSegment, GLsizei numSegments, GLfloat distance, GLfloat *x, GLfloat *y, GLfloat *tangentX, GLfloat *tangentY);
GLfloat glGetPathLengthNV(GLuint path, GLsizei startSegment, GLsizei numSegments);
@@ -14426,7 +14426,7 @@ class QOpenGLExtension_NV_pixel_data_range : public QAbstractOpenGLExtension
public:
QOpenGLExtension_NV_pixel_data_range();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glFlushPixelDataRangeNV(GLenum target);
void glPixelDataRangeNV(GLenum target, GLsizei length, const GLvoid *pointer);
@@ -14459,7 +14459,7 @@ class QOpenGLExtension_NV_point_sprite : public QAbstractOpenGLExtension
public:
QOpenGLExtension_NV_point_sprite();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glPointParameterivNV(GLenum pname, const GLint *params);
void glPointParameteriNV(GLenum pname, GLint param);
@@ -14496,7 +14496,7 @@ class QOpenGLExtension_NV_present_video : public QAbstractOpenGLExtension
public:
QOpenGLExtension_NV_present_video();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glGetVideoui64vNV(GLuint video_slot, GLenum pname, GLuint64EXT *params);
void glGetVideoi64vNV(GLuint video_slot, GLenum pname, GLint64EXT *params);
@@ -14557,7 +14557,7 @@ class QOpenGLExtension_NV_primitive_restart : public QAbstractOpenGLExtension
public:
QOpenGLExtension_NV_primitive_restart();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glPrimitiveRestartIndexNV(GLuint index);
void glPrimitiveRestartNV();
@@ -14601,7 +14601,7 @@ class QOpenGLExtension_NV_register_combiners : public QAbstractOpenGLExtension
public:
QOpenGLExtension_NV_register_combiners();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glGetFinalCombinerInputParameterivNV(GLenum variable, GLenum pname, GLint *params);
void glGetFinalCombinerInputParameterfvNV(GLenum variable, GLenum pname, GLfloat *params);
@@ -14711,7 +14711,7 @@ class QOpenGLExtension_NV_register_combiners2 : public QAbstractOpenGLExtension
public:
QOpenGLExtension_NV_register_combiners2();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glGetCombinerStageParameterfvNV(GLenum stage, GLenum pname, GLfloat *params);
void glCombinerStageParameterfvNV(GLenum stage, GLenum pname, const GLfloat *params);
@@ -14756,7 +14756,7 @@ class QOpenGLExtension_NV_shader_buffer_load : public QAbstractOpenGLExtension
public:
QOpenGLExtension_NV_shader_buffer_load();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glProgramUniformui64vNV(GLuint program, GLint location, GLsizei count, const GLuint64EXT *value);
void glProgramUniformui64NV(GLuint program, GLint location, GLuint64EXT value);
@@ -14872,7 +14872,7 @@ class QOpenGLExtension_NV_texture_barrier : public QAbstractOpenGLExtension
public:
QOpenGLExtension_NV_texture_barrier();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glTextureBarrierNV();
@@ -14902,7 +14902,7 @@ class QOpenGLExtension_NV_texture_multisample : public QAbstractOpenGLExtension
public:
QOpenGLExtension_NV_texture_multisample();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glTextureImage3DMultisampleCoverageNV(GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);
void glTextureImage2DMultisampleCoverageNV(GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);
@@ -14973,7 +14973,7 @@ class QOpenGLExtension_NV_transform_feedback : public QAbstractOpenGLExtension
public:
QOpenGLExtension_NV_transform_feedback();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glTransformFeedbackStreamAttribsNV(GLsizei count, const GLint *attribs, GLsizei nbuffers, const GLint *bufstreams, GLenum bufferMode);
void glGetTransformFeedbackVaryingNV(GLuint program, GLuint index, GLint *location);
@@ -15081,7 +15081,7 @@ class QOpenGLExtension_NV_transform_feedback2 : public QAbstractOpenGLExtension
public:
QOpenGLExtension_NV_transform_feedback2();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glDrawTransformFeedbackNV(GLenum mode, GLuint id);
void glResumeTransformFeedbackNV();
@@ -15157,7 +15157,7 @@ class QOpenGLExtension_NV_vdpau_interop : public QAbstractOpenGLExtension
public:
QOpenGLExtension_NV_vdpau_interop();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glVDPAUUnmapSurfacesNV(GLsizei numSurface, const GLvdpauSurfaceNV *surfaces);
void glVDPAUMapSurfacesNV(GLsizei numSurfaces, const GLvdpauSurfaceNV *surfaces);
@@ -15246,7 +15246,7 @@ class QOpenGLExtension_NV_vertex_array_range : public QAbstractOpenGLExtension
public:
QOpenGLExtension_NV_vertex_array_range();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glVertexArrayRangeNV(GLsizei length, const GLvoid *pointer);
void glFlushVertexArrayRangeNV();
@@ -15296,7 +15296,7 @@ class QOpenGLExtension_NV_vertex_attrib_integer_64bit : public QAbstractOpenGLEx
public:
QOpenGLExtension_NV_vertex_attrib_integer_64bit();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glVertexAttribLFormatNV(GLuint index, GLint size, GLenum type, GLsizei stride);
void glGetVertexAttribLui64vNV(GLuint index, GLenum pname, GLuint64EXT *params);
@@ -15458,7 +15458,7 @@ class QOpenGLExtension_NV_vertex_buffer_unified_memory : public QAbstractOpenGLE
public:
QOpenGLExtension_NV_vertex_buffer_unified_memory();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glGetIntegerui64i_vNV(GLenum value, GLuint index, GLuint64EXT *result);
void glVertexAttribIFormatNV(GLuint index, GLint size, GLenum type, GLsizei stride);
@@ -15623,7 +15623,7 @@ class QOpenGLExtension_NV_vertex_program : public QAbstractOpenGLExtension
public:
QOpenGLExtension_NV_vertex_program();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glVertexAttribs4ubvNV(GLuint index, GLsizei count, const GLubyte *v);
void glVertexAttribs4svNV(GLuint index, GLsizei count, const GLshort *v);
@@ -16111,7 +16111,7 @@ class QOpenGLExtension_NV_vertex_program4 : public QAbstractOpenGLExtension
public:
QOpenGLExtension_NV_vertex_program4();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glGetVertexAttribIuivEXT(GLuint index, GLenum pname, GLuint *params);
void glGetVertexAttribIivEXT(GLuint index, GLenum pname, GLint *params);
@@ -16301,7 +16301,7 @@ class QOpenGLExtension_NV_video_capture : public QAbstractOpenGLExtension
public:
QOpenGLExtension_NV_video_capture();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glVideoCaptureStreamParameterdvNV(GLuint video_capture_slot, GLuint stream, GLenum pname, const GLdouble *params);
void glVideoCaptureStreamParameterfvNV(GLuint video_capture_slot, GLuint stream, GLenum pname, const GLfloat *params);
@@ -16403,7 +16403,7 @@ class QOpenGLExtension_PGI_misc_hints : public QAbstractOpenGLExtension
public:
QOpenGLExtension_PGI_misc_hints();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glHintPGI(GLenum target, GLint mode);
@@ -16429,7 +16429,7 @@ class QOpenGLExtension_SGIS_detail_texture : public QAbstractOpenGLExtension
public:
QOpenGLExtension_SGIS_detail_texture();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glGetDetailTexFuncSGIS(GLenum target, GLfloat *points);
void glDetailTexFuncSGIS(GLenum target, GLsizei n, const GLfloat *points);
@@ -16462,7 +16462,7 @@ class QOpenGLExtension_SGIS_fog_function : public QAbstractOpenGLExtension
public:
QOpenGLExtension_SGIS_fog_function();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glGetFogFuncSGIS(GLfloat *points);
void glFogFuncSGIS(GLsizei n, const GLfloat *points);
@@ -16495,7 +16495,7 @@ class QOpenGLExtension_SGIS_multisample : public QAbstractOpenGLExtension
public:
QOpenGLExtension_SGIS_multisample();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glSamplePatternSGIS(GLenum pattern);
void glSampleMaskSGIS(GLclampf value, GLboolean invert);
@@ -16532,7 +16532,7 @@ class QOpenGLExtension_SGIS_pixel_texture : public QAbstractOpenGLExtension
public:
QOpenGLExtension_SGIS_pixel_texture();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glGetPixelTexGenParameterfvSGIS(GLenum pname, GLfloat *params);
void glGetPixelTexGenParameterivSGIS(GLenum pname, GLint *params);
@@ -16593,7 +16593,7 @@ class QOpenGLExtension_SGIS_point_parameters : public QAbstractOpenGLExtension
public:
QOpenGLExtension_SGIS_point_parameters();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glPointParameterfvSGIS(GLenum pname, const GLfloat *params);
void glPointParameterfSGIS(GLenum pname, GLfloat param);
@@ -16626,7 +16626,7 @@ class QOpenGLExtension_SGIS_sharpen_texture : public QAbstractOpenGLExtension
public:
QOpenGLExtension_SGIS_sharpen_texture();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glGetSharpenTexFuncSGIS(GLenum target, GLfloat *points);
void glSharpenTexFuncSGIS(GLenum target, GLsizei n, const GLfloat *points);
@@ -16659,7 +16659,7 @@ class QOpenGLExtension_SGIS_texture4D : public QAbstractOpenGLExtension
public:
QOpenGLExtension_SGIS_texture4D();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glTexSubImage4DSGIS(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const GLvoid *pixels);
void glTexImage4DSGIS(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
@@ -16691,7 +16691,7 @@ class QOpenGLExtension_SGIS_texture_color_mask : public QAbstractOpenGLExtension
public:
QOpenGLExtension_SGIS_texture_color_mask();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glTextureColorMaskSGIS(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
@@ -16717,7 +16717,7 @@ class QOpenGLExtension_SGIS_texture_filter4 : public QAbstractOpenGLExtension
public:
QOpenGLExtension_SGIS_texture_filter4();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glTexFilterFuncSGIS(GLenum target, GLenum filter, GLsizei n, const GLfloat *weights);
void glGetTexFilterFuncSGIS(GLenum target, GLenum filter, GLfloat *weights);
@@ -16754,7 +16754,7 @@ class QOpenGLExtension_SGIX_async : public QAbstractOpenGLExtension
public:
QOpenGLExtension_SGIX_async();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
GLboolean glIsAsyncMarkerSGIX(GLuint marker);
void glDeleteAsyncMarkersSGIX(GLuint marker, GLsizei range);
@@ -16814,7 +16814,7 @@ class QOpenGLExtension_SGIX_flush_raster : public QAbstractOpenGLExtension
public:
QOpenGLExtension_SGIX_flush_raster();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glFlushRasterSGIX();
@@ -16856,7 +16856,7 @@ class QOpenGLExtension_SGIX_fragment_lighting : public QAbstractOpenGLExtension
public:
QOpenGLExtension_SGIX_fragment_lighting();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glLightEnviSGIX(GLenum pname, GLint param);
void glGetFragmentMaterialivSGIX(GLenum face, GLenum pname, GLint *params);
@@ -17000,7 +17000,7 @@ class QOpenGLExtension_SGIX_framezoom : public QAbstractOpenGLExtension
public:
QOpenGLExtension_SGIX_framezoom();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glFrameZoomSGIX(GLint factor);
@@ -17025,7 +17025,7 @@ class QOpenGLExtension_SGIX_igloo_interface : public QAbstractOpenGLExtension
public:
QOpenGLExtension_SGIX_igloo_interface();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glIglooInterfaceSGIX(GLenum pname, const GLvoid *params);
@@ -17055,7 +17055,7 @@ class QOpenGLExtension_SGIX_instruments : public QAbstractOpenGLExtension
public:
QOpenGLExtension_SGIX_instruments();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glStopInstrumentsSGIX(GLint marker);
void glStartInstrumentsSGIX();
@@ -17120,7 +17120,7 @@ class QOpenGLExtension_SGIX_list_priority : public QAbstractOpenGLExtension
public:
QOpenGLExtension_SGIX_list_priority();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glListParameterivSGIX(GLuint list, GLenum pname, const GLint *params);
void glListParameteriSGIX(GLuint list, GLenum pname, GLint param);
@@ -17180,7 +17180,7 @@ class QOpenGLExtension_SGIX_pixel_texture : public QAbstractOpenGLExtension
public:
QOpenGLExtension_SGIX_pixel_texture();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glPixelTexGenSGIX(GLenum mode);
@@ -17208,7 +17208,7 @@ class QOpenGLExtension_SGIX_polynomial_ffd : public QAbstractOpenGLExtension
public:
QOpenGLExtension_SGIX_polynomial_ffd();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glLoadIdentityDeformationMapSGIX(GLbitfield mask);
void glDeformSGIX(GLbitfield mask);
@@ -17254,7 +17254,7 @@ class QOpenGLExtension_SGIX_reference_plane : public QAbstractOpenGLExtension
public:
QOpenGLExtension_SGIX_reference_plane();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glReferencePlaneSGIX(const GLdouble *equation);
@@ -17282,7 +17282,7 @@ class QOpenGLExtension_SGIX_sprite : public QAbstractOpenGLExtension
public:
QOpenGLExtension_SGIX_sprite();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glSpriteParameterivSGIX(GLenum pname, const GLint *params);
void glSpriteParameteriSGIX(GLenum pname, GLint param);
@@ -17328,7 +17328,7 @@ class QOpenGLExtension_SGIX_tag_sample_buffer : public QAbstractOpenGLExtension
public:
QOpenGLExtension_SGIX_tag_sample_buffer();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glTagSampleBufferSGIX();
@@ -17359,7 +17359,7 @@ class QOpenGLExtension_SGI_color_table : public QAbstractOpenGLExtension
public:
QOpenGLExtension_SGI_color_table();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glGetColorTableParameterivSGI(GLenum target, GLenum pname, GLint *params);
void glGetColorTableParameterfvSGI(GLenum target, GLenum pname, GLfloat *params);
@@ -17426,7 +17426,7 @@ class QOpenGLExtension_SUNX_constant_data : public QAbstractOpenGLExtension
public:
QOpenGLExtension_SUNX_constant_data();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glFinishTextureSUNX();
@@ -17458,7 +17458,7 @@ class QOpenGLExtension_SUN_global_alpha : public QAbstractOpenGLExtension
public:
QOpenGLExtension_SUN_global_alpha();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glGlobalAlphaFactoruiSUN(GLuint factor);
void glGlobalAlphaFactorusSUN(GLushort factor);
@@ -17532,7 +17532,7 @@ class QOpenGLExtension_SUN_mesh_array : public QAbstractOpenGLExtension
public:
QOpenGLExtension_SUN_mesh_array();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glDrawMeshArraysSUN(GLenum mode, GLint first, GLsizei count, GLsizei width);
@@ -17563,7 +17563,7 @@ class QOpenGLExtension_SUN_triangle_list : public QAbstractOpenGLExtension
public:
QOpenGLExtension_SUN_triangle_list();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glReplacementCodePointerSUN(GLenum type, GLsizei stride, const GLvoid* *pointer);
void glReplacementCodeubvSUN(const GLubyte *code);
@@ -17669,7 +17669,7 @@ class QOpenGLExtension_SUN_vertex : public QAbstractOpenGLExtension
public:
QOpenGLExtension_SUN_vertex();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN(const GLuint *rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
void glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN(GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
@@ -17971,7 +17971,7 @@ class QOpenGLExtension_OES_EGL_image : public QAbstractOpenGLExtension
public:
QOpenGLExtension_OES_EGL_image();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glEGLImageTargetTexture2DOES(GLenum target, GLeglImageOES image);
void glEGLImageTargetRenderbufferStorageOES(GLenum target, GLeglImageOES image);
@@ -18004,7 +18004,7 @@ class QOpenGLExtension_OES_get_program_binary : public QAbstractOpenGLExtension
public:
QOpenGLExtension_OES_get_program_binary();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glGetProgramBinaryOES(GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary);
void glProgramBinaryOES(GLuint program, GLenum binaryFormat, const GLvoid *binary, GLint length);
@@ -18038,7 +18038,7 @@ class QOpenGLExtension_OES_mapbuffer : public QAbstractOpenGLExtension
public:
QOpenGLExtension_OES_mapbuffer();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void* glMapBufferOES(GLenum target, GLenum access);
GLboolean glUnmapBufferOES(GLenum target);
@@ -18082,7 +18082,7 @@ class QOpenGLExtension_OES_texture_3D : public QAbstractOpenGLExtension
public:
QOpenGLExtension_OES_texture_3D();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glTexImage3DOES(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels);
void glTexSubImage3DOES(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* pixels);
@@ -18145,7 +18145,7 @@ class QOpenGLExtension_OES_vertex_array_object : public QAbstractOpenGLExtension
public:
QOpenGLExtension_OES_vertex_array_object();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glBindVertexArrayOES(GLuint array);
void glDeleteVertexArraysOES(GLsizei n, const GLuint *arrays);
@@ -18201,7 +18201,7 @@ class QOpenGLExtension_AMD_performance_monitor : public QAbstractOpenGLExtension
public:
QOpenGLExtension_AMD_performance_monitor();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glGetPerfMonitorGroupsAMD(GLint *numGroups, GLsizei groupsSize, GLuint *groups);
void glGetPerfMonitorCountersAMD(GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters);
@@ -18296,7 +18296,7 @@ class QOpenGLExtension_ANGLE_framebuffer_blit : public QAbstractOpenGLExtension
public:
QOpenGLExtension_ANGLE_framebuffer_blit();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glBlitFramebufferANGLE(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
@@ -18321,7 +18321,7 @@ class QOpenGLExtension_ANGLE_framebuffer_multisample : public QAbstractOpenGLExt
public:
QOpenGLExtension_ANGLE_framebuffer_multisample();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glRenderbufferStorageMultisampleANGLE(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
@@ -18348,7 +18348,7 @@ class QOpenGLExtension_ANGLE_instanced_arrays : public QAbstractOpenGLExtension
public:
QOpenGLExtension_ANGLE_instanced_arrays();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glDrawArraysInstancedANGLE(GLenum mode, GLint first, GLsizei count, GLsizei primcount);
void glDrawElementsInstancedANGLE(GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount);
@@ -18387,7 +18387,7 @@ class QOpenGLExtension_ANGLE_translated_shader_source : public QAbstractOpenGLEx
public:
QOpenGLExtension_ANGLE_translated_shader_source();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glGetTranslatedShaderSourceANGLE(GLuint shader, GLsizei bufsize, GLsizei *length, GLchar *source);
@@ -18413,7 +18413,7 @@ class QOpenGLExtension_APPLE_framebuffer_multisample : public QAbstractOpenGLExt
public:
QOpenGLExtension_APPLE_framebuffer_multisample();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glRenderbufferStorageMultisampleAPPLE(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
void glResolveMultisampleFramebufferAPPLE(void);
@@ -18446,7 +18446,7 @@ class QOpenGLExtension_EXT_debug_label : public QAbstractOpenGLExtension
public:
QOpenGLExtension_EXT_debug_label();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glLabelObjectEXT(GLenum type, GLuint object, GLsizei length, const GLchar *label);
void glGetObjectLabelEXT(GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label);
@@ -18480,7 +18480,7 @@ class QOpenGLExtension_EXT_debug_marker : public QAbstractOpenGLExtension
public:
QOpenGLExtension_EXT_debug_marker();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glInsertEventMarkerEXT(GLsizei length, const GLchar *marker);
void glPushGroupMarkerEXT(GLsizei length, const GLchar *marker);
@@ -18519,7 +18519,7 @@ class QOpenGLExtension_EXT_discard_framebuffer : public QAbstractOpenGLExtension
public:
QOpenGLExtension_EXT_discard_framebuffer();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glDiscardFramebufferEXT(GLenum target, GLsizei numAttachments, const GLenum *attachments);
@@ -18545,7 +18545,7 @@ class QOpenGLExtension_EXT_multisampled_render_to_texture : public QAbstractOpen
public:
QOpenGLExtension_EXT_multisampled_render_to_texture();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glRenderbufferStorageMultisampleEXT(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
void glFramebufferTexture2DMultisampleEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
@@ -18578,7 +18578,7 @@ class QOpenGLExtension_EXT_multi_draw_arrays : public QAbstractOpenGLExtension
public:
QOpenGLExtension_EXT_multi_draw_arrays();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glMultiDrawArraysEXT(GLenum mode, GLint *first, GLsizei *count, GLsizei primcount);
void glMultiDrawElementsEXT(GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount);
@@ -18616,7 +18616,7 @@ class QOpenGLExtension_EXT_occlusion_query_boolean : public QAbstractOpenGLExten
public:
QOpenGLExtension_EXT_occlusion_query_boolean();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glGenQueriesEXT(GLsizei n, GLuint *ids);
void glDeleteQueriesEXT(GLsizei n, const GLuint *ids);
@@ -18686,7 +18686,7 @@ class QOpenGLExtension_EXT_robustness : public QAbstractOpenGLExtension
public:
QOpenGLExtension_EXT_robustness();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
GLenum glGetGraphicsResetStatusEXT(void);
void glReadnPixelsEXT(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data);
@@ -18761,7 +18761,7 @@ class QOpenGLExtension_EXT_separate_shader_objects : public QAbstractOpenGLExten
public:
QOpenGLExtension_EXT_separate_shader_objects();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glUseProgramStagesEXT(GLuint pipeline, GLbitfield stages, GLuint program);
void glActiveShaderProgramEXT(GLuint pipeline, GLuint program);
@@ -18994,7 +18994,7 @@ class QOpenGLExtension_EXT_texture_storage : public QAbstractOpenGLExtension
public:
QOpenGLExtension_EXT_texture_storage();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glTexStorage1DEXT(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
void glTexStorage2DEXT(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
@@ -19055,7 +19055,7 @@ class QOpenGLExtension_IMG_multisampled_render_to_texture : public QAbstractOpen
public:
QOpenGLExtension_IMG_multisampled_render_to_texture();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glRenderbufferStorageMultisampleIMG(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
void glFramebufferTexture2DMultisampleIMG(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
@@ -19088,7 +19088,7 @@ class QOpenGLExtension_NV_coverage_sample : public QAbstractOpenGLExtension
public:
QOpenGLExtension_NV_coverage_sample();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glCoverageMaskNV(GLboolean mask);
void glCoverageOperationNV(GLenum operation);
@@ -19120,7 +19120,7 @@ class QOpenGLExtension_NV_draw_buffers : public QAbstractOpenGLExtension
public:
QOpenGLExtension_NV_draw_buffers();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glDrawBuffersNV(GLsizei n, const GLenum *bufs);
@@ -19151,7 +19151,7 @@ class QOpenGLExtension_NV_fence : public QAbstractOpenGLExtension
public:
QOpenGLExtension_NV_fence();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glDeleteFencesNV(GLsizei n, const GLuint *fences);
void glGenFencesNV(GLsizei n, GLuint *fences);
@@ -19218,7 +19218,7 @@ class QOpenGLExtension_NV_read_buffer : public QAbstractOpenGLExtension
public:
QOpenGLExtension_NV_read_buffer();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glReadBufferNV(GLenum mode);
@@ -19243,7 +19243,7 @@ class QOpenGLExtension_QCOM_alpha_test : public QAbstractOpenGLExtension
public:
QOpenGLExtension_QCOM_alpha_test();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glAlphaFuncQCOM(GLenum func, GLclampf ref);
@@ -19271,7 +19271,7 @@ class QOpenGLExtension_QCOM_driver_control : public QAbstractOpenGLExtension
public:
QOpenGLExtension_QCOM_driver_control();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glGetDriverControlsQCOM(GLint *num, GLsizei size, GLuint *driverControls);
void glGetDriverControlStringQCOM(GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString);
@@ -19324,7 +19324,7 @@ class QOpenGLExtension_QCOM_extended_get : public QAbstractOpenGLExtension
public:
QOpenGLExtension_QCOM_extended_get();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glExtGetTexturesQCOM(GLuint *textures, GLint maxTextures, GLint *numTextures);
void glExtGetBuffersQCOM(GLuint *buffers, GLint maxBuffers, GLint *numBuffers);
@@ -19401,7 +19401,7 @@ class QOpenGLExtension_QCOM_extended_get2 : public QAbstractOpenGLExtension
public:
QOpenGLExtension_QCOM_extended_get2();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glExtGetShadersQCOM(GLuint *shaders, GLint maxShaders, GLint *numShaders);
void glExtGetProgramsQCOM(GLuint *programs, GLint maxPrograms, GLint *numPrograms);
@@ -19448,7 +19448,7 @@ class QOpenGLExtension_QCOM_tiled_rendering : public QAbstractOpenGLExtension
public:
QOpenGLExtension_QCOM_tiled_rendering();
- bool initializeOpenGLFunctions() Q_DECL_FINAL;
+ bool initializeOpenGLFunctions() final;
void glStartTilingQCOM(GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask);
void glEndTilingQCOM(GLbitfield preserveMask);
diff --git a/src/platformsupport/devicediscovery/qdevicediscovery_dummy_p.h b/src/platformsupport/devicediscovery/qdevicediscovery_dummy_p.h
index fea3a06cbd..fe669c8dec 100644
--- a/src/platformsupport/devicediscovery/qdevicediscovery_dummy_p.h
+++ b/src/platformsupport/devicediscovery/qdevicediscovery_dummy_p.h
@@ -61,7 +61,7 @@ class QDeviceDiscoveryDummy : public QDeviceDiscovery
public:
QDeviceDiscoveryDummy(QDeviceTypes types, QObject *parent = 0);
- QStringList scanConnectedDevices() Q_DECL_OVERRIDE;
+ QStringList scanConnectedDevices() override;
};
QT_END_NAMESPACE
diff --git a/src/platformsupport/devicediscovery/qdevicediscovery_static_p.h b/src/platformsupport/devicediscovery/qdevicediscovery_static_p.h
index ab5a9c6f12..93110c3c55 100644
--- a/src/platformsupport/devicediscovery/qdevicediscovery_static_p.h
+++ b/src/platformsupport/devicediscovery/qdevicediscovery_static_p.h
@@ -61,7 +61,7 @@ class QDeviceDiscoveryStatic : public QDeviceDiscovery
public:
QDeviceDiscoveryStatic(QDeviceTypes types, QObject *parent = 0);
- QStringList scanConnectedDevices() Q_DECL_OVERRIDE;
+ QStringList scanConnectedDevices() override;
private:
bool checkDeviceType(const QString &device);
diff --git a/src/platformsupport/devicediscovery/qdevicediscovery_udev_p.h b/src/platformsupport/devicediscovery/qdevicediscovery_udev_p.h
index 3c53ef3f17..28618d0b21 100644
--- a/src/platformsupport/devicediscovery/qdevicediscovery_udev_p.h
+++ b/src/platformsupport/devicediscovery/qdevicediscovery_udev_p.h
@@ -63,7 +63,7 @@ class QDeviceDiscoveryUDev : public QDeviceDiscovery
public:
QDeviceDiscoveryUDev(QDeviceTypes types, struct udev *udev, QObject *parent = 0);
~QDeviceDiscoveryUDev();
- QStringList scanConnectedDevices() Q_DECL_OVERRIDE;
+ QStringList scanConnectedDevices() override;
private slots:
void handleUDevNotification();
diff --git a/src/platformsupport/edid/qedidvendortable_p.h b/src/platformsupport/edid/qedidvendortable_p.h
index d09642d649..948a9cecfc 100644
--- a/src/platformsupport/edid/qedidvendortable_p.h
+++ b/src/platformsupport/edid/qedidvendortable_p.h
@@ -47,6 +47,15 @@
#ifndef QEDIDVENDORTABLE_P_H
#define QEDIDVENDORTABLE_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+
QT_BEGIN_NAMESPACE
typedef struct VendorTable {
diff --git a/src/platformsupport/eglconvenience/qeglpbuffer_p.h b/src/platformsupport/eglconvenience/qeglpbuffer_p.h
index 38370c0e62..eed8cd9dca 100644
--- a/src/platformsupport/eglconvenience/qeglpbuffer_p.h
+++ b/src/platformsupport/eglconvenience/qeglpbuffer_p.h
@@ -63,8 +63,8 @@ public:
QEGLPlatformContext::Flags flags = 0);
~QEGLPbuffer();
- QSurfaceFormat format() const Q_DECL_OVERRIDE { return m_format; }
- bool isValid() const Q_DECL_OVERRIDE { return m_pbuffer != EGL_NO_SURFACE; }
+ QSurfaceFormat format() const override { return m_format; }
+ bool isValid() const override { return m_pbuffer != EGL_NO_SURFACE; }
EGLSurface pbuffer() const { return m_pbuffer; }
diff --git a/src/platformsupport/eglconvenience/qeglplatformcontext_p.h b/src/platformsupport/eglconvenience/qeglplatformcontext_p.h
index 9d41eecd99..d6cbbe4131 100644
--- a/src/platformsupport/eglconvenience/qeglplatformcontext_p.h
+++ b/src/platformsupport/eglconvenience/qeglplatformcontext_p.h
@@ -72,15 +72,15 @@ public:
Flags flags = 0);
~QEGLPlatformContext();
- void initialize() Q_DECL_OVERRIDE;
- bool makeCurrent(QPlatformSurface *surface) Q_DECL_OVERRIDE;
- void doneCurrent() Q_DECL_OVERRIDE;
- void swapBuffers(QPlatformSurface *surface) Q_DECL_OVERRIDE;
- QFunctionPointer getProcAddress(const char *procName) Q_DECL_OVERRIDE;
+ void initialize() override;
+ bool makeCurrent(QPlatformSurface *surface) override;
+ void doneCurrent() override;
+ void swapBuffers(QPlatformSurface *surface) override;
+ QFunctionPointer getProcAddress(const char *procName) override;
- QSurfaceFormat format() const Q_DECL_OVERRIDE;
- bool isSharing() const Q_DECL_OVERRIDE { return m_shareContext != EGL_NO_CONTEXT; }
- bool isValid() const Q_DECL_OVERRIDE { return m_eglContext != EGL_NO_CONTEXT; }
+ QSurfaceFormat format() const override;
+ bool isSharing() const override { return m_shareContext != EGL_NO_CONTEXT; }
+ bool isValid() const override { return m_eglContext != EGL_NO_CONTEXT; }
EGLContext eglContext() const;
EGLDisplay eglDisplay() const;
diff --git a/src/platformsupport/eventdispatchers/qeventdispatcher_glib_p.h b/src/platformsupport/eventdispatchers/qeventdispatcher_glib_p.h
index bed2532856..5930dc68e7 100644
--- a/src/platformsupport/eventdispatchers/qeventdispatcher_glib_p.h
+++ b/src/platformsupport/eventdispatchers/qeventdispatcher_glib_p.h
@@ -67,7 +67,7 @@ public:
explicit QPAEventDispatcherGlib(QObject *parent = 0);
~QPAEventDispatcherGlib();
- bool processEvents(QEventLoop::ProcessEventsFlags flags) Q_DECL_OVERRIDE;
+ bool processEvents(QEventLoop::ProcessEventsFlags flags) override;
QEventLoop::ProcessEventsFlags m_flags;
};
diff --git a/src/platformsupport/eventdispatchers/qwindowsguieventdispatcher_p.h b/src/platformsupport/eventdispatchers/qwindowsguieventdispatcher_p.h
index 9a23b5c0bd..4ff047a60e 100644
--- a/src/platformsupport/eventdispatchers/qwindowsguieventdispatcher_p.h
+++ b/src/platformsupport/eventdispatchers/qwindowsguieventdispatcher_p.h
@@ -63,8 +63,8 @@ public:
static const char *windowsMessageName(UINT msg);
- bool QT_ENSURE_STACK_ALIGNED_FOR_SSE processEvents(QEventLoop::ProcessEventsFlags flags) Q_DECL_OVERRIDE;
- void sendPostedEvents() Q_DECL_OVERRIDE;
+ bool QT_ENSURE_STACK_ALIGNED_FOR_SSE processEvents(QEventLoop::ProcessEventsFlags flags) override;
+ void sendPostedEvents() override;
private:
QEventLoop::ProcessEventsFlags m_flags;
diff --git a/src/platformsupport/fbconvenience/qfbbackingstore_p.h b/src/platformsupport/fbconvenience/qfbbackingstore_p.h
index c8dfe3489c..c4762c9327 100644
--- a/src/platformsupport/fbconvenience/qfbbackingstore_p.h
+++ b/src/platformsupport/fbconvenience/qfbbackingstore_p.h
@@ -66,10 +66,10 @@ public:
QFbBackingStore(QWindow *window);
~QFbBackingStore();
- QPaintDevice *paintDevice() Q_DECL_OVERRIDE { return &mImage; }
- void flush(QWindow *window, const QRegion &region, const QPoint &offset) Q_DECL_OVERRIDE;
+ QPaintDevice *paintDevice() override { return &mImage; }
+ void flush(QWindow *window, const QRegion &region, const QPoint &offset) override;
- void resize(const QSize &size, const QRegion &region) Q_DECL_OVERRIDE;
+ void resize(const QSize &size, const QRegion &region) override;
const QImage image();
QImage toImage() const override;
@@ -77,8 +77,8 @@ public:
void lock();
void unlock();
- void beginPaint(const QRegion &) Q_DECL_OVERRIDE;
- void endPaint() Q_DECL_OVERRIDE;
+ void beginPaint(const QRegion &) override;
+ void endPaint() override;
protected:
friend class QFbWindow;
diff --git a/src/platformsupport/fbconvenience/qfbscreen_p.h b/src/platformsupport/fbconvenience/qfbscreen_p.h
index 1c27a941cc..eed615de36 100644
--- a/src/platformsupport/fbconvenience/qfbscreen_p.h
+++ b/src/platformsupport/fbconvenience/qfbscreen_p.h
@@ -78,14 +78,14 @@ public:
virtual bool initialize();
- QRect geometry() const Q_DECL_OVERRIDE { return mGeometry; }
- int depth() const Q_DECL_OVERRIDE { return mDepth; }
- QImage::Format format() const Q_DECL_OVERRIDE { return mFormat; }
- QSizeF physicalSize() const Q_DECL_OVERRIDE { return mPhysicalSize; }
- QPlatformCursor *cursor() const Q_DECL_OVERRIDE { return mCursor; }
+ QRect geometry() const override { return mGeometry; }
+ int depth() const override { return mDepth; }
+ QImage::Format format() const override { return mFormat; }
+ QSizeF physicalSize() const override { return mPhysicalSize; }
+ QPlatformCursor *cursor() const override { return mCursor; }
QWindow *topWindow() const;
- QWindow *topLevelAt(const QPoint & p) const Q_DECL_OVERRIDE;
+ QWindow *topLevelAt(const QPoint & p) const override;
// compositor api
virtual void addWindow(QFbWindow *window);
@@ -109,7 +109,7 @@ protected:
virtual QRegion doRedraw();
void initializeCompositor();
- bool event(QEvent *event) Q_DECL_OVERRIDE;
+ bool event(QEvent *event) override;
QFbWindow *windowForId(WId wid) const;
diff --git a/src/platformsupport/fbconvenience/qfbwindow_p.h b/src/platformsupport/fbconvenience/qfbwindow_p.h
index 20bac46c69..76b34ce041 100644
--- a/src/platformsupport/fbconvenience/qfbwindow_p.h
+++ b/src/platformsupport/fbconvenience/qfbwindow_p.h
@@ -64,17 +64,17 @@ public:
QFbWindow(QWindow *window);
~QFbWindow();
- void raise() Q_DECL_OVERRIDE;
- void lower() Q_DECL_OVERRIDE;
+ void raise() override;
+ void lower() override;
- void setGeometry(const QRect &rect) Q_DECL_OVERRIDE;
- void setVisible(bool visible) Q_DECL_OVERRIDE;
+ void setGeometry(const QRect &rect) override;
+ void setVisible(bool visible) override;
- void setWindowState(Qt::WindowStates state) Q_DECL_OVERRIDE;
- void setWindowFlags(Qt::WindowFlags type) Q_DECL_OVERRIDE;
+ void setWindowState(Qt::WindowStates state) override;
+ void setWindowFlags(Qt::WindowFlags type) override;
Qt::WindowFlags windowFlags() const;
- WId winId() const Q_DECL_OVERRIDE { return mWindowId; }
+ WId winId() const override { return mWindowId; }
void setBackingStore(QFbBackingStore *store) { mBackingStore = store; }
QFbBackingStore *backingStore() const { return mBackingStore; }
@@ -83,9 +83,9 @@ public:
virtual void repaint(const QRegion&);
- void propagateSizeHints() Q_DECL_OVERRIDE { }
- bool setKeyboardGrabEnabled(bool) Q_DECL_OVERRIDE { return false; }
- bool setMouseGrabEnabled(bool) Q_DECL_OVERRIDE { return false; }
+ void propagateSizeHints() override { }
+ bool setKeyboardGrabEnabled(bool) override { return false; }
+ bool setMouseGrabEnabled(bool) override { return false; }
protected:
friend class QFbScreen;
diff --git a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp
index 969a9c17e0..733d6dc531 100644
--- a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp
+++ b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp
@@ -428,7 +428,7 @@ static void populateFromPattern(FcPattern *pattern)
if (res == FcResultMatch) {
bool hasLang = false;
#if FC_VERSION >= 20297
- FcChar8 *cap = Q_NULLPTR;
+ FcChar8 *cap = nullptr;
FcResult capRes = FcResultNoMatch;
#endif
for (int j = 1; j < QFontDatabase::WritingSystemsCount; ++j) {
@@ -438,7 +438,7 @@ static void populateFromPattern(FcPattern *pattern)
if (langRes != FcLangDifferentLang) {
#if FC_VERSION >= 20297
if (*capabilityForWritingSystem[j] && requiresOpenType(j)) {
- if (cap == Q_NULLPTR)
+ if (cap == nullptr)
capRes = FcPatternGetString(pattern, FC_CAPABILITY, 0, &cap);
if (capRes == FcResultMatch && strstr(reinterpret_cast<const char *>(cap), capabilityForWritingSystem[j]) == 0)
continue;
diff --git a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase_p.h b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase_p.h
index 6a3261de30..a7257c2f98 100644
--- a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase_p.h
+++ b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase_p.h
@@ -61,15 +61,15 @@ class QFontEngineFT;
class QFontconfigDatabase : public QFreeTypeFontDatabase
{
public:
- void populateFontDatabase() Q_DECL_OVERRIDE;
- void invalidate() Q_DECL_OVERRIDE;
- QFontEngineMulti *fontEngineMulti(QFontEngine *fontEngine, QChar::Script script) Q_DECL_OVERRIDE;
- QFontEngine *fontEngine(const QFontDef &fontDef, void *handle) Q_DECL_OVERRIDE;
- QFontEngine *fontEngine(const QByteArray &fontData, qreal pixelSize, QFont::HintingPreference hintingPreference) Q_DECL_OVERRIDE;
- QStringList fallbacksForFamily(const QString &family, QFont::Style style, QFont::StyleHint styleHint, QChar::Script script) const Q_DECL_OVERRIDE;
- QStringList addApplicationFont(const QByteArray &fontData, const QString &fileName) Q_DECL_OVERRIDE;
- QString resolveFontFamilyAlias(const QString &family) const Q_DECL_OVERRIDE;
- QFont defaultFont() const Q_DECL_OVERRIDE;
+ void populateFontDatabase() override;
+ void invalidate() override;
+ QFontEngineMulti *fontEngineMulti(QFontEngine *fontEngine, QChar::Script script) override;
+ QFontEngine *fontEngine(const QFontDef &fontDef, void *handle) override;
+ QFontEngine *fontEngine(const QByteArray &fontData, qreal pixelSize, QFont::HintingPreference hintingPreference) override;
+ QStringList fallbacksForFamily(const QString &family, QFont::Style style, QFont::StyleHint styleHint, QChar::Script script) const override;
+ QStringList addApplicationFont(const QByteArray &fontData, const QString &fileName) override;
+ QString resolveFontFamilyAlias(const QString &family) const override;
+ QFont defaultFont() const override;
private:
void setupFontEngine(QFontEngineFT *engine, const QFontDef &fontDef) const;
diff --git a/src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig_p.h b/src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig_p.h
index 1d2f451722..7f560c2d05 100644
--- a/src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig_p.h
+++ b/src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig_p.h
@@ -63,7 +63,7 @@ public:
~QFontEngineMultiFontConfig();
- bool shouldLoadFontEngineForCharacter(int at, uint ucs4) const Q_DECL_OVERRIDE;
+ bool shouldLoadFontEngineForCharacter(int at, uint ucs4) const override;
private:
FcPattern* getMatchPatternForFallback(int at) const;
diff --git a/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp b/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp
index 73def00017..898cabd786 100644
--- a/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp
+++ b/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp
@@ -1537,7 +1537,7 @@ QFontEngineFT::QGlyphSet *QFontEngineFT::loadGlyphSet(const QTransform &matrix)
// FT_Set_Transform only supports scalable fonts
if (!FT_IS_SCALABLE(freetype->face))
- return matrix.type() <= QTransform::TxTranslate ? &defaultGlyphSet : Q_NULLPTR;
+ return matrix.type() <= QTransform::TxTranslate ? &defaultGlyphSet : nullptr;
FT_Matrix m = QTransformToFTMatrix(matrix);
@@ -1966,7 +1966,7 @@ glyph_metrics_t QFontEngineFT::alphaMapBoundingBox(glyph_t glyph, QFixed subPixe
static inline QImage alphaMapFromGlyphData(QFontEngineFT::Glyph *glyph, QFontEngine::GlyphFormat glyphFormat)
{
- if (glyph == Q_NULLPTR || glyph->height == 0 || glyph->width == 0)
+ if (glyph == nullptr || glyph->height == 0 || glyph->width == 0)
return QImage();
QImage::Format format = QImage::Format_Invalid;
@@ -2014,14 +2014,14 @@ QImage *QFontEngineFT::lockedAlphaMapForGlyph(glyph_t glyphIndex, QFixed subPixe
currentlyLockedAlphaMap = alphaMapFromGlyphData(glyph, neededFormat);
- const bool glyphHasGeometry = glyph != Q_NULLPTR && glyph->height != 0 && glyph->width != 0;
+ const bool glyphHasGeometry = glyph != nullptr && glyph->height != 0 && glyph->width != 0;
if (!cacheEnabled && glyph != &emptyGlyph) {
currentlyLockedAlphaMap = currentlyLockedAlphaMap.copy();
delete glyph;
}
if (!glyphHasGeometry)
- return Q_NULLPTR;
+ return nullptr;
if (currentlyLockedAlphaMap.isNull())
return QFontEngine::lockedAlphaMapForGlyph(glyphIndex, subPixelPosition, neededFormat, t, offset);
@@ -2119,7 +2119,7 @@ QImage QFontEngineFT::alphaRGBMapForGlyph(glyph_t g, QFixed subPixelPosition, co
QImage QFontEngineFT::bitmapForGlyph(glyph_t g, QFixed subPixelPosition, const QTransform &t)
{
Glyph *glyph = loadGlyphFor(g, subPixelPosition, defaultFormat, t);
- if (glyph == Q_NULLPTR)
+ if (glyph == nullptr)
return QImage();
QImage img;
diff --git a/src/platformsupport/fontdatabases/freetype/qfontengine_ft_p.h b/src/platformsupport/fontdatabases/freetype/qfontengine_ft_p.h
index c063f5df30..f5585da7de 100644
--- a/src/platformsupport/fontdatabases/freetype/qfontengine_ft_p.h
+++ b/src/platformsupport/fontdatabases/freetype/qfontengine_ft_p.h
@@ -190,68 +190,68 @@ private:
mutable int fast_glyph_count;
};
- QFontEngine::FaceId faceId() const Q_DECL_OVERRIDE;
- QFontEngine::Properties properties() const Q_DECL_OVERRIDE;
- QFixed emSquareSize() const Q_DECL_OVERRIDE;
- bool supportsSubPixelPositions() const Q_DECL_OVERRIDE
+ QFontEngine::FaceId faceId() const override;
+ QFontEngine::Properties properties() const override;
+ QFixed emSquareSize() const override;
+ bool supportsSubPixelPositions() const override
{
return default_hint_style == HintLight ||
default_hint_style == HintNone;
}
- bool getSfntTableData(uint tag, uchar *buffer, uint *length) const Q_DECL_OVERRIDE;
- int synthesized() const Q_DECL_OVERRIDE;
+ bool getSfntTableData(uint tag, uchar *buffer, uint *length) const override;
+ int synthesized() const override;
- QFixed ascent() const Q_DECL_OVERRIDE;
- QFixed capHeight() const Q_DECL_OVERRIDE;
- QFixed descent() const Q_DECL_OVERRIDE;
- QFixed leading() const Q_DECL_OVERRIDE;
- QFixed xHeight() const Q_DECL_OVERRIDE;
- QFixed averageCharWidth() const Q_DECL_OVERRIDE;
+ QFixed ascent() const override;
+ QFixed capHeight() const override;
+ QFixed descent() const override;
+ QFixed leading() const override;
+ QFixed xHeight() const override;
+ QFixed averageCharWidth() const override;
- qreal maxCharWidth() const Q_DECL_OVERRIDE;
- QFixed lineThickness() const Q_DECL_OVERRIDE;
- QFixed underlinePosition() const Q_DECL_OVERRIDE;
+ qreal maxCharWidth() const override;
+ QFixed lineThickness() const override;
+ QFixed underlinePosition() const override;
- glyph_t glyphIndex(uint ucs4) const Q_DECL_OVERRIDE;
- void doKerning(QGlyphLayout *, ShaperFlags) const Q_DECL_OVERRIDE;
+ glyph_t glyphIndex(uint ucs4) const override;
+ void doKerning(QGlyphLayout *, ShaperFlags) const override;
- void getUnscaledGlyph(glyph_t glyph, QPainterPath *path, glyph_metrics_t *metrics) Q_DECL_OVERRIDE;
+ void getUnscaledGlyph(glyph_t glyph, QPainterPath *path, glyph_metrics_t *metrics) override;
- bool supportsTransformation(const QTransform &transform) const Q_DECL_OVERRIDE;
+ bool supportsTransformation(const QTransform &transform) const override;
void addGlyphsToPath(glyph_t *glyphs, QFixedPoint *positions, int nglyphs,
- QPainterPath *path, QTextItem::RenderFlags flags) Q_DECL_OVERRIDE;
+ QPainterPath *path, QTextItem::RenderFlags flags) override;
void addOutlineToPath(qreal x, qreal y, const QGlyphLayout &glyphs,
- QPainterPath *path, QTextItem::RenderFlags flags) Q_DECL_OVERRIDE;
+ QPainterPath *path, QTextItem::RenderFlags flags) override;
- bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, ShaperFlags flags) const Q_DECL_OVERRIDE;
+ bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, ShaperFlags flags) const override;
- glyph_metrics_t boundingBox(const QGlyphLayout &glyphs) Q_DECL_OVERRIDE;
- glyph_metrics_t boundingBox(glyph_t glyph) Q_DECL_OVERRIDE;
- glyph_metrics_t boundingBox(glyph_t glyph, const QTransform &matrix) Q_DECL_OVERRIDE;
+ glyph_metrics_t boundingBox(const QGlyphLayout &glyphs) override;
+ glyph_metrics_t boundingBox(glyph_t glyph) override;
+ glyph_metrics_t boundingBox(glyph_t glyph, const QTransform &matrix) override;
- void recalcAdvances(QGlyphLayout *glyphs, ShaperFlags flags) const Q_DECL_OVERRIDE;
- QImage alphaMapForGlyph(glyph_t g) Q_DECL_OVERRIDE { return alphaMapForGlyph(g, 0); }
- QImage alphaMapForGlyph(glyph_t, QFixed) Q_DECL_OVERRIDE;
- QImage alphaMapForGlyph(glyph_t glyph, QFixed subPixelPosition, const QTransform &t) Q_DECL_OVERRIDE;
- QImage alphaRGBMapForGlyph(glyph_t, QFixed subPixelPosition, const QTransform &t) Q_DECL_OVERRIDE;
- QImage bitmapForGlyph(glyph_t, QFixed subPixelPosition, const QTransform &t) Q_DECL_OVERRIDE;
+ void recalcAdvances(QGlyphLayout *glyphs, ShaperFlags flags) const override;
+ QImage alphaMapForGlyph(glyph_t g) override { return alphaMapForGlyph(g, 0); }
+ QImage alphaMapForGlyph(glyph_t, QFixed) override;
+ QImage alphaMapForGlyph(glyph_t glyph, QFixed subPixelPosition, const QTransform &t) override;
+ QImage alphaRGBMapForGlyph(glyph_t, QFixed subPixelPosition, const QTransform &t) override;
+ QImage bitmapForGlyph(glyph_t, QFixed subPixelPosition, const QTransform &t) override;
glyph_metrics_t alphaMapBoundingBox(glyph_t glyph,
QFixed subPixelPosition,
const QTransform &matrix,
- QFontEngine::GlyphFormat format) Q_DECL_OVERRIDE;
+ QFontEngine::GlyphFormat format) override;
QImage *lockedAlphaMapForGlyph(glyph_t glyph, QFixed subPixelPosition,
GlyphFormat neededFormat, const QTransform &t,
- QPoint *offset) Q_DECL_OVERRIDE;
- bool hasInternalCaching() const Q_DECL_OVERRIDE { return cacheEnabled; }
- void unlockAlphaMapForGlyph() Q_DECL_OVERRIDE;
- bool expectsGammaCorrectedBlending() const Q_DECL_OVERRIDE;
+ QPoint *offset) override;
+ bool hasInternalCaching() const override { return cacheEnabled; }
+ void unlockAlphaMapForGlyph() override;
+ bool expectsGammaCorrectedBlending() const override;
- void removeGlyphFromCache(glyph_t glyph) Q_DECL_OVERRIDE;
- int glyphMargin(QFontEngine::GlyphFormat /* format */) Q_DECL_OVERRIDE { return 0; }
+ void removeGlyphFromCache(glyph_t glyph) override;
+ int glyphMargin(QFontEngine::GlyphFormat /* format */) override { return 0; }
- int glyphCount() const Q_DECL_OVERRIDE;
+ int glyphCount() const override;
enum Scaling {
Scaled,
@@ -282,13 +282,13 @@ private:
bool init(FaceId faceId, bool antialias, GlyphFormat format,
QFreetypeFace *freetypeFace);
- int getPointInOutline(glyph_t glyph, int flags, quint32 point, QFixed *xpos, QFixed *ypos, quint32 *nPoints) Q_DECL_OVERRIDE;
+ int getPointInOutline(glyph_t glyph, int flags, quint32 point, QFixed *xpos, QFixed *ypos, quint32 *nPoints) override;
void setQtDefaultHintStyle(QFont::HintingPreference hintingPreference);
- void setDefaultHintStyle(HintStyle style) Q_DECL_OVERRIDE;
+ void setDefaultHintStyle(HintStyle style) override;
- QFontEngine *cloneWithSize(qreal pixelSize) const Q_DECL_OVERRIDE;
- Qt::HANDLE handle() const Q_DECL_OVERRIDE;
+ QFontEngine *cloneWithSize(qreal pixelSize) const override;
+ Qt::HANDLE handle() const override;
bool initFromFontEngine(const QFontEngineFT *fontEngine);
HintStyle defaultHintStyle() const { return default_hint_style; }
diff --git a/src/platformsupport/fontdatabases/freetype/qfreetypefontdatabase_p.h b/src/platformsupport/fontdatabases/freetype/qfreetypefontdatabase_p.h
index 6d51361400..0b2956b16e 100644
--- a/src/platformsupport/fontdatabases/freetype/qfreetypefontdatabase_p.h
+++ b/src/platformsupport/fontdatabases/freetype/qfreetypefontdatabase_p.h
@@ -66,11 +66,11 @@ struct FontFile
class QFreeTypeFontDatabase : public QPlatformFontDatabase
{
public:
- void populateFontDatabase() Q_DECL_OVERRIDE;
- QFontEngine *fontEngine(const QFontDef &fontDef, void *handle) Q_DECL_OVERRIDE;
- QFontEngine *fontEngine(const QByteArray &fontData, qreal pixelSize, QFont::HintingPreference hintingPreference) Q_DECL_OVERRIDE;
- QStringList addApplicationFont(const QByteArray &fontData, const QString &fileName) Q_DECL_OVERRIDE;
- void releaseHandle(void *handle) Q_DECL_OVERRIDE;
+ void populateFontDatabase() override;
+ QFontEngine *fontEngine(const QFontDef &fontDef, void *handle) override;
+ QFontEngine *fontEngine(const QByteArray &fontData, qreal pixelSize, QFont::HintingPreference hintingPreference) override;
+ QStringList addApplicationFont(const QByteArray &fontData, const QString &fileName) override;
+ void releaseHandle(void *handle) override;
static QStringList addTTFile(const QByteArray &fontData, const QByteArray &file);
};
diff --git a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h
index 2b4c4e3ceb..76ab31c046 100644
--- a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h
+++ b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h
@@ -70,18 +70,18 @@ class QCoreTextFontDatabase : public QPlatformFontDatabase
public:
QCoreTextFontDatabase();
~QCoreTextFontDatabase();
- void populateFontDatabase() Q_DECL_OVERRIDE;
+ void populateFontDatabase() override;
bool populateFamilyAliases() override;
- void populateFamily(const QString &familyName) Q_DECL_OVERRIDE;
+ void populateFamily(const QString &familyName) override;
void invalidate() override;
- QStringList fallbacksForFamily(const QString &family, QFont::Style style, QFont::StyleHint styleHint, QChar::Script script) const Q_DECL_OVERRIDE;
- QStringList addApplicationFont(const QByteArray &fontData, const QString &fileName) Q_DECL_OVERRIDE;
- void releaseHandle(void *handle) Q_DECL_OVERRIDE;
- bool isPrivateFontFamily(const QString &family) const Q_DECL_OVERRIDE;
- QFont defaultFont() const Q_DECL_OVERRIDE;
- bool fontsAlwaysScalable() const Q_DECL_OVERRIDE;
- QList<int> standardSizes() const Q_DECL_OVERRIDE;
+ QStringList fallbacksForFamily(const QString &family, QFont::Style style, QFont::StyleHint styleHint, QChar::Script script) const override;
+ QStringList addApplicationFont(const QByteArray &fontData, const QString &fileName) override;
+ void releaseHandle(void *handle) override;
+ bool isPrivateFontFamily(const QString &family) const override;
+ QFont defaultFont() const override;
+ bool fontsAlwaysScalable() const override;
+ QList<int> standardSizes() const override;
// For iOS and OS X platform themes
QFont *themeFont(QPlatformTheme::Font) const;
diff --git a/src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h b/src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h
index 2986f0aaec..1f7b346909 100644
--- a/src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h
+++ b/src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h
@@ -70,53 +70,53 @@ public:
QCoreTextFontEngine(CGFontRef font, const QFontDef &def);
~QCoreTextFontEngine();
- glyph_t glyphIndex(uint ucs4) const Q_DECL_OVERRIDE;
- bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, ShaperFlags flags) const Q_DECL_OVERRIDE;
- void recalcAdvances(QGlyphLayout *, ShaperFlags) const Q_DECL_OVERRIDE;
+ glyph_t glyphIndex(uint ucs4) const override;
+ bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, ShaperFlags flags) const override;
+ void recalcAdvances(QGlyphLayout *, ShaperFlags) const override;
- glyph_metrics_t boundingBox(const QGlyphLayout &glyphs) Q_DECL_OVERRIDE;
- glyph_metrics_t boundingBox(glyph_t glyph) Q_DECL_OVERRIDE;
+ glyph_metrics_t boundingBox(const QGlyphLayout &glyphs) override;
+ glyph_metrics_t boundingBox(glyph_t glyph) override;
- QFixed ascent() const Q_DECL_OVERRIDE;
- QFixed capHeight() const Q_DECL_OVERRIDE;
- QFixed descent() const Q_DECL_OVERRIDE;
- QFixed leading() const Q_DECL_OVERRIDE;
- QFixed xHeight() const Q_DECL_OVERRIDE;
- qreal maxCharWidth() const Q_DECL_OVERRIDE;
- QFixed averageCharWidth() const Q_DECL_OVERRIDE;
+ QFixed ascent() const override;
+ QFixed capHeight() const override;
+ QFixed descent() const override;
+ QFixed leading() const override;
+ QFixed xHeight() const override;
+ qreal maxCharWidth() const override;
+ QFixed averageCharWidth() const override;
void addGlyphsToPath(glyph_t *glyphs, QFixedPoint *positions, int numGlyphs,
- QPainterPath *path, QTextItem::RenderFlags) Q_DECL_OVERRIDE;
+ QPainterPath *path, QTextItem::RenderFlags) override;
- bool canRender(const QChar *string, int len) const Q_DECL_OVERRIDE;
+ bool canRender(const QChar *string, int len) const override;
- int synthesized() const Q_DECL_OVERRIDE { return synthesisFlags; }
- bool supportsSubPixelPositions() const Q_DECL_OVERRIDE { return true; }
+ int synthesized() const override { return synthesisFlags; }
+ bool supportsSubPixelPositions() const override { return true; }
- QFixed lineThickness() const Q_DECL_OVERRIDE;
- QFixed underlinePosition() const Q_DECL_OVERRIDE;
+ QFixed lineThickness() const override;
+ QFixed underlinePosition() const override;
void draw(CGContextRef ctx, qreal x, qreal y, const QTextItemInt &ti, int paintDeviceHeight);
- FaceId faceId() const Q_DECL_OVERRIDE;
- bool getSfntTableData(uint /*tag*/, uchar * /*buffer*/, uint * /*length*/) const Q_DECL_OVERRIDE;
- void getUnscaledGlyph(glyph_t glyph, QPainterPath *path, glyph_metrics_t *metrics) Q_DECL_OVERRIDE;
- QImage alphaMapForGlyph(glyph_t, QFixed subPixelPosition) Q_DECL_OVERRIDE;
- QImage alphaMapForGlyph(glyph_t glyph, QFixed subPixelPosition, const QTransform &t) Q_DECL_OVERRIDE;
- QImage alphaRGBMapForGlyph(glyph_t, QFixed subPixelPosition, const QTransform &t) Q_DECL_OVERRIDE;
- glyph_metrics_t alphaMapBoundingBox(glyph_t glyph, QFixed, const QTransform &matrix, GlyphFormat) Q_DECL_OVERRIDE;
- QImage bitmapForGlyph(glyph_t, QFixed subPixelPosition, const QTransform &t) Q_DECL_OVERRIDE;
- QFixed emSquareSize() const Q_DECL_OVERRIDE;
- void doKerning(QGlyphLayout *g, ShaperFlags flags) const Q_DECL_OVERRIDE;
-
- bool supportsTransformation(const QTransform &transform) const Q_DECL_OVERRIDE;
- bool expectsGammaCorrectedBlending() const Q_DECL_OVERRIDE;
-
- QFontEngine *cloneWithSize(qreal pixelSize) const Q_DECL_OVERRIDE;
- Qt::HANDLE handle() const Q_DECL_OVERRIDE;
- int glyphMargin(QFontEngine::GlyphFormat format) Q_DECL_OVERRIDE { Q_UNUSED(format); return 0; }
-
- QFontEngine::Properties properties() const Q_DECL_OVERRIDE;
+ FaceId faceId() const override;
+ bool getSfntTableData(uint /*tag*/, uchar * /*buffer*/, uint * /*length*/) const override;
+ void getUnscaledGlyph(glyph_t glyph, QPainterPath *path, glyph_metrics_t *metrics) override;
+ QImage alphaMapForGlyph(glyph_t, QFixed subPixelPosition) override;
+ QImage alphaMapForGlyph(glyph_t glyph, QFixed subPixelPosition, const QTransform &t) override;
+ QImage alphaRGBMapForGlyph(glyph_t, QFixed subPixelPosition, const QTransform &t) override;
+ glyph_metrics_t alphaMapBoundingBox(glyph_t glyph, QFixed, const QTransform &matrix, GlyphFormat) override;
+ QImage bitmapForGlyph(glyph_t, QFixed subPixelPosition, const QTransform &t) override;
+ QFixed emSquareSize() const override;
+ void doKerning(QGlyphLayout *g, ShaperFlags flags) const override;
+
+ bool supportsTransformation(const QTransform &transform) const override;
+ bool expectsGammaCorrectedBlending() const override;
+
+ QFontEngine *cloneWithSize(qreal pixelSize) const override;
+ Qt::HANDLE handle() const override;
+ int glyphMargin(QFontEngine::GlyphFormat format) override { Q_UNUSED(format); return 0; }
+
+ QFontEngine::Properties properties() const override;
static bool ct_getSfntTable(void *user_data, uint tag, uchar *buffer, uint *length);
static QFont::Weight qtWeightFromCFWeight(float value);
diff --git a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp b/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp
index a0adcd6e2e..def67c6199 100644
--- a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp
+++ b/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp
@@ -76,20 +76,18 @@ typedef HRESULT (WINAPI *DWriteCreateFactoryType)(DWRITE_FACTORY_TYPE, const IID
static inline DWriteCreateFactoryType resolveDWriteCreateFactory()
{
- if (QSysInfo::windowsVersion() < QSysInfo::WV_VISTA)
- return Q_NULLPTR;
QSystemLibrary library(QStringLiteral("dwrite"));
QFunctionPointer result = library.resolve("DWriteCreateFactory");
if (Q_UNLIKELY(!result)) {
qWarning("Unable to load dwrite.dll");
- return Q_NULLPTR;
+ return nullptr;
}
return reinterpret_cast<DWriteCreateFactoryType>(result);
}
static void createDirectWriteFactory(IDWriteFactory **factory)
{
- *factory = Q_NULLPTR;
+ *factory = nullptr;
static const DWriteCreateFactoryType dWriteCreateFactory = resolveDWriteCreateFactory();
if (!dWriteCreateFactory)
@@ -539,7 +537,7 @@ namespace {
class CustomFontFileLoader
{
public:
- CustomFontFileLoader() : m_directWriteFontFileLoader(Q_NULLPTR)
+ CustomFontFileLoader() : m_directWriteFontFileLoader(nullptr)
{
createDirectWriteFactory(&m_directWriteFactory);
@@ -1128,7 +1126,7 @@ static int QT_WIN_CALLBACK storeFont(const LOGFONT *logFont, const TEXTMETRIC *t
// NEWTEXTMETRICEX (passed for TT fonts) is a NEWTEXTMETRIC, which according
// to the documentation is identical to a TEXTMETRIC except for the last four
// members, which we don't use anyway
- const FONTSIGNATURE *signature = Q_NULLPTR;
+ const FONTSIGNATURE *signature = nullptr;
if (type & TRUETYPE_FONTTYPE)
signature = &reinterpret_cast<const NEWTEXTMETRICEX *>(textmetric)->ntmFontSig;
addFontToDatabase(familyName, styleName, *logFont, textmetric, signature, type);
@@ -1719,11 +1717,8 @@ LOGFONT QWindowsFontDatabase::fontDefToLOGFONT(const QFontDef &request, const QS
qual = PROOF_QUALITY;
if (request.styleStrategy & QFont::PreferAntialias) {
- if (QSysInfo::WindowsVersion >= QSysInfo::WV_XP && !(request.styleStrategy & QFont::NoSubpixelAntialias)) {
- qual = CLEARTYPE_QUALITY;
- } else {
- qual = ANTIALIASED_QUALITY;
- }
+ qual = (request.styleStrategy & QFont::NoSubpixelAntialias) == 0
+ ? CLEARTYPE_QUALITY : ANTIALIASED_QUALITY;
} else if (request.styleStrategy & QFont::NoAntialias) {
qual = NONANTIALIASED_QUALITY;
} else if ((request.styleStrategy & QFont::NoSubpixelAntialias) && sharedFontData()->clearTypeEnabled) {
@@ -1910,7 +1905,7 @@ QFontEngine *QWindowsFontDatabase::createEngine(const QFontDef &request, const Q
} else {
bool isColorFont = false;
#if defined(QT_USE_DIRECTWRITE2)
- IDWriteFontFace2 *directWriteFontFace2 = Q_NULLPTR;
+ IDWriteFontFace2 *directWriteFontFace2 = nullptr;
if (SUCCEEDED(directWriteFontFace->QueryInterface(__uuidof(IDWriteFontFace2),
reinterpret_cast<void **>(&directWriteFontFace2)))) {
if (directWriteFontFace2->IsColorFont())
diff --git a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_ft.cpp b/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_ft.cpp
index 3f03b30f10..78477de38a 100644
--- a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_ft.cpp
+++ b/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_ft.cpp
@@ -144,7 +144,7 @@ static FontKeys &fontKeys()
return result;
}
-static const FontKey *findFontKey(const QString &name, int *indexIn = Q_NULLPTR)
+static const FontKey *findFontKey(const QString &name, int *indexIn = nullptr)
{
const FontKeys &keys = fontKeys();
for (auto it = keys.constBegin(), cend = keys.constEnd(); it != cend; ++it) {
@@ -157,7 +157,7 @@ static const FontKey *findFontKey(const QString &name, int *indexIn = Q_NULLPTR)
}
if (indexIn)
*indexIn = -1;
- return Q_NULLPTR;
+ return nullptr;
}
static bool addFontToDatabase(QString familyName,
@@ -310,7 +310,7 @@ static int QT_WIN_CALLBACK storeFont(const LOGFONT *logFont, const TEXTMETRIC *t
// NEWTEXTMETRICEX (passed for TT fonts) is a NEWTEXTMETRIC, which according
// to the documentation is identical to a TEXTMETRIC except for the last four
// members, which we don't use anyway
- const FONTSIGNATURE *signature = Q_NULLPTR;
+ const FONTSIGNATURE *signature = nullptr;
if (type & TRUETYPE_FONTTYPE)
signature = &reinterpret_cast<const NEWTEXTMETRICEX *>(textmetric)->ntmFontSig;
addFontToDatabase(faceName, styleName, fullName, *logFont, textmetric, signature, type);
diff --git a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_ft_p.h b/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_ft_p.h
index 2df81274ad..c3d201b3a0 100644
--- a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_ft_p.h
+++ b/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_ft_p.h
@@ -60,18 +60,18 @@ QT_BEGIN_NAMESPACE
class QWindowsFontDatabaseFT : public QFreeTypeFontDatabase
{
public:
- void populateFontDatabase() Q_DECL_OVERRIDE;
- void populateFamily(const QString &familyName) Q_DECL_OVERRIDE;
- QFontEngine *fontEngine(const QFontDef &fontDef, void *handle) Q_DECL_OVERRIDE;
+ void populateFontDatabase() override;
+ void populateFamily(const QString &familyName) override;
+ QFontEngine *fontEngine(const QFontDef &fontDef, void *handle) override;
QFontEngine *fontEngine(const QByteArray &fontData, qreal pixelSize,
- QFont::HintingPreference hintingPreference) Q_DECL_OVERRIDE;
+ QFont::HintingPreference hintingPreference) override;
QStringList fallbacksForFamily(const QString &family, QFont::Style style,
QFont::StyleHint styleHint,
- QChar::Script script) const Q_DECL_OVERRIDE;
+ QChar::Script script) const override;
- QString fontDir() const Q_DECL_OVERRIDE;
- QFont defaultFont() const Q_DECL_OVERRIDE;
+ QString fontDir() const override;
+ QFont defaultFont() const override;
};
QT_END_NAMESPACE
diff --git a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_p.h b/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_p.h
index 15172c09da..bbdb90f70a 100644
--- a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_p.h
+++ b/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_p.h
@@ -95,18 +95,18 @@ public:
QWindowsFontDatabase();
~QWindowsFontDatabase();
- void populateFontDatabase() Q_DECL_OVERRIDE;
- void populateFamily(const QString &familyName) Q_DECL_OVERRIDE;
- QFontEngineMulti *fontEngineMulti(QFontEngine *fontEngine, QChar::Script script) Q_DECL_OVERRIDE;
- QFontEngine *fontEngine(const QFontDef &fontDef, void *handle) Q_DECL_OVERRIDE;
- QFontEngine *fontEngine(const QByteArray &fontData, qreal pixelSize, QFont::HintingPreference hintingPreference) Q_DECL_OVERRIDE;
- QStringList fallbacksForFamily(const QString &family, QFont::Style style, QFont::StyleHint styleHint, QChar::Script script) const Q_DECL_OVERRIDE;
- QStringList addApplicationFont(const QByteArray &fontData, const QString &fileName) Q_DECL_OVERRIDE;
- void releaseHandle(void *handle) Q_DECL_OVERRIDE;
- QString fontDir() const Q_DECL_OVERRIDE;
-
- QFont defaultFont() const Q_DECL_OVERRIDE { return systemDefaultFont(); }
- bool fontsAlwaysScalable() const Q_DECL_OVERRIDE;
+ void populateFontDatabase() override;
+ void populateFamily(const QString &familyName) override;
+ QFontEngineMulti *fontEngineMulti(QFontEngine *fontEngine, QChar::Script script) override;
+ QFontEngine *fontEngine(const QFontDef &fontDef, void *handle) override;
+ QFontEngine *fontEngine(const QByteArray &fontData, qreal pixelSize, QFont::HintingPreference hintingPreference) override;
+ QStringList fallbacksForFamily(const QString &family, QFont::Style style, QFont::StyleHint styleHint, QChar::Script script) const override;
+ QStringList addApplicationFont(const QByteArray &fontData, const QString &fileName) override;
+ void releaseHandle(void *handle) override;
+ QString fontDir() const override;
+
+ QFont defaultFont() const override { return systemDefaultFont(); }
+ bool fontsAlwaysScalable() const override;
void derefUniqueFont(const QString &uniqueFont);
void refUniqueFont(const QString &uniqueFont);
diff --git a/src/platformsupport/fontdatabases/windows/qwindowsfontengine_p.h b/src/platformsupport/fontdatabases/windows/qwindowsfontengine_p.h
index 76b45d7a7b..2ec391c4da 100644
--- a/src/platformsupport/fontdatabases/windows/qwindowsfontengine_p.h
+++ b/src/platformsupport/fontdatabases/windows/qwindowsfontengine_p.h
@@ -76,53 +76,53 @@ public:
void initFontInfo(const QFontDef &request,
int dpi);
- QFixed lineThickness() const Q_DECL_OVERRIDE;
- Properties properties() const Q_DECL_OVERRIDE;
- void getUnscaledGlyph(glyph_t glyph, QPainterPath *path, glyph_metrics_t *metrics) Q_DECL_OVERRIDE;
- FaceId faceId() const Q_DECL_OVERRIDE;
- bool getSfntTableData(uint tag, uchar *buffer, uint *length) const Q_DECL_OVERRIDE;
- int synthesized() const Q_DECL_OVERRIDE;
- QFixed emSquareSize() const Q_DECL_OVERRIDE;
-
- glyph_t glyphIndex(uint ucs4) const Q_DECL_OVERRIDE;
- bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, ShaperFlags flags) const Q_DECL_OVERRIDE;
- void recalcAdvances(QGlyphLayout *glyphs, ShaperFlags) const Q_DECL_OVERRIDE;
-
- void addOutlineToPath(qreal x, qreal y, const QGlyphLayout &glyphs, QPainterPath *path, QTextItem::RenderFlags flags) Q_DECL_OVERRIDE;
+ QFixed lineThickness() const override;
+ Properties properties() const override;
+ void getUnscaledGlyph(glyph_t glyph, QPainterPath *path, glyph_metrics_t *metrics) override;
+ FaceId faceId() const override;
+ bool getSfntTableData(uint tag, uchar *buffer, uint *length) const override;
+ int synthesized() const override;
+ QFixed emSquareSize() const override;
+
+ glyph_t glyphIndex(uint ucs4) const override;
+ bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, ShaperFlags flags) const override;
+ void recalcAdvances(QGlyphLayout *glyphs, ShaperFlags) const override;
+
+ void addOutlineToPath(qreal x, qreal y, const QGlyphLayout &glyphs, QPainterPath *path, QTextItem::RenderFlags flags) override;
virtual void addGlyphsToPath(glyph_t *glyphs, QFixedPoint *positions, int nglyphs,
- QPainterPath *path, QTextItem::RenderFlags flags) Q_DECL_OVERRIDE;
+ QPainterPath *path, QTextItem::RenderFlags flags) override;
HGDIOBJ selectDesignFont() const;
- glyph_metrics_t boundingBox(const QGlyphLayout &glyphs) Q_DECL_OVERRIDE;
- glyph_metrics_t boundingBox(glyph_t g) Q_DECL_OVERRIDE { return boundingBox(g, QTransform()); }
- glyph_metrics_t boundingBox(glyph_t g, const QTransform &t) Q_DECL_OVERRIDE;
+ glyph_metrics_t boundingBox(const QGlyphLayout &glyphs) override;
+ glyph_metrics_t boundingBox(glyph_t g) override { return boundingBox(g, QTransform()); }
+ glyph_metrics_t boundingBox(glyph_t g, const QTransform &t) override;
- QFixed ascent() const Q_DECL_OVERRIDE;
- QFixed descent() const Q_DECL_OVERRIDE;
- QFixed leading() const Q_DECL_OVERRIDE;
- QFixed xHeight() const Q_DECL_OVERRIDE;
- QFixed capHeight() const Q_DECL_OVERRIDE;
- QFixed averageCharWidth() const Q_DECL_OVERRIDE;
- qreal maxCharWidth() const Q_DECL_OVERRIDE;
- qreal minLeftBearing() const Q_DECL_OVERRIDE;
- qreal minRightBearing() const Q_DECL_OVERRIDE;
+ QFixed ascent() const override;
+ QFixed descent() const override;
+ QFixed leading() const override;
+ QFixed xHeight() const override;
+ QFixed capHeight() const override;
+ QFixed averageCharWidth() const override;
+ qreal maxCharWidth() const override;
+ qreal minLeftBearing() const override;
+ qreal minRightBearing() const override;
- QImage alphaMapForGlyph(glyph_t t) Q_DECL_OVERRIDE { return alphaMapForGlyph(t, QTransform()); }
- QImage alphaMapForGlyph(glyph_t, const QTransform &xform) Q_DECL_OVERRIDE;
- QImage alphaRGBMapForGlyph(glyph_t t, QFixed subPixelPosition, const QTransform &xform) Q_DECL_OVERRIDE;
- glyph_metrics_t alphaMapBoundingBox(glyph_t glyph, QFixed, const QTransform &matrix, GlyphFormat) Q_DECL_OVERRIDE;
+ QImage alphaMapForGlyph(glyph_t t) override { return alphaMapForGlyph(t, QTransform()); }
+ QImage alphaMapForGlyph(glyph_t, const QTransform &xform) override;
+ QImage alphaRGBMapForGlyph(glyph_t t, QFixed subPixelPosition, const QTransform &xform) override;
+ glyph_metrics_t alphaMapBoundingBox(glyph_t glyph, QFixed, const QTransform &matrix, GlyphFormat) override;
- QFontEngine *cloneWithSize(qreal pixelSize) const Q_DECL_OVERRIDE;
- Qt::HANDLE handle() const Q_DECL_OVERRIDE;
- bool supportsTransformation(const QTransform &transform) const Q_DECL_OVERRIDE;
+ QFontEngine *cloneWithSize(qreal pixelSize) const override;
+ Qt::HANDLE handle() const override;
+ bool supportsTransformation(const QTransform &transform) const override;
#ifndef Q_CC_MINGW
- void getGlyphBearings(glyph_t glyph, qreal *leftBearing = 0, qreal *rightBearing = 0) Q_DECL_OVERRIDE;
+ void getGlyphBearings(glyph_t glyph, qreal *leftBearing = 0, qreal *rightBearing = 0) override;
#endif
- bool hasUnreliableGlyphOutline() const Q_DECL_OVERRIDE;
+ bool hasUnreliableGlyphOutline() const override;
int getGlyphIndexes(const QChar *ch, int numChars, QGlyphLayout *glyphs) const;
void getCMap();
@@ -173,7 +173,7 @@ class QWindowsMultiFontEngine : public QFontEngineMulti
public:
explicit QWindowsMultiFontEngine(QFontEngine *fe, int script);
- QFontEngine *loadEngine(int at) Q_DECL_OVERRIDE;
+ QFontEngine *loadEngine(int at) override;
};
QT_END_NAMESPACE
diff --git a/src/platformsupport/fontdatabases/windows/qwindowsfontenginedirectwrite.cpp b/src/platformsupport/fontdatabases/windows/qwindowsfontenginedirectwrite.cpp
index f07e711048..0e017c3b77 100644
--- a/src/platformsupport/fontdatabases/windows/qwindowsfontenginedirectwrite.cpp
+++ b/src/platformsupport/fontdatabases/windows/qwindowsfontenginedirectwrite.cpp
@@ -282,7 +282,7 @@ static UUID uuidIdWriteLocalFontFileLoader()
QString QWindowsFontEngineDirectWrite::filenameFromFontFile(IDWriteFontFile *fontFile)
{
- IDWriteFontFileLoader *loader = Q_NULLPTR;
+ IDWriteFontFileLoader *loader = nullptr;
HRESULT hr = fontFile->GetLoader(&loader);
if (FAILED(hr)) {
@@ -290,11 +290,11 @@ QString QWindowsFontEngineDirectWrite::filenameFromFontFile(IDWriteFontFile *fon
return QString();
}
- QIdWriteLocalFontFileLoader *localLoader = Q_NULLPTR;
+ QIdWriteLocalFontFileLoader *localLoader = nullptr;
hr = loader->QueryInterface(uuidIdWriteLocalFontFileLoader(),
reinterpret_cast<void **>(&localLoader));
- const void *fontFileReferenceKey = Q_NULLPTR;
+ const void *fontFileReferenceKey = nullptr;
UINT32 fontFileReferenceKeySize = 0;
if (SUCCEEDED(hr)) {
hr = fontFile->GetReferenceKey(&fontFileReferenceKey,
@@ -326,10 +326,10 @@ QString QWindowsFontEngineDirectWrite::filenameFromFontFile(IDWriteFontFile *fon
ret = QString::fromWCharArray(filePath.data());
}
- if (localLoader != Q_NULLPTR)
+ if (localLoader != nullptr)
localLoader->Release();
- if (loader != Q_NULLPTR)
+ if (loader != nullptr)
loader->Release();
return ret;
}
@@ -349,7 +349,7 @@ void QWindowsFontEngineDirectWrite::collectMetrics()
m_lineGap = DESIGN_TO_LOGICAL(metrics.lineGap);
m_underlinePosition = DESIGN_TO_LOGICAL(metrics.underlinePosition);
- IDWriteFontFile *fontFile = Q_NULLPTR;
+ IDWriteFontFile *fontFile = nullptr;
UINT32 numberOfFiles = 1;
if (SUCCEEDED(m_directWriteFontFace->GetFiles(&numberOfFiles, &fontFile))) {
m_faceId.filename = QFile::encodeName(filenameFromFontFile(fontFile));
@@ -713,7 +713,7 @@ QImage QWindowsFontEngineDirectWrite::imageForGlyph(glyph_t t,
#if defined(QT_USE_DIRECTWRITE2)
HRESULT hr = DWRITE_E_NOCOLOR;
IDWriteColorGlyphRunEnumerator *enumerator = 0;
- IDWriteFactory2 *factory2 = Q_NULLPTR;
+ IDWriteFactory2 *factory2 = nullptr;
if (glyphFormat == QFontEngine::Format_ARGB
&& SUCCEEDED(m_fontEngineData->directWriteFactory->QueryInterface(__uuidof(IDWriteFactory2),
reinterpret_cast<void **>(&factory2)))) {
diff --git a/src/platformsupport/fontdatabases/windows/qwindowsfontenginedirectwrite_p.h b/src/platformsupport/fontdatabases/windows/qwindowsfontenginedirectwrite_p.h
index db4e79e44f..83fdddfa26 100644
--- a/src/platformsupport/fontdatabases/windows/qwindowsfontenginedirectwrite_p.h
+++ b/src/platformsupport/fontdatabases/windows/qwindowsfontenginedirectwrite_p.h
@@ -80,41 +80,41 @@ public:
void initFontInfo(const QFontDef &request, int dpi);
- QFixed lineThickness() const Q_DECL_OVERRIDE;
- QFixed underlinePosition() const Q_DECL_OVERRIDE;
- bool getSfntTableData(uint tag, uchar *buffer, uint *length) const Q_DECL_OVERRIDE;
- QFixed emSquareSize() const Q_DECL_OVERRIDE;
+ QFixed lineThickness() const override;
+ QFixed underlinePosition() const override;
+ bool getSfntTableData(uint tag, uchar *buffer, uint *length) const override;
+ QFixed emSquareSize() const override;
- glyph_t glyphIndex(uint ucs4) const Q_DECL_OVERRIDE;
+ glyph_t glyphIndex(uint ucs4) const override;
bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs,
- ShaperFlags flags) const Q_DECL_OVERRIDE;
- void recalcAdvances(QGlyphLayout *glyphs, ShaperFlags) const Q_DECL_OVERRIDE;
+ ShaperFlags flags) const override;
+ void recalcAdvances(QGlyphLayout *glyphs, ShaperFlags) const override;
void addGlyphsToPath(glyph_t *glyphs, QFixedPoint *positions, int nglyphs,
- QPainterPath *path, QTextItem::RenderFlags flags) Q_DECL_OVERRIDE;
+ QPainterPath *path, QTextItem::RenderFlags flags) override;
- glyph_metrics_t boundingBox(const QGlyphLayout &glyphs) Q_DECL_OVERRIDE;
- glyph_metrics_t boundingBox(glyph_t g) Q_DECL_OVERRIDE;
+ glyph_metrics_t boundingBox(const QGlyphLayout &glyphs) override;
+ glyph_metrics_t boundingBox(glyph_t g) override;
glyph_metrics_t alphaMapBoundingBox(glyph_t glyph, QFixed,
- const QTransform &matrix, GlyphFormat) Q_DECL_OVERRIDE;
+ const QTransform &matrix, GlyphFormat) override;
- QFixed ascent() const Q_DECL_OVERRIDE;
- QFixed capHeight() const Q_DECL_OVERRIDE;
- QFixed descent() const Q_DECL_OVERRIDE;
- QFixed leading() const Q_DECL_OVERRIDE;
- QFixed xHeight() const Q_DECL_OVERRIDE;
- qreal maxCharWidth() const Q_DECL_OVERRIDE;
- FaceId faceId() const Q_DECL_OVERRIDE;
+ QFixed ascent() const override;
+ QFixed capHeight() const override;
+ QFixed descent() const override;
+ QFixed leading() const override;
+ QFixed xHeight() const override;
+ qreal maxCharWidth() const override;
+ FaceId faceId() const override;
- bool supportsSubPixelPositions() const Q_DECL_OVERRIDE;
+ bool supportsSubPixelPositions() const override;
- QImage alphaMapForGlyph(glyph_t glyph, QFixed subPixelPosition) Q_DECL_OVERRIDE;
- QImage alphaMapForGlyph(glyph_t glyph, QFixed subPixelPosition, const QTransform &t) Q_DECL_OVERRIDE;
- QImage alphaRGBMapForGlyph(glyph_t t, QFixed subPixelPosition, const QTransform &xform) Q_DECL_OVERRIDE;
- QImage bitmapForGlyph(glyph_t, QFixed subPixelPosition, const QTransform &t) Q_DECL_OVERRIDE;
+ QImage alphaMapForGlyph(glyph_t glyph, QFixed subPixelPosition) override;
+ QImage alphaMapForGlyph(glyph_t glyph, QFixed subPixelPosition, const QTransform &t) override;
+ QImage alphaRGBMapForGlyph(glyph_t t, QFixed subPixelPosition, const QTransform &xform) override;
+ QImage bitmapForGlyph(glyph_t, QFixed subPixelPosition, const QTransform &t) override;
- QFontEngine *cloneWithSize(qreal pixelSize) const Q_DECL_OVERRIDE;
- Qt::HANDLE handle() const Q_DECL_OVERRIDE;
+ QFontEngine *cloneWithSize(qreal pixelSize) const override;
+ Qt::HANDLE handle() const override;
const QSharedPointer<QWindowsFontEngineData> &fontEngineData() const { return m_fontEngineData; }
diff --git a/src/platformsupport/fontdatabases/windows/qwindowsnativeimage.cpp b/src/platformsupport/fontdatabases/windows/qwindowsnativeimage.cpp
index f8fcff952a..67a6619b91 100644
--- a/src/platformsupport/fontdatabases/windows/qwindowsnativeimage.cpp
+++ b/src/platformsupport/fontdatabases/windows/qwindowsnativeimage.cpp
@@ -98,7 +98,7 @@ static inline HBITMAP createDIB(HDC hdc, int width, int height,
bmi.blueMask = 0;
}
- uchar *bits = Q_NULLPTR;
+ uchar *bits = nullptr;
HBITMAP bitmap = CreateDIBSection(hdc, reinterpret_cast<BITMAPINFO *>(&bmi),
DIB_RGB_COLORS, reinterpret_cast<void **>(&bits), 0, 0);
if (Q_UNLIKELY(!bitmap || !bits))
diff --git a/src/platformsupport/graphics/qrasterbackingstore_p.h b/src/platformsupport/graphics/qrasterbackingstore_p.h
index 2764fd6432..357e861d1d 100644
--- a/src/platformsupport/graphics/qrasterbackingstore_p.h
+++ b/src/platformsupport/graphics/qrasterbackingstore_p.h
@@ -62,12 +62,12 @@ public:
QRasterBackingStore(QWindow *window);
~QRasterBackingStore();
- void resize(const QSize &size, const QRegion &staticContents) Q_DECL_OVERRIDE;
- bool scroll(const QRegion &area, int dx, int dy) Q_DECL_OVERRIDE;
- void beginPaint(const QRegion &region) Q_DECL_OVERRIDE;
+ void resize(const QSize &size, const QRegion &staticContents) override;
+ bool scroll(const QRegion &area, int dx, int dy) override;
+ void beginPaint(const QRegion &region) override;
- QPaintDevice *paintDevice() Q_DECL_OVERRIDE;
- QImage toImage() const Q_DECL_OVERRIDE;
+ QPaintDevice *paintDevice() override;
+ QImage toImage() const override;
protected:
virtual QImage::Format format() const;
diff --git a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp
index 960f1d2f12..2d6426db7f 100644
--- a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp
+++ b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp
@@ -71,7 +71,7 @@ void QFdContainer::reset() Q_DECL_NOTHROW
}
QEvdevKeyboardHandler::QEvdevKeyboardHandler(const QString &device, QFdContainer &fd, bool disableZap, bool enableCompose, const QString &keymapFile)
- : m_device(device), m_fd(fd.release()), m_notify(Q_NULLPTR),
+ : m_device(device), m_fd(fd.release()), m_notify(nullptr),
m_modifiers(0), m_composing(0), m_dead_unicode(0xffff),
m_no_zap(disableZap), m_do_compose(enableCompose),
m_keymap(0), m_keymap_size(0), m_keycompose(0), m_keycompose_size(0)
@@ -172,7 +172,7 @@ void QEvdevKeyboardHandler::readKeycode()
// by the above error over and over again.
if (errno == ENODEV) {
delete m_notify;
- m_notify = Q_NULLPTR;
+ m_notify = nullptr;
m_fd.reset();
}
return;
diff --git a/src/platformsupport/input/evdevmouse/qevdevmousehandler.cpp b/src/platformsupport/input/evdevmouse/qevdevmousehandler.cpp
index 8614de066f..04372ae4d9 100644
--- a/src/platformsupport/input/evdevmouse/qevdevmousehandler.cpp
+++ b/src/platformsupport/input/evdevmouse/qevdevmousehandler.cpp
@@ -184,7 +184,7 @@ void QEvdevMouseHandler::sendMouseEvent()
m_prevInvalid = false;
}
- emit handleMouseEvent(x, y, m_abs, m_buttons);
+ emit handleMouseEvent(x, y, m_abs, m_buttons, m_button, m_eventType);
m_prevx = m_x;
m_prevy = m_y;
@@ -210,7 +210,7 @@ void QEvdevMouseHandler::readMouseData()
// by the above error over and over again.
if (errno == ENODEV) {
delete m_notify;
- m_notify = Q_NULLPTR;
+ m_notify = nullptr;
qt_safe_close(m_fd);
m_fd = -1;
}
@@ -286,6 +286,8 @@ void QEvdevMouseHandler::readMouseData()
case 0x11f: button = Qt::ExtraButton13; break;
}
m_buttons.setFlag(button, data->value);
+ m_button = button;
+ m_eventType = data->value == 0 ? QEvent::MouseButtonRelease : QEvent::MouseButtonPress;
btnChanged = true;
} else if (data->type == EV_SYN && data->code == SYN_REPORT) {
if (btnChanged) {
@@ -293,6 +295,7 @@ void QEvdevMouseHandler::readMouseData()
sendMouseEvent();
pendingMouseEvent = false;
} else if (posChanged) {
+ m_eventType = QEvent::MouseMove;
posChanged = false;
if (m_compression) {
pendingMouseEvent = true;
diff --git a/src/platformsupport/input/evdevmouse/qevdevmousehandler_p.h b/src/platformsupport/input/evdevmouse/qevdevmousehandler_p.h
index 6cad4b9173..c7f2b04eb2 100644
--- a/src/platformsupport/input/evdevmouse/qevdevmousehandler_p.h
+++ b/src/platformsupport/input/evdevmouse/qevdevmousehandler_p.h
@@ -54,6 +54,7 @@
#include <QObject>
#include <QString>
#include <QPoint>
+#include <QEvent>
QT_BEGIN_NAMESPACE
@@ -69,7 +70,8 @@ public:
void readMouseData();
signals:
- void handleMouseEvent(int x, int y, bool abs, Qt::MouseButtons buttons);
+ void handleMouseEvent(int x, int y, bool abs, Qt::MouseButtons buttons,
+ Qt::MouseButton button, QEvent::Type type);
void handleWheelEvent(QPoint delta);
private:
@@ -86,6 +88,8 @@ private:
bool m_abs;
bool m_compression;
Qt::MouseButtons m_buttons;
+ Qt::MouseButton m_button;
+ QEvent::Type m_eventType;
int m_jitterLimitSquared;
bool m_prevInvalid;
int m_hardwareWidth;
diff --git a/src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp b/src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp
index ba94bcd460..5264736dd6 100644
--- a/src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp
+++ b/src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp
@@ -131,7 +131,8 @@ void QEvdevMouseManager::clampPosition()
m_y = g.bottom() - m_yoffset;
}
-void QEvdevMouseManager::handleMouseEvent(int x, int y, bool abs, Qt::MouseButtons buttons)
+void QEvdevMouseManager::handleMouseEvent(int x, int y, bool abs, Qt::MouseButtons buttons,
+ Qt::MouseButton button, QEvent::Type type)
{
// update current absolute coordinates
if (!abs) {
@@ -147,7 +148,8 @@ void QEvdevMouseManager::handleMouseEvent(int x, int y, bool abs, Qt::MouseButto
QPoint pos(m_x + m_xoffset, m_y + m_yoffset);
// Cannot track the keyboard modifiers ourselves here. Instead, report the
// modifiers from the last key event that has been seen by QGuiApplication.
- QWindowSystemInterface::handleMouseEvent(0, pos, pos, buttons, QGuiApplication::keyboardModifiers());
+ Qt::KeyboardModifiers mods = QGuiApplication::keyboardModifiers();
+ QWindowSystemInterface::handleMouseEvent(0, pos, pos, buttons, button, type, mods);
}
void QEvdevMouseManager::handleWheelEvent(QPoint delta)
diff --git a/src/platformsupport/input/evdevmouse/qevdevmousemanager_p.h b/src/platformsupport/input/evdevmouse/qevdevmousemanager_p.h
index 10703655b3..13a8e3dec5 100644
--- a/src/platformsupport/input/evdevmouse/qevdevmousemanager_p.h
+++ b/src/platformsupport/input/evdevmouse/qevdevmousemanager_p.h
@@ -68,7 +68,8 @@ public:
QEvdevMouseManager(const QString &key, const QString &specification, QObject *parent = 0);
~QEvdevMouseManager();
- void handleMouseEvent(int x, int y, bool abs, Qt::MouseButtons buttons);
+ void handleMouseEvent(int x, int y, bool abs, Qt::MouseButtons buttons,
+ Qt::MouseButton button, QEvent::Type type);
void handleWheelEvent(QPoint delta);
void addMouse(const QString &deviceNode = QString());
diff --git a/src/platformsupport/input/evdevtablet/qevdevtablethandler_p.h b/src/platformsupport/input/evdevtablet/qevdevtablethandler_p.h
index 8d848d6ebb..66e821117a 100644
--- a/src/platformsupport/input/evdevtablet/qevdevtablethandler_p.h
+++ b/src/platformsupport/input/evdevtablet/qevdevtablethandler_p.h
@@ -85,7 +85,7 @@ class QEvdevTabletHandlerThread : public QDaemonThread
public:
explicit QEvdevTabletHandlerThread(const QString &device, const QString &spec, QObject *parent = 0);
~QEvdevTabletHandlerThread();
- void run() Q_DECL_OVERRIDE;
+ void run() override;
QEvdevTabletHandler *handler() { return m_handler; }
private:
diff --git a/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp b/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp
index c7595cf2b3..0ab4c65c45 100644
--- a/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp
+++ b/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp
@@ -192,9 +192,9 @@ static inline bool testBit(long bit, const long *array)
#endif
QEvdevTouchScreenHandler::QEvdevTouchScreenHandler(const QString &device, const QString &spec, QObject *parent)
- : QObject(parent), m_notify(Q_NULLPTR), m_fd(-1), d(Q_NULLPTR), m_device(Q_NULLPTR)
+ : QObject(parent), m_notify(nullptr), m_fd(-1), d(nullptr), m_device(nullptr)
#if QT_CONFIG(mtdev)
- , m_mtdev(Q_NULLPTR)
+ , m_mtdev(nullptr)
#endif
{
setObjectName(QLatin1String("Evdev Touch Handler"));
@@ -427,7 +427,7 @@ err:
qErrnoWarning(errno, "evdevtouch: Could not read from input device");
if (errno == ENODEV) { // device got disconnected -> stop reading
delete m_notify;
- m_notify = Q_NULLPTR;
+ m_notify = nullptr;
QT_CLOSE(m_fd);
m_fd = -1;
@@ -466,7 +466,7 @@ void QEvdevTouchScreenHandler::unregisterTouchDevice()
delete m_device;
}
- m_device = Q_NULLPTR;
+ m_device = nullptr;
}
void QEvdevTouchScreenData::addTouchPoint(const Contact &contact, Qt::TouchPointStates *combinedStates)
@@ -781,13 +781,13 @@ void QEvdevTouchScreenData::reportPoints()
if (m_filtered)
emit q->touchPointsUpdated();
else
- QWindowSystemInterface::handleTouchEvent(Q_NULLPTR, q->touchDevice(), m_touchPoints);
+ QWindowSystemInterface::handleTouchEvent(nullptr, q->touchDevice(), m_touchPoints);
}
QEvdevTouchScreenHandlerThread::QEvdevTouchScreenHandlerThread(const QString &device, const QString &spec, QObject *parent)
- : QDaemonThread(parent), m_device(device), m_spec(spec), m_handler(Q_NULLPTR), m_touchDeviceRegistered(false)
+ : QDaemonThread(parent), m_device(device), m_spec(spec), m_handler(nullptr), m_touchDeviceRegistered(false)
, m_touchUpdatePending(false)
- , m_filterWindow(Q_NULLPTR)
+ , m_filterWindow(nullptr)
, m_touchRate(-1)
{
start();
@@ -812,7 +812,7 @@ void QEvdevTouchScreenHandlerThread::run()
exec();
delete m_handler;
- m_handler = Q_NULLPTR;
+ m_handler = nullptr;
}
bool QEvdevTouchScreenHandlerThread::isTouchDeviceRegistered() const
@@ -953,7 +953,7 @@ void QEvdevTouchScreenHandlerThread::filterAndSendTouchPoints()
m_filteredPoints = filteredPoints;
- QWindowSystemInterface::handleTouchEvent(Q_NULLPTR,
+ QWindowSystemInterface::handleTouchEvent(nullptr,
m_handler->touchDevice(),
points);
}
diff --git a/src/platformsupport/input/evdevtouch/qevdevtouchhandler_p.h b/src/platformsupport/input/evdevtouch/qevdevtouchhandler_p.h
index a0b689a89e..56308d0352 100644
--- a/src/platformsupport/input/evdevtouch/qevdevtouchhandler_p.h
+++ b/src/platformsupport/input/evdevtouch/qevdevtouchhandler_p.h
@@ -75,7 +75,7 @@ class QEvdevTouchScreenHandler : public QObject
Q_OBJECT
public:
- explicit QEvdevTouchScreenHandler(const QString &device, const QString &spec = QString(), QObject *parent = Q_NULLPTR);
+ explicit QEvdevTouchScreenHandler(const QString &device, const QString &spec = QString(), QObject *parent = nullptr);
~QEvdevTouchScreenHandler();
QTouchDevice *touchDevice() const;
@@ -107,13 +107,13 @@ class QEvdevTouchScreenHandlerThread : public QDaemonThread
{
Q_OBJECT
public:
- explicit QEvdevTouchScreenHandlerThread(const QString &device, const QString &spec, QObject *parent = Q_NULLPTR);
+ explicit QEvdevTouchScreenHandlerThread(const QString &device, const QString &spec, QObject *parent = nullptr);
~QEvdevTouchScreenHandlerThread();
- void run() Q_DECL_OVERRIDE;
+ void run() override;
bool isTouchDeviceRegistered() const;
- bool eventFilter(QObject *object, QEvent *event) Q_DECL_OVERRIDE;
+ bool eventFilter(QObject *object, QEvent *event) override;
void scheduleTouchPointUpdate();
diff --git a/src/platformsupport/input/integrityhid/qintegrityhidmanager.cpp b/src/platformsupport/input/integrityhid/qintegrityhidmanager.cpp
index 8089a6e38b..e472693077 100644
--- a/src/platformsupport/input/integrityhid/qintegrityhidmanager.cpp
+++ b/src/platformsupport/input/integrityhid/qintegrityhidmanager.cpp
@@ -75,8 +75,8 @@ public:
{
CheckSuccess(gh_hid_close(handle));
};
- void process_event(void) Q_DECL_OVERRIDE;
- void async_wait(void) Q_DECL_OVERRIDE;
+ void process_event(void) override;
+ void async_wait(void) override;
HIDDriver *get_driver(void) { return driver; };
HIDHandle get_handle(void) { return handle; };
private:
@@ -94,8 +94,8 @@ public:
{
qDeleteAll(devices);
};
- void process_event(void) Q_DECL_OVERRIDE;
- void async_wait(void) Q_DECL_OVERRIDE;
+ void process_event(void) override;
+ void async_wait(void) override;
void find_devices(void);
private:
QHash<Value, HIDDeviceHandler *> devices;
diff --git a/src/platformsupport/input/libinput/qlibinputhandler.cpp b/src/platformsupport/input/libinput/qlibinputhandler.cpp
index 733cf7d409..52eaa18f4b 100644
--- a/src/platformsupport/input/libinput/qlibinputhandler.cpp
+++ b/src/platformsupport/input/libinput/qlibinputhandler.cpp
@@ -94,7 +94,7 @@ QLibInputHandler::QLibInputHandler(const QString &key, const QString &spec)
if (Q_UNLIKELY(!m_udev))
qFatal("Failed to get udev context for libinput");
- m_li = libinput_udev_create_context(&liInterface, Q_NULLPTR, m_udev);
+ m_li = libinput_udev_create_context(&liInterface, nullptr, m_udev);
if (Q_UNLIKELY(!m_li))
qFatal("Failed to get libinput context");
@@ -140,7 +140,7 @@ void QLibInputHandler::onReadyRead()
}
libinput_event *ev;
- while ((ev = libinput_get_event(m_li)) != Q_NULLPTR) {
+ while ((ev = libinput_get_event(m_li)) != nullptr) {
processEvent(ev);
libinput_event_destroy(ev);
}
diff --git a/src/platformsupport/input/libinput/qlibinputkeyboard.cpp b/src/platformsupport/input/libinput/qlibinputkeyboard.cpp
index f14a2e8f04..21f7fde7c8 100644
--- a/src/platformsupport/input/libinput/qlibinputkeyboard.cpp
+++ b/src/platformsupport/input/libinput/qlibinputkeyboard.cpp
@@ -143,7 +143,7 @@ QLibInputKeyboard::QLibInputKeyboard()
qWarning("Failed to create xkb context");
return;
}
- m_keymap = xkb_keymap_new_from_names(m_ctx, Q_NULLPTR, XKB_KEYMAP_COMPILE_NO_FLAGS);
+ m_keymap = xkb_keymap_new_from_names(m_ctx, nullptr, XKB_KEYMAP_COMPILE_NO_FLAGS);
if (!m_keymap) {
qWarning("Failed to compile keymap");
return;
@@ -211,7 +211,7 @@ void QLibInputKeyboard::processKey(libinput_event_keyboard *e)
xkb_state_update_key(m_state, k, pressed ? XKB_KEY_DOWN : XKB_KEY_UP);
- QWindowSystemInterface::handleExtendedKeyEvent(Q_NULLPTR,
+ QWindowSystemInterface::handleExtendedKeyEvent(nullptr,
pressed ? QEvent::KeyPress : QEvent::KeyRelease,
qtkey, mods, k, sym, mods, text);
@@ -237,7 +237,7 @@ void QLibInputKeyboard::processKey(libinput_event_keyboard *e)
#ifndef QT_NO_XKBCOMMON_EVDEV
void QLibInputKeyboard::handleRepeat()
{
- QWindowSystemInterface::handleExtendedKeyEvent(Q_NULLPTR, QEvent::KeyPress,
+ QWindowSystemInterface::handleExtendedKeyEvent(nullptr, QEvent::KeyPress,
m_repeatData.qtkey, m_repeatData.mods,
m_repeatData.nativeScanCode, m_repeatData.virtualKey, m_repeatData.nativeMods,
m_repeatData.unicodeText, true, m_repeatData.repeatCount);
diff --git a/src/platformsupport/input/libinput/qlibinputpointer.cpp b/src/platformsupport/input/libinput/qlibinputpointer.cpp
index 6879d0cd83..12379a83fa 100644
--- a/src/platformsupport/input/libinput/qlibinputpointer.cpp
+++ b/src/platformsupport/input/libinput/qlibinputpointer.cpp
@@ -39,6 +39,7 @@
#include "qlibinputpointer_p.h"
#include <libinput.h>
+#include <QtCore/QEvent>
#include <QtGui/QGuiApplication>
#include <QtGui/QScreen>
#include <qpa/qwindowsysteminterface.h>
@@ -78,7 +79,10 @@ void QLibInputPointer::processButton(libinput_event_pointer *e)
m_buttons.setFlag(button, pressed);
- QWindowSystemInterface::handleMouseEvent(Q_NULLPTR, m_pos, m_pos, m_buttons, QGuiApplication::keyboardModifiers());
+ QEvent::Type type = pressed ? QEvent::MouseButtonPress : QEvent::MouseButtonRelease;
+ Qt::KeyboardModifiers mods = QGuiApplication::keyboardModifiers();
+
+ QWindowSystemInterface::handleMouseEvent(nullptr, m_pos, m_pos, m_buttons, button, type, mods);
}
void QLibInputPointer::processMotion(libinput_event_pointer *e)
@@ -91,7 +95,10 @@ void QLibInputPointer::processMotion(libinput_event_pointer *e)
m_pos.setX(qBound(g.left(), qRound(m_pos.x() + dx), g.right()));
m_pos.setY(qBound(g.top(), qRound(m_pos.y() + dy), g.bottom()));
- QWindowSystemInterface::handleMouseEvent(Q_NULLPTR, m_pos, m_pos, m_buttons, QGuiApplication::keyboardModifiers());
+ Qt::KeyboardModifiers mods = QGuiApplication::keyboardModifiers();
+
+ QWindowSystemInterface::handleMouseEvent(nullptr, m_pos, m_pos, m_buttons,
+ Qt::NoButton, QEvent::MouseMove, mods);
}
void QLibInputPointer::processAxis(libinput_event_pointer *e)
diff --git a/src/platformsupport/input/libinput/qlibinputtouch.cpp b/src/platformsupport/input/libinput/qlibinputtouch.cpp
index 42925a18e1..a65bc91c39 100644
--- a/src/platformsupport/input/libinput/qlibinputtouch.cpp
+++ b/src/platformsupport/input/libinput/qlibinputtouch.cpp
@@ -53,7 +53,7 @@ QWindowSystemInterface::TouchPoint *QLibInputTouch::DeviceState::point(int32_t s
if (m_points.at(i).id == id)
return &m_points[i];
- return Q_NULLPTR;
+ return nullptr;
}
QLibInputTouch::DeviceState *QLibInputTouch::deviceState(libinput_event_touch *e)
@@ -150,7 +150,7 @@ void QLibInputTouch::processTouchCancel(libinput_event_touch *e)
{
DeviceState *state = deviceState(e);
if (state->m_touchDevice)
- QWindowSystemInterface::handleTouchCancelEvent(Q_NULLPTR, state->m_touchDevice, QGuiApplication::keyboardModifiers());
+ QWindowSystemInterface::handleTouchCancelEvent(nullptr, state->m_touchDevice, QGuiApplication::keyboardModifiers());
else
qWarning("TouchCancel without registered device");
}
@@ -165,7 +165,7 @@ void QLibInputTouch::processTouchFrame(libinput_event_touch *e)
if (state->m_points.isEmpty())
return;
- QWindowSystemInterface::handleTouchEvent(Q_NULLPTR, state->m_touchDevice, state->m_points,
+ QWindowSystemInterface::handleTouchEvent(nullptr, state->m_touchDevice, state->m_points,
QGuiApplication::keyboardModifiers());
for (int i = 0; i < state->m_points.count(); ++i) {
diff --git a/src/platformsupport/kmsconvenience/qkmsdevice.cpp b/src/platformsupport/kmsconvenience/qkmsdevice.cpp
index a25a1e582f..59db3da776 100644
--- a/src/platformsupport/kmsconvenience/qkmsdevice.cpp
+++ b/src/platformsupport/kmsconvenience/qkmsdevice.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2017 The Qt Company Ltd.
** Copyright (C) 2016 Pelagicore AG
** Copyright (C) 2015 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
** Contact: https://www.qt.io/licensing/
@@ -47,6 +47,8 @@
#include <QtCore/QFile>
#include <QtCore/QLoggingCategory>
+#include <errno.h>
+
#define ARRAY_LENGTH(a) (sizeof (a) / sizeof (a)[0])
QT_BEGIN_NAMESPACE
@@ -75,7 +77,7 @@ int QKmsDevice::crtcForConnector(drmModeResPtr resources, drmModeConnectorPtr co
for (int j = 0; j < resources->count_crtcs; j++) {
bool isPossible = possibleCrtcs & (1 << j);
- bool isAvailable = !(m_crtc_allocator & 1 << resources->crtcs[j]);
+ bool isAvailable = !(m_crtc_allocator & (1 << j));
if (isPossible && isAvailable)
return j;
@@ -162,22 +164,24 @@ static bool parseModeline(const QByteArray &text, drmModeModeInfoPtr mode)
QPlatformScreen *QKmsDevice::createScreenForConnector(drmModeResPtr resources,
drmModeConnectorPtr connector,
- VirtualDesktopInfo *vinfo)
+ ScreenInfo *vinfo)
{
+ Q_ASSERT(vinfo);
const QByteArray connectorName = nameForConnector(connector);
const int crtc = crtcForConnector(resources, connector);
if (crtc < 0) {
qWarning() << "No usable crtc/encoder pair for connector" << connectorName;
- return Q_NULLPTR;
+ return nullptr;
}
OutputConfiguration configuration;
QSize configurationSize;
+ int configurationRefresh = 0;
drmModeModeInfo configurationModeline;
auto userConfig = m_screenConfig->outputSettings();
- auto userConnectorConfig = userConfig.value(QString::fromUtf8(connectorName));
+ QVariantMap userConnectorConfig = userConfig.value(QString::fromUtf8(connectorName));
// default to the preferred mode unless overridden in the config
const QByteArray mode = userConnectorConfig.value(QStringLiteral("mode"), QStringLiteral("preferred"))
.toByteArray().toLower();
@@ -187,6 +191,10 @@ QPlatformScreen *QKmsDevice::createScreenForConnector(drmModeResPtr resources,
configuration = OutputConfigPreferred;
} else if (mode == "current") {
configuration = OutputConfigCurrent;
+ } else if (sscanf(mode.constData(), "%dx%d@%d", &configurationSize.rwidth(), &configurationSize.rheight(),
+ &configurationRefresh) == 3)
+ {
+ configuration = OutputConfigMode;
} else if (sscanf(mode.constData(), "%dx%d", &configurationSize.rwidth(), &configurationSize.rheight()) == 2) {
configuration = OutputConfigMode;
} else if (parseModeline(mode, &configurationModeline)) {
@@ -195,31 +203,30 @@ QPlatformScreen *QKmsDevice::createScreenForConnector(drmModeResPtr resources,
qWarning("Invalid mode \"%s\" for output %s", mode.constData(), connectorName.constData());
configuration = OutputConfigPreferred;
}
- if (vinfo) {
- *vinfo = VirtualDesktopInfo();
- vinfo->virtualIndex = userConnectorConfig.value(QStringLiteral("virtualIndex"), INT_MAX).toInt();
- if (userConnectorConfig.contains(QStringLiteral("virtualPos"))) {
- const QByteArray vpos = userConnectorConfig.value(QStringLiteral("virtualPos")).toByteArray();
- const QByteArrayList vposComp = vpos.split(',');
- if (vposComp.count() == 2)
- vinfo->virtualPos = QPoint(vposComp[0].trimmed().toInt(), vposComp[1].trimmed().toInt());
- }
- if (userConnectorConfig.value(QStringLiteral("primary")).toBool())
- vinfo->isPrimary = true;
+
+ *vinfo = ScreenInfo();
+ vinfo->virtualIndex = userConnectorConfig.value(QStringLiteral("virtualIndex"), INT_MAX).toInt();
+ if (userConnectorConfig.contains(QStringLiteral("virtualPos"))) {
+ const QByteArray vpos = userConnectorConfig.value(QStringLiteral("virtualPos")).toByteArray();
+ const QByteArrayList vposComp = vpos.split(',');
+ if (vposComp.count() == 2)
+ vinfo->virtualPos = QPoint(vposComp[0].trimmed().toInt(), vposComp[1].trimmed().toInt());
}
+ if (userConnectorConfig.value(QStringLiteral("primary")).toBool())
+ vinfo->isPrimary = true;
const uint32_t crtc_id = resources->crtcs[crtc];
if (configuration == OutputConfigOff) {
qCDebug(qLcKmsDebug) << "Turning off output" << connectorName;
- drmModeSetCrtc(m_dri_fd, crtc_id, 0, 0, 0, 0, 0, Q_NULLPTR);
- return Q_NULLPTR;
+ drmModeSetCrtc(m_dri_fd, crtc_id, 0, 0, 0, 0, 0, nullptr);
+ return nullptr;
}
// Skip disconnected output
if (configuration == OutputConfigPreferred && connector->connection == DRM_MODE_DISCONNECTED) {
qCDebug(qLcKmsDebug) << "Skipping disconnected output" << connectorName;
- return Q_NULLPTR;
+ return nullptr;
}
// Get the current mode on the current crtc
@@ -230,7 +237,7 @@ QPlatformScreen *QKmsDevice::createScreenForConnector(drmModeResPtr resources,
drmModeFreeEncoder(encoder);
if (!crtc)
- return Q_NULLPTR;
+ return nullptr;
if (crtc->mode_valid)
crtc_mode = crtc->mode;
@@ -240,7 +247,8 @@ QPlatformScreen *QKmsDevice::createScreenForConnector(drmModeResPtr resources,
QList<drmModeModeInfo> modes;
modes.reserve(connector->count_modes);
- qCDebug(qLcKmsDebug) << connectorName << "mode count:" << connector->count_modes;
+ qCDebug(qLcKmsDebug) << connectorName << "mode count:" << connector->count_modes
+ << "crtc index:" << crtc << "crtc id:" << crtc_id;
for (int i = 0; i < connector->count_modes; i++) {
const drmModeModeInfo &mode = connector->modes[i];
qCDebug(qLcKmsDebug) << "mode" << i << mode.hdisplay << "x" << mode.vdisplay
@@ -256,9 +264,11 @@ QPlatformScreen *QKmsDevice::createScreenForConnector(drmModeResPtr resources,
for (int i = modes.size() - 1; i >= 0; i--) {
const drmModeModeInfo &m = modes.at(i);
- if (configuration == OutputConfigMode &&
- m.hdisplay == configurationSize.width() &&
- m.vdisplay == configurationSize.height()) {
+ if (configuration == OutputConfigMode
+ && m.hdisplay == configurationSize.width()
+ && m.vdisplay == configurationSize.height()
+ && (!configurationRefresh || m.vrefresh == uint32_t(configurationRefresh)))
+ {
configured = i;
}
@@ -297,7 +307,7 @@ QPlatformScreen *QKmsDevice::createScreenForConnector(drmModeResPtr resources,
if (selected_mode < 0) {
qWarning() << "No modes available for output" << connectorName;
- return Q_NULLPTR;
+ return nullptr;
} else {
int width = modes[selected_mode].hdisplay;
int height = modes[selected_mode].vdisplay;
@@ -324,24 +334,72 @@ QPlatformScreen *QKmsDevice::createScreenForConnector(drmModeResPtr resources,
}
qCDebug(qLcKmsDebug) << "Physical size is" << physSize << "mm" << "for output" << connectorName;
- QKmsOutput output = {
- QString::fromUtf8(connectorName),
- connector->connector_id,
- crtc_id,
- physSize,
- selected_mode,
- selected_mode,
- false,
- drmModeGetCrtc(m_dri_fd, crtc_id),
- modes,
- connector->subpixel,
- connectorProperty(connector, QByteArrayLiteral("DPMS")),
- connectorPropertyBlob(connector, QByteArrayLiteral("EDID")),
- false,
- 0,
- false
- };
+ const QByteArray formatStr = userConnectorConfig.value(QStringLiteral("format"), QStringLiteral("xrgb8888"))
+ .toByteArray().toLower();
+ uint32_t drmFormat;
+ if (formatStr == "xrgb8888") {
+ drmFormat = DRM_FORMAT_XRGB8888;
+ } else if (formatStr == "xbgr8888") {
+ drmFormat = DRM_FORMAT_XBGR8888;
+ } else if (formatStr == "argb8888") {
+ drmFormat = DRM_FORMAT_ARGB8888;
+ } else if (formatStr == "abgr8888") {
+ drmFormat = DRM_FORMAT_ABGR8888;
+ } else if (formatStr == "rgb565") {
+ drmFormat = DRM_FORMAT_RGB565;
+ } else if (formatStr == "bgr565") {
+ drmFormat = DRM_FORMAT_BGR565;
+ } else if (formatStr == "xrgb2101010") {
+ drmFormat = DRM_FORMAT_XRGB2101010;
+ } else if (formatStr == "xbgr2101010") {
+ drmFormat = DRM_FORMAT_XBGR2101010;
+ } else if (formatStr == "argb2101010") {
+ drmFormat = DRM_FORMAT_ARGB2101010;
+ } else if (formatStr == "abgr2101010") {
+ drmFormat = DRM_FORMAT_ABGR2101010;
+ } else {
+ qWarning("Invalid pixel format \"%s\" for output %s", formatStr.constData(), connectorName.constData());
+ drmFormat = DRM_FORMAT_XRGB8888;
+ }
+
+ const QString cloneSource = userConnectorConfig.value(QStringLiteral("clones")).toString();
+ if (!cloneSource.isEmpty())
+ qCDebug(qLcKmsDebug) << "Output" << connectorName << " clones output " << cloneSource;
+
+ QKmsOutput output;
+ output.name = QString::fromUtf8(connectorName);
+ output.connector_id = connector->connector_id;
+ output.crtc_index = crtc;
+ output.crtc_id = crtc_id;
+ output.physical_size = physSize;
+ output.preferred_mode = preferred >= 0 ? preferred : selected_mode;
+ output.mode = selected_mode;
+ output.mode_set = false;
+ output.saved_crtc = drmModeGetCrtc(m_dri_fd, crtc_id);
+ output.modes = modes;
+ output.subpixel = connector->subpixel;
+ output.dpms_prop = connectorProperty(connector, QByteArrayLiteral("DPMS"));
+ output.edid_blob = connectorPropertyBlob(connector, QByteArrayLiteral("EDID"));
+ output.wants_forced_plane = false;
+ output.forced_plane_id = 0;
+ output.forced_plane_set = false;
+ output.drm_format = drmFormat;
+ output.clone_source = cloneSource;
+
+ QString planeListStr;
+ for (const QKmsPlane &plane : qAsConst(m_planes)) {
+ if (plane.possibleCrtcs & (1 << output.crtc_index)) {
+ output.available_planes.append(plane);
+ planeListStr.append(QString::number(plane.id));
+ planeListStr.append(QLatin1Char(' '));
+ }
+ }
+ qCDebug(qLcKmsDebug, "Output %s can use %d planes: %s",
+ connectorName.constData(), output.available_planes.count(), qPrintable(planeListStr));
+ // This is for the EGLDevice/EGLStream backend. On some of those devices one
+ // may want to target a pre-configured plane. It is probably useless for
+ // eglfs_kms and others. Do not confuse with generic plane support (available_planes).
bool ok;
int idx = qEnvironmentVariableIntValue("QT_QPA_EGLFS_KMS_PLANE_INDEX", &ok);
if (ok) {
@@ -350,8 +408,8 @@ QPlatformScreen *QKmsDevice::createScreenForConnector(drmModeResPtr resources,
if (idx >= 0 && idx < int(planeResources->count_planes)) {
drmModePlane *plane = drmModeGetPlane(m_dri_fd, planeResources->planes[idx]);
if (plane) {
- output.wants_plane = true;
- output.plane_id = plane->plane_id;
+ output.wants_forced_plane = true;
+ output.forced_plane_id = plane->plane_id;
qCDebug(qLcKmsDebug, "Forcing plane index %d, plane id %u (belongs to crtc id %u)",
idx, plane->plane_id, plane->crtc_id);
drmModeFreePlane(plane);
@@ -362,8 +420,9 @@ QPlatformScreen *QKmsDevice::createScreenForConnector(drmModeResPtr resources,
}
}
- m_crtc_allocator |= (1 << output.crtc_id);
- m_connector_allocator |= (1 << output.connector_id);
+ m_crtc_allocator |= (1 << output.crtc_index);
+
+ vinfo->output = output;
return createScreen(output);
}
@@ -381,7 +440,7 @@ drmModePropertyPtr QKmsDevice::connectorProperty(drmModeConnectorPtr connector,
drmModeFreeProperty(prop);
}
- return Q_NULLPTR;
+ return nullptr;
}
drmModePropertyBlobPtr QKmsDevice::connectorPropertyBlob(drmModeConnectorPtr connector, const QByteArray &name)
@@ -406,7 +465,6 @@ QKmsDevice::QKmsDevice(QKmsScreenConfig *screenConfig, const QString &path)
, m_path(path)
, m_dri_fd(-1)
, m_crtc_allocator(0)
- , m_connector_allocator(0)
{
if (m_path.isEmpty()) {
m_path = m_screenConfig->devicePath();
@@ -425,10 +483,10 @@ QKmsDevice::~QKmsDevice()
struct OrderedScreen
{
OrderedScreen() : screen(nullptr) { }
- OrderedScreen(QPlatformScreen *screen, const QKmsDevice::VirtualDesktopInfo &vinfo)
+ OrderedScreen(QPlatformScreen *screen, const QKmsDevice::ScreenInfo &vinfo)
: screen(screen), vinfo(vinfo) { }
QPlatformScreen *screen;
- QKmsDevice::VirtualDesktopInfo vinfo;
+ QKmsDevice::ScreenInfo vinfo;
};
QDebug operator<<(QDebug dbg, const OrderedScreen &s)
@@ -449,12 +507,29 @@ static bool orderedScreenLessThan(const OrderedScreen &a, const OrderedScreen &b
void QKmsDevice::createScreens()
{
+ // Headless mode using a render node: cannot do any output related DRM
+ // stuff. Skip it all and register a dummy screen.
+ if (m_screenConfig->headless()) {
+ QPlatformScreen *screen = createHeadlessScreen();
+ if (screen) {
+ qCDebug(qLcKmsDebug, "Headless mode enabled");
+ registerScreen(screen, true, QPoint(0, 0), QList<QPlatformScreen *>());
+ return;
+ } else {
+ qWarning("QKmsDevice: Requested headless mode without support in the backend. Request is ignored.");
+ }
+ }
+
+ drmSetClientCap(m_dri_fd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1);
+
drmModeResPtr resources = drmModeGetResources(m_dri_fd);
if (!resources) {
- qWarning("drmModeGetResources failed");
+ qErrnoWarning(errno, "drmModeGetResources failed");
return;
}
+ discoverPlanes();
+
QVector<OrderedScreen> screens;
int wantedConnectorIndex = -1;
@@ -475,7 +550,7 @@ void QKmsDevice::createScreens()
if (!connector)
continue;
- VirtualDesktopInfo vinfo;
+ ScreenInfo vinfo;
QPlatformScreen *screen = createScreenForConnector(resources, connector, &vinfo);
if (screen)
screens.append(OrderedScreen(screen, vinfo));
@@ -490,6 +565,32 @@ void QKmsDevice::createScreens()
std::stable_sort(screens.begin(), screens.end(), orderedScreenLessThan);
qCDebug(qLcKmsDebug) << "Sorted screen list:" << screens;
+ // The final list of screens is available, so do the second phase setup.
+ // Hook up clone sources and targets.
+ for (const OrderedScreen &orderedScreen : screens) {
+ QVector<QPlatformScreen *> screensCloningThisScreen;
+ for (const OrderedScreen &s : screens) {
+ if (s.vinfo.output.clone_source == orderedScreen.vinfo.output.name)
+ screensCloningThisScreen.append(s.screen);
+ }
+ QPlatformScreen *screenThisScreenClones = nullptr;
+ if (!orderedScreen.vinfo.output.clone_source.isEmpty()) {
+ for (const OrderedScreen &s : screens) {
+ if (s.vinfo.output.name == orderedScreen.vinfo.output.clone_source) {
+ screenThisScreenClones = s.screen;
+ break;
+ }
+ }
+ }
+ if (screenThisScreenClones)
+ qCDebug(qLcKmsDebug) << orderedScreen.screen->name() << "clones" << screenThisScreenClones;
+ if (!screensCloningThisScreen.isEmpty())
+ qCDebug(qLcKmsDebug) << orderedScreen.screen->name() << "is cloned by" << screensCloningThisScreen;
+
+ registerScreenCloning(orderedScreen.screen, screenThisScreenClones, screensCloningThisScreen);
+ }
+
+ // Figure out the virtual desktop and register the screens to QPA/QGuiApplication.
QPoint pos(0, 0);
QList<QPlatformScreen *> siblings;
QVector<QPoint> virtualPositions;
@@ -531,6 +632,132 @@ void QKmsDevice::createScreens()
}
}
+QPlatformScreen *QKmsDevice::createHeadlessScreen()
+{
+ // headless mode not supported by default
+ return nullptr;
+}
+
+// not all subclasses support screen cloning
+void QKmsDevice::registerScreenCloning(QPlatformScreen *screen,
+ QPlatformScreen *screenThisScreenClones,
+ const QVector<QPlatformScreen *> &screensCloningThisScreen)
+{
+ Q_UNUSED(screen);
+ Q_UNUSED(screenThisScreenClones);
+ Q_UNUSED(screensCloningThisScreen);
+}
+
+// drm_property_type_is is not available in old headers
+static inline bool propTypeIs(drmModePropertyPtr prop, uint32_t type)
+{
+ if (prop->flags & DRM_MODE_PROP_EXTENDED_TYPE)
+ return (prop->flags & DRM_MODE_PROP_EXTENDED_TYPE) == type;
+ return prop->flags & type;
+}
+
+void QKmsDevice::enumerateProperties(drmModeObjectPropertiesPtr objProps, PropCallback callback)
+{
+ for (uint32_t propIdx = 0; propIdx < objProps->count_props; ++propIdx) {
+ drmModePropertyPtr prop = drmModeGetProperty(m_dri_fd, objProps->props[propIdx]);
+ if (!prop)
+ continue;
+
+ const quint64 value = objProps->prop_values[propIdx];
+ qCDebug(qLcKmsDebug, " property %d: id = %u name = '%s'", propIdx, prop->prop_id, prop->name);
+
+ if (propTypeIs(prop, DRM_MODE_PROP_SIGNED_RANGE)) {
+ qCDebug(qLcKmsDebug, " type is SIGNED_RANGE, value is %lld, possible values are:", qint64(value));
+ for (int i = 0; i < prop->count_values; ++i)
+ qCDebug(qLcKmsDebug, " %lld", qint64(prop->values[i]));
+ } else if (propTypeIs(prop, DRM_MODE_PROP_RANGE)) {
+ qCDebug(qLcKmsDebug, " type is RANGE, value is %llu, possible values are:", value);
+ for (int i = 0; i < prop->count_values; ++i)
+ qCDebug(qLcKmsDebug, " %llu", quint64(prop->values[i]));
+ } else if (propTypeIs(prop, DRM_MODE_PROP_ENUM)) {
+ qCDebug(qLcKmsDebug, " type is ENUM, value is %llu, possible values are:", value);
+ for (int i = 0; i < prop->count_enums; ++i)
+ qCDebug(qLcKmsDebug, " enum %d: %s - %llu", i, prop->enums[i].name, prop->enums[i].value);
+ } else if (propTypeIs(prop, DRM_MODE_PROP_BITMASK)) {
+ qCDebug(qLcKmsDebug, " type is BITMASK, value is %llu, possible bits are:", value);
+ for (int i = 0; i < prop->count_enums; ++i)
+ qCDebug(qLcKmsDebug, " bitmask %d: %s - %u", i, prop->enums[i].name, 1 << prop->enums[i].value);
+ } else if (propTypeIs(prop, DRM_MODE_PROP_BLOB)) {
+ qCDebug(qLcKmsDebug, " type is BLOB");
+ } else if (propTypeIs(prop, DRM_MODE_PROP_OBJECT)) {
+ qCDebug(qLcKmsDebug, " type is OBJECT");
+ }
+
+ callback(prop, value);
+
+ drmModeFreeProperty(prop);
+ }
+}
+
+void QKmsDevice::discoverPlanes()
+{
+ m_planes.clear();
+
+ drmModePlaneResPtr planeResources = drmModeGetPlaneResources(m_dri_fd);
+ if (!planeResources)
+ return;
+
+ const int countPlanes = planeResources->count_planes;
+ qCDebug(qLcKmsDebug, "Found %d planes", countPlanes);
+ for (int planeIdx = 0; planeIdx < countPlanes; ++planeIdx) {
+ drmModePlanePtr drmplane = drmModeGetPlane(m_dri_fd, planeResources->planes[planeIdx]);
+ if (!drmplane) {
+ qCDebug(qLcKmsDebug, "Failed to query plane %d, ignoring", planeIdx);
+ continue;
+ }
+
+ QKmsPlane plane;
+ plane.id = drmplane->plane_id;
+ plane.possibleCrtcs = drmplane->possible_crtcs;
+
+ const int countFormats = drmplane->count_formats;
+ QString formatStr;
+ for (int i = 0; i < countFormats; ++i) {
+ uint32_t f = drmplane->formats[i];
+ plane.supportedFormats.append(f);
+ QString s;
+ s.sprintf("%c%c%c%c ", f, f >> 8, f >> 16, f >> 24);
+ formatStr += s;
+ }
+
+ qCDebug(qLcKmsDebug, "plane %d: id = %u countFormats = %d possibleCrtcs = 0x%x supported formats = %s",
+ planeIdx, plane.id, countFormats, plane.possibleCrtcs, qPrintable(formatStr));
+
+ drmModeFreePlane(drmplane);
+
+ drmModeObjectPropertiesPtr objProps = drmModeObjectGetProperties(m_dri_fd, plane.id, DRM_MODE_OBJECT_PLANE);
+ if (!objProps) {
+ qCDebug(qLcKmsDebug, "Failed to query plane %d object properties, ignoring", planeIdx);
+ continue;
+ }
+
+ enumerateProperties(objProps, [&plane](drmModePropertyPtr prop, quint64 value) {
+ if (!strcmp(prop->name, "type")) {
+ plane.type = QKmsPlane::Type(value);
+ } else if (!strcmp(prop->name, "rotation")) {
+ plane.initialRotation = QKmsPlane::Rotations(int(value));
+ plane.availableRotations = 0;
+ if (propTypeIs(prop, DRM_MODE_PROP_BITMASK)) {
+ for (int i = 0; i < prop->count_enums; ++i)
+ plane.availableRotations |= QKmsPlane::Rotation(1 << prop->enums[i].value);
+ }
+ plane.rotationPropertyId = prop->prop_id;
+ }
+ });
+
+ m_planes.append(plane);
+
+ drmModeFreeObjectProperties(objProps);
+ }
+
+ drmModeFreePlaneResources(planeResources);
+}
+
int QKmsDevice::fd() const
{
return m_dri_fd;
@@ -552,7 +779,8 @@ QKmsScreenConfig *QKmsDevice::screenConfig() const
}
QKmsScreenConfig::QKmsScreenConfig()
- : m_hwCursor(true)
+ : m_headless(false)
+ , m_hwCursor(true)
, m_separateScreens(false)
, m_pbuffers(false)
, m_virtualDesktopLayout(VirtualDesktopLayoutHorizontal)
@@ -587,6 +815,16 @@ void QKmsScreenConfig::loadConfig()
const QJsonObject object = doc.object();
+ const QString headlessStr = object.value(QLatin1String("headless")).toString();
+ const QByteArray headless = headlessStr.toUtf8();
+ QSize headlessSize;
+ if (sscanf(headless.constData(), "%dx%d", &headlessSize.rwidth(), &headlessSize.rheight()) == 2) {
+ m_headless = true;
+ m_headlessSize = headlessSize;
+ } else {
+ m_headless = false;
+ }
+
m_hwCursor = object.value(QLatin1String("hwcursor")).toBool(m_hwCursor);
m_pbuffers = object.value(QLatin1String("pbuffers")).toBool(m_pbuffers);
m_devicePath = object.value(QLatin1String("device")).toString();
@@ -618,6 +856,7 @@ void QKmsScreenConfig::loadConfig()
}
qCDebug(qLcKmsDebug) << "Requested configuration (some settings may be ignored):\n"
+ << "\theadless:" << m_headless << "\n"
<< "\thwcursor:" << m_hwCursor << "\n"
<< "\tpbuffers:" << m_pbuffers << "\n"
<< "\tseparateScreens:" << m_separateScreens << "\n"
diff --git a/src/platformsupport/kmsconvenience/qkmsdevice_p.h b/src/platformsupport/kmsconvenience/qkmsdevice_p.h
index 964a0b1775..5eecedec39 100644
--- a/src/platformsupport/kmsconvenience/qkmsdevice_p.h
+++ b/src/platformsupport/kmsconvenience/qkmsdevice_p.h
@@ -59,6 +59,42 @@
#include <xf86drm.h>
#include <xf86drmMode.h>
+#include <drm_fourcc.h>
+
+#include <functional>
+
+// In less fortunate cases one may need to build on a system with dev headers
+// from the dark ages. Let's pull a GL and define the missing stuff outselves.
+
+#ifndef DRM_PLANE_TYPE_OVERLAY
+#define DRM_PLANE_TYPE_OVERLAY 0
+#endif
+#ifndef DRM_PLANE_TYPE_PRIMARY
+#define DRM_PLANE_TYPE_PRIMARY 1
+#endif
+#ifndef DRM_PLANE_TYPE_CURSOR
+#define DRM_PLANE_TYPE_CURSOR 2
+#endif
+
+#ifndef DRM_CLIENT_CAP_UNIVERSAL_PLANES
+#define DRM_CLIENT_CAP_UNIVERSAL_PLANES 2
+#endif
+#ifndef DRM_CLIENT_CAP_ATOMIC
+#define DRM_CLIENT_CAP_ATOMIC 3
+#endif
+
+#ifndef DRM_MODE_PROP_EXTENDED_TYPE
+#define DRM_MODE_PROP_EXTENDED_TYPE 0x0000ffc0
+#endif
+#ifndef DRM_MODE_PROP_TYPE
+#define DRM_MODE_PROP_TYPE(n) ((n) << 6)
+#endif
+#ifndef DRM_MODE_PROP_OBJECT
+#define DRM_MODE_PROP_OBJECT DRM_MODE_PROP_TYPE(1)
+#endif
+#ifndef DRM_MODE_PROP_SIGNED_RANGE
+#define DRM_MODE_PROP_SIGNED_RANGE DRM_MODE_PROP_TYPE(2)
+#endif
QT_BEGIN_NAMESPACE
@@ -76,6 +112,8 @@ public:
QString devicePath() const { return m_devicePath; }
+ bool headless() const { return m_headless; }
+ QSize headlessSize() const { return m_headlessSize; }
bool hwCursor() const { return m_hwCursor; }
bool separateScreens() const { return m_separateScreens; }
bool supportsPBuffers() const { return m_pbuffers; }
@@ -87,6 +125,8 @@ private:
void loadConfig();
QString m_devicePath;
+ bool m_headless;
+ QSize m_headlessSize;
bool m_hwCursor;
bool m_separateScreens;
bool m_pbuffers;
@@ -94,23 +134,63 @@ private:
QMap<QString, QVariantMap> m_outputSettings;
};
+// NB! QKmsPlane does not store the current state and offers no functions to
+// change object properties. Any such functionality belongs to subclasses since
+// in some cases atomic operations will be desired where a mere
+// drmModeObjectSetProperty would not be acceptable.
+struct QKmsPlane
+{
+ enum Type {
+ OverlayPlane = DRM_PLANE_TYPE_OVERLAY,
+ PrimaryPlane = DRM_PLANE_TYPE_PRIMARY,
+ CursorPlane = DRM_PLANE_TYPE_CURSOR
+ };
+
+ enum Rotation {
+ Rotation0 = 1 << 0,
+ Rotation90 = 1 << 1,
+ Rotation180 = 1 << 2,
+ Rotation270 = 1 << 3,
+ RotationReflectX = 1 << 4,
+ RotationReflectY = 1 << 5
+ };
+ Q_DECLARE_FLAGS(Rotations, Rotation)
+
+ uint32_t id = 0;
+ Type type = OverlayPlane;
+
+ int possibleCrtcs = 0;
+
+ QVector<uint32_t> supportedFormats;
+
+ Rotations initialRotation = Rotation0;
+ Rotations availableRotations = Rotation0;
+ uint32_t rotationPropertyId = 0;
+};
+
+Q_DECLARE_OPERATORS_FOR_FLAGS(QKmsPlane::Rotations)
+
struct QKmsOutput
{
QString name;
- uint32_t connector_id;
- uint32_t crtc_id;
+ uint32_t connector_id = 0;
+ uint32_t crtc_index = 0;
+ uint32_t crtc_id = 0;
QSizeF physical_size;
- int preferred_mode; // index of preferred mode in list below
- int mode; // index of selected mode in list below
- bool mode_set;
- drmModeCrtcPtr saved_crtc;
+ int preferred_mode = -1; // index of preferred mode in list below
+ int mode = -1; // index of selected mode in list below
+ bool mode_set = false;
+ drmModeCrtcPtr saved_crtc = nullptr;
QList<drmModeModeInfo> modes;
- int subpixel;
- drmModePropertyPtr dpms_prop;
- drmModePropertyBlobPtr edid_blob;
- bool wants_plane;
- uint32_t plane_id;
- bool plane_set;
+ int subpixel = DRM_MODE_SUBPIXEL_UNKNOWN;
+ drmModePropertyPtr dpms_prop = nullptr;
+ drmModePropertyBlobPtr edid_blob = nullptr;
+ bool wants_forced_plane = false;
+ uint32_t forced_plane_id = 0;
+ bool forced_plane_set = false;
+ uint32_t drm_format = DRM_FORMAT_XRGB8888;
+ QString clone_source;
+ QVector<QKmsPlane> available_planes;
void restoreMode(QKmsDevice *device);
void cleanup(QKmsDevice *device);
@@ -121,11 +201,11 @@ struct QKmsOutput
class QKmsDevice
{
public:
- struct VirtualDesktopInfo {
- VirtualDesktopInfo() : virtualIndex(0), isPrimary(false) { }
- int virtualIndex;
+ struct ScreenInfo {
+ int virtualIndex = 0;
QPoint virtualPos;
- bool isPrimary;
+ bool isPrimary = false;
+ QKmsOutput output;
};
QKmsDevice(QKmsScreenConfig *screenConfig, const QString &path = QString());
@@ -144,6 +224,10 @@ public:
protected:
virtual QPlatformScreen *createScreen(const QKmsOutput &output) = 0;
+ virtual QPlatformScreen *createHeadlessScreen();
+ virtual void registerScreenCloning(QPlatformScreen *screen,
+ QPlatformScreen *screenThisScreenClones,
+ const QVector<QPlatformScreen *> &screensCloningThisScreen);
virtual void registerScreen(QPlatformScreen *screen,
bool isPrimary,
const QPoint &virtualPos,
@@ -153,16 +237,20 @@ protected:
int crtcForConnector(drmModeResPtr resources, drmModeConnectorPtr connector);
QPlatformScreen *createScreenForConnector(drmModeResPtr resources,
drmModeConnectorPtr connector,
- VirtualDesktopInfo *vinfo);
+ ScreenInfo *vinfo);
drmModePropertyPtr connectorProperty(drmModeConnectorPtr connector, const QByteArray &name);
drmModePropertyBlobPtr connectorPropertyBlob(drmModeConnectorPtr connector, const QByteArray &name);
+ typedef std::function<void(drmModePropertyPtr, quint64)> PropCallback;
+ void enumerateProperties(drmModeObjectPropertiesPtr objProps, PropCallback callback);
+ void discoverPlanes();
QKmsScreenConfig *m_screenConfig;
QString m_path;
int m_dri_fd;
quint32 m_crtc_allocator;
- quint32 m_connector_allocator;
+
+ QVector<QKmsPlane> m_planes;
private:
Q_DISABLE_COPY(QKmsDevice)
diff --git a/src/platformsupport/linuxaccessibility/bridge_p.h b/src/platformsupport/linuxaccessibility/bridge_p.h
index 1e435ca351..c48bbd3710 100644
--- a/src/platformsupport/linuxaccessibility/bridge_p.h
+++ b/src/platformsupport/linuxaccessibility/bridge_p.h
@@ -74,7 +74,7 @@ public:
virtual ~QSpiAccessibleBridge();
- void notifyAccessibilityUpdate(QAccessibleEvent *event) Q_DECL_OVERRIDE;
+ void notifyAccessibilityUpdate(QAccessibleEvent *event) override;
QDBusConnection dBusConnection() const;
public Q_SLOTS:
diff --git a/src/platformsupport/platformcompositor/qopenglcompositorbackingstore.cpp b/src/platformsupport/platformcompositor/qopenglcompositorbackingstore.cpp
index e938020437..40400e2a19 100644
--- a/src/platformsupport/platformcompositor/qopenglcompositorbackingstore.cpp
+++ b/src/platformsupport/platformcompositor/qopenglcompositorbackingstore.cpp
@@ -196,7 +196,7 @@ void QOpenGLCompositorBackingStore::flush(QWindow *window, const QRegion &region
dstCtx->makeCurrent(dstWin);
updateTexture();
m_textures->clear();
- m_textures->appendTexture(Q_NULLPTR, m_bsTexture, window->geometry());
+ m_textures->appendTexture(nullptr, m_bsTexture, window->geometry());
compositor->update();
}
@@ -233,7 +233,7 @@ void QOpenGLCompositorBackingStore::composeAndFlush(QWindow *window, const QRegi
textures->clipRect(i), textures->flags(i));
updateTexture();
- m_textures->appendTexture(Q_NULLPTR, m_bsTexture, window->geometry());
+ m_textures->appendTexture(nullptr, m_bsTexture, window->geometry());
textures->lock(true);
m_lockedWidgetTextures = textures;
@@ -280,7 +280,7 @@ void QOpenGLCompositorBackingStore::resize(const QSize &size, const QRegion &sta
if (m_bsTexture) {
glDeleteTextures(1, &m_bsTexture);
m_bsTexture = 0;
- m_bsTextureContext = Q_NULLPTR;
+ m_bsTextureContext = nullptr;
}
}
diff --git a/src/platformsupport/platformcompositor/qopenglcompositorbackingstore_p.h b/src/platformsupport/platformcompositor/qopenglcompositorbackingstore_p.h
index da68b90e92..d88738ea8f 100644
--- a/src/platformsupport/platformcompositor/qopenglcompositorbackingstore_p.h
+++ b/src/platformsupport/platformcompositor/qopenglcompositorbackingstore_p.h
@@ -66,17 +66,17 @@ public:
QOpenGLCompositorBackingStore(QWindow *window);
~QOpenGLCompositorBackingStore();
- QPaintDevice *paintDevice() Q_DECL_OVERRIDE;
+ QPaintDevice *paintDevice() override;
- void beginPaint(const QRegion &region) Q_DECL_OVERRIDE;
+ void beginPaint(const QRegion &region) override;
- void flush(QWindow *window, const QRegion &region, const QPoint &offset) Q_DECL_OVERRIDE;
- void resize(const QSize &size, const QRegion &staticContents) Q_DECL_OVERRIDE;
+ void flush(QWindow *window, const QRegion &region, const QPoint &offset) override;
+ void resize(const QSize &size, const QRegion &staticContents) override;
- QImage toImage() const Q_DECL_OVERRIDE;
+ QImage toImage() const override;
void composeAndFlush(QWindow *window, const QRegion &region, const QPoint &offset,
QPlatformTextureList *textures,
- bool translucentBackground) Q_DECL_OVERRIDE;
+ bool translucentBackground) override;
const QPlatformTextureList *textures() const { return m_textures; }
diff --git a/src/platformsupport/platformsupport.pro b/src/platformsupport/platformsupport.pro
index 5549984d6a..4f2f56f01f 100644
--- a/src/platformsupport/platformsupport.pro
+++ b/src/platformsupport/platformsupport.pro
@@ -34,6 +34,7 @@ qtConfig(accessibility) {
SUBDIRS += linuxaccessibility
linuxaccessibility.depends += accessibility
}
+ win32:!winrt: SUBDIRS += windowsuiautomation
}
darwin {
diff --git a/src/platformsupport/services/genericunix/qgenericunixservices.cpp b/src/platformsupport/services/genericunix/qgenericunixservices.cpp
index cdb5d33859..cb1e367b9f 100644
--- a/src/platformsupport/services/genericunix/qgenericunixservices.cpp
+++ b/src/platformsupport/services/genericunix/qgenericunixservices.cpp
@@ -49,6 +49,24 @@
#include <QtCore/QStandardPaths>
#include <QtCore/QUrl>
+#if QT_CONFIG(dbus)
+// These QtCore includes are needed for flatpak support
+#include <QtCore/private/qcore_unix_p.h>
+
+#include <QtCore/QFileInfo>
+#include <QtCore/QUrlQuery>
+
+#include <QtDBus/QDBusConnection>
+#include <QtDBus/QDBusMessage>
+#include <QtDBus/QDBusPendingCall>
+#include <QtDBus/QDBusPendingCallWatcher>
+#include <QtDBus/QDBusPendingReply>
+#include <QtDBus/QDBusUnixFileDescriptor>
+
+#include <fcntl.h>
+
+#endif // QT_CONFIG(dbus)
+
#include <stdlib.h>
QT_BEGIN_NAMESPACE
@@ -153,6 +171,83 @@ static inline bool launch(const QString &launcher, const QUrl &url)
return ok;
}
+#if QT_CONFIG(dbus)
+static inline bool checkRunningUnderFlatpak()
+{
+ return !QStandardPaths::locate(QStandardPaths::RuntimeLocation, QLatin1String("flatpak-info")).isEmpty();
+}
+
+static inline bool flatpakOpenUrl(const QUrl &url)
+{
+ // DBus signature:
+ // OpenURI (IN s parent_window,
+ // IN s uri,
+ // IN a{sv} options,
+ // OUT o handle)
+ // Options:
+ // writable (b) - Whether to allow the chosen application to write to the file.
+ // This key only takes effect the uri points to a local file that is exported in the document portal,
+ // and the chosen application is sandboxed itself.
+
+ QDBusMessage message = QDBusMessage::createMethodCall(QLatin1String("org.freedesktop.portal.Desktop"),
+ QLatin1String("/org/freedesktop/portal/desktop"),
+ QLatin1String("org.freedesktop.portal.OpenURI"),
+ QLatin1String("OpenURI"));
+ // FIXME parent_window_id and handle writable option
+ message << QString() << url.toString() << QVariantMap();
+
+ QDBusPendingReply<QDBusObjectPath> reply = QDBusConnection::sessionBus().call(message);
+ return !reply.isError();
+}
+
+static inline bool flatpakSendEmail(const QUrl &url)
+{
+ // DBus signature:
+ // ComposeEmail (IN s parent_window,
+ // IN a{sv} options,
+ // OUT o handle)
+ // Options:
+ // address (s) - The email address to send to.
+ // subject (s) - The subject for the email.
+ // body (s) - The body for the email.
+ // attachment_fds (ah) - File descriptors for files to attach.
+
+ QUrlQuery urlQuery(url);
+ QVariantMap options;
+ options.insert(QLatin1String("address"), url.path());
+ options.insert(QLatin1String("subject"), urlQuery.queryItemValue(QLatin1String("subject")));
+ options.insert(QLatin1String("body"), urlQuery.queryItemValue(QLatin1String("body")));
+
+ // O_PATH seems to be present since Linux 2.6.39, which is not case of RHEL 6
+#ifdef O_PATH
+ QList<QDBusUnixFileDescriptor> attachments;
+ const QStringList attachmentUris = urlQuery.allQueryItemValues(QLatin1String("attachment"));
+
+ for (const QString &attachmentUri : attachmentUris) {
+ const int fd = qt_safe_open(QFile::encodeName(attachmentUri), O_PATH);
+ if (fd != -1) {
+ QDBusUnixFileDescriptor descriptor(fd);
+ attachments << descriptor;
+ qt_safe_close(fd);
+ }
+ }
+
+ options.insert(QLatin1String("attachment_fds"), QVariant::fromValue(attachments));
+#endif
+
+ QDBusMessage message = QDBusMessage::createMethodCall(QLatin1String("org.freedesktop.portal.Desktop"),
+ QLatin1String("/org/freedesktop/portal/desktop"),
+ QLatin1String("org.freedesktop.portal.Email"),
+ QLatin1String("ComposeEmail"));
+
+ // FIXME parent_window_id
+ message << QString() << options;
+
+ QDBusPendingReply<QDBusObjectPath> reply = QDBusConnection::sessionBus().call(message);
+ return !reply.isError();
+}
+#endif // QT_CONFIG(dbus)
+
QByteArray QGenericUnixServices::desktopEnvironment() const
{
static const QByteArray result = detectDesktopEnvironment();
@@ -161,8 +256,18 @@ QByteArray QGenericUnixServices::desktopEnvironment() const
bool QGenericUnixServices::openUrl(const QUrl &url)
{
- if (url.scheme() == QLatin1String("mailto"))
+ if (url.scheme() == QLatin1String("mailto")) {
+#if QT_CONFIG(dbus)
+ if (checkRunningUnderFlatpak())
+ return flatpakSendEmail(url);
+#endif
return openDocument(url);
+ }
+
+#if QT_CONFIG(dbus)
+ if (checkRunningUnderFlatpak())
+ return flatpakOpenUrl(url);
+#endif
if (m_webBrowser.isEmpty() && !detectWebBrowser(desktopEnvironment(), true, &m_webBrowser)) {
qWarning("Unable to detect a web browser to launch '%s'", qPrintable(url.toString()));
diff --git a/src/platformsupport/services/genericunix/qgenericunixservices_p.h b/src/platformsupport/services/genericunix/qgenericunixservices_p.h
index 205b2e6160..8ac3de6f03 100644
--- a/src/platformsupport/services/genericunix/qgenericunixservices_p.h
+++ b/src/platformsupport/services/genericunix/qgenericunixservices_p.h
@@ -61,10 +61,10 @@ class QGenericUnixServices : public QPlatformServices
public:
QGenericUnixServices() {}
- QByteArray desktopEnvironment() const Q_DECL_OVERRIDE;
+ QByteArray desktopEnvironment() const override;
- bool openUrl(const QUrl &url) Q_DECL_OVERRIDE;
- bool openDocument(const QUrl &url) Q_DECL_OVERRIDE;
+ bool openUrl(const QUrl &url) override;
+ bool openDocument(const QUrl &url) override;
private:
QString m_webBrowser;
diff --git a/src/platformsupport/services/services.pro b/src/platformsupport/services/services.pro
index 91957a0a78..2027c7b5be 100644
--- a/src/platformsupport/services/services.pro
+++ b/src/platformsupport/services/services.pro
@@ -2,6 +2,8 @@ TARGET = QtServiceSupport
MODULE = service_support
QT = core-private gui-private
+qtConfig(dbus): QT += dbus
+
CONFIG += static internal_module
DEFINES += QT_NO_CAST_FROM_ASCII
diff --git a/src/platformsupport/themes/genericunix/dbusmenu/qdbusmenuadaptor.cpp b/src/platformsupport/themes/genericunix/dbusmenu/qdbusmenuadaptor.cpp
index 354b9c3a2e..eabb4b4122 100644
--- a/src/platformsupport/themes/genericunix/dbusmenu/qdbusmenuadaptor.cpp
+++ b/src/platformsupport/themes/genericunix/dbusmenu/qdbusmenuadaptor.cpp
@@ -122,7 +122,7 @@ void QDBusMenuAdaptor::Event(int id, const QString &eventId, const QDBusVariant
emit item->hovered();
if (eventId == QLatin1String("closed")) {
// There is no explicit AboutToHide method, so map closed event to aboutToHide method
- const QDBusPlatformMenu *menu = Q_NULLPTR;
+ const QDBusPlatformMenu *menu = nullptr;
if (item)
menu = static_cast<const QDBusPlatformMenu *>(item->menu());
else if (id == 0)
diff --git a/src/platformsupport/themes/genericunix/dbusmenu/qdbusmenubar_p.h b/src/platformsupport/themes/genericunix/dbusmenu/qdbusmenubar_p.h
index 8266a395f5..364e7da4b6 100644
--- a/src/platformsupport/themes/genericunix/dbusmenu/qdbusmenubar_p.h
+++ b/src/platformsupport/themes/genericunix/dbusmenu/qdbusmenubar_p.h
@@ -67,12 +67,12 @@ public:
QDBusMenuBar();
virtual ~QDBusMenuBar();
- void insertMenu(QPlatformMenu *menu, QPlatformMenu *before) Q_DECL_OVERRIDE;
- void removeMenu(QPlatformMenu *menu) Q_DECL_OVERRIDE;
- void syncMenu(QPlatformMenu *menu) Q_DECL_OVERRIDE;
- void handleReparent(QWindow *newParentWindow) Q_DECL_OVERRIDE;
- QPlatformMenu *menuForTag(quintptr tag) const Q_DECL_OVERRIDE;
- QPlatformMenu *createMenu() const Q_DECL_OVERRIDE;
+ void insertMenu(QPlatformMenu *menu, QPlatformMenu *before) override;
+ void removeMenu(QPlatformMenu *menu) override;
+ void syncMenu(QPlatformMenu *menu) override;
+ void handleReparent(QWindow *newParentWindow) override;
+ QPlatformMenu *menuForTag(quintptr tag) const override;
+ QPlatformMenu *createMenu() const override;
private:
QDBusPlatformMenu *m_menu;
diff --git a/src/platformsupport/themes/genericunix/dbusmenu/qdbusplatformmenu.cpp b/src/platformsupport/themes/genericunix/dbusmenu/qdbusplatformmenu.cpp
index 51c690d43a..fc1b37f2f2 100644
--- a/src/platformsupport/themes/genericunix/dbusmenu/qdbusplatformmenu.cpp
+++ b/src/platformsupport/themes/genericunix/dbusmenu/qdbusplatformmenu.cpp
@@ -68,7 +68,7 @@ QDBusPlatformMenuItem::~QDBusPlatformMenuItem()
{
menuItemsByID.remove(m_dbusID);
if (m_subMenu)
- static_cast<QDBusPlatformMenu *>(m_subMenu)->setContainingMenuItem(Q_NULLPTR);
+ static_cast<QDBusPlatformMenu *>(m_subMenu)->setContainingMenuItem(nullptr);
}
void QDBusPlatformMenuItem::setText(const QString &text)
@@ -88,7 +88,7 @@ void QDBusPlatformMenuItem::setIcon(const QIcon &icon)
void QDBusPlatformMenuItem::setMenu(QPlatformMenu *menu)
{
if (m_subMenu)
- static_cast<QDBusPlatformMenu *>(m_subMenu)->setContainingMenuItem(Q_NULLPTR);
+ static_cast<QDBusPlatformMenu *>(m_subMenu)->setContainingMenuItem(nullptr);
m_subMenu = menu;
if (menu)
static_cast<QDBusPlatformMenu *>(menu)->setContainingMenuItem(this);
@@ -147,7 +147,7 @@ QDBusPlatformMenuItem *QDBusPlatformMenuItem::byId(int id)
// a default-constructed nullptr value into menuItemsByID
if (menuItemsByID.contains(id))
return menuItemsByID[id];
- return Q_NULLPTR;
+ return nullptr;
}
QList<const QDBusPlatformMenuItem *> QDBusPlatformMenuItem::byIds(const QList<int> &ids)
@@ -165,14 +165,14 @@ QDBusPlatformMenu::QDBusPlatformMenu()
: m_isEnabled(true)
, m_isVisible(true)
, m_revision(1)
- , m_containingMenuItem(Q_NULLPTR)
+ , m_containingMenuItem(nullptr)
{
}
QDBusPlatformMenu::~QDBusPlatformMenu()
{
if (m_containingMenuItem)
- m_containingMenuItem->setMenu(Q_NULLPTR);
+ m_containingMenuItem->setMenu(nullptr);
}
void QDBusPlatformMenu::insertMenuItem(QPlatformMenuItem *menuItem, QPlatformMenuItem *before)
diff --git a/src/platformsupport/themes/genericunix/dbusmenu/qdbusplatformmenu_p.h b/src/platformsupport/themes/genericunix/dbusmenu/qdbusplatformmenu_p.h
index 5458e2fdd5..8a31f82fb0 100644
--- a/src/platformsupport/themes/genericunix/dbusmenu/qdbusplatformmenu_p.h
+++ b/src/platformsupport/themes/genericunix/dbusmenu/qdbusplatformmenu_p.h
@@ -77,31 +77,31 @@ public:
~QDBusPlatformMenuItem();
const QString text() const { return m_text; }
- void setText(const QString &text) Q_DECL_OVERRIDE;
+ void setText(const QString &text) override;
QIcon icon() const { return m_icon; }
- void setIcon(const QIcon &icon) Q_DECL_OVERRIDE;
+ void setIcon(const QIcon &icon) override;
const QPlatformMenu *menu() const { return m_subMenu; }
- void setMenu(QPlatformMenu *menu) Q_DECL_OVERRIDE;
+ void setMenu(QPlatformMenu *menu) override;
bool isEnabled() const { return m_isEnabled; }
- void setEnabled(bool enabled) Q_DECL_OVERRIDE;
+ void setEnabled(bool enabled) override;
bool isVisible() const { return m_isVisible; }
- void setVisible(bool isVisible) Q_DECL_OVERRIDE;
+ void setVisible(bool isVisible) override;
bool isSeparator() const { return m_isSeparator; }
- void setIsSeparator(bool isSeparator) Q_DECL_OVERRIDE;
- void setFont(const QFont &font) Q_DECL_OVERRIDE { Q_UNUSED(font); }
- void setRole(MenuRole role) Q_DECL_OVERRIDE;
+ void setIsSeparator(bool isSeparator) override;
+ void setFont(const QFont &font) override { Q_UNUSED(font); }
+ void setRole(MenuRole role) override;
bool isCheckable() const { return m_isCheckable; }
- void setCheckable(bool checkable) Q_DECL_OVERRIDE;
+ void setCheckable(bool checkable) override;
bool isChecked() const { return m_isChecked; }
- void setChecked(bool isChecked) Q_DECL_OVERRIDE;
+ void setChecked(bool isChecked) override;
bool hasExclusiveGroup() const { return m_hasExclusiveGroup; }
- void setHasExclusiveGroup(bool hasExclusiveGroup) Q_DECL_OVERRIDE;
+ void setHasExclusiveGroup(bool hasExclusiveGroup) override;
#ifndef QT_NO_SHORTCUT
QKeySequence shortcut() const { return m_shortcut; }
- void setShortcut(const QKeySequence& shortcut) Q_DECL_OVERRIDE;
+ void setShortcut(const QKeySequence& shortcut) override;
#endif
- void setIconSize(int size) Q_DECL_OVERRIDE { Q_UNUSED(size); }
- void setNativeContents(WId item) Q_DECL_OVERRIDE { Q_UNUSED(item); }
+ void setIconSize(int size) override { Q_UNUSED(size); }
+ void setNativeContents(WId item) override { Q_UNUSED(item); }
int dbusID() const { return m_dbusID; }
@@ -133,35 +133,35 @@ class QDBusPlatformMenu : public QPlatformMenu
public:
QDBusPlatformMenu();
~QDBusPlatformMenu();
- void insertMenuItem(QPlatformMenuItem *menuItem, QPlatformMenuItem *before) Q_DECL_OVERRIDE;
- void removeMenuItem(QPlatformMenuItem *menuItem) Q_DECL_OVERRIDE;
+ void insertMenuItem(QPlatformMenuItem *menuItem, QPlatformMenuItem *before) override;
+ void removeMenuItem(QPlatformMenuItem *menuItem) override;
void syncSubMenu(const QDBusPlatformMenu *menu);
- void syncMenuItem(QPlatformMenuItem *menuItem) Q_DECL_OVERRIDE;
- void syncSeparatorsCollapsible(bool enable) Q_DECL_OVERRIDE { Q_UNUSED(enable); }
+ void syncMenuItem(QPlatformMenuItem *menuItem) override;
+ void syncSeparatorsCollapsible(bool enable) override { Q_UNUSED(enable); }
const QString text() const { return m_text; }
- void setText(const QString &text) Q_DECL_OVERRIDE;
+ void setText(const QString &text) override;
QIcon icon() const { return m_icon; }
- void setIcon(const QIcon &icon) Q_DECL_OVERRIDE;
- bool isEnabled() const Q_DECL_OVERRIDE { return m_isEnabled; }
- void setEnabled(bool enabled) Q_DECL_OVERRIDE;
+ void setIcon(const QIcon &icon) override;
+ bool isEnabled() const override { return m_isEnabled; }
+ void setEnabled(bool enabled) override;
bool isVisible() const { return m_isVisible; }
- void setVisible(bool visible) Q_DECL_OVERRIDE;
- void setMinimumWidth(int width) Q_DECL_OVERRIDE { Q_UNUSED(width); }
- void setFont(const QFont &font) Q_DECL_OVERRIDE { Q_UNUSED(font); }
- void setMenuType(MenuType type) Q_DECL_OVERRIDE { Q_UNUSED(type); }
+ void setVisible(bool visible) override;
+ void setMinimumWidth(int width) override { Q_UNUSED(width); }
+ void setFont(const QFont &font) override { Q_UNUSED(font); }
+ void setMenuType(MenuType type) override { Q_UNUSED(type); }
void setContainingMenuItem(QDBusPlatformMenuItem *item);
- void showPopup(const QWindow *parentWindow, const QRect &targetRect, const QPlatformMenuItem *item) Q_DECL_OVERRIDE;
+ void showPopup(const QWindow *parentWindow, const QRect &targetRect, const QPlatformMenuItem *item) override;
- void dismiss() Q_DECL_OVERRIDE { } // Closes this and all its related menu popups
+ void dismiss() override { } // Closes this and all its related menu popups
- QPlatformMenuItem *menuItemAt(int position) const Q_DECL_OVERRIDE;
- QPlatformMenuItem *menuItemForTag(quintptr tag) const Q_DECL_OVERRIDE;
+ QPlatformMenuItem *menuItemAt(int position) const override;
+ QPlatformMenuItem *menuItemForTag(quintptr tag) const override;
const QList<QDBusPlatformMenuItem *> items() const;
- QPlatformMenuItem *createMenuItem() const Q_DECL_OVERRIDE;
- QPlatformMenu *createSubMenu() const Q_DECL_OVERRIDE;
+ QPlatformMenuItem *createMenuItem() const override;
+ QPlatformMenu *createSubMenu() const override;
uint revision() const { return m_revision; }
diff --git a/src/platformsupport/themes/genericunix/dbustray/qdbustrayicon.cpp b/src/platformsupport/themes/genericunix/dbustray/qdbustrayicon.cpp
index 9baf94726d..8480c15fb7 100644
--- a/src/platformsupport/themes/genericunix/dbustray/qdbustrayicon.cpp
+++ b/src/platformsupport/themes/genericunix/dbustray/qdbustrayicon.cpp
@@ -102,17 +102,17 @@ static int instanceCount = 0;
*/
QDBusTrayIcon::QDBusTrayIcon()
- : m_dbusConnection(Q_NULLPTR)
+ : m_dbusConnection(nullptr)
, m_adaptor(new QStatusNotifierItemAdaptor(this))
- , m_menuAdaptor(Q_NULLPTR)
- , m_menu(Q_NULLPTR)
- , m_notifier(Q_NULLPTR)
+ , m_menuAdaptor(nullptr)
+ , m_menu(nullptr)
+ , m_notifier(nullptr)
, m_instanceId(KDEItemFormat.arg(QCoreApplication::applicationPid()).arg(++instanceCount))
, m_category(QStringLiteral("ApplicationStatus"))
, m_defaultStatus(QStringLiteral("Active")) // be visible all the time. QSystemTrayIcon has no API to control this.
, m_status(m_defaultStatus)
- , m_tempIcon(Q_NULLPTR)
- , m_tempAttentionIcon(Q_NULLPTR)
+ , m_tempIcon(nullptr)
+ , m_tempAttentionIcon(nullptr)
, m_registered(false)
{
qCDebug(qLcTray);
@@ -149,9 +149,9 @@ void QDBusTrayIcon::cleanup()
if (m_registered)
dBusConnection()->unregisterTrayIcon(this);
delete m_dbusConnection;
- m_dbusConnection = Q_NULLPTR;
+ m_dbusConnection = nullptr;
delete m_notifier;
- m_notifier = Q_NULLPTR;
+ m_notifier = nullptr;
m_registered = false;
}
@@ -203,7 +203,7 @@ QTemporaryFile *QDBusTrayIcon::tempIcon(const QIcon &icon)
necessity_checked = true;
}
if (!necessary)
- return Q_NULLPTR;
+ return nullptr;
qreal dpr = qGuiApp->devicePixelRatio();
QTemporaryFile *ret = new QTemporaryFile(TempFileTemplate, this);
ret->open();
diff --git a/src/platformsupport/themes/genericunix/dbustray/qdbustrayicon_p.h b/src/platformsupport/themes/genericunix/dbustray/qdbustrayicon_p.h
index 4c9bc8f7e3..7034a7edb4 100644
--- a/src/platformsupport/themes/genericunix/dbustray/qdbustrayicon_p.h
+++ b/src/platformsupport/themes/genericunix/dbustray/qdbustrayicon_p.h
@@ -91,18 +91,18 @@ public:
QDBusMenuConnection * dBusConnection();
- void init() Q_DECL_OVERRIDE;
- void cleanup() Q_DECL_OVERRIDE;
- void updateIcon(const QIcon &icon) Q_DECL_OVERRIDE;
- void updateToolTip(const QString &tooltip) Q_DECL_OVERRIDE;
- void updateMenu(QPlatformMenu *menu) Q_DECL_OVERRIDE;
- QPlatformMenu *createMenu() const Q_DECL_OVERRIDE;
+ void init() override;
+ void cleanup() override;
+ void updateIcon(const QIcon &icon) override;
+ void updateToolTip(const QString &tooltip) override;
+ void updateMenu(QPlatformMenu *menu) override;
+ QPlatformMenu *createMenu() const override;
void showMessage(const QString &title, const QString &msg,
- const QIcon &icon, MessageIcon iconType, int msecs) Q_DECL_OVERRIDE;
+ const QIcon &icon, MessageIcon iconType, int msecs) override;
- bool isSystemTrayAvailable() const Q_DECL_OVERRIDE;
- bool supportsMessages() const Q_DECL_OVERRIDE { return true; }
- QRect geometry() const Q_DECL_OVERRIDE { return QRect(); }
+ bool isSystemTrayAvailable() const override;
+ bool supportsMessages() const override { return true; }
+ QRect geometry() const override { return QRect(); }
QString category() const { return m_category; }
QString status() const { return m_status; }
diff --git a/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp b/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
index 2105145263..5eac0a3584 100644
--- a/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
+++ b/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
@@ -199,7 +199,7 @@ QPlatformSystemTrayIcon *QGenericUnixTheme::createPlatformSystemTrayIcon() const
{
if (isDBusTrayAvailable())
return new QDBusTrayIcon();
- return Q_NULLPTR;
+ return nullptr;
}
#endif
@@ -674,7 +674,7 @@ QPlatformSystemTrayIcon *QKdeTheme::createPlatformSystemTrayIcon() const
{
if (isDBusTrayAvailable())
return new QDBusTrayIcon();
- return Q_NULLPTR;
+ return nullptr;
}
#endif
@@ -693,7 +693,7 @@ const char *QGnomeTheme::name = "gnome";
class QGnomeThemePrivate : public QPlatformThemePrivate
{
public:
- QGnomeThemePrivate() : systemFont(Q_NULLPTR), fixedFont(Q_NULLPTR) {}
+ QGnomeThemePrivate() : systemFont(nullptr), fixedFont(nullptr) {}
~QGnomeThemePrivate() { delete systemFont; delete fixedFont; }
void configureFonts(const QString &gtkFontName) const
@@ -793,7 +793,7 @@ QPlatformSystemTrayIcon *QGnomeTheme::createPlatformSystemTrayIcon() const
{
if (isDBusTrayAvailable())
return new QDBusTrayIcon();
- return Q_NULLPTR;
+ return nullptr;
}
#endif
@@ -831,7 +831,7 @@ QPlatformTheme *QGenericUnixTheme::createUnixTheme(const QString &name)
#endif
if (name == QLatin1String(QGnomeTheme::name))
return new QGnomeTheme;
- return Q_NULLPTR;
+ return nullptr;
}
QStringList QGenericUnixTheme::themeNames()
diff --git a/src/platformsupport/themes/genericunix/qgenericunixthemes_p.h b/src/platformsupport/themes/genericunix/qgenericunixthemes_p.h
index da13390662..186e5a7dff 100644
--- a/src/platformsupport/themes/genericunix/qgenericunixthemes_p.h
+++ b/src/platformsupport/themes/genericunix/qgenericunixthemes_p.h
@@ -81,15 +81,15 @@ public:
static QPlatformTheme *createUnixTheme(const QString &name);
static QStringList themeNames();
- const QFont *font(Font type) const Q_DECL_OVERRIDE;
- QVariant themeHint(ThemeHint hint) const Q_DECL_OVERRIDE;
+ const QFont *font(Font type) const override;
+ QVariant themeHint(ThemeHint hint) const override;
static QStringList xdgIconThemePaths();
#ifndef QT_NO_DBUS
- QPlatformMenuBar *createPlatformMenuBar() const Q_DECL_OVERRIDE;
+ QPlatformMenuBar *createPlatformMenuBar() const override;
#endif
#if !defined(QT_NO_DBUS) && !defined(QT_NO_SYSTEMTRAYICON)
- QPlatformSystemTrayIcon *createPlatformSystemTrayIcon() const Q_DECL_OVERRIDE;
+ QPlatformSystemTrayIcon *createPlatformSystemTrayIcon() const override;
#endif
static const char *name;
@@ -105,19 +105,19 @@ public:
QKdeTheme(const QStringList& kdeDirs, int kdeVersion);
static QPlatformTheme *createKdeTheme();
- QVariant themeHint(ThemeHint hint) const Q_DECL_OVERRIDE;
+ QVariant themeHint(ThemeHint hint) const override;
QIcon fileIcon(const QFileInfo &fileInfo,
QPlatformTheme::IconOptions iconOptions = 0) const override;
- const QPalette *palette(Palette type = SystemPalette) const Q_DECL_OVERRIDE;
+ const QPalette *palette(Palette type = SystemPalette) const override;
- const QFont *font(Font type) const Q_DECL_OVERRIDE;
+ const QFont *font(Font type) const override;
#ifndef QT_NO_DBUS
- QPlatformMenuBar *createPlatformMenuBar() const Q_DECL_OVERRIDE;
+ QPlatformMenuBar *createPlatformMenuBar() const override;
#endif
#if !defined(QT_NO_DBUS) && !defined(QT_NO_SYSTEMTRAYICON)
- QPlatformSystemTrayIcon *createPlatformSystemTrayIcon() const Q_DECL_OVERRIDE;
+ QPlatformSystemTrayIcon *createPlatformSystemTrayIcon() const override;
#endif
static const char *name;
@@ -131,18 +131,18 @@ class QGnomeTheme : public QPlatformTheme
Q_DECLARE_PRIVATE(QGnomeTheme)
public:
QGnomeTheme();
- QVariant themeHint(ThemeHint hint) const Q_DECL_OVERRIDE;
+ QVariant themeHint(ThemeHint hint) const override;
QIcon fileIcon(const QFileInfo &fileInfo,
QPlatformTheme::IconOptions = 0) const override;
- const QFont *font(Font type) const Q_DECL_OVERRIDE;
- QString standardButtonText(int button) const Q_DECL_OVERRIDE;
+ const QFont *font(Font type) const override;
+ QString standardButtonText(int button) const override;
virtual QString gtkFontName() const;
#ifndef QT_NO_DBUS
- QPlatformMenuBar *createPlatformMenuBar() const Q_DECL_OVERRIDE;
+ QPlatformMenuBar *createPlatformMenuBar() const override;
#endif
#if !defined(QT_NO_DBUS) && !defined(QT_NO_SYSTEMTRAYICON)
- QPlatformSystemTrayIcon *createPlatformSystemTrayIcon() const Q_DECL_OVERRIDE;
+ QPlatformSystemTrayIcon *createPlatformSystemTrayIcon() const override;
#endif
static const char *name;
diff --git a/src/platformsupport/windowsuiautomation/qwindowsuiawrapper.cpp b/src/platformsupport/windowsuiautomation/qwindowsuiawrapper.cpp
new file mode 100644
index 0000000000..79541fe636
--- /dev/null
+++ b/src/platformsupport/windowsuiautomation/qwindowsuiawrapper.cpp
@@ -0,0 +1,117 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <initguid.h>
+
+#include "qwindowsuiawrapper_p.h"
+#include <QtCore/private/qsystemlibrary_p.h>
+
+QT_BEGIN_NAMESPACE
+
+// private constructor
+QWindowsUiaWrapper::QWindowsUiaWrapper()
+{
+ QSystemLibrary uiaLib(QStringLiteral("UIAutomationCore"));
+ if (uiaLib.load()) {
+ m_pUiaReturnRawElementProvider = reinterpret_cast<PtrUiaReturnRawElementProvider>(uiaLib.resolve("UiaReturnRawElementProvider"));
+ m_pUiaHostProviderFromHwnd = reinterpret_cast<PtrUiaHostProviderFromHwnd>(uiaLib.resolve("UiaHostProviderFromHwnd"));
+ m_pUiaRaiseAutomationPropertyChangedEvent = reinterpret_cast<PtrUiaRaiseAutomationPropertyChangedEvent>(uiaLib.resolve("UiaRaiseAutomationPropertyChangedEvent"));
+ m_pUiaRaiseAutomationEvent = reinterpret_cast<PtrUiaRaiseAutomationEvent>(uiaLib.resolve("UiaRaiseAutomationEvent"));
+ m_pUiaClientsAreListening = reinterpret_cast<PtrUiaClientsAreListening>(uiaLib.resolve("UiaClientsAreListening"));
+ }
+}
+
+QWindowsUiaWrapper::~QWindowsUiaWrapper()
+{
+}
+
+// shared instance
+QWindowsUiaWrapper *QWindowsUiaWrapper::instance()
+{
+ static QWindowsUiaWrapper wrapper;
+ return &wrapper;
+}
+
+// True if all symbols resolved.
+BOOL QWindowsUiaWrapper::ready()
+{
+ return m_pUiaReturnRawElementProvider
+ && m_pUiaHostProviderFromHwnd
+ && m_pUiaRaiseAutomationPropertyChangedEvent
+ && m_pUiaRaiseAutomationEvent
+ && m_pUiaClientsAreListening;
+}
+
+BOOL QWindowsUiaWrapper::clientsAreListening()
+{
+ if (!m_pUiaClientsAreListening)
+ return FALSE;
+ return m_pUiaClientsAreListening();
+}
+
+LRESULT QWindowsUiaWrapper::returnRawElementProvider(HWND hwnd, WPARAM wParam, LPARAM lParam, IRawElementProviderSimple *el)
+{
+ if (!m_pUiaReturnRawElementProvider)
+ return static_cast<LRESULT>(NULL);
+ return m_pUiaReturnRawElementProvider(hwnd, wParam, lParam, el);
+}
+
+HRESULT QWindowsUiaWrapper::hostProviderFromHwnd(HWND hwnd, IRawElementProviderSimple **ppProvider)
+{
+ if (!m_pUiaHostProviderFromHwnd)
+ return UIA_E_NOTSUPPORTED;
+ return m_pUiaHostProviderFromHwnd(hwnd, ppProvider);
+}
+
+HRESULT QWindowsUiaWrapper::raiseAutomationPropertyChangedEvent(IRawElementProviderSimple *pProvider, PROPERTYID id, VARIANT oldValue, VARIANT newValue)
+{
+ if (!m_pUiaRaiseAutomationPropertyChangedEvent)
+ return UIA_E_NOTSUPPORTED;
+ return m_pUiaRaiseAutomationPropertyChangedEvent(pProvider, id, oldValue, newValue);
+}
+
+HRESULT QWindowsUiaWrapper::raiseAutomationEvent(IRawElementProviderSimple *pProvider, EVENTID id)
+{
+ if (!m_pUiaRaiseAutomationEvent)
+ return UIA_E_NOTSUPPORTED;
+ return m_pUiaRaiseAutomationEvent(pProvider, id);
+}
+
+QT_END_NAMESPACE
+
diff --git a/src/platformsupport/windowsuiautomation/qwindowsuiawrapper_p.h b/src/platformsupport/windowsuiautomation/qwindowsuiawrapper_p.h
new file mode 100644
index 0000000000..f89640612e
--- /dev/null
+++ b/src/platformsupport/windowsuiautomation/qwindowsuiawrapper_p.h
@@ -0,0 +1,100 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QWINDOWSUIAWRAPPER_H
+#define QWINDOWSUIAWRAPPER_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists for the convenience
+// of other Qt classes. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtGui/private/qtguiglobal_p.h>
+
+#include "uiatypes.h"
+#include "uiaattributeids.h"
+#include "uiacontroltypeids.h"
+#include "uiaerrorids.h"
+#include "uiaeventids.h"
+#include "uiageneralids.h"
+#include "uiapatternids.h"
+#include "uiapropertyids.h"
+#include "uiaserverinterfaces.h"
+#include "uiaclientinterfaces.h"
+
+QT_REQUIRE_CONFIG(accessibility);
+
+QT_BEGIN_NAMESPACE
+
+class QWindowsUiaWrapper
+{
+ QWindowsUiaWrapper();
+ virtual ~QWindowsUiaWrapper();
+public:
+ static QWindowsUiaWrapper *instance();
+ BOOL ready();
+ BOOL clientsAreListening();
+ LRESULT returnRawElementProvider(HWND hwnd, WPARAM wParam, LPARAM lParam, IRawElementProviderSimple *el);
+ HRESULT hostProviderFromHwnd(HWND hwnd, IRawElementProviderSimple **ppProvider);
+ HRESULT raiseAutomationPropertyChangedEvent(IRawElementProviderSimple *pProvider, PROPERTYID id, VARIANT oldValue, VARIANT newValue);
+ HRESULT raiseAutomationEvent(IRawElementProviderSimple *pProvider, EVENTID id);
+
+private:
+ typedef LRESULT (WINAPI *PtrUiaReturnRawElementProvider)(HWND, WPARAM, LPARAM, IRawElementProviderSimple *);
+ typedef HRESULT (WINAPI *PtrUiaHostProviderFromHwnd)(HWND, IRawElementProviderSimple **);
+ typedef HRESULT (WINAPI *PtrUiaRaiseAutomationPropertyChangedEvent)(IRawElementProviderSimple *, PROPERTYID, VARIANT, VARIANT);
+ typedef HRESULT (WINAPI *PtrUiaRaiseAutomationEvent)(IRawElementProviderSimple *, EVENTID);
+ typedef BOOL (WINAPI *PtrUiaClientsAreListening)();
+ PtrUiaReturnRawElementProvider m_pUiaReturnRawElementProvider = nullptr;
+ PtrUiaHostProviderFromHwnd m_pUiaHostProviderFromHwnd = nullptr;
+ PtrUiaRaiseAutomationPropertyChangedEvent m_pUiaRaiseAutomationPropertyChangedEvent = nullptr;
+ PtrUiaRaiseAutomationEvent m_pUiaRaiseAutomationEvent = nullptr;
+ PtrUiaClientsAreListening m_pUiaClientsAreListening = nullptr;
+};
+
+QT_END_NAMESPACE
+
+#endif //QWINDOWSUIAWRAPPER_H
+
diff --git a/src/platformsupport/windowsuiautomation/uiaattributeids.h b/src/platformsupport/windowsuiautomation/uiaattributeids.h
new file mode 100644
index 0000000000..52e7306a67
--- /dev/null
+++ b/src/platformsupport/windowsuiautomation/uiaattributeids.h
@@ -0,0 +1,88 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef UIAATTRIBUTEIDS_H
+#define UIAATTRIBUTEIDS_H
+
+#define UIA_AnimationStyleAttributeId 40000
+#define UIA_BackgroundColorAttributeId 40001
+#define UIA_BulletStyleAttributeId 40002
+#define UIA_CapStyleAttributeId 40003
+#define UIA_CultureAttributeId 40004
+#define UIA_FontNameAttributeId 40005
+#define UIA_FontSizeAttributeId 40006
+#define UIA_FontWeightAttributeId 40007
+#define UIA_ForegroundColorAttributeId 40008
+#define UIA_HorizontalTextAlignmentAttributeId 40009
+#define UIA_IndentationFirstLineAttributeId 40010
+#define UIA_IndentationLeadingAttributeId 40011
+#define UIA_IndentationTrailingAttributeId 40012
+#define UIA_IsHiddenAttributeId 40013
+#define UIA_IsItalicAttributeId 40014
+#define UIA_IsReadOnlyAttributeId 40015
+#define UIA_IsSubscriptAttributeId 40016
+#define UIA_IsSuperscriptAttributeId 40017
+#define UIA_MarginBottomAttributeId 40018
+#define UIA_MarginLeadingAttributeId 40019
+#define UIA_MarginTopAttributeId 40020
+#define UIA_MarginTrailingAttributeId 40021
+#define UIA_OutlineStylesAttributeId 40022
+#define UIA_OverlineColorAttributeId 40023
+#define UIA_OverlineStyleAttributeId 40024
+#define UIA_StrikethroughColorAttributeId 40025
+#define UIA_StrikethroughStyleAttributeId 40026
+#define UIA_TabsAttributeId 40027
+#define UIA_TextFlowDirectionsAttributeId 40028
+#define UIA_UnderlineColorAttributeId 40029
+#define UIA_UnderlineStyleAttributeId 40030
+#define UIA_AnnotationTypesAttributeId 40031
+#define UIA_AnnotationObjectsAttributeId 40032
+#define UIA_StyleNameAttributeId 40033
+#define UIA_StyleIdAttributeId 40034
+#define UIA_LinkAttributeId 40035
+#define UIA_IsActiveAttributeId 40036
+#define UIA_SelectionActiveEndAttributeId 40037
+#define UIA_CaretPositionAttributeId 40038
+#define UIA_CaretBidiModeAttributeId 40039
+#define UIA_LineSpacingAttributeId 40040
+#define UIA_BeforeParagraphSpacingAttributeId 40041
+#define UIA_AfterParagraphSpacingAttributeId 40042
+#define UIA_SayAsInterpretAsAttributeId 40043
+
+#endif
diff --git a/src/platformsupport/windowsuiautomation/uiaclientinterfaces.h b/src/platformsupport/windowsuiautomation/uiaclientinterfaces.h
new file mode 100644
index 0000000000..b95c05f6a4
--- /dev/null
+++ b/src/platformsupport/windowsuiautomation/uiaclientinterfaces.h
@@ -0,0 +1,255 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef UIACLIENTINTERFACES_H
+#define UIACLIENTINTERFACES_H
+
+#include <Unknwn.h>
+
+#ifndef __IUIAutomationElement_INTERFACE_DEFINED__
+
+struct IUIAutomationCondition;
+struct IUIAutomationCacheRequest;
+struct IUIAutomationElementArray;
+struct IUIAutomationTreeWalker;
+struct IUIAutomationEventHandler;
+struct IUIAutomationPropertyChangedEventHandler;
+struct IUIAutomationStructureChangedEventHandler;
+struct IUIAutomationFocusChangedEventHandler;
+struct IUIAutomationProxyFactory;
+struct IUIAutomationProxyFactoryEntry;
+struct IUIAutomationProxyFactoryMapping;
+#ifndef __IAccessible_FWD_DEFINED__
+#define __IAccessible_FWD_DEFINED__
+struct IAccessible;
+#endif /* __IAccessible_FWD_DEFINED__ */
+
+#define __IUIAutomationElement_INTERFACE_DEFINED__
+DEFINE_GUID(IID_IUIAutomationElement, 0xd22108aa, 0x8ac5, 0x49a5, 0x83,0x7b, 0x37,0xbb,0xb3,0xd7,0x59,0x1e);
+MIDL_INTERFACE("d22108aa-8ac5-49a5-837b-37bbb3d7591e")
+IUIAutomationElement : public IUnknown
+{
+public:
+ virtual HRESULT STDMETHODCALLTYPE SetFocus() = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetRuntimeId(__RPC__deref_out_opt SAFEARRAY **runtimeId) = 0;
+ virtual HRESULT STDMETHODCALLTYPE FindFirst(enum TreeScope scope, __RPC__in_opt IUIAutomationCondition *condition, __RPC__deref_out_opt IUIAutomationElement **found) = 0;
+ virtual HRESULT STDMETHODCALLTYPE FindAll(enum TreeScope scope, __RPC__in_opt IUIAutomationCondition *condition, __RPC__deref_out_opt IUIAutomationElementArray **found) = 0;
+ virtual HRESULT STDMETHODCALLTYPE FindFirstBuildCache(enum TreeScope scope, __RPC__in_opt IUIAutomationCondition *condition, __RPC__in_opt IUIAutomationCacheRequest *cacheRequest, __RPC__deref_out_opt IUIAutomationElement **found) = 0;
+ virtual HRESULT STDMETHODCALLTYPE FindAllBuildCache(enum TreeScope scope, __RPC__in_opt IUIAutomationCondition *condition, __RPC__in_opt IUIAutomationCacheRequest *cacheRequest, __RPC__deref_out_opt IUIAutomationElementArray **found) = 0;
+ virtual HRESULT STDMETHODCALLTYPE BuildUpdatedCache(__RPC__in_opt IUIAutomationCacheRequest *cacheRequest, __RPC__deref_out_opt IUIAutomationElement **updatedElement) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetCurrentPropertyValue(PROPERTYID propertyId, __RPC__out VARIANT *retVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetCurrentPropertyValueEx(PROPERTYID propertyId, BOOL ignoreDefaultValue, __RPC__out VARIANT *retVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetCachedPropertyValue(PROPERTYID propertyId, __RPC__out VARIANT *retVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetCachedPropertyValueEx(PROPERTYID propertyId, BOOL ignoreDefaultValue, __RPC__out VARIANT *retVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetCurrentPatternAs(PATTERNID patternId, __RPC__in REFIID riid, __RPC__deref_out_opt void **patternObject) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetCachedPatternAs(PATTERNID patternId, __RPC__in REFIID riid, __RPC__deref_out_opt void **patternObject) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetCurrentPattern(PATTERNID patternId, __RPC__deref_out_opt IUnknown **patternObject) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetCachedPattern(PATTERNID patternId, __RPC__deref_out_opt IUnknown **patternObject) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetCachedParent(__RPC__deref_out_opt IUIAutomationElement **parent) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetCachedChildren(__RPC__deref_out_opt IUIAutomationElementArray **children) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_CurrentProcessId(__RPC__out int *retVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_CurrentControlType(__RPC__out CONTROLTYPEID *retVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_CurrentLocalizedControlType(__RPC__deref_out_opt BSTR *retVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_CurrentName(__RPC__deref_out_opt BSTR *retVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_CurrentAcceleratorKey(__RPC__deref_out_opt BSTR *retVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_CurrentAccessKey(__RPC__deref_out_opt BSTR *retVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_CurrentHasKeyboardFocus(__RPC__out BOOL *retVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_CurrentIsKeyboardFocusable(__RPC__out BOOL *retVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_CurrentIsEnabled(__RPC__out BOOL *retVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_CurrentAutomationId(__RPC__deref_out_opt BSTR *retVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_CurrentClassName(__RPC__deref_out_opt BSTR *retVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_CurrentHelpText(__RPC__deref_out_opt BSTR *retVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_CurrentCulture(__RPC__out int *retVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_CurrentIsControlElement(__RPC__out BOOL *retVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_CurrentIsContentElement(__RPC__out BOOL *retVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_CurrentIsPassword(__RPC__out BOOL *retVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_CurrentNativeWindowHandle(__RPC__deref_out_opt UIA_HWND *retVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_CurrentItemType(__RPC__deref_out_opt BSTR *retVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_CurrentIsOffscreen(__RPC__out BOOL *retVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_CurrentOrientation(__RPC__out enum OrientationType *retVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_CurrentFrameworkId(__RPC__deref_out_opt BSTR *retVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_CurrentIsRequiredForForm(__RPC__out BOOL *retVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_CurrentItemStatus(__RPC__deref_out_opt BSTR *retVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_CurrentBoundingRectangle(__RPC__out RECT *retVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_CurrentLabeledBy(__RPC__deref_out_opt IUIAutomationElement **retVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_CurrentAriaRole(__RPC__deref_out_opt BSTR *retVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_CurrentAriaProperties(__RPC__deref_out_opt BSTR *retVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_CurrentIsDataValidForForm(__RPC__out BOOL *retVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_CurrentControllerFor(__RPC__deref_out_opt IUIAutomationElementArray **retVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_CurrentDescribedBy(__RPC__deref_out_opt IUIAutomationElementArray **retVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_CurrentFlowsTo(__RPC__deref_out_opt IUIAutomationElementArray **retVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_CurrentProviderDescription(__RPC__deref_out_opt BSTR *retVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_CachedProcessId(__RPC__out int *retVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_CachedControlType(__RPC__out CONTROLTYPEID *retVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_CachedLocalizedControlType(__RPC__deref_out_opt BSTR *retVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_CachedName(__RPC__deref_out_opt BSTR *retVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_CachedAcceleratorKey(__RPC__deref_out_opt BSTR *retVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_CachedAccessKey(__RPC__deref_out_opt BSTR *retVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_CachedHasKeyboardFocus(__RPC__out BOOL *retVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_CachedIsKeyboardFocusable(__RPC__out BOOL *retVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_CachedIsEnabled(__RPC__out BOOL *retVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_CachedAutomationId(__RPC__deref_out_opt BSTR *retVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_CachedClassName(__RPC__deref_out_opt BSTR *retVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_CachedHelpText(__RPC__deref_out_opt BSTR *retVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_CachedCulture(__RPC__out int *retVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_CachedIsControlElement(__RPC__out BOOL *retVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_CachedIsContentElement(__RPC__out BOOL *retVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_CachedIsPassword(__RPC__out BOOL *retVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_CachedNativeWindowHandle(__RPC__deref_out_opt UIA_HWND *retVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_CachedItemType(__RPC__deref_out_opt BSTR *retVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_CachedIsOffscreen(__RPC__out BOOL *retVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_CachedOrientation(__RPC__out enum OrientationType *retVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_CachedFrameworkId(__RPC__deref_out_opt BSTR *retVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_CachedIsRequiredForForm(__RPC__out BOOL *retVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_CachedItemStatus(__RPC__deref_out_opt BSTR *retVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_CachedBoundingRectangle(__RPC__out RECT *retVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_CachedLabeledBy(__RPC__deref_out_opt IUIAutomationElement **retVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_CachedAriaRole(__RPC__deref_out_opt BSTR *retVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_CachedAriaProperties(__RPC__deref_out_opt BSTR *retVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_CachedIsDataValidForForm(__RPC__out BOOL *retVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_CachedControllerFor(__RPC__deref_out_opt IUIAutomationElementArray **retVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_CachedDescribedBy(__RPC__deref_out_opt IUIAutomationElementArray **retVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_CachedFlowsTo(__RPC__deref_out_opt IUIAutomationElementArray **retVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_CachedProviderDescription(__RPC__deref_out_opt BSTR *retVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetClickablePoint(__RPC__out POINT *clickable, __RPC__out BOOL *gotClickable) = 0;
+};
+#ifdef __CRT_UUID_DECL
+__CRT_UUID_DECL(IUIAutomationElement, 0xd22108aa, 0x8ac5, 0x49a5, 0x83,0x7b, 0x37,0xbb,0xb3,0xd7,0x59,0x1e)
+#endif
+#endif
+
+
+#ifndef __IUIAutomation_INTERFACE_DEFINED__
+#define __IUIAutomation_INTERFACE_DEFINED__
+DEFINE_GUID(IID_IUIAutomation, 0x30cbe57d, 0xd9d0, 0x452a, 0xab,0x13, 0x7a,0xc5,0xac,0x48,0x25,0xee);
+MIDL_INTERFACE("30cbe57d-d9d0-452a-ab13-7ac5ac4825ee")
+IUIAutomation : public IUnknown
+{
+public:
+ virtual HRESULT STDMETHODCALLTYPE CompareElements(__RPC__in_opt IUIAutomationElement *el1, __RPC__in_opt IUIAutomationElement *el2, __RPC__out BOOL *areSame) = 0;
+ virtual HRESULT STDMETHODCALLTYPE CompareRuntimeIds(__RPC__in SAFEARRAY * runtimeId1, __RPC__in SAFEARRAY * runtimeId2, __RPC__out BOOL *areSame) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetRootElement(__RPC__deref_out_opt IUIAutomationElement **root) = 0;
+ virtual HRESULT STDMETHODCALLTYPE ElementFromHandle(__RPC__in UIA_HWND hwnd, __RPC__deref_out_opt IUIAutomationElement **element) = 0;
+ virtual HRESULT STDMETHODCALLTYPE ElementFromPoint(POINT pt, __RPC__deref_out_opt IUIAutomationElement **element) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetFocusedElement(__RPC__deref_out_opt IUIAutomationElement **element) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetRootElementBuildCache(__RPC__in_opt IUIAutomationCacheRequest *cacheRequest, __RPC__deref_out_opt IUIAutomationElement **root) = 0;
+ virtual HRESULT STDMETHODCALLTYPE ElementFromHandleBuildCache(__RPC__in UIA_HWND hwnd, __RPC__in_opt IUIAutomationCacheRequest *cacheRequest, __RPC__deref_out_opt IUIAutomationElement **element) = 0;
+ virtual HRESULT STDMETHODCALLTYPE ElementFromPointBuildCache(POINT pt, __RPC__in_opt IUIAutomationCacheRequest *cacheRequest, __RPC__deref_out_opt IUIAutomationElement **element) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetFocusedElementBuildCache(__RPC__in_opt IUIAutomationCacheRequest *cacheRequest, __RPC__deref_out_opt IUIAutomationElement **element) = 0;
+ virtual HRESULT STDMETHODCALLTYPE CreateTreeWalker(__RPC__in_opt IUIAutomationCondition *pCondition, __RPC__deref_out_opt IUIAutomationTreeWalker **walker) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_ControlViewWalker(__RPC__deref_out_opt IUIAutomationTreeWalker **walker) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_ContentViewWalker(__RPC__deref_out_opt IUIAutomationTreeWalker **walker) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_RawViewWalker(__RPC__deref_out_opt IUIAutomationTreeWalker **walker) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_RawViewCondition(__RPC__deref_out_opt IUIAutomationCondition **condition) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_ControlViewCondition(__RPC__deref_out_opt IUIAutomationCondition **condition) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_ContentViewCondition(__RPC__deref_out_opt IUIAutomationCondition **condition) = 0;
+ virtual HRESULT STDMETHODCALLTYPE CreateCacheRequest(__RPC__deref_out_opt IUIAutomationCacheRequest **cacheRequest) = 0;
+ virtual HRESULT STDMETHODCALLTYPE CreateTrueCondition(__RPC__deref_out_opt IUIAutomationCondition **newCondition) = 0;
+ virtual HRESULT STDMETHODCALLTYPE CreateFalseCondition(__RPC__deref_out_opt IUIAutomationCondition **newCondition) = 0;
+ virtual HRESULT STDMETHODCALLTYPE CreatePropertyCondition(PROPERTYID propertyId, VARIANT value, __RPC__deref_out_opt IUIAutomationCondition **newCondition) = 0;
+ virtual HRESULT STDMETHODCALLTYPE CreatePropertyConditionEx(PROPERTYID propertyId, VARIANT value, enum PropertyConditionFlags flags, __RPC__deref_out_opt IUIAutomationCondition **newCondition) = 0;
+ virtual HRESULT STDMETHODCALLTYPE CreateAndCondition(__RPC__in_opt IUIAutomationCondition *condition1, __RPC__in_opt IUIAutomationCondition *condition2, __RPC__deref_out_opt IUIAutomationCondition **newCondition) = 0;
+ virtual HRESULT STDMETHODCALLTYPE CreateAndConditionFromArray(__RPC__in_opt SAFEARRAY * conditions, __RPC__deref_out_opt IUIAutomationCondition **newCondition) = 0;
+ virtual HRESULT STDMETHODCALLTYPE CreateAndConditionFromNativeArray(__RPC__in_ecount_full(conditionCount) IUIAutomationCondition **conditions, int conditionCount, __RPC__deref_out_opt IUIAutomationCondition **newCondition) = 0;
+ virtual HRESULT STDMETHODCALLTYPE CreateOrCondition(__RPC__in_opt IUIAutomationCondition *condition1, __RPC__in_opt IUIAutomationCondition *condition2, __RPC__deref_out_opt IUIAutomationCondition **newCondition) = 0;
+ virtual HRESULT STDMETHODCALLTYPE CreateOrConditionFromArray(__RPC__in_opt SAFEARRAY * conditions, __RPC__deref_out_opt IUIAutomationCondition **newCondition) = 0;
+ virtual HRESULT STDMETHODCALLTYPE CreateOrConditionFromNativeArray(__RPC__in_ecount_full(conditionCount) IUIAutomationCondition **conditions, int conditionCount, __RPC__deref_out_opt IUIAutomationCondition **newCondition) = 0;
+ virtual HRESULT STDMETHODCALLTYPE CreateNotCondition(__RPC__in_opt IUIAutomationCondition *condition, __RPC__deref_out_opt IUIAutomationCondition **newCondition) = 0;
+ virtual HRESULT STDMETHODCALLTYPE AddAutomationEventHandler(EVENTID eventId, __RPC__in_opt IUIAutomationElement *element, enum TreeScope scope, __RPC__in_opt IUIAutomationCacheRequest *cacheRequest, __RPC__in_opt IUIAutomationEventHandler *handler) = 0;
+ virtual HRESULT STDMETHODCALLTYPE RemoveAutomationEventHandler(EVENTID eventId, __RPC__in_opt IUIAutomationElement *element, __RPC__in_opt IUIAutomationEventHandler *handler) = 0;
+ virtual HRESULT STDMETHODCALLTYPE AddPropertyChangedEventHandlerNativeArray(__RPC__in_opt IUIAutomationElement *element, enum TreeScope scope, __RPC__in_opt IUIAutomationCacheRequest *cacheRequest, __RPC__in_opt IUIAutomationPropertyChangedEventHandler *handler, __RPC__in_ecount_full(propertyCount) PROPERTYID *propertyArray, int propertyCount) = 0;
+ virtual HRESULT STDMETHODCALLTYPE AddPropertyChangedEventHandler(__RPC__in_opt IUIAutomationElement *element, enum TreeScope scope, __RPC__in_opt IUIAutomationCacheRequest *cacheRequest, __RPC__in_opt IUIAutomationPropertyChangedEventHandler *handler, __RPC__in SAFEARRAY * propertyArray) = 0;
+ virtual HRESULT STDMETHODCALLTYPE RemovePropertyChangedEventHandler(__RPC__in_opt IUIAutomationElement *element, __RPC__in_opt IUIAutomationPropertyChangedEventHandler *handler) = 0;
+ virtual HRESULT STDMETHODCALLTYPE AddStructureChangedEventHandler(__RPC__in_opt IUIAutomationElement *element, enum TreeScope scope, __RPC__in_opt IUIAutomationCacheRequest *cacheRequest, __RPC__in_opt IUIAutomationStructureChangedEventHandler *handler) = 0;
+ virtual HRESULT STDMETHODCALLTYPE RemoveStructureChangedEventHandler(__RPC__in_opt IUIAutomationElement *element, __RPC__in_opt IUIAutomationStructureChangedEventHandler *handler) = 0;
+ virtual HRESULT STDMETHODCALLTYPE AddFocusChangedEventHandler(__RPC__in_opt IUIAutomationCacheRequest *cacheRequest, __RPC__in_opt IUIAutomationFocusChangedEventHandler *handler) = 0;
+ virtual HRESULT STDMETHODCALLTYPE RemoveFocusChangedEventHandler(__RPC__in_opt IUIAutomationFocusChangedEventHandler *handler) = 0;
+ virtual HRESULT STDMETHODCALLTYPE RemoveAllEventHandlers() = 0;
+ virtual HRESULT STDMETHODCALLTYPE IntNativeArrayToSafeArray(__RPC__in_ecount_full(arrayCount) int *array, int arrayCount, __RPC__deref_out_opt SAFEARRAY **safeArray) = 0;
+ virtual HRESULT STDMETHODCALLTYPE IntSafeArrayToNativeArray(__RPC__in SAFEARRAY * intArray, __RPC__deref_out_ecount_full_opt(*arrayCount) int **array, __RPC__out int *arrayCount) = 0;
+ virtual HRESULT STDMETHODCALLTYPE RectToVariant(RECT rc, __RPC__out VARIANT *var) = 0;
+ virtual HRESULT STDMETHODCALLTYPE VariantToRect(VARIANT var, __RPC__out RECT *rc) = 0;
+ virtual HRESULT STDMETHODCALLTYPE SafeArrayToRectNativeArray(__RPC__in SAFEARRAY * rects, __RPC__deref_out_ecount_full_opt(*rectArrayCount) RECT **rectArray, __RPC__out int *rectArrayCount) = 0;
+ virtual HRESULT STDMETHODCALLTYPE CreateProxyFactoryEntry(__RPC__in_opt IUIAutomationProxyFactory *factory, __RPC__deref_out_opt IUIAutomationProxyFactoryEntry **factoryEntry) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_ProxyFactoryMapping(__RPC__deref_out_opt IUIAutomationProxyFactoryMapping **factoryMapping) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetPropertyProgrammaticName(PROPERTYID property, __RPC__deref_out_opt BSTR *name) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetPatternProgrammaticName(PATTERNID pattern, __RPC__deref_out_opt BSTR *name) = 0;
+ virtual HRESULT STDMETHODCALLTYPE PollForPotentialSupportedPatterns(__RPC__in_opt IUIAutomationElement *pElement, __RPC__deref_out_opt SAFEARRAY **patternIds, __RPC__deref_out_opt SAFEARRAY **patternNames) = 0;
+ virtual HRESULT STDMETHODCALLTYPE PollForPotentialSupportedProperties(__RPC__in_opt IUIAutomationElement *pElement, __RPC__deref_out_opt SAFEARRAY **propertyIds, __RPC__deref_out_opt SAFEARRAY **propertyNames) = 0;
+ virtual HRESULT STDMETHODCALLTYPE CheckNotSupported(VARIANT value, __RPC__out BOOL *isNotSupported) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_ReservedNotSupportedValue(__RPC__deref_out_opt IUnknown **notSupportedValue) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_ReservedMixedAttributeValue(__RPC__deref_out_opt IUnknown **mixedAttributeValue) = 0;
+ virtual HRESULT STDMETHODCALLTYPE ElementFromIAccessible(__RPC__in_opt IAccessible *accessible, int childId, __RPC__deref_out_opt IUIAutomationElement **element) = 0;
+ virtual HRESULT STDMETHODCALLTYPE ElementFromIAccessibleBuildCache(__RPC__in_opt IAccessible *accessible, int childId, __RPC__in_opt IUIAutomationCacheRequest *cacheRequest, __RPC__deref_out_opt IUIAutomationElement **element) = 0;
+};
+#ifdef __CRT_UUID_DECL
+__CRT_UUID_DECL(IUIAutomation, 0x30cbe57d, 0xd9d0, 0x452a, 0xab,0x13, 0x7a,0xc5,0xac,0x48,0x25,0xee)
+#endif
+#endif
+
+
+#ifndef __IUIAutomationTreeWalker_INTERFACE_DEFINED__
+#define __IUIAutomationTreeWalker_INTERFACE_DEFINED__
+DEFINE_GUID(IID_IUIAutomationTreeWalker, 0x4042c624, 0x389c, 0x4afc, 0xa6,0x30, 0x9d,0xf8,0x54,0xa5,0x41,0xfc);
+MIDL_INTERFACE("4042c624-389c-4afc-a630-9df854a541fc")
+IUIAutomationTreeWalker : public IUnknown
+{
+public:
+ virtual HRESULT STDMETHODCALLTYPE GetParentElement(__RPC__in_opt IUIAutomationElement *element, __RPC__deref_out_opt IUIAutomationElement **parent) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetFirstChildElement(__RPC__in_opt IUIAutomationElement *element, __RPC__deref_out_opt IUIAutomationElement **first) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetLastChildElement(__RPC__in_opt IUIAutomationElement *element, __RPC__deref_out_opt IUIAutomationElement **last) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetNextSiblingElement(__RPC__in_opt IUIAutomationElement *element, __RPC__deref_out_opt IUIAutomationElement **next) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetPreviousSiblingElement(__RPC__in_opt IUIAutomationElement *element, __RPC__deref_out_opt IUIAutomationElement **previous) = 0;
+ virtual HRESULT STDMETHODCALLTYPE NormalizeElement(__RPC__in_opt IUIAutomationElement *element, __RPC__deref_out_opt IUIAutomationElement **normalized) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetParentElementBuildCache(__RPC__in_opt IUIAutomationElement *element, __RPC__in_opt IUIAutomationCacheRequest *cacheRequest, __RPC__deref_out_opt IUIAutomationElement **parent) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetFirstChildElementBuildCache(__RPC__in_opt IUIAutomationElement *element, __RPC__in_opt IUIAutomationCacheRequest *cacheRequest, __RPC__deref_out_opt IUIAutomationElement **first) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetLastChildElementBuildCache(__RPC__in_opt IUIAutomationElement *element, __RPC__in_opt IUIAutomationCacheRequest *cacheRequest, __RPC__deref_out_opt IUIAutomationElement **last) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetNextSiblingElementBuildCache(__RPC__in_opt IUIAutomationElement *element, __RPC__in_opt IUIAutomationCacheRequest *cacheRequest, __RPC__deref_out_opt IUIAutomationElement **next) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetPreviousSiblingElementBuildCache(__RPC__in_opt IUIAutomationElement *element, __RPC__in_opt IUIAutomationCacheRequest *cacheRequest, __RPC__deref_out_opt IUIAutomationElement **previous) = 0;
+ virtual HRESULT STDMETHODCALLTYPE NormalizeElementBuildCache(__RPC__in_opt IUIAutomationElement *element, __RPC__in_opt IUIAutomationCacheRequest *cacheRequest, __RPC__deref_out_opt IUIAutomationElement **normalized) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_Condition(__RPC__deref_out_opt IUIAutomationCondition **condition) = 0;
+};
+#ifdef __CRT_UUID_DECL
+__CRT_UUID_DECL(IUIAutomationTreeWalker, 0x4042c624, 0x389c, 0x4afc, 0xa6,0x30, 0x9d,0xf8,0x54,0xa5,0x41,0xfc)
+#endif
+#endif
+
+DEFINE_GUID(CLSID_CUIAutomation, 0xff48dba4, 0x60ef, 0x4201, 0xaa,0x87, 0x54,0x10,0x3e,0xef,0x59,0x4e);
+
+#endif
diff --git a/src/platformsupport/windowsuiautomation/uiacontroltypeids.h b/src/platformsupport/windowsuiautomation/uiacontroltypeids.h
new file mode 100644
index 0000000000..d77fc68da9
--- /dev/null
+++ b/src/platformsupport/windowsuiautomation/uiacontroltypeids.h
@@ -0,0 +1,85 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef UIACONTROLTYPEIDS_H
+#define UIACONTROLTYPEIDS_H
+
+#define UIA_ButtonControlTypeId 50000
+#define UIA_CalendarControlTypeId 50001
+#define UIA_CheckBoxControlTypeId 50002
+#define UIA_ComboBoxControlTypeId 50003
+#define UIA_EditControlTypeId 50004
+#define UIA_HyperlinkControlTypeId 50005
+#define UIA_ImageControlTypeId 50006
+#define UIA_ListItemControlTypeId 50007
+#define UIA_ListControlTypeId 50008
+#define UIA_MenuControlTypeId 50009
+#define UIA_MenuBarControlTypeId 50010
+#define UIA_MenuItemControlTypeId 50011
+#define UIA_ProgressBarControlTypeId 50012
+#define UIA_RadioButtonControlTypeId 50013
+#define UIA_ScrollBarControlTypeId 50014
+#define UIA_SliderControlTypeId 50015
+#define UIA_SpinnerControlTypeId 50016
+#define UIA_StatusBarControlTypeId 50017
+#define UIA_TabControlTypeId 50018
+#define UIA_TabItemControlTypeId 50019
+#define UIA_TextControlTypeId 50020
+#define UIA_ToolBarControlTypeId 50021
+#define UIA_ToolTipControlTypeId 50022
+#define UIA_TreeControlTypeId 50023
+#define UIA_TreeItemControlTypeId 50024
+#define UIA_CustomControlTypeId 50025
+#define UIA_GroupControlTypeId 50026
+#define UIA_ThumbControlTypeId 50027
+#define UIA_DataGridControlTypeId 50028
+#define UIA_DataItemControlTypeId 50029
+#define UIA_DocumentControlTypeId 50030
+#define UIA_SplitButtonControlTypeId 50031
+#define UIA_WindowControlTypeId 50032
+#define UIA_PaneControlTypeId 50033
+#define UIA_HeaderControlTypeId 50034
+#define UIA_HeaderItemControlTypeId 50035
+#define UIA_TableControlTypeId 50036
+#define UIA_TitleBarControlTypeId 50037
+#define UIA_SeparatorControlTypeId 50038
+#define UIA_SemanticZoomControlTypeId 50039
+#define UIA_AppBarControlTypeId 50040
+
+#endif
diff --git a/src/platformsupport/windowsuiautomation/uiaerrorids.h b/src/platformsupport/windowsuiautomation/uiaerrorids.h
new file mode 100644
index 0000000000..c25453007d
--- /dev/null
+++ b/src/platformsupport/windowsuiautomation/uiaerrorids.h
@@ -0,0 +1,51 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef UIAERRORIDS_H
+#define UIAERRORIDS_H
+
+#define UIA_E_ELEMENTNOTENABLED 0x80040200
+#define UIA_E_ELEMENTNOTAVAILABLE 0x80040201
+#define UIA_E_NOCLICKABLEPOINT 0x80040202
+#define UIA_E_PROXYASSEMBLYNOTLOADED 0x80040203
+#define UIA_E_NOTSUPPORTED 0x80040204
+#define UIA_E_INVALIDOPERATION 0x80131509
+#define UIA_E_TIMEOUT 0x80131505
+
+#endif
diff --git a/src/platformsupport/windowsuiautomation/uiaeventids.h b/src/platformsupport/windowsuiautomation/uiaeventids.h
new file mode 100644
index 0000000000..2b414968ed
--- /dev/null
+++ b/src/platformsupport/windowsuiautomation/uiaeventids.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef UIAEVENTIDS_H
+#define UIAEVENTIDS_H
+
+#define UIA_ToolTipOpenedEventId 20000
+#define UIA_ToolTipClosedEventId 20001
+#define UIA_StructureChangedEventId 20002
+#define UIA_MenuOpenedEventId 20003
+#define UIA_AutomationPropertyChangedEventId 20004
+#define UIA_AutomationFocusChangedEventId 20005
+#define UIA_AsyncContentLoadedEventId 20006
+#define UIA_MenuClosedEventId 20007
+#define UIA_LayoutInvalidatedEventId 20008
+#define UIA_Invoke_InvokedEventId 20009
+#define UIA_SelectionItem_ElementAddedToSelectionEventId 20010
+#define UIA_SelectionItem_ElementRemovedFromSelectionEventId 20011
+#define UIA_SelectionItem_ElementSelectedEventId 20012
+#define UIA_Selection_InvalidatedEventId 20013
+#define UIA_Text_TextSelectionChangedEventId 20014
+#define UIA_Text_TextChangedEventId 20015
+#define UIA_Window_WindowOpenedEventId 20016
+#define UIA_Window_WindowClosedEventId 20017
+#define UIA_MenuModeStartEventId 20018
+#define UIA_MenuModeEndEventId 20019
+#define UIA_InputReachedTargetEventId 20020
+#define UIA_InputReachedOtherElementEventId 20021
+#define UIA_InputDiscardedEventId 20022
+#define UIA_SystemAlertEventId 20023
+#define UIA_LiveRegionChangedEventId 20024
+#define UIA_HostedFragmentRootsInvalidatedEventId 20025
+#define UIA_Drag_DragStartEventId 20026
+#define UIA_Drag_DragCancelEventId 20027
+#define UIA_Drag_DragCompleteEventId 20028
+#define UIA_DropTarget_DragEnterEventId 20029
+#define UIA_DropTarget_DragLeaveEventId 20030
+#define UIA_DropTarget_DroppedEventId 20031
+#define UIA_TextEdit_TextChangedEventId 20032
+#define UIA_TextEdit_ConversionTargetChangedEventId 20033
+#define UIA_ChangesEventId 20034
+
+#endif
diff --git a/src/platformsupport/windowsuiautomation/uiageneralids.h b/src/platformsupport/windowsuiautomation/uiageneralids.h
new file mode 100644
index 0000000000..62c795b94a
--- /dev/null
+++ b/src/platformsupport/windowsuiautomation/uiageneralids.h
@@ -0,0 +1,46 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef UIAGENERALIDS_H
+#define UIAGENERALIDS_H
+
+#define UiaAppendRuntimeId 3
+#define UiaRootObjectId -25
+
+#endif
diff --git a/src/platformsupport/windowsuiautomation/uiapatternids.h b/src/platformsupport/windowsuiautomation/uiapatternids.h
new file mode 100644
index 0000000000..114aabcaa5
--- /dev/null
+++ b/src/platformsupport/windowsuiautomation/uiapatternids.h
@@ -0,0 +1,78 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef UIAPATTERNIDS_H
+#define UIAPATTERNIDS_H
+
+#define UIA_InvokePatternId 10000
+#define UIA_SelectionPatternId 10001
+#define UIA_ValuePatternId 10002
+#define UIA_RangeValuePatternId 10003
+#define UIA_ScrollPatternId 10004
+#define UIA_ExpandCollapsePatternId 10005
+#define UIA_GridPatternId 10006
+#define UIA_GridItemPatternId 10007
+#define UIA_MultipleViewPatternId 10008
+#define UIA_WindowPatternId 10009
+#define UIA_SelectionItemPatternId 10010
+#define UIA_DockPatternId 10011
+#define UIA_TablePatternId 10012
+#define UIA_TableItemPatternId 10013
+#define UIA_TextPatternId 10014
+#define UIA_TogglePatternId 10015
+#define UIA_TransformPatternId 10016
+#define UIA_ScrollItemPatternId 10017
+#define UIA_LegacyIAccessiblePatternId 10018
+#define UIA_ItemContainerPatternId 10019
+#define UIA_VirtualizedItemPatternId 10020
+#define UIA_SynchronizedInputPatternId 10021
+#define UIA_ObjectModelPatternId 10022
+#define UIA_AnnotationPatternId 10023
+#define UIA_TextPattern2Id 10024
+#define UIA_StylesPatternId 10025
+#define UIA_SpreadsheetPatternId 10026
+#define UIA_SpreadsheetItemPatternId 10027
+#define UIA_TransformPattern2Id 10028
+#define UIA_TextChildPatternId 10029
+#define UIA_DragPatternId 10030
+#define UIA_DropTargetPatternId 10031
+#define UIA_TextEditPatternId 10032
+#define UIA_CustomNavigationPatternId 10033
+
+#endif
diff --git a/src/platformsupport/windowsuiautomation/uiapropertyids.h b/src/platformsupport/windowsuiautomation/uiapropertyids.h
new file mode 100644
index 0000000000..5c35c956f8
--- /dev/null
+++ b/src/platformsupport/windowsuiautomation/uiapropertyids.h
@@ -0,0 +1,212 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef UIAPROPERTYIDS_H
+#define UIAPROPERTYIDS_H
+
+#define UIA_RuntimeIdPropertyId 30000
+#define UIA_BoundingRectanglePropertyId 30001
+#define UIA_ProcessIdPropertyId 30002
+#define UIA_ControlTypePropertyId 30003
+#define UIA_LocalizedControlTypePropertyId 30004
+#define UIA_NamePropertyId 30005
+#define UIA_AcceleratorKeyPropertyId 30006
+#define UIA_AccessKeyPropertyId 30007
+#define UIA_HasKeyboardFocusPropertyId 30008
+#define UIA_IsKeyboardFocusablePropertyId 30009
+#define UIA_IsEnabledPropertyId 30010
+#define UIA_AutomationIdPropertyId 30011
+#define UIA_ClassNamePropertyId 30012
+#define UIA_HelpTextPropertyId 30013
+#define UIA_ClickablePointPropertyId 30014
+#define UIA_CulturePropertyId 30015
+#define UIA_IsControlElementPropertyId 30016
+#define UIA_IsContentElementPropertyId 30017
+#define UIA_LabeledByPropertyId 30018
+#define UIA_IsPasswordPropertyId 30019
+#define UIA_NativeWindowHandlePropertyId 30020
+#define UIA_ItemTypePropertyId 30021
+#define UIA_IsOffscreenPropertyId 30022
+#define UIA_OrientationPropertyId 30023
+#define UIA_FrameworkIdPropertyId 30024
+#define UIA_IsRequiredForFormPropertyId 30025
+#define UIA_ItemStatusPropertyId 30026
+#define UIA_IsDockPatternAvailablePropertyId 30027
+#define UIA_IsExpandCollapsePatternAvailablePropertyId 30028
+#define UIA_IsGridItemPatternAvailablePropertyId 30029
+#define UIA_IsGridPatternAvailablePropertyId 30030
+#define UIA_IsInvokePatternAvailablePropertyId 30031
+#define UIA_IsMultipleViewPatternAvailablePropertyId 30032
+#define UIA_IsRangeValuePatternAvailablePropertyId 30033
+#define UIA_IsScrollPatternAvailablePropertyId 30034
+#define UIA_IsScrollItemPatternAvailablePropertyId 30035
+#define UIA_IsSelectionItemPatternAvailablePropertyId 30036
+#define UIA_IsSelectionPatternAvailablePropertyId 30037
+#define UIA_IsTablePatternAvailablePropertyId 30038
+#define UIA_IsTableItemPatternAvailablePropertyId 30039
+#define UIA_IsTextPatternAvailablePropertyId 30040
+#define UIA_IsTogglePatternAvailablePropertyId 30041
+#define UIA_IsTransformPatternAvailablePropertyId 30042
+#define UIA_IsValuePatternAvailablePropertyId 30043
+#define UIA_IsWindowPatternAvailablePropertyId 30044
+#define UIA_ValueValuePropertyId 30045
+#define UIA_ValueIsReadOnlyPropertyId 30046
+#define UIA_RangeValueValuePropertyId 30047
+#define UIA_RangeValueIsReadOnlyPropertyId 30048
+#define UIA_RangeValueMinimumPropertyId 30049
+#define UIA_RangeValueMaximumPropertyId 30050
+#define UIA_RangeValueLargeChangePropertyId 30051
+#define UIA_RangeValueSmallChangePropertyId 30052
+#define UIA_ScrollHorizontalScrollPercentPropertyId 30053
+#define UIA_ScrollHorizontalViewSizePropertyId 30054
+#define UIA_ScrollVerticalScrollPercentPropertyId 30055
+#define UIA_ScrollVerticalViewSizePropertyId 30056
+#define UIA_ScrollHorizontallyScrollablePropertyId 30057
+#define UIA_ScrollVerticallyScrollablePropertyId 30058
+#define UIA_SelectionSelectionPropertyId 30059
+#define UIA_SelectionCanSelectMultiplePropertyId 30060
+#define UIA_SelectionIsSelectionRequiredPropertyId 30061
+#define UIA_GridRowCountPropertyId 30062
+#define UIA_GridColumnCountPropertyId 30063
+#define UIA_GridItemRowPropertyId 30064
+#define UIA_GridItemColumnPropertyId 30065
+#define UIA_GridItemRowSpanPropertyId 30066
+#define UIA_GridItemColumnSpanPropertyId 30067
+#define UIA_GridItemContainingGridPropertyId 30068
+#define UIA_DockDockPositionPropertyId 30069
+#define UIA_ExpandCollapseExpandCollapseStatePropertyId 30070
+#define UIA_MultipleViewCurrentViewPropertyId 30071
+#define UIA_MultipleViewSupportedViewsPropertyId 30072
+#define UIA_WindowCanMaximizePropertyId 30073
+#define UIA_WindowCanMinimizePropertyId 30074
+#define UIA_WindowWindowVisualStatePropertyId 30075
+#define UIA_WindowWindowInteractionStatePropertyId 30076
+#define UIA_WindowIsModalPropertyId 30077
+#define UIA_WindowIsTopmostPropertyId 30078
+#define UIA_SelectionItemIsSelectedPropertyId 30079
+#define UIA_SelectionItemSelectionContainerPropertyId 30080
+#define UIA_TableRowHeadersPropertyId 30081
+#define UIA_TableColumnHeadersPropertyId 30082
+#define UIA_TableRowOrColumnMajorPropertyId 30083
+#define UIA_TableItemRowHeaderItemsPropertyId 30084
+#define UIA_TableItemColumnHeaderItemsPropertyId 30085
+#define UIA_ToggleToggleStatePropertyId 30086
+#define UIA_TransformCanMovePropertyId 30087
+#define UIA_TransformCanResizePropertyId 30088
+#define UIA_TransformCanRotatePropertyId 30089
+#define UIA_IsLegacyIAccessiblePatternAvailablePropertyId 30090
+#define UIA_LegacyIAccessibleChildIdPropertyId 30091
+#define UIA_LegacyIAccessibleNamePropertyId 30092
+#define UIA_LegacyIAccessibleValuePropertyId 30093
+#define UIA_LegacyIAccessibleDescriptionPropertyId 30094
+#define UIA_LegacyIAccessibleRolePropertyId 30095
+#define UIA_LegacyIAccessibleStatePropertyId 30096
+#define UIA_LegacyIAccessibleHelpPropertyId 30097
+#define UIA_LegacyIAccessibleKeyboardShortcutPropertyId 30098
+#define UIA_LegacyIAccessibleSelectionPropertyId 30099
+#define UIA_LegacyIAccessibleDefaultActionPropertyId 30100
+#define UIA_AriaRolePropertyId 30101
+#define UIA_AriaPropertiesPropertyId 30102
+#define UIA_IsDataValidForFormPropertyId 30103
+#define UIA_ControllerForPropertyId 30104
+#define UIA_DescribedByPropertyId 30105
+#define UIA_FlowsToPropertyId 30106
+#define UIA_ProviderDescriptionPropertyId 30107
+#define UIA_IsItemContainerPatternAvailablePropertyId 30108
+#define UIA_IsVirtualizedItemPatternAvailablePropertyId 30109
+#define UIA_IsSynchronizedInputPatternAvailablePropertyId 30110
+#define UIA_OptimizeForVisualContentPropertyId 30111
+#define UIA_IsObjectModelPatternAvailablePropertyId 30112
+#define UIA_AnnotationAnnotationTypeIdPropertyId 30113
+#define UIA_AnnotationAnnotationTypeNamePropertyId 30114
+#define UIA_AnnotationAuthorPropertyId 30115
+#define UIA_AnnotationDateTimePropertyId 30116
+#define UIA_AnnotationTargetPropertyId 30117
+#define UIA_IsAnnotationPatternAvailablePropertyId 30118
+#define UIA_IsTextPattern2AvailablePropertyId 30119
+#define UIA_StylesStyleIdPropertyId 30120
+#define UIA_StylesStyleNamePropertyId 30121
+#define UIA_StylesFillColorPropertyId 30122
+#define UIA_StylesFillPatternStylePropertyId 30123
+#define UIA_StylesShapePropertyId 30124
+#define UIA_StylesFillPatternColorPropertyId 30125
+#define UIA_StylesExtendedPropertiesPropertyId 30126
+#define UIA_IsStylesPatternAvailablePropertyId 30127
+#define UIA_IsSpreadsheetPatternAvailablePropertyId 30128
+#define UIA_SpreadsheetItemFormulaPropertyId 30129
+#define UIA_SpreadsheetItemAnnotationObjectsPropertyId 30130
+#define UIA_SpreadsheetItemAnnotationTypesPropertyId 30131
+#define UIA_IsSpreadsheetItemPatternAvailablePropertyId 30132
+#define UIA_Transform2CanZoomPropertyId 30133
+#define UIA_IsTransformPattern2AvailablePropertyId 30134
+#define UIA_LiveSettingPropertyId 30135
+#define UIA_IsTextChildPatternAvailablePropertyId 30136
+#define UIA_IsDragPatternAvailablePropertyId 30137
+#define UIA_DragIsGrabbedPropertyId 30138
+#define UIA_DragDropEffectPropertyId 30139
+#define UIA_DragDropEffectsPropertyId 30140
+#define UIA_IsDropTargetPatternAvailablePropertyId 30141
+#define UIA_DropTargetDropTargetEffectPropertyId 30142
+#define UIA_DropTargetDropTargetEffectsPropertyId 30143
+#define UIA_DragGrabbedItemsPropertyId 30144
+#define UIA_Transform2ZoomLevelPropertyId 30145
+#define UIA_Transform2ZoomMinimumPropertyId 30146
+#define UIA_Transform2ZoomMaximumPropertyId 30147
+#define UIA_FlowsFromPropertyId 30148
+#define UIA_IsTextEditPatternAvailablePropertyId 30149
+#define UIA_IsPeripheralPropertyId 30150
+#define UIA_IsCustomNavigationPatternAvailablePropertyId 30151
+#define UIA_PositionInSetPropertyId 30152
+#define UIA_SizeOfSetPropertyId 30153
+#define UIA_LevelPropertyId 30154
+#define UIA_AnnotationTypesPropertyId 30155
+#define UIA_AnnotationObjectsPropertyId 30156
+#define UIA_LandmarkTypePropertyId 30157
+#define UIA_LocalizedLandmarkTypePropertyId 30158
+#define UIA_FullDescriptionPropertyId 30159
+#define UIA_FillColorPropertyId 30160
+#define UIA_OutlineColorPropertyId 30161
+#define UIA_FillTypePropertyId 30162
+#define UIA_VisualEffectsPropertyId 30163
+#define UIA_OutlineThicknessPropertyId 30164
+#define UIA_CenterPointPropertyId 30165
+#define UIA_RotationPropertyId 30166
+#define UIA_SizePropertyId 30167
+
+#endif
diff --git a/src/platformsupport/windowsuiautomation/uiaserverinterfaces.h b/src/platformsupport/windowsuiautomation/uiaserverinterfaces.h
new file mode 100644
index 0000000000..caae84755b
--- /dev/null
+++ b/src/platformsupport/windowsuiautomation/uiaserverinterfaces.h
@@ -0,0 +1,352 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef UIASERVERINTERFACES_H
+#define UIASERVERINTERFACES_H
+
+#include <Unknwn.h>
+
+#ifndef __IRawElementProviderSimple_INTERFACE_DEFINED__
+#define __IRawElementProviderSimple_INTERFACE_DEFINED__
+DEFINE_GUID(IID_IRawElementProviderSimple, 0xd6dd68d1, 0x86fd, 0x4332, 0x86,0x66, 0x9a,0xbe,0xde,0xa2,0xd2,0x4c);
+MIDL_INTERFACE("d6dd68d1-86fd-4332-8666-9abedea2d24c")
+IRawElementProviderSimple : public IUnknown
+{
+public:
+ virtual HRESULT STDMETHODCALLTYPE get_ProviderOptions(__RPC__out enum ProviderOptions *pRetVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetPatternProvider(PATTERNID patternId, __RPC__deref_out_opt IUnknown **pRetVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetPropertyValue(PROPERTYID propertyId, __RPC__out VARIANT *pRetVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_HostRawElementProvider(__RPC__deref_out_opt IRawElementProviderSimple **pRetVal) = 0;
+};
+#ifdef __CRT_UUID_DECL
+__CRT_UUID_DECL(IRawElementProviderSimple, 0xd6dd68d1, 0x86fd, 0x4332, 0x86,0x66, 0x9a,0xbe,0xde,0xa2,0xd2,0x4c)
+#endif
+#endif
+
+
+#ifndef __IRawElementProviderFragmentRoot_FWD_DEFINED__
+#define __IRawElementProviderFragmentRoot_FWD_DEFINED__
+typedef interface IRawElementProviderFragmentRoot IRawElementProviderFragmentRoot;
+#endif
+
+
+#ifndef __IRawElementProviderFragment_FWD_DEFINED__
+#define __IRawElementProviderFragment_FWD_DEFINED__
+typedef interface IRawElementProviderFragment IRawElementProviderFragment;
+#endif
+
+
+#ifndef __IRawElementProviderFragment_INTERFACE_DEFINED__
+#define __IRawElementProviderFragment_INTERFACE_DEFINED__
+DEFINE_GUID(IID_IRawElementProviderFragment, 0xf7063da8, 0x8359, 0x439c, 0x92,0x97, 0xbb,0xc5,0x29,0x9a,0x7d,0x87);
+MIDL_INTERFACE("f7063da8-8359-439c-9297-bbc5299a7d87")
+IRawElementProviderFragment : public IUnknown
+{
+public:
+ virtual HRESULT STDMETHODCALLTYPE Navigate(enum NavigateDirection direction, __RPC__deref_out_opt IRawElementProviderFragment **pRetVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetRuntimeId(__RPC__deref_out_opt SAFEARRAY **pRetVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_BoundingRectangle(__RPC__out struct UiaRect *pRetVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetEmbeddedFragmentRoots(__RPC__deref_out_opt SAFEARRAY **pRetVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE SetFocus() = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_FragmentRoot(__RPC__deref_out_opt IRawElementProviderFragmentRoot **pRetVal) = 0;
+};
+#ifdef __CRT_UUID_DECL
+__CRT_UUID_DECL(IRawElementProviderFragment, 0xf7063da8, 0x8359, 0x439c, 0x92,0x97, 0xbb,0xc5,0x29,0x9a,0x7d,0x87)
+#endif
+#endif
+
+
+#ifndef __IRawElementProviderFragmentRoot_INTERFACE_DEFINED__
+#define __IRawElementProviderFragmentRoot_INTERFACE_DEFINED__
+DEFINE_GUID(IID_IRawElementProviderFragmentRoot, 0x620ce2a5, 0xab8f, 0x40a9, 0x86,0xcb, 0xde,0x3c,0x75,0x59,0x9b,0x58);
+MIDL_INTERFACE("620ce2a5-ab8f-40a9-86cb-de3c75599b58")
+IRawElementProviderFragmentRoot : public IUnknown
+{
+public:
+ virtual HRESULT STDMETHODCALLTYPE ElementProviderFromPoint(double x, double y, __RPC__deref_out_opt IRawElementProviderFragment **pRetVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetFocus(__RPC__deref_out_opt IRawElementProviderFragment **pRetVal) = 0;
+};
+#ifdef __CRT_UUID_DECL
+__CRT_UUID_DECL(IRawElementProviderFragmentRoot, 0x620ce2a5, 0xab8f, 0x40a9, 0x86,0xcb, 0xde,0x3c,0x75,0x59,0x9b,0x58)
+#endif
+#endif
+
+
+#ifndef __IValueProvider_INTERFACE_DEFINED__
+#define __IValueProvider_INTERFACE_DEFINED__
+DEFINE_GUID(IID_IValueProvider, 0xc7935180, 0x6fb3, 0x4201, 0xb1,0x74, 0x7d,0xf7,0x3a,0xdb,0xf6,0x4a);
+MIDL_INTERFACE("c7935180-6fb3-4201-b174-7df73adbf64a")
+IValueProvider : public IUnknown
+{
+public:
+ virtual HRESULT STDMETHODCALLTYPE SetValue(__RPC__in LPCWSTR val) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_Value(__RPC__deref_out_opt BSTR *pRetVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_IsReadOnly(__RPC__out BOOL *pRetVal) = 0;
+};
+#ifdef __CRT_UUID_DECL
+__CRT_UUID_DECL(IValueProvider, 0xc7935180, 0x6fb3, 0x4201, 0xb1,0x74, 0x7d,0xf7,0x3a,0xdb,0xf6,0x4a)
+#endif
+#endif
+
+
+#ifndef __IRangeValueProvider_INTERFACE_DEFINED__
+#define __IRangeValueProvider_INTERFACE_DEFINED__
+DEFINE_GUID(IID_IRangeValueProvider, 0x36dc7aef, 0x33e6, 0x4691, 0xaf,0xe1, 0x2b,0xe7,0x27,0x4b,0x3d,0x33);
+MIDL_INTERFACE("36dc7aef-33e6-4691-afe1-2be7274b3d33")
+IRangeValueProvider : public IUnknown
+{
+public:
+ virtual HRESULT STDMETHODCALLTYPE SetValue(double val) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_Value(__RPC__out double *pRetVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_IsReadOnly(__RPC__out BOOL *pRetVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_Maximum(__RPC__out double *pRetVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_Minimum(__RPC__out double *pRetVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_LargeChange(__RPC__out double *pRetVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_SmallChange(__RPC__out double *pRetVal) = 0;
+};
+#ifdef __CRT_UUID_DECL
+__CRT_UUID_DECL(IRangeValueProvider, 0x36dc7aef, 0x33e6, 0x4691, 0xaf,0xe1, 0x2b,0xe7,0x27,0x4b,0x3d,0x33)
+#endif
+#endif
+
+
+#ifndef __ITextRangeProvider_INTERFACE_DEFINED__
+#define __ITextRangeProvider_INTERFACE_DEFINED__
+DEFINE_GUID(IID_ITextRangeProvider, 0x5347ad7b, 0xc355, 0x46f8, 0xaf,0xf5, 0x90,0x90,0x33,0x58,0x2f,0x63);
+MIDL_INTERFACE("5347ad7b-c355-46f8-aff5-909033582f63")
+ITextRangeProvider : public IUnknown
+{
+public:
+ virtual HRESULT STDMETHODCALLTYPE Clone(__RPC__deref_out_opt ITextRangeProvider **pRetVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE Compare(__RPC__in_opt ITextRangeProvider *range, __RPC__out BOOL *pRetVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE CompareEndpoints(enum TextPatternRangeEndpoint endpoint, __RPC__in_opt ITextRangeProvider *targetRange, enum TextPatternRangeEndpoint targetEndpoint, __RPC__out int *pRetVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE ExpandToEnclosingUnit(enum TextUnit unit) = 0;
+ virtual HRESULT STDMETHODCALLTYPE FindAttribute(TEXTATTRIBUTEID attributeId, VARIANT val, BOOL backward, __RPC__deref_out_opt ITextRangeProvider **pRetVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE FindText(__RPC__in BSTR text, BOOL backward, BOOL ignoreCase, __RPC__deref_out_opt ITextRangeProvider **pRetVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetAttributeValue(TEXTATTRIBUTEID attributeId, __RPC__out VARIANT *pRetVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetBoundingRectangles(__RPC__deref_out_opt SAFEARRAY **pRetVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetEnclosingElement(__RPC__deref_out_opt IRawElementProviderSimple **pRetVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetText(int maxLength, __RPC__deref_out_opt BSTR *pRetVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE Move(enum TextUnit unit, int count, __RPC__out int *pRetVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE MoveEndpointByUnit(enum TextPatternRangeEndpoint endpoint, enum TextUnit unit, int count, __RPC__out int *pRetVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE MoveEndpointByRange(enum TextPatternRangeEndpoint endpoint, __RPC__in_opt ITextRangeProvider *targetRange, enum TextPatternRangeEndpoint targetEndpoint) = 0;
+ virtual HRESULT STDMETHODCALLTYPE Select() = 0;
+ virtual HRESULT STDMETHODCALLTYPE AddToSelection() = 0;
+ virtual HRESULT STDMETHODCALLTYPE RemoveFromSelection() = 0;
+ virtual HRESULT STDMETHODCALLTYPE ScrollIntoView(BOOL alignToTop) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetChildren(__RPC__deref_out_opt SAFEARRAY **pRetVal) = 0;
+};
+#ifdef __CRT_UUID_DECL
+__CRT_UUID_DECL(ITextRangeProvider, 0x5347ad7b, 0xc355, 0x46f8, 0xaf,0xf5, 0x90,0x90,0x33,0x58,0x2f,0x63)
+#endif
+#endif
+
+
+#ifndef __ITextProvider_INTERFACE_DEFINED__
+#define __ITextProvider_INTERFACE_DEFINED__
+DEFINE_GUID(IID_ITextProvider, 0x3589c92c, 0x63f3, 0x4367, 0x99,0xbb, 0xad,0xa6,0x53,0xb7,0x7c,0xf2);
+MIDL_INTERFACE("3589c92c-63f3-4367-99bb-ada653b77cf2")
+ITextProvider : public IUnknown
+{
+public:
+ virtual HRESULT STDMETHODCALLTYPE GetSelection(__RPC__deref_out_opt SAFEARRAY **pRetVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetVisibleRanges(__RPC__deref_out_opt SAFEARRAY **pRetVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE RangeFromChild(__RPC__in_opt IRawElementProviderSimple *childElement, __RPC__deref_out_opt ITextRangeProvider **pRetVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE RangeFromPoint(struct UiaPoint point, __RPC__deref_out_opt ITextRangeProvider **pRetVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_DocumentRange(__RPC__deref_out_opt ITextRangeProvider **pRetVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_SupportedTextSelection(__RPC__out enum SupportedTextSelection *pRetVal) = 0;
+};
+#ifdef __CRT_UUID_DECL
+__CRT_UUID_DECL(ITextProvider, 0x3589c92c, 0x63f3, 0x4367, 0x99,0xbb, 0xad,0xa6,0x53,0xb7,0x7c,0xf2)
+#endif
+#endif
+
+
+#ifndef __ITextProvider2_INTERFACE_DEFINED__
+#define __ITextProvider2_INTERFACE_DEFINED__
+DEFINE_GUID(IID_ITextProvider2, 0x0dc5e6ed, 0x3e16, 0x4bf1, 0x8f,0x9a, 0xa9,0x79,0x87,0x8b,0xc1,0x95);
+MIDL_INTERFACE("0dc5e6ed-3e16-4bf1-8f9a-a979878bc195")
+ITextProvider2 : public ITextProvider
+{
+public:
+ virtual HRESULT STDMETHODCALLTYPE RangeFromAnnotation(__RPC__in_opt IRawElementProviderSimple *annotationElement, __RPC__deref_out_opt ITextRangeProvider **pRetVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetCaretRange(__RPC__out BOOL *isActive, __RPC__deref_out_opt ITextRangeProvider **pRetVal) = 0;
+};
+#ifdef __CRT_UUID_DECL
+__CRT_UUID_DECL(ITextProvider2, 0x0dc5e6ed, 0x3e16, 0x4bf1, 0x8f,0x9a, 0xa9,0x79,0x87,0x8b,0xc1,0x95)
+#endif
+#endif
+
+
+#ifndef __IToggleProvider_INTERFACE_DEFINED__
+#define __IToggleProvider_INTERFACE_DEFINED__
+DEFINE_GUID(IID_IToggleProvider, 0x56d00bd0, 0xc4f4, 0x433c, 0xa8,0x36, 0x1a,0x52,0xa5,0x7e,0x08,0x92);
+MIDL_INTERFACE("56d00bd0-c4f4-433c-a836-1a52a57e0892")
+IToggleProvider : public IUnknown
+{
+public:
+ virtual HRESULT STDMETHODCALLTYPE Toggle() = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_ToggleState(__RPC__out enum ToggleState *pRetVal) = 0;
+};
+#ifdef __CRT_UUID_DECL
+__CRT_UUID_DECL(IToggleProvider, 0x56d00bd0, 0xc4f4, 0x433c, 0xa8,0x36, 0x1a,0x52,0xa5,0x7e,0x08,0x92)
+#endif
+#endif
+
+
+#ifndef __IInvokeProvider_INTERFACE_DEFINED__
+#define __IInvokeProvider_INTERFACE_DEFINED__
+DEFINE_GUID(IID_IInvokeProvider, 0x54fcb24b, 0xe18e, 0x47a2, 0xb4,0xd3, 0xec,0xcb,0xe7,0x75,0x99,0xa2);
+MIDL_INTERFACE("54fcb24b-e18e-47a2-b4d3-eccbe77599a2")
+IInvokeProvider : public IUnknown
+{
+public:
+ virtual HRESULT STDMETHODCALLTYPE Invoke() = 0;
+};
+#ifdef __CRT_UUID_DECL
+__CRT_UUID_DECL(IInvokeProvider, 0x54fcb24b, 0xe18e, 0x47a2, 0xb4,0xd3, 0xec,0xcb,0xe7,0x75,0x99,0xa2)
+#endif
+#endif
+
+
+#ifndef __ISelectionProvider_INTERFACE_DEFINED__
+#define __ISelectionProvider_INTERFACE_DEFINED__
+DEFINE_GUID(IID_ISelectionProvider, 0xfb8b03af, 0x3bdf, 0x48d4, 0xbd,0x36, 0x1a,0x65,0x79,0x3b,0xe1,0x68);
+MIDL_INTERFACE("fb8b03af-3bdf-48d4-bd36-1a65793be168")
+ISelectionProvider : public IUnknown
+{
+public:
+ virtual HRESULT STDMETHODCALLTYPE GetSelection(__RPC__deref_out_opt SAFEARRAY **pRetVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_CanSelectMultiple(__RPC__out BOOL *pRetVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_IsSelectionRequired(__RPC__out BOOL *pRetVal) = 0;
+};
+#ifdef __CRT_UUID_DECL
+__CRT_UUID_DECL(ISelectionProvider, 0xfb8b03af, 0x3bdf, 0x48d4, 0xbd,0x36, 0x1a,0x65,0x79,0x3b,0xe1,0x68)
+#endif
+#endif
+
+
+#ifndef __ISelectionItemProvider_INTERFACE_DEFINED__
+#define __ISelectionItemProvider_INTERFACE_DEFINED__
+DEFINE_GUID(IID_ISelectionItemProvider, 0x2acad808, 0xb2d4, 0x452d, 0xa4,0x07, 0x91,0xff,0x1a,0xd1,0x67,0xb2);
+MIDL_INTERFACE("2acad808-b2d4-452d-a407-91ff1ad167b2")
+ISelectionItemProvider : public IUnknown
+{
+public:
+ virtual HRESULT STDMETHODCALLTYPE Select() = 0;
+ virtual HRESULT STDMETHODCALLTYPE AddToSelection() = 0;
+ virtual HRESULT STDMETHODCALLTYPE RemoveFromSelection() = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_IsSelected(__RPC__out BOOL *pRetVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_SelectionContainer(__RPC__deref_out_opt IRawElementProviderSimple **pRetVal) = 0;
+};
+#ifdef __CRT_UUID_DECL
+__CRT_UUID_DECL(ISelectionItemProvider, 0x2acad808, 0xb2d4, 0x452d, 0xa4,0x07, 0x91,0xff,0x1a,0xd1,0x67,0xb2)
+#endif
+#endif
+
+
+#ifndef __ITableProvider_INTERFACE_DEFINED__
+#define __ITableProvider_INTERFACE_DEFINED__
+DEFINE_GUID(IID_ITableProvider, 0x9c860395, 0x97b3, 0x490a, 0xb5,0x2a, 0x85,0x8c,0xc2,0x2a,0xf1,0x66);
+MIDL_INTERFACE("9c860395-97b3-490a-b52a-858cc22af166")
+ITableProvider : public IUnknown
+{
+public:
+ virtual HRESULT STDMETHODCALLTYPE GetRowHeaders(__RPC__deref_out_opt SAFEARRAY **pRetVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetColumnHeaders(__RPC__deref_out_opt SAFEARRAY **pRetVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_RowOrColumnMajor(__RPC__out enum RowOrColumnMajor *pRetVal) = 0;
+};
+#ifdef __CRT_UUID_DECL
+__CRT_UUID_DECL(ITableProvider, 0x9c860395, 0x97b3, 0x490a, 0xb5,0x2a, 0x85,0x8c,0xc2,0x2a,0xf1,0x66)
+#endif
+#endif
+
+
+#ifndef __ITableItemProvider_INTERFACE_DEFINED__
+#define __ITableItemProvider_INTERFACE_DEFINED__
+DEFINE_GUID(IID_ITableItemProvider, 0xb9734fa6, 0x771f, 0x4d78, 0x9c,0x90, 0x25,0x17,0x99,0x93,0x49,0xcd);
+MIDL_INTERFACE("b9734fa6-771f-4d78-9c90-2517999349cd")
+ITableItemProvider : public IUnknown
+{
+public:
+ virtual HRESULT STDMETHODCALLTYPE GetRowHeaderItems(__RPC__deref_out_opt SAFEARRAY **pRetVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE GetColumnHeaderItems(__RPC__deref_out_opt SAFEARRAY **pRetVal) = 0;
+};
+#ifdef __CRT_UUID_DECL
+__CRT_UUID_DECL(ITableItemProvider, 0xb9734fa6, 0x771f, 0x4d78, 0x9c,0x90, 0x25,0x17,0x99,0x93,0x49,0xcd)
+#endif
+#endif
+
+
+#ifndef __IGridProvider_INTERFACE_DEFINED__
+#define __IGridProvider_INTERFACE_DEFINED__
+DEFINE_GUID(IID_IGridProvider, 0xb17d6187, 0x0907, 0x464b, 0xa1,0x68, 0x0e,0xf1,0x7a,0x15,0x72,0xb1);
+MIDL_INTERFACE("b17d6187-0907-464b-a168-0ef17a1572b1")
+IGridProvider : public IUnknown
+{
+public:
+ virtual HRESULT STDMETHODCALLTYPE GetItem(int row, int column, __RPC__deref_out_opt IRawElementProviderSimple **pRetVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_RowCount(__RPC__out int *pRetVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_ColumnCount(__RPC__out int *pRetVal) = 0;
+};
+#ifdef __CRT_UUID_DECL
+__CRT_UUID_DECL(IGridProvider, 0xb17d6187, 0x0907, 0x464b, 0xa1,0x68, 0x0e,0xf1,0x7a,0x15,0x72,0xb1)
+#endif
+#endif
+
+
+#ifndef __IGridItemProvider_INTERFACE_DEFINED__
+#define __IGridItemProvider_INTERFACE_DEFINED__
+DEFINE_GUID(IID_IGridItemProvider, 0xd02541f1, 0xfb81, 0x4d64, 0xae,0x32, 0xf5,0x20,0xf8,0xa6,0xdb,0xd1);
+MIDL_INTERFACE("d02541f1-fb81-4d64-ae32-f520f8a6dbd1")
+IGridItemProvider : public IUnknown
+{
+public:
+ virtual HRESULT STDMETHODCALLTYPE get_Row(__RPC__out int *pRetVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_Column(__RPC__out int *pRetVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_RowSpan(__RPC__out int *pRetVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_ColumnSpan(__RPC__out int *pRetVal) = 0;
+ virtual HRESULT STDMETHODCALLTYPE get_ContainingGrid(__RPC__deref_out_opt IRawElementProviderSimple **pRetVal) = 0;
+};
+#ifdef __CRT_UUID_DECL
+__CRT_UUID_DECL(IGridItemProvider, 0xd02541f1, 0xfb81, 0x4d64, 0xae,0x32, 0xf5,0x20,0xf8,0xa6,0xdb,0xd1)
+#endif
+#endif
+
+#endif
diff --git a/src/platformsupport/windowsuiautomation/uiatypes.h b/src/platformsupport/windowsuiautomation/uiatypes.h
new file mode 100644
index 0000000000..25d8b8cb2b
--- /dev/null
+++ b/src/platformsupport/windowsuiautomation/uiatypes.h
@@ -0,0 +1,145 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef UIATYPES_H
+#define UIATYPES_H
+
+typedef int PROPERTYID;
+typedef int PATTERNID;
+typedef int EVENTID;
+typedef int TEXTATTRIBUTEID;
+typedef int CONTROLTYPEID;
+typedef int LANDMARKTYPEID;
+typedef int METADATAID;
+
+typedef void *UIA_HWND;
+
+enum NavigateDirection {
+ NavigateDirection_Parent = 0,
+ NavigateDirection_NextSibling = 1,
+ NavigateDirection_PreviousSibling = 2,
+ NavigateDirection_FirstChild = 3,
+ NavigateDirection_LastChild = 4
+};
+
+enum ProviderOptions {
+ ProviderOptions_ClientSideProvider = 0x1,
+ ProviderOptions_ServerSideProvider = 0x2,
+ ProviderOptions_NonClientAreaProvider = 0x4,
+ ProviderOptions_OverrideProvider = 0x8,
+ ProviderOptions_ProviderOwnsSetFocus = 0x10,
+ ProviderOptions_UseComThreading = 0x20,
+ ProviderOptions_RefuseNonClientSupport = 0x40,
+ ProviderOptions_HasNativeIAccessible = 0x80,
+ ProviderOptions_UseClientCoordinates = 0x100
+};
+
+enum SupportedTextSelection {
+ SupportedTextSelection_None = 0,
+ SupportedTextSelection_Single = 1,
+ SupportedTextSelection_Multiple = 2
+};
+
+enum TextUnit {
+ TextUnit_Character = 0,
+ TextUnit_Format = 1,
+ TextUnit_Word = 2,
+ TextUnit_Line = 3,
+ TextUnit_Paragraph = 4,
+ TextUnit_Page = 5,
+ TextUnit_Document = 6
+};
+
+enum TextPatternRangeEndpoint {
+ TextPatternRangeEndpoint_Start = 0,
+ TextPatternRangeEndpoint_End = 1
+};
+
+enum CaretPosition {
+ CaretPosition_Unknown = 0,
+ CaretPosition_EndOfLine = 1,
+ CaretPosition_BeginningOfLine = 2
+};
+
+enum ToggleState {
+ ToggleState_Off = 0,
+ ToggleState_On = 1,
+ ToggleState_Indeterminate = 2
+};
+
+enum RowOrColumnMajor {
+ RowOrColumnMajor_RowMajor = 0,
+ RowOrColumnMajor_ColumnMajor = 1,
+ RowOrColumnMajor_Indeterminate = 2
+};
+
+enum TreeScope {
+ TreeScope_None = 0,
+ TreeScope_Element = 0x1,
+ TreeScope_Children = 0x2,
+ TreeScope_Descendants = 0x4,
+ TreeScope_Parent = 0x8,
+ TreeScope_Ancestors = 0x10,
+ TreeScope_Subtree = TreeScope_Element | TreeScope_Children | TreeScope_Descendants
+};
+
+enum OrientationType {
+ OrientationType_None = 0,
+ OrientationType_Horizontal = 1,
+ OrientationType_Vertical = 2
+};
+
+enum PropertyConditionFlags {
+ PropertyConditionFlags_None = 0,
+ PropertyConditionFlags_IgnoreCase = 1
+};
+
+struct UiaRect {
+ double left;
+ double top;
+ double width;
+ double height;
+};
+
+struct UiaPoint {
+ double x;
+ double y;
+};
+
+#endif
diff --git a/src/platformsupport/windowsuiautomation/windowsuiautomation.pro b/src/platformsupport/windowsuiautomation/windowsuiautomation.pro
new file mode 100644
index 0000000000..28c26477f3
--- /dev/null
+++ b/src/platformsupport/windowsuiautomation/windowsuiautomation.pro
@@ -0,0 +1,23 @@
+TARGET = QtWindowsUIAutomationSupport
+MODULE = windowsuiautomation_support
+
+QT = core-private gui-private
+CONFIG += static internal_module
+
+HEADERS += \
+ qwindowsuiawrapper_p.h \
+ uiaattributeids.h \
+ uiacontroltypeids.h \
+ uiaerrorids.h \
+ uiaeventids.h \
+ uiageneralids.h \
+ uiaserverinterfaces.h \
+ uiaclientinterfaces.h \
+ uiapatternids.h \
+ uiapropertyids.h \
+ uiatypes.h
+
+SOURCES += \
+ qwindowsuiawrapper.cpp
+
+load(qt_module)
diff --git a/src/plugins/bearer/android/jar/bundledjar.pro b/src/plugins/bearer/android/jar/bundledjar.pro
deleted file mode 100644
index 6037f813f2..0000000000
--- a/src/plugins/bearer/android/jar/bundledjar.pro
+++ /dev/null
@@ -1,3 +0,0 @@
-TARGET = QtAndroidBearer-bundled
-CONFIG += bundled_jar_file
-include(jar.pri)
diff --git a/src/plugins/bearer/android/jar/distributedjar.pro b/src/plugins/bearer/android/jar/distributedjar.pro
deleted file mode 100644
index c769a113d5..0000000000
--- a/src/plugins/bearer/android/jar/distributedjar.pro
+++ /dev/null
@@ -1,2 +0,0 @@
-TARGET = QtAndroidBearer
-include(jar.pri)
diff --git a/src/plugins/bearer/android/jar/jar.pri b/src/plugins/bearer/android/jar/jar.pri
deleted file mode 100644
index e43dbf0711..0000000000
--- a/src/plugins/bearer/android/jar/jar.pri
+++ /dev/null
@@ -1,11 +0,0 @@
-load(qt_build_paths)
-CONFIG += java
-DESTDIR = $$MODULE_BASE_OUTDIR/jar
-
-JAVACLASSPATH += $$PWD/src
-
-JAVASOURCES += $$PWD/src/org/qtproject/qt5/android/bearer/QtNetworkReceiver.java
-
-# install
-target.path = $$[QT_INSTALL_PREFIX]/jar
-INSTALLS += target
diff --git a/src/plugins/bearer/android/jar/jar.pro b/src/plugins/bearer/android/jar/jar.pro
index 923e757d9b..f988019dac 100644
--- a/src/plugins/bearer/android/jar/jar.pro
+++ b/src/plugins/bearer/android/jar/jar.pro
@@ -1,2 +1,13 @@
-TEMPLATE=subdirs
-SUBDIRS += distributedjar.pro bundledjar.pro
+TARGET = QtAndroidBearer
+
+load(qt_build_paths)
+CONFIG += java
+DESTDIR = $$MODULE_BASE_OUTDIR/jar
+
+JAVACLASSPATH += $$PWD/src
+
+JAVASOURCES += $$PWD/src/org/qtproject/qt5/android/bearer/QtNetworkReceiver.java
+
+# install
+target.path = $$[QT_INSTALL_PREFIX]/jar
+INSTALLS += target
diff --git a/src/plugins/bearer/android/src/main.cpp b/src/plugins/bearer/android/src/main.cpp
index 3892766b89..f3a5074e5d 100644
--- a/src/plugins/bearer/android/src/main.cpp
+++ b/src/plugins/bearer/android/src/main.cpp
@@ -50,7 +50,7 @@ class QAndroidBearerEnginePlugin : public QBearerEnginePlugin
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QBearerEngineFactoryInterface" FILE "android.json")
public:
- QBearerEngine *create(const QString &key) const Q_DECL_OVERRIDE
+ QBearerEngine *create(const QString &key) const override
{
return (key == QLatin1String("android")) ? new QAndroidBearerEngine() : 0;
}
diff --git a/src/plugins/bearer/android/src/qandroidbearerengine.h b/src/plugins/bearer/android/src/qandroidbearerengine.h
index f404ca65eb..837b02232d 100644
--- a/src/plugins/bearer/android/src/qandroidbearerengine.h
+++ b/src/plugins/bearer/android/src/qandroidbearerengine.h
@@ -60,20 +60,20 @@ class QAndroidBearerEngine : public QBearerEngineImpl
public:
explicit QAndroidBearerEngine(QObject *parent = 0);
- ~QAndroidBearerEngine() Q_DECL_OVERRIDE;
-
- QString getInterfaceFromId(const QString &id) Q_DECL_OVERRIDE;
- bool hasIdentifier(const QString &id) Q_DECL_OVERRIDE;
- void connectToId(const QString &id) Q_DECL_OVERRIDE;
- void disconnectFromId(const QString &id) Q_DECL_OVERRIDE;
- QNetworkSession::State sessionStateForId(const QString &id) Q_DECL_OVERRIDE;
- QNetworkConfigurationManager::Capabilities capabilities() const Q_DECL_OVERRIDE;
- QNetworkSessionPrivate *createSessionBackend() Q_DECL_OVERRIDE;
- QNetworkConfigurationPrivatePointer defaultConfiguration() Q_DECL_OVERRIDE;
- bool requiresPolling() const Q_DECL_OVERRIDE;
- quint64 bytesWritten(const QString &id) Q_DECL_OVERRIDE;
- quint64 bytesReceived(const QString &id) Q_DECL_OVERRIDE;
- quint64 startTime(const QString &id) Q_DECL_OVERRIDE;
+ ~QAndroidBearerEngine() override;
+
+ QString getInterfaceFromId(const QString &id) override;
+ bool hasIdentifier(const QString &id) override;
+ void connectToId(const QString &id) override;
+ void disconnectFromId(const QString &id) override;
+ QNetworkSession::State sessionStateForId(const QString &id) override;
+ QNetworkConfigurationManager::Capabilities capabilities() const override;
+ QNetworkSessionPrivate *createSessionBackend() override;
+ QNetworkConfigurationPrivatePointer defaultConfiguration() override;
+ bool requiresPolling() const override;
+ quint64 bytesWritten(const QString &id) override;
+ quint64 bytesReceived(const QString &id) override;
+ quint64 startTime(const QString &id) override;
Q_INVOKABLE void initialize();
Q_INVOKABLE void requestUpdate();
diff --git a/src/plugins/bearer/generic/main.cpp b/src/plugins/bearer/generic/main.cpp
index 80e7b7d9aa..82a9ce97f4 100644
--- a/src/plugins/bearer/generic/main.cpp
+++ b/src/plugins/bearer/generic/main.cpp
@@ -54,7 +54,7 @@ public:
QGenericEnginePlugin();
~QGenericEnginePlugin();
- QBearerEngine *create(const QString &key) const Q_DECL_OVERRIDE;
+ QBearerEngine *create(const QString &key) const override;
};
QGenericEnginePlugin::QGenericEnginePlugin()
diff --git a/src/plugins/bearer/generic/qgenericengine.h b/src/plugins/bearer/generic/qgenericengine.h
index e680eb9cc0..08960d66f6 100644
--- a/src/plugins/bearer/generic/qgenericengine.h
+++ b/src/plugins/bearer/generic/qgenericengine.h
@@ -58,24 +58,24 @@ public:
QGenericEngine(QObject *parent = 0);
~QGenericEngine();
- QString getInterfaceFromId(const QString &id) Q_DECL_OVERRIDE;
- bool hasIdentifier(const QString &id) Q_DECL_OVERRIDE;
+ QString getInterfaceFromId(const QString &id) override;
+ bool hasIdentifier(const QString &id) override;
- void connectToId(const QString &id) Q_DECL_OVERRIDE;
- void disconnectFromId(const QString &id) Q_DECL_OVERRIDE;
+ void connectToId(const QString &id) override;
+ void disconnectFromId(const QString &id) override;
Q_INVOKABLE void initialize();
Q_INVOKABLE void requestUpdate();
- QNetworkSession::State sessionStateForId(const QString &id) Q_DECL_OVERRIDE;
+ QNetworkSession::State sessionStateForId(const QString &id) override;
- QNetworkConfigurationManager::Capabilities capabilities() const Q_DECL_OVERRIDE;
+ QNetworkConfigurationManager::Capabilities capabilities() const override;
- QNetworkSessionPrivate *createSessionBackend() Q_DECL_OVERRIDE;
+ QNetworkSessionPrivate *createSessionBackend() override;
- QNetworkConfigurationPrivatePointer defaultConfiguration() Q_DECL_OVERRIDE;
+ QNetworkConfigurationPrivatePointer defaultConfiguration() override;
- bool requiresPolling() const Q_DECL_OVERRIDE;
+ bool requiresPolling() const override;
private Q_SLOTS:
void doRequestUpdate();
diff --git a/src/plugins/bearer/qnetworksession_impl.h b/src/plugins/bearer/qnetworksession_impl.h
index e9c0e383fc..d9aa6ca8fb 100644
--- a/src/plugins/bearer/qnetworksession_impl.h
+++ b/src/plugins/bearer/qnetworksession_impl.h
@@ -75,31 +75,31 @@ public:
//that the state is immediately updated (w/o actually opening
//a session). Also this function should take care of
//notification hooks to discover future state changes.
- void syncStateWithInterface() Q_DECL_OVERRIDE;
+ void syncStateWithInterface() override;
#ifndef QT_NO_NETWORKINTERFACE
- QNetworkInterface currentInterface() const Q_DECL_OVERRIDE;
+ QNetworkInterface currentInterface() const override;
#endif
- QVariant sessionProperty(const QString& key) const Q_DECL_OVERRIDE;
- void setSessionProperty(const QString& key, const QVariant& value) Q_DECL_OVERRIDE;
-
- void open() Q_DECL_OVERRIDE;
- void close() Q_DECL_OVERRIDE;
- void stop() Q_DECL_OVERRIDE;
- void migrate() Q_DECL_OVERRIDE;
- void accept() Q_DECL_OVERRIDE;
- void ignore() Q_DECL_OVERRIDE;
- void reject() Q_DECL_OVERRIDE;
-
- QString errorString() const Q_DECL_OVERRIDE; //must return translated string
- QNetworkSession::SessionError error() const Q_DECL_OVERRIDE;
-
- quint64 bytesWritten() const Q_DECL_OVERRIDE;
- quint64 bytesReceived() const Q_DECL_OVERRIDE;
- quint64 activeTime() const Q_DECL_OVERRIDE;
-
- QNetworkSession::UsagePolicies usagePolicies() const Q_DECL_OVERRIDE;
- void setUsagePolicies(QNetworkSession::UsagePolicies) Q_DECL_OVERRIDE;
+ QVariant sessionProperty(const QString& key) const override;
+ void setSessionProperty(const QString& key, const QVariant& value) override;
+
+ void open() override;
+ void close() override;
+ void stop() override;
+ void migrate() override;
+ void accept() override;
+ void ignore() override;
+ void reject() override;
+
+ QString errorString() const override; //must return translated string
+ QNetworkSession::SessionError error() const override;
+
+ quint64 bytesWritten() const override;
+ quint64 bytesReceived() const override;
+ quint64 activeTime() const override;
+
+ QNetworkSession::UsagePolicies usagePolicies() const override;
+ void setUsagePolicies(QNetworkSession::UsagePolicies) override;
private Q_SLOTS:
void networkConfigurationsChanged();
diff --git a/src/plugins/generic/evdevkeyboard/main.cpp b/src/plugins/generic/evdevkeyboard/main.cpp
index ef08cd56ab..5c170e1a06 100644
--- a/src/plugins/generic/evdevkeyboard/main.cpp
+++ b/src/plugins/generic/evdevkeyboard/main.cpp
@@ -50,7 +50,7 @@ class QEvdevKeyboardPlugin : public QGenericPlugin
public:
QEvdevKeyboardPlugin();
- QObject* create(const QString &key, const QString &specification) Q_DECL_OVERRIDE;
+ QObject* create(const QString &key, const QString &specification) override;
};
QEvdevKeyboardPlugin::QEvdevKeyboardPlugin()
diff --git a/src/plugins/generic/evdevmouse/main.cpp b/src/plugins/generic/evdevmouse/main.cpp
index 86ec7cb575..1b8517f4c4 100644
--- a/src/plugins/generic/evdevmouse/main.cpp
+++ b/src/plugins/generic/evdevmouse/main.cpp
@@ -50,7 +50,7 @@ class QEvdevMousePlugin : public QGenericPlugin
public:
QEvdevMousePlugin();
- QObject* create(const QString &key, const QString &specification) Q_DECL_OVERRIDE;
+ QObject* create(const QString &key, const QString &specification) override;
};
QEvdevMousePlugin::QEvdevMousePlugin()
diff --git a/src/plugins/generic/evdevtablet/main.cpp b/src/plugins/generic/evdevtablet/main.cpp
index 0646d71146..f43a32910d 100644
--- a/src/plugins/generic/evdevtablet/main.cpp
+++ b/src/plugins/generic/evdevtablet/main.cpp
@@ -50,7 +50,7 @@ class QEvdevTabletPlugin : public QGenericPlugin
public:
QEvdevTabletPlugin();
- QObject* create(const QString &key, const QString &specification) Q_DECL_OVERRIDE;
+ QObject* create(const QString &key, const QString &specification) override;
};
QEvdevTabletPlugin::QEvdevTabletPlugin()
diff --git a/src/plugins/generic/evdevtouch/main.cpp b/src/plugins/generic/evdevtouch/main.cpp
index aa60614936..f1a0ad53ab 100644
--- a/src/plugins/generic/evdevtouch/main.cpp
+++ b/src/plugins/generic/evdevtouch/main.cpp
@@ -50,7 +50,7 @@ class QEvdevTouchScreenPlugin : public QGenericPlugin
public:
QEvdevTouchScreenPlugin();
- QObject* create(const QString &key, const QString &specification) Q_DECL_OVERRIDE;
+ QObject* create(const QString &key, const QString &specification) override;
};
QEvdevTouchScreenPlugin::QEvdevTouchScreenPlugin()
diff --git a/src/plugins/imageformats/jpeg/qjpeghandler.cpp b/src/plugins/imageformats/jpeg/qjpeghandler.cpp
index 68619928d3..1cdc28c077 100644
--- a/src/plugins/imageformats/jpeg/qjpeghandler.cpp
+++ b/src/plugins/imageformats/jpeg/qjpeghandler.cpp
@@ -65,9 +65,6 @@ extern "C" {
#endif
#define XMD_H // shut JPEGlib up
-#if defined(Q_OS_UNIXWARE)
-# define HAVE_BOOLEAN // libjpeg under Unixware seems to need this
-#endif
#include <jpeglib.h>
#ifdef const
# undef const // remove crazy C hackery in jconfig.h
diff --git a/src/plugins/platforminputcontexts/compose/qcomposeplatforminputcontext.h b/src/plugins/platforminputcontexts/compose/qcomposeplatforminputcontext.h
index f82280903d..4830959665 100644
--- a/src/plugins/platforminputcontexts/compose/qcomposeplatforminputcontext.h
+++ b/src/plugins/platforminputcontexts/compose/qcomposeplatforminputcontext.h
@@ -58,11 +58,11 @@ public:
QComposeInputContext();
~QComposeInputContext();
- bool isValid() const Q_DECL_OVERRIDE;
- void setFocusObject(QObject *object) Q_DECL_OVERRIDE;
- void reset() Q_DECL_OVERRIDE;
- void update(Qt::InputMethodQueries) Q_DECL_OVERRIDE;
- bool filterEvent(const QEvent *event) Q_DECL_OVERRIDE;
+ bool isValid() const override;
+ void setFocusObject(QObject *object) override;
+ void reset() override;
+ void update(Qt::InputMethodQueries) override;
+ bool filterEvent(const QEvent *event) override;
protected:
void clearComposeBuffer();
diff --git a/src/plugins/platforminputcontexts/compose/qcomposeplatforminputcontextmain.cpp b/src/plugins/platforminputcontexts/compose/qcomposeplatforminputcontextmain.cpp
index 97a7242ca6..6b33df65b9 100644
--- a/src/plugins/platforminputcontexts/compose/qcomposeplatforminputcontextmain.cpp
+++ b/src/plugins/platforminputcontexts/compose/qcomposeplatforminputcontextmain.cpp
@@ -51,7 +51,7 @@ class QComposePlatformInputContextPlugin : public QPlatformInputContextPlugin
Q_PLUGIN_METADATA(IID QPlatformInputContextFactoryInterface_iid FILE "compose.json")
public:
- QComposeInputContext *create(const QString &, const QStringList &) Q_DECL_OVERRIDE;
+ QComposeInputContext *create(const QString &, const QStringList &) override;
};
QComposeInputContext *QComposePlatformInputContextPlugin::create(const QString &system, const QStringList &paramList)
diff --git a/src/plugins/platforminputcontexts/ibus/main.cpp b/src/plugins/platforminputcontexts/ibus/main.cpp
index 2846f52c8c..0a7da3b14c 100644
--- a/src/plugins/platforminputcontexts/ibus/main.cpp
+++ b/src/plugins/platforminputcontexts/ibus/main.cpp
@@ -51,7 +51,7 @@ class QIbusPlatformInputContextPlugin : public QPlatformInputContextPlugin
Q_PLUGIN_METADATA(IID QPlatformInputContextFactoryInterface_iid FILE "ibus.json")
public:
- QIBusPlatformInputContext *create(const QString&, const QStringList&) Q_DECL_OVERRIDE;
+ QIBusPlatformInputContext *create(const QString&, const QStringList&) override;
};
QIBusPlatformInputContext *QIbusPlatformInputContextPlugin::create(const QString& system, const QStringList& paramList)
diff --git a/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp b/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp
index 9675d828e7..379e428cb0 100644
--- a/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp
+++ b/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp
@@ -90,6 +90,7 @@ public:
bool valid;
bool busConnected;
QString predit;
+ QList<QInputMethodEvent::Attribute> attributes;
bool needsSurroundingText;
QLocale locale;
};
@@ -165,6 +166,7 @@ void QIBusPlatformInputContext::reset()
d->context->Reset();
d->predit = QString();
+ d->attributes.clear();
}
void QIBusPlatformInputContext::commit()
@@ -177,6 +179,7 @@ void QIBusPlatformInputContext::commit()
QObject *input = qApp->focusObject();
if (!input) {
d->predit = QString();
+ d->attributes.clear();
return;
}
@@ -188,6 +191,7 @@ void QIBusPlatformInputContext::commit()
d->context->Reset();
d->predit = QString();
+ d->attributes.clear();
}
@@ -274,6 +278,7 @@ void QIBusPlatformInputContext::commitText(const QDBusVariant &text)
QCoreApplication::sendEvent(input, &event);
d->predit = QString();
+ d->attributes.clear();
}
void QIBusPlatformInputContext::updatePreeditText(const QDBusVariant &text, uint cursorPos, bool visible)
@@ -292,11 +297,11 @@ void QIBusPlatformInputContext::updatePreeditText(const QDBusVariant &text, uint
if (debug)
qDebug() << "preedit text:" << t.text;
- QList<QInputMethodEvent::Attribute> attributes = t.attributes.imAttributes();
+ d->attributes = t.attributes.imAttributes();
if (!t.text.isEmpty())
- attributes += QInputMethodEvent::Attribute(QInputMethodEvent::Cursor, cursorPos, visible ? 1 : 0);
+ d->attributes += QInputMethodEvent::Attribute(QInputMethodEvent::Cursor, cursorPos, visible ? 1 : 0, QVariant());
- QInputMethodEvent event(t.text, attributes);
+ QInputMethodEvent event(t.text, d->attributes);
QCoreApplication::sendEvent(input, &event);
d->predit = t.text;
@@ -324,6 +329,27 @@ void QIBusPlatformInputContext::deleteSurroundingText(int offset, uint n_chars)
QCoreApplication::sendEvent(input, &event);
}
+void QIBusPlatformInputContext::hidePreeditText()
+{
+ QObject *input = QGuiApplication::focusObject();
+ if (!input)
+ return;
+
+ QList<QInputMethodEvent::Attribute> attributes;
+ QInputMethodEvent event(QString(), attributes);
+ QCoreApplication::sendEvent(input, &event);
+}
+
+void QIBusPlatformInputContext::showPreeditText()
+{
+ QObject *input = QGuiApplication::focusObject();
+ if (!input)
+ return;
+
+ QInputMethodEvent event(d->predit, d->attributes);
+ QCoreApplication::sendEvent(input, &event);
+}
+
bool QIBusPlatformInputContext::filterEvent(const QEvent *event)
{
if (!d->busConnected)
@@ -498,6 +524,8 @@ void QIBusPlatformInputContext::connectToContextSignals()
connect(d->context, SIGNAL(UpdatePreeditText(QDBusVariant,uint,bool)), this, SLOT(updatePreeditText(QDBusVariant,uint,bool)));
connect(d->context, SIGNAL(DeleteSurroundingText(int,uint)), this, SLOT(deleteSurroundingText(int,uint)));
connect(d->context, SIGNAL(RequireSurroundingText()), this, SLOT(surroundingTextRequired()));
+ connect(d->context, SIGNAL(HidePreeditText()), this, SLOT(hidePreeditText()));
+ connect(d->context, SIGNAL(ShowPreeditText()), this, SLOT(showPreeditText()));
}
}
diff --git a/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.h b/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.h
index 7baa9ad1da..f78c99e2bd 100644
--- a/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.h
+++ b/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.h
@@ -86,16 +86,16 @@ public:
QIBusPlatformInputContext();
~QIBusPlatformInputContext();
- bool isValid() const Q_DECL_OVERRIDE;
- void setFocusObject(QObject *object) Q_DECL_OVERRIDE;
+ bool isValid() const override;
+ void setFocusObject(QObject *object) override;
- void invokeAction(QInputMethod::Action a, int x) Q_DECL_OVERRIDE;
- void reset() Q_DECL_OVERRIDE;
- void commit() Q_DECL_OVERRIDE;
- void update(Qt::InputMethodQueries) Q_DECL_OVERRIDE;
- bool filterEvent(const QEvent *event) Q_DECL_OVERRIDE;
- QLocale locale() const Q_DECL_OVERRIDE;
- bool hasCapability(Capability capability) const Q_DECL_OVERRIDE;
+ void invokeAction(QInputMethod::Action a, int x) override;
+ void reset() override;
+ void commit() override;
+ void update(Qt::InputMethodQueries) override;
+ bool filterEvent(const QEvent *event) override;
+ QLocale locale() const override;
+ bool hasCapability(Capability capability) const override;
public Q_SLOTS:
void commitText(const QDBusVariant &text);
@@ -103,6 +103,8 @@ public Q_SLOTS:
void cursorRectChanged();
void deleteSurroundingText(int offset, uint n_chars);
void surroundingTextRequired();
+ void hidePreeditText();
+ void showPreeditText();
void filterEventFinished(QDBusPendingCallWatcher *call);
void socketChanged(const QString &str);
void connectToBus();
diff --git a/src/plugins/platforms/cocoa/qcocoaaccessibility.h b/src/plugins/platforms/cocoa/qcocoaaccessibility.h
index e7957276c2..e456364555 100644
--- a/src/plugins/platforms/cocoa/qcocoaaccessibility.h
+++ b/src/plugins/platforms/cocoa/qcocoaaccessibility.h
@@ -53,10 +53,10 @@ class QCocoaAccessibility : public QPlatformAccessibility
public:
QCocoaAccessibility();
~QCocoaAccessibility();
- void notifyAccessibilityUpdate(QAccessibleEvent *event) Q_DECL_OVERRIDE;
- void setRootObject(QObject *o) Q_DECL_OVERRIDE;
- void initialize() Q_DECL_OVERRIDE;
- void cleanup() Q_DECL_OVERRIDE;
+ void notifyAccessibilityUpdate(QAccessibleEvent *event) override;
+ void setRootObject(QObject *o) override;
+ void initialize() override;
+ void cleanup() override;
};
namespace QCocoaAccessible {
diff --git a/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm b/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm
index 7e6bae127c..df2336d08b 100644
--- a/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm
+++ b/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm
@@ -40,6 +40,7 @@
#include "qcocoaaccessibility.h"
#include "qcocoahelpers.h"
#include "qcocoawindow.h"
+#include "qcocoascreen.h"
#include "private/qaccessiblecache_p.h"
#include <QtAccessibilitySupport/private/qaccessiblebridgeutils_p.h>
#include <QtGui/qaccessible.h>
@@ -298,9 +299,9 @@ static void convertLineOffset(QAccessibleTextInterface *text, int *line, int *of
// We're in the same top level element as our parent.
return [[self parentElement] accessibilityAttributeValue:NSAccessibilityTopLevelUIElementAttribute];
} else if ([attribute isEqualToString:NSAccessibilityPositionAttribute]) {
- QPoint qtPosition = iface->rect().topLeft();
- QSize qtSize = iface->rect().size();
- return [NSValue valueWithPoint: NSMakePoint(qtPosition.x(), qt_mac_flipYCoordinate(qtPosition.y() + qtSize.height()))];
+ // The position in points of the element's lower-left corner in screen-relative coordinates
+ QPointF qtPosition = QRectF(iface->rect()).bottomLeft();
+ return [NSValue valueWithPoint:QCocoaScreen::mapToNative(qtPosition)];
} else if ([attribute isEqualToString:NSAccessibilitySizeAttribute]) {
QSize qtSize = iface->rect().size();
return [NSValue valueWithSize: NSMakeSize(qtSize.width(), qtSize.height())];
@@ -430,7 +431,7 @@ static void convertLineOffset(QAccessibleTextInterface *text, int *line, int *of
if ([attribute isEqualToString: NSAccessibilityBoundsForRangeParameterizedAttribute]) {
NSRange range = [parameter rangeValue];
QRect firstRect = iface->textInterface()->characterRect(range.location);
- QRect rect;
+ QRectF rect;
if (range.length > 0) {
NSUInteger position = range.location + range.length - 1;
if (position > range.location && iface->textInterface()->text(position, position + 1) == QStringLiteral("\n"))
@@ -441,15 +442,14 @@ static void convertLineOffset(QAccessibleTextInterface *text, int *line, int *of
rect = firstRect;
rect.setWidth(1);
}
- return [NSValue valueWithRect: NSMakeRect((CGFloat) rect.x(),(CGFloat) qt_mac_flipYCoordinate(rect.y() + rect.height()), rect.width(), rect.height())];
+ return [NSValue valueWithRect:QCocoaScreen::mapToNative(rect)];
}
if ([attribute isEqualToString: NSAccessibilityAttributedStringForRangeParameterizedAttribute]) {
NSRange range = [parameter rangeValue];
QString text = iface->textInterface()->text(range.location, range.location + range.length);
return [[NSAttributedString alloc] initWithString:text.toNSString()];
} else if ([attribute isEqualToString: NSAccessibilityRangeForPositionParameterizedAttribute]) {
- NSPoint nsPoint = [parameter pointValue];
- QPoint point(static_cast<int>(nsPoint.x), static_cast<int>(qt_mac_flipYCoordinate(nsPoint.y)));
+ QPoint point = QCocoaScreen::mapFromNative([parameter pointValue]).toPoint();
int offset = iface->textInterface()->offsetAtPoint(point);
return [NSValue valueWithRange:NSMakeRange(static_cast<NSUInteger>(offset), 1)];
} else if ([attribute isEqualToString: NSAccessibilityStyleRangeForIndexParameterizedAttribute]) {
@@ -566,8 +566,8 @@ static void convertLineOffset(QAccessibleTextInterface *text, int *line, int *of
return NSAccessibilityUnignoredAncestor(self);
}
- int y = qt_mac_flipYCoordinate(point.y);
- QAccessibleInterface *childInterface = iface->childAt(point.x, y);
+ QPointF screenPoint = QCocoaScreen::mapFromNative(point);
+ QAccessibleInterface *childInterface = iface->childAt(screenPoint.x(), screenPoint.y());
// No child found, meaning we hit this element.
if (!childInterface || !childInterface->isValid())
return NSAccessibilityUnignoredAncestor(self);
@@ -575,7 +575,7 @@ static void convertLineOffset(QAccessibleTextInterface *text, int *line, int *of
// find the deepest child at the point
QAccessibleInterface *childOfChildInterface = 0;
do {
- childOfChildInterface = childInterface->childAt(point.x, y);
+ childOfChildInterface = childInterface->childAt(screenPoint.x(), screenPoint.y());
if (childOfChildInterface && childOfChildInterface->isValid())
childInterface = childOfChildInterface;
} while (childOfChildInterface && childOfChildInterface->isValid());
diff --git a/src/plugins/platforms/cocoa/qcocoabackingstore.h b/src/plugins/platforms/cocoa/qcocoabackingstore.h
index a0bc204013..b4cd506513 100644
--- a/src/plugins/platforms/cocoa/qcocoabackingstore.h
+++ b/src/plugins/platforms/cocoa/qcocoabackingstore.h
@@ -52,11 +52,11 @@ public:
QCocoaBackingStore(QWindow *window);
~QCocoaBackingStore();
- void flush(QWindow *, const QRegion &, const QPoint &) Q_DECL_OVERRIDE;
+ void flush(QWindow *, const QRegion &, const QPoint &) override;
private:
bool windowHasUnifiedToolbar() const;
- QImage::Format format() const Q_DECL_OVERRIDE;
+ QImage::Format format() const override;
void redrawRoundedBottomCorners(CGRect) const;
};
diff --git a/src/plugins/platforms/cocoa/qcocoaclipboard.h b/src/plugins/platforms/cocoa/qcocoaclipboard.h
index cab2cfaa91..a78d8f4187 100644
--- a/src/plugins/platforms/cocoa/qcocoaclipboard.h
+++ b/src/plugins/platforms/cocoa/qcocoaclipboard.h
@@ -56,10 +56,10 @@ class QCocoaClipboard : public QObject, public QPlatformClipboard
public:
QCocoaClipboard();
- QMimeData *mimeData(QClipboard::Mode mode = QClipboard::Clipboard) Q_DECL_OVERRIDE;
- void setMimeData(QMimeData *data, QClipboard::Mode mode = QClipboard::Clipboard) Q_DECL_OVERRIDE;
- bool supportsMode(QClipboard::Mode mode) const Q_DECL_OVERRIDE;
- bool ownsMode(QClipboard::Mode mode) const Q_DECL_OVERRIDE;
+ QMimeData *mimeData(QClipboard::Mode mode = QClipboard::Clipboard) override;
+ void setMimeData(QMimeData *data, QClipboard::Mode mode = QClipboard::Clipboard) override;
+ bool supportsMode(QClipboard::Mode mode) const override;
+ bool ownsMode(QClipboard::Mode mode) const override;
private Q_SLOTS:
void handleApplicationStateChanged(Qt::ApplicationState state);
diff --git a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.h b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.h
index 133efd6db8..01ac7e181d 100644
--- a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.h
+++ b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.h
@@ -55,12 +55,12 @@ public:
QCocoaColorDialogHelper();
~QCocoaColorDialogHelper();
- void exec() Q_DECL_OVERRIDE;
- bool show(Qt::WindowFlags windowFlags, Qt::WindowModality windowModality, QWindow *parent) Q_DECL_OVERRIDE;
- void hide() Q_DECL_OVERRIDE;
+ void exec() override;
+ bool show(Qt::WindowFlags windowFlags, Qt::WindowModality windowModality, QWindow *parent) override;
+ void hide() override;
- void setCurrentColor(const QColor&) Q_DECL_OVERRIDE;
- QColor currentColor() const Q_DECL_OVERRIDE;
+ void setCurrentColor(const QColor&) override;
+ QColor currentColor() const override;
};
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/cocoa/qcocoacursor.h b/src/plugins/platforms/cocoa/qcocoacursor.h
index d1586660a4..58b9ef2151 100644
--- a/src/plugins/platforms/cocoa/qcocoacursor.h
+++ b/src/plugins/platforms/cocoa/qcocoacursor.h
@@ -53,9 +53,9 @@ public:
QCocoaCursor();
~QCocoaCursor();
- void changeCursor(QCursor *cursor, QWindow *window) Q_DECL_OVERRIDE;
- QPoint pos() const Q_DECL_OVERRIDE;
- void setPos(const QPoint &position) Q_DECL_OVERRIDE;
+ void changeCursor(QCursor *cursor, QWindow *window) override;
+ QPoint pos() const override;
+ void setPos(const QPoint &position) override;
private:
QHash<Qt::CursorShape, NSCursor *> m_cursors;
NSCursor *convertCursor(QCursor *cursor);
diff --git a/src/plugins/platforms/cocoa/qcocoacursor.mm b/src/plugins/platforms/cocoa/qcocoacursor.mm
index 99a136d384..c021128e4c 100644
--- a/src/plugins/platforms/cocoa/qcocoacursor.mm
+++ b/src/plugins/platforms/cocoa/qcocoacursor.mm
@@ -39,6 +39,7 @@
#include "qcocoacursor.h"
#include "qcocoawindow.h"
+#include "qcocoascreen.h"
#include "qcocoahelpers.h"
#include <QtGui/private/qcoregraphics_p.h>
@@ -70,7 +71,7 @@ void QCocoaCursor::changeCursor(QCursor *cursor, QWindow *window)
QPoint QCocoaCursor::pos() const
{
- return qt_mac_flipPoint([NSEvent mouseLocation]).toPoint();
+ return QCocoaScreen::mapFromNative([NSEvent mouseLocation]).toPoint();
}
void QCocoaCursor::setPos(const QPoint &position)
@@ -86,7 +87,7 @@ void QCocoaCursor::setPos(const QPoint &position)
NSCursor *QCocoaCursor::convertCursor(QCursor *cursor)
{
- if (cursor == Q_NULLPTR)
+ if (cursor == nullptr)
return 0;
const Qt::CursorShape newShape = cursor->shape();
diff --git a/src/plugins/platforms/cocoa/qcocoadrag.h b/src/plugins/platforms/cocoa/qcocoadrag.h
index c7277a47bf..dc0cc17dfb 100644
--- a/src/plugins/platforms/cocoa/qcocoadrag.h
+++ b/src/plugins/platforms/cocoa/qcocoadrag.h
@@ -56,10 +56,10 @@ public:
~QCocoaDrag();
QMimeData *dragMimeData();
- Qt::DropAction drag(QDrag *m_drag) Q_DECL_OVERRIDE;
+ Qt::DropAction drag(QDrag *m_drag) override;
Qt::DropAction defaultAction(Qt::DropActions possibleActions,
- Qt::KeyboardModifiers modifiers) const Q_DECL_OVERRIDE;
+ Qt::KeyboardModifiers modifiers) const override;
/**
* to meet NSView dragImage:at guarantees, we need to record the original
diff --git a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.h b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.h
index f5ba1dc22e..2ddda14289 100644
--- a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.h
+++ b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.h
@@ -59,19 +59,19 @@ public:
QCocoaFileDialogHelper();
virtual ~QCocoaFileDialogHelper();
- void exec() Q_DECL_OVERRIDE;
+ void exec() override;
- bool defaultNameFilterDisables() const Q_DECL_OVERRIDE;
+ bool defaultNameFilterDisables() const override;
- bool show(Qt::WindowFlags windowFlags, Qt::WindowModality windowModality, QWindow *parent) Q_DECL_OVERRIDE;
- void hide() Q_DECL_OVERRIDE;
- void setDirectory(const QUrl &directory) Q_DECL_OVERRIDE;
- QUrl directory() const Q_DECL_OVERRIDE;
- void selectFile(const QUrl &filename) Q_DECL_OVERRIDE;
- QList<QUrl> selectedFiles() const Q_DECL_OVERRIDE;
- void setFilter() Q_DECL_OVERRIDE;
- void selectNameFilter(const QString &filter) Q_DECL_OVERRIDE;
- QString selectedNameFilter() const Q_DECL_OVERRIDE;
+ bool show(Qt::WindowFlags windowFlags, Qt::WindowModality windowModality, QWindow *parent) override;
+ void hide() override;
+ void setDirectory(const QUrl &directory) override;
+ QUrl directory() const override;
+ void selectFile(const QUrl &filename) override;
+ QList<QUrl> selectedFiles() const override;
+ void setFilter() override;
+ void selectNameFilter(const QString &filter) override;
+ QString selectedNameFilter() const override;
public:
bool showCocoaFilePanel(Qt::WindowModality windowModality, QWindow *parent);
diff --git a/src/plugins/platforms/cocoa/qcocoafontdialoghelper.h b/src/plugins/platforms/cocoa/qcocoafontdialoghelper.h
index c3fad7cfd6..14f12f2d76 100644
--- a/src/plugins/platforms/cocoa/qcocoafontdialoghelper.h
+++ b/src/plugins/platforms/cocoa/qcocoafontdialoghelper.h
@@ -54,13 +54,13 @@ public:
QCocoaFontDialogHelper();
~QCocoaFontDialogHelper();
- void exec() Q_DECL_OVERRIDE;
+ void exec() override;
- bool show(Qt::WindowFlags windowFlags, Qt::WindowModality windowModality, QWindow *parent) Q_DECL_OVERRIDE;
- void hide() Q_DECL_OVERRIDE;
+ bool show(Qt::WindowFlags windowFlags, Qt::WindowModality windowModality, QWindow *parent) override;
+ void hide() override;
- void setCurrentFont(const QFont &) Q_DECL_OVERRIDE;
- QFont currentFont() const Q_DECL_OVERRIDE;
+ void setCurrentFont(const QFont &) override;
+ QFont currentFont() const override;
};
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/cocoa/qcocoaglcontext.h b/src/plugins/platforms/cocoa/qcocoaglcontext.h
index 1a66cec0e3..129307acf4 100644
--- a/src/plugins/platforms/cocoa/qcocoaglcontext.h
+++ b/src/plugins/platforms/cocoa/qcocoaglcontext.h
@@ -55,22 +55,22 @@ public:
QCocoaGLContext(const QSurfaceFormat &format, QPlatformOpenGLContext *share, const QVariant &nativeHandle);
~QCocoaGLContext();
- QSurfaceFormat format() const Q_DECL_OVERRIDE;
+ QSurfaceFormat format() const override;
- void swapBuffers(QPlatformSurface *surface) Q_DECL_OVERRIDE;
+ void swapBuffers(QPlatformSurface *surface) override;
- bool makeCurrent(QPlatformSurface *surface) Q_DECL_OVERRIDE;
- void doneCurrent() Q_DECL_OVERRIDE;
+ bool makeCurrent(QPlatformSurface *surface) override;
+ void doneCurrent() override;
- QFunctionPointer getProcAddress(const char *procName) Q_DECL_OVERRIDE;
+ QFunctionPointer getProcAddress(const char *procName) override;
void update();
static NSOpenGLPixelFormat *createNSOpenGLPixelFormat(const QSurfaceFormat &format);
NSOpenGLContext *nsOpenGLContext() const;
- bool isSharing() const Q_DECL_OVERRIDE;
- bool isValid() const Q_DECL_OVERRIDE;
+ bool isSharing() const override;
+ bool isValid() const override;
void windowWasHidden();
diff --git a/src/plugins/platforms/cocoa/qcocoahelpers.h b/src/plugins/platforms/cocoa/qcocoahelpers.h
index 7810733255..6c75db9bdb 100644
--- a/src/plugins/platforms/cocoa/qcocoahelpers.h
+++ b/src/plugins/platforms/cocoa/qcocoahelpers.h
@@ -85,13 +85,8 @@ QT_MANGLE_NAMESPACE(QNSView) *qnsview_cast(NSView *view);
void qt_mac_transformProccessToForegroundApplication();
QString qt_mac_applicationName();
-int qt_mac_flipYCoordinate(int y);
-qreal qt_mac_flipYCoordinate(qreal y);
-QPointF qt_mac_flipPoint(const NSPoint &p);
-NSPoint qt_mac_flipPoint(const QPoint &p);
-NSPoint qt_mac_flipPoint(const QPointF &p);
-
-NSRect qt_mac_flipRect(const QRect &rect);
+QPointF qt_mac_flip(const QPointF &pos, const QRectF &reference);
+QRectF qt_mac_flip(const QRectF &rect, const QRectF &reference);
Qt::MouseButton cocoaButton2QtButton(NSInteger buttonNum);
@@ -193,6 +188,19 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSPanelContentsWrapper);
// -------------------------------------------------------------------------
+// QAppleRefCounted expects the retain function to return the object
+io_object_t q_IOObjectRetain(io_object_t obj);
+// QAppleRefCounted expects the release function to return void
+void q_IOObjectRelease(io_object_t obj);
+
+template <typename T>
+class QIOType : public QAppleRefCounted<T, io_object_t, q_IOObjectRetain, q_IOObjectRelease>
+{
+ using QAppleRefCounted<T, io_object_t, q_IOObjectRetain, q_IOObjectRelease>::QAppleRefCounted;
+};
+
+// -------------------------------------------------------------------------
+
// Depending on the ABI of the platform, we may need to use objc_msgSendSuper_stret:
// - http://www.sealiesoftware.com/blog/archive/2008/10/30/objc_explain_objc_msgSend_stret.html
// - https://lists.apple.com/archives/cocoa-dev/2008/Feb/msg02338.html
diff --git a/src/plugins/platforms/cocoa/qcocoahelpers.mm b/src/plugins/platforms/cocoa/qcocoahelpers.mm
index 9f9618177d..85d12040de 100644
--- a/src/plugins/platforms/cocoa/qcocoahelpers.mm
+++ b/src/plugins/platforms/cocoa/qcocoahelpers.mm
@@ -232,50 +232,37 @@ QString qt_mac_applicationName()
return appName;
}
-int qt_mac_primaryScreenHeight()
-{
- QMacAutoReleasePool pool;
- NSArray *screens = [NSScreen screens];
- if ([screens count] > 0) {
- // The first screen in the screens array is documented to
- // have the (0,0) origin and is designated the primary screen.
- NSRect screenFrame = [[screens objectAtIndex: 0] frame];
- return screenFrame.size.height;
- }
- return 0;
-}
+// -------------------------------------------------------------------------
-int qt_mac_flipYCoordinate(int y)
-{
- return qt_mac_primaryScreenHeight() - y;
-}
+/*!
+ \fn QPointF qt_mac_flip(const QPointF &pos, const QRectF &reference)
+ \fn QRectF qt_mac_flip(const QRectF &rect, const QRectF &reference)
-qreal qt_mac_flipYCoordinate(qreal y)
-{
- return qt_mac_primaryScreenHeight() - y;
-}
+ Flips the Y coordinate of the point/rect between quadrant I and IV.
-QPointF qt_mac_flipPoint(const NSPoint &p)
-{
- return QPointF(p.x, qt_mac_flipYCoordinate(p.y));
-}
+ The native coordinate system on macOS uses quadrant I, with origin
+ in bottom left, and Qt uses quadrant IV, with origin in top left.
-NSPoint qt_mac_flipPoint(const QPoint &p)
-{
- return NSMakePoint(p.x(), qt_mac_flipYCoordinate(p.y()));
-}
+ By flipping the Y coordinate, we can map the point/rect between
+ the two coordinate systems.
-NSPoint qt_mac_flipPoint(const QPointF &p)
+ The flip is always in relation to a reference rectangle, e.g.
+ the frame of the parent view, or the screen geometry. In the
+ latter case the specialized QCocoaScreen::mapFrom/To functions
+ should be used instead.
+*/
+QPointF qt_mac_flip(const QPointF &pos, const QRectF &reference)
{
- return NSMakePoint(p.x(), qt_mac_flipYCoordinate(p.y()));
+ return QPointF(pos.x(), reference.height() - pos.y());
}
-NSRect qt_mac_flipRect(const QRect &rect)
+QRectF qt_mac_flip(const QRectF &rect, const QRectF &reference)
{
- int flippedY = qt_mac_flipYCoordinate(rect.y() + rect.height());
- return NSMakeRect(rect.x(), flippedY, rect.width(), rect.height());
+ return QRectF(qt_mac_flip(rect.bottomLeft(), reference), rect.size());
}
+// -------------------------------------------------------------------------
+
Qt::MouseButton cocoaButton2QtButton(NSInteger buttonNum)
{
if (buttonNum >= 0 && buttonNum <= 31)
@@ -408,4 +395,19 @@ QT_END_NAMESPACE
[super layout];
}
+// -------------------------------------------------------------------------
+
+io_object_t q_IOObjectRetain(io_object_t obj)
+{
+ kern_return_t ret = IOObjectRetain(obj);
+ Q_ASSERT(!ret);
+ return obj;
+}
+
+void q_IOObjectRelease(io_object_t obj)
+{
+ kern_return_t ret = IOObjectRelease(obj);
+ Q_ASSERT(!ret);
+}
+
@end
diff --git a/src/plugins/platforms/cocoa/qcocoainputcontext.h b/src/plugins/platforms/cocoa/qcocoainputcontext.h
index a248ca0d8d..7190ba0de8 100644
--- a/src/plugins/platforms/cocoa/qcocoainputcontext.h
+++ b/src/plugins/platforms/cocoa/qcocoainputcontext.h
@@ -53,11 +53,11 @@ public:
explicit QCocoaInputContext();
~QCocoaInputContext();
- bool isValid() const Q_DECL_OVERRIDE { return true; }
+ bool isValid() const override { return true; }
- void reset() Q_DECL_OVERRIDE;
+ void reset() override;
- QLocale locale() const Q_DECL_OVERRIDE { return m_locale; }
+ QLocale locale() const override { return m_locale; }
void updateLocale();
private Q_SLOTS:
diff --git a/src/plugins/platforms/cocoa/qcocoaintegration.h b/src/plugins/platforms/cocoa/qcocoaintegration.h
index 2fc5156d24..301771fd53 100644
--- a/src/plugins/platforms/cocoa/qcocoaintegration.h
+++ b/src/plugins/platforms/cocoa/qcocoaintegration.h
@@ -75,35 +75,35 @@ public:
static QCocoaIntegration *instance();
Options options() const;
- bool hasCapability(QPlatformIntegration::Capability cap) const Q_DECL_OVERRIDE;
- QPlatformWindow *createPlatformWindow(QWindow *window) const Q_DECL_OVERRIDE;
- QPlatformWindow *createForeignWindow(QWindow *window, WId nativeHandle) const Q_DECL_OVERRIDE;
+ bool hasCapability(QPlatformIntegration::Capability cap) const override;
+ QPlatformWindow *createPlatformWindow(QWindow *window) const override;
+ QPlatformWindow *createForeignWindow(QWindow *window, WId nativeHandle) const override;
QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override;
#ifndef QT_NO_OPENGL
- QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const Q_DECL_OVERRIDE;
+ QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override;
#endif
- QPlatformBackingStore *createPlatformBackingStore(QWindow *widget) const Q_DECL_OVERRIDE;
+ QPlatformBackingStore *createPlatformBackingStore(QWindow *widget) const override;
- QAbstractEventDispatcher *createEventDispatcher() const Q_DECL_OVERRIDE;
+ QAbstractEventDispatcher *createEventDispatcher() const override;
- QCoreTextFontDatabase *fontDatabase() const Q_DECL_OVERRIDE;
- QCocoaNativeInterface *nativeInterface() const Q_DECL_OVERRIDE;
- QPlatformInputContext *inputContext() const Q_DECL_OVERRIDE;
+ QCoreTextFontDatabase *fontDatabase() const override;
+ QCocoaNativeInterface *nativeInterface() const override;
+ QPlatformInputContext *inputContext() const override;
#ifndef QT_NO_ACCESSIBILITY
- QCocoaAccessibility *accessibility() const Q_DECL_OVERRIDE;
+ QCocoaAccessibility *accessibility() const override;
#endif
#ifndef QT_NO_CLIPBOARD
- QCocoaClipboard *clipboard() const Q_DECL_OVERRIDE;
+ QCocoaClipboard *clipboard() const override;
#endif
- QCocoaDrag *drag() const Q_DECL_OVERRIDE;
+ QCocoaDrag *drag() const override;
- QStringList themeNames() const Q_DECL_OVERRIDE;
- QPlatformTheme *createPlatformTheme(const QString &name) const Q_DECL_OVERRIDE;
- QCocoaServices *services() const Q_DECL_OVERRIDE;
- QVariant styleHint(StyleHint hint) const Q_DECL_OVERRIDE;
+ QStringList themeNames() const override;
+ QPlatformTheme *createPlatformTheme(const QString &name) const override;
+ QCocoaServices *services() const override;
+ QVariant styleHint(StyleHint hint) const override;
- Qt::KeyboardModifiers queryKeyboardModifiers() const Q_DECL_OVERRIDE;
- QList<int> possibleKeys(const QKeyEvent *event) const Q_DECL_OVERRIDE;
+ Qt::KeyboardModifiers queryKeyboardModifiers() const override;
+ QList<int> possibleKeys(const QKeyEvent *event) const override;
void updateScreens();
QCocoaScreen *screenForNSScreen(NSScreen *nsScreen);
@@ -117,9 +117,9 @@ public:
QCocoaWindow *activePopupWindow() const;
QList<QCocoaWindow *> *popupWindowStack();
- void setApplicationIcon(const QIcon &icon) const Q_DECL_OVERRIDE;
+ void setApplicationIcon(const QIcon &icon) const override;
- void beep() const Q_DECL_OVERRIDE;
+ void beep() const override;
private Q_SLOTS:
void focusWindowChanged(QWindow *);
diff --git a/src/plugins/platforms/cocoa/qcocoamenu.h b/src/plugins/platforms/cocoa/qcocoamenu.h
index 5081fc78c6..f5fa93cbb5 100644
--- a/src/plugins/platforms/cocoa/qcocoamenu.h
+++ b/src/plugins/platforms/cocoa/qcocoamenu.h
@@ -55,32 +55,32 @@ public:
QCocoaMenu();
~QCocoaMenu();
- void insertMenuItem(QPlatformMenuItem *menuItem, QPlatformMenuItem *before) Q_DECL_OVERRIDE;
- void removeMenuItem(QPlatformMenuItem *menuItem) Q_DECL_OVERRIDE;
- void syncMenuItem(QPlatformMenuItem *menuItem) Q_DECL_OVERRIDE;
- void setEnabled(bool enabled) Q_DECL_OVERRIDE;
- bool isEnabled() const Q_DECL_OVERRIDE;
- void setVisible(bool visible) Q_DECL_OVERRIDE;
- void showPopup(const QWindow *parentWindow, const QRect &targetRect, const QPlatformMenuItem *item) Q_DECL_OVERRIDE;
- void dismiss() Q_DECL_OVERRIDE;
+ void insertMenuItem(QPlatformMenuItem *menuItem, QPlatformMenuItem *before) override;
+ void removeMenuItem(QPlatformMenuItem *menuItem) override;
+ void syncMenuItem(QPlatformMenuItem *menuItem) override;
+ void setEnabled(bool enabled) override;
+ bool isEnabled() const override;
+ void setVisible(bool visible) override;
+ void showPopup(const QWindow *parentWindow, const QRect &targetRect, const QPlatformMenuItem *item) override;
+ void dismiss() override;
- void syncSeparatorsCollapsible(bool enable) Q_DECL_OVERRIDE;
+ void syncSeparatorsCollapsible(bool enable) override;
void propagateEnabledState(bool enabled);
- void setIcon(const QIcon &icon) Q_DECL_OVERRIDE { Q_UNUSED(icon) }
+ void setIcon(const QIcon &icon) override { Q_UNUSED(icon) }
- void setText(const QString &text) Q_DECL_OVERRIDE;
- void setMinimumWidth(int width) Q_DECL_OVERRIDE;
- void setFont(const QFont &font) Q_DECL_OVERRIDE;
+ void setText(const QString &text) override;
+ void setMinimumWidth(int width) override;
+ void setFont(const QFont &font) override;
inline NSMenu *nsMenu() const
{ return m_nativeMenu; }
inline bool isVisible() const { return m_visible; }
- QPlatformMenuItem *menuItemAt(int position) const Q_DECL_OVERRIDE;
- QPlatformMenuItem *menuItemForTag(quintptr tag) const Q_DECL_OVERRIDE;
+ QPlatformMenuItem *menuItemAt(int position) const override;
+ QPlatformMenuItem *menuItemForTag(quintptr tag) const override;
QList<QCocoaMenuItem *> items() const;
QList<QCocoaMenuItem *> merged() const;
@@ -91,7 +91,7 @@ public:
bool isOpen() const;
void setIsOpen(bool isOpen);
- void timerEvent(QTimerEvent *e) Q_DECL_OVERRIDE;
+ void timerEvent(QTimerEvent *e) override;
void syncMenuItem_helper(QPlatformMenuItem *menuItem, bool menubarUpdate);
diff --git a/src/plugins/platforms/cocoa/qcocoamenubar.h b/src/plugins/platforms/cocoa/qcocoamenubar.h
index a4ee531e91..32a8fd89b4 100644
--- a/src/plugins/platforms/cocoa/qcocoamenubar.h
+++ b/src/plugins/platforms/cocoa/qcocoamenubar.h
@@ -56,11 +56,11 @@ public:
QCocoaMenuBar();
~QCocoaMenuBar();
- void insertMenu(QPlatformMenu *menu, QPlatformMenu* before) Q_DECL_OVERRIDE;
- void removeMenu(QPlatformMenu *menu) Q_DECL_OVERRIDE;
- void syncMenu(QPlatformMenu *menuItem) Q_DECL_OVERRIDE;
- void handleReparent(QWindow *newParentWindow) Q_DECL_OVERRIDE;
- QPlatformMenu *menuForTag(quintptr tag) const Q_DECL_OVERRIDE;
+ void insertMenu(QPlatformMenu *menu, QPlatformMenu* before) override;
+ void removeMenu(QPlatformMenu *menu) override;
+ void syncMenu(QPlatformMenu *menuItem) override;
+ void handleReparent(QWindow *newParentWindow) override;
+ QPlatformMenu *menuForTag(quintptr tag) const override;
inline NSMenu *nsMenu() const
{ return m_nativeMenu; }
diff --git a/src/plugins/platforms/cocoa/qcocoamenubar.mm b/src/plugins/platforms/cocoa/qcocoamenubar.mm
index a4cd465dae..fd28a4d7da 100644
--- a/src/plugins/platforms/cocoa/qcocoamenubar.mm
+++ b/src/plugins/platforms/cocoa/qcocoamenubar.mm
@@ -449,7 +449,7 @@ NSMenuItem *QCocoaMenuBar::itemForRole(QPlatformMenuItem::MenuRole r)
foreach (QCocoaMenuItem *i, m->items())
if (i->effectiveRole() == r)
return i->nsItem();
- return Q_NULLPTR;
+ return nullptr;
}
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/cocoa/qcocoamenuitem.h b/src/plugins/platforms/cocoa/qcocoamenuitem.h
index 53862d0484..2b598ee3a0 100644
--- a/src/plugins/platforms/cocoa/qcocoamenuitem.h
+++ b/src/plugins/platforms/cocoa/qcocoamenuitem.h
@@ -78,22 +78,22 @@ public:
QCocoaMenuItem();
~QCocoaMenuItem();
- void setText(const QString &text) Q_DECL_OVERRIDE;
- void setIcon(const QIcon &icon) Q_DECL_OVERRIDE;
- void setMenu(QPlatformMenu *menu) Q_DECL_OVERRIDE;
- void setVisible(bool isVisible) Q_DECL_OVERRIDE;
- void setIsSeparator(bool isSeparator) Q_DECL_OVERRIDE;
- void setFont(const QFont &font) Q_DECL_OVERRIDE;
- void setRole(MenuRole role) Q_DECL_OVERRIDE;
+ void setText(const QString &text) override;
+ void setIcon(const QIcon &icon) override;
+ void setMenu(QPlatformMenu *menu) override;
+ void setVisible(bool isVisible) override;
+ void setIsSeparator(bool isSeparator) override;
+ void setFont(const QFont &font) override;
+ void setRole(MenuRole role) override;
#ifndef QT_NO_SHORTCUT
- void setShortcut(const QKeySequence& shortcut) Q_DECL_OVERRIDE;
+ void setShortcut(const QKeySequence& shortcut) override;
#endif
- void setCheckable(bool checkable) Q_DECL_OVERRIDE { Q_UNUSED(checkable) }
- void setChecked(bool isChecked) Q_DECL_OVERRIDE;
- void setEnabled(bool isEnabled) Q_DECL_OVERRIDE;
- void setIconSize(int size) Q_DECL_OVERRIDE;
+ void setCheckable(bool checkable) override { Q_UNUSED(checkable) }
+ void setChecked(bool isChecked) override;
+ void setEnabled(bool isEnabled) override;
+ void setIconSize(int size) override;
- void setNativeContents(WId item) Q_DECL_OVERRIDE;
+ void setNativeContents(WId item) override;
inline QString text() const { return m_text; }
inline NSMenuItem * nsItem() { return m_native; }
diff --git a/src/plugins/platforms/cocoa/qcocoanativeinterface.h b/src/plugins/platforms/cocoa/qcocoanativeinterface.h
index 26fbe3e4bc..c78f1d5a7f 100644
--- a/src/plugins/platforms/cocoa/qcocoanativeinterface.h
+++ b/src/plugins/platforms/cocoa/qcocoanativeinterface.h
@@ -60,18 +60,18 @@ public:
QCocoaNativeInterface();
#ifndef QT_NO_OPENGL
- void *nativeResourceForContext(const QByteArray &resourceString, QOpenGLContext *context) Q_DECL_OVERRIDE;
+ void *nativeResourceForContext(const QByteArray &resourceString, QOpenGLContext *context) override;
#endif
- void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) Q_DECL_OVERRIDE;
+ void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) override;
- NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) Q_DECL_OVERRIDE;
+ NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) override;
#ifndef QT_NO_OPENGL
static void *cglContextForContext(QOpenGLContext *context);
static void *nsOpenGLContextForContext(QOpenGLContext* context);
#endif
- QFunctionPointer platformFunction(const QByteArray &function) const Q_DECL_OVERRIDE;
+ QFunctionPointer platformFunction(const QByteArray &function) const override;
public Q_SLOTS:
void onAppFocusWindowChanged(QWindow *window);
diff --git a/src/plugins/platforms/cocoa/qcocoanativeinterface.mm b/src/plugins/platforms/cocoa/qcocoanativeinterface.mm
index 8943cb6cd5..1422aebd65 100644
--- a/src/plugins/platforms/cocoa/qcocoanativeinterface.mm
+++ b/src/plugins/platforms/cocoa/qcocoanativeinterface.mm
@@ -233,7 +233,7 @@ QFunctionPointer QCocoaNativeInterface::platformFunction(const QByteArray &funct
if (function == QCocoaWindowFunctions::bottomLeftClippedByNSWindowOffsetIdentifier())
return QFunctionPointer(QCocoaWindowFunctions::BottomLeftClippedByNSWindowOffset(QCocoaWindow::bottomLeftClippedByNSWindowOffsetStatic));
- return Q_NULLPTR;
+ return nullptr;
}
void QCocoaNativeInterface::addToMimeList(void *macPasteboardMime)
diff --git a/src/plugins/platforms/cocoa/qcocoaprintdevice.h b/src/plugins/platforms/cocoa/qcocoaprintdevice.h
index c726cca4e5..20b27f3286 100644
--- a/src/plugins/platforms/cocoa/qcocoaprintdevice.h
+++ b/src/plugins/platforms/cocoa/qcocoaprintdevice.h
@@ -68,37 +68,37 @@ public:
explicit QCocoaPrintDevice(const QString &id);
virtual ~QCocoaPrintDevice();
- bool isValid() const Q_DECL_OVERRIDE;
- bool isDefault() const Q_DECL_OVERRIDE;
+ bool isValid() const override;
+ bool isDefault() const override;
- QPrint::DeviceState state() const Q_DECL_OVERRIDE;
+ QPrint::DeviceState state() const override;
- QPageSize defaultPageSize() const Q_DECL_OVERRIDE;
+ QPageSize defaultPageSize() const override;
QMarginsF printableMargins(const QPageSize &pageSize, QPageLayout::Orientation orientation,
- int resolution) const Q_DECL_OVERRIDE;
+ int resolution) const override;
- int defaultResolution() const Q_DECL_OVERRIDE;
+ int defaultResolution() const override;
- QPrint::InputSlot defaultInputSlot() const Q_DECL_OVERRIDE;
+ QPrint::InputSlot defaultInputSlot() const override;
- QPrint::OutputBin defaultOutputBin() const Q_DECL_OVERRIDE;
+ QPrint::OutputBin defaultOutputBin() const override;
- QPrint::DuplexMode defaultDuplexMode() const Q_DECL_OVERRIDE;
+ QPrint::DuplexMode defaultDuplexMode() const override;
- QPrint::ColorMode defaultColorMode() const Q_DECL_OVERRIDE;
+ QPrint::ColorMode defaultColorMode() const override;
PMPrinter macPrinter() const;
PMPaper macPaper(const QPageSize &pageSize) const;
protected:
- void loadPageSizes() const Q_DECL_OVERRIDE;
- void loadResolutions() const Q_DECL_OVERRIDE;
- void loadInputSlots() const Q_DECL_OVERRIDE;
- void loadOutputBins() const Q_DECL_OVERRIDE;
- void loadDuplexModes() const Q_DECL_OVERRIDE;
- void loadColorModes() const Q_DECL_OVERRIDE;
- void loadMimeTypes() const Q_DECL_OVERRIDE;
+ void loadPageSizes() const override;
+ void loadResolutions() const override;
+ void loadInputSlots() const override;
+ void loadOutputBins() const override;
+ void loadDuplexModes() const override;
+ void loadColorModes() const override;
+ void loadMimeTypes() const override;
private:
QPageSize createPageSize(const PMPaper &paper) const;
diff --git a/src/plugins/platforms/cocoa/qcocoaprintdevice.mm b/src/plugins/platforms/cocoa/qcocoaprintdevice.mm
index 39fcf285ed..bfe6cd09b6 100644
--- a/src/plugins/platforms/cocoa/qcocoaprintdevice.mm
+++ b/src/plugins/platforms/cocoa/qcocoaprintdevice.mm
@@ -46,6 +46,15 @@ QT_BEGIN_NAMESPACE
#ifndef QT_NO_PRINTER
+// The CUPS PPD APIs were deprecated in CUPS 1.6/macOS 10.8, but
+// as long as we're supporting RHEL 6, which still ships CUPS 1.4
+// we're not going to rewrite this, as we want to share the code
+// between macOS and Linux for the CUPS-bits. See discussion in
+// https://bugreports.qt.io/browse/QTBUG-56545
+#pragma message "Disabling CUPS PPD deprecation warnings. This should be fixed once we drop support for RHEL6 (QTBUG-56545)"
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+
static QPrint::DuplexMode macToDuplexMode(const PMDuplexMode &mode)
{
if (mode == kPMDuplexTumble)
@@ -474,6 +483,8 @@ PMPaper QCocoaPrintDevice::macPaper(const QPageSize &pageSize) const
return paper;
}
+#pragma clang diagnostic pop
+
#endif // QT_NO_PRINTER
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/cocoa/qcocoaprintersupport.h b/src/plugins/platforms/cocoa/qcocoaprintersupport.h
index a07bf0ec1b..40a638207a 100644
--- a/src/plugins/platforms/cocoa/qcocoaprintersupport.h
+++ b/src/plugins/platforms/cocoa/qcocoaprintersupport.h
@@ -53,12 +53,12 @@ public:
QCocoaPrinterSupport();
~QCocoaPrinterSupport();
- QPrintEngine *createNativePrintEngine(QPrinter::PrinterMode printerMode, const QString &deviceId = QString()) Q_DECL_OVERRIDE;
- QPaintEngine *createPaintEngine(QPrintEngine *, QPrinter::PrinterMode printerMode) Q_DECL_OVERRIDE;
+ QPrintEngine *createNativePrintEngine(QPrinter::PrinterMode printerMode, const QString &deviceId = QString()) override;
+ QPaintEngine *createPaintEngine(QPrintEngine *, QPrinter::PrinterMode printerMode) override;
- QPrintDevice createPrintDevice(const QString &id) Q_DECL_OVERRIDE;
- QStringList availablePrintDeviceIds() const Q_DECL_OVERRIDE;
- QString defaultPrintDeviceId() const Q_DECL_OVERRIDE;
+ QPrintDevice createPrintDevice(const QString &id) override;
+ QStringList availablePrintDeviceIds() const override;
+ QString defaultPrintDeviceId() const override;
};
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/cocoa/qcocoascreen.h b/src/plugins/platforms/cocoa/qcocoascreen.h
index 937002f493..3d59c3de79 100644
--- a/src/plugins/platforms/cocoa/qcocoascreen.h
+++ b/src/plugins/platforms/cocoa/qcocoascreen.h
@@ -56,20 +56,20 @@ public:
// ----------------------------------------------------
// Virtual methods overridden from QPlatformScreen
- QPixmap grabWindow(WId window, int x, int y, int width, int height) const Q_DECL_OVERRIDE;
- QRect geometry() const Q_DECL_OVERRIDE { return m_geometry; }
- QRect availableGeometry() const Q_DECL_OVERRIDE { return m_availableGeometry; }
- int depth() const Q_DECL_OVERRIDE { return m_depth; }
- QImage::Format format() const Q_DECL_OVERRIDE { return m_format; }
- qreal devicePixelRatio() const Q_DECL_OVERRIDE;
- QSizeF physicalSize() const Q_DECL_OVERRIDE { return m_physicalSize; }
- QDpi logicalDpi() const Q_DECL_OVERRIDE { return m_logicalDpi; }
- qreal refreshRate() const Q_DECL_OVERRIDE { return m_refreshRate; }
- QString name() const Q_DECL_OVERRIDE { return m_name; }
- QPlatformCursor *cursor() const Q_DECL_OVERRIDE { return m_cursor; }
- QWindow *topLevelAt(const QPoint &point) const Q_DECL_OVERRIDE;
- QList<QPlatformScreen *> virtualSiblings() const Q_DECL_OVERRIDE { return m_siblings; }
- QPlatformScreen::SubpixelAntialiasingType subpixelAntialiasingTypeHint() const Q_DECL_OVERRIDE;
+ QPixmap grabWindow(WId window, int x, int y, int width, int height) const override;
+ QRect geometry() const override { return m_geometry; }
+ QRect availableGeometry() const override { return m_availableGeometry; }
+ int depth() const override { return m_depth; }
+ QImage::Format format() const override { return m_format; }
+ qreal devicePixelRatio() const override;
+ QSizeF physicalSize() const override { return m_physicalSize; }
+ QDpi logicalDpi() const override { return m_logicalDpi; }
+ qreal refreshRate() const override { return m_refreshRate; }
+ QString name() const override { return m_name; }
+ QPlatformCursor *cursor() const override { return m_cursor; }
+ QWindow *topLevelAt(const QPoint &point) const override;
+ QList<QPlatformScreen *> virtualSiblings() const override { return m_siblings; }
+ QPlatformScreen::SubpixelAntialiasingType subpixelAntialiasingTypeHint() const override;
// ----------------------------------------------------
// Additional methods
@@ -77,16 +77,12 @@ public:
NSScreen *nativeScreen() const;
void updateGeometry();
- QPointF mapToNative(const QPointF &pos) const { return flipCoordinate(pos); }
- QRectF mapToNative(const QRectF &rect) const { return flipCoordinate(rect); }
- QPointF mapFromNative(const QPointF &pos) const { return flipCoordinate(pos); }
- QRectF mapFromNative(const QRectF &rect) const { return flipCoordinate(rect); }
-
static QCocoaScreen *primaryScreen();
-private:
- QPointF flipCoordinate(const QPointF &pos) const;
- QRectF flipCoordinate(const QRectF &rect) const;
+ static CGPoint mapToNative(const QPointF &pos, QCocoaScreen *screen = QCocoaScreen::primaryScreen());
+ static CGRect mapToNative(const QRectF &rect, QCocoaScreen *screen = QCocoaScreen::primaryScreen());
+ static QPointF mapFromNative(CGPoint pos, QCocoaScreen *screen = QCocoaScreen::primaryScreen());
+ static QRectF mapFromNative(CGRect rect, QCocoaScreen *screen = QCocoaScreen::primaryScreen());
public:
int m_screenIndex;
diff --git a/src/plugins/platforms/cocoa/qcocoascreen.mm b/src/plugins/platforms/cocoa/qcocoascreen.mm
index f523873bde..ed1b19cd53 100644
--- a/src/plugins/platforms/cocoa/qcocoascreen.mm
+++ b/src/plugins/platforms/cocoa/qcocoascreen.mm
@@ -75,32 +75,36 @@ NSScreen *QCocoaScreen::nativeScreen() const
return [screens objectAtIndex:m_screenIndex];
}
-/*!
- Flips the Y coordinate of the point between quadrant I and IV.
+static QString displayName(CGDirectDisplayID displayID)
+{
+ QIOType<io_iterator_t> iterator;
+ if (IOServiceGetMatchingServices(kIOMasterPortDefault,
+ IOServiceMatching("IODisplayConnect"), &iterator))
+ return QString();
+
+ QIOType<io_service_t> display;
+ while ((display = IOIteratorNext(iterator)) != 0)
+ {
+ NSDictionary *info = [(__bridge NSDictionary*)IODisplayCreateInfoDictionary(
+ display, kIODisplayOnlyPreferredName) autorelease];
+
+ if ([[info objectForKey:@kDisplayVendorID] longValue] != CGDisplayVendorNumber(displayID))
+ continue;
- The native coordinate system on macOS uses quadrant I, with origin
- in bottom left, and Qt uses quadrant IV, with origin in top left.
+ if ([[info objectForKey:@kDisplayProductID] longValue] != CGDisplayModelNumber(displayID))
+ continue;
- By flippig the Y coordinate, we can map the position between the
- two coordinate systems.
-*/
-QPointF QCocoaScreen::flipCoordinate(const QPointF &pos) const
-{
- return QPointF(pos.x(), m_geometry.height() - pos.y());
-}
+ if ([[info objectForKey:@kDisplaySerialNumber] longValue] != CGDisplaySerialNumber(displayID))
+ continue;
-/*!
- Flips the Y coordinate of the rectangle between quadrant I and IV.
+ NSDictionary *localizedNames = [info objectForKey:@kDisplayProductName];
+ if (![localizedNames count])
+ break; // Correct screen, but no name in dictionary
- The native coordinate system on macOS uses quadrant I, with origin
- in bottom left, and Qt uses quadrant IV, with origin in top left.
+ return QString::fromNSString([localizedNames objectForKey:[[localizedNames allKeys] objectAtIndex:0]]);
+ }
- By flippig the Y coordinate, we can map the rectangle between the
- two coordinate systems.
-*/
-QRectF QCocoaScreen::flipCoordinate(const QRectF &rect) const
-{
- return QRectF(flipCoordinate(rect.topLeft() + QPoint(0, rect.height())), rect.size());
+ return QString();
}
void QCocoaScreen::updateGeometry()
@@ -109,20 +113,10 @@ void QCocoaScreen::updateGeometry()
if (!nsScreen)
return;
- // At this point the geometry is in native coordinates, but the size
- // is correct, which we take advantage of next when we map the native
- // coordinates to the Qt coordinate system.
- m_geometry = QRectF::fromCGRect(NSRectToCGRect(nsScreen.frame)).toRect();
- m_availableGeometry = QRectF::fromCGRect(NSRectToCGRect(nsScreen.visibleFrame)).toRect();
-
- // The reference screen for the geometry is always the primary screen, but since
- // we may be in the process of creating and registering the primary screen, we
- // must special-case that and assign it direcly.
- QCocoaScreen *primaryScreen = (nsScreen == [[NSScreen screens] firstObject]) ?
- this : QCocoaScreen::primaryScreen();
-
- m_geometry = primaryScreen->mapFromNative(m_geometry).toRect();
- m_availableGeometry = primaryScreen->mapFromNative(m_availableGeometry).toRect();
+ // The reference screen for the geometry is always the primary screen
+ QRectF primaryScreenGeometry = QRectF::fromCGRect([[NSScreen screens] firstObject].frame);
+ m_geometry = qt_mac_flip(QRectF::fromCGRect(nsScreen.frame), primaryScreenGeometry).toRect();
+ m_availableGeometry = qt_mac_flip(QRectF::fromCGRect(nsScreen.visibleFrame), primaryScreenGeometry).toRect();
m_format = QImage::Format_RGB32;
m_depth = NSBitsPerPixelFromDepth([nsScreen depth]);
@@ -139,12 +133,7 @@ void QCocoaScreen::updateGeometry()
if (refresh > 0)
m_refreshRate = refresh;
- // Get m_name (brand/model of the monitor)
- NSDictionary *deviceInfo = (NSDictionary *)IODisplayCreateInfoDictionary(CGDisplayIOServicePort(dpy), kIODisplayOnlyPreferredName);
- NSDictionary *localizedNames = [deviceInfo objectForKey:[NSString stringWithUTF8String:kDisplayProductName]];
- if ([localizedNames count] > 0)
- m_name = QString::fromUtf8([[localizedNames objectForKey:[[localizedNames allKeys] objectAtIndex:0]] UTF8String]);
- [deviceInfo release];
+ m_name = displayName(dpy);
QWindowSystemInterface::handleScreenGeometryChange(screen(), geometry(), availableGeometry());
QWindowSystemInterface::handleScreenLogicalDotsPerInchChange(screen(), m_logicalDpi.first, m_logicalDpi.second);
@@ -170,7 +159,7 @@ QPlatformScreen::SubpixelAntialiasingType QCocoaScreen::subpixelAntialiasingType
QWindow *QCocoaScreen::topLevelAt(const QPoint &point) const
{
- NSPoint screenPoint = qt_mac_flipPoint(point);
+ NSPoint screenPoint = mapToNative(point);
// Search (hit test) for the top-level window. [NSWidow windowNumberAtPoint:
// belowWindowWithWindowNumber] may return windows that are not interesting
@@ -275,6 +264,30 @@ QCocoaScreen *QCocoaScreen::primaryScreen()
return static_cast<QCocoaScreen *>(QGuiApplication::primaryScreen()->handle());
}
+CGPoint QCocoaScreen::mapToNative(const QPointF &pos, QCocoaScreen *screen)
+{
+ Q_ASSERT(screen);
+ return qt_mac_flip(pos, screen->geometry()).toCGPoint();
+}
+
+CGRect QCocoaScreen::mapToNative(const QRectF &rect, QCocoaScreen *screen)
+{
+ Q_ASSERT(screen);
+ return qt_mac_flip(rect, screen->geometry()).toCGRect();
+}
+
+QPointF QCocoaScreen::mapFromNative(CGPoint pos, QCocoaScreen *screen)
+{
+ Q_ASSERT(screen);
+ return qt_mac_flip(QPointF::fromCGPoint(pos), screen->geometry());
+}
+
+QRectF QCocoaScreen::mapFromNative(CGRect rect, QCocoaScreen *screen)
+{
+ Q_ASSERT(screen);
+ return qt_mac_flip(QRectF::fromCGRect(rect), screen->geometry());
+}
+
#ifndef QT_NO_DEBUG_STREAM
QDebug operator<<(QDebug debug, const QCocoaScreen *screen)
{
diff --git a/src/plugins/platforms/cocoa/qcocoaservices.h b/src/plugins/platforms/cocoa/qcocoaservices.h
index c2ceede0f0..62a8891f96 100644
--- a/src/plugins/platforms/cocoa/qcocoaservices.h
+++ b/src/plugins/platforms/cocoa/qcocoaservices.h
@@ -47,8 +47,8 @@ QT_BEGIN_NAMESPACE
class QCocoaServices : public QPlatformServices
{
public:
- bool openUrl(const QUrl &url) Q_DECL_OVERRIDE;
- bool openDocument(const QUrl &url) Q_DECL_OVERRIDE;
+ bool openUrl(const QUrl &url) override;
+ bool openDocument(const QUrl &url) override;
};
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/cocoa/qcocoasystemtrayicon.h b/src/plugins/platforms/cocoa/qcocoasystemtrayicon.h
index d542a3cb8f..2f1a1e42a9 100644
--- a/src/plugins/platforms/cocoa/qcocoasystemtrayicon.h
+++ b/src/plugins/platforms/cocoa/qcocoasystemtrayicon.h
@@ -57,17 +57,17 @@ class Q_GUI_EXPORT QCocoaSystemTrayIcon : public QPlatformSystemTrayIcon
public:
QCocoaSystemTrayIcon() : m_sys(0) {}
- void init() Q_DECL_OVERRIDE;
- void cleanup() Q_DECL_OVERRIDE;
- void updateIcon(const QIcon &icon) Q_DECL_OVERRIDE;
- void updateToolTip(const QString &toolTip) Q_DECL_OVERRIDE;
- void updateMenu(QPlatformMenu *menu) Q_DECL_OVERRIDE;
- QRect geometry() const Q_DECL_OVERRIDE;
+ void init() override;
+ void cleanup() override;
+ void updateIcon(const QIcon &icon) override;
+ void updateToolTip(const QString &toolTip) override;
+ void updateMenu(QPlatformMenu *menu) override;
+ QRect geometry() const override;
void showMessage(const QString &title, const QString &msg,
- const QIcon& icon, MessageIcon iconType, int secs) Q_DECL_OVERRIDE;
+ const QIcon& icon, MessageIcon iconType, int secs) override;
- bool isSystemTrayAvailable() const Q_DECL_OVERRIDE;
- bool supportsMessages() const Q_DECL_OVERRIDE;
+ bool isSystemTrayAvailable() const override;
+ bool supportsMessages() const override;
private:
QSystemTrayIconSys *m_sys;
diff --git a/src/plugins/platforms/cocoa/qcocoatheme.h b/src/plugins/platforms/cocoa/qcocoatheme.h
index 27c071a8cd..69eaf8db56 100644
--- a/src/plugins/platforms/cocoa/qcocoatheme.h
+++ b/src/plugins/platforms/cocoa/qcocoatheme.h
@@ -56,25 +56,25 @@ public:
void reset();
- QPlatformMenuItem* createPlatformMenuItem() const Q_DECL_OVERRIDE;
- QPlatformMenu* createPlatformMenu() const Q_DECL_OVERRIDE;
- QPlatformMenuBar* createPlatformMenuBar() const Q_DECL_OVERRIDE;
+ QPlatformMenuItem* createPlatformMenuItem() const override;
+ QPlatformMenu* createPlatformMenu() const override;
+ QPlatformMenuBar* createPlatformMenuBar() const override;
#ifndef QT_NO_SYSTEMTRAYICON
- QPlatformSystemTrayIcon *createPlatformSystemTrayIcon() const Q_DECL_OVERRIDE;
+ QPlatformSystemTrayIcon *createPlatformSystemTrayIcon() const override;
#endif
- bool usePlatformNativeDialog(DialogType dialogType) const Q_DECL_OVERRIDE;
- QPlatformDialogHelper *createPlatformDialogHelper(DialogType dialogType) const Q_DECL_OVERRIDE;
+ bool usePlatformNativeDialog(DialogType dialogType) const override;
+ QPlatformDialogHelper *createPlatformDialogHelper(DialogType dialogType) const override;
- const QPalette *palette(Palette type = SystemPalette) const Q_DECL_OVERRIDE;
- const QFont *font(Font type = SystemFont) const Q_DECL_OVERRIDE;
- QPixmap standardPixmap(StandardPixmap sp, const QSizeF &size) const Q_DECL_OVERRIDE;
+ const QPalette *palette(Palette type = SystemPalette) const override;
+ const QFont *font(Font type = SystemFont) const override;
+ QPixmap standardPixmap(StandardPixmap sp, const QSizeF &size) const override;
QIcon fileIcon(const QFileInfo &fileInfo, QPlatformTheme::IconOptions options = 0) const override;
- QVariant themeHint(ThemeHint hint) const Q_DECL_OVERRIDE;
- QString standardButtonText(int button) const Q_DECL_OVERRIDE;
- QKeySequence standardButtonShortcut(int button) const Q_DECL_OVERRIDE;
+ QVariant themeHint(ThemeHint hint) const override;
+ QString standardButtonText(int button) const override;
+ QKeySequence standardButtonShortcut(int button) const override;
static const char *name;
diff --git a/src/plugins/platforms/cocoa/qcocoatheme.mm b/src/plugins/platforms/cocoa/qcocoatheme.mm
index 5239864ad8..2aab5fd545 100644
--- a/src/plugins/platforms/cocoa/qcocoatheme.mm
+++ b/src/plugins/platforms/cocoa/qcocoatheme.mm
@@ -98,7 +98,7 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QCocoaThemeNotificationReceiver);
{
Q_UNUSED(notification);
mPrivate->reset();
- QWindowSystemInterface::handleThemeChange(Q_NULLPTR);
+ QWindowSystemInterface::handleThemeChange(nullptr);
}
@end
@@ -127,7 +127,7 @@ QCocoaTheme::~QCocoaTheme()
void QCocoaTheme::reset()
{
delete m_systemPalette;
- m_systemPalette = Q_NULLPTR;
+ m_systemPalette = nullptr;
qDeleteAll(m_palettes);
m_palettes.clear();
}
@@ -275,7 +275,7 @@ QPixmap QCocoaTheme::standardPixmap(StandardPixmap sp, const QSizeF &size) const
}
if (iconType != 0) {
QPixmap pixmap;
- IconRef icon = Q_NULLPTR;
+ IconRef icon = nullptr;
GetIconRef(kOnSystemDisk, kSystemIconsCreator, iconType, &icon);
if (icon) {
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.h b/src/plugins/platforms/cocoa/qcocoawindow.h
index 6fbe29f683..fb91c53a7a 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.h
+++ b/src/plugins/platforms/cocoa/qcocoawindow.h
@@ -97,37 +97,37 @@ public:
void initialize() override;
- void setGeometry(const QRect &rect) Q_DECL_OVERRIDE;
- QRect geometry() const Q_DECL_OVERRIDE;
+ void setGeometry(const QRect &rect) override;
+ QRect geometry() const override;
void setCocoaGeometry(const QRect &rect);
- void setVisible(bool visible) Q_DECL_OVERRIDE;
- void setWindowFlags(Qt::WindowFlags flags) Q_DECL_OVERRIDE;
- void setWindowState(Qt::WindowStates state) Q_DECL_OVERRIDE;
- void setWindowTitle(const QString &title) Q_DECL_OVERRIDE;
- void setWindowFilePath(const QString &filePath) Q_DECL_OVERRIDE;
- void setWindowIcon(const QIcon &icon) Q_DECL_OVERRIDE;
- void setAlertState(bool enabled) Q_DECL_OVERRIDE;
- bool isAlertState() const Q_DECL_OVERRIDE;
- void raise() Q_DECL_OVERRIDE;
- void lower() Q_DECL_OVERRIDE;
- bool isExposed() const Q_DECL_OVERRIDE;
+ void setVisible(bool visible) override;
+ void setWindowFlags(Qt::WindowFlags flags) override;
+ void setWindowState(Qt::WindowStates state) override;
+ void setWindowTitle(const QString &title) override;
+ void setWindowFilePath(const QString &filePath) override;
+ void setWindowIcon(const QIcon &icon) override;
+ void setAlertState(bool enabled) override;
+ bool isAlertState() const override;
+ void raise() override;
+ void lower() override;
+ bool isExposed() const override;
bool isOpaque() const;
- void propagateSizeHints() Q_DECL_OVERRIDE;
- void setOpacity(qreal level) Q_DECL_OVERRIDE;
- void setMask(const QRegion &region) Q_DECL_OVERRIDE;
- bool setKeyboardGrabEnabled(bool grab) Q_DECL_OVERRIDE;
- bool setMouseGrabEnabled(bool grab) Q_DECL_OVERRIDE;
- QMargins frameMargins() const Q_DECL_OVERRIDE;
- QSurfaceFormat format() const Q_DECL_OVERRIDE;
+ void propagateSizeHints() override;
+ void setOpacity(qreal level) override;
+ void setMask(const QRegion &region) override;
+ bool setKeyboardGrabEnabled(bool grab) override;
+ bool setMouseGrabEnabled(bool grab) override;
+ QMargins frameMargins() const override;
+ QSurfaceFormat format() const override;
- bool isForeignWindow() const Q_DECL_OVERRIDE;
+ bool isForeignWindow() const override;
void requestUpdate() override;
- void requestActivateWindow() Q_DECL_OVERRIDE;
+ void requestActivateWindow() override;
- WId winId() const Q_DECL_OVERRIDE;
- void setParent(const QPlatformWindow *window) Q_DECL_OVERRIDE;
+ WId winId() const override;
+ void setParent(const QPlatformWindow *window) override;
NSView *view() const;
NSWindow *nativeWindow() const;
@@ -167,10 +167,10 @@ public:
QCocoaGLContext *currentContext() const;
#endif
- bool setWindowModified(bool modified) Q_DECL_OVERRIDE;
+ bool setWindowModified(bool modified) override;
- void setFrameStrutEventsEnabled(bool enabled) Q_DECL_OVERRIDE;
- bool frameStrutEventsEnabled() const Q_DECL_OVERRIDE
+ void setFrameStrutEventsEnabled(bool enabled) override;
+ bool frameStrutEventsEnabled() const override
{ return m_frameStrutEventsEnabled; }
void setMenubar(QCocoaMenuBar *mb);
@@ -187,7 +187,7 @@ public:
void applyContentBorderThickness(NSWindow *window = nullptr);
void updateNSToolbar();
- qreal devicePixelRatio() const Q_DECL_OVERRIDE;
+ qreal devicePixelRatio() const override;
QWindow *childWindowAt(QPoint windowPoint);
bool shouldRefuseKeyWindowAndFirstResponder();
@@ -209,8 +209,6 @@ protected:
void recreateWindowIfNeeded();
QCocoaNSWindow *createNSWindow(bool shouldBePanel);
- QRect nativeWindowGeometry() const;
-
Qt::WindowState windowState() const;
void applyWindowState(Qt::WindowStates newState);
void toggleMaximized();
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm
index d1f19f2de9..c3160e32c2 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.mm
+++ b/src/plugins/platforms/cocoa/qcocoawindow.mm
@@ -286,7 +286,7 @@ QRect QCocoaWindow::geometry() const
NSPoint windowPoint = [m_view convertPoint:NSMakePoint(0, 0) toView:nil];
NSRect screenRect = [[m_view window] convertRectToScreen:NSMakeRect(windowPoint.x, windowPoint.y, 1, 1)];
NSPoint screenPoint = screenRect.origin;
- QPoint position = qt_mac_flipPoint(screenPoint).toPoint();
+ QPoint position = QCocoaScreen::mapFromNative(screenPoint).toPoint();
QSize size = QRectF::fromCGRect(NSRectToCGRect([m_view bounds])).toRect().size();
return QRect(position, size);
}
@@ -309,7 +309,7 @@ void QCocoaWindow::setCocoaGeometry(const QRect &rect)
}
if (isContentView()) {
- NSRect bounds = qt_mac_flipRect(rect);
+ NSRect bounds = QCocoaScreen::mapToNative(rect);
[m_view.window setFrame:[m_view.window frameRectForContentRect:bounds] display:YES animate:NO];
} else {
[m_view setFrame:NSMakeRect(rect.x(), rect.y(), rect.width(), rect.height())];
@@ -402,7 +402,7 @@ void QCocoaWindow::setVisible(bool visible)
if (!(parentCocoaWindow && window()->transientParent()->isActive()) && window()->type() == Qt::Popup) {
removeMonitor();
monitor = [NSEvent addGlobalMonitorForEventsMatchingMask:NSLeftMouseDownMask|NSRightMouseDownMask|NSOtherMouseDownMask|NSMouseMovedMask handler:^(NSEvent *e) {
- QPointF localPoint = qt_mac_flipPoint([NSEvent mouseLocation]);
+ QPointF localPoint = QCocoaScreen::mapFromNative([NSEvent mouseLocation]);
QWindowSystemInterface::handleMouseEvent(window(), window()->mapFromGlobal(localPoint.toPoint()), localPoint,
cocoaButton2QtButton([e buttonNumber]));
}];
@@ -1115,7 +1115,7 @@ void QCocoaWindow::handleGeometryChange()
CGRect contentRect = [m_view.window contentRectForFrameRect:m_view.window.frame];
// The result above is in native screen coordinates, so remap to the Qt coordinate system
- newGeometry = QCocoaScreen::primaryScreen()->mapFromNative(QRectF::fromCGRect(contentRect)).toRect();
+ newGeometry = QCocoaScreen::mapFromNative(contentRect).toRect();
} else {
// QNSView has isFlipped set, so no need to remap the geometry
newGeometry = QRectF::fromCGRect(m_view.frame).toRect();
@@ -1377,7 +1377,7 @@ QCocoaNSWindow *QCocoaWindow::createNSWindow(bool shouldBePanel)
rect.translate(-targetScreen->geometry().topLeft());
QCocoaScreen *cocoaScreen = static_cast<QCocoaScreen *>(targetScreen->handle());
- NSRect frame = NSRectFromCGRect(cocoaScreen->mapToNative(rect).toCGRect());
+ NSRect frame = QCocoaScreen::mapToNative(rect, cocoaScreen);
// Note: The macOS window manager has a bug, where if a screen is rotated, it will not allow
// a window to be created within the area of the screen that has a Y coordinate (I quadrant)
@@ -1473,19 +1473,6 @@ void QCocoaWindow::removeMonitor()
monitor = nil;
}
-// Returns the current global screen geometry for the nswindow associated with this window.
-QRect QCocoaWindow::nativeWindowGeometry() const
-{
- if (!isContentView())
- return geometry();
-
- NSRect rect = m_view.window.frame;
- QPlatformScreen *onScreen = QPlatformScreen::platformScreenForWindow(window());
- int flippedY = onScreen->geometry().height() - rect.origin.y - rect.size.height; // account for nswindow inverted y.
- QRect qRect = QRect(rect.origin.x, flippedY, rect.size.width, rect.size.height);
- return qRect;
-}
-
/*!
Applies the given state to the NSWindow, going in/out of minimize/zoomed/fullscreen
diff --git a/src/plugins/platforms/cocoa/qmultitouch_mac.mm b/src/plugins/platforms/cocoa/qmultitouch_mac.mm
index 79f8af7783..9eca4d2d43 100644
--- a/src/plugins/platforms/cocoa/qmultitouch_mac.mm
+++ b/src/plugins/platforms/cocoa/qmultitouch_mac.mm
@@ -39,6 +39,7 @@
#include "qmultitouch_mac_p.h"
#include "qcocoahelpers.h"
+#include "qcocoascreen.h"
#include <private/qtouchdevice_p.h>
QT_BEGIN_NAMESPACE
@@ -83,7 +84,7 @@ void QCocoaTouch::updateTouchData(NSTouch *nstouch, NSTouchPhase phase)
if (_touchPoint.id == 0 && phase == NSTouchPhaseBegan) {
_trackpadReferencePos = qnpos;
- _screenReferencePos = qt_mac_flipPoint([NSEvent mouseLocation]);
+ _screenReferencePos = QCocoaScreen::mapFromNative([NSEvent mouseLocation]);
}
QPointF screenPos = _screenReferencePos;
diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm
index c888551729..33f9527213 100644
--- a/src/plugins/platforms/cocoa/qnsview.mm
+++ b/src/plugins/platforms/cocoa/qnsview.mm
@@ -42,6 +42,7 @@
#include "qnsview.h"
#include "qcocoawindow.h"
#include "qcocoahelpers.h"
+#include "qcocoascreen.h"
#include "qmultitouch_mac_p.h"
#include "qcocoadrag.h"
#include "qcocoainputcontext.h"
@@ -442,8 +443,7 @@ Q_LOGGING_CATEGORY(lcQpaTablet, "qt.qpa.input.tablet")
nsWindowPoint = windowRect.origin; // NSWindow coordinates
NSPoint nsViewPoint = [self convertPoint: nsWindowPoint fromView: nil]; // NSView/QWindow coordinates
*qtWindowPoint = QPointF(nsViewPoint.x, nsViewPoint.y); // NSView/QWindow coordinates
-
- *qtScreenPoint = QPointF(mouseLocation.x, qt_mac_flipYCoordinate(mouseLocation.y)); // Qt screen coordinates
+ *qtScreenPoint = QCocoaScreen::mapFromNative(mouseLocation);
}
- (void)resetMouseButtons
@@ -554,7 +554,7 @@ Q_LOGGING_CATEGORY(lcQpaTablet, "qt.qpa.input.tablet")
NSPoint nsViewPoint = [self convertPoint: windowPoint fromView: nil];
QPoint qtWindowPoint = QPoint(nsViewPoint.x, titleBarHeight + nsViewPoint.y);
NSPoint screenPoint = [window convertRectToScreen:NSMakeRect(windowPoint.x, windowPoint.y, 0, 0)].origin;
- QPoint qtScreenPoint = QPoint(screenPoint.x, qt_mac_flipYCoordinate(screenPoint.y));
+ QPoint qtScreenPoint = QCocoaScreen::mapFromNative(screenPoint).toPoint();
ulong timestamp = [theEvent timestamp] * 1000;
QWindowSystemInterface::handleFrameStrutMouseEvent(m_platformWindow->window(), timestamp, qtWindowPoint, qtScreenPoint, m_frameStrutButtons);
@@ -646,7 +646,7 @@ Q_LOGGING_CATEGORY(lcQpaTablet, "qt.qpa.input.tablet")
if (!popups->isEmpty()) {
// Check if the click is outside all popups.
bool inside = false;
- QPointF qtScreenPoint = qt_mac_flipPoint([self screenMousePoint:theEvent]);
+ QPointF qtScreenPoint = QCocoaScreen::mapFromNative([self screenMousePoint:theEvent]);
for (QList<QCocoaWindow *>::const_iterator it = popups->begin(); it != popups->end(); ++it) {
if ((*it)->geometry().contains(qtScreenPoint.toPoint())) {
inside = true;
@@ -1736,14 +1736,8 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent)
// The returned rect is always based on the internal cursor.
QRect mr = qApp->inputMethod()->cursorRectangle().toRect();
- QPoint mp = m_platformWindow->window()->mapToGlobal(mr.bottomLeft());
-
- NSRect rect;
- rect.origin.x = mp.x();
- rect.origin.y = qt_mac_flipYCoordinate(mp.y());
- rect.size.width = mr.width();
- rect.size.height = mr.height();
- return rect;
+ mr.moveBottomLeft(m_platformWindow->window()->mapToGlobal(mr.bottomLeft()));
+ return QCocoaScreen::mapToNative(mr);
}
- (NSUInteger)characterIndexForPoint:(NSPoint)aPoint
@@ -2029,8 +2023,7 @@ static QPoint mapWindowCoordinates(QWindow *source, QWindow *target, QPoint poin
NSPoint windowPoint = [self.window convertRectFromScreen:NSMakeRect(screenPoint.x, screenPoint.y, 1, 1)].origin;
NSPoint nsViewPoint = [self convertPoint: windowPoint fromView: nil]; // NSView/QWindow coordinates
QPoint qtWindowPoint(nsViewPoint.x, nsViewPoint.y);
-
- QPoint qtScreenPoint = QPoint(screenPoint.x, qt_mac_flipYCoordinate(screenPoint.y));
+ QPoint qtScreenPoint = QCocoaScreen::mapFromNative(screenPoint).toPoint();
QWindowSystemInterface::handleMouseEvent(target, mapWindowCoordinates(m_platformWindow->window(), target, qtWindowPoint), qtScreenPoint, m_buttons);
}
diff --git a/src/plugins/platforms/cocoa/qprintengine_mac.mm b/src/plugins/platforms/cocoa/qprintengine_mac.mm
index c39af870d4..b3d48c1ec3 100644
--- a/src/plugins/platforms/cocoa/qprintengine_mac.mm
+++ b/src/plugins/platforms/cocoa/qprintengine_mac.mm
@@ -247,7 +247,7 @@ void QMacPrintEnginePrivate::initialize()
QList<int> resolutions = m_printDevice->supportedResolutions();
if (!resolutions.isEmpty() && mode != QPrinter::ScreenResolution) {
- qSort(resolutions);
+ std::sort(resolutions.begin(), resolutions.end());
if (resolutions.count() > 1 && mode == QPrinter::HighResolution)
resolution.hRes = resolution.vRes = resolutions.last();
else
diff --git a/src/plugins/platforms/cocoa/qprintengine_mac_p.h b/src/plugins/platforms/cocoa/qprintengine_mac_p.h
index 2d46a250d5..9514f3e691 100644
--- a/src/plugins/platforms/cocoa/qprintengine_mac_p.h
+++ b/src/plugins/platforms/cocoa/qprintengine_mac_p.h
@@ -150,8 +150,8 @@ public:
PMPrintSession session() const { return static_cast<PMPrintSession>([printInfo PMPrintSession]); }
PMPrintSettings settings() const { return static_cast<PMPrintSettings>([printInfo PMPrintSettings]); }
- QPaintEngine *aggregateEngine() Q_DECL_OVERRIDE { return paintEngine; }
- Qt::HANDLE nativeHandle() Q_DECL_OVERRIDE { return q_func()->handle(); }
+ QPaintEngine *aggregateEngine() override { return paintEngine; }
+ Qt::HANDLE nativeHandle() override { return q_func()->handle(); }
};
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/direct2d/qwindowsdirect2dbackingstore.h b/src/plugins/platforms/direct2d/qwindowsdirect2dbackingstore.h
index 670c4e9840..f72ea2b038 100644
--- a/src/plugins/platforms/direct2d/qwindowsdirect2dbackingstore.h
+++ b/src/plugins/platforms/direct2d/qwindowsdirect2dbackingstore.h
@@ -54,12 +54,12 @@ public:
QWindowsDirect2DBackingStore(QWindow *window);
~QWindowsDirect2DBackingStore();
- void beginPaint(const QRegion &) Q_DECL_OVERRIDE;
- void endPaint() Q_DECL_OVERRIDE;
+ void beginPaint(const QRegion &) override;
+ void endPaint() override;
- QPaintDevice *paintDevice() Q_DECL_OVERRIDE;
- void flush(QWindow *targetWindow, const QRegion &region, const QPoint &offset) Q_DECL_OVERRIDE;
- void resize(const QSize &size, const QRegion &staticContents) Q_DECL_OVERRIDE;
+ QPaintDevice *paintDevice() override;
+ void flush(QWindow *targetWindow, const QRegion &region, const QPoint &offset) override;
+ void resize(const QSize &size, const QRegion &staticContents) override;
QImage toImage() const override;
};
diff --git a/src/plugins/platforms/direct2d/qwindowsdirect2ddevicecontext.cpp b/src/plugins/platforms/direct2d/qwindowsdirect2ddevicecontext.cpp
index 643ae877d0..d578a58982 100644
--- a/src/plugins/platforms/direct2d/qwindowsdirect2ddevicecontext.cpp
+++ b/src/plugins/platforms/direct2d/qwindowsdirect2ddevicecontext.cpp
@@ -161,7 +161,7 @@ void QWindowsDirect2DDeviceContextSuspender::resume()
{
if (m_dc) {
m_dc->resume();
- m_dc = Q_NULLPTR;
+ m_dc = nullptr;
}
}
diff --git a/src/plugins/platforms/direct2d/qwindowsdirect2dintegration.cpp b/src/plugins/platforms/direct2d/qwindowsdirect2dintegration.cpp
index ea51135583..97e3a25b86 100644
--- a/src/plugins/platforms/direct2d/qwindowsdirect2dintegration.cpp
+++ b/src/plugins/platforms/direct2d/qwindowsdirect2dintegration.cpp
@@ -203,7 +203,7 @@ QWindowsDirect2DIntegration *QWindowsDirect2DIntegration::create(const QStringLi
caption.toStdWString().c_str(),
MB_OK | MB_ICONERROR);
- return Q_NULLPTR;
+ return nullptr;
}
QWindowsDirect2DIntegration *integration = new QWindowsDirect2DIntegration(paramList);
diff --git a/src/plugins/platforms/direct2d/qwindowsdirect2dintegration.h b/src/plugins/platforms/direct2d/qwindowsdirect2dintegration.h
index 43f2a08745..39ca1d0dbf 100644
--- a/src/plugins/platforms/direct2d/qwindowsdirect2dintegration.h
+++ b/src/plugins/platforms/direct2d/qwindowsdirect2dintegration.h
@@ -58,15 +58,15 @@ public:
static QWindowsDirect2DIntegration *instance();
- QPlatformNativeInterface *nativeInterface() const Q_DECL_OVERRIDE;
- QPlatformPixmap *createPlatformPixmap(QPlatformPixmap::PixelType type) const Q_DECL_OVERRIDE;
- QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const Q_DECL_OVERRIDE;
- QAbstractEventDispatcher *createEventDispatcher() const Q_DECL_OVERRIDE;
+ QPlatformNativeInterface *nativeInterface() const override;
+ QPlatformPixmap *createPlatformPixmap(QPlatformPixmap::PixelType type) const override;
+ QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const override;
+ QAbstractEventDispatcher *createEventDispatcher() const override;
QWindowsDirect2DContext *direct2DContext() const;
protected:
- QWindowsWindow *createPlatformWindowHelper(QWindow *window, const QWindowsWindowData &) const Q_DECL_OVERRIDE;
+ QWindowsWindow *createPlatformWindowHelper(QWindow *window, const QWindowsWindowData &) const override;
private:
explicit QWindowsDirect2DIntegration(const QStringList &paramList);
diff --git a/src/plugins/platforms/direct2d/qwindowsdirect2dnativeinterface.h b/src/plugins/platforms/direct2d/qwindowsdirect2dnativeinterface.h
index d57136129b..fce6ff9969 100644
--- a/src/plugins/platforms/direct2d/qwindowsdirect2dnativeinterface.h
+++ b/src/plugins/platforms/direct2d/qwindowsdirect2dnativeinterface.h
@@ -48,7 +48,7 @@ class QWindowsDirect2DNativeInterface : public QWindowsNativeInterface
{
Q_OBJECT
public:
- void *nativeResourceForBackingStore(const QByteArray &resource, QBackingStore *bs) Q_DECL_OVERRIDE;
+ void *nativeResourceForBackingStore(const QByteArray &resource, QBackingStore *bs) override;
};
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/direct2d/qwindowsdirect2dpaintdevice.h b/src/plugins/platforms/direct2d/qwindowsdirect2dpaintdevice.h
index f434ef993c..1f23d604f5 100644
--- a/src/plugins/platforms/direct2d/qwindowsdirect2dpaintdevice.h
+++ b/src/plugins/platforms/direct2d/qwindowsdirect2dpaintdevice.h
@@ -58,11 +58,11 @@ public:
QWindowsDirect2DPaintEngine::Flags paintFlags = QWindowsDirect2DPaintEngine::NoFlag);
~QWindowsDirect2DPaintDevice();
- QPaintEngine *paintEngine() const Q_DECL_OVERRIDE;
- int devType() const Q_DECL_OVERRIDE;
+ QPaintEngine *paintEngine() const override;
+ int devType() const override;
protected:
- int metric(PaintDeviceMetric metric) const Q_DECL_OVERRIDE;
+ int metric(PaintDeviceMetric metric) const override;
private:
QScopedPointer<QWindowsDirect2DPaintDevicePrivate> d_ptr;
diff --git a/src/plugins/platforms/direct2d/qwindowsdirect2dpaintengine.cpp b/src/plugins/platforms/direct2d/qwindowsdirect2dpaintengine.cpp
index 164429ba30..95fbd37247 100644
--- a/src/plugins/platforms/direct2d/qwindowsdirect2dpaintengine.cpp
+++ b/src/plugins/platforms/direct2d/qwindowsdirect2dpaintengine.cpp
@@ -804,7 +804,7 @@ public:
const bool alias = !q->antiAliasingEnabled();
QVectorPath::CacheEntry *cacheEntry = path.isCacheable() ? path.lookupCacheData(q)
- : Q_NULLPTR;
+ : nullptr;
if (cacheEntry) {
D2DVectorPathCache *e = static_cast<D2DVectorPathCache *>(cacheEntry->data);
diff --git a/src/plugins/platforms/direct2d/qwindowsdirect2dpaintengine.h b/src/plugins/platforms/direct2d/qwindowsdirect2dpaintengine.h
index a8f63af5d5..b9616acd6a 100644
--- a/src/plugins/platforms/direct2d/qwindowsdirect2dpaintengine.h
+++ b/src/plugins/platforms/direct2d/qwindowsdirect2dpaintengine.h
@@ -65,45 +65,45 @@ public:
QWindowsDirect2DPaintEngine(QWindowsDirect2DBitmap *bitmap, Flags flags);
- bool begin(QPaintDevice *pdev) Q_DECL_OVERRIDE;
- bool end() Q_DECL_OVERRIDE;
+ bool begin(QPaintDevice *pdev) override;
+ bool end() override;
- Type type() const Q_DECL_OVERRIDE;
+ Type type() const override;
- void setState(QPainterState *s) Q_DECL_OVERRIDE;
+ void setState(QPainterState *s) override;
- void draw(const QVectorPath &path) Q_DECL_OVERRIDE;
+ void draw(const QVectorPath &path) override;
- void fill(const QVectorPath &path, const QBrush &brush) Q_DECL_OVERRIDE;
+ void fill(const QVectorPath &path, const QBrush &brush) override;
void fill(ID2D1Geometry *geometry, const QBrush &brush);
- void stroke(const QVectorPath &path, const QPen &pen) Q_DECL_OVERRIDE;
+ void stroke(const QVectorPath &path, const QPen &pen) override;
void stroke(ID2D1Geometry *geometry, const QPen &pen);
- void clip(const QVectorPath &path, Qt::ClipOperation op) Q_DECL_OVERRIDE;
+ void clip(const QVectorPath &path, Qt::ClipOperation op) override;
- void clipEnabledChanged() Q_DECL_OVERRIDE;
- void penChanged() Q_DECL_OVERRIDE;
- void brushChanged() Q_DECL_OVERRIDE;
- void brushOriginChanged() Q_DECL_OVERRIDE;
- void opacityChanged() Q_DECL_OVERRIDE;
- void compositionModeChanged() Q_DECL_OVERRIDE;
- void renderHintsChanged() Q_DECL_OVERRIDE;
- void transformChanged() Q_DECL_OVERRIDE;
+ void clipEnabledChanged() override;
+ void penChanged() override;
+ void brushChanged() override;
+ void brushOriginChanged() override;
+ void opacityChanged() override;
+ void compositionModeChanged() override;
+ void renderHintsChanged() override;
+ void transformChanged() override;
- void fillRect(const QRectF &rect, const QBrush &brush) Q_DECL_OVERRIDE;
+ void fillRect(const QRectF &rect, const QBrush &brush) override;
- void drawRects(const QRect *rects, int rectCount) Q_DECL_OVERRIDE;
- void drawRects(const QRectF *rects, int rectCount) Q_DECL_OVERRIDE;
+ void drawRects(const QRect *rects, int rectCount) override;
+ void drawRects(const QRectF *rects, int rectCount) override;
- void drawEllipse(const QRectF &r) Q_DECL_OVERRIDE;
- void drawEllipse(const QRect &r) Q_DECL_OVERRIDE;
+ void drawEllipse(const QRectF &r) override;
+ void drawEllipse(const QRect &r) override;
- void drawImage(const QRectF &rectangle, const QImage &image, const QRectF &sr, Qt::ImageConversionFlags flags = Qt::AutoColor) Q_DECL_OVERRIDE;
- void drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr) Q_DECL_OVERRIDE;
+ void drawImage(const QRectF &rectangle, const QImage &image, const QRectF &sr, Qt::ImageConversionFlags flags = Qt::AutoColor) override;
+ void drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr) override;
- void drawStaticTextItem(QStaticTextItem *staticTextItem) Q_DECL_OVERRIDE;
- void drawTextItem(const QPointF &p, const QTextItem &textItem) Q_DECL_OVERRIDE;
+ void drawStaticTextItem(QStaticTextItem *staticTextItem) override;
+ void drawTextItem(const QPointF &p, const QTextItem &textItem) override;
private:
void ensureBrush();
diff --git a/src/plugins/platforms/direct2d/qwindowsdirect2dplatformpixmap.h b/src/plugins/platforms/direct2d/qwindowsdirect2dplatformpixmap.h
index 5f65a2313a..0448613a95 100644
--- a/src/plugins/platforms/direct2d/qwindowsdirect2dplatformpixmap.h
+++ b/src/plugins/platforms/direct2d/qwindowsdirect2dplatformpixmap.h
@@ -59,21 +59,21 @@ public:
QWindowsDirect2DPlatformPixmap(PixelType pixelType, QWindowsDirect2DPaintEngine::Flags flags, QWindowsDirect2DBitmap *bitmap);
~QWindowsDirect2DPlatformPixmap();
- void resize(int width, int height) Q_DECL_OVERRIDE;
- void fromImage(const QImage &image, Qt::ImageConversionFlags flags) Q_DECL_OVERRIDE;
+ void resize(int width, int height) override;
+ void fromImage(const QImage &image, Qt::ImageConversionFlags flags) override;
- int metric(QPaintDevice::PaintDeviceMetric metric) const Q_DECL_OVERRIDE;
- void fill(const QColor &color) Q_DECL_OVERRIDE;
+ int metric(QPaintDevice::PaintDeviceMetric metric) const override;
+ void fill(const QColor &color) override;
- bool hasAlphaChannel() const Q_DECL_OVERRIDE;
+ bool hasAlphaChannel() const override;
- QImage toImage() const Q_DECL_OVERRIDE;
- QImage toImage(const QRect &rect) const Q_DECL_OVERRIDE;
+ QImage toImage() const override;
+ QImage toImage(const QRect &rect) const override;
- QPaintEngine* paintEngine() const Q_DECL_OVERRIDE;
+ QPaintEngine* paintEngine() const override;
- qreal devicePixelRatio() const Q_DECL_OVERRIDE;
- void setDevicePixelRatio(qreal scaleFactor) Q_DECL_OVERRIDE;
+ qreal devicePixelRatio() const override;
+ void setDevicePixelRatio(qreal scaleFactor) override;
QWindowsDirect2DBitmap *bitmap() const;
diff --git a/src/plugins/platforms/direct2d/qwindowsdirect2dwindow.cpp b/src/plugins/platforms/direct2d/qwindowsdirect2dwindow.cpp
index 21294cfb15..f81182e0b1 100644
--- a/src/plugins/platforms/direct2d/qwindowsdirect2dwindow.cpp
+++ b/src/plugins/platforms/direct2d/qwindowsdirect2dwindow.cpp
@@ -209,7 +209,7 @@ void QWindowsDirect2DWindow::resizeSwapChain(const QSize &size)
{
m_pixmap.reset();
m_bitmap.reset();
- m_deviceContext->SetTarget(Q_NULLPTR);
+ m_deviceContext->SetTarget(nullptr);
m_needsFullFlush = true;
if (!m_swapChain)
@@ -241,7 +241,7 @@ QSharedPointer<QWindowsDirect2DBitmap> QWindowsDirect2DWindow::copyBackBuffer()
dpiX, // FLOAT dpiX;
dpiY, // FLOAT dpiY;
D2D1_BITMAP_OPTIONS_TARGET, // D2D1_BITMAP_OPTIONS bitmapOptions;
- Q_NULLPTR // _Field_size_opt_(1) ID2D1ColorContext *colorContext;
+ nullptr // _Field_size_opt_(1) ID2D1ColorContext *colorContext;
};
ComPtr<ID2D1Bitmap1> copy;
HRESULT hr = m_deviceContext.Get()->CreateBitmap(size, NULL, 0, properties, &copy);
@@ -257,7 +257,7 @@ QSharedPointer<QWindowsDirect2DBitmap> QWindowsDirect2DWindow::copyBackBuffer()
return null_result;
}
- return QSharedPointer<QWindowsDirect2DBitmap>(new QWindowsDirect2DBitmap(copy.Get(), Q_NULLPTR));
+ return QSharedPointer<QWindowsDirect2DBitmap>(new QWindowsDirect2DBitmap(copy.Get(), nullptr));
}
void QWindowsDirect2DWindow::setupBitmap()
diff --git a/src/plugins/platforms/direct2d/qwindowsdirect2dwindow.h b/src/plugins/platforms/direct2d/qwindowsdirect2dwindow.h
index 156d4660d1..3ac532d938 100644
--- a/src/plugins/platforms/direct2d/qwindowsdirect2dwindow.h
+++ b/src/plugins/platforms/direct2d/qwindowsdirect2dwindow.h
@@ -56,7 +56,7 @@ public:
QWindowsDirect2DWindow(QWindow *window, const QWindowsWindowData &data);
~QWindowsDirect2DWindow();
- void setWindowFlags(Qt::WindowFlags flags) Q_DECL_OVERRIDE;
+ void setWindowFlags(Qt::WindowFlags flags) override;
QPixmap *pixmap();
void flush(QWindowsDirect2DBitmap *bitmap, const QRegion &region, const QPoint &offset);
diff --git a/src/plugins/platforms/eglfs/api/qeglfsdeviceintegration.cpp b/src/plugins/platforms/eglfs/api/qeglfsdeviceintegration.cpp
index e411ea55e9..0fc4cc54e0 100644
--- a/src/plugins/platforms/eglfs/api/qeglfsdeviceintegration.cpp
+++ b/src/plugins/platforms/eglfs/api/qeglfsdeviceintegration.cpp
@@ -103,7 +103,7 @@ QStringList QEglFSDeviceIntegrationFactory::keys(const QString &pluginPath)
QEglFSDeviceIntegration *QEglFSDeviceIntegrationFactory::create(const QString &key, const QString &pluginPath)
{
- QEglFSDeviceIntegration *integration = Q_NULLPTR;
+ QEglFSDeviceIntegration *integration = nullptr;
#if QT_CONFIG(library)
if (!pluginPath.isEmpty()) {
QCoreApplication::addLibraryPath(pluginPath);
@@ -351,9 +351,21 @@ bool QEglFSDeviceIntegration::supportsSurfacelessContexts() const
return true;
}
+QFunctionPointer QEglFSDeviceIntegration::platformFunction(const QByteArray &function) const
+{
+ Q_UNUSED(function);
+ return nullptr;
+}
+
+void *QEglFSDeviceIntegration::nativeResourceForIntegration(const QByteArray &name)
+{
+ Q_UNUSED(name);
+ return nullptr;
+}
+
void *QEglFSDeviceIntegration::wlDisplay() const
{
- return Q_NULLPTR;
+ return nullptr;
}
EGLConfig QEglFSDeviceIntegration::chooseConfig(EGLDisplay display, const QSurfaceFormat &format)
diff --git a/src/plugins/platforms/eglfs/api/qeglfsdeviceintegration_p.h b/src/plugins/platforms/eglfs/api/qeglfsdeviceintegration_p.h
index 4335554912..d927bc9bc6 100644
--- a/src/plugins/platforms/eglfs/api/qeglfsdeviceintegration_p.h
+++ b/src/plugins/platforms/eglfs/api/qeglfsdeviceintegration_p.h
@@ -103,6 +103,8 @@ public:
virtual int framebufferIndex() const;
virtual bool supportsPBuffers() const;
virtual bool supportsSurfacelessContexts() const;
+ virtual QFunctionPointer platformFunction(const QByteArray &function) const;
+ virtual void *nativeResourceForIntegration(const QByteArray &name);
virtual void *wlDisplay() const;
diff --git a/src/plugins/platforms/eglfs/api/qeglfsintegration.cpp b/src/plugins/platforms/eglfs/api/qeglfsintegration.cpp
index 9a0be489a8..c0ecfd235f 100644
--- a/src/plugins/platforms/eglfs/api/qeglfsintegration.cpp
+++ b/src/plugins/platforms/eglfs/api/qeglfsintegration.cpp
@@ -324,6 +324,7 @@ void *QEglFSIntegration::nativeResourceForIntegration(const QByteArray &resource
result = qt_egl_device_integration()->wlDisplay();
break;
default:
+ result = qt_egl_device_integration()->nativeResourceForIntegration(resource);
break;
}
@@ -427,11 +428,9 @@ QFunctionPointer QEglFSIntegration::platformFunction(const QByteArray &function)
#if QT_CONFIG(evdev)
if (function == QEglFSFunctions::loadKeymapTypeIdentifier())
return QFunctionPointer(loadKeymapStatic);
-#else
- Q_UNUSED(function)
#endif
- return 0;
+ return qt_egl_device_integration()->platformFunction(function);
}
void QEglFSIntegration::loadKeymapStatic(const QString &filename)
diff --git a/src/plugins/platforms/eglfs/api/qeglfswindow_p.h b/src/plugins/platforms/eglfs/api/qeglfswindow_p.h
index 6bda262523..c61f04f569 100644
--- a/src/plugins/platforms/eglfs/api/qeglfswindow_p.h
+++ b/src/plugins/platforms/eglfs/api/qeglfswindow_p.h
@@ -95,7 +95,7 @@ public:
EGLNativeWindowType eglWindow() const;
EGLSurface surface() const;
- QEglFSScreen *screen() const;
+ QEglFSScreen *screen() const override;
bool hasNativeWindow() const { return m_flags.testFlag(HasNativeWindow); }
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/eglfs_kms.pro b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/eglfs_kms.pro
index 27c0af1f08..43170a3875 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/eglfs_kms.pro
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/eglfs_kms.pro
@@ -19,11 +19,13 @@ SOURCES += $$PWD/qeglfskmsgbmmain.cpp \
$$PWD/qeglfskmsgbmintegration.cpp \
$$PWD/qeglfskmsgbmdevice.cpp \
$$PWD/qeglfskmsgbmscreen.cpp \
- $$PWD/qeglfskmsgbmcursor.cpp
+ $$PWD/qeglfskmsgbmcursor.cpp \
+ $$PWD/qeglfskmsgbmwindow.cpp
HEADERS += $$PWD/qeglfskmsgbmintegration.h \
$$PWD/qeglfskmsgbmdevice.h \
$$PWD/qeglfskmsgbmscreen.h \
- $$PWD/qeglfskmsgbmcursor.h
+ $$PWD/qeglfskmsgbmcursor.h \
+ $$PWD/qeglfskmsgbmwindow.h
OTHER_FILES += $$PWD/eglfs_kms.json
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmcursor.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmcursor.cpp
index 800118362d..9bd7fee1fb 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmcursor.cpp
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmcursor.cpp
@@ -68,7 +68,7 @@ Q_DECLARE_LOGGING_CATEGORY(qLcEglfsKmsDebug)
QEglFSKmsGbmCursor::QEglFSKmsGbmCursor(QEglFSKmsGbmScreen *screen)
: m_screen(screen)
, m_cursorSize(64, 64) // 64x64 is the old standard size, we now try to query the real size below
- , m_bo(Q_NULLPTR)
+ , m_bo(nullptr)
, m_cursorImage(0, 0, 0, 0, 0, 0)
, m_state(CursorPendingVisible)
{
@@ -118,7 +118,7 @@ QEglFSKmsGbmCursor::~QEglFSKmsGbmCursor()
if (m_bo) {
gbm_bo_destroy(m_bo);
- m_bo = Q_NULLPTR;
+ m_bo = nullptr;
}
}
@@ -132,7 +132,7 @@ void QEglFSKmsGbmCursor::updateMouseStatus()
m_state = visible ? CursorPendingVisible : CursorPendingHidden;
#ifndef QT_NO_CURSOR
- changeCursor(Q_NULLPTR, m_screen->topLevelAt(pos()));
+ changeCursor(nullptr, m_screen->topLevelAt(pos()));
#endif
}
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmdevice.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmdevice.cpp
index e218d580a2..20127ae7f7 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmdevice.cpp
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmdevice.cpp
@@ -53,28 +53,17 @@ QT_BEGIN_NAMESPACE
Q_DECLARE_LOGGING_CATEGORY(qLcEglfsKmsDebug)
-void QEglFSKmsGbmDevice::pageFlipHandler(int fd, unsigned int sequence, unsigned int tv_sec, unsigned int tv_usec, void *user_data)
-{
- Q_UNUSED(fd);
- Q_UNUSED(sequence);
- Q_UNUSED(tv_sec);
- Q_UNUSED(tv_usec);
-
- QEglFSKmsScreen *screen = static_cast<QEglFSKmsScreen *>(user_data);
- screen->flipFinished();
-}
-
QEglFSKmsGbmDevice::QEglFSKmsGbmDevice(QKmsScreenConfig *screenConfig, const QString &path)
: QEglFSKmsDevice(screenConfig, path)
- , m_gbm_device(Q_NULLPTR)
- , m_globalCursor(Q_NULLPTR)
+ , m_gbm_device(nullptr)
+ , m_globalCursor(nullptr)
{
}
bool QEglFSKmsGbmDevice::open()
{
Q_ASSERT(fd() == -1);
- Q_ASSERT(m_gbm_device == Q_NULLPTR);
+ Q_ASSERT(m_gbm_device == nullptr);
int fd = qt_safe_open(devicePath().toLocal8Bit().constData(), O_RDWR | O_CLOEXEC);
if (fd == -1) {
@@ -103,7 +92,7 @@ void QEglFSKmsGbmDevice::close()
if (m_gbm_device) {
gbm_device_destroy(m_gbm_device);
- m_gbm_device = Q_NULLPTR;
+ m_gbm_device = nullptr;
}
if (fd() != -1) {
@@ -134,24 +123,13 @@ void QEglFSKmsGbmDevice::destroyGlobalCursor()
if (m_globalCursor) {
qCDebug(qLcEglfsKmsDebug, "Destroying global GBM mouse cursor");
delete m_globalCursor;
- m_globalCursor = Q_NULLPTR;
+ m_globalCursor = nullptr;
}
}
-void QEglFSKmsGbmDevice::handleDrmEvent()
-{
- drmEventContext drmEvent;
- memset(&drmEvent, 0, sizeof(drmEvent));
- drmEvent.version = 2;
- drmEvent.vblank_handler = nullptr;
- drmEvent.page_flip_handler = pageFlipHandler;
-
- drmHandleEvent(fd(), &drmEvent);
-}
-
QPlatformScreen *QEglFSKmsGbmDevice::createScreen(const QKmsOutput &output)
{
- QEglFSKmsGbmScreen *screen = new QEglFSKmsGbmScreen(this, output);
+ QEglFSKmsGbmScreen *screen = new QEglFSKmsGbmScreen(this, output, false);
if (!m_globalCursor && screenConfig()->hwCursor()) {
qCDebug(qLcEglfsKmsDebug, "Creating new global GBM mouse cursor");
@@ -161,4 +139,20 @@ QPlatformScreen *QEglFSKmsGbmDevice::createScreen(const QKmsOutput &output)
return screen;
}
+QPlatformScreen *QEglFSKmsGbmDevice::createHeadlessScreen()
+{
+ return new QEglFSKmsGbmScreen(this, QKmsOutput(), true);
+}
+
+void QEglFSKmsGbmDevice::registerScreenCloning(QPlatformScreen *screen,
+ QPlatformScreen *screenThisScreenClones,
+ const QVector<QPlatformScreen *> &screensCloningThisScreen)
+{
+ if (!screenThisScreenClones && screensCloningThisScreen.isEmpty())
+ return;
+
+ QEglFSKmsGbmScreen *gbmScreen = static_cast<QEglFSKmsGbmScreen *>(screen);
+ gbmScreen->initCloning(screenThisScreenClones, screensCloningThisScreen);
+}
+
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmdevice.h b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmdevice.h
index 08ca28d48e..518e2ce58b 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmdevice.h
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmdevice.h
@@ -65,9 +65,11 @@ public:
QPlatformCursor *globalCursor() const;
void destroyGlobalCursor();
- void handleDrmEvent();
-
QPlatformScreen *createScreen(const QKmsOutput &output) override;
+ QPlatformScreen *createHeadlessScreen() override;
+ void registerScreenCloning(QPlatformScreen *screen,
+ QPlatformScreen *screenThisScreenClones,
+ const QVector<QPlatformScreen *> &screensCloningThisScreen) override;
private:
Q_DISABLE_COPY(QEglFSKmsGbmDevice)
@@ -75,12 +77,6 @@ private:
gbm_device *m_gbm_device;
QEglFSKmsGbmCursor *m_globalCursor;
-
- static void pageFlipHandler(int fd,
- unsigned int sequence,
- unsigned int tv_sec,
- unsigned int tv_usec,
- void *user_data);
};
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmintegration.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmintegration.cpp
index 058791e473..402338197d 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmintegration.cpp
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmintegration.cpp
@@ -43,21 +43,13 @@
#include "qeglfskmsgbmdevice.h"
#include "qeglfskmsgbmscreen.h"
#include "qeglfskmsgbmcursor.h"
-#include "private/qeglfswindow_p.h"
+#include "qeglfskmsgbmwindow.h"
#include "private/qeglfscursor_p.h"
-#include <QtDeviceDiscoverySupport/private/qdevicediscovery_p.h>
-#include <QtEglSupport/private/qeglconvenience_p.h>
#include <QtCore/QLoggingCategory>
-#include <QtCore/QJsonDocument>
-#include <QtCore/QJsonObject>
-#include <QtCore/QJsonArray>
-#include <QtGui/qpa/qplatformwindow.h>
-#include <QtGui/qpa/qplatformcursor.h>
#include <QtGui/QScreen>
+#include <QtDeviceDiscoverySupport/private/qdevicediscovery_p.h>
-#include <xf86drm.h>
-#include <xf86drmMode.h>
#include <gbm.h>
QT_BEGIN_NAMESPACE
@@ -105,7 +97,6 @@ EGLNativeWindowType QEglFSKmsGbmIntegration::createNativeOffscreenWindow(const Q
Q_UNUSED(format);
Q_ASSERT(device());
- qCDebug(qLcEglfsKmsDebug) << "Creating native off screen window";
gbm_surface *surface = gbm_surface_create(static_cast<QEglFSKmsGbmDevice *>(device())->gbmDevice(),
1, 1,
GBM_FORMAT_XRGB8888,
@@ -134,8 +125,7 @@ QPlatformCursor *QEglFSKmsGbmIntegration::createCursor(QPlatformScreen *screen)
void QEglFSKmsGbmIntegration::presentBuffer(QPlatformSurface *surface)
{
QWindow *window = static_cast<QWindow *>(surface->surface());
- QEglFSKmsScreen *screen = static_cast<QEglFSKmsScreen *>(window->screen()->handle());
-
+ QEglFSKmsGbmScreen *screen = static_cast<QEglFSKmsGbmScreen *>(window->screen()->handle());
screen->flip();
}
@@ -160,46 +150,6 @@ QKmsDevice *QEglFSKmsGbmIntegration::createDevice()
return new QEglFSKmsGbmDevice(screenConfig(), path);
}
-class QEglFSKmsGbmWindow : public QEglFSWindow
-{
-public:
- QEglFSKmsGbmWindow(QWindow *w, const QEglFSKmsGbmIntegration *integration)
- : QEglFSWindow(w)
- , m_integration(integration)
- {}
- void resetSurface() override;
- const QEglFSKmsGbmIntegration *m_integration;
-};
-
-void QEglFSKmsGbmWindow::resetSurface()
-{
- QEglFSKmsGbmScreen *gbmScreen = static_cast<QEglFSKmsGbmScreen *>(screen());
- if (gbmScreen->surface()) {
- qWarning("Only single window per screen supported!");
- return;
- }
-
- EGLDisplay display = gbmScreen->display();
- QSurfaceFormat platformFormat = m_integration->surfaceFormatFor(window()->requestedFormat());
- m_config = QEglFSDeviceIntegration::chooseConfig(display, platformFormat);
- m_format = q_glFormatFromConfig(display, m_config, platformFormat);
- m_window = reinterpret_cast<EGLNativeWindowType>(gbmScreen->createSurface());
-
- PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC createPlatformWindowSurface = nullptr;
- const char *extensions = eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS);
- if (extensions && (strstr(extensions, "EGL_KHR_platform_gbm") || strstr(extensions, "EGL_MESA_platform_gbm"))) {
- createPlatformWindowSurface = reinterpret_cast<PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC>(
- eglGetProcAddress("eglCreatePlatformWindowSurfaceEXT"));
- }
-
- if (createPlatformWindowSurface) {
- m_surface = createPlatformWindowSurface(display, m_config, reinterpret_cast<void *>(m_window), nullptr);
- } else {
- qCDebug(qLcEglfsKmsDebug, "No eglCreatePlatformWindowSurface for GBM, falling back to eglCreateWindowSurface");
- m_surface = eglCreateWindowSurface(display, m_config, m_window, nullptr);
- }
-}
-
QEglFSWindow *QEglFSKmsGbmIntegration::createWindow(QWindow *window) const
{
return new QEglFSKmsGbmWindow(window, this);
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.cpp
index 87fb3146c7..4742143121 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.cpp
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
+** Copyright (C) 2017 The Qt Company Ltd.
** Copyright (C) 2015 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
-** Copyright (C) 2016 The Qt Company Ltd.
** Copyright (C) 2016 Pelagicore AG
** Contact: https://www.qt.io/licensing/
**
@@ -55,6 +55,18 @@ QT_BEGIN_NAMESPACE
Q_DECLARE_LOGGING_CATEGORY(qLcEglfsKmsDebug)
+static inline uint32_t drmFormatToGbmFormat(uint32_t drmFormat)
+{
+ Q_ASSERT(DRM_FORMAT_XRGB8888 == GBM_FORMAT_XRGB8888);
+ return drmFormat;
+}
+
+static inline uint32_t gbmFormatToDrmFormat(uint32_t gbmFormat)
+{
+ Q_ASSERT(DRM_FORMAT_XRGB8888 == GBM_FORMAT_XRGB8888);
+ return gbmFormat;
+}
+
void QEglFSKmsGbmScreen::bufferDestroyedHandler(gbm_bo *bo, void *data)
{
FrameBuffer *fb = static_cast<FrameBuffer *>(data);
@@ -77,29 +89,34 @@ QEglFSKmsGbmScreen::FrameBuffer *QEglFSKmsGbmScreen::framebufferForBufferObject(
uint32_t width = gbm_bo_get_width(bo);
uint32_t height = gbm_bo_get_height(bo);
- uint32_t stride = gbm_bo_get_stride(bo);
- uint32_t handle = gbm_bo_get_handle(bo).u32;
+ uint32_t handles[4] = { gbm_bo_get_handle(bo).u32 };
+ uint32_t strides[4] = { gbm_bo_get_stride(bo) };
+ uint32_t offsets[4] = { 0 };
+ uint32_t pixelFormat = gbmFormatToDrmFormat(gbm_bo_get_format(bo));
QScopedPointer<FrameBuffer> fb(new FrameBuffer);
+ qCDebug(qLcEglfsKmsDebug, "Adding FB, size %ux%u, DRM format 0x%x", width, height, pixelFormat);
- int ret = drmModeAddFB(device()->fd(), width, height, 24, 32,
- stride, handle, &fb->fb);
+ int ret = drmModeAddFB2(device()->fd(), width, height, pixelFormat,
+ handles, strides, offsets, &fb->fb, 0);
if (ret) {
qWarning("Failed to create KMS FB!");
- return Q_NULLPTR;
+ return nullptr;
}
gbm_bo_set_user_data(bo, fb.data(), bufferDestroyedHandler);
return fb.take();
}
-QEglFSKmsGbmScreen::QEglFSKmsGbmScreen(QKmsDevice *device, const QKmsOutput &output)
- : QEglFSKmsScreen(device, output)
- , m_gbm_surface(Q_NULLPTR)
- , m_gbm_bo_current(Q_NULLPTR)
- , m_gbm_bo_next(Q_NULLPTR)
- , m_cursor(Q_NULLPTR)
+QEglFSKmsGbmScreen::QEglFSKmsGbmScreen(QKmsDevice *device, const QKmsOutput &output, bool headless)
+ : QEglFSKmsScreen(device, output, headless)
+ , m_gbm_surface(nullptr)
+ , m_gbm_bo_current(nullptr)
+ , m_gbm_bo_next(nullptr)
+ , m_flipPending(false)
+ , m_cursor(nullptr)
+ , m_cloneSource(nullptr)
{
}
@@ -114,6 +131,8 @@ QEglFSKmsGbmScreen::~QEglFSKmsGbmScreen()
QPlatformCursor *QEglFSKmsGbmScreen::cursor() const
{
QKmsScreenConfig *config = device()->screenConfig();
+ if (config->headless())
+ return nullptr;
if (config->hwCursor()) {
if (!config->separateScreens())
return static_cast<QEglFSKmsGbmDevice *>(device())->globalCursor();
@@ -132,47 +151,112 @@ QPlatformCursor *QEglFSKmsGbmScreen::cursor() const
gbm_surface *QEglFSKmsGbmScreen::createSurface()
{
if (!m_gbm_surface) {
- qCDebug(qLcEglfsKmsDebug) << "Creating window for screen" << name();
+ uint32_t gbmFormat = drmFormatToGbmFormat(m_output.drm_format);
+ qCDebug(qLcEglfsKmsDebug, "Creating gbm_surface for screen %s with format 0x%x", qPrintable(name()), gbmFormat);
m_gbm_surface = gbm_surface_create(static_cast<QEglFSKmsGbmDevice *>(device())->gbmDevice(),
rawGeometry().width(),
rawGeometry().height(),
- GBM_FORMAT_XRGB8888,
+ gbmFormat,
GBM_BO_USE_SCANOUT | GBM_BO_USE_RENDERING);
}
- return m_gbm_surface;
+ return m_gbm_surface; // not owned, gets destroyed in QEglFSKmsGbmIntegration::destroyNativeWindow() via QEglFSKmsGbmWindow::invalidateSurface()
}
-void QEglFSKmsGbmScreen::destroySurface()
+void QEglFSKmsGbmScreen::resetSurface()
{
- if (m_gbm_bo_current) {
- gbm_bo_destroy(m_gbm_bo_current);
- m_gbm_bo_current = Q_NULLPTR;
- }
+ m_gbm_surface = nullptr;
+}
- if (m_gbm_bo_next) {
- gbm_bo_destroy(m_gbm_bo_next);
- m_gbm_bo_next = Q_NULLPTR;
+void QEglFSKmsGbmScreen::initCloning(QPlatformScreen *screenThisScreenClones,
+ const QVector<QPlatformScreen *> &screensCloningThisScreen)
+{
+ // clone destinations need to know the clone source
+ const bool clonesAnother = screenThisScreenClones != nullptr;
+ if (clonesAnother && !screensCloningThisScreen.isEmpty()) {
+ qWarning("QEglFSKmsGbmScreen %s cannot be clone source and destination at the same time", qPrintable(name()));
+ return;
}
+ if (clonesAnother)
+ m_cloneSource = static_cast<QEglFSKmsGbmScreen *>(screenThisScreenClones);
+
+ // clone sources need to know their additional destinations
+ for (QPlatformScreen *s : screensCloningThisScreen) {
+ CloneDestination d;
+ d.screen = static_cast<QEglFSKmsGbmScreen *>(s);
+ m_cloneDests.append(d);
+ }
+}
+
+void QEglFSKmsGbmScreen::ensureModeSet(uint32_t fb)
+{
+ QKmsOutput &op(output());
+ const int fd = device()->fd();
+
+ if (!op.mode_set) {
+ op.mode_set = true;
+
+ bool doModeSet = true;
+ drmModeCrtcPtr currentMode = drmModeGetCrtc(fd, op.crtc_id);
+ const bool alreadySet = currentMode && !memcmp(&currentMode->mode, &op.modes[op.mode], sizeof(drmModeModeInfo));
+ if (currentMode)
+ drmModeFreeCrtc(currentMode);
+ if (alreadySet) {
+ static bool alwaysDoSet = qEnvironmentVariableIntValue("QT_QPA_EGLFS_ALWAYS_SET_MODE");
+ if (!alwaysDoSet) {
+ qCDebug(qLcEglfsKmsDebug, "Mode already set, skipping modesetting for screen %s", qPrintable(name()));
+ doModeSet = false;
+ }
+ }
- if (m_gbm_surface) {
- gbm_surface_destroy(m_gbm_surface);
- m_gbm_surface = Q_NULLPTR;
+ if (doModeSet) {
+ qCDebug(qLcEglfsKmsDebug, "Setting mode for screen %s", qPrintable(name()));
+ int ret = drmModeSetCrtc(fd,
+ op.crtc_id,
+ fb,
+ 0, 0,
+ &op.connector_id, 1,
+ &op.modes[op.mode]);
+
+ if (ret == 0)
+ setPowerState(PowerStateOn);
+ else
+ qErrnoWarning(errno, "Could not set DRM mode for screen %s", qPrintable(name()));
+ }
}
}
void QEglFSKmsGbmScreen::waitForFlip()
{
+ if (m_headless || m_cloneSource)
+ return;
+
// Don't lock the mutex unless we actually need to
if (!m_gbm_bo_next)
return;
QMutexLocker lock(&m_waitForFlipMutex);
- while (m_gbm_bo_next)
- static_cast<QEglFSKmsGbmDevice *>(device())->handleDrmEvent();
+ while (m_gbm_bo_next) {
+ drmEventContext drmEvent;
+ memset(&drmEvent, 0, sizeof(drmEvent));
+ drmEvent.version = 2;
+ drmEvent.vblank_handler = nullptr;
+ drmEvent.page_flip_handler = pageFlipHandler;
+ drmHandleEvent(device()->fd(), &drmEvent);
+ }
}
void QEglFSKmsGbmScreen::flip()
{
+ // For headless screen just return silently. It is not necessarily an error
+ // to end up here, so show no warnings.
+ if (m_headless)
+ return;
+
+ if (m_cloneSource) {
+ qWarning("Screen %s clones another screen. swapBuffers() not allowed.", qPrintable(name()));
+ return;
+ }
+
if (!m_gbm_surface) {
qWarning("Cannot sync before platform init!");
return;
@@ -185,60 +269,92 @@ void QEglFSKmsGbmScreen::flip()
}
FrameBuffer *fb = framebufferForBufferObject(m_gbm_bo_next);
+ ensureModeSet(fb->fb);
QKmsOutput &op(output());
const int fd = device()->fd();
- const uint32_t w = op.modes[op.mode].hdisplay;
- const uint32_t h = op.modes[op.mode].vdisplay;
-
- if (!op.mode_set) {
- int ret = drmModeSetCrtc(fd,
- op.crtc_id,
- fb->fb,
- 0, 0,
- &op.connector_id, 1,
- &op.modes[op.mode]);
-
- if (ret == -1) {
- qErrnoWarning(errno, "Could not set DRM mode!");
- } else {
- op.mode_set = true;
- setPowerState(PowerStateOn);
-
- if (!op.plane_set) {
- op.plane_set = true;
- if (op.wants_plane) {
- int ret = drmModeSetPlane(fd, op.plane_id, op.crtc_id,
- uint32_t(-1), 0,
- 0, 0, w, h,
- 0 << 16, 0 << 16, w << 16, h << 16);
- if (ret == -1)
- qErrnoWarning(errno, "drmModeSetPlane failed");
- }
- }
- }
- }
-
+ m_flipPending = true;
int ret = drmModePageFlip(fd,
op.crtc_id,
fb->fb,
DRM_MODE_PAGE_FLIP_EVENT,
this);
if (ret) {
- qErrnoWarning("Could not queue DRM page flip!");
+ qErrnoWarning("Could not queue DRM page flip on screen %s", qPrintable(name()));
+ m_flipPending = false;
gbm_surface_release_buffer(m_gbm_surface, m_gbm_bo_next);
- m_gbm_bo_next = Q_NULLPTR;
+ m_gbm_bo_next = nullptr;
+ return;
+ }
+
+ for (CloneDestination &d : m_cloneDests) {
+ if (d.screen != this) {
+ d.screen->ensureModeSet(fb->fb);
+ d.cloneFlipPending = true;
+ int ret = drmModePageFlip(fd,
+ d.screen->output().crtc_id,
+ fb->fb,
+ DRM_MODE_PAGE_FLIP_EVENT,
+ d.screen);
+ if (ret) {
+ qErrnoWarning("Could not queue DRM page flip for clone screen %s", qPrintable(name()));
+ d.cloneFlipPending = false;
+ }
+ }
}
}
+void QEglFSKmsGbmScreen::pageFlipHandler(int fd, unsigned int sequence, unsigned int tv_sec, unsigned int tv_usec, void *user_data)
+{
+ Q_UNUSED(fd);
+ Q_UNUSED(sequence);
+ Q_UNUSED(tv_sec);
+ Q_UNUSED(tv_usec);
+
+ QEglFSKmsGbmScreen *screen = static_cast<QEglFSKmsGbmScreen *>(user_data);
+ screen->flipFinished();
+}
+
void QEglFSKmsGbmScreen::flipFinished()
{
+ if (m_cloneSource) {
+ m_cloneSource->cloneDestFlipFinished(this);
+ return;
+ }
+
+ m_flipPending = false;
+ updateFlipStatus();
+}
+
+void QEglFSKmsGbmScreen::cloneDestFlipFinished(QEglFSKmsGbmScreen *cloneDestScreen)
+{
+ for (CloneDestination &d : m_cloneDests) {
+ if (d.screen == cloneDestScreen) {
+ d.cloneFlipPending = false;
+ break;
+ }
+ }
+ updateFlipStatus();
+}
+
+void QEglFSKmsGbmScreen::updateFlipStatus()
+{
+ Q_ASSERT(!m_cloneSource);
+
+ if (m_flipPending)
+ return;
+
+ for (const CloneDestination &d : m_cloneDests) {
+ if (d.cloneFlipPending)
+ return;
+ }
+
if (m_gbm_bo_current)
gbm_surface_release_buffer(m_gbm_surface,
m_gbm_bo_current);
m_gbm_bo_current = m_gbm_bo_next;
- m_gbm_bo_next = Q_NULLPTR;
+ m_gbm_bo_next = nullptr;
}
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.h b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.h
index 341cc95bbe..f5a2122723 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.h
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.h
@@ -54,34 +54,54 @@ class QEglFSKmsGbmCursor;
class QEglFSKmsGbmScreen : public QEglFSKmsScreen
{
public:
- QEglFSKmsGbmScreen(QKmsDevice *device, const QKmsOutput &output);
+ QEglFSKmsGbmScreen(QKmsDevice *device, const QKmsOutput &output, bool headless);
~QEglFSKmsGbmScreen();
QPlatformCursor *cursor() const override;
- gbm_surface *surface() const { return m_gbm_surface; }
gbm_surface *createSurface();
- void destroySurface();
+ void resetSurface();
+
+ void initCloning(QPlatformScreen *screenThisScreenClones,
+ const QVector<QPlatformScreen *> &screensCloningThisScreen);
void waitForFlip() override;
- void flip() override;
- void flipFinished() override;
+
+ void flip();
private:
+ void flipFinished();
+ void ensureModeSet(uint32_t fb);
+ void cloneDestFlipFinished(QEglFSKmsGbmScreen *cloneDestScreen);
+ void updateFlipStatus();
+
+ static void pageFlipHandler(int fd,
+ unsigned int sequence,
+ unsigned int tv_sec,
+ unsigned int tv_usec,
+ void *user_data);
+
gbm_surface *m_gbm_surface;
gbm_bo *m_gbm_bo_current;
gbm_bo *m_gbm_bo_next;
+ bool m_flipPending;
QScopedPointer<QEglFSKmsGbmCursor> m_cursor;
struct FrameBuffer {
- FrameBuffer() : fb(0) {}
- uint32_t fb;
+ uint32_t fb = 0;
};
static void bufferDestroyedHandler(gbm_bo *bo, void *data);
FrameBuffer *framebufferForBufferObject(gbm_bo *bo);
+ QEglFSKmsGbmScreen *m_cloneSource;
+ struct CloneDestination {
+ QEglFSKmsGbmScreen *screen = nullptr;
+ bool cloneFlipPending = false;
+ };
+ QVector<CloneDestination> m_cloneDests;
+
static QMutex m_waitForFlipMutex;
};
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmwindow.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmwindow.cpp
new file mode 100644
index 0000000000..110a592dec
--- /dev/null
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmwindow.cpp
@@ -0,0 +1,80 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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 "qeglfskmsgbmwindow.h"
+#include "qeglfskmsgbmintegration.h"
+#include "qeglfskmsgbmscreen.h"
+
+#include <QtEglSupport/private/qeglconvenience_p.h>
+
+QT_BEGIN_NAMESPACE
+
+void QEglFSKmsGbmWindow::resetSurface()
+{
+ QEglFSKmsGbmScreen *gbmScreen = static_cast<QEglFSKmsGbmScreen *>(screen());
+ EGLDisplay display = gbmScreen->display();
+ QSurfaceFormat platformFormat = m_integration->surfaceFormatFor(window()->requestedFormat());
+ m_config = QEglFSDeviceIntegration::chooseConfig(display, platformFormat);
+ m_format = q_glFormatFromConfig(display, m_config, platformFormat);
+ // One fullscreen window per screen -> the native window is simply the gbm_surface the screen created.
+ m_window = reinterpret_cast<EGLNativeWindowType>(gbmScreen->createSurface());
+
+ PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC createPlatformWindowSurface = nullptr;
+ const char *extensions = eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS);
+ if (extensions && (strstr(extensions, "EGL_KHR_platform_gbm") || strstr(extensions, "EGL_MESA_platform_gbm"))) {
+ createPlatformWindowSurface = reinterpret_cast<PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC>(
+ eglGetProcAddress("eglCreatePlatformWindowSurfaceEXT"));
+ }
+
+ if (createPlatformWindowSurface) {
+ m_surface = createPlatformWindowSurface(display, m_config, reinterpret_cast<void *>(m_window), nullptr);
+ } else {
+ qCDebug(qLcEglfsKmsDebug, "No eglCreatePlatformWindowSurface for GBM, falling back to eglCreateWindowSurface");
+ m_surface = eglCreateWindowSurface(display, m_config, m_window, nullptr);
+ }
+}
+
+void QEglFSKmsGbmWindow::invalidateSurface()
+{
+ QEglFSKmsGbmScreen *gbmScreen = static_cast<QEglFSKmsGbmScreen *>(screen());
+ QEglFSWindow::invalidateSurface();
+ gbmScreen->resetSurface();
+}
+
+QT_END_NAMESPACE
diff --git a/src/plugins/platforms/windows/accessible/comutils.h b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmwindow.h
index b1e6183a0f..a19cf7e8bc 100644
--- a/src/plugins/platforms/windows/accessible/comutils.h
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmwindow.h
@@ -1,6 +1,8 @@
/****************************************************************************
**
+** Copyright (C) 2015 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2016 Pelagicore AG
** Contact: https://www.qt.io/licensing/
**
** This file is part of the plugins of the Qt Toolkit.
@@ -36,29 +38,30 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-#ifndef COMUTILS_H
-#define COMUTILS_H
-#if !defined(_WINDOWS_) && !defined(_WINDOWS_H) && !defined(__WINDOWS__)
-#error Must include windows.h first!
-#endif
+#ifndef QEGLFSKMSGBMWINDOW_H
+#define QEGLFSKMSGBMWINDOW_H
-#include <ocidl.h>
-#include <QtCore/qstring.h>
+#include "private/qeglfswindow_p.h"
QT_BEGIN_NAMESPACE
-class QVariant;
+class QEglFSKmsGbmIntegration;
-// Originally QVariantToVARIANT copied from ActiveQt - renamed to avoid conflicts in static builds.
-bool QVariant2VARIANT(const QVariant &var, VARIANT &arg, const QByteArray &typeName, bool out);
-
-inline BSTR QStringToBSTR(const QString &str)
+class QEglFSKmsGbmWindow : public QEglFSWindow
{
- return SysAllocStringLen(reinterpret_cast<const OLECHAR *>(str.unicode()), UINT(str.length()));
-}
+public:
+ QEglFSKmsGbmWindow(QWindow *w, const QEglFSKmsGbmIntegration *integration)
+ : QEglFSWindow(w),
+ m_integration(integration)
+ { }
+ void resetSurface() override;
+ void invalidateSurface() override;
-QT_END_NAMESPACE
+private:
+ const QEglFSKmsGbmIntegration *m_integration;
+};
-#endif // COMUTILS_H
+QT_END_NAMESPACE
+#endif // QEGLFSKMSGBMWINDOW_H
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldevice.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldevice.cpp
index cca413ff2d..8c8e6260f1 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldevice.cpp
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldevice.cpp
@@ -58,7 +58,7 @@ bool QEglFSKmsEglDevice::open()
{
Q_ASSERT(fd() == -1);
- int fd = drmOpen(devicePath().toLocal8Bit().constData(), Q_NULLPTR);
+ int fd = drmOpen(devicePath().toLocal8Bit().constData(), nullptr);
if (Q_UNLIKELY(fd < 0))
qFatal("Could not open DRM (NV) device");
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 3af21d768e..a67457a6a5 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp
@@ -51,7 +51,7 @@ QT_BEGIN_NAMESPACE
QEglFSKmsEglDeviceIntegration::QEglFSKmsEglDeviceIntegration()
: m_egl_device(EGL_NO_DEVICE_EXT)
- , m_funcs(Q_NULLPTR)
+ , m_funcs(nullptr)
{
qCDebug(qLcEglfsKmsDebug, "New DRM/KMS on EGLDevice integration created");
}
@@ -75,7 +75,7 @@ EGLDisplay QEglFSKmsEglDeviceIntegration::createDisplay(EGLNativeDisplayType nat
EGLDisplay display;
if (m_funcs->has_egl_platform_device) {
- display = m_funcs->get_platform_display(EGL_PLATFORM_DEVICE_EXT, nativeDisplay, Q_NULLPTR);
+ display = m_funcs->get_platform_display(EGL_PLATFORM_DEVICE_EXT, nativeDisplay, nullptr);
} else {
qWarning("EGL_EXT_platform_device not available, falling back to legacy path!");
display = eglGetDisplay(nativeDisplay);
@@ -162,7 +162,7 @@ void QEglFSKmsEglDeviceWindow::resetSurface()
qCDebug(qLcEglfsKmsDebug, "Could not query number of EGLStream FIFO frames");
}
- if (!m_integration->m_funcs->get_output_layers(display, Q_NULLPTR, Q_NULLPTR, 0, &count) || count == 0) {
+ if (!m_integration->m_funcs->get_output_layers(display, nullptr, nullptr, 0, &count) || count == 0) {
qWarning("No output layers found");
return;
}
@@ -172,7 +172,7 @@ void QEglFSKmsEglDeviceWindow::resetSurface()
QVector<EGLOutputLayerEXT> layers;
layers.resize(count);
EGLint actualCount;
- if (!m_integration->m_funcs->get_output_layers(display, Q_NULLPTR, layers.data(), count, &actualCount)) {
+ if (!m_integration->m_funcs->get_output_layers(display, nullptr, layers.data(), count, &actualCount)) {
qWarning("Failed to get layers");
return;
}
@@ -180,7 +180,7 @@ void QEglFSKmsEglDeviceWindow::resetSurface()
QEglFSKmsEglDeviceScreen *cur_screen = static_cast<QEglFSKmsEglDeviceScreen *>(screen());
Q_ASSERT(cur_screen);
QKmsOutput &output(cur_screen->output());
- const uint32_t wantedId = !output.wants_plane ? output.crtc_id : output.plane_id;
+ const uint32_t wantedId = !output.wants_forced_plane ? output.crtc_id : output.forced_plane_id;
qCDebug(qLcEglfsKmsDebug, "Searching for id: %d", wantedId);
EGLOutputLayerEXT layer = EGL_NO_OUTPUT_LAYER_EXT;
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldevicescreen.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldevicescreen.cpp
index a27c89faab..531b73d1dc 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldevicescreen.cpp
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldevicescreen.cpp
@@ -105,12 +105,12 @@ void QEglFSKmsEglDeviceScreen::waitForFlip()
qErrnoWarning(errno, "drmModeSetCrtc failed");
}
- if (!op.plane_set) {
- op.plane_set = true;
+ if (!op.forced_plane_set) {
+ op.forced_plane_set = true;
- if (op.wants_plane) {
- qCDebug(qLcEglfsKmsDebug, "Setting plane %u", op.plane_id);
- int ret = drmModeSetPlane(fd, op.plane_id, op.crtc_id, uint32_t(-1), 0,
+ if (op.wants_forced_plane) {
+ qCDebug(qLcEglfsKmsDebug, "Setting plane %u", op.forced_plane_id);
+ int ret = drmModeSetPlane(fd, op.forced_plane_id, op.crtc_id, uint32_t(-1), 0,
0, 0, w, h,
0 << 16, 0 << 16, w << 16, h << 16);
if (ret == -1)
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsintegration.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsintegration.cpp
index c77151181e..975b1947bf 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsintegration.cpp
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsintegration.cpp
@@ -55,7 +55,7 @@ QT_BEGIN_NAMESPACE
Q_LOGGING_CATEGORY(qLcEglfsKmsDebug, "qt.qpa.eglfs.kms")
QEglFSKmsIntegration::QEglFSKmsIntegration()
- : m_device(Q_NULLPTR),
+ : m_device(nullptr),
m_screenConfig(new QKmsScreenConfig)
{
}
@@ -78,7 +78,7 @@ void QEglFSKmsIntegration::platformDestroy()
qCDebug(qLcEglfsKmsDebug, "platformDestroy: Closing DRM device");
m_device->close();
delete m_device;
- m_device = Q_NULLPTR;
+ m_device = nullptr;
}
EGLNativeDisplayType QEglFSKmsIntegration::platformDisplay() const
@@ -133,6 +133,14 @@ bool QEglFSKmsIntegration::supportsPBuffers() const
return m_screenConfig->supportsPBuffers();
}
+void *QEglFSKmsIntegration::nativeResourceForIntegration(const QByteArray &name)
+{
+ if (name == QByteArrayLiteral("dri_fd") && m_device)
+ return (void *) (qintptr) m_device->fd();
+
+ return nullptr;
+}
+
QKmsDevice *QEglFSKmsIntegration::device() const
{
return m_device;
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsintegration.h b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsintegration.h
index 9955616919..26ba2fdaec 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsintegration.h
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsintegration.h
@@ -69,6 +69,7 @@ public:
bool hasCapability(QPlatformIntegration::Capability cap) const override;
void waitForVSync(QPlatformSurface *surface) const override;
bool supportsPBuffers() const override;
+ void *nativeResourceForIntegration(const QByteArray &name) override;
QKmsDevice *device() const;
QKmsScreenConfig *screenConfig() const;
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsscreen.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsscreen.cpp
index 734f5cd611..5e45b42abe 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsscreen.cpp
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsscreen.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
+** Copyright (C) 2017 The Qt Company Ltd.
** Copyright (C) 2017 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
-** Copyright (C) 2016 The Qt Company Ltd.
** Copyright (C) 2016 Pelagicore AG
** Contact: https://www.qt.io/licensing/
**
@@ -68,12 +68,13 @@ private:
QEglFSKmsScreen *m_screen;
};
-QEglFSKmsScreen::QEglFSKmsScreen(QKmsDevice *device, const QKmsOutput &output)
+QEglFSKmsScreen::QEglFSKmsScreen(QKmsDevice *device, const QKmsOutput &output, bool headless)
: QEglFSScreen(static_cast<QEglFSIntegration *>(QGuiApplicationPrivate::platformIntegration())->display())
, m_device(device)
, m_output(output)
, m_powerState(PowerStateOn)
, m_interruptHandler(new QEglFSKmsInterruptHandler(this))
+ , m_headless(headless)
{
m_siblings << this; // gets overridden later
@@ -109,6 +110,9 @@ void QEglFSKmsScreen::setVirtualPosition(const QPoint &pos)
// geometry() calls rawGeometry() and may apply additional transforms.
QRect QEglFSKmsScreen::rawGeometry() const
{
+ if (m_headless)
+ return QRect(QPoint(0, 0), m_device->screenConfig()->headlessSize());
+
const int mode = m_output.mode;
return QRect(m_pos.x(), m_pos.y(),
m_output.modes[mode].hdisplay,
@@ -117,12 +121,30 @@ QRect QEglFSKmsScreen::rawGeometry() const
int QEglFSKmsScreen::depth() const
{
- return 32;
+ return format() == QImage::Format_RGB16 ? 16 : 32;
}
QImage::Format QEglFSKmsScreen::format() const
{
- return QImage::Format_RGB32;
+ // the result can be slightly incorrect, it won't matter in practice
+ switch (m_output.drm_format) {
+ case DRM_FORMAT_ARGB8888:
+ case DRM_FORMAT_ABGR8888:
+ return QImage::Format_ARGB32;
+ case DRM_FORMAT_RGB565:
+ case DRM_FORMAT_BGR565:
+ return QImage::Format_RGB16;
+ case DRM_FORMAT_XRGB2101010:
+ return QImage::Format_RGB30;
+ case DRM_FORMAT_XBGR2101010:
+ return QImage::Format_BGR30;
+ case DRM_FORMAT_ARGB2101010:
+ return QImage::Format_A2RGB30_Premultiplied;
+ case DRM_FORMAT_ABGR2101010:
+ return QImage::Format_A2BGR30_Premultiplied;
+ default:
+ return QImage::Format_RGB32;
+ }
}
QSizeF QEglFSKmsScreen::physicalSize() const
@@ -159,7 +181,7 @@ Qt::ScreenOrientation QEglFSKmsScreen::orientation() const
QString QEglFSKmsScreen::name() const
{
- return m_output.name;
+ return !m_headless ? m_output.name : QStringLiteral("qt_Headless");
}
QString QEglFSKmsScreen::manufacturer() const
@@ -177,22 +199,10 @@ QString QEglFSKmsScreen::serialNumber() const
return m_edid.serialNumber;
}
-void QEglFSKmsScreen::destroySurface()
-{
-}
-
void QEglFSKmsScreen::waitForFlip()
{
}
-void QEglFSKmsScreen::flip()
-{
-}
-
-void QEglFSKmsScreen::flipFinished()
-{
-}
-
void QEglFSKmsScreen::restoreMode()
{
m_output.restoreMode(m_device);
@@ -200,6 +210,9 @@ void QEglFSKmsScreen::restoreMode()
qreal QEglFSKmsScreen::refreshRate() const
{
+ if (m_headless)
+ return 60;
+
quint32 refresh = m_output.modes[m_output.mode].vrefresh;
return refresh > 0 ? refresh : 60;
}
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsscreen.h b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsscreen.h
index 4e09929189..7f395aacb7 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsscreen.h
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsscreen.h
@@ -56,7 +56,7 @@ class QEglFSKmsInterruptHandler;
class Q_EGLFS_EXPORT QEglFSKmsScreen : public QEglFSScreen
{
public:
- QEglFSKmsScreen(QKmsDevice *device, const QKmsOutput &output);
+ QEglFSKmsScreen(QKmsDevice *device, const QKmsOutput &output, bool headless = false);
~QEglFSKmsScreen();
void setVirtualPosition(const QPoint &pos);
@@ -89,11 +89,7 @@ public:
QKmsDevice *device() const { return m_device; }
- void destroySurface();
-
virtual void waitForFlip();
- virtual void flip();
- virtual void flipFinished();
QKmsOutput &output() { return m_output; }
void restoreMode();
@@ -115,6 +111,8 @@ protected:
PowerState m_powerState;
QEglFSKmsInterruptHandler *m_interruptHandler;
+
+ bool m_headless;
};
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/haiku/main.cpp b/src/plugins/platforms/haiku/main.cpp
index 02168d0165..841891970d 100644
--- a/src/plugins/platforms/haiku/main.cpp
+++ b/src/plugins/platforms/haiku/main.cpp
@@ -47,7 +47,7 @@ QPlatformIntegration *QHaikuIntegrationPlugin::create(const QString& system, con
if (!system.compare(QLatin1String("haiku"), Qt::CaseInsensitive))
return new QHaikuIntegration(paramList);
- return Q_NULLPTR;
+ return nullptr;
}
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/haiku/main.h b/src/plugins/platforms/haiku/main.h
index 82f3313652..e316b79d7c 100644
--- a/src/plugins/platforms/haiku/main.h
+++ b/src/plugins/platforms/haiku/main.h
@@ -47,7 +47,7 @@ class QHaikuIntegrationPlugin : public QPlatformIntegrationPlugin
Q_PLUGIN_METADATA(IID QPlatformIntegrationFactoryInterface_iid FILE "haiku.json")
public:
- QPlatformIntegration *create(const QString&, const QStringList&) Q_DECL_OVERRIDE;
+ QPlatformIntegration *create(const QString&, const QStringList&) override;
};
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/haiku/qhaikuapplication.h b/src/plugins/platforms/haiku/qhaikuapplication.h
index 0696df8109..a9ea442691 100644
--- a/src/plugins/platforms/haiku/qhaikuapplication.h
+++ b/src/plugins/platforms/haiku/qhaikuapplication.h
@@ -49,8 +49,8 @@ class QHaikuApplication : public BApplication
public:
explicit QHaikuApplication(const char *signature);
- bool QuitRequested() Q_DECL_OVERRIDE;
- void RefsReceived(BMessage* message) Q_DECL_OVERRIDE;
+ bool QuitRequested() override;
+ void RefsReceived(BMessage* message) override;
};
#endif
diff --git a/src/plugins/platforms/haiku/qhaikubuffer.cpp b/src/plugins/platforms/haiku/qhaikubuffer.cpp
index c6f6ffe6bc..f25ddef86b 100644
--- a/src/plugins/platforms/haiku/qhaikubuffer.cpp
+++ b/src/plugins/platforms/haiku/qhaikubuffer.cpp
@@ -45,7 +45,7 @@
QT_BEGIN_NAMESPACE
QHaikuBuffer::QHaikuBuffer()
- : m_buffer(Q_NULLPTR)
+ : m_buffer(nullptr)
{
}
@@ -63,12 +63,12 @@ BBitmap* QHaikuBuffer::nativeBuffer() const
const QImage *QHaikuBuffer::image() const
{
- return (m_buffer != Q_NULLPTR) ? &m_image : Q_NULLPTR;
+ return (m_buffer != nullptr) ? &m_image : nullptr;
}
QImage *QHaikuBuffer::image()
{
- return (m_buffer != Q_NULLPTR) ? &m_image : Q_NULLPTR;
+ return (m_buffer != nullptr) ? &m_image : nullptr;
}
QRect QHaikuBuffer::rect() const
diff --git a/src/plugins/platforms/haiku/qhaikuclipboard.cpp b/src/plugins/platforms/haiku/qhaikuclipboard.cpp
index 774da4432a..20519e21d0 100644
--- a/src/plugins/platforms/haiku/qhaikuclipboard.cpp
+++ b/src/plugins/platforms/haiku/qhaikuclipboard.cpp
@@ -47,8 +47,8 @@
#include <Clipboard.h>
QHaikuClipboard::QHaikuClipboard()
- : m_systemMimeData(Q_NULLPTR)
- , m_userMimeData(Q_NULLPTR)
+ : m_systemMimeData(nullptr)
+ , m_userMimeData(nullptr)
{
if (be_clipboard)
be_clipboard->StartWatching(BMessenger(this));
@@ -81,12 +81,12 @@ QMimeData *QHaikuClipboard::mimeData(QClipboard::Mode mode)
const BMessage *clipboard = be_clipboard->Data();
if (clipboard) {
- char *name = Q_NULLPTR;
+ char *name = nullptr;
uint32 type = 0;
int32 count = 0;
for (int i = 0; clipboard->GetInfo(B_MIME_TYPE, i, &name, &type, &count) == B_OK; i++) {
- const void *data = Q_NULLPTR;
+ const void *data = nullptr;
int32 dataLen = 0;
const status_t status = clipboard->FindData(name, B_MIME_TYPE, &data, &dataLen);
@@ -162,7 +162,7 @@ void QHaikuClipboard::MessageReceived(BMessage* message)
{
if (message->what == B_CLIPBOARD_CHANGED) {
delete m_userMimeData;
- m_userMimeData = Q_NULLPTR;
+ m_userMimeData = nullptr;
emitChanged(QClipboard::Clipboard);
}
diff --git a/src/plugins/platforms/haiku/qhaikuclipboard.h b/src/plugins/platforms/haiku/qhaikuclipboard.h
index 3dd4496e8d..b6eb3f591f 100644
--- a/src/plugins/platforms/haiku/qhaikuclipboard.h
+++ b/src/plugins/platforms/haiku/qhaikuclipboard.h
@@ -54,13 +54,13 @@ public:
QHaikuClipboard();
~QHaikuClipboard();
- QMimeData *mimeData(QClipboard::Mode mode = QClipboard::Clipboard) Q_DECL_OVERRIDE;
- void setMimeData(QMimeData *data, QClipboard::Mode mode = QClipboard::Clipboard) Q_DECL_OVERRIDE;
- bool supportsMode(QClipboard::Mode mode) const Q_DECL_OVERRIDE;
- bool ownsMode(QClipboard::Mode mode) const Q_DECL_OVERRIDE;
+ QMimeData *mimeData(QClipboard::Mode mode = QClipboard::Clipboard) override;
+ void setMimeData(QMimeData *data, QClipboard::Mode mode = QClipboard::Clipboard) override;
+ bool supportsMode(QClipboard::Mode mode) const override;
+ bool ownsMode(QClipboard::Mode mode) const override;
// override from BHandler to catch change notifications from Haiku clipboard
- void MessageReceived(BMessage* message) Q_DECL_OVERRIDE;
+ void MessageReceived(BMessage* message) override;
private:
QMimeData *m_systemMimeData;
diff --git a/src/plugins/platforms/haiku/qhaikucursor.h b/src/plugins/platforms/haiku/qhaikucursor.h
index 5d70c97d9e..73a1d2c492 100644
--- a/src/plugins/platforms/haiku/qhaikucursor.h
+++ b/src/plugins/platforms/haiku/qhaikucursor.h
@@ -52,7 +52,7 @@ public:
QHaikuCursor();
#ifndef QT_NO_CURSOR
- void changeCursor(QCursor *windowCursor, QWindow *window) Q_DECL_OVERRIDE;
+ void changeCursor(QCursor *windowCursor, QWindow *window) override;
#endif
private:
diff --git a/src/plugins/platforms/haiku/qhaikuintegration.cpp b/src/plugins/platforms/haiku/qhaikuintegration.cpp
index d46d77ff18..8bd2171794 100644
--- a/src/plugins/platforms/haiku/qhaikuintegration.cpp
+++ b/src/plugins/platforms/haiku/qhaikuintegration.cpp
@@ -87,13 +87,13 @@ QHaikuIntegration::QHaikuIntegration(const QStringList &parameters)
QHaikuIntegration::~QHaikuIntegration()
{
destroyScreen(m_screen);
- m_screen = Q_NULLPTR;
+ m_screen = nullptr;
delete m_services;
- m_services = Q_NULLPTR;
+ m_services = nullptr;
delete m_clipboard;
- m_clipboard = Q_NULLPTR;
+ m_clipboard = nullptr;
be_app->LockLooper();
be_app->Quit();
diff --git a/src/plugins/platforms/haiku/qhaikuintegration.h b/src/plugins/platforms/haiku/qhaikuintegration.h
index 1b938acb82..5c7a173c91 100644
--- a/src/plugins/platforms/haiku/qhaikuintegration.h
+++ b/src/plugins/platforms/haiku/qhaikuintegration.h
@@ -54,17 +54,17 @@ public:
explicit QHaikuIntegration(const QStringList &paramList);
~QHaikuIntegration();
- bool hasCapability(QPlatformIntegration::Capability cap) const Q_DECL_OVERRIDE;
+ bool hasCapability(QPlatformIntegration::Capability cap) const override;
- QPlatformWindow *createPlatformWindow(QWindow *window) const Q_DECL_OVERRIDE;
- QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const Q_DECL_OVERRIDE;
- QAbstractEventDispatcher *createEventDispatcher() const Q_DECL_OVERRIDE;
+ QPlatformWindow *createPlatformWindow(QWindow *window) const override;
+ QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const override;
+ QAbstractEventDispatcher *createEventDispatcher() const override;
- QPlatformFontDatabase *fontDatabase() const Q_DECL_OVERRIDE;
- QPlatformServices *services() const Q_DECL_OVERRIDE;
+ QPlatformFontDatabase *fontDatabase() const override;
+ QPlatformServices *services() const override;
#ifndef QT_NO_CLIPBOARD
- QPlatformClipboard *clipboard() const Q_DECL_OVERRIDE;
+ QPlatformClipboard *clipboard() const override;
#endif
private:
diff --git a/src/plugins/platforms/haiku/qhaikurasterbackingstore.cpp b/src/plugins/platforms/haiku/qhaikurasterbackingstore.cpp
index ee53f693cd..613ae471cb 100644
--- a/src/plugins/platforms/haiku/qhaikurasterbackingstore.cpp
+++ b/src/plugins/platforms/haiku/qhaikurasterbackingstore.cpp
@@ -47,14 +47,14 @@ QT_BEGIN_NAMESPACE
QHaikuRasterBackingStore::QHaikuRasterBackingStore(QWindow *window)
: QPlatformBackingStore(window)
- , m_bitmap(Q_NULLPTR)
+ , m_bitmap(nullptr)
{
}
QHaikuRasterBackingStore::~QHaikuRasterBackingStore()
{
delete m_bitmap;
- m_bitmap = Q_NULLPTR;
+ m_bitmap = nullptr;
}
QPaintDevice *QHaikuRasterBackingStore::paintDevice()
@@ -62,7 +62,7 @@ QPaintDevice *QHaikuRasterBackingStore::paintDevice()
if (!m_bufferSize.isEmpty() && m_bitmap)
return m_buffer.image();
- return Q_NULLPTR;
+ return nullptr;
}
void QHaikuRasterBackingStore::flush(QWindow *window, const QRegion &region, const QPoint &offset)
diff --git a/src/plugins/platforms/haiku/qhaikurasterbackingstore.h b/src/plugins/platforms/haiku/qhaikurasterbackingstore.h
index 06a46e7eb3..060ab27126 100644
--- a/src/plugins/platforms/haiku/qhaikurasterbackingstore.h
+++ b/src/plugins/platforms/haiku/qhaikurasterbackingstore.h
@@ -55,9 +55,9 @@ public:
explicit QHaikuRasterBackingStore(QWindow *window);
~QHaikuRasterBackingStore();
- QPaintDevice *paintDevice() Q_DECL_OVERRIDE;
- void flush(QWindow *window, const QRegion &region, const QPoint &offset) Q_DECL_OVERRIDE;
- void resize(const QSize &size, const QRegion &staticContents) Q_DECL_OVERRIDE;
+ QPaintDevice *paintDevice() override;
+ void flush(QWindow *window, const QRegion &region, const QPoint &offset) override;
+ void resize(const QSize &size, const QRegion &staticContents) override;
private:
BBitmap *m_bitmap;
diff --git a/src/plugins/platforms/haiku/qhaikurasterwindow.cpp b/src/plugins/platforms/haiku/qhaikurasterwindow.cpp
index 9834b7cbc7..7e57e67bab 100644
--- a/src/plugins/platforms/haiku/qhaikurasterwindow.cpp
+++ b/src/plugins/platforms/haiku/qhaikurasterwindow.cpp
@@ -211,7 +211,7 @@ void HaikuViewProxy::handleKeyEvent(QEvent::Type type, BMessage *message)
{
int32 key = 0;
uint32 code = 0;
- const char *bytes = Q_NULLPTR;
+ const char *bytes = nullptr;
QString text;
if (message) {
@@ -265,7 +265,7 @@ QHaikuRasterWindow::~QHaikuRasterWindow()
m_window->UnlockLooper();
delete m_view;
- m_view = Q_NULLPTR;
+ m_view = nullptr;
}
BView* QHaikuRasterWindow::nativeViewHandle() const
diff --git a/src/plugins/platforms/haiku/qhaikurasterwindow.h b/src/plugins/platforms/haiku/qhaikurasterwindow.h
index ae57e0f0e4..24b13aa122 100644
--- a/src/plugins/platforms/haiku/qhaikurasterwindow.h
+++ b/src/plugins/platforms/haiku/qhaikurasterwindow.h
@@ -51,15 +51,15 @@ class HaikuViewProxy : public QObject, public BView
Q_OBJECT
public:
- explicit HaikuViewProxy(BWindow *window, QObject *parent = Q_NULLPTR);
+ explicit HaikuViewProxy(BWindow *window, QObject *parent = nullptr);
- void MessageReceived(BMessage *message) Q_DECL_OVERRIDE;
- void Draw(BRect updateRect) Q_DECL_OVERRIDE;
- void MouseDown(BPoint pos) Q_DECL_OVERRIDE;
- void MouseUp(BPoint pos) Q_DECL_OVERRIDE;
- void MouseMoved(BPoint pos, uint32 code, const BMessage *dragMessage) Q_DECL_OVERRIDE;
- void KeyDown(const char *bytes, int32 numBytes) Q_DECL_OVERRIDE;
- void KeyUp(const char *bytes, int32 numBytes) Q_DECL_OVERRIDE;
+ void MessageReceived(BMessage *message) override;
+ void Draw(BRect updateRect) override;
+ void MouseDown(BPoint pos) override;
+ void MouseUp(BPoint pos) override;
+ void MouseMoved(BPoint pos, uint32 code, const BMessage *dragMessage) override;
+ void KeyDown(const char *bytes, int32 numBytes) override;
+ void KeyUp(const char *bytes, int32 numBytes) override;
Q_SIGNALS:
void mouseEvent(const QPoint &localPosition, const QPoint &globalPosition, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, Qt::MouseEventSource source);
diff --git a/src/plugins/platforms/haiku/qhaikuscreen.cpp b/src/plugins/platforms/haiku/qhaikuscreen.cpp
index 54951a0af5..2c8abba8aa 100644
--- a/src/plugins/platforms/haiku/qhaikuscreen.cpp
+++ b/src/plugins/platforms/haiku/qhaikuscreen.cpp
@@ -58,10 +58,10 @@ QHaikuScreen::QHaikuScreen()
QHaikuScreen::~QHaikuScreen()
{
delete m_cursor;
- m_cursor = Q_NULLPTR;
+ m_cursor = nullptr;
delete m_screen;
- m_screen = Q_NULLPTR;
+ m_screen = nullptr;
}
QPixmap QHaikuScreen::grabWindow(WId winId, int x, int y, int width, int height) const
@@ -69,8 +69,8 @@ QPixmap QHaikuScreen::grabWindow(WId winId, int x, int y, int width, int height)
if (width == 0 || height == 0)
return QPixmap();
- BScreen screen(Q_NULLPTR);
- BBitmap *bitmap = Q_NULLPTR;
+ BScreen screen(nullptr);
+ BBitmap *bitmap = nullptr;
screen.GetBitmap(&bitmap);
const BRect frame = (winId ? ((BWindow*)winId)->Frame() : screen.Frame());
diff --git a/src/plugins/platforms/haiku/qhaikuscreen.h b/src/plugins/platforms/haiku/qhaikuscreen.h
index 49fa3f0a60..98de6fdd03 100644
--- a/src/plugins/platforms/haiku/qhaikuscreen.h
+++ b/src/plugins/platforms/haiku/qhaikuscreen.h
@@ -53,13 +53,13 @@ public:
QHaikuScreen();
~QHaikuScreen();
- QPixmap grabWindow(WId window, int x, int y, int width, int height) const Q_DECL_OVERRIDE;
+ QPixmap grabWindow(WId window, int x, int y, int width, int height) const override;
- QRect geometry() const Q_DECL_OVERRIDE;
- int depth() const Q_DECL_OVERRIDE;
- QImage::Format format() const Q_DECL_OVERRIDE;
+ QRect geometry() const override;
+ int depth() const override;
+ QImage::Format format() const override;
- QPlatformCursor *cursor() const Q_DECL_OVERRIDE;
+ QPlatformCursor *cursor() const override;
private:
BScreen *m_screen;
diff --git a/src/plugins/platforms/haiku/qhaikuservices.h b/src/plugins/platforms/haiku/qhaikuservices.h
index a210eb8b61..59ff6395fb 100644
--- a/src/plugins/platforms/haiku/qhaikuservices.h
+++ b/src/plugins/platforms/haiku/qhaikuservices.h
@@ -47,10 +47,10 @@ QT_BEGIN_NAMESPACE
class QHaikuServices : public QPlatformServices
{
public:
- bool openUrl(const QUrl &url) Q_DECL_OVERRIDE;
- bool openDocument(const QUrl &url) Q_DECL_OVERRIDE;
+ bool openUrl(const QUrl &url) override;
+ bool openDocument(const QUrl &url) override;
- QByteArray desktopEnvironment() const Q_DECL_OVERRIDE;
+ QByteArray desktopEnvironment() const override;
};
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/haiku/qhaikuwindow.cpp b/src/plugins/platforms/haiku/qhaikuwindow.cpp
index 4bea7f7ff6..f8fdf3f92d 100644
--- a/src/plugins/platforms/haiku/qhaikuwindow.cpp
+++ b/src/plugins/platforms/haiku/qhaikuwindow.cpp
@@ -118,12 +118,12 @@ void HaikuWindowProxy::zoomByQt()
QHaikuWindow::QHaikuWindow(QWindow *window)
: QPlatformWindow(window)
- , m_window(Q_NULLPTR)
+ , m_window(nullptr)
, m_windowState(Qt::WindowNoState)
{
const QRect rect = initialGeometry(window, window->geometry(), DefaultWindowWidth, DefaultWindowHeight);
- HaikuWindowProxy *haikuWindow = new HaikuWindowProxy(window, rect, Q_NULLPTR);
+ HaikuWindowProxy *haikuWindow = new HaikuWindowProxy(window, rect, nullptr);
connect(haikuWindow, SIGNAL(moved(QPoint)), SLOT(haikuWindowMoved(QPoint)));
connect(haikuWindow, SIGNAL(resized(QSize,bool)), SLOT(haikuWindowResized(QSize,bool)));
connect(haikuWindow, SIGNAL(windowActivated(bool)), SLOT(haikuWindowActivated(bool)));
@@ -145,7 +145,7 @@ QHaikuWindow::~QHaikuWindow()
m_window->LockLooper();
m_window->Quit();
- m_window = Q_NULLPTR;
+ m_window = nullptr;
}
void QHaikuWindow::setGeometry(const QRect &rect)
@@ -330,7 +330,7 @@ void QHaikuWindow::haikuWindowResized(const QSize &size, bool zoomInProgress)
void QHaikuWindow::haikuWindowActivated(bool activated)
{
- QWindowSystemInterface::handleWindowActivated(activated ? window() : Q_NULLPTR);
+ QWindowSystemInterface::handleWindowActivated(activated ? window() : nullptr);
}
void QHaikuWindow::haikuWindowMinimized(bool minimize)
diff --git a/src/plugins/platforms/haiku/qhaikuwindow.h b/src/plugins/platforms/haiku/qhaikuwindow.h
index 5bfb99e532..bb57742087 100644
--- a/src/plugins/platforms/haiku/qhaikuwindow.h
+++ b/src/plugins/platforms/haiku/qhaikuwindow.h
@@ -51,14 +51,14 @@ class HaikuWindowProxy : public QObject, public BWindow
Q_OBJECT
public:
- explicit HaikuWindowProxy(QWindow *window, const QRect &rect, QObject *parent = Q_NULLPTR);
+ explicit HaikuWindowProxy(QWindow *window, const QRect &rect, QObject *parent = nullptr);
- void FrameMoved(BPoint pos) Q_DECL_OVERRIDE;
- void FrameResized(float width, float height) Q_DECL_OVERRIDE;
- void WindowActivated(bool activated) Q_DECL_OVERRIDE;
- void Minimize(bool minimize) Q_DECL_OVERRIDE;
- void Zoom(BPoint pos, float width, float height) Q_DECL_OVERRIDE;
- bool QuitRequested() Q_DECL_OVERRIDE;
+ void FrameMoved(BPoint pos) override;
+ void FrameResized(float width, float height) override;
+ void WindowActivated(bool activated) override;
+ void Minimize(bool minimize) override;
+ void Zoom(BPoint pos, float width, float height) override;
+ bool QuitRequested() override;
void zoomByQt();
@@ -83,23 +83,23 @@ public:
explicit QHaikuWindow(QWindow *window);
virtual ~QHaikuWindow();
- void setGeometry(const QRect &rect) Q_DECL_OVERRIDE;
- QMargins frameMargins() const Q_DECL_OVERRIDE;
- void setVisible(bool visible) Q_DECL_OVERRIDE;
+ void setGeometry(const QRect &rect) override;
+ QMargins frameMargins() const override;
+ void setVisible(bool visible) override;
- bool isExposed() const Q_DECL_OVERRIDE;
- bool isActive() const Q_DECL_OVERRIDE;
+ bool isExposed() const override;
+ bool isActive() const override;
- WId winId() const Q_DECL_OVERRIDE;
+ WId winId() const override;
BWindow* nativeHandle() const;
- void requestActivateWindow() Q_DECL_OVERRIDE;
- void setWindowState(Qt::WindowStates state) Q_DECL_OVERRIDE;
- void setWindowFlags(Qt::WindowFlags flags) Q_DECL_OVERRIDE;
+ void requestActivateWindow() override;
+ void setWindowState(Qt::WindowStates state) override;
+ void setWindowFlags(Qt::WindowFlags flags) override;
- void setWindowTitle(const QString &title) Q_DECL_OVERRIDE;
+ void setWindowTitle(const QString &title) override;
- void propagateSizeHints() Q_DECL_OVERRIDE;
+ void propagateSizeHints() override;
protected:
HaikuWindowProxy *m_window;
diff --git a/src/plugins/platforms/integrity/main.cpp b/src/plugins/platforms/integrity/main.cpp
index f75e227335..6313aa47e5 100644
--- a/src/plugins/platforms/integrity/main.cpp
+++ b/src/plugins/platforms/integrity/main.cpp
@@ -47,7 +47,7 @@ class QIntegrityFbIntegrationPlugin : public QPlatformIntegrationPlugin
Q_OBJECT
Q_PLUGIN_METADATA(IID QPlatformIntegrationFactoryInterface_iid FILE "integrity.json")
public:
- QPlatformIntegration *create(const QString&, const QStringList&) Q_DECL_OVERRIDE;
+ QPlatformIntegration *create(const QString&, const QStringList&) override;
};
QPlatformIntegration* QIntegrityFbIntegrationPlugin::create(const QString& system, const QStringList& paramList)
diff --git a/src/plugins/platforms/integrity/qintegrityfbintegration.h b/src/plugins/platforms/integrity/qintegrityfbintegration.h
index a954dc2356..d0cd5417ab 100644
--- a/src/plugins/platforms/integrity/qintegrityfbintegration.h
+++ b/src/plugins/platforms/integrity/qintegrityfbintegration.h
@@ -54,19 +54,19 @@ public:
QIntegrityFbIntegration(const QStringList &paramList);
~QIntegrityFbIntegration();
- void initialize() Q_DECL_OVERRIDE;
- bool hasCapability(QPlatformIntegration::Capability cap) const Q_DECL_OVERRIDE;
+ void initialize() override;
+ bool hasCapability(QPlatformIntegration::Capability cap) const override;
- QPlatformWindow *createPlatformWindow(QWindow *window) const Q_DECL_OVERRIDE;
- QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const Q_DECL_OVERRIDE;
+ QPlatformWindow *createPlatformWindow(QWindow *window) const override;
+ QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const override;
- QAbstractEventDispatcher *createEventDispatcher() const Q_DECL_OVERRIDE;
+ QAbstractEventDispatcher *createEventDispatcher() const override;
- QPlatformFontDatabase *fontDatabase() const Q_DECL_OVERRIDE;
- QPlatformServices *services() const Q_DECL_OVERRIDE;
- QPlatformInputContext *inputContext() const Q_DECL_OVERRIDE { return m_inputContext; }
+ QPlatformFontDatabase *fontDatabase() const override;
+ QPlatformServices *services() const override;
+ QPlatformInputContext *inputContext() const override { return m_inputContext; }
- QPlatformNativeInterface *nativeInterface() const Q_DECL_OVERRIDE;
+ QPlatformNativeInterface *nativeInterface() const override;
QList<QPlatformScreen *> screens() const;
diff --git a/src/plugins/platforms/integrity/qintegrityfbscreen.h b/src/plugins/platforms/integrity/qintegrityfbscreen.h
index 6bc78913c9..c38b4f073d 100644
--- a/src/plugins/platforms/integrity/qintegrityfbscreen.h
+++ b/src/plugins/platforms/integrity/qintegrityfbscreen.h
@@ -57,9 +57,9 @@ public:
bool initialize();
- QPixmap grabWindow(WId wid, int x, int y, int width, int height) const Q_DECL_OVERRIDE;
+ QPixmap grabWindow(WId wid, int x, int y, int width, int height) const override;
- QRegion doRedraw() Q_DECL_OVERRIDE;
+ QRegion doRedraw() override;
private:
QStringList mArgs;
diff --git a/src/plugins/platforms/integrity/qintegrityhidmanager.cpp b/src/plugins/platforms/integrity/qintegrityhidmanager.cpp
index 49583735f5..3570b90134 100644
--- a/src/plugins/platforms/integrity/qintegrityhidmanager.cpp
+++ b/src/plugins/platforms/integrity/qintegrityhidmanager.cpp
@@ -73,8 +73,8 @@ public:
{
CheckSuccess(gh_hid_close(handle));
};
- void process_event(void) Q_DECL_OVERRIDE;
- void async_wait(void) Q_DECL_OVERRIDE;
+ void process_event(void) override;
+ void async_wait(void) override;
HIDDriver *get_driver(void) { return driver; };
HIDHandle get_handle(void) { return handle; };
private:
@@ -92,8 +92,8 @@ public:
{
qDeleteAll(devices);
};
- void process_event(void) Q_DECL_OVERRIDE;
- void async_wait(void) Q_DECL_OVERRIDE;
+ void process_event(void) override;
+ void async_wait(void) override;
void find_devices(void);
private:
QHash<Value, HIDDeviceHandler *> devices;
diff --git a/src/plugins/platforms/ios/optional/nsphotolibrarysupport/qiosfileengineassetslibrary.mm b/src/plugins/platforms/ios/optional/nsphotolibrarysupport/qiosfileengineassetslibrary.mm
index bea2897240..54152aebf7 100644
--- a/src/plugins/platforms/ios/optional/nsphotolibrarysupport/qiosfileengineassetslibrary.mm
+++ b/src/plugins/platforms/ios/optional/nsphotolibrarysupport/qiosfileengineassetslibrary.mm
@@ -302,7 +302,7 @@ public:
g_iteratorCurrentUrl.setLocalData(QString());
}
- QString next() Q_DECL_OVERRIDE
+ QString next() override
{
// Cache the URL that we are about to return, since QDir will immediately create a
// new file engine on the file and ask if it exists. Unless we do this, we end up
@@ -314,17 +314,17 @@ public:
return url;
}
- bool hasNext() const Q_DECL_OVERRIDE
+ bool hasNext() const override
{
return m_enumerator->hasNext();
}
- QString currentFileName() const Q_DECL_OVERRIDE
+ QString currentFileName() const override
{
return g_iteratorCurrentUrl.localData();
}
- QFileInfo currentFileInfo() const Q_DECL_OVERRIDE
+ QFileInfo currentFileInfo() const override
{
return QFileInfo(currentFileName());
}
diff --git a/src/plugins/platforms/ios/qiosbackingstore.h b/src/plugins/platforms/ios/qiosbackingstore.h
index e6b890251a..38006ba90b 100644
--- a/src/plugins/platforms/ios/qiosbackingstore.h
+++ b/src/plugins/platforms/ios/qiosbackingstore.h
@@ -54,7 +54,7 @@ public:
QIOSBackingStore(QWindow *window);
~QIOSBackingStore();
- void flush(QWindow *window, const QRegion &region, const QPoint &offset) Q_DECL_OVERRIDE;
+ void flush(QWindow *window, const QRegion &region, const QPoint &offset) override;
};
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/ios/qiosclipboard.h b/src/plugins/platforms/ios/qiosclipboard.h
index f3ccfcace0..3fe9b29b71 100644
--- a/src/plugins/platforms/ios/qiosclipboard.h
+++ b/src/plugins/platforms/ios/qiosclipboard.h
@@ -58,10 +58,10 @@ public:
QIOSClipboard();
~QIOSClipboard();
- QMimeData *mimeData(QClipboard::Mode mode = QClipboard::Clipboard) Q_DECL_OVERRIDE;
- void setMimeData(QMimeData *mimeData, QClipboard::Mode mode = QClipboard::Clipboard) Q_DECL_OVERRIDE;
- bool supportsMode(QClipboard::Mode mode) const Q_DECL_OVERRIDE;
- bool ownsMode(QClipboard::Mode mode) const Q_DECL_OVERRIDE;
+ QMimeData *mimeData(QClipboard::Mode mode = QClipboard::Clipboard) override;
+ void setMimeData(QMimeData *mimeData, QClipboard::Mode mode = QClipboard::Clipboard) override;
+ bool supportsMode(QClipboard::Mode mode) const override;
+ bool ownsMode(QClipboard::Mode mode) const override;
private:
QUIClipboard *m_clipboard;
diff --git a/src/plugins/platforms/ios/qiosclipboard.mm b/src/plugins/platforms/ios/qiosclipboard.mm
index 15deb3332e..9a975eadc9 100644
--- a/src/plugins/platforms/ios/qiosclipboard.mm
+++ b/src/plugins/platforms/ios/qiosclipboard.mm
@@ -138,8 +138,8 @@ public:
QIOSMimeData(QClipboard::Mode mode) : QMimeData(), m_mode(mode) { }
~QIOSMimeData() { }
- QStringList formats() const Q_DECL_OVERRIDE;
- QVariant retrieveData(const QString &mimeType, QVariant::Type type) const Q_DECL_OVERRIDE;
+ QStringList formats() const override;
+ QVariant retrieveData(const QString &mimeType, QVariant::Type type) const override;
private:
const QClipboard::Mode m_mode;
diff --git a/src/plugins/platforms/ios/qioscontext.h b/src/plugins/platforms/ios/qioscontext.h
index 5b7917f7b4..7539e981c0 100644
--- a/src/plugins/platforms/ios/qioscontext.h
+++ b/src/plugins/platforms/ios/qioscontext.h
@@ -57,18 +57,18 @@ public:
QIOSContext(QOpenGLContext *context);
~QIOSContext();
- QSurfaceFormat format() const Q_DECL_OVERRIDE;
+ QSurfaceFormat format() const override;
- void swapBuffers(QPlatformSurface *surface) Q_DECL_OVERRIDE;
+ void swapBuffers(QPlatformSurface *surface) override;
- bool makeCurrent(QPlatformSurface *surface) Q_DECL_OVERRIDE;
- void doneCurrent() Q_DECL_OVERRIDE;
+ bool makeCurrent(QPlatformSurface *surface) override;
+ void doneCurrent() override;
- GLuint defaultFramebufferObject(QPlatformSurface *) const Q_DECL_OVERRIDE;
- QFunctionPointer getProcAddress(const char *procName) Q_DECL_OVERRIDE;
+ GLuint defaultFramebufferObject(QPlatformSurface *) const override;
+ QFunctionPointer getProcAddress(const char *procName) override;
- bool isSharing() const Q_DECL_OVERRIDE;
- bool isValid() const Q_DECL_OVERRIDE;
+ bool isSharing() const override;
+ bool isValid() const override;
private Q_SLOTS:
void windowDestroyed(QObject *object);
diff --git a/src/plugins/platforms/ios/qioseventdispatcher.h b/src/plugins/platforms/ios/qioseventdispatcher.h
index c1442ed1e8..62133b9510 100644
--- a/src/plugins/platforms/ios/qioseventdispatcher.h
+++ b/src/plugins/platforms/ios/qioseventdispatcher.h
@@ -51,8 +51,8 @@ class QIOSEventDispatcher : public QEventDispatcherCoreFoundation
public:
explicit QIOSEventDispatcher(QObject *parent = 0);
- bool processEvents(QEventLoop::ProcessEventsFlags flags) Q_DECL_OVERRIDE;
- bool processPostedEvents() Q_DECL_OVERRIDE;
+ bool processEvents(QEventLoop::ProcessEventsFlags flags) override;
+ bool processPostedEvents() override;
void handleRunLoopExit(CFRunLoopActivity activity);
diff --git a/src/plugins/platforms/ios/qiosfiledialog.h b/src/plugins/platforms/ios/qiosfiledialog.h
index 0b56bd20bf..5cb1b45e20 100644
--- a/src/plugins/platforms/ios/qiosfiledialog.h
+++ b/src/plugins/platforms/ios/qiosfiledialog.h
@@ -53,17 +53,17 @@ public:
QIOSFileDialog();
~QIOSFileDialog();
- void exec() Q_DECL_OVERRIDE;
- bool defaultNameFilterDisables() const Q_DECL_OVERRIDE { return false; }
- bool show(Qt::WindowFlags windowFlags, Qt::WindowModality windowModality, QWindow *parent) Q_DECL_OVERRIDE;
- void hide() Q_DECL_OVERRIDE;
- void setDirectory(const QUrl &) Q_DECL_OVERRIDE {}
- QUrl directory() const Q_DECL_OVERRIDE { return QUrl(); }
- void selectFile(const QUrl &) Q_DECL_OVERRIDE {}
- QList<QUrl> selectedFiles() const Q_DECL_OVERRIDE;
- void setFilter() Q_DECL_OVERRIDE {}
- void selectNameFilter(const QString &) Q_DECL_OVERRIDE {}
- QString selectedNameFilter() const Q_DECL_OVERRIDE { return QString(); }
+ void exec() override;
+ bool defaultNameFilterDisables() const override { return false; }
+ bool show(Qt::WindowFlags windowFlags, Qt::WindowModality windowModality, QWindow *parent) override;
+ void hide() override;
+ void setDirectory(const QUrl &) override {}
+ QUrl directory() const override { return QUrl(); }
+ void selectFile(const QUrl &) override {}
+ QList<QUrl> selectedFiles() const override;
+ void setFilter() override {}
+ void selectNameFilter(const QString &) override {}
+ QString selectedNameFilter() const override { return QString(); }
void selectedFilesChanged(QList<QUrl> selection);
diff --git a/src/plugins/platforms/ios/qiosfiledialog.mm b/src/plugins/platforms/ios/qiosfiledialog.mm
index c5722d33f8..5987bc1540 100644
--- a/src/plugins/platforms/ios/qiosfiledialog.mm
+++ b/src/plugins/platforms/ios/qiosfiledialog.mm
@@ -48,7 +48,7 @@
#include "qiosoptionalplugininterface.h"
QIOSFileDialog::QIOSFileDialog()
- : m_viewController(Q_NULLPTR)
+ : m_viewController(nullptr)
{
}
@@ -112,7 +112,7 @@ void QIOSFileDialog::hide()
[m_viewController dismissViewControllerAnimated:YES completion:nil];
[m_viewController release];
- m_viewController = Q_NULLPTR;
+ m_viewController = nullptr;
m_eventLoop.exit();
}
diff --git a/src/plugins/platforms/ios/qiosinputcontext.h b/src/plugins/platforms/ios/qiosinputcontext.h
index 966d1a7e80..255cf8bca9 100644
--- a/src/plugins/platforms/ios/qiosinputcontext.h
+++ b/src/plugins/platforms/ios/qiosinputcontext.h
@@ -88,24 +88,24 @@ public:
QIOSInputContext();
~QIOSInputContext();
- bool isValid() const Q_DECL_OVERRIDE { return true; }
+ bool isValid() const override { return true; }
- void showInputPanel() Q_DECL_OVERRIDE;
- void hideInputPanel() Q_DECL_OVERRIDE;
+ void showInputPanel() override;
+ void hideInputPanel() override;
- bool isInputPanelVisible() const Q_DECL_OVERRIDE;
- bool isAnimating() const Q_DECL_OVERRIDE;
- QRectF keyboardRect() const Q_DECL_OVERRIDE;
+ bool isInputPanelVisible() const override;
+ bool isAnimating() const override;
+ QRectF keyboardRect() const override;
- void update(Qt::InputMethodQueries) Q_DECL_OVERRIDE;
- void reset() Q_DECL_OVERRIDE;
- void commit() Q_DECL_OVERRIDE;
+ void update(Qt::InputMethodQueries) override;
+ void reset() override;
+ void commit() override;
- QLocale locale() const Q_DECL_OVERRIDE;
+ QLocale locale() const override;
void clearCurrentFocusObject();
- void setFocusObject(QObject *object) Q_DECL_OVERRIDE;
+ void setFocusObject(QObject *object) override;
void focusWindowChanged(QWindow *focusWindow);
void scrollToCursor();
diff --git a/src/plugins/platforms/ios/qiosintegration.h b/src/plugins/platforms/ios/qiosintegration.h
index 6f3f18af48..20eb210cd5 100644
--- a/src/plugins/platforms/ios/qiosintegration.h
+++ b/src/plugins/platforms/ios/qiosintegration.h
@@ -62,45 +62,45 @@ public:
QIOSIntegration();
~QIOSIntegration();
- bool hasCapability(Capability cap) const Q_DECL_OVERRIDE;
+ bool hasCapability(Capability cap) const override;
- QPlatformWindow *createPlatformWindow(QWindow *window) const Q_DECL_OVERRIDE;
- QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const Q_DECL_OVERRIDE;
+ QPlatformWindow *createPlatformWindow(QWindow *window) const override;
+ QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const override;
- QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const Q_DECL_OVERRIDE;
- QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const Q_DECL_OVERRIDE;
+ QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override;
+ QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override;
- QPlatformFontDatabase *fontDatabase() const Q_DECL_OVERRIDE;
+ QPlatformFontDatabase *fontDatabase() const override;
#ifndef QT_NO_CLIPBOARD
- QPlatformClipboard *clipboard() const Q_DECL_OVERRIDE;
+ QPlatformClipboard *clipboard() const override;
#endif
- QPlatformInputContext *inputContext() const Q_DECL_OVERRIDE;
- QPlatformServices *services() const Q_DECL_OVERRIDE;
+ QPlatformInputContext *inputContext() const override;
+ QPlatformServices *services() const override;
- QVariant styleHint(StyleHint hint) const Q_DECL_OVERRIDE;
+ QVariant styleHint(StyleHint hint) const override;
- QStringList themeNames() const Q_DECL_OVERRIDE;
- QPlatformTheme *createPlatformTheme(const QString &name) const Q_DECL_OVERRIDE;
+ QStringList themeNames() const override;
+ QPlatformTheme *createPlatformTheme(const QString &name) const override;
- QAbstractEventDispatcher *createEventDispatcher() const Q_DECL_OVERRIDE;
- QPlatformNativeInterface *nativeInterface() const Q_DECL_OVERRIDE;
+ QAbstractEventDispatcher *createEventDispatcher() const override;
+ QPlatformNativeInterface *nativeInterface() const override;
QTouchDevice *touchDevice();
#ifndef QT_NO_ACCESSIBILITY
- QPlatformAccessibility *accessibility() const Q_DECL_OVERRIDE;
+ 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 Q_DECL_OVERRIDE;
+ void beep() const override;
static QIOSIntegration *instance();
// -- QPlatformNativeInterface --
- void *nativeResourceForWindow(const QByteArray &resource, QWindow *window) Q_DECL_OVERRIDE;
+ void *nativeResourceForWindow(const QByteArray &resource, QWindow *window) override;
QFactoryLoader *optionalPlugins() { return m_optionalPlugins; }
diff --git a/src/plugins/platforms/ios/qiosintegration.mm b/src/plugins/platforms/ios/qiosintegration.mm
index 94a30eb931..92c1e39d72 100644
--- a/src/plugins/platforms/ios/qiosintegration.mm
+++ b/src/plugins/platforms/ios/qiosintegration.mm
@@ -118,6 +118,9 @@ QIOSIntegration::QIOSIntegration()
}
m_touchDevice->setCapabilities(touchCapabilities);
QWindowSystemInterface::registerTouchDevice(m_touchDevice);
+#if QT_CONFIG(tabletevent)
+ QWindowSystemInterfacePrivate::TabletEvent::setPlatformSynthesizesMouse(false);
+#endif
QMacInternalPasteboardMime::initializeMimeTypes();
for (int i = 0; i < m_optionalPlugins->metaData().size(); ++i)
@@ -196,12 +199,12 @@ class QIOSOffscreenSurface : public QPlatformOffscreenSurface
public:
QIOSOffscreenSurface(QOffscreenSurface *offscreenSurface) : QPlatformOffscreenSurface(offscreenSurface) {}
- QSurfaceFormat format() const Q_DECL_OVERRIDE
+ QSurfaceFormat format() const override
{
Q_ASSERT(offscreenSurface());
return offscreenSurface()->requestedFormat();
}
- bool isValid() const Q_DECL_OVERRIDE { return true; }
+ bool isValid() const override { return true; }
};
QPlatformOffscreenSurface *QIOSIntegration::createPlatformOffscreenSurface(QOffscreenSurface *surface) const
diff --git a/src/plugins/platforms/ios/qiosmenu.h b/src/plugins/platforms/ios/qiosmenu.h
index 61cadab56d..32022a3bb8 100644
--- a/src/plugins/platforms/ios/qiosmenu.h
+++ b/src/plugins/platforms/ios/qiosmenu.h
@@ -56,20 +56,20 @@ class QIOSMenuItem : public QPlatformMenuItem
public:
QIOSMenuItem();
- void setText(const QString &text) Q_DECL_OVERRIDE;
- void setIcon(const QIcon &) Q_DECL_OVERRIDE {}
- void setMenu(QPlatformMenu *) Q_DECL_OVERRIDE;
- void setVisible(bool isVisible) Q_DECL_OVERRIDE;
- void setIsSeparator(bool) Q_DECL_OVERRIDE;
- void setFont(const QFont &) Q_DECL_OVERRIDE {}
- void setRole(MenuRole role) Q_DECL_OVERRIDE;
- void setCheckable(bool) Q_DECL_OVERRIDE {}
- void setChecked(bool) Q_DECL_OVERRIDE {}
+ void setText(const QString &text) override;
+ void setIcon(const QIcon &) override {}
+ void setMenu(QPlatformMenu *) override;
+ void setVisible(bool isVisible) override;
+ void setIsSeparator(bool) override;
+ void setFont(const QFont &) override {}
+ void setRole(MenuRole role) override;
+ void setCheckable(bool) override {}
+ void setChecked(bool) override {}
#ifndef QT_NO_SHORTCUT
- void setShortcut(const QKeySequence&) Q_DECL_OVERRIDE;
+ void setShortcut(const QKeySequence&) override;
#endif
- void setEnabled(bool enabled) Q_DECL_OVERRIDE;
- void setIconSize(int) Q_DECL_OVERRIDE {}
+ void setEnabled(bool enabled) override;
+ void setIconSize(int) override {}
bool m_visible;
QString m_text;
@@ -88,22 +88,22 @@ public:
QIOSMenu();
~QIOSMenu();
- void insertMenuItem(QPlatformMenuItem *menuItem, QPlatformMenuItem *before) Q_DECL_OVERRIDE;
- void removeMenuItem(QPlatformMenuItem *menuItem) Q_DECL_OVERRIDE;
- void syncMenuItem(QPlatformMenuItem *) Q_DECL_OVERRIDE;
- void syncSeparatorsCollapsible(bool) Q_DECL_OVERRIDE {}
+ void insertMenuItem(QPlatformMenuItem *menuItem, QPlatformMenuItem *before) override;
+ void removeMenuItem(QPlatformMenuItem *menuItem) override;
+ void syncMenuItem(QPlatformMenuItem *) override;
+ void syncSeparatorsCollapsible(bool) override {}
- void setText(const QString &) Q_DECL_OVERRIDE;
- void setIcon(const QIcon &) Q_DECL_OVERRIDE {}
- void setEnabled(bool enabled) Q_DECL_OVERRIDE;
- void setVisible(bool visible) Q_DECL_OVERRIDE;
- void setMenuType(MenuType type) Q_DECL_OVERRIDE;
+ void setText(const QString &) override;
+ void setIcon(const QIcon &) override {}
+ void setEnabled(bool enabled) override;
+ void setVisible(bool visible) override;
+ void setMenuType(MenuType type) override;
- void showPopup(const QWindow *parentWindow, const QRect &targetRect, const QPlatformMenuItem *item) Q_DECL_OVERRIDE;
- void dismiss() Q_DECL_OVERRIDE;
+ void showPopup(const QWindow *parentWindow, const QRect &targetRect, const QPlatformMenuItem *item) override;
+ void dismiss() override;
- QPlatformMenuItem *menuItemAt(int position) const Q_DECL_OVERRIDE;
- QPlatformMenuItem *menuItemForTag(quintptr tag) const Q_DECL_OVERRIDE;
+ QPlatformMenuItem *menuItemAt(int position) const override;
+ QPlatformMenuItem *menuItemForTag(quintptr tag) const override;
void handleItemSelected(QIOSMenuItem *menuItem);
@@ -111,7 +111,7 @@ public:
static id menuActionTarget() { return m_currentMenu ? m_currentMenu->m_menuController : 0; }
protected:
- bool eventFilter(QObject *obj, QEvent *event) Q_DECL_OVERRIDE;
+ bool eventFilter(QObject *obj, QEvent *event) override;
private:
bool m_enabled;
diff --git a/src/plugins/platforms/ios/qiosmessagedialog.h b/src/plugins/platforms/ios/qiosmessagedialog.h
index e67e10a5e1..92a4db8319 100644
--- a/src/plugins/platforms/ios/qiosmessagedialog.h
+++ b/src/plugins/platforms/ios/qiosmessagedialog.h
@@ -54,9 +54,9 @@ public:
QIOSMessageDialog();
~QIOSMessageDialog();
- void exec() Q_DECL_OVERRIDE;
- bool show(Qt::WindowFlags windowFlags, Qt::WindowModality windowModality, QWindow *parent) Q_DECL_OVERRIDE;
- void hide() Q_DECL_OVERRIDE;
+ void exec() override;
+ bool show(Qt::WindowFlags windowFlags, Qt::WindowModality windowModality, QWindow *parent) override;
+ void hide() override;
private:
QEventLoop m_eventLoop;
diff --git a/src/plugins/platforms/ios/qiosmessagedialog.mm b/src/plugins/platforms/ios/qiosmessagedialog.mm
index 5507f13de7..9d05b792c2 100644
--- a/src/plugins/platforms/ios/qiosmessagedialog.mm
+++ b/src/plugins/platforms/ios/qiosmessagedialog.mm
@@ -48,7 +48,7 @@
#include "qiosmessagedialog.h"
QIOSMessageDialog::QIOSMessageDialog()
- : m_alertController(Q_NULLPTR)
+ : m_alertController(nullptr)
{
}
@@ -136,5 +136,5 @@ void QIOSMessageDialog::hide()
m_eventLoop.exit();
[m_alertController dismissViewControllerAnimated:YES completion:nil];
[m_alertController release];
- m_alertController = Q_NULLPTR;
+ m_alertController = nullptr;
}
diff --git a/src/plugins/platforms/ios/qiosoptionalplugininterface.h b/src/plugins/platforms/ios/qiosoptionalplugininterface.h
index 3f74e41c83..660c74e856 100644
--- a/src/plugins/platforms/ios/qiosoptionalplugininterface.h
+++ b/src/plugins/platforms/ios/qiosoptionalplugininterface.h
@@ -55,7 +55,7 @@ class QIosOptionalPluginInterface
public:
virtual ~QIosOptionalPluginInterface() {}
virtual void initPlugin() const {};
- virtual UIViewController* createImagePickerController(QIOSFileDialog *) const { return Q_NULLPTR; };
+ virtual UIViewController* createImagePickerController(QIOSFileDialog *) const { return nullptr; };
};
Q_DECLARE_INTERFACE(QIosOptionalPluginInterface, QIosOptionalPluginInterface_iid)
diff --git a/src/plugins/platforms/ios/qiosscreen.h b/src/plugins/platforms/ios/qiosscreen.h
index 9fcce42825..329fb1f9e2 100644
--- a/src/plugins/platforms/ios/qiosscreen.h
+++ b/src/plugins/platforms/ios/qiosscreen.h
@@ -56,17 +56,17 @@ public:
QIOSScreen(UIScreen *screen);
~QIOSScreen();
- QRect geometry() const Q_DECL_OVERRIDE;
- QRect availableGeometry() const Q_DECL_OVERRIDE;
- int depth() const Q_DECL_OVERRIDE;
- QImage::Format format() const Q_DECL_OVERRIDE;
- QSizeF physicalSize() const Q_DECL_OVERRIDE;
- QDpi logicalDpi() const Q_DECL_OVERRIDE;
- qreal devicePixelRatio() const Q_DECL_OVERRIDE;
-
- Qt::ScreenOrientation nativeOrientation() const Q_DECL_OVERRIDE;
- Qt::ScreenOrientation orientation() const Q_DECL_OVERRIDE;
- void setOrientationUpdateMask(Qt::ScreenOrientations mask) Q_DECL_OVERRIDE;
+ QRect geometry() const override;
+ QRect availableGeometry() const override;
+ int depth() const override;
+ QImage::Format format() const override;
+ QSizeF physicalSize() const override;
+ QDpi logicalDpi() const override;
+ qreal devicePixelRatio() const override;
+
+ Qt::ScreenOrientation nativeOrientation() const override;
+ Qt::ScreenOrientation orientation() const override;
+ void setOrientationUpdateMask(Qt::ScreenOrientations mask) override;
QPixmap grabWindow(WId window, int x, int y, int width, int height) const override;
diff --git a/src/plugins/platforms/ios/qiostextinputoverlay.mm b/src/plugins/platforms/ios/qiostextinputoverlay.mm
index bb9fe4d58f..fe3c29d037 100644
--- a/src/plugins/platforms/ios/qiostextinputoverlay.mm
+++ b/src/plugins/platforms/ios/qiostextinputoverlay.mm
@@ -608,7 +608,7 @@ static void executeBlockWithoutAnimation(Block block)
- (QIOSLoupeLayer *)createLoupeLayer
{
Q_UNREACHABLE();
- return Q_NULLPTR;
+ return nullptr;
}
- (void)updateFocalPoint:(QPointF)touchPoint
@@ -984,12 +984,12 @@ static void executeBlockWithoutAnimation(Block block)
QT_BEGIN_NAMESPACE
-QIOSEditMenu *QIOSTextInputOverlay::s_editMenu = Q_NULLPTR;
+QIOSEditMenu *QIOSTextInputOverlay::s_editMenu = nullptr;
QIOSTextInputOverlay::QIOSTextInputOverlay()
- : m_cursorRecognizer(Q_NULLPTR)
- , m_selectionRecognizer(Q_NULLPTR)
- , m_openMenuOnTapRecognizer(Q_NULLPTR)
+ : m_cursorRecognizer(nullptr)
+ , m_selectionRecognizer(nullptr)
+ , m_openMenuOnTapRecognizer(nullptr)
{
connect(qApp, &QGuiApplication::focusObjectChanged, this, &QIOSTextInputOverlay::updateFocusObject);
}
@@ -1012,10 +1012,10 @@ void QIOSTextInputOverlay::updateFocusObject()
[m_selectionRecognizer release];
[m_openMenuOnTapRecognizer release];
[s_editMenu release];
- m_cursorRecognizer = Q_NULLPTR;
- m_selectionRecognizer = Q_NULLPTR;
- m_openMenuOnTapRecognizer = Q_NULLPTR;
- s_editMenu = Q_NULLPTR;
+ m_cursorRecognizer = nullptr;
+ m_selectionRecognizer = nullptr;
+ m_openMenuOnTapRecognizer = nullptr;
+ s_editMenu = nullptr;
}
if (platformInputContext()->inputMethodAccepted()) {
diff --git a/src/plugins/platforms/ios/qiostheme.h b/src/plugins/platforms/ios/qiostheme.h
index fc6b58178a..c917679a91 100644
--- a/src/plugins/platforms/ios/qiostheme.h
+++ b/src/plugins/platforms/ios/qiostheme.h
@@ -52,16 +52,16 @@ public:
QIOSTheme();
~QIOSTheme();
- const QPalette *palette(Palette type = SystemPalette) const Q_DECL_OVERRIDE;
- QVariant themeHint(ThemeHint hint) const Q_DECL_OVERRIDE;
+ const QPalette *palette(Palette type = SystemPalette) const override;
+ QVariant themeHint(ThemeHint hint) const override;
- QPlatformMenuItem* createPlatformMenuItem() const Q_DECL_OVERRIDE;
- QPlatformMenu* createPlatformMenu() const Q_DECL_OVERRIDE;
+ QPlatformMenuItem* createPlatformMenuItem() const override;
+ QPlatformMenu* createPlatformMenu() const override;
- bool usePlatformNativeDialog(DialogType type) const Q_DECL_OVERRIDE;
- QPlatformDialogHelper *createPlatformDialogHelper(DialogType type) const Q_DECL_OVERRIDE;
+ bool usePlatformNativeDialog(DialogType type) const override;
+ QPlatformDialogHelper *createPlatformDialogHelper(DialogType type) const override;
- const QFont *font(Font type = SystemFont) const Q_DECL_OVERRIDE;
+ const QFont *font(Font type = SystemFont) const override;
static const char *name;
diff --git a/src/plugins/platforms/ios/qioswindow.h b/src/plugins/platforms/ios/qioswindow.h
index da8a6aabdc..1342d66201 100644
--- a/src/plugins/platforms/ios/qioswindow.h
+++ b/src/plugins/platforms/ios/qioswindow.h
@@ -60,35 +60,35 @@ public:
explicit QIOSWindow(QWindow *window);
~QIOSWindow();
- void setGeometry(const QRect &rect) Q_DECL_OVERRIDE;
+ void setGeometry(const QRect &rect) override;
- void setWindowState(Qt::WindowStates state) Q_DECL_OVERRIDE;
- void setParent(const QPlatformWindow *window) Q_DECL_OVERRIDE;
- void handleContentOrientationChange(Qt::ScreenOrientation orientation) Q_DECL_OVERRIDE;
- void setVisible(bool visible) Q_DECL_OVERRIDE;
- void setOpacity(qreal level) Q_DECL_OVERRIDE;
+ void setWindowState(Qt::WindowStates state) override;
+ void setParent(const QPlatformWindow *window) override;
+ void handleContentOrientationChange(Qt::ScreenOrientation orientation) override;
+ void setVisible(bool visible) override;
+ void setOpacity(qreal level) override;
- bool isExposed() const Q_DECL_OVERRIDE;
- void propagateSizeHints() Q_DECL_OVERRIDE {}
+ bool isExposed() const override;
+ void propagateSizeHints() override {}
- void raise() Q_DECL_OVERRIDE{ raiseOrLower(true); }
- void lower() Q_DECL_OVERRIDE { raiseOrLower(false); }
+ void raise() override{ raiseOrLower(true); }
+ void lower() override { raiseOrLower(false); }
bool shouldAutoActivateWindow() const;
- void requestActivateWindow() Q_DECL_OVERRIDE;
+ void requestActivateWindow() override;
- qreal devicePixelRatio() const Q_DECL_OVERRIDE;
+ qreal devicePixelRatio() const override;
- bool setMouseGrabEnabled(bool grab) Q_DECL_OVERRIDE { return grab; }
- bool setKeyboardGrabEnabled(bool grab) Q_DECL_OVERRIDE { return grab; }
+ bool setMouseGrabEnabled(bool grab) override { return grab; }
+ bool setKeyboardGrabEnabled(bool grab) override { return grab; }
- WId winId() const Q_DECL_OVERRIDE { return WId(m_view); }
+ WId winId() const override { return WId(m_view); }
void clearAccessibleCache();
- QSurfaceFormat format() const Q_DECL_OVERRIDE;
+ QSurfaceFormat format() const override;
- void requestUpdate() Q_DECL_OVERRIDE;
+ void requestUpdate() override;
CAEAGLLayer *eaglLayer() const;
diff --git a/src/plugins/platforms/ios/quiview.h b/src/plugins/platforms/ios/quiview.h
index 1500f0b41c..2224ee336a 100644
--- a/src/plugins/platforms/ios/quiview.h
+++ b/src/plugins/platforms/ios/quiview.h
@@ -58,6 +58,7 @@ QT_END_NAMESPACE
QT_PREPEND_NAMESPACE(QIOSWindow) *m_qioswindow;
@private
QHash<UITouch *, QWindowSystemInterface::TouchPoint> m_activeTouches;
+ UITouch *m_activePencilTouch;
int m_nextTouchId;
@private
diff --git a/src/plugins/platforms/ios/quiview.mm b/src/plugins/platforms/ios/quiview.mm
index a56530e1d9..406bfcf5b3 100644
--- a/src/plugins/platforms/ios/quiview.mm
+++ b/src/plugins/platforms/ios/quiview.mm
@@ -52,6 +52,8 @@
#include <QtGui/private/qwindow_p.h>
#include <qpa/qwindowsysteminterface_p.h>
+Q_LOGGING_CATEGORY(lcQpaTablet, "qt.qpa.input.tablet")
+
@implementation QUIView
+ (Class)layerClass
@@ -311,11 +313,44 @@
return [super pointInside:point withEvent:event];
}
-- (void)updateTouchList:(NSSet *)touches withState:(Qt::TouchPointState)state
+- (void)handleTouches:(NSSet *)touches withEvent:(UIEvent *)event withState:(Qt::TouchPointState)state withTimestamp:(ulong)timeStamp
{
+ QIOSIntegration *iosIntegration = QIOSIntegration::instance();
bool supportsPressure = QIOSIntegration::instance()->touchDevice()->capabilities() & QTouchDevice::Pressure;
- foreach (UITouch *uiTouch, m_activeTouches.keys()) {
+#if QT_CONFIG(tabletevent)
+ if (m_activePencilTouch && [touches containsObject:m_activePencilTouch]) {
+ NSArray<UITouch *> *cTouches = [event coalescedTouchesForTouch:m_activePencilTouch];
+ int i = 0;
+ for (UITouch *cTouch in cTouches) {
+ QPointF localViewPosition = QPointF::fromCGPoint([cTouch preciseLocationInView:self]);
+ QPoint localViewPositionI = localViewPosition.toPoint();
+ QPointF globalScreenPosition = m_qioswindow->mapToGlobal(localViewPositionI) +
+ (localViewPosition - localViewPositionI);
+ qreal pressure = cTouch.force / cTouch.maximumPossibleForce;
+ // azimuth unit vector: +x to the right, +y going downwards
+ CGVector azimuth = [cTouch azimuthUnitVectorInView: self];
+ // azimuthAngle given in radians, zero when the stylus points towards +x axis; converted to degrees with 0 pointing straight up
+ qreal azimuthAngle = [cTouch azimuthAngleInView: self] * 180 / M_PI + 90;
+ // altitudeAngle given in radians, pi / 2 is with the stylus perpendicular to the iPad, smaller values mean more tilted, but never negative.
+ // Convert to degrees with zero being perpendicular.
+ qreal altitudeAngle = 90 - cTouch.altitudeAngle * 180 / M_PI;
+ qCDebug(lcQpaTablet) << i << ":" << timeStamp << localViewPosition << pressure << state << "azimuth" << azimuth.dx << azimuth.dy
+ << "angle" << azimuthAngle << "altitude" << cTouch.altitudeAngle
+ << "xTilt" << qBound(-60.0, altitudeAngle * azimuth.dx, 60.0) << "yTilt" << qBound(-60.0, altitudeAngle * azimuth.dy, 60.0);
+ QWindowSystemInterface::handleTabletEvent(m_qioswindow->window(), timeStamp, localViewPosition, globalScreenPosition,
+ // device, pointerType, buttons
+ QTabletEvent::RotationStylus, QTabletEvent::Pen, state == Qt::TouchPointReleased ? Qt::NoButton : Qt::LeftButton,
+ // pressure, xTilt, yTilt
+ pressure, qBound(-60.0, altitudeAngle * azimuth.dx, 60.0), qBound(-60.0, altitudeAngle * azimuth.dy, 60.0),
+ // tangentialPressure, rotation, z, uid, modifiers
+ 0, azimuthAngle, 0, 0, Qt::NoModifier);
+ ++i;
+ }
+ }
+#endif
+
+ for (UITouch *uiTouch : m_activeTouches.keys()) {
QWindowSystemInterface::TouchPoint &touchPoint = m_activeTouches[uiTouch];
if (![touches containsObject:uiTouch]) {
touchPoint.state = Qt::TouchPointStationary;
@@ -344,17 +379,13 @@
touchPoint.pressure = uiTouch.force / uiTouch.maximumPossibleForce;
} else {
// We don't claim that our touch device supports QTouchDevice::Pressure,
- // but fill in a meaningfull value in case clients use it anyways.
+ // but fill in a meaningful value in case clients use it anyway.
touchPoint.pressure = (state == Qt::TouchPointReleased) ? 0.0 : 1.0;
}
}
}
-}
-
-- (void)sendTouchEventWithTimestamp:(ulong)timeStamp
-{
- QIOSIntegration *iosIntegration = QIOSIntegration::instance();
- QWindowSystemInterface::handleTouchEvent<QWindowSystemInterface::SynchronousDelivery>(m_qioswindow->window(), timeStamp, iosIntegration->touchDevice(), m_activeTouches.values());
+ if (!m_activeTouches.isEmpty())
+ QWindowSystemInterface::handleTouchEvent<QWindowSystemInterface::SynchronousDelivery>(m_qioswindow->window(), timeStamp, iosIntegration->touchDevice(), m_activeTouches.values());
}
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
@@ -364,8 +395,21 @@
// points to QWindowSystemInterface::TouchPoints, and assigns each TouchPoint
// an id for use by Qt.
for (UITouch *touch in touches) {
- Q_ASSERT(!m_activeTouches.contains(touch));
- m_activeTouches[touch].id = m_nextTouchId++;
+#if QT_CONFIG(tabletevent)
+ if (touch.type == UITouchTypeStylus) {
+ if (Q_UNLIKELY(m_activePencilTouch)) {
+ qWarning("ignoring additional Pencil while first is still active");
+ continue;
+ }
+ m_activePencilTouch = touch;
+ } else
+ {
+ Q_ASSERT(!m_activeTouches.contains(touch));
+#endif
+ m_activeTouches[touch].id = m_nextTouchId++;
+#if QT_CONFIG(tabletevent)
+ }
+#endif
}
if (m_qioswindow->shouldAutoActivateWindow() && m_activeTouches.size() == 1) {
@@ -376,31 +420,36 @@
topLevel->requestActivateWindow();
}
- [self updateTouchList:touches withState:Qt::TouchPointPressed];
- [self sendTouchEventWithTimestamp:ulong(event.timestamp * 1000)];
+ [self handleTouches:touches withEvent:event withState:Qt::TouchPointPressed withTimestamp:ulong(event.timestamp * 1000)];
}
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
- [self updateTouchList:touches withState:Qt::TouchPointMoved];
- [self sendTouchEventWithTimestamp:ulong(event.timestamp * 1000)];
+ [self handleTouches:touches withEvent:event withState:Qt::TouchPointMoved withTimestamp:ulong(event.timestamp * 1000)];
}
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
- [self updateTouchList:touches withState:Qt::TouchPointReleased];
- [self sendTouchEventWithTimestamp:ulong(event.timestamp * 1000)];
+ [self handleTouches:touches withEvent:event withState:Qt::TouchPointReleased withTimestamp:ulong(event.timestamp * 1000)];
// Remove ended touch points from the active set:
- for (UITouch *touch in touches)
- m_activeTouches.remove(touch);
- if (m_activeTouches.isEmpty())
+ for (UITouch *touch in touches) {
+#if QT_CONFIG(tabletevent)
+ if (touch.type == UITouchTypeStylus) {
+ m_activePencilTouch = nil;
+ } else
+#endif
+ {
+ m_activeTouches.remove(touch);
+ }
+ }
+ if (m_activeTouches.isEmpty() && !m_activePencilTouch)
m_nextTouchId = 0;
}
- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event
{
- if (m_activeTouches.isEmpty())
+ if (m_activeTouches.isEmpty() && !m_activePencilTouch)
return;
// When four-finger swiping, we get a touchesCancelled callback
@@ -424,11 +473,12 @@
// sub-set of the active touch events are intentionally cancelled.
NSInteger count = static_cast<NSInteger>([touches count]);
- if (count != 0 && count != m_activeTouches.count())
+ if (count != 0 && count != m_activeTouches.count() && !m_activePencilTouch)
qWarning("Subset of active touches cancelled by UIKit");
m_activeTouches.clear();
m_nextTouchId = 0;
+ m_activePencilTouch = nil;
NSTimeInterval timestamp = event ? event.timestamp : [[NSProcessInfo processInfo] systemUptime];
diff --git a/src/plugins/platforms/linuxfb/main.cpp b/src/plugins/platforms/linuxfb/main.cpp
index 82b916b9a9..24156b68e8 100644
--- a/src/plugins/platforms/linuxfb/main.cpp
+++ b/src/plugins/platforms/linuxfb/main.cpp
@@ -47,7 +47,7 @@ class QLinuxFbIntegrationPlugin : public QPlatformIntegrationPlugin
Q_OBJECT
Q_PLUGIN_METADATA(IID QPlatformIntegrationFactoryInterface_iid FILE "linuxfb.json")
public:
- QPlatformIntegration *create(const QString&, const QStringList&) Q_DECL_OVERRIDE;
+ QPlatformIntegration *create(const QString&, const QStringList&) override;
};
QPlatformIntegration* QLinuxFbIntegrationPlugin::create(const QString& system, const QStringList& paramList)
diff --git a/src/plugins/platforms/linuxfb/qlinuxfbdrmscreen.cpp b/src/plugins/platforms/linuxfb/qlinuxfbdrmscreen.cpp
index e15d6fee24..dcc1ef2790 100644
--- a/src/plugins/platforms/linuxfb/qlinuxfbdrmscreen.cpp
+++ b/src/plugins/platforms/linuxfb/qlinuxfbdrmscreen.cpp
@@ -43,7 +43,6 @@
// Multiscreen: QWindow-QScreen(-output) association. Needs some reorg (device cannot be owned by screen)
// Find card via devicediscovery like in eglfs_kms.
// Mode restore like QEglFSKmsInterruptHandler.
-// Formats other then 32 bpp?
// grabWindow
#include "qlinuxfbdrmscreen.h"
@@ -187,15 +186,67 @@ void QLinuxFbDevice::registerScreen(QPlatformScreen *screen,
Q_UNREACHABLE();
}
+static uint32_t bppForDrmFormat(uint32_t drmFormat)
+{
+ switch (drmFormat) {
+ case DRM_FORMAT_RGB565:
+ case DRM_FORMAT_BGR565:
+ return 16;
+ default:
+ return 32;
+ }
+}
+
+static int depthForDrmFormat(uint32_t drmFormat)
+{
+ switch (drmFormat) {
+ case DRM_FORMAT_RGB565:
+ case DRM_FORMAT_BGR565:
+ return 16;
+ case DRM_FORMAT_XRGB8888:
+ case DRM_FORMAT_XBGR8888:
+ return 24;
+ case DRM_FORMAT_XRGB2101010:
+ case DRM_FORMAT_XBGR2101010:
+ return 30;
+ default:
+ return 32;
+ }
+}
+
+static QImage::Format formatForDrmFormat(uint32_t drmFormat)
+{
+ switch (drmFormat) {
+ case DRM_FORMAT_XRGB8888:
+ case DRM_FORMAT_XBGR8888:
+ return QImage::Format_RGB32;
+ case DRM_FORMAT_ARGB8888:
+ case DRM_FORMAT_ABGR8888:
+ return QImage::Format_ARGB32;
+ case DRM_FORMAT_RGB565:
+ case DRM_FORMAT_BGR565:
+ return QImage::Format_RGB16;
+ case DRM_FORMAT_XRGB2101010:
+ case DRM_FORMAT_XBGR2101010:
+ return QImage::Format_RGB30;
+ case DRM_FORMAT_ARGB2101010:
+ case DRM_FORMAT_ABGR2101010:
+ return QImage::Format_A2RGB30_Premultiplied;
+ default:
+ return QImage::Format_ARGB32;
+ }
+}
+
bool QLinuxFbDevice::createFramebuffer(QLinuxFbDevice::Output *output, int bufferIdx)
{
const QSize size = output->currentRes();
const uint32_t w = size.width();
const uint32_t h = size.height();
+ const uint32_t bpp = bppForDrmFormat(output->kmsOutput.drm_format);
drm_mode_create_dumb creq = {
h,
w,
- 32,
+ bpp,
0, 0, 0, 0
};
if (drmIoctl(fd(), DRM_IOCTL_MODE_CREATE_DUMB, &creq) == -1) {
@@ -207,10 +258,15 @@ bool QLinuxFbDevice::createFramebuffer(QLinuxFbDevice::Output *output, int buffe
fb.handle = creq.handle;
fb.pitch = creq.pitch;
fb.size = creq.size;
- qCDebug(qLcFbDrm, "Got a dumb buffer for size %dx%d, handle %u, pitch %u, size %u",
- w, h, fb.handle, fb.pitch, (uint) fb.size);
+ qCDebug(qLcFbDrm, "Got a dumb buffer for size %dx%d and bpp %u: handle %u, pitch %u, size %u",
+ w, h, bpp, fb.handle, fb.pitch, (uint) fb.size);
+
+ uint32_t handles[4] = { fb.handle };
+ uint32_t strides[4] = { fb.pitch };
+ uint32_t offsets[4] = { 0 };
- if (drmModeAddFB(fd(), w, h, 24, 32, fb.pitch, fb.handle, &fb.fb) == -1) {
+ if (drmModeAddFB2(fd(), w, h, output->kmsOutput.drm_format,
+ handles, strides, offsets, &fb.fb, 0) == -1) {
qErrnoWarning(errno, "Failed to add FB");
return false;
}
@@ -229,10 +285,10 @@ bool QLinuxFbDevice::createFramebuffer(QLinuxFbDevice::Output *output, int buffe
return false;
}
- qCDebug(qLcFbDrm, "FB is %u, mapped at %p", fb.fb, fb.p);
+ qCDebug(qLcFbDrm, "FB is %u (DRM format 0x%x), mapped at %p", fb.fb, output->kmsOutput.drm_format, fb.p);
memset(fb.p, 0, fb.size);
- fb.wrapper = QImage(static_cast<uchar *>(fb.p), w, h, fb.pitch, QImage::Format_ARGB32);
+ fb.wrapper = QImage(static_cast<uchar *>(fb.p), w, h, fb.pitch, formatForDrmFormat(output->kmsOutput.drm_format));
return true;
}
@@ -357,10 +413,10 @@ bool QLinuxFbDrmScreen::initialize()
QLinuxFbDevice::Output *output(m_device->output(0));
mGeometry = QRect(QPoint(0, 0), output->currentRes());
- mDepth = 32;
- mFormat = QImage::Format_ARGB32;
+ mDepth = depthForDrmFormat(output->kmsOutput.drm_format);
+ mFormat = formatForDrmFormat(output->kmsOutput.drm_format);
mPhysicalSize = output->kmsOutput.physical_size;
- qCDebug(qLcFbDrm) << mGeometry << mPhysicalSize;
+ qCDebug(qLcFbDrm) << mGeometry << mPhysicalSize << mDepth << mFormat;
QFbScreen::initializeCompositor();
diff --git a/src/plugins/platforms/linuxfb/qlinuxfbintegration.h b/src/plugins/platforms/linuxfb/qlinuxfbintegration.h
index 9934a8cd54..22578bf980 100644
--- a/src/plugins/platforms/linuxfb/qlinuxfbintegration.h
+++ b/src/plugins/platforms/linuxfb/qlinuxfbintegration.h
@@ -55,19 +55,19 @@ public:
QLinuxFbIntegration(const QStringList &paramList);
~QLinuxFbIntegration();
- void initialize() Q_DECL_OVERRIDE;
- bool hasCapability(QPlatformIntegration::Capability cap) const Q_DECL_OVERRIDE;
+ void initialize() override;
+ bool hasCapability(QPlatformIntegration::Capability cap) const override;
- QPlatformWindow *createPlatformWindow(QWindow *window) const Q_DECL_OVERRIDE;
- QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const Q_DECL_OVERRIDE;
+ QPlatformWindow *createPlatformWindow(QWindow *window) const override;
+ QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const override;
- QAbstractEventDispatcher *createEventDispatcher() const Q_DECL_OVERRIDE;
+ QAbstractEventDispatcher *createEventDispatcher() const override;
- QPlatformFontDatabase *fontDatabase() const Q_DECL_OVERRIDE;
- QPlatformServices *services() const Q_DECL_OVERRIDE;
- QPlatformInputContext *inputContext() const Q_DECL_OVERRIDE { return m_inputContext; }
+ QPlatformFontDatabase *fontDatabase() const override;
+ QPlatformServices *services() const override;
+ QPlatformInputContext *inputContext() const override { return m_inputContext; }
- QPlatformNativeInterface *nativeInterface() const Q_DECL_OVERRIDE;
+ QPlatformNativeInterface *nativeInterface() const override;
QList<QPlatformScreen *> screens() const;
diff --git a/src/plugins/platforms/minimal/main.cpp b/src/plugins/platforms/minimal/main.cpp
index 29809c1843..f9a0c17509 100644
--- a/src/plugins/platforms/minimal/main.cpp
+++ b/src/plugins/platforms/minimal/main.cpp
@@ -48,7 +48,7 @@ class QMinimalIntegrationPlugin : public QPlatformIntegrationPlugin
Q_OBJECT
Q_PLUGIN_METADATA(IID QPlatformIntegrationFactoryInterface_iid FILE "minimal.json")
public:
- QPlatformIntegration *create(const QString&, const QStringList&) Q_DECL_OVERRIDE;
+ QPlatformIntegration *create(const QString&, const QStringList&) override;
};
QPlatformIntegration *QMinimalIntegrationPlugin::create(const QString& system, const QStringList& paramList)
diff --git a/src/plugins/platforms/minimal/qminimalbackingstore.h b/src/plugins/platforms/minimal/qminimalbackingstore.h
index 3d7aaf2b99..2119894809 100644
--- a/src/plugins/platforms/minimal/qminimalbackingstore.h
+++ b/src/plugins/platforms/minimal/qminimalbackingstore.h
@@ -52,9 +52,9 @@ public:
QMinimalBackingStore(QWindow *window);
~QMinimalBackingStore();
- QPaintDevice *paintDevice() Q_DECL_OVERRIDE;
- void flush(QWindow *window, const QRegion &region, const QPoint &offset) Q_DECL_OVERRIDE;
- void resize(const QSize &size, const QRegion &staticContents) Q_DECL_OVERRIDE;
+ QPaintDevice *paintDevice() override;
+ void flush(QWindow *window, const QRegion &region, const QPoint &offset) override;
+ void resize(const QSize &size, const QRegion &staticContents) override;
private:
QImage mImage;
diff --git a/src/plugins/platforms/minimal/qminimalintegration.cpp b/src/plugins/platforms/minimal/qminimalintegration.cpp
index ca33689cd7..9fc7671feb 100644
--- a/src/plugins/platforms/minimal/qminimalintegration.cpp
+++ b/src/plugins/platforms/minimal/qminimalintegration.cpp
@@ -123,7 +123,7 @@ bool QMinimalIntegration::hasCapability(QPlatformIntegration::Capability cap) co
class DummyFontDatabase : public QPlatformFontDatabase
{
public:
- virtual void populateFontDatabase() Q_DECL_OVERRIDE {}
+ virtual void populateFontDatabase() override {}
};
QPlatformFontDatabase *QMinimalIntegration::fontDatabase() const
diff --git a/src/plugins/platforms/minimal/qminimalintegration.h b/src/plugins/platforms/minimal/qminimalintegration.h
index eaa2f228c5..bc7b23c83c 100644
--- a/src/plugins/platforms/minimal/qminimalintegration.h
+++ b/src/plugins/platforms/minimal/qminimalintegration.h
@@ -51,9 +51,9 @@ public:
QMinimalScreen()
: mDepth(32), mFormat(QImage::Format_ARGB32_Premultiplied) {}
- QRect geometry() const Q_DECL_OVERRIDE { return mGeometry; }
- int depth() const Q_DECL_OVERRIDE { return mDepth; }
- QImage::Format format() const Q_DECL_OVERRIDE { return mFormat; }
+ QRect geometry() const override { return mGeometry; }
+ int depth() const override { return mDepth; }
+ QImage::Format format() const override { return mFormat; }
public:
QRect mGeometry;
@@ -74,12 +74,12 @@ public:
explicit QMinimalIntegration(const QStringList &parameters);
~QMinimalIntegration();
- bool hasCapability(QPlatformIntegration::Capability cap) const Q_DECL_OVERRIDE;
- QPlatformFontDatabase *fontDatabase() const Q_DECL_OVERRIDE;
+ bool hasCapability(QPlatformIntegration::Capability cap) const override;
+ QPlatformFontDatabase *fontDatabase() const override;
- QPlatformWindow *createPlatformWindow(QWindow *window) const Q_DECL_OVERRIDE;
- QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const Q_DECL_OVERRIDE;
- QAbstractEventDispatcher *createEventDispatcher() const Q_DECL_OVERRIDE;
+ QPlatformWindow *createPlatformWindow(QWindow *window) const override;
+ QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const override;
+ QAbstractEventDispatcher *createEventDispatcher() const override;
unsigned options() const { return m_options; }
diff --git a/src/plugins/platforms/minimalegl/main.cpp b/src/plugins/platforms/minimalegl/main.cpp
index a010ed76e2..5aac71e140 100644
--- a/src/plugins/platforms/minimalegl/main.cpp
+++ b/src/plugins/platforms/minimalegl/main.cpp
@@ -47,7 +47,7 @@ class QMinimalEglIntegrationPlugin : public QPlatformIntegrationPlugin
Q_OBJECT
Q_PLUGIN_METADATA(IID QPlatformIntegrationFactoryInterface_iid FILE "minimalegl.json")
public:
- QPlatformIntegration *create(const QString&, const QStringList&) Q_DECL_OVERRIDE;
+ QPlatformIntegration *create(const QString&, const QStringList&) override;
};
QPlatformIntegration* QMinimalEglIntegrationPlugin::create(const QString& system, const QStringList& paramList)
diff --git a/src/plugins/platforms/minimalegl/qminimaleglbackingstore.h b/src/plugins/platforms/minimalegl/qminimaleglbackingstore.h
index 0e22298891..382f2d1404 100644
--- a/src/plugins/platforms/minimalegl/qminimaleglbackingstore.h
+++ b/src/plugins/platforms/minimalegl/qminimaleglbackingstore.h
@@ -53,13 +53,13 @@ public:
QMinimalEglBackingStore(QWindow *window);
~QMinimalEglBackingStore();
- QPaintDevice *paintDevice() Q_DECL_OVERRIDE;
+ QPaintDevice *paintDevice() override;
- void beginPaint(const QRegion &) Q_DECL_OVERRIDE;
- void endPaint() Q_DECL_OVERRIDE;
+ void beginPaint(const QRegion &) override;
+ void endPaint() override;
- void flush(QWindow *window, const QRegion &region, const QPoint &offset) Q_DECL_OVERRIDE;
- void resize(const QSize &size, const QRegion &staticContents) Q_DECL_OVERRIDE;
+ void flush(QWindow *window, const QRegion &region, const QPoint &offset) override;
+ void resize(const QSize &size, const QRegion &staticContents) override;
private:
QOpenGLContext *m_context;
diff --git a/src/plugins/platforms/minimalegl/qminimaleglintegration.cpp b/src/plugins/platforms/minimalegl/qminimaleglintegration.cpp
index a716a6092a..5d31af53d5 100644
--- a/src/plugins/platforms/minimalegl/qminimaleglintegration.cpp
+++ b/src/plugins/platforms/minimalegl/qminimaleglintegration.cpp
@@ -71,7 +71,7 @@ public:
QWinRTEventDispatcher() {}
protected:
- bool hasPendingEvents() Q_DECL_OVERRIDE
+ bool hasPendingEvents() override
{
return QEventDispatcherWinRT::hasPendingEvents() || QWindowSystemInterface::windowSystemEventsQueued();
}
@@ -156,7 +156,7 @@ QAbstractEventDispatcher *QMinimalEglIntegration::createEventDispatcher() const
#elif defined(Q_OS_WIN)
return new QWindowsGuiEventDispatcher;
#else
- return Q_NULLPTR;
+ return nullptr;
#endif
}
diff --git a/src/plugins/platforms/minimalegl/qminimaleglintegration.h b/src/plugins/platforms/minimalegl/qminimaleglintegration.h
index d0ab75bd3c..70a51004a6 100644
--- a/src/plugins/platforms/minimalegl/qminimaleglintegration.h
+++ b/src/plugins/platforms/minimalegl/qminimaleglintegration.h
@@ -51,18 +51,18 @@ public:
QMinimalEglIntegration();
~QMinimalEglIntegration();
- bool hasCapability(QPlatformIntegration::Capability cap) const Q_DECL_OVERRIDE;
+ bool hasCapability(QPlatformIntegration::Capability cap) const override;
- QPlatformWindow *createPlatformWindow(QWindow *window) const Q_DECL_OVERRIDE;
- QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const Q_DECL_OVERRIDE;
+ QPlatformWindow *createPlatformWindow(QWindow *window) const override;
+ QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const override;
#ifndef QT_NO_OPENGL
- QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const Q_DECL_OVERRIDE;
+ QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override;
#endif
- QPlatformFontDatabase *fontDatabase() const Q_DECL_OVERRIDE;
+ QPlatformFontDatabase *fontDatabase() const override;
- QAbstractEventDispatcher *createEventDispatcher() const Q_DECL_OVERRIDE;
+ QAbstractEventDispatcher *createEventDispatcher() const override;
- QVariant styleHint(QPlatformIntegration::StyleHint hint) const Q_DECL_OVERRIDE;
+ QVariant styleHint(QPlatformIntegration::StyleHint hint) const override;
private:
QPlatformFontDatabase *mFontDb;
diff --git a/src/plugins/platforms/minimalegl/qminimaleglscreen.cpp b/src/plugins/platforms/minimalegl/qminimaleglscreen.cpp
index 0175d2dbdd..6e122e28ce 100644
--- a/src/plugins/platforms/minimalegl/qminimaleglscreen.cpp
+++ b/src/plugins/platforms/minimalegl/qminimaleglscreen.cpp
@@ -64,7 +64,7 @@ public:
{
}
- EGLSurface eglSurfaceForPlatformSurface(QPlatformSurface *surface) Q_DECL_OVERRIDE
+ EGLSurface eglSurfaceForPlatformSurface(QPlatformSurface *surface) override
{
QMinimalEglWindow *window = static_cast<QMinimalEglWindow *>(surface);
QMinimalEglScreen *screen = static_cast<QMinimalEglScreen *>(window->screen());
diff --git a/src/plugins/platforms/minimalegl/qminimaleglscreen.h b/src/plugins/platforms/minimalegl/qminimaleglscreen.h
index 24098b8127..926936ae32 100644
--- a/src/plugins/platforms/minimalegl/qminimaleglscreen.h
+++ b/src/plugins/platforms/minimalegl/qminimaleglscreen.h
@@ -56,9 +56,9 @@ public:
QMinimalEglScreen(EGLNativeDisplayType display);
~QMinimalEglScreen();
- QRect geometry() const Q_DECL_OVERRIDE;
- int depth() const Q_DECL_OVERRIDE;
- QImage::Format format() const Q_DECL_OVERRIDE;
+ QRect geometry() const override;
+ int depth() const override;
+ QImage::Format format() const override;
#ifndef QT_NO_OPENGL
QPlatformOpenGLContext *platformContext() const;
#endif
diff --git a/src/plugins/platforms/minimalegl/qminimaleglwindow.h b/src/plugins/platforms/minimalegl/qminimaleglwindow.h
index b8bfd6c8d2..098ec05e6b 100644
--- a/src/plugins/platforms/minimalegl/qminimaleglwindow.h
+++ b/src/plugins/platforms/minimalegl/qminimaleglwindow.h
@@ -51,8 +51,8 @@ class QMinimalEglWindow : public QPlatformWindow
public:
QMinimalEglWindow(QWindow *w);
- void setGeometry(const QRect &) Q_DECL_OVERRIDE;
- WId winId() const Q_DECL_OVERRIDE;
+ void setGeometry(const QRect &) override;
+ WId winId() const override;
private:
WId m_winid;
diff --git a/src/plugins/platforms/offscreen/main.cpp b/src/plugins/platforms/offscreen/main.cpp
index 9750c4f7ca..207db60f3a 100644
--- a/src/plugins/platforms/offscreen/main.cpp
+++ b/src/plugins/platforms/offscreen/main.cpp
@@ -48,7 +48,7 @@ class QOffscreenIntegrationPlugin : public QPlatformIntegrationPlugin
Q_OBJECT
Q_PLUGIN_METADATA(IID QPlatformIntegrationFactoryInterface_iid FILE "offscreen.json")
public:
- QPlatformIntegration *create(const QString&, const QStringList&) Q_DECL_OVERRIDE;
+ QPlatformIntegration *create(const QString&, const QStringList&) override;
};
QPlatformIntegration *QOffscreenIntegrationPlugin::create(const QString& system, const QStringList& paramList)
diff --git a/src/plugins/platforms/offscreen/qoffscreencommon.cpp b/src/plugins/platforms/offscreen/qoffscreencommon.cpp
index 85422071aa..f0eb69718a 100644
--- a/src/plugins/platforms/offscreen/qoffscreencommon.cpp
+++ b/src/plugins/platforms/offscreen/qoffscreencommon.cpp
@@ -55,8 +55,8 @@ class QOffscreenCursor : public QPlatformCursor
public:
QOffscreenCursor() : m_pos(10, 10) {}
- QPoint pos() const Q_DECL_OVERRIDE { return m_pos; }
- void setPos(const QPoint &pos) Q_DECL_OVERRIDE
+ QPoint pos() const override { return m_pos; }
+ void setPos(const QPoint &pos) override
{
m_pos = pos;
const QWindowList wl = QGuiApplication::topLevelWindows();
@@ -82,7 +82,7 @@ public:
QOffscreenScreen::windowContainingCursor = containing ? containing->handle() : 0;
}
#ifndef QT_NO_CURSOR
- void changeCursor(QCursor *windowCursor, QWindow *window) Q_DECL_OVERRIDE
+ void changeCursor(QCursor *windowCursor, QWindow *window) override
{
Q_UNUSED(windowCursor);
Q_UNUSED(window);
diff --git a/src/plugins/platforms/offscreen/qoffscreencommon.h b/src/plugins/platforms/offscreen/qoffscreencommon.h
index 1a9d65972d..541c07384c 100644
--- a/src/plugins/platforms/offscreen/qoffscreencommon.h
+++ b/src/plugins/platforms/offscreen/qoffscreencommon.h
@@ -57,12 +57,12 @@ class QOffscreenScreen : public QPlatformScreen
public:
QOffscreenScreen();
- QRect geometry() const Q_DECL_OVERRIDE { return m_geometry; }
- int depth() const Q_DECL_OVERRIDE { return 32; }
- QImage::Format format() const Q_DECL_OVERRIDE { return QImage::Format_RGB32; }
- QPlatformCursor *cursor() const Q_DECL_OVERRIDE { return m_cursor.data(); }
+ QRect geometry() const override { return m_geometry; }
+ int depth() const override { return 32; }
+ QImage::Format format() const override { return QImage::Format_RGB32; }
+ QPlatformCursor *cursor() const override { return m_cursor.data(); }
- QPixmap grabWindow(WId window, int x, int y, int width, int height) const Q_DECL_OVERRIDE;
+ QPixmap grabWindow(WId window, int x, int y, int width, int height) const override;
static QPlatformWindow *windowContainingCursor;
@@ -75,7 +75,7 @@ public:
class QOffscreenDrag : public QPlatformDrag
{
public:
- Qt::DropAction drag(QDrag *) Q_DECL_OVERRIDE { return Qt::IgnoreAction; }
+ Qt::DropAction drag(QDrag *) override { return Qt::IgnoreAction; }
};
#endif
@@ -85,10 +85,10 @@ public:
QOffscreenBackingStore(QWindow *window);
~QOffscreenBackingStore();
- QPaintDevice *paintDevice() Q_DECL_OVERRIDE;
- void flush(QWindow *window, const QRegion &region, const QPoint &offset) Q_DECL_OVERRIDE;
- void resize(const QSize &size, const QRegion &staticContents) Q_DECL_OVERRIDE;
- bool scroll(const QRegion &area, int dx, int dy) Q_DECL_OVERRIDE;
+ QPaintDevice *paintDevice() override;
+ void flush(QWindow *window, const QRegion &region, const QPoint &offset) override;
+ void resize(const QSize &size, const QRegion &staticContents) override;
+ bool scroll(const QRegion &area, int dx, int dy) override;
QPixmap grabWindow(WId window, const QRect &rect) const;
diff --git a/src/plugins/platforms/offscreen/qoffscreenintegration.h b/src/plugins/platforms/offscreen/qoffscreenintegration.h
index f72587d11a..c84c1f7c50 100644
--- a/src/plugins/platforms/offscreen/qoffscreenintegration.h
+++ b/src/plugins/platforms/offscreen/qoffscreenintegration.h
@@ -54,20 +54,20 @@ public:
QOffscreenIntegration();
~QOffscreenIntegration();
- void initialize() Q_DECL_OVERRIDE;
- bool hasCapability(QPlatformIntegration::Capability cap) const Q_DECL_OVERRIDE;
+ void initialize() override;
+ bool hasCapability(QPlatformIntegration::Capability cap) const override;
- QPlatformWindow *createPlatformWindow(QWindow *window) const Q_DECL_OVERRIDE;
- QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const Q_DECL_OVERRIDE;
+ QPlatformWindow *createPlatformWindow(QWindow *window) const override;
+ QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const override;
#ifndef QT_NO_DRAGANDDROP
- QPlatformDrag *drag() const Q_DECL_OVERRIDE;
+ QPlatformDrag *drag() const override;
#endif
- QPlatformInputContext *inputContext() const Q_DECL_OVERRIDE;
- QPlatformServices *services() const Q_DECL_OVERRIDE;
+ QPlatformInputContext *inputContext() const override;
+ QPlatformServices *services() const override;
- QPlatformFontDatabase *fontDatabase() const Q_DECL_OVERRIDE;
- QAbstractEventDispatcher *createEventDispatcher() const Q_DECL_OVERRIDE;
+ QPlatformFontDatabase *fontDatabase() const override;
+ QAbstractEventDispatcher *createEventDispatcher() const override;
QStringList themeNames() const;
QPlatformTheme *createPlatformTheme(const QString &name) const;
diff --git a/src/plugins/platforms/offscreen/qoffscreenintegration_x11.h b/src/plugins/platforms/offscreen/qoffscreenintegration_x11.h
index aaca74d2fb..5e1c6b799b 100644
--- a/src/plugins/platforms/offscreen/qoffscreenintegration_x11.h
+++ b/src/plugins/platforms/offscreen/qoffscreenintegration_x11.h
@@ -55,9 +55,9 @@ class QOffscreenX11Info;
class QOffscreenX11Integration : public QOffscreenIntegration
{
public:
- bool hasCapability(QPlatformIntegration::Capability cap) const Q_DECL_OVERRIDE;
+ bool hasCapability(QPlatformIntegration::Capability cap) const override;
- QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const Q_DECL_OVERRIDE;
+ QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override;
private:
mutable QScopedPointer<QOffscreenX11Connection> m_connection;
@@ -88,14 +88,14 @@ public:
QOffscreenX11GLXContext(QOffscreenX11Info *x11, QOpenGLContext *context);
~QOffscreenX11GLXContext();
- bool makeCurrent(QPlatformSurface *surface) Q_DECL_OVERRIDE;
- void doneCurrent() Q_DECL_OVERRIDE;
- void swapBuffers(QPlatformSurface *surface) Q_DECL_OVERRIDE;
- QFunctionPointer getProcAddress(const char *procName) Q_DECL_OVERRIDE;
+ bool makeCurrent(QPlatformSurface *surface) override;
+ void doneCurrent() override;
+ void swapBuffers(QPlatformSurface *surface) override;
+ QFunctionPointer getProcAddress(const char *procName) override;
- QSurfaceFormat format() const Q_DECL_OVERRIDE;
- bool isSharing() const Q_DECL_OVERRIDE;
- bool isValid() const Q_DECL_OVERRIDE;
+ QSurfaceFormat format() const override;
+ bool isSharing() const override;
+ bool isValid() const override;
private:
QScopedPointer<QOffscreenX11GLXContextData> d;
diff --git a/src/plugins/platforms/offscreen/qoffscreenwindow.h b/src/plugins/platforms/offscreen/qoffscreenwindow.h
index 0dced9680a..e1f37bb034 100644
--- a/src/plugins/platforms/offscreen/qoffscreenwindow.h
+++ b/src/plugins/platforms/offscreen/qoffscreenwindow.h
@@ -53,15 +53,15 @@ public:
QOffscreenWindow(QWindow *window);
~QOffscreenWindow();
- void setGeometry(const QRect &rect) Q_DECL_OVERRIDE;
- void setWindowState(Qt::WindowStates states) Q_DECL_OVERRIDE;
+ void setGeometry(const QRect &rect) override;
+ void setWindowState(Qt::WindowStates states) override;
- QMargins frameMargins() const Q_DECL_OVERRIDE;
+ QMargins frameMargins() const override;
- void setVisible(bool visible) Q_DECL_OVERRIDE;
- void requestActivateWindow() Q_DECL_OVERRIDE;
+ void setVisible(bool visible) override;
+ void requestActivateWindow() override;
- WId winId() const Q_DECL_OVERRIDE;
+ WId winId() const override;
static QOffscreenWindow *windowForWinId(WId id);
diff --git a/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp b/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp
index a758bdf7f4..dd7f907ee0 100644
--- a/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp
+++ b/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp
@@ -139,6 +139,7 @@ void QQnxRasterBackingStore::beginPaint(const QRegion &region)
platformWindow()->adjustBufferSize();
if (window()->requestedFormat().alphaBufferSize() > 0) {
+ auto platformScreen = static_cast<QQnxScreen *>(platformWindow()->screen());
for (const QRect &r : region) {
// Clear transparent regions
const int bg[] = {
@@ -149,11 +150,11 @@ void QQnxRasterBackingStore::beginPaint(const QRegion &region)
SCREEN_BLIT_DESTINATION_HEIGHT, r.height(),
SCREEN_BLIT_END
};
- Q_SCREEN_CHECKERROR(screen_fill(platformWindow()->screen()->nativeContext(),
+ Q_SCREEN_CHECKERROR(screen_fill(platformScreen->nativeContext(),
platformWindow()->renderBuffer().nativeBuffer(), bg),
"failed to clear transparent regions");
}
- Q_SCREEN_CHECKERROR(screen_flush_blits(platformWindow()->screen()->nativeContext(),
+ Q_SCREEN_CHECKERROR(screen_flush_blits(platformScreen->nativeContext(),
SCREEN_WAIT_IDLE), "failed to flush blits");
}
}
diff --git a/src/plugins/platforms/qnx/qqnxrasterwindow.cpp b/src/plugins/platforms/qnx/qqnxrasterwindow.cpp
index 7f11de228e..dc844189d1 100644
--- a/src/plugins/platforms/qnx/qqnxrasterwindow.cpp
+++ b/src/plugins/platforms/qnx/qqnxrasterwindow.cpp
@@ -141,6 +141,7 @@ QQnxBuffer &QQnxRasterWindow::renderBuffer()
// Check if render buffer is invalid
if (m_currentBufferIndex == -1) {
+ auto platformScreen = static_cast<QQnxScreen *>(screen());
// Get all buffers available for rendering
screen_buffer_t buffers[MAX_BUFFER_COUNT];
const int result = screen_get_window_property_pv(nativeHandle(), SCREEN_PROPERTY_RENDER_BUFFERS,
@@ -153,11 +154,11 @@ QQnxBuffer &QQnxRasterWindow::renderBuffer()
// Clear Buffer
int bg[] = { SCREEN_BLIT_COLOR, 0x00000000, SCREEN_BLIT_END };
- Q_SCREEN_CHECKERROR(screen_fill(screen()->nativeContext(), buffers[i], bg),
+ Q_SCREEN_CHECKERROR(screen_fill(platformScreen->nativeContext(), buffers[i], bg),
"Failed to clear window buffer");
}
- Q_SCREEN_CHECKERROR(screen_flush_blits(screen()->nativeContext(), 0),
+ Q_SCREEN_CHECKERROR(screen_flush_blits(platformScreen->nativeContext(), 0),
"Failed to flush blits");
// Use the first available render buffer
@@ -185,7 +186,7 @@ void QQnxRasterWindow::adjustBufferSize()
int QQnxRasterWindow::pixelFormat() const
{
- return screen()->nativeFormat();
+ return static_cast<QQnxScreen *>(screen())->nativeFormat();
}
void QQnxRasterWindow::resetBuffers()
diff --git a/src/plugins/platforms/qnx/qqnxwindow.cpp b/src/plugins/platforms/qnx/qqnxwindow.cpp
index 2253e3b23d..38b61fd782 100644
--- a/src/plugins/platforms/qnx/qqnxwindow.cpp
+++ b/src/plugins/platforms/qnx/qqnxwindow.cpp
@@ -479,7 +479,7 @@ void QQnxWindow::setParent(const QPlatformWindow *window)
if (newParent == m_parentWindow)
return;
- if (screen()->rootWindow() == this) {
+ if (static_cast<QQnxScreen *>(screen())->rootWindow() == this) {
qWarning("Application window cannot be reparented");
return;
}
@@ -539,7 +539,7 @@ void QQnxWindow::requestActivateWindow()
if (focusWindow == this)
return;
- if (screen()->rootWindow() == this ||
+ if (static_cast<QQnxScreen *>(screen())->rootWindow() == this ||
(focusWindow && findWindow(focusWindow->nativeHandle()))) {
// If the focus window is a child, we can just set the focus of our own window
// group to our window handle
@@ -550,6 +550,7 @@ void QQnxWindow::requestActivateWindow()
QQnxWindow *currentWindow = this;
QList<QQnxWindow*> windowList;
while (currentWindow) {
+ auto platformScreen = static_cast<QQnxScreen *>(screen());
windowList.prepend(currentWindow);
// If we find the focus window, we don't have to go further
if (currentWindow == focusWindow)
@@ -557,9 +558,9 @@ void QQnxWindow::requestActivateWindow()
if (currentWindow->parent()){
currentWindow = static_cast<QQnxWindow*>(currentWindow->parent());
- } else if (screen()->rootWindow() &&
- screen()->rootWindow()->m_windowGroupName == currentWindow->m_parentGroupName) {
- currentWindow = screen()->rootWindow();
+ } else if (platformScreen->rootWindow() &&
+ platformScreen->rootWindow()->m_windowGroupName == currentWindow->m_parentGroupName) {
+ currentWindow = platformScreen->rootWindow();
} else {
currentWindow = 0;
}
@@ -622,6 +623,11 @@ void QQnxWindow::clearMMRendererWindow()
m_mmRendererWindow = 0;
}
+QPlatformScreen *QQnxWindow::screen() const
+{
+ return m_screen;
+}
+
QQnxWindow *QQnxWindow::findWindow(screen_window_t windowHandle)
{
if (m_window == windowHandle)
@@ -775,7 +781,8 @@ void QQnxWindow::windowPosted()
bool QQnxWindow::shouldMakeFullScreen() const
{
- return ((screen()->rootWindow() == this) && (QQnxIntegration::options() & QQnxIntegration::FullScreenApplication));
+ return ((static_cast<QQnxScreen *>(screen())->rootWindow() == this)
+ && (QQnxIntegration::options() & QQnxIntegration::FullScreenApplication));
}
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/qnx/qqnxwindow.h b/src/plugins/platforms/qnx/qqnxwindow.h
index f96edc49e4..dfcca78f80 100644
--- a/src/plugins/platforms/qnx/qqnxwindow.h
+++ b/src/plugins/platforms/qnx/qqnxwindow.h
@@ -94,7 +94,7 @@ public:
void setMMRendererWindow(screen_window_t handle);
void clearMMRendererWindow();
- QQnxScreen *screen() const { return m_screen; }
+ QPlatformScreen *screen() const override;
const QList<QQnxWindow*>& children() const { return m_childWindows; }
QQnxWindow *findWindow(screen_window_t windowHandle);
diff --git a/src/plugins/platforms/windows/accessible/accessible.pri b/src/plugins/platforms/windows/accessible/accessible.pri
deleted file mode 100644
index 557bdfe307..0000000000
--- a/src/plugins/platforms/windows/accessible/accessible.pri
+++ /dev/null
@@ -1,19 +0,0 @@
-SOURCES += \
- $$PWD/qwindowsaccessibility.cpp \
- $$PWD/comutils.cpp
-
-HEADERS += \
- $$PWD/qwindowsaccessibility.h \
- $$PWD/comutils.h
-
-SOURCES += \
- $$PWD/qwindowsmsaaaccessible.cpp \
- $$PWD/iaccessible2.cpp
-
-HEADERS += \
- $$PWD/qwindowsmsaaaccessible.h \
- $$PWD/iaccessible2.h
-
-include(../../../../3rdparty/iaccessible2/iaccessible2.pri)
-
-mingw: LIBS *= -luuid
diff --git a/src/plugins/platforms/windows/accessible/comutils.cpp b/src/plugins/platforms/windows/accessible/comutils.cpp
deleted file mode 100644
index 1c072c5e2c..0000000000
--- a/src/plugins/platforms/windows/accessible/comutils.cpp
+++ /dev/null
@@ -1,280 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 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 <qt_windows.h>
-
-#include <ocidl.h>
-#include <olectl.h>
-
-#include "comutils.h"
-#include <QtCore/qdatetime.h>
-#include <QtGui/qpixmap.h>
-#include <QtGui/qfont.h>
-
-
-#include <QtCore/qvariant.h>
-#include <QtCore/qbytearray.h>
-#include <QtGui/qcolor.h>
-
-QT_BEGIN_NAMESPACE
-
-static DATE QDateTimeToDATE(const QDateTime &dt)
-{
- if (!dt.isValid() || dt.isNull())
- return 949998; // Special value for no date (01/01/4501)
-
- SYSTEMTIME stime;
- memset(&stime, 0, sizeof(stime));
- QDate date = dt.date();
- QTime time = dt.time();
- if (date.isValid() && !date.isNull()) {
- stime.wDay = WORD(date.day());
- stime.wMonth = WORD(date.month());
- stime.wYear = WORD(date.year());
- }
- if (time.isValid() && !time.isNull()) {
- stime.wMilliseconds = WORD(time.msec());
- stime.wSecond = WORD(time.second());
- stime.wMinute = WORD(time.minute());
- stime.wHour = WORD(time.hour());
- }
-
- double vtime;
- SystemTimeToVariantTime(&stime, &vtime);
-
- return vtime;
-}
-
-inline uint QColorToOLEColor(const QColor &col)
-{
- return qRgba(col.blue(), col.green(), col.red(), 0x00);
-}
-
-bool QVariant2VARIANT(const QVariant &var, VARIANT &arg, const QByteArray &typeName, bool out)
-{
- QVariant qvar = var;
- // "type" is the expected type, so coerce if necessary
- QVariant::Type proptype = typeName.isEmpty() ? QVariant::Invalid : QVariant::nameToType(typeName);
- if (proptype == QVariant::UserType && !typeName.isEmpty()) {
- if (typeName == "short" || typeName == "char")
- proptype = QVariant::Int;
- else if (typeName == "float")
- proptype = QVariant::Double;
- }
- if (proptype != QVariant::Invalid && proptype != QVariant::UserType && proptype != qvar.type()) {
- if (qvar.canConvert(int(proptype)))
- qvar.convert(int(proptype));
- else
- qvar = QVariant(proptype);
- }
-
- if (out && arg.vt == (VT_VARIANT|VT_BYREF) && arg.pvarVal) {
- return QVariant2VARIANT(var, *arg.pvarVal, typeName, false);
- }
-
- if (out && proptype == QVariant::UserType && typeName == "QVariant") {
- VARIANT *pVariant = new VARIANT;
- QVariant2VARIANT(var, *pVariant, QByteArray(), false);
- arg.vt = VT_VARIANT|VT_BYREF;
- arg.pvarVal = pVariant;
- return true;
- }
-
- switch ((int)qvar.type()) {
- case QVariant::String:
- if (out && arg.vt == (VT_BSTR|VT_BYREF)) {
- if (*arg.pbstrVal)
- SysFreeString(*arg.pbstrVal);
- *arg.pbstrVal = QStringToBSTR(qvar.toString());
- arg.vt = VT_BSTR|VT_BYREF;
- } else {
- arg.vt = VT_BSTR;
- arg.bstrVal = QStringToBSTR(qvar.toString());
- if (out) {
- arg.pbstrVal = new BSTR(arg.bstrVal);
- arg.vt |= VT_BYREF;
- }
- }
- break;
-
- case QVariant::Int:
- if (out && arg.vt == (VT_I4|VT_BYREF)) {
- *arg.plVal = qvar.toInt();
- } else {
- arg.vt = VT_I4;
- arg.lVal = qvar.toInt();
- if (out) {
- if (typeName == "short") {
- arg.vt = VT_I2;
- arg.piVal = new short(arg.lVal);
- } else if (typeName == "char") {
- arg.vt = VT_I1;
- arg.pcVal= new char(arg.lVal);
- } else {
- arg.plVal = new long(arg.lVal);
- }
- arg.vt |= VT_BYREF;
- }
- }
- break;
-
- case QVariant::UInt:
- if (out && (arg.vt == (VT_UINT|VT_BYREF) || arg.vt == (VT_I4|VT_BYREF))) {
- *arg.puintVal = qvar.toUInt();
- } else {
- arg.vt = VT_UINT;
- arg.uintVal = qvar.toUInt();
- if (out) {
- arg.puintVal = new uint(arg.uintVal);
- arg.vt |= VT_BYREF;
- }
- }
- break;
-
- case QVariant::LongLong:
- if (out && arg.vt == (VT_CY|VT_BYREF)) {
- arg.pcyVal->int64 = qvar.toLongLong();
- } else if (out && arg.vt == (VT_I8|VT_BYREF)) {
- *arg.pllVal = qvar.toLongLong();
- } else {
- arg.vt = VT_I8;
- arg.llVal = qvar.toLongLong();
- if (out) {
- arg.pllVal = new LONGLONG(arg.llVal);
- arg.vt |= VT_BYREF;
- }
- }
- break;
-
- case QVariant::ULongLong:
- if (out && arg.vt == (VT_CY|VT_BYREF)) {
- arg.pcyVal->int64 = qvar.toULongLong();
- } else if (out && arg.vt == (VT_UI8|VT_BYREF)) {
- *arg.pullVal = qvar.toULongLong();
- } else {
- arg.vt = VT_UI8;
- arg.ullVal = qvar.toULongLong();
- if (out) {
- arg.pullVal = new ULONGLONG(arg.ullVal);
- arg.vt |= VT_BYREF;
- }
- }
- break;
-
- case QVariant::Bool:
- if (out && arg.vt == (VT_BOOL|VT_BYREF)) {
- *arg.pboolVal = qvar.toBool() ? VARIANT_TRUE : VARIANT_FALSE;
- } else {
- arg.vt = VT_BOOL;
- arg.boolVal = qvar.toBool() ? VARIANT_TRUE : VARIANT_FALSE;
- if (out) {
- arg.pboolVal = new short(arg.boolVal);
- arg.vt |= VT_BYREF;
- }
- }
- break;
- case QVariant::Double:
- if (out && arg.vt == (VT_R8|VT_BYREF)) {
- *arg.pdblVal = qvar.toDouble();
- } else {
- arg.vt = VT_R8;
- arg.dblVal = qvar.toDouble();
- if (out) {
- if (typeName == "float") {
- arg.vt = VT_R4;
- arg.pfltVal = new float(arg.dblVal);
- } else {
- arg.pdblVal = new double(arg.dblVal);
- }
- arg.vt |= VT_BYREF;
- }
- }
- break;
- case QVariant::Color:
- if (out && arg.vt == (VT_COLOR|VT_BYREF)) {
-
- *arg.plVal = QColorToOLEColor(qvariant_cast<QColor>(qvar));
- } else {
- arg.vt = VT_COLOR;
- arg.lVal = QColorToOLEColor(qvariant_cast<QColor>(qvar));
- if (out) {
- arg.plVal = new long(arg.lVal);
- arg.vt |= VT_BYREF;
- }
- }
- break;
-
- case QVariant::Date:
- case QVariant::Time:
- case QVariant::DateTime:
- if (out && arg.vt == (VT_DATE|VT_BYREF)) {
- *arg.pdate = QDateTimeToDATE(qvar.toDateTime());
- } else {
- arg.vt = VT_DATE;
- arg.date = QDateTimeToDATE(qvar.toDateTime());
- if (out) {
- arg.pdate = new DATE(arg.date);
- arg.vt |= VT_BYREF;
- }
- }
- break;
-
- case QVariant::Invalid: // default-parameters not set
- if (out && arg.vt == (VT_ERROR|VT_BYREF)) {
- *arg.plVal = DISP_E_PARAMNOTFOUND;
- } else {
- arg.vt = VT_ERROR;
- arg.lVal = DISP_E_PARAMNOTFOUND;
- if (out) {
- arg.plVal = new long(arg.lVal);
- arg.vt |= VT_BYREF;
- }
- }
- break;
-
- default:
- return false;
- }
-
- Q_ASSERT(!out || (arg.vt & VT_BYREF));
- return true;
-}
-
-QT_END_NAMESPACE
-
diff --git a/src/plugins/platforms/windows/accessible/iaccessible2.cpp b/src/plugins/platforms/windows/accessible/iaccessible2.cpp
deleted file mode 100644
index 75af65b5ab..0000000000
--- a/src/plugins/platforms/windows/accessible/iaccessible2.cpp
+++ /dev/null
@@ -1,1640 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 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 <QtCore/qglobal.h>
-#ifndef QT_NO_ACCESSIBILITY
-
-#include "iaccessible2.h"
-#include "qwindowsaccessibility.h"
-#include <QtAccessibilitySupport/private/qaccessiblebridgeutils_p.h>
-#include <QtGui/qaccessible.h>
-#include <QtGui/qclipboard.h>
-#include <QtGui/qguiapplication.h>
-#include <QtGui/private/qhighdpiscaling_p.h>
-#include <QtCore/qdebug.h>
-
-#include <algorithm>
-
-QT_BEGIN_NAMESPACE
-
-template <class T>
-static inline T *coTaskMemAllocArray(int size)
-{
- return static_cast<T *>(::CoTaskMemAlloc(sizeof(T) * size_t(size)));
-}
-
-/**************************************************************\
- * AccessibleApplication *
- **************************************************************/
-
-HRESULT STDMETHODCALLTYPE AccessibleApplication::get_appName(/* [retval][out] */ BSTR *name)
-{
- const QString appName = QGuiApplication::applicationName();
- *name = QStringToBSTR(appName);
- return S_OK;
-}
-
-HRESULT STDMETHODCALLTYPE AccessibleApplication::get_appVersion(/* [retval][out] */ BSTR *version)
-{
- const QString appName = QGuiApplication::applicationVersion();
- *version = QStringToBSTR(appName);
- return S_OK;
-}
-
-HRESULT STDMETHODCALLTYPE AccessibleApplication::get_toolkitName(/* [retval][out] */ BSTR *name)
-{
- *name = ::SysAllocString(L"Qt");
- return S_OK;
-}
-
-HRESULT STDMETHODCALLTYPE AccessibleApplication::get_toolkitVersion(/* [retval][out] */ BSTR *version)
-{
- *version = ::SysAllocString(TEXT(QT_VERSION_STR));
- return S_OK;
-}
-
-
-/**************************************************************\
- * AccessibleRelation *
- **************************************************************/
-AccessibleRelation::AccessibleRelation(const QList<QAccessibleInterface *> &targets,
- QAccessible::Relation relation)
- : m_targets(targets), m_relation(relation)
-{
- Q_ASSERT(m_targets.count());
-}
-
-/* IAccessibleRelation */
-HRESULT STDMETHODCALLTYPE AccessibleRelation::get_relationType(
- /* [retval][out] */ BSTR *relationType)
-{
- *relationType = relationToBSTR(m_relation);
- return S_OK;
-}
-
-HRESULT STDMETHODCALLTYPE AccessibleRelation::get_localizedRelationType(
- /* [retval][out] */ BSTR *localizedRelationType)
-{
- // Who ever needs this???
- *localizedRelationType = relationToBSTR(m_relation);
- return S_OK;
-}
-
-HRESULT STDMETHODCALLTYPE AccessibleRelation::get_nTargets(
- /* [retval][out] */ long *nTargets)
-{
- // ### always one target
- *nTargets = m_targets.count();
- return S_OK;
-}
-
-/*!
- \internal
- Client allocates and deallocates array
- (see "Special Consideration when using Arrays", in Accessible2.idl)
- */
-HRESULT STDMETHODCALLTYPE AccessibleRelation::get_target(
- /* [in] */ long targetIndex,
- /* [retval][out] */ IUnknown **target)
-{
- if (targetIndex >= 0 && targetIndex < m_targets.count()) {
- QAccessibleInterface *iface = m_targets.at(targetIndex);
- *target = QWindowsAccessibility::wrap(iface);
- if (*target)
- return S_OK;
- return E_FAIL;
- }
- return E_INVALIDARG;
-}
-
-/*!
- \internal
- Client allocates and deallocates \a targets array
- (see "Special Consideration when using Arrays", in Accessible2.idl)
- */
-HRESULT STDMETHODCALLTYPE AccessibleRelation::get_targets(
- /* [in] */ long maxTargets,
- /* [length_is][size_is][out] */ IUnknown **targets,
- /* [retval][out] */ long *nTargets)
-{
-
- const int numTargets = qMin(int(maxTargets), m_targets.count());
- for (int i = 0; i < numTargets; ++i) {
- QAccessibleInterface *iface = m_targets.at(i);
- IAccessible *iacc = QWindowsAccessibility::wrap(iface);
- if (!iacc)
- return E_FAIL;
- *targets = iacc;
- ++targets;
- }
- *nTargets = numTargets;
- // \a targets array is allocated by client.
- return numTargets > 0 ? S_OK : S_FALSE;
-}
-
-
-/**************************************************************\
- * *
- * IUnknown *
- * *
- **************************************************************/
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::QueryInterface(REFIID id, LPVOID *iface)
-{
- *iface = nullptr;
- QAccessibleInterface *accessible = accessibleInterface();
- if (!accessible)
- return E_NOINTERFACE;
-
- if (SUCCEEDED(QWindowsMsaaAccessible::QueryInterface(id, iface))
- || qWindowsComQueryInterface<IServiceProvider>(this, id, iface)
- || qWindowsComQueryInterface<IAccessible2>(this, id, iface)
- || qWindowsComQueryInterface<IAccessibleComponent>(this, id, iface)) {
- return S_OK;
- }
-
- if (id == IID_IAccessibleAction) {
- if (accessible->actionInterface())
- *iface = static_cast<IAccessibleAction *>(this);
- } else if (id == IID_IAccessibleEditableText) {
- if (accessible->editableTextInterface() ||
- accessible->role() == QAccessible::EditableText)
- {
- *iface = static_cast<IAccessibleEditableText *>(this);
- }
- } else if (id == IID_IAccessibleHyperlink) {
- //*iface = static_cast<IAccessibleHyperlink *>(this);
- } else if (id == IID_IAccessibleHypertext) {
- //*iface = static_cast<IAccessibleHypertext *>(this);
- } else if (id == IID_IAccessibleImage) {
- //*iface = static_cast<IAccessibleImage *>(this);
- } else if (id == IID_IAccessibleTable) {
- //*iface = static_cast<IAccessibleTable *>(this); // not supported
- } else if (id == IID_IAccessibleTable2) {
- if (accessible->tableInterface())
- *iface = static_cast<IAccessibleTable2 *>(this);
- } else if (id == IID_IAccessibleTableCell) {
- if (accessible->tableCellInterface())
- *iface = static_cast<IAccessibleTableCell *>(this);
- } else if (id == IID_IAccessibleText) {
- if (accessible->textInterface())
- *iface = static_cast<IAccessibleText *>(this);
- } else if (id == IID_IAccessibleValue) {
- if (accessible->valueInterface())
- *iface = static_cast<IAccessibleValue *>(this);
- }
- if (*iface) {
- AddRef();
- return S_OK;
- }
- return E_NOINTERFACE;
-}
-
-
-/* Note that IUnknown is inherited from several interfaces. Therefore we must reimplement all its
- functions in the concrete class to avoid ambiguity.
-*/
-ULONG STDMETHODCALLTYPE QWindowsIA2Accessible::AddRef()
-{
- return QWindowsMsaaAccessible::AddRef();
-}
-
-ULONG STDMETHODCALLTYPE QWindowsIA2Accessible::Release()
-{
- return QWindowsMsaaAccessible::Release();
-}
-
-/**************************************************************\
- * *
- * IAccessible2 *
- * *
- **************************************************************/
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_nRelations(long *nRelations)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (!nRelations)
- return E_INVALIDARG;
- if (!accessible)
- return E_FAIL;
-
- return getRelationsHelper(0, 0, 0, nRelations);
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_relation(long relationIndex, IAccessibleRelation **relation)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (!relation)
- return E_INVALIDARG;
- if (!accessible)
- return E_FAIL;
-
- return getRelationsHelper(relation, relationIndex, 1);
-}
-
-/*!
- \internal
- Client allocates and deallocates array
- (see "Special Consideration when using Arrays", in Accessible2.idl)
- */
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_relations(long maxRelations,
- IAccessibleRelation **relations,
- long *nRelations)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (!accessible)
- return E_FAIL;
-
- return getRelationsHelper(relations, 0, maxRelations, nRelations);
-}
-
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::role(long *ia2role)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (!accessible)
- return E_FAIL;
-
- long r = accessible->role();
-
- switch (r) {
- case QAccessible::LayeredPane: r = IA2_ROLE_LAYERED_PANE; break;
- case QAccessible::Terminal: r = IA2_ROLE_TERMINAL; break;
- case QAccessible::Desktop: r = IA2_ROLE_DESKTOP_PANE; break;
- case QAccessible::Paragraph: r = IA2_ROLE_PARAGRAPH; break;
- case QAccessible::Section: r = IA2_ROLE_SECTION; break;
- default: break;
- }
-
- *ia2role = r;
- return S_OK;
-}
-
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::scrollTo(enum IA2ScrollType /*scrollType*/)
-{
- //### Ignore for now
- return E_NOTIMPL;
-}
-
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::scrollToPoint(enum IA2CoordinateType /*coordinateType*/, long /*x*/, long /*y*/)
-{
- //### Ignore for now
- return E_NOTIMPL;
-}
-
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_groupPosition(long *groupLevel,
- long *similarItemsInGroup,
- long *positionInGroup)
-{
- // ### Ignore for now. Not sure what this is used for.....
- *groupLevel = 0; // Not applicable
- *similarItemsInGroup = 0; // Not applicable
- *positionInGroup = 0; // Not applicable
- return S_FALSE;
-}
-
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_states(AccessibleStates *states)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (!accessible)
- return E_FAIL;
- if (!states)
- return E_POINTER;
- QAccessible::State st = accessible->state();
- AccessibleStates ia2states = 0;
- if (st.active)
- ia2states |= IA2_STATE_ACTIVE;
- if (st.invalid)
- ia2states |= IA2_STATE_DEFUNCT;
- if (st.editable)
- ia2states |= IA2_STATE_EDITABLE;
- if (st.multiLine)
- ia2states |= IA2_STATE_MULTI_LINE;
- if (st.selectableText)
- ia2states |= IA2_STATE_SELECTABLE_TEXT;
- if (st.supportsAutoCompletion)
- ia2states |= IA2_STATE_SUPPORTS_AUTOCOMPLETION;
-
- *states = ia2states;
- return S_OK;
-}
-
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_extendedRole(BSTR *extendedRole)
-{
- //###
- *extendedRole = 0;
- return E_NOTIMPL; // mozilla does this
- //return S_FALSE;
-}
-
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_localizedExtendedRole(BSTR *localizedExtendedRole)
-{
- //###
- *localizedExtendedRole = 0;
- return E_NOTIMPL; // mozilla does this
- //return S_FALSE;
-}
-
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_nExtendedStates(long *nExtendedStates)
-{
- // Who will ever intepret these values into something meaningful??
- *nExtendedStates = 0;
- return E_NOTIMPL; // mozilla does this
- //return S_FALSE;
-}
-
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_extendedStates(long /*maxExtendedStates*/,
- BSTR **extendedStates,
- long *nExtendedStates)
-{
- *extendedStates = 0;
- *nExtendedStates = 0;
- return E_NOTIMPL; // mozilla does this
- //return S_FALSE;
-}
-
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_localizedExtendedStates(long /*maxLocalizedExtendedStates*/,
- BSTR **localizedExtendedStates,
- long *nLocalizedExtendedStates)
-{
- *localizedExtendedStates = 0;
- *nLocalizedExtendedStates = 0;
- return E_NOTIMPL; // mozilla does this
- //return S_FALSE;
-}
-
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_uniqueID(long *outUniqueID)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (!accessible)
- return E_FAIL;
-
- qCDebug(lcQpaAccessibility) << "uniqueID: " << showbase << hex << id;
-
- *outUniqueID = (long)id;
- return int(id) < 0 ? S_OK : S_FALSE;
-}
-
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_windowHandle(HWND *windowHandle)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (!accessible)
- return E_FAIL;
- return GetWindow(windowHandle);
-}
-
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_indexInParent(long *indexInParent)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (!accessible)
- return E_FAIL;
- if (!indexInParent)
- return E_INVALIDARG;
- QAccessibleInterface *par = accessible->parent();
- *indexInParent = par ? par->indexOfChild(accessible) : -1;
- if (*indexInParent < 0) {
- qCWarning(lcQpaAccessibility) << "index in parent invalid:" << accessible << "parent:" << par;
- return S_FALSE;
- }
- return S_OK;
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_locale(IA2Locale *locale)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (!accessible)
- return E_FAIL;
- IA2Locale res;
- QLocale l;
- res.country = QStringToBSTR(QLocale::countryToString(l.country()));
- res.language = QStringToBSTR(QLocale::languageToString(l.language()));
- res.variant = QStringToBSTR(QString());
- *locale = res;
- return S_OK;
-}
-
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_attributes(BSTR *attributes)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (!accessible)
- return E_FAIL;
- *attributes = 0;//QStringToBSTR(QString());
- return S_FALSE;
-}
-
-/**************************************************************\
- * IAccessibleAction *
- **************************************************************/
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::nActions(long *nActions)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (!accessible)
- return E_FAIL;
- *nActions = QAccessibleBridgeUtils::effectiveActionNames(accessible).count();
- return S_OK;
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::doAction(long actionIndex)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (!accessible)
- return E_FAIL;
- const QStringList actionNames = QAccessibleBridgeUtils::effectiveActionNames(accessible);
- if (actionIndex < 0 || actionIndex >= actionNames.count())
- return E_INVALIDARG;
- const QString actionName = actionNames.at(actionIndex);
- return QAccessibleBridgeUtils::performEffectiveAction(accessible, actionName) ? S_OK : S_FALSE;
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_description(long actionIndex, BSTR *description)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (!accessible)
- return E_FAIL;
- *description = 0;
- const QStringList actionNames = QAccessibleBridgeUtils::effectiveActionNames(accessible);
- if (actionIndex < 0 || actionIndex >= actionNames.count())
- return E_INVALIDARG;
- const QString actionName = actionNames.at(actionIndex);
- if (QAccessibleActionInterface *actionIface = actionInterface())
- *description = QStringToBSTR(actionIface->localizedActionDescription(actionName));
- else
- *description = QStringToBSTR(qAccessibleLocalizedActionDescription(actionName));
-
- return *description ? S_OK : S_FALSE;
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_keyBinding(long actionIndex, long nMaxBindings, BSTR **keyBindings, long *nBindings)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (!accessible)
- return E_FAIL;
- Q_UNUSED(nMaxBindings);
- BSTR *arrayOfBindingsToReturn = 0;
- int numBindings = 0;
- if (QAccessibleActionInterface *actionIface = actionInterface()) {
- const QStringList actionNames = actionIface->actionNames();
- if (actionIndex < 0 || actionIndex >= actionNames.count())
- return E_INVALIDARG;
- const QString actionName = actionNames.at(actionIndex);
- const QStringList keyBindings = actionIface->keyBindingsForAction(actionName);
- numBindings = keyBindings.count();
- if (numBindings > 0) {
- // The IDL documents that the client must free with CoTaskMemFree
- arrayOfBindingsToReturn = coTaskMemAllocArray<BSTR>(numBindings);
- std::transform(keyBindings.constBegin(), keyBindings.constEnd(),
- QT_MAKE_CHECKED_ARRAY_ITERATOR(arrayOfBindingsToReturn, numBindings),
- QStringToBSTR);
- }
- }
- *keyBindings = arrayOfBindingsToReturn;
- *nBindings = numBindings;
-
- return numBindings ? S_OK : S_FALSE;
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_name(long actionIndex, BSTR *name)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (!accessible)
- return E_FAIL;
- *name = 0;
- const QStringList actionNames = QAccessibleBridgeUtils::effectiveActionNames(accessible);
- if (actionIndex < 0 || actionIndex >= actionNames.count())
- return E_INVALIDARG;
- const QString actionName = actionNames.at(actionIndex);
- *name = QStringToBSTR(actionName);
- return *name ? S_OK : S_FALSE;
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_localizedName(long actionIndex, BSTR *localizedName)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (!accessible)
- return E_FAIL;
- *localizedName = 0;
- const QStringList actionNames = QAccessibleBridgeUtils::effectiveActionNames(accessible);
- if (actionIndex < 0 || actionIndex >= actionNames.count())
- return E_INVALIDARG;
-
- const QString actionName = actionNames.at(actionIndex);
- if (QAccessibleActionInterface *actionIface = actionInterface())
- *localizedName = QStringToBSTR(actionIface->localizedActionName(actionName));
- else
- *localizedName = QStringToBSTR(QAccessibleActionInterface::tr(qPrintable(actionName)));
-
- return *localizedName ? S_OK : S_FALSE;
-}
-
-/**************************************************************\
- * IAccessibleComponent *
- **************************************************************/
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_locationInParent(long *x, long *y)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (!accessible)
- return E_FAIL;
-
- QPoint topLeft = accessible->rect().topLeft();
-
- QAccessibleInterface *parentIface = accessible->parent();
- if (parentIface && parentIface->isValid())
- topLeft -= parentIface->rect().topLeft();
- const QPoint nativeTopLeft = QHighDpi::toNativeLocalPosition(topLeft, accessible->window());
-
-
- *x = nativeTopLeft.x();
- *y = nativeTopLeft.y();
- return S_OK;
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_foreground(IA2Color *foreground)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (!accessible)
- return E_FAIL;
-
- // IA2Color is a typedef for long
- *foreground = static_cast<IA2Color>(accessible->foregroundColor().rgb());
- return S_OK;
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_background(IA2Color *background)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (!accessible)
- return E_FAIL;
-
- // IA2Color is a typedef for long
- *background = static_cast<IA2Color>(accessible->backgroundColor().rgb());
- return S_OK;
-}
-
-/**************************************************************\
- * IAccessibleEditableText *
- **************************************************************/
-#if QT_CONFIG(clipboard)
-/*!
- \internal
-
- if \a endOffset == -1 it means end of the text
-*/
-QString QWindowsIA2Accessible::textForRange(int startOffset, int endOffset) const
-{
- QAccessibleInterface *accessible = accessibleInterface();
-
- if (QAccessibleTextInterface *textIface = accessible->textInterface()) {
- if (endOffset == IA2_TEXT_OFFSET_LENGTH)
- endOffset = textIface->characterCount();
- return textIface->text(startOffset, endOffset);
- }
- QString txt = accessible->text(QAccessible::Value);
- if (endOffset == IA2_TEXT_OFFSET_LENGTH)
- endOffset = txt.length();
- return txt.mid(startOffset, endOffset - startOffset);
-}
-#endif
-
-/*!
- \internal
-*/
-void QWindowsIA2Accessible::replaceTextFallback(long startOffset, long endOffset, const QString &txt)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- QString t = textForRange(0, -1);
- if (endOffset == IA2_TEXT_OFFSET_LENGTH)
- endOffset = t.length();
- if (endOffset - startOffset == 0) {
- t.insert(startOffset, txt);
- } else {
- t.replace(startOffset, endOffset - startOffset, txt);
- }
- accessible->setText(QAccessible::Value, t);
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::copyText(long startOffset, long endOffset)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
-#if QT_CONFIG(clipboard)
- const QString t = textForRange(startOffset, endOffset);
- QGuiApplication::clipboard()->setText(t);
- return S_OK;
-#else
- return E_NOTIMPL;
-#endif
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::deleteText(long startOffset, long endOffset)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (QAccessibleEditableTextInterface *editableTextIface = accessible->editableTextInterface())
- editableTextIface->deleteText(startOffset, endOffset);
- else
- replaceTextFallback(startOffset, endOffset, QString());
- return S_OK;
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::insertText(long offset, BSTR *text)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- const QString txt = QString::fromWCharArray(*text);
- if (QAccessibleEditableTextInterface *editableTextIface = accessible->editableTextInterface())
- editableTextIface->insertText(offset, txt);
- else
- replaceTextFallback(offset, offset, txt);
- return S_OK;
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::cutText(long startOffset, long endOffset)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
-#if QT_CONFIG(clipboard)
- const QString t = textForRange(startOffset, endOffset);
- if (QAccessibleEditableTextInterface *editableTextIface = accessible->editableTextInterface())
- editableTextIface->deleteText(startOffset, endOffset);
- else
- replaceTextFallback(startOffset, endOffset, QString());
- QGuiApplication::clipboard()->setText(t);
- return S_OK;
-#else
- return E_NOTIMPL;
-#endif
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::pasteText(long offset)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
-#if QT_CONFIG(clipboard)
- const QString txt = QGuiApplication::clipboard()->text();
- if (QAccessibleEditableTextInterface *editableTextIface = accessible->editableTextInterface())
- editableTextIface->insertText(offset, txt);
- else
- replaceTextFallback(offset, offset, txt);
- return S_OK;
-#else
- return E_NOTIMPL;
-#endif
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::replaceText(long startOffset, long endOffset, BSTR *text)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- const QString txt = QString::fromWCharArray(*text);
- if (QAccessibleEditableTextInterface *editableTextIface = accessible->editableTextInterface())
- editableTextIface->replaceText(startOffset, endOffset, txt);
- else
- replaceTextFallback(startOffset, endOffset, txt);
- return S_OK;
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::setAttributes(long /*startOffset*/, long /*endOffset*/, BSTR * /*attributes*/)
-{
- return E_NOTIMPL;
-}
-
-
-/**************************************************************\
- * IAccessibleTable2 *
- **************************************************************/
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_cellAt( long row, long column, IUnknown **cell)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (!accessible)
- return E_FAIL;
-
- *cell = 0;
- if (QAccessibleTableInterface *tableIface = tableInterface()) {
- if (QAccessibleInterface *qtCell = tableIface->cellAt(row, column)) {
- *cell = QWindowsAccessibility::wrap(qtCell);
- }
- }
- qCDebug(lcQpaAccessibility) << "found cell? " << *cell;
- return *cell ? S_OK : S_FALSE;
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_caption( IUnknown **captionInterface)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (!accessible)
- return E_FAIL;
-
- *captionInterface = 0;
- if (QAccessibleTableInterface *tableIface = tableInterface()) {
- if (QAccessibleInterface *iface = tableIface->caption())
- *captionInterface = QWindowsAccessibility::wrap(iface);
- }
- return *captionInterface ? S_OK : S_FALSE;
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_columnDescription( long column, BSTR *description)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (!accessible)
- return E_FAIL;
-
- *description = 0;
- if (QAccessibleTableInterface *tableIface = tableInterface()) {
- const QString qtDesc = tableIface->columnDescription(column);
- if (!qtDesc.isEmpty())
- *description = QStringToBSTR(qtDesc);
- }
- return *description ? S_OK : S_FALSE;
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_nColumns( long *columnCount)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (!accessible)
- return E_FAIL;
-
- if (QAccessibleTableInterface *tableIface = tableInterface()) {
- *columnCount = tableIface->columnCount();
- return S_OK;
- }
- return E_FAIL;
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_nRows(long *rowCount)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (!accessible)
- return E_FAIL;
-
- if (QAccessibleTableInterface *tableIface = tableInterface()) {
- *rowCount = tableIface->rowCount();
- return S_OK;
- }
- return E_FAIL;
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_nSelectedCells(long *cellCount)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (!accessible)
- return E_FAIL;
-
- if (QAccessibleTableInterface *tableIface = tableInterface()) {
- *cellCount = tableIface->selectedCellCount();
- return S_OK;
- }
- return E_FAIL;
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_nSelectedColumns(long *columnCount)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (!accessible)
- return E_FAIL;
-
- if (QAccessibleTableInterface *tableIface = tableInterface()) {
- *columnCount = tableIface->selectedColumnCount();
- return S_OK;
- }
- return E_FAIL;
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_nSelectedRows(long *rowCount)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (!accessible)
- return E_FAIL;
-
- if (QAccessibleTableInterface *tableIface = tableInterface()) {
- *rowCount = tableIface->selectedRowCount();
- return S_OK;
- }
- return E_FAIL;
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_rowDescription(long row, BSTR *description)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (!accessible)
- return E_FAIL;
-
- *description = 0;
- if (QAccessibleTableInterface *tableIface = tableInterface()) {
- const QString qtDesc = tableIface->rowDescription(row);
- if (!qtDesc.isEmpty())
- *description = QStringToBSTR(qtDesc);
- }
- return *description ? S_OK : S_FALSE;
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_selectedCells(IUnknown ***cells, long *nSelectedCells)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- Q_UNUSED(cells);
- Q_UNUSED(nSelectedCells);
- if (!accessible)
- return E_FAIL;
-
- QList<QAccessibleInterface*> selectedCells = tableInterface()->selectedCells();
- return wrapListOfCells(selectedCells, cells, nSelectedCells);
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_selectedColumns(long **selectedColumns, long *nColumns)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (!accessible)
- return E_FAIL;
-
- if (QAccessibleTableInterface *tableIface = tableInterface()) {
- const QList<int> selectedIndices = tableIface->selectedColumns();
- const int count = selectedIndices.count();
- *nColumns = count;
- *selectedColumns = Q_NULLPTR;
- if (count) {
- *selectedColumns = coTaskMemAllocArray<long>(count);
- std::copy(selectedIndices.constBegin(), selectedIndices.constEnd(),
- QT_MAKE_CHECKED_ARRAY_ITERATOR(*selectedColumns, count));
- }
- return count ? S_OK : S_FALSE;
- }
- return E_FAIL;
-
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_selectedRows(long **selectedRows, long *nRows)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (!accessible)
- return E_FAIL;
-
- if (QAccessibleTableInterface *tableIface = tableInterface()) {
- const QList<int> selectedIndices = tableIface->selectedRows();
- const int count = selectedIndices.count();
- *nRows = count;
- *selectedRows = Q_NULLPTR;
- if (count) {
- *selectedRows = coTaskMemAllocArray<long>(count);
- std::copy(selectedIndices.constBegin(), selectedIndices.constEnd(),
- QT_MAKE_CHECKED_ARRAY_ITERATOR(*selectedRows, count));
- }
- return count ? S_OK : S_FALSE;
- }
- return E_FAIL;
-
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_summary(IUnknown **summaryInterface)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (!accessible)
- return E_FAIL;
-
- *summaryInterface = 0;
- if (QAccessibleTableInterface *tableIface = tableInterface()) {
- if (QAccessibleInterface *iface = tableIface->summary())
- *summaryInterface = QWindowsAccessibility::wrap(iface);
- }
- return *summaryInterface ? S_OK : S_FALSE;
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_isColumnSelected(long column, boolean *isSelected)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (!accessible)
- return E_FAIL;
-
- if (QAccessibleTableInterface *tableIface = tableInterface()) {
- *isSelected = tableIface->isColumnSelected(column);
- return S_OK;
- }
- return E_FAIL;
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_isRowSelected(long row, boolean *isSelected)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (!accessible)
- return E_FAIL;
-
- if (QAccessibleTableInterface *tableIface = tableInterface()) {
- *isSelected = tableIface->isRowSelected(row);
- return S_OK;
- }
- return E_FAIL;
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::selectRow(long row)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (!accessible)
- return E_FAIL;
-
- if (QAccessibleTableInterface *tableIface = tableInterface()) {
- bool ok = tableIface->selectRow(row);
- return ok ? S_OK : E_INVALIDARG; //### Not sure of the return value if it fails???
- }
- return E_FAIL;
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::selectColumn(long column)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (!accessible)
- return E_FAIL;
-
- if (QAccessibleTableInterface *tableIface = tableInterface()) {
- bool ok = tableIface->selectColumn(column);
- return ok ? S_OK : E_INVALIDARG; //### Not sure of the return value if it fails???
- }
- return E_FAIL;
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::unselectRow(long row)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (!accessible)
- return E_FAIL;
-
- if (QAccessibleTableInterface *tableIface = tableInterface()) {
- bool ok = tableIface->unselectRow(row);
- return ok ? S_OK : E_INVALIDARG; //### Not sure of the return value if it fails???
- }
- return E_FAIL;
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::unselectColumn(long column)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (!accessible)
- return E_FAIL;
-
- if (QAccessibleTableInterface *tableIface = tableInterface()) {
- bool ok = tableIface->unselectColumn(column);
- return ok ? S_OK : E_INVALIDARG; //### Not sure of the return value if it fails???
- }
- return E_FAIL;
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_modelChange( IA2TableModelChange * /*modelChange*/)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (!accessible)
- return E_FAIL;
- return E_NOTIMPL;
-}
-
-/**************************************************************\
- * IAccessibleTableCell *
-\**************************************************************/
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_columnExtent(long *nColumnsSpanned)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (!accessible)
- return E_FAIL;
-
- *nColumnsSpanned = tableCellInterface()->columnExtent();
- return S_OK;
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_columnHeaderCells(IUnknown ***cellAccessibles,
- long *nColumnHeaderCells)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (!accessible)
- return E_FAIL;
- const QList<QAccessibleInterface*> headerCells = tableCellInterface()->columnHeaderCells();
- return wrapListOfCells(headerCells, cellAccessibles, nColumnHeaderCells);
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_columnIndex(long *columnIndex)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (!accessible)
- return E_FAIL;
- *columnIndex = tableCellInterface()->columnIndex();
- return S_OK;
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_rowExtent(long *nRowsSpanned)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (!accessible)
- return E_FAIL;
- *nRowsSpanned = tableCellInterface()->rowExtent();
- return S_OK;
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_rowHeaderCells(IUnknown ***cellAccessibles,
- long *nRowHeaderCells)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (!accessible)
- return E_FAIL;
- const QList<QAccessibleInterface*> headerCells = tableCellInterface()->rowHeaderCells();
- return wrapListOfCells(headerCells, cellAccessibles, nRowHeaderCells);
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_rowIndex(long *rowIndex)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (!accessible)
- return E_FAIL;
- *rowIndex = tableCellInterface()->rowIndex();
- return S_OK;
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_isSelected( boolean *isSelected)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (!accessible)
- return E_FAIL;
- *isSelected = tableCellInterface()->isSelected();
- return S_OK;
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_rowColumnExtents(long *row, long *column,
- long *rowExtents, long *columnExtents,
- boolean *isSelected)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (!accessible || !tableCellInterface())
- return E_FAIL;
-
- *row = tableCellInterface()->rowIndex();
- *column = tableCellInterface()->columnIndex();
- *rowExtents = tableCellInterface()->rowExtent();
- *columnExtents = tableCellInterface()->columnExtent();
- *isSelected = tableCellInterface()->isSelected();
- return S_OK;
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_table(IUnknown **table)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (!accessible)
- return E_FAIL;
-
- QAccessibleInterface *tableIface = tableCellInterface()->table();
-
- *table = QWindowsAccessibility::wrap(tableIface);
- return S_OK;
-}
-
-/**************************************************************\
- * IAccessibleText *
-\**************************************************************/
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::addSelection(long startOffset,
- long endOffset)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (QAccessibleTextInterface *text = textInterface()) {
- text->addSelection(startOffset, endOffset);
- return S_OK;
- }
- return E_FAIL;
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_attributes(long offset,
- long *startOffset,
- long *endOffset,
- BSTR *textAttributes)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (QAccessibleTextInterface *text = textInterface()) {
- const QString attrs = text->attributes(offset, reinterpret_cast<int *>(startOffset),
- reinterpret_cast<int *>(endOffset));
- *textAttributes = QStringToBSTR(attrs);
- return S_OK;
- }
- return E_FAIL;
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_caretOffset(long *offset)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (QAccessibleTextInterface *text = textInterface()) {
- *offset = text->cursorPosition();
- return S_OK;
- }
- return E_FAIL;
-}
-
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_characterExtents(long offset,
- enum IA2CoordinateType coordType,
- long *x,
- long *y,
- long *width,
- long *height)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (QAccessibleTextInterface *text = textInterface()) {
- QRect rect = text->characterRect(offset);
- mapFromScreenPos(coordType, rect.topLeft(), x, y);
- *width = rect.width();
- *height = rect.height();
- return S_OK;
- }
- return E_FAIL;
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_nSelections(long *nSelections)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (QAccessibleTextInterface *text = textInterface()) {
- *nSelections = text->selectionCount();
- return S_OK;
- }
- return E_FAIL;
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_offsetAtPoint(long x,
- long y,
- enum IA2CoordinateType coordType,
- long *offset)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (QAccessibleTextInterface *text = textInterface()) {
- QPoint screenPos = mapToScreenPos(coordType, x, y);
- *offset = text->offsetAtPoint(screenPos);
- return (*offset >=0 ? S_OK : S_FALSE);
- }
- return E_FAIL;
-
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_selection(long selectionIndex,
- long *startOffset,
- long *endOffset)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (QAccessibleTextInterface *text = textInterface()) {
- text->selection(selectionIndex, reinterpret_cast<int *>(startOffset),
- reinterpret_cast<int *>(endOffset));
- return S_OK;
- }
- return E_FAIL;
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_text(long startOffset,
- long endOffset,
- BSTR *text)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (QAccessibleTextInterface *textif = textInterface()) {
- const QString t = textif->text(startOffset, endOffset);
- if (!t.isEmpty()) {
- *text = QStringToBSTR(t);
- return S_OK;
- }
- return E_INVALIDARG;
- }
- return E_FAIL;
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_textBeforeOffset(long offset,
- enum IA2TextBoundaryType boundaryType,
- long *startOffset,
- long *endOffset,
- BSTR *text)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (QAccessibleTextInterface *textIface = textInterface()) {
- const QString txt =
- textIface->textBeforeOffset(offset, static_cast<QAccessible::TextBoundaryType>(boundaryType),
- reinterpret_cast<int *>(startOffset),
- reinterpret_cast<int *>(endOffset));
- if (!txt.isEmpty()) {
- *text = QStringToBSTR(txt);
- return S_OK;
- }
- return S_FALSE;
- }
- return E_FAIL;
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_textAfterOffset(
- long offset,
- enum IA2TextBoundaryType boundaryType,
- long *startOffset,
- long *endOffset,
- BSTR *text)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (QAccessibleTextInterface *textIface = textInterface()) {
- const QString txt =
- textIface->textAfterOffset(offset, static_cast<QAccessible::TextBoundaryType>(boundaryType),
- reinterpret_cast<int *>(startOffset),
- reinterpret_cast<int *>(endOffset));
- if (!txt.isEmpty()) {
- *text = QStringToBSTR(txt);
- return S_OK;
- }
- return S_FALSE;
- }
- return E_FAIL;
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_textAtOffset(long offset,
- enum IA2TextBoundaryType boundaryType,
- long *startOffset,
- long *endOffset,
- BSTR *text)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (QAccessibleTextInterface *textIface = textInterface()) {
- const QString txt =
- textIface->textAtOffset(offset, static_cast<QAccessible::TextBoundaryType>(boundaryType),
- reinterpret_cast<int *>(startOffset),
- reinterpret_cast<int *>(endOffset));
- if (!txt.isEmpty()) {
- *text = QStringToBSTR(txt);
- return S_OK;
- }
- return S_FALSE;
- }
- return E_FAIL;
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::removeSelection(long selectionIndex)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (QAccessibleTextInterface *textIface = textInterface()) {
- textIface->removeSelection(selectionIndex);
- return S_OK;
- }
- return E_FAIL;
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::setCaretOffset(long offset)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (QAccessibleTextInterface *textIface = textInterface()) {
- textIface->setCursorPosition(offset);
- return S_OK;
- }
- return E_FAIL;
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::setSelection(long selectionIndex,
- long startOffset,
- long endOffset)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (QAccessibleTextInterface *textIface = textInterface()) {
- textIface->setSelection(selectionIndex, startOffset, endOffset);
- return S_OK;
- }
- return E_FAIL;
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_nCharacters(long *nCharacters)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (QAccessibleTextInterface *textIface = textInterface()) {
- *nCharacters = textIface->characterCount();
- return S_OK;
- }
- return E_FAIL;
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::scrollSubstringTo(long startIndex,
- long endIndex,
- enum IA2ScrollType scrollType)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (QAccessibleTextInterface *textIface = textInterface()) {
- Q_UNUSED(scrollType); //###
- textIface->scrollToSubstring(startIndex, endIndex);
- return S_OK;
- }
- return E_FAIL;
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::scrollSubstringToPoint(long startIndex,
- long endIndex,
- enum IA2CoordinateType coordinateType,
- long x,
- long y)
-{
- Q_UNUSED(startIndex);
- Q_UNUSED(endIndex);
- Q_UNUSED(coordinateType);
- Q_UNUSED(x);
- Q_UNUSED(y);
-
- return E_NOTIMPL;
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_newText(IA2TextSegment *newText)
-{
- Q_UNUSED(newText);
- return E_NOTIMPL;
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_oldText(IA2TextSegment *oldText)
-{
- Q_UNUSED(oldText);
- return E_NOTIMPL;
-}
-
-/**************************************************************\
- * IAccessibleValue *
- **************************************************************/
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_currentValue(VARIANT *currentValue)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (!accessible)
- return E_FAIL;
- if (QAccessibleValueInterface *valueIface = valueInterface()) {
- const QVariant var = valueIface->currentValue();
- if (QVariant2VARIANT(var, *currentValue, QByteArray(), false))
- return S_OK;
-
- }
- currentValue->vt = VT_EMPTY;
- return S_FALSE;
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::setCurrentValue(VARIANT value)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (!accessible)
- return E_FAIL;
- HRESULT hr = S_FALSE;
- if (QAccessibleValueInterface *valueIface = valueInterface()) {
- hr = VariantChangeType(&value, &value, 0, VT_R8);
- if (SUCCEEDED(hr)) {
- // ### works only for numbers (not date, strings, etc)
- valueIface->setCurrentValue(QVariant(value.dblVal));
- }
- }
- return hr;
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_maximumValue(VARIANT *maximumValue)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (!accessible)
- return E_FAIL;
- if (QAccessibleValueInterface *valueIface = valueInterface()) {
- const QVariant var = valueIface->maximumValue();
- if (QVariant2VARIANT(var, *maximumValue, QByteArray(), false))
- return S_OK;
- }
- maximumValue->vt = VT_EMPTY;
- return S_FALSE;
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_minimumValue(VARIANT *minimumValue)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (!accessible)
- return E_FAIL;
- if (QAccessibleValueInterface *valueIface = valueInterface()) {
- const QVariant var = valueIface->minimumValue();
- if (QVariant2VARIANT(var, *minimumValue, QByteArray(), false))
- return S_OK;
- }
- minimumValue->vt = VT_EMPTY;
- return S_FALSE;
-}
-
-
-/**************************************************************\
- * IServiceProvider *
- **************************************************************/
-/*!
- \internal
- Reimplemented from IServiceProvider
-*/
-HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::QueryService(REFGUID guidService, REFIID riid, void **iface)
-{
- if (!iface)
- return E_POINTER;
- Q_UNUSED(guidService);
- *iface = 0;
- qCDebug(lcQpaAccessibility) << "QWindowsIA2Accessible::QS(): " << QWindowsAccessibleGuid(riid);
-
-
- if (guidService == IID_IAccessible) {
- if (riid == IID_IServiceProvider) {
- // do not end up calling QueryInterface for IID_IServiceProvider
- *iface = 0;
- } else if (riid == IID_IAccessible || riid == IID_IUnknown || riid == IID_IDispatch) {
- // The above conditions works with AccProbe and NVDA.
- *iface = static_cast<IAccessible*>(this);
- } else {
- // According to _dicoveringInterfaces Discovery of Interfaces, we should really only
- // enter here if riid == IID_IAccessible2, but some screen readers does not like that,
- // and other servers seems to have realized that. (Chrome and Mozilla for instance,
- // calls QueryInterface more or less in the same way)
-
- // For instance, accProbe discovers IID_IAccessibleTable2 by a QueryService only.
- return QueryInterface(riid, iface);
- }
- }
-
- if (riid == IID_IAccessibleApplication) {
- *iface = new AccessibleApplication;
- return S_OK;
- }
- if (*iface) {
- AddRef();
- return S_OK;
- }
-
- return E_NOINTERFACE;
-}
-
-
-/*!
- \internal
- private function..
- \a maxRelations max number of relations to return in \a relations
- \a relations the array of relations matching
- \a startIndex Index to start to return from,
- it will return only that specific relation in \a relations
-
- If \a relations is null, \a startIndex and \a maxRelations are ignored, causing
- it to return the number of relations in \a nRelations
-*/
-HRESULT QWindowsIA2Accessible::getRelationsHelper(IAccessibleRelation **relations, int startIndex, long maxRelations, long *nRelations /* = 0*/)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- if (nRelations)
- *nRelations = 0;
- typedef QPair<QAccessibleInterface *, QAccessible::Relation> RelationEntry;
- QVector<RelationEntry> rels = accessible->relations();
- QMap<QAccessible::Relation, QAccessibleInterface *> relationMap;
- for (QVector<RelationEntry>::const_iterator it = rels.constBegin(); it != rels.constEnd(); ++it)
- {
- RelationEntry e = *it;
- relationMap.insertMulti(e.second, e.first);
- }
-
- QList<QAccessible::Relation> keys = relationMap.keys();
- const int numRelations = keys.count();
- if (relations) {
- for (int i = startIndex; i < qMin(startIndex + int(maxRelations), numRelations); ++i) {
- QAccessible::Relation relation = keys.at(i);
- QList<QAccessibleInterface*> targets = relationMap.values(relation);
- AccessibleRelation *rel = new AccessibleRelation(targets, relation);
- *relations = rel;
- ++relations;
- }
- }
- if (nRelations)
- *nRelations = numRelations;
-
- return numRelations > 0 ? S_OK : S_FALSE;
-}
-
-
-
-
-/*!
- \internal
- helper to wrap a QList<QAccessibleInterface*> inside an array of IAccessible*
- The IAccessible* array is returned as a IUnknown*
-*/
-HRESULT QWindowsIA2Accessible::wrapListOfCells(const QList<QAccessibleInterface*> &inputCells, IUnknown ***outputAccessibles, long *nCellCount)
-{
- const int count = inputCells.count();
- // Server allocates array
- *nCellCount = count;
- *outputAccessibles = Q_NULLPTR;
- if (count) {
- *outputAccessibles = coTaskMemAllocArray<IUnknown *>(count);
- std::transform(inputCells.constBegin(), inputCells.constEnd(),
- QT_MAKE_CHECKED_ARRAY_ITERATOR(*outputAccessibles, count),
- QWindowsAccessibility::wrap);
- }
- return count > 0 ? S_OK : S_FALSE;
-}
-
-// Q_STATIC_ASSERT(IA2_ROLE_CANVAS == QAccessible::Canvas); // ### Qt 6: make them the same
-Q_STATIC_ASSERT(IA2_ROLE_COLOR_CHOOSER == static_cast<IA2Role>(QAccessible::ColorChooser));
-Q_STATIC_ASSERT(IA2_ROLE_FOOTER == static_cast<IA2Role>(QAccessible::Footer));
-Q_STATIC_ASSERT(IA2_ROLE_FORM == static_cast<IA2Role>(QAccessible::Form));
-Q_STATIC_ASSERT(IA2_ROLE_HEADING == static_cast<IA2Role>(QAccessible::Heading));
-Q_STATIC_ASSERT(IA2_ROLE_NOTE == static_cast<IA2Role>(QAccessible::Note));
-Q_STATIC_ASSERT(IA2_ROLE_COMPLEMENTARY_CONTENT == static_cast<IA2Role>(QAccessible::ComplementaryContent));
-
-QT_END_NAMESPACE
-
-#endif //QT_NO_ACCESSIBILITY
diff --git a/src/plugins/platforms/windows/accessible/iaccessible2.h b/src/plugins/platforms/windows/accessible/iaccessible2.h
deleted file mode 100644
index d987016e15..0000000000
--- a/src/plugins/platforms/windows/accessible/iaccessible2.h
+++ /dev/null
@@ -1,358 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 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$
-**
-****************************************************************************/
-#ifndef IACCESSIBLE2_H
-#define IACCESSIBLE2_H
-
-#include <QtCore/qglobal.h>
-#ifndef QT_NO_ACCESSIBILITY
-
-#include "qwindowscombase.h"
-#include "qwindowsmsaaaccessible.h"
-#include "comutils.h"
-
-#include "ia2_api_all.h"
-
-#include <servprov.h>
-
-QT_BEGIN_NAMESPACE
-
-#ifdef Q_CC_MINGW
-QT_WARNING_DISABLE_GCC("-Wunused-function") // MinGW 7.X claims it is unused
-// MinGW's __uuidof operator does not work for the Accessible2 interfaces
-template <>
-IID qUuidOf<IAccessibleComponent>() { return IID_IAccessibleComponent; }
-#endif // Q_CC_MINGW
-
-class QWindowsIA2Accessible : public QWindowsMsaaAccessible,
- public IAccessibleAction,
- public IAccessibleComponent,
- public IAccessibleEditableText,
- public IAccessibleTable2,
- public IAccessibleTableCell,
- public IAccessibleText,
- public IAccessibleValue,
- public IServiceProvider
-{
-public:
- QWindowsIA2Accessible(QAccessibleInterface *a) : QWindowsMsaaAccessible(a) {}
-
- /* IUnknown */
- HRESULT STDMETHODCALLTYPE QueryInterface(REFIID, LPVOID *);
- ULONG STDMETHODCALLTYPE AddRef();
- ULONG STDMETHODCALLTYPE Release();
-
- /* IAccessible2 */
- HRESULT STDMETHODCALLTYPE get_nRelations(long *nRelations);
- HRESULT STDMETHODCALLTYPE get_relation(long relationIndex, IAccessibleRelation **relation);
- HRESULT STDMETHODCALLTYPE get_relations(long maxRelations, IAccessibleRelation **relations, long *nRelations);
- HRESULT STDMETHODCALLTYPE role(long *role);
- HRESULT STDMETHODCALLTYPE scrollTo(enum IA2ScrollType scrollType);
- HRESULT STDMETHODCALLTYPE scrollToPoint(enum IA2CoordinateType coordinateType, long x, long y);
- HRESULT STDMETHODCALLTYPE get_groupPosition(long *groupLevel, long *similarItemsInGroup, long *positionInGroup);
- HRESULT STDMETHODCALLTYPE get_states(AccessibleStates *states);
- HRESULT STDMETHODCALLTYPE get_extendedRole(BSTR *extendedRole);
- HRESULT STDMETHODCALLTYPE get_localizedExtendedRole(BSTR *localizedExtendedRole);
- HRESULT STDMETHODCALLTYPE get_nExtendedStates(long *nExtendedStates);
- HRESULT STDMETHODCALLTYPE get_extendedStates(long maxExtendedStates, BSTR **extendedStates, long *nExtendedStates);
- HRESULT STDMETHODCALLTYPE get_localizedExtendedStates(long maxLocalizedExtendedStates, BSTR **localizedExtendedStates, long *nLocalizedExtendedStates);
- HRESULT STDMETHODCALLTYPE get_uniqueID(long *uniqueID);
- HRESULT STDMETHODCALLTYPE get_windowHandle(HWND *windowHandle);
- HRESULT STDMETHODCALLTYPE get_indexInParent(long *indexInParent);
- HRESULT STDMETHODCALLTYPE get_locale(IA2Locale *locale);
- HRESULT STDMETHODCALLTYPE get_attributes(BSTR *attributes);
-
- /* IAccessibleAction */
- HRESULT STDMETHODCALLTYPE nActions(long *nActions);
- HRESULT STDMETHODCALLTYPE doAction(long actionIndex);
- HRESULT STDMETHODCALLTYPE get_description(long actionIndex, BSTR *description);
- HRESULT STDMETHODCALLTYPE get_keyBinding(long actionIndex, long nMaxBindings, BSTR **keyBindings, long *nBindings);
- HRESULT STDMETHODCALLTYPE get_name(long actionIndex, BSTR *name);
- HRESULT STDMETHODCALLTYPE get_localizedName(long actionIndex, BSTR *localizedName);
-
- /* IAccessibleComponent */
- HRESULT STDMETHODCALLTYPE get_locationInParent(long *x,long *y);
- HRESULT STDMETHODCALLTYPE get_foreground(IA2Color *foreground);
- HRESULT STDMETHODCALLTYPE get_background(IA2Color *background);
-
- /* IAccessibleEditableText */
- HRESULT STDMETHODCALLTYPE copyText(long startOffset, long endOffset);
- HRESULT STDMETHODCALLTYPE deleteText(long startOffset, long endOffset);
- HRESULT STDMETHODCALLTYPE insertText(long offset, BSTR *text);
- HRESULT STDMETHODCALLTYPE cutText(long startOffset, long endOffset);
- HRESULT STDMETHODCALLTYPE pasteText(long offset);
- HRESULT STDMETHODCALLTYPE replaceText(long startOffset, long endOffset, BSTR *text);
- HRESULT STDMETHODCALLTYPE setAttributes(long startOffset, long endOffset, BSTR *attributes);
-
- /* IAccessibleTable2 */
- HRESULT STDMETHODCALLTYPE get_cellAt( long row, long column, IUnknown **cell);
- HRESULT STDMETHODCALLTYPE get_caption( IUnknown **accessibleInterface);
- HRESULT STDMETHODCALLTYPE get_columnDescription( long column, BSTR *description);
- HRESULT STDMETHODCALLTYPE get_nColumns( long *columnCount);
- HRESULT STDMETHODCALLTYPE get_nRows( long *rowCount);
- HRESULT STDMETHODCALLTYPE get_nSelectedCells( long *cellCount);
- HRESULT STDMETHODCALLTYPE get_nSelectedColumns( long *columnCount);
- HRESULT STDMETHODCALLTYPE get_nSelectedRows( long *rowCount);
- HRESULT STDMETHODCALLTYPE get_rowDescription( long row, BSTR *description);
- HRESULT STDMETHODCALLTYPE get_selectedCells( IUnknown ***cells, long *nSelectedCells);
- HRESULT STDMETHODCALLTYPE get_selectedColumns( long **selectedColumns, long *nColumns);
- HRESULT STDMETHODCALLTYPE get_selectedRows( long **selectedRows, long *nRows);
- HRESULT STDMETHODCALLTYPE get_summary( IUnknown **accessibleInterface);
- HRESULT STDMETHODCALLTYPE get_isColumnSelected( long column, boolean *isSelected);
- HRESULT STDMETHODCALLTYPE get_isRowSelected( long row, boolean *isSelected);
- HRESULT STDMETHODCALLTYPE selectRow( long row);
- HRESULT STDMETHODCALLTYPE selectColumn( long column);
- HRESULT STDMETHODCALLTYPE unselectRow( long row);
- HRESULT STDMETHODCALLTYPE unselectColumn( long column);
- HRESULT STDMETHODCALLTYPE get_modelChange( IA2TableModelChange *modelChange);
-
- /* IAccessibleTableCell */
- HRESULT STDMETHODCALLTYPE get_columnExtent(long *nColumnsSpanned);
- HRESULT STDMETHODCALLTYPE get_columnHeaderCells(IUnknown ***cellAccessibles, long *nColumnHeaderCells);
- HRESULT STDMETHODCALLTYPE get_columnIndex(long *columnIndex);
- HRESULT STDMETHODCALLTYPE get_rowExtent(long *nRowsSpanned);
- HRESULT STDMETHODCALLTYPE get_rowHeaderCells(IUnknown ***cellAccessibles, long *nRowHeaderCells);
- HRESULT STDMETHODCALLTYPE get_rowIndex(long *rowIndex);
- HRESULT STDMETHODCALLTYPE get_isSelected( boolean *isSelected);
- HRESULT STDMETHODCALLTYPE get_rowColumnExtents(long *row, long *column,
- long *rowExtents, long *columnExtents,
- boolean *isSelected);
- HRESULT STDMETHODCALLTYPE get_table(IUnknown **table);
-
-
- /* IAccessibleText */
- HRESULT STDMETHODCALLTYPE addSelection(long startOffset, long endOffset);
- HRESULT STDMETHODCALLTYPE get_attributes(long offset, long *startOffset,
- long *endOffset, BSTR *textAttributes);
- HRESULT STDMETHODCALLTYPE get_caretOffset(long *offset);
- HRESULT STDMETHODCALLTYPE get_characterExtents(long offset, enum IA2CoordinateType coordType,
- long *x, long *y,
- long *width, long *height);
- HRESULT STDMETHODCALLTYPE get_nSelections(long *nSelections);
- HRESULT STDMETHODCALLTYPE get_offsetAtPoint(long x, long y, enum IA2CoordinateType coordType, long *offset);
- HRESULT STDMETHODCALLTYPE get_selection(long selectionIndex, long *startOffset, long *endOffset);
- HRESULT STDMETHODCALLTYPE get_text(long startOffset, long endOffset, BSTR *text);
- HRESULT STDMETHODCALLTYPE get_textBeforeOffset(long offset, enum IA2TextBoundaryType boundaryType,
- long *startOffset, long *endOffset, BSTR *text);
- HRESULT STDMETHODCALLTYPE get_textAfterOffset(long offset, enum IA2TextBoundaryType boundaryType,
- long *startOffset, long *endOffset, BSTR *text);
- HRESULT STDMETHODCALLTYPE get_textAtOffset(long offset, enum IA2TextBoundaryType boundaryType,
- long *startOffset, long *endOffset, BSTR *text);
- HRESULT STDMETHODCALLTYPE removeSelection(long selectionIndex);
- HRESULT STDMETHODCALLTYPE setCaretOffset(long offset);
- HRESULT STDMETHODCALLTYPE setSelection(long selectionIndex, long startOffset, long endOffset);
- HRESULT STDMETHODCALLTYPE get_nCharacters(long *nCharacters);
- HRESULT STDMETHODCALLTYPE scrollSubstringTo(long startIndex, long endIndex, enum IA2ScrollType scrollType);
- HRESULT STDMETHODCALLTYPE scrollSubstringToPoint(long startIndex, long endIndex,
- enum IA2CoordinateType coordinateType, long x, long y);
- HRESULT STDMETHODCALLTYPE get_newText(IA2TextSegment *newText);
- HRESULT STDMETHODCALLTYPE get_oldText(IA2TextSegment *oldText);
-
- /* IAccessibleValue */
- HRESULT STDMETHODCALLTYPE get_currentValue(VARIANT *currentValue);
- HRESULT STDMETHODCALLTYPE setCurrentValue(VARIANT value);
- HRESULT STDMETHODCALLTYPE get_maximumValue(VARIANT *maximumValue);
- HRESULT STDMETHODCALLTYPE get_minimumValue(VARIANT *minimumValue);
-
- /* IServiceProvider */
- HRESULT STDMETHODCALLTYPE QueryService(REFGUID guidService, REFIID riid, void **ppv);
-
- /* private helper functions */
-private:
- inline QAccessibleTextInterface *textInterface() const {
- QAccessibleInterface *accessible = accessibleInterface();
- return accessible ? accessible->textInterface() : static_cast<QAccessibleTextInterface *>(0);
- }
-
- inline QAccessibleActionInterface *actionInterface() const {
- QAccessibleInterface *accessible = accessibleInterface();
- return accessible->actionInterface();
- }
-
- inline QAccessibleValueInterface *valueInterface() const {
- QAccessibleInterface *accessible = accessibleInterface();
- return accessible->valueInterface();
- }
-
- inline QAccessibleTableInterface *tableInterface() const {
- QAccessibleInterface *accessible = accessibleInterface();
- return accessible->tableInterface();
- }
-
- inline QAccessibleTableCellInterface *tableCellInterface() const {
- QAccessibleInterface *accessible = accessibleInterface();
- return accessible->tableCellInterface();
- }
-
- /*!
- \internal
- \a screenPos is in screen relative position
- \a x and \y (out) is in parent relative position if coordType == IA2_COORDTYPE_PARENT_RELATIVE
- */
- void mapFromScreenPos(enum IA2CoordinateType coordType, const QPoint &screenPos, long *x, long *y) const {
- QAccessibleInterface *accessible = accessibleInterface();
- if (coordType == IA2_COORDTYPE_PARENT_RELATIVE) {
- // caller wants relative to parent
- if (QAccessibleInterface *parent = accessible->parent()) {
- const QRect parentScreenRect = parent->rect();
- *x = parentScreenRect.x() - screenPos.x();
- *y = parentScreenRect.y() - screenPos.y();
- return;
- }
- }
- *x = screenPos.x();
- *y = screenPos.y();
- }
-
- /*!
- \internal
- \a x and \y is in parent relative position if coordType == IA2_COORDTYPE_PARENT_RELATIVE
- \return a screen relative position
- */
- QPoint mapToScreenPos(enum IA2CoordinateType coordType, long x, long y) const {
- QAccessibleInterface *accessible = accessibleInterface();
- if (coordType == IA2_COORDTYPE_PARENT_RELATIVE) {
- if (QAccessibleInterface *parent = accessible->parent()) {
- const QRect parentScreenRect = parent->rect();
- return QPoint(parentScreenRect.x() + x, parentScreenRect.y() + y);
- }
- }
- return QPoint(x,y);
- }
-
- HRESULT getRelationsHelper(IAccessibleRelation **relations, int startIndex, long maxRelations, long *nRelations = 0);
- HRESULT wrapListOfCells(const QList<QAccessibleInterface*> &inputCells, IUnknown ***outputAccessibles, long *nCellCount);
- QString textForRange(int startOffset, int endOffset) const;
- void replaceTextFallback(long startOffset, long endOffset, const QString &txt);
-
-};
-
-/**************************************************************\
- * AccessibleApplication *
- **************************************************************/
-
-#ifdef Q_CC_MINGW
-// MinGW's __uuidof operator does not work for the IAccessible2 interfaces
-template <>
-IID qUuidOf<IAccessibleApplication>() { return IID_IAccessibleApplication; }
-
-template <>
-IID qUuidOf<IAccessible2>() { return IID_IAccessible2; }
-
-template <>
-IID qUuidOf<IAccessibleRelation>() { return IID_IAccessibleRelation; }
-#endif // Q_CC_MINGW
-
-class AccessibleApplication : public QWindowsComBase<IAccessibleApplication>
-{
-public:
- AccessibleApplication() {}
-
- virtual ~AccessibleApplication() {}
-
- /* IAccessibleApplication */
- HRESULT STDMETHODCALLTYPE get_appName(/* [retval][out] */ BSTR *name);
- HRESULT STDMETHODCALLTYPE get_appVersion(/* [retval][out] */ BSTR *version);
- HRESULT STDMETHODCALLTYPE get_toolkitName(/* [retval][out] */ BSTR *name);
- HRESULT STDMETHODCALLTYPE get_toolkitVersion(/* [retval][out] */ BSTR *version);
-};
-
-
-
-/**************************************************************\
- * AccessibleRelation *
- **************************************************************/
-
-
-
-class AccessibleRelation : public QWindowsComBase<IAccessibleRelation>
-{
-public:
- AccessibleRelation(const QList<QAccessibleInterface *> &targets,
- QAccessible::Relation relation);
-
- virtual ~AccessibleRelation() {}
-
- /* IAccessibleRelation */
- HRESULT STDMETHODCALLTYPE get_relationType(BSTR *relationType);
- HRESULT STDMETHODCALLTYPE get_localizedRelationType(BSTR *localizedRelationType);
- HRESULT STDMETHODCALLTYPE get_nTargets(long *nTargets);
- HRESULT STDMETHODCALLTYPE get_target(long targetIndex, IUnknown **target);
- HRESULT STDMETHODCALLTYPE get_targets(long maxTargets, IUnknown **targets, long *nTargets);
-
-private:
- static BSTR relationToBSTR(QAccessible::Relation relation)
- {
- const wchar_t *constRelationString = 0;
- switch (relation) {
- case QAccessible::Label:
- constRelationString = IA2_RELATION_LABEL_FOR;
- break;
- case QAccessible::Labelled:
- constRelationString = IA2_RELATION_LABELLED_BY;
- break;
- case QAccessible::Controller:
- constRelationString = IA2_RELATION_CONTROLLER_FOR;
- break;
- case QAccessible::Controlled:
- constRelationString = IA2_RELATION_CONTROLLED_BY;
- break;
- case QAccessible::AllRelations:
- constRelationString = ( L"AllRelations" );
- break;
- }
-
- if (constRelationString) {
- BSTR bstrVal;
- const UINT wlen = (UINT)wcslen(constRelationString);
- bstrVal = ::SysAllocStringLen(constRelationString, wlen);
- return bstrVal;
- }
- return 0;
- }
-
-
- QList<QAccessibleInterface *> m_targets;
- QAccessible::Relation m_relation;
-};
-
-QT_END_NAMESPACE
-
-#endif //QT_NO_ACCESSIBILITY
-
-#endif // IACCESSIBLE2_H
diff --git a/src/plugins/platforms/windows/accessible/qwindowsaccessibility.cpp b/src/plugins/platforms/windows/accessible/qwindowsaccessibility.cpp
deleted file mode 100644
index d48cb9674f..0000000000
--- a/src/plugins/platforms/windows/accessible/qwindowsaccessibility.cpp
+++ /dev/null
@@ -1,245 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 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 <QtCore/qglobal.h>
-#ifndef QT_NO_ACCESSIBILITY
-
-
-#include <private/qsystemlibrary_p.h>
-
-#include <QtCore/qlocale.h>
-#include <QtCore/qmap.h>
-#include <QtCore/qpair.h>
-#include <QtCore/qpointer.h>
-#include <QtGui/qaccessible.h>
-#include <QtGui/private/qguiapplication_p.h>
-#include <qpa/qplatformnativeinterface.h>
-#include <qpa/qplatformintegration.h>
-#include <QtGui/qwindow.h>
-#include <QtGui/qguiapplication.h>
-#include <QtFontDatabaseSupport/private/qwindowsfontdatabase_p.h> // registry helper
-
-#include "qwindowsaccessibility.h"
-#include "iaccessible2.h"
-#include "comutils.h"
-
-#include <oleacc.h>
-
-//#include <uiautomationcoreapi.h>
-#ifndef UiaRootObjectId
-#define UiaRootObjectId -25
-#endif
-
-#include <winuser.h>
-#if !defined(WINABLEAPI)
-# include <winable.h>
-#endif
-
-#include <servprov.h>
-#if !defined(Q_CC_BOR) && !defined (Q_CC_GNU)
-#include <comdef.h>
-#endif
-
-#include <QtCore/qt_windows.h>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \!internal
- \class QWindowsAccessibility
-
- Implements QPlatformAccessibility
-
-*/
-QWindowsAccessibility::QWindowsAccessibility()
-{
-}
-
-// Retrieve sound name by checking the icon property of a message box
-static inline QString messageBoxAlertSound(const QObject *messageBox)
-{
- enum MessageBoxIcon { // Keep in sync with QMessageBox::Icon
- Information = 1,
- Warning = 2,
- Critical = 3
- };
- switch (messageBox->property("icon").toInt()) {
- case Information:
- return QStringLiteral("SystemAsterisk");
- case Warning:
- return QStringLiteral("SystemExclamation");
- case Critical:
- return QStringLiteral("SystemHand");
- }
- return QString();
-}
-
-static QString soundFileName(const QString &soundName)
-{
- const QString key = QStringLiteral("AppEvents\\Schemes\\Apps\\.Default\\")
- + soundName + QStringLiteral("\\.Current");
- return QWindowsFontDatabase::readRegistryString(HKEY_CURRENT_USER,
- reinterpret_cast<const wchar_t *>(key.utf16()), L"");
-}
-
-void QWindowsAccessibility::notifyAccessibilityUpdate(QAccessibleEvent *event)
-{
- QString soundName;
- switch (event->type()) {
- case QAccessible::PopupMenuStart:
- soundName = QLatin1String("MenuPopup");
- break;
-
- case QAccessible::MenuCommand:
- soundName = QLatin1String("MenuCommand");
- break;
-
- case QAccessible::Alert:
- soundName = event->object()->inherits("QMessageBox") ?
- messageBoxAlertSound(event->object()) : QStringLiteral("SystemAsterisk");
- break;
- default:
- break;
- }
-
- if (!soundName.isEmpty() && !soundFileName(soundName).isEmpty()) {
- PlaySound(reinterpret_cast<const wchar_t *>(soundName.utf16()), 0,
- SND_ALIAS | SND_ASYNC | SND_NODEFAULT | SND_NOWAIT);
- }
-
- // An event has to be associated with a window,
- // so find the first parent that is a widget and that has a WId
- QAccessibleInterface *iface = event->accessibleInterface();
- if (!isActive() || !iface || !iface->isValid())
- return;
- QWindow *window = QWindowsAccessibility::windowHelper(iface);
-
- if (!window) {
- window = QGuiApplication::focusWindow();
- if (!window)
- return;
- }
-
- QPlatformNativeInterface *platform = QGuiApplication::platformNativeInterface();
- if (!window->handle()) // Called before show(), no native window yet.
- return;
- const HWND hWnd = reinterpret_cast<HWND>(platform->nativeResourceForWindow("handle", window));
-
- if (event->type() != QAccessible::MenuCommand && // MenuCommand is faked
- event->type() != QAccessible::ObjectDestroyed) {
- ::NotifyWinEvent(event->type(), hWnd, OBJID_CLIENT, QAccessible::uniqueId(iface));
- }
-}
-
-QWindow *QWindowsAccessibility::windowHelper(const QAccessibleInterface *iface)
-{
- QWindow *window = iface->window();
- if (!window) {
- QAccessibleInterface *acc = iface->parent();
- while (acc && acc->isValid() && !window) {
- window = acc->window();
- QAccessibleInterface *par = acc->parent();
- acc = par;
- }
- }
- return window;
-}
-
-/*!
- \internal
- helper to wrap a QAccessibleInterface inside a IAccessible*
-*/
-IAccessible *QWindowsAccessibility::wrap(QAccessibleInterface *acc)
-{
- if (!acc)
- return 0;
-
- // ### FIXME: maybe we should accept double insertions into the cache
- if (!QAccessible::uniqueId(acc))
- QAccessible::registerAccessibleInterface(acc);
-
- QWindowsIA2Accessible *wacc = new QWindowsIA2Accessible(acc);
- IAccessible *iacc = 0;
- wacc->QueryInterface(IID_IAccessible, reinterpret_cast<void **>(&iacc));
- return iacc;
-}
-
-bool QWindowsAccessibility::handleAccessibleObjectFromWindowRequest(HWND hwnd, WPARAM wParam, LPARAM lParam, LRESULT *lResult)
-{
- if (static_cast<long>(lParam) == static_cast<long>(UiaRootObjectId)) {
- /* For UI Automation */
- } else if (DWORD(lParam) == DWORD(OBJID_CLIENT)) {
- // Start handling accessibility internally
- QGuiApplicationPrivate::platformIntegration()->accessibility()->setActive(true);
- // Ignoring all requests while starting up
- // ### Maybe QPA takes care of this???
- if (QCoreApplication::startingUp() || QCoreApplication::closingDown())
- return false;
-
- typedef LRESULT (WINAPI *PtrLresultFromObject)(REFIID, WPARAM, LPUNKNOWN);
- static PtrLresultFromObject ptrLresultFromObject = 0;
- static bool oleaccChecked = false;
-
- if (!oleaccChecked) {
- oleaccChecked = true;
- ptrLresultFromObject = reinterpret_cast<PtrLresultFromObject>(QSystemLibrary::resolve(QLatin1String("oleacc"), "LresultFromObject"));
- }
-
- if (ptrLresultFromObject) {
- QWindow *window = QWindowsContext::instance()->findWindow(hwnd);
- if (window) {
- QAccessibleInterface *acc = window->accessibleRoot();
- if (acc) {
- if (IAccessible *iface = wrap(acc)) {
- *lResult = ptrLresultFromObject(IID_IAccessible, wParam, iface); // ref == 2
- if (*lResult) {
- iface->Release(); // the client will release the object again, and then it will destroy itself
- }
- return true;
- }
- }
- }
- }
- }
- return false;
-}
-
-QT_END_NAMESPACE
-
-#endif //QT_NO_ACCESSIBILITY
diff --git a/src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.cpp b/src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.cpp
deleted file mode 100644
index fe2b9335cb..0000000000
--- a/src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.cpp
+++ /dev/null
@@ -1,1223 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 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 <QtCore/qglobal.h>
-#ifndef QT_NO_ACCESSIBILITY
-
-#include "qwindowsmsaaaccessible.h"
-#include "qwindowsaccessibility.h"
-#include "qwindowscombase.h"
-#include <oleacc.h>
-#include <servprov.h>
-#include <winuser.h>
-#include "comutils.h"
-
-#include <QtCore/qdebug.h>
-#include <QtCore/qmap.h>
-#include <QtCore/qpair.h>
-#include <QtGui/qaccessible.h>
-#include <QtGui/qguiapplication.h>
-#include <qpa/qplatformnativeinterface.h>
-#include <QtGui/qwindow.h>
-#include <QtGui/private/qhighdpiscaling_p.h>
-
-//#include <uiautomationcoreapi.h>
-#ifndef UiaRootObjectId
-#define UiaRootObjectId -25
-#endif
-
-#if !defined(Q_CC_BOR) && !defined (Q_CC_GNU)
-#include <comdef.h>
-#endif
-
-
-#include <QtCore/qt_windows.h>
-
-
-QT_BEGIN_NAMESPACE
-
-class QWindowsEnumerate : public QWindowsComBase<IEnumVARIANT>
-{
-public:
- QWindowsEnumerate(const QVector<int> &a) : QWindowsComBase<IEnumVARIANT>(0), current(0),array(a) {}
- virtual ~QWindowsEnumerate() {}
-
- HRESULT STDMETHODCALLTYPE Clone(IEnumVARIANT **ppEnum);
- HRESULT STDMETHODCALLTYPE Next(unsigned long celt, VARIANT FAR* rgVar, unsigned long FAR* pCeltFetched);
- HRESULT STDMETHODCALLTYPE Reset();
- HRESULT STDMETHODCALLTYPE Skip(unsigned long celt);
-
-private:
- ULONG current;
- QVector<int> array;
-};
-
-HRESULT STDMETHODCALLTYPE QWindowsEnumerate::Clone(IEnumVARIANT **ppEnum)
-{
- QWindowsEnumerate *penum = 0;
- *ppEnum = 0;
-
- penum = new QWindowsEnumerate(array);
- if (!penum)
- return E_OUTOFMEMORY;
- penum->current = current;
- penum->array = array;
- penum->AddRef();
- *ppEnum = penum;
-
- return S_OK;
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsEnumerate::Next(unsigned long celt, VARIANT FAR* rgVar, unsigned long FAR* pCeltFetched)
-{
- if (pCeltFetched)
- *pCeltFetched = 0;
-
- ULONG l;
- for (l = 0; l < celt; l++) {
- VariantInit(&rgVar[l]);
- if (current + 1 > ULONG(array.size())) {
- *pCeltFetched = l;
- return S_FALSE;
- }
-
- rgVar[l].vt = VT_I4;
- rgVar[l].lVal = array[int(current)];
- ++current;
- }
- *pCeltFetched = l;
- return S_OK;
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsEnumerate::Reset()
-{
- current = 0;
- return S_OK;
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsEnumerate::Skip(unsigned long celt)
-{
- current += celt;
- if (current > ULONG(array.size())) {
- current = ULONG(array.size());
- return S_FALSE;
- }
- return S_OK;
-}
-
-#if defined(DEBUG_SHOW_ATCLIENT_COMMANDS)
-void accessibleDebugClientCalls_helper(const char* funcName, const QAccessibleInterface *iface)
-{
- qCDebug(lcQpaAccessibility) << iface << funcName;
-}
-#endif
-
-/**************************************************************\
- * *
- * IUnknown *
- * *
- **************************************************************/
-HRESULT STDMETHODCALLTYPE QWindowsMsaaAccessible::QueryInterface(REFIID id, LPVOID *iface)
-{
- *iface = nullptr;
- const bool result = qWindowsComQueryUnknownInterfaceMulti<IAccessible2>(this, id, iface)
- || qWindowsComQueryInterface<IDispatch>(this, id, iface)
- || qWindowsComQueryInterface<IAccessible>(this, id, iface)
- || qWindowsComQueryInterface<IOleWindow>(this, id, iface);
-
- if (result) {
- qCDebug(lcQpaAccessibility) << "QWindowsIA2Accessible::QI() - "
- << QWindowsAccessibleGuid(id) << ", iface:" << accessibleInterface();
- }
- return result ? S_OK : E_NOINTERFACE;
-}
-
-ULONG STDMETHODCALLTYPE QWindowsMsaaAccessible::AddRef()
-{
- return ++ref;
-}
-
-ULONG STDMETHODCALLTYPE QWindowsMsaaAccessible::Release()
-{
- if (!--ref) {
- delete this;
- return 0;
- }
- return ref;
-}
-
-
-/*
- IDispatch
-*/
-
-HRESULT STDMETHODCALLTYPE QWindowsMsaaAccessible::GetTypeInfoCount(unsigned int * pctinfo)
-{
- // We don't use a type library
- *pctinfo = 0;
- return S_OK;
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsMsaaAccessible::GetTypeInfo(unsigned int, unsigned long, ITypeInfo **pptinfo)
-{
- // We don't use a type library
- *pptinfo = 0;
- return S_OK;
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsMsaaAccessible::GetIDsOfNames(const _GUID &, wchar_t **rgszNames, unsigned int, unsigned long, long *rgdispid)
-{
-#if !defined(Q_CC_BOR) && !defined(Q_CC_GNU)
- // PROPERTIES: Hierarchical
- if (_bstr_t(rgszNames[0]) == _bstr_t(L"accParent"))
- rgdispid[0] = DISPID_ACC_PARENT;
- else if (_bstr_t(rgszNames[0]) == _bstr_t(L"accChildCount"))
- rgdispid[0] = DISPID_ACC_CHILDCOUNT;
- else if (_bstr_t(rgszNames[0]) == _bstr_t(L"accChild"))
- rgdispid[0] = DISPID_ACC_CHILD;
-
- // PROPERTIES: Descriptional
- else if (_bstr_t(rgszNames[0]) == _bstr_t(L"accName("))
- rgdispid[0] = DISPID_ACC_NAME;
- else if (_bstr_t(rgszNames[0]) == _bstr_t(L"accValue"))
- rgdispid[0] = DISPID_ACC_VALUE;
- else if (_bstr_t(rgszNames[0]) == _bstr_t(L"accDescription"))
- rgdispid[0] = DISPID_ACC_DESCRIPTION;
- else if (_bstr_t(rgszNames[0]) == _bstr_t(L"accRole"))
- rgdispid[0] = DISPID_ACC_ROLE;
- else if (_bstr_t(rgszNames[0]) == _bstr_t(L"accState"))
- rgdispid[0] = DISPID_ACC_STATE;
- else if (_bstr_t(rgszNames[0]) == _bstr_t(L"accHelp"))
- rgdispid[0] = DISPID_ACC_HELP;
- else if (_bstr_t(rgszNames[0]) == _bstr_t(L"accHelpTopic"))
- rgdispid[0] = DISPID_ACC_HELPTOPIC;
- else if (_bstr_t(rgszNames[0]) == _bstr_t(L"accKeyboardShortcut"))
- rgdispid[0] = DISPID_ACC_KEYBOARDSHORTCUT;
- else if (_bstr_t(rgszNames[0]) == _bstr_t(L"accFocus"))
- rgdispid[0] = DISPID_ACC_FOCUS;
- else if (_bstr_t(rgszNames[0]) == _bstr_t(L"accSelection"))
- rgdispid[0] = DISPID_ACC_SELECTION;
- else if (_bstr_t(rgszNames[0]) == _bstr_t(L"accDefaultAction"))
- rgdispid[0] = DISPID_ACC_DEFAULTACTION;
-
- // METHODS
- else if (_bstr_t(rgszNames[0]) == _bstr_t(L"accSelect"))
- rgdispid[0] = DISPID_ACC_SELECT;
- else if (_bstr_t(rgszNames[0]) == _bstr_t(L"accLocation"))
- rgdispid[0] = DISPID_ACC_LOCATION;
- else if (_bstr_t(rgszNames[0]) == _bstr_t(L"accNavigate"))
- rgdispid[0] = DISPID_ACC_NAVIGATE;
- else if (_bstr_t(rgszNames[0]) == _bstr_t(L"accHitTest"))
- rgdispid[0] = DISPID_ACC_HITTEST;
- else if (_bstr_t(rgszNames[0]) == _bstr_t(L"accDoDefaultAction"))
- rgdispid[0] = DISPID_ACC_DODEFAULTACTION;
- else
- return DISP_E_UNKNOWNINTERFACE;
-
- return S_OK;
-#else
- Q_UNUSED(rgszNames);
- Q_UNUSED(rgdispid);
-
- return DISP_E_MEMBERNOTFOUND;
-#endif
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsMsaaAccessible::Invoke(long dispIdMember,
- const _GUID &,
- unsigned long,
- unsigned short wFlags,
- tagDISPPARAMS *pDispParams,
- tagVARIANT *pVarResult,
- tagEXCEPINFO *, unsigned int *)
-{
- HRESULT hr = DISP_E_MEMBERNOTFOUND;
-
- switch (dispIdMember)
- {
- case DISPID_ACC_PARENT:
- if (wFlags == DISPATCH_PROPERTYGET) {
- if (!pVarResult)
- return E_INVALIDARG;
- hr = get_accParent(&pVarResult->pdispVal);
- } else {
- hr = DISP_E_MEMBERNOTFOUND;
- }
- break;
-
- case DISPID_ACC_CHILDCOUNT:
- if (wFlags == DISPATCH_PROPERTYGET) {
- if (!pVarResult)
- return E_INVALIDARG;
- hr = get_accChildCount(&pVarResult->lVal);
- } else {
- hr = DISP_E_MEMBERNOTFOUND;
- }
- break;
-
- case DISPID_ACC_CHILD:
- if (wFlags == DISPATCH_PROPERTYGET)
- hr = get_accChild(pDispParams->rgvarg[0], &pVarResult->pdispVal);
- else
- hr = DISP_E_MEMBERNOTFOUND;
- break;
-
- case DISPID_ACC_NAME:
- if (wFlags == DISPATCH_PROPERTYGET)
- hr = get_accName(pDispParams->rgvarg[0], &pVarResult->bstrVal);
- else if (wFlags == DISPATCH_PROPERTYPUT)
- hr = put_accName(pDispParams->rgvarg[0], pVarResult->bstrVal);
- else
- hr = DISP_E_MEMBERNOTFOUND;
- break;
-
- case DISPID_ACC_VALUE:
- if (wFlags == DISPATCH_PROPERTYGET)
- hr = get_accValue(pDispParams->rgvarg[0], &pVarResult->bstrVal);
- else if (wFlags == DISPATCH_PROPERTYPUT)
- hr = put_accValue(pDispParams->rgvarg[0], pVarResult->bstrVal);
- else
- hr = DISP_E_MEMBERNOTFOUND;
- break;
-
- case DISPID_ACC_DESCRIPTION:
- if (wFlags == DISPATCH_PROPERTYGET)
- hr = get_accDescription(pDispParams->rgvarg[0], &pVarResult->bstrVal);
- else
- hr = DISP_E_MEMBERNOTFOUND;
- break;
-
- case DISPID_ACC_ROLE:
- if (wFlags == DISPATCH_PROPERTYGET)
- hr = get_accRole(pDispParams->rgvarg[0], pVarResult);
- else
- hr = DISP_E_MEMBERNOTFOUND;
- break;
-
- case DISPID_ACC_STATE:
- if (wFlags == DISPATCH_PROPERTYGET)
- hr = get_accState(pDispParams->rgvarg[0], pVarResult);
- else
- hr = DISP_E_MEMBERNOTFOUND;
- break;
-
- case DISPID_ACC_HELP:
- if (wFlags == DISPATCH_PROPERTYGET)
- hr = get_accHelp(pDispParams->rgvarg[0], &pVarResult->bstrVal);
- else
- hr = DISP_E_MEMBERNOTFOUND;
- break;
-
- case DISPID_ACC_HELPTOPIC:
- if (wFlags == DISPATCH_PROPERTYGET)
- hr = get_accHelpTopic(&pDispParams->rgvarg[2].bstrVal, pDispParams->rgvarg[1], &pDispParams->rgvarg[0].lVal);
- else
- hr = DISP_E_MEMBERNOTFOUND;
- break;
-
- case DISPID_ACC_KEYBOARDSHORTCUT:
- if (wFlags == DISPATCH_PROPERTYGET)
- hr = get_accKeyboardShortcut(pDispParams->rgvarg[0], &pVarResult->bstrVal);
- else
- hr = DISP_E_MEMBERNOTFOUND;
- break;
-
- case DISPID_ACC_FOCUS:
- if (wFlags == DISPATCH_PROPERTYGET)
- hr = get_accFocus(pVarResult);
- else
- hr = DISP_E_MEMBERNOTFOUND;
- break;
-
- case DISPID_ACC_SELECTION:
- if (wFlags == DISPATCH_PROPERTYGET)
- hr = get_accSelection(pVarResult);
- else
- hr = DISP_E_MEMBERNOTFOUND;
- break;
-
- case DISPID_ACC_DEFAULTACTION:
- if (wFlags == DISPATCH_PROPERTYGET)
- hr = get_accDefaultAction(pDispParams->rgvarg[0], &pVarResult->bstrVal);
- else
- hr = DISP_E_MEMBERNOTFOUND;
- break;
-
- case DISPID_ACC_SELECT:
- if (wFlags == DISPATCH_METHOD)
- hr = accSelect(pDispParams->rgvarg[1].lVal, pDispParams->rgvarg[0]);
- else
- hr = DISP_E_MEMBERNOTFOUND;
- break;
-
- case DISPID_ACC_LOCATION:
- if (wFlags == DISPATCH_METHOD)
- hr = accLocation(&pDispParams->rgvarg[4].lVal, &pDispParams->rgvarg[3].lVal, &pDispParams->rgvarg[2].lVal, &pDispParams->rgvarg[1].lVal, pDispParams->rgvarg[0]);
- else
- hr = DISP_E_MEMBERNOTFOUND;
- break;
-
- case DISPID_ACC_NAVIGATE:
- if (wFlags == DISPATCH_METHOD)
- hr = accNavigate(pDispParams->rgvarg[1].lVal, pDispParams->rgvarg[0], pVarResult);
- else
- hr = DISP_E_MEMBERNOTFOUND;
- break;
-
- case DISPID_ACC_HITTEST:
- if (wFlags == DISPATCH_METHOD)
- hr = accHitTest(pDispParams->rgvarg[1].lVal, pDispParams->rgvarg[0].lVal, pVarResult);
- else
- hr = DISP_E_MEMBERNOTFOUND;
- break;
-
- case DISPID_ACC_DODEFAULTACTION:
- if (wFlags == DISPATCH_METHOD)
- hr = accDoDefaultAction(pDispParams->rgvarg[0]);
- else
- hr = DISP_E_MEMBERNOTFOUND;
- break;
-
- default:
- hr = DISP_E_MEMBERNOTFOUND;
- break;
- }
-
- if (!SUCCEEDED(hr)) {
- return hr;
- }
- return hr;
-}
-
-/*
- IAccessible
-
-IAccessible::accHitTest documents the value returned in pvarID like this:
-
-| *Point location* | *vt member* | *Value member* |
-+========================================================+=============+=========================+
-| Outside of the object's boundaries, and either inside | VT_EMPTY | None. |
-| or outside of the object's bounding rectangle. | | |
-+--------------------------------------------------------+-------------+-------------------------+
-| Within the object but not within a child element or a | VT_I4 | lVal is CHILDID_SELF |
-| child object. | | |
-+--------------------------------------------------------+-------------+-------------------------+
-| Within a child element. | VT_I4 | lVal contains |
-| | | the child ID. |
-+--------------------------------------------------------+-------------+-------------------------+
-| Within a child object. | VT_DISPATCH | pdispVal is set to the |
-| | | child object's IDispatch|
-| | | interface pointer |
-+--------------------------------------------------------+-------------+-------------------------+
-*/
-HRESULT STDMETHODCALLTYPE QWindowsMsaaAccessible::accHitTest(long xLeft, long yTop, VARIANT *pvarID)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (!accessible)
- return E_FAIL;
-
- const QPoint pos = QHighDpi::fromNativeLocalPosition(QPoint(xLeft, yTop),
- QWindowsAccessibility::windowHelper(accessible));
- QAccessibleInterface *child = accessible->childAt(pos.x(), pos.y());
- if (child == 0) {
- // no child found, return this item if it contains the coordinates
- if (accessible->rect().contains(xLeft, yTop)) {
- (*pvarID).vt = VT_I4;
- (*pvarID).lVal = CHILDID_SELF;
- return S_OK;
- }
- } else {
- IAccessible *iface = QWindowsAccessibility::wrap(child);
- if (iface) {
- (*pvarID).vt = VT_DISPATCH;
- (*pvarID).pdispVal = iface;
- return S_OK;
- }
- }
-
- // Did not find anything
- (*pvarID).vt = VT_EMPTY;
- return S_FALSE;
-}
-
-/*
- It is recommended to read
- "Implementing a Microsoft Active Accessibility (MSAA) Server.
- Practical Tips for Developers and How Mozilla Does It"
- (https://developer.mozilla.org/En/Accessibility/Implementing_an_MSAA_Server)
-
- to get an overview of what's important to implement and what parts of MSAA
- can be ignored. All stuff prefixed with "moz" are information from that page.
-*/
-// moz: [important]
-HRESULT STDMETHODCALLTYPE QWindowsMsaaAccessible::accLocation(long *pxLeft, long *pyTop, long *pcxWidth, long *pcyHeight, VARIANT varID)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (!accessible)
- return E_FAIL;
-
- QAccessibleInterface *acc = childPointer(accessible, varID);
- if (!acc || !acc->isValid())
- return E_FAIL;
- const QRect rect = QHighDpi::toNativePixels(acc->rect(),
- QWindowsAccessibility::windowHelper(accessible));
-
- *pxLeft = rect.x();
- *pyTop = rect.y();
- *pcxWidth = rect.width();
- *pcyHeight = rect.height();
-
- return S_OK;
-}
-
-// moz: [important, but no need to implement up/down/left/right]
-HRESULT STDMETHODCALLTYPE QWindowsMsaaAccessible::accNavigate(long navDir, VARIANT varStart, VARIANT *pvarEnd)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (!accessible)
- return E_FAIL;
-
- QAccessibleInterface *acc = 0;
- switch (navDir) {
- case NAVDIR_FIRSTCHILD:
- acc = accessible->child(0);
- break;
- case NAVDIR_LASTCHILD:
- acc = accessible->child(accessible->childCount() - 1);
- break;
- case NAVDIR_NEXT:
- case NAVDIR_PREVIOUS:
- if (!varStart.lVal){
- QAccessibleInterface *parent = accessible->parent();
- if (parent && parent->isValid()) {
- int index = parent->indexOfChild(accessible);
- index += (navDir == NAVDIR_NEXT) ? 1 : -1;
- if (index >= 0 && index < parent->childCount())
- acc = parent->child(index);
- }
- } else {
- int index = varStart.lVal;
- index += (navDir == NAVDIR_NEXT) ? 1 : -1;
- if (index > 0 && index <= accessible->childCount())
- acc = accessible->child(index - 1);
- }
- break;
-
- // Geometrical
- case NAVDIR_UP:
- case NAVDIR_DOWN:
- case NAVDIR_LEFT:
- case NAVDIR_RIGHT: {
- QAccessibleInterface *pIface = accessible->parent();
- if (pIface && pIface->isValid()) {
- const int indexOfOurself = pIface->indexOfChild(accessible);
- QRect startg = accessible->rect();
- QPoint startc = startg.center();
- QAccessibleInterface *candidate = 0;
- unsigned mindist = UINT_MAX; // will work on screen sizes at least up to 46340x46340
- const int sibCount = pIface->childCount();
- for (int i = 0; i < sibCount; ++i) {
- QAccessibleInterface *sibling = 0;
- sibling = pIface->child(i);
- Q_ASSERT(sibling);
- if (i == indexOfOurself || sibling->state().invisible) {
- //ignore ourself and invisible siblings
- continue;
- }
-
- QRect sibg = sibling->rect();
- QPoint sibc = sibg.center();
- QPoint sibp;
- QPoint startp;
- QPoint distp;
- switch (navDir) {
- case NAVDIR_LEFT:
- startp = QPoint(startg.left(), startg.top() + startg.height() / 2);
- sibp = QPoint(sibg.right(), sibg.top() + sibg.height() / 2);
- if (QPoint(sibc - startc).x() >= 0) {
- continue;
- }
- distp = sibp - startp;
- break;
- case NAVDIR_RIGHT:
- startp = QPoint(startg.right(), startg.top() + startg.height() / 2);
- sibp = QPoint(sibg.left(), sibg.top() + sibg.height() / 2);
- if (QPoint(sibc - startc).x() <= 0) {
- continue;
- }
- distp = sibp - startp;
- break;
- case NAVDIR_UP:
- startp = QPoint(startg.left() + startg.width() / 2, startg.top());
- sibp = QPoint(sibg.left() + sibg.width() / 2, sibg.bottom());
- if (QPoint(sibc - startc).y() >= 0) {
- continue;
- }
- distp = sibp - startp;
- break;
- case NAVDIR_DOWN:
- startp = QPoint(startg.left() + startg.width() / 2, startg.bottom());
- sibp = QPoint(sibg.left() + sibg.width() / 2, sibg.top());
- if (QPoint(sibc - startc).y() <= 0) {
- continue;
- }
- distp = sibp - startp;
- break;
- default:
- break;
- }
-
- // Since we're *comparing* (and not measuring) distances, we can compare the
- // squared distance, (thus, no need to take the sqrt()).
- unsigned dist = distp.x() * distp.x() + distp.y() * distp.y();
- if (dist < mindist) {
- candidate = sibling;
- mindist = dist;
- }
- }
- acc = candidate;
- }
- }
- break;
- default:
- break;
- }
- if (!acc) {
- (*pvarEnd).vt = VT_EMPTY;
- return S_FALSE;
- }
-
- if (IAccessible *iface = QWindowsAccessibility::wrap(acc)) {
- (*pvarEnd).vt = VT_DISPATCH;
- (*pvarEnd).pdispVal = iface;
- return S_OK;
- }
-
- (*pvarEnd).vt = VT_EMPTY;
- return S_FALSE;
-}
-
-// moz: [important]
-HRESULT STDMETHODCALLTYPE QWindowsMsaaAccessible::get_accChild(VARIANT varChildID, IDispatch** ppdispChild)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (!accessible)
- return E_FAIL;
-
- if (varChildID.vt != VT_I4)
- return E_INVALIDARG;
-
- QAccessibleInterface *acc = childPointer(accessible, varChildID);
- if (acc && acc->isValid()) {
- *ppdispChild = QWindowsAccessibility::wrap(acc);
- return S_OK;
- }
-
- return E_FAIL;
-}
-
-// moz: [important]
-HRESULT STDMETHODCALLTYPE QWindowsMsaaAccessible::get_accChildCount(long* pcountChildren)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (!accessible)
- return E_FAIL;
-
- *pcountChildren = accessible->childCount();
- return S_OK;
-}
-
-// moz: [important]
-HRESULT STDMETHODCALLTYPE QWindowsMsaaAccessible::get_accParent(IDispatch** ppdispParent)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (!accessible)
- return E_FAIL;
-
- QAccessibleInterface *acc = accessible->parent();
- if (acc) {
- if (IAccessible *iface = QWindowsAccessibility::wrap(acc)) {
- *ppdispParent = iface;
- return S_OK;
- }
- }
-
- *ppdispParent = 0;
- return S_FALSE;
-}
-
-/*
- Properties and methods
-*/
-HRESULT STDMETHODCALLTYPE QWindowsMsaaAccessible::accDoDefaultAction(VARIANT varID)
-{
- Q_UNUSED(varID);
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (!accessible)
- return E_FAIL;
-
- if (QAccessibleActionInterface *actionIface = accessible->actionInterface()) {
- const QString def = actionIface->actionNames().value(0);
- if (!def.isEmpty()) {
- actionIface->doAction(def);
- return S_OK;
- }
- }
- return S_FALSE;
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsMsaaAccessible::get_accDefaultAction(VARIANT varID, BSTR* pszDefaultAction)
-{
- Q_UNUSED(varID);
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (!accessible)
- return E_FAIL;
-
- *pszDefaultAction = 0;
- if (QAccessibleActionInterface *actionIface = accessible->actionInterface()) {
- const QString def = actionIface->actionNames().value(0);
- if (!def.isEmpty())
- *pszDefaultAction = QStringToBSTR(def);
- }
- return *pszDefaultAction ? S_OK : S_FALSE;
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsMsaaAccessible::get_accDescription(VARIANT varID, BSTR* pszDescription)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (!accessible)
- return E_FAIL;
-
-
- QString descr;
- if (varID.lVal) {
- QAccessibleInterface *child = childPointer(accessible, varID);
- if (!child || !child->isValid())
- return E_FAIL;
- descr = child->text(QAccessible::Description);
- } else {
- descr = accessible->text(QAccessible::Description);
- }
- if (descr.size()) {
- *pszDescription = QStringToBSTR(descr);
- return S_OK;
- }
-
- *pszDescription = 0;
- return S_FALSE;
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsMsaaAccessible::get_accHelp(VARIANT varID, BSTR *pszHelp)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (!accessible)
- return E_FAIL;
-
- QString help;
- if (varID.lVal) {
- QAccessibleInterface *child = childPointer(accessible, varID);
- if (!child || !child->isValid())
- return E_FAIL;
- help = child->text(QAccessible::Help);
- } else {
- help = accessible->text(QAccessible::Help);
- }
- if (help.size()) {
- *pszHelp = QStringToBSTR(help);
- return S_OK;
- }
-
- *pszHelp = 0;
- return S_FALSE;
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsMsaaAccessible::get_accHelpTopic(BSTR *, VARIANT, long *)
-{
- return DISP_E_MEMBERNOTFOUND;
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsMsaaAccessible::get_accKeyboardShortcut(VARIANT varID, BSTR *pszKeyboardShortcut)
-{
- Q_UNUSED(varID);
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (!accessible)
- return E_FAIL;
-
- *pszKeyboardShortcut = 0;
- if (QAccessibleActionInterface *actionIface = accessible->actionInterface()) {
- const QString def = actionIface->actionNames().value(0);
- if (!def.isEmpty()) {
- const QString keyBoardShortCut = actionIface->keyBindingsForAction(def).value(0);
- if (!keyBoardShortCut.isEmpty())
- *pszKeyboardShortcut = QStringToBSTR(keyBoardShortCut);
- }
- }
- return *pszKeyboardShortcut ? S_OK : S_FALSE;
-}
-
-static QAccessibleInterface *relatedInterface(QAccessibleInterface *iface, QAccessible::RelationFlag flag)
-{
- typedef QPair<QAccessibleInterface *, QAccessible::Relation> RelationPair;
- QVector<RelationPair> rels = iface->relations(flag);
-
- return rels.value(0).first;
-}
-
-// moz: [important]
-HRESULT STDMETHODCALLTYPE QWindowsMsaaAccessible::get_accName(VARIANT varID, BSTR* pszName)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (!accessible)
- return E_FAIL;
-
- QString name;
- if (varID.lVal) {
- QAccessibleInterface *child = childPointer(accessible, varID);
- if (!child || !child->isValid())
- return E_FAIL;
- name = child->text(QAccessible::Name);
- if (name.isEmpty()) {
- if (QAccessibleInterface *labelInterface = relatedInterface(child, QAccessible::Label)) {
- name = labelInterface->text(QAccessible::Name);
- }
- }
- } else {
- name = accessible->text(QAccessible::Name);
- if (name.isEmpty()) {
- if (QAccessibleInterface *labelInterface = relatedInterface(accessible, QAccessible::Label)) {
- name = labelInterface->text(QAccessible::Name);
- }
- }
- }
-
- QString shortcut = accessible->text(QAccessible::Accelerator);
- if (!shortcut.isEmpty())
- name += QLatin1Char(' ') + shortcut;
-
- if (name.size()) {
- *pszName = QStringToBSTR(name);
- return S_OK;
- }
-
- *pszName = 0;
- return S_FALSE;
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsMsaaAccessible::put_accName(VARIANT, BSTR)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- return DISP_E_MEMBERNOTFOUND;
-}
-
-// moz: [important]
-HRESULT STDMETHODCALLTYPE QWindowsMsaaAccessible::get_accRole(VARIANT varID, VARIANT *pvarRole)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (!accessible)
- return E_FAIL;
-
- QAccessible::Role role;
- if (varID.lVal) {
- QAccessibleInterface *child = childPointer(accessible, varID);
- if (!child || !child->isValid())
- return E_FAIL;
- role = child->role();
- } else {
- role = accessible->role();
- }
-
- if (role != QAccessible::NoRole) {
- if (role >= QAccessible::LayeredPane) {
- // This block should hopefully only be entered if the AT client
- // does not support IAccessible2, since it should prefer IA2::role() then.
- if (role == QAccessible::LayeredPane)
- role = QAccessible::Pane;
- else if (role == QAccessible::WebDocument)
- role = QAccessible::Document;
- else
- role = QAccessible::Client;
- }
- (*pvarRole).vt = VT_I4;
- (*pvarRole).lVal = role;
- } else {
- (*pvarRole).vt = VT_EMPTY;
- }
- return S_OK;
-}
-
-// moz: [important]
-HRESULT STDMETHODCALLTYPE QWindowsMsaaAccessible::get_accState(VARIANT varID, VARIANT *pvarState)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (!accessible)
- return E_FAIL;
-
- QAccessible::State state;
- if (varID.lVal) {
- QAccessibleInterface *child = childPointer(accessible, varID);
- if (!child || !child->isValid())
- return E_FAIL;
- state = child->state();
- } else {
- state = accessible->state();
- }
-
- LONG st = 0;
- if (state.animated)
- st |= STATE_SYSTEM_ANIMATED;
- if (state.busy)
- st |= STATE_SYSTEM_BUSY;
- if (state.checked)
- st |= STATE_SYSTEM_CHECKED;
- if (state.collapsed)
- st |= STATE_SYSTEM_COLLAPSED;
- if (state.defaultButton)
- st |= STATE_SYSTEM_DEFAULT;
- if (state.expanded)
- st |= STATE_SYSTEM_EXPANDED;
- if (state.extSelectable)
- st |= STATE_SYSTEM_EXTSELECTABLE;
- if (state.focusable)
- st |= STATE_SYSTEM_FOCUSABLE;
- if (state.focused)
- st |= STATE_SYSTEM_FOCUSED;
- if (state.hasPopup)
- st |= STATE_SYSTEM_HASPOPUP;
- if (state.hotTracked)
- st |= STATE_SYSTEM_HOTTRACKED;
- if (state.invisible)
- st |= STATE_SYSTEM_INVISIBLE;
- if (state.linked)
- st |= STATE_SYSTEM_LINKED;
- if (state.marqueed)
- st |= STATE_SYSTEM_MARQUEED;
- if (state.checkStateMixed)
- st |= STATE_SYSTEM_MIXED;
- if (state.movable)
- st |= STATE_SYSTEM_MOVEABLE;
- if (state.multiSelectable)
- st |= STATE_SYSTEM_MULTISELECTABLE;
- if (state.offscreen)
- st |= STATE_SYSTEM_OFFSCREEN;
- if (state.pressed)
- st |= STATE_SYSTEM_PRESSED;
- if (state.passwordEdit)
- st |= STATE_SYSTEM_PROTECTED;
- if (state.readOnly)
- st |= STATE_SYSTEM_READONLY;
- if (state.selectable)
- st |= STATE_SYSTEM_SELECTABLE;
- if (state.selected)
- st |= STATE_SYSTEM_SELECTED;
- if (state.selfVoicing)
- st |= STATE_SYSTEM_SELFVOICING;
- if (state.sizeable)
- st |= STATE_SYSTEM_SIZEABLE;
- if (state.traversed)
- st |= STATE_SYSTEM_TRAVERSED;
- if (state.disabled)
- st |= STATE_SYSTEM_UNAVAILABLE;
-
- (*pvarState).vt = VT_I4;
- (*pvarState).lVal = st;
- return S_OK;
-}
-
-// moz: [important]
-HRESULT STDMETHODCALLTYPE QWindowsMsaaAccessible::get_accValue(VARIANT varID, BSTR* pszValue)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (varID.vt != VT_I4)
- return E_INVALIDARG;
-
- if (!accessible || !accessible->isValid() || varID.lVal) {
- return E_FAIL;
- }
-
- QString value;
- if (accessible->valueInterface()) {
- value = accessible->valueInterface()->currentValue().toString();
- } else {
- value = accessible->text(QAccessible::Value);
- }
- if (!value.isNull()) {
- *pszValue = QStringToBSTR(value);
- return S_OK;
- }
-
- *pszValue = 0;
- qCDebug(lcQpaAccessibility) << "return S_FALSE";
- return S_FALSE;
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsMsaaAccessible::put_accValue(VARIANT, BSTR value)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
-
- if (!accessible || !accessible->isValid()) {
- return E_FAIL;
- }
-
- QString qstrValue = QString::fromWCharArray(value);
-
- if (accessible->valueInterface()) {
- accessible->valueInterface()->setCurrentValue(qstrValue);
- } else {
- accessible->setText(QAccessible::Value, qstrValue);
- }
-
- return S_OK;
-}
-
-// moz: [important]
-HRESULT STDMETHODCALLTYPE QWindowsMsaaAccessible::accSelect(long flagsSelect, VARIANT varID)
-{
- Q_UNUSED(flagsSelect);
- Q_UNUSED(varID);
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (!accessible)
- return E_FAIL;
-
- bool res = false;
-
-/*
- ### Check for accessibleTableInterface() or accessibleTextInterface()
-
- ### and if there are no ia2 interfaces we should do nothing??
- if (flagsSelect & SELFLAG_TAKEFOCUS)
- res = accessible()->doAction(SetFocus, varID.lVal, QVariantList());
- if (flagsSelect & SELFLAG_TAKESELECTION) {
- accessible()->doAction(ClearSelection, 0, QVariantList());
- res = accessible()->doAction(AddToSelection, varID.lVal, QVariantList());
- }
- if (flagsSelect & SELFLAG_EXTENDSELECTION)
- res = accessible()->doAction(ExtendSelection, varID.lVal, QVariantList());
- if (flagsSelect & SELFLAG_ADDSELECTION)
- res = accessible()->doAction(AddToSelection, varID.lVal, QVariantList());
- if (flagsSelect & SELFLAG_REMOVESELECTION)
- res = accessible()->doAction(RemoveSelection, varID.lVal, QVariantList());
-*/
- return res ? S_OK : S_FALSE;
-}
-
-/*!
- \internal
- Can return:
-
- +-------------+------------------------------------------------------------------------------+
- | VT_EMPTY | None. Neither this object nor any of its children has the keyboard focus. |
- +-------------+------------------------------------------------------------------------------+
- | VT_I4 | lVal is CHILDID_SELF. The object itself has the keyboard focus. |
- +-------------+------------------------------------------------------------------------------+
- | VT_I4 | lVal contains the child ID of the child element that has the keyboard focus. |
- +-------------+------------------------------------------------------------------------------+
- | VT_DISPATCH | pdispVal member is the address of the IDispatch interface for the child |
- | | object that has the keyboard focus. |
- +-------------+------------------------------------------------------------------------------+
- moz: [important]
-*/
-HRESULT STDMETHODCALLTYPE QWindowsMsaaAccessible::get_accFocus(VARIANT *pvarID)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (!accessible)
- return E_FAIL;
-
- if (QAccessibleInterface *acc = accessible->focusChild()) {
- if (acc == accessible) {
- (*pvarID).vt = VT_I4;
- (*pvarID).lVal = CHILDID_SELF;
- return S_OK;
- } else {
- if (IAccessible *iface = QWindowsAccessibility::wrap(acc)) {
- (*pvarID).vt = VT_DISPATCH;
- (*pvarID).pdispVal = iface;
- return S_OK;
- }
- }
- }
- (*pvarID).vt = VT_EMPTY;
- return S_FALSE;
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsMsaaAccessible::get_accSelection(VARIANT *pvarChildren)
-{
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (!accessible)
- return E_FAIL;
-
- int cc = accessible->childCount();
- QVector<int> sel(cc);
- int selIndex = 0;
- for (int i = 0; i < cc; ++i) {
- bool isSelected = false;
- QAccessibleInterface *child = accessible->child(i);
- if (child) {
- isSelected = child->state().selected;
- }
- if (isSelected)
- sel[selIndex++] = i+1;
- }
- sel.resize(selIndex);
- if (sel.isEmpty()) {
- (*pvarChildren).vt = VT_EMPTY;
- return S_FALSE;
- }
- if (sel.size() == 1) {
- (*pvarChildren).vt = VT_I4;
- (*pvarChildren).lVal = sel[0];
- return S_OK;
- }
- IEnumVARIANT *iface = new QWindowsEnumerate(sel);
- IUnknown *uiface;
- iface->QueryInterface(IID_IUnknown, (void**)&uiface);
- (*pvarChildren).vt = VT_UNKNOWN;
- (*pvarChildren).punkVal = uiface;
-
- return S_OK;
-}
-
-/**************************************************************\
- * IOleWindow *
- **************************************************************/
-HRESULT STDMETHODCALLTYPE QWindowsMsaaAccessible::GetWindow(HWND *phwnd)
-{
- *phwnd = 0;
- QAccessibleInterface *accessible = accessibleInterface();
- accessibleDebugClientCalls(accessible);
- if (!accessible)
- return E_FAIL;
-
- QWindow *window = QWindowsAccessibility::windowHelper(accessible);
- if (!window)
- return E_FAIL;
-
- QPlatformNativeInterface *platform = QGuiApplication::platformNativeInterface();
- Q_ASSERT(platform);
- *phwnd = (HWND)platform->nativeResourceForWindow("handle", window);
- qCDebug(lcQpaAccessibility) << "QWindowsAccessible::GetWindow(): " << *phwnd;
- return S_OK;
-}
-
-HRESULT STDMETHODCALLTYPE QWindowsMsaaAccessible::ContextSensitiveHelp(BOOL)
-{
- return S_OK;
-}
-
-const char *QWindowsAccessibleGuid::iidToString(const GUID &id)
-{
- const char *result = nullptr;
- if (id == IID_IUnknown)
- result = "IID_IUnknown";
- else if (id == IID_IDispatch)
- result = "IID_IDispatch";
- else if (id == IID_IAccessible)
- result = "IID_IAccessible";
- else if (id == IID_IOleWindow)
- result = "IID_IOleWindow";
- else if (id == IID_IServiceProvider)
- result = "IID_IServiceProvider";
- else if (id == IID_IAccessible2)
- result = "IID_IAccessible2";
- else if (id == IID_IAccessibleAction)
- result = "IID_IAccessibleAction";
- else if (id == IID_IAccessibleApplication)
- result = "IID_IAccessibleApplication";
- else if (id == IID_IAccessibleComponent)
- result = "IID_IAccessibleComponent";
- else if (id == IID_IAccessibleEditableText)
- result = "IID_IAccessibleEditableText";
- else if (id == IID_IAccessibleHyperlink)
- result = "IID_IAccessibleHyperlink";
- else if (id == IID_IAccessibleHypertext)
- result = "IID_IAccessibleHypertext";
- else if (id == IID_IAccessibleImage)
- result = "IID_IAccessibleImage";
- else if (id == IID_IAccessibleRelation)
- result = "IID_IAccessibleRelation";
- else if (id == IID_IAccessibleTable)
- result = "IID_IAccessibleTable";
- else if (id == IID_IAccessibleTable2)
- result = "IID_IAccessibleTable2";
- else if (id == IID_IAccessibleTableCell)
- result = "IID_IAccessibleTableCell";
- else if (id == IID_IAccessibleText)
- result = "IID_IAccessibleText";
- else if (id == IID_IAccessibleValue)
- result = "IID_IAccessibleValue";
- return result;
-}
-
-#ifndef QT_NO_DEBUG_STREAM
-QDebug operator<<(QDebug, const GUID &);
-
-QDebug operator<<(QDebug d, const QWindowsAccessibleGuid &aguid)
-{
- QDebugStateSaver saver(d);
- d.nospace();
- if (const char *ids = QWindowsAccessibleGuid::iidToString(aguid.guid()))
- d << ids;
- else
- d << aguid.guid();
- return d;
-}
-#endif // !QT_NO_DEBUG_STREAM
-
-QT_END_NAMESPACE
-
-#endif //QT_NO_ACCESSIBILITY
diff --git a/src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.h b/src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.h
deleted file mode 100644
index 5380fc2411..0000000000
--- a/src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.h
+++ /dev/null
@@ -1,176 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 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$
-**
-****************************************************************************/
-#ifndef QWINDOWSMSAAACCESSIBLE_H
-#define QWINDOWSMSAAACCESSIBLE_H
-
-#include <QtCore/qglobal.h>
-#ifndef QT_NO_ACCESSIBILITY
-
-#include <QtCore/qt_windows.h>
-#include <QtCore/qsharedpointer.h>
-#include <QtGui/qaccessible.h>
-#include <oleacc.h>
-#include "ia2_api_all.h" // IAccessible2 inherits from IAccessible
-
-QT_BEGIN_NAMESPACE
-
-#ifndef QT_NO_DEBUG_OUTPUT
-#define DEBUG_SHOW_ATCLIENT_COMMANDS
-#endif
-#if defined(DEBUG_SHOW_ATCLIENT_COMMANDS)
-void accessibleDebugClientCalls_helper(const char* funcName, const QAccessibleInterface *iface);
-# define accessibleDebugClientCalls(iface) accessibleDebugClientCalls_helper(Q_FUNC_INFO, iface)
-#else
-# define accessibleDebugClientCalls(iface)
-#endif
-
-QWindow *window_helper(const QAccessibleInterface *iface);
-
-class QWindowsAccessibleGuid // Helper for QDebug, outputs known ids by name.
-{
-public:
- explicit QWindowsAccessibleGuid(const GUID &g) : m_guid(g) {}
- GUID guid () const { return m_guid; }
- static const char *iidToString(const GUID &id);
-
-private:
- GUID m_guid;
-};
-
-#ifndef QT_NO_DEBUG_STREAM
-QDebug operator<<(QDebug d, const QWindowsAccessibleGuid &aguid);
-#endif
-
-/**************************************************************\
- * QWindowsAccessible *
- **************************************************************/
-
-class QWindowsMsaaAccessible : public IAccessible2, public IOleWindow
-{
-public:
- QWindowsMsaaAccessible(QAccessibleInterface *a)
- : ref(0)
- {
- id = QAccessible::uniqueId(a);
- }
-
- virtual ~QWindowsMsaaAccessible()
- {
- }
-
- /* IUnknown */
- HRESULT STDMETHODCALLTYPE QueryInterface(REFIID, LPVOID *);
- ULONG STDMETHODCALLTYPE AddRef();
- ULONG STDMETHODCALLTYPE Release();
-
- /* IDispatch */
- HRESULT STDMETHODCALLTYPE GetTypeInfoCount(unsigned int *);
- HRESULT STDMETHODCALLTYPE GetTypeInfo(unsigned int, unsigned long, ITypeInfo **);
- HRESULT STDMETHODCALLTYPE GetIDsOfNames(const _GUID &, wchar_t **, unsigned int, unsigned long, long *);
- HRESULT STDMETHODCALLTYPE Invoke(long, const _GUID &, unsigned long, unsigned short, tagDISPPARAMS *, tagVARIANT *, tagEXCEPINFO *, unsigned int *);
-
- /* IAccessible */
- HRESULT STDMETHODCALLTYPE accHitTest(long xLeft, long yTop, VARIANT *pvarID);
- HRESULT STDMETHODCALLTYPE accLocation(long *pxLeft, long *pyTop, long *pcxWidth, long *pcyHeight, VARIANT varID);
- HRESULT STDMETHODCALLTYPE accNavigate(long navDir, VARIANT varStart, VARIANT *pvarEnd);
- HRESULT STDMETHODCALLTYPE get_accChild(VARIANT varChildID, IDispatch** ppdispChild);
- HRESULT STDMETHODCALLTYPE get_accChildCount(long* pcountChildren);
- HRESULT STDMETHODCALLTYPE get_accParent(IDispatch** ppdispParent);
-
- HRESULT STDMETHODCALLTYPE accDoDefaultAction(VARIANT varID);
- HRESULT STDMETHODCALLTYPE get_accDefaultAction(VARIANT varID, BSTR* pszDefaultAction);
- HRESULT STDMETHODCALLTYPE get_accDescription(VARIANT varID, BSTR* pszDescription);
- HRESULT STDMETHODCALLTYPE get_accHelp(VARIANT varID, BSTR *pszHelp);
- HRESULT STDMETHODCALLTYPE get_accHelpTopic(BSTR *pszHelpFile, VARIANT varChild, long *pidTopic);
- HRESULT STDMETHODCALLTYPE get_accKeyboardShortcut(VARIANT varID, BSTR *pszKeyboardShortcut);
- HRESULT STDMETHODCALLTYPE get_accName(VARIANT varID, BSTR* pszName);
- HRESULT STDMETHODCALLTYPE put_accName(VARIANT varChild, BSTR szName);
- HRESULT STDMETHODCALLTYPE get_accRole(VARIANT varID, VARIANT *pvarRole);
- HRESULT STDMETHODCALLTYPE get_accState(VARIANT varID, VARIANT *pvarState);
- HRESULT STDMETHODCALLTYPE get_accValue(VARIANT varID, BSTR* pszValue);
- HRESULT STDMETHODCALLTYPE put_accValue(VARIANT varChild, BSTR szValue);
-
- HRESULT STDMETHODCALLTYPE accSelect(long flagsSelect, VARIANT varID);
- HRESULT STDMETHODCALLTYPE get_accFocus(VARIANT *pvarID);
- HRESULT STDMETHODCALLTYPE get_accSelection(VARIANT *pvarChildren);
-
- /* IOleWindow */
- HRESULT STDMETHODCALLTYPE GetWindow(HWND *phwnd);
- HRESULT STDMETHODCALLTYPE ContextSensitiveHelp(BOOL fEnterMode);
-
-protected:
- QAccessible::Id id;
-
- QAccessibleInterface *accessibleInterface() const
- {
- QAccessibleInterface *iface = QAccessible::accessibleInterface(id);
- if (iface && iface->isValid())
- return iface;
- return 0;
- }
-
- static QAccessibleInterface *childPointer(QAccessibleInterface *parent, VARIANT varID)
- {
- // -1 since windows API always uses 1 for the first child
- Q_ASSERT(parent);
-
- QAccessibleInterface *acc = 0;
- int childIndex = varID.lVal;
- if (childIndex == 0) {
- // Yes, some AT clients (Active Accessibility Object Inspector)
- // actually ask for the same object. As a consequence, we need to clone ourselves:
- acc = parent;
- } else if (childIndex < 0) {
- acc = QAccessible::accessibleInterface((QAccessible::Id)childIndex);
- } else {
- acc = parent->child(childIndex - 1);
- }
- return acc;
- }
-
-private:
- ULONG ref;
-
-};
-
-QT_END_NAMESPACE
-
-#endif //QT_NO_ACCESSIBILITY
-
-#endif // QWINDOWSMSAAACCESSIBLE_H
diff --git a/src/plugins/platforms/windows/qwin10helpers.cpp b/src/plugins/platforms/windows/qwin10helpers.cpp
index 12cccd124b..ac6a34d7c2 100644
--- a/src/plugins/platforms/windows/qwin10helpers.cpp
+++ b/src/plugins/platforms/windows/qwin10helpers.cpp
@@ -40,6 +40,7 @@
#include "qwin10helpers.h"
#include <QtCore/QDebug>
+#include <QtCore/QOperatingSystemVersion>
#include <QtCore/private/qsystemlibrary_p.h>
#if defined(Q_CC_MINGW)
@@ -115,7 +116,7 @@ static QWindowsComBaseDLL baseComDll;
bool QWindowsComBaseDLL::init()
{
- if (QSysInfo::windowsVersion() >= QSysInfo::WV_WINDOWS10 && !isValid()) {
+ if (QOperatingSystemVersion::current() >= QOperatingSystemVersion::Windows10 && !isValid()) {
QSystemLibrary library(QStringLiteral("combase"));
roGetActivationFactory =
reinterpret_cast<RoGetActivationFactory>(library.resolve("RoGetActivationFactory"));
diff --git a/src/plugins/platforms/windows/qwindowsbackingstore.cpp b/src/plugins/platforms/windows/qwindowsbackingstore.cpp
index 49c7144221..80872c3ea3 100644
--- a/src/plugins/platforms/windows/qwindowsbackingstore.cpp
+++ b/src/plugins/platforms/windows/qwindowsbackingstore.cpp
@@ -93,7 +93,7 @@ void QWindowsBackingStore::flush(QWindow *window, const QRegion &region,
// Windows with alpha: Use blend function to update.
QRect r = QHighDpi::toNativePixels(window->frameGeometry(), window);
QPoint frameOffset(QHighDpi::toNativePixels(QPoint(window->frameMargins().left(), window->frameMargins().top()),
- static_cast<const QWindow *>(Q_NULLPTR)));
+ static_cast<const QWindow *>(nullptr)));
QRect dirtyRect = br.translated(offset + frameOffset);
SIZE size = {r.width(), r.height()};
diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp
index 9912e03cb9..c146f8ec25 100644
--- a/src/plugins/platforms/windows/qwindowscontext.cpp
+++ b/src/plugins/platforms/windows/qwindowscontext.cpp
@@ -53,7 +53,7 @@
#include "qwindowstheme.h"
#include <private/qguiapplication_p.h>
#ifndef QT_NO_ACCESSIBILITY
-# include "accessible/qwindowsaccessibility.h"
+# include "uiautomation/qwindowsuiaaccessibility.h"
#endif
#if QT_CONFIG(sessionmanager)
# include <private/qsessionmanager_p.h>
@@ -98,6 +98,7 @@ Q_LOGGING_CATEGORY(lcQpaDialogs, "qt.qpa.dialogs")
Q_LOGGING_CATEGORY(lcQpaMenus, "qt.qpa.menus")
Q_LOGGING_CATEGORY(lcQpaTablet, "qt.qpa.input.tablet")
Q_LOGGING_CATEGORY(lcQpaAccessibility, "qt.qpa.accessibility")
+Q_LOGGING_CATEGORY(lcQpaUiAutomation, "qt.qpa.uiautomation")
Q_LOGGING_CATEGORY(lcQpaTrayIcon, "qt.qpa.trayicon")
int QWindowsContext::verbose = 0;
@@ -193,26 +194,14 @@ void QWindowsUser32DLL::init()
getDisplayAutoRotationPreferences = (GetDisplayAutoRotationPreferences)library.resolve("GetDisplayAutoRotationPreferences");
setDisplayAutoRotationPreferences = (SetDisplayAutoRotationPreferences)library.resolve("SetDisplayAutoRotationPreferences");
- if (QSysInfo::windowsVersion() >= QSysInfo::WV_WINDOWS10) { // Appears in 10.0.14393, October 2016
+ if (QOperatingSystemVersion::current()
+ >= QOperatingSystemVersion(QOperatingSystemVersion::Windows, 10, 0, 14393)) {
enableNonClientDpiScaling = (EnableNonClientDpiScaling)library.resolve("EnableNonClientDpiScaling");
getWindowDpiAwarenessContext = (GetWindowDpiAwarenessContext)library.resolve("GetWindowDpiAwarenessContext");
getAwarenessFromDpiAwarenessContext = (GetAwarenessFromDpiAwarenessContext)library.resolve("GetAwarenessFromDpiAwarenessContext");
}
}
-bool QWindowsUser32DLL::initTouch()
-{
- if (!isTouchWindow && QSysInfo::windowsVersion() >= QSysInfo::WV_WINDOWS7) {
- QSystemLibrary library(QStringLiteral("user32"));
- isTouchWindow = (IsTouchWindow)(library.resolve("IsTouchWindow"));
- registerTouchWindow = (RegisterTouchWindow)(library.resolve("RegisterTouchWindow"));
- unregisterTouchWindow = (UnregisterTouchWindow)(library.resolve("UnregisterTouchWindow"));
- getTouchInputInfo = (GetTouchInputInfo)(library.resolve("GetTouchInputInfo"));
- closeTouchInputHandle = (CloseTouchInputHandle)(library.resolve("CloseTouchInputHandle"));
- }
- return isTouchWindow && registerTouchWindow && unregisterTouchWindow && getTouchInputInfo && closeTouchInputHandle;
-}
-
void QWindowsShcoreDLL::init()
{
if (QOperatingSystemVersion::current() < QOperatingSystemVersion::Windows8_1)
@@ -269,7 +258,7 @@ QWindowsContextPrivate::QWindowsContextPrivate()
QWindowsContext::user32dll.init();
QWindowsContext::shcoredll.init();
- if (m_mouseHandler.touchDevice() && QWindowsContext::user32dll.initTouch())
+ if (m_mouseHandler.touchDevice())
m_systemInfo |= QWindowsContext::SI_SupportsTouch;
m_displayContext = GetDC(0);
m_defaultDPI = GetDeviceCaps(m_displayContext, LOGPIXELSY);
@@ -327,11 +316,6 @@ bool QWindowsContext::initTouch(unsigned integrationOptions)
if (!touchDevice)
return false;
- if (!QWindowsContext::user32dll.initTouch()) {
- delete touchDevice;
- return false;
- }
-
if (!(integrationOptions & QWindowsIntegration::DontPassOsMouseEventsSynthesizedFromTouch))
touchDevice->setCapabilities(touchDevice->capabilities() | QTouchDevice::MouseEmulation);
@@ -454,7 +438,7 @@ QString QWindowsContext::registerWindowClass(const QWindow *w)
// QOpenGLWidget or QQuickWidget later on. That cannot be detected at this stage.
if (w->surfaceType() == QSurface::OpenGLSurface || (flags & Qt::MSWindowsOwnDC))
style |= CS_OWNDC;
- if (!(flags & Qt::NoDropShadowWindowHint) && (QSysInfo::WindowsVersion & QSysInfo::WV_NT_based)
+ if (!(flags & Qt::NoDropShadowWindowHint)
&& (type == Qt::Popup || w->property("_q_windowsDropShadow").toBool())) {
style |= CS_DROPSHADOW;
}
@@ -757,7 +741,7 @@ HWND QWindowsContext::createDummyWindow(const QString &classNameIn,
// present in the MSVCRT.DLL found on Windows XP (QTBUG-35617).
static inline QString errorMessageFromComError(const _com_error &comError)
{
- TCHAR *message = Q_NULLPTR;
+ TCHAR *message = nullptr;
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
NULL, DWORD(comError.Error()), MAKELANGID(LANG_NEUTRAL,SUBLANG_DEFAULT),
message, 0, NULL);
@@ -872,7 +856,7 @@ static inline bool resizeOnDpiChanged(const QWindow *w)
static bool shouldHaveNonClientDpiScaling(const QWindow *window)
{
- return QSysInfo::windowsVersion() >= QSysInfo::WV_WINDOWS10
+ return QOperatingSystemVersion::current() >= QOperatingSystemVersion::Windows10
&& window->isTopLevel()
&& !window->property(QWindowsWindow::embeddedNativeParentHandleProperty).isValid()
#if QT_CONFIG(opengl) // /QTBUG-62901, EnableNonClientDpiScaling has problems with GL
@@ -974,7 +958,7 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message,
return false;
case QtWindows::AccessibleObjectFromWindowRequest:
#ifndef QT_NO_ACCESSIBILITY
- return QWindowsAccessibility::handleAccessibleObjectFromWindowRequest(hwnd, wParam, lParam, result);
+ return QWindowsUiaAccessibility::handleWmGetObject(hwnd, wParam, lParam, result);
#else
return false;
#endif
diff --git a/src/plugins/platforms/windows/qwindowscontext.h b/src/plugins/platforms/windows/qwindowscontext.h
index 5c39b6068b..f2ec307be2 100644
--- a/src/plugins/platforms/windows/qwindowscontext.h
+++ b/src/plugins/platforms/windows/qwindowscontext.h
@@ -66,6 +66,7 @@ Q_DECLARE_LOGGING_CATEGORY(lcQpaDialogs)
Q_DECLARE_LOGGING_CATEGORY(lcQpaMenus)
Q_DECLARE_LOGGING_CATEGORY(lcQpaTablet)
Q_DECLARE_LOGGING_CATEGORY(lcQpaAccessibility)
+Q_DECLARE_LOGGING_CATEGORY(lcQpaUiAutomation)
Q_DECLARE_LOGGING_CATEGORY(lcQpaTrayIcon)
class QWindow;
@@ -84,13 +85,7 @@ class QTouchDevice;
struct QWindowsUser32DLL
{
inline void init();
- inline bool initTouch();
- typedef BOOL (WINAPI *IsTouchWindow)(HWND, PULONG); // Windows 7
- typedef BOOL (WINAPI *RegisterTouchWindow)(HWND, ULONG);
- typedef BOOL (WINAPI *UnregisterTouchWindow)(HWND);
- typedef BOOL (WINAPI *GetTouchInputInfo)(HANDLE, UINT, PVOID, int);
- typedef BOOL (WINAPI *CloseTouchInputHandle)(HANDLE);
typedef BOOL (WINAPI *SetProcessDPIAware)();
typedef BOOL (WINAPI *AddClipboardFormatListener)(HWND);
typedef BOOL (WINAPI *RemoveClipboardFormatListener)(HWND);
@@ -100,13 +95,6 @@ struct QWindowsUser32DLL
typedef int (WINAPI *GetWindowDpiAwarenessContext)(HWND);
typedef int (WINAPI *GetAwarenessFromDpiAwarenessContext)(int);
- // Touch functions from Windows 7 onwards (also for use with Q_CC_MSVC).
- IsTouchWindow isTouchWindow = nullptr;
- RegisterTouchWindow registerTouchWindow = nullptr;
- UnregisterTouchWindow unregisterTouchWindow = nullptr;
- GetTouchInputInfo getTouchInputInfo = nullptr;
- CloseTouchInputHandle closeTouchInputHandle = nullptr;
-
// Windows Vista onwards
SetProcessDPIAware setProcessDPIAware = nullptr;
diff --git a/src/plugins/platforms/windows/qwindowscursor.cpp b/src/plugins/platforms/windows/qwindowscursor.cpp
index e7ba08b719..a325b9d1d7 100644
--- a/src/plugins/platforms/windows/qwindowscursor.cpp
+++ b/src/plugins/platforms/windows/qwindowscursor.cpp
@@ -184,7 +184,7 @@ static HCURSOR createBitmapCursor(const QCursor &cursor, qreal scaleFactor = 1)
return createBitmapCursor(bbits, mbits, cursor.hotSpot(), invb, invm);
}
-static QSize systemCursorSize(const QPlatformScreen *screen = Q_NULLPTR)
+static QSize systemCursorSize(const QPlatformScreen *screen = nullptr)
{
const QSize primaryScreenCursorSize(GetSystemMetrics(SM_CXCURSOR), GetSystemMetrics(SM_CYCURSOR));
if (screen) {
diff --git a/src/plugins/platforms/windows/qwindowscursor.h b/src/plugins/platforms/windows/qwindowscursor.h
index 9aa9523ac8..8af56e4e0c 100644
--- a/src/plugins/platforms/windows/qwindowscursor.h
+++ b/src/plugins/platforms/windows/qwindowscursor.h
@@ -70,7 +70,7 @@ class CursorHandle
{
Q_DISABLE_COPY(CursorHandle)
public:
- explicit CursorHandle(HCURSOR hcursor = Q_NULLPTR) : m_hcursor(hcursor) {}
+ explicit CursorHandle(HCURSOR hcursor = nullptr) : m_hcursor(hcursor) {}
~CursorHandle()
{
if (m_hcursor)
@@ -113,9 +113,9 @@ public:
static HCURSOR createPixmapCursor(QPixmap pixmap, const QPoint &hotSpot, qreal scaleFactor = 1);
static HCURSOR createPixmapCursor(const PixmapCursor &pc, qreal scaleFactor = 1) { return createPixmapCursor(pc.pixmap, pc.hotSpot, scaleFactor); }
- static PixmapCursor customCursor(Qt::CursorShape cursorShape, const QPlatformScreen *screen = Q_NULLPTR);
+ static PixmapCursor customCursor(Qt::CursorShape cursorShape, const QPlatformScreen *screen = nullptr);
- static HCURSOR createCursorFromShape(Qt::CursorShape cursorShape, const QPlatformScreen *screen = Q_NULLPTR);
+ static HCURSOR createCursorFromShape(Qt::CursorShape cursorShape, const QPlatformScreen *screen = nullptr);
static QPoint mousePosition();
static CursorState cursorState();
diff --git a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp
index e713debf5b..1efb01d52e 100644
--- a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp
+++ b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp
@@ -601,8 +601,8 @@ QString QWindowsShellItem::path() const
{
if (isFileSystem())
return QDir::cleanPath(QWindowsShellItem::displayName(m_item, SIGDN_FILESYSPATH));
- // Check for a "Library" item (Windows 7)
- if (QSysInfo::windowsVersion() >= QSysInfo::WV_WINDOWS7 && isDir())
+ // Check for a "Library" item
+ if (isDir())
return QWindowsShellItem::libraryItemDefaultSaveFolder(m_item);
return QString();
}
@@ -713,7 +713,7 @@ QString QWindowsShellItem::libraryItemDefaultSaveFolder(IShellItem *item)
{
QString result;
if (IShellLibrary *library = sHLoadLibraryFromItem(item, STGM_READ | STGM_SHARE_DENY_WRITE)) {
- IShellItem *item = Q_NULLPTR;
+ IShellItem *item = nullptr;
if (SUCCEEDED(library->GetDefaultSaveFolder(DSFT_DETECT, IID_IShellItem, reinterpret_cast<void **>(&item)))) {
result = QDir::cleanPath(QWindowsShellItem::displayName(item, SIGDN_FILESYSPATH));
item->Release();
@@ -895,7 +895,7 @@ void QWindowsNativeFileDialogBase::setWindowTitle(const QString &title)
IShellItem *QWindowsNativeFileDialogBase::shellItem(const QUrl &url)
{
if (url.isLocalFile()) {
- IShellItem *result = Q_NULLPTR;
+ IShellItem *result = nullptr;
const QString native = QDir::toNativeSeparators(url.toLocalFile());
const HRESULT hr =
SHCreateItemFromParsingName(reinterpret_cast<const wchar_t *>(native.utf16()),
@@ -903,30 +903,30 @@ IShellItem *QWindowsNativeFileDialogBase::shellItem(const QUrl &url)
reinterpret_cast<void **>(&result));
if (FAILED(hr)) {
qErrnoWarning("%s: SHCreateItemFromParsingName(%s)) failed", __FUNCTION__, qPrintable(url.toString()));
- return Q_NULLPTR;
+ return nullptr;
}
return result;
} else if (url.scheme() == QLatin1String("clsid")) {
// Support for virtual folders via GUID
// (see https://msdn.microsoft.com/en-us/library/windows/desktop/dd378457(v=vs.85).aspx)
// specified as "clsid:<GUID>" (without '{', '}').
- IShellItem *result = Q_NULLPTR;
+ IShellItem *result = nullptr;
const auto uuid = QUuid::fromString(url.path());
if (uuid.isNull()) {
qWarning() << __FUNCTION__ << ": Invalid CLSID: " << url.path();
- return Q_NULLPTR;
+ return nullptr;
}
PIDLIST_ABSOLUTE idList;
HRESULT hr = SHGetKnownFolderIDList(uuid, 0, 0, &idList);
if (FAILED(hr)) {
qErrnoWarning("%s: SHGetKnownFolderIDList(%s)) failed", __FUNCTION__, qPrintable(url.toString()));
- return Q_NULLPTR;
+ return nullptr;
}
hr = SHCreateItemFromIDList(idList, IID_IShellItem, reinterpret_cast<void **>(&result));
CoTaskMemFree(idList);
if (FAILED(hr)) {
qErrnoWarning("%s: SHCreateItemFromIDList(%s)) failed", __FUNCTION__, qPrintable(url.toString()));
- return Q_NULLPTR;
+ return nullptr;
}
return result;
} else {
@@ -2047,7 +2047,7 @@ bool useHelper(QPlatformTheme::DialogType type)
return false;
switch (type) {
case QPlatformTheme::FileDialog:
- return QSysInfo::windowsVersion() >= QSysInfo::WV_XP;
+ return true;
case QPlatformTheme::ColorDialog:
#ifdef USE_NATIVE_COLOR_DIALOG
return true;
@@ -2068,13 +2068,10 @@ QPlatformDialogHelper *createHelper(QPlatformTheme::DialogType type)
if (QWindowsIntegration::instance()->options() & QWindowsIntegration::NoNativeDialogs)
return 0;
switch (type) {
- case QPlatformTheme::FileDialog: // Note: "Windows XP Professional x64 Edition has version number WV_5_2 (WV_2003).
- if (QWindowsIntegration::instance()->options() & QWindowsIntegration::XpNativeDialogs
- || QSysInfo::windowsVersion() <= QSysInfo::WV_2003) {
+ case QPlatformTheme::FileDialog:
+ if (QWindowsIntegration::instance()->options() & QWindowsIntegration::XpNativeDialogs)
return new QWindowsXpFileDialogHelper();
- }
- if (QSysInfo::windowsVersion() > QSysInfo::WV_2003)
- return new QWindowsFileDialogHelper();
+ return new QWindowsFileDialogHelper;
case QPlatformTheme::ColorDialog:
#ifdef USE_NATIVE_COLOR_DIALOG
return new QWindowsColorDialogHelper();
diff --git a/src/plugins/platforms/windows/qwindowseglcontext.h b/src/plugins/platforms/windows/qwindowseglcontext.h
index 47878a7169..3e5f2c81d5 100644
--- a/src/plugins/platforms/windows/qwindowseglcontext.h
+++ b/src/plugins/platforms/windows/qwindowseglcontext.h
@@ -95,7 +95,7 @@ struct QWindowsLibGLESv2
#if !defined(QT_STATIC) || defined(QT_OPENGL_DYNAMIC)
void *moduleHandle() const { return m_lib; }
#else
- void *moduleHandle() const { return Q_NULLPTR; }
+ void *moduleHandle() const { return nullptr; }
#endif
const GLubyte * (APIENTRY * glGetString)(GLenum name);
diff --git a/src/plugins/platforms/windows/qwindowsglcontext.cpp b/src/plugins/platforms/windows/qwindowsglcontext.cpp
index 78368d87de..4bdf3167e4 100644
--- a/src/plugins/platforms/windows/qwindowsglcontext.cpp
+++ b/src/plugins/platforms/windows/qwindowsglcontext.cpp
@@ -379,9 +379,7 @@ static PIXELFORMATDESCRIPTOR
initPixelFormatDescriptor(&pfd);
pfd.iPixelType = PFD_TYPE_RGBA;
pfd.iLayerType = PFD_MAIN_PLANE;
- pfd.dwFlags = PFD_SUPPORT_OPENGL;
- if (QSysInfo::windowsVersion() >= QSysInfo::WV_VISTA)
- pfd.dwFlags = PFD_SUPPORT_COMPOSITION;
+ pfd.dwFlags = PFD_SUPPORT_OPENGL | PFD_SUPPORT_COMPOSITION;
const bool isPixmap = (additional.formatFlags & QWindowsGLRenderToPixmap) != 0;
pfd.dwFlags |= isPixmap ? PFD_DRAW_TO_BITMAP : PFD_DRAW_TO_WINDOW;
if (!(additional.formatFlags & QWindowsGLDirectRendering))
diff --git a/src/plugins/platforms/windows/qwindowsinputcontext.cpp b/src/plugins/platforms/windows/qwindowsinputcontext.cpp
index 8c228f588e..b9dd2c557e 100644
--- a/src/plugins/platforms/windows/qwindowsinputcontext.cpp
+++ b/src/plugins/platforms/windows/qwindowsinputcontext.cpp
@@ -221,6 +221,28 @@ void QWindowsInputContext::setFocusObject(QObject *)
updateEnabled();
}
+HWND QWindowsInputContext::getVirtualKeyboardWindowHandle() const
+{
+ return ::FindWindowA("IPTip_Main_Window", nullptr);
+}
+
+QRectF QWindowsInputContext::keyboardRect() const
+{
+ if (HWND hwnd = getVirtualKeyboardWindowHandle()) {
+ RECT rect;
+ if (::GetWindowRect(hwnd, &rect)) {
+ return QRectF(rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top);
+ }
+ }
+ return QRectF();
+}
+
+bool QWindowsInputContext::isInputPanelVisible() const
+{
+ HWND hwnd = getVirtualKeyboardWindowHandle();
+ return hwnd && ::IsWindowEnabled(hwnd) && ::IsWindowVisible(hwnd);
+}
+
void QWindowsInputContext::updateEnabled()
{
if (!QGuiApplication::focusObject())
diff --git a/src/plugins/platforms/windows/qwindowsinputcontext.h b/src/plugins/platforms/windows/qwindowsinputcontext.h
index 617ef30cef..ada1fc0d29 100644
--- a/src/plugins/platforms/windows/qwindowsinputcontext.h
+++ b/src/plugins/platforms/windows/qwindowsinputcontext.h
@@ -79,6 +79,9 @@ public:
void invokeAction(QInputMethod::Action, int cursorPosition) override;
void setFocusObject(QObject *object) override;
+ QRectF keyboardRect() const override;
+ bool isInputPanelVisible() const override;
+
bool startComposition(HWND hwnd);
bool composition(HWND hwnd, LPARAM lParam);
bool endComposition(HWND hwnd);
@@ -98,6 +101,7 @@ private:
void startContextComposition();
void endContextComposition();
void updateEnabled();
+ HWND getVirtualKeyboardWindowHandle() const;
const DWORD m_WM_MSIME_MOUSE;
static HIMC m_defaultContext;
diff --git a/src/plugins/platforms/windows/qwindowsintegration.cpp b/src/plugins/platforms/windows/qwindowsintegration.cpp
index f9bac3920b..287b65cd5d 100644
--- a/src/plugins/platforms/windows/qwindowsintegration.cpp
+++ b/src/plugins/platforms/windows/qwindowsintegration.cpp
@@ -60,7 +60,7 @@
#include "qwindowsinputcontext.h"
#include "qwindowskeymapper.h"
#ifndef QT_NO_ACCESSIBILITY
-# include "accessible/qwindowsaccessibility.h"
+# include "uiautomation/qwindowsuiaaccessibility.h"
#endif
#include <qpa/qplatformnativeinterface.h>
@@ -151,7 +151,7 @@ struct QWindowsIntegrationPrivate
#endif // QT_NO_OPENGL
QScopedPointer<QPlatformInputContext> m_inputContext;
#ifndef QT_NO_ACCESSIBILITY
- QWindowsAccessibility m_accessibility;
+ QWindowsUiaAccessibility m_accessibility;
#endif
QWindowsServices m_services;
};
@@ -252,7 +252,7 @@ QWindowsIntegrationPrivate::~QWindowsIntegrationPrivate()
delete m_fontDatabase;
}
-QWindowsIntegration *QWindowsIntegration::m_instance = Q_NULLPTR;
+QWindowsIntegration *QWindowsIntegration::m_instance = nullptr;
QWindowsIntegration::QWindowsIntegration(const QStringList &paramList) :
d(new QWindowsIntegrationPrivate(paramList))
@@ -266,7 +266,7 @@ QWindowsIntegration::QWindowsIntegration(const QStringList &paramList) :
QWindowsIntegration::~QWindowsIntegration()
{
- m_instance = Q_NULLPTR;
+ m_instance = nullptr;
}
void QWindowsIntegration::initialize()
@@ -336,7 +336,7 @@ QPlatformWindow *QWindowsIntegration::createPlatformWindow(QWindow *window) cons
<< " handle=" << obtained.hwnd << ' ' << obtained.flags << '\n';
if (Q_UNLIKELY(!obtained.hwnd))
- return Q_NULLPTR;
+ return nullptr;
QWindowsWindow *result = createPlatformWindowHelper(window, obtained);
Q_ASSERT(result);
@@ -356,7 +356,7 @@ QPlatformWindow *QWindowsIntegration::createForeignWindow(QWindow *window, WId n
}
QWindowsForeignWindow *result = new QWindowsForeignWindow(window, hwnd);
const QRect obtainedGeometry = result->geometry();
- QScreen *screen = Q_NULLPTR;
+ QScreen *screen = nullptr;
if (const QPlatformScreen *pScreen = result->screenForGeometry(obtainedGeometry))
screen = pScreen->screen();
if (screen && screen != window->screen())
@@ -402,7 +402,7 @@ QWindowsStaticOpenGLContext *QWindowsStaticOpenGLContext::doCreate()
qCWarning(lcQpaGl, "Software OpenGL failed. Falling back to system OpenGL.");
if (QWindowsOpenGLTester::supportedRenderers() & QWindowsOpenGLTester::DesktopGl)
return QOpenGLStaticContext::create();
- return Q_NULLPTR;
+ return nullptr;
default:
break;
}
diff --git a/src/plugins/platforms/windows/qwindowsmousehandler.cpp b/src/plugins/platforms/windows/qwindowsmousehandler.cpp
index 9544fb81f7..814291c54a 100644
--- a/src/plugins/platforms/windows/qwindowsmousehandler.cpp
+++ b/src/plugins/platforms/windows/qwindowsmousehandler.cpp
@@ -56,37 +56,6 @@
#include <windowsx.h>
-/* Touch is supported from Windows 7 onwards and data structures
- * are present in the Windows SDK's, but not in older MSVC Express
- * versions. */
-
-#if !defined(TOUCHEVENTF_MOVE)
-
-typedef struct tagTOUCHINPUT {
- LONG x;
- LONG y;
- HANDLE hSource;
- DWORD dwID;
- DWORD dwFlags;
- DWORD dwMask;
- DWORD dwTime;
- ULONG_PTR dwExtraInfo;
- DWORD cxContact;
- DWORD cyContact;
-} TOUCHINPUT, *PTOUCHINPUT;
-typedef TOUCHINPUT const * PCTOUCHINPUT;
-
-# define TOUCHEVENTF_MOVE 0x0001
-# define TOUCHEVENTF_DOWN 0x0002
-# define TOUCHEVENTF_UP 0x0004
-# define TOUCHEVENTF_INRANGE 0x0008
-# define TOUCHEVENTF_PRIMARY 0x0010
-# define TOUCHEVENTF_NOCOALESCE 0x0020
-# define TOUCHEVENTF_PALM 0x0080
-# define TOUCHINPUTMASKF_CONTACTAREA 0x0004
-# define TOUCHINPUTMASKF_EXTRAINFO 0x0002
-#endif // if !defined(TOUCHEVENTF_MOVE)
-
QT_BEGIN_NAMESPACE
static inline void compressMouseMove(MSG *msg)
@@ -154,8 +123,6 @@ static inline QTouchDevice *createTouchDevice()
QT_NID_INTEGRATED_TOUCH = 0x1, QT_NID_EXTERNAL_TOUCH = 0x02,
QT_NID_MULTI_INPUT = 0x40, QT_NID_READY = 0x80 };
- if (QSysInfo::windowsVersion() < QSysInfo::WV_WINDOWS7)
- return 0;
const int digitizers = GetSystemMetrics(QT_SM_DIGITIZER);
if (!(digitizers & (QT_NID_INTEGRATED_TOUCH | QT_NID_EXTERNAL_TOUCH)))
return 0;
@@ -523,9 +490,8 @@ bool QWindowsMouseHandler::translateTouchEvent(QWindow *window, HWND,
touchPoints.reserve(winTouchPointCount);
Qt::TouchPointStates allStates = 0;
- QWindowsContext::user32dll.getTouchInputInfo(reinterpret_cast<HANDLE>(msg.lParam),
- UINT(msg.wParam),
- winTouchInputs.data(), sizeof(TOUCHINPUT));
+ GetTouchInputInfo(reinterpret_cast<HTOUCHINPUT>(msg.lParam),
+ UINT(msg.wParam), winTouchInputs.data(), sizeof(TOUCHINPUT));
for (int i = 0; i < winTouchPointCount; ++i) {
const TOUCHINPUT &winTouchInput = winTouchInputs[i];
int id = m_touchInputIDToTouchPointID.value(winTouchInput.dwID, -1);
@@ -566,7 +532,7 @@ bool QWindowsMouseHandler::translateTouchEvent(QWindow *window, HWND,
touchPoints.append(touchPoint);
}
- QWindowsContext::user32dll.closeTouchInputHandle(reinterpret_cast<HANDLE>(msg.lParam));
+ CloseTouchInputHandle(reinterpret_cast<HTOUCHINPUT>(msg.lParam));
// all touch points released, forget the ids we've seen, they may not be reused
if (allStates == Qt::TouchPointReleased)
diff --git a/src/plugins/platforms/windows/qwindowsnativeinterface.cpp b/src/plugins/platforms/windows/qwindowsnativeinterface.cpp
index dc8e97c886..324b00144e 100644
--- a/src/plugins/platforms/windows/qwindowsnativeinterface.cpp
+++ b/src/plugins/platforms/windows/qwindowsnativeinterface.cpp
@@ -134,7 +134,7 @@ void *QWindowsNativeInterface::nativeResourceForCursor(const QByteArray &resourc
return static_cast<const QWindowsCursor *>(pCursor)->hCursor(cursor);
}
}
- return Q_NULLPTR;
+ return nullptr;
}
#endif // !QT_NO_CURSOR
@@ -280,7 +280,7 @@ QFunctionPointer QWindowsNativeInterface::platformFunction(const QByteArray &fun
return QFunctionPointer(QWindowsWindow::setHasBorderInFullScreenStatic);
else if (function == QWindowsWindowFunctions::isTabletModeIdentifier())
return QFunctionPointer(QWindowsNativeInterface::isTabletMode);
- return Q_NULLPTR;
+ return nullptr;
}
QVariant QWindowsNativeInterface::gpu() const
diff --git a/src/plugins/platforms/windows/qwindowsscreen.cpp b/src/plugins/platforms/windows/qwindowsscreen.cpp
index cfddb3cc71..c0781df973 100644
--- a/src/plugins/platforms/windows/qwindowsscreen.cpp
+++ b/src/plugins/platforms/windows/qwindowsscreen.cpp
@@ -563,7 +563,7 @@ const QWindowsScreen *QWindowsScreenManager::screenAtDp(const QPoint &p) const
if (scr->geometry().contains(p))
return scr;
}
- return Q_NULLPTR;
+ return nullptr;
}
const QWindowsScreen *QWindowsScreenManager::screenForHwnd(HWND hwnd) const
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp
index 1d81fa9cd5..854c19ccf8 100644
--- a/src/plugins/platforms/windows/qwindowswindow.cpp
+++ b/src/plugins/platforms/windows/qwindowswindow.cpp
@@ -37,6 +37,13 @@
**
****************************************************************************/
+#if defined(WINVER) && WINVER < 0x0601
+# undef WINVER
+#endif
+#if !defined(WINVER)
+# define WINVER 0x0601 // Enable touch functions for MinGW
+#endif
+
#include "qwindowswindow.h"
#include "qwindowscontext.h"
#if QT_CONFIG(draganddrop)
@@ -858,7 +865,7 @@ QWindowsBaseWindow *QWindowsBaseWindow::baseWindowOf(const QWindow *w)
if (QPlatformWindow *pw = w->handle())
return static_cast<QWindowsBaseWindow *>(pw);
}
- return Q_NULLPTR;
+ return nullptr;
}
HWND QWindowsBaseWindow::handleOf(const QWindow *w)
@@ -1113,7 +1120,7 @@ QWindowsWindow::~QWindowsWindow()
{
setFlag(WithinDestroy);
if (testFlag(TouchRegistered))
- QWindowsContext::user32dll.unregisterTouchWindow(m_data.hwnd);
+ UnregisterTouchWindow(m_data.hwnd);
destroyWindow();
destroyIcon();
}
@@ -2064,9 +2071,17 @@ void QWindowsWindow::propagateSizeHints()
bool QWindowsWindow::handleGeometryChangingMessage(MSG *message, const QWindow *qWindow, const QMargins &margins)
{
+ WINDOWPOS *windowPos = reinterpret_cast<WINDOWPOS *>(message->lParam);
+ if ((windowPos->flags & SWP_NOZORDER) == 0) {
+ if (QWindowsWindow *platformWindow = QWindowsWindow::windowsWindowOf(qWindow)) {
+ QWindow *parentWindow = qWindow->parent();
+ HWND parentHWND = GetAncestor(windowPos->hwnd, GA_PARENT);
+ HWND desktopHWND = GetDesktopWindow();
+ platformWindow->m_data.embedded = !parentWindow && parentHWND && (parentHWND != desktopHWND);
+ }
+ }
if (!qWindow->isTopLevel()) // Implement hasHeightForWidth().
return false;
- WINDOWPOS *windowPos = reinterpret_cast<WINDOWPOS *>(message->lParam);
if ((windowPos->flags & (SWP_NOCOPYBITS | SWP_NOSIZE)))
return false;
const QRect suggestedFrameGeometry(windowPos->x, windowPos->y,
@@ -2600,12 +2615,12 @@ void QWindowsWindow::registerTouchWindow(QWindowsWindowFunctions::TouchWindowTou
if ((QWindowsContext::instance()->systemInfo() & QWindowsContext::SI_SupportsTouch)
&& !testFlag(TouchRegistered)) {
ULONG touchFlags = 0;
- const bool ret = QWindowsContext::user32dll.isTouchWindow(m_data.hwnd, &touchFlags);
+ const bool ret = IsTouchWindow(m_data.hwnd, &touchFlags);
// Return if it is not a touch window or the flags are already set by a hook
// such as HCBT_CREATEWND
if (ret || touchFlags != 0)
return;
- if (QWindowsContext::user32dll.registerTouchWindow(m_data.hwnd, ULONG(touchTypes)))
+ if (RegisterTouchWindow(m_data.hwnd, ULONG(touchTypes)))
setFlag(TouchRegistered);
else
qErrnoWarning("RegisterTouchWindow() failed for window '%s'.", qPrintable(window()->objectName()));
diff --git a/src/plugins/platforms/windows/uiautomation/qwindowsuiaaccessibility.cpp b/src/plugins/platforms/windows/uiautomation/qwindowsuiaaccessibility.cpp
new file mode 100644
index 0000000000..907883bf5b
--- /dev/null
+++ b/src/plugins/platforms/windows/uiautomation/qwindowsuiaaccessibility.cpp
@@ -0,0 +1,140 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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 <QtCore/QtConfig>
+#ifndef QT_NO_ACCESSIBILITY
+
+#include "qwindowsuiaaccessibility.h"
+#include "qwindowsuiamainprovider.h"
+#include "qwindowsuiautils.h"
+
+#include <QtGui/QAccessible>
+#include <QtGui/QWindow>
+#include <QtGui/QGuiApplication>
+#include <QtGui/private/qguiapplication_p.h>
+#include <QtCore/qt_windows.h>
+#include <qpa/qplatformintegration.h>
+#include <QtWindowsUIAutomationSupport/private/qwindowsuiawrapper_p.h>
+
+QT_BEGIN_NAMESPACE
+
+using namespace QWindowsUiAutomation;
+
+
+QWindowsUiaAccessibility::QWindowsUiaAccessibility()
+{
+}
+
+QWindowsUiaAccessibility::~QWindowsUiaAccessibility()
+{
+}
+
+// Handles UI Automation window messages.
+bool QWindowsUiaAccessibility::handleWmGetObject(HWND hwnd, WPARAM wParam, LPARAM lParam, LRESULT *lResult)
+{
+ if (lParam == LPARAM(UiaRootObjectId)) {
+
+ // Start handling accessibility internally
+ QGuiApplicationPrivate::platformIntegration()->accessibility()->setActive(true);
+
+ // Ignoring all requests while starting up / shutting down
+ if (QCoreApplication::startingUp() || QCoreApplication::closingDown())
+ return false;
+
+ if (QWindow *window = QWindowsContext::instance()->findWindow(hwnd)) {
+ if (QAccessibleInterface *accessible = window->accessibleRoot()) {
+ QWindowsUiaMainProvider *provider = QWindowsUiaMainProvider::providerForAccessible(accessible);
+ *lResult = QWindowsUiaWrapper::instance()->returnRawElementProvider(hwnd, wParam, lParam, provider);
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
+// Handles accessibility update notifications.
+void QWindowsUiaAccessibility::notifyAccessibilityUpdate(QAccessibleEvent *event)
+{
+ if (!event)
+ return;
+
+ QAccessibleInterface *accessible = event->accessibleInterface();
+ if (!isActive() || !accessible || !accessible->isValid())
+ return;
+
+ // Ensures QWindowsUiaWrapper is properly initialized.
+ if (!QWindowsUiaWrapper::instance()->ready())
+ return;
+
+ // No need to do anything when nobody is listening.
+ if (!QWindowsUiaWrapper::instance()->clientsAreListening())
+ return;
+
+ switch (event->type()) {
+
+ case QAccessible::Focus:
+ QWindowsUiaMainProvider::notifyFocusChange(event);
+ break;
+
+ case QAccessible::StateChanged:
+ QWindowsUiaMainProvider::notifyStateChange(static_cast<QAccessibleStateChangeEvent *>(event));
+ break;
+
+ case QAccessible::ValueChanged:
+ QWindowsUiaMainProvider::notifyValueChange(static_cast<QAccessibleValueChangeEvent *>(event));
+ break;
+
+ case QAccessible::TextAttributeChanged:
+ case QAccessible::TextColumnChanged:
+ case QAccessible::TextInserted:
+ case QAccessible::TextRemoved:
+ case QAccessible::TextUpdated:
+ case QAccessible::TextSelectionChanged:
+ case QAccessible::TextCaretMoved:
+ QWindowsUiaMainProvider::notifyTextChange(event);
+ break;
+
+ default:
+ break;
+ }
+}
+
+QT_END_NAMESPACE
+
+#endif // QT_NO_ACCESSIBILITY
diff --git a/src/plugins/platforms/windows/accessible/qwindowsaccessibility.h b/src/plugins/platforms/windows/uiautomation/qwindowsuiaaccessibility.h
index 8621e93120..bbb81d596b 100644
--- a/src/plugins/platforms/windows/accessible/qwindowsaccessibility.h
+++ b/src/plugins/platforms/windows/uiautomation/qwindowsuiaaccessibility.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2017 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the plugins of the Qt Toolkit.
@@ -37,27 +37,29 @@
**
****************************************************************************/
-#ifndef QWINDOWSACCESSIBILITY_H
-#define QWINDOWSACCESSIBILITY_H
+#ifndef QWINDOWSUIAACCESSIBILITY_H
+#define QWINDOWSUIAACCESSIBILITY_H
-#include "../qtwindowsglobal.h"
-#include "../qwindowscontext.h"
-#include <qpa/qplatformaccessibility.h>
+#include <QtCore/QtConfig>
+#ifndef QT_NO_ACCESSIBILITY
-#include <oleacc.h>
+#include "qwindowscontext.h"
+#include <qpa/qplatformaccessibility.h>
QT_BEGIN_NAMESPACE
-class QWindowsAccessibility : public QPlatformAccessibility
+// Windows plataform accessibility implemented over UI Automation.
+class QWindowsUiaAccessibility : public QPlatformAccessibility
{
public:
- QWindowsAccessibility();
- static bool handleAccessibleObjectFromWindowRequest(HWND hwnd, WPARAM wParam, LPARAM lParam, LRESULT *lResult);
+ explicit QWindowsUiaAccessibility();
+ virtual ~QWindowsUiaAccessibility();
+ static bool handleWmGetObject(HWND hwnd, WPARAM wParam, LPARAM lParam, LRESULT *lResult);
void notifyAccessibilityUpdate(QAccessibleEvent *event) override;
- static IAccessible *wrap(QAccessibleInterface *acc);
- static QWindow *windowHelper(const QAccessibleInterface *iface);
};
QT_END_NAMESPACE
-#endif // QWINDOWSACCESSIBILITY_H
+#endif // QT_NO_ACCESSIBILITY
+
+#endif // QWINDOWSUIAACCESSIBILITY_H
diff --git a/src/plugins/platforms/windows/uiautomation/qwindowsuiabaseprovider.cpp b/src/plugins/platforms/windows/uiautomation/qwindowsuiabaseprovider.cpp
new file mode 100644
index 0000000000..1e1fc49c0f
--- /dev/null
+++ b/src/plugins/platforms/windows/uiautomation/qwindowsuiabaseprovider.cpp
@@ -0,0 +1,81 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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 <QtCore/QtConfig>
+#ifndef QT_NO_ACCESSIBILITY
+
+#include "qwindowsuiabaseprovider.h"
+#include "qwindowsuiautils.h"
+#include "qwindowscontext.h"
+
+#include <QtGui/QAccessible>
+#include <QtGui/QAccessibleInterface>
+#include <QtCore/QDebug>
+#include <QtCore/QString>
+
+QT_BEGIN_NAMESPACE
+
+using namespace QWindowsUiAutomation;
+
+
+QWindowsUiaBaseProvider::QWindowsUiaBaseProvider(QAccessible::Id id) :
+ m_id(id)
+{
+}
+
+QWindowsUiaBaseProvider::~QWindowsUiaBaseProvider()
+{
+}
+
+QAccessibleInterface *QWindowsUiaBaseProvider::accessibleInterface() const
+{
+ QAccessibleInterface *accessible = QAccessible::accessibleInterface(m_id);
+ if (accessible && accessible->isValid())
+ return accessible;
+ return nullptr;
+}
+
+QAccessible::Id QWindowsUiaBaseProvider::id() const
+{
+ return m_id;
+}
+
+QT_END_NAMESPACE
+
+#endif // QT_NO_ACCESSIBILITY
diff --git a/src/plugins/platforms/windows/uiautomation/qwindowsuiabaseprovider.h b/src/plugins/platforms/windows/uiautomation/qwindowsuiabaseprovider.h
new file mode 100644
index 0000000000..3ae403e8c5
--- /dev/null
+++ b/src/plugins/platforms/windows/uiautomation/qwindowsuiabaseprovider.h
@@ -0,0 +1,78 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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$
+**
+****************************************************************************/
+
+#ifndef QWINDOWSUIABASEPROVIDER_H
+#define QWINDOWSUIABASEPROVIDER_H
+
+#include <QtCore/QtConfig>
+#ifndef QT_NO_ACCESSIBILITY
+
+#include <QtGui/QAccessible>
+#include <QtGui/QAccessibleInterface>
+#include <QtCore/QPointer>
+
+#include <qwindowscombase.h>
+#include <QtWindowsUIAutomationSupport/private/qwindowsuiawrapper_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QAccessibleInterface;
+class QDebug;
+
+// Base class for UI Automation providers.
+class QWindowsUiaBaseProvider : public QObject
+{
+ Q_OBJECT
+ Q_DISABLE_COPY(QWindowsUiaBaseProvider)
+public:
+ explicit QWindowsUiaBaseProvider(QAccessible::Id id);
+ virtual ~QWindowsUiaBaseProvider();
+
+ QAccessibleInterface *accessibleInterface() const;
+ QAccessible::Id id() const;
+
+private:
+ QAccessible::Id m_id;
+};
+
+QT_END_NAMESPACE
+
+#endif // QT_NO_ACCESSIBILITY
+
+#endif // QWINDOWSUIABASEPROVIDER_H
diff --git a/src/plugins/platforms/windows/uiautomation/qwindowsuiagriditemprovider.cpp b/src/plugins/platforms/windows/uiautomation/qwindowsuiagriditemprovider.cpp
new file mode 100644
index 0000000000..e0502c00f3
--- /dev/null
+++ b/src/plugins/platforms/windows/uiautomation/qwindowsuiagriditemprovider.cpp
@@ -0,0 +1,176 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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 <QtCore/QtConfig>
+#ifndef QT_NO_ACCESSIBILITY
+
+#include "qwindowsuiagriditemprovider.h"
+#include "qwindowsuiamainprovider.h"
+#include "qwindowsuiautils.h"
+#include "qwindowscontext.h"
+
+#include <QtGui/QAccessible>
+#include <QtGui/QAccessibleInterface>
+#include <QtCore/QDebug>
+#include <QtCore/QString>
+
+QT_BEGIN_NAMESPACE
+
+using namespace QWindowsUiAutomation;
+
+
+QWindowsUiaGridItemProvider::QWindowsUiaGridItemProvider(QAccessible::Id id) :
+ QWindowsUiaBaseProvider(id)
+{
+}
+
+QWindowsUiaGridItemProvider::~QWindowsUiaGridItemProvider()
+{
+}
+
+// Returns the row index of the item.
+HRESULT STDMETHODCALLTYPE QWindowsUiaGridItemProvider::get_Row(int *pRetVal)
+{
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__;
+
+ if (!pRetVal)
+ return E_INVALIDARG;
+ *pRetVal = 0;
+
+ QAccessibleInterface *accessible = accessibleInterface();
+ if (!accessible)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ QAccessibleTableCellInterface *tableCellInterface = accessible->tableCellInterface();
+ if (!tableCellInterface)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ *pRetVal = tableCellInterface->rowIndex();
+ return S_OK;
+}
+
+// Returns the column index of the item.
+HRESULT STDMETHODCALLTYPE QWindowsUiaGridItemProvider::get_Column(int *pRetVal)
+{
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__;
+
+ if (!pRetVal)
+ return E_INVALIDARG;
+ *pRetVal = 0;
+
+ QAccessibleInterface *accessible = accessibleInterface();
+ if (!accessible)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ QAccessibleTableCellInterface *tableCellInterface = accessible->tableCellInterface();
+ if (!tableCellInterface)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ *pRetVal = tableCellInterface->columnIndex();
+ return S_OK;
+}
+
+// Returns the number of rows occupied by the item.
+HRESULT STDMETHODCALLTYPE QWindowsUiaGridItemProvider::get_RowSpan(int *pRetVal)
+{
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__;
+
+ if (!pRetVal)
+ return E_INVALIDARG;
+ *pRetVal = 0;
+
+ QAccessibleInterface *accessible = accessibleInterface();
+ if (!accessible)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ QAccessibleTableCellInterface *tableCellInterface = accessible->tableCellInterface();
+ if (!tableCellInterface)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ *pRetVal = tableCellInterface->rowExtent();
+ return S_OK;
+}
+
+// Returns the number of columns occupied by the item.
+HRESULT STDMETHODCALLTYPE QWindowsUiaGridItemProvider::get_ColumnSpan(int *pRetVal)
+{
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__;
+
+ if (!pRetVal)
+ return E_INVALIDARG;
+ *pRetVal = 0;
+
+ QAccessibleInterface *accessible = accessibleInterface();
+ if (!accessible)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ QAccessibleTableCellInterface *tableCellInterface = accessible->tableCellInterface();
+ if (!tableCellInterface)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ *pRetVal = tableCellInterface->columnExtent();
+ return S_OK;
+}
+
+// Returns the provider for the cointaining table/tree.
+HRESULT STDMETHODCALLTYPE QWindowsUiaGridItemProvider::get_ContainingGrid(IRawElementProviderSimple **pRetVal)
+{
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__;
+
+ if (!pRetVal)
+ return E_INVALIDARG;
+ *pRetVal = nullptr;
+
+ QAccessibleInterface *accessible = accessibleInterface();
+ if (!accessible)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ QAccessibleTableCellInterface *tableCellInterface = accessible->tableCellInterface();
+ if (!tableCellInterface)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ if (QAccessibleInterface *table = tableCellInterface->table()) {
+ *pRetVal = QWindowsUiaMainProvider::providerForAccessible(table);
+ }
+ return S_OK;
+}
+
+QT_END_NAMESPACE
+
+#endif // QT_NO_ACCESSIBILITY
diff --git a/src/plugins/platforms/windows/uiautomation/qwindowsuiagriditemprovider.h b/src/plugins/platforms/windows/uiautomation/qwindowsuiagriditemprovider.h
new file mode 100644
index 0000000000..a93b50ef97
--- /dev/null
+++ b/src/plugins/platforms/windows/uiautomation/qwindowsuiagriditemprovider.h
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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$
+**
+****************************************************************************/
+
+#ifndef QWINDOWSUIAGRIDITEMPROVIDER_H
+#define QWINDOWSUIAGRIDITEMPROVIDER_H
+
+#include <QtCore/QtConfig>
+#ifndef QT_NO_ACCESSIBILITY
+
+#include "qwindowsuiabaseprovider.h"
+
+QT_BEGIN_NAMESPACE
+
+// Implements the Grid Item control pattern provider. Used by items within a table/tree.
+class QWindowsUiaGridItemProvider : public QWindowsUiaBaseProvider,
+ public QWindowsComBase<IGridItemProvider>
+{
+ Q_DISABLE_COPY(QWindowsUiaGridItemProvider)
+public:
+ explicit QWindowsUiaGridItemProvider(QAccessible::Id id);
+ virtual ~QWindowsUiaGridItemProvider();
+
+ // IGridItemProvider
+ HRESULT STDMETHODCALLTYPE get_Row(int *pRetVal);
+ HRESULT STDMETHODCALLTYPE get_Column(int *pRetVal);
+ HRESULT STDMETHODCALLTYPE get_RowSpan(int *pRetVal);
+ HRESULT STDMETHODCALLTYPE get_ColumnSpan(int *pRetVal);
+ HRESULT STDMETHODCALLTYPE get_ContainingGrid(IRawElementProviderSimple **pRetVal);
+};
+
+QT_END_NAMESPACE
+
+#endif // QT_NO_ACCESSIBILITY
+
+#endif // QWINDOWSUIAGRIDITEMPROVIDER_H
diff --git a/src/plugins/platforms/windows/uiautomation/qwindowsuiagridprovider.cpp b/src/plugins/platforms/windows/uiautomation/qwindowsuiagridprovider.cpp
new file mode 100644
index 0000000000..65c2df703b
--- /dev/null
+++ b/src/plugins/platforms/windows/uiautomation/qwindowsuiagridprovider.cpp
@@ -0,0 +1,136 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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 <QtCore/QtConfig>
+#ifndef QT_NO_ACCESSIBILITY
+
+#include "qwindowsuiagridprovider.h"
+#include "qwindowsuiamainprovider.h"
+#include "qwindowsuiautils.h"
+#include "qwindowscontext.h"
+
+#include <QtGui/QAccessible>
+#include <QtGui/QAccessibleInterface>
+#include <QtCore/QDebug>
+#include <QtCore/QString>
+
+QT_BEGIN_NAMESPACE
+
+using namespace QWindowsUiAutomation;
+
+
+QWindowsUiaGridProvider::QWindowsUiaGridProvider(QAccessible::Id id) :
+ QWindowsUiaBaseProvider(id)
+{
+}
+
+QWindowsUiaGridProvider::~QWindowsUiaGridProvider()
+{
+}
+
+// Returns the provider for an item within a table/tree.
+HRESULT STDMETHODCALLTYPE QWindowsUiaGridProvider::GetItem(int row, int column, IRawElementProviderSimple **pRetVal)
+{
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__;
+
+ if (!pRetVal)
+ return E_INVALIDARG;
+ *pRetVal = nullptr;
+
+ QAccessibleInterface *accessible = accessibleInterface();
+ if (!accessible)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ QAccessibleTableInterface *tableInterface = accessible->tableInterface();
+ if (!tableInterface)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ if ((row >= 0) && (row < tableInterface->rowCount()) && (column >= 0) && (column < tableInterface->columnCount())) {
+ if (QAccessibleInterface *cell = tableInterface->cellAt(row, column)) {
+ *pRetVal = QWindowsUiaMainProvider::providerForAccessible(cell);
+ }
+ }
+ return S_OK;
+}
+
+// Returns the number of rows.
+HRESULT STDMETHODCALLTYPE QWindowsUiaGridProvider::get_RowCount(int *pRetVal)
+{
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__;
+
+ if (!pRetVal)
+ return E_INVALIDARG;
+ *pRetVal = 0;
+
+ QAccessibleInterface *accessible = accessibleInterface();
+ if (!accessible)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ QAccessibleTableInterface *tableInterface = accessible->tableInterface();
+ if (!tableInterface)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ *pRetVal = tableInterface->rowCount();
+ return S_OK;
+}
+
+// Returns the number of columns.
+HRESULT STDMETHODCALLTYPE QWindowsUiaGridProvider::get_ColumnCount(int *pRetVal)
+{
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__;
+
+ if (!pRetVal)
+ return E_INVALIDARG;
+ *pRetVal = 0;
+
+ QAccessibleInterface *accessible = accessibleInterface();
+ if (!accessible)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ QAccessibleTableInterface *tableInterface = accessible->tableInterface();
+ if (!tableInterface)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ *pRetVal = tableInterface->columnCount();
+ return S_OK;
+}
+
+QT_END_NAMESPACE
+
+#endif // QT_NO_ACCESSIBILITY
diff --git a/src/plugins/platforms/windows/uiautomation/qwindowsuiagridprovider.h b/src/plugins/platforms/windows/uiautomation/qwindowsuiagridprovider.h
new file mode 100644
index 0000000000..15521f98b3
--- /dev/null
+++ b/src/plugins/platforms/windows/uiautomation/qwindowsuiagridprovider.h
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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$
+**
+****************************************************************************/
+
+#ifndef QWINDOWSUIAGRIDPROVIDER_H
+#define QWINDOWSUIAGRIDPROVIDER_H
+
+#include <QtCore/QtConfig>
+#ifndef QT_NO_ACCESSIBILITY
+
+#include "qwindowsuiabaseprovider.h"
+
+QT_BEGIN_NAMESPACE
+
+// Implements the Grid control pattern provider. Used by tables/trees.
+class QWindowsUiaGridProvider : public QWindowsUiaBaseProvider,
+ public QWindowsComBase<IGridProvider>
+{
+ Q_DISABLE_COPY(QWindowsUiaGridProvider)
+public:
+ explicit QWindowsUiaGridProvider(QAccessible::Id id);
+ virtual ~QWindowsUiaGridProvider();
+
+ // IGridProvider
+ HRESULT STDMETHODCALLTYPE GetItem(int row, int column, IRawElementProviderSimple **pRetVal);
+ HRESULT STDMETHODCALLTYPE get_RowCount(int *pRetVal);
+ HRESULT STDMETHODCALLTYPE get_ColumnCount(int *pRetVal);
+};
+
+QT_END_NAMESPACE
+
+#endif // QT_NO_ACCESSIBILITY
+
+#endif // QWINDOWSUIAGRIDPROVIDER_H
diff --git a/src/plugins/platforms/windows/uiautomation/qwindowsuiainvokeprovider.cpp b/src/plugins/platforms/windows/uiautomation/qwindowsuiainvokeprovider.cpp
new file mode 100644
index 0000000000..2af883c4f6
--- /dev/null
+++ b/src/plugins/platforms/windows/uiautomation/qwindowsuiainvokeprovider.cpp
@@ -0,0 +1,84 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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 <QtCore/QtConfig>
+#ifndef QT_NO_ACCESSIBILITY
+
+#include "qwindowsuiainvokeprovider.h"
+#include "qwindowsuiautils.h"
+#include "qwindowscontext.h"
+
+#include <QtGui/QAccessible>
+#include <QtGui/QAccessibleInterface>
+#include <QtCore/QDebug>
+#include <QtCore/QString>
+
+QT_BEGIN_NAMESPACE
+
+using namespace QWindowsUiAutomation;
+
+
+QWindowsUiaInvokeProvider::QWindowsUiaInvokeProvider(QAccessible::Id id) :
+ QWindowsUiaBaseProvider(id)
+{
+}
+
+QWindowsUiaInvokeProvider::~QWindowsUiaInvokeProvider()
+{
+}
+
+HRESULT STDMETHODCALLTYPE QWindowsUiaInvokeProvider::Invoke()
+{
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__;
+
+ QAccessibleInterface *accessible = accessibleInterface();
+ if (!accessible)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ QAccessibleActionInterface *actionInterface = accessible->actionInterface();
+ if (!actionInterface)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ actionInterface->doAction(QAccessibleActionInterface::pressAction());
+ return S_OK;
+}
+
+QT_END_NAMESPACE
+
+#endif // QT_NO_ACCESSIBILITY
diff --git a/src/plugins/platforms/windows/uiautomation/qwindowsuiainvokeprovider.h b/src/plugins/platforms/windows/uiautomation/qwindowsuiainvokeprovider.h
new file mode 100644
index 0000000000..2b8a646983
--- /dev/null
+++ b/src/plugins/platforms/windows/uiautomation/qwindowsuiainvokeprovider.h
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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$
+**
+****************************************************************************/
+
+#ifndef QWINDOWSUIAINVOKEPROVIDER_H
+#define QWINDOWSUIAINVOKEPROVIDER_H
+
+#include <QtCore/QtConfig>
+#ifndef QT_NO_ACCESSIBILITY
+
+#include "qwindowsuiabaseprovider.h"
+
+QT_BEGIN_NAMESPACE
+
+// Implements the Invoke control pattern provider.
+class QWindowsUiaInvokeProvider : public QWindowsUiaBaseProvider,
+ public QWindowsComBase<IInvokeProvider>
+{
+ Q_DISABLE_COPY(QWindowsUiaInvokeProvider)
+public:
+ explicit QWindowsUiaInvokeProvider(QAccessible::Id id);
+ virtual ~QWindowsUiaInvokeProvider();
+
+ // IInvokeProvider
+ HRESULT STDMETHODCALLTYPE Invoke();
+};
+
+QT_END_NAMESPACE
+
+#endif // QT_NO_ACCESSIBILITY
+
+#endif // QWINDOWSUIAINVOKEPROVIDER_H
diff --git a/src/plugins/platforms/windows/uiautomation/qwindowsuiamainprovider.cpp b/src/plugins/platforms/windows/uiautomation/qwindowsuiamainprovider.cpp
new file mode 100644
index 0000000000..46f73f81a0
--- /dev/null
+++ b/src/plugins/platforms/windows/uiautomation/qwindowsuiamainprovider.cpp
@@ -0,0 +1,638 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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 <QtCore/QtConfig>
+#ifndef QT_NO_ACCESSIBILITY
+
+#include "qwindowsuiamainprovider.h"
+#include "qwindowsuiavalueprovider.h"
+#include "qwindowsuiarangevalueprovider.h"
+#include "qwindowsuiatextprovider.h"
+#include "qwindowsuiatoggleprovider.h"
+#include "qwindowsuiainvokeprovider.h"
+#include "qwindowsuiaselectionprovider.h"
+#include "qwindowsuiaselectionitemprovider.h"
+#include "qwindowsuiatableprovider.h"
+#include "qwindowsuiatableitemprovider.h"
+#include "qwindowsuiagridprovider.h"
+#include "qwindowsuiagriditemprovider.h"
+#include "qwindowscombase.h"
+#include "qwindowscontext.h"
+#include "qwindowsuiautils.h"
+#include "qwindowsuiaprovidercache.h"
+
+#include <QtCore/QDebug>
+#include <QtGui/QAccessible>
+#include <QtGui/QGuiApplication>
+#include <QtGui/QWindow>
+
+#if !defined(Q_CC_BOR) && !defined (Q_CC_GNU)
+#include <comdef.h>
+#endif
+
+#include <QtCore/qt_windows.h>
+
+QT_BEGIN_NAMESPACE
+
+using namespace QWindowsUiAutomation;
+
+
+// Returns a cached instance of the provider for a specific acessible interface.
+QWindowsUiaMainProvider *QWindowsUiaMainProvider::providerForAccessible(QAccessibleInterface *accessible)
+{
+ if (!accessible)
+ return nullptr;
+
+ QAccessible::Id id = QAccessible::uniqueId(accessible);
+ QWindowsUiaProviderCache *providerCache = QWindowsUiaProviderCache::instance();
+ QWindowsUiaMainProvider *provider = qobject_cast<QWindowsUiaMainProvider *>(providerCache->providerForId(id));
+
+ if (provider) {
+ provider->AddRef();
+ } else {
+ provider = new QWindowsUiaMainProvider(accessible);
+ providerCache->insert(id, provider);
+ }
+ return provider;
+}
+
+QWindowsUiaMainProvider::QWindowsUiaMainProvider(QAccessibleInterface *a, int initialRefCount)
+ : QWindowsUiaBaseProvider(QAccessible::uniqueId(a)),
+ m_ref(initialRefCount)
+{
+}
+
+QWindowsUiaMainProvider::~QWindowsUiaMainProvider()
+{
+}
+
+void QWindowsUiaMainProvider::notifyFocusChange(QAccessibleEvent *event)
+{
+ if (QAccessibleInterface *accessible = event->accessibleInterface()) {
+ if (QWindowsUiaMainProvider *provider = providerForAccessible(accessible)) {
+ QWindowsUiaWrapper::instance()->raiseAutomationEvent(provider, UIA_AutomationFocusChangedEventId);
+ }
+ }
+}
+
+void QWindowsUiaMainProvider::notifyStateChange(QAccessibleStateChangeEvent *event)
+{
+ if (QAccessibleInterface *accessible = event->accessibleInterface()) {
+ if (event->changedStates().checked || event->changedStates().checkStateMixed) {
+ // Notifies states changes in checkboxes.
+ if (accessible->role() == QAccessible::CheckBox) {
+ if (QWindowsUiaMainProvider *provider = providerForAccessible(accessible)) {
+ VARIANT oldVal, newVal;
+ clearVariant(&oldVal);
+ int toggleState = ToggleState_Off;
+ if (accessible->state().checked)
+ toggleState = accessible->state().checkStateMixed ? ToggleState_Indeterminate : ToggleState_On;
+ setVariantI4(toggleState, &newVal);
+ QWindowsUiaWrapper::instance()->raiseAutomationPropertyChangedEvent(provider, UIA_ToggleToggleStatePropertyId, oldVal, newVal);
+ }
+ }
+ }
+ if (event->changedStates().active) {
+ if (accessible->role() == QAccessible::Window) {
+ // Notifies window opened/closed.
+ if (QWindowsUiaMainProvider *provider = providerForAccessible(accessible)) {
+ if (accessible->state().active) {
+ QWindowsUiaWrapper::instance()->raiseAutomationEvent(provider, UIA_Window_WindowOpenedEventId);
+ } else {
+ QWindowsUiaWrapper::instance()->raiseAutomationEvent(provider, UIA_Window_WindowClosedEventId);
+ }
+ }
+ }
+ }
+ }
+}
+
+void QWindowsUiaMainProvider::notifyValueChange(QAccessibleValueChangeEvent *event)
+{
+ if (QAccessibleInterface *accessible = event->accessibleInterface()) {
+ if (QAccessibleValueInterface *valueInterface = accessible->valueInterface()) {
+ // Notifies changes in values of controls supporting the value interface.
+ if (QWindowsUiaMainProvider *provider = providerForAccessible(accessible)) {
+ VARIANT oldVal, newVal;
+ clearVariant(&oldVal);
+ setVariantDouble(valueInterface->currentValue().toDouble(), &newVal);
+ QWindowsUiaWrapper::instance()->raiseAutomationPropertyChangedEvent(provider, UIA_RangeValueValuePropertyId, oldVal, newVal);
+ }
+ }
+ }
+}
+
+// Notifies changes in text content and selection state of text controls.
+void QWindowsUiaMainProvider::notifyTextChange(QAccessibleEvent *event)
+{
+ if (QAccessibleInterface *accessible = event->accessibleInterface()) {
+ if (accessible->textInterface()) {
+ if (QWindowsUiaMainProvider *provider = providerForAccessible(accessible)) {
+ if (event->type() == QAccessible::TextSelectionChanged) {
+ QWindowsUiaWrapper::instance()->raiseAutomationEvent(provider, UIA_Text_TextSelectionChangedEventId);
+ } else if (event->type() == QAccessible::TextCaretMoved) {
+ if (!accessible->state().readOnly) {
+ QWindowsUiaWrapper::instance()->raiseAutomationEvent(provider, UIA_Text_TextSelectionChangedEventId);
+ }
+ } else {
+ QWindowsUiaWrapper::instance()->raiseAutomationEvent(provider, UIA_Text_TextChangedEventId);
+ }
+ }
+ }
+ }
+}
+
+HRESULT STDMETHODCALLTYPE QWindowsUiaMainProvider::QueryInterface(REFIID iid, LPVOID *iface)
+{
+ if (!iface)
+ return E_INVALIDARG;
+ *iface = nullptr;
+
+ QAccessibleInterface *accessible = accessibleInterface();
+
+ const bool result = qWindowsComQueryUnknownInterfaceMulti<IRawElementProviderSimple>(this, iid, iface)
+ || qWindowsComQueryInterface<IRawElementProviderSimple>(this, iid, iface)
+ || qWindowsComQueryInterface<IRawElementProviderFragment>(this, iid, iface)
+ || (accessible && hwndForAccessible(accessible) && qWindowsComQueryInterface<IRawElementProviderFragmentRoot>(this, iid, iface));
+ return result ? S_OK : E_NOINTERFACE;
+}
+
+ULONG QWindowsUiaMainProvider::AddRef()
+{
+ return ++m_ref;
+}
+
+ULONG STDMETHODCALLTYPE QWindowsUiaMainProvider::Release()
+{
+ if (!--m_ref) {
+ delete this;
+ return 0;
+ }
+ return m_ref;
+}
+
+HRESULT QWindowsUiaMainProvider::get_ProviderOptions(ProviderOptions *pRetVal)
+{
+ if (!pRetVal)
+ return E_INVALIDARG;
+ // We are STA, (OleInitialize()).
+ *pRetVal = static_cast<ProviderOptions>(ProviderOptions_ServerSideProvider | ProviderOptions_UseComThreading);
+ return S_OK;
+}
+
+// Return providers for specific control patterns
+HRESULT QWindowsUiaMainProvider::GetPatternProvider(PATTERNID idPattern, IUnknown **pRetVal)
+{
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__ << idPattern;
+
+ if (!pRetVal)
+ return E_INVALIDARG;
+ *pRetVal = nullptr;
+
+ QAccessibleInterface *accessible = accessibleInterface();
+ if (!accessible)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ switch (idPattern) {
+ case UIA_TextPatternId:
+ case UIA_TextPattern2Id:
+ // All text controls.
+ if (accessible->textInterface()) {
+ *pRetVal = new QWindowsUiaTextProvider(id());
+ }
+ break;
+ case UIA_ValuePatternId:
+ // All accessible controls return text(QAccessible::Value) (which may be empty).
+ *pRetVal = new QWindowsUiaValueProvider(id());
+ break;
+ case UIA_RangeValuePatternId:
+ // Controls providing a numeric value within a range (e.g., sliders, scroll bars, dials).
+ if (accessible->valueInterface()) {
+ *pRetVal = new QWindowsUiaRangeValueProvider(id());
+ }
+ break;
+ case UIA_TogglePatternId:
+ // Checkbox controls.
+ if (accessible->role() == QAccessible::CheckBox) {
+ *pRetVal = new QWindowsUiaToggleProvider(id());
+ }
+ break;
+ case UIA_SelectionPatternId:
+ // Lists of items.
+ if (accessible->role() == QAccessible::List) {
+ *pRetVal = new QWindowsUiaSelectionProvider(id());
+ }
+ break;
+ case UIA_SelectionItemPatternId:
+ // Items within a list and radio buttons.
+ if ((accessible->role() == QAccessible::RadioButton)
+ || (accessible->role() == QAccessible::ListItem)) {
+ *pRetVal = new QWindowsUiaSelectionItemProvider(id());
+ }
+ break;
+ case UIA_TablePatternId:
+ // Table/tree.
+ if (accessible->tableInterface()
+ && ((accessible->role() == QAccessible::Table) || (accessible->role() == QAccessible::Tree))) {
+ *pRetVal = new QWindowsUiaTableProvider(id());
+ }
+ break;
+ case UIA_TableItemPatternId:
+ // Item within a table/tree.
+ if (accessible->tableCellInterface()
+ && ((accessible->role() == QAccessible::Cell) || (accessible->role() == QAccessible::TreeItem))) {
+ *pRetVal = new QWindowsUiaTableItemProvider(id());
+ }
+ break;
+ case UIA_GridPatternId:
+ // Table/tree.
+ if (accessible->tableInterface()
+ && ((accessible->role() == QAccessible::Table) || (accessible->role() == QAccessible::Tree))) {
+ *pRetVal = new QWindowsUiaGridProvider(id());
+ }
+ break;
+ case UIA_GridItemPatternId:
+ // Item within a table/tree.
+ if (accessible->tableCellInterface()
+ && ((accessible->role() == QAccessible::Cell) || (accessible->role() == QAccessible::TreeItem))) {
+ *pRetVal = new QWindowsUiaGridItemProvider(id());
+ }
+ break;
+ case UIA_InvokePatternId:
+ // Things that have an invokable action (e.g., simple buttons).
+ if (accessible->actionInterface()) {
+ *pRetVal = new QWindowsUiaInvokeProvider(id());
+ }
+ break;
+ default:
+ break;
+ }
+
+ return S_OK;
+}
+
+HRESULT QWindowsUiaMainProvider::GetPropertyValue(PROPERTYID idProp, VARIANT *pRetVal)
+{
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__ << idProp;
+
+ if (!pRetVal)
+ return E_INVALIDARG;
+ clearVariant(pRetVal);
+
+ QAccessibleInterface *accessible = accessibleInterface();
+ if (!accessible)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ bool clientTopLevel = (accessible->role() == QAccessible::Client)
+ && accessible->parent() && (accessible->parent()->role() == QAccessible::Application);
+
+ switch (idProp) {
+ case UIA_ProcessIdPropertyId:
+ // PID
+ setVariantI4(int(GetCurrentProcessId()), pRetVal);
+ break;
+ case UIA_AccessKeyPropertyId:
+ // Accelerator key.
+ setVariantString(accessible->text(QAccessible::Accelerator), pRetVal);
+ break;
+ case UIA_AutomationIdPropertyId:
+ // Automation ID, which can be used by tools to select a specific control in the UI.
+ setVariantString(automationIdForAccessible(accessible), pRetVal);
+ break;
+ case UIA_ClassNamePropertyId:
+ // Class name.
+ if (QObject *o = accessible->object()) {
+ QString className = QLatin1String(o->metaObject()->className());
+ setVariantString(className, pRetVal);
+ }
+ break;
+ case UIA_FrameworkIdPropertyId:
+ setVariantString(QStringLiteral("Qt"), pRetVal);
+ break;
+ case UIA_ControlTypePropertyId:
+ if (clientTopLevel) {
+ // Reports a top-level widget as a window, instead of "custom".
+ setVariantI4(UIA_WindowControlTypeId, pRetVal);
+ } else {
+ // Control type converted from role.
+ setVariantI4(roleToControlTypeId(accessible->role()), pRetVal);
+ }
+ break;
+ case UIA_HelpTextPropertyId:
+ setVariantString(accessible->text(QAccessible::Help), pRetVal);
+ break;
+ case UIA_HasKeyboardFocusPropertyId:
+ setVariantBool(accessible->state().focused, pRetVal);
+ break;
+ case UIA_IsKeyboardFocusablePropertyId:
+ setVariantBool(accessible->state().focusable, pRetVal);
+ break;
+ case UIA_IsOffscreenPropertyId:
+ setVariantBool(false, pRetVal);
+ break;
+ case UIA_IsContentElementPropertyId:
+ setVariantBool(true, pRetVal);
+ break;
+ case UIA_IsControlElementPropertyId:
+ setVariantBool(true, pRetVal);
+ break;
+ case UIA_IsEnabledPropertyId:
+ setVariantBool(!accessible->state().disabled, pRetVal);
+ break;
+ case UIA_IsPasswordPropertyId:
+ setVariantBool(accessible->role() == QAccessible::EditableText
+ && accessible->state().passwordEdit, pRetVal);
+ break;
+ case UIA_IsPeripheralPropertyId:
+ // True for peripheral UIs.
+ if (QWindow *window = windowForAccessible(accessible)) {
+ const Qt::WindowType wt = window->type();
+ setVariantBool(wt == Qt::Popup || wt == Qt::ToolTip || wt == Qt::SplashScreen, pRetVal);
+ }
+ break;
+ case UIA_FullDescriptionPropertyId:
+ setVariantString(accessible->text(QAccessible::Description), pRetVal);
+ break;
+ case UIA_NamePropertyId: {
+ QString name = accessible->text(QAccessible::Name);
+ if (name.isEmpty() && clientTopLevel) {
+ name = QCoreApplication::applicationName();
+ }
+ setVariantString(name, pRetVal);
+ break;
+ }
+ default:
+ break;
+ }
+ return S_OK;
+}
+
+// Generates an ID based on the name of the controls and their parents.
+QString QWindowsUiaMainProvider::automationIdForAccessible(const QAccessibleInterface *accessible)
+{
+ QString result;
+ if (accessible) {
+ QObject *obj = accessible->object();
+ while (obj) {
+ QString name = obj->objectName();
+ if (name.isEmpty())
+ return QString();
+ if (!result.isEmpty())
+ result.prepend(QLatin1Char('.'));
+ result.prepend(name);
+ obj = obj->parent();
+ }
+ }
+ return result;
+}
+
+HRESULT QWindowsUiaMainProvider::get_HostRawElementProvider(IRawElementProviderSimple **pRetVal)
+{
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__ << this;
+
+ if (!pRetVal)
+ return E_INVALIDARG;
+ *pRetVal = nullptr;
+
+ // Returns a host provider only for controls associated with a native window handle. Others should return NULL.
+ if (QAccessibleInterface *accessible = accessibleInterface()) {
+ if (HWND hwnd = hwndForAccessible(accessible)) {
+ return QWindowsUiaWrapper::instance()->hostProviderFromHwnd(hwnd, pRetVal);
+ }
+ }
+ return S_OK;
+}
+
+// Navigates within the tree of accessible controls.
+HRESULT QWindowsUiaMainProvider::Navigate(NavigateDirection direction, IRawElementProviderFragment **pRetVal)
+{
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__ << direction << " this: " << this;
+
+ if (!pRetVal)
+ return E_INVALIDARG;
+ *pRetVal = nullptr;
+
+ QAccessibleInterface *accessible = accessibleInterface();
+ if (!accessible)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ QAccessibleInterface *targetacc = nullptr;
+
+ switch (direction) {
+ case NavigateDirection_Parent:
+ targetacc = accessible->parent();
+ if (targetacc && (targetacc->role() == QAccessible::Application)) {
+ targetacc = nullptr; // The app's children are considered top level objects.
+ }
+ break;
+ case NavigateDirection_FirstChild:
+ targetacc = accessible->child(0);
+ break;
+ case NavigateDirection_LastChild:
+ targetacc = accessible->child(accessible->childCount() - 1);
+ break;
+ case NavigateDirection_NextSibling:
+ case NavigateDirection_PreviousSibling:
+ if (QAccessibleInterface *parent = accessible->parent()) {
+ if (parent->isValid()) {
+ int index = parent->indexOfChild(accessible);
+ index += (direction == NavigateDirection_NextSibling) ? 1 : -1;
+ if (index >= 0 && index < parent->childCount())
+ targetacc = parent->child(index);
+ }
+ }
+ break;
+ }
+
+ if (targetacc)
+ *pRetVal = providerForAccessible(targetacc);
+ return S_OK;
+}
+
+// Returns a unique id assigned to the UI element, used as key by the UI Automation framework.
+HRESULT QWindowsUiaMainProvider::GetRuntimeId(SAFEARRAY **pRetVal)
+{
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__ << this;
+
+ if (!pRetVal)
+ return E_INVALIDARG;
+ *pRetVal = nullptr;
+
+ QAccessibleInterface *accessible = accessibleInterface();
+ if (!accessible)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ // The UiaAppendRuntimeId constant is used to make then ID unique
+ // among multiple instances running on the system.
+ int rtId[] = { UiaAppendRuntimeId, int(id()) };
+
+ if ((*pRetVal = SafeArrayCreateVector(VT_I4, 0, 2))) {
+ for (LONG i = 0; i < 2; ++i)
+ SafeArrayPutElement(*pRetVal, &i, &rtId[i]);
+ }
+ return S_OK;
+}
+
+// Returns the bounding rectangle for the accessible control.
+HRESULT QWindowsUiaMainProvider::get_BoundingRectangle(UiaRect *pRetVal)
+{
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__ << this;
+
+ if (!pRetVal)
+ return E_INVALIDARG;
+
+ QAccessibleInterface *accessible = accessibleInterface();
+ if (!accessible)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ QWindow *window = windowForAccessible(accessible);
+ if (!window)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ rectToNativeUiaRect(accessible->rect(), window, pRetVal);
+ return S_OK;
+}
+
+HRESULT QWindowsUiaMainProvider::GetEmbeddedFragmentRoots(SAFEARRAY **pRetVal)
+{
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__ << this;
+
+ if (!pRetVal)
+ return E_INVALIDARG;
+ *pRetVal = nullptr;
+ // No embedded roots.
+ return S_OK;
+}
+
+// Sets focus to the control.
+HRESULT QWindowsUiaMainProvider::SetFocus()
+{
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__ << this;
+
+ QAccessibleInterface *accessible = accessibleInterface();
+ if (!accessible)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ QAccessibleActionInterface *actionInterface = accessible->actionInterface();
+ if (!actionInterface)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ actionInterface->doAction(QAccessibleActionInterface::setFocusAction());
+ return S_OK;
+}
+
+HRESULT QWindowsUiaMainProvider::get_FragmentRoot(IRawElementProviderFragmentRoot **pRetVal)
+{
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__ << this;
+
+ if (!pRetVal)
+ return E_INVALIDARG;
+ *pRetVal = nullptr;
+
+ // Our UI Automation implementation considers the window as the root for
+ // non-native controls/fragments.
+ if (QAccessibleInterface *accessible = accessibleInterface()) {
+ if (QWindow *window = windowForAccessible(accessible)) {
+ if (QAccessibleInterface *rootacc = window->accessibleRoot()) {
+ *pRetVal = providerForAccessible(rootacc);
+ }
+ }
+ }
+ return S_OK;
+}
+
+// Returns a provider for the UI element present at the specified screen coordinates.
+HRESULT QWindowsUiaMainProvider::ElementProviderFromPoint(double x, double y, IRawElementProviderFragment **pRetVal)
+{
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__ << x << y;
+
+ if (!pRetVal) {
+ return E_INVALIDARG;
+ }
+ *pRetVal = nullptr;
+
+ QAccessibleInterface *accessible = accessibleInterface();
+ if (!accessible)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ QWindow *window = windowForAccessible(accessible);
+ if (!window)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ // Scales coordinates from High DPI screens.
+ UiaPoint uiaPoint = {x, y};
+ QPoint point;
+ nativeUiaPointToPoint(uiaPoint, window, &point);
+
+ QAccessibleInterface *targetacc = accessible->childAt(point.x(), point.y());
+
+ if (targetacc) {
+ QAccessibleInterface *acc = targetacc;
+ // Controls can be embedded within grouping elements. By default returns the innermost control.
+ while (acc) {
+ targetacc = acc;
+ // For accessibility tools it may be better to return the text element instead of its subcomponents.
+ if (targetacc->textInterface()) break;
+ acc = acc->childAt(point.x(), point.y());
+ }
+ *pRetVal = providerForAccessible(targetacc);
+ }
+ return S_OK;
+}
+
+// Returns the fragment with focus.
+HRESULT QWindowsUiaMainProvider::GetFocus(IRawElementProviderFragment **pRetVal)
+{
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__ << this;
+
+ if (!pRetVal)
+ return E_INVALIDARG;
+ *pRetVal = nullptr;
+
+ if (QAccessibleInterface *accessible = accessibleInterface()) {
+ if (QAccessibleInterface *focusacc = accessible->focusChild()) {
+ *pRetVal = providerForAccessible(focusacc);
+ }
+ }
+ return S_OK;
+}
+
+QT_END_NAMESPACE
+
+#endif // QT_NO_ACCESSIBILITY
diff --git a/src/plugins/platforms/windows/uiautomation/qwindowsuiamainprovider.h b/src/plugins/platforms/windows/uiautomation/qwindowsuiamainprovider.h
new file mode 100644
index 0000000000..893cbf7f8a
--- /dev/null
+++ b/src/plugins/platforms/windows/uiautomation/qwindowsuiamainprovider.h
@@ -0,0 +1,105 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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$
+**
+****************************************************************************/
+
+#ifndef QWINDOWSUIAMAINPROVIDER_H
+#define QWINDOWSUIAMAINPROVIDER_H
+
+#include <QtCore/QtConfig>
+#ifndef QT_NO_ACCESSIBILITY
+
+#include "qwindowsuiabaseprovider.h"
+
+#include <QtCore/QPointer>
+#include <QtCore/QSharedPointer>
+#include <QtCore/qt_windows.h>
+#include <QtGui/QAccessible>
+
+QT_BEGIN_NAMESPACE
+
+// The main UI Automation class.
+class QWindowsUiaMainProvider :
+ public QWindowsUiaBaseProvider,
+ public IRawElementProviderSimple,
+ public IRawElementProviderFragment,
+ public IRawElementProviderFragmentRoot
+{
+ Q_OBJECT
+ Q_DISABLE_COPY(QWindowsUiaMainProvider)
+public:
+ static QWindowsUiaMainProvider *providerForAccessible(QAccessibleInterface *accessible);
+ explicit QWindowsUiaMainProvider(QAccessibleInterface *a, int initialRefCount = 1);
+ virtual ~QWindowsUiaMainProvider();
+ static void notifyFocusChange(QAccessibleEvent *event);
+ static void notifyStateChange(QAccessibleStateChangeEvent *event);
+ static void notifyValueChange(QAccessibleValueChangeEvent *event);
+ static void notifyTextChange(QAccessibleEvent *event);
+
+ // IUnknown
+ HRESULT STDMETHODCALLTYPE QueryInterface(REFIID id, LPVOID *iface);
+ ULONG STDMETHODCALLTYPE AddRef();
+ ULONG STDMETHODCALLTYPE Release();
+
+ // IRawElementProviderSimple methods
+ HRESULT STDMETHODCALLTYPE get_ProviderOptions(ProviderOptions *pRetVal);
+ HRESULT STDMETHODCALLTYPE GetPatternProvider(PATTERNID idPattern, IUnknown **pRetVal);
+ HRESULT STDMETHODCALLTYPE GetPropertyValue(PROPERTYID idProp, VARIANT *pRetVal);
+ HRESULT STDMETHODCALLTYPE get_HostRawElementProvider(IRawElementProviderSimple **pRetVal);
+
+ // IRawElementProviderFragment methods
+ HRESULT STDMETHODCALLTYPE Navigate(NavigateDirection direction, IRawElementProviderFragment **pRetVal);
+ HRESULT STDMETHODCALLTYPE GetRuntimeId(SAFEARRAY **pRetVal);
+ HRESULT STDMETHODCALLTYPE get_BoundingRectangle(UiaRect *pRetVal);
+ HRESULT STDMETHODCALLTYPE GetEmbeddedFragmentRoots(SAFEARRAY **pRetVal);
+ HRESULT STDMETHODCALLTYPE SetFocus();
+ HRESULT STDMETHODCALLTYPE get_FragmentRoot(IRawElementProviderFragmentRoot **pRetVal);
+
+ // IRawElementProviderFragmentRoot methods
+ HRESULT STDMETHODCALLTYPE ElementProviderFromPoint(double x, double y, IRawElementProviderFragment **pRetVal);
+ HRESULT STDMETHODCALLTYPE GetFocus(IRawElementProviderFragment **pRetVal);
+
+private:
+ QString automationIdForAccessible(const QAccessibleInterface *accessible);
+ ULONG m_ref;
+};
+
+QT_END_NAMESPACE
+
+#endif // QT_NO_ACCESSIBILITY
+
+#endif // QWINDOWSUIAMAINPROVIDER_H
diff --git a/src/plugins/platforms/windows/uiautomation/qwindowsuiaprovidercache.cpp b/src/plugins/platforms/windows/uiautomation/qwindowsuiaprovidercache.cpp
new file mode 100644
index 0000000000..9f0a1e126f
--- /dev/null
+++ b/src/plugins/platforms/windows/uiautomation/qwindowsuiaprovidercache.cpp
@@ -0,0 +1,106 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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 <QtCore/QtConfig>
+#ifndef QT_NO_ACCESSIBILITY
+
+#include "qwindowsuiaprovidercache.h"
+#include "qwindowsuiautils.h"
+#include "qwindowscontext.h"
+
+#include <QtCore/QDebug>
+
+QT_BEGIN_NAMESPACE
+
+using namespace QWindowsUiAutomation;
+
+
+// Private constructor
+QWindowsUiaProviderCache::QWindowsUiaProviderCache()
+{
+}
+
+// shared instance
+QWindowsUiaProviderCache *QWindowsUiaProviderCache::instance()
+{
+ static QWindowsUiaProviderCache providerCache;
+ return &providerCache;
+}
+
+// Returns the provider instance associated with the ID, or nullptr.
+QWindowsUiaBaseProvider *QWindowsUiaProviderCache::providerForId(QAccessible::Id id) const
+{
+ return providerTable.value(id);
+}
+
+// Inserts a provider in the cache and associates it with an accessibility ID.
+void QWindowsUiaProviderCache::insert(QAccessible::Id id, QWindowsUiaBaseProvider *provider)
+{
+ remove(id);
+ if (provider) {
+ providerTable[id] = provider;
+ inverseTable[provider] = id;
+ // Connects the destroyed signal to our slot, to remove deleted objects from the cache.
+ QObject::connect(provider, &QObject::destroyed, this, &QWindowsUiaProviderCache::objectDestroyed);
+ }
+}
+
+// Removes deleted provider objects from the cache.
+void QWindowsUiaProviderCache::objectDestroyed(QObject *obj)
+{
+ // We have to use the inverse table to map the object address back to its ID,
+ // since at this point (called from QObject destructor), it has already been
+ // partially destroyed and we cannot treat it as a provider.
+ auto it = inverseTable.find(obj);
+ if (it != inverseTable.end()) {
+ providerTable.remove(*it);
+ inverseTable.remove(obj);
+ }
+}
+
+// Removes a provider with a given id from the cache.
+void QWindowsUiaProviderCache::remove(QAccessible::Id id)
+{
+ inverseTable.remove(providerTable.value(id));
+ providerTable.remove(id);
+}
+
+QT_END_NAMESPACE
+
+#endif // QT_NO_ACCESSIBILITY
diff --git a/src/plugins/platforms/windows/uiautomation/qwindowsuiaprovidercache.h b/src/plugins/platforms/windows/uiautomation/qwindowsuiaprovidercache.h
new file mode 100644
index 0000000000..7ad30ac39c
--- /dev/null
+++ b/src/plugins/platforms/windows/uiautomation/qwindowsuiaprovidercache.h
@@ -0,0 +1,77 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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$
+**
+****************************************************************************/
+
+#ifndef QWINDOWSUIAPROVIDERCACHE_H
+#define QWINDOWSUIAPROVIDERCACHE_H
+
+#include <QtCore/QtConfig>
+#ifndef QT_NO_ACCESSIBILITY
+
+#include "qwindowsuiabaseprovider.h"
+
+#include <QtCore/QHash>
+#include <QtGui/QAccessible>
+#include <QtGui/QAccessibleInterface>
+
+QT_BEGIN_NAMESPACE
+
+// Singleton used to cache provider instances using the accessibility ID as the key.
+class QWindowsUiaProviderCache : public QObject
+{
+ QWindowsUiaProviderCache();
+ Q_OBJECT
+public:
+ static QWindowsUiaProviderCache *instance();
+ QWindowsUiaBaseProvider *providerForId(QAccessible::Id id) const;
+ void insert(QAccessible::Id id, QWindowsUiaBaseProvider *provider);
+ void remove(QAccessible::Id id);
+
+private Q_SLOTS:
+ void objectDestroyed(QObject *obj);
+
+private:
+ QHash<QAccessible::Id, QWindowsUiaBaseProvider *> providerTable;
+ QHash<QObject *, QAccessible::Id> inverseTable;
+};
+
+QT_END_NAMESPACE
+
+#endif // QT_NO_ACCESSIBILITY
+
+#endif // QWINDOWSUIAPROVIDERCACHE_H
diff --git a/src/plugins/platforms/windows/uiautomation/qwindowsuiarangevalueprovider.cpp b/src/plugins/platforms/windows/uiautomation/qwindowsuiarangevalueprovider.cpp
new file mode 100644
index 0000000000..0cd09c3f0a
--- /dev/null
+++ b/src/plugins/platforms/windows/uiautomation/qwindowsuiarangevalueprovider.cpp
@@ -0,0 +1,190 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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 <QtCore/QtConfig>
+#ifndef QT_NO_ACCESSIBILITY
+
+#include "qwindowsuiarangevalueprovider.h"
+#include "qwindowsuiautils.h"
+#include "qwindowscontext.h"
+
+#include <QtGui/QAccessible>
+#include <QtGui/QAccessibleInterface>
+#include <QtCore/QDebug>
+#include <QtCore/QString>
+
+QT_BEGIN_NAMESPACE
+
+using namespace QWindowsUiAutomation;
+
+
+QWindowsUiaRangeValueProvider::QWindowsUiaRangeValueProvider(QAccessible::Id id) :
+ QWindowsUiaBaseProvider(id)
+{
+}
+
+QWindowsUiaRangeValueProvider::~QWindowsUiaRangeValueProvider()
+{
+}
+
+HRESULT STDMETHODCALLTYPE QWindowsUiaRangeValueProvider::SetValue(double val)
+{
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__;
+
+ QAccessibleInterface *accessible = accessibleInterface();
+ if (!accessible)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ QAccessibleValueInterface *valueInterface = accessible->valueInterface();
+ if (!valueInterface)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ double minimum = valueInterface->minimumValue().toDouble();
+ double maximum = valueInterface->maximumValue().toDouble();
+ if ((val < minimum) || (val > maximum))
+ return E_INVALIDARG;
+
+ valueInterface->setCurrentValue(QVariant(val));
+ return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE QWindowsUiaRangeValueProvider::get_Value(double *pRetVal)
+{
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__;
+
+ if (!pRetVal)
+ return E_INVALIDARG;
+
+ QAccessibleInterface *accessible = accessibleInterface();
+ if (!accessible)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ QAccessibleValueInterface *valueInterface = accessible->valueInterface();
+ if (!valueInterface)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ QVariant varValue = valueInterface->currentValue();
+ *pRetVal = varValue.toDouble();
+ return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE QWindowsUiaRangeValueProvider::get_IsReadOnly(BOOL *pRetVal)
+{
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__;
+
+ if (!pRetVal)
+ return E_INVALIDARG;
+
+ QAccessibleInterface *accessible = accessibleInterface();
+ if (!accessible)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ *pRetVal = accessible->state().readOnly;
+ return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE QWindowsUiaRangeValueProvider::get_Maximum(double *pRetVal)
+{
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__;
+
+ if (!pRetVal)
+ return E_INVALIDARG;
+
+ QAccessibleInterface *accessible = accessibleInterface();
+ if (!accessible)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ QAccessibleValueInterface *valueInterface = accessible->valueInterface();
+ if (!valueInterface)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ QVariant varValue = valueInterface->maximumValue();
+ *pRetVal = varValue.toDouble();
+ return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE QWindowsUiaRangeValueProvider::get_Minimum(double *pRetVal)
+{
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__;
+
+ if (!pRetVal)
+ return E_INVALIDARG;
+
+ QAccessibleInterface *accessible = accessibleInterface();
+ if (!accessible)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ QAccessibleValueInterface *valueInterface = accessible->valueInterface();
+ if (!valueInterface)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ QVariant varValue = valueInterface->minimumValue();
+ *pRetVal = varValue.toDouble();
+ return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE QWindowsUiaRangeValueProvider::get_LargeChange(double *pRetVal)
+{
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__;
+ return get_SmallChange(pRetVal);
+}
+
+HRESULT STDMETHODCALLTYPE QWindowsUiaRangeValueProvider::get_SmallChange(double *pRetVal)
+{
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__;
+
+ if (!pRetVal)
+ return E_INVALIDARG;
+
+ QAccessibleInterface *accessible = accessibleInterface();
+ if (!accessible)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ QAccessibleValueInterface *valueInterface = accessible->valueInterface();
+ if (!valueInterface)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ QVariant varValue = valueInterface->minimumStepSize();
+ *pRetVal = varValue.toDouble();
+ return S_OK;
+}
+
+QT_END_NAMESPACE
+
+#endif // QT_NO_ACCESSIBILITY
diff --git a/src/plugins/platforms/windows/uiautomation/qwindowsuiarangevalueprovider.h b/src/plugins/platforms/windows/uiautomation/qwindowsuiarangevalueprovider.h
new file mode 100644
index 0000000000..f742ef99c2
--- /dev/null
+++ b/src/plugins/platforms/windows/uiautomation/qwindowsuiarangevalueprovider.h
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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$
+**
+****************************************************************************/
+
+#ifndef QWINDOWSUIARANGEVALUEPROVIDER_H
+#define QWINDOWSUIARANGEVALUEPROVIDER_H
+
+#include <QtCore/QtConfig>
+#ifndef QT_NO_ACCESSIBILITY
+
+#include "qwindowsuiabaseprovider.h"
+
+QT_BEGIN_NAMESPACE
+
+// Implements the Range Value control pattern provider.
+class QWindowsUiaRangeValueProvider : public QWindowsUiaBaseProvider,
+ public QWindowsComBase<IRangeValueProvider>
+{
+ Q_DISABLE_COPY(QWindowsUiaRangeValueProvider)
+public:
+ explicit QWindowsUiaRangeValueProvider(QAccessible::Id id);
+ virtual ~QWindowsUiaRangeValueProvider();
+
+ // IRangeValueProvider
+ HRESULT STDMETHODCALLTYPE SetValue(double val);
+ HRESULT STDMETHODCALLTYPE get_Value(double *pRetVal);
+ HRESULT STDMETHODCALLTYPE get_IsReadOnly(BOOL *pRetVal);
+ HRESULT STDMETHODCALLTYPE get_Maximum(double *pRetVal);
+ HRESULT STDMETHODCALLTYPE get_Minimum(double *pRetVal);
+ HRESULT STDMETHODCALLTYPE get_LargeChange(double *pRetVal);
+ HRESULT STDMETHODCALLTYPE get_SmallChange(double *pRetVal);
+};
+
+QT_END_NAMESPACE
+
+#endif // QT_NO_ACCESSIBILITY
+
+#endif // QWINDOWSUIARANGEVALUEPROVIDER_H
diff --git a/src/plugins/platforms/windows/uiautomation/qwindowsuiaselectionitemprovider.cpp b/src/plugins/platforms/windows/uiautomation/qwindowsuiaselectionitemprovider.cpp
new file mode 100644
index 0000000000..45216a6d1c
--- /dev/null
+++ b/src/plugins/platforms/windows/uiautomation/qwindowsuiaselectionitemprovider.cpp
@@ -0,0 +1,201 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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 <QtCore/QtConfig>
+#ifndef QT_NO_ACCESSIBILITY
+
+#include "qwindowsuiaselectionitemprovider.h"
+#include "qwindowsuiamainprovider.h"
+#include "qwindowsuiautils.h"
+#include "qwindowscontext.h"
+
+#include <QtGui/QAccessible>
+#include <QtGui/QAccessibleInterface>
+#include <QtCore/QDebug>
+#include <QtCore/QString>
+
+QT_BEGIN_NAMESPACE
+
+using namespace QWindowsUiAutomation;
+
+
+QWindowsUiaSelectionItemProvider::QWindowsUiaSelectionItemProvider(QAccessible::Id id) :
+ QWindowsUiaBaseProvider(id)
+{
+}
+
+QWindowsUiaSelectionItemProvider::~QWindowsUiaSelectionItemProvider()
+{
+}
+
+// Selects the element (deselecting all others).
+HRESULT STDMETHODCALLTYPE QWindowsUiaSelectionItemProvider::Select()
+{
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__;
+
+ QAccessibleInterface *accessible = accessibleInterface();
+ if (!accessible)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ QAccessibleActionInterface *actionInterface = accessible->actionInterface();
+ if (!actionInterface)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ if (accessible->role() == QAccessible::RadioButton) {
+ // For radio buttons we just invoke the selection action; others are automatically deselected.
+ actionInterface->doAction(QAccessibleActionInterface::pressAction());
+ } else {
+ // Toggle list item if not already selected. It must be done first to support all selection modes.
+ if (!accessible->state().selected) {
+ actionInterface->doAction(QAccessibleActionInterface::toggleAction());
+ }
+ // Toggle selected siblings.
+ if (QAccessibleInterface *parent = accessible->parent()) {
+ for (int i = 0; i < parent->childCount(); ++i) {
+ if (QAccessibleInterface *sibling = parent->child(i)) {
+ if ((sibling != accessible) && (sibling->state().selected)) {
+ if (QAccessibleActionInterface *siblingAction = sibling->actionInterface()) {
+ siblingAction->doAction(QAccessibleActionInterface::toggleAction());
+ }
+ }
+ }
+ }
+ }
+ }
+ return S_OK;
+}
+
+// Adds the element to the list of selected elements.
+HRESULT STDMETHODCALLTYPE QWindowsUiaSelectionItemProvider::AddToSelection()
+{
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__;
+
+ QAccessibleInterface *accessible = accessibleInterface();
+ if (!accessible)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ QAccessibleActionInterface *actionInterface = accessible->actionInterface();
+ if (!actionInterface)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ if (accessible->role() == QAccessible::RadioButton) {
+ // For radio buttons we invoke the selection action.
+ actionInterface->doAction(QAccessibleActionInterface::pressAction());
+ } else {
+ // Toggle list item if not already selected.
+ if (!accessible->state().selected) {
+ actionInterface->doAction(QAccessibleActionInterface::toggleAction());
+ }
+ }
+ return S_OK;
+}
+
+// Removes a list item from selection.
+HRESULT STDMETHODCALLTYPE QWindowsUiaSelectionItemProvider::RemoveFromSelection()
+{
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__;
+
+ QAccessibleInterface *accessible = accessibleInterface();
+ if (!accessible)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ QAccessibleActionInterface *actionInterface = accessible->actionInterface();
+ if (!actionInterface)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ if (accessible->role() != QAccessible::RadioButton) {
+ if (accessible->state().selected) {
+ actionInterface->doAction(QAccessibleActionInterface::toggleAction());
+ }
+ }
+
+ return S_OK;
+}
+
+// Returns true if element is currently selected.
+HRESULT STDMETHODCALLTYPE QWindowsUiaSelectionItemProvider::get_IsSelected(BOOL *pRetVal)
+{
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__;
+
+ if (!pRetVal)
+ return E_INVALIDARG;
+ *pRetVal = FALSE;
+
+ QAccessibleInterface *accessible = accessibleInterface();
+ if (!accessible)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ if (accessible->role() == QAccessible::RadioButton)
+ *pRetVal = accessible->state().checked;
+ else
+ *pRetVal = accessible->state().selected;
+ return S_OK;
+}
+
+// Returns the provider for the container element (e.g., the list for the list item).
+HRESULT STDMETHODCALLTYPE QWindowsUiaSelectionItemProvider::get_SelectionContainer(IRawElementProviderSimple **pRetVal)
+{
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__;
+
+ if (!pRetVal)
+ return E_INVALIDARG;
+ *pRetVal = nullptr;
+
+ QAccessibleInterface *accessible = accessibleInterface();
+ if (!accessible)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ QAccessibleActionInterface *actionInterface = accessible->actionInterface();
+ if (!actionInterface)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ // Radio buttons do not require a container.
+ if (accessible->role() == QAccessible::ListItem) {
+ if (QAccessibleInterface *parent = accessible->parent()) {
+ if (parent->role() == QAccessible::List) {
+ *pRetVal = QWindowsUiaMainProvider::providerForAccessible(parent);
+ }
+ }
+ }
+ return S_OK;
+}
+
+QT_END_NAMESPACE
+
+#endif // QT_NO_ACCESSIBILITY
diff --git a/src/plugins/platforms/windows/uiautomation/qwindowsuiaselectionitemprovider.h b/src/plugins/platforms/windows/uiautomation/qwindowsuiaselectionitemprovider.h
new file mode 100644
index 0000000000..6a9b5b1e4b
--- /dev/null
+++ b/src/plugins/platforms/windows/uiautomation/qwindowsuiaselectionitemprovider.h
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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$
+**
+****************************************************************************/
+
+#ifndef QWINDOWSUIASELECTIONITEMPROVIDER_H
+#define QWINDOWSUIASELECTIONITEMPROVIDER_H
+
+#include <QtCore/QtConfig>
+#ifndef QT_NO_ACCESSIBILITY
+
+#include "qwindowsuiabaseprovider.h"
+
+QT_BEGIN_NAMESPACE
+
+// Implements the Selection Item control pattern provider. Used for List items and radio buttons.
+class QWindowsUiaSelectionItemProvider : public QWindowsUiaBaseProvider,
+ public QWindowsComBase<ISelectionItemProvider>
+{
+ Q_DISABLE_COPY(QWindowsUiaSelectionItemProvider)
+public:
+ explicit QWindowsUiaSelectionItemProvider(QAccessible::Id id);
+ virtual ~QWindowsUiaSelectionItemProvider();
+
+ // ISelectionItemProvider
+ HRESULT STDMETHODCALLTYPE Select();
+ HRESULT STDMETHODCALLTYPE AddToSelection();
+ HRESULT STDMETHODCALLTYPE RemoveFromSelection();
+ HRESULT STDMETHODCALLTYPE get_IsSelected(BOOL *pRetVal);
+ HRESULT STDMETHODCALLTYPE get_SelectionContainer(IRawElementProviderSimple **pRetVal);
+};
+
+QT_END_NAMESPACE
+
+#endif // QT_NO_ACCESSIBILITY
+
+#endif // QWINDOWSUIASELECTIONITEMPROVIDER_H
diff --git a/src/plugins/platforms/windows/uiautomation/qwindowsuiaselectionprovider.cpp b/src/plugins/platforms/windows/uiautomation/qwindowsuiaselectionprovider.cpp
new file mode 100644
index 0000000000..1c06503bfc
--- /dev/null
+++ b/src/plugins/platforms/windows/uiautomation/qwindowsuiaselectionprovider.cpp
@@ -0,0 +1,147 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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 <QtCore/QtConfig>
+#ifndef QT_NO_ACCESSIBILITY
+
+#include "qwindowsuiaselectionprovider.h"
+#include "qwindowsuiamainprovider.h"
+#include "qwindowsuiautils.h"
+#include "qwindowscontext.h"
+
+#include <QtGui/QAccessible>
+#include <QtGui/QAccessibleInterface>
+#include <QtCore/QDebug>
+#include <QtCore/QString>
+#include <QList>
+
+QT_BEGIN_NAMESPACE
+
+using namespace QWindowsUiAutomation;
+
+
+QWindowsUiaSelectionProvider::QWindowsUiaSelectionProvider(QAccessible::Id id) :
+ QWindowsUiaBaseProvider(id)
+{
+}
+
+QWindowsUiaSelectionProvider::~QWindowsUiaSelectionProvider()
+{
+}
+
+// Returns an array of providers with the selected items.
+HRESULT STDMETHODCALLTYPE QWindowsUiaSelectionProvider::GetSelection(SAFEARRAY **pRetVal)
+{
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__;
+
+ if (!pRetVal)
+ return E_INVALIDARG;
+ *pRetVal = nullptr;
+
+ QAccessibleInterface *accessible = accessibleInterface();
+ if (!accessible)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ // First put selected items in a list, then build a safe array with the right size.
+ QList<QAccessibleInterface *> selectedList;
+ for (int i = 0; i < accessible->childCount(); ++i) {
+ if (QAccessibleInterface *child = accessible->child(i)) {
+ if (child->state().selected) {
+ selectedList.append(child);
+ }
+ }
+ }
+
+ if ((*pRetVal = SafeArrayCreateVector(VT_UNKNOWN, 0, selectedList.size()))) {
+ for (LONG i = 0; i < selectedList.size(); ++i) {
+ if (QWindowsUiaMainProvider *childProvider = QWindowsUiaMainProvider::providerForAccessible(selectedList.at(i))) {
+ SafeArrayPutElement(*pRetVal, &i, static_cast<IRawElementProviderSimple *>(childProvider));
+ childProvider->Release();
+ }
+ }
+ }
+ return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE QWindowsUiaSelectionProvider::get_CanSelectMultiple(BOOL *pRetVal)
+{
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__;
+
+ if (!pRetVal)
+ return E_INVALIDARG;
+ *pRetVal = FALSE;
+
+ QAccessibleInterface *accessible = accessibleInterface();
+ if (!accessible)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ *pRetVal = accessible->state().multiSelectable;
+ return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE QWindowsUiaSelectionProvider::get_IsSelectionRequired(BOOL *pRetVal)
+{
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__;
+
+ if (!pRetVal)
+ return E_INVALIDARG;
+ *pRetVal = FALSE;
+
+ QAccessibleInterface *accessible = accessibleInterface();
+ if (!accessible)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ // Initially returns false if none are selected. After the first selection, it may be required.
+ bool anySelected = false;
+ for (int i = 0; i < accessible->childCount(); ++i) {
+ if (QAccessibleInterface *child = accessible->child(i)) {
+ if (child->state().selected) {
+ anySelected = true;
+ break;
+ }
+ }
+ }
+
+ *pRetVal = anySelected && !accessible->state().multiSelectable && !accessible->state().extSelectable;
+ return S_OK;
+}
+
+QT_END_NAMESPACE
+
+#endif // QT_NO_ACCESSIBILITY
diff --git a/src/plugins/platforms/windows/uiautomation/qwindowsuiaselectionprovider.h b/src/plugins/platforms/windows/uiautomation/qwindowsuiaselectionprovider.h
new file mode 100644
index 0000000000..5a07a82ac8
--- /dev/null
+++ b/src/plugins/platforms/windows/uiautomation/qwindowsuiaselectionprovider.h
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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$
+**
+****************************************************************************/
+
+#ifndef QWINDOWSUIASELECTIONPROVIDER_H
+#define QWINDOWSUIASELECTIONPROVIDER_H
+
+#include <QtCore/QtConfig>
+#ifndef QT_NO_ACCESSIBILITY
+
+#include "qwindowsuiabaseprovider.h"
+
+QT_BEGIN_NAMESPACE
+
+// Implements the Selection control pattern provider. Used for Lists.
+class QWindowsUiaSelectionProvider : public QWindowsUiaBaseProvider,
+ public QWindowsComBase<ISelectionProvider>
+{
+ Q_DISABLE_COPY(QWindowsUiaSelectionProvider)
+public:
+ explicit QWindowsUiaSelectionProvider(QAccessible::Id id);
+ virtual ~QWindowsUiaSelectionProvider();
+
+ // ISelectionProvider
+ HRESULT STDMETHODCALLTYPE GetSelection(SAFEARRAY **pRetVal);
+ HRESULT STDMETHODCALLTYPE get_CanSelectMultiple(BOOL *pRetVal);
+ HRESULT STDMETHODCALLTYPE get_IsSelectionRequired(BOOL *pRetVal);
+};
+
+QT_END_NAMESPACE
+
+#endif // QT_NO_ACCESSIBILITY
+
+#endif // QWINDOWSUIASELECTIONPROVIDER_H
diff --git a/src/plugins/platforms/windows/uiautomation/qwindowsuiatableitemprovider.cpp b/src/plugins/platforms/windows/uiautomation/qwindowsuiatableitemprovider.cpp
new file mode 100644
index 0000000000..3ea29fc86c
--- /dev/null
+++ b/src/plugins/platforms/windows/uiautomation/qwindowsuiatableitemprovider.cpp
@@ -0,0 +1,129 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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 <QtCore/QtConfig>
+#ifndef QT_NO_ACCESSIBILITY
+
+#include "qwindowsuiatableitemprovider.h"
+#include "qwindowsuiamainprovider.h"
+#include "qwindowsuiautils.h"
+#include "qwindowscontext.h"
+
+#include <QtGui/QAccessible>
+#include <QtGui/QAccessibleInterface>
+#include <QtCore/QDebug>
+#include <QtCore/QString>
+
+QT_BEGIN_NAMESPACE
+
+using namespace QWindowsUiAutomation;
+
+
+QWindowsUiaTableItemProvider::QWindowsUiaTableItemProvider(QAccessible::Id id) :
+ QWindowsUiaBaseProvider(id)
+{
+}
+
+QWindowsUiaTableItemProvider::~QWindowsUiaTableItemProvider()
+{
+}
+
+// Returns the providers for the row headers associated with the item.
+HRESULT STDMETHODCALLTYPE QWindowsUiaTableItemProvider::GetRowHeaderItems(SAFEARRAY **pRetVal)
+{
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__;
+
+ if (!pRetVal)
+ return E_INVALIDARG;
+ *pRetVal = nullptr;
+
+ QAccessibleInterface *accessible = accessibleInterface();
+ if (!accessible)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ QAccessibleTableCellInterface *tableCellInterface = accessible->tableCellInterface();
+ if (!tableCellInterface)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ QList<QAccessibleInterface *> headers = tableCellInterface->rowHeaderCells();
+
+ if ((*pRetVal = SafeArrayCreateVector(VT_UNKNOWN, 0, headers.size()))) {
+ for (LONG i = 0; i < headers.size(); ++i) {
+ if (QWindowsUiaMainProvider *headerProvider = QWindowsUiaMainProvider::providerForAccessible(headers.at(i))) {
+ SafeArrayPutElement(*pRetVal, &i, static_cast<IRawElementProviderSimple *>(headerProvider));
+ headerProvider->Release();
+ }
+ }
+ }
+ return S_OK;
+}
+
+// Returns the providers for the column headers associated with the item.
+HRESULT STDMETHODCALLTYPE QWindowsUiaTableItemProvider::GetColumnHeaderItems(SAFEARRAY **pRetVal)
+{
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__;
+
+ if (!pRetVal)
+ return E_INVALIDARG;
+ *pRetVal = nullptr;
+
+ QAccessibleInterface *accessible = accessibleInterface();
+ if (!accessible)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ QAccessibleTableCellInterface *tableCellInterface = accessible->tableCellInterface();
+ if (!tableCellInterface)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ QList<QAccessibleInterface *> headers = tableCellInterface->columnHeaderCells();
+
+ if ((*pRetVal = SafeArrayCreateVector(VT_UNKNOWN, 0, headers.size()))) {
+ for (LONG i = 0; i < headers.size(); ++i) {
+ if (QWindowsUiaMainProvider *headerProvider = QWindowsUiaMainProvider::providerForAccessible(headers.at(i))) {
+ SafeArrayPutElement(*pRetVal, &i, static_cast<IRawElementProviderSimple *>(headerProvider));
+ headerProvider->Release();
+ }
+ }
+ }
+ return S_OK;
+}
+
+QT_END_NAMESPACE
+
+#endif // QT_NO_ACCESSIBILITY
diff --git a/src/plugins/platforms/windows/uiautomation/qwindowsuiatableitemprovider.h b/src/plugins/platforms/windows/uiautomation/qwindowsuiatableitemprovider.h
new file mode 100644
index 0000000000..277884c980
--- /dev/null
+++ b/src/plugins/platforms/windows/uiautomation/qwindowsuiatableitemprovider.h
@@ -0,0 +1,68 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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$
+**
+****************************************************************************/
+
+#ifndef QWINDOWSUIATABLEITEMPROVIDER_H
+#define QWINDOWSUIATABLEITEMPROVIDER_H
+
+#include <QtCore/QtConfig>
+#ifndef QT_NO_ACCESSIBILITY
+
+#include "qwindowsuiabaseprovider.h"
+
+QT_BEGIN_NAMESPACE
+
+// Implements the Table Item control pattern provider. Used by items within a table/tree.
+class QWindowsUiaTableItemProvider : public QWindowsUiaBaseProvider,
+ public QWindowsComBase<ITableItemProvider>
+{
+ Q_DISABLE_COPY(QWindowsUiaTableItemProvider)
+public:
+ explicit QWindowsUiaTableItemProvider(QAccessible::Id id);
+ virtual ~QWindowsUiaTableItemProvider();
+
+ // ITableItemProvider
+ HRESULT STDMETHODCALLTYPE GetRowHeaderItems(SAFEARRAY **pRetVal);
+ HRESULT STDMETHODCALLTYPE GetColumnHeaderItems(SAFEARRAY **pRetVal);
+};
+
+QT_END_NAMESPACE
+
+#endif // QT_NO_ACCESSIBILITY
+
+#endif // QWINDOWSUIATABLEITEMPROVIDER_H
diff --git a/src/plugins/platforms/windows/uiautomation/qwindowsuiatableprovider.cpp b/src/plugins/platforms/windows/uiautomation/qwindowsuiatableprovider.cpp
new file mode 100644
index 0000000000..f79a24536b
--- /dev/null
+++ b/src/plugins/platforms/windows/uiautomation/qwindowsuiatableprovider.cpp
@@ -0,0 +1,154 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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 <QtCore/QtConfig>
+#ifndef QT_NO_ACCESSIBILITY
+
+#include "qwindowsuiatableprovider.h"
+#include "qwindowsuiamainprovider.h"
+#include "qwindowsuiautils.h"
+#include "qwindowscontext.h"
+
+#include <QtGui/QAccessible>
+#include <QtGui/QAccessibleInterface>
+#include <QtCore/QDebug>
+#include <QtCore/QString>
+
+QT_BEGIN_NAMESPACE
+
+using namespace QWindowsUiAutomation;
+
+
+QWindowsUiaTableProvider::QWindowsUiaTableProvider(QAccessible::Id id) :
+ QWindowsUiaBaseProvider(id)
+{
+}
+
+QWindowsUiaTableProvider::~QWindowsUiaTableProvider()
+{
+}
+
+// Gets the providers for all the row headers in the table.
+HRESULT STDMETHODCALLTYPE QWindowsUiaTableProvider::GetRowHeaders(SAFEARRAY **pRetVal)
+{
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__;
+
+ if (!pRetVal)
+ return E_INVALIDARG;
+ *pRetVal = nullptr;
+
+ QAccessibleInterface *accessible = accessibleInterface();
+ if (!accessible)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ QAccessibleTableInterface *tableInterface = accessible->tableInterface();
+ if (!tableInterface)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ QList<QAccessibleInterface *> headers;
+
+ for (int i = 0; i < tableInterface->rowCount(); ++i) {
+ if (QAccessibleInterface *cell = tableInterface->cellAt(i, 0)) {
+ if (QAccessibleTableCellInterface *tableCellInterface = cell->tableCellInterface()) {
+ headers.append(tableCellInterface->rowHeaderCells());
+ }
+ }
+ }
+ if ((*pRetVal = SafeArrayCreateVector(VT_UNKNOWN, 0, headers.size()))) {
+ for (LONG i = 0; i < headers.size(); ++i) {
+ if (QWindowsUiaMainProvider *headerProvider = QWindowsUiaMainProvider::providerForAccessible(headers.at(i))) {
+ SafeArrayPutElement(*pRetVal, &i, static_cast<IRawElementProviderSimple *>(headerProvider));
+ headerProvider->Release();
+ }
+ }
+ }
+ return S_OK;
+}
+
+// Gets the providers for all the column headers in the table.
+HRESULT STDMETHODCALLTYPE QWindowsUiaTableProvider::GetColumnHeaders(SAFEARRAY **pRetVal)
+{
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__;
+
+ if (!pRetVal)
+ return E_INVALIDARG;
+ *pRetVal = nullptr;
+
+ QAccessibleInterface *accessible = accessibleInterface();
+ if (!accessible)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ QAccessibleTableInterface *tableInterface = accessible->tableInterface();
+ if (!tableInterface)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ QList<QAccessibleInterface *> headers;
+
+ for (int i = 0; i < tableInterface->columnCount(); ++i) {
+ if (QAccessibleInterface *cell = tableInterface->cellAt(0, i)) {
+ if (QAccessibleTableCellInterface *tableCellInterface = cell->tableCellInterface()) {
+ headers.append(tableCellInterface->columnHeaderCells());
+ }
+ }
+ }
+ if ((*pRetVal = SafeArrayCreateVector(VT_UNKNOWN, 0, headers.size()))) {
+ for (LONG i = 0; i < headers.size(); ++i) {
+ if (QWindowsUiaMainProvider *headerProvider = QWindowsUiaMainProvider::providerForAccessible(headers.at(i))) {
+ SafeArrayPutElement(*pRetVal, &i, static_cast<IRawElementProviderSimple *>(headerProvider));
+ headerProvider->Release();
+ }
+ }
+ }
+ return S_OK;
+}
+
+// Returns the primary direction of traversal for the table.
+HRESULT STDMETHODCALLTYPE QWindowsUiaTableProvider::get_RowOrColumnMajor(enum RowOrColumnMajor *pRetVal)
+{
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__;
+
+ if (!pRetVal)
+ return E_INVALIDARG;
+ *pRetVal = RowOrColumnMajor_Indeterminate;
+ return S_OK;
+}
+
+QT_END_NAMESPACE
+
+#endif // QT_NO_ACCESSIBILITY
diff --git a/src/plugins/platforms/windows/uiautomation/qwindowsuiatableprovider.h b/src/plugins/platforms/windows/uiautomation/qwindowsuiatableprovider.h
new file mode 100644
index 0000000000..8cd0acda03
--- /dev/null
+++ b/src/plugins/platforms/windows/uiautomation/qwindowsuiatableprovider.h
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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$
+**
+****************************************************************************/
+
+#ifndef QWINDOWSUIATABLEPROVIDER_H
+#define QWINDOWSUIATABLEPROVIDER_H
+
+#include <QtCore/QtConfig>
+#ifndef QT_NO_ACCESSIBILITY
+
+#include "qwindowsuiabaseprovider.h"
+
+QT_BEGIN_NAMESPACE
+
+// Implements the Table control pattern provider. Used by tables/trees.
+class QWindowsUiaTableProvider : public QWindowsUiaBaseProvider,
+ public QWindowsComBase<ITableProvider>
+{
+ Q_DISABLE_COPY(QWindowsUiaTableProvider)
+public:
+ explicit QWindowsUiaTableProvider(QAccessible::Id id);
+ virtual ~QWindowsUiaTableProvider();
+
+ // ITableProvider
+ HRESULT STDMETHODCALLTYPE GetRowHeaders(SAFEARRAY **pRetVal);
+ HRESULT STDMETHODCALLTYPE GetColumnHeaders(SAFEARRAY **pRetVal);
+ HRESULT STDMETHODCALLTYPE get_RowOrColumnMajor(enum RowOrColumnMajor *pRetVal);
+};
+
+QT_END_NAMESPACE
+
+#endif // QT_NO_ACCESSIBILITY
+
+#endif // QWINDOWSUIATABLEPROVIDER_H
diff --git a/src/plugins/platforms/windows/uiautomation/qwindowsuiatextprovider.cpp b/src/plugins/platforms/windows/uiautomation/qwindowsuiatextprovider.cpp
new file mode 100644
index 0000000000..e1622933af
--- /dev/null
+++ b/src/plugins/platforms/windows/uiautomation/qwindowsuiatextprovider.cpp
@@ -0,0 +1,261 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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 <QtCore/QtConfig>
+#ifndef QT_NO_ACCESSIBILITY
+
+#include "qwindowsuiatextprovider.h"
+#include "qwindowsuiautils.h"
+#include "qwindowscontext.h"
+
+#include <QtGui/QAccessible>
+#include <QtGui/QAccessibleInterface>
+#include <QtCore/QDebug>
+#include <QtCore/QString>
+
+QT_BEGIN_NAMESPACE
+
+using namespace QWindowsUiAutomation;
+
+
+QWindowsUiaTextProvider::QWindowsUiaTextProvider(QAccessible::Id id) :
+ QWindowsUiaBaseProvider(id)
+{
+}
+
+QWindowsUiaTextProvider::~QWindowsUiaTextProvider()
+{
+}
+
+HRESULT STDMETHODCALLTYPE QWindowsUiaTextProvider::QueryInterface(REFIID iid, LPVOID *iface)
+{
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__ << this;
+
+ if (!iface)
+ return E_INVALIDARG;
+ *iface = nullptr;
+
+ const bool result = qWindowsComQueryUnknownInterfaceMulti<ITextProvider>(this, iid, iface)
+ || qWindowsComQueryInterface<ITextProvider>(this, iid, iface)
+ || qWindowsComQueryInterface<ITextProvider2>(this, iid, iface);
+ return result ? S_OK : E_NOINTERFACE;
+}
+
+// Returns an array of providers for the selected text ranges.
+HRESULT STDMETHODCALLTYPE QWindowsUiaTextProvider::GetSelection(SAFEARRAY **pRetVal)
+{
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__ << this;
+
+ if (!pRetVal)
+ return E_INVALIDARG;
+ *pRetVal = nullptr;
+
+ QAccessibleInterface *accessible = accessibleInterface();
+ if (!accessible)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ QAccessibleTextInterface *textInterface = accessible->textInterface();
+ if (!textInterface)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ int selCount = textInterface->selectionCount();
+ if (selCount > 0) {
+ // Build a safe array with the text range providers.
+ if ((*pRetVal = SafeArrayCreateVector(VT_UNKNOWN, 0, selCount))) {
+ for (LONG i = 0; i < selCount; ++i) {
+ int startOffset = 0, endOffset = 0;
+ textInterface->selection((int)i, &startOffset, &endOffset);
+ QWindowsUiaTextRangeProvider *textRangeProvider = new QWindowsUiaTextRangeProvider(id(), startOffset, endOffset);
+ SafeArrayPutElement(*pRetVal, &i, static_cast<IUnknown *>(textRangeProvider));
+ textRangeProvider->Release();
+ }
+ }
+ } else {
+ // If there is no selection, we return an array with a single degenerate (empty) text range at the cursor position.
+ if ((*pRetVal = SafeArrayCreateVector(VT_UNKNOWN, 0, 1))) {
+ LONG i = 0;
+ int cursorPosition = textInterface->cursorPosition();
+ QWindowsUiaTextRangeProvider *textRangeProvider = new QWindowsUiaTextRangeProvider(id(), cursorPosition, cursorPosition);
+ SafeArrayPutElement(*pRetVal, &i, static_cast<IUnknown *>(textRangeProvider));
+ textRangeProvider->Release();
+ }
+ }
+ return S_OK;
+}
+
+// Returns an array of providers for the visible text ranges.
+HRESULT STDMETHODCALLTYPE QWindowsUiaTextProvider::GetVisibleRanges(SAFEARRAY **pRetVal)
+{
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__ << this;
+
+ if (!pRetVal)
+ return E_INVALIDARG;
+ *pRetVal = nullptr;
+
+ QAccessibleInterface *accessible = accessibleInterface();
+ if (!accessible)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ QAccessibleTextInterface *textInterface = accessible->textInterface();
+ if (!textInterface)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ // Considering the entire text as visible.
+ if ((*pRetVal = SafeArrayCreateVector(VT_UNKNOWN, 0, 1))) {
+ LONG i = 0;
+ QWindowsUiaTextRangeProvider *textRangeProvider = new QWindowsUiaTextRangeProvider(id(), 0, textInterface->characterCount());
+ SafeArrayPutElement(*pRetVal, &i, static_cast<IUnknown *>(textRangeProvider));
+ textRangeProvider->Release();
+ }
+ return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE QWindowsUiaTextProvider::RangeFromChild(IRawElementProviderSimple * /*childElement*/,
+ ITextRangeProvider **pRetVal)
+{
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__ << this;
+
+ if (!pRetVal)
+ return E_INVALIDARG;
+ *pRetVal = nullptr;
+ // No children supported.
+ return S_OK;
+}
+
+// Returns a degenerate text range at the specified point.
+HRESULT STDMETHODCALLTYPE QWindowsUiaTextProvider::RangeFromPoint(UiaPoint point, ITextRangeProvider **pRetVal)
+{
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__ << this;
+
+ if (!pRetVal)
+ return E_INVALIDARG;
+ *pRetVal = nullptr;
+
+ QAccessibleInterface *accessible = accessibleInterface();
+ if (!accessible)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ QAccessibleTextInterface *textInterface = accessible->textInterface();
+ if (!textInterface)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ QWindow *window = windowForAccessible(accessible);
+ if (!window)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ QPoint pt;
+ nativeUiaPointToPoint(point, window, &pt);
+
+ int offset = textInterface->offsetAtPoint(pt);
+ if ((offset >= 0) && (offset < textInterface->characterCount())) {
+ *pRetVal = new QWindowsUiaTextRangeProvider(id(), offset, offset);
+ }
+ return S_OK;
+}
+
+// Returns a text range provider for the entire text.
+HRESULT STDMETHODCALLTYPE QWindowsUiaTextProvider::get_DocumentRange(ITextRangeProvider **pRetVal)
+{
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__ << this;
+
+ if (!pRetVal)
+ return E_INVALIDARG;
+ *pRetVal = nullptr;
+
+ QAccessibleInterface *accessible = accessibleInterface();
+ if (!accessible)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ QAccessibleTextInterface *textInterface = accessible->textInterface();
+ if (!textInterface)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ *pRetVal = new QWindowsUiaTextRangeProvider(id(), 0, textInterface->characterCount());
+ return S_OK;
+}
+
+// Currently supporting single selection.
+HRESULT STDMETHODCALLTYPE QWindowsUiaTextProvider::get_SupportedTextSelection(SupportedTextSelection *pRetVal)
+{
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__ << this;
+
+ if (!pRetVal)
+ return E_INVALIDARG;
+ *pRetVal = SupportedTextSelection_Single;
+ return S_OK;
+}
+
+// Not supporting annotations.
+HRESULT STDMETHODCALLTYPE QWindowsUiaTextProvider::RangeFromAnnotation(IRawElementProviderSimple * /*annotationElement*/, ITextRangeProvider **pRetVal)
+{
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__ << this;
+
+ if (!pRetVal)
+ return E_INVALIDARG;
+ *pRetVal = nullptr;
+ return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE QWindowsUiaTextProvider::GetCaretRange(BOOL *isActive, ITextRangeProvider **pRetVal)
+{
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__ << this;
+
+ if (!isActive || !pRetVal)
+ return E_INVALIDARG;
+ *isActive = FALSE;
+ *pRetVal = nullptr;
+
+ QAccessibleInterface *accessible = accessibleInterface();
+ if (!accessible)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ QAccessibleTextInterface *textInterface = accessible->textInterface();
+ if (!textInterface)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ *isActive = accessible->state().focused;
+
+ int cursorPosition = textInterface->cursorPosition();
+ *pRetVal = new QWindowsUiaTextRangeProvider(id(), cursorPosition, cursorPosition);
+ return S_OK;
+}
+
+QT_END_NAMESPACE
+
+#endif // QT_NO_ACCESSIBILITY
diff --git a/src/plugins/platforms/windows/uiautomation/qwindowsuiatextprovider.h b/src/plugins/platforms/windows/uiautomation/qwindowsuiatextprovider.h
new file mode 100644
index 0000000000..a6d10027fa
--- /dev/null
+++ b/src/plugins/platforms/windows/uiautomation/qwindowsuiatextprovider.h
@@ -0,0 +1,80 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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$
+**
+****************************************************************************/
+
+#ifndef QWINDOWSUIATEXTPROVIDER_H
+#define QWINDOWSUIATEXTPROVIDER_H
+
+#include <QtCore/QtConfig>
+#ifndef QT_NO_ACCESSIBILITY
+
+#include "qwindowsuiabaseprovider.h"
+#include "qwindowsuiatextrangeprovider.h"
+
+QT_BEGIN_NAMESPACE
+
+// Implements the Text control pattern provider. Used for text controls.
+class QWindowsUiaTextProvider : public QWindowsUiaBaseProvider,
+ public QWindowsComBase<ITextProvider2>
+{
+ Q_DISABLE_COPY(QWindowsUiaTextProvider)
+public:
+ explicit QWindowsUiaTextProvider(QAccessible::Id id);
+ ~QWindowsUiaTextProvider();
+
+ // IUnknown overrides
+ HRESULT STDMETHODCALLTYPE QueryInterface(REFIID id, LPVOID *iface);
+
+ // ITextProvider
+ HRESULT STDMETHODCALLTYPE GetSelection(SAFEARRAY **pRetVal);
+ HRESULT STDMETHODCALLTYPE GetVisibleRanges(SAFEARRAY **pRetVal);
+ HRESULT STDMETHODCALLTYPE RangeFromChild(IRawElementProviderSimple *childElement, ITextRangeProvider **pRetVal);
+ HRESULT STDMETHODCALLTYPE RangeFromPoint(UiaPoint point, ITextRangeProvider **pRetVal);
+ HRESULT STDMETHODCALLTYPE get_DocumentRange(ITextRangeProvider **pRetVal);
+ HRESULT STDMETHODCALLTYPE get_SupportedTextSelection(SupportedTextSelection *pRetVal);
+
+ // ITextProvider2
+ HRESULT STDMETHODCALLTYPE RangeFromAnnotation(IRawElementProviderSimple *annotationElement, ITextRangeProvider **pRetVal);
+ HRESULT STDMETHODCALLTYPE GetCaretRange(BOOL *isActive, ITextRangeProvider **pRetVal);
+};
+
+QT_END_NAMESPACE
+
+#endif // QT_NO_ACCESSIBILITY
+
+#endif // QWINDOWSUIATEXTPROVIDER_H
diff --git a/src/plugins/platforms/windows/uiautomation/qwindowsuiatextrangeprovider.cpp b/src/plugins/platforms/windows/uiautomation/qwindowsuiatextrangeprovider.cpp
new file mode 100644
index 0000000000..dae7cbdd5f
--- /dev/null
+++ b/src/plugins/platforms/windows/uiautomation/qwindowsuiatextrangeprovider.cpp
@@ -0,0 +1,554 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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 <QtCore/QtConfig>
+#ifndef QT_NO_ACCESSIBILITY
+
+#include "qwindowsuiatextrangeprovider.h"
+#include "qwindowsuiamainprovider.h"
+#include "qwindowsuiautils.h"
+#include "qwindowscontext.h"
+
+#include <QtGui/QAccessible>
+#include <QtGui/QAccessibleInterface>
+#include <QtCore/QDebug>
+#include <QtCore/QString>
+
+QT_BEGIN_NAMESPACE
+
+using namespace QWindowsUiAutomation;
+
+
+QWindowsUiaTextRangeProvider::QWindowsUiaTextRangeProvider(QAccessible::Id id, int startOffset, int endOffset) :
+ QWindowsUiaBaseProvider(id),
+ m_startOffset(startOffset),
+ m_endOffset(endOffset)
+{
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__ << this << startOffset << endOffset;
+}
+
+QWindowsUiaTextRangeProvider::~QWindowsUiaTextRangeProvider()
+{
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__ << this;
+}
+
+HRESULT QWindowsUiaTextRangeProvider::AddToSelection()
+{
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__ << this;
+ return Select();
+}
+
+HRESULT QWindowsUiaTextRangeProvider::Clone(ITextRangeProvider **pRetVal)
+{
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__ << this;
+
+ if (!pRetVal)
+ return E_INVALIDARG;
+
+ *pRetVal = new QWindowsUiaTextRangeProvider(id(), m_startOffset, m_endOffset);
+ return S_OK;
+}
+
+// Two ranges are considered equal if their start/end points are the same.
+HRESULT QWindowsUiaTextRangeProvider::Compare(ITextRangeProvider *range, BOOL *pRetVal)
+{
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__ << this;
+
+ if (!range || !pRetVal)
+ return E_INVALIDARG;
+
+ QWindowsUiaTextRangeProvider *targetProvider = static_cast<QWindowsUiaTextRangeProvider *>(range);
+ *pRetVal = ((targetProvider->m_startOffset == m_startOffset) && (targetProvider->m_endOffset == m_endOffset));
+ return S_OK;
+}
+
+// Compare different endpoinds between two providers.
+HRESULT QWindowsUiaTextRangeProvider::CompareEndpoints(TextPatternRangeEndpoint endpoint,
+ ITextRangeProvider *targetRange,
+ TextPatternRangeEndpoint targetEndpoint,
+ int *pRetVal)
+{
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__
+ << "endpoint=" << endpoint << "targetRange=" << targetRange
+ << "targetEndpoint=" << targetEndpoint << "this: " << this;
+
+ if (!targetRange || !pRetVal)
+ return E_INVALIDARG;
+
+ QWindowsUiaTextRangeProvider *targetProvider = static_cast<QWindowsUiaTextRangeProvider *>(targetRange);
+
+ int point = (endpoint == TextPatternRangeEndpoint_Start) ? m_startOffset : m_endOffset;
+ int targetPoint = (targetEndpoint == TextPatternRangeEndpoint_Start) ?
+ targetProvider->m_startOffset : targetProvider->m_endOffset;
+ *pRetVal = point - targetPoint;
+ return S_OK;
+}
+
+// Expands/normalizes the range for a given text unit.
+HRESULT QWindowsUiaTextRangeProvider::ExpandToEnclosingUnit(TextUnit unit)
+{
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__ << "unit=" << unit << "this: " << this;
+
+ QAccessibleInterface *accessible = accessibleInterface();
+ if (!accessible)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ QAccessibleTextInterface *textInterface = accessible->textInterface();
+ if (!textInterface)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ int len = textInterface->characterCount();
+ if (len < 1) {
+ m_startOffset = 0;
+ m_endOffset = 0;
+ } else {
+ if (unit == TextUnit_Character) {
+ m_startOffset = qBound(0, m_startOffset, len - 1);
+ m_endOffset = m_startOffset + 1;
+ } else {
+ QString text = textInterface->text(0, len);
+ for (int t = m_startOffset; t >= 0; --t) {
+ if (!isTextUnitSeparator(unit, text[t]) && ((t == 0) || isTextUnitSeparator(unit, text[t - 1]))) {
+ m_startOffset = t;
+ break;
+ }
+ }
+ for (int t = m_startOffset; t < len; ++t) {
+ if ((t == len - 1) || (isTextUnitSeparator(unit, text[t]) && ((unit == TextUnit_Word) || !isTextUnitSeparator(unit, text[t + 1])))) {
+ m_endOffset = t + 1;
+ break;
+ }
+ }
+ }
+ }
+ return S_OK;
+}
+
+// Not supported.
+HRESULT QWindowsUiaTextRangeProvider::FindAttribute(TEXTATTRIBUTEID /* attributeId */,
+ VARIANT /* val */, BOOL /* backward */,
+ ITextRangeProvider **pRetVal)
+{
+ if (!pRetVal)
+ return E_INVALIDARG;
+ *pRetVal = nullptr;
+ return S_OK;
+}
+
+// Returns the value of a given attribute.
+HRESULT STDMETHODCALLTYPE QWindowsUiaTextRangeProvider::GetAttributeValue(TEXTATTRIBUTEID attributeId,
+ VARIANT *pRetVal)
+{
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__ << "attributeId=" << attributeId << "this: " << this;
+
+ if (!pRetVal)
+ return E_INVALIDARG;
+ clearVariant(pRetVal);
+
+ QAccessibleInterface *accessible = accessibleInterface();
+ if (!accessible)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ QAccessibleTextInterface *textInterface = accessible->textInterface();
+ if (!textInterface)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ switch (attributeId) {
+ case UIA_IsReadOnlyAttributeId:
+ setVariantBool(accessible->state().readOnly, pRetVal);
+ break;
+ case UIA_CaretPositionAttributeId:
+ if (textInterface->cursorPosition() == 0)
+ setVariantI4(CaretPosition_BeginningOfLine, pRetVal);
+ else if (textInterface->cursorPosition() == textInterface->characterCount())
+ setVariantI4(CaretPosition_EndOfLine, pRetVal);
+ else
+ setVariantI4(CaretPosition_Unknown, pRetVal);
+ break;
+ default:
+ break;
+ }
+ return S_OK;
+}
+
+// Returns an array of bounding rectangles for text lines within the range.
+HRESULT QWindowsUiaTextRangeProvider::GetBoundingRectangles(SAFEARRAY **pRetVal)
+{
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__ << this;
+
+ if (!pRetVal)
+ return E_INVALIDARG;
+
+ QAccessibleInterface *accessible = accessibleInterface();
+ if (!accessible)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ QAccessibleTextInterface *textInterface = accessible->textInterface();
+ if (!textInterface)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ QWindow *window = windowForAccessible(accessible);
+ if (!window)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ int len = textInterface->characterCount();
+ QList<QRect> rectList;
+
+ if ((m_startOffset >= 0) && (m_endOffset <= len) && (m_startOffset < m_endOffset)) {
+ int start, end;
+ textInterface->textAtOffset(m_startOffset, QAccessible::LineBoundary, &start, &end);
+ while ((start >= 0) && (end >= 0)) {
+ int startRange = qMax(start, m_startOffset);
+ int endRange = qMin(end, m_endOffset);
+ if (startRange < endRange) {
+ // Calculates a bounding rectangle for the line and adds it to the list.
+ QRect startRect = textInterface->characterRect(startRange);
+ QRect endRect = textInterface->characterRect(endRange - 1);
+ QRect lineRect(qMin(startRect.x(), endRect.x()),
+ qMin(startRect.y(), endRect.y()),
+ qMax(startRect.x() + startRect.width(), endRect.x() + endRect.width()) - qMin(startRect.x(), endRect.x()),
+ qMax(startRect.y() + startRect.height(), endRect.y() + endRect.height()) - qMin(startRect.y(), endRect.y()));
+ rectList.append(lineRect);
+ }
+ if (end >= len) break;
+ textInterface->textAfterOffset(end + 1, QAccessible::LineBoundary, &start, &end);
+ }
+ }
+
+ if ((*pRetVal = SafeArrayCreateVector(VT_R8, 0, 4 * rectList.size()))) {
+ for (int i = 0; i < rectList.size(); ++i) {
+ // Scale rect for high DPI screens.
+ UiaRect uiaRect;
+ rectToNativeUiaRect(rectList[i], window, &uiaRect);
+ double coords[4] = { uiaRect.left, uiaRect.top, uiaRect.width, uiaRect.height };
+ for (int j = 0; j < 4; ++j) {
+ LONG idx = 4 * i + j;
+ SafeArrayPutElement(*pRetVal, &idx, &coords[j]);
+ }
+ }
+ }
+ return S_OK;
+}
+
+// Returns an array of children elements embedded within the range.
+HRESULT QWindowsUiaTextRangeProvider::GetChildren(SAFEARRAY **pRetVal)
+{
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__ << this;
+
+ if (!pRetVal)
+ return E_INVALIDARG;
+ // Not supporting any children.
+ *pRetVal = SafeArrayCreateVector(VT_UNKNOWN, 0, 0);
+ return S_OK;
+}
+
+// Returns a provider for the enclosing element (text to which the range belongs).
+HRESULT QWindowsUiaTextRangeProvider::GetEnclosingElement(IRawElementProviderSimple **pRetVal)
+{
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__ << this;
+
+ if (!pRetVal)
+ return E_INVALIDARG;
+
+ QAccessibleInterface *accessible = accessibleInterface();
+ if (!accessible)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ *pRetVal = QWindowsUiaMainProvider::providerForAccessible(accessible);
+ return S_OK;
+}
+
+// Gets the text within the range.
+HRESULT QWindowsUiaTextRangeProvider::GetText(int maxLength, BSTR *pRetVal)
+{
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__ << maxLength << "this: " << this;
+
+ if (!pRetVal)
+ return E_INVALIDARG;
+ *pRetVal = nullptr;
+
+ QAccessibleInterface *accessible = accessibleInterface();
+ if (!accessible)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ QAccessibleTextInterface *textInterface = accessible->textInterface();
+ if (!textInterface)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ int len = textInterface->characterCount();
+ QString rangeText;
+ if ((m_startOffset >= 0) && (m_endOffset <= len) && (m_startOffset < m_endOffset))
+ rangeText = textInterface->text(m_startOffset, m_endOffset);
+
+ if ((maxLength > -1) && (rangeText.size() > maxLength))
+ rangeText.truncate(maxLength);
+ *pRetVal = bStrFromQString(rangeText);
+ return S_OK;
+}
+
+// Moves the range a specified number of units (and normalizes it).
+HRESULT QWindowsUiaTextRangeProvider::Move(TextUnit unit, int count, int *pRetVal)
+{
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__ << "unit=" << unit << "count=" << count << "this: " << this;
+
+ if (!pRetVal)
+ return E_INVALIDARG;
+ *pRetVal = 0;
+
+ QAccessibleInterface *accessible = accessibleInterface();
+ if (!accessible)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ QAccessibleTextInterface *textInterface = accessible->textInterface();
+ if (!textInterface)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ int len = textInterface->characterCount();
+
+ if (len < 1)
+ return S_OK;
+
+ if (unit == TextUnit_Character) {
+ // Moves the start point, ensuring it lies within the bounds.
+ int start = qBound(0, m_startOffset + count, len - 1);
+ // If range was initially empty, leaves it as is; otherwise, normalizes it to one char.
+ m_endOffset = (m_endOffset > m_startOffset) ? start + 1 : start;
+ *pRetVal = start - m_startOffset; // Returns the actually moved distance.
+ m_startOffset = start;
+ } else {
+ if (count > 0) {
+ MoveEndpointByUnit(TextPatternRangeEndpoint_End, unit, count, pRetVal);
+ MoveEndpointByUnit(TextPatternRangeEndpoint_Start, unit, count, pRetVal);
+ } else {
+ MoveEndpointByUnit(TextPatternRangeEndpoint_Start, unit, count, pRetVal);
+ MoveEndpointByUnit(TextPatternRangeEndpoint_End, unit, count, pRetVal);
+ }
+ }
+ return S_OK;
+}
+
+// Copies the value of an end point from one range to another.
+HRESULT QWindowsUiaTextRangeProvider::MoveEndpointByRange(TextPatternRangeEndpoint endpoint,
+ ITextRangeProvider *targetRange,
+ TextPatternRangeEndpoint targetEndpoint)
+{
+ if (!targetRange)
+ return E_INVALIDARG;
+
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__
+ << "endpoint=" << endpoint << "targetRange=" << targetRange << "targetEndpoint=" << targetEndpoint << "this: " << this;
+
+ QWindowsUiaTextRangeProvider *targetProvider = static_cast<QWindowsUiaTextRangeProvider *>(targetRange);
+
+ int targetPoint = (targetEndpoint == TextPatternRangeEndpoint_Start) ?
+ targetProvider->m_startOffset : targetProvider->m_endOffset;
+
+ // If the moved endpoint crosses the other endpoint, that one is moved too.
+ if (endpoint == TextPatternRangeEndpoint_Start) {
+ m_startOffset = targetPoint;
+ if (m_endOffset < m_startOffset)
+ m_endOffset = m_startOffset;
+ } else {
+ m_endOffset = targetPoint;
+ if (m_endOffset < m_startOffset)
+ m_startOffset = m_endOffset;
+ }
+ return S_OK;
+}
+
+// Moves an endpoint an specific number of units.
+HRESULT QWindowsUiaTextRangeProvider::MoveEndpointByUnit(TextPatternRangeEndpoint endpoint,
+ TextUnit unit, int count,
+ int *pRetVal)
+{
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__
+ << "endpoint=" << endpoint << "unit=" << unit << "count=" << count << "this: " << this;
+
+ if (!pRetVal)
+ return E_INVALIDARG;
+ *pRetVal = 0;
+
+ QAccessibleInterface *accessible = accessibleInterface();
+ if (!accessible)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ QAccessibleTextInterface *textInterface = accessible->textInterface();
+ if (!textInterface)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ int len = textInterface->characterCount();
+
+ if (len < 1)
+ return S_OK;
+
+ if (unit == TextUnit_Character) {
+ if (endpoint == TextPatternRangeEndpoint_Start) {
+ int boundedValue = qBound(0, m_startOffset + count, len - 1);
+ *pRetVal = boundedValue - m_startOffset;
+ m_startOffset = boundedValue;
+ m_endOffset = qBound(m_startOffset, m_endOffset, len);
+ } else {
+ int boundedValue = qBound(0, m_endOffset + count, len);
+ *pRetVal = boundedValue - m_endOffset;
+ m_endOffset = boundedValue;
+ m_startOffset = qBound(0, m_startOffset, m_endOffset);
+ }
+ } else {
+ QString text = textInterface->text(0, len);
+ int moved = 0;
+
+ if (endpoint == TextPatternRangeEndpoint_Start) {
+ if (count > 0) {
+ for (int t = m_startOffset; (t < len - 1) && (moved < count); ++t) {
+ if (isTextUnitSeparator(unit, text[t]) && !isTextUnitSeparator(unit, text[t + 1])) {
+ m_startOffset = t + 1;
+ ++moved;
+ }
+ }
+ m_endOffset = qBound(m_startOffset, m_endOffset, len);
+ } else {
+ for (int t = m_startOffset - 1; (t >= 0) && (moved > count); --t) {
+ if (!isTextUnitSeparator(unit, text[t]) && ((t == 0) || isTextUnitSeparator(unit, text[t - 1]))) {
+ m_startOffset = t;
+ --moved;
+ }
+ }
+ }
+ } else {
+ if (count > 0) {
+ for (int t = m_endOffset; (t < len) && (moved < count); ++t) {
+ if ((t == len - 1) || (isTextUnitSeparator(unit, text[t]) && ((unit == TextUnit_Word) || !isTextUnitSeparator(unit, text[t + 1])))) {
+ m_endOffset = t + 1;
+ ++moved;
+ }
+ }
+ } else {
+ int end = 0;
+ for (int t = m_endOffset - 2; (t > 0) && (moved > count); --t) {
+ if (isTextUnitSeparator(unit, text[t]) && ((unit == TextUnit_Word) || !isTextUnitSeparator(unit, text[t + 1]))) {
+ end = t + 1;
+ --moved;
+ }
+ }
+ m_endOffset = end;
+ m_startOffset = qBound(0, m_startOffset, m_endOffset);
+ }
+ }
+ *pRetVal = moved;
+ }
+ return S_OK;
+}
+
+HRESULT QWindowsUiaTextRangeProvider::RemoveFromSelection()
+{
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__;
+ // unselects all
+ return unselect();
+}
+
+// Scrolls the range into view.
+HRESULT QWindowsUiaTextRangeProvider::ScrollIntoView(BOOL alignToTop)
+{
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__ << "alignToTop=" << alignToTop << "this: " << this;
+
+ QAccessibleInterface *accessible = accessibleInterface();
+ if (!accessible)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ QAccessibleTextInterface *textInterface = accessible->textInterface();
+ if (!textInterface)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ textInterface->scrollToSubstring(m_startOffset, m_endOffset);
+ return S_OK;
+}
+
+// Selects the range.
+HRESULT QWindowsUiaTextRangeProvider::Select()
+{
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__ << this;
+
+ QAccessibleInterface *accessible = accessibleInterface();
+ if (!accessible)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ QAccessibleTextInterface *textInterface = accessible->textInterface();
+ if (!textInterface)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ // unselects all and adds a new selection
+ unselect();
+ textInterface->addSelection(m_startOffset, m_endOffset);
+ return S_OK;
+}
+
+// Not supported.
+HRESULT QWindowsUiaTextRangeProvider::FindTextW(BSTR /* text */, BOOL /* backward */,
+ BOOL /* ignoreCase */,
+ ITextRangeProvider **pRetVal)
+{
+ if (!pRetVal)
+ return E_INVALIDARG;
+ *pRetVal = nullptr;
+ return S_OK;
+}
+
+// Removes all selected ranges from the text element.
+HRESULT QWindowsUiaTextRangeProvider::unselect()
+{
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__ << this;
+
+ QAccessibleInterface *accessible = accessibleInterface();
+ if (!accessible)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ QAccessibleTextInterface *textInterface = accessible->textInterface();
+ if (!textInterface)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ int selCount = textInterface->selectionCount();
+
+ for (int i = selCount - 1; i >= 0; --i)
+ textInterface->removeSelection(i);
+ return S_OK;
+}
+
+QT_END_NAMESPACE
+
+#endif // QT_NO_ACCESSIBILITY
diff --git a/src/plugins/platforms/windows/uiautomation/qwindowsuiatextrangeprovider.h b/src/plugins/platforms/windows/uiautomation/qwindowsuiatextrangeprovider.h
new file mode 100644
index 0000000000..6fe6502c41
--- /dev/null
+++ b/src/plugins/platforms/windows/uiautomation/qwindowsuiatextrangeprovider.h
@@ -0,0 +1,88 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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$
+**
+****************************************************************************/
+
+#ifndef QWINDOWSUIATEXTRANGEPROVIDER_H
+#define QWINDOWSUIATEXTRANGEPROVIDER_H
+
+#include <QtCore/QtConfig>
+#ifndef QT_NO_ACCESSIBILITY
+
+#include "qwindowsuiabaseprovider.h"
+
+QT_BEGIN_NAMESPACE
+
+// Implements the Text Range control pattern provider. Used for text controls.
+class QWindowsUiaTextRangeProvider : public QWindowsUiaBaseProvider,
+ public QWindowsComBase<ITextRangeProvider>
+{
+ Q_DISABLE_COPY(QWindowsUiaTextRangeProvider)
+public:
+ explicit QWindowsUiaTextRangeProvider(QAccessible::Id id, int startOffset, int endOffset);
+ virtual ~QWindowsUiaTextRangeProvider();
+
+ HRESULT STDMETHODCALLTYPE AddToSelection();
+ HRESULT STDMETHODCALLTYPE Clone(ITextRangeProvider **pRetVal);
+ HRESULT STDMETHODCALLTYPE Compare(ITextRangeProvider *range, BOOL *pRetVal);
+ HRESULT STDMETHODCALLTYPE CompareEndpoints(TextPatternRangeEndpoint endpoint, ITextRangeProvider *targetRange, TextPatternRangeEndpoint targetEndpoint, int *pRetVal);
+ HRESULT STDMETHODCALLTYPE ExpandToEnclosingUnit(TextUnit unit);
+ HRESULT STDMETHODCALLTYPE FindAttribute(TEXTATTRIBUTEID attributeId, VARIANT val, BOOL backward, ITextRangeProvider **pRetVal);
+ HRESULT STDMETHODCALLTYPE FindText(BSTR text, BOOL backward, BOOL ignoreCase, ITextRangeProvider **pRetVal);
+ HRESULT STDMETHODCALLTYPE GetAttributeValue(TEXTATTRIBUTEID attributeId, VARIANT *pRetVal);
+ HRESULT STDMETHODCALLTYPE GetBoundingRectangles(SAFEARRAY **pRetVal);
+ HRESULT STDMETHODCALLTYPE GetChildren(SAFEARRAY **pRetVal);
+ HRESULT STDMETHODCALLTYPE GetEnclosingElement(IRawElementProviderSimple **pRetVal);
+ HRESULT STDMETHODCALLTYPE GetText(int maxLength, BSTR *pRetVal);
+ HRESULT STDMETHODCALLTYPE Move(TextUnit unit, int count, int *pRetVal);
+ HRESULT STDMETHODCALLTYPE MoveEndpointByRange(TextPatternRangeEndpoint endpoint, ITextRangeProvider *targetRange, TextPatternRangeEndpoint targetEndpoint);
+ HRESULT STDMETHODCALLTYPE MoveEndpointByUnit(TextPatternRangeEndpoint endpoint, TextUnit unit, int count, int *pRetVal);
+ HRESULT STDMETHODCALLTYPE RemoveFromSelection();
+ HRESULT STDMETHODCALLTYPE ScrollIntoView(BOOL alignToTop);
+ HRESULT STDMETHODCALLTYPE Select();
+
+private:
+ HRESULT unselect();
+ int m_startOffset;
+ int m_endOffset;
+};
+
+QT_END_NAMESPACE
+
+#endif // QT_NO_ACCESSIBILITY
+
+#endif // QWINDOWSUIATEXTRANGEPROVIDER_H
diff --git a/src/plugins/platforms/windows/uiautomation/qwindowsuiatoggleprovider.cpp b/src/plugins/platforms/windows/uiautomation/qwindowsuiatoggleprovider.cpp
new file mode 100644
index 0000000000..01cdfd7e91
--- /dev/null
+++ b/src/plugins/platforms/windows/uiautomation/qwindowsuiatoggleprovider.cpp
@@ -0,0 +1,105 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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 <QtCore/QtConfig>
+#ifndef QT_NO_ACCESSIBILITY
+
+#include "qwindowsuiatoggleprovider.h"
+#include "qwindowsuiautils.h"
+#include "qwindowscontext.h"
+
+#include <QtGui/QAccessible>
+#include <QtGui/QAccessibleInterface>
+#include <QtCore/QDebug>
+#include <QtCore/QString>
+
+QT_BEGIN_NAMESPACE
+
+using namespace QWindowsUiAutomation;
+
+
+QWindowsUiaToggleProvider::QWindowsUiaToggleProvider(QAccessible::Id id) :
+ QWindowsUiaBaseProvider(id)
+{
+}
+
+QWindowsUiaToggleProvider::~QWindowsUiaToggleProvider()
+{
+}
+
+// toggles the state by invoking the toggle action
+HRESULT STDMETHODCALLTYPE QWindowsUiaToggleProvider::Toggle()
+{
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__;
+
+ QAccessibleInterface *accessible = accessibleInterface();
+ if (!accessible)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ QAccessibleActionInterface *actionInterface = accessible->actionInterface();
+ if (!actionInterface)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ actionInterface->doAction(QAccessibleActionInterface::toggleAction());
+ return S_OK;
+}
+
+// Gets the current toggle state.
+HRESULT STDMETHODCALLTYPE QWindowsUiaToggleProvider::get_ToggleState(ToggleState *pRetVal)
+{
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__;
+
+ if (!pRetVal)
+ return E_INVALIDARG;
+ *pRetVal = ToggleState_Off;
+
+ QAccessibleInterface *accessible = accessibleInterface();
+ if (!accessible)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ if (accessible->state().checked)
+ *pRetVal = accessible->state().checkStateMixed ? ToggleState_Indeterminate : ToggleState_On;
+ else
+ *pRetVal = ToggleState_Off;
+ return S_OK;
+}
+
+QT_END_NAMESPACE
+
+#endif // QT_NO_ACCESSIBILITY
diff --git a/src/plugins/platforms/windows/uiautomation/qwindowsuiatoggleprovider.h b/src/plugins/platforms/windows/uiautomation/qwindowsuiatoggleprovider.h
new file mode 100644
index 0000000000..a0df983e40
--- /dev/null
+++ b/src/plugins/platforms/windows/uiautomation/qwindowsuiatoggleprovider.h
@@ -0,0 +1,68 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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$
+**
+****************************************************************************/
+
+#ifndef QWINDOWSUIATOGGLEPROVIDER_H
+#define QWINDOWSUIATOGGLEPROVIDER_H
+
+#include <QtCore/QtConfig>
+#ifndef QT_NO_ACCESSIBILITY
+
+#include "qwindowsuiabaseprovider.h"
+
+QT_BEGIN_NAMESPACE
+
+// Implements the Toggle control pattern provider. Used for checkboxes.
+class QWindowsUiaToggleProvider : public QWindowsUiaBaseProvider,
+ public QWindowsComBase<IToggleProvider>
+{
+ Q_DISABLE_COPY(QWindowsUiaToggleProvider)
+public:
+ explicit QWindowsUiaToggleProvider(QAccessible::Id id);
+ virtual ~QWindowsUiaToggleProvider();
+
+ // IToggleProvider
+ HRESULT STDMETHODCALLTYPE Toggle();
+ HRESULT STDMETHODCALLTYPE get_ToggleState(ToggleState *pRetVal);
+};
+
+QT_END_NAMESPACE
+
+#endif // QT_NO_ACCESSIBILITY
+
+#endif // QWINDOWSUIATOGGLEPROVIDER_H
diff --git a/src/plugins/platforms/windows/uiautomation/qwindowsuiautils.cpp b/src/plugins/platforms/windows/uiautomation/qwindowsuiautils.cpp
new file mode 100644
index 0000000000..89e5075dcb
--- /dev/null
+++ b/src/plugins/platforms/windows/uiautomation/qwindowsuiautils.cpp
@@ -0,0 +1,221 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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 <QtCore/QtConfig>
+#ifndef QT_NO_ACCESSIBILITY
+
+#include "qwindowsuiautils.h"
+#include "qwindowscontext.h"
+#include "qwindowswindow.h"
+
+#include <QtGui/QWindow>
+#include <QtGui/private/qhighdpiscaling_p.h>
+#include <cmath>
+
+QT_BEGIN_NAMESPACE
+
+namespace QWindowsUiAutomation {
+
+// Returns the window containing the element (usually the top window),
+QWindow *windowForAccessible(const QAccessibleInterface *accessible)
+{
+ QWindow *window = accessible->window();
+ if (!window) {
+ QAccessibleInterface *acc = accessible->parent();
+ while (acc && acc->isValid() && !window) {
+ window = acc->window();
+ QAccessibleInterface *par = acc->parent();
+ acc = par;
+ }
+ }
+ return window;
+}
+
+// Returns the native window handle associated with the element, if any.
+// Usually it will be NULL, as Qt5 by default uses alien widgets with no native windows.
+HWND hwndForAccessible(const QAccessibleInterface *accessible)
+{
+ if (QWindow *window = accessible->window()) {
+ if (!accessible->parent() || (accessible->parent()->window() != window)) {
+ return QWindowsBaseWindow::handleOf(window);
+ }
+ }
+ return NULL;
+}
+
+void clearVariant(VARIANT *variant)
+{
+ variant->vt = VT_EMPTY;
+ variant->punkVal = nullptr;
+}
+
+void setVariantI4(int value, VARIANT *variant)
+{
+ variant->vt = VT_I4;
+ variant->lVal = value;
+}
+
+void setVariantBool(bool value, VARIANT *variant)
+{
+ variant->vt = VT_BOOL;
+ variant->boolVal = value ? -1 : 0;
+}
+
+void setVariantDouble(double value, VARIANT *variant)
+{
+ variant->vt = VT_R8;
+ variant->boolVal = value;
+}
+
+BSTR bStrFromQString(const QString &value)
+{
+ return SysAllocString(reinterpret_cast<const wchar_t *>(value.utf16()));
+}
+
+void setVariantString(const QString &value, VARIANT *variant)
+{
+ variant->vt = VT_BSTR;
+ variant->bstrVal = bStrFromQString(value);
+}
+
+// Scales a rect to native coordinates, according to high dpi settings.
+void rectToNativeUiaRect(const QRect &rect, const QWindow *w, UiaRect *uiaRect)
+{
+ if (w && uiaRect) {
+ const qreal factor = QHighDpiScaling::factor(w);
+ uiaRect->left = qreal(rect.x()) * factor;
+ uiaRect->top = qreal(rect.y()) * factor;
+ uiaRect->width = qreal(rect.width()) * factor;
+ uiaRect->height = qreal(rect.height()) * factor;
+ }
+}
+
+// Scales a point from native coordinates, according to high dpi settings.
+void nativeUiaPointToPoint(const UiaPoint &uiaPoint, const QWindow *w, QPoint *point)
+{
+ if (w && point) {
+ const qreal factor = QHighDpiScaling::factor(w);
+ point->setX(int(std::lround(uiaPoint.x / factor)));
+ point->setY(int(std::lround(uiaPoint.y / factor)));
+ }
+}
+
+// Maps an accessibility role ID to an UI Automation control type ID.
+long roleToControlTypeId(QAccessible::Role role)
+{
+ static const QHash<QAccessible::Role, long> mapping {
+ {QAccessible::TitleBar, UIA_TitleBarControlTypeId},
+ {QAccessible::MenuBar, UIA_MenuBarControlTypeId},
+ {QAccessible::ScrollBar, UIA_ScrollBarControlTypeId},
+ {QAccessible::Grip, UIA_ThumbControlTypeId},
+ {QAccessible::Sound, UIA_CustomControlTypeId},
+ {QAccessible::Cursor, UIA_CustomControlTypeId},
+ {QAccessible::Caret, UIA_CustomControlTypeId},
+ {QAccessible::AlertMessage, UIA_CustomControlTypeId},
+ {QAccessible::Window, UIA_WindowControlTypeId},
+ {QAccessible::Client, UIA_CustomControlTypeId},
+ {QAccessible::PopupMenu, UIA_MenuControlTypeId},
+ {QAccessible::MenuItem, UIA_MenuItemControlTypeId},
+ {QAccessible::ToolTip, UIA_ToolTipControlTypeId},
+ {QAccessible::Application, UIA_CustomControlTypeId},
+ {QAccessible::Document, UIA_DocumentControlTypeId},
+ {QAccessible::Pane, UIA_PaneControlTypeId},
+ {QAccessible::Chart, UIA_CustomControlTypeId},
+ {QAccessible::Dialog, UIA_WindowControlTypeId},
+ {QAccessible::Border, UIA_CustomControlTypeId},
+ {QAccessible::Grouping, UIA_GroupControlTypeId},
+ {QAccessible::Separator, UIA_SeparatorControlTypeId},
+ {QAccessible::ToolBar, UIA_ToolBarControlTypeId},
+ {QAccessible::StatusBar, UIA_StatusBarControlTypeId},
+ {QAccessible::Table, UIA_TableControlTypeId},
+ {QAccessible::ColumnHeader, UIA_HeaderControlTypeId},
+ {QAccessible::RowHeader, UIA_HeaderControlTypeId},
+ {QAccessible::Column, UIA_HeaderItemControlTypeId},
+ {QAccessible::Row, UIA_HeaderItemControlTypeId},
+ {QAccessible::Cell, UIA_DataItemControlTypeId},
+ {QAccessible::Link, UIA_HyperlinkControlTypeId},
+ {QAccessible::HelpBalloon, UIA_ToolTipControlTypeId},
+ {QAccessible::Assistant, UIA_CustomControlTypeId},
+ {QAccessible::List, UIA_ListControlTypeId},
+ {QAccessible::ListItem, UIA_ListItemControlTypeId},
+ {QAccessible::Tree, UIA_TreeControlTypeId},
+ {QAccessible::TreeItem, UIA_TreeItemControlTypeId},
+ {QAccessible::PageTab, UIA_TabItemControlTypeId},
+ {QAccessible::PropertyPage, UIA_CustomControlTypeId},
+ {QAccessible::Indicator, UIA_CustomControlTypeId},
+ {QAccessible::Graphic, UIA_ImageControlTypeId},
+ {QAccessible::StaticText, UIA_EditControlTypeId},
+ {QAccessible::EditableText, UIA_EditControlTypeId},
+ {QAccessible::Button, UIA_ButtonControlTypeId},
+ {QAccessible::CheckBox, UIA_CheckBoxControlTypeId},
+ {QAccessible::RadioButton, UIA_RadioButtonControlTypeId},
+ {QAccessible::ComboBox, UIA_ComboBoxControlTypeId},
+ {QAccessible::ProgressBar, UIA_ProgressBarControlTypeId},
+ {QAccessible::Dial, UIA_CustomControlTypeId},
+ {QAccessible::HotkeyField, UIA_CustomControlTypeId},
+ {QAccessible::Slider, UIA_SliderControlTypeId},
+ {QAccessible::SpinBox, UIA_SpinnerControlTypeId},
+ {QAccessible::Canvas, UIA_CustomControlTypeId},
+ {QAccessible::Animation, UIA_CustomControlTypeId},
+ {QAccessible::Equation, UIA_CustomControlTypeId},
+ {QAccessible::ButtonDropDown, UIA_ButtonControlTypeId},
+ {QAccessible::ButtonMenu, UIA_ButtonControlTypeId},
+ {QAccessible::ButtonDropGrid, UIA_ButtonControlTypeId},
+ {QAccessible::Whitespace, UIA_CustomControlTypeId},
+ {QAccessible::PageTabList, UIA_TabControlTypeId},
+ {QAccessible::Clock, UIA_CustomControlTypeId},
+ {QAccessible::Splitter, UIA_CustomControlTypeId},
+ };
+
+ return mapping.value(role, UIA_CustomControlTypeId);
+}
+
+// True if a character can be a separator for a text unit.
+bool isTextUnitSeparator(TextUnit unit, const QChar &ch)
+{
+ return (((unit == TextUnit_Word) || (unit == TextUnit_Format)) && ch.isSpace())
+ || ((unit == TextUnit_Line) && (ch.toLatin1() == '\n'));
+}
+
+} // namespace QWindowsUiAutomation
+
+
+QT_END_NAMESPACE
+
+#endif // QT_NO_ACCESSIBILITY
diff --git a/src/plugins/platforms/windows/uiautomation/qwindowsuiautils.h b/src/plugins/platforms/windows/uiautomation/qwindowsuiautils.h
new file mode 100644
index 0000000000..15f4d6e8ba
--- /dev/null
+++ b/src/plugins/platforms/windows/uiautomation/qwindowsuiautils.h
@@ -0,0 +1,89 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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$
+**
+****************************************************************************/
+
+#ifndef QWINDOWSUIAUTILS_H
+#define QWINDOWSUIAUTILS_H
+
+#include <QtCore/QtConfig>
+#ifndef QT_NO_ACCESSIBILITY
+
+#include <QtCore/QString>
+#include <QtCore/qt_windows.h>
+#include <QtGui/QAccessible>
+#include <QtGui/QAccessibleInterface>
+#include <QtGui/QWindow>
+#include <QtCore/QDebug>
+#include <QtCore/QRect>
+#include <QtWindowsUIAutomationSupport/private/qwindowsuiawrapper_p.h>
+
+QT_BEGIN_NAMESPACE
+
+namespace QWindowsUiAutomation {
+
+QWindow *windowForAccessible(const QAccessibleInterface *accessible);
+
+HWND hwndForAccessible(const QAccessibleInterface *accessible);
+
+void rectToNativeUiaRect(const QRect &rect, const QWindow *w, UiaRect *uiaRect);
+
+void nativeUiaPointToPoint(const UiaPoint &uiaPoint, const QWindow *w, QPoint *point);
+
+long roleToControlTypeId(QAccessible::Role role);
+
+bool isTextUnitSeparator(TextUnit unit, const QChar &ch);
+
+void clearVariant(VARIANT *variant);
+
+void setVariantI4(int value, VARIANT *variant);
+
+void setVariantBool(bool value, VARIANT *variant);
+
+void setVariantDouble(double value, VARIANT *variant);
+
+BSTR bStrFromQString(const QString &value);
+
+void setVariantString(const QString &value, VARIANT *variant);
+
+} // namespace QWindowsUiAutomation
+
+QT_END_NAMESPACE
+
+#endif // QT_NO_ACCESSIBILITY
+
+#endif // QWINDOWSUIAUTILS_H
diff --git a/src/plugins/platforms/windows/uiautomation/qwindowsuiavalueprovider.cpp b/src/plugins/platforms/windows/uiautomation/qwindowsuiavalueprovider.cpp
new file mode 100644
index 0000000000..ef7d564e22
--- /dev/null
+++ b/src/plugins/platforms/windows/uiautomation/qwindowsuiavalueprovider.cpp
@@ -0,0 +1,132 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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 <QtCore/QtConfig>
+#ifndef QT_NO_ACCESSIBILITY
+
+#include "qwindowsuiavalueprovider.h"
+#include "qwindowsuiautils.h"
+#include "qwindowscontext.h"
+
+#include <QtGui/QAccessible>
+#include <QtGui/QAccessibleInterface>
+#include <QtCore/QDebug>
+#include <QtCore/QString>
+
+QT_BEGIN_NAMESPACE
+
+using namespace QWindowsUiAutomation;
+
+
+QWindowsUiaValueProvider::QWindowsUiaValueProvider(QAccessible::Id id) :
+ QWindowsUiaBaseProvider(id)
+{
+}
+
+QWindowsUiaValueProvider::~QWindowsUiaValueProvider()
+{
+}
+
+// Sets the value associated with the control.
+HRESULT STDMETHODCALLTYPE QWindowsUiaValueProvider::SetValue(LPCWSTR val)
+{
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__;
+
+ QAccessibleInterface *accessible = accessibleInterface();
+ if (!accessible)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ // First sets the value as a text.
+ QString strVal = QString::fromUtf16(reinterpret_cast<const ushort *>(val));
+ accessible->setText(QAccessible::Value, strVal);
+
+ // Then, if the control supports the value interface (range value)
+ // and the supplied text can be converted to a number, and that number
+ // lies within the min/max limits, sets it as the control's current (numeric) value.
+ if (QAccessibleValueInterface *valueInterface = accessible->valueInterface()) {
+ bool ok = false;
+ double numval = strVal.toDouble(&ok);
+ if (ok) {
+ double minimum = valueInterface->minimumValue().toDouble();
+ double maximum = valueInterface->maximumValue().toDouble();
+ if ((numval >= minimum) && (numval <= maximum)) {
+ valueInterface->setCurrentValue(QVariant(numval));
+ }
+ }
+ }
+ return S_OK;
+}
+
+// True for read-only controls.
+HRESULT STDMETHODCALLTYPE QWindowsUiaValueProvider::get_IsReadOnly(BOOL *pRetVal)
+{
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__;
+
+ if (!pRetVal)
+ return E_INVALIDARG;
+ *pRetVal = FALSE;
+
+ QAccessibleInterface *accessible = accessibleInterface();
+ if (!accessible)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ *pRetVal = accessible->state().readOnly;
+ return S_OK;
+}
+
+// Returns the value in text form.
+HRESULT STDMETHODCALLTYPE QWindowsUiaValueProvider::get_Value(BSTR *pRetVal)
+{
+ qCDebug(lcQpaUiAutomation) << __FUNCTION__;
+
+ if (!pRetVal)
+ return E_INVALIDARG;
+ *pRetVal = nullptr;
+
+ QAccessibleInterface *accessible = accessibleInterface();
+ if (!accessible)
+ return UIA_E_ELEMENTNOTAVAILABLE;
+
+ *pRetVal = bStrFromQString(accessible->text(QAccessible::Value));
+ return S_OK;
+}
+
+QT_END_NAMESPACE
+
+#endif // QT_NO_ACCESSIBILITY
diff --git a/src/plugins/platforms/windows/uiautomation/qwindowsuiavalueprovider.h b/src/plugins/platforms/windows/uiautomation/qwindowsuiavalueprovider.h
new file mode 100644
index 0000000000..db54fc0a46
--- /dev/null
+++ b/src/plugins/platforms/windows/uiautomation/qwindowsuiavalueprovider.h
@@ -0,0 +1,70 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 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$
+**
+****************************************************************************/
+
+#ifndef QWINDOWSUIAVALUEPROVIDER_H
+#define QWINDOWSUIAVALUEPROVIDER_H
+
+#include <QtCore/QtConfig>
+#ifndef QT_NO_ACCESSIBILITY
+
+#include "qwindowsuiabaseprovider.h"
+
+QT_BEGIN_NAMESPACE
+
+// Implements the Value control pattern provider.
+// Supported for all controls that can return text(QAccessible::Value).
+class QWindowsUiaValueProvider : public QWindowsUiaBaseProvider,
+ public QWindowsComBase<IValueProvider>
+{
+ Q_DISABLE_COPY(QWindowsUiaValueProvider)
+public:
+ explicit QWindowsUiaValueProvider(QAccessible::Id id);
+ virtual ~QWindowsUiaValueProvider();
+
+ // IValueProvider
+ HRESULT STDMETHODCALLTYPE SetValue(LPCWSTR val);
+ HRESULT STDMETHODCALLTYPE get_IsReadOnly(BOOL *pRetVal);
+ HRESULT STDMETHODCALLTYPE get_Value(BSTR *pRetVal);
+};
+
+QT_END_NAMESPACE
+
+#endif // QT_NO_ACCESSIBILITY
+
+#endif // QWINDOWSUIAVALUEPROVIDER_H
diff --git a/src/plugins/platforms/windows/uiautomation/uiautomation.pri b/src/plugins/platforms/windows/uiautomation/uiautomation.pri
new file mode 100644
index 0000000000..e3071766d9
--- /dev/null
+++ b/src/plugins/platforms/windows/uiautomation/uiautomation.pri
@@ -0,0 +1,43 @@
+qtHaveModule(windowsuiautomation_support-private): \
+ QT += windowsuiautomation_support-private
+
+SOURCES += \
+ $$PWD/qwindowsuiaaccessibility.cpp \
+ $$PWD/qwindowsuiaprovidercache.cpp \
+ $$PWD/qwindowsuiamainprovider.cpp \
+ $$PWD/qwindowsuiabaseprovider.cpp \
+ $$PWD/qwindowsuiavalueprovider.cpp \
+ $$PWD/qwindowsuiatextprovider.cpp \
+ $$PWD/qwindowsuiatextrangeprovider.cpp \
+ $$PWD/qwindowsuiatoggleprovider.cpp \
+ $$PWD/qwindowsuiaselectionprovider.cpp \
+ $$PWD/qwindowsuiaselectionitemprovider.cpp \
+ $$PWD/qwindowsuiainvokeprovider.cpp \
+ $$PWD/qwindowsuiarangevalueprovider.cpp \
+ $$PWD/qwindowsuiatableprovider.cpp \
+ $$PWD/qwindowsuiatableitemprovider.cpp \
+ $$PWD/qwindowsuiagridprovider.cpp \
+ $$PWD/qwindowsuiagriditemprovider.cpp \
+ $$PWD/qwindowsuiautils.cpp
+
+HEADERS += \
+ $$PWD/qwindowsuiaaccessibility.h \
+ $$PWD/qwindowsuiaprovidercache.h \
+ $$PWD/qwindowsuiamainprovider.h \
+ $$PWD/qwindowsuiabaseprovider.h \
+ $$PWD/qwindowsuiavalueprovider.h \
+ $$PWD/qwindowsuiatextprovider.h \
+ $$PWD/qwindowsuiatextrangeprovider.h \
+ $$PWD/qwindowsuiatoggleprovider.h \
+ $$PWD/qwindowsuiaselectionprovider.h \
+ $$PWD/qwindowsuiaselectionitemprovider.h \
+ $$PWD/qwindowsuiainvokeprovider.h \
+ $$PWD/qwindowsuiarangevalueprovider.h \
+ $$PWD/qwindowsuiatableprovider.h \
+ $$PWD/qwindowsuiatableitemprovider.h \
+ $$PWD/qwindowsuiagridprovider.h \
+ $$PWD/qwindowsuiagriditemprovider.h \
+ $$PWD/qwindowsuiautils.h
+
+mingw: LIBS *= -luuid
+
diff --git a/src/plugins/platforms/windows/windows.pri b/src/plugins/platforms/windows/windows.pri
index b7790a66e3..f4c396f7c5 100644
--- a/src/plugins/platforms/windows/windows.pri
+++ b/src/plugins/platforms/windows/windows.pri
@@ -53,7 +53,7 @@ HEADERS += \
$$PWD/qwindowsservices.h \
$$PWD/qwindowsnativeinterface.h \
$$PWD/qwindowsopengltester.h \
- $$PWD/qwindowsthreadpoolrunner.h
+ $$PWD/qwindowsthreadpoolrunner.h \
$$PWD/qwin10helpers.h
INCLUDEPATH += $$PWD
@@ -109,7 +109,7 @@ qtConfig(imageformat_png):RESOURCES += $$PWD/cursors.qrc
RESOURCES += $$PWD/openglblacklists.qrc
-qtConfig(accessibility): include($$PWD/accessible/accessible.pri)
+qtConfig(accessibility): include($$PWD/uiautomation/uiautomation.pri)
qtConfig(combined-angle-lib) {
DEFINES *= LIBEGL_NAME=$${LIBQTANGLE_NAME}
diff --git a/src/plugins/platforms/winrt/qwinrtclipboard.cpp b/src/plugins/platforms/winrt/qwinrtclipboard.cpp
index 117cb515df..05c34b82f8 100644
--- a/src/plugins/platforms/winrt/qwinrtclipboard.cpp
+++ b/src/plugins/platforms/winrt/qwinrtclipboard.cpp
@@ -59,7 +59,7 @@ typedef IEventHandler<IInspectable *> ContentChangedHandler;
QT_BEGIN_NAMESPACE
QWinRTClipboard::QWinRTClipboard()
- : m_mimeData(Q_NULLPTR)
+ : m_mimeData(nullptr)
{
QEventDispatcherWinRT::runOnXamlThread([this]() {
HRESULT hr;
diff --git a/src/plugins/platforms/winrt/qwinrtcursor.cpp b/src/plugins/platforms/winrt/qwinrtcursor.cpp
index 28a5f73e6e..3c918df935 100644
--- a/src/plugins/platforms/winrt/qwinrtcursor.cpp
+++ b/src/plugins/platforms/winrt/qwinrtcursor.cpp
@@ -89,7 +89,7 @@ void QWinRTCursor::changeCursor(QCursor *windowCursor, QWindow *window)
switch (windowCursor ? windowCursor->shape() : Qt::ArrowCursor) {
case Qt::BlankCursor:
hr = QEventDispatcherWinRT::runOnXamlThread([coreWindow]() {
- coreWindow->put_PointerCursor(Q_NULLPTR);
+ coreWindow->put_PointerCursor(nullptr);
return S_OK;
});
RETURN_VOID_IF_FAILED("Failed to set blank native cursor");
diff --git a/src/plugins/platforms/winrt/qwinrtdrag.cpp b/src/plugins/platforms/winrt/qwinrtdrag.cpp
index 43c406e1fb..0c918230b3 100644
--- a/src/plugins/platforms/winrt/qwinrtdrag.cpp
+++ b/src/plugins/platforms/winrt/qwinrtdrag.cpp
@@ -104,7 +104,7 @@ class DragThreadTransferData : public QObject
public slots:
void handleDrag();
public:
- explicit DragThreadTransferData(QObject *parent = Q_NULLPTR);
+ explicit DragThreadTransferData(QObject *parent = nullptr);
QWindow *window;
QWinRTInternalMimeData *mime;
QPoint point;
diff --git a/src/plugins/platforms/winrt/qwinrtfiledialoghelper.cpp b/src/plugins/platforms/winrt/qwinrtfiledialoghelper.cpp
index 62eacba89b..3c90334c8c 100644
--- a/src/plugins/platforms/winrt/qwinrtfiledialoghelper.cpp
+++ b/src/plugins/platforms/winrt/qwinrtfiledialoghelper.cpp
@@ -83,7 +83,7 @@ public:
}
HRESULT __stdcall GetView(IVectorView<HSTRING> **view)
{
- *view = Q_NULLPTR;
+ *view = nullptr;
return E_NOTIMPL;
}
HRESULT __stdcall IndexOf(HSTRING value, quint32 *index, boolean *found)
diff --git a/src/plugins/platforms/winrt/qwinrtfileengine.cpp b/src/plugins/platforms/winrt/qwinrtfileengine.cpp
index f037c516b5..76efdf6cc8 100644
--- a/src/plugins/platforms/winrt/qwinrtfileengine.cpp
+++ b/src/plugins/platforms/winrt/qwinrtfileengine.cpp
@@ -144,7 +144,7 @@ QAbstractFileEngine *QWinRTFileEngineHandler::create(const QString &fileName) co
if (file != d->files.end())
return new QWinRTFileEngine(fileName, file.value().Get());
- return Q_NULLPTR;
+ return nullptr;
}
static HRESULT getDestinationFolder(const QString &fileName, const QString &newFileName,
diff --git a/src/plugins/platforms/winrt/qwinrtscreen.cpp b/src/plugins/platforms/winrt/qwinrtscreen.cpp
index c370c2ec50..7b9502f9ab 100644
--- a/src/plugins/platforms/winrt/qwinrtscreen.cpp
+++ b/src/plugins/platforms/winrt/qwinrtscreen.cpp
@@ -497,7 +497,7 @@ QWinRTScreen::QWinRTScreen()
Q_D(QWinRTScreen);
qCDebug(lcQpaWindows) << __FUNCTION__;
d->orientation = Qt::PrimaryOrientation;
- d->touchDevice = Q_NULLPTR;
+ d->touchDevice = nullptr;
HRESULT hr;
ComPtr<Xaml::IWindowStatics> windowStatics;
@@ -540,7 +540,7 @@ QWinRTScreen::QWinRTScreen()
Q_ASSERT_SUCCEEDED(hr);
d->nativeOrientation = static_cast<Qt::ScreenOrientation>(static_cast<int>(qtOrientationsFromNative(displayOrientation)));
// Set initial pixel density
- onDpiChanged(Q_NULLPTR, Q_NULLPTR);
+ onDpiChanged(nullptr, nullptr);
d->orientation = d->nativeOrientation;
ComPtr<IApplicationViewStatics2> applicationViewStatics;
@@ -764,7 +764,7 @@ void QWinRTScreen::initialize()
Q_ASSERT_SUCCEEDED(hr);
hr = d->displayInformation->add_DpiChanged(Callback<DisplayInformationHandler>(this, &QWinRTScreen::onDpiChanged).Get(), &d->displayTokens[&IDisplayInformation::remove_DpiChanged]);
Q_ASSERT_SUCCEEDED(hr);
- onOrientationChanged(Q_NULLPTR, Q_NULLPTR);
+ onOrientationChanged(nullptr, nullptr);
onVisibilityChanged(nullptr, nullptr);
hr = d->redirect->add_PointerRoutedReleased(Callback<RedirectHandler>(this, &QWinRTScreen::onRedirectReleased).Get(), &d->redirectTokens[&ICorePointerRedirector::remove_PointerRoutedReleased]);
@@ -864,7 +864,7 @@ void QWinRTScreen::removeWindow(QWindow *window)
const Qt::WindowType type = window->type();
if (wasTopWindow && type != Qt::Popup && type != Qt::ToolTip && type != Qt::Tool)
- QWindowSystemInterface::handleWindowActivated(Q_NULLPTR, Qt::OtherFocusReason);
+ QWindowSystemInterface::handleWindowActivated(nullptr, Qt::OtherFocusReason);
handleExpose();
QWindowSystemInterface::flushWindowSystemEvents(QEventLoop::ExcludeUserInputEvents);
#ifndef QT_NO_DRAGANDDROP
diff --git a/src/plugins/platforms/winrt/qwinrtwindow.h b/src/plugins/platforms/winrt/qwinrtwindow.h
index a8992450b9..9604b4bbaa 100644
--- a/src/plugins/platforms/winrt/qwinrtwindow.h
+++ b/src/plugins/platforms/winrt/qwinrtwindow.h
@@ -70,8 +70,8 @@ public:
qreal devicePixelRatio() const override;
void setWindowState(Qt::WindowStates state) override;
- bool setMouseGrabEnabled(bool grab) Q_DECL_OVERRIDE;
- bool setKeyboardGrabEnabled(bool grab) Q_DECL_OVERRIDE;
+ bool setMouseGrabEnabled(bool grab) override;
+ bool setKeyboardGrabEnabled(bool grab) override;
EGLSurface eglSurface() const;
void createEglSurface(EGLDisplay display, EGLConfig config);
diff --git a/src/plugins/platforms/xcb/gl_integrations/qxcbglintegration.h b/src/plugins/platforms/xcb/gl_integrations/qxcbglintegration.h
index 926e5e22df..07e983a499 100644
--- a/src/plugins/platforms/xcb/gl_integrations/qxcbglintegration.h
+++ b/src/plugins/platforms/xcb/gl_integrations/qxcbglintegration.h
@@ -69,7 +69,7 @@ public:
#endif
virtual QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const = 0;
- virtual QXcbNativeInterfaceHandler *nativeInterfaceHandler() const { return Q_NULLPTR; }
+ virtual QXcbNativeInterfaceHandler *nativeInterfaceHandler() const { return nullptr; }
};
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/xcb/gl_integrations/qxcbnativeinterfacehandler.cpp b/src/plugins/platforms/xcb/gl_integrations/qxcbnativeinterfacehandler.cpp
index ac992b859d..e18656c6ec 100644
--- a/src/plugins/platforms/xcb/gl_integrations/qxcbnativeinterfacehandler.cpp
+++ b/src/plugins/platforms/xcb/gl_integrations/qxcbnativeinterfacehandler.cpp
@@ -56,37 +56,37 @@ QXcbNativeInterfaceHandler::~QXcbNativeInterfaceHandler()
QPlatformNativeInterface::NativeResourceForIntegrationFunction QXcbNativeInterfaceHandler::nativeResourceFunctionForIntegration(const QByteArray &resource) const
{
Q_UNUSED(resource);
- return Q_NULLPTR;
+ return nullptr;
}
QPlatformNativeInterface::NativeResourceForContextFunction QXcbNativeInterfaceHandler::nativeResourceFunctionForContext(const QByteArray &resource) const
{
Q_UNUSED(resource);
- return Q_NULLPTR;
+ return nullptr;
}
QPlatformNativeInterface::NativeResourceForScreenFunction QXcbNativeInterfaceHandler::nativeResourceFunctionForScreen(const QByteArray &resource) const
{
Q_UNUSED(resource);
- return Q_NULLPTR;
+ return nullptr;
}
QPlatformNativeInterface::NativeResourceForWindowFunction QXcbNativeInterfaceHandler::nativeResourceFunctionForWindow(const QByteArray &resource) const
{
Q_UNUSED(resource);
- return Q_NULLPTR;
+ return nullptr;
}
QPlatformNativeInterface::NativeResourceForBackingStoreFunction QXcbNativeInterfaceHandler::nativeResourceFunctionForBackingStore(const QByteArray &resource) const
{
Q_UNUSED(resource);
- return Q_NULLPTR;
+ return nullptr;
}
QFunctionPointer QXcbNativeInterfaceHandler::platformFunction(const QByteArray &function) const
{
Q_UNUSED(function);
- return Q_NULLPTR;
+ return nullptr;
}
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglintegration.cpp b/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglintegration.cpp
index 7aa1d631df..fe18bc24db 100644
--- a/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglintegration.cpp
+++ b/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglintegration.cpp
@@ -49,7 +49,7 @@
QT_BEGIN_NAMESPACE
QXcbEglIntegration::QXcbEglIntegration()
- : m_connection(Q_NULLPTR)
+ : m_connection(nullptr)
, m_egl_display(EGL_NO_DISPLAY)
{
qCDebug(lcQpaGl) << "Xcb EGL gl-integration created";
diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglnativeinterfacehandler.cpp b/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglnativeinterfacehandler.cpp
index 30f5e3a00d..c0e3f820fe 100644
--- a/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglnativeinterfacehandler.cpp
+++ b/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglnativeinterfacehandler.cpp
@@ -77,7 +77,7 @@ QPlatformNativeInterface::NativeResourceForIntegrationFunction QXcbEglNativeInte
default:
break;
}
- return Q_NULLPTR;
+ return nullptr;
}
QPlatformNativeInterface::NativeResourceForContextFunction QXcbEglNativeInterfaceHandler::nativeResourceFunctionForContext(const QByteArray &resource) const
@@ -90,7 +90,7 @@ QPlatformNativeInterface::NativeResourceForContextFunction QXcbEglNativeInterfac
default:
break;
}
- return Q_NULLPTR;
+ return nullptr;
}
QPlatformNativeInterface::NativeResourceForWindowFunction QXcbEglNativeInterfaceHandler::nativeResourceFunctionForWindow(const QByteArray &resource) const
@@ -101,7 +101,7 @@ QPlatformNativeInterface::NativeResourceForWindowFunction QXcbEglNativeInterface
default:
break;
}
- return Q_NULLPTR;
+ return nullptr;
}
void *QXcbEglNativeInterfaceHandler::eglDisplay()
@@ -114,11 +114,11 @@ void *QXcbEglNativeInterfaceHandler::eglDisplay()
void *QXcbEglNativeInterfaceHandler::eglDisplayForWindow(QWindow *window)
{
Q_ASSERT(window);
- if (window->supportsOpenGL() && window->handle() == Q_NULLPTR)
+ if (window->supportsOpenGL() && window->handle() == nullptr)
return eglDisplay();
else if (window->supportsOpenGL())
return static_cast<QXcbEglWindow *>(window->handle())->glIntegration()->eglDisplay();
- return Q_NULLPTR;
+ return nullptr;
}
void *QXcbEglNativeInterfaceHandler::eglContextForContext(QOpenGLContext *context)
diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglwindow.cpp b/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglwindow.cpp
index 9c3fd26d49..65beac227c 100644
--- a/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglwindow.cpp
+++ b/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglwindow.cpp
@@ -49,7 +49,7 @@ QT_BEGIN_NAMESPACE
QXcbEglWindow::QXcbEglWindow(QWindow *window, QXcbEglIntegration *glIntegration)
: QXcbWindow(window)
, m_glIntegration(glIntegration)
- , m_config(Q_NULLPTR)
+ , m_config(nullptr)
, m_surface(EGL_NO_SURFACE)
{
}
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 3bc8590d36..56a737e882 100644
--- a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp
+++ b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp
@@ -321,7 +321,7 @@ void QGLXContext::init(QXcbScreen *screen, QPlatformOpenGLContext *share)
if (!m_context && m_shareContext) {
// re-try without a shared glx context
m_shareContext = 0;
- m_context = glXCreateContext(m_display, visualInfo, Q_NULLPTR, true);
+ m_context = glXCreateContext(m_display, visualInfo, nullptr, true);
}
// Create a temporary window so that we can make the new context current
@@ -470,7 +470,7 @@ static QXcbScreen *screenForPlatformSurface(QPlatformSurface *surface)
} else if (surfaceClass == QSurface::Offscreen) {
return static_cast<QXcbScreen *>(static_cast<QGLXPbuffer *>(surface)->screen());
}
- return Q_NULLPTR;
+ return nullptr;
}
QVariant QGLXContext::nativeHandle() const
diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxintegration.cpp b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxintegration.cpp
index 377066df61..13f03f8bf3 100644
--- a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxintegration.cpp
+++ b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxintegration.cpp
@@ -87,7 +87,7 @@ QT_BEGIN_NAMESPACE
#endif
QXcbGlxIntegration::QXcbGlxIntegration()
- : m_connection(Q_NULLPTR)
+ : m_connection(nullptr)
, m_glx_first_event(0)
{
qCDebug(lcQpaGl) << "Xcb GLX gl-integration created";
diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxnativeinterfacehandler.cpp b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxnativeinterfacehandler.cpp
index 638fdd46b5..e9bb4460ff 100644
--- a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxnativeinterfacehandler.cpp
+++ b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxnativeinterfacehandler.cpp
@@ -72,7 +72,7 @@ QPlatformNativeInterface::NativeResourceForContextFunction QXcbGlxNativeInterfac
default:
break;
}
- return Q_NULLPTR;
+ return nullptr;
}
void *QXcbGlxNativeInterfaceHandler::glxContextForContext(QOpenGLContext *context)
diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxwindow.cpp b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxwindow.cpp
index 145a11a5e3..d682ea87fb 100644
--- a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxwindow.cpp
+++ b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxwindow.cpp
@@ -58,7 +58,7 @@ const xcb_visualtype_t *QXcbGlxWindow::createVisual()
{
QXcbScreen *scr = xcbScreen();
if (!scr)
- return Q_NULLPTR;
+ return nullptr;
qDebug(lcQpaGl) << "Requested format before FBConfig/Visual selection:" << m_format;
@@ -74,7 +74,7 @@ const xcb_visualtype_t *QXcbGlxWindow::createVisual()
XVisualInfo *visualInfo = qglx_findVisualInfo(dpy, scr->screenNumber(), &m_format, GLX_WINDOW_BIT, flags);
if (!visualInfo) {
qWarning() << "No XVisualInfo for format" << m_format;
- return Q_NULLPTR;
+ return nullptr;
}
const xcb_visualtype_t *xcb_visualtype = scr->visualForId(visualInfo->visualid);
XFree(visualInfo);
diff --git a/src/plugins/platforms/xcb/nativepainting/qbackingstore_x11.cpp b/src/plugins/platforms/xcb/nativepainting/qbackingstore_x11.cpp
index 2dd2cdd9e3..cb2bbafee1 100644
--- a/src/plugins/platforms/xcb/nativepainting/qbackingstore_x11.cpp
+++ b/src/plugins/platforms/xcb/nativepainting/qbackingstore_x11.cpp
@@ -115,7 +115,7 @@ void QXcbNativeBackingStore::flush(QWindow *window, const QRegion &region, const
else
#endif
{
- GC gc = XCreateGC(display(), wid, 0, Q_NULLPTR);
+ GC gc = XCreateGC(display(), wid, 0, nullptr);
if (clipRects.size() != 1)
XSetClipRectangles(display(), gc, 0, 0, clipRects.data(), clipRects.size(), YXBanded);
@@ -155,7 +155,7 @@ void QXcbNativeBackingStore::resize(const QSize &size, const QRegion &staticCont
QRect br = staticContents.boundingRect().intersected(QRect(QPoint(0, 0), size));
if (!br.isEmpty()) {
- GC gc = XCreateGC(display(), to, 0, Q_NULLPTR);
+ GC gc = XCreateGC(display(), to, 0, nullptr);
XCopyArea(display(), from, to, gc, br.x(), br.y(), br.width(), br.height(), br.x(), br.y());
XFreeGC(display(), gc);
}
@@ -172,7 +172,7 @@ bool QXcbNativeBackingStore::scroll(const QRegion &area, int dx, int dy)
QRect rect = area.boundingRect();
Pixmap pix = qt_x11PixmapHandle(m_pixmap);
- GC gc = XCreateGC(display(), pix, 0, Q_NULLPTR);
+ GC gc = XCreateGC(display(), pix, 0, nullptr);
XCopyArea(display(), pix, pix, gc,
rect.x(), rect.y(), rect.width(), rect.height(),
rect.x()+dx, rect.y()+dy);
diff --git a/src/plugins/platforms/xcb/nativepainting/qpaintengine_x11_p.h b/src/plugins/platforms/xcb/nativepainting/qpaintengine_x11_p.h
index 34b5d929d5..a0dd6cdf74 100644
--- a/src/plugins/platforms/xcb/nativepainting/qpaintengine_x11_p.h
+++ b/src/plugins/platforms/xcb/nativepainting/qpaintengine_x11_p.h
@@ -56,10 +56,10 @@ public:
QX11PaintEngine();
~QX11PaintEngine();
- bool begin(QPaintDevice *pdev) Q_DECL_OVERRIDE;
- bool end() Q_DECL_OVERRIDE;
+ bool begin(QPaintDevice *pdev) override;
+ bool end() override;
- void updateState(const QPaintEngineState &state) Q_DECL_OVERRIDE;
+ void updateState(const QPaintEngineState &state) override;
void updatePen(const QPen &pen);
void updateBrush(const QBrush &brush, const QPointF &pt);
@@ -68,31 +68,31 @@ public:
void updateMatrix(const QTransform &matrix);
void updateClipRegion_dev(const QRegion &region, Qt::ClipOperation op);
- void drawLines(const QLine *lines, int lineCount) Q_DECL_OVERRIDE;
- void drawLines(const QLineF *lines, int lineCount) Q_DECL_OVERRIDE;
+ void drawLines(const QLine *lines, int lineCount) override;
+ void drawLines(const QLineF *lines, int lineCount) override;
- void drawRects(const QRect *rects, int rectCount) Q_DECL_OVERRIDE;
- void drawRects(const QRectF *rects, int rectCount) Q_DECL_OVERRIDE;
+ void drawRects(const QRect *rects, int rectCount) override;
+ void drawRects(const QRectF *rects, int rectCount) override;
- void drawPoints(const QPoint *points, int pointCount) Q_DECL_OVERRIDE;
- void drawPoints(const QPointF *points, int pointCount) Q_DECL_OVERRIDE;
+ void drawPoints(const QPoint *points, int pointCount) override;
+ void drawPoints(const QPointF *points, int pointCount) override;
- void drawEllipse(const QRect &r) Q_DECL_OVERRIDE;
- void drawEllipse(const QRectF &r) Q_DECL_OVERRIDE;
+ void drawEllipse(const QRect &r) override;
+ void drawEllipse(const QRectF &r) override;
- virtual void drawPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode) Q_DECL_OVERRIDE;
- inline void drawPolygon(const QPoint *points, int pointCount, PolygonDrawMode mode) Q_DECL_OVERRIDE
+ virtual void drawPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode) override;
+ inline void drawPolygon(const QPoint *points, int pointCount, PolygonDrawMode mode) override
{ QPaintEngine::drawPolygon(points, pointCount, mode); }
- void drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr) Q_DECL_OVERRIDE;
- void drawTiledPixmap(const QRectF &r, const QPixmap &pixmap, const QPointF &s) Q_DECL_OVERRIDE;
- void drawPath(const QPainterPath &path) Q_DECL_OVERRIDE;
- void drawTextItem(const QPointF &p, const QTextItem &textItem) Q_DECL_OVERRIDE;
+ void drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr) override;
+ void drawTiledPixmap(const QRectF &r, const QPixmap &pixmap, const QPointF &s) override;
+ void drawPath(const QPainterPath &path) override;
+ void drawTextItem(const QPointF &p, const QTextItem &textItem) override;
void drawImage(const QRectF &r, const QImage &img, const QRectF &sr,
- Qt::ImageConversionFlags flags = Qt::AutoColor) Q_DECL_OVERRIDE;
+ Qt::ImageConversionFlags flags = Qt::AutoColor) override;
virtual Drawable handle() const;
- inline Type type() const Q_DECL_OVERRIDE { return QPaintEngine::X11; }
+ inline Type type() const override { return QPaintEngine::X11; }
QPainter::RenderHints supportedRenderHints() const;
diff --git a/src/plugins/platforms/xcb/nativepainting/qpixmap_x11_p.h b/src/plugins/platforms/xcb/nativepainting/qpixmap_x11_p.h
index 2cbd1fe3d0..79e607c6f8 100644
--- a/src/plugins/platforms/xcb/nativepainting/qpixmap_x11_p.h
+++ b/src/plugins/platforms/xcb/nativepainting/qpixmap_x11_p.h
@@ -56,22 +56,22 @@ public:
QX11PlatformPixmap(PixelType pixelType);
~QX11PlatformPixmap();
- QPlatformPixmap *createCompatiblePlatformPixmap() const Q_DECL_OVERRIDE;
- void resize(int width, int height) Q_DECL_OVERRIDE;
- void fromImage(const QImage &img, Qt::ImageConversionFlags flags) Q_DECL_OVERRIDE;
- void copy(const QPlatformPixmap *data, const QRect &rect) Q_DECL_OVERRIDE;
- bool scroll(int dx, int dy, const QRect &rect) Q_DECL_OVERRIDE;
- int metric(QPaintDevice::PaintDeviceMetric metric) const Q_DECL_OVERRIDE;
- void fill(const QColor &fillColor) Q_DECL_OVERRIDE;
- QBitmap mask() const Q_DECL_OVERRIDE;
- void setMask(const QBitmap &mask) Q_DECL_OVERRIDE;
- bool hasAlphaChannel() const Q_DECL_OVERRIDE;
- QPixmap transformed(const QTransform &matrix, Qt::TransformationMode mode) const Q_DECL_OVERRIDE;
- QImage toImage() const Q_DECL_OVERRIDE;
- QImage toImage(const QRect &rect) const Q_DECL_OVERRIDE;
- QPaintEngine *paintEngine() const Q_DECL_OVERRIDE;
- qreal devicePixelRatio() const Q_DECL_OVERRIDE;
- void setDevicePixelRatio(qreal scaleFactor) Q_DECL_OVERRIDE;
+ QPlatformPixmap *createCompatiblePlatformPixmap() const override;
+ void resize(int width, int height) override;
+ void fromImage(const QImage &img, Qt::ImageConversionFlags flags) override;
+ void copy(const QPlatformPixmap *data, const QRect &rect) override;
+ bool scroll(int dx, int dy, const QRect &rect) override;
+ int metric(QPaintDevice::PaintDeviceMetric metric) const override;
+ void fill(const QColor &fillColor) override;
+ QBitmap mask() const override;
+ void setMask(const QBitmap &mask) override;
+ bool hasAlphaChannel() const override;
+ QPixmap transformed(const QTransform &matrix, Qt::TransformationMode mode) const override;
+ QImage toImage() const override;
+ QImage toImage(const QRect &rect) const override;
+ QPaintEngine *paintEngine() const override;
+ qreal devicePixelRatio() const override;
+ void setDevicePixelRatio(qreal scaleFactor) override;
inline Drawable handle() const { return hd; }
inline Picture x11PictureHandle() const { return picture; }
@@ -123,7 +123,7 @@ inline QX11PlatformPixmap *qt_x11Pixmap(const QPixmap &pixmap)
{
return (pixmap.handle() && pixmap.handle()->classId() == QPlatformPixmap::X11Class)
? static_cast<QX11PlatformPixmap *>(pixmap.handle())
- : Q_NULLPTR;
+ : nullptr;
}
inline Picture qt_x11PictureHandle(const QPixmap &pixmap)
diff --git a/src/plugins/platforms/xcb/nativepainting/qxcbnativepainting.cpp b/src/plugins/platforms/xcb/nativepainting/qxcbnativepainting.cpp
index ccb421d868..7731f6c806 100644
--- a/src/plugins/platforms/xcb/nativepainting/qxcbnativepainting.cpp
+++ b/src/plugins/platforms/xcb/nativepainting/qxcbnativepainting.cpp
@@ -38,7 +38,7 @@
QT_BEGIN_NAMESPACE
-QXcbX11Data *qt_x11Data = Q_NULLPTR;
+QXcbX11Data *qt_x11Data = nullptr;
void qt_xcb_native_x11_info_init(QXcbConnection *conn)
{
@@ -122,7 +122,7 @@ class QXcbX11InfoData : public QSharedData, public QX11InfoData
{};
QXcbX11Info::QXcbX11Info()
- : d(Q_NULLPTR)
+ : d(nullptr)
{}
QXcbX11Info::~QXcbX11Info()
diff --git a/src/plugins/platforms/xcb/qxcbbackingstore.cpp b/src/plugins/platforms/xcb/qxcbbackingstore.cpp
index 420d1ac7c5..1e046aa677 100644
--- a/src/plugins/platforms/xcb/qxcbbackingstore.cpp
+++ b/src/plugins/platforms/xcb/qxcbbackingstore.cpp
@@ -69,6 +69,8 @@ public:
QXcbShmImage(QXcbScreen *connection, const QSize &size, uint depth, QImage::Format format);
~QXcbShmImage() { destroy(); }
+ void flushScrolledRegion(bool clientSideScroll);
+
bool scroll(const QRegion &area, int dx, int dy);
QImage *image() { return &m_qimage; }
@@ -86,7 +88,8 @@ private:
void destroy();
void ensureGC(xcb_drawable_t dst);
- void flushPixmap(const QRegion &region);
+ void shmPutImage(xcb_drawable_t drawable, const QRegion &region, const QPoint &offset = QPoint());
+ void flushPixmap(const QRegion &region, bool fullRegion = false);
void setClip(const QRegion &region);
xcb_shm_segment_info_t m_shm_info;
@@ -99,18 +102,26 @@ private:
xcb_gcontext_t m_gc;
xcb_drawable_t m_gc_drawable;
- // When using shared memory this is the region currently shared with the server
- QRegion m_dirtyShm;
-
+ // When using shared memory these variables are used only for server-side scrolling.
// When not using shared memory, we maintain a server-side pixmap with the backing
// store as well as repainted content not yet flushed to the pixmap. We only flush
// the regions we need and only when these are marked dirty. This way we can just
// do a server-side copy on expose instead of sending the pixels every time
xcb_pixmap_t m_xcb_pixmap;
QRegion m_pendingFlush;
+
+ // This is the scrolled region which is stored in server-side pixmap
+ QRegion m_scrolledRegion;
+
+ // When using shared memory this is the region currently shared with the server
+ QRegion m_dirtyShm;
+
+ // When not using shared memory this is a temporary buffer which is uploaded
+ // as a pixmap region to server
QByteArray m_flushBuffer;
bool m_hasAlpha;
+ bool m_clientSideScroll;
};
class QXcbShmGraphicsBuffer : public QPlatformGraphicsBuffer
@@ -145,10 +156,11 @@ private:
QXcbShmImage::QXcbShmImage(QXcbScreen *screen, const QSize &size, uint depth, QImage::Format format)
: QXcbObject(screen->connection())
- , m_graphics_buffer(Q_NULLPTR)
+ , m_graphics_buffer(nullptr)
, m_gc(0)
, m_gc_drawable(0)
, m_xcb_pixmap(0)
+ , m_clientSideScroll(false)
{
const xcb_format_t *fmt = connection()->formatForDepth(depth);
Q_ASSERT(fmt);
@@ -202,13 +214,59 @@ QXcbShmImage::QXcbShmImage(QXcbScreen *screen, const QSize &size, uint depth, QI
m_qimage = QImage( (uchar*) m_xcb_image->data, m_xcb_image->width, m_xcb_image->height, m_xcb_image->stride, format);
m_graphics_buffer = new QXcbShmGraphicsBuffer(&m_qimage);
- if (!hasShm()) {
- m_xcb_pixmap = xcb_generate_id(xcb_connection());
- xcb_create_pixmap(xcb_connection(),
- m_xcb_image->depth,
- m_xcb_pixmap,
- screen->screen()->root,
- m_xcb_image->width, m_xcb_image->height);
+ m_xcb_pixmap = xcb_generate_id(xcb_connection());
+ xcb_create_pixmap(xcb_connection(),
+ m_xcb_image->depth,
+ m_xcb_pixmap,
+ screen->screen()->root,
+ m_xcb_image->width, m_xcb_image->height);
+}
+
+void QXcbShmImage::flushScrolledRegion(bool clientSideScroll)
+{
+ if (m_clientSideScroll == clientSideScroll)
+ return;
+
+ m_clientSideScroll = clientSideScroll;
+
+ if (m_scrolledRegion.isNull())
+ return;
+
+ if (hasShm() && m_dirtyShm.intersects(m_scrolledRegion)) {
+ connection()->sync();
+ m_dirtyShm = QRegion();
+ }
+
+ if (m_clientSideScroll) {
+ // Copy scrolled image region from server-side pixmap to client-side memory
+ for (const QRect &rect : m_scrolledRegion) {
+ const int w = rect.width();
+ const int h = rect.height();
+
+ auto reply = Q_XCB_REPLY_UNCHECKED(xcb_get_image,
+ xcb_connection(),
+ m_xcb_image->format,
+ m_xcb_pixmap,
+ rect.x(), rect.y(),
+ w, h,
+ ~0u);
+
+ if (reply && reply->depth == m_xcb_image->depth) {
+ const QImage img(xcb_get_image_data(reply.get()), w, h, m_qimage.format());
+
+ QPainter p(&m_qimage);
+ p.setCompositionMode(QPainter::CompositionMode_Source);
+ p.drawImage(rect.topLeft(), img);
+ }
+ }
+ m_scrolledRegion = QRegion();
+ } else {
+ // Copy scrolled image region from client-side memory to server-side pixmap
+ ensureGC(m_xcb_pixmap);
+ if (hasShm())
+ shmPutImage(m_xcb_pixmap, m_scrolledRegion);
+ else
+ flushPixmap(m_scrolledRegion, true);
}
}
@@ -216,21 +274,28 @@ extern void qt_scrollRectInImage(QImage &img, const QRect &rect, const QPoint &o
bool QXcbShmImage::scroll(const QRegion &area, int dx, int dy)
{
- if (image()->isNull())
- return false;
+ const QRect bounds(QPoint(), size());
+ const QRegion scrollArea(area & bounds);
+ const QPoint delta(dx, dy);
- if (hasShm())
- preparePaint(area);
+ if (m_clientSideScroll) {
+ if (m_qimage.isNull())
+ return false;
- const QPoint delta(dx, dy);
- for (const QRect &rect : area)
- qt_scrollRectInImage(*image(), rect, delta);
+ if (hasShm())
+ preparePaint(scrollArea);
+
+ for (const QRect &rect : scrollArea)
+ qt_scrollRectInImage(m_qimage, rect, delta);
+ } else {
+ if (hasShm())
+ shmPutImage(m_xcb_pixmap, m_pendingFlush.intersected(scrollArea));
+ else
+ flushPixmap(scrollArea);
- if (m_xcb_pixmap) {
- flushPixmap(area);
ensureGC(m_xcb_pixmap);
- const QRect bounds(QPoint(0, 0), size());
- for (const QRect &src : area) {
+
+ for (const QRect &src : scrollArea) {
const QRect dst = src.translated(delta).intersected(bounds);
xcb_copy_area(xcb_connection(),
m_xcb_pixmap,
@@ -242,6 +307,12 @@ bool QXcbShmImage::scroll(const QRegion &area, int dx, int dy)
}
}
+ m_scrolledRegion |= scrollArea.translated(delta).intersected(bounds);
+ if (hasShm()) {
+ m_pendingFlush -= scrollArea;
+ m_pendingFlush -= m_scrolledRegion;
+ }
+
return true;
}
@@ -265,12 +336,10 @@ void QXcbShmImage::destroy()
if (m_gc)
xcb_free_gc(xcb_connection(), m_gc);
delete m_graphics_buffer;
- m_graphics_buffer = Q_NULLPTR;
+ m_graphics_buffer = nullptr;
- if (m_xcb_pixmap) {
- xcb_free_pixmap(xcb_connection(), m_xcb_pixmap);
- m_xcb_pixmap = 0;
- }
+ xcb_free_pixmap(xcb_connection(), m_xcb_pixmap);
+ m_xcb_pixmap = 0;
}
void QXcbShmImage::ensureGC(xcb_drawable_t dst)
@@ -353,10 +422,36 @@ static inline quint32 round_up_scanline(quint32 base, quint32 pad)
return (base + pad - 1) & -pad;
}
-void QXcbShmImage::flushPixmap(const QRegion &region)
+void QXcbShmImage::shmPutImage(xcb_drawable_t drawable, const QRegion &region, const QPoint &offset)
+{
+ for (const QRect &rect : region) {
+ const QPoint source = rect.translated(offset).topLeft();
+ xcb_shm_put_image(xcb_connection(),
+ drawable,
+ m_gc,
+ m_xcb_image->width,
+ m_xcb_image->height,
+ source.x(), source.y(),
+ rect.width(), rect.height(),
+ rect.x(), rect.y(),
+ m_xcb_image->depth,
+ m_xcb_image->format,
+ 0, // send event?
+ m_shm_info.shmseg,
+ m_xcb_image->data - m_shm_info.shmaddr);
+ }
+ m_dirtyShm |= region.translated(offset);
+}
+
+void QXcbShmImage::flushPixmap(const QRegion &region, bool fullRegion)
{
- const QVector<QRect> rects = m_pendingFlush.intersected(region).rects();
- m_pendingFlush -= region;
+ QVector<QRect> rects;
+ if (!fullRegion) {
+ rects = m_pendingFlush.intersected(region).rects();
+ m_pendingFlush -= region;
+ } else {
+ rects = region.rects();
+ }
xcb_image_t xcb_subimage;
memset(&xcb_subimage, 0, sizeof(xcb_image_t));
@@ -372,7 +467,7 @@ void QXcbShmImage::flushPixmap(const QRegion &region)
const bool needsByteSwap = xcb_subimage.byte_order != m_xcb_image->byte_order;
- for (const QRect &rect : rects) {
+ for (const QRect &rect : qAsConst(rects)) {
// We must make sure that each request is not larger than max_req_size.
// Each request takes req_size + m_xcb_image->stride * height bytes.
static const uint32_t req_size = sizeof(xcb_put_image_request_t);
@@ -445,29 +540,32 @@ void QXcbShmImage::setClip(const QRegion &region)
void QXcbShmImage::put(xcb_drawable_t dst, const QRegion &region, const QPoint &offset)
{
+ Q_ASSERT(!m_clientSideScroll);
+
ensureGC(dst);
setClip(region);
- const QRect bounds = region.boundingRect();
- const QPoint target = bounds.topLeft();
- const QRect source = bounds.translated(offset);
-
if (hasShm()) {
- xcb_shm_put_image(xcb_connection(),
+ // Copy scrolled area on server-side from pixmap to window
+ const QRegion scrolledRegion = m_scrolledRegion.translated(-offset);
+ for (const QRect &rect : scrolledRegion) {
+ const QPoint source = rect.translated(offset).topLeft();
+ xcb_copy_area(xcb_connection(),
+ m_xcb_pixmap,
dst,
m_gc,
- m_xcb_image->width,
- m_xcb_image->height,
source.x(), source.y(),
- source.width(), source.height(),
- target.x(), target.y(),
- m_xcb_image->depth,
- m_xcb_image->format,
- 0, // send event?
- m_shm_info.shmseg,
- m_xcb_image->data - m_shm_info.shmaddr);
- m_dirtyShm |= region.translated(offset);
+ rect.x(), rect.y(),
+ rect.width(), rect.height());
+ }
+
+ // Copy non-scrolled image from client-side memory to server-side window
+ const QRegion notScrolledArea = region - scrolledRegion;
+ shmPutImage(dst, notScrolledArea, offset);
} else {
+ const QRect bounds = region.boundingRect();
+ const QPoint target = bounds.topLeft();
+ const QRect source = bounds.translated(offset);
flushPixmap(region);
xcb_copy_area(xcb_connection(),
m_xcb_pixmap,
@@ -489,9 +587,9 @@ void QXcbShmImage::preparePaint(const QRegion &region)
connection()->sync();
m_dirtyShm = QRegion();
}
- } else {
- m_pendingFlush |= region;
}
+ m_scrolledRegion -= region;
+ m_pendingFlush |= region;
}
QXcbBackingStore::QXcbBackingStore(QWindow *window)
@@ -565,7 +663,7 @@ QImage QXcbBackingStore::toImage() const
QPlatformGraphicsBuffer *QXcbBackingStore::graphicsBuffer() const
{
- return m_image ? m_image->graphicsBuffer() : Q_NULLPTR;
+ return m_image ? m_image->graphicsBuffer() : nullptr;
}
void QXcbBackingStore::flush(QWindow *window, const QRegion &region, const QPoint &offset)
@@ -573,6 +671,8 @@ void QXcbBackingStore::flush(QWindow *window, const QRegion &region, const QPoin
if (!m_image || m_image->size().isEmpty())
return;
+ m_image->flushScrolledRegion(false);
+
QSize imageSize = m_image->size();
QRegion clipped = region;
@@ -603,6 +703,11 @@ void QXcbBackingStore::composeAndFlush(QWindow *window, const QRegion &region, c
QPlatformTextureList *textures,
bool translucentBackground)
{
+ if (!m_image || m_image->size().isEmpty())
+ return;
+
+ m_image->flushScrolledRegion(true);
+
QPlatformBackingStore::composeAndFlush(window, region, offset, textures, translucentBackground);
QXcbWindow *platformWindow = static_cast<QXcbWindow *>(window->handle());
diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp
index 536c709dbe..c5eae20266 100644
--- a/src/plugins/platforms/xcb/qxcbconnection.cpp
+++ b/src/plugins/platforms/xcb/qxcbconnection.cpp
@@ -369,7 +369,7 @@ void QXcbConnection::destroyScreen(QXcbScreen *screen)
// If there are no other screens on the same virtual desktop,
// then transform the physical screen into a fake screen.
const QString nameWas = screen->name();
- screen->setOutput(XCB_NONE, Q_NULLPTR);
+ screen->setOutput(XCB_NONE, nullptr);
qCDebug(lcQpaScreen) << "transformed" << nameWas << "to fake" << screen;
} else {
// There is more than one screen on the same virtual desktop, remove the screen
@@ -395,7 +395,7 @@ void QXcbConnection::initializeScreens()
{
xcb_screen_iterator_t it = xcb_setup_roots_iterator(m_setup);
int xcbScreenNumber = 0; // screen number in the xcb sense
- QXcbScreen *primaryScreen = Q_NULLPTR;
+ QXcbScreen *primaryScreen = nullptr;
while (it.rem) {
// Each "screen" in xcb terminology is a virtual desktop,
// potentially a collection of separate juxtaposed monitors.
@@ -415,7 +415,7 @@ void QXcbConnection::initializeScreens()
qWarning("failed to get the current screen resources");
} else {
xcb_timestamp_t timestamp = 0;
- xcb_randr_output_t *outputs = Q_NULLPTR;
+ xcb_randr_output_t *outputs = nullptr;
int outputCount = xcb_randr_get_screen_resources_current_outputs_length(resources_current.get());
if (outputCount) {
timestamp = resources_current->config_timestamp;
@@ -487,7 +487,7 @@ void QXcbConnection::initializeScreens()
while (it.rem) {
xcb_xinerama_screen_info_t *screen_info = it.data;
QXcbScreen *screen = new QXcbScreen(this, virtualDesktop,
- XCB_NONE, Q_NULLPTR,
+ XCB_NONE, nullptr,
screen_info, it.index);
siblings << screen;
m_screens << screen;
@@ -498,7 +498,7 @@ void QXcbConnection::initializeScreens()
if (siblings.isEmpty()) {
// If there are no XRandR outputs or XRandR extension is missing,
// then create a fake/legacy screen.
- QXcbScreen *screen = new QXcbScreen(this, virtualDesktop, XCB_NONE, Q_NULLPTR);
+ QXcbScreen *screen = new QXcbScreen(this, virtualDesktop, XCB_NONE, nullptr);
qCDebug(lcQpaScreen) << "created fake screen" << screen;
m_screens << screen;
if (m_primaryScreenNumber == xcbScreenNumber) {
@@ -631,7 +631,7 @@ QXcbConnection::QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGra
if (m_glIntegration && !m_glIntegration->initialize(this)) {
qCDebug(lcQpaGl) << "Failed to initialize xcb gl-integration" << glIntegrationNames.at(i);
delete m_glIntegration;
- m_glIntegration = Q_NULLPTR;
+ m_glIntegration = nullptr;
}
}
if (!m_glIntegration)
@@ -689,7 +689,7 @@ QXcbScreen *QXcbConnection::primaryScreen() const
return m_screens.first();
}
- return Q_NULLPTR;
+ return nullptr;
}
void QXcbConnection::addWindowEventListener(xcb_window_t id, QXcbWindowEventListener *eventListener)
@@ -983,6 +983,12 @@ static Qt::MouseButtons translateMouseButtons(int s)
return ret;
}
+void QXcbConnection::setButtonState(Qt::MouseButton button, bool down)
+{
+ m_buttonState.setFlag(button, down);
+ m_button = button;
+}
+
Qt::MouseButton QXcbConnection::translateMouseButton(xcb_button_t s)
{
switch (s) {
@@ -1055,7 +1061,7 @@ void QXcbConnection::handleXcbEvent(xcb_generic_event_t *event)
// the event explicitly contains the state of the three first buttons,
// the rest we need to manage ourselves
m_buttonState = (m_buttonState & ~0x7) | translateMouseButtons(ev->state);
- m_buttonState |= translateMouseButton(ev->detail);
+ setButtonState(translateMouseButton(ev->detail), true);
if (Q_UNLIKELY(lcQpaXInputEvents().isDebugEnabled()))
qCDebug(lcQpaXInputEvents, "legacy mouse press, button %d state %X", ev->detail, static_cast<unsigned int>(m_buttonState));
HANDLE_PLATFORM_WINDOW_EVENT(xcb_button_press_event_t, event, handleButtonPressEvent);
@@ -1064,7 +1070,7 @@ void QXcbConnection::handleXcbEvent(xcb_generic_event_t *event)
xcb_button_release_event_t *ev = (xcb_button_release_event_t *)event;
m_keyboard->updateXKBStateFromCore(ev->state);
m_buttonState = (m_buttonState & ~0x7) | translateMouseButtons(ev->state);
- m_buttonState &= ~translateMouseButton(ev->detail);
+ setButtonState(translateMouseButton(ev->detail), false);
if (Q_UNLIKELY(lcQpaXInputEvents().isDebugEnabled()))
qCDebug(lcQpaXInputEvents, "legacy mouse release, button %d state %X", ev->detail, static_cast<unsigned int>(m_buttonState));
HANDLE_PLATFORM_WINDOW_EVENT(xcb_button_release_event_t, event, handleButtonReleaseEvent);
@@ -1413,7 +1419,7 @@ void QXcbConnection::setFocusWindow(QWindow *w)
void QXcbConnection::setMouseGrabber(QXcbWindow *w)
{
m_mouseGrabber = w;
- m_mousePressWindow = Q_NULLPTR;
+ m_mousePressWindow = nullptr;
}
void QXcbConnection::setMousePressWindow(QXcbWindow *w)
{
@@ -2070,7 +2076,8 @@ const xcb_format_t *QXcbConnection::formatForDepth(uint8_t depth) const
xcb_format_next(&iterator);
}
- return 0;
+ qWarning() << "XCB failed to find an xcb_format_t for depth:" << depth;
+ return nullptr;
}
void QXcbConnection::sync()
diff --git a/src/plugins/platforms/xcb/qxcbconnection.h b/src/plugins/platforms/xcb/qxcbconnection.h
index 999dc0630c..725c01f77d 100644
--- a/src/plugins/platforms/xcb/qxcbconnection.h
+++ b/src/plugins/platforms/xcb/qxcbconnection.h
@@ -409,6 +409,15 @@ public:
const xcb_setup_t *setup() const { return m_setup; }
const xcb_format_t *formatForDepth(uint8_t depth) const;
+ bool imageNeedsEndianSwap() const
+ {
+#if Q_BYTE_ORDER == Q_BIG_ENDIAN
+ return m_setup->image_byte_order != XCB_IMAGE_ORDER_MSB_FIRST;
+#else
+ return m_setup->image_byte_order != XCB_IMAGE_ORDER_LSB_FIRST;
+#endif
+ }
+
QXcbKeyboard *keyboard() const { return m_keyboard; }
#ifndef QT_NO_CLIPBOARD
@@ -476,8 +485,9 @@ public:
xcb_window_t getSelectionOwner(xcb_atom_t atom) const;
xcb_window_t getQtSelectionOwner();
- void setButtonState(Qt::MouseButton button, bool down) { m_buttonState.setFlag(button, down); }
+ void setButtonState(Qt::MouseButton button, bool down);
Qt::MouseButtons buttonState() const { return m_buttonState; }
+ Qt::MouseButton button() const { return m_button; }
Qt::MouseButton translateMouseButton(xcb_button_t s);
QXcbWindow *focusWindow() const { return m_focusWindow; }
@@ -691,6 +701,7 @@ private:
bool has_render_extension = false;
Qt::MouseButtons m_buttonState = 0;
+ Qt::MouseButton m_button = Qt::NoButton;
QXcbWindow *m_focusWindow = nullptr;
QXcbWindow *m_mouseGrabber = nullptr;
diff --git a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
index f90f189146..e60b5213ff 100644
--- a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
+++ b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
@@ -1333,7 +1333,7 @@ QXcbConnection::TabletData *QXcbConnection::tabletDataForDevice(int id)
if (m_tabletData.at(i).deviceId == id)
return &m_tabletData[i];
}
- return Q_NULLPTR;
+ return nullptr;
}
#endif // QT_CONFIG(tabletevent)
diff --git a/src/plugins/platforms/xcb/qxcbcursor.cpp b/src/plugins/platforms/xcb/qxcbcursor.cpp
index da63360333..34b7d0d236 100644
--- a/src/plugins/platforms/xcb/qxcbcursor.cpp
+++ b/src/plugins/platforms/xcb/qxcbcursor.cpp
@@ -255,29 +255,29 @@ static const uint8_t * const cursor_bits20[] = {
forbidden_bits, forbiddenm_bits
};
-static const char * const cursorNames[] = {
- "left_ptr",
- "up_arrow",
- "cross",
- "wait",
- "ibeam",
- "size_ver",
- "size_hor",
- "size_bdiag",
- "size_fdiag",
- "size_all",
- "blank",
- "split_v",
- "split_h",
- "pointing_hand",
- "forbidden",
- "whats_this",
- "left_ptr_watch",
- "openhand",
- "closedhand",
- "copy",
- "move",
- "link"
+static const std::vector<const char *> cursorNames[] = {
+ { "left_ptr", "default", "top_left_arrow", "left_arrow" },
+ { "up_arrow" },
+ { "cross" },
+ { "wait", "watch", "0426c94ea35c87780ff01dc239897213" },
+ { "ibeam", "text", "xterm" },
+ { "size_ver", "ns-resize", "v_double_arrow", "00008160000006810000408080010102" },
+ { "size_hor", "ew-resize", "h_double_arrow", "028006030e0e7ebffc7f7070c0600140" },
+ { "size_bdiag", "nesw-resize", "50585d75b494802d0151028115016902", "fcf1c3c7cd4491d801f1e1c78f100000" },
+ { "size_fdiag", "nwse-resize", "38c5dff7c7b8962045400281044508d2", "c7088f0f3e6c8088236ef8e1e3e70000" },
+ { "size_all" },
+ { "blank" },
+ { "split_v", "row-resize", "sb_v_double_arrow", "2870a09082c103050810ffdffffe0204", "c07385c7190e701020ff7ffffd08103c" },
+ { "split_h", "col-resize", "sb_h_double_arrow", "043a9f68147c53184671403ffa811cc5", "14fef782d02440884392942c11205230" },
+ { "pointing_hand", "pointer", "hand1", "e29285e634086352946a0e7090d73106" },
+ { "forbidden", "not-allowed", "crossed_circle", "circle", "03b6e0fcb3499374a867c041f52298f0" },
+ { "whats_this", "help", "question_arrow", "5c6cd98b3f3ebcb1f9c7f1c204630408", "d9ce0ab605698f320427677b458ad60b" },
+ { "left_ptr_watch", "half-busy", "progress", "00000000000000020006000e7e9ffc3f", "08e8e1c95fe2fc01f976f1e063a24ccd" },
+ { "openhand", "fleur", "5aca4d189052212118709018842178c0", "9d800788f1b08800ae810202380a0822" },
+ { "closedhand", "grabbing", "208530c400c041818281048008011002" },
+ { "dnd-copy", "copy" },
+ { "dnd-move", "move" },
+ { "dnd-link", "link" }
};
QXcbCursorCacheKey::QXcbCursorCacheKey(const QCursor &c)
@@ -535,22 +535,13 @@ static xcb_cursor_t loadCursor(void *dpy, int cshape)
xcb_cursor_t cursor = XCB_NONE;
if (!ptrXcursorLibraryLoadCursor || !dpy)
return cursor;
- switch (cshape) {
- case Qt::DragCopyCursor:
- cursor = ptrXcursorLibraryLoadCursor(dpy, "dnd-copy");
- break;
- case Qt::DragMoveCursor:
- cursor = ptrXcursorLibraryLoadCursor(dpy, "dnd-move");
- break;
- case Qt::DragLinkCursor:
- cursor = ptrXcursorLibraryLoadCursor(dpy, "dnd-link");
- break;
- default:
- break;
- }
- if (!cursor) {
- cursor = ptrXcursorLibraryLoadCursor(dpy, cursorNames[cshape]);
+
+ for (const char *cursorName: cursorNames[cshape]) {
+ cursor = ptrXcursorLibraryLoadCursor(dpy, cursorName);
+ if (cursor != XCB_NONE)
+ break;
}
+
return cursor;
}
#endif // QT_CONFIG(xcb_xlib) / QT_CONFIG(library)
@@ -565,7 +556,6 @@ xcb_cursor_t QXcbCursor::createFontCursor(int cshape)
#if QT_CONFIG(xcb_xlib) && QT_CONFIG(library)
if (cshape >= 0 && cshape <= Qt::LastCursor) {
void *dpy = connection()->xlib_display();
- // special case for non-standard dnd-* cursors
cursor = loadCursor(dpy, cshape);
if (!cursor && !m_gtkCursorThemeInitialized && m_screen->xSettings()->initialized()) {
QByteArray gtkCursorTheme = m_screen->xSettings()->setting("Gtk/CursorThemeName").toByteArray();
@@ -598,7 +588,7 @@ xcb_cursor_t QXcbCursor::createFontCursor(int cshape)
}
if (cursor && cshape >= 0 && cshape < Qt::LastCursor && connection()->hasXFixes()) {
- const char *name = cursorNames[cshape];
+ const char *name = cursorNames[cshape].front();
xcb_xfixes_set_cursor_name(conn, cursor, strlen(name), name);
}
@@ -660,7 +650,7 @@ QPoint QXcbCursor::pos() const
void QXcbCursor::setPos(const QPoint &pos)
{
- QXcbVirtualDesktop *virtualDesktop = Q_NULLPTR;
+ QXcbVirtualDesktop *virtualDesktop = nullptr;
queryPointer(connection(), &virtualDesktop, 0);
xcb_warp_pointer(xcb_connection(), XCB_NONE, virtualDesktop->root(), 0, 0, 0, 0, pos.x(), pos.y());
xcb_flush(xcb_connection());
diff --git a/src/plugins/platforms/xcb/qxcbdrag.cpp b/src/plugins/platforms/xcb/qxcbdrag.cpp
index d4521de8e0..18f5ff4f0d 100644
--- a/src/plugins/platforms/xcb/qxcbdrag.cpp
+++ b/src/plugins/platforms/xcb/qxcbdrag.cpp
@@ -208,7 +208,7 @@ void QXcbDrag::startDrag()
setScreen(current_virtual_desktop->screens().constFirst()->screen());
initiatorWindow = QGuiApplicationPrivate::currentMouseWindow;
QBasicDrag::startDrag();
- if (connection()->mouseGrabber() == Q_NULLPTR)
+ if (connection()->mouseGrabber() == nullptr)
shapedPixmapWindow()->setMouseGrabEnabled(true);
}
@@ -308,7 +308,7 @@ void QXcbDrag::move(const QPoint &globalPos)
if (source_sameanswer.contains(globalPos) && source_sameanswer.isValid())
return;
- QXcbVirtualDesktop *virtualDesktop = Q_NULLPTR;
+ QXcbVirtualDesktop *virtualDesktop = nullptr;
QPoint cursorPos;
QXcbCursor::queryPointer(connection(), &virtualDesktop, &cursorPos);
QXcbScreen *screen = virtualDesktop->screenAt(cursorPos);
@@ -317,7 +317,7 @@ void QXcbDrag::move(const QPoint &globalPos)
if (virtualDesktop != current_virtual_desktop) {
setUseCompositing(virtualDesktop->compositingActive());
recreateShapedPixmapWindow(static_cast<QPlatformScreen*>(screen)->screen(), deviceIndependentPos);
- if (connection()->mouseGrabber() == Q_NULLPTR)
+ if (connection()->mouseGrabber() == nullptr)
shapedPixmapWindow()->setMouseGrabEnabled(true);
current_virtual_desktop = virtualDesktop;
diff --git a/src/plugins/platforms/xcb/qxcbimage.cpp b/src/plugins/platforms/xcb/qxcbimage.cpp
index 36536e0602..e18a08755b 100644
--- a/src/plugins/platforms/xcb/qxcbimage.cpp
+++ b/src/plugins/platforms/xcb/qxcbimage.cpp
@@ -38,6 +38,7 @@
****************************************************************************/
#include "qxcbimage.h"
+#include <QtCore/QtEndian>
#include <QtGui/QColor>
#include <QtGui/private/qimage_p.h>
#include <QtGui/private/qdrawhelper_p.h>
@@ -52,47 +53,108 @@ extern "C" {
#undef template
#endif
+#include "qxcbconnection.h"
+#include "qxcbintegration.h"
+
+namespace {
+
+QImage::Format imageFormatForMasks(int depth, int bits_per_pixel, int red_mask, int blue_mask)
+{
+ if (bits_per_pixel == 32) {
+ switch (depth) {
+ case 32:
+ if (red_mask == 0xff0000 && blue_mask == 0xff)
+ return QImage::Format_ARGB32_Premultiplied;
+#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN
+ if (red_mask == 0xff && blue_mask == 0xff0000)
+ return QImage::Format_RGBA8888_Premultiplied;
+#else
+ if (red_mask == 0xff000000 && blue_mask == 0xff00)
+ return QImage::Format_RGBA8888_Premultiplied;
+#endif
+ if (red_mask == 0x3ff && blue_mask == 0x3ff00000)
+ return QImage::Format_A2BGR30_Premultiplied;
+ if (red_mask == 0x3ff00000 && blue_mask == 0x3ff)
+ return QImage::Format_A2RGB30_Premultiplied;
+ break;
+ case 30:
+ if (red_mask == 0x3ff && blue_mask == 0x3ff00000)
+ return QImage::Format_BGR30;
+ if (blue_mask == 0x3ff && red_mask == 0x3ff00000)
+ return QImage::Format_RGB30;
+ break;
+ case 24:
+ if (red_mask == 0xff0000 && blue_mask == 0xff)
+ return QImage::Format_RGB32;
+#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN
+ if (red_mask == 0xff && blue_mask == 0xff0000)
+ return QImage::Format_RGBX8888;
+#else
+ if (red_mask == 0xff000000 && blue_mask == 0xff00)
+ return QImage::Format_RGBX8888;
+#endif
+ break;
+ }
+ } else if (bits_per_pixel == 16) {
+ if (depth == 16 && red_mask == 0xf800 && blue_mask == 0x1f)
+ return QImage::Format_RGB16;
+ if (depth == 15 && red_mask == 0x7c00 && blue_mask == 0x1f)
+ return QImage::Format_RGB555;
+ }
+ return QImage::Format_Invalid;
+}
+
+} // namespace
+
QT_BEGIN_NAMESPACE
-QImage::Format qt_xcb_imageFormatForVisual(QXcbConnection *connection, uint8_t depth,
- const xcb_visualtype_t *visual)
+bool qt_xcb_imageFormatForVisual(QXcbConnection *connection, uint8_t depth, const xcb_visualtype_t *visual,
+ QImage::Format *imageFormat, bool *needsRgbSwap)
{
+ Q_ASSERT(connection && visual && imageFormat);
+
+ if (needsRgbSwap)
+ *needsRgbSwap = false;
+ *imageFormat = QImage::Format_Invalid;
+
+ if (depth == 8) {
+ if (visual->_class == XCB_VISUAL_CLASS_GRAY_SCALE) {
+ *imageFormat = QImage::Format_Grayscale8;
+ return true;
+ }
+#if QT_CONFIG(xcb_native_painting)
+ if (QXcbIntegration::instance() && QXcbIntegration::instance()->nativePaintingEnabled()) {
+ *imageFormat = QImage::Format_Indexed8;
+ return true;
+ }
+#endif
+ return false;
+ }
+
const xcb_format_t *format = connection->formatForDepth(depth);
+ if (!format)
+ return false;
+
+ const bool connectionEndianSwap = connection->imageNeedsEndianSwap();
+ // We swap the masks and see if we can recognize it as a host format
+ const quint32 red_mask = connectionEndianSwap ? qbswap(visual->red_mask) : visual->red_mask;
+ const quint32 blue_mask = connectionEndianSwap ? qbswap(visual->blue_mask) : visual->blue_mask;
- if (!visual || !format)
- return QImage::Format_Invalid;
-
- if (depth == 32 && format->bits_per_pixel == 32 && visual->red_mask == 0xff0000
- && visual->green_mask == 0xff00 && visual->blue_mask == 0xff)
- return QImage::Format_ARGB32_Premultiplied;
-
- if (depth == 30 && format->bits_per_pixel == 32 && visual->red_mask == 0x3ff
- && visual->green_mask == 0x0ffc00 && visual->blue_mask == 0x3ff00000)
- return QImage::Format_BGR30;
-
- if (depth == 30 && format->bits_per_pixel == 32 && visual->blue_mask == 0x3ff
- && visual->green_mask == 0x0ffc00 && visual->red_mask == 0x3ff00000)
- return QImage::Format_RGB30;
-
- if (depth == 24 && format->bits_per_pixel == 32 && visual->red_mask == 0xff0000
- && visual->green_mask == 0xff00 && visual->blue_mask == 0xff)
- return QImage::Format_RGB32;
-
- if (QSysInfo::ByteOrder == QSysInfo::LittleEndian) {
- if (depth == 24 && format->bits_per_pixel == 32 && visual->blue_mask == 0xff0000
- && visual->green_mask == 0xff00 && visual->red_mask == 0xff)
- return QImage::Format_RGBX8888;
- } else {
- if (depth == 24 && format->bits_per_pixel == 32 && visual->blue_mask == 0xff00
- && visual->green_mask == 0xff0000 && visual->red_mask == 0xff000000)
- return QImage::Format_RGBX8888;
+ *imageFormat = imageFormatForMasks(depth, format->bits_per_pixel, red_mask, blue_mask);
+ if (*imageFormat != QImage::Format_Invalid)
+ return true;
+
+ if (needsRgbSwap) {
+ *imageFormat = imageFormatForMasks(depth, format->bits_per_pixel, blue_mask, red_mask);
+ if (*imageFormat != QImage::Format_Invalid) {
+ *needsRgbSwap = true;
+ return true;
+ }
}
- if (depth == 16 && format->bits_per_pixel == 16 && visual->red_mask == 0xf800
- && visual->green_mask == 0x7e0 && visual->blue_mask == 0x1f)
- return QImage::Format_RGB16;
+ qWarning("Unsupported screen format: depth: %d, bits_per_pixel: %d, red_mask: %x, blue_mask: %x", depth, format->bits_per_pixel, red_mask, blue_mask);
- return QImage::Format_Invalid;
+ return false;
}
QPixmap qt_xcb_pixmapFromXPixmap(QXcbConnection *connection, xcb_pixmap_t pixmap,
@@ -112,44 +174,14 @@ QPixmap qt_xcb_pixmapFromXPixmap(QXcbConnection *connection, xcb_pixmap_t pixmap
QPixmap result;
- QImage::Format format = qt_xcb_imageFormatForVisual(connection, depth, visual);
- if (format != QImage::Format_Invalid) {
+ QImage::Format format;
+ bool needsRgbSwap;
+ if (qt_xcb_imageFormatForVisual(connection, depth, visual, &format, &needsRgbSwap)) {
uint32_t bytes_per_line = length / height;
QImage image(const_cast<uint8_t *>(data), width, height, bytes_per_line, format);
- uint8_t image_byte_order = connection->setup()->image_byte_order;
-
- // we may have to swap the byte order
- if ((QSysInfo::ByteOrder == QSysInfo::LittleEndian && image_byte_order == XCB_IMAGE_ORDER_MSB_FIRST)
- || (QSysInfo::ByteOrder == QSysInfo::BigEndian && image_byte_order == XCB_IMAGE_ORDER_LSB_FIRST))
- {
- for (int i=0; i < image.height(); i++) {
- switch (format) {
- case QImage::Format_RGB16: {
- ushort *p = (ushort*)image.scanLine(i);
- ushort *end = p + image.width();
- while (p < end) {
- *p = ((*p << 8) & 0xff00) | ((*p >> 8) & 0x00ff);
- p++;
- }
- break;
- }
- case QImage::Format_RGB32:
- case QImage::Format_ARGB32_Premultiplied:
- case QImage::Format_RGBX8888: {
- uint *p = (uint*)image.scanLine(i);
- uint *end = p + image.width();
- while (p < end) {
- *p = ((*p << 24) & 0xff000000) | ((*p << 8) & 0x00ff0000)
- | ((*p >> 8) & 0x0000ff00) | ((*p >> 24) & 0x000000ff);
- p++;
- }
- break;
- }
- default:
- Q_ASSERT(false);
- }
- }
- }
+
+ if (needsRgbSwap)
+ image = std::move(image).rgbSwapped();
// fix-up alpha channel
if (format == QImage::Format_RGB32 || format == QImage::Format_RGBX8888) {
diff --git a/src/plugins/platforms/xcb/qxcbimage.h b/src/plugins/platforms/xcb/qxcbimage.h
index a9071a45de..d718089ec2 100644
--- a/src/plugins/platforms/xcb/qxcbimage.h
+++ b/src/plugins/platforms/xcb/qxcbimage.h
@@ -48,8 +48,8 @@
QT_BEGIN_NAMESPACE
-QImage::Format qt_xcb_imageFormatForVisual(QXcbConnection *connection,
- uint8_t depth, const xcb_visualtype_t *visual);
+bool qt_xcb_imageFormatForVisual(QXcbConnection *connection, uint8_t depth, const xcb_visualtype_t *visual,
+ QImage::Format *imageFormat, bool *needsRgbSwap = nullptr);
QPixmap qt_xcb_pixmapFromXPixmap(QXcbConnection *connection, xcb_pixmap_t pixmap,
int width, int height, int depth,
const xcb_visualtype_t *visual);
diff --git a/src/plugins/platforms/xcb/qxcbintegration.cpp b/src/plugins/platforms/xcb/qxcbintegration.cpp
index 72d31060db..6afa7bc934 100644
--- a/src/plugins/platforms/xcb/qxcbintegration.cpp
+++ b/src/plugins/platforms/xcb/qxcbintegration.cpp
@@ -121,7 +121,7 @@ static bool runningUnderDebugger()
#endif
}
-QXcbIntegration *QXcbIntegration::m_instance = Q_NULLPTR;
+QXcbIntegration *QXcbIntegration::m_instance = nullptr;
QXcbIntegration::QXcbIntegration(const QStringList &parameters, int &argc, char **argv)
: m_services(new QGenericUnixServices)
@@ -222,7 +222,7 @@ QXcbIntegration::QXcbIntegration(const QStringList &parameters, int &argc, char
QXcbIntegration::~QXcbIntegration()
{
qDeleteAll(m_connections);
- m_instance = Q_NULLPTR;
+ m_instance = nullptr;
}
QPlatformPixmap *QXcbIntegration::createPlatformPixmap(QPlatformPixmap::PixelType type) const
@@ -274,7 +274,7 @@ QPlatformOpenGLContext *QXcbIntegration::createPlatformOpenGLContext(QOpenGLCont
QXcbGlIntegration *glIntegration = screen->connection()->glIntegration();
if (!glIntegration) {
qWarning("QXcbIntegration: Cannot create platform OpenGL context, neither GLX nor EGL are enabled");
- return Q_NULLPTR;
+ return nullptr;
}
return glIntegration->createPlatformOpenGLContext(context);
}
@@ -296,7 +296,7 @@ QPlatformOffscreenSurface *QXcbIntegration::createPlatformOffscreenSurface(QOffs
QXcbGlIntegration *glIntegration = screen->connection()->glIntegration();
if (!glIntegration) {
qWarning("QXcbIntegration: Cannot create platform offscreen surface, neither GLX nor EGL are enabled");
- return Q_NULLPTR;
+ return nullptr;
}
return glIntegration->createPlatformOffscreenSurface(surface);
}
diff --git a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp
index caa9499c45..d989761297 100644
--- a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp
+++ b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp
@@ -101,7 +101,7 @@ QXcbNativeInterface::QXcbNativeInterface() :
static inline QXcbSystemTrayTracker *systemTrayTracker(const QScreen *s)
{
if (!s)
- return Q_NULLPTR;
+ return nullptr;
return static_cast<const QXcbScreen *>(s->handle())->connection()->systemTrayTracker();
}
@@ -194,7 +194,7 @@ void *QXcbNativeInterface::nativeResourceForScreen(const QByteArray &resourceStr
{
if (!screen) {
qWarning("nativeResourceForScreen: null screen");
- return Q_NULLPTR;
+ return nullptr;
}
QByteArray lowerCaseResource = resourceString.toLower();
@@ -236,7 +236,7 @@ void *QXcbNativeInterface::nativeResourceForScreen(const QByteArray &resourceStr
break;
case CompositingEnabled:
if (QXcbVirtualDesktop *vd = xcbScreen->virtualDesktop())
- result = vd->compositingActive() ? this : Q_NULLPTR;
+ result = vd->compositingActive() ? this : nullptr;
break;
default:
break;
@@ -294,7 +294,7 @@ void *QXcbNativeInterface::nativeResourceForCursor(const QByteArray &resource, c
}
}
}
- return Q_NULLPTR;
+ return nullptr;
}
#endif // !QT_NO_CURSOR
@@ -323,7 +323,7 @@ QPlatformNativeInterface::NativeResourceForContextFunction QXcbNativeInterface::
QPlatformNativeInterface::NativeResourceForContextFunction func = handlerNativeResourceFunctionForContext(lowerCaseResource);
if (func)
return func;
- return Q_NULLPTR;
+ return nullptr;
}
QPlatformNativeInterface::NativeResourceForScreenFunction QXcbNativeInterface::nativeResourceFunctionForScreen(const QByteArray &resource)
@@ -390,13 +390,13 @@ QFunctionPointer QXcbNativeInterface::platformFunction(const QByteArray &functio
if (function == QXcbScreenFunctions::virtualDesktopNumberIdentifier())
return QFunctionPointer(QXcbScreenFunctions::VirtualDesktopNumber(QXcbScreen::virtualDesktopNumberStatic));
- return Q_NULLPTR;
+ return nullptr;
}
void *QXcbNativeInterface::appTime(const QXcbScreen *screen)
{
if (!screen)
- return Q_NULLPTR;
+ return nullptr;
return reinterpret_cast<void *>(quintptr(screen->connection()->time()));
}
@@ -404,7 +404,7 @@ void *QXcbNativeInterface::appTime(const QXcbScreen *screen)
void *QXcbNativeInterface::appUserTime(const QXcbScreen *screen)
{
if (!screen)
- return Q_NULLPTR;
+ return nullptr;
return reinterpret_cast<void *>(quintptr(screen->connection()->netWmUserTime()));
}
@@ -412,7 +412,7 @@ void *QXcbNativeInterface::appUserTime(const QXcbScreen *screen)
void *QXcbNativeInterface::getTimestamp(const QXcbScreen *screen)
{
if (!screen)
- return Q_NULLPTR;
+ return nullptr;
return reinterpret_cast<void *>(quintptr(screen->connection()->getTimestamp()));
}
@@ -452,7 +452,7 @@ void *QXcbNativeInterface::display()
if (defaultConnection)
return defaultConnection->xlib_display();
#endif
- return Q_NULLPTR;
+ return nullptr;
}
void *QXcbNativeInterface::connection()
@@ -525,10 +525,10 @@ QXcbScreen *QXcbNativeInterface::qPlatformScreenForWindow(QWindow *window)
QXcbScreen *screen;
if (window) {
QScreen *qs = window->screen();
- screen = static_cast<QXcbScreen *>(qs ? qs->handle() : Q_NULLPTR);
+ screen = static_cast<QXcbScreen *>(qs ? qs->handle() : nullptr);
} else {
QScreen *qs = QGuiApplication::primaryScreen();
- screen = static_cast<QXcbScreen *>(qs ? qs->handle() : Q_NULLPTR);
+ screen = static_cast<QXcbScreen *>(qs ? qs->handle() : nullptr);
}
return screen;
}
@@ -537,23 +537,23 @@ void *QXcbNativeInterface::displayForWindow(QWindow *window)
{
#if QT_CONFIG(xcb_xlib)
QXcbScreen *screen = qPlatformScreenForWindow(window);
- return screen ? screen->connection()->xlib_display() : Q_NULLPTR;
+ return screen ? screen->connection()->xlib_display() : nullptr;
#else
Q_UNUSED(window);
- return Q_NULLPTR;
+ return nullptr;
#endif
}
void *QXcbNativeInterface::connectionForWindow(QWindow *window)
{
QXcbScreen *screen = qPlatformScreenForWindow(window);
- return screen ? screen->xcb_connection() : Q_NULLPTR;
+ return screen ? screen->xcb_connection() : nullptr;
}
void *QXcbNativeInterface::screenForWindow(QWindow *window)
{
QXcbScreen *screen = qPlatformScreenForWindow(window);
- return screen ? screen->screen() : Q_NULLPTR;
+ return screen ? screen->screen() : nullptr;
}
void QXcbNativeInterface::addHandler(QXcbNativeInterfaceHandler *handler)
@@ -575,7 +575,7 @@ QPlatformNativeInterface::NativeResourceForIntegrationFunction QXcbNativeInterfa
if (result)
return result;
}
- return Q_NULLPTR;
+ return nullptr;
}
QPlatformNativeInterface::NativeResourceForContextFunction QXcbNativeInterface::handlerNativeResourceFunctionForContext(const QByteArray &resource) const
@@ -586,7 +586,7 @@ QPlatformNativeInterface::NativeResourceForContextFunction QXcbNativeInterface::
if (result)
return result;
}
- return Q_NULLPTR;
+ return nullptr;
}
QPlatformNativeInterface::NativeResourceForScreenFunction QXcbNativeInterface::handlerNativeResourceFunctionForScreen(const QByteArray &resource) const
@@ -597,7 +597,7 @@ QPlatformNativeInterface::NativeResourceForScreenFunction QXcbNativeInterface::h
if (result)
return result;
}
- return Q_NULLPTR;
+ return nullptr;
}
QPlatformNativeInterface::NativeResourceForWindowFunction QXcbNativeInterface::handlerNativeResourceFunctionForWindow(const QByteArray &resource) const
@@ -608,7 +608,7 @@ QPlatformNativeInterface::NativeResourceForWindowFunction QXcbNativeInterface::h
if (result)
return result;
}
- return Q_NULLPTR;
+ return nullptr;
}
QPlatformNativeInterface::NativeResourceForBackingStoreFunction QXcbNativeInterface::handlerNativeResourceFunctionForBackingStore(const QByteArray &resource) const
@@ -619,7 +619,7 @@ QPlatformNativeInterface::NativeResourceForBackingStoreFunction QXcbNativeInterf
if (result)
return result;
}
- return Q_NULLPTR;
+ return nullptr;
}
QFunctionPointer QXcbNativeInterface::handlerPlatformFunction(const QByteArray &function) const
@@ -630,7 +630,7 @@ QFunctionPointer QXcbNativeInterface::handlerPlatformFunction(const QByteArray &
if (func)
return func;
}
- return Q_NULLPTR;
+ return nullptr;
}
void *QXcbNativeInterface::handlerNativeResourceForIntegration(const QByteArray &resource) const
@@ -638,7 +638,7 @@ void *QXcbNativeInterface::handlerNativeResourceForIntegration(const QByteArray
NativeResourceForIntegrationFunction func = handlerNativeResourceFunctionForIntegration(resource);
if (func)
return func();
- return Q_NULLPTR;
+ return nullptr;
}
void *QXcbNativeInterface::handlerNativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) const
@@ -646,7 +646,7 @@ void *QXcbNativeInterface::handlerNativeResourceForContext(const QByteArray &res
NativeResourceForContextFunction func = handlerNativeResourceFunctionForContext(resource);
if (func)
return func(context);
- return Q_NULLPTR;
+ return nullptr;
}
void *QXcbNativeInterface::handlerNativeResourceForScreen(const QByteArray &resource, QScreen *screen) const
@@ -654,7 +654,7 @@ void *QXcbNativeInterface::handlerNativeResourceForScreen(const QByteArray &reso
NativeResourceForScreenFunction func = handlerNativeResourceFunctionForScreen(resource);
if (func)
return func(screen);
- return Q_NULLPTR;
+ return nullptr;
}
void *QXcbNativeInterface::handlerNativeResourceForWindow(const QByteArray &resource, QWindow *window) const
@@ -662,7 +662,7 @@ void *QXcbNativeInterface::handlerNativeResourceForWindow(const QByteArray &reso
NativeResourceForWindowFunction func = handlerNativeResourceFunctionForWindow(resource);
if (func)
return func(window);
- return Q_NULLPTR;
+ return nullptr;
}
void *QXcbNativeInterface::handlerNativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) const
@@ -670,7 +670,7 @@ void *QXcbNativeInterface::handlerNativeResourceForBackingStore(const QByteArray
NativeResourceForBackingStoreFunction func = handlerNativeResourceFunctionForBackingStore(resource);
if (func)
return func(backingStore);
- return Q_NULLPTR;
+ return nullptr;
}
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/xcb/qxcbscreen.cpp b/src/plugins/platforms/xcb/qxcbscreen.cpp
index ec0f9ba561..cdeafa8cba 100644
--- a/src/plugins/platforms/xcb/qxcbscreen.cpp
+++ b/src/plugins/platforms/xcb/qxcbscreen.cpp
@@ -140,7 +140,7 @@ QXcbScreen *QXcbVirtualDesktop::screenAt(const QPoint &pos) const
if (screen->virtualDesktop() == this && screen->geometry().contains(pos))
return screen;
}
- return Q_NULLPTR;
+ return nullptr;
}
void QXcbVirtualDesktop::addScreen(QPlatformScreen *s)
@@ -583,7 +583,9 @@ QRect QXcbScreen::availableGeometry() const
QImage::Format QXcbScreen::format() const
{
- return qt_xcb_imageFormatForVisual(connection(), screen()->root_depth, visualForId(screen()->root_visual));
+ QImage::Format format;
+ qt_xcb_imageFormatForVisual(connection(), screen()->root_depth, visualForId(screen()->root_visual), &format);
+ return format;
}
QDpi QXcbScreen::virtualDpi() const
diff --git a/src/plugins/platforms/xcb/qxcbscreen.h b/src/plugins/platforms/xcb/qxcbscreen.h
index 842738b622..4a9b1bd209 100644
--- a/src/plugins/platforms/xcb/qxcbscreen.h
+++ b/src/plugins/platforms/xcb/qxcbscreen.h
@@ -140,7 +140,7 @@ class Q_XCB_EXPORT QXcbScreen : public QXcbObject, public QPlatformScreen
public:
QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop,
xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo,
- const xcb_xinerama_screen_info_t *xineramaScreenInfo = Q_NULLPTR, int xineramaScreenIdx = -1);
+ const xcb_xinerama_screen_info_t *xineramaScreenInfo = nullptr, int xineramaScreenIdx = -1);
~QXcbScreen();
QString getOutputName(xcb_randr_get_output_info_reply_t *outputInfo);
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp
index c8a668b72c..5ea865f74a 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.cpp
+++ b/src/plugins/platforms/xcb/qxcbwindow.cpp
@@ -51,6 +51,7 @@
#include "qxcbscreen.h"
#include "qxcbdrag.h"
#include "qxcbkeyboard.h"
+#include "qxcbimage.h"
#include "qxcbwmsupport.h"
#include "qxcbimage.h"
#include "qxcbnativeinterface.h"
@@ -176,80 +177,23 @@ static inline bool isTransient(const QWindow *w)
|| w->type() == Qt::Popup;
}
-static inline QImage::Format imageFormatForVisual(int depth, quint32 red_mask, quint32 blue_mask, bool *rgbSwap)
+void QXcbWindow::setImageFormatForVisual(const xcb_visualtype_t *visual)
{
- if (rgbSwap)
- *rgbSwap = false;
- switch (depth) {
- case 32:
- if (blue_mask == 0xff)
- return QImage::Format_ARGB32_Premultiplied;
- if (red_mask == 0x3ff)
- return QImage::Format_A2BGR30_Premultiplied;
- if (blue_mask == 0x3ff)
- return QImage::Format_A2RGB30_Premultiplied;
- if (red_mask == 0xff) {
- if (rgbSwap)
- *rgbSwap = true;
- return QImage::Format_ARGB32_Premultiplied;
- }
- break;
- case 30:
- if (red_mask == 0x3ff)
- return QImage::Format_BGR30;
- if (blue_mask == 0x3ff)
- return QImage::Format_RGB30;
- break;
- case 24:
- if (blue_mask == 0xff)
- return QImage::Format_RGB32;
- if (red_mask == 0xff) {
- if (rgbSwap)
- *rgbSwap = true;
- return QImage::Format_RGB32;
- }
- break;
- case 16:
- if (blue_mask == 0x1f)
- return QImage::Format_RGB16;
- if (red_mask == 0x1f) {
- if (rgbSwap)
- *rgbSwap = true;
- return QImage::Format_RGB16;
- }
- break;
- case 15:
- if (blue_mask == 0x1f)
- return QImage::Format_RGB555;
- if (red_mask == 0x1f) {
- if (rgbSwap)
- *rgbSwap = true;
- return QImage::Format_RGB555;
- }
- break;
-#if QT_CONFIG(xcb_native_painting)
- case 8:
- if (QXcbIntegration::instance() && QXcbIntegration::instance()->nativePaintingEnabled())
- return QImage::Format_Indexed8;
- break;
-#endif
- default:
- break;
- }
- qWarning("Unsupported screen format: depth: %d, red_mask: %x, blue_mask: %x", depth, red_mask, blue_mask);
+ if (qt_xcb_imageFormatForVisual(connection(), m_depth, visual, &m_imageFormat, &m_imageRgbSwap))
+ return;
- switch (depth) {
+ switch (m_depth) {
+ case 32:
case 24:
qWarning("Using RGB32 fallback, if this works your X11 server is reporting a bad screen format.");
- return QImage::Format_RGB32;
+ m_imageFormat = QImage::Format_RGB32;
+ break;
case 16:
qWarning("Using RGB16 fallback, if this works your X11 server is reporting a bad screen format.");
- return QImage::Format_RGB16;
+ m_imageFormat = QImage::Format_RGB16;
default:
break;
}
-
- return QImage::Format_Invalid;
}
static inline bool positionIncludesFrame(QWindow *w)
@@ -287,7 +231,7 @@ static inline XTextProperty* qstringToXTP(Display *dpy, const QString& s)
if (!mapper || errCode < 0) {
mapper = QTextCodec::codecForName("latin1");
if (!mapper || !mapper->canEncode(s))
- return Q_NULLPTR;
+ return nullptr;
#endif
static QByteArray qcs;
qcs = s.toLatin1();
@@ -322,7 +266,7 @@ static QWindow *childWindowAt(QWindow *win, const QPoint &p)
&& win->geometry().contains(win->parent()->mapFromGlobal(p))) {
return win;
}
- return Q_NULLPTR;
+ return nullptr;
}
static const char *wm_window_type_property_id = "_q_xcb_wm_window_type";
@@ -381,7 +325,7 @@ void QXcbWindow::create()
}
if (!visual)
visual = platformScreen->visualForId(m_visualId);
- m_imageFormat = imageFormatForVisual(m_depth, visual->red_mask, visual->blue_mask, &m_imageRgbSwap);
+ setImageFormatForVisual(visual);
connection()->addWindowEventListener(m_window, this);
return;
}
@@ -418,7 +362,7 @@ void QXcbWindow::create()
resolveFormat(platformScreen->surfaceFormatFor(window()->requestedFormat()));
- const xcb_visualtype_t *visual = Q_NULLPTR;
+ const xcb_visualtype_t *visual = nullptr;
if (connection()->hasDefaultVisualId()) {
visual = platformScreen->visualForId(connection()->defaultVisualId());
@@ -451,7 +395,7 @@ void QXcbWindow::create()
m_visualId = visual->visual_id;
m_depth = platformScreen->depthOfVisual(m_visualId);
- m_imageFormat = imageFormatForVisual(m_depth, visual->red_mask, visual->blue_mask, &m_imageRgbSwap);
+ setImageFormatForVisual(visual);
quint32 mask = XCB_CW_BACK_PIXMAP
| XCB_CW_BORDER_PIXEL
@@ -641,7 +585,7 @@ void QXcbWindow::destroy()
if (connection()->focusWindow() == this)
doFocusOut();
if (connection()->mouseGrabber() == this)
- connection()->setMouseGrabber(Q_NULLPTR);
+ connection()->setMouseGrabber(nullptr);
if (m_syncCounter && m_usingSyncProtocol)
xcb_sync_destroy_counter(xcb_connection(), m_syncCounter);
@@ -700,6 +644,15 @@ void QXcbWindow::setGeometry(const QRect &rect)
qBound<qint32>(1, wmGeometry.height(), XCOORD_MAX),
};
xcb_configure_window(xcb_connection(), m_window, mask, reinterpret_cast<const quint32*>(values));
+ if (window()->parent() && !window()->transientParent()) {
+ // Wait for server reply for parented windows to ensure that a few window
+ // moves will come as a one event. This is important when native widget is
+ // moved a few times in X and Y directions causing native scroll. Widget
+ // must get single event to not trigger unwanted widget position changes
+ // and then expose events causing backingstore flushes with incorrect
+ // offset causing image crruption.
+ connection()->sync();
+ }
}
xcb_flush(xcb_connection());
@@ -877,12 +830,12 @@ void QXcbWindow::hide()
xcb_flush(xcb_connection());
if (connection()->mouseGrabber() == this)
- connection()->setMouseGrabber(Q_NULLPTR);
+ connection()->setMouseGrabber(nullptr);
if (QPlatformWindow *w = connection()->mousePressWindow()) {
// Unset mousePressWindow when it (or one of its parents) is unmapped
while (w) {
if (w == this) {
- connection()->setMousePressWindow(Q_NULLPTR);
+ connection()->setMousePressWindow(nullptr);
break;
}
w = w->parent();
@@ -900,7 +853,7 @@ void QXcbWindow::hide()
// Find the top level window at cursor position.
// Don't use QGuiApplication::topLevelAt(): search only the virtual siblings of this window's screen
- QWindow *enterWindow = Q_NULLPTR;
+ QWindow *enterWindow = nullptr;
const auto screens = xcbScreen()->virtualSiblings();
for (QPlatformScreen *screen : screens) {
if (screen->geometry().contains(cursorPos)) {
@@ -2000,13 +1953,14 @@ void QXcbWindow::handleClientMessageEvent(const xcb_client_message_event_t *even
return;
if (event->type == atom(QXcbAtom::WM_PROTOCOLS)) {
- if (event->data.data32[0] == atom(QXcbAtom::WM_DELETE_WINDOW)) {
+ xcb_atom_t protocolAtom = event->data.data32[0];
+ if (protocolAtom == atom(QXcbAtom::WM_DELETE_WINDOW)) {
QWindowSystemInterface::handleCloseEvent(window());
- } else if (event->data.data32[0] == atom(QXcbAtom::WM_TAKE_FOCUS)) {
+ } else if (protocolAtom == atom(QXcbAtom::WM_TAKE_FOCUS)) {
connection()->setTime(event->data.data32[1]);
relayFocusToModalWindow();
return;
- } else if (event->data.data32[0] == atom(QXcbAtom::_NET_WM_PING)) {
+ } else if (protocolAtom == atom(QXcbAtom::_NET_WM_PING)) {
if (event->window == xcbScreen()->root())
return;
@@ -2015,20 +1969,23 @@ void QXcbWindow::handleClientMessageEvent(const xcb_client_message_event_t *even
reply.response_type = XCB_CLIENT_MESSAGE;
reply.window = xcbScreen()->root();
- xcb_send_event(xcb_connection(), 0, xcbScreen()->root(), XCB_EVENT_MASK_STRUCTURE_NOTIFY | XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT, (const char *)&reply);
+ xcb_send_event(xcb_connection(), 0, xcbScreen()->root(),
+ XCB_EVENT_MASK_STRUCTURE_NOTIFY | XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT,
+ (const char *)&reply);
xcb_flush(xcb_connection());
- } else if (event->data.data32[0] == atom(QXcbAtom::_NET_WM_SYNC_REQUEST)) {
+ } else if (protocolAtom == atom(QXcbAtom::_NET_WM_SYNC_REQUEST)) {
connection()->setTime(event->data.data32[1]);
m_syncValue.lo = event->data.data32[2];
m_syncValue.hi = event->data.data32[3];
if (m_usingSyncProtocol)
m_syncState = SyncReceived;
#ifndef QT_NO_WHATSTHIS
- } else if (event->data.data32[0] == atom(QXcbAtom::_NET_WM_CONTEXT_HELP)) {
+ } else if (protocolAtom == atom(QXcbAtom::_NET_WM_CONTEXT_HELP)) {
QWindowSystemInterface::handleEnterWhatsThisEvent();
#endif
} else {
- qWarning() << "QXcbWindow: Unhandled WM_PROTOCOLS message:" << connection()->atomName(event->data.data32[0]);
+ qCWarning(lcQpaXcb, "Unhandled WM_PROTOCOLS (%s)",
+ connection()->atomName(protocolAtom).constData());
}
#ifndef QT_NO_DRAGANDDROP
} else if (event->type == atom(QXcbAtom::XdndEnter)) {
@@ -2056,7 +2013,7 @@ void QXcbWindow::handleClientMessageEvent(const xcb_client_message_event_t *even
|| event->type == atom(QXcbAtom::_GTK_LOAD_ICONTHEMES)) {
//silence the _COMPIZ and _GTK messages for now
} else {
- qWarning() << "QXcbWindow: Unhandled client message:" << connection()->atomName(event->type);
+ qCWarning(lcQpaXcb) << "Unhandled client message: " << connection()->atomName(event->type);
}
}
@@ -2165,7 +2122,8 @@ void QXcbWindow::handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *event)
}
void QXcbWindow::handleButtonPressEvent(int event_x, int event_y, int root_x, int root_y,
- int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, Qt::MouseEventSource source)
+ int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp,
+ QEvent::Type type, Qt::MouseEventSource source)
{
const bool isWheel = detail >= 4 && detail <= 7;
if (!isWheel && window() != QGuiApplication::focusWindow()) {
@@ -2214,11 +2172,12 @@ void QXcbWindow::handleButtonPressEvent(int event_x, int event_y, int root_x, in
connection()->setMousePressWindow(this);
- handleMouseEvent(timestamp, local, global, modifiers, source);
+ handleMouseEvent(timestamp, local, global, modifiers, type, source);
}
void QXcbWindow::handleButtonReleaseEvent(int event_x, int event_y, int root_x, int root_y,
- int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, Qt::MouseEventSource source)
+ int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp,
+ QEvent::Type type, Qt::MouseEventSource source)
{
QPoint local(event_x, event_y);
QPoint global(root_x, root_y);
@@ -2229,9 +2188,9 @@ void QXcbWindow::handleButtonReleaseEvent(int event_x, int event_y, int root_x,
}
if (connection()->buttonState() == Qt::NoButton)
- connection()->setMousePressWindow(Q_NULLPTR);
+ connection()->setMousePressWindow(nullptr);
- handleMouseEvent(timestamp, local, global, modifiers, source);
+ handleMouseEvent(timestamp, local, global, modifiers, type, source);
}
static inline bool doCheckUnGrabAncestor(QXcbConnection *conn)
@@ -2254,7 +2213,7 @@ static inline bool doCheckUnGrabAncestor(QXcbConnection *conn)
return true;
}
-static bool ignoreLeaveEvent(quint8 mode, quint8 detail, QXcbConnection *conn = Q_NULLPTR)
+static bool ignoreLeaveEvent(quint8 mode, quint8 detail, QXcbConnection *conn = nullptr)
{
return ((doCheckUnGrabAncestor(conn)
&& mode == XCB_NOTIFY_MODE_GRAB && detail == XCB_NOTIFY_DETAIL_ANCESTOR)
@@ -2263,7 +2222,7 @@ static bool ignoreLeaveEvent(quint8 mode, quint8 detail, QXcbConnection *conn =
|| detail == XCB_NOTIFY_DETAIL_NONLINEAR_VIRTUAL);
}
-static bool ignoreEnterEvent(quint8 mode, quint8 detail, QXcbConnection *conn = Q_NULLPTR)
+static bool ignoreEnterEvent(quint8 mode, quint8 detail, QXcbConnection *conn = nullptr)
{
return ((doCheckUnGrabAncestor(conn)
&& mode == XCB_NOTIFY_MODE_UNGRAB && detail == XCB_NOTIFY_DETAIL_ANCESTOR)
@@ -2332,7 +2291,8 @@ void QXcbWindow::handleLeaveNotifyEvent(int root_x, int root_y,
}
void QXcbWindow::handleMotionNotifyEvent(int event_x, int event_y, int root_x, int root_y,
- Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, Qt::MouseEventSource source)
+ Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp,
+ QEvent::Type type, Qt::MouseEventSource source)
{
QPoint local(event_x, event_y);
QPoint global(root_x, root_y);
@@ -2340,33 +2300,34 @@ void QXcbWindow::handleMotionNotifyEvent(int event_x, int event_y, int root_x, i
// "mousePressWindow" can be NULL i.e. if a window will be grabbed or unmapped, so set it again here.
// Unset "mousePressWindow" when mouse button isn't pressed - in some cases the release event won't arrive.
const bool isMouseButtonPressed = (connection()->buttonState() != Qt::NoButton);
- const bool hasMousePressWindow = (connection()->mousePressWindow() != Q_NULLPTR);
+ const bool hasMousePressWindow = (connection()->mousePressWindow() != nullptr);
if (isMouseButtonPressed && !hasMousePressWindow)
connection()->setMousePressWindow(this);
else if (hasMousePressWindow && !isMouseButtonPressed)
- connection()->setMousePressWindow(Q_NULLPTR);
+ connection()->setMousePressWindow(nullptr);
- handleMouseEvent(timestamp, local, global, modifiers, source);
+ handleMouseEvent(timestamp, local, global, modifiers, type, source);
}
void QXcbWindow::handleButtonPressEvent(const xcb_button_press_event_t *event)
{
Qt::KeyboardModifiers modifiers = connection()->keyboard()->translateModifiers(event->state);
handleButtonPressEvent(event->event_x, event->event_y, event->root_x, event->root_y, event->detail,
- modifiers, event->time);
+ modifiers, event->time, QEvent::MouseButtonPress);
}
void QXcbWindow::handleButtonReleaseEvent(const xcb_button_release_event_t *event)
{
Qt::KeyboardModifiers modifiers = connection()->keyboard()->translateModifiers(event->state);
handleButtonReleaseEvent(event->event_x, event->event_y, event->root_x, event->root_y, event->detail,
- modifiers, event->time);
+ modifiers, event->time, QEvent::MouseButtonRelease);
}
void QXcbWindow::handleMotionNotifyEvent(const xcb_motion_notify_event_t *event)
{
Qt::KeyboardModifiers modifiers = connection()->keyboard()->translateModifiers(event->state);
- handleMotionNotifyEvent(event->event_x, event->event_y, event->root_x, event->root_y, modifiers, event->time);
+ handleMotionNotifyEvent(event->event_x, event->event_y, event->root_x, event->root_y, modifiers,
+ event->time, QEvent::MouseMove);
}
#if QT_CONFIG(xinput2)
@@ -2417,18 +2378,18 @@ void QXcbWindow::handleXIMouseEvent(xcb_ge_event_t *event, Qt::MouseEventSource
if (Q_UNLIKELY(lcQpaXInputEvents().isDebugEnabled()))
qCDebug(lcQpaXInputEvents, "XI2 mouse press, button %d, time %d, source %s", button, ev->time, sourceName);
conn->setButtonState(button, true);
- handleButtonPressEvent(event_x, event_y, root_x, root_y, ev->detail, modifiers, ev->time, source);
+ handleButtonPressEvent(event_x, event_y, root_x, root_y, ev->detail, modifiers, ev->time, QEvent::MouseButtonPress, source);
break;
case XI_ButtonRelease:
if (Q_UNLIKELY(lcQpaXInputEvents().isDebugEnabled()))
qCDebug(lcQpaXInputEvents, "XI2 mouse release, button %d, time %d, source %s", button, ev->time, sourceName);
conn->setButtonState(button, false);
- handleButtonReleaseEvent(event_x, event_y, root_x, root_y, ev->detail, modifiers, ev->time, source);
+ handleButtonReleaseEvent(event_x, event_y, root_x, root_y, ev->detail, modifiers, ev->time, QEvent::MouseButtonRelease, source);
break;
case XI_Motion:
if (Q_UNLIKELY(lcQpaXInputEvents().isDebugEnabled()))
qCDebug(lcQpaXInputEvents, "XI2 mouse motion %d,%d, time %d, source %s", event_x, event_y, ev->time, sourceName);
- handleMotionNotifyEvent(event_x, event_y, root_x, root_y, modifiers, ev->time, source);
+ handleMotionNotifyEvent(event_x, event_y, root_x, root_y, modifiers, ev->time, QEvent::MouseMove, source);
break;
default:
qWarning() << "Unrecognized XI2 mouse event" << ev->evtype;
@@ -2473,10 +2434,13 @@ void QXcbWindow::handleXIEnterLeave(xcb_ge_event_t *event)
QXcbWindow *QXcbWindow::toWindow() { return this; }
void QXcbWindow::handleMouseEvent(xcb_timestamp_t time, const QPoint &local, const QPoint &global,
- Qt::KeyboardModifiers modifiers, Qt::MouseEventSource source)
+ Qt::KeyboardModifiers modifiers, QEvent::Type type, Qt::MouseEventSource source)
{
connection()->setTime(time);
- QWindowSystemInterface::handleMouseEvent(window(), time, local, global, connection()->buttonState(), modifiers, source);
+ Qt::MouseButton button = type == QEvent::MouseMove ? Qt::NoButton : connection()->button();
+ QWindowSystemInterface::handleMouseEvent(window(), time, local, global,
+ connection()->buttonState(), button,
+ type, modifiers, source);
}
void QXcbWindow::handleEnterNotifyEvent(const xcb_enter_notify_event_t *event)
@@ -2526,7 +2490,7 @@ void QXcbWindow::handlePropertyNotifyEvent(const xcb_property_notify_event_t *ev
m_lastWindowStateEvent = newState;
m_windowState = newState;
if ((m_windowState & Qt::WindowMinimized) && connection()->mouseGrabber() == this)
- connection()->setMouseGrabber(Q_NULLPTR);
+ connection()->setMouseGrabber(nullptr);
}
return;
} else if (event->atom == atom(QXcbAtom::_NET_FRAME_EXTENTS)) {
@@ -2594,7 +2558,7 @@ bool QXcbWindow::setKeyboardGrabEnabled(bool grab)
bool QXcbWindow::setMouseGrabEnabled(bool grab)
{
if (!grab && connection()->mouseGrabber() == this)
- connection()->setMouseGrabber(Q_NULLPTR);
+ connection()->setMouseGrabber(nullptr);
#if QT_CONFIG(xinput2)
if (connection()->hasXInput2() && !connection()->xi2MouseEventsDisabled()) {
diff --git a/src/plugins/platforms/xcb/qxcbwindow.h b/src/plugins/platforms/xcb/qxcbwindow.h
index 1ce9b0a42f..b89dddf72f 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.h
+++ b/src/plugins/platforms/xcb/qxcbwindow.h
@@ -146,7 +146,7 @@ public:
QXcbWindow *toWindow() override;
void handleMouseEvent(xcb_timestamp_t time, const QPoint &local, const QPoint &global,
- Qt::KeyboardModifiers modifiers, Qt::MouseEventSource source);
+ Qt::KeyboardModifiers modifiers, QEvent::Type type, Qt::MouseEventSource source);
void updateNetWmUserTime(xcb_timestamp_t timestamp);
@@ -188,6 +188,7 @@ public Q_SLOTS:
protected:
virtual void resolveFormat(const QSurfaceFormat &format) { m_format = format; }
virtual const xcb_visualtype_t *createVisual();
+ void setImageFormatForVisual(const xcb_visualtype_t *visual);
QXcbScreen *parentScreen();
@@ -220,13 +221,16 @@ protected:
bool compressExposeEvent(QRegion &exposeRegion);
void handleButtonPressEvent(int event_x, int event_y, int root_x, int root_y,
- int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized);
+ int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp,
+ QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized);
void handleButtonReleaseEvent(int event_x, int event_y, int root_x, int root_y,
- int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized);
+ int detail, Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp,
+ QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized);
void handleMotionNotifyEvent(int event_x, int event_y, int root_x, int root_y,
- Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized);
+ Qt::KeyboardModifiers modifiers, xcb_timestamp_t timestamp,
+ QEvent::Type type, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized);
void handleEnterNotifyEvent(int event_x, int event_y, int root_x, int root_y,
quint8 mode, quint8 detail, xcb_timestamp_t timestamp);
diff --git a/src/plugins/platformthemes/gtk3/main.cpp b/src/plugins/platformthemes/gtk3/main.cpp
index c4cd66c33b..fb1c425d8e 100644
--- a/src/plugins/platformthemes/gtk3/main.cpp
+++ b/src/plugins/platformthemes/gtk3/main.cpp
@@ -48,7 +48,7 @@ class QGtk3ThemePlugin : public QPlatformThemePlugin
Q_PLUGIN_METADATA(IID QPlatformThemeFactoryInterface_iid FILE "gtk3.json")
public:
- QPlatformTheme *create(const QString &key, const QStringList &params) Q_DECL_OVERRIDE;
+ QPlatformTheme *create(const QString &key, const QStringList &params) override;
};
QPlatformTheme *QGtk3ThemePlugin::create(const QString &key, const QStringList &params)
diff --git a/src/plugins/platformthemes/gtk3/qgtk3dialoghelpers.h b/src/plugins/platformthemes/gtk3/qgtk3dialoghelpers.h
index ba43046e04..e78a7fc6d1 100644
--- a/src/plugins/platformthemes/gtk3/qgtk3dialoghelpers.h
+++ b/src/plugins/platformthemes/gtk3/qgtk3dialoghelpers.h
@@ -63,12 +63,12 @@ public:
QGtk3ColorDialogHelper();
~QGtk3ColorDialogHelper();
- bool show(Qt::WindowFlags flags, Qt::WindowModality modality, QWindow *parent) Q_DECL_OVERRIDE;
- void exec() Q_DECL_OVERRIDE;
- void hide() Q_DECL_OVERRIDE;
+ bool show(Qt::WindowFlags flags, Qt::WindowModality modality, QWindow *parent) override;
+ void exec() override;
+ void hide() override;
- void setCurrentColor(const QColor &color) Q_DECL_OVERRIDE;
- QColor currentColor() const Q_DECL_OVERRIDE;
+ void setCurrentColor(const QColor &color) override;
+ QColor currentColor() const override;
private Q_SLOTS:
void onAccepted();
@@ -88,18 +88,18 @@ public:
QGtk3FileDialogHelper();
~QGtk3FileDialogHelper();
- bool show(Qt::WindowFlags flags, Qt::WindowModality modality, QWindow *parent) Q_DECL_OVERRIDE;
- void exec() Q_DECL_OVERRIDE;
- void hide() Q_DECL_OVERRIDE;
+ bool show(Qt::WindowFlags flags, Qt::WindowModality modality, QWindow *parent) override;
+ void exec() override;
+ void hide() override;
- bool defaultNameFilterDisables() const Q_DECL_OVERRIDE;
- void setDirectory(const QUrl &directory) Q_DECL_OVERRIDE;
- QUrl directory() const Q_DECL_OVERRIDE;
- void selectFile(const QUrl &filename) Q_DECL_OVERRIDE;
- QList<QUrl> selectedFiles() const Q_DECL_OVERRIDE;
- void setFilter() Q_DECL_OVERRIDE;
- void selectNameFilter(const QString &filter) Q_DECL_OVERRIDE;
- QString selectedNameFilter() const Q_DECL_OVERRIDE;
+ bool defaultNameFilterDisables() const override;
+ void setDirectory(const QUrl &directory) override;
+ QUrl directory() const override;
+ void selectFile(const QUrl &filename) override;
+ QList<QUrl> selectedFiles() const override;
+ void setFilter() override;
+ void selectNameFilter(const QString &filter) override;
+ QString selectedNameFilter() const override;
private Q_SLOTS:
void onAccepted();
@@ -128,12 +128,12 @@ public:
QGtk3FontDialogHelper();
~QGtk3FontDialogHelper();
- bool show(Qt::WindowFlags flags, Qt::WindowModality modality, QWindow *parent) Q_DECL_OVERRIDE;
- void exec() Q_DECL_OVERRIDE;
- void hide() Q_DECL_OVERRIDE;
+ bool show(Qt::WindowFlags flags, Qt::WindowModality modality, QWindow *parent) override;
+ void exec() override;
+ void hide() override;
- void setCurrentFont(const QFont &font) Q_DECL_OVERRIDE;
- QFont currentFont() const Q_DECL_OVERRIDE;
+ void setCurrentFont(const QFont &font) override;
+ QFont currentFont() const override;
private Q_SLOTS:
void onAccepted();
diff --git a/src/plugins/platformthemes/gtk3/qgtk3theme.h b/src/plugins/platformthemes/gtk3/qgtk3theme.h
index 52036680c6..8f03b84bb6 100644
--- a/src/plugins/platformthemes/gtk3/qgtk3theme.h
+++ b/src/plugins/platformthemes/gtk3/qgtk3theme.h
@@ -49,14 +49,14 @@ class QGtk3Theme : public QGnomeTheme
public:
QGtk3Theme();
- virtual QVariant themeHint(ThemeHint hint) const Q_DECL_OVERRIDE;
- virtual QString gtkFontName() const Q_DECL_OVERRIDE;
+ virtual QVariant themeHint(ThemeHint hint) const override;
+ virtual QString gtkFontName() const override;
- bool usePlatformNativeDialog(DialogType type) const Q_DECL_OVERRIDE;
- QPlatformDialogHelper *createPlatformDialogHelper(DialogType type) const Q_DECL_OVERRIDE;
+ bool usePlatformNativeDialog(DialogType type) const override;
+ QPlatformDialogHelper *createPlatformDialogHelper(DialogType type) const override;
- QPlatformMenu* createPlatformMenu() const Q_DECL_OVERRIDE;
- QPlatformMenuItem* createPlatformMenuItem() const Q_DECL_OVERRIDE;
+ QPlatformMenu* createPlatformMenu() const override;
+ QPlatformMenuItem* createPlatformMenuItem() const override;
static const char *name;
};
diff --git a/src/plugins/printsupport/cups/main.cpp b/src/plugins/printsupport/cups/main.cpp
index 39309a0031..cf263a7f52 100644
--- a/src/plugins/printsupport/cups/main.cpp
+++ b/src/plugins/printsupport/cups/main.cpp
@@ -52,7 +52,7 @@ class QCupsPrinterSupportPlugin : public QPlatformPrinterSupportPlugin
public:
QStringList keys() const;
- QPlatformPrinterSupport *create(const QString &) Q_DECL_OVERRIDE;
+ QPlatformPrinterSupport *create(const QString &) override;
};
QStringList QCupsPrinterSupportPlugin::keys() const
diff --git a/src/plugins/printsupport/cups/qcupsprintengine_p.h b/src/plugins/printsupport/cups/qcupsprintengine_p.h
index 0ebf6e7a0f..c99c48c7ea 100644
--- a/src/plugins/printsupport/cups/qcupsprintengine_p.h
+++ b/src/plugins/printsupport/cups/qcupsprintengine_p.h
@@ -72,8 +72,8 @@ public:
virtual ~QCupsPrintEngine();
// reimplementations QPdfPrintEngine
- void setProperty(PrintEnginePropertyKey key, const QVariant &value) Q_DECL_OVERRIDE;
- QVariant property(PrintEnginePropertyKey key) const Q_DECL_OVERRIDE;
+ void setProperty(PrintEnginePropertyKey key, const QVariant &value) override;
+ QVariant property(PrintEnginePropertyKey key) const override;
// end reimplementations QPdfPrintEngine
private:
@@ -87,8 +87,8 @@ public:
QCupsPrintEnginePrivate(QPrinter::PrinterMode m);
~QCupsPrintEnginePrivate();
- bool openPrintDevice() Q_DECL_OVERRIDE;
- void closePrintDevice() Q_DECL_OVERRIDE;
+ bool openPrintDevice() override;
+ void closePrintDevice() override;
private:
Q_DISABLE_COPY(QCupsPrintEnginePrivate)
diff --git a/src/plugins/printsupport/cups/qcupsprintersupport_p.h b/src/plugins/printsupport/cups/qcupsprintersupport_p.h
index df6507d324..42de28aec0 100644
--- a/src/plugins/printsupport/cups/qcupsprintersupport_p.h
+++ b/src/plugins/printsupport/cups/qcupsprintersupport_p.h
@@ -64,12 +64,12 @@ public:
QCupsPrinterSupport();
~QCupsPrinterSupport();
- QPrintEngine *createNativePrintEngine(QPrinter::PrinterMode printerMode, const QString &deviceId = QString()) Q_DECL_OVERRIDE;
- QPaintEngine *createPaintEngine(QPrintEngine *printEngine, QPrinter::PrinterMode) Q_DECL_OVERRIDE;
+ QPrintEngine *createNativePrintEngine(QPrinter::PrinterMode printerMode, const QString &deviceId = QString()) override;
+ QPaintEngine *createPaintEngine(QPrintEngine *printEngine, QPrinter::PrinterMode) override;
- QPrintDevice createPrintDevice(const QString &id) Q_DECL_OVERRIDE;
- QStringList availablePrintDeviceIds() const Q_DECL_OVERRIDE;
- QString defaultPrintDeviceId() const Q_DECL_OVERRIDE;
+ QPrintDevice createPrintDevice(const QString &id) override;
+ QStringList availablePrintDeviceIds() const override;
+ QString defaultPrintDeviceId() const override;
private:
QString cupsOption(int i, const QString &key) const;
diff --git a/src/plugins/printsupport/cups/qppdprintdevice.h b/src/plugins/printsupport/cups/qppdprintdevice.h
index fab7077ce4..3cd7518b14 100644
--- a/src/plugins/printsupport/cups/qppdprintdevice.h
+++ b/src/plugins/printsupport/cups/qppdprintdevice.h
@@ -69,35 +69,35 @@ public:
explicit QPpdPrintDevice(const QString &id);
virtual ~QPpdPrintDevice();
- bool isValid() const Q_DECL_OVERRIDE;
- bool isDefault() const Q_DECL_OVERRIDE;
+ bool isValid() const override;
+ bool isDefault() const override;
- QPrint::DeviceState state() const Q_DECL_OVERRIDE;
+ QPrint::DeviceState state() const override;
- QPageSize defaultPageSize() const Q_DECL_OVERRIDE;
+ QPageSize defaultPageSize() const override;
QMarginsF printableMargins(const QPageSize &pageSize, QPageLayout::Orientation orientation,
- int resolution) const Q_DECL_OVERRIDE;
+ int resolution) const override;
- int defaultResolution() const Q_DECL_OVERRIDE;
+ int defaultResolution() const override;
- QPrint::InputSlot defaultInputSlot() const Q_DECL_OVERRIDE;
+ QPrint::InputSlot defaultInputSlot() const override;
- QPrint::OutputBin defaultOutputBin() const Q_DECL_OVERRIDE;
+ QPrint::OutputBin defaultOutputBin() const override;
- QPrint::DuplexMode defaultDuplexMode() const Q_DECL_OVERRIDE;
+ QPrint::DuplexMode defaultDuplexMode() const override;
- QPrint::ColorMode defaultColorMode() const Q_DECL_OVERRIDE;
+ QPrint::ColorMode defaultColorMode() const override;
protected:
- void loadPageSizes() const Q_DECL_OVERRIDE;
- void loadResolutions() const Q_DECL_OVERRIDE;
- void loadInputSlots() const Q_DECL_OVERRIDE;
- void loadOutputBins() const Q_DECL_OVERRIDE;
- void loadDuplexModes() const Q_DECL_OVERRIDE;
- void loadColorModes() const Q_DECL_OVERRIDE;
+ void loadPageSizes() const override;
+ void loadResolutions() const override;
+ void loadInputSlots() const override;
+ void loadOutputBins() const override;
+ void loadDuplexModes() const override;
+ void loadColorModes() const override;
#ifndef QT_NO_MIMETYPE
- void loadMimeTypes() const Q_DECL_OVERRIDE;
+ void loadMimeTypes() const override;
#endif
private:
diff --git a/src/plugins/printsupport/windows/qwindowsprintdevice.cpp b/src/plugins/printsupport/windows/qwindowsprintdevice.cpp
index 1cb14514ee..b1589c0738 100644
--- a/src/plugins/printsupport/windows/qwindowsprintdevice.cpp
+++ b/src/plugins/printsupport/windows/qwindowsprintdevice.cpp
@@ -87,13 +87,13 @@ static LPDEVMODE getDevmode(HANDLE hPrinter, const QString &printerId)
// Allocate the required DEVMODE buffer
LONG dmSize = DocumentProperties(NULL, hPrinter, printerIdUtf16, NULL, NULL, 0);
if (dmSize <= 0)
- return Q_NULLPTR;
+ return nullptr;
LPDEVMODE pDevMode = reinterpret_cast<LPDEVMODE>(malloc(dmSize));
// Get the default DevMode
LONG result = DocumentProperties(NULL, hPrinter, printerIdUtf16, pDevMode, NULL, DM_OUT_BUFFER);
if (result != IDOK) {
free(pDevMode);
- pDevMode = Q_NULLPTR;
+ pDevMode = nullptr;
}
return pDevMode;
}
diff --git a/src/plugins/printsupport/windows/qwindowsprintdevice.h b/src/plugins/printsupport/windows/qwindowsprintdevice.h
index d95a4316cc..6b51ee8785 100644
--- a/src/plugins/printsupport/windows/qwindowsprintdevice.h
+++ b/src/plugins/printsupport/windows/qwindowsprintdevice.h
@@ -64,34 +64,34 @@ public:
explicit QWindowsPrintDevice(const QString &id);
virtual ~QWindowsPrintDevice();
- bool isValid() const Q_DECL_OVERRIDE;
- bool isDefault() const Q_DECL_OVERRIDE;
+ bool isValid() const override;
+ bool isDefault() const override;
- QPrint::DeviceState state() const Q_DECL_OVERRIDE;
+ QPrint::DeviceState state() const override;
- QPageSize defaultPageSize() const Q_DECL_OVERRIDE;
+ QPageSize defaultPageSize() const override;
QMarginsF printableMargins(const QPageSize &pageSize, QPageLayout::Orientation orientation,
- int resolution) const Q_DECL_OVERRIDE;
+ int resolution) const override;
- int defaultResolution() const Q_DECL_OVERRIDE;
+ int defaultResolution() const override;
- QPrint::InputSlot defaultInputSlot() const Q_DECL_OVERRIDE;
+ QPrint::InputSlot defaultInputSlot() const override;
- QPrint::DuplexMode defaultDuplexMode() const Q_DECL_OVERRIDE;
+ QPrint::DuplexMode defaultDuplexMode() const override;
- QPrint::ColorMode defaultColorMode() const Q_DECL_OVERRIDE;
+ QPrint::ColorMode defaultColorMode() const override;
static QStringList availablePrintDeviceIds();
static QString defaultPrintDeviceId();
protected:
- void loadPageSizes() const Q_DECL_OVERRIDE;
- void loadResolutions() const Q_DECL_OVERRIDE;
- void loadInputSlots() const Q_DECL_OVERRIDE;
- void loadOutputBins() const Q_DECL_OVERRIDE;
- void loadDuplexModes() const Q_DECL_OVERRIDE;
- void loadColorModes() const Q_DECL_OVERRIDE;
+ void loadPageSizes() const override;
+ void loadResolutions() const override;
+ void loadInputSlots() const override;
+ void loadOutputBins() const override;
+ void loadDuplexModes() const override;
+ void loadColorModes() const override;
private:
HANDLE m_hPrinter;
diff --git a/src/plugins/printsupport/windows/qwindowsprintersupport.h b/src/plugins/printsupport/windows/qwindowsprintersupport.h
index 84b60a8207..c42e7aa551 100644
--- a/src/plugins/printsupport/windows/qwindowsprintersupport.h
+++ b/src/plugins/printsupport/windows/qwindowsprintersupport.h
@@ -50,12 +50,12 @@ public:
QWindowsPrinterSupport();
~QWindowsPrinterSupport();
- QPrintEngine *createNativePrintEngine(QPrinter::PrinterMode printerMode, const QString &deviceId = QString()) Q_DECL_OVERRIDE;
- QPaintEngine *createPaintEngine(QPrintEngine *printEngine, QPrinter::PrinterMode) Q_DECL_OVERRIDE;
+ QPrintEngine *createNativePrintEngine(QPrinter::PrinterMode printerMode, const QString &deviceId = QString()) override;
+ QPaintEngine *createPaintEngine(QPrintEngine *printEngine, QPrinter::PrinterMode) override;
- QPrintDevice createPrintDevice(const QString &id) Q_DECL_OVERRIDE;
- QStringList availablePrintDeviceIds() const Q_DECL_OVERRIDE;
- QString defaultPrintDeviceId() const Q_DECL_OVERRIDE;
+ QPrintDevice createPrintDevice(const QString &id) override;
+ QStringList availablePrintDeviceIds() const override;
+ QString defaultPrintDeviceId() const override;
};
QT_END_NAMESPACE
diff --git a/src/plugins/sqldrivers/db2/qsql_db2.cpp b/src/plugins/sqldrivers/db2/qsql_db2.cpp
index 1a9631f1eb..b457ced538 100644
--- a/src/plugins/sqldrivers/db2/qsql_db2.cpp
+++ b/src/plugins/sqldrivers/db2/qsql_db2.cpp
@@ -92,24 +92,24 @@ class QDB2Result: public QSqlResult
public:
QDB2Result(const QDB2Driver *drv);
~QDB2Result();
- bool prepare(const QString &query) Q_DECL_OVERRIDE;
- bool exec() Q_DECL_OVERRIDE;
- QVariant handle() const Q_DECL_OVERRIDE;
+ bool prepare(const QString &query) override;
+ bool exec() override;
+ QVariant handle() const override;
protected:
- QVariant data(int field) Q_DECL_OVERRIDE;
- bool reset(const QString &query) Q_DECL_OVERRIDE;
- bool fetch(int i) Q_DECL_OVERRIDE;
- bool fetchNext() Q_DECL_OVERRIDE;
- bool fetchFirst() Q_DECL_OVERRIDE;
- bool fetchLast() Q_DECL_OVERRIDE;
- bool isNull(int i) Q_DECL_OVERRIDE;
- int size() Q_DECL_OVERRIDE;
- int numRowsAffected() Q_DECL_OVERRIDE;
- QSqlRecord record() const Q_DECL_OVERRIDE;
- void virtual_hook(int id, void *data) Q_DECL_OVERRIDE;
- void detachFromResultSet() Q_DECL_OVERRIDE;
- bool nextResult() Q_DECL_OVERRIDE;
+ QVariant data(int field) override;
+ bool reset(const QString &query) override;
+ bool fetch(int i) override;
+ bool fetchNext() override;
+ bool fetchFirst() override;
+ bool fetchLast() override;
+ bool isNull(int i) override;
+ int size() override;
+ int numRowsAffected() override;
+ QSqlRecord record() const override;
+ void virtual_hook(int id, void *data) override;
+ void detachFromResultSet() override;
+ bool nextResult() override;
};
class QDB2ResultPrivate: public QSqlResultPrivate
diff --git a/src/plugins/sqldrivers/db2/qsql_db2_p.h b/src/plugins/sqldrivers/db2/qsql_db2_p.h
index fa6d739479..79ae54ab2d 100644
--- a/src/plugins/sqldrivers/db2/qsql_db2_p.h
+++ b/src/plugins/sqldrivers/db2/qsql_db2_p.h
@@ -75,24 +75,24 @@ public:
explicit QDB2Driver(QObject* parent = 0);
QDB2Driver(Qt::HANDLE env, Qt::HANDLE con, QObject* parent = 0);
~QDB2Driver();
- bool hasFeature(DriverFeature) const Q_DECL_OVERRIDE;
- void close() Q_DECL_OVERRIDE;
- QSqlRecord record(const QString &tableName) const Q_DECL_OVERRIDE;
- QStringList tables(QSql::TableType type) const Q_DECL_OVERRIDE;
- QSqlResult *createResult() const Q_DECL_OVERRIDE;
- QSqlIndex primaryIndex(const QString &tablename) const Q_DECL_OVERRIDE;
- bool beginTransaction() Q_DECL_OVERRIDE;
- bool commitTransaction() Q_DECL_OVERRIDE;
- bool rollbackTransaction() Q_DECL_OVERRIDE;
- QString formatValue(const QSqlField &field, bool trimStrings) const Q_DECL_OVERRIDE;
- QVariant handle() const Q_DECL_OVERRIDE;
+ bool hasFeature(DriverFeature) const override;
+ void close() override;
+ QSqlRecord record(const QString &tableName) const override;
+ QStringList tables(QSql::TableType type) const override;
+ QSqlResult *createResult() const override;
+ QSqlIndex primaryIndex(const QString &tablename) const override;
+ bool beginTransaction() override;
+ bool commitTransaction() override;
+ bool rollbackTransaction() override;
+ QString formatValue(const QSqlField &field, bool trimStrings) const override;
+ QVariant handle() const override;
bool open(const QString &db,
const QString &user,
const QString &password,
const QString &host,
int port,
- const QString& connOpts) Q_DECL_OVERRIDE;
- QString escapeIdentifier(const QString &identifier, IdentifierType type) const Q_DECL_OVERRIDE;
+ const QString& connOpts) override;
+ QString escapeIdentifier(const QString &identifier, IdentifierType type) const override;
private:
bool setAutoCommit(bool autoCommit);
diff --git a/src/plugins/sqldrivers/ibase/qsql_ibase.cpp b/src/plugins/sqldrivers/ibase/qsql_ibase.cpp
index c50fc7916a..218cd75c69 100644
--- a/src/plugins/sqldrivers/ibase/qsql_ibase.cpp
+++ b/src/plugins/sqldrivers/ibase/qsql_ibase.cpp
@@ -356,16 +356,16 @@ class QIBaseResult : public QSqlCachedResult
public:
explicit QIBaseResult(const QIBaseDriver* db);
- bool prepare(const QString &query) Q_DECL_OVERRIDE;
- bool exec() Q_DECL_OVERRIDE;
- QVariant handle() const Q_DECL_OVERRIDE;
+ bool prepare(const QString &query) override;
+ bool exec() override;
+ QVariant handle() const override;
protected:
- bool gotoNext(QSqlCachedResult::ValueCache& row, int rowIdx) Q_DECL_OVERRIDE;
- bool reset (const QString &query) Q_DECL_OVERRIDE;
- int size() Q_DECL_OVERRIDE;
- int numRowsAffected() Q_DECL_OVERRIDE;
- QSqlRecord record() const Q_DECL_OVERRIDE;
+ bool gotoNext(QSqlCachedResult::ValueCache& row, int rowIdx) override;
+ bool reset (const QString &query) override;
+ int size() override;
+ int numRowsAffected() override;
+ QSqlRecord record() const override;
};
class QIBaseResultPrivate: public QSqlCachedResultPrivate
diff --git a/src/plugins/sqldrivers/ibase/qsql_ibase_p.h b/src/plugins/sqldrivers/ibase/qsql_ibase_p.h
index c7cee41462..295f6c0cec 100644
--- a/src/plugins/sqldrivers/ibase/qsql_ibase_p.h
+++ b/src/plugins/sqldrivers/ibase/qsql_ibase_p.h
@@ -74,36 +74,36 @@ public:
explicit QIBaseDriver(QObject *parent = 0);
explicit QIBaseDriver(isc_db_handle connection, QObject *parent = 0);
virtual ~QIBaseDriver();
- bool hasFeature(DriverFeature f) const Q_DECL_OVERRIDE;
+ bool hasFeature(DriverFeature f) const override;
bool open(const QString &db,
const QString &user,
const QString &password,
const QString &host,
int port,
- const QString &connOpts) Q_DECL_OVERRIDE;
+ const QString &connOpts) override;
bool open(const QString &db,
const QString &user,
const QString &password,
const QString &host,
int port) { return open(db, user, password, host, port, QString()); }
- void close() Q_DECL_OVERRIDE;
- QSqlResult *createResult() const Q_DECL_OVERRIDE;
- bool beginTransaction() Q_DECL_OVERRIDE;
- bool commitTransaction() Q_DECL_OVERRIDE;
- bool rollbackTransaction() Q_DECL_OVERRIDE;
- QStringList tables(QSql::TableType) const Q_DECL_OVERRIDE;
+ void close() override;
+ QSqlResult *createResult() const override;
+ bool beginTransaction() override;
+ bool commitTransaction() override;
+ bool rollbackTransaction() override;
+ QStringList tables(QSql::TableType) const override;
- QSqlRecord record(const QString& tablename) const Q_DECL_OVERRIDE;
- QSqlIndex primaryIndex(const QString &table) const Q_DECL_OVERRIDE;
+ QSqlRecord record(const QString& tablename) const override;
+ QSqlIndex primaryIndex(const QString &table) const override;
- QString formatValue(const QSqlField &field, bool trimStrings) const Q_DECL_OVERRIDE;
- QVariant handle() const Q_DECL_OVERRIDE;
+ QString formatValue(const QSqlField &field, bool trimStrings) const override;
+ QVariant handle() const override;
- QString escapeIdentifier(const QString &identifier, IdentifierType type) const Q_DECL_OVERRIDE;
+ QString escapeIdentifier(const QString &identifier, IdentifierType type) const override;
- bool subscribeToNotification(const QString &name) Q_DECL_OVERRIDE;
- bool unsubscribeFromNotification(const QString &name) Q_DECL_OVERRIDE;
- QStringList subscribedToNotifications() const Q_DECL_OVERRIDE;
+ bool subscribeToNotification(const QString &name) override;
+ bool unsubscribeFromNotification(const QString &name) override;
+ QStringList subscribedToNotifications() const override;
private Q_SLOTS:
void qHandleEventNotification(void* updatedResultBuffer);
diff --git a/src/plugins/sqldrivers/mysql/main.cpp b/src/plugins/sqldrivers/mysql/main.cpp
index 00d9c5bb34..d8d70483ef 100644
--- a/src/plugins/sqldrivers/mysql/main.cpp
+++ b/src/plugins/sqldrivers/mysql/main.cpp
@@ -51,7 +51,7 @@ class QMYSQLDriverPlugin : public QSqlDriverPlugin
public:
QMYSQLDriverPlugin();
- QSqlDriver* create(const QString &) Q_DECL_OVERRIDE;
+ QSqlDriver* create(const QString &) override;
};
QMYSQLDriverPlugin::QMYSQLDriverPlugin()
diff --git a/src/plugins/sqldrivers/mysql/qsql_mysql.cpp b/src/plugins/sqldrivers/mysql/qsql_mysql.cpp
index d9aebff700..f84a0081df 100644
--- a/src/plugins/sqldrivers/mysql/qsql_mysql.cpp
+++ b/src/plugins/sqldrivers/mysql/qsql_mysql.cpp
@@ -175,26 +175,26 @@ public:
explicit QMYSQLResult(const QMYSQLDriver *db);
~QMYSQLResult();
- QVariant handle() const Q_DECL_OVERRIDE;
+ QVariant handle() const override;
protected:
void cleanup();
- bool fetch(int i) Q_DECL_OVERRIDE;
- bool fetchNext() Q_DECL_OVERRIDE;
- bool fetchLast() Q_DECL_OVERRIDE;
- bool fetchFirst() Q_DECL_OVERRIDE;
- QVariant data(int field) Q_DECL_OVERRIDE;
- bool isNull(int field) Q_DECL_OVERRIDE;
- bool reset (const QString& query) Q_DECL_OVERRIDE;
- int size() Q_DECL_OVERRIDE;
- int numRowsAffected() Q_DECL_OVERRIDE;
- QVariant lastInsertId() const Q_DECL_OVERRIDE;
- QSqlRecord record() const Q_DECL_OVERRIDE;
- void virtual_hook(int id, void *data) Q_DECL_OVERRIDE;
- bool nextResult() Q_DECL_OVERRIDE;
+ bool fetch(int i) override;
+ bool fetchNext() override;
+ bool fetchLast() override;
+ bool fetchFirst() override;
+ QVariant data(int field) override;
+ bool isNull(int field) override;
+ bool reset (const QString& query) override;
+ int size() override;
+ int numRowsAffected() override;
+ QVariant lastInsertId() const override;
+ QSqlRecord record() const override;
+ void virtual_hook(int id, void *data) override;
+ bool nextResult() override;
#if MYSQL_VERSION_ID >= 40108
- bool prepare(const QString &stmt) Q_DECL_OVERRIDE;
- bool exec() Q_DECL_OVERRIDE;
+ bool prepare(const QString &stmt) override;
+ bool exec() override;
#endif
};
diff --git a/src/plugins/sqldrivers/mysql/qsql_mysql_p.h b/src/plugins/sqldrivers/mysql/qsql_mysql_p.h
index 7641f9aa34..48b04fb1f5 100644
--- a/src/plugins/sqldrivers/mysql/qsql_mysql_p.h
+++ b/src/plugins/sqldrivers/mysql/qsql_mysql_p.h
@@ -78,29 +78,29 @@ public:
explicit QMYSQLDriver(QObject *parent=0);
explicit QMYSQLDriver(MYSQL *con, QObject * parent=0);
~QMYSQLDriver();
- bool hasFeature(DriverFeature f) const Q_DECL_OVERRIDE;
+ bool hasFeature(DriverFeature f) const override;
bool open(const QString & db,
const QString & user,
const QString & password,
const QString & host,
int port,
- const QString& connOpts) Q_DECL_OVERRIDE;
- void close() Q_DECL_OVERRIDE;
- QSqlResult *createResult() const Q_DECL_OVERRIDE;
- QStringList tables(QSql::TableType) const Q_DECL_OVERRIDE;
- QSqlIndex primaryIndex(const QString& tablename) const Q_DECL_OVERRIDE;
- QSqlRecord record(const QString& tablename) const Q_DECL_OVERRIDE;
+ const QString& connOpts) override;
+ void close() override;
+ QSqlResult *createResult() const override;
+ QStringList tables(QSql::TableType) const override;
+ QSqlIndex primaryIndex(const QString& tablename) const override;
+ QSqlRecord record(const QString& tablename) const override;
QString formatValue(const QSqlField &field,
- bool trimStrings) const Q_DECL_OVERRIDE;
- QVariant handle() const Q_DECL_OVERRIDE;
- QString escapeIdentifier(const QString &identifier, IdentifierType type) const Q_DECL_OVERRIDE;
+ bool trimStrings) const override;
+ QVariant handle() const override;
+ QString escapeIdentifier(const QString &identifier, IdentifierType type) const override;
- bool isIdentifierEscaped(const QString &identifier, IdentifierType type) const Q_DECL_OVERRIDE;
+ bool isIdentifierEscaped(const QString &identifier, IdentifierType type) const override;
protected:
- bool beginTransaction() Q_DECL_OVERRIDE;
- bool commitTransaction() Q_DECL_OVERRIDE;
- bool rollbackTransaction() Q_DECL_OVERRIDE;
+ bool beginTransaction() override;
+ bool commitTransaction() override;
+ bool rollbackTransaction() override;
private:
void init();
};
diff --git a/src/plugins/sqldrivers/oci/qsql_oci.cpp b/src/plugins/sqldrivers/oci/qsql_oci.cpp
index 9ce2fc1b55..2d16c3d60c 100644
--- a/src/plugins/sqldrivers/oci/qsql_oci.cpp
+++ b/src/plugins/sqldrivers/oci/qsql_oci.cpp
@@ -55,6 +55,7 @@
#include <qvarlengtharray.h>
#include <qvector.h>
#include <qdebug.h>
+#include <qtimezone.h>
// This is needed for oracle oci when compiling with mingw-w64 headers
#if defined(__MINGW64_VERSION_MAJOR) && defined(_WIN64)
@@ -112,9 +113,6 @@ static const ub2 qOraCharset = OCI_UCS2ID;
typedef QVarLengthArray<sb2, 32> IndicatorArray;
typedef QVarLengthArray<ub2, 32> SizeArray;
-static QByteArray qMakeOraDate(const QDateTime& dt);
-static QDateTime qMakeDate(const char* oraDate);
-
static QByteArray qMakeOCINumber(const qlonglong &ll, OCIError *err);
static QByteArray qMakeOCINumber(const qulonglong& ull, OCIError* err);
@@ -156,6 +154,60 @@ QOCIRowId::~QOCIRowId()
OCIDescriptorFree(id, OCI_DTYPE_ROWID);
}
+class QOCIDateTime
+{
+public:
+ QOCIDateTime(OCIEnv *env, OCIError *err, const QDateTime &dt = QDateTime());
+ ~QOCIDateTime();
+ OCIDateTime *dateTime;
+ static QDateTime fromOCIDateTime(OCIEnv *env, OCIError *err, OCIDateTime *dt);
+};
+
+QOCIDateTime::QOCIDateTime(OCIEnv *env, OCIError *err, const QDateTime &dt)
+ : dateTime(nullptr)
+{
+ OCIDescriptorAlloc(env, reinterpret_cast<void**>(&dateTime), OCI_DTYPE_TIMESTAMP_TZ, 0, 0);
+ if (dt.isValid()) {
+ const QDate date = dt.date();
+ const QTime time = dt.time();
+ // Zone in +hh:mm format (stripping UTC prefix from OffsetName)
+ QString timeZone = dt.timeZone().displayName(dt, QTimeZone::OffsetName).mid(3);
+ const OraText *tz = reinterpret_cast<const OraText *>(timeZone.utf16());
+ OCIDateTimeConstruct(env, err, dateTime, date.year(), date.month(), date.day(), time.hour(),
+ time.minute(), time.second(), time.msec() * 1000000,
+ const_cast<OraText *>(tz), timeZone.length() * sizeof(QChar));
+ }
+}
+
+QOCIDateTime::~QOCIDateTime()
+{
+ if (dateTime != nullptr)
+ OCIDescriptorFree(dateTime, OCI_DTYPE_TIMESTAMP_TZ);
+}
+
+QDateTime QOCIDateTime::fromOCIDateTime(OCIEnv *env, OCIError *err, OCIDateTime *dateTime)
+{
+ sb2 year;
+ ub1 month, day, hour, minute, second;
+ ub4 nsec;
+ sb1 tzHour, tzMinute;
+
+ OCIDateTimeGetDate(env, err, dateTime, &year, &month, &day);
+ OCIDateTimeGetTime(env, err, dateTime, &hour, &minute, &second, &nsec);
+ OCIDateTimeGetTimeZoneOffset(env, err, dateTime, &tzHour, &tzMinute);
+ int secondsOffset = (qAbs(tzHour) * 60 + tzMinute) * 60;
+ if (tzHour < 0)
+ secondsOffset = -secondsOffset;
+ // OCIDateTimeGetTime gives "fractions of second" as nanoseconds
+ return QDateTime(QDate(year, month, day), QTime(hour, minute, second, nsec / 1000000),
+ Qt::OffsetFromUTC, secondsOffset);
+}
+
+struct TempStorage {
+ QList<QByteArray> rawData;
+ QList<QOCIDateTime *> dateTimes;
+};
+
typedef QSharedDataPointer<QOCIRowId> QOCIRowIdPointer;
QT_BEGIN_INCLUDE_NAMESPACE
Q_DECLARE_METATYPE(QOCIRowIdPointer)
@@ -193,19 +245,19 @@ class QOCIResult: public QSqlCachedResult
public:
QOCIResult(const QOCIDriver *db);
~QOCIResult();
- bool prepare(const QString &query) Q_DECL_OVERRIDE;
- bool exec() Q_DECL_OVERRIDE;
- QVariant handle() const Q_DECL_OVERRIDE;
+ bool prepare(const QString &query) override;
+ bool exec() override;
+ QVariant handle() const override;
protected:
- bool gotoNext(ValueCache &values, int index) Q_DECL_OVERRIDE;
- bool reset(const QString &query) Q_DECL_OVERRIDE;
- int size() Q_DECL_OVERRIDE;
- int numRowsAffected() Q_DECL_OVERRIDE;
- QSqlRecord record() const Q_DECL_OVERRIDE;
- QVariant lastInsertId() const Q_DECL_OVERRIDE;
- bool execBatch(bool arrayBind = false) Q_DECL_OVERRIDE;
- void virtual_hook(int id, void *data) Q_DECL_OVERRIDE;
+ bool gotoNext(ValueCache &values, int index) override;
+ bool reset(const QString &query) override;
+ int size() override;
+ int numRowsAffected() override;
+ QSqlRecord record() const override;
+ QVariant lastInsertId() const override;
+ bool execBatch(bool arrayBind = false) override;
+ void virtual_hook(int id, void *data) override;
bool fetchNext() override;
};
@@ -228,11 +280,11 @@ public:
void setStatementAttributes();
int bindValue(OCIStmt *sql, OCIBind **hbnd, OCIError *err, int pos,
- const QVariant &val, dvoid *indPtr, ub2 *tmpSize, QList<QByteArray> &tmpStorage);
+ const QVariant &val, dvoid *indPtr, ub2 *tmpSize, TempStorage &tmpStorage);
int bindValues(QVector<QVariant> &values, IndicatorArray &indicators, SizeArray &tmpSizes,
- QList<QByteArray> &tmpStorage);
+ TempStorage &tmpStorage);
void outValues(QVector<QVariant> &values, IndicatorArray &indicators,
- QList<QByteArray> &tmpStorage);
+ TempStorage &tmpStorage);
inline bool isOutValue(int i) const
{ Q_Q(const QOCIResult); return q->bindValueType(i) & QSql::Out; }
inline bool isBinaryValue(int i) const
@@ -305,7 +357,7 @@ void QOCIResultPrivate::setStatementAttributes()
}
int QOCIResultPrivate::bindValue(OCIStmt *sql, OCIBind **hbnd, OCIError *err, int pos,
- const QVariant &val, dvoid *indPtr, ub2 *tmpSize, QList<QByteArray> &tmpStorage)
+ const QVariant &val, dvoid *indPtr, ub2 *tmpSize, TempStorage &tmpStorage)
{
int r = OCI_SUCCESS;
void *data = const_cast<void *>(val.constData());
@@ -323,14 +375,15 @@ int QOCIResultPrivate::bindValue(OCIStmt *sql, OCIBind **hbnd, OCIError *err, in
case QVariant::Time:
case QVariant::Date:
case QVariant::DateTime: {
- QByteArray ba = qMakeOraDate(val.toDateTime());
+ QOCIDateTime *ptr = new QOCIDateTime(env, err, val.toDateTime());
r = OCIBindByPos(sql, hbnd, err,
pos + 1,
- ba.data(),
- ba.size(),
- SQLT_DAT, indPtr, 0, 0, 0, 0, OCI_DEFAULT);
- tmpStorage.append(ba);
- break; }
+ &ptr->dateTime,
+ sizeof(OCIDateTime *),
+ SQLT_TIMESTAMP_TZ, indPtr, 0, 0, 0, 0, OCI_DEFAULT);
+ tmpStorage.dateTimes.append(ptr);
+ break;
+ }
case QVariant::Int:
r = OCIBindByPos(sql, hbnd, err,
pos + 1,
@@ -357,7 +410,7 @@ int QOCIResultPrivate::bindValue(OCIStmt *sql, OCIBind **hbnd, OCIError *err, in
ba.data(),
ba.size(),
SQLT_VNU, indPtr, 0, 0, 0, 0, OCI_DEFAULT);
- tmpStorage.append(ba);
+ tmpStorage.rawData.append(ba);
break;
}
case QVariant::ULongLong:
@@ -368,7 +421,7 @@ int QOCIResultPrivate::bindValue(OCIStmt *sql, OCIBind **hbnd, OCIError *err, in
ba.data(),
ba.size(),
SQLT_VNU, indPtr, 0, 0, 0, 0, OCI_DEFAULT);
- tmpStorage.append(ba);
+ tmpStorage.rawData.append(ba);
break;
}
case QVariant::Double:
@@ -438,7 +491,7 @@ int QOCIResultPrivate::bindValue(OCIStmt *sql, OCIBind **hbnd, OCIError *err, in
}
if (r == OCI_SUCCESS)
setCharset(*hbnd, OCI_HTYPE_BIND);
- tmpStorage.append(ba);
+ tmpStorage.rawData.append(ba);
break;
} // default case
} // switch
@@ -448,7 +501,7 @@ int QOCIResultPrivate::bindValue(OCIStmt *sql, OCIBind **hbnd, OCIError *err, in
}
int QOCIResultPrivate::bindValues(QVector<QVariant> &values, IndicatorArray &indicators,
- SizeArray &tmpSizes, QList<QByteArray> &tmpStorage)
+ SizeArray &tmpSizes, TempStorage &tmpStorage)
{
int r = OCI_SUCCESS;
for (int i = 0; i < values.count(); ++i) {
@@ -466,27 +519,30 @@ int QOCIResultPrivate::bindValues(QVector<QVariant> &values, IndicatorArray &ind
}
// will assign out value and remove its temp storage.
-static void qOraOutValue(QVariant &value, QList<QByteArray> &storage, OCIError* err)
+static void qOraOutValue(QVariant &value, TempStorage &tmpStorage, OCIEnv *env, OCIError* err)
{
switch (value.type()) {
case QVariant::Time:
- value = qMakeDate(storage.takeFirst()).time();
+ value = QOCIDateTime::fromOCIDateTime(env, err,
+ tmpStorage.dateTimes.takeFirst()->dateTime).time();
break;
case QVariant::Date:
- value = qMakeDate(storage.takeFirst()).date();
+ value = QOCIDateTime::fromOCIDateTime(env, err,
+ tmpStorage.dateTimes.takeFirst()->dateTime).date();
break;
case QVariant::DateTime:
- value = qMakeDate(storage.takeFirst());
+ value = QOCIDateTime::fromOCIDateTime(env, err,
+ tmpStorage.dateTimes.takeFirst()->dateTime);
break;
case QVariant::LongLong:
- value = qMakeLongLong(storage.takeFirst(), err);
+ value = qMakeLongLong(tmpStorage.rawData.takeFirst(), err);
break;
case QVariant::ULongLong:
- value = qMakeULongLong(storage.takeFirst(), err);
+ value = qMakeULongLong(tmpStorage.rawData.takeFirst(), err);
break;
case QVariant::String:
value = QString(
- reinterpret_cast<const QChar *>(storage.takeFirst().constData()));
+ reinterpret_cast<const QChar *>(tmpStorage.rawData.takeFirst().constData()));
break;
default:
break; //nothing
@@ -494,14 +550,14 @@ static void qOraOutValue(QVariant &value, QList<QByteArray> &storage, OCIError*
}
void QOCIResultPrivate::outValues(QVector<QVariant> &values, IndicatorArray &indicators,
- QList<QByteArray> &tmpStorage)
+ TempStorage &tmpStorage)
{
for (int i = 0; i < values.count(); ++i) {
if (!isOutValue(i))
continue;
- qOraOutValue(values[i], tmpStorage, err);
+ qOraOutValue(values[i], tmpStorage, env, err);
QVariant::Type typ = values.at(i).type();
if (indicators[i] == -1) // NULL
@@ -693,11 +749,9 @@ QVariant::Type qDecodeOCIType(int ocitype, QSql::NumericalPrecisionPolicy precis
break;
case SQLT_DAT:
case SQLT_ODT:
-#ifdef SQLT_TIMESTAMP
case SQLT_TIMESTAMP:
case SQLT_TIMESTAMP_TZ:
case SQLT_TIMESTAMP_LTZ:
-#endif
type = QVariant::DateTime;
break;
default:
@@ -724,27 +778,6 @@ static QSqlField qFromOraInf(const OraFieldInfo &ofi)
}
/*!
- \internal
-
- Convert QDateTime to the internal Oracle DATE format NB!
- It does not handle BCE dates.
-*/
-QByteArray qMakeOraDate(const QDateTime& dt)
-{
- QByteArray ba;
- ba.resize(7);
- int year = dt.date().year();
- ba[0]= (year / 100) + 100; // century
- ba[1]= (year % 100) + 100; // year
- ba[2]= dt.date().month();
- ba[3]= dt.date().day();
- ba[4]= dt.time().hour() + 1;
- ba[5]= dt.time().minute() + 1;
- ba[6]= dt.time().second() + 1;
- return ba;
-}
-
-/*!
\internal
Convert qlonglong to the internal Oracle OCINumber format.
@@ -794,22 +827,6 @@ qulonglong qMakeULongLong(const char* ociNumber, OCIError* err)
return qull;
}
-QDateTime qMakeDate(const char* oraDate)
-{
- int century = uchar(oraDate[0]);
- if(century >= 100){
- int year = uchar(oraDate[1]);
- year = ((century-100)*100) + (year-100);
- int month = oraDate[2];
- int day = oraDate[3];
- int hour = oraDate[4] - 1;
- int min = oraDate[5] - 1;
- int sec = oraDate[6] - 1;
- return QDateTime(QDate(year,month,day), QTime(hour,min,sec));
- }
- return QDateTime();
-}
-
class QOCICols
{
public:
@@ -832,7 +849,7 @@ private:
class OraFieldInf
{
public:
- OraFieldInf(): data(0), len(0), ind(0), typ(QVariant::Invalid), oraType(0), def(0), lob(0)
+ OraFieldInf() : data(0), len(0), ind(0), typ(QVariant::Invalid), oraType(0), def(0), lob(0), dataPtr(nullptr)
{}
~OraFieldInf();
char *data;
@@ -842,6 +859,7 @@ private:
ub4 oraType;
OCIDefine *def;
OCILobLocator *lob;
+ void *dataPtr;
};
QVector<OraFieldInf> fieldInf;
@@ -856,6 +874,20 @@ QOCICols::OraFieldInf::~OraFieldInf()
if (r != 0)
qWarning("QOCICols: Cannot free LOB descriptor");
}
+ if (dataPtr) {
+ switch (typ) {
+ case QVariant::Date:
+ case QVariant::Time:
+ case QVariant::DateTime: {
+ int r = OCIDescriptorFree(dataPtr, OCI_DTYPE_TIMESTAMP_TZ);
+ if (r != OCI_SUCCESS)
+ qWarning("QOCICols: Cannot free OCIDateTime descriptor");
+ break;
+ }
+ default:
+ break;
+ }
+ }
}
QOCICols::QOCICols(int size, QOCIResultPrivate* dp)
@@ -902,13 +934,18 @@ QOCICols::QOCICols(int size, QOCIResultPrivate* dp)
switch (ofi.type) {
case QVariant::DateTime:
+ r = OCIDescriptorAlloc(d->env, (void **)&fieldInf[idx].dataPtr, OCI_DTYPE_TIMESTAMP_TZ, 0, 0);
+ if (r != OCI_SUCCESS) {
+ qWarning("QOCICols: Unable to allocate the OCIDateTime descriptor");
+ break;
+ }
r = OCIDefineByPos(d->sql,
&dfn,
d->err,
count,
- create(idx, dataSize+1),
- dataSize+1,
- SQLT_DAT,
+ &fieldInf[idx].dataPtr,
+ sizeof(OCIDateTime *),
+ SQLT_TIMESTAMP_TZ,
&(fieldInf[idx].ind),
0, 0, OCI_DEFAULT);
break;
@@ -1323,11 +1360,10 @@ bool QOCICols::execBatch(QOCIResultPrivate *d, QVector<QVariant> &boundValues, b
fieldTypes.append(tp == QVariant::List ? boundValues.at(i).toList().value(0).type()
: tp);
}
-
- QList<QByteArray> tmpStorage;
SizeArray tmpSizes(columnCount);
QVector<QOCIBatchColumn> columns(columnCount);
QOCIBatchCleanupHandler cleaner(columns);
+ TempStorage tmpStorage;
// figuring out buffer sizes
for (i = 0; i < columnCount; ++i) {
@@ -1364,8 +1400,8 @@ bool QOCICols::execBatch(QOCIResultPrivate *d, QVector<QVariant> &boundValues, b
case QVariant::Time:
case QVariant::Date:
case QVariant::DateTime:
- col.bindAs = SQLT_DAT;
- col.maxLen = 7;
+ col.bindAs = SQLT_TIMESTAMP_TZ;
+ col.maxLen = sizeof(OCIDateTime *);
break;
case QVariant::Int:
@@ -1433,7 +1469,7 @@ bool QOCICols::execBatch(QOCIResultPrivate *d, QVector<QVariant> &boundValues, b
for (uint row = 0; row < col.recordCount; ++row) {
const QVariant &val = boundValues.at(i).toList().at(row);
- if (val.isNull()){
+ if (val.isNull() && !d->isOutValue(i)) {
columns[i].indicators[row] = -1;
columns[i].lengths[row] = 0;
} else {
@@ -1444,9 +1480,8 @@ bool QOCICols::execBatch(QOCIResultPrivate *d, QVector<QVariant> &boundValues, b
case QVariant::Date:
case QVariant::DateTime:{
columns[i].lengths[row] = columns[i].maxLen;
- const QByteArray ba = qMakeOraDate(val.toDateTime());
- Q_ASSERT(ba.size() == int(columns[i].maxLen));
- memcpy(dataPtr, ba.constData(), columns[i].maxLen);
+ QOCIDateTime *date = new QOCIDateTime(d->env, d->err, val.toDateTime());
+ *reinterpret_cast<OCIDateTime**>(dataPtr) = date->dateTime;
break;
}
case QVariant::Int:
@@ -1582,7 +1617,7 @@ bool QOCICols::execBatch(QOCIResultPrivate *d, QVector<QVariant> &boundValues, b
QVariant::Type tp = boundValues.at(i).type();
if (tp != QVariant::List) {
- qOraOutValue(boundValues[i], tmpStorage, d->err);
+ qOraOutValue(boundValues[i], tmpStorage, d->env, d->err);
if (*columns[i].indicators == -1)
boundValues[i] = QVariant(tp);
continue;
@@ -1594,16 +1629,16 @@ bool QOCICols::execBatch(QOCIResultPrivate *d, QVector<QVariant> &boundValues, b
for (uint r = 0; r < columns[i].recordCount; ++r){
if (columns[i].indicators[r] == -1) {
- (*list)[r] = QVariant();
+ (*list)[r] = QVariant(fieldTypes[i]);
continue;
}
switch(columns[i].bindAs) {
- case SQLT_DAT:
- (*list)[r] = qMakeDate(data + r * columns[i].maxLen);
+ case SQLT_TIMESTAMP_TZ:
+ (*list)[r] = QOCIDateTime::fromOCIDateTime(d->env, d->err,
+ *reinterpret_cast<OCIDateTime **>(data + r * columns[i].maxLen));
break;
-
case SQLT_INT:
(*list)[r] = *reinterpret_cast<int*>(data + r * columns[i].maxLen);
break;
@@ -1647,6 +1682,7 @@ bool QOCICols::execBatch(QOCIResultPrivate *d, QVector<QVariant> &boundValues, b
d->q_func()->setAt(QSql::BeforeFirstRow);
d->q_func()->setActive(true);
+ qDeleteAll(tmpStorage.dateTimes);
return true;
}
@@ -1755,7 +1791,8 @@ void QOCICols::getValues(QVector<QVariant> &v, int index)
switch (fld.typ) {
case QVariant::DateTime:
- v[index + i] = QVariant(qMakeDate(fld.data));
+ v[index + i] = QVariant(QOCIDateTime::fromOCIDateTime(d->env, d->err,
+ reinterpret_cast<OCIDateTime *>(fld.dataPtr)));
break;
case QVariant::Double:
case QVariant::Int:
@@ -1985,7 +2022,7 @@ bool QOCIResult::exec()
ub2 stmtType=0;
ub4 iters;
ub4 mode;
- QList<QByteArray> tmpStorage;
+ TempStorage tmpStorage;
IndicatorArray indicators(boundValueCount());
SizeArray tmpSizes(boundValueCount());
@@ -2056,7 +2093,7 @@ bool QOCIResult::exec()
if (hasOutValues())
d->outValues(boundValues(), indicators, tmpStorage);
-
+ qDeleteAll(tmpStorage.dateTimes);
return true;
}
diff --git a/src/plugins/sqldrivers/oci/qsql_oci_p.h b/src/plugins/sqldrivers/oci/qsql_oci_p.h
index 69911f4bee..295c131f1a 100644
--- a/src/plugins/sqldrivers/oci/qsql_oci_p.h
+++ b/src/plugins/sqldrivers/oci/qsql_oci_p.h
@@ -84,21 +84,21 @@ public:
const QString &password,
const QString &host,
int port,
- const QString &connOpts) Q_DECL_OVERRIDE;
- void close() Q_DECL_OVERRIDE;
- QSqlResult *createResult() const Q_DECL_OVERRIDE;
- QStringList tables(QSql::TableType) const Q_DECL_OVERRIDE;
- QSqlRecord record(const QString &tablename) const Q_DECL_OVERRIDE;
- QSqlIndex primaryIndex(const QString& tablename) const Q_DECL_OVERRIDE;
+ const QString &connOpts) override;
+ void close() override;
+ QSqlResult *createResult() const override;
+ QStringList tables(QSql::TableType) const override;
+ QSqlRecord record(const QString &tablename) const override;
+ QSqlIndex primaryIndex(const QString& tablename) const override;
QString formatValue(const QSqlField &field,
- bool trimStrings) const Q_DECL_OVERRIDE;
- QVariant handle() const Q_DECL_OVERRIDE;
- QString escapeIdentifier(const QString &identifier, IdentifierType) const Q_DECL_OVERRIDE;
+ bool trimStrings) const override;
+ QVariant handle() const override;
+ QString escapeIdentifier(const QString &identifier, IdentifierType) const override;
protected:
- bool beginTransaction() Q_DECL_OVERRIDE;
- bool commitTransaction() Q_DECL_OVERRIDE;
- bool rollbackTransaction() Q_DECL_OVERRIDE;
+ bool beginTransaction() override;
+ bool commitTransaction() override;
+ bool rollbackTransaction() override;
};
QT_END_NAMESPACE
diff --git a/src/plugins/sqldrivers/odbc/qsql_odbc.cpp b/src/plugins/sqldrivers/odbc/qsql_odbc.cpp
index c32a29c5e7..4a4183c7a3 100644
--- a/src/plugins/sqldrivers/odbc/qsql_odbc.cpp
+++ b/src/plugins/sqldrivers/odbc/qsql_odbc.cpp
@@ -163,27 +163,27 @@ public:
QODBCResult(const QODBCDriver *db);
virtual ~QODBCResult();
- bool prepare(const QString &query) Q_DECL_OVERRIDE;
- bool exec() Q_DECL_OVERRIDE;
+ bool prepare(const QString &query) override;
+ bool exec() override;
- QVariant lastInsertId() const Q_DECL_OVERRIDE;
- QVariant handle() const Q_DECL_OVERRIDE;
+ QVariant lastInsertId() const override;
+ QVariant handle() const override;
protected:
- bool fetchNext() Q_DECL_OVERRIDE;
- bool fetchFirst() Q_DECL_OVERRIDE;
- bool fetchLast() Q_DECL_OVERRIDE;
- bool fetchPrevious() Q_DECL_OVERRIDE;
- bool fetch(int i) Q_DECL_OVERRIDE;
- bool reset(const QString &query) Q_DECL_OVERRIDE;
- QVariant data(int field) Q_DECL_OVERRIDE;
- bool isNull(int field) Q_DECL_OVERRIDE;
- int size() Q_DECL_OVERRIDE;
- int numRowsAffected() Q_DECL_OVERRIDE;
- QSqlRecord record() const Q_DECL_OVERRIDE;
- void virtual_hook(int id, void *data) Q_DECL_OVERRIDE;
- void detachFromResultSet() Q_DECL_OVERRIDE;
- bool nextResult() Q_DECL_OVERRIDE;
+ bool fetchNext() override;
+ bool fetchFirst() override;
+ bool fetchLast() override;
+ bool fetchPrevious() override;
+ bool fetch(int i) override;
+ bool reset(const QString &query) override;
+ QVariant data(int field) override;
+ bool isNull(int field) override;
+ int size() override;
+ int numRowsAffected() override;
+ QSqlRecord record() const override;
+ void virtual_hook(int id, void *data) override;
+ void detachFromResultSet() override;
+ bool nextResult() override;
};
class QODBCResultPrivate: public QSqlResultPrivate
diff --git a/src/plugins/sqldrivers/odbc/qsql_odbc_p.h b/src/plugins/sqldrivers/odbc/qsql_odbc_p.h
index f4ce8bc243..ea0aa6fc8b 100644
--- a/src/plugins/sqldrivers/odbc/qsql_odbc_p.h
+++ b/src/plugins/sqldrivers/odbc/qsql_odbc_p.h
@@ -92,30 +92,30 @@ public:
explicit QODBCDriver(QObject *parent=0);
QODBCDriver(SQLHANDLE env, SQLHANDLE con, QObject * parent=0);
virtual ~QODBCDriver();
- bool hasFeature(DriverFeature f) const Q_DECL_OVERRIDE;
- void close() Q_DECL_OVERRIDE;
- QSqlResult *createResult() const Q_DECL_OVERRIDE;
- QStringList tables(QSql::TableType) const Q_DECL_OVERRIDE;
- QSqlRecord record(const QString &tablename) const Q_DECL_OVERRIDE;
- QSqlIndex primaryIndex(const QString &tablename) const Q_DECL_OVERRIDE;
- QVariant handle() const Q_DECL_OVERRIDE;
+ bool hasFeature(DriverFeature f) const override;
+ void close() override;
+ QSqlResult *createResult() const override;
+ QStringList tables(QSql::TableType) const override;
+ QSqlRecord record(const QString &tablename) const override;
+ QSqlIndex primaryIndex(const QString &tablename) const override;
+ QVariant handle() const override;
QString formatValue(const QSqlField &field,
- bool trimStrings) const Q_DECL_OVERRIDE;
+ bool trimStrings) const override;
bool open(const QString &db,
const QString &user,
const QString &password,
const QString &host,
int port,
- const QString &connOpts) Q_DECL_OVERRIDE;
+ const QString &connOpts) override;
- QString escapeIdentifier(const QString &identifier, IdentifierType type) const Q_DECL_OVERRIDE;
+ QString escapeIdentifier(const QString &identifier, IdentifierType type) const override;
- bool isIdentifierEscaped(const QString &identifier, IdentifierType type) const Q_DECL_OVERRIDE;
+ bool isIdentifierEscaped(const QString &identifier, IdentifierType type) const override;
protected:
- bool beginTransaction() Q_DECL_OVERRIDE;
- bool commitTransaction() Q_DECL_OVERRIDE;
- bool rollbackTransaction() Q_DECL_OVERRIDE;
+ bool beginTransaction() override;
+ bool commitTransaction() override;
+ bool rollbackTransaction() override;
private:
bool endTrans();
diff --git a/src/plugins/sqldrivers/psql/main.cpp b/src/plugins/sqldrivers/psql/main.cpp
index 7657fcbfdf..c5d546f6ff 100644
--- a/src/plugins/sqldrivers/psql/main.cpp
+++ b/src/plugins/sqldrivers/psql/main.cpp
@@ -51,7 +51,7 @@ class QPSQLDriverPlugin : public QSqlDriverPlugin
public:
QPSQLDriverPlugin();
- QSqlDriver* create(const QString &) Q_DECL_OVERRIDE;
+ QSqlDriver* create(const QString &) override;
};
QPSQLDriverPlugin::QPSQLDriverPlugin()
diff --git a/src/plugins/sqldrivers/psql/qsql_psql.cpp b/src/plugins/sqldrivers/psql/qsql_psql.cpp
index 0f4b7a80af..1dce2f28c1 100644
--- a/src/plugins/sqldrivers/psql/qsql_psql.cpp
+++ b/src/plugins/sqldrivers/psql/qsql_psql.cpp
@@ -135,23 +135,23 @@ public:
QPSQLResult(const QPSQLDriver *db);
~QPSQLResult();
- QVariant handle() const Q_DECL_OVERRIDE;
- void virtual_hook(int id, void *data) Q_DECL_OVERRIDE;
+ QVariant handle() const override;
+ void virtual_hook(int id, void *data) override;
protected:
void cleanup();
- bool fetch(int i) Q_DECL_OVERRIDE;
- bool fetchFirst() Q_DECL_OVERRIDE;
- bool fetchLast() Q_DECL_OVERRIDE;
- QVariant data(int i) Q_DECL_OVERRIDE;
- bool isNull(int field) Q_DECL_OVERRIDE;
- bool reset (const QString &query) Q_DECL_OVERRIDE;
- int size() Q_DECL_OVERRIDE;
- int numRowsAffected() Q_DECL_OVERRIDE;
- QSqlRecord record() const Q_DECL_OVERRIDE;
- QVariant lastInsertId() const Q_DECL_OVERRIDE;
- bool prepare(const QString &query) Q_DECL_OVERRIDE;
- bool exec() Q_DECL_OVERRIDE;
+ bool fetch(int i) override;
+ bool fetchFirst() override;
+ bool fetchLast() override;
+ QVariant data(int i) override;
+ bool isNull(int field) override;
+ bool reset (const QString &query) override;
+ int size() override;
+ int numRowsAffected() override;
+ QSqlRecord record() const override;
+ QVariant lastInsertId() const override;
+ bool prepare(const QString &query) override;
+ bool exec() override;
};
class QPSQLDriverPrivate : public QSqlDriverPrivate
@@ -237,7 +237,7 @@ public:
preparedQueriesEnabled(false)
{ }
- QString fieldSerial(int i) const Q_DECL_OVERRIDE { return QLatin1Char('$') + QString::number(i + 1); }
+ QString fieldSerial(int i) const override { return QLatin1Char('$') + QString::number(i + 1); }
void deallocatePreparedStmt();
PGresult *result;
diff --git a/src/plugins/sqldrivers/psql/qsql_psql_p.h b/src/plugins/sqldrivers/psql/qsql_psql_p.h
index f5cb2e9bd0..2873a9f851 100644
--- a/src/plugins/sqldrivers/psql/qsql_psql_p.h
+++ b/src/plugins/sqldrivers/psql/qsql_psql_p.h
@@ -98,34 +98,34 @@ public:
explicit QPSQLDriver(QObject *parent=0);
explicit QPSQLDriver(PGconn *conn, QObject *parent=0);
~QPSQLDriver();
- bool hasFeature(DriverFeature f) const Q_DECL_OVERRIDE;
+ bool hasFeature(DriverFeature f) const override;
bool open(const QString & db,
const QString & user,
const QString & password,
const QString & host,
int port,
- const QString& connOpts) Q_DECL_OVERRIDE;
- bool isOpen() const Q_DECL_OVERRIDE;
- void close() Q_DECL_OVERRIDE;
- QSqlResult *createResult() const Q_DECL_OVERRIDE;
- QStringList tables(QSql::TableType) const Q_DECL_OVERRIDE;
- QSqlIndex primaryIndex(const QString& tablename) const Q_DECL_OVERRIDE;
- QSqlRecord record(const QString& tablename) const Q_DECL_OVERRIDE;
+ const QString& connOpts) override;
+ bool isOpen() const override;
+ void close() override;
+ QSqlResult *createResult() const override;
+ QStringList tables(QSql::TableType) const override;
+ QSqlIndex primaryIndex(const QString& tablename) const override;
+ QSqlRecord record(const QString& tablename) const override;
Protocol protocol() const;
- QVariant handle() const Q_DECL_OVERRIDE;
+ QVariant handle() const override;
- QString escapeIdentifier(const QString &identifier, IdentifierType type) const Q_DECL_OVERRIDE;
- QString formatValue(const QSqlField &field, bool trimStrings) const Q_DECL_OVERRIDE;
+ QString escapeIdentifier(const QString &identifier, IdentifierType type) const override;
+ QString formatValue(const QSqlField &field, bool trimStrings) const override;
- bool subscribeToNotification(const QString &name) Q_DECL_OVERRIDE;
- bool unsubscribeFromNotification(const QString &name) Q_DECL_OVERRIDE;
- QStringList subscribedToNotifications() const Q_DECL_OVERRIDE;
+ bool subscribeToNotification(const QString &name) override;
+ bool unsubscribeFromNotification(const QString &name) override;
+ QStringList subscribedToNotifications() const override;
protected:
- bool beginTransaction() Q_DECL_OVERRIDE;
- bool commitTransaction() Q_DECL_OVERRIDE;
- bool rollbackTransaction() Q_DECL_OVERRIDE;
+ bool beginTransaction() override;
+ bool commitTransaction() override;
+ bool rollbackTransaction() override;
private Q_SLOTS:
void _q_handleNotification(int);
diff --git a/src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp b/src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp
index e9f5ee9508..e1ddd4b25e 100644
--- a/src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp
+++ b/src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp
@@ -123,19 +123,19 @@ class QSQLiteResult : public QSqlCachedResult
public:
explicit QSQLiteResult(const QSQLiteDriver* db);
~QSQLiteResult();
- QVariant handle() const Q_DECL_OVERRIDE;
+ QVariant handle() const override;
protected:
- bool gotoNext(QSqlCachedResult::ValueCache& row, int idx) Q_DECL_OVERRIDE;
- bool reset(const QString &query) Q_DECL_OVERRIDE;
- bool prepare(const QString &query) Q_DECL_OVERRIDE;
- bool exec() Q_DECL_OVERRIDE;
- int size() Q_DECL_OVERRIDE;
- int numRowsAffected() Q_DECL_OVERRIDE;
- QVariant lastInsertId() const Q_DECL_OVERRIDE;
- QSqlRecord record() const Q_DECL_OVERRIDE;
- void detachFromResultSet() Q_DECL_OVERRIDE;
- void virtual_hook(int id, void *data) Q_DECL_OVERRIDE;
+ bool gotoNext(QSqlCachedResult::ValueCache& row, int idx) override;
+ bool reset(const QString &query) override;
+ bool prepare(const QString &query) override;
+ bool exec() override;
+ int size() override;
+ int numRowsAffected() override;
+ QVariant lastInsertId() const override;
+ QSqlRecord record() const override;
+ void detachFromResultSet() override;
+ void virtual_hook(int id, void *data) override;
};
class QSQLiteDriverPrivate : public QSqlDriverPrivate
diff --git a/src/plugins/sqldrivers/sqlite/qsql_sqlite_p.h b/src/plugins/sqldrivers/sqlite/qsql_sqlite_p.h
index ca969a4b53..61be4c937f 100644
--- a/src/plugins/sqldrivers/sqlite/qsql_sqlite_p.h
+++ b/src/plugins/sqldrivers/sqlite/qsql_sqlite_p.h
@@ -75,28 +75,28 @@ public:
explicit QSQLiteDriver(QObject *parent = 0);
explicit QSQLiteDriver(sqlite3 *connection, QObject *parent = 0);
~QSQLiteDriver();
- bool hasFeature(DriverFeature f) const Q_DECL_OVERRIDE;
+ bool hasFeature(DriverFeature f) const override;
bool open(const QString & db,
const QString & user,
const QString & password,
const QString & host,
int port,
- const QString & connOpts) Q_DECL_OVERRIDE;
- void close() Q_DECL_OVERRIDE;
- QSqlResult *createResult() const Q_DECL_OVERRIDE;
- bool beginTransaction() Q_DECL_OVERRIDE;
- bool commitTransaction() Q_DECL_OVERRIDE;
- bool rollbackTransaction() Q_DECL_OVERRIDE;
- QStringList tables(QSql::TableType) const Q_DECL_OVERRIDE;
+ const QString & connOpts) override;
+ void close() override;
+ QSqlResult *createResult() const override;
+ bool beginTransaction() override;
+ bool commitTransaction() override;
+ bool rollbackTransaction() override;
+ QStringList tables(QSql::TableType) const override;
- QSqlRecord record(const QString& tablename) const Q_DECL_OVERRIDE;
- QSqlIndex primaryIndex(const QString &table) const Q_DECL_OVERRIDE;
- QVariant handle() const Q_DECL_OVERRIDE;
- QString escapeIdentifier(const QString &identifier, IdentifierType) const Q_DECL_OVERRIDE;
+ QSqlRecord record(const QString& tablename) const override;
+ QSqlIndex primaryIndex(const QString &table) const override;
+ QVariant handle() const override;
+ QString escapeIdentifier(const QString &identifier, IdentifierType) const override;
- bool subscribeToNotification(const QString &name) Q_DECL_OVERRIDE;
- bool unsubscribeFromNotification(const QString &name) Q_DECL_OVERRIDE;
- QStringList subscribedToNotifications() const Q_DECL_OVERRIDE;
+ bool subscribeToNotification(const QString &name) override;
+ bool unsubscribeFromNotification(const QString &name) override;
+ QStringList subscribedToNotifications() const override;
private Q_SLOTS:
void handleNotification(const QString &tableName, qint64 rowid);
};
diff --git a/src/plugins/sqldrivers/sqlite/smain.cpp b/src/plugins/sqldrivers/sqlite/smain.cpp
index 2ad466a61e..092813990c 100644
--- a/src/plugins/sqldrivers/sqlite/smain.cpp
+++ b/src/plugins/sqldrivers/sqlite/smain.cpp
@@ -51,7 +51,7 @@ class QSQLiteDriverPlugin : public QSqlDriverPlugin
public:
QSQLiteDriverPlugin();
- QSqlDriver* create(const QString &) Q_DECL_OVERRIDE;
+ QSqlDriver* create(const QString &) override;
};
QSQLiteDriverPlugin::QSQLiteDriverPlugin()
diff --git a/src/plugins/sqldrivers/sqlite2/qsql_sqlite2.cpp b/src/plugins/sqldrivers/sqlite2/qsql_sqlite2.cpp
index 93f47e3f13..9745c5ebc6 100644
--- a/src/plugins/sqldrivers/sqlite2/qsql_sqlite2.cpp
+++ b/src/plugins/sqldrivers/sqlite2/qsql_sqlite2.cpp
@@ -107,16 +107,16 @@ class QSQLite2Result : public QSqlCachedResult
public:
explicit QSQLite2Result(const QSQLite2Driver* db);
~QSQLite2Result();
- QVariant handle() const Q_DECL_OVERRIDE;
+ QVariant handle() const override;
protected:
- bool gotoNext(QSqlCachedResult::ValueCache &row, int idx) Q_DECL_OVERRIDE;
- bool reset(const QString &query) Q_DECL_OVERRIDE;
- int size() Q_DECL_OVERRIDE;
- int numRowsAffected() Q_DECL_OVERRIDE;
- QSqlRecord record() const Q_DECL_OVERRIDE;
- void detachFromResultSet() Q_DECL_OVERRIDE;
- void virtual_hook(int id, void *data) Q_DECL_OVERRIDE;
+ bool gotoNext(QSqlCachedResult::ValueCache &row, int idx) override;
+ bool reset(const QString &query) override;
+ int size() override;
+ int numRowsAffected() override;
+ QSqlRecord record() const override;
+ void detachFromResultSet() override;
+ void virtual_hook(int id, void *data) override;
};
class QSQLite2ResultPrivate: public QSqlCachedResultPrivate
diff --git a/src/plugins/sqldrivers/sqlite2/qsql_sqlite2_p.h b/src/plugins/sqldrivers/sqlite2/qsql_sqlite2_p.h
index 83b248ec6a..48c64536f1 100644
--- a/src/plugins/sqldrivers/sqlite2/qsql_sqlite2_p.h
+++ b/src/plugins/sqldrivers/sqlite2/qsql_sqlite2_p.h
@@ -79,29 +79,29 @@ public:
explicit QSQLite2Driver(QObject *parent = 0);
explicit QSQLite2Driver(sqlite *connection, QObject *parent = 0);
~QSQLite2Driver();
- bool hasFeature(DriverFeature f) const Q_DECL_OVERRIDE;
+ bool hasFeature(DriverFeature f) const override;
bool open(const QString &db,
const QString &user,
const QString &password,
const QString &host,
int port,
- const QString &connOpts) Q_DECL_OVERRIDE;
+ const QString &connOpts) override;
bool open(const QString &db,
const QString &user,
const QString &password,
const QString &host,
int port) { return open(db, user, password, host, port, QString()); }
- void close() Q_DECL_OVERRIDE;
- QSqlResult *createResult() const Q_DECL_OVERRIDE;
- bool beginTransaction() Q_DECL_OVERRIDE;
- bool commitTransaction() Q_DECL_OVERRIDE;
- bool rollbackTransaction() Q_DECL_OVERRIDE;
- QStringList tables(QSql::TableType) const Q_DECL_OVERRIDE;
+ void close() override;
+ QSqlResult *createResult() const override;
+ bool beginTransaction() override;
+ bool commitTransaction() override;
+ bool rollbackTransaction() override;
+ QStringList tables(QSql::TableType) const override;
- QSqlRecord record(const QString &tablename) const Q_DECL_OVERRIDE;
- QSqlIndex primaryIndex(const QString &table) const Q_DECL_OVERRIDE;
- QVariant handle() const Q_DECL_OVERRIDE;
- QString escapeIdentifier(const QString &identifier, IdentifierType) const Q_DECL_OVERRIDE;
+ QSqlRecord record(const QString &tablename) const override;
+ QSqlIndex primaryIndex(const QString &table) const override;
+ QVariant handle() const override;
+ QString escapeIdentifier(const QString &identifier, IdentifierType) const override;
};
QT_END_NAMESPACE
diff --git a/src/plugins/sqldrivers/tds/qsql_tds.cpp b/src/plugins/sqldrivers/tds/qsql_tds.cpp
index 670198af81..5fc34da407 100644
--- a/src/plugins/sqldrivers/tds/qsql_tds.cpp
+++ b/src/plugins/sqldrivers/tds/qsql_tds.cpp
@@ -163,15 +163,15 @@ class QTDSResult : public QSqlCachedResult
public:
explicit QTDSResult(const QTDSDriver* db);
~QTDSResult();
- QVariant handle() const Q_DECL_OVERRIDE;
+ QVariant handle() const override;
protected:
void cleanup();
- bool reset(const QString &query) Q_DECL_OVERRIDE;
- int size() Q_DECL_OVERRIDE;
- int numRowsAffected() Q_DECL_OVERRIDE;
- bool gotoNext(QSqlCachedResult::ValueCache &values, int index) Q_DECL_OVERRIDE;
- QSqlRecord record() const Q_DECL_OVERRIDE;
+ bool reset(const QString &query) override;
+ int size() override;
+ int numRowsAffected() override;
+ bool gotoNext(QSqlCachedResult::ValueCache &values, int index) override;
+ QSqlRecord record() const override;
};
class QTDSResultPrivate: public QSqlCachedResultPrivate
diff --git a/src/plugins/sqldrivers/tds/qsql_tds_p.h b/src/plugins/sqldrivers/tds/qsql_tds_p.h
index d0914455a2..948e3c7024 100644
--- a/src/plugins/sqldrivers/tds/qsql_tds_p.h
+++ b/src/plugins/sqldrivers/tds/qsql_tds_p.h
@@ -88,29 +88,29 @@ public:
explicit QTDSDriver(QObject* parent = 0);
QTDSDriver(LOGINREC* rec, const QString& host, const QString &db, QObject* parent = 0);
~QTDSDriver();
- bool hasFeature(DriverFeature f) const Q_DECL_OVERRIDE;
+ bool hasFeature(DriverFeature f) const override;
bool open(const QString &db,
const QString &user,
const QString &password,
const QString &host,
int port,
- const QString &connOpts) Q_DECL_OVERRIDE;
- void close() Q_DECL_OVERRIDE;
- QStringList tables(QSql::TableType) const Q_DECL_OVERRIDE;
- QSqlResult *createResult() const Q_DECL_OVERRIDE;
- QSqlRecord record(const QString &tablename) const Q_DECL_OVERRIDE;
- QSqlIndex primaryIndex(const QString &tablename) const Q_DECL_OVERRIDE;
+ const QString &connOpts) override;
+ void close() override;
+ QStringList tables(QSql::TableType) const override;
+ QSqlResult *createResult() const override;
+ QSqlRecord record(const QString &tablename) const override;
+ QSqlIndex primaryIndex(const QString &tablename) const override;
QString formatValue(const QSqlField &field,
- bool trimStrings) const Q_DECL_OVERRIDE;
- QVariant handle() const Q_DECL_OVERRIDE;
+ bool trimStrings) const override;
+ QVariant handle() const override;
- QString escapeIdentifier(const QString &identifier, IdentifierType type) const Q_DECL_OVERRIDE;
+ QString escapeIdentifier(const QString &identifier, IdentifierType type) const override;
protected:
- bool beginTransaction() Q_DECL_OVERRIDE;
- bool commitTransaction() Q_DECL_OVERRIDE;
- bool rollbackTransaction() Q_DECL_OVERRIDE;
+ bool beginTransaction() override;
+ bool commitTransaction() override;
+ bool rollbackTransaction() override;
private:
void init();
};
diff --git a/src/plugins/styles/windowsvista/qwindowsxpstyle.cpp b/src/plugins/styles/windowsvista/qwindowsxpstyle.cpp
index 0a47ccf68a..ba993e55f2 100644
--- a/src/plugins/styles/windowsvista/qwindowsxpstyle.cpp
+++ b/src/plugins/styles/windowsvista/qwindowsxpstyle.cpp
@@ -3963,6 +3963,40 @@ QWindowsXPStyle::QWindowsXPStyle(QWindowsXPStylePrivate &dd) : QWindowsStyle(dd)
{
}
+#ifndef QT_NO_DEBUG_STREAM
+QDebug operator<<(QDebug d, const XPThemeData &t)
+{
+ QDebugStateSaver saver(d);
+ d.nospace();
+ d << "XPThemeData(" << t.widget << ", theme=#" << t.theme << ", " << t.htheme
+ << ", partId=" << t.partId << ", stateId=" << t.stateId << ", rect=" << t.rect
+ << ", mirrorHorizontally=" << t.mirrorHorizontally << ", mirrorVertically="
+ << t.mirrorVertically << ", noBorder=" << t.noBorder << ", noContent=" << t.noContent
+ << ", rotate=" << t.rotate << ')';
+ return d;
+}
+
+QDebug operator<<(QDebug d, const ThemeMapKey &k)
+{
+ QDebugStateSaver saver(d);
+ d.nospace();
+ d << "ThemeMapKey(theme=#" << k.theme
+ << ", partId=" << k.partId << ", stateId=" << k.stateId
+ << ", noBorder=" << k.noBorder << ", noContent=" << k.noContent << ')';
+ return d;
+}
+
+QDebug operator<<(QDebug d, const ThemeMapData &td)
+{
+ QDebugStateSaver saver(d);
+ d.nospace();
+ d << "ThemeMapData(alphaType=" << td.alphaType
+ << ", dataValid=" << td.dataValid << ", partIsTransparent=" << td.partIsTransparent
+ << ", hasAlphaChannel=" << td.hasAlphaChannel << ", wasAlphaSwapped=" << td.wasAlphaSwapped
+ << ", hadInvalidAlpha=" << td.hadInvalidAlpha << ')';
+ return d;
+}
+#endif // QT_NO_DEBUG_STREAM
// Debugging code ---------------------------------------------------------------------[ START ]---
// The code for this point on is not compiled by default, but only used as assisting
diff --git a/src/plugins/styles/windowsvista/qwindowsxpstyle_p_p.h b/src/plugins/styles/windowsvista/qwindowsxpstyle_p_p.h
index 721a734829..4f3fd9c48d 100644
--- a/src/plugins/styles/windowsvista/qwindowsxpstyle_p_p.h
+++ b/src/plugins/styles/windowsvista/qwindowsxpstyle_p_p.h
@@ -64,6 +64,8 @@
QT_BEGIN_NAMESPACE
+class QDebug;
+
// TMT_TEXTSHADOWCOLOR is wrongly defined in mingw
#if TMT_TEXTSHADOWCOLOR != 3818
#undef TMT_TEXTSHADOWCOLOR
@@ -181,6 +183,12 @@ struct ThemeMapData {
hasAlphaChannel(false), wasAlphaSwapped(false), hadInvalidAlpha(false) {}
};
+#ifndef QT_NO_DEBUG_STREAM
+QDebug operator<<(QDebug d, const XPThemeData &t);
+QDebug operator<<(QDebug d, const ThemeMapKey &k);
+QDebug operator<<(QDebug d, const ThemeMapData &td);
+#endif
+
class QWindowsXPStylePrivate : public QWindowsStylePrivate
{
Q_DECLARE_PUBLIC(QWindowsXPStyle)
diff --git a/src/printsupport/dialogs/qabstractprintdialog.h b/src/printsupport/dialogs/qabstractprintdialog.h
index eb4dc3eb99..3cc89890fc 100644
--- a/src/printsupport/dialogs/qabstractprintdialog.h
+++ b/src/printsupport/dialogs/qabstractprintdialog.h
@@ -81,7 +81,7 @@ public:
Q_DECLARE_FLAGS(PrintDialogOptions, PrintDialogOption)
Q_FLAG(PrintDialogOptions)
- explicit QAbstractPrintDialog(QPrinter *printer, QWidget *parent = Q_NULLPTR);
+ explicit QAbstractPrintDialog(QPrinter *printer, QWidget *parent = nullptr);
~QAbstractPrintDialog();
int exec() override = 0;
@@ -108,7 +108,7 @@ public:
QPrinter *printer() const;
protected:
- QAbstractPrintDialog(QAbstractPrintDialogPrivate &ptr, QPrinter *printer, QWidget *parent = Q_NULLPTR);
+ QAbstractPrintDialog(QAbstractPrintDialogPrivate &ptr, QPrinter *printer, QWidget *parent = nullptr);
private:
Q_DISABLE_COPY(QAbstractPrintDialog)
diff --git a/src/printsupport/dialogs/qpagesetupdialog.h b/src/printsupport/dialogs/qpagesetupdialog.h
index 3bd752a413..a7aaa03134 100644
--- a/src/printsupport/dialogs/qpagesetupdialog.h
+++ b/src/printsupport/dialogs/qpagesetupdialog.h
@@ -57,19 +57,19 @@ class Q_PRINTSUPPORT_EXPORT QPageSetupDialog : public QDialog
Q_DECLARE_PRIVATE(QPageSetupDialog)
public:
- explicit QPageSetupDialog(QPrinter *printer, QWidget *parent = Q_NULLPTR);
- explicit QPageSetupDialog(QWidget *parent = Q_NULLPTR);
+ explicit QPageSetupDialog(QPrinter *printer, QWidget *parent = nullptr);
+ explicit QPageSetupDialog(QWidget *parent = nullptr);
~QPageSetupDialog();
#if defined(Q_OS_MAC) || defined(Q_OS_WIN)
- void setVisible(bool visible) Q_DECL_OVERRIDE;
+ void setVisible(bool visible) override;
#endif
- int exec() Q_DECL_OVERRIDE;
+ int exec() override;
using QDialog::open;
void open(QObject *receiver, const char *member);
- void done(int result) Q_DECL_OVERRIDE;
+ void done(int result) override;
QPrinter *printer();
};
diff --git a/src/printsupport/dialogs/qpagesetupdialog_unix.cpp b/src/printsupport/dialogs/qpagesetupdialog_unix.cpp
index b048ba8b29..c321552a19 100644
--- a/src/printsupport/dialogs/qpagesetupdialog_unix.cpp
+++ b/src/printsupport/dialogs/qpagesetupdialog_unix.cpp
@@ -117,7 +117,7 @@ public:
}
protected:
- void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE
+ void paintEvent(QPaintEvent *) override
{
QSize pageSize = m_pageLayout.fullRectPoints().size();
QSizeF scaledSize = pageSize.scaled(width() - 10, height() - 10, Qt::KeepAspectRatio);
diff --git a/src/printsupport/dialogs/qprintdialog.h b/src/printsupport/dialogs/qprintdialog.h
index 5b81440a3c..bbb12202f0 100644
--- a/src/printsupport/dialogs/qprintdialog.h
+++ b/src/printsupport/dialogs/qprintdialog.h
@@ -59,15 +59,15 @@ class Q_PRINTSUPPORT_EXPORT QPrintDialog : public QAbstractPrintDialog
Q_PROPERTY(PrintDialogOptions options READ options WRITE setOptions)
public:
- explicit QPrintDialog(QPrinter *printer, QWidget *parent = Q_NULLPTR);
- explicit QPrintDialog(QWidget *parent = Q_NULLPTR);
+ explicit QPrintDialog(QPrinter *printer, QWidget *parent = nullptr);
+ explicit QPrintDialog(QWidget *parent = nullptr);
~QPrintDialog();
- int exec() Q_DECL_OVERRIDE;
+ int exec() override;
#if defined (Q_OS_UNIX) && !defined(Q_OS_MAC)
- virtual void accept() Q_DECL_OVERRIDE;
+ virtual void accept() override;
#endif
- void done(int result) Q_DECL_OVERRIDE;
+ void done(int result) override;
void setOption(PrintDialogOption option, bool on = true);
bool testOption(PrintDialogOption option) const;
@@ -75,7 +75,7 @@ public:
PrintDialogOptions options() const;
#if defined(Q_OS_UNIX) || defined(Q_OS_WIN)
- void setVisible(bool visible) Q_DECL_OVERRIDE;
+ void setVisible(bool visible) override;
#endif
using QDialog::open;
diff --git a/src/printsupport/dialogs/qprintdialog_unix.cpp b/src/printsupport/dialogs/qprintdialog_unix.cpp
index a5f381d0a2..183af7daa3 100644
--- a/src/printsupport/dialogs/qprintdialog_unix.cpp
+++ b/src/printsupport/dialogs/qprintdialog_unix.cpp
@@ -217,7 +217,7 @@ public:
void setupPrinter();
void updateWidgets();
- virtual void setTabs(const QList<QWidget*> &tabs) Q_DECL_OVERRIDE;
+ virtual void setTabs(const QList<QWidget*> &tabs) override;
Ui::QPrintSettingsOutput options;
QUnixPrintWidget *top;
diff --git a/src/printsupport/dialogs/qprintpreviewdialog.cpp b/src/printsupport/dialogs/qprintpreviewdialog.cpp
index 174cfe4dba..2116e8a821 100644
--- a/src/printsupport/dialogs/qprintpreviewdialog.cpp
+++ b/src/printsupport/dialogs/qprintpreviewdialog.cpp
@@ -79,7 +79,7 @@ class QPrintPreviewMainWindow : public QMainWindow
{
public:
QPrintPreviewMainWindow(QWidget *parent) : QMainWindow(parent) {}
- QMenu *createPopupMenu() Q_DECL_OVERRIDE { return 0; }
+ QMenu *createPopupMenu() override { return 0; }
};
class ZoomFactorValidator : public QDoubleValidator
@@ -90,7 +90,7 @@ public:
ZoomFactorValidator(qreal bottom, qreal top, int decimals, QObject *parent)
: QDoubleValidator(bottom, top, decimals, parent) {}
- State validate(QString &input, int &pos) const Q_DECL_OVERRIDE
+ State validate(QString &input, int &pos) const override
{
bool replacePercent = false;
if (input.endsWith(QLatin1Char('%'))) {
@@ -123,13 +123,13 @@ public:
}
protected:
- void focusInEvent(QFocusEvent *e) Q_DECL_OVERRIDE
+ void focusInEvent(QFocusEvent *e) override
{
origText = text();
QLineEdit::focusInEvent(e);
}
- void focusOutEvent(QFocusEvent *e) Q_DECL_OVERRIDE
+ void focusOutEvent(QFocusEvent *e) override
{
if (isModified() && !hasAcceptableInput())
setText(origText);
diff --git a/src/printsupport/dialogs/qprintpreviewdialog.h b/src/printsupport/dialogs/qprintpreviewdialog.h
index 3b8f8a1171..53fede7e83 100644
--- a/src/printsupport/dialogs/qprintpreviewdialog.h
+++ b/src/printsupport/dialogs/qprintpreviewdialog.h
@@ -58,8 +58,8 @@ class Q_PRINTSUPPORT_EXPORT QPrintPreviewDialog : public QDialog
Q_DECLARE_PRIVATE(QPrintPreviewDialog)
public:
- explicit QPrintPreviewDialog(QWidget *parent = Q_NULLPTR, Qt::WindowFlags flags = Qt::WindowFlags());
- explicit QPrintPreviewDialog(QPrinter *printer, QWidget *parent = Q_NULLPTR,
+ explicit QPrintPreviewDialog(QWidget *parent = nullptr, Qt::WindowFlags flags = Qt::WindowFlags());
+ explicit QPrintPreviewDialog(QPrinter *printer, QWidget *parent = nullptr,
Qt::WindowFlags flags = Qt::WindowFlags());
~QPrintPreviewDialog();
@@ -68,8 +68,8 @@ public:
QPrinter *printer();
- void setVisible(bool visible) Q_DECL_OVERRIDE;
- void done(int result) Q_DECL_OVERRIDE;
+ void setVisible(bool visible) override;
+ void done(int result) override;
Q_SIGNALS:
void paintRequested(QPrinter *printer);
diff --git a/src/printsupport/kernel/qprintengine_pdf_p.h b/src/printsupport/kernel/qprintengine_pdf_p.h
index e9e81bdf68..bb01a2e9e1 100644
--- a/src/printsupport/kernel/qprintengine_pdf_p.h
+++ b/src/printsupport/kernel/qprintengine_pdf_p.h
@@ -87,18 +87,18 @@ public:
virtual ~QPdfPrintEngine();
// reimplementations QPaintEngine
- bool begin(QPaintDevice *pdev) Q_DECL_OVERRIDE;
- bool end() Q_DECL_OVERRIDE;
+ bool begin(QPaintDevice *pdev) override;
+ bool end() override;
// end reimplementations QPaintEngine
// reimplementations QPrintEngine
- bool abort() Q_DECL_OVERRIDE {return false;}
- QPrinter::PrinterState printerState() const Q_DECL_OVERRIDE {return state;}
+ bool abort() override {return false;}
+ QPrinter::PrinterState printerState() const override {return state;}
- bool newPage() Q_DECL_OVERRIDE;
- int metric(QPaintDevice::PaintDeviceMetric) const Q_DECL_OVERRIDE;
- virtual void setProperty(PrintEnginePropertyKey key, const QVariant &value) Q_DECL_OVERRIDE;
- virtual QVariant property(PrintEnginePropertyKey key) const Q_DECL_OVERRIDE;
+ bool newPage() override;
+ int metric(QPaintDevice::PaintDeviceMetric) const override;
+ virtual void setProperty(PrintEnginePropertyKey key, const QVariant &value) override;
+ virtual QVariant property(PrintEnginePropertyKey key) const override;
// end reimplementations QPrintEngine
QPrinter::PrinterState state;
diff --git a/src/printsupport/kernel/qprinter.cpp b/src/printsupport/kernel/qprinter.cpp
index 3135836ce7..dd0fa8639b 100644
--- a/src/printsupport/kernel/qprinter.cpp
+++ b/src/printsupport/kernel/qprinter.cpp
@@ -231,7 +231,7 @@ public:
virtual ~QPrinterPagedPaintDevicePrivate()
{}
- bool setPageLayout(const QPageLayout &newPageLayout) Q_DECL_OVERRIDE
+ bool setPageLayout(const QPageLayout &newPageLayout) override
{
if (pd->paintEngine->type() != QPaintEngine::Pdf
&& pd->printEngine->printerState() == QPrinter::Active) {
@@ -248,7 +248,7 @@ public:
return pageLayout().isEquivalentTo(newPageLayout);
}
- bool setPageSize(const QPageSize &pageSize) Q_DECL_OVERRIDE
+ bool setPageSize(const QPageSize &pageSize) override
{
if (pd->paintEngine->type() != QPaintEngine::Pdf
&& pd->printEngine->printerState() == QPrinter::Active) {
@@ -266,7 +266,7 @@ public:
return pageLayout().pageSize().isEquivalentTo(pageSize);
}
- bool setPageOrientation(QPageLayout::Orientation orientation) Q_DECL_OVERRIDE
+ bool setPageOrientation(QPageLayout::Orientation orientation) override
{
// Set the print engine value
pd->setProperty(QPrintEngine::PPK_Orientation, orientation);
@@ -277,12 +277,12 @@ public:
return pageLayout().orientation() == orientation;
}
- bool setPageMargins(const QMarginsF &margins) Q_DECL_OVERRIDE
+ bool setPageMargins(const QMarginsF &margins) override
{
return setPageMargins(margins, pageLayout().units());
}
- bool setPageMargins(const QMarginsF &margins, QPageLayout::Unit units) Q_DECL_OVERRIDE
+ bool setPageMargins(const QMarginsF &margins, QPageLayout::Unit units) override
{
// Try to set print engine margins
QPair<QMarginsF, QPageLayout::Unit> pair = qMakePair(margins, units);
@@ -294,7 +294,7 @@ public:
return pageLayout().margins() == margins && pageLayout().units() == units;
}
- QPageLayout pageLayout() const Q_DECL_OVERRIDE
+ QPageLayout pageLayout() const override
{
return pd->printEngine->property(QPrintEngine::PPK_QPageLayout).value<QPageLayout>();
}
diff --git a/src/printsupport/kernel/qprinter.h b/src/printsupport/kernel/qprinter.h
index bfe2d346ae..28dca78a63 100644
--- a/src/printsupport/kernel/qprinter.h
+++ b/src/printsupport/kernel/qprinter.h
@@ -72,7 +72,7 @@ public:
explicit QPrinter(const QPrinterInfo& printer, PrinterMode mode = ScreenResolution);
~QPrinter();
- int devType() const Q_DECL_OVERRIDE;
+ int devType() const override;
enum Orientation { Portrait, Landscape };
@@ -170,10 +170,10 @@ public:
void setOrientation(Orientation);
Orientation orientation() const;
- void setPageSize(PageSize) Q_DECL_OVERRIDE;
+ void setPageSize(PageSize) override;
PageSize pageSize() const;
- void setPageSizeMM(const QSizeF &size) Q_DECL_OVERRIDE;
+ void setPageSizeMM(const QSizeF &size) override;
void setPaperSize(PaperSize);
PaperSize paperSize() const;
@@ -237,12 +237,12 @@ public:
QString printerSelectionOption() const;
void setPrinterSelectionOption(const QString &);
- bool newPage() Q_DECL_OVERRIDE;
+ bool newPage() override;
bool abort();
PrinterState printerState() const;
- QPaintEngine *paintEngine() const Q_DECL_OVERRIDE;
+ QPaintEngine *paintEngine() const override;
QPrintEngine *printEngine() const;
void setFromTo(int fromPage, int toPage);
@@ -252,13 +252,13 @@ public:
void setPrintRange(PrintRange range);
PrintRange printRange() const;
- void setMargins(const Margins &m) Q_DECL_OVERRIDE;
+ void setMargins(const Margins &m) override;
void setPageMargins(qreal left, qreal top, qreal right, qreal bottom, Unit unit);
void getPageMargins(qreal *left, qreal *top, qreal *right, qreal *bottom, Unit unit) const;
protected:
- int metric(PaintDeviceMetric) const Q_DECL_OVERRIDE;
+ int metric(PaintDeviceMetric) const override;
void setEngines(QPrintEngine *printEngine, QPaintEngine *paintEngine);
private:
diff --git a/src/printsupport/widgets/qprintpreviewwidget.cpp b/src/printsupport/widgets/qprintpreviewwidget.cpp
index 9e44603bb8..d036a4394a 100644
--- a/src/printsupport/widgets/qprintpreviewwidget.cpp
+++ b/src/printsupport/widgets/qprintpreviewwidget.cpp
@@ -64,13 +64,13 @@ public:
setCacheMode(DeviceCoordinateCache);
}
- QRectF boundingRect() const Q_DECL_OVERRIDE
+ QRectF boundingRect() const override
{ return brect; }
inline int pageNumber() const
{ return pageNum; }
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *item, QWidget *widget) Q_DECL_OVERRIDE;
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *item, QWidget *widget) override;
private:
int pageNum;
@@ -156,7 +156,7 @@ signals:
void resized();
protected:
- void resizeEvent(QResizeEvent* e) Q_DECL_OVERRIDE
+ void resizeEvent(QResizeEvent* e) override
{
{
const QSignalBlocker blocker(verticalScrollBar()); // Don't change page, QTBUG-14517
@@ -165,7 +165,7 @@ protected:
emit resized();
}
- void showEvent(QShowEvent* e) Q_DECL_OVERRIDE
+ void showEvent(QShowEvent* e) override
{
QGraphicsView::showEvent(e);
emit resized();
diff --git a/src/printsupport/widgets/qprintpreviewwidget.h b/src/printsupport/widgets/qprintpreviewwidget.h
index 8735d06072..f11d686602 100644
--- a/src/printsupport/widgets/qprintpreviewwidget.h
+++ b/src/printsupport/widgets/qprintpreviewwidget.h
@@ -69,9 +69,9 @@ public:
FitInView
};
- explicit QPrintPreviewWidget(QPrinter *printer, QWidget *parent = Q_NULLPTR,
+ explicit QPrintPreviewWidget(QPrinter *printer, QWidget *parent = nullptr,
Qt::WindowFlags flags = Qt::WindowFlags());
- explicit QPrintPreviewWidget(QWidget *parent = Q_NULLPTR, Qt::WindowFlags flags = Qt::WindowFlags());
+ explicit QPrintPreviewWidget(QWidget *parent = nullptr, Qt::WindowFlags flags = Qt::WindowFlags());
~QPrintPreviewWidget();
qreal zoomFactor() const;
@@ -80,7 +80,7 @@ public:
ZoomMode zoomMode() const;
int currentPage() const;
int pageCount() const;
- void setVisible(bool visible) Q_DECL_OVERRIDE;
+ void setVisible(bool visible) override;
public Q_SLOTS:
void print();
diff --git a/src/sql/kernel/qsqlcachedresult_p.h b/src/sql/kernel/qsqlcachedresult_p.h
index 9bcfd49f1a..543a902554 100644
--- a/src/sql/kernel/qsqlcachedresult_p.h
+++ b/src/sql/kernel/qsqlcachedresult_p.h
@@ -78,20 +78,20 @@ protected:
virtual bool gotoNext(ValueCache &values, int index) = 0;
- QVariant data(int i) Q_DECL_OVERRIDE;
- bool isNull(int i) Q_DECL_OVERRIDE;
- bool fetch(int i) Q_DECL_OVERRIDE;
- bool fetchNext() Q_DECL_OVERRIDE;
- bool fetchPrevious() Q_DECL_OVERRIDE;
- bool fetchFirst() Q_DECL_OVERRIDE;
- bool fetchLast() Q_DECL_OVERRIDE;
+ QVariant data(int i) override;
+ bool isNull(int i) override;
+ bool fetch(int i) override;
+ bool fetchNext() override;
+ bool fetchPrevious() override;
+ bool fetchFirst() override;
+ bool fetchLast() override;
int colCount() const;
ValueCache &cache();
- void virtual_hook(int id, void *data) Q_DECL_OVERRIDE;
- void detachFromResultSet() Q_DECL_OVERRIDE;
- void setNumericalPrecisionPolicy(QSql::NumericalPrecisionPolicy policy) Q_DECL_OVERRIDE;
+ void virtual_hook(int id, void *data) override;
+ void detachFromResultSet() override;
+ void setNumericalPrecisionPolicy(QSql::NumericalPrecisionPolicy policy) override;
private:
bool cacheNext();
};
diff --git a/src/sql/kernel/qsqldatabase.h b/src/sql/kernel/qsqldatabase.h
index 0b4aca8cdd..684b9c04a1 100644
--- a/src/sql/kernel/qsqldatabase.h
+++ b/src/sql/kernel/qsqldatabase.h
@@ -64,7 +64,7 @@ template <class T>
class QSqlDriverCreator : public QSqlDriverCreatorBase
{
public:
- QSqlDriver *createObject() const Q_DECL_OVERRIDE { return new T; }
+ QSqlDriver *createObject() const override { return new T; }
};
class Q_SQL_EXPORT QSqlDatabase
diff --git a/src/sql/kernel/qsqldriver.h b/src/sql/kernel/qsqldriver.h
index 1296bd5d51..1e03be48d3 100644
--- a/src/sql/kernel/qsqldriver.h
+++ b/src/sql/kernel/qsqldriver.h
@@ -89,7 +89,7 @@ public:
DB2
};
- explicit QSqlDriver(QObject *parent = Q_NULLPTR);
+ explicit QSqlDriver(QObject *parent = nullptr);
~QSqlDriver();
virtual bool isOpen() const;
bool isOpenError() const;
@@ -139,7 +139,7 @@ Q_SIGNALS:
void notification(const QString &name, QSqlDriver::NotificationSource source, const QVariant &payload);
protected:
- QSqlDriver(QSqlDriverPrivate &dd, QObject *parent = Q_NULLPTR);
+ QSqlDriver(QSqlDriverPrivate &dd, QObject *parent = nullptr);
virtual void setOpen(bool o);
virtual void setOpenError(bool e);
virtual void setLastError(const QSqlError& e);
diff --git a/src/sql/kernel/qsqldriverplugin.h b/src/sql/kernel/qsqldriverplugin.h
index c0f4c00943..001368a291 100644
--- a/src/sql/kernel/qsqldriverplugin.h
+++ b/src/sql/kernel/qsqldriverplugin.h
@@ -55,7 +55,7 @@ class Q_SQL_EXPORT QSqlDriverPlugin : public QObject
{
Q_OBJECT
public:
- explicit QSqlDriverPlugin(QObject *parent = Q_NULLPTR);
+ explicit QSqlDriverPlugin(QObject *parent = nullptr);
~QSqlDriverPlugin();
virtual QSqlDriver *create(const QString &key) = 0;
diff --git a/src/sql/kernel/qsqlnulldriver_p.h b/src/sql/kernel/qsqlnulldriver_p.h
index 92d8d30485..7a40199d71 100644
--- a/src/sql/kernel/qsqlnulldriver_p.h
+++ b/src/sql/kernel/qsqlnulldriver_p.h
@@ -66,27 +66,27 @@ public:
{ QSqlResult::setLastError(
QSqlError(QLatin1String("Driver not loaded"), QLatin1String("Driver not loaded"), QSqlError::ConnectionError)); }
protected:
- inline QVariant data(int) Q_DECL_OVERRIDE { return QVariant(); }
- inline bool reset (const QString&) Q_DECL_OVERRIDE { return false; }
- inline bool fetch(int) Q_DECL_OVERRIDE { return false; }
- inline bool fetchFirst() Q_DECL_OVERRIDE { return false; }
- inline bool fetchLast() Q_DECL_OVERRIDE { return false; }
- inline bool isNull(int) Q_DECL_OVERRIDE { return false; }
- inline int size() Q_DECL_OVERRIDE { return -1; }
- inline int numRowsAffected() Q_DECL_OVERRIDE { return 0; }
+ inline QVariant data(int) override { return QVariant(); }
+ inline bool reset (const QString&) override { return false; }
+ inline bool fetch(int) override { return false; }
+ inline bool fetchFirst() override { return false; }
+ inline bool fetchLast() override { return false; }
+ inline bool isNull(int) override { return false; }
+ inline int size() override { return -1; }
+ inline int numRowsAffected() override { return 0; }
- inline void setAt(int) Q_DECL_OVERRIDE {}
- inline void setActive(bool) Q_DECL_OVERRIDE {}
- inline void setLastError(const QSqlError&) Q_DECL_OVERRIDE {}
- inline void setQuery(const QString&) Q_DECL_OVERRIDE {}
- inline void setSelect(bool) Q_DECL_OVERRIDE {}
- inline void setForwardOnly(bool) Q_DECL_OVERRIDE {}
+ inline void setAt(int) override {}
+ inline void setActive(bool) override {}
+ inline void setLastError(const QSqlError&) override {}
+ inline void setQuery(const QString&) override {}
+ inline void setSelect(bool) override {}
+ inline void setForwardOnly(bool) override {}
- inline bool exec() Q_DECL_OVERRIDE { return false; }
- inline bool prepare(const QString&) Q_DECL_OVERRIDE { return false; }
- inline bool savePrepare(const QString&) Q_DECL_OVERRIDE { return false; }
- inline void bindValue(int, const QVariant&, QSql::ParamType) Q_DECL_OVERRIDE {}
- inline void bindValue(const QString&, const QVariant&, QSql::ParamType) Q_DECL_OVERRIDE {}
+ inline bool exec() override { return false; }
+ inline bool prepare(const QString&) override { return false; }
+ inline bool savePrepare(const QString&) override { return false; }
+ inline void bindValue(int, const QVariant&, QSql::ParamType) override {}
+ inline void bindValue(const QString&, const QVariant&, QSql::ParamType) override {}
};
class QSqlNullDriver : public QSqlDriver
@@ -95,16 +95,16 @@ public:
inline QSqlNullDriver(): QSqlDriver()
{ QSqlDriver::setLastError(
QSqlError(QLatin1String("Driver not loaded"), QLatin1String("Driver not loaded"), QSqlError::ConnectionError)); }
- inline bool hasFeature(DriverFeature) const Q_DECL_OVERRIDE { return false; }
- inline bool open(const QString &, const QString &, const QString &, const QString &, int, const QString&) Q_DECL_OVERRIDE
+ inline bool hasFeature(DriverFeature) const override { return false; }
+ inline bool open(const QString &, const QString &, const QString &, const QString &, int, const QString&) override
{ return false; }
- inline void close() Q_DECL_OVERRIDE {}
- inline QSqlResult *createResult() const Q_DECL_OVERRIDE { return new QSqlNullResult(this); }
+ inline void close() override {}
+ inline QSqlResult *createResult() const override { return new QSqlNullResult(this); }
protected:
- inline void setOpen(bool) Q_DECL_OVERRIDE {}
- inline void setOpenError(bool) Q_DECL_OVERRIDE {}
- inline void setLastError(const QSqlError&) Q_DECL_OVERRIDE {}
+ inline void setOpen(bool) override {}
+ inline void setOpenError(bool) override {}
+ inline void setLastError(const QSqlError&) override {}
};
QT_END_NAMESPACE
diff --git a/src/sql/models/qsqlrelationaltablemodel.cpp b/src/sql/models/qsqlrelationaltablemodel.cpp
index 9d6daa2634..8220fea39a 100644
--- a/src/sql/models/qsqlrelationaltablemodel.cpp
+++ b/src/sql/models/qsqlrelationaltablemodel.cpp
@@ -156,7 +156,7 @@ class QRelatedTableModel : public QSqlTableModel
{
public:
QRelatedTableModel(QRelation *rel, QObject *parent = 0, QSqlDatabase db = QSqlDatabase());
- bool select() Q_DECL_OVERRIDE;
+ bool select() override;
private:
bool firstSelect;
QRelation *relation;
@@ -268,12 +268,12 @@ public:
{}
QString fullyQualifiedFieldName(const QString &tableName, const QString &fieldName) const;
- int nameToIndex(const QString &name) const Q_DECL_OVERRIDE;
+ int nameToIndex(const QString &name) const override;
mutable QVector<QRelation> relations;
QSqlRecord baseRec; // the record without relations
void clearChanges();
- void clearCache() Q_DECL_OVERRIDE;
- void revertCachedRow(int row) Q_DECL_OVERRIDE;
+ void clearCache() override;
+ void revertCachedRow(int row) override;
void translateFieldNames(QSqlRecord &values) const;
QSqlRelationalTableModel::JoinMode joinMode;
diff --git a/src/sql/models/qsqlrelationaltablemodel.h b/src/sql/models/qsqlrelationaltablemodel.h
index f8b08b089f..90b7a6481f 100644
--- a/src/sql/models/qsqlrelationaltablemodel.h
+++ b/src/sql/models/qsqlrelationaltablemodel.h
@@ -88,31 +88,31 @@ public:
LeftJoin
};
- explicit QSqlRelationalTableModel(QObject *parent = Q_NULLPTR,
+ explicit QSqlRelationalTableModel(QObject *parent = nullptr,
QSqlDatabase db = QSqlDatabase());
virtual ~QSqlRelationalTableModel();
- QVariant data(const QModelIndex &item, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
- bool setData(const QModelIndex &item, const QVariant &value, int role = Qt::EditRole) Q_DECL_OVERRIDE;
- bool removeColumns(int column, int count, const QModelIndex &parent = QModelIndex()) Q_DECL_OVERRIDE;
+ QVariant data(const QModelIndex &item, int role = Qt::DisplayRole) const override;
+ bool setData(const QModelIndex &item, const QVariant &value, int role = Qt::EditRole) override;
+ bool removeColumns(int column, int count, const QModelIndex &parent = QModelIndex()) override;
- void clear() Q_DECL_OVERRIDE;
- bool select() Q_DECL_OVERRIDE;
+ void clear() override;
+ bool select() override;
- void setTable(const QString &tableName) Q_DECL_OVERRIDE;
+ void setTable(const QString &tableName) override;
virtual void setRelation(int column, const QSqlRelation &relation);
QSqlRelation relation(int column) const;
virtual QSqlTableModel *relationModel(int column) const;
void setJoinMode( QSqlRelationalTableModel::JoinMode joinMode );
public Q_SLOTS:
- void revertRow(int row) Q_DECL_OVERRIDE;
+ void revertRow(int row) override;
protected:
- QString selectStatement() const Q_DECL_OVERRIDE;
- bool updateRowInTable(int row, const QSqlRecord &values) Q_DECL_OVERRIDE;
- bool insertRowIntoTable(const QSqlRecord &values) Q_DECL_OVERRIDE;
- QString orderByClause() const Q_DECL_OVERRIDE;
+ QString selectStatement() const override;
+ bool updateRowInTable(int row, const QSqlRecord &values) override;
+ bool insertRowIntoTable(const QSqlRecord &values) override;
+ QString orderByClause() const override;
private:
Q_DECLARE_PRIVATE(QSqlRelationalTableModel)
diff --git a/src/sql/models/qsqltablemodel.h b/src/sql/models/qsqltablemodel.h
index 6a62c6993d..77b0517c74 100644
--- a/src/sql/models/qsqltablemodel.h
+++ b/src/sql/models/qsqltablemodel.h
@@ -60,25 +60,25 @@ class Q_SQL_EXPORT QSqlTableModel: public QSqlQueryModel
public:
enum EditStrategy {OnFieldChange, OnRowChange, OnManualSubmit};
- explicit QSqlTableModel(QObject *parent = Q_NULLPTR, QSqlDatabase db = QSqlDatabase());
+ explicit QSqlTableModel(QObject *parent = nullptr, QSqlDatabase db = QSqlDatabase());
virtual ~QSqlTableModel();
virtual void setTable(const QString &tableName);
QString tableName() const;
- Qt::ItemFlags flags(const QModelIndex &index) const Q_DECL_OVERRIDE;
+ Qt::ItemFlags flags(const QModelIndex &index) const override;
QSqlRecord record() const;
QSqlRecord record(int row) const;
- QVariant data(const QModelIndex &idx, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
- bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) Q_DECL_OVERRIDE;
+ QVariant data(const QModelIndex &idx, int role = Qt::DisplayRole) const override;
+ bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;
- QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
+ QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
bool isDirty() const;
bool isDirty(const QModelIndex &index) const;
- void clear() Q_DECL_OVERRIDE;
+ void clear() override;
virtual void setEditStrategy(EditStrategy strategy);
EditStrategy editStrategy() const;
@@ -87,17 +87,17 @@ public:
QSqlDatabase database() const;
int fieldIndex(const QString &fieldName) const;
- void sort(int column, Qt::SortOrder order) Q_DECL_OVERRIDE;
+ void sort(int column, Qt::SortOrder order) override;
virtual void setSort(int column, Qt::SortOrder order);
QString filter() const;
virtual void setFilter(const QString &filter);
- int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
+ int rowCount(const QModelIndex &parent = QModelIndex()) const override;
- bool removeColumns(int column, int count, const QModelIndex &parent = QModelIndex()) Q_DECL_OVERRIDE;
- bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()) Q_DECL_OVERRIDE;
- bool insertRows(int row, int count, const QModelIndex &parent = QModelIndex()) Q_DECL_OVERRIDE;
+ bool removeColumns(int column, int count, const QModelIndex &parent = QModelIndex()) override;
+ bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()) override;
+ bool insertRows(int row, int count, const QModelIndex &parent = QModelIndex()) override;
bool insertRecord(int row, const QSqlRecord &record);
bool setRecord(int row, const QSqlRecord &record);
@@ -108,8 +108,8 @@ public Q_SLOTS:
virtual bool select();
virtual bool selectRow(int row);
- bool submit() Q_DECL_OVERRIDE;
- void revert() Q_DECL_OVERRIDE;
+ bool submit() override;
+ void revert() override;
bool submitAll();
void revertAll();
@@ -122,7 +122,7 @@ Q_SIGNALS:
void beforeDelete(int row);
protected:
- QSqlTableModel(QSqlTableModelPrivate &dd, QObject *parent = Q_NULLPTR, QSqlDatabase db = QSqlDatabase());
+ QSqlTableModel(QSqlTableModelPrivate &dd, QObject *parent = nullptr, QSqlDatabase db = QSqlDatabase());
virtual bool updateRowInTable(int row, const QSqlRecord &values);
virtual bool insertRowIntoTable(const QSqlRecord &values);
@@ -132,7 +132,7 @@ protected:
void setPrimaryKey(const QSqlIndex &key);
void setQuery(const QSqlQuery &query);
- QModelIndex indexInQuery(const QModelIndex &item) const Q_DECL_OVERRIDE;
+ QModelIndex indexInQuery(const QModelIndex &item) const override;
QSqlRecord primaryValues(int row) const;
};
diff --git a/src/testlib/3rdparty/cycle_p.h b/src/testlib/3rdparty/cycle_p.h
index a2924230ad..95e741a82a 100644
--- a/src/testlib/3rdparty/cycle_p.h
+++ b/src/testlib/3rdparty/cycle_p.h
@@ -493,21 +493,4 @@ INLINE_ELAPSED(inline)
#define HAVE_TICK_COUNTER
#endif
-/*----------------------------------------------------------------*/
-/* Symbian */
-#if defined(__SYMBIAN32__) && !defined(HAVE_TICK_COUNTER)
-#include <e32std.h>
-
-typedef TUint32 CycleCounterTicks;
-
-static inline CycleCounterTicks getticks(void)
-{
- return User::FastCounter();
-}
-
-INLINE_ELAPSED(inline)
-
-#define HAVE_TICK_COUNTER
-#endif
-
#endif // QBENCHLIB_CYCLE_H
diff --git a/src/testlib/qbenchmarkperfevents_p.h b/src/testlib/qbenchmarkperfevents_p.h
index 085dc620d7..86ba556549 100644
--- a/src/testlib/qbenchmarkperfevents_p.h
+++ b/src/testlib/qbenchmarkperfevents_p.h
@@ -60,16 +60,16 @@ class QBenchmarkPerfEventsMeasurer : public QBenchmarkMeasurerBase
public:
QBenchmarkPerfEventsMeasurer();
~QBenchmarkPerfEventsMeasurer();
- virtual void init() Q_DECL_OVERRIDE;
- virtual void start() Q_DECL_OVERRIDE;
- virtual qint64 checkpoint() Q_DECL_OVERRIDE;
- virtual qint64 stop() Q_DECL_OVERRIDE;
- virtual bool isMeasurementAccepted(qint64 measurement) Q_DECL_OVERRIDE;
- virtual int adjustIterationCount(int suggestion) Q_DECL_OVERRIDE;
- virtual int adjustMedianCount(int suggestion) Q_DECL_OVERRIDE;
- virtual bool repeatCount() Q_DECL_OVERRIDE { return 1; }
- virtual bool needsWarmupIteration() Q_DECL_OVERRIDE { return true; }
- virtual QTest::QBenchmarkMetric metricType() Q_DECL_OVERRIDE;
+ virtual void init() override;
+ virtual void start() override;
+ virtual qint64 checkpoint() override;
+ virtual qint64 stop() override;
+ virtual bool isMeasurementAccepted(qint64 measurement) override;
+ virtual int adjustIterationCount(int suggestion) override;
+ virtual int adjustMedianCount(int suggestion) override;
+ virtual bool repeatCount() override { return 1; }
+ virtual bool needsWarmupIteration() override { return true; }
+ virtual QTest::QBenchmarkMetric metricType() override;
static bool isAvailable();
static QTest::QBenchmarkMetric metricForEvent(quint32 type, quint64 event_id);
diff --git a/src/testlib/qcsvbenchmarklogger_p.h b/src/testlib/qcsvbenchmarklogger_p.h
index f321494e8a..5840aee0f5 100644
--- a/src/testlib/qcsvbenchmarklogger_p.h
+++ b/src/testlib/qcsvbenchmarklogger_p.h
@@ -61,18 +61,18 @@ public:
QCsvBenchmarkLogger(const char *filename);
~QCsvBenchmarkLogger();
- void startLogging() Q_DECL_OVERRIDE;
- void stopLogging() Q_DECL_OVERRIDE;
+ void startLogging() override;
+ void stopLogging() override;
- void enterTestFunction(const char *function) Q_DECL_OVERRIDE;
- void leaveTestFunction() Q_DECL_OVERRIDE;
+ void enterTestFunction(const char *function) override;
+ void leaveTestFunction() override;
void addIncident(IncidentTypes type, const char *description,
- const char *file = 0, int line = 0) Q_DECL_OVERRIDE;
- void addBenchmarkResult(const QBenchmarkResult &result) Q_DECL_OVERRIDE;
+ const char *file = 0, int line = 0) override;
+ void addBenchmarkResult(const QBenchmarkResult &result) override;
void addMessage(MessageTypes type, const QString &message,
- const char *file = 0, int line = 0) Q_DECL_OVERRIDE;
+ const char *file = 0, int line = 0) override;
};
QT_END_NAMESPACE
diff --git a/src/testlib/qsignalspy.h b/src/testlib/qsignalspy.h
index 6b1b7e6922..d9a0f4496b 100644
--- a/src/testlib/qsignalspy.h
+++ b/src/testlib/qsignalspy.h
@@ -88,7 +88,7 @@ public:
}
if (!QMetaObject::connect(obj, sigIndex, this, memberOffset,
- Qt::DirectConnection, Q_NULLPTR)) {
+ Qt::DirectConnection, nullptr)) {
qWarning("QSignalSpy: QMetaObject::connect returned false. Unable to connect.");
return;
}
@@ -151,7 +151,7 @@ public:
return count() > origCount;
}
- int qt_metacall(QMetaObject::Call call, int methodId, void **a) Q_DECL_OVERRIDE
+ int qt_metacall(QMetaObject::Call call, int methodId, void **a) override
{
methodId = QObject::qt_metacall(call, methodId, a);
if (methodId < 0)
diff --git a/src/testlib/qtest.h b/src/testlib/qtest.h
index ca045120d5..a5df27e3b9 100644
--- a/src/testlib/qtest.h
+++ b/src/testlib/qtest.h
@@ -263,7 +263,7 @@ inline bool qCompare(QList<T> const &t1, QList<T> const &t2, const char *actual,
delete [] val2;
}
}
- return compare_helper(isOk, msg, Q_NULLPTR, Q_NULLPTR, actual, expected, file, line);
+ return compare_helper(isOk, msg, nullptr, nullptr, actual, expected, file, line);
}
template <>
diff --git a/src/testlib/qtest_gui.h b/src/testlib/qtest_gui.h
index d4b2de2214..fc3e5d3fe2 100644
--- a/src/testlib/qtest_gui.h
+++ b/src/testlib/qtest_gui.h
@@ -164,24 +164,24 @@ inline bool qCompare(QImage const &t1, QImage const &t2,
qsnprintf(msg, 1024, "Compared QImages differ.\n"
" Actual (%s).isNull(): %d\n"
" Expected (%s).isNull(): %d", actual, t1Null, expected, t2Null);
- return compare_helper(false, msg, Q_NULLPTR, Q_NULLPTR, actual, expected, file, line);
+ return compare_helper(false, msg, nullptr, nullptr, actual, expected, file, line);
}
if (t1Null && t2Null)
- return compare_helper(true, Q_NULLPTR, Q_NULLPTR, Q_NULLPTR, actual, expected, file, line);
+ return compare_helper(true, nullptr, nullptr, nullptr, actual, expected, file, line);
if (t1.width() != t2.width() || t1.height() != t2.height()) {
qsnprintf(msg, 1024, "Compared QImages differ in size.\n"
" Actual (%s): %dx%d\n"
" Expected (%s): %dx%d",
actual, t1.width(), t1.height(),
expected, t2.width(), t2.height());
- return compare_helper(false, msg, Q_NULLPTR, Q_NULLPTR, actual, expected, file, line);
+ return compare_helper(false, msg, nullptr, nullptr, actual, expected, file, line);
}
if (t1.format() != t2.format()) {
qsnprintf(msg, 1024, "Compared QImages differ in format.\n"
" Actual (%s): %d\n"
" Expected (%s): %d",
actual, t1.format(), expected, t2.format());
- return compare_helper(false, msg, Q_NULLPTR, Q_NULLPTR, actual, expected, file, line);
+ return compare_helper(false, msg, nullptr, nullptr, actual, expected, file, line);
}
return compare_helper(t1 == t2, "Compared values are not the same",
toString(t1), toString(t2), actual, expected, file, line);
@@ -198,17 +198,17 @@ inline bool qCompare(QPixmap const &t1, QPixmap const &t2, const char *actual, c
qsnprintf(msg, 1024, "Compared QPixmaps differ.\n"
" Actual (%s).isNull(): %d\n"
" Expected (%s).isNull(): %d", actual, t1Null, expected, t2Null);
- return compare_helper(false, msg, Q_NULLPTR, Q_NULLPTR, actual, expected, file, line);
+ return compare_helper(false, msg, nullptr, nullptr, actual, expected, file, line);
}
if (t1Null && t2Null)
- return compare_helper(true, Q_NULLPTR, Q_NULLPTR, Q_NULLPTR, actual, expected, file, line);
+ return compare_helper(true, nullptr, nullptr, nullptr, actual, expected, file, line);
if (t1.width() != t2.width() || t1.height() != t2.height()) {
qsnprintf(msg, 1024, "Compared QPixmaps differ in size.\n"
" Actual (%s): %dx%d\n"
" Expected (%s): %dx%d",
actual, t1.width(), t1.height(),
expected, t2.width(), t2.height());
- return compare_helper(false, msg, Q_NULLPTR, Q_NULLPTR, actual, expected, file, line);
+ return compare_helper(false, msg, nullptr, nullptr, actual, expected, file, line);
}
return qCompare(t1.toImage(), t2.toImage(), actual, expected, file, line);
}
diff --git a/src/testlib/qtestaccessible.h b/src/testlib/qtestaccessible.h
index 464f87fb5c..0470d15ed7 100644
--- a/src/testlib/qtestaccessible.h
+++ b/src/testlib/qtestaccessible.h
@@ -132,7 +132,7 @@ public:
static void cleanup()
{
delete instance();
- instance() = Q_NULLPTR;
+ instance() = nullptr;
}
static void clearEvents() { eventList().clear(); }
static EventList events() { return eventList(); }
@@ -167,8 +167,8 @@ private:
~QTestAccessibility()
{
- QAccessible::installUpdateHandler(Q_NULLPTR);
- QAccessible::installRootObjectHandler(Q_NULLPTR);
+ QAccessible::installUpdateHandler(nullptr);
+ QAccessible::installRootObjectHandler(nullptr);
}
static void rootObjectHandler(QObject *object)
@@ -273,7 +273,7 @@ private:
static QTestAccessibility *&instance()
{
- static QTestAccessibility *ta = Q_NULLPTR;
+ static QTestAccessibility *ta = nullptr;
return ta;
}
diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp
index 3b5acb6b95..8f8bb83f11 100644
--- a/src/testlib/qtestcase.cpp
+++ b/src/testlib/qtestcase.cpp
@@ -901,6 +901,10 @@ void TestMethods::invokeTestOnData(int index) const
if (m_cleanupMethod.isValid())
m_cleanupMethod.invoke(QTest::currentTestObject, Qt::DirectConnection);
+ // Process any deleteLater(), like event-loop based apps would do. Fixes memleak reports.
+ if (QCoreApplication::instance())
+ QCoreApplication::sendPostedEvents(nullptr, QEvent::DeferredDelete);
+
// If the test isn't a benchmark, finalize the result after cleanup() has finished.
if (!isBenchmark)
QTestResult::finishedCurrentTestDataCleanup();
@@ -1385,7 +1389,7 @@ void TestMethods::invokeTests(QObject *testObject) const
if (!QTestResult::skipCurrentTest() && !previousFailed) {
for (int i = 0, count = int(m_methods.size()); i < count; ++i) {
- const char *data = Q_NULLPTR;
+ const char *data = nullptr;
if (i < QTest::testTags.size() && !QTest::testTags.at(i).isEmpty())
data = qstrdup(QTest::testTags.at(i).toLatin1().constData());
const bool ok = invokeTest(i, data, watchDog.data());
@@ -1530,7 +1534,7 @@ class DebugSymbolResolver
Q_DISABLE_COPY(DebugSymbolResolver)
public:
struct Symbol {
- Symbol() : name(Q_NULLPTR), address(0) {}
+ Symbol() : name(nullptr), address(0) {}
const char *name; // Must be freed by caller.
DWORD64 address;
@@ -1578,11 +1582,11 @@ void DebugSymbolResolver::cleanup()
if (m_dbgHelpLib)
FreeLibrary(m_dbgHelpLib);
m_dbgHelpLib = 0;
- m_symFromAddr = Q_NULLPTR;
+ m_symFromAddr = nullptr;
}
DebugSymbolResolver::DebugSymbolResolver(HANDLE process)
- : m_process(process), m_dbgHelpLib(0), m_symFromAddr(Q_NULLPTR)
+ : m_process(process), m_dbgHelpLib(0), m_symFromAddr(nullptr)
{
bool success = false;
m_dbgHelpLib = LoadLibraryW(L"dbghelp.dll");
diff --git a/src/testlib/qtestcase.h b/src/testlib/qtestcase.h
index 2605325a94..f38f7ed4df 100644
--- a/src/testlib/qtestcase.h
+++ b/src/testlib/qtestcase.h
@@ -250,7 +250,7 @@ namespace QTest
template <typename T> // Fallback
inline typename std::enable_if<!QtPrivate::IsQEnumHelper<T>::Value, char*>::type toString(const T &)
{
- return Q_NULLPTR;
+ return nullptr;
}
} // namespace Internal
@@ -273,14 +273,14 @@ namespace QTest
Q_TESTLIB_EXPORT char *toString(const char *);
Q_TESTLIB_EXPORT char *toString(const void *);
- Q_TESTLIB_EXPORT void qInit(QObject *testObject, int argc = 0, char **argv = Q_NULLPTR);
+ Q_TESTLIB_EXPORT void qInit(QObject *testObject, int argc = 0, char **argv = nullptr);
Q_TESTLIB_EXPORT int qRun();
Q_TESTLIB_EXPORT void qCleanup();
- Q_TESTLIB_EXPORT int qExec(QObject *testObject, int argc = 0, char **argv = Q_NULLPTR);
+ Q_TESTLIB_EXPORT int qExec(QObject *testObject, int argc = 0, char **argv = nullptr);
Q_TESTLIB_EXPORT int qExec(QObject *testObject, const QStringList &arguments);
- Q_TESTLIB_EXPORT void setMainSourcePath(const char *file, const char *builddir = Q_NULLPTR);
+ Q_TESTLIB_EXPORT void setMainSourcePath(const char *file, const char *builddir = nullptr);
Q_TESTLIB_EXPORT bool qVerify(bool statement, const char *statementStr, const char *description,
const char *file, int line);
@@ -288,7 +288,7 @@ namespace QTest
Q_TESTLIB_EXPORT void qSkip(const char *message, const char *file, int line);
Q_TESTLIB_EXPORT bool qExpectFail(const char *dataIndex, const char *comment, TestFailMode mode,
const char *file, int line);
- Q_TESTLIB_EXPORT void qWarn(const char *message, const char *file = Q_NULLPTR, int line = 0);
+ Q_TESTLIB_EXPORT void qWarn(const char *message, const char *file = nullptr, int line = 0);
Q_TESTLIB_EXPORT void ignoreMessage(QtMsgType type, const char *message);
#ifndef QT_NO_REGULAREXPRESSION
Q_TESTLIB_EXPORT void ignoreMessage(QtMsgType type, const QRegularExpression &messagePattern);
@@ -297,8 +297,8 @@ namespace QTest
#if QT_CONFIG(temporaryfile)
Q_TESTLIB_EXPORT QSharedPointer<QTemporaryDir> qExtractTestData(const QString &dirName);
#endif
- Q_TESTLIB_EXPORT QString qFindTestData(const char* basepath, const char* file = Q_NULLPTR, int line = 0, const char* builddir = Q_NULLPTR);
- Q_TESTLIB_EXPORT QString qFindTestData(const QString& basepath, const char* file = Q_NULLPTR, int line = 0, const char* builddir = Q_NULLPTR);
+ Q_TESTLIB_EXPORT QString qFindTestData(const char* basepath, const char* file = nullptr, int line = 0, const char* builddir = nullptr);
+ Q_TESTLIB_EXPORT QString qFindTestData(const QString& basepath, const char* file = nullptr, int line = 0, const char* builddir = nullptr);
Q_TESTLIB_EXPORT void *qData(const char *tagName, int typeId);
Q_TESTLIB_EXPORT void *qGlobalData(const char *tagName, int typeId);
diff --git a/src/testlib/qtesteventloop.h b/src/testlib/qtesteventloop.h
index bcf4a4be2d..81c0b9126c 100644
--- a/src/testlib/qtesteventloop.h
+++ b/src/testlib/qtesteventloop.h
@@ -56,8 +56,8 @@ class Q_TESTLIB_EXPORT QTestEventLoop : public QObject
Q_OBJECT
public:
- inline QTestEventLoop(QObject *aParent = Q_NULLPTR)
- : QObject(aParent), inLoop(false), _timeout(false), timerId(-1), loop(Q_NULLPTR) {}
+ inline QTestEventLoop(QObject *aParent = nullptr)
+ : QObject(aParent), inLoop(false), _timeout(false), timerId(-1), loop(nullptr) {}
inline void enterLoopMSecs(int ms);
inline void enterLoop(int secs) { enterLoopMSecs(secs * 1000); }
@@ -103,7 +103,7 @@ inline void QTestEventLoop::enterLoopMSecs(int ms)
loop = &l;
l.exec();
- loop = Q_NULLPTR;
+ loop = nullptr;
}
inline void QTestEventLoop::exitLoop()
diff --git a/src/testlib/qtestmouse.h b/src/testlib/qtestmouse.h
index 8f55c1801f..55f8baa003 100644
--- a/src/testlib/qtestmouse.h
+++ b/src/testlib/qtestmouse.h
@@ -64,7 +64,9 @@
QT_BEGIN_NAMESPACE
-Q_GUI_EXPORT void qt_handleMouseEvent(QWindow *w, const QPointF &local, const QPointF &global, Qt::MouseButtons b, Qt::KeyboardModifiers mods, int timestamp);
+Q_GUI_EXPORT void qt_handleMouseEvent(QWindow *window, const QPointF &local, const QPointF &global,
+ Qt::MouseButtons state, Qt::MouseButton button,
+ QEvent::Type type, Qt::KeyboardModifiers mods, int timestamp);
namespace QTest
{
@@ -120,23 +122,28 @@ namespace QTest
switch (action)
{
case MouseDClick:
- qt_handleMouseEvent(w, pos, global, button, stateKey, ++lastMouseTimestamp);
- qt_handleMouseEvent(w, pos, global, Qt::NoButton, stateKey, ++lastMouseTimestamp);
+ qt_handleMouseEvent(w, pos, global, button, button, QEvent::MouseButtonPress,
+ stateKey, ++lastMouseTimestamp);
+ qt_handleMouseEvent(w, pos, global, Qt::NoButton, button, QEvent::MouseButtonRelease,
+ stateKey, ++lastMouseTimestamp);
Q_FALLTHROUGH();
case MousePress:
case MouseClick:
- qt_handleMouseEvent(w, pos, global, button, stateKey, ++lastMouseTimestamp);
+ qt_handleMouseEvent(w, pos, global, button, button, QEvent::MouseButtonPress,
+ stateKey, ++lastMouseTimestamp);
lastMouseButton = button;
if (action == MousePress)
break;
Q_FALLTHROUGH();
case MouseRelease:
- qt_handleMouseEvent(w, pos, global, Qt::NoButton, stateKey, ++lastMouseTimestamp);
+ qt_handleMouseEvent(w, pos, global, Qt::NoButton, button, QEvent::MouseButtonRelease,
+ stateKey, ++lastMouseTimestamp);
lastMouseTimestamp += mouseDoubleClickInterval; // avoid double clicks being generated
lastMouseButton = Qt::NoButton;
break;
case MouseMove:
- qt_handleMouseEvent(w, pos, global, lastMouseButton, stateKey, ++lastMouseTimestamp);
+ qt_handleMouseEvent(w, pos, global, lastMouseButton, Qt::NoButton, QEvent::MouseMove,
+ stateKey, ++lastMouseTimestamp);
// No QCursor::setPos() call here. That could potentially result in mouse events sent by the windowing system
// which is highly undesired here. Tests must avoid relying on QCursor.
break;
diff --git a/src/testlib/qtesttable.cpp b/src/testlib/qtesttable.cpp
index 1afe2f7af5..953495a18a 100644
--- a/src/testlib/qtesttable.cpp
+++ b/src/testlib/qtesttable.cpp
@@ -58,7 +58,7 @@ public:
}
struct Element {
- Element() : name(Q_NULLPTR), type(0) {}
+ Element() : name(nullptr), type(0) {}
Element(const char *n, int t) : name(n), type(t) {}
const char *name;
@@ -130,12 +130,12 @@ int QTestTable::elementTypeId(int index) const
const char *QTestTable::dataTag(int index) const
{
- return size_t(index) < d->elementList.size() ? d->elementList[index].name : Q_NULLPTR;
+ return size_t(index) < d->elementList.size() ? d->elementList[index].name : nullptr;
}
QTestData *QTestTable::testData(int index) const
{
- return size_t(index) < d->dataList.size() ? d->dataList[index] : Q_NULLPTR;
+ return size_t(index) < d->dataList.size() ? d->dataList[index] : nullptr;
}
class NamePredicate : public std::unary_function<QTestTablePrivate::Element, bool>
diff --git a/src/testlib/qtesttouch.h b/src/testlib/qtesttouch.h
index bda185bfee..bdb6d5b629 100644
--- a/src/testlib/qtesttouch.h
+++ b/src/testlib/qtesttouch.h
@@ -75,21 +75,21 @@ namespace QTest
if (commitWhenDestroyed)
commit();
}
- QTouchEventSequence& press(int touchId, const QPoint &pt, QWindow *window = Q_NULLPTR)
+ QTouchEventSequence& press(int touchId, const QPoint &pt, QWindow *window = nullptr)
{
QTouchEvent::TouchPoint &p = point(touchId);
p.setScreenPos(mapToScreen(window, pt));
p.setState(Qt::TouchPointPressed);
return *this;
}
- QTouchEventSequence& move(int touchId, const QPoint &pt, QWindow *window = Q_NULLPTR)
+ QTouchEventSequence& move(int touchId, const QPoint &pt, QWindow *window = nullptr)
{
QTouchEvent::TouchPoint &p = point(touchId);
p.setScreenPos(mapToScreen(window, pt));
p.setState(Qt::TouchPointMoved);
return *this;
}
- QTouchEventSequence& release(int touchId, const QPoint &pt, QWindow *window = Q_NULLPTR)
+ QTouchEventSequence& release(int touchId, const QPoint &pt, QWindow *window = nullptr)
{
QTouchEvent::TouchPoint &p = point(touchId);
p.setScreenPos(mapToScreen(window, pt));
@@ -104,21 +104,21 @@ namespace QTest
}
#ifdef QT_WIDGETS_LIB
- QTouchEventSequence& press(int touchId, const QPoint &pt, QWidget *widget = Q_NULLPTR)
+ QTouchEventSequence& press(int touchId, const QPoint &pt, QWidget *widget = nullptr)
{
QTouchEvent::TouchPoint &p = point(touchId);
p.setScreenPos(mapToScreen(widget, pt));
p.setState(Qt::TouchPointPressed);
return *this;
}
- QTouchEventSequence& move(int touchId, const QPoint &pt, QWidget *widget = Q_NULLPTR)
+ QTouchEventSequence& move(int touchId, const QPoint &pt, QWidget *widget = nullptr)
{
QTouchEvent::TouchPoint &p = point(touchId);
p.setScreenPos(mapToScreen(widget, pt));
p.setState(Qt::TouchPointMoved);
return *this;
}
- QTouchEventSequence& release(int touchId, const QPoint &pt, QWidget *widget = Q_NULLPTR)
+ QTouchEventSequence& release(int touchId, const QPoint &pt, QWidget *widget = nullptr)
{
QTouchEvent::TouchPoint &p = point(touchId);
p.setScreenPos(mapToScreen(widget, pt));
@@ -151,14 +151,14 @@ namespace QTest
private:
#ifdef QT_WIDGETS_LIB
QTouchEventSequence(QWidget *widget, QTouchDevice *aDevice, bool autoCommit)
- : targetWidget(widget), targetWindow(Q_NULLPTR), device(aDevice), commitWhenDestroyed(autoCommit)
+ : targetWidget(widget), targetWindow(nullptr), device(aDevice), commitWhenDestroyed(autoCommit)
{
}
#endif
QTouchEventSequence(QWindow *window, QTouchDevice *aDevice, bool autoCommit)
:
#ifdef QT_WIDGETS_LIB
- targetWidget(Q_NULLPTR),
+ targetWidget(nullptr),
#endif
targetWindow(window), device(aDevice), commitWhenDestroyed(autoCommit)
{
diff --git a/src/testlib/qxctestlogger_p.h b/src/testlib/qxctestlogger_p.h
index 2bbd5ad296..1b641f18af 100644
--- a/src/testlib/qxctestlogger_p.h
+++ b/src/testlib/qxctestlogger_p.h
@@ -65,21 +65,21 @@ class QXcodeTestLogger : public QAbstractTestLogger
{
public:
QXcodeTestLogger();
- ~QXcodeTestLogger() Q_DECL_OVERRIDE;
+ ~QXcodeTestLogger() override;
- void startLogging() Q_DECL_OVERRIDE;
- void stopLogging() Q_DECL_OVERRIDE;
+ void startLogging() override;
+ void stopLogging() override;
- void enterTestFunction(const char *function) Q_DECL_OVERRIDE;
- void leaveTestFunction() Q_DECL_OVERRIDE;
+ void enterTestFunction(const char *function) override;
+ void leaveTestFunction() override;
void addIncident(IncidentTypes type, const char *description,
- const char *file = 0, int line = 0) Q_DECL_OVERRIDE;
+ const char *file = 0, int line = 0) override;
void addMessage(MessageTypes type, const QString &message,
- const char *file = 0, int line = 0) Q_DECL_OVERRIDE;
+ const char *file = 0, int line = 0) override;
- void addBenchmarkResult(const QBenchmarkResult &result) Q_DECL_OVERRIDE;
+ void addBenchmarkResult(const QBenchmarkResult &result) override;
static bool canLogTestProgress();
static int parseCommandLineArgument(const char *argument);
diff --git a/src/tools/bootstrap/bootstrap.pro b/src/tools/bootstrap/bootstrap.pro
index 042ad7adb9..03d5e44405 100644
--- a/src/tools/bootstrap/bootstrap.pro
+++ b/src/tools/bootstrap/bootstrap.pro
@@ -45,6 +45,7 @@ SOURCES += \
../../corelib/io/qiodevice.cpp \
../../corelib/io/qfiledevice.cpp \
../../corelib/io/qresource.cpp \
+ ../../corelib/io/qtemporarydir.cpp \
../../corelib/io/qtemporaryfile.cpp \
../../corelib/io/qtextstream.cpp \
../../corelib/io/qsavefile.cpp \
diff --git a/src/tools/moc/generator.cpp b/src/tools/moc/generator.cpp
index 139f7328af..587a91139d 100644
--- a/src/tools/moc/generator.cpp
+++ b/src/tools/moc/generator.cpp
@@ -1269,7 +1269,7 @@ void Generator::generateStaticMetacall()
continue;
anythingUsed = true;
fprintf(out, " {\n");
- fprintf(out, " typedef %s (%s::*_t)(",f.type.rawName.constData() , cdef->classname.constData());
+ fprintf(out, " using _t = %s (%s::*)(",f.type.rawName.constData() , cdef->classname.constData());
int argsCount = f.arguments.count();
for (int j = 0; j < argsCount; ++j) {
diff --git a/src/tools/rcc/rcc.cpp b/src/tools/rcc/rcc.cpp
index 84fe6ef5c7..92d3c5c171 100644
--- a/src/tools/rcc/rcc.cpp
+++ b/src/tools/rcc/rcc.cpp
@@ -207,7 +207,11 @@ void RCCFileInfo::writeDataInfo(RCCResourceLibrary &lib)
if (lib.formatVersion() >= 2) {
// last modified time stamp
const QDateTime lastModified = m_fileInfo.lastModified();
- lib.writeNumber8(quint64(lastModified.isValid() ? lastModified.toMSecsSinceEpoch() : 0));
+ quint64 lastmod = quint64(lastModified.isValid() ? lastModified.toMSecsSinceEpoch() : 0);
+ static const quint64 sourceDate = 1000 * qgetenv("QT_RCC_SOURCE_DATE_OVERRIDE").toULongLong();
+ if (sourceDate != 0)
+ lastmod = sourceDate;
+ lib.writeNumber8(lastmod);
if (text || pass1)
lib.writeChar('\n');
}
diff --git a/src/tools/uic/cpp/cppwritedeclaration.h b/src/tools/uic/cpp/cppwritedeclaration.h
index ca2122293c..f83bfe8f50 100644
--- a/src/tools/uic/cpp/cppwritedeclaration.h
+++ b/src/tools/uic/cpp/cppwritedeclaration.h
@@ -45,13 +45,13 @@ struct WriteDeclaration : public TreeWalker
{
WriteDeclaration(Uic *uic);
- void acceptUI(DomUI *node) Q_DECL_OVERRIDE;
- void acceptWidget(DomWidget *node) Q_DECL_OVERRIDE;
- void acceptSpacer(DomSpacer *node) Q_DECL_OVERRIDE;
- void acceptLayout(DomLayout *node) Q_DECL_OVERRIDE;
- void acceptActionGroup(DomActionGroup *node) Q_DECL_OVERRIDE;
- void acceptAction(DomAction *node) Q_DECL_OVERRIDE;
- void acceptButtonGroup(const DomButtonGroup *buttonGroup) Q_DECL_OVERRIDE;
+ void acceptUI(DomUI *node) override;
+ void acceptWidget(DomWidget *node) override;
+ void acceptSpacer(DomSpacer *node) override;
+ void acceptLayout(DomLayout *node) override;
+ void acceptActionGroup(DomActionGroup *node) override;
+ void acceptAction(DomAction *node) override;
+ void acceptButtonGroup(const DomButtonGroup *buttonGroup) override;
private:
Uic *m_uic;
diff --git a/src/tools/uic/cpp/cppwriteincludes.h b/src/tools/uic/cpp/cppwriteincludes.h
index 0d9c293efc..f91e1cf8ff 100644
--- a/src/tools/uic/cpp/cppwriteincludes.h
+++ b/src/tools/uic/cpp/cppwriteincludes.h
@@ -49,23 +49,23 @@ struct WriteIncludes : public TreeWalker
{
WriteIncludes(Uic *uic);
- void acceptUI(DomUI *node) Q_DECL_OVERRIDE;
- void acceptWidget(DomWidget *node) Q_DECL_OVERRIDE;
- void acceptLayout(DomLayout *node) Q_DECL_OVERRIDE;
- void acceptSpacer(DomSpacer *node) Q_DECL_OVERRIDE;
- void acceptProperty(DomProperty *node) Q_DECL_OVERRIDE;
+ void acceptUI(DomUI *node) override;
+ void acceptWidget(DomWidget *node) override;
+ void acceptLayout(DomLayout *node) override;
+ void acceptSpacer(DomSpacer *node) override;
+ void acceptProperty(DomProperty *node) override;
//
// custom widgets
//
- void acceptCustomWidgets(DomCustomWidgets *node) Q_DECL_OVERRIDE;
- void acceptCustomWidget(DomCustomWidget *node) Q_DECL_OVERRIDE;
+ void acceptCustomWidgets(DomCustomWidgets *node) override;
+ void acceptCustomWidget(DomCustomWidget *node) override;
//
// include hints
//
- void acceptIncludes(DomIncludes *node) Q_DECL_OVERRIDE;
- void acceptInclude(DomInclude *node) Q_DECL_OVERRIDE;
+ void acceptIncludes(DomIncludes *node) override;
+ void acceptInclude(DomInclude *node) override;
private:
void add(const QString &className, bool determineHeader = true, const QString &header = QString(), bool global = false);
diff --git a/src/tools/uic/cpp/cppwriteinitialization.h b/src/tools/uic/cpp/cppwriteinitialization.h
index b26f51875d..64cbde13f7 100644
--- a/src/tools/uic/cpp/cppwriteinitialization.h
+++ b/src/tools/uic/cpp/cppwriteinitialization.h
@@ -93,41 +93,41 @@ struct WriteInitialization : public TreeWalker
//
// widgets
//
- void acceptUI(DomUI *node) Q_DECL_OVERRIDE;
- void acceptWidget(DomWidget *node) Q_DECL_OVERRIDE;
+ void acceptUI(DomUI *node) override;
+ void acceptWidget(DomWidget *node) override;
- void acceptLayout(DomLayout *node) Q_DECL_OVERRIDE;
- void acceptSpacer(DomSpacer *node) Q_DECL_OVERRIDE;
- void acceptLayoutItem(DomLayoutItem *node) Q_DECL_OVERRIDE;
+ void acceptLayout(DomLayout *node) override;
+ void acceptSpacer(DomSpacer *node) override;
+ void acceptLayoutItem(DomLayoutItem *node) override;
//
// 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;
//
// tab stops
//
- void acceptTabStops(DomTabStops *tabStops) Q_DECL_OVERRIDE;
+ void acceptTabStops(DomTabStops *tabStops) override;
//
// custom widgets
//
- void acceptCustomWidgets(DomCustomWidgets *node) Q_DECL_OVERRIDE;
- void acceptCustomWidget(DomCustomWidget *node) Q_DECL_OVERRIDE;
+ void acceptCustomWidgets(DomCustomWidgets *node) override;
+ void acceptCustomWidget(DomCustomWidget *node) override;
//
// layout defaults/functions
//
- void acceptLayoutDefault(DomLayoutDefault *node) Q_DECL_OVERRIDE { m_LayoutDefaultHandler.acceptLayoutDefault(node); }
- void acceptLayoutFunction(DomLayoutFunction *node) Q_DECL_OVERRIDE { m_LayoutDefaultHandler.acceptLayoutFunction(node); }
+ void acceptLayoutDefault(DomLayoutDefault *node) override { m_LayoutDefaultHandler.acceptLayoutDefault(node); }
+ void acceptLayoutFunction(DomLayoutFunction *node) override { m_LayoutDefaultHandler.acceptLayoutFunction(node); }
//
// signal/slot connections
//
- void acceptConnection(DomConnection *connection) Q_DECL_OVERRIDE;
+ void acceptConnection(DomConnection *connection) override;
enum {
Use43UiFile = 0,
diff --git a/src/tools/uic/customwidgetsinfo.h b/src/tools/uic/customwidgetsinfo.h
index 3ce27d546c..944ed59215 100644
--- a/src/tools/uic/customwidgetsinfo.h
+++ b/src/tools/uic/customwidgetsinfo.h
@@ -43,10 +43,10 @@ class CustomWidgetsInfo : public TreeWalker
public:
CustomWidgetsInfo();
- void acceptUI(DomUI *node) Q_DECL_OVERRIDE;
+ void acceptUI(DomUI *node) override;
- void acceptCustomWidgets(DomCustomWidgets *node) Q_DECL_OVERRIDE;
- void acceptCustomWidget(DomCustomWidget *node) Q_DECL_OVERRIDE;
+ void acceptCustomWidgets(DomCustomWidgets *node) override;
+ void acceptCustomWidget(DomCustomWidget *node) override;
inline QStringList customWidgets() const
{ return m_customWidgets.keys(); }
diff --git a/src/tools/uic/databaseinfo.h b/src/tools/uic/databaseinfo.h
index c313681278..bebf139c5a 100644
--- a/src/tools/uic/databaseinfo.h
+++ b/src/tools/uic/databaseinfo.h
@@ -42,8 +42,8 @@ class DatabaseInfo : public TreeWalker
public:
DatabaseInfo();
- void acceptUI(DomUI *node) Q_DECL_OVERRIDE;
- void acceptWidget(DomWidget *node) Q_DECL_OVERRIDE;
+ void acceptUI(DomUI *node) override;
+ void acceptWidget(DomWidget *node) override;
inline QStringList connections() const
{ return m_connections; }
diff --git a/src/tools/uic/validator.h b/src/tools/uic/validator.h
index e0a99b47ef..f7f7401991 100644
--- a/src/tools/uic/validator.h
+++ b/src/tools/uic/validator.h
@@ -43,14 +43,14 @@ struct Validator : public TreeWalker
{
Validator(Uic *uic);
- void acceptUI(DomUI *node) Q_DECL_OVERRIDE;
- void acceptWidget(DomWidget *node) Q_DECL_OVERRIDE;
+ void acceptUI(DomUI *node) override;
+ void acceptWidget(DomWidget *node) override;
- void acceptLayoutItem(DomLayoutItem *node) Q_DECL_OVERRIDE;
- void acceptLayout(DomLayout *node) Q_DECL_OVERRIDE;
+ void acceptLayoutItem(DomLayoutItem *node) override;
+ void acceptLayout(DomLayout *node) override;
- void acceptActionGroup(DomActionGroup *node) Q_DECL_OVERRIDE;
- void acceptAction(DomAction *node) Q_DECL_OVERRIDE;
+ void acceptActionGroup(DomActionGroup *node) override;
+ void acceptAction(DomAction *node) override;
private:
Driver *m_driver;
diff --git a/src/widgets/accessible/complexwidgets.cpp b/src/widgets/accessible/complexwidgets.cpp
index 0f88554415..6cdc06d702 100644
--- a/src/widgets/accessible/complexwidgets.cpp
+++ b/src/widgets/accessible/complexwidgets.cpp
@@ -93,16 +93,16 @@ public:
: m_parent(parent), m_index(index)
{}
- void *interface_cast(QAccessible::InterfaceType t) Q_DECL_OVERRIDE {
+ void *interface_cast(QAccessible::InterfaceType t) override {
if (t == QAccessible::ActionInterface) {
return static_cast<QAccessibleActionInterface*>(this);
}
return 0;
}
- QObject *object() const Q_DECL_OVERRIDE { return 0; }
- QAccessible::Role role() const Q_DECL_OVERRIDE { return QAccessible::PageTab; }
- QAccessible::State state() const Q_DECL_OVERRIDE {
+ QObject *object() const override { return 0; }
+ QAccessible::Role role() const override { return QAccessible::PageTab; }
+ QAccessible::State state() const override {
if (!isValid()) {
QAccessible::State s;
s.invalid = true;
@@ -110,7 +110,7 @@ public:
}
return parent()->state();
}
- QRect rect() const Q_DECL_OVERRIDE {
+ QRect rect() const override {
if (!isValid())
return QRect();
@@ -120,13 +120,13 @@ public:
return rec;
}
- bool isValid() const Q_DECL_OVERRIDE { return m_parent.data() && m_parent->count() > m_index; }
+ bool isValid() const override { return m_parent.data() && m_parent->count() > m_index; }
- QAccessibleInterface *childAt(int, int) const Q_DECL_OVERRIDE { return 0; }
- int childCount() const Q_DECL_OVERRIDE { return 0; }
- int indexOfChild(const QAccessibleInterface *) const Q_DECL_OVERRIDE { return -1; }
+ QAccessibleInterface *childAt(int, int) const override { return 0; }
+ int childCount() const override { return 0; }
+ int indexOfChild(const QAccessibleInterface *) const override { return -1; }
- QString text(QAccessible::Text t) const Q_DECL_OVERRIDE
+ QString text(QAccessible::Text t) const override
{
if (!isValid())
return QString();
@@ -156,26 +156,26 @@ public:
return str;
}
- void setText(QAccessible::Text, const QString &) Q_DECL_OVERRIDE {}
+ void setText(QAccessible::Text, const QString &) override {}
- QAccessibleInterface *parent() const Q_DECL_OVERRIDE {
+ QAccessibleInterface *parent() const override {
return QAccessible::queryAccessibleInterface(m_parent.data());
}
- QAccessibleInterface *child(int) const Q_DECL_OVERRIDE { return 0; }
+ QAccessibleInterface *child(int) const override { return 0; }
// action interface
- QStringList actionNames() const Q_DECL_OVERRIDE
+ QStringList actionNames() const override
{
return QStringList(pressAction());
}
- void doAction(const QString &actionName) Q_DECL_OVERRIDE
+ void doAction(const QString &actionName) override
{
if (isValid() && actionName == pressAction())
m_parent->setCurrentIndex(m_index);
}
- QStringList keyBindingsForAction(const QString &) const Q_DECL_OVERRIDE
+ QStringList keyBindingsForAction(const QString &) const override
{
return QStringList();
}
diff --git a/src/widgets/accessible/complexwidgets_p.h b/src/widgets/accessible/complexwidgets_p.h
index 1887f98dca..96db2dab70 100644
--- a/src/widgets/accessible/complexwidgets_p.h
+++ b/src/widgets/accessible/complexwidgets_p.h
@@ -85,11 +85,11 @@ public:
Undefined
};
- QAccessibleInterface *child(int index) const Q_DECL_OVERRIDE;
- int childCount() const Q_DECL_OVERRIDE;
- int indexOfChild(const QAccessibleInterface *child) const Q_DECL_OVERRIDE;
- bool isValid() const Q_DECL_OVERRIDE;
- QAccessibleInterface *childAt(int x, int y) const Q_DECL_OVERRIDE;
+ QAccessibleInterface *child(int index) const override;
+ int childCount() const override;
+ int indexOfChild(const QAccessibleInterface *child) const override;
+ bool isValid() const override;
+ QAccessibleInterface *childAt(int x, int y) const override;
//protected:
QAbstractScrollArea *abstractScrollArea() const;
@@ -114,11 +114,11 @@ public:
explicit QAccessibleTabBar(QWidget *w);
~QAccessibleTabBar();
- int childCount() const Q_DECL_OVERRIDE;
- QString text(QAccessible::Text t) const Q_DECL_OVERRIDE;
+ int childCount() const override;
+ QString text(QAccessible::Text t) const override;
- QAccessibleInterface* child(int index) const Q_DECL_OVERRIDE;
- int indexOfChild(const QAccessibleInterface *child) const Q_DECL_OVERRIDE;
+ QAccessibleInterface* child(int index) const override;
+ int indexOfChild(const QAccessibleInterface *child) const override;
protected:
QTabBar *tabBar() const;
@@ -132,18 +132,18 @@ class QAccessibleComboBox : public QAccessibleWidget
public:
explicit QAccessibleComboBox(QWidget *w);
- int childCount() const Q_DECL_OVERRIDE;
- QAccessibleInterface *childAt(int x, int y) const Q_DECL_OVERRIDE;
- int indexOfChild(const QAccessibleInterface *child) const Q_DECL_OVERRIDE;
- QAccessibleInterface* child(int index) const Q_DECL_OVERRIDE;
+ int childCount() const override;
+ QAccessibleInterface *childAt(int x, int y) const override;
+ int indexOfChild(const QAccessibleInterface *child) const override;
+ QAccessibleInterface* child(int index) const override;
- QString text(QAccessible::Text t) const Q_DECL_OVERRIDE;
+ QString text(QAccessible::Text t) const override;
// QAccessibleActionInterface
- QStringList actionNames() const Q_DECL_OVERRIDE;
- QString localizedActionDescription(const QString &actionName) const Q_DECL_OVERRIDE;
- void doAction(const QString &actionName) Q_DECL_OVERRIDE;
- QStringList keyBindingsForAction(const QString &actionName) const Q_DECL_OVERRIDE;
+ QStringList actionNames() const override;
+ QString localizedActionDescription(const QString &actionName) const override;
+ void doAction(const QString &actionName) override;
+ QStringList keyBindingsForAction(const QString &actionName) const override;
protected:
QComboBox *comboBox() const;
diff --git a/src/widgets/accessible/itemviews_p.h b/src/widgets/accessible/itemviews_p.h
index 72841b8a0f..683ae9c948 100644
--- a/src/widgets/accessible/itemviews_p.h
+++ b/src/widgets/accessible/itemviews_p.h
@@ -71,48 +71,48 @@ class QAccessibleTable :public QAccessibleTableInterface, public QAccessibleObje
{
public:
explicit QAccessibleTable(QWidget *w);
- bool isValid() const Q_DECL_OVERRIDE;
+ bool isValid() const override;
- QAccessible::Role role() const Q_DECL_OVERRIDE;
- QAccessible::State state() const Q_DECL_OVERRIDE;
- QString text(QAccessible::Text t) const Q_DECL_OVERRIDE;
- QRect rect() const Q_DECL_OVERRIDE;
+ QAccessible::Role role() const override;
+ QAccessible::State state() const override;
+ QString text(QAccessible::Text t) const override;
+ QRect rect() const override;
- QAccessibleInterface *childAt(int x, int y) const Q_DECL_OVERRIDE;
- int childCount() const Q_DECL_OVERRIDE;
- int indexOfChild(const QAccessibleInterface *) const Q_DECL_OVERRIDE;
+ QAccessibleInterface *childAt(int x, int y) const override;
+ int childCount() const override;
+ int indexOfChild(const QAccessibleInterface *) const override;
- QAccessibleInterface *parent() const Q_DECL_OVERRIDE;
- QAccessibleInterface *child(int index) const Q_DECL_OVERRIDE;
+ QAccessibleInterface *parent() const override;
+ QAccessibleInterface *child(int index) const override;
- void *interface_cast(QAccessible::InterfaceType t) Q_DECL_OVERRIDE;
+ void *interface_cast(QAccessible::InterfaceType t) override;
// table interface
- virtual QAccessibleInterface *cellAt(int row, int column) const Q_DECL_OVERRIDE;
- virtual QAccessibleInterface *caption() const Q_DECL_OVERRIDE;
- virtual QAccessibleInterface *summary() const Q_DECL_OVERRIDE;
- virtual QString columnDescription(int column) const Q_DECL_OVERRIDE;
- virtual QString rowDescription(int row) const Q_DECL_OVERRIDE;
- virtual int columnCount() const Q_DECL_OVERRIDE;
- virtual int rowCount() const Q_DECL_OVERRIDE;
+ virtual QAccessibleInterface *cellAt(int row, int column) const override;
+ virtual QAccessibleInterface *caption() const override;
+ virtual QAccessibleInterface *summary() const override;
+ virtual QString columnDescription(int column) const override;
+ virtual QString rowDescription(int row) const override;
+ virtual int columnCount() const override;
+ virtual int rowCount() const override;
// selection
- virtual int selectedCellCount() const Q_DECL_OVERRIDE;
- virtual int selectedColumnCount() const Q_DECL_OVERRIDE;
- virtual int selectedRowCount() const Q_DECL_OVERRIDE;
- virtual QList<QAccessibleInterface*> selectedCells() const Q_DECL_OVERRIDE;
- virtual QList<int> selectedColumns() const Q_DECL_OVERRIDE;
- virtual QList<int> selectedRows() const Q_DECL_OVERRIDE;
- virtual bool isColumnSelected(int column) const Q_DECL_OVERRIDE;
- virtual bool isRowSelected(int row) const Q_DECL_OVERRIDE;
- virtual bool selectRow(int row) Q_DECL_OVERRIDE;
- virtual bool selectColumn(int column) Q_DECL_OVERRIDE;
- virtual bool unselectRow(int row) Q_DECL_OVERRIDE;
- virtual bool unselectColumn(int column) Q_DECL_OVERRIDE;
+ virtual int selectedCellCount() const override;
+ virtual int selectedColumnCount() const override;
+ virtual int selectedRowCount() const override;
+ virtual QList<QAccessibleInterface*> selectedCells() const override;
+ virtual QList<int> selectedColumns() const override;
+ virtual QList<int> selectedRows() const override;
+ virtual bool isColumnSelected(int column) const override;
+ virtual bool isRowSelected(int row) const override;
+ virtual bool selectRow(int row) override;
+ virtual bool selectColumn(int column) override;
+ virtual bool unselectRow(int row) override;
+ virtual bool unselectColumn(int column) override;
QAbstractItemView *view() const;
- void modelChange(QAccessibleTableModelChangeEvent *event) Q_DECL_OVERRIDE;
+ void modelChange(QAccessibleTableModelChangeEvent *event) override;
protected:
inline QAccessible::Role cellRole() const {
@@ -153,19 +153,19 @@ public:
{}
- QAccessibleInterface *childAt(int x, int y) const Q_DECL_OVERRIDE;
- int childCount() const Q_DECL_OVERRIDE;
- QAccessibleInterface *child(int index) const Q_DECL_OVERRIDE;
+ QAccessibleInterface *childAt(int x, int y) const override;
+ int childCount() const override;
+ QAccessibleInterface *child(int index) const override;
- int indexOfChild(const QAccessibleInterface *) const Q_DECL_OVERRIDE;
+ int indexOfChild(const QAccessibleInterface *) const override;
- int rowCount() const Q_DECL_OVERRIDE;
+ int rowCount() const override;
// table interface
- QAccessibleInterface *cellAt(int row, int column) const Q_DECL_OVERRIDE;
- QString rowDescription(int row) const Q_DECL_OVERRIDE;
- bool isRowSelected(int row) const Q_DECL_OVERRIDE;
- bool selectRow(int row) Q_DECL_OVERRIDE;
+ QAccessibleInterface *cellAt(int row, int column) const override;
+ QString rowDescription(int row) const override;
+ bool isRowSelected(int row) const override;
+ bool selectRow(int row) override;
private:
QModelIndex indexFromLogical(int row, int column = 0) const;
@@ -179,37 +179,37 @@ class QAccessibleTableCell: public QAccessibleInterface, public QAccessibleTable
public:
QAccessibleTableCell(QAbstractItemView *view, const QModelIndex &m_index, QAccessible::Role role);
- void *interface_cast(QAccessible::InterfaceType t) Q_DECL_OVERRIDE;
- QObject *object() const Q_DECL_OVERRIDE { return Q_NULLPTR; }
- QAccessible::Role role() const Q_DECL_OVERRIDE;
- QAccessible::State state() const Q_DECL_OVERRIDE;
- QRect rect() const Q_DECL_OVERRIDE;
- bool isValid() const Q_DECL_OVERRIDE;
+ void *interface_cast(QAccessible::InterfaceType t) override;
+ QObject *object() const override { return nullptr; }
+ QAccessible::Role role() const override;
+ QAccessible::State state() const override;
+ QRect rect() const override;
+ bool isValid() const override;
- QAccessibleInterface *childAt(int, int) const Q_DECL_OVERRIDE { return Q_NULLPTR; }
- int childCount() const Q_DECL_OVERRIDE { return 0; }
- int indexOfChild(const QAccessibleInterface *) const Q_DECL_OVERRIDE { return -1; }
+ QAccessibleInterface *childAt(int, int) const override { return nullptr; }
+ int childCount() const override { return 0; }
+ int indexOfChild(const QAccessibleInterface *) const override { return -1; }
- QString text(QAccessible::Text t) const Q_DECL_OVERRIDE;
- void setText(QAccessible::Text t, const QString &text) Q_DECL_OVERRIDE;
+ QString text(QAccessible::Text t) const override;
+ void setText(QAccessible::Text t, const QString &text) override;
- QAccessibleInterface *parent() const Q_DECL_OVERRIDE;
- QAccessibleInterface *child(int) const Q_DECL_OVERRIDE;
+ QAccessibleInterface *parent() const override;
+ QAccessibleInterface *child(int) const override;
// cell interface
- virtual int columnExtent() const Q_DECL_OVERRIDE;
- virtual QList<QAccessibleInterface*> columnHeaderCells() const Q_DECL_OVERRIDE;
- virtual int columnIndex() const Q_DECL_OVERRIDE;
- virtual int rowExtent() const Q_DECL_OVERRIDE;
- virtual QList<QAccessibleInterface*> rowHeaderCells() const Q_DECL_OVERRIDE;
- virtual int rowIndex() const Q_DECL_OVERRIDE;
- virtual bool isSelected() const Q_DECL_OVERRIDE;
- virtual QAccessibleInterface* table() const Q_DECL_OVERRIDE;
+ virtual int columnExtent() const override;
+ virtual QList<QAccessibleInterface*> columnHeaderCells() const override;
+ virtual int columnIndex() const override;
+ virtual int rowExtent() const override;
+ virtual QList<QAccessibleInterface*> rowHeaderCells() const override;
+ virtual int rowIndex() const override;
+ virtual bool isSelected() const override;
+ virtual QAccessibleInterface* table() const override;
//action interface
- virtual QStringList actionNames() const Q_DECL_OVERRIDE;
- virtual void doAction(const QString &actionName) Q_DECL_OVERRIDE;
- virtual QStringList keyBindingsForAction(const QString &actionName) const Q_DECL_OVERRIDE;
+ virtual QStringList actionNames() const override;
+ virtual void doAction(const QString &actionName) override;
+ virtual QStringList keyBindingsForAction(const QString &actionName) const override;
private:
QHeaderView *verticalHeader() const;
@@ -234,21 +234,21 @@ public:
// For header cells, pass the header view in addition
QAccessibleTableHeaderCell(QAbstractItemView *view, int index, Qt::Orientation orientation);
- QObject *object() const Q_DECL_OVERRIDE { return Q_NULLPTR; }
- QAccessible::Role role() const Q_DECL_OVERRIDE;
- QAccessible::State state() const Q_DECL_OVERRIDE;
- QRect rect() const Q_DECL_OVERRIDE;
- bool isValid() const Q_DECL_OVERRIDE;
+ QObject *object() const override { return nullptr; }
+ QAccessible::Role role() const override;
+ QAccessible::State state() const override;
+ QRect rect() const override;
+ bool isValid() const override;
- QAccessibleInterface *childAt(int, int) const Q_DECL_OVERRIDE { return Q_NULLPTR; }
- int childCount() const Q_DECL_OVERRIDE { return 0; }
- int indexOfChild(const QAccessibleInterface *) const Q_DECL_OVERRIDE { return -1; }
+ QAccessibleInterface *childAt(int, int) const override { return nullptr; }
+ int childCount() const override { return 0; }
+ int indexOfChild(const QAccessibleInterface *) const override { return -1; }
- QString text(QAccessible::Text t) const Q_DECL_OVERRIDE;
- void setText(QAccessible::Text t, const QString &text) Q_DECL_OVERRIDE;
+ QString text(QAccessible::Text t) const override;
+ void setText(QAccessible::Text t, const QString &text) override;
- QAccessibleInterface *parent() const Q_DECL_OVERRIDE;
- QAccessibleInterface *child(int index) const Q_DECL_OVERRIDE;
+ QAccessibleInterface *parent() const override;
+ QAccessibleInterface *child(int index) const override;
private:
QHeaderView *headerView() const;
@@ -273,24 +273,24 @@ public:
:view(view_)
{}
- QObject *object() const Q_DECL_OVERRIDE { return Q_NULLPTR; }
- QAccessible::Role role() const Q_DECL_OVERRIDE { return QAccessible::Pane; }
- QAccessible::State state() const Q_DECL_OVERRIDE { return QAccessible::State(); }
- QRect rect() const Q_DECL_OVERRIDE { return QRect(); }
- bool isValid() const Q_DECL_OVERRIDE { return true; }
+ QObject *object() const override { return nullptr; }
+ QAccessible::Role role() const override { return QAccessible::Pane; }
+ QAccessible::State state() const override { return QAccessible::State(); }
+ QRect rect() const override { return QRect(); }
+ bool isValid() const override { return true; }
- QAccessibleInterface *childAt(int, int) const Q_DECL_OVERRIDE { return Q_NULLPTR; }
- int childCount() const Q_DECL_OVERRIDE { return 0; }
- int indexOfChild(const QAccessibleInterface *) const Q_DECL_OVERRIDE { return -1; }
+ QAccessibleInterface *childAt(int, int) const override { return nullptr; }
+ int childCount() const override { return 0; }
+ int indexOfChild(const QAccessibleInterface *) const override { return -1; }
- QString text(QAccessible::Text) const Q_DECL_OVERRIDE { return QString(); }
- void setText(QAccessible::Text, const QString &) Q_DECL_OVERRIDE {}
+ QString text(QAccessible::Text) const override { return QString(); }
+ void setText(QAccessible::Text, const QString &) override {}
- QAccessibleInterface *parent() const Q_DECL_OVERRIDE {
+ QAccessibleInterface *parent() const override {
return QAccessible::queryAccessibleInterface(view);
}
- QAccessibleInterface *child(int) const Q_DECL_OVERRIDE {
- return Q_NULLPTR;
+ QAccessibleInterface *child(int) const override {
+ return nullptr;
}
private:
diff --git a/src/widgets/accessible/qaccessiblemenu.cpp b/src/widgets/accessible/qaccessiblemenu.cpp
index d20c5bfc71..8b3353f625 100644
--- a/src/widgets/accessible/qaccessiblemenu.cpp
+++ b/src/widgets/accessible/qaccessiblemenu.cpp
@@ -242,7 +242,7 @@ QObject *QAccessibleMenuItem::object() const
/*! \reimp */
QWindow *QAccessibleMenuItem::window() const
{
- QWindow *result = Q_NULLPTR;
+ QWindow *result = nullptr;
if (!m_owner.isNull()) {
result = m_owner->windowHandle();
if (!result) {
diff --git a/src/widgets/accessible/qaccessiblemenu_p.h b/src/widgets/accessible/qaccessiblemenu_p.h
index 8b37e23333..9acd2a42f9 100644
--- a/src/widgets/accessible/qaccessiblemenu_p.h
+++ b/src/widgets/accessible/qaccessiblemenu_p.h
@@ -69,14 +69,14 @@ class QAccessibleMenu : public QAccessibleWidget
public:
explicit QAccessibleMenu(QWidget *w);
- int childCount() const Q_DECL_OVERRIDE;
- QAccessibleInterface *childAt(int x, int y) const Q_DECL_OVERRIDE;
+ int childCount() const override;
+ QAccessibleInterface *childAt(int x, int y) const override;
- QString text(QAccessible::Text t) const Q_DECL_OVERRIDE;
- QAccessible::Role role() const Q_DECL_OVERRIDE;
- QAccessibleInterface *child(int index) const Q_DECL_OVERRIDE;
- QAccessibleInterface *parent() const Q_DECL_OVERRIDE;
- int indexOfChild( const QAccessibleInterface *child ) const Q_DECL_OVERRIDE;
+ QString text(QAccessible::Text t) const override;
+ QAccessible::Role role() const override;
+ QAccessibleInterface *child(int index) const override;
+ QAccessibleInterface *parent() const override;
+ int indexOfChild( const QAccessibleInterface *child ) const override;
protected:
QMenu *menu() const;
@@ -88,10 +88,10 @@ class QAccessibleMenuBar : public QAccessibleWidget
public:
explicit QAccessibleMenuBar(QWidget *w);
- QAccessibleInterface *child(int index) const Q_DECL_OVERRIDE;
- int childCount() const Q_DECL_OVERRIDE;
+ QAccessibleInterface *child(int index) const override;
+ int childCount() const override;
- int indexOfChild(const QAccessibleInterface *child) const Q_DECL_OVERRIDE;
+ int indexOfChild(const QAccessibleInterface *child) const override;
protected:
QMenuBar *menuBar() const;
@@ -105,28 +105,28 @@ public:
explicit QAccessibleMenuItem(QWidget *owner, QAction *w);
~QAccessibleMenuItem();
- void *interface_cast(QAccessible::InterfaceType t) Q_DECL_OVERRIDE;
+ void *interface_cast(QAccessible::InterfaceType t) override;
- int childCount() const Q_DECL_OVERRIDE;
- QAccessibleInterface *childAt(int x, int y) const Q_DECL_OVERRIDE;
- bool isValid() const Q_DECL_OVERRIDE;
- int indexOfChild(const QAccessibleInterface * child) const Q_DECL_OVERRIDE;
+ int childCount() const override;
+ QAccessibleInterface *childAt(int x, int y) const override;
+ bool isValid() const override;
+ int indexOfChild(const QAccessibleInterface * child) const override;
- QAccessibleInterface *parent() const Q_DECL_OVERRIDE;
- QAccessibleInterface *child(int index) const Q_DECL_OVERRIDE;
- QObject * object() const Q_DECL_OVERRIDE;
- QWindow *window() const Q_DECL_OVERRIDE;
+ QAccessibleInterface *parent() const override;
+ QAccessibleInterface *child(int index) const override;
+ QObject * object() const override;
+ QWindow *window() const override;
- QRect rect() const Q_DECL_OVERRIDE;
- QAccessible::Role role() const Q_DECL_OVERRIDE;
- void setText(QAccessible::Text t, const QString & text) Q_DECL_OVERRIDE;
- QAccessible::State state() const Q_DECL_OVERRIDE;
- QString text(QAccessible::Text t) const Q_DECL_OVERRIDE;
+ QRect rect() const override;
+ QAccessible::Role role() const override;
+ void setText(QAccessible::Text t, const QString & text) override;
+ QAccessible::State state() const override;
+ QString text(QAccessible::Text t) const override;
// QAccessibleActionInterface
- QStringList actionNames() const Q_DECL_OVERRIDE;
- void doAction(const QString &actionName) Q_DECL_OVERRIDE;
- QStringList keyBindingsForAction(const QString &actionName) const Q_DECL_OVERRIDE;
+ QStringList actionNames() const override;
+ void doAction(const QString &actionName) override;
+ QStringList keyBindingsForAction(const QString &actionName) const override;
QWidget *owner() const;
protected:
diff --git a/src/widgets/accessible/qaccessiblewidget.h b/src/widgets/accessible/qaccessiblewidget.h
index e09c3ff489..63789a595f 100644
--- a/src/widgets/accessible/qaccessiblewidget.h
+++ b/src/widgets/accessible/qaccessiblewidget.h
@@ -54,32 +54,32 @@ class Q_WIDGETS_EXPORT QAccessibleWidget : public QAccessibleObject, public QAcc
{
public:
explicit QAccessibleWidget(QWidget *o, QAccessible::Role r = QAccessible::Client, const QString& name = QString());
- bool isValid() const Q_DECL_OVERRIDE;
+ bool isValid() const override;
- QWindow *window() const Q_DECL_OVERRIDE;
- int childCount() const Q_DECL_OVERRIDE;
- int indexOfChild(const QAccessibleInterface *child) const Q_DECL_OVERRIDE;
- QVector<QPair<QAccessibleInterface*, QAccessible::Relation> > relations(QAccessible::Relation match = QAccessible::AllRelations) const Q_DECL_OVERRIDE;
- QAccessibleInterface *focusChild() const Q_DECL_OVERRIDE;
+ QWindow *window() const override;
+ int childCount() const override;
+ int indexOfChild(const QAccessibleInterface *child) const override;
+ QVector<QPair<QAccessibleInterface*, QAccessible::Relation> > relations(QAccessible::Relation match = QAccessible::AllRelations) const override;
+ QAccessibleInterface *focusChild() const override;
- QRect rect() const Q_DECL_OVERRIDE;
+ QRect rect() const override;
- QAccessibleInterface *parent() const Q_DECL_OVERRIDE;
- QAccessibleInterface *child(int index) const Q_DECL_OVERRIDE;
+ QAccessibleInterface *parent() const override;
+ QAccessibleInterface *child(int index) const override;
- QString text(QAccessible::Text t) const Q_DECL_OVERRIDE;
- QAccessible::Role role() const Q_DECL_OVERRIDE;
- QAccessible::State state() const Q_DECL_OVERRIDE;
+ QString text(QAccessible::Text t) const override;
+ QAccessible::Role role() const override;
+ QAccessible::State state() const override;
- QColor foregroundColor() const Q_DECL_OVERRIDE;
- QColor backgroundColor() const Q_DECL_OVERRIDE;
+ QColor foregroundColor() const override;
+ QColor backgroundColor() const override;
- void *interface_cast(QAccessible::InterfaceType t) Q_DECL_OVERRIDE;
+ void *interface_cast(QAccessible::InterfaceType t) override;
// QAccessibleActionInterface
- QStringList actionNames() const Q_DECL_OVERRIDE;
- void doAction(const QString &actionName) Q_DECL_OVERRIDE;
- QStringList keyBindingsForAction(const QString &actionName) const Q_DECL_OVERRIDE;
+ QStringList actionNames() const override;
+ void doAction(const QString &actionName) override;
+ QStringList keyBindingsForAction(const QString &actionName) const override;
protected:
~QAccessibleWidget();
QWidget *widget() const;
diff --git a/src/widgets/accessible/qaccessiblewidgets_p.h b/src/widgets/accessible/qaccessiblewidgets_p.h
index 75e1eff694..87f0b888a0 100644
--- a/src/widgets/accessible/qaccessiblewidgets_p.h
+++ b/src/widgets/accessible/qaccessiblewidgets_p.h
@@ -85,40 +85,40 @@ class QAccessibleTextWidget : public QAccessibleWidget,
public:
QAccessibleTextWidget(QWidget *o, QAccessible::Role r = QAccessible::EditableText, const QString &name = QString());
- QAccessible::State state() const Q_DECL_OVERRIDE;
+ QAccessible::State state() const override;
// QAccessibleTextInterface
// selection
- void selection(int selectionIndex, int *startOffset, int *endOffset) const Q_DECL_OVERRIDE;
- int selectionCount() const Q_DECL_OVERRIDE;
- void addSelection(int startOffset, int endOffset) Q_DECL_OVERRIDE;
- void removeSelection(int selectionIndex) Q_DECL_OVERRIDE;
- void setSelection(int selectionIndex, int startOffset, int endOffset) Q_DECL_OVERRIDE;
+ void selection(int selectionIndex, int *startOffset, int *endOffset) const override;
+ int selectionCount() const override;
+ void addSelection(int startOffset, int endOffset) override;
+ void removeSelection(int selectionIndex) override;
+ void setSelection(int selectionIndex, int startOffset, int endOffset) override;
// cursor
- int cursorPosition() const Q_DECL_OVERRIDE;
- void setCursorPosition(int position) Q_DECL_OVERRIDE;
+ int cursorPosition() const override;
+ void setCursorPosition(int position) override;
// text
- QString text(int startOffset, int endOffset) const Q_DECL_OVERRIDE;
+ QString text(int startOffset, int endOffset) const override;
QString textBeforeOffset(int offset, QAccessible::TextBoundaryType boundaryType,
- int *startOffset, int *endOffset) const Q_DECL_OVERRIDE;
+ int *startOffset, int *endOffset) const override;
QString textAfterOffset(int offset, QAccessible::TextBoundaryType boundaryType,
- int *startOffset, int *endOffset) const Q_DECL_OVERRIDE;
+ int *startOffset, int *endOffset) const override;
QString textAtOffset(int offset, QAccessible::TextBoundaryType boundaryType,
- int *startOffset, int *endOffset) const Q_DECL_OVERRIDE;
- int characterCount() const Q_DECL_OVERRIDE;
+ int *startOffset, int *endOffset) const override;
+ int characterCount() const override;
// character <-> geometry
- QRect characterRect(int offset) const Q_DECL_OVERRIDE;
- int offsetAtPoint(const QPoint &point) const Q_DECL_OVERRIDE;
+ QRect characterRect(int offset) const override;
+ int offsetAtPoint(const QPoint &point) const override;
- QString attributes(int offset, int *startOffset, int *endOffset) const Q_DECL_OVERRIDE;
+ QString attributes(int offset, int *startOffset, int *endOffset) const override;
// QAccessibleEditableTextInterface
- void deleteText(int startOffset, int endOffset) Q_DECL_OVERRIDE;
- void insertText(int offset, const QString &text) Q_DECL_OVERRIDE;
- void replaceText(int startOffset, int endOffset, const QString &text) Q_DECL_OVERRIDE;
+ void deleteText(int startOffset, int endOffset) override;
+ void insertText(int offset, const QString &text) override;
+ void replaceText(int startOffset, int endOffset, const QString &text) override;
using QAccessibleWidget::text;
@@ -138,25 +138,25 @@ class QAccessiblePlainTextEdit : public QAccessibleTextWidget
public:
explicit QAccessiblePlainTextEdit(QWidget *o);
- QString text(QAccessible::Text t) const Q_DECL_OVERRIDE;
- void setText(QAccessible::Text t, const QString &text) Q_DECL_OVERRIDE;
- QAccessible::State state() const Q_DECL_OVERRIDE;
+ QString text(QAccessible::Text t) const override;
+ void setText(QAccessible::Text t, const QString &text) override;
+ QAccessible::State state() const override;
- void *interface_cast(QAccessible::InterfaceType t) Q_DECL_OVERRIDE;
+ void *interface_cast(QAccessible::InterfaceType t) override;
// QAccessibleTextInterface
- void scrollToSubstring(int startIndex, int endIndex) Q_DECL_OVERRIDE;
+ void scrollToSubstring(int startIndex, int endIndex) override;
using QAccessibleTextWidget::text;
protected:
QPlainTextEdit *plainTextEdit() const;
- QPoint scrollBarPosition() const Q_DECL_OVERRIDE;
- QTextCursor textCursor() const Q_DECL_OVERRIDE;
- void setTextCursor(const QTextCursor &textCursor) Q_DECL_OVERRIDE;
- QTextDocument *textDocument() const Q_DECL_OVERRIDE;
- QWidget *viewport() const Q_DECL_OVERRIDE;
+ QPoint scrollBarPosition() const override;
+ QTextCursor textCursor() const override;
+ void setTextCursor(const QTextCursor &textCursor) override;
+ QTextDocument *textDocument() const override;
+ QWidget *viewport() const override;
};
class QAccessibleTextEdit : public QAccessibleTextWidget
@@ -164,25 +164,25 @@ class QAccessibleTextEdit : public QAccessibleTextWidget
public:
explicit QAccessibleTextEdit(QWidget *o);
- QString text(QAccessible::Text t) const Q_DECL_OVERRIDE;
- void setText(QAccessible::Text t, const QString &text) Q_DECL_OVERRIDE;
- QAccessible::State state() const Q_DECL_OVERRIDE;
+ QString text(QAccessible::Text t) const override;
+ void setText(QAccessible::Text t, const QString &text) override;
+ QAccessible::State state() const override;
- void *interface_cast(QAccessible::InterfaceType t) Q_DECL_OVERRIDE;
+ void *interface_cast(QAccessible::InterfaceType t) override;
// QAccessibleTextInterface
- void scrollToSubstring(int startIndex, int endIndex) Q_DECL_OVERRIDE;
+ void scrollToSubstring(int startIndex, int endIndex) override;
using QAccessibleTextWidget::text;
protected:
QTextEdit *textEdit() const;
- QPoint scrollBarPosition() const Q_DECL_OVERRIDE;
- QTextCursor textCursor() const Q_DECL_OVERRIDE;
- void setTextCursor(const QTextCursor &textCursor) Q_DECL_OVERRIDE;
- QTextDocument *textDocument() const Q_DECL_OVERRIDE;
- QWidget *viewport() const Q_DECL_OVERRIDE;
+ QPoint scrollBarPosition() const override;
+ QTextCursor textCursor() const override;
+ void setTextCursor(const QTextCursor &textCursor) override;
+ QTextDocument *textDocument() const override;
+ QWidget *viewport() const override;
};
#endif // QT_CONFIG(textedit)
#endif //QT_NO_CURSOR
@@ -192,10 +192,10 @@ class QAccessibleStackedWidget : public QAccessibleWidget
public:
explicit QAccessibleStackedWidget(QWidget *widget);
- QAccessibleInterface *childAt(int x, int y) const Q_DECL_OVERRIDE;
- int childCount() const Q_DECL_OVERRIDE;
- int indexOfChild(const QAccessibleInterface *child) const Q_DECL_OVERRIDE;
- QAccessibleInterface *child(int index) const Q_DECL_OVERRIDE;
+ QAccessibleInterface *childAt(int x, int y) const override;
+ int childCount() const override;
+ int indexOfChild(const QAccessibleInterface *child) const override;
+ QAccessibleInterface *child(int index) const override;
protected:
QStackedWidget *stackedWidget() const;
@@ -222,9 +222,9 @@ class QAccessibleMdiArea : public QAccessibleWidget
public:
explicit QAccessibleMdiArea(QWidget *widget);
- int childCount() const Q_DECL_OVERRIDE;
- QAccessibleInterface *child(int index) const Q_DECL_OVERRIDE;
- int indexOfChild(const QAccessibleInterface *child) const Q_DECL_OVERRIDE;
+ int childCount() const override;
+ QAccessibleInterface *child(int index) const override;
+ int indexOfChild(const QAccessibleInterface *child) const override;
protected:
QMdiArea *mdiArea() const;
@@ -235,13 +235,13 @@ class QAccessibleMdiSubWindow : public QAccessibleWidget
public:
explicit QAccessibleMdiSubWindow(QWidget *widget);
- QString text(QAccessible::Text textType) const Q_DECL_OVERRIDE;
- void setText(QAccessible::Text textType, const QString &text) Q_DECL_OVERRIDE;
- QAccessible::State state() const Q_DECL_OVERRIDE;
- int childCount() const Q_DECL_OVERRIDE;
- QAccessibleInterface *child(int index) const Q_DECL_OVERRIDE;
- int indexOfChild(const QAccessibleInterface *child) const Q_DECL_OVERRIDE;
- QRect rect() const Q_DECL_OVERRIDE;
+ QString text(QAccessible::Text textType) const override;
+ void setText(QAccessible::Text textType, const QString &text) override;
+ QAccessible::State state() const override;
+ int childCount() const override;
+ QAccessibleInterface *child(int index) const override;
+ int indexOfChild(const QAccessibleInterface *child) const override;
+ QRect rect() const override;
protected:
QMdiSubWindow *mdiSubWindow() const;
@@ -262,7 +262,7 @@ class QAccessibleTextBrowser : public QAccessibleTextEdit
public:
explicit QAccessibleTextBrowser(QWidget *widget);
- QAccessible::Role role() const Q_DECL_OVERRIDE;
+ QAccessible::Role role() const override;
};
#endif // QT_CONFIG(textbrowser) && QT_NO_CURSOR
@@ -272,10 +272,10 @@ class QAccessibleCalendarWidget : public QAccessibleWidget
public:
explicit QAccessibleCalendarWidget(QWidget *widget);
- int childCount() const Q_DECL_OVERRIDE;
- int indexOfChild(const QAccessibleInterface *child) const Q_DECL_OVERRIDE;
+ int childCount() const override;
+ int indexOfChild(const QAccessibleInterface *child) const override;
- QAccessibleInterface *child(int index) const Q_DECL_OVERRIDE;
+ QAccessibleInterface *child(int index) const override;
protected:
QCalendarWidget *calendarWidget() const;
@@ -291,11 +291,11 @@ class QAccessibleDockWidget: public QAccessibleWidget
{
public:
explicit QAccessibleDockWidget(QWidget *widget);
- QAccessibleInterface *child(int index) const Q_DECL_OVERRIDE;
- int indexOfChild(const QAccessibleInterface *child) const Q_DECL_OVERRIDE;
- int childCount() const Q_DECL_OVERRIDE;
- QRect rect () const Q_DECL_OVERRIDE;
- QString text(QAccessible::Text t) const Q_DECL_OVERRIDE;
+ QAccessibleInterface *child(int index) const override;
+ int indexOfChild(const QAccessibleInterface *child) const override;
+ int childCount() const override;
+ QRect rect () const override;
+ QString text(QAccessible::Text t) const override;
QDockWidget *dockWidget() const;
protected:
@@ -310,10 +310,10 @@ class QAccessibleMainWindow : public QAccessibleWidget
public:
explicit QAccessibleMainWindow(QWidget *widget);
- QAccessibleInterface *child(int index) const Q_DECL_OVERRIDE;
- int childCount() const Q_DECL_OVERRIDE;
- int indexOfChild(const QAccessibleInterface *iface) const Q_DECL_OVERRIDE;
- QAccessibleInterface *childAt(int x, int y) const Q_DECL_OVERRIDE;
+ QAccessibleInterface *child(int index) const override;
+ int childCount() const override;
+ int indexOfChild(const QAccessibleInterface *iface) const override;
+ QAccessibleInterface *childAt(int x, int y) const override;
QMainWindow *mainWindow() const;
};
diff --git a/src/widgets/accessible/rangecontrols.cpp b/src/widgets/accessible/rangecontrols.cpp
index 190f0aa02f..b5b8608418 100644
--- a/src/widgets/accessible/rangecontrols.cpp
+++ b/src/widgets/accessible/rangecontrols.cpp
@@ -69,7 +69,7 @@ QT_BEGIN_NAMESPACE
#if QT_CONFIG(spinbox)
QAccessibleAbstractSpinBox::QAccessibleAbstractSpinBox(QWidget *w)
-: QAccessibleWidget(w, QAccessible::SpinBox), lineEdit(Q_NULLPTR)
+: QAccessibleWidget(w, QAccessible::SpinBox), lineEdit(nullptr)
{
Q_ASSERT(abstractSpinBox());
}
diff --git a/src/widgets/accessible/rangecontrols_p.h b/src/widgets/accessible/rangecontrols_p.h
index 8af86681a0..1eada8e456 100644
--- a/src/widgets/accessible/rangecontrols_p.h
+++ b/src/widgets/accessible/rangecontrols_p.h
@@ -78,41 +78,41 @@ public:
explicit QAccessibleAbstractSpinBox(QWidget *w);
virtual ~QAccessibleAbstractSpinBox();
- QString text(QAccessible::Text t) const Q_DECL_OVERRIDE;
- void *interface_cast(QAccessible::InterfaceType t) Q_DECL_OVERRIDE;
+ QString text(QAccessible::Text t) const override;
+ void *interface_cast(QAccessible::InterfaceType t) override;
// QAccessibleValueInterface
- QVariant currentValue() const Q_DECL_OVERRIDE;
- void setCurrentValue(const QVariant &value) Q_DECL_OVERRIDE;
- QVariant maximumValue() const Q_DECL_OVERRIDE;
- QVariant minimumValue() const Q_DECL_OVERRIDE;
- QVariant minimumStepSize() const Q_DECL_OVERRIDE;
+ QVariant currentValue() const override;
+ void setCurrentValue(const QVariant &value) override;
+ QVariant maximumValue() const override;
+ QVariant minimumValue() const override;
+ QVariant minimumStepSize() const override;
// QAccessibleTextInterface
- void addSelection(int startOffset, int endOffset) Q_DECL_OVERRIDE;
- QString attributes(int offset, int *startOffset, int *endOffset) const Q_DECL_OVERRIDE;
- int cursorPosition() const Q_DECL_OVERRIDE;
- QRect characterRect(int offset) const Q_DECL_OVERRIDE;
- int selectionCount() const Q_DECL_OVERRIDE;
- int offsetAtPoint(const QPoint &point) const Q_DECL_OVERRIDE;
- void selection(int selectionIndex, int *startOffset, int *endOffset) const Q_DECL_OVERRIDE;
- QString text(int startOffset, int endOffset) const Q_DECL_OVERRIDE;
+ void addSelection(int startOffset, int endOffset) override;
+ QString attributes(int offset, int *startOffset, int *endOffset) const override;
+ int cursorPosition() const override;
+ QRect characterRect(int offset) const override;
+ int selectionCount() const override;
+ int offsetAtPoint(const QPoint &point) const override;
+ void selection(int selectionIndex, int *startOffset, int *endOffset) const override;
+ QString text(int startOffset, int endOffset) const override;
QString textBeforeOffset (int offset, QAccessible::TextBoundaryType boundaryType,
- int *endOffset, int *startOffset) const Q_DECL_OVERRIDE;
+ int *endOffset, int *startOffset) const override;
QString textAfterOffset(int offset, QAccessible::TextBoundaryType boundaryType,
- int *startOffset, int *endOffset) const Q_DECL_OVERRIDE;
+ int *startOffset, int *endOffset) const override;
QString textAtOffset(int offset, QAccessible::TextBoundaryType boundaryType,
- int *startOffset, int *endOffset) const Q_DECL_OVERRIDE;
- void removeSelection(int selectionIndex) Q_DECL_OVERRIDE;
- void setCursorPosition(int position) Q_DECL_OVERRIDE;
- void setSelection(int selectionIndex, int startOffset, int endOffset) Q_DECL_OVERRIDE;
- int characterCount() const Q_DECL_OVERRIDE;
- void scrollToSubstring(int startIndex, int endIndex) Q_DECL_OVERRIDE;
+ int *startOffset, int *endOffset) const override;
+ void removeSelection(int selectionIndex) override;
+ void setCursorPosition(int position) override;
+ void setSelection(int selectionIndex, int startOffset, int endOffset) override;
+ int characterCount() const override;
+ void scrollToSubstring(int startIndex, int endIndex) override;
// QAccessibleEditableTextInterface
- void deleteText(int startOffset, int endOffset) Q_DECL_OVERRIDE;
- void insertText(int offset, const QString &text) Q_DECL_OVERRIDE;
- void replaceText(int startOffset, int endOffset, const QString &text) Q_DECL_OVERRIDE;
+ void deleteText(int startOffset, int endOffset) override;
+ void insertText(int offset, const QString &text) override;
+ void replaceText(int startOffset, int endOffset, const QString &text) override;
protected:
QAbstractSpinBox *abstractSpinBox() const;
@@ -135,7 +135,7 @@ class QAccessibleDoubleSpinBox : public QAccessibleAbstractSpinBox
public:
explicit QAccessibleDoubleSpinBox(QWidget *widget);
- QString text(QAccessible::Text t) const Q_DECL_OVERRIDE;
+ QString text(QAccessible::Text t) const override;
using QAccessibleAbstractSpinBox::text;
protected:
@@ -148,14 +148,14 @@ class QAccessibleAbstractSlider: public QAccessibleWidget, public QAccessibleVal
{
public:
explicit QAccessibleAbstractSlider(QWidget *w, QAccessible::Role r = QAccessible::Slider);
- void *interface_cast(QAccessible::InterfaceType t) Q_DECL_OVERRIDE;
+ void *interface_cast(QAccessible::InterfaceType t) override;
// QAccessibleValueInterface
- QVariant currentValue() const Q_DECL_OVERRIDE;
- void setCurrentValue(const QVariant &value) Q_DECL_OVERRIDE;
- QVariant maximumValue() const Q_DECL_OVERRIDE;
- QVariant minimumValue() const Q_DECL_OVERRIDE;
- QVariant minimumStepSize() const Q_DECL_OVERRIDE;
+ QVariant currentValue() const override;
+ void setCurrentValue(const QVariant &value) override;
+ QVariant maximumValue() const override;
+ QVariant minimumValue() const override;
+ QVariant minimumStepSize() const override;
protected:
QAbstractSlider *abstractSlider() const;
@@ -167,7 +167,7 @@ class QAccessibleScrollBar : public QAccessibleAbstractSlider
{
public:
explicit QAccessibleScrollBar(QWidget *w);
- QString text(QAccessible::Text t) const Q_DECL_OVERRIDE;
+ QString text(QAccessible::Text t) const override;
protected:
QScrollBar *scrollBar() const;
@@ -179,7 +179,7 @@ class QAccessibleSlider : public QAccessibleAbstractSlider
{
public:
explicit QAccessibleSlider(QWidget *w);
- QString text(QAccessible::Text t) const Q_DECL_OVERRIDE;
+ QString text(QAccessible::Text t) const override;
protected:
QSlider *slider() const;
@@ -192,7 +192,7 @@ class QAccessibleDial : public QAccessibleAbstractSlider
public:
explicit QAccessibleDial(QWidget *w);
- QString text(QAccessible::Text textType) const Q_DECL_OVERRIDE;
+ QString text(QAccessible::Text textType) const override;
protected:
QDial *dial() const;
diff --git a/src/widgets/accessible/simplewidgets.cpp b/src/widgets/accessible/simplewidgets.cpp
index bacb00fe2e..f821c2f001 100644
--- a/src/widgets/accessible/simplewidgets.cpp
+++ b/src/widgets/accessible/simplewidgets.cpp
@@ -170,7 +170,7 @@ QAccessible::State QAccessibleButton::state() const
if (b->isChecked())
state.checked = true;
#if QT_CONFIG(checkbox)
- else if (cb && cb->checkState() == Qt::PartiallyChecked)
+ if (cb && cb->checkState() == Qt::PartiallyChecked)
state.checkStateMixed = true;
#endif
if (b->isDown())
diff --git a/src/widgets/accessible/simplewidgets_p.h b/src/widgets/accessible/simplewidgets_p.h
index 902b403d5b..fcd0e7df47 100644
--- a/src/widgets/accessible/simplewidgets_p.h
+++ b/src/widgets/accessible/simplewidgets_p.h
@@ -72,14 +72,14 @@ class QAccessibleButton : public QAccessibleWidget
public:
QAccessibleButton(QWidget *w);
- QString text(QAccessible::Text t) const Q_DECL_OVERRIDE;
- QAccessible::State state() const Q_DECL_OVERRIDE;
- QRect rect() const Q_DECL_OVERRIDE;
- QAccessible::Role role() const Q_DECL_OVERRIDE;
+ QString text(QAccessible::Text t) const override;
+ QAccessible::State state() const override;
+ QRect rect() const override;
+ QAccessible::Role role() const override;
- QStringList actionNames() const Q_DECL_OVERRIDE;
- void doAction(const QString &actionName) Q_DECL_OVERRIDE;
- QStringList keyBindingsForAction(const QString &actionName) const Q_DECL_OVERRIDE;
+ QStringList actionNames() const override;
+ void doAction(const QString &actionName) override;
+ QStringList keyBindingsForAction(const QString &actionName) const override;
protected:
QAbstractButton *button() const;
@@ -92,15 +92,15 @@ class QAccessibleToolButton : public QAccessibleButton
public:
QAccessibleToolButton(QWidget *w);
- QAccessible::State state() const Q_DECL_OVERRIDE;
- QAccessible::Role role() const Q_DECL_OVERRIDE;
+ QAccessible::State state() const override;
+ QAccessible::Role role() const override;
- int childCount() const Q_DECL_OVERRIDE;
- QAccessibleInterface *child(int index) const Q_DECL_OVERRIDE;
+ int childCount() const override;
+ QAccessibleInterface *child(int index) const override;
// QAccessibleActionInterface
- QStringList actionNames() const Q_DECL_OVERRIDE;
- void doAction(const QString &actionName) Q_DECL_OVERRIDE;
+ QStringList actionNames() const override;
+ void doAction(const QString &actionName) override;
protected:
QToolButton *toolButton() const;
@@ -114,16 +114,16 @@ class QAccessibleDisplay : public QAccessibleWidget, public QAccessibleImageInte
public:
explicit QAccessibleDisplay(QWidget *w, QAccessible::Role role = QAccessible::StaticText);
- QString text(QAccessible::Text t) const Q_DECL_OVERRIDE;
- QAccessible::Role role() const Q_DECL_OVERRIDE;
+ QString text(QAccessible::Text t) const override;
+ QAccessible::Role role() const override;
- QVector<QPair<QAccessibleInterface*, QAccessible::Relation> >relations(QAccessible::Relation match = QAccessible::AllRelations) const Q_DECL_OVERRIDE;
- void *interface_cast(QAccessible::InterfaceType t) Q_DECL_OVERRIDE;
+ QVector<QPair<QAccessibleInterface*, QAccessible::Relation> >relations(QAccessible::Relation match = QAccessible::AllRelations) const override;
+ void *interface_cast(QAccessible::InterfaceType t) override;
// QAccessibleImageInterface
- QString imageDescription() const Q_DECL_OVERRIDE;
- QSize imageSize() const Q_DECL_OVERRIDE;
- QPoint imagePosition() const Q_DECL_OVERRIDE;
+ QString imageDescription() const override;
+ QSize imageSize() const override;
+ QPoint imagePosition() const override;
};
#if QT_CONFIG(groupbox)
@@ -132,16 +132,16 @@ class QAccessibleGroupBox : public QAccessibleWidget
public:
explicit QAccessibleGroupBox(QWidget *w);
- QAccessible::State state() const Q_DECL_OVERRIDE;
- QAccessible::Role role() const Q_DECL_OVERRIDE;
- QString text(QAccessible::Text t) const Q_DECL_OVERRIDE;
+ QAccessible::State state() const override;
+ QAccessible::Role role() const override;
+ QString text(QAccessible::Text t) const override;
- QVector<QPair<QAccessibleInterface*, QAccessible::Relation> >relations(QAccessible::Relation match = QAccessible::AllRelations) const Q_DECL_OVERRIDE;
+ QVector<QPair<QAccessibleInterface*, QAccessible::Relation> >relations(QAccessible::Relation match = QAccessible::AllRelations) const override;
//QAccessibleActionInterface
- QStringList actionNames() const Q_DECL_OVERRIDE;
- void doAction(const QString &actionName) Q_DECL_OVERRIDE;
- QStringList keyBindingsForAction(const QString &) const Q_DECL_OVERRIDE;
+ QStringList actionNames() const override;
+ void doAction(const QString &actionName) override;
+ QStringList keyBindingsForAction(const QString &) const override;
private:
QGroupBox *groupBox() const;
@@ -154,36 +154,36 @@ class QAccessibleLineEdit : public QAccessibleWidget, public QAccessibleTextInte
public:
explicit QAccessibleLineEdit(QWidget *o, const QString &name = QString());
- QString text(QAccessible::Text t) const Q_DECL_OVERRIDE;
- void setText(QAccessible::Text t, const QString &text) Q_DECL_OVERRIDE;
- QAccessible::State state() const Q_DECL_OVERRIDE;
- void *interface_cast(QAccessible::InterfaceType t) Q_DECL_OVERRIDE;
+ QString text(QAccessible::Text t) const override;
+ void setText(QAccessible::Text t, const QString &text) override;
+ QAccessible::State state() const override;
+ void *interface_cast(QAccessible::InterfaceType t) override;
// QAccessibleTextInterface
- void addSelection(int startOffset, int endOffset) Q_DECL_OVERRIDE;
- QString attributes(int offset, int *startOffset, int *endOffset) const Q_DECL_OVERRIDE;
- int cursorPosition() const Q_DECL_OVERRIDE;
- QRect characterRect(int offset) const Q_DECL_OVERRIDE;
- int selectionCount() const Q_DECL_OVERRIDE;
- int offsetAtPoint(const QPoint &point) const Q_DECL_OVERRIDE;
- void selection(int selectionIndex, int *startOffset, int *endOffset) const Q_DECL_OVERRIDE;
- QString text(int startOffset, int endOffset) const Q_DECL_OVERRIDE;
+ void addSelection(int startOffset, int endOffset) override;
+ QString attributes(int offset, int *startOffset, int *endOffset) const override;
+ int cursorPosition() const override;
+ QRect characterRect(int offset) const override;
+ int selectionCount() const override;
+ int offsetAtPoint(const QPoint &point) const override;
+ void selection(int selectionIndex, int *startOffset, int *endOffset) const override;
+ QString text(int startOffset, int endOffset) const override;
QString textBeforeOffset (int offset, QAccessible::TextBoundaryType boundaryType,
- int *startOffset, int *endOffset) const Q_DECL_OVERRIDE;
+ int *startOffset, int *endOffset) const override;
QString textAfterOffset(int offset, QAccessible::TextBoundaryType boundaryType,
- int *startOffset, int *endOffset) const Q_DECL_OVERRIDE;
+ int *startOffset, int *endOffset) const override;
QString textAtOffset(int offset, QAccessible::TextBoundaryType boundaryType,
- int *startOffset, int *endOffset) const Q_DECL_OVERRIDE;
- void removeSelection(int selectionIndex) Q_DECL_OVERRIDE;
- void setCursorPosition(int position) Q_DECL_OVERRIDE;
- void setSelection(int selectionIndex, int startOffset, int endOffset) Q_DECL_OVERRIDE;
- int characterCount() const Q_DECL_OVERRIDE;
- void scrollToSubstring(int startIndex, int endIndex) Q_DECL_OVERRIDE;
+ int *startOffset, int *endOffset) const override;
+ void removeSelection(int selectionIndex) override;
+ void setCursorPosition(int position) override;
+ void setSelection(int selectionIndex, int startOffset, int endOffset) override;
+ int characterCount() const override;
+ void scrollToSubstring(int startIndex, int endIndex) override;
// QAccessibleEditableTextInterface
- void deleteText(int startOffset, int endOffset) Q_DECL_OVERRIDE;
- void insertText(int offset, const QString &text) Q_DECL_OVERRIDE;
- void replaceText(int startOffset, int endOffset, const QString &text) Q_DECL_OVERRIDE;
+ void deleteText(int startOffset, int endOffset) override;
+ void insertText(int offset, const QString &text) override;
+ void replaceText(int startOffset, int endOffset, const QString &text) override;
protected:
QLineEdit *lineEdit() const;
friend class QAccessibleAbstractSpinBox;
@@ -195,14 +195,14 @@ class QAccessibleProgressBar : public QAccessibleDisplay, public QAccessibleValu
{
public:
explicit QAccessibleProgressBar(QWidget *o);
- void *interface_cast(QAccessible::InterfaceType t) Q_DECL_OVERRIDE;
+ void *interface_cast(QAccessible::InterfaceType t) override;
// QAccessibleValueInterface
- QVariant currentValue() const Q_DECL_OVERRIDE;
- QVariant maximumValue() const Q_DECL_OVERRIDE;
- QVariant minimumValue() const Q_DECL_OVERRIDE;
- QVariant minimumStepSize() const Q_DECL_OVERRIDE;
- void setCurrentValue(const QVariant &) Q_DECL_OVERRIDE {}
+ QVariant currentValue() const override;
+ QVariant maximumValue() const override;
+ QVariant minimumValue() const override;
+ QVariant minimumStepSize() const override;
+ void setCurrentValue(const QVariant &) override {}
protected:
QProgressBar *progressBar() const;
@@ -214,9 +214,9 @@ class QAccessibleWindowContainer : public QAccessibleWidget
{
public:
QAccessibleWindowContainer(QWidget *w);
- int childCount() const Q_DECL_OVERRIDE;
- int indexOfChild(const QAccessibleInterface *child) const Q_DECL_OVERRIDE;
- QAccessibleInterface *child(int i) const Q_DECL_OVERRIDE;
+ int childCount() const override;
+ int indexOfChild(const QAccessibleInterface *child) const override;
+ QAccessibleInterface *child(int i) const override;
private:
QWindowContainer *container() const;
diff --git a/src/widgets/dialogs/qcolordialog.cpp b/src/widgets/dialogs/qcolordialog.cpp
index f3b198fdc2..cd422297f1 100644
--- a/src/widgets/dialogs/qcolordialog.cpp
+++ b/src/widgets/dialogs/qcolordialog.cpp
@@ -134,7 +134,7 @@ public:
bool handleColorPickingMouseButtonRelease(QMouseEvent *e);
bool handleColorPickingKeyPress(QKeyEvent *e);
- bool canBeNativeDialog() const Q_DECL_OVERRIDE;
+ bool canBeNativeDialog() const override;
QWellArray *custom;
QWellArray *standard;
@@ -167,8 +167,8 @@ public:
#endif
private:
- virtual void initHelper(QPlatformDialogHelper *h) Q_DECL_OVERRIDE;
- virtual void helperPrepareShow(QPlatformDialogHelper *h) Q_DECL_OVERRIDE;
+ virtual void initHelper(QPlatformDialogHelper *h) override;
+ virtual void helperPrepareShow(QPlatformDialogHelper *h) override;
};
//////////// QWellArray BEGIN
@@ -192,7 +192,7 @@ public:
virtual void setCurrent(int row, int col);
virtual void setSelected(int row, int col);
- QSize sizeHint() const Q_DECL_OVERRIDE;
+ QSize sizeHint() const override;
inline int cellWidth() const
{ return cellw; }
@@ -242,12 +242,12 @@ protected:
virtual void paintCell(QPainter *, int row, int col, const QRect&);
virtual void paintCellContents(QPainter *, int row, int col, const QRect&);
- void mousePressEvent(QMouseEvent*) Q_DECL_OVERRIDE;
- void mouseReleaseEvent(QMouseEvent*) Q_DECL_OVERRIDE;
- void keyPressEvent(QKeyEvent*) Q_DECL_OVERRIDE;
- void focusInEvent(QFocusEvent*) Q_DECL_OVERRIDE;
- void focusOutEvent(QFocusEvent*) Q_DECL_OVERRIDE;
- void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
+ void mousePressEvent(QMouseEvent*) override;
+ void mouseReleaseEvent(QMouseEvent*) override;
+ void keyPressEvent(QKeyEvent*) override;
+ void focusInEvent(QFocusEvent*) override;
+ void focusOutEvent(QFocusEvent*) override;
+ void paintEvent(QPaintEvent *) override;
private:
Q_DISABLE_COPY(QWellArray)
@@ -495,7 +495,7 @@ class QColorPickingEventFilter : public QObject {
public:
explicit QColorPickingEventFilter(QColorDialogPrivate *dp, QObject *parent = 0) : QObject(parent), m_dp(dp) {}
- bool eventFilter(QObject *, QEvent *event) Q_DECL_OVERRIDE
+ bool eventFilter(QObject *, QEvent *event) override
{
switch (event->type()) {
case QEvent::MouseMove:
@@ -586,15 +586,15 @@ public:
{ setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum)); }
protected:
- void paintCellContents(QPainter *, int row, int col, const QRect&) Q_DECL_OVERRIDE;
- void mousePressEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
- void mouseMoveEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
- void mouseReleaseEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
+ void paintCellContents(QPainter *, int row, int col, const QRect&) override;
+ void mousePressEvent(QMouseEvent *e) override;
+ void mouseMoveEvent(QMouseEvent *e) override;
+ void mouseReleaseEvent(QMouseEvent *e) override;
#ifndef QT_NO_DRAGANDDROP
- void dragEnterEvent(QDragEnterEvent *e) Q_DECL_OVERRIDE;
- void dragLeaveEvent(QDragLeaveEvent *e) Q_DECL_OVERRIDE;
- void dragMoveEvent(QDragMoveEvent *e) Q_DECL_OVERRIDE;
- void dropEvent(QDropEvent *e) Q_DECL_OVERRIDE;
+ void dragEnterEvent(QDragEnterEvent *e) override;
+ void dragLeaveEvent(QDragLeaveEvent *e) override;
+ void dragMoveEvent(QDragMoveEvent *e) override;
+ void dropEvent(QDropEvent *e) override;
#endif
private:
@@ -708,11 +708,11 @@ signals:
void newCol(int h, int s);
protected:
- QSize sizeHint() const Q_DECL_OVERRIDE;
- void paintEvent(QPaintEvent*) Q_DECL_OVERRIDE;
- void mouseMoveEvent(QMouseEvent *) Q_DECL_OVERRIDE;
- void mousePressEvent(QMouseEvent *) Q_DECL_OVERRIDE;
- void resizeEvent(QResizeEvent *) Q_DECL_OVERRIDE;
+ QSize sizeHint() const override;
+ void paintEvent(QPaintEvent*) override;
+ void mouseMoveEvent(QMouseEvent *) override;
+ void mousePressEvent(QMouseEvent *) override;
+ void resizeEvent(QResizeEvent *) override;
private:
int hue;
@@ -745,9 +745,9 @@ signals:
void newHsv(int h, int s, int v);
protected:
- void paintEvent(QPaintEvent*) Q_DECL_OVERRIDE;
- void mouseMoveEvent(QMouseEvent *) Q_DECL_OVERRIDE;
- void mousePressEvent(QMouseEvent *) Q_DECL_OVERRIDE;
+ void paintEvent(QPaintEvent*) override;
+ void mouseMoveEvent(QMouseEvent *) override;
+ void mousePressEvent(QMouseEvent *) override;
private:
enum { foff = 3, coff = 4 }; //frame and contents offset
@@ -1067,14 +1067,14 @@ signals:
void colorDropped(QRgb);
protected:
- void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
- void mousePressEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
- void mouseMoveEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
- void mouseReleaseEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
+ void paintEvent(QPaintEvent *) override;
+ void mousePressEvent(QMouseEvent *e) override;
+ void mouseMoveEvent(QMouseEvent *e) override;
+ void mouseReleaseEvent(QMouseEvent *e) override;
#ifndef QT_NO_DRAGANDDROP
- void dragEnterEvent(QDragEnterEvent *e) Q_DECL_OVERRIDE;
- void dragLeaveEvent(QDragLeaveEvent *e) Q_DECL_OVERRIDE;
- void dropEvent(QDropEvent *e) Q_DECL_OVERRIDE;
+ void dragEnterEvent(QDragEnterEvent *e) override;
+ void dragLeaveEvent(QDragLeaveEvent *e) override;
+ void dropEvent(QDropEvent *e) override;
#endif
private:
@@ -1560,8 +1560,7 @@ bool QColorDialogPrivate::selectColor(const QColor &col)
QColor QColorDialogPrivate::grabScreenColor(const QPoint &p)
{
const QDesktopWidget *desktop = QApplication::desktop();
- const QPixmap pixmap = QGuiApplication::screens().at(desktop->screenNumber())->grabWindow(desktop->winId(),
- p.x(), p.y(), 1, 1);
+ const QPixmap pixmap = QGuiApplication::primaryScreen()->grabWindow(desktop->winId(), p.x(), p.y(), 1, 1);
QImage i = pixmap.toImage();
return i.pixel(0, 0);
}
diff --git a/src/widgets/dialogs/qcolordialog.h b/src/widgets/dialogs/qcolordialog.h
index a27cfaf953..6451ff9bde 100644
--- a/src/widgets/dialogs/qcolordialog.h
+++ b/src/widgets/dialogs/qcolordialog.h
@@ -68,8 +68,8 @@ public:
Q_DECLARE_FLAGS(ColorDialogOptions, ColorDialogOption)
- explicit QColorDialog(QWidget *parent = Q_NULLPTR);
- explicit QColorDialog(const QColor &initial, QWidget *parent = Q_NULLPTR);
+ explicit QColorDialog(QWidget *parent = nullptr);
+ explicit QColorDialog(const QColor &initial, QWidget *parent = nullptr);
~QColorDialog();
void setCurrentColor(const QColor &color);
@@ -85,15 +85,15 @@ public:
using QDialog::open;
void open(QObject *receiver, const char *member);
- void setVisible(bool visible) Q_DECL_OVERRIDE;
+ void setVisible(bool visible) override;
static QColor getColor(const QColor &initial = Qt::white,
- QWidget *parent = Q_NULLPTR,
+ QWidget *parent = nullptr,
const QString &title = QString(),
ColorDialogOptions options = ColorDialogOptions());
// obsolete
- static QRgb getRgba(QRgb rgba = 0xffffffff, bool *ok = Q_NULLPTR, QWidget *parent = Q_NULLPTR);
+ static QRgb getRgba(QRgb rgba = 0xffffffff, bool *ok = nullptr, QWidget *parent = nullptr);
static int customCount();
static QColor customColor(int index);
@@ -106,8 +106,8 @@ Q_SIGNALS:
void colorSelected(const QColor &color);
protected:
- void changeEvent(QEvent *event) Q_DECL_OVERRIDE;
- void done(int result) Q_DECL_OVERRIDE;
+ void changeEvent(QEvent *event) override;
+ void done(int result) override;
private:
Q_DISABLE_COPY(QColorDialog)
diff --git a/src/widgets/dialogs/qdialog.h b/src/widgets/dialogs/qdialog.h
index 72250172d3..7f267dd939 100644
--- a/src/widgets/dialogs/qdialog.h
+++ b/src/widgets/dialogs/qdialog.h
@@ -60,7 +60,7 @@ class Q_WIDGETS_EXPORT QDialog : public QWidget
Q_PROPERTY(bool modal READ isModal WRITE setModal)
public:
- explicit QDialog(QWidget *parent = Q_NULLPTR, Qt::WindowFlags f = Qt::WindowFlags());
+ explicit QDialog(QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags());
~QDialog();
enum DialogCode { Rejected, Accepted };
diff --git a/src/widgets/dialogs/qdialog_p.h b/src/widgets/dialogs/qdialog_p.h
index 2ed414bd45..99fff08e65 100644
--- a/src/widgets/dialogs/qdialog_p.h
+++ b/src/widgets/dialogs/qdialog_p.h
@@ -143,7 +143,7 @@ public:
T *operator->() const Q_DECL_NOTHROW { return get(); }
T *get() const Q_DECL_NOTHROW { return o; }
T &operator*() const { return *get(); }
- operator RestrictedBool() const Q_DECL_NOTHROW { return o ? &internal::func : Q_NULLPTR; }
+ operator RestrictedBool() const Q_DECL_NOTHROW { return o ? &internal::func : nullptr; }
bool operator!() const Q_DECL_NOTHROW { return !o; }
private:
Q_DISABLE_COPY(QAutoPointer);
diff --git a/src/widgets/dialogs/qerrormessage.cpp b/src/widgets/dialogs/qerrormessage.cpp
index 39035b743d..fd68f19680 100644
--- a/src/widgets/dialogs/qerrormessage.cpp
+++ b/src/widgets/dialogs/qerrormessage.cpp
@@ -95,8 +95,8 @@ public:
QErrorMessageTextView(QWidget *parent)
: QTextEdit(parent) { setReadOnly(true); }
- virtual QSize minimumSizeHint() const Q_DECL_OVERRIDE;
- virtual QSize sizeHint() const Q_DECL_OVERRIDE;
+ virtual QSize minimumSizeHint() const override;
+ virtual QSize sizeHint() const override;
};
} // unnamed namespace
diff --git a/src/widgets/dialogs/qerrormessage.h b/src/widgets/dialogs/qerrormessage.h
index 4cb1fad845..220694e54e 100644
--- a/src/widgets/dialogs/qerrormessage.h
+++ b/src/widgets/dialogs/qerrormessage.h
@@ -55,7 +55,7 @@ class Q_WIDGETS_EXPORT QErrorMessage: public QDialog
Q_OBJECT
Q_DECLARE_PRIVATE(QErrorMessage)
public:
- explicit QErrorMessage(QWidget* parent = Q_NULLPTR);
+ explicit QErrorMessage(QWidget* parent = nullptr);
~QErrorMessage();
static QErrorMessage * qtHandler();
@@ -65,8 +65,8 @@ public Q_SLOTS:
void showMessage(const QString &message, const QString &type);
protected:
- void done(int) Q_DECL_OVERRIDE;
- void changeEvent(QEvent *e) Q_DECL_OVERRIDE;
+ void done(int) override;
+ void changeEvent(QEvent *e) override;
private:
Q_DISABLE_COPY(QErrorMessage)
diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp
index 8d37969be4..e375a957de 100644
--- a/src/widgets/dialogs/qfiledialog.cpp
+++ b/src/widgets/dialogs/qfiledialog.cpp
@@ -1994,7 +1994,7 @@ QFileIconProvider *QFileDialog::iconProvider() const
{
Q_D(const QFileDialog);
if (!d->model)
- return Q_NULLPTR;
+ return nullptr;
return d->model->iconProvider();
}
@@ -3621,7 +3621,7 @@ void QFileDialogPrivate::_q_enterDirectory(const QModelIndex &index)
}
} else {
// Do not accept when shift-clicking to multi-select a file in environments with single-click-activation (KDE)
- if (!q->style()->styleHint(QStyle::SH_ItemView_ActivateItemOnSingleClick, Q_NULLPTR, qFileDialogUi->treeView)
+ if (!q->style()->styleHint(QStyle::SH_ItemView_ActivateItemOnSingleClick, nullptr, qFileDialogUi->treeView)
|| q->fileMode() != QFileDialog::ExistingFiles || !(QGuiApplication::keyboardModifiers() & Qt::CTRL)) {
q->accept();
}
diff --git a/src/widgets/dialogs/qfiledialog.h b/src/widgets/dialogs/qfiledialog.h
index b9092e036d..1cbd690f24 100644
--- a/src/widgets/dialogs/qfiledialog.h
+++ b/src/widgets/dialogs/qfiledialog.h
@@ -98,7 +98,7 @@ public:
Q_FLAG(Options)
QFileDialog(QWidget *parent, Qt::WindowFlags f);
- explicit QFileDialog(QWidget *parent = Q_NULLPTR,
+ explicit QFileDialog(QWidget *parent = nullptr,
const QString &caption = QString(),
const QString &directory = QString(),
const QString &filter = QString());
@@ -190,7 +190,7 @@ public:
using QDialog::open;
void open(QObject *receiver, const char *member);
- void setVisible(bool visible) Q_DECL_OVERRIDE;
+ void setVisible(bool visible) override;
Q_SIGNALS:
void fileSelected(const QString &file);
@@ -207,68 +207,68 @@ Q_SIGNALS:
public:
- static QString getOpenFileName(QWidget *parent = Q_NULLPTR,
+ static QString getOpenFileName(QWidget *parent = nullptr,
const QString &caption = QString(),
const QString &dir = QString(),
const QString &filter = QString(),
- QString *selectedFilter = Q_NULLPTR,
+ QString *selectedFilter = nullptr,
Options options = Options());
- static QUrl getOpenFileUrl(QWidget *parent = Q_NULLPTR,
+ static QUrl getOpenFileUrl(QWidget *parent = nullptr,
const QString &caption = QString(),
const QUrl &dir = QUrl(),
const QString &filter = QString(),
- QString *selectedFilter = Q_NULLPTR,
+ QString *selectedFilter = nullptr,
Options options = Options(),
const QStringList &supportedSchemes = QStringList());
- static QString getSaveFileName(QWidget *parent = Q_NULLPTR,
+ static QString getSaveFileName(QWidget *parent = nullptr,
const QString &caption = QString(),
const QString &dir = QString(),
const QString &filter = QString(),
- QString *selectedFilter = Q_NULLPTR,
+ QString *selectedFilter = nullptr,
Options options = Options());
- static QUrl getSaveFileUrl(QWidget *parent = Q_NULLPTR,
+ static QUrl getSaveFileUrl(QWidget *parent = nullptr,
const QString &caption = QString(),
const QUrl &dir = QUrl(),
const QString &filter = QString(),
- QString *selectedFilter = Q_NULLPTR,
+ QString *selectedFilter = nullptr,
Options options = Options(),
const QStringList &supportedSchemes = QStringList());
- static QString getExistingDirectory(QWidget *parent = Q_NULLPTR,
+ static QString getExistingDirectory(QWidget *parent = nullptr,
const QString &caption = QString(),
const QString &dir = QString(),
Options options = ShowDirsOnly);
- static QUrl getExistingDirectoryUrl(QWidget *parent = Q_NULLPTR,
+ static QUrl getExistingDirectoryUrl(QWidget *parent = nullptr,
const QString &caption = QString(),
const QUrl &dir = QUrl(),
Options options = ShowDirsOnly,
const QStringList &supportedSchemes = QStringList());
- static QStringList getOpenFileNames(QWidget *parent = Q_NULLPTR,
+ static QStringList getOpenFileNames(QWidget *parent = nullptr,
const QString &caption = QString(),
const QString &dir = QString(),
const QString &filter = QString(),
- QString *selectedFilter = Q_NULLPTR,
+ QString *selectedFilter = nullptr,
Options options = Options());
- static QList<QUrl> getOpenFileUrls(QWidget *parent = Q_NULLPTR,
+ static QList<QUrl> getOpenFileUrls(QWidget *parent = nullptr,
const QString &caption = QString(),
const QUrl &dir = QUrl(),
const QString &filter = QString(),
- QString *selectedFilter = Q_NULLPTR,
+ QString *selectedFilter = nullptr,
Options options = Options(),
const QStringList &supportedSchemes = QStringList());
protected:
QFileDialog(const QFileDialogArgs &args);
- void done(int result) Q_DECL_OVERRIDE;
- void accept() Q_DECL_OVERRIDE;
- void changeEvent(QEvent *e) Q_DECL_OVERRIDE;
+ void done(int result) override;
+ void accept() override;
+ void changeEvent(QEvent *e) override;
private:
Q_DECLARE_PRIVATE(QFileDialog)
diff --git a/src/widgets/dialogs/qfiledialog_p.h b/src/widgets/dialogs/qfiledialog_p.h
index 371826eccc..17290381d3 100644
--- a/src/widgets/dialogs/qfiledialog_p.h
+++ b/src/widgets/dialogs/qfiledialog_p.h
@@ -254,7 +254,7 @@ public:
// setVisible_sys returns true if it ends up showing a native
// dialog. Returning false means that a non-native dialog must be
// used instead.
- bool canBeNativeDialog() const Q_DECL_OVERRIDE;
+ bool canBeNativeDialog() const override;
inline bool usingWidgets() const;
inline void setDirectory_sys(const QUrl &directory);
@@ -286,9 +286,9 @@ public:
~QFileDialogPrivate();
private:
- virtual void initHelper(QPlatformDialogHelper *) Q_DECL_OVERRIDE;
- virtual void helperPrepareShow(QPlatformDialogHelper *) Q_DECL_OVERRIDE;
- virtual void helperDone(QDialog::DialogCode, QPlatformDialogHelper *) Q_DECL_OVERRIDE;
+ virtual void initHelper(QPlatformDialogHelper *) override;
+ virtual void helperPrepareShow(QPlatformDialogHelper *) override;
+ virtual void helperDone(QDialog::DialogCode, QPlatformDialogHelper *) override;
Q_DISABLE_COPY(QFileDialogPrivate)
};
@@ -298,7 +298,7 @@ class QFileDialogLineEdit : public QLineEdit
public:
QFileDialogLineEdit(QWidget *parent = 0) : QLineEdit(parent), d_ptr(0){}
void setFileDialogPrivate(QFileDialogPrivate *d_pointer) {d_ptr = d_pointer; }
- void keyPressEvent(QKeyEvent *e) Q_DECL_OVERRIDE;
+ void keyPressEvent(QKeyEvent *e) override;
bool hideOnEsc;
private:
QFileDialogPrivate *d_ptr;
@@ -309,10 +309,10 @@ class QFileDialogComboBox : public QComboBox
public:
QFileDialogComboBox(QWidget *parent = 0) : QComboBox(parent), urlModel(0) {}
void setFileDialogPrivate(QFileDialogPrivate *d_pointer);
- void showPopup() Q_DECL_OVERRIDE;
+ void showPopup() override;
void setHistory(const QStringList &paths);
QStringList history() const { return m_history; }
- void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
+ void paintEvent(QPaintEvent *) override;
private:
QUrlModel *urlModel;
@@ -325,9 +325,9 @@ class QFileDialogListView : public QListView
public:
QFileDialogListView(QWidget *parent = 0);
void setFileDialogPrivate(QFileDialogPrivate *d_pointer);
- QSize sizeHint() const Q_DECL_OVERRIDE;
+ QSize sizeHint() const override;
protected:
- void keyPressEvent(QKeyEvent *e) Q_DECL_OVERRIDE;
+ void keyPressEvent(QKeyEvent *e) override;
private:
QFileDialogPrivate *d_ptr;
};
@@ -337,10 +337,10 @@ class QFileDialogTreeView : public QTreeView
public:
QFileDialogTreeView(QWidget *parent);
void setFileDialogPrivate(QFileDialogPrivate *d_pointer);
- QSize sizeHint() const Q_DECL_OVERRIDE;
+ QSize sizeHint() const override;
protected:
- void keyPressEvent(QKeyEvent *e) Q_DECL_OVERRIDE;
+ void keyPressEvent(QKeyEvent *e) override;
private:
QFileDialogPrivate *d_ptr;
};
diff --git a/src/widgets/dialogs/qfileinfogatherer_p.h b/src/widgets/dialogs/qfileinfogatherer_p.h
index 52578126de..1e97cc3558 100644
--- a/src/widgets/dialogs/qfileinfogatherer_p.h
+++ b/src/widgets/dialogs/qfileinfogatherer_p.h
@@ -185,7 +185,7 @@ private Q_SLOTS:
void driveRemoved();
private:
- void run() Q_DECL_OVERRIDE;
+ void run() override;
// called by run():
void getFileInfos(const QString &path, const QStringList &files);
void fetch(const QFileInfo &info, QElapsedTimer &base, bool &firstTime, QVector<QPair<QString, QFileInfo> > &updatedFiles, const QString &path);
diff --git a/src/widgets/dialogs/qfilesystemmodel.h b/src/widgets/dialogs/qfilesystemmodel.h
index a5f23c9220..c2c8b8818e 100644
--- a/src/widgets/dialogs/qfilesystemmodel.h
+++ b/src/widgets/dialogs/qfilesystemmodel.h
@@ -75,36 +75,36 @@ public:
FilePermissions = Qt::UserRole + 3
};
- explicit QFileSystemModel(QObject *parent = Q_NULLPTR);
+ explicit QFileSystemModel(QObject *parent = nullptr);
~QFileSystemModel();
- QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
+ QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override;
QModelIndex index(const QString &path, int column = 0) const;
- QModelIndex parent(const QModelIndex &child) const Q_DECL_OVERRIDE;
+ QModelIndex parent(const QModelIndex &child) const override;
using QObject::parent;
- QModelIndex sibling(int row, int column, const QModelIndex &idx) const Q_DECL_OVERRIDE;
- bool hasChildren(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
- bool canFetchMore(const QModelIndex &parent) const Q_DECL_OVERRIDE;
- void fetchMore(const QModelIndex &parent) Q_DECL_OVERRIDE;
+ QModelIndex sibling(int row, int column, const QModelIndex &idx) const override;
+ bool hasChildren(const QModelIndex &parent = QModelIndex()) const override;
+ bool canFetchMore(const QModelIndex &parent) const override;
+ void fetchMore(const QModelIndex &parent) override;
- int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
- int columnCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
+ int rowCount(const QModelIndex &parent = QModelIndex()) const override;
+ int columnCount(const QModelIndex &parent = QModelIndex()) const override;
QVariant myComputer(int role = Qt::DisplayRole) const;
- QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
- bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) Q_DECL_OVERRIDE;
+ QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
+ bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;
- QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
+ QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
- Qt::ItemFlags flags(const QModelIndex &index) const Q_DECL_OVERRIDE;
+ Qt::ItemFlags flags(const QModelIndex &index) const override;
- void sort(int column, Qt::SortOrder order = Qt::AscendingOrder) Q_DECL_OVERRIDE;
+ void sort(int column, Qt::SortOrder order = Qt::AscendingOrder) override;
- QStringList mimeTypes() const Q_DECL_OVERRIDE;
- QMimeData *mimeData(const QModelIndexList &indexes) const Q_DECL_OVERRIDE;
+ QStringList mimeTypes() const override;
+ QMimeData *mimeData(const QModelIndexList &indexes) const override;
bool dropMimeData(const QMimeData *data, Qt::DropAction action,
- int row, int column, const QModelIndex &parent) Q_DECL_OVERRIDE;
- Qt::DropActions supportedDropActions() const Q_DECL_OVERRIDE;
+ int row, int column, const QModelIndex &parent) override;
+ Qt::DropActions supportedDropActions() const override;
// QFileSystemModel specific API
QModelIndex setRootPath(const QString &path);
@@ -144,9 +144,9 @@ public:
bool remove(const QModelIndex &index);
protected:
- QFileSystemModel(QFileSystemModelPrivate &, QObject *parent = Q_NULLPTR);
- void timerEvent(QTimerEvent *event) Q_DECL_OVERRIDE;
- bool event(QEvent *event) Q_DECL_OVERRIDE;
+ QFileSystemModel(QFileSystemModelPrivate &, QObject *parent = nullptr);
+ void timerEvent(QTimerEvent *event) override;
+ bool event(QEvent *event) override;
private:
Q_DECLARE_PRIVATE(QFileSystemModel)
diff --git a/src/widgets/dialogs/qfontdialog.cpp b/src/widgets/dialogs/qfontdialog.cpp
index 587e31d8c5..5f912c582f 100644
--- a/src/widgets/dialogs/qfontdialog.cpp
+++ b/src/widgets/dialogs/qfontdialog.cpp
@@ -84,7 +84,7 @@ public:
int row = QListView::currentIndex().row();
return row < 0 ? QString() : model()->stringList().at(row);
}
- void currentChanged(const QModelIndex &current, const QModelIndex &previous) Q_DECL_OVERRIDE {
+ void currentChanged(const QModelIndex &current, const QModelIndex &previous) override {
QListView::currentChanged(current, previous);
if (current.isValid())
emit highlighted(current.row());
diff --git a/src/widgets/dialogs/qfontdialog.h b/src/widgets/dialogs/qfontdialog.h
index 3fb3997b85..ae1320e779 100644
--- a/src/widgets/dialogs/qfontdialog.h
+++ b/src/widgets/dialogs/qfontdialog.h
@@ -72,8 +72,8 @@ public:
Q_DECLARE_FLAGS(FontDialogOptions, FontDialogOption)
- explicit QFontDialog(QWidget *parent = Q_NULLPTR);
- explicit QFontDialog(const QFont &initial, QWidget *parent = Q_NULLPTR);
+ explicit QFontDialog(QWidget *parent = nullptr);
+ explicit QFontDialog(const QFont &initial, QWidget *parent = nullptr);
~QFontDialog();
void setCurrentFont(const QFont &font);
@@ -89,10 +89,10 @@ public:
using QDialog::open;
void open(QObject *receiver, const char *member);
- void setVisible(bool visible) Q_DECL_OVERRIDE;
+ void setVisible(bool visible) override;
- static QFont getFont(bool *ok, QWidget *parent = Q_NULLPTR);
- static QFont getFont(bool *ok, const QFont &initial, QWidget *parent = Q_NULLPTR, const QString &title = QString(),
+ static QFont getFont(bool *ok, QWidget *parent = nullptr);
+ static QFont getFont(bool *ok, const QFont &initial, QWidget *parent = nullptr, const QString &title = QString(),
FontDialogOptions options = FontDialogOptions());
Q_SIGNALS:
@@ -100,9 +100,9 @@ Q_SIGNALS:
void fontSelected(const QFont &font);
protected:
- void changeEvent(QEvent *event) Q_DECL_OVERRIDE;
- void done(int result) Q_DECL_OVERRIDE;
- bool eventFilter(QObject *object, QEvent *event) Q_DECL_OVERRIDE;
+ void changeEvent(QEvent *event) override;
+ void done(int result) override;
+ bool eventFilter(QObject *object, QEvent *event) override;
private:
Q_DISABLE_COPY(QFontDialog)
diff --git a/src/widgets/dialogs/qfontdialog_p.h b/src/widgets/dialogs/qfontdialog_p.h
index ae923d94ed..202247a3b4 100644
--- a/src/widgets/dialogs/qfontdialog_p.h
+++ b/src/widgets/dialogs/qfontdialog_p.h
@@ -141,12 +141,12 @@ public:
QPointer<QObject> receiverToDisconnectOnClose;
QByteArray memberToDisconnectOnClose;
- bool canBeNativeDialog() const Q_DECL_OVERRIDE;
+ bool canBeNativeDialog() const override;
void _q_runNativeAppModalPanel();
private:
- virtual void initHelper(QPlatformDialogHelper *) Q_DECL_OVERRIDE;
- virtual void helperPrepareShow(QPlatformDialogHelper *) Q_DECL_OVERRIDE;
+ virtual void initHelper(QPlatformDialogHelper *) override;
+ virtual void helperPrepareShow(QPlatformDialogHelper *) override;
};
QT_END_NAMESPACE
diff --git a/src/widgets/dialogs/qfscompleter_p.h b/src/widgets/dialogs/qfscompleter_p.h
index ce0612f293..3b829d4a52 100644
--- a/src/widgets/dialogs/qfscompleter_p.h
+++ b/src/widgets/dialogs/qfscompleter_p.h
@@ -71,8 +71,8 @@ public:
setCaseSensitivity(Qt::CaseInsensitive);
#endif
}
- QString pathFromIndex(const QModelIndex &index) const Q_DECL_OVERRIDE;
- QStringList splitPath(const QString& path) const Q_DECL_OVERRIDE;
+ QString pathFromIndex(const QModelIndex &index) const override;
+ QStringList splitPath(const QString& path) const override;
QAbstractProxyModel *proxyModel;
QFileSystemModel *sourceModel;
diff --git a/src/widgets/dialogs/qinputdialog.cpp b/src/widgets/dialogs/qinputdialog.cpp
index 4c0f22ae97..c03df08345 100644
--- a/src/widgets/dialogs/qinputdialog.cpp
+++ b/src/widgets/dialogs/qinputdialog.cpp
@@ -74,7 +74,7 @@ static const char *candidateSignal(int which)
case NumCandidateSignals: ; // fall through
};
Q_UNREACHABLE();
- return Q_NULLPTR;
+ return nullptr;
}
static const char *signalForMember(const char *member)
@@ -115,7 +115,7 @@ private slots:
void notifyTextChanged() { emit textChanged(hasAcceptableInput()); }
private:
- void keyPressEvent(QKeyEvent *event) Q_DECL_OVERRIDE {
+ void keyPressEvent(QKeyEvent *event) override {
if ((event->key() == Qt::Key_Return || event->key() == Qt::Key_Enter) && !hasAcceptableInput()) {
#ifndef QT_NO_PROPERTIES
setProperty("value", property("value"));
@@ -126,7 +126,7 @@ private:
notifyTextChanged();
}
- void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE {
+ void mousePressEvent(QMouseEvent *event) override {
QSpinBox::mousePressEvent(event);
notifyTextChanged();
}
@@ -150,7 +150,7 @@ private slots:
void notifyTextChanged() { emit textChanged(hasAcceptableInput()); }
private:
- void keyPressEvent(QKeyEvent *event) Q_DECL_OVERRIDE {
+ void keyPressEvent(QKeyEvent *event) override {
if ((event->key() == Qt::Key_Return || event->key() == Qt::Key_Enter) && !hasAcceptableInput()) {
#ifndef QT_NO_PROPERTIES
setProperty("value", property("value"));
@@ -161,7 +161,7 @@ private:
notifyTextChanged();
}
- void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE {
+ void mousePressEvent(QMouseEvent *event) override {
QDoubleSpinBox::mousePressEvent(event);
notifyTextChanged();
}
@@ -239,7 +239,6 @@ void QInputDialogPrivate::ensureLayout()
QObject::connect(buttonBox, SIGNAL(rejected()), q, SLOT(reject()));
mainLayout = new QVBoxLayout(q);
- //we want to let the input dialog grow to available size on Symbian.
mainLayout->setSizeConstraint(QLayout::SetMinAndMaxSize);
mainLayout->addWidget(label);
mainLayout->addWidget(inputWidget);
diff --git a/src/widgets/dialogs/qinputdialog.h b/src/widgets/dialogs/qinputdialog.h
index e41d442498..c3a5e59d53 100644
--- a/src/widgets/dialogs/qinputdialog.h
+++ b/src/widgets/dialogs/qinputdialog.h
@@ -91,7 +91,7 @@ public:
DoubleInput
};
- QInputDialog(QWidget *parent = Q_NULLPTR, Qt::WindowFlags flags = Qt::WindowFlags());
+ QInputDialog(QWidget *parent = nullptr, Qt::WindowFlags flags = Qt::WindowFlags());
~QInputDialog();
void setInputMode(InputMode mode);
@@ -154,31 +154,31 @@ public:
using QDialog::open;
void open(QObject *receiver, const char *member);
- QSize minimumSizeHint() const Q_DECL_OVERRIDE;
- QSize sizeHint() const Q_DECL_OVERRIDE;
+ QSize minimumSizeHint() const override;
+ QSize sizeHint() const override;
- void setVisible(bool visible) Q_DECL_OVERRIDE;
+ void setVisible(bool visible) override;
static QString getText(QWidget *parent, const QString &title, const QString &label,
QLineEdit::EchoMode echo = QLineEdit::Normal,
- const QString &text = QString(), bool *ok = Q_NULLPTR,
+ const QString &text = QString(), bool *ok = nullptr,
Qt::WindowFlags flags = Qt::WindowFlags(),
Qt::InputMethodHints inputMethodHints = Qt::ImhNone);
static QString getMultiLineText(QWidget *parent, const QString &title, const QString &label,
- const QString &text = QString(), bool *ok = Q_NULLPTR,
+ const QString &text = QString(), bool *ok = nullptr,
Qt::WindowFlags flags = Qt::WindowFlags(),
Qt::InputMethodHints inputMethodHints = Qt::ImhNone);
static QString getItem(QWidget *parent, const QString &title, const QString &label,
const QStringList &items, int current = 0, bool editable = true,
- bool *ok = Q_NULLPTR, Qt::WindowFlags flags = Qt::WindowFlags(),
+ bool *ok = nullptr, Qt::WindowFlags flags = Qt::WindowFlags(),
Qt::InputMethodHints inputMethodHints = Qt::ImhNone);
static int getInt(QWidget *parent, const QString &title, const QString &label, int value = 0,
int minValue = -2147483647, int maxValue = 2147483647,
- int step = 1, bool *ok = Q_NULLPTR, Qt::WindowFlags flags = Qt::WindowFlags());
+ int step = 1, bool *ok = nullptr, Qt::WindowFlags flags = Qt::WindowFlags());
static double getDouble(QWidget *parent, const QString &title, const QString &label, double value = 0,
double minValue = -2147483647, double maxValue = 2147483647,
- int decimals = 1, bool *ok = Q_NULLPTR, Qt::WindowFlags flags = Qt::WindowFlags());
+ int decimals = 1, bool *ok = nullptr, Qt::WindowFlags flags = Qt::WindowFlags());
// ### Qt 6: merge overloads
static double getDouble(QWidget *parent, const QString &title, const QString &label, double value,
double minValue, double maxValue, int decimals, bool *ok, Qt::WindowFlags flags,
@@ -187,7 +187,7 @@ public:
#if QT_DEPRECATED_SINCE(5, 0)
QT_DEPRECATED static inline int getInteger(QWidget *parent, const QString &title, const QString &label, int value = 0,
int minValue = -2147483647, int maxValue = 2147483647,
- int step = 1, bool *ok = Q_NULLPTR, Qt::WindowFlags flags = Qt::WindowFlags())
+ int step = 1, bool *ok = nullptr, Qt::WindowFlags flags = Qt::WindowFlags())
{
return getInt(parent, title, label, value, minValue, maxValue, step, ok, flags);
}
@@ -206,7 +206,7 @@ Q_SIGNALS:
void doubleValueSelected(double value);
public:
- void done(int result) Q_DECL_OVERRIDE;
+ void done(int result) override;
private:
Q_DISABLE_COPY(QInputDialog)
diff --git a/src/widgets/dialogs/qmessagebox.cpp b/src/widgets/dialogs/qmessagebox.cpp
index fdfffb45cf..190ce93439 100644
--- a/src/widgets/dialogs/qmessagebox.cpp
+++ b/src/widgets/dialogs/qmessagebox.cpp
@@ -98,7 +98,7 @@ public:
public:
TextEdit(QWidget *parent=0) : QTextEdit(parent) { }
#ifndef QT_NO_CONTEXTMENU
- void contextMenuEvent(QContextMenuEvent * e) Q_DECL_OVERRIDE
+ void contextMenuEvent(QContextMenuEvent * e) override
{
QMenu *menu = createStandardContextMenu();
menu->setAttribute(Qt::WA_DeleteOnClose);
@@ -173,7 +173,7 @@ public:
void setLabel(DetailButtonLabel lbl)
{ setText(label(lbl)); }
- QSize sizeHint() const Q_DECL_OVERRIDE
+ QSize sizeHint() const override
{
ensurePolished();
QStyleOptionButton opt;
@@ -259,9 +259,9 @@ public:
QByteArray signalToDisconnectOnClose;
QSharedPointer<QMessageDialogOptions> options;
private:
- void initHelper(QPlatformDialogHelper *) Q_DECL_OVERRIDE;
- void helperPrepareShow(QPlatformDialogHelper *) Q_DECL_OVERRIDE;
- void helperDone(QDialog::DialogCode, QPlatformDialogHelper *) Q_DECL_OVERRIDE;
+ void initHelper(QPlatformDialogHelper *) override;
+ void helperPrepareShow(QPlatformDialogHelper *) override;
+ void helperDone(QDialog::DialogCode, QPlatformDialogHelper *) override;
};
void QMessageBoxPrivate::init(const QString &title, const QString &text)
@@ -2608,7 +2608,7 @@ QPixmap QMessageBoxPrivate::standardIcon(QMessageBox::Icon icon, QMessageBox *mb
break;
}
if (!tmpIcon.isNull()) {
- QWindow *window = Q_NULLPTR;
+ QWindow *window = nullptr;
if (mb) {
window = mb->windowHandle();
if (!window) {
diff --git a/src/widgets/dialogs/qmessagebox.h b/src/widgets/dialogs/qmessagebox.h
index fd7d7936b6..4b993a9e65 100644
--- a/src/widgets/dialogs/qmessagebox.h
+++ b/src/widgets/dialogs/qmessagebox.h
@@ -132,9 +132,9 @@ public:
Q_DECLARE_FLAGS(StandardButtons, StandardButton)
Q_FLAG(StandardButtons)
- explicit QMessageBox(QWidget *parent = Q_NULLPTR);
+ explicit QMessageBox(QWidget *parent = nullptr);
QMessageBox(Icon icon, const QString &title, const QString &text,
- StandardButtons buttons = NoButton, QWidget *parent = Q_NULLPTR,
+ StandardButtons buttons = NoButton, QWidget *parent = nullptr,
Qt::WindowFlags flags = Qt::Dialog | Qt::MSWindowsFixedSizeDialogHint);
~QMessageBox();
@@ -201,7 +201,7 @@ public:
QMessageBox(const QString &title, const QString &text, Icon icon,
int button0, int button1, int button2,
- QWidget *parent = Q_NULLPTR,
+ QWidget *parent = nullptr,
Qt::WindowFlags f = Qt::Dialog | Qt::MSWindowsFixedSizeDialogHint);
static int information(QWidget *parent, const QString &title,
@@ -290,12 +290,12 @@ public Q_SLOTS:
#endif
protected:
- bool event(QEvent *e) Q_DECL_OVERRIDE;
- void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE;
- void showEvent(QShowEvent *event) Q_DECL_OVERRIDE;
- void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE;
- void keyPressEvent(QKeyEvent *event) Q_DECL_OVERRIDE;
- void changeEvent(QEvent *event) Q_DECL_OVERRIDE;
+ bool event(QEvent *e) override;
+ void resizeEvent(QResizeEvent *event) override;
+ void showEvent(QShowEvent *event) override;
+ void closeEvent(QCloseEvent *event) override;
+ void keyPressEvent(QKeyEvent *event) override;
+ void changeEvent(QEvent *event) override;
private:
Q_PRIVATE_SLOT(d_func(), void _q_buttonClicked(QAbstractButton *))
diff --git a/src/widgets/dialogs/qprogressdialog.h b/src/widgets/dialogs/qprogressdialog.h
index 902a4de5d2..74adb6bd84 100644
--- a/src/widgets/dialogs/qprogressdialog.h
+++ b/src/widgets/dialogs/qprogressdialog.h
@@ -68,9 +68,9 @@ class Q_WIDGETS_EXPORT QProgressDialog : public QDialog
Q_PROPERTY(QString labelText READ labelText WRITE setLabelText)
public:
- explicit QProgressDialog(QWidget *parent = Q_NULLPTR, Qt::WindowFlags flags = Qt::WindowFlags());
+ explicit QProgressDialog(QWidget *parent = nullptr, Qt::WindowFlags flags = Qt::WindowFlags());
QProgressDialog(const QString &labelText, const QString &cancelButtonText,
- int minimum, int maximum, QWidget *parent = Q_NULLPTR,
+ int minimum, int maximum, QWidget *parent = nullptr,
Qt::WindowFlags flags = Qt::WindowFlags());
~QProgressDialog();
@@ -85,7 +85,7 @@ public:
int value() const;
- QSize sizeHint() const Q_DECL_OVERRIDE;
+ QSize sizeHint() const override;
QString labelText() const;
int minimumDuration() const;
@@ -113,10 +113,10 @@ Q_SIGNALS:
void canceled();
protected:
- void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE;
- void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE;
- void changeEvent(QEvent *event) Q_DECL_OVERRIDE;
- void showEvent(QShowEvent *event) Q_DECL_OVERRIDE;
+ void resizeEvent(QResizeEvent *event) override;
+ void closeEvent(QCloseEvent *event) override;
+ void changeEvent(QEvent *event) override;
+ void showEvent(QShowEvent *event) override;
protected Q_SLOTS:
void forceShow();
diff --git a/src/widgets/dialogs/qsidebar_p.h b/src/widgets/dialogs/qsidebar_p.h
index 1f27d477a8..07aaa5abd2 100644
--- a/src/widgets/dialogs/qsidebar_p.h
+++ b/src/widgets/dialogs/qsidebar_p.h
@@ -69,7 +69,7 @@ class QSideBarDelegate : public QStyledItemDelegate
public:
QSideBarDelegate(QWidget *parent = 0) : QStyledItemDelegate(parent) {}
void initStyleOption(QStyleOptionViewItem *option,
- const QModelIndex &index) const Q_DECL_OVERRIDE;
+ const QModelIndex &index) const override;
};
class Q_AUTOTEST_EXPORT QUrlModel : public QStandardItemModel
@@ -84,14 +84,14 @@ public:
QUrlModel(QObject *parent = 0);
- QStringList mimeTypes() const Q_DECL_OVERRIDE;
- QMimeData *mimeData(const QModelIndexList &indexes) const Q_DECL_OVERRIDE;
+ QStringList mimeTypes() const override;
+ QMimeData *mimeData(const QModelIndexList &indexes) const override;
#ifndef QT_NO_DRAGANDDROP
bool canDrop(QDragEnterEvent *event);
- bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) Q_DECL_OVERRIDE;
+ bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override;
#endif
- Qt::ItemFlags flags(const QModelIndex &index) const Q_DECL_OVERRIDE;
- bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) Q_DECL_OVERRIDE;
+ Qt::ItemFlags flags(const QModelIndex &index) const override;
+ bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override;
void setUrls(const QList<QUrl> &list);
void addUrls(const QList<QUrl> &urls, int row = -1, bool move = true);
@@ -131,7 +131,7 @@ public:
void setModelAndUrls(QFileSystemModel *model, const QList<QUrl> &newUrls);
~QSidebar();
- QSize sizeHint() const Q_DECL_OVERRIDE;
+ QSize sizeHint() const override;
void setUrls(const QList<QUrl> &list) { urlModel->setUrls(list); }
void addUrls(const QList<QUrl> &list, int row) { urlModel->addUrls(list, row); }
@@ -140,10 +140,10 @@ public:
void selectUrl(const QUrl &url);
protected:
- bool event(QEvent * e) Q_DECL_OVERRIDE;
- void focusInEvent(QFocusEvent *event) Q_DECL_OVERRIDE;
+ bool event(QEvent * e) override;
+ void focusInEvent(QFocusEvent *event) override;
#ifndef QT_NO_DRAGANDDROP
- void dragEnterEvent(QDragEnterEvent *event) Q_DECL_OVERRIDE;
+ void dragEnterEvent(QDragEnterEvent *event) override;
#endif
private Q_SLOTS:
diff --git a/src/widgets/dialogs/qwizard.cpp b/src/widgets/dialogs/qwizard.cpp
index 890069ca1a..3876cf16c6 100644
--- a/src/widgets/dialogs/qwizard.cpp
+++ b/src/widgets/dialogs/qwizard.cpp
@@ -298,7 +298,7 @@ public:
Qt::TextFormat titleFormat, Qt::TextFormat subTitleFormat);
protected:
- void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
+ void paintEvent(QPaintEvent *event) override;
#if QT_CONFIG(style_windowsvista)
private:
bool vistaDisabled() const;
@@ -454,7 +454,7 @@ public:
m_layout->addWidget(m_sideWidget);
}
- QSize minimumSizeHint() const Q_DECL_OVERRIDE {
+ QSize minimumSizeHint() const override {
if (pixmap() && !pixmap()->isNull())
return pixmap()->size();
return QFrame::minimumSizeHint();
@@ -579,7 +579,7 @@ public:
, bottomRuler(0)
#if QT_CONFIG(style_windowsvista)
, vistaHelper(0)
- , vistaInitPending(false)
+ , vistaInitPending(true)
, vistaState(QVistaHelper::Dirty)
, vistaStateChanged(false)
, inHandleAeroStyleChange(false)
@@ -590,12 +590,6 @@ public:
, maximumHeight(QWIDGETSIZE_MAX)
{
std::fill(btns, btns + QWizard::NButtons, static_cast<QAbstractButton *>(0));
-
-#if QT_CONFIG(style_windowsvista)
- if (QSysInfo::WindowsVersion >= QSysInfo::WV_VISTA
- && (QSysInfo::WindowsVersion & QSysInfo::WV_NT_based))
- vistaInitPending = true;
-#endif
}
void init();
diff --git a/src/widgets/dialogs/qwizard.h b/src/widgets/dialogs/qwizard.h
index 4d03bf91d4..0dd837b197 100644
--- a/src/widgets/dialogs/qwizard.h
+++ b/src/widgets/dialogs/qwizard.h
@@ -120,7 +120,7 @@ public:
Q_DECLARE_FLAGS(WizardOptions, WizardOption)
Q_FLAG(WizardOptions)
- explicit QWizard(QWidget *parent = Q_NULLPTR, Qt::WindowFlags flags = Qt::WindowFlags());
+ explicit QWizard(QWidget *parent = nullptr, Qt::WindowFlags flags = Qt::WindowFlags());
~QWizard();
int addPage(QWizardPage *page);
@@ -168,8 +168,8 @@ public:
void setDefaultProperty(const char *className, const char *property,
const char *changedSignal);
- void setVisible(bool visible) Q_DECL_OVERRIDE;
- QSize sizeHint() const Q_DECL_OVERRIDE;
+ void setVisible(bool visible) override;
+ QSize sizeHint() const override;
Q_SIGNALS:
void currentIdChanged(int id);
@@ -184,13 +184,13 @@ public Q_SLOTS:
void restart();
protected:
- bool event(QEvent *event) Q_DECL_OVERRIDE;
- void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE;
- void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
+ bool event(QEvent *event) override;
+ void resizeEvent(QResizeEvent *event) override;
+ void paintEvent(QPaintEvent *event) override;
#if defined(Q_OS_WIN) || defined(Q_CLANG_QDOC)
- bool nativeEvent(const QByteArray &eventType, void *message, long *result) Q_DECL_OVERRIDE;
+ bool nativeEvent(const QByteArray &eventType, void *message, long *result) override;
#endif
- void done(int result) Q_DECL_OVERRIDE;
+ void done(int result) override;
virtual void initializePage(int id);
virtual void cleanupPage(int id);
@@ -215,7 +215,7 @@ class Q_WIDGETS_EXPORT QWizardPage : public QWidget
Q_PROPERTY(QString subTitle READ subTitle WRITE setSubTitle)
public:
- explicit QWizardPage(QWidget *parent = Q_NULLPTR);
+ explicit QWizardPage(QWidget *parent = nullptr);
~QWizardPage();
void setTitle(const QString &title);
@@ -243,8 +243,8 @@ Q_SIGNALS:
protected:
void setField(const QString &name, const QVariant &value);
QVariant field(const QString &name) const;
- void registerField(const QString &name, QWidget *widget, const char *property = Q_NULLPTR,
- const char *changedSignal = Q_NULLPTR);
+ void registerField(const QString &name, QWidget *widget, const char *property = nullptr,
+ const char *changedSignal = nullptr);
QWizard *wizard() const;
private:
diff --git a/src/widgets/dialogs/qwizard_win.cpp b/src/widgets/dialogs/qwizard_win.cpp
index 666b192e9c..6ca4541980 100644
--- a/src/widgets/dialogs/qwizard_win.cpp
+++ b/src/widgets/dialogs/qwizard_win.cpp
@@ -154,10 +154,7 @@ QVistaHelper::QVistaHelper(QWizard *wizard)
backButton_ = new QVistaBackButton(wizard);
backButton_->hide();
- // Handle diff between Windows 7 and Vista
iconSpacing = QStyleHelper::dpiScaled(7);
- textSpacing = QSysInfo::WindowsVersion >= QSysInfo::WV_WINDOWS7 ?
- iconSpacing : QStyleHelper::dpiScaled(20);
}
QVistaHelper::~QVistaHelper()
@@ -695,7 +692,7 @@ int QVistaHelper::captionSizeDp()
int QVistaHelper::titleOffset()
{
- int iconOffset = wizard ->windowIcon().isNull() ? 0 : iconSize() + textSpacing;
+ int iconOffset = wizard ->windowIcon().isNull() ? 0 : iconSize() + iconSpacing;
return leftMargin() + iconOffset;
}
diff --git a/src/widgets/dialogs/qwizard_win_p.h b/src/widgets/dialogs/qwizard_win_p.h
index f9122865c2..7ca4899a1f 100644
--- a/src/widgets/dialogs/qwizard_win_p.h
+++ b/src/widgets/dialogs/qwizard_win_p.h
@@ -104,8 +104,7 @@ public:
static int titleBarSize() { return QVistaHelper::titleBarSizeDp() / QVistaHelper::m_devicePixelRatio; }
static int titleBarSizeDp() { return QVistaHelper::frameSizeDp() + QVistaHelper::captionSizeDp(); }
static int topPadding() { // padding under text
- return int(QStyleHelper::dpiScaled(
- QSysInfo::WindowsVersion >= QSysInfo::WV_WINDOWS7 ? 4 : 6));
+ return int(QStyleHelper::dpiScaled(4));
}
static int topOffset();
@@ -150,7 +149,6 @@ private:
int titleBarOffset; // Extra spacing above the text
int iconSpacing; // Space between button and icon
- int textSpacing; // Space between icon and text
static int m_devicePixelRatio;
};
diff --git a/src/widgets/effects/qgraphicseffect.h b/src/widgets/effects/qgraphicseffect.h
index 78d025ded5..f7c0769778 100644
--- a/src/widgets/effects/qgraphicseffect.h
+++ b/src/widgets/effects/qgraphicseffect.h
@@ -79,7 +79,7 @@ public:
PadToEffectiveBoundingRect
};
- QGraphicsEffect(QObject *parent = Q_NULLPTR);
+ QGraphicsEffect(QObject *parent = nullptr);
virtual ~QGraphicsEffect();
virtual QRectF boundingRectFor(const QRectF &sourceRect) const;
@@ -95,7 +95,7 @@ Q_SIGNALS:
void enabledChanged(bool enabled);
protected:
- QGraphicsEffect(QGraphicsEffectPrivate &d, QObject *parent = Q_NULLPTR);
+ QGraphicsEffect(QGraphicsEffectPrivate &d, QObject *parent = nullptr);
virtual void draw(QPainter *painter) = 0;
virtual void sourceChanged(ChangeFlags flags);
void updateBoundingRect();
@@ -104,7 +104,7 @@ protected:
QRectF sourceBoundingRect(Qt::CoordinateSystem system = Qt::LogicalCoordinates) const;
void drawSource(QPainter *painter);
QPixmap sourcePixmap(Qt::CoordinateSystem system = Qt::LogicalCoordinates,
- QPoint *offset = Q_NULLPTR,
+ QPoint *offset = nullptr,
PixmapPadMode mode = PadToEffectiveBoundingRect) const;
private:
@@ -129,7 +129,7 @@ class Q_WIDGETS_EXPORT QGraphicsColorizeEffect: public QGraphicsEffect
Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
Q_PROPERTY(qreal strength READ strength WRITE setStrength NOTIFY strengthChanged)
public:
- QGraphicsColorizeEffect(QObject *parent = Q_NULLPTR);
+ QGraphicsColorizeEffect(QObject *parent = nullptr);
~QGraphicsColorizeEffect();
QColor color() const;
@@ -144,7 +144,7 @@ Q_SIGNALS:
void strengthChanged(qreal strength);
protected:
- void draw(QPainter *painter) Q_DECL_OVERRIDE;
+ void draw(QPainter *painter) override;
private:
Q_DECLARE_PRIVATE(QGraphicsColorizeEffect)
@@ -167,10 +167,10 @@ public:
Q_DECLARE_FLAGS(BlurHints, BlurHint)
Q_FLAG(BlurHints)
- QGraphicsBlurEffect(QObject *parent = Q_NULLPTR);
+ QGraphicsBlurEffect(QObject *parent = nullptr);
~QGraphicsBlurEffect();
- QRectF boundingRectFor(const QRectF &rect) const Q_DECL_OVERRIDE;
+ QRectF boundingRectFor(const QRectF &rect) const override;
qreal blurRadius() const;
BlurHints blurHints() const;
@@ -183,7 +183,7 @@ Q_SIGNALS:
void blurHintsChanged(BlurHints hints);
protected:
- void draw(QPainter *painter) Q_DECL_OVERRIDE;
+ void draw(QPainter *painter) override;
private:
Q_DECLARE_PRIVATE(QGraphicsBlurEffect)
@@ -202,10 +202,10 @@ class Q_WIDGETS_EXPORT QGraphicsDropShadowEffect: public QGraphicsEffect
Q_PROPERTY(qreal blurRadius READ blurRadius WRITE setBlurRadius NOTIFY blurRadiusChanged)
Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
public:
- QGraphicsDropShadowEffect(QObject *parent = Q_NULLPTR);
+ QGraphicsDropShadowEffect(QObject *parent = nullptr);
~QGraphicsDropShadowEffect();
- QRectF boundingRectFor(const QRectF &rect) const Q_DECL_OVERRIDE;
+ QRectF boundingRectFor(const QRectF &rect) const override;
QPointF offset() const;
inline qreal xOffset() const
@@ -241,7 +241,7 @@ Q_SIGNALS:
void colorChanged(const QColor &color);
protected:
- void draw(QPainter *painter) Q_DECL_OVERRIDE;
+ void draw(QPainter *painter) override;
private:
Q_DECLARE_PRIVATE(QGraphicsDropShadowEffect)
@@ -255,7 +255,7 @@ class Q_WIDGETS_EXPORT QGraphicsOpacityEffect: public QGraphicsEffect
Q_PROPERTY(qreal opacity READ opacity WRITE setOpacity NOTIFY opacityChanged)
Q_PROPERTY(QBrush opacityMask READ opacityMask WRITE setOpacityMask NOTIFY opacityMaskChanged)
public:
- QGraphicsOpacityEffect(QObject *parent = Q_NULLPTR);
+ QGraphicsOpacityEffect(QObject *parent = nullptr);
~QGraphicsOpacityEffect();
qreal opacity() const;
@@ -270,7 +270,7 @@ Q_SIGNALS:
void opacityMaskChanged(const QBrush &mask);
protected:
- void draw(QPainter *painter) Q_DECL_OVERRIDE;
+ void draw(QPainter *painter) override;
private:
Q_DECLARE_PRIVATE(QGraphicsOpacityEffect)
diff --git a/src/widgets/effects/qpixmapfilter_p.h b/src/widgets/effects/qpixmapfilter_p.h
index 399a835142..0f582bde60 100644
--- a/src/widgets/effects/qpixmapfilter_p.h
+++ b/src/widgets/effects/qpixmapfilter_p.h
@@ -105,8 +105,8 @@ public:
void setConvolutionKernel(const qreal *matrix, int rows, int columns);
- QRectF boundingRectFor(const QRectF &rect) const Q_DECL_OVERRIDE;
- void draw(QPainter *painter, const QPointF &dest, const QPixmap &src, const QRectF &srcRect = QRectF()) const Q_DECL_OVERRIDE;
+ QRectF boundingRectFor(const QRectF &rect) const override;
+ void draw(QPainter *painter, const QPointF &dest, const QPixmap &src, const QRectF &srcRect = QRectF()) const override;
private:
friend class QGLPixmapConvolutionFilter;
@@ -133,8 +133,8 @@ public:
qreal radius() const;
QGraphicsBlurEffect::BlurHints blurHints() const;
- QRectF boundingRectFor(const QRectF &rect) const Q_DECL_OVERRIDE;
- void draw(QPainter *painter, const QPointF &dest, const QPixmap &src, const QRectF &srcRect = QRectF()) const Q_DECL_OVERRIDE;
+ QRectF boundingRectFor(const QRectF &rect) const override;
+ void draw(QPainter *painter, const QPointF &dest, const QPixmap &src, const QRectF &srcRect = QRectF()) const override;
private:
friend class QGLPixmapBlurFilter;
@@ -157,7 +157,7 @@ public:
void setStrength(qreal strength);
qreal strength() const;
- void draw(QPainter *painter, const QPointF &dest, const QPixmap &src, const QRectF &srcRect = QRectF()) const Q_DECL_OVERRIDE;
+ void draw(QPainter *painter, const QPointF &dest, const QPixmap &src, const QRectF &srcRect = QRectF()) const override;
};
class QPixmapDropShadowFilterPrivate;
@@ -171,8 +171,8 @@ public:
QPixmapDropShadowFilter(QObject *parent = 0);
~QPixmapDropShadowFilter();
- QRectF boundingRectFor(const QRectF &rect) const Q_DECL_OVERRIDE;
- void draw(QPainter *p, const QPointF &pos, const QPixmap &px, const QRectF &src = QRectF()) const Q_DECL_OVERRIDE;
+ QRectF boundingRectFor(const QRectF &rect) const override;
+ void draw(QPainter *p, const QPointF &pos, const QPixmap &px, const QRectF &src = QRectF()) const override;
qreal blurRadius() const;
void setBlurRadius(qreal radius);
diff --git a/src/widgets/graphicsview/qgraphicsanchorlayout.h b/src/widgets/graphicsview/qgraphicsanchorlayout.h
index 01dc30718a..e392be1568 100644
--- a/src/widgets/graphicsview/qgraphicsanchorlayout.h
+++ b/src/widgets/graphicsview/qgraphicsanchorlayout.h
@@ -76,7 +76,7 @@ private:
class Q_WIDGETS_EXPORT QGraphicsAnchorLayout : public QGraphicsLayout
{
public:
- QGraphicsAnchorLayout(QGraphicsLayoutItem *parent = Q_NULLPTR);
+ QGraphicsAnchorLayout(QGraphicsLayoutItem *parent = nullptr);
virtual ~QGraphicsAnchorLayout();
QGraphicsAnchor *addAnchor(QGraphicsLayoutItem *firstItem, Qt::AnchorPoint firstEdge,
@@ -97,14 +97,14 @@ public:
qreal horizontalSpacing() const;
qreal verticalSpacing() const;
- void removeAt(int index) Q_DECL_OVERRIDE;
- void setGeometry(const QRectF &rect) Q_DECL_OVERRIDE;
- int count() const Q_DECL_OVERRIDE;
- QGraphicsLayoutItem *itemAt(int index) const Q_DECL_OVERRIDE;
+ void removeAt(int index) override;
+ void setGeometry(const QRectF &rect) override;
+ int count() const override;
+ QGraphicsLayoutItem *itemAt(int index) const override;
- void invalidate() Q_DECL_OVERRIDE;
+ void invalidate() override;
protected:
- QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const Q_DECL_OVERRIDE;
+ QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const override;
private:
Q_DISABLE_COPY(QGraphicsAnchorLayout)
diff --git a/src/widgets/graphicsview/qgraphicsanchorlayout_p.h b/src/widgets/graphicsview/qgraphicsanchorlayout_p.h
index e785b486bb..6b2408b2eb 100644
--- a/src/widgets/graphicsview/qgraphicsanchorlayout_p.h
+++ b/src/widgets/graphicsview/qgraphicsanchorlayout_p.h
@@ -198,7 +198,7 @@ struct SequentialAnchorData : public AnchorData
#endif
}
- virtual void updateChildrenSizes() Q_DECL_OVERRIDE;
+ virtual void updateChildrenSizes() override;
void calculateSizeHints();
QVector<AnchorVertex*> m_children; // list of vertices in the sequence
@@ -226,7 +226,7 @@ struct ParallelAnchorData : public AnchorData
#endif
}
- virtual void updateChildrenSizes() Q_DECL_OVERRIDE;
+ virtual void updateChildrenSizes() override;
bool calculateSizeHints();
bool secondForward() const {
diff --git a/src/widgets/graphicsview/qgraphicsgridlayout.h b/src/widgets/graphicsview/qgraphicsgridlayout.h
index fb9bc2e32c..4c0a1b4527 100644
--- a/src/widgets/graphicsview/qgraphicsgridlayout.h
+++ b/src/widgets/graphicsview/qgraphicsgridlayout.h
@@ -53,7 +53,7 @@ class QGraphicsGridLayoutPrivate;
class Q_WIDGETS_EXPORT QGraphicsGridLayout : public QGraphicsLayout
{
public:
- QGraphicsGridLayout(QGraphicsLayoutItem *parent = Q_NULLPTR);
+ QGraphicsGridLayout(QGraphicsLayoutItem *parent = nullptr);
virtual ~QGraphicsGridLayout();
void addItem(QGraphicsLayoutItem *item, int row, int column, int rowSpan, int columnSpan,
@@ -106,16 +106,16 @@ public:
QGraphicsLayoutItem *itemAt(int row, int column) const;
// inherited from QGraphicsLayout
- int count() const Q_DECL_OVERRIDE;
- QGraphicsLayoutItem *itemAt(int index) const Q_DECL_OVERRIDE;
- void removeAt(int index) Q_DECL_OVERRIDE;
+ int count() const override;
+ QGraphicsLayoutItem *itemAt(int index) const override;
+ void removeAt(int index) override;
void removeItem(QGraphicsLayoutItem *item);
- void invalidate() Q_DECL_OVERRIDE;
+ void invalidate() override;
// inherited from QGraphicsLayoutItem
- void setGeometry(const QRectF &rect) Q_DECL_OVERRIDE;
- QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const Q_DECL_OVERRIDE;
+ void setGeometry(const QRectF &rect) override;
+ QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const override;
// ####
//QRect cellRect(int row, int column, int rowSpan = 1, int columnSpan = 1) const;
diff --git a/src/widgets/graphicsview/qgraphicsgridlayoutengine_p.h b/src/widgets/graphicsview/qgraphicsgridlayoutengine_p.h
index d797f784b8..370df9eed7 100644
--- a/src/widgets/graphicsview/qgraphicsgridlayoutengine_p.h
+++ b/src/widgets/graphicsview/qgraphicsgridlayoutengine_p.h
@@ -71,35 +71,35 @@ public:
Qt::Alignment alignment = 0)
: QGridLayoutItem(row, columns, rowSpan, columnSpan, alignment), q_layoutItem(item) {}
- virtual QLayoutPolicy::Policy sizePolicy(Qt::Orientation orientation) const Q_DECL_OVERRIDE
+ virtual QLayoutPolicy::Policy sizePolicy(Qt::Orientation orientation) const override
{
QSizePolicy sizePolicy(q_layoutItem->sizePolicy());
return (QLayoutPolicy::Policy)((orientation == Qt::Horizontal) ? sizePolicy.horizontalPolicy()
: sizePolicy.verticalPolicy());
}
- virtual QLayoutPolicy::ControlTypes controlTypes(LayoutSide) const Q_DECL_OVERRIDE
+ virtual QLayoutPolicy::ControlTypes controlTypes(LayoutSide) const override
{
const QSizePolicy::ControlType ct = q_layoutItem->sizePolicy().controlType();
return (QLayoutPolicy::ControlTypes)ct;
}
- virtual QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint) const Q_DECL_OVERRIDE
+ virtual QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint) const override
{
return q_layoutItem->effectiveSizeHint(which, constraint);
}
bool isHidden() const;
- virtual bool isIgnored() const Q_DECL_OVERRIDE;
+ virtual bool isIgnored() const override;
- virtual void setGeometry(const QRectF &rect) Q_DECL_OVERRIDE
+ virtual void setGeometry(const QRectF &rect) override
{
q_layoutItem->setGeometry(rect);
}
- virtual bool hasDynamicConstraint() const Q_DECL_OVERRIDE;
- virtual Qt::Orientation dynamicConstraintOrientation() const Q_DECL_OVERRIDE;
+ virtual bool hasDynamicConstraint() const override;
+ virtual Qt::Orientation dynamicConstraintOrientation() const override;
QGraphicsLayoutItem *layoutItem() const { return q_layoutItem; }
diff --git a/src/widgets/graphicsview/qgraphicsitem.h b/src/widgets/graphicsview/qgraphicsitem.h
index 11d872f6e6..47ef5ba80e 100644
--- a/src/widgets/graphicsview/qgraphicsitem.h
+++ b/src/widgets/graphicsview/qgraphicsitem.h
@@ -158,7 +158,7 @@ public:
SceneModal
};
- explicit QGraphicsItem(QGraphicsItem *parent = Q_NULLPTR);
+ explicit QGraphicsItem(QGraphicsItem *parent = nullptr);
virtual ~QGraphicsItem();
QGraphicsScene *scene() const;
@@ -194,7 +194,7 @@ public:
PanelModality panelModality() const;
void setPanelModality(PanelModality panelModality);
- bool isBlockedByModalPanel(QGraphicsItem **blockingPanel = Q_NULLPTR) const;
+ bool isBlockedByModalPanel(QGraphicsItem **blockingPanel = nullptr) const;
#ifndef QT_NO_TOOLTIP
QString toolTip() const;
@@ -290,7 +290,7 @@ public:
QTransform transform() const;
QTransform sceneTransform() const;
QTransform deviceTransform(const QTransform &viewportTransform) const;
- QTransform itemTransform(const QGraphicsItem *other, bool *ok = Q_NULLPTR) const;
+ QTransform itemTransform(const QGraphicsItem *other, bool *ok = nullptr) const;
void setTransform(const QTransform &matrix, bool combine = false);
void resetTransform();
#if QT_DEPRECATED_SINCE(5, 0)
@@ -341,7 +341,7 @@ public:
void setBoundingRegionGranularity(qreal granularity);
// Drawing
- virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = Q_NULLPTR) = 0;
+ virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr) = 0;
void update(const QRectF &rect = QRectF());
inline void update(qreal x, qreal y, qreal width, qreal height);
void scroll(qreal dx, qreal dy, const QRectF &rect = QRectF());
@@ -558,7 +558,7 @@ class Q_WIDGETS_EXPORT QGraphicsObject : public QObject, public QGraphicsItem
Q_CLASSINFO("DefaultProperty", "children")
Q_INTERFACES(QGraphicsItem)
public:
- explicit QGraphicsObject(QGraphicsItem *parent = Q_NULLPTR);
+ explicit QGraphicsObject(QGraphicsItem *parent = nullptr);
~QGraphicsObject();
using QObject::children;
@@ -588,7 +588,7 @@ Q_SIGNALS:
protected:
QGraphicsObject(QGraphicsItemPrivate &dd, QGraphicsItem *parent);
- bool event(QEvent *ev) Q_DECL_OVERRIDE;
+ bool event(QEvent *ev) override;
private:
friend class QGraphicsItem;
@@ -600,7 +600,7 @@ class QAbstractGraphicsShapeItemPrivate;
class Q_WIDGETS_EXPORT QAbstractGraphicsShapeItem : public QGraphicsItem
{
public:
- explicit QAbstractGraphicsShapeItem(QGraphicsItem *parent = Q_NULLPTR);
+ explicit QAbstractGraphicsShapeItem(QGraphicsItem *parent = nullptr);
~QAbstractGraphicsShapeItem();
QPen pen() const;
@@ -609,8 +609,8 @@ public:
QBrush brush() const;
void setBrush(const QBrush &brush);
- bool isObscuredBy(const QGraphicsItem *item) const Q_DECL_OVERRIDE;
- QPainterPath opaqueArea() const Q_DECL_OVERRIDE;
+ bool isObscuredBy(const QGraphicsItem *item) const override;
+ QPainterPath opaqueArea() const override;
protected:
QAbstractGraphicsShapeItem(QAbstractGraphicsShapeItemPrivate &dd,
@@ -625,29 +625,29 @@ class QGraphicsPathItemPrivate;
class Q_WIDGETS_EXPORT QGraphicsPathItem : public QAbstractGraphicsShapeItem
{
public:
- explicit QGraphicsPathItem(QGraphicsItem *parent = Q_NULLPTR);
- explicit QGraphicsPathItem(const QPainterPath &path, QGraphicsItem *parent = Q_NULLPTR);
+ explicit QGraphicsPathItem(QGraphicsItem *parent = nullptr);
+ explicit QGraphicsPathItem(const QPainterPath &path, QGraphicsItem *parent = nullptr);
~QGraphicsPathItem();
QPainterPath path() const;
void setPath(const QPainterPath &path);
- QRectF boundingRect() const Q_DECL_OVERRIDE;
- QPainterPath shape() const Q_DECL_OVERRIDE;
- bool contains(const QPointF &point) const Q_DECL_OVERRIDE;
+ QRectF boundingRect() const override;
+ QPainterPath shape() const override;
+ bool contains(const QPointF &point) const override;
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = Q_NULLPTR) Q_DECL_OVERRIDE;
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr) override;
- bool isObscuredBy(const QGraphicsItem *item) const Q_DECL_OVERRIDE;
- QPainterPath opaqueArea() const Q_DECL_OVERRIDE;
+ bool isObscuredBy(const QGraphicsItem *item) const override;
+ QPainterPath opaqueArea() const override;
enum { Type = 2 };
- int type() const Q_DECL_OVERRIDE;
+ int type() const override;
protected:
- bool supportsExtension(Extension extension) const Q_DECL_OVERRIDE;
- void setExtension(Extension extension, const QVariant &variant) Q_DECL_OVERRIDE;
- QVariant extension(const QVariant &variant) const Q_DECL_OVERRIDE;
+ bool supportsExtension(Extension extension) const override;
+ void setExtension(Extension extension, const QVariant &variant) override;
+ QVariant extension(const QVariant &variant) const override;
private:
Q_DISABLE_COPY(QGraphicsPathItem)
@@ -658,31 +658,31 @@ class QGraphicsRectItemPrivate;
class Q_WIDGETS_EXPORT QGraphicsRectItem : public QAbstractGraphicsShapeItem
{
public:
- explicit QGraphicsRectItem(QGraphicsItem *parent = Q_NULLPTR);
- explicit QGraphicsRectItem(const QRectF &rect, QGraphicsItem *parent = Q_NULLPTR);
- explicit QGraphicsRectItem(qreal x, qreal y, qreal w, qreal h, QGraphicsItem *parent = Q_NULLPTR);
+ explicit QGraphicsRectItem(QGraphicsItem *parent = nullptr);
+ explicit QGraphicsRectItem(const QRectF &rect, QGraphicsItem *parent = nullptr);
+ explicit QGraphicsRectItem(qreal x, qreal y, qreal w, qreal h, QGraphicsItem *parent = nullptr);
~QGraphicsRectItem();
QRectF rect() const;
void setRect(const QRectF &rect);
inline void setRect(qreal x, qreal y, qreal w, qreal h);
- QRectF boundingRect() const Q_DECL_OVERRIDE;
- QPainterPath shape() const Q_DECL_OVERRIDE;
- bool contains(const QPointF &point) const Q_DECL_OVERRIDE;
+ QRectF boundingRect() const override;
+ QPainterPath shape() const override;
+ bool contains(const QPointF &point) const override;
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = Q_NULLPTR) Q_DECL_OVERRIDE;
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr) override;
- bool isObscuredBy(const QGraphicsItem *item) const Q_DECL_OVERRIDE;
- QPainterPath opaqueArea() const Q_DECL_OVERRIDE;
+ bool isObscuredBy(const QGraphicsItem *item) const override;
+ QPainterPath opaqueArea() const override;
enum { Type = 3 };
- int type() const Q_DECL_OVERRIDE;
+ int type() const override;
protected:
- bool supportsExtension(Extension extension) const Q_DECL_OVERRIDE;
- void setExtension(Extension extension, const QVariant &variant) Q_DECL_OVERRIDE;
- QVariant extension(const QVariant &variant) const Q_DECL_OVERRIDE;
+ bool supportsExtension(Extension extension) const override;
+ void setExtension(Extension extension, const QVariant &variant) override;
+ QVariant extension(const QVariant &variant) const override;
private:
Q_DISABLE_COPY(QGraphicsRectItem)
@@ -696,9 +696,9 @@ class QGraphicsEllipseItemPrivate;
class Q_WIDGETS_EXPORT QGraphicsEllipseItem : public QAbstractGraphicsShapeItem
{
public:
- explicit QGraphicsEllipseItem(QGraphicsItem *parent = Q_NULLPTR);
- explicit QGraphicsEllipseItem(const QRectF &rect, QGraphicsItem *parent = Q_NULLPTR);
- explicit QGraphicsEllipseItem(qreal x, qreal y, qreal w, qreal h, QGraphicsItem *parent = Q_NULLPTR);
+ explicit QGraphicsEllipseItem(QGraphicsItem *parent = nullptr);
+ explicit QGraphicsEllipseItem(const QRectF &rect, QGraphicsItem *parent = nullptr);
+ explicit QGraphicsEllipseItem(qreal x, qreal y, qreal w, qreal h, QGraphicsItem *parent = nullptr);
~QGraphicsEllipseItem();
QRectF rect() const;
@@ -711,22 +711,22 @@ public:
int spanAngle() const;
void setSpanAngle(int angle);
- QRectF boundingRect() const Q_DECL_OVERRIDE;
- QPainterPath shape() const Q_DECL_OVERRIDE;
- bool contains(const QPointF &point) const Q_DECL_OVERRIDE;
+ QRectF boundingRect() const override;
+ QPainterPath shape() const override;
+ bool contains(const QPointF &point) const override;
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = Q_NULLPTR) Q_DECL_OVERRIDE;
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr) override;
- bool isObscuredBy(const QGraphicsItem *item) const Q_DECL_OVERRIDE;
- QPainterPath opaqueArea() const Q_DECL_OVERRIDE;
+ bool isObscuredBy(const QGraphicsItem *item) const override;
+ QPainterPath opaqueArea() const override;
enum { Type = 4 };
- int type() const Q_DECL_OVERRIDE;
+ int type() const override;
protected:
- bool supportsExtension(Extension extension) const Q_DECL_OVERRIDE;
- void setExtension(Extension extension, const QVariant &variant) Q_DECL_OVERRIDE;
- QVariant extension(const QVariant &variant) const Q_DECL_OVERRIDE;
+ bool supportsExtension(Extension extension) const override;
+ void setExtension(Extension extension, const QVariant &variant) override;
+ QVariant extension(const QVariant &variant) const override;
private:
Q_DISABLE_COPY(QGraphicsEllipseItem)
@@ -740,9 +740,9 @@ class QGraphicsPolygonItemPrivate;
class Q_WIDGETS_EXPORT QGraphicsPolygonItem : public QAbstractGraphicsShapeItem
{
public:
- explicit QGraphicsPolygonItem(QGraphicsItem *parent = Q_NULLPTR);
+ explicit QGraphicsPolygonItem(QGraphicsItem *parent = nullptr);
explicit QGraphicsPolygonItem(const QPolygonF &polygon,
- QGraphicsItem *parent = Q_NULLPTR);
+ QGraphicsItem *parent = nullptr);
~QGraphicsPolygonItem();
QPolygonF polygon() const;
@@ -751,22 +751,22 @@ public:
Qt::FillRule fillRule() const;
void setFillRule(Qt::FillRule rule);
- QRectF boundingRect() const Q_DECL_OVERRIDE;
- QPainterPath shape() const Q_DECL_OVERRIDE;
- bool contains(const QPointF &point) const Q_DECL_OVERRIDE;
+ QRectF boundingRect() const override;
+ QPainterPath shape() const override;
+ bool contains(const QPointF &point) const override;
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = Q_NULLPTR) Q_DECL_OVERRIDE;
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr) override;
- bool isObscuredBy(const QGraphicsItem *item) const Q_DECL_OVERRIDE;
- QPainterPath opaqueArea() const Q_DECL_OVERRIDE;
+ bool isObscuredBy(const QGraphicsItem *item) const override;
+ QPainterPath opaqueArea() const override;
enum { Type = 5 };
- int type() const Q_DECL_OVERRIDE;
+ int type() const override;
protected:
- bool supportsExtension(Extension extension) const Q_DECL_OVERRIDE;
- void setExtension(Extension extension, const QVariant &variant) Q_DECL_OVERRIDE;
- QVariant extension(const QVariant &variant) const Q_DECL_OVERRIDE;
+ bool supportsExtension(Extension extension) const override;
+ void setExtension(Extension extension, const QVariant &variant) override;
+ QVariant extension(const QVariant &variant) const override;
private:
Q_DISABLE_COPY(QGraphicsPolygonItem)
@@ -777,9 +777,9 @@ class QGraphicsLineItemPrivate;
class Q_WIDGETS_EXPORT QGraphicsLineItem : public QGraphicsItem
{
public:
- explicit QGraphicsLineItem(QGraphicsItem *parent = Q_NULLPTR);
- explicit QGraphicsLineItem(const QLineF &line, QGraphicsItem *parent = Q_NULLPTR);
- explicit QGraphicsLineItem(qreal x1, qreal y1, qreal x2, qreal y2, QGraphicsItem *parent = Q_NULLPTR);
+ explicit QGraphicsLineItem(QGraphicsItem *parent = nullptr);
+ explicit QGraphicsLineItem(const QLineF &line, QGraphicsItem *parent = nullptr);
+ explicit QGraphicsLineItem(qreal x1, qreal y1, qreal x2, qreal y2, QGraphicsItem *parent = nullptr);
~QGraphicsLineItem();
QPen pen() const;
@@ -790,22 +790,22 @@ public:
inline void setLine(qreal x1, qreal y1, qreal x2, qreal y2)
{ setLine(QLineF(x1, y1, x2, y2)); }
- QRectF boundingRect() const Q_DECL_OVERRIDE;
- QPainterPath shape() const Q_DECL_OVERRIDE;
- bool contains(const QPointF &point) const Q_DECL_OVERRIDE;
+ QRectF boundingRect() const override;
+ QPainterPath shape() const override;
+ bool contains(const QPointF &point) const override;
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = Q_NULLPTR) Q_DECL_OVERRIDE;
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr) override;
- bool isObscuredBy(const QGraphicsItem *item) const Q_DECL_OVERRIDE;
- QPainterPath opaqueArea() const Q_DECL_OVERRIDE;
+ bool isObscuredBy(const QGraphicsItem *item) const override;
+ QPainterPath opaqueArea() const override;
enum { Type = 6 };
- int type() const Q_DECL_OVERRIDE;
+ int type() const override;
protected:
- bool supportsExtension(Extension extension) const Q_DECL_OVERRIDE;
- void setExtension(Extension extension, const QVariant &variant) Q_DECL_OVERRIDE;
- QVariant extension(const QVariant &variant) const Q_DECL_OVERRIDE;
+ bool supportsExtension(Extension extension) const override;
+ void setExtension(Extension extension, const QVariant &variant) override;
+ QVariant extension(const QVariant &variant) const override;
private:
Q_DISABLE_COPY(QGraphicsLineItem)
@@ -822,8 +822,8 @@ public:
HeuristicMaskShape
};
- explicit QGraphicsPixmapItem(QGraphicsItem *parent = Q_NULLPTR);
- explicit QGraphicsPixmapItem(const QPixmap &pixmap, QGraphicsItem *parent = Q_NULLPTR);
+ explicit QGraphicsPixmapItem(QGraphicsItem *parent = nullptr);
+ explicit QGraphicsPixmapItem(const QPixmap &pixmap, QGraphicsItem *parent = nullptr);
~QGraphicsPixmapItem();
QPixmap pixmap() const;
@@ -836,25 +836,25 @@ public:
void setOffset(const QPointF &offset);
inline void setOffset(qreal x, qreal y);
- QRectF boundingRect() const Q_DECL_OVERRIDE;
- QPainterPath shape() const Q_DECL_OVERRIDE;
- bool contains(const QPointF &point) const Q_DECL_OVERRIDE;
+ QRectF boundingRect() const override;
+ QPainterPath shape() const override;
+ bool contains(const QPointF &point) const override;
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) Q_DECL_OVERRIDE;
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
- bool isObscuredBy(const QGraphicsItem *item) const Q_DECL_OVERRIDE;
- QPainterPath opaqueArea() const Q_DECL_OVERRIDE;
+ bool isObscuredBy(const QGraphicsItem *item) const override;
+ QPainterPath opaqueArea() const override;
enum { Type = 7 };
- int type() const Q_DECL_OVERRIDE;
+ int type() const override;
ShapeMode shapeMode() const;
void setShapeMode(ShapeMode mode);
protected:
- bool supportsExtension(Extension extension) const Q_DECL_OVERRIDE;
- void setExtension(Extension extension, const QVariant &variant) Q_DECL_OVERRIDE;
- QVariant extension(const QVariant &variant) const Q_DECL_OVERRIDE;
+ bool supportsExtension(Extension extension) const override;
+ void setExtension(Extension extension, const QVariant &variant) override;
+ QVariant extension(const QVariant &variant) const override;
private:
Q_DISABLE_COPY(QGraphicsPixmapItem)
@@ -874,8 +874,8 @@ class Q_WIDGETS_EXPORT QGraphicsTextItem : public QGraphicsObject
QDOC_PROPERTY(QTextCursor textCursor READ textCursor WRITE setTextCursor)
public:
- explicit QGraphicsTextItem(QGraphicsItem *parent = Q_NULLPTR);
- explicit QGraphicsTextItem(const QString &text, QGraphicsItem *parent = Q_NULLPTR);
+ explicit QGraphicsTextItem(QGraphicsItem *parent = nullptr);
+ explicit QGraphicsTextItem(const QString &text, QGraphicsItem *parent = nullptr);
~QGraphicsTextItem();
QString toHtml() const;
@@ -890,17 +890,17 @@ public:
void setDefaultTextColor(const QColor &c);
QColor defaultTextColor() const;
- QRectF boundingRect() const Q_DECL_OVERRIDE;
- QPainterPath shape() const Q_DECL_OVERRIDE;
- bool contains(const QPointF &point) const Q_DECL_OVERRIDE;
+ QRectF boundingRect() const override;
+ QPainterPath shape() const override;
+ bool contains(const QPointF &point) const override;
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) Q_DECL_OVERRIDE;
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
- bool isObscuredBy(const QGraphicsItem *item) const Q_DECL_OVERRIDE;
- QPainterPath opaqueArea() const Q_DECL_OVERRIDE;
+ bool isObscuredBy(const QGraphicsItem *item) const override;
+ QPainterPath opaqueArea() const override;
enum { Type = 8 };
- int type() const Q_DECL_OVERRIDE;
+ int type() const override;
void setTextWidth(qreal width);
qreal textWidth() const;
@@ -927,30 +927,30 @@ Q_SIGNALS:
void linkHovered(const QString &);
protected:
- bool sceneEvent(QEvent *event) Q_DECL_OVERRIDE;
- void mousePressEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE;
- void mouseMoveEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE;
- void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE;
- void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE;
- void contextMenuEvent(QGraphicsSceneContextMenuEvent *event) Q_DECL_OVERRIDE;
- void keyPressEvent(QKeyEvent *event) Q_DECL_OVERRIDE;
- void keyReleaseEvent(QKeyEvent *event) Q_DECL_OVERRIDE;
- void focusInEvent(QFocusEvent *event) Q_DECL_OVERRIDE;
- void focusOutEvent(QFocusEvent *event) Q_DECL_OVERRIDE;
- void dragEnterEvent(QGraphicsSceneDragDropEvent *event) Q_DECL_OVERRIDE;
- void dragLeaveEvent(QGraphicsSceneDragDropEvent *event) Q_DECL_OVERRIDE;
- void dragMoveEvent(QGraphicsSceneDragDropEvent *event) Q_DECL_OVERRIDE;
- void dropEvent(QGraphicsSceneDragDropEvent *event) Q_DECL_OVERRIDE;
- void inputMethodEvent(QInputMethodEvent *event) Q_DECL_OVERRIDE;
- void hoverEnterEvent(QGraphicsSceneHoverEvent *event) Q_DECL_OVERRIDE;
- void hoverMoveEvent(QGraphicsSceneHoverEvent *event) Q_DECL_OVERRIDE;
- void hoverLeaveEvent(QGraphicsSceneHoverEvent *event) Q_DECL_OVERRIDE;
-
- QVariant inputMethodQuery(Qt::InputMethodQuery query) const Q_DECL_OVERRIDE;
-
- bool supportsExtension(Extension extension) const Q_DECL_OVERRIDE;
- void setExtension(Extension extension, const QVariant &variant) Q_DECL_OVERRIDE;
- QVariant extension(const QVariant &variant) const Q_DECL_OVERRIDE;
+ bool sceneEvent(QEvent *event) override;
+ void mousePressEvent(QGraphicsSceneMouseEvent *event) override;
+ void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override;
+ void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override;
+ void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) override;
+ void contextMenuEvent(QGraphicsSceneContextMenuEvent *event) override;
+ void keyPressEvent(QKeyEvent *event) override;
+ void keyReleaseEvent(QKeyEvent *event) override;
+ void focusInEvent(QFocusEvent *event) override;
+ void focusOutEvent(QFocusEvent *event) override;
+ void dragEnterEvent(QGraphicsSceneDragDropEvent *event) override;
+ void dragLeaveEvent(QGraphicsSceneDragDropEvent *event) override;
+ void dragMoveEvent(QGraphicsSceneDragDropEvent *event) override;
+ void dropEvent(QGraphicsSceneDragDropEvent *event) override;
+ void inputMethodEvent(QInputMethodEvent *event) override;
+ void hoverEnterEvent(QGraphicsSceneHoverEvent *event) override;
+ void hoverMoveEvent(QGraphicsSceneHoverEvent *event) override;
+ void hoverLeaveEvent(QGraphicsSceneHoverEvent *event) override;
+
+ QVariant inputMethodQuery(Qt::InputMethodQuery query) const override;
+
+ bool supportsExtension(Extension extension) const override;
+ void setExtension(Extension extension, const QVariant &variant) override;
+ QVariant extension(const QVariant &variant) const override;
private:
Q_DISABLE_COPY(QGraphicsTextItem)
@@ -965,8 +965,8 @@ class QGraphicsSimpleTextItemPrivate;
class Q_WIDGETS_EXPORT QGraphicsSimpleTextItem : public QAbstractGraphicsShapeItem
{
public:
- explicit QGraphicsSimpleTextItem(QGraphicsItem *parent = Q_NULLPTR);
- explicit QGraphicsSimpleTextItem(const QString &text, QGraphicsItem *parent = Q_NULLPTR);
+ explicit QGraphicsSimpleTextItem(QGraphicsItem *parent = nullptr);
+ explicit QGraphicsSimpleTextItem(const QString &text, QGraphicsItem *parent = nullptr);
~QGraphicsSimpleTextItem();
void setText(const QString &text);
@@ -975,22 +975,22 @@ public:
void setFont(const QFont &font);
QFont font() const;
- QRectF boundingRect() const Q_DECL_OVERRIDE;
- QPainterPath shape() const Q_DECL_OVERRIDE;
- bool contains(const QPointF &point) const Q_DECL_OVERRIDE;
+ QRectF boundingRect() const override;
+ QPainterPath shape() const override;
+ bool contains(const QPointF &point) const override;
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) Q_DECL_OVERRIDE;
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
- bool isObscuredBy(const QGraphicsItem *item) const Q_DECL_OVERRIDE;
- QPainterPath opaqueArea() const Q_DECL_OVERRIDE;
+ bool isObscuredBy(const QGraphicsItem *item) const override;
+ QPainterPath opaqueArea() const override;
enum { Type = 9 };
- int type() const Q_DECL_OVERRIDE;
+ int type() const override;
protected:
- bool supportsExtension(Extension extension) const Q_DECL_OVERRIDE;
- void setExtension(Extension extension, const QVariant &variant) Q_DECL_OVERRIDE;
- QVariant extension(const QVariant &variant) const Q_DECL_OVERRIDE;
+ bool supportsExtension(Extension extension) const override;
+ void setExtension(Extension extension, const QVariant &variant) override;
+ QVariant extension(const QVariant &variant) const override;
private:
Q_DISABLE_COPY(QGraphicsSimpleTextItem)
@@ -1001,20 +1001,20 @@ class QGraphicsItemGroupPrivate;
class Q_WIDGETS_EXPORT QGraphicsItemGroup : public QGraphicsItem
{
public:
- explicit QGraphicsItemGroup(QGraphicsItem *parent = Q_NULLPTR);
+ explicit QGraphicsItemGroup(QGraphicsItem *parent = nullptr);
~QGraphicsItemGroup();
void addToGroup(QGraphicsItem *item);
void removeFromGroup(QGraphicsItem *item);
- QRectF boundingRect() const Q_DECL_OVERRIDE;
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = Q_NULLPTR) Q_DECL_OVERRIDE;
+ QRectF boundingRect() const override;
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr) override;
- bool isObscuredBy(const QGraphicsItem *item) const Q_DECL_OVERRIDE;
- QPainterPath opaqueArea() const Q_DECL_OVERRIDE;
+ bool isObscuredBy(const QGraphicsItem *item) const override;
+ QPainterPath opaqueArea() const override;
enum { Type = 10 };
- int type() const Q_DECL_OVERRIDE;
+ int type() const override;
private:
Q_DISABLE_COPY(QGraphicsItemGroup)
diff --git a/src/widgets/graphicsview/qgraphicsitem_p.h b/src/widgets/graphicsview/qgraphicsitem_p.h
index 86414263a7..bae38473f9 100644
--- a/src/widgets/graphicsview/qgraphicsitem_p.h
+++ b/src/widgets/graphicsview/qgraphicsitem_p.h
@@ -595,28 +595,28 @@ public:
: QGraphicsEffectSourcePrivate(), item(i), info(0)
{}
- void detach() Q_DECL_OVERRIDE
+ void detach() override
{
item->d_ptr->graphicsEffect = 0;
item->prepareGeometryChange();
}
- const QGraphicsItem *graphicsItem() const Q_DECL_OVERRIDE
+ const QGraphicsItem *graphicsItem() const override
{ return item; }
- const QWidget *widget() const Q_DECL_OVERRIDE
+ const QWidget *widget() const override
{ return 0; }
- void update() Q_DECL_OVERRIDE {
+ void update() override {
item->d_ptr->updateDueToGraphicsEffect = true;
item->update();
item->d_ptr->updateDueToGraphicsEffect = false;
}
- void effectBoundingRectChanged() Q_DECL_OVERRIDE
+ void effectBoundingRectChanged() override
{ item->prepareGeometryChange(); }
- bool isPixmap() const Q_DECL_OVERRIDE
+ bool isPixmap() const override
{
return item->type() == QGraphicsPixmapItem::Type
&& !(item->flags() & QGraphicsItem::ItemIsSelectable)
@@ -624,10 +624,10 @@ public:
//|| (item->d_ptr->isObject && qobject_cast<QDeclarativeImage *>(q_func()));
}
- const QStyleOption *styleOption() const Q_DECL_OVERRIDE
+ const QStyleOption *styleOption() const override
{ return info ? info->option : 0; }
- QRect deviceRect() const Q_DECL_OVERRIDE
+ QRect deviceRect() const override
{
if (!info || !info->widget) {
qWarning("QGraphicsEffectSource::deviceRect: Not yet implemented, lacking device context");
@@ -636,11 +636,11 @@ public:
return info->widget->rect();
}
- QRectF boundingRect(Qt::CoordinateSystem system) const Q_DECL_OVERRIDE;
- void draw(QPainter *) Q_DECL_OVERRIDE;
+ QRectF boundingRect(Qt::CoordinateSystem system) const override;
+ void draw(QPainter *) override;
QPixmap pixmap(Qt::CoordinateSystem system,
QPoint *offset,
- QGraphicsEffect::PixmapPadMode mode) const Q_DECL_OVERRIDE;
+ QGraphicsEffect::PixmapPadMode mode) const override;
QRect paddedEffectRect(Qt::CoordinateSystem system, QGraphicsEffect::PixmapPadMode mode, const QRectF &sourceRect, bool *unpadded = 0) const;
QGraphicsItem *item;
diff --git a/src/widgets/graphicsview/qgraphicsitemanimation.h b/src/widgets/graphicsview/qgraphicsitemanimation.h
index a819acc880..7417d7729c 100644
--- a/src/widgets/graphicsview/qgraphicsitemanimation.h
+++ b/src/widgets/graphicsview/qgraphicsitemanimation.h
@@ -58,7 +58,7 @@ class Q_WIDGETS_EXPORT QGraphicsItemAnimation : public QObject
{
Q_OBJECT
public:
- QGraphicsItemAnimation(QObject *parent = Q_NULLPTR);
+ QGraphicsItemAnimation(QObject *parent = nullptr);
virtual ~QGraphicsItemAnimation();
QGraphicsItem *item() const;
diff --git a/src/widgets/graphicsview/qgraphicslayout.h b/src/widgets/graphicsview/qgraphicslayout.h
index bbe45bbdd6..28b335ceaa 100644
--- a/src/widgets/graphicsview/qgraphicslayout.h
+++ b/src/widgets/graphicsview/qgraphicslayout.h
@@ -54,16 +54,16 @@ class QGraphicsWidget;
class Q_WIDGETS_EXPORT QGraphicsLayout : public QGraphicsLayoutItem
{
public:
- QGraphicsLayout(QGraphicsLayoutItem *parent = Q_NULLPTR);
+ QGraphicsLayout(QGraphicsLayoutItem *parent = nullptr);
~QGraphicsLayout();
void setContentsMargins(qreal left, qreal top, qreal right, qreal bottom);
- void getContentsMargins(qreal *left, qreal *top, qreal *right, qreal *bottom) const Q_DECL_OVERRIDE;
+ void getContentsMargins(qreal *left, qreal *top, qreal *right, qreal *bottom) const override;
void activate();
bool isActivated() const;
virtual void invalidate();
- virtual void updateGeometry() Q_DECL_OVERRIDE;
+ virtual void updateGeometry() override;
virtual void widgetEvent(QEvent *e);
diff --git a/src/widgets/graphicsview/qgraphicslayoutitem.h b/src/widgets/graphicsview/qgraphicslayoutitem.h
index 10c7870412..44f430034b 100644
--- a/src/widgets/graphicsview/qgraphicslayoutitem.h
+++ b/src/widgets/graphicsview/qgraphicslayoutitem.h
@@ -54,7 +54,7 @@ class QGraphicsItem;
class Q_WIDGETS_EXPORT QGraphicsLayoutItem
{
public:
- QGraphicsLayoutItem(QGraphicsLayoutItem *parent = Q_NULLPTR, bool isLayout = false);
+ QGraphicsLayoutItem(QGraphicsLayoutItem *parent = nullptr, bool isLayout = false);
virtual ~QGraphicsLayoutItem();
void setSizePolicy(const QSizePolicy &policy);
diff --git a/src/widgets/graphicsview/qgraphicslayoutstyleinfo_p.h b/src/widgets/graphicsview/qgraphicslayoutstyleinfo_p.h
index 3463ae71bf..7886de432c 100644
--- a/src/widgets/graphicsview/qgraphicslayoutstyleinfo_p.h
+++ b/src/widgets/graphicsview/qgraphicslayoutstyleinfo_p.h
@@ -70,17 +70,17 @@ public:
virtual qreal combinedLayoutSpacing(QLayoutPolicy::ControlTypes controls1,
QLayoutPolicy::ControlTypes controls2,
- Qt::Orientation orientation) const Q_DECL_OVERRIDE;
+ Qt::Orientation orientation) const override;
virtual qreal perItemSpacing(QLayoutPolicy::ControlType control1,
QLayoutPolicy::ControlType control2,
- Qt::Orientation orientation) const Q_DECL_OVERRIDE;
+ Qt::Orientation orientation) const override;
- virtual qreal spacing(Qt::Orientation orientation) const Q_DECL_OVERRIDE;
+ virtual qreal spacing(Qt::Orientation orientation) const override;
- virtual qreal windowMargin(Qt::Orientation orientation) const Q_DECL_OVERRIDE;
+ virtual qreal windowMargin(Qt::Orientation orientation) const override;
- virtual void invalidate() Q_DECL_OVERRIDE
+ virtual void invalidate() override
{
m_style = 0;
QAbstractLayoutStyleInfo::invalidate();
diff --git a/src/widgets/graphicsview/qgraphicslinearlayout.h b/src/widgets/graphicsview/qgraphicslinearlayout.h
index 8186eea987..d27191adb3 100644
--- a/src/widgets/graphicsview/qgraphicslinearlayout.h
+++ b/src/widgets/graphicsview/qgraphicslinearlayout.h
@@ -53,8 +53,8 @@ class QGraphicsLinearLayoutPrivate;
class Q_WIDGETS_EXPORT QGraphicsLinearLayout : public QGraphicsLayout
{
public:
- QGraphicsLinearLayout(QGraphicsLayoutItem *parent = Q_NULLPTR);
- QGraphicsLinearLayout(Qt::Orientation orientation, QGraphicsLayoutItem *parent = Q_NULLPTR);
+ QGraphicsLinearLayout(QGraphicsLayoutItem *parent = nullptr);
+ QGraphicsLinearLayout(Qt::Orientation orientation, QGraphicsLayoutItem *parent = nullptr);
virtual ~QGraphicsLinearLayout();
void setOrientation(Qt::Orientation orientation);
@@ -67,7 +67,7 @@ public:
void insertStretch(int index, int stretch = 1);
void removeItem(QGraphicsLayoutItem *item);
- void removeAt(int index) Q_DECL_OVERRIDE;
+ void removeAt(int index) override;
void setSpacing(qreal spacing);
qreal spacing() const;
@@ -80,13 +80,13 @@ public:
void setAlignment(QGraphicsLayoutItem *item, Qt::Alignment alignment);
Qt::Alignment alignment(QGraphicsLayoutItem *item) const;
- void setGeometry(const QRectF &rect) Q_DECL_OVERRIDE;
+ void setGeometry(const QRectF &rect) override;
- int count() const Q_DECL_OVERRIDE;
- QGraphicsLayoutItem *itemAt(int index) const Q_DECL_OVERRIDE;
+ int count() const override;
+ QGraphicsLayoutItem *itemAt(int index) const override;
- void invalidate() Q_DECL_OVERRIDE;
- QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const Q_DECL_OVERRIDE;
+ void invalidate() override;
+ QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const override;
#if 0 // ###
Q5SizePolicy::ControlTypes controlTypes(LayoutSide side) const;
diff --git a/src/widgets/graphicsview/qgraphicsproxywidget.h b/src/widgets/graphicsview/qgraphicsproxywidget.h
index fd6369a1fd..76fdf8aeba 100644
--- a/src/widgets/graphicsview/qgraphicsproxywidget.h
+++ b/src/widgets/graphicsview/qgraphicsproxywidget.h
@@ -53,7 +53,7 @@ class Q_WIDGETS_EXPORT QGraphicsProxyWidget : public QGraphicsWidget
{
Q_OBJECT
public:
- QGraphicsProxyWidget(QGraphicsItem *parent = Q_NULLPTR, Qt::WindowFlags wFlags = Qt::WindowFlags());
+ QGraphicsProxyWidget(QGraphicsItem *parent = nullptr, Qt::WindowFlags wFlags = Qt::WindowFlags());
~QGraphicsProxyWidget();
void setWidget(QWidget *widget);
@@ -61,63 +61,63 @@ public:
QRectF subWidgetRect(const QWidget *widget) const;
- void setGeometry(const QRectF &rect) Q_DECL_OVERRIDE;
+ void setGeometry(const QRectF &rect) override;
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) Q_DECL_OVERRIDE;
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
enum {
Type = 12
};
- int type() const Q_DECL_OVERRIDE;
+ int type() const override;
QGraphicsProxyWidget *createProxyForChildWidget(QWidget *child);
protected:
- QVariant itemChange(GraphicsItemChange change, const QVariant &value) Q_DECL_OVERRIDE;
+ QVariant itemChange(GraphicsItemChange change, const QVariant &value) override;
- bool event(QEvent *event) Q_DECL_OVERRIDE;
- bool eventFilter(QObject *object, QEvent *event) Q_DECL_OVERRIDE;
+ bool event(QEvent *event) override;
+ bool eventFilter(QObject *object, QEvent *event) override;
- void showEvent(QShowEvent *event) Q_DECL_OVERRIDE;
- void hideEvent(QHideEvent *event) Q_DECL_OVERRIDE;
+ void showEvent(QShowEvent *event) override;
+ void hideEvent(QHideEvent *event) override;
#ifndef QT_NO_CONTEXTMENU
- void contextMenuEvent(QGraphicsSceneContextMenuEvent *event) Q_DECL_OVERRIDE;
+ void contextMenuEvent(QGraphicsSceneContextMenuEvent *event) override;
#endif
#ifndef QT_NO_DRAGANDDROP
- void dragEnterEvent(QGraphicsSceneDragDropEvent *event) Q_DECL_OVERRIDE;
- void dragLeaveEvent(QGraphicsSceneDragDropEvent *event) Q_DECL_OVERRIDE;
- void dragMoveEvent(QGraphicsSceneDragDropEvent *event) Q_DECL_OVERRIDE;
- void dropEvent(QGraphicsSceneDragDropEvent *event) Q_DECL_OVERRIDE;
+ void dragEnterEvent(QGraphicsSceneDragDropEvent *event) override;
+ void dragLeaveEvent(QGraphicsSceneDragDropEvent *event) override;
+ void dragMoveEvent(QGraphicsSceneDragDropEvent *event) override;
+ void dropEvent(QGraphicsSceneDragDropEvent *event) override;
#endif
- void hoverEnterEvent(QGraphicsSceneHoverEvent *event) Q_DECL_OVERRIDE;
- void hoverLeaveEvent(QGraphicsSceneHoverEvent *event) Q_DECL_OVERRIDE;
- void hoverMoveEvent(QGraphicsSceneHoverEvent *event) Q_DECL_OVERRIDE;
- void grabMouseEvent(QEvent *event) Q_DECL_OVERRIDE;
- void ungrabMouseEvent(QEvent *event) Q_DECL_OVERRIDE;
+ void hoverEnterEvent(QGraphicsSceneHoverEvent *event) override;
+ void hoverLeaveEvent(QGraphicsSceneHoverEvent *event) override;
+ void hoverMoveEvent(QGraphicsSceneHoverEvent *event) override;
+ void grabMouseEvent(QEvent *event) override;
+ void ungrabMouseEvent(QEvent *event) override;
- void mouseMoveEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE;
- void mousePressEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE;
- void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE;
- void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE;
+ void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override;
+ void mousePressEvent(QGraphicsSceneMouseEvent *event) override;
+ void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override;
+ void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) override;
#if QT_CONFIG(wheelevent)
- void wheelEvent(QGraphicsSceneWheelEvent *event) Q_DECL_OVERRIDE;
+ void wheelEvent(QGraphicsSceneWheelEvent *event) override;
#endif
- void keyPressEvent(QKeyEvent *event) Q_DECL_OVERRIDE;
- void keyReleaseEvent(QKeyEvent *event) Q_DECL_OVERRIDE;
+ void keyPressEvent(QKeyEvent *event) override;
+ void keyReleaseEvent(QKeyEvent *event) override;
- void focusInEvent(QFocusEvent *event) Q_DECL_OVERRIDE;
- void focusOutEvent(QFocusEvent *event) Q_DECL_OVERRIDE;
- bool focusNextPrevChild(bool next) Q_DECL_OVERRIDE;
+ void focusInEvent(QFocusEvent *event) override;
+ void focusOutEvent(QFocusEvent *event) override;
+ bool focusNextPrevChild(bool next) override;
- QVariant inputMethodQuery(Qt::InputMethodQuery query) const Q_DECL_OVERRIDE;
- void inputMethodEvent(QInputMethodEvent *event) Q_DECL_OVERRIDE;
+ QVariant inputMethodQuery(Qt::InputMethodQuery query) const override;
+ void inputMethodEvent(QInputMethodEvent *event) override;
- QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const Q_DECL_OVERRIDE;
- void resizeEvent(QGraphicsSceneResizeEvent *event) Q_DECL_OVERRIDE;
+ QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const override;
+ void resizeEvent(QGraphicsSceneResizeEvent *event) override;
protected Q_SLOTS:
QGraphicsProxyWidget *newProxyWidget(const QWidget *);
diff --git a/src/widgets/graphicsview/qgraphicsscene.h b/src/widgets/graphicsview/qgraphicsscene.h
index d515585067..5ecd2baab8 100644
--- a/src/widgets/graphicsview/qgraphicsscene.h
+++ b/src/widgets/graphicsview/qgraphicsscene.h
@@ -121,9 +121,9 @@ public:
};
Q_DECLARE_FLAGS(SceneLayers, SceneLayer)
- QGraphicsScene(QObject *parent = Q_NULLPTR);
- QGraphicsScene(const QRectF &sceneRect, QObject *parent = Q_NULLPTR);
- QGraphicsScene(qreal x, qreal y, qreal width, qreal height, QObject *parent = Q_NULLPTR);
+ QGraphicsScene(QObject *parent = nullptr);
+ QGraphicsScene(const QRectF &sceneRect, QObject *parent = nullptr);
+ QGraphicsScene(qreal x, qreal y, qreal width, qreal height, QObject *parent = nullptr);
virtual ~QGraphicsScene();
QRectF sceneRect() const;
@@ -159,7 +159,7 @@ public:
#if QT_DEPRECATED_SINCE(5, 0)
QT_DEPRECATED inline QGraphicsItem *itemAt(const QPointF &position) const {
QList<QGraphicsItem *> itemsAtPoint = items(position);
- return itemsAtPoint.isEmpty() ? Q_NULLPTR : itemsAtPoint.first();
+ return itemsAtPoint.isEmpty() ? nullptr : itemsAtPoint.first();
}
#endif
QGraphicsItem *itemAt(const QPointF &pos, const QTransform &deviceTransform) const;
@@ -173,7 +173,7 @@ public:
#if QT_DEPRECATED_SINCE(5, 0)
QT_DEPRECATED inline QGraphicsItem *itemAt(qreal x, qreal y) const {
QList<QGraphicsItem *> itemsAtPoint = items(QPointF(x, y));
- return itemsAtPoint.isEmpty() ? Q_NULLPTR : itemsAtPoint.first();
+ return itemsAtPoint.isEmpty() ? nullptr : itemsAtPoint.first();
}
#endif
inline QGraphicsItem *itemAt(qreal x, qreal y, const QTransform &deviceTransform) const
@@ -261,8 +261,8 @@ public Q_SLOTS:
void clear();
protected:
- bool event(QEvent *event) Q_DECL_OVERRIDE;
- bool eventFilter(QObject *watched, QEvent *event) Q_DECL_OVERRIDE;
+ bool event(QEvent *event) override;
+ bool eventFilter(QObject *watched, QEvent *event) override;
virtual void contextMenuEvent(QGraphicsSceneContextMenuEvent *event);
virtual void dragEnterEvent(QGraphicsSceneDragDropEvent *event);
virtual void dragMoveEvent(QGraphicsSceneDragDropEvent *event);
@@ -285,7 +285,7 @@ protected:
virtual void drawItems(QPainter *painter, int numItems,
QGraphicsItem *items[],
const QStyleOptionGraphicsItem options[],
- QWidget *widget = Q_NULLPTR);
+ QWidget *widget = nullptr);
protected Q_SLOTS:
// ### Qt 6: make unconditional
diff --git a/src/widgets/graphicsview/qgraphicsscene_bsp.cpp b/src/widgets/graphicsview/qgraphicsscene_bsp.cpp
index 81d2953d8f..75eb50a3ac 100644
--- a/src/widgets/graphicsview/qgraphicsscene_bsp.cpp
+++ b/src/widgets/graphicsview/qgraphicsscene_bsp.cpp
@@ -49,7 +49,7 @@ class QGraphicsSceneInsertItemBspTreeVisitor : public QGraphicsSceneBspTreeVisit
public:
QGraphicsItem *item;
- void visit(QList<QGraphicsItem *> *items) Q_DECL_OVERRIDE
+ void visit(QList<QGraphicsItem *> *items) override
{ items->prepend(item); }
};
@@ -58,7 +58,7 @@ class QGraphicsSceneRemoveItemBspTreeVisitor : public QGraphicsSceneBspTreeVisit
public:
QGraphicsItem *item;
- void visit(QList<QGraphicsItem *> *items) Q_DECL_OVERRIDE
+ void visit(QList<QGraphicsItem *> *items) override
{ items->removeAll(item); }
};
@@ -68,7 +68,7 @@ public:
QList<QGraphicsItem *> *foundItems;
bool onlyTopLevelItems;
- void visit(QList<QGraphicsItem *> *items) Q_DECL_OVERRIDE
+ void visit(QList<QGraphicsItem *> *items) override
{
for (int i = 0; i < items->size(); ++i) {
QGraphicsItem *item = items->at(i);
diff --git a/src/widgets/graphicsview/qgraphicsscenebsptreeindex_p.h b/src/widgets/graphicsview/qgraphicsscenebsptreeindex_p.h
index 8e78407762..b6387a2c56 100644
--- a/src/widgets/graphicsview/qgraphicsscenebsptreeindex_p.h
+++ b/src/widgets/graphicsview/qgraphicsscenebsptreeindex_p.h
@@ -77,25 +77,25 @@ public:
QGraphicsSceneBspTreeIndex(QGraphicsScene *scene = 0);
~QGraphicsSceneBspTreeIndex();
- QList<QGraphicsItem *> estimateItems(const QRectF &rect, Qt::SortOrder order) const Q_DECL_OVERRIDE;
- QList<QGraphicsItem *> estimateTopLevelItems(const QRectF &rect, Qt::SortOrder order) const Q_DECL_OVERRIDE;
- QList<QGraphicsItem *> items(Qt::SortOrder order = Qt::DescendingOrder) const Q_DECL_OVERRIDE;
+ QList<QGraphicsItem *> estimateItems(const QRectF &rect, Qt::SortOrder order) const override;
+ QList<QGraphicsItem *> estimateTopLevelItems(const QRectF &rect, Qt::SortOrder order) const override;
+ QList<QGraphicsItem *> items(Qt::SortOrder order = Qt::DescendingOrder) const override;
int bspTreeDepth() const;
void setBspTreeDepth(int depth);
protected Q_SLOTS:
- void updateSceneRect(const QRectF &rect) Q_DECL_OVERRIDE;
+ void updateSceneRect(const QRectF &rect) override;
protected:
- bool event(QEvent *event) Q_DECL_OVERRIDE;
- void clear() Q_DECL_OVERRIDE;
+ bool event(QEvent *event) override;
+ void clear() override;
- void addItem(QGraphicsItem *item) Q_DECL_OVERRIDE;
- void removeItem(QGraphicsItem *item) Q_DECL_OVERRIDE;
- void prepareBoundingRectChange(const QGraphicsItem *item) Q_DECL_OVERRIDE;
+ void addItem(QGraphicsItem *item) override;
+ void removeItem(QGraphicsItem *item) override;
+ void prepareBoundingRectChange(const QGraphicsItem *item) override;
- void itemChange(const QGraphicsItem *item, QGraphicsItem::GraphicsItemChange change, const void *const value) Q_DECL_OVERRIDE;
+ void itemChange(const QGraphicsItem *item, QGraphicsItem::GraphicsItemChange change, const void *const value) override;
private :
Q_DECLARE_PRIVATE(QGraphicsSceneBspTreeIndex)
diff --git a/src/widgets/graphicsview/qgraphicsscenelinearindex_p.h b/src/widgets/graphicsview/qgraphicsscenelinearindex_p.h
index a59a8ac1b0..07d5d80ef1 100644
--- a/src/widgets/graphicsview/qgraphicsscenelinearindex_p.h
+++ b/src/widgets/graphicsview/qgraphicsscenelinearindex_p.h
@@ -70,10 +70,10 @@ public:
QGraphicsSceneLinearIndex(QGraphicsScene *scene = 0) : QGraphicsSceneIndex(scene), m_numSortedElements(0)
{ }
- QList<QGraphicsItem *> items(Qt::SortOrder order = Qt::DescendingOrder) const Q_DECL_OVERRIDE
+ QList<QGraphicsItem *> items(Qt::SortOrder order = Qt::DescendingOrder) const override
{ Q_UNUSED(order); return m_items; }
- virtual QList<QGraphicsItem *> estimateItems(const QRectF &rect, Qt::SortOrder order) const Q_DECL_OVERRIDE
+ virtual QList<QGraphicsItem *> estimateItems(const QRectF &rect, Qt::SortOrder order) const override
{
Q_UNUSED(rect);
Q_UNUSED(order);
@@ -81,16 +81,16 @@ public:
}
protected :
- virtual void clear() Q_DECL_OVERRIDE
+ virtual void clear() override
{
m_items.clear();
m_numSortedElements = 0;
}
- virtual void addItem(QGraphicsItem *item) Q_DECL_OVERRIDE
+ virtual void addItem(QGraphicsItem *item) override
{ m_items << item; }
- virtual void removeItem(QGraphicsItem *item) Q_DECL_OVERRIDE
+ virtual void removeItem(QGraphicsItem *item) override
{
// Sort m_items if needed
if (m_numSortedElements < m_items.size())
diff --git a/src/widgets/graphicsview/qgraphicstransform.h b/src/widgets/graphicsview/qgraphicstransform.h
index ceeb314c86..b8455781c5 100644
--- a/src/widgets/graphicsview/qgraphicstransform.h
+++ b/src/widgets/graphicsview/qgraphicstransform.h
@@ -57,7 +57,7 @@ class Q_WIDGETS_EXPORT QGraphicsTransform : public QObject
{
Q_OBJECT
public:
- QGraphicsTransform(QObject *parent = Q_NULLPTR);
+ QGraphicsTransform(QObject *parent = nullptr);
~QGraphicsTransform();
virtual void applyTo(QMatrix4x4 *matrix) const = 0;
@@ -85,7 +85,7 @@ class Q_WIDGETS_EXPORT QGraphicsScale : public QGraphicsTransform
Q_PROPERTY(qreal yScale READ yScale WRITE setYScale NOTIFY yScaleChanged)
Q_PROPERTY(qreal zScale READ zScale WRITE setZScale NOTIFY zScaleChanged)
public:
- QGraphicsScale(QObject *parent = Q_NULLPTR);
+ QGraphicsScale(QObject *parent = nullptr);
~QGraphicsScale();
QVector3D origin() const;
@@ -100,7 +100,7 @@ public:
qreal zScale() const;
void setZScale(qreal);
- void applyTo(QMatrix4x4 *matrix) const Q_DECL_OVERRIDE;
+ void applyTo(QMatrix4x4 *matrix) const override;
Q_SIGNALS:
void originChanged();
@@ -123,7 +123,7 @@ class Q_WIDGETS_EXPORT QGraphicsRotation : public QGraphicsTransform
Q_PROPERTY(qreal angle READ angle WRITE setAngle NOTIFY angleChanged)
Q_PROPERTY(QVector3D axis READ axis WRITE setAxis NOTIFY axisChanged)
public:
- QGraphicsRotation(QObject *parent = Q_NULLPTR);
+ QGraphicsRotation(QObject *parent = nullptr);
~QGraphicsRotation();
QVector3D origin() const;
@@ -136,7 +136,7 @@ public:
void setAxis(const QVector3D &axis);
void setAxis(Qt::Axis axis);
- void applyTo(QMatrix4x4 *matrix) const Q_DECL_OVERRIDE;
+ void applyTo(QMatrix4x4 *matrix) const override;
Q_SIGNALS:
void originChanged();
diff --git a/src/widgets/graphicsview/qgraphicsview.h b/src/widgets/graphicsview/qgraphicsview.h
index a9e4efefaf..e02fba69c9 100644
--- a/src/widgets/graphicsview/qgraphicsview.h
+++ b/src/widgets/graphicsview/qgraphicsview.h
@@ -114,11 +114,11 @@ public:
};
Q_DECLARE_FLAGS(OptimizationFlags, OptimizationFlag)
- QGraphicsView(QWidget *parent = Q_NULLPTR);
- QGraphicsView(QGraphicsScene *scene, QWidget *parent = Q_NULLPTR);
+ QGraphicsView(QWidget *parent = nullptr);
+ QGraphicsView(QGraphicsScene *scene, QWidget *parent = nullptr);
~QGraphicsView();
- QSize sizeHint() const Q_DECL_OVERRIDE;
+ QSize sizeHint() const override;
QPainter::RenderHints renderHints() const;
void setRenderHint(QPainter::RenderHint hint, bool enabled = true);
@@ -214,7 +214,7 @@ public:
inline QPoint mapFromScene(qreal x, qreal y) const;
inline QPolygon mapFromScene(qreal x, qreal y, qreal w, qreal h) const;
- QVariant inputMethodQuery(Qt::InputMethodQuery query) const Q_DECL_OVERRIDE;
+ QVariant inputMethodQuery(Qt::InputMethodQuery query) const override;
QBrush backgroundBrush() const;
void setBackgroundBrush(const QBrush &brush);
@@ -233,39 +233,39 @@ Q_SIGNALS:
#endif
protected Q_SLOTS:
- void setupViewport(QWidget *widget) Q_DECL_OVERRIDE;
+ void setupViewport(QWidget *widget) override;
protected:
- QGraphicsView(QGraphicsViewPrivate &, QWidget *parent = Q_NULLPTR);
- bool event(QEvent *event) Q_DECL_OVERRIDE;
- bool viewportEvent(QEvent *event) Q_DECL_OVERRIDE;
+ QGraphicsView(QGraphicsViewPrivate &, QWidget *parent = nullptr);
+ bool event(QEvent *event) override;
+ bool viewportEvent(QEvent *event) override;
#ifndef QT_NO_CONTEXTMENU
- void contextMenuEvent(QContextMenuEvent *event) Q_DECL_OVERRIDE;
+ void contextMenuEvent(QContextMenuEvent *event) override;
#endif
#if QT_CONFIG(draganddrop)
- void dragEnterEvent(QDragEnterEvent *event) Q_DECL_OVERRIDE;
- void dragLeaveEvent(QDragLeaveEvent *event) Q_DECL_OVERRIDE;
- void dragMoveEvent(QDragMoveEvent *event) Q_DECL_OVERRIDE;
- void dropEvent(QDropEvent *event) Q_DECL_OVERRIDE;
+ void dragEnterEvent(QDragEnterEvent *event) override;
+ void dragLeaveEvent(QDragLeaveEvent *event) override;
+ void dragMoveEvent(QDragMoveEvent *event) override;
+ void dropEvent(QDropEvent *event) override;
#endif
- void focusInEvent(QFocusEvent *event) Q_DECL_OVERRIDE;
- bool focusNextPrevChild(bool next) Q_DECL_OVERRIDE;
- void focusOutEvent(QFocusEvent *event) Q_DECL_OVERRIDE;
- void keyPressEvent(QKeyEvent *event) Q_DECL_OVERRIDE;
- void keyReleaseEvent(QKeyEvent *event) Q_DECL_OVERRIDE;
- void mouseDoubleClickEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
- void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
- void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
- void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
+ void focusInEvent(QFocusEvent *event) override;
+ bool focusNextPrevChild(bool next) override;
+ void focusOutEvent(QFocusEvent *event) override;
+ void keyPressEvent(QKeyEvent *event) override;
+ void keyReleaseEvent(QKeyEvent *event) override;
+ void mouseDoubleClickEvent(QMouseEvent *event) override;
+ void mousePressEvent(QMouseEvent *event) override;
+ void mouseMoveEvent(QMouseEvent *event) override;
+ void mouseReleaseEvent(QMouseEvent *event) override;
#if QT_CONFIG(wheelevent)
- void wheelEvent(QWheelEvent *event) Q_DECL_OVERRIDE;
+ void wheelEvent(QWheelEvent *event) override;
#endif
- void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
- void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE;
- void scrollContentsBy(int dx, int dy) Q_DECL_OVERRIDE;
- void showEvent(QShowEvent *event) Q_DECL_OVERRIDE;
- void inputMethodEvent(QInputMethodEvent *event) Q_DECL_OVERRIDE;
+ void paintEvent(QPaintEvent *event) override;
+ void resizeEvent(QResizeEvent *event) override;
+ void scrollContentsBy(int dx, int dy) override;
+ void showEvent(QShowEvent *event) override;
+ void inputMethodEvent(QInputMethodEvent *event) override;
virtual void drawBackground(QPainter *painter, const QRectF &rect);
virtual void drawForeground(QPainter *painter, const QRectF &rect);
diff --git a/src/widgets/graphicsview/qgraphicswidget.cpp b/src/widgets/graphicsview/qgraphicswidget.cpp
index c658e40a9e..4108dd803a 100644
--- a/src/widgets/graphicsview/qgraphicswidget.cpp
+++ b/src/widgets/graphicsview/qgraphicswidget.cpp
@@ -276,7 +276,7 @@ QGraphicsWidget::~QGraphicsWidget()
// Unset the parent here, when we're still a QGraphicsWidget.
// It is otherwise done in ~QGraphicsItem() where we'd be
// calling QGraphicsWidget members on an ex-QGraphicsWidget object
- setParentItem(Q_NULLPTR);
+ setParentItem(nullptr);
}
/*!
diff --git a/src/widgets/graphicsview/qgraphicswidget.h b/src/widgets/graphicsview/qgraphicswidget.h
index 831511d14a..481fb55db3 100644
--- a/src/widgets/graphicsview/qgraphicswidget.h
+++ b/src/widgets/graphicsview/qgraphicswidget.h
@@ -80,7 +80,7 @@ class Q_WIDGETS_EXPORT QGraphicsWidget : public QGraphicsObject, public QGraphic
Q_PROPERTY(bool autoFillBackground READ autoFillBackground WRITE setAutoFillBackground)
Q_PROPERTY(QGraphicsLayout* layout READ layout WRITE setLayout NOTIFY layoutChanged)
public:
- QGraphicsWidget(QGraphicsItem *parent = Q_NULLPTR, Qt::WindowFlags wFlags = Qt::WindowFlags());
+ QGraphicsWidget(QGraphicsItem *parent = nullptr, Qt::WindowFlags wFlags = Qt::WindowFlags());
~QGraphicsWidget();
QGraphicsLayout *layout() const;
void setLayout(QGraphicsLayout *layout);
@@ -106,12 +106,12 @@ public:
inline void resize(qreal w, qreal h) { resize(QSizeF(w, h)); }
QSizeF size() const;
- void setGeometry(const QRectF &rect) Q_DECL_OVERRIDE;
+ void setGeometry(const QRectF &rect) override;
inline void setGeometry(qreal x, qreal y, qreal w, qreal h);
inline QRectF rect() const { return QRectF(QPointF(), size()); }
void setContentsMargins(qreal left, qreal top, qreal right, qreal bottom);
- void getContentsMargins(qreal *left, qreal *top, qreal *right, qreal *bottom) const Q_DECL_OVERRIDE;
+ void getContentsMargins(qreal *left, qreal *top, qreal *right, qreal *bottom) const override;
void setWindowFrameMargins(qreal left, qreal top, qreal right, qreal bottom);
void getWindowFrameMargins(qreal *left, qreal *top, qreal *right, qreal *bottom) const;
@@ -161,12 +161,12 @@ public:
enum {
Type = 11
};
- int type() const Q_DECL_OVERRIDE;
+ int type() const override;
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = Q_NULLPTR) Q_DECL_OVERRIDE;
- virtual void paintWindowFrame(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = Q_NULLPTR);
- QRectF boundingRect() const Q_DECL_OVERRIDE;
- QPainterPath shape() const Q_DECL_OVERRIDE;
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr) override;
+ virtual void paintWindowFrame(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr);
+ QRectF boundingRect() const override;
+ QPainterPath shape() const override;
#if 0
void dumpFocusChain();
@@ -184,28 +184,28 @@ public Q_SLOTS:
protected:
virtual void initStyleOption(QStyleOption *option) const;
- QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const Q_DECL_OVERRIDE;
- void updateGeometry() Q_DECL_OVERRIDE;
+ QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const override;
+ void updateGeometry() override;
// Notification
- QVariant itemChange(GraphicsItemChange change, const QVariant &value) Q_DECL_OVERRIDE;
+ QVariant itemChange(GraphicsItemChange change, const QVariant &value) override;
virtual QVariant propertyChange(const QString &propertyName, const QVariant &value);
// Scene events
- bool sceneEvent(QEvent *event) Q_DECL_OVERRIDE;
+ bool sceneEvent(QEvent *event) override;
virtual bool windowFrameEvent(QEvent *e);
virtual Qt::WindowFrameSection windowFrameSectionAt(const QPointF& pos) const;
// Base event handlers
- bool event(QEvent *event) Q_DECL_OVERRIDE;
+ bool event(QEvent *event) override;
//virtual void actionEvent(QActionEvent *event);
virtual void changeEvent(QEvent *event);
virtual void closeEvent(QCloseEvent *event);
//void create(WId window = 0, bool initializeWindow = true, bool destroyOldWindow = true);
//void destroy(bool destroyWindow = true, bool destroySubWindows = true);
- void focusInEvent(QFocusEvent *event) Q_DECL_OVERRIDE;
+ void focusInEvent(QFocusEvent *event) override;
virtual bool focusNextPrevChild(bool next);
- void focusOutEvent(QFocusEvent *event) Q_DECL_OVERRIDE;
+ void focusOutEvent(QFocusEvent *event) override;
virtual void hideEvent(QHideEvent *event);
//virtual int metric(PaintDeviceMetric m ) const;
virtual void moveEvent(QGraphicsSceneMoveEvent *event);
@@ -214,8 +214,8 @@ protected:
virtual void resizeEvent(QGraphicsSceneResizeEvent *event);
virtual void showEvent(QShowEvent *event);
//virtual void tabletEvent(QTabletEvent *event);
- virtual void hoverMoveEvent(QGraphicsSceneHoverEvent *event) Q_DECL_OVERRIDE;
- virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent *event) Q_DECL_OVERRIDE;
+ virtual void hoverMoveEvent(QGraphicsSceneHoverEvent *event) override;
+ virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent *event) override;
virtual void grabMouseEvent(QEvent *event);
virtual void ungrabMouseEvent(QEvent *event);
virtual void grabKeyboardEvent(QEvent *event);
diff --git a/src/widgets/graphicsview/qgraphicswidget_p.h b/src/widgets/graphicsview/qgraphicswidget_p.h
index 0fb9fbba07..505a2a24c0 100644
--- a/src/widgets/graphicsview/qgraphicswidget_p.h
+++ b/src/widgets/graphicsview/qgraphicswidget_p.h
@@ -94,13 +94,13 @@ public:
QPalette palette;
uint inheritedPaletteResolveMask;
void setPalette_helper(const QPalette &palette);
- void resolvePalette(uint inheritedMask) Q_DECL_OVERRIDE;
+ void resolvePalette(uint inheritedMask) override;
void updatePalette(const QPalette &palette);
QPalette naturalWidgetPalette() const;
QFont font;
uint inheritedFontResolveMask;
void setFont_helper(const QFont &font);
- void resolveFont(uint inheritedMask) Q_DECL_OVERRIDE;
+ void resolveFont(uint inheritedMask) override;
void updateFont(const QFont &font);
QFont naturalWidgetFont() const;
@@ -115,13 +115,13 @@ public:
bool hasDecoration() const;
// Private Properties
- qreal width() const Q_DECL_OVERRIDE;
- void setWidth(qreal) Q_DECL_OVERRIDE;
- void resetWidth() Q_DECL_OVERRIDE;
+ qreal width() const override;
+ void setWidth(qreal) override;
+ void resetWidth() override;
- qreal height() const Q_DECL_OVERRIDE;
- void setHeight(qreal) Q_DECL_OVERRIDE;
- void resetHeight() Q_DECL_OVERRIDE;
+ qreal height() const override;
+ void setHeight(qreal) override;
+ void resetHeight() override;
void setGeometryFromSetPos();
// State
diff --git a/src/widgets/itemviews/qabstractitemdelegate.h b/src/widgets/itemviews/qabstractitemdelegate.h
index 9b6bde1c87..575728e806 100644
--- a/src/widgets/itemviews/qabstractitemdelegate.h
+++ b/src/widgets/itemviews/qabstractitemdelegate.h
@@ -69,7 +69,7 @@ public:
RevertModelCache
};
- explicit QAbstractItemDelegate(QObject *parent = Q_NULLPTR);
+ explicit QAbstractItemDelegate(QObject *parent = nullptr);
virtual ~QAbstractItemDelegate();
// painting
@@ -119,7 +119,7 @@ Q_SIGNALS:
void sizeHintChanged(const QModelIndex &);
protected:
- QAbstractItemDelegate(QObjectPrivate &, QObject *parent = Q_NULLPTR);
+ QAbstractItemDelegate(QObjectPrivate &, QObject *parent = nullptr);
private:
Q_DECLARE_PRIVATE(QAbstractItemDelegate)
Q_DISABLE_COPY(QAbstractItemDelegate)
diff --git a/src/widgets/itemviews/qabstractitemview.h b/src/widgets/itemviews/qabstractitemview.h
index 6a007da348..96745a84ea 100644
--- a/src/widgets/itemviews/qabstractitemview.h
+++ b/src/widgets/itemviews/qabstractitemview.h
@@ -124,7 +124,7 @@ public:
};
Q_ENUM(ScrollMode)
- explicit QAbstractItemView(QWidget *parent = Q_NULLPTR);
+ explicit QAbstractItemView(QWidget *parent = nullptr);
~QAbstractItemView();
virtual void setModel(QAbstractItemModel *model);
@@ -225,7 +225,7 @@ public:
QAbstractItemDelegate *itemDelegate(const QModelIndex &index) const;
- virtual QVariant inputMethodQuery(Qt::InputMethodQuery query) const Q_DECL_OVERRIDE;
+ virtual QVariant inputMethodQuery(Qt::InputMethodQuery query) const override;
using QAbstractScrollArea::update;
@@ -270,7 +270,7 @@ Q_SIGNALS:
void iconSizeChanged(const QSize &size);
protected:
- QAbstractItemView(QAbstractItemViewPrivate &, QWidget *parent = Q_NULLPTR);
+ QAbstractItemView(QAbstractItemViewPrivate &, QWidget *parent = nullptr);
void setHorizontalStepsPerItem(int steps);
int horizontalStepsPerItem() const;
@@ -295,7 +295,7 @@ protected:
virtual bool edit(const QModelIndex &index, EditTrigger trigger, QEvent *event);
virtual QItemSelectionModel::SelectionFlags selectionCommand(const QModelIndex &index,
- const QEvent *event = Q_NULLPTR) const;
+ const QEvent *event = nullptr) const;
#ifndef QT_NO_DRAGANDDROP
virtual void startDrag(Qt::DropActions supportedActions);
@@ -327,32 +327,32 @@ protected:
void stopAutoScroll();
void doAutoScroll();
- bool focusNextPrevChild(bool next) Q_DECL_OVERRIDE;
- bool event(QEvent *event) Q_DECL_OVERRIDE;
- bool viewportEvent(QEvent *event) Q_DECL_OVERRIDE;
- void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
- void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
- void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
- void mouseDoubleClickEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
+ bool focusNextPrevChild(bool next) override;
+ bool event(QEvent *event) override;
+ bool viewportEvent(QEvent *event) override;
+ void mousePressEvent(QMouseEvent *event) override;
+ void mouseMoveEvent(QMouseEvent *event) override;
+ void mouseReleaseEvent(QMouseEvent *event) override;
+ void mouseDoubleClickEvent(QMouseEvent *event) override;
#ifndef QT_NO_DRAGANDDROP
- void dragEnterEvent(QDragEnterEvent *event) Q_DECL_OVERRIDE;
- void dragMoveEvent(QDragMoveEvent *event) Q_DECL_OVERRIDE;
- void dragLeaveEvent(QDragLeaveEvent *event) Q_DECL_OVERRIDE;
- void dropEvent(QDropEvent *event) Q_DECL_OVERRIDE;
+ void dragEnterEvent(QDragEnterEvent *event) override;
+ void dragMoveEvent(QDragMoveEvent *event) override;
+ void dragLeaveEvent(QDragLeaveEvent *event) override;
+ void dropEvent(QDropEvent *event) override;
#endif
- void focusInEvent(QFocusEvent *event) Q_DECL_OVERRIDE;
- void focusOutEvent(QFocusEvent *event) Q_DECL_OVERRIDE;
- void keyPressEvent(QKeyEvent *event) Q_DECL_OVERRIDE;
- void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE;
- void timerEvent(QTimerEvent *event) Q_DECL_OVERRIDE;
- void inputMethodEvent(QInputMethodEvent *event) Q_DECL_OVERRIDE;
+ void focusInEvent(QFocusEvent *event) override;
+ void focusOutEvent(QFocusEvent *event) override;
+ void keyPressEvent(QKeyEvent *event) override;
+ void resizeEvent(QResizeEvent *event) override;
+ void timerEvent(QTimerEvent *event) override;
+ void inputMethodEvent(QInputMethodEvent *event) override;
#ifndef QT_NO_DRAGANDDROP
enum DropIndicatorPosition { OnItem, AboveItem, BelowItem, OnViewport };
DropIndicatorPosition dropIndicatorPosition() const;
#endif
- QSize viewportSizeHint() const Q_DECL_OVERRIDE;
+ QSize viewportSizeHint() const override;
private:
Q_DECLARE_PRIVATE(QAbstractItemView)
diff --git a/src/widgets/itemviews/qcolumnview.h b/src/widgets/itemviews/qcolumnview.h
index 42eac7426a..5c62f9c9af 100644
--- a/src/widgets/itemviews/qcolumnview.h
+++ b/src/widgets/itemviews/qcolumnview.h
@@ -58,18 +58,18 @@ Q_SIGNALS:
void updatePreviewWidget(const QModelIndex &index);
public:
- explicit QColumnView(QWidget *parent = Q_NULLPTR);
+ explicit QColumnView(QWidget *parent = nullptr);
~QColumnView();
// QAbstractItemView overloads
- QModelIndex indexAt(const QPoint &point) const Q_DECL_OVERRIDE;
- void scrollTo(const QModelIndex &index, ScrollHint hint = EnsureVisible) Q_DECL_OVERRIDE;
- QSize sizeHint() const Q_DECL_OVERRIDE;
- QRect visualRect(const QModelIndex &index) const Q_DECL_OVERRIDE;
- void setModel(QAbstractItemModel *model) Q_DECL_OVERRIDE;
- void setSelectionModel(QItemSelectionModel * selectionModel) Q_DECL_OVERRIDE;
- void setRootIndex(const QModelIndex &index) Q_DECL_OVERRIDE;
- void selectAll() Q_DECL_OVERRIDE;
+ QModelIndex indexAt(const QPoint &point) const override;
+ void scrollTo(const QModelIndex &index, ScrollHint hint = EnsureVisible) override;
+ QSize sizeHint() const override;
+ QRect visualRect(const QModelIndex &index) const override;
+ void setModel(QAbstractItemModel *model) override;
+ void setSelectionModel(QItemSelectionModel * selectionModel) override;
+ void setRootIndex(const QModelIndex &index) override;
+ void selectAll() override;
// QColumnView functions
void setResizeGripsVisible(bool visible);
@@ -82,21 +82,21 @@ public:
QList<int> columnWidths() const;
protected:
- QColumnView(QColumnViewPrivate &dd, QWidget *parent = Q_NULLPTR);
+ QColumnView(QColumnViewPrivate &dd, QWidget *parent = nullptr);
// QAbstractItemView overloads
- bool isIndexHidden(const QModelIndex &index) const Q_DECL_OVERRIDE;
- QModelIndex moveCursor(CursorAction cursorAction, Qt::KeyboardModifiers modifiers) Q_DECL_OVERRIDE;
- void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE;
- void setSelection(const QRect & rect, QItemSelectionModel::SelectionFlags command) Q_DECL_OVERRIDE;
- QRegion visualRegionForSelection(const QItemSelection &selection) const Q_DECL_OVERRIDE;
- int horizontalOffset() const Q_DECL_OVERRIDE;
- int verticalOffset() const Q_DECL_OVERRIDE;
- void rowsInserted(const QModelIndex &parent, int start, int end) Q_DECL_OVERRIDE;
- void currentChanged(const QModelIndex &current, const QModelIndex &previous) Q_DECL_OVERRIDE;
+ bool isIndexHidden(const QModelIndex &index) const override;
+ QModelIndex moveCursor(CursorAction cursorAction, Qt::KeyboardModifiers modifiers) override;
+ void resizeEvent(QResizeEvent *event) override;
+ void setSelection(const QRect & rect, QItemSelectionModel::SelectionFlags command) override;
+ QRegion visualRegionForSelection(const QItemSelection &selection) const override;
+ int horizontalOffset() const override;
+ int verticalOffset() const override;
+ void rowsInserted(const QModelIndex &parent, int start, int end) override;
+ void currentChanged(const QModelIndex &current, const QModelIndex &previous) override;
// QColumnView functions
- void scrollContentsBy(int dx, int dy) Q_DECL_OVERRIDE;
+ void scrollContentsBy(int dx, int dy) override;
virtual QAbstractItemView* createColumn(const QModelIndex &rootIndex);
void initializeColumn(QAbstractItemView *column) const;
diff --git a/src/widgets/itemviews/qcolumnview_p.h b/src/widgets/itemviews/qcolumnview_p.h
index fa276075fe..850ab02747 100644
--- a/src/widgets/itemviews/qcolumnview_p.h
+++ b/src/widgets/itemviews/qcolumnview_p.h
@@ -80,7 +80,7 @@ public:
setMinimumWidth(previewWidget->minimumWidth());
}
- void resizeEvent(QResizeEvent * event) Q_DECL_OVERRIDE{
+ void resizeEvent(QResizeEvent * event) override{
if (!previewWidget)
return;
previewWidget->resize(
@@ -96,7 +96,7 @@ public:
QAbstractScrollArea::resizeEvent(event);
}
- void scrollContentsBy(int dx, int dy) Q_DECL_OVERRIDE
+ void scrollContentsBy(int dx, int dy) override
{
if (!previewWidget)
return;
@@ -106,36 +106,36 @@ public:
QAbstractItemView::scrollContentsBy(dx, dy);
}
- QRect visualRect(const QModelIndex &) const Q_DECL_OVERRIDE
+ QRect visualRect(const QModelIndex &) const override
{
return QRect();
}
- void scrollTo(const QModelIndex &, ScrollHint) Q_DECL_OVERRIDE
+ void scrollTo(const QModelIndex &, ScrollHint) override
{
}
- QModelIndex indexAt(const QPoint &) const Q_DECL_OVERRIDE
+ QModelIndex indexAt(const QPoint &) const override
{
return QModelIndex();
}
- QModelIndex moveCursor(CursorAction, Qt::KeyboardModifiers) Q_DECL_OVERRIDE
+ QModelIndex moveCursor(CursorAction, Qt::KeyboardModifiers) override
{
return QModelIndex();
}
- int horizontalOffset () const Q_DECL_OVERRIDE {
+ int horizontalOffset () const override {
return 0;
}
- int verticalOffset () const Q_DECL_OVERRIDE {
+ int verticalOffset () const override {
return 0;
}
- QRegion visualRegionForSelection(const QItemSelection &) const Q_DECL_OVERRIDE
+ QRegion visualRegionForSelection(const QItemSelection &) const override
{
return QRegion();
}
- bool isIndexHidden(const QModelIndex &) const Q_DECL_OVERRIDE
+ bool isIndexHidden(const QModelIndex &) const override
{
return false;
}
- void setSelection(const QRect &, QItemSelectionModel::SelectionFlags) Q_DECL_OVERRIDE
+ void setSelection(const QRect &, QItemSelectionModel::SelectionFlags) override
{
}
private:
@@ -163,7 +163,7 @@ public:
void _q_gripMoved(int offset);
void _q_changeCurrentColumn();
void _q_clicked(const QModelIndex &index);
- void _q_columnsInserted(const QModelIndex &parent, int start, int end) Q_DECL_OVERRIDE;
+ void _q_columnsInserted(const QModelIndex &parent, int start, int end) override;
QList<QAbstractItemView*> columns;
QVector<int> columnSizes; // used during init and corner moving
@@ -188,7 +188,7 @@ public:
void paint(QPainter *painter,
const QStyleOptionViewItem &option,
- const QModelIndex &index) const Q_DECL_OVERRIDE;
+ const QModelIndex &index) const override;
};
QT_END_NAMESPACE
diff --git a/src/widgets/itemviews/qcolumnviewgrip_p.h b/src/widgets/itemviews/qcolumnviewgrip_p.h
index 16c0aefada..7e2793074b 100644
--- a/src/widgets/itemviews/qcolumnviewgrip_p.h
+++ b/src/widgets/itemviews/qcolumnviewgrip_p.h
@@ -74,11 +74,11 @@ public:
protected:
QColumnViewGrip(QColumnViewGripPrivate &, QWidget *parent = 0, Qt::WindowFlags f = 0);
- void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
- void mouseDoubleClickEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
- void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
- void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
- void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
+ void paintEvent(QPaintEvent *event) override;
+ void mouseDoubleClickEvent(QMouseEvent *event) override;
+ void mouseMoveEvent(QMouseEvent *event) override;
+ void mouseReleaseEvent(QMouseEvent *event) override;
+ void mousePressEvent(QMouseEvent *event) override;
private:
Q_DECLARE_PRIVATE(QColumnViewGrip)
diff --git a/src/widgets/itemviews/qdatawidgetmapper.h b/src/widgets/itemviews/qdatawidgetmapper.h
index 7d4d61378a..2d75b63a5e 100644
--- a/src/widgets/itemviews/qdatawidgetmapper.h
+++ b/src/widgets/itemviews/qdatawidgetmapper.h
@@ -61,7 +61,7 @@ class Q_WIDGETS_EXPORT QDataWidgetMapper: public QObject
Q_PROPERTY(SubmitPolicy submitPolicy READ submitPolicy WRITE setSubmitPolicy)
public:
- explicit QDataWidgetMapper(QObject *parent = Q_NULLPTR);
+ explicit QDataWidgetMapper(QObject *parent = nullptr);
~QDataWidgetMapper();
void setModel(QAbstractItemModel *model);
diff --git a/src/widgets/itemviews/qdirmodel.h b/src/widgets/itemviews/qdirmodel.h
index 30810cf4f6..ab91bbd763 100644
--- a/src/widgets/itemviews/qdirmodel.h
+++ b/src/widgets/itemviews/qdirmodel.h
@@ -66,31 +66,31 @@ public:
};
QDirModel(const QStringList &nameFilters, QDir::Filters filters,
- QDir::SortFlags sort, QObject *parent = Q_NULLPTR);
- explicit QDirModel(QObject *parent = Q_NULLPTR);
+ QDir::SortFlags sort, QObject *parent = nullptr);
+ explicit QDirModel(QObject *parent = nullptr);
~QDirModel();
- QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
- QModelIndex parent(const QModelIndex &child) const Q_DECL_OVERRIDE;
+ QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override;
+ QModelIndex parent(const QModelIndex &child) const override;
- int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
- int columnCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
+ int rowCount(const QModelIndex &parent = QModelIndex()) const override;
+ int columnCount(const QModelIndex &parent = QModelIndex()) const override;
- QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
- bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) Q_DECL_OVERRIDE;
+ QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
+ bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;
- QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
+ QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
- bool hasChildren(const QModelIndex &index = QModelIndex()) const Q_DECL_OVERRIDE;
- Qt::ItemFlags flags(const QModelIndex &index) const Q_DECL_OVERRIDE;
+ bool hasChildren(const QModelIndex &index = QModelIndex()) const override;
+ Qt::ItemFlags flags(const QModelIndex &index) const override;
- void sort(int column, Qt::SortOrder order = Qt::AscendingOrder) Q_DECL_OVERRIDE;
+ void sort(int column, Qt::SortOrder order = Qt::AscendingOrder) override;
- QStringList mimeTypes() const Q_DECL_OVERRIDE;
- QMimeData *mimeData(const QModelIndexList &indexes) const Q_DECL_OVERRIDE;
+ QStringList mimeTypes() const override;
+ QMimeData *mimeData(const QModelIndexList &indexes) const override;
bool dropMimeData(const QMimeData *data, Qt::DropAction action,
- int row, int column, const QModelIndex &parent) Q_DECL_OVERRIDE;
- Qt::DropActions supportedDropActions() const Q_DECL_OVERRIDE;
+ int row, int column, const QModelIndex &parent) override;
+ Qt::DropActions supportedDropActions() const override;
// QDirModel specific API
@@ -133,7 +133,7 @@ public Q_SLOTS:
void refresh(const QModelIndex &parent = QModelIndex());
protected:
- QDirModel(QDirModelPrivate &, QObject *parent = Q_NULLPTR);
+ QDirModel(QDirModelPrivate &, QObject *parent = nullptr);
friend class QFileDialogPrivate;
private:
diff --git a/src/widgets/itemviews/qheaderview.h b/src/widgets/itemviews/qheaderview.h
index ec4500d81e..b6554c0730 100644
--- a/src/widgets/itemviews/qheaderview.h
+++ b/src/widgets/itemviews/qheaderview.h
@@ -74,16 +74,16 @@ public:
};
Q_ENUM(ResizeMode)
- explicit QHeaderView(Qt::Orientation orientation, QWidget *parent = Q_NULLPTR);
+ explicit QHeaderView(Qt::Orientation orientation, QWidget *parent = nullptr);
virtual ~QHeaderView();
- void setModel(QAbstractItemModel *model) Q_DECL_OVERRIDE;
+ void setModel(QAbstractItemModel *model) override;
Qt::Orientation orientation() const;
int offset() const;
int length() const;
- QSize sizeHint() const Q_DECL_OVERRIDE;
- void setVisible(bool v) Q_DECL_OVERRIDE;
+ QSize sizeHint() const override;
+ void setVisible(bool v) override;
int sectionSizeHint(int logicalIndex) const;
int visualIndexAt(int position) const;
@@ -172,7 +172,7 @@ public:
Qt::Alignment defaultAlignment() const;
void setDefaultAlignment(Qt::Alignment alignment);
- void doItemsLayout() Q_DECL_OVERRIDE;
+ void doItemsLayout() override;
bool sectionsMoved() const;
bool sectionsHidden() const;
@@ -181,7 +181,7 @@ public:
bool restoreState(const QByteArray &state);
#endif
- void reset() Q_DECL_OVERRIDE;
+ void reset() override;
public Q_SLOTS:
void setOffset(int offset);
@@ -208,41 +208,41 @@ protected Q_SLOTS:
void sectionsAboutToBeRemoved(const QModelIndex &parent, int logicalFirst, int logicalLast);
protected:
- QHeaderView(QHeaderViewPrivate &dd, Qt::Orientation orientation, QWidget *parent = Q_NULLPTR);
+ QHeaderView(QHeaderViewPrivate &dd, Qt::Orientation orientation, QWidget *parent = nullptr);
void initialize();
void initializeSections();
void initializeSections(int start, int end);
- void currentChanged(const QModelIndex &current, const QModelIndex &old) Q_DECL_OVERRIDE;
+ void currentChanged(const QModelIndex &current, const QModelIndex &old) override;
- bool event(QEvent *e) Q_DECL_OVERRIDE;
- void paintEvent(QPaintEvent *e) Q_DECL_OVERRIDE;
- void mousePressEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
- void mouseMoveEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
- void mouseReleaseEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
- void mouseDoubleClickEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
- bool viewportEvent(QEvent *e) Q_DECL_OVERRIDE;
+ bool event(QEvent *e) override;
+ void paintEvent(QPaintEvent *e) override;
+ void mousePressEvent(QMouseEvent *e) override;
+ void mouseMoveEvent(QMouseEvent *e) override;
+ void mouseReleaseEvent(QMouseEvent *e) override;
+ void mouseDoubleClickEvent(QMouseEvent *e) override;
+ bool viewportEvent(QEvent *e) override;
virtual void paintSection(QPainter *painter, const QRect &rect, int logicalIndex) const;
virtual QSize sectionSizeFromContents(int logicalIndex) const;
- int horizontalOffset() const Q_DECL_OVERRIDE;
- int verticalOffset() const Q_DECL_OVERRIDE;
- void updateGeometries() Q_DECL_OVERRIDE;
- void scrollContentsBy(int dx, int dy) Q_DECL_OVERRIDE;
+ int horizontalOffset() const override;
+ int verticalOffset() const override;
+ void updateGeometries() override;
+ void scrollContentsBy(int dx, int dy) override;
- void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &roles = QVector<int>()) Q_DECL_OVERRIDE;
- void rowsInserted(const QModelIndex &parent, int start, int end) Q_DECL_OVERRIDE;
+ void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &roles = QVector<int>()) override;
+ void rowsInserted(const QModelIndex &parent, int start, int end) override;
- QRect visualRect(const QModelIndex &index) const Q_DECL_OVERRIDE;
- void scrollTo(const QModelIndex &index, ScrollHint hint) Q_DECL_OVERRIDE;
+ QRect visualRect(const QModelIndex &index) const override;
+ void scrollTo(const QModelIndex &index, ScrollHint hint) override;
- QModelIndex indexAt(const QPoint &p) const Q_DECL_OVERRIDE;
- bool isIndexHidden(const QModelIndex &index) const Q_DECL_OVERRIDE;
+ QModelIndex indexAt(const QPoint &p) const override;
+ bool isIndexHidden(const QModelIndex &index) const override;
- QModelIndex moveCursor(CursorAction, Qt::KeyboardModifiers) Q_DECL_OVERRIDE;
- void setSelection(const QRect& rect, QItemSelectionModel::SelectionFlags flags) Q_DECL_OVERRIDE;
- QRegion visualRegionForSelection(const QItemSelection &selection) const Q_DECL_OVERRIDE;
+ QModelIndex moveCursor(CursorAction, Qt::KeyboardModifiers) override;
+ void setSelection(const QRect& rect, QItemSelectionModel::SelectionFlags flags) override;
+ QRegion visualRegionForSelection(const QItemSelection &selection) const override;
void initStyleOption(QStyleOptionHeader *option) const;
friend class QTableView;
diff --git a/src/widgets/itemviews/qitemdelegate.cpp b/src/widgets/itemviews/qitemdelegate.cpp
index d9caebec8a..df5f9afb0e 100644
--- a/src/widgets/itemviews/qitemdelegate.cpp
+++ b/src/widgets/itemviews/qitemdelegate.cpp
@@ -94,10 +94,7 @@ public:
inline static QString replaceNewLine(QString text)
{
- const QChar nl = QLatin1Char('\n');
- for (int i = 0; i < text.count(); ++i)
- if (text.at(i) == nl)
- text[i] = QChar::LineSeparator;
+ text.replace(QLatin1Char('\n'), QChar::LineSeparator);
return text;
}
diff --git a/src/widgets/itemviews/qitemdelegate.h b/src/widgets/itemviews/qitemdelegate.h
index 21594327ef..539dec4374 100644
--- a/src/widgets/itemviews/qitemdelegate.h
+++ b/src/widgets/itemviews/qitemdelegate.h
@@ -59,7 +59,7 @@ class Q_WIDGETS_EXPORT QItemDelegate : public QAbstractItemDelegate
Q_PROPERTY(bool clipping READ hasClipping WRITE setClipping)
public:
- explicit QItemDelegate(QObject *parent = Q_NULLPTR);
+ explicit QItemDelegate(QObject *parent = nullptr);
~QItemDelegate();
bool hasClipping() const;
@@ -68,21 +68,21 @@ public:
// painting
void paint(QPainter *painter,
const QStyleOptionViewItem &option,
- const QModelIndex &index) const Q_DECL_OVERRIDE;
+ const QModelIndex &index) const override;
QSize sizeHint(const QStyleOptionViewItem &option,
- const QModelIndex &index) const Q_DECL_OVERRIDE;
+ const QModelIndex &index) const override;
// editing
QWidget *createEditor(QWidget *parent,
const QStyleOptionViewItem &option,
- const QModelIndex &index) const Q_DECL_OVERRIDE;
+ const QModelIndex &index) const override;
- void setEditorData(QWidget *editor, const QModelIndex &index) const Q_DECL_OVERRIDE;
- void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const Q_DECL_OVERRIDE;
+ void setEditorData(QWidget *editor, const QModelIndex &index) const override;
+ void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const override;
void updateEditorGeometry(QWidget *editor,
const QStyleOptionViewItem &option,
- const QModelIndex &index) const Q_DECL_OVERRIDE;
+ const QModelIndex &index) const override;
// editor factory
QItemEditorFactory *itemEditorFactory() const;
@@ -105,9 +105,9 @@ protected:
QRect rect(const QStyleOptionViewItem &option, const QModelIndex &index, int role) const;
- bool eventFilter(QObject *object, QEvent *event) Q_DECL_OVERRIDE;
+ bool eventFilter(QObject *object, QEvent *event) override;
bool editorEvent(QEvent *event, QAbstractItemModel *model,
- const QStyleOptionViewItem &option, const QModelIndex &index) Q_DECL_OVERRIDE;
+ const QStyleOptionViewItem &option, const QModelIndex &index) override;
QStyleOptionViewItem setOptions(const QModelIndex &index,
const QStyleOptionViewItem &option) const;
diff --git a/src/widgets/itemviews/qitemeditorfactory.cpp b/src/widgets/itemviews/qitemeditorfactory.cpp
index b580f0e840..1d8e03569d 100644
--- a/src/widgets/itemviews/qitemeditorfactory.cpp
+++ b/src/widgets/itemviews/qitemeditorfactory.cpp
@@ -233,8 +233,8 @@ class QDefaultItemEditorFactory : public QItemEditorFactory
{
public:
inline QDefaultItemEditorFactory() {}
- QWidget *createEditor(int userType, QWidget *parent) const Q_DECL_OVERRIDE;
- QByteArray valuePropertyName(int) const Q_DECL_OVERRIDE;
+ QWidget *createEditor(int userType, QWidget *parent) const override;
+ QByteArray valuePropertyName(int) const override;
};
QWidget *QDefaultItemEditorFactory::createEditor(int userType, QWidget *parent) const
diff --git a/src/widgets/itemviews/qitemeditorfactory_p.h b/src/widgets/itemviews/qitemeditorfactory_p.h
index 46a8da1d8f..e78f42b729 100644
--- a/src/widgets/itemviews/qitemeditorfactory_p.h
+++ b/src/widgets/itemviews/qitemeditorfactory_p.h
@@ -74,7 +74,7 @@ public:
}
protected:
- void changeEvent(QEvent *e) Q_DECL_OVERRIDE;
+ void changeEvent(QEvent *e) override;
public Q_SLOTS:
void resizeToContents();
diff --git a/src/widgets/itemviews/qlistview.h b/src/widgets/itemviews/qlistview.h
index 66ec9b18b1..2da510facf 100644
--- a/src/widgets/itemviews/qlistview.h
+++ b/src/widgets/itemviews/qlistview.h
@@ -78,7 +78,7 @@ public:
enum ViewMode { ListMode, IconMode };
Q_ENUM(ViewMode)
- explicit QListView(QWidget *parent = Q_NULLPTR);
+ explicit QListView(QWidget *parent = nullptr);
~QListView();
void setMovement(Movement movement);
@@ -125,67 +125,67 @@ public:
void setSelectionRectVisible(bool show);
bool isSelectionRectVisible() const;
- QRect visualRect(const QModelIndex &index) const Q_DECL_OVERRIDE;
- void scrollTo(const QModelIndex &index, ScrollHint hint = EnsureVisible) Q_DECL_OVERRIDE;
- QModelIndex indexAt(const QPoint &p) const Q_DECL_OVERRIDE;
+ QRect visualRect(const QModelIndex &index) const override;
+ void scrollTo(const QModelIndex &index, ScrollHint hint = EnsureVisible) override;
+ QModelIndex indexAt(const QPoint &p) const override;
- void doItemsLayout() Q_DECL_OVERRIDE;
- void reset() Q_DECL_OVERRIDE;
- void setRootIndex(const QModelIndex &index) Q_DECL_OVERRIDE;
+ void doItemsLayout() override;
+ void reset() override;
+ void setRootIndex(const QModelIndex &index) override;
Q_SIGNALS:
void indexesMoved(const QModelIndexList &indexes);
protected:
- QListView(QListViewPrivate &, QWidget *parent = Q_NULLPTR);
+ QListView(QListViewPrivate &, QWidget *parent = nullptr);
- bool event(QEvent *e) Q_DECL_OVERRIDE;
+ bool event(QEvent *e) override;
- void scrollContentsBy(int dx, int dy) Q_DECL_OVERRIDE;
+ void scrollContentsBy(int dx, int dy) override;
void resizeContents(int width, int height);
QSize contentsSize() const;
- void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &roles = QVector<int>()) Q_DECL_OVERRIDE;
- void rowsInserted(const QModelIndex &parent, int start, int end) Q_DECL_OVERRIDE;
- void rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end) Q_DECL_OVERRIDE;
+ void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &roles = QVector<int>()) override;
+ void rowsInserted(const QModelIndex &parent, int start, int end) override;
+ void rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end) override;
- void mouseMoveEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
- void mouseReleaseEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
+ void mouseMoveEvent(QMouseEvent *e) override;
+ void mouseReleaseEvent(QMouseEvent *e) override;
#if QT_CONFIG(wheelevent)
- void wheelEvent(QWheelEvent *e) Q_DECL_OVERRIDE;
+ void wheelEvent(QWheelEvent *e) override;
#endif
- void timerEvent(QTimerEvent *e) Q_DECL_OVERRIDE;
- void resizeEvent(QResizeEvent *e) Q_DECL_OVERRIDE;
+ void timerEvent(QTimerEvent *e) override;
+ void resizeEvent(QResizeEvent *e) override;
#ifndef QT_NO_DRAGANDDROP
- void dragMoveEvent(QDragMoveEvent *e) Q_DECL_OVERRIDE;
- void dragLeaveEvent(QDragLeaveEvent *e) Q_DECL_OVERRIDE;
- void dropEvent(QDropEvent *e) Q_DECL_OVERRIDE;
- void startDrag(Qt::DropActions supportedActions) Q_DECL_OVERRIDE;
+ void dragMoveEvent(QDragMoveEvent *e) override;
+ void dragLeaveEvent(QDragLeaveEvent *e) override;
+ void dropEvent(QDropEvent *e) override;
+ void startDrag(Qt::DropActions supportedActions) override;
#endif // QT_NO_DRAGANDDROP
- QStyleOptionViewItem viewOptions() const Q_DECL_OVERRIDE;
- void paintEvent(QPaintEvent *e) Q_DECL_OVERRIDE;
+ QStyleOptionViewItem viewOptions() const override;
+ void paintEvent(QPaintEvent *e) override;
- int horizontalOffset() const Q_DECL_OVERRIDE;
- int verticalOffset() const Q_DECL_OVERRIDE;
- QModelIndex moveCursor(CursorAction cursorAction, Qt::KeyboardModifiers modifiers) Q_DECL_OVERRIDE;
+ int horizontalOffset() const override;
+ int verticalOffset() const override;
+ QModelIndex moveCursor(CursorAction cursorAction, Qt::KeyboardModifiers modifiers) override;
QRect rectForIndex(const QModelIndex &index) const;
void setPositionForIndex(const QPoint &position, const QModelIndex &index);
- void setSelection(const QRect &rect, QItemSelectionModel::SelectionFlags command) Q_DECL_OVERRIDE;
- QRegion visualRegionForSelection(const QItemSelection &selection) const Q_DECL_OVERRIDE;
- QModelIndexList selectedIndexes() const Q_DECL_OVERRIDE;
+ void setSelection(const QRect &rect, QItemSelectionModel::SelectionFlags command) override;
+ QRegion visualRegionForSelection(const QItemSelection &selection) const override;
+ QModelIndexList selectedIndexes() const override;
- void updateGeometries() Q_DECL_OVERRIDE;
+ void updateGeometries() override;
- bool isIndexHidden(const QModelIndex &index) const Q_DECL_OVERRIDE;
+ bool isIndexHidden(const QModelIndex &index) const override;
- void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected) Q_DECL_OVERRIDE;
- void currentChanged(const QModelIndex &current, const QModelIndex &previous) Q_DECL_OVERRIDE;
+ void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected) override;
+ void currentChanged(const QModelIndex &current, const QModelIndex &previous) override;
- QSize viewportSizeHint() const Q_DECL_OVERRIDE;
+ QSize viewportSizeHint() const override;
private:
int visualIndex(const QModelIndex &index) const;
diff --git a/src/widgets/itemviews/qlistwidget.cpp b/src/widgets/itemviews/qlistwidget.cpp
index 95ad3f82d0..c14dcec744 100644
--- a/src/widgets/itemviews/qlistwidget.cpp
+++ b/src/widgets/itemviews/qlistwidget.cpp
@@ -189,8 +189,9 @@ int QListModel::rowCount(const QModelIndex &parent) const
return parent.isValid() ? 0 : items.count();
}
-QModelIndex QListModel::index(QListWidgetItem *item) const
+QModelIndex QListModel::index(const QListWidgetItem *item_) const
{
+ QListWidgetItem *item = const_cast<QListWidgetItem *>(item_);
if (!item || !item->view || static_cast<const QListModel *>(item->view->model()) != this
|| items.isEmpty())
return QModelIndex();
@@ -1942,14 +1943,28 @@ QList<QListWidgetItem*> QListWidget::items(const QMimeData *data) const
/*!
Returns the QModelIndex associated with the given \a item.
+
+ \note In Qt versions prior to 5.10, this function took a non-\c{const} \a item.
*/
-QModelIndex QListWidget::indexFromItem(QListWidgetItem *item) const
+QModelIndex QListWidget::indexFromItem(const QListWidgetItem *item) const
{
Q_D(const QListWidget);
return d->listModel()->index(item);
}
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
+/*!
+ \internal
+ \obsolete
+ \overload
+*/
+QModelIndex QListWidget::indexFromItem(QListWidgetItem *item) const
+{
+ return indexFromItem(const_cast<const QListWidgetItem *>(item));
+}
+#endif
+
/*!
Returns a pointer to the QListWidgetItem associated with the given \a index.
*/
diff --git a/src/widgets/itemviews/qlistwidget.h b/src/widgets/itemviews/qlistwidget.h
index 50f4e2ac84..3caa5ce6f2 100644
--- a/src/widgets/itemviews/qlistwidget.h
+++ b/src/widgets/itemviews/qlistwidget.h
@@ -61,10 +61,10 @@ class Q_WIDGETS_EXPORT QListWidgetItem
friend class QListWidget;
public:
enum ItemType { Type = 0, UserType = 1000 };
- explicit QListWidgetItem(QListWidget *view = Q_NULLPTR, int type = Type);
- explicit QListWidgetItem(const QString &text, QListWidget *view = Q_NULLPTR, int type = Type);
+ explicit QListWidgetItem(QListWidget *view = nullptr, int type = Type);
+ explicit QListWidgetItem(const QString &text, QListWidget *view = nullptr, int type = Type);
explicit QListWidgetItem(const QIcon &icon, const QString &text,
- QListWidget *view = Q_NULLPTR, int type = Type);
+ QListWidget *view = nullptr, int type = Type);
QListWidgetItem(const QListWidgetItem &other);
virtual ~QListWidgetItem();
@@ -204,10 +204,10 @@ class Q_WIDGETS_EXPORT QListWidget : public QListView
friend class QListWidgetItem;
friend class QListModel;
public:
- explicit QListWidget(QWidget *parent = Q_NULLPTR);
+ explicit QListWidget(QWidget *parent = nullptr);
~QListWidget();
- void setSelectionModel(QItemSelectionModel *selectionModel) Q_DECL_OVERRIDE;
+ void setSelectionModel(QItemSelectionModel *selectionModel) override;
QListWidgetItem *item(int row) const;
int row(const QListWidgetItem *item) const;
@@ -257,7 +257,7 @@ public:
protected:
#endif
#if QT_CONFIG(draganddrop)
- void dropEvent(QDropEvent *event) Q_DECL_OVERRIDE;
+ void dropEvent(QDropEvent *event) override;
#endif
public Q_SLOTS:
void scrollToItem(const QListWidgetItem *item, QAbstractItemView::ScrollHint hint = EnsureVisible);
@@ -278,7 +278,7 @@ Q_SIGNALS:
void itemSelectionChanged();
protected:
- bool event(QEvent *e) Q_DECL_OVERRIDE;
+ bool event(QEvent *e) override;
virtual QStringList mimeTypes() const;
#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
virtual QMimeData *mimeData(const QList<QListWidgetItem *> &items) const;
@@ -297,11 +297,14 @@ protected:
#endif
QList<QListWidgetItem*> items(const QMimeData *data) const;
- QModelIndex indexFromItem(QListWidgetItem *item) const;
+ QModelIndex indexFromItem(const QListWidgetItem *item) const;
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
+ QModelIndex indexFromItem(QListWidgetItem *item) const; // ### Qt 6: remove
+#endif
QListWidgetItem *itemFromIndex(const QModelIndex &index) const;
private:
- void setModel(QAbstractItemModel *model) Q_DECL_OVERRIDE;
+ void setModel(QAbstractItemModel *model) override;
Qt::SortOrder sortOrder() const;
Q_DECLARE_PRIVATE(QListWidget)
@@ -319,7 +322,7 @@ private:
};
inline void QListWidget::removeItemWidget(QListWidgetItem *aItem)
-{ setItemWidget(aItem, Q_NULLPTR); }
+{ setItemWidget(aItem, nullptr); }
inline void QListWidget::addItem(QListWidgetItem *aitem)
{ insertItem(count(), aitem); }
diff --git a/src/widgets/itemviews/qlistwidget_p.h b/src/widgets/itemviews/qlistwidget_p.h
index e8f5540f9c..492b05ff07 100644
--- a/src/widgets/itemviews/qlistwidget_p.h
+++ b/src/widgets/itemviews/qlistwidget_p.h
@@ -95,7 +95,7 @@ public:
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
- QModelIndex index(QListWidgetItem *item) const;
+ QModelIndex index(const QListWidgetItem *item) const;
QModelIndex index(int row, int column = 0, const QModelIndex &parent = QModelIndex()) const override;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
diff --git a/src/widgets/itemviews/qstyleditemdelegate.h b/src/widgets/itemviews/qstyleditemdelegate.h
index f3b7c4d1f4..2df2450f07 100644
--- a/src/widgets/itemviews/qstyleditemdelegate.h
+++ b/src/widgets/itemviews/qstyleditemdelegate.h
@@ -58,28 +58,28 @@ class Q_WIDGETS_EXPORT QStyledItemDelegate : public QAbstractItemDelegate
Q_OBJECT
public:
- explicit QStyledItemDelegate(QObject *parent = Q_NULLPTR);
+ explicit QStyledItemDelegate(QObject *parent = nullptr);
~QStyledItemDelegate();
// painting
void paint(QPainter *painter,
- const QStyleOptionViewItem &option, const QModelIndex &index) const Q_DECL_OVERRIDE;
+ const QStyleOptionViewItem &option, const QModelIndex &index) const override;
QSize sizeHint(const QStyleOptionViewItem &option,
- const QModelIndex &index) const Q_DECL_OVERRIDE;
+ const QModelIndex &index) const override;
// editing
QWidget *createEditor(QWidget *parent,
const QStyleOptionViewItem &option,
- const QModelIndex &index) const Q_DECL_OVERRIDE;
+ const QModelIndex &index) const override;
- void setEditorData(QWidget *editor, const QModelIndex &index) const Q_DECL_OVERRIDE;
+ void setEditorData(QWidget *editor, const QModelIndex &index) const override;
void setModelData(QWidget *editor,
QAbstractItemModel *model,
- const QModelIndex &index) const Q_DECL_OVERRIDE;
+ const QModelIndex &index) const override;
void updateEditorGeometry(QWidget *editor,
const QStyleOptionViewItem &option,
- const QModelIndex &index) const Q_DECL_OVERRIDE;
+ const QModelIndex &index) const override;
// editor factory
QItemEditorFactory *itemEditorFactory() const;
@@ -91,9 +91,9 @@ protected:
virtual void initStyleOption(QStyleOptionViewItem *option,
const QModelIndex &index) const;
- bool eventFilter(QObject *object, QEvent *event) Q_DECL_OVERRIDE;
+ bool eventFilter(QObject *object, QEvent *event) override;
bool editorEvent(QEvent *event, QAbstractItemModel *model,
- const QStyleOptionViewItem &option, const QModelIndex &index) Q_DECL_OVERRIDE;
+ const QStyleOptionViewItem &option, const QModelIndex &index) override;
private:
Q_DECLARE_PRIVATE(QStyledItemDelegate)
diff --git a/src/widgets/itemviews/qtableview.cpp b/src/widgets/itemviews/qtableview.cpp
index 8ab811e9f7..fd3bdfd065 100644
--- a/src/widgets/itemviews/qtableview.cpp
+++ b/src/widgets/itemviews/qtableview.cpp
@@ -585,7 +585,7 @@ class QTableCornerButton : public QAbstractButton
Q_OBJECT
public:
QTableCornerButton(QWidget *parent) : QAbstractButton(parent) {}
- void paintEvent(QPaintEvent*) Q_DECL_OVERRIDE {
+ void paintEvent(QPaintEvent*) override {
QStyleOptionHeader opt;
opt.init(this);
QStyle::State state = QStyle::State_None;
diff --git a/src/widgets/itemviews/qtableview.h b/src/widgets/itemviews/qtableview.h
index 75f2e7b44c..60c2f34103 100644
--- a/src/widgets/itemviews/qtableview.h
+++ b/src/widgets/itemviews/qtableview.h
@@ -62,13 +62,13 @@ class Q_WIDGETS_EXPORT QTableView : public QAbstractItemView
#endif
public:
- explicit QTableView(QWidget *parent = Q_NULLPTR);
+ explicit QTableView(QWidget *parent = nullptr);
~QTableView();
- void setModel(QAbstractItemModel *model) Q_DECL_OVERRIDE;
- void setRootIndex(const QModelIndex &index) Q_DECL_OVERRIDE;
- void setSelectionModel(QItemSelectionModel *selectionModel) Q_DECL_OVERRIDE;
- void doItemsLayout() Q_DECL_OVERRIDE;
+ void setModel(QAbstractItemModel *model) override;
+ void setRootIndex(const QModelIndex &index) override;
+ void setSelectionModel(QItemSelectionModel *selectionModel) override;
+ void doItemsLayout() override;
QHeaderView *horizontalHeader() const;
QHeaderView *verticalHeader() const;
@@ -109,9 +109,9 @@ public:
bool isCornerButtonEnabled() const;
#endif
- QRect visualRect(const QModelIndex &index) const Q_DECL_OVERRIDE;
- void scrollTo(const QModelIndex &index, ScrollHint hint = EnsureVisible) Q_DECL_OVERRIDE;
- QModelIndex indexAt(const QPoint &p) const Q_DECL_OVERRIDE;
+ QRect visualRect(const QModelIndex &index) const override;
+ void scrollTo(const QModelIndex &index, ScrollHint hint = EnsureVisible) override;
+ QModelIndex indexAt(const QPoint &p) const override;
void setSpan(int row, int column, int rowSpan, int columnSpan);
int rowSpan(int row, int column) const;
@@ -144,37 +144,37 @@ protected Q_SLOTS:
protected:
QTableView(QTableViewPrivate &, QWidget *parent);
- void scrollContentsBy(int dx, int dy) Q_DECL_OVERRIDE;
+ void scrollContentsBy(int dx, int dy) override;
- QStyleOptionViewItem viewOptions() const Q_DECL_OVERRIDE;
- void paintEvent(QPaintEvent *e) Q_DECL_OVERRIDE;
+ QStyleOptionViewItem viewOptions() const override;
+ void paintEvent(QPaintEvent *e) override;
- void timerEvent(QTimerEvent *event) Q_DECL_OVERRIDE;
+ void timerEvent(QTimerEvent *event) override;
- int horizontalOffset() const Q_DECL_OVERRIDE;
- int verticalOffset() const Q_DECL_OVERRIDE;
- QModelIndex moveCursor(CursorAction cursorAction, Qt::KeyboardModifiers modifiers) Q_DECL_OVERRIDE;
+ int horizontalOffset() const override;
+ int verticalOffset() const override;
+ QModelIndex moveCursor(CursorAction cursorAction, Qt::KeyboardModifiers modifiers) override;
- void setSelection(const QRect &rect, QItemSelectionModel::SelectionFlags command) Q_DECL_OVERRIDE;
- QRegion visualRegionForSelection(const QItemSelection &selection) const Q_DECL_OVERRIDE;
- QModelIndexList selectedIndexes() const Q_DECL_OVERRIDE;
+ void setSelection(const QRect &rect, QItemSelectionModel::SelectionFlags command) override;
+ QRegion visualRegionForSelection(const QItemSelection &selection) const override;
+ QModelIndexList selectedIndexes() const override;
- void updateGeometries() Q_DECL_OVERRIDE;
+ void updateGeometries() override;
- QSize viewportSizeHint() const Q_DECL_OVERRIDE;
+ QSize viewportSizeHint() const override;
- int sizeHintForRow(int row) const Q_DECL_OVERRIDE;
- int sizeHintForColumn(int column) const Q_DECL_OVERRIDE;
+ int sizeHintForRow(int row) const override;
+ int sizeHintForColumn(int column) const override;
- void verticalScrollbarAction(int action) Q_DECL_OVERRIDE;
- void horizontalScrollbarAction(int action) Q_DECL_OVERRIDE;
+ void verticalScrollbarAction(int action) override;
+ void horizontalScrollbarAction(int action) override;
- bool isIndexHidden(const QModelIndex &index) const Q_DECL_OVERRIDE;
+ bool isIndexHidden(const QModelIndex &index) const override;
void selectionChanged(const QItemSelection &selected,
- const QItemSelection &deselected) Q_DECL_OVERRIDE;
+ const QItemSelection &deselected) override;
void currentChanged(const QModelIndex &current,
- const QModelIndex &previous) Q_DECL_OVERRIDE;
+ const QModelIndex &previous) override;
private:
friend class QAccessibleItemView;
diff --git a/src/widgets/itemviews/qtablewidget.cpp b/src/widgets/itemviews/qtablewidget.cpp
index bb1970e3ac..a0c01e2f25 100644
--- a/src/widgets/itemviews/qtablewidget.cpp
+++ b/src/widgets/itemviews/qtablewidget.cpp
@@ -2652,14 +2652,28 @@ QList<QTableWidgetItem*> QTableWidget::items(const QMimeData *data) const
/*!
Returns the QModelIndex associated with the given \a item.
+
+ \note In Qt versions prior to 5.10, this function took a non-\c{const} \a item.
*/
-QModelIndex QTableWidget::indexFromItem(QTableWidgetItem *item) const
+QModelIndex QTableWidget::indexFromItem(const QTableWidgetItem *item) const
{
Q_D(const QTableWidget);
return d->tableModel()->index(item);
}
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
+/*!
+ \internal
+ \obsolete
+ \overload
+*/
+QModelIndex QTableWidget::indexFromItem(QTableWidgetItem *item) const
+{
+ return indexFromItem(const_cast<const QTableWidgetItem *>(item));
+}
+#endif
+
/*!
Returns a pointer to the QTableWidgetItem associated with the given \a index.
*/
diff --git a/src/widgets/itemviews/qtablewidget.h b/src/widgets/itemviews/qtablewidget.h
index 9c231d5127..7322e3aed7 100644
--- a/src/widgets/itemviews/qtablewidget.h
+++ b/src/widgets/itemviews/qtablewidget.h
@@ -219,8 +219,8 @@ class Q_WIDGETS_EXPORT QTableWidget : public QTableView
friend class QTableModel;
public:
- explicit QTableWidget(QWidget *parent = Q_NULLPTR);
- QTableWidget(int rows, int columns, QWidget *parent = Q_NULLPTR);
+ explicit QTableWidget(QWidget *parent = nullptr);
+ QTableWidget(int rows, int columns, QWidget *parent = nullptr);
~QTableWidget();
void setRowCount(int rows);
@@ -318,7 +318,7 @@ Q_SIGNALS:
void currentCellChanged(int currentRow, int currentColumn, int previousRow, int previousColumn);
protected:
- bool event(QEvent *e) Q_DECL_OVERRIDE;
+ bool event(QEvent *e) override;
virtual QStringList mimeTypes() const;
#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
virtual QMimeData *mimeData(const QList<QTableWidgetItem *> &items) const;
@@ -335,15 +335,18 @@ protected:
#endif
QList<QTableWidgetItem*> items(const QMimeData *data) const;
- QModelIndex indexFromItem(QTableWidgetItem *item) const;
+ QModelIndex indexFromItem(const QTableWidgetItem *item) const;
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
+ QModelIndex indexFromItem(QTableWidgetItem *item) const; // ### Qt 6: remove
+#endif
QTableWidgetItem *itemFromIndex(const QModelIndex &index) const;
protected:
#if QT_CONFIG(draganddrop)
- void dropEvent(QDropEvent *event) Q_DECL_OVERRIDE;
+ void dropEvent(QDropEvent *event) override;
#endif
private:
- void setModel(QAbstractItemModel *model) Q_DECL_OVERRIDE;
+ void setModel(QAbstractItemModel *model) override;
Q_DECLARE_PRIVATE(QTableWidget)
Q_DISABLE_COPY(QTableWidget)
@@ -360,7 +363,7 @@ private:
};
inline void QTableWidget::removeCellWidget(int arow, int acolumn)
-{ setCellWidget(arow, acolumn, Q_NULLPTR); }
+{ setCellWidget(arow, acolumn, nullptr); }
inline QTableWidgetItem *QTableWidget::itemAt(int ax, int ay) const
{ return itemAt(QPoint(ax, ay)); }
diff --git a/src/widgets/itemviews/qtreeview.cpp b/src/widgets/itemviews/qtreeview.cpp
index d6d0fd4322..6ea180dcf2 100644
--- a/src/widgets/itemviews/qtreeview.cpp
+++ b/src/widgets/itemviews/qtreeview.cpp
@@ -4006,6 +4006,27 @@ int QTreeView::visualIndex(const QModelIndex &index) const
return d->viewIndex(index);
}
+/*!
+ \reimp
+*/
+
+void QTreeView::verticalScrollbarValueChanged(int value)
+{
+ Q_D(QTreeView);
+ if (!d->viewItems.isEmpty() && value == verticalScrollBar()->maximum()) {
+ QModelIndex ret = d->viewItems.last().index;
+ // Root index will be handled by base class implementation
+ while (ret.isValid()) {
+ if (isExpanded(ret) && d->model->canFetchMore(ret)) {
+ d->model->fetchMore(ret);
+ break;
+ }
+ ret = ret.parent();
+ }
+ }
+ QAbstractItemView::verticalScrollbarValueChanged(value);
+}
+
QT_END_NAMESPACE
#include "moc_qtreeview.cpp"
diff --git a/src/widgets/itemviews/qtreeview.h b/src/widgets/itemviews/qtreeview.h
index c32c127cd1..e7ee55aa2a 100644
--- a/src/widgets/itemviews/qtreeview.h
+++ b/src/widgets/itemviews/qtreeview.h
@@ -68,12 +68,12 @@ class Q_WIDGETS_EXPORT QTreeView : public QAbstractItemView
Q_PROPERTY(bool expandsOnDoubleClick READ expandsOnDoubleClick WRITE setExpandsOnDoubleClick)
public:
- explicit QTreeView(QWidget *parent = Q_NULLPTR);
+ explicit QTreeView(QWidget *parent = nullptr);
~QTreeView();
- void setModel(QAbstractItemModel *model) Q_DECL_OVERRIDE;
- void setRootIndex(const QModelIndex &index) Q_DECL_OVERRIDE;
- void setSelectionModel(QItemSelectionModel *selectionModel) Q_DECL_OVERRIDE;
+ void setModel(QAbstractItemModel *model) override;
+ void setRootIndex(const QModelIndex &index) override;
+ void setSelectionModel(QItemSelectionModel *selectionModel) override;
QHeaderView *header() const;
void setHeader(QHeaderView *header);
@@ -132,21 +132,21 @@ public:
void setTreePosition(int logicalIndex);
int treePosition() const;
- void keyboardSearch(const QString &search) Q_DECL_OVERRIDE;
+ void keyboardSearch(const QString &search) override;
- QRect visualRect(const QModelIndex &index) const Q_DECL_OVERRIDE;
- void scrollTo(const QModelIndex &index, ScrollHint hint = EnsureVisible) Q_DECL_OVERRIDE;
- QModelIndex indexAt(const QPoint &p) const Q_DECL_OVERRIDE;
+ QRect visualRect(const QModelIndex &index) const override;
+ void scrollTo(const QModelIndex &index, ScrollHint hint = EnsureVisible) override;
+ QModelIndex indexAt(const QPoint &p) const override;
QModelIndex indexAbove(const QModelIndex &index) const;
QModelIndex indexBelow(const QModelIndex &index) const;
- void doItemsLayout() Q_DECL_OVERRIDE;
- void reset() Q_DECL_OVERRIDE;
+ void doItemsLayout() override;
+ void reset() override;
void sortByColumn(int column, Qt::SortOrder order);
- void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &roles = QVector<int>()) Q_DECL_OVERRIDE;
- void selectAll() Q_DECL_OVERRIDE;
+ void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &roles = QVector<int>()) override;
+ void selectAll() override;
Q_SIGNALS:
void expanded(const QModelIndex &index);
@@ -169,23 +169,24 @@ protected Q_SLOTS:
void columnMoved();
void reexpand();
void rowsRemoved(const QModelIndex &parent, int first, int last);
+ void verticalScrollbarValueChanged(int value) override;
protected:
- QTreeView(QTreeViewPrivate &dd, QWidget *parent = Q_NULLPTR);
- void scrollContentsBy(int dx, int dy) Q_DECL_OVERRIDE;
- void rowsInserted(const QModelIndex &parent, int start, int end) Q_DECL_OVERRIDE;
- void rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end) Q_DECL_OVERRIDE;
+ QTreeView(QTreeViewPrivate &dd, QWidget *parent = nullptr);
+ void scrollContentsBy(int dx, int dy) override;
+ void rowsInserted(const QModelIndex &parent, int start, int end) override;
+ void rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end) override;
- QModelIndex moveCursor(CursorAction cursorAction, Qt::KeyboardModifiers modifiers) Q_DECL_OVERRIDE;
- int horizontalOffset() const Q_DECL_OVERRIDE;
- int verticalOffset() const Q_DECL_OVERRIDE;
+ QModelIndex moveCursor(CursorAction cursorAction, Qt::KeyboardModifiers modifiers) override;
+ int horizontalOffset() const override;
+ int verticalOffset() const override;
- void setSelection(const QRect &rect, QItemSelectionModel::SelectionFlags command) Q_DECL_OVERRIDE;
- QRegion visualRegionForSelection(const QItemSelection &selection) const Q_DECL_OVERRIDE;
- QModelIndexList selectedIndexes() const Q_DECL_OVERRIDE;
+ void setSelection(const QRect &rect, QItemSelectionModel::SelectionFlags command) override;
+ QRegion visualRegionForSelection(const QItemSelection &selection) const override;
+ QModelIndexList selectedIndexes() const override;
- void timerEvent(QTimerEvent *event) Q_DECL_OVERRIDE;
- void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
+ void timerEvent(QTimerEvent *event) override;
+ void paintEvent(QPaintEvent *event) override;
void drawTree(QPainter *painter, const QRegion &region) const;
virtual void drawRow(QPainter *painter,
@@ -195,30 +196,30 @@ protected:
const QRect &rect,
const QModelIndex &index) const;
- void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
- void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
- void mouseDoubleClickEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
- void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
- void keyPressEvent(QKeyEvent *event) Q_DECL_OVERRIDE;
+ void mousePressEvent(QMouseEvent *event) override;
+ void mouseReleaseEvent(QMouseEvent *event) override;
+ void mouseDoubleClickEvent(QMouseEvent *event) override;
+ void mouseMoveEvent(QMouseEvent *event) override;
+ void keyPressEvent(QKeyEvent *event) override;
#ifndef QT_NO_DRAGANDDROP
- void dragMoveEvent(QDragMoveEvent *event) Q_DECL_OVERRIDE;
+ void dragMoveEvent(QDragMoveEvent *event) override;
#endif
- bool viewportEvent(QEvent *event) Q_DECL_OVERRIDE;
+ bool viewportEvent(QEvent *event) override;
- void updateGeometries() Q_DECL_OVERRIDE;
+ void updateGeometries() override;
- QSize viewportSizeHint() const Q_DECL_OVERRIDE;
+ QSize viewportSizeHint() const override;
- int sizeHintForColumn(int column) const Q_DECL_OVERRIDE;
+ int sizeHintForColumn(int column) const override;
int indexRowSizeHint(const QModelIndex &index) const;
int rowHeight(const QModelIndex &index) const;
- void horizontalScrollbarAction(int action) Q_DECL_OVERRIDE;
+ void horizontalScrollbarAction(int action) override;
- bool isIndexHidden(const QModelIndex &index) const Q_DECL_OVERRIDE;
+ bool isIndexHidden(const QModelIndex &index) const override;
void selectionChanged(const QItemSelection &selected,
- const QItemSelection &deselected) Q_DECL_OVERRIDE;
- void currentChanged(const QModelIndex &current, const QModelIndex &previous) Q_DECL_OVERRIDE;
+ const QItemSelection &deselected) override;
+ void currentChanged(const QModelIndex &current, const QModelIndex &previous) override;
private:
friend class ::tst_QTreeView;
diff --git a/src/widgets/itemviews/qtreewidget.cpp b/src/widgets/itemviews/qtreewidget.cpp
index d7b46a0835..601ed44b55 100644
--- a/src/widgets/itemviews/qtreewidget.cpp
+++ b/src/widgets/itemviews/qtreewidget.cpp
@@ -145,7 +145,7 @@ QTreeModel::QTreeModel(QTreeModelPrivate &dd, QTreeWidget *parent)
QTreeModel::~QTreeModel()
{
clear();
- headerItem->view = Q_NULLPTR;
+ headerItem->view = nullptr;
delete headerItem;
rootItem->view = 0;
delete rootItem;
@@ -3366,6 +3366,7 @@ QModelIndex QTreeWidget::indexFromItem(const QTreeWidgetItem *item, int column)
return d->index(item, column);
}
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
/*!
\overload
\internal
@@ -3374,6 +3375,7 @@ QModelIndex QTreeWidget::indexFromItem(QTreeWidgetItem *item, int column) const
{
return indexFromItem(const_cast<const QTreeWidgetItem *>(item), column);
}
+#endif
/*!
Returns a pointer to the QTreeWidgetItem associated with the given \a index.
diff --git a/src/widgets/itemviews/qtreewidget.h b/src/widgets/itemviews/qtreewidget.h
index 783627cde9..a31af0428a 100644
--- a/src/widgets/itemviews/qtreewidget.h
+++ b/src/widgets/itemviews/qtreewidget.h
@@ -178,7 +178,7 @@ public:
inline QTreeWidgetItem *parent() const { return par; }
inline QTreeWidgetItem *child(int index) const {
if (index < 0 || index >= children.size())
- return Q_NULLPTR;
+ return nullptr;
executePendingSort();
return children.at(index);
}
@@ -261,7 +261,7 @@ class Q_WIDGETS_EXPORT QTreeWidget : public QTreeView
friend class QTreeModel;
friend class QTreeWidgetItem;
public:
- explicit QTreeWidget(QWidget *parent = Q_NULLPTR);
+ explicit QTreeWidget(QWidget *parent = nullptr);
~QTreeWidget();
int columnCount() const;
@@ -324,7 +324,7 @@ public:
QTreeWidgetItem *itemAbove(const QTreeWidgetItem *item) const;
QTreeWidgetItem *itemBelow(const QTreeWidgetItem *item) const;
- void setSelectionModel(QItemSelectionModel *selectionModel) Q_DECL_OVERRIDE;
+ void setSelectionModel(QItemSelectionModel *selectionModel) override;
public Q_SLOTS:
void scrollToItem(const QTreeWidgetItem *item,
@@ -346,7 +346,7 @@ Q_SIGNALS:
void itemSelectionChanged();
protected:
- bool event(QEvent *e) Q_DECL_OVERRIDE;
+ bool event(QEvent *e) override;
virtual QStringList mimeTypes() const;
#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
virtual QMimeData *mimeData(const QList<QTreeWidgetItem *> &items) const;
@@ -365,15 +365,17 @@ protected:
QList<QTreeWidgetItem*> items(const QMimeData *data) const;
QModelIndex indexFromItem(const QTreeWidgetItem *item, int column = 0) const;
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QModelIndex indexFromItem(QTreeWidgetItem *item, int column = 0) const; // ### Qt 6: remove
+#endif
QTreeWidgetItem *itemFromIndex(const QModelIndex &index) const;
protected:
#if QT_CONFIG(draganddrop)
- void dropEvent(QDropEvent *event) Q_DECL_OVERRIDE;
+ void dropEvent(QDropEvent *event) override;
#endif
private:
- void setModel(QAbstractItemModel *model) Q_DECL_OVERRIDE;
+ void setModel(QAbstractItemModel *model) override;
Q_DECLARE_PRIVATE(QTreeWidget)
Q_DISABLE_COPY(QTreeWidget)
@@ -393,7 +395,7 @@ private:
};
inline void QTreeWidget::removeItemWidget(QTreeWidgetItem *item, int column)
-{ setItemWidget(item, column, Q_NULLPTR); }
+{ setItemWidget(item, column, nullptr); }
inline QTreeWidgetItem *QTreeWidget::itemAt(int ax, int ay) const
{ return itemAt(QPoint(ax, ay)); }
diff --git a/src/widgets/itemviews/qtreewidget_p.h b/src/widgets/itemviews/qtreewidget_p.h
index 7aa4daefc0..f4625842ef 100644
--- a/src/widgets/itemviews/qtreewidget_p.h
+++ b/src/widgets/itemviews/qtreewidget_p.h
@@ -91,24 +91,24 @@ public:
void itemChanged(QTreeWidgetItem *item);
QModelIndex index(const QTreeWidgetItem *item, int column) const;
- QModelIndex index(int row, int column, const QModelIndex &parent) const Q_DECL_OVERRIDE;
- QModelIndex parent(const QModelIndex &child) const Q_DECL_OVERRIDE;
- int rowCount(const QModelIndex &parent) const Q_DECL_OVERRIDE;
- int columnCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
- bool hasChildren(const QModelIndex &parent) const Q_DECL_OVERRIDE;
+ QModelIndex index(int row, int column, const QModelIndex &parent) const override;
+ QModelIndex parent(const QModelIndex &child) const override;
+ int rowCount(const QModelIndex &parent) const override;
+ int columnCount(const QModelIndex &parent = QModelIndex()) const override;
+ bool hasChildren(const QModelIndex &parent) const override;
- QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
- bool setData(const QModelIndex &index, const QVariant &value, int role) Q_DECL_OVERRIDE;
+ QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
+ bool setData(const QModelIndex &index, const QVariant &value, int role) override;
- QMap<int, QVariant> itemData(const QModelIndex &index) const Q_DECL_OVERRIDE;
+ QMap<int, QVariant> itemData(const QModelIndex &index) const override;
- QVariant headerData(int section, Qt::Orientation orientation, int role) const Q_DECL_OVERRIDE;
+ QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
bool setHeaderData(int section, Qt::Orientation orientation, const QVariant &value,
- int role) Q_DECL_OVERRIDE;
+ int role) override;
- Qt::ItemFlags flags(const QModelIndex &index) const Q_DECL_OVERRIDE;
+ Qt::ItemFlags flags(const QModelIndex &index) const override;
- void sort(int column, Qt::SortOrder order) Q_DECL_OVERRIDE;
+ void sort(int column, Qt::SortOrder order) override;
void ensureSorted(int column, Qt::SortOrder order,
int start, int end, const QModelIndex &parent);
static bool itemLessThan(const QPair<QTreeWidgetItem*,int> &left,
@@ -120,17 +120,17 @@ public:
const QList<QTreeWidgetItem*>::iterator &end,
Qt::SortOrder order, QTreeWidgetItem *item);
- bool insertRows(int row, int count, const QModelIndex &) Q_DECL_OVERRIDE;
- bool insertColumns(int column, int count, const QModelIndex &) Q_DECL_OVERRIDE;
+ bool insertRows(int row, int count, const QModelIndex &) override;
+ bool insertColumns(int column, int count, const QModelIndex &) override;
- bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()) Q_DECL_OVERRIDE;
+ bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()) override;
// dnd
- QStringList mimeTypes() const Q_DECL_OVERRIDE;
- QMimeData *mimeData(const QModelIndexList &indexes) const Q_DECL_OVERRIDE;
+ QStringList mimeTypes() const override;
+ QMimeData *mimeData(const QModelIndexList &indexes) const override;
bool dropMimeData(const QMimeData *data, Qt::DropAction action,
- int row, int column, const QModelIndex &parent) Q_DECL_OVERRIDE;
- Qt::DropActions supportedDropActions() const Q_DECL_OVERRIDE;
+ int row, int column, const QModelIndex &parent) override;
+ Qt::DropActions supportedDropActions() const override;
QMimeData *internalMimeData() const;
@@ -145,7 +145,7 @@ protected:
void beginRemoveItems(QTreeWidgetItem *parent, int row, int count);
void endRemoveItems();
void sortItems(QList<QTreeWidgetItem*> *items, int column, Qt::SortOrder order);
- void timerEvent(QTimerEvent *) Q_DECL_OVERRIDE;
+ void timerEvent(QTimerEvent *) override;
private:
QTreeWidgetItem *rootItem;
diff --git a/src/widgets/kernel/qaction.h b/src/widgets/kernel/qaction.h
index e1d431100e..84bf92d2ac 100644
--- a/src/widgets/kernel/qaction.h
+++ b/src/widgets/kernel/qaction.h
@@ -161,7 +161,7 @@ public:
enum ActionEvent { Trigger, Hover };
void activate(ActionEvent event);
- bool showStatusText(QWidget *widget = Q_NULLPTR);
+ bool showStatusText(QWidget *widget = nullptr);
void setMenuRole(MenuRole menuRole);
MenuRole menuRole() const;
@@ -180,7 +180,7 @@ public:
#endif
protected:
- bool event(QEvent *) Q_DECL_OVERRIDE;
+ bool event(QEvent *) override;
QAction(QActionPrivate &dd, QObject *parent);
public Q_SLOTS:
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp
index 943aeaa2d9..93e2db4b1a 100644
--- a/src/widgets/kernel/qapplication.cpp
+++ b/src/widgets/kernel/qapplication.cpp
@@ -2804,7 +2804,7 @@ void QApplicationPrivate::sendSyntheticEnterLeave(QWidget *widget)
*/
QDesktopWidget *QApplication::desktop()
{
- CHECK_QAPP_INSTANCE(Q_NULLPTR)
+ CHECK_QAPP_INSTANCE(nullptr)
if (!qt_desktopWidget || // not created yet
!(qt_desktopWidget->windowType() == Qt::Desktop)) { // reparented away
qt_desktopWidget = new QDesktopWidget();
@@ -3284,7 +3284,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
// sequence, so we reset wheel_widget in case no one accepts the event
// or if we didn't get (or missed) a ScrollEnd previously.
if (spontaneous && phase == Qt::ScrollBegin)
- QApplicationPrivate::wheel_widget = Q_NULLPTR;
+ QApplicationPrivate::wheel_widget = nullptr;
const QPoint &relpos = wheel->pos();
@@ -3334,7 +3334,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
d->notify_helper(QApplicationPrivate::wheel_widget, &we);
wheel->setAccepted(we.isAccepted());
if (phase == Qt::ScrollEnd)
- QApplicationPrivate::wheel_widget = Q_NULLPTR;
+ QApplicationPrivate::wheel_widget = nullptr;
}
}
break;
diff --git a/src/widgets/kernel/qapplication.h b/src/widgets/kernel/qapplication.h
index 396d0c9474..7a5d7ba1a9 100644
--- a/src/widgets/kernel/qapplication.h
+++ b/src/widgets/kernel/qapplication.h
@@ -110,11 +110,11 @@ public:
using QGuiApplication::palette;
static QPalette palette(const QWidget *);
static QPalette palette(const char *className);
- static void setPalette(const QPalette &, const char* className = Q_NULLPTR);
+ static void setPalette(const QPalette &, const char* className = nullptr);
static QFont font();
static QFont font(const QWidget*);
static QFont font(const char *className);
- static void setFont(const QFont &, const char* className = Q_NULLPTR);
+ static void setFont(const QFont &, const char* className = nullptr);
static QFontMetrics fontMetrics();
#if QT_VERSION < 0x060000 // remove these forwarders in Qt 6
@@ -177,7 +177,7 @@ public:
#endif
static int exec();
- bool notify(QObject *, QEvent *) Q_DECL_OVERRIDE;
+ bool notify(QObject *, QEvent *) override;
#ifdef QT_KEYPAD_NAVIGATION
static Q_DECL_DEPRECATED void setKeypadNavigationEnabled(bool);
@@ -201,8 +201,8 @@ public Q_SLOTS:
static void aboutQt();
protected:
- bool event(QEvent *) Q_DECL_OVERRIDE;
- bool compressEvent(QEvent *, QObject *receiver, QPostEventList *) Q_DECL_OVERRIDE;
+ bool event(QEvent *) override;
+ bool compressEvent(QEvent *, QObject *receiver, QPostEventList *) override;
private:
Q_DISABLE_COPY(QApplication)
diff --git a/src/widgets/kernel/qapplication_p.h b/src/widgets/kernel/qapplication_p.h
index 5dca2e85f1..e83d6e5820 100644
--- a/src/widgets/kernel/qapplication_p.h
+++ b/src/widgets/kernel/qapplication_p.h
@@ -106,11 +106,11 @@ public:
QApplicationPrivate(int &argc, char **argv, int flags);
~QApplicationPrivate();
- virtual void notifyLayoutDirectionChange() Q_DECL_OVERRIDE;
- virtual void notifyActiveWindowChange(QWindow *) Q_DECL_OVERRIDE;
+ virtual void notifyLayoutDirectionChange() override;
+ virtual void notifyActiveWindowChange(QWindow *) override;
- virtual bool shouldQuit() Q_DECL_OVERRIDE;
- bool tryCloseAllWindows() Q_DECL_OVERRIDE;
+ virtual bool shouldQuit() override;
+ bool tryCloseAllWindows() override;
#if 0 // Used to be included in Qt4 for Q_WS_X11
#ifndef QT_NO_SETTINGS
@@ -122,13 +122,13 @@ public:
static QString desktopStyleKey();
- void createEventDispatcher() Q_DECL_OVERRIDE;
+ void createEventDispatcher() override;
static void dispatchEnterLeave(QWidget *enter, QWidget *leave, const QPointF &globalPosF);
- void notifyWindowIconChanged() Q_DECL_OVERRIDE;
+ void notifyWindowIconChanged() override;
//modality
- bool isWindowBlocked(QWindow *window, QWindow **blockingWindow = 0) const Q_DECL_OVERRIDE;
+ bool isWindowBlocked(QWindow *window, QWindow **blockingWindow = 0) const override;
static bool isBlockedByModal(QWidget *widget);
static bool modalState();
static bool tryModalHelper(QWidget *widget, QWidget **rettop = 0);
@@ -158,7 +158,7 @@ public:
#endif
static bool inPopupMode();
- bool popupActive() Q_DECL_OVERRIDE { return inPopupMode(); }
+ bool popupActive() override { return inPopupMode(); }
void closePopup(QWidget *popup);
void openPopup(QWidget *popup);
static void setFocusWidget(QWidget *focus, Qt::FocusReason reason);
@@ -183,9 +183,9 @@ public:
static QPalette *set_pal;
protected:
- void notifyThemeChanged() Q_DECL_OVERRIDE;
+ void notifyThemeChanged() override;
#ifndef QT_NO_DRAGANDDROP
- void notifyDragStarted(const QDrag *) Q_DECL_OVERRIDE;
+ void notifyDragStarted(const QDrag *) override;
#endif // QT_NO_DRAGANDDROP
public:
@@ -284,7 +284,7 @@ public:
ulong timestamp);
static void translateTouchCancel(QTouchDevice *device, ulong timestamp);
- QPixmap applyQIconStyleHelper(QIcon::Mode mode, const QPixmap& base) const Q_DECL_OVERRIDE;
+ QPixmap applyQIconStyleHelper(QIcon::Mode mode, const QPixmap& base) const override;
private:
static QApplicationPrivate *self;
static bool tryCloseAllWidgetWindows(QWindowList *processedWindows);
diff --git a/src/widgets/kernel/qboxlayout.cpp b/src/widgets/kernel/qboxlayout.cpp
index 588cec2b95..a368f379ad 100644
--- a/src/widgets/kernel/qboxlayout.cpp
+++ b/src/widgets/kernel/qboxlayout.cpp
@@ -124,7 +124,7 @@ public:
void calcHfw(int);
void effectiveMargins(int *left, int *top, int *right, int *bottom) const;
- QLayoutItem* replaceAt(int index, QLayoutItem*) Q_DECL_OVERRIDE;
+ QLayoutItem* replaceAt(int index, QLayoutItem*) override;
};
QBoxLayoutPrivate::~QBoxLayoutPrivate()
diff --git a/src/widgets/kernel/qboxlayout.h b/src/widgets/kernel/qboxlayout.h
index 9c7d0e593f..6bb8f8aafa 100644
--- a/src/widgets/kernel/qboxlayout.h
+++ b/src/widgets/kernel/qboxlayout.h
@@ -61,7 +61,7 @@ public:
enum Direction { LeftToRight, RightToLeft, TopToBottom, BottomToTop,
Down = TopToBottom, Up = BottomToTop };
- explicit QBoxLayout(Direction, QWidget *parent = Q_NULLPTR);
+ explicit QBoxLayout(Direction, QWidget *parent = nullptr);
~QBoxLayout();
@@ -74,7 +74,7 @@ public:
void addWidget(QWidget *, int stretch = 0, Qt::Alignment alignment = Qt::Alignment());
void addLayout(QLayout *layout, int stretch = 0);
void addStrut(int);
- void addItem(QLayoutItem *) Q_DECL_OVERRIDE;
+ void addItem(QLayoutItem *) override;
void insertSpacing(int index, int size);
void insertStretch(int index, int stretch = 0);
@@ -91,20 +91,20 @@ public:
void setStretch(int index, int stretch);
int stretch(int index) const;
- QSize sizeHint() const Q_DECL_OVERRIDE;
- QSize minimumSize() const Q_DECL_OVERRIDE;
- QSize maximumSize() const Q_DECL_OVERRIDE;
+ QSize sizeHint() const override;
+ QSize minimumSize() const override;
+ QSize maximumSize() const override;
- bool hasHeightForWidth() const Q_DECL_OVERRIDE;
- int heightForWidth(int) const Q_DECL_OVERRIDE;
- int minimumHeightForWidth(int) const Q_DECL_OVERRIDE;
+ bool hasHeightForWidth() const override;
+ int heightForWidth(int) const override;
+ int minimumHeightForWidth(int) const override;
- Qt::Orientations expandingDirections() const Q_DECL_OVERRIDE;
- void invalidate() Q_DECL_OVERRIDE;
- QLayoutItem *itemAt(int) const Q_DECL_OVERRIDE;
- QLayoutItem *takeAt(int) Q_DECL_OVERRIDE;
- int count() const Q_DECL_OVERRIDE;
- void setGeometry(const QRect&) Q_DECL_OVERRIDE;
+ Qt::Orientations expandingDirections() const override;
+ void invalidate() override;
+ QLayoutItem *itemAt(int) const override;
+ QLayoutItem *takeAt(int) override;
+ int count() const override;
+ void setGeometry(const QRect&) override;
private:
Q_DISABLE_COPY(QBoxLayout)
diff --git a/src/widgets/kernel/qdesktopwidget.cpp b/src/widgets/kernel/qdesktopwidget.cpp
index 1b9cf88efe..5fb7882932 100644
--- a/src/widgets/kernel/qdesktopwidget.cpp
+++ b/src/widgets/kernel/qdesktopwidget.cpp
@@ -50,7 +50,7 @@
QT_BEGIN_NAMESPACE
QDesktopScreenWidget::QDesktopScreenWidget(QScreen *screen, const QRect &geometry)
- : QWidget(Q_NULLPTR, Qt::Desktop), m_screen(screen)
+ : QWidget(nullptr, Qt::Desktop), m_screen(screen)
{
setVisible(false);
if (QWindow *winHandle = windowHandle())
@@ -114,7 +114,7 @@ QDesktopScreenWidget *QDesktopWidgetPrivate::widgetForScreen(QScreen *qScreen) c
if (widget->screen() == qScreen)
return widget;
}
- return Q_NULLPTR;
+ return nullptr;
}
void QDesktopWidgetPrivate::_q_updateScreens()
@@ -176,17 +176,26 @@ void QDesktopWidgetPrivate::_q_updateScreens()
// Notice that we trigger screenCountChanged even if a screen was removed and another one added,
// in which case the total number of screens did not change. This is the only way for applications
// to notice that a screen was swapped out against another one.
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
emit q->screenCountChanged(targetLength);
+QT_WARNING_POP
}
foreach (int changedScreen, changedScreens)
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
emit q->resized(changedScreen);
+QT_WARNING_POP
}
void QDesktopWidgetPrivate::_q_availableGeometryChanged()
{
Q_Q(QDesktopWidget);
if (QScreen *screen = qobject_cast<QScreen *>(q->sender()))
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
emit q->workAreaResized(QGuiApplication::screens().indexOf(screen));
+QT_WARNING_POP
}
QDesktopWidget::QDesktopWidget()
@@ -268,13 +277,8 @@ const QRect QDesktopWidget::availableGeometry(int screenNo) const
const QRect QDesktopWidgetPrivate::availableGeometry(int screenNo)
{
- QList<QScreen *> screens = QGuiApplication::screens();
- if (screenNo == -1)
- screenNo = 0;
- if (screenNo < 0 || screenNo >= screens.size())
- return QRect();
- else
- return screens.at(screenNo)->availableGeometry();
+ const QScreen *screen = QDesktopWidgetPrivate::screen(screenNo);
+ return screen ? screen->availableGeometry() : QRect();
}
const QRect QDesktopWidget::screenGeometry(int screenNo) const
@@ -284,13 +288,8 @@ const QRect QDesktopWidget::screenGeometry(int screenNo) const
const QRect QDesktopWidgetPrivate::screenGeometry(int screenNo)
{
- QList<QScreen *> screens = QGuiApplication::screens();
- if (screenNo == -1)
- screenNo = 0;
- if (screenNo < 0 || screenNo >= screens.size())
- return QRect();
- else
- return screens.at(screenNo)->geometry();
+ const QScreen *screen = QDesktopWidgetPrivate::screen(screenNo);
+ return screen ? screen->geometry() : QRect();
}
int QDesktopWidget::screenNumber(const QWidget *w) const
@@ -330,7 +329,7 @@ int QDesktopWidgetPrivate::screenNumber(const QWidget *w)
if (!w->isWindow())
frame.moveTopLeft(w->mapToGlobal(QPoint(0, 0)));
- QScreen *widgetScreen = Q_NULLPTR;
+ QScreen *widgetScreen = nullptr;
int largestArea = 0;
foreach (QScreen *screen, screens) {
const QRect deviceIndependentScreenGeometry =
@@ -356,6 +355,16 @@ int QDesktopWidgetPrivate::screenNumber(const QPoint &p)
return screen ? QGuiApplication::screens().indexOf(screen) : primaryScreen();
}
+QScreen *QDesktopWidgetPrivate::screen(int screenNo)
+{
+ QList<QScreen *> screens = QGuiApplication::screens();
+ if (screenNo == -1)
+ screenNo = 0;
+ if (screenNo < 0 || screenNo >= screens.size())
+ return nullptr;
+ return screens.at(screenNo);
+}
+
void QDesktopWidget::resizeEvent(QResizeEvent *)
{
}
diff --git a/src/widgets/kernel/qdesktopwidget.h b/src/widgets/kernel/qdesktopwidget.h
index 64e1c568eb..f53d0fe9bb 100644
--- a/src/widgets/kernel/qdesktopwidget.h
+++ b/src/widgets/kernel/qdesktopwidget.h
@@ -59,35 +59,48 @@ public:
QDesktopWidget();
~QDesktopWidget();
- bool isVirtualDesktop() const;
+ int screenNumber(const QWidget *widget = nullptr) const;
+ const QRect screenGeometry(const QWidget *widget) const;
+ const QRect availableGeometry(const QWidget *widget) const;
- int numScreens() const;
- int screenCount() const;
- int primaryScreen() const;
+#if QT_DEPRECATED_SINCE(5, 11)
+ QT_DEPRECATED_X("Use QScreen::virtualSiblings() of primary screen") bool isVirtualDesktop() const;
- int screenNumber(const QWidget *widget = Q_NULLPTR) const;
- int screenNumber(const QPoint &) const;
+ QT_DEPRECATED_X("Use QGuiApplication::screens()") int numScreens() const;
+ QT_DEPRECATED_X("Use QGuiApplication::screens()") int screenCount() const;
+ QT_DEPRECATED_X("Use QGuiApplication::primaryScreen()") int primaryScreen() const;
- QWidget *screen(int screen = -1);
+ QT_DEPRECATED_X("Use QGuiApplication::screenAt()") int screenNumber(const QPoint &) const;
- const QRect screenGeometry(int screen = -1) const;
- const QRect screenGeometry(const QWidget *widget) const;
- const QRect screenGeometry(const QPoint &point) const
- { return screenGeometry(screenNumber(point)); }
+ QT_DEPRECATED_X("Use QScreen") QWidget *screen(int screen = -1);
- const QRect availableGeometry(int screen = -1) const;
- const QRect availableGeometry(const QWidget *widget) const;
- const QRect availableGeometry(const QPoint &point) const
- { return availableGeometry(screenNumber(point)); }
+ QT_DEPRECATED_X("Use QGuiApplication::screens()") const QRect screenGeometry(int screen = -1) const;
+ QT_DEPRECATED_X("Use QGuiApplication::screenAt()") const QRect screenGeometry(const QPoint &point) const
+ {
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
+ return screenGeometry(screenNumber(point));
+QT_WARNING_POP
+ }
+
+ QT_DEPRECATED_X("Use QGuiApplication::screens()") const QRect availableGeometry(int screen = -1) const;
+ QT_DEPRECATED_X("Use QGuiApplication::screenAt()") const QRect availableGeometry(const QPoint &point) const
+ {
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
+ return availableGeometry(screenNumber(point));
+QT_WARNING_POP
+ }
Q_SIGNALS:
- void resized(int);
- void workAreaResized(int);
- void screenCountChanged(int);
- void primaryScreenChanged();
+ QT_DEPRECATED_X("Use QScreen::geometryChanged()") void resized(int);
+ QT_DEPRECATED_X("Use QScreen::availableGeometryChanged()") void workAreaResized(int);
+ QT_DEPRECATED_X("Use QGuiApplication::screenAdded/Removed()") void screenCountChanged(int);
+ QT_DEPRECATED_X("Use QGuiApplication::primaryScreenChanged()") void primaryScreenChanged();
+#endif
protected:
- void resizeEvent(QResizeEvent *e) Q_DECL_OVERRIDE;
+ void resizeEvent(QResizeEvent *e) override;
private:
Q_DISABLE_COPY(QDesktopWidget)
@@ -100,7 +113,12 @@ private:
};
inline int QDesktopWidget::screenCount() const
-{ return numScreens(); }
+{
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
+ return numScreens();
+QT_WARNING_POP
+}
QT_END_NAMESPACE
diff --git a/src/widgets/kernel/qdesktopwidget.qdoc b/src/widgets/kernel/qdesktopwidget.qdoc
index fdf6a27597..dd2d9535ae 100644
--- a/src/widgets/kernel/qdesktopwidget.qdoc
+++ b/src/widgets/kernel/qdesktopwidget.qdoc
@@ -32,6 +32,7 @@
\ingroup advanced
\ingroup desktop
\inmodule QtWidgets
+ \obsolete
Systems with more than one graphics card and monitor can manage the
physical screen space available either as multiple desktops, or as a
@@ -125,7 +126,7 @@
\obsolete
- This function is deprecated. Use screenCount instead.
+ Use QGuiApplication::screens() instead.
\sa primaryScreen
*/
@@ -140,6 +141,10 @@
have the geometry of the entire virtual desktop; i.e., bounding
every \a screen.
+ \obsolete
+
+ Use QScreen instead.
+
\sa primaryScreen, screenCount, virtualDesktop
*/
@@ -152,6 +157,10 @@
on \macos, or the task bar on Windows). The default screen is used if
\a screen is -1.
+ \obsolete
+
+ Use QGuiApplication::screens() instead.
+
\sa screenNumber(), screenGeometry(), QScreen::availableGeometry()
*/
@@ -170,6 +179,10 @@
Returns the available geometry of the screen which contains \a p.
+ \obsolete
+
+ Use QGuiApplication::screenAt() instead.
+
\sa screenGeometry()
*/
@@ -180,6 +193,10 @@
Returns the geometry of the screen with index \a screen. The default
screen is used if \a screen is -1.
+ \obsolete
+
+ Use QGuiApplication::screens() instead.
+
\sa screenNumber()
*/
@@ -195,6 +212,10 @@
\overload
Returns the geometry of the screen which contains \a p.
+
+ \obsolete
+
+ Use QGuiApplication::screenAt() instead.
*/
@@ -214,30 +235,47 @@
Returns the index of the screen that contains the \a point, or the
screen which is the shortest distance from the \a point.
+ \obsolete
+
+ Use QGuiApplication::screenAt() instead.
+
\sa primaryScreen
*/
/*!
\fn void QDesktopWidget::resizeEvent(QResizeEvent *event)
\reimp
+ \internal
*/
/*!
\fn void QDesktopWidget::resized(int screen)
This signal is emitted when the size of \a screen changes.
+
+ \obsolete
+
+ Use QScreen::geometryChanged() instead.
*/
/*!
\fn void QDesktopWidget::workAreaResized(int screen)
This signal is emitted when the work area available on \a screen changes.
+
+ \obsolete
+
+ Use QScreen::availableGeometryChanged() instead.
*/
/*!
\property QDesktopWidget::screenCount
\brief the number of screens currently available on the system.
+ \obsolete
+
+ Use QGuiApplication::screens() instead.
+
\since 4.6
*/
@@ -245,6 +283,10 @@
\property QDesktopWidget::primaryScreen
\brief the index of the screen that is configured to be the primary screen
on the system.
+
+ \obsolete
+
+ Use QGuiApplication::primaryScreen() instead.
*/
/*!
@@ -255,6 +297,10 @@
For virtual desktops, screen() will always return the same widget.
The size of the virtual desktop is the size of this desktop
widget.
+
+ \obsolete
+
+ Use QScreen::virtualSiblings() of primary screen instead.
*/
/*!
@@ -264,6 +310,10 @@
This signal is emitted when the number of screens changes to \a newCount.
+ \obsolete
+
+ Use QGuiApplication::screenAdded and QGuiApplication::screenRemoved() instead.
+
\sa screenCount
*/
@@ -278,5 +328,9 @@
\note This doesn't mean the QDesktopWidget::primaryScreen index will
necessarily be different, but now it will refer to the new primary screen.
+ \obsolete
+
+ Use QGuiApplication::primaryScreenChanged() instead.
+
\sa primaryScreen, screenGeometry()
*/
diff --git a/src/widgets/kernel/qdesktopwidget_p.h b/src/widgets/kernel/qdesktopwidget_p.h
index 7a66661771..69f87337b3 100644
--- a/src/widgets/kernel/qdesktopwidget_p.h
+++ b/src/widgets/kernel/qdesktopwidget_p.h
@@ -100,6 +100,8 @@ public:
static int screenNumber(const QWidget *widget = nullptr);
static int screenNumber(const QPoint &);
+ static QScreen *screen(int screenNo = -1);
+
static const QRect screenGeometry(int screen = -1);
static const QRect screenGeometry(const QWidget *widget);
static const QRect screenGeometry(const QPoint &point)
diff --git a/src/widgets/kernel/qformlayout.cpp b/src/widgets/kernel/qformlayout.cpp
index 868ac17b6f..8a5b863bb5 100644
--- a/src/widgets/kernel/qformlayout.cpp
+++ b/src/widgets/kernel/qformlayout.cpp
@@ -224,7 +224,7 @@ public:
int hSpacing;
int vSpacing;
- QLayoutItem* replaceAt(int index, QLayoutItem*) Q_DECL_OVERRIDE;
+ QLayoutItem* replaceAt(int index, QLayoutItem*) override;
};
QFormLayoutPrivate::QFormLayoutPrivate()
diff --git a/src/widgets/kernel/qformlayout.h b/src/widgets/kernel/qformlayout.h
index 5ec27433d3..40424f2a49 100644
--- a/src/widgets/kernel/qformlayout.h
+++ b/src/widgets/kernel/qformlayout.h
@@ -88,7 +88,7 @@ public:
QLayoutItem *fieldItem;
};
- explicit QFormLayout(QWidget *parent = Q_NULLPTR);
+ explicit QFormLayout(QWidget *parent = nullptr);
~QFormLayout();
void setFieldGrowthPolicy(FieldGrowthPolicy policy);
@@ -142,19 +142,19 @@ public:
QWidget *labelForField(QLayout *field) const;
// reimplemented from QLayout
- void addItem(QLayoutItem *item) Q_DECL_OVERRIDE;
- QLayoutItem *itemAt(int index) const Q_DECL_OVERRIDE;
- QLayoutItem *takeAt(int index) Q_DECL_OVERRIDE;
-
- void setGeometry(const QRect &rect) Q_DECL_OVERRIDE;
- QSize minimumSize() const Q_DECL_OVERRIDE;
- QSize sizeHint() const Q_DECL_OVERRIDE;
- void invalidate() Q_DECL_OVERRIDE;
-
- bool hasHeightForWidth() const Q_DECL_OVERRIDE;
- int heightForWidth(int width) const Q_DECL_OVERRIDE;
- Qt::Orientations expandingDirections() const Q_DECL_OVERRIDE;
- int count() const Q_DECL_OVERRIDE;
+ void addItem(QLayoutItem *item) override;
+ QLayoutItem *itemAt(int index) const override;
+ QLayoutItem *takeAt(int index) override;
+
+ void setGeometry(const QRect &rect) override;
+ QSize minimumSize() const override;
+ QSize sizeHint() const override;
+ void invalidate() override;
+
+ bool hasHeightForWidth() const override;
+ int heightForWidth(int width) const override;
+ Qt::Orientations expandingDirections() const override;
+ int count() const override;
int rowCount() const;
diff --git a/src/widgets/kernel/qgesture.h b/src/widgets/kernel/qgesture.h
index 1eda611d64..c5b2cee83d 100644
--- a/src/widgets/kernel/qgesture.h
+++ b/src/widgets/kernel/qgesture.h
@@ -70,7 +70,7 @@ class Q_WIDGETS_EXPORT QGesture : public QObject
Q_PROPERTY(bool hasHotSpot READ hasHotSpot)
public:
- explicit QGesture(QObject *parent = Q_NULLPTR);
+ explicit QGesture(QObject *parent = nullptr);
~QGesture();
Qt::GestureType gestureType() const;
@@ -114,7 +114,7 @@ class Q_WIDGETS_EXPORT QPanGesture : public QGesture
Q_PRIVATE_PROPERTY(QPanGesture::d_func(), qreal verticalVelocity READ verticalVelocity WRITE setVerticalVelocity)
public:
- explicit QPanGesture(QObject *parent = Q_NULLPTR);
+ explicit QPanGesture(QObject *parent = nullptr);
~QPanGesture();
QPointF lastOffset() const;
@@ -162,7 +162,7 @@ public:
Q_PROPERTY(QPointF centerPoint READ centerPoint WRITE setCenterPoint)
public:
- explicit QPinchGesture(QObject *parent = Q_NULLPTR);
+ explicit QPinchGesture(QObject *parent = nullptr);
~QPinchGesture();
ChangeFlags totalChangeFlags() const;
@@ -218,7 +218,7 @@ public:
enum SwipeDirection { NoDirection, Left, Right, Up, Down };
Q_ENUM(SwipeDirection)
- explicit QSwipeGesture(QObject *parent = Q_NULLPTR);
+ explicit QSwipeGesture(QObject *parent = nullptr);
~QSwipeGesture();
SwipeDirection horizontalDirection() const;
@@ -239,7 +239,7 @@ class Q_WIDGETS_EXPORT QTapGesture : public QGesture
Q_PROPERTY(QPointF position READ position WRITE setPosition)
public:
- explicit QTapGesture(QObject *parent = Q_NULLPTR);
+ explicit QTapGesture(QObject *parent = nullptr);
~QTapGesture();
QPointF position() const;
@@ -257,7 +257,7 @@ class Q_WIDGETS_EXPORT QTapAndHoldGesture : public QGesture
Q_PROPERTY(QPointF position READ position WRITE setPosition)
public:
- explicit QTapAndHoldGesture(QObject *parent = Q_NULLPTR);
+ explicit QTapAndHoldGesture(QObject *parent = nullptr);
~QTapAndHoldGesture();
QPointF position() const;
diff --git a/src/widgets/kernel/qgridlayout.cpp b/src/widgets/kernel/qgridlayout.cpp
index 29df38f19c..db8ef89477 100644
--- a/src/widgets/kernel/qgridlayout.cpp
+++ b/src/widgets/kernel/qgridlayout.cpp
@@ -170,7 +170,7 @@ public:
}
return 0;
}
- QLayoutItem* replaceAt(int index, QLayoutItem *newitem) Q_DECL_OVERRIDE
+ QLayoutItem* replaceAt(int index, QLayoutItem *newitem) override
{
if (!newitem)
return 0;
diff --git a/src/widgets/kernel/qgridlayout.h b/src/widgets/kernel/qgridlayout.h
index 51dd65d181..0283ec2028 100644
--- a/src/widgets/kernel/qgridlayout.h
+++ b/src/widgets/kernel/qgridlayout.h
@@ -66,9 +66,9 @@ public:
~QGridLayout();
- QSize sizeHint() const Q_DECL_OVERRIDE;
- QSize minimumSize() const Q_DECL_OVERRIDE;
- QSize maximumSize() const Q_DECL_OVERRIDE;
+ QSize sizeHint() const override;
+ QSize minimumSize() const override;
+ QSize maximumSize() const override;
void setHorizontalSpacing(int spacing);
int horizontalSpacing() const;
@@ -92,12 +92,12 @@ public:
QRect cellRect(int row, int column) const;
- bool hasHeightForWidth() const Q_DECL_OVERRIDE;
- int heightForWidth(int) const Q_DECL_OVERRIDE;
- int minimumHeightForWidth(int) const Q_DECL_OVERRIDE;
+ bool hasHeightForWidth() const override;
+ int heightForWidth(int) const override;
+ int minimumHeightForWidth(int) const override;
- Qt::Orientations expandingDirections() const Q_DECL_OVERRIDE;
- void invalidate() Q_DECL_OVERRIDE;
+ Qt::Orientations expandingDirections() const override;
+ void invalidate() override;
inline void addWidget(QWidget *w) { QLayout::addWidget(w); }
void addWidget(QWidget *, int row, int column, Qt::Alignment = Qt::Alignment());
@@ -108,11 +108,11 @@ public:
void setOriginCorner(Qt::Corner);
Qt::Corner originCorner() const;
- QLayoutItem *itemAt(int index) const Q_DECL_OVERRIDE;
+ QLayoutItem *itemAt(int index) const override;
QLayoutItem *itemAtPosition(int row, int column) const;
- QLayoutItem *takeAt(int index) Q_DECL_OVERRIDE;
- int count() const Q_DECL_OVERRIDE;
- void setGeometry(const QRect&) Q_DECL_OVERRIDE;
+ QLayoutItem *takeAt(int index) override;
+ int count() const override;
+ void setGeometry(const QRect&) override;
void addItem(QLayoutItem *item, int row, int column, int rowSpan = 1, int columnSpan = 1, Qt::Alignment = Qt::Alignment());
@@ -120,7 +120,7 @@ public:
void getItemPosition(int idx, int *row, int *column, int *rowSpan, int *columnSpan) const;
protected:
- void addItem(QLayoutItem *) Q_DECL_OVERRIDE;
+ void addItem(QLayoutItem *) override;
private:
Q_DISABLE_COPY(QGridLayout)
diff --git a/src/widgets/kernel/qlayout.h b/src/widgets/kernel/qlayout.h
index 2de12b4f99..abadf2e69d 100644
--- a/src/widgets/kernel/qlayout.h
+++ b/src/widgets/kernel/qlayout.h
@@ -104,8 +104,8 @@ public:
QWidget *parentWidget() const;
- void invalidate() Q_DECL_OVERRIDE;
- QRect geometry() const Q_DECL_OVERRIDE;
+ void invalidate() override;
+ QRect geometry() const override;
bool activate();
void update();
@@ -115,16 +115,16 @@ public:
void removeWidget(QWidget *w);
void removeItem(QLayoutItem *);
- Qt::Orientations expandingDirections() const Q_DECL_OVERRIDE;
- QSize minimumSize() const Q_DECL_OVERRIDE;
- QSize maximumSize() const Q_DECL_OVERRIDE;
- virtual void setGeometry(const QRect&) Q_DECL_OVERRIDE;
+ Qt::Orientations expandingDirections() const override;
+ QSize minimumSize() const override;
+ QSize maximumSize() const override;
+ virtual void setGeometry(const QRect&) override;
virtual QLayoutItem *itemAt(int index) const = 0;
virtual QLayoutItem *takeAt(int index) = 0;
virtual int indexOf(QWidget *) const;
virtual int count() const = 0;
- bool isEmpty() const Q_DECL_OVERRIDE;
- QSizePolicy::ControlTypes controlTypes() const Q_DECL_OVERRIDE;
+ bool isEmpty() const override;
+ QSizePolicy::ControlTypes controlTypes() const override;
// ### Qt 6 make this function virtual
QLayoutItem *replaceWidget(QWidget *from, QWidget *to, Qt::FindChildOptions options = Qt::FindChildrenRecursively);
@@ -133,7 +133,7 @@ public:
QSize totalMinimumSize() const;
QSize totalMaximumSize() const;
QSize totalSizeHint() const;
- QLayout *layout() Q_DECL_OVERRIDE;
+ QLayout *layout() override;
void setEnabled(bool);
bool isEnabled() const;
@@ -143,7 +143,7 @@ public:
protected:
void widgetEvent(QEvent *);
- void childEvent(QChildEvent *e) Q_DECL_OVERRIDE;
+ void childEvent(QChildEvent *e) override;
void addChildLayout(QLayout *l);
void addChildWidget(QWidget *w);
bool adoptLayout(QLayout *layout);
diff --git a/src/widgets/kernel/qopenglwidget.cpp b/src/widgets/kernel/qopenglwidget.cpp
index 5bc408a8cd..07588d2ee2 100644
--- a/src/widgets/kernel/qopenglwidget.cpp
+++ b/src/widgets/kernel/qopenglwidget.cpp
@@ -536,8 +536,8 @@ public:
: QOpenGLPaintDevicePrivate(QSize()),
w(widget) { }
- void beginPaint() Q_DECL_OVERRIDE;
- void endPaint() Q_DECL_OVERRIDE;
+ void beginPaint() override;
+ void endPaint() override;
QOpenGLWidget *w;
};
@@ -547,7 +547,7 @@ class QOpenGLWidgetPaintDevice : public QOpenGLPaintDevice
public:
QOpenGLWidgetPaintDevice(QOpenGLWidget *widget)
: QOpenGLPaintDevice(*new QOpenGLWidgetPaintDevicePrivate(widget)) { }
- void ensureActiveTarget() Q_DECL_OVERRIDE;
+ void ensureActiveTarget() override;
};
class QOpenGLWidgetPrivate : public QWidgetPrivate
@@ -576,8 +576,8 @@ public:
void reset();
void recreateFbo();
- GLuint textureId() const Q_DECL_OVERRIDE;
- QPlatformTextureList::Flags textureListFlags() Q_DECL_OVERRIDE;
+ GLuint textureId() const override;
+ QPlatformTextureList::Flags textureListFlags() override;
void initialize();
void invokeUserPaint();
@@ -585,14 +585,14 @@ public:
void invalidateFbo();
- QImage grabFramebuffer() Q_DECL_OVERRIDE;
- void beginBackingStorePainting() Q_DECL_OVERRIDE { inBackingStorePaint = true; }
- void endBackingStorePainting() Q_DECL_OVERRIDE { inBackingStorePaint = false; }
- void beginCompose() Q_DECL_OVERRIDE;
- void endCompose() Q_DECL_OVERRIDE;
- void initializeViewportFramebuffer() Q_DECL_OVERRIDE;
- void resizeViewportFramebuffer() Q_DECL_OVERRIDE;
- void resolveSamples() Q_DECL_OVERRIDE;
+ QImage grabFramebuffer() override;
+ void beginBackingStorePainting() override { inBackingStorePaint = true; }
+ void endBackingStorePainting() override { inBackingStorePaint = false; }
+ void beginCompose() override;
+ void endCompose() override;
+ void initializeViewportFramebuffer() override;
+ void resizeViewportFramebuffer() override;
+ void resolveSamples() override;
QOpenGLContext *context;
QOpenGLFramebufferObject *fbo;
diff --git a/src/widgets/kernel/qopenglwidget.h b/src/widgets/kernel/qopenglwidget.h
index c0a6e41522..9eb4a9ba5a 100644
--- a/src/widgets/kernel/qopenglwidget.h
+++ b/src/widgets/kernel/qopenglwidget.h
@@ -63,7 +63,7 @@ public:
PartialUpdate
};
- explicit QOpenGLWidget(QWidget* parent = Q_NULLPTR, Qt::WindowFlags f = Qt::WindowFlags());
+ explicit QOpenGLWidget(QWidget* parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags());
~QOpenGLWidget();
void setUpdateBehavior(UpdateBehavior updateBehavior);
@@ -96,13 +96,13 @@ protected:
virtual void resizeGL(int w, int h);
virtual void paintGL();
- void paintEvent(QPaintEvent *e) Q_DECL_OVERRIDE;
- void resizeEvent(QResizeEvent *e) Q_DECL_OVERRIDE;
- bool event(QEvent *e) Q_DECL_OVERRIDE;
+ void paintEvent(QPaintEvent *e) override;
+ void resizeEvent(QResizeEvent *e) override;
+ bool event(QEvent *e) override;
- int metric(QPaintDevice::PaintDeviceMetric metric) const Q_DECL_OVERRIDE;
- QPaintDevice *redirected(QPoint *p) const Q_DECL_OVERRIDE;
- QPaintEngine *paintEngine() const Q_DECL_OVERRIDE;
+ int metric(QPaintDevice::PaintDeviceMetric metric) const override;
+ QPaintDevice *redirected(QPoint *p) const override;
+ QPaintEngine *paintEngine() const override;
private:
Q_DISABLE_COPY(QOpenGLWidget)
diff --git a/src/widgets/kernel/qshortcut.h b/src/widgets/kernel/qshortcut.h
index 22c667c9c1..6dcf4971b2 100644
--- a/src/widgets/kernel/qshortcut.h
+++ b/src/widgets/kernel/qshortcut.h
@@ -62,7 +62,7 @@ class Q_WIDGETS_EXPORT QShortcut : public QObject
public:
explicit QShortcut(QWidget *parent);
QShortcut(const QKeySequence& key, QWidget *parent,
- const char *member = Q_NULLPTR, const char *ambiguousMember = Q_NULLPTR,
+ const char *member = nullptr, const char *ambiguousMember = nullptr,
Qt::ShortcutContext context = Qt::WindowShortcut);
~QShortcut();
@@ -91,7 +91,7 @@ Q_SIGNALS:
void activatedAmbiguously();
protected:
- bool event(QEvent *e) Q_DECL_OVERRIDE;
+ bool event(QEvent *e) override;
};
#endif // QT_NO_SHORTCUT
diff --git a/src/widgets/kernel/qstackedlayout.cpp b/src/widgets/kernel/qstackedlayout.cpp
index b8b6f4302d..7430d833db 100644
--- a/src/widgets/kernel/qstackedlayout.cpp
+++ b/src/widgets/kernel/qstackedlayout.cpp
@@ -51,7 +51,7 @@ class QStackedLayoutPrivate : public QLayoutPrivate
Q_DECLARE_PUBLIC(QStackedLayout)
public:
QStackedLayoutPrivate() : index(-1), stackingMode(QStackedLayout::StackOne) {}
- QLayoutItem* replaceAt(int index, QLayoutItem *newitem) Q_DECL_OVERRIDE;
+ QLayoutItem* replaceAt(int index, QLayoutItem *newitem) override;
QList<QLayoutItem *> list;
int index;
QStackedLayout::StackingMode stackingMode;
diff --git a/src/widgets/kernel/qstackedlayout.h b/src/widgets/kernel/qstackedlayout.h
index 6f5eded1f0..966ee2aae4 100644
--- a/src/widgets/kernel/qstackedlayout.h
+++ b/src/widgets/kernel/qstackedlayout.h
@@ -75,20 +75,20 @@ public:
int currentIndex() const;
using QLayout::widget;
QWidget *widget(int) const;
- int count() const Q_DECL_OVERRIDE;
+ int count() const override;
StackingMode stackingMode() const;
void setStackingMode(StackingMode stackingMode);
// abstract virtual functions:
- void addItem(QLayoutItem *item) Q_DECL_OVERRIDE;
- QSize sizeHint() const Q_DECL_OVERRIDE;
- QSize minimumSize() const Q_DECL_OVERRIDE;
- QLayoutItem *itemAt(int) const Q_DECL_OVERRIDE;
- QLayoutItem *takeAt(int) Q_DECL_OVERRIDE;
- void setGeometry(const QRect &rect) Q_DECL_OVERRIDE;
- bool hasHeightForWidth() const Q_DECL_OVERRIDE;
- int heightForWidth(int width) const Q_DECL_OVERRIDE;
+ void addItem(QLayoutItem *item) override;
+ QSize sizeHint() const override;
+ QSize minimumSize() const override;
+ QLayoutItem *itemAt(int) const override;
+ QLayoutItem *takeAt(int) override;
+ void setGeometry(const QRect &rect) override;
+ bool hasHeightForWidth() const override;
+ int heightForWidth(int width) const override;
Q_SIGNALS:
void widgetRemoved(int index);
diff --git a/src/widgets/kernel/qstandardgestures_p.h b/src/widgets/kernel/qstandardgestures_p.h
index 9b2cffaa9a..6de09361fe 100644
--- a/src/widgets/kernel/qstandardgestures_p.h
+++ b/src/widgets/kernel/qstandardgestures_p.h
@@ -64,9 +64,9 @@ class QPanGestureRecognizer : public QGestureRecognizer
public:
explicit QPanGestureRecognizer(int pointCount = 2) : m_pointCount(pointCount) {}
- QGesture *create(QObject *target) Q_DECL_OVERRIDE;
- QGestureRecognizer::Result recognize(QGesture *state, QObject *watched, QEvent *event) Q_DECL_OVERRIDE;
- void reset(QGesture *state) Q_DECL_OVERRIDE;
+ QGesture *create(QObject *target) override;
+ QGestureRecognizer::Result recognize(QGesture *state, QObject *watched, QEvent *event) override;
+ void reset(QGesture *state) override;
private:
const int m_pointCount;
@@ -77,9 +77,9 @@ class QPinchGestureRecognizer : public QGestureRecognizer
public:
QPinchGestureRecognizer();
- QGesture *create(QObject *target) Q_DECL_OVERRIDE;
- QGestureRecognizer::Result recognize(QGesture *state, QObject *watched, QEvent *event) Q_DECL_OVERRIDE;
- void reset(QGesture *state) Q_DECL_OVERRIDE;
+ QGesture *create(QObject *target) override;
+ QGestureRecognizer::Result recognize(QGesture *state, QObject *watched, QEvent *event) override;
+ void reset(QGesture *state) override;
};
class QSwipeGestureRecognizer : public QGestureRecognizer
@@ -87,9 +87,9 @@ class QSwipeGestureRecognizer : public QGestureRecognizer
public:
QSwipeGestureRecognizer();
- QGesture *create(QObject *target) Q_DECL_OVERRIDE;
- QGestureRecognizer::Result recognize(QGesture *state, QObject *watched, QEvent *event) Q_DECL_OVERRIDE;
- void reset(QGesture *state) Q_DECL_OVERRIDE;
+ QGesture *create(QObject *target) override;
+ QGestureRecognizer::Result recognize(QGesture *state, QObject *watched, QEvent *event) override;
+ void reset(QGesture *state) override;
};
class QTapGestureRecognizer : public QGestureRecognizer
@@ -97,9 +97,9 @@ class QTapGestureRecognizer : public QGestureRecognizer
public:
QTapGestureRecognizer();
- QGesture *create(QObject *target) Q_DECL_OVERRIDE;
- QGestureRecognizer::Result recognize(QGesture *state, QObject *watched, QEvent *event) Q_DECL_OVERRIDE;
- void reset(QGesture *state) Q_DECL_OVERRIDE;
+ QGesture *create(QObject *target) override;
+ QGestureRecognizer::Result recognize(QGesture *state, QObject *watched, QEvent *event) override;
+ void reset(QGesture *state) override;
};
class QTapAndHoldGestureRecognizer : public QGestureRecognizer
@@ -107,9 +107,9 @@ class QTapAndHoldGestureRecognizer : public QGestureRecognizer
public:
QTapAndHoldGestureRecognizer();
- QGesture *create(QObject *target) Q_DECL_OVERRIDE;
- QGestureRecognizer::Result recognize(QGesture *state, QObject *watched, QEvent *event) Q_DECL_OVERRIDE;
- void reset(QGesture *state) Q_DECL_OVERRIDE;
+ QGesture *create(QObject *target) override;
+ QGestureRecognizer::Result recognize(QGesture *state, QObject *watched, QEvent *event) override;
+ void reset(QGesture *state) override;
};
QT_END_NAMESPACE
diff --git a/src/widgets/kernel/qtooltip.cpp b/src/widgets/kernel/qtooltip.cpp
index 80dc65e2d2..69b62ff7d7 100644
--- a/src/widgets/kernel/qtooltip.cpp
+++ b/src/widgets/kernel/qtooltip.cpp
@@ -127,7 +127,7 @@ public:
~QTipLabel();
static QTipLabel *instance;
- bool eventFilter(QObject *, QEvent *) Q_DECL_OVERRIDE;
+ bool eventFilter(QObject *, QEvent *) override;
QBasicTimer hideTimer, expireTimer;
@@ -143,10 +143,10 @@ public:
static int getTipScreen(const QPoint &pos, QWidget *w);
protected:
- void timerEvent(QTimerEvent *e) Q_DECL_OVERRIDE;
- void paintEvent(QPaintEvent *e) Q_DECL_OVERRIDE;
- void mouseMoveEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
- void resizeEvent(QResizeEvent *e) Q_DECL_OVERRIDE;
+ void timerEvent(QTimerEvent *e) override;
+ void paintEvent(QPaintEvent *e) override;
+ void mouseMoveEvent(QMouseEvent *e) override;
+ void resizeEvent(QResizeEvent *e) override;
#ifndef QT_NO_STYLE_STYLESHEET
public slots:
@@ -501,7 +501,10 @@ void QToolTip::showText(const QPoint &pos, const QString &text, QWidget *w, cons
#ifdef Q_OS_WIN32
// On windows, we can't use the widget as parent otherwise the window will be
// raised when the tooltip will be shown
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
new QTipLabel(text, QApplication::desktop()->screen(QTipLabel::getTipScreen(pos, w)), msecDisplayTime);
+QT_WARNING_POP
#else
new QTipLabel(text, w, msecDisplayTime); // sets QTipLabel::instance to itself
#endif
diff --git a/src/widgets/kernel/qtooltip.h b/src/widgets/kernel/qtooltip.h
index 5e68eef0a7..edf1de0c1d 100644
--- a/src/widgets/kernel/qtooltip.h
+++ b/src/widgets/kernel/qtooltip.h
@@ -53,7 +53,7 @@ class Q_WIDGETS_EXPORT QToolTip
QToolTip() Q_DECL_EQ_DELETE;
public:
// ### Qt 6 - merge the three showText functions below
- static void showText(const QPoint &pos, const QString &text, QWidget *w = Q_NULLPTR);
+ static void showText(const QPoint &pos, const QString &text, QWidget *w = nullptr);
static void showText(const QPoint &pos, const QString &text, QWidget *w, const QRect &rect);
static void showText(const QPoint &pos, const QString &text, QWidget *w, const QRect &rect, int msecShowTime);
static inline void hideText() { showText(QPoint(), QString()); }
diff --git a/src/widgets/kernel/qwhatsthis.cpp b/src/widgets/kernel/qwhatsthis.cpp
index 91d2b503e0..96d0cf61c4 100644
--- a/src/widgets/kernel/qwhatsthis.cpp
+++ b/src/widgets/kernel/qwhatsthis.cpp
@@ -145,12 +145,12 @@ public:
static QWhatsThat *instance;
protected:
- void showEvent(QShowEvent *e) Q_DECL_OVERRIDE;
- void mousePressEvent(QMouseEvent*) Q_DECL_OVERRIDE;
- void mouseReleaseEvent(QMouseEvent*) Q_DECL_OVERRIDE;
- void mouseMoveEvent(QMouseEvent*) Q_DECL_OVERRIDE;
- void keyPressEvent(QKeyEvent*) Q_DECL_OVERRIDE;
- void paintEvent(QPaintEvent*) Q_DECL_OVERRIDE;
+ void showEvent(QShowEvent *e) override;
+ void mousePressEvent(QMouseEvent*) override;
+ void mouseReleaseEvent(QMouseEvent*) override;
+ void mouseMoveEvent(QMouseEvent*) override;
+ void keyPressEvent(QKeyEvent*) override;
+ void paintEvent(QPaintEvent*) override;
private:
QPointer<QWidget>widget;
@@ -365,7 +365,7 @@ class QWhatsThisPrivate : public QObject
QWhatsThisPrivate();
~QWhatsThisPrivate();
static QWhatsThisPrivate *instance;
- bool eventFilter(QObject *, QEvent *) Q_DECL_OVERRIDE;
+ bool eventFilter(QObject *, QEvent *) override;
QPointer<QAction> action;
static void say(QWidget *, const QString &, int x = 0, int y = 0);
static void notifyToplevels(QEvent *e);
diff --git a/src/widgets/kernel/qwhatsthis.h b/src/widgets/kernel/qwhatsthis.h
index 3211796d3e..1f0f82b2a2 100644
--- a/src/widgets/kernel/qwhatsthis.h
+++ b/src/widgets/kernel/qwhatsthis.h
@@ -59,10 +59,10 @@ public:
static bool inWhatsThisMode();
static void leaveWhatsThisMode();
- static void showText(const QPoint &pos, const QString &text, QWidget *w = Q_NULLPTR);
+ static void showText(const QPoint &pos, const QString &text, QWidget *w = nullptr);
static void hideText();
- static QAction *createAction(QObject *parent = Q_NULLPTR);
+ static QAction *createAction(QObject *parent = nullptr);
};
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index 2ee9d307c9..c5eea1c514 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2017 The Qt Company Ltd.
** Copyright (C) 2016 Intel Corporation.
** Contact: https://www.qt.io/licensing/
**
@@ -1169,7 +1169,7 @@ void QWidgetPrivate::init(QWidget *parentWidget, Qt::WindowFlags f)
if (targetScreen >= 0) {
topData()->initialScreenIndex = targetScreen;
if (QWindow *window = q->windowHandle())
- window->setScreen(QGuiApplication::screens().value(targetScreen, Q_NULLPTR));
+ window->setScreen(QGuiApplication::screens().value(targetScreen, nullptr));
}
data.fstrut_dirty = true;
@@ -1463,7 +1463,7 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO
screenNumber = q->windowType() != Qt::Desktop
? QDesktopWidgetPrivate::screenNumber(q) : 0;
}
- win->setScreen(QGuiApplication::screens().value(screenNumber, Q_NULLPTR));
+ win->setScreen(QGuiApplication::screens().value(screenNumber, nullptr));
}
QSurfaceFormat format = win->requestedFormat();
@@ -1504,7 +1504,7 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO
QBackingStore *store = q->backingStore();
if (!store) {
- if (win && q->windowType() != Qt::Desktop) {
+ if (q->windowType() != Qt::Desktop) {
if (q->isTopLevel())
q->setBackingStore(new QBackingStore(win));
} else {
@@ -7905,7 +7905,7 @@ void QWidgetPrivate::show_helper()
const bool isWindow = q->isWindow();
#if QT_CONFIG(graphicsview)
- bool isEmbedded = isWindow && q->graphicsProxyWidget() != Q_NULLPTR;
+ bool isEmbedded = isWindow && q->graphicsProxyWidget() != nullptr;
#else
bool isEmbedded = false;
#endif
@@ -12460,7 +12460,7 @@ static inline bool canMapPosition(QWindow *window)
#if QT_CONFIG(graphicsview)
static inline QGraphicsProxyWidget *graphicsProxyWidget(const QWidget *w)
{
- QGraphicsProxyWidget *result = Q_NULLPTR;
+ QGraphicsProxyWidget *result = nullptr;
const QWidgetPrivate *d = qt_widget_private(const_cast<QWidget *>(w));
if (d->extra)
result = d->extra->proxyWidget;
@@ -12476,7 +12476,7 @@ struct MapToGlobalTransformResult {
static MapToGlobalTransformResult mapToGlobalTransform(const QWidget *w)
{
MapToGlobalTransformResult result;
- result.window = Q_NULLPTR;
+ result.window = nullptr;
for ( ; w ; w = w->parentWidget()) {
#if QT_CONFIG(graphicsview)
if (QGraphicsProxyWidget *qgpw = graphicsProxyWidget(w)) {
diff --git a/src/widgets/kernel/qwidget.h b/src/widgets/kernel/qwidget.h
index 732af4de09..5087d330ee 100644
--- a/src/widgets/kernel/qwidget.h
+++ b/src/widgets/kernel/qwidget.h
@@ -211,10 +211,10 @@ public:
};
Q_DECLARE_FLAGS(RenderFlags, RenderFlag)
- explicit QWidget(QWidget* parent = Q_NULLPTR, Qt::WindowFlags f = Qt::WindowFlags());
+ explicit QWidget(QWidget* parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags());
~QWidget();
- int devType() const Q_DECL_OVERRIDE;
+ int devType() const override;
WId winId() const;
void createWinId(); // internal, going away
@@ -578,7 +578,7 @@ public:
void setAttribute(Qt::WidgetAttribute, bool on = true);
inline bool testAttribute(Qt::WidgetAttribute) const;
- QPaintEngine *paintEngine() const Q_DECL_OVERRIDE;
+ QPaintEngine *paintEngine() const override;
void ensurePolished() const;
@@ -596,7 +596,7 @@ public:
QWindow *windowHandle() const;
- static QWidget *createWindowContainer(QWindow *window, QWidget *parent=Q_NULLPTR, Qt::WindowFlags flags=Qt::WindowFlags());
+ static QWidget *createWindowContainer(QWindow *window, QWidget *parent=nullptr, Qt::WindowFlags flags=Qt::WindowFlags());
friend class QDesktopScreenWidget;
@@ -608,7 +608,7 @@ Q_SIGNALS:
protected:
// Event handlers
- bool event(QEvent *event) Q_DECL_OVERRIDE;
+ bool event(QEvent *event) override;
virtual void mousePressEvent(QMouseEvent *event);
virtual void mouseReleaseEvent(QMouseEvent *event);
virtual void mouseDoubleClickEvent(QMouseEvent *event);
@@ -650,10 +650,10 @@ protected:
// Misc. protected functions
virtual void changeEvent(QEvent *);
- int metric(PaintDeviceMetric) const Q_DECL_OVERRIDE;
- void initPainter(QPainter *painter) const Q_DECL_OVERRIDE;
- QPaintDevice *redirected(QPoint *offset) const Q_DECL_OVERRIDE;
- QPainter *sharedPainter() const Q_DECL_OVERRIDE;
+ int metric(PaintDeviceMetric) const override;
+ void initPainter(QPainter *painter) const override;
+ QPaintDevice *redirected(QPoint *offset) const override;
+ QPainter *sharedPainter() const override;
virtual void inputMethodEvent(QInputMethodEvent *);
public:
@@ -738,12 +738,12 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(QWidget::RenderFlags)
#ifndef Q_QDOC
template <> inline QWidget *qobject_cast<QWidget*>(QObject *o)
{
- if (!o || !o->isWidgetType()) return Q_NULLPTR;
+ if (!o || !o->isWidgetType()) return nullptr;
return static_cast<QWidget*>(o);
}
template <> inline const QWidget *qobject_cast<const QWidget*>(const QObject *o)
{
- if (!o || !o->isWidgetType()) return Q_NULLPTR;
+ if (!o || !o->isWidgetType()) return nullptr;
return static_cast<const QWidget*>(o);
}
#endif // !Q_QDOC
diff --git a/src/widgets/kernel/qwidget_p.h b/src/widgets/kernel/qwidget_p.h
index 4a86f87c71..26f8b53392 100644
--- a/src/widgets/kernel/qwidget_p.h
+++ b/src/widgets/kernel/qwidget_p.h
@@ -903,26 +903,26 @@ public:
: QGraphicsEffectSourcePrivate(), m_widget(widget), context(0), updateDueToGraphicsEffect(false)
{}
- void detach() Q_DECL_OVERRIDE
+ void detach() override
{ m_widget->d_func()->graphicsEffect = 0; }
- const QGraphicsItem *graphicsItem() const Q_DECL_OVERRIDE
+ const QGraphicsItem *graphicsItem() const override
{ return 0; }
- const QWidget *widget() const Q_DECL_OVERRIDE
+ const QWidget *widget() const override
{ return m_widget; }
- void update() Q_DECL_OVERRIDE
+ void update() override
{
updateDueToGraphicsEffect = true;
m_widget->update();
updateDueToGraphicsEffect = false;
}
- bool isPixmap() const Q_DECL_OVERRIDE
+ bool isPixmap() const override
{ return false; }
- void effectBoundingRectChanged() Q_DECL_OVERRIDE
+ void effectBoundingRectChanged() override
{
// ### This function should take a rect parameter; then we can avoid
// updating too much on the parent widget.
@@ -932,16 +932,16 @@ public:
update();
}
- const QStyleOption *styleOption() const Q_DECL_OVERRIDE
+ const QStyleOption *styleOption() const override
{ return 0; }
- QRect deviceRect() const Q_DECL_OVERRIDE
+ QRect deviceRect() const override
{ return m_widget->window()->rect(); }
- QRectF boundingRect(Qt::CoordinateSystem system) const Q_DECL_OVERRIDE;
- void draw(QPainter *p) Q_DECL_OVERRIDE;
+ QRectF boundingRect(Qt::CoordinateSystem system) const override;
+ void draw(QPainter *p) override;
QPixmap pixmap(Qt::CoordinateSystem system, QPoint *offset,
- QGraphicsEffect::PixmapPadMode mode) const Q_DECL_OVERRIDE;
+ QGraphicsEffect::PixmapPadMode mode) const override;
QWidget *m_widget;
QWidgetPaintContext *context;
diff --git a/src/widgets/kernel/qwidgetaction.h b/src/widgets/kernel/qwidgetaction.h
index 3da691a430..4769332a23 100644
--- a/src/widgets/kernel/qwidgetaction.h
+++ b/src/widgets/kernel/qwidgetaction.h
@@ -66,8 +66,8 @@ public:
void releaseWidget(QWidget *widget);
protected:
- virtual bool event(QEvent *) Q_DECL_OVERRIDE;
- virtual bool eventFilter(QObject *, QEvent *) Q_DECL_OVERRIDE;
+ virtual bool event(QEvent *) override;
+ virtual bool eventFilter(QObject *, QEvent *) override;
virtual QWidget *createWidget(QWidget *parent);
virtual void deleteWidget(QWidget *widget);
QList<QWidget *> createdWidgets() const;
diff --git a/src/widgets/kernel/qwidgetbackingstore.cpp b/src/widgets/kernel/qwidgetbackingstore.cpp
index 52080fe05f..3b093283cd 100644
--- a/src/widgets/kernel/qwidgetbackingstore.cpp
+++ b/src/widgets/kernel/qwidgetbackingstore.cpp
@@ -1058,7 +1058,7 @@ static QPlatformTextureList *widgetTexturesFor(QWidget *tlw, QWidget *widget)
{
Q_UNUSED(tlw);
Q_UNUSED(widget);
- return Q_NULLPTR;
+ return nullptr;
}
#endif // QT_NO_OPENGL
diff --git a/src/widgets/kernel/qwidgetwindow.cpp b/src/widgets/kernel/qwidgetwindow.cpp
index d8d6eab7b1..ac32c32e12 100644
--- a/src/widgets/kernel/qwidgetwindow.cpp
+++ b/src/widgets/kernel/qwidgetwindow.cpp
@@ -78,7 +78,7 @@ public:
QWindowPrivate::setVisible(visible);
}
- QWindow *eventReceiver() Q_DECL_OVERRIDE {
+ QWindow *eventReceiver() override {
Q_Q(QWidgetWindow);
QWindow *w = q;
while (w->parent() && qobject_cast<QWidgetWindow *>(w) && qobject_cast<QWidgetWindow *>(w->parent())) {
@@ -87,7 +87,7 @@ public:
return w;
}
- void clearFocusObject() Q_DECL_OVERRIDE
+ void clearFocusObject() override
{
Q_Q(QWidgetWindow);
QWidget *widget = q->widget();
@@ -95,7 +95,7 @@ public:
widget->focusWidget()->clearFocus();
}
- QRectF closestAcceptableGeometry(const QRectF &rect) const Q_DECL_OVERRIDE;
+ QRectF closestAcceptableGeometry(const QRectF &rect) const override;
#if QT_CONFIG(opengl)
QOpenGLContext *shareContext() const override;
#endif
@@ -171,7 +171,7 @@ QObject *QWidgetWindow::focusObject() const
{
QWidget *windowWidget = m_widget;
if (!windowWidget)
- return Q_NULLPTR;
+ return nullptr;
// A window can't have a focus object if it's being destroyed.
if (QWidgetPrivate::get(windowWidget)->data.in_destructor)
@@ -422,7 +422,7 @@ void QWidgetWindow::handleEnterLeaveEvent(QEvent *event)
const QEnterEvent *ee = static_cast<QEnterEvent *>(event);
QWidget *child = m_widget->childAt(ee->pos());
QWidget *receiver = child ? child : m_widget.data();
- QWidget *leave = Q_NULLPTR;
+ QWidget *leave = nullptr;
if (QApplicationPrivate::inPopupMode() && receiver == m_widget
&& qt_last_mouse_receiver != m_widget) {
// This allows to deliver the leave event to the native widget
@@ -529,11 +529,11 @@ void QWidgetWindow::handleMouseEvent(QMouseEvent *event)
// Prevent negative mouse position on enter event - this event
// should be properly handled in "handleEnterLeaveEvent()".
if (receiverMapped.x() >= 0 && receiverMapped.y() >= 0) {
- QApplicationPrivate::dispatchEnterLeave(receiver, Q_NULLPTR, event->screenPos());
+ QApplicationPrivate::dispatchEnterLeave(receiver, nullptr, event->screenPos());
qt_last_mouse_receiver = receiver;
}
} else {
- QApplicationPrivate::dispatchEnterLeave(Q_NULLPTR, qt_last_mouse_receiver, event->screenPos());
+ QApplicationPrivate::dispatchEnterLeave(nullptr, qt_last_mouse_receiver, event->screenPos());
qt_last_mouse_receiver = receiver;
receiver = activePopupWidget;
}
@@ -637,12 +637,9 @@ void QWidgetWindow::handleMouseEvent(QMouseEvent *event)
QWidget *receiver = QApplicationPrivate::pickMouseReceiver(m_widget, event->windowPos().toPoint(), &mapped, event->type(), event->buttons(),
qt_button_down, widget);
-
- if (!receiver) {
- if (event->type() == QEvent::MouseButtonRelease)
- QApplicationPrivate::mouse_buttons &= ~event->button();
+ if (!receiver)
return;
- }
+
if ((event->type() != QEvent::MouseButtonPress)
|| !(event->flags().testFlag(Qt::MouseEventCreatedDoubleClick))) {
diff --git a/src/widgets/kernel/qwidgetwindow_p.h b/src/widgets/kernel/qwidgetwindow_p.h
index be3f808a22..d0f1d55c2a 100644
--- a/src/widgets/kernel/qwidgetwindow_p.h
+++ b/src/widgets/kernel/qwidgetwindow_p.h
@@ -75,13 +75,13 @@ public:
QWidget *widget() const { return m_widget; }
#ifndef QT_NO_ACCESSIBILITY
- QAccessibleInterface *accessibleRoot() const Q_DECL_OVERRIDE;
+ QAccessibleInterface *accessibleRoot() const override;
#endif
- QObject *focusObject() const Q_DECL_OVERRIDE;
+ QObject *focusObject() const override;
void setNativeWindowVisibility(bool visible);
protected:
- bool event(QEvent *) Q_DECL_OVERRIDE;
+ bool event(QEvent *) override;
void handleCloseEvent(QCloseEvent *);
void handleEnterLeaveEvent(QEvent *);
@@ -102,7 +102,7 @@ protected:
#endif
void handleExposeEvent(QExposeEvent *);
void handleWindowStateChangedEvent(QWindowStateChangeEvent *event);
- bool nativeEvent(const QByteArray &eventType, void *message, long *result) Q_DECL_OVERRIDE;
+ bool nativeEvent(const QByteArray &eventType, void *message, long *result) override;
#if QT_CONFIG(tabletevent)
void handleTabletEvent(QTabletEvent *);
#endif
diff --git a/src/widgets/kernel/qwindowcontainer_p.h b/src/widgets/kernel/qwindowcontainer_p.h
index 1d838c8dd6..a8754232a8 100644
--- a/src/widgets/kernel/qwindowcontainer_p.h
+++ b/src/widgets/kernel/qwindowcontainer_p.h
@@ -75,7 +75,7 @@ public:
static void parentWasLowered(QWidget *parent);
protected:
- bool event(QEvent *ev) Q_DECL_OVERRIDE;
+ bool event(QEvent *ev) override;
private slots:
void focusWindowChanged(QWindow *focusWindow);
diff --git a/src/widgets/statemachine/qbasickeyeventtransition_p.h b/src/widgets/statemachine/qbasickeyeventtransition_p.h
index d3b90f6104..5007b79739 100644
--- a/src/widgets/statemachine/qbasickeyeventtransition_p.h
+++ b/src/widgets/statemachine/qbasickeyeventtransition_p.h
@@ -80,8 +80,8 @@ public:
void setModifierMask(Qt::KeyboardModifiers modifiers);
protected:
- bool eventTest(QEvent *event) Q_DECL_OVERRIDE;
- void onTransition(QEvent *) Q_DECL_OVERRIDE;
+ bool eventTest(QEvent *event) override;
+ void onTransition(QEvent *) override;
private:
Q_DISABLE_COPY(QBasicKeyEventTransition)
diff --git a/src/widgets/statemachine/qbasicmouseeventtransition_p.h b/src/widgets/statemachine/qbasicmouseeventtransition_p.h
index d6d37eb03e..93d2a5ec61 100644
--- a/src/widgets/statemachine/qbasicmouseeventtransition_p.h
+++ b/src/widgets/statemachine/qbasicmouseeventtransition_p.h
@@ -83,8 +83,8 @@ public:
void setHitTestPath(const QPainterPath &path);
protected:
- bool eventTest(QEvent *event) Q_DECL_OVERRIDE;
- void onTransition(QEvent *) Q_DECL_OVERRIDE;
+ bool eventTest(QEvent *event) override;
+ void onTransition(QEvent *) override;
private:
Q_DISABLE_COPY(QBasicMouseEventTransition)
diff --git a/src/widgets/statemachine/qkeyeventtransition.h b/src/widgets/statemachine/qkeyeventtransition.h
index 23ce3c40be..676f5f7846 100644
--- a/src/widgets/statemachine/qkeyeventtransition.h
+++ b/src/widgets/statemachine/qkeyeventtransition.h
@@ -54,9 +54,9 @@ class Q_WIDGETS_EXPORT QKeyEventTransition : public QEventTransition
Q_PROPERTY(int key READ key WRITE setKey)
Q_PROPERTY(Qt::KeyboardModifiers modifierMask READ modifierMask WRITE setModifierMask)
public:
- QKeyEventTransition(QState *sourceState = Q_NULLPTR);
+ QKeyEventTransition(QState *sourceState = nullptr);
QKeyEventTransition(QObject *object, QEvent::Type type, int key,
- QState *sourceState = Q_NULLPTR);
+ QState *sourceState = nullptr);
~QKeyEventTransition();
int key() const;
@@ -66,8 +66,8 @@ public:
void setModifierMask(Qt::KeyboardModifiers modifiers);
protected:
- void onTransition(QEvent *event) Q_DECL_OVERRIDE;
- bool eventTest(QEvent *event) Q_DECL_OVERRIDE;
+ void onTransition(QEvent *event) override;
+ bool eventTest(QEvent *event) override;
private:
Q_DISABLE_COPY(QKeyEventTransition)
diff --git a/src/widgets/statemachine/qmouseeventtransition.h b/src/widgets/statemachine/qmouseeventtransition.h
index 3f40224d8c..41f738d894 100644
--- a/src/widgets/statemachine/qmouseeventtransition.h
+++ b/src/widgets/statemachine/qmouseeventtransition.h
@@ -55,9 +55,9 @@ class Q_WIDGETS_EXPORT QMouseEventTransition : public QEventTransition
Q_PROPERTY(Qt::MouseButton button READ button WRITE setButton)
Q_PROPERTY(Qt::KeyboardModifiers modifierMask READ modifierMask WRITE setModifierMask)
public:
- QMouseEventTransition(QState *sourceState = Q_NULLPTR);
+ QMouseEventTransition(QState *sourceState = nullptr);
QMouseEventTransition(QObject *object, QEvent::Type type,
- Qt::MouseButton button, QState *sourceState = Q_NULLPTR);
+ Qt::MouseButton button, QState *sourceState = nullptr);
~QMouseEventTransition();
Qt::MouseButton button() const;
@@ -70,8 +70,8 @@ public:
void setHitTestPath(const QPainterPath &path);
protected:
- void onTransition(QEvent *event) Q_DECL_OVERRIDE;
- bool eventTest(QEvent *event) Q_DECL_OVERRIDE;
+ void onTransition(QEvent *event) override;
+ bool eventTest(QEvent *event) override;
private:
Q_DISABLE_COPY(QMouseEventTransition)
diff --git a/src/widgets/styles/qcommonstyle.h b/src/widgets/styles/qcommonstyle.h
index ed880a150f..f39915295e 100644
--- a/src/widgets/styles/qcommonstyle.h
+++ b/src/widgets/styles/qcommonstyle.h
@@ -56,40 +56,40 @@ public:
~QCommonStyle();
void drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p,
- const QWidget *w = Q_NULLPTR) const Q_DECL_OVERRIDE;
+ const QWidget *w = nullptr) const override;
void drawControl(ControlElement element, const QStyleOption *opt, QPainter *p,
- const QWidget *w = Q_NULLPTR) const Q_DECL_OVERRIDE;
- QRect subElementRect(SubElement r, const QStyleOption *opt, const QWidget *widget = Q_NULLPTR) const Q_DECL_OVERRIDE;
+ const QWidget *w = nullptr) const override;
+ QRect subElementRect(SubElement r, const QStyleOption *opt, const QWidget *widget = nullptr) const override;
void drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p,
- const QWidget *w = Q_NULLPTR) const Q_DECL_OVERRIDE;
+ const QWidget *w = nullptr) const override;
SubControl hitTestComplexControl(ComplexControl cc, const QStyleOptionComplex *opt,
- const QPoint &pt, const QWidget *w = Q_NULLPTR) const Q_DECL_OVERRIDE;
+ const QPoint &pt, const QWidget *w = nullptr) const override;
QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *opt, SubControl sc,
- const QWidget *w = Q_NULLPTR) const Q_DECL_OVERRIDE;
+ const QWidget *w = nullptr) const override;
QSize sizeFromContents(ContentsType ct, const QStyleOption *opt,
- const QSize &contentsSize, const QWidget *widget = Q_NULLPTR) const Q_DECL_OVERRIDE;
+ const QSize &contentsSize, const QWidget *widget = nullptr) const override;
- int pixelMetric(PixelMetric m, const QStyleOption *opt = Q_NULLPTR, const QWidget *widget = Q_NULLPTR) const Q_DECL_OVERRIDE;
+ int pixelMetric(PixelMetric m, const QStyleOption *opt = nullptr, const QWidget *widget = nullptr) const override;
- int styleHint(StyleHint sh, const QStyleOption *opt = Q_NULLPTR, const QWidget *w = Q_NULLPTR,
- QStyleHintReturn *shret = Q_NULLPTR) const Q_DECL_OVERRIDE;
+ int styleHint(StyleHint sh, const QStyleOption *opt = nullptr, const QWidget *w = nullptr,
+ QStyleHintReturn *shret = nullptr) const override;
- QIcon standardIcon(StandardPixmap standardIcon, const QStyleOption *opt = Q_NULLPTR,
- const QWidget *widget = Q_NULLPTR) const Q_DECL_OVERRIDE;
- QPixmap standardPixmap(StandardPixmap sp, const QStyleOption *opt = Q_NULLPTR,
- const QWidget *widget = Q_NULLPTR) const Q_DECL_OVERRIDE;
+ QIcon standardIcon(StandardPixmap standardIcon, const QStyleOption *opt = nullptr,
+ const QWidget *widget = nullptr) const override;
+ QPixmap standardPixmap(StandardPixmap sp, const QStyleOption *opt = nullptr,
+ const QWidget *widget = nullptr) const override;
QPixmap generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap,
- const QStyleOption *opt) const Q_DECL_OVERRIDE;
+ const QStyleOption *opt) const override;
int layoutSpacing(QSizePolicy::ControlType control1, QSizePolicy::ControlType control2,
- Qt::Orientation orientation, const QStyleOption *option = Q_NULLPTR,
- const QWidget *widget = Q_NULLPTR) const Q_DECL_OVERRIDE;
-
- void polish(QPalette &) Q_DECL_OVERRIDE;
- void polish(QApplication *app) Q_DECL_OVERRIDE;
- void polish(QWidget *widget) Q_DECL_OVERRIDE;
- void unpolish(QWidget *widget) Q_DECL_OVERRIDE;
- void unpolish(QApplication *application) Q_DECL_OVERRIDE;
+ Qt::Orientation orientation, const QStyleOption *option = nullptr,
+ const QWidget *widget = nullptr) const override;
+
+ void polish(QPalette &) override;
+ void polish(QApplication *app) override;
+ void polish(QWidget *widget) override;
+ void unpolish(QWidget *widget) override;
+ void unpolish(QApplication *application) override;
protected:
QCommonStyle(QCommonStylePrivate &dd);
diff --git a/src/widgets/styles/qdrawutil.h b/src/widgets/styles/qdrawutil.h
index d5582f2c90..346029e1b4 100644
--- a/src/widgets/styles/qdrawutil.h
+++ b/src/widgets/styles/qdrawutil.h
@@ -70,42 +70,42 @@ Q_WIDGETS_EXPORT void qDrawShadeLine(QPainter *p, const QPoint &p1, const QPoint
Q_WIDGETS_EXPORT void qDrawShadeRect(QPainter *p, int x, int y, int w, int h,
const QPalette &pal, bool sunken = false,
int lineWidth = 1, int midLineWidth = 0,
- const QBrush *fill = Q_NULLPTR);
+ const QBrush *fill = nullptr);
Q_WIDGETS_EXPORT void qDrawShadeRect(QPainter *p, const QRect &r,
const QPalette &pal, bool sunken = false,
int lineWidth = 1, int midLineWidth = 0,
- const QBrush *fill = Q_NULLPTR);
+ const QBrush *fill = nullptr);
Q_WIDGETS_EXPORT void qDrawShadePanel(QPainter *p, int x, int y, int w, int h,
const QPalette &pal, bool sunken = false,
- int lineWidth = 1, const QBrush *fill = Q_NULLPTR);
+ int lineWidth = 1, const QBrush *fill = nullptr);
Q_WIDGETS_EXPORT void qDrawShadePanel(QPainter *p, const QRect &r,
const QPalette &pal, bool sunken = false,
- int lineWidth = 1, const QBrush *fill = Q_NULLPTR);
+ int lineWidth = 1, const QBrush *fill = nullptr);
Q_WIDGETS_EXPORT void qDrawWinButton(QPainter *p, int x, int y, int w, int h,
const QPalette &pal, bool sunken = false,
- const QBrush *fill = Q_NULLPTR);
+ const QBrush *fill = nullptr);
Q_WIDGETS_EXPORT void qDrawWinButton(QPainter *p, const QRect &r,
const QPalette &pal, bool sunken = false,
- const QBrush *fill = Q_NULLPTR);
+ const QBrush *fill = nullptr);
Q_WIDGETS_EXPORT void qDrawWinPanel(QPainter *p, int x, int y, int w, int h,
const QPalette &pal, bool sunken = false,
- const QBrush *fill = Q_NULLPTR);
+ const QBrush *fill = nullptr);
Q_WIDGETS_EXPORT void qDrawWinPanel(QPainter *p, const QRect &r,
const QPalette &pal, bool sunken = false,
- const QBrush *fill = Q_NULLPTR);
+ const QBrush *fill = nullptr);
Q_WIDGETS_EXPORT void qDrawPlainRect(QPainter *p, int x, int y, int w, int h, const QColor &,
- int lineWidth = 1, const QBrush *fill = Q_NULLPTR);
+ int lineWidth = 1, const QBrush *fill = nullptr);
Q_WIDGETS_EXPORT void qDrawPlainRect(QPainter *p, const QRect &r, const QColor &,
- int lineWidth = 1, const QBrush *fill = Q_NULLPTR);
+ int lineWidth = 1, const QBrush *fill = nullptr);
diff --git a/src/widgets/styles/qfusionstyle_p.h b/src/widgets/styles/qfusionstyle_p.h
index 10f76045d5..e67e792727 100644
--- a/src/widgets/styles/qfusionstyle_p.h
+++ b/src/widgets/styles/qfusionstyle_p.h
@@ -69,41 +69,41 @@ public:
QFusionStyle();
~QFusionStyle();
- QPalette standardPalette () const Q_DECL_OVERRIDE;
+ QPalette standardPalette () const override;
void drawPrimitive(PrimitiveElement elem,
const QStyleOption *option,
- QPainter *painter, const QWidget *widget = 0) const Q_DECL_OVERRIDE;
+ QPainter *painter, const QWidget *widget = 0) const override;
void drawControl(ControlElement ce, const QStyleOption *option, QPainter *painter,
- const QWidget *widget) const Q_DECL_OVERRIDE;
- int pixelMetric(PixelMetric metric, const QStyleOption *option = 0, const QWidget *widget = 0) const Q_DECL_OVERRIDE;
+ const QWidget *widget) const override;
+ int pixelMetric(PixelMetric metric, const QStyleOption *option = 0, const QWidget *widget = 0) const override;
void drawComplexControl(ComplexControl control, const QStyleOptionComplex *option,
- QPainter *painter, const QWidget *widget) const Q_DECL_OVERRIDE;
- QRect subElementRect(SubElement r, const QStyleOption *opt, const QWidget *widget = 0) const Q_DECL_OVERRIDE;
+ QPainter *painter, const QWidget *widget) const override;
+ QRect subElementRect(SubElement r, const QStyleOption *opt, const QWidget *widget = 0) const override;
QSize sizeFromContents(ContentsType type, const QStyleOption *option,
- const QSize &size, const QWidget *widget) const Q_DECL_OVERRIDE;
+ const QSize &size, const QWidget *widget) const override;
SubControl hitTestComplexControl(ComplexControl cc, const QStyleOptionComplex *opt,
- const QPoint &pt, const QWidget *w = 0) const Q_DECL_OVERRIDE;
+ const QPoint &pt, const QWidget *w = 0) const override;
QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *opt,
- SubControl sc, const QWidget *widget) const Q_DECL_OVERRIDE;
+ SubControl sc, const QWidget *widget) const override;
QPixmap generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap,
- const QStyleOption *opt) const Q_DECL_OVERRIDE;
+ const QStyleOption *opt) const override;
int styleHint(StyleHint hint, const QStyleOption *option = 0, const QWidget *widget = 0,
- QStyleHintReturn *returnData = 0) const Q_DECL_OVERRIDE;
- QRect itemPixmapRect(const QRect &r, int flags, const QPixmap &pixmap) const Q_DECL_OVERRIDE;
+ QStyleHintReturn *returnData = 0) const override;
+ QRect itemPixmapRect(const QRect &r, int flags, const QPixmap &pixmap) const override;
QIcon standardIcon(StandardPixmap standardIcon, const QStyleOption *option = 0,
- const QWidget *widget = 0) const Q_DECL_OVERRIDE;
+ const QWidget *widget = 0) const override;
QPixmap standardPixmap(StandardPixmap standardPixmap, const QStyleOption *opt,
- const QWidget *widget = 0) const Q_DECL_OVERRIDE;
+ const QWidget *widget = 0) const override;
void drawItemPixmap(QPainter *painter, const QRect &rect,
- int alignment, const QPixmap &pixmap) const Q_DECL_OVERRIDE;
+ int alignment, const QPixmap &pixmap) const override;
void drawItemText(QPainter *painter, const QRect &rect,
int flags, const QPalette &pal, bool enabled,
- const QString &text, QPalette::ColorRole textRole = QPalette::NoRole) const Q_DECL_OVERRIDE;
- void polish(QWidget *widget) Q_DECL_OVERRIDE;
- void polish(QApplication *app) Q_DECL_OVERRIDE;
- void polish(QPalette &pal) Q_DECL_OVERRIDE;
- void unpolish(QWidget *widget) Q_DECL_OVERRIDE;
- void unpolish(QApplication *app) Q_DECL_OVERRIDE;
+ const QString &text, QPalette::ColorRole textRole = QPalette::NoRole) const override;
+ void polish(QWidget *widget) override;
+ void polish(QApplication *app) override;
+ void polish(QPalette &pal) override;
+ void unpolish(QWidget *widget) override;
+ void unpolish(QApplication *app) override;
protected:
QFusionStyle(QFusionStylePrivate &dd);
diff --git a/src/widgets/styles/qpixmapstyle_p.h b/src/widgets/styles/qpixmapstyle_p.h
index 618d6d2f50..590434d95e 100644
--- a/src/widgets/styles/qpixmapstyle_p.h
+++ b/src/widgets/styles/qpixmapstyle_p.h
@@ -136,34 +136,34 @@ public:
QPixmapStyle();
~QPixmapStyle();
- void polish(QApplication *application) Q_DECL_OVERRIDE;
- void polish(QPalette &palette) Q_DECL_OVERRIDE;
- void polish(QWidget *widget) Q_DECL_OVERRIDE;
- void unpolish(QApplication *application) Q_DECL_OVERRIDE;
- void unpolish(QWidget *widget) Q_DECL_OVERRIDE;
+ void polish(QApplication *application) override;
+ void polish(QPalette &palette) override;
+ void polish(QWidget *widget) override;
+ void unpolish(QApplication *application) override;
+ void unpolish(QWidget *widget) override;
void drawPrimitive(PrimitiveElement element, const QStyleOption *option,
- QPainter *painter, const QWidget *widget = Q_NULLPTR) const Q_DECL_OVERRIDE;
+ QPainter *painter, const QWidget *widget = nullptr) const override;
void drawControl(ControlElement element, const QStyleOption *option,
- QPainter *painter, const QWidget *widget = Q_NULLPTR) const Q_DECL_OVERRIDE;
+ QPainter *painter, const QWidget *widget = nullptr) const override;
void drawComplexControl(ComplexControl cc, const QStyleOptionComplex *option,
- QPainter *painter, const QWidget *widget=0) const Q_DECL_OVERRIDE;
+ QPainter *painter, const QWidget *widget=0) const override;
QSize sizeFromContents(ContentsType type, const QStyleOption *option,
- const QSize &contentsSize, const QWidget *widget = Q_NULLPTR) const Q_DECL_OVERRIDE;
+ const QSize &contentsSize, const QWidget *widget = nullptr) const override;
QRect subElementRect(SubElement element, const QStyleOption *option,
- const QWidget *widget = Q_NULLPTR) const Q_DECL_OVERRIDE;
+ const QWidget *widget = nullptr) const override;
QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *option,
- SubControl sc, const QWidget *widget = Q_NULLPTR) const Q_DECL_OVERRIDE;
+ SubControl sc, const QWidget *widget = nullptr) const override;
- int pixelMetric(PixelMetric metric, const QStyleOption *option = Q_NULLPTR,
- const QWidget *widget = Q_NULLPTR) const Q_DECL_OVERRIDE;
+ int pixelMetric(PixelMetric metric, const QStyleOption *option = nullptr,
+ const QWidget *widget = nullptr) const override;
int styleHint(StyleHint hint, const QStyleOption *option,
- const QWidget *widget, QStyleHintReturn *returnData) const Q_DECL_OVERRIDE;
+ const QWidget *widget, QStyleHintReturn *returnData) const override;
SubControl hitTestComplexControl(ComplexControl control, const QStyleOptionComplex *option,
- const QPoint &pos, const QWidget *widget) const Q_DECL_OVERRIDE;
+ const QPoint &pos, const QWidget *widget) const override;
- bool eventFilter(QObject *watched, QEvent *event) Q_DECL_OVERRIDE;
+ bool eventFilter(QObject *watched, QEvent *event) override;
void addDescriptor(ControlDescriptor control, const QString &fileName,
QMargins margins = QMargins(),
diff --git a/src/widgets/styles/qproxystyle.h b/src/widgets/styles/qproxystyle.h
index 20a0f12868..c26d9abf59 100644
--- a/src/widgets/styles/qproxystyle.h
+++ b/src/widgets/styles/qproxystyle.h
@@ -54,47 +54,47 @@ class Q_WIDGETS_EXPORT QProxyStyle : public QCommonStyle
Q_OBJECT
public:
- QProxyStyle(QStyle *style = Q_NULLPTR);
+ QProxyStyle(QStyle *style = nullptr);
QProxyStyle(const QString &key);
~QProxyStyle();
QStyle *baseStyle() const;
void setBaseStyle(QStyle *style);
- void drawPrimitive(PrimitiveElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget = Q_NULLPTR) const Q_DECL_OVERRIDE;
- void drawControl(ControlElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget = Q_NULLPTR) const Q_DECL_OVERRIDE;
- void drawComplexControl(ComplexControl control, const QStyleOptionComplex *option, QPainter *painter, const QWidget *widget = Q_NULLPTR) const Q_DECL_OVERRIDE;
+ void drawPrimitive(PrimitiveElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget = nullptr) const override;
+ void drawControl(ControlElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget = nullptr) const override;
+ void drawComplexControl(ComplexControl control, const QStyleOptionComplex *option, QPainter *painter, const QWidget *widget = nullptr) const override;
void drawItemText(QPainter *painter, const QRect &rect, int flags, const QPalette &pal, bool enabled,
- const QString &text, QPalette::ColorRole textRole = QPalette::NoRole) const Q_DECL_OVERRIDE;
- virtual void drawItemPixmap(QPainter *painter, const QRect &rect, int alignment, const QPixmap &pixmap) const Q_DECL_OVERRIDE;
+ const QString &text, QPalette::ColorRole textRole = QPalette::NoRole) const override;
+ virtual void drawItemPixmap(QPainter *painter, const QRect &rect, int alignment, const QPixmap &pixmap) const override;
- QSize sizeFromContents(ContentsType type, const QStyleOption *option, const QSize &size, const QWidget *widget) const Q_DECL_OVERRIDE;
+ QSize sizeFromContents(ContentsType type, const QStyleOption *option, const QSize &size, const QWidget *widget) const override;
- QRect subElementRect(SubElement element, const QStyleOption *option, const QWidget *widget) const Q_DECL_OVERRIDE;
- QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *opt, SubControl sc, const QWidget *widget) const Q_DECL_OVERRIDE;
- QRect itemTextRect(const QFontMetrics &fm, const QRect &r, int flags, bool enabled, const QString &text) const Q_DECL_OVERRIDE;
- QRect itemPixmapRect(const QRect &r, int flags, const QPixmap &pixmap) const Q_DECL_OVERRIDE;
+ QRect subElementRect(SubElement element, const QStyleOption *option, const QWidget *widget) const override;
+ QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *opt, SubControl sc, const QWidget *widget) const override;
+ QRect itemTextRect(const QFontMetrics &fm, const QRect &r, int flags, bool enabled, const QString &text) const override;
+ QRect itemPixmapRect(const QRect &r, int flags, const QPixmap &pixmap) const override;
- SubControl hitTestComplexControl(ComplexControl control, const QStyleOptionComplex *option, const QPoint &pos, const QWidget *widget = Q_NULLPTR) const Q_DECL_OVERRIDE;
- int styleHint(StyleHint hint, const QStyleOption *option = Q_NULLPTR, const QWidget *widget = Q_NULLPTR, QStyleHintReturn *returnData = Q_NULLPTR) const Q_DECL_OVERRIDE;
- int pixelMetric(PixelMetric metric, const QStyleOption *option = Q_NULLPTR, const QWidget *widget = Q_NULLPTR) const Q_DECL_OVERRIDE;
+ SubControl hitTestComplexControl(ComplexControl control, const QStyleOptionComplex *option, const QPoint &pos, const QWidget *widget = nullptr) const override;
+ int styleHint(StyleHint hint, const QStyleOption *option = nullptr, const QWidget *widget = nullptr, QStyleHintReturn *returnData = nullptr) const override;
+ int pixelMetric(PixelMetric metric, const QStyleOption *option = nullptr, const QWidget *widget = nullptr) const override;
int layoutSpacing(QSizePolicy::ControlType control1, QSizePolicy::ControlType control2,
- Qt::Orientation orientation, const QStyleOption *option = Q_NULLPTR, const QWidget *widget = Q_NULLPTR) const Q_DECL_OVERRIDE;
+ Qt::Orientation orientation, const QStyleOption *option = nullptr, const QWidget *widget = nullptr) const override;
- QIcon standardIcon(StandardPixmap standardIcon, const QStyleOption *option = Q_NULLPTR, const QWidget *widget = Q_NULLPTR) const Q_DECL_OVERRIDE;
- QPixmap standardPixmap(StandardPixmap standardPixmap, const QStyleOption *opt, const QWidget *widget = Q_NULLPTR) const Q_DECL_OVERRIDE;
- QPixmap generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap, const QStyleOption *opt) const Q_DECL_OVERRIDE;
- QPalette standardPalette() const Q_DECL_OVERRIDE;
+ QIcon standardIcon(StandardPixmap standardIcon, const QStyleOption *option = nullptr, const QWidget *widget = nullptr) const override;
+ QPixmap standardPixmap(StandardPixmap standardPixmap, const QStyleOption *opt, const QWidget *widget = nullptr) const override;
+ QPixmap generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap, const QStyleOption *opt) const override;
+ QPalette standardPalette() const override;
- void polish(QWidget *widget) Q_DECL_OVERRIDE;
- void polish(QPalette &pal) Q_DECL_OVERRIDE;
- void polish(QApplication *app) Q_DECL_OVERRIDE;
+ void polish(QWidget *widget) override;
+ void polish(QPalette &pal) override;
+ void polish(QApplication *app) override;
- void unpolish(QWidget *widget) Q_DECL_OVERRIDE;
- void unpolish(QApplication *app) Q_DECL_OVERRIDE;
+ void unpolish(QWidget *widget) override;
+ void unpolish(QApplication *app) override;
protected:
- bool event(QEvent *e) Q_DECL_OVERRIDE;
+ bool event(QEvent *e) override;
private:
Q_DISABLE_COPY(QProxyStyle)
diff --git a/src/widgets/styles/qstyle.h b/src/widgets/styles/qstyle.h
index b4936a3e0a..f922aff7f1 100644
--- a/src/widgets/styles/qstyle.h
+++ b/src/widgets/styles/qstyle.h
@@ -202,7 +202,7 @@ public:
Q_ENUM(PrimitiveElement)
virtual void drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p,
- const QWidget *w = Q_NULLPTR) const = 0;
+ const QWidget *w = nullptr) const = 0;
enum ControlElement {
CE_PushButton,
CE_PushButtonBevel,
@@ -273,7 +273,7 @@ public:
Q_ENUM(ControlElement)
virtual void drawControl(ControlElement element, const QStyleOption *opt, QPainter *p,
- const QWidget *w = Q_NULLPTR) const = 0;
+ const QWidget *w = nullptr) const = 0;
enum SubElement {
SE_PushButtonContents,
@@ -362,7 +362,7 @@ public:
Q_ENUM(SubElement)
virtual QRect subElementRect(SubElement subElement, const QStyleOption *option,
- const QWidget *widget = Q_NULLPTR) const = 0;
+ const QWidget *widget = nullptr) const = 0;
enum ComplexControl {
@@ -441,11 +441,11 @@ public:
virtual void drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p,
- const QWidget *widget = Q_NULLPTR) const = 0;
+ const QWidget *widget = nullptr) const = 0;
virtual SubControl hitTestComplexControl(ComplexControl cc, const QStyleOptionComplex *opt,
- const QPoint &pt, const QWidget *widget = Q_NULLPTR) const = 0;
+ const QPoint &pt, const QWidget *widget = nullptr) const = 0;
virtual QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *opt,
- SubControl sc, const QWidget *widget = Q_NULLPTR) const = 0;
+ SubControl sc, const QWidget *widget = nullptr) const = 0;
enum PixelMetric {
PM_ButtonMargin,
@@ -579,8 +579,8 @@ public:
};
Q_ENUM(PixelMetric)
- virtual int pixelMetric(PixelMetric metric, const QStyleOption *option = Q_NULLPTR,
- const QWidget *widget = Q_NULLPTR) const = 0;
+ virtual int pixelMetric(PixelMetric metric, const QStyleOption *option = nullptr,
+ const QWidget *widget = nullptr) const = 0;
enum ContentsType {
CT_PushButton,
@@ -612,7 +612,7 @@ public:
Q_ENUM(ContentsType)
virtual QSize sizeFromContents(ContentsType ct, const QStyleOption *opt,
- const QSize &contentsSize, const QWidget *w = Q_NULLPTR) const = 0;
+ const QSize &contentsSize, const QWidget *w = nullptr) const = 0;
enum RequestSoftwareInputPanel {
RSIP_OnMouseClickAndAlreadyFocused,
@@ -745,8 +745,8 @@ public:
};
Q_ENUM(StyleHint)
- virtual int styleHint(StyleHint stylehint, const QStyleOption *opt = Q_NULLPTR,
- const QWidget *widget = Q_NULLPTR, QStyleHintReturn* returnData = Q_NULLPTR) const = 0;
+ virtual int styleHint(StyleHint stylehint, const QStyleOption *opt = nullptr,
+ const QWidget *widget = nullptr, QStyleHintReturn* returnData = nullptr) const = 0;
enum StandardPixmap {
SP_TitleBarMenuButton,
@@ -825,11 +825,11 @@ public:
};
Q_ENUM(StandardPixmap)
- virtual QPixmap standardPixmap(StandardPixmap standardPixmap, const QStyleOption *opt = Q_NULLPTR,
- const QWidget *widget = Q_NULLPTR) const = 0;
+ virtual QPixmap standardPixmap(StandardPixmap standardPixmap, const QStyleOption *opt = nullptr,
+ const QWidget *widget = nullptr) const = 0;
- virtual QIcon standardIcon(StandardPixmap standardIcon, const QStyleOption *option = Q_NULLPTR,
- const QWidget *widget = Q_NULLPTR) const = 0;
+ virtual QIcon standardIcon(StandardPixmap standardIcon, const QStyleOption *option = nullptr,
+ const QWidget *widget = nullptr) const = 0;
virtual QPixmap generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap,
const QStyleOption *opt) const = 0;
@@ -848,10 +848,10 @@ public:
virtual int layoutSpacing(QSizePolicy::ControlType control1,
QSizePolicy::ControlType control2, Qt::Orientation orientation,
- const QStyleOption *option = Q_NULLPTR, const QWidget *widget = Q_NULLPTR) const = 0;
+ const QStyleOption *option = nullptr, const QWidget *widget = nullptr) const = 0;
int combinedLayoutSpacing(QSizePolicy::ControlTypes controls1,
QSizePolicy::ControlTypes controls2, Qt::Orientation orientation,
- QStyleOption *option = Q_NULLPTR, QWidget *widget = Q_NULLPTR) const;
+ QStyleOption *option = nullptr, QWidget *widget = nullptr) const;
const QStyle * proxy() const;
diff --git a/src/widgets/styles/qstyleanimation_p.h b/src/widgets/styles/qstyleanimation_p.h
index bb1ab9d877..a2ad4a91da 100644
--- a/src/widgets/styles/qstyleanimation_p.h
+++ b/src/widgets/styles/qstyleanimation_p.h
@@ -70,7 +70,7 @@ public:
QObject *target() const;
- int duration() const Q_DECL_OVERRIDE;
+ int duration() const override;
void setDuration(int duration);
int delay() const;
@@ -97,7 +97,7 @@ public Q_SLOTS:
protected:
virtual bool isUpdateNeeded() const;
- virtual void updateCurrentTime(int time) Q_DECL_OVERRIDE;
+ virtual void updateCurrentTime(int time) override;
private:
int _delay;
@@ -121,7 +121,7 @@ public:
void setSpeed(int speed);
protected:
- bool isUpdateNeeded() const Q_DECL_OVERRIDE;
+ bool isUpdateNeeded() const override;
private:
int _speed;
@@ -144,7 +144,7 @@ public:
qreal currentValue() const;
protected:
- bool isUpdateNeeded() const Q_DECL_OVERRIDE;
+ bool isUpdateNeeded() const override;
private:
qreal _start;
@@ -170,7 +170,7 @@ public:
QImage currentImage() const;
protected:
- virtual void updateCurrentTime(int time) Q_DECL_OVERRIDE;
+ virtual void updateCurrentTime(int time) override;
private:
Type _type;
@@ -194,7 +194,7 @@ public:
void setActive(bool active);
private slots:
- void updateCurrentTime(int time) Q_DECL_OVERRIDE;
+ void updateCurrentTime(int time) override;
private:
Mode _mode;
diff --git a/src/widgets/styles/qstyleoption.h b/src/widgets/styles/qstyleoption.h
index f703c56917..2880917510 100644
--- a/src/widgets/styles/qstyleoption.h
+++ b/src/widgets/styles/qstyleoption.h
@@ -682,7 +682,7 @@ T qstyleoption_cast(const QStyleOption *opt)
|| (int(Opt::Type) == QStyleOption::SO_Complex
&& opt->type > QStyleOption::SO_Complex)))
return static_cast<T>(opt);
- return Q_NULLPTR;
+ return nullptr;
}
template <typename T>
@@ -694,7 +694,7 @@ T qstyleoption_cast(QStyleOption *opt)
|| (int(Opt::Type) == QStyleOption::SO_Complex
&& opt->type > QStyleOption::SO_Complex)))
return static_cast<T>(opt);
- return Q_NULLPTR;
+ return nullptr;
}
// -------------------------- QStyleHintReturn -------------------------------
@@ -743,7 +743,7 @@ T qstyleoption_cast(const QStyleHintReturn *hint)
if (hint && hint->version <= Opt::Version &&
(hint->type == Opt::Type || int(Opt::Type) == QStyleHintReturn::SH_Default))
return static_cast<T>(hint);
- return Q_NULLPTR;
+ return nullptr;
}
template <typename T>
@@ -753,7 +753,7 @@ T qstyleoption_cast(QStyleHintReturn *hint)
if (hint && hint->version <= Opt::Version &&
(hint->type == Opt::Type || int(Opt::Type) == QStyleHintReturn::SH_Default))
return static_cast<T>(hint);
- return Q_NULLPTR;
+ return nullptr;
}
#if !defined(QT_NO_DEBUG_STREAM)
diff --git a/src/widgets/styles/qstylepainter.h b/src/widgets/styles/qstylepainter.h
index 191360727e..b5e7956cb1 100644
--- a/src/widgets/styles/qstylepainter.h
+++ b/src/widgets/styles/qstylepainter.h
@@ -51,7 +51,7 @@ QT_BEGIN_NAMESPACE
class QStylePainter : public QPainter
{
public:
- inline QStylePainter() : QPainter(), widget(Q_NULLPTR), wstyle(Q_NULLPTR) {}
+ inline QStylePainter() : QPainter(), widget(nullptr), wstyle(nullptr) {}
inline explicit QStylePainter(QWidget *w) { begin(w, w); }
inline QStylePainter(QPaintDevice *pd, QWidget *w) { begin(pd, w); }
inline bool begin(QWidget *w) { return begin(w, w); }
diff --git a/src/widgets/styles/qstyleplugin.h b/src/widgets/styles/qstyleplugin.h
index d44f57d208..e9a26f9127 100644
--- a/src/widgets/styles/qstyleplugin.h
+++ b/src/widgets/styles/qstyleplugin.h
@@ -55,7 +55,7 @@ class Q_WIDGETS_EXPORT QStylePlugin : public QObject
{
Q_OBJECT
public:
- explicit QStylePlugin(QObject *parent = Q_NULLPTR);
+ explicit QStylePlugin(QObject *parent = nullptr);
~QStylePlugin();
virtual QStyle *create(const QString &key) = 0;
diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp
index a721357ddc..fd812d8d0d 100644
--- a/src/widgets/styles/qstylesheetstyle.cpp
+++ b/src/widgets/styles/qstylesheetstyle.cpp
@@ -1463,7 +1463,7 @@ class QStyleSheetStyleSelector : public StyleSelector
public:
QStyleSheetStyleSelector() { }
- QStringList nodeNames(NodePtr node) const Q_DECL_OVERRIDE
+ QStringList nodeNames(NodePtr node) const override
{
if (isNullNode(node))
return QStringList();
@@ -1479,7 +1479,7 @@ public:
} while (metaObject != 0);
return result;
}
- QString attribute(NodePtr node, const QString& name) const Q_DECL_OVERRIDE
+ QString attribute(NodePtr node, const QString& name) const override
{
if (isNullNode(node))
return QString();
@@ -1516,7 +1516,7 @@ public:
cache[name] = valueStr;
return valueStr;
}
- bool nodeNameEquals(NodePtr node, const QString& nodeName) const Q_DECL_OVERRIDE
+ bool nodeNameEquals(NodePtr node, const QString& nodeName) const override
{
if (isNullNode(node))
return false;
@@ -1539,19 +1539,19 @@ public:
} while (metaObject != 0);
return false;
}
- bool hasAttributes(NodePtr) const Q_DECL_OVERRIDE
+ bool hasAttributes(NodePtr) const override
{ return true; }
- QStringList nodeIds(NodePtr node) const Q_DECL_OVERRIDE
+ QStringList nodeIds(NodePtr node) const override
{ return isNullNode(node) ? QStringList() : QStringList(OBJECT_PTR(node)->objectName()); }
- bool isNullNode(NodePtr node) const Q_DECL_OVERRIDE
+ bool isNullNode(NodePtr node) const override
{ return node.ptr == 0; }
- NodePtr parentNode(NodePtr node) const Q_DECL_OVERRIDE
+ NodePtr parentNode(NodePtr node) const override
{ NodePtr n; n.ptr = isNullNode(node) ? 0 : parentObject(OBJECT_PTR(node)); return n; }
- NodePtr previousSiblingNode(NodePtr) const Q_DECL_OVERRIDE
+ NodePtr previousSiblingNode(NodePtr) const override
{ NodePtr n; n.ptr = 0; return n; }
- NodePtr duplicateNode(NodePtr node) const Q_DECL_OVERRIDE
+ NodePtr duplicateNode(NodePtr node) const override
{ return node; }
- void freeNode(NodePtr) const Q_DECL_OVERRIDE
+ void freeNode(NodePtr) const override
{ }
private:
@@ -4262,7 +4262,7 @@ void QStyleSheetStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *op
switch (pe) {
case PE_FrameStatusBar: {
- QRenderRule subRule = renderRule(w ? w->parentWidget() : Q_NULLPTR, opt, PseudoElement_Item);
+ QRenderRule subRule = renderRule(w ? w->parentWidget() : nullptr, opt, PseudoElement_Item);
if (subRule.hasDrawable()) {
subRule.drawRule(p, opt->rect);
return;
diff --git a/src/widgets/styles/qstylesheetstyle_p.h b/src/widgets/styles/qstylesheetstyle_p.h
index 2d302305bd..042abf5c22 100644
--- a/src/widgets/styles/qstylesheetstyle_p.h
+++ b/src/widgets/styles/qstylesheetstyle_p.h
@@ -82,48 +82,48 @@ public:
~QStyleSheetStyle();
void drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p,
- const QWidget *w = 0) const Q_DECL_OVERRIDE;
+ const QWidget *w = 0) const override;
void drawControl(ControlElement element, const QStyleOption *opt, QPainter *p,
- const QWidget *w = 0) const Q_DECL_OVERRIDE;
- void drawItemPixmap(QPainter *painter, const QRect &rect, int alignment, const QPixmap &pixmap) const Q_DECL_OVERRIDE;
+ const QWidget *w = 0) const override;
+ void drawItemPixmap(QPainter *painter, const QRect &rect, int alignment, const QPixmap &pixmap) const override;
void drawItemText(QPainter *painter, const QRect& rect, int alignment, const QPalette &pal,
- bool enabled, const QString& text, QPalette::ColorRole textRole = QPalette::NoRole) const Q_DECL_OVERRIDE;
+ bool enabled, const QString& text, QPalette::ColorRole textRole = QPalette::NoRole) const override;
void drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p,
- const QWidget *w = 0) const Q_DECL_OVERRIDE;
+ const QWidget *w = 0) const override;
QPixmap generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap,
- const QStyleOption *option) const Q_DECL_OVERRIDE;
+ const QStyleOption *option) const override;
SubControl hitTestComplexControl(ComplexControl cc, const QStyleOptionComplex *opt,
- const QPoint &pt, const QWidget *w = 0) const Q_DECL_OVERRIDE;
- QRect itemPixmapRect(const QRect &rect, int alignment, const QPixmap &pixmap) const Q_DECL_OVERRIDE;
+ const QPoint &pt, const QWidget *w = 0) const override;
+ QRect itemPixmapRect(const QRect &rect, int alignment, const QPixmap &pixmap) const override;
QRect itemTextRect(const QFontMetrics &metrics, const QRect &rect, int alignment, bool enabled,
- const QString &text) const Q_DECL_OVERRIDE;
- int pixelMetric(PixelMetric metric, const QStyleOption *option = 0, const QWidget *widget = 0) const Q_DECL_OVERRIDE;
- void polish(QWidget *widget) Q_DECL_OVERRIDE;
- void polish(QApplication *app) Q_DECL_OVERRIDE;
- void polish(QPalette &pal) Q_DECL_OVERRIDE;
+ const QString &text) const override;
+ int pixelMetric(PixelMetric metric, const QStyleOption *option = 0, const QWidget *widget = 0) const override;
+ void polish(QWidget *widget) override;
+ void polish(QApplication *app) override;
+ void polish(QPalette &pal) override;
QSize sizeFromContents(ContentsType ct, const QStyleOption *opt,
- const QSize &contentsSize, const QWidget *widget = 0) const Q_DECL_OVERRIDE;
- QPalette standardPalette() const Q_DECL_OVERRIDE;
+ const QSize &contentsSize, const QWidget *widget = 0) const override;
+ QPalette standardPalette() const override;
QIcon standardIcon(StandardPixmap standardIcon, const QStyleOption *opt = 0,
- const QWidget *widget = 0) const Q_DECL_OVERRIDE;
+ const QWidget *widget = 0) const override;
QPixmap standardPixmap(StandardPixmap standardPixmap, const QStyleOption *option = 0,
- const QWidget *w = 0 ) const Q_DECL_OVERRIDE;
+ const QWidget *w = 0 ) const override;
int layoutSpacing(QSizePolicy::ControlType control1, QSizePolicy::ControlType control2,
Qt::Orientation orientation, const QStyleOption *option = 0,
- const QWidget *widget = 0) const Q_DECL_OVERRIDE;
+ const QWidget *widget = 0) const override;
int styleHint(StyleHint sh, const QStyleOption *opt = 0, const QWidget *w = 0,
- QStyleHintReturn *shret = 0) const Q_DECL_OVERRIDE;
- QRect subElementRect(SubElement r, const QStyleOption *opt, const QWidget *widget = 0) const Q_DECL_OVERRIDE;
+ QStyleHintReturn *shret = 0) const override;
+ QRect subElementRect(SubElement r, const QStyleOption *opt, const QWidget *widget = 0) const override;
QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *opt, SubControl sc,
- const QWidget *w = 0) const Q_DECL_OVERRIDE;
+ const QWidget *w = 0) const override;
// These functions are called from QApplication/QWidget. Be careful.
QStyle *baseStyle() const;
void repolish(QWidget *widget);
void repolish(QApplication *app);
- void unpolish(QWidget *widget) Q_DECL_OVERRIDE;
- void unpolish(QApplication *app) Q_DECL_OVERRIDE;
+ void unpolish(QWidget *widget) override;
+ void unpolish(QApplication *app) override;
QStyle *base;
void ref() { ++refcount; }
@@ -136,7 +136,7 @@ public:
bool styleSheetPalette(const QWidget* w, const QStyleOption* opt, QPalette* pal);
protected:
- bool event(QEvent *e) Q_DECL_OVERRIDE;
+ bool event(QEvent *e) override;
private:
int refcount;
diff --git a/src/widgets/styles/qwindowsstyle.cpp b/src/widgets/styles/qwindowsstyle.cpp
index 657166fc8d..9e53038348 100644
--- a/src/widgets/styles/qwindowsstyle.cpp
+++ b/src/widgets/styles/qwindowsstyle.cpp
@@ -380,7 +380,7 @@ int QWindowsStylePrivate::fixedPixelMetric(QStyle::PixelMetric pm)
static QWindow *windowOf(const QWidget *w)
{
- QWindow *result = Q_NULLPTR;
+ QWindow *result = nullptr;
if (w) {
result = w->windowHandle();
if (!result) {
diff --git a/src/widgets/styles/qwindowsstyle_p.h b/src/widgets/styles/qwindowsstyle_p.h
index 12a682f330..7993b9f1c6 100644
--- a/src/widgets/styles/qwindowsstyle_p.h
+++ b/src/widgets/styles/qwindowsstyle_p.h
@@ -68,37 +68,37 @@ public:
QWindowsStyle();
~QWindowsStyle();
- void polish(QApplication*) Q_DECL_OVERRIDE;
- void unpolish(QApplication*) Q_DECL_OVERRIDE;
+ void polish(QApplication*) override;
+ void unpolish(QApplication*) override;
- void polish(QWidget*) Q_DECL_OVERRIDE;
- void unpolish(QWidget*) Q_DECL_OVERRIDE;
+ void polish(QWidget*) override;
+ void unpolish(QWidget*) override;
- void polish(QPalette &) Q_DECL_OVERRIDE;
+ void polish(QPalette &) override;
void drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p,
- const QWidget *w = 0) const Q_DECL_OVERRIDE;
+ const QWidget *w = 0) const override;
void drawControl(ControlElement element, const QStyleOption *opt, QPainter *p,
- const QWidget *w = 0) const Q_DECL_OVERRIDE;
- QRect subElementRect(SubElement r, const QStyleOption *opt, const QWidget *widget = 0) const Q_DECL_OVERRIDE;
+ const QWidget *w = 0) const override;
+ QRect subElementRect(SubElement r, const QStyleOption *opt, const QWidget *widget = 0) const override;
void drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p,
- const QWidget *w = 0) const Q_DECL_OVERRIDE;
+ const QWidget *w = 0) const override;
QSize sizeFromContents(ContentsType ct, const QStyleOption *opt,
- const QSize &contentsSize, const QWidget *widget = 0) const Q_DECL_OVERRIDE;
+ const QSize &contentsSize, const QWidget *widget = 0) const override;
- int pixelMetric(PixelMetric pm, const QStyleOption *option = 0, const QWidget *widget = 0) const Q_DECL_OVERRIDE;
+ int pixelMetric(PixelMetric pm, const QStyleOption *option = 0, const QWidget *widget = 0) const override;
int styleHint(StyleHint hint, const QStyleOption *opt = 0, const QWidget *widget = 0,
- QStyleHintReturn *returnData = 0) const Q_DECL_OVERRIDE;
+ QStyleHintReturn *returnData = 0) const override;
QPixmap standardPixmap(StandardPixmap standardPixmap, const QStyleOption *opt,
- const QWidget *widget = 0) const Q_DECL_OVERRIDE;
+ const QWidget *widget = 0) const override;
QIcon standardIcon(StandardPixmap standardIcon, const QStyleOption *option = 0,
- const QWidget *widget = 0) const Q_DECL_OVERRIDE;
+ const QWidget *widget = 0) const override;
protected:
- bool eventFilter(QObject *o, QEvent *e) Q_DECL_OVERRIDE;
+ bool eventFilter(QObject *o, QEvent *e) override;
QWindowsStyle(QWindowsStylePrivate &dd);
private:
diff --git a/src/widgets/styles/qwindowsstyle_p_p.h b/src/widgets/styles/qwindowsstyle_p_p.h
index 8b387b6ab9..67fa6a2f86 100644
--- a/src/widgets/styles/qwindowsstyle_p_p.h
+++ b/src/widgets/styles/qwindowsstyle_p_p.h
@@ -73,7 +73,7 @@ public:
static int fixedPixelMetric(QStyle::PixelMetric pm);
static qreal devicePixelRatio(const QWidget *widget = 0)
{ return widget ? widget->devicePixelRatioF() : QWindowsStylePrivate::appDevicePixelRatio(); }
- static qreal nativeMetricScaleFactor(const QWidget *widget = Q_NULLPTR);
+ static qreal nativeMetricScaleFactor(const QWidget *widget = nullptr);
bool hasSeenAlt(const QWidget *widget) const;
bool altDown() const { return alt_down; }
diff --git a/src/widgets/util/qcompleter.h b/src/widgets/util/qcompleter.h
index 1a2c2440f5..de79302e15 100644
--- a/src/widgets/util/qcompleter.h
+++ b/src/widgets/util/qcompleter.h
@@ -82,10 +82,10 @@ public:
CaseInsensitivelySortedModel
};
- QCompleter(QObject *parent = Q_NULLPTR);
- QCompleter(QAbstractItemModel *model, QObject *parent = Q_NULLPTR);
+ QCompleter(QObject *parent = nullptr);
+ QCompleter(QAbstractItemModel *model, QObject *parent = nullptr);
#ifndef QT_NO_STRINGLISTMODEL
- QCompleter(const QStringList& completions, QObject *parent = Q_NULLPTR);
+ QCompleter(const QStringList& completions, QObject *parent = nullptr);
#endif
~QCompleter();
@@ -142,8 +142,8 @@ public:
virtual QStringList splitPath(const QString &path) const;
protected:
- bool eventFilter(QObject *o, QEvent *e) Q_DECL_OVERRIDE;
- bool event(QEvent *) Q_DECL_OVERRIDE;
+ bool eventFilter(QObject *o, QEvent *e) override;
+ bool event(QEvent *) override;
Q_SIGNALS:
void activated(const QString &text);
diff --git a/src/widgets/util/qcompleter_p.h b/src/widgets/util/qcompleter_p.h
index e76dcdc8bc..765363744b 100644
--- a/src/widgets/util/qcompleter_p.h
+++ b/src/widgets/util/qcompleter_p.h
@@ -177,7 +177,7 @@ class QSortedModelEngine : public QCompletionEngine
{
public:
QSortedModelEngine(QCompleterPrivate *c) : QCompletionEngine(c) { }
- QMatchData filter(const QString&, const QModelIndex&, int) Q_DECL_OVERRIDE;
+ QMatchData filter(const QString&, const QModelIndex&, int) override;
QIndexMapper indexHint(QString, const QModelIndex&, Qt::SortOrder);
Qt::SortOrder sortOrder(const QModelIndex&) const;
};
@@ -187,8 +187,8 @@ class QUnsortedModelEngine : public QCompletionEngine
public:
QUnsortedModelEngine(QCompleterPrivate *c) : QCompletionEngine(c) { }
- void filterOnDemand(int) Q_DECL_OVERRIDE;
- QMatchData filter(const QString&, const QModelIndex&, int) Q_DECL_OVERRIDE;
+ void filterOnDemand(int) override;
+ QMatchData filter(const QString&, const QModelIndex&, int) override;
private:
int buildIndices(const QString& str, const QModelIndex& parent, int n,
const QIndexMapper& iv, QMatchData* m);
@@ -199,7 +199,7 @@ class QCompleterItemDelegate : public QItemDelegate
public:
QCompleterItemDelegate(QAbstractItemView *view)
: QItemDelegate(view), view(view) { }
- void paint(QPainter *p, const QStyleOptionViewItem& opt, const QModelIndex& idx) const Q_DECL_OVERRIDE {
+ void paint(QPainter *p, const QStyleOptionViewItem& opt, const QModelIndex& idx) const override {
QStyleOptionViewItem optCopy = opt;
optCopy.showDecorationSelected = true;
if (view->currentIndex() == idx)
@@ -228,16 +228,16 @@ public:
bool setCurrentRow(int row);
QModelIndex currentIndex(bool) const;
- QModelIndex index(int row, int column, const QModelIndex & = QModelIndex()) const Q_DECL_OVERRIDE;
- int rowCount(const QModelIndex &index = QModelIndex()) const Q_DECL_OVERRIDE;
- int columnCount(const QModelIndex &index = QModelIndex()) const Q_DECL_OVERRIDE;
- bool hasChildren(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
- QModelIndex parent(const QModelIndex & = QModelIndex()) const Q_DECL_OVERRIDE { return QModelIndex(); }
- QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
+ QModelIndex index(int row, int column, const QModelIndex & = QModelIndex()) const override;
+ int rowCount(const QModelIndex &index = QModelIndex()) const override;
+ int columnCount(const QModelIndex &index = QModelIndex()) const override;
+ bool hasChildren(const QModelIndex &parent = QModelIndex()) const override;
+ QModelIndex parent(const QModelIndex & = QModelIndex()) const override { return QModelIndex(); }
+ QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
- void setSourceModel(QAbstractItemModel *sourceModel) Q_DECL_OVERRIDE;
- QModelIndex mapToSource(const QModelIndex& proxyIndex) const Q_DECL_OVERRIDE;
- QModelIndex mapFromSource(const QModelIndex& sourceIndex) const Q_DECL_OVERRIDE;
+ void setSourceModel(QAbstractItemModel *sourceModel) override;
+ QModelIndex mapToSource(const QModelIndex& proxyIndex) const override;
+ QModelIndex mapFromSource(const QModelIndex& sourceIndex) const override;
QCompleterPrivate *c;
QScopedPointer<QCompletionEngine> engine;
diff --git a/src/widgets/util/qflickgesture.cpp b/src/widgets/util/qflickgesture.cpp
index 549b130c9d..b59fe0d504 100644
--- a/src/widgets/util/qflickgesture.cpp
+++ b/src/widgets/util/qflickgesture.cpp
@@ -256,7 +256,7 @@ public:
}
protected:
- void timerEvent(QTimerEvent *e) Q_DECL_OVERRIDE
+ void timerEvent(QTimerEvent *e) override
{
if (e->timerId() == pressDelayTimer) {
if (pressDelayEvent && mouseTarget) {
diff --git a/src/widgets/util/qscroller.cpp b/src/widgets/util/qscroller.cpp
index d8ac686fb9..8a1bcdae05 100644
--- a/src/widgets/util/qscroller.cpp
+++ b/src/widgets/util/qscroller.cpp
@@ -58,6 +58,7 @@
#include <QGraphicsView>
#endif
#include <QDesktopWidget>
+#include <private/qdesktopwidget_p.h>
#include <QVector2D>
#include <QtCore/qmath.h>
#include <QtGui/qevent.h>
@@ -198,7 +199,7 @@ public:
: QAbstractAnimation(_d), d(_d), ignoreUpdate(false), skip(0)
{ }
- int duration() const Q_DECL_OVERRIDE
+ int duration() const override
{
return -1;
}
@@ -214,7 +215,7 @@ public:
}
protected:
- void updateCurrentTime(int /*currentTime*/) Q_DECL_OVERRIDE
+ void updateCurrentTime(int /*currentTime*/) override
{
if (!ignoreUpdate) {
if (++skip >= d->frameRateSkip()) {
@@ -1016,7 +1017,7 @@ bool QScroller::handleInput(Input input, const QPointF &position, qint64 timesta
#if 1 // Used to be excluded in Qt4 for Q_WS_MAC
// the Mac version is implemented in qscroller_mac.mm
-QPointF QScrollerPrivate::realDpi(int screen) const
+QPointF QScrollerPrivate::realDpi(int screenNumber) const
{
# if 0 /* Used to be included in Qt4 for Q_WS_X11 */ && !defined(QT_NO_XRANDR)
if (X11 && X11->use_xrandr && X11->ptrXRRSizes && X11->ptrXRRRootToScreen) {
@@ -1040,8 +1041,8 @@ QPointF QScrollerPrivate::realDpi(int screen) const
}
# endif
- QWidget *w = QApplication::desktop()->screen(screen);
- return QPointF(w->physicalDpiX(), w->physicalDpiY());
+ const QScreen *screen = QDesktopWidgetPrivate::screen(screenNumber);
+ return QPointF(screen->physicalDotsPerInchX(), screen->physicalDotsPerInchY());
}
#endif
diff --git a/src/widgets/util/qsystemtrayicon.h b/src/widgets/util/qsystemtrayicon.h
index 81f396ed83..e4652b742c 100644
--- a/src/widgets/util/qsystemtrayicon.h
+++ b/src/widgets/util/qsystemtrayicon.h
@@ -66,8 +66,8 @@ class Q_WIDGETS_EXPORT QSystemTrayIcon : public QObject
Q_PROPERTY(bool visible READ isVisible WRITE setVisible DESIGNABLE false)
public:
- QSystemTrayIcon(QObject *parent = Q_NULLPTR);
- QSystemTrayIcon(const QIcon &icon, QObject *parent = Q_NULLPTR);
+ QSystemTrayIcon(QObject *parent = nullptr);
+ QSystemTrayIcon(const QIcon &icon, QObject *parent = nullptr);
~QSystemTrayIcon();
enum ActivationReason {
@@ -110,7 +110,7 @@ Q_SIGNALS:
void messageClicked();
protected:
- bool event(QEvent *event) Q_DECL_OVERRIDE;
+ bool event(QEvent *event) override;
private:
Q_DISABLE_COPY(QSystemTrayIcon)
diff --git a/src/widgets/util/qsystemtrayicon_p.h b/src/widgets/util/qsystemtrayicon_p.h
index 318edbd1e3..5bdf020a47 100644
--- a/src/widgets/util/qsystemtrayicon_p.h
+++ b/src/widgets/util/qsystemtrayicon_p.h
@@ -127,10 +127,10 @@ private:
void balloon(const QPoint&, int, bool);
protected:
- void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
- void resizeEvent(QResizeEvent *) Q_DECL_OVERRIDE;
- void mousePressEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
- void timerEvent(QTimerEvent *e) Q_DECL_OVERRIDE;
+ void paintEvent(QPaintEvent *) override;
+ void resizeEvent(QResizeEvent *) override;
+ void mousePressEvent(QMouseEvent *e) override;
+ void timerEvent(QTimerEvent *e) override;
private:
QSystemTrayIcon *trayIcon;
diff --git a/src/widgets/util/qsystemtrayicon_x11.cpp b/src/widgets/util/qsystemtrayicon_x11.cpp
index cd593d8d98..df93e15f80 100644
--- a/src/widgets/util/qsystemtrayicon_x11.cpp
+++ b/src/widgets/util/qsystemtrayicon_x11.cpp
@@ -87,12 +87,12 @@ public:
QRect globalGeometry() const;
protected:
- virtual void mousePressEvent(QMouseEvent *ev) Q_DECL_OVERRIDE;
- virtual void mouseDoubleClickEvent(QMouseEvent *ev) Q_DECL_OVERRIDE;
- virtual bool event(QEvent *) Q_DECL_OVERRIDE;
- virtual void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
- virtual void resizeEvent(QResizeEvent *) Q_DECL_OVERRIDE;
- virtual void moveEvent(QMoveEvent *) Q_DECL_OVERRIDE;
+ virtual void mousePressEvent(QMouseEvent *ev) override;
+ virtual void mouseDoubleClickEvent(QMouseEvent *ev) override;
+ virtual bool event(QEvent *) override;
+ virtual void paintEvent(QPaintEvent *) override;
+ virtual void resizeEvent(QResizeEvent *) override;
+ virtual void moveEvent(QMoveEvent *) override;
private slots:
void systemTrayWindowChanged(QScreen *screen);
diff --git a/src/widgets/util/qundogroup.h b/src/widgets/util/qundogroup.h
index dba79ea706..1845f7e057 100644
--- a/src/widgets/util/qundogroup.h
+++ b/src/widgets/util/qundogroup.h
@@ -58,7 +58,7 @@ class Q_WIDGETS_EXPORT QUndoGroup : public QObject
Q_DECLARE_PRIVATE(QUndoGroup)
public:
- explicit QUndoGroup(QObject *parent = Q_NULLPTR);
+ explicit QUndoGroup(QObject *parent = nullptr);
~QUndoGroup();
void addStack(QUndoStack *stack);
diff --git a/src/widgets/util/qundostack.h b/src/widgets/util/qundostack.h
index 7ab90b507a..4be24eadab 100644
--- a/src/widgets/util/qundostack.h
+++ b/src/widgets/util/qundostack.h
@@ -57,8 +57,8 @@ class Q_WIDGETS_EXPORT QUndoCommand
QUndoCommandPrivate *d;
public:
- explicit QUndoCommand(QUndoCommand *parent = Q_NULLPTR);
- explicit QUndoCommand(const QString &text, QUndoCommand *parent = Q_NULLPTR);
+ explicit QUndoCommand(QUndoCommand *parent = nullptr);
+ explicit QUndoCommand(const QString &text, QUndoCommand *parent = nullptr);
virtual ~QUndoCommand();
virtual void undo();
@@ -92,7 +92,7 @@ class Q_WIDGETS_EXPORT QUndoStack : public QObject
Q_PROPERTY(int undoLimit READ undoLimit WRITE setUndoLimit)
public:
- explicit QUndoStack(QObject *parent = Q_NULLPTR);
+ explicit QUndoStack(QObject *parent = nullptr);
~QUndoStack();
void clear();
diff --git a/src/widgets/util/qundoview.cpp b/src/widgets/util/qundoview.cpp
index b56aa42aed..31f6c0dff2 100644
--- a/src/widgets/util/qundoview.cpp
+++ b/src/widgets/util/qundoview.cpp
@@ -59,11 +59,11 @@ public:
QUndoStack *stack() const;
virtual QModelIndex index(int row, int column,
- const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
- virtual QModelIndex parent(const QModelIndex &child) const Q_DECL_OVERRIDE;
- virtual int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
- virtual int columnCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
- virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
+ const QModelIndex &parent = QModelIndex()) const override;
+ virtual QModelIndex parent(const QModelIndex &child) const override;
+ virtual int rowCount(const QModelIndex &parent = QModelIndex()) const override;
+ virtual int columnCount(const QModelIndex &parent = QModelIndex()) const override;
+ virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
QModelIndex selectedIndex() const;
QItemSelectionModel *selectionModel() const;
diff --git a/src/widgets/util/qundoview.h b/src/widgets/util/qundoview.h
index 0bfcdd0c18..403f05d2e4 100644
--- a/src/widgets/util/qundoview.h
+++ b/src/widgets/util/qundoview.h
@@ -62,10 +62,10 @@ class Q_WIDGETS_EXPORT QUndoView : public QListView
Q_PROPERTY(QIcon cleanIcon READ cleanIcon WRITE setCleanIcon)
public:
- explicit QUndoView(QWidget *parent = Q_NULLPTR);
- explicit QUndoView(QUndoStack *stack, QWidget *parent = Q_NULLPTR);
+ explicit QUndoView(QWidget *parent = nullptr);
+ explicit QUndoView(QUndoStack *stack, QWidget *parent = nullptr);
#if QT_CONFIG(undogroup)
- explicit QUndoView(QUndoGroup *group, QWidget *parent = Q_NULLPTR);
+ explicit QUndoView(QUndoGroup *group, QWidget *parent = nullptr);
#endif
~QUndoView();
diff --git a/src/widgets/widgets.pro b/src/widgets/widgets.pro
index 22bdf08408..27d7fe9874 100644
--- a/src/widgets/widgets.pro
+++ b/src/widgets/widgets.pro
@@ -5,7 +5,6 @@ MODULE_CONFIG = uic
CONFIG += $$MODULE_CONFIG
DEFINES += QT_NO_USING_NAMESPACE
win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x65000000
-irix-cc*:QMAKE_CXXFLAGS += -no_prelink -ptused
QMAKE_DOCS = $$PWD/doc/qtwidgets.qdocconf
diff --git a/src/widgets/widgets/qabstractbutton.h b/src/widgets/widgets/qabstractbutton.h
index 01dbf4e92d..e8dee142f2 100644
--- a/src/widgets/widgets/qabstractbutton.h
+++ b/src/widgets/widgets/qabstractbutton.h
@@ -72,7 +72,7 @@ class Q_WIDGETS_EXPORT QAbstractButton : public QWidget
Q_PROPERTY(bool down READ isDown WRITE setDown DESIGNABLE false)
public:
- explicit QAbstractButton(QWidget *parent = Q_NULLPTR);
+ explicit QAbstractButton(QWidget *parent = nullptr);
~QAbstractButton();
void setText(const QString &text);
@@ -126,25 +126,25 @@ Q_SIGNALS:
void toggled(bool checked);
protected:
- void paintEvent(QPaintEvent *e) Q_DECL_OVERRIDE = 0;
+ void paintEvent(QPaintEvent *e) override = 0;
virtual bool hitButton(const QPoint &pos) const;
virtual void checkStateSet();
virtual void nextCheckState();
- bool event(QEvent *e) Q_DECL_OVERRIDE;
- void keyPressEvent(QKeyEvent *e) Q_DECL_OVERRIDE;
- void keyReleaseEvent(QKeyEvent *e) Q_DECL_OVERRIDE;
- void mousePressEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
- void mouseReleaseEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
- void mouseMoveEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
- void focusInEvent(QFocusEvent *e) Q_DECL_OVERRIDE;
- void focusOutEvent(QFocusEvent *e) Q_DECL_OVERRIDE;
- void changeEvent(QEvent *e) Q_DECL_OVERRIDE;
- void timerEvent(QTimerEvent *e) Q_DECL_OVERRIDE;
+ bool event(QEvent *e) override;
+ void keyPressEvent(QKeyEvent *e) override;
+ void keyReleaseEvent(QKeyEvent *e) override;
+ void mousePressEvent(QMouseEvent *e) override;
+ void mouseReleaseEvent(QMouseEvent *e) override;
+ void mouseMoveEvent(QMouseEvent *e) override;
+ void focusInEvent(QFocusEvent *e) override;
+ void focusOutEvent(QFocusEvent *e) override;
+ void changeEvent(QEvent *e) override;
+ void timerEvent(QTimerEvent *e) override;
protected:
- QAbstractButton(QAbstractButtonPrivate &dd, QWidget* parent = Q_NULLPTR);
+ QAbstractButton(QAbstractButtonPrivate &dd, QWidget* parent = nullptr);
private:
Q_DECLARE_PRIVATE(QAbstractButton)
diff --git a/src/widgets/widgets/qabstractscrollarea.h b/src/widgets/widgets/qabstractscrollarea.h
index cee8481e6f..8a17036fb2 100644
--- a/src/widgets/widgets/qabstractscrollarea.h
+++ b/src/widgets/widgets/qabstractscrollarea.h
@@ -61,7 +61,7 @@ class Q_WIDGETS_EXPORT QAbstractScrollArea : public QFrame
Q_PROPERTY(SizeAdjustPolicy sizeAdjustPolicy READ sizeAdjustPolicy WRITE setSizeAdjustPolicy)
public:
- explicit QAbstractScrollArea(QWidget *parent = Q_NULLPTR);
+ explicit QAbstractScrollArea(QWidget *parent = nullptr);
~QAbstractScrollArea();
enum SizeAdjustPolicy {
@@ -91,9 +91,9 @@ public:
void setViewport(QWidget *widget);
QSize maximumViewportSize() const;
- QSize minimumSizeHint() const Q_DECL_OVERRIDE;
+ QSize minimumSizeHint() const override;
- QSize sizeHint() const Q_DECL_OVERRIDE;
+ QSize sizeHint() const override;
virtual void setupViewport(QWidget *viewport);
@@ -101,35 +101,35 @@ public:
void setSizeAdjustPolicy(SizeAdjustPolicy policy);
protected:
- QAbstractScrollArea(QAbstractScrollAreaPrivate &dd, QWidget *parent = Q_NULLPTR);
+ QAbstractScrollArea(QAbstractScrollAreaPrivate &dd, QWidget *parent = nullptr);
void setViewportMargins(int left, int top, int right, int bottom);
void setViewportMargins(const QMargins &margins);
QMargins viewportMargins() const;
- bool eventFilter(QObject *, QEvent *) Q_DECL_OVERRIDE;
- bool event(QEvent *) Q_DECL_OVERRIDE;
+ bool eventFilter(QObject *, QEvent *) override;
+ bool event(QEvent *) override;
virtual bool viewportEvent(QEvent *);
- void resizeEvent(QResizeEvent *) Q_DECL_OVERRIDE;
- void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
- void mousePressEvent(QMouseEvent *) Q_DECL_OVERRIDE;
- void mouseReleaseEvent(QMouseEvent *) Q_DECL_OVERRIDE;
- void mouseDoubleClickEvent(QMouseEvent *) Q_DECL_OVERRIDE;
- void mouseMoveEvent(QMouseEvent *) Q_DECL_OVERRIDE;
+ void resizeEvent(QResizeEvent *) override;
+ void paintEvent(QPaintEvent *) override;
+ void mousePressEvent(QMouseEvent *) override;
+ void mouseReleaseEvent(QMouseEvent *) override;
+ void mouseDoubleClickEvent(QMouseEvent *) override;
+ void mouseMoveEvent(QMouseEvent *) override;
#if QT_CONFIG(wheelevent)
- void wheelEvent(QWheelEvent *) Q_DECL_OVERRIDE;
+ void wheelEvent(QWheelEvent *) override;
#endif
#ifndef QT_NO_CONTEXTMENU
- void contextMenuEvent(QContextMenuEvent *) Q_DECL_OVERRIDE;
+ void contextMenuEvent(QContextMenuEvent *) override;
#endif
#ifndef QT_NO_DRAGANDDROP
- void dragEnterEvent(QDragEnterEvent *) Q_DECL_OVERRIDE;
- void dragMoveEvent(QDragMoveEvent *) Q_DECL_OVERRIDE;
- void dragLeaveEvent(QDragLeaveEvent *) Q_DECL_OVERRIDE;
- void dropEvent(QDropEvent *) Q_DECL_OVERRIDE;
+ void dragEnterEvent(QDragEnterEvent *) override;
+ void dragMoveEvent(QDragMoveEvent *) override;
+ void dragLeaveEvent(QDragLeaveEvent *) override;
+ void dropEvent(QDropEvent *) override;
#endif
- void keyPressEvent(QKeyEvent *) Q_DECL_OVERRIDE;
+ void keyPressEvent(QKeyEvent *) override;
virtual void scrollContentsBy(int dx, int dy);
diff --git a/src/widgets/widgets/qabstractscrollarea_p.h b/src/widgets/widgets/qabstractscrollarea_p.h
index c52e7f9fd4..251e563724 100644
--- a/src/widgets/widgets/qabstractscrollarea_p.h
+++ b/src/widgets/widgets/qabstractscrollarea_p.h
@@ -124,7 +124,7 @@ class QAbstractScrollAreaFilter : public QObject
public:
QAbstractScrollAreaFilter(QAbstractScrollAreaPrivate *p) : d(p)
{ setObjectName(QLatin1String("qt_abstractscrollarea_filter")); }
- bool eventFilter(QObject *o, QEvent *e) Q_DECL_OVERRIDE
+ bool eventFilter(QObject *o, QEvent *e) override
{ return (o == d->viewport ? d->viewportEvent(e) : false); }
private:
QAbstractScrollAreaPrivate *d;
diff --git a/src/widgets/widgets/qabstractslider.h b/src/widgets/widgets/qabstractslider.h
index d26d6a879c..7791d30d10 100644
--- a/src/widgets/widgets/qabstractslider.h
+++ b/src/widgets/widgets/qabstractslider.h
@@ -67,7 +67,7 @@ class Q_WIDGETS_EXPORT QAbstractSlider : public QWidget
Q_PROPERTY(bool sliderDown READ isSliderDown WRITE setSliderDown DESIGNABLE false)
public:
- explicit QAbstractSlider(QWidget *parent = Q_NULLPTR);
+ explicit QAbstractSlider(QWidget *parent = nullptr);
~QAbstractSlider();
Qt::Orientation orientation() const;
@@ -131,7 +131,7 @@ Q_SIGNALS:
void actionTriggered(int action);
protected:
- bool event(QEvent *e) Q_DECL_OVERRIDE;
+ bool event(QEvent *e) override;
void setRepeatAction(SliderAction action, int thresholdTime = 500, int repeatTime = 50);
SliderAction repeatAction() const;
@@ -144,16 +144,16 @@ protected:
};
virtual void sliderChange(SliderChange change);
- void keyPressEvent(QKeyEvent *ev) Q_DECL_OVERRIDE;
- void timerEvent(QTimerEvent *) Q_DECL_OVERRIDE;
+ void keyPressEvent(QKeyEvent *ev) override;
+ void timerEvent(QTimerEvent *) override;
#if QT_CONFIG(wheelevent)
- void wheelEvent(QWheelEvent *e) Q_DECL_OVERRIDE;
+ void wheelEvent(QWheelEvent *e) override;
#endif
- void changeEvent(QEvent *e) Q_DECL_OVERRIDE;
+ void changeEvent(QEvent *e) override;
protected:
- QAbstractSlider(QAbstractSliderPrivate &dd, QWidget *parent = Q_NULLPTR);
+ QAbstractSlider(QAbstractSliderPrivate &dd, QWidget *parent = nullptr);
private:
Q_DISABLE_COPY(QAbstractSlider)
diff --git a/src/widgets/widgets/qabstractspinbox.h b/src/widgets/widgets/qabstractspinbox.h
index 88735baf1c..83bf83d779 100644
--- a/src/widgets/widgets/qabstractspinbox.h
+++ b/src/widgets/widgets/qabstractspinbox.h
@@ -70,7 +70,7 @@ class Q_WIDGETS_EXPORT QAbstractSpinBox : public QWidget
Q_PROPERTY(bool keyboardTracking READ keyboardTracking WRITE setKeyboardTracking)
Q_PROPERTY(bool showGroupSeparator READ isGroupSeparatorShown WRITE setGroupSeparatorShown)
public:
- explicit QAbstractSpinBox(QWidget *parent = Q_NULLPTR);
+ explicit QAbstractSpinBox(QWidget *parent = nullptr);
~QAbstractSpinBox();
enum StepEnabledFlag { StepNone = 0x00, StepUpEnabled = 0x01,
@@ -162,7 +162,7 @@ protected:
Q_SIGNALS:
void editingFinished();
protected:
- QAbstractSpinBox(QAbstractSpinBoxPrivate &dd, QWidget *parent = Q_NULLPTR);
+ QAbstractSpinBox(QAbstractSpinBoxPrivate &dd, QWidget *parent = nullptr);
private:
Q_PRIVATE_SLOT(d_func(), void _q_editorTextChanged(const QString &))
diff --git a/src/widgets/widgets/qbuttongroup.h b/src/widgets/widgets/qbuttongroup.h
index 1b4f2377ae..fec94ccb3e 100644
--- a/src/widgets/widgets/qbuttongroup.h
+++ b/src/widgets/widgets/qbuttongroup.h
@@ -57,7 +57,7 @@ class Q_WIDGETS_EXPORT QButtonGroup : public QObject
Q_PROPERTY(bool exclusive READ exclusive WRITE setExclusive)
public:
- explicit QButtonGroup(QObject *parent = Q_NULLPTR);
+ explicit QButtonGroup(QObject *parent = nullptr);
~QButtonGroup();
void setExclusive(bool);
diff --git a/src/widgets/widgets/qcalendarwidget.cpp b/src/widgets/widgets/qcalendarwidget.cpp
index 94911d1cb1..d496d86906 100644
--- a/src/widgets/widgets/qcalendarwidget.cpp
+++ b/src/widgets/widgets/qcalendarwidget.cpp
@@ -115,11 +115,11 @@ class QCalendarDayValidator : public QCalendarDateSectionValidator
public:
QCalendarDayValidator();
- virtual Section handleKey(int key) Q_DECL_OVERRIDE;
- virtual QDate applyToDate(const QDate &date) const Q_DECL_OVERRIDE;
- virtual void setDate(const QDate &date) Q_DECL_OVERRIDE;
- virtual QString text() const Q_DECL_OVERRIDE;
- virtual QString text(const QDate &date, int repeat) const Q_DECL_OVERRIDE;
+ virtual Section handleKey(int key) override;
+ virtual QDate applyToDate(const QDate &date) const override;
+ virtual void setDate(const QDate &date) override;
+ virtual QString text() const override;
+ virtual QString text(const QDate &date, int repeat) const override;
private:
int m_pos;
int m_day;
@@ -223,11 +223,11 @@ class QCalendarMonthValidator : public QCalendarDateSectionValidator
public:
QCalendarMonthValidator();
- virtual Section handleKey(int key) Q_DECL_OVERRIDE;
- virtual QDate applyToDate(const QDate &date) const Q_DECL_OVERRIDE;
- virtual void setDate(const QDate &date) Q_DECL_OVERRIDE;
- virtual QString text() const Q_DECL_OVERRIDE;
- virtual QString text(const QDate &date, int repeat) const Q_DECL_OVERRIDE;
+ virtual Section handleKey(int key) override;
+ virtual QDate applyToDate(const QDate &date) const override;
+ virtual void setDate(const QDate &date) override;
+ virtual QString text() const override;
+ virtual QString text(const QDate &date, int repeat) const override;
private:
int m_pos;
int m_month;
@@ -333,11 +333,11 @@ class QCalendarYearValidator : public QCalendarDateSectionValidator
public:
QCalendarYearValidator();
- virtual Section handleKey(int key) Q_DECL_OVERRIDE;
- virtual QDate applyToDate(const QDate &date) const Q_DECL_OVERRIDE;
- virtual void setDate(const QDate &date) Q_DECL_OVERRIDE;
- virtual QString text() const Q_DECL_OVERRIDE;
- virtual QString text(const QDate &date, int repeat) const Q_DECL_OVERRIDE;
+ virtual Section handleKey(int key) override;
+ virtual QDate applyToDate(const QDate &date) const override;
+ virtual void setDate(const QDate &date) override;
+ virtual QString text() const override;
+ virtual QString text(const QDate &date, int repeat) const override;
private:
int pow10(int n);
int m_pos;
@@ -654,8 +654,8 @@ public:
void setDate(const QDate &date);
- bool eventFilter(QObject *o, QEvent *e) Q_DECL_OVERRIDE;
- void timerEvent(QTimerEvent *e) Q_DECL_OVERRIDE;
+ bool eventFilter(QObject *o, QEvent *e) override;
+ void timerEvent(QTimerEvent *e) override;
signals:
void dateChanged(const QDate &date);
@@ -861,32 +861,32 @@ class QCalendarModel : public QAbstractTableModel
public:
QCalendarModel(QObject *parent = 0);
- int rowCount(const QModelIndex &) const Q_DECL_OVERRIDE
+ int rowCount(const QModelIndex &) const override
{ return RowCount + m_firstRow; }
- int columnCount(const QModelIndex &) const Q_DECL_OVERRIDE
+ int columnCount(const QModelIndex &) const override
{ return ColumnCount + m_firstColumn; }
- QVariant data(const QModelIndex &index, int role) const Q_DECL_OVERRIDE;
- Qt::ItemFlags flags(const QModelIndex &index) const Q_DECL_OVERRIDE;
+ QVariant data(const QModelIndex &index, int role) const override;
+ Qt::ItemFlags flags(const QModelIndex &index) const override;
- bool insertRows(int row, int count, const QModelIndex &parent = QModelIndex()) Q_DECL_OVERRIDE
+ bool insertRows(int row, int count, const QModelIndex &parent = QModelIndex()) override
{
beginInsertRows(parent, row, row + count - 1);
endInsertRows();
return true;
}
- bool insertColumns(int column, int count, const QModelIndex &parent = QModelIndex()) Q_DECL_OVERRIDE
+ bool insertColumns(int column, int count, const QModelIndex &parent = QModelIndex()) override
{
beginInsertColumns(parent, column, column + count - 1);
endInsertColumns();
return true;
}
- bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()) Q_DECL_OVERRIDE
+ bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()) override
{
beginRemoveRows(parent, row, row + count - 1);
endRemoveRows();
return true;
}
- bool removeColumns(int column, int count, const QModelIndex &parent = QModelIndex()) Q_DECL_OVERRIDE
+ bool removeColumns(int column, int count, const QModelIndex &parent = QModelIndex()) override
{
beginRemoveColumns(parent, column, column + count - 1);
endRemoveColumns();
@@ -947,7 +947,7 @@ public:
void internalUpdate() { updateGeometries(); }
void setReadOnly(bool enable);
- virtual void keyboardSearch(const QString & search) Q_DECL_OVERRIDE { Q_UNUSED(search) }
+ virtual void keyboardSearch(const QString & search) override { Q_UNUSED(search) }
signals:
void showDate(const QDate &date);
@@ -955,16 +955,16 @@ signals:
void clicked(const QDate &date);
void editingFinished();
protected:
- QModelIndex moveCursor(CursorAction cursorAction, Qt::KeyboardModifiers modifiers) Q_DECL_OVERRIDE;
- void mouseDoubleClickEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
- void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
- void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
- void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
+ QModelIndex moveCursor(CursorAction cursorAction, Qt::KeyboardModifiers modifiers) override;
+ void mouseDoubleClickEvent(QMouseEvent *event) override;
+ void mousePressEvent(QMouseEvent *event) override;
+ void mouseMoveEvent(QMouseEvent *event) override;
+ void mouseReleaseEvent(QMouseEvent *event) override;
#if QT_CONFIG(wheelevent)
- void wheelEvent(QWheelEvent *event) Q_DECL_OVERRIDE;
+ void wheelEvent(QWheelEvent *event) override;
#endif
- void keyPressEvent(QKeyEvent *event) Q_DECL_OVERRIDE;
- bool event(QEvent *event) Q_DECL_OVERRIDE;
+ void keyPressEvent(QKeyEvent *event) override;
+ bool event(QEvent *event) override;
QDate handleMouseEvent(QMouseEvent *event);
public:
@@ -988,7 +988,7 @@ QCalendarModel::QCalendarModel(QObject *parent)
m_firstDay(QLocale().firstDayOfWeek()),
m_horizontalHeaderFormat(QCalendarWidget::ShortDayNames),
m_weekNumbersShown(true),
- m_view(Q_NULLPTR)
+ m_view(nullptr)
{
}
@@ -1563,7 +1563,7 @@ public:
: QItemDelegate(parent), calendarWidgetPrivate(w)
{ }
virtual void paint(QPainter *painter, const QStyleOptionViewItem &option,
- const QModelIndex &index) const Q_DECL_OVERRIDE;
+ const QModelIndex &index) const override;
void paintCell(QPainter *painter, const QRect &rect, const QDate &date) const;
private:
@@ -1579,7 +1579,7 @@ public:
: QToolButton(parent)
{ }
protected:
- void paintEvent(QPaintEvent *e) Q_DECL_OVERRIDE
+ void paintEvent(QPaintEvent *e) override
{
Q_UNUSED(e)
@@ -1607,7 +1607,7 @@ class QPrevNextCalButton : public QToolButton
public:
QPrevNextCalButton(QWidget *parent) : QToolButton(parent) {}
protected:
- void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE {
+ void paintEvent(QPaintEvent *) override {
QStylePainter painter(this);
QStyleOptionToolButton opt;
initStyleOption(&opt);
diff --git a/src/widgets/widgets/qcalendarwidget.h b/src/widgets/widgets/qcalendarwidget.h
index 29e2ff698b..44ba340289 100644
--- a/src/widgets/widgets/qcalendarwidget.h
+++ b/src/widgets/widgets/qcalendarwidget.h
@@ -89,11 +89,11 @@ public:
};
Q_ENUM(SelectionMode)
- explicit QCalendarWidget(QWidget *parent = Q_NULLPTR);
+ explicit QCalendarWidget(QWidget *parent = nullptr);
~QCalendarWidget();
- virtual QSize sizeHint() const Q_DECL_OVERRIDE;
- virtual QSize minimumSizeHint() const Q_DECL_OVERRIDE;
+ virtual QSize sizeHint() const override;
+ virtual QSize minimumSizeHint() const override;
QDate selectedDate() const;
@@ -138,11 +138,11 @@ public:
void setDateEditAcceptDelay(int delay);
protected:
- bool event(QEvent *event) Q_DECL_OVERRIDE;
- bool eventFilter(QObject *watched, QEvent *event) Q_DECL_OVERRIDE;
- void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
- void resizeEvent(QResizeEvent * event) Q_DECL_OVERRIDE;
- void keyPressEvent(QKeyEvent * event) Q_DECL_OVERRIDE;
+ bool event(QEvent *event) override;
+ bool eventFilter(QObject *watched, QEvent *event) override;
+ void mousePressEvent(QMouseEvent *event) override;
+ void resizeEvent(QResizeEvent * event) override;
+ void keyPressEvent(QKeyEvent * event) override;
virtual void paintCell(QPainter *painter, const QRect &rect, const QDate &date) const;
void updateCell(const QDate &date);
diff --git a/src/widgets/widgets/qcheckbox.cpp b/src/widgets/widgets/qcheckbox.cpp
index 9b49916774..235508535d 100644
--- a/src/widgets/widgets/qcheckbox.cpp
+++ b/src/widgets/widgets/qcheckbox.cpp
@@ -45,6 +45,9 @@
#include "qstyle.h"
#include "qstyleoption.h"
#include "qevent.h"
+#ifndef QT_NO_ACCESSIBILITY
+#include "qaccessible.h"
+#endif
#include "private/qabstractbutton_p.h"
@@ -243,6 +246,9 @@ Qt::CheckState QCheckBox::checkState() const
void QCheckBox::setCheckState(Qt::CheckState state)
{
Q_D(QCheckBox);
+#ifndef QT_NO_ACCESSIBILITY
+ bool noChange = d->noChange;
+#endif
if (state == Qt::PartiallyChecked) {
d->tristate = true;
d->noChange = true;
@@ -257,6 +263,15 @@ void QCheckBox::setCheckState(Qt::CheckState state)
d->publishedState = state;
emit stateChanged(state);
}
+
+#ifndef QT_NO_ACCESSIBILITY
+ if (noChange != d->noChange) {
+ QAccessible::State s;
+ s.checkStateMixed = true;
+ QAccessibleStateChangeEvent event(this, s);
+ QAccessible::updateAccessibility(&event);
+ }
+#endif
}
diff --git a/src/widgets/widgets/qcheckbox.h b/src/widgets/widgets/qcheckbox.h
index 8543c4c86f..80cb22b82e 100644
--- a/src/widgets/widgets/qcheckbox.h
+++ b/src/widgets/widgets/qcheckbox.h
@@ -58,12 +58,12 @@ class Q_WIDGETS_EXPORT QCheckBox : public QAbstractButton
Q_PROPERTY(bool tristate READ isTristate WRITE setTristate)
public:
- explicit QCheckBox(QWidget *parent = Q_NULLPTR);
- explicit QCheckBox(const QString &text, QWidget *parent = Q_NULLPTR);
+ explicit QCheckBox(QWidget *parent = nullptr);
+ explicit QCheckBox(const QString &text, QWidget *parent = nullptr);
~QCheckBox();
- QSize sizeHint() const Q_DECL_OVERRIDE;
- QSize minimumSizeHint() const Q_DECL_OVERRIDE;
+ QSize sizeHint() const override;
+ QSize minimumSizeHint() const override;
void setTristate(bool y = true);
bool isTristate() const;
@@ -75,12 +75,12 @@ Q_SIGNALS:
void stateChanged(int);
protected:
- bool event(QEvent *e) Q_DECL_OVERRIDE;
- bool hitButton(const QPoint &pos) const Q_DECL_OVERRIDE;
- void checkStateSet() Q_DECL_OVERRIDE;
- void nextCheckState() Q_DECL_OVERRIDE;
- void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
- void mouseMoveEvent(QMouseEvent *) Q_DECL_OVERRIDE;
+ bool event(QEvent *e) override;
+ bool hitButton(const QPoint &pos) const override;
+ void checkStateSet() override;
+ void nextCheckState() override;
+ void paintEvent(QPaintEvent *) override;
+ void mouseMoveEvent(QMouseEvent *) override;
void initStyleOption(QStyleOptionButton *option) const;
diff --git a/src/widgets/widgets/qcombobox.h b/src/widgets/widgets/qcombobox.h
index 59f2a425a0..671c883584 100644
--- a/src/widgets/widgets/qcombobox.h
+++ b/src/widgets/widgets/qcombobox.h
@@ -82,7 +82,7 @@ class Q_WIDGETS_EXPORT QComboBox : public QWidget
Q_PROPERTY(int modelColumn READ modelColumn WRITE setModelColumn)
public:
- explicit QComboBox(QWidget *parent = Q_NULLPTR);
+ explicit QComboBox(QWidget *parent = nullptr);
~QComboBox();
int maxVisibleItems() const;
@@ -196,14 +196,14 @@ public:
QAbstractItemView *view() const;
void setView(QAbstractItemView *itemView);
- QSize sizeHint() const Q_DECL_OVERRIDE;
- QSize minimumSizeHint() const Q_DECL_OVERRIDE;
+ QSize sizeHint() const override;
+ QSize minimumSizeHint() const override;
virtual void showPopup();
virtual void hidePopup();
- bool event(QEvent *event) Q_DECL_OVERRIDE;
- QVariant inputMethodQuery(Qt::InputMethodQuery) const Q_DECL_OVERRIDE;
+ bool event(QEvent *event) override;
+ QVariant inputMethodQuery(Qt::InputMethodQuery) const override;
Q_INVOKABLE QVariant inputMethodQuery(Qt::InputMethodQuery query, const QVariant &argument) const;
public Q_SLOTS:
@@ -224,24 +224,24 @@ Q_SIGNALS:
void currentTextChanged(const QString &);
protected:
- void focusInEvent(QFocusEvent *e) Q_DECL_OVERRIDE;
- void focusOutEvent(QFocusEvent *e) Q_DECL_OVERRIDE;
- void changeEvent(QEvent *e) Q_DECL_OVERRIDE;
- void resizeEvent(QResizeEvent *e) Q_DECL_OVERRIDE;
- void paintEvent(QPaintEvent *e) Q_DECL_OVERRIDE;
- void showEvent(QShowEvent *e) Q_DECL_OVERRIDE;
- void hideEvent(QHideEvent *e) Q_DECL_OVERRIDE;
- void mousePressEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
- void mouseReleaseEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
- void keyPressEvent(QKeyEvent *e) Q_DECL_OVERRIDE;
- void keyReleaseEvent(QKeyEvent *e) Q_DECL_OVERRIDE;
+ void focusInEvent(QFocusEvent *e) override;
+ void focusOutEvent(QFocusEvent *e) override;
+ void changeEvent(QEvent *e) override;
+ void resizeEvent(QResizeEvent *e) override;
+ void paintEvent(QPaintEvent *e) override;
+ void showEvent(QShowEvent *e) override;
+ void hideEvent(QHideEvent *e) override;
+ void mousePressEvent(QMouseEvent *e) override;
+ void mouseReleaseEvent(QMouseEvent *e) override;
+ void keyPressEvent(QKeyEvent *e) override;
+ void keyReleaseEvent(QKeyEvent *e) override;
#if QT_CONFIG(wheelevent)
- void wheelEvent(QWheelEvent *e) Q_DECL_OVERRIDE;
+ void wheelEvent(QWheelEvent *e) override;
#endif
#ifndef QT_NO_CONTEXTMENU
- void contextMenuEvent(QContextMenuEvent *e) Q_DECL_OVERRIDE;
+ void contextMenuEvent(QContextMenuEvent *e) override;
#endif // QT_NO_CONTEXTMENU
- void inputMethodEvent(QInputMethodEvent *) Q_DECL_OVERRIDE;
+ void inputMethodEvent(QInputMethodEvent *) override;
void initStyleOption(QStyleOptionComboBox *option) const;
diff --git a/src/widgets/widgets/qcommandlinkbutton.h b/src/widgets/widgets/qcommandlinkbutton.h
index d8215a256e..2d01d63df8 100644
--- a/src/widgets/widgets/qcommandlinkbutton.h
+++ b/src/widgets/widgets/qcommandlinkbutton.h
@@ -58,20 +58,20 @@ class Q_WIDGETS_EXPORT QCommandLinkButton: public QPushButton
Q_PROPERTY(bool flat READ isFlat WRITE setFlat DESIGNABLE false)
public:
- explicit QCommandLinkButton(QWidget *parent = Q_NULLPTR);
- explicit QCommandLinkButton(const QString &text, QWidget *parent = Q_NULLPTR);
- explicit QCommandLinkButton(const QString &text, const QString &description, QWidget *parent = Q_NULLPTR);
+ explicit QCommandLinkButton(QWidget *parent = nullptr);
+ explicit QCommandLinkButton(const QString &text, QWidget *parent = nullptr);
+ explicit QCommandLinkButton(const QString &text, const QString &description, QWidget *parent = nullptr);
~QCommandLinkButton();
QString description() const;
void setDescription(const QString &description);
protected:
- QSize sizeHint() const Q_DECL_OVERRIDE;
- int heightForWidth(int) const Q_DECL_OVERRIDE;
- QSize minimumSizeHint() const Q_DECL_OVERRIDE;
- bool event(QEvent *e) Q_DECL_OVERRIDE;
- void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
+ QSize sizeHint() const override;
+ int heightForWidth(int) const override;
+ QSize minimumSizeHint() const override;
+ bool event(QEvent *e) override;
+ void paintEvent(QPaintEvent *) override;
private:
Q_DISABLE_COPY(QCommandLinkButton)
diff --git a/src/widgets/widgets/qdatetimeedit.h b/src/widgets/widgets/qdatetimeedit.h
index b46434c1a4..b6fb35fc71 100644
--- a/src/widgets/widgets/qdatetimeedit.h
+++ b/src/widgets/widgets/qdatetimeedit.h
@@ -92,10 +92,10 @@ public:
Q_DECLARE_FLAGS(Sections, Section)
Q_FLAG(Sections)
- explicit QDateTimeEdit(QWidget *parent = Q_NULLPTR);
- explicit QDateTimeEdit(const QDateTime &dt, QWidget *parent = Q_NULLPTR);
- explicit QDateTimeEdit(const QDate &d, QWidget *parent = Q_NULLPTR);
- explicit QDateTimeEdit(const QTime &t, QWidget *parent = Q_NULLPTR);
+ explicit QDateTimeEdit(QWidget *parent = nullptr);
+ explicit QDateTimeEdit(const QDateTime &dt, QWidget *parent = nullptr);
+ explicit QDateTimeEdit(const QDate &d, QWidget *parent = nullptr);
+ explicit QDateTimeEdit(const QTime &t, QWidget *parent = nullptr);
~QDateTimeEdit();
QDateTime dateTime() const;
@@ -191,7 +191,7 @@ protected:
void paintEvent(QPaintEvent *event) override;
void initStyleOption(QStyleOptionSpinBox *option) const;
- QDateTimeEdit(const QVariant &val, QVariant::Type parserType, QWidget *parent = Q_NULLPTR);
+ QDateTimeEdit(const QVariant &val, QVariant::Type parserType, QWidget *parent = nullptr);
private:
Q_DECLARE_PRIVATE(QDateTimeEdit)
Q_DISABLE_COPY(QDateTimeEdit)
@@ -204,8 +204,8 @@ class Q_WIDGETS_EXPORT QTimeEdit : public QDateTimeEdit
Q_OBJECT
Q_PROPERTY(QTime time READ time WRITE setTime NOTIFY userTimeChanged USER true)
public:
- explicit QTimeEdit(QWidget *parent = Q_NULLPTR);
- explicit QTimeEdit(const QTime &time, QWidget *parent = Q_NULLPTR);
+ explicit QTimeEdit(QWidget *parent = nullptr);
+ explicit QTimeEdit(const QTime &time, QWidget *parent = nullptr);
~QTimeEdit();
Q_SIGNALS:
@@ -217,8 +217,8 @@ class Q_WIDGETS_EXPORT QDateEdit : public QDateTimeEdit
Q_OBJECT
Q_PROPERTY(QDate date READ date WRITE setDate NOTIFY userDateChanged USER true)
public:
- explicit QDateEdit(QWidget *parent = Q_NULLPTR);
- explicit QDateEdit(const QDate &date, QWidget *parent = Q_NULLPTR);
+ explicit QDateEdit(QWidget *parent = nullptr);
+ explicit QDateEdit(const QDate &date, QWidget *parent = nullptr);
~QDateEdit();
Q_SIGNALS:
diff --git a/src/widgets/widgets/qdatetimeedit_p.h b/src/widgets/widgets/qdatetimeedit_p.h
index 5ac5a9db6a..1ebc98dedf 100644
--- a/src/widgets/widgets/qdatetimeedit_p.h
+++ b/src/widgets/widgets/qdatetimeedit_p.h
@@ -80,25 +80,25 @@ public:
void clearSection(int index);
// Override QAbstractSpinBoxPrivate:
- void emitSignals(EmitPolicy ep, const QVariant &old) Q_DECL_OVERRIDE;
- QString textFromValue(const QVariant &f) const Q_DECL_OVERRIDE;
- QVariant valueFromText(const QString &f) const Q_DECL_OVERRIDE;
- void _q_editorCursorPositionChanged(int oldpos, int newpos) Q_DECL_OVERRIDE;
- void interpret(EmitPolicy ep) Q_DECL_OVERRIDE;
- void clearCache() const Q_DECL_OVERRIDE;
- QStyle::SubControl newHoverControl(const QPoint &pos) Q_DECL_OVERRIDE;
- void updateEditFieldGeometry() Q_DECL_OVERRIDE;
- QVariant getZeroVariant() const Q_DECL_OVERRIDE;
- void setRange(const QVariant &min, const QVariant &max) Q_DECL_OVERRIDE;
- void updateEdit() Q_DECL_OVERRIDE;
+ void emitSignals(EmitPolicy ep, const QVariant &old) override;
+ QString textFromValue(const QVariant &f) const override;
+ QVariant valueFromText(const QString &f) const override;
+ void _q_editorCursorPositionChanged(int oldpos, int newpos) override;
+ void interpret(EmitPolicy ep) override;
+ void clearCache() const override;
+ QStyle::SubControl newHoverControl(const QPoint &pos) override;
+ void updateEditFieldGeometry() override;
+ QVariant getZeroVariant() const override;
+ void setRange(const QVariant &min, const QVariant &max) override;
+ void updateEdit() override;
// Override QDateTimeParser:
- QString displayText() const Q_DECL_OVERRIDE { return edit->text(); }
- QDateTime getMinimum() const Q_DECL_OVERRIDE { return minimum.toDateTime(); }
- QDateTime getMaximum() const Q_DECL_OVERRIDE { return maximum.toDateTime(); }
- QLocale locale() const Q_DECL_OVERRIDE { return q_func()->locale(); }
- QString getAmPmText(AmPm ap, Case cs) const Q_DECL_OVERRIDE;
- int cursorPosition() const Q_DECL_OVERRIDE { return edit ? edit->cursorPosition() : -1; }
+ QString displayText() const override { return edit->text(); }
+ QDateTime getMinimum() const override { return minimum.toDateTime(); }
+ QDateTime getMaximum() const override { return maximum.toDateTime(); }
+ QLocale locale() const override { return q_func()->locale(); }
+ QString getAmPmText(AmPm ap, Case cs) const override;
+ int cursorPosition() const override { return edit ? edit->cursorPosition() : -1; }
int absoluteIndex(QDateTimeEdit::Section s, int index) const;
int absoluteIndex(const SectionNode &s) const;
diff --git a/src/widgets/widgets/qdial.cpp b/src/widgets/widgets/qdial.cpp
index c08c820127..25d57970bf 100644
--- a/src/widgets/widgets/qdial.cpp
+++ b/src/widgets/widgets/qdial.cpp
@@ -79,7 +79,7 @@ public:
int valueFromPoint(const QPoint &) const;
double angle(const QPoint &, const QPoint &) const;
void init();
- virtual int bound(int val) const Q_DECL_OVERRIDE;
+ virtual int bound(int val) const override;
};
void QDialPrivate::init()
diff --git a/src/widgets/widgets/qdial.h b/src/widgets/widgets/qdial.h
index ed753d86b0..1db1f9bb07 100644
--- a/src/widgets/widgets/qdial.h
+++ b/src/widgets/widgets/qdial.h
@@ -61,7 +61,7 @@ class Q_WIDGETS_EXPORT QDial: public QAbstractSlider
Q_PROPERTY(qreal notchTarget READ notchTarget WRITE setNotchTarget)
Q_PROPERTY(bool notchesVisible READ notchesVisible WRITE setNotchesVisible)
public:
- explicit QDial(QWidget *parent = Q_NULLPTR);
+ explicit QDial(QWidget *parent = nullptr);
~QDial();
@@ -73,23 +73,23 @@ public:
qreal notchTarget() const;
bool notchesVisible() const;
- QSize sizeHint() const Q_DECL_OVERRIDE;
- QSize minimumSizeHint() const Q_DECL_OVERRIDE;
+ QSize sizeHint() const override;
+ QSize minimumSizeHint() const override;
public Q_SLOTS:
void setNotchesVisible(bool visible);
void setWrapping(bool on);
protected:
- bool event(QEvent *e) Q_DECL_OVERRIDE;
- void resizeEvent(QResizeEvent *re) Q_DECL_OVERRIDE;
- void paintEvent(QPaintEvent *pe) Q_DECL_OVERRIDE;
+ bool event(QEvent *e) override;
+ void resizeEvent(QResizeEvent *re) override;
+ void paintEvent(QPaintEvent *pe) override;
- void mousePressEvent(QMouseEvent *me) Q_DECL_OVERRIDE;
- void mouseReleaseEvent(QMouseEvent *me) Q_DECL_OVERRIDE;
- void mouseMoveEvent(QMouseEvent *me) Q_DECL_OVERRIDE;
+ void mousePressEvent(QMouseEvent *me) override;
+ void mouseReleaseEvent(QMouseEvent *me) override;
+ void mouseMoveEvent(QMouseEvent *me) override;
- void sliderChange(SliderChange change) Q_DECL_OVERRIDE;
+ void sliderChange(SliderChange change) override;
void initStyleOption(QStyleOptionSlider *option) const;
diff --git a/src/widgets/widgets/qdialogbuttonbox.h b/src/widgets/widgets/qdialogbuttonbox.h
index 02d14dee7c..a9a1a3453d 100644
--- a/src/widgets/widgets/qdialogbuttonbox.h
+++ b/src/widgets/widgets/qdialogbuttonbox.h
@@ -117,11 +117,11 @@ public:
AndroidLayout = GnomeLayout + 2 // ### Qt 6: reorder
};
- QDialogButtonBox(QWidget *parent = Q_NULLPTR);
- QDialogButtonBox(Qt::Orientation orientation, QWidget *parent = Q_NULLPTR);
- explicit QDialogButtonBox(StandardButtons buttons, QWidget *parent = Q_NULLPTR);
+ QDialogButtonBox(QWidget *parent = nullptr);
+ QDialogButtonBox(Qt::Orientation orientation, QWidget *parent = nullptr);
+ explicit QDialogButtonBox(StandardButtons buttons, QWidget *parent = nullptr);
QDialogButtonBox(StandardButtons buttons, Qt::Orientation orientation,
- QWidget *parent = Q_NULLPTR);
+ QWidget *parent = nullptr);
~QDialogButtonBox();
void setOrientation(Qt::Orientation orientation);
@@ -151,8 +151,8 @@ Q_SIGNALS:
void rejected();
protected:
- void changeEvent(QEvent *event) Q_DECL_OVERRIDE;
- bool event(QEvent *event) Q_DECL_OVERRIDE;
+ void changeEvent(QEvent *event) override;
+ bool event(QEvent *event) override;
private:
Q_DISABLE_COPY(QDialogButtonBox)
diff --git a/src/widgets/widgets/qdockwidget.cpp b/src/widgets/widgets/qdockwidget.cpp
index bfb3a98d7e..26060052d3 100644
--- a/src/widgets/widgets/qdockwidget.cpp
+++ b/src/widgets/widgets/qdockwidget.cpp
@@ -73,7 +73,7 @@ static inline QMainWindowLayout *qt_mainwindow_layout_from_dock(const QDockWidge
return qt_mainwindow_layout(window);
p = p->parentWidget();
}
- return Q_NULLPTR;
+ return nullptr;
}
static inline bool hasFeature(const QDockWidgetPrivate *priv, QDockWidget::DockWidgetFeature feature)
@@ -120,13 +120,13 @@ class QDockWidgetTitleButton : public QAbstractButton
public:
QDockWidgetTitleButton(QDockWidget *dockWidget);
- QSize sizeHint() const Q_DECL_OVERRIDE;
- QSize minimumSizeHint() const Q_DECL_OVERRIDE
+ QSize sizeHint() const override;
+ QSize minimumSizeHint() const override
{ return sizeHint(); }
- void enterEvent(QEvent *event) Q_DECL_OVERRIDE;
- void leaveEvent(QEvent *event) Q_DECL_OVERRIDE;
- void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
+ void enterEvent(QEvent *event) override;
+ void leaveEvent(QEvent *event) override;
+ void paintEvent(QPaintEvent *event) override;
};
diff --git a/src/widgets/widgets/qdockwidget.h b/src/widgets/widgets/qdockwidget.h
index b53fa19a03..b53a991dae 100644
--- a/src/widgets/widgets/qdockwidget.h
+++ b/src/widgets/widgets/qdockwidget.h
@@ -63,9 +63,9 @@ class Q_WIDGETS_EXPORT QDockWidget : public QWidget
Q_PROPERTY(QString windowTitle READ windowTitle WRITE setWindowTitle DESIGNABLE true)
public:
- explicit QDockWidget(const QString &title, QWidget *parent = Q_NULLPTR,
+ explicit QDockWidget(const QString &title, QWidget *parent = nullptr,
Qt::WindowFlags flags = Qt::WindowFlags());
- explicit QDockWidget(QWidget *parent = Q_NULLPTR, Qt::WindowFlags flags = Qt::WindowFlags());
+ explicit QDockWidget(QWidget *parent = nullptr, Qt::WindowFlags flags = Qt::WindowFlags());
~QDockWidget();
QWidget *widget() const;
@@ -113,10 +113,10 @@ Q_SIGNALS:
void dockLocationChanged(Qt::DockWidgetArea area);
protected:
- void changeEvent(QEvent *event) Q_DECL_OVERRIDE;
- void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE;
- void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
- bool event(QEvent *event) Q_DECL_OVERRIDE;
+ void changeEvent(QEvent *event) override;
+ void closeEvent(QCloseEvent *event) override;
+ void paintEvent(QPaintEvent *event) override;
+ bool event(QEvent *event) override;
void initStyleOption(QStyleOptionDockWidget *option) const;
private:
diff --git a/src/widgets/widgets/qdockwidget_p.h b/src/widgets/widgets/qdockwidget_p.h
index 2c16176c37..e35fd17fc2 100644
--- a/src/widgets/widgets/qdockwidget_p.h
+++ b/src/widgets/widgets/qdockwidget_p.h
@@ -135,18 +135,18 @@ class Q_WIDGETS_EXPORT QDockWidgetLayout : public QLayout
public:
QDockWidgetLayout(QWidget *parent = 0);
~QDockWidgetLayout();
- void addItem(QLayoutItem *item) Q_DECL_OVERRIDE;
- QLayoutItem *itemAt(int index) const Q_DECL_OVERRIDE;
- QLayoutItem *takeAt(int index) Q_DECL_OVERRIDE;
- int count() const Q_DECL_OVERRIDE;
+ void addItem(QLayoutItem *item) override;
+ QLayoutItem *itemAt(int index) const override;
+ QLayoutItem *takeAt(int index) override;
+ int count() const override;
- QSize maximumSize() const Q_DECL_OVERRIDE;
- QSize minimumSize() const Q_DECL_OVERRIDE;
- QSize sizeHint() const Q_DECL_OVERRIDE;
+ QSize maximumSize() const override;
+ QSize minimumSize() const override;
+ QSize sizeHint() const override;
QSize sizeFromContent(const QSize &content, bool floating) const;
- void setGeometry(const QRect &r) Q_DECL_OVERRIDE;
+ void setGeometry(const QRect &r) override;
enum Role { Content, CloseButton, FloatButton, TitleBar, RoleCount };
QWidget *widgetForRole(Role r) const;
@@ -178,9 +178,9 @@ class QDockWidgetItem : public QWidgetItem
{
public:
QDockWidgetItem(QDockWidget *dockWidget);
- QSize minimumSize() const Q_DECL_OVERRIDE;
- QSize maximumSize() const Q_DECL_OVERRIDE;
- QSize sizeHint() const Q_DECL_OVERRIDE;
+ QSize minimumSize() const override;
+ QSize maximumSize() const override;
+ QSize sizeHint() const override;
private:
inline QLayoutItem *dockWidgetChildItem() const;
diff --git a/src/widgets/widgets/qeffects.cpp b/src/widgets/widgets/qeffects.cpp
index d4ef33966b..bcc8d7815d 100644
--- a/src/widgets/widgets/qeffects.cpp
+++ b/src/widgets/widgets/qeffects.cpp
@@ -71,10 +71,10 @@ public:
void run(int time);
protected:
- void paintEvent(QPaintEvent* e) Q_DECL_OVERRIDE;
- void closeEvent(QCloseEvent*) Q_DECL_OVERRIDE;
+ void paintEvent(QPaintEvent* e) override;
+ void closeEvent(QCloseEvent*) override;
void alphaBlend();
- bool eventFilter(QObject *, QEvent *) Q_DECL_OVERRIDE;
+ bool eventFilter(QObject *, QEvent *) override;
protected slots:
void render();
@@ -98,9 +98,12 @@ static QAlphaWidget* q_blend = 0;
/*
Constructs a QAlphaWidget.
*/
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED // QDesktopWidget::screen()
QAlphaWidget::QAlphaWidget(QWidget* w, Qt::WindowFlags f)
: QWidget(QApplication::desktop()->screen(QDesktopWidgetPrivate::screenNumber(w)), f)
{
+QT_WARNING_POP
#ifndef Q_OS_WIN
setEnabled(false);
#endif
@@ -348,8 +351,8 @@ public:
void run(int time);
protected:
- void paintEvent(QPaintEvent*) Q_DECL_OVERRIDE;
- void closeEvent(QCloseEvent*) Q_DECL_OVERRIDE;
+ void paintEvent(QPaintEvent*) override;
+ void closeEvent(QCloseEvent*) override;
private slots:
void scroll();
diff --git a/src/widgets/widgets/qfocusframe.h b/src/widgets/widgets/qfocusframe.h
index a1fc6d345d..73d5b42bd8 100644
--- a/src/widgets/widgets/qfocusframe.h
+++ b/src/widgets/widgets/qfocusframe.h
@@ -53,17 +53,17 @@ class Q_WIDGETS_EXPORT QFocusFrame : public QWidget
{
Q_OBJECT
public:
- QFocusFrame(QWidget *parent = Q_NULLPTR);
+ QFocusFrame(QWidget *parent = nullptr);
~QFocusFrame();
void setWidget(QWidget *widget);
QWidget *widget() const;
protected:
- bool event(QEvent *e) Q_DECL_OVERRIDE;
+ bool event(QEvent *e) override;
- bool eventFilter(QObject *, QEvent *) Q_DECL_OVERRIDE;
- void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
+ bool eventFilter(QObject *, QEvent *) override;
+ void paintEvent(QPaintEvent *) override;
void initStyleOption(QStyleOption *option) const;
private:
diff --git a/src/widgets/widgets/qfontcombobox.cpp b/src/widgets/widgets/qfontcombobox.cpp
index 1c56c19c8f..49f1223d9c 100644
--- a/src/widgets/widgets/qfontcombobox.cpp
+++ b/src/widgets/widgets/qfontcombobox.cpp
@@ -189,10 +189,10 @@ public:
// painting
void paint(QPainter *painter,
const QStyleOptionViewItem &option,
- const QModelIndex &index) const Q_DECL_OVERRIDE;
+ const QModelIndex &index) const override;
QSize sizeHint(const QStyleOptionViewItem &option,
- const QModelIndex &index) const Q_DECL_OVERRIDE;
+ const QModelIndex &index) const override;
const QIcon truetype;
const QIcon bitmap;
diff --git a/src/widgets/widgets/qfontcombobox.h b/src/widgets/widgets/qfontcombobox.h
index 1e4555ce2d..6c1871dd2d 100644
--- a/src/widgets/widgets/qfontcombobox.h
+++ b/src/widgets/widgets/qfontcombobox.h
@@ -58,7 +58,7 @@ class Q_WIDGETS_EXPORT QFontComboBox : public QComboBox
Q_PROPERTY(QFont currentFont READ currentFont WRITE setCurrentFont NOTIFY currentFontChanged)
public:
- explicit QFontComboBox(QWidget *parent = Q_NULLPTR);
+ explicit QFontComboBox(QWidget *parent = nullptr);
~QFontComboBox();
void setWritingSystem(QFontDatabase::WritingSystem);
@@ -78,7 +78,7 @@ public:
FontFilters fontFilters() const;
QFont currentFont() const;
- QSize sizeHint() const Q_DECL_OVERRIDE;
+ QSize sizeHint() const override;
public Q_SLOTS:
void setCurrentFont(const QFont &f);
@@ -87,7 +87,7 @@ Q_SIGNALS:
void currentFontChanged(const QFont &f);
protected:
- bool event(QEvent *e) Q_DECL_OVERRIDE;
+ bool event(QEvent *e) override;
private:
Q_DISABLE_COPY(QFontComboBox)
diff --git a/src/widgets/widgets/qframe.h b/src/widgets/widgets/qframe.h
index 986915a28f..595dfa929d 100644
--- a/src/widgets/widgets/qframe.h
+++ b/src/widgets/widgets/qframe.h
@@ -61,7 +61,7 @@ class Q_WIDGETS_EXPORT QFrame : public QWidget
Q_PROPERTY(QRect frameRect READ frameRect WRITE setFrameRect DESIGNABLE false)
public:
- explicit QFrame(QWidget* parent = Q_NULLPTR, Qt::WindowFlags f = Qt::WindowFlags());
+ explicit QFrame(QWidget* parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags());
~QFrame();
int frameStyle() const;
@@ -69,7 +69,7 @@ public:
int frameWidth() const;
- QSize sizeHint() const Q_DECL_OVERRIDE;
+ QSize sizeHint() const override;
enum Shape {
NoFrame = 0, // no frame
@@ -108,14 +108,14 @@ public:
void setFrameRect(const QRect &);
protected:
- bool event(QEvent *e) Q_DECL_OVERRIDE;
- void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
- void changeEvent(QEvent *) Q_DECL_OVERRIDE;
+ bool event(QEvent *e) override;
+ void paintEvent(QPaintEvent *) override;
+ void changeEvent(QEvent *) override;
void drawFrame(QPainter *);
protected:
- QFrame(QFramePrivate &dd, QWidget* parent = Q_NULLPTR, Qt::WindowFlags f = Qt::WindowFlags());
+ QFrame(QFramePrivate &dd, QWidget* parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags());
void initStyleOption(QStyleOptionFrame *option) const;
private:
diff --git a/src/widgets/widgets/qgroupbox.h b/src/widgets/widgets/qgroupbox.h
index 668dc03f3d..deaeba4656 100644
--- a/src/widgets/widgets/qgroupbox.h
+++ b/src/widgets/widgets/qgroupbox.h
@@ -59,8 +59,8 @@ class Q_WIDGETS_EXPORT QGroupBox : public QWidget
Q_PROPERTY(bool checkable READ isCheckable WRITE setCheckable)
Q_PROPERTY(bool checked READ isChecked WRITE setChecked DESIGNABLE isCheckable NOTIFY toggled USER true)
public:
- explicit QGroupBox(QWidget *parent = Q_NULLPTR);
- explicit QGroupBox(const QString &title, QWidget *parent = Q_NULLPTR);
+ explicit QGroupBox(QWidget *parent = nullptr);
+ explicit QGroupBox(const QString &title, QWidget *parent = nullptr);
~QGroupBox();
QString title() const;
@@ -69,7 +69,7 @@ public:
Qt::Alignment alignment() const;
void setAlignment(int alignment);
- QSize minimumSizeHint() const Q_DECL_OVERRIDE;
+ QSize minimumSizeHint() const override;
bool isFlat() const;
void setFlat(bool flat);
@@ -85,15 +85,15 @@ Q_SIGNALS:
void toggled(bool);
protected:
- bool event(QEvent *event) Q_DECL_OVERRIDE;
- void childEvent(QChildEvent *event) Q_DECL_OVERRIDE;
- void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE;
- void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
- void focusInEvent(QFocusEvent *event) Q_DECL_OVERRIDE;
- void changeEvent(QEvent *event) Q_DECL_OVERRIDE;
- void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
- void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
- void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
+ bool event(QEvent *event) override;
+ void childEvent(QChildEvent *event) override;
+ void resizeEvent(QResizeEvent *event) override;
+ void paintEvent(QPaintEvent *event) override;
+ void focusInEvent(QFocusEvent *event) override;
+ void changeEvent(QEvent *event) override;
+ void mousePressEvent(QMouseEvent *event) override;
+ void mouseMoveEvent(QMouseEvent *event) override;
+ void mouseReleaseEvent(QMouseEvent *event) override;
void initStyleOption(QStyleOptionGroupBox *option) const;
diff --git a/src/widgets/widgets/qkeysequenceedit.h b/src/widgets/widgets/qkeysequenceedit.h
index d5b4b199cd..85d76f14a3 100644
--- a/src/widgets/widgets/qkeysequenceedit.h
+++ b/src/widgets/widgets/qkeysequenceedit.h
@@ -55,8 +55,8 @@ class Q_WIDGETS_EXPORT QKeySequenceEdit : public QWidget
Q_PROPERTY(QKeySequence keySequence READ keySequence WRITE setKeySequence NOTIFY keySequenceChanged USER true)
public:
- explicit QKeySequenceEdit(QWidget *parent = Q_NULLPTR);
- explicit QKeySequenceEdit(const QKeySequence &keySequence, QWidget *parent = Q_NULLPTR);
+ explicit QKeySequenceEdit(QWidget *parent = nullptr);
+ explicit QKeySequenceEdit(const QKeySequence &keySequence, QWidget *parent = nullptr);
~QKeySequenceEdit();
QKeySequence keySequence() const;
@@ -72,10 +72,10 @@ Q_SIGNALS:
protected:
QKeySequenceEdit(QKeySequenceEditPrivate &d, QWidget *parent, Qt::WindowFlags f);
- bool event(QEvent *) Q_DECL_OVERRIDE;
- void keyPressEvent(QKeyEvent *) Q_DECL_OVERRIDE;
- void keyReleaseEvent(QKeyEvent *) Q_DECL_OVERRIDE;
- void timerEvent(QTimerEvent *) Q_DECL_OVERRIDE;
+ bool event(QEvent *) override;
+ void keyPressEvent(QKeyEvent *) override;
+ void keyReleaseEvent(QKeyEvent *) override;
+ void timerEvent(QTimerEvent *) override;
private:
Q_DISABLE_COPY(QKeySequenceEdit)
diff --git a/src/widgets/widgets/qlabel.cpp b/src/widgets/widgets/qlabel.cpp
index e3225800cc..70dc13287d 100644
--- a/src/widgets/widgets/qlabel.cpp
+++ b/src/widgets/widgets/qlabel.cpp
@@ -66,16 +66,16 @@ QLabelPrivate::QLabelPrivate()
sh(),
msh(),
text(),
- pixmap(Q_NULLPTR),
- scaledpixmap(Q_NULLPTR),
- cachedimage(Q_NULLPTR),
+ pixmap(nullptr),
+ scaledpixmap(nullptr),
+ cachedimage(nullptr),
#ifndef QT_NO_PICTURE
- picture(Q_NULLPTR),
+ picture(nullptr),
#endif
#if QT_CONFIG(movie)
movie(),
#endif
- control(Q_NULLPTR),
+ control(nullptr),
shortcutCursor(),
#ifndef QT_NO_CURSOR
cursor(),
diff --git a/src/widgets/widgets/qlabel.h b/src/widgets/widgets/qlabel.h
index 469254a145..e1cc333a1c 100644
--- a/src/widgets/widgets/qlabel.h
+++ b/src/widgets/widgets/qlabel.h
@@ -67,8 +67,8 @@ class Q_WIDGETS_EXPORT QLabel : public QFrame
Q_PROPERTY(QString selectedText READ selectedText)
public:
- explicit QLabel(QWidget *parent=Q_NULLPTR, Qt::WindowFlags f=Qt::WindowFlags());
- explicit QLabel(const QString &text, QWidget *parent=Q_NULLPTR, Qt::WindowFlags f=Qt::WindowFlags());
+ explicit QLabel(QWidget *parent=nullptr, Qt::WindowFlags f=Qt::WindowFlags());
+ explicit QLabel(const QString &text, QWidget *parent=nullptr, Qt::WindowFlags f=Qt::WindowFlags());
~QLabel();
QString text() const;
@@ -97,13 +97,13 @@ public:
bool hasScaledContents() const;
void setScaledContents(bool);
- QSize sizeHint() const Q_DECL_OVERRIDE;
- QSize minimumSizeHint() const Q_DECL_OVERRIDE;
+ QSize sizeHint() const override;
+ QSize minimumSizeHint() const override;
#ifndef QT_NO_SHORTCUT
void setBuddy(QWidget *);
QWidget *buddy() const;
#endif
- int heightForWidth(int) const Q_DECL_OVERRIDE;
+ int heightForWidth(int) const override;
bool openExternalLinks() const;
void setOpenExternalLinks(bool open);
@@ -134,19 +134,19 @@ Q_SIGNALS:
void linkHovered(const QString& link);
protected:
- bool event(QEvent *e) Q_DECL_OVERRIDE;
- void keyPressEvent(QKeyEvent *ev) Q_DECL_OVERRIDE;
- void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
- void changeEvent(QEvent *) Q_DECL_OVERRIDE;
- void mousePressEvent(QMouseEvent *ev) Q_DECL_OVERRIDE;
- void mouseMoveEvent(QMouseEvent *ev) Q_DECL_OVERRIDE;
- void mouseReleaseEvent(QMouseEvent *ev) Q_DECL_OVERRIDE;
+ bool event(QEvent *e) override;
+ void keyPressEvent(QKeyEvent *ev) override;
+ void paintEvent(QPaintEvent *) override;
+ void changeEvent(QEvent *) override;
+ void mousePressEvent(QMouseEvent *ev) override;
+ void mouseMoveEvent(QMouseEvent *ev) override;
+ void mouseReleaseEvent(QMouseEvent *ev) override;
#ifndef QT_NO_CONTEXTMENU
- void contextMenuEvent(QContextMenuEvent *ev) Q_DECL_OVERRIDE;
+ void contextMenuEvent(QContextMenuEvent *ev) override;
#endif // QT_NO_CONTEXTMENU
- void focusInEvent(QFocusEvent *ev) Q_DECL_OVERRIDE;
- void focusOutEvent(QFocusEvent *ev) Q_DECL_OVERRIDE;
- bool focusNextPrevChild(bool next) Q_DECL_OVERRIDE;
+ void focusInEvent(QFocusEvent *ev) override;
+ void focusOutEvent(QFocusEvent *ev) override;
+ bool focusNextPrevChild(bool next) override;
private:
diff --git a/src/widgets/widgets/qlcdnumber.h b/src/widgets/widgets/qlcdnumber.h
index 28fd530e6e..644c39eaf3 100644
--- a/src/widgets/widgets/qlcdnumber.h
+++ b/src/widgets/widgets/qlcdnumber.h
@@ -59,8 +59,8 @@ class Q_WIDGETS_EXPORT QLCDNumber : public QFrame // LCD number widget
Q_PROPERTY(int intValue READ intValue WRITE display)
public:
- explicit QLCDNumber(QWidget* parent = Q_NULLPTR);
- explicit QLCDNumber(uint numDigits, QWidget* parent = Q_NULLPTR);
+ explicit QLCDNumber(QWidget* parent = nullptr);
+ explicit QLCDNumber(uint numDigits, QWidget* parent = nullptr);
~QLCDNumber();
enum Mode {
@@ -88,7 +88,7 @@ public:
double value() const;
int intValue() const;
- QSize sizeHint() const Q_DECL_OVERRIDE;
+ QSize sizeHint() const override;
public Q_SLOTS:
void display(const QString &str);
@@ -104,8 +104,8 @@ Q_SIGNALS:
void overflow();
protected:
- bool event(QEvent *e) Q_DECL_OVERRIDE;
- void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
+ bool event(QEvent *e) override;
+ void paintEvent(QPaintEvent *) override;
public:
diff --git a/src/widgets/widgets/qlineedit.h b/src/widgets/widgets/qlineedit.h
index b98307390c..099bf4bb18 100644
--- a/src/widgets/widgets/qlineedit.h
+++ b/src/widgets/widgets/qlineedit.h
@@ -90,8 +90,8 @@ public:
};
Q_ENUM(ActionPosition)
- explicit QLineEdit(QWidget *parent = Q_NULLPTR);
- explicit QLineEdit(const QString &, QWidget *parent = Q_NULLPTR);
+ explicit QLineEdit(QWidget *parent = nullptr);
+ explicit QLineEdit(const QString &, QWidget *parent = nullptr);
~QLineEdit();
QString text() const;
@@ -128,8 +128,8 @@ public:
QCompleter *completer() const;
#endif
- QSize sizeHint() const Q_DECL_OVERRIDE;
- QSize minimumSizeHint() const Q_DECL_OVERRIDE;
+ QSize sizeHint() const override;
+ QSize minimumSizeHint() const override;
int cursorPosition() const;
void setCursorPosition(int);
@@ -209,31 +209,31 @@ Q_SIGNALS:
void selectionChanged();
protected:
- void mousePressEvent(QMouseEvent *) Q_DECL_OVERRIDE;
- void mouseMoveEvent(QMouseEvent *) Q_DECL_OVERRIDE;
- void mouseReleaseEvent(QMouseEvent *) Q_DECL_OVERRIDE;
- void mouseDoubleClickEvent(QMouseEvent *) Q_DECL_OVERRIDE;
- void keyPressEvent(QKeyEvent *) Q_DECL_OVERRIDE;
- void focusInEvent(QFocusEvent *) Q_DECL_OVERRIDE;
- void focusOutEvent(QFocusEvent *) Q_DECL_OVERRIDE;
- void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
+ void mousePressEvent(QMouseEvent *) override;
+ void mouseMoveEvent(QMouseEvent *) override;
+ void mouseReleaseEvent(QMouseEvent *) override;
+ void mouseDoubleClickEvent(QMouseEvent *) override;
+ void keyPressEvent(QKeyEvent *) override;
+ void focusInEvent(QFocusEvent *) override;
+ void focusOutEvent(QFocusEvent *) override;
+ void paintEvent(QPaintEvent *) override;
#ifndef QT_NO_DRAGANDDROP
- void dragEnterEvent(QDragEnterEvent *) Q_DECL_OVERRIDE;
- void dragMoveEvent(QDragMoveEvent *e) Q_DECL_OVERRIDE;
- void dragLeaveEvent(QDragLeaveEvent *e) Q_DECL_OVERRIDE;
- void dropEvent(QDropEvent *) Q_DECL_OVERRIDE;
+ void dragEnterEvent(QDragEnterEvent *) override;
+ void dragMoveEvent(QDragMoveEvent *e) override;
+ void dragLeaveEvent(QDragLeaveEvent *e) override;
+ void dropEvent(QDropEvent *) override;
#endif
- void changeEvent(QEvent *) Q_DECL_OVERRIDE;
+ void changeEvent(QEvent *) override;
#ifndef QT_NO_CONTEXTMENU
- void contextMenuEvent(QContextMenuEvent *) Q_DECL_OVERRIDE;
+ void contextMenuEvent(QContextMenuEvent *) override;
#endif
- void inputMethodEvent(QInputMethodEvent *) Q_DECL_OVERRIDE;
+ void inputMethodEvent(QInputMethodEvent *) override;
void initStyleOption(QStyleOptionFrame *option) const;
public:
- QVariant inputMethodQuery(Qt::InputMethodQuery) const Q_DECL_OVERRIDE;
+ QVariant inputMethodQuery(Qt::InputMethodQuery) const override;
Q_INVOKABLE QVariant inputMethodQuery(Qt::InputMethodQuery property, QVariant argument) const;
- bool event(QEvent *) Q_DECL_OVERRIDE;
+ bool event(QEvent *) override;
protected:
QRect cursorRect() const;
diff --git a/src/widgets/widgets/qlineedit_p.cpp b/src/widgets/widgets/qlineedit_p.cpp
index 5b352f5554..c66b842223 100644
--- a/src/widgets/widgets/qlineedit_p.cpp
+++ b/src/widgets/widgets/qlineedit_p.cpp
@@ -330,13 +330,13 @@ QLineEditIconButton::QLineEditIconButton(QWidget *parent)
QLineEditPrivate *QLineEditIconButton::lineEditPrivate() const
{
QLineEdit *le = qobject_cast<QLineEdit *>(parentWidget());
- return le ? static_cast<QLineEditPrivate *>(qt_widget_private(le)) : Q_NULLPTR;
+ return le ? static_cast<QLineEditPrivate *>(qt_widget_private(le)) : nullptr;
}
void QLineEditIconButton::paintEvent(QPaintEvent *)
{
QPainter painter(this);
- QWindow *window = Q_NULLPTR;
+ QWindow *window = nullptr;
if (const QWidget *nativeParent = nativeParentWidget())
window = nativeParent->windowHandle();
// Note isDown should really use the active state but in most styles
diff --git a/src/widgets/widgets/qlineedit_p.h b/src/widgets/widgets/qlineedit_p.h
index 77a91880df..a3f549ad31 100644
--- a/src/widgets/widgets/qlineedit_p.h
+++ b/src/widgets/widgets/qlineedit_p.h
@@ -94,8 +94,8 @@ public:
#endif
protected:
- void actionEvent(QActionEvent *e) Q_DECL_OVERRIDE;
- void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
+ void actionEvent(QActionEvent *e) override;
+ void paintEvent(QPaintEvent *event) override;
private slots:
void updateCursor();
diff --git a/src/widgets/widgets/qmaccocoaviewcontainer_mac.h b/src/widgets/widgets/qmaccocoaviewcontainer_mac.h
index d926ef8569..0de3989167 100644
--- a/src/widgets/widgets/qmaccocoaviewcontainer_mac.h
+++ b/src/widgets/widgets/qmaccocoaviewcontainer_mac.h
@@ -52,7 +52,7 @@ class Q_WIDGETS_EXPORT QMacCocoaViewContainer : public QWidget
{
Q_OBJECT
public:
- QMacCocoaViewContainer(NSView *cocoaViewToWrap, QWidget *parent = Q_NULLPTR);
+ QMacCocoaViewContainer(NSView *cocoaViewToWrap, QWidget *parent = nullptr);
virtual ~QMacCocoaViewContainer();
void setCocoaView(NSView *view);
diff --git a/src/widgets/widgets/qmacnativewidget_mac.h b/src/widgets/widgets/qmacnativewidget_mac.h
index a8faffd6be..6fd90516ac 100644
--- a/src/widgets/widgets/qmacnativewidget_mac.h
+++ b/src/widgets/widgets/qmacnativewidget_mac.h
@@ -51,7 +51,7 @@ class Q_WIDGETS_EXPORT QMacNativeWidget : public QWidget
{
Q_OBJECT
public:
- QMacNativeWidget(NSView *parentView = Q_NULLPTR);
+ QMacNativeWidget(NSView *parentView = nullptr);
~QMacNativeWidget();
QSize sizeHint() const override;
diff --git a/src/widgets/widgets/qmainwindow.h b/src/widgets/widgets/qmainwindow.h
index 50d840cf61..069683d4ac 100644
--- a/src/widgets/widgets/qmainwindow.h
+++ b/src/widgets/widgets/qmainwindow.h
@@ -91,7 +91,7 @@ public:
Q_DECLARE_FLAGS(DockOptions, DockOption)
Q_FLAG(DockOptions)
- explicit QMainWindow(QWidget *parent = Q_NULLPTR, Qt::WindowFlags flags = Qt::WindowFlags());
+ explicit QMainWindow(QWidget *parent = nullptr, Qt::WindowFlags flags = Qt::WindowFlags());
~QMainWindow();
QSize iconSize() const;
@@ -203,9 +203,9 @@ Q_SIGNALS:
protected:
#ifndef QT_NO_CONTEXTMENU
- void contextMenuEvent(QContextMenuEvent *event) Q_DECL_OVERRIDE;
+ void contextMenuEvent(QContextMenuEvent *event) override;
#endif
- bool event(QEvent *event) Q_DECL_OVERRIDE;
+ bool event(QEvent *event) override;
private:
Q_DECLARE_PRIVATE(QMainWindow)
diff --git a/src/widgets/widgets/qmainwindowlayout.cpp b/src/widgets/widgets/qmainwindowlayout.cpp
index 1767a8458f..9b38da340c 100644
--- a/src/widgets/widgets/qmainwindowlayout.cpp
+++ b/src/widgets/widgets/qmainwindowlayout.cpp
@@ -202,14 +202,14 @@ public:
layoutState.deleteAllLayoutItems();
}
- void addItem(QLayoutItem*) Q_DECL_OVERRIDE { Q_UNREACHABLE(); }
- int count() const Q_DECL_OVERRIDE { return 0; }
- QLayoutItem* itemAt(int index) const Q_DECL_OVERRIDE
+ void addItem(QLayoutItem*) override { Q_UNREACHABLE(); }
+ int count() const override { return 0; }
+ QLayoutItem* itemAt(int index) const override
{
int x = 0;
return layoutState.itemAt(&x, index);
}
- QLayoutItem* takeAt(int index) Q_DECL_OVERRIDE
+ QLayoutItem* takeAt(int index) override
{
int x = 0;
QLayoutItem *ret = layoutState.takeAt(&x, index);
@@ -225,22 +225,22 @@ public:
}
return ret;
}
- QSize sizeHint() const Q_DECL_OVERRIDE
+ QSize sizeHint() const override
{
int fw = frameWidth();
return layoutState.sizeHint() + QSize(fw, fw);
}
- QSize minimumSize() const Q_DECL_OVERRIDE
+ QSize minimumSize() const override
{
int fw = frameWidth();
return layoutState.minimumSize() + QSize(fw, fw);
}
- QSize maximumSize() const Q_DECL_OVERRIDE
+ QSize maximumSize() const override
{
int fw = frameWidth();
return layoutState.maximumSize() + QSize(fw, fw);
}
- void setGeometry(const QRect&r) Q_DECL_OVERRIDE
+ void setGeometry(const QRect&r) override
{
groupWindow()->destroyOrHideIfEmpty();
QDockAreaLayoutInfo *li = dockAreaLayoutInfo();
@@ -1658,9 +1658,9 @@ class QMainWindowTabBar : public QTabBar
public:
QMainWindowTabBar(QMainWindow *parent);
protected:
- bool event(QEvent *e) Q_DECL_OVERRIDE;
- void mouseReleaseEvent(QMouseEvent*) Q_DECL_OVERRIDE;
- void mouseMoveEvent(QMouseEvent*) Q_DECL_OVERRIDE;
+ bool event(QEvent *e) override;
+ void mouseReleaseEvent(QMouseEvent*) override;
+ void mouseMoveEvent(QMouseEvent*) override;
};
diff --git a/src/widgets/widgets/qmainwindowlayout_p.h b/src/widgets/widgets/qmainwindowlayout_p.h
index c61c4f6aa8..168d4444b9 100644
--- a/src/widgets/widgets/qmainwindowlayout_p.h
+++ b/src/widgets/widgets/qmainwindowlayout_p.h
@@ -345,8 +345,8 @@ public:
QList<int> currentGapPos;
protected:
- bool event(QEvent *) Q_DECL_OVERRIDE;
- void paintEvent(QPaintEvent*) Q_DECL_OVERRIDE;
+ bool event(QEvent *) override;
+ void paintEvent(QPaintEvent*) override;
private:
QSize m_removedFrameSize;
@@ -358,9 +358,9 @@ class QDockWidgetGroupWindowItem : public QWidgetItem
{
public:
explicit QDockWidgetGroupWindowItem(QDockWidgetGroupWindow *parent) : QWidgetItem(parent) {}
- QSize minimumSize() const Q_DECL_OVERRIDE { return lay()->minimumSize(); }
- QSize maximumSize() const Q_DECL_OVERRIDE { return lay()->maximumSize(); }
- QSize sizeHint() const Q_DECL_OVERRIDE { return lay()->sizeHint(); }
+ QSize minimumSize() const override { return lay()->minimumSize(); }
+ QSize maximumSize() const override { return lay()->maximumSize(); }
+ QSize sizeHint() const override { return lay()->sizeHint(); }
private:
QLayout *lay() const { return const_cast<QDockWidgetGroupWindowItem *>(this)->widget()->layout(); }
@@ -533,17 +533,17 @@ public:
// QLayout interface
- void addItem(QLayoutItem *item) Q_DECL_OVERRIDE;
- void setGeometry(const QRect &r) Q_DECL_OVERRIDE;
- QLayoutItem *itemAt(int index) const Q_DECL_OVERRIDE;
- QLayoutItem *takeAt(int index) Q_DECL_OVERRIDE;
- int count() const Q_DECL_OVERRIDE;
+ void addItem(QLayoutItem *item) override;
+ void setGeometry(const QRect &r) override;
+ QLayoutItem *itemAt(int index) const override;
+ QLayoutItem *takeAt(int index) override;
+ int count() const override;
- QSize sizeHint() const Q_DECL_OVERRIDE;
- QSize minimumSize() const Q_DECL_OVERRIDE;
+ QSize sizeHint() const override;
+ QSize minimumSize() const override;
mutable QSize szHint;
mutable QSize minSize;
- void invalidate() Q_DECL_OVERRIDE;
+ void invalidate() override;
// animations
diff --git a/src/widgets/widgets/qmdiarea.cpp b/src/widgets/widgets/qmdiarea.cpp
index 4e7925556a..bc7333df2e 100644
--- a/src/widgets/widgets/qmdiarea.cpp
+++ b/src/widgets/widgets/qmdiarea.cpp
@@ -570,9 +570,9 @@ public:
QMdiAreaTabBar(QWidget *parent) : QTabBar(parent) {}
protected:
- void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
+ void mousePressEvent(QMouseEvent *event) override;
#ifndef QT_NO_CONTEXTMENU
- void contextMenuEvent(QContextMenuEvent *event) Q_DECL_OVERRIDE;
+ void contextMenuEvent(QContextMenuEvent *event) override;
#endif
private:
diff --git a/src/widgets/widgets/qmdiarea.h b/src/widgets/widgets/qmdiarea.h
index 05deb9e21f..35edde9eb8 100644
--- a/src/widgets/widgets/qmdiarea.h
+++ b/src/widgets/widgets/qmdiarea.h
@@ -87,11 +87,11 @@ public:
};
Q_ENUM(ViewMode)
- QMdiArea(QWidget *parent = Q_NULLPTR);
+ QMdiArea(QWidget *parent = nullptr);
~QMdiArea();
- QSize sizeHint() const Q_DECL_OVERRIDE;
- QSize minimumSizeHint() const Q_DECL_OVERRIDE;
+ QSize sizeHint() const override;
+ QSize minimumSizeHint() const override;
QMdiSubWindow *currentSubWindow() const;
QMdiSubWindow *activeSubWindow() const;
@@ -143,18 +143,18 @@ public Q_SLOTS:
void activatePreviousSubWindow();
protected Q_SLOTS:
- void setupViewport(QWidget *viewport) Q_DECL_OVERRIDE;
+ void setupViewport(QWidget *viewport) override;
protected:
- bool event(QEvent *event) Q_DECL_OVERRIDE;
- bool eventFilter(QObject *object, QEvent *event) Q_DECL_OVERRIDE;
- void paintEvent(QPaintEvent *paintEvent) Q_DECL_OVERRIDE;
- void childEvent(QChildEvent *childEvent) Q_DECL_OVERRIDE;
- void resizeEvent(QResizeEvent *resizeEvent) Q_DECL_OVERRIDE;
- void timerEvent(QTimerEvent *timerEvent) Q_DECL_OVERRIDE;
- void showEvent(QShowEvent *showEvent) Q_DECL_OVERRIDE;
- bool viewportEvent(QEvent *event) Q_DECL_OVERRIDE;
- void scrollContentsBy(int dx, int dy) Q_DECL_OVERRIDE;
+ bool event(QEvent *event) override;
+ bool eventFilter(QObject *object, QEvent *event) override;
+ void paintEvent(QPaintEvent *paintEvent) override;
+ void childEvent(QChildEvent *childEvent) override;
+ void resizeEvent(QResizeEvent *resizeEvent) override;
+ void timerEvent(QTimerEvent *timerEvent) override;
+ void showEvent(QShowEvent *showEvent) override;
+ bool viewportEvent(QEvent *event) override;
+ void scrollContentsBy(int dx, int dy) override;
private:
Q_DISABLE_COPY(QMdiArea)
diff --git a/src/widgets/widgets/qmdiarea_p.h b/src/widgets/widgets/qmdiarea_p.h
index 4740993af7..fd00118ec6 100644
--- a/src/widgets/widgets/qmdiarea_p.h
+++ b/src/widgets/widgets/qmdiarea_p.h
@@ -88,8 +88,8 @@ class RegularTiler : public Rearranger
// Rearranges widgets according to a regular tiling pattern
// covering the entire domain.
// Both positions and sizes may change.
- void rearrange(QList<QWidget *> &widgets, const QRect &domain) const Q_DECL_OVERRIDE;
- Type type() const Q_DECL_OVERRIDE { return Rearranger::RegularTiler; }
+ void rearrange(QList<QWidget *> &widgets, const QRect &domain) const override;
+ Type type() const override { return Rearranger::RegularTiler; }
};
class SimpleCascader : public Rearranger
@@ -97,8 +97,8 @@ class SimpleCascader : public Rearranger
// Rearranges widgets according to a simple, regular cascading pattern.
// Widgets are resized to minimumSize.
// Both positions and sizes may change.
- void rearrange(QList<QWidget *> &widgets, const QRect &domain) const Q_DECL_OVERRIDE;
- Type type() const Q_DECL_OVERRIDE { return Rearranger::SimpleCascader; }
+ void rearrange(QList<QWidget *> &widgets, const QRect &domain) const override;
+ Type type() const override { return Rearranger::SimpleCascader; }
};
class IconTiler : public Rearranger
@@ -106,8 +106,8 @@ class IconTiler : public Rearranger
// Rearranges icons (assumed to be the same size) according to a regular
// tiling pattern filling up the domain from the bottom.
// Only positions may change.
- void rearrange(QList<QWidget *> &widgets, const QRect &domain) const Q_DECL_OVERRIDE;
- Type type() const Q_DECL_OVERRIDE { return Rearranger::IconTiler; }
+ void rearrange(QList<QWidget *> &widgets, const QRect &domain) const override;
+ Type type() const override { return Rearranger::IconTiler; }
};
class Placer
@@ -122,7 +122,7 @@ public:
class MinOverlapPlacer : public Placer
{
- QPoint place(const QSize &size, const QVector<QRect> &rects, const QRect &domain) const Q_DECL_OVERRIDE;
+ QPoint place(const QSize &size, const QVector<QRect> &rects, const QRect &domain) const override;
static int accumulatedOverlap(const QRect &source, const QVector<QRect> &rects);
static QRect findMinOverlapRect(const QVector<QRect> &source, const QVector<QRect> &rects);
static QVector<QRect> getCandidatePlacements(const QSize &size, const QVector<QRect> &rects, const QRect &domain);
@@ -206,7 +206,7 @@ public:
bool lastWindowAboutToBeDestroyed() const;
void setChildActivationEnabled(bool enable = true, bool onlyNextActivationEvent = false) const;
QRect resizeToMinimumTileSize(const QSize &minSubWindowSize, int subWindowCount);
- void scrollBarPolicyChanged(Qt::Orientation, Qt::ScrollBarPolicy) Q_DECL_OVERRIDE; // reimp
+ void scrollBarPolicyChanged(Qt::Orientation, Qt::ScrollBarPolicy) override; // reimp
QMdiSubWindow *nextVisibleSubWindow(int increaseFactor, QMdiArea::WindowOrder,
int removed = -1, int fromIndex = -1) const;
void highlightNextSubWindow(int increaseFactor);
diff --git a/src/widgets/widgets/qmdisubwindow.cpp b/src/widgets/widgets/qmdisubwindow.cpp
index 129898a08d..0fdeaeb1e6 100644
--- a/src/widgets/widgets/qmdisubwindow.cpp
+++ b/src/widgets/widgets/qmdisubwindow.cpp
@@ -373,18 +373,18 @@ class ControlLabel : public QWidget
public:
ControlLabel(QMdiSubWindow *subWindow, QWidget *parent = 0);
- QSize sizeHint() const Q_DECL_OVERRIDE;
+ QSize sizeHint() const override;
signals:
void _q_clicked();
void _q_doubleClicked();
protected:
- bool event(QEvent *event) Q_DECL_OVERRIDE;
- void paintEvent(QPaintEvent *paintEvent) Q_DECL_OVERRIDE;
- void mousePressEvent(QMouseEvent *mouseEvent) Q_DECL_OVERRIDE;
- void mouseDoubleClickEvent(QMouseEvent *mouseEvent) Q_DECL_OVERRIDE;
- void mouseReleaseEvent(QMouseEvent *mouseEvent) Q_DECL_OVERRIDE;
+ bool event(QEvent *event) override;
+ void paintEvent(QPaintEvent *paintEvent) override;
+ void mousePressEvent(QMouseEvent *mouseEvent) override;
+ void mouseDoubleClickEvent(QMouseEvent *mouseEvent) override;
+ void mouseReleaseEvent(QMouseEvent *mouseEvent) override;
private:
QPixmap label;
@@ -504,7 +504,7 @@ class ControllerWidget : public QWidget
Q_OBJECT
public:
ControllerWidget(QMdiSubWindow *subWindow, QWidget *parent = 0);
- QSize sizeHint() const Q_DECL_OVERRIDE;
+ QSize sizeHint() const override;
void setControlVisible(QMdiSubWindowPrivate::WindowStateAction action, bool visible);
inline bool hasVisibleControls() const
{
@@ -519,12 +519,12 @@ signals:
void _q_close();
protected:
- void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
- void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
- void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
- void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
- void leaveEvent(QEvent *event) Q_DECL_OVERRIDE;
- bool event(QEvent *event) Q_DECL_OVERRIDE;
+ void paintEvent(QPaintEvent *event) override;
+ void mousePressEvent(QMouseEvent *event) override;
+ void mouseReleaseEvent(QMouseEvent *event) override;
+ void mouseMoveEvent(QMouseEvent *event) override;
+ void leaveEvent(QEvent *event) override;
+ bool event(QEvent *event) override;
private:
QStyle::SubControl activeControl;
diff --git a/src/widgets/widgets/qmdisubwindow.h b/src/widgets/widgets/qmdisubwindow.h
index adaafa352a..302522e1c3 100644
--- a/src/widgets/widgets/qmdisubwindow.h
+++ b/src/widgets/widgets/qmdisubwindow.h
@@ -66,11 +66,11 @@ public:
};
Q_DECLARE_FLAGS(SubWindowOptions, SubWindowOption)
- QMdiSubWindow(QWidget *parent = Q_NULLPTR, Qt::WindowFlags flags = Qt::WindowFlags());
+ QMdiSubWindow(QWidget *parent = nullptr, Qt::WindowFlags flags = Qt::WindowFlags());
~QMdiSubWindow();
- QSize sizeHint() const Q_DECL_OVERRIDE;
- QSize minimumSizeHint() const Q_DECL_OVERRIDE;
+ QSize sizeHint() const override;
+ QSize minimumSizeHint() const override;
void setWidget(QWidget *widget);
QWidget *widget() const;
@@ -107,28 +107,28 @@ public Q_SLOTS:
void showShaded();
protected:
- bool eventFilter(QObject *object, QEvent *event) Q_DECL_OVERRIDE;
- bool event(QEvent *event) Q_DECL_OVERRIDE;
- void showEvent(QShowEvent *showEvent) Q_DECL_OVERRIDE;
- void hideEvent(QHideEvent *hideEvent) Q_DECL_OVERRIDE;
- void changeEvent(QEvent *changeEvent) Q_DECL_OVERRIDE;
- void closeEvent(QCloseEvent *closeEvent) Q_DECL_OVERRIDE;
- void leaveEvent(QEvent *leaveEvent) Q_DECL_OVERRIDE;
- void resizeEvent(QResizeEvent *resizeEvent) Q_DECL_OVERRIDE;
- void timerEvent(QTimerEvent *timerEvent) Q_DECL_OVERRIDE;
- void moveEvent(QMoveEvent *moveEvent) Q_DECL_OVERRIDE;
- void paintEvent(QPaintEvent *paintEvent) Q_DECL_OVERRIDE;
- void mousePressEvent(QMouseEvent *mouseEvent) Q_DECL_OVERRIDE;
- void mouseDoubleClickEvent(QMouseEvent *mouseEvent) Q_DECL_OVERRIDE;
- void mouseReleaseEvent(QMouseEvent *mouseEvent) Q_DECL_OVERRIDE;
- void mouseMoveEvent(QMouseEvent *mouseEvent) Q_DECL_OVERRIDE;
- void keyPressEvent(QKeyEvent *keyEvent) Q_DECL_OVERRIDE;
+ bool eventFilter(QObject *object, QEvent *event) override;
+ bool event(QEvent *event) override;
+ void showEvent(QShowEvent *showEvent) override;
+ void hideEvent(QHideEvent *hideEvent) override;
+ void changeEvent(QEvent *changeEvent) override;
+ void closeEvent(QCloseEvent *closeEvent) override;
+ void leaveEvent(QEvent *leaveEvent) override;
+ void resizeEvent(QResizeEvent *resizeEvent) override;
+ void timerEvent(QTimerEvent *timerEvent) override;
+ void moveEvent(QMoveEvent *moveEvent) override;
+ void paintEvent(QPaintEvent *paintEvent) override;
+ void mousePressEvent(QMouseEvent *mouseEvent) override;
+ void mouseDoubleClickEvent(QMouseEvent *mouseEvent) override;
+ void mouseReleaseEvent(QMouseEvent *mouseEvent) override;
+ void mouseMoveEvent(QMouseEvent *mouseEvent) override;
+ void keyPressEvent(QKeyEvent *keyEvent) override;
#ifndef QT_NO_CONTEXTMENU
- void contextMenuEvent(QContextMenuEvent *contextMenuEvent) Q_DECL_OVERRIDE;
+ void contextMenuEvent(QContextMenuEvent *contextMenuEvent) override;
#endif
- void focusInEvent(QFocusEvent *focusInEvent) Q_DECL_OVERRIDE;
- void focusOutEvent(QFocusEvent *focusOutEvent) Q_DECL_OVERRIDE;
- void childEvent(QChildEvent *childEvent) Q_DECL_OVERRIDE;
+ void focusInEvent(QFocusEvent *focusInEvent) override;
+ void focusOutEvent(QFocusEvent *focusOutEvent) override;
+ void childEvent(QChildEvent *childEvent) override;
private:
Q_DISABLE_COPY(QMdiSubWindow)
diff --git a/src/widgets/widgets/qmdisubwindow_p.h b/src/widgets/widgets/qmdisubwindow_p.h
index d03aca168b..719984c8d4 100644
--- a/src/widgets/widgets/qmdisubwindow_p.h
+++ b/src/widgets/widgets/qmdisubwindow_p.h
@@ -271,7 +271,7 @@ public:
void setFocusWidget();
bool restoreFocus();
void storeFocusWidget();
- void setWindowFlags(Qt::WindowFlags windowFlags) Q_DECL_OVERRIDE;
+ void setWindowFlags(Qt::WindowFlags windowFlags) override;
void setVisible(WindowStateAction, bool visible = true);
#ifndef QT_NO_ACTION
void setEnabled(WindowStateAction, bool enable = true);
diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp
index c5b912e35b..c4bb02fd5b 100644
--- a/src/widgets/widgets/qmenu.cpp
+++ b/src/widgets/widgets/qmenu.cpp
@@ -116,7 +116,7 @@ class QTornOffMenu : public QMenu
q->setFixedSize(size);
}
- QVector<QPointer<QWidget> > calcCausedStack() const Q_DECL_OVERRIDE { return causedStack; }
+ QVector<QPointer<QWidget> > calcCausedStack() const override { return causedStack; }
QPointer<QMenu> causedMenu;
QVector<QPointer<QWidget> > causedStack;
bool initialized;
@@ -162,7 +162,7 @@ public:
} else if (act->type() == QEvent::ActionRemoved)
removeAction(act->action());
}
- void actionEvent(QActionEvent *e) Q_DECL_OVERRIDE
+ void actionEvent(QActionEvent *e) override
{
Q_D(QTornOffMenu);
QMenu::actionEvent(e);
@@ -240,7 +240,7 @@ void QMenuPrivate::syncPlatformMenu()
if (platformMenu.isNull())
return;
- QPlatformMenuItem *beforeItem = Q_NULLPTR;
+ QPlatformMenuItem *beforeItem = nullptr;
const QList<QAction*> actions = q->actions();
for (QList<QAction*>::const_reverse_iterator it = actions.rbegin(), end = actions.rend(); it != end; ++it) {
QPlatformMenuItem *menuItem = insertActionInPlatformMenu(*it, beforeItem);
@@ -665,7 +665,7 @@ void QMenuPrivate::setCurrentAction(QAction *action, int popup, SelectionReason
if (action
&& (action->isSeparator()
|| (!action->isEnabled() && !q->style()->styleHint(QStyle::SH_Menu_AllowActiveAndDisabled, 0, q))))
- action = Q_NULLPTR;
+ action = nullptr;
// Reselect the currently active action in case mouse moved over other menu items when
// moving from sub menu action to sub menu (QTBUG-20094).
@@ -739,13 +739,13 @@ void QMenuSloppyState::reset()
m_use_reset_action = true;
m_uni_dir_discarded_count = 0;
m_time.stop();
- m_reset_action = Q_NULLPTR;
- m_origin_action = Q_NULLPTR;
+ m_reset_action = nullptr;
+ m_origin_action = nullptr;
m_action_rect = QRect();
m_previous_point = QPointF();
if (m_sub_menu) {
- QMenuPrivate::get(m_sub_menu)->sloppyState.m_parent = Q_NULLPTR;
- m_sub_menu = Q_NULLPTR;
+ QMenuPrivate::get(m_sub_menu)->sloppyState.m_parent = nullptr;
+ m_sub_menu = nullptr;
}
}
void QMenuSloppyState::enter()
@@ -854,7 +854,7 @@ void QMenuSloppyState::timeout()
if (m_use_reset_action)
menu_priv->setCurrentAction(m_reset_action, 0);
} else {
- menu_priv->setCurrentAction(Q_NULLPTR, 0);
+ menu_priv->setCurrentAction(nullptr, 0);
}
}
@@ -904,8 +904,7 @@ void QMenuPrivate::adjustMenuScreen(const QPoint &p)
// so a wrong screen would often cause wrong sizes (on high DPI)
const QScreen *primaryScreen = QApplication::primaryScreen();
const QScreen *currentScreen = q->windowHandle() ? q->windowHandle()->screen() : primaryScreen;
- const int screenNumberForPoint = QApplication::desktop()->screenNumber(p);
- QScreen *actualScreen = QGuiApplication::screens().at(screenNumberForPoint);
+ QScreen *actualScreen = QGuiApplication::screenAt(p);
if (actualScreen && currentScreen != actualScreen) {
if (!q->windowHandle()) // Try to create a window handle if not created.
createWinId();
@@ -2227,7 +2226,7 @@ void QMenu::hideTearOffMenu()
// should consider the torn-off menu deleted.
// This way showTearOffMenu() will not try to
// reuse the dying torn-off menu.
- d->tornPopup = Q_NULLPTR;
+ d->tornPopup = nullptr;
}
}
diff --git a/src/widgets/widgets/qmenu.h b/src/widgets/widgets/qmenu.h
index 7cf73f55b3..86d927e919 100644
--- a/src/widgets/widgets/qmenu.h
+++ b/src/widgets/widgets/qmenu.h
@@ -71,8 +71,8 @@ private:
Q_PROPERTY(bool toolTipsVisible READ toolTipsVisible WRITE setToolTipsVisible)
public:
- explicit QMenu(QWidget *parent = Q_NULLPTR);
- explicit QMenu(const QString &title, QWidget *parent = Q_NULLPTR);
+ explicit QMenu(QWidget *parent = nullptr);
+ explicit QMenu(const QString &title, QWidget *parent = nullptr);
~QMenu();
using QWidget::addAction;
@@ -184,17 +184,17 @@ public:
void setActiveAction(QAction *act);
QAction *activeAction() const;
- void popup(const QPoint &pos, QAction *at = Q_NULLPTR);
+ void popup(const QPoint &pos, QAction *at = nullptr);
QAction *exec();
- QAction *exec(const QPoint &pos, QAction *at = Q_NULLPTR);
+ QAction *exec(const QPoint &pos, QAction *at = nullptr);
#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
- static QAction *exec(const QList<QAction *> &actions, const QPoint &pos, QAction *at = Q_NULLPTR, QWidget *parent = Q_NULLPTR);
+ static QAction *exec(const QList<QAction *> &actions, const QPoint &pos, QAction *at = nullptr, QWidget *parent = nullptr);
#else
- static QAction *exec(QList<QAction*> actions, const QPoint &pos, QAction *at = Q_NULLPTR, QWidget *parent = Q_NULLPTR);
+ static QAction *exec(QList<QAction*> actions, const QPoint &pos, QAction *at = nullptr, QWidget *parent = nullptr);
#endif
- QSize sizeHint() const Q_DECL_OVERRIDE;
+ QSize sizeHint() const override;
QRect actionGeometry(QAction *) const;
QAction *actionAt(const QPoint &) const;
@@ -231,22 +231,22 @@ Q_SIGNALS:
protected:
int columnCount() const;
- void changeEvent(QEvent *) Q_DECL_OVERRIDE;
- void keyPressEvent(QKeyEvent *) Q_DECL_OVERRIDE;
- void mouseReleaseEvent(QMouseEvent *) Q_DECL_OVERRIDE;
- void mousePressEvent(QMouseEvent *) Q_DECL_OVERRIDE;
- void mouseMoveEvent(QMouseEvent *) Q_DECL_OVERRIDE;
+ void changeEvent(QEvent *) override;
+ void keyPressEvent(QKeyEvent *) override;
+ void mouseReleaseEvent(QMouseEvent *) override;
+ void mousePressEvent(QMouseEvent *) override;
+ void mouseMoveEvent(QMouseEvent *) override;
#if QT_CONFIG(wheelevent)
- void wheelEvent(QWheelEvent *) Q_DECL_OVERRIDE;
+ void wheelEvent(QWheelEvent *) override;
#endif
- void enterEvent(QEvent *) Q_DECL_OVERRIDE;
- void leaveEvent(QEvent *) Q_DECL_OVERRIDE;
- void hideEvent(QHideEvent *) Q_DECL_OVERRIDE;
- void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
- void actionEvent(QActionEvent *) Q_DECL_OVERRIDE;
- void timerEvent(QTimerEvent *) Q_DECL_OVERRIDE;
- bool event(QEvent *) Q_DECL_OVERRIDE;
- bool focusNextPrevChild(bool next) Q_DECL_OVERRIDE;
+ void enterEvent(QEvent *) override;
+ void leaveEvent(QEvent *) override;
+ void hideEvent(QHideEvent *) override;
+ void paintEvent(QPaintEvent *) override;
+ void actionEvent(QActionEvent *) override;
+ void timerEvent(QTimerEvent *) override;
+ bool event(QEvent *) override;
+ bool focusNextPrevChild(bool next) override;
void initStyleOption(QStyleOptionMenuItem *option, const QAction *action) const;
private Q_SLOTS:
@@ -259,7 +259,7 @@ private:
Q_PRIVATE_SLOT(d_func(), void _q_platformMenuAboutToShow())
protected:
- QMenu(QMenuPrivate &dd, QWidget* parent = Q_NULLPTR);
+ QMenu(QMenuPrivate &dd, QWidget* parent = nullptr);
private:
Q_DISABLE_COPY(QMenu)
diff --git a/src/widgets/widgets/qmenu_p.h b/src/widgets/widgets/qmenu_p.h
index ce5134958e..b6afb05e3a 100644
--- a/src/widgets/widgets/qmenu_p.h
+++ b/src/widgets/widgets/qmenu_p.h
@@ -177,7 +177,7 @@ public:
QSetValueOnDestroy<QPointF> setPreviousPoint(m_previous_point, mousePos);
if (resetAction && resetAction->isSeparator()) {
- m_reset_action = Q_NULLPTR;
+ m_reset_action = nullptr;
m_use_reset_action = true;
} else if (m_reset_action != resetAction) {
if (m_use_reset_action && resetAction) {
@@ -442,8 +442,8 @@ public:
public:
enum Type { ScrollUp, ScrollDown };
ScrollerTearOffItem(Type type, QMenuPrivate *mPrivate,
- QWidget *parent = Q_NULLPTR, Qt::WindowFlags f = Qt::WindowFlags());
- void paintEvent(QPaintEvent *e) Q_DECL_OVERRIDE;
+ QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags());
+ void paintEvent(QPaintEvent *e) override;
void updateScrollerRects(const QRect &rect);
private:
diff --git a/src/widgets/widgets/qmenubar.cpp b/src/widgets/widgets/qmenubar.cpp
index ece2a0a9c9..80c6d28e85 100644
--- a/src/widgets/widgets/qmenubar.cpp
+++ b/src/widgets/widgets/qmenubar.cpp
@@ -75,8 +75,8 @@ class QMenuBarExtension : public QToolButton
public:
explicit QMenuBarExtension(QWidget *parent);
- QSize sizeHint() const Q_DECL_OVERRIDE;
- void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
+ QSize sizeHint() const override;
+ void paintEvent(QPaintEvent *) override;
};
QMenuBarExtension::QMenuBarExtension(QWidget *parent)
@@ -1331,7 +1331,7 @@ void QMenuBarPrivate::handleReparent()
//Note: if parent is reparented, then window may change even if parent doesn't.
// We need to install an avent filter on each parent up to the parent that is
// also a window (for shortcuts)
- QWidget *newWindow = newParent ? newParent->window() : Q_NULLPTR;
+ QWidget *newWindow = newParent ? newParent->window() : nullptr;
QVector<QPointer<QWidget> > newParents;
// Remove event filters on ex-parents, keep them on still-parents
@@ -1710,7 +1710,7 @@ void QMenuBarPrivate::_q_internalShortcutActivated(int id)
QAction *act = actions.at(id);
if (act && act->menu()) {
if (QPlatformMenu *platformMenu = act->menu()->platformMenu()) {
- platformMenu->showPopup(q->windowHandle(), actionRects.at(id), Q_NULLPTR);
+ platformMenu->showPopup(q->windowHandle(), actionRects.at(id), nullptr);
return;
}
}
diff --git a/src/widgets/widgets/qmenubar.h b/src/widgets/widgets/qmenubar.h
index be70f4ea48..4f8e3b8d53 100644
--- a/src/widgets/widgets/qmenubar.h
+++ b/src/widgets/widgets/qmenubar.h
@@ -60,7 +60,7 @@ class Q_WIDGETS_EXPORT QMenuBar : public QWidget
Q_PROPERTY(bool nativeMenuBar READ isNativeMenuBar WRITE setNativeMenuBar)
public:
- explicit QMenuBar(QWidget *parent = Q_NULLPTR);
+ explicit QMenuBar(QWidget *parent = nullptr);
~QMenuBar();
using QWidget::addAction;
diff --git a/src/widgets/widgets/qplaintextedit.cpp b/src/widgets/widgets/qplaintextedit.cpp
index 555b1f94ad..9f23169736 100644
--- a/src/widgets/widgets/qplaintextedit.cpp
+++ b/src/widgets/widgets/qplaintextedit.cpp
@@ -747,7 +747,8 @@ QPlainTextEditPrivate::QPlainTextEditPrivate()
tabChangesFocus(false),
lineWrap(QPlainTextEdit::WidgetWidth),
wordWrap(QTextOption::WrapAtWordBoundaryOrAnywhere),
- clickCausedFocus(0),topLine(0),topLineFracture(0),
+ clickCausedFocus(0), placeholderVisible(1),
+ topLine(0), topLineFracture(0),
pageUpDownLastCursorYIsValid(false)
{
showCursorOnInitialShow = true;
@@ -784,6 +785,7 @@ void QPlainTextEditPrivate::init(const QString &txt)
QObject::connect(control, SIGNAL(selectionChanged()), q, SIGNAL(selectionChanged()));
QObject::connect(control, SIGNAL(cursorPositionChanged()), q, SLOT(_q_cursorPositionChanged()));
+ QObject::connect(control, SIGNAL(textChanged()), q, SLOT(_q_textChanged()));
QObject::connect(control, SIGNAL(textChanged()), q, SLOT(updateMicroFocus()));
// set a null page size initially to avoid any relayouting until the textedit
@@ -816,6 +818,24 @@ void QPlainTextEditPrivate::init(const QString &txt)
#endif
}
+void QPlainTextEditPrivate::_q_textChanged()
+{
+ Q_Q(QPlainTextEdit);
+
+ // We normally only repaint the part of view that contains text in the
+ // document that has changed (in _q_repaintContents). But the placeholder
+ // text is not a part of the document, but is drawn on separately. So whenever
+ // we either show or hide the placeholder text, we issue a full update.
+ bool placeholderCurrentyVisible = placeholderVisible;
+
+ placeholderVisible = !placeholderText.isEmpty()
+ && q->document()->isEmpty()
+ && q->firstVisibleBlock().layout()->preeditAreaText().isEmpty();
+
+ if (placeholderCurrentyVisible != placeholderVisible)
+ viewport->update();
+}
+
void QPlainTextEditPrivate::_q_repaintContents(const QRectF &contentsRect)
{
Q_Q(QPlainTextEdit);
@@ -1881,6 +1901,7 @@ static void fillBackground(QPainter *p, const QRectF &rect, QBrush brush, const
*/
void QPlainTextEdit::paintEvent(QPaintEvent *e)
{
+ Q_D(QPlainTextEdit);
QPainter painter(viewport());
Q_ASSERT(qobject_cast<QPlainTextDocumentLayout*>(document()->documentLayout()));
@@ -1903,6 +1924,15 @@ void QPlainTextEdit::paintEvent(QPaintEvent *e)
er.setRight(qMin(er.right(), maxX));
painter.setClipRect(er);
+ if (d->placeholderVisible) {
+ QColor col = d->control->palette().text().color();
+ col.setAlpha(128);
+ painter.setPen(col);
+ painter.setClipRect(e->rect());
+ const int margin = int(document()->documentMargin());
+ QRectF textRect = viewportRect.adjusted(margin, margin, 0, 0);
+ painter.drawText(textRect, Qt::AlignTop | Qt::TextWordWrap, placeholderText());
+ }
QAbstractTextDocumentLayout::PaintContext context = getPaintContext();
@@ -1977,17 +2007,8 @@ void QPlainTextEdit::paintEvent(QPaintEvent *e)
}
}
+ layout->draw(&painter, offset, selections, er);
- if (!placeholderText().isEmpty() && document()->isEmpty() && layout->preeditAreaText().isEmpty()) {
- Q_D(QPlainTextEdit);
- QColor col = d->control->palette().text().color();
- col.setAlpha(128);
- painter.setPen(col);
- const int margin = int(document()->documentMargin());
- painter.drawText(r.adjusted(margin, 0, 0, 0), Qt::AlignTop | Qt::TextWordWrap, placeholderText());
- } else {
- layout->draw(&painter, offset, selections, er);
- }
if ((drawCursor && !drawCursorAsBlock)
|| (editable && context.cursorPosition < -1
&& !layout->preeditAreaText().isEmpty())) {
diff --git a/src/widgets/widgets/qplaintextedit.h b/src/widgets/widgets/qplaintextedit.h
index cd25b45d50..34ec96715e 100644
--- a/src/widgets/widgets/qplaintextedit.h
+++ b/src/widgets/widgets/qplaintextedit.h
@@ -91,8 +91,8 @@ public:
};
Q_ENUM(LineWrapMode)
- explicit QPlainTextEdit(QWidget *parent = Q_NULLPTR);
- explicit QPlainTextEdit(const QString &text, QWidget *parent = Q_NULLPTR);
+ explicit QPlainTextEdit(QWidget *parent = nullptr);
+ explicit QPlainTextEdit(const QString &text, QWidget *parent = nullptr);
virtual ~QPlainTextEdit();
void setDocument(QTextDocument *document);
@@ -191,7 +191,7 @@ public:
void print(QPagedPaintDevice *printer) const;
int blockCount() const;
- QVariant inputMethodQuery(Qt::InputMethodQuery property) const Q_DECL_OVERRIDE;
+ QVariant inputMethodQuery(Qt::InputMethodQuery property) const override;
Q_INVOKABLE QVariant inputMethodQuery(Qt::InputMethodQuery query, QVariant argument) const;
public Q_SLOTS:
@@ -233,43 +233,43 @@ Q_SIGNALS:
void modificationChanged(bool);
protected:
- virtual bool event(QEvent *e) Q_DECL_OVERRIDE;
- virtual void timerEvent(QTimerEvent *e) Q_DECL_OVERRIDE;
- virtual void keyPressEvent(QKeyEvent *e) Q_DECL_OVERRIDE;
- virtual void keyReleaseEvent(QKeyEvent *e) Q_DECL_OVERRIDE;
- virtual void resizeEvent(QResizeEvent *e) Q_DECL_OVERRIDE;
- virtual void paintEvent(QPaintEvent *e) Q_DECL_OVERRIDE;
- virtual void mousePressEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
- virtual void mouseMoveEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
- virtual void mouseReleaseEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
- virtual void mouseDoubleClickEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
- virtual bool focusNextPrevChild(bool next) Q_DECL_OVERRIDE;
+ virtual bool event(QEvent *e) override;
+ virtual void timerEvent(QTimerEvent *e) override;
+ virtual void keyPressEvent(QKeyEvent *e) override;
+ virtual void keyReleaseEvent(QKeyEvent *e) override;
+ virtual void resizeEvent(QResizeEvent *e) override;
+ virtual void paintEvent(QPaintEvent *e) override;
+ virtual void mousePressEvent(QMouseEvent *e) override;
+ virtual void mouseMoveEvent(QMouseEvent *e) override;
+ virtual void mouseReleaseEvent(QMouseEvent *e) override;
+ virtual void mouseDoubleClickEvent(QMouseEvent *e) override;
+ virtual bool focusNextPrevChild(bool next) override;
#ifndef QT_NO_CONTEXTMENU
- virtual void contextMenuEvent(QContextMenuEvent *e) Q_DECL_OVERRIDE;
+ virtual void contextMenuEvent(QContextMenuEvent *e) override;
#endif
#ifndef QT_NO_DRAGANDDROP
- virtual void dragEnterEvent(QDragEnterEvent *e) Q_DECL_OVERRIDE;
- virtual void dragLeaveEvent(QDragLeaveEvent *e) Q_DECL_OVERRIDE;
- virtual void dragMoveEvent(QDragMoveEvent *e) Q_DECL_OVERRIDE;
- virtual void dropEvent(QDropEvent *e) Q_DECL_OVERRIDE;
+ virtual void dragEnterEvent(QDragEnterEvent *e) override;
+ virtual void dragLeaveEvent(QDragLeaveEvent *e) override;
+ virtual void dragMoveEvent(QDragMoveEvent *e) override;
+ virtual void dropEvent(QDropEvent *e) override;
#endif
- virtual void focusInEvent(QFocusEvent *e) Q_DECL_OVERRIDE;
- virtual void focusOutEvent(QFocusEvent *e) Q_DECL_OVERRIDE;
- virtual void showEvent(QShowEvent *) Q_DECL_OVERRIDE;
- virtual void changeEvent(QEvent *e) Q_DECL_OVERRIDE;
+ virtual void focusInEvent(QFocusEvent *e) override;
+ virtual void focusOutEvent(QFocusEvent *e) override;
+ virtual void showEvent(QShowEvent *) override;
+ virtual void changeEvent(QEvent *e) override;
#if QT_CONFIG(wheelevent)
- virtual void wheelEvent(QWheelEvent *e) Q_DECL_OVERRIDE;
+ virtual void wheelEvent(QWheelEvent *e) override;
#endif
virtual QMimeData *createMimeDataFromSelection() const;
virtual bool canInsertFromMimeData(const QMimeData *source) const;
virtual void insertFromMimeData(const QMimeData *source);
- virtual void inputMethodEvent(QInputMethodEvent *) Q_DECL_OVERRIDE;
+ virtual void inputMethodEvent(QInputMethodEvent *) override;
QPlainTextEdit(QPlainTextEditPrivate &dd, QWidget *parent);
- virtual void scrollContentsBy(int dx, int dy) Q_DECL_OVERRIDE;
+ virtual void scrollContentsBy(int dx, int dy) override;
virtual void doSetTextCursor(const QTextCursor &cursor);
QTextBlock firstVisibleBlock() const;
@@ -283,6 +283,7 @@ protected:
private:
Q_DISABLE_COPY(QPlainTextEdit)
Q_PRIVATE_SLOT(d_func(), void _q_repaintContents(const QRectF &r))
+ Q_PRIVATE_SLOT(d_func(), void _q_textChanged())
Q_PRIVATE_SLOT(d_func(), void _q_adjustScrollbars())
Q_PRIVATE_SLOT(d_func(), void _q_verticalScrollbarActionTriggered(int))
Q_PRIVATE_SLOT(d_func(), void _q_cursorPositionChanged())
@@ -302,14 +303,14 @@ public:
QPlainTextDocumentLayout(QTextDocument *document);
~QPlainTextDocumentLayout();
- void draw(QPainter *, const PaintContext &) Q_DECL_OVERRIDE;
- int hitTest(const QPointF &, Qt::HitTestAccuracy ) const Q_DECL_OVERRIDE;
+ void draw(QPainter *, const PaintContext &) override;
+ int hitTest(const QPointF &, Qt::HitTestAccuracy ) const override;
- int pageCount() const Q_DECL_OVERRIDE;
- QSizeF documentSize() const Q_DECL_OVERRIDE;
+ int pageCount() const override;
+ QSizeF documentSize() const override;
- QRectF frameBoundingRect(QTextFrame *) const Q_DECL_OVERRIDE;
- QRectF blockBoundingRect(const QTextBlock &block) const Q_DECL_OVERRIDE;
+ QRectF frameBoundingRect(QTextFrame *) const override;
+ QRectF blockBoundingRect(const QTextBlock &block) const override;
void ensureBlockLayout(const QTextBlock &block) const;
@@ -319,7 +320,7 @@ public:
void requestUpdate();
protected:
- void documentChanged(int from, int /*charsRemoved*/, int charsAdded) Q_DECL_OVERRIDE;
+ void documentChanged(int from, int /*charsRemoved*/, int charsAdded) override;
private:
diff --git a/src/widgets/widgets/qplaintextedit_p.h b/src/widgets/widgets/qplaintextedit_p.h
index 3d6e7781ed..534f0d4681 100644
--- a/src/widgets/widgets/qplaintextedit_p.h
+++ b/src/widgets/widgets/qplaintextedit_p.h
@@ -84,19 +84,19 @@ public:
QPlainTextEditControl(QPlainTextEdit *parent);
- QMimeData *createMimeDataFromSelection() const Q_DECL_OVERRIDE;
- bool canInsertFromMimeData(const QMimeData *source) const Q_DECL_OVERRIDE;
- void insertFromMimeData(const QMimeData *source) Q_DECL_OVERRIDE;
- int hitTest(const QPointF &point, Qt::HitTestAccuracy = Qt::FuzzyHit) const Q_DECL_OVERRIDE;
- QRectF blockBoundingRect(const QTextBlock &block) const Q_DECL_OVERRIDE;
- QString anchorAt(const QPointF &pos) const Q_DECL_OVERRIDE;
+ QMimeData *createMimeDataFromSelection() const override;
+ bool canInsertFromMimeData(const QMimeData *source) const override;
+ void insertFromMimeData(const QMimeData *source) override;
+ int hitTest(const QPointF &point, Qt::HitTestAccuracy = Qt::FuzzyHit) const override;
+ QRectF blockBoundingRect(const QTextBlock &block) const override;
+ QString anchorAt(const QPointF &pos) const override;
inline QRectF cursorRect(const QTextCursor &cursor) const {
QRectF r = QWidgetTextControl::cursorRect(cursor);
r.setLeft(qMax(r.left(), (qreal) 0.));
return r;
}
inline QRectF cursorRect() { return cursorRect(textCursor()); }
- void ensureCursorVisible() Q_DECL_OVERRIDE {
+ void ensureCursorVisible() override {
textEdit->ensureCursorVisible();
emit microFocusChanged();
}
@@ -106,7 +106,7 @@ public:
int topBlock;
QTextBlock firstVisibleBlock() const;
- QVariant loadResource(int type, const QUrl &name) Q_DECL_OVERRIDE {
+ QVariant loadResource(int type, const QUrl &name) override {
return textEdit->loadResource(type, name);
}
@@ -121,6 +121,7 @@ public:
void init(const QString &txt = QString());
void _q_repaintContents(const QRectF &contentsRect);
+ void _q_textChanged();
inline QPoint mapToContents(const QPoint &point) const
{ return QPoint(point.x() + horizontalOffset(), point.y() + verticalOffset()); }
@@ -157,6 +158,7 @@ public:
uint centerOnScroll : 1;
uint inDrag : 1;
uint clickCausedFocus : 1;
+ uint placeholderVisible : 1;
int topLine;
qreal topLineFracture; // for non-int sized fonts
diff --git a/src/widgets/widgets/qprogressbar.h b/src/widgets/widgets/qprogressbar.h
index e0f5e9084b..ec9686068c 100644
--- a/src/widgets/widgets/qprogressbar.h
+++ b/src/widgets/widgets/qprogressbar.h
@@ -68,7 +68,7 @@ public:
enum Direction { TopToBottom, BottomToTop };
Q_ENUM(Direction)
- explicit QProgressBar(QWidget *parent = Q_NULLPTR);
+ explicit QProgressBar(QWidget *parent = nullptr);
~QProgressBar();
int minimum() const;
@@ -83,8 +83,8 @@ public:
Qt::Alignment alignment() const;
void setAlignment(Qt::Alignment alignment);
- QSize sizeHint() const Q_DECL_OVERRIDE;
- QSize minimumSizeHint() const Q_DECL_OVERRIDE;
+ QSize sizeHint() const override;
+ QSize minimumSizeHint() const override;
Qt::Orientation orientation() const;
@@ -109,8 +109,8 @@ Q_SIGNALS:
void valueChanged(int value);
protected:
- bool event(QEvent *e) Q_DECL_OVERRIDE;
- void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
+ bool event(QEvent *e) override;
+ void paintEvent(QPaintEvent *) override;
void initStyleOption(QStyleOptionProgressBar *option) const;
private:
diff --git a/src/widgets/widgets/qpushbutton.h b/src/widgets/widgets/qpushbutton.h
index c005f320cc..b02ba63d07 100644
--- a/src/widgets/widgets/qpushbutton.h
+++ b/src/widgets/widgets/qpushbutton.h
@@ -61,13 +61,13 @@ class Q_WIDGETS_EXPORT QPushButton : public QAbstractButton
Q_PROPERTY(bool flat READ isFlat WRITE setFlat)
public:
- explicit QPushButton(QWidget *parent = Q_NULLPTR);
- explicit QPushButton(const QString &text, QWidget *parent = Q_NULLPTR);
- QPushButton(const QIcon& icon, const QString &text, QWidget *parent = Q_NULLPTR);
+ explicit QPushButton(QWidget *parent = nullptr);
+ explicit QPushButton(const QString &text, QWidget *parent = nullptr);
+ QPushButton(const QIcon& icon, const QString &text, QWidget *parent = nullptr);
~QPushButton();
- QSize sizeHint() const Q_DECL_OVERRIDE;
- QSize minimumSizeHint() const Q_DECL_OVERRIDE;
+ QSize sizeHint() const override;
+ QSize minimumSizeHint() const override;
bool autoDefault() const;
void setAutoDefault(bool);
@@ -88,13 +88,13 @@ public Q_SLOTS:
#endif
protected:
- bool event(QEvent *e) Q_DECL_OVERRIDE;
- void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
- void keyPressEvent(QKeyEvent *) Q_DECL_OVERRIDE;
- void focusInEvent(QFocusEvent *) Q_DECL_OVERRIDE;
- void focusOutEvent(QFocusEvent *) Q_DECL_OVERRIDE;
+ bool event(QEvent *e) override;
+ void paintEvent(QPaintEvent *) override;
+ void keyPressEvent(QKeyEvent *) override;
+ void focusInEvent(QFocusEvent *) override;
+ void focusOutEvent(QFocusEvent *) override;
void initStyleOption(QStyleOptionButton *option) const;
- QPushButton(QPushButtonPrivate &dd, QWidget* parent = Q_NULLPTR);
+ QPushButton(QPushButtonPrivate &dd, QWidget* parent = nullptr);
public:
diff --git a/src/widgets/widgets/qradiobutton.h b/src/widgets/widgets/qradiobutton.h
index 137ae01380..c6b5ddce84 100644
--- a/src/widgets/widgets/qradiobutton.h
+++ b/src/widgets/widgets/qradiobutton.h
@@ -56,18 +56,18 @@ class Q_WIDGETS_EXPORT QRadioButton : public QAbstractButton
Q_OBJECT
public:
- explicit QRadioButton(QWidget *parent = Q_NULLPTR);
- explicit QRadioButton(const QString &text, QWidget *parent = Q_NULLPTR);
+ explicit QRadioButton(QWidget *parent = nullptr);
+ explicit QRadioButton(const QString &text, QWidget *parent = nullptr);
~QRadioButton();
- QSize sizeHint() const Q_DECL_OVERRIDE;
- QSize minimumSizeHint() const Q_DECL_OVERRIDE;
+ QSize sizeHint() const override;
+ QSize minimumSizeHint() const override;
protected:
- bool event(QEvent *e) Q_DECL_OVERRIDE;
- bool hitButton(const QPoint &) const Q_DECL_OVERRIDE;
- void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
- void mouseMoveEvent(QMouseEvent *) Q_DECL_OVERRIDE;
+ bool event(QEvent *e) override;
+ bool hitButton(const QPoint &) const override;
+ void paintEvent(QPaintEvent *) override;
+ void mouseMoveEvent(QMouseEvent *) override;
void initStyleOption(QStyleOptionButton *button) const;
diff --git a/src/widgets/widgets/qrubberband.h b/src/widgets/widgets/qrubberband.h
index a05eb0d543..c683c24a18 100644
--- a/src/widgets/widgets/qrubberband.h
+++ b/src/widgets/widgets/qrubberband.h
@@ -56,7 +56,7 @@ class Q_WIDGETS_EXPORT QRubberBand : public QWidget
public:
enum Shape { Line, Rectangle };
- explicit QRubberBand(Shape, QWidget * = Q_NULLPTR);
+ explicit QRubberBand(Shape, QWidget * = nullptr);
~QRubberBand();
Shape shape() const;
@@ -73,12 +73,12 @@ public:
{ resize(s.width(), s.height()); }
protected:
- bool event(QEvent *e) Q_DECL_OVERRIDE;
- void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
- void changeEvent(QEvent *) Q_DECL_OVERRIDE;
- void showEvent(QShowEvent *) Q_DECL_OVERRIDE;
- void resizeEvent(QResizeEvent *) Q_DECL_OVERRIDE;
- void moveEvent(QMoveEvent *) Q_DECL_OVERRIDE;
+ bool event(QEvent *e) override;
+ void paintEvent(QPaintEvent *) override;
+ void changeEvent(QEvent *) override;
+ void showEvent(QShowEvent *) override;
+ void resizeEvent(QResizeEvent *) override;
+ void moveEvent(QMoveEvent *) override;
void initStyleOption(QStyleOptionRubberBand *option) const;
private:
diff --git a/src/widgets/widgets/qscrollarea.h b/src/widgets/widgets/qscrollarea.h
index d38bced2f2..6d252821c5 100644
--- a/src/widgets/widgets/qscrollarea.h
+++ b/src/widgets/widgets/qscrollarea.h
@@ -56,7 +56,7 @@ class Q_WIDGETS_EXPORT QScrollArea : public QAbstractScrollArea
Q_PROPERTY(Qt::Alignment alignment READ alignment WRITE setAlignment)
public:
- explicit QScrollArea(QWidget *parent = Q_NULLPTR);
+ explicit QScrollArea(QWidget *parent = nullptr);
~QScrollArea();
QWidget *widget() const;
@@ -66,9 +66,9 @@ public:
bool widgetResizable() const;
void setWidgetResizable(bool resizable);
- QSize sizeHint() const Q_DECL_OVERRIDE;
+ QSize sizeHint() const override;
- bool focusNextPrevChild(bool next) Q_DECL_OVERRIDE;
+ bool focusNextPrevChild(bool next) override;
Qt::Alignment alignment() const;
void setAlignment(Qt::Alignment);
@@ -77,13 +77,13 @@ public:
void ensureWidgetVisible(QWidget *childWidget, int xmargin = 50, int ymargin = 50);
protected:
- QScrollArea(QScrollAreaPrivate &dd, QWidget *parent = Q_NULLPTR);
- bool event(QEvent *) Q_DECL_OVERRIDE;
- bool eventFilter(QObject *, QEvent *) Q_DECL_OVERRIDE;
- void resizeEvent(QResizeEvent *) Q_DECL_OVERRIDE;
- void scrollContentsBy(int dx, int dy) Q_DECL_OVERRIDE;
+ QScrollArea(QScrollAreaPrivate &dd, QWidget *parent = nullptr);
+ bool event(QEvent *) override;
+ bool eventFilter(QObject *, QEvent *) override;
+ void resizeEvent(QResizeEvent *) override;
+ void scrollContentsBy(int dx, int dy) override;
- QSize viewportSizeHint() const Q_DECL_OVERRIDE;
+ QSize viewportSizeHint() const override;
private:
Q_DECLARE_PRIVATE(QScrollArea)
diff --git a/src/widgets/widgets/qscrollbar.h b/src/widgets/widgets/qscrollbar.h
index 22b9bfcddb..171195fd24 100644
--- a/src/widgets/widgets/qscrollbar.h
+++ b/src/widgets/widgets/qscrollbar.h
@@ -56,25 +56,25 @@ class Q_WIDGETS_EXPORT QScrollBar : public QAbstractSlider
{
Q_OBJECT
public:
- explicit QScrollBar(QWidget *parent = Q_NULLPTR);
- explicit QScrollBar(Qt::Orientation, QWidget *parent = Q_NULLPTR);
+ explicit QScrollBar(QWidget *parent = nullptr);
+ explicit QScrollBar(Qt::Orientation, QWidget *parent = nullptr);
~QScrollBar();
- QSize sizeHint() const Q_DECL_OVERRIDE;
- bool event(QEvent *event) Q_DECL_OVERRIDE;
+ QSize sizeHint() const override;
+ bool event(QEvent *event) override;
protected:
#if QT_CONFIG(wheelevent)
- void wheelEvent(QWheelEvent *) Q_DECL_OVERRIDE;
+ void wheelEvent(QWheelEvent *) override;
#endif
- void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
- void mousePressEvent(QMouseEvent *) Q_DECL_OVERRIDE;
- void mouseReleaseEvent(QMouseEvent *) Q_DECL_OVERRIDE;
- void mouseMoveEvent(QMouseEvent *) Q_DECL_OVERRIDE;
- void hideEvent(QHideEvent*) Q_DECL_OVERRIDE;
- void sliderChange(SliderChange change) Q_DECL_OVERRIDE;
+ void paintEvent(QPaintEvent *) override;
+ void mousePressEvent(QMouseEvent *) override;
+ void mouseReleaseEvent(QMouseEvent *) override;
+ void mouseMoveEvent(QMouseEvent *) override;
+ void hideEvent(QHideEvent*) override;
+ void sliderChange(SliderChange change) override;
#ifndef QT_NO_CONTEXTMENU
- void contextMenuEvent(QContextMenuEvent *) Q_DECL_OVERRIDE;
+ void contextMenuEvent(QContextMenuEvent *) override;
#endif
void initStyleOption(QStyleOptionSlider *option) const;
diff --git a/src/widgets/widgets/qsizegrip.h b/src/widgets/widgets/qsizegrip.h
index 6ad2405339..5285ffdfb8 100644
--- a/src/widgets/widgets/qsizegrip.h
+++ b/src/widgets/widgets/qsizegrip.h
@@ -55,19 +55,19 @@ public:
explicit QSizeGrip(QWidget *parent);
~QSizeGrip();
- QSize sizeHint() const Q_DECL_OVERRIDE;
- void setVisible(bool) Q_DECL_OVERRIDE;
+ QSize sizeHint() const override;
+ void setVisible(bool) override;
protected:
- void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
- void mousePressEvent(QMouseEvent *) Q_DECL_OVERRIDE;
- void mouseMoveEvent(QMouseEvent *) Q_DECL_OVERRIDE;
- void mouseReleaseEvent(QMouseEvent *mouseEvent) Q_DECL_OVERRIDE;
- void moveEvent(QMoveEvent *moveEvent) Q_DECL_OVERRIDE;
- void showEvent(QShowEvent *showEvent) Q_DECL_OVERRIDE;
- void hideEvent(QHideEvent *hideEvent) Q_DECL_OVERRIDE;
- bool eventFilter(QObject *, QEvent *) Q_DECL_OVERRIDE;
- bool event(QEvent *) Q_DECL_OVERRIDE;
+ void paintEvent(QPaintEvent *) override;
+ void mousePressEvent(QMouseEvent *) override;
+ void mouseMoveEvent(QMouseEvent *) override;
+ void mouseReleaseEvent(QMouseEvent *mouseEvent) override;
+ void moveEvent(QMoveEvent *moveEvent) override;
+ void showEvent(QShowEvent *showEvent) override;
+ void hideEvent(QHideEvent *hideEvent) override;
+ bool eventFilter(QObject *, QEvent *) override;
+ bool event(QEvent *) override;
public:
diff --git a/src/widgets/widgets/qslider.h b/src/widgets/widgets/qslider.h
index 642e836af7..f74f9c8576 100644
--- a/src/widgets/widgets/qslider.h
+++ b/src/widgets/widgets/qslider.h
@@ -68,13 +68,13 @@ public:
};
Q_ENUM(TickPosition)
- explicit QSlider(QWidget *parent = Q_NULLPTR);
- explicit QSlider(Qt::Orientation orientation, QWidget *parent = Q_NULLPTR);
+ explicit QSlider(QWidget *parent = nullptr);
+ explicit QSlider(Qt::Orientation orientation, QWidget *parent = nullptr);
~QSlider();
- QSize sizeHint() const Q_DECL_OVERRIDE;
- QSize minimumSizeHint() const Q_DECL_OVERRIDE;
+ QSize sizeHint() const override;
+ QSize minimumSizeHint() const override;
void setTickPosition(TickPosition position);
TickPosition tickPosition() const;
@@ -82,13 +82,13 @@ public:
void setTickInterval(int ti);
int tickInterval() const;
- bool event(QEvent *event) Q_DECL_OVERRIDE;
+ bool event(QEvent *event) override;
protected:
- void paintEvent(QPaintEvent *ev) Q_DECL_OVERRIDE;
- void mousePressEvent(QMouseEvent *ev) Q_DECL_OVERRIDE;
- void mouseReleaseEvent(QMouseEvent *ev) Q_DECL_OVERRIDE;
- void mouseMoveEvent(QMouseEvent *ev) Q_DECL_OVERRIDE;
+ void paintEvent(QPaintEvent *ev) override;
+ void mousePressEvent(QMouseEvent *ev) override;
+ void mouseReleaseEvent(QMouseEvent *ev) override;
+ void mouseMoveEvent(QMouseEvent *ev) override;
void initStyleOption(QStyleOptionSlider *option) const;
diff --git a/src/widgets/widgets/qspinbox.cpp b/src/widgets/widgets/qspinbox.cpp
index b62a7768ce..561215ec85 100644
--- a/src/widgets/widgets/qspinbox.cpp
+++ b/src/widgets/widgets/qspinbox.cpp
@@ -61,10 +61,10 @@ class QSpinBoxPrivate : public QAbstractSpinBoxPrivate
Q_DECLARE_PUBLIC(QSpinBox)
public:
QSpinBoxPrivate();
- void emitSignals(EmitPolicy ep, const QVariant &) Q_DECL_OVERRIDE;
+ void emitSignals(EmitPolicy ep, const QVariant &) override;
- virtual QVariant valueFromText(const QString &n) const Q_DECL_OVERRIDE;
- virtual QString textFromValue(const QVariant &n) const Q_DECL_OVERRIDE;
+ virtual QVariant valueFromText(const QString &n) const override;
+ virtual QString textFromValue(const QVariant &n) const override;
QVariant validateAndInterpret(QString &input, int &pos,
QValidator::State &state) const;
@@ -82,10 +82,10 @@ class QDoubleSpinBoxPrivate : public QAbstractSpinBoxPrivate
Q_DECLARE_PUBLIC(QDoubleSpinBox)
public:
QDoubleSpinBoxPrivate();
- void emitSignals(EmitPolicy ep, const QVariant &) Q_DECL_OVERRIDE;
+ void emitSignals(EmitPolicy ep, const QVariant &) override;
- virtual QVariant valueFromText(const QString &n) const Q_DECL_OVERRIDE;
- virtual QString textFromValue(const QVariant &n) const Q_DECL_OVERRIDE;
+ virtual QVariant valueFromText(const QString &n) const override;
+ virtual QString textFromValue(const QVariant &n) const override;
QVariant validateAndInterpret(QString &input, int &pos,
QValidator::State &state) const;
double round(double input) const;
diff --git a/src/widgets/widgets/qspinbox.h b/src/widgets/widgets/qspinbox.h
index b61e665413..73489c9a68 100644
--- a/src/widgets/widgets/qspinbox.h
+++ b/src/widgets/widgets/qspinbox.h
@@ -62,7 +62,7 @@ class Q_WIDGETS_EXPORT QSpinBox : public QAbstractSpinBox
Q_PROPERTY(int displayIntegerBase READ displayIntegerBase WRITE setDisplayIntegerBase)
public:
- explicit QSpinBox(QWidget *parent = Q_NULLPTR);
+ explicit QSpinBox(QWidget *parent = nullptr);
~QSpinBox();
int value() const;
@@ -123,7 +123,7 @@ class Q_WIDGETS_EXPORT QDoubleSpinBox : public QAbstractSpinBox
Q_PROPERTY(double singleStep READ singleStep WRITE setSingleStep)
Q_PROPERTY(double value READ value WRITE setValue NOTIFY valueChanged USER true)
public:
- explicit QDoubleSpinBox(QWidget *parent = Q_NULLPTR);
+ explicit QDoubleSpinBox(QWidget *parent = nullptr);
~QDoubleSpinBox();
double value() const;
diff --git a/src/widgets/widgets/qsplashscreen.h b/src/widgets/widgets/qsplashscreen.h
index 1971b8bacf..8bdf4e7749 100644
--- a/src/widgets/widgets/qsplashscreen.h
+++ b/src/widgets/widgets/qsplashscreen.h
@@ -73,9 +73,9 @@ Q_SIGNALS:
void messageChanged(const QString &message);
protected:
- bool event(QEvent *e) Q_DECL_OVERRIDE;
+ bool event(QEvent *e) override;
virtual void drawContents(QPainter *painter);
- void mousePressEvent(QMouseEvent *) Q_DECL_OVERRIDE;
+ void mousePressEvent(QMouseEvent *) override;
private:
Q_DISABLE_COPY(QSplashScreen)
diff --git a/src/widgets/widgets/qsplitter.h b/src/widgets/widgets/qsplitter.h
index bc4d7bca39..16fac48d1c 100644
--- a/src/widgets/widgets/qsplitter.h
+++ b/src/widgets/widgets/qsplitter.h
@@ -64,8 +64,8 @@ class Q_WIDGETS_EXPORT QSplitter : public QFrame
Q_PROPERTY(bool childrenCollapsible READ childrenCollapsible WRITE setChildrenCollapsible)
public:
- explicit QSplitter(QWidget* parent = Q_NULLPTR);
- explicit QSplitter(Qt::Orientation, QWidget* parent = Q_NULLPTR);
+ explicit QSplitter(QWidget* parent = nullptr);
+ explicit QSplitter(Qt::Orientation, QWidget* parent = nullptr);
~QSplitter();
void addWidget(QWidget *widget);
@@ -84,8 +84,8 @@ public:
bool opaqueResize() const;
void refresh();
- QSize sizeHint() const Q_DECL_OVERRIDE;
- QSize minimumSizeHint() const Q_DECL_OVERRIDE;
+ QSize sizeHint() const override;
+ QSize minimumSizeHint() const override;
QList<int> sizes() const;
void setSizes(const QList<int> &list);
@@ -111,12 +111,12 @@ Q_SIGNALS:
protected:
virtual QSplitterHandle *createHandle();
- void childEvent(QChildEvent *) Q_DECL_OVERRIDE;
+ void childEvent(QChildEvent *) override;
- bool event(QEvent *) Q_DECL_OVERRIDE;
- void resizeEvent(QResizeEvent *) Q_DECL_OVERRIDE;
+ bool event(QEvent *) override;
+ void resizeEvent(QResizeEvent *) override;
- void changeEvent(QEvent *) Q_DECL_OVERRIDE;
+ void changeEvent(QEvent *) override;
void moveSplitter(int pos, int index);
void setRubberBand(int position);
int closestLegalPosition(int, int);
@@ -145,15 +145,15 @@ public:
bool opaqueResize() const;
QSplitter *splitter() const;
- QSize sizeHint() const Q_DECL_OVERRIDE;
+ QSize sizeHint() const override;
protected:
- void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
- void mouseMoveEvent(QMouseEvent *) Q_DECL_OVERRIDE;
- void mousePressEvent(QMouseEvent *) Q_DECL_OVERRIDE;
- void mouseReleaseEvent(QMouseEvent *) Q_DECL_OVERRIDE;
- void resizeEvent(QResizeEvent *) Q_DECL_OVERRIDE;
- bool event(QEvent *) Q_DECL_OVERRIDE;
+ void paintEvent(QPaintEvent *) override;
+ void mouseMoveEvent(QMouseEvent *) override;
+ void mousePressEvent(QMouseEvent *) override;
+ void mouseReleaseEvent(QMouseEvent *) override;
+ void resizeEvent(QResizeEvent *) override;
+ bool event(QEvent *) override;
void moveSplitter(int p);
int closestLegalPosition(int p);
diff --git a/src/widgets/widgets/qstackedwidget.h b/src/widgets/widgets/qstackedwidget.h
index 29df145b70..5508f905d4 100644
--- a/src/widgets/widgets/qstackedwidget.h
+++ b/src/widgets/widgets/qstackedwidget.h
@@ -56,7 +56,7 @@ class Q_WIDGETS_EXPORT QStackedWidget : public QFrame
Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex NOTIFY currentChanged)
Q_PROPERTY(int count READ count)
public:
- explicit QStackedWidget(QWidget *parent = Q_NULLPTR);
+ explicit QStackedWidget(QWidget *parent = nullptr);
~QStackedWidget();
int addWidget(QWidget *w);
@@ -79,7 +79,7 @@ Q_SIGNALS:
void widgetRemoved(int index);
protected:
- bool event(QEvent *e) Q_DECL_OVERRIDE;
+ bool event(QEvent *e) override;
private:
Q_DISABLE_COPY(QStackedWidget)
diff --git a/src/widgets/widgets/qstatusbar.h b/src/widgets/widgets/qstatusbar.h
index 9ac637931c..2492e8487f 100644
--- a/src/widgets/widgets/qstatusbar.h
+++ b/src/widgets/widgets/qstatusbar.h
@@ -56,7 +56,7 @@ class Q_WIDGETS_EXPORT QStatusBar: public QWidget
Q_PROPERTY(bool sizeGripEnabled READ isSizeGripEnabled WRITE setSizeGripEnabled)
public:
- explicit QStatusBar(QWidget *parent = Q_NULLPTR);
+ explicit QStatusBar(QWidget *parent = nullptr);
virtual ~QStatusBar();
void addWidget(QWidget *widget, int stretch = 0);
@@ -79,14 +79,14 @@ Q_SIGNALS:
void messageChanged(const QString &text);
protected:
- void showEvent(QShowEvent *) Q_DECL_OVERRIDE;
- void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
- void resizeEvent(QResizeEvent *) Q_DECL_OVERRIDE;
+ void showEvent(QShowEvent *) override;
+ void paintEvent(QPaintEvent *) override;
+ void resizeEvent(QResizeEvent *) override;
// ### Qt 6: consider making reformat() and hideOrShow() private
void reformat();
void hideOrShow();
- bool event(QEvent *) Q_DECL_OVERRIDE;
+ bool event(QEvent *) override;
private:
Q_DISABLE_COPY(QStatusBar)
diff --git a/src/widgets/widgets/qtabbar.h b/src/widgets/widgets/qtabbar.h
index ebcd1094ef..fc619355f0 100644
--- a/src/widgets/widgets/qtabbar.h
+++ b/src/widgets/widgets/qtabbar.h
@@ -71,7 +71,7 @@ class Q_WIDGETS_EXPORT QTabBar: public QWidget
Q_PROPERTY(bool changeCurrentOnDrag READ changeCurrentOnDrag WRITE setChangeCurrentOnDrag)
public:
- explicit QTabBar(QWidget *parent = Q_NULLPTR);
+ explicit QTabBar(QWidget *parent = nullptr);
~QTabBar();
enum Shape { RoundedNorth, RoundedSouth, RoundedWest, RoundedEast,
@@ -136,8 +136,8 @@ public:
int currentIndex() const;
int count() const;
- QSize sizeHint() const Q_DECL_OVERRIDE;
- QSize minimumSizeHint() const Q_DECL_OVERRIDE;
+ QSize sizeHint() const override;
+ QSize minimumSizeHint() const override;
void setDrawBase(bool drawTheBase);
bool drawBase() const;
@@ -194,20 +194,20 @@ protected:
virtual void tabRemoved(int index);
virtual void tabLayoutChange();
- bool event(QEvent *) Q_DECL_OVERRIDE;
- void resizeEvent(QResizeEvent *) Q_DECL_OVERRIDE;
- void showEvent(QShowEvent *) Q_DECL_OVERRIDE;
- void hideEvent(QHideEvent *) Q_DECL_OVERRIDE;
- void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
- void mousePressEvent (QMouseEvent *) Q_DECL_OVERRIDE;
- void mouseMoveEvent (QMouseEvent *) Q_DECL_OVERRIDE;
- void mouseReleaseEvent (QMouseEvent *) Q_DECL_OVERRIDE;
+ bool event(QEvent *) override;
+ void resizeEvent(QResizeEvent *) override;
+ void showEvent(QShowEvent *) override;
+ void hideEvent(QHideEvent *) override;
+ void paintEvent(QPaintEvent *) override;
+ void mousePressEvent (QMouseEvent *) override;
+ void mouseMoveEvent (QMouseEvent *) override;
+ void mouseReleaseEvent (QMouseEvent *) override;
#if QT_CONFIG(wheelevent)
- void wheelEvent(QWheelEvent *event) Q_DECL_OVERRIDE;
+ void wheelEvent(QWheelEvent *event) override;
#endif
- void keyPressEvent(QKeyEvent *) Q_DECL_OVERRIDE;
- void changeEvent(QEvent *) Q_DECL_OVERRIDE;
- void timerEvent(QTimerEvent *event) Q_DECL_OVERRIDE;
+ void keyPressEvent(QKeyEvent *) override;
+ void changeEvent(QEvent *) override;
+ void timerEvent(QTimerEvent *event) override;
void initStyleOption(QStyleOptionTab *option, int tabIndex) const;
#ifndef QT_NO_ACCESSIBILITY
diff --git a/src/widgets/widgets/qtabbar_p.h b/src/widgets/widgets/qtabbar_p.h
index 195ff79c5d..1092878f2c 100644
--- a/src/widgets/widgets/qtabbar_p.h
+++ b/src/widgets/widgets/qtabbar_p.h
@@ -71,11 +71,11 @@ QT_BEGIN_NAMESPACE
class QMovableTabWidget : public QWidget
{
public:
- explicit QMovableTabWidget(QWidget *parent = Q_NULLPTR);
+ explicit QMovableTabWidget(QWidget *parent = nullptr);
void setPixmap(const QPixmap &pixmap);
protected:
- void paintEvent(QPaintEvent *e) Q_DECL_OVERRIDE;
+ void paintEvent(QPaintEvent *e) override;
private:
QPixmap m_pixmap;
@@ -142,9 +142,9 @@ public:
TabBarAnimation(Tab *t, QTabBarPrivate *_priv) : tab(t), priv(_priv)
{ setEasingCurve(QEasingCurve::InOutQuad); }
- void updateCurrentValue(const QVariant &current) Q_DECL_OVERRIDE;
+ void updateCurrentValue(const QVariant &current) override;
- void updateState(State, State newState) Q_DECL_OVERRIDE;
+ void updateState(State, State newState) override;
private:
//these are needed for the callbacks
Tab *tab;
@@ -278,12 +278,12 @@ class CloseButton : public QAbstractButton
public:
explicit CloseButton(QWidget *parent = 0);
- QSize sizeHint() const Q_DECL_OVERRIDE;
- QSize minimumSizeHint() const Q_DECL_OVERRIDE
+ QSize sizeHint() const override;
+ QSize minimumSizeHint() const override
{ return sizeHint(); }
- void enterEvent(QEvent *event) Q_DECL_OVERRIDE;
- void leaveEvent(QEvent *event) Q_DECL_OVERRIDE;
- void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
+ void enterEvent(QEvent *event) override;
+ void leaveEvent(QEvent *event) override;
+ void paintEvent(QPaintEvent *event) override;
};
QT_END_NAMESPACE
diff --git a/src/widgets/widgets/qtabwidget.h b/src/widgets/widgets/qtabwidget.h
index b80fdba1fb..f55e71488b 100644
--- a/src/widgets/widgets/qtabwidget.h
+++ b/src/widgets/widgets/qtabwidget.h
@@ -68,7 +68,7 @@ class Q_WIDGETS_EXPORT QTabWidget : public QWidget
Q_PROPERTY(bool tabBarAutoHide READ tabBarAutoHide WRITE setTabBarAutoHide)
public:
- explicit QTabWidget(QWidget *parent = Q_NULLPTR);
+ explicit QTabWidget(QWidget *parent = nullptr);
~QTabWidget();
int addTab(QWidget *widget, const QString &);
@@ -120,10 +120,10 @@ public:
TabShape tabShape() const;
void setTabShape(TabShape s);
- QSize sizeHint() const Q_DECL_OVERRIDE;
- QSize minimumSizeHint() const Q_DECL_OVERRIDE;
- int heightForWidth(int width) const Q_DECL_OVERRIDE;
- bool hasHeightForWidth() const Q_DECL_OVERRIDE;
+ QSize sizeHint() const override;
+ QSize minimumSizeHint() const override;
+ int heightForWidth(int width) const override;
+ bool hasHeightForWidth() const override;
void setCornerWidget(QWidget * w, Qt::Corner corner = Qt::TopRightCorner);
QWidget * cornerWidget(Qt::Corner corner = Qt::TopRightCorner) const;
@@ -161,13 +161,13 @@ protected:
virtual void tabInserted(int index);
virtual void tabRemoved(int index);
- void showEvent(QShowEvent *) Q_DECL_OVERRIDE;
- void resizeEvent(QResizeEvent *) Q_DECL_OVERRIDE;
- void keyPressEvent(QKeyEvent *) Q_DECL_OVERRIDE;
- void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
+ void showEvent(QShowEvent *) override;
+ void resizeEvent(QResizeEvent *) override;
+ void keyPressEvent(QKeyEvent *) override;
+ void paintEvent(QPaintEvent *) override;
void setTabBar(QTabBar *);
- void changeEvent(QEvent *) Q_DECL_OVERRIDE;
- bool event(QEvent *) Q_DECL_OVERRIDE;
+ void changeEvent(QEvent *) override;
+ bool event(QEvent *) override;
void initStyleOption(QStyleOptionTabWidgetFrame *option) const;
diff --git a/src/widgets/widgets/qtextbrowser.cpp b/src/widgets/widgets/qtextbrowser.cpp
index 0797120960..fa4dd14c92 100644
--- a/src/widgets/widgets/qtextbrowser.cpp
+++ b/src/widgets/widgets/qtextbrowser.cpp
@@ -135,7 +135,7 @@ public:
void setSource(const QUrl &url);
// re-imlemented from QTextEditPrivate
- virtual QUrl resolveUrl(const QUrl &url) const Q_DECL_OVERRIDE;
+ virtual QUrl resolveUrl(const QUrl &url) const override;
inline QUrl resolveUrl(const QString &url) const
{ return resolveUrl(QUrl(url)); }
diff --git a/src/widgets/widgets/qtextbrowser.h b/src/widgets/widgets/qtextbrowser.h
index f36c86bc86..ea81256f50 100644
--- a/src/widgets/widgets/qtextbrowser.h
+++ b/src/widgets/widgets/qtextbrowser.h
@@ -63,7 +63,7 @@ class Q_WIDGETS_EXPORT QTextBrowser : public QTextEdit
Q_PROPERTY(bool openLinks READ openLinks WRITE setOpenLinks)
public:
- explicit QTextBrowser(QWidget* parent = Q_NULLPTR);
+ explicit QTextBrowser(QWidget* parent = nullptr);
virtual ~QTextBrowser();
QUrl source() const;
@@ -71,7 +71,7 @@ public:
QStringList searchPaths() const;
void setSearchPaths(const QStringList &paths);
- virtual QVariant loadResource(int type, const QUrl &name) Q_DECL_OVERRIDE;
+ virtual QVariant loadResource(int type, const QUrl &name) override;
bool isBackwardAvailable() const;
bool isForwardAvailable() const;
@@ -104,14 +104,14 @@ Q_SIGNALS:
void anchorClicked(const QUrl &);
protected:
- bool event(QEvent *e) Q_DECL_OVERRIDE;
- virtual void keyPressEvent(QKeyEvent *ev) Q_DECL_OVERRIDE;
- virtual void mouseMoveEvent(QMouseEvent *ev) Q_DECL_OVERRIDE;
- virtual void mousePressEvent(QMouseEvent *ev) Q_DECL_OVERRIDE;
- virtual void mouseReleaseEvent(QMouseEvent *ev) Q_DECL_OVERRIDE;
- virtual void focusOutEvent(QFocusEvent *ev) Q_DECL_OVERRIDE;
- virtual bool focusNextPrevChild(bool next) Q_DECL_OVERRIDE;
- virtual void paintEvent(QPaintEvent *e) Q_DECL_OVERRIDE;
+ bool event(QEvent *e) override;
+ virtual void keyPressEvent(QKeyEvent *ev) override;
+ virtual void mouseMoveEvent(QMouseEvent *ev) override;
+ virtual void mousePressEvent(QMouseEvent *ev) override;
+ virtual void mouseReleaseEvent(QMouseEvent *ev) override;
+ virtual void focusOutEvent(QFocusEvent *ev) override;
+ virtual bool focusNextPrevChild(bool next) override;
+ virtual void paintEvent(QPaintEvent *e) override;
private:
Q_DISABLE_COPY(QTextBrowser)
diff --git a/src/widgets/widgets/qtextedit.cpp b/src/widgets/widgets/qtextedit.cpp
index df8ecba112..95c85dc4fe 100644
--- a/src/widgets/widgets/qtextedit.cpp
+++ b/src/widgets/widgets/qtextedit.cpp
@@ -84,19 +84,19 @@ class QTextEditControl : public QWidgetTextControl
public:
inline QTextEditControl(QObject *parent) : QWidgetTextControl(parent) {}
- virtual QMimeData *createMimeDataFromSelection() const Q_DECL_OVERRIDE {
+ virtual QMimeData *createMimeDataFromSelection() const override {
QTextEdit *ed = qobject_cast<QTextEdit *>(parent());
if (!ed)
return QWidgetTextControl::createMimeDataFromSelection();
return ed->createMimeDataFromSelection();
}
- virtual bool canInsertFromMimeData(const QMimeData *source) const Q_DECL_OVERRIDE {
+ virtual bool canInsertFromMimeData(const QMimeData *source) const override {
QTextEdit *ed = qobject_cast<QTextEdit *>(parent());
if (!ed)
return QWidgetTextControl::canInsertFromMimeData(source);
return ed->canInsertFromMimeData(source);
}
- virtual void insertFromMimeData(const QMimeData *source) Q_DECL_OVERRIDE {
+ virtual void insertFromMimeData(const QMimeData *source) override {
QTextEdit *ed = qobject_cast<QTextEdit *>(parent());
if (!ed)
QWidgetTextControl::insertFromMimeData(source);
diff --git a/src/widgets/widgets/qtextedit.h b/src/widgets/widgets/qtextedit.h
index 954f0167ae..9e0913160d 100644
--- a/src/widgets/widgets/qtextedit.h
+++ b/src/widgets/widgets/qtextedit.h
@@ -102,8 +102,8 @@ public:
Q_DECLARE_FLAGS(AutoFormatting, AutoFormattingFlag)
Q_FLAG(AutoFormatting)
- explicit QTextEdit(QWidget *parent = Q_NULLPTR);
- explicit QTextEdit(const QString &text, QWidget *parent = Q_NULLPTR);
+ explicit QTextEdit(QWidget *parent = nullptr);
+ explicit QTextEdit(const QString &text, QWidget *parent = nullptr);
virtual ~QTextEdit();
void setDocument(QTextDocument *document);
@@ -216,7 +216,7 @@ public:
void print(QPagedPaintDevice *printer) const;
- QVariant inputMethodQuery(Qt::InputMethodQuery property) const Q_DECL_OVERRIDE;
+ QVariant inputMethodQuery(Qt::InputMethodQuery property) const override;
Q_INVOKABLE QVariant inputMethodQuery(Qt::InputMethodQuery query, QVariant argument) const;
public Q_SLOTS:
@@ -270,43 +270,43 @@ Q_SIGNALS:
void cursorPositionChanged();
protected:
- virtual bool event(QEvent *e) Q_DECL_OVERRIDE;
- virtual void timerEvent(QTimerEvent *e) Q_DECL_OVERRIDE;
- virtual void keyPressEvent(QKeyEvent *e) Q_DECL_OVERRIDE;
- virtual void keyReleaseEvent(QKeyEvent *e) Q_DECL_OVERRIDE;
- virtual void resizeEvent(QResizeEvent *e) Q_DECL_OVERRIDE;
- virtual void paintEvent(QPaintEvent *e) Q_DECL_OVERRIDE;
- virtual void mousePressEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
- virtual void mouseMoveEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
- virtual void mouseReleaseEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
- virtual void mouseDoubleClickEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
- virtual bool focusNextPrevChild(bool next) Q_DECL_OVERRIDE;
+ virtual bool event(QEvent *e) override;
+ virtual void timerEvent(QTimerEvent *e) override;
+ virtual void keyPressEvent(QKeyEvent *e) override;
+ virtual void keyReleaseEvent(QKeyEvent *e) override;
+ virtual void resizeEvent(QResizeEvent *e) override;
+ virtual void paintEvent(QPaintEvent *e) override;
+ virtual void mousePressEvent(QMouseEvent *e) override;
+ virtual void mouseMoveEvent(QMouseEvent *e) override;
+ virtual void mouseReleaseEvent(QMouseEvent *e) override;
+ virtual void mouseDoubleClickEvent(QMouseEvent *e) override;
+ virtual bool focusNextPrevChild(bool next) override;
#ifndef QT_NO_CONTEXTMENU
- virtual void contextMenuEvent(QContextMenuEvent *e) Q_DECL_OVERRIDE;
+ virtual void contextMenuEvent(QContextMenuEvent *e) override;
#endif
#ifndef QT_NO_DRAGANDDROP
- virtual void dragEnterEvent(QDragEnterEvent *e) Q_DECL_OVERRIDE;
- virtual void dragLeaveEvent(QDragLeaveEvent *e) Q_DECL_OVERRIDE;
- virtual void dragMoveEvent(QDragMoveEvent *e) Q_DECL_OVERRIDE;
- virtual void dropEvent(QDropEvent *e) Q_DECL_OVERRIDE;
+ virtual void dragEnterEvent(QDragEnterEvent *e) override;
+ virtual void dragLeaveEvent(QDragLeaveEvent *e) override;
+ virtual void dragMoveEvent(QDragMoveEvent *e) override;
+ virtual void dropEvent(QDropEvent *e) override;
#endif
- virtual void focusInEvent(QFocusEvent *e) Q_DECL_OVERRIDE;
- virtual void focusOutEvent(QFocusEvent *e) Q_DECL_OVERRIDE;
- virtual void showEvent(QShowEvent *) Q_DECL_OVERRIDE;
- virtual void changeEvent(QEvent *e) Q_DECL_OVERRIDE;
+ virtual void focusInEvent(QFocusEvent *e) override;
+ virtual void focusOutEvent(QFocusEvent *e) override;
+ virtual void showEvent(QShowEvent *) override;
+ virtual void changeEvent(QEvent *e) override;
#if QT_CONFIG(wheelevent)
- virtual void wheelEvent(QWheelEvent *e) Q_DECL_OVERRIDE;
+ virtual void wheelEvent(QWheelEvent *e) override;
#endif
virtual QMimeData *createMimeDataFromSelection() const;
virtual bool canInsertFromMimeData(const QMimeData *source) const;
virtual void insertFromMimeData(const QMimeData *source);
- virtual void inputMethodEvent(QInputMethodEvent *) Q_DECL_OVERRIDE;
+ virtual void inputMethodEvent(QInputMethodEvent *) override;
QTextEdit(QTextEditPrivate &dd, QWidget *parent);
- virtual void scrollContentsBy(int dx, int dy) Q_DECL_OVERRIDE;
+ virtual void scrollContentsBy(int dx, int dy) override;
virtual void doSetTextCursor(const QTextCursor &cursor);
void zoomInF(float range);
diff --git a/src/widgets/widgets/qtoolbar.h b/src/widgets/widgets/qtoolbar.h
index 9ffb472c76..0253541a2e 100644
--- a/src/widgets/widgets/qtoolbar.h
+++ b/src/widgets/widgets/qtoolbar.h
@@ -76,8 +76,8 @@ class Q_WIDGETS_EXPORT QToolBar : public QWidget
Q_PROPERTY(bool floatable READ isFloatable WRITE setFloatable)
public:
- explicit QToolBar(const QString &title, QWidget *parent = Q_NULLPTR);
- explicit QToolBar(QWidget *parent = Q_NULLPTR);
+ explicit QToolBar(const QString &title, QWidget *parent = nullptr);
+ explicit QToolBar(QWidget *parent = nullptr);
~QToolBar();
void setMovable(bool movable);
@@ -188,10 +188,10 @@ Q_SIGNALS:
void visibilityChanged(bool visible);
protected:
- void actionEvent(QActionEvent *event) Q_DECL_OVERRIDE;
- void changeEvent(QEvent *event) Q_DECL_OVERRIDE;
- void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
- bool event(QEvent *event) Q_DECL_OVERRIDE;
+ void actionEvent(QActionEvent *event) override;
+ void changeEvent(QEvent *event) override;
+ void paintEvent(QPaintEvent *event) override;
+ bool event(QEvent *event) override;
void initStyleOption(QStyleOptionToolBar *option) const;
diff --git a/src/widgets/widgets/qtoolbarextension_p.h b/src/widgets/widgets/qtoolbarextension_p.h
index b6223107c4..a388f1e40f 100644
--- a/src/widgets/widgets/qtoolbarextension_p.h
+++ b/src/widgets/widgets/qtoolbarextension_p.h
@@ -64,8 +64,8 @@ class Q_AUTOTEST_EXPORT QToolBarExtension : public QToolButton
public:
explicit QToolBarExtension(QWidget *parent);
- void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
- QSize sizeHint() const Q_DECL_OVERRIDE;
+ void paintEvent(QPaintEvent *) override;
+ QSize sizeHint() const override;
public Q_SLOTS:
void setOrientation(Qt::Orientation o);
diff --git a/src/widgets/widgets/qtoolbarlayout_p.h b/src/widgets/widgets/qtoolbarlayout_p.h
index 9a81c4e50e..8c60164439 100644
--- a/src/widgets/widgets/qtoolbarlayout_p.h
+++ b/src/widgets/widgets/qtoolbarlayout_p.h
@@ -68,7 +68,7 @@ class QToolBarItem : public QWidgetItem
{
public:
QToolBarItem(QWidget *widget);
- bool isEmpty() const Q_DECL_OVERRIDE;
+ bool isEmpty() const override;
QAction *action;
bool customWidget;
@@ -82,22 +82,22 @@ public:
QToolBarLayout(QWidget *parent = 0);
~QToolBarLayout();
- void addItem(QLayoutItem *item) Q_DECL_OVERRIDE;
- QLayoutItem *itemAt(int index) const Q_DECL_OVERRIDE;
- QLayoutItem *takeAt(int index) Q_DECL_OVERRIDE;
- int count() const Q_DECL_OVERRIDE;
+ void addItem(QLayoutItem *item) override;
+ QLayoutItem *itemAt(int index) const override;
+ QLayoutItem *takeAt(int index) override;
+ int count() const override;
- bool isEmpty() const Q_DECL_OVERRIDE;
- void invalidate() Q_DECL_OVERRIDE;
- Qt::Orientations expandingDirections() const Q_DECL_OVERRIDE;
+ bool isEmpty() const override;
+ void invalidate() override;
+ Qt::Orientations expandingDirections() const override;
- void setGeometry(const QRect &r) Q_DECL_OVERRIDE;
- QSize minimumSize() const Q_DECL_OVERRIDE;
- QSize sizeHint() const Q_DECL_OVERRIDE;
+ void setGeometry(const QRect &r) override;
+ QSize minimumSize() const override;
+ QSize sizeHint() const override;
void insertAction(int index, QAction *action);
int indexOf(QAction *action) const;
- int indexOf(QWidget *widget) const Q_DECL_OVERRIDE { return QLayout::indexOf(widget); }
+ int indexOf(QWidget *widget) const override { return QLayout::indexOf(widget); }
bool layoutActions(const QSize &size);
QSize expandedSize(const QSize &size) const;
diff --git a/src/widgets/widgets/qtoolbarseparator_p.h b/src/widgets/widgets/qtoolbarseparator_p.h
index 8c9cf9f46a..d52b4fa6ae 100644
--- a/src/widgets/widgets/qtoolbarseparator_p.h
+++ b/src/widgets/widgets/qtoolbarseparator_p.h
@@ -71,9 +71,9 @@ public:
Qt::Orientation orientation() const;
- QSize sizeHint() const Q_DECL_OVERRIDE;
+ QSize sizeHint() const override;
- void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
+ void paintEvent(QPaintEvent *) override;
void initStyleOption(QStyleOption *option) const;
public Q_SLOTS:
diff --git a/src/widgets/widgets/qtoolbox.cpp b/src/widgets/widgets/qtoolbox.cpp
index fdcd07eb06..46ade0277c 100644
--- a/src/widgets/widgets/qtoolbox.cpp
+++ b/src/widgets/widgets/qtoolbox.cpp
@@ -69,12 +69,12 @@ public:
inline void setSelected(bool b) { selected = b; update(); }
inline void setIndex(int newIndex) { indexInPage = newIndex; }
- QSize sizeHint() const Q_DECL_OVERRIDE;
- QSize minimumSizeHint() const Q_DECL_OVERRIDE;
+ QSize sizeHint() const override;
+ QSize minimumSizeHint() const override;
protected:
void initStyleOption(QStyleOptionToolBox *opt) const;
- void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
+ void paintEvent(QPaintEvent *) override;
private:
bool selected;
diff --git a/src/widgets/widgets/qtoolbox.h b/src/widgets/widgets/qtoolbox.h
index 321507ba07..2796631b94 100644
--- a/src/widgets/widgets/qtoolbox.h
+++ b/src/widgets/widgets/qtoolbox.h
@@ -57,7 +57,7 @@ class Q_WIDGETS_EXPORT QToolBox : public QFrame
Q_PROPERTY(int count READ count)
public:
- explicit QToolBox(QWidget *parent = Q_NULLPTR, Qt::WindowFlags f = Qt::WindowFlags());
+ explicit QToolBox(QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags());
~QToolBox();
int addItem(QWidget *widget, const QString &text);
@@ -95,11 +95,11 @@ Q_SIGNALS:
void currentChanged(int index);
protected:
- bool event(QEvent *e) Q_DECL_OVERRIDE;
+ bool event(QEvent *e) override;
virtual void itemInserted(int index);
virtual void itemRemoved(int index);
- void showEvent(QShowEvent *e) Q_DECL_OVERRIDE;
- void changeEvent(QEvent *) Q_DECL_OVERRIDE;
+ void showEvent(QShowEvent *e) override;
+ void changeEvent(QEvent *) override;
private:
diff --git a/src/widgets/widgets/qtoolbutton.h b/src/widgets/widgets/qtoolbutton.h
index dd9964cb94..52bd2d5f7a 100644
--- a/src/widgets/widgets/qtoolbutton.h
+++ b/src/widgets/widgets/qtoolbutton.h
@@ -71,11 +71,11 @@ public:
};
Q_ENUM(ToolButtonPopupMode)
- explicit QToolButton(QWidget *parent = Q_NULLPTR);
+ explicit QToolButton(QWidget *parent = nullptr);
~QToolButton();
- QSize sizeHint() const Q_DECL_OVERRIDE;
- QSize minimumSizeHint() const Q_DECL_OVERRIDE;
+ QSize sizeHint() const override;
+ QSize minimumSizeHint() const override;
Qt::ToolButtonStyle toolButtonStyle() const;
@@ -106,19 +106,19 @@ Q_SIGNALS:
void triggered(QAction *);
protected:
- bool event(QEvent *e) Q_DECL_OVERRIDE;
- void mousePressEvent(QMouseEvent *) Q_DECL_OVERRIDE;
- void mouseReleaseEvent(QMouseEvent *) Q_DECL_OVERRIDE;
- void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
- void actionEvent(QActionEvent *) Q_DECL_OVERRIDE;
-
- void enterEvent(QEvent *) Q_DECL_OVERRIDE;
- void leaveEvent(QEvent *) Q_DECL_OVERRIDE;
- void timerEvent(QTimerEvent *) Q_DECL_OVERRIDE;
- void changeEvent(QEvent *) Q_DECL_OVERRIDE;
-
- bool hitButton(const QPoint &pos) const Q_DECL_OVERRIDE;
- void nextCheckState() Q_DECL_OVERRIDE;
+ bool event(QEvent *e) override;
+ void mousePressEvent(QMouseEvent *) override;
+ void mouseReleaseEvent(QMouseEvent *) override;
+ void paintEvent(QPaintEvent *) override;
+ void actionEvent(QActionEvent *) override;
+
+ void enterEvent(QEvent *) override;
+ void leaveEvent(QEvent *) override;
+ void timerEvent(QTimerEvent *) override;
+ void changeEvent(QEvent *) override;
+
+ bool hitButton(const QPoint &pos) const override;
+ void nextCheckState() override;
void initStyleOption(QStyleOptionToolButton *option) const;
private:
diff --git a/src/widgets/widgets/qwidgetlinecontrol_p.h b/src/widgets/widgets/qwidgetlinecontrol_p.h
index 16c9cc71eb..16eb337416 100644
--- a/src/widgets/widgets/qwidgetlinecontrol_p.h
+++ b/src/widgets/widgets/qwidgetlinecontrol_p.h
@@ -550,7 +550,7 @@ Q_SIGNALS:
void editFocusChange(bool);
#endif
protected:
- virtual void timerEvent(QTimerEvent *event) Q_DECL_OVERRIDE;
+ virtual void timerEvent(QTimerEvent *event) override;
private Q_SLOTS:
void _q_deleteSelected();
diff --git a/src/widgets/widgets/qwidgetresizehandler_p.h b/src/widgets/widgets/qwidgetresizehandler_p.h
index 669cb6f256..b87bbd6229 100644
--- a/src/widgets/widgets/qwidgetresizehandler_p.h
+++ b/src/widgets/widgets/qwidgetresizehandler_p.h
@@ -95,7 +95,7 @@ Q_SIGNALS:
void activate();
protected:
- bool eventFilter(QObject *o, QEvent *e) Q_DECL_OVERRIDE;
+ bool eventFilter(QObject *o, QEvent *e) override;
void mouseMoveEvent(QMouseEvent *e);
void keyPressEvent(QKeyEvent *e);
diff --git a/src/widgets/widgets/qwidgettextcontrol.cpp b/src/widgets/widgets/qwidgettextcontrol.cpp
index aa5a3329e9..5712ea6151 100644
--- a/src/widgets/widgets/qwidgettextcontrol.cpp
+++ b/src/widgets/widgets/qwidgettextcontrol.cpp
@@ -1887,8 +1887,6 @@ void QWidgetTextControlPrivate::contextMenuEvent(const QPoint &screenPos, const
Q_UNUSED(contextWidget);
#else
Q_Q(QWidgetTextControl);
- if (!hasFocus)
- return;
QMenu *menu = q->createStandardContextMenu(docPos, contextWidget);
if (!menu)
return;
diff --git a/src/widgets/widgets/qwidgettextcontrol_p.h b/src/widgets/widgets/qwidgettextcontrol_p.h
index 11ff63c5e4..4b2acbd934 100644
--- a/src/widgets/widgets/qwidgettextcontrol_p.h
+++ b/src/widgets/widgets/qwidgettextcontrol_p.h
@@ -258,9 +258,9 @@ public:
bool findNextPrevAnchor(const QTextCursor& from, bool next, QTextCursor& newAnchor);
protected:
- virtual void timerEvent(QTimerEvent *e) Q_DECL_OVERRIDE;
+ virtual void timerEvent(QTimerEvent *e) override;
- virtual bool event(QEvent *e) Q_DECL_OVERRIDE;
+ virtual bool event(QEvent *e) override;
private:
Q_DISABLE_COPY(QWidgetTextControl)
@@ -296,9 +296,9 @@ class QTextEditMimeData : public QMimeData
public:
inline QTextEditMimeData(const QTextDocumentFragment &aFragment) : fragment(aFragment) {}
- virtual QStringList formats() const Q_DECL_OVERRIDE;
+ virtual QStringList formats() const override;
protected:
- virtual QVariant retrieveData(const QString &mimeType, QVariant::Type type) const Q_DECL_OVERRIDE;
+ virtual QVariant retrieveData(const QString &mimeType, QVariant::Type type) const override;
private:
void setup() const;
diff --git a/src/winmain/qtmain_win.cpp b/src/winmain/qtmain_win.cpp
index 5f90055762..3dc1ac0fba 100644
--- a/src/winmain/qtmain_win.cpp
+++ b/src/winmain/qtmain_win.cpp
@@ -99,7 +99,7 @@ extern "C" int APIENTRY WinMain(HINSTANCE, HINSTANCE, LPSTR /*cmdParamarg*/, int
char **argv = new char *[argc + 1];
for (int i = 0; i < argc; ++i)
argv[i] = wideToMulti(CP_ACP, argvW[i]);
- argv[argc] = Q_NULLPTR;
+ argv[argc] = nullptr;
LocalFree(argvW);
const int exitCode = main(argc, argv);
for (int i = 0; i < argc && argv[i]; ++i)
diff --git a/src/winmain/qtmain_winrt.cpp b/src/winmain/qtmain_winrt.cpp
index 13ca561d35..1f5b98794d 100644
--- a/src/winmain/qtmain_winrt.cpp
+++ b/src/winmain/qtmain_winrt.cpp
@@ -229,12 +229,12 @@ private:
return S_OK;
}
- HRESULT __stdcall OnActivated(IActivatedEventArgs *args) Q_DECL_OVERRIDE
+ HRESULT __stdcall OnActivated(IActivatedEventArgs *args) override
{
return activatedLaunch(args);
}
- HRESULT __stdcall OnLaunched(ILaunchActivatedEventArgs *launchArgs) Q_DECL_OVERRIDE
+ HRESULT __stdcall OnLaunched(ILaunchActivatedEventArgs *launchArgs) override
{
ComPtr<IPrelaunchActivatedEventArgs> preArgs;
HRESULT hr = launchArgs->QueryInterface(preArgs.GetAddressOf());
@@ -324,41 +324,41 @@ private:
return S_OK;
}
- HRESULT __stdcall OnFileActivated(IFileActivatedEventArgs *args) Q_DECL_OVERRIDE
+ HRESULT __stdcall OnFileActivated(IFileActivatedEventArgs *args) override
{
return activatedLaunch(args);
}
- HRESULT __stdcall OnSearchActivated(ISearchActivatedEventArgs *args) Q_DECL_OVERRIDE
+ HRESULT __stdcall OnSearchActivated(ISearchActivatedEventArgs *args) override
{
Q_UNUSED(args);
return S_OK;
}
- HRESULT __stdcall OnShareTargetActivated(IShareTargetActivatedEventArgs *args) Q_DECL_OVERRIDE
+ HRESULT __stdcall OnShareTargetActivated(IShareTargetActivatedEventArgs *args) override
{
return activatedLaunch(args);
}
- HRESULT __stdcall OnFileOpenPickerActivated(IFileOpenPickerActivatedEventArgs *args) Q_DECL_OVERRIDE
+ HRESULT __stdcall OnFileOpenPickerActivated(IFileOpenPickerActivatedEventArgs *args) override
{
Q_UNUSED(args);
return S_OK;
}
- HRESULT __stdcall OnFileSavePickerActivated(IFileSavePickerActivatedEventArgs *args) Q_DECL_OVERRIDE
+ HRESULT __stdcall OnFileSavePickerActivated(IFileSavePickerActivatedEventArgs *args) override
{
Q_UNUSED(args);
return S_OK;
}
- HRESULT __stdcall OnCachedFileUpdaterActivated(ICachedFileUpdaterActivatedEventArgs *args) Q_DECL_OVERRIDE
+ HRESULT __stdcall OnCachedFileUpdaterActivated(ICachedFileUpdaterActivatedEventArgs *args) override
{
Q_UNUSED(args);
return S_OK;
}
- HRESULT __stdcall OnWindowCreated(Xaml::IWindowCreatedEventArgs *args) Q_DECL_OVERRIDE
+ HRESULT __stdcall OnWindowCreated(Xaml::IWindowCreatedEventArgs *args) override
{
Q_UNUSED(args);
return S_OK;
diff --git a/src/xml/dom/qdom.cpp b/src/xml/dom/qdom.cpp
index 9affd697a0..df2d7c3ce8 100644
--- a/src/xml/dom/qdom.cpp
+++ b/src/xml/dom/qdom.cpp
@@ -291,16 +291,16 @@ public:
void init();
// Reimplemented from QDomNodePrivate
- QDomNodePrivate* cloneNode(bool deep = true) Q_DECL_OVERRIDE;
- QDomNodePrivate* insertBefore(QDomNodePrivate* newChild, QDomNodePrivate* refChild) Q_DECL_OVERRIDE;
- QDomNodePrivate* insertAfter(QDomNodePrivate* newChild, QDomNodePrivate* refChild) Q_DECL_OVERRIDE;
- QDomNodePrivate* replaceChild(QDomNodePrivate* newChild, QDomNodePrivate* oldChild) Q_DECL_OVERRIDE;
- QDomNodePrivate* removeChild(QDomNodePrivate* oldChild) Q_DECL_OVERRIDE;
- QDomNodePrivate* appendChild(QDomNodePrivate* newChild) Q_DECL_OVERRIDE;
+ QDomNodePrivate* cloneNode(bool deep = true) override;
+ QDomNodePrivate* insertBefore(QDomNodePrivate* newChild, QDomNodePrivate* refChild) override;
+ QDomNodePrivate* insertAfter(QDomNodePrivate* newChild, QDomNodePrivate* refChild) override;
+ QDomNodePrivate* replaceChild(QDomNodePrivate* newChild, QDomNodePrivate* oldChild) override;
+ QDomNodePrivate* removeChild(QDomNodePrivate* oldChild) override;
+ QDomNodePrivate* appendChild(QDomNodePrivate* newChild) override;
- QDomNode::NodeType nodeType() const Q_DECL_OVERRIDE { return QDomNode::DocumentTypeNode; }
+ QDomNode::NodeType nodeType() const override { return QDomNode::DocumentTypeNode; }
- void save(QTextStream& s, int, int) const Q_DECL_OVERRIDE;
+ void save(QTextStream& s, int, int) const override;
// Variables
QDomNamedNodeMapPrivate* entities;
@@ -317,8 +317,8 @@ public:
QDomDocumentFragmentPrivate(QDomNodePrivate* n, bool deep);
// Reimplemented from QDomNodePrivate
- virtual QDomNodePrivate* cloneNode(bool deep = true) Q_DECL_OVERRIDE;
- QDomNode::NodeType nodeType() const Q_DECL_OVERRIDE { return QDomNode::DocumentFragmentNode; }
+ virtual QDomNodePrivate* cloneNode(bool deep = true) override;
+ QDomNode::NodeType nodeType() const override { return QDomNode::DocumentFragmentNode; }
};
class QDomCharacterDataPrivate : public QDomNodePrivate
@@ -335,8 +335,8 @@ public:
void replaceData(unsigned long offset, unsigned long count, const QString& arg);
// Reimplemented from QDomNodePrivate
- QDomNode::NodeType nodeType() const Q_DECL_OVERRIDE { return QDomNode::CharacterDataNode; }
- QDomNodePrivate* cloneNode(bool deep = true) Q_DECL_OVERRIDE;
+ QDomNode::NodeType nodeType() const override { return QDomNode::CharacterDataNode; }
+ QDomNodePrivate* cloneNode(bool deep = true) override;
};
class QDomTextPrivate : public QDomCharacterDataPrivate
@@ -348,9 +348,9 @@ public:
QDomTextPrivate* splitText(int offset);
// Reimplemented from QDomNodePrivate
- QDomNodePrivate* cloneNode(bool deep = true) Q_DECL_OVERRIDE;
- QDomNode::NodeType nodeType() const Q_DECL_OVERRIDE { return QDomNode::TextNode; }
- virtual void save(QTextStream& s, int, int) const Q_DECL_OVERRIDE;
+ QDomNodePrivate* cloneNode(bool deep = true) override;
+ QDomNode::NodeType nodeType() const override { return QDomNode::TextNode; }
+ virtual void save(QTextStream& s, int, int) const override;
};
class QDomAttrPrivate : public QDomNodePrivate
@@ -363,10 +363,10 @@ public:
bool specified() const;
// Reimplemented from QDomNodePrivate
- void setNodeValue(const QString& v) Q_DECL_OVERRIDE;
- QDomNodePrivate* cloneNode(bool deep = true) Q_DECL_OVERRIDE;
- QDomNode::NodeType nodeType() const Q_DECL_OVERRIDE { return QDomNode::AttributeNode; }
- virtual void save(QTextStream& s, int, int) const Q_DECL_OVERRIDE;
+ void setNodeValue(const QString& v) override;
+ QDomNodePrivate* cloneNode(bool deep = true) override;
+ QDomNode::NodeType nodeType() const override { return QDomNode::AttributeNode; }
+ virtual void save(QTextStream& s, int, int) const override;
// Variables
bool m_specified;
@@ -398,9 +398,9 @@ public:
// Reimplemented from QDomNodePrivate
QDomNamedNodeMapPrivate* attributes() { return m_attr; }
bool hasAttributes() { return (m_attr->length() > 0); }
- QDomNode::NodeType nodeType() const Q_DECL_OVERRIDE { return QDomNode::ElementNode; }
- QDomNodePrivate* cloneNode(bool deep = true) Q_DECL_OVERRIDE;
- virtual void save(QTextStream& s, int, int) const Q_DECL_OVERRIDE;
+ QDomNode::NodeType nodeType() const override { return QDomNode::ElementNode; }
+ QDomNodePrivate* cloneNode(bool deep = true) override;
+ virtual void save(QTextStream& s, int, int) const override;
// Variables
QDomNamedNodeMapPrivate* m_attr;
@@ -414,9 +414,9 @@ public:
QDomCommentPrivate(QDomCommentPrivate* n, bool deep);
// Reimplemented from QDomNodePrivate
- QDomNodePrivate* cloneNode(bool deep = true) Q_DECL_OVERRIDE;
- QDomNode::NodeType nodeType() const Q_DECL_OVERRIDE { return QDomNode::CommentNode; }
- virtual void save(QTextStream& s, int, int) const Q_DECL_OVERRIDE;
+ QDomNodePrivate* cloneNode(bool deep = true) override;
+ QDomNode::NodeType nodeType() const override { return QDomNode::CommentNode; }
+ virtual void save(QTextStream& s, int, int) const override;
};
class QDomCDATASectionPrivate : public QDomTextPrivate
@@ -426,9 +426,9 @@ public:
QDomCDATASectionPrivate(QDomCDATASectionPrivate* n, bool deep);
// Reimplemented from QDomNodePrivate
- QDomNodePrivate* cloneNode(bool deep = true) Q_DECL_OVERRIDE;
- QDomNode::NodeType nodeType() const Q_DECL_OVERRIDE { return QDomNode::CDATASectionNode; }
- virtual void save(QTextStream& s, int, int) const Q_DECL_OVERRIDE;
+ QDomNodePrivate* cloneNode(bool deep = true) override;
+ QDomNode::NodeType nodeType() const override { return QDomNode::CDATASectionNode; }
+ virtual void save(QTextStream& s, int, int) const override;
};
class QDomNotationPrivate : public QDomNodePrivate
@@ -439,9 +439,9 @@ public:
QDomNotationPrivate(QDomNotationPrivate* n, bool deep);
// Reimplemented from QDomNodePrivate
- QDomNodePrivate* cloneNode(bool deep = true) Q_DECL_OVERRIDE;
- QDomNode::NodeType nodeType() const Q_DECL_OVERRIDE { return QDomNode::NotationNode; }
- virtual void save(QTextStream& s, int, int) const Q_DECL_OVERRIDE;
+ QDomNodePrivate* cloneNode(bool deep = true) override;
+ QDomNode::NodeType nodeType() const override { return QDomNode::NotationNode; }
+ virtual void save(QTextStream& s, int, int) const override;
// Variables
QString m_sys;
@@ -456,9 +456,9 @@ public:
QDomEntityPrivate(QDomEntityPrivate* n, bool deep);
// Reimplemented from QDomNodePrivate
- QDomNodePrivate* cloneNode(bool deep = true) Q_DECL_OVERRIDE;
- QDomNode::NodeType nodeType() const Q_DECL_OVERRIDE { return QDomNode::EntityNode; }
- virtual void save(QTextStream& s, int, int) const Q_DECL_OVERRIDE;
+ QDomNodePrivate* cloneNode(bool deep = true) override;
+ QDomNode::NodeType nodeType() const override { return QDomNode::EntityNode; }
+ virtual void save(QTextStream& s, int, int) const override;
// Variables
QString m_sys;
@@ -473,9 +473,9 @@ public:
QDomEntityReferencePrivate(QDomNodePrivate* n, bool deep);
// Reimplemented from QDomNodePrivate
- QDomNodePrivate* cloneNode(bool deep = true) Q_DECL_OVERRIDE;
- QDomNode::NodeType nodeType() const Q_DECL_OVERRIDE { return QDomNode::EntityReferenceNode; }
- virtual void save(QTextStream& s, int, int) const Q_DECL_OVERRIDE;
+ QDomNodePrivate* cloneNode(bool deep = true) override;
+ QDomNode::NodeType nodeType() const override { return QDomNode::EntityReferenceNode; }
+ virtual void save(QTextStream& s, int, int) const override;
};
class QDomProcessingInstructionPrivate : public QDomNodePrivate
@@ -486,9 +486,9 @@ public:
QDomProcessingInstructionPrivate(QDomProcessingInstructionPrivate* n, bool deep);
// Reimplemented from QDomNodePrivate
- QDomNodePrivate* cloneNode(bool deep = true) Q_DECL_OVERRIDE;
- QDomNode::NodeType nodeType() const Q_DECL_OVERRIDE { return QDomNode::ProcessingInstructionNode; }
- virtual void save(QTextStream& s, int, int) const Q_DECL_OVERRIDE;
+ QDomNodePrivate* cloneNode(bool deep = true) override;
+ QDomNode::NodeType nodeType() const override { return QDomNode::ProcessingInstructionNode; }
+ virtual void save(QTextStream& s, int, int) const override;
};
class QDomDocumentPrivate : public QDomNodePrivate
@@ -523,9 +523,9 @@ public:
QDomNodePrivate* importNode(QDomNodePrivate* importedNode, bool deep);
// Reimplemented from QDomNodePrivate
- QDomNodePrivate* cloneNode(bool deep = true) Q_DECL_OVERRIDE;
- QDomNode::NodeType nodeType() const Q_DECL_OVERRIDE { return QDomNode::DocumentNode; }
- void clear() Q_DECL_OVERRIDE;
+ QDomNodePrivate* cloneNode(bool deep = true) override;
+ QDomNode::NodeType nodeType() const override { return QDomNode::DocumentNode; }
+ void clear() override;
// Variables
QExplicitlySharedDataPointer<QDomImplementationPrivate> impl;
@@ -576,32 +576,32 @@ public:
~QDomHandler();
// content handler
- bool endDocument() Q_DECL_OVERRIDE;
- bool startElement(const QString& nsURI, const QString& localName, const QString& qName, const QXmlAttributes& atts) Q_DECL_OVERRIDE;
- bool endElement(const QString& nsURI, const QString& localName, const QString& qName) Q_DECL_OVERRIDE;
- bool characters(const QString& ch) Q_DECL_OVERRIDE;
- bool processingInstruction(const QString& target, const QString& data) Q_DECL_OVERRIDE;
- bool skippedEntity(const QString& name) Q_DECL_OVERRIDE;
+ bool endDocument() override;
+ bool startElement(const QString& nsURI, const QString& localName, const QString& qName, const QXmlAttributes& atts) override;
+ bool endElement(const QString& nsURI, const QString& localName, const QString& qName) override;
+ bool characters(const QString& ch) override;
+ bool processingInstruction(const QString& target, const QString& data) override;
+ bool skippedEntity(const QString& name) override;
// error handler
- bool fatalError(const QXmlParseException& exception) Q_DECL_OVERRIDE;
+ bool fatalError(const QXmlParseException& exception) override;
// lexical handler
- bool startCDATA() Q_DECL_OVERRIDE;
- bool endCDATA() Q_DECL_OVERRIDE;
- bool startEntity(const QString &) Q_DECL_OVERRIDE;
- bool endEntity(const QString &) Q_DECL_OVERRIDE;
- bool startDTD(const QString& name, const QString& publicId, const QString& systemId) Q_DECL_OVERRIDE;
- bool comment(const QString& ch) Q_DECL_OVERRIDE;
+ bool startCDATA() override;
+ bool endCDATA() override;
+ bool startEntity(const QString &) override;
+ bool endEntity(const QString &) override;
+ bool startDTD(const QString& name, const QString& publicId, const QString& systemId) override;
+ bool comment(const QString& ch) override;
// decl handler
- bool externalEntityDecl(const QString &name, const QString &publicId, const QString &systemId) Q_DECL_OVERRIDE ;
+ bool externalEntityDecl(const QString &name, const QString &publicId, const QString &systemId) override ;
// DTD handler
- bool notationDecl(const QString & name, const QString & publicId, const QString & systemId) Q_DECL_OVERRIDE;
- bool unparsedEntityDecl(const QString &name, const QString &publicId, const QString &systemId, const QString &notationName) Q_DECL_OVERRIDE ;
+ bool notationDecl(const QString & name, const QString & publicId, const QString & systemId) override;
+ bool unparsedEntityDecl(const QString &name, const QString &publicId, const QString &systemId, const QString &notationName) override ;
- void setDocumentLocator(QXmlLocator *locator) Q_DECL_OVERRIDE;
+ void setDocumentLocator(QXmlLocator *locator) override;
QString errorMsg;
int errorLine;
diff --git a/src/xml/dom/qdom.h b/src/xml/dom/qdom.h
index 464c8ebfc2..0a7db7dcd7 100644
--- a/src/xml/dom/qdom.h
+++ b/src/xml/dom/qdom.h
@@ -335,14 +335,14 @@ public:
inline QDomNode::NodeType nodeType() const { return DocumentNode; }
// Qt extensions
- bool setContent(const QByteArray& text, bool namespaceProcessing, QString *errorMsg=Q_NULLPTR, int *errorLine=Q_NULLPTR, int *errorColumn=Q_NULLPTR );
- bool setContent(const QString& text, bool namespaceProcessing, QString *errorMsg=Q_NULLPTR, int *errorLine=Q_NULLPTR, int *errorColumn=Q_NULLPTR );
- bool setContent(QIODevice* dev, bool namespaceProcessing, QString *errorMsg=Q_NULLPTR, int *errorLine=Q_NULLPTR, int *errorColumn=Q_NULLPTR );
- bool setContent(QXmlInputSource *source, bool namespaceProcessing, QString *errorMsg=Q_NULLPTR, int *errorLine=Q_NULLPTR, int *errorColumn=Q_NULLPTR );
- bool setContent(const QByteArray& text, QString *errorMsg=Q_NULLPTR, int *errorLine=Q_NULLPTR, int *errorColumn=Q_NULLPTR );
- bool setContent(const QString& text, QString *errorMsg=Q_NULLPTR, int *errorLine=Q_NULLPTR, int *errorColumn=Q_NULLPTR );
- bool setContent(QIODevice* dev, QString *errorMsg=Q_NULLPTR, int *errorLine=Q_NULLPTR, int *errorColumn=Q_NULLPTR );
- bool setContent(QXmlInputSource *source, QXmlReader *reader, QString *errorMsg=Q_NULLPTR, int *errorLine=Q_NULLPTR, int *errorColumn=Q_NULLPTR );
+ bool setContent(const QByteArray& text, bool namespaceProcessing, QString *errorMsg=nullptr, int *errorLine=nullptr, int *errorColumn=nullptr );
+ bool setContent(const QString& text, bool namespaceProcessing, QString *errorMsg=nullptr, int *errorLine=nullptr, int *errorColumn=nullptr );
+ bool setContent(QIODevice* dev, bool namespaceProcessing, QString *errorMsg=nullptr, int *errorLine=nullptr, int *errorColumn=nullptr );
+ bool setContent(QXmlInputSource *source, bool namespaceProcessing, QString *errorMsg=nullptr, int *errorLine=nullptr, int *errorColumn=nullptr );
+ bool setContent(const QByteArray& text, QString *errorMsg=nullptr, int *errorLine=nullptr, int *errorColumn=nullptr );
+ bool setContent(const QString& text, QString *errorMsg=nullptr, int *errorLine=nullptr, int *errorColumn=nullptr );
+ bool setContent(QIODevice* dev, QString *errorMsg=nullptr, int *errorLine=nullptr, int *errorColumn=nullptr );
+ bool setContent(QXmlInputSource *source, QXmlReader *reader, QString *errorMsg=nullptr, int *errorLine=nullptr, int *errorColumn=nullptr );
// Qt extensions
QString toString(int = 1) const;
diff --git a/src/xml/sax/qxml.cpp b/src/xml/sax/qxml.cpp
index bc7d00483a..8615d9b10c 100644
--- a/src/xml/sax/qxml.cpp
+++ b/src/xml/sax/qxml.cpp
@@ -448,11 +448,11 @@ public:
{
}
- int columnNumber() const Q_DECL_OVERRIDE
+ int columnNumber() const override
{
return (reader->d_ptr->columnNr == -1 ? -1 : reader->d_ptr->columnNr + 1);
}
- int lineNumber() const Q_DECL_OVERRIDE
+ int lineNumber() const override
{
return (reader->d_ptr->lineNr == -1 ? -1 : reader->d_ptr->lineNr + 1);
}
diff --git a/src/xml/sax/qxml.h b/src/xml/sax/qxml.h
index 77a5a78650..7c5b5fe204 100644
--- a/src/xml/sax/qxml.h
+++ b/src/xml/sax/qxml.h
@@ -225,10 +225,10 @@ class Q_XML_EXPORT QXmlReader
{
public:
virtual ~QXmlReader() {}
- virtual bool feature(const QString& name, bool *ok = Q_NULLPTR) const = 0;
+ virtual bool feature(const QString& name, bool *ok = nullptr) const = 0;
virtual void setFeature(const QString& name, bool value) = 0;
virtual bool hasFeature(const QString& name) const = 0;
- virtual void* property(const QString& name, bool *ok = Q_NULLPTR) const = 0;
+ virtual void* property(const QString& name, bool *ok = nullptr) const = 0;
virtual void setProperty(const QString& name, void* value) = 0;
virtual bool hasProperty(const QString& name) const = 0;
virtual void setEntityResolver(QXmlEntityResolver* handler) = 0;
@@ -253,29 +253,29 @@ public:
QXmlSimpleReader();
virtual ~QXmlSimpleReader();
- bool feature(const QString& name, bool *ok = Q_NULLPTR) const Q_DECL_OVERRIDE;
- void setFeature(const QString& name, bool value) Q_DECL_OVERRIDE;
- bool hasFeature(const QString& name) const Q_DECL_OVERRIDE;
-
- void* property(const QString& name, bool *ok = Q_NULLPTR) const Q_DECL_OVERRIDE;
- void setProperty(const QString& name, void* value) Q_DECL_OVERRIDE;
- bool hasProperty(const QString& name) const Q_DECL_OVERRIDE;
-
- void setEntityResolver(QXmlEntityResolver* handler) Q_DECL_OVERRIDE;
- QXmlEntityResolver* entityResolver() const Q_DECL_OVERRIDE;
- void setDTDHandler(QXmlDTDHandler* handler) Q_DECL_OVERRIDE;
- QXmlDTDHandler* DTDHandler() const Q_DECL_OVERRIDE;
- void setContentHandler(QXmlContentHandler* handler) Q_DECL_OVERRIDE;
- QXmlContentHandler* contentHandler() const Q_DECL_OVERRIDE;
- void setErrorHandler(QXmlErrorHandler* handler) Q_DECL_OVERRIDE;
- QXmlErrorHandler* errorHandler() const Q_DECL_OVERRIDE;
- void setLexicalHandler(QXmlLexicalHandler* handler) Q_DECL_OVERRIDE;
- QXmlLexicalHandler* lexicalHandler() const Q_DECL_OVERRIDE;
- void setDeclHandler(QXmlDeclHandler* handler) Q_DECL_OVERRIDE;
- QXmlDeclHandler* declHandler() const Q_DECL_OVERRIDE;
-
- bool parse(const QXmlInputSource& input) Q_DECL_OVERRIDE;
- bool parse(const QXmlInputSource* input) Q_DECL_OVERRIDE;
+ bool feature(const QString& name, bool *ok = nullptr) const override;
+ void setFeature(const QString& name, bool value) override;
+ bool hasFeature(const QString& name) const override;
+
+ void* property(const QString& name, bool *ok = nullptr) const override;
+ void setProperty(const QString& name, void* value) override;
+ bool hasProperty(const QString& name) const override;
+
+ void setEntityResolver(QXmlEntityResolver* handler) override;
+ QXmlEntityResolver* entityResolver() const override;
+ void setDTDHandler(QXmlDTDHandler* handler) override;
+ QXmlDTDHandler* DTDHandler() const override;
+ void setContentHandler(QXmlContentHandler* handler) override;
+ QXmlContentHandler* contentHandler() const override;
+ void setErrorHandler(QXmlErrorHandler* handler) override;
+ QXmlErrorHandler* errorHandler() const override;
+ void setLexicalHandler(QXmlLexicalHandler* handler) override;
+ QXmlLexicalHandler* lexicalHandler() const override;
+ void setDeclHandler(QXmlDeclHandler* handler) override;
+ QXmlDeclHandler* declHandler() const override;
+
+ bool parse(const QXmlInputSource& input) override;
+ bool parse(const QXmlInputSource* input) override;
virtual bool parse(const QXmlInputSource* input, bool incremental);
virtual bool parseContinue();
@@ -385,40 +385,40 @@ public:
QXmlDefaultHandler();
virtual ~QXmlDefaultHandler();
- void setDocumentLocator(QXmlLocator* locator) Q_DECL_OVERRIDE;
- bool startDocument() Q_DECL_OVERRIDE;
- bool endDocument() Q_DECL_OVERRIDE;
- bool startPrefixMapping(const QString& prefix, const QString& uri) Q_DECL_OVERRIDE;
- bool endPrefixMapping(const QString& prefix) Q_DECL_OVERRIDE;
- bool startElement(const QString& namespaceURI, const QString& localName, const QString& qName, const QXmlAttributes& atts) Q_DECL_OVERRIDE;
- bool endElement(const QString& namespaceURI, const QString& localName, const QString& qName) Q_DECL_OVERRIDE;
- bool characters(const QString& ch) Q_DECL_OVERRIDE;
- bool ignorableWhitespace(const QString& ch) Q_DECL_OVERRIDE;
- bool processingInstruction(const QString& target, const QString& data) Q_DECL_OVERRIDE;
- bool skippedEntity(const QString& name) Q_DECL_OVERRIDE;
-
- bool warning(const QXmlParseException& exception) Q_DECL_OVERRIDE;
- bool error(const QXmlParseException& exception) Q_DECL_OVERRIDE;
- bool fatalError(const QXmlParseException& exception) Q_DECL_OVERRIDE;
-
- bool notationDecl(const QString& name, const QString& publicId, const QString& systemId) Q_DECL_OVERRIDE;
- bool unparsedEntityDecl(const QString& name, const QString& publicId, const QString& systemId, const QString& notationName) Q_DECL_OVERRIDE;
-
- bool resolveEntity(const QString& publicId, const QString& systemId, QXmlInputSource*& ret) Q_DECL_OVERRIDE;
-
- bool startDTD(const QString& name, const QString& publicId, const QString& systemId) Q_DECL_OVERRIDE;
- bool endDTD() Q_DECL_OVERRIDE;
- bool startEntity(const QString& name) Q_DECL_OVERRIDE;
- bool endEntity(const QString& name) Q_DECL_OVERRIDE;
- bool startCDATA() Q_DECL_OVERRIDE;
- bool endCDATA() Q_DECL_OVERRIDE;
- bool comment(const QString& ch) Q_DECL_OVERRIDE;
-
- bool attributeDecl(const QString& eName, const QString& aName, const QString& type, const QString& valueDefault, const QString& value) Q_DECL_OVERRIDE;
- bool internalEntityDecl(const QString& name, const QString& value) Q_DECL_OVERRIDE;
- bool externalEntityDecl(const QString& name, const QString& publicId, const QString& systemId) Q_DECL_OVERRIDE;
-
- QString errorString() const Q_DECL_OVERRIDE;
+ void setDocumentLocator(QXmlLocator* locator) override;
+ bool startDocument() override;
+ bool endDocument() override;
+ bool startPrefixMapping(const QString& prefix, const QString& uri) override;
+ bool endPrefixMapping(const QString& prefix) override;
+ bool startElement(const QString& namespaceURI, const QString& localName, const QString& qName, const QXmlAttributes& atts) override;
+ bool endElement(const QString& namespaceURI, const QString& localName, const QString& qName) override;
+ bool characters(const QString& ch) override;
+ bool ignorableWhitespace(const QString& ch) override;
+ bool processingInstruction(const QString& target, const QString& data) override;
+ bool skippedEntity(const QString& name) override;
+
+ bool warning(const QXmlParseException& exception) override;
+ bool error(const QXmlParseException& exception) override;
+ bool fatalError(const QXmlParseException& exception) override;
+
+ bool notationDecl(const QString& name, const QString& publicId, const QString& systemId) override;
+ bool unparsedEntityDecl(const QString& name, const QString& publicId, const QString& systemId, const QString& notationName) override;
+
+ bool resolveEntity(const QString& publicId, const QString& systemId, QXmlInputSource*& ret) override;
+
+ bool startDTD(const QString& name, const QString& publicId, const QString& systemId) override;
+ bool endDTD() override;
+ bool startEntity(const QString& name) override;
+ bool endEntity(const QString& name) override;
+ bool startCDATA() override;
+ bool endCDATA() override;
+ bool comment(const QString& ch) override;
+
+ bool attributeDecl(const QString& eName, const QString& aName, const QString& type, const QString& valueDefault, const QString& value) override;
+ bool internalEntityDecl(const QString& name, const QString& value) override;
+ bool externalEntityDecl(const QString& name, const QString& publicId, const QString& systemId) override;
+
+ QString errorString() const override;
private:
QXmlDefaultHandlerPrivate *d;
diff --git a/sync.profile b/sync.profile
index a696be5e54..6a50e31102 100644
--- a/sync.profile
+++ b/sync.profile
@@ -11,6 +11,7 @@
"QtDBus" => "$basedir/src/dbus",
"QtConcurrent" => "$basedir/src/concurrent",
"QtAccessibilitySupport" => "$basedir/src/platformsupport/accessibility",
+ "QtWindowsUIAutomationSupport" => "$basedir/src/platformsupport/windowsuiautomation",
"QtLinuxAccessibilitySupport" => "$basedir/src/platformsupport/linuxaccessibility",
"QtClipboardSupport" => "$basedir/src/platformsupport/clipboard",
"QtDeviceDiscoverySupport" => "$basedir/src/platformsupport/devicediscovery",
diff --git a/tests/auto/concurrent/qtconcurrentrun/tst_qtconcurrentrun.cpp b/tests/auto/concurrent/qtconcurrentrun/tst_qtconcurrentrun.cpp
index 4e3668d72e..1596a9fafd 100644
--- a/tests/auto/concurrent/qtconcurrentrun/tst_qtconcurrentrun.cpp
+++ b/tests/auto/concurrent/qtconcurrentrun/tst_qtconcurrentrun.cpp
@@ -572,7 +572,7 @@ class SlowTask : public QRunnable
{
public:
static QAtomicInt cancel;
- void run() Q_DECL_OVERRIDE {
+ void run() override {
int iter = 60;
while (--iter && !cancel.load())
QThread::currentThread()->msleep(25);
diff --git a/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp b/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp
index c3b53a2fc0..f8f9387abb 100644
--- a/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp
+++ b/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp
@@ -2406,16 +2406,16 @@ void tst_QTextCodec::shiftJis()
struct UserCodec : public QTextCodec
{
// implement pure virtuals
- QByteArray name() const Q_DECL_OVERRIDE
+ QByteArray name() const override
{ return "UserCodec"; }
- QList<QByteArray> aliases() const Q_DECL_OVERRIDE
+ QList<QByteArray> aliases() const override
{ return QList<QByteArray>() << "usercodec" << "user-codec"; }
- int mibEnum() const Q_DECL_OVERRIDE
+ int mibEnum() const override
{ return 5000; }
- virtual QString convertToUnicode(const char *, int, ConverterState *) const Q_DECL_OVERRIDE
+ virtual QString convertToUnicode(const char *, int, ConverterState *) const override
{ return QString(); }
- virtual QByteArray convertFromUnicode(const QChar *, int, ConverterState *) const Q_DECL_OVERRIDE
+ virtual QByteArray convertFromUnicode(const QChar *, int, ConverterState *) const override
{ return QByteArray(); }
};
diff --git a/tests/auto/corelib/global/qfloat16/tst_qfloat16.cpp b/tests/auto/corelib/global/qfloat16/tst_qfloat16.cpp
index 9bd87e3f21..d2902f4944 100644
--- a/tests/auto/corelib/global/qfloat16/tst_qfloat16.cpp
+++ b/tests/auto/corelib/global/qfloat16/tst_qfloat16.cpp
@@ -46,6 +46,8 @@ private slots:
void promotionTests();
void arithOps_data();
void arithOps();
+ void floatToFloat16();
+ void floatFromFloat16();
};
void tst_qfloat16::fuzzyCompare_data()
@@ -305,5 +307,41 @@ void tst_qfloat16::arithOps()
QVERIFY(qFuzzyCompare(r4,1.f/val2));
}
+void tst_qfloat16::floatToFloat16()
+{
+ float in[63];
+ qfloat16 out[63];
+ qfloat16 expected[63];
+
+ for (int i = 0; i < 63; ++i)
+ in[i] = i * (1/13.f);
+
+ for (int i = 0; i < 63; ++i)
+ expected[i] = qfloat16(in[i]);
+
+ qFloatToFloat16(out, in, 63);
+
+ for (int i = 0; i < 63; ++i)
+ QVERIFY(qFuzzyCompare(out[i], expected[i]));
+}
+
+void tst_qfloat16::floatFromFloat16()
+{
+ qfloat16 in[35];
+ float out[35];
+ float expected[35];
+
+ for (int i = 0; i < 35; ++i)
+ in[i] = qfloat16(i * (17.f / 3));
+
+ for (int i = 0; i < 35; ++i)
+ expected[i] = float(in[i]);
+
+ qFloatFromFloat16(out, in, 35);
+
+ for (int i = 0; i < 35; ++i)
+ QCOMPARE(out[i], expected[i]);
+}
+
QTEST_APPLESS_MAIN(tst_qfloat16)
#include "tst_qfloat16.moc"
diff --git a/tests/auto/corelib/global/qglobal/qglobal.c b/tests/auto/corelib/global/qglobal/qglobal.c
new file mode 100644
index 0000000000..bf2943a63c
--- /dev/null
+++ b/tests/auto/corelib/global/qglobal/qglobal.c
@@ -0,0 +1,117 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 Intel Corporation.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtCore/qglobal.h>
+
+#if QT_HAS_INCLUDE(<stdbool.h>) || __STDC_VERSION__ >= 199901L
+# include <stdbool.h>
+#else
+# undef true
+# define true 1
+# undef false
+# define false 0
+#endif
+
+#ifdef Q_COMPILER_THREAD_LOCAL
+# include <threads.h>
+#endif
+
+/*
+ * Certain features of qglobal.h must work in C mode too. We test that
+ * everything works.
+ */
+
+/* Types and Q_UNUSED */
+void tst_GlobalTypes()
+{
+ qint8 s8;
+ qint16 s16;
+ qint32 s32;
+ qint64 s64;
+ qlonglong sll;
+ Q_UNUSED(s8); Q_UNUSED(s16); Q_UNUSED(s32); Q_UNUSED(s64); Q_UNUSED(sll);
+
+ quint8 u8;
+ quint16 u16;
+ quint32 u32;
+ quint64 u64;
+ qulonglong ull;
+ Q_UNUSED(u8); Q_UNUSED(u16); Q_UNUSED(u32); Q_UNUSED(u64); Q_UNUSED(ull);
+
+ uchar uc;
+ ushort us;
+ uint ui;
+ ulong ul;
+ Q_UNUSED(uc); Q_UNUSED(us); Q_UNUSED(ui); Q_UNUSED(ul);
+
+ qreal qr;
+ Q_UNUSED(qr);
+
+ qssize_t qs;
+ qptrdiff qp;
+ qintptr qip;
+ quintptr qup;
+ Q_UNUSED(qs); Q_UNUSED(qp); Q_UNUSED(qip); Q_UNUSED(qup);
+}
+
+/* Qt version */
+int tst_QtVersion()
+{
+ return QT_VERSION;
+}
+
+const char *tst_qVersion() Q_DECL_NOTHROW
+{
+#if !defined(QT_NAMESPACE)
+ return qVersion();
+#else
+ return NULL;
+#endif
+}
+
+/* Static assertion */
+Q_STATIC_ASSERT(true);
+Q_STATIC_ASSERT(1);
+Q_STATIC_ASSERT_X(true, "Message");
+Q_STATIC_ASSERT_X(1, "Message");
+
+Q_STATIC_ASSERT(!false);
+Q_STATIC_ASSERT(!0);
+
+Q_STATIC_ASSERT(!!true);
+Q_STATIC_ASSERT(!!1);
+
+#ifdef Q_COMPILER_THREAD_LOCAL
+static thread_local int gt_var;
+void thread_local_test()
+{
+ thread_local int t_var;
+ t_var = gt_var;
+}
+#endif
+
diff --git a/tests/auto/corelib/global/qglobal/qglobal.pro b/tests/auto/corelib/global/qglobal/qglobal.pro
index b8ed7761f5..a40cb9a288 100644
--- a/tests/auto/corelib/global/qglobal/qglobal.pro
+++ b/tests/auto/corelib/global/qglobal/qglobal.pro
@@ -1,4 +1,4 @@
CONFIG += testcase
TARGET = tst_qglobal
QT = core testlib
-SOURCES = tst_qglobal.cpp
+SOURCES = tst_qglobal.cpp qglobal.c
diff --git a/tests/auto/corelib/global/qglobal/tst_qglobal.cpp b/tests/auto/corelib/global/qglobal/tst_qglobal.cpp
index 083526fdc4..78b954f373 100644
--- a/tests/auto/corelib/global/qglobal/tst_qglobal.cpp
+++ b/tests/auto/corelib/global/qglobal/tst_qglobal.cpp
@@ -39,6 +39,7 @@ class tst_QGlobal: public QObject
Q_OBJECT
private slots:
+ void cMode();
void qIsNull();
void for_each();
void qassert();
@@ -56,6 +57,22 @@ private slots:
void testqOverload();
};
+extern "C" { // functions in qglobal.c
+void tst_GlobalTypes();
+int tst_QtVersion();
+const char *tst_qVersion();
+}
+
+void tst_QGlobal::cMode()
+{
+ tst_GlobalTypes();
+ QCOMPARE(tst_QtVersion(), QT_VERSION);
+
+#ifndef QT_NAMESPACE
+ QCOMPARE(tst_qVersion(), qVersion());
+#endif
+}
+
void tst_QGlobal::qIsNull()
{
double d = 0.0;
diff --git a/tests/auto/corelib/io/qfile/tst_qfile.cpp b/tests/auto/corelib/io/qfile/tst_qfile.cpp
index c173a87a41..06c3a9578f 100644
--- a/tests/auto/corelib/io/qfile/tst_qfile.cpp
+++ b/tests/auto/corelib/io/qfile/tst_qfile.cpp
@@ -68,8 +68,6 @@ QT_END_NAMESPACE
#elif defined(Q_OS_FREEBSD)
# include <sys/param.h>
# include <sys/mount.h>
-#elif defined(Q_OS_IRIX)
-# include <sys/statfs.h>
#elif defined(Q_OS_VXWORKS)
# include <fcntl.h>
#if defined(_WRS_KERNEL)
@@ -1957,10 +1955,6 @@ void tst_QFile::largeFileSupport()
if (::GetDiskFreeSpaceEx((wchar_t*)QDir::currentPath().utf16(), &free, 0, 0))
freespace = free.QuadPart;
if (freespace != 0) {
-#elif defined(Q_OS_IRIX)
- struct statfs info;
- if (statfs(QDir::currentPath().local8Bit(), &info, sizeof(struct statfs), 0) == 0) {
- freespace = qlonglong(info.f_bfree * info.f_bsize);
#else
struct statfs info;
if (statfs(const_cast<char *>(QDir::currentPath().toLocal8Bit().constData()), &info) == 0) {
diff --git a/tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp b/tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp
index a0188f8ba9..a485788ec2 100644
--- a/tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp
+++ b/tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp
@@ -551,18 +551,18 @@ public:
: QIODevice(), buf(byteArray), offset(0), ownbuf(false) { }
virtual ~SequentialReadBuffer() { if (ownbuf) delete buf; }
- bool isSequential() const Q_DECL_OVERRIDE { return true; }
+ bool isSequential() const override { return true; }
const QByteArray &buffer() const { return *buf; }
protected:
- qint64 readData(char *data, qint64 maxSize) Q_DECL_OVERRIDE
+ qint64 readData(char *data, qint64 maxSize) override
{
maxSize = qMin(maxSize, qint64(buf->size() - offset));
memcpy(data, buf->constData() + offset, maxSize);
offset += maxSize;
return maxSize;
}
- qint64 writeData(const char * /* data */, qint64 /* maxSize */) Q_DECL_OVERRIDE
+ qint64 writeData(const char * /* data */, qint64 /* maxSize */) override
{
return -1;
}
@@ -598,13 +598,13 @@ public:
RandomAccessBuffer(const char *data) : QIODevice(), buf(data) { }
protected:
- qint64 readData(char *data, qint64 maxSize) Q_DECL_OVERRIDE
+ qint64 readData(char *data, qint64 maxSize) override
{
maxSize = qMin(maxSize, qint64(buf.size() - pos()));
memcpy(data, buf.constData() + pos(), maxSize);
return maxSize;
}
- qint64 writeData(const char *data, qint64 maxSize) Q_DECL_OVERRIDE
+ qint64 writeData(const char *data, qint64 maxSize) override
{
maxSize = qMin(maxSize, qint64(buf.size() - pos()));
memcpy(buf.data() + pos(), data, maxSize);
diff --git a/tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp b/tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp
index 835c4a2778..fc7ab70d41 100644
--- a/tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp
+++ b/tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp
@@ -39,6 +39,8 @@
# include <qt_windows.h>
#endif
+#include <private/qlockfile_p.h> // for getLockFileHandle()
+
class tst_QLockFile : public QObject
{
Q_OBJECT
@@ -61,8 +63,12 @@ private slots:
void noPermissionsWindows();
void corruptedLockFile();
void corruptedLockFileInTheFuture();
+ void hostnameChange();
+ void differentMachines();
+ void reboot();
private:
+ static bool overwriteLineInLockFile(QFile &f, int line, const QString &newLine);
static bool overwritePidInLockFile(const QString &filePath, qint64 pid);
public:
@@ -295,7 +301,7 @@ void tst_QLockFile::staleLockFromCrashedProcessReusedPid()
QLockFile secondLock(fileName);
qint64 pid = 0;
- secondLock.getLockInfo(&pid, 0, 0);
+ QVERIFY(secondLock.getLockInfo(&pid, 0, 0));
QCOMPARE(pid, QCoreApplication::applicationPid());
secondLock.setStaleLockTime(0);
QVERIFY(secondLock.tryLock());
@@ -549,22 +555,109 @@ void tst_QLockFile::corruptedLockFileInTheFuture()
#endif
}
+void tst_QLockFile::hostnameChange()
+{
+ const QByteArray hostid = QSysInfo::machineUniqueId();
+ if (hostid.isEmpty())
+ QSKIP("Could not get a unique host ID on this machine");
+
+ QString lockFile = dir.path() + "/hostnameChangeLock";
+ QLockFile lock1(lockFile);
+ QVERIFY(lock1.lock());
+
+ {
+ // now modify it
+ QFile f;
+ QVERIFY(f.open(QLockFilePrivate::getLockFileHandle(&lock1),
+ QIODevice::ReadWrite | QIODevice::Text,
+ QFile::DontCloseHandle));
+ QVERIFY(overwriteLineInLockFile(f, 3, "this is not a hostname"));
+ }
+
+ {
+ // we should fail to lock
+ QLockFile lock2(lockFile);
+ QVERIFY(!lock2.tryLock(1000));
+ }
+}
+
+void tst_QLockFile::differentMachines()
+{
+ const QByteArray hostid = QSysInfo::machineUniqueId();
+ if (hostid.isEmpty())
+ QSKIP("Could not get a unique host ID on this machine");
+
+ QString lockFile = dir.path() + "/differentMachinesLock";
+ QLockFile lock1(lockFile);
+ QVERIFY(lock1.lock());
+
+ {
+ // now modify it
+ QFile f;
+ QVERIFY(f.open(QLockFilePrivate::getLockFileHandle(&lock1),
+ QIODevice::ReadWrite | QIODevice::Text,
+ QFile::DontCloseHandle));
+ QVERIFY(overwriteLineInLockFile(f, 1, QT_STRINGIFY(INT_MAX)));
+ QVERIFY(overwriteLineInLockFile(f, 4, "this is not a UUID"));
+ }
+
+ {
+ // we should fail to lock
+ QLockFile lock2(lockFile);
+ QVERIFY(!lock2.tryLock(1000));
+ }
+}
+
+void tst_QLockFile::reboot()
+{
+ const QByteArray bootid = QSysInfo::bootUniqueId();
+ if (bootid.isEmpty())
+ QSKIP("Could not get a unique boot ID on this machine");
+
+ // create a lock so we can get its contents
+ QString lockFile = dir.path() + "/rebootLock";
+ QLockFile lock1(lockFile);
+ QVERIFY(lock1.lock());
+
+ QFile f(lockFile);
+ QVERIFY(f.open(QFile::ReadOnly | QFile::Text));
+ auto lines = f.readAll().split('\n');
+ f.close();
+
+ lock1.unlock();
+
+ // now recreate the file simulating a reboot
+ QVERIFY(f.open(QFile::WriteOnly | QFile::Text));
+ lines[4] = "this is not a UUID";
+ f.write(lines.join('\n'));
+ f.close();
+
+ // we should succeed in locking
+ QVERIFY(lock1.tryLock(0));
+}
+
bool tst_QLockFile::overwritePidInLockFile(const QString &filePath, qint64 pid)
{
QFile f(filePath);
- if (!f.open(QFile::ReadWrite)) {
- qWarning("Cannot open %s.", qPrintable(filePath));
+ if (!f.open(QFile::ReadWrite | QFile::Text)) {
+ qErrnoWarning("Cannot open %s", qPrintable(filePath));
return false;
}
+ return overwriteLineInLockFile(f, 1, QString::number(pid));
+}
+
+bool tst_QLockFile::overwriteLineInLockFile(QFile &f, int line, const QString &newLine)
+{
+ f.seek(0);
QByteArray buf = f.readAll();
- int i = buf.indexOf('\n');
- if (i < 0) {
+ QStringList lines = QString::fromUtf8(buf).split('\n');
+ if (lines.size() < 3 && lines.size() < line - 1) {
qWarning("Unexpected lockfile content.");
return false;
}
- buf.remove(0, i);
- buf.prepend(QByteArray::number(pid));
+ lines[line - 1] = newLine;
f.seek(0);
+ buf = lines.join('\n').toUtf8();
f.resize(buf.size());
return f.write(buf) == buf.size();
}
diff --git a/tests/auto/corelib/io/qlockfile/tst_qlockfile.pro b/tests/auto/corelib/io/qlockfile/tst_qlockfile.pro
index 7a304fe779..da2660fd02 100644
--- a/tests/auto/corelib/io/qlockfile/tst_qlockfile.pro
+++ b/tests/auto/corelib/io/qlockfile/tst_qlockfile.pro
@@ -2,5 +2,5 @@ CONFIG += testcase
TARGET = tst_qlockfile
SOURCES += tst_qlockfile.cpp
-QT = core testlib concurrent
+QT = core-private testlib concurrent
win32:!winrt:LIBS += -ladvapi32
diff --git a/tests/auto/corelib/io/qprocess/tst_qprocess.cpp b/tests/auto/corelib/io/qprocess/tst_qprocess.cpp
index de6eb28503..6b4d292fe3 100644
--- a/tests/auto/corelib/io/qprocess/tst_qprocess.cpp
+++ b/tests/auto/corelib/io/qprocess/tst_qprocess.cpp
@@ -285,7 +285,7 @@ void tst_QProcess::startWithOldOpen()
class OverriddenOpen : public QProcess
{
public:
- virtual bool open(OpenMode mode) Q_DECL_OVERRIDE
+ virtual bool open(OpenMode mode) override
{ return QIODevice::open(mode); }
};
@@ -708,7 +708,7 @@ void tst_QProcess::restartProcessDeadlock()
QCOMPARE(process.write("", 1), qlonglong(1));
QVERIFY(process.waitForFinished(5000));
- QObject::disconnect(&process, static_cast<QProcessFinishedSignal1>(&QProcess::finished), Q_NULLPTR, Q_NULLPTR);
+ QObject::disconnect(&process, static_cast<QProcessFinishedSignal1>(&QProcess::finished), nullptr, nullptr);
QCOMPARE(process.write("", 1), qlonglong(1));
QVERIFY(process.waitForFinished(5000));
@@ -847,7 +847,7 @@ void tst_QProcess::emitReadyReadOnlyWhenNewDataArrives()
QVERIFY(QTestEventLoop::instance().timeout());
QVERIFY(!proc.waitForReadyRead(250));
- QObject::disconnect(&proc, &QIODevice::readyRead, Q_NULLPTR, Q_NULLPTR);
+ QObject::disconnect(&proc, &QIODevice::readyRead, nullptr, nullptr);
proc.write("B");
QVERIFY(proc.waitForReadyRead(5000));
diff --git a/tests/auto/corelib/io/qsettings/tst_qsettings.cpp b/tests/auto/corelib/io/qsettings/tst_qsettings.cpp
index 012ce5f2f5..db756ada39 100644
--- a/tests/auto/corelib/io/qsettings/tst_qsettings.cpp
+++ b/tests/auto/corelib/io/qsettings/tst_qsettings.cpp
@@ -207,7 +207,7 @@ void tst_QSettings::getSetCheck()
QCOMPARE(true, obj1.fallbacksEnabled());
}
-static QString settingsPath(const char *path = Q_NULLPTR)
+static QString settingsPath(const char *path = nullptr)
{
// Temporary path for files that are specified explicitly in the constructor.
#ifndef Q_OS_WINRT
diff --git a/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp b/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp
index 0e423a56ca..df8746e518 100644
--- a/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp
+++ b/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp
@@ -609,14 +609,14 @@ void tst_QTextStream::readLinesFromBufferCRCR()
class ErrorDevice : public QIODevice
{
protected:
- qint64 readData(char *data, qint64 maxlen) Q_DECL_OVERRIDE
+ qint64 readData(char *data, qint64 maxlen) override
{
Q_UNUSED(data)
Q_UNUSED(maxlen)
return -1;
}
- qint64 writeData(const char *data, qint64 len) Q_DECL_OVERRIDE
+ qint64 writeData(const char *data, qint64 len) override
{
Q_UNUSED(data)
Q_UNUSED(len)
@@ -634,7 +634,7 @@ void tst_QTextStream::readLineInto()
ts.readLineInto(&line);
QCOMPARE(line, QStringLiteral("1"));
- ts.readLineInto(Q_NULLPTR, 0); // read the second line, but don't store it
+ ts.readLineInto(nullptr, 0); // read the second line, but don't store it
ts.readLineInto(&line);
QCOMPARE(line, QStringLiteral("3"));
diff --git a/tests/auto/corelib/itemmodels/qidentityproxymodel/tst_qidentityproxymodel.cpp b/tests/auto/corelib/itemmodels/qidentityproxymodel/tst_qidentityproxymodel.cpp
index 564b8547b1..f8c5c92677 100644
--- a/tests/auto/corelib/itemmodels/qidentityproxymodel/tst_qidentityproxymodel.cpp
+++ b/tests/auto/corelib/itemmodels/qidentityproxymodel/tst_qidentityproxymodel.cpp
@@ -360,7 +360,7 @@ class AppendStringProxy : public QIdentityProxyModel
public:
QVariant data(const QModelIndex &index, int role) const
{
- const QVariant result = sourceModel()->data(index, role);
+ const QVariant result = QIdentityProxyModel::data(index, role);
if (role != Qt::DisplayRole)
return result;
return result.toString() + "_appended";
diff --git a/tests/auto/corelib/itemmodels/qitemmodel/tst_qitemmodel.cpp b/tests/auto/corelib/itemmodels/qitemmodel/tst_qitemmodel.cpp
index 8ebb860edd..3d9446965e 100644
--- a/tests/auto/corelib/itemmodels/qitemmodel/tst_qitemmodel.cpp
+++ b/tests/auto/corelib/itemmodels/qitemmodel/tst_qitemmodel.cpp
@@ -533,9 +533,6 @@ void tst_QItemModel::data()
// A valid index should have a valid qvariant data
QVERIFY(currentModel->index(0,0).isValid());
- // shouldn't be able to set data on an invalid index
- QCOMPARE(currentModel->setData(QModelIndex(), "foo", Qt::DisplayRole), false);
-
// General Purpose roles
QVariant variant = currentModel->data(currentModel->index(0,0), Qt::ToolTipRole);
if (variant.isValid()) {
@@ -605,7 +602,6 @@ void tst_QItemModel::setData()
QVERIFY(currentModel);
QSignalSpy spy(currentModel, &QAbstractItemModel::dataChanged);
QVERIFY(spy.isValid());
- QCOMPARE(currentModel->setData(QModelIndex(), QVariant()), false);
QCOMPARE(spy.count(), 0);
QFETCH(bool, isEmpty);
diff --git a/tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp b/tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp
index 1fb51490db..8333809c40 100644
--- a/tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp
+++ b/tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp
@@ -1873,9 +1873,6 @@ void tst_QSortFilterProxyModel::changeFilter()
QCOMPARE(args.at(2).toInt(), finalRemoveIntervals.at(i).second);
}
-#ifdef Q_OS_IRIX
- QEXPECT_FAIL("filter (2)", "Not reliable on IRIX", Abort);
-#endif
QCOMPARE(finalInsertSpy.count(), insertIntervals.count());
for (int i = 0; i < finalInsertSpy.count(); ++i) {
QList<QVariant> args = finalInsertSpy.at(i);
@@ -4072,11 +4069,11 @@ public:
}
bool canDropMimeData(const QMimeData *, Qt::DropAction,
- int row, int /* column */, const QModelIndex & /* parent */) const Q_DECL_OVERRIDE
+ int row, int /* column */, const QModelIndex & /* parent */) const override
{ return row == 1; }
bool dropMimeData(const QMimeData *, Qt::DropAction,
- int row, int /* column */, const QModelIndex & /* parent */) Q_DECL_OVERRIDE
+ int row, int /* column */, const QModelIndex & /* parent */) override
{ return row == 1; }
};
diff --git a/tests/auto/corelib/itemmodels/qstringlistmodel/tst_qstringlistmodel.cpp b/tests/auto/corelib/itemmodels/qstringlistmodel/tst_qstringlistmodel.cpp
index adc8c59bf7..9a54c0a70d 100644
--- a/tests/auto/corelib/itemmodels/qstringlistmodel/tst_qstringlistmodel.cpp
+++ b/tests/auto/corelib/itemmodels/qstringlistmodel/tst_qstringlistmodel.cpp
@@ -112,12 +112,6 @@ void tst_QStringListModel::rowsAboutToBeRemoved_rowsRemoved_data()
QStringList res3;
QTest::newRow( "data3" ) << strings3 << 0 << 5 << aboutto3 << res3;
- /* Not sure if this is a valid test */
- QStringList strings4; strings4 << "One" << "Two" << "Three" << "Four" << "Five";
- QStringList aboutto4; aboutto4 << "Five" << "";
- QStringList res4; res4 << "One" << "Two" << "Three" << "Four";
- QTest::newRow( "data4" ) << strings4 << 4 << 2 << aboutto4 << res4;
-
/*
* Keep this, template to add more data
QStringList strings2; strings2 << "One" << "Two" << "Three" << "Four" << "Five";
diff --git a/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp b/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp
index 22f0d8ecaa..5e9dbdd226 100644
--- a/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp
+++ b/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp
@@ -56,7 +56,7 @@ class ThreadedEventReceiver : public QObject
Q_OBJECT
public:
QList<int> recordedEvents;
- bool event(QEvent *event) Q_DECL_OVERRIDE
+ bool event(QEvent *event) override
{
if (event->type() != QEvent::Type(QEvent::User + 1))
return QObject::event(event);
@@ -70,7 +70,7 @@ public:
class Thread : public QDaemonThread
{
- void run() Q_DECL_OVERRIDE
+ void run() override
{
QThreadData *data = QThreadData::current();
QVERIFY(!data->requiresCoreApplication); // daemon thread
diff --git a/tests/auto/corelib/kernel/qmetamethod/tst_qmetamethod.cpp b/tests/auto/corelib/kernel/qmetamethod/tst_qmetamethod.cpp
index 87196eaef1..4584b6ce31 100644
--- a/tests/auto/corelib/kernel/qmetamethod/tst_qmetamethod.cpp
+++ b/tests/auto/corelib/kernel/qmetamethod/tst_qmetamethod.cpp
@@ -763,7 +763,7 @@ void tst_QMetaMethod::gadget()
{
// Call with null should not crash
- MyGadget *gadget = Q_NULLPTR;
+ MyGadget *gadget = nullptr;
QString string;
QVERIFY(!setValueMethod.invokeOnGadget(gadget, Q_ARG(QString, QLatin1String("hi"))));
QVERIFY(!getValueMethod.invokeOnGadget(gadget, Q_RETURN_ARG(QString, string)));
diff --git a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp
index 5ecdd92228..f6feac29dc 100644
--- a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp
+++ b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp
@@ -6015,7 +6015,7 @@ public:
struct SlotArgFunctor
{
- SlotArgFunctor(int *s) : status(s), context(Q_NULLPTR), sender(Q_NULLPTR) {}
+ SlotArgFunctor(int *s) : status(s), context(nullptr), sender(nullptr) {}
SlotArgFunctor(ContextObject *context, QObject *sender, int *s) : status(s), context(context), sender(sender) {}
void operator()() { *status = 2; if (context) context->compareSender(sender); }
@@ -6453,7 +6453,7 @@ Q_SIGNALS:
static int countedStructObjectsCount = 0;
struct CountedStruct
{
- CountedStruct() : sender(Q_NULLPTR) { ++countedStructObjectsCount; }
+ CountedStruct() : sender(nullptr) { ++countedStructObjectsCount; }
CountedStruct(GetSenderObject *sender) : sender(sender) { ++countedStructObjectsCount; }
CountedStruct(const CountedStruct &o) : sender(o.sender) { ++countedStructObjectsCount; }
CountedStruct &operator=(const CountedStruct &) { return *this; }
@@ -6769,7 +6769,7 @@ class CountedExceptionThrower : public QObject
Q_OBJECT
public:
- explicit CountedExceptionThrower(bool throwException, QObject *parent = Q_NULLPTR)
+ explicit CountedExceptionThrower(bool throwException, QObject *parent = nullptr)
: QObject(parent)
{
if (throwException)
@@ -6855,7 +6855,7 @@ void tst_QObject::exceptions()
try {
class ParentObject : public QObject {
public:
- explicit ParentObject(QObject *parent = Q_NULLPTR)
+ explicit ParentObject(QObject *parent = nullptr)
: QObject(parent)
{
new CountedExceptionThrower(false, this);
diff --git a/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp b/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp
index b921c0f13d..2c6d9ea7c0 100644
--- a/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp
+++ b/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp
@@ -754,7 +754,7 @@ void tst_QTimer::recurseOnTimeoutAndStopTimer()
struct CountedStruct
{
- CountedStruct(int *count, QThread *t = Q_NULLPTR) : count(count), thread(t) { }
+ CountedStruct(int *count, QThread *t = nullptr) : count(count), thread(t) { }
~CountedStruct() { }
void operator()() const { ++(*count); if (thread) QCOMPARE(QThread::currentThread(), thread); }
@@ -763,7 +763,7 @@ struct CountedStruct
};
static QScopedPointer<QEventLoop> _e;
-static QThread *_t = Q_NULLPTR;
+static QThread *_t = nullptr;
class StaticEventLoop
{
@@ -827,7 +827,7 @@ void tst_QTimer::singleShotToFunctors()
_t->quit();
_t->wait();
_t->deleteLater();
- _t = Q_NULLPTR;
+ _t = nullptr;
{
QObject c3;
@@ -865,7 +865,7 @@ void tst_QTimer::singleShotToFunctors()
QCOMPARE(count, 5);
_e.reset();
- _t = Q_NULLPTR;
+ _t = nullptr;
}
void tst_QTimer::singleShot_chrono()
diff --git a/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp b/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp
index 0d45159d09..5d19cb8428 100644
--- a/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp
+++ b/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp
@@ -4927,7 +4927,7 @@ void tst_QVariant::accessSequentialContainerKey()
{
QMap<QString, QObject*> mapping;
QString name = QString::fromLatin1("Seven");
- mapping.insert(name, Q_NULLPTR);
+ mapping.insert(name, nullptr);
QVariant variant = QVariant::fromValue(mapping);
diff --git a/tests/auto/corelib/statemachine/qstatemachine/tst_qstatemachine.cpp b/tests/auto/corelib/statemachine/qstatemachine/tst_qstatemachine.cpp
index 8f0d83ce32..c30efe4e3b 100644
--- a/tests/auto/corelib/statemachine/qstatemachine/tst_qstatemachine.cpp
+++ b/tests/auto/corelib/statemachine/qstatemachine/tst_qstatemachine.cpp
@@ -6634,7 +6634,7 @@ void tst_QStateMachine::postEventFromBeginSelectTransitions()
{
class StateMachine : public QStateMachine {
protected:
- void beginSelectTransitions(QEvent* e) Q_DECL_OVERRIDE {
+ void beginSelectTransitions(QEvent* e) override {
if (e->type() == QEvent::Type(QEvent::User + 2))
postEvent(new QEvent(QEvent::Type(QEvent::User + 1)), QStateMachine::HighPriority);
}
diff --git a/tests/auto/corelib/thread/qfuture/tst_qfuture.cpp b/tests/auto/corelib/thread/qfuture/tst_qfuture.cpp
index 58bebe19ac..d4a3ee6054 100644
--- a/tests/auto/corelib/thread/qfuture/tst_qfuture.cpp
+++ b/tests/auto/corelib/thread/qfuture/tst_qfuture.cpp
@@ -1304,8 +1304,8 @@ QFuture<int> createExceptionResultFuture()
class DerivedException : public QException
{
public:
- void raise() const Q_DECL_OVERRIDE { throw *this; }
- DerivedException *clone() const Q_DECL_OVERRIDE { return new DerivedException(*this); }
+ void raise() const override { throw *this; }
+ DerivedException *clone() const override { return new DerivedException(*this); }
};
QFuture<void> createDerivedExceptionFuture()
@@ -1455,7 +1455,7 @@ void tst_QFuture::nonGlobalThreadPool()
return f;
}
- void run() Q_DECL_OVERRIDE
+ void run() override
{
const int ms = 100 + (QRandomGenerator::global()->bounded(100) - 100/2);
QThread::msleep(ms);
diff --git a/tests/auto/corelib/thread/qwaitcondition/tst_qwaitcondition.cpp b/tests/auto/corelib/thread/qwaitcondition/tst_qwaitcondition.cpp
index 4ef3bab87f..126cb6b180 100644
--- a/tests/auto/corelib/thread/qwaitcondition/tst_qwaitcondition.cpp
+++ b/tests/auto/corelib/thread/qwaitcondition/tst_qwaitcondition.cpp
@@ -379,7 +379,7 @@ class WakeThreadBase : public TerminatingThread
public:
QAtomicInt *count;
- WakeThreadBase() : count(Q_NULLPTR) {}
+ WakeThreadBase() : count(nullptr) {}
};
class wake_Thread : public WakeThreadBase
diff --git a/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp b/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp
index 93c10d78db..338adaabf7 100644
--- a/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp
+++ b/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp
@@ -756,13 +756,7 @@ void tst_QByteArray::qvsnprintf()
QCOMPARE(static_cast<const char *>(buf), "bub****************");
# endif
#else
-#ifdef Q_OS_IRIX
- // Irix reports back the amount of characters written without the \0
- QCOMPARE(::qsnprintf(buf, 3, "%s", "bubu"), 2);
-#else
- // Every other system in this world reports the amount of data that could have been written
QCOMPARE(::qsnprintf(buf, 3, "%s", "bubu"), 4);
-#endif
QCOMPARE(static_cast<const char*>(buf), "bu");
#endif
QCOMPARE(buf[4], char(42));
diff --git a/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp b/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp
index c0ed88e154..7e1e2f1345 100644
--- a/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp
+++ b/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp
@@ -1263,9 +1263,6 @@ void tst_QDateTime::addSecs()
QFETCH(QDateTime, dt);
QFETCH(int, nsecs);
QFETCH(QDateTime, result);
-#ifdef Q_OS_IRIX
- QEXPECT_FAIL("cet4", "IRIX databases say 1970 had DST", Abort);
-#endif
QDateTime test = dt.addSecs(nsecs);
QCOMPARE(test, result);
QCOMPARE(test.timeSpec(), dt.timeSpec());
@@ -1285,9 +1282,6 @@ void tst_QDateTime::addMSecs()
QFETCH(int, nsecs);
QFETCH(QDateTime, result);
-#ifdef Q_OS_IRIX
- QEXPECT_FAIL("cet4", "IRIX databases say 1970 had DST", Abort);
-#endif
QDateTime test = dt.addMSecs(qint64(nsecs) * 1000);
QCOMPARE(test, result);
QCOMPARE(test.timeSpec(), dt.timeSpec());
@@ -1373,9 +1367,6 @@ void tst_QDateTime::toTimeSpec()
QCOMPARE(localToLocal.time(), fromLocal.time());
QCOMPARE(localToLocal.timeSpec(), Qt::LocalTime);
-#ifdef Q_OS_IRIX
- QEXPECT_FAIL("summer2", "IRIX databases say 1970 had DST", Abort);
-#endif
QCOMPARE(utcToLocal, fromLocal);
QCOMPARE(utcToLocal.date(), fromLocal.date());
QCOMPARE(utcToLocal.time(), fromLocal.time());
@@ -1427,9 +1418,6 @@ void tst_QDateTime::toLocalTime()
QFETCH(QDateTime, fromLocal);
QCOMPARE(fromLocal.toLocalTime(), fromLocal);
-#ifdef Q_OS_IRIX
- QEXPECT_FAIL("summer2", "IRIX databases say 1970 had DST", Abort);
-#endif
QCOMPARE(fromUtc.toLocalTime(), fromLocal);
QCOMPARE(fromUtc.toLocalTime(), fromLocal.toLocalTime());
} else {
@@ -1449,9 +1437,6 @@ void tst_QDateTime::toUTC()
QFETCH(QDateTime, fromLocal);
QCOMPARE(fromUtc.toUTC(), fromUtc);
-#ifdef Q_OS_IRIX
- QEXPECT_FAIL("summer2", "IRIX databases say 1970 had DST", Abort);
-#endif
QCOMPARE(fromLocal.toUTC(), fromUtc);
QCOMPARE(fromUtc.toUTC(), fromLocal.toUTC());
} else {
@@ -1512,9 +1497,6 @@ void tst_QDateTime::secsTo()
QFETCH(QDateTime, result);
if (dt.isValid()) {
- #ifdef Q_OS_IRIX
- QEXPECT_FAIL("cet4", "IRIX databases say 1970 had DST", Abort);
- #endif
QCOMPARE(dt.secsTo(result), (qint64)nsecs);
QCOMPARE(result.secsTo(dt), (qint64)-nsecs);
QVERIFY((dt == result) == (0 == nsecs));
@@ -1541,9 +1523,6 @@ void tst_QDateTime::msecsTo()
QFETCH(QDateTime, result);
if (dt.isValid()) {
- #ifdef Q_OS_IRIX
- QEXPECT_FAIL("cet4", "IRIX databases say 1970 had DST", Abort);
- #endif
QCOMPARE(dt.msecsTo(result), qint64(nsecs) * 1000);
QCOMPARE(result.msecsTo(dt), -qint64(nsecs) * 1000);
QVERIFY((dt == result) == (0 == (qint64(nsecs) * 1000)));
diff --git a/tests/auto/corelib/tools/qlatin1string/tst_qlatin1string.cpp b/tests/auto/corelib/tools/qlatin1string/tst_qlatin1string.cpp
index c8373b6ae9..dcfb0aa042 100644
--- a/tests/auto/corelib/tools/qlatin1string/tst_qlatin1string.cpp
+++ b/tests/auto/corelib/tools/qlatin1string/tst_qlatin1string.cpp
@@ -86,7 +86,7 @@ void tst_QLatin1String::nullString()
// default ctor
{
QLatin1String l1;
- QCOMPARE(static_cast<const void*>(l1.data()), static_cast<const void*>(Q_NULLPTR));
+ QCOMPARE(static_cast<const void*>(l1.data()), static_cast<const void*>(nullptr));
QCOMPARE(l1.size(), 0);
QString s = l1;
@@ -95,9 +95,9 @@ void tst_QLatin1String::nullString()
// from nullptr
{
- const char *null = Q_NULLPTR;
+ const char *null = nullptr;
QLatin1String l1(null);
- QCOMPARE(static_cast<const void*>(l1.data()), static_cast<const void*>(Q_NULLPTR));
+ QCOMPARE(static_cast<const void*>(l1.data()), static_cast<const void*>(nullptr));
QCOMPARE(l1.size(), 0);
QString s = l1;
@@ -111,7 +111,7 @@ void tst_QLatin1String::nullString()
QLatin1String l1(null);
QEXPECT_FAIL("", "null QByteArrays become non-null QLatin1Strings...", Continue);
- QCOMPARE(static_cast<const void*>(l1.data()), static_cast<const void*>(Q_NULLPTR));
+ QCOMPARE(static_cast<const void*>(l1.data()), static_cast<const void*>(nullptr));
QCOMPARE(l1.size(), 0);
QString s = l1;
diff --git a/tests/auto/corelib/tools/qringbuffer/tst_qringbuffer.cpp b/tests/auto/corelib/tools/qringbuffer/tst_qringbuffer.cpp
index 145ba7ff72..deee7171b1 100644
--- a/tests/auto/corelib/tools/qringbuffer/tst_qringbuffer.cpp
+++ b/tests/auto/corelib/tools/qringbuffer/tst_qringbuffer.cpp
@@ -68,7 +68,7 @@ void tst_QRingBuffer::constructing()
QCOMPARE(ringBuffer.size(), Q_INT64_C(0));
QVERIFY(ringBuffer.isEmpty());
QCOMPARE(ringBuffer.nextDataBlockSize(), Q_INT64_C(0));
- QVERIFY(ringBuffer.readPointer() == Q_NULLPTR);
+ QVERIFY(ringBuffer.readPointer() == nullptr);
QCOMPARE(ringBuffer.skip(5), Q_INT64_C(0));
QCOMPARE(ringBuffer.read(), QByteArray());
QCOMPARE(ringBuffer.getChar(), -1);
diff --git a/tests/auto/corelib/tools/qscopedpointer/tst_qscopedpointer.cpp b/tests/auto/corelib/tools/qscopedpointer/tst_qscopedpointer.cpp
index a4b06d1b3b..b943b04e23 100644
--- a/tests/auto/corelib/tools/qscopedpointer/tst_qscopedpointer.cpp
+++ b/tests/auto/corelib/tools/qscopedpointer/tst_qscopedpointer.cpp
@@ -68,6 +68,7 @@ void tst_QScopedPointer::defaultConstructor()
/* Check that the members, one, is correctly initialized. */
QScopedPointer<int> p;
QCOMPARE(p.data(), static_cast<int *>(0));
+ QCOMPARE(p.get(), static_cast<int *>(0));
}
void tst_QScopedPointer::dataOnDefaultConstructed()
@@ -75,6 +76,7 @@ void tst_QScopedPointer::dataOnDefaultConstructed()
QScopedPointer<int> p;
QCOMPARE(p.data(), static_cast<int *>(0));
+ QCOMPARE(p.get(), static_cast<int *>(0));
}
class MyClass
@@ -113,6 +115,7 @@ void tst_QScopedPointer::reset()
QScopedPointer<int> p;
p.reset();
QCOMPARE(p.data(), static_cast<int *>(0));
+ QCOMPARE(p.get(), static_cast<int *>(0));
}
/* Call reset() on an active value. */
@@ -120,6 +123,7 @@ void tst_QScopedPointer::reset()
QScopedPointer<int> p(new int(3));
p.reset();
QCOMPARE(p.data(), static_cast<int *>(0));
+ QCOMPARE(p.get(), static_cast<int *>(0));
}
/* Call reset() with a value, on an active value. */
@@ -129,6 +133,7 @@ void tst_QScopedPointer::reset()
int *const value = new int(9);
p.reset(value);
QCOMPARE(*p.data(), 9);
+ QCOMPARE(*p.get(), 9);
}
/* Call reset() with a value, on default constructed value. */
@@ -138,6 +143,7 @@ void tst_QScopedPointer::reset()
int *const value = new int(9);
p.reset(value);
QCOMPARE(*p.data(), 9);
+ QCOMPARE(*p.get(), 9);
}
}
diff --git a/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp b/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp
index e1dcdb8407..203d9d8683 100644
--- a/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp
+++ b/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp
@@ -272,6 +272,7 @@ void tst_QSharedPointer::basics()
QCOMPARE(!ptr, isNull);
QCOMPARE(ptr.data(), aData);
+ QCOMPARE(ptr.get(), aData);
QCOMPARE(ptr.operator->(), aData);
if (!isNull) {
Data &dataReference = *ptr;
@@ -316,6 +317,7 @@ void tst_QSharedPointer::basics()
QCOMPARE(copy.isNull(), isNull);
QCOMPARE(copy.data(), aData);
+ QCOMPARE(copy.get(), aData);
QVERIFY(copy == aData);
}
QVERIFY(!refCountData(ptr) || refCountData(ptr)->weakref.load() == 1);
@@ -349,6 +351,7 @@ void tst_QSharedPointer::basics()
QVERIFY(strong == weak);
QVERIFY(strong == ptr);
QCOMPARE(strong.data(), aData);
+ QCOMPARE(strong.get(), aData);
}
QVERIFY(!refCountData(ptr) || refCountData(ptr)->weakref.load() == 1);
QVERIFY(!refCountData(ptr) || refCountData(ptr)->strongref.load() == 1);
@@ -362,11 +365,14 @@ void tst_QSharedPointer::operators()
QSharedPointer<char> p2(new char);
qptrdiff diff = p2.data() - p1.data();
QVERIFY(p1.data() != p2.data());
+ QVERIFY(p1.get() != p2.get());
QVERIFY(diff != 0);
// operator-
QCOMPARE(p2 - p1.data(), diff);
+ QCOMPARE(p2 - p1.get(), diff);
QCOMPARE(p2.data() - p1, diff);
+ QCOMPARE(p2.get() - p1, diff);
QCOMPARE(p2 - p1, diff);
QCOMPARE(p1 - p2, -diff);
QCOMPARE(p1 - p1, qptrdiff(0));
@@ -374,7 +380,9 @@ void tst_QSharedPointer::operators()
// operator<
QVERIFY(p1 < p2.data());
+ QVERIFY(p1 < p2.get());
QVERIFY(p1.data() < p2);
+ QVERIFY(p1.get() < p2);
QVERIFY(p1 < p2);
QVERIFY(!(p2 < p1));
QVERIFY(!(p2 < p2));
@@ -382,7 +390,9 @@ void tst_QSharedPointer::operators()
// qHash
QCOMPARE(qHash(p1), qHash(p1.data()));
+ QCOMPARE(qHash(p1), qHash(p1.get()));
QCOMPARE(qHash(p2), qHash(p2.data()));
+ QCOMPARE(qHash(p2), qHash(p2.get()));
}
void tst_QSharedPointer::nullptrOps()
@@ -396,11 +406,13 @@ void tst_QSharedPointer::nullptrOps()
QVERIFY(nullptr == p1);
QVERIFY(!p1);
QVERIFY(!p1.data());
+ QVERIFY(!p1.get());
QVERIFY(p2 == null);
QVERIFY(p2 == nullptr);
QVERIFY(nullptr == p2);
QVERIFY(!p2);
QVERIFY(!p2.data());
+ QVERIFY(!p2.get());
QVERIFY(p1 == p2);
QSharedPointer<char> p3 = p1;
@@ -409,6 +421,7 @@ void tst_QSharedPointer::nullptrOps()
QVERIFY(p3 == nullptr);
QVERIFY(nullptr == p3);
QVERIFY(!p3.data());
+ QVERIFY(!p3.get());
p3 = nullptr;
@@ -421,6 +434,7 @@ void tst_QSharedPointer::nullptrOps()
QSharedPointer<char> p4(new char);
QVERIFY(p4);
QVERIFY(p4.data());
+ QVERIFY(p4.get());
QVERIFY(p4 != nullptr);
QVERIFY(nullptr != p4);
QVERIFY(p4 != p1);
diff --git a/tests/auto/corelib/tools/qstring/tst_qstring.cpp b/tests/auto/corelib/tools/qstring/tst_qstring.cpp
index 70ccc72630..f6840e60a8 100644
--- a/tests/auto/corelib/tools/qstring/tst_qstring.cpp
+++ b/tests/auto/corelib/tools/qstring/tst_qstring.cpp
@@ -249,7 +249,7 @@ class CharStarContainer
{
const char *str;
public:
- explicit Q_DECL_CONSTEXPR CharStarContainer(const char *s = Q_NULLPTR) : str(s) {}
+ explicit Q_DECL_CONSTEXPR CharStarContainer(const char *s = nullptr) : str(s) {}
Q_DECL_CONSTEXPR operator const char *() const { return str; }
};
@@ -1483,7 +1483,7 @@ void tst_QString::indexOf()
QRegularExpression re(QRegularExpression::escape(needle), options);
QCOMPARE( haystack.indexOf(re, startpos), resultpos );
- QCOMPARE(haystack.indexOf(re, startpos, Q_NULLPTR), resultpos);
+ QCOMPARE(haystack.indexOf(re, startpos, nullptr), resultpos);
QRegularExpressionMatch match;
QVERIFY(!match.hasMatch());
@@ -1608,7 +1608,7 @@ void tst_QString::indexOfInvalidRegex()
QTest::ignoreMessage(QtWarningMsg, "QString::indexOf: invalid QRegularExpression object");
QCOMPARE(QString("invalid regex\\").indexOf(QRegularExpression("invalid regex\\")), -1);
QTest::ignoreMessage(QtWarningMsg, "QString::indexOf: invalid QRegularExpression object");
- QCOMPARE(QString("invalid regex\\").indexOf(QRegularExpression("invalid regex\\"), -1, Q_NULLPTR), -1);
+ QCOMPARE(QString("invalid regex\\").indexOf(QRegularExpression("invalid regex\\"), -1, nullptr), -1);
QRegularExpressionMatch match;
QVERIFY(!match.hasMatch());
@@ -1706,7 +1706,7 @@ void tst_QString::lastIndexOf()
QRegularExpression re(QRegularExpression::escape(needle), options);
QCOMPARE(haystack.lastIndexOf(re, from), expected);
- QCOMPARE(haystack.lastIndexOf(re, from, Q_NULLPTR), expected);
+ QCOMPARE(haystack.lastIndexOf(re, from, nullptr), expected);
QRegularExpressionMatch match;
QVERIFY(!match.hasMatch());
QCOMPARE(haystack.lastIndexOf(re, from, &match), expected);
@@ -1743,7 +1743,7 @@ void tst_QString::lastIndexOfInvalidRegex()
QTest::ignoreMessage(QtWarningMsg, "QString::lastIndexOf: invalid QRegularExpression object");
QCOMPARE(QString("invalid regex\\").lastIndexOf(QRegularExpression("invalid regex\\"), 0), -1);
QTest::ignoreMessage(QtWarningMsg, "QString::lastIndexOf: invalid QRegularExpression object");
- QCOMPARE(QString("invalid regex\\").lastIndexOf(QRegularExpression("invalid regex\\"), -1, Q_NULLPTR), -1);
+ QCOMPARE(QString("invalid regex\\").lastIndexOf(QRegularExpression("invalid regex\\"), -1, nullptr), -1);
QRegularExpressionMatch match;
QVERIFY(!match.hasMatch());
diff --git a/tests/auto/corelib/tools/qstringref/tst_qstringref.cpp b/tests/auto/corelib/tools/qstringref/tst_qstringref.cpp
index 473f563f9b..581e9152e6 100644
--- a/tests/auto/corelib/tools/qstringref/tst_qstringref.cpp
+++ b/tests/auto/corelib/tools/qstringref/tst_qstringref.cpp
@@ -121,14 +121,6 @@ typedef QList<int> IntList;
#if defined(Q_OS_SOLARIS)
# include <ieeefp.h>
#endif
-#if defined(Q_OS_OSF) && (defined(__DECC) || defined(__DECCXX))
-# define INFINITY DBL_INFINITY
-# define NAN DBL_QNAN
-#endif
-#if defined(Q_OS_IRIX) && defined(Q_CC_GNU)
-# include <ieeefp.h>
-# define isnan(d) isnand(d)
-#endif
enum {
LittleEndian,
diff --git a/tests/auto/corelib/tools/qtimezone/tst_qtimezone.cpp b/tests/auto/corelib/tools/qtimezone/tst_qtimezone.cpp
index 9f22c3d51d..6b103d355a 100644
--- a/tests/auto/corelib/tools/qtimezone/tst_qtimezone.cpp
+++ b/tests/auto/corelib/tools/qtimezone/tst_qtimezone.cpp
@@ -1177,7 +1177,8 @@ void tst_QTimeZone::testEpochTranPrivate(const QTimeZonePrivate &tzp)
// Pre-epoch time-zones might not be supported at all:
tran = tzp.nextTransition(QDateTime(QDate(1601, 1, 1), QTime(0, 0),
Qt::UTC).toMSecsSinceEpoch());
- if (tran.atMSecsSinceEpoch != QTimeZonePrivate::invalidSeconds()
+ if (tran.atMSecsSinceEpoch != QTimeZonePrivate::invalidMSecs()
+ // Toronto *did* have a transition before 1970 (DST since 1918):
&& tran.atMSecsSinceEpoch < 0) {
// ... but, if they are, we should be able to search back to them:
tran = tzp.previousTransition(0); // i.e. last before epoch
diff --git a/tests/auto/corelib/tools/qvector/tst_qvector.cpp b/tests/auto/corelib/tools/qvector/tst_qvector.cpp
index 374fec221e..56daea31fe 100644
--- a/tests/auto/corelib/tools/qvector/tst_qvector.cpp
+++ b/tests/auto/corelib/tools/qvector/tst_qvector.cpp
@@ -2803,7 +2803,7 @@ void tst_QVector::detachThreadSafety() const
static const uint threadsCount = 5;
struct : QThread {
- void run() Q_DECL_OVERRIDE
+ void run() override
{
QVector<T> copy(*detachThreadSafetyData<T>()->load());
QVERIFY(!copy.isDetached());
diff --git a/tests/auto/corelib/xml/qxmlstream/tst_qxmlstream.cpp b/tests/auto/corelib/xml/qxmlstream/tst_qxmlstream.cpp
index 79cd17b5b3..16a4200b5d 100644
--- a/tests/auto/corelib/xml/qxmlstream/tst_qxmlstream.cpp
+++ b/tests/auto/corelib/xml/qxmlstream/tst_qxmlstream.cpp
@@ -576,6 +576,7 @@ private slots:
void invalidStringCharacters_data() const;
void invalidStringCharacters() const;
void hasError() const;
+ void readBack() const;
private:
static QByteArray readFile(const QString &filename);
@@ -1695,5 +1696,50 @@ void tst_QXmlStream::invalidStringCharacters_data() const
//
}
+static bool isValidSingleTextChar(const ushort c)
+{
+ // Conforms to https://www.w3.org/TR/REC-xml/#NT-Char - except for the high range, which is done
+ // with surrogates.
+ // Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF]
+ static const QPair<ushort, ushort> validRanges[] = {
+ QPair<ushort, ushort>(0x9, 0xb),
+ QPair<ushort, ushort>(0xd, 0xe),
+ QPair<ushort, ushort>(0x20, 0xd800),
+ QPair<ushort, ushort>(0xe000, 0xfffe)
+ };
+
+ for (const QPair<ushort, ushort> &range : validRanges) {
+ if (c >= range.first && c < range.second)
+ return true;
+ }
+ return false;
+}
+
+void tst_QXmlStream::readBack() const
+{
+ for (ushort c = 0; c < std::numeric_limits<ushort>::max(); ++c) {
+ QBuffer buffer;
+
+ QVERIFY(buffer.open(QIODevice::WriteOnly));
+ QXmlStreamWriter writer(&buffer);
+ writer.writeStartDocument();
+ writer.writeTextElement("a", QString(QChar(c)));
+ writer.writeEndDocument();
+ buffer.close();
+
+ if (writer.hasError()) {
+ QVERIFY2(!isValidSingleTextChar(c), QByteArray::number(c));
+ } else {
+ QVERIFY2(isValidSingleTextChar(c), QByteArray::number(c));
+ QVERIFY(buffer.open(QIODevice::ReadOnly));
+ QXmlStreamReader reader(&buffer);
+ do {
+ reader.readNext();
+ } while (!reader.atEnd());
+ QVERIFY2(!reader.hasError(), QByteArray::number(c));
+ }
+ }
+}
+
#include "tst_qxmlstream.moc"
// vim: et:ts=4:sw=4:sts=4
diff --git a/tests/auto/gui/itemmodels/qstandarditemmodel/tst_qstandarditemmodel.cpp b/tests/auto/gui/itemmodels/qstandarditemmodel/tst_qstandarditemmodel.cpp
index 2f5537adfe..a07f45ef1d 100644
--- a/tests/auto/gui/itemmodels/qstandarditemmodel/tst_qstandarditemmodel.cpp
+++ b/tests/auto/gui/itemmodels/qstandarditemmodel/tst_qstandarditemmodel.cpp
@@ -130,6 +130,8 @@ private slots:
void getMimeDataWithInvalidModelIndex();
void supportedDragDropActions();
+ void taskQTBUG_45114_setItemData();
+
private:
QAbstractItemModel *m_model;
QPersistentModelIndex persistent;
@@ -1701,5 +1703,65 @@ void tst_QStandardItemModel::supportedDragDropActions()
QCOMPARE(model.supportedDropActions(), Qt::CopyAction | Qt::MoveAction);
}
+void tst_QStandardItemModel::taskQTBUG_45114_setItemData()
+{
+ QStandardItemModel model;
+ QSignalSpy spy(&model, &QStandardItemModel::itemChanged);
+
+ QStandardItem *item = new QStandardItem("item");
+ item->setData(1, Qt::UserRole + 1);
+ item->setData(2, Qt::UserRole + 2);
+ model.appendRow(item);
+
+ QModelIndex index = item->index();
+ QCOMPARE(model.itemData(index).size(), 3);
+
+ QCOMPARE(spy.count(), 0);
+
+ QMap<int, QVariant> roles;
+
+ roles.insert(Qt::UserRole + 1, 1);
+ roles.insert(Qt::UserRole + 2, 2);
+ model.setItemData(index, roles);
+
+ QCOMPARE(spy.count(), 0);
+
+ roles.insert(Qt::UserRole + 1, 1);
+ roles.insert(Qt::UserRole + 2, 2);
+ roles.insert(Qt::UserRole + 3, QVariant());
+ model.setItemData(index, roles);
+
+ QCOMPARE(spy.count(), 0);
+
+ roles.clear();
+ roles.insert(Qt::UserRole + 1, 10);
+ roles.insert(Qt::UserRole + 3, 12);
+ model.setItemData(index, roles);
+
+ QCOMPARE(spy.count(), 1);
+ QMap<int, QVariant> itemRoles = model.itemData(index);
+
+ QCOMPARE(itemRoles.size(), 4);
+ QCOMPARE(itemRoles[Qt::UserRole + 1].toInt(), 10);
+ QCOMPARE(itemRoles[Qt::UserRole + 2].toInt(), 2);
+ QCOMPARE(itemRoles[Qt::UserRole + 3].toInt(), 12);
+
+ roles.clear();
+ roles.insert(Qt::UserRole + 3, 1);
+ model.setItemData(index, roles);
+
+ QCOMPARE(spy.count(), 2);
+
+ roles.clear();
+ roles.insert(Qt::UserRole + 3, QVariant());
+ model.setItemData(index, roles);
+
+ QCOMPARE(spy.count(), 3);
+
+ itemRoles = model.itemData(index);
+ QCOMPARE(itemRoles.size(), 3);
+ QVERIFY(!itemRoles.keys().contains(Qt::UserRole + 3));
+}
+
QTEST_MAIN(tst_QStandardItemModel)
#include "tst_qstandarditemmodel.moc"
diff --git a/tests/auto/gui/kernel/qopenglwindow/tst_qopenglwindow.cpp b/tests/auto/gui/kernel/qopenglwindow/tst_qopenglwindow.cpp
index d882dc3888..f74ae00bff 100644
--- a/tests/auto/gui/kernel/qopenglwindow/tst_qopenglwindow.cpp
+++ b/tests/auto/gui/kernel/qopenglwindow/tst_qopenglwindow.cpp
@@ -74,17 +74,17 @@ public:
initCount = resizeCount = paintCount = 0;
}
- void initializeGL() Q_DECL_OVERRIDE {
+ void initializeGL() override {
++initCount;
}
- void resizeGL(int w, int h) Q_DECL_OVERRIDE {
+ void resizeGL(int w, int h) override {
++resizeCount;
QCOMPARE(w, size().width());
QCOMPARE(h, size().height());
}
- void paintGL() Q_DECL_OVERRIDE {
+ void paintGL() override {
++paintCount;
QOpenGLContext *ctx = QOpenGLContext::currentContext();
@@ -144,7 +144,7 @@ void tst_QOpenGLWindow::basic()
class PainterWindow : public QOpenGLWindow
{
public:
- void paintGL() Q_DECL_OVERRIDE {
+ void paintGL() override {
QOpenGLContext *ctx = QOpenGLContext::currentContext();
QVERIFY(ctx);
QCOMPARE(ctx, context());
@@ -183,7 +183,7 @@ public:
PartialPainterWindow(QOpenGLWindow::UpdateBehavior u)
: QOpenGLWindow(u), x(0) { }
- void paintGL() Q_DECL_OVERRIDE {
+ void paintGL() override {
++paintCount;
QPainter p(this);
@@ -244,7 +244,7 @@ public:
Error
} m_state;
- void paintUnderGL() Q_DECL_OVERRIDE {
+ void paintUnderGL() override {
if (m_state == None || m_state == PaintOver)
m_state = PaintUnder;
else
@@ -255,7 +255,7 @@ public:
QCOMPARE(fbo, GLuint(0));
}
- void paintGL() Q_DECL_OVERRIDE {
+ void paintGL() override {
if (m_state == PaintUnder)
m_state = Paint;
else
@@ -268,7 +268,7 @@ public:
QCOMPARE(fbo, defaultFramebufferObject());
}
- void paintOverGL() Q_DECL_OVERRIDE {
+ void paintOverGL() override {
if (m_state == Paint)
m_state = PaintOver;
else
diff --git a/tests/auto/gui/kernel/qrasterwindow/tst_qrasterwindow.cpp b/tests/auto/gui/kernel/qrasterwindow/tst_qrasterwindow.cpp
index 3421622fe3..ffc440ac2d 100644
--- a/tests/auto/gui/kernel/qrasterwindow/tst_qrasterwindow.cpp
+++ b/tests/auto/gui/kernel/qrasterwindow/tst_qrasterwindow.cpp
@@ -54,7 +54,7 @@ class PainterWindow : public QRasterWindow
public:
void reset() { paintCount = 0; }
- void paintEvent(QPaintEvent*) Q_DECL_OVERRIDE {
+ void paintEvent(QPaintEvent*) override {
++paintCount;
QPainter p(this);
p.fillRect(QRect(0, 0, 100, 100), Qt::blue);
diff --git a/tests/auto/gui/kernel/qtouchevent/tst_qtouchevent.cpp b/tests/auto/gui/kernel/qtouchevent/tst_qtouchevent.cpp
index ec143896ab..706c66ef14 100644
--- a/tests/auto/gui/kernel/qtouchevent/tst_qtouchevent.cpp
+++ b/tests/auto/gui/kernel/qtouchevent/tst_qtouchevent.cpp
@@ -48,7 +48,7 @@ public:
ulong timestamp;
QTouchDevice *deviceFromEvent;
- explicit tst_QTouchEventWidget(QWidget *parent = Q_NULLPTR) : QWidget(parent)
+ explicit tst_QTouchEventWidget(QWidget *parent = nullptr) : QWidget(parent)
{
reset();
}
@@ -63,7 +63,7 @@ public:
deleteInTouchBegin = deleteInTouchUpdate = deleteInTouchEnd = false;
}
- bool event(QEvent *event) Q_DECL_OVERRIDE
+ bool event(QEvent *event) override
{
switch (event->type()) {
case QEvent::TouchBegin:
@@ -117,7 +117,7 @@ public:
bool deleteInTouchBegin, deleteInTouchUpdate, deleteInTouchEnd;
tst_QTouchEventGraphicsItem **weakpointer;
- explicit tst_QTouchEventGraphicsItem(QGraphicsItem *parent = Q_NULLPTR)
+ explicit tst_QTouchEventGraphicsItem(QGraphicsItem *parent = nullptr)
: QGraphicsItem(parent), weakpointer(0)
{
reset();
@@ -140,13 +140,13 @@ public:
deleteInTouchBegin = deleteInTouchUpdate = deleteInTouchEnd = false;
}
- QRectF boundingRect() const Q_DECL_OVERRIDE { return QRectF(0, 0, 10, 10); }
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) Q_DECL_OVERRIDE
+ QRectF boundingRect() const override { return QRectF(0, 0, 10, 10); }
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) override
{
painter->fillRect(QRectF(QPointF(0, 0), boundingRect().size()), Qt::yellow);
}
- bool sceneEvent(QEvent *event) Q_DECL_OVERRIDE
+ bool sceneEvent(QEvent *event) override
{
switch (event->type()) {
case QEvent::TouchBegin:
@@ -1628,7 +1628,7 @@ class WindowTouchEventFilter : public QObject
{
Q_OBJECT
public:
- bool eventFilter(QObject *obj, QEvent *event) Q_DECL_OVERRIDE;
+ bool eventFilter(QObject *obj, QEvent *event) override;
struct TouchInfo {
QList<QTouchEvent::TouchPoint> points;
QEvent::Type lastSeenType;
diff --git a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
index 039d095ce6..f2754de929 100644
--- a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
+++ b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
@@ -106,6 +106,7 @@ private slots:
void flags();
void cleanup();
void testBlockingWindowShownAfterModalDialog();
+ void generatedMouseMove();
private:
QPoint m_availableTopLeft;
@@ -352,7 +353,7 @@ private:
class ColoredWindow : public QRasterWindow {
public:
explicit ColoredWindow(const QColor &color, QWindow *parent = 0) : QRasterWindow(parent), m_color(color) {}
- void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE
+ void paintEvent(QPaintEvent *) override
{
QPainter p(this);
p.fillRect(QRect(QPoint(0, 0), size()), m_color);
@@ -702,7 +703,7 @@ class PlatformWindowFilter : public QObject
public:
PlatformWindowFilter(QObject *parent = 0)
: QObject(parent)
- , m_window(Q_NULLPTR)
+ , m_window(nullptr)
, m_alwaysExisted(true)
{}
@@ -714,7 +715,7 @@ public:
// If they are, the native platform surface should always exist when we
// receive a QPlatformSurfaceEvent
if (e->type() == QEvent::PlatformSurface && o == m_window) {
- m_alwaysExisted &= (m_window->handle() != Q_NULLPTR);
+ m_alwaysExisted &= (m_window->handle() != nullptr);
}
return false;
}
@@ -741,7 +742,7 @@ void tst_QWindow::platformSurface()
QTRY_COMPARE(window.received(QEvent::PlatformSurface), 1);
QTRY_COMPARE(window.surfaceEventType(), QPlatformSurfaceEvent::SurfaceCreated);
- QTRY_VERIFY(window.handle() != Q_NULLPTR);
+ QTRY_VERIFY(window.handle() != nullptr);
window.destroy();
QTRY_COMPARE(window.received(QEvent::PlatformSurface), 2);
@@ -918,6 +919,7 @@ public:
}
}
void mouseMoveEvent(QMouseEvent *event) {
+ buttonStateInGeneratedMove = event->buttons();
if (ignoreMouse) {
event->ignore();
} else {
@@ -999,6 +1001,7 @@ public:
bool ignoreMouse, ignoreTouch;
bool spinLoopWhenPressed;
+ Qt::MouseButtons buttonStateInGeneratedMove;
};
void tst_QWindow::testInputEvents()
@@ -2316,6 +2319,56 @@ void tst_QWindow::testBlockingWindowShownAfterModalDialog()
QVERIFY(normalWindowAfter.gotBlocked);
}
+void tst_QWindow::generatedMouseMove()
+{
+ InputTestWindow w;
+ w.setGeometry(QRect(m_availableTopLeft + QPoint(100, 100), m_testWindowSize));
+ w.show();
+ QVERIFY(QTest::qWaitForWindowActive(&w));
+ QPoint point(10, 10);
+ QPoint step(2, 2);
+
+ QVERIFY(w.mouseMovedCount == 0);
+ QWindowSystemInterface::handleMouseEvent(&w, point, point, Qt::NoButton, Qt::NoButton, QEvent::MouseMove);
+ QCoreApplication::processEvents();
+ QVERIFY(w.mouseMovedCount == 1);
+ // Press that does not change position should not generate mouse move
+ QWindowSystemInterface::handleMouseEvent(&w, point, point, Qt::LeftButton, Qt::LeftButton, QEvent::MouseButtonPress);
+ QWindowSystemInterface::handleMouseEvent(&w, point, point, Qt::LeftButton | Qt::RightButton, Qt::RightButton, QEvent::MouseButtonPress);
+ QCoreApplication::processEvents();
+ QVERIFY(w.mouseMovedCount == 1);
+
+ // Test moves generated for mouse release
+ point += step;
+ QWindowSystemInterface::handleMouseEvent(&w, point, point, Qt::RightButton, Qt::LeftButton, QEvent::MouseButtonRelease);
+ QCoreApplication::processEvents();
+ QVERIFY(w.mouseMovedCount == 2);
+ QVERIFY(w.buttonStateInGeneratedMove == (Qt::LeftButton | Qt::RightButton));
+ point += step;
+ QWindowSystemInterface::handleMouseEvent(&w, point, point, Qt::NoButton, Qt::RightButton, QEvent::MouseButtonRelease);
+ QCoreApplication::processEvents();
+ QVERIFY(w.mouseMovedCount == 3);
+ QVERIFY(w.buttonStateInGeneratedMove == Qt::RightButton);
+
+ // Test moves generated for mouse press
+ point += step;
+ QWindowSystemInterface::handleMouseEvent(&w, point, point, Qt::LeftButton, Qt::LeftButton, QEvent::MouseButtonPress);
+ QCoreApplication::processEvents();
+ QVERIFY(w.mouseMovedCount == 4);
+ QVERIFY(w.buttonStateInGeneratedMove == Qt::NoButton);
+ point += step;
+ QWindowSystemInterface::handleMouseEvent(&w, point, point, Qt::LeftButton | Qt::RightButton, Qt::RightButton, QEvent::MouseButtonPress);
+ QCoreApplication::processEvents();
+ QVERIFY(w.mouseMovedCount == 5);
+ QVERIFY(w.buttonStateInGeneratedMove == Qt::LeftButton);
+
+ // Release that does not change position should not generate mouse move
+ QWindowSystemInterface::handleMouseEvent(&w, point, point, Qt::LeftButton, Qt::RightButton, QEvent::MouseButtonRelease);
+ QWindowSystemInterface::handleMouseEvent(&w, point, point, Qt::NoButton, Qt::LeftButton, QEvent::MouseButtonRelease);
+ QCoreApplication::processEvents();
+ QVERIFY(w.mouseMovedCount == 5);
+}
+
#include <tst_qwindow.moc>
QTEST_MAIN(tst_QWindow)
diff --git a/tests/auto/gui/painting/qcolor/tst_qcolor.cpp b/tests/auto/gui/painting/qcolor/tst_qcolor.cpp
index 6809aea086..67d30d7c9a 100644
--- a/tests/auto/gui/painting/qcolor/tst_qcolor.cpp
+++ b/tests/auto/gui/painting/qcolor/tst_qcolor.cpp
@@ -1423,9 +1423,6 @@ void tst_QColor::achromaticHslHue()
#if 0 // Used to be included in Qt4 for Q_WS_X11
void tst_QColor::setallowX11ColorNames()
{
-#if defined(Q_OS_IRIX)
- QSKIP("This fails due to the gamma settings in the SGI X server");
-#endif
RGBData x11RgbTbl[] = {
// a few standard X11 color names
{ "DodgerBlue1", qRgb(30, 144, 255) },
diff --git a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp
index b8243a2b54..5fe17ebb68 100644
--- a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp
+++ b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp
@@ -2827,7 +2827,7 @@ void tst_QPainter::monoImages()
}
}
-#if !defined(Q_OS_IRIX) && !defined(Q_OS_AIX) && !defined(Q_CC_MSVC) && !defined(Q_OS_SOLARIS) && !defined(__UCLIBC__)
+#if !defined(Q_OS_AIX) && !defined(Q_CC_MSVC) && !defined(Q_OS_SOLARIS) && !defined(__UCLIBC__)
#include <fenv.h>
static const QString fpeExceptionString(int exception)
diff --git a/tests/auto/gui/qopengl/tst_qopengl.cpp b/tests/auto/gui/qopengl/tst_qopengl.cpp
index 82b3657b56..5b1af9b6c9 100644
--- a/tests/auto/gui/qopengl/tst_qopengl.cpp
+++ b/tests/auto/gui/qopengl/tst_qopengl.cpp
@@ -1593,7 +1593,7 @@ void tst_QOpenGL::defaultQGLCurrentBuffer()
ctx->makeCurrent(surface.data());
// Bind default FBO on the current context, and record what's the current QGL FBO. It should
- // be Q_NULLPTR because the default platform OpenGL FBO is not backed by a
+ // be nullptr because the default platform OpenGL FBO is not backed by a
// QOpenGLFramebufferObject.
QOpenGLFramebufferObject::bindDefault();
QOpenGLFramebufferObject *defaultQFBO = QOpenGLContextPrivate::get(ctx.data())->qgl_current_fbo;
diff --git a/tests/auto/gui/qvulkan/tst_qvulkan.cpp b/tests/auto/gui/qvulkan/tst_qvulkan.cpp
index cc4bc43f92..c80c3fed97 100644
--- a/tests/auto/gui/qvulkan/tst_qvulkan.cpp
+++ b/tests/auto/gui/qvulkan/tst_qvulkan.cpp
@@ -166,7 +166,7 @@ static void waitForUnexposed(QWindow *w)
if (remaining <= 0)
break;
QCoreApplication::processEvents(QEventLoop::AllEvents, remaining);
- QCoreApplication::sendPostedEvents(Q_NULLPTR, QEvent::DeferredDelete);
+ QCoreApplication::sendPostedEvents(nullptr, QEvent::DeferredDelete);
QTest::qSleep(10);
}
}
diff --git a/tests/auto/gui/text/qcssparser/tst_qcssparser.cpp b/tests/auto/gui/text/qcssparser/tst_qcssparser.cpp
index dbe5bf7cc6..2a53f5d633 100644
--- a/tests/auto/gui/text/qcssparser/tst_qcssparser.cpp
+++ b/tests/auto/gui/text/qcssparser/tst_qcssparser.cpp
@@ -87,10 +87,8 @@ void tst_QCssParser::scanner_data()
#if defined(Q_OS_ANDROID) || defined(Q_OS_WINRT)
QDir d(":/");
-#elif !defined(Q_OS_IRIX)
- QDir d(SRCDIR);
#else
- QDir d(QDir::current());
+ QDir d(SRCDIR);
#endif
d.cd("testdata");
d.cd("scanner");
diff --git a/tests/auto/gui/text/qfontmetrics/tst_qfontmetrics.cpp b/tests/auto/gui/text/qfontmetrics/tst_qfontmetrics.cpp
index 0a422fca17..06302f4cc1 100644
--- a/tests/auto/gui/text/qfontmetrics/tst_qfontmetrics.cpp
+++ b/tests/auto/gui/text/qfontmetrics/tst_qfontmetrics.cpp
@@ -48,7 +48,7 @@ private slots:
void veryNarrowElidedText();
void averageCharWidth();
-#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
+#if QT_DEPRECATED_SINCE(5, 11) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
void bypassShaping();
#endif
@@ -191,7 +191,7 @@ void tst_QFontMetrics::averageCharWidth()
QVERIFY(fmf.averageCharWidth() != 0);
}
-#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
+#if QT_DEPRECATED_SINCE(5, 11) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
void tst_QFontMetrics::bypassShaping()
{
QFont f;
diff --git a/tests/auto/gui/text/qstatictext/tst_qstatictext.cpp b/tests/auto/gui/text/qstatictext/tst_qstatictext.cpp
index f4e3356ad0..9ade3b554e 100644
--- a/tests/auto/gui/text/qstatictext/tst_qstatictext.cpp
+++ b/tests/auto/gui/text/qstatictext/tst_qstatictext.cpp
@@ -862,19 +862,19 @@ void tst_QStaticText::textDocumentColor()
class TestPaintEngine: public QPaintEngine
{
public:
- void drawTextItem(const QPointF &p, const QTextItem &) Q_DECL_OVERRIDE
+ void drawTextItem(const QPointF &p, const QTextItem &) override
{
differentVerticalPositions.insert(qRound(p.y()));
}
- void updateState(const QPaintEngineState &) Q_DECL_OVERRIDE {}
+ void updateState(const QPaintEngineState &) override {}
- void drawPolygon(const QPointF *, int , PolygonDrawMode ) Q_DECL_OVERRIDE {}
+ void drawPolygon(const QPointF *, int , PolygonDrawMode ) override {}
- bool begin(QPaintDevice *) Q_DECL_OVERRIDE { return true; }
- bool end() Q_DECL_OVERRIDE { return true; }
- void drawPixmap(const QRectF &, const QPixmap &, const QRectF &) Q_DECL_OVERRIDE {}
- Type type() const Q_DECL_OVERRIDE
+ bool begin(QPaintDevice *) override { return true; }
+ bool end() override { return true; }
+ void drawPixmap(const QRectF &, const QPixmap &, const QRectF &) override {}
+ Type type() const override
{
return User;
}
diff --git a/tests/auto/network/access/http2/http2srv.h b/tests/auto/network/access/http2/http2srv.h
index ff4a1319e2..76c5a0ee36 100644
--- a/tests/auto/network/access/http2/http2srv.h
+++ b/tests/auto/network/access/http2/http2srv.h
@@ -116,7 +116,7 @@ private slots:
void readReady();
private:
- void incomingConnection(qintptr socketDescriptor) Q_DECL_OVERRIDE;
+ void incomingConnection(qintptr socketDescriptor) override;
quint32 clientSetting(Http2::Settings identifier, quint32 defaultValue);
bool readMethodLine();
diff --git a/tests/auto/network/access/qhttpnetworkreply/tst_qhttpnetworkreply.cpp b/tests/auto/network/access/qhttpnetworkreply/tst_qhttpnetworkreply.cpp
index ec965a61b2..edfef09a96 100644
--- a/tests/auto/network/access/qhttpnetworkreply/tst_qhttpnetworkreply.cpp
+++ b/tests/auto/network/access/qhttpnetworkreply/tst_qhttpnetworkreply.cpp
@@ -104,7 +104,7 @@ void tst_QHttpNetworkReply::parseHeader()
class TestHeaderSocket : public QAbstractSocket
{
public:
- explicit TestHeaderSocket(const QByteArray &input) : QAbstractSocket(QAbstractSocket::TcpSocket, Q_NULLPTR)
+ explicit TestHeaderSocket(const QByteArray &input) : QAbstractSocket(QAbstractSocket::TcpSocket, nullptr)
{
inputBuffer.setData(input);
inputBuffer.open(QIODevice::ReadOnly | QIODevice::Unbuffered);
diff --git a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
index a2e602e4c5..69bd78a4f0 100644
--- a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
+++ b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
@@ -548,7 +548,9 @@ static void setupSslServer(QSslSocket* serverSocket)
}
#endif
-// Limited support for POST and PUT.
+// NOTE: MiniHttpServer has a very limited support of PUT/POST requests! Make
+// sure you understand the server's code before PUTting/POSTing data (and
+// probably you'll have to update the logic).
class MiniHttpServer: public QTcpServer
{
Q_OBJECT
@@ -591,6 +593,12 @@ public:
dataToTransmit = data;
}
+ void clearHeaderParserState()
+ {
+ contentLength = 0;
+ receivedData.clear();
+ }
+
protected:
void incomingConnection(qintptr socketDescriptor)
{
@@ -672,6 +680,7 @@ private slots:
}
public slots:
+
void readyReadSlot()
{
QTcpSocket *currentClient = qobject_cast<QTcpSocket *>(sender());
@@ -7341,6 +7350,7 @@ void tst_QNetworkReply::qtbug28035browserDoesNotLoadQtProjectOrgCorrectly() {
QCOMPARE(reply->readAll(), QByteArray("GET"));
QCOMPARE(reply->attribute(QNetworkRequest::SourceIsFromCacheAttribute).toBool(), false);
+ server.clearHeaderParserState();
server.setDataToTransmit(getReply);
reply.reset(manager.get(request));
QVERIFY2(waitForFinish(reply) == Success, msgWaitForFinished(reply));
@@ -7350,6 +7360,7 @@ void tst_QNetworkReply::qtbug28035browserDoesNotLoadQtProjectOrgCorrectly() {
QCOMPARE(reply->readAll(), QByteArray("GET"));
QCOMPARE(reply->attribute(QNetworkRequest::SourceIsFromCacheAttribute).toBool(), true);
+ server.clearHeaderParserState();
server.setDataToTransmit(postReply);
request.setRawHeader("Content-Type", "text/plain");
reply.reset(manager.post(request, postData));
@@ -7362,6 +7373,7 @@ void tst_QNetworkReply::qtbug28035browserDoesNotLoadQtProjectOrgCorrectly() {
QCOMPARE(reply->readAll(), QByteArray("POST"));
QCOMPARE(reply->attribute(QNetworkRequest::SourceIsFromCacheAttribute).toBool(), false);
+ server.clearHeaderParserState();
server.setDataToTransmit(getReply);
reply.reset(manager.get(request));
@@ -7372,6 +7384,7 @@ void tst_QNetworkReply::qtbug28035browserDoesNotLoadQtProjectOrgCorrectly() {
QCOMPARE(reply->readAll(), QByteArray("GET"));
QCOMPARE(reply->attribute(QNetworkRequest::SourceIsFromCacheAttribute).toBool(), false);
+ server.clearHeaderParserState();
server.setDataToTransmit(getReply);
reply.reset(manager.get(request));
@@ -7382,6 +7395,7 @@ void tst_QNetworkReply::qtbug28035browserDoesNotLoadQtProjectOrgCorrectly() {
QCOMPARE(reply->readAll(), QByteArray("GET"));
QCOMPARE(reply->attribute(QNetworkRequest::SourceIsFromCacheAttribute).toBool(), true);
+ server.clearHeaderParserState();
server.setDataToTransmit(putReply);
reply.reset(manager.put(request, postData));
@@ -7391,6 +7405,7 @@ void tst_QNetworkReply::qtbug28035browserDoesNotLoadQtProjectOrgCorrectly() {
QCOMPARE(reply->error(), QNetworkReply::NoError);
QCOMPARE(reply->attribute(QNetworkRequest::SourceIsFromCacheAttribute).toBool(), false);
+ server.clearHeaderParserState();
server.setDataToTransmit(getReply);
reply.reset(manager.get(request));
@@ -7401,6 +7416,7 @@ void tst_QNetworkReply::qtbug28035browserDoesNotLoadQtProjectOrgCorrectly() {
QCOMPARE(reply->readAll(), QByteArray("GET"));
QCOMPARE(reply->attribute(QNetworkRequest::SourceIsFromCacheAttribute).toBool(), false);
+ server.clearHeaderParserState();
server.setDataToTransmit(getReply);
reply.reset(manager.get(request));
diff --git a/tests/auto/network/kernel/qhostaddress/qhostaddress.pro b/tests/auto/network/kernel/qhostaddress/qhostaddress.pro
index a79fa2f59d..b5d6ea6459 100644
--- a/tests/auto/network/kernel/qhostaddress/qhostaddress.pro
+++ b/tests/auto/network/kernel/qhostaddress/qhostaddress.pro
@@ -2,7 +2,6 @@ CONFIG += testcase
TARGET = tst_qhostaddress
SOURCES += tst_qhostaddress.cpp
-
-QT = core network testlib
+QT = core network-private testlib
win32:LIBS += -lws2_32
diff --git a/tests/auto/network/kernel/qhostaddress/tst_qhostaddress.cpp b/tests/auto/network/kernel/qhostaddress/tst_qhostaddress.cpp
index bc3f5650ba..224e4d61a9 100644
--- a/tests/auto/network/kernel/qhostaddress/tst_qhostaddress.cpp
+++ b/tests/auto/network/kernel/qhostaddress/tst_qhostaddress.cpp
@@ -27,9 +27,10 @@
**
****************************************************************************/
+#include <qhostaddress.h>
+#include <private/qhostaddress_p.h>
#include <qcoreapplication.h>
#include <QtTest/QtTest>
-#include <qhostaddress.h>
#include <qplatformdefs.h>
#include <qdebug.h>
#include <qhash.h>
@@ -46,6 +47,7 @@
# include <netinet/in.h>
#endif
+Q_DECLARE_METATYPE(AddressClassification)
Q_DECLARE_METATYPE(QHostAddress::SpecialAddress)
class tst_QHostAddress : public QObject
@@ -75,10 +77,8 @@ private slots:
void parseSubnet();
void isInSubnet_data();
void isInSubnet();
- void isLoopback_data();
- void isLoopback();
- void isMulticast_data();
- void isMulticast();
+ void classification_data();
+ void classification();
void convertv4v6_data();
void convertv4v6();
};
@@ -667,90 +667,88 @@ void tst_QHostAddress::isInSubnet()
QTEST(address.isInSubnet(prefix, prefixLength), "result");
}
-void tst_QHostAddress::isLoopback_data()
-{
- QTest::addColumn<QHostAddress>("address");
- QTest::addColumn<bool>("result");
-
- QTest::newRow("default") << QHostAddress() << false;
- QTest::newRow("invalid") << QHostAddress("&&&") << false;
-
- QTest::newRow("ipv6_loop") << QHostAddress(QHostAddress::LocalHostIPv6) << true;
- QTest::newRow("::1") << QHostAddress("::1") << true;
-
- QTest::newRow("ipv4_loop") << QHostAddress(QHostAddress::LocalHost) << true;
- QTest::newRow("127.0.0.1") << QHostAddress("127.0.0.1") << true;
- QTest::newRow("127.0.0.2") << QHostAddress("127.0.0.2") << true;
- QTest::newRow("127.3.2.1") << QHostAddress("127.3.2.1") << true;
-
- QTest::newRow("1.2.3.4") << QHostAddress("1.2.3.4") << false;
- QTest::newRow("10.0.0.4") << QHostAddress("10.0.0.4") << false;
- QTest::newRow("192.168.3.4") << QHostAddress("192.168.3.4") << false;
-
- QTest::newRow("::") << QHostAddress("::") << false;
- QTest::newRow("Any") << QHostAddress(QHostAddress::Any) << false;
- QTest::newRow("AnyIPv4") << QHostAddress(QHostAddress::AnyIPv4) << false;
- QTest::newRow("AnyIPv6") << QHostAddress(QHostAddress::AnyIPv6) << false;
- QTest::newRow("Broadcast") << QHostAddress(QHostAddress::Broadcast) << false;
- QTest::newRow("Null") << QHostAddress(QHostAddress::Null) << false;
- QTest::newRow("ipv6-all-ffff") << QHostAddress("ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff") << false;
-
- QTest::newRow("::ffff:127.0.0.1") << QHostAddress("::ffff:127.0.0.1") << true;
- QTest::newRow("::ffff:127.0.0.2") << QHostAddress("::ffff:127.0.0.2") << true;
- QTest::newRow("::ffff:127.3.2.1") << QHostAddress("::ffff:127.3.2.1") << true;
-
-}
-
-void tst_QHostAddress::isLoopback()
-{
- QFETCH(QHostAddress, address);
- QFETCH(bool, result);
-
- QCOMPARE(address.isLoopback(), result);
-}
-
-void tst_QHostAddress::isMulticast_data()
+void tst_QHostAddress::classification_data()
{
QTest::addColumn<QHostAddress>("address");
- QTest::addColumn<bool>("result");
-
- QTest::newRow("default") << QHostAddress() << false;
- QTest::newRow("invalid") << QHostAddress("&&&") << false;
-
- QTest::newRow("ipv6_loop") << QHostAddress(QHostAddress::LocalHostIPv6) << false;
- QTest::newRow("::1") << QHostAddress("::1") << false;
- QTest::newRow("ipv4_loop") << QHostAddress(QHostAddress::LocalHost) << false;
- QTest::newRow("127.0.0.1") << QHostAddress("127.0.0.1") << false;
- QTest::newRow("::") << QHostAddress("::") << false;
- QTest::newRow("Any") << QHostAddress(QHostAddress::Any) << false;
- QTest::newRow("AnyIPv4") << QHostAddress(QHostAddress::AnyIPv4) << false;
- QTest::newRow("AnyIPv6") << QHostAddress(QHostAddress::AnyIPv6) << false;
- QTest::newRow("Broadcast") << QHostAddress(QHostAddress::Broadcast) << false;
- QTest::newRow("Null") << QHostAddress(QHostAddress::Null) << false;
-
- QTest::newRow("223.255.255.255") << QHostAddress("223.255.255.255") << false;
- QTest::newRow("224.0.0.0") << QHostAddress("224.0.0.0") << true;
- QTest::newRow("239.255.255.255") << QHostAddress("239.255.255.255") << true;
- QTest::newRow("240.0.0.0") << QHostAddress("240.0.0.0") << false;
-
- QTest::newRow("::ffff:223.255.255.255") << QHostAddress("::ffff:223.255.255.255") << false;
- QTest::newRow("::ffff:224.0.0.0") << QHostAddress("::ffff:224.0.0.0") << true;
- QTest::newRow("::ffff:239.255.255.255") << QHostAddress("::ffff:239.255.255.255") << true;
- QTest::newRow("::ffff:240.0.0.0") << QHostAddress("::ffff:240.0.0.0") << false;
-
- QTest::newRow("fc00::") << QHostAddress("fc00::") << false;
- QTest::newRow("fe80::") << QHostAddress("fe80::") << false;
- QTest::newRow("fec0::") << QHostAddress("fec0::") << false;
- QTest::newRow("ff00::") << QHostAddress("ff00::") << true;
- QTest::newRow("ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff") << QHostAddress("ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff") << true;
+ QTest::addColumn<AddressClassification>("result");
+
+ QTest::newRow("default") << QHostAddress() << UnknownAddress;
+ QTest::newRow("invalid") << QHostAddress("&&&") << UnknownAddress;
+
+ QTest::newRow("Any") << QHostAddress(QHostAddress::Any) << LocalNetAddress;
+ QTest::newRow("Null") << QHostAddress(QHostAddress::Null) << UnknownAddress;
+
+ // IPv6 address space
+ auto addV6 = [](const char *str, AddressClassification cl) {
+ QTest::newRow(str) << QHostAddress(str) << cl;
+ };
+ QTest::newRow("AnyIPv6") << QHostAddress(QHostAddress::AnyIPv6) << LocalNetAddress;
+ QTest::newRow("ipv6_loop") << QHostAddress(QHostAddress::LocalHostIPv6) << LoopbackAddress;
+ addV6("::", LocalNetAddress);
+ addV6("::1", LoopbackAddress);
+ addV6("::2", GlobalAddress);
+ addV6("2000::", GlobalAddress);
+ addV6("3fff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", GlobalAddress);
+ addV6("fbff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", GlobalAddress);
+ addV6("fc00::", UniqueLocalAddress);
+ addV6("fdff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", UniqueLocalAddress);
+ addV6("fe00::", UnknownAddress);
+ addV6("fe7f:ffff:ffff:ffff:ffff:ffff:ffff:ffff", UnknownAddress);
+ addV6("fe80::", LinkLocalAddress);
+ addV6("febf:ffff:ffff:ffff:ffff:ffff:ffff:ffff", LinkLocalAddress);
+ addV6("fec0::", SiteLocalAddress);
+ addV6("feff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", SiteLocalAddress);
+ addV6("ff00::", MulticastAddress);
+ addV6("ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", MulticastAddress);
+
+ // IPv4 address space
+ auto addV4 = [](const char *str, AddressClassification cl) {
+ QTest::newRow(str) << QHostAddress(str) << cl;
+ QByteArray v6 = "::ffff:";
+ v6 += str;
+ QTest::newRow(v6.constData()) << QHostAddress(QString::fromLatin1(v6)) << cl;
+ };
+ QTest::newRow("AnyIPv4") << QHostAddress(QHostAddress::AnyIPv4) << LocalNetAddress;
+ QTest::newRow("ipv4_loop") << QHostAddress(QHostAddress::LocalHost) << LoopbackAddress;
+ QTest::newRow("Broadcast") << QHostAddress(QHostAddress::Broadcast) << BroadcastAddress;
+ addV4("0.0.0.0", LocalNetAddress);
+ addV4("0.0.0.1", LocalNetAddress);
+ addV4("0.255.255.255", LocalNetAddress);
+ addV4("1.0.0.0", GlobalAddress);
+ addV4("1.2.3.4", GlobalAddress);
+ addV4("10.0.0.4", PrivateNetworkAddress);
+ addV4("127.0.0.1", LoopbackAddress);
+ addV4("127.0.0.2", LoopbackAddress);
+ addV4("127.255.255.255", LoopbackAddress);
+ addV4("192.168.3.4", PrivateNetworkAddress);
+ addV4("223.255.255.255", GlobalAddress);
+ addV4("224.0.0.0", MulticastAddress);
+ addV4("239.255.255.255", MulticastAddress);
+ addV4("240.0.0.0", UnknownAddress);
+ addV4("255.255.255.254", UnknownAddress);
+ addV4("255.255.255.255", BroadcastAddress);
}
-void tst_QHostAddress::isMulticast()
+void tst_QHostAddress::classification()
{
QFETCH(QHostAddress, address);
- QFETCH(bool, result);
-
- QCOMPARE(address.isMulticast(), result);
+ QFETCH(AddressClassification, result);
+
+ bool isLoopback = (result == LoopbackAddress);
+ bool isGlobal = (result & GlobalAddress); // GlobalAddress is a bit
+ bool isLinkLocal = (result == LinkLocalAddress);
+ bool isSiteLocal = (result == SiteLocalAddress);
+ bool isUniqueLocalAddress = (result == UniqueLocalAddress);
+ bool isMulticast = (result == MulticastAddress);
+ bool isBroadcast = (result == BroadcastAddress);
+
+ QCOMPARE(address.isLoopback(), isLoopback);
+ QCOMPARE(address.isGlobal(), isGlobal);
+ QCOMPARE(address.isLinkLocal(), isLinkLocal);
+ QCOMPARE(address.isSiteLocal(), isSiteLocal);
+ QCOMPARE(address.isUniqueLocalUnicast(), isUniqueLocalAddress);
+ QCOMPARE(address.isMulticast(), isMulticast);
+ QCOMPARE(address.isBroadcast(), isBroadcast);
}
void tst_QHostAddress::convertv4v6_data()
diff --git a/tests/auto/network/kernel/qnetworkinterface/BLACKLIST b/tests/auto/network/kernel/qnetworkinterface/BLACKLIST
deleted file mode 100644
index 23bb688d9a..0000000000
--- a/tests/auto/network/kernel/qnetworkinterface/BLACKLIST
+++ /dev/null
@@ -1,2 +0,0 @@
-[localAddress]
-linux
diff --git a/tests/auto/network/kernel/qnetworkinterface/tst_qnetworkinterface.cpp b/tests/auto/network/kernel/qnetworkinterface/tst_qnetworkinterface.cpp
index 36dcec0a82..0b4ed4870d 100644
--- a/tests/auto/network/kernel/qnetworkinterface/tst_qnetworkinterface.cpp
+++ b/tests/auto/network/kernel/qnetworkinterface/tst_qnetworkinterface.cpp
@@ -40,6 +40,8 @@
#include "../../../network-settings.h"
#include "emulationdetector.h"
+Q_DECLARE_METATYPE(QHostAddress)
+
class tst_QNetworkInterface : public QObject
{
Q_OBJECT
@@ -57,6 +59,7 @@ private slots:
void consistencyCheck();
void loopbackIPv4();
void loopbackIPv6();
+ void localAddress_data();
void localAddress();
void interfaceFromXXX_data();
void interfaceFromXXX();
@@ -138,7 +141,9 @@ void tst_QNetworkInterface::dump()
qDebug() << " index: " << i.index();
qDebug() << " flags: " << qPrintable(flags);
+ qDebug() << " type: " << i.type();
qDebug() << " hw address:" << qPrintable(i.hardwareAddress());
+ qDebug() << " MTU: " << i.maxTransmissionUnit();
int count = 0;
foreach (const QNetworkAddressEntry &e, i.addressEntries()) {
@@ -151,6 +156,16 @@ void tst_QNetworkInterface::dump()
<< " (" << qPrintable(e.netmask().toString()) << ')';
if (!e.broadcast().isNull())
s.nospace() << " broadcast " << qPrintable(e.broadcast().toString());
+ if (e.dnsEligibility() == QNetworkAddressEntry::DnsEligible)
+ s.nospace() << " dns-eligible";
+ else if (e.dnsEligibility() == QNetworkAddressEntry::DnsIneligible)
+ s.nospace() << " dns-ineligible";
+ if (e.isLifetimeKnown()) {
+#define printable(l) qPrintable(l.isForever() ? "forever" : QString::fromLatin1("%1ms").arg(l.remainingTime()))
+ s.nospace() << " preferred:" << printable(e.preferredLifetime())
+ << " valid:" << printable(e.validityLifetime());
+#undef printable
+ }
}
}
}
@@ -162,6 +177,7 @@ void tst_QNetworkInterface::consistencyCheck()
QVector<int> interfaceIndexes;
foreach (const QNetworkInterface &iface, ifaces) {
+ QVERIFY(iface.isValid());
QVERIFY2(!interfaceNames.contains(iface.name()),
"duplicate name = " + iface.name().toLocal8Bit());
interfaceNames << iface.name();
@@ -170,6 +186,17 @@ void tst_QNetworkInterface::consistencyCheck()
"duplicate index = " + QByteArray::number(iface.index()));
if (iface.index())
interfaceIndexes << iface.index();
+
+ QVERIFY(iface.maxTransmissionUnit() >= 0);
+
+ const QList<QNetworkAddressEntry> addresses = iface.addressEntries();
+ for (auto entry : addresses) {
+ QVERIFY(entry.ip().protocol() != QAbstractSocket::UnknownNetworkLayerProtocol);
+ if (!entry.preferredLifetime().isForever() || !entry.validityLifetime().isForever())
+ QVERIFY(entry.isLifetimeKnown());
+ if (!entry.validityLifetime().isForever())
+ QVERIFY(entry.isTemporary());
+ }
}
}
@@ -186,18 +213,69 @@ void tst_QNetworkInterface::loopbackIPv6()
QList<QHostAddress> all = QNetworkInterface::allAddresses();
QVERIFY(all.contains(QHostAddress(QHostAddress::LocalHostIPv6)));
}
+void tst_QNetworkInterface::localAddress_data()
+{
+ QTest::addColumn<QHostAddress>("target");
+
+ QTest::newRow("localhost-ipv4") << QHostAddress(QHostAddress::LocalHost);
+ if (isIPv6Working())
+ QTest::newRow("localhost-ipv6") << QHostAddress(QHostAddress::LocalHostIPv6);
+
+ QTest::newRow("test-server") << QtNetworkSettings::serverIP();
+
+ // Since we don't actually transmit anything, we can list any IPv4 address
+ // and it should work. But we're using a linklocal address so that this
+ // test can pass even machines that failed to reach a DHCP server.
+ QTest::newRow("linklocal-ipv4") << QHostAddress("169.254.0.1");
+
+ if (isIPv6Working()) {
+ // On the other hand, we can't list just any IPv6 here. It's very
+ // likely that this machine has not received a route via ICMPv6-RA or
+ // DHCPv6, so it won't have a global route. On some OSes, IPv6 may be
+ // enabled per interface, so we need to know which ones work.
+ const QList<QHostAddress> addrs = QNetworkInterface::allAddresses();
+ for (const QHostAddress &addr : addrs) {
+ QString scope = addr.scopeId();
+ if (scope.isEmpty())
+ continue;
+ QTest::addRow("linklocal-ipv6-%s", qPrintable(scope))
+ << QHostAddress("fe80::1234%" + scope);
+ }
+ }
+}
void tst_QNetworkInterface::localAddress()
{
+ QFETCH(QHostAddress, target);
QUdpSocket socket;
- socket.connectToHost(QtNetworkSettings::serverName(), 80);
+ socket.connectToHost(target, 80);
QVERIFY(socket.waitForConnected(5000));
QHostAddress local = socket.localAddress();
- // test that we can find the address that QUdpSocket reported
- QList<QHostAddress> all = QNetworkInterface::allAddresses();
- QVERIFY(all.contains(local));
+ // find the interface that contains the address QUdpSocket reported
+ QList<QNetworkInterface> ifaces = QNetworkInterface::allInterfaces();
+ const QNetworkInterface *outgoingIface = nullptr;
+ for (const QNetworkInterface &iface : ifaces) {
+ QList<QNetworkAddressEntry> addrs = iface.addressEntries();
+ for (const QNetworkAddressEntry &entry : addrs) {
+ if (entry.ip() == local) {
+ outgoingIface = &iface;
+ break;
+ }
+ }
+ if (outgoingIface)
+ break;
+ }
+ QVERIFY(outgoingIface);
+
+ // we get QVariant() if the QNativeSocketEngine doesn't know how to get the PMTU
+ int pmtu = socket.socketOption(QAbstractSocket::PathMtuSocketOption).toInt();
+ qDebug() << "Connected to" << target.toString() << "via interface" << outgoingIface->name()
+ << "pmtu" << pmtu;
+
+ // check that the Path MTU is less than or equal the interface's MTU
+ QVERIFY(pmtu <= outgoingIface->maxTransmissionUnit());
}
void tst_QNetworkInterface::interfaceFromXXX_data()
diff --git a/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp b/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp
index 7760138067..0d538865a3 100644
--- a/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp
+++ b/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp
@@ -476,7 +476,7 @@ void tst_QLocalSocket::connectWithOldOpen()
class OverriddenOpen : public LocalSocket
{
public:
- virtual bool open(OpenMode mode) Q_DECL_OVERRIDE
+ virtual bool open(OpenMode mode) override
{ return QIODevice::open(mode); }
};
diff --git a/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp b/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp
index e45eda2940..fc92ed6cbc 100644
--- a/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp
+++ b/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp
@@ -3131,7 +3131,7 @@ void tst_QTcpSocket::readNotificationsAfterBind()
if (setProxy)
return;
- QAbstractSocket socket(QAbstractSocket::TcpSocket, Q_NULLPTR);
+ QAbstractSocket socket(QAbstractSocket::TcpSocket, nullptr);
QVERIFY2(socket.bind(), "Bind error!");
connect(&socket, SIGNAL(error(QAbstractSocket::SocketError)), &QTestEventLoop::instance(), SLOT(exitLoop()));
diff --git a/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp b/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp
index 4de77a9080..8324a9c8fa 100644
--- a/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp
+++ b/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp
@@ -2491,6 +2491,7 @@ void tst_QSslSocket::writeBigChunk()
QByteArray data;
data.resize(1024*1024*10); // 10 MB
// init with garbage. needed so ssl cannot compress it in an efficient way.
+ // ### Qt 6: update to a random engine
for (size_t i = 0; i < data.size() / sizeof(int); i++) {
int r = qrand();
data.data()[i*sizeof(int)] = r;
diff --git a/tests/auto/other/modeltest/modeltest.cpp b/tests/auto/other/modeltest/modeltest.cpp
index 611f9e904b..1f4a96f7b6 100644
--- a/tests/auto/other/modeltest/modeltest.cpp
+++ b/tests/auto/other/modeltest/modeltest.cpp
@@ -28,61 +28,66 @@
#include "modeltest.h"
-#include <QtCore/QtCore>
#include <QtTest/QtTest>
+Q_LOGGING_CATEGORY(lcModelTest, "qt.modeltest")
+
/*!
Connect to all of the models signals. Whenever anything happens recheck everything.
*/
-ModelTest::ModelTest(QAbstractItemModel *_model, QObject *parent) : QObject(parent),
- model(_model),
- fetchingMore(false)
+ModelTest::ModelTest(QAbstractItemModel *model, QObject *parent)
+ : QObject(parent),
+ model(model),
+ fetchingMore(false)
{
if (!model)
qFatal("%s: model must not be null", Q_FUNC_INFO);
- connect(model, SIGNAL(columnsAboutToBeInserted(QModelIndex,int,int)),
- this, SLOT(runAllTests()));
- connect(model, SIGNAL(columnsAboutToBeRemoved(QModelIndex,int,int)),
- this, SLOT(runAllTests()));
- connect(model, SIGNAL(columnsInserted(QModelIndex,int,int)),
- this, SLOT(runAllTests()));
- connect(model, SIGNAL(columnsRemoved(QModelIndex,int,int)),
- this, SLOT(runAllTests()));
- connect(model, SIGNAL(dataChanged(QModelIndex,QModelIndex)),
- this, SLOT(runAllTests()));
- connect(model, SIGNAL(headerDataChanged(Qt::Orientation,int,int)),
- this, SLOT(runAllTests()));
- connect(model, SIGNAL(layoutAboutToBeChanged()), this, SLOT(runAllTests()));
- connect(model, SIGNAL(layoutChanged()), this, SLOT(runAllTests()));
- connect(model, SIGNAL(modelReset()), this, SLOT(runAllTests()));
- connect(model, SIGNAL(rowsAboutToBeInserted(QModelIndex,int,int)),
- this, SLOT(runAllTests()));
- connect(model, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)),
- this, SLOT(runAllTests()));
- connect(model, SIGNAL(rowsInserted(QModelIndex,int,int)),
- this, SLOT(runAllTests()));
- connect(model, SIGNAL(rowsRemoved(QModelIndex,int,int)),
- this, SLOT(runAllTests()));
+ connect(model, &QAbstractItemModel::columnsAboutToBeInserted,
+ this, &ModelTest::runAllTests);
+ connect(model, &QAbstractItemModel::columnsAboutToBeRemoved,
+ this, &ModelTest::runAllTests);
+ connect(model, &QAbstractItemModel::columnsInserted,
+ this, &ModelTest::runAllTests);
+ connect(model, &QAbstractItemModel::columnsRemoved,
+ this, &ModelTest::runAllTests);
+ connect(model, &QAbstractItemModel::dataChanged,
+ this, &ModelTest::runAllTests);
+ connect(model, &QAbstractItemModel::headerDataChanged,
+ this, &ModelTest::runAllTests);
+ connect(model, &QAbstractItemModel::layoutAboutToBeChanged,
+ this, &ModelTest::runAllTests);
+ connect(model, &QAbstractItemModel::layoutChanged,
+ this, &ModelTest::runAllTests);
+ connect(model, &QAbstractItemModel::modelReset,
+ this, &ModelTest::runAllTests);
+ connect(model, &QAbstractItemModel::rowsAboutToBeInserted,
+ this, &ModelTest::runAllTests);
+ connect(model, &QAbstractItemModel::rowsAboutToBeRemoved,
+ this, &ModelTest::runAllTests);
+ connect(model, &QAbstractItemModel::rowsInserted,
+ this, &ModelTest::runAllTests);
+ connect(model, &QAbstractItemModel::rowsRemoved,
+ this, &ModelTest::runAllTests);
// Special checks for changes
- connect(model, SIGNAL(layoutAboutToBeChanged()),
- this, SLOT(layoutAboutToBeChanged()));
- connect(model, SIGNAL(layoutChanged()),
- this, SLOT(layoutChanged()));
-
- connect(model, SIGNAL(rowsAboutToBeInserted(QModelIndex,int,int)),
- this, SLOT(rowsAboutToBeInserted(QModelIndex,int,int)));
- connect(model, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)),
- this, SLOT(rowsAboutToBeRemoved(QModelIndex,int,int)));
- connect(model, SIGNAL(rowsInserted(QModelIndex,int,int)),
- this, SLOT(rowsInserted(QModelIndex,int,int)));
- connect(model, SIGNAL(rowsRemoved(QModelIndex,int,int)),
- this, SLOT(rowsRemoved(QModelIndex,int,int)));
- connect(model, SIGNAL(dataChanged(QModelIndex,QModelIndex)),
- this, SLOT(dataChanged(QModelIndex,QModelIndex)));
- connect(model, SIGNAL(headerDataChanged(Qt::Orientation,int,int)),
- this, SLOT(headerDataChanged(Qt::Orientation,int,int)));
+ connect(model, &QAbstractItemModel::layoutAboutToBeChanged,
+ this, &ModelTest::layoutAboutToBeChanged);
+ connect(model, &QAbstractItemModel::layoutChanged,
+ this, &ModelTest::layoutChanged);
+
+ connect(model, &QAbstractItemModel::rowsAboutToBeInserted,
+ this, &ModelTest::rowsAboutToBeInserted);
+ connect(model, &QAbstractItemModel::rowsAboutToBeRemoved,
+ this, &ModelTest::rowsAboutToBeRemoved);
+ connect(model, &QAbstractItemModel::rowsInserted,
+ this, &ModelTest::rowsInserted);
+ connect(model, &QAbstractItemModel::rowsRemoved,
+ this, &ModelTest::rowsRemoved);
+ connect(model, &QAbstractItemModel::dataChanged,
+ this, &ModelTest::dataChanged);
+ connect(model, &QAbstractItemModel::headerDataChanged,
+ this, &ModelTest::headerDataChanged);
runAllTests();
}
@@ -142,7 +147,6 @@ void ModelTest::nonDestructiveBasicTest()
*/
void ModelTest::rowCount()
{
-// qDebug() << "rc";
// check top row
QModelIndex topIndex = model->index(0, 0, QModelIndex());
int rows = model->rowCount(topIndex);
@@ -186,7 +190,6 @@ void ModelTest::columnCount()
*/
void ModelTest::hasIndex()
{
-// qDebug() << "hi";
// Make sure that invalid values returns an invalid index
QVERIFY(!model->hasIndex(-2, -2));
QVERIFY(!model->hasIndex(-2, 0));
@@ -211,7 +214,6 @@ void ModelTest::hasIndex()
*/
void ModelTest::index()
{
-// qDebug() << "i";
// Make sure that invalid values returns an invalid index
QVERIFY(!model->index(-2, -2).isValid());
QVERIFY(!model->index(-2, 0).isValid());
@@ -241,7 +243,6 @@ void ModelTest::index()
*/
void ModelTest::parent()
{
-// qDebug() << "p";
// Make sure the model won't crash and will return an invalid QModelIndex
// when asked for the parent of an invalid index.
QVERIFY(!model->parent(QModelIndex()).isValid());
@@ -309,8 +310,8 @@ void ModelTest::checkChildren(const QModelIndex &parent, int currentDepth)
fetchingMore = false;
}
- int rows = model->rowCount(parent);
- int columns = model->columnCount(parent);
+ const int rows = model->rowCount(parent);
+ const int columns = model->columnCount(parent);
if (rows > 0)
QVERIFY(model->hasChildren(parent));
@@ -321,9 +322,6 @@ void ModelTest::checkChildren(const QModelIndex &parent, int currentDepth)
if (rows > 0)
QVERIFY(model->hasChildren(parent));
- //qDebug() << "parent:" << model->data(parent).toString() << "rows:" << rows
- // << "columns:" << columns << "parent column:" << parent.column();
-
const QModelIndex topLeftChild = model->index(0, 0, parent);
QVERIFY(!model->hasIndex(rows + 1, 0, parent));
@@ -339,7 +337,7 @@ void ModelTest::checkChildren(const QModelIndex &parent, int currentDepth)
QModelIndex index = model->index(r, c, parent);
// rowCount() and columnCount() said that it existed...
if (!index.isValid())
- qWarning() << "Got invalid index at row=" << r << "col=" << c << "parent=" << parent;
+ qCWarning(lcModelTest) << "Got invalid index at row=" << r << "col=" << c << "parent=" << parent;
QVERIFY(index.isValid());
// index() should always return the same index when called twice in a row
@@ -364,30 +362,22 @@ void ModelTest::checkChildren(const QModelIndex &parent, int currentDepth)
QCOMPARE(index.model(), model);
QCOMPARE(index.row(), r);
QCOMPARE(index.column(), c);
- // While you can technically return a QVariant usually this is a sign
- // of a bug in data(). Disable if this really is ok in your model.
-// QVERIFY( model->data ( index, Qt::DisplayRole ).isValid() );
// If the next test fails here is some somewhat useful debug you play with.
-
if (model->parent(index) != parent) {
- qDebug() << r << c << currentDepth << model->data(index).toString()
- << model->data(parent).toString();
- qDebug() << index << parent << model->parent(index);
-// And a view that you can even use to show the model.
-// QTreeView view;
-// view.setModel(model);
-// view.show();
+ qCWarning(lcModelTest) << "Inconsistent parent() implementation detected:";
+ qCWarning(lcModelTest) << " index=" << index << "exp. parent=" << parent << "act. parent=" << model->parent(index);
+ qCWarning(lcModelTest) << " row=" << r << "col=" << c << "depth=" << currentDepth;
+ qCWarning(lcModelTest) << " data for child" << model->data(index).toString();
+ qCWarning(lcModelTest) << " data for parent" << model->data(parent).toString();
}
// Check that we can get back our real parent.
QCOMPARE(model->parent(index), parent);
// recursively go down the children
- if (model->hasChildren(index) && currentDepth < 10) {
- //qDebug() << r << c << "has children" << model->rowCount(index);
+ if (model->hasChildren(index) && currentDepth < 10)
checkChildren(index, ++currentDepth);
- }/* else { if (currentDepth >= 10) qDebug() << "checked 10 deep"; };*/
// make sure that after testing the children that the index doesn't change.
QModelIndex newerIndex = model->index(r, c, parent);
@@ -465,12 +455,14 @@ void ModelTest::data()
\sa rowsInserted()
*/
-void ModelTest::rowsAboutToBeInserted(const QModelIndex &parent, int start, int /* end */)
+void ModelTest::rowsAboutToBeInserted(const QModelIndex &parent, int start, int end)
{
-// Q_UNUSED(end);
-// qDebug() << "rowsAboutToBeInserted" << "start=" << start << "end=" << end << "parent=" << model->data ( parent ).toString()
-// << "current count of parent=" << model->rowCount ( parent ); // << "display of last=" << model->data( model->index(start-1, 0, parent) );
-// qDebug() << model->index(start-1, 0, parent) << model->data( model->index(start-1, 0, parent) );
+ qCDebug(lcModelTest) << "rowsAboutToBeInserted"
+ << "start=" << start << "end=" << end << "parent=" << parent
+ << "parent data=" << model->data(parent).toString()
+ << "current count of parent=" << model->rowCount(parent)
+ << "last before insertion=" << model->index(start - 1, 0, parent) << model->data(model->index(start - 1, 0, parent));
+
Changing c;
c.parent = parent;
c.oldSize = model->rowCount(parent);
@@ -486,16 +478,19 @@ void ModelTest::rowsAboutToBeInserted(const QModelIndex &parent, int start, int
*/
void ModelTest::rowsInserted(const QModelIndex &parent, int start, int end)
{
+ qCDebug(lcModelTest) << "rowsInserted"
+ << "start=" << start << "end=" << end << "parent=" << parent
+ << "parent data=" << model->data(parent).toString()
+ << "current count of parent=" << model->rowCount(parent);
+
+ for (int i = start; i <= end; ++i) {
+ qCDebug(lcModelTest) << " itemWasInserted:" << i
+ << model->index(i, 0, parent).data();
+ }
+
+
Changing c = insert.pop();
QCOMPARE(parent, c.parent);
-// qDebug() << "rowsInserted" << "start=" << start << "end=" << end << "oldsize=" << c.oldSize
-// << "parent=" << model->data ( parent ).toString() << "current rowcount of parent=" << model->rowCount ( parent );
-
-// for (int ii=start; ii <= end; ii++)
-// {
-// qDebug() << "itemWasInserted:" << ii << model->data ( model->index ( ii, 0, parent ));
-// }
-// qDebug();
QCOMPARE(model->rowCount(parent), c.oldSize + (end - start + 1));
QCOMPARE(model->data(model->index(start - 1, 0, c.parent)), c.last);
@@ -532,7 +527,12 @@ void ModelTest::layoutChanged()
*/
void ModelTest::rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end)
{
- qDebug() << "ratbr" << parent << start << end;
+ qCDebug(lcModelTest) << "rowsAboutToBeRemoved"
+ << "start=" << start << "end=" << end << "parent=" << parent
+ << "parent data=" << model->data(parent).toString()
+ << "current count of parent=" << model->rowCount(parent)
+ << "last before removal=" << model->index(start - 1, 0, parent) << model->data(model->index(start - 1, 0, parent));
+
Changing c;
c.parent = parent;
c.oldSize = model->rowCount(parent);
@@ -548,7 +548,11 @@ void ModelTest::rowsAboutToBeRemoved(const QModelIndex &parent, int start, int e
*/
void ModelTest::rowsRemoved(const QModelIndex &parent, int start, int end)
{
- qDebug() << "rr" << parent << start << end;
+ qCDebug(lcModelTest) << "rowsRemoved"
+ << "start=" << start << "end=" << end << "parent=" << parent
+ << "parent data=" << model->data(parent).toString()
+ << "current count of parent=" << model->rowCount(parent);
+
Changing c = remove.pop();
QCOMPARE(parent, c.parent);
QCOMPARE(model->rowCount(parent), c.oldSize - (end - start + 1));
diff --git a/tests/auto/other/modeltest/modeltest.h b/tests/auto/other/modeltest/modeltest.h
index 4676bf4434..9d09c6da5b 100644
--- a/tests/auto/other/modeltest/modeltest.h
+++ b/tests/auto/other/modeltest/modeltest.h
@@ -38,9 +38,9 @@ class ModelTest : public QObject
Q_OBJECT
public:
- ModelTest(QAbstractItemModel *model, QObject *parent = 0);
+ ModelTest(QAbstractItemModel *model, QObject *parent = nullptr);
-private Q_SLOTS:
+private:
void nonDestructiveBasicTest();
void rowCount();
void columnCount();
@@ -49,7 +49,6 @@ private Q_SLOTS:
void parent();
void data();
-protected Q_SLOTS:
void runAllTests();
void layoutAboutToBeChanged();
void layoutChanged();
@@ -60,7 +59,6 @@ protected Q_SLOTS:
void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight);
void headerDataChanged(Qt::Orientation orientation, int start, int end);
-private:
void checkChildren(const QModelIndex &parent, int currentDepth = 0);
QAbstractItemModel *model;
diff --git a/tests/auto/other/qaccessibility/accessiblewidgets.h b/tests/auto/other/qaccessibility/accessiblewidgets.h
index 0c337a72f4..d436f81d17 100644
--- a/tests/auto/other/qaccessibility/accessiblewidgets.h
+++ b/tests/auto/other/qaccessibility/accessiblewidgets.h
@@ -47,7 +47,7 @@ class QtTestAccessibleWidgetIface: public QAccessibleWidget
{
public:
QtTestAccessibleWidgetIface(QtTestAccessibleWidget *w): QAccessibleWidget(w) {}
- QString text(QAccessible::Text t) const Q_DECL_OVERRIDE
+ QString text(QAccessible::Text t) const override
{
if (t == QAccessible::Help)
return QString::fromLatin1("Help yourself");
diff --git a/tests/auto/other/qaccessibility/qaccessibility.pro b/tests/auto/other/qaccessibility/qaccessibility.pro
index bfe652d25a..3587c38e76 100644
--- a/tests/auto/other/qaccessibility/qaccessibility.pro
+++ b/tests/auto/other/qaccessibility/qaccessibility.pro
@@ -8,9 +8,8 @@ HEADERS += accessiblewidgets.h
unix:!darwin:!haiku:!integity: LIBS += -lm
win32 {
- !*g++:!winrt {
- include(../../../../src/3rdparty/iaccessible2/iaccessible2.pri)
- DEFINES += QT_SUPPORTS_IACCESSIBLE2
+ !winrt {
+ QT += windowsuiautomation_support-private
}
LIBS += -luuid -loleacc -loleaut32 -lole32
}
diff --git a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp
index 29fbffa541..7976e0d626 100644
--- a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp
+++ b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp
@@ -32,12 +32,10 @@
# include <QtCore/qt_windows.h>
#ifndef Q_OS_WINRT
# include <oleacc.h>
+# include <QtWindowsUIAutomationSupport/private/qwindowsuiawrapper_p.h>
#endif
# include <servprov.h>
# include <winuser.h>
-# ifdef QT_SUPPORTS_IACCESSIBLE2
-# include <ia2_api_all.h>
-# endif
#endif
#include <QtTest/QtTest>
#include <QtGui>
@@ -3738,7 +3736,7 @@ void tst_QAccessibility::bridgeTest()
// For now this is a simple test to see if the bridge is working at all.
// Ideally it should be extended to test all aspects of the bridge.
#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
- // First, test MSAA part of bridge
+
QWidget window;
QVBoxLayout *lay = new QVBoxLayout(&window);
QPushButton *button = new QPushButton(tr("Push me"), &window);
@@ -3775,10 +3773,7 @@ void tst_QAccessibility::bridgeTest()
window.show();
QVERIFY(QTest::qWaitForWindowExposed(&window));
-
- /**************************************************
- * QPushButton
- **************************************************/
+ // Validate button position through the accessible interface.
QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(button);
QPoint buttonPos = button->mapToGlobal(QPoint(0,0));
QRect buttonRect = iface->rect();
@@ -3787,231 +3782,113 @@ void tst_QAccessibility::bridgeTest()
// All set, now test the bridge.
const QPoint nativePos = QHighDpi::toNativePixels(buttonRect.center(), window.windowHandle());
POINT pt{nativePos.x(), nativePos.y()};
- IAccessible *iaccButton;
- VARIANT varChild;
- HRESULT hr = ::AccessibleObjectFromPoint(pt, &iaccButton, &varChild);
+ // Initialize COM stuff.
+ HRESULT hr = CoInitialize(nullptr);
QVERIFY(SUCCEEDED(hr));
- VARIANT varSELF;
- varSELF.vt = VT_I4;
- varSELF.lVal = 0;
- // **** Test get_accRole ****
- VARIANT varRole;
- hr = iaccButton->get_accRole(varSELF, &varRole);
+ // Get UI Automation interface.
+ IUIAutomation *automation = nullptr;
+ hr = CoCreateInstance(CLSID_CUIAutomation, nullptr, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&automation));
QVERIFY(SUCCEEDED(hr));
- QCOMPARE(varRole.vt, (VARTYPE)VT_I4);
- QCOMPARE(varRole.lVal, (LONG)ROLE_SYSTEM_PUSHBUTTON);
-
- // **** Test accLocation ****
- long x, y, w, h;
- // Do not crash on insane arguments.
- varChild.lVal = 999;
- hr = iaccButton->accLocation(&x, &y, &w, &h, varChild);
- QCOMPARE(SUCCEEDED(hr), false);
-
- hr = iaccButton->accLocation(&x, &y, &w, &h, varSELF);
- QCOMPARE(buttonRect, QHighDpi::fromNativePixels(QRect(x, y, w, h), window.windowHandle()));
-
-#ifdef QT_SUPPORTS_IACCESSIBLE2
- // Test IAccessible2 part of bridge
- if (IAccessible2 *ia2Button = (IAccessible2*)queryIA2(iaccButton, IID_IAccessible2)) {
- // The control supports IAccessible2.
- // ia2Button is the reference to the accessible object's IAccessible2 interface.
-
- /***** Test IAccessibleComponent *****/
- IAccessibleComponent *ia2Component = 0;
- hr = ia2Button->QueryInterface(IID_IAccessibleComponent, (void**)&ia2Component);
- QVERIFY(SUCCEEDED(hr));
- long x, y;
- hr = ia2Component->get_locationInParent(&x, &y);
- QVERIFY(SUCCEEDED(hr));
- QCOMPARE(button->pos(), QHighDpi::fromNativePixels(QPoint(x, y), window.windowHandle()));
- ia2Component->Release();
-
- /***** Test IAccessibleAction *****/
- IAccessibleAction *ia2Action = 0;
- hr = ia2Button->QueryInterface(IID_IAccessibleAction, (void**)&ia2Action);
- QVERIFY(SUCCEEDED(hr));
- QVERIFY(ia2Action);
- long nActions;
- ia2Action->nActions(&nActions);
- QVERIFY(nActions >= 1); // "Press" and "SetFocus"
- BSTR actionName;
- ia2Action->get_name(0, &actionName);
- QString name((QChar*)actionName);
- ::SysFreeString(actionName);
- QCOMPARE(name, QAccessibleActionInterface::pressAction());
- ia2Action->Release();
-
- /***** Test IAccessibleRelation *****/
- long nRelations = 0;
- hr = ia2Button->get_nRelations(&nRelations);
- QVERIFY(SUCCEEDED(hr));
- QCOMPARE(nRelations, (long)1);
-
- IAccessibleRelation **relations = (IAccessibleRelation **)::CoTaskMemAlloc(sizeof(IAccessibleRelation *) * 4);
- hr = ia2Button->get_relations(4, relations, &nRelations);
- QVERIFY(SUCCEEDED(hr));
- QCOMPARE(nRelations, (long)1);
-
- IAccessibleRelation *relation = relations[0];
- BSTR relType;
- hr = relation->get_relationType(&relType);
- QCOMPARE(QString::fromWCharArray(relType), QLatin1String("labelFor"));
- ::SysFreeString(relType);
-
- long nTargets;
- relation->get_nTargets(&nTargets);
- QCOMPARE(nTargets, (long)1);
- IAccessible *target; // target is the label
- hr = relation->get_target(0, (IUnknown**)&target);
- QVERIFY(SUCCEEDED(hr));
-
- VARIANT varRole;
- hr = target->get_accRole(varSELF, &varRole);
- QVERIFY(SUCCEEDED(hr));
- Q_ASSERT(varRole.vt == (VARTYPE)VT_I4);
- QCOMPARE(varRole.lVal, (LONG)ROLE_SYSTEM_STATICTEXT);
+ // Get button element from UI Automation using point.
+ IUIAutomationElement *buttonElement = nullptr;
+ hr = automation->ElementFromPoint(pt, &buttonElement);
+ QVERIFY(SUCCEEDED(hr));
- BSTR buttonName;
- hr = target->get_accName(varSELF, &buttonName);
- QVERIFY(SUCCEEDED(hr));
+ // Check that it has a button control type ID.
+ CONTROLTYPEID controlTypeId;
+ hr = buttonElement->get_CurrentControlType(&controlTypeId);
+ QVERIFY(SUCCEEDED(hr));
+ QCOMPARE(controlTypeId, UIA_ButtonControlTypeId);
- QCOMPARE(QString::fromWCharArray(buttonName), QLatin1String("Push my buddy"));
- ::SysFreeString(buttonName);
- ::CoTaskMemFree(relations);
+ // Test the bounding rectangle.
+ RECT rect;
+ hr = buttonElement->get_CurrentBoundingRectangle(&rect);
+ QVERIFY(SUCCEEDED(hr));
+ QCOMPARE(buttonRect, QRect(rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top));
- // Done testing
- ia2Button->Release();
- }
-#endif
- iaccButton->Release();
+ buttonElement->Release();
- /**************************************************
- * QWidget
- **************************************************/
+ // Get native window handle.
QWindow *windowHandle = window.windowHandle();
+ QVERIFY(windowHandle != 0);
QPlatformNativeInterface *platform = QGuiApplication::platformNativeInterface();
+ QVERIFY(platform != 0);
HWND hWnd = (HWND)platform->nativeResourceForWindow("handle", windowHandle);
+ QVERIFY(hWnd != 0);
- IAccessible *iaccWindow;
- hr = ::AccessibleObjectFromWindow(hWnd, OBJID_CLIENT, IID_IAccessible, (void**)&iaccWindow);
+ // Get automation element for the window from handle.
+ IUIAutomationElement *windowElement = nullptr;
+ hr = automation->ElementFromHandle(hWnd, &windowElement);
QVERIFY(SUCCEEDED(hr));
- hr = iaccWindow->get_accRole(varSELF, &varRole);
+ QVERIFY(windowElement != 0);
+
+ // Validate that the top-level widget is reported as a window.
+ hr = windowElement->get_CurrentControlType(&controlTypeId);
QVERIFY(SUCCEEDED(hr));
+ QCOMPARE(controlTypeId, UIA_WindowControlTypeId);
- QCOMPARE(varRole.vt, (VARTYPE)VT_I4);
- QCOMPARE(varRole.lVal, (LONG)ROLE_SYSTEM_CLIENT);
+ // Get a tree walker to walk over elements.
+ IUIAutomationTreeWalker *controlWalker = nullptr;
+ IUIAutomationElement *node = nullptr;
+ QList<IUIAutomationElement *> nodeList;
- long nChildren;
- hr = iaccWindow->get_accChildCount(&nChildren);
+ hr = automation->get_ControlViewWalker(&controlWalker);
QVERIFY(SUCCEEDED(hr));
- QCOMPARE(nChildren, (long)4);
-
- /**************************************************
- * QTextEdit
- **************************************************/
- // Get the second child (the accessible interface for the text edit)
- varChild.vt = VT_I4;
- varChild.lVal = 2;
- QVERIFY(iaccWindow);
- IAccessible *iaccTextEdit;
- hr = iaccWindow->get_accChild(varChild, (IDispatch**)&iaccTextEdit);
- QVERIFY(SUCCEEDED(hr));
- QVERIFY(iaccTextEdit);
- hr = iaccTextEdit->get_accRole(varSELF, &varRole);
- QVERIFY(SUCCEEDED(hr));
-
- QCOMPARE(varRole.vt, (VARTYPE)VT_I4);
- QCOMPARE(varRole.lVal, (LONG)ROLE_SYSTEM_TEXT);
+ QVERIFY(controlWalker != 0);
+ hr = controlWalker->GetFirstChildElement(windowElement, &node);
+ QVERIFY(SUCCEEDED(hr));
+ QVERIFY(node != 0);
+ int numElements = 5; // Title bar + 4 widgets
-#ifdef QT_SUPPORTS_IACCESSIBLE2
- if (IAccessibleEditableText *ia2TextEdit = (IAccessibleEditableText*)queryIA2(iaccTextEdit, IID_IAccessibleEditableText)) {
- ia2TextEdit->copyText(6, 11);
- QCOMPARE(QApplication::clipboard()->text(), QLatin1String("world"));
- ia2TextEdit->cutText(12, 16);
- QCOMPARE(QApplication::clipboard()->text(), QLatin1String("how "));
- ia2TextEdit->Release();
- }
- if (IAccessibleText *ia2Text = (IAccessibleText*)queryIA2(iaccTextEdit, IID_IAccessibleText)) {
- BSTR txt;
- hr = ia2Text->get_text(12, 15, &txt);
+ while (node) {
+ nodeList.append(node);
+ QVERIFY(nodeList.size() <= numElements);
+ IUIAutomationElement *next = nullptr;
+ hr = controlWalker->GetNextSiblingElement(node, &next);
QVERIFY(SUCCEEDED(hr));
- QCOMPARE(QString((QChar*)txt), QLatin1String("are"));
- ia2Text->Release();
+ node = next;
}
-#endif
- iaccTextEdit->Release();
+ QCOMPARE(nodeList.size(), numElements);
+ // Title bar
+ hr = nodeList.at(0)->get_CurrentControlType(&controlTypeId);
+ QVERIFY(SUCCEEDED(hr));
+ QCOMPARE(controlTypeId, UIA_TitleBarControlTypeId);
- /**************************************************
- * QTableWidget
- **************************************************/
- {
- // Get the second child (the accessible interface for the table widget)
- varChild.vt = VT_I4;
- varChild.lVal = 3;
- QVERIFY(iaccWindow);
- IAccessible *iaccTable = 0;
- hr = iaccWindow->get_accChild(varChild, (IDispatch**)&iaccTable);
- QVERIFY(SUCCEEDED(hr));
- QVERIFY(iaccTable);
- hr = iaccTable->get_accRole(varSELF, &varRole);
- QVERIFY(SUCCEEDED(hr));
-
- QCOMPARE(varRole.vt, (VARTYPE)VT_I4);
- QCOMPARE(varRole.lVal, (LONG)ROLE_SYSTEM_TABLE);
-
+ // Button
+ hr = nodeList.at(1)->get_CurrentControlType(&controlTypeId);
+ QVERIFY(SUCCEEDED(hr));
+ QCOMPARE(controlTypeId, UIA_ButtonControlTypeId);
-#ifdef QT_SUPPORTS_IACCESSIBLE2
- IAccessibleTable2 *ia2Table = (IAccessibleTable2*)queryIA2(iaccTable, IID_IAccessibleTable2);
- QVERIFY(ia2Table);
- BSTR bstrDescription;
- hr = ia2Table->get_columnDescription(0, &bstrDescription);
- QVERIFY(SUCCEEDED(hr));
- QCOMPARE(QString::fromWCharArray(bstrDescription), QLatin1String("h1"));
- ::SysFreeString(bstrDescription);
+ // Edit
+ hr = nodeList.at(2)->get_CurrentControlType(&controlTypeId);
+ QVERIFY(SUCCEEDED(hr));
+ QCOMPARE(controlTypeId, UIA_EditControlTypeId);
- hr = ia2Table->get_rowDescription(1, &bstrDescription);
- QVERIFY(SUCCEEDED(hr));
- QCOMPARE(QString::fromWCharArray(bstrDescription), QLatin1String("v2"));
- ::SysFreeString(bstrDescription);
+ // Table
+ hr = nodeList.at(3)->get_CurrentControlType(&controlTypeId);
+ QVERIFY(SUCCEEDED(hr));
+ QCOMPARE(controlTypeId, UIA_TableControlTypeId);
- IAccessible *accTableCell = 0;
- hr = ia2Table->get_cellAt(1, 2, (IUnknown**)&accTableCell);
- QVERIFY(SUCCEEDED(hr));
- QVERIFY(accTableCell);
- IAccessibleTableCell *ia2TableCell = (IAccessibleTableCell *)queryIA2(accTableCell, IID_IAccessibleTableCell);
- QVERIFY(ia2TableCell);
- LONG index;
- ia2TableCell->get_rowIndex(&index);
- QCOMPARE(index, (LONG)1);
- ia2TableCell->get_columnIndex(&index);
- QCOMPARE(index, (LONG)2);
-
- IAccessible *iaccTableCell = 0;
- hr = ia2TableCell->QueryInterface(IID_IAccessible, (void**)&iaccTableCell);
- QVERIFY(SUCCEEDED(hr));
- QVERIFY(iaccTableCell);
- BSTR bstrCellName;
- hr = iaccTableCell->get_accName(varSELF, &bstrCellName);
- QVERIFY(SUCCEEDED(hr));
- QString cellName((QChar*)bstrCellName);
- QCOMPARE(cellName, QLatin1String("1.2"));
+ // Label
+ hr = nodeList.at(4)->get_CurrentControlType(&controlTypeId);
+ QVERIFY(SUCCEEDED(hr));
+ QCOMPARE(controlTypeId, UIA_EditControlTypeId);
- accTableCell->Release();
- iaccTableCell->Release();
- ia2TableCell->Release();
- ia2Table->Release();
-#endif
- iaccTable->Release();
+ for (auto nd : nodeList) {
+ nd->Release();
}
- iaccWindow->Release();
+ controlWalker->Release();
+ windowElement->Release();
+ automation->Release();
+ CoUninitialize();
+
QTestAccessibility::clearEvents();
#endif
}
diff --git a/tests/auto/other/qfocusevent/tst_qfocusevent.cpp b/tests/auto/other/qfocusevent/tst_qfocusevent.cpp
index 35441010f7..70e696e703 100644
--- a/tests/auto/other/qfocusevent/tst_qfocusevent.cpp
+++ b/tests/auto/other/qfocusevent/tst_qfocusevent.cpp
@@ -346,10 +346,6 @@ void tst_QFocusEvent::checkReason_ActiveWindow()
d->hide();
QTest::qWait(100);
-#if defined(Q_OS_IRIX)
- QEXPECT_FAIL("", "IRIX requires explicit activateWindow(), so this test does not make any sense.", Abort);
-#endif
-
if (!QGuiApplication::platformName().compare(QLatin1String("offscreen"), Qt::CaseInsensitive)
|| !QGuiApplication::platformName().compare(QLatin1String("minimal"), Qt::CaseInsensitive)) {
// Activate window of testFocusWidget, focus in that window goes to childFocusWidgetOne
diff --git a/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp b/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp
index 3ea13896d8..1935bb6501 100644
--- a/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp
+++ b/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp
@@ -248,6 +248,9 @@ private slots:
void QTBUG_57138_data() { generic_data("QSQLITE"); }
void QTBUG_57138();
+ void dateTime_data();
+ void dateTime();
+
private:
// returns all database connections
void generic_data(const QString &engine=QString());
@@ -724,6 +727,30 @@ void tst_QSqlQuery::oraOutValues()
q.addBindValue( out, QSql::Out );
QVERIFY_SQL( q, exec() );
QCOMPARE( q.boundValue( 1 ).toString(), QString( "fifibubulalakikikokololo" ) );
+
+ /*** in/outvalue date ***/
+ QVERIFY_SQL(q, exec("create or replace procedure " + tst_outValues + "(x in date, y out date) is\n"
+ "begin\n"
+ " y := x;\n"
+ "end;\n"));
+ QVERIFY(q.prepare("call " + tst_outValues + "(?, ?)"));
+ const QDate date = QDate::currentDate();
+ q.addBindValue(date, QSql::In);
+ q.addBindValue(QVariant(QDate()), QSql::Out);
+ QVERIFY_SQL(q, exec());
+ QCOMPARE(q.boundValue(1).toDate(), date);
+
+ /*** in/outvalue timestamp ***/
+ QVERIFY_SQL(q, exec("create or replace procedure " + tst_outValues + "(x in timestamp, y out timestamp) is\n"
+ "begin\n"
+ " y := x;\n"
+ "end;\n"));
+ QVERIFY(q.prepare("call " + tst_outValues + "(?, ?)"));
+ const QDateTime dt = QDateTime::currentDateTime();
+ q.addBindValue(dt, QSql::In);
+ q.addBindValue(QVariant(QVariant::DateTime), QSql::Out);
+ QVERIFY_SQL(q, exec());
+ QCOMPARE(q.boundValue(1).toDateTime(), dt);
}
void tst_QSqlQuery::oraClob()
@@ -2138,8 +2165,8 @@ void tst_QSqlQuery::batchExec()
QSqlQuery q( db );
const QString tableName = qTableName("qtest_batch", __FILE__, db);
- QVERIFY_SQL( q, exec( "create table " + tableName + " (id int, name varchar(20), dt date, num numeric(8, 4))" ) );
- QVERIFY_SQL( q, prepare( "insert into " + tableName + " (id, name, dt, num) values (?, ?, ?, ?)" ) );
+ QVERIFY_SQL(q, exec("create table " + tableName + " (id int, name varchar(20), dt date, num numeric(8, 4), dtstamp TIMESTAMP(3))"));
+ QVERIFY_SQL(q, prepare("insert into " + tableName + " (id, name, dt, num, dtstamp) values (?, ?, ?, ?, ?)"));
QVariantList intCol;
intCol << 1 << 2 << QVariant( QVariant::Int );
@@ -2154,31 +2181,54 @@ void tst_QSqlQuery::batchExec()
QVariantList numCol;
numCol << 2.3 << 3.4 << QVariant( QVariant::Double );
- q.addBindValue( intCol );
+ QVariantList timeStampCol;
+ const QDateTime dtStamp = QDateTime(QDate::currentDate(), QTime(1, 2, 3, 4));
+ timeStampCol << dtStamp << dtStamp.addDays(-1) << QVariant(QVariant::DateTime);
+
+ q.addBindValue(intCol);
q.addBindValue( charCol );
q.addBindValue( dateCol );
q.addBindValue( numCol );
+ q.addBindValue(timeStampCol);
QVERIFY_SQL( q, execBatch() );
- QVERIFY_SQL( q, exec( "select id, name, dt, num from " + tableName + " order by id" ) );
+ QVERIFY_SQL(q, exec("select id, name, dt, num, dtstamp from " + tableName + " order by id"));
QVERIFY( q.next() );
QCOMPARE( q.value( 0 ).toInt(), 1 );
QCOMPARE( q.value( 1 ).toString(), QString( "harald" ) );
QCOMPARE( q.value( 2 ).toDateTime(), dt );
QCOMPARE( q.value( 3 ).toDouble(), 2.3 );
+ QCOMPARE(q.value(4).toDateTime(), dtStamp);
QVERIFY( q.next() );
QCOMPARE( q.value( 0 ).toInt(), 2 );
QCOMPARE( q.value( 1 ).toString(), QString( "boris" ) );
QCOMPARE( q.value( 2 ).toDateTime(), dt.addDays( -1 ) );
QCOMPARE( q.value( 3 ).toDouble(), 3.4 );
+ QCOMPARE(q.value(4).toDateTime(), dtStamp.addDays(-1));
QVERIFY( q.next() );
QVERIFY( q.value( 0 ).isNull() );
QVERIFY( q.value( 1 ).isNull() );
QVERIFY( q.value( 2 ).isNull() );
QVERIFY( q.value( 3 ).isNull() );
+ QVERIFY(q.value(4).isNull());
+
+ const QString procName = qTableName("qtest_batch_proc", __FILE__, db);
+ QVERIFY_SQL(q, exec("create or replace procedure " + procName + " (x in timestamp, y out timestamp) is\n"
+ "begin\n"
+ " y := x;\n"
+ "end;\n"));
+ QVERIFY(q.prepare("call " + procName + "(?, ?)"));
+ q.addBindValue(timeStampCol, QSql::In);
+ QVariantList emptyDateTimes;
+ emptyDateTimes.reserve(timeStampCol.size());
+ for (int i = 0; i < timeStampCol.size(); i++)
+ emptyDateTimes << QVariant(QDateTime());
+ q.addBindValue(emptyDateTimes, QSql::Out);
+ QVERIFY_SQL(q, execBatch());
+ QCOMPARE(q.boundValue(1).toList(), timeStampCol);
}
void tst_QSqlQuery::QTBUG_43874()
@@ -2894,16 +2944,14 @@ void tst_QSqlQuery::timeStampParsing()
QFETCH(QString, dbName);
QSqlDatabase db = QSqlDatabase::database(dbName);
CHECK_DATABASE(db);
+ const QString tableName(qTableName("timeStampParsing", __FILE__, db));
+ tst_Databases::safeDropTable(db, tableName);
QSqlQuery q(db);
- QVERIFY_SQL(q, exec(
- "CREATE TABLE \"main\".\"datetest\" ("
- "\"id\" integer NOT NULL PRIMARY KEY AUTOINCREMENT,"
- "\"datefield\" timestamp);"
- ));
- QVERIFY_SQL(q, exec(
- "INSERT INTO datetest (datefield) VALUES (current_timestamp);"
- ));
- QVERIFY_SQL(q, exec("SELECT * FROM datetest;"));
+ QVERIFY_SQL(q, exec(QStringLiteral("CREATE TABLE ") + tableName
+ + QStringLiteral(" (id integer, datefield timestamp)")));
+ QVERIFY_SQL(q, exec(QStringLiteral("INSERT INTO ") + tableName
+ + QStringLiteral(" (datefield) VALUES (current_timestamp)")));
+ QVERIFY_SQL(q, exec(QStringLiteral("SELECT * FROM ") + tableName));
while (q.next())
QVERIFY(q.value(1).toDateTime().isValid());
}
@@ -4142,5 +4190,88 @@ void tst_QSqlQuery::QTBUG_57138()
QCOMPARE(q.value(2).toDateTime(), tzoffset);
}
+void tst_QSqlQuery::dateTime_data()
+{
+ QTest::addColumn<QString>("dbName");
+ QTest::addColumn<QString>("tableName");
+ QTest::addColumn<QString>("createTableString");
+ QTest::addColumn<QList<QDateTime> >("initialDateTimes");
+ QTest::addColumn<QList<QDateTime> >("expectedDateTimes");
+
+ // Using time zones which are highly unlikely to be the same as the testing machine's one
+ // as it could pass as a result despite it.
+ // +8.5 hours from UTC to North Korea
+ const QTimeZone afterUTCTimeZone(30600);
+ // -8 hours from UTC to Belize
+ const QTimeZone beforeUTCTimeZone(-28800);
+ const QTimeZone utcTimeZone("UTC");
+ const QDateTime dt(QDate(2015, 5, 18), QTime(4, 26, 30));
+ const QDateTime dtWithMS(QDate(2015, 5, 18), QTime(4, 26, 30, 500));
+ const QDateTime dtWithAfterTZ(QDate(2015, 5, 18), QTime(4, 26, 30, 500), afterUTCTimeZone);
+ const QDateTime dtWithBeforeTZ(QDate(2015, 5, 18), QTime(4, 26, 30, 500), beforeUTCTimeZone);
+ const QDateTime dtWithUTCTZ(QDate(2015, 5, 18), QTime(4, 26, 30, 500), utcTimeZone);
+ const QList<QDateTime> dateTimes = { dt, dtWithMS, dtWithAfterTZ, dtWithBeforeTZ, dtWithUTCTZ };
+ const QList<QDateTime> expectedDateTimesLocalTZ = { dt, dtWithMS, dtWithAfterTZ.toLocalTime(),
+ dtWithBeforeTZ.toLocalTime(),
+ dtWithUTCTZ.toLocalTime() };
+ const QList<QDateTime> expectedTimeStampDateTimes = { dt, dtWithMS, dtWithMS, dtWithMS, dtWithMS };
+ const QList<QDateTime> expectedDateTimes = { dt, dt, dt, dt, dt };
+
+ for (const QString &dbName : qAsConst(dbs.dbNames)) {
+ QSqlDatabase db = QSqlDatabase::database(dbName);
+ if (!db.isValid())
+ continue;
+ const QString tableNameTSWithTimeZone(qTableName("dateTimeTSWithTimeZone", __FILE__, db));
+ const QString tableNameTSWithLocalTimeZone(qTableName("dateTimeTSWithLocalTimeZone", __FILE__, db));
+ const QString tableNameTS(qTableName("dateTimeTS", __FILE__, db));
+ const QString tableNameDate(qTableName("dateTimeDate", __FILE__, db));
+ QTest::newRow(QString(dbName + " timestamp with time zone").toLatin1())
+ << dbName << tableNameTSWithTimeZone
+ << QStringLiteral(" (dt TIMESTAMP WITH TIME ZONE)")
+ << dateTimes << dateTimes;
+ QTest::newRow(QString(dbName + " timestamp with local time zone").toLatin1())
+ << dbName << tableNameTSWithTimeZone
+ << QStringLiteral(" (dt TIMESTAMP WITH LOCAL TIME ZONE)")
+ << dateTimes << expectedDateTimesLocalTZ;
+ QTest::newRow(QString(dbName + "timestamp").toLatin1())
+ << dbName << tableNameTS << QStringLiteral(" (dt TIMESTAMP(3))")
+ << dateTimes << expectedTimeStampDateTimes;
+ QTest::newRow(QString(dbName + "date").toLatin1())
+ << dbName << tableNameDate << QStringLiteral(" (dt DATE)")
+ << dateTimes << expectedDateTimes;
+ }
+}
+
+void tst_QSqlQuery::dateTime()
+{
+ QFETCH(QString, dbName);
+ QSqlDatabase db = QSqlDatabase::database(dbName);
+ CHECK_DATABASE(db);
+
+ QSqlDriver::DbmsType dbType = tst_Databases::getDatabaseType(db);
+ if (dbType != QSqlDriver::Oracle)
+ QSKIP("Implemented only for Oracle");
+
+ QFETCH(QString, tableName);
+ QFETCH(QString, createTableString);
+ QFETCH(QList<QDateTime>, initialDateTimes);
+ QFETCH(QList<QDateTime>, expectedDateTimes);
+
+ tst_Databases::safeDropTable(db, tableName);
+
+ QSqlQuery q(db);
+ QVERIFY_SQL(q, exec("CREATE TABLE " + tableName + createTableString));
+ for (const QDateTime &dt : qAsConst(initialDateTimes)) {
+ QVERIFY_SQL(q, prepare("INSERT INTO " + tableName + " values(:dt)"));
+ q.bindValue(":dt", dt);
+ QVERIFY_SQL(q, exec());
+ }
+ QVERIFY_SQL(q, exec("SELECT * FROM " + tableName));
+ for (const QDateTime &dt : qAsConst(expectedDateTimes)) {
+ QVERIFY(q.next());
+ QCOMPARE(q.value(0).toDateTime(), dt);
+ }
+}
+
QTEST_MAIN( tst_QSqlQuery )
#include "tst_qsqlquery.moc"
diff --git a/tests/auto/testlib/selftests/deleteLater/deleteLater.pro b/tests/auto/testlib/selftests/deleteLater/deleteLater.pro
new file mode 100644
index 0000000000..6847238b1d
--- /dev/null
+++ b/tests/auto/testlib/selftests/deleteLater/deleteLater.pro
@@ -0,0 +1,7 @@
+SOURCES += tst_deleteLater.cpp
+QT = core testlib
+
+CONFIG -= app_bundle
+CONFIG -= debug_and_release_target
+
+TARGET = tst_deleteLater
diff --git a/tests/auto/testlib/selftests/deleteLater/tst_deleteLater.cpp b/tests/auto/testlib/selftests/deleteLater/tst_deleteLater.cpp
new file mode 100644
index 0000000000..8789baa22a
--- /dev/null
+++ b/tests/auto/testlib/selftests/deleteLater/tst_deleteLater.cpp
@@ -0,0 +1,87 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author David Faure <david.faure@kdab.com>
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE: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>
+
+class tst_DeleteLater: public QObject
+{
+ Q_OBJECT
+
+private slots:
+ void qtestLibShouldFlushDeleteLaterBetweenTests_setup();
+ void qtestLibShouldFlushDeleteLaterBetweenTests_check();
+ void qtestLibShouldFlushDeleteLaterOnExit();
+};
+
+class ToBeDeleted : public QObject
+{
+public:
+ ToBeDeleted(bool *staticBool) : staticBool(staticBool) {}
+ ~ToBeDeleted() { *staticBool = true; }
+private:
+ bool *staticBool;
+};
+
+static bool deletedBetweenTests = false;
+
+void tst_DeleteLater::qtestLibShouldFlushDeleteLaterBetweenTests_setup()
+{
+ ToBeDeleted *obj = new ToBeDeleted(&deletedBetweenTests);
+ obj->deleteLater();
+}
+
+void tst_DeleteLater::qtestLibShouldFlushDeleteLaterBetweenTests_check()
+{
+ QVERIFY(deletedBetweenTests);
+}
+
+static bool deletedOnExit = false;
+
+void tst_DeleteLater::qtestLibShouldFlushDeleteLaterOnExit()
+{
+ ToBeDeleted *obj = new ToBeDeleted(&deletedOnExit);
+ obj->deleteLater();
+}
+
+// This global object will check whether the deleteLater was processed
+class DeleteChecker
+{
+public:
+ ~DeleteChecker() {
+ if (!deletedOnExit) {
+ qFatal("QTestLib failed to flush deleteLater on exit");
+ }
+ }
+};
+static DeleteChecker s_deleteChecker;
+
+QTEST_MAIN(tst_DeleteLater)
+
+#include "tst_deleteLater.moc"
diff --git a/tests/auto/testlib/selftests/deleteLater_noApp/deleteLater_noApp.pro b/tests/auto/testlib/selftests/deleteLater_noApp/deleteLater_noApp.pro
new file mode 100644
index 0000000000..f860a767cd
--- /dev/null
+++ b/tests/auto/testlib/selftests/deleteLater_noApp/deleteLater_noApp.pro
@@ -0,0 +1,7 @@
+SOURCES += tst_deleteLater_noApp.cpp
+QT = core testlib
+
+CONFIG -= app_bundle
+CONFIG -= debug_and_release_target
+
+TARGET = tst_deleteLater_noApp
diff --git a/tests/auto/testlib/selftests/deleteLater_noApp/tst_deleteLater_noApp.cpp b/tests/auto/testlib/selftests/deleteLater_noApp/tst_deleteLater_noApp.cpp
new file mode 100644
index 0000000000..9069e5d07e
--- /dev/null
+++ b/tests/auto/testlib/selftests/deleteLater_noApp/tst_deleteLater_noApp.cpp
@@ -0,0 +1,88 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author David Faure <david.faure@kdab.com>
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE: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>
+
+class tst_DeleteLater_noApp: public QObject
+{
+ Q_OBJECT
+
+private slots:
+ void qtestLibShouldNotFlushDeleteLaterBetweenTests_setup();
+ void qtestLibShouldNotFlushDeleteLaterBetweenTests_check();
+ void qtestLibShouldNotFlushDeleteLaterOnExit();
+};
+
+class ToBeDeleted : public QObject
+{
+public:
+ ToBeDeleted(bool *staticBool) : staticBool(staticBool) {}
+ ~ToBeDeleted() { *staticBool = true; }
+private:
+ bool *staticBool;
+};
+
+static bool deletedBetweenTests = false;
+
+void tst_DeleteLater_noApp::qtestLibShouldNotFlushDeleteLaterBetweenTests_setup()
+{
+ ToBeDeleted *obj = new ToBeDeleted(&deletedBetweenTests);
+ obj->deleteLater();
+}
+
+void tst_DeleteLater_noApp::qtestLibShouldNotFlushDeleteLaterBetweenTests_check()
+{
+ // There's no qApp, we can't flush the events
+ QVERIFY(!deletedBetweenTests);
+}
+
+static bool deletedOnExit = false;
+
+void tst_DeleteLater_noApp::qtestLibShouldNotFlushDeleteLaterOnExit()
+{
+ ToBeDeleted *obj = new ToBeDeleted(&deletedOnExit);
+ obj->deleteLater();
+}
+
+// This global object will check whether the deleteLater was processed
+class DeleteChecker
+{
+public:
+ ~DeleteChecker() {
+ if (deletedOnExit) {
+ qFatal("QTestLib somehow flushed deleteLater on exit, without a qApp?");
+ }
+ }
+};
+static DeleteChecker s_deleteChecker;
+
+QTEST_APPLESS_MAIN(tst_DeleteLater_noApp)
+
+#include "tst_deleteLater_noApp.moc"
diff --git a/tests/auto/testlib/selftests/expected_alive.txt b/tests/auto/testlib/selftests/expected_alive.txt
deleted file mode 100644
index 4384a9fcea..0000000000
--- a/tests/auto/testlib/selftests/expected_alive.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-********* Start testing of tst_Alive *********
-Config: Using QtTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@
-PASS : tst_Alive::initTestCase()
-QWARN : tst_Alive::alive() TEST LAGS 3 PINGS behind!
-QWARN : tst_Alive::alive() TEST LAGS 4 PINGS behind!
-QDEBUG : tst_Alive::alive() CUT
-QWARN : tst_Alive::alive() TEST LAGS 3 PINGS behind!
-QWARN : tst_Alive::alive() TEST LAGS 4 PINGS behind!
-PASS : tst_Alive::alive()
-PASS : tst_Alive::addMouseDClick()
-PASS : tst_Alive::cleanupTestCase()
-Totals: 4 passed, 0 failed, 0 skipped, 0 blacklisted
-********* Finished testing of tst_Alive *********
diff --git a/tests/auto/testlib/selftests/expected_assert.lightxml b/tests/auto/testlib/selftests/expected_assert.lightxml
index b40ff41da3..1591f4cf41 100644
--- a/tests/auto/testlib/selftests/expected_assert.lightxml
+++ b/tests/auto/testlib/selftests/expected_assert.lightxml
@@ -5,19 +5,19 @@
</Environment>
<TestFunction name="initTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testNumber1">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testNumber2">
<Message type="qfatal" file="" line="0">
- <Description><![CDATA[ASSERT: "false" in file tst_assert.cpp, line 66]]></Description>
+ <Description><![CDATA[ASSERT: "false" in file qtbase/tests/auto/testlib/selftests/assert/tst_assert.cpp, line 0]]></Description>
</Message>
<Incident type="fail" file="Unknown file" line="0">
<Description><![CDATA[Received a fatal error.]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<Duration msecs="0"/>
diff --git a/tests/auto/testlib/selftests/expected_assert.teamcity b/tests/auto/testlib/selftests/expected_assert.teamcity
index 2b6cf21863..3f68c5f21b 100644
--- a/tests/auto/testlib/selftests/expected_assert.teamcity
+++ b/tests/auto/testlib/selftests/expected_assert.teamcity
@@ -5,6 +5,6 @@
##teamcity[testFinished name='testNumber1()' flowId='tst_Assert']
##teamcity[testStarted name='testNumber2()' flowId='tst_Assert']
##teamcity[testFailed name='testNumber2()' message='Failure! |[Loc: Unknown file(0)|]' details='Received a fatal error.' flowId='tst_Assert']
-##teamcity[testStdOut name='testNumber2()' out='QFATAL: ASSERT: "false" in file tst_assert.cpp, line 58' flowId='tst_Assert']
+##teamcity[testStdOut name='testNumber2()' out='QFATAL: ASSERT: "false" in file qtbase/tests/auto/testlib/selftests/assert/tst_assert.cpp, line 0' flowId='tst_Assert']
##teamcity[testFinished name='testNumber2()' flowId='tst_Assert']
##teamcity[testSuiteFinished name='tst_Assert' flowId='tst_Assert']
diff --git a/tests/auto/testlib/selftests/expected_assert.txt b/tests/auto/testlib/selftests/expected_assert.txt
index c07c95d8ee..9380eeddc1 100644
--- a/tests/auto/testlib/selftests/expected_assert.txt
+++ b/tests/auto/testlib/selftests/expected_assert.txt
@@ -1,9 +1,9 @@
********* Start testing of tst_Assert *********
-Config: Using QtTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@
+Config: Using QtTest library
PASS : tst_Assert::initTestCase()
PASS : tst_Assert::testNumber1()
-QFATAL : tst_Assert::testNumber2() ASSERT: "false" in file tst_assert.cpp, line 66
+QFATAL : tst_Assert::testNumber2() ASSERT: "false" in file qtbase/tests/auto/testlib/selftests/assert/tst_assert.cpp, line 0
FAIL! : tst_Assert::testNumber2() Received a fatal error.
Loc: [Unknown file(0)]
-Totals: 2 passed, 1 failed, 0 skipped, 0 blacklisted
+Totals: 2 passed, 1 failed, 0 skipped, 0 blacklisted, 0ms
********* Finished testing of tst_Assert *********
diff --git a/tests/auto/testlib/selftests/expected_assert.xml b/tests/auto/testlib/selftests/expected_assert.xml
index 9770b3cd57..cdb7f4d8d1 100644
--- a/tests/auto/testlib/selftests/expected_assert.xml
+++ b/tests/auto/testlib/selftests/expected_assert.xml
@@ -7,20 +7,20 @@
</Environment>
<TestFunction name="initTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testNumber1">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testNumber2">
<Message type="qfatal" file="" line="0">
- <Description><![CDATA[ASSERT: "false" in file tst_assert.cpp, line 66]]></Description>
+ <Description><![CDATA[ASSERT: "false" in file qtbase/tests/auto/testlib/selftests/assert/tst_assert.cpp, line 0]]></Description>
</Message>
<Incident type="fail" file="Unknown file" line="0">
<Description><![CDATA[Received a fatal error.]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<Duration msecs="0"/>
</TestCase>
diff --git a/tests/auto/testlib/selftests/expected_assert.xunitxml b/tests/auto/testlib/selftests/expected_assert.xunitxml
index 96daa33dcf..ca12a45e20 100644
--- a/tests/auto/testlib/selftests/expected_assert.xunitxml
+++ b/tests/auto/testlib/selftests/expected_assert.xunitxml
@@ -8,10 +8,10 @@
<testcase result="pass" name="initTestCase"/>
<testcase result="pass" name="testNumber1"/>
<testcase result="fail" name="testNumber2">
- <!-- message="ASSERT: &quot;false&quot; in file tst_assert.cpp, line 66" type="qfatal" -->
+ <!-- message="ASSERT: &quot;false&quot; in file qtbase/tests/auto/testlib/selftests/assert/tst_assert.cpp, line 53" type="qfatal" -->
<failure message="Received a fatal error." result="fail"/>
</testcase>
<system-err>
-<![CDATA[ASSERT: "false" in file tst_assert.cpp, line 66]]>
+<![CDATA[ASSERT: "false" in file qtbase/tests/auto/testlib/selftests/assert/tst_assert.cpp, line 0]]>
</system-err>
</testsuite>
diff --git a/tests/auto/testlib/selftests/expected_badxml.lightxml b/tests/auto/testlib/selftests/expected_badxml.lightxml
index 94f479a79a..1ab76274d3 100644
--- a/tests/auto/testlib/selftests/expected_badxml.lightxml
+++ b/tests/auto/testlib/selftests/expected_badxml.lightxml
@@ -12,7 +12,7 @@
<DataTag><![CDATA[fail end cdata ]]]><![CDATA[]> text ]]]><![CDATA[]> more text]]></DataTag>
<Description><![CDATA[a message]]></Description>
</Message>
-<Incident type="fail" file="tst_badxml.cpp" line="114">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/badxml/tst_badxml.cpp" line="0">
<DataTag><![CDATA[fail end cdata ]]]><![CDATA[]> text ]]]><![CDATA[]> more text]]></DataTag>
<Description><![CDATA[a failure]]></Description>
</Incident>
@@ -28,7 +28,7 @@
<DataTag><![CDATA[fail quotes " text" more text]]></DataTag>
<Description><![CDATA[a message]]></Description>
</Message>
-<Incident type="fail" file="tst_badxml.cpp" line="114">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/badxml/tst_badxml.cpp" line="0">
<DataTag><![CDATA[fail quotes " text" more text]]></DataTag>
<Description><![CDATA[a failure]]></Description>
</Incident>
@@ -44,7 +44,7 @@
<DataTag><![CDATA[fail xml close > open < tags < text]]></DataTag>
<Description><![CDATA[a message]]></Description>
</Message>
-<Incident type="fail" file="tst_badxml.cpp" line="114">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/badxml/tst_badxml.cpp" line="0">
<DataTag><![CDATA[fail xml close > open < tags < text]]></DataTag>
<Description><![CDATA[a failure]]></Description>
</Incident>
@@ -60,7 +60,7 @@
<DataTag><![CDATA[fail all > " mixed ]]]><![CDATA[]> up > " in < the ]]]><![CDATA[]> hopes < of triggering "< ]]]><![CDATA[]> bugs]]></DataTag>
<Description><![CDATA[a message]]></Description>
</Message>
-<Incident type="fail" file="tst_badxml.cpp" line="114">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/badxml/tst_badxml.cpp" line="0">
<DataTag><![CDATA[fail all > " mixed ]]]><![CDATA[]> up > " in < the ]]]><![CDATA[]> hopes < of triggering "< ]]]><![CDATA[]> bugs]]></DataTag>
<Description><![CDATA[a failure]]></Description>
</Incident>
diff --git a/tests/auto/testlib/selftests/expected_badxml.teamcity b/tests/auto/testlib/selftests/expected_badxml.teamcity
index 04d38f81ab..e765393375 100644
--- a/tests/auto/testlib/selftests/expected_badxml.teamcity
+++ b/tests/auto/testlib/selftests/expected_badxml.teamcity
@@ -2,28 +2,28 @@
##teamcity[testStarted name='initTestCase()' flowId='tst_BadXml']
##teamcity[testFinished name='initTestCase()' flowId='tst_BadXml']
##teamcity[testStarted name='badDataTag(fail end cdata |]|]> text |]|]> more text)' flowId='tst_BadXml']
-##teamcity[testFailed name='badDataTag(fail end cdata |]|]> text |]|]> more text)' message='Failure! |[Loc: tst_badxml.cpp(106)|]' details='a failure' flowId='tst_BadXml']
+##teamcity[testFailed name='badDataTag(fail end cdata |]|]> text |]|]> more text)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/badxml/tst_badxml.cpp(0)|]' details='a failure' flowId='tst_BadXml']
##teamcity[testStdOut name='badDataTag(fail end cdata |]|]> text |]|]> more text)' out='QDEBUG: a message' flowId='tst_BadXml']
##teamcity[testFinished name='badDataTag(fail end cdata |]|]> text |]|]> more text)' flowId='tst_BadXml']
##teamcity[testStarted name='badDataTag(pass end cdata |]|]> text |]|]> more text)' flowId='tst_BadXml']
##teamcity[testStdOut name='badDataTag(pass end cdata |]|]> text |]|]> more text)' out='QDEBUG: a message' flowId='tst_BadXml']
##teamcity[testFinished name='badDataTag(pass end cdata |]|]> text |]|]> more text)' flowId='tst_BadXml']
##teamcity[testStarted name='badDataTag(fail quotes " text" more text)' flowId='tst_BadXml']
-##teamcity[testFailed name='badDataTag(fail quotes " text" more text)' message='Failure! |[Loc: tst_badxml.cpp(106)|]' details='a failure' flowId='tst_BadXml']
+##teamcity[testFailed name='badDataTag(fail quotes " text" more text)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/badxml/tst_badxml.cpp(0)|]' details='a failure' flowId='tst_BadXml']
##teamcity[testStdOut name='badDataTag(fail quotes " text" more text)' out='QDEBUG: a message' flowId='tst_BadXml']
##teamcity[testFinished name='badDataTag(fail quotes " text" more text)' flowId='tst_BadXml']
##teamcity[testStarted name='badDataTag(pass quotes " text" more text)' flowId='tst_BadXml']
##teamcity[testStdOut name='badDataTag(pass quotes " text" more text)' out='QDEBUG: a message' flowId='tst_BadXml']
##teamcity[testFinished name='badDataTag(pass quotes " text" more text)' flowId='tst_BadXml']
##teamcity[testStarted name='badDataTag(fail xml close > open < tags < text)' flowId='tst_BadXml']
-##teamcity[testFailed name='badDataTag(fail xml close > open < tags < text)' message='Failure! |[Loc: tst_badxml.cpp(106)|]' details='a failure' flowId='tst_BadXml']
+##teamcity[testFailed name='badDataTag(fail xml close > open < tags < text)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/badxml/tst_badxml.cpp(0)|]' details='a failure' flowId='tst_BadXml']
##teamcity[testStdOut name='badDataTag(fail xml close > open < tags < text)' out='QDEBUG: a message' flowId='tst_BadXml']
##teamcity[testFinished name='badDataTag(fail xml close > open < tags < text)' flowId='tst_BadXml']
##teamcity[testStarted name='badDataTag(pass xml close > open < tags < text)' flowId='tst_BadXml']
##teamcity[testStdOut name='badDataTag(pass xml close > open < tags < text)' out='QDEBUG: a message' flowId='tst_BadXml']
##teamcity[testFinished name='badDataTag(pass xml close > open < tags < text)' flowId='tst_BadXml']
##teamcity[testStarted name='badDataTag(fail all > " mixed |]|]> up > " in < the |]|]> hopes < of triggering "< |]|]> bugs)' flowId='tst_BadXml']
-##teamcity[testFailed name='badDataTag(fail all > " mixed |]|]> up > " in < the |]|]> hopes < of triggering "< |]|]> bugs)' message='Failure! |[Loc: tst_badxml.cpp(106)|]' details='a failure' flowId='tst_BadXml']
+##teamcity[testFailed name='badDataTag(fail all > " mixed |]|]> up > " in < the |]|]> hopes < of triggering "< |]|]> bugs)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/badxml/tst_badxml.cpp(0)|]' details='a failure' flowId='tst_BadXml']
##teamcity[testStdOut name='badDataTag(fail all > " mixed |]|]> up > " in < the |]|]> hopes < of triggering "< |]|]> bugs)' out='QDEBUG: a message' flowId='tst_BadXml']
##teamcity[testFinished name='badDataTag(fail all > " mixed |]|]> up > " in < the |]|]> hopes < of triggering "< |]|]> bugs)' flowId='tst_BadXml']
##teamcity[testStarted name='badDataTag(pass all > " mixed |]|]> up > " in < the |]|]> hopes < of triggering "< |]|]> bugs)' flowId='tst_BadXml']
@@ -44,7 +44,7 @@
##teamcity[testStarted name='failWithNoFile()' flowId='tst_BadXml']
##teamcity[testFailed name='failWithNoFile()' message='Failure!' details='failure message' flowId='tst_BadXml']
##teamcity[testFinished name='failWithNoFile()' flowId='tst_BadXml']
-##teamcity[testIgnored name='encoding()' message='Skipped for text due to unpredictable console encoding. |[Loc: tst_badxml.cpp(131)|]' flowId='tst_BadXml']
+##teamcity[testIgnored name='encoding()' message='Skipped for text due to unpredictable console encoding. |[Loc: qtbase/tests/auto/testlib/selftests/badxml/tst_badxml.cpp(0)|]' flowId='tst_BadXml']
##teamcity[testStarted name='cleanupTestCase()' flowId='tst_BadXml']
##teamcity[testFinished name='cleanupTestCase()' flowId='tst_BadXml']
##teamcity[testSuiteFinished name='tst_BadXml' flowId='tst_BadXml']
diff --git a/tests/auto/testlib/selftests/expected_badxml.txt b/tests/auto/testlib/selftests/expected_badxml.txt
index e4fa78494e..e9d8695130 100644
--- a/tests/auto/testlib/selftests/expected_badxml.txt
+++ b/tests/auto/testlib/selftests/expected_badxml.txt
@@ -1,30 +1,30 @@
********* Start testing of tst_BadXml *********
-Config: Using QtTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@
+Config: Using QtTest library
PASS : tst_BadXml::initTestCase()
QDEBUG : tst_BadXml::badDataTag(fail end cdata ]]> text ]]> more text) a message
FAIL! : tst_BadXml::badDataTag(fail end cdata ]]> text ]]> more text) a failure
- Loc: [tst_badxml.cpp(114)]
+ Loc: [qtbase/tests/auto/testlib/selftests/badxml/tst_badxml.cpp(0)]
QDEBUG : tst_BadXml::badDataTag(pass end cdata ]]> text ]]> more text) a message
PASS : tst_BadXml::badDataTag(pass end cdata ]]> text ]]> more text)
RESULT : tst_BadXml::badDataTag():"pass end cdata ]]> text ]]> more text":
0 events per iteration (total: 0, iterations: 1)
QDEBUG : tst_BadXml::badDataTag(fail quotes " text" more text) a message
FAIL! : tst_BadXml::badDataTag(fail quotes " text" more text) a failure
- Loc: [tst_badxml.cpp(114)]
+ Loc: [qtbase/tests/auto/testlib/selftests/badxml/tst_badxml.cpp(0)]
QDEBUG : tst_BadXml::badDataTag(pass quotes " text" more text) a message
PASS : tst_BadXml::badDataTag(pass quotes " text" more text)
RESULT : tst_BadXml::badDataTag():"pass quotes " text" more text":
0 events per iteration (total: 0, iterations: 1)
QDEBUG : tst_BadXml::badDataTag(fail xml close > open < tags < text) a message
FAIL! : tst_BadXml::badDataTag(fail xml close > open < tags < text) a failure
- Loc: [tst_badxml.cpp(114)]
+ Loc: [qtbase/tests/auto/testlib/selftests/badxml/tst_badxml.cpp(0)]
QDEBUG : tst_BadXml::badDataTag(pass xml close > open < tags < text) a message
PASS : tst_BadXml::badDataTag(pass xml close > open < tags < text)
RESULT : tst_BadXml::badDataTag():"pass xml close > open < tags < text":
0 events per iteration (total: 0, iterations: 1)
QDEBUG : tst_BadXml::badDataTag(fail all > " mixed ]]> up > " in < the ]]> hopes < of triggering "< ]]> bugs) a message
FAIL! : tst_BadXml::badDataTag(fail all > " mixed ]]> up > " in < the ]]> hopes < of triggering "< ]]> bugs) a failure
- Loc: [tst_badxml.cpp(114)]
+ Loc: [qtbase/tests/auto/testlib/selftests/badxml/tst_badxml.cpp(0)]
QDEBUG : tst_BadXml::badDataTag(pass all > " mixed ]]> up > " in < the ]]> hopes < of triggering "< ]]> bugs) a message
PASS : tst_BadXml::badDataTag(pass all > " mixed ]]> up > " in < the ]]> hopes < of triggering "< ]]> bugs)
RESULT : tst_BadXml::badDataTag():"pass all > " mixed ]]> up > " in < the ]]> hopes < of triggering "< ]]> bugs":
@@ -39,7 +39,7 @@ QDEBUG : tst_BadXml::badMessage(string 3) all > " mixed ]]> up > " in < the ]]>
PASS : tst_BadXml::badMessage(string 3)
FAIL! : tst_BadXml::failWithNoFile() failure message
SKIP : tst_BadXml::encoding() Skipped for text due to unpredictable console encoding.
- Loc: [tst_badxml.cpp(139)]
+ Loc: [qtbase/tests/auto/testlib/selftests/badxml/tst_badxml.cpp(0)]
PASS : tst_BadXml::cleanupTestCase()
-Totals: 10 passed, 5 failed, 1 skipped, 0 blacklisted
+Totals: 10 passed, 5 failed, 1 skipped, 0 blacklisted, 0ms
********* Finished testing of tst_BadXml *********
diff --git a/tests/auto/testlib/selftests/expected_badxml.xml b/tests/auto/testlib/selftests/expected_badxml.xml
index c1266bfeed..927f58f7f6 100644
--- a/tests/auto/testlib/selftests/expected_badxml.xml
+++ b/tests/auto/testlib/selftests/expected_badxml.xml
@@ -14,7 +14,7 @@
<DataTag><![CDATA[fail end cdata ]]]><![CDATA[]> text ]]]><![CDATA[]> more text]]></DataTag>
<Description><![CDATA[a message]]></Description>
</Message>
-<Incident type="fail" file="tst_badxml.cpp" line="114">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/badxml/tst_badxml.cpp" line="0">
<DataTag><![CDATA[fail end cdata ]]]><![CDATA[]> text ]]]><![CDATA[]> more text]]></DataTag>
<Description><![CDATA[a failure]]></Description>
</Incident>
@@ -30,7 +30,7 @@
<DataTag><![CDATA[fail quotes " text" more text]]></DataTag>
<Description><![CDATA[a message]]></Description>
</Message>
-<Incident type="fail" file="tst_badxml.cpp" line="114">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/badxml/tst_badxml.cpp" line="0">
<DataTag><![CDATA[fail quotes " text" more text]]></DataTag>
<Description><![CDATA[a failure]]></Description>
</Incident>
@@ -46,7 +46,7 @@
<DataTag><![CDATA[fail xml close > open < tags < text]]></DataTag>
<Description><![CDATA[a message]]></Description>
</Message>
-<Incident type="fail" file="tst_badxml.cpp" line="114">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/badxml/tst_badxml.cpp" line="0">
<DataTag><![CDATA[fail xml close > open < tags < text]]></DataTag>
<Description><![CDATA[a failure]]></Description>
</Incident>
@@ -62,7 +62,7 @@
<DataTag><![CDATA[fail all > " mixed ]]]><![CDATA[]> up > " in < the ]]]><![CDATA[]> hopes < of triggering "< ]]]><![CDATA[]> bugs]]></DataTag>
<Description><![CDATA[a message]]></Description>
</Message>
-<Incident type="fail" file="tst_badxml.cpp" line="114">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/badxml/tst_badxml.cpp" line="0">
<DataTag><![CDATA[fail all > " mixed ]]]><![CDATA[]> up > " in < the ]]]><![CDATA[]> hopes < of triggering "< ]]]><![CDATA[]> bugs]]></DataTag>
<Description><![CDATA[a failure]]></Description>
</Incident>
diff --git a/tests/auto/testlib/selftests/expected_benchlibcallgrind.lightxml b/tests/auto/testlib/selftests/expected_benchlibcallgrind.lightxml
new file mode 100644
index 0000000000..ea5374985d
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_benchlibcallgrind.lightxml
@@ -0,0 +1,26 @@
+<Environment>
+ <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>
+ <QtBuild/>
+ <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion>
+</Environment>
+<Environment>
+ <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>
+ <QtBuild/>
+ <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion>
+</Environment>
+<TestFunction name="initTestCase">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="twoHundredMillionInstructions">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/benchlibcallgrind/tst_benchlibcallgrind.cpp" line="0">
+ <Description><![CDATA[This test is only defined for gcc and x86.]]></Description>
+</Message>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="cleanupTestCase">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<Duration msecs="0"/>
+<Duration msecs="0"/>
diff --git a/tests/auto/testlib/selftests/expected_benchlibcallgrind.teamcity b/tests/auto/testlib/selftests/expected_benchlibcallgrind.teamcity
new file mode 100644
index 0000000000..11de23ccc2
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_benchlibcallgrind.teamcity
@@ -0,0 +1,9 @@
+##teamcity[testSuiteStarted name='tst_BenchlibCallgrind' flowId='tst_BenchlibCallgrind']
+##teamcity[testSuiteStarted name='tst_BenchlibCallgrind' flowId='tst_BenchlibCallgrind']
+##teamcity[testStarted name='initTestCase()' flowId='tst_BenchlibCallgrind']
+##teamcity[testFinished name='initTestCase()' flowId='tst_BenchlibCallgrind']
+##teamcity[testIgnored name='twoHundredMillionInstructions()' message='This test is only defined for gcc and x86. |[Loc: qtbase/tests/auto/testlib/selftests/benchlibcallgrind/tst_benchlibcallgrind.cpp(0)|]' flowId='tst_BenchlibCallgrind']
+##teamcity[testStarted name='cleanupTestCase()' flowId='tst_BenchlibCallgrind']
+##teamcity[testFinished name='cleanupTestCase()' flowId='tst_BenchlibCallgrind']
+##teamcity[testSuiteFinished name='tst_BenchlibCallgrind' flowId='tst_BenchlibCallgrind']
+##teamcity[testSuiteFinished name='tst_BenchlibCallgrind' flowId='tst_BenchlibCallgrind']
diff --git a/tests/auto/testlib/selftests/expected_benchlibcallgrind.xml b/tests/auto/testlib/selftests/expected_benchlibcallgrind.xml
new file mode 100644
index 0000000000..14433e719d
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_benchlibcallgrind.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<TestCase name="tst_BenchlibCallgrind">
+<Environment>
+ <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>
+ <QtBuild/>
+ <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion>
+</Environment>
+<?xml version="1.0" encoding="UTF-8"?>
+<TestCase name="tst_BenchlibCallgrind">
+<Environment>
+ <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>
+ <QtBuild/>
+ <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion>
+</Environment>
+<TestFunction name="initTestCase">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="twoHundredMillionInstructions">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/benchlibcallgrind/tst_benchlibcallgrind.cpp" line="0">
+ <Description><![CDATA[This test is only defined for gcc and x86.]]></Description>
+</Message>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="cleanupTestCase">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<Duration msecs="0"/>
+</TestCase>
+<Duration msecs="0"/>
+</TestCase>
diff --git a/tests/auto/testlib/selftests/expected_benchlibcallgrind.xunitxml b/tests/auto/testlib/selftests/expected_benchlibcallgrind.xunitxml
new file mode 100644
index 0000000000..95d90e6ee7
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_benchlibcallgrind.xunitxml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<testsuite errors="1" failures="0" tests="3" name="tst_BenchlibCallgrind">
+ <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"/>
+ <testcase name="twoHundredMillionInstructions">
+ <!-- message="This test is only defined for gcc and x86." type="skip" -->
+ </testcase>
+ <testcase result="pass" name="cleanupTestCase"/>
+ <system-err>
+<![CDATA[This test is only defined for gcc and x86.]]>
+ </system-err>
+</testsuite>
+<?xml version="1.0" encoding="UTF-8" ?>
+<testsuite errors="0" failures="0" tests="0" name="tst_BenchlibCallgrind">
+ <properties>
+ <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/>
+ <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/>
+ <property value="" name="QtBuild"/>
+ </properties>
+ <system-err/>
+</testsuite>
diff --git a/tests/auto/testlib/selftests/expected_benchlibcallgrind_0.txt b/tests/auto/testlib/selftests/expected_benchlibcallgrind_0.txt
new file mode 100644
index 0000000000..750dcf4736
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_benchlibcallgrind_0.txt
@@ -0,0 +1,8 @@
+********* Start testing of tst_BenchlibCallgrind *********
+Config: Using QtTest library
+PASS : tst_BenchlibCallgrind::initTestCase()
+SKIP : tst_BenchlibCallgrind::twoHundredMillionInstructions() This test is only defined for gcc and x86.
+ Loc: [qtbase/tests/auto/testlib/selftests/benchlibcallgrind/tst_benchlibcallgrind.cpp(0)]
+PASS : tst_BenchlibCallgrind::cleanupTestCase()
+Totals: 2 passed, 0 failed, 1 skipped, 0 blacklisted
+********* Finished testing of tst_BenchlibCallgrind *********
diff --git a/tests/auto/testlib/selftests/expected_benchlibcallgrind.txt b/tests/auto/testlib/selftests/expected_benchlibcallgrind_1.txt
index 07365bb9e8..07365bb9e8 100644
--- a/tests/auto/testlib/selftests/expected_benchlibcallgrind.txt
+++ b/tests/auto/testlib/selftests/expected_benchlibcallgrind_1.txt
diff --git a/tests/auto/testlib/selftests/expected_benchlibcounting.lightxml b/tests/auto/testlib/selftests/expected_benchlibcounting.lightxml
index 6fe511462c..cc83020650 100644
--- a/tests/auto/testlib/selftests/expected_benchlibcounting.lightxml
+++ b/tests/auto/testlib/selftests/expected_benchlibcounting.lightxml
@@ -5,27 +5,27 @@
</Environment>
<TestFunction name="initTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="passingBenchmark">
<Incident type="pass" file="" line="0" />
<BenchmarkResult metric="Events" tag="" value="0" iterations="1" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="skippingBenchmark">
-<Message type="skip" file="tst_benchlibcounting.cpp" line="64">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/benchlibcounting/tst_benchlibcounting.cpp" line="0">
<Description><![CDATA[This is a skipping benchmark]]></Description>
</Message>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="failingBenchmark">
-<Incident type="fail" file="tst_benchlibcounting.cpp" line="71">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/benchlibcounting/tst_benchlibcounting.cpp" line="0">
<Description><![CDATA[This is a failing benchmark]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="cleanupTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<Duration msecs="0"/>
diff --git a/tests/auto/testlib/selftests/expected_benchlibcounting.teamcity b/tests/auto/testlib/selftests/expected_benchlibcounting.teamcity
new file mode 100644
index 0000000000..f693db31d8
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_benchlibcounting.teamcity
@@ -0,0 +1,12 @@
+##teamcity[testSuiteStarted name='tst_BenchlibCounting' flowId='tst_BenchlibCounting']
+##teamcity[testStarted name='initTestCase()' flowId='tst_BenchlibCounting']
+##teamcity[testFinished name='initTestCase()' flowId='tst_BenchlibCounting']
+##teamcity[testStarted name='passingBenchmark()' flowId='tst_BenchlibCounting']
+##teamcity[testFinished name='passingBenchmark()' flowId='tst_BenchlibCounting']
+##teamcity[testIgnored name='skippingBenchmark()' message='This is a skipping benchmark |[Loc: qtbase/tests/auto/testlib/selftests/benchlibcounting/tst_benchlibcounting.cpp(0)|]' flowId='tst_BenchlibCounting']
+##teamcity[testStarted name='failingBenchmark()' flowId='tst_BenchlibCounting']
+##teamcity[testFailed name='failingBenchmark()' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/benchlibcounting/tst_benchlibcounting.cpp(0)|]' details='This is a failing benchmark' flowId='tst_BenchlibCounting']
+##teamcity[testFinished name='failingBenchmark()' flowId='tst_BenchlibCounting']
+##teamcity[testStarted name='cleanupTestCase()' flowId='tst_BenchlibCounting']
+##teamcity[testFinished name='cleanupTestCase()' flowId='tst_BenchlibCounting']
+##teamcity[testSuiteFinished name='tst_BenchlibCounting' flowId='tst_BenchlibCounting']
diff --git a/tests/auto/testlib/selftests/expected_benchlibcounting.txt b/tests/auto/testlib/selftests/expected_benchlibcounting.txt
index 62e316dc3c..d47309d11c 100644
--- a/tests/auto/testlib/selftests/expected_benchlibcounting.txt
+++ b/tests/auto/testlib/selftests/expected_benchlibcounting.txt
@@ -1,13 +1,13 @@
********* Start testing of tst_BenchlibCounting *********
-Config: Using QtTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@
+Config: Using QtTest library
PASS : tst_BenchlibCounting::initTestCase()
PASS : tst_BenchlibCounting::passingBenchmark()
RESULT : tst_BenchlibCounting::passingBenchmark():
0 events per iteration (total: 0, iterations: 1)
SKIP : tst_BenchlibCounting::skippingBenchmark() This is a skipping benchmark
- Loc: [tst_benchlibcounting.cpp(64)]
+ Loc: [qtbase/tests/auto/testlib/selftests/benchlibcounting/tst_benchlibcounting.cpp(0)]
FAIL! : tst_BenchlibCounting::failingBenchmark() This is a failing benchmark
- Loc: [tst_benchlibcounting.cpp(71)]
+ Loc: [qtbase/tests/auto/testlib/selftests/benchlibcounting/tst_benchlibcounting.cpp(0)]
PASS : tst_BenchlibCounting::cleanupTestCase()
-Totals: 3 passed, 1 failed, 1 skipped, 0 blacklisted
+Totals: 3 passed, 1 failed, 1 skipped, 0 blacklisted, 0ms
********* Finished testing of tst_BenchlibCounting *********
diff --git a/tests/auto/testlib/selftests/expected_benchlibcounting.xml b/tests/auto/testlib/selftests/expected_benchlibcounting.xml
index d945511eec..7c8366ed8c 100644
--- a/tests/auto/testlib/selftests/expected_benchlibcounting.xml
+++ b/tests/auto/testlib/selftests/expected_benchlibcounting.xml
@@ -7,28 +7,28 @@
</Environment>
<TestFunction name="initTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="passingBenchmark">
<Incident type="pass" file="" line="0" />
<BenchmarkResult metric="Events" tag="" value="0" iterations="1" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="skippingBenchmark">
-<Message type="skip" file="tst_benchlibcounting.cpp" line="64">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/benchlibcounting/tst_benchlibcounting.cpp" line="0">
<Description><![CDATA[This is a skipping benchmark]]></Description>
</Message>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="failingBenchmark">
-<Incident type="fail" file="tst_benchlibcounting.cpp" line="71">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/benchlibcounting/tst_benchlibcounting.cpp" line="0">
<Description><![CDATA[This is a failing benchmark]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="cleanupTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<Duration msecs="0"/>
</TestCase>
diff --git a/tests/auto/testlib/selftests/expected_benchlibeventcounter.lightxml b/tests/auto/testlib/selftests/expected_benchlibeventcounter.lightxml
index 0bc00569e9..867210ecb3 100644
--- a/tests/auto/testlib/selftests/expected_benchlibeventcounter.lightxml
+++ b/tests/auto/testlib/selftests/expected_benchlibeventcounter.lightxml
@@ -5,7 +5,7 @@
</Environment>
<TestFunction name="initTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="events">
<Incident type="pass" file="" line="0">
@@ -36,10 +36,10 @@
<DataTag><![CDATA[100000]]></DataTag>
</Incident>
<BenchmarkResult metric="Events" tag="100000" value="100000" iterations="1" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="cleanupTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<Duration msecs="0"/>
diff --git a/tests/auto/testlib/selftests/expected_benchlibeventcounter.teamcity b/tests/auto/testlib/selftests/expected_benchlibeventcounter.teamcity
new file mode 100644
index 0000000000..6cb4c7214c
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_benchlibeventcounter.teamcity
@@ -0,0 +1,20 @@
+##teamcity[testSuiteStarted name='tst_BenchlibEventCounter' flowId='tst_BenchlibEventCounter']
+##teamcity[testStarted name='initTestCase()' flowId='tst_BenchlibEventCounter']
+##teamcity[testFinished name='initTestCase()' flowId='tst_BenchlibEventCounter']
+##teamcity[testStarted name='events(0)' flowId='tst_BenchlibEventCounter']
+##teamcity[testFinished name='events(0)' flowId='tst_BenchlibEventCounter']
+##teamcity[testStarted name='events(1)' flowId='tst_BenchlibEventCounter']
+##teamcity[testFinished name='events(1)' flowId='tst_BenchlibEventCounter']
+##teamcity[testStarted name='events(10)' flowId='tst_BenchlibEventCounter']
+##teamcity[testFinished name='events(10)' flowId='tst_BenchlibEventCounter']
+##teamcity[testStarted name='events(100)' flowId='tst_BenchlibEventCounter']
+##teamcity[testFinished name='events(100)' flowId='tst_BenchlibEventCounter']
+##teamcity[testStarted name='events(500)' flowId='tst_BenchlibEventCounter']
+##teamcity[testFinished name='events(500)' flowId='tst_BenchlibEventCounter']
+##teamcity[testStarted name='events(5000)' flowId='tst_BenchlibEventCounter']
+##teamcity[testFinished name='events(5000)' flowId='tst_BenchlibEventCounter']
+##teamcity[testStarted name='events(100000)' flowId='tst_BenchlibEventCounter']
+##teamcity[testFinished name='events(100000)' flowId='tst_BenchlibEventCounter']
+##teamcity[testStarted name='cleanupTestCase()' flowId='tst_BenchlibEventCounter']
+##teamcity[testFinished name='cleanupTestCase()' flowId='tst_BenchlibEventCounter']
+##teamcity[testSuiteFinished name='tst_BenchlibEventCounter' flowId='tst_BenchlibEventCounter']
diff --git a/tests/auto/testlib/selftests/expected_benchlibeventcounter.txt b/tests/auto/testlib/selftests/expected_benchlibeventcounter.txt
index 773bc4cc14..67c5ab495f 100644
--- a/tests/auto/testlib/selftests/expected_benchlibeventcounter.txt
+++ b/tests/auto/testlib/selftests/expected_benchlibeventcounter.txt
@@ -1,5 +1,5 @@
********* Start testing of tst_BenchlibEventCounter *********
-Config: Using QtTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@
+Config: Using QtTest library
PASS : tst_BenchlibEventCounter::initTestCase()
PASS : tst_BenchlibEventCounter::events(0)
RESULT : tst_BenchlibEventCounter::events():"0":
@@ -23,5 +23,5 @@ PASS : tst_BenchlibEventCounter::events(100000)
RESULT : tst_BenchlibEventCounter::events():"100000":
100,000 events per iteration (total: 100,000, iterations: 1)
PASS : tst_BenchlibEventCounter::cleanupTestCase()
-Totals: 9 passed, 0 failed, 0 skipped, 0 blacklisted
+Totals: 9 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms
********* Finished testing of tst_BenchlibEventCounter *********
diff --git a/tests/auto/testlib/selftests/expected_benchlibeventcounter.xml b/tests/auto/testlib/selftests/expected_benchlibeventcounter.xml
index f543e2775c..8a03b84461 100644
--- a/tests/auto/testlib/selftests/expected_benchlibeventcounter.xml
+++ b/tests/auto/testlib/selftests/expected_benchlibeventcounter.xml
@@ -7,7 +7,7 @@
</Environment>
<TestFunction name="initTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="events">
<Incident type="pass" file="" line="0">
@@ -38,11 +38,11 @@
<DataTag><![CDATA[100000]]></DataTag>
</Incident>
<BenchmarkResult metric="Events" tag="100000" value="100000" iterations="1" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="cleanupTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<Duration msecs="0"/>
</TestCase>
diff --git a/tests/auto/testlib/selftests/expected_benchliboptions.lightxml b/tests/auto/testlib/selftests/expected_benchliboptions.lightxml
new file mode 100644
index 0000000000..ed7c206a61
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_benchliboptions.lightxml
@@ -0,0 +1,57 @@
+<Environment>
+ <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>
+ <QtBuild/>
+ <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion>
+</Environment>
+<TestFunction name="initTestCase">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="threeEvents">
+<Incident type="pass" file="" line="0" />
+<BenchmarkResult metric="Events" tag="" value="3" iterations="1" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="cleanupTestCase">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<Duration msecs="0"/>
+<Environment>
+ <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>
+ <QtBuild/>
+ <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion>
+</Environment>
+<TestFunction name="initTestCase">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="threeEvents">
+<Incident type="pass" file="" line="0" />
+<BenchmarkResult metric="Events" tag="" value="3" iterations="15" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="cleanupTestCase">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<Duration msecs="0"/>
+<Environment>
+ <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>
+ <QtBuild/>
+ <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion>
+</Environment>
+<TestFunction name="initTestCase">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="threeEvents">
+<Incident type="pass" file="" line="0" />
+<BenchmarkResult metric="Events" tag="" value="3" iterations="64" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="cleanupTestCase">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<Duration msecs="0"/>
diff --git a/tests/auto/testlib/selftests/expected_benchliboptions.teamcity b/tests/auto/testlib/selftests/expected_benchliboptions.teamcity
new file mode 100644
index 0000000000..6dbaa64af7
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_benchliboptions.teamcity
@@ -0,0 +1,24 @@
+##teamcity[testSuiteStarted name='tst_BenchlibOptions' flowId='tst_BenchlibOptions']
+##teamcity[testStarted name='initTestCase()' flowId='tst_BenchlibOptions']
+##teamcity[testFinished name='initTestCase()' flowId='tst_BenchlibOptions']
+##teamcity[testStarted name='threeEvents()' flowId='tst_BenchlibOptions']
+##teamcity[testFinished name='threeEvents()' flowId='tst_BenchlibOptions']
+##teamcity[testStarted name='cleanupTestCase()' flowId='tst_BenchlibOptions']
+##teamcity[testFinished name='cleanupTestCase()' flowId='tst_BenchlibOptions']
+##teamcity[testSuiteFinished name='tst_BenchlibOptions' flowId='tst_BenchlibOptions']
+##teamcity[testSuiteStarted name='tst_BenchlibFifteenIterations' flowId='tst_BenchlibFifteenIterations']
+##teamcity[testStarted name='initTestCase()' flowId='tst_BenchlibFifteenIterations']
+##teamcity[testFinished name='initTestCase()' flowId='tst_BenchlibFifteenIterations']
+##teamcity[testStarted name='threeEvents()' flowId='tst_BenchlibFifteenIterations']
+##teamcity[testFinished name='threeEvents()' flowId='tst_BenchlibFifteenIterations']
+##teamcity[testStarted name='cleanupTestCase()' flowId='tst_BenchlibFifteenIterations']
+##teamcity[testFinished name='cleanupTestCase()' flowId='tst_BenchlibFifteenIterations']
+##teamcity[testSuiteFinished name='tst_BenchlibFifteenIterations' flowId='tst_BenchlibFifteenIterations']
+##teamcity[testSuiteStarted name='tst_BenchlibOneHundredMinimum' flowId='tst_BenchlibOneHundredMinimum']
+##teamcity[testStarted name='initTestCase()' flowId='tst_BenchlibOneHundredMinimum']
+##teamcity[testFinished name='initTestCase()' flowId='tst_BenchlibOneHundredMinimum']
+##teamcity[testStarted name='threeEvents()' flowId='tst_BenchlibOneHundredMinimum']
+##teamcity[testFinished name='threeEvents()' flowId='tst_BenchlibOneHundredMinimum']
+##teamcity[testStarted name='cleanupTestCase()' flowId='tst_BenchlibOneHundredMinimum']
+##teamcity[testFinished name='cleanupTestCase()' flowId='tst_BenchlibOneHundredMinimum']
+##teamcity[testSuiteFinished name='tst_BenchlibOneHundredMinimum' flowId='tst_BenchlibOneHundredMinimum']
diff --git a/tests/auto/testlib/selftests/expected_benchliboptions.txt b/tests/auto/testlib/selftests/expected_benchliboptions.txt
index 0b8ec87724..462b517933 100644
--- a/tests/auto/testlib/selftests/expected_benchliboptions.txt
+++ b/tests/auto/testlib/selftests/expected_benchliboptions.txt
@@ -1,27 +1,27 @@
********* Start testing of tst_BenchlibOptions *********
-Config: Using QtTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@
+Config: Using QtTest library
PASS : tst_BenchlibOptions::initTestCase()
PASS : tst_BenchlibOptions::threeEvents()
RESULT : tst_BenchlibOptions::threeEvents():
3 events per iteration (total: 3, iterations: 1)
PASS : tst_BenchlibOptions::cleanupTestCase()
-Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted
+Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms
********* Finished testing of tst_BenchlibOptions *********
********* Start testing of tst_BenchlibFifteenIterations *********
-Config: Using QtTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@
+Config: Using QtTest library
PASS : tst_BenchlibFifteenIterations::initTestCase()
PASS : tst_BenchlibFifteenIterations::threeEvents()
RESULT : tst_BenchlibFifteenIterations::threeEvents():
3.0 events per iteration (total: 45, iterations: 15)
PASS : tst_BenchlibFifteenIterations::cleanupTestCase()
-Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted
+Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms
********* Finished testing of tst_BenchlibFifteenIterations *********
********* Start testing of tst_BenchlibOneHundredMinimum *********
-Config: Using QtTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@
+Config: Using QtTest library
PASS : tst_BenchlibOneHundredMinimum::initTestCase()
PASS : tst_BenchlibOneHundredMinimum::threeEvents()
RESULT : tst_BenchlibOneHundredMinimum::threeEvents():
3.00 events per iteration (total: 192, iterations: 64)
PASS : tst_BenchlibOneHundredMinimum::cleanupTestCase()
-Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted
+Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms
********* Finished testing of tst_BenchlibOneHundredMinimum *********
diff --git a/tests/auto/testlib/selftests/expected_benchliboptions.xml b/tests/auto/testlib/selftests/expected_benchliboptions.xml
new file mode 100644
index 0000000000..45ae180889
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_benchliboptions.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<TestCase name="tst_BenchlibOptions">
+<Environment>
+ <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>
+ <QtBuild/>
+ <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion>
+</Environment>
+<TestFunction name="initTestCase">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="threeEvents">
+<Incident type="pass" file="" line="0" />
+<BenchmarkResult metric="Events" tag="" value="3" iterations="1" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="cleanupTestCase">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<Duration msecs="0"/>
+</TestCase>
+<?xml version="1.0" encoding="UTF-8"?>
+<TestCase name="tst_BenchlibFifteenIterations">
+<Environment>
+ <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>
+ <QtBuild/>
+ <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion>
+</Environment>
+<TestFunction name="initTestCase">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="threeEvents">
+<Incident type="pass" file="" line="0" />
+<BenchmarkResult metric="Events" tag="" value="3" iterations="15" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="cleanupTestCase">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<Duration msecs="0"/>
+</TestCase>
+<?xml version="1.0" encoding="UTF-8"?>
+<TestCase name="tst_BenchlibOneHundredMinimum">
+<Environment>
+ <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>
+ <QtBuild/>
+ <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion>
+</Environment>
+<TestFunction name="initTestCase">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="threeEvents">
+<Incident type="pass" file="" line="0" />
+<BenchmarkResult metric="Events" tag="" value="3" iterations="64" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="cleanupTestCase">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<Duration msecs="0"/>
+</TestCase>
diff --git a/tests/auto/testlib/selftests/expected_benchliboptions.xunitxml b/tests/auto/testlib/selftests/expected_benchliboptions.xunitxml
new file mode 100644
index 0000000000..370d1c7c5c
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_benchliboptions.xunitxml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<testsuite errors="0" failures="0" tests="3" name="tst_BenchlibOptions">
+ <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"/>
+ <testcase result="pass" name="threeEvents">
+ </testcase>
+ <testcase result="pass" name="cleanupTestCase"/>
+ <system-err/>
+</testsuite>
+<?xml version="1.0" encoding="UTF-8" ?>
+<testsuite errors="0" failures="0" tests="3" name="tst_BenchlibFifteenIterations">
+ <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"/>
+ <testcase result="pass" name="threeEvents">
+ </testcase>
+ <testcase result="pass" name="cleanupTestCase"/>
+ <system-err/>
+</testsuite>
+<?xml version="1.0" encoding="UTF-8" ?>
+<testsuite errors="0" failures="0" tests="3" name="tst_BenchlibOneHundredMinimum">
+ <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"/>
+ <testcase result="pass" name="threeEvents">
+ </testcase>
+ <testcase result="pass" name="cleanupTestCase"/>
+ <system-err/>
+</testsuite>
diff --git a/tests/auto/testlib/selftests/expected_benchlibtickcounter.lightxml b/tests/auto/testlib/selftests/expected_benchlibtickcounter.lightxml
index 11296ad9c2..57076755df 100644
--- a/tests/auto/testlib/selftests/expected_benchlibtickcounter.lightxml
+++ b/tests/auto/testlib/selftests/expected_benchlibtickcounter.lightxml
@@ -5,15 +5,15 @@
</Environment>
<TestFunction name="initTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="threeBillionTicks">
<Incident type="pass" file="" line="0" />
-<BenchmarkResult metric="CPUTicks" tag="" value="3.00001e+09" iterations="1" />
-<Duration msecs="0"/>
+<BenchmarkResult metric="CPUTicks" tag="" value="0" iterations="1" />
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="cleanupTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<Duration msecs="0"/>
diff --git a/tests/auto/testlib/selftests/expected_benchlibtickcounter.teamcity b/tests/auto/testlib/selftests/expected_benchlibtickcounter.teamcity
new file mode 100644
index 0000000000..842d36b79c
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_benchlibtickcounter.teamcity
@@ -0,0 +1,8 @@
+##teamcity[testSuiteStarted name='tst_BenchlibTickCounter' flowId='tst_BenchlibTickCounter']
+##teamcity[testStarted name='initTestCase()' flowId='tst_BenchlibTickCounter']
+##teamcity[testFinished name='initTestCase()' flowId='tst_BenchlibTickCounter']
+##teamcity[testStarted name='threeBillionTicks()' flowId='tst_BenchlibTickCounter']
+##teamcity[testFinished name='threeBillionTicks()' flowId='tst_BenchlibTickCounter']
+##teamcity[testStarted name='cleanupTestCase()' flowId='tst_BenchlibTickCounter']
+##teamcity[testFinished name='cleanupTestCase()' flowId='tst_BenchlibTickCounter']
+##teamcity[testSuiteFinished name='tst_BenchlibTickCounter' flowId='tst_BenchlibTickCounter']
diff --git a/tests/auto/testlib/selftests/expected_benchlibtickcounter.txt b/tests/auto/testlib/selftests/expected_benchlibtickcounter.txt
index 5fd6bfb4fd..5a292bad18 100644
--- a/tests/auto/testlib/selftests/expected_benchlibtickcounter.txt
+++ b/tests/auto/testlib/selftests/expected_benchlibtickcounter.txt
@@ -1,9 +1,9 @@
********* Start testing of tst_BenchlibTickCounter *********
-Config: Using QtTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@
+Config: Using QtTest library
PASS : tst_BenchlibTickCounter::initTestCase()
PASS : tst_BenchlibTickCounter::threeBillionTicks()
RESULT : tst_BenchlibTickCounter::threeBillionTicks():
- 3,000,005,772 CPU ticks per iteration (total: 3,000,005,772, iterations: 1)
+ 0 CPU ticks per iteration (total: 0, iterations: 1)
PASS : tst_BenchlibTickCounter::cleanupTestCase()
-Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted
+Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms
********* Finished testing of tst_BenchlibTickCounter *********
diff --git a/tests/auto/testlib/selftests/expected_benchlibtickcounter.xml b/tests/auto/testlib/selftests/expected_benchlibtickcounter.xml
index 3dd56b4af7..224d287e92 100644
--- a/tests/auto/testlib/selftests/expected_benchlibtickcounter.xml
+++ b/tests/auto/testlib/selftests/expected_benchlibtickcounter.xml
@@ -7,16 +7,16 @@
</Environment>
<TestFunction name="initTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="threeBillionTicks">
<Incident type="pass" file="" line="0" />
-<BenchmarkResult metric="CPUTicks" tag="" value="3.00002e+09" iterations="1" />
-<Duration msecs="0"/>
+<BenchmarkResult metric="CPUTicks" tag="" value="0" iterations="1" />
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="cleanupTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<Duration msecs="0"/>
</TestCase>
diff --git a/tests/auto/testlib/selftests/expected_benchlibwalltime.lightxml b/tests/auto/testlib/selftests/expected_benchlibwalltime.lightxml
index c75a6c944d..f0db92ebe0 100644
--- a/tests/auto/testlib/selftests/expected_benchlibwalltime.lightxml
+++ b/tests/auto/testlib/selftests/expected_benchlibwalltime.lightxml
@@ -5,25 +5,25 @@
</Environment>
<TestFunction name="initTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="waitForOneThousand">
<Incident type="pass" file="" line="0" />
-<BenchmarkResult metric="WalltimeMilliseconds" tag="" value="1004" iterations="1" />
-<Duration msecs="0"/>
+<BenchmarkResult metric="WalltimeMilliseconds" tag="" value="0" iterations="1" />
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="waitForFourThousand">
<Incident type="pass" file="" line="0" />
-<BenchmarkResult metric="WalltimeMilliseconds" tag="" value="4004" iterations="1" />
-<Duration msecs="0"/>
+<BenchmarkResult metric="WalltimeMilliseconds" tag="" value="0" iterations="1" />
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="qbenchmark_once">
<Incident type="pass" file="" line="0" />
<BenchmarkResult metric="WalltimeMilliseconds" tag="" value="0" iterations="1" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="cleanupTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<Duration msecs="0"/>
diff --git a/tests/auto/testlib/selftests/expected_benchlibwalltime.teamcity b/tests/auto/testlib/selftests/expected_benchlibwalltime.teamcity
new file mode 100644
index 0000000000..4c5d9667e7
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_benchlibwalltime.teamcity
@@ -0,0 +1,12 @@
+##teamcity[testSuiteStarted name='tst_BenchlibWalltime' flowId='tst_BenchlibWalltime']
+##teamcity[testStarted name='initTestCase()' flowId='tst_BenchlibWalltime']
+##teamcity[testFinished name='initTestCase()' flowId='tst_BenchlibWalltime']
+##teamcity[testStarted name='waitForOneThousand()' flowId='tst_BenchlibWalltime']
+##teamcity[testFinished name='waitForOneThousand()' flowId='tst_BenchlibWalltime']
+##teamcity[testStarted name='waitForFourThousand()' flowId='tst_BenchlibWalltime']
+##teamcity[testFinished name='waitForFourThousand()' flowId='tst_BenchlibWalltime']
+##teamcity[testStarted name='qbenchmark_once()' flowId='tst_BenchlibWalltime']
+##teamcity[testFinished name='qbenchmark_once()' flowId='tst_BenchlibWalltime']
+##teamcity[testStarted name='cleanupTestCase()' flowId='tst_BenchlibWalltime']
+##teamcity[testFinished name='cleanupTestCase()' flowId='tst_BenchlibWalltime']
+##teamcity[testSuiteFinished name='tst_BenchlibWalltime' flowId='tst_BenchlibWalltime']
diff --git a/tests/auto/testlib/selftests/expected_benchlibwalltime.txt b/tests/auto/testlib/selftests/expected_benchlibwalltime.txt
index fd53b0a40e..ad86a994db 100644
--- a/tests/auto/testlib/selftests/expected_benchlibwalltime.txt
+++ b/tests/auto/testlib/selftests/expected_benchlibwalltime.txt
@@ -1,15 +1,15 @@
********* Start testing of tst_BenchlibWalltime *********
-Config: Using QtTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@
+Config: Using QtTest library
PASS : tst_BenchlibWalltime::initTestCase()
PASS : tst_BenchlibWalltime::waitForOneThousand()
RESULT : tst_BenchlibWalltime::waitForOneThousand():
- 1,006 msecs per iteration (total: 1,006, iterations: 1)
+ 0 msecs per iteration (total: 0, iterations: 1)
PASS : tst_BenchlibWalltime::waitForFourThousand()
RESULT : tst_BenchlibWalltime::waitForFourThousand():
- 4,008 msecs per iteration (total: 4,008, iterations: 1)
+ 0 msecs per iteration (total: 0, iterations: 1)
PASS : tst_BenchlibWalltime::qbenchmark_once()
RESULT : tst_BenchlibWalltime::qbenchmark_once():
0 msecs per iteration (total: 0, iterations: 1)
PASS : tst_BenchlibWalltime::cleanupTestCase()
-Totals: 5 passed, 0 failed, 0 skipped, 0 blacklisted
+Totals: 5 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms
********* Finished testing of tst_BenchlibWalltime *********
diff --git a/tests/auto/testlib/selftests/expected_benchlibwalltime.xml b/tests/auto/testlib/selftests/expected_benchlibwalltime.xml
index a2f0edecc6..bb71d00218 100644
--- a/tests/auto/testlib/selftests/expected_benchlibwalltime.xml
+++ b/tests/auto/testlib/selftests/expected_benchlibwalltime.xml
@@ -7,26 +7,26 @@
</Environment>
<TestFunction name="initTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="waitForOneThousand">
<Incident type="pass" file="" line="0" />
-<BenchmarkResult metric="WalltimeMilliseconds" tag="" value="1008" iterations="1" />
-<Duration msecs="0"/>
+<BenchmarkResult metric="WalltimeMilliseconds" tag="" value="0" iterations="1" />
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="waitForFourThousand">
<Incident type="pass" file="" line="0" />
-<BenchmarkResult metric="WalltimeMilliseconds" tag="" value="4002" iterations="1" />
-<Duration msecs="0"/>
+<BenchmarkResult metric="WalltimeMilliseconds" tag="" value="0" iterations="1" />
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="qbenchmark_once">
<Incident type="pass" file="" line="0" />
<BenchmarkResult metric="WalltimeMilliseconds" tag="" value="0" iterations="1" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="cleanupTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<Duration msecs="0"/>
</TestCase>
diff --git a/tests/auto/testlib/selftests/expected_blacklisted.lightxml b/tests/auto/testlib/selftests/expected_blacklisted.lightxml
new file mode 100644
index 0000000000..4193628e7c
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_blacklisted.lightxml
@@ -0,0 +1,66 @@
+<Environment>
+ <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>
+ <QtBuild/>
+ <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion>
+</Environment>
+<TestFunction name="initTestCase">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="pass">
+<Incident type="bpass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="skip">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
+ <Description><![CDATA[This test should SKIP]]></Description>
+</Message>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="fail">
+<Incident type="bfail" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
+ <Description><![CDATA['false' returned FALSE. (This test should BFAIL)]]></Description>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="xfail">
+<Incident type="xfail" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
+ <Description><![CDATA[This test should XFAIL then BFAIL]]></Description>
+</Incident>
+<Incident type="bpass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="xpass">
+<Incident type="xpass" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
+ <Description><![CDATA['true' returned TRUE unexpectedly. (This test should XPASS, blacklist ignored for XPASS)]]></Description>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="messages">
+<Message type="qwarn" file="" line="0">
+ <Description><![CDATA[This is a warning that should not appear in silent test output]]></Description>
+</Message>
+<Message type="warn" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
+ <Description><![CDATA[This is an internal testlib warning that should not appear in silent test output]]></Description>
+</Message>
+<Message type="qdebug" file="" line="0">
+ <Description><![CDATA[This is a debug message that should not appear in silent test output]]></Description>
+</Message>
+<Message type="system" file="" line="0">
+ <Description><![CDATA[This is a critical message that should not appear in silent test output]]></Description>
+</Message>
+<Message type="qinfo" file="" line="0">
+ <Description><![CDATA[This is an info message that should not appear in silent test output]]></Description>
+</Message>
+<Message type="info" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
+ <Description><![CDATA[This is an internal testlib info message that should not appear in silent test output]]></Description>
+</Message>
+<Message type="qfatal" file="" line="0">
+ <Description><![CDATA[This is a fatal error message that should still appear in silent test output]]></Description>
+</Message>
+<Incident type="bfail" file="Unknown file" line="0">
+ <Description><![CDATA[Received a fatal error.]]></Description>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<Duration msecs="0"/>
diff --git a/tests/auto/testlib/selftests/expected_blacklisted.teamcity b/tests/auto/testlib/selftests/expected_blacklisted.teamcity
new file mode 100644
index 0000000000..8180a7ce76
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_blacklisted.teamcity
@@ -0,0 +1,18 @@
+##teamcity[testSuiteStarted name='tst_Blacklisted' flowId='tst_Blacklisted']
+##teamcity[testStarted name='initTestCase()' flowId='tst_Blacklisted']
+##teamcity[testFinished name='initTestCase()' flowId='tst_Blacklisted']
+##teamcity[testStarted name='pass()' flowId='tst_Blacklisted']
+##teamcity[testFinished name='pass()' flowId='tst_Blacklisted']
+##teamcity[testIgnored name='skip()' message='This test should SKIP |[Loc: qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)|]' flowId='tst_Blacklisted']
+##teamcity[testStarted name='fail()' flowId='tst_Blacklisted']
+##teamcity[testFinished name='fail()' flowId='tst_Blacklisted']
+##teamcity[testStarted name='xfail()' flowId='tst_Blacklisted']
+##teamcity[testStdOut name='xfail()' out='XFAIL |[Loc: qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)|]: This test should XFAIL then BFAIL' flowId='tst_Blacklisted']
+##teamcity[testFinished name='xfail()' flowId='tst_Blacklisted']
+##teamcity[testStarted name='xpass()' flowId='tst_Blacklisted']
+##teamcity[testFailed name='xpass()' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)|]' details='|'true|' returned TRUE unexpectedly. (This test should XPASS, blacklist ignored for XPASS)' flowId='tst_Blacklisted']
+##teamcity[testFinished name='xpass()' flowId='tst_Blacklisted']
+##teamcity[testStarted name='messages()' flowId='tst_Blacklisted']
+##teamcity[testStdOut name='messages()' out='QWARN: This is a warning that should not appear in silent test output|nWARNING |[Loc: qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)|]: This is an internal testlib warning that should not appear in silent test output|nQDEBUG: This is a debug message that should not appear in silent test output|nQSYSTEM: This is a critical message that should not appear in silent test output|nQINFO: This is an info message that should not appear in silent test output|nINFO |[Loc: qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)|]: This is an internal testlib info message that should not appear in silent test output|nQFATAL: This is a fatal error message that should still appear in silent test output' flowId='tst_Blacklisted']
+##teamcity[testFinished name='messages()' flowId='tst_Blacklisted']
+##teamcity[testSuiteFinished name='tst_Blacklisted' flowId='tst_Blacklisted']
diff --git a/tests/auto/testlib/selftests/expected_blacklisted.txt b/tests/auto/testlib/selftests/expected_blacklisted.txt
index 3afd93b0cc..6fa2403b59 100644
--- a/tests/auto/testlib/selftests/expected_blacklisted.txt
+++ b/tests/auto/testlib/selftests/expected_blacklisted.txt
@@ -1,26 +1,26 @@
********* Start testing of tst_Blacklisted *********
-Config: Using QtTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@
+Config: Using QtTest library
PASS : tst_Blacklisted::initTestCase()
BPASS : tst_Blacklisted::pass()
SKIP : tst_Blacklisted::skip() This test should SKIP
- Loc: [tst_blacklisted.cpp(62)]
+ Loc: [qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)]
BFAIL : tst_Blacklisted::fail() 'false' returned FALSE. (This test should BFAIL)
- Loc: [tst_blacklisted.cpp(67)]
+ Loc: [qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)]
XFAIL : tst_Blacklisted::xfail() This test should XFAIL then BFAIL
- Loc: [tst_blacklisted.cpp(73)]
+ Loc: [qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)]
BPASS : tst_Blacklisted::xfail()
XPASS : tst_Blacklisted::xpass() 'true' returned TRUE unexpectedly. (This test should XPASS, blacklist ignored for XPASS)
- Loc: [tst_blacklisted.cpp(79)]
+ Loc: [qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)]
QWARN : tst_Blacklisted::messages() This is a warning that should not appear in silent test output
WARNING: tst_Blacklisted::messages() This is an internal testlib warning that should not appear in silent test output
- Loc: [tst_blacklisted.cpp(85)]
+ Loc: [qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)]
QDEBUG : tst_Blacklisted::messages() This is a debug message that should not appear in silent test output
QSYSTEM: tst_Blacklisted::messages() This is a critical message that should not appear in silent test output
QINFO : tst_Blacklisted::messages() This is an info message that should not appear in silent test output
INFO : tst_Blacklisted::messages() This is an internal testlib info message that should not appear in silent test output
- Loc: [tst_blacklisted.cpp(89)]
+ Loc: [qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp(0)]
QFATAL : tst_Blacklisted::messages() This is a fatal error message that should still appear in silent test output
BFAIL : tst_Blacklisted::messages() Received a fatal error.
Loc: [Unknown file(0)]
-Totals: 1 passed, 1 failed, 1 skipped, 4 blacklisted
+Totals: 1 passed, 1 failed, 1 skipped, 4 blacklisted, 0ms
********* Finished testing of tst_Blacklisted *********
diff --git a/tests/auto/testlib/selftests/expected_blacklisted.xml b/tests/auto/testlib/selftests/expected_blacklisted.xml
new file mode 100644
index 0000000000..443bc6b199
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_blacklisted.xml
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<TestCase name="tst_Blacklisted">
+<Environment>
+ <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>
+ <QtBuild/>
+ <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion>
+</Environment>
+<TestFunction name="initTestCase">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="pass">
+<Incident type="bpass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="skip">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
+ <Description><![CDATA[This test should SKIP]]></Description>
+</Message>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="fail">
+<Incident type="bfail" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
+ <Description><![CDATA['false' returned FALSE. (This test should BFAIL)]]></Description>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="xfail">
+<Incident type="xfail" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
+ <Description><![CDATA[This test should XFAIL then BFAIL]]></Description>
+</Incident>
+<Incident type="bpass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="xpass">
+<Incident type="xpass" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
+ <Description><![CDATA['true' returned TRUE unexpectedly. (This test should XPASS, blacklist ignored for XPASS)]]></Description>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="messages">
+<Message type="qwarn" file="" line="0">
+ <Description><![CDATA[This is a warning that should not appear in silent test output]]></Description>
+</Message>
+<Message type="warn" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
+ <Description><![CDATA[This is an internal testlib warning that should not appear in silent test output]]></Description>
+</Message>
+<Message type="qdebug" file="" line="0">
+ <Description><![CDATA[This is a debug message that should not appear in silent test output]]></Description>
+</Message>
+<Message type="system" file="" line="0">
+ <Description><![CDATA[This is a critical message that should not appear in silent test output]]></Description>
+</Message>
+<Message type="qinfo" file="" line="0">
+ <Description><![CDATA[This is an info message that should not appear in silent test output]]></Description>
+</Message>
+<Message type="info" file="qtbase/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp" line="0">
+ <Description><![CDATA[This is an internal testlib info message that should not appear in silent test output]]></Description>
+</Message>
+<Message type="qfatal" file="" line="0">
+ <Description><![CDATA[This is a fatal error message that should still appear in silent test output]]></Description>
+</Message>
+<Incident type="bfail" file="Unknown file" line="0">
+ <Description><![CDATA[Received a fatal error.]]></Description>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<Duration msecs="0"/>
+</TestCase>
diff --git a/tests/auto/testlib/selftests/expected_blacklisted.xunitxml b/tests/auto/testlib/selftests/expected_blacklisted.xunitxml
new file mode 100644
index 0000000000..2752bc18b4
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_blacklisted.xunitxml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<testsuite errors="9" failures="3" tests="7" name="tst_Blacklisted">
+ <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"/>
+ <testcase result="bpass" name="pass"/>
+ <testcase name="skip">
+ <!-- message="This test should SKIP" type="skip" -->
+ </testcase>
+ <testcase result="bfail" name="fail"/>
+ <testcase result="xfail" name="xfail">
+ <!-- message="This test should XFAIL then BFAIL" type="info" -->
+ </testcase>
+ <testcase result="xpass" name="xpass">
+ <failure message="&apos;true&apos; returned TRUE unexpectedly. (This test should XPASS, blacklist ignored for XPASS)" result="xpass"/>
+ </testcase>
+ <testcase result="bfail" name="messages">
+ <!-- message="This is a warning that should not appear in silent test output" type="qwarn" -->
+ <!-- message="This is an internal testlib warning that should not appear in silent test output" type="warn" -->
+ <!-- message="This is a debug message that should not appear in silent test output" type="qdebug" -->
+ <!-- message="This is a critical message that should not appear in silent test output" type="system" -->
+ <!-- message="This is an info message that should not appear in silent test output" type="qinfo" -->
+ <!-- message="This is an internal testlib info message that should not appear in silent test output" type="info" -->
+ <!-- message="This is a fatal error message that should still appear in silent test output" type="qfatal" -->
+ </testcase>
+ <system-err>
+<![CDATA[This test should SKIP]]>
+<![CDATA[This test should XFAIL then BFAIL]]>
+<![CDATA[This is a warning that should not appear in silent test output]]>
+<![CDATA[This is an internal testlib warning that should not appear in silent test output]]>
+<![CDATA[This is a debug message that should not appear in silent test output]]>
+<![CDATA[This is a critical message that should not appear in silent test output]]>
+<![CDATA[This is an info message that should not appear in silent test output]]>
+<![CDATA[This is an internal testlib info message that should not appear in silent test output]]>
+<![CDATA[This is a fatal error message that should still appear in silent test output]]>
+ </system-err>
+</testsuite>
diff --git a/tests/auto/testlib/selftests/expected_commandlinedata.lightxml b/tests/auto/testlib/selftests/expected_commandlinedata.lightxml
index 894ae7ae23..89016c21aa 100644
--- a/tests/auto/testlib/selftests/expected_commandlinedata.lightxml
+++ b/tests/auto/testlib/selftests/expected_commandlinedata.lightxml
@@ -5,58 +5,58 @@
</Environment>
<TestFunction name="initTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="fiveTablePasses">
-<Message type="info" file="tst_commandlinedata.cpp" line="65">
+<Message type="info" file="qtbase/tests/auto/testlib/selftests/commandlinedata/tst_commandlinedata.cpp" line="0">
<DataTag><![CDATA[fiveTablePasses_data1]]></DataTag>
<Description><![CDATA[QVERIFY(test)]]></Description>
</Message>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[fiveTablePasses_data1]]></DataTag>
</Incident>
-<Message type="info" file="tst_commandlinedata.cpp" line="65">
+<Message type="info" file="qtbase/tests/auto/testlib/selftests/commandlinedata/tst_commandlinedata.cpp" line="0">
<DataTag><![CDATA[fiveTablePasses_data2]]></DataTag>
<Description><![CDATA[QVERIFY(test)]]></Description>
</Message>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[fiveTablePasses_data2]]></DataTag>
</Incident>
-<Message type="info" file="tst_commandlinedata.cpp" line="65">
+<Message type="info" file="qtbase/tests/auto/testlib/selftests/commandlinedata/tst_commandlinedata.cpp" line="0">
<DataTag><![CDATA[fiveTablePasses_data3]]></DataTag>
<Description><![CDATA[QVERIFY(test)]]></Description>
</Message>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[fiveTablePasses_data3]]></DataTag>
</Incident>
-<Message type="info" file="tst_commandlinedata.cpp" line="65">
+<Message type="info" file="qtbase/tests/auto/testlib/selftests/commandlinedata/tst_commandlinedata.cpp" line="0">
<DataTag><![CDATA[fiveTablePasses_data4]]></DataTag>
<Description><![CDATA[QVERIFY(test)]]></Description>
</Message>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[fiveTablePasses_data4]]></DataTag>
</Incident>
-<Message type="info" file="tst_commandlinedata.cpp" line="65">
+<Message type="info" file="qtbase/tests/auto/testlib/selftests/commandlinedata/tst_commandlinedata.cpp" line="0">
<DataTag><![CDATA[fiveTablePasses_data5]]></DataTag>
<Description><![CDATA[QVERIFY(test)]]></Description>
</Message>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[fiveTablePasses_data5]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="fiveTablePasses">
-<Message type="info" file="tst_commandlinedata.cpp" line="65">
+<Message type="info" file="qtbase/tests/auto/testlib/selftests/commandlinedata/tst_commandlinedata.cpp" line="0">
<DataTag><![CDATA[fiveTablePasses_data1]]></DataTag>
<Description><![CDATA[QVERIFY(test)]]></Description>
</Message>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[fiveTablePasses_data1]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="cleanupTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<Duration msecs="0"/>
diff --git a/tests/auto/testlib/selftests/expected_commandlinedata.teamcity b/tests/auto/testlib/selftests/expected_commandlinedata.teamcity
index 13c0b44320..a8ec263c18 100644
--- a/tests/auto/testlib/selftests/expected_commandlinedata.teamcity
+++ b/tests/auto/testlib/selftests/expected_commandlinedata.teamcity
@@ -2,22 +2,22 @@
##teamcity[testStarted name='initTestCase()' flowId='tst_DataTable']
##teamcity[testFinished name='initTestCase()' flowId='tst_DataTable']
##teamcity[testStarted name='fiveTablePasses(fiveTablePasses_data1)' flowId='tst_DataTable']
-##teamcity[testStdOut name='fiveTablePasses(fiveTablePasses_data1)' out='INFO |[Loc: tst_commandlinedata.cpp(57)|]: QVERIFY(test)' flowId='tst_DataTable']
+##teamcity[testStdOut name='fiveTablePasses(fiveTablePasses_data1)' out='INFO |[Loc: qtbase/tests/auto/testlib/selftests/commandlinedata/tst_commandlinedata.cpp(0)|]: QVERIFY(test)' flowId='tst_DataTable']
##teamcity[testFinished name='fiveTablePasses(fiveTablePasses_data1)' flowId='tst_DataTable']
##teamcity[testStarted name='fiveTablePasses(fiveTablePasses_data2)' flowId='tst_DataTable']
-##teamcity[testStdOut name='fiveTablePasses(fiveTablePasses_data2)' out='INFO |[Loc: tst_commandlinedata.cpp(57)|]: QVERIFY(test)' flowId='tst_DataTable']
+##teamcity[testStdOut name='fiveTablePasses(fiveTablePasses_data2)' out='INFO |[Loc: qtbase/tests/auto/testlib/selftests/commandlinedata/tst_commandlinedata.cpp(0)|]: QVERIFY(test)' flowId='tst_DataTable']
##teamcity[testFinished name='fiveTablePasses(fiveTablePasses_data2)' flowId='tst_DataTable']
##teamcity[testStarted name='fiveTablePasses(fiveTablePasses_data3)' flowId='tst_DataTable']
-##teamcity[testStdOut name='fiveTablePasses(fiveTablePasses_data3)' out='INFO |[Loc: tst_commandlinedata.cpp(57)|]: QVERIFY(test)' flowId='tst_DataTable']
+##teamcity[testStdOut name='fiveTablePasses(fiveTablePasses_data3)' out='INFO |[Loc: qtbase/tests/auto/testlib/selftests/commandlinedata/tst_commandlinedata.cpp(0)|]: QVERIFY(test)' flowId='tst_DataTable']
##teamcity[testFinished name='fiveTablePasses(fiveTablePasses_data3)' flowId='tst_DataTable']
##teamcity[testStarted name='fiveTablePasses(fiveTablePasses_data4)' flowId='tst_DataTable']
-##teamcity[testStdOut name='fiveTablePasses(fiveTablePasses_data4)' out='INFO |[Loc: tst_commandlinedata.cpp(57)|]: QVERIFY(test)' flowId='tst_DataTable']
+##teamcity[testStdOut name='fiveTablePasses(fiveTablePasses_data4)' out='INFO |[Loc: qtbase/tests/auto/testlib/selftests/commandlinedata/tst_commandlinedata.cpp(0)|]: QVERIFY(test)' flowId='tst_DataTable']
##teamcity[testFinished name='fiveTablePasses(fiveTablePasses_data4)' flowId='tst_DataTable']
##teamcity[testStarted name='fiveTablePasses(fiveTablePasses_data5)' flowId='tst_DataTable']
-##teamcity[testStdOut name='fiveTablePasses(fiveTablePasses_data5)' out='INFO |[Loc: tst_commandlinedata.cpp(57)|]: QVERIFY(test)' flowId='tst_DataTable']
+##teamcity[testStdOut name='fiveTablePasses(fiveTablePasses_data5)' out='INFO |[Loc: qtbase/tests/auto/testlib/selftests/commandlinedata/tst_commandlinedata.cpp(0)|]: QVERIFY(test)' flowId='tst_DataTable']
##teamcity[testFinished name='fiveTablePasses(fiveTablePasses_data5)' flowId='tst_DataTable']
##teamcity[testStarted name='fiveTablePasses(fiveTablePasses_data1)' flowId='tst_DataTable']
-##teamcity[testStdOut name='fiveTablePasses(fiveTablePasses_data1)' out='INFO |[Loc: tst_commandlinedata.cpp(57)|]: QVERIFY(test)' flowId='tst_DataTable']
+##teamcity[testStdOut name='fiveTablePasses(fiveTablePasses_data1)' out='INFO |[Loc: qtbase/tests/auto/testlib/selftests/commandlinedata/tst_commandlinedata.cpp(0)|]: QVERIFY(test)' flowId='tst_DataTable']
##teamcity[testFinished name='fiveTablePasses(fiveTablePasses_data1)' flowId='tst_DataTable']
##teamcity[testStarted name='cleanupTestCase()' flowId='tst_DataTable']
##teamcity[testFinished name='cleanupTestCase()' flowId='tst_DataTable']
diff --git a/tests/auto/testlib/selftests/expected_commandlinedata.txt b/tests/auto/testlib/selftests/expected_commandlinedata.txt
index 94861416d7..bc86235918 100644
--- a/tests/auto/testlib/selftests/expected_commandlinedata.txt
+++ b/tests/auto/testlib/selftests/expected_commandlinedata.txt
@@ -1,28 +1,28 @@
********* Start testing of tst_DataTable *********
-Config: Using QtTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@
+Config: Using QtTest library
INFO : tst_DataTable::initTestCase() entering
PASS : tst_DataTable::initTestCase()
INFO : tst_DataTable::fiveTablePasses() entering
INFO : tst_DataTable::fiveTablePasses(fiveTablePasses_data1) QVERIFY(test)
- Loc: [tst_commandlinedata.cpp(65)]
+ Loc: [qtbase/tests/auto/testlib/selftests/commandlinedata/tst_commandlinedata.cpp(0)]
PASS : tst_DataTable::fiveTablePasses(fiveTablePasses_data1)
INFO : tst_DataTable::fiveTablePasses(fiveTablePasses_data2) QVERIFY(test)
- Loc: [tst_commandlinedata.cpp(65)]
+ Loc: [qtbase/tests/auto/testlib/selftests/commandlinedata/tst_commandlinedata.cpp(0)]
PASS : tst_DataTable::fiveTablePasses(fiveTablePasses_data2)
INFO : tst_DataTable::fiveTablePasses(fiveTablePasses_data3) QVERIFY(test)
- Loc: [tst_commandlinedata.cpp(65)]
+ Loc: [qtbase/tests/auto/testlib/selftests/commandlinedata/tst_commandlinedata.cpp(0)]
PASS : tst_DataTable::fiveTablePasses(fiveTablePasses_data3)
INFO : tst_DataTable::fiveTablePasses(fiveTablePasses_data4) QVERIFY(test)
- Loc: [tst_commandlinedata.cpp(65)]
+ Loc: [qtbase/tests/auto/testlib/selftests/commandlinedata/tst_commandlinedata.cpp(0)]
PASS : tst_DataTable::fiveTablePasses(fiveTablePasses_data4)
INFO : tst_DataTable::fiveTablePasses(fiveTablePasses_data5) QVERIFY(test)
- Loc: [tst_commandlinedata.cpp(65)]
+ Loc: [qtbase/tests/auto/testlib/selftests/commandlinedata/tst_commandlinedata.cpp(0)]
PASS : tst_DataTable::fiveTablePasses(fiveTablePasses_data5)
INFO : tst_DataTable::fiveTablePasses() entering
INFO : tst_DataTable::fiveTablePasses(fiveTablePasses_data1) QVERIFY(test)
- Loc: [tst_commandlinedata.cpp(65)]
+ Loc: [qtbase/tests/auto/testlib/selftests/commandlinedata/tst_commandlinedata.cpp(0)]
PASS : tst_DataTable::fiveTablePasses(fiveTablePasses_data1)
INFO : tst_DataTable::cleanupTestCase() entering
PASS : tst_DataTable::cleanupTestCase()
-Totals: 8 passed, 0 failed, 0 skipped, 0 blacklisted
+Totals: 8 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms
********* Finished testing of tst_DataTable *********
diff --git a/tests/auto/testlib/selftests/expected_commandlinedata.xml b/tests/auto/testlib/selftests/expected_commandlinedata.xml
index b2aa98f6a7..9597a3e8a0 100644
--- a/tests/auto/testlib/selftests/expected_commandlinedata.xml
+++ b/tests/auto/testlib/selftests/expected_commandlinedata.xml
@@ -7,59 +7,59 @@
</Environment>
<TestFunction name="initTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="fiveTablePasses">
-<Message type="info" file="tst_commandlinedata.cpp" line="65">
+<Message type="info" file="qtbase/tests/auto/testlib/selftests/commandlinedata/tst_commandlinedata.cpp" line="0">
<DataTag><![CDATA[fiveTablePasses_data1]]></DataTag>
<Description><![CDATA[QVERIFY(test)]]></Description>
</Message>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[fiveTablePasses_data1]]></DataTag>
</Incident>
-<Message type="info" file="tst_commandlinedata.cpp" line="65">
+<Message type="info" file="qtbase/tests/auto/testlib/selftests/commandlinedata/tst_commandlinedata.cpp" line="0">
<DataTag><![CDATA[fiveTablePasses_data2]]></DataTag>
<Description><![CDATA[QVERIFY(test)]]></Description>
</Message>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[fiveTablePasses_data2]]></DataTag>
</Incident>
-<Message type="info" file="tst_commandlinedata.cpp" line="65">
+<Message type="info" file="qtbase/tests/auto/testlib/selftests/commandlinedata/tst_commandlinedata.cpp" line="0">
<DataTag><![CDATA[fiveTablePasses_data3]]></DataTag>
<Description><![CDATA[QVERIFY(test)]]></Description>
</Message>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[fiveTablePasses_data3]]></DataTag>
</Incident>
-<Message type="info" file="tst_commandlinedata.cpp" line="65">
+<Message type="info" file="qtbase/tests/auto/testlib/selftests/commandlinedata/tst_commandlinedata.cpp" line="0">
<DataTag><![CDATA[fiveTablePasses_data4]]></DataTag>
<Description><![CDATA[QVERIFY(test)]]></Description>
</Message>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[fiveTablePasses_data4]]></DataTag>
</Incident>
-<Message type="info" file="tst_commandlinedata.cpp" line="65">
+<Message type="info" file="qtbase/tests/auto/testlib/selftests/commandlinedata/tst_commandlinedata.cpp" line="0">
<DataTag><![CDATA[fiveTablePasses_data5]]></DataTag>
<Description><![CDATA[QVERIFY(test)]]></Description>
</Message>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[fiveTablePasses_data5]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="fiveTablePasses">
-<Message type="info" file="tst_commandlinedata.cpp" line="65">
+<Message type="info" file="qtbase/tests/auto/testlib/selftests/commandlinedata/tst_commandlinedata.cpp" line="0">
<DataTag><![CDATA[fiveTablePasses_data1]]></DataTag>
<Description><![CDATA[QVERIFY(test)]]></Description>
</Message>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[fiveTablePasses_data1]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="cleanupTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<Duration msecs="0"/>
</TestCase>
diff --git a/tests/auto/testlib/selftests/expected_counting.lightxml b/tests/auto/testlib/selftests/expected_counting.lightxml
index 836c35fb85..68730a3293 100644
--- a/tests/auto/testlib/selftests/expected_counting.lightxml
+++ b/tests/auto/testlib/selftests/expected_counting.lightxml
@@ -5,7 +5,7 @@
</Environment>
<TestFunction name="initTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testPassPass">
<Incident type="pass" file="" line="0">
@@ -14,104 +14,104 @@
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[row 2]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testPassSkip">
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[row 1]]></DataTag>
</Incident>
-<Message type="skip" file="tst_counting.cpp" line="118">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 2]]></DataTag>
<Description><![CDATA[Skipping]]></Description>
</Message>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testPassFail">
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[row 1]]></DataTag>
</Incident>
-<Incident type="fail" file="tst_counting.cpp" line="115">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 2]]></DataTag>
<Description><![CDATA['false' returned FALSE. ()]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testSkipPass">
-<Message type="skip" file="tst_counting.cpp" line="118">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 1]]></DataTag>
<Description><![CDATA[Skipping]]></Description>
</Message>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[row 2]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testSkipSkip">
-<Message type="skip" file="tst_counting.cpp" line="118">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 1]]></DataTag>
<Description><![CDATA[Skipping]]></Description>
</Message>
-<Message type="skip" file="tst_counting.cpp" line="118">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 2]]></DataTag>
<Description><![CDATA[Skipping]]></Description>
</Message>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testSkipFail">
-<Message type="skip" file="tst_counting.cpp" line="118">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 1]]></DataTag>
<Description><![CDATA[Skipping]]></Description>
</Message>
-<Incident type="fail" file="tst_counting.cpp" line="115">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 2]]></DataTag>
<Description><![CDATA['false' returned FALSE. ()]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testFailPass">
-<Incident type="fail" file="tst_counting.cpp" line="115">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 1]]></DataTag>
<Description><![CDATA['false' returned FALSE. ()]]></Description>
</Incident>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[row 2]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testFailSkip">
-<Incident type="fail" file="tst_counting.cpp" line="115">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 1]]></DataTag>
<Description><![CDATA['false' returned FALSE. ()]]></Description>
</Incident>
-<Message type="skip" file="tst_counting.cpp" line="118">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 2]]></DataTag>
<Description><![CDATA[Skipping]]></Description>
</Message>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testFailFail">
-<Incident type="fail" file="tst_counting.cpp" line="115">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 1]]></DataTag>
<Description><![CDATA['false' returned FALSE. ()]]></Description>
</Incident>
-<Incident type="fail" file="tst_counting.cpp" line="115">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 2]]></DataTag>
<Description><![CDATA['false' returned FALSE. ()]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testFailInInit">
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[before]]></DataTag>
</Incident>
-<Incident type="fail" file="tst_counting.cpp" line="234">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[fail]]></DataTag>
<Description><![CDATA[Fail in init()]]></Description>
</Incident>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[after]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testFailInCleanup">
<Incident type="pass" file="" line="0">
@@ -121,27 +121,27 @@
<DataTag><![CDATA[fail]]></DataTag>
<Description><![CDATA[This test function should execute and then QFAIL in cleanup()]]></Description>
</Message>
-<Incident type="fail" file="tst_counting.cpp" line="242">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[fail]]></DataTag>
<Description><![CDATA[Fail in cleanup()]]></Description>
</Incident>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[after]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testSkipInInit">
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[before]]></DataTag>
</Incident>
-<Message type="skip" file="tst_counting.cpp" line="236">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[skip]]></DataTag>
<Description><![CDATA[Skip in init()]]></Description>
</Message>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[after]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testSkipInCleanup">
<Incident type="pass" file="" line="0">
@@ -151,17 +151,17 @@
<DataTag><![CDATA[skip]]></DataTag>
<Description><![CDATA[This test function should execute and then QSKIP in cleanup()]]></Description>
</Message>
-<Message type="skip" file="tst_counting.cpp" line="244">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[skip]]></DataTag>
<Description><![CDATA[Skip in cleanup()]]></Description>
</Message>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[after]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="cleanupTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<Duration msecs="0"/>
diff --git a/tests/auto/testlib/selftests/expected_counting.teamcity b/tests/auto/testlib/selftests/expected_counting.teamcity
index 705d42a90f..5ceaf155d8 100644
--- a/tests/auto/testlib/selftests/expected_counting.teamcity
+++ b/tests/auto/testlib/selftests/expected_counting.teamcity
@@ -7,59 +7,59 @@
##teamcity[testFinished name='testPassPass(row 2)' flowId='tst_Counting']
##teamcity[testStarted name='testPassSkip(row 1)' flowId='tst_Counting']
##teamcity[testFinished name='testPassSkip(row 1)' flowId='tst_Counting']
-##teamcity[testIgnored name='testPassSkip(row 2)' message='Skipping |[Loc: tst_counting.cpp(110)|]' flowId='tst_Counting']
+##teamcity[testIgnored name='testPassSkip(row 2)' message='Skipping |[Loc: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)|]' flowId='tst_Counting']
##teamcity[testStarted name='testPassFail(row 1)' flowId='tst_Counting']
##teamcity[testFinished name='testPassFail(row 1)' flowId='tst_Counting']
##teamcity[testStarted name='testPassFail(row 2)' flowId='tst_Counting']
-##teamcity[testFailed name='testPassFail(row 2)' message='Failure! |[Loc: tst_counting.cpp(107)|]' details='|'false|' returned FALSE. ()' flowId='tst_Counting']
+##teamcity[testFailed name='testPassFail(row 2)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)|]' details='|'false|' returned FALSE. ()' flowId='tst_Counting']
##teamcity[testFinished name='testPassFail(row 2)' flowId='tst_Counting']
-##teamcity[testIgnored name='testSkipPass(row 1)' message='Skipping |[Loc: tst_counting.cpp(110)|]' flowId='tst_Counting']
+##teamcity[testIgnored name='testSkipPass(row 1)' message='Skipping |[Loc: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)|]' flowId='tst_Counting']
##teamcity[testStarted name='testSkipPass(row 2)' flowId='tst_Counting']
##teamcity[testFinished name='testSkipPass(row 2)' flowId='tst_Counting']
-##teamcity[testIgnored name='testSkipSkip(row 1)' message='Skipping |[Loc: tst_counting.cpp(110)|]' flowId='tst_Counting']
-##teamcity[testIgnored name='testSkipSkip(row 2)' message='Skipping |[Loc: tst_counting.cpp(110)|]' flowId='tst_Counting']
-##teamcity[testIgnored name='testSkipFail(row 1)' message='Skipping |[Loc: tst_counting.cpp(110)|]' flowId='tst_Counting']
+##teamcity[testIgnored name='testSkipSkip(row 1)' message='Skipping |[Loc: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)|]' flowId='tst_Counting']
+##teamcity[testIgnored name='testSkipSkip(row 2)' message='Skipping |[Loc: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)|]' flowId='tst_Counting']
+##teamcity[testIgnored name='testSkipFail(row 1)' message='Skipping |[Loc: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)|]' flowId='tst_Counting']
##teamcity[testStarted name='testSkipFail(row 2)' flowId='tst_Counting']
-##teamcity[testFailed name='testSkipFail(row 2)' message='Failure! |[Loc: tst_counting.cpp(107)|]' details='|'false|' returned FALSE. ()' flowId='tst_Counting']
+##teamcity[testFailed name='testSkipFail(row 2)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)|]' details='|'false|' returned FALSE. ()' flowId='tst_Counting']
##teamcity[testFinished name='testSkipFail(row 2)' flowId='tst_Counting']
##teamcity[testStarted name='testFailPass(row 1)' flowId='tst_Counting']
-##teamcity[testFailed name='testFailPass(row 1)' message='Failure! |[Loc: tst_counting.cpp(107)|]' details='|'false|' returned FALSE. ()' flowId='tst_Counting']
+##teamcity[testFailed name='testFailPass(row 1)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)|]' details='|'false|' returned FALSE. ()' flowId='tst_Counting']
##teamcity[testFinished name='testFailPass(row 1)' flowId='tst_Counting']
##teamcity[testStarted name='testFailPass(row 2)' flowId='tst_Counting']
##teamcity[testFinished name='testFailPass(row 2)' flowId='tst_Counting']
##teamcity[testStarted name='testFailSkip(row 1)' flowId='tst_Counting']
-##teamcity[testFailed name='testFailSkip(row 1)' message='Failure! |[Loc: tst_counting.cpp(107)|]' details='|'false|' returned FALSE. ()' flowId='tst_Counting']
+##teamcity[testFailed name='testFailSkip(row 1)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)|]' details='|'false|' returned FALSE. ()' flowId='tst_Counting']
##teamcity[testFinished name='testFailSkip(row 1)' flowId='tst_Counting']
-##teamcity[testIgnored name='testFailSkip(row 2)' message='Skipping |[Loc: tst_counting.cpp(110)|]' flowId='tst_Counting']
+##teamcity[testIgnored name='testFailSkip(row 2)' message='Skipping |[Loc: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)|]' flowId='tst_Counting']
##teamcity[testStarted name='testFailFail(row 1)' flowId='tst_Counting']
-##teamcity[testFailed name='testFailFail(row 1)' message='Failure! |[Loc: tst_counting.cpp(107)|]' details='|'false|' returned FALSE. ()' flowId='tst_Counting']
+##teamcity[testFailed name='testFailFail(row 1)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)|]' details='|'false|' returned FALSE. ()' flowId='tst_Counting']
##teamcity[testFinished name='testFailFail(row 1)' flowId='tst_Counting']
##teamcity[testStarted name='testFailFail(row 2)' flowId='tst_Counting']
-##teamcity[testFailed name='testFailFail(row 2)' message='Failure! |[Loc: tst_counting.cpp(107)|]' details='|'false|' returned FALSE. ()' flowId='tst_Counting']
+##teamcity[testFailed name='testFailFail(row 2)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)|]' details='|'false|' returned FALSE. ()' flowId='tst_Counting']
##teamcity[testFinished name='testFailFail(row 2)' flowId='tst_Counting']
##teamcity[testStarted name='testFailInInit(before)' flowId='tst_Counting']
##teamcity[testFinished name='testFailInInit(before)' flowId='tst_Counting']
##teamcity[testStarted name='testFailInInit(fail)' flowId='tst_Counting']
-##teamcity[testFailed name='testFailInInit(fail)' message='Failure! |[Loc: tst_counting.cpp(226)|]' details='Fail in init()' flowId='tst_Counting']
+##teamcity[testFailed name='testFailInInit(fail)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)|]' details='Fail in init()' flowId='tst_Counting']
##teamcity[testFinished name='testFailInInit(fail)' flowId='tst_Counting']
##teamcity[testStarted name='testFailInInit(after)' flowId='tst_Counting']
##teamcity[testFinished name='testFailInInit(after)' flowId='tst_Counting']
##teamcity[testStarted name='testFailInCleanup(before)' flowId='tst_Counting']
##teamcity[testFinished name='testFailInCleanup(before)' flowId='tst_Counting']
##teamcity[testStarted name='testFailInCleanup(fail)' flowId='tst_Counting']
-##teamcity[testFailed name='testFailInCleanup(fail)' message='Failure! |[Loc: tst_counting.cpp(234)|]' details='Fail in cleanup()' flowId='tst_Counting']
+##teamcity[testFailed name='testFailInCleanup(fail)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)|]' details='Fail in cleanup()' flowId='tst_Counting']
##teamcity[testStdOut name='testFailInCleanup(fail)' out='QDEBUG: This test function should execute and then QFAIL in cleanup()' flowId='tst_Counting']
##teamcity[testFinished name='testFailInCleanup(fail)' flowId='tst_Counting']
##teamcity[testStarted name='testFailInCleanup(after)' flowId='tst_Counting']
##teamcity[testFinished name='testFailInCleanup(after)' flowId='tst_Counting']
##teamcity[testStarted name='testSkipInInit(before)' flowId='tst_Counting']
##teamcity[testFinished name='testSkipInInit(before)' flowId='tst_Counting']
-##teamcity[testIgnored name='testSkipInInit(skip)' message='Skip in init() |[Loc: tst_counting.cpp(228)|]' flowId='tst_Counting']
+##teamcity[testIgnored name='testSkipInInit(skip)' message='Skip in init() |[Loc: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)|]' flowId='tst_Counting']
##teamcity[testStarted name='testSkipInInit(after)' flowId='tst_Counting']
##teamcity[testFinished name='testSkipInInit(after)' flowId='tst_Counting']
##teamcity[testStarted name='testSkipInCleanup(before)' flowId='tst_Counting']
##teamcity[testFinished name='testSkipInCleanup(before)' flowId='tst_Counting']
-##teamcity[testIgnored name='testSkipInCleanup(skip)' message='Skip in cleanup() |[Loc: tst_counting.cpp(236)|]' flowId='tst_Counting']
+##teamcity[testIgnored name='testSkipInCleanup(skip)' message='Skip in cleanup() |[Loc: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)|]' flowId='tst_Counting']
##teamcity[testStarted name='testSkipInCleanup(after)' flowId='tst_Counting']
##teamcity[testStdOut name='testSkipInCleanup(after)' out='QDEBUG: This test function should execute and then QSKIP in cleanup()' flowId='tst_Counting']
##teamcity[testFinished name='testSkipInCleanup(after)' flowId='tst_Counting']
diff --git a/tests/auto/testlib/selftests/expected_counting.txt b/tests/auto/testlib/selftests/expected_counting.txt
index 32368760d6..027e5b2c6e 100644
--- a/tests/auto/testlib/selftests/expected_counting.txt
+++ b/tests/auto/testlib/selftests/expected_counting.txt
@@ -1,54 +1,54 @@
********* Start testing of tst_Counting *********
-Config: Using QtTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@
+Config: Using QtTest library
PASS : tst_Counting::initTestCase()
PASS : tst_Counting::testPassPass(row 1)
PASS : tst_Counting::testPassPass(row 2)
PASS : tst_Counting::testPassSkip(row 1)
SKIP : tst_Counting::testPassSkip(row 2) Skipping
- Loc: [tst_counting.cpp(118)]
+ Loc: [qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)]
PASS : tst_Counting::testPassFail(row 1)
FAIL! : tst_Counting::testPassFail(row 2) 'false' returned FALSE. ()
- Loc: [tst_counting.cpp(115)]
+ Loc: [qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)]
SKIP : tst_Counting::testSkipPass(row 1) Skipping
- Loc: [tst_counting.cpp(118)]
+ Loc: [qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)]
PASS : tst_Counting::testSkipPass(row 2)
SKIP : tst_Counting::testSkipSkip(row 1) Skipping
- Loc: [tst_counting.cpp(118)]
+ Loc: [qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)]
SKIP : tst_Counting::testSkipSkip(row 2) Skipping
- Loc: [tst_counting.cpp(118)]
+ Loc: [qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)]
SKIP : tst_Counting::testSkipFail(row 1) Skipping
- Loc: [tst_counting.cpp(118)]
+ Loc: [qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)]
FAIL! : tst_Counting::testSkipFail(row 2) 'false' returned FALSE. ()
- Loc: [tst_counting.cpp(115)]
+ Loc: [qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)]
FAIL! : tst_Counting::testFailPass(row 1) 'false' returned FALSE. ()
- Loc: [tst_counting.cpp(115)]
+ Loc: [qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)]
PASS : tst_Counting::testFailPass(row 2)
FAIL! : tst_Counting::testFailSkip(row 1) 'false' returned FALSE. ()
- Loc: [tst_counting.cpp(115)]
+ Loc: [qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)]
SKIP : tst_Counting::testFailSkip(row 2) Skipping
- Loc: [tst_counting.cpp(118)]
+ Loc: [qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)]
FAIL! : tst_Counting::testFailFail(row 1) 'false' returned FALSE. ()
- Loc: [tst_counting.cpp(115)]
+ Loc: [qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)]
FAIL! : tst_Counting::testFailFail(row 2) 'false' returned FALSE. ()
- Loc: [tst_counting.cpp(115)]
+ Loc: [qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)]
PASS : tst_Counting::testFailInInit(before)
FAIL! : tst_Counting::testFailInInit(fail) Fail in init()
- Loc: [tst_counting.cpp(234)]
+ Loc: [qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)]
PASS : tst_Counting::testFailInInit(after)
PASS : tst_Counting::testFailInCleanup(before)
QDEBUG : tst_Counting::testFailInCleanup(fail) This test function should execute and then QFAIL in cleanup()
FAIL! : tst_Counting::testFailInCleanup(fail) Fail in cleanup()
- Loc: [tst_counting.cpp(242)]
+ Loc: [qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)]
PASS : tst_Counting::testFailInCleanup(after)
PASS : tst_Counting::testSkipInInit(before)
SKIP : tst_Counting::testSkipInInit(skip) Skip in init()
- Loc: [tst_counting.cpp(236)]
+ Loc: [qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)]
PASS : tst_Counting::testSkipInInit(after)
PASS : tst_Counting::testSkipInCleanup(before)
QDEBUG : tst_Counting::testSkipInCleanup(skip) This test function should execute and then QSKIP in cleanup()
SKIP : tst_Counting::testSkipInCleanup(skip) Skip in cleanup()
- Loc: [tst_counting.cpp(244)]
+ Loc: [qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)]
PASS : tst_Counting::testSkipInCleanup(after)
PASS : tst_Counting::cleanupTestCase()
-Totals: 16 passed, 8 failed, 8 skipped, 0 blacklisted
+Totals: 16 passed, 8 failed, 8 skipped, 0 blacklisted, 0ms
********* Finished testing of tst_Counting *********
diff --git a/tests/auto/testlib/selftests/expected_counting.xml b/tests/auto/testlib/selftests/expected_counting.xml
index 892fd762c6..841a49c30d 100644
--- a/tests/auto/testlib/selftests/expected_counting.xml
+++ b/tests/auto/testlib/selftests/expected_counting.xml
@@ -7,7 +7,7 @@
</Environment>
<TestFunction name="initTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testPassPass">
<Incident type="pass" file="" line="0">
@@ -16,104 +16,104 @@
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[row 2]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testPassSkip">
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[row 1]]></DataTag>
</Incident>
-<Message type="skip" file="tst_counting.cpp" line="118">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 2]]></DataTag>
<Description><![CDATA[Skipping]]></Description>
</Message>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testPassFail">
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[row 1]]></DataTag>
</Incident>
-<Incident type="fail" file="tst_counting.cpp" line="115">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 2]]></DataTag>
<Description><![CDATA['false' returned FALSE. ()]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testSkipPass">
-<Message type="skip" file="tst_counting.cpp" line="118">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 1]]></DataTag>
<Description><![CDATA[Skipping]]></Description>
</Message>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[row 2]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testSkipSkip">
-<Message type="skip" file="tst_counting.cpp" line="118">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 1]]></DataTag>
<Description><![CDATA[Skipping]]></Description>
</Message>
-<Message type="skip" file="tst_counting.cpp" line="118">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 2]]></DataTag>
<Description><![CDATA[Skipping]]></Description>
</Message>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testSkipFail">
-<Message type="skip" file="tst_counting.cpp" line="118">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 1]]></DataTag>
<Description><![CDATA[Skipping]]></Description>
</Message>
-<Incident type="fail" file="tst_counting.cpp" line="115">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 2]]></DataTag>
<Description><![CDATA['false' returned FALSE. ()]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testFailPass">
-<Incident type="fail" file="tst_counting.cpp" line="115">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 1]]></DataTag>
<Description><![CDATA['false' returned FALSE. ()]]></Description>
</Incident>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[row 2]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testFailSkip">
-<Incident type="fail" file="tst_counting.cpp" line="115">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 1]]></DataTag>
<Description><![CDATA['false' returned FALSE. ()]]></Description>
</Incident>
-<Message type="skip" file="tst_counting.cpp" line="118">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 2]]></DataTag>
<Description><![CDATA[Skipping]]></Description>
</Message>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testFailFail">
-<Incident type="fail" file="tst_counting.cpp" line="115">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 1]]></DataTag>
<Description><![CDATA['false' returned FALSE. ()]]></Description>
</Incident>
-<Incident type="fail" file="tst_counting.cpp" line="115">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 2]]></DataTag>
<Description><![CDATA['false' returned FALSE. ()]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testFailInInit">
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[before]]></DataTag>
</Incident>
-<Incident type="fail" file="tst_counting.cpp" line="234">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[fail]]></DataTag>
<Description><![CDATA[Fail in init()]]></Description>
</Incident>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[after]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testFailInCleanup">
<Incident type="pass" file="" line="0">
@@ -123,27 +123,27 @@
<DataTag><![CDATA[fail]]></DataTag>
<Description><![CDATA[This test function should execute and then QFAIL in cleanup()]]></Description>
</Message>
-<Incident type="fail" file="tst_counting.cpp" line="242">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[fail]]></DataTag>
<Description><![CDATA[Fail in cleanup()]]></Description>
</Incident>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[after]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testSkipInInit">
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[before]]></DataTag>
</Incident>
-<Message type="skip" file="tst_counting.cpp" line="236">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[skip]]></DataTag>
<Description><![CDATA[Skip in init()]]></Description>
</Message>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[after]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testSkipInCleanup">
<Incident type="pass" file="" line="0">
@@ -153,18 +153,18 @@
<DataTag><![CDATA[skip]]></DataTag>
<Description><![CDATA[This test function should execute and then QSKIP in cleanup()]]></Description>
</Message>
-<Message type="skip" file="tst_counting.cpp" line="244">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[skip]]></DataTag>
<Description><![CDATA[Skip in cleanup()]]></Description>
</Message>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[after]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="cleanupTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<Duration msecs="0"/>
</TestCase>
diff --git a/tests/auto/testlib/selftests/expected_datatable.lightxml b/tests/auto/testlib/selftests/expected_datatable.lightxml
index c14a6a1940..b4378ea887 100644
--- a/tests/auto/testlib/selftests/expected_datatable.lightxml
+++ b/tests/auto/testlib/selftests/expected_datatable.lightxml
@@ -5,15 +5,15 @@
</Environment>
<TestFunction name="initTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="singleTestFunction1">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="singleTestFunction2">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="fiveTablePasses">
<Incident type="pass" file="" line="0">
@@ -31,33 +31,33 @@
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[fiveTablePasses_data 5]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="fiveTableFailures">
-<Incident type="fail" file="tst_datatable.cpp" line="91">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp" line="0">
<DataTag><![CDATA[fiveTableFailures_data 1]]></DataTag>
<Description><![CDATA['test' returned FALSE. ()]]></Description>
</Incident>
-<Incident type="fail" file="tst_datatable.cpp" line="91">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp" line="0">
<DataTag><![CDATA[fiveTableFailures_data 2]]></DataTag>
<Description><![CDATA['test' returned FALSE. ()]]></Description>
</Incident>
-<Incident type="fail" file="tst_datatable.cpp" line="91">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp" line="0">
<DataTag><![CDATA[fiveTableFailures_data 3]]></DataTag>
<Description><![CDATA['test' returned FALSE. ()]]></Description>
</Incident>
-<Incident type="fail" file="tst_datatable.cpp" line="91">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp" line="0">
<DataTag><![CDATA[fiveTableFailures_data 4]]></DataTag>
<Description><![CDATA['test' returned FALSE. ()]]></Description>
</Incident>
-<Incident type="fail" file="tst_datatable.cpp" line="91">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp" line="0">
<DataTag><![CDATA[fiveTableFailures_data 5]]></DataTag>
<Description><![CDATA['test' returned FALSE. ()]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="startsWithFailure">
-<Incident type="fail" file="tst_datatable.cpp" line="91">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp" line="0">
<DataTag><![CDATA[startsWithFailure_data 1]]></DataTag>
<Description><![CDATA['test' returned FALSE. ()]]></Description>
</Incident>
@@ -73,7 +73,7 @@
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[startsWithFailure_data 5]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="endsWithFailure">
<Incident type="pass" file="" line="0">
@@ -88,11 +88,11 @@
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[endsWithFailure 4]]></DataTag>
</Incident>
-<Incident type="fail" file="tst_datatable.cpp" line="91">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp" line="0">
<DataTag><![CDATA[endsWithFailure 5]]></DataTag>
<Description><![CDATA['test' returned FALSE. ()]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="failureInMiddle">
<Incident type="pass" file="" line="0">
@@ -101,7 +101,7 @@
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[failureInMiddle_data 2]]></DataTag>
</Incident>
-<Incident type="fail" file="tst_datatable.cpp" line="91">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp" line="0">
<DataTag><![CDATA[failureInMiddle_data 3]]></DataTag>
<Description><![CDATA['test' returned FALSE. ()]]></Description>
</Incident>
@@ -111,33 +111,33 @@
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[failureInMiddle_data 5]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="fiveIsolatedFailures">
-<Incident type="fail" file="tst_datatable.cpp" line="173">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp" line="0">
<DataTag><![CDATA[fiveIsolatedFailures_data 1]]></DataTag>
<Description><![CDATA['!test' returned FALSE. ()]]></Description>
</Incident>
-<Incident type="fail" file="tst_datatable.cpp" line="173">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp" line="0">
<DataTag><![CDATA[fiveIsolatedFailures_data 2]]></DataTag>
<Description><![CDATA['!test' returned FALSE. ()]]></Description>
</Incident>
-<Incident type="fail" file="tst_datatable.cpp" line="173">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp" line="0">
<DataTag><![CDATA[fiveIsolatedFailures_data 3]]></DataTag>
<Description><![CDATA['!test' returned FALSE. ()]]></Description>
</Incident>
-<Incident type="fail" file="tst_datatable.cpp" line="173">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp" line="0">
<DataTag><![CDATA[fiveIsolatedFailures_data 4]]></DataTag>
<Description><![CDATA['!test' returned FALSE. ()]]></Description>
</Incident>
-<Incident type="fail" file="tst_datatable.cpp" line="173">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp" line="0">
<DataTag><![CDATA[fiveIsolatedFailures_data 5]]></DataTag>
<Description><![CDATA['!test' returned FALSE. ()]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="cleanupTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<Duration msecs="0"/>
diff --git a/tests/auto/testlib/selftests/expected_datatable.teamcity b/tests/auto/testlib/selftests/expected_datatable.teamcity
index 9df9dd2a36..0b52e153e2 100644
--- a/tests/auto/testlib/selftests/expected_datatable.teamcity
+++ b/tests/auto/testlib/selftests/expected_datatable.teamcity
@@ -16,22 +16,22 @@
##teamcity[testStarted name='fiveTablePasses(fiveTablePasses_data 5)' flowId='tst_DataTable']
##teamcity[testFinished name='fiveTablePasses(fiveTablePasses_data 5)' flowId='tst_DataTable']
##teamcity[testStarted name='fiveTableFailures(fiveTableFailures_data 1)' flowId='tst_DataTable']
-##teamcity[testFailed name='fiveTableFailures(fiveTableFailures_data 1)' message='Failure! |[Loc: tst_datatable.cpp(83)|]' details='|'test|' returned FALSE. ()' flowId='tst_DataTable']
+##teamcity[testFailed name='fiveTableFailures(fiveTableFailures_data 1)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp(0)|]' details='|'test|' returned FALSE. ()' flowId='tst_DataTable']
##teamcity[testFinished name='fiveTableFailures(fiveTableFailures_data 1)' flowId='tst_DataTable']
##teamcity[testStarted name='fiveTableFailures(fiveTableFailures_data 2)' flowId='tst_DataTable']
-##teamcity[testFailed name='fiveTableFailures(fiveTableFailures_data 2)' message='Failure! |[Loc: tst_datatable.cpp(83)|]' details='|'test|' returned FALSE. ()' flowId='tst_DataTable']
+##teamcity[testFailed name='fiveTableFailures(fiveTableFailures_data 2)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp(0)|]' details='|'test|' returned FALSE. ()' flowId='tst_DataTable']
##teamcity[testFinished name='fiveTableFailures(fiveTableFailures_data 2)' flowId='tst_DataTable']
##teamcity[testStarted name='fiveTableFailures(fiveTableFailures_data 3)' flowId='tst_DataTable']
-##teamcity[testFailed name='fiveTableFailures(fiveTableFailures_data 3)' message='Failure! |[Loc: tst_datatable.cpp(83)|]' details='|'test|' returned FALSE. ()' flowId='tst_DataTable']
+##teamcity[testFailed name='fiveTableFailures(fiveTableFailures_data 3)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp(0)|]' details='|'test|' returned FALSE. ()' flowId='tst_DataTable']
##teamcity[testFinished name='fiveTableFailures(fiveTableFailures_data 3)' flowId='tst_DataTable']
##teamcity[testStarted name='fiveTableFailures(fiveTableFailures_data 4)' flowId='tst_DataTable']
-##teamcity[testFailed name='fiveTableFailures(fiveTableFailures_data 4)' message='Failure! |[Loc: tst_datatable.cpp(83)|]' details='|'test|' returned FALSE. ()' flowId='tst_DataTable']
+##teamcity[testFailed name='fiveTableFailures(fiveTableFailures_data 4)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp(0)|]' details='|'test|' returned FALSE. ()' flowId='tst_DataTable']
##teamcity[testFinished name='fiveTableFailures(fiveTableFailures_data 4)' flowId='tst_DataTable']
##teamcity[testStarted name='fiveTableFailures(fiveTableFailures_data 5)' flowId='tst_DataTable']
-##teamcity[testFailed name='fiveTableFailures(fiveTableFailures_data 5)' message='Failure! |[Loc: tst_datatable.cpp(83)|]' details='|'test|' returned FALSE. ()' flowId='tst_DataTable']
+##teamcity[testFailed name='fiveTableFailures(fiveTableFailures_data 5)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp(0)|]' details='|'test|' returned FALSE. ()' flowId='tst_DataTable']
##teamcity[testFinished name='fiveTableFailures(fiveTableFailures_data 5)' flowId='tst_DataTable']
##teamcity[testStarted name='startsWithFailure(startsWithFailure_data 1)' flowId='tst_DataTable']
-##teamcity[testFailed name='startsWithFailure(startsWithFailure_data 1)' message='Failure! |[Loc: tst_datatable.cpp(83)|]' details='|'test|' returned FALSE. ()' flowId='tst_DataTable']
+##teamcity[testFailed name='startsWithFailure(startsWithFailure_data 1)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp(0)|]' details='|'test|' returned FALSE. ()' flowId='tst_DataTable']
##teamcity[testFinished name='startsWithFailure(startsWithFailure_data 1)' flowId='tst_DataTable']
##teamcity[testStarted name='startsWithFailure(startsWithFailure_data 2)' flowId='tst_DataTable']
##teamcity[testFinished name='startsWithFailure(startsWithFailure_data 2)' flowId='tst_DataTable']
@@ -50,33 +50,33 @@
##teamcity[testStarted name='endsWithFailure(endsWithFailure 4)' flowId='tst_DataTable']
##teamcity[testFinished name='endsWithFailure(endsWithFailure 4)' flowId='tst_DataTable']
##teamcity[testStarted name='endsWithFailure(endsWithFailure 5)' flowId='tst_DataTable']
-##teamcity[testFailed name='endsWithFailure(endsWithFailure 5)' message='Failure! |[Loc: tst_datatable.cpp(83)|]' details='|'test|' returned FALSE. ()' flowId='tst_DataTable']
+##teamcity[testFailed name='endsWithFailure(endsWithFailure 5)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp(0)|]' details='|'test|' returned FALSE. ()' flowId='tst_DataTable']
##teamcity[testFinished name='endsWithFailure(endsWithFailure 5)' flowId='tst_DataTable']
##teamcity[testStarted name='failureInMiddle(failureInMiddle_data 1)' flowId='tst_DataTable']
##teamcity[testFinished name='failureInMiddle(failureInMiddle_data 1)' flowId='tst_DataTable']
##teamcity[testStarted name='failureInMiddle(failureInMiddle_data 2)' flowId='tst_DataTable']
##teamcity[testFinished name='failureInMiddle(failureInMiddle_data 2)' flowId='tst_DataTable']
##teamcity[testStarted name='failureInMiddle(failureInMiddle_data 3)' flowId='tst_DataTable']
-##teamcity[testFailed name='failureInMiddle(failureInMiddle_data 3)' message='Failure! |[Loc: tst_datatable.cpp(83)|]' details='|'test|' returned FALSE. ()' flowId='tst_DataTable']
+##teamcity[testFailed name='failureInMiddle(failureInMiddle_data 3)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp(0)|]' details='|'test|' returned FALSE. ()' flowId='tst_DataTable']
##teamcity[testFinished name='failureInMiddle(failureInMiddle_data 3)' flowId='tst_DataTable']
##teamcity[testStarted name='failureInMiddle(failureInMiddle_data 4)' flowId='tst_DataTable']
##teamcity[testFinished name='failureInMiddle(failureInMiddle_data 4)' flowId='tst_DataTable']
##teamcity[testStarted name='failureInMiddle(failureInMiddle_data 5)' flowId='tst_DataTable']
##teamcity[testFinished name='failureInMiddle(failureInMiddle_data 5)' flowId='tst_DataTable']
##teamcity[testStarted name='fiveIsolatedFailures(fiveIsolatedFailures_data 1)' flowId='tst_DataTable']
-##teamcity[testFailed name='fiveIsolatedFailures(fiveIsolatedFailures_data 1)' message='Failure! |[Loc: tst_datatable.cpp(165)|]' details='|'!test|' returned FALSE. ()' flowId='tst_DataTable']
+##teamcity[testFailed name='fiveIsolatedFailures(fiveIsolatedFailures_data 1)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp(0)|]' details='|'!test|' returned FALSE. ()' flowId='tst_DataTable']
##teamcity[testFinished name='fiveIsolatedFailures(fiveIsolatedFailures_data 1)' flowId='tst_DataTable']
##teamcity[testStarted name='fiveIsolatedFailures(fiveIsolatedFailures_data 2)' flowId='tst_DataTable']
-##teamcity[testFailed name='fiveIsolatedFailures(fiveIsolatedFailures_data 2)' message='Failure! |[Loc: tst_datatable.cpp(165)|]' details='|'!test|' returned FALSE. ()' flowId='tst_DataTable']
+##teamcity[testFailed name='fiveIsolatedFailures(fiveIsolatedFailures_data 2)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp(0)|]' details='|'!test|' returned FALSE. ()' flowId='tst_DataTable']
##teamcity[testFinished name='fiveIsolatedFailures(fiveIsolatedFailures_data 2)' flowId='tst_DataTable']
##teamcity[testStarted name='fiveIsolatedFailures(fiveIsolatedFailures_data 3)' flowId='tst_DataTable']
-##teamcity[testFailed name='fiveIsolatedFailures(fiveIsolatedFailures_data 3)' message='Failure! |[Loc: tst_datatable.cpp(165)|]' details='|'!test|' returned FALSE. ()' flowId='tst_DataTable']
+##teamcity[testFailed name='fiveIsolatedFailures(fiveIsolatedFailures_data 3)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp(0)|]' details='|'!test|' returned FALSE. ()' flowId='tst_DataTable']
##teamcity[testFinished name='fiveIsolatedFailures(fiveIsolatedFailures_data 3)' flowId='tst_DataTable']
##teamcity[testStarted name='fiveIsolatedFailures(fiveIsolatedFailures_data 4)' flowId='tst_DataTable']
-##teamcity[testFailed name='fiveIsolatedFailures(fiveIsolatedFailures_data 4)' message='Failure! |[Loc: tst_datatable.cpp(165)|]' details='|'!test|' returned FALSE. ()' flowId='tst_DataTable']
+##teamcity[testFailed name='fiveIsolatedFailures(fiveIsolatedFailures_data 4)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp(0)|]' details='|'!test|' returned FALSE. ()' flowId='tst_DataTable']
##teamcity[testFinished name='fiveIsolatedFailures(fiveIsolatedFailures_data 4)' flowId='tst_DataTable']
##teamcity[testStarted name='fiveIsolatedFailures(fiveIsolatedFailures_data 5)' flowId='tst_DataTable']
-##teamcity[testFailed name='fiveIsolatedFailures(fiveIsolatedFailures_data 5)' message='Failure! |[Loc: tst_datatable.cpp(165)|]' details='|'!test|' returned FALSE. ()' flowId='tst_DataTable']
+##teamcity[testFailed name='fiveIsolatedFailures(fiveIsolatedFailures_data 5)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp(0)|]' details='|'!test|' returned FALSE. ()' flowId='tst_DataTable']
##teamcity[testFinished name='fiveIsolatedFailures(fiveIsolatedFailures_data 5)' flowId='tst_DataTable']
##teamcity[testStarted name='cleanupTestCase()' flowId='tst_DataTable']
##teamcity[testFinished name='cleanupTestCase()' flowId='tst_DataTable']
diff --git a/tests/auto/testlib/selftests/expected_datatable.txt b/tests/auto/testlib/selftests/expected_datatable.txt
index b1ace3be01..8d24a55a55 100644
--- a/tests/auto/testlib/selftests/expected_datatable.txt
+++ b/tests/auto/testlib/selftests/expected_datatable.txt
@@ -1,5 +1,5 @@
********* Start testing of tst_DataTable *********
-Config: Using QtTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@
+Config: Using QtTest library
PASS : tst_DataTable::initTestCase()
PASS : tst_DataTable::singleTestFunction1()
PASS : tst_DataTable::singleTestFunction2()
@@ -9,17 +9,17 @@ PASS : tst_DataTable::fiveTablePasses(fiveTablePasses_data 3)
PASS : tst_DataTable::fiveTablePasses(fiveTablePasses_data 4)
PASS : tst_DataTable::fiveTablePasses(fiveTablePasses_data 5)
FAIL! : tst_DataTable::fiveTableFailures(fiveTableFailures_data 1) 'test' returned FALSE. ()
- Loc: [tst_datatable.cpp(91)]
+ Loc: [qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp(0)]
FAIL! : tst_DataTable::fiveTableFailures(fiveTableFailures_data 2) 'test' returned FALSE. ()
- Loc: [tst_datatable.cpp(91)]
+ Loc: [qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp(0)]
FAIL! : tst_DataTable::fiveTableFailures(fiveTableFailures_data 3) 'test' returned FALSE. ()
- Loc: [tst_datatable.cpp(91)]
+ Loc: [qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp(0)]
FAIL! : tst_DataTable::fiveTableFailures(fiveTableFailures_data 4) 'test' returned FALSE. ()
- Loc: [tst_datatable.cpp(91)]
+ Loc: [qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp(0)]
FAIL! : tst_DataTable::fiveTableFailures(fiveTableFailures_data 5) 'test' returned FALSE. ()
- Loc: [tst_datatable.cpp(91)]
+ Loc: [qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp(0)]
FAIL! : tst_DataTable::startsWithFailure(startsWithFailure_data 1) 'test' returned FALSE. ()
- Loc: [tst_datatable.cpp(91)]
+ Loc: [qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp(0)]
PASS : tst_DataTable::startsWithFailure(startsWithFailure_data 2)
PASS : tst_DataTable::startsWithFailure(startsWithFailure_data 3)
PASS : tst_DataTable::startsWithFailure(startsWithFailure_data 4)
@@ -29,23 +29,23 @@ PASS : tst_DataTable::endsWithFailure(endsWithFailure 2)
PASS : tst_DataTable::endsWithFailure(endsWithFailure 3)
PASS : tst_DataTable::endsWithFailure(endsWithFailure 4)
FAIL! : tst_DataTable::endsWithFailure(endsWithFailure 5) 'test' returned FALSE. ()
- Loc: [tst_datatable.cpp(91)]
+ Loc: [qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp(0)]
PASS : tst_DataTable::failureInMiddle(failureInMiddle_data 1)
PASS : tst_DataTable::failureInMiddle(failureInMiddle_data 2)
FAIL! : tst_DataTable::failureInMiddle(failureInMiddle_data 3) 'test' returned FALSE. ()
- Loc: [tst_datatable.cpp(91)]
+ Loc: [qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp(0)]
PASS : tst_DataTable::failureInMiddle(failureInMiddle_data 4)
PASS : tst_DataTable::failureInMiddle(failureInMiddle_data 5)
FAIL! : tst_DataTable::fiveIsolatedFailures(fiveIsolatedFailures_data 1) '!test' returned FALSE. ()
- Loc: [tst_datatable.cpp(173)]
+ Loc: [qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp(0)]
FAIL! : tst_DataTable::fiveIsolatedFailures(fiveIsolatedFailures_data 2) '!test' returned FALSE. ()
- Loc: [tst_datatable.cpp(173)]
+ Loc: [qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp(0)]
FAIL! : tst_DataTable::fiveIsolatedFailures(fiveIsolatedFailures_data 3) '!test' returned FALSE. ()
- Loc: [tst_datatable.cpp(173)]
+ Loc: [qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp(0)]
FAIL! : tst_DataTable::fiveIsolatedFailures(fiveIsolatedFailures_data 4) '!test' returned FALSE. ()
- Loc: [tst_datatable.cpp(173)]
+ Loc: [qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp(0)]
FAIL! : tst_DataTable::fiveIsolatedFailures(fiveIsolatedFailures_data 5) '!test' returned FALSE. ()
- Loc: [tst_datatable.cpp(173)]
+ Loc: [qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp(0)]
PASS : tst_DataTable::cleanupTestCase()
-Totals: 21 passed, 13 failed, 0 skipped, 0 blacklisted
+Totals: 21 passed, 13 failed, 0 skipped, 0 blacklisted, 0ms
********* Finished testing of tst_DataTable *********
diff --git a/tests/auto/testlib/selftests/expected_datatable.xml b/tests/auto/testlib/selftests/expected_datatable.xml
index 297cb0d5de..6fefe4eed1 100644
--- a/tests/auto/testlib/selftests/expected_datatable.xml
+++ b/tests/auto/testlib/selftests/expected_datatable.xml
@@ -7,15 +7,15 @@
</Environment>
<TestFunction name="initTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="singleTestFunction1">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="singleTestFunction2">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="fiveTablePasses">
<Incident type="pass" file="" line="0">
@@ -33,33 +33,33 @@
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[fiveTablePasses_data 5]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="fiveTableFailures">
-<Incident type="fail" file="tst_datatable.cpp" line="91">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp" line="0">
<DataTag><![CDATA[fiveTableFailures_data 1]]></DataTag>
<Description><![CDATA['test' returned FALSE. ()]]></Description>
</Incident>
-<Incident type="fail" file="tst_datatable.cpp" line="91">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp" line="0">
<DataTag><![CDATA[fiveTableFailures_data 2]]></DataTag>
<Description><![CDATA['test' returned FALSE. ()]]></Description>
</Incident>
-<Incident type="fail" file="tst_datatable.cpp" line="91">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp" line="0">
<DataTag><![CDATA[fiveTableFailures_data 3]]></DataTag>
<Description><![CDATA['test' returned FALSE. ()]]></Description>
</Incident>
-<Incident type="fail" file="tst_datatable.cpp" line="91">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp" line="0">
<DataTag><![CDATA[fiveTableFailures_data 4]]></DataTag>
<Description><![CDATA['test' returned FALSE. ()]]></Description>
</Incident>
-<Incident type="fail" file="tst_datatable.cpp" line="91">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp" line="0">
<DataTag><![CDATA[fiveTableFailures_data 5]]></DataTag>
<Description><![CDATA['test' returned FALSE. ()]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="startsWithFailure">
-<Incident type="fail" file="tst_datatable.cpp" line="91">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp" line="0">
<DataTag><![CDATA[startsWithFailure_data 1]]></DataTag>
<Description><![CDATA['test' returned FALSE. ()]]></Description>
</Incident>
@@ -75,7 +75,7 @@
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[startsWithFailure_data 5]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="endsWithFailure">
<Incident type="pass" file="" line="0">
@@ -90,11 +90,11 @@
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[endsWithFailure 4]]></DataTag>
</Incident>
-<Incident type="fail" file="tst_datatable.cpp" line="91">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp" line="0">
<DataTag><![CDATA[endsWithFailure 5]]></DataTag>
<Description><![CDATA['test' returned FALSE. ()]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="failureInMiddle">
<Incident type="pass" file="" line="0">
@@ -103,7 +103,7 @@
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[failureInMiddle_data 2]]></DataTag>
</Incident>
-<Incident type="fail" file="tst_datatable.cpp" line="91">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp" line="0">
<DataTag><![CDATA[failureInMiddle_data 3]]></DataTag>
<Description><![CDATA['test' returned FALSE. ()]]></Description>
</Incident>
@@ -113,34 +113,34 @@
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[failureInMiddle_data 5]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="fiveIsolatedFailures">
-<Incident type="fail" file="tst_datatable.cpp" line="173">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp" line="0">
<DataTag><![CDATA[fiveIsolatedFailures_data 1]]></DataTag>
<Description><![CDATA['!test' returned FALSE. ()]]></Description>
</Incident>
-<Incident type="fail" file="tst_datatable.cpp" line="173">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp" line="0">
<DataTag><![CDATA[fiveIsolatedFailures_data 2]]></DataTag>
<Description><![CDATA['!test' returned FALSE. ()]]></Description>
</Incident>
-<Incident type="fail" file="tst_datatable.cpp" line="173">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp" line="0">
<DataTag><![CDATA[fiveIsolatedFailures_data 3]]></DataTag>
<Description><![CDATA['!test' returned FALSE. ()]]></Description>
</Incident>
-<Incident type="fail" file="tst_datatable.cpp" line="173">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp" line="0">
<DataTag><![CDATA[fiveIsolatedFailures_data 4]]></DataTag>
<Description><![CDATA['!test' returned FALSE. ()]]></Description>
</Incident>
-<Incident type="fail" file="tst_datatable.cpp" line="173">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp" line="0">
<DataTag><![CDATA[fiveIsolatedFailures_data 5]]></DataTag>
<Description><![CDATA['!test' returned FALSE. ()]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="cleanupTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<Duration msecs="0"/>
</TestCase>
diff --git a/tests/auto/testlib/selftests/expected_datetime.lightxml b/tests/auto/testlib/selftests/expected_datetime.lightxml
index 1aeac37e42..c7c7758b8b 100644
--- a/tests/auto/testlib/selftests/expected_datetime.lightxml
+++ b/tests/auto/testlib/selftests/expected_datetime.lightxml
@@ -5,27 +5,27 @@
</Environment>
<TestFunction name="initTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="dateTime">
-<Incident type="fail" file="tst_datetime.cpp" line="65">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/datetime/tst_datetime.cpp" line="0">
<Description><![CDATA[Compared values are not the same
Actual (local): 2000/05/03 04:03:04.000[UTC+00:02]
Expected (utc) : 2000/05/03 04:03:04.000[UTC]]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="qurl">
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[empty urls]]></DataTag>
</Incident>
-<Incident type="fail" file="tst_datetime.cpp" line="73">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/datetime/tst_datetime.cpp" line="0">
<DataTag><![CDATA[empty rhs]]></DataTag>
<Description><![CDATA[Compared values are not the same
Actual (operandA): http://example.com
Expected (operandB): Invalid URL: ]]></Description>
</Incident>
-<Incident type="fail" file="tst_datetime.cpp" line="73">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/datetime/tst_datetime.cpp" line="0">
<DataTag><![CDATA[empty lhs]]></DataTag>
<Description><![CDATA[Compared values are not the same
Actual (operandA): Invalid URL:
@@ -34,10 +34,10 @@
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[same urls]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="cleanupTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<Duration msecs="0"/>
diff --git a/tests/auto/testlib/selftests/expected_datetime.teamcity b/tests/auto/testlib/selftests/expected_datetime.teamcity
index a2bc95cd2f..be5612eb0d 100644
--- a/tests/auto/testlib/selftests/expected_datetime.teamcity
+++ b/tests/auto/testlib/selftests/expected_datetime.teamcity
@@ -2,15 +2,15 @@
##teamcity[testStarted name='initTestCase()' flowId='tst_DateTime']
##teamcity[testFinished name='initTestCase()' flowId='tst_DateTime']
##teamcity[testStarted name='dateTime()' flowId='tst_DateTime']
-##teamcity[testFailed name='dateTime()' message='Failure! |[Loc: tst_datetime.cpp(57)|]' details='Compared values are not the same|n Actual (local): 2000/05/03 04:03:04.000|[UTC+00:02|]|n Expected (utc) : 2000/05/03 04:03:04.000|[UTC|]' flowId='tst_DateTime']
+##teamcity[testFailed name='dateTime()' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/datetime/tst_datetime.cpp(0)|]' details='Compared values are not the same|n Actual (local): 2000/05/03 04:03:04.000|[UTC+00:02|]|n Expected (utc) : 2000/05/03 04:03:04.000|[UTC|]' flowId='tst_DateTime']
##teamcity[testFinished name='dateTime()' flowId='tst_DateTime']
##teamcity[testStarted name='qurl(empty urls)' flowId='tst_DateTime']
##teamcity[testFinished name='qurl(empty urls)' flowId='tst_DateTime']
##teamcity[testStarted name='qurl(empty rhs)' flowId='tst_DateTime']
-##teamcity[testFailed name='qurl(empty rhs)' message='Failure! |[Loc: tst_datetime.cpp(65)|]' details='Compared values are not the same|n Actual (operandA): http://example.com|n Expected (operandB): Invalid URL:' flowId='tst_DateTime']
+##teamcity[testFailed name='qurl(empty rhs)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/datetime/tst_datetime.cpp(0)|]' details='Compared values are not the same|n Actual (operandA): http://example.com|n Expected (operandB): Invalid URL:' flowId='tst_DateTime']
##teamcity[testFinished name='qurl(empty rhs)' flowId='tst_DateTime']
##teamcity[testStarted name='qurl(empty lhs)' flowId='tst_DateTime']
-##teamcity[testFailed name='qurl(empty lhs)' message='Failure! |[Loc: tst_datetime.cpp(65)|]' details='Compared values are not the same|n Actual (operandA): Invalid URL: |n Expected (operandB): http://example.com' flowId='tst_DateTime']
+##teamcity[testFailed name='qurl(empty lhs)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/datetime/tst_datetime.cpp(0)|]' details='Compared values are not the same|n Actual (operandA): Invalid URL: |n Expected (operandB): http://example.com' flowId='tst_DateTime']
##teamcity[testFinished name='qurl(empty lhs)' flowId='tst_DateTime']
##teamcity[testStarted name='qurl(same urls)' flowId='tst_DateTime']
##teamcity[testFinished name='qurl(same urls)' flowId='tst_DateTime']
diff --git a/tests/auto/testlib/selftests/expected_datetime.txt b/tests/auto/testlib/selftests/expected_datetime.txt
index c29fa050a1..387e8e93a5 100644
--- a/tests/auto/testlib/selftests/expected_datetime.txt
+++ b/tests/auto/testlib/selftests/expected_datetime.txt
@@ -1,20 +1,20 @@
********* Start testing of tst_DateTime *********
-Config: Using QtTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@
+Config: Using QtTest library
PASS : tst_DateTime::initTestCase()
FAIL! : tst_DateTime::dateTime() Compared values are not the same
Actual (local): 2000/05/03 04:03:04.000[UTC+00:02]
Expected (utc) : 2000/05/03 04:03:04.000[UTC]
- Loc: [tst_datetime.cpp(65)]
+ Loc: [qtbase/tests/auto/testlib/selftests/datetime/tst_datetime.cpp(0)]
PASS : tst_DateTime::qurl(empty urls)
FAIL! : tst_DateTime::qurl(empty rhs) Compared values are not the same
Actual (operandA): http://example.com
Expected (operandB): Invalid URL:
- Loc: [tst_datetime.cpp(73)]
+ Loc: [qtbase/tests/auto/testlib/selftests/datetime/tst_datetime.cpp(0)]
FAIL! : tst_DateTime::qurl(empty lhs) Compared values are not the same
Actual (operandA): Invalid URL:
Expected (operandB): http://example.com
- Loc: [tst_datetime.cpp(73)]
+ Loc: [qtbase/tests/auto/testlib/selftests/datetime/tst_datetime.cpp(0)]
PASS : tst_DateTime::qurl(same urls)
PASS : tst_DateTime::cleanupTestCase()
-Totals: 4 passed, 3 failed, 0 skipped, 0 blacklisted
+Totals: 4 passed, 3 failed, 0 skipped, 0 blacklisted, 0ms
********* Finished testing of tst_DateTime *********
diff --git a/tests/auto/testlib/selftests/expected_datetime.xml b/tests/auto/testlib/selftests/expected_datetime.xml
index 4c5bb0525b..910388502a 100644
--- a/tests/auto/testlib/selftests/expected_datetime.xml
+++ b/tests/auto/testlib/selftests/expected_datetime.xml
@@ -7,27 +7,27 @@
</Environment>
<TestFunction name="initTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="dateTime">
-<Incident type="fail" file="tst_datetime.cpp" line="65">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/datetime/tst_datetime.cpp" line="0">
<Description><![CDATA[Compared values are not the same
Actual (local): 2000/05/03 04:03:04.000[UTC+00:02]
Expected (utc) : 2000/05/03 04:03:04.000[UTC]]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="qurl">
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[empty urls]]></DataTag>
</Incident>
-<Incident type="fail" file="tst_datetime.cpp" line="73">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/datetime/tst_datetime.cpp" line="0">
<DataTag><![CDATA[empty rhs]]></DataTag>
<Description><![CDATA[Compared values are not the same
Actual (operandA): http://example.com
Expected (operandB): Invalid URL: ]]></Description>
</Incident>
-<Incident type="fail" file="tst_datetime.cpp" line="73">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/datetime/tst_datetime.cpp" line="0">
<DataTag><![CDATA[empty lhs]]></DataTag>
<Description><![CDATA[Compared values are not the same
Actual (operandA): Invalid URL:
@@ -36,11 +36,11 @@
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[same urls]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="cleanupTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<Duration msecs="0"/>
</TestCase>
diff --git a/tests/auto/testlib/selftests/expected_differentexec.lightxml b/tests/auto/testlib/selftests/expected_differentexec.lightxml
new file mode 100644
index 0000000000..30ee50bc08
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_differentexec.lightxml
@@ -0,0 +1,21 @@
+********* Start testing of tst_TestA *********
+Config: Using QtTest library
+PASS : tst_TestA::initTestCase()
+PASS : tst_TestA::slotName()
+PASS : tst_TestA::cleanupTestCase()
+Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms
+********* Finished testing of tst_TestA *********
+********* Start testing of tst_TestA *********
+Config: Using QtTest library
+PASS : tst_TestA::initTestCase()
+PASS : tst_TestA::slotName()
+PASS : tst_TestA::cleanupTestCase()
+Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms
+********* Finished testing of tst_TestA *********
+********* Start testing of tst_TestB *********
+Config: Using QtTest library
+PASS : tst_TestB::initTestCase()
+PASS : tst_TestB::slotName()
+PASS : tst_TestB::cleanupTestCase()
+Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms
+********* Finished testing of tst_TestB *********
diff --git a/tests/auto/testlib/selftests/expected_differentexec.teamcity b/tests/auto/testlib/selftests/expected_differentexec.teamcity
new file mode 100644
index 0000000000..30ee50bc08
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_differentexec.teamcity
@@ -0,0 +1,21 @@
+********* Start testing of tst_TestA *********
+Config: Using QtTest library
+PASS : tst_TestA::initTestCase()
+PASS : tst_TestA::slotName()
+PASS : tst_TestA::cleanupTestCase()
+Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms
+********* Finished testing of tst_TestA *********
+********* Start testing of tst_TestA *********
+Config: Using QtTest library
+PASS : tst_TestA::initTestCase()
+PASS : tst_TestA::slotName()
+PASS : tst_TestA::cleanupTestCase()
+Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms
+********* Finished testing of tst_TestA *********
+********* Start testing of tst_TestB *********
+Config: Using QtTest library
+PASS : tst_TestB::initTestCase()
+PASS : tst_TestB::slotName()
+PASS : tst_TestB::cleanupTestCase()
+Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms
+********* Finished testing of tst_TestB *********
diff --git a/tests/auto/testlib/selftests/expected_differentexec.txt b/tests/auto/testlib/selftests/expected_differentexec.txt
index acaf556c9b..30ee50bc08 100644
--- a/tests/auto/testlib/selftests/expected_differentexec.txt
+++ b/tests/auto/testlib/selftests/expected_differentexec.txt
@@ -1,21 +1,21 @@
********* Start testing of tst_TestA *********
-Config: Using QtTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@
+Config: Using QtTest library
PASS : tst_TestA::initTestCase()
PASS : tst_TestA::slotName()
PASS : tst_TestA::cleanupTestCase()
-Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted
+Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms
********* Finished testing of tst_TestA *********
********* Start testing of tst_TestA *********
-Config: Using QtTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@
+Config: Using QtTest library
PASS : tst_TestA::initTestCase()
PASS : tst_TestA::slotName()
PASS : tst_TestA::cleanupTestCase()
-Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted
+Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms
********* Finished testing of tst_TestA *********
********* Start testing of tst_TestB *********
-Config: Using QtTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@
+Config: Using QtTest library
PASS : tst_TestB::initTestCase()
PASS : tst_TestB::slotName()
PASS : tst_TestB::cleanupTestCase()
-Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted
+Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms
********* Finished testing of tst_TestB *********
diff --git a/tests/auto/testlib/selftests/expected_differentexec.xml b/tests/auto/testlib/selftests/expected_differentexec.xml
new file mode 100644
index 0000000000..30ee50bc08
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_differentexec.xml
@@ -0,0 +1,21 @@
+********* Start testing of tst_TestA *********
+Config: Using QtTest library
+PASS : tst_TestA::initTestCase()
+PASS : tst_TestA::slotName()
+PASS : tst_TestA::cleanupTestCase()
+Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms
+********* Finished testing of tst_TestA *********
+********* Start testing of tst_TestA *********
+Config: Using QtTest library
+PASS : tst_TestA::initTestCase()
+PASS : tst_TestA::slotName()
+PASS : tst_TestA::cleanupTestCase()
+Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms
+********* Finished testing of tst_TestA *********
+********* Start testing of tst_TestB *********
+Config: Using QtTest library
+PASS : tst_TestB::initTestCase()
+PASS : tst_TestB::slotName()
+PASS : tst_TestB::cleanupTestCase()
+Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms
+********* Finished testing of tst_TestB *********
diff --git a/tests/auto/testlib/selftests/expected_differentexec.xunitxml b/tests/auto/testlib/selftests/expected_differentexec.xunitxml
new file mode 100644
index 0000000000..30ee50bc08
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_differentexec.xunitxml
@@ -0,0 +1,21 @@
+********* Start testing of tst_TestA *********
+Config: Using QtTest library
+PASS : tst_TestA::initTestCase()
+PASS : tst_TestA::slotName()
+PASS : tst_TestA::cleanupTestCase()
+Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms
+********* Finished testing of tst_TestA *********
+********* Start testing of tst_TestA *********
+Config: Using QtTest library
+PASS : tst_TestA::initTestCase()
+PASS : tst_TestA::slotName()
+PASS : tst_TestA::cleanupTestCase()
+Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms
+********* Finished testing of tst_TestA *********
+********* Start testing of tst_TestB *********
+Config: Using QtTest library
+PASS : tst_TestB::initTestCase()
+PASS : tst_TestB::slotName()
+PASS : tst_TestB::cleanupTestCase()
+Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms
+********* Finished testing of tst_TestB *********
diff --git a/tests/auto/testlib/selftests/expected_exceptionthrow.lightxml b/tests/auto/testlib/selftests/expected_exceptionthrow.lightxml
index 2b802aabaf..aadc1a3cb8 100644
--- a/tests/auto/testlib/selftests/expected_exceptionthrow.lightxml
+++ b/tests/auto/testlib/selftests/expected_exceptionthrow.lightxml
@@ -5,12 +5,12 @@
</Environment>
<TestFunction name="initTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="throwException">
-<Incident type="fail" file="qtestcase.cpp" line="2235">
+<Incident type="fail" file="qtbase/src/testlib/qtestcase.cpp" line="0">
<Description><![CDATA[Caught unhandled exception]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<Duration msecs="0"/>
diff --git a/tests/auto/testlib/selftests/expected_exceptionthrow.teamcity b/tests/auto/testlib/selftests/expected_exceptionthrow.teamcity
index 3bc7271b65..120dc006b9 100644
--- a/tests/auto/testlib/selftests/expected_exceptionthrow.teamcity
+++ b/tests/auto/testlib/selftests/expected_exceptionthrow.teamcity
@@ -2,6 +2,6 @@
##teamcity[testStarted name='initTestCase()' flowId='tst_Exception']
##teamcity[testFinished name='initTestCase()' flowId='tst_Exception']
##teamcity[testStarted name='throwException()' flowId='tst_Exception']
-##teamcity[testFailed name='throwException()' message='Failure! |[Loc: qtestcase.cpp(1707)|]' details='Caught unhandled exception' flowId='tst_Exception']
+##teamcity[testFailed name='throwException()' message='Failure! |[Loc: qtbase/src/testlib/qtestcase.cpp(0)|]' details='Caught unhandled exception' flowId='tst_Exception']
##teamcity[testFinished name='throwException()' flowId='tst_Exception']
##teamcity[testSuiteFinished name='tst_Exception' flowId='tst_Exception']
diff --git a/tests/auto/testlib/selftests/expected_exceptionthrow.txt b/tests/auto/testlib/selftests/expected_exceptionthrow.txt
index bb9c101709..8911a60fc2 100644
--- a/tests/auto/testlib/selftests/expected_exceptionthrow.txt
+++ b/tests/auto/testlib/selftests/expected_exceptionthrow.txt
@@ -1,7 +1,7 @@
********* Start testing of tst_Exception *********
-Config: Using QtTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@
+Config: Using QtTest library
PASS : tst_Exception::initTestCase()
FAIL! : tst_Exception::throwException() Caught unhandled exception
- Loc: [/home/frederik/dev/qt/qt-src-dev/qtbase/src/testlib/qtestcase.cpp(2229)]
-Totals: 1 passed, 1 failed, 0 skipped, 0 blacklisted
+ Loc: [qtbase/src/testlib/qtestcase.cpp(0)]
+Totals: 1 passed, 1 failed, 0 skipped, 0 blacklisted, 0ms
********* Finished testing of tst_Exception *********
diff --git a/tests/auto/testlib/selftests/expected_exceptionthrow.xml b/tests/auto/testlib/selftests/expected_exceptionthrow.xml
index a265d5ba5f..8adc1bf87d 100644
--- a/tests/auto/testlib/selftests/expected_exceptionthrow.xml
+++ b/tests/auto/testlib/selftests/expected_exceptionthrow.xml
@@ -7,13 +7,13 @@
</Environment>
<TestFunction name="initTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="throwException">
-<Incident type="fail" file="qtestcase.cpp" line="2235">
+<Incident type="fail" file="qtbase/src/testlib/qtestcase.cpp" line="0">
<Description><![CDATA[Caught unhandled exception]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<Duration msecs="0"/>
</TestCase>
diff --git a/tests/auto/testlib/selftests/expected_expectfail.lightxml b/tests/auto/testlib/selftests/expected_expectfail.lightxml
index cd5ab78fbe..7c91656b89 100644
--- a/tests/auto/testlib/selftests/expected_expectfail.lightxml
+++ b/tests/auto/testlib/selftests/expected_expectfail.lightxml
@@ -5,46 +5,46 @@
</Environment>
<TestFunction name="initTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="xfailAndContinue">
<Message type="qdebug" file="" line="0">
<Description><![CDATA[begin]]></Description>
</Message>
-<Incident type="xfail" file="tst_expectfail.cpp" line="78">
+<Incident type="xfail" file="qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="0">
<Description><![CDATA[This should xfail]]></Description>
</Incident>
<Message type="qdebug" file="" line="0">
<Description><![CDATA[after]]></Description>
</Message>
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="xfailAndAbort">
<Message type="qdebug" file="" line="0">
<Description><![CDATA[begin]]></Description>
</Message>
-<Incident type="xfail" file="tst_expectfail.cpp" line="86">
+<Incident type="xfail" file="qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="0">
<Description><![CDATA[This should xfail]]></Description>
</Incident>
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="xfailTwice">
-<Incident type="fail" file="tst_expectfail.cpp" line="96">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="0">
<Description><![CDATA[Already expecting a fail]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="xfailWithQString">
-<Incident type="xfail" file="tst_expectfail.cpp" line="105">
+<Incident type="xfail" file="qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="0">
<Description><![CDATA[A string]]></Description>
</Incident>
-<Incident type="xfail" file="tst_expectfail.cpp" line="110">
+<Incident type="xfail" file="qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="0">
<Description><![CDATA[Bug 5 (The message)]]></Description>
</Incident>
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="xfailDataDrivenWithQVerify">
<Incident type="pass" file="" line="0">
@@ -53,21 +53,21 @@
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[Pass 2]]></DataTag>
</Incident>
-<Incident type="xfail" file="tst_expectfail.cpp" line="139">
+<Incident type="xfail" file="qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="0">
<DataTag><![CDATA[Abort]]></DataTag>
<Description><![CDATA[This test should xfail]]></Description>
</Incident>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[Abort]]></DataTag>
</Incident>
-<Incident type="xfail" file="tst_expectfail.cpp" line="139">
+<Incident type="xfail" file="qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="0">
<DataTag><![CDATA[Continue]]></DataTag>
<Description><![CDATA[This test should xfail]]></Description>
</Incident>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[Continue]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="xfailDataDrivenWithQCompare">
<Incident type="pass" file="" line="0">
@@ -76,44 +76,44 @@
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[Pass 2]]></DataTag>
</Incident>
-<Incident type="xfail" file="tst_expectfail.cpp" line="173">
+<Incident type="xfail" file="qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="0">
<DataTag><![CDATA[Abort]]></DataTag>
<Description><![CDATA[This test should xfail]]></Description>
</Incident>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[Abort]]></DataTag>
</Incident>
-<Incident type="xfail" file="tst_expectfail.cpp" line="173">
+<Incident type="xfail" file="qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="0">
<DataTag><![CDATA[Continue]]></DataTag>
<Description><![CDATA[This test should xfail]]></Description>
</Incident>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[Continue]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="xfailOnWrongRow">
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[right row]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="xfailOnAnyRow">
-<Incident type="xfail" file="tst_expectfail.cpp" line="208">
+<Incident type="xfail" file="qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="0">
<DataTag><![CDATA[first row]]></DataTag>
<Description><![CDATA[This test should xfail]]></Description>
</Incident>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[first row]]></DataTag>
</Incident>
-<Incident type="xfail" file="tst_expectfail.cpp" line="208">
+<Incident type="xfail" file="qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="0">
<DataTag><![CDATA[second row]]></DataTag>
<Description><![CDATA[This test should xfail]]></Description>
</Incident>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[second row]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="xfailWithoutVerify">
<Incident type="fail" file="" line="0">
@@ -124,36 +124,36 @@
<DataTag><![CDATA[second row]]></DataTag>
<Description><![CDATA[QEXPECT_FAIL was called without any subsequent verification statements]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="xpass">
-<Incident type="xpass" file="tst_expectfail.cpp" line="228">
+<Incident type="xpass" file="qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="0">
<Description><![CDATA['true' returned TRUE unexpectedly. ()]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="xpassDataDrivenWithQVerify">
-<Incident type="xpass" file="tst_expectfail.cpp" line="250">
+<Incident type="xpass" file="qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="0">
<DataTag><![CDATA[XPass]]></DataTag>
<Description><![CDATA['true' returned TRUE unexpectedly. ()]]></Description>
</Incident>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[Pass]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="xpassDataDrivenWithQCompare">
-<Incident type="xpass" file="tst_expectfail.cpp" line="271">
+<Incident type="xpass" file="qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="0">
<DataTag><![CDATA[XPass]]></DataTag>
<Description><![CDATA[QCOMPARE(1, 1) returned TRUE unexpectedly.]]></Description>
</Incident>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[Pass]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="cleanupTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<Duration msecs="0"/>
diff --git a/tests/auto/testlib/selftests/expected_expectfail.teamcity b/tests/auto/testlib/selftests/expected_expectfail.teamcity
index 29546c1cee..cac2c34491 100644
--- a/tests/auto/testlib/selftests/expected_expectfail.teamcity
+++ b/tests/auto/testlib/selftests/expected_expectfail.teamcity
@@ -2,44 +2,44 @@
##teamcity[testStarted name='initTestCase()' flowId='tst_ExpectFail']
##teamcity[testFinished name='initTestCase()' flowId='tst_ExpectFail']
##teamcity[testStarted name='xfailAndContinue()' flowId='tst_ExpectFail']
-##teamcity[testStdOut name='xfailAndContinue()' out='QDEBUG: begin|nXFAIL |[Loc: tst_expectfail.cpp(70)|]: This should xfail|nQDEBUG: after' flowId='tst_ExpectFail']
+##teamcity[testStdOut name='xfailAndContinue()' out='QDEBUG: begin|nXFAIL |[Loc: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(0)|]: This should xfail|nQDEBUG: after' flowId='tst_ExpectFail']
##teamcity[testFinished name='xfailAndContinue()' flowId='tst_ExpectFail']
##teamcity[testStarted name='xfailAndAbort()' flowId='tst_ExpectFail']
-##teamcity[testStdOut name='xfailAndAbort()' out='QDEBUG: begin|nXFAIL |[Loc: tst_expectfail.cpp(78)|]: This should xfail' flowId='tst_ExpectFail']
+##teamcity[testStdOut name='xfailAndAbort()' out='QDEBUG: begin|nXFAIL |[Loc: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(0)|]: This should xfail' flowId='tst_ExpectFail']
##teamcity[testFinished name='xfailAndAbort()' flowId='tst_ExpectFail']
##teamcity[testStarted name='xfailTwice()' flowId='tst_ExpectFail']
-##teamcity[testFailed name='xfailTwice()' message='Failure! |[Loc: tst_expectfail.cpp(88)|]' details='Already expecting a fail' flowId='tst_ExpectFail']
+##teamcity[testFailed name='xfailTwice()' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(0)|]' details='Already expecting a fail' flowId='tst_ExpectFail']
##teamcity[testFinished name='xfailTwice()' flowId='tst_ExpectFail']
##teamcity[testStarted name='xfailWithQString()' flowId='tst_ExpectFail']
-##teamcity[testStdOut name='xfailWithQString()' out='XFAIL |[Loc: tst_expectfail.cpp(97)|]: A string|nXFAIL |[Loc: tst_expectfail.cpp(102)|]: Bug 5 (The message)' flowId='tst_ExpectFail']
+##teamcity[testStdOut name='xfailWithQString()' out='XFAIL |[Loc: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(0)|]: A string|nXFAIL |[Loc: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(0)|]: Bug 5 (The message)' flowId='tst_ExpectFail']
##teamcity[testFinished name='xfailWithQString()' flowId='tst_ExpectFail']
##teamcity[testStarted name='xfailDataDrivenWithQVerify(Pass 1)' flowId='tst_ExpectFail']
##teamcity[testFinished name='xfailDataDrivenWithQVerify(Pass 1)' flowId='tst_ExpectFail']
##teamcity[testStarted name='xfailDataDrivenWithQVerify(Pass 2)' flowId='tst_ExpectFail']
##teamcity[testFinished name='xfailDataDrivenWithQVerify(Pass 2)' flowId='tst_ExpectFail']
##teamcity[testStarted name='xfailDataDrivenWithQVerify(Abort)' flowId='tst_ExpectFail']
-##teamcity[testStdOut name='xfailDataDrivenWithQVerify(Abort)' out='XFAIL |[Loc: tst_expectfail.cpp(131)|]: This test should xfail' flowId='tst_ExpectFail']
+##teamcity[testStdOut name='xfailDataDrivenWithQVerify(Abort)' out='XFAIL |[Loc: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(0)|]: This test should xfail' flowId='tst_ExpectFail']
##teamcity[testFinished name='xfailDataDrivenWithQVerify(Abort)' flowId='tst_ExpectFail']
##teamcity[testStarted name='xfailDataDrivenWithQVerify(Continue)' flowId='tst_ExpectFail']
-##teamcity[testStdOut name='xfailDataDrivenWithQVerify(Continue)' out='XFAIL |[Loc: tst_expectfail.cpp(131)|]: This test should xfail' flowId='tst_ExpectFail']
+##teamcity[testStdOut name='xfailDataDrivenWithQVerify(Continue)' out='XFAIL |[Loc: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(0)|]: This test should xfail' flowId='tst_ExpectFail']
##teamcity[testFinished name='xfailDataDrivenWithQVerify(Continue)' flowId='tst_ExpectFail']
##teamcity[testStarted name='xfailDataDrivenWithQCompare(Pass 1)' flowId='tst_ExpectFail']
##teamcity[testFinished name='xfailDataDrivenWithQCompare(Pass 1)' flowId='tst_ExpectFail']
##teamcity[testStarted name='xfailDataDrivenWithQCompare(Pass 2)' flowId='tst_ExpectFail']
##teamcity[testFinished name='xfailDataDrivenWithQCompare(Pass 2)' flowId='tst_ExpectFail']
##teamcity[testStarted name='xfailDataDrivenWithQCompare(Abort)' flowId='tst_ExpectFail']
-##teamcity[testStdOut name='xfailDataDrivenWithQCompare(Abort)' out='XFAIL |[Loc: tst_expectfail.cpp(165)|]: This test should xfail' flowId='tst_ExpectFail']
+##teamcity[testStdOut name='xfailDataDrivenWithQCompare(Abort)' out='XFAIL |[Loc: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(0)|]: This test should xfail' flowId='tst_ExpectFail']
##teamcity[testFinished name='xfailDataDrivenWithQCompare(Abort)' flowId='tst_ExpectFail']
##teamcity[testStarted name='xfailDataDrivenWithQCompare(Continue)' flowId='tst_ExpectFail']
-##teamcity[testStdOut name='xfailDataDrivenWithQCompare(Continue)' out='XFAIL |[Loc: tst_expectfail.cpp(165)|]: This test should xfail' flowId='tst_ExpectFail']
+##teamcity[testStdOut name='xfailDataDrivenWithQCompare(Continue)' out='XFAIL |[Loc: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(0)|]: This test should xfail' flowId='tst_ExpectFail']
##teamcity[testFinished name='xfailDataDrivenWithQCompare(Continue)' flowId='tst_ExpectFail']
##teamcity[testStarted name='xfailOnWrongRow(right row)' flowId='tst_ExpectFail']
##teamcity[testFinished name='xfailOnWrongRow(right row)' flowId='tst_ExpectFail']
##teamcity[testStarted name='xfailOnAnyRow(first row)' flowId='tst_ExpectFail']
-##teamcity[testStdOut name='xfailOnAnyRow(first row)' out='XFAIL |[Loc: tst_expectfail.cpp(200)|]: This test should xfail' flowId='tst_ExpectFail']
+##teamcity[testStdOut name='xfailOnAnyRow(first row)' out='XFAIL |[Loc: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(0)|]: This test should xfail' flowId='tst_ExpectFail']
##teamcity[testFinished name='xfailOnAnyRow(first row)' flowId='tst_ExpectFail']
##teamcity[testStarted name='xfailOnAnyRow(second row)' flowId='tst_ExpectFail']
-##teamcity[testStdOut name='xfailOnAnyRow(second row)' out='XFAIL |[Loc: tst_expectfail.cpp(200)|]: This test should xfail' flowId='tst_ExpectFail']
+##teamcity[testStdOut name='xfailOnAnyRow(second row)' out='XFAIL |[Loc: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(0)|]: This test should xfail' flowId='tst_ExpectFail']
##teamcity[testFinished name='xfailOnAnyRow(second row)' flowId='tst_ExpectFail']
##teamcity[testStarted name='xfailWithoutVerify(first row)' flowId='tst_ExpectFail']
##teamcity[testFailed name='xfailWithoutVerify(first row)' message='Failure!' details='QEXPECT_FAIL was called without any subsequent verification statements' flowId='tst_ExpectFail']
@@ -48,15 +48,15 @@
##teamcity[testFailed name='xfailWithoutVerify(second row)' message='Failure!' details='QEXPECT_FAIL was called without any subsequent verification statements' flowId='tst_ExpectFail']
##teamcity[testFinished name='xfailWithoutVerify(second row)' flowId='tst_ExpectFail']
##teamcity[testStarted name='xpass()' flowId='tst_ExpectFail']
-##teamcity[testFailed name='xpass()' message='Failure! |[Loc: tst_expectfail.cpp(220)|]' details='|'true|' returned TRUE unexpectedly. ()' flowId='tst_ExpectFail']
+##teamcity[testFailed name='xpass()' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(0)|]' details='|'true|' returned TRUE unexpectedly. ()' flowId='tst_ExpectFail']
##teamcity[testFinished name='xpass()' flowId='tst_ExpectFail']
##teamcity[testStarted name='xpassDataDrivenWithQVerify(XPass)' flowId='tst_ExpectFail']
-##teamcity[testFailed name='xpassDataDrivenWithQVerify(XPass)' message='Failure! |[Loc: tst_expectfail.cpp(242)|]' details='|'true|' returned TRUE unexpectedly. ()' flowId='tst_ExpectFail']
+##teamcity[testFailed name='xpassDataDrivenWithQVerify(XPass)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(0)|]' details='|'true|' returned TRUE unexpectedly. ()' flowId='tst_ExpectFail']
##teamcity[testFinished name='xpassDataDrivenWithQVerify(XPass)' flowId='tst_ExpectFail']
##teamcity[testStarted name='xpassDataDrivenWithQVerify(Pass)' flowId='tst_ExpectFail']
##teamcity[testFinished name='xpassDataDrivenWithQVerify(Pass)' flowId='tst_ExpectFail']
##teamcity[testStarted name='xpassDataDrivenWithQCompare(XPass)' flowId='tst_ExpectFail']
-##teamcity[testFailed name='xpassDataDrivenWithQCompare(XPass)' message='Failure! |[Loc: tst_expectfail.cpp(263)|]' details='QCOMPARE(1, 1) returned TRUE unexpectedly.' flowId='tst_ExpectFail']
+##teamcity[testFailed name='xpassDataDrivenWithQCompare(XPass)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(0)|]' details='QCOMPARE(1, 1) returned TRUE unexpectedly.' flowId='tst_ExpectFail']
##teamcity[testFinished name='xpassDataDrivenWithQCompare(XPass)' flowId='tst_ExpectFail']
##teamcity[testStarted name='xpassDataDrivenWithQCompare(Pass)' flowId='tst_ExpectFail']
##teamcity[testFinished name='xpassDataDrivenWithQCompare(Pass)' flowId='tst_ExpectFail']
diff --git a/tests/auto/testlib/selftests/expected_expectfail.txt b/tests/auto/testlib/selftests/expected_expectfail.txt
index a23b845f23..75d41e5733 100644
--- a/tests/auto/testlib/selftests/expected_expectfail.txt
+++ b/tests/auto/testlib/selftests/expected_expectfail.txt
@@ -1,55 +1,55 @@
********* Start testing of tst_ExpectFail *********
-Config: Using QtTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@
+Config: Using QtTest library
PASS : tst_ExpectFail::initTestCase()
QDEBUG : tst_ExpectFail::xfailAndContinue() begin
XFAIL : tst_ExpectFail::xfailAndContinue() This should xfail
- Loc: [tst_expectfail.cpp(78)]
+ Loc: [qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(0)]
QDEBUG : tst_ExpectFail::xfailAndContinue() after
PASS : tst_ExpectFail::xfailAndContinue()
QDEBUG : tst_ExpectFail::xfailAndAbort() begin
XFAIL : tst_ExpectFail::xfailAndAbort() This should xfail
- Loc: [tst_expectfail.cpp(86)]
+ Loc: [qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(0)]
PASS : tst_ExpectFail::xfailAndAbort()
FAIL! : tst_ExpectFail::xfailTwice() Already expecting a fail
- Loc: [tst_expectfail.cpp(96)]
+ Loc: [qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(0)]
XFAIL : tst_ExpectFail::xfailWithQString() A string
- Loc: [tst_expectfail.cpp(105)]
+ Loc: [qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(0)]
XFAIL : tst_ExpectFail::xfailWithQString() Bug 5 (The message)
- Loc: [tst_expectfail.cpp(110)]
+ Loc: [qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(0)]
PASS : tst_ExpectFail::xfailWithQString()
PASS : tst_ExpectFail::xfailDataDrivenWithQVerify(Pass 1)
PASS : tst_ExpectFail::xfailDataDrivenWithQVerify(Pass 2)
XFAIL : tst_ExpectFail::xfailDataDrivenWithQVerify(Abort) This test should xfail
- Loc: [tst_expectfail.cpp(139)]
+ Loc: [qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(0)]
PASS : tst_ExpectFail::xfailDataDrivenWithQVerify(Abort)
XFAIL : tst_ExpectFail::xfailDataDrivenWithQVerify(Continue) This test should xfail
- Loc: [tst_expectfail.cpp(139)]
+ Loc: [qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(0)]
PASS : tst_ExpectFail::xfailDataDrivenWithQVerify(Continue)
PASS : tst_ExpectFail::xfailDataDrivenWithQCompare(Pass 1)
PASS : tst_ExpectFail::xfailDataDrivenWithQCompare(Pass 2)
XFAIL : tst_ExpectFail::xfailDataDrivenWithQCompare(Abort) This test should xfail
- Loc: [tst_expectfail.cpp(173)]
+ Loc: [qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(0)]
PASS : tst_ExpectFail::xfailDataDrivenWithQCompare(Abort)
XFAIL : tst_ExpectFail::xfailDataDrivenWithQCompare(Continue) This test should xfail
- Loc: [tst_expectfail.cpp(173)]
+ Loc: [qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(0)]
PASS : tst_ExpectFail::xfailDataDrivenWithQCompare(Continue)
PASS : tst_ExpectFail::xfailOnWrongRow(right row)
XFAIL : tst_ExpectFail::xfailOnAnyRow(first row) This test should xfail
- Loc: [tst_expectfail.cpp(208)]
+ Loc: [qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(0)]
PASS : tst_ExpectFail::xfailOnAnyRow(first row)
XFAIL : tst_ExpectFail::xfailOnAnyRow(second row) This test should xfail
- Loc: [tst_expectfail.cpp(208)]
+ Loc: [qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(0)]
PASS : tst_ExpectFail::xfailOnAnyRow(second row)
FAIL! : tst_ExpectFail::xfailWithoutVerify(first row) QEXPECT_FAIL was called without any subsequent verification statements
FAIL! : tst_ExpectFail::xfailWithoutVerify(second row) QEXPECT_FAIL was called without any subsequent verification statements
XPASS : tst_ExpectFail::xpass() 'true' returned TRUE unexpectedly. ()
- Loc: [tst_expectfail.cpp(228)]
+ Loc: [qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(0)]
XPASS : tst_ExpectFail::xpassDataDrivenWithQVerify(XPass) 'true' returned TRUE unexpectedly. ()
- Loc: [tst_expectfail.cpp(250)]
+ Loc: [qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(0)]
PASS : tst_ExpectFail::xpassDataDrivenWithQVerify(Pass)
XPASS : tst_ExpectFail::xpassDataDrivenWithQCompare(XPass) QCOMPARE(1, 1) returned TRUE unexpectedly.
- Loc: [tst_expectfail.cpp(271)]
+ Loc: [qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(0)]
PASS : tst_ExpectFail::xpassDataDrivenWithQCompare(Pass)
PASS : tst_ExpectFail::cleanupTestCase()
-Totals: 18 passed, 6 failed, 0 skipped, 0 blacklisted
+Totals: 18 passed, 6 failed, 0 skipped, 0 blacklisted, 0ms
********* Finished testing of tst_ExpectFail *********
diff --git a/tests/auto/testlib/selftests/expected_expectfail.xml b/tests/auto/testlib/selftests/expected_expectfail.xml
index a98b97810c..ccfd942c92 100644
--- a/tests/auto/testlib/selftests/expected_expectfail.xml
+++ b/tests/auto/testlib/selftests/expected_expectfail.xml
@@ -7,46 +7,46 @@
</Environment>
<TestFunction name="initTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="xfailAndContinue">
<Message type="qdebug" file="" line="0">
<Description><![CDATA[begin]]></Description>
</Message>
-<Incident type="xfail" file="tst_expectfail.cpp" line="78">
+<Incident type="xfail" file="qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="0">
<Description><![CDATA[This should xfail]]></Description>
</Incident>
<Message type="qdebug" file="" line="0">
<Description><![CDATA[after]]></Description>
</Message>
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="xfailAndAbort">
<Message type="qdebug" file="" line="0">
<Description><![CDATA[begin]]></Description>
</Message>
-<Incident type="xfail" file="tst_expectfail.cpp" line="86">
+<Incident type="xfail" file="qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="0">
<Description><![CDATA[This should xfail]]></Description>
</Incident>
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="xfailTwice">
-<Incident type="fail" file="tst_expectfail.cpp" line="96">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="0">
<Description><![CDATA[Already expecting a fail]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="xfailWithQString">
-<Incident type="xfail" file="tst_expectfail.cpp" line="105">
+<Incident type="xfail" file="qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="0">
<Description><![CDATA[A string]]></Description>
</Incident>
-<Incident type="xfail" file="tst_expectfail.cpp" line="110">
+<Incident type="xfail" file="qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="0">
<Description><![CDATA[Bug 5 (The message)]]></Description>
</Incident>
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="xfailDataDrivenWithQVerify">
<Incident type="pass" file="" line="0">
@@ -55,21 +55,21 @@
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[Pass 2]]></DataTag>
</Incident>
-<Incident type="xfail" file="tst_expectfail.cpp" line="139">
+<Incident type="xfail" file="qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="0">
<DataTag><![CDATA[Abort]]></DataTag>
<Description><![CDATA[This test should xfail]]></Description>
</Incident>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[Abort]]></DataTag>
</Incident>
-<Incident type="xfail" file="tst_expectfail.cpp" line="139">
+<Incident type="xfail" file="qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="0">
<DataTag><![CDATA[Continue]]></DataTag>
<Description><![CDATA[This test should xfail]]></Description>
</Incident>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[Continue]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="xfailDataDrivenWithQCompare">
<Incident type="pass" file="" line="0">
@@ -78,44 +78,44 @@
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[Pass 2]]></DataTag>
</Incident>
-<Incident type="xfail" file="tst_expectfail.cpp" line="173">
+<Incident type="xfail" file="qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="0">
<DataTag><![CDATA[Abort]]></DataTag>
<Description><![CDATA[This test should xfail]]></Description>
</Incident>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[Abort]]></DataTag>
</Incident>
-<Incident type="xfail" file="tst_expectfail.cpp" line="173">
+<Incident type="xfail" file="qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="0">
<DataTag><![CDATA[Continue]]></DataTag>
<Description><![CDATA[This test should xfail]]></Description>
</Incident>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[Continue]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="xfailOnWrongRow">
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[right row]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="xfailOnAnyRow">
-<Incident type="xfail" file="tst_expectfail.cpp" line="208">
+<Incident type="xfail" file="qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="0">
<DataTag><![CDATA[first row]]></DataTag>
<Description><![CDATA[This test should xfail]]></Description>
</Incident>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[first row]]></DataTag>
</Incident>
-<Incident type="xfail" file="tst_expectfail.cpp" line="208">
+<Incident type="xfail" file="qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="0">
<DataTag><![CDATA[second row]]></DataTag>
<Description><![CDATA[This test should xfail]]></Description>
</Incident>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[second row]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="xfailWithoutVerify">
<Incident type="fail" file="" line="0">
@@ -126,37 +126,37 @@
<DataTag><![CDATA[second row]]></DataTag>
<Description><![CDATA[QEXPECT_FAIL was called without any subsequent verification statements]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="xpass">
-<Incident type="xpass" file="tst_expectfail.cpp" line="228">
+<Incident type="xpass" file="qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="0">
<Description><![CDATA['true' returned TRUE unexpectedly. ()]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="xpassDataDrivenWithQVerify">
-<Incident type="xpass" file="tst_expectfail.cpp" line="250">
+<Incident type="xpass" file="qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="0">
<DataTag><![CDATA[XPass]]></DataTag>
<Description><![CDATA['true' returned TRUE unexpectedly. ()]]></Description>
</Incident>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[Pass]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="xpassDataDrivenWithQCompare">
-<Incident type="xpass" file="tst_expectfail.cpp" line="271">
+<Incident type="xpass" file="qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="0">
<DataTag><![CDATA[XPass]]></DataTag>
<Description><![CDATA[QCOMPARE(1, 1) returned TRUE unexpectedly.]]></Description>
</Incident>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[Pass]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="cleanupTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<Duration msecs="0"/>
</TestCase>
diff --git a/tests/auto/testlib/selftests/expected_failcleanup.lightxml b/tests/auto/testlib/selftests/expected_failcleanup.lightxml
index b2db64c4e2..c6484111d3 100644
--- a/tests/auto/testlib/selftests/expected_failcleanup.lightxml
+++ b/tests/auto/testlib/selftests/expected_failcleanup.lightxml
@@ -5,16 +5,16 @@
</Environment>
<TestFunction name="initTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="aTestFunction">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="cleanupTestCase">
-<Incident type="fail" file="tst_failcleanup.cpp" line="59">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/failcleanup/tst_failcleanup.cpp" line="0">
<Description><![CDATA['false' returned FALSE. (Fail inside cleanupTestCase)]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<Duration msecs="0"/>
diff --git a/tests/auto/testlib/selftests/expected_failcleanup.teamcity b/tests/auto/testlib/selftests/expected_failcleanup.teamcity
index ecd15b7483..1f8d353581 100644
--- a/tests/auto/testlib/selftests/expected_failcleanup.teamcity
+++ b/tests/auto/testlib/selftests/expected_failcleanup.teamcity
@@ -4,6 +4,6 @@
##teamcity[testStarted name='aTestFunction()' flowId='tst_FailCleanup']
##teamcity[testFinished name='aTestFunction()' flowId='tst_FailCleanup']
##teamcity[testStarted name='cleanupTestCase()' flowId='tst_FailCleanup']
-##teamcity[testFailed name='cleanupTestCase()' message='Failure! |[Loc: tst_failcleanup.cpp(51)|]' details='|'false|' returned FALSE. (Fail inside cleanupTestCase)' flowId='tst_FailCleanup']
+##teamcity[testFailed name='cleanupTestCase()' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/failcleanup/tst_failcleanup.cpp(0)|]' details='|'false|' returned FALSE. (Fail inside cleanupTestCase)' flowId='tst_FailCleanup']
##teamcity[testFinished name='cleanupTestCase()' flowId='tst_FailCleanup']
##teamcity[testSuiteFinished name='tst_FailCleanup' flowId='tst_FailCleanup']
diff --git a/tests/auto/testlib/selftests/expected_failcleanup.txt b/tests/auto/testlib/selftests/expected_failcleanup.txt
index 4fb877429e..a5776e59bf 100644
--- a/tests/auto/testlib/selftests/expected_failcleanup.txt
+++ b/tests/auto/testlib/selftests/expected_failcleanup.txt
@@ -1,8 +1,8 @@
********* Start testing of tst_FailCleanup *********
-Config: Using QtTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@
+Config: Using QtTest library
PASS : tst_FailCleanup::initTestCase()
PASS : tst_FailCleanup::aTestFunction()
FAIL! : tst_FailCleanup::cleanupTestCase() 'false' returned FALSE. (Fail inside cleanupTestCase)
- Loc: [tst_failcleanup.cpp(59)]
-Totals: 2 passed, 1 failed, 0 skipped, 0 blacklisted
+ Loc: [qtbase/tests/auto/testlib/selftests/failcleanup/tst_failcleanup.cpp(0)]
+Totals: 2 passed, 1 failed, 0 skipped, 0 blacklisted, 0ms
********* Finished testing of tst_FailCleanup *********
diff --git a/tests/auto/testlib/selftests/expected_failcleanup.xml b/tests/auto/testlib/selftests/expected_failcleanup.xml
index 476e56c4f4..bb0502983c 100644
--- a/tests/auto/testlib/selftests/expected_failcleanup.xml
+++ b/tests/auto/testlib/selftests/expected_failcleanup.xml
@@ -7,17 +7,17 @@
</Environment>
<TestFunction name="initTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="aTestFunction">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="cleanupTestCase">
-<Incident type="fail" file="tst_failcleanup.cpp" line="59">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/failcleanup/tst_failcleanup.cpp" line="0">
<Description><![CDATA['false' returned FALSE. (Fail inside cleanupTestCase)]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<Duration msecs="0"/>
</TestCase>
diff --git a/tests/auto/testlib/selftests/expected_failinit.lightxml b/tests/auto/testlib/selftests/expected_failinit.lightxml
index 5a940fc36b..663aa5c3dd 100644
--- a/tests/auto/testlib/selftests/expected_failinit.lightxml
+++ b/tests/auto/testlib/selftests/expected_failinit.lightxml
@@ -4,13 +4,13 @@
<QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion>
</Environment>
<TestFunction name="initTestCase">
-<Incident type="fail" file="tst_failinit.cpp" line="55">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/failinit/tst_failinit.cpp" line="0">
<Description><![CDATA['false' returned FALSE. ()]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="cleanupTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<Duration msecs="0"/>
diff --git a/tests/auto/testlib/selftests/expected_failinit.teamcity b/tests/auto/testlib/selftests/expected_failinit.teamcity
index 49972c7aa2..78a4c8bc9f 100644
--- a/tests/auto/testlib/selftests/expected_failinit.teamcity
+++ b/tests/auto/testlib/selftests/expected_failinit.teamcity
@@ -1,6 +1,6 @@
##teamcity[testSuiteStarted name='tst_FailInit' flowId='tst_FailInit']
##teamcity[testStarted name='initTestCase()' flowId='tst_FailInit']
-##teamcity[testFailed name='initTestCase()' message='Failure! |[Loc: tst_failinit.cpp(47)|]' details='|'false|' returned FALSE. ()' flowId='tst_FailInit']
+##teamcity[testFailed name='initTestCase()' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/failinit/tst_failinit.cpp(0)|]' details='|'false|' returned FALSE. ()' flowId='tst_FailInit']
##teamcity[testFinished name='initTestCase()' flowId='tst_FailInit']
##teamcity[testStarted name='cleanupTestCase()' flowId='tst_FailInit']
##teamcity[testFinished name='cleanupTestCase()' flowId='tst_FailInit']
diff --git a/tests/auto/testlib/selftests/expected_failinit.txt b/tests/auto/testlib/selftests/expected_failinit.txt
index 62d6ec1dd6..7608367d78 100644
--- a/tests/auto/testlib/selftests/expected_failinit.txt
+++ b/tests/auto/testlib/selftests/expected_failinit.txt
@@ -1,7 +1,7 @@
********* Start testing of tst_FailInit *********
-Config: Using QtTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@
+Config: Using QtTest library
FAIL! : tst_FailInit::initTestCase() 'false' returned FALSE. ()
- Loc: [tst_failinit.cpp(55)]
+ Loc: [qtbase/tests/auto/testlib/selftests/failinit/tst_failinit.cpp(0)]
PASS : tst_FailInit::cleanupTestCase()
-Totals: 1 passed, 1 failed, 0 skipped, 0 blacklisted
+Totals: 1 passed, 1 failed, 0 skipped, 0 blacklisted, 0ms
********* Finished testing of tst_FailInit *********
diff --git a/tests/auto/testlib/selftests/expected_failinit.xml b/tests/auto/testlib/selftests/expected_failinit.xml
index 51e1a7fce4..46c925091c 100644
--- a/tests/auto/testlib/selftests/expected_failinit.xml
+++ b/tests/auto/testlib/selftests/expected_failinit.xml
@@ -6,14 +6,14 @@
<QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion>
</Environment>
<TestFunction name="initTestCase">
-<Incident type="fail" file="tst_failinit.cpp" line="55">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/failinit/tst_failinit.cpp" line="0">
<Description><![CDATA['false' returned FALSE. ()]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="cleanupTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<Duration msecs="0"/>
</TestCase>
diff --git a/tests/auto/testlib/selftests/expected_failinitdata.lightxml b/tests/auto/testlib/selftests/expected_failinitdata.lightxml
index f9da42c060..60bf7b60bf 100644
--- a/tests/auto/testlib/selftests/expected_failinitdata.lightxml
+++ b/tests/auto/testlib/selftests/expected_failinitdata.lightxml
@@ -4,9 +4,9 @@
<QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion>
</Environment>
<TestFunction name="initTestCase">
-<Incident type="fail" file="tst_failinitdata.cpp" line="56">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/failinitdata/tst_failinitdata.cpp" line="0">
<Description><![CDATA['false' returned FALSE. ()]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<Duration msecs="0"/>
diff --git a/tests/auto/testlib/selftests/expected_failinitdata.teamcity b/tests/auto/testlib/selftests/expected_failinitdata.teamcity
index 7766d9dca2..5823b55dd1 100644
--- a/tests/auto/testlib/selftests/expected_failinitdata.teamcity
+++ b/tests/auto/testlib/selftests/expected_failinitdata.teamcity
@@ -1,5 +1,5 @@
##teamcity[testSuiteStarted name='tst_FailInitData' flowId='tst_FailInitData']
##teamcity[testStarted name='initTestCase()' flowId='tst_FailInitData']
-##teamcity[testFailed name='initTestCase()' message='Failure! |[Loc: tst_failinitdata.cpp(48)|]' details='|'false|' returned FALSE. ()' flowId='tst_FailInitData']
+##teamcity[testFailed name='initTestCase()' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/failinitdata/tst_failinitdata.cpp(0)|]' details='|'false|' returned FALSE. ()' flowId='tst_FailInitData']
##teamcity[testFinished name='initTestCase()' flowId='tst_FailInitData']
##teamcity[testSuiteFinished name='tst_FailInitData' flowId='tst_FailInitData']
diff --git a/tests/auto/testlib/selftests/expected_failinitdata.txt b/tests/auto/testlib/selftests/expected_failinitdata.txt
index 431c70269e..3f985516da 100644
--- a/tests/auto/testlib/selftests/expected_failinitdata.txt
+++ b/tests/auto/testlib/selftests/expected_failinitdata.txt
@@ -1,6 +1,6 @@
********* Start testing of tst_FailInitData *********
-Config: Using QtTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@
+Config: Using QtTest library
FAIL! : tst_FailInitData::initTestCase() 'false' returned FALSE. ()
- Loc: [tst_failinitdata.cpp(56)]
-Totals: 0 passed, 1 failed, 0 skipped, 0 blacklisted
+ Loc: [qtbase/tests/auto/testlib/selftests/failinitdata/tst_failinitdata.cpp(0)]
+Totals: 0 passed, 1 failed, 0 skipped, 0 blacklisted, 0ms
********* Finished testing of tst_FailInitData *********
diff --git a/tests/auto/testlib/selftests/expected_failinitdata.xml b/tests/auto/testlib/selftests/expected_failinitdata.xml
index e843863bfc..e135c59c8c 100644
--- a/tests/auto/testlib/selftests/expected_failinitdata.xml
+++ b/tests/auto/testlib/selftests/expected_failinitdata.xml
@@ -6,10 +6,10 @@
<QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion>
</Environment>
<TestFunction name="initTestCase">
-<Incident type="fail" file="tst_failinitdata.cpp" line="56">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/failinitdata/tst_failinitdata.cpp" line="0">
<Description><![CDATA['false' returned FALSE. ()]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<Duration msecs="0"/>
</TestCase>
diff --git a/tests/auto/testlib/selftests/expected_fetchbogus.lightxml b/tests/auto/testlib/selftests/expected_fetchbogus.lightxml
index c62a93eb49..b586fa9c29 100644
--- a/tests/auto/testlib/selftests/expected_fetchbogus.lightxml
+++ b/tests/auto/testlib/selftests/expected_fetchbogus.lightxml
@@ -5,7 +5,7 @@
</Environment>
<TestFunction name="initTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="fetchBogus">
<Message type="qfatal" file="" line="0">
@@ -16,6 +16,6 @@
<DataTag><![CDATA[foo]]></DataTag>
<Description><![CDATA[Received a fatal error.]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<Duration msecs="0"/>
diff --git a/tests/auto/testlib/selftests/expected_fetchbogus.teamcity b/tests/auto/testlib/selftests/expected_fetchbogus.teamcity
index c2da66c2ee..6fa9c833fb 100644
--- a/tests/auto/testlib/selftests/expected_fetchbogus.teamcity
+++ b/tests/auto/testlib/selftests/expected_fetchbogus.teamcity
@@ -2,7 +2,7 @@
##teamcity[testStarted name='initTestCase()' flowId='tst_FetchBogus']
##teamcity[testFinished name='initTestCase()' flowId='tst_FetchBogus']
##teamcity[testStarted name='fetchBogus(foo)' flowId='tst_FetchBogus']
-##teamcity[testFailed name='fetchBogus(foo)' message='Failure! |[Loc: Unknown file(57)|]' details='Received a fatal error.' flowId='tst_FetchBogus']
+##teamcity[testFailed name='fetchBogus(foo)' message='Failure! |[Loc: Unknown file(0)|]' details='Received a fatal error.' flowId='tst_FetchBogus']
##teamcity[testStdOut name='fetchBogus(foo)' out='QFATAL: QFETCH: Requested testdata |'bubu|' not available, check your _data function.' flowId='tst_FetchBogus']
##teamcity[testFinished name='fetchBogus(foo)' flowId='tst_FetchBogus']
##teamcity[testSuiteFinished name='tst_FetchBogus' flowId='tst_FetchBogus']
diff --git a/tests/auto/testlib/selftests/expected_fetchbogus.txt b/tests/auto/testlib/selftests/expected_fetchbogus.txt
index 598e281215..94c7cca223 100644
--- a/tests/auto/testlib/selftests/expected_fetchbogus.txt
+++ b/tests/auto/testlib/selftests/expected_fetchbogus.txt
@@ -1,8 +1,8 @@
********* Start testing of tst_FetchBogus *********
-Config: Using QtTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@
+Config: Using QtTest library
PASS : tst_FetchBogus::initTestCase()
QFATAL : tst_FetchBogus::fetchBogus(foo) QFETCH: Requested testdata 'bubu' not available, check your _data function.
FAIL! : tst_FetchBogus::fetchBogus(foo) Received a fatal error.
Loc: [Unknown file(0)]
-Totals: 1 passed, 1 failed, 0 skipped, 0 blacklisted
+Totals: 1 passed, 1 failed, 0 skipped, 0 blacklisted, 0ms
********* Finished testing of tst_FetchBogus *********
diff --git a/tests/auto/testlib/selftests/expected_fetchbogus.xml b/tests/auto/testlib/selftests/expected_fetchbogus.xml
index c20de137a2..38ffa2fa7a 100644
--- a/tests/auto/testlib/selftests/expected_fetchbogus.xml
+++ b/tests/auto/testlib/selftests/expected_fetchbogus.xml
@@ -7,7 +7,7 @@
</Environment>
<TestFunction name="initTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="fetchBogus">
<Message type="qfatal" file="" line="0">
@@ -18,7 +18,7 @@
<DataTag><![CDATA[foo]]></DataTag>
<Description><![CDATA[Received a fatal error.]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<Duration msecs="0"/>
</TestCase>
diff --git a/tests/auto/testlib/selftests/expected_findtestdata.lightxml b/tests/auto/testlib/selftests/expected_findtestdata.lightxml
index e3c3cea7bc..90acd946a5 100644
--- a/tests/auto/testlib/selftests/expected_findtestdata.lightxml
+++ b/tests/auto/testlib/selftests/expected_findtestdata.lightxml
@@ -5,17 +5,17 @@
</Environment>
<TestFunction name="initTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="paths">
-<Message type="warn" file="findtestdata.cpp" line="154">
+<Message type="warn" file="qtbase/tests/auto/testlib/selftests/findtestdata/findtestdata.cpp" line="0">
<Description><![CDATA[testdata testfile could not be located!]]></Description>
</Message>
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="cleanupTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<Duration msecs="0"/>
diff --git a/tests/auto/testlib/selftests/expected_findtestdata.teamcity b/tests/auto/testlib/selftests/expected_findtestdata.teamcity
index 8a8fa2e885..c653400c42 100644
--- a/tests/auto/testlib/selftests/expected_findtestdata.teamcity
+++ b/tests/auto/testlib/selftests/expected_findtestdata.teamcity
@@ -2,7 +2,7 @@
##teamcity[testStarted name='initTestCase()' flowId='FindTestData']
##teamcity[testFinished name='initTestCase()' flowId='FindTestData']
##teamcity[testStarted name='paths()' flowId='FindTestData']
-##teamcity[testStdOut name='paths()' out='WARNING |[Loc: findtestdata.cpp(146)|]: testdata testfile could not be located!' flowId='FindTestData']
+##teamcity[testStdOut name='paths()' out='WARNING |[Loc: qtbase/tests/auto/testlib/selftests/findtestdata/findtestdata.cpp(0)|]: testdata testfile could not be located!' flowId='FindTestData']
##teamcity[testFinished name='paths()' flowId='FindTestData']
##teamcity[testStarted name='cleanupTestCase()' flowId='FindTestData']
##teamcity[testFinished name='cleanupTestCase()' flowId='FindTestData']
diff --git a/tests/auto/testlib/selftests/expected_findtestdata.txt b/tests/auto/testlib/selftests/expected_findtestdata.txt
index 6a900e73d6..81ebefb423 100644
--- a/tests/auto/testlib/selftests/expected_findtestdata.txt
+++ b/tests/auto/testlib/selftests/expected_findtestdata.txt
@@ -1,9 +1,9 @@
********* Start testing of FindTestData *********
-Config: Using QtTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@
+Config: Using QtTest library
PASS : FindTestData::initTestCase()
WARNING: FindTestData::paths() testdata testfile could not be located!
- Loc: [findtestdata.cpp(154)]
+ Loc: [qtbase/tests/auto/testlib/selftests/findtestdata/findtestdata.cpp(0)]
PASS : FindTestData::paths()
PASS : FindTestData::cleanupTestCase()
-Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted
+Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms
********* Finished testing of FindTestData *********
diff --git a/tests/auto/testlib/selftests/expected_findtestdata.xml b/tests/auto/testlib/selftests/expected_findtestdata.xml
index 6abaa15103..152700acee 100644
--- a/tests/auto/testlib/selftests/expected_findtestdata.xml
+++ b/tests/auto/testlib/selftests/expected_findtestdata.xml
@@ -7,18 +7,18 @@
</Environment>
<TestFunction name="initTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="paths">
-<Message type="warn" file="findtestdata.cpp" line="154">
+<Message type="warn" file="qtbase/tests/auto/testlib/selftests/findtestdata/findtestdata.cpp" line="0">
<Description><![CDATA[testdata testfile could not be located!]]></Description>
</Message>
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="cleanupTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<Duration msecs="0"/>
</TestCase>
diff --git a/tests/auto/testlib/selftests/expected_float.lightxml b/tests/auto/testlib/selftests/expected_float.lightxml
new file mode 100644
index 0000000000..0dbc5dd8c8
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_float.lightxml
@@ -0,0 +1,62 @@
+<Environment>
+ <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>
+ <QtBuild/>
+ <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion>
+</Environment>
+<TestFunction name="initTestCase">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="floatComparisons">
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[should SUCCEED 1]]></DataTag>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
+ <DataTag><![CDATA[should FAIL 1]]></DataTag>
+ <Description><![CDATA[Compared floats are not the same (fuzzy compare)
+ Actual (operandLeft) : 1
+ Expected (operandRight): 3]]></Description>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
+ <DataTag><![CDATA[should FAIL 2]]></DataTag>
+ <Description><![CDATA[Compared floats are not the same (fuzzy compare)
+ Actual (operandLeft) : 1e-07
+ Expected (operandRight): 3e-07]]></Description>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
+ <DataTag><![CDATA[should FAIL 3]]></DataTag>
+ <Description><![CDATA[Compared floats are not the same (fuzzy compare)
+ Actual (operandLeft) : 99998
+ Expected (operandRight): 99999]]></Description>
+</Incident>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[should SUCCEED 2]]></DataTag>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="compareFloatTests">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
+ <DataTag><![CDATA[1e0]]></DataTag>
+ <Description><![CDATA[Compared floats are not the same (fuzzy compare)
+ Actual (t1): 1
+ Expected (t3): 3]]></Description>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
+ <DataTag><![CDATA[1e-7]]></DataTag>
+ <Description><![CDATA[Compared floats are not the same (fuzzy compare)
+ Actual (t1): 1e-07
+ Expected (t3): 3e-07]]></Description>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
+ <DataTag><![CDATA[1e+7]]></DataTag>
+ <Description><![CDATA[Compared floats are not the same (fuzzy compare)
+ Actual (t1): 1e+07
+ Expected (t3): 3e+07]]></Description>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="cleanupTestCase">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<Duration msecs="0"/>
diff --git a/tests/auto/testlib/selftests/expected_float.teamcity b/tests/auto/testlib/selftests/expected_float.teamcity
new file mode 100644
index 0000000000..d5b81593d8
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_float.teamcity
@@ -0,0 +1,28 @@
+##teamcity[testSuiteStarted name='tst_float' flowId='tst_float']
+##teamcity[testStarted name='initTestCase()' flowId='tst_float']
+##teamcity[testFinished name='initTestCase()' flowId='tst_float']
+##teamcity[testStarted name='floatComparisons(should SUCCEED 1)' flowId='tst_float']
+##teamcity[testFinished name='floatComparisons(should SUCCEED 1)' flowId='tst_float']
+##teamcity[testStarted name='floatComparisons(should FAIL 1)' flowId='tst_float']
+##teamcity[testFailed name='floatComparisons(should FAIL 1)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared floats are not the same (fuzzy compare)|n Actual (operandLeft) : 1|n Expected (operandRight): 3' flowId='tst_float']
+##teamcity[testFinished name='floatComparisons(should FAIL 1)' flowId='tst_float']
+##teamcity[testStarted name='floatComparisons(should FAIL 2)' flowId='tst_float']
+##teamcity[testFailed name='floatComparisons(should FAIL 2)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared floats are not the same (fuzzy compare)|n Actual (operandLeft) : 1e-07|n Expected (operandRight): 3e-07' flowId='tst_float']
+##teamcity[testFinished name='floatComparisons(should FAIL 2)' flowId='tst_float']
+##teamcity[testStarted name='floatComparisons(should FAIL 3)' flowId='tst_float']
+##teamcity[testFailed name='floatComparisons(should FAIL 3)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared floats are not the same (fuzzy compare)|n Actual (operandLeft) : 99998|n Expected (operandRight): 99999' flowId='tst_float']
+##teamcity[testFinished name='floatComparisons(should FAIL 3)' flowId='tst_float']
+##teamcity[testStarted name='floatComparisons(should SUCCEED 2)' flowId='tst_float']
+##teamcity[testFinished name='floatComparisons(should SUCCEED 2)' flowId='tst_float']
+##teamcity[testStarted name='compareFloatTests(1e0)' flowId='tst_float']
+##teamcity[testFailed name='compareFloatTests(1e0)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared floats are not the same (fuzzy compare)|n Actual (t1): 1|n Expected (t3): 3' flowId='tst_float']
+##teamcity[testFinished name='compareFloatTests(1e0)' flowId='tst_float']
+##teamcity[testStarted name='compareFloatTests(1e-7)' flowId='tst_float']
+##teamcity[testFailed name='compareFloatTests(1e-7)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared floats are not the same (fuzzy compare)|n Actual (t1): 1e-07|n Expected (t3): 3e-07' flowId='tst_float']
+##teamcity[testFinished name='compareFloatTests(1e-7)' flowId='tst_float']
+##teamcity[testStarted name='compareFloatTests(1e+7)' flowId='tst_float']
+##teamcity[testFailed name='compareFloatTests(1e+7)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared floats are not the same (fuzzy compare)|n Actual (t1): 1e+07|n Expected (t3): 3e+07' flowId='tst_float']
+##teamcity[testFinished name='compareFloatTests(1e+7)' flowId='tst_float']
+##teamcity[testStarted name='cleanupTestCase()' flowId='tst_float']
+##teamcity[testFinished name='cleanupTestCase()' flowId='tst_float']
+##teamcity[testSuiteFinished name='tst_float' flowId='tst_float']
diff --git a/tests/auto/testlib/selftests/expected_float.txt b/tests/auto/testlib/selftests/expected_float.txt
index e9cfae04b4..8abea6a67e 100644
--- a/tests/auto/testlib/selftests/expected_float.txt
+++ b/tests/auto/testlib/selftests/expected_float.txt
@@ -1,32 +1,32 @@
********* Start testing of tst_float *********
-Config: Using QtTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@
+Config: Using QtTest library
PASS : tst_float::initTestCase()
PASS : tst_float::floatComparisons(should SUCCEED 1)
FAIL! : tst_float::floatComparisons(should FAIL 1) Compared floats are not the same (fuzzy compare)
Actual (operandLeft) : 1
Expected (operandRight): 3
- Loc: [tst_float.cpp(61)]
+ Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)]
FAIL! : tst_float::floatComparisons(should FAIL 2) Compared floats are not the same (fuzzy compare)
Actual (operandLeft) : 1e-07
Expected (operandRight): 3e-07
- Loc: [tst_float.cpp(61)]
+ Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)]
FAIL! : tst_float::floatComparisons(should FAIL 3) Compared floats are not the same (fuzzy compare)
Actual (operandLeft) : 99998
Expected (operandRight): 99999
- Loc: [tst_float.cpp(61)]
+ Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)]
PASS : tst_float::floatComparisons(should SUCCEED 2)
FAIL! : tst_float::compareFloatTests(1e0) Compared floats are not the same (fuzzy compare)
Actual (t1): 1
Expected (t3): 3
- Loc: [tst_float.cpp(109)]
+ Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)]
FAIL! : tst_float::compareFloatTests(1e-7) Compared floats are not the same (fuzzy compare)
Actual (t1): 1e-07
Expected (t3): 3e-07
- Loc: [tst_float.cpp(109)]
+ Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)]
FAIL! : tst_float::compareFloatTests(1e+7) Compared floats are not the same (fuzzy compare)
Actual (t1): 1e+07
Expected (t3): 3e+07
- Loc: [tst_float.cpp(109)]
+ Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)]
PASS : tst_float::cleanupTestCase()
-Totals: 4 passed, 6 failed, 0 skipped, 0 blacklisted
+Totals: 4 passed, 6 failed, 0 skipped, 0 blacklisted, 0ms
********* Finished testing of tst_float *********
diff --git a/tests/auto/testlib/selftests/expected_float.xml b/tests/auto/testlib/selftests/expected_float.xml
new file mode 100644
index 0000000000..096e1a5b54
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_float.xml
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<TestCase name="tst_float">
+<Environment>
+ <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>
+ <QtBuild/>
+ <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion>
+</Environment>
+<TestFunction name="initTestCase">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="floatComparisons">
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[should SUCCEED 1]]></DataTag>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
+ <DataTag><![CDATA[should FAIL 1]]></DataTag>
+ <Description><![CDATA[Compared floats are not the same (fuzzy compare)
+ Actual (operandLeft) : 1
+ Expected (operandRight): 3]]></Description>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
+ <DataTag><![CDATA[should FAIL 2]]></DataTag>
+ <Description><![CDATA[Compared floats are not the same (fuzzy compare)
+ Actual (operandLeft) : 1e-07
+ Expected (operandRight): 3e-07]]></Description>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
+ <DataTag><![CDATA[should FAIL 3]]></DataTag>
+ <Description><![CDATA[Compared floats are not the same (fuzzy compare)
+ Actual (operandLeft) : 99998
+ Expected (operandRight): 99999]]></Description>
+</Incident>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[should SUCCEED 2]]></DataTag>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="compareFloatTests">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
+ <DataTag><![CDATA[1e0]]></DataTag>
+ <Description><![CDATA[Compared floats are not the same (fuzzy compare)
+ Actual (t1): 1
+ Expected (t3): 3]]></Description>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
+ <DataTag><![CDATA[1e-7]]></DataTag>
+ <Description><![CDATA[Compared floats are not the same (fuzzy compare)
+ Actual (t1): 1e-07
+ Expected (t3): 3e-07]]></Description>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
+ <DataTag><![CDATA[1e+7]]></DataTag>
+ <Description><![CDATA[Compared floats are not the same (fuzzy compare)
+ Actual (t1): 1e+07
+ Expected (t3): 3e+07]]></Description>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="cleanupTestCase">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<Duration msecs="0"/>
+</TestCase>
diff --git a/tests/auto/testlib/selftests/expected_float.xunitxml b/tests/auto/testlib/selftests/expected_float.xunitxml
new file mode 100644
index 0000000000..5de14e8d9b
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_float.xunitxml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<testsuite errors="0" failures="6" tests="4" name="tst_float">
+ <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"/>
+ <testcase result="fail" name="floatComparisons">
+ <failure tag="should FAIL 1" message="Compared floats are not the same (fuzzy compare)
+ Actual (operandLeft) : 1
+ Expected (operandRight): 3" result="fail"/>
+ <failure tag="should FAIL 2" message="Compared floats are not the same (fuzzy compare)
+ Actual (operandLeft) : 1e&#x002D;07
+ Expected (operandRight): 3e&#x002D;07" result="fail"/>
+ <failure tag="should FAIL 3" message="Compared floats are not the same (fuzzy compare)
+ Actual (operandLeft) : 99998
+ Expected (operandRight): 99999" result="fail"/>
+ </testcase>
+ <testcase result="fail" name="compareFloatTests">
+ <failure tag="1e0" message="Compared floats are not the same (fuzzy compare)
+ Actual (t1): 1
+ Expected (t3): 3" result="fail"/>
+ <failure tag="1e&#x002D;7" message="Compared floats are not the same (fuzzy compare)
+ Actual (t1): 1e&#x002D;07
+ Expected (t3): 3e&#x002D;07" result="fail"/>
+ <failure tag="1e+7" message="Compared floats are not the same (fuzzy compare)
+ Actual (t1): 1e+07
+ Expected (t3): 3e+07" result="fail"/>
+ </testcase>
+ <testcase result="pass" name="cleanupTestCase"/>
+ <system-err/>
+</testsuite>
diff --git a/tests/auto/testlib/selftests/expected_globaldata.lightxml b/tests/auto/testlib/selftests/expected_globaldata.lightxml
index 7d4c43905c..f66c4c552d 100644
--- a/tests/auto/testlib/selftests/expected_globaldata.lightxml
+++ b/tests/auto/testlib/selftests/expected_globaldata.lightxml
@@ -8,7 +8,7 @@
<Description><![CDATA[initTestCase initTestCase (null)]]></Description>
</Message>
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testGlobal">
<Message type="qdebug" file="" line="0">
@@ -87,21 +87,21 @@
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[2:local 2]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="skip">
-<Message type="skip" file="tst_globaldata.cpp" line="129">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp" line="0">
<DataTag><![CDATA[1]]></DataTag>
<Description><![CDATA[skipping]]></Description>
</Message>
-<Duration msecs="0"/>
+ <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>
</Message>
-<Message type="skip" file="tst_globaldata.cpp" line="149">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp" line="0">
<DataTag><![CDATA[1:local 1]]></DataTag>
<Description><![CDATA[skipping]]></Description>
</Message>
@@ -113,7 +113,7 @@
<DataTag><![CDATA[1:local 2]]></DataTag>
<Description><![CDATA[init skipLocal local 2]]></Description>
</Message>
-<Message type="skip" file="tst_globaldata.cpp" line="149">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp" line="0">
<DataTag><![CDATA[1:local 2]]></DataTag>
<Description><![CDATA[skipping]]></Description>
</Message>
@@ -121,7 +121,7 @@
<DataTag><![CDATA[1:local 2]]></DataTag>
<Description><![CDATA[cleanup skipLocal local 2]]></Description>
</Message>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="skipSingle">
<Message type="qdebug" file="" line="0">
@@ -158,7 +158,7 @@
<DataTag><![CDATA[2:local 1]]></DataTag>
<Description><![CDATA[init skipSingle local 1]]></Description>
</Message>
-<Message type="skip" file="tst_globaldata.cpp" line="143">
+<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>
</Message>
@@ -181,13 +181,13 @@
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[2:local 2]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="cleanupTestCase">
<Message type="qdebug" file="" line="0">
<Description><![CDATA[cleanupTestCase cleanupTestCase (null)]]></Description>
</Message>
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<Duration msecs="0"/>
diff --git a/tests/auto/testlib/selftests/expected_globaldata.teamcity b/tests/auto/testlib/selftests/expected_globaldata.teamcity
index 5c6cc4b88d..5d623a3285 100644
--- a/tests/auto/testlib/selftests/expected_globaldata.teamcity
+++ b/tests/auto/testlib/selftests/expected_globaldata.teamcity
@@ -14,16 +14,16 @@
##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[testIgnored name='skip()' message='skipping |[Loc: tst_globaldata.cpp(121)|]' flowId='tst_globaldata']
-##teamcity[testIgnored name='skipLocal(local 1)' message='skipping |[Loc: tst_globaldata.cpp(141)|]' flowId='tst_globaldata']
-##teamcity[testIgnored name='skipLocal(local 2)' message='skipping |[Loc: tst_globaldata.cpp(141)|]' 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: tst_globaldata.cpp(135)|]' 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[testStarted name='cleanupTestCase()' flowId='tst_globaldata']
diff --git a/tests/auto/testlib/selftests/expected_globaldata.txt b/tests/auto/testlib/selftests/expected_globaldata.txt
index efd461d7d2..b12f4a2a69 100644
--- a/tests/auto/testlib/selftests/expected_globaldata.txt
+++ b/tests/auto/testlib/selftests/expected_globaldata.txt
@@ -1,5 +1,5 @@
********* Start testing of tst_globaldata *********
-Config: Using QtTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@
+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
@@ -23,14 +23,14 @@ 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
- Loc: [tst_globaldata.cpp(129)]
+ 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
- Loc: [tst_globaldata.cpp(149)]
+ 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
- Loc: [tst_globaldata.cpp(149)]
+ 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
@@ -42,7 +42,7 @@ 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
- Loc: [tst_globaldata.cpp(143)]
+ 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
@@ -50,5 +50,5 @@ QDEBUG : tst_globaldata::skipSingle(2:local 2) cleanup skipSingle local 2
PASS : tst_globaldata::skipSingle(2:local 2)
QDEBUG : tst_globaldata::cleanupTestCase() cleanupTestCase cleanupTestCase (null)
PASS : tst_globaldata::cleanupTestCase()
-Totals: 9 passed, 0 failed, 4 skipped, 0 blacklisted
+Totals: 9 passed, 0 failed, 4 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 5e5d4d8922..0f705ef352 100644
--- a/tests/auto/testlib/selftests/expected_globaldata.xml
+++ b/tests/auto/testlib/selftests/expected_globaldata.xml
@@ -10,7 +10,7 @@
<Description><![CDATA[initTestCase initTestCase (null)]]></Description>
</Message>
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testGlobal">
<Message type="qdebug" file="" line="0">
@@ -89,21 +89,21 @@
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[2:local 2]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="skip">
-<Message type="skip" file="tst_globaldata.cpp" line="129">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp" line="0">
<DataTag><![CDATA[1]]></DataTag>
<Description><![CDATA[skipping]]></Description>
</Message>
-<Duration msecs="0"/>
+ <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>
</Message>
-<Message type="skip" file="tst_globaldata.cpp" line="149">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp" line="0">
<DataTag><![CDATA[1:local 1]]></DataTag>
<Description><![CDATA[skipping]]></Description>
</Message>
@@ -115,7 +115,7 @@
<DataTag><![CDATA[1:local 2]]></DataTag>
<Description><![CDATA[init skipLocal local 2]]></Description>
</Message>
-<Message type="skip" file="tst_globaldata.cpp" line="149">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp" line="0">
<DataTag><![CDATA[1:local 2]]></DataTag>
<Description><![CDATA[skipping]]></Description>
</Message>
@@ -123,7 +123,7 @@
<DataTag><![CDATA[1:local 2]]></DataTag>
<Description><![CDATA[cleanup skipLocal local 2]]></Description>
</Message>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="skipSingle">
<Message type="qdebug" file="" line="0">
@@ -160,7 +160,7 @@
<DataTag><![CDATA[2:local 1]]></DataTag>
<Description><![CDATA[init skipSingle local 1]]></Description>
</Message>
-<Message type="skip" file="tst_globaldata.cpp" line="143">
+<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>
</Message>
@@ -183,14 +183,14 @@
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[2:local 2]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="cleanupTestCase">
<Message type="qdebug" file="" line="0">
<Description><![CDATA[cleanupTestCase cleanupTestCase (null)]]></Description>
</Message>
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<Duration msecs="0"/>
</TestCase>
diff --git a/tests/auto/testlib/selftests/expected_longstring.lightxml b/tests/auto/testlib/selftests/expected_longstring.lightxml
index f8796bed4a..12e4fabd8d 100644
--- a/tests/auto/testlib/selftests/expected_longstring.lightxml
+++ b/tests/auto/testlib/selftests/expected_longstring.lightxml
@@ -5,10 +5,10 @@
</Environment>
<TestFunction name="initTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="failWithLongString">
-<Incident type="fail" file="tst_longstring.cpp" line="67">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/longstring/tst_longstring.cpp" line="0">
<Description><![CDATA[Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet. Quisque rutrum. Aenean imperdiet. Etiam ultricies nisi vel augue. Curabitur ullamcorper ultricies nisi. Nam eget dui.
Etiam rhoncus. Maecenas tempus, tellus eget condimentum rhoncus, sem quam semper libero, sit amet adipiscing sem neque sed ipsum. Nam quam nunc, blandit vel, luctus pulvinar, hendrerit id, lorem. Maecenas nec odio et ante tincidunt tempus. Donec vitae sapien ut libero venenatis faucibus. Nullam quis ante. Etiam sit amet orci eget eros faucibus tincidunt. Duis leo. Sed fringilla mauris sit amet nibh. Donec sodales sagittis magna. Sed consequat, leo eget bibendum sodales, augue velit cursus nunc, quis gravida magna mi a libero. Fusce vulputate eleifend sapien. Vestibulum purus quam, scelerisque ut, mollis sed, nonummy id, metus. Nullam accumsan lorem in dui. Cras ultricies mi eu turpis hendrerit fringilla. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; In ac dui quis mi consectetuer lacinia.
@@ -19,10 +19,10 @@ Curabitur ligula sapien, tincidunt non, euismod vitae, posuere imperdiet, leo. M
Aenean posuere, tortor sed cursus feugiat, nunc augue blandit nunc, eu sollicitudin urna dolor sagittis lacus. Donec elit libero, sodales nec, volutpat a, suscipit non, turpis. Nullam sagittis. Suspendisse pulvinar, augue ac venenatis condimentum, sem libero volutpat nibh, nec pellentesque velit pede quis nunc. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Fusce id purus. Ut varius tincidunt libero. Phasellus dolor. Maecenas vestibulum mollis diam. Pellentesque ut neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="cleanupTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<Duration msecs="0"/>
diff --git a/tests/auto/testlib/selftests/expected_longstring.teamcity b/tests/auto/testlib/selftests/expected_longstring.teamcity
index 0e7fa82b9b..0ea45871d1 100644
--- a/tests/auto/testlib/selftests/expected_longstring.teamcity
+++ b/tests/auto/testlib/selftests/expected_longstring.teamcity
@@ -2,7 +2,7 @@
##teamcity[testStarted name='initTestCase()' flowId='tst_LongString']
##teamcity[testFinished name='initTestCase()' flowId='tst_LongString']
##teamcity[testStarted name='failWithLongString()' flowId='tst_LongString']
-##teamcity[testFailed name='failWithLongString()' message='Failure! |[Loc: tst_longstring.cpp(59)|]' details='Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet. Quisque rutrum. Aenean imperdiet. Etiam ultricies nisi vel augue. Curabitur ullamcorper ultricies nisi. Nam eget dui.|n|nEtiam rhoncus. Maecenas tempus, tellus eget condimentum rhoncus, sem quam semper libero, sit amet adipiscing sem neque sed ipsum. Nam quam nunc, blandit vel, luctus pulvinar, hendrerit id, lorem. Maecenas nec odio et ante tincidunt tempus. Donec vitae sapien ut libero venenatis faucibus. Nullam quis ante. Etiam sit amet orci eget eros faucibus tincidunt. Duis leo. Sed fringilla mauris sit amet nibh. Donec sodales sagittis magna. Sed consequat, leo eget bibendum sodales, augue velit cursus nunc, quis gravida magna mi a libero. Fusce vulputate eleifend sapien. Vestibulum purus quam, scelerisque ut, mollis sed, nonummy id, metus. Nullam accumsan lorem in dui. Cras ultricies mi eu turpis hendrerit fringilla. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; In ac dui quis mi consectetuer lacinia.|n|nNam pretium turpis et arcu. Duis arcu tortor, suscipit eget, imperdiet nec, imperdiet iaculis, ipsum. Sed aliquam ultrices mauris. Integer ante arcu, accumsan a, consectetuer eget, posuere ut, mauris. Praesent adipiscing. Phasellus ullamcorper ipsum rutrum nunc. Nunc nonummy metus. Vestibulum volutpat pretium libero. Cras id dui. Aenean ut eros et nisl sagittis vestibulum. Nullam nulla eros, ultricies sit amet, nonummy id, imperdiet feugiat, pede. Sed lectus. Donec mollis hendrerit risus. Phasellus nec sem in justo pellentesque facilisis. Etiam imperdiet imperdiet orci. Nunc nec neque. Phasellus leo dolor, tempus non, auctor et, hendrerit quis, nisi.|n|nCurabitur ligula sapien, tincidunt non, euismod vitae, posuere imperdiet, leo. Maecenas malesuada. Praesent congue erat at massa. Sed cursus turpis vitae tortor. Donec posuere vulputate arcu. Phasellus accumsan cursus velit. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed aliquam, nisi quis porttitor congue, elit erat euismod orci, ac placerat dolor lectus quis orci. Phasellus consectetuer vestibulum elit. Aenean tellus metus, bibendum sed, posuere ac, mattis non, nunc. Vestibulum fringilla pede sit amet augue. In turpis. Pellentesque posuere. Praesent turpis.|n|nAenean posuere, tortor sed cursus feugiat, nunc augue blandit nunc, eu sollicitudin urna dolor sagittis lacus. Donec elit libero, sodales nec, volutpat a, suscipit non, turpis. Nullam sagittis. Suspendisse pulvinar, augue ac venenatis condimentum, sem libero volutpat nibh, nec pellentesque velit pede quis nunc. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Fusce id purus. Ut varius tincidunt libero. Phasellus dolor. Maecenas vestibulum mollis diam. Pellentesque ut neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.' flowId='tst_LongString']
+##teamcity[testFailed name='failWithLongString()' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/longstring/tst_longstring.cpp(0)|]' details='Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet. Quisque rutrum. Aenean imperdiet. Etiam ultricies nisi vel augue. Curabitur ullamcorper ultricies nisi. Nam eget dui.|n|nEtiam rhoncus. Maecenas tempus, tellus eget condimentum rhoncus, sem quam semper libero, sit amet adipiscing sem neque sed ipsum. Nam quam nunc, blandit vel, luctus pulvinar, hendrerit id, lorem. Maecenas nec odio et ante tincidunt tempus. Donec vitae sapien ut libero venenatis faucibus. Nullam quis ante. Etiam sit amet orci eget eros faucibus tincidunt. Duis leo. Sed fringilla mauris sit amet nibh. Donec sodales sagittis magna. Sed consequat, leo eget bibendum sodales, augue velit cursus nunc, quis gravida magna mi a libero. Fusce vulputate eleifend sapien. Vestibulum purus quam, scelerisque ut, mollis sed, nonummy id, metus. Nullam accumsan lorem in dui. Cras ultricies mi eu turpis hendrerit fringilla. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; In ac dui quis mi consectetuer lacinia.|n|nNam pretium turpis et arcu. Duis arcu tortor, suscipit eget, imperdiet nec, imperdiet iaculis, ipsum. Sed aliquam ultrices mauris. Integer ante arcu, accumsan a, consectetuer eget, posuere ut, mauris. Praesent adipiscing. Phasellus ullamcorper ipsum rutrum nunc. Nunc nonummy metus. Vestibulum volutpat pretium libero. Cras id dui. Aenean ut eros et nisl sagittis vestibulum. Nullam nulla eros, ultricies sit amet, nonummy id, imperdiet feugiat, pede. Sed lectus. Donec mollis hendrerit risus. Phasellus nec sem in justo pellentesque facilisis. Etiam imperdiet imperdiet orci. Nunc nec neque. Phasellus leo dolor, tempus non, auctor et, hendrerit quis, nisi.|n|nCurabitur ligula sapien, tincidunt non, euismod vitae, posuere imperdiet, leo. Maecenas malesuada. Praesent congue erat at massa. Sed cursus turpis vitae tortor. Donec posuere vulputate arcu. Phasellus accumsan cursus velit. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed aliquam, nisi quis porttitor congue, elit erat euismod orci, ac placerat dolor lectus quis orci. Phasellus consectetuer vestibulum elit. Aenean tellus metus, bibendum sed, posuere ac, mattis non, nunc. Vestibulum fringilla pede sit amet augue. In turpis. Pellentesque posuere. Praesent turpis.|n|nAenean posuere, tortor sed cursus feugiat, nunc augue blandit nunc, eu sollicitudin urna dolor sagittis lacus. Donec elit libero, sodales nec, volutpat a, suscipit non, turpis. Nullam sagittis. Suspendisse pulvinar, augue ac venenatis condimentum, sem libero volutpat nibh, nec pellentesque velit pede quis nunc. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Fusce id purus. Ut varius tincidunt libero. Phasellus dolor. Maecenas vestibulum mollis diam. Pellentesque ut neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.' flowId='tst_LongString']
##teamcity[testFinished name='failWithLongString()' flowId='tst_LongString']
##teamcity[testStarted name='cleanupTestCase()' flowId='tst_LongString']
##teamcity[testFinished name='cleanupTestCase()' flowId='tst_LongString']
diff --git a/tests/auto/testlib/selftests/expected_longstring.txt b/tests/auto/testlib/selftests/expected_longstring.txt
index 7ffa77cc1c..3c403c9d92 100644
--- a/tests/auto/testlib/selftests/expected_longstring.txt
+++ b/tests/auto/testlib/selftests/expected_longstring.txt
@@ -1,5 +1,5 @@
********* Start testing of tst_LongString *********
-Config: Using QtTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@
+Config: Using QtTest library
PASS : tst_LongString::initTestCase()
FAIL! : tst_LongString::failWithLongString() Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet. Quisque rutrum. Aenean imperdiet. Etiam ultricies nisi vel augue. Curabitur ullamcorper ultricies nisi. Nam eget dui.
@@ -10,7 +10,7 @@ Nam pretium turpis et arcu. Duis arcu tortor, suscipit eget, imperdiet nec, impe
Curabitur ligula sapien, tincidunt non, euismod vitae, posuere imperdiet, leo. Maecenas malesuada. Praesent congue erat at massa. Sed cursus turpis vitae tortor. Donec posuere vulputate arcu. Phasellus accumsan cursus velit. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed aliquam, nisi quis porttitor congue, elit erat euismod orci, ac placerat dolor lectus quis orci. Phasellus consectetuer vestibulum elit. Aenean tellus metus, bibendum sed, posuere ac, mattis non, nunc. Vestibulum fringilla pede sit amet augue. In turpis. Pellentesque posuere. Praesent turpis.
Aenean posuere, tortor sed cursus feugiat, nunc augue blandit nunc, eu sollicitudin urna dolor sagittis lacus. Donec elit libero, sodales nec, volutpat a, suscipit non, turpis. Nullam sagittis. Suspendisse pulvinar, augue ac venenatis condimentum, sem libero volutpat nibh, nec pellentesque velit pede quis nunc. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Fusce id purus. Ut varius tincidunt libero. Phasellus dolor. Maecenas vestibulum mollis diam. Pellentesque ut neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.
- Loc: [tst_longstring.cpp(67)]
+ Loc: [qtbase/tests/auto/testlib/selftests/longstring/tst_longstring.cpp(0)]
PASS : tst_LongString::cleanupTestCase()
-Totals: 2 passed, 1 failed, 0 skipped, 0 blacklisted
+Totals: 2 passed, 1 failed, 0 skipped, 0 blacklisted, 0ms
********* Finished testing of tst_LongString *********
diff --git a/tests/auto/testlib/selftests/expected_longstring.xml b/tests/auto/testlib/selftests/expected_longstring.xml
index 6623b7cd88..9db4da0e92 100644
--- a/tests/auto/testlib/selftests/expected_longstring.xml
+++ b/tests/auto/testlib/selftests/expected_longstring.xml
@@ -7,10 +7,10 @@
</Environment>
<TestFunction name="initTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="failWithLongString">
-<Incident type="fail" file="tst_longstring.cpp" line="67">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/longstring/tst_longstring.cpp" line="0">
<Description><![CDATA[Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet. Quisque rutrum. Aenean imperdiet. Etiam ultricies nisi vel augue. Curabitur ullamcorper ultricies nisi. Nam eget dui.
Etiam rhoncus. Maecenas tempus, tellus eget condimentum rhoncus, sem quam semper libero, sit amet adipiscing sem neque sed ipsum. Nam quam nunc, blandit vel, luctus pulvinar, hendrerit id, lorem. Maecenas nec odio et ante tincidunt tempus. Donec vitae sapien ut libero venenatis faucibus. Nullam quis ante. Etiam sit amet orci eget eros faucibus tincidunt. Duis leo. Sed fringilla mauris sit amet nibh. Donec sodales sagittis magna. Sed consequat, leo eget bibendum sodales, augue velit cursus nunc, quis gravida magna mi a libero. Fusce vulputate eleifend sapien. Vestibulum purus quam, scelerisque ut, mollis sed, nonummy id, metus. Nullam accumsan lorem in dui. Cras ultricies mi eu turpis hendrerit fringilla. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; In ac dui quis mi consectetuer lacinia.
@@ -21,11 +21,11 @@ Curabitur ligula sapien, tincidunt non, euismod vitae, posuere imperdiet, leo. M
Aenean posuere, tortor sed cursus feugiat, nunc augue blandit nunc, eu sollicitudin urna dolor sagittis lacus. Donec elit libero, sodales nec, volutpat a, suscipit non, turpis. Nullam sagittis. Suspendisse pulvinar, augue ac venenatis condimentum, sem libero volutpat nibh, nec pellentesque velit pede quis nunc. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Fusce id purus. Ut varius tincidunt libero. Phasellus dolor. Maecenas vestibulum mollis diam. Pellentesque ut neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="cleanupTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<Duration msecs="0"/>
</TestCase>
diff --git a/tests/auto/testlib/selftests/expected_maxwarnings.lightxml b/tests/auto/testlib/selftests/expected_maxwarnings.lightxml
index 49db189352..86967ce1dc 100644
--- a/tests/auto/testlib/selftests/expected_maxwarnings.lightxml
+++ b/tests/auto/testlib/selftests/expected_maxwarnings.lightxml
@@ -5,7 +5,7 @@
</Environment>
<TestFunction name="initTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="warn">
<Message type="qwarn" file="" line="0">
@@ -6015,10 +6015,10 @@
<Description><![CDATA[Maximum amount of warnings exceeded. Use -maxwarnings to override.]]></Description>
</Message>
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="cleanupTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<Duration msecs="0"/>
diff --git a/tests/auto/testlib/selftests/expected_maxwarnings.txt b/tests/auto/testlib/selftests/expected_maxwarnings.txt
index 30f8d6f5d3..437ec851dd 100644
--- a/tests/auto/testlib/selftests/expected_maxwarnings.txt
+++ b/tests/auto/testlib/selftests/expected_maxwarnings.txt
@@ -1,5 +1,5 @@
********* Start testing of MaxWarnings *********
-Config: Using QtTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@
+Config: Using QtTest library
PASS : MaxWarnings::initTestCase()
QWARN : MaxWarnings::warn() 0
QWARN : MaxWarnings::warn() 1
@@ -2005,5 +2005,5 @@ QWARN : MaxWarnings::warn() 2000
QSYSTEM: MaxWarnings::warn() Maximum amount of warnings exceeded. Use -maxwarnings to override.
PASS : MaxWarnings::warn()
PASS : MaxWarnings::cleanupTestCase()
-Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted
+Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms
********* Finished testing of MaxWarnings *********
diff --git a/tests/auto/testlib/selftests/expected_maxwarnings.xml b/tests/auto/testlib/selftests/expected_maxwarnings.xml
index 614b054fad..5134d60519 100644
--- a/tests/auto/testlib/selftests/expected_maxwarnings.xml
+++ b/tests/auto/testlib/selftests/expected_maxwarnings.xml
@@ -7,7 +7,7 @@
</Environment>
<TestFunction name="initTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="warn">
<Message type="qwarn" file="" line="0">
@@ -6017,11 +6017,11 @@
<Description><![CDATA[Maximum amount of warnings exceeded. Use -maxwarnings to override.]]></Description>
</Message>
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="cleanupTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<Duration msecs="0"/>
</TestCase>
diff --git a/tests/auto/testlib/selftests/expected_multiexec.lightxml b/tests/auto/testlib/selftests/expected_multiexec.lightxml
new file mode 100644
index 0000000000..344955f049
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_multiexec.lightxml
@@ -0,0 +1,90 @@
+<Environment>
+ <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>
+ <QtBuild/>
+ <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion>
+</Environment>
+<TestFunction name="initTestCase">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="nothing">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="cleanupTestCase">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<Duration msecs="0"/>
+<Environment>
+ <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>
+ <QtBuild/>
+ <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion>
+</Environment>
+<TestFunction name="initTestCase">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="nothing">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="cleanupTestCase">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<Duration msecs="0"/>
+<Environment>
+ <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>
+ <QtBuild/>
+ <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion>
+</Environment>
+<TestFunction name="initTestCase">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="nothing">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="cleanupTestCase">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<Duration msecs="0"/>
+<Environment>
+ <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>
+ <QtBuild/>
+ <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion>
+</Environment>
+<TestFunction name="initTestCase">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="nothing">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="cleanupTestCase">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<Duration msecs="0"/>
+<Environment>
+ <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>
+ <QtBuild/>
+ <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion>
+</Environment>
+<TestFunction name="initTestCase">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="nothing">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="cleanupTestCase">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<Duration msecs="0"/>
diff --git a/tests/auto/testlib/selftests/expected_multiexec.teamcity b/tests/auto/testlib/selftests/expected_multiexec.teamcity
new file mode 100644
index 0000000000..db2aa90272
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_multiexec.teamcity
@@ -0,0 +1,40 @@
+##teamcity[testSuiteStarted name='tst_Nothing' flowId='tst_Nothing']
+##teamcity[testStarted name='initTestCase()' flowId='tst_Nothing']
+##teamcity[testFinished name='initTestCase()' flowId='tst_Nothing']
+##teamcity[testStarted name='nothing()' flowId='tst_Nothing']
+##teamcity[testFinished name='nothing()' flowId='tst_Nothing']
+##teamcity[testStarted name='cleanupTestCase()' flowId='tst_Nothing']
+##teamcity[testFinished name='cleanupTestCase()' flowId='tst_Nothing']
+##teamcity[testSuiteFinished name='tst_Nothing' flowId='tst_Nothing']
+##teamcity[testSuiteStarted name='tst_Nothing' flowId='tst_Nothing']
+##teamcity[testStarted name='initTestCase()' flowId='tst_Nothing']
+##teamcity[testFinished name='initTestCase()' flowId='tst_Nothing']
+##teamcity[testStarted name='nothing()' flowId='tst_Nothing']
+##teamcity[testFinished name='nothing()' flowId='tst_Nothing']
+##teamcity[testStarted name='cleanupTestCase()' flowId='tst_Nothing']
+##teamcity[testFinished name='cleanupTestCase()' flowId='tst_Nothing']
+##teamcity[testSuiteFinished name='tst_Nothing' flowId='tst_Nothing']
+##teamcity[testSuiteStarted name='tst_Nothing' flowId='tst_Nothing']
+##teamcity[testStarted name='initTestCase()' flowId='tst_Nothing']
+##teamcity[testFinished name='initTestCase()' flowId='tst_Nothing']
+##teamcity[testStarted name='nothing()' flowId='tst_Nothing']
+##teamcity[testFinished name='nothing()' flowId='tst_Nothing']
+##teamcity[testStarted name='cleanupTestCase()' flowId='tst_Nothing']
+##teamcity[testFinished name='cleanupTestCase()' flowId='tst_Nothing']
+##teamcity[testSuiteFinished name='tst_Nothing' flowId='tst_Nothing']
+##teamcity[testSuiteStarted name='tst_Nothing' flowId='tst_Nothing']
+##teamcity[testStarted name='initTestCase()' flowId='tst_Nothing']
+##teamcity[testFinished name='initTestCase()' flowId='tst_Nothing']
+##teamcity[testStarted name='nothing()' flowId='tst_Nothing']
+##teamcity[testFinished name='nothing()' flowId='tst_Nothing']
+##teamcity[testStarted name='cleanupTestCase()' flowId='tst_Nothing']
+##teamcity[testFinished name='cleanupTestCase()' flowId='tst_Nothing']
+##teamcity[testSuiteFinished name='tst_Nothing' flowId='tst_Nothing']
+##teamcity[testSuiteStarted name='tst_Nothing' flowId='tst_Nothing']
+##teamcity[testStarted name='initTestCase()' flowId='tst_Nothing']
+##teamcity[testFinished name='initTestCase()' flowId='tst_Nothing']
+##teamcity[testStarted name='nothing()' flowId='tst_Nothing']
+##teamcity[testFinished name='nothing()' flowId='tst_Nothing']
+##teamcity[testStarted name='cleanupTestCase()' flowId='tst_Nothing']
+##teamcity[testFinished name='cleanupTestCase()' flowId='tst_Nothing']
+##teamcity[testSuiteFinished name='tst_Nothing' flowId='tst_Nothing']
diff --git a/tests/auto/testlib/selftests/expected_multiexec.txt b/tests/auto/testlib/selftests/expected_multiexec.txt
index f3cd942e38..28a5e5679e 100644
--- a/tests/auto/testlib/selftests/expected_multiexec.txt
+++ b/tests/auto/testlib/selftests/expected_multiexec.txt
@@ -1,35 +1,35 @@
********* Start testing of tst_Nothing *********
-Config: Using QtTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@
+Config: Using QtTest library
PASS : tst_Nothing::initTestCase()
PASS : tst_Nothing::nothing()
PASS : tst_Nothing::cleanupTestCase()
-Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted
+Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms
********* Finished testing of tst_Nothing *********
********* Start testing of tst_Nothing *********
-Config: Using QtTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@
+Config: Using QtTest library
PASS : tst_Nothing::initTestCase()
PASS : tst_Nothing::nothing()
PASS : tst_Nothing::cleanupTestCase()
-Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted
+Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms
********* Finished testing of tst_Nothing *********
********* Start testing of tst_Nothing *********
-Config: Using QtTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@
+Config: Using QtTest library
PASS : tst_Nothing::initTestCase()
PASS : tst_Nothing::nothing()
PASS : tst_Nothing::cleanupTestCase()
-Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted
+Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms
********* Finished testing of tst_Nothing *********
********* Start testing of tst_Nothing *********
-Config: Using QtTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@
+Config: Using QtTest library
PASS : tst_Nothing::initTestCase()
PASS : tst_Nothing::nothing()
PASS : tst_Nothing::cleanupTestCase()
-Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted
+Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms
********* Finished testing of tst_Nothing *********
********* Start testing of tst_Nothing *********
-Config: Using QtTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@
+Config: Using QtTest library
PASS : tst_Nothing::initTestCase()
PASS : tst_Nothing::nothing()
PASS : tst_Nothing::cleanupTestCase()
-Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted
+Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms
********* Finished testing of tst_Nothing *********
diff --git a/tests/auto/testlib/selftests/expected_multiexec.xml b/tests/auto/testlib/selftests/expected_multiexec.xml
new file mode 100644
index 0000000000..e160b4f3e6
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_multiexec.xml
@@ -0,0 +1,105 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<TestCase name="tst_Nothing">
+<Environment>
+ <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>
+ <QtBuild/>
+ <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion>
+</Environment>
+<TestFunction name="initTestCase">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="nothing">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="cleanupTestCase">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<Duration msecs="0"/>
+</TestCase>
+<?xml version="1.0" encoding="UTF-8"?>
+<TestCase name="tst_Nothing">
+<Environment>
+ <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>
+ <QtBuild/>
+ <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion>
+</Environment>
+<TestFunction name="initTestCase">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="nothing">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="cleanupTestCase">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<Duration msecs="0"/>
+</TestCase>
+<?xml version="1.0" encoding="UTF-8"?>
+<TestCase name="tst_Nothing">
+<Environment>
+ <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>
+ <QtBuild/>
+ <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion>
+</Environment>
+<TestFunction name="initTestCase">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="nothing">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="cleanupTestCase">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<Duration msecs="0"/>
+</TestCase>
+<?xml version="1.0" encoding="UTF-8"?>
+<TestCase name="tst_Nothing">
+<Environment>
+ <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>
+ <QtBuild/>
+ <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion>
+</Environment>
+<TestFunction name="initTestCase">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="nothing">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="cleanupTestCase">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<Duration msecs="0"/>
+</TestCase>
+<?xml version="1.0" encoding="UTF-8"?>
+<TestCase name="tst_Nothing">
+<Environment>
+ <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>
+ <QtBuild/>
+ <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion>
+</Environment>
+<TestFunction name="initTestCase">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="nothing">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="cleanupTestCase">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<Duration msecs="0"/>
+</TestCase>
diff --git a/tests/auto/testlib/selftests/expected_multiexec.xunitxml b/tests/auto/testlib/selftests/expected_multiexec.xunitxml
new file mode 100644
index 0000000000..8ab914842b
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_multiexec.xunitxml
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<testsuite errors="0" failures="0" tests="3" name="tst_Nothing">
+ <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"/>
+ <testcase result="pass" name="nothing"/>
+ <testcase result="pass" name="cleanupTestCase"/>
+ <system-err/>
+</testsuite>
+<?xml version="1.0" encoding="UTF-8" ?>
+<testsuite errors="0" failures="0" tests="3" name="tst_Nothing">
+ <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"/>
+ <testcase result="pass" name="nothing"/>
+ <testcase result="pass" name="cleanupTestCase"/>
+ <system-err/>
+</testsuite>
+<?xml version="1.0" encoding="UTF-8" ?>
+<testsuite errors="0" failures="0" tests="3" name="tst_Nothing">
+ <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"/>
+ <testcase result="pass" name="nothing"/>
+ <testcase result="pass" name="cleanupTestCase"/>
+ <system-err/>
+</testsuite>
+<?xml version="1.0" encoding="UTF-8" ?>
+<testsuite errors="0" failures="0" tests="3" name="tst_Nothing">
+ <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"/>
+ <testcase result="pass" name="nothing"/>
+ <testcase result="pass" name="cleanupTestCase"/>
+ <system-err/>
+</testsuite>
+<?xml version="1.0" encoding="UTF-8" ?>
+<testsuite errors="0" failures="0" tests="3" name="tst_Nothing">
+ <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"/>
+ <testcase result="pass" name="nothing"/>
+ <testcase result="pass" name="cleanupTestCase"/>
+ <system-err/>
+</testsuite>
diff --git a/tests/auto/testlib/selftests/expected_pairdiagnostics.lightxml b/tests/auto/testlib/selftests/expected_pairdiagnostics.lightxml
index 95b932e3c4..7a842e9d36 100644
--- a/tests/auto/testlib/selftests/expected_pairdiagnostics.lightxml
+++ b/tests/auto/testlib/selftests/expected_pairdiagnostics.lightxml
@@ -8,7 +8,7 @@
<Duration msecs="0"/>
</TestFunction>
<TestFunction name="testQPair">
-<Incident type="fail" file="../../../qt5/qtbase_fixItemData/tests/auto/testlib/selftests/pairdiagnostics/tst_pairdiagnostics.cpp" line="51">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/pairdiagnostics/tst_pairdiagnostics.cpp" line="0">
<Description><![CDATA[Compared values are not the same
Actual (pair1): "QPair(1,1)"
Expected (pair2): "QPair(1,2)"]]></Description>
@@ -16,7 +16,7 @@
<Duration msecs="0"/>
</TestFunction>
<TestFunction name="testStdPair">
-<Incident type="fail" file="../../../qt5/qtbase_fixItemData/tests/auto/testlib/selftests/pairdiagnostics/tst_pairdiagnostics.cpp" line="58">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/pairdiagnostics/tst_pairdiagnostics.cpp" line="0">
<Description><![CDATA[Compared values are not the same
Actual (pair1): "std::pair(1,1)"
Expected (pair2): "std::pair(1,2)"]]></Description>
diff --git a/tests/auto/testlib/selftests/expected_pairdiagnostics.teamcity b/tests/auto/testlib/selftests/expected_pairdiagnostics.teamcity
index 06883570ac..9068e2c45b 100644
--- a/tests/auto/testlib/selftests/expected_pairdiagnostics.teamcity
+++ b/tests/auto/testlib/selftests/expected_pairdiagnostics.teamcity
@@ -2,10 +2,10 @@
##teamcity[testStarted name='initTestCase()' flowId='tst_PairDiagnostics']
##teamcity[testFinished name='initTestCase()' flowId='tst_PairDiagnostics']
##teamcity[testStarted name='testQPair()' flowId='tst_PairDiagnostics']
-##teamcity[testFailed name='testQPair()' message='Failure! |[Loc: ../../../qt5/qtbase_fixItemData/tests/auto/testlib/selftests/pairdiagnostics/tst_pairdiagnostics.cpp(51)|]' details='Compared values are not the same|n Actual (pair1): "QPair(1,1)"|n Expected (pair2): "QPair(1,2)"' flowId='tst_PairDiagnostics']
+##teamcity[testFailed name='testQPair()' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/pairdiagnostics/tst_pairdiagnostics.cpp(0)|]' details='Compared values are not the same|n Actual (pair1): "QPair(1,1)"|n Expected (pair2): "QPair(1,2)"' flowId='tst_PairDiagnostics']
##teamcity[testFinished name='testQPair()' flowId='tst_PairDiagnostics']
##teamcity[testStarted name='testStdPair()' flowId='tst_PairDiagnostics']
-##teamcity[testFailed name='testStdPair()' message='Failure! |[Loc: ../../../qt5/qtbase_fixItemData/tests/auto/testlib/selftests/pairdiagnostics/tst_pairdiagnostics.cpp(58)|]' details='Compared values are not the same|n Actual (pair1): "std::pair(1,1)"|n Expected (pair2): "std::pair(1,2)"' flowId='tst_PairDiagnostics']
+##teamcity[testFailed name='testStdPair()' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/pairdiagnostics/tst_pairdiagnostics.cpp(0)|]' details='Compared values are not the same|n Actual (pair1): "std::pair(1,1)"|n Expected (pair2): "std::pair(1,2)"' flowId='tst_PairDiagnostics']
##teamcity[testFinished name='testStdPair()' flowId='tst_PairDiagnostics']
##teamcity[testStarted name='cleanupTestCase()' flowId='tst_PairDiagnostics']
##teamcity[testFinished name='cleanupTestCase()' flowId='tst_PairDiagnostics']
diff --git a/tests/auto/testlib/selftests/expected_pairdiagnostics.txt b/tests/auto/testlib/selftests/expected_pairdiagnostics.txt
index e09b9a560f..5e29888ba6 100644
--- a/tests/auto/testlib/selftests/expected_pairdiagnostics.txt
+++ b/tests/auto/testlib/selftests/expected_pairdiagnostics.txt
@@ -1,14 +1,14 @@
********* Start testing of tst_PairDiagnostics *********
-Config: Using QtTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@
+Config: Using QtTest library
PASS : tst_PairDiagnostics::initTestCase()
FAIL! : tst_PairDiagnostics::testQPair() Compared values are not the same
Actual (pair1): "QPair(1,1)"
Expected (pair2): "QPair(1,2)"
- Loc: [../../../qt5/qtbase_fixItemData/tests/auto/testlib/selftests/pairdiagnostics/tst_pairdiagnostics.cpp(51)]
+ Loc: [qtbase/tests/auto/testlib/selftests/pairdiagnostics/tst_pairdiagnostics.cpp(0)]
FAIL! : tst_PairDiagnostics::testStdPair() Compared values are not the same
Actual (pair1): "std::pair(1,1)"
Expected (pair2): "std::pair(1,2)"
- Loc: [../../../qt5/qtbase_fixItemData/tests/auto/testlib/selftests/pairdiagnostics/tst_pairdiagnostics.cpp(58)]
+ Loc: [qtbase/tests/auto/testlib/selftests/pairdiagnostics/tst_pairdiagnostics.cpp(0)]
PASS : tst_PairDiagnostics::cleanupTestCase()
-Totals: 2 passed, 2 failed, 0 skipped, 0 blacklisted, 1ms
+Totals: 2 passed, 2 failed, 0 skipped, 0 blacklisted, 0ms
********* Finished testing of tst_PairDiagnostics *********
diff --git a/tests/auto/testlib/selftests/expected_pairdiagnostics.xml b/tests/auto/testlib/selftests/expected_pairdiagnostics.xml
index 47921e0b8a..cd98e4d36e 100644
--- a/tests/auto/testlib/selftests/expected_pairdiagnostics.xml
+++ b/tests/auto/testlib/selftests/expected_pairdiagnostics.xml
@@ -7,27 +7,27 @@
</Environment>
<TestFunction name="initTestCase">
<Incident type="pass" file="" line="0" />
- <Duration msecs="0.680795"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testQPair">
-<Incident type="fail" file="../../../qt5/qtbase_fixItemData/tests/auto/testlib/selftests/pairdiagnostics/tst_pairdiagnostics.cpp" line="51">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/pairdiagnostics/tst_pairdiagnostics.cpp" line="0">
<Description><![CDATA[Compared values are not the same
Actual (pair1): "QPair(1,1)"
Expected (pair2): "QPair(1,2)"]]></Description>
</Incident>
- <Duration msecs="0.085705"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testStdPair">
-<Incident type="fail" file="../../../qt5/qtbase_fixItemData/tests/auto/testlib/selftests/pairdiagnostics/tst_pairdiagnostics.cpp" line="58">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/pairdiagnostics/tst_pairdiagnostics.cpp" line="0">
<Description><![CDATA[Compared values are not the same
Actual (pair1): "std::pair(1,1)"
Expected (pair2): "std::pair(1,2)"]]></Description>
</Incident>
- <Duration msecs="0.030780"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="cleanupTestCase">
<Incident type="pass" file="" line="0" />
- <Duration msecs="0.039052"/>
+ <Duration msecs="0"/>
</TestFunction>
-<Duration msecs="0.995227"/>
+<Duration msecs="0"/>
</TestCase>
diff --git a/tests/auto/testlib/selftests/expected_qexecstringlist.lightxml b/tests/auto/testlib/selftests/expected_qexecstringlist.lightxml
new file mode 100644
index 0000000000..c6db60bb1f
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_qexecstringlist.lightxml
@@ -0,0 +1,75 @@
+<Environment>
+ <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>
+ <QtBuild/>
+ <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion>
+</Environment>
+<TestFunction name="initTestCase">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="testA">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="testB">
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[Data1]]></DataTag>
+</Incident>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[Data2]]></DataTag>
+</Incident>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[Data3]]></DataTag>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="testC">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="cleanupTestCase">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<Duration msecs="0"/>
+********* Start testing of tst_QExecStringList *********
+Config: Using QtTest library
+PASS : tst_QExecStringList::initTestCase()
+PASS : tst_QExecStringList::testA()
+PASS : tst_QExecStringList::testB(Data1)
+PASS : tst_QExecStringList::testB(Data2)
+PASS : tst_QExecStringList::testB(Data3)
+PASS : tst_QExecStringList::testC()
+PASS : tst_QExecStringList::cleanupTestCase()
+Totals: 7 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms
+********* Finished testing of tst_QExecStringList *********
+********* Start testing of tst_QExecStringList *********
+Config: Using QtTest library
+PASS : tst_QExecStringList::initTestCase()
+PASS : tst_QExecStringList::testA()
+PASS : tst_QExecStringList::cleanupTestCase()
+Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms
+********* Finished testing of tst_QExecStringList *********
+********* Start testing of tst_QExecStringList *********
+Config: Using QtTest library
+PASS : tst_QExecStringList::initTestCase()
+PASS : tst_QExecStringList::testB(Data1)
+PASS : tst_QExecStringList::testB(Data2)
+PASS : tst_QExecStringList::testB(Data3)
+PASS : tst_QExecStringList::cleanupTestCase()
+Totals: 5 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms
+********* Finished testing of tst_QExecStringList *********
+********* Start testing of tst_QExecStringList *********
+Config: Using QtTest library
+PASS : tst_QExecStringList::initTestCase()
+PASS : tst_QExecStringList::testB(Data2)
+PASS : tst_QExecStringList::cleanupTestCase()
+Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms
+********* Finished testing of tst_QExecStringList *********
+********* Start testing of tst_QExecStringList *********
+Config: Using QtTest library
+PASS : tst_QExecStringList::initTestCase()
+PASS : tst_QExecStringList::testC()
+PASS : tst_QExecStringList::cleanupTestCase()
+Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms
+********* Finished testing of tst_QExecStringList *********
diff --git a/tests/auto/testlib/selftests/expected_qexecstringlist.teamcity b/tests/auto/testlib/selftests/expected_qexecstringlist.teamcity
new file mode 100644
index 0000000000..bb7ae829dd
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_qexecstringlist.teamcity
@@ -0,0 +1,57 @@
+##teamcity[testSuiteStarted name='tst_QExecStringList' flowId='tst_QExecStringList']
+##teamcity[testStarted name='initTestCase()' flowId='tst_QExecStringList']
+##teamcity[testFinished name='initTestCase()' flowId='tst_QExecStringList']
+##teamcity[testStarted name='testA()' flowId='tst_QExecStringList']
+##teamcity[testFinished name='testA()' flowId='tst_QExecStringList']
+##teamcity[testStarted name='testB(Data1)' flowId='tst_QExecStringList']
+##teamcity[testFinished name='testB(Data1)' flowId='tst_QExecStringList']
+##teamcity[testStarted name='testB(Data2)' flowId='tst_QExecStringList']
+##teamcity[testFinished name='testB(Data2)' flowId='tst_QExecStringList']
+##teamcity[testStarted name='testB(Data3)' flowId='tst_QExecStringList']
+##teamcity[testFinished name='testB(Data3)' flowId='tst_QExecStringList']
+##teamcity[testStarted name='testC()' flowId='tst_QExecStringList']
+##teamcity[testFinished name='testC()' flowId='tst_QExecStringList']
+##teamcity[testStarted name='cleanupTestCase()' flowId='tst_QExecStringList']
+##teamcity[testFinished name='cleanupTestCase()' flowId='tst_QExecStringList']
+##teamcity[testSuiteFinished name='tst_QExecStringList' flowId='tst_QExecStringList']
+********* Start testing of tst_QExecStringList *********
+Config: Using QtTest library
+PASS : tst_QExecStringList::initTestCase()
+PASS : tst_QExecStringList::testA()
+PASS : tst_QExecStringList::testB(Data1)
+PASS : tst_QExecStringList::testB(Data2)
+PASS : tst_QExecStringList::testB(Data3)
+PASS : tst_QExecStringList::testC()
+PASS : tst_QExecStringList::cleanupTestCase()
+Totals: 7 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms
+********* Finished testing of tst_QExecStringList *********
+********* Start testing of tst_QExecStringList *********
+Config: Using QtTest library
+PASS : tst_QExecStringList::initTestCase()
+PASS : tst_QExecStringList::testA()
+PASS : tst_QExecStringList::cleanupTestCase()
+Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms
+********* Finished testing of tst_QExecStringList *********
+********* Start testing of tst_QExecStringList *********
+Config: Using QtTest library
+PASS : tst_QExecStringList::initTestCase()
+PASS : tst_QExecStringList::testB(Data1)
+PASS : tst_QExecStringList::testB(Data2)
+PASS : tst_QExecStringList::testB(Data3)
+PASS : tst_QExecStringList::cleanupTestCase()
+Totals: 5 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms
+********* Finished testing of tst_QExecStringList *********
+********* Start testing of tst_QExecStringList *********
+Config: Using QtTest library
+PASS : tst_QExecStringList::initTestCase()
+PASS : tst_QExecStringList::testB(Data2)
+PASS : tst_QExecStringList::cleanupTestCase()
+Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms
+********* Finished testing of tst_QExecStringList *********
+********* Start testing of tst_QExecStringList *********
+Config: Using QtTest library
+PASS : tst_QExecStringList::initTestCase()
+PASS : tst_QExecStringList::testC()
+PASS : tst_QExecStringList::cleanupTestCase()
+Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms
+********* Finished testing of tst_QExecStringList *********
diff --git a/tests/auto/testlib/selftests/expected_qexecstringlist.txt b/tests/auto/testlib/selftests/expected_qexecstringlist.txt
index 830e7e8b36..480baedd0a 100644
--- a/tests/auto/testlib/selftests/expected_qexecstringlist.txt
+++ b/tests/auto/testlib/selftests/expected_qexecstringlist.txt
@@ -1,5 +1,5 @@
********* Start testing of tst_QExecStringList *********
-Config: Using QtTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@
+Config: Using QtTest library
PASS : tst_QExecStringList::initTestCase()
PASS : tst_QExecStringList::testA()
PASS : tst_QExecStringList::testB(Data1)
@@ -7,10 +7,10 @@ PASS : tst_QExecStringList::testB(Data2)
PASS : tst_QExecStringList::testB(Data3)
PASS : tst_QExecStringList::testC()
PASS : tst_QExecStringList::cleanupTestCase()
-Totals: 7 passed, 0 failed, 0 skipped, 0 blacklisted
+Totals: 7 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms
********* Finished testing of tst_QExecStringList *********
********* Start testing of tst_QExecStringList *********
-Config: Using QtTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@
+Config: Using QtTest library
PASS : tst_QExecStringList::initTestCase()
PASS : tst_QExecStringList::testA()
PASS : tst_QExecStringList::testB(Data1)
@@ -18,35 +18,35 @@ PASS : tst_QExecStringList::testB(Data2)
PASS : tst_QExecStringList::testB(Data3)
PASS : tst_QExecStringList::testC()
PASS : tst_QExecStringList::cleanupTestCase()
-Totals: 7 passed, 0 failed, 0 skipped, 0 blacklisted
+Totals: 7 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms
********* Finished testing of tst_QExecStringList *********
********* Start testing of tst_QExecStringList *********
-Config: Using QtTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@
+Config: Using QtTest library
PASS : tst_QExecStringList::initTestCase()
PASS : tst_QExecStringList::testA()
PASS : tst_QExecStringList::cleanupTestCase()
-Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted
+Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms
********* Finished testing of tst_QExecStringList *********
********* Start testing of tst_QExecStringList *********
-Config: Using QtTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@
+Config: Using QtTest library
PASS : tst_QExecStringList::initTestCase()
PASS : tst_QExecStringList::testB(Data1)
PASS : tst_QExecStringList::testB(Data2)
PASS : tst_QExecStringList::testB(Data3)
PASS : tst_QExecStringList::cleanupTestCase()
-Totals: 5 passed, 0 failed, 0 skipped, 0 blacklisted
+Totals: 5 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms
********* Finished testing of tst_QExecStringList *********
********* Start testing of tst_QExecStringList *********
-Config: Using QtTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@
+Config: Using QtTest library
PASS : tst_QExecStringList::initTestCase()
PASS : tst_QExecStringList::testB(Data2)
PASS : tst_QExecStringList::cleanupTestCase()
-Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted
+Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms
********* Finished testing of tst_QExecStringList *********
********* Start testing of tst_QExecStringList *********
-Config: Using QtTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@
+Config: Using QtTest library
PASS : tst_QExecStringList::initTestCase()
PASS : tst_QExecStringList::testC()
PASS : tst_QExecStringList::cleanupTestCase()
-Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted
+Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms
********* Finished testing of tst_QExecStringList *********
diff --git a/tests/auto/testlib/selftests/expected_qexecstringlist.xml b/tests/auto/testlib/selftests/expected_qexecstringlist.xml
new file mode 100644
index 0000000000..403d2725b0
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_qexecstringlist.xml
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<TestCase name="tst_QExecStringList">
+<Environment>
+ <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>
+ <QtBuild/>
+ <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion>
+</Environment>
+<TestFunction name="initTestCase">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="testA">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="testB">
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[Data1]]></DataTag>
+</Incident>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[Data2]]></DataTag>
+</Incident>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[Data3]]></DataTag>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="testC">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="cleanupTestCase">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<Duration msecs="0"/>
+</TestCase>
+********* Start testing of tst_QExecStringList *********
+Config: Using QtTest library
+PASS : tst_QExecStringList::initTestCase()
+PASS : tst_QExecStringList::testA()
+PASS : tst_QExecStringList::testB(Data1)
+PASS : tst_QExecStringList::testB(Data2)
+PASS : tst_QExecStringList::testB(Data3)
+PASS : tst_QExecStringList::testC()
+PASS : tst_QExecStringList::cleanupTestCase()
+Totals: 7 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms
+********* Finished testing of tst_QExecStringList *********
+********* Start testing of tst_QExecStringList *********
+Config: Using QtTest library
+PASS : tst_QExecStringList::initTestCase()
+PASS : tst_QExecStringList::testA()
+PASS : tst_QExecStringList::cleanupTestCase()
+Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms
+********* Finished testing of tst_QExecStringList *********
+********* Start testing of tst_QExecStringList *********
+Config: Using QtTest library
+PASS : tst_QExecStringList::initTestCase()
+PASS : tst_QExecStringList::testB(Data1)
+PASS : tst_QExecStringList::testB(Data2)
+PASS : tst_QExecStringList::testB(Data3)
+PASS : tst_QExecStringList::cleanupTestCase()
+Totals: 5 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms
+********* Finished testing of tst_QExecStringList *********
+********* Start testing of tst_QExecStringList *********
+Config: Using QtTest library
+PASS : tst_QExecStringList::initTestCase()
+PASS : tst_QExecStringList::testB(Data2)
+PASS : tst_QExecStringList::cleanupTestCase()
+Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms
+********* Finished testing of tst_QExecStringList *********
+********* Start testing of tst_QExecStringList *********
+Config: Using QtTest library
+PASS : tst_QExecStringList::initTestCase()
+PASS : tst_QExecStringList::testC()
+PASS : tst_QExecStringList::cleanupTestCase()
+Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms
+********* Finished testing of tst_QExecStringList *********
diff --git a/tests/auto/testlib/selftests/expected_qexecstringlist.xunitxml b/tests/auto/testlib/selftests/expected_qexecstringlist.xunitxml
new file mode 100644
index 0000000000..b352b8e6b9
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_qexecstringlist.xunitxml
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<testsuite errors="0" failures="0" tests="5" name="tst_QExecStringList">
+ <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"/>
+ <testcase result="pass" name="testA"/>
+ <testcase result="pass" name="testB"/>
+ <testcase result="pass" name="testC"/>
+ <testcase result="pass" name="cleanupTestCase"/>
+ <system-err/>
+</testsuite>
+********* Start testing of tst_QExecStringList *********
+Config: Using QtTest library
+PASS : tst_QExecStringList::initTestCase()
+PASS : tst_QExecStringList::testA()
+PASS : tst_QExecStringList::testB(Data1)
+PASS : tst_QExecStringList::testB(Data2)
+PASS : tst_QExecStringList::testB(Data3)
+PASS : tst_QExecStringList::testC()
+PASS : tst_QExecStringList::cleanupTestCase()
+Totals: 7 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms
+********* Finished testing of tst_QExecStringList *********
+********* Start testing of tst_QExecStringList *********
+Config: Using QtTest library
+PASS : tst_QExecStringList::initTestCase()
+PASS : tst_QExecStringList::testA()
+PASS : tst_QExecStringList::cleanupTestCase()
+Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms
+********* Finished testing of tst_QExecStringList *********
+********* Start testing of tst_QExecStringList *********
+Config: Using QtTest library
+PASS : tst_QExecStringList::initTestCase()
+PASS : tst_QExecStringList::testB(Data1)
+PASS : tst_QExecStringList::testB(Data2)
+PASS : tst_QExecStringList::testB(Data3)
+PASS : tst_QExecStringList::cleanupTestCase()
+Totals: 5 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms
+********* Finished testing of tst_QExecStringList *********
+********* Start testing of tst_QExecStringList *********
+Config: Using QtTest library
+PASS : tst_QExecStringList::initTestCase()
+PASS : tst_QExecStringList::testB(Data2)
+PASS : tst_QExecStringList::cleanupTestCase()
+Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms
+********* Finished testing of tst_QExecStringList *********
+********* Start testing of tst_QExecStringList *********
+Config: Using QtTest library
+PASS : tst_QExecStringList::initTestCase()
+PASS : tst_QExecStringList::testC()
+PASS : tst_QExecStringList::cleanupTestCase()
+Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms
+********* Finished testing of tst_QExecStringList *********
diff --git a/tests/auto/testlib/selftests/expected_silent.lightxml b/tests/auto/testlib/selftests/expected_silent.lightxml
new file mode 100644
index 0000000000..29b582cb4b
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_silent.lightxml
@@ -0,0 +1,66 @@
+<Environment>
+ <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>
+ <QtBuild/>
+ <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion>
+</Environment>
+<TestFunction name="initTestCase">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="pass">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="skip">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/silent/tst_silent.cpp" line="0">
+ <Description><![CDATA[This test should skip]]></Description>
+</Message>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="fail">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/silent/tst_silent.cpp" line="0">
+ <Description><![CDATA['false' returned FALSE. (This test should fail)]]></Description>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="xfail">
+<Incident type="xfail" file="qtbase/tests/auto/testlib/selftests/silent/tst_silent.cpp" line="0">
+ <Description><![CDATA[This test should XFAIL]]></Description>
+</Incident>
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="xpass">
+<Incident type="xpass" file="qtbase/tests/auto/testlib/selftests/silent/tst_silent.cpp" line="0">
+ <Description><![CDATA['true' returned TRUE unexpectedly. (This test should XPASS)]]></Description>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="messages">
+<Message type="qwarn" file="" line="0">
+ <Description><![CDATA[This is a warning that should not appear in silent test output]]></Description>
+</Message>
+<Message type="warn" file="qtbase/tests/auto/testlib/selftests/silent/tst_silent.cpp" line="0">
+ <Description><![CDATA[This is an internal testlib warning that should not appear in silent test output]]></Description>
+</Message>
+<Message type="qdebug" file="" line="0">
+ <Description><![CDATA[This is a debug message that should not appear in silent test output]]></Description>
+</Message>
+<Message type="system" file="" line="0">
+ <Description><![CDATA[This is a critical message that should not appear in silent test output]]></Description>
+</Message>
+<Message type="qinfo" file="" line="0">
+ <Description><![CDATA[This is an info message that should not appear in silent test output]]></Description>
+</Message>
+<Message type="info" file="qtbase/tests/auto/testlib/selftests/silent/tst_silent.cpp" line="0">
+ <Description><![CDATA[This is an internal testlib info message that should not appear in silent test output]]></Description>
+</Message>
+<Message type="qfatal" file="" line="0">
+ <Description><![CDATA[This is a fatal error message that should still appear in silent test output]]></Description>
+</Message>
+<Incident type="fail" file="Unknown file" line="0">
+ <Description><![CDATA[Received a fatal error.]]></Description>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<Duration msecs="0"/>
diff --git a/tests/auto/testlib/selftests/expected_silent.teamcity b/tests/auto/testlib/selftests/expected_silent.teamcity
index 0f68bcb437..327d667fee 100644
--- a/tests/auto/testlib/selftests/expected_silent.teamcity
+++ b/tests/auto/testlib/selftests/expected_silent.teamcity
@@ -1,12 +1,12 @@
##teamcity[testSuiteStarted name='tst_Silent' flowId='tst_Silent']
##teamcity[testStarted name='fail()' flowId='tst_Silent']
-##teamcity[testFailed name='fail()' message='Failure! |[Loc: tst_silent.cpp(65)|]' details='|'false|' returned FALSE. (This test should fail)' flowId='tst_Silent']
+##teamcity[testFailed name='fail()' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/silent/tst_silent.cpp(0)|]' details='|'false|' returned FALSE. (This test should fail)' flowId='tst_Silent']
##teamcity[testFinished name='fail()' flowId='tst_Silent']
##teamcity[testStarted name='xpass()' flowId='tst_Silent']
-##teamcity[testFailed name='xpass()' message='Failure! |[Loc: tst_silent.cpp(77)|]' details='|'true|' returned TRUE unexpectedly. (This test should XPASS)' flowId='tst_Silent']
+##teamcity[testFailed name='xpass()' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/silent/tst_silent.cpp(0)|]' details='|'true|' returned TRUE unexpectedly. (This test should XPASS)' flowId='tst_Silent']
##teamcity[testFinished name='xpass()' flowId='tst_Silent']
##teamcity[testStarted name='messages()' flowId='tst_Silent']
-##teamcity[testFailed name='messages()' message='Failure! |[Loc: unknown file(0)|]' details='Received a fatal error.' flowId='tst_Silent']
+##teamcity[testFailed name='messages()' message='Failure! |[Loc: Unknown file(0)|]' details='Received a fatal error.' flowId='tst_Silent']
##teamcity[testStdOut name='messages()' out='QFATAL: This is a fatal error message that should still appear in silent test output' flowId='tst_Silent']
##teamcity[testFinished name='messages()' flowId='tst_Silent']
##teamcity[testSuiteFinished name='tst_Silent' flowId='tst_Silent']
diff --git a/tests/auto/testlib/selftests/expected_silent.txt b/tests/auto/testlib/selftests/expected_silent.txt
index 34728f5829..b70a97dbac 100644
--- a/tests/auto/testlib/selftests/expected_silent.txt
+++ b/tests/auto/testlib/selftests/expected_silent.txt
@@ -1,9 +1,9 @@
Testing tst_Silent
FAIL! : tst_Silent::fail() 'false' returned FALSE. (This test should fail)
- Loc: [tst_silent.cpp(73)]
+ Loc: [qtbase/tests/auto/testlib/selftests/silent/tst_silent.cpp(0)]
XPASS : tst_Silent::xpass() 'true' returned TRUE unexpectedly. (This test should XPASS)
- Loc: [tst_silent.cpp(85)]
+ Loc: [qtbase/tests/auto/testlib/selftests/silent/tst_silent.cpp(0)]
QFATAL : tst_Silent::messages() This is a fatal error message that should still appear in silent test output
FAIL! : tst_Silent::messages() Received a fatal error.
Loc: [Unknown file(0)]
-Totals: 3 passed, 3 failed, 1 skipped, 0 blacklisted
+Totals: 3 passed, 3 failed, 1 skipped, 0 blacklisted, 0ms
diff --git a/tests/auto/testlib/selftests/expected_silent.xml b/tests/auto/testlib/selftests/expected_silent.xml
new file mode 100644
index 0000000000..6d2fae9fab
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_silent.xml
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<TestCase name="tst_Silent">
+<Environment>
+ <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>
+ <QtBuild/>
+ <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion>
+</Environment>
+<TestFunction name="initTestCase">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="pass">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="skip">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/silent/tst_silent.cpp" line="0">
+ <Description><![CDATA[This test should skip]]></Description>
+</Message>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="fail">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/silent/tst_silent.cpp" line="0">
+ <Description><![CDATA['false' returned FALSE. (This test should fail)]]></Description>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="xfail">
+<Incident type="xfail" file="qtbase/tests/auto/testlib/selftests/silent/tst_silent.cpp" line="0">
+ <Description><![CDATA[This test should XFAIL]]></Description>
+</Incident>
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="xpass">
+<Incident type="xpass" file="qtbase/tests/auto/testlib/selftests/silent/tst_silent.cpp" line="0">
+ <Description><![CDATA['true' returned TRUE unexpectedly. (This test should XPASS)]]></Description>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="messages">
+<Message type="qwarn" file="" line="0">
+ <Description><![CDATA[This is a warning that should not appear in silent test output]]></Description>
+</Message>
+<Message type="warn" file="qtbase/tests/auto/testlib/selftests/silent/tst_silent.cpp" line="0">
+ <Description><![CDATA[This is an internal testlib warning that should not appear in silent test output]]></Description>
+</Message>
+<Message type="qdebug" file="" line="0">
+ <Description><![CDATA[This is a debug message that should not appear in silent test output]]></Description>
+</Message>
+<Message type="system" file="" line="0">
+ <Description><![CDATA[This is a critical message that should not appear in silent test output]]></Description>
+</Message>
+<Message type="qinfo" file="" line="0">
+ <Description><![CDATA[This is an info message that should not appear in silent test output]]></Description>
+</Message>
+<Message type="info" file="qtbase/tests/auto/testlib/selftests/silent/tst_silent.cpp" line="0">
+ <Description><![CDATA[This is an internal testlib info message that should not appear in silent test output]]></Description>
+</Message>
+<Message type="qfatal" file="" line="0">
+ <Description><![CDATA[This is a fatal error message that should still appear in silent test output]]></Description>
+</Message>
+<Incident type="fail" file="Unknown file" line="0">
+ <Description><![CDATA[Received a fatal error.]]></Description>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<Duration msecs="0"/>
+</TestCase>
diff --git a/tests/auto/testlib/selftests/expected_silent.xunitxml b/tests/auto/testlib/selftests/expected_silent.xunitxml
new file mode 100644
index 0000000000..ea229d1dc7
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_silent.xunitxml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<testsuite errors="9" failures="3" tests="7" name="tst_Silent">
+ <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"/>
+ <testcase result="pass" name="pass"/>
+ <testcase name="skip">
+ <!-- message="This test should skip" type="skip" -->
+ </testcase>
+ <testcase result="fail" name="fail">
+ <failure message="&apos;false&apos; returned FALSE. (This test should fail)" result="fail"/>
+ </testcase>
+ <testcase result="xfail" name="xfail">
+ <!-- message="This test should XFAIL" type="info" -->
+ </testcase>
+ <testcase result="xpass" name="xpass">
+ <failure message="&apos;true&apos; returned TRUE unexpectedly. (This test should XPASS)" result="xpass"/>
+ </testcase>
+ <testcase result="fail" name="messages">
+ <!-- message="This is a warning that should not appear in silent test output" type="qwarn" -->
+ <!-- message="This is an internal testlib warning that should not appear in silent test output" type="warn" -->
+ <!-- message="This is a debug message that should not appear in silent test output" type="qdebug" -->
+ <!-- message="This is a critical message that should not appear in silent test output" type="system" -->
+ <!-- message="This is an info message that should not appear in silent test output" type="qinfo" -->
+ <!-- message="This is an internal testlib info message that should not appear in silent test output" type="info" -->
+ <!-- message="This is a fatal error message that should still appear in silent test output" type="qfatal" -->
+ <failure message="Received a fatal error." result="fail"/>
+ </testcase>
+ <system-err>
+<![CDATA[This test should skip]]>
+<![CDATA[This test should XFAIL]]>
+<![CDATA[This is a warning that should not appear in silent test output]]>
+<![CDATA[This is an internal testlib warning that should not appear in silent test output]]>
+<![CDATA[This is a debug message that should not appear in silent test output]]>
+<![CDATA[This is a critical message that should not appear in silent test output]]>
+<![CDATA[This is an info message that should not appear in silent test output]]>
+<![CDATA[This is an internal testlib info message that should not appear in silent test output]]>
+<![CDATA[This is a fatal error message that should still appear in silent test output]]>
+ </system-err>
+</testsuite>
diff --git a/tests/auto/testlib/selftests/expected_singleskip.lightxml b/tests/auto/testlib/selftests/expected_singleskip.lightxml
index ce09c0a9ad..10e35ae27b 100644
--- a/tests/auto/testlib/selftests/expected_singleskip.lightxml
+++ b/tests/auto/testlib/selftests/expected_singleskip.lightxml
@@ -5,16 +5,16 @@
</Environment>
<TestFunction name="initTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="myTest">
-<Message type="skip" file="tst_singleskip.cpp" line="56">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/singleskip/tst_singleskip.cpp" line="0">
<Description><![CDATA[skipping test]]></Description>
</Message>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="cleanupTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<Duration msecs="0"/>
diff --git a/tests/auto/testlib/selftests/expected_singleskip.teamcity b/tests/auto/testlib/selftests/expected_singleskip.teamcity
index 6c3a04aeb8..461538cead 100644
--- a/tests/auto/testlib/selftests/expected_singleskip.teamcity
+++ b/tests/auto/testlib/selftests/expected_singleskip.teamcity
@@ -1,7 +1,7 @@
##teamcity[testSuiteStarted name='tst_SingleSkip' flowId='tst_SingleSkip']
##teamcity[testStarted name='initTestCase()' flowId='tst_SingleSkip']
##teamcity[testFinished name='initTestCase()' flowId='tst_SingleSkip']
-##teamcity[testIgnored name='myTest()' message='skipping test |[Loc: tst_singleskip.cpp(48)|]' flowId='tst_SingleSkip']
+##teamcity[testIgnored name='myTest()' message='skipping test |[Loc: qtbase/tests/auto/testlib/selftests/singleskip/tst_singleskip.cpp(0)|]' flowId='tst_SingleSkip']
##teamcity[testStarted name='cleanupTestCase()' flowId='tst_SingleSkip']
##teamcity[testFinished name='cleanupTestCase()' flowId='tst_SingleSkip']
##teamcity[testSuiteFinished name='tst_SingleSkip' flowId='tst_SingleSkip']
diff --git a/tests/auto/testlib/selftests/expected_singleskip.txt b/tests/auto/testlib/selftests/expected_singleskip.txt
index 34c877cfd4..f7484633bd 100644
--- a/tests/auto/testlib/selftests/expected_singleskip.txt
+++ b/tests/auto/testlib/selftests/expected_singleskip.txt
@@ -1,8 +1,8 @@
********* Start testing of tst_SingleSkip *********
-Config: Using QtTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@
+Config: Using QtTest library
PASS : tst_SingleSkip::initTestCase()
SKIP : tst_SingleSkip::myTest() skipping test
- Loc: [tst_singleskip.cpp(56)]
+ Loc: [qtbase/tests/auto/testlib/selftests/singleskip/tst_singleskip.cpp(0)]
PASS : tst_SingleSkip::cleanupTestCase()
-Totals: 2 passed, 0 failed, 1 skipped, 0 blacklisted
+Totals: 2 passed, 0 failed, 1 skipped, 0 blacklisted, 0ms
********* Finished testing of tst_SingleSkip *********
diff --git a/tests/auto/testlib/selftests/expected_singleskip.xml b/tests/auto/testlib/selftests/expected_singleskip.xml
index 0c5cdade3d..a36e74a236 100644
--- a/tests/auto/testlib/selftests/expected_singleskip.xml
+++ b/tests/auto/testlib/selftests/expected_singleskip.xml
@@ -7,17 +7,17 @@
</Environment>
<TestFunction name="initTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="myTest">
-<Message type="skip" file="tst_singleskip.cpp" line="56">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/singleskip/tst_singleskip.cpp" line="0">
<Description><![CDATA[skipping test]]></Description>
</Message>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="cleanupTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<Duration msecs="0"/>
</TestCase>
diff --git a/tests/auto/testlib/selftests/expected_skip.lightxml b/tests/auto/testlib/selftests/expected_skip.lightxml
index ee83d263b5..d44cfe317d 100644
--- a/tests/auto/testlib/selftests/expected_skip.lightxml
+++ b/tests/auto/testlib/selftests/expected_skip.lightxml
@@ -5,22 +5,22 @@
</Environment>
<TestFunction name="initTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="test">
-<Message type="skip" file="tst_skip.cpp" line="68">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/skip/tst_skip.cpp" line="0">
<Description><![CDATA[skipping all]]></Description>
</Message>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="emptytest">
-<Message type="skip" file="tst_skip.cpp" line="78">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/skip/tst_skip.cpp" line="0">
<Description><![CDATA[skipping all]]></Description>
</Message>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="singleSkip">
-<Message type="skip" file="tst_skip.cpp" line="97">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/skip/tst_skip.cpp" line="0">
<DataTag><![CDATA[local 1]]></DataTag>
<Description><![CDATA[skipping one]]></Description>
</Message>
@@ -31,10 +31,10 @@
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[local 2]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="cleanupTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<Duration msecs="0"/>
diff --git a/tests/auto/testlib/selftests/expected_skip.teamcity b/tests/auto/testlib/selftests/expected_skip.teamcity
index 5c01cf1ff2..472690195f 100644
--- a/tests/auto/testlib/selftests/expected_skip.teamcity
+++ b/tests/auto/testlib/selftests/expected_skip.teamcity
@@ -1,9 +1,9 @@
##teamcity[testSuiteStarted name='tst_Skip' flowId='tst_Skip']
##teamcity[testStarted name='initTestCase()' flowId='tst_Skip']
##teamcity[testFinished name='initTestCase()' flowId='tst_Skip']
-##teamcity[testIgnored name='test()' message='skipping all |[Loc: tst_skip.cpp(60)|]' flowId='tst_Skip']
-##teamcity[testIgnored name='emptytest()' message='skipping all |[Loc: tst_skip.cpp(70)|]' flowId='tst_Skip']
-##teamcity[testIgnored name='singleSkip(local 1)' message='skipping one |[Loc: tst_skip.cpp(89)|]' flowId='tst_Skip']
+##teamcity[testIgnored name='test()' message='skipping all |[Loc: qtbase/tests/auto/testlib/selftests/skip/tst_skip.cpp(0)|]' flowId='tst_Skip']
+##teamcity[testIgnored name='emptytest()' message='skipping all |[Loc: qtbase/tests/auto/testlib/selftests/skip/tst_skip.cpp(0)|]' flowId='tst_Skip']
+##teamcity[testIgnored name='singleSkip(local 1)' message='skipping one |[Loc: qtbase/tests/auto/testlib/selftests/skip/tst_skip.cpp(0)|]' flowId='tst_Skip']
##teamcity[testStarted name='singleSkip(local 2)' flowId='tst_Skip']
##teamcity[testStdOut name='singleSkip(local 2)' out='QDEBUG: this line should only be reached once (true)' flowId='tst_Skip']
##teamcity[testFinished name='singleSkip(local 2)' flowId='tst_Skip']
diff --git a/tests/auto/testlib/selftests/expected_skip.txt b/tests/auto/testlib/selftests/expected_skip.txt
index a48427d3b2..9499a54be3 100644
--- a/tests/auto/testlib/selftests/expected_skip.txt
+++ b/tests/auto/testlib/selftests/expected_skip.txt
@@ -1,14 +1,14 @@
********* Start testing of tst_Skip *********
-Config: Using QtTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@
+Config: Using QtTest library
PASS : tst_Skip::initTestCase()
SKIP : tst_Skip::test() skipping all
- Loc: [tst_skip.cpp(68)]
+ Loc: [qtbase/tests/auto/testlib/selftests/skip/tst_skip.cpp(0)]
SKIP : tst_Skip::emptytest() skipping all
- Loc: [tst_skip.cpp(78)]
+ Loc: [qtbase/tests/auto/testlib/selftests/skip/tst_skip.cpp(0)]
SKIP : tst_Skip::singleSkip(local 1) skipping one
- Loc: [tst_skip.cpp(97)]
+ Loc: [qtbase/tests/auto/testlib/selftests/skip/tst_skip.cpp(0)]
QDEBUG : tst_Skip::singleSkip(local 2) this line should only be reached once (true)
PASS : tst_Skip::singleSkip(local 2)
PASS : tst_Skip::cleanupTestCase()
-Totals: 3 passed, 0 failed, 3 skipped, 0 blacklisted
+Totals: 3 passed, 0 failed, 3 skipped, 0 blacklisted, 0ms
********* Finished testing of tst_Skip *********
diff --git a/tests/auto/testlib/selftests/expected_skip.xml b/tests/auto/testlib/selftests/expected_skip.xml
index 2c830bc9fb..70d3d12cf5 100644
--- a/tests/auto/testlib/selftests/expected_skip.xml
+++ b/tests/auto/testlib/selftests/expected_skip.xml
@@ -7,22 +7,22 @@
</Environment>
<TestFunction name="initTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="test">
-<Message type="skip" file="tst_skip.cpp" line="68">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/skip/tst_skip.cpp" line="0">
<Description><![CDATA[skipping all]]></Description>
</Message>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="emptytest">
-<Message type="skip" file="tst_skip.cpp" line="78">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/skip/tst_skip.cpp" line="0">
<Description><![CDATA[skipping all]]></Description>
</Message>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="singleSkip">
-<Message type="skip" file="tst_skip.cpp" line="97">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/skip/tst_skip.cpp" line="0">
<DataTag><![CDATA[local 1]]></DataTag>
<Description><![CDATA[skipping one]]></Description>
</Message>
@@ -33,11 +33,11 @@
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[local 2]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="cleanupTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<Duration msecs="0"/>
</TestCase>
diff --git a/tests/auto/testlib/selftests/expected_skipcleanup.lightxml b/tests/auto/testlib/selftests/expected_skipcleanup.lightxml
index dbbc30c0db..ac310226e8 100644
--- a/tests/auto/testlib/selftests/expected_skipcleanup.lightxml
+++ b/tests/auto/testlib/selftests/expected_skipcleanup.lightxml
@@ -5,16 +5,16 @@
</Environment>
<TestFunction name="initTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="aTestFunction">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="cleanupTestCase">
-<Message type="skip" file="tst_skipcleanup.cpp" line="59">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/skipcleanup/tst_skipcleanup.cpp" line="0">
<Description><![CDATA[Skip inside cleanupTestCase.]]></Description>
</Message>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<Duration msecs="0"/>
diff --git a/tests/auto/testlib/selftests/expected_skipcleanup.teamcity b/tests/auto/testlib/selftests/expected_skipcleanup.teamcity
index 7f78f82004..12b0d0e0d2 100644
--- a/tests/auto/testlib/selftests/expected_skipcleanup.teamcity
+++ b/tests/auto/testlib/selftests/expected_skipcleanup.teamcity
@@ -3,5 +3,5 @@
##teamcity[testFinished name='initTestCase()' flowId='tst_SkipCleanup']
##teamcity[testStarted name='aTestFunction()' flowId='tst_SkipCleanup']
##teamcity[testFinished name='aTestFunction()' flowId='tst_SkipCleanup']
-##teamcity[testIgnored name='cleanupTestCase()' message='Skip inside cleanupTestCase. |[Loc: tst_skipcleanup.cpp(51)|]' flowId='tst_SkipCleanup']
+##teamcity[testIgnored name='cleanupTestCase()' message='Skip inside cleanupTestCase. |[Loc: qtbase/tests/auto/testlib/selftests/skipcleanup/tst_skipcleanup.cpp(0)|]' flowId='tst_SkipCleanup']
##teamcity[testSuiteFinished name='tst_SkipCleanup' flowId='tst_SkipCleanup']
diff --git a/tests/auto/testlib/selftests/expected_skipcleanup.txt b/tests/auto/testlib/selftests/expected_skipcleanup.txt
index 3120cffcb6..987e2b9a14 100644
--- a/tests/auto/testlib/selftests/expected_skipcleanup.txt
+++ b/tests/auto/testlib/selftests/expected_skipcleanup.txt
@@ -1,8 +1,8 @@
********* Start testing of tst_SkipCleanup *********
-Config: Using QtTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@
+Config: Using QtTest library
PASS : tst_SkipCleanup::initTestCase()
PASS : tst_SkipCleanup::aTestFunction()
SKIP : tst_SkipCleanup::cleanupTestCase() Skip inside cleanupTestCase.
- Loc: [tst_skipcleanup.cpp(59)]
-Totals: 2 passed, 0 failed, 1 skipped, 0 blacklisted
+ Loc: [qtbase/tests/auto/testlib/selftests/skipcleanup/tst_skipcleanup.cpp(0)]
+Totals: 2 passed, 0 failed, 1 skipped, 0 blacklisted, 0ms
********* Finished testing of tst_SkipCleanup *********
diff --git a/tests/auto/testlib/selftests/expected_skipcleanup.xml b/tests/auto/testlib/selftests/expected_skipcleanup.xml
index 7b787ebb3d..14207b2196 100644
--- a/tests/auto/testlib/selftests/expected_skipcleanup.xml
+++ b/tests/auto/testlib/selftests/expected_skipcleanup.xml
@@ -7,17 +7,17 @@
</Environment>
<TestFunction name="initTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="aTestFunction">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="cleanupTestCase">
-<Message type="skip" file="tst_skipcleanup.cpp" line="59">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/skipcleanup/tst_skipcleanup.cpp" line="0">
<Description><![CDATA[Skip inside cleanupTestCase.]]></Description>
</Message>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<Duration msecs="0"/>
</TestCase>
diff --git a/tests/auto/testlib/selftests/expected_skipinit.lightxml b/tests/auto/testlib/selftests/expected_skipinit.lightxml
index 3682068825..76f4365cae 100644
--- a/tests/auto/testlib/selftests/expected_skipinit.lightxml
+++ b/tests/auto/testlib/selftests/expected_skipinit.lightxml
@@ -4,13 +4,13 @@
<QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion>
</Environment>
<TestFunction name="initTestCase">
-<Message type="skip" file="tst_skipinit.cpp" line="55">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/skipinit/tst_skipinit.cpp" line="0">
<Description><![CDATA[Skip inside initTestCase. This should skip all tests in the class.]]></Description>
</Message>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="cleanupTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<Duration msecs="0"/>
diff --git a/tests/auto/testlib/selftests/expected_skipinit.teamcity b/tests/auto/testlib/selftests/expected_skipinit.teamcity
index 7f36d6d3b9..07a30c743d 100644
--- a/tests/auto/testlib/selftests/expected_skipinit.teamcity
+++ b/tests/auto/testlib/selftests/expected_skipinit.teamcity
@@ -1,5 +1,5 @@
##teamcity[testSuiteStarted name='tst_SkipInit' flowId='tst_SkipInit']
-##teamcity[testIgnored name='initTestCase()' message='Skip inside initTestCase. This should skip all tests in the class. |[Loc: tst_skipinit.cpp(47)|]' flowId='tst_SkipInit']
+##teamcity[testIgnored name='initTestCase()' message='Skip inside initTestCase. This should skip all tests in the class. |[Loc: qtbase/tests/auto/testlib/selftests/skipinit/tst_skipinit.cpp(0)|]' flowId='tst_SkipInit']
##teamcity[testStarted name='cleanupTestCase()' flowId='tst_SkipInit']
##teamcity[testFinished name='cleanupTestCase()' flowId='tst_SkipInit']
##teamcity[testSuiteFinished name='tst_SkipInit' flowId='tst_SkipInit']
diff --git a/tests/auto/testlib/selftests/expected_skipinit.txt b/tests/auto/testlib/selftests/expected_skipinit.txt
index 8a2bbe01db..9fc2d98006 100644
--- a/tests/auto/testlib/selftests/expected_skipinit.txt
+++ b/tests/auto/testlib/selftests/expected_skipinit.txt
@@ -1,7 +1,7 @@
********* Start testing of tst_SkipInit *********
-Config: Using QtTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@
+Config: Using QtTest library
SKIP : tst_SkipInit::initTestCase() Skip inside initTestCase. This should skip all tests in the class.
- Loc: [tst_skipinit.cpp(55)]
+ Loc: [qtbase/tests/auto/testlib/selftests/skipinit/tst_skipinit.cpp(0)]
PASS : tst_SkipInit::cleanupTestCase()
-Totals: 1 passed, 0 failed, 1 skipped, 0 blacklisted
+Totals: 1 passed, 0 failed, 1 skipped, 0 blacklisted, 0ms
********* Finished testing of tst_SkipInit *********
diff --git a/tests/auto/testlib/selftests/expected_skipinit.xml b/tests/auto/testlib/selftests/expected_skipinit.xml
index 9d6a38b82f..7e0c1564b6 100644
--- a/tests/auto/testlib/selftests/expected_skipinit.xml
+++ b/tests/auto/testlib/selftests/expected_skipinit.xml
@@ -6,14 +6,14 @@
<QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion>
</Environment>
<TestFunction name="initTestCase">
-<Message type="skip" file="tst_skipinit.cpp" line="55">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/skipinit/tst_skipinit.cpp" line="0">
<Description><![CDATA[Skip inside initTestCase. This should skip all tests in the class.]]></Description>
</Message>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="cleanupTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<Duration msecs="0"/>
</TestCase>
diff --git a/tests/auto/testlib/selftests/expected_skipinitdata.lightxml b/tests/auto/testlib/selftests/expected_skipinitdata.lightxml
index 26afcb4ab1..27a207a4a2 100644
--- a/tests/auto/testlib/selftests/expected_skipinitdata.lightxml
+++ b/tests/auto/testlib/selftests/expected_skipinitdata.lightxml
@@ -4,9 +4,9 @@
<QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion>
</Environment>
<TestFunction name="initTestCase">
-<Message type="skip" file="tst_skipinitdata.cpp" line="56">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/skipinitdata/tst_skipinitdata.cpp" line="0">
<Description><![CDATA[Skip inside initTestCase_data. This should skip all tests in the class.]]></Description>
</Message>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<Duration msecs="0"/>
diff --git a/tests/auto/testlib/selftests/expected_skipinitdata.teamcity b/tests/auto/testlib/selftests/expected_skipinitdata.teamcity
index 82b8be5370..8ae11fc7ff 100644
--- a/tests/auto/testlib/selftests/expected_skipinitdata.teamcity
+++ b/tests/auto/testlib/selftests/expected_skipinitdata.teamcity
@@ -1,3 +1,3 @@
##teamcity[testSuiteStarted name='tst_SkipInitData' flowId='tst_SkipInitData']
-##teamcity[testIgnored name='initTestCase()' message='Skip inside initTestCase_data. This should skip all tests in the class. |[Loc: tst_skipinitdata.cpp(48)|]' flowId='tst_SkipInitData']
+##teamcity[testIgnored name='initTestCase()' message='Skip inside initTestCase_data. This should skip all tests in the class. |[Loc: qtbase/tests/auto/testlib/selftests/skipinitdata/tst_skipinitdata.cpp(0)|]' flowId='tst_SkipInitData']
##teamcity[testSuiteFinished name='tst_SkipInitData' flowId='tst_SkipInitData']
diff --git a/tests/auto/testlib/selftests/expected_skipinitdata.txt b/tests/auto/testlib/selftests/expected_skipinitdata.txt
index 654098630e..c245f52847 100644
--- a/tests/auto/testlib/selftests/expected_skipinitdata.txt
+++ b/tests/auto/testlib/selftests/expected_skipinitdata.txt
@@ -1,6 +1,6 @@
********* Start testing of tst_SkipInitData *********
-Config: Using QtTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@
+Config: Using QtTest library
SKIP : tst_SkipInitData::initTestCase() Skip inside initTestCase_data. This should skip all tests in the class.
- Loc: [tst_skipinitdata.cpp(56)]
-Totals: 0 passed, 0 failed, 1 skipped, 0 blacklisted
+ Loc: [qtbase/tests/auto/testlib/selftests/skipinitdata/tst_skipinitdata.cpp(0)]
+Totals: 0 passed, 0 failed, 1 skipped, 0 blacklisted, 0ms
********* Finished testing of tst_SkipInitData *********
diff --git a/tests/auto/testlib/selftests/expected_skipinitdata.xml b/tests/auto/testlib/selftests/expected_skipinitdata.xml
index 9ab84f21a1..cf0189e6be 100644
--- a/tests/auto/testlib/selftests/expected_skipinitdata.xml
+++ b/tests/auto/testlib/selftests/expected_skipinitdata.xml
@@ -6,10 +6,10 @@
<QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion>
</Environment>
<TestFunction name="initTestCase">
-<Message type="skip" file="tst_skipinitdata.cpp" line="56">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/skipinitdata/tst_skipinitdata.cpp" line="0">
<Description><![CDATA[Skip inside initTestCase_data. This should skip all tests in the class.]]></Description>
</Message>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<Duration msecs="0"/>
</TestCase>
diff --git a/tests/auto/testlib/selftests/expected_sleep.lightxml b/tests/auto/testlib/selftests/expected_sleep.lightxml
new file mode 100644
index 0000000000..97b65d1259
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_sleep.lightxml
@@ -0,0 +1,18 @@
+<Environment>
+ <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>
+ <QtBuild/>
+ <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion>
+</Environment>
+<TestFunction name="initTestCase">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="sleep">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="cleanupTestCase">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<Duration msecs="0"/>
diff --git a/tests/auto/testlib/selftests/expected_sleep.txt b/tests/auto/testlib/selftests/expected_sleep.txt
index 58c7b928c0..d18c3212bb 100644
--- a/tests/auto/testlib/selftests/expected_sleep.txt
+++ b/tests/auto/testlib/selftests/expected_sleep.txt
@@ -1,7 +1,7 @@
********* Start testing of tst_Sleep *********
-Config: Using QtTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@
+Config: Using QtTest library
PASS : tst_Sleep::initTestCase()
PASS : tst_Sleep::sleep()
PASS : tst_Sleep::cleanupTestCase()
-Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted
+Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms
********* Finished testing of tst_Sleep *********
diff --git a/tests/auto/testlib/selftests/expected_sleep.xml b/tests/auto/testlib/selftests/expected_sleep.xml
new file mode 100644
index 0000000000..5729c0ac9d
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_sleep.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<TestCase name="tst_Sleep">
+<Environment>
+ <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>
+ <QtBuild/>
+ <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion>
+</Environment>
+<TestFunction name="initTestCase">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="sleep">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="cleanupTestCase">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<Duration msecs="0"/>
+</TestCase>
diff --git a/tests/auto/testlib/selftests/expected_sleep.xunitxml b/tests/auto/testlib/selftests/expected_sleep.xunitxml
new file mode 100644
index 0000000000..138486fc02
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_sleep.xunitxml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<testsuite errors="0" failures="0" tests="3" name="tst_Sleep">
+ <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"/>
+ <testcase result="pass" name="sleep"/>
+ <testcase result="pass" name="cleanupTestCase"/>
+ <system-err/>
+</testsuite>
diff --git a/tests/auto/testlib/selftests/expected_strcmp.lightxml b/tests/auto/testlib/selftests/expected_strcmp.lightxml
index 93a860431e..e35ec497cc 100644
--- a/tests/auto/testlib/selftests/expected_strcmp.lightxml
+++ b/tests/auto/testlib/selftests/expected_strcmp.lightxml
@@ -5,63 +5,63 @@
</Environment>
<TestFunction name="initTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="compareCharStars">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="compareByteArray">
-<Incident type="xfail" file="tst_strcmp.cpp" line="88">
+<Incident type="xfail" file="qtbase/tests/auto/testlib/selftests/strcmp/tst_strcmp.cpp" line="0">
<Description><![CDATA[Next test should fail]]></Description>
</Incident>
-<Incident type="xfail" file="tst_strcmp.cpp" line="95">
+<Incident type="xfail" file="qtbase/tests/auto/testlib/selftests/strcmp/tst_strcmp.cpp" line="0">
<Description><![CDATA[Next test should fail]]></Description>
</Incident>
-<Incident type="xfail" file="tst_strcmp.cpp" line="102">
+<Incident type="xfail" file="qtbase/tests/auto/testlib/selftests/strcmp/tst_strcmp.cpp" line="0">
<Description><![CDATA[Next test should fail]]></Description>
</Incident>
-<Incident type="fail" file="tst_strcmp.cpp" line="109">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/strcmp/tst_strcmp.cpp" line="0">
<Description><![CDATA[Compared values are not the same
Actual (a): "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB"...
Expected (b): "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"...]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="failByteArray">
-<Incident type="fail" file="tst_strcmp.cpp" line="115">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/strcmp/tst_strcmp.cpp" line="0">
<Description><![CDATA[Compared values are not the same
Actual (QByteArray("abc")): "abc"
Expected (QByteArray("cba")): "cba"]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="failByteArrayNull">
-<Incident type="fail" file="tst_strcmp.cpp" line="121">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/strcmp/tst_strcmp.cpp" line="0">
<Description><![CDATA[Compared values are not the same
Actual (QByteArray("foo")): "foo"
Expected (QByteArray()) : ""]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="failByteArrayEmpty">
-<Incident type="fail" file="tst_strcmp.cpp" line="126">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/strcmp/tst_strcmp.cpp" line="0">
<Description><![CDATA[Compared values are not the same
Actual (QByteArray("")) : ""
Expected (QByteArray("foo")): "foo"]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="failByteArraySingleChars">
-<Incident type="fail" file="tst_strcmp.cpp" line="133">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/strcmp/tst_strcmp.cpp" line="0">
<Description><![CDATA[Compared values are not the same
Actual (QByteArray("6")): "6"
Expected (QByteArray("7")): "7"]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="cleanupTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<Duration msecs="0"/>
diff --git a/tests/auto/testlib/selftests/expected_strcmp.teamcity b/tests/auto/testlib/selftests/expected_strcmp.teamcity
index 1e56488067..b0a614e264 100644
--- a/tests/auto/testlib/selftests/expected_strcmp.teamcity
+++ b/tests/auto/testlib/selftests/expected_strcmp.teamcity
@@ -4,20 +4,20 @@
##teamcity[testStarted name='compareCharStars()' flowId='tst_StrCmp']
##teamcity[testFinished name='compareCharStars()' flowId='tst_StrCmp']
##teamcity[testStarted name='compareByteArray()' flowId='tst_StrCmp']
-##teamcity[testFailed name='compareByteArray()' message='Failure! |[Loc: tst_strcmp.cpp(101)|]' details='Compared values are not the same|n Actual (a): "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB"...|n Expected (b): "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"...' flowId='tst_StrCmp']
-##teamcity[testStdOut name='compareByteArray()' out='XFAIL |[Loc: tst_strcmp.cpp(80)|]: Next test should fail|nXFAIL |[Loc: tst_strcmp.cpp(87)|]: Next test should fail|nXFAIL |[Loc: tst_strcmp.cpp(94)|]: Next test should fail' flowId='tst_StrCmp']
+##teamcity[testFailed name='compareByteArray()' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/strcmp/tst_strcmp.cpp(0)|]' details='Compared values are not the same|n Actual (a): "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB"...|n Expected (b): "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"...' flowId='tst_StrCmp']
+##teamcity[testStdOut name='compareByteArray()' out='XFAIL |[Loc: qtbase/tests/auto/testlib/selftests/strcmp/tst_strcmp.cpp(0)|]: Next test should fail|nXFAIL |[Loc: qtbase/tests/auto/testlib/selftests/strcmp/tst_strcmp.cpp(0)|]: Next test should fail|nXFAIL |[Loc: qtbase/tests/auto/testlib/selftests/strcmp/tst_strcmp.cpp(0)|]: Next test should fail' flowId='tst_StrCmp']
##teamcity[testFinished name='compareByteArray()' flowId='tst_StrCmp']
##teamcity[testStarted name='failByteArray()' flowId='tst_StrCmp']
-##teamcity[testFailed name='failByteArray()' message='Failure! |[Loc: tst_strcmp.cpp(107)|]' details='Compared values are not the same|n Actual (QByteArray("abc")): "abc"|n Expected (QByteArray("cba")): "cba"' flowId='tst_StrCmp']
+##teamcity[testFailed name='failByteArray()' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/strcmp/tst_strcmp.cpp(0)|]' details='Compared values are not the same|n Actual (QByteArray("abc")): "abc"|n Expected (QByteArray("cba")): "cba"' flowId='tst_StrCmp']
##teamcity[testFinished name='failByteArray()' flowId='tst_StrCmp']
##teamcity[testStarted name='failByteArrayNull()' flowId='tst_StrCmp']
-##teamcity[testFailed name='failByteArrayNull()' message='Failure! |[Loc: tst_strcmp.cpp(113)|]' details='Compared values are not the same|n Actual (QByteArray("foo")): "foo"|n Expected (QByteArray()) : ""' flowId='tst_StrCmp']
+##teamcity[testFailed name='failByteArrayNull()' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/strcmp/tst_strcmp.cpp(0)|]' details='Compared values are not the same|n Actual (QByteArray("foo")): "foo"|n Expected (QByteArray()) : ""' flowId='tst_StrCmp']
##teamcity[testFinished name='failByteArrayNull()' flowId='tst_StrCmp']
##teamcity[testStarted name='failByteArrayEmpty()' flowId='tst_StrCmp']
-##teamcity[testFailed name='failByteArrayEmpty()' message='Failure! |[Loc: tst_strcmp.cpp(118)|]' details='Compared values are not the same|n Actual (QByteArray("")) : ""|n Expected (QByteArray("foo")): "foo"' flowId='tst_StrCmp']
+##teamcity[testFailed name='failByteArrayEmpty()' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/strcmp/tst_strcmp.cpp(0)|]' details='Compared values are not the same|n Actual (QByteArray("")) : ""|n Expected (QByteArray("foo")): "foo"' flowId='tst_StrCmp']
##teamcity[testFinished name='failByteArrayEmpty()' flowId='tst_StrCmp']
##teamcity[testStarted name='failByteArraySingleChars()' flowId='tst_StrCmp']
-##teamcity[testFailed name='failByteArraySingleChars()' message='Failure! |[Loc: tst_strcmp.cpp(125)|]' details='Compared values are not the same|n Actual (QByteArray("6")): "6"|n Expected (QByteArray("7")): "7"' flowId='tst_StrCmp']
+##teamcity[testFailed name='failByteArraySingleChars()' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/strcmp/tst_strcmp.cpp(0)|]' details='Compared values are not the same|n Actual (QByteArray("6")): "6"|n Expected (QByteArray("7")): "7"' flowId='tst_StrCmp']
##teamcity[testFinished name='failByteArraySingleChars()' flowId='tst_StrCmp']
##teamcity[testStarted name='cleanupTestCase()' flowId='tst_StrCmp']
##teamcity[testFinished name='cleanupTestCase()' flowId='tst_StrCmp']
diff --git a/tests/auto/testlib/selftests/expected_strcmp.txt b/tests/auto/testlib/selftests/expected_strcmp.txt
index 270ce09892..ed8f9125f3 100644
--- a/tests/auto/testlib/selftests/expected_strcmp.txt
+++ b/tests/auto/testlib/selftests/expected_strcmp.txt
@@ -1,33 +1,33 @@
********* Start testing of tst_StrCmp *********
-Config: Using QtTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@
+Config: Using QtTest library
PASS : tst_StrCmp::initTestCase()
PASS : tst_StrCmp::compareCharStars()
XFAIL : tst_StrCmp::compareByteArray() Next test should fail
- Loc: [tst_strcmp.cpp(88)]
+ Loc: [qtbase/tests/auto/testlib/selftests/strcmp/tst_strcmp.cpp(0)]
XFAIL : tst_StrCmp::compareByteArray() Next test should fail
- Loc: [tst_strcmp.cpp(95)]
+ Loc: [qtbase/tests/auto/testlib/selftests/strcmp/tst_strcmp.cpp(0)]
XFAIL : tst_StrCmp::compareByteArray() Next test should fail
- Loc: [tst_strcmp.cpp(102)]
+ Loc: [qtbase/tests/auto/testlib/selftests/strcmp/tst_strcmp.cpp(0)]
FAIL! : tst_StrCmp::compareByteArray() Compared values are not the same
Actual (a): "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB"...
Expected (b): "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"...
- Loc: [/home/thiago/src/qt/qt5/qtbase/tests/auto/testlib/selftests/strcmp/tst_strcmp.cpp(109)]
+ Loc: [qtbase/tests/auto/testlib/selftests/strcmp/tst_strcmp.cpp(0)]
FAIL! : tst_StrCmp::failByteArray() Compared values are not the same
Actual (QByteArray("abc")): "abc"
Expected (QByteArray("cba")): "cba"
- Loc: [/home/thiago/src/qt/qt5/qtbase/tests/auto/testlib/selftests/strcmp/tst_strcmp.cpp(115)]
+ Loc: [qtbase/tests/auto/testlib/selftests/strcmp/tst_strcmp.cpp(0)]
FAIL! : tst_StrCmp::failByteArrayNull() Compared values are not the same
Actual (QByteArray("foo")): "foo"
Expected (QByteArray()) : ""
- Loc: [/home/thiago/src/qt/qt5/qtbase/tests/auto/testlib/selftests/strcmp/tst_strcmp.cpp(121)]
+ Loc: [qtbase/tests/auto/testlib/selftests/strcmp/tst_strcmp.cpp(0)]
FAIL! : tst_StrCmp::failByteArrayEmpty() Compared values are not the same
Actual (QByteArray("")) : ""
Expected (QByteArray("foo")): "foo"
- Loc: [/home/thiago/src/qt/qt5/qtbase/tests/auto/testlib/selftests/strcmp/tst_strcmp.cpp(126)]
+ Loc: [qtbase/tests/auto/testlib/selftests/strcmp/tst_strcmp.cpp(0)]
FAIL! : tst_StrCmp::failByteArraySingleChars() Compared values are not the same
Actual (QByteArray("6")): "6"
Expected (QByteArray("7")): "7"
- Loc: [/home/thiago/src/qt/qt5/qtbase/tests/auto/testlib/selftests/strcmp/tst_strcmp.cpp(133)]
+ Loc: [qtbase/tests/auto/testlib/selftests/strcmp/tst_strcmp.cpp(0)]
PASS : tst_StrCmp::cleanupTestCase()
-Totals: 3 passed, 5 failed, 0 skipped, 0 blacklisted
+Totals: 3 passed, 5 failed, 0 skipped, 0 blacklisted, 0ms
********* Finished testing of tst_StrCmp *********
diff --git a/tests/auto/testlib/selftests/expected_strcmp.xml b/tests/auto/testlib/selftests/expected_strcmp.xml
index 9e14dddd7c..7848eea61f 100644
--- a/tests/auto/testlib/selftests/expected_strcmp.xml
+++ b/tests/auto/testlib/selftests/expected_strcmp.xml
@@ -7,64 +7,64 @@
</Environment>
<TestFunction name="initTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="compareCharStars">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="compareByteArray">
-<Incident type="xfail" file="tst_strcmp.cpp" line="88">
+<Incident type="xfail" file="qtbase/tests/auto/testlib/selftests/strcmp/tst_strcmp.cpp" line="0">
<Description><![CDATA[Next test should fail]]></Description>
</Incident>
-<Incident type="xfail" file="tst_strcmp.cpp" line="95">
+<Incident type="xfail" file="qtbase/tests/auto/testlib/selftests/strcmp/tst_strcmp.cpp" line="0">
<Description><![CDATA[Next test should fail]]></Description>
</Incident>
-<Incident type="xfail" file="tst_strcmp.cpp" line="102">
+<Incident type="xfail" file="qtbase/tests/auto/testlib/selftests/strcmp/tst_strcmp.cpp" line="0">
<Description><![CDATA[Next test should fail]]></Description>
</Incident>
-<Incident type="fail" file="tst_strcmp.cpp" line="109">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/strcmp/tst_strcmp.cpp" line="0">
<Description><![CDATA[Compared values are not the same
Actual (a): "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB"...
Expected (b): "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"...]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="failByteArray">
-<Incident type="fail" file="tst_strcmp.cpp" line="115">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/strcmp/tst_strcmp.cpp" line="0">
<Description><![CDATA[Compared values are not the same
Actual (QByteArray("abc")): "abc"
Expected (QByteArray("cba")): "cba"]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="failByteArrayNull">
-<Incident type="fail" file="tst_strcmp.cpp" line="121">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/strcmp/tst_strcmp.cpp" line="0">
<Description><![CDATA[Compared values are not the same
Actual (QByteArray("foo")): "foo"
Expected (QByteArray()) : ""]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="failByteArrayEmpty">
-<Incident type="fail" file="tst_strcmp.cpp" line="126">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/strcmp/tst_strcmp.cpp" line="0">
<Description><![CDATA[Compared values are not the same
Actual (QByteArray("")) : ""
Expected (QByteArray("foo")): "foo"]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="failByteArraySingleChars">
-<Incident type="fail" file="tst_strcmp.cpp" line="133">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/strcmp/tst_strcmp.cpp" line="0">
<Description><![CDATA[Compared values are not the same
Actual (QByteArray("6")): "6"
Expected (QByteArray("7")): "7"]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="cleanupTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<Duration msecs="0"/>
</TestCase>
diff --git a/tests/auto/testlib/selftests/expected_subtest.lightxml b/tests/auto/testlib/selftests/expected_subtest.lightxml
index 2e484aafef..f35f6a6dc4 100644
--- a/tests/auto/testlib/selftests/expected_subtest.lightxml
+++ b/tests/auto/testlib/selftests/expected_subtest.lightxml
@@ -8,7 +8,7 @@
<Description><![CDATA[initTestCase initTestCase (null)]]></Description>
</Message>
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="test1">
<Message type="qdebug" file="" line="0">
@@ -21,7 +21,7 @@
<Description><![CDATA[cleanup test1 (null)]]></Description>
</Message>
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="test2">
<Message type="qdebug" file="" line="0">
@@ -87,7 +87,7 @@
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[data2]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="test3">
<Message type="qdebug" file="" line="0">
@@ -123,7 +123,7 @@
<DataTag><![CDATA[data1]]></DataTag>
<Description><![CDATA[test2 test3 data1]]></Description>
</Message>
-<Incident type="fail" file="tst_subtest.cpp" line="154">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/subtest/tst_subtest.cpp" line="0">
<DataTag><![CDATA[data1]]></DataTag>
<Description><![CDATA[Compared values are not the same
Actual (str) : "hello1"
@@ -141,7 +141,7 @@
<DataTag><![CDATA[data2]]></DataTag>
<Description><![CDATA[test2 test3 data2]]></Description>
</Message>
-<Incident type="fail" file="tst_subtest.cpp" line="154">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/subtest/tst_subtest.cpp" line="0">
<DataTag><![CDATA[data2]]></DataTag>
<Description><![CDATA[Compared values are not the same
Actual (str) : "hello2"
@@ -151,13 +151,13 @@
<DataTag><![CDATA[data2]]></DataTag>
<Description><![CDATA[cleanup test3 data2]]></Description>
</Message>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="cleanupTestCase">
<Message type="qdebug" file="" line="0">
<Description><![CDATA[cleanupTestCase cleanupTestCase (null)]]></Description>
</Message>
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<Duration msecs="0"/>
diff --git a/tests/auto/testlib/selftests/expected_subtest.teamcity b/tests/auto/testlib/selftests/expected_subtest.teamcity
index b974e30d78..3fcbcb7ea4 100644
--- a/tests/auto/testlib/selftests/expected_subtest.teamcity
+++ b/tests/auto/testlib/selftests/expected_subtest.teamcity
@@ -18,11 +18,11 @@
##teamcity[testStdOut name='test3(data0)' out='QDEBUG: test3_data test3 (null)|nQDEBUG: test3_data end|nQDEBUG: init test3 data0|nQDEBUG: test2 test3 data0|nQDEBUG: test2 end|nQDEBUG: cleanup test3 data0' flowId='tst_Subtest']
##teamcity[testFinished name='test3(data0)' flowId='tst_Subtest']
##teamcity[testStarted name='test3(data1)' flowId='tst_Subtest']
-##teamcity[testFailed name='test3(data1)' message='Failure! |[Loc: tst_subtest.cpp(146)|]' details='Compared values are not the same|n Actual (str) : "hello1"|n Expected (QString("hello0")): "hello0"' flowId='tst_Subtest']
+##teamcity[testFailed name='test3(data1)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/subtest/tst_subtest.cpp(0)|]' details='Compared values are not the same|n Actual (str) : "hello1"|n Expected (QString("hello0")): "hello0"' flowId='tst_Subtest']
##teamcity[testStdOut name='test3(data1)' out='QDEBUG: init test3 data1|nQDEBUG: test2 test3 data1' flowId='tst_Subtest']
##teamcity[testFinished name='test3(data1)' flowId='tst_Subtest']
##teamcity[testStarted name='test3(data2)' flowId='tst_Subtest']
-##teamcity[testFailed name='test3(data2)' message='Failure! |[Loc: tst_subtest.cpp(146)|]' details='Compared values are not the same|n Actual (str) : "hello2"|n Expected (QString("hello0")): "hello0"' flowId='tst_Subtest']
+##teamcity[testFailed name='test3(data2)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/subtest/tst_subtest.cpp(0)|]' details='Compared values are not the same|n Actual (str) : "hello2"|n Expected (QString("hello0")): "hello0"' flowId='tst_Subtest']
##teamcity[testStdOut name='test3(data2)' out='QDEBUG: cleanup test3 data1|nQDEBUG: init test3 data2|nQDEBUG: test2 test3 data2' flowId='tst_Subtest']
##teamcity[testFinished name='test3(data2)' flowId='tst_Subtest']
##teamcity[testStarted name='cleanupTestCase()' flowId='tst_Subtest']
diff --git a/tests/auto/testlib/selftests/expected_subtest.txt b/tests/auto/testlib/selftests/expected_subtest.txt
index ba710e54a9..8b0dbf63ee 100644
--- a/tests/auto/testlib/selftests/expected_subtest.txt
+++ b/tests/auto/testlib/selftests/expected_subtest.txt
@@ -1,5 +1,5 @@
********* Start testing of tst_Subtest *********
-Config: Using QtTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@
+Config: Using QtTest library
QDEBUG : tst_Subtest::initTestCase() initTestCase initTestCase (null)
PASS : tst_Subtest::initTestCase()
QDEBUG : tst_Subtest::test1() init test1 (null)
@@ -35,16 +35,16 @@ QDEBUG : tst_Subtest::test3(data1) test2 test3 data1
FAIL! : tst_Subtest::test3(data1) Compared values are not the same
Actual (str) : "hello1"
Expected (QString("hello0")): "hello0"
- Loc: [tst_subtest.cpp(154)]
+ Loc: [qtbase/tests/auto/testlib/selftests/subtest/tst_subtest.cpp(0)]
QDEBUG : tst_Subtest::test3(data1) cleanup test3 data1
QDEBUG : tst_Subtest::test3(data2) init test3 data2
QDEBUG : tst_Subtest::test3(data2) test2 test3 data2
FAIL! : tst_Subtest::test3(data2) Compared values are not the same
Actual (str) : "hello2"
Expected (QString("hello0")): "hello0"
- Loc: [tst_subtest.cpp(154)]
+ Loc: [qtbase/tests/auto/testlib/selftests/subtest/tst_subtest.cpp(0)]
QDEBUG : tst_Subtest::test3(data2) cleanup test3 data2
QDEBUG : tst_Subtest::cleanupTestCase() cleanupTestCase cleanupTestCase (null)
PASS : tst_Subtest::cleanupTestCase()
-Totals: 7 passed, 2 failed, 0 skipped, 0 blacklisted
+Totals: 7 passed, 2 failed, 0 skipped, 0 blacklisted, 0ms
********* Finished testing of tst_Subtest *********
diff --git a/tests/auto/testlib/selftests/expected_subtest.xml b/tests/auto/testlib/selftests/expected_subtest.xml
index f011489ec8..793f5d4d2d 100644
--- a/tests/auto/testlib/selftests/expected_subtest.xml
+++ b/tests/auto/testlib/selftests/expected_subtest.xml
@@ -10,7 +10,7 @@
<Description><![CDATA[initTestCase initTestCase (null)]]></Description>
</Message>
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="test1">
<Message type="qdebug" file="" line="0">
@@ -23,7 +23,7 @@
<Description><![CDATA[cleanup test1 (null)]]></Description>
</Message>
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="test2">
<Message type="qdebug" file="" line="0">
@@ -89,7 +89,7 @@
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[data2]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="test3">
<Message type="qdebug" file="" line="0">
@@ -125,7 +125,7 @@
<DataTag><![CDATA[data1]]></DataTag>
<Description><![CDATA[test2 test3 data1]]></Description>
</Message>
-<Incident type="fail" file="tst_subtest.cpp" line="154">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/subtest/tst_subtest.cpp" line="0">
<DataTag><![CDATA[data1]]></DataTag>
<Description><![CDATA[Compared values are not the same
Actual (str) : "hello1"
@@ -143,7 +143,7 @@
<DataTag><![CDATA[data2]]></DataTag>
<Description><![CDATA[test2 test3 data2]]></Description>
</Message>
-<Incident type="fail" file="tst_subtest.cpp" line="154">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/subtest/tst_subtest.cpp" line="0">
<DataTag><![CDATA[data2]]></DataTag>
<Description><![CDATA[Compared values are not the same
Actual (str) : "hello2"
@@ -153,14 +153,14 @@
<DataTag><![CDATA[data2]]></DataTag>
<Description><![CDATA[cleanup test3 data2]]></Description>
</Message>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="cleanupTestCase">
<Message type="qdebug" file="" line="0">
<Description><![CDATA[cleanupTestCase cleanupTestCase (null)]]></Description>
</Message>
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<Duration msecs="0"/>
</TestCase>
diff --git a/tests/auto/testlib/selftests/expected_verbose1.lightxml b/tests/auto/testlib/selftests/expected_verbose1.lightxml
index 6d7ce13ea0..68730a3293 100644
--- a/tests/auto/testlib/selftests/expected_verbose1.lightxml
+++ b/tests/auto/testlib/selftests/expected_verbose1.lightxml
@@ -5,7 +5,7 @@
</Environment>
<TestFunction name="initTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testPassPass">
<Incident type="pass" file="" line="0">
@@ -14,104 +14,104 @@
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[row 2]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testPassSkip">
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[row 1]]></DataTag>
</Incident>
-<Message type="skip" file="../counting/tst_counting.cpp" line="118">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 2]]></DataTag>
<Description><![CDATA[Skipping]]></Description>
</Message>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testPassFail">
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[row 1]]></DataTag>
</Incident>
-<Incident type="fail" file="../counting/tst_counting.cpp" line="115">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 2]]></DataTag>
<Description><![CDATA['false' returned FALSE. ()]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testSkipPass">
-<Message type="skip" file="../counting/tst_counting.cpp" line="118">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 1]]></DataTag>
<Description><![CDATA[Skipping]]></Description>
</Message>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[row 2]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testSkipSkip">
-<Message type="skip" file="../counting/tst_counting.cpp" line="118">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 1]]></DataTag>
<Description><![CDATA[Skipping]]></Description>
</Message>
-<Message type="skip" file="../counting/tst_counting.cpp" line="118">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 2]]></DataTag>
<Description><![CDATA[Skipping]]></Description>
</Message>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testSkipFail">
-<Message type="skip" file="../counting/tst_counting.cpp" line="118">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 1]]></DataTag>
<Description><![CDATA[Skipping]]></Description>
</Message>
-<Incident type="fail" file="../counting/tst_counting.cpp" line="115">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 2]]></DataTag>
<Description><![CDATA['false' returned FALSE. ()]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testFailPass">
-<Incident type="fail" file="../counting/tst_counting.cpp" line="115">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 1]]></DataTag>
<Description><![CDATA['false' returned FALSE. ()]]></Description>
</Incident>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[row 2]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testFailSkip">
-<Incident type="fail" file="../counting/tst_counting.cpp" line="115">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 1]]></DataTag>
<Description><![CDATA['false' returned FALSE. ()]]></Description>
</Incident>
-<Message type="skip" file="../counting/tst_counting.cpp" line="118">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 2]]></DataTag>
<Description><![CDATA[Skipping]]></Description>
</Message>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testFailFail">
-<Incident type="fail" file="../counting/tst_counting.cpp" line="115">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 1]]></DataTag>
<Description><![CDATA['false' returned FALSE. ()]]></Description>
</Incident>
-<Incident type="fail" file="../counting/tst_counting.cpp" line="115">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 2]]></DataTag>
<Description><![CDATA['false' returned FALSE. ()]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testFailInInit">
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[before]]></DataTag>
</Incident>
-<Incident type="fail" file="../counting/tst_counting.cpp" line="234">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[fail]]></DataTag>
<Description><![CDATA[Fail in init()]]></Description>
</Incident>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[after]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testFailInCleanup">
<Incident type="pass" file="" line="0">
@@ -121,27 +121,27 @@
<DataTag><![CDATA[fail]]></DataTag>
<Description><![CDATA[This test function should execute and then QFAIL in cleanup()]]></Description>
</Message>
-<Incident type="fail" file="../counting/tst_counting.cpp" line="242">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[fail]]></DataTag>
<Description><![CDATA[Fail in cleanup()]]></Description>
</Incident>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[after]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testSkipInInit">
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[before]]></DataTag>
</Incident>
-<Message type="skip" file="../counting/tst_counting.cpp" line="236">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[skip]]></DataTag>
<Description><![CDATA[Skip in init()]]></Description>
</Message>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[after]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testSkipInCleanup">
<Incident type="pass" file="" line="0">
@@ -151,17 +151,17 @@
<DataTag><![CDATA[skip]]></DataTag>
<Description><![CDATA[This test function should execute and then QSKIP in cleanup()]]></Description>
</Message>
-<Message type="skip" file="../counting/tst_counting.cpp" line="244">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[skip]]></DataTag>
<Description><![CDATA[Skip in cleanup()]]></Description>
</Message>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[after]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="cleanupTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<Duration msecs="0"/>
diff --git a/tests/auto/testlib/selftests/expected_verbose1.teamcity b/tests/auto/testlib/selftests/expected_verbose1.teamcity
index e6d324a573..5ceaf155d8 100644
--- a/tests/auto/testlib/selftests/expected_verbose1.teamcity
+++ b/tests/auto/testlib/selftests/expected_verbose1.teamcity
@@ -7,59 +7,59 @@
##teamcity[testFinished name='testPassPass(row 2)' flowId='tst_Counting']
##teamcity[testStarted name='testPassSkip(row 1)' flowId='tst_Counting']
##teamcity[testFinished name='testPassSkip(row 1)' flowId='tst_Counting']
-##teamcity[testIgnored name='testPassSkip(row 2)' message='Skipping |[Loc: ../counting/tst_counting.cpp(110)|]' flowId='tst_Counting']
+##teamcity[testIgnored name='testPassSkip(row 2)' message='Skipping |[Loc: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)|]' flowId='tst_Counting']
##teamcity[testStarted name='testPassFail(row 1)' flowId='tst_Counting']
##teamcity[testFinished name='testPassFail(row 1)' flowId='tst_Counting']
##teamcity[testStarted name='testPassFail(row 2)' flowId='tst_Counting']
-##teamcity[testFailed name='testPassFail(row 2)' message='Failure! |[Loc: ../counting/tst_counting.cpp(107)|]' details='|'false|' returned FALSE. ()' flowId='tst_Counting']
+##teamcity[testFailed name='testPassFail(row 2)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)|]' details='|'false|' returned FALSE. ()' flowId='tst_Counting']
##teamcity[testFinished name='testPassFail(row 2)' flowId='tst_Counting']
-##teamcity[testIgnored name='testSkipPass(row 1)' message='Skipping |[Loc: ../counting/tst_counting.cpp(110)|]' flowId='tst_Counting']
+##teamcity[testIgnored name='testSkipPass(row 1)' message='Skipping |[Loc: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)|]' flowId='tst_Counting']
##teamcity[testStarted name='testSkipPass(row 2)' flowId='tst_Counting']
##teamcity[testFinished name='testSkipPass(row 2)' flowId='tst_Counting']
-##teamcity[testIgnored name='testSkipSkip(row 1)' message='Skipping |[Loc: ../counting/tst_counting.cpp(110)|]' flowId='tst_Counting']
-##teamcity[testIgnored name='testSkipSkip(row 2)' message='Skipping |[Loc: ../counting/tst_counting.cpp(110)|]' flowId='tst_Counting']
-##teamcity[testIgnored name='testSkipFail(row 1)' message='Skipping |[Loc: ../counting/tst_counting.cpp(110)|]' flowId='tst_Counting']
+##teamcity[testIgnored name='testSkipSkip(row 1)' message='Skipping |[Loc: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)|]' flowId='tst_Counting']
+##teamcity[testIgnored name='testSkipSkip(row 2)' message='Skipping |[Loc: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)|]' flowId='tst_Counting']
+##teamcity[testIgnored name='testSkipFail(row 1)' message='Skipping |[Loc: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)|]' flowId='tst_Counting']
##teamcity[testStarted name='testSkipFail(row 2)' flowId='tst_Counting']
-##teamcity[testFailed name='testSkipFail(row 2)' message='Failure! |[Loc: ../counting/tst_counting.cpp(107)|]' details='|'false|' returned FALSE. ()' flowId='tst_Counting']
+##teamcity[testFailed name='testSkipFail(row 2)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)|]' details='|'false|' returned FALSE. ()' flowId='tst_Counting']
##teamcity[testFinished name='testSkipFail(row 2)' flowId='tst_Counting']
##teamcity[testStarted name='testFailPass(row 1)' flowId='tst_Counting']
-##teamcity[testFailed name='testFailPass(row 1)' message='Failure! |[Loc: ../counting/tst_counting.cpp(107)|]' details='|'false|' returned FALSE. ()' flowId='tst_Counting']
+##teamcity[testFailed name='testFailPass(row 1)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)|]' details='|'false|' returned FALSE. ()' flowId='tst_Counting']
##teamcity[testFinished name='testFailPass(row 1)' flowId='tst_Counting']
##teamcity[testStarted name='testFailPass(row 2)' flowId='tst_Counting']
##teamcity[testFinished name='testFailPass(row 2)' flowId='tst_Counting']
##teamcity[testStarted name='testFailSkip(row 1)' flowId='tst_Counting']
-##teamcity[testFailed name='testFailSkip(row 1)' message='Failure! |[Loc: ../counting/tst_counting.cpp(107)|]' details='|'false|' returned FALSE. ()' flowId='tst_Counting']
+##teamcity[testFailed name='testFailSkip(row 1)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)|]' details='|'false|' returned FALSE. ()' flowId='tst_Counting']
##teamcity[testFinished name='testFailSkip(row 1)' flowId='tst_Counting']
-##teamcity[testIgnored name='testFailSkip(row 2)' message='Skipping |[Loc: ../counting/tst_counting.cpp(110)|]' flowId='tst_Counting']
+##teamcity[testIgnored name='testFailSkip(row 2)' message='Skipping |[Loc: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)|]' flowId='tst_Counting']
##teamcity[testStarted name='testFailFail(row 1)' flowId='tst_Counting']
-##teamcity[testFailed name='testFailFail(row 1)' message='Failure! |[Loc: ../counting/tst_counting.cpp(107)|]' details='|'false|' returned FALSE. ()' flowId='tst_Counting']
+##teamcity[testFailed name='testFailFail(row 1)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)|]' details='|'false|' returned FALSE. ()' flowId='tst_Counting']
##teamcity[testFinished name='testFailFail(row 1)' flowId='tst_Counting']
##teamcity[testStarted name='testFailFail(row 2)' flowId='tst_Counting']
-##teamcity[testFailed name='testFailFail(row 2)' message='Failure! |[Loc: ../counting/tst_counting.cpp(107)|]' details='|'false|' returned FALSE. ()' flowId='tst_Counting']
+##teamcity[testFailed name='testFailFail(row 2)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)|]' details='|'false|' returned FALSE. ()' flowId='tst_Counting']
##teamcity[testFinished name='testFailFail(row 2)' flowId='tst_Counting']
##teamcity[testStarted name='testFailInInit(before)' flowId='tst_Counting']
##teamcity[testFinished name='testFailInInit(before)' flowId='tst_Counting']
##teamcity[testStarted name='testFailInInit(fail)' flowId='tst_Counting']
-##teamcity[testFailed name='testFailInInit(fail)' message='Failure! |[Loc: ../counting/tst_counting.cpp(226)|]' details='Fail in init()' flowId='tst_Counting']
+##teamcity[testFailed name='testFailInInit(fail)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)|]' details='Fail in init()' flowId='tst_Counting']
##teamcity[testFinished name='testFailInInit(fail)' flowId='tst_Counting']
##teamcity[testStarted name='testFailInInit(after)' flowId='tst_Counting']
##teamcity[testFinished name='testFailInInit(after)' flowId='tst_Counting']
##teamcity[testStarted name='testFailInCleanup(before)' flowId='tst_Counting']
##teamcity[testFinished name='testFailInCleanup(before)' flowId='tst_Counting']
##teamcity[testStarted name='testFailInCleanup(fail)' flowId='tst_Counting']
-##teamcity[testFailed name='testFailInCleanup(fail)' message='Failure! |[Loc: ../counting/tst_counting.cpp(234)|]' details='Fail in cleanup()' flowId='tst_Counting']
+##teamcity[testFailed name='testFailInCleanup(fail)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)|]' details='Fail in cleanup()' flowId='tst_Counting']
##teamcity[testStdOut name='testFailInCleanup(fail)' out='QDEBUG: This test function should execute and then QFAIL in cleanup()' flowId='tst_Counting']
##teamcity[testFinished name='testFailInCleanup(fail)' flowId='tst_Counting']
##teamcity[testStarted name='testFailInCleanup(after)' flowId='tst_Counting']
##teamcity[testFinished name='testFailInCleanup(after)' flowId='tst_Counting']
##teamcity[testStarted name='testSkipInInit(before)' flowId='tst_Counting']
##teamcity[testFinished name='testSkipInInit(before)' flowId='tst_Counting']
-##teamcity[testIgnored name='testSkipInInit(skip)' message='Skip in init() |[Loc: ../counting/tst_counting.cpp(228)|]' flowId='tst_Counting']
+##teamcity[testIgnored name='testSkipInInit(skip)' message='Skip in init() |[Loc: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)|]' flowId='tst_Counting']
##teamcity[testStarted name='testSkipInInit(after)' flowId='tst_Counting']
##teamcity[testFinished name='testSkipInInit(after)' flowId='tst_Counting']
##teamcity[testStarted name='testSkipInCleanup(before)' flowId='tst_Counting']
##teamcity[testFinished name='testSkipInCleanup(before)' flowId='tst_Counting']
-##teamcity[testIgnored name='testSkipInCleanup(skip)' message='Skip in cleanup() |[Loc: ../counting/tst_counting.cpp(236)|]' flowId='tst_Counting']
+##teamcity[testIgnored name='testSkipInCleanup(skip)' message='Skip in cleanup() |[Loc: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)|]' flowId='tst_Counting']
##teamcity[testStarted name='testSkipInCleanup(after)' flowId='tst_Counting']
##teamcity[testStdOut name='testSkipInCleanup(after)' out='QDEBUG: This test function should execute and then QSKIP in cleanup()' flowId='tst_Counting']
##teamcity[testFinished name='testSkipInCleanup(after)' flowId='tst_Counting']
diff --git a/tests/auto/testlib/selftests/expected_verbose1.txt b/tests/auto/testlib/selftests/expected_verbose1.txt
index 1c83be75cc..da2e04674d 100644
--- a/tests/auto/testlib/selftests/expected_verbose1.txt
+++ b/tests/auto/testlib/selftests/expected_verbose1.txt
@@ -1,5 +1,5 @@
********* Start testing of tst_Counting *********
-Config: Using QtTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@
+Config: Using QtTest library
INFO : tst_Counting::initTestCase() entering
PASS : tst_Counting::initTestCase()
INFO : tst_Counting::testPassPass() entering
@@ -8,62 +8,62 @@ PASS : tst_Counting::testPassPass(row 2)
INFO : tst_Counting::testPassSkip() entering
PASS : tst_Counting::testPassSkip(row 1)
SKIP : tst_Counting::testPassSkip(row 2) Skipping
- Loc: [../counting/tst_counting.cpp(118)]
+ Loc: [qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)]
INFO : tst_Counting::testPassFail() entering
PASS : tst_Counting::testPassFail(row 1)
FAIL! : tst_Counting::testPassFail(row 2) 'false' returned FALSE. ()
- Loc: [../counting/tst_counting.cpp(115)]
+ Loc: [qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)]
INFO : tst_Counting::testSkipPass() entering
SKIP : tst_Counting::testSkipPass(row 1) Skipping
- Loc: [../counting/tst_counting.cpp(118)]
+ Loc: [qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)]
PASS : tst_Counting::testSkipPass(row 2)
INFO : tst_Counting::testSkipSkip() entering
SKIP : tst_Counting::testSkipSkip(row 1) Skipping
- Loc: [../counting/tst_counting.cpp(118)]
+ Loc: [qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)]
SKIP : tst_Counting::testSkipSkip(row 2) Skipping
- Loc: [../counting/tst_counting.cpp(118)]
+ Loc: [qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)]
INFO : tst_Counting::testSkipFail() entering
SKIP : tst_Counting::testSkipFail(row 1) Skipping
- Loc: [../counting/tst_counting.cpp(118)]
+ Loc: [qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)]
FAIL! : tst_Counting::testSkipFail(row 2) 'false' returned FALSE. ()
- Loc: [../counting/tst_counting.cpp(115)]
+ Loc: [qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)]
INFO : tst_Counting::testFailPass() entering
FAIL! : tst_Counting::testFailPass(row 1) 'false' returned FALSE. ()
- Loc: [../counting/tst_counting.cpp(115)]
+ Loc: [qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)]
PASS : tst_Counting::testFailPass(row 2)
INFO : tst_Counting::testFailSkip() entering
FAIL! : tst_Counting::testFailSkip(row 1) 'false' returned FALSE. ()
- Loc: [../counting/tst_counting.cpp(115)]
+ Loc: [qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)]
SKIP : tst_Counting::testFailSkip(row 2) Skipping
- Loc: [../counting/tst_counting.cpp(118)]
+ Loc: [qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)]
INFO : tst_Counting::testFailFail() entering
FAIL! : tst_Counting::testFailFail(row 1) 'false' returned FALSE. ()
- Loc: [../counting/tst_counting.cpp(115)]
+ Loc: [qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)]
FAIL! : tst_Counting::testFailFail(row 2) 'false' returned FALSE. ()
- Loc: [../counting/tst_counting.cpp(115)]
+ Loc: [qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)]
INFO : tst_Counting::testFailInInit() entering
PASS : tst_Counting::testFailInInit(before)
FAIL! : tst_Counting::testFailInInit(fail) Fail in init()
- Loc: [../counting/tst_counting.cpp(234)]
+ Loc: [qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)]
PASS : tst_Counting::testFailInInit(after)
INFO : tst_Counting::testFailInCleanup() entering
PASS : tst_Counting::testFailInCleanup(before)
QDEBUG : tst_Counting::testFailInCleanup(fail) This test function should execute and then QFAIL in cleanup()
FAIL! : tst_Counting::testFailInCleanup(fail) Fail in cleanup()
- Loc: [../counting/tst_counting.cpp(242)]
+ Loc: [qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)]
PASS : tst_Counting::testFailInCleanup(after)
INFO : tst_Counting::testSkipInInit() entering
PASS : tst_Counting::testSkipInInit(before)
SKIP : tst_Counting::testSkipInInit(skip) Skip in init()
- Loc: [../counting/tst_counting.cpp(236)]
+ Loc: [qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)]
PASS : tst_Counting::testSkipInInit(after)
INFO : tst_Counting::testSkipInCleanup() entering
PASS : tst_Counting::testSkipInCleanup(before)
QDEBUG : tst_Counting::testSkipInCleanup(skip) This test function should execute and then QSKIP in cleanup()
SKIP : tst_Counting::testSkipInCleanup(skip) Skip in cleanup()
- Loc: [../counting/tst_counting.cpp(244)]
+ Loc: [qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)]
PASS : tst_Counting::testSkipInCleanup(after)
INFO : tst_Counting::cleanupTestCase() entering
PASS : tst_Counting::cleanupTestCase()
-Totals: 16 passed, 8 failed, 8 skipped, 0 blacklisted
+Totals: 16 passed, 8 failed, 8 skipped, 0 blacklisted, 0ms
********* Finished testing of tst_Counting *********
diff --git a/tests/auto/testlib/selftests/expected_verbose1.xml b/tests/auto/testlib/selftests/expected_verbose1.xml
index b5ae1286cb..841a49c30d 100644
--- a/tests/auto/testlib/selftests/expected_verbose1.xml
+++ b/tests/auto/testlib/selftests/expected_verbose1.xml
@@ -7,7 +7,7 @@
</Environment>
<TestFunction name="initTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testPassPass">
<Incident type="pass" file="" line="0">
@@ -16,104 +16,104 @@
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[row 2]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testPassSkip">
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[row 1]]></DataTag>
</Incident>
-<Message type="skip" file="../counting/tst_counting.cpp" line="118">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 2]]></DataTag>
<Description><![CDATA[Skipping]]></Description>
</Message>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testPassFail">
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[row 1]]></DataTag>
</Incident>
-<Incident type="fail" file="../counting/tst_counting.cpp" line="115">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 2]]></DataTag>
<Description><![CDATA['false' returned FALSE. ()]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testSkipPass">
-<Message type="skip" file="../counting/tst_counting.cpp" line="118">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 1]]></DataTag>
<Description><![CDATA[Skipping]]></Description>
</Message>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[row 2]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testSkipSkip">
-<Message type="skip" file="../counting/tst_counting.cpp" line="118">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 1]]></DataTag>
<Description><![CDATA[Skipping]]></Description>
</Message>
-<Message type="skip" file="../counting/tst_counting.cpp" line="118">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 2]]></DataTag>
<Description><![CDATA[Skipping]]></Description>
</Message>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testSkipFail">
-<Message type="skip" file="../counting/tst_counting.cpp" line="118">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 1]]></DataTag>
<Description><![CDATA[Skipping]]></Description>
</Message>
-<Incident type="fail" file="../counting/tst_counting.cpp" line="115">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 2]]></DataTag>
<Description><![CDATA['false' returned FALSE. ()]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testFailPass">
-<Incident type="fail" file="../counting/tst_counting.cpp" line="115">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 1]]></DataTag>
<Description><![CDATA['false' returned FALSE. ()]]></Description>
</Incident>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[row 2]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testFailSkip">
-<Incident type="fail" file="../counting/tst_counting.cpp" line="115">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 1]]></DataTag>
<Description><![CDATA['false' returned FALSE. ()]]></Description>
</Incident>
-<Message type="skip" file="../counting/tst_counting.cpp" line="118">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 2]]></DataTag>
<Description><![CDATA[Skipping]]></Description>
</Message>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testFailFail">
-<Incident type="fail" file="../counting/tst_counting.cpp" line="115">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 1]]></DataTag>
<Description><![CDATA['false' returned FALSE. ()]]></Description>
</Incident>
-<Incident type="fail" file="../counting/tst_counting.cpp" line="115">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 2]]></DataTag>
<Description><![CDATA['false' returned FALSE. ()]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testFailInInit">
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[before]]></DataTag>
</Incident>
-<Incident type="fail" file="../counting/tst_counting.cpp" line="234">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[fail]]></DataTag>
<Description><![CDATA[Fail in init()]]></Description>
</Incident>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[after]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testFailInCleanup">
<Incident type="pass" file="" line="0">
@@ -123,27 +123,27 @@
<DataTag><![CDATA[fail]]></DataTag>
<Description><![CDATA[This test function should execute and then QFAIL in cleanup()]]></Description>
</Message>
-<Incident type="fail" file="../counting/tst_counting.cpp" line="242">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[fail]]></DataTag>
<Description><![CDATA[Fail in cleanup()]]></Description>
</Incident>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[after]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testSkipInInit">
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[before]]></DataTag>
</Incident>
-<Message type="skip" file="../counting/tst_counting.cpp" line="236">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[skip]]></DataTag>
<Description><![CDATA[Skip in init()]]></Description>
</Message>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[after]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testSkipInCleanup">
<Incident type="pass" file="" line="0">
@@ -153,18 +153,18 @@
<DataTag><![CDATA[skip]]></DataTag>
<Description><![CDATA[This test function should execute and then QSKIP in cleanup()]]></Description>
</Message>
-<Message type="skip" file="../counting/tst_counting.cpp" line="244">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[skip]]></DataTag>
<Description><![CDATA[Skip in cleanup()]]></Description>
</Message>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[after]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="cleanupTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<Duration msecs="0"/>
</TestCase>
diff --git a/tests/auto/testlib/selftests/expected_verbose2.lightxml b/tests/auto/testlib/selftests/expected_verbose2.lightxml
index 85f9ec45af..cad736a7e6 100644
--- a/tests/auto/testlib/selftests/expected_verbose2.lightxml
+++ b/tests/auto/testlib/selftests/expected_verbose2.lightxml
@@ -5,185 +5,185 @@
</Environment>
<TestFunction name="initTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testPassPass">
-<Message type="info" file="../counting/tst_counting.cpp" line="111">
+<Message type="info" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 1]]></DataTag>
<Description><![CDATA[QVERIFY(true)]]></Description>
</Message>
-<Message type="info" file="../counting/tst_counting.cpp" line="112">
+<Message type="info" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 1]]></DataTag>
<Description><![CDATA[QCOMPARE(2 + 1, 3)]]></Description>
</Message>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[row 1]]></DataTag>
</Incident>
-<Message type="info" file="../counting/tst_counting.cpp" line="111">
+<Message type="info" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 2]]></DataTag>
<Description><![CDATA[QVERIFY(true)]]></Description>
</Message>
-<Message type="info" file="../counting/tst_counting.cpp" line="112">
+<Message type="info" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 2]]></DataTag>
<Description><![CDATA[QCOMPARE(2 + 1, 3)]]></Description>
</Message>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[row 2]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testPassSkip">
-<Message type="info" file="../counting/tst_counting.cpp" line="111">
+<Message type="info" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 1]]></DataTag>
<Description><![CDATA[QVERIFY(true)]]></Description>
</Message>
-<Message type="info" file="../counting/tst_counting.cpp" line="112">
+<Message type="info" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 1]]></DataTag>
<Description><![CDATA[QCOMPARE(2 + 1, 3)]]></Description>
</Message>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[row 1]]></DataTag>
</Incident>
-<Message type="skip" file="../counting/tst_counting.cpp" line="118">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 2]]></DataTag>
<Description><![CDATA[Skipping]]></Description>
</Message>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testPassFail">
-<Message type="info" file="../counting/tst_counting.cpp" line="111">
+<Message type="info" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 1]]></DataTag>
<Description><![CDATA[QVERIFY(true)]]></Description>
</Message>
-<Message type="info" file="../counting/tst_counting.cpp" line="112">
+<Message type="info" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 1]]></DataTag>
<Description><![CDATA[QCOMPARE(2 + 1, 3)]]></Description>
</Message>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[row 1]]></DataTag>
</Incident>
-<Message type="info" file="../counting/tst_counting.cpp" line="115">
+<Message type="info" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 2]]></DataTag>
<Description><![CDATA[QVERIFY(false)]]></Description>
</Message>
-<Incident type="fail" file="../counting/tst_counting.cpp" line="115">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 2]]></DataTag>
<Description><![CDATA['false' returned FALSE. ()]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testSkipPass">
-<Message type="skip" file="../counting/tst_counting.cpp" line="118">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 1]]></DataTag>
<Description><![CDATA[Skipping]]></Description>
</Message>
-<Message type="info" file="../counting/tst_counting.cpp" line="111">
+<Message type="info" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 2]]></DataTag>
<Description><![CDATA[QVERIFY(true)]]></Description>
</Message>
-<Message type="info" file="../counting/tst_counting.cpp" line="112">
+<Message type="info" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 2]]></DataTag>
<Description><![CDATA[QCOMPARE(2 + 1, 3)]]></Description>
</Message>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[row 2]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testSkipSkip">
-<Message type="skip" file="../counting/tst_counting.cpp" line="118">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 1]]></DataTag>
<Description><![CDATA[Skipping]]></Description>
</Message>
-<Message type="skip" file="../counting/tst_counting.cpp" line="118">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 2]]></DataTag>
<Description><![CDATA[Skipping]]></Description>
</Message>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testSkipFail">
-<Message type="skip" file="../counting/tst_counting.cpp" line="118">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 1]]></DataTag>
<Description><![CDATA[Skipping]]></Description>
</Message>
-<Message type="info" file="../counting/tst_counting.cpp" line="115">
+<Message type="info" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 2]]></DataTag>
<Description><![CDATA[QVERIFY(false)]]></Description>
</Message>
-<Incident type="fail" file="../counting/tst_counting.cpp" line="115">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 2]]></DataTag>
<Description><![CDATA['false' returned FALSE. ()]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testFailPass">
-<Message type="info" file="../counting/tst_counting.cpp" line="115">
+<Message type="info" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 1]]></DataTag>
<Description><![CDATA[QVERIFY(false)]]></Description>
</Message>
-<Incident type="fail" file="../counting/tst_counting.cpp" line="115">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 1]]></DataTag>
<Description><![CDATA['false' returned FALSE. ()]]></Description>
</Incident>
-<Message type="info" file="../counting/tst_counting.cpp" line="111">
+<Message type="info" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 2]]></DataTag>
<Description><![CDATA[QVERIFY(true)]]></Description>
</Message>
-<Message type="info" file="../counting/tst_counting.cpp" line="112">
+<Message type="info" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 2]]></DataTag>
<Description><![CDATA[QCOMPARE(2 + 1, 3)]]></Description>
</Message>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[row 2]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testFailSkip">
-<Message type="info" file="../counting/tst_counting.cpp" line="115">
+<Message type="info" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 1]]></DataTag>
<Description><![CDATA[QVERIFY(false)]]></Description>
</Message>
-<Incident type="fail" file="../counting/tst_counting.cpp" line="115">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 1]]></DataTag>
<Description><![CDATA['false' returned FALSE. ()]]></Description>
</Incident>
-<Message type="skip" file="../counting/tst_counting.cpp" line="118">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 2]]></DataTag>
<Description><![CDATA[Skipping]]></Description>
</Message>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testFailFail">
-<Message type="info" file="../counting/tst_counting.cpp" line="115">
+<Message type="info" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 1]]></DataTag>
<Description><![CDATA[QVERIFY(false)]]></Description>
</Message>
-<Incident type="fail" file="../counting/tst_counting.cpp" line="115">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 1]]></DataTag>
<Description><![CDATA['false' returned FALSE. ()]]></Description>
</Incident>
-<Message type="info" file="../counting/tst_counting.cpp" line="115">
+<Message type="info" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 2]]></DataTag>
<Description><![CDATA[QVERIFY(false)]]></Description>
</Message>
-<Incident type="fail" file="../counting/tst_counting.cpp" line="115">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 2]]></DataTag>
<Description><![CDATA['false' returned FALSE. ()]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testFailInInit">
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[before]]></DataTag>
</Incident>
-<Incident type="fail" file="../counting/tst_counting.cpp" line="234">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[fail]]></DataTag>
<Description><![CDATA[Fail in init()]]></Description>
</Incident>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[after]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testFailInCleanup">
<Incident type="pass" file="" line="0">
@@ -193,27 +193,27 @@
<DataTag><![CDATA[fail]]></DataTag>
<Description><![CDATA[This test function should execute and then QFAIL in cleanup()]]></Description>
</Message>
-<Incident type="fail" file="../counting/tst_counting.cpp" line="242">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[fail]]></DataTag>
<Description><![CDATA[Fail in cleanup()]]></Description>
</Incident>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[after]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testSkipInInit">
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[before]]></DataTag>
</Incident>
-<Message type="skip" file="../counting/tst_counting.cpp" line="236">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[skip]]></DataTag>
<Description><![CDATA[Skip in init()]]></Description>
</Message>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[after]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testSkipInCleanup">
<Incident type="pass" file="" line="0">
@@ -223,17 +223,17 @@
<DataTag><![CDATA[skip]]></DataTag>
<Description><![CDATA[This test function should execute and then QSKIP in cleanup()]]></Description>
</Message>
-<Message type="skip" file="../counting/tst_counting.cpp" line="244">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[skip]]></DataTag>
<Description><![CDATA[Skip in cleanup()]]></Description>
</Message>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[after]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="cleanupTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<Duration msecs="0"/>
diff --git a/tests/auto/testlib/selftests/expected_verbose2.teamcity b/tests/auto/testlib/selftests/expected_verbose2.teamcity
index 138e223fa5..2aebb94938 100644
--- a/tests/auto/testlib/selftests/expected_verbose2.teamcity
+++ b/tests/auto/testlib/selftests/expected_verbose2.teamcity
@@ -2,76 +2,76 @@
##teamcity[testStarted name='initTestCase()' flowId='tst_Counting']
##teamcity[testFinished name='initTestCase()' flowId='tst_Counting']
##teamcity[testStarted name='testPassPass(row 1)' flowId='tst_Counting']
-##teamcity[testStdOut name='testPassPass(row 1)' out='INFO |[Loc: ../counting/tst_counting.cpp(103)|]: QVERIFY(true)|nINFO |[Loc: ../counting/tst_counting.cpp(104)|]: QCOMPARE(2 + 1, 3)' flowId='tst_Counting']
+##teamcity[testStdOut name='testPassPass(row 1)' out='INFO |[Loc: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)|]: QVERIFY(true)|nINFO |[Loc: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)|]: QCOMPARE(2 + 1, 3)' flowId='tst_Counting']
##teamcity[testFinished name='testPassPass(row 1)' flowId='tst_Counting']
##teamcity[testStarted name='testPassPass(row 2)' flowId='tst_Counting']
-##teamcity[testStdOut name='testPassPass(row 2)' out='INFO |[Loc: ../counting/tst_counting.cpp(103)|]: QVERIFY(true)|nINFO |[Loc: ../counting/tst_counting.cpp(104)|]: QCOMPARE(2 + 1, 3)' flowId='tst_Counting']
+##teamcity[testStdOut name='testPassPass(row 2)' out='INFO |[Loc: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)|]: QVERIFY(true)|nINFO |[Loc: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)|]: QCOMPARE(2 + 1, 3)' flowId='tst_Counting']
##teamcity[testFinished name='testPassPass(row 2)' flowId='tst_Counting']
##teamcity[testStarted name='testPassSkip(row 1)' flowId='tst_Counting']
-##teamcity[testStdOut name='testPassSkip(row 1)' out='INFO |[Loc: ../counting/tst_counting.cpp(103)|]: QVERIFY(true)|nINFO |[Loc: ../counting/tst_counting.cpp(104)|]: QCOMPARE(2 + 1, 3)' flowId='tst_Counting']
+##teamcity[testStdOut name='testPassSkip(row 1)' out='INFO |[Loc: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)|]: QVERIFY(true)|nINFO |[Loc: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)|]: QCOMPARE(2 + 1, 3)' flowId='tst_Counting']
##teamcity[testFinished name='testPassSkip(row 1)' flowId='tst_Counting']
-##teamcity[testIgnored name='testPassSkip(row 2)' message='Skipping |[Loc: ../counting/tst_counting.cpp(110)|]' flowId='tst_Counting']
+##teamcity[testIgnored name='testPassSkip(row 2)' message='Skipping |[Loc: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)|]' flowId='tst_Counting']
##teamcity[testStarted name='testPassFail(row 1)' flowId='tst_Counting']
-##teamcity[testStdOut name='testPassFail(row 1)' out='INFO |[Loc: ../counting/tst_counting.cpp(103)|]: QVERIFY(true)|nINFO |[Loc: ../counting/tst_counting.cpp(104)|]: QCOMPARE(2 + 1, 3)' flowId='tst_Counting']
+##teamcity[testStdOut name='testPassFail(row 1)' out='INFO |[Loc: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)|]: QVERIFY(true)|nINFO |[Loc: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)|]: QCOMPARE(2 + 1, 3)' flowId='tst_Counting']
##teamcity[testFinished name='testPassFail(row 1)' flowId='tst_Counting']
##teamcity[testStarted name='testPassFail(row 2)' flowId='tst_Counting']
-##teamcity[testFailed name='testPassFail(row 2)' message='Failure! |[Loc: ../counting/tst_counting.cpp(107)|]' details='|'false|' returned FALSE. ()' flowId='tst_Counting']
-##teamcity[testStdOut name='testPassFail(row 2)' out='INFO |[Loc: ../counting/tst_counting.cpp(107)|]: QVERIFY(false)' flowId='tst_Counting']
+##teamcity[testFailed name='testPassFail(row 2)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)|]' details='|'false|' returned FALSE. ()' flowId='tst_Counting']
+##teamcity[testStdOut name='testPassFail(row 2)' out='INFO |[Loc: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)|]: QVERIFY(false)' flowId='tst_Counting']
##teamcity[testFinished name='testPassFail(row 2)' flowId='tst_Counting']
-##teamcity[testIgnored name='testSkipPass(row 1)' message='Skipping |[Loc: ../counting/tst_counting.cpp(110)|]' flowId='tst_Counting']
+##teamcity[testIgnored name='testSkipPass(row 1)' message='Skipping |[Loc: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)|]' flowId='tst_Counting']
##teamcity[testStarted name='testSkipPass(row 2)' flowId='tst_Counting']
-##teamcity[testStdOut name='testSkipPass(row 2)' out='INFO |[Loc: ../counting/tst_counting.cpp(103)|]: QVERIFY(true)|nINFO |[Loc: ../counting/tst_counting.cpp(104)|]: QCOMPARE(2 + 1, 3)' flowId='tst_Counting']
+##teamcity[testStdOut name='testSkipPass(row 2)' out='INFO |[Loc: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)|]: QVERIFY(true)|nINFO |[Loc: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)|]: QCOMPARE(2 + 1, 3)' flowId='tst_Counting']
##teamcity[testFinished name='testSkipPass(row 2)' flowId='tst_Counting']
-##teamcity[testIgnored name='testSkipSkip(row 1)' message='Skipping |[Loc: ../counting/tst_counting.cpp(110)|]' flowId='tst_Counting']
-##teamcity[testIgnored name='testSkipSkip(row 2)' message='Skipping |[Loc: ../counting/tst_counting.cpp(110)|]' flowId='tst_Counting']
-##teamcity[testIgnored name='testSkipFail(row 1)' message='Skipping |[Loc: ../counting/tst_counting.cpp(110)|]' flowId='tst_Counting']
+##teamcity[testIgnored name='testSkipSkip(row 1)' message='Skipping |[Loc: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)|]' flowId='tst_Counting']
+##teamcity[testIgnored name='testSkipSkip(row 2)' message='Skipping |[Loc: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)|]' flowId='tst_Counting']
+##teamcity[testIgnored name='testSkipFail(row 1)' message='Skipping |[Loc: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)|]' flowId='tst_Counting']
##teamcity[testStarted name='testSkipFail(row 2)' flowId='tst_Counting']
-##teamcity[testFailed name='testSkipFail(row 2)' message='Failure! |[Loc: ../counting/tst_counting.cpp(107)|]' details='|'false|' returned FALSE. ()' flowId='tst_Counting']
-##teamcity[testStdOut name='testSkipFail(row 2)' out='INFO |[Loc: ../counting/tst_counting.cpp(107)|]: QVERIFY(false)' flowId='tst_Counting']
+##teamcity[testFailed name='testSkipFail(row 2)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)|]' details='|'false|' returned FALSE. ()' flowId='tst_Counting']
+##teamcity[testStdOut name='testSkipFail(row 2)' out='INFO |[Loc: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)|]: QVERIFY(false)' flowId='tst_Counting']
##teamcity[testFinished name='testSkipFail(row 2)' flowId='tst_Counting']
##teamcity[testStarted name='testFailPass(row 1)' flowId='tst_Counting']
-##teamcity[testFailed name='testFailPass(row 1)' message='Failure! |[Loc: ../counting/tst_counting.cpp(107)|]' details='|'false|' returned FALSE. ()' flowId='tst_Counting']
-##teamcity[testStdOut name='testFailPass(row 1)' out='INFO |[Loc: ../counting/tst_counting.cpp(107)|]: QVERIFY(false)' flowId='tst_Counting']
+##teamcity[testFailed name='testFailPass(row 1)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)|]' details='|'false|' returned FALSE. ()' flowId='tst_Counting']
+##teamcity[testStdOut name='testFailPass(row 1)' out='INFO |[Loc: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)|]: QVERIFY(false)' flowId='tst_Counting']
##teamcity[testFinished name='testFailPass(row 1)' flowId='tst_Counting']
##teamcity[testStarted name='testFailPass(row 2)' flowId='tst_Counting']
-##teamcity[testStdOut name='testFailPass(row 2)' out='INFO |[Loc: ../counting/tst_counting.cpp(103)|]: QVERIFY(true)|nINFO |[Loc: ../counting/tst_counting.cpp(104)|]: QCOMPARE(2 + 1, 3)' flowId='tst_Counting']
+##teamcity[testStdOut name='testFailPass(row 2)' out='INFO |[Loc: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)|]: QVERIFY(true)|nINFO |[Loc: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)|]: QCOMPARE(2 + 1, 3)' flowId='tst_Counting']
##teamcity[testFinished name='testFailPass(row 2)' flowId='tst_Counting']
##teamcity[testStarted name='testFailSkip(row 1)' flowId='tst_Counting']
-##teamcity[testFailed name='testFailSkip(row 1)' message='Failure! |[Loc: ../counting/tst_counting.cpp(107)|]' details='|'false|' returned FALSE. ()' flowId='tst_Counting']
-##teamcity[testStdOut name='testFailSkip(row 1)' out='INFO |[Loc: ../counting/tst_counting.cpp(107)|]: QVERIFY(false)' flowId='tst_Counting']
+##teamcity[testFailed name='testFailSkip(row 1)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)|]' details='|'false|' returned FALSE. ()' flowId='tst_Counting']
+##teamcity[testStdOut name='testFailSkip(row 1)' out='INFO |[Loc: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)|]: QVERIFY(false)' flowId='tst_Counting']
##teamcity[testFinished name='testFailSkip(row 1)' flowId='tst_Counting']
-##teamcity[testIgnored name='testFailSkip(row 2)' message='Skipping |[Loc: ../counting/tst_counting.cpp(110)|]' flowId='tst_Counting']
+##teamcity[testIgnored name='testFailSkip(row 2)' message='Skipping |[Loc: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)|]' flowId='tst_Counting']
##teamcity[testStarted name='testFailFail(row 1)' flowId='tst_Counting']
-##teamcity[testFailed name='testFailFail(row 1)' message='Failure! |[Loc: ../counting/tst_counting.cpp(107)|]' details='|'false|' returned FALSE. ()' flowId='tst_Counting']
-##teamcity[testStdOut name='testFailFail(row 1)' out='INFO |[Loc: ../counting/tst_counting.cpp(107)|]: QVERIFY(false)' flowId='tst_Counting']
+##teamcity[testFailed name='testFailFail(row 1)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)|]' details='|'false|' returned FALSE. ()' flowId='tst_Counting']
+##teamcity[testStdOut name='testFailFail(row 1)' out='INFO |[Loc: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)|]: QVERIFY(false)' flowId='tst_Counting']
##teamcity[testFinished name='testFailFail(row 1)' flowId='tst_Counting']
##teamcity[testStarted name='testFailFail(row 2)' flowId='tst_Counting']
-##teamcity[testFailed name='testFailFail(row 2)' message='Failure! |[Loc: ../counting/tst_counting.cpp(107)|]' details='|'false|' returned FALSE. ()' flowId='tst_Counting']
-##teamcity[testStdOut name='testFailFail(row 2)' out='INFO |[Loc: ../counting/tst_counting.cpp(107)|]: QVERIFY(false)' flowId='tst_Counting']
+##teamcity[testFailed name='testFailFail(row 2)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)|]' details='|'false|' returned FALSE. ()' flowId='tst_Counting']
+##teamcity[testStdOut name='testFailFail(row 2)' out='INFO |[Loc: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)|]: QVERIFY(false)' flowId='tst_Counting']
##teamcity[testFinished name='testFailFail(row 2)' flowId='tst_Counting']
##teamcity[testStarted name='testFailInInit(before)' flowId='tst_Counting']
##teamcity[testFinished name='testFailInInit(before)' flowId='tst_Counting']
##teamcity[testStarted name='testFailInInit(fail)' flowId='tst_Counting']
-##teamcity[testFailed name='testFailInInit(fail)' message='Failure! |[Loc: ../counting/tst_counting.cpp(226)|]' details='Fail in init()' flowId='tst_Counting']
+##teamcity[testFailed name='testFailInInit(fail)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)|]' details='Fail in init()' flowId='tst_Counting']
##teamcity[testFinished name='testFailInInit(fail)' flowId='tst_Counting']
##teamcity[testStarted name='testFailInInit(after)' flowId='tst_Counting']
##teamcity[testFinished name='testFailInInit(after)' flowId='tst_Counting']
##teamcity[testStarted name='testFailInCleanup(before)' flowId='tst_Counting']
##teamcity[testFinished name='testFailInCleanup(before)' flowId='tst_Counting']
##teamcity[testStarted name='testFailInCleanup(fail)' flowId='tst_Counting']
-##teamcity[testFailed name='testFailInCleanup(fail)' message='Failure! |[Loc: ../counting/tst_counting.cpp(234)|]' details='Fail in cleanup()' flowId='tst_Counting']
+##teamcity[testFailed name='testFailInCleanup(fail)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)|]' details='Fail in cleanup()' flowId='tst_Counting']
##teamcity[testStdOut name='testFailInCleanup(fail)' out='QDEBUG: This test function should execute and then QFAIL in cleanup()' flowId='tst_Counting']
##teamcity[testFinished name='testFailInCleanup(fail)' flowId='tst_Counting']
##teamcity[testStarted name='testFailInCleanup(after)' flowId='tst_Counting']
##teamcity[testFinished name='testFailInCleanup(after)' flowId='tst_Counting']
##teamcity[testStarted name='testSkipInInit(before)' flowId='tst_Counting']
##teamcity[testFinished name='testSkipInInit(before)' flowId='tst_Counting']
-##teamcity[testIgnored name='testSkipInInit(skip)' message='Skip in init() |[Loc: ../counting/tst_counting.cpp(228)|]' flowId='tst_Counting']
+##teamcity[testIgnored name='testSkipInInit(skip)' message='Skip in init() |[Loc: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)|]' flowId='tst_Counting']
##teamcity[testStarted name='testSkipInInit(after)' flowId='tst_Counting']
##teamcity[testFinished name='testSkipInInit(after)' flowId='tst_Counting']
##teamcity[testStarted name='testSkipInCleanup(before)' flowId='tst_Counting']
##teamcity[testFinished name='testSkipInCleanup(before)' flowId='tst_Counting']
-##teamcity[testIgnored name='testSkipInCleanup(skip)' message='Skip in cleanup() |[Loc: ../counting/tst_counting.cpp(236)|]' flowId='tst_Counting']
+##teamcity[testIgnored name='testSkipInCleanup(skip)' message='Skip in cleanup() |[Loc: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)|]' flowId='tst_Counting']
##teamcity[testStarted name='testSkipInCleanup(after)' flowId='tst_Counting']
##teamcity[testStdOut name='testSkipInCleanup(after)' out='QDEBUG: This test function should execute and then QSKIP in cleanup()' flowId='tst_Counting']
##teamcity[testFinished name='testSkipInCleanup(after)' flowId='tst_Counting']
diff --git a/tests/auto/testlib/selftests/expected_verbose2.txt b/tests/auto/testlib/selftests/expected_verbose2.txt
index 8e4e01b526..a46c398a4f 100644
--- a/tests/auto/testlib/selftests/expected_verbose2.txt
+++ b/tests/auto/testlib/selftests/expected_verbose2.txt
@@ -1,105 +1,105 @@
********* Start testing of tst_Counting *********
-Config: Using QtTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@
+Config: Using QtTest library
INFO : tst_Counting::initTestCase() entering
PASS : tst_Counting::initTestCase()
INFO : tst_Counting::testPassPass() entering
INFO : tst_Counting::testPassPass(row 1) QVERIFY(true)
- Loc: [../counting/tst_counting.cpp(111)]
+ Loc: [qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)]
INFO : tst_Counting::testPassPass(row 1) QCOMPARE(2 + 1, 3)
- Loc: [../counting/tst_counting.cpp(112)]
+ Loc: [qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)]
PASS : tst_Counting::testPassPass(row 1)
INFO : tst_Counting::testPassPass(row 2) QVERIFY(true)
- Loc: [../counting/tst_counting.cpp(111)]
+ Loc: [qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)]
INFO : tst_Counting::testPassPass(row 2) QCOMPARE(2 + 1, 3)
- Loc: [../counting/tst_counting.cpp(112)]
+ Loc: [qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)]
PASS : tst_Counting::testPassPass(row 2)
INFO : tst_Counting::testPassSkip() entering
INFO : tst_Counting::testPassSkip(row 1) QVERIFY(true)
- Loc: [../counting/tst_counting.cpp(111)]
+ Loc: [qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)]
INFO : tst_Counting::testPassSkip(row 1) QCOMPARE(2 + 1, 3)
- Loc: [../counting/tst_counting.cpp(112)]
+ Loc: [qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)]
PASS : tst_Counting::testPassSkip(row 1)
SKIP : tst_Counting::testPassSkip(row 2) Skipping
- Loc: [../counting/tst_counting.cpp(118)]
+ Loc: [qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)]
INFO : tst_Counting::testPassFail() entering
INFO : tst_Counting::testPassFail(row 1) QVERIFY(true)
- Loc: [../counting/tst_counting.cpp(111)]
+ Loc: [qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)]
INFO : tst_Counting::testPassFail(row 1) QCOMPARE(2 + 1, 3)
- Loc: [../counting/tst_counting.cpp(112)]
+ Loc: [qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)]
PASS : tst_Counting::testPassFail(row 1)
INFO : tst_Counting::testPassFail(row 2) QVERIFY(false)
- Loc: [../counting/tst_counting.cpp(115)]
+ Loc: [qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)]
FAIL! : tst_Counting::testPassFail(row 2) 'false' returned FALSE. ()
- Loc: [../counting/tst_counting.cpp(115)]
+ Loc: [qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)]
INFO : tst_Counting::testSkipPass() entering
SKIP : tst_Counting::testSkipPass(row 1) Skipping
- Loc: [../counting/tst_counting.cpp(118)]
+ Loc: [qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)]
INFO : tst_Counting::testSkipPass(row 2) QVERIFY(true)
- Loc: [../counting/tst_counting.cpp(111)]
+ Loc: [qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)]
INFO : tst_Counting::testSkipPass(row 2) QCOMPARE(2 + 1, 3)
- Loc: [../counting/tst_counting.cpp(112)]
+ Loc: [qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)]
PASS : tst_Counting::testSkipPass(row 2)
INFO : tst_Counting::testSkipSkip() entering
SKIP : tst_Counting::testSkipSkip(row 1) Skipping
- Loc: [../counting/tst_counting.cpp(118)]
+ Loc: [qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)]
SKIP : tst_Counting::testSkipSkip(row 2) Skipping
- Loc: [../counting/tst_counting.cpp(118)]
+ Loc: [qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)]
INFO : tst_Counting::testSkipFail() entering
SKIP : tst_Counting::testSkipFail(row 1) Skipping
- Loc: [../counting/tst_counting.cpp(118)]
+ Loc: [qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)]
INFO : tst_Counting::testSkipFail(row 2) QVERIFY(false)
- Loc: [../counting/tst_counting.cpp(115)]
+ Loc: [qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)]
FAIL! : tst_Counting::testSkipFail(row 2) 'false' returned FALSE. ()
- Loc: [../counting/tst_counting.cpp(115)]
+ Loc: [qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)]
INFO : tst_Counting::testFailPass() entering
INFO : tst_Counting::testFailPass(row 1) QVERIFY(false)
- Loc: [../counting/tst_counting.cpp(115)]
+ Loc: [qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)]
FAIL! : tst_Counting::testFailPass(row 1) 'false' returned FALSE. ()
- Loc: [../counting/tst_counting.cpp(115)]
+ Loc: [qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)]
INFO : tst_Counting::testFailPass(row 2) QVERIFY(true)
- Loc: [../counting/tst_counting.cpp(111)]
+ Loc: [qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)]
INFO : tst_Counting::testFailPass(row 2) QCOMPARE(2 + 1, 3)
- Loc: [../counting/tst_counting.cpp(112)]
+ Loc: [qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)]
PASS : tst_Counting::testFailPass(row 2)
INFO : tst_Counting::testFailSkip() entering
INFO : tst_Counting::testFailSkip(row 1) QVERIFY(false)
- Loc: [../counting/tst_counting.cpp(115)]
+ Loc: [qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)]
FAIL! : tst_Counting::testFailSkip(row 1) 'false' returned FALSE. ()
- Loc: [../counting/tst_counting.cpp(115)]
+ Loc: [qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)]
SKIP : tst_Counting::testFailSkip(row 2) Skipping
- Loc: [../counting/tst_counting.cpp(118)]
+ Loc: [qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)]
INFO : tst_Counting::testFailFail() entering
INFO : tst_Counting::testFailFail(row 1) QVERIFY(false)
- Loc: [../counting/tst_counting.cpp(115)]
+ Loc: [qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)]
FAIL! : tst_Counting::testFailFail(row 1) 'false' returned FALSE. ()
- Loc: [../counting/tst_counting.cpp(115)]
+ Loc: [qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)]
INFO : tst_Counting::testFailFail(row 2) QVERIFY(false)
- Loc: [../counting/tst_counting.cpp(115)]
+ Loc: [qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)]
FAIL! : tst_Counting::testFailFail(row 2) 'false' returned FALSE. ()
- Loc: [../counting/tst_counting.cpp(115)]
+ Loc: [qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)]
INFO : tst_Counting::testFailInInit() entering
PASS : tst_Counting::testFailInInit(before)
FAIL! : tst_Counting::testFailInInit(fail) Fail in init()
- Loc: [../counting/tst_counting.cpp(234)]
+ Loc: [qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)]
PASS : tst_Counting::testFailInInit(after)
INFO : tst_Counting::testFailInCleanup() entering
PASS : tst_Counting::testFailInCleanup(before)
QDEBUG : tst_Counting::testFailInCleanup(fail) This test function should execute and then QFAIL in cleanup()
FAIL! : tst_Counting::testFailInCleanup(fail) Fail in cleanup()
- Loc: [../counting/tst_counting.cpp(242)]
+ Loc: [qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)]
PASS : tst_Counting::testFailInCleanup(after)
INFO : tst_Counting::testSkipInInit() entering
PASS : tst_Counting::testSkipInInit(before)
SKIP : tst_Counting::testSkipInInit(skip) Skip in init()
- Loc: [../counting/tst_counting.cpp(236)]
+ Loc: [qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)]
PASS : tst_Counting::testSkipInInit(after)
INFO : tst_Counting::testSkipInCleanup() entering
PASS : tst_Counting::testSkipInCleanup(before)
QDEBUG : tst_Counting::testSkipInCleanup(skip) This test function should execute and then QSKIP in cleanup()
SKIP : tst_Counting::testSkipInCleanup(skip) Skip in cleanup()
- Loc: [../counting/tst_counting.cpp(244)]
+ Loc: [qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp(0)]
PASS : tst_Counting::testSkipInCleanup(after)
INFO : tst_Counting::cleanupTestCase() entering
PASS : tst_Counting::cleanupTestCase()
-Totals: 16 passed, 8 failed, 8 skipped, 0 blacklisted
+Totals: 16 passed, 8 failed, 8 skipped, 0 blacklisted, 0ms
********* Finished testing of tst_Counting *********
diff --git a/tests/auto/testlib/selftests/expected_verbose2.xml b/tests/auto/testlib/selftests/expected_verbose2.xml
index 94fef3eed7..b7226db3bf 100644
--- a/tests/auto/testlib/selftests/expected_verbose2.xml
+++ b/tests/auto/testlib/selftests/expected_verbose2.xml
@@ -7,185 +7,185 @@
</Environment>
<TestFunction name="initTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testPassPass">
-<Message type="info" file="../counting/tst_counting.cpp" line="111">
+<Message type="info" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 1]]></DataTag>
<Description><![CDATA[QVERIFY(true)]]></Description>
</Message>
-<Message type="info" file="../counting/tst_counting.cpp" line="112">
+<Message type="info" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 1]]></DataTag>
<Description><![CDATA[QCOMPARE(2 + 1, 3)]]></Description>
</Message>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[row 1]]></DataTag>
</Incident>
-<Message type="info" file="../counting/tst_counting.cpp" line="111">
+<Message type="info" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 2]]></DataTag>
<Description><![CDATA[QVERIFY(true)]]></Description>
</Message>
-<Message type="info" file="../counting/tst_counting.cpp" line="112">
+<Message type="info" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 2]]></DataTag>
<Description><![CDATA[QCOMPARE(2 + 1, 3)]]></Description>
</Message>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[row 2]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testPassSkip">
-<Message type="info" file="../counting/tst_counting.cpp" line="111">
+<Message type="info" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 1]]></DataTag>
<Description><![CDATA[QVERIFY(true)]]></Description>
</Message>
-<Message type="info" file="../counting/tst_counting.cpp" line="112">
+<Message type="info" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 1]]></DataTag>
<Description><![CDATA[QCOMPARE(2 + 1, 3)]]></Description>
</Message>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[row 1]]></DataTag>
</Incident>
-<Message type="skip" file="../counting/tst_counting.cpp" line="118">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 2]]></DataTag>
<Description><![CDATA[Skipping]]></Description>
</Message>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testPassFail">
-<Message type="info" file="../counting/tst_counting.cpp" line="111">
+<Message type="info" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 1]]></DataTag>
<Description><![CDATA[QVERIFY(true)]]></Description>
</Message>
-<Message type="info" file="../counting/tst_counting.cpp" line="112">
+<Message type="info" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 1]]></DataTag>
<Description><![CDATA[QCOMPARE(2 + 1, 3)]]></Description>
</Message>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[row 1]]></DataTag>
</Incident>
-<Message type="info" file="../counting/tst_counting.cpp" line="115">
+<Message type="info" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 2]]></DataTag>
<Description><![CDATA[QVERIFY(false)]]></Description>
</Message>
-<Incident type="fail" file="../counting/tst_counting.cpp" line="115">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 2]]></DataTag>
<Description><![CDATA['false' returned FALSE. ()]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testSkipPass">
-<Message type="skip" file="../counting/tst_counting.cpp" line="118">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 1]]></DataTag>
<Description><![CDATA[Skipping]]></Description>
</Message>
-<Message type="info" file="../counting/tst_counting.cpp" line="111">
+<Message type="info" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 2]]></DataTag>
<Description><![CDATA[QVERIFY(true)]]></Description>
</Message>
-<Message type="info" file="../counting/tst_counting.cpp" line="112">
+<Message type="info" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 2]]></DataTag>
<Description><![CDATA[QCOMPARE(2 + 1, 3)]]></Description>
</Message>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[row 2]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testSkipSkip">
-<Message type="skip" file="../counting/tst_counting.cpp" line="118">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 1]]></DataTag>
<Description><![CDATA[Skipping]]></Description>
</Message>
-<Message type="skip" file="../counting/tst_counting.cpp" line="118">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 2]]></DataTag>
<Description><![CDATA[Skipping]]></Description>
</Message>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testSkipFail">
-<Message type="skip" file="../counting/tst_counting.cpp" line="118">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 1]]></DataTag>
<Description><![CDATA[Skipping]]></Description>
</Message>
-<Message type="info" file="../counting/tst_counting.cpp" line="115">
+<Message type="info" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 2]]></DataTag>
<Description><![CDATA[QVERIFY(false)]]></Description>
</Message>
-<Incident type="fail" file="../counting/tst_counting.cpp" line="115">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 2]]></DataTag>
<Description><![CDATA['false' returned FALSE. ()]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testFailPass">
-<Message type="info" file="../counting/tst_counting.cpp" line="115">
+<Message type="info" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 1]]></DataTag>
<Description><![CDATA[QVERIFY(false)]]></Description>
</Message>
-<Incident type="fail" file="../counting/tst_counting.cpp" line="115">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 1]]></DataTag>
<Description><![CDATA['false' returned FALSE. ()]]></Description>
</Incident>
-<Message type="info" file="../counting/tst_counting.cpp" line="111">
+<Message type="info" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 2]]></DataTag>
<Description><![CDATA[QVERIFY(true)]]></Description>
</Message>
-<Message type="info" file="../counting/tst_counting.cpp" line="112">
+<Message type="info" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 2]]></DataTag>
<Description><![CDATA[QCOMPARE(2 + 1, 3)]]></Description>
</Message>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[row 2]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testFailSkip">
-<Message type="info" file="../counting/tst_counting.cpp" line="115">
+<Message type="info" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 1]]></DataTag>
<Description><![CDATA[QVERIFY(false)]]></Description>
</Message>
-<Incident type="fail" file="../counting/tst_counting.cpp" line="115">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 1]]></DataTag>
<Description><![CDATA['false' returned FALSE. ()]]></Description>
</Incident>
-<Message type="skip" file="../counting/tst_counting.cpp" line="118">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 2]]></DataTag>
<Description><![CDATA[Skipping]]></Description>
</Message>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testFailFail">
-<Message type="info" file="../counting/tst_counting.cpp" line="115">
+<Message type="info" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 1]]></DataTag>
<Description><![CDATA[QVERIFY(false)]]></Description>
</Message>
-<Incident type="fail" file="../counting/tst_counting.cpp" line="115">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 1]]></DataTag>
<Description><![CDATA['false' returned FALSE. ()]]></Description>
</Incident>
-<Message type="info" file="../counting/tst_counting.cpp" line="115">
+<Message type="info" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 2]]></DataTag>
<Description><![CDATA[QVERIFY(false)]]></Description>
</Message>
-<Incident type="fail" file="../counting/tst_counting.cpp" line="115">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[row 2]]></DataTag>
<Description><![CDATA['false' returned FALSE. ()]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testFailInInit">
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[before]]></DataTag>
</Incident>
-<Incident type="fail" file="../counting/tst_counting.cpp" line="234">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[fail]]></DataTag>
<Description><![CDATA[Fail in init()]]></Description>
</Incident>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[after]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testFailInCleanup">
<Incident type="pass" file="" line="0">
@@ -195,27 +195,27 @@
<DataTag><![CDATA[fail]]></DataTag>
<Description><![CDATA[This test function should execute and then QFAIL in cleanup()]]></Description>
</Message>
-<Incident type="fail" file="../counting/tst_counting.cpp" line="242">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[fail]]></DataTag>
<Description><![CDATA[Fail in cleanup()]]></Description>
</Incident>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[after]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testSkipInInit">
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[before]]></DataTag>
</Incident>
-<Message type="skip" file="../counting/tst_counting.cpp" line="236">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[skip]]></DataTag>
<Description><![CDATA[Skip in init()]]></Description>
</Message>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[after]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testSkipInCleanup">
<Incident type="pass" file="" line="0">
@@ -225,18 +225,18 @@
<DataTag><![CDATA[skip]]></DataTag>
<Description><![CDATA[This test function should execute and then QSKIP in cleanup()]]></Description>
</Message>
-<Message type="skip" file="../counting/tst_counting.cpp" line="244">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp" line="0">
<DataTag><![CDATA[skip]]></DataTag>
<Description><![CDATA[Skip in cleanup()]]></Description>
</Message>
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[after]]></DataTag>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="cleanupTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<Duration msecs="0"/>
</TestCase>
diff --git a/tests/auto/testlib/selftests/expected_verifyexceptionthrown.lightxml b/tests/auto/testlib/selftests/expected_verifyexceptionthrown.lightxml
index d38363fb6e..6dd5260e80 100644
--- a/tests/auto/testlib/selftests/expected_verifyexceptionthrown.lightxml
+++ b/tests/auto/testlib/selftests/expected_verifyexceptionthrown.lightxml
@@ -5,58 +5,58 @@
</Environment>
<TestFunction name="initTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testCorrectStdTypes">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testCorrectStdExceptions">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testCorrectMyExceptions">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testFailInt">
-<Incident type="fail" file="tst_verifyexceptionthrown.cpp" line="128">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/verifyexceptionthrown/tst_verifyexceptionthrown.cpp" line="0">
<Description><![CDATA[Expected exception of type double to be thrown but unknown exception caught]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testFailStdString">
-<Incident type="fail" file="tst_verifyexceptionthrown.cpp" line="133">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/verifyexceptionthrown/tst_verifyexceptionthrown.cpp" line="0">
<Description><![CDATA[Expected exception of type char* to be thrown but unknown exception caught]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testFailStdRuntimeError">
-<Incident type="fail" file="tst_verifyexceptionthrown.cpp" line="138">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/verifyexceptionthrown/tst_verifyexceptionthrown.cpp" line="0">
<Description><![CDATA[Expected exception of type std::runtime_error to be thrown but std::exception caught with message: logic error]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testFailMyException">
-<Incident type="fail" file="tst_verifyexceptionthrown.cpp" line="143">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/verifyexceptionthrown/tst_verifyexceptionthrown.cpp" line="0">
<Description><![CDATA[Expected exception of type MyBaseException to be thrown but std::exception caught with message: logic error]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testFailMyDerivedException">
-<Incident type="fail" file="tst_verifyexceptionthrown.cpp" line="148">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/verifyexceptionthrown/tst_verifyexceptionthrown.cpp" line="0">
<Description><![CDATA[Expected exception of type std::runtime_error to be thrown but std::exception caught with message: MyDerivedException]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testFailNoException">
-<Incident type="fail" file="tst_verifyexceptionthrown.cpp" line="153">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/verifyexceptionthrown/tst_verifyexceptionthrown.cpp" line="0">
<Description><![CDATA[Expected exception of type std::exception to be thrown but no exception caught]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="cleanupTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<Duration msecs="0"/>
diff --git a/tests/auto/testlib/selftests/expected_verifyexceptionthrown.teamcity b/tests/auto/testlib/selftests/expected_verifyexceptionthrown.teamcity
index 25490bca78..030da58195 100644
--- a/tests/auto/testlib/selftests/expected_verifyexceptionthrown.teamcity
+++ b/tests/auto/testlib/selftests/expected_verifyexceptionthrown.teamcity
@@ -8,22 +8,22 @@
##teamcity[testStarted name='testCorrectMyExceptions()' flowId='tst_VerifyExceptionThrown']
##teamcity[testFinished name='testCorrectMyExceptions()' flowId='tst_VerifyExceptionThrown']
##teamcity[testStarted name='testFailInt()' flowId='tst_VerifyExceptionThrown']
-##teamcity[testFailed name='testFailInt()' message='Failure! |[Loc: tst_verifyexceptionthrown.cpp(120)|]' details='Expected exception of type double to be thrown but unknown exception caught' flowId='tst_VerifyExceptionThrown']
+##teamcity[testFailed name='testFailInt()' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/verifyexceptionthrown/tst_verifyexceptionthrown.cpp(0)|]' details='Expected exception of type double to be thrown but unknown exception caught' flowId='tst_VerifyExceptionThrown']
##teamcity[testFinished name='testFailInt()' flowId='tst_VerifyExceptionThrown']
##teamcity[testStarted name='testFailStdString()' flowId='tst_VerifyExceptionThrown']
-##teamcity[testFailed name='testFailStdString()' message='Failure! |[Loc: tst_verifyexceptionthrown.cpp(125)|]' details='Expected exception of type char* to be thrown but unknown exception caught' flowId='tst_VerifyExceptionThrown']
+##teamcity[testFailed name='testFailStdString()' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/verifyexceptionthrown/tst_verifyexceptionthrown.cpp(0)|]' details='Expected exception of type char* to be thrown but unknown exception caught' flowId='tst_VerifyExceptionThrown']
##teamcity[testFinished name='testFailStdString()' flowId='tst_VerifyExceptionThrown']
##teamcity[testStarted name='testFailStdRuntimeError()' flowId='tst_VerifyExceptionThrown']
-##teamcity[testFailed name='testFailStdRuntimeError()' message='Failure! |[Loc: tst_verifyexceptionthrown.cpp(130)|]' details='Expected exception of type std::runtime_error to be thrown but std::exception caught with message: logic error' flowId='tst_VerifyExceptionThrown']
+##teamcity[testFailed name='testFailStdRuntimeError()' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/verifyexceptionthrown/tst_verifyexceptionthrown.cpp(0)|]' details='Expected exception of type std::runtime_error to be thrown but std::exception caught with message: logic error' flowId='tst_VerifyExceptionThrown']
##teamcity[testFinished name='testFailStdRuntimeError()' flowId='tst_VerifyExceptionThrown']
##teamcity[testStarted name='testFailMyException()' flowId='tst_VerifyExceptionThrown']
-##teamcity[testFailed name='testFailMyException()' message='Failure! |[Loc: tst_verifyexceptionthrown.cpp(135)|]' details='Expected exception of type MyBaseException to be thrown but std::exception caught with message: logic error' flowId='tst_VerifyExceptionThrown']
+##teamcity[testFailed name='testFailMyException()' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/verifyexceptionthrown/tst_verifyexceptionthrown.cpp(0)|]' details='Expected exception of type MyBaseException to be thrown but std::exception caught with message: logic error' flowId='tst_VerifyExceptionThrown']
##teamcity[testFinished name='testFailMyException()' flowId='tst_VerifyExceptionThrown']
##teamcity[testStarted name='testFailMyDerivedException()' flowId='tst_VerifyExceptionThrown']
-##teamcity[testFailed name='testFailMyDerivedException()' message='Failure! |[Loc: tst_verifyexceptionthrown.cpp(140)|]' details='Expected exception of type std::runtime_error to be thrown but std::exception caught with message: MyDerivedException' flowId='tst_VerifyExceptionThrown']
+##teamcity[testFailed name='testFailMyDerivedException()' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/verifyexceptionthrown/tst_verifyexceptionthrown.cpp(0)|]' details='Expected exception of type std::runtime_error to be thrown but std::exception caught with message: MyDerivedException' flowId='tst_VerifyExceptionThrown']
##teamcity[testFinished name='testFailMyDerivedException()' flowId='tst_VerifyExceptionThrown']
##teamcity[testStarted name='testFailNoException()' flowId='tst_VerifyExceptionThrown']
-##teamcity[testFailed name='testFailNoException()' message='Failure! |[Loc: tst_verifyexceptionthrown.cpp(145)|]' details='Expected exception of type std::exception to be thrown but no exception caught' flowId='tst_VerifyExceptionThrown']
+##teamcity[testFailed name='testFailNoException()' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/verifyexceptionthrown/tst_verifyexceptionthrown.cpp(0)|]' details='Expected exception of type std::exception to be thrown but no exception caught' flowId='tst_VerifyExceptionThrown']
##teamcity[testFinished name='testFailNoException()' flowId='tst_VerifyExceptionThrown']
##teamcity[testStarted name='cleanupTestCase()' flowId='tst_VerifyExceptionThrown']
##teamcity[testFinished name='cleanupTestCase()' flowId='tst_VerifyExceptionThrown']
diff --git a/tests/auto/testlib/selftests/expected_verifyexceptionthrown.txt b/tests/auto/testlib/selftests/expected_verifyexceptionthrown.txt
index 43fc30c969..c982fbc5e7 100644
--- a/tests/auto/testlib/selftests/expected_verifyexceptionthrown.txt
+++ b/tests/auto/testlib/selftests/expected_verifyexceptionthrown.txt
@@ -1,21 +1,21 @@
********* Start testing of tst_VerifyExceptionThrown *********
-Config: Using QtTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@
+Config: Using QtTest library
PASS : tst_VerifyExceptionThrown::initTestCase()
PASS : tst_VerifyExceptionThrown::testCorrectStdTypes()
PASS : tst_VerifyExceptionThrown::testCorrectStdExceptions()
PASS : tst_VerifyExceptionThrown::testCorrectMyExceptions()
FAIL! : tst_VerifyExceptionThrown::testFailInt() Expected exception of type double to be thrown but unknown exception caught
- Loc: [tst_verifyexceptionthrown.cpp(128)]
+ Loc: [qtbase/tests/auto/testlib/selftests/verifyexceptionthrown/tst_verifyexceptionthrown.cpp(0)]
FAIL! : tst_VerifyExceptionThrown::testFailStdString() Expected exception of type char* to be thrown but unknown exception caught
- Loc: [tst_verifyexceptionthrown.cpp(133)]
+ Loc: [qtbase/tests/auto/testlib/selftests/verifyexceptionthrown/tst_verifyexceptionthrown.cpp(0)]
FAIL! : tst_VerifyExceptionThrown::testFailStdRuntimeError() Expected exception of type std::runtime_error to be thrown but std::exception caught with message: logic error
- Loc: [tst_verifyexceptionthrown.cpp(138)]
+ Loc: [qtbase/tests/auto/testlib/selftests/verifyexceptionthrown/tst_verifyexceptionthrown.cpp(0)]
FAIL! : tst_VerifyExceptionThrown::testFailMyException() Expected exception of type MyBaseException to be thrown but std::exception caught with message: logic error
- Loc: [tst_verifyexceptionthrown.cpp(143)]
+ Loc: [qtbase/tests/auto/testlib/selftests/verifyexceptionthrown/tst_verifyexceptionthrown.cpp(0)]
FAIL! : tst_VerifyExceptionThrown::testFailMyDerivedException() Expected exception of type std::runtime_error to be thrown but std::exception caught with message: MyDerivedException
- Loc: [tst_verifyexceptionthrown.cpp(148)]
+ Loc: [qtbase/tests/auto/testlib/selftests/verifyexceptionthrown/tst_verifyexceptionthrown.cpp(0)]
FAIL! : tst_VerifyExceptionThrown::testFailNoException() Expected exception of type std::exception to be thrown but no exception caught
- Loc: [tst_verifyexceptionthrown.cpp(153)]
+ Loc: [qtbase/tests/auto/testlib/selftests/verifyexceptionthrown/tst_verifyexceptionthrown.cpp(0)]
PASS : tst_VerifyExceptionThrown::cleanupTestCase()
-Totals: 5 passed, 6 failed, 0 skipped, 0 blacklisted
+Totals: 5 passed, 6 failed, 0 skipped, 0 blacklisted, 0ms
********* Finished testing of tst_VerifyExceptionThrown *********
diff --git a/tests/auto/testlib/selftests/expected_verifyexceptionthrown.xml b/tests/auto/testlib/selftests/expected_verifyexceptionthrown.xml
index 8c57fe5c0f..c8329197db 100644
--- a/tests/auto/testlib/selftests/expected_verifyexceptionthrown.xml
+++ b/tests/auto/testlib/selftests/expected_verifyexceptionthrown.xml
@@ -7,59 +7,59 @@
</Environment>
<TestFunction name="initTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testCorrectStdTypes">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testCorrectStdExceptions">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testCorrectMyExceptions">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testFailInt">
-<Incident type="fail" file="tst_verifyexceptionthrown.cpp" line="128">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/verifyexceptionthrown/tst_verifyexceptionthrown.cpp" line="0">
<Description><![CDATA[Expected exception of type double to be thrown but unknown exception caught]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testFailStdString">
-<Incident type="fail" file="tst_verifyexceptionthrown.cpp" line="133">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/verifyexceptionthrown/tst_verifyexceptionthrown.cpp" line="0">
<Description><![CDATA[Expected exception of type char* to be thrown but unknown exception caught]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testFailStdRuntimeError">
-<Incident type="fail" file="tst_verifyexceptionthrown.cpp" line="138">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/verifyexceptionthrown/tst_verifyexceptionthrown.cpp" line="0">
<Description><![CDATA[Expected exception of type std::runtime_error to be thrown but std::exception caught with message: logic error]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testFailMyException">
-<Incident type="fail" file="tst_verifyexceptionthrown.cpp" line="143">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/verifyexceptionthrown/tst_verifyexceptionthrown.cpp" line="0">
<Description><![CDATA[Expected exception of type MyBaseException to be thrown but std::exception caught with message: logic error]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testFailMyDerivedException">
-<Incident type="fail" file="tst_verifyexceptionthrown.cpp" line="148">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/verifyexceptionthrown/tst_verifyexceptionthrown.cpp" line="0">
<Description><![CDATA[Expected exception of type std::runtime_error to be thrown but std::exception caught with message: MyDerivedException]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testFailNoException">
-<Incident type="fail" file="tst_verifyexceptionthrown.cpp" line="153">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/verifyexceptionthrown/tst_verifyexceptionthrown.cpp" line="0">
<Description><![CDATA[Expected exception of type std::exception to be thrown but no exception caught]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="cleanupTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<Duration msecs="0"/>
</TestCase>
diff --git a/tests/auto/testlib/selftests/expected_warnings.lightxml b/tests/auto/testlib/selftests/expected_warnings.lightxml
index afbbf5b5e2..9d5a106500 100644
--- a/tests/auto/testlib/selftests/expected_warnings.lightxml
+++ b/tests/auto/testlib/selftests/expected_warnings.lightxml
@@ -5,7 +5,7 @@
</Environment>
<TestFunction name="initTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testWarnings">
<Message type="qwarn" file="" line="0">
@@ -39,7 +39,7 @@
<Description><![CDATA[Babablabla]]></Description>
</Message>
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testMissingWarnings">
<Message type="info" file="" line="0">
@@ -51,7 +51,7 @@
<Incident type="fail" file="" line="0">
<Description><![CDATA[Not all expected messages were received]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testMissingWarningsRegularExpression">
<Message type="info" file="" line="0">
@@ -60,7 +60,7 @@
<Incident type="fail" file="" line="0">
<Description><![CDATA[Not all expected messages were received]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testMissingWarningsWithData">
<Message type="info" file="" line="0">
@@ -87,10 +87,10 @@
<DataTag><![CDATA[second row]]></DataTag>
<Description><![CDATA[Not all expected messages were received]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="cleanupTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<Duration msecs="0"/>
diff --git a/tests/auto/testlib/selftests/expected_warnings.txt b/tests/auto/testlib/selftests/expected_warnings.txt
index 9f7393e90f..0a65213b79 100644
--- a/tests/auto/testlib/selftests/expected_warnings.txt
+++ b/tests/auto/testlib/selftests/expected_warnings.txt
@@ -1,5 +1,5 @@
********* Start testing of tst_Warnings *********
-Config: Using QtTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@
+Config: Using QtTest library
PASS : tst_Warnings::initTestCase()
QWARN : tst_Warnings::testWarnings() Warning
QWARN : tst_Warnings::testWarnings() Warning
@@ -24,5 +24,5 @@ INFO : tst_Warnings::testMissingWarningsWithData(second row) Did not receive m
INFO : tst_Warnings::testMissingWarningsWithData(second row) Did not receive message: "Warning1"
FAIL! : tst_Warnings::testMissingWarningsWithData(second row) Not all expected messages were received
PASS : tst_Warnings::cleanupTestCase()
-Totals: 3 passed, 4 failed, 0 skipped, 0 blacklisted
+Totals: 3 passed, 4 failed, 0 skipped, 0 blacklisted, 0ms
********* Finished testing of tst_Warnings *********
diff --git a/tests/auto/testlib/selftests/expected_warnings.xml b/tests/auto/testlib/selftests/expected_warnings.xml
index 7023e35e0c..1b17dbbf5d 100644
--- a/tests/auto/testlib/selftests/expected_warnings.xml
+++ b/tests/auto/testlib/selftests/expected_warnings.xml
@@ -7,7 +7,7 @@
</Environment>
<TestFunction name="initTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testWarnings">
<Message type="qwarn" file="" line="0">
@@ -41,7 +41,7 @@
<Description><![CDATA[Babablabla]]></Description>
</Message>
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testMissingWarnings">
<Message type="info" file="" line="0">
@@ -53,7 +53,7 @@
<Incident type="fail" file="" line="0">
<Description><![CDATA[Not all expected messages were received]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testMissingWarningsRegularExpression">
<Message type="info" file="" line="0">
@@ -62,7 +62,7 @@
<Incident type="fail" file="" line="0">
<Description><![CDATA[Not all expected messages were received]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testMissingWarningsWithData">
<Message type="info" file="" line="0">
@@ -89,11 +89,11 @@
<DataTag><![CDATA[second row]]></DataTag>
<Description><![CDATA[Not all expected messages were received]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="cleanupTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<Duration msecs="0"/>
</TestCase>
diff --git a/tests/auto/testlib/selftests/expected_xunit.lightxml b/tests/auto/testlib/selftests/expected_xunit.lightxml
index 95ab8f03f0..863501bddf 100644
--- a/tests/auto/testlib/selftests/expected_xunit.lightxml
+++ b/tests/auto/testlib/selftests/expected_xunit.lightxml
@@ -5,60 +5,60 @@
</Environment>
<TestFunction name="initTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testFunc1">
-<Message type="warn" file="tst_xunit.cpp" line="67">
+<Message type="warn" file="qtbase/tests/auto/testlib/selftests/xunit/tst_xunit.cpp" line="0">
<Description><![CDATA[just a QWARN() !]]></Description>
</Message>
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testFunc2">
<Message type="qdebug" file="" line="0">
<Description><![CDATA[a qDebug() call with comment-ending stuff -->]]></Description>
</Message>
-<Incident type="fail" file="tst_xunit.cpp" line="74">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/xunit/tst_xunit.cpp" line="0">
<Description><![CDATA[Compared values are not the same
Actual (2): 2
Expected (3): 3]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testFunc3">
-<Message type="skip" file="tst_xunit.cpp" line="79">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/xunit/tst_xunit.cpp" line="0">
<Description><![CDATA[skipping this function!]]></Description>
</Message>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testFunc4">
-<Incident type="fail" file="tst_xunit.cpp" line="84">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/xunit/tst_xunit.cpp" line="0">
<Description><![CDATA[a forced failure!]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testFunc5">
-<Incident type="xfail" file="tst_xunit.cpp" line="98">
+<Incident type="xfail" file="qtbase/tests/auto/testlib/selftests/xunit/tst_xunit.cpp" line="0">
<Description><![CDATA[this failure is expected]]></Description>
</Incident>
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testFunc6">
-<Incident type="xfail" file="tst_xunit.cpp" line="104">
+<Incident type="xfail" file="qtbase/tests/auto/testlib/selftests/xunit/tst_xunit.cpp" line="0">
<Description><![CDATA[this failure is also expected]]></Description>
</Incident>
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testFunc7">
-<Incident type="xpass" file="tst_xunit.cpp" line="110">
+<Incident type="xpass" file="qtbase/tests/auto/testlib/selftests/xunit/tst_xunit.cpp" line="0">
<Description><![CDATA['true' returned TRUE unexpectedly. ()]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="cleanupTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<Duration msecs="0"/>
diff --git a/tests/auto/testlib/selftests/expected_xunit.teamcity b/tests/auto/testlib/selftests/expected_xunit.teamcity
index 7f8ea3de3b..9969624413 100644
--- a/tests/auto/testlib/selftests/expected_xunit.teamcity
+++ b/tests/auto/testlib/selftests/expected_xunit.teamcity
@@ -2,24 +2,24 @@
##teamcity[testStarted name='initTestCase()' flowId='tst_Xunit']
##teamcity[testFinished name='initTestCase()' flowId='tst_Xunit']
##teamcity[testStarted name='testFunc1()' flowId='tst_Xunit']
-##teamcity[testStdOut name='testFunc1()' out='WARNING |[Loc: tst_xunit.cpp(59)|]: just a QWARN() !' flowId='tst_Xunit']
+##teamcity[testStdOut name='testFunc1()' out='WARNING |[Loc: qtbase/tests/auto/testlib/selftests/xunit/tst_xunit.cpp(0)|]: just a QWARN() !' flowId='tst_Xunit']
##teamcity[testFinished name='testFunc1()' flowId='tst_Xunit']
##teamcity[testStarted name='testFunc2()' flowId='tst_Xunit']
-##teamcity[testFailed name='testFunc2()' message='Failure! |[Loc: tst_xunit.cpp(66)|]' details='Compared values are not the same|n Actual (2): 2|n Expected (3): 3' flowId='tst_Xunit']
+##teamcity[testFailed name='testFunc2()' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/xunit/tst_xunit.cpp(0)|]' details='Compared values are not the same|n Actual (2): 2|n Expected (3): 3' flowId='tst_Xunit']
##teamcity[testStdOut name='testFunc2()' out='QDEBUG: a qDebug() call with comment-ending stuff -->' flowId='tst_Xunit']
##teamcity[testFinished name='testFunc2()' flowId='tst_Xunit']
-##teamcity[testIgnored name='testFunc3()' message='skipping this function! |[Loc: tst_xunit.cpp(71)|]' flowId='tst_Xunit']
+##teamcity[testIgnored name='testFunc3()' message='skipping this function! |[Loc: qtbase/tests/auto/testlib/selftests/xunit/tst_xunit.cpp(0)|]' flowId='tst_Xunit']
##teamcity[testStarted name='testFunc4()' flowId='tst_Xunit']
-##teamcity[testFailed name='testFunc4()' message='Failure! |[Loc: tst_xunit.cpp(76)|]' details='a forced failure!' flowId='tst_Xunit']
+##teamcity[testFailed name='testFunc4()' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/xunit/tst_xunit.cpp(0)|]' details='a forced failure!' flowId='tst_Xunit']
##teamcity[testFinished name='testFunc4()' flowId='tst_Xunit']
##teamcity[testStarted name='testFunc5()' flowId='tst_Xunit']
-##teamcity[testStdOut name='testFunc5()' out='XFAIL |[Loc: tst_xunit.cpp(90)|]: this failure is expected' flowId='tst_Xunit']
+##teamcity[testStdOut name='testFunc5()' out='XFAIL |[Loc: qtbase/tests/auto/testlib/selftests/xunit/tst_xunit.cpp(0)|]: this failure is expected' flowId='tst_Xunit']
##teamcity[testFinished name='testFunc5()' flowId='tst_Xunit']
##teamcity[testStarted name='testFunc6()' flowId='tst_Xunit']
-##teamcity[testStdOut name='testFunc6()' out='XFAIL |[Loc: tst_xunit.cpp(96)|]: this failure is also expected' flowId='tst_Xunit']
+##teamcity[testStdOut name='testFunc6()' out='XFAIL |[Loc: qtbase/tests/auto/testlib/selftests/xunit/tst_xunit.cpp(0)|]: this failure is also expected' flowId='tst_Xunit']
##teamcity[testFinished name='testFunc6()' flowId='tst_Xunit']
##teamcity[testStarted name='testFunc7()' flowId='tst_Xunit']
-##teamcity[testFailed name='testFunc7()' message='Failure! |[Loc: tst_xunit.cpp(102)|]' details='|'true|' returned TRUE unexpectedly. ()' flowId='tst_Xunit']
+##teamcity[testFailed name='testFunc7()' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/xunit/tst_xunit.cpp(0)|]' details='|'true|' returned TRUE unexpectedly. ()' flowId='tst_Xunit']
##teamcity[testFinished name='testFunc7()' flowId='tst_Xunit']
##teamcity[testStarted name='cleanupTestCase()' flowId='tst_Xunit']
##teamcity[testFinished name='cleanupTestCase()' flowId='tst_Xunit']
diff --git a/tests/auto/testlib/selftests/expected_xunit.txt b/tests/auto/testlib/selftests/expected_xunit.txt
index 4863711bd0..bc6f50a58f 100644
--- a/tests/auto/testlib/selftests/expected_xunit.txt
+++ b/tests/auto/testlib/selftests/expected_xunit.txt
@@ -1,26 +1,26 @@
********* Start testing of tst_Xunit *********
-Config: Using QtTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@
+Config: Using QtTest library
PASS : tst_Xunit::initTestCase()
WARNING: tst_Xunit::testFunc1() just a QWARN() !
- Loc: [tst_xunit.cpp(67)]
+ Loc: [qtbase/tests/auto/testlib/selftests/xunit/tst_xunit.cpp(0)]
PASS : tst_Xunit::testFunc1()
QDEBUG : tst_Xunit::testFunc2() a qDebug() call with comment-ending stuff -->
FAIL! : tst_Xunit::testFunc2() Compared values are not the same
Actual (2): 2
Expected (3): 3
- Loc: [tst_xunit.cpp(74)]
+ Loc: [qtbase/tests/auto/testlib/selftests/xunit/tst_xunit.cpp(0)]
SKIP : tst_Xunit::testFunc3() skipping this function!
- Loc: [tst_xunit.cpp(79)]
+ Loc: [qtbase/tests/auto/testlib/selftests/xunit/tst_xunit.cpp(0)]
FAIL! : tst_Xunit::testFunc4() a forced failure!
- Loc: [tst_xunit.cpp(84)]
+ Loc: [qtbase/tests/auto/testlib/selftests/xunit/tst_xunit.cpp(0)]
XFAIL : tst_Xunit::testFunc5() this failure is expected
- Loc: [tst_xunit.cpp(98)]
+ Loc: [qtbase/tests/auto/testlib/selftests/xunit/tst_xunit.cpp(0)]
PASS : tst_Xunit::testFunc5()
XFAIL : tst_Xunit::testFunc6() this failure is also expected
- Loc: [tst_xunit.cpp(104)]
+ Loc: [qtbase/tests/auto/testlib/selftests/xunit/tst_xunit.cpp(0)]
PASS : tst_Xunit::testFunc6()
XPASS : tst_Xunit::testFunc7() 'true' returned TRUE unexpectedly. ()
- Loc: [tst_xunit.cpp(110)]
+ Loc: [qtbase/tests/auto/testlib/selftests/xunit/tst_xunit.cpp(0)]
PASS : tst_Xunit::cleanupTestCase()
-Totals: 5 passed, 3 failed, 1 skipped, 0 blacklisted
+Totals: 5 passed, 3 failed, 1 skipped, 0 blacklisted, 0ms
********* Finished testing of tst_Xunit *********
diff --git a/tests/auto/testlib/selftests/expected_xunit.xml b/tests/auto/testlib/selftests/expected_xunit.xml
index f56ca947be..723ae6c914 100644
--- a/tests/auto/testlib/selftests/expected_xunit.xml
+++ b/tests/auto/testlib/selftests/expected_xunit.xml
@@ -7,61 +7,61 @@
</Environment>
<TestFunction name="initTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testFunc1">
-<Message type="warn" file="tst_xunit.cpp" line="67">
+<Message type="warn" file="qtbase/tests/auto/testlib/selftests/xunit/tst_xunit.cpp" line="0">
<Description><![CDATA[just a QWARN() !]]></Description>
</Message>
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testFunc2">
<Message type="qdebug" file="" line="0">
<Description><![CDATA[a qDebug() call with comment-ending stuff -->]]></Description>
</Message>
-<Incident type="fail" file="tst_xunit.cpp" line="74">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/xunit/tst_xunit.cpp" line="0">
<Description><![CDATA[Compared values are not the same
Actual (2): 2
Expected (3): 3]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testFunc3">
-<Message type="skip" file="tst_xunit.cpp" line="79">
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/xunit/tst_xunit.cpp" line="0">
<Description><![CDATA[skipping this function!]]></Description>
</Message>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testFunc4">
-<Incident type="fail" file="tst_xunit.cpp" line="84">
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/xunit/tst_xunit.cpp" line="0">
<Description><![CDATA[a forced failure!]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testFunc5">
-<Incident type="xfail" file="tst_xunit.cpp" line="98">
+<Incident type="xfail" file="qtbase/tests/auto/testlib/selftests/xunit/tst_xunit.cpp" line="0">
<Description><![CDATA[this failure is expected]]></Description>
</Incident>
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testFunc6">
-<Incident type="xfail" file="tst_xunit.cpp" line="104">
+<Incident type="xfail" file="qtbase/tests/auto/testlib/selftests/xunit/tst_xunit.cpp" line="0">
<Description><![CDATA[this failure is also expected]]></Description>
</Incident>
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="testFunc7">
-<Incident type="xpass" file="tst_xunit.cpp" line="110">
+<Incident type="xpass" file="qtbase/tests/auto/testlib/selftests/xunit/tst_xunit.cpp" line="0">
<Description><![CDATA['true' returned TRUE unexpectedly. ()]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="cleanupTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<Duration msecs="0"/>
</TestCase>
diff --git a/tests/auto/testlib/selftests/generate_expected_output.py b/tests/auto/testlib/selftests/generate_expected_output.py
index a3a66da98b..6c14d75ea6 100755
--- a/tests/auto/testlib/selftests/generate_expected_output.py
+++ b/tests/auto/testlib/selftests/generate_expected_output.py
@@ -252,7 +252,13 @@ def generateTestData(testname, clean,
def main(name, *args):
"""Minimal argument parsing and driver for the real work"""
- os.environ['LC_ALL'] = 'C'
+ os.environ.update(
+ LC_ALL = 'C', # Use standard locale
+ # Avoid interference from any qtlogging.ini files, e.g. in
+ # /etc/xdg/QtProject/, (must match tst_selftests.cpp's
+ # processEnvironment()'s value):
+ QT_LOGGING_RULES = '*.debug=true;qt.qpa.screen=false')
+
herePath = os.getcwd()
cleaner = Cleaner(herePath, name)
diff --git a/tests/auto/testlib/selftests/selftests.pri b/tests/auto/testlib/selftests/selftests.pri
index 0287e35447..42c62d3b55 100644
--- a/tests/auto/testlib/selftests/selftests.pri
+++ b/tests/auto/testlib/selftests/selftests.pri
@@ -15,6 +15,8 @@ SUBPROGRAMS = \
crashes \
datatable \
datetime \
+ deleteLater \
+ deleteLater_noApp \
differentexec \
exceptionthrow \
expectfail \
diff --git a/tests/auto/testlib/selftests/selftests.qrc b/tests/auto/testlib/selftests/selftests.qrc
index 02e8adb6b4..75d3375394 100644
--- a/tests/auto/testlib/selftests/selftests.qrc
+++ b/tests/auto/testlib/selftests/selftests.qrc
@@ -1,6 +1,5 @@
<RCC>
<qresource prefix="/">
- <file>expected_alive.txt</file>
<file>expected_assert.lightxml</file>
<file>expected_assert.teamcity</file>
<file>expected_assert.txt</file>
@@ -11,29 +10,40 @@
<file>expected_badxml.txt</file>
<file>expected_badxml.xml</file>
<file>expected_badxml.xunitxml</file>
- <file>expected_benchlibcallgrind.txt</file>
+ <file>expected_benchlibcallgrind_0.txt</file>
+ <file>expected_benchlibcallgrind_1.txt</file>
<file>expected_benchlibcallgrind.csv</file>
+ <file>expected_benchlibcallgrind.lightxml</file>
+ <file>expected_benchlibcallgrind.xml</file>
+ <file>expected_benchlibcallgrind.xunitxml</file>
+ <file>expected_benchlibcounting.csv</file>
<file>expected_benchlibcounting.lightxml</file>
<file>expected_benchlibcounting.txt</file>
<file>expected_benchlibcounting.xml</file>
<file>expected_benchlibcounting.xunitxml</file>
- <file>expected_benchlibcounting.csv</file>
+ <file>expected_benchlibeventcounter.csv</file>
<file>expected_benchlibeventcounter.lightxml</file>
<file>expected_benchlibeventcounter.txt</file>
<file>expected_benchlibeventcounter.xml</file>
<file>expected_benchlibeventcounter.xunitxml</file>
- <file>expected_benchlibeventcounter.csv</file>
+ <file>expected_benchliboptions.lightxml</file>
<file>expected_benchliboptions.txt</file>
+ <file>expected_benchliboptions.xml</file>
+ <file>expected_benchliboptions.xunitxml</file>
+ <file>expected_benchlibtickcounter.csv</file>
<file>expected_benchlibtickcounter.lightxml</file>
<file>expected_benchlibtickcounter.txt</file>
<file>expected_benchlibtickcounter.xml</file>
<file>expected_benchlibtickcounter.xunitxml</file>
- <file>expected_benchlibtickcounter.csv</file>
+ <file>expected_benchlibwalltime.csv</file>
<file>expected_benchlibwalltime.lightxml</file>
<file>expected_benchlibwalltime.txt</file>
<file>expected_benchlibwalltime.xml</file>
<file>expected_benchlibwalltime.xunitxml</file>
- <file>expected_benchlibwalltime.csv</file>
+ <file>expected_blacklisted.lightxml</file>
+ <file>expected_blacklisted.txt</file>
+ <file>expected_blacklisted.xml</file>
+ <file>expected_blacklisted.xunitxml</file>
<file>expected_cmptest.lightxml</file>
<file>expected_cmptest.teamcity</file>
<file>expected_cmptest.txt</file>
@@ -62,7 +72,10 @@
<file>expected_datetime.txt</file>
<file>expected_datetime.xml</file>
<file>expected_datetime.xunitxml</file>
+ <file>expected_differentexec.lightxml</file>
<file>expected_differentexec.txt</file>
+ <file>expected_differentexec.xml</file>
+ <file>expected_differentexec.xunitxml</file>
<file>expected_exceptionthrow.lightxml</file>
<file>expected_exceptionthrow.teamcity</file>
<file>expected_exceptionthrow.txt</file>
@@ -98,7 +111,10 @@
<file>expected_findtestdata.txt</file>
<file>expected_findtestdata.xml</file>
<file>expected_findtestdata.xunitxml</file>
+ <file>expected_float.lightxml</file>
<file>expected_float.txt</file>
+ <file>expected_float.xml</file>
+ <file>expected_float.xunitxml</file>
<file>expected_globaldata.lightxml</file>
<file>expected_globaldata.teamcity</file>
<file>expected_globaldata.txt</file>
@@ -114,7 +130,10 @@
<file>expected_maxwarnings.txt</file>
<file>expected_maxwarnings.xml</file>
<file>expected_maxwarnings.xunitxml</file>
+ <file>expected_multiexec.lightxml</file>
<file>expected_multiexec.txt</file>
+ <file>expected_multiexec.xml</file>
+ <file>expected_multiexec.xunitxml</file>
<file>expected_pairdiagnostics.lightxml</file>
<file>expected_pairdiagnostics.teamcity</file>
<file>expected_pairdiagnostics.txt</file>
@@ -122,9 +141,15 @@
<file>expected_pairdiagnostics.xunitxml</file>
<file>expected_printdatatags.txt</file>
<file>expected_printdatatagswithglobaltags.txt</file>
+ <file>expected_qexecstringlist.lightxml</file>
<file>expected_qexecstringlist.txt</file>
+ <file>expected_qexecstringlist.xml</file>
+ <file>expected_qexecstringlist.xunitxml</file>
+ <file>expected_silent.lightxml</file>
<file>expected_silent.teamcity</file>
<file>expected_silent.txt</file>
+ <file>expected_silent.xml</file>
+ <file>expected_silent.xunitxml</file>
<file>expected_singleskip.lightxml</file>
<file>expected_singleskip.teamcity</file>
<file>expected_singleskip.txt</file>
@@ -150,8 +175,11 @@
<file>expected_skipinitdata.txt</file>
<file>expected_skipinitdata.xml</file>
<file>expected_skipinitdata.xunitxml</file>
+ <file>expected_sleep.lightxml</file>
<file>expected_sleep.teamcity</file>
<file>expected_sleep.txt</file>
+ <file>expected_sleep.xml</file>
+ <file>expected_sleep.xunitxml</file>
<file>expected_strcmp.lightxml</file>
<file>expected_strcmp.teamcity</file>
<file>expected_strcmp.txt</file>
@@ -187,6 +215,5 @@
<file>expected_xunit.txt</file>
<file>expected_xunit.xml</file>
<file>expected_xunit.xunitxml</file>
- <file>expected_blacklisted.txt</file>
</qresource>
</RCC>
diff --git a/tests/auto/testlib/selftests/tst_selftests.cpp b/tests/auto/testlib/selftests/tst_selftests.cpp
index 64f324e26c..9bb3c9b2d4 100644
--- a/tests/auto/testlib/selftests/tst_selftests.cpp
+++ b/tests/auto/testlib/selftests/tst_selftests.cpp
@@ -568,6 +568,10 @@ static QProcessEnvironment processEnvironment()
if (useVariable)
result.insert(key, systemEnvironment.value(key));
}
+ // Avoid interference from any qtlogging.ini files, e.g. in /etc/xdg/QtProject/:
+ result.insert(QStringLiteral("QT_LOGGING_RULES"),
+ // Must match generate_expected_output.py's main()'s value:
+ QStringLiteral("*.debug=true;qt.qpa.screen=false"));
}
return result;
}
diff --git a/tests/auto/tools/moc/cxx11-explicit-override-control.h b/tests/auto/tools/moc/cxx11-explicit-override-control.h
index f361a47248..2211112717 100644
--- a/tests/auto/tools/moc/cxx11-explicit-override-control.h
+++ b/tests/auto/tools/moc/cxx11-explicit-override-control.h
@@ -132,17 +132,17 @@ public:
: ExplicitOverrideControlBase(parent) {}
private Q_SLOTS:
- void pureSlot0() Q_DECL_OVERRIDE {}
- void pureSlot1() Q_DECL_OVERRIDE {}
- void pureSlot2() const Q_DECL_OVERRIDE {}
- void pureSlot3() Q_DECL_OVERRIDE const {}
+ void pureSlot0() override {}
+ void pureSlot1() override {}
+ void pureSlot2() const override {}
+ void pureSlot3() override const {}
#if 0 // moc doesn't support volatile slots
- void pureSlot4() volatile Q_DECL_OVERRIDE {}
- void pureSlot5() Q_DECL_OVERRIDE volatile {}
- void pureSlot6() const volatile Q_DECL_OVERRIDE {}
- void pureSlot7() volatile Q_DECL_OVERRIDE const {}
- void pureSlot8() const Q_DECL_OVERRIDE volatile {}
- void pureSlot9() Q_DECL_OVERRIDE volatile const {}
+ void pureSlot4() volatile override {}
+ void pureSlot5() override volatile {}
+ void pureSlot6() const volatile override {}
+ void pureSlot7() volatile override const {}
+ void pureSlot8() const override volatile {}
+ void pureSlot9() override volatile const {}
#endif
};
@@ -176,17 +176,17 @@ public:
: ExplicitOverrideControlBase(parent) {}
private Q_SLOTS:
- void pureSlot0() Q_DECL_FINAL Q_DECL_OVERRIDE {}
- void pureSlot1() Q_DECL_OVERRIDE Q_DECL_FINAL {}
- void pureSlot2() Q_DECL_OVERRIDE const Q_DECL_FINAL {}
- void pureSlot3() Q_DECL_FINAL const Q_DECL_OVERRIDE {}
+ void pureSlot0() Q_DECL_FINAL override {}
+ void pureSlot1() override Q_DECL_FINAL {}
+ void pureSlot2() override const Q_DECL_FINAL {}
+ void pureSlot3() Q_DECL_FINAL const override {}
#if 0 // moc doesn't support volatile slots
- void pureSlot4() volatile Q_DECL_FINAL Q_DECL_OVERRIDE {}
- void pureSlot5() Q_DECL_OVERRIDE Q_DECL_FINAL volatile {}
- void pureSlot6() Q_DECL_OVERRIDE const volatile Q_DECL_FINAL {}
- void pureSlot7() volatile Q_DECL_OVERRIDE Q_DECL_FINAL const {}
- void pureSlot8() const Q_DECL_FINAL Q_DECL_OVERRIDE volatile {}
- void pureSlot9() Q_DECL_FINAL volatile const Q_DECL_OVERRIDE {}
+ void pureSlot4() volatile Q_DECL_FINAL override {}
+ void pureSlot5() override Q_DECL_FINAL volatile {}
+ void pureSlot6() override const volatile Q_DECL_FINAL {}
+ void pureSlot7() volatile override Q_DECL_FINAL const {}
+ void pureSlot8() const Q_DECL_FINAL override volatile {}
+ void pureSlot9() Q_DECL_FINAL volatile const override {}
#endif
};
diff --git a/tests/auto/tools/moc/moc.pro b/tests/auto/tools/moc/moc.pro
index b7151f9c16..d2b13f9c4e 100644
--- a/tests/auto/tools/moc/moc.pro
+++ b/tests/auto/tools/moc/moc.pro
@@ -32,7 +32,7 @@ HEADERS += using-namespaces.h no-keywords.h task87883.h c-comments.h backslash-n
namespace.h cxx17-namespaces.h
-if(*-g++*|*-icc*|*-clang*|*-llvm):!irix-*:!win32-*: HEADERS += os9-newlines.h win-newlines.h
+if(*-g++*|*-icc*|*-clang*|*-llvm):!win32-*: HEADERS += os9-newlines.h win-newlines.h
if(*-g++*|*-clang*): HEADERS += dollars.h
SOURCES += tst_moc.cpp
diff --git a/tests/auto/tools/moc/tst_moc.cpp b/tests/auto/tools/moc/tst_moc.cpp
index 55e8054a70..753da401a2 100644
--- a/tests/auto/tools/moc/tst_moc.cpp
+++ b/tests/auto/tools/moc/tst_moc.cpp
@@ -43,7 +43,7 @@
#include "pure-virtual-signals.h"
#include "qinvokable.h"
// msvc and friends crap out on it
-#if !defined(Q_CC_GNU) || defined(Q_OS_IRIX) || defined(Q_OS_WIN)
+#if !defined(Q_CC_GNU) || defined(Q_OS_WIN)
#define SKIP_NEWLINE_TEST
#endif
#if !defined(SKIP_NEWLINE_TEST)
@@ -163,7 +163,7 @@ class CreatableGadget
public:
Q_INVOKABLE CreatableGadget()
{
- CreatableGadget::qt_static_metacall((QObject*)this, QMetaObject::ReadProperty, -1, Q_NULLPTR);
+ CreatableGadget::qt_static_metacall((QObject*)this, QMetaObject::ReadProperty, -1, nullptr);
}
};
@@ -223,7 +223,7 @@ namespace {
{
Q_OBJECT
public:
- explicit ObjectInUnnamedNS(QObject *parent = Q_NULLPTR) : QObject(parent) {}
+ explicit ObjectInUnnamedNS(QObject *parent = nullptr) : QObject(parent) {}
};
}
@@ -3768,7 +3768,7 @@ void tst_Moc::veryLongStringData()
void tst_Moc::gadgetHierarchy()
{
- QCOMPARE(NonGadgetParent::Derived::staticMetaObject.superClass(), static_cast<const QMetaObject*>(Q_NULLPTR));
+ QCOMPARE(NonGadgetParent::Derived::staticMetaObject.superClass(), static_cast<const QMetaObject*>(nullptr));
QCOMPARE(GrandParentGadget::DerivedGadget::staticMetaObject.superClass(), &GrandParentGadget::BaseGadget::staticMetaObject);
}
diff --git a/tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp b/tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp
index d704d212dd..7e246b5366 100644
--- a/tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp
+++ b/tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp
@@ -243,7 +243,7 @@ void tst_QDialog::showMaximized()
dialog.showMaximized();
QVERIFY(dialog.isMaximized());
QVERIFY(dialog.isVisible());
-#if QT_CONFIG(sizegrip) && !defined(Q_OS_DARWIN) && !defined(Q_OS_IRIX) && !defined(Q_OS_HPUX)
+#if QT_CONFIG(sizegrip) && !defined(Q_OS_DARWIN) && !defined(Q_OS_HPUX)
QVERIFY(!sizeGrip->isVisible());
#endif
diff --git a/tests/auto/widgets/dialogs/qinputdialog/tst_qinputdialog.cpp b/tests/auto/widgets/dialogs/qinputdialog/tst_qinputdialog.cpp
index 62286d703f..259de49c67 100644
--- a/tests/auto/widgets/dialogs/qinputdialog/tst_qinputdialog.cpp
+++ b/tests/auto/widgets/dialogs/qinputdialog/tst_qinputdialog.cpp
@@ -338,7 +338,7 @@ class SelfDestructParent : public QWidget
Q_OBJECT
public:
explicit SelfDestructParent(int delay = 100)
- : QWidget(Q_NULLPTR)
+ : QWidget(nullptr)
{
QTimer::singleShot(delay, this, SLOT(deleteLater()));
}
diff --git a/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp b/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp
index 6a16e48394..a5058f4b6c 100644
--- a/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp
+++ b/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp
@@ -134,10 +134,10 @@ class ExecCloseHelper : public QObject
public:
enum { CloseWindow = -1 };
- explicit ExecCloseHelper(QObject *parent = Q_NULLPTR)
- : QObject(parent), m_key(0), m_timerId(0), m_testCandidate(Q_NULLPTR) { }
+ explicit ExecCloseHelper(QObject *parent = nullptr)
+ : QObject(parent), m_key(0), m_timerId(0), m_testCandidate(nullptr) { }
- void start(int key, QWidget *testCandidate = Q_NULLPTR)
+ void start(int key, QWidget *testCandidate = nullptr)
{
m_key = key;
m_testCandidate = testCandidate;
@@ -147,7 +147,7 @@ public:
bool done() const { return !m_timerId; }
protected:
- void timerEvent(QTimerEvent *te) Q_DECL_OVERRIDE;
+ void timerEvent(QTimerEvent *te) override;
private:
int m_key;
@@ -172,7 +172,7 @@ void ExecCloseHelper::timerEvent(QTimerEvent *te)
QKeyEvent *ke = new QKeyEvent(QEvent::KeyPress, m_key, Qt::NoModifier);
QCoreApplication::postEvent(m_testCandidate, ke);
}
- m_testCandidate = Q_NULLPTR;
+ m_testCandidate = nullptr;
killTimer(m_timerId);
m_timerId = m_key = 0;
}
diff --git a/tests/auto/widgets/dialogs/qprogressdialog/tst_qprogressdialog.cpp b/tests/auto/widgets/dialogs/qprogressdialog/tst_qprogressdialog.cpp
index 44b7894c53..00d640e55e 100644
--- a/tests/auto/widgets/dialogs/qprogressdialog/tst_qprogressdialog.cpp
+++ b/tests/auto/widgets/dialogs/qprogressdialog/tst_qprogressdialog.cpp
@@ -255,10 +255,10 @@ class QTestTranslator : public QTranslator
public:
explicit QTestTranslator(QString str) : m_str(qMove(str)) {}
- QString translate(const char *, const char *sourceText, const char *, int) const Q_DECL_OVERRIDE
+ QString translate(const char *, const char *sourceText, const char *, int) const override
{ return m_str + sourceText + m_str; }
- bool isEmpty() const Q_DECL_OVERRIDE { return false; }
+ bool isEmpty() const override { return false; }
};
template <typename Translator>
diff --git a/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp
index 2220ef8d2f..26831002ce 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp
@@ -1101,11 +1101,11 @@ void tst_QGraphicsItem::visible()
scene.addItem(item);
QVERIFY(item->isVisible());
- QCOMPARE(scene.items(QPointF(0, 0)).value(0, Q_NULLPTR), item);
+ QCOMPARE(scene.items(QPointF(0, 0)).value(0, nullptr), item);
item->setVisible(false);
QVERIFY(scene.items(QPointF(0, 0)).isEmpty());
item->setVisible(true);
- QCOMPARE(scene.items(QPointF(0, 0)).value(0, Q_NULLPTR), item);
+ QCOMPARE(scene.items(QPointF(0, 0)).value(0, nullptr), item);
QGraphicsSceneMouseEvent event(QEvent::GraphicsSceneMousePress);
event.setButton(Qt::LeftButton);
@@ -5494,16 +5494,16 @@ void tst_QGraphicsItem::itemClipsChildrenToShape2()
QGraphicsScene scene;
scene.addItem(parent);
- QCOMPARE(scene.items(QPointF(5, 5)).value(0, Q_NULLPTR), (QGraphicsItem *)parent);
+ QCOMPARE(scene.items(QPointF(5, 5)).value(0, nullptr), (QGraphicsItem *)parent);
QVERIFY(scene.items(QPointF(15, 5)).isEmpty());
QVERIFY(scene.items(QPointF(5, 15)).isEmpty());
QVERIFY(scene.items(QPointF(60, 60)).isEmpty());
QVERIFY(scene.items(QPointF(140, 60)).isEmpty());
QVERIFY(scene.items(QPointF(60, 140)).isEmpty());
QVERIFY(scene.items(QPointF(140, 140)).isEmpty());
- QCOMPARE(scene.items(QPointF(75, 75)).value(0, Q_NULLPTR), (QGraphicsItem *)child2);
- QCOMPARE(scene.items(QPointF(75, 100)).value(0, Q_NULLPTR), (QGraphicsItem *)child1);
- QCOMPARE(scene.items(QPointF(100, 75)).value(0, Q_NULLPTR), (QGraphicsItem *)child1);
+ QCOMPARE(scene.items(QPointF(75, 75)).value(0, nullptr), (QGraphicsItem *)child2);
+ QCOMPARE(scene.items(QPointF(75, 100)).value(0, nullptr), (QGraphicsItem *)child1);
+ QCOMPARE(scene.items(QPointF(100, 75)).value(0, nullptr), (QGraphicsItem *)child1);
QImage image(100, 100, QImage::Format_ARGB32_Premultiplied);
image.fill(0);
@@ -5538,9 +5538,9 @@ void tst_QGraphicsItem::itemClipsChildrenToShape3()
grandchild->setPos( 50, 50 );
parent->setFlag(QGraphicsItem::ItemClipsChildrenToShape);
- QCOMPARE(scene.items(QPointF(25, 25)).value(0, Q_NULLPTR), (QGraphicsItem *)parent);
- QCOMPARE(scene.items(QPointF(75, 75)).value(0, Q_NULLPTR), (QGraphicsItem *)child);
- QCOMPARE(scene.items(QPointF(125, 125)).value(0, Q_NULLPTR), (QGraphicsItem *)grandchild);
+ QCOMPARE(scene.items(QPointF(25, 25)).value(0, nullptr), (QGraphicsItem *)parent);
+ QCOMPARE(scene.items(QPointF(75, 75)).value(0, nullptr), (QGraphicsItem *)child);
+ QCOMPARE(scene.items(QPointF(125, 125)).value(0, nullptr), (QGraphicsItem *)grandchild);
QVERIFY(scene.items(QPointF(175, 175)).isEmpty());
// Move child to fully overlap the parent. The grandchild should
@@ -5548,9 +5548,9 @@ void tst_QGraphicsItem::itemClipsChildrenToShape3()
child->prepareGeometryChange();
child->setPos( 0, 0 );
- QCOMPARE(scene.items(QPointF(25, 25)).value(0, Q_NULLPTR), (QGraphicsItem *)child);
- QCOMPARE(scene.items(QPointF(75, 75)).value(0, Q_NULLPTR), (QGraphicsItem *)grandchild);
- QCOMPARE(scene.items(QPointF(125, 125)).value(0, Q_NULLPTR), (QGraphicsItem *)grandchild);
+ QCOMPARE(scene.items(QPointF(25, 25)).value(0, nullptr), (QGraphicsItem *)child);
+ QCOMPARE(scene.items(QPointF(75, 75)).value(0, nullptr), (QGraphicsItem *)grandchild);
+ QCOMPARE(scene.items(QPointF(125, 125)).value(0, nullptr), (QGraphicsItem *)grandchild);
QVERIFY(scene.items(QPointF(175, 175)).isEmpty());
}
@@ -5823,8 +5823,8 @@ void tst_QGraphicsItem::itemClippingDiscovery()
rightRectItem->setParentItem(clipItem);
// The rects item are both visible at these points.
- QCOMPARE(scene.items(QPointF(10, 10)).value(0, Q_NULLPTR), (QGraphicsItem *)leftRectItem);
- QCOMPARE(scene.items(QPointF(90, 90)).value(0, Q_NULLPTR), (QGraphicsItem *)rightRectItem);
+ QCOMPARE(scene.items(QPointF(10, 10)).value(0, nullptr), (QGraphicsItem *)leftRectItem);
+ QCOMPARE(scene.items(QPointF(90, 90)).value(0, nullptr), (QGraphicsItem *)rightRectItem);
// The ellipse clips the rects now.
clipItem->setFlag(QGraphicsItem::ItemClipsChildrenToShape);
@@ -5864,7 +5864,7 @@ void tst_QGraphicsItem::itemContainsChildrenInShape()
int oldChildBoundingRectCalls = childOutsideShape->boundingRectCalls;
// First test that both items are searched if no optimization flags are set
- QGraphicsItem* item = scene.items(QPointF(25, 5)).value(0, Q_NULLPTR);
+ QGraphicsItem* item = scene.items(QPointF(25, 5)).value(0, nullptr);
QCOMPARE(item, childOutsideShape);
QVERIFY(parent->boundingRectCalls > oldParentBoundingRectCalls);
@@ -5875,7 +5875,7 @@ void tst_QGraphicsItem::itemContainsChildrenInShape()
oldChildBoundingRectCalls = childOutsideShape->boundingRectCalls;
// Repeat the test to make sure that no caching/indexing is in effect
- item = scene.items(QPointF(25, 5)).value(0, Q_NULLPTR);
+ item = scene.items(QPointF(25, 5)).value(0, nullptr);
QCOMPARE(item, childOutsideShape);
QVERIFY(parent->boundingRectCalls > oldParentBoundingRectCalls);
@@ -5888,7 +5888,7 @@ void tst_QGraphicsItem::itemContainsChildrenInShape()
// Set the optimization flag and make sure that the child is not returned
// and that the child's boundingRect() method is never called.
parent->setFlag(QGraphicsItem::ItemContainsChildrenInShape);
- item = scene.items(QPointF(25, 5)).value(0, Q_NULLPTR);
+ item = scene.items(QPointF(25, 5)).value(0, nullptr);
QVERIFY(!(item));
QVERIFY(parent->boundingRectCalls > oldParentBoundingRectCalls);
diff --git a/tests/auto/widgets/graphicsview/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp b/tests/auto/widgets/graphicsview/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp
index 0f5277710c..97f3eb4a60 100644
--- a/tests/auto/widgets/graphicsview/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp
@@ -894,7 +894,7 @@ public:
: QProxyStyle(key),
horizontalSpacing(-1), verticalSpacing(-1) {}
- virtual int pixelMetric(QStyle::PixelMetric pm, const QStyleOption *option = 0, const QWidget *widget = 0) const Q_DECL_OVERRIDE
+ virtual int pixelMetric(QStyle::PixelMetric pm, const QStyleOption *option = 0, const QWidget *widget = 0) const override
{
if (pm == QStyle::PM_LayoutHorizontalSpacing && horizontalSpacing >= 0) {
return horizontalSpacing;
diff --git a/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp b/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
index 07d195b3e8..1529cfc158 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
@@ -2661,9 +2661,6 @@ void tst_QGraphicsProxyWidget::childPos_data()
void tst_QGraphicsProxyWidget::childPos()
{
-#ifdef Q_OS_IRIX
- QSKIP("This test is not reliable on IRIX.");
-#endif
QFETCH(bool, moveCombo);
QFETCH(QPoint, comboPos);
QFETCH(QPointF, proxyPos);
diff --git a/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp b/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp
index 968233438a..539580f628 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp
@@ -295,7 +295,7 @@ void tst_QGraphicsScene::construction()
static inline const QGraphicsItem *itemAt(const QGraphicsScene &scene, qreal x, qreal y)
{
- return scene.items(QPointF(x, y)).value(0, Q_NULLPTR);
+ return scene.items(QPointF(x, y)).value(0, nullptr);
}
void tst_QGraphicsScene::sceneRect()
diff --git a/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp b/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp
index 1be17b552e..85b42e54fe 100644
--- a/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp
@@ -2059,10 +2059,10 @@ void tst_QGraphicsWidget::task236127_bspTreeIndexFails()
QTRY_VERIFY(scene.items(QPointF(25, 25)).isEmpty());
widget->setGeometry(0, 112, 360, 528);
- QTRY_COMPARE(scene.items(QPointF(15, 120)).value(0, Q_NULLPTR), (QGraphicsItem *)widget);
+ QTRY_COMPARE(scene.items(QPointF(15, 120)).value(0, nullptr), (QGraphicsItem *)widget);
widget2->setGeometry(0, 573, 360, 67);
- QTRY_COMPARE(scene.items(QPointF(15, 120)).value(0, Q_NULLPTR), (QGraphicsItem *)widget);
- QTRY_COMPARE(scene.items(QPointF(50, 585)).value(0, Q_NULLPTR), (QGraphicsItem *)widget2);
+ QTRY_COMPARE(scene.items(QPointF(15, 120)).value(0, nullptr), (QGraphicsItem *)widget);
+ QTRY_COMPARE(scene.items(QPointF(50, 585)).value(0, nullptr), (QGraphicsItem *)widget2);
}
void tst_QGraphicsWidget::defaultSize()
@@ -3461,12 +3461,12 @@ void tst_QGraphicsWidget::QTBUG_45867_send_itemChildAddedChange_to_parent()
{
}
- QRectF boundingRect() const Q_DECL_OVERRIDE { return QRectF(); }
+ QRectF boundingRect() const override { return QRectF(); }
- void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *) Q_DECL_OVERRIDE {}
+ void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *) override {}
protected:
- QVariant itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value) Q_DECL_OVERRIDE
+ QVariant itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value) override
{
if (change == QGraphicsItem::ItemChildAddedChange)
++m_itemChildAddedChangeNotificationsCount;
diff --git a/tests/auto/widgets/itemviews/itemviews.pro b/tests/auto/widgets/itemviews/itemviews.pro
index af0b6aeef0..f2ee0e9124 100644
--- a/tests/auto/widgets/itemviews/itemviews.pro
+++ b/tests/auto/widgets/itemviews/itemviews.pro
@@ -20,7 +20,3 @@ SUBDIRS=\
!qtConfig(private_tests): SUBDIRS -= \
qcolumnview \
qlistwidget \
-
-# This test takes too long to run on IRIX, so skip it on that platform
-irix-*:SUBDIRS -= qitemview
-
diff --git a/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp b/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp
index 1ac66ed5cb..f6723ceba4 100644
--- a/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp
+++ b/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp
@@ -77,7 +77,7 @@ public:
GeometriesTestView() : QTableView(), updateGeometriesCalled(false) {}
bool updateGeometriesCalled;
protected slots:
- void updateGeometries() Q_DECL_OVERRIDE { updateGeometriesCalled = true; QTableView::updateGeometries(); }
+ void updateGeometries() override { updateGeometriesCalled = true; QTableView::updateGeometries(); }
};
class tst_QAbstractItemView : public QObject
@@ -1555,7 +1555,7 @@ public:
QItemDelegate(parent)
{}
- void setEditorData(QWidget *editor, const QModelIndex &index) const Q_DECL_OVERRIDE {
+ void setEditorData(QWidget *editor, const QModelIndex &index) const override {
Q_UNUSED(index);
static bool w = true;
editor->setEnabled(w);
@@ -1999,7 +1999,7 @@ void tst_QAbstractItemView::QTBUG50535_update_on_new_selection_model()
{
}
- void setSelectionModel(QItemSelectionModel *model) Q_DECL_OVERRIDE
+ void setSelectionModel(QItemSelectionModel *model) override
{
m_deselectedMustBeEmpty = !selectionModel() || !model || selectionModel()->model() != model->model();
QListView::setSelectionModel(model);
@@ -2009,7 +2009,7 @@ void tst_QAbstractItemView::QTBUG50535_update_on_new_selection_model()
bool selectionChangedOk() const { return m_selectionChangedOk; }
protected:
- bool viewportEvent(QEvent *event) Q_DECL_OVERRIDE
+ bool viewportEvent(QEvent *event) override
{
if (event->type() == QEvent::Paint)
++m_paintEventsCount;
@@ -2017,7 +2017,7 @@ void tst_QAbstractItemView::QTBUG50535_update_on_new_selection_model()
}
void selectionChanged(const QItemSelection &selected,
- const QItemSelection &deselected) Q_DECL_OVERRIDE
+ const QItemSelection &deselected) override
{
if (m_deselectedMustBeEmpty && !deselected.isEmpty())
m_selectionChangedOk = false;
@@ -2140,7 +2140,7 @@ signals:
void setSelectionCalled(const QRect &rect);
protected:
- void setSelection(const QRect &rect, QItemSelectionModel::SelectionFlags flags) Q_DECL_OVERRIDE
+ void setSelection(const QRect &rect, QItemSelectionModel::SelectionFlags flags) override
{
emit setSelectionCalled(rect);
QListView::setSelection(rect, flags);
diff --git a/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp b/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp
index 90019a1798..273e90e110 100644
--- a/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp
+++ b/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp
@@ -1800,7 +1800,7 @@ class TestHeaderViewStyle : public QProxyStyle
{
public:
TestHeaderViewStyle() : horizontalSectionSize(100) {}
- int pixelMetric(PixelMetric metric, const QStyleOption *option = 0, const QWidget *widget = 0) const Q_DECL_OVERRIDE
+ int pixelMetric(PixelMetric metric, const QStyleOption *option = 0, const QWidget *widget = 0) const override
{
if (metric == QStyle::PM_HeaderDefaultSectionSizeHorizontal)
return horizontalSectionSize;
diff --git a/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp b/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp
index 5e0d99f25e..1d8286b3cf 100644
--- a/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp
+++ b/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp
@@ -282,7 +282,7 @@ public:
class ScrollPerItemListView : public QListView
{
public:
- explicit ScrollPerItemListView(QWidget *parent = Q_NULLPTR)
+ explicit ScrollPerItemListView(QWidget *parent = nullptr)
: QListView(parent)
{
// Force per item scroll mode since it comes from the style by default
diff --git a/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp b/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp
index b2e1a2d9b5..f870605d7d 100644
--- a/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp
+++ b/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp
@@ -165,6 +165,7 @@ private slots:
void statusTip_data();
void statusTip();
+ void fetchMoreOnScroll();
// task-specific tests:
void task174627_moveLeftToRoot();
@@ -2607,7 +2608,7 @@ class TestTreeViewStyle : public QProxyStyle
{
public:
TestTreeViewStyle() : indentation(20) {}
- int pixelMetric(PixelMetric metric, const QStyleOption *option = 0, const QWidget *widget = 0) const Q_DECL_OVERRIDE
+ int pixelMetric(PixelMetric metric, const QStyleOption *option = 0, const QWidget *widget = 0) const override
{
if (metric == QStyle::PM_TreeViewIndentation)
return indentation;
@@ -4565,6 +4566,49 @@ void tst_QTreeView::statusTip()
QTRY_COMPARE(mw.statusBar()->currentMessage(), QLatin1String("Header 0 -- Status"));
}
+class FetchMoreModel : public QStandardItemModel
+{
+public:
+ FetchMoreModel() : QStandardItemModel(), canFetchReady(false)
+ {
+ for (int i = 0; i < 20; ++i) {
+ QStandardItem *item = new QStandardItem("Row");
+ item->appendRow(new QStandardItem("Child"));
+ appendRow(item);
+ }
+ }
+ bool canFetchMore(const QModelIndex &parent) const override
+ {
+ if (!canFetchReady || !parent.isValid())
+ return false;
+ if (!parent.parent().isValid())
+ return rowCount(parent) < 20;
+ return false;
+ }
+ void fetchMore(const QModelIndex &parent) override
+ {
+ QStandardItem *item = itemFromIndex(parent);
+ for (int i = 0; i < 19; ++i)
+ item->appendRow(new QStandardItem(QString("New Child %1").arg(i)));
+ }
+ bool canFetchReady;
+};
+
+void tst_QTreeView::fetchMoreOnScroll()
+{
+ QTreeView tw;
+ FetchMoreModel im;
+ tw.setModel(&im);
+ tw.show();
+ tw.expandAll();
+ QTest::qWaitForWindowActive(&tw);
+ // Now we can allow the fetch to happen
+ im.canFetchReady = true;
+ tw.verticalScrollBar()->setValue(tw.verticalScrollBar()->maximum());
+ // The item should have now fetched the other children, thus bringing the count to 20
+ QCOMPARE(im.item(19)->rowCount(), 20);
+}
+
static void fillModeltaskQTBUG_8376(QAbstractItemModel &model)
{
model.insertRow(0);
diff --git a/tests/auto/widgets/itemviews/qtreewidget/tst_qtreewidget.cpp b/tests/auto/widgets/itemviews/qtreewidget/tst_qtreewidget.cpp
index fa7f9596da..3317c79daa 100644
--- a/tests/auto/widgets/itemviews/qtreewidget/tst_qtreewidget.cpp
+++ b/tests/auto/widgets/itemviews/qtreewidget/tst_qtreewidget.cpp
@@ -3449,7 +3449,7 @@ void tst_QTreeWidget::getMimeDataWithInvalidItem()
{
CustomTreeWidget w;
QTest::ignoreMessage(QtWarningMsg, "QTreeWidget::mimeData: Null-item passed");
- QMimeData *md = w.mimeData(QList<QTreeWidgetItem*>() << Q_NULLPTR);
+ QMimeData *md = w.mimeData(QList<QTreeWidgetItem*>() << nullptr);
QVERIFY(!md);
}
diff --git a/tests/auto/widgets/kernel/qaction/tst_qaction.cpp b/tests/auto/widgets/kernel/qaction/tst_qaction.cpp
index ac0174d19a..272ec6d60b 100644
--- a/tests/auto/widgets/kernel/qaction/tst_qaction.cpp
+++ b/tests/auto/widgets/kernel/qaction/tst_qaction.cpp
@@ -354,7 +354,7 @@ void tst_QAction::enabledVisibleInteraction()
void tst_QAction::task200823_tooltip()
{
- const QScopedPointer<QAction> action(new QAction("foo", Q_NULLPTR));
+ const QScopedPointer<QAction> action(new QAction("foo", nullptr));
QString shortcut("ctrl+o");
action->setShortcut(shortcut);
@@ -368,7 +368,7 @@ void tst_QAction::task200823_tooltip()
void tst_QAction::task229128TriggeredSignalWithoutActiongroup()
{
// test without a group
- const QScopedPointer<QAction> actionWithoutGroup(new QAction("Test", Q_NULLPTR));
+ const QScopedPointer<QAction> actionWithoutGroup(new QAction("Test", nullptr));
QSignalSpy spyWithoutGroup(actionWithoutGroup.data(), SIGNAL(triggered(bool)));
QCOMPARE(spyWithoutGroup.count(), 0);
actionWithoutGroup->trigger();
diff --git a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp
index 6ff38abdb8..c70ac0309f 100644
--- a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp
+++ b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp
@@ -2214,7 +2214,7 @@ void tst_QApplication::staticFunctions()
QApplication::activeModalWidget();
QApplication::focusWidget();
QApplication::activeWindow();
- QApplication::setActiveWindow(Q_NULLPTR);
+ QApplication::setActiveWindow(nullptr);
QApplication::widgetAt(QPoint(0, 0));
QApplication::topLevelAt(QPoint(0, 0));
QApplication::setGlobalStrut(QSize(0, 0));
diff --git a/tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp b/tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp
index 7262817d23..2f1a305710 100644
--- a/tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp
+++ b/tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp
@@ -293,7 +293,7 @@ void tst_QBoxLayout::taskQTBUG_40609_addingWidgetToItsOwnLayout(){
layout.setObjectName("ef9e2b42298e0e6420105bb");
QTest::ignoreMessage(QtWarningMsg, "QLayout: Cannot add a null widget to QVBoxLayout/ef9e2b42298e0e6420105bb");
- layout.addWidget(Q_NULLPTR);
+ layout.addWidget(nullptr);
QCOMPARE(layout.count(), 0);
QTest::ignoreMessage(QtWarningMsg, "QLayout: Cannot add parent widget QWidget/347b469225a24a0ef05150a to its child layout QVBoxLayout/ef9e2b42298e0e6420105bb");
@@ -309,7 +309,7 @@ void tst_QBoxLayout::taskQTBUG_40609_addingLayoutToItself(){
layout.setObjectName("cc751dd0f50f62b05a62da");
QTest::ignoreMessage(QtWarningMsg, "QLayout: Cannot add a null layout to QVBoxLayout/cc751dd0f50f62b05a62da");
- layout.addLayout(Q_NULLPTR);
+ layout.addLayout(nullptr);
QCOMPARE(layout.count(), 0);
QTest::ignoreMessage(QtWarningMsg, "QLayout: Cannot add layout QVBoxLayout/cc751dd0f50f62b05a62da to itself");
diff --git a/tests/auto/widgets/kernel/qgesturerecognizer/tst_qgesturerecognizer.cpp b/tests/auto/widgets/kernel/qgesturerecognizer/tst_qgesturerecognizer.cpp
index c3ebb838bb..bcf48c21df 100644
--- a/tests/auto/widgets/kernel/qgesturerecognizer/tst_qgesturerecognizer.cpp
+++ b/tests/auto/widgets/kernel/qgesturerecognizer/tst_qgesturerecognizer.cpp
@@ -84,7 +84,7 @@ public:
{ return m_receivedGestures.value(gestureType); }
protected:
- bool event(QEvent * event) Q_DECL_OVERRIDE;
+ bool event(QEvent * event) override;
private:
typedef QHash<Qt::GestureType, bool> GestureTypeHash;
diff --git a/tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp b/tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp
index 37e2bdb069..40a2319910 100644
--- a/tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp
+++ b/tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp
@@ -336,7 +336,7 @@ void tst_QGridLayout::setMinAndMaxSize()
layout.removeItem(spacer);
delete spacer;
- spacer = Q_NULLPTR;
+ spacer = nullptr;
rightChild.hide();
QApplication::sendPostedEvents(0, 0);
@@ -1624,7 +1624,7 @@ void tst_QGridLayout::taskQTBUG_40609_addingWidgetToItsOwnLayout(){
layout.setObjectName("d631e91a35f2b66a6dff35");
QTest::ignoreMessage(QtWarningMsg, "QLayout: Cannot add a null widget to QGridLayout/d631e91a35f2b66a6dff35");
- layout.addWidget(Q_NULLPTR, 0, 0);
+ layout.addWidget(nullptr, 0, 0);
QCOMPARE(layout.count(), 0);
QTest::ignoreMessage(QtWarningMsg, "QLayout: Cannot add parent widget QWidget/9bb37ca762aeb7269b8 to its child layout QGridLayout/d631e91a35f2b66a6dff35");
@@ -1639,7 +1639,7 @@ void tst_QGridLayout::taskQTBUG_40609_addingLayoutToItself(){
layout.setObjectName("5d79e1b0aed83f100e3c2");
QTest::ignoreMessage(QtWarningMsg, "QLayout: Cannot add a null layout to QGridLayout/5d79e1b0aed83f100e3c2");
- layout.addLayout(Q_NULLPTR, 0, 0);
+ layout.addLayout(nullptr, 0, 0);
QCOMPARE(layout.count(), 0);
QTest::ignoreMessage(QtWarningMsg, "QLayout: Cannot add layout QGridLayout/5d79e1b0aed83f100e3c2 to itself");
diff --git a/tests/auto/widgets/kernel/qshortcut/tst_qshortcut.cpp b/tests/auto/widgets/kernel/qshortcut/tst_qshortcut.cpp
index 9d0c939d84..ff35b0cdb1 100644
--- a/tests/auto/widgets/kernel/qshortcut/tst_qshortcut.cpp
+++ b/tests/auto/widgets/kernel/qshortcut/tst_qshortcut.cpp
@@ -1105,7 +1105,7 @@ public:
int overrideCount;
- bool event(QEvent *e) Q_DECL_OVERRIDE
+ bool event(QEvent *e) override
{
if (e->type() == QEvent::ShortcutOverride)
overrideCount++;
diff --git a/tests/auto/widgets/kernel/qsizepolicy/tst_qsizepolicy.cpp b/tests/auto/widgets/kernel/qsizepolicy/tst_qsizepolicy.cpp
index d50f46cc16..eb3264be53 100644
--- a/tests/auto/widgets/kernel/qsizepolicy/tst_qsizepolicy.cpp
+++ b/tests/auto/widgets/kernel/qsizepolicy/tst_qsizepolicy.cpp
@@ -60,7 +60,7 @@ private:
struct PrettyPrint {
const char *m_s;
template <typename T>
- explicit PrettyPrint(const T &t) : m_s(Q_NULLPTR)
+ explicit PrettyPrint(const T &t) : m_s(nullptr)
{
using QT_PREPEND_NAMESPACE(QTest)::toString;
m_s = toString(t);
diff --git a/tests/auto/widgets/kernel/qtooltip/tst_qtooltip.cpp b/tests/auto/widgets/kernel/qtooltip/tst_qtooltip.cpp
index c163117ef3..86736bb082 100644
--- a/tests/auto/widgets/kernel/qtooltip/tst_qtooltip.cpp
+++ b/tests/auto/widgets/kernel/qtooltip/tst_qtooltip.cpp
@@ -129,7 +129,7 @@ static QWidget *findWhatsThat()
if (widget->inherits("QWhatsThat"))
return widget;
}
- return Q_NULLPTR;
+ return nullptr;
}
void tst_QToolTip::whatsThis()
@@ -137,7 +137,7 @@ void tst_QToolTip::whatsThis()
qApp->setStyleSheet( "QWidget { font-size: 72px; }" );
QWhatsThis::showText(QPoint(0, 0), "This is text");
- QWidget *whatsthis = Q_NULLPTR;
+ QWidget *whatsthis = nullptr;
QTRY_VERIFY( (whatsthis = findWhatsThat()) );
QVERIFY(whatsthis->isVisible());
const int whatsThisHeight = whatsthis->height();
diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
index cf2794903e..d2c89e31c3 100644
--- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
+++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
@@ -6065,7 +6065,7 @@ public:
startTimer(1000);
}
- void timerEvent(QTimerEvent *) Q_DECL_OVERRIDE
+ void timerEvent(QTimerEvent *) override
{
switch (state++) {
case 0:
@@ -6088,7 +6088,7 @@ public:
return false;
}
- bool nativeEvent(const QByteArray &eventType, void *message, long *) Q_DECL_OVERRIDE
+ bool nativeEvent(const QByteArray &eventType, void *message, long *) override
{
if (isMapNotify(eventType, message))
gotExpectedMapNotify = true;
@@ -6096,7 +6096,7 @@ public:
}
// QAbstractNativeEventFilter interface
- bool nativeEventFilter(const QByteArray &eventType, void *message, long *) Q_DECL_OVERRIDE
+ bool nativeEventFilter(const QByteArray &eventType, void *message, long *) override
{
if (isMapNotify(eventType, message))
gotExpectedGlobalEvent = true;
@@ -10521,7 +10521,7 @@ public slots:
QTimer::singleShot(100, this, SLOT(doMouseMoves()));
modal->exec();
delete modal;
- modal = Q_NULLPTR;
+ modal = nullptr;
}
void doMouseMoves()
@@ -10594,7 +10594,7 @@ class KeyboardWidget : public QWidget
{
public:
KeyboardWidget(QWidget* parent = 0) : QWidget(parent), m_eventCounter(0) {}
- virtual void mousePressEvent(QMouseEvent* ev) Q_DECL_OVERRIDE {
+ virtual void mousePressEvent(QMouseEvent* ev) override {
m_modifiers = ev->modifiers();
m_appModifiers = QApplication::keyboardModifiers();
++m_eventCounter;
diff --git a/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp b/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp
index b76c4d35a8..9021be1515 100644
--- a/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp
+++ b/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp
@@ -214,12 +214,12 @@ class PaintTestWidget : public QWidget
public:
int paintEventCount;
- explicit PaintTestWidget(QWidget *parent = Q_NULLPTR)
+ explicit PaintTestWidget(QWidget *parent = nullptr)
: QWidget(parent)
, paintEventCount(0)
{}
- void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE
+ void paintEvent(QPaintEvent *event) override
{
++paintEventCount;
QWidget::paintEvent(event);
@@ -692,7 +692,7 @@ public:
int resizeCount;
protected:
- void resizeEvent(QResizeEvent *) Q_DECL_OVERRIDE
+ void resizeEvent(QResizeEvent *) override
{
resizeCount++;
}
@@ -759,7 +759,7 @@ public:
, moveCount(0)
{ }
- void moveEvent(QMoveEvent *) Q_DECL_OVERRIDE
+ void moveEvent(QMoveEvent *) override
{
moveCount++;
}
@@ -798,7 +798,7 @@ public:
}
protected:
- bool eventFilter(QObject *o, QEvent *e) Q_DECL_OVERRIDE
+ bool eventFilter(QObject *o, QEvent *e) override
{
if (e->type() == filterEventType())
++eventCount;
diff --git a/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp b/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp
index cd8ba95b06..e49fd701d6 100644
--- a/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp
+++ b/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp
@@ -730,7 +730,7 @@ public:
, called(false)
{}
- void drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p, const QWidget *w) const Q_DECL_OVERRIDE {
+ void drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p, const QWidget *w) const override {
called = true;
return QProxyStyle::drawPrimitive(pe, opt, p, w);
}
@@ -773,74 +773,74 @@ class TestStyleOptionInitProxy: public QProxyStyle
Q_OBJECT
public:
mutable bool invalidOptionsDetected;
- explicit TestStyleOptionInitProxy(QStyle *style = Q_NULLPTR)
+ explicit TestStyleOptionInitProxy(QStyle *style = nullptr)
: QProxyStyle(style),
invalidOptionsDetected(false)
{}
- void drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p, const QWidget *w) const Q_DECL_OVERRIDE {
+ void drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p, const QWidget *w) const override {
checkStyleEnum<QStyle::PrimitiveElement>(pe, opt);
return QProxyStyle::drawPrimitive(pe, opt, p, w);
}
- void drawControl(ControlElement element, const QStyleOption *opt, QPainter *p, const QWidget *w) const Q_DECL_OVERRIDE {
+ void drawControl(ControlElement element, const QStyleOption *opt, QPainter *p, const QWidget *w) const override {
checkStyleEnum<QStyle::ControlElement>(element, opt);
return QProxyStyle::drawControl(element, opt, p, w);
}
- QRect subElementRect(SubElement subElement, const QStyleOption *option, const QWidget *widget) const Q_DECL_OVERRIDE {
+ QRect subElementRect(SubElement subElement, const QStyleOption *option, const QWidget *widget) const override {
checkStyleEnum<QStyle::SubElement>(subElement, option);
return QProxyStyle::subElementRect(subElement, option, widget);
}
- void drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p, const QWidget *widget) const Q_DECL_OVERRIDE {
+ void drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p, const QWidget *widget) const override {
checkStyleEnum<QStyle::ComplexControl>(cc, opt);
return QProxyStyle::drawComplexControl(cc, opt, p, widget);
}
- QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *opt, SubControl sc, const QWidget *widget) const Q_DECL_OVERRIDE {
+ QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *opt, SubControl sc, const QWidget *widget) const override {
checkStyleEnum<QStyle::ComplexControl>(cc, opt);
return QProxyStyle::subControlRect(cc, opt, sc, widget);
}
- int pixelMetric(PixelMetric metric, const QStyleOption *option, const QWidget *widget) const Q_DECL_OVERRIDE {
+ int pixelMetric(PixelMetric metric, const QStyleOption *option, const QWidget *widget) const override {
checkStyleEnum<QStyle::PixelMetric>(metric, option);
return QProxyStyle::pixelMetric(metric, option, widget);
}
- QSize sizeFromContents(ContentsType ct, const QStyleOption *opt, const QSize &contentsSize, const QWidget *w) const Q_DECL_OVERRIDE {
+ QSize sizeFromContents(ContentsType ct, const QStyleOption *opt, const QSize &contentsSize, const QWidget *w) const override {
checkStyleEnum<QStyle::ContentsType>(ct, opt);
return QProxyStyle::sizeFromContents(ct, opt, contentsSize, w);
}
- int styleHint(StyleHint stylehint, const QStyleOption *opt, const QWidget *widget, QStyleHintReturn *returnData) const Q_DECL_OVERRIDE {
+ int styleHint(StyleHint stylehint, const QStyleOption *opt, const QWidget *widget, QStyleHintReturn *returnData) const override {
checkStyleEnum<QStyle::StyleHint>(stylehint, opt);
return QProxyStyle::styleHint(stylehint, opt, widget, returnData);
}
- QPixmap standardPixmap(StandardPixmap standardPixmap, const QStyleOption *opt, const QWidget *widget) const Q_DECL_OVERRIDE {
+ QPixmap standardPixmap(StandardPixmap standardPixmap, const QStyleOption *opt, const QWidget *widget) const override {
checkStyleEnum<QStyle::StandardPixmap>(standardPixmap, opt);
return QProxyStyle::standardPixmap(standardPixmap, opt, widget);
}
- QIcon standardIcon(StandardPixmap standardIcon, const QStyleOption *option, const QWidget *widget) const Q_DECL_OVERRIDE {
+ QIcon standardIcon(StandardPixmap standardIcon, const QStyleOption *option, const QWidget *widget) const override {
checkStyleEnum<QStyle::StandardPixmap>(standardIcon, option);
return QProxyStyle::standardIcon(standardIcon, option, widget);
}
- QPixmap generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap, const QStyleOption *opt) const Q_DECL_OVERRIDE {
+ QPixmap generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap, const QStyleOption *opt) const override {
checkStyle(QString::asprintf("QIcon::Mode(%i)", iconMode).toLatin1(), opt);
return QProxyStyle::generatedIconPixmap(iconMode, pixmap, opt);
}
- int layoutSpacing(QSizePolicy::ControlType control1, QSizePolicy::ControlType control2, Qt::Orientation orientation, const QStyleOption *option, const QWidget *widget) const Q_DECL_OVERRIDE {
+ int layoutSpacing(QSizePolicy::ControlType control1, QSizePolicy::ControlType control2, Qt::Orientation orientation, const QStyleOption *option, const QWidget *widget) const override {
checkStyle(QString::asprintf("QSizePolicy::ControlType(%i), QSizePolicy::ControlType(%i)", control1, control2).toLatin1(), option);
return QProxyStyle::layoutSpacing(control1, control2, orientation, option, widget);
}
private:
void checkStyle(const QByteArray &info, const QStyleOption *opt) const {
- if (opt && (opt->version == 0 || opt->styleObject == Q_NULLPTR) ) {
+ if (opt && (opt->version == 0 || opt->styleObject == nullptr) ) {
invalidOptionsDetected = true;
qWarning() << baseStyle()->metaObject()->className()
<< "Invalid QStyleOption found for"
diff --git a/tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp b/tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp
index 92bcd5c350..6fbb0fe5fa 100644
--- a/tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp
+++ b/tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp
@@ -610,7 +610,7 @@ void tst_QCompleter::directoryModel_data()
QTest::newRow("(/et)") << "/et" << "" << "etc" << "/etc";
#else
QTest::newRow("()") << "" << "" << "/" << "/";
-#if !defined(Q_OS_IRIX) && !defined(Q_OS_AIX) && !defined(Q_OS_HPUX) && !defined(Q_OS_QNX)
+#if !defined(Q_OS_AIX) && !defined(Q_OS_HPUX) && !defined(Q_OS_QNX)
QTest::newRow("(/h)") << "/h" << "" << "home" << "/home";
#endif
QTest::newRow("(/et)") << "/et" << "" << "etc" << "/etc";
@@ -656,7 +656,7 @@ void tst_QCompleter::fileSystemModel_data()
QTest::newRow("(/et)") << "/et" << "" << "etc" << "/etc";
#else
QTest::newRow("()") << "" << "" << "/" << "/";
-#if !defined(Q_OS_IRIX) && !defined(Q_OS_AIX) && !defined(Q_OS_HPUX) && !defined(Q_OS_QNX)
+#if !defined(Q_OS_AIX) && !defined(Q_OS_HPUX) && !defined(Q_OS_QNX)
QTest::newRow("(/h)") << "/h" << "" << "home" << "/home";
#endif
QTest::newRow("(/et)") << "/et" << "" << "etc" << "/etc";
diff --git a/tests/auto/widgets/util/qundogroup/tst_qundogroup.cpp b/tests/auto/widgets/util/qundogroup/tst_qundogroup.cpp
index 62c3469447..c1524d870d 100644
--- a/tests/auto/widgets/util/qundogroup/tst_qundogroup.cpp
+++ b/tests/auto/widgets/util/qundogroup/tst_qundogroup.cpp
@@ -30,24 +30,6 @@
#include <QUndoStack>
#include <QAction>
-// Temporarily disabling IRIX due to build issuues with GCC
-#if defined(__sgi) && defined(__GNUC__)
-
-class tst_QUndoGroup : public QObject
-{
- Q_OBJECT
-public:
- tst_QUndoGroup() {}
-
-private slots:
- void setActive() { QSKIP( "Not tested on irix-g++"); }
- void addRemoveStack() { QSKIP( "Not tested on irix-g++"); }
- void deleteStack() { QSKIP( "Not tested on irix-g++"); }
- void checkSignals() { QSKIP( "Not tested on irix-g++"); }
- void addStackAndDie() { QSKIP( "Not tested on irix-g++"); }
-};
-#else
-
/******************************************************************************
** Commands
*/
@@ -652,7 +634,6 @@ void tst_QUndoGroup::commandTextFormat()
qApp->removeTranslator(&translator);
#endif
}
-#endif // !(SGI && GCC)
QTEST_MAIN(tst_QUndoGroup)
diff --git a/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp b/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp
index b6007482ae..c65cfa3e1a 100644
--- a/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp
+++ b/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp
@@ -3273,7 +3273,7 @@ void tst_QComboBox::task_QTBUG_49831_scrollerNotActivated()
class QTBUG_56693_Model : public QStandardItemModel
{
public:
- QTBUG_56693_Model(QObject *parent = Q_NULLPTR)
+ QTBUG_56693_Model(QObject *parent = nullptr)
: QStandardItemModel(parent)
{ }
@@ -3301,7 +3301,7 @@ public:
}
- void drawControl(ControlElement element, const QStyleOption *opt, QPainter *p, const QWidget *w = Q_NULLPTR) const override
+ void drawControl(ControlElement element, const QStyleOption *opt, QPainter *p, const QWidget *w = nullptr) const override
{
if (element == CE_MenuItem)
if (const QStyleOptionMenuItem *menuItem = qstyleoption_cast<const QStyleOptionMenuItem *>(opt))
diff --git a/tests/auto/widgets/widgets/qlabel/tst_qlabel.cpp b/tests/auto/widgets/widgets/qlabel/tst_qlabel.cpp
index 6363d0c673..500ec2e1fa 100644
--- a/tests/auto/widgets/widgets/qlabel/tst_qlabel.cpp
+++ b/tests/auto/widgets/widgets/qlabel/tst_qlabel.cpp
@@ -47,7 +47,7 @@ public:
QList<QEvent::Type> events;
protected:
- bool event(QEvent *ev) Q_DECL_OVERRIDE {
+ bool event(QEvent *ev) override {
events.append(ev->type());
return QWidget::event(ev);
}
diff --git a/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp b/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp
index 21669e42cd..54e9ec0bf2 100644
--- a/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp
+++ b/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp
@@ -3046,7 +3046,7 @@ void tst_QLineEdit::cutWithoutSelection()
QClipboard *clipboard = QGuiApplication::clipboard();
if (!PlatformClipboard::isAvailable()
|| !QGuiApplication::platformName().compare("xcb", Qt::CaseInsensitive)) { // Avoid unstable X11 clipboard
- clipboard = Q_NULLPTR;
+ clipboard = nullptr;
}
if (clipboard)
@@ -4475,7 +4475,7 @@ template <class T> T *findAssociatedWidget(const QAction *a)
if (T *result = qobject_cast<T *>(w))
return result;
}
- return Q_NULLPTR;
+ return nullptr;
}
void tst_QLineEdit::sideWidgetsActionEvents()
diff --git a/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp b/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp
index 91c12e292d..15e2d9fa11 100644
--- a/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp
+++ b/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp
@@ -610,7 +610,7 @@ static QMenu *getTornOffMenu()
if (w->isVisible() && w->inherits("QTornOffMenu"))
return static_cast<QMenu *>(w);
}
- return Q_NULLPTR;
+ return nullptr;
}
void tst_QMenu::tearOff()
@@ -812,7 +812,7 @@ public:
}
protected:
- void showEvent(QShowEvent *e) Q_DECL_OVERRIDE
+ void showEvent(QShowEvent *e) override
{
QVERIFY(m_subMenu->isVisible());
QVERIFY2(m_subMenu->x() > x(),
@@ -821,7 +821,7 @@ protected:
QMenu::showEvent(e);
}
- void timerEvent(QTimerEvent *e) Q_DECL_OVERRIDE
+ void timerEvent(QTimerEvent *e) override
{
if (e->timerId() == m_timerId) {
switch (m_timerTick++) {
@@ -1210,7 +1210,7 @@ public:
setMouseTracking(true);
}
- bool event(QEvent *e) Q_DECL_OVERRIDE
+ bool event(QEvent *e) override
{
switch (e->type()) {
case QEvent::MouseMove:
@@ -1518,7 +1518,7 @@ void tst_QMenu::menuSize_Scrolling()
~TestMenu() {}
private:
- void showEvent(QShowEvent *e) Q_DECL_OVERRIDE
+ void showEvent(QShowEvent *e) override
{
QVERIFY(actions().length() == m_numItems);
diff --git a/tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp b/tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp
index 417fa9befa..96a64b18c1 100644
--- a/tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp
+++ b/tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp
@@ -1549,7 +1549,7 @@ void tst_QMenuBar::taskQTBUG53205_crashReparentNested()
//set the new parent, a window
QScopedPointer<QWidget> windowedParent;
- windowedParent.reset(new QWidget(Q_NULLPTR, Qt::WindowFlags()));
+ windowedParent.reset(new QWidget(nullptr, Qt::WindowFlags()));
windowedParent->setGeometry(400, 10, 300, 300);
windowedParent->show();
@@ -1566,7 +1566,7 @@ void tst_QMenuBar::taskQTBUG53205_crashReparentNested()
//to windowedParent<-movingParent<-containerWidget<-containedWidget<-menuBar
movingParent.setParent(windowedParent.data(),0);
// this resets the parenting and the menu bar's window
- taskQTBUG53205MenuBar->setParent(Q_NULLPTR);
+ taskQTBUG53205MenuBar->setParent(nullptr);
taskQTBUG53205MenuBar->setParent(&containedWidget);
//from windowedParent<-movingParent<-containerWidget<-containedWidget<-menuBar
//to : QMainWindow<-hiddenParent<-movingParent<-containerWidget<-containedWidget<-menuBar
@@ -1598,7 +1598,7 @@ void tst_QMenuBar::platformMenu()
void tst_QMenuBar::slotForTaskQTBUG53205()
{
QWidget *parent = taskQTBUG53205MenuBar->parentWidget();
- taskQTBUG53205MenuBar->setParent(Q_NULLPTR);
+ taskQTBUG53205MenuBar->setParent(nullptr);
taskQTBUG53205MenuBar->setParent(parent);
}
diff --git a/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp b/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp
index 49291cf5f9..db125f6644 100644
--- a/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp
+++ b/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp
@@ -100,16 +100,16 @@ public:
m_w(expectedWidth), m_h(expectedHeight),
r(1.0f), g(0.0f), b(0.0f) { }
- void initializeGL() Q_DECL_OVERRIDE {
+ void initializeGL() override {
m_initCalled = true;
initializeOpenGLFunctions();
}
- void paintGL() Q_DECL_OVERRIDE {
+ void paintGL() override {
m_paintCalled = true;
glClearColor(r, g, b, 1.0f);
glClear(GL_COLOR_BUFFER_BIT);
}
- void resizeGL(int w, int h) Q_DECL_OVERRIDE {
+ void resizeGL(int w, int h) override {
m_resizeCalled = true;
m_resizeOk = w == m_w && h == m_h;
}
@@ -203,10 +203,10 @@ public:
PainterWidget(QWidget *parent)
: QOpenGLWidget(parent), m_clear(false) { }
- void initializeGL() Q_DECL_OVERRIDE {
+ void initializeGL() override {
initializeOpenGLFunctions();
}
- void paintGL() Q_DECL_OVERRIDE {
+ void paintGL() override {
QPainter p(this);
QCOMPARE(p.device()->width(), width());
QCOMPARE(p.device()->height(), height());
@@ -322,7 +322,7 @@ public:
void resetPaintCount() { m_count = 0; }
protected:
- void drawForeground(QPainter *, const QRectF &) Q_DECL_OVERRIDE;
+ void drawForeground(QPainter *, const QRectF &) override;
int m_count;
};
@@ -372,7 +372,7 @@ class PaintCountWidget : public QOpenGLWidget
public:
PaintCountWidget() : m_count(0) { }
void reset() { m_count = 0; }
- void paintGL() Q_DECL_OVERRIDE { ++m_count; }
+ void paintGL() override { ++m_count; }
int m_count;
};
@@ -393,7 +393,7 @@ void tst_QOpenGLWidget::requestUpdate()
class FboCheckWidget : public QOpenGLWidget
{
public:
- void paintGL() Q_DECL_OVERRIDE {
+ void paintGL() override {
GLuint reportedDefaultFbo = QOpenGLContext::currentContext()->defaultFramebufferObject();
GLuint expectedDefaultFbo = defaultFramebufferObject();
QCOMPARE(reportedDefaultFbo, expectedDefaultFbo);
diff --git a/tests/auto/widgets/widgets/qsplitter/tst_qsplitter.cpp b/tests/auto/widgets/widgets/qsplitter/tst_qsplitter.cpp
index aef4046afe..80c12c0bd2 100644
--- a/tests/auto/widgets/widgets/qsplitter/tst_qsplitter.cpp
+++ b/tests/auto/widgets/widgets/qsplitter/tst_qsplitter.cpp
@@ -299,7 +299,7 @@ class TestSplitterStyle : public QProxyStyle
{
public:
TestSplitterStyle() : handleWidth(5) {}
- int pixelMetric(PixelMetric metric, const QStyleOption *option = 0, const QWidget *widget = 0) const Q_DECL_OVERRIDE
+ int pixelMetric(PixelMetric metric, const QStyleOption *option = 0, const QWidget *widget = 0) const override
{
if (metric == QStyle::PM_SplitterWidth)
return handleWidth;
diff --git a/tests/benchmarks/corelib/thread/qthreadpool/tst_qthreadpool.cpp b/tests/benchmarks/corelib/thread/qthreadpool/tst_qthreadpool.cpp
index 30a7b82278..10928e3afc 100644
--- a/tests/benchmarks/corelib/thread/qthreadpool/tst_qthreadpool.cpp
+++ b/tests/benchmarks/corelib/thread/qthreadpool/tst_qthreadpool.cpp
@@ -53,7 +53,7 @@ tst_QThreadPool::~tst_QThreadPool()
class NoOpRunnable : public QRunnable
{
public:
- void run() Q_DECL_OVERRIDE {
+ void run() override {
}
};
diff --git a/tests/benchmarks/gui/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp b/tests/benchmarks/gui/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp
index 622df2fb3b..6145fabbf8 100644
--- a/tests/benchmarks/gui/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp
+++ b/tests/benchmarks/gui/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp
@@ -216,7 +216,7 @@ void tst_QGraphicsScene::itemAt()
QGraphicsItem *item = 0;
QBENCHMARK {
- item = scene.items(QPointF(0, 0)).value(0, Q_NULLPTR);
+ item = scene.items(QPointF(0, 0)).value(0, nullptr);
}
//let QGraphicsScene::_q_polishItems be called so ~QGraphicsItem doesn't spend all his time cleaning the unpolished list
diff --git a/tests/manual/cocoa/menurama/mainwindow.h b/tests/manual/cocoa/menurama/mainwindow.h
index a7afa770be..3ca90dad8f 100644
--- a/tests/manual/cocoa/menurama/mainwindow.h
+++ b/tests/manual/cocoa/menurama/mainwindow.h
@@ -44,7 +44,7 @@ public:
~MainWindow();
protected:
- void timerEvent(QTimerEvent *) Q_DECL_OVERRIDE;
+ void timerEvent(QTimerEvent *) override;
public slots:
void enableStuffMenu(bool enable);
diff --git a/tests/manual/cocoa/menurama/menuramaapplication.cpp b/tests/manual/cocoa/menurama/menuramaapplication.cpp
index 4cd741000e..1506fe7d19 100644
--- a/tests/manual/cocoa/menurama/menuramaapplication.cpp
+++ b/tests/manual/cocoa/menurama/menuramaapplication.cpp
@@ -71,5 +71,5 @@ QAction *MenuramaApplication::findAction(QLatin1String title, QMenu *parentMenu)
if (a->text() == title)
return a;
- return Q_NULLPTR;
+ return nullptr;
}
diff --git a/tests/manual/diaglib/logwidget.cpp b/tests/manual/diaglib/logwidget.cpp
index 8e4844fab2..35fabd6e2e 100644
--- a/tests/manual/diaglib/logwidget.cpp
+++ b/tests/manual/diaglib/logwidget.cpp
@@ -133,7 +133,7 @@ void LogWidget::install()
qInfo("%s", qPrintable(LogWidget::startupMessage()));
}
-void LogWidget::uninstall() { qInstallMessageHandler(Q_NULLPTR); }
+void LogWidget::uninstall() { qInstallMessageHandler(nullptr); }
#else // Qt 5
diff --git a/tests/manual/foreignwindows/main.cpp b/tests/manual/foreignwindows/main.cpp
index cda7e7207e..74c6d8c376 100644
--- a/tests/manual/foreignwindows/main.cpp
+++ b/tests/manual/foreignwindows/main.cpp
@@ -110,7 +110,7 @@ EmbeddingWindow::EmbeddingWindow(QWindow *window) : m_window(window)
+ QLatin1String(" 0x") + QString::number(window->winId(), 16);
setWindowTitle(title);
setObjectName("MainWindow");
- QWidget *container = QWidget::createWindowContainer(window, Q_NULLPTR, Qt::Widget);
+ QWidget *container = QWidget::createWindowContainer(window, nullptr, Qt::Widget);
container->setObjectName("Container");
setCentralWidget(container);
@@ -149,8 +149,8 @@ EmbeddingWindow::EmbeddingWindow(QWindow *window) : m_window(window)
void EmbeddingWindow::releaseForeignWindow()
{
if (m_window) {
- m_window->setParent(Q_NULLPTR);
- m_window = Q_NULLPTR;
+ m_window->setParent(nullptr);
+ m_window = nullptr;
m_releaseAction->setEnabled(false);
}
}
diff --git a/tests/manual/highdpi/dragwidget.h b/tests/manual/highdpi/dragwidget.h
index 2cb821d509..8b67b20410 100644
--- a/tests/manual/highdpi/dragwidget.h
+++ b/tests/manual/highdpi/dragwidget.h
@@ -43,15 +43,15 @@ public:
DragWidget(QString text = QString(), QWidget *parent = 0);
protected:
- void dragEnterEvent(QDragEnterEvent *event) Q_DECL_OVERRIDE;
- void dragLeaveEvent(QDragLeaveEvent *event) Q_DECL_OVERRIDE;
- void dropEvent(QDropEvent *event) Q_DECL_OVERRIDE;
- void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
- void dragMoveEvent(QDragMoveEvent * event) Q_DECL_OVERRIDE;
- void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
- void timerEvent(QTimerEvent *event) Q_DECL_OVERRIDE;
- void showEvent(QShowEvent *event) Q_DECL_OVERRIDE;
- void hideEvent(QHideEvent *event) Q_DECL_OVERRIDE;
+ void dragEnterEvent(QDragEnterEvent *event) override;
+ void dragLeaveEvent(QDragLeaveEvent *event) override;
+ void dropEvent(QDropEvent *event) override;
+ void mousePressEvent(QMouseEvent *event) override;
+ void dragMoveEvent(QDragMoveEvent * event) override;
+ void paintEvent(QPaintEvent *) override;
+ void timerEvent(QTimerEvent *event) override;
+ void showEvent(QShowEvent *event) override;
+ void hideEvent(QHideEvent *event) override;
private:
QPoint dragPos;
QPoint dropPos;
diff --git a/tests/manual/qlayout/gridwidget.cpp b/tests/manual/qlayout/gridwidget.cpp
index ede13a22c3..f19b3eac6f 100644
--- a/tests/manual/qlayout/gridwidget.cpp
+++ b/tests/manual/qlayout/gridwidget.cpp
@@ -62,8 +62,8 @@ GridWidget::GridWidget(QWidget *parent) :
qDebug("There should be four warnings, but no crash or freeze:");
hb->addWidget(this, 6, 6); ///< This command should print a warning, but should not add "this"
- hb->addWidget(Q_NULLPTR, 6, 7); ///< This command should print a warning, but should not add "NULL"
+ hb->addWidget(nullptr, 6, 7); ///< This command should print a warning, but should not add "NULL"
hb->addLayout(hb, 7, 6); ///< This command should print a warning, but should not add "hb"
- hb->addLayout(Q_NULLPTR, 7, 7); ///< This command should print a warning, but should not add "NULL"
+ hb->addLayout(nullptr, 7, 7); ///< This command should print a warning, but should not add "NULL"
qDebug("Neither crashed nor frozen");
}
diff --git a/tests/manual/qlayout/hbwidget.cpp b/tests/manual/qlayout/hbwidget.cpp
index d1f6c94d5b..80219d01fd 100644
--- a/tests/manual/qlayout/hbwidget.cpp
+++ b/tests/manual/qlayout/hbwidget.cpp
@@ -58,8 +58,8 @@ HbWidget::HbWidget(QWidget *parent) :
qDebug("There should be four warnings, but no crash or freeze:");
hb->addWidget(this); ///< This command should print a warning, but should not add "this"
- hb->addWidget(Q_NULLPTR); ///< This command should print a warning, but should not add "NULL"
+ hb->addWidget(nullptr); ///< This command should print a warning, but should not add "NULL"
hb->addLayout(hb); ///< This command should print a warning, but should not add "hb"
- hb->addLayout(Q_NULLPTR); ///< This command should print a warning, but should not add "NULL"
+ hb->addLayout(nullptr); ///< This command should print a warning, but should not add "NULL"
qDebug("Neither crashed nor frozen");
}
diff --git a/tests/manual/qlayout/vbwidget.cpp b/tests/manual/qlayout/vbwidget.cpp
index d3898422fb..97f240f9a0 100644
--- a/tests/manual/qlayout/vbwidget.cpp
+++ b/tests/manual/qlayout/vbwidget.cpp
@@ -58,8 +58,8 @@ VbWidget::VbWidget(QWidget *parent) :
qDebug("There should be four warnings, but no crash or freeze:");
hb->addWidget(this); ///< This command should print a warning, but should not add "this"
- hb->addWidget(Q_NULLPTR); ///< This command should print a warning, but should not add "NULL"
+ hb->addWidget(nullptr); ///< This command should print a warning, but should not add "NULL"
hb->addLayout(hb); ///< This command should print a warning, but should not add "hb"
- hb->addLayout(Q_NULLPTR); ///< This command should print a warning, but should not add "NULL"
+ hb->addLayout(nullptr); ///< This command should print a warning, but should not add "NULL"
qDebug("Neither crashed nor frozen");
}
diff --git a/tests/manual/qscreen/main.cpp b/tests/manual/qscreen/main.cpp
index 445af82e09..6fba872b12 100644
--- a/tests/manual/qscreen/main.cpp
+++ b/tests/manual/qscreen/main.cpp
@@ -73,12 +73,12 @@ public:
}
protected:
- void mouseMoveEvent(QMouseEvent *ev) Q_DECL_OVERRIDE {
+ void mouseMoveEvent(QMouseEvent *ev) override {
m_cursorPos = ev->screenPos().toPoint();
updateText();
}
- void mousePressEvent(QMouseEvent *ev) Q_DECL_OVERRIDE {
+ void mousePressEvent(QMouseEvent *ev) override {
m_cursorPos = ev->screenPos().toPoint();
qDebug() << "top level @" << m_cursorPos << ":" << QGuiApplication::topLevelAt(m_cursorPos);
updateText();
@@ -100,7 +100,7 @@ class ScreenPropertyWatcher : public PropertyWatcher
{
Q_OBJECT
public:
- ScreenPropertyWatcher(QWidget *wp = Q_NULLPTR) : PropertyWatcher(Q_NULLPTR, QString(), wp)
+ ScreenPropertyWatcher(QWidget *wp = nullptr) : PropertyWatcher(nullptr, QString(), wp)
{
// workaround for the fact that virtualSiblings is not a property,
// thus there is no change notification:
@@ -150,7 +150,7 @@ public:
QScreen *screenSubject() const { return m_watcher->screenSubject(); }
protected:
- bool event(QEvent *event) Q_DECL_OVERRIDE;
+ bool event(QEvent *event) override;
void startMouseMonitor();
private:
diff --git a/tests/manual/qscreen/propertywatcher.cpp b/tests/manual/qscreen/propertywatcher.cpp
index 0fb322a480..d2a552f108 100644
--- a/tests/manual/qscreen/propertywatcher.cpp
+++ b/tests/manual/qscreen/propertywatcher.cpp
@@ -34,7 +34,7 @@
#include "propertyfield.h"
PropertyWatcher::PropertyWatcher(QObject *subject, QString annotation, QWidget *parent)
- : QWidget(parent), m_subject(Q_NULLPTR), m_formLayout(new QFormLayout(this))
+ : QWidget(parent), m_subject(nullptr), m_formLayout(new QFormLayout(this))
{
setMinimumSize(450, 300);
m_formLayout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
diff --git a/tests/manual/qscreen/propertywatcher.h b/tests/manual/qscreen/propertywatcher.h
index f371a3b9b6..d988d96c91 100644
--- a/tests/manual/qscreen/propertywatcher.h
+++ b/tests/manual/qscreen/propertywatcher.h
@@ -39,7 +39,7 @@ class PropertyWatcher : public QWidget
Q_OBJECT
public:
- explicit PropertyWatcher(QObject* subject = Q_NULLPTR, QString annotation = QString(), QWidget *parent = Q_NULLPTR);
+ explicit PropertyWatcher(QObject* subject = nullptr, QString annotation = QString(), QWidget *parent = nullptr);
QFormLayout *formLayout() { return m_formLayout; }
diff --git a/tests/manual/qsysinfo/main.cpp b/tests/manual/qsysinfo/main.cpp
index 5b391e5dfd..62d0c51416 100644
--- a/tests/manual/qsysinfo/main.cpp
+++ b/tests/manual/qsysinfo/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 Intel Corporation.
+** Copyright (C) 2017 Intel Corporation.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
@@ -133,6 +133,8 @@ int main(int argc, char *argv[])
printf("QSysInfo::productVersion() = %s\n", qPrintable(QSysInfo::productVersion()));
printf("QSysInfo::prettyProductName() = %s\n", qPrintable(QSysInfo::prettyProductName()));
printf("QSysInfo::machineHostName() = %s\n", qPrintable(QSysInfo::machineHostName()));
+ printf("QSysInfo::machineUniqueId() = %s\n", QSysInfo::machineUniqueId().constData());
+ printf("QSysInfo::bootUniqueId() = %s\n", qPrintable(QSysInfo::bootUniqueId()));
const auto osv = QOperatingSystemVersion::current();
printf("QOperatingSystemVersion::current() = %s %d.%d.%d\n",
diff --git a/tests/manual/qtabletevent/regular_widgets/main.cpp b/tests/manual/qtabletevent/regular_widgets/main.cpp
index 339d1d3633..caf8c70c6f 100644
--- a/tests/manual/qtabletevent/regular_widgets/main.cpp
+++ b/tests/manual/qtabletevent/regular_widgets/main.cpp
@@ -82,7 +82,7 @@ class EventReportWidget : public QWidget
{
Q_OBJECT
public:
- EventReportWidget() { startTimer(1000); }
+ EventReportWidget();
public slots:
void clearPoints() { m_points.clear(); update(); }
@@ -98,6 +98,8 @@ protected:
void tabletEvent(QTabletEvent *) override;
+ bool event(QEvent *event) override;
+
void paintEvent(QPaintEvent *) override;
void timerEvent(QTimerEvent *) override;
@@ -108,10 +110,17 @@ private:
bool m_lastIsTabletMove = false;
Qt::MouseButton m_lastButton = Qt::NoButton;
QVector<TabletPoint> m_points;
+ QVector<QPointF> m_touchPoints;
int m_tabletMoveCount = 0;
int m_paintEventCount = 0;
};
+EventReportWidget::EventReportWidget()
+{
+ setAttribute(Qt::WA_AcceptTouchEvents);
+ startTimer(1000);
+}
+
void EventReportWidget::paintEvent(QPaintEvent *)
{
QPainter p(this);
@@ -160,6 +169,11 @@ void EventReportWidget::paintEvent(QPaintEvent *)
}
}
}
+ p.setPen(Qt::blue);
+ for (QPointF t : m_touchPoints) {
+ p.drawLine(t.x() - 40, t.y(), t.x() + 40, t.y());
+ p.drawLine(t.x(), t.y() - 40, t.x(), t.y() + 40);
+ }
++m_paintEventCount;
}
@@ -198,6 +212,27 @@ void EventReportWidget::tabletEvent(QTabletEvent *event)
m_lastIsTabletMove = isMove;
}
+bool EventReportWidget::event(QEvent *event)
+{
+ switch (event->type()) {
+ case QEvent::TouchBegin:
+ case QEvent::TouchUpdate:
+ event->accept();
+ m_touchPoints.clear();
+ for (const QTouchEvent::TouchPoint &p : static_cast<const QTouchEvent *>(event)->touchPoints())
+ m_touchPoints.append(p.pos());
+ update();
+ break;
+ case QEvent::TouchEnd:
+ m_touchPoints.clear();
+ update();
+ break;
+ default:
+ return QWidget::event(event);
+ }
+ return true;
+}
+
void EventReportWidget::outputMouseEvent(QMouseEvent *event)
{
if (event->type() == QEvent::MouseMove) {
diff --git a/tests/manual/touch/main.cpp b/tests/manual/touch/main.cpp
index 1d00ea5db5..d3c6079c7d 100644
--- a/tests/manual/touch/main.cpp
+++ b/tests/manual/touch/main.cpp
@@ -118,7 +118,7 @@ public:
explicit PanGesture(const QWidget *w, const QPanGesture *source) : Gesture(w, source)
, m_offset(source->offset()) {}
- void draw(const QRectF &rect, QPainter &painter) const Q_DECL_OVERRIDE
+ void draw(const QRectF &rect, QPainter &painter) const override
{
const QPointF hotSpot = drawHotSpot(rect, painter);
painter.drawLine(hotSpot, hotSpot + m_offset);
@@ -134,7 +134,7 @@ public:
, m_horizontal(source->horizontalDirection()), m_vertical(source->verticalDirection())
, m_angle(source->swipeAngle()) {}
- void draw(const QRectF &rect, QPainter &painter) const Q_DECL_OVERRIDE;
+ void draw(const QRectF &rect, QPainter &painter) const override;
private:
QSwipeGesture::SwipeDirection m_horizontal;
@@ -169,7 +169,7 @@ void SwipeGesture::draw(const QRectF &rect, QPainter &painter) const
Gesture *Gesture::fromQGesture(const QWidget *w, const QGesture *source)
{
- Gesture *result = Q_NULLPTR;
+ Gesture *result = nullptr;
switch (source->gestureType()) {
case Qt::TapGesture:
case Qt::TapAndHoldGesture:
@@ -197,7 +197,7 @@ class EventFilter : public QObject {
public:
explicit EventFilter(const EventTypeVector &types, QObject *p) : QObject(p), m_types(types) {}
- bool eventFilter(QObject *, QEvent *) Q_DECL_OVERRIDE;
+ bool eventFilter(QObject *, QEvent *) override;
signals:
void eventReceived(const QString &);
@@ -292,8 +292,8 @@ signals:
void logMessage(const QString &);
protected:
- bool event(QEvent *event) Q_DECL_OVERRIDE;
- void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
+ bool event(QEvent *event) override;
+ void paintEvent(QPaintEvent *) override;
private:
void handleGestureEvent(QGestureEvent *gestureEvent);
diff --git a/tests/manual/widgets/qgraphicsview/rubberband/rubberbandtest.cpp b/tests/manual/widgets/qgraphicsview/rubberband/rubberbandtest.cpp
index e8844f87fd..f2c5494ebc 100644
--- a/tests/manual/widgets/qgraphicsview/rubberband/rubberbandtest.cpp
+++ b/tests/manual/widgets/qgraphicsview/rubberband/rubberbandtest.cpp
@@ -36,7 +36,7 @@ public:
setFlags(QGraphicsItem::ItemIsSelectable);
}
- void paint(QPainter *painter, const QStyleOptionGraphicsItem * /* option*/, QWidget * /*widget*/) Q_DECL_OVERRIDE
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem * /* option*/, QWidget * /*widget*/) override
{
if (isSelected())
painter->fillRect(rect(), QColor(255, 0, 0));
@@ -55,7 +55,7 @@ public:
connect(this, SIGNAL(rubberBandChanged(QRect, QPointF, QPointF)), this, SLOT(updateRubberbandInfo(QRect, QPointF, QPointF)));
}
protected:
- void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE
+ void mouseMoveEvent(QMouseEvent *event) override
{
QGraphicsView::mouseMoveEvent(event);
diff --git a/tests/manual/widgets/styles/main.cpp b/tests/manual/widgets/styles/main.cpp
index 7c840dc9ae..7df54baef5 100644
--- a/tests/manual/widgets/styles/main.cpp
+++ b/tests/manual/widgets/styles/main.cpp
@@ -87,7 +87,7 @@ static QWidget *createStandardPixmapPage(QWidget *parent)
const int maxColumns = 6;
for (int i = 0; i <= int(QStyle::SP_LineEditClearButton); ++i) {
const QStyle::StandardPixmap sp = static_cast<QStyle::StandardPixmap>(i);
- QPixmap pixmap = result->style()->standardPixmap(sp, Q_NULLPTR, result);
+ QPixmap pixmap = result->style()->standardPixmap(sp, nullptr, result);
QLabel *descriptionLabel = new QLabel(pixmapDescription(sp, pixmap));
grid->addWidget(descriptionLabel, row, column++);
QLabel *displayLabel = new QLabel;
@@ -111,7 +111,7 @@ static QWidget *createMetricsPage(QWidget *parent)
for (int i = 0; i <= int(QStyle::PM_HeaderDefaultSectionSizeVertical); ++i) {
const QStyle::PixelMetric m = static_cast<QStyle::PixelMetric>(i);
str << formatEnumValue(m) << '(' << int(m) << ")="
- << result->style()->pixelMetric(m, Q_NULLPTR, result) << '\n';
+ << result->style()->pixelMetric(m, nullptr, result) << '\n';
}
result->setPlainText(text);
return result;
@@ -126,7 +126,7 @@ static QWidget *createHintsPage(QWidget *parent)
for (int i = 0; i <= int(QStyle::SH_Menu_SubMenuDontStartSloppyOnLeave); ++i) {
const QStyle::StyleHint h = static_cast<QStyle::StyleHint>(i);
str << formatEnumValue(h) << '(' << int(h) << ")="
- << result->style()->styleHint(h, Q_NULLPTR, result) << '\n';
+ << result->style()->styleHint(h, nullptr, result) << '\n';
}
result->setPlainText(text);
return result;
diff --git a/util/edid/qedidvendortable.py b/util/edid/qedidvendortable.py
index 6d30f3a60d..500abf0890 100755
--- a/util/edid/qedidvendortable.py
+++ b/util/edid/qedidvendortable.py
@@ -82,6 +82,15 @@ header = """
#ifndef QEDIDVENDORTABLE_P_H
#define QEDIDVENDORTABLE_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+
QT_BEGIN_NAMESPACE
typedef struct VendorTable {
diff --git a/util/glgen/codegenerator.cpp b/util/glgen/codegenerator.cpp
index 70cd3a7931..4627daa48b 100644
--- a/util/glgen/codegenerator.cpp
+++ b/util/glgen/codegenerator.cpp
@@ -530,7 +530,7 @@ void CodeGenerator::writePublicClassDeclaration(const QString &baseFileName,
stream << QStringLiteral("public:") << endl;
stream << QString(QStringLiteral(" %1();")).arg(className) << endl;
stream << QString(QStringLiteral(" ~%1();")).arg(className) << endl << endl;
- stream << QStringLiteral(" bool initializeOpenGLFunctions() Q_DECL_OVERRIDE;") << endl << endl;
+ stream << QStringLiteral(" bool initializeOpenGLFunctions() override;") << endl << endl;
// Get the functions needed for this class and declare them
FunctionCollection functionSet = functionCollection(versionProfile);
@@ -989,7 +989,7 @@ void CodeGenerator::writeExtensionClassDeclaration(QTextStream &stream, const QS
stream << QStringLiteral(" ") << className << QStringLiteral("();") << endl << endl;
// Base class virtual function(s)
- QString resolveFunction = QStringLiteral(" bool initializeOpenGLFunctions() Q_DECL_FINAL;");
+ QString resolveFunction = QStringLiteral(" bool initializeOpenGLFunctions() final;");
stream << resolveFunction << endl << endl;
}