summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/3rdparty/angle/include/KHR/khrplatform.h7
-rw-r--r--src/3rdparty/angle/src/libEGL/libEGL_mingw32.def36
-rw-r--r--src/3rdparty/angle/src/libEGL/libEGLd_mingw32.def36
-rw-r--r--src/3rdparty/angle/src/libGLESv2/libGLESv2_mingw32.def182
-rw-r--r--src/3rdparty/angle/src/libGLESv2/libGLESv2d_mingw32.def182
-rw-r--r--src/3rdparty/harfbuzz/src/harfbuzz-arabic.c2
-rw-r--r--src/3rdparty/harfbuzz/src/harfbuzz-external.h2
-rw-r--r--src/3rdparty/harfbuzz/src/harfbuzz-global.h2
-rw-r--r--src/3rdparty/harfbuzz/src/harfbuzz-greek.c2
-rw-r--r--src/3rdparty/harfbuzz/src/harfbuzz-hangul.c2
-rw-r--r--src/3rdparty/harfbuzz/src/harfbuzz-hebrew.c2
-rw-r--r--src/3rdparty/harfbuzz/src/harfbuzz-impl.c2
-rw-r--r--src/3rdparty/harfbuzz/src/harfbuzz-indic.cpp2
-rw-r--r--src/3rdparty/harfbuzz/src/harfbuzz-khmer.c2
-rw-r--r--src/3rdparty/harfbuzz/src/harfbuzz-myanmar.c2
-rw-r--r--src/3rdparty/harfbuzz/src/harfbuzz-shaper-all.cpp2
-rw-r--r--src/3rdparty/harfbuzz/src/harfbuzz-shaper-private.h2
-rw-r--r--src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp2
-rw-r--r--src/3rdparty/harfbuzz/src/harfbuzz-shaper.h2
-rw-r--r--src/3rdparty/harfbuzz/src/harfbuzz-stream.c2
-rw-r--r--src/3rdparty/harfbuzz/src/harfbuzz-stream.h2
-rw-r--r--src/3rdparty/harfbuzz/src/harfbuzz-thai.c2
-rw-r--r--src/3rdparty/harfbuzz/src/harfbuzz-tibetan.c2
-rw-r--r--src/3rdparty/harfbuzz/tests/shaping/harfbuzz-qt.cpp2
-rw-r--r--src/3rdparty/harfbuzz/tests/shaping/main.cpp2
-rw-r--r--src/3rdparty/iaccessible2/iaccessible2.pri8
-rw-r--r--src/angle/README.qt5
-rw-r--r--src/angle/patches/0007-ANGLE-Fix-typedefs-for-Win64.patch38
-rw-r--r--src/angle/src/libEGL/libEGL.pro5
-rw-r--r--src/angle/src/libGLESv2/libGLESv2.pro6
-rw-r--r--src/concurrent/doc/qtconcurrent.qdocconf10
-rw-r--r--src/concurrent/qtconcurrentfunctionwrappers.h1
-rw-r--r--src/corelib/Qt5CTestMacros.cmake5
-rw-r--r--src/corelib/Qt5CoreConfigExtras.cmake.in6
-rw-r--r--src/corelib/corelib.pro28
-rw-r--r--src/corelib/doc/qtcore.qdocconf16
-rw-r--r--src/corelib/doc/snippets/code/doc_src_plugins-howto.cpp17
-rw-r--r--src/corelib/doc/snippets/code/doc_src_plugins-howto.pro11
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_io_qsettings.cpp2
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_kernel_qobject.cpp2
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_tools_qbytearray.cpp2
-rw-r--r--src/corelib/doc/snippets/hellotrmain.cpp57
-rw-r--r--src/corelib/doc/src/custom-types.qdoc165
-rw-r--r--src/corelib/doc/src/implicit-sharing.qdoc2
-rw-r--r--src/corelib/doc/src/json.qdoc2
-rw-r--r--src/corelib/doc/src/objectmodel/object.qdoc3
-rw-r--r--src/corelib/doc/src/objectmodel/properties.qdoc4
-rw-r--r--src/corelib/doc/src/plugins-howto.qdoc25
-rw-r--r--src/corelib/doc/src/statemachine.qdoc2
-rw-r--r--src/corelib/doc/src/threads-basics.qdoc18
-rw-r--r--src/corelib/doc/src/threads.qdoc8
-rw-r--r--src/corelib/doc/src/timers.qdoc123
-rw-r--r--src/corelib/global/qconfig-minimal.h3
-rw-r--r--src/corelib/global/qconfig-nacl.h3
-rw-r--r--src/corelib/global/qconfig-small.h5
-rw-r--r--src/corelib/global/qfeatures.h6
-rw-r--r--src/corelib/global/qfeatures.txt9
-rw-r--r--src/corelib/global/qflags.h3
-rw-r--r--src/corelib/global/qglobal.cpp20
-rw-r--r--src/corelib/global/qglobal.h15
-rw-r--r--src/corelib/global/qlogging.cpp2
-rw-r--r--src/corelib/global/qnamespace.qdoc6
-rw-r--r--src/corelib/global/qsysinfo.h4
-rw-r--r--src/corelib/global/qtypeinfo.h4
-rw-r--r--src/corelib/global/qtypetraits.h3
-rw-r--r--src/corelib/io/qabstractfileengine.cpp2
-rw-r--r--src/corelib/io/qprocess_win.cpp3
-rw-r--r--src/corelib/io/qstandardpaths.h2
-rw-r--r--src/corelib/io/qstandardpaths_unix.cpp1
-rw-r--r--src/corelib/io/qurl.cpp251
-rw-r--r--src/corelib/itemmodels/qabstractitemmodel.cpp2
-rw-r--r--src/corelib/itemmodels/qabstractproxymodel.cpp4
-rw-r--r--src/corelib/itemmodels/qsortfilterproxymodel.cpp4
-rw-r--r--src/corelib/json/qjsonarray.cpp8
-rw-r--r--src/corelib/json/qjsonobject.cpp13
-rw-r--r--src/corelib/kernel/qeventdispatcher_blackberry.cpp2
-rw-r--r--src/corelib/kernel/qmetatype.h17
-rw-r--r--src/corelib/kernel/qobject.cpp16
-rw-r--r--src/corelib/kernel/qtimer.cpp6
-rw-r--r--src/corelib/kernel/qtranslator.cpp6
-rw-r--r--src/corelib/kernel/qvariant.cpp4
-rw-r--r--src/corelib/kernel/qwineventnotifier.h9
-rw-r--r--src/corelib/mimetypes/qmimedatabase.cpp14
-rw-r--r--src/corelib/plugin/qfactoryloader.cpp21
-rw-r--r--src/corelib/plugin/qlibrary.cpp2
-rw-r--r--src/corelib/plugin/qlibrary_p.h2
-rw-r--r--src/corelib/plugin/qlibrary_unix.cpp100
-rw-r--r--src/corelib/plugin/qlibrary_win.cpp11
-rw-r--r--src/corelib/plugin/qpluginloader.cpp54
-rw-r--r--src/corelib/plugin/quuid.cpp13
-rw-r--r--src/corelib/plugin/quuid.h4
-rw-r--r--src/corelib/statemachine/qstatemachine.cpp8
-rw-r--r--src/corelib/thread/qatomic.cpp88
-rw-r--r--src/corelib/thread/qatomic.h10
-rw-r--r--src/corelib/thread/qbasicatomic.h4
-rw-r--r--src/corelib/thread/qfuture.qdoc8
-rw-r--r--src/corelib/thread/qmutex.cpp4
-rw-r--r--src/corelib/thread/qmutex_linux.cpp5
-rw-r--r--src/corelib/thread/qthread_unix.cpp7
-rw-r--r--src/corelib/thread/qwaitcondition.qdoc2
-rw-r--r--src/corelib/tools/qbytearray.cpp46
-rw-r--r--src/corelib/tools/qbytearray.h4
-rw-r--r--src/corelib/tools/qelapsedtimer_unix.cpp2
-rw-r--r--src/corelib/tools/qharfbuzz_p.h3
-rw-r--r--src/corelib/tools/qhash.cpp12
-rw-r--r--src/corelib/tools/qlinkedlist.cpp12
-rw-r--r--src/corelib/tools/qlist.cpp12
-rw-r--r--src/corelib/tools/qlist.h2
-rw-r--r--src/corelib/tools/qlocale.cpp25
-rw-r--r--src/corelib/tools/qlocale.h1
-rw-r--r--src/corelib/tools/qlocale.qdoc7
-rw-r--r--src/corelib/tools/qmap.cpp12
-rw-r--r--src/corelib/tools/qregexp.cpp4
-rw-r--r--src/corelib/tools/qset.qdoc16
-rw-r--r--src/corelib/tools/qstring.cpp12
-rw-r--r--src/corelib/tools/qunicodetools.cpp3
-rw-r--r--src/corelib/tools/qvarlengtharray.qdoc12
-rw-r--r--src/corelib/tools/qvector.cpp12
-rw-r--r--src/corelib/tools/tools.pri3
-rw-r--r--src/dbus/doc/images/qurl-ftppath.pngbin0 -> 1974 bytes
-rw-r--r--src/dbus/doc/qtdbus.qdocconf12
-rw-r--r--src/dbus/qdbusxmlparser.cpp156
-rw-r--r--src/gui/accessible/qaccessible.cpp14
-rw-r--r--src/gui/accessible/qaccessible.h3
-rw-r--r--src/gui/accessible/qaccessible2.cpp13
-rw-r--r--src/gui/accessible/qaccessible2.h1
-rw-r--r--src/gui/accessible/qaccessibleobject.cpp2
-rw-r--r--src/gui/doc/qtgui.qdocconf17
-rw-r--r--src/gui/doc/src/dnd.qdoc37
-rw-r--r--src/gui/doc/src/richtext.qdoc4
-rw-r--r--src/gui/gui.pro4
-rw-r--r--src/gui/image/qimage.cpp1
-rw-r--r--src/gui/image/qimageiohandler.cpp4
-rw-r--r--src/gui/image/qimageiohandler.h4
-rw-r--r--src/gui/image/qimagereader.cpp29
-rw-r--r--src/gui/image/qimagewriter.cpp22
-rw-r--r--src/gui/kernel/qguiapplication.cpp7
-rw-r--r--src/gui/kernel/qkeysequence.cpp2
-rw-r--r--src/gui/kernel/qopenglcontext.cpp2
-rw-r--r--src/gui/kernel/qplatformcursor.h2
-rw-r--r--src/gui/kernel/qplatformdialoghelper.cpp4
-rw-r--r--src/gui/kernel/qplatformnativeinterface.cpp6
-rw-r--r--src/gui/kernel/qplatformnativeinterface.h2
-rw-r--r--src/gui/kernel/qplatformwindow.cpp35
-rw-r--r--src/gui/kernel/qplatformwindow.h1
-rw-r--r--src/gui/kernel/qshortcutmap.cpp2
-rw-r--r--src/gui/kernel/qwindow.cpp193
-rw-r--r--src/gui/kernel/qwindow.h82
-rw-r--r--src/gui/kernel/qwindow_p.h4
-rw-r--r--src/gui/math3d/qmatrix4x4.cpp18
-rw-r--r--src/gui/math3d/qmatrix4x4.h2
-rw-r--r--src/gui/math3d/qquaternion.cpp2
-rw-r--r--src/gui/opengl/opengl.pri2
-rw-r--r--src/gui/opengl/qopenglpaintdevice.cpp44
-rw-r--r--src/gui/painting/qcolor.cpp2
-rw-r--r--src/gui/painting/qdrawhelper_ssse3.cpp2
-rw-r--r--src/gui/painting/qmath_p.h1
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp2
-rw-r--r--src/gui/text/qfontdatabase.cpp27
-rw-r--r--src/gui/text/qfontdatabase_qpa.cpp5
-rw-r--r--src/gui/text/qfontengine_ft.cpp14
-rw-r--r--src/gui/text/qplatformfontdatabase.cpp10
-rw-r--r--src/gui/text/qplatformfontdatabase.h3
-rw-r--r--src/gui/text/text.pri2
-rw-r--r--src/gui/util/qdesktopservices.cpp2
-rw-r--r--src/network/access/qnetworkcookie.cpp4
-rw-r--r--src/network/access/qnetworkreplyhttpimpl_p.h2
-rw-r--r--src/network/doc/images/network-examples.pngbin0 -> 8946 bytes
-rw-r--r--src/network/doc/qtnetwork.qdocconf10
-rw-r--r--src/network/doc/snippets/code/src_network_access_qftp.cpp4
-rw-r--r--src/network/doc/src/examples.qdoc68
-rw-r--r--src/network/doc/src/ssl.qdoc4
-rw-r--r--src/network/kernel/qnetworkproxy.cpp2
-rw-r--r--src/network/socket/qabstractsocket.cpp4
-rw-r--r--src/network/socket/qlocalserver_tcp.cpp6
-rw-r--r--src/network/socket/qlocalsocket_tcp.cpp2
-rw-r--r--src/network/socket/qlocalsocket_win.cpp2
-rw-r--r--src/network/ssl/qsslcertificate.cpp2
-rw-r--r--src/network/ssl/qsslerror.h4
-rw-r--r--src/network/ssl/qsslsocket.h4
-rw-r--r--src/network/ssl/qsslsocket_openssl.cpp6
-rw-r--r--src/network/ssl/qsslsocket_openssl_symbols.cpp8
-rw-r--r--src/network/ssl/qsslsocket_openssl_symbols_p.h4
-rw-r--r--src/opengl/doc/qtopengl.qdocconf9
-rw-r--r--src/opengl/opengl.pro2
-rw-r--r--src/opengl/qgl.cpp5
-rw-r--r--src/opengl/qgl_qpa.cpp7
-rw-r--r--src/platformsupport/dnd/qsimpledrag.cpp2
-rw-r--r--src/platformsupport/eventdispatchers/qeventdispatcher_glib.cpp2
-rw-r--r--src/platformsupport/fbconvenience/qfbcursor.cpp2
-rw-r--r--src/platformsupport/fbconvenience/qfbcursor_p.h2
-rw-r--r--src/platformsupport/fontdatabases/basic/qbasicfontdatabase.cpp2
-rw-r--r--src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp14
-rw-r--r--src/platformsupport/fontdatabases/fontdatabases.pri1
-rw-r--r--src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm3
-rw-r--r--src/platformsupport/input/evdevtouch/qevdevtouch.cpp2
-rw-r--r--src/platformsupport/linuxaccessibility/application.cpp4
-rw-r--r--src/platformsupport/linuxaccessibility/application_p.h4
-rw-r--r--src/platformsupport/linuxaccessibility/atspiadaptor.cpp116
-rw-r--r--src/platformsupport/linuxaccessibility/atspiadaptor_p.h6
-rw-r--r--src/platformsupport/linuxaccessibility/bridge.cpp4
-rw-r--r--src/platformsupport/linuxaccessibility/bridge_p.h4
-rw-r--r--src/platformsupport/linuxaccessibility/cache.cpp4
-rw-r--r--src/platformsupport/linuxaccessibility/cache_p.h4
-rw-r--r--src/platformsupport/linuxaccessibility/constant_mappings.cpp6
-rw-r--r--src/platformsupport/linuxaccessibility/constant_mappings_p.h3
-rw-r--r--src/platformsupport/linuxaccessibility/dbusconnection.cpp4
-rw-r--r--src/platformsupport/linuxaccessibility/dbusconnection_p.h4
-rw-r--r--src/platformsupport/linuxaccessibility/linuxaccessibility.pri2
-rw-r--r--src/platformsupport/linuxaccessibility/struct_marshallers.cpp4
-rw-r--r--src/plugins/accessible/widgets/main.cpp4
-rw-r--r--src/plugins/accessible/widgets/qaccessiblemenu.cpp2
-rw-r--r--src/plugins/accessible/widgets/qaccessiblewidgets.cpp8
-rw-r--r--src/plugins/accessible/widgets/qaccessiblewidgets.h6
-rw-r--r--src/plugins/accessible/widgets/rangecontrols.cpp10
-rw-r--r--src/plugins/accessible/widgets/rangecontrols.h2
-rw-r--r--src/plugins/accessible/widgets/simplewidgets.cpp8
-rw-r--r--src/plugins/accessible/widgets/simplewidgets.h1
-rw-r--r--src/plugins/accessible/widgets/widgets.pro1
-rw-r--r--src/plugins/bearer/bearer.pro2
-rw-r--r--src/plugins/bearer/blackberry/blackberry.pro1
-rw-r--r--src/plugins/bearer/connman/connman.pro1
-rw-r--r--src/plugins/bearer/connman/qconnmanservice_linux.cpp48
-rw-r--r--src/plugins/bearer/connman/qconnmanservice_linux_p.h13
-rw-r--r--src/plugins/bearer/corewlan/corewlan.pro1
-rw-r--r--src/plugins/bearer/generic/generic.pro1
-rw-r--r--src/plugins/bearer/nativewifi/nativewifi.pro1
-rw-r--r--src/plugins/bearer/networkmanager/networkmanager.pro1
-rw-r--r--src/plugins/bearer/nla/nla.pro1
-rw-r--r--src/plugins/generic/evdevkeyboard/evdevkeyboard.pro1
-rw-r--r--src/plugins/generic/evdevmouse/evdevmouse.pro1
-rw-r--r--src/plugins/generic/evdevtablet/evdevtablet.pro1
-rw-r--r--src/plugins/generic/evdevtouch/evdevtouch.pro1
-rw-r--r--src/plugins/generic/meego/meego.pro1
-rw-r--r--src/plugins/generic/tslib/tslib.pro1
-rw-r--r--src/plugins/imageformats/gif/gif.pro1
-rw-r--r--src/plugins/imageformats/gif/main.h4
-rw-r--r--src/plugins/imageformats/ico/ico.pro1
-rw-r--r--src/plugins/imageformats/jpeg/jpeg.pro1
-rw-r--r--src/plugins/platforminputcontexts/ibus/ibus.pro1
-rw-r--r--src/plugins/platforminputcontexts/maliit/maliit.pro1
-rw-r--r--src/plugins/platforminputcontexts/platforminputcontexts.pro2
-rw-r--r--src/plugins/platforms/cocoa/cocoa.pro12
-rw-r--r--src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm8
-rw-r--r--src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm18
-rw-r--r--src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm6
-rw-r--r--src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm16
-rw-r--r--src/plugins/platforms/cocoa/qcocoahelpers.mm41
-rw-r--r--src/plugins/platforms/cocoa/qcocoaintegration.h4
-rw-r--r--src/plugins/platforms/cocoa/qcocoaintegration.mm6
-rw-r--r--src/plugins/platforms/cocoa/qcocoakeymapper.h111
-rw-r--r--src/plugins/platforms/cocoa/qcocoakeymapper.mm468
-rw-r--r--src/plugins/platforms/cocoa/qcocoanativeinterface.mm6
-rw-r--r--src/plugins/platforms/cocoa/qcocoasystemsettings.mm32
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.mm13
-rw-r--r--src/plugins/platforms/cocoa/qnsview.h1
-rw-r--r--src/plugins/platforms/cocoa/qnsview.mm35
-rw-r--r--src/plugins/platforms/cocoa/qnsviewaccessibility.mm2
-rw-r--r--src/plugins/platforms/directfb/directfb.pro1
-rw-r--r--src/plugins/platforms/directfb/qdirectfbblitter.cpp2
-rw-r--r--src/plugins/platforms/directfb/qdirectfbcursor.cpp4
-rw-r--r--src/plugins/platforms/directfb/qdirectfbcursor.h4
-rw-r--r--src/plugins/platforms/eglfs/eglfs.pro1
-rw-r--r--src/plugins/platforms/eglfs/qeglfscursor.cpp4
-rw-r--r--src/plugins/platforms/eglfs/qeglfscursor.h4
-rw-r--r--src/plugins/platforms/eglfs/qeglfshooks_stub.cpp1
-rw-r--r--src/plugins/platforms/eglfs/qeglfswindow.cpp2
-rw-r--r--src/plugins/platforms/kms/kms.pro1
-rw-r--r--src/plugins/platforms/linuxfb/linuxfb.pro1
-rw-r--r--src/plugins/platforms/minimal/minimal.pro1
-rw-r--r--src/plugins/platforms/minimalegl/minimalegl.pro1
-rw-r--r--src/plugins/platforms/openwfd/openwf.pro1
-rw-r--r--src/plugins/platforms/qnx/qnx.pro3
-rw-r--r--src/plugins/platforms/qnx/qqnxfiledialoghelper.cpp15
-rw-r--r--src/plugins/platforms/qnx/qqnxfiledialoghelper.h6
-rw-r--r--src/plugins/platforms/qnx/qqnxintegration.cpp2
-rw-r--r--src/plugins/platforms/qnx/qqnxintegration.h2
-rw-r--r--src/plugins/platforms/qnx/qqnxscreen.cpp2
-rw-r--r--src/plugins/platforms/qnx/qqnxtheme.cpp14
-rw-r--r--src/plugins/platforms/qnx/qqnxtheme.h9
-rw-r--r--src/plugins/platforms/qnx/qqnxvirtualkeyboardbps.cpp5
-rw-r--r--src/plugins/platforms/qnx/qqnxwindow.cpp6
-rw-r--r--src/plugins/platforms/windows/accessible/comutils.cpp20
-rw-r--r--src/plugins/platforms/windows/accessible/comutils.h3
-rw-r--r--src/plugins/platforms/windows/accessible/iaccessible2.cpp6
-rw-r--r--src/plugins/platforms/windows/accessible/qwindowsaccessibility.cpp30
-rw-r--r--src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.cpp2
-rw-r--r--src/plugins/platforms/windows/qwindowsfontdatabase.cpp167
-rw-r--r--src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp8
-rw-r--r--src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp5
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.cpp22
-rw-r--r--src/plugins/platforms/windows/windows.pro5
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection.cpp71
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection.h10
-rw-r--r--src/plugins/platforms/xcb/qxcbcursor.cpp2
-rw-r--r--src/plugins/platforms/xcb/qxcbcursor.h6
-rw-r--r--src/plugins/platforms/xcb/qxcbnativeinterface.cpp46
-rw-r--r--src/plugins/platforms/xcb/qxcbnativeinterface.h11
-rw-r--r--src/plugins/platforms/xcb/qxcbscreen.cpp52
-rw-r--r--src/plugins/platforms/xcb/qxcbscreen.h2
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.cpp103
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.h5
-rw-r--r--src/plugins/platforms/xcb/xcb-plugin.pro5
-rw-r--r--src/plugins/platforms/xcb/xcb-static/xcb-static.pro2
-rw-r--r--src/plugins/plugins.pro6
-rw-r--r--src/plugins/printsupport/cocoa/cocoa.pro1
-rw-r--r--src/plugins/printsupport/cups/cups.pro1
-rw-r--r--src/plugins/printsupport/windows/windows.pro1
-rw-r--r--src/plugins/sqldrivers/db2/db2.pro1
-rw-r--r--src/plugins/sqldrivers/ibase/ibase.pro1
-rw-r--r--src/plugins/sqldrivers/mysql/mysql.pro1
-rw-r--r--src/plugins/sqldrivers/oci/oci.pro1
-rw-r--r--src/plugins/sqldrivers/odbc/odbc.pro1
-rw-r--r--src/plugins/sqldrivers/psql/psql.pro1
-rw-r--r--src/plugins/sqldrivers/sqlite/sqlite.pro1
-rw-r--r--src/plugins/sqldrivers/sqlite2/sqlite2.pro1
-rw-r--r--src/plugins/sqldrivers/tds/tds.pro1
-rw-r--r--src/printsupport/doc/qtprintsupport.qdocconf10
-rw-r--r--src/sql/doc/qtsql.qdocconf12
-rw-r--r--src/sql/doc/src/sql-driver.qdoc2
-rw-r--r--src/sql/doc/src/sql-programming.qdoc6
-rw-r--r--src/sql/drivers/mysql/qsql_mysql.cpp1
-rw-r--r--src/sql/drivers/odbc/qsql_odbc.cpp27
-rw-r--r--src/sql/drivers/psql/qsql_psql.cpp38
-rw-r--r--src/sql/drivers/sqlite/qsql_sqlite.cpp1
-rw-r--r--src/sql/kernel/qsql.qdoc3
-rw-r--r--src/sql/kernel/qsqldriver.cpp1
-rw-r--r--src/sql/kernel/qsqlresult.cpp2
-rw-r--r--src/sql/models/qsqlrelationaldelegate.cpp6
-rw-r--r--src/sql/models/qsqlrelationaltablemodel.cpp1
-rw-r--r--src/testlib/3rdparty/valgrind_p.h1
-rw-r--r--src/testlib/doc/qttestlib.qdocconf38
-rw-r--r--src/testlib/doc/snippets/code/doc_src_qsignalspy.cpp4
-rw-r--r--src/testlib/qsignalspy.qdoc3
-rw-r--r--src/testlib/qtestaccessible.h4
-rw-r--r--src/testlib/qtestcase.cpp5
-rw-r--r--src/testlib/testlib.pro1
-rw-r--r--src/tools/bootstrap/bootstrap.pro20
-rw-r--r--src/tools/moc/moc.cpp6
-rw-r--r--src/tools/qdbuscpp2xml/qdbuscpp2xml.pro1
-rw-r--r--src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp2
-rw-r--r--src/tools/qdbusxml2cpp/qdbusxml2cpp.pro1
-rw-r--r--src/tools/qdoc/codemarker.cpp34
-rw-r--r--src/tools/qdoc/codemarker.h6
-rw-r--r--src/tools/qdoc/cppcodemarker.cpp86
-rw-r--r--src/tools/qdoc/generator.cpp6
-rw-r--r--src/tools/qdoc/htmlgenerator.cpp4
-rw-r--r--src/tools/qdoc/node.h5
-rw-r--r--src/tools/qdoc/qdoc.pro3
-rw-r--r--src/tools/qdoc/qdocdatabase.cpp35
-rw-r--r--src/tools/qdoc/qdocdatabase.h30
-rw-r--r--src/tools/qdoc/qdocindexfiles.cpp6
-rw-r--r--src/tools/qdoc/tree.cpp48
-rw-r--r--src/tools/rcc/rcc.cpp4
-rw-r--r--src/tools/tools.pro14
-rw-r--r--src/tools/uic/uic.cpp3
-rw-r--r--src/widgets/accessible/qaccessiblewidget.cpp2
-rw-r--r--src/widgets/dialogs/qdialog.cpp2
-rw-r--r--src/widgets/dialogs/qfiledialog.cpp4
-rw-r--r--src/widgets/dialogs/qmessagebox.cpp30
-rw-r--r--src/widgets/dialogs/qwizard.cpp2
-rw-r--r--src/widgets/doc/images/dialog-examples.pngbin0 -> 7049 bytes
-rw-r--r--src/widgets/doc/images/graphicsview-examples.pngbin0 -> 223121 bytes
-rw-r--r--src/widgets/doc/images/itemviews-examples.pngbin0 -> 32534 bytes
-rw-r--r--src/widgets/doc/images/mainwindow-examples.pngbin0 -> 10271 bytes
-rw-r--r--src/widgets/doc/qtwidgets.qdocconf12
-rw-r--r--src/widgets/doc/snippets/code/src_gui_kernel_qapplication.cpp30
-rw-r--r--src/widgets/doc/src/model-view-programming.qdoc3
-rw-r--r--src/widgets/doc/src/qtwidgets-examples.qdoc70
-rw-r--r--src/widgets/doc/src/widgets-and-layouts/styles.qdoc4
-rw-r--r--src/widgets/doc/src/widgets-and-layouts/stylesheet.qdoc32
-rw-r--r--src/widgets/graphicsview/qgraphicsitem.cpp31
-rw-r--r--src/widgets/graphicsview/qgraphicsview.cpp106
-rw-r--r--src/widgets/graphicsview/qgraphicsview_p.h1
-rw-r--r--src/widgets/itemviews/qabstractitemview.cpp2
-rw-r--r--src/widgets/itemviews/qlistview.cpp4
-rw-r--r--src/widgets/itemviews/qlistwidget.cpp4
-rw-r--r--src/widgets/itemviews/qtableview.cpp4
-rw-r--r--src/widgets/itemviews/qtablewidget.cpp4
-rw-r--r--src/widgets/itemviews/qtreeview.cpp16
-rw-r--r--src/widgets/itemviews/qtreewidget.cpp4
-rw-r--r--src/widgets/kernel/qapplication.cpp13
-rw-r--r--src/widgets/kernel/qapplication.h3
-rw-r--r--src/widgets/kernel/qapplication_qpa.cpp3
-rw-r--r--src/widgets/kernel/qformlayout.cpp4
-rw-r--r--src/widgets/kernel/qwidget.cpp44
-rw-r--r--src/widgets/kernel/qwidgetsfunctions_wince.h2
-rw-r--r--src/widgets/styles/qcommonstyle.cpp8
-rw-r--r--src/widgets/styles/qfusionstyle.cpp2
-rw-r--r--src/widgets/styles/qgtkpainter.cpp1
-rw-r--r--src/widgets/styles/qgtkstyle.cpp4
-rw-r--r--src/widgets/styles/qmacstyle.qdoc2
-rw-r--r--src/widgets/styles/qmacstyle_mac.mm139
-rw-r--r--src/widgets/styles/qmacstyle_mac_p_p.h26
-rw-r--r--src/widgets/styles/qstylehelper.cpp2
-rw-r--r--src/widgets/styles/qstyleoption.cpp1
-rw-r--r--src/widgets/widgets.pro10
-rw-r--r--src/widgets/widgets/qabstractscrollarea.cpp31
-rw-r--r--src/widgets/widgets/qcheckbox.cpp4
-rw-r--r--src/widgets/widgets/qdatetimeedit.cpp12
-rw-r--r--src/widgets/widgets/qdial.cpp4
-rw-r--r--src/widgets/widgets/qfontcombobox.cpp2
-rw-r--r--src/widgets/widgets/qgroupbox.cpp4
-rw-r--r--src/widgets/widgets/qlabel.cpp4
-rw-r--r--src/widgets/widgets/qlcdnumber.cpp4
-rw-r--r--src/widgets/widgets/qlineedit.cpp4
-rw-r--r--src/widgets/widgets/qmenu.cpp2
-rw-r--r--src/widgets/widgets/qmenu_wince.rc4
-rw-r--r--src/widgets/widgets/qprogressbar.cpp4
-rw-r--r--src/widgets/widgets/qpushbutton.cpp4
-rw-r--r--src/widgets/widgets/qradiobutton.cpp4
-rw-r--r--src/widgets/widgets/qscrollbar.cpp20
-rw-r--r--src/widgets/widgets/qslider.cpp4
-rw-r--r--src/widgets/widgets/qspinbox.cpp4
-rw-r--r--src/widgets/widgets/qsplitter.cpp35
-rw-r--r--src/widgets/widgets/qtabwidget.cpp4
-rw-r--r--src/widgets/widgets/qtextedit.cpp15
-rw-r--r--src/widgets/widgets/qtextedit.h1
-rw-r--r--src/widgets/widgets/qtextedit_p.h1
-rw-r--r--src/widgets/widgets/qtoolbar.cpp30
-rw-r--r--src/winmain/winmain.pro2
-rw-r--r--src/xml/doc/qtxml.qdocconf10
422 files changed, 4248 insertions, 1882 deletions
diff --git a/src/3rdparty/angle/include/KHR/khrplatform.h b/src/3rdparty/angle/include/KHR/khrplatform.h
index 8ec0d199ff..56c676c77b 100644
--- a/src/3rdparty/angle/include/KHR/khrplatform.h
+++ b/src/3rdparty/angle/include/KHR/khrplatform.h
@@ -221,10 +221,17 @@ typedef signed char khronos_int8_t;
typedef unsigned char khronos_uint8_t;
typedef signed short int khronos_int16_t;
typedef unsigned short int khronos_uint16_t;
+#ifdef _WIN64
+typedef signed long long int khronos_intptr_t;
+typedef unsigned long long int khronos_uintptr_t;
+typedef signed long long int khronos_ssize_t;
+typedef unsigned long long int khronos_usize_t;
+#else
typedef signed long int khronos_intptr_t;
typedef unsigned long int khronos_uintptr_t;
typedef signed long int khronos_ssize_t;
typedef unsigned long int khronos_usize_t;
+#endif
#if KHRONOS_SUPPORT_FLOAT
/*
diff --git a/src/3rdparty/angle/src/libEGL/libEGL_mingw32.def b/src/3rdparty/angle/src/libEGL/libEGL_mingw32.def
new file mode 100644
index 0000000000..8128e7c4f0
--- /dev/null
+++ b/src/3rdparty/angle/src/libEGL/libEGL_mingw32.def
@@ -0,0 +1,36 @@
+LIBRARY libEGL
+EXPORTS
+ eglBindAPI@4 @14
+ eglBindTexImage@12 @20
+ eglChooseConfig@20 @7
+ eglCopyBuffers@12 @33
+ eglCreateContext@16 @23
+ eglCreatePbufferFromClientBuffer@20 @18
+ eglCreatePbufferSurface@12 @10
+ eglCreatePixmapSurface@16 @11
+ eglCreateWindowSurface@16 @9
+ eglDestroyContext@8 @24
+ eglDestroySurface@8 @12
+ eglGetConfigAttrib@16 @8
+ eglGetConfigs@16 @6
+ eglGetCurrentContext@0 @26
+ eglGetCurrentDisplay@0 @28
+ eglGetCurrentSurface@4 @27
+ eglGetDisplay@4 @2
+ eglGetError@0 @1
+ eglGetProcAddress@4 @34
+ eglInitialize@12 @3
+ eglMakeCurrent@16 @25
+ eglQueryAPI@0 @15
+ eglQueryContext@16 @29
+ eglQueryString@8 @5
+ eglQuerySurface@16 @13
+ eglReleaseTexImage@12 @21
+ eglReleaseThread@0 @17
+ eglSurfaceAttrib@16 @19
+ eglSwapBuffers@8 @32
+ eglSwapInterval@8 @22
+ eglTerminate@4 @4
+ eglWaitClient@0 @16
+ eglWaitGL@0 @30
+ eglWaitNative@4 @31
diff --git a/src/3rdparty/angle/src/libEGL/libEGLd_mingw32.def b/src/3rdparty/angle/src/libEGL/libEGLd_mingw32.def
new file mode 100644
index 0000000000..1c72413f89
--- /dev/null
+++ b/src/3rdparty/angle/src/libEGL/libEGLd_mingw32.def
@@ -0,0 +1,36 @@
+LIBRARY libEGLd
+EXPORTS
+ eglBindAPI@4 @14
+ eglBindTexImage@12 @20
+ eglChooseConfig@20 @7
+ eglCopyBuffers@12 @33
+ eglCreateContext@16 @23
+ eglCreatePbufferFromClientBuffer@20 @18
+ eglCreatePbufferSurface@12 @10
+ eglCreatePixmapSurface@16 @11
+ eglCreateWindowSurface@16 @9
+ eglDestroyContext@8 @24
+ eglDestroySurface@8 @12
+ eglGetConfigAttrib@16 @8
+ eglGetConfigs@16 @6
+ eglGetCurrentContext@0 @26
+ eglGetCurrentDisplay@0 @28
+ eglGetCurrentSurface@4 @27
+ eglGetDisplay@4 @2
+ eglGetError@0 @1
+ eglGetProcAddress@4 @34
+ eglInitialize@12 @3
+ eglMakeCurrent@16 @25
+ eglQueryAPI@0 @15
+ eglQueryContext@16 @29
+ eglQueryString@8 @5
+ eglQuerySurface@16 @13
+ eglReleaseTexImage@12 @21
+ eglReleaseThread@0 @17
+ eglSurfaceAttrib@16 @19
+ eglSwapBuffers@8 @32
+ eglSwapInterval@8 @22
+ eglTerminate@4 @4
+ eglWaitClient@0 @16
+ eglWaitGL@0 @30
+ eglWaitNative@4 @31
diff --git a/src/3rdparty/angle/src/libGLESv2/libGLESv2_mingw32.def b/src/3rdparty/angle/src/libGLESv2/libGLESv2_mingw32.def
new file mode 100644
index 0000000000..dc5900854a
--- /dev/null
+++ b/src/3rdparty/angle/src/libGLESv2/libGLESv2_mingw32.def
@@ -0,0 +1,182 @@
+LIBRARY libGLESv2
+EXPORTS
+ glActiveTexture@4 @1
+ glAttachShader@8 @2
+ glBindAttribLocation@12 @3
+ glBindBuffer@8 @4
+ glBindFramebuffer@8 @5
+ glBindRenderbuffer@8 @6
+ glBindTexture@8 @7
+ glBlendColor@16 @8
+ glBlendEquation@4 @9
+ glBlendEquationSeparate@8 @10
+ glBlendFunc@8 @11
+ glBlendFuncSeparate@16 @12
+ glBufferData@16 @13
+ glBufferSubData@16 @14
+ glCheckFramebufferStatus@4 @15
+ glClear@4 @16
+ glClearColor@16 @17
+ glClearDepthf@4 @18
+ glClearStencil@4 @19
+ glColorMask@16 @20
+ glCompileShader@4 @21
+ glCompressedTexImage2D@32 @22
+ glCompressedTexSubImage2D@36 @23
+ glCopyTexImage2D@32 @24
+ glCopyTexSubImage2D@32 @25
+ glCreateProgram@0 @26
+ glCreateShader@4 @27
+ glCullFace@4 @28
+ glDeleteBuffers@8 @29
+ glDeleteFramebuffers@8 @30
+ glDeleteProgram@4 @32
+ glDeleteRenderbuffers@8 @33
+ glDeleteShader@4 @34
+ glDeleteTextures@8 @31
+ glDepthFunc@4 @36
+ glDepthMask@4 @37
+ glDepthRangef@8 @38
+ glDetachShader@8 @35
+ glDisable@4 @39
+ glDisableVertexAttribArray@4 @40
+ glDrawArrays@12 @41
+ glDrawElements@16 @42
+ glEnable@4 @43
+ glEnableVertexAttribArray@4 @44
+ glFinish@0 @45
+ glFlush@0 @46
+ glFramebufferRenderbuffer@16 @47
+ glFramebufferTexture2D@20 @48
+ glFrontFace@4 @49
+ glGenBuffers@8 @50
+ glGenFramebuffers@8 @52
+ glGenRenderbuffers@8 @53
+ glGenTextures@8 @54
+ glGenerateMipmap@4 @51
+ glGetActiveAttrib@28 @55
+ glGetActiveUniform@28 @56
+ glGetAttachedShaders@16 @57
+ glGetAttribLocation@8 @58
+ glGetBooleanv@8 @59
+ glGetBufferParameteriv@12 @60
+ glGetError@0 @61
+ glGetFloatv@8 @62
+ glGetFramebufferAttachmentParameteriv@16 @63
+ glGetIntegerv@8 @64
+ glGetProgramInfoLog@16 @66
+ glGetProgramiv@12 @65
+ glGetRenderbufferParameteriv@12 @67
+ glGetShaderInfoLog@16 @69
+ glGetShaderPrecisionFormat@16 @70
+ glGetShaderSource@16 @71
+ glGetShaderiv@12 @68
+ glGetString@4 @72
+ glGetTexParameterfv@12 @73
+ glGetTexParameteriv@12 @74
+ glGetUniformLocation@8 @77
+ glGetUniformfv@12 @75
+ glGetUniformiv@12 @76
+ glGetVertexAttribPointerv@12 @80
+ glGetVertexAttribfv@12 @78
+ glGetVertexAttribiv@12 @79
+ glHint@8 @81
+ glIsBuffer@4 @82
+ glIsEnabled@4 @83
+ glIsFramebuffer@4 @84
+ glIsProgram@4 @85
+ glIsRenderbuffer@4 @86
+ glIsShader@4 @87
+ glIsTexture@4 @88
+ glLineWidth@4 @89
+ glLinkProgram@4 @90
+ glPixelStorei@8 @91
+ glPolygonOffset@8 @92
+ glReadPixels@28 @93
+ glReleaseShaderCompiler@0 @94
+ glRenderbufferStorage@16 @95
+ glSampleCoverage@8 @96
+ glScissor@16 @97
+ glShaderBinary@20 @98
+ glShaderSource@16 @99
+ glStencilFunc@12 @100
+ glStencilFuncSeparate@16 @101
+ glStencilMask@4 @102
+ glStencilMaskSeparate@8 @103
+ glStencilOp@12 @104
+ glStencilOpSeparate@16 @105
+ glTexImage2D@36 @106
+ glTexParameterf@12 @107
+ glTexParameterfv@12 @108
+ glTexParameteri@12 @109
+ glTexParameteriv@12 @110
+ glTexSubImage2D@36 @111
+ glUniform1f@8 @112
+ glUniform1fv@12 @113
+ glUniform1i@8 @114
+ glUniform1iv@12 @115
+ glUniform2f@12 @116
+ glUniform2fv@12 @117
+ glUniform2i@12 @118
+ glUniform2iv@12 @119
+ glUniform3f@16 @120
+ glUniform3fv@12 @121
+ glUniform3i@16 @122
+ glUniform3iv@12 @123
+ glUniform4f@20 @124
+ glUniform4fv@12 @125
+ glUniform4i@20 @126
+ glUniform4iv@12 @127
+ glUniformMatrix2fv@16 @128
+ glUniformMatrix3fv@16 @129
+ glUniformMatrix4fv@16 @130
+ glUseProgram@4 @131
+ glValidateProgram@4 @132
+ glVertexAttrib1f@8 @133
+ glVertexAttrib1fv@8 @134
+ glVertexAttrib2f@12 @135
+ glVertexAttrib2fv@8 @136
+ glVertexAttrib3f@16 @137
+ glVertexAttrib3fv@8 @138
+ glVertexAttrib4f@20 @139
+ glVertexAttrib4fv@8 @140
+ glVertexAttribPointer@24 @141
+ glViewport@16 @142
+
+ ; Extensions
+ glTexImage3DOES@40 @143
+ glBlitFramebufferANGLE@40 @149
+ glRenderbufferStorageMultisampleANGLE@20 @150
+ glDeleteFencesNV@8 @151
+ glFinishFenceNV@4 @152
+ glGenFencesNV@8 @153
+ glGetFenceivNV@12 @154
+ glIsFenceNV@4 @155
+ glSetFenceNV@8 @156
+ glTestFenceNV@4 @157
+ glGetTranslatedShaderSourceANGLE@16 @159
+ glTexStorage2DEXT@20 @160
+ glGetGraphicsResetStatusEXT@0 @161
+ glReadnPixelsEXT@32 @162
+ glGetnUniformfvEXT@16 @163
+ glGetnUniformivEXT@16 @164
+ glGenQueriesEXT@8 @165
+ glDeleteQueriesEXT@8 @166
+ glIsQueryEXT@4 @167
+ glBeginQueryEXT@8 @168
+ glEndQueryEXT@4 @169
+ glGetQueryivEXT@12 @170
+ glGetQueryObjectuivEXT@12 @171
+ glVertexAttribDivisorANGLE@8 @172
+ glDrawArraysInstancedANGLE@16 @173
+ glDrawElementsInstancedANGLE@20 @174
+ glProgramBinaryOES@16 @175
+ glGetProgramBinaryOES@20 @176
+
+ ; EGL dependencies
+ glCreateContext @144 NONAME
+ glDestroyContext @145 NONAME
+ glMakeCurrent @146 NONAME
+ glGetCurrentContext @147 NONAME
+ glGetProcAddress@4 @148 NONAME
+ glBindTexImage@4 @158 NONAME
diff --git a/src/3rdparty/angle/src/libGLESv2/libGLESv2d_mingw32.def b/src/3rdparty/angle/src/libGLESv2/libGLESv2d_mingw32.def
new file mode 100644
index 0000000000..610e5e1173
--- /dev/null
+++ b/src/3rdparty/angle/src/libGLESv2/libGLESv2d_mingw32.def
@@ -0,0 +1,182 @@
+LIBRARY libGLESv2d
+EXPORTS
+ glActiveTexture@4 @1
+ glAttachShader@8 @2
+ glBindAttribLocation@12 @3
+ glBindBuffer@8 @4
+ glBindFramebuffer@8 @5
+ glBindRenderbuffer@8 @6
+ glBindTexture@8 @7
+ glBlendColor@16 @8
+ glBlendEquation@4 @9
+ glBlendEquationSeparate@8 @10
+ glBlendFunc@8 @11
+ glBlendFuncSeparate@16 @12
+ glBufferData@16 @13
+ glBufferSubData@16 @14
+ glCheckFramebufferStatus@4 @15
+ glClear@4 @16
+ glClearColor@16 @17
+ glClearDepthf@4 @18
+ glClearStencil@4 @19
+ glColorMask@16 @20
+ glCompileShader@4 @21
+ glCompressedTexImage2D@32 @22
+ glCompressedTexSubImage2D@36 @23
+ glCopyTexImage2D@32 @24
+ glCopyTexSubImage2D@32 @25
+ glCreateProgram@0 @26
+ glCreateShader@4 @27
+ glCullFace@4 @28
+ glDeleteBuffers@8 @29
+ glDeleteFramebuffers@8 @30
+ glDeleteProgram@4 @32
+ glDeleteRenderbuffers@8 @33
+ glDeleteShader@4 @34
+ glDeleteTextures@8 @31
+ glDepthFunc@4 @36
+ glDepthMask@4 @37
+ glDepthRangef@8 @38
+ glDetachShader@8 @35
+ glDisable@4 @39
+ glDisableVertexAttribArray@4 @40
+ glDrawArrays@12 @41
+ glDrawElements@16 @42
+ glEnable@4 @43
+ glEnableVertexAttribArray@4 @44
+ glFinish@0 @45
+ glFlush@0 @46
+ glFramebufferRenderbuffer@16 @47
+ glFramebufferTexture2D@20 @48
+ glFrontFace@4 @49
+ glGenBuffers@8 @50
+ glGenFramebuffers@8 @52
+ glGenRenderbuffers@8 @53
+ glGenTextures@8 @54
+ glGenerateMipmap@4 @51
+ glGetActiveAttrib@28 @55
+ glGetActiveUniform@28 @56
+ glGetAttachedShaders@16 @57
+ glGetAttribLocation@8 @58
+ glGetBooleanv@8 @59
+ glGetBufferParameteriv@12 @60
+ glGetError@0 @61
+ glGetFloatv@8 @62
+ glGetFramebufferAttachmentParameteriv@16 @63
+ glGetIntegerv@8 @64
+ glGetProgramInfoLog@16 @66
+ glGetProgramiv@12 @65
+ glGetRenderbufferParameteriv@12 @67
+ glGetShaderInfoLog@16 @69
+ glGetShaderPrecisionFormat@16 @70
+ glGetShaderSource@16 @71
+ glGetShaderiv@12 @68
+ glGetString@4 @72
+ glGetTexParameterfv@12 @73
+ glGetTexParameteriv@12 @74
+ glGetUniformLocation@8 @77
+ glGetUniformfv@12 @75
+ glGetUniformiv@12 @76
+ glGetVertexAttribPointerv@12 @80
+ glGetVertexAttribfv@12 @78
+ glGetVertexAttribiv@12 @79
+ glHint@8 @81
+ glIsBuffer@4 @82
+ glIsEnabled@4 @83
+ glIsFramebuffer@4 @84
+ glIsProgram@4 @85
+ glIsRenderbuffer@4 @86
+ glIsShader@4 @87
+ glIsTexture@4 @88
+ glLineWidth@4 @89
+ glLinkProgram@4 @90
+ glPixelStorei@8 @91
+ glPolygonOffset@8 @92
+ glReadPixels@28 @93
+ glReleaseShaderCompiler@0 @94
+ glRenderbufferStorage@16 @95
+ glSampleCoverage@8 @96
+ glScissor@16 @97
+ glShaderBinary@20 @98
+ glShaderSource@16 @99
+ glStencilFunc@12 @100
+ glStencilFuncSeparate@16 @101
+ glStencilMask@4 @102
+ glStencilMaskSeparate@8 @103
+ glStencilOp@12 @104
+ glStencilOpSeparate@16 @105
+ glTexImage2D@36 @106
+ glTexParameterf@12 @107
+ glTexParameterfv@12 @108
+ glTexParameteri@12 @109
+ glTexParameteriv@12 @110
+ glTexSubImage2D@36 @111
+ glUniform1f@8 @112
+ glUniform1fv@12 @113
+ glUniform1i@8 @114
+ glUniform1iv@12 @115
+ glUniform2f@12 @116
+ glUniform2fv@12 @117
+ glUniform2i@12 @118
+ glUniform2iv@12 @119
+ glUniform3f@16 @120
+ glUniform3fv@12 @121
+ glUniform3i@16 @122
+ glUniform3iv@12 @123
+ glUniform4f@20 @124
+ glUniform4fv@12 @125
+ glUniform4i@20 @126
+ glUniform4iv@12 @127
+ glUniformMatrix2fv@16 @128
+ glUniformMatrix3fv@16 @129
+ glUniformMatrix4fv@16 @130
+ glUseProgram@4 @131
+ glValidateProgram@4 @132
+ glVertexAttrib1f@8 @133
+ glVertexAttrib1fv@8 @134
+ glVertexAttrib2f@12 @135
+ glVertexAttrib2fv@8 @136
+ glVertexAttrib3f@16 @137
+ glVertexAttrib3fv@8 @138
+ glVertexAttrib4f@20 @139
+ glVertexAttrib4fv@8 @140
+ glVertexAttribPointer@24 @141
+ glViewport@16 @142
+
+ ; Extensions
+ glTexImage3DOES@40 @143
+ glBlitFramebufferANGLE@40 @149
+ glRenderbufferStorageMultisampleANGLE@20 @150
+ glDeleteFencesNV@8 @151
+ glFinishFenceNV@4 @152
+ glGenFencesNV@8 @153
+ glGetFenceivNV@12 @154
+ glIsFenceNV@4 @155
+ glSetFenceNV@8 @156
+ glTestFenceNV@4 @157
+ glGetTranslatedShaderSourceANGLE@16 @159
+ glTexStorage2DEXT@20 @160
+ glGetGraphicsResetStatusEXT@0 @161
+ glReadnPixelsEXT@32 @162
+ glGetnUniformfvEXT@16 @163
+ glGetnUniformivEXT@16 @164
+ glGenQueriesEXT@8 @165
+ glDeleteQueriesEXT@8 @166
+ glIsQueryEXT@4 @167
+ glBeginQueryEXT@8 @168
+ glEndQueryEXT@4 @169
+ glGetQueryivEXT@12 @170
+ glGetQueryObjectuivEXT@12 @171
+ glVertexAttribDivisorANGLE@8 @172
+ glDrawArraysInstancedANGLE@16 @173
+ glDrawElementsInstancedANGLE@20 @174
+ glProgramBinaryOES@16 @175
+ glGetProgramBinaryOES@20 @176
+
+ ; EGL dependencies
+ glCreateContext @144 NONAME
+ glDestroyContext @145 NONAME
+ glMakeCurrent @146 NONAME
+ glGetCurrentContext @147 NONAME
+ glGetProcAddress@4 @148 NONAME
+ glBindTexImage@4 @158 NONAME
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-arabic.c b/src/3rdparty/harfbuzz/src/harfbuzz-arabic.c
index d478f0484c..5e7d7f0706 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-arabic.c
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-arabic.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+ * Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies)
*
* This is part of HarfBuzz, an OpenType Layout engine library.
*
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-external.h b/src/3rdparty/harfbuzz/src/harfbuzz-external.h
index 8daf8a69e9..0c0db2045f 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-external.h
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-external.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+ * Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies)
*
* This is part of HarfBuzz, an OpenType Layout engine library.
*
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-global.h b/src/3rdparty/harfbuzz/src/harfbuzz-global.h
index d4e6b466b6..fedff7acc0 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-global.h
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-global.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+ * Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies)
* Copyright (C) 2007 Red Hat, Inc.
*
* This is part of HarfBuzz, an OpenType Layout engine library.
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-greek.c b/src/3rdparty/harfbuzz/src/harfbuzz-greek.c
index 353685861f..0da2fa7cc8 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-greek.c
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-greek.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies)
+ * Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies)
*
* This is part of HarfBuzz, an OpenType Layout engine library.
*
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-hangul.c b/src/3rdparty/harfbuzz/src/harfbuzz-hangul.c
index 6f89ed6b0b..e78ff38b9f 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-hangul.c
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-hangul.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+ * Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies)
*
* This is part of HarfBuzz, an OpenType Layout engine library.
*
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-hebrew.c b/src/3rdparty/harfbuzz/src/harfbuzz-hebrew.c
index b5431a53e7..ecf4cd1fbd 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-hebrew.c
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-hebrew.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+ * Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies)
*
* This is part of HarfBuzz, an OpenType Layout engine library.
*
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-impl.c b/src/3rdparty/harfbuzz/src/harfbuzz-impl.c
index ddbf36be0e..9c55c8e261 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-impl.c
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-impl.c
@@ -1,6 +1,6 @@
/*
* Copyright (C) 1998-2004 David Turner and Werner Lemberg
- * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+ * Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies)
* Copyright (C) 2007 Red Hat, Inc.
*
* This is part of HarfBuzz, an OpenType Layout engine library.
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-indic.cpp b/src/3rdparty/harfbuzz/src/harfbuzz-indic.cpp
index 0dcddc4f7d..976e419fd4 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-indic.cpp
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-indic.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+ * Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies)
*
* This is part of HarfBuzz, an OpenType Layout engine library.
*
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-khmer.c b/src/3rdparty/harfbuzz/src/harfbuzz-khmer.c
index 1f3c7e2bce..6a49a3380d 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-khmer.c
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-khmer.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+ * Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies)
*
* This is part of HarfBuzz, an OpenType Layout engine library.
*
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-myanmar.c b/src/3rdparty/harfbuzz/src/harfbuzz-myanmar.c
index b18b83054d..75c28440eb 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-myanmar.c
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-myanmar.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+ * Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies)
*
* This is part of HarfBuzz, an OpenType Layout engine library.
*
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-shaper-all.cpp b/src/3rdparty/harfbuzz/src/harfbuzz-shaper-all.cpp
index 2dae501305..b32c78f458 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-shaper-all.cpp
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-shaper-all.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+ * Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies)
*
* This is part of HarfBuzz, an OpenType Layout engine library.
*
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-shaper-private.h b/src/3rdparty/harfbuzz/src/harfbuzz-shaper-private.h
index e62c896e8e..fca36c8716 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-shaper-private.h
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-shaper-private.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+ * Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies)
*
* This is part of HarfBuzz, an OpenType Layout engine library.
*
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp b/src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp
index 093e8aed94..2f1b7fe807 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+ * Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies)
*
* This is part of HarfBuzz, an OpenType Layout engine library.
*
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-shaper.h b/src/3rdparty/harfbuzz/src/harfbuzz-shaper.h
index e2891d047e..41782c4411 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-shaper.h
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-shaper.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+ * Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies)
*
* This is part of HarfBuzz, an OpenType Layout engine library.
*
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-stream.c b/src/3rdparty/harfbuzz/src/harfbuzz-stream.c
index 2d9638f6b6..1afe604f02 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-stream.c
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-stream.c
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2005 David Turner
- * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+ * Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies)
* Copyright (C) 2007 Red Hat, Inc.
*
* This is part of HarfBuzz, an OpenType Layout engine library.
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-stream.h b/src/3rdparty/harfbuzz/src/harfbuzz-stream.h
index cfbfb1c4fe..9bcd9d7e3a 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-stream.h
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-stream.h
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2005 David Turner
- * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+ * Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies)
*
* This is part of HarfBuzz, an OpenType Layout engine library.
*
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-thai.c b/src/3rdparty/harfbuzz/src/harfbuzz-thai.c
index f62a1b7159..dc436c784a 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-thai.c
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-thai.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+ * Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies)
*
* This is part of HarfBuzz, an OpenType Layout engine library.
*
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-tibetan.c b/src/3rdparty/harfbuzz/src/harfbuzz-tibetan.c
index c3570974b3..242fd6fd47 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-tibetan.c
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-tibetan.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+ * Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies)
*
* This is part of HarfBuzz, an OpenType Layout engine library.
*
diff --git a/src/3rdparty/harfbuzz/tests/shaping/harfbuzz-qt.cpp b/src/3rdparty/harfbuzz/tests/shaping/harfbuzz-qt.cpp
index 924a97da27..7b6df736e8 100644
--- a/src/3rdparty/harfbuzz/tests/shaping/harfbuzz-qt.cpp
+++ b/src/3rdparty/harfbuzz/tests/shaping/harfbuzz-qt.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+ * Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies)
*
* This is part of HarfBuzz, an OpenType Layout engine library.
*
diff --git a/src/3rdparty/harfbuzz/tests/shaping/main.cpp b/src/3rdparty/harfbuzz/tests/shaping/main.cpp
index 29ff7b3e1b..302d0a00e8 100644
--- a/src/3rdparty/harfbuzz/tests/shaping/main.cpp
+++ b/src/3rdparty/harfbuzz/tests/shaping/main.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+ * Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies)
*
* This is part of HarfBuzz, an OpenType Layout engine library.
*
diff --git a/src/3rdparty/iaccessible2/iaccessible2.pri b/src/3rdparty/iaccessible2/iaccessible2.pri
index 954f4c9e7c..b3cdfa9356 100644
--- a/src/3rdparty/iaccessible2/iaccessible2.pri
+++ b/src/3rdparty/iaccessible2/iaccessible2.pri
@@ -40,8 +40,12 @@ SOURCES += $${MIDL_GENERATED}/Accessible2_i.c \
$${MIDL_GENERATED}/AccessibleText_i.c \
$${MIDL_GENERATED}/AccessibleValue_i.c
-SOURCES += $${MIDL_GENERATED}/IA2TypeLibrary_i.c \
- $${MIDL_GENERATED}/dlldata.c
+SOURCES += $${MIDL_GENERATED}/IA2TypeLibrary_i.c
+
+# Do not add dlldata.c when building accessibility into a static library, as the COM entry points
+# defined there can cause duplicate symbol errors when linking into a binary that also defines
+# such entry points, e.g. anything linked against QtAxServer.
+!static: SOURCES += $${MIDL_GENERATED}/dlldata.c
HEADERS += $${MIDL_GENERATED}/Accessible2.h \
$${MIDL_GENERATED}/AccessibleAction.h \
diff --git a/src/angle/README.qt b/src/angle/README.qt
index a8888604cc..ce5b6332bc 100644
--- a/src/angle/README.qt
+++ b/src/angle/README.qt
@@ -29,6 +29,11 @@ Since we build debug and release versions
the .def files (libEGLd.def) must be created as copies
with the LIBRARY name entry adapted.
+MinGW-w64 32-bit requires function exports in the .def files
+to be decorated. Modified versions of the .def files are created as
+<library>_mingw32.def. The decorated names of each function can be found
+using the nm command to list the symbols in libEGL.o and libGLESv2.o.
+
Using a custom ANGLE
-------------------------------------------------------------
Qt supports building a version of ANGLE other than the one that
diff --git a/src/angle/patches/0007-ANGLE-Fix-typedefs-for-Win64.patch b/src/angle/patches/0007-ANGLE-Fix-typedefs-for-Win64.patch
new file mode 100644
index 0000000000..ed744bbbd9
--- /dev/null
+++ b/src/angle/patches/0007-ANGLE-Fix-typedefs-for-Win64.patch
@@ -0,0 +1,38 @@
+From cf01d1953de652910734d0e01b032da99194590d Mon Sep 17 00:00:00 2001
+From: Jonathan Liu <net147@gmail.com>
+Date: Tue, 18 Dec 2012 00:37:11 +1100
+Subject: [PATCH] ANGLE: Fix typedefs for Win64
+
+The long int type is incorrect for Windows 64-bit as LLP64 is used
+there.
+
+Change-Id: If4ccf49d6bb0cd7ba4ff2997cebfdbe5e7e9711c
+---
+ src/3rdparty/angle/include/KHR/khrplatform.h | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/src/3rdparty/angle/include/KHR/khrplatform.h b/src/3rdparty/angle/include/KHR/khrplatform.h
+index 8ec0d19..56c676c 100644
+--- a/src/3rdparty/angle/include/KHR/khrplatform.h
++++ b/src/3rdparty/angle/include/KHR/khrplatform.h
+@@ -221,10 +221,17 @@ typedef signed char khronos_int8_t;
+ typedef unsigned char khronos_uint8_t;
+ typedef signed short int khronos_int16_t;
+ typedef unsigned short int khronos_uint16_t;
++#ifdef _WIN64
++typedef signed long long int khronos_intptr_t;
++typedef unsigned long long int khronos_uintptr_t;
++typedef signed long long int khronos_ssize_t;
++typedef unsigned long long int khronos_usize_t;
++#else
+ typedef signed long int khronos_intptr_t;
+ typedef unsigned long int khronos_uintptr_t;
+ typedef signed long int khronos_ssize_t;
+ typedef unsigned long int khronos_usize_t;
++#endif
+
+ #if KHRONOS_SUPPORT_FLOAT
+ /*
+--
+1.8.0.1
+
diff --git a/src/angle/src/libEGL/libEGL.pro b/src/angle/src/libEGL/libEGL.pro
index 524e3a9b59..6f3bc25cfb 100644
--- a/src/angle/src/libEGL/libEGL.pro
+++ b/src/angle/src/libEGL/libEGL.pro
@@ -24,7 +24,10 @@ SOURCES += \
$$ANGLE_DIR/src/libEGL/main.cpp \
$$ANGLE_DIR/src/libEGL/Surface.cpp
-msvc:DEF_FILE = $$ANGLE_DIR/src/libEGL/$${TARGET}.def
+!static {
+ DEF_FILE = $$ANGLE_DIR/src/libEGL/$${TARGET}.def
+ win32-g++*:equals(QT_ARCH, i386): DEF_FILE = $$ANGLE_DIR/src/libEGL/$${TARGET}_mingw32.def
+}
load(qt_installs)
diff --git a/src/angle/src/libGLESv2/libGLESv2.pro b/src/angle/src/libGLESv2/libGLESv2.pro
index f4cbfd0494..2412a01b82 100644
--- a/src/angle/src/libGLESv2/libGLESv2.pro
+++ b/src/angle/src/libGLESv2/libGLESv2.pro
@@ -1,6 +1,5 @@
TEMPLATE = lib
TARGET = $$qtLibraryTarget(libGLESv2)
-DEPENDPATH += . shaders
CONFIG += simd
include(../common/common.pri)
@@ -67,7 +66,10 @@ SOURCES += \
SSE2_SOURCES += $$ANGLE_DIR/src/libGLESv2/TextureSSE2.cpp
-msvc:DEF_FILE = $$ANGLE_DIR/src/libGLESv2/$${TARGET}.def
+!static {
+ DEF_FILE = $$ANGLE_DIR/src/libGLESv2/$${TARGET}.def
+ win32-g++*:equals(QT_ARCH, i386): DEF_FILE = $$ANGLE_DIR/src/libGLESv2/$${TARGET}_mingw32.def
+}
float_converter.target = float_converter
float_converter.commands = python $$ANGLE_DIR/src/libGLESv2/Float16ToFloat32.py \
diff --git a/src/concurrent/doc/qtconcurrent.qdocconf b/src/concurrent/doc/qtconcurrent.qdocconf
index 30fdcad847..442f69372c 100644
--- a/src/concurrent/doc/qtconcurrent.qdocconf
+++ b/src/concurrent/doc/qtconcurrent.qdocconf
@@ -3,21 +3,21 @@ include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf)
project = QtConcurrent
description = Qt Concurrent Reference Documentation
url = http://qt-project.org/doc/qtconcurrent
-version = 5.0.0
+version = 5.0.1
examplesinstallpath = qtconcurrent
qhp.projects = QtConcurrent
qhp.QtConcurrent.file = qtconcurrent.qhp
-qhp.QtConcurrent.namespace = org.qt-project.qtconcurrent.500
+qhp.QtConcurrent.namespace = org.qt-project.qtconcurrent.501
qhp.QtConcurrent.virtualFolder = qtconcurrent
qhp.QtConcurrent.indexTitle = Qt Concurrent
qhp.QtConcurrent.indexRoot =
-qhp.QtConcurrent.filterAttributes = qtconcurrent 5.0.0 qtrefdoc
-qhp.QtConcurrent.customFilters.Qt.name = QtConcurrent 5.0.0
-qhp.QtConcurrent.customFilters.Qt.filterAttributes = qtconcurrent 5.0.0
+qhp.QtConcurrent.filterAttributes = qtconcurrent 5.0.1 qtrefdoc
+qhp.QtConcurrent.customFilters.Qt.name = QtConcurrent 5.0.1
+qhp.QtConcurrent.customFilters.Qt.filterAttributes = qtconcurrent 5.0.1
qhp.QtConcurrent.subprojects = classes
qhp.QtConcurrent.subprojects.classes.title = C++ Classes
diff --git a/src/concurrent/qtconcurrentfunctionwrappers.h b/src/concurrent/qtconcurrentfunctionwrappers.h
index 59a29d4653..734aa2a06d 100644
--- a/src/concurrent/qtconcurrentfunctionwrappers.h
+++ b/src/concurrent/qtconcurrentfunctionwrappers.h
@@ -43,6 +43,7 @@
#define QTCONCURRENT_FUNCTIONWRAPPERS_H
#include <QtConcurrent/qtconcurrentcompilertest.h>
+#include <QtCore/QStringList>
#ifndef QT_NO_CONCURRENT
diff --git a/src/corelib/Qt5CTestMacros.cmake b/src/corelib/Qt5CTestMacros.cmake
index fc39c708f3..c5d10c9b5b 100644
--- a/src/corelib/Qt5CTestMacros.cmake
+++ b/src/corelib/Qt5CTestMacros.cmake
@@ -1,4 +1,7 @@
-
+#
+# W A R N I N G
+# -------------
+#
# This file is not part of the Qt API. It exists purely as an
# implementation detail. This file, and its contents may change from version to
# version without notice, or even be removed.
diff --git a/src/corelib/Qt5CoreConfigExtras.cmake.in b/src/corelib/Qt5CoreConfigExtras.cmake.in
index 0df27039d0..06ff6dc831 100644
--- a/src/corelib/Qt5CoreConfigExtras.cmake.in
+++ b/src/corelib/Qt5CoreConfigExtras.cmake.in
@@ -43,10 +43,10 @@ set(Qt5Core_QMAKE_EXECUTABLE Qt5::qmake)
set(Qt5Core_MOC_EXECUTABLE Qt5::moc)
set(Qt5Core_RCC_EXECUTABLE Qt5::rcc)
-!!IF isEmpty(CMAKE_DATA_DIR_IS_ABSOLUTE)
-list(APPEND Qt5Core_INCLUDE_DIRS \"${_qt5_corelib_install_prefix}/mkspecs/$${CMAKE_MKSPEC}\")
+!!IF isEmpty(CMAKE_ARCHDATA_DIR_IS_ABSOLUTE)
+list(APPEND Qt5Core_INCLUDE_DIRS \"${_qt5_corelib_install_prefix}/$${CMAKE_ARCHDATA_DIR}/mkspecs/$${CMAKE_MKSPEC}\")
!!ELSE
-list(APPEND Qt5Core_INCLUDE_DIRS \"$${CMAKE_DATA_DIR}mkspecs/$${CMAKE_MKSPEC}\")
+list(APPEND Qt5Core_INCLUDE_DIRS \"$${CMAKE_ARCHDATA_DIR}mkspecs/$${CMAKE_MKSPEC}\")
!!ENDIF
!!IF !isEmpty(CMAKE_ADD_FPIE_FLAGS)
diff --git a/src/corelib/corelib.pro b/src/corelib/corelib.pro
index 46c771e6a5..f95ee545c0 100644
--- a/src/corelib/corelib.pro
+++ b/src/corelib/corelib.pro
@@ -6,6 +6,7 @@ MODULE = core # not corelib, as per project file
MODULE_CONFIG = moc resources
!isEmpty(QT_NAMESPACE): MODULE_DEFINES = QT_NAMESPACE=$$QT_NAMESPACE
+CONFIG += $$MODULE_CONFIG
DEFINES += QT_NO_USING_NAMESPACE
win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x67000000
irix-cc*:QMAKE_CXXFLAGS += -no_prelink -ptused
@@ -40,7 +41,6 @@ mac|darwin {
}
LIBS_PRIVATE += -framework CoreFoundation
}
-mac:lib_bundle:DEFINES += QT_NO_DEBUG_PLUGIN_CHECK
win32:DEFINES-=QT_NO_CAST_TO_ASCII
DEFINES += $$MODULE_DEFINES
@@ -50,29 +50,11 @@ QMAKE_DYNAMIC_LIST_FILE = $$PWD/QtCore.dynlist
contains(DEFINES,QT_EVAL):include(eval.pri)
-load(moc)
-load(resources)
+HOST_BINS = $$[QT_HOST_BINS]
+host_bins.name = host_bins
+host_bins.variable = HOST_BINS
-moc_dir.name = moc_location
-moc_dir.variable = QMAKE_MOC
-
-rcc_dir.name = rcc_location
-rcc_dir.variable = QMAKE_RCC
-
-QMAKE_PKGCONFIG_VARIABLES += moc_dir rcc_dir
-
-# These are aliens, but Linguist installs no own module, and it fits here best.
-
-qtPrepareTool(QMAKE_LUPDATE, lupdate)
-qtPrepareTool(QMAKE_LRELEASE, lrelease)
-
-lupdate_dir.name = lupdate_location
-lupdate_dir.variable = QMAKE_LUPDATE
-
-lrelease_dir.name = lrelease_location
-lrelease_dir.variable = QMAKE_LRELEASE
-
-QMAKE_PKGCONFIG_VARIABLES += lupdate_dir lrelease_dir
+QMAKE_PKGCONFIG_VARIABLES += host_bins
ctest_macros_file.input = $$PWD/Qt5CTestMacros.cmake
ctest_macros_file.output = $$DESTDIR/cmake/Qt5Core/Qt5CTestMacros.cmake
diff --git a/src/corelib/doc/qtcore.qdocconf b/src/corelib/doc/qtcore.qdocconf
index 2151d95f65..61c9d2bc00 100644
--- a/src/corelib/doc/qtcore.qdocconf
+++ b/src/corelib/doc/qtcore.qdocconf
@@ -3,21 +3,21 @@ include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf)
project = QtCore
description = Qt Core Reference Documentation
url = http://qt-project.org/doc/qtcore
-version = 5.0.0
+version = 5.0.1
examplesinstallpath = core
qhp.projects = QtCore
qhp.QtCore.file = qtcore.qhp
-qhp.QtCore.namespace = org.qt-project.qtcore.500
+qhp.QtCore.namespace = org.qt-project.qtcore.501
qhp.QtCore.virtualFolder = qtcore
qhp.QtCore.indexTitle = Qt Core
qhp.QtCore.indexRoot =
-qhp.QtCore.filterAttributes = qtcore 5.0.0 qtrefdoc
-qhp.QtCore.customFilters.Qt.name = QtCore 5.0.0
-qhp.QtCore.customFilters.Qt.filterAttributes = qtcore 5.0.0
+qhp.QtCore.filterAttributes = qtcore 5.0.1 qtrefdoc
+qhp.QtCore.customFilters.Qt.name = QtCore 5.0.1
+qhp.QtCore.customFilters.Qt.filterAttributes = qtcore 5.0.1
qhp.QtCore.subprojects = classes
qhp.QtCore.subprojects.classes.title = C++ Classes
qhp.QtCore.subprojects.classes.indexTitle = Qt Core C++ Classes
@@ -26,7 +26,7 @@ qhp.QtCore.subprojects.classes.sortPages = true
tagfile = ../../../doc/qtcore/qtcore.tags
-depends += qtgui qtwidgets qtnetwork qtdoc qtquick
+depends += qtgui qtwidgets qtnetwork qtdoc qtquick qtlinguist qtdesigner
headerdirs += ..
@@ -35,6 +35,8 @@ sourcedirs += ..
exampledirs += \
../ \
snippets \
- ../../../examples/threads
+ ../../../examples/threads/ \
+ ../../../examples/tools/ \
+ ../../../examples/widgets/widgets/analogclock
imagedirs += images
diff --git a/src/corelib/doc/snippets/code/doc_src_plugins-howto.cpp b/src/corelib/doc/snippets/code/doc_src_plugins-howto.cpp
index ca6e64a90e..a86441c822 100644
--- a/src/corelib/doc/snippets/code/doc_src_plugins-howto.cpp
+++ b/src/corelib/doc/snippets/code/doc_src_plugins-howto.cpp
@@ -65,20 +65,3 @@ QStyle *MyStylePlugin::create(const QString &key)
//! [2]
QApplication::setStyle(QStyleFactory::create("MyStyle"));
//! [2]
-
-
-//! [4]
-#include <QApplication>
-#include <QtPlugin>
-
-Q_IMPORT_PLUGIN(qjpeg)
-Q_IMPORT_PLUGIN(qgif)
-Q_IMPORT_PLUGIN(qkrcodecs)
-
-int main(int argc, char *argv[])
-{
- QApplication app(argc, argv);
- ...
- return app.exec();
-}
-//! [4]
diff --git a/src/corelib/doc/snippets/code/doc_src_plugins-howto.pro b/src/corelib/doc/snippets/code/doc_src_plugins-howto.pro
index 20d5f7e41b..b33db7942f 100644
--- a/src/corelib/doc/snippets/code/doc_src_plugins-howto.pro
+++ b/src/corelib/doc/snippets/code/doc_src_plugins-howto.pro
@@ -42,9 +42,20 @@
CONFIG += release
#! [3]
+#! [4]
+CONFIG += qpa_minimal_plugin
+#! [4]
#! [5]
QTPLUGIN += qjpeg \
qgif \
qkrcodecs
#! [5]
+
+#! [6]
+CONFIG -= import_qpa_plugin
+#! [6]
+
+#! [7]
+CONFIG -= import_plugins
+#! [7]
diff --git a/src/corelib/doc/snippets/code/src_corelib_io_qsettings.cpp b/src/corelib/doc/snippets/code/src_corelib_io_qsettings.cpp
index ab54033ef3..d3dde5be66 100644
--- a/src/corelib/doc/snippets/code/src_corelib_io_qsettings.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_io_qsettings.cpp
@@ -82,7 +82,7 @@ settings.value("HKEY_CURRENT_USER\\MySoft\\Star Runner\\Galaxy\\Default"); // re
//! [7]
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
QSettings settings("grenoullelogique.fr", "Squash");
#else
QSettings settings("Grenoulle Logique", "Squash");
diff --git a/src/corelib/doc/snippets/code/src_corelib_kernel_qobject.cpp b/src/corelib/doc/snippets/code/src_corelib_kernel_qobject.cpp
index c462083328..1735efbfde 100644
--- a/src/corelib/doc/snippets/code/src_corelib_kernel_qobject.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_kernel_qobject.cpp
@@ -377,7 +377,7 @@ Q_PROPERTY(type name
[DESIGNABLE bool]
[SCRIPTABLE bool]
[STORED bool]
- [USER bool]
+ [USER bool]
[CONSTANT]
[FINAL])
//! [36]
diff --git a/src/corelib/doc/snippets/code/src_corelib_tools_qbytearray.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qbytearray.cpp
index 71c6fbd80f..eef026af75 100644
--- a/src/corelib/doc/snippets/code/src_corelib_tools_qbytearray.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_tools_qbytearray.cpp
@@ -251,7 +251,7 @@ ba.lastIndexOf("X"); // returns -1
//! [25]
-QByteArray url("ftp://ftp.qt.nokia.com/");
+QByteArray url("ftp://ftp.qt-project.org/");
if (url.startsWith("ftp:"))
...
//! [25]
diff --git a/src/corelib/doc/snippets/hellotrmain.cpp b/src/corelib/doc/snippets/hellotrmain.cpp
new file mode 100644
index 0000000000..fdb034c241
--- /dev/null
+++ b/src/corelib/doc/snippets/hellotrmain.cpp
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+** of its contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//! [0]
+int main(int argc, char *argv[])
+{
+ QApplication app(argc, argv);
+
+ QTranslator translator;
+ translator.load("hellotr_la");
+ app.installTranslator(&translator);
+
+ QPushButton hello(QPushButton::tr("Hello world!"));
+ hello.resize(100, 30);
+
+ hello.show();
+ return app.exec();
+}
+//! [0]
+
diff --git a/src/corelib/doc/src/custom-types.qdoc b/src/corelib/doc/src/custom-types.qdoc
new file mode 100644
index 0000000000..95987ec014
--- /dev/null
+++ b/src/corelib/doc/src/custom-types.qdoc
@@ -0,0 +1,165 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** 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 Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \page custom-types.html
+ \title Creating Custom Qt Types
+ \brief How to create and register new types with Qt.
+
+ \ingroup best-practices
+
+ \tableofcontents
+
+ \section1 Overview
+
+ When creating user interfaces with Qt, particularly those with specialized controls and
+ features, developers sometimes need to create new data types that can be used alongside
+ or in place of Qt's existing set of value types.
+
+ Standard types such as QSize, QColor and QString can all be stored in QVariant objects,
+ used as the types of properties in QObject-based classes, and emitted in signal-slot
+ communication.
+
+ In this document, we take a custom type and describe how to integrate it into Qt's object
+ model so that it can be stored in the same way as standard Qt types. We then show how to
+ register the custom type to allow it to be used in signals and slots connections.
+
+ \section1 Creating a Custom Type
+
+ Before we begin, we need to ensure that the custom type we are creating meets all the
+ requirements imposed by QMetaType. In other words, it must provide:
+
+ \list
+ \li a public default constructor,
+ \li a public copy constructor, and
+ \li a public destructor.
+ \endlist
+
+ The following \c Message class definition includes these members:
+
+ \snippet customtype/message.h custom type definition
+
+ The class also provides a constructor for normal use and two public member functions
+ that are used to obtain the private data.
+
+ \section1 Declaring the Type with QMetaType
+
+ The \c Message class only needs a suitable implementation in order to be usable.
+ However, Qt's type system will not be able to understand how to store, retrieve
+ and serialize instances of this class without some assistance. For example, we
+ will be unable to store \c Message values in QVariant.
+
+ The class in Qt responsible for custom types is QMetaType. To make the type known
+ to this class, we invoke the Q_DECLARE_METATYPE() macro on the class in the header
+ file where it is defined:
+
+ \snippet customtype/message.h custom type meta-type declaration
+
+ This now makes it possible for \c Message values to be stored in QVariant objects
+ and retrieved later. See the \l{Custom Type Example} for code that demonstrates
+ this.
+
+ The Q_DECLARE_METATYPE() macro also makes it possible for these values to be used as
+ arguments to signals, but \e{only in direct signal-slot connections}.
+ To make the custom type generally usable with the signals and slots mechanism, we
+ need to perform some extra work.
+
+ \section1 Creating and Destroying Custom Objects
+
+ Although the declaration in the previous section makes the type available for use
+ in direct signal-slot connections, it cannot be used for queued signal-slot
+ connections, such as those that are made between objects in different threads.
+ This is because the meta-object system does not know how to handle creation and
+ destruction of objects of the custom type at run-time.
+
+ To enable creation of objects at run-time, call the qRegisterMetaType() template
+ function to register it with the meta-object system. This also makes the type
+ available for queued signal-slot communication as long as you call it before you
+ make the first connection that uses the type.
+
+ The \l{Queued Custom Type Example} declares a \c Block class which is registered
+ in the \c{main.cpp} file:
+
+ \snippet queuedcustomtype/main.cpp main start
+ \dots
+ \snippet queuedcustomtype/main.cpp register meta-type for queued communications
+ \dots
+ \snippet queuedcustomtype/main.cpp main finish
+
+ This type is later used in a signal-slot connection in the \c{window.cpp} file:
+
+ \snippet queuedcustomtype/window.cpp Window constructor start
+ \dots
+ \snippet queuedcustomtype/window.cpp connecting signal with custom type
+ \dots
+ \snippet queuedcustomtype/window.cpp Window constructor finish
+
+ If a type is used in a queued connection without being registered, a warning will be
+ printed at the console; for example:
+
+ \code
+ QObject::connect: Cannot queue arguments of type 'Block'
+ (Make sure 'Block' is registered using qRegisterMetaType().)
+ \endcode
+
+ \section1 Making the Type Printable
+
+ It is often quite useful to make a custom type printable for debugging purposes,
+ as in the following code:
+
+ \snippet customtype/main.cpp printing a custom type
+
+ This is achieved by creating a streaming operator for the type, which is often
+ defined in the header file for that type:
+
+ \snippet customtype/message.h custom type streaming operator
+
+ The implementation for the \c Message type in the \l{Custom Type Example}
+ goes to some effort to make the printable representation as readable as
+ possible:
+
+ \snippet customtype/message.cpp custom type streaming operator
+
+ The output sent to the debug stream can, of course, be made as simple or as
+ complicated as you like. Note that the value returned by this function is
+ the QDebug object itself, though this is often obtained by calling the
+ maybeSpace() member function of QDebug that pads out the stream with space
+ characters to make it more readable.
+
+ \section1 Further Reading
+
+ The Q_DECLARE_METATYPE() macro and qRegisterMetaType() function documentation
+ contain more detailed information about their uses and limitations.
+
+ The \l{Custom Type Example}{Custom Type},
+ \l{Custom Type Sending Example}{Custom Type Sending}
+ and \l{Queued Custom Type Example}{Queued Custom Type} examples show how to
+ implement a custom type with the features outlined in this document.
+
+ The \l{Debugging Techniques} document provides an overview of the debugging
+ mechanisms discussed above.
+*/
diff --git a/src/corelib/doc/src/implicit-sharing.qdoc b/src/corelib/doc/src/implicit-sharing.qdoc
index 39ba702d55..baed85fb18 100644
--- a/src/corelib/doc/src/implicit-sharing.qdoc
+++ b/src/corelib/doc/src/implicit-sharing.qdoc
@@ -135,7 +135,7 @@
\warning Do not copy an implicitly shared container (QMap,
QVector, etc.) while you are iterating over it using an non-const
- \l{STL-style iterator}.
+ \l{STL-style iterators}{STL-style iterator}.
\keyword implicitly shared classes
\annotatedlist shared
diff --git a/src/corelib/doc/src/json.qdoc b/src/corelib/doc/src/json.qdoc
index ff06b48008..109102f190 100644
--- a/src/corelib/doc/src/json.qdoc
+++ b/src/corelib/doc/src/json.qdoc
@@ -99,8 +99,6 @@
A valid JSON document is either an array or an object, so a document always starts
with a square or curly bracket.
- JSON support in Qt consists of a set of 4 classes.
-
\section1 The JSON Classes
diff --git a/src/corelib/doc/src/objectmodel/object.qdoc b/src/corelib/doc/src/objectmodel/object.qdoc
index 47f56372de..edf5673da0 100644
--- a/src/corelib/doc/src/objectmodel/object.qdoc
+++ b/src/corelib/doc/src/objectmodel/object.qdoc
@@ -47,7 +47,7 @@
properties}
\li powerful \l{The Event System}{events and event filters}
\li contextual \l{i18n}{string translation for internationalization}
- \li sophisticated interval driven \l timers that make it possible
+ \li sophisticated interval driven \l {Timers}{timers} that make it possible
to elegantly integrate many tasks in an event-driven GUI
\li hierarchical and queryable \l{Object Trees & Ownership}{object
trees} that organize object ownership in a natural way
@@ -56,6 +56,7 @@
pointers which become dangling pointers when their objects are destroyed
\li a \l{metaobjects.html#qobjectcast}{dynamic cast} that works across
library boundaries.
+ \li support for \l{Creating Custom Qt Types}{custom type} creation.
\endlist
Many of these Qt features are implemented with standard C++
diff --git a/src/corelib/doc/src/objectmodel/properties.qdoc b/src/corelib/doc/src/objectmodel/properties.qdoc
index 4ea52050b8..d818d1154c 100644
--- a/src/corelib/doc/src/objectmodel/properties.qdoc
+++ b/src/corelib/doc/src/objectmodel/properties.qdoc
@@ -89,8 +89,8 @@
\li The \c DESIGNABLE attribute indicates whether the property
should be visible in the property editor of GUI design tool (e.g.,
- \l {Qt Designer}). Most properties are \c DESIGNABLE (default
- true). Instead of true or false, you can specify a boolean
+ \l {Qt Designer Manual}{Qt Designer}). Most properties are \c DESIGNABLE
+ (default true). Instead of true or false, you can specify a boolean
member function.
\li The \c SCRIPTABLE attribute indicates whether this property
diff --git a/src/corelib/doc/src/plugins-howto.qdoc b/src/corelib/doc/src/plugins-howto.qdoc
index 332b92596b..d94bf2eadc 100644
--- a/src/corelib/doc/src/plugins-howto.qdoc
+++ b/src/corelib/doc/src/plugins-howto.qdoc
@@ -266,18 +266,22 @@
\row \li \c qsqltds \li SQL driver \li Sybase Adaptive Server (TDS)
\endtable
- To link statically against those plugins, you need to use the
- Q_IMPORT_PLUGIN() macro in your application and you need to add
+ To link statically against those plugins, you need to add
the required plugins to your build using \c QTPLUGIN.
- For example, in your \c main.cpp:
-
- \snippet code/doc_src_plugins-howto.cpp 4
+ Q_IMPORT_PLUGIN() macros are also needed in application code,
+ but those are automatically generated by qmake and added to
+ your application project.
In the \c .pro file for your application, you need the following
entry:
\snippet code/doc_src_plugins-howto.pro 5
+ If you do not want all plugins added to QTPLUGIN to be automatically
+ linked, remove \c import_plugins from the \c CONFIG variable:
+
+ \snippet code/doc_src_plugins-howto.pro 7
+
It is also possible to create your own static plugins, by
following these steps:
@@ -296,6 +300,17 @@
to make sure that the \c{QT_STATICPLUGIN} preprocessor macro is
defined.
+ The default Qt platform adaptation plugin is automatically added to QTPLUGIN
+ in static builds. If you want to add the minimal plugin instead, add \c qpa_minimal_plugin
+ to \c CONFIG:
+
+ \snippet code/doc_src_plugins-howto.pro 4
+
+ If you want neither the default nor the minimal QPA plugin to be linked automatically,
+ remove \c import_qpa_plugin from \c CONFIG:
+
+ \snippet code/doc_src_plugins-howto.pro 6
+
\section1 Deploying and Debugging Plugins
The \l{Deploying Plugins} document covers the process of deploying
diff --git a/src/corelib/doc/src/statemachine.qdoc b/src/corelib/doc/src/statemachine.qdoc
index b241b4aff4..e23b911f85 100644
--- a/src/corelib/doc/src/statemachine.qdoc
+++ b/src/corelib/doc/src/statemachine.qdoc
@@ -45,7 +45,7 @@
The State Machine framework provides classes for creating and executing
state graphs. The concepts and notation are based on those from Harel's
- \l{Statecharts: A visual formalism for complex systems}{Statecharts}, which
+ \l{http://www.wisdom.weizmann.ac.il/~dharel/SCANNED.PAPERS/Statecharts.pdf}{Statecharts: A visual formalism for complex systems}, which
is also the basis of UML state diagrams. The semantics of state machine
execution are based on \l{State Chart XML: State Machine Notation for
Control Abstraction}{State Chart XML (SCXML)}.
diff --git a/src/corelib/doc/src/threads-basics.qdoc b/src/corelib/doc/src/threads-basics.qdoc
index 501edb6ecf..ea804f2d6d 100644
--- a/src/corelib/doc/src/threads-basics.qdoc
+++ b/src/corelib/doc/src/threads-basics.qdoc
@@ -244,18 +244,18 @@
code that generates another thread which says hello in that thread and then
exits.
- \snippet tutorials/threads/hellothread/hellothread.h 1
+ \snippet ../widgets/tutorials/threads/hellothread/hellothread.h 1
We derive a class from QThread and reimplement the \l{QThread::}{run()}
method.
- \snippet tutorials/threads/hellothread/hellothread.cpp 1
+ \snippet ../widgets/tutorials/threads/hellothread/hellothread.cpp 1
The run method contains the code that will be run in a separate thread. In
this example, a message containing the thread ID will be printed.
QThread::start() will call the method in another thread.
- \snippet tutorials/threads/hellothread/main.cpp 1
+ \snippet ../widgets/tutorials/threads/hellothread/main.cpp 1
To start the thread, our thread object needs to be instantiated. The
\l{QThread::}{start()} method creates a new thread and calls the
@@ -453,7 +453,7 @@
another thread needs to be placed in the reimplemented QRunnable::run()
method.
- \snippet tutorials/threads/hellothreadpool/hellothreadpool.cpp 1
+ \snippet ../widgets/tutorials/threads/hellothreadpool/hellothreadpool.cpp 1
We instantiate Work in main(), locate the global thread pool and use the
QThreadPool::start() method. Now the thread pool runs our worker in another
@@ -463,7 +463,7 @@
\section2 Example 2: Using QtConcurrent
- \snippet tutorials/threads/helloconcurrent/helloconcurrent.cpp 1
+ \snippet ../widgets/tutorials/threads/helloconcurrent/helloconcurrent.cpp 1
We write a global function hello() to implement the work. QtConcurrent::run()
is used to run the function in another thread. The result is a QFuture.
@@ -499,17 +499,17 @@
Communication from the GUI to the worker thread is shown in the next
example.
- \snippet tutorials/threads/clock/main.cpp 1
+ \snippet ../widgets/tutorials/threads/clock/main.cpp 1
We've connected the \c clockThread with the label. The connection must be a
queued signal-slot connection because we want to put the call in the event
loop.
- \snippet tutorials/threads/clock/clockthread.h 1
+ \snippet ../widgets/tutorials/threads/clock/clockthread.h 1
We have derived a class from QThread and declared the \c sendTime() signal.
- \snippet tutorials/threads/clock/clockthread.cpp 1
+ \snippet ../widgets/tutorials/threads/clock/clockthread.cpp 1
The trickiest part of this example is that the timer is connected to its
slot via a direct connection. A default connection would produce a queued
@@ -541,7 +541,7 @@
The \c Thread class's code is short but somewhat involved, so we only show
how to use the class.
- \snippet tutorials/threads/movedobject/main.cpp 1
+ \snippet ../widgets/tutorials/threads/movedobject/main.cpp 1
QMetaObject::invokeMethod() calls a slot via the event loop. The worker
object's methods should not be called directly after the object has been
diff --git a/src/corelib/doc/src/threads.qdoc b/src/corelib/doc/src/threads.qdoc
index 9b8fe527d2..bcabfc3c8c 100644
--- a/src/corelib/doc/src/threads.qdoc
+++ b/src/corelib/doc/src/threads.qdoc
@@ -74,10 +74,10 @@
to threading see our Recommended Reading list:
\list
- \li \l{Threads Primer: A Guide to Multithreaded Programming}
- \li \l{Thread Time: The Multithreaded Programming Guide}
- \li \l{Pthreads Programming: A POSIX Standard for Better Multiprocessing}
- \li \l{Win32 Multithreaded Programming}
+ \li \l {http://www.amazon.com/Threads-Primer-Guide-Multithreaded-Programming/dp/0134436989}{Threads Primer: A Guide to Multithreaded Programming}
+ \li \l {http://www.amazon.com/Thread-Time-MultiThreaded-Programming-Guide/dp/0131900676}{Thread Time: The Multithreaded Programming Guide}
+ \li \l {http://www.amazon.com/Pthreads-Programming-Standard-Multiprocessing-Nutshell/dp/1565921151a}{Pthreads Programming: A POSIX Standard for Better Multiprocessing}
+ \li \l {http://www.amazon.com/WIN32-Multithreaded-Programming-Aaron-Cohen/dp/1565922964}{Win32 Multithreaded Programming}
\endlist
\section1 The Threading Classes
diff --git a/src/corelib/doc/src/timers.qdoc b/src/corelib/doc/src/timers.qdoc
new file mode 100644
index 0000000000..eddb600559
--- /dev/null
+++ b/src/corelib/doc/src/timers.qdoc
@@ -0,0 +1,123 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** 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 Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \page timers.html
+ \title Timers
+ \brief How to use Qt timers in your application.
+
+ \ingroup best-practices
+
+ QObject, the base class of all Qt objects, provides the basic
+ timer support in Qt. With QObject::startTimer(), you start a
+ timer with an interval in milliseconds as argument. The function
+ returns a unique integer timer ID. The timer will now fire at
+ regular intervals until you explicitly call QObject::killTimer()
+ with the timer ID.
+
+ For this mechanism to work, the application must run in an event
+ loop. You start an event loop with QApplication::exec(). When a
+ timer fires, the application sends a QTimerEvent, and the flow of
+ control leaves the event loop until the timer event is processed.
+ This implies that a timer cannot fire while your application is
+ busy doing something else. In other words: the accuracy of timers
+ depends on the granularity of your application.
+
+ In multithreaded applications, you can use the timer mechanism in
+ any thread that has an event loop. To start an event loop from a
+ non-GUI thread, use QThread::exec(). Qt uses the object's
+ \l{QObject::thread()}{thread affinity} to determine which thread
+ will deliver the QTimerEvent. Because of this, you must start and
+ stop all timers in the object's thread; it is not possible to
+ start timers for objects in another thread.
+
+ The upper limit for the interval value is determined by the number
+ of milliseconds that can be specified in a signed integer
+ (in practice, this is a period of just over 24 days). The accuracy
+ depends on the underlying operating system. Windows 2000 has 15
+ millisecond accuracy; other systems that we have tested can handle
+ 1 millisecond intervals.
+
+ The main API for the timer functionality is QTimer. That class
+ provides regular timers that emit a signal when the timer fires, and
+ inherits QObject so that it fits well into the ownership structure
+ of most GUI programs. The normal way of using it is like this:
+
+ \snippet timers/timers.cpp 0
+ \snippet timers/timers.cpp 1
+ \snippet timers/timers.cpp 2
+
+ The QTimer object is made into a child of this widget so that,
+ when this widget is deleted, the timer is deleted too.
+ Next, its \l{QTimer::}{timeout()} signal is connected to the slot
+ that will do the work, it is started with a value of 1000
+ milliseconds, indicating that it will time out every second.
+
+ QTimer also provides a static function for single-shot timers.
+ For example:
+
+ \snippet timers/timers.cpp 3
+
+ 200 milliseconds (0.2 seconds) after this line of code is
+ executed, the \c updateCaption() slot will be called.
+
+ For QTimer to work, you must have an event loop in your
+ application; that is, you must call QCoreApplication::exec()
+ somewhere. Timer events will be delivered only while the event
+ loop is running.
+
+ In multithreaded applications, you can use QTimer in any thread
+ that has an event loop. To start an event loop from a non-GUI
+ thread, use QThread::exec(). Qt uses the timer's
+ \l{QObject::thread()}{thread affinity} to determine which thread
+ will emit the \l{QTimer::}{timeout()} signal. Because of this, you
+ must start and stop the timer in its thread; it is not possible to
+ start a timer from another thread.
+
+ The \l{widgets/analogclock}{Analog Clock} example shows how to use
+ QTimer to redraw a widget at regular intervals. From \c{AnalogClock}'s
+ implementation:
+
+ \snippet analogclock.cpp 0
+ \snippet analogclock.cpp 2
+ \snippet analogclock.cpp 3
+ \snippet analogclock.cpp 4
+ \snippet analogclock.cpp 5
+ \snippet analogclock.cpp 6
+ \dots
+ \snippet analogclock.cpp 7
+
+ Every second, QTimer will call the QWidget::update() slot to
+ refresh the clock's display.
+
+ If you already have a QObject subclass and want an easy
+ optimization, you can use QBasicTimer instead of QTimer. With
+ QBasicTimer, you must reimplement
+ \l{QObject::timerEvent()}{timerEvent()} in your QObject subclass
+ and handle the timeout there. The \l{widgets/wiggly}{Wiggly}
+ example shows how to use QBasicTimer.
+*/
diff --git a/src/corelib/global/qconfig-minimal.h b/src/corelib/global/qconfig-minimal.h
index 28cb8fbede..6a21492827 100644
--- a/src/corelib/global/qconfig-minimal.h
+++ b/src/corelib/global/qconfig-minimal.h
@@ -40,9 +40,6 @@
****************************************************************************/
/* Data structures */
-#ifndef QT_NO_QUUID_STRING
-# define QT_NO_QUUID_STRING
-#endif
#ifndef QT_NO_TEXTDATE
# define QT_NO_TEXTDATE
#endif
diff --git a/src/corelib/global/qconfig-nacl.h b/src/corelib/global/qconfig-nacl.h
index d5172aac29..9dac73ea93 100644
--- a/src/corelib/global/qconfig-nacl.h
+++ b/src/corelib/global/qconfig-nacl.h
@@ -46,9 +46,6 @@
#define QT_FONTS_ARE_RESOURCES
/* Data structures */
-#ifndef QT_NO_QUUID_STRING
-# define QT_NO_QUUID_STRING
-#endif
#ifndef QT_NO_TEXTDATE
# define QT_NO_TEXTDATE
#endif
diff --git a/src/corelib/global/qconfig-small.h b/src/corelib/global/qconfig-small.h
index 9d72cd5d4c..405521c338 100644
--- a/src/corelib/global/qconfig-small.h
+++ b/src/corelib/global/qconfig-small.h
@@ -39,11 +39,6 @@
**
****************************************************************************/
-/* Data structures */
-#ifndef QT_NO_QUUID_STRING
-# define QT_NO_QUUID_STRING
-#endif
-
/* Dialogs */
#ifndef QT_NO_COLORDIALOG
# define QT_NO_COLORDIALOG
diff --git a/src/corelib/global/qfeatures.h b/src/corelib/global/qfeatures.h
index 26d92592cb..a63d3a3b3d 100644
--- a/src/corelib/global/qfeatures.h
+++ b/src/corelib/global/qfeatures.h
@@ -91,9 +91,6 @@
// QHostInfo
//#define QT_NO_HOSTINFO
-// QImageIOPlugin
-//#define QT_NO_IMAGEFORMATPLUGIN
-
// BMP Image Format
//#define QT_NO_IMAGEFORMAT_BMP
@@ -157,9 +154,6 @@
// Properties
//#define QT_NO_PROPERTIES
-// Universally Unique Identifier Convertion
-//#define QT_NO_QUUID_STRING
-
// Resize Handler
//#define QT_NO_RESIZEHANDLER
diff --git a/src/corelib/global/qfeatures.txt b/src/corelib/global/qfeatures.txt
index 941150351a..ad1ca5a6d5 100644
--- a/src/corelib/global/qfeatures.txt
+++ b/src/corelib/global/qfeatures.txt
@@ -141,13 +141,6 @@ Name: QInputContext
SeeAlso: ???
# Data structures
-Feature: QUUID_STRING
-Description: Supports convertion between UUID and strings.
-Section: Data structures
-Requires:
-Name: Universally Unique Identifier Convertion
-SeeAlso: ???
-
Feature: TEXTDATE
Description: Supports month and day names in dates.
Section: Data structures
@@ -767,7 +760,7 @@ SeeAlso: ???
Feature: IMAGEFORMATPLUGIN
Description: Supports writing an image format plugin.
Section: Images
-Requires:
+Requires: LIBRARY
Name: QImageIOPlugin
SeeAlso: ???
diff --git a/src/corelib/global/qflags.h b/src/corelib/global/qflags.h
index 3edbef3bd6..cbd7185a92 100644
--- a/src/corelib/global/qflags.h
+++ b/src/corelib/global/qflags.h
@@ -39,10 +39,11 @@
**
****************************************************************************/
+#include <QtCore/qglobal.h>
+
#ifndef QFLAGS_H
#define QFLAGS_H
-#include <QtCore/qglobal.h>
#include <QtCore/qtypeinfo.h>
#include <QtCore/qtypetraits.h>
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index c1501db33d..3881b166b1 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -2513,26 +2513,6 @@ int qrand()
*/
/*!
- \macro TRUE
- \relates <QtGlobal>
- \obsolete
-
- Synonym for \c true.
-
- \sa FALSE
-*/
-
-/*!
- \macro FALSE
- \relates <QtGlobal>
- \obsolete
-
- Synonym for \c false.
-
- \sa TRUE
-*/
-
-/*!
\macro QABS(n)
\relates <QtGlobal>
\obsolete
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index 60b90dc70f..48cc477d51 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -45,11 +45,11 @@
#include <stddef.h>
-#define QT_VERSION_STR "5.0.0"
+#define QT_VERSION_STR "5.0.1"
/*
QT_VERSION is (major << 16) + (minor << 8) + patch.
*/
-#define QT_VERSION 0x050000
+#define QT_VERSION 0x050001
/*
can be used like #if (QT_VERSION >= QT_VERSION_CHECK(4, 4, 0))
*/
@@ -436,17 +436,6 @@ typedef QIntegerForSizeof<void*>::Unsigned quintptr;
typedef QIntegerForSizeof<void*>::Signed qptrdiff;
typedef qptrdiff qintptr;
-/*
- Constant bool values
-*/
-
-#ifndef QT_LINUXBASE /* the LSB defines TRUE and FALSE for us */
-# ifndef TRUE
-# define TRUE true
-# define FALSE false
-# endif
-#endif
-
/* moc compats (signals/slots) */
#ifndef QT_MOC_COMPAT
# define QT_MOC_COMPAT
diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp
index e4ff7eece4..339cedb57e 100644
--- a/src/corelib/global/qlogging.cpp
+++ b/src/corelib/global/qlogging.cpp
@@ -83,7 +83,6 @@ static bool isFatal(QtMsgType msgType)
/*!
\class QMessageLogContext
\inmodule QtCore
- \relates <QtGlobal>
\brief The QMessageLogContext class provides additional information about a log message.
\since 5.0
@@ -96,7 +95,6 @@ static bool isFatal(QtMsgType msgType)
/*!
\class QMessageLogger
\inmodule QtCore
- \relates <QtGlobal>
\brief The QMessageLogger class generates log messages.
\since 5.0
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc
index 363c5206b0..0b0d089ba5 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -406,7 +406,7 @@
\value BevelJoin The triangular notch between the two lines is filled.
\value RoundJoin A circular arc between the two lines is filled.
\value SvgMiterJoin A miter join corresponding to the definition of
- a miter join in the \l{SVG 1.2 Tiny} specification.
+ a miter join in the \l{http://www.w3.org/TR/SVGMobile12/}{SVG 1.2 Tiny} specification.
\omitvalue MPenJoinStyle
\sa QPen
@@ -1721,7 +1721,9 @@
\value ScrollBarAlwaysOff QAbstractScrollArea never shows a scroll bar.
- \value ScrollBarAlwaysOn QAbstractScrollArea always shows a scroll bar.
+ \value ScrollBarAlwaysOn QAbstractScrollArea always shows a scroll bar. This
+ property is ignored on systems with transient scroll bars (e.g., on Mac from
+ version 10.7).
(The modes for the horizontal and vertical scroll bars are
independent.)
diff --git a/src/corelib/global/qsysinfo.h b/src/corelib/global/qsysinfo.h
index 275b899662..867acd4d60 100644
--- a/src/corelib/global/qsysinfo.h
+++ b/src/corelib/global/qsysinfo.h
@@ -39,11 +39,11 @@
**
****************************************************************************/
+#include <QtCore/qglobal.h>
+
#ifndef QSYSINFO_H
#define QSYSINFO_H
-#include <QtCore/qglobal.h>
-
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
diff --git a/src/corelib/global/qtypeinfo.h b/src/corelib/global/qtypeinfo.h
index a4b12feae3..68df50a2af 100644
--- a/src/corelib/global/qtypeinfo.h
+++ b/src/corelib/global/qtypeinfo.h
@@ -39,11 +39,11 @@
**
****************************************************************************/
+#include <QtCore/qglobal.h>
+
#ifndef QTYPEINFO_H
#define QTYPEINFO_H
-#include <QtCore/qglobal.h>
-
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
diff --git a/src/corelib/global/qtypetraits.h b/src/corelib/global/qtypetraits.h
index 0183f33738..54b48667b4 100644
--- a/src/corelib/global/qtypetraits.h
+++ b/src/corelib/global/qtypetraits.h
@@ -102,11 +102,12 @@
// - Use Qt macros for long long type differences on Windows.
// - Enclose in QtPrivate namespace.
+#include "QtCore/qglobal.h"
+
#ifndef QTYPETRAITS_H
#define QTYPETRAITS_H
#include <utility> // For pair
-#include "QtCore/qglobal.h"
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
diff --git a/src/corelib/io/qabstractfileengine.cpp b/src/corelib/io/qabstractfileengine.cpp
index 1841619400..d7cf7e3f15 100644
--- a/src/corelib/io/qabstractfileengine.cpp
+++ b/src/corelib/io/qabstractfileengine.cpp
@@ -155,7 +155,7 @@ QAbstractFileEngineHandler::~QAbstractFileEngineHandler()
}
/*
- \ìnternal
+ \internal
Handles calls to custom file engine handlers.
*/
diff --git a/src/corelib/io/qprocess_win.cpp b/src/corelib/io/qprocess_win.cpp
index d19ab695ea..bd2ca4c325 100644
--- a/src/corelib/io/qprocess_win.cpp
+++ b/src/corelib/io/qprocess_win.cpp
@@ -82,7 +82,8 @@ static void qt_create_pipe(Q_PIPE *pipe, bool isInputPipe)
forever {
// ### The user must make sure to call qsrand() to make the pipe names less predictable.
// ### Replace the call to qrand() with a secure version, once we have it in Qt.
- swprintf(pipeName, L"\\\\.\\pipe\\qt-%X", qrand());
+ _snwprintf(pipeName, sizeof(pipeName) / sizeof(pipeName[0]),
+ L"\\\\.\\pipe\\qt-%X", qrand());
DWORD dwPipeFlags = PIPE_TYPE_BYTE | PIPE_WAIT;
if (QSysInfo::windowsVersion() >= QSysInfo::WV_VISTA)
diff --git a/src/corelib/io/qstandardpaths.h b/src/corelib/io/qstandardpaths.h
index d9d572db08..cfd2b52e9b 100644
--- a/src/corelib/io/qstandardpaths.h
+++ b/src/corelib/io/qstandardpaths.h
@@ -51,8 +51,6 @@ QT_BEGIN_NAMESPACE
#ifndef QT_NO_STANDARDPATHS
-class QStringList;
-
class Q_CORE_EXPORT QStandardPaths
{
public:
diff --git a/src/corelib/io/qstandardpaths_unix.cpp b/src/corelib/io/qstandardpaths_unix.cpp
index 3fb36589d2..932ae6b6cc 100644
--- a/src/corelib/io/qstandardpaths_unix.cpp
+++ b/src/corelib/io/qstandardpaths_unix.cpp
@@ -127,6 +127,7 @@ QString QStandardPaths::writableLocation(StandardLocation type)
return QString();
}
}
+ qWarning("QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '%s'", qPrintable(xdgRuntimeDir));
}
// "The directory MUST be owned by the user"
QFileInfo fileInfo(xdgRuntimeDir);
diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp
index a7a722bc46..2a439b3a7c 100644
--- a/src/corelib/io/qurl.cpp
+++ b/src/corelib/io/qurl.cpp
@@ -114,7 +114,7 @@
QUrl is capable of detecting many errors in URLs while parsing it or when
components of the URL are set with individual setter methods (like
setScheme(), setHost() or setPath()). If the parsing or setter function is
- succesful, any previously recorded error conditions will be discarded.
+ successful, any previously recorded error conditions will be discarded.
By default, QUrl setter methods operate in QUrl::TolerantMode, which means
they accept some common mistakes and mis-representation of data. An
@@ -363,6 +363,7 @@ public:
enum ErrorCode {
// the high byte of the error code matches the Section
+ // the first item in each value must be the generic "Invalid xxx Error"
InvalidSchemeError = Scheme << 8,
InvalidUserNameError = UserName << 8,
@@ -410,6 +411,9 @@ public:
void clearError();
void setError(ErrorCode errorCode, const QString &source, int supplement = -1);
ErrorCode validityError(QString *source = 0, int *position = 0) const;
+ bool validateComponent(Section section, const QString &input, int begin, int end);
+ bool validateComponent(Section section, const QString &input)
+ { return validateComponent(section, input, 0, uint(input.length())); }
// no QString scheme() const;
void appendAuthority(QString &appendTo, QUrl::FormattingOptions options, Section appendingTo) const;
@@ -895,58 +899,72 @@ inline void QUrlPrivate::setAuthority(const QString &auth, int from, int end, QU
{
sectionIsPresent &= ~Authority;
sectionIsPresent |= Host;
- if (from == end) {
- userName.clear();
- password.clear();
- host.clear();
- port = -1;
- return;
- }
- int userInfoIndex = auth.indexOf(QLatin1Char('@'), from);
- if (uint(userInfoIndex) < uint(end)) {
- setUserInfo(auth, from, userInfoIndex);
- from = userInfoIndex + 1;
- }
+ // we never actually _loop_
+ while (from != end) {
+ int userInfoIndex = auth.indexOf(QLatin1Char('@'), from);
+ if (uint(userInfoIndex) < uint(end)) {
+ setUserInfo(auth, from, userInfoIndex);
+ if (mode == QUrl::StrictMode && !validateComponent(UserInfo, auth, from, userInfoIndex))
+ break;
+ from = userInfoIndex + 1;
+ }
- int colonIndex = auth.lastIndexOf(QLatin1Char(':'), end - 1);
- if (colonIndex < from)
- colonIndex = -1;
+ int colonIndex = auth.lastIndexOf(QLatin1Char(':'), end - 1);
+ if (colonIndex < from)
+ colonIndex = -1;
- if (uint(colonIndex) < uint(end)) {
- if (auth.at(from).unicode() == '[') {
- // check if colonIndex isn't inside the "[...]" part
- int closingBracket = auth.indexOf(QLatin1Char(']'), from);
- if (uint(closingBracket) > uint(colonIndex))
- colonIndex = -1;
+ if (uint(colonIndex) < uint(end)) {
+ if (auth.at(from).unicode() == '[') {
+ // check if colonIndex isn't inside the "[...]" part
+ int closingBracket = auth.indexOf(QLatin1Char(']'), from);
+ if (uint(closingBracket) > uint(colonIndex))
+ colonIndex = -1;
+ }
}
- }
- if (colonIndex == end - 1) {
- // found a colon but no digits after it
- setError(PortEmptyError, auth, colonIndex + 1);
- } else if (uint(colonIndex) < uint(end)) {
- unsigned long x = 0;
- for (int i = colonIndex + 1; i < end; ++i) {
- ushort c = auth.at(i).unicode();
- if (c >= '0' && c <= '9') {
- x *= 10;
- x += c - '0';
+ if (colonIndex == end - 1) {
+ // found a colon but no digits after it
+ setError(PortEmptyError, auth, colonIndex + 1);
+ } else if (uint(colonIndex) < uint(end)) {
+ unsigned long x = 0;
+ for (int i = colonIndex + 1; i < end; ++i) {
+ ushort c = auth.at(i).unicode();
+ if (c >= '0' && c <= '9') {
+ x *= 10;
+ x += c - '0';
+ } else {
+ x = ulong(-1); // x != ushort(x)
+ break;
+ }
+ }
+ if (x == ushort(x)) {
+ port = ushort(x);
} else {
- x = ulong(-1); // x != ushort(x)
- break;
+ setError(InvalidPortError, auth, colonIndex + 1);
+ if (mode == QUrl::StrictMode)
+ break;
}
- }
- if (x == ushort(x)) {
- port = ushort(x);
} else {
- setError(InvalidPortError, auth, colonIndex + 1);
+ port = -1;
+ }
+
+ setHost(auth, from, qMin<uint>(end, colonIndex), mode);
+ if (mode == QUrl::StrictMode && !validateComponent(Host, auth, from, qMin<uint>(end, colonIndex))) {
+ // clear host too
+ sectionIsPresent &= ~Authority;
+ break;
}
- } else {
- port = -1;
- }
- setHost(auth, from, qMin<uint>(end, colonIndex), mode);
+ // success
+ return;
+ }
+ // clear all sections but host
+ sectionIsPresent &= ~Authority | Host;
+ userName.clear();
+ password.clear();
+ host.clear();
+ port = -1;
}
inline void QUrlPrivate::setUserInfo(const QString &userInfo, int from, int end)
@@ -1297,61 +1315,18 @@ inline void QUrlPrivate::parse(const QString &url, QUrl::ParsingMode parsingMode
if (error || parsingMode == QUrl::TolerantMode)
return;
- // The parsing so far was tolerant of errors, so the StrictMode
- // parsing is actually implemented here, as an extra post-check.
- // We only execute it if we haven't found any errors so far.
+ // The parsing so far was partially tolerant of errors, except for the
+ // scheme parser (which is always strict) and the authority (which was
+ // executed in strict mode).
+ // If we haven't found any errors so far, continue the strict-mode parsing
+ // from the path component onwards.
- // What we need to look out for, that the regular parser tolerates:
- // - percent signs not followed by two hex digits
- // - forbidden characters, which should always appear encoded
- // '"' / '<' / '>' / '\' / '^' / '`' / '{' / '|' / '}' / BKSP
- // control characters
- // - delimiters not allowed in certain positions
- // . scheme: parser is already strict
- // . user info: gen-delims (except for ':') disallowed
- // . host: parser is stricter than the standard
- // . port: parser is stricter than the standard
- // . path: all delimiters allowed
- // . fragment: all delimiters allowed
- // . query: all delimiters allowed
- // We would only need to check the user-info. However, the presence
- // of the disallowed gen-delims changes the parsing, so we don't
- // actually need to do anything
- static const char forbidden[] = "\"<>\\^`{|}\x7F";
- for (uint i = 0; i < uint(len); ++i) {
- register uint uc = data[i];
- if (uc >= 0x80)
- continue;
-
- if ((uc == '%' && (uint(len) < i + 2 || !isHex(data[i + 1]) || !isHex(data[i + 2])))
- || uc <= 0x20 || strchr(forbidden, uc)) {
- // found an error
- ErrorCode errorCode;
-
- // where are we?
- if (i > uint(hash)) {
- errorCode = InvalidFragmentError;
- } else if (i > uint(question)) {
- errorCode = InvalidQueryError;
- } else if (i > uint(pathStart)) {
- // pathStart is never -1
- errorCode = InvalidPathError;
- } else {
- // It must be in the authority, since the scheme is strict.
- // Since the port and hostname parsers are also strict,
- // the error can only have happened in the user info.
- int pos = url.indexOf(QLatin1Char(':'), hierStart);
- if (i > uint(pos)) {
- errorCode = InvalidPasswordError;
- } else {
- errorCode = InvalidUserNameError;
- }
- }
-
- setError(errorCode, url, i);
- return;
- }
- }
+ if (!validateComponent(Path, url, pathStart, hierEnd))
+ return;
+ if (uint(question) < uint(hash) && !validateComponent(Query, url, question + 1, qMin<uint>(hash, len)))
+ return;
+ if (hash != -1)
+ validateComponent(Fragment, url, hash + 1, len);
}
/*
@@ -1519,6 +1494,67 @@ inline QUrlPrivate::ErrorCode QUrlPrivate::validityError(QString *source, int *p
return NoError;
}
+bool QUrlPrivate::validateComponent(QUrlPrivate::Section section, const QString &input,
+ int begin, int end)
+{
+ // What we need to look out for, that the regular parser tolerates:
+ // - percent signs not followed by two hex digits
+ // - forbidden characters, which should always appear encoded
+ // '"' / '<' / '>' / '\' / '^' / '`' / '{' / '|' / '}' / BKSP
+ // control characters
+ // - delimiters not allowed in certain positions
+ // . scheme: parser is already strict
+ // . user info: gen-delims except ":" disallowed ("/" / "?" / "#" / "[" / "]" / "@")
+ // . host: parser is stricter than the standard
+ // . port: parser is stricter than the standard
+ // . path: all delimiters allowed
+ // . fragment: all delimiters allowed
+ // . query: all delimiters allowed
+ static const char forbidden[] = "\"<>\\^`{|}\x7F";
+ static const char forbiddenUserInfo[] = ":/?#[]@";
+
+ Q_ASSERT(section != Authority && section != Hierarchy && section != FullUrl);
+
+ const ushort *const data = reinterpret_cast<const ushort *>(input.constData());
+ for (uint i = uint(begin); i < uint(end); ++i) {
+ register uint uc = data[i];
+ if (uc >= 0x80)
+ continue;
+
+ bool error = false;
+ if ((uc == '%' && (uint(end) < i + 2 || !isHex(data[i + 1]) || !isHex(data[i + 2])))
+ || uc <= 0x20 || strchr(forbidden, uc)) {
+ // found an error
+ error = true;
+ } else if (section & UserInfo) {
+ if (section == UserInfo && strchr(forbiddenUserInfo + 1, uc))
+ error = true;
+ else if (section != UserInfo && strchr(forbiddenUserInfo, uc))
+ error = true;
+ }
+
+ if (!error)
+ continue;
+
+ ErrorCode errorCode = ErrorCode(int(section) << 8);
+ if (section == UserInfo) {
+ // is it the user name or the password?
+ errorCode = InvalidUserNameError;
+ for (uint j = uint(begin); j < i; ++j)
+ if (data[j] == ':') {
+ errorCode = InvalidPasswordError;
+ break;
+ }
+ }
+
+ setError(errorCode, input, i);
+ return false;
+ }
+
+ // no errors
+ return true;
+}
+
#if 0
inline void QUrlPrivate::validate() const
{
@@ -1954,6 +1990,10 @@ void QUrl::setUserInfo(const QString &userInfo, ParsingMode mode)
// QUrlPrivate::setUserInfo cleared almost everything
// but it leaves the UserName bit set
d->sectionIsPresent &= ~QUrlPrivate::UserInfo;
+ } else if (mode == StrictMode && !d->validateComponent(QUrlPrivate::UserInfo, userInfo)) {
+ d->sectionIsPresent &= ~QUrlPrivate::UserInfo;
+ d->userName.clear();
+ d->password.clear();
}
}
@@ -2010,10 +2050,11 @@ void QUrl::setUserName(const QString &userName, ParsingMode mode)
mode = TolerantMode;
}
-
d->setUserName(data, 0, data.length());
if (userName.isNull())
d->sectionIsPresent &= ~QUrlPrivate::UserName;
+ else if (mode == StrictMode && !d->validateComponent(QUrlPrivate::UserName, userName))
+ d->userName.clear();
}
/*!
@@ -2105,6 +2146,8 @@ void QUrl::setPassword(const QString &password, ParsingMode mode)
d->setPassword(data, 0, data.length());
if (password.isNull())
d->sectionIsPresent &= ~QUrlPrivate::Password;
+ else if (mode == StrictMode && !d->validateComponent(QUrlPrivate::Password, password))
+ d->password.clear();
}
/*!
@@ -2354,6 +2397,9 @@ void QUrl::setPath(const QString &path, ParsingMode mode)
// optimized out, since there is no path delimiter
// if (path.isNull())
// d->sectionIsPresent &= ~QUrlPrivate::Path;
+// else
+ if (mode == StrictMode && !d->validateComponent(QUrlPrivate::Path, path))
+ d->path.clear();
}
/*!
@@ -2474,6 +2520,8 @@ void QUrl::setQuery(const QString &query, ParsingMode mode)
d->setQuery(data, 0, data.length());
if (query.isNull())
d->sectionIsPresent &= ~QUrlPrivate::Query;
+ else if (mode == StrictMode && !d->validateComponent(QUrlPrivate::Query, query))
+ d->query.clear();
}
/*!
@@ -2835,6 +2883,8 @@ void QUrl::setFragment(const QString &fragment, ParsingMode mode)
d->setFragment(data, 0, data.length());
if (fragment.isNull())
d->sectionIsPresent &= ~QUrlPrivate::Fragment;
+ else if (mode == StrictMode && !d->validateComponent(QUrlPrivate::Fragment, fragment))
+ d->fragment.clear();
}
/*!
@@ -3812,7 +3862,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\list
\li qt.nokia.com becomes http://qt.nokia.com
- \li ftp.qt.nokia.com becomes ftp://ftp.qt.nokia.com
+ \li ftp.qt-project.org becomes ftp://ftp.qt-project.org
\li hostname becomes http://hostname
\li /home/user/test.html becomes file:///home/user/test.html
\endlist
@@ -3828,12 +3878,11 @@ QUrl QUrl::fromUserInput(const QString &userInput)
QUrl url = QUrl(trimmedString, QUrl::TolerantMode);
QUrl urlPrepended = QUrl(QStringLiteral("http://") + trimmedString, QUrl::TolerantMode);
- // Check the most common case of a valid url with scheme and host
+ // Check the most common case of a valid url with a scheme
// We check if the port would be valid by adding the scheme to handle the case host:port
// where the host would be interpretted as the scheme
if (url.isValid()
&& !url.scheme().isEmpty()
- && (!url.host().isEmpty() || !url.path().isEmpty())
&& urlPrepended.port() == -1)
return adjustFtpPath(url);
diff --git a/src/corelib/itemmodels/qabstractitemmodel.cpp b/src/corelib/itemmodels/qabstractitemmodel.cpp
index e2361e11f9..db1db9aaed 100644
--- a/src/corelib/itemmodels/qabstractitemmodel.cpp
+++ b/src/corelib/itemmodels/qabstractitemmodel.cpp
@@ -1437,7 +1437,7 @@ QAbstractItemModel::~QAbstractItemModel()
For example:
- \snippet itemviews/simpledommodel/dommodel.cpp 2
+ \snippet ../widgets/itemviews/simpledommodel/dommodel.cpp 2
\note When implementing a table based model, columnCount() should return 0
when the parent is valid.
diff --git a/src/corelib/itemmodels/qabstractproxymodel.cpp b/src/corelib/itemmodels/qabstractproxymodel.cpp
index 715a186b97..0175a0f2fa 100644
--- a/src/corelib/itemmodels/qabstractproxymodel.cpp
+++ b/src/corelib/itemmodels/qabstractproxymodel.cpp
@@ -124,6 +124,10 @@ QAbstractProxyModel::~QAbstractProxyModel()
/*!
Sets the given \a sourceModel to be processed by the proxy model.
+
+ Subclasses should call beginResetModel() at the beginning of the method,
+ disconnect from the old model, call this method, connect to the new model,
+ and call endResetModel().
*/
void QAbstractProxyModel::setSourceModel(QAbstractItemModel *sourceModel)
{
diff --git a/src/corelib/itemmodels/qsortfilterproxymodel.cpp b/src/corelib/itemmodels/qsortfilterproxymodel.cpp
index 6ab32a9366..857054558f 100644
--- a/src/corelib/itemmodels/qsortfilterproxymodel.cpp
+++ b/src/corelib/itemmodels/qsortfilterproxymodel.cpp
@@ -1616,7 +1616,7 @@ void QSortFilterProxyModelPrivate::_q_sourceColumnsMoved(
QSortFilterProxyModel and reimplementing lessThan(), which is
used to compare items. For example:
- \snippet itemviews/customsortfiltermodel/mysortfilterproxymodel.cpp 5
+ \snippet ../widgets/itemviews/customsortfiltermodel/mysortfilterproxymodel.cpp 5
(This code snippet comes from the
\l{itemviews/customsortfiltermodel}{Custom Sort/Filter Model}
@@ -1659,7 +1659,7 @@ void QSortFilterProxyModelPrivate::_q_sourceColumnsMoved(
the \l{QSortFilterProxyModel::filterKeyColumn}{filterKeyColumn} property
and performs filtering on columns 0, 1, and 2:
- \snippet itemviews/customsortfiltermodel/mysortfilterproxymodel.cpp 3
+ \snippet ../widgets/itemviews/customsortfiltermodel/mysortfilterproxymodel.cpp 3
(This code snippet comes from the
\l{itemviews/customsortfiltermodel}{Custom Sort/Filter Model}
diff --git a/src/corelib/json/qjsonarray.cpp b/src/corelib/json/qjsonarray.cpp
index 0cd436a3b9..a669a5533d 100644
--- a/src/corelib/json/qjsonarray.cpp
+++ b/src/corelib/json/qjsonarray.cpp
@@ -535,7 +535,7 @@ bool QJsonArray::operator!=(const QJsonArray &other) const
/*! \fn QJsonArray::iterator QJsonArray::begin()
- Returns an \l{STL-style iterator} pointing to the first item in
+ Returns an \l{STL-style iterators}{STL-style iterator} pointing to the first item in
the array.
\sa constBegin(), end()
@@ -548,7 +548,7 @@ bool QJsonArray::operator!=(const QJsonArray &other) const
/*! \fn QJsonArray::const_iterator QJsonArray::constBegin() const
- Returns a const \l{STL-style iterator} pointing to the first item
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first item
in the array.
\sa begin(), constEnd()
@@ -556,7 +556,7 @@ bool QJsonArray::operator!=(const QJsonArray &other) const
/*! \fn QJsonArray::iterator QJsonArray::end()
- Returns an \l{STL-style iterator} pointing to the imaginary item
+ Returns an \l{STL-style iterators}{STL-style iterator} pointing to the imaginary item
after the last item in the array.
\sa begin(), constEnd()
@@ -569,7 +569,7 @@ bool QJsonArray::operator!=(const QJsonArray &other) const
/*! \fn QJsonArray::const_iterator QJsonArray::constEnd() const
- Returns a const \l{STL-style iterator} pointing to the imaginary
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary
item after the last item in the array.
\sa constBegin(), end()
diff --git a/src/corelib/json/qjsonobject.cpp b/src/corelib/json/qjsonobject.cpp
index 728bbbd0ec..1bdd872e78 100644
--- a/src/corelib/json/qjsonobject.cpp
+++ b/src/corelib/json/qjsonobject.cpp
@@ -390,13 +390,14 @@ QJsonValue QJsonObject::take(const QString &key)
if (!keyExists)
return QJsonValue(QJsonValue::Undefined);
- QJsonPrivate::Entry *e = o->entryAt(index);
+ QJsonValue v(d, o, o->entryAt(index)->value);
+ detach();
o->removeItems(index, 1);
++d->compactionCounter;
if (d->compactionCounter > 32u && d->compactionCounter >= unsigned(o->length) / 2u)
compact();
- return QJsonValue(d, o, e->value);
+ return v;
}
/*!
@@ -525,7 +526,7 @@ QJsonObject::const_iterator QJsonObject::constFind(const QString &key) const
/*! \fn QJsonObject::iterator QJsonObject::begin()
- Returns an \l{STL-style iterator} pointing to the first item in
+ Returns an \l{STL-style iterators}{STL-style iterator} pointing to the first item in
the object.
\sa constBegin(), end()
@@ -538,7 +539,7 @@ QJsonObject::const_iterator QJsonObject::constFind(const QString &key) const
/*! \fn QJsonObject::const_iterator QJsonObject::constBegin() const
- Returns a const \l{STL-style iterator} pointing to the first item
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first item
in the object.
\sa begin(), constEnd()
@@ -546,7 +547,7 @@ QJsonObject::const_iterator QJsonObject::constFind(const QString &key) const
/*! \fn QJsonObject::iterator QJsonObject::end()
- Returns an \l{STL-style iterator} pointing to the imaginary item
+ Returns an \l{STL-style iterators}{STL-style iterator} pointing to the imaginary item
after the last item in the object.
\sa begin(), constEnd()
@@ -559,7 +560,7 @@ QJsonObject::const_iterator QJsonObject::constFind(const QString &key) const
/*! \fn QJsonObject::const_iterator QJsonObject::constEnd() const
- Returns a const \l{STL-style iterator} pointing to the imaginary
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary
item after the last item in the object.
\sa constBegin(), end()
diff --git a/src/corelib/kernel/qeventdispatcher_blackberry.cpp b/src/corelib/kernel/qeventdispatcher_blackberry.cpp
index 2252b73ad4..69b4a8b172 100644
--- a/src/corelib/kernel/qeventdispatcher_blackberry.cpp
+++ b/src/corelib/kernel/qeventdispatcher_blackberry.cpp
@@ -132,7 +132,7 @@ static int bpsIOHandler(int fd, int io_events, void *data)
}
// post unblock event to our thread; in this callback the bps channel is
- // guarenteed to be the same that was active when bps_add_fd was called
+ // guaranteed to be the same that was active when bps_add_fd was called
result = bps_push_event(event);
if (result != BPS_SUCCESS) {
qWarning("QEventDispatcherBlackberryPrivate::QEventDispatcherBlackberry: bps_push_event() failed");
diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h
index 06d325f383..09c641e4a3 100644
--- a/src/corelib/kernel/qmetatype.h
+++ b/src/corelib/kernel/qmetatype.h
@@ -252,7 +252,8 @@ public:
IsEnumeration = 0x10,
SharedPointerToQObject = 0x20,
WeakPointerToQObject = 0x40,
- TrackingPointerToQObject = 0x80
+ TrackingPointerToQObject = 0x80,
+ WasDeclaredAsMetaType = 0x100
};
Q_DECLARE_FLAGS(TypeFlags, TypeFlag)
@@ -563,12 +564,19 @@ namespace QtPrivate {
| (Q_IS_ENUM(T) ? QMetaType::IsEnumeration : 0)
};
};
+
+ template<typename T, bool defined>
+ struct MetaTypeDefinedHelper
+ {
+ enum DefinedType { Defined = defined };
+ };
}
template <typename T>
int qRegisterNormalizedMetaType(const QT_PREPEND_NAMESPACE(QByteArray) &normalizedTypeName
#ifndef qdoc
, T * dummy = 0
+ , typename QtPrivate::MetaTypeDefinedHelper<T, QMetaTypeId2<T>::Defined && !QMetaTypeId2<T>::IsBuiltIn>::DefinedType defined = QtPrivate::MetaTypeDefinedHelper<T, QMetaTypeId2<T>::Defined && !QMetaTypeId2<T>::IsBuiltIn>::Defined
#endif
)
{
@@ -580,6 +588,10 @@ int qRegisterNormalizedMetaType(const QT_PREPEND_NAMESPACE(QByteArray) &normaliz
return QMetaType::registerNormalizedTypedef(normalizedTypeName, typedefOf);
QMetaType::TypeFlags flags(QtPrivate::QMetaTypeTypeFlags<T>::Flags);
+
+ if (defined)
+ flags |= QMetaType::WasDeclaredAsMetaType;
+
return QMetaType::registerNormalizedType(normalizedTypeName,
QtMetaTypePrivate::QMetaTypeFunctionHelper<T>::Delete,
QtMetaTypePrivate::QMetaTypeFunctionHelper<T>::Create,
@@ -594,6 +606,7 @@ template <typename T>
int qRegisterMetaType(const char *typeName
#ifndef qdoc
, T * dummy = 0
+ , typename QtPrivate::MetaTypeDefinedHelper<T, QMetaTypeId2<T>::Defined && !QMetaTypeId2<T>::IsBuiltIn>::DefinedType defined = QtPrivate::MetaTypeDefinedHelper<T, QMetaTypeId2<T>::Defined && !QMetaTypeId2<T>::IsBuiltIn>::Defined
#endif
)
{
@@ -602,7 +615,7 @@ int qRegisterMetaType(const char *typeName
#else
QT_PREPEND_NAMESPACE(QByteArray) normalizedTypeName = QMetaObject::normalizedType(typeName);
#endif
- return qRegisterNormalizedMetaType<T>(normalizedTypeName, dummy);
+ return qRegisterNormalizedMetaType<T>(normalizedTypeName, dummy, defined);
}
#ifndef QT_NO_DATASTREAM
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index 9d0854f3a9..9091b5579e 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -1945,7 +1945,7 @@ void QObject::deleteLater()
is available.
Example:
- \snippet mainwindows/sdi/mainwindow.cpp implicit tr context
+ \snippet ../widgets/mainwindows/sdi/mainwindow.cpp implicit tr context
\dots
If the same \a sourceText is used in different roles within the
@@ -3864,9 +3864,9 @@ QDebug operator<<(QDebug dbg, const QObject *o) {
Example:
- \snippet tools/plugandpaintplugins/basictools/basictoolsplugin.h 1
+ \snippet ../widgets/tools/plugandpaintplugins/basictools/basictoolsplugin.h 1
\dots
- \snippet tools/plugandpaintplugins/basictools/basictoolsplugin.h 3
+ \snippet ../widgets/tools/plugandpaintplugins/basictools/basictoolsplugin.h 3
See the \l{tools/plugandpaintplugins/basictools}{Plug & Paint
Basic Tools} example for details.
@@ -4293,6 +4293,16 @@ bool QObject::disconnect(const QMetaObject::Connection &connection)
if (c->next)
c->next->prev = c->prev;
c->receiver = 0;
+
+ // destroy the QSlotObject, if possible
+ if (c->isSlotObject) {
+ c->slotObj->destroyIfLastRef();
+ c->isSlotObject = false;
+ }
+
+ const_cast<QMetaObject::Connection &>(connection).d_ptr = 0;
+ c->deref(); // has been removed from the QMetaObject::Connection object
+
// disconnectNotify() not called (the signal index is unknown).
return true;
diff --git a/src/corelib/kernel/qtimer.cpp b/src/corelib/kernel/qtimer.cpp
index 9dea666363..9126d7ea17 100644
--- a/src/corelib/kernel/qtimer.cpp
+++ b/src/corelib/kernel/qtimer.cpp
@@ -62,9 +62,9 @@ QT_BEGIN_NAMESPACE
Example for a one second (1000 millisecond) timer (from the
\l{widgets/analogclock}{Analog Clock} example):
- \snippet widgets/analogclock/analogclock.cpp 4
- \snippet widgets/analogclock/analogclock.cpp 5
- \snippet widgets/analogclock/analogclock.cpp 6
+ \snippet ../widgets/widgets/analogclock/analogclock.cpp 4
+ \snippet ../widgets/widgets/analogclock/analogclock.cpp 5
+ \snippet ../widgets/widgets/analogclock/analogclock.cpp 6
From then on, the \c update() slot is called every second.
diff --git a/src/corelib/kernel/qtranslator.cpp b/src/corelib/kernel/qtranslator.cpp
index f934202cf6..58e4f202d5 100644
--- a/src/corelib/kernel/qtranslator.cpp
+++ b/src/corelib/kernel/qtranslator.cpp
@@ -343,10 +343,10 @@ public:
The most common use of QTranslator is to: load a translation
file, install it using QCoreApplication::installTranslator(), and use
- it via QObject::tr(). Here's the \c main() function from the
- \l{linguist/hellotr}{Hello tr()} example:
+ it via QObject::tr(). Here's an example \c main() function using the
+ QTranslator:
- \snippet linguist/hellotr/main.cpp 2
+ \snippet hellotrmain.cpp 0
Note that the translator must be created \e before the
application's widgets.
diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp
index 9ff9d10bf0..26deeba6a2 100644
--- a/src/corelib/kernel/qvariant.cpp
+++ b/src/corelib/kernel/qvariant.cpp
@@ -341,11 +341,9 @@ static bool convert(const QVariant::Private *d, int t, void *result, bool *ok)
*str = v_cast<QUrl>(d)->toString();
break;
#endif
-#ifndef QT_NO_QUUID_STRING
case QVariant::Uuid:
*str = v_cast<QUuid>(d)->toString();
break;
-#endif
default:
return false;
}
@@ -722,11 +720,9 @@ static bool convert(const QVariant::Private *d, int t, void *result, bool *ok)
#endif
case QVariant::Uuid:
switch (d->type) {
-#ifndef QT_NO_QUUID_STRING
case QVariant::String:
*static_cast<QUuid *>(result) = QUuid(*v_cast<QString>(d));
break;
-#endif
default:
return false;
}
diff --git a/src/corelib/kernel/qwineventnotifier.h b/src/corelib/kernel/qwineventnotifier.h
index d5e4d0f7e3..291d953e58 100644
--- a/src/corelib/kernel/qwineventnotifier.h
+++ b/src/corelib/kernel/qwineventnotifier.h
@@ -42,12 +42,9 @@
#ifndef QWINEVENTNOTIFIER_H
#define QWINEVENTNOTIFIER_H
-#if 0
-// inform syncqt
-#pragma qt_no_master_include
-#endif
-
#include "QtCore/qobject.h"
+
+#ifdef Q_OS_WIN
#include "QtCore/qt_windows.h"
QT_BEGIN_HEADER
@@ -88,4 +85,6 @@ QT_END_NAMESPACE
QT_END_HEADER
+#endif // Q_OS_WIN
+
#endif // QWINEVENTNOTIFIER_H
diff --git a/src/corelib/mimetypes/qmimedatabase.cpp b/src/corelib/mimetypes/qmimedatabase.cpp
index 5acc290475..f3705476c3 100644
--- a/src/corelib/mimetypes/qmimedatabase.cpp
+++ b/src/corelib/mimetypes/qmimedatabase.cpp
@@ -604,18 +604,4 @@ QList<QMimeType> QMimeDatabase::allMimeTypes() const
\value MatchContent The file content is used to look for a match
*/
-/*!
- \fn QMimeType QMimeDatabase::mimeTypeForNameAndData(const QString &fileName, QIODevice *device) const
- \obsolete
-
- This function is replaced by \l mimeTypeForFileNameAndData()
-*/
-
-/*!
- \fn QMimeType QMimeDatabase::mimeTypeForNameAndData(const QString &fileName, const QByteArray &data) const
- \obsolete
-
- This function is replaced by \l mimeTypeForFileNameAndData()
-*/
-
QT_END_NAMESPACE
diff --git a/src/corelib/plugin/qfactoryloader.cpp b/src/corelib/plugin/qfactoryloader.cpp
index 75652b0902..aeb78e88b4 100644
--- a/src/corelib/plugin/qfactoryloader.cpp
+++ b/src/corelib/plugin/qfactoryloader.cpp
@@ -126,9 +126,30 @@ void QFactoryLoader::update()
QStringList plugins = QDir(path).entryList(QDir::Files);
QLibraryPrivate *library = 0;
+
+#ifdef Q_OS_MAC
+ // Loading both the debug and release version of the cocoa plugins causes the objective-c runtime
+ // to print "duplicate class definitions" warnings. Detect if QFactoryLoader is about to load both,
+ // skip one of them (below).
+ //
+ // ### FIXME find a proper solution
+ //
+ const bool isLoadingDebugAndReleaseCocoa = plugins.contains("libqcocoa_debug.dylib") && plugins.contains("libqcocoa.dylib");
+#endif
for (int j = 0; j < plugins.count(); ++j) {
QString fileName = QDir::cleanPath(path + QLatin1Char('/') + plugins.at(j));
+#ifdef Q_OS_MAC
+ if (isLoadingDebugAndReleaseCocoa) {
+#ifdef QT_DEBUG
+ if (fileName.contains(QStringLiteral("libqcocoa.dylib")))
+ continue; // Skip release plugin in debug mode
+#else
+ if (fileName.contains(QStringLiteral("libqcocoa_debug.dylib")))
+ continue; // Skip debug plugin in release mode
+#endif
+ }
+#endif
if (qt_debug_component()) {
qDebug() << "QFactoryLoader::QFactoryLoader() looking at" << fileName;
}
diff --git a/src/corelib/plugin/qlibrary.cpp b/src/corelib/plugin/qlibrary.cpp
index 26692ca3d4..8d2e890d87 100644
--- a/src/corelib/plugin/qlibrary.cpp
+++ b/src/corelib/plugin/qlibrary.cpp
@@ -73,7 +73,7 @@ QT_BEGIN_NAMESPACE
# define QLIBRARY_AS_DEBUG true
#endif
-#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
+#if defined(Q_OS_UNIX)
// We don't use separate debug and release libs on UNIX, so we want
// to allow loading plugins, regardless of how they were built.
# define QT_NO_DEBUG_PLUGIN_CHECK
diff --git a/src/corelib/plugin/qlibrary_p.h b/src/corelib/plugin/qlibrary_p.h
index 337c43acb9..8465d5cf06 100644
--- a/src/corelib/plugin/qlibrary_p.h
+++ b/src/corelib/plugin/qlibrary_p.h
@@ -92,6 +92,8 @@ public:
QFunctionPointer resolve(const char *);
static QLibraryPrivate *findOrCreate(const QString &fileName, const QString &version = QString());
+ static QStringList suffixes_sys(const QString &fullVersion);
+ static QStringList prefixes_sys();
static QVector<QStaticPlugin> staticPlugins();
diff --git a/src/corelib/plugin/qlibrary_unix.cpp b/src/corelib/plugin/qlibrary_unix.cpp
index 2ef6f80466..35d8197306 100644
--- a/src/corelib/plugin/qlibrary_unix.cpp
+++ b/src/corelib/plugin/qlibrary_unix.cpp
@@ -80,6 +80,60 @@ static QString qdlerror()
return err ? QLatin1Char('(') + QString::fromLocal8Bit(err) + QLatin1Char(')'): QString();
}
+QStringList QLibraryPrivate::suffixes_sys(const QString& fullVersion)
+{
+ QStringList suffixes;
+#if defined(Q_OS_HPUX)
+ // according to
+ // http://docs.hp.com/en/B2355-90968/linkerdifferencesiapa.htm
+
+ // In PA-RISC (PA-32 and PA-64) shared libraries are suffixed
+ // with .sl. In IPF (32-bit and 64-bit), the shared libraries
+ // are suffixed with .so. For compatibility, the IPF linker
+ // also supports the .sl suffix.
+
+ // But since we don't know if we are built on HPUX or HPUXi,
+ // we support both .sl (and .<version>) and .so suffixes but
+ // .so is preferred.
+# if defined(__ia64)
+ if (!fullVersion.isEmpty()) {
+ suffixes << QString::fromLatin1(".so.%1").arg(fullVersion);
+ } else {
+ suffixes << QLatin1String(".so");
+ }
+# endif
+ if (!fullVersion.isEmpty()) {
+ suffixes << QString::fromLatin1(".sl.%1").arg(fullVersion);
+ suffixes << QString::fromLatin1(".%1").arg(fullVersion);
+ } else {
+ suffixes << QLatin1String(".sl");
+ }
+#elif defined(Q_OS_AIX)
+ suffixes << ".a";
+
+#else
+ if (!fullVersion.isEmpty()) {
+ suffixes << QString::fromLatin1(".so.%1").arg(fullVersion);
+ } else {
+ suffixes << QLatin1String(".so");
+ }
+#endif
+# ifdef Q_OS_MAC
+ if (!fullVersion.isEmpty()) {
+ suffixes << QString::fromLatin1(".%1.bundle").arg(fullVersion);
+ suffixes << QString::fromLatin1(".%1.dylib").arg(fullVersion);
+ } else {
+ suffixes << QLatin1String(".bundle") << QLatin1String(".dylib");
+ }
+#endif
+ return suffixes;
+}
+
+QStringList QLibraryPrivate::prefixes_sys()
+{
+ return QStringList() << QLatin1String("lib");
+}
+
bool QLibraryPrivate::load_sys()
{
QString attempt;
@@ -96,50 +150,8 @@ bool QLibraryPrivate::load_sys()
QStringList suffixes;
QStringList prefixes;
if (pluginState != IsAPlugin) {
- prefixes << QLatin1String("lib");
-#if defined(Q_OS_HPUX)
- // according to
- // http://docs.hp.com/en/B2355-90968/linkerdifferencesiapa.htm
-
- // In PA-RISC (PA-32 and PA-64) shared libraries are suffixed
- // with .sl. In IPF (32-bit and 64-bit), the shared libraries
- // are suffixed with .so. For compatibility, the IPF linker
- // also supports the .sl suffix.
-
- // But since we don't know if we are built on HPUX or HPUXi,
- // we support both .sl (and .<version>) and .so suffixes but
- // .so is preferred.
-# if defined(__ia64)
- if (!fullVersion.isEmpty()) {
- suffixes << QString::fromLatin1(".so.%1").arg(fullVersion);
- } else {
- suffixes << QLatin1String(".so");
- }
-# endif
- if (!fullVersion.isEmpty()) {
- suffixes << QString::fromLatin1(".sl.%1").arg(fullVersion);
- suffixes << QString::fromLatin1(".%1").arg(fullVersion);
- } else {
- suffixes << QLatin1String(".sl");
- }
-#elif defined(Q_OS_AIX)
- suffixes << ".a";
-
-#else
- if (!fullVersion.isEmpty()) {
- suffixes << QString::fromLatin1(".so.%1").arg(fullVersion);
- } else {
- suffixes << QLatin1String(".so");
- }
-#endif
-# ifdef Q_OS_MAC
- if (!fullVersion.isEmpty()) {
- suffixes << QString::fromLatin1(".%1.bundle").arg(fullVersion);
- suffixes << QString::fromLatin1(".%1.dylib").arg(fullVersion);
- } else {
- suffixes << QLatin1String(".bundle") << QLatin1String(".dylib");
- }
-#endif
+ prefixes = prefixes_sys();
+ suffixes = suffixes_sys(fullVersion);
}
int dlFlags = 0;
#if defined(QT_HPUX_LD)
diff --git a/src/corelib/plugin/qlibrary_win.cpp b/src/corelib/plugin/qlibrary_win.cpp
index 27796aedc1..ef3816a804 100644
--- a/src/corelib/plugin/qlibrary_win.cpp
+++ b/src/corelib/plugin/qlibrary_win.cpp
@@ -57,6 +57,17 @@ QT_BEGIN_NAMESPACE
extern QString qt_error_string(int code);
+QStringList QLibraryPrivate::suffixes_sys(const QString& fullVersion)
+{
+ Q_UNUSED(fullVersion);
+ return QStringList() << ".dll";
+}
+
+QStringList QLibraryPrivate::prefixes_sys()
+{
+ return QStringList();
+}
+
bool QLibraryPrivate::load_sys()
{
//avoid 'Bad Image' message box
diff --git a/src/corelib/plugin/qpluginloader.cpp b/src/corelib/plugin/qpluginloader.cpp
index 31d9fda858..c16a340dbe 100644
--- a/src/corelib/plugin/qpluginloader.cpp
+++ b/src/corelib/plugin/qpluginloader.cpp
@@ -42,6 +42,7 @@
#include "qplatformdefs.h"
#include "qplugin.h"
+#include "qcoreapplication.h"
#include "qpluginloader.h"
#include <qfileinfo.h>
#include "qlibrary_p.h"
@@ -250,14 +251,52 @@ bool QPluginLoader::isLoaded() const
return d && d->pHnd && d->instance;
}
+static QString locatePlugin(const QString& fileName)
+{
+ QStringList prefixes = QLibraryPrivate::prefixes_sys();
+ prefixes.prepend(QString());
+ QStringList suffixes = QLibraryPrivate::suffixes_sys(QString());
+ suffixes.prepend(QString());
+
+ // Split up "subdir/filename"
+ const int slash = fileName.lastIndexOf('/');
+ const QString baseName = fileName.mid(slash + 1);
+ const QString basePath = fileName.left(slash + 1); // keep the '/'
+
+ const bool debug = qt_debug_component();
+
+ QStringList paths = QCoreApplication::libraryPaths();
+ paths.prepend(QStringLiteral("./")); // search in current dir first
+ foreach (const QString &path, paths) {
+ foreach (const QString &prefix, prefixes) {
+ foreach (const QString &suffix, suffixes) {
+ const QString fn = path + QLatin1Char('/') + basePath + prefix + baseName + suffix;
+ if (debug)
+ qDebug() << "Trying..." << fn;
+ if (QFileInfo(fn).isFile())
+ return fn;
+ }
+ }
+ }
+ if (debug)
+ qDebug() << fileName << "not found";
+ return QString();
+}
+
/*!
\property QPluginLoader::fileName
\brief the file name of the plugin
- To be loadable, the file's suffix must be a valid suffix for a
- loadable library in accordance with the platform, e.g. \c .so on
- Unix, \c .dylib on Mac OS X, and \c .dll on Windows. The suffix
- can be verified with QLibrary::isLibrary().
+ We recommend omitting the file's suffix in the file name, since
+ QPluginLoader will automatically look for the file with the appropriate
+ suffix (see QLibrary::isLibrary()).
+
+ When loading the plugin, QPluginLoader searches in the current directory and
+ in all plugin locations specified by QCoreApplication::libraryPaths(),
+ unless the file name has an absolute path. After loading the plugin
+ successfully, fileName() returns the fully-qualified file name of
+ the plugin, including the full path to the plugin if one was given
+ in the constructor or passed to setFileName().
If the file name does not exist, it will not be set. This property
will then contain an empty string.
@@ -277,7 +316,12 @@ void QPluginLoader::setFileName(const QString &fileName)
did_load = false;
}
- QString fn = QFileInfo(fileName).canonicalFilePath();
+ QFileInfo fi(fileName);
+ QString fn;
+ if (fi.isAbsolute())
+ fn = fi.canonicalFilePath();
+ else
+ fn = locatePlugin(fileName);
d = QLibraryPrivate::findOrCreate(fn);
d->loadHints = lh;
diff --git a/src/corelib/plugin/quuid.cpp b/src/corelib/plugin/quuid.cpp
index c1ebc57cf6..f9a9666de3 100644
--- a/src/corelib/plugin/quuid.cpp
+++ b/src/corelib/plugin/quuid.cpp
@@ -50,7 +50,6 @@
#endif
QT_BEGIN_NAMESPACE
-#ifndef QT_NO_QUUID_STRING
template <class Char, class Integral>
void _q_toHex(Char *&dst, Integral value)
{
@@ -134,7 +133,6 @@ bool _q_uuidFromHex(const Char *&src, uint &d1, ushort &d2, ushort &d3, uchar (&
return true;
}
-#endif
#ifndef QT_BOOTSTRAPPED
static QUuid createFromName(const QUuid &ns, const QByteArray &baseData, QCryptographicHash::Algorithm algorithm, int version)
@@ -341,7 +339,6 @@ static QUuid createFromName(const QUuid &ns, const QByteArray &baseData, QCrypto
\snippet code/src_corelib_plugin_quuid.cpp 0
*/
-#ifndef QT_NO_QUUID_STRING
/*!
Creates a QUuid object from the string \a text, which must be
formatted as five hex fields separated by '-', e.g.,
@@ -422,8 +419,6 @@ QUuid::QUuid(const QByteArray &text)
}
}
-#endif
-
/*!
\since 5.0
\fn QUuid QUuid::createUuidV3(const QUuid &ns, const QByteArray &baseData);
@@ -527,7 +522,7 @@ QUuid QUuid::fromRfc4122(const QByteArray &bytes)
Returns true if this QUuid and the \a other QUuid are different;
otherwise returns false.
*/
-#ifndef QT_NO_QUUID_STRING
+
/*!
Returns the string representation of this QUuid. The string is
formatted as five hex fields separated by '-' and enclosed in
@@ -617,7 +612,6 @@ QByteArray QUuid::toByteArray() const
return result;
}
-#endif
/*!
Returns the binary representation of this QUuid. The byte array is in big
@@ -1016,12 +1010,7 @@ QUuid QUuid::createUuid()
*/
QDebug operator<<(QDebug dbg, const QUuid &id)
{
-#ifndef QT_NO_QUUID_STRING
dbg.nospace() << "QUuid(" << id.toString() << ')';
-#else
- Q_UNUSED(id)
- dbg.nospace() << "QUuid(QT_NO_QUUID_STRING)";
-#endif
return dbg.space();
}
#endif
diff --git a/src/corelib/plugin/quuid.h b/src/corelib/plugin/quuid.h
index ba475ac33b..d1b56002f3 100644
--- a/src/corelib/plugin/quuid.h
+++ b/src/corelib/plugin/quuid.h
@@ -115,13 +115,11 @@ public:
}
#endif
-#ifndef QT_NO_QUUID_STRING
QUuid(const QString &);
QUuid(const char *);
QString toString() const;
QUuid(const QByteArray &);
QByteArray toByteArray() const;
-#endif
QByteArray toRfc4122() const;
static QUuid fromRfc4122(const QByteArray &);
bool isNull() const;
@@ -193,7 +191,6 @@ public:
#ifndef QT_BOOTSTRAPPED
static QUuid createUuidV3(const QUuid &ns, const QByteArray &baseData);
static QUuid createUuidV5(const QUuid &ns, const QByteArray &baseData);
-#ifndef QT_NO_QUUID_STRING
static inline QUuid createUuidV3(const QUuid &ns, const QString &baseData)
{
return QUuid::createUuidV3(ns, baseData.toUtf8());
@@ -205,7 +202,6 @@ public:
}
#endif
-#endif
QUuid::Variant variant() const;
QUuid::Version version() const;
diff --git a/src/corelib/statemachine/qstatemachine.cpp b/src/corelib/statemachine/qstatemachine.cpp
index bf33500676..0d0bb45738 100644
--- a/src/corelib/statemachine/qstatemachine.cpp
+++ b/src/corelib/statemachine/qstatemachine.cpp
@@ -86,17 +86,15 @@ QT_BEGIN_NAMESPACE
\ingroup statemachine
QStateMachine is based on the concepts and notation of
- \l{Statecharts: A visual formalism for complex
- systems}{Statecharts}. QStateMachine is part of \l{The State
- Machine Framework}.
+ \l{http://www.wisdom.weizmann.ac.il/~dharel/SCANNED.PAPERS/Statecharts.pdf}{Statecharts}.
+ QStateMachine is part of \l{The State Machine Framework}.
A state machine manages a set of states (classes that inherit from
QAbstractState) and transitions (descendants of
QAbstractTransition) between those states; these states and
transitions define a state graph. Once a state graph has been
built, the state machine can execute it. QStateMachine's
- execution algorithm is based on the \l{State Chart XML: State
- Machine Notation for Control Abstraction}{State Chart XML (SCXML)}
+ execution algorithm is based on the \l{http://www.w3.org/TR/scxml/}{State Chart XML (SCXML)}
algorithm. The framework's \l{The State Machine
Framework}{overview} gives several state graphs and the code to
build them.
diff --git a/src/corelib/thread/qatomic.cpp b/src/corelib/thread/qatomic.cpp
index 87f1d84d4d..ef74ac40e8 100644
--- a/src/corelib/thread/qatomic.cpp
+++ b/src/corelib/thread/qatomic.cpp
@@ -53,12 +53,6 @@
The QAtomicInt class provides atomic reference counting, test-and-set, fetch-and-store,
and fetch-and-add for integers.
- \section1 Non-atomic convenience operators
-
- For convenience, QAtomicInt provides integer comparison, cast, and
- assignment operators. Note that a combination of these operators
- is \e not an atomic operation.
-
\section1 The Atomic API
\section2 Reference counting
@@ -222,6 +216,44 @@
this QAtomicInt.
*/
+/*!
+ \fn int QAtomicInt::load() const
+
+ Atomically loads the value of this QAtomicInt using relaxed memory
+ ordering. The value is not modified in any way, but note that there's no
+ guarantee that it remains so.
+
+ \sa store(), loadAcquire()
+*/
+
+/*!
+ \fn int QAtomicInt::loadAcquire() const
+
+ Atomically loads the value of this QAtomicInt using the "Acquire" memory
+ ordering. The value is not modified in any way, but note that there's no
+ guarantee that it remains so.
+
+ \sa store(), load()
+*/
+
+/*!
+ \fn void QAtomicInt::store(int newValue)
+
+ Atomically stores the \a newValue value into this atomic type, using
+ relaxed memory ordering.
+
+ \sa storeRelease(), load()
+*/
+
+/*!
+ \fn void QAtomicInt::storeRelease(int newValue)
+
+ Atomically stores the \a newValue value into this atomic type, using
+ the "Release" memory ordering.
+
+ \sa store(), load()
+*/
+
/*! \fn bool QAtomicInt::isReferenceCountingNative()
Returns true if reference counting is implemented using atomic
@@ -610,12 +642,6 @@
An \e atomic operation is a complex operation that completes without interruption.
The QAtomicPointer class provides atomic test-and-set, fetch-and-store, and fetch-and-add for pointers.
- \section1 Non-atomic convenience operators
-
- For convenience, QAtomicPointer provides pointer comparison, cast,
- dereference, and assignment operators. Note that these operators
- are \e not atomic.
-
\section1 The Atomic API
\section2 Memory ordering
@@ -762,6 +788,44 @@
this QAtomicPointer.
*/
+/*!
+ \fn T *QAtomicPointer::load() const
+
+ Atomically loads the value of this QAtomicPointer using relaxed memory
+ ordering. The value is not modified in any way, but note that there's no
+ guarantee that it remains so.
+
+ \sa store(), loadAcquire()
+*/
+
+/*!
+ \fn T *QAtomicPointer::loadAcquire() const
+
+ Atomically loads the value of this QAtomicPointerusing the "Acquire" memory
+ ordering. The value is not modified in any way, but note that there's no
+ guarantee that it remains so.
+
+ \sa store(), load()
+*/
+
+/*!
+ \fn void QAtomicPointer::store(T *newValue)
+
+ Atomically stores the \a newValue value into this atomic type, using
+ relaxed memory ordering.
+
+ \sa storeRelease(), load()
+*/
+
+/*!
+ \fn void QAtomicPointer::storeRelease(T *newValue)
+
+ Atomically stores the \a newValue value into this atomic type, using
+ the "Release" memory ordering.
+
+ \sa store(), load()
+*/
+
/*! \fn bool QAtomicPointer::isTestAndSetNative()
Returns true if test-and-set is implemented using atomic processor
diff --git a/src/corelib/thread/qatomic.h b/src/corelib/thread/qatomic.h
index 076cfba159..10001802ba 100644
--- a/src/corelib/thread/qatomic.h
+++ b/src/corelib/thread/qatomic.h
@@ -82,6 +82,11 @@ public:
}
#ifdef qdoc
+ int load() const;
+ int loadAcquire() const;
+ void store(int newValue);
+ void storeRelease(int newValue);
+
static Q_DECL_CONSTEXPR bool isReferenceCountingNative();
static Q_DECL_CONSTEXPR bool isReferenceCountingWaitFree();
@@ -139,6 +144,11 @@ public:
}
#ifdef qdoc
+ T *load() const;
+ T *loadAcquire() const;
+ void store(T *newValue);
+ void storeRelease(T *newValue);
+
static Q_DECL_CONSTEXPR bool isTestAndSetNative();
static Q_DECL_CONSTEXPR bool isTestAndSetWaitFree();
diff --git a/src/corelib/thread/qbasicatomic.h b/src/corelib/thread/qbasicatomic.h
index 4177ddbd39..70b69827c2 100644
--- a/src/corelib/thread/qbasicatomic.h
+++ b/src/corelib/thread/qbasicatomic.h
@@ -39,11 +39,11 @@
**
****************************************************************************/
+#include <QtCore/qatomic.h>
+
#ifndef QBASICATOMIC_H
#define QBASICATOMIC_H
-#include <QtCore/qglobal.h>
-
#if defined(QT_MOC) || defined(QT_BUILD_QMAKE) || defined(QT_RCC) || defined(QT_UIC) || defined(QT_BOOTSTRAPPED)
# include <QtCore/qatomic_bootstrap.h>
diff --git a/src/corelib/thread/qfuture.qdoc b/src/corelib/thread/qfuture.qdoc
index b67d711536..6ba5d564cf 100644
--- a/src/corelib/thread/qfuture.qdoc
+++ b/src/corelib/thread/qfuture.qdoc
@@ -328,7 +328,7 @@
/*! \fn QFuture::const_iterator QFuture::begin() const
- Returns a const \l{STL-style iterator} pointing to the first result in the
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first result in the
future.
\sa constBegin(), end()
@@ -336,7 +336,7 @@
/*! \fn QFuture::const_iterator QFuture::end() const
- Returns a const \l{STL-style iterator} pointing to the imaginary result
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary result
after the last result in the future.
\sa begin(), constEnd()
@@ -344,7 +344,7 @@
/*! \fn QFuture::const_iterator QFuture::constBegin() const
- Returns a const \l{STL-style iterator} pointing to the first result in the
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first result in the
future.
\sa begin(), constEnd()
@@ -352,7 +352,7 @@
/*! \fn QFuture::const_iterator QFuture::constEnd() const
- Returns a const \l{STL-style iterator} pointing to the imaginary result
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary result
after the last result in the future.
\sa constBegin(), end()
diff --git a/src/corelib/thread/qmutex.cpp b/src/corelib/thread/qmutex.cpp
index 3815ce16a7..97a5e5738c 100644
--- a/src/corelib/thread/qmutex.cpp
+++ b/src/corelib/thread/qmutex.cpp
@@ -394,7 +394,7 @@ bool QBasicMutex::isRecursive()
to wait on the mutex. There are two tricks to keep in mind:
We don't want to increment waiters after we checked no threads are waiting
(waiters == 0). That's why we atomically set the BigNumber flag on waiters when
- we check waiters. Similarily, if waiters is decremented right after we checked,
+ we check waiters. Similarly, if waiters is decremented right after we checked,
the mutex would be unlocked (d->wakeUp() has (or will) be called), but there is
no thread waiting. This is only happening if there was a timeout in tryLock at the
same time as the mutex is unlocked. So when there was a timeout, we set the
@@ -531,7 +531,7 @@ void QBasicMutex::unlockInternal() Q_DECL_NOTHROW
QMutexPrivate *d = reinterpret_cast<QMutexPrivate *>(copy);
- // If no one is waiting for the lock anymore, we shoud reset d to 0x0.
+ // If no one is waiting for the lock anymore, we should reset d to 0x0.
// Using fetchAndAdd, we atomically check that waiters was equal to 0, and add a flag
// to the waiters variable (BigNumber). That way, we avoid the race in which waiters is
// incremented right after we checked, because we won't increment waiters if is
diff --git a/src/corelib/thread/qmutex_linux.cpp b/src/corelib/thread/qmutex_linux.cpp
index 4f70014acb..94aec0ede0 100644
--- a/src/corelib/thread/qmutex_linux.cpp
+++ b/src/corelib/thread/qmutex_linux.cpp
@@ -187,7 +187,7 @@ bool lockInternal_helper(QBasicAtomicPointer<QMutexData> &d_ptr, int timeout = -
struct timespec ts, *pts = 0;
QElapsedTimer elapsedTimer;
checkElapsedTimerIsTrivial();
- if (IsTimed) {
+ if (IsTimed && timeout > 0) {
ts.tv_sec = timeout / 1000;
ts.tv_nsec = (timeout % 1000) * 1000 * 1000;
elapsedTimer.start();
@@ -206,7 +206,7 @@ bool lockInternal_helper(QBasicAtomicPointer<QMutexData> &d_ptr, int timeout = -
ts.tv_sec = xtimeout / Q_INT64_C(1000) / 1000 / 1000;
ts.tv_nsec = xtimeout % (Q_INT64_C(1000) * 1000 * 1000);
}
- if (IsTimed)
+ if (IsTimed && timeout > 0)
pts = &ts;
// successfully set the waiting bit, now sleep
@@ -232,7 +232,6 @@ void QBasicMutex::lockInternal() Q_DECL_NOTHROW
bool QBasicMutex::lockInternal(int timeout) Q_DECL_NOTHROW
{
Q_ASSERT(!isRecursive());
- Q_ASSERT(timeout >= 0);
return lockInternal_helper<true>(d_ptr, timeout);
}
diff --git a/src/corelib/thread/qthread_unix.cpp b/src/corelib/thread/qthread_unix.cpp
index b80653c07e..3b8a3f383b 100644
--- a/src/corelib/thread/qthread_unix.cpp
+++ b/src/corelib/thread/qthread_unix.cpp
@@ -392,10 +392,7 @@ int QThread::idealThreadCount() Q_DECL_NOTHROW
{
int cores = -1;
-#if defined(Q_OS_MAC) && !defined(Q_OS_IOS)
- // Mac OS X
- cores = MPProcessorsScheduled();
-#elif defined(Q_OS_HPUX)
+#if defined(Q_OS_HPUX)
// HP-UX
struct pst_dynamic psd;
if (pstat_getdynamic(&psd, sizeof(psd), 1, 0) == -1) {
@@ -405,7 +402,7 @@ int QThread::idealThreadCount() Q_DECL_NOTHROW
cores = (int)psd.psd_proc_cnt;
}
#elif defined(Q_OS_BSD4)
- // FreeBSD, OpenBSD, NetBSD, BSD/OS
+ // FreeBSD, OpenBSD, NetBSD, BSD/OS, Mac OS X
size_t len = sizeof(cores);
int mib[2];
mib[0] = CTL_HW;
diff --git a/src/corelib/thread/qwaitcondition.qdoc b/src/corelib/thread/qwaitcondition.qdoc
index e3a526d7f8..f0649c605a 100644
--- a/src/corelib/thread/qwaitcondition.qdoc
+++ b/src/corelib/thread/qwaitcondition.qdoc
@@ -38,7 +38,7 @@
QWaitCondition allows a thread to tell other threads that some
sort of condition has been met. One or many threads can block
waiting for a QWaitCondition to set a condition with wakeOne() or
- wakeAll(). Use wakeOne() to wake one randomly selected condition or
+ wakeAll(). Use wakeOne() to wake one randomly selected thread or
wakeAll() to wake them all.
For example, let's suppose that we have three tasks that should
diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp
index feda8f441d..3685a8938a 100644
--- a/src/corelib/tools/qbytearray.cpp
+++ b/src/corelib/tools/qbytearray.cpp
@@ -3585,7 +3585,8 @@ QByteArray QByteArray::toBase64() const
Sets the byte array to the printed value of \a n in base \a base (10
by default) and returns a reference to the byte array. The \a base can
- be any value between 2 and 36.
+ be any value between 2 and 36. For bases other than 10, n is treated
+ as an unsigned integer.
Example:
\snippet code/src_corelib_tools_qbytearray.cpp 40
@@ -3623,7 +3624,7 @@ QByteArray QByteArray::toBase64() const
\sa toLongLong()
*/
-QByteArray &QByteArray::setNum(qlonglong n, int base)
+static char *qulltoa2(char *p, qulonglong n, int base)
{
#if defined(QT_CHECK_RANGE)
if (base < 2 || base > 36) {
@@ -3631,8 +3632,31 @@ QByteArray &QByteArray::setNum(qlonglong n, int base)
base = 10;
}
#endif
- QLocale locale(QLocale::C);
- *this = locale.d->longLongToString(n, -1, base).toLatin1();
+ const char b = 'a' - 10;
+ do {
+ const int c = n % base;
+ n /= base;
+ *--p = c + (c < 10 ? '0' : b);
+ } while (n);
+
+ return p;
+}
+
+QByteArray &QByteArray::setNum(qlonglong n, int base)
+{
+ const int buffsize = 66; // big enough for MAX_ULLONG in base 2
+ char buff[buffsize];
+ char *p;
+
+ if (n < 0 && base == 10) {
+ p = qulltoa2(buff + buffsize, qulonglong(-(1 + n)) + 1, base);
+ *--p = '-';
+ } else {
+ p = qulltoa2(buff + buffsize, qulonglong(n), base);
+ }
+
+ clear();
+ append(p, buffsize - (p - buff));
return *this;
}
@@ -3644,14 +3668,12 @@ QByteArray &QByteArray::setNum(qlonglong n, int base)
QByteArray &QByteArray::setNum(qulonglong n, int base)
{
-#if defined(QT_CHECK_RANGE)
- if (base < 2 || base > 36) {
- qWarning("QByteArray::setNum: Invalid base %d", base);
- base = 10;
- }
-#endif
- QLocale locale(QLocale::C);
- *this = locale.d->unsLongLongToString(n, -1, base).toLatin1();
+ const int buffsize = 66; // big enough for MAX_ULLONG in base 2
+ char buff[buffsize];
+ char *p = qulltoa2(buff + buffsize, n, base);
+
+ clear();
+ append(p, buffsize - (p - buff));
return *this;
}
diff --git a/src/corelib/tools/qbytearray.h b/src/corelib/tools/qbytearray.h
index 50e52a1ca7..860869e9c3 100644
--- a/src/corelib/tools/qbytearray.h
+++ b/src/corelib/tools/qbytearray.h
@@ -581,11 +581,11 @@ inline QByteArray &QByteArray::replace(const char *before, const char *after)
{ return replace(before, qstrlen(before), after, qstrlen(after)); }
inline QByteArray &QByteArray::setNum(short n, int base)
-{ return setNum(qlonglong(n), base); }
+{ return base == 10 ? setNum(qlonglong(n), base) : setNum(qulonglong(ushort(n)), base); }
inline QByteArray &QByteArray::setNum(ushort n, int base)
{ return setNum(qulonglong(n), base); }
inline QByteArray &QByteArray::setNum(int n, int base)
-{ return setNum(qlonglong(n), base); }
+{ return base == 10 ? setNum(qlonglong(n), base) : setNum(qulonglong(uint(n)), base); }
inline QByteArray &QByteArray::setNum(uint n, int base)
{ return setNum(qulonglong(n), base); }
inline QByteArray &QByteArray::setNum(float n, char f, int prec)
diff --git a/src/corelib/tools/qelapsedtimer_unix.cpp b/src/corelib/tools/qelapsedtimer_unix.cpp
index 5dc18ce99f..b8f2180a5b 100644
--- a/src/corelib/tools/qelapsedtimer_unix.cpp
+++ b/src/corelib/tools/qelapsedtimer_unix.cpp
@@ -69,7 +69,7 @@ QT_BEGIN_NAMESPACE
* http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap02.html#tag_02_01_06 )
*
* The macro _POSIX_MONOTONIC_CLOCK can therefore assume the following values:
- * -1 monotonic clock is never supported on this sytem
+ * -1 monotonic clock is never supported on this system
* 0 monotonic clock might be supported, runtime check is needed
* >1 (such as 200809L) monotonic clock is always supported
*
diff --git a/src/corelib/tools/qharfbuzz_p.h b/src/corelib/tools/qharfbuzz_p.h
index 9efbdcb692..8b73b1d507 100644
--- a/src/corelib/tools/qharfbuzz_p.h
+++ b/src/corelib/tools/qharfbuzz_p.h
@@ -54,8 +54,7 @@
#define QHARFBUZZ_P_H
#include <QtCore/qchar.h>
-
-#include <harfbuzz-shaper.h>
+#include <private/harfbuzz-shaper.h>
QT_BEGIN_NAMESPACE
diff --git a/src/corelib/tools/qhash.cpp b/src/corelib/tools/qhash.cpp
index 3fab2f68e6..eca66d75b0 100644
--- a/src/corelib/tools/qhash.cpp
+++ b/src/corelib/tools/qhash.cpp
@@ -1261,7 +1261,7 @@ void QHashData::checkSanity()
/*! \fn QHash::iterator QHash::begin()
- Returns an \l{STL-style iterator} pointing to the first item in
+ Returns an \l{STL-style iterators}{STL-style iterator} pointing to the first item in
the hash.
\sa constBegin(), end()
@@ -1275,7 +1275,7 @@ void QHashData::checkSanity()
/*! \fn QHash::const_iterator QHash::cbegin() const
\since 5.0
- Returns a const \l{STL-style iterator} pointing to the first item
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first item
in the hash.
\sa begin(), cend()
@@ -1283,7 +1283,7 @@ void QHashData::checkSanity()
/*! \fn QHash::const_iterator QHash::constBegin() const
- Returns a const \l{STL-style iterator} pointing to the first item
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first item
in the hash.
\sa begin(), constEnd()
@@ -1291,7 +1291,7 @@ void QHashData::checkSanity()
/*! \fn QHash::iterator QHash::end()
- Returns an \l{STL-style iterator} pointing to the imaginary item
+ Returns an \l{STL-style iterators}{STL-style iterator} pointing to the imaginary item
after the last item in the hash.
\sa begin(), constEnd()
@@ -1304,7 +1304,7 @@ void QHashData::checkSanity()
/*! \fn QHash::const_iterator QHash::constEnd() const
- Returns a const \l{STL-style iterator} pointing to the imaginary
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary
item after the last item in the hash.
\sa constBegin(), end()
@@ -1313,7 +1313,7 @@ void QHashData::checkSanity()
/*! \fn QHash::const_iterator QHash::cend() const
\since 5.0
- Returns a const \l{STL-style iterator} pointing to the imaginary
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary
item after the last item in the hash.
\sa cbegin(), end()
diff --git a/src/corelib/tools/qlinkedlist.cpp b/src/corelib/tools/qlinkedlist.cpp
index 025d48b595..0c5894f150 100644
--- a/src/corelib/tools/qlinkedlist.cpp
+++ b/src/corelib/tools/qlinkedlist.cpp
@@ -320,7 +320,7 @@ const QLinkedListData QLinkedListData::shared_null = {
/*! \fn QLinkedList::iterator QLinkedList::begin()
- Returns an \l{STL-style iterator} pointing to the first item in
+ Returns an \l{STL-style iterators}{STL-style iterator} pointing to the first item in
the list.
\sa constBegin(), end()
@@ -334,7 +334,7 @@ const QLinkedListData QLinkedListData::shared_null = {
/*! \fn QLinkedList::const_iterator QLinkedList::cbegin() const
\since 5.0
- Returns a const \l{STL-style iterator} pointing to the first item
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first item
in the list.
\sa begin(), cend()
@@ -342,7 +342,7 @@ const QLinkedListData QLinkedListData::shared_null = {
/*! \fn QLinkedList::const_iterator QLinkedList::constBegin() const
- Returns a const \l{STL-style iterator} pointing to the first item
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first item
in the list.
\sa begin(), constEnd()
@@ -350,7 +350,7 @@ const QLinkedListData QLinkedListData::shared_null = {
/*! \fn QLinkedList::iterator QLinkedList::end()
- Returns an \l{STL-style iterator} pointing to the imaginary item
+ Returns an \l{STL-style iterators}{STL-style iterator} pointing to the imaginary item
after the last item in the list.
\sa begin(), constEnd()
@@ -364,7 +364,7 @@ const QLinkedListData QLinkedListData::shared_null = {
/*! \fn QLinkedList::const_iterator QLinkedList::cend() const
\since 5.0
- Returns a const \l{STL-style iterator} pointing to the imaginary
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary
item after the last item in the list.
\sa cbegin(), end()
@@ -372,7 +372,7 @@ const QLinkedListData QLinkedListData::shared_null = {
/*! \fn QLinkedList::const_iterator QLinkedList::constEnd() const
- Returns a const \l{STL-style iterator} pointing to the imaginary
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary
item after the last item in the list.
\sa constBegin(), end()
diff --git a/src/corelib/tools/qlist.cpp b/src/corelib/tools/qlist.cpp
index 4f26b25fec..f31b184f81 100644
--- a/src/corelib/tools/qlist.cpp
+++ b/src/corelib/tools/qlist.cpp
@@ -915,7 +915,7 @@ void **QListData::erase(void **xi)
/*! \fn QList::iterator QList::begin()
- Returns an \l{STL-style iterator} pointing to the first item in
+ Returns an \l{STL-style iterators}{STL-style iterator} pointing to the first item in
the list.
\sa constBegin(), end()
@@ -929,7 +929,7 @@ void **QListData::erase(void **xi)
/*! \fn QList::const_iterator QList::cbegin() const
\since 5.0
- Returns a const \l{STL-style iterator} pointing to the first item
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first item
in the list.
\sa begin(), cend()
@@ -937,7 +937,7 @@ void **QListData::erase(void **xi)
/*! \fn QList::const_iterator QList::constBegin() const
- Returns a const \l{STL-style iterator} pointing to the first item
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first item
in the list.
\sa begin(), constEnd()
@@ -945,7 +945,7 @@ void **QListData::erase(void **xi)
/*! \fn QList::iterator QList::end()
- Returns an \l{STL-style iterator} pointing to the imaginary item
+ Returns an \l{STL-style iterators}{STL-style iterator} pointing to the imaginary item
after the last item in the list.
\sa begin(), constEnd()
@@ -959,7 +959,7 @@ void **QListData::erase(void **xi)
/*! \fn QList::const_iterator QList::cend() const
\since 5.0
- Returns a const \l{STL-style iterator} pointing to the imaginary
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary
item after the last item in the list.
\sa cbegin(), end()
@@ -967,7 +967,7 @@ void **QListData::erase(void **xi)
/*! \fn QList::const_iterator QList::constEnd() const
- Returns a const \l{STL-style iterator} pointing to the imaginary
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary
item after the last item in the list.
\sa constBegin(), end()
diff --git a/src/corelib/tools/qlist.h b/src/corelib/tools/qlist.h
index f5858bf22a..0d4c10fecd 100644
--- a/src/corelib/tools/qlist.h
+++ b/src/corelib/tools/qlist.h
@@ -368,7 +368,7 @@ Q_INLINE_TEMPLATE void QList<T>::node_construct(Node *n, const T &t)
else *reinterpret_cast<T*>(n) = t;
#else
// This is always safe, but penaltizes unoptimized builds a lot.
- else ::memcpy(n, &t, sizeof(T));
+ else ::memcpy(n, static_cast<const void *>(&t), sizeof(T));
#endif
}
diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp
index 4b4c94872e..582ae9ebef 100644
--- a/src/corelib/tools/qlocale.cpp
+++ b/src/corelib/tools/qlocale.cpp
@@ -2240,16 +2240,23 @@ QLocale::MeasurementSystem QLocale::measurementSystem() const
*/
Qt::LayoutDirection QLocale::textDirection() const
{
- Language lang = language();
- if (lang == QLocale::Arabic ||
- lang == QLocale::Hebrew ||
- lang == QLocale::Persian ||
- lang == QLocale::Pashto ||
- lang == QLocale::Urdu ||
- lang == QLocale::Syriac ||
- lang == QLocale::Divehi)
+ switch (language()) {
+ case QLocale::Arabic:
+ case QLocale::Hebrew:
+ case QLocale::Persian:
+ case QLocale::Pashto:
+ case QLocale::Urdu:
+ case QLocale::Syriac:
+ case QLocale::Divehi:
return Qt::RightToLeft;
-
+ case QLocale::Punjabi:
+ case QLocale::Uzbek:
+ if (script() == QLocale::ArabicScript)
+ return Qt::RightToLeft;
+ // fall through
+ default:
+ break;
+ }
return Qt::LeftToRight;
}
diff --git a/src/corelib/tools/qlocale.h b/src/corelib/tools/qlocale.h
index 6b6beeff0a..c9cb31d03b 100644
--- a/src/corelib/tools/qlocale.h
+++ b/src/corelib/tools/qlocale.h
@@ -67,6 +67,7 @@ class Q_CORE_EXPORT QLocale
Q_GADGET
Q_ENUMS(Language)
Q_ENUMS(Country)
+ Q_ENUMS(MeasurementSystem)
friend class QString;
friend class QByteArray;
friend class QIntValidator;
diff --git a/src/corelib/tools/qlocale.qdoc b/src/corelib/tools/qlocale.qdoc
index a31e089eca..43d2b3ade6 100644
--- a/src/corelib/tools/qlocale.qdoc
+++ b/src/corelib/tools/qlocale.qdoc
@@ -450,6 +450,7 @@
\value Cambodia
\value Cameroon
\value Canada
+ \value CanaryIslands
\value CapeVerde
\value CaymanIslands
\value CentralAfricanRepublic
@@ -457,6 +458,7 @@
\value Chile
\value China
\value ChristmasIsland
+ \value ClippertonIsland
\value CocosIslands
\value Colombia
\value Comoros
@@ -503,6 +505,7 @@
\value Guadeloupe
\value Guam
\value Guatemala
+ \value Guernsey
\value Guinea
\value GuineaBissau
\value Guyana
@@ -647,7 +650,7 @@
\value Vanuatu
\value VaticanCityState
\value Venezuela
- \value VietNam
+ \value Vietnam
\value BritishVirginIslands
\value UnitedStatesVirginIslands
\value WallisAndFutunaIslands
@@ -718,7 +721,7 @@
\value SinhalaScript
\value SyriacScript
\value YiScript
- \value VaiiScript
+ \value VaiScript
\omitvalue LastScript
\sa script(), scriptToString(), languageToString()
diff --git a/src/corelib/tools/qmap.cpp b/src/corelib/tools/qmap.cpp
index 7c33d60750..9f6b5f3f4f 100644
--- a/src/corelib/tools/qmap.cpp
+++ b/src/corelib/tools/qmap.cpp
@@ -811,7 +811,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
/*! \fn QMap::iterator QMap::begin()
- Returns an \l{STL-style iterator} pointing to the first item in
+ Returns an \l{STL-style iterators}{STL-style iterator} pointing to the first item in
the map.
\sa constBegin(), end()
@@ -825,7 +825,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
/*! \fn QMap::const_iterator QMap::cbegin() const
\since 5.0
- Returns a const \l{STL-style iterator} pointing to the first item
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first item
in the map.
\sa begin(), cend()
@@ -833,7 +833,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
/*! \fn QMap::const_iterator QMap::constBegin() const
- Returns a const \l{STL-style iterator} pointing to the first item
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first item
in the map.
\sa begin(), constEnd()
@@ -841,7 +841,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
/*! \fn QMap::iterator QMap::end()
- Returns an \l{STL-style iterator} pointing to the imaginary item
+ Returns an \l{STL-style iterators}{STL-style iterator} pointing to the imaginary item
after the last item in the map.
\sa begin(), constEnd()
@@ -855,7 +855,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
/*! \fn QMap::const_iterator QMap::cend() const
\since 5.0
- Returns a const \l{STL-style iterator} pointing to the imaginary
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary
item after the last item in the map.
\sa cbegin(), end()
@@ -863,7 +863,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
/*! \fn QMap::const_iterator QMap::constEnd() const
- Returns a const \l{STL-style iterator} pointing to the imaginary
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary
item after the last item in the map.
\sa constBegin(), end()
diff --git a/src/corelib/tools/qregexp.cpp b/src/corelib/tools/qregexp.cpp
index 4d73fc7478..e441d5320b 100644
--- a/src/corelib/tools/qregexp.cpp
+++ b/src/corelib/tools/qregexp.cpp
@@ -3920,7 +3920,7 @@ static void invalidateEngine(QRegExpPrivate *priv)
\value Wildcard This provides a simple pattern matching syntax
similar to that used by shells (command interpreters) for "file
- globbing". See \l{Wildcard Matching}.
+ globbing". See \l{QRegExp wildcard matching}.
\value WildcardUnix This is similar to Wildcard but with the
behavior of a Unix shell. The wildcard characters can be escaped
@@ -4150,7 +4150,7 @@ QRegExp::PatternSyntax QRegExp::patternSyntax() const
QRegExp::RegExp.
Setting \a syntax to QRegExp::Wildcard enables simple shell-like
- \l{wildcard matching}. For example, \b{r*.txt} matches the
+ \l{QRegExp wildcard matching}. For example, \b{r*.txt} matches the
string \c{readme.txt} in wildcard mode, but does not match
\c{readme}.
diff --git a/src/corelib/tools/qset.qdoc b/src/corelib/tools/qset.qdoc
index 6649d5ba69..dc07f482f9 100644
--- a/src/corelib/tools/qset.qdoc
+++ b/src/corelib/tools/qset.qdoc
@@ -330,7 +330,7 @@
/*! \fn QSet::const_iterator QSet::begin() const
- Returns a const \l{STL-style iterator} positioned at the first
+ Returns a const \l{STL-style iterators}{STL-style iterator} positioned at the first
item in the set.
\sa constBegin(), end()
@@ -340,14 +340,14 @@
\since 4.2
\overload
- Returns a non-const \l{STL-style iterator} positioned at the first
+ Returns a non-const \l{STL-style iterators}{STL-style iterator} positioned at the first
item in the set.
*/
/*! \fn QSet::const_iterator QSet::cbegin() const
\since 5.0
- Returns a const \l{STL-style iterator} positioned at the first
+ Returns a const \l{STL-style iterators}{STL-style iterator} positioned at the first
item in the set.
\sa begin(), cend()
@@ -355,7 +355,7 @@
/*! \fn QSet::const_iterator QSet::constBegin() const
- Returns a const \l{STL-style iterator} positioned at the first
+ Returns a const \l{STL-style iterators}{STL-style iterator} positioned at the first
item in the set.
\sa begin(), constEnd()
@@ -363,7 +363,7 @@
/*! \fn QSet::const_iterator QSet::end() const
- Returns a const \l{STL-style iterator} positioned at the imaginary
+ Returns a const \l{STL-style iterators}{STL-style iterator} positioned at the imaginary
item after the last item in the set.
\sa constEnd(), begin()
@@ -373,14 +373,14 @@
\since 4.2
\overload
- Returns a non-const \l{STL-style iterator} pointing to the
+ Returns a non-const \l{STL-style iterators}{STL-style iterator} pointing to the
imaginary item after the last item in the set.
*/
/*! \fn QSet::const_iterator QSet::cend() const
\since 5.0
- Returns a const \l{STL-style iterator} pointing to the imaginary
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary
item after the last item in the set.
\sa cbegin(), end()
@@ -388,7 +388,7 @@
/*! \fn QSet::const_iterator QSet::constEnd() const
- Returns a const \l{STL-style iterator} pointing to the imaginary
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary
item after the last item in the set.
\sa constBegin(), end()
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp
index 34a8cbe4c8..6db4fed0f8 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -840,7 +840,7 @@ const QString::Null QString::null = { };
/*! \fn QString::iterator QString::begin()
- Returns an \l{STL-style iterator} pointing to the first character in
+ Returns an \l{STL-style iterators}{STL-style iterator} pointing to the first character in
the string.
\sa constBegin(), end()
@@ -854,7 +854,7 @@ const QString::Null QString::null = { };
/*! \fn QString::const_iterator QString::cbegin() const
\since 5.0
- Returns a const \l{STL-style iterator} pointing to the first character
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first character
in the string.
\sa begin(), cend()
@@ -862,7 +862,7 @@ const QString::Null QString::null = { };
/*! \fn QString::const_iterator QString::constBegin() const
- Returns a const \l{STL-style iterator} pointing to the first character
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first character
in the string.
\sa begin(), constEnd()
@@ -870,7 +870,7 @@ const QString::Null QString::null = { };
/*! \fn QString::iterator QString::end()
- Returns an \l{STL-style iterator} pointing to the imaginary character
+ Returns an \l{STL-style iterators}{STL-style iterator} pointing to the imaginary character
after the last character in the string.
\sa begin(), constEnd()
@@ -884,7 +884,7 @@ const QString::Null QString::null = { };
/*! \fn QString::const_iterator QString::cend() const
\since 5.0
- Returns a const \l{STL-style iterator} pointing to the imaginary
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary
item after the last item in the list.
\sa cbegin(), end()
@@ -892,7 +892,7 @@ const QString::Null QString::null = { };
/*! \fn QString::const_iterator QString::constEnd() const
- Returns a const \l{STL-style iterator} pointing to the imaginary
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary
item after the last item in the list.
\sa constBegin(), end()
diff --git a/src/corelib/tools/qunicodetools.cpp b/src/corelib/tools/qunicodetools.cpp
index 8bafb692ca..f83e2b5911 100644
--- a/src/corelib/tools/qunicodetools.cpp
+++ b/src/corelib/tools/qunicodetools.cpp
@@ -44,7 +44,8 @@
#include "qunicodetables_p.h"
#include "qvarlengtharray.h"
-#include "qharfbuzz_p.h"
+#include <private/harfbuzz-shaper.h>
+#include <private/qharfbuzz_p.h>
#define FLAG(x) (1 << (x))
diff --git a/src/corelib/tools/qvarlengtharray.qdoc b/src/corelib/tools/qvarlengtharray.qdoc
index 452bc0a598..0481373f2d 100644
--- a/src/corelib/tools/qvarlengtharray.qdoc
+++ b/src/corelib/tools/qvarlengtharray.qdoc
@@ -483,7 +483,7 @@
/*! \fn QVarLengthArray::iterator QVarLengthArray::begin()
\since 4.8
- Returns an \l{STL-style iterator} pointing to the first item in
+ Returns an \l{STL-style iterators}{STL-style iterator} pointing to the first item in
the array.
\sa constBegin(), end()
@@ -497,7 +497,7 @@
/*! \fn QVarLengthArray::const_iterator QVarLengthArray::cbegin() const
\since 5.0
- Returns a const \l{STL-style iterator} pointing to the first item
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first item
in the array.
\sa begin(), cend()
@@ -506,7 +506,7 @@
/*! \fn QVarLengthArray::const_iterator QVarLengthArray::constBegin() const
\since 4.8
- Returns a const \l{STL-style iterator} pointing to the first item
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first item
in the array.
\sa begin(), constEnd()
@@ -515,7 +515,7 @@
/*! \fn QVarLengthArray::iterator QVarLengthArray::end()
\since 4.8
- Returns an \l{STL-style iterator} pointing to the imaginary item
+ Returns an \l{STL-style iterators}{STL-style iterator} pointing to the imaginary item
after the last item in the array.
\sa begin(), constEnd()
@@ -530,7 +530,7 @@
/*! \fn QVarLengthArray::const_iterator QVarLengthArray::cend() const
\since 5.0
- Returns a const \l{STL-style iterator} pointing to the imaginary
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary
item after the last item in the array.
\sa cbegin(), end()
@@ -539,7 +539,7 @@
/*! \fn QVarLengthArray::const_iterator QVarLengthArray::constEnd() const
\since 4.8
- Returns a const \l{STL-style iterator} pointing to the imaginary
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary
item after the last item in the array.
\sa constBegin(), end()
diff --git a/src/corelib/tools/qvector.cpp b/src/corelib/tools/qvector.cpp
index f33bb930c2..ab8127159f 100644
--- a/src/corelib/tools/qvector.cpp
+++ b/src/corelib/tools/qvector.cpp
@@ -636,7 +636,7 @@
/*! \fn QVector::iterator QVector::begin()
- Returns an \l{STL-style iterator} pointing to the first item in
+ Returns an \l{STL-style iterators}{STL-style iterator} pointing to the first item in
the vector.
\sa constBegin(), end()
@@ -650,7 +650,7 @@
/*! \fn QVector::const_iterator QVector::cbegin() const
\since 5.0
- Returns a const \l{STL-style iterator} pointing to the first item
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first item
in the vector.
\sa begin(), cend()
@@ -658,7 +658,7 @@
/*! \fn QVector::const_iterator QVector::constBegin() const
- Returns a const \l{STL-style iterator} pointing to the first item
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first item
in the vector.
\sa begin(), constEnd()
@@ -666,7 +666,7 @@
/*! \fn QVector::iterator QVector::end()
- Returns an \l{STL-style iterator} pointing to the imaginary item
+ Returns an \l{STL-style iterators}{STL-style iterator} pointing to the imaginary item
after the last item in the vector.
\sa begin(), constEnd()
@@ -680,7 +680,7 @@
/*! \fn QVector::const_iterator QVector::cend() const
\since 5.0
- Returns a const \l{STL-style iterator} pointing to the imaginary
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary
item after the last item in the vector.
\sa cbegin(), end()
@@ -688,7 +688,7 @@
/*! \fn QVector::const_iterator QVector::constEnd() const
- Returns a const \l{STL-style iterator} pointing to the imaginary
+ Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary
item after the last item in the vector.
\sa constBegin(), end()
diff --git a/src/corelib/tools/tools.pri b/src/corelib/tools/tools.pri
index 88a59f5f77..564aff9ab9 100644
--- a/src/corelib/tools/tools.pri
+++ b/src/corelib/tools/tools.pri
@@ -133,7 +133,6 @@ pcre {
}
DEFINES += HB_EXPORT=Q_CORE_EXPORT
-INCLUDEPATH += ../3rdparty/harfbuzz/src
HEADERS += ../3rdparty/harfbuzz/src/harfbuzz.h
SOURCES += ../3rdparty/harfbuzz/src/harfbuzz-buffer.c \
../3rdparty/harfbuzz/src/harfbuzz-gdef.c \
@@ -146,8 +145,6 @@ SOURCES += ../3rdparty/harfbuzz/src/harfbuzz-buffer.c \
tools/qharfbuzz.cpp
HEADERS += tools/qharfbuzz_p.h
-private_headers.files += ../3rdparty/harfbuzz/src/*.h
-
INCLUDEPATH += ../3rdparty/md5 \
../3rdparty/md4
diff --git a/src/dbus/doc/images/qurl-ftppath.png b/src/dbus/doc/images/qurl-ftppath.png
new file mode 100644
index 0000000000..d88df4922b
--- /dev/null
+++ b/src/dbus/doc/images/qurl-ftppath.png
Binary files differ
diff --git a/src/dbus/doc/qtdbus.qdocconf b/src/dbus/doc/qtdbus.qdocconf
index 20b327f9fb..7a58dada63 100644
--- a/src/dbus/doc/qtdbus.qdocconf
+++ b/src/dbus/doc/qtdbus.qdocconf
@@ -14,9 +14,12 @@ exampledirs += ../../../examples/dbus \
headerdirs += ..
imagedirs += images
-sourcedirs += ..
+sourcedirs += .. \
+ ../../../examples/dbus/doc/src
excludedirs += ../../../examples/widgets/doc
+examplesinstallpath = dbus
+
depends += qtcore
# The following parameters are for creating a qhp file, the qhelpgenerator
@@ -33,15 +36,16 @@ qhp.qtdbus.file = qtdbus.qhp
# Namespace for the output file. This namespace is used to distinguish between
# different documentation files in Creator/Assistant.
-qhp.qtdbus.namespace = org.qt-project.qtdbus.500
+qhp.qtdbus.namespace = org.qt-project.qtdbus.501
# Title for the package, will be the main title for the package in
# Assistant/Creator.
-qhp.qtdbus.indexTitle = Qt Script Documentation
+qhp.qtdbus.indexTitle = Qt D-Bus
# Only update the name of the project for the next variables.
qhp.qtdbus.virtualFolder = qtdbus
qhp.qtdbus.subprojects = classes
-qhp.qtdbus.subprojects.classes.title = Qt D-Bus C++ Classes
+qhp.qtdbus.subprojects.classes.title = C++ Classes
+qhp.qtdbus.subprojects.classes.indexTitle = Qt D-Bus C++ Classes
qhp.qtdbus.subprojects.classes.selectors = class fake:headerfile
qhp.qtdbus.subprojects.classes.sortPages = true
diff --git a/src/dbus/qdbusxmlparser.cpp b/src/dbus/qdbusxmlparser.cpp
index 315b4a2e24..c2c1b8daff 100644
--- a/src/dbus/qdbusxmlparser.cpp
+++ b/src/dbus/qdbusxmlparser.cpp
@@ -59,7 +59,8 @@
QT_BEGIN_NAMESPACE
-static bool parseArg(const QXmlStreamAttributes &attributes, QDBusIntrospection::Argument &argData)
+static bool parseArg(const QXmlStreamAttributes &attributes, QDBusIntrospection::Argument &argData,
+ QDBusIntrospection::Interface *ifaceData)
{
const QString argType = attributes.value(QLatin1String("type")).toString();
@@ -72,10 +73,21 @@ static bool parseArg(const QXmlStreamAttributes &attributes, QDBusIntrospection:
argData.name = attributes.value(QLatin1String("name")).toString();
argData.type = argType;
+ ifaceData->introspection += QLatin1String(" <arg");
+ if (attributes.hasAttribute(QLatin1String("direction"))) {
+ const QString direction = attributes.value(QLatin1String("direction")).toString();
+ ifaceData->introspection += QLatin1String(" direction=\"") + direction + QLatin1String("\"");
+ }
+ ifaceData->introspection += QLatin1String(" type=\"") + argData.type + QLatin1String("\"");
+ if (!argData.name.isEmpty())
+ ifaceData->introspection += QLatin1String(" name=\"") + argData.name + QLatin1String("\"");
+ ifaceData->introspection += QLatin1String("/>\n");
+
return ok;
}
-static bool parseAnnotation(const QXmlStreamReader &xml, QDBusIntrospection::Annotations &annotations)
+static bool parseAnnotation(const QXmlStreamReader &xml, QDBusIntrospection::Annotations &annotations,
+ QDBusIntrospection::Interface *ifaceData, bool interfaceAnnotation = false)
{
Q_ASSERT(xml.isStartElement() && xml.name() == QLatin1String("annotation"));
@@ -87,12 +99,16 @@ static bool parseAnnotation(const QXmlStreamReader &xml, QDBusIntrospection::Ann
qPrintable(name));
return false;
}
- annotations.insert(name, attributes.value(QLatin1String("value")).toString());
+ const QString value = attributes.value(QLatin1String("value")).toString();
+ annotations.insert(name, value);
+ if (!interfaceAnnotation)
+ ifaceData->introspection += QLatin1String(" ");
+ ifaceData->introspection += QLatin1String(" <annotation value=\"") + value + QLatin1String("\" name=\"") + name + QLatin1String("\"/>\n");
return true;
}
static bool parseProperty(QXmlStreamReader &xml, QDBusIntrospection::Property &propertyData,
- const QString &ifaceName)
+ QDBusIntrospection::Interface *ifaceData)
{
Q_ASSERT(xml.isStartElement() && xml.name() == QLatin1String("property"));
@@ -100,7 +116,7 @@ static bool parseProperty(QXmlStreamReader &xml, QDBusIntrospection::Property &p
const QString propertyName = attributes.value(QLatin1String("name")).toString();
if (!QDBusUtil::isValidMemberName(propertyName)) {
qDBusParserError("Invalid D-BUS member name '%s' found in interface '%s' while parsing introspection",
- qPrintable(propertyName), qPrintable(ifaceName));
+ qPrintable(propertyName), qPrintable(ifaceData->name));
xml.skipCurrentElement();
return false;
}
@@ -112,7 +128,7 @@ static bool parseProperty(QXmlStreamReader &xml, QDBusIntrospection::Property &p
if (!QDBusUtil::isValidSingleSignature(propertyData.type)) {
// cannot be!
qDBusParserError("Invalid D-BUS type signature '%s' found in property '%s.%s' while parsing introspection",
- qPrintable(propertyData.type), qPrintable(ifaceName),
+ qPrintable(propertyData.type), qPrintable(ifaceData->name),
qPrintable(propertyName));
}
@@ -125,18 +141,28 @@ static bool parseProperty(QXmlStreamReader &xml, QDBusIntrospection::Property &p
propertyData.access = QDBusIntrospection::Property::ReadWrite;
else {
qDBusParserError("Invalid D-BUS property access '%s' found in property '%s.%s' while parsing introspection",
- qPrintable(access), qPrintable(ifaceName),
+ qPrintable(access), qPrintable(ifaceData->name),
qPrintable(propertyName));
return false; // invalid one!
}
- while (xml.readNextStartElement()) {
- if (xml.name() == QLatin1String("annotation")) {
- parseAnnotation(xml, propertyData.annotations);
- } else if (xml.prefix().isEmpty()) {
- qDBusParserError() << "Unknown element" << xml.name() << "while checking for annotations";
- }
- xml.skipCurrentElement();
+ ifaceData->introspection += QLatin1String(" <property access=\"") + access + QLatin1String("\" type=\"") + propertyData.type + QLatin1String("\" name=\"") + propertyName + QLatin1String("\"");
+
+ if (!xml.readNextStartElement()) {
+ ifaceData->introspection += QLatin1String("/>\n");
+ } else {
+ ifaceData->introspection += QLatin1String(">\n");
+
+ do {
+ if (xml.name() == QLatin1String("annotation")) {
+ parseAnnotation(xml, propertyData.annotations, ifaceData);
+ } else if (xml.prefix().isEmpty()) {
+ qDBusParserError() << "Unknown element" << xml.name() << "while checking for annotations";
+ }
+ xml.skipCurrentElement();
+ } while (xml.readNextStartElement());
+
+ ifaceData->introspection += QLatin1String(" </property>\n");
}
if (!xml.isEndElement() || xml.name() != QLatin1String("property")) {
@@ -148,7 +174,7 @@ static bool parseProperty(QXmlStreamReader &xml, QDBusIntrospection::Property &p
}
static bool parseMethod(QXmlStreamReader &xml, QDBusIntrospection::Method &methodData,
- const QString &ifaceName)
+ QDBusIntrospection::Interface *ifaceData)
{
Q_ASSERT(xml.isStartElement() && xml.name() == QLatin1String("method"));
@@ -156,35 +182,44 @@ static bool parseMethod(QXmlStreamReader &xml, QDBusIntrospection::Method &metho
const QString methodName = attributes.value(QLatin1String("name")).toString();
if (!QDBusUtil::isValidMemberName(methodName)) {
qDBusParserError("Invalid D-BUS member name '%s' found in interface '%s' while parsing introspection",
- qPrintable(methodName), qPrintable(ifaceName));
+ qPrintable(methodName), qPrintable(ifaceData->name));
return false;
}
methodData.name = methodName;
+ ifaceData->introspection += QLatin1String(" <method name=\"") + methodName + QLatin1String("\"");
QDBusIntrospection::Arguments outArguments;
QDBusIntrospection::Arguments inArguments;
QDBusIntrospection::Annotations annotations;
- while (xml.readNextStartElement()) {
- if (xml.name() == QLatin1String("annotation")) {
- parseAnnotation(xml, annotations);
- } else if (xml.name() == QLatin1String("arg")) {
- const QXmlStreamAttributes attributes = xml.attributes();
- const QString direction = attributes.value(QLatin1String("direction")).toString();
- QDBusIntrospection::Argument argument;
- if (!attributes.hasAttribute(QLatin1String("direction"))
- || direction == QLatin1String("in")) {
- parseArg(attributes, argument);
- inArguments << argument;
- } else if (direction == QLatin1String("out")) {
- parseArg(attributes, argument);
- outArguments << argument;
+ if (!xml.readNextStartElement()) {
+ ifaceData->introspection += QLatin1String("/>\n");
+ } else {
+ ifaceData->introspection += QLatin1String(">\n");
+
+ do {
+ if (xml.name() == QLatin1String("annotation")) {
+ parseAnnotation(xml, annotations, ifaceData);
+ } else if (xml.name() == QLatin1String("arg")) {
+ const QXmlStreamAttributes attributes = xml.attributes();
+ const QString direction = attributes.value(QLatin1String("direction")).toString();
+ QDBusIntrospection::Argument argument;
+ if (!attributes.hasAttribute(QLatin1String("direction"))
+ || direction == QLatin1String("in")) {
+ parseArg(attributes, argument, ifaceData);
+ inArguments << argument;
+ } else if (direction == QLatin1String("out")) {
+ parseArg(attributes, argument, ifaceData);
+ outArguments << argument;
+ }
+ } else if (xml.prefix().isEmpty()) {
+ qDBusParserError() << "Unknown element" << xml.name() << "while checking for method arguments";
}
- } else if (xml.prefix().isEmpty()) {
- qDBusParserError() << "Unknown element" << xml.name() << "while checking for method arguments";
- }
- xml.skipCurrentElement();
+ xml.skipCurrentElement();
+ } while (xml.readNextStartElement());
+
+ ifaceData->introspection += QLatin1String(" </method>\n");
}
methodData.inputArgs = inArguments;
@@ -196,7 +231,7 @@ static bool parseMethod(QXmlStreamReader &xml, QDBusIntrospection::Method &metho
static bool parseSignal(QXmlStreamReader &xml, QDBusIntrospection::Signal &signalData,
- const QString &ifaceName)
+ QDBusIntrospection::Interface *ifaceData)
{
Q_ASSERT(xml.isStartElement() && xml.name() == QLatin1String("signal"));
@@ -205,31 +240,39 @@ static bool parseSignal(QXmlStreamReader &xml, QDBusIntrospection::Signal &signa
if (!QDBusUtil::isValidMemberName(signalName)) {
qDBusParserError("Invalid D-BUS member name '%s' found in interface '%s' while parsing introspection",
- qPrintable(signalName), qPrintable(ifaceName));
+ qPrintable(signalName), qPrintable(ifaceData->name));
return false;
}
signalData.name = signalName;
-
+ ifaceData->introspection += QLatin1String(" <signal name=\"") + signalName + QLatin1String("\"");
QDBusIntrospection::Arguments arguments;
QDBusIntrospection::Annotations annotations;
- while (xml.readNextStartElement()) {
- if (xml.name() == QLatin1String("annotation")) {
- parseAnnotation(xml, annotations);
- } else if (xml.name() == QLatin1String("arg")) {
- const QXmlStreamAttributes attributes = xml.attributes();
- QDBusIntrospection::Argument argument;
- if (!attributes.hasAttribute(QLatin1String("direction")) ||
- attributes.value(QLatin1String("direction")) == QLatin1String("out")) {
- parseArg(attributes, argument);
- arguments << argument;
+ if (!xml.readNextStartElement()) {
+ ifaceData->introspection += QLatin1String("/>\n");
+ } else {
+ ifaceData->introspection += QLatin1String(">\n");
+
+ do {
+ if (xml.name() == QLatin1String("annotation")) {
+ parseAnnotation(xml, annotations, ifaceData);
+ } else if (xml.name() == QLatin1String("arg")) {
+ const QXmlStreamAttributes attributes = xml.attributes();
+ QDBusIntrospection::Argument argument;
+ if (!attributes.hasAttribute(QLatin1String("direction")) ||
+ attributes.value(QLatin1String("direction")) == QLatin1String("out")) {
+ parseArg(attributes, argument, ifaceData);
+ arguments << argument;
+ }
+ } else {
+ qDBusParserError() << "Unknown element" << xml.name() << "while checking for signal arguments";
}
- } else {
- qDBusParserError() << "Unknown element" << xml.name() << "while checking for signal arguments";
- }
- xml.skipCurrentElement();
+ xml.skipCurrentElement();
+ } while (xml.readNextStartElement());
+
+ ifaceData->introspection += QLatin1String(" </signal>\n");
}
signalData.outputArgs = arguments;
@@ -252,22 +295,23 @@ static void readInterface(QXmlStreamReader &xml, QDBusIntrospection::Object *obj
QDBusIntrospection::Interface *ifaceData = new QDBusIntrospection::Interface;
ifaceData->name = ifaceName;
+ ifaceData->introspection += QLatin1String(" <interface name=\"") + ifaceName + QLatin1String("\">\n");
while (xml.readNextStartElement()) {
if (xml.name() == QLatin1String("method")) {
QDBusIntrospection::Method methodData;
- if (parseMethod(xml, methodData, ifaceName))
+ if (parseMethod(xml, methodData, ifaceData))
ifaceData->methods.insert(methodData.name, methodData);
} else if (xml.name() == QLatin1String("signal")) {
QDBusIntrospection::Signal signalData;
- if (parseSignal(xml, signalData, ifaceName))
+ if (parseSignal(xml, signalData, ifaceData))
ifaceData->signals_.insert(signalData.name, signalData);
} else if (xml.name() == QLatin1String("property")) {
QDBusIntrospection::Property propertyData;
- if (parseProperty(xml, propertyData, ifaceName))
+ if (parseProperty(xml, propertyData, ifaceData))
ifaceData->properties.insert(propertyData.name, propertyData);
} else if (xml.name() == QLatin1String("annotation")) {
- parseAnnotation(xml, ifaceData->annotations);
+ parseAnnotation(xml, ifaceData->annotations, ifaceData, true);
xml.skipCurrentElement(); // skip over annotation object
} else {
if (xml.prefix().isEmpty()) {
@@ -277,6 +321,8 @@ static void readInterface(QXmlStreamReader &xml, QDBusIntrospection::Object *obj
}
}
+ ifaceData->introspection += QLatin1String(" </interface>");
+
interfaces->insert(ifaceName, QSharedDataPointer<QDBusIntrospection::Interface>(ifaceData));
if (!xml.isEndElement() || xml.name() != QLatin1String("interface")) {
diff --git a/src/gui/accessible/qaccessible.cpp b/src/gui/accessible/qaccessible.cpp
index 28a3afbbf0..a32f771bd0 100644
--- a/src/gui/accessible/qaccessible.cpp
+++ b/src/gui/accessible/qaccessible.cpp
@@ -56,6 +56,8 @@
QT_BEGIN_NAMESPACE
+#ifndef QT_NO_ACCESSIBILITY
+
/*!
\class QAccessible
\brief The QAccessible class provides enums and static functions
@@ -440,23 +442,19 @@ QAccessible::RootObjectHandler QAccessible::rootObjectHandler = 0;
static bool accessibility_active = false;
static bool cleanupAdded = false;
-#ifndef QT_NO_ACCESSIBILITY
static QPlatformAccessibility *platformAccessibility()
{
QPlatformIntegration *pfIntegration = QGuiApplicationPrivate::platformIntegration();
return pfIntegration ? pfIntegration->accessibility() : 0;
}
-#endif
/*!
\internal
*/
void QAccessible::cleanup()
{
-#ifndef QT_NO_ACCESSIBILITY
if (QPlatformAccessibility *pfAccessibility = platformAccessibility())
pfAccessibility->cleanup();
-#endif
}
static void qAccessibleCleanup()
@@ -617,10 +615,8 @@ QAccessibleInterface *QAccessible::queryAccessibleInterface(QObject *object)
mo = mo->superClass();
}
-#ifndef QT_NO_ACCESSIBILITY
if (object == qApp)
return new QAccessibleApplication;
-#endif
return 0;
}
@@ -660,10 +656,8 @@ void QAccessible::setRootObject(QObject *object)
return;
}
-#ifndef QT_NO_ACCESSIBILITY
if (QPlatformAccessibility *pfAccessibility = platformAccessibility())
pfAccessibility->setRootObject(object);
-#endif
}
/*!
@@ -695,10 +689,8 @@ void QAccessible::updateAccessibility(QAccessibleEvent *event)
if (!isActive())
return;
-#ifndef QT_NO_ACCESSIBILITY
if (QPlatformAccessibility *pfAccessibility = platformAccessibility())
pfAccessibility->notifyAccessibilityUpdate(event);
-#endif
}
#if QT_DEPRECATED_SINCE(5, 0)
@@ -1552,5 +1544,7 @@ QDebug operator<<(QDebug d, const QAccessibleEvent &ev)
#endif
+#endif // QT_NO_ACCESSIBILITY
+
QT_END_NAMESPACE
diff --git a/src/gui/accessible/qaccessible.h b/src/gui/accessible/qaccessible.h
index 5f61634ba2..5bcf9e7d0d 100644
--- a/src/gui/accessible/qaccessible.h
+++ b/src/gui/accessible/qaccessible.h
@@ -57,6 +57,7 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
+#ifndef QT_NO_ACCESSIBILITY
class QAccessibleInterface;
class QAccessibleEvent;
@@ -676,6 +677,8 @@ inline void QAccessible::updateAccessibility(QObject *object, int child, Event r
}
#endif
+#endif // QT_NO_ACCESSIBILITY
+
QT_END_NAMESPACE
QT_END_HEADER
diff --git a/src/gui/accessible/qaccessible2.cpp b/src/gui/accessible/qaccessible2.cpp
index 7f871f9c5a..f21c74e74f 100644
--- a/src/gui/accessible/qaccessible2.cpp
+++ b/src/gui/accessible/qaccessible2.cpp
@@ -439,6 +439,19 @@ QString QAccessibleTextInterface::textAtOffset(int offset, QAccessible2::Boundar
*/
/*!
+ \fn QVariant QAccessibleValueInterface::minimumStepSize() const
+
+ Returns the minimum step size for the accessible.
+ This is the smalles increment that makes sense when changing the value.
+ When programatically changing the value it should always be a multiple
+ of the minimum step size.
+
+ Some tools use this value even when the setCurrentValue does not
+ perform any action. Progress bars for example are read-only but
+ should return their range divided by 100.
+*/
+
+/*!
\class QAccessibleImageInterface
\inmodule QtGui
\ingroup accessibility
diff --git a/src/gui/accessible/qaccessible2.h b/src/gui/accessible/qaccessible2.h
index 6006e7846c..04c9091a79 100644
--- a/src/gui/accessible/qaccessible2.h
+++ b/src/gui/accessible/qaccessible2.h
@@ -117,6 +117,7 @@ public:
virtual void setCurrentValue(const QVariant &value) = 0;
virtual QVariant maximumValue() const = 0;
virtual QVariant minimumValue() const = 0;
+ virtual QVariant minimumStepSize() const = 0;
};
class Q_GUI_EXPORT QAccessibleTableCellInterface
diff --git a/src/gui/accessible/qaccessibleobject.cpp b/src/gui/accessible/qaccessibleobject.cpp
index bc108980cf..2bd5a00afb 100644
--- a/src/gui/accessible/qaccessibleobject.cpp
+++ b/src/gui/accessible/qaccessibleobject.cpp
@@ -165,6 +165,8 @@ QAccessibleInterface *QAccessibleObject::childAt(int x, int y) const
Q_ASSERT(childIface);
if (childIface->rect().contains(x,y)) {
return childIface;
+ } else {
+ delete childIface;
}
}
return 0;
diff --git a/src/gui/doc/qtgui.qdocconf b/src/gui/doc/qtgui.qdocconf
index cf324ad8ac..a46aa9b3d1 100644
--- a/src/gui/doc/qtgui.qdocconf
+++ b/src/gui/doc/qtgui.qdocconf
@@ -3,25 +3,25 @@ include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf)
project = QtGui
description = Qt GUI Reference Documentation
url = http://qt-project.org/doc/qtgui
-version = 5.0.0
+version = 5.0.1
examplesinstallpath = gui
qhp.projects = QtGui
qhp.QtGui.file = qtgui.qhp
-qhp.QtGui.namespace = org.qt-project.qtgui.500
+qhp.QtGui.namespace = org.qt-project.qtgui.501
qhp.QtGui.virtualFolder = qtgui
qhp.QtGui.indexTitle = Qt GUI
qhp.QtGui.indexRoot =
-qhp.QtGui.filterAttributes = qtgui 5.0.0 qtrefdoc
-qhp.QtGui.customFilters.Qt.name = Qtgui 5.0.0
-qhp.QtGui.customFilters.Qt.filterAttributes = qtgui 5.0.0
+qhp.QtGui.filterAttributes = qtgui 5.0.1 qtrefdoc
+qhp.QtGui.customFilters.Qt.name = Qtgui 5.0.1
+qhp.QtGui.customFilters.Qt.filterAttributes = qtgui 5.0.1
qhp.QtGui.subprojects = classes
qhp.QtGui.subprojects.classes.title = C++ Classes
-qhp.QtGui.subprojects.classes.indexTitle = Qt GUI C++ Classes
+qhp.QtGui.subprojects.classes.indexTitle = Qt GUI C++ API
qhp.QtGui.subprojects.classes.selectors = class fake:headerfile
qhp.QtGui.subprojects.classes.sortPages = true
@@ -40,9 +40,10 @@ depends += \
headerdirs += ..
sourcedirs += .. \
- ../../../examples/gui/doc
+ ../../../examples/gui/doc/src
exampledirs += ../../../examples/gui \
snippets
-imagedirs += images
+imagedirs += images \
+ ../../../examples/gui/doc/images
diff --git a/src/gui/doc/src/dnd.qdoc b/src/gui/doc/src/dnd.qdoc
index a4eb77469b..ad48d7b5c7 100644
--- a/src/gui/doc/src/dnd.qdoc
+++ b/src/gui/doc/src/dnd.qdoc
@@ -41,9 +41,11 @@
\tableofcontents
This document describes the basic drag and drop mechanism and
- outlines the approach used to enable it in custom widgets. Drag
- and drop operations are also supported by Qt's item views and by
- the graphics view framework. More information is available in
+ outlines the approach used to enable it in custom controls. Drag
+ and drop operations are also supported by many of Qt's controls,
+ such as the item views and graphics view framework, as well as
+ editing controls for Qt Widgets and Qt Quick. More information
+ about item views and graphics view is available in
\l{Using drag and drop with item views} and \l{Graphics View
Framework}.
@@ -56,22 +58,31 @@
\section1 Configuration
- The QApplication object provides some properties that are related
+ The QStyleHints object provides some properties that are related
to drag and drop operations:
\list
- \li \l{QApplication::startDragTime} describes the amount of time in
+ \li \l{QStyleHints::startDragTime()} describes the amount of time in
milliseconds that the user must hold down a mouse button over an
object before a drag will begin.
- \li \l{QApplication::startDragDistance} indicates how far the user has to
+ \li \l{QStyleHints::startDragDistance()} indicates how far the user has to
move the mouse while holding down a mouse button before the movement
- will be interpreted as dragging. Use of high values for this quantity
- prevents accidental dragging when the user only meant to click on an
- object.
+ will be interpreted as dragging.
+ \li \l{QStyleHints::startDragVelocity()} indicates how fast (in pixels/second)
+ the user has to move the mouse to start a drag. A value of \c 0 means
+ that there is no such limit.
\endlist
- These quantities provide sensible default values for you to use if you
- provide drag and drop support in your widgets.
+ These quantities provide sensible default values that are compliant with
+ the underlying windowing system for you to use if you
+ provide drag and drop support in your controls.
+
+ \section1 Drag and Drop in Qt Quick
+
+ The rest of the document focuses mainly on how to implement drag and drop
+ in C++. For using drag and drop inside a Qt Quick scene, please read the
+ documentation for the Qt Quick \l{Drag}, \l{DragEvent} and \l{DropArea} items.
+ There is also an example \l{quick/draganddrop}{available}.
\section1 Dragging
@@ -335,7 +346,7 @@
the clipboard. To access this, you need to obtain a QClipboard object
from the QApplication object:
- \snippet widgets/charactermap/mainwindow.cpp 3
+ \snippet ../widgets/widgets/charactermap/mainwindow.cpp 3
The QMimeData class is used to represent data that is transferred to and
from the clipboard. To put data on the clipboard, you can use the
@@ -350,7 +361,7 @@
For example, we can copy the contents of a QLineEdit to the clipboard
with the following code:
- \snippet widgets/charactermap/mainwindow.cpp 11
+ \snippet ../widgets/widgets/charactermap/mainwindow.cpp 11
Data with different MIME types can also be put on the clipboard.
Construct a QMimeData object and set data with setData() function in
diff --git a/src/gui/doc/src/richtext.qdoc b/src/gui/doc/src/richtext.qdoc
index b4ba4ba6c4..448c42631b 100644
--- a/src/gui/doc/src/richtext.qdoc
+++ b/src/gui/doc/src/richtext.qdoc
@@ -851,7 +851,7 @@
\contentspage richtext.html Contents
\previouspage Common Rich Text Editing Tasks
- Qt's text widgets are able to display rich text, specified using a subset of \l{HTML 4}
+ Qt's text widgets are able to display rich text, specified using a subset of \l {http://www.w3.org/TR/html401/}{HTML 4}
markup. Widgets that use QTextDocument, such as QLabel and QTextEdit, are able to display
rich text specified in this way.
@@ -863,7 +863,7 @@
setting a label's \l{QLabel::}{text} property with the string \c{"<b>Hello</b> <i>Qt!</i>"}
will result in the label displaying text like this: \b{Hello} \e{Qt!}
- When HTML markup is used for text, Qt follows the rules defined by the \l{HTML 4}
+ When HTML markup is used for text, Qt follows the rules defined by the \l{http://www.w3.org/TR/html401/}{HTML 4}
specification. This includes default properties for text layout, such as the
direction of the text flow (left-to-right) which can be changed by applying the
\l{#Block Attributes}{\c dir} attribute to blocks of text.
diff --git a/src/gui/gui.pro b/src/gui/gui.pro
index 301d704e2e..058cfe92ec 100644
--- a/src/gui/gui.pro
+++ b/src/gui/gui.pro
@@ -1,6 +1,8 @@
TARGET = QtGui
QT = core-private
-MODULE_CONFIG = opengl
+
+MODULE_CONFIG = needs_qpa_plugin
+contains(QT_CONFIG, opengl.*):MODULE_CONFIG += opengl
DEFINES += QT_NO_USING_NAMESPACE
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp
index c40ca1545a..dbc33719e2 100644
--- a/src/gui/image/qimage.cpp
+++ b/src/gui/image/qimage.cpp
@@ -4213,6 +4213,7 @@ QImage QImage::mirrored(bool horizontal, bool vertical) const
result.d->colortable = d->colortable;
result.d->has_alpha_clut = d->has_alpha_clut;
+ result.d->devicePixelRatio = d->devicePixelRatio;
if (depth() == 1)
w = (w+7)/8;
diff --git a/src/gui/image/qimageiohandler.cpp b/src/gui/image/qimageiohandler.cpp
index 8ec2dea431..36757a6f34 100644
--- a/src/gui/image/qimageiohandler.cpp
+++ b/src/gui/image/qimageiohandler.cpp
@@ -514,6 +514,8 @@ int QImageIOHandler::nextImageDelay() const
return 0;
}
+#ifndef QT_NO_IMAGEFORMATPLUGIN
+
/*!
Constructs an image plugin with the given \a parent. This is
invoked automatically by the moc generated code that exports the plugin.
@@ -554,4 +556,6 @@ QImageIOPlugin::~QImageIOPlugin()
\sa keys()
*/
+#endif // QT_NO_IMAGEFORMATPLUGIN
+
QT_END_NAMESPACE
diff --git a/src/gui/image/qimageiohandler.h b/src/gui/image/qimageiohandler.h
index 62f7ba1163..1f94099478 100644
--- a/src/gui/image/qimageiohandler.h
+++ b/src/gui/image/qimageiohandler.h
@@ -114,6 +114,8 @@ private:
Q_DISABLE_COPY(QImageIOHandler)
};
+#ifndef QT_NO_IMAGEFORMATPLUGIN
+
#define QImageIOHandlerFactoryInterface_iid "org.qt-project.Qt.QImageIOHandlerFactoryInterface"
class Q_GUI_EXPORT QImageIOPlugin : public QObject
@@ -136,6 +138,8 @@ public:
Q_DECLARE_OPERATORS_FOR_FLAGS(QImageIOPlugin::Capabilities)
+#endif // QT_NO_IMAGEFORMATPLUGIN
+
QT_END_NAMESPACE
QT_END_HEADER
diff --git a/src/gui/image/qimagereader.cpp b/src/gui/image/qimagereader.cpp
index a27a7710f6..7e6d937c9f 100644
--- a/src/gui/image/qimagereader.cpp
+++ b/src/gui/image/qimagereader.cpp
@@ -151,7 +151,7 @@
QT_BEGIN_NAMESPACE
-#ifndef QT_NO_LIBRARY
+#ifndef QT_NO_IMAGEFORMATPLUGIN
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
(QImageIOHandlerFactoryInterface_iid, QLatin1String("/imageformats")))
#endif
@@ -223,23 +223,23 @@ static QImageIOHandler *createReadHandlerHelper(QIODevice *device,
QByteArray form = format.toLower();
QImageIOHandler *handler = 0;
+ QByteArray suffix;
-#ifndef QT_NO_LIBRARY
+#ifndef QT_NO_IMAGEFORMATPLUGIN
typedef QMultiMap<int, QString> PluginKeyMap;
// check if we have plugins that support the image format
QFactoryLoader *l = loader();
const PluginKeyMap keyMap = l->keyMap();
-#endif
- QByteArray suffix;
#ifdef QIMAGEREADER_DEBUG
qDebug() << "QImageReader::createReadHandler( device =" << (void *)device << ", format =" << format << "),"
<< keyMap.values().size() << "plugins available: " << keyMap.values();
#endif
-#ifndef QT_NO_LIBRARY
int suffixPluginIndex = -1;
+#endif // QT_NO_IMAGEFORMATPLUGIN
+
if (device && format.isEmpty() && autoDetectImageFormat && !ignoresFormatAndExtension) {
// if there's no format, see if \a device is a file, and if so, find
// the file suffix and find support for that format among our plugins.
@@ -249,6 +249,7 @@ static QImageIOHandler *createReadHandlerHelper(QIODevice *device,
qDebug() << "QImageReader::createReadHandler: device is a file:" << file->fileName();
#endif
if (!(suffix = QFileInfo(file->fileName()).suffix().toLower().toLatin1()).isEmpty()) {
+#ifndef QT_NO_IMAGEFORMATPLUGIN
const int index = keyMap.key(QString::fromLatin1(suffix), -1);
if (index != -1) {
#ifdef QIMAGEREADER_DEBUG
@@ -257,17 +258,17 @@ static QImageIOHandler *createReadHandlerHelper(QIODevice *device,
#endif
suffixPluginIndex = index;
}
+#endif // QT_NO_IMAGEFORMATPLUGIN
}
}
}
-#endif // QT_NO_LIBRARY
QByteArray testFormat = !form.isEmpty() ? form : suffix;
if (ignoresFormatAndExtension)
testFormat = QByteArray();
-#ifndef QT_NO_LIBRARY
+#ifndef QT_NO_IMAGEFORMATPLUGIN
if (suffixPluginIndex != -1) {
// check if the plugin that claims support for this format can load
// from this device with this format.
@@ -322,7 +323,7 @@ static QImageIOHandler *createReadHandlerHelper(QIODevice *device,
device->seek(pos);
}
-#endif // QT_NO_LIBRARY
+#endif // QT_NO_IMAGEFORMATPLUGIN
// if we don't have a handler yet, check if we have built-in support for
// the format
@@ -369,7 +370,7 @@ static QImageIOHandler *createReadHandlerHelper(QIODevice *device,
#endif
}
-#ifndef QT_NO_LIBRARY
+#ifndef QT_NO_IMAGEFORMATPLUGIN
if (!handler && (autoDetectImageFormat || ignoresFormatAndExtension)) {
// check if any of our plugins recognize the file from its contents.
const qint64 pos = device ? device->pos() : 0;
@@ -389,7 +390,7 @@ static QImageIOHandler *createReadHandlerHelper(QIODevice *device,
if (device && !device->isSequential())
device->seek(pos);
}
-#endif // QT_NO_LIBRARY
+#endif // QT_NO_IMAGEFORMATPLUGIN
if (!handler && (autoDetectImageFormat || ignoresFormatAndExtension)) {
// check if any of our built-in handlers recognize the file from its
@@ -1235,7 +1236,7 @@ bool QImageReader::read(QImage *image)
}
// successful read; check for "@2x" file name suffix and set device pixel ratio.
- if (QFileInfo(fileName()).baseName().endsWith("@2x")) {
+ if (QFileInfo(fileName()).baseName().endsWith(QLatin1String("@2x"))) {
image->setDevicePixelRatio(2.0);
}
@@ -1429,7 +1430,7 @@ QByteArray QImageReader::imageFormat(QIODevice *device)
return format;
}
-#ifndef QT_NO_LIBRARY
+#ifndef QT_NO_IMAGEFORMATPLUGIN
void supportedImageHandlerFormats(QFactoryLoader *loader,
QImageIOPlugin::Capability cap,
QSet<QByteArray> *result);
@@ -1471,9 +1472,9 @@ QList<QByteArray> QImageReader::supportedImageFormats()
for (int i = 0; i < _qt_NumFormats; ++i)
formats << _qt_BuiltInFormats[i].extension;
-#ifndef QT_NO_LIBRARY
+#ifndef QT_NO_IMAGEFORMATPLUGIN
supportedImageHandlerFormats(loader(), QImageIOPlugin::CanRead, &formats);
-#endif // QT_NO_LIBRARY
+#endif // QT_NO_IMAGEFORMATPLUGIN
QList<QByteArray> sortedFormats;
for (QSet<QByteArray>::ConstIterator it = formats.constBegin(); it != formats.constEnd(); ++it)
diff --git a/src/gui/image/qimagewriter.cpp b/src/gui/image/qimagewriter.cpp
index 8e5fd5faec..6085a0e465 100644
--- a/src/gui/image/qimagewriter.cpp
+++ b/src/gui/image/qimagewriter.cpp
@@ -124,7 +124,7 @@
QT_BEGIN_NAMESPACE
-#ifndef QT_NO_LIBRARY
+#ifndef QT_NO_IMAGEFORMATPLUGIN
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
(QImageIOHandlerFactoryInterface_iid, QLatin1String("/imageformats")))
#endif
@@ -136,7 +136,7 @@ static QImageIOHandler *createWriteHandlerHelper(QIODevice *device,
QByteArray suffix;
QImageIOHandler *handler = 0;
-#ifndef QT_NO_LIBRARY
+#ifndef QT_NO_IMAGEFORMATPLUGIN
typedef QMultiMap<int, QString> PluginKeyMap;
// check if any plugins can write the image
@@ -151,7 +151,7 @@ static QImageIOHandler *createWriteHandlerHelper(QIODevice *device,
// this allows plugins to override our built-in handlers.
if (QFile *file = qobject_cast<QFile *>(device)) {
if (!(suffix = QFileInfo(file->fileName()).suffix().toLower().toLatin1()).isEmpty()) {
-#ifndef QT_NO_LIBRARY
+#ifndef QT_NO_IMAGEFORMATPLUGIN
const int index = keyMap.key(QString::fromLatin1(suffix), -1);
if (index != -1)
suffixPluginIndex = index;
@@ -162,7 +162,7 @@ static QImageIOHandler *createWriteHandlerHelper(QIODevice *device,
QByteArray testFormat = !form.isEmpty() ? form : suffix;
-#ifndef QT_NO_LIBRARY
+#ifndef QT_NO_IMAGEFORMATPLUGIN
if (suffixPluginIndex != -1) {
// when format is missing, check if we can find a plugin for the
// suffix.
@@ -173,7 +173,7 @@ static QImageIOHandler *createWriteHandlerHelper(QIODevice *device,
handler = plugin->create(device, suffix);
}
}
-#endif // QT_NO_LIBRARY
+#endif // QT_NO_IMAGEFORMATPLUGIN
// check if any built-in handlers can write the image
if (!handler && !testFormat.isEmpty()) {
@@ -214,7 +214,7 @@ static QImageIOHandler *createWriteHandlerHelper(QIODevice *device,
}
}
-#ifndef QT_NO_LIBRARY
+#ifndef QT_NO_IMAGEFORMATPLUGIN
if (!testFormat.isEmpty()) {
const int keyCount = keyMap.keys().size();
for (int i = 0; i < keyCount; ++i) {
@@ -226,7 +226,7 @@ static QImageIOHandler *createWriteHandlerHelper(QIODevice *device,
}
}
}
-#endif // QT_NO_LIBRARY
+#endif // QT_NO_IMAGEFORMATPLUGIN
if (!handler)
return 0;
@@ -655,7 +655,7 @@ bool QImageWriter::supportsOption(QImageIOHandler::ImageOption option) const
}
-#ifndef QT_NO_LIBRARY
+#ifndef QT_NO_IMAGEFORMATPLUGIN
void supportedImageHandlerFormats(QFactoryLoader *loader,
QImageIOPlugin::Capability cap,
QSet<QByteArray> *result)
@@ -677,7 +677,7 @@ void supportedImageHandlerFormats(QFactoryLoader *loader,
result->insert(key);
}
}
-#endif // QT_NO_LIBRARY
+#endif // QT_NO_IMAGEFORMATPLUGIN
/*!
Returns the list of image formats supported by QImageWriter.
@@ -729,9 +729,9 @@ QList<QByteArray> QImageWriter::supportedImageFormats()
formats << "gif";
#endif
-#ifndef QT_NO_LIBRARY
+#ifndef QT_NO_IMAGEFORMATPLUGIN
supportedImageHandlerFormats(loader(), QImageIOPlugin::CanWrite, &formats);
-#endif // QT_NO_LIBRARY
+#endif // QT_NO_IMAGEFORMATPLUGIN
QList<QByteArray> sortedFormats;
for (QSet<QByteArray>::ConstIterator it = formats.constBegin(); it != formats.constEnd(); ++it)
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index fb14490a24..72e95c996c 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -60,6 +60,7 @@
#include <QtCore/private/qthread_p.h>
#include <QtCore/qdir.h>
#include <QtDebug>
+#include "qaccessible.h"
#include <qpalette.h>
#include <qscreen.h>
#include "qsessionmanager.h"
@@ -1065,7 +1066,8 @@ QGuiApplicationPrivate::~QGuiApplicationPrivate()
QPixmapCache::clear();
- delete platform_theme;
+ delete platform_theme;
+ platform_theme = 0;
delete platform_integration;
platform_integration = 0;
delete m_gammaTables.load();
@@ -1183,6 +1185,9 @@ QPlatformNativeInterface *QGuiApplication::platformNativeInterface()
*/
int QGuiApplication::exec()
{
+#ifndef QT_NO_ACCESSIBILITY
+ QAccessible::setRootObject(qApp);
+#endif
return QCoreApplication::exec();
}
diff --git a/src/gui/kernel/qkeysequence.cpp b/src/gui/kernel/qkeysequence.cpp
index 66baa3db95..83e7b30a52 100644
--- a/src/gui/kernel/qkeysequence.cpp
+++ b/src/gui/kernel/qkeysequence.cpp
@@ -349,7 +349,7 @@ void Q_GUI_EXPORT qt_set_sequence_auto_mnemonic(bool b) { qt_sequence_no_mnemoni
\section1 GNU Emacs Style Key Sequences
- Key sequences similar to those used in \l{GNU Emacs}, allowing up to four
+ Key sequences similar to those used in \l{http://www.gnu.org/software/emacs/}{GNU Emacs}, allowing up to four
key codes, can be created by using the multiple argument constructor,
or by passing a human-readable string of comma-separated key sequences.
diff --git a/src/gui/kernel/qopenglcontext.cpp b/src/gui/kernel/qopenglcontext.cpp
index d2de6aa125..f16f29718d 100644
--- a/src/gui/kernel/qopenglcontext.cpp
+++ b/src/gui/kernel/qopenglcontext.cpp
@@ -121,7 +121,7 @@ QMutex QOpenGLContextPrivate::makeCurrentTrackerMutex;
\l{OpenGL documentation}.
For an example of how to use QOpenGLContext see the
- \l{gui/openglwindow}{OpenGL Window} example.
+ \l{OpenGL Window Example}{OpenGL Window} example.
\section1 Thread affinity
diff --git a/src/gui/kernel/qplatformcursor.h b/src/gui/kernel/qplatformcursor.h
index 138c5fdb58..babb91d9fd 100644
--- a/src/gui/kernel/qplatformcursor.h
+++ b/src/gui/kernel/qplatformcursor.h
@@ -92,7 +92,9 @@ public:
// input methods
virtual void pointerEvent(const QMouseEvent & event) { Q_UNUSED(event); }
+#ifndef QT_NO_CURSOR
virtual void changeCursor(QCursor * windowCursor, QWindow * window) = 0;
+#endif
virtual QPoint pos() const;
virtual void setPos(const QPoint &pos);
diff --git a/src/gui/kernel/qplatformdialoghelper.cpp b/src/gui/kernel/qplatformdialoghelper.cpp
index 79f1bd1b49..0ef08227a4 100644
--- a/src/gui/kernel/qplatformdialoghelper.cpp
+++ b/src/gui/kernel/qplatformdialoghelper.cpp
@@ -205,7 +205,7 @@ QColorDialogStaticData::QColorDialogStaticData() : customSet(false)
void QColorDialogStaticData::readSettings()
{
#ifndef QT_NO_SETTINGS
- const QSettings settings(QSettings::UserScope, QStringLiteral("Trolltech"));
+ const QSettings settings(QSettings::UserScope, QStringLiteral("QtProject"));
for (int i = 0; i < int(CustomColorCount); ++i) {
const QVariant v = settings.value(QStringLiteral("Qt/customColors/") + QString::number(i));
if (v.isValid())
@@ -218,7 +218,7 @@ void QColorDialogStaticData::writeSettings() const
{
#ifndef QT_NO_SETTINGS
if (!customSet) {
- QSettings settings(QSettings::UserScope, QStringLiteral("Trolltech"));
+ QSettings settings(QSettings::UserScope, QStringLiteral("QtProject"));
for (int i = 0; i < int(CustomColorCount); ++i)
settings.setValue(QStringLiteral("Qt/customColors/") + QString::number(i), customRgb[i]);
}
diff --git a/src/gui/kernel/qplatformnativeinterface.cpp b/src/gui/kernel/qplatformnativeinterface.cpp
index 925b2ad3de..cf487b2235 100644
--- a/src/gui/kernel/qplatformnativeinterface.cpp
+++ b/src/gui/kernel/qplatformnativeinterface.cpp
@@ -100,6 +100,12 @@ QPlatformNativeInterface::NativeResourceForContextFunction QPlatformNativeInterf
return 0;
}
+QPlatformNativeInterface::NativeResourceForScreenFunction QPlatformNativeInterface::nativeResourceFunctionForScreen(const QByteArray &resource)
+{
+ Q_UNUSED(resource);
+ return 0;
+}
+
QPlatformNativeInterface::NativeResourceForWindowFunction QPlatformNativeInterface::nativeResourceFunctionForWindow(const QByteArray &resource)
{
Q_UNUSED(resource);
diff --git a/src/gui/kernel/qplatformnativeinterface.h b/src/gui/kernel/qplatformnativeinterface.h
index cbf997bec4..8dd661f67e 100644
--- a/src/gui/kernel/qplatformnativeinterface.h
+++ b/src/gui/kernel/qplatformnativeinterface.h
@@ -78,10 +78,12 @@ public:
typedef void * (*NativeResourceForIntegrationFunction)();
typedef void * (*NativeResourceForContextFunction)(QOpenGLContext *context);
+ typedef void * (*NativeResourceForScreenFunction)(QScreen *screen);
typedef void * (*NativeResourceForWindowFunction)(QWindow *window);
typedef void * (*NativeResourceForBackingStoreFunction)(QBackingStore *backingStore);
virtual NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource);
virtual NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource);
+ virtual NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource);
virtual NativeResourceForWindowFunction nativeResourceFunctionForWindow(const QByteArray &resource);
virtual NativeResourceForBackingStoreFunction nativeResourceFunctionForBackingStore(const QByteArray &resource);
diff --git a/src/gui/kernel/qplatformwindow.cpp b/src/gui/kernel/qplatformwindow.cpp
index 25b863c9a3..82547b04ec 100644
--- a/src/gui/kernel/qplatformwindow.cpp
+++ b/src/gui/kernel/qplatformwindow.cpp
@@ -247,7 +247,12 @@ void QPlatformWindow::setParent(const QPlatformWindow *parent)
}
/*!
- Reimplement to set the window title to \a title
+ Reimplement to set the window title to \a title.
+
+ The implementation might want to append the application display name to
+ the window title, like Windows and Linux do.
+
+ \sa QGuiApplication::applicationDisplayName()
*/
void QPlatformWindow::setWindowTitle(const QString &title) { Q_UNUSED(title); }
@@ -331,31 +336,6 @@ void QPlatformWindow::handleContentOrientationChange(Qt::ScreenOrientation orien
}
/*!
- Request a different orientation of the platform window.
-
- This tells the window manager how the window wants to be rotated in order
- to be displayed, and how input events should be translated.
-
- As an example, a portrait compositor might rotate the window by 90 degrees,
- if the window is in landscape. It will also rotate input coordinates from
- portrait to landscape such that top right in portrait gets mapped to top
- left in landscape.
-
- If the implementation doesn't support the requested orientation it should
- signal this by returning an actual supported orientation.
-
- If the implementation doesn't support rotating the window at all it should
- return Qt::PrimaryOrientation, this is also the default value.
-
- \sa QWindow::requestWindowOrientation()
-*/
-Qt::ScreenOrientation QPlatformWindow::requestWindowOrientation(Qt::ScreenOrientation orientation)
-{
- Q_UNUSED(orientation);
- return Qt::PrimaryOrientation;
-}
-
-/*!
Reimplement this function in subclass to return the device pixel ratio
for the window. This is the ratio between physical pixels
and device-independent pixels.
@@ -469,9 +449,6 @@ bool QPlatformWindow::frameStrutEventsEnabled() const
QPlatformWindow is also the way QPA defines how native child windows should be supported
through the setParent function.
- The only way to retrieve a QPlatformOpenGLContext in QPA is by calling the glContext() function
- on QPlatformWindow.
-
\section1 Implementation Aspects
\list 1
diff --git a/src/gui/kernel/qplatformwindow.h b/src/gui/kernel/qplatformwindow.h
index 607c8e4035..5d7323ae2b 100644
--- a/src/gui/kernel/qplatformwindow.h
+++ b/src/gui/kernel/qplatformwindow.h
@@ -115,7 +115,6 @@ public:
virtual void requestActivateWindow();
virtual void handleContentOrientationChange(Qt::ScreenOrientation orientation);
- virtual Qt::ScreenOrientation requestWindowOrientation(Qt::ScreenOrientation orientation);
virtual qreal devicePixelRatio() const;
diff --git a/src/gui/kernel/qshortcutmap.cpp b/src/gui/kernel/qshortcutmap.cpp
index 43f37a900f..839cbf37e7 100644
--- a/src/gui/kernel/qshortcutmap.cpp
+++ b/src/gui/kernel/qshortcutmap.cpp
@@ -679,7 +679,7 @@ void QShortcutMap::dispatchEvent(QKeyEvent *e)
#if defined(DEBUG_QSHORTCUTMAP)
qDebug().nospace()
<< "QShortcutMap::dispatchEvent(): Sending QShortcutEvent(\""
- << (QString)next->keyseq << "\", " << next->id << ", "
+ << next->keyseq.toString() << "\", " << next->id << ", "
<< (bool)(enabledShortcuts>1) << ") to object(" << next->owner << ')';
#endif
QShortcutEvent se(next->keyseq, next->id, enabledShortcuts>1);
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp
index aaf2b25ad4..b6d592e050 100644
--- a/src/gui/kernel/qwindow.cpp
+++ b/src/gui/kernel/qwindow.cpp
@@ -89,23 +89,16 @@ QT_BEGIN_NAMESPACE
buffers to support double and triple buffering, as well as depth and stencil
buffers. To release a window's memory resources, call the destroy() function.
- \section1 Window and content orientation
-
- QWindow has reportContentOrientationChange() and
- requestWindowOrientation() that can be used to specify the
- layout of the window contents in relation to the screen. The
- window orientation determines the actual buffer layout of the
- window, and the windowing system uses this value to rotate the
- window before it ends up on the display, and to ensure that input
- coordinates are in the correct coordinate space relative to the
- application.
-
- On the other hand, the content orientation is simply a hint to the
- windowing system about which orientation the window contents are in.
- It's useful when you wish to keep the same buffer layout, but rotate
- the contents instead, especially when doing rotation animations
- between different orientations. The windowing system might use this
- value to determine the layout of system popups or dialogs.
+ \section1 Content orientation
+
+ QWindow has reportContentOrientationChange() that can be used to specify
+ the layout of the window contents in relation to the screen. The content
+ orientation is simply a hint to the windowing system about which
+ orientation the window contents are in. It's useful when you wish to keep
+ the same window size, but rotate the contents instead, especially when
+ doing rotation animations between different orientations. The windowing
+ system might use this value to determine the layout of system popups or
+ dialogs.
\section1 Visibility and Windowing system exposure.
@@ -661,9 +654,11 @@ void QWindow::lower()
void QWindow::setOpacity(qreal level)
{
Q_D(QWindow);
- if (d->platformWindow) {
+ if (level == d->opacity) // #fixme: Add property for 5.1
+ return;
+ d->opacity = level;
+ if (d->platformWindow)
d->platformWindow->setOpacity(level);
- }
}
/*!
@@ -743,8 +738,6 @@ bool QWindow::isActive() const
to compute the necessary transform.
The default value is Qt::PrimaryOrientation
-
- \sa requestOrientation(), QScreen::orientation()
*/
void QWindow::reportContentOrientationChange(Qt::ScreenOrientation orientation)
{
@@ -766,46 +759,6 @@ Qt::ScreenOrientation QWindow::contentOrientation() const
}
/*!
- Requests the given window \a orientation.
-
- The window \a orientation specifies how the window should be rotated
- by the window manager in order to be displayed. Input events will
- be correctly mapped to the given \a orientation.
-
- The return value is false if the system doesn't support the given
- \a orientation (for example when requesting a portrait orientation
- on a device that only handles landscape buffers, typically a desktop
- system).
-
- If the return value is false, call \l orientation() to get the actual
- supported orientation.
-
- \sa orientation(), reportContentOrientationChange(), QScreen::orientation()
-*/
-bool QWindow::requestOrientation(Qt::ScreenOrientation orientation)
-{
- Q_D(QWindow);
- if (!d->platformWindow)
- create();
- Q_ASSERT(d->platformWindow);
- d->windowOrientation = d->platformWindow->requestWindowOrientation(orientation);
- return d->windowOrientation == orientation;
-}
-
-/*!
- Returns the actual window orientation.
-
- The default value is Qt::PrimaryOrientation.
-
- \sa requestOrientation()
-*/
-Qt::ScreenOrientation QWindow::orientation() const
-{
- Q_D(const QWindow);
- return d->windowOrientation;
-}
-
-/*!
Returns the ratio between physical pixels and device-independent pixels
for the window. This value is dependent on the screen the window is on,
and may change when the window is moved.
@@ -983,11 +936,59 @@ void QWindow::setMinimumSize(const QSize &size)
emit minimumHeightChanged(d->minimumSize.height());
}
+/*!
+ \property QWindow::x
+ \brief the x position of the window's geometry
+*/
+void QWindow::setX(int arg)
+{
+ if (x() != arg)
+ setGeometry(QRect(arg, y(), width(), height()));
+}
+
+/*!
+ \property QWindow::y
+ \brief the y position of the window's geometry
+*/
+void QWindow::setY(int arg)
+{
+ if (y() != arg)
+ setGeometry(QRect(x(), arg, width(), height()));
+}
+
+/*!
+ \property QWindow::width
+ \brief the width of the window's geometry
+*/
+void QWindow::setWidth(int arg)
+{
+ if (width() != arg)
+ setGeometry(QRect(x(), y(), arg, height()));
+}
+
+/*!
+ \property QWindow::height
+ \brief the height of the window's geometry
+*/
+void QWindow::setHeight(int arg)
+{
+ if (height() != arg)
+ setGeometry(QRect(x(), y(), width(), arg));
+}
+
+/*!
+ \property QWindow::minimumWidth
+ \brief the minimum width of the window's geometry
+*/
void QWindow::setMinimumWidth(int w)
{
setMinimumSize(QSize(w, minimumHeight()));
}
+/*!
+ \property QWindow::minimumHeight
+ \brief the minimum height of the window's geometry
+*/
void QWindow::setMinimumHeight(int h)
{
setMinimumSize(QSize(minimumWidth(), h));
@@ -1016,11 +1017,19 @@ void QWindow::setMaximumSize(const QSize &size)
emit maximumHeightChanged(d->maximumSize.height());
}
+/*!
+ \property QWindow::maximumWidth
+ \brief the maximum width of the window's geometry
+*/
void QWindow::setMaximumWidth(int w)
{
setMaximumSize(QSize(w, maximumHeight()));
}
+/*!
+ \property QWindow::maximumHeight
+ \brief the maximum height of the window's geometry
+*/
void QWindow::setMaximumHeight(int h)
{
setMaximumSize(QSize(maximumWidth(), h));
@@ -1069,13 +1078,15 @@ void QWindow::setSizeIncrement(const QSize &size)
}
/*!
- \fn void QWindow::setGeometry(int posx, int posy, int w, int h)
-
Sets the geometry of the window, excluding its window frame, to a
rectangle constructed from \a posx, \a posy, \a w and \a h.
\sa geometry()
*/
+void QWindow::setGeometry(int posx, int posy, int w, int h)
+{
+ setGeometry(QRect(posx, posy, w, h));
+}
/*!
\brief Sets the geometry of the window, excluding its window frame, to \a rect.
@@ -1107,46 +1118,6 @@ void QWindow::setGeometry(const QRect &rect)
}
/*!
- \property QWindow::x
- \brief the x position of the window's geometry
-*/
-
-/*!
- \property QWindow::y
- \brief the y position of the window's geometry
-*/
-
-/*!
- \property QWindow::width
- \brief the width of the window's geometry
-*/
-
-/*!
- \property QWindow::height
- \brief the height of the window's geometry
-*/
-
-/*!
- \property QWindow::minimumWidth
- \brief the minimum width of the window's geometry
-*/
-
-/*!
- \property QWindow::minimumHeight
- \brief the minimum height of the window's geometry
-*/
-
-/*!
- \property QWindow::maximumWidth
- \brief the maximum width of the window's geometry
-*/
-
-/*!
- \property QWindow::maximumHeight
- \brief the maximum height of the window's geometry
-*/
-
-/*!
Returns the geometry of the window, excluding its window frame.
\sa frameMargins(), frameGeometry()
@@ -1221,18 +1192,24 @@ void QWindow::setFramePosition(const QPoint &point)
}
/*!
- \fn void QWindow::setPosition(const QPoint &pt)
\brief set the position of the window on the desktop to \a pt
\sa position()
*/
+void QWindow::setPosition(const QPoint &pt)
+{
+ setGeometry(QRect(pt, size()));
+}
/*!
- \fn void QWindow::setPosition(int posx, int posy)
\brief set the position of the window on the desktop to \a posx, \a posy
\sa position()
*/
+void QWindow::setPosition(int posx, int posy)
+{
+ setPosition(QPoint(posx, posy));
+}
/*!
\fn QPoint QWindow::position() const
@@ -1249,13 +1226,15 @@ void QWindow::setFramePosition(const QPoint &point)
*/
/*!
- \fn void QWindow::resize(int w, int h)
-
set the size of the window, excluding any window frame, to a QSize
constructed from width \a w and height \a h
\sa size(), geometry()
*/
+void QWindow::resize(int w, int h)
+{
+ resize(QSize(w, h));
+}
/*!
\brief set the size of the window, excluding any window frame, to \a newSize
diff --git a/src/gui/kernel/qwindow.h b/src/gui/kernel/qwindow.h
index 229275d7c7..c1a8e7971a 100644
--- a/src/gui/kernel/qwindow.h
+++ b/src/gui/kernel/qwindow.h
@@ -113,35 +113,6 @@ class Q_GUI_EXPORT QWindow : public QObject, public QSurface
Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged)
Q_PROPERTY(Qt::ScreenOrientation contentOrientation READ contentOrientation WRITE reportContentOrientationChange NOTIFY contentOrientationChanged)
- // ------------------------------------------------------------------------
- // Temporary backwards-compatibility properties to be removed ASAP
- Q_PROPERTY(QString windowTitle READ windowTitle WRITE setWindowTitle)
- Q_PROPERTY(QString windowFilePath READ windowFilePath WRITE setWindowFilePath)
- Q_PROPERTY(QIcon windowIcon READ windowIcon WRITE setWindowIcon)
- Q_PROPERTY(Qt::WindowModality windowModality READ windowModality WRITE setWindowModality NOTIFY windowModalityChanged)
-
-public:
-
- Qt::WindowModality windowModality() const { return modality(); }
- void setWindowModality(Qt::WindowModality wm) { setModality(wm); }
- void setWindowFlags(Qt::WindowFlags f) { setFlags(f); }
- Qt::WindowFlags windowFlags() const { return flags(); }
- Qt::WindowType windowType() const { return type(); }
- QString windowTitle() const { return title(); }
- void requestActivateWindow() { requestActivate(); }
- bool requestWindowOrientation(Qt::ScreenOrientation o) { return requestOrientation(o); }
- Qt::ScreenOrientation windowOrientation() const { return orientation(); }
- void setWindowFilePath(const QString &fp) { setFilePath(fp); }
- QString windowFilePath() const { return filePath(); }
- void setWindowIcon(const QIcon &i) { setIcon(i); }
- QIcon windowIcon() const { return icon(); }
- void setWindowTitle(const QString &t) { setTitle(t); }
-
-Q_SIGNALS:
- void windowModalityChanged(Qt::WindowModality windowModality);
- // End of temporary backwards-compatibility properties
- // ------------------------------------------------------------------------
-
public:
explicit QWindow(QScreen *screen = 0);
@@ -186,9 +157,6 @@ public:
qreal devicePixelRatio() const;
- bool requestOrientation(Qt::ScreenOrientation orientation);
- Qt::ScreenOrientation orientation() const;
-
Qt::WindowState windowState() const;
void setWindowState(Qt::WindowState state);
@@ -204,10 +172,10 @@ public:
bool isExposed() const;
- int minimumWidth() const { return minimumSize().width(); }
- int minimumHeight() const { return minimumSize().height(); }
- int maximumWidth() const { return maximumSize().width(); }
- int maximumHeight() const { return maximumSize().height(); }
+ inline int minimumWidth() const { return minimumSize().width(); }
+ inline int minimumHeight() const { return minimumSize().height(); }
+ inline int maximumWidth() const { return maximumSize().width(); }
+ inline int maximumHeight() const { return maximumSize().height(); }
QSize minimumSize() const;
QSize maximumSize() const;
@@ -219,7 +187,7 @@ public:
void setBaseSize(const QSize &size);
void setSizeIncrement(const QSize &size);
- void setGeometry(int posx, int posy, int w, int h) { setGeometry(QRect(posx, posy, w, h)); }
+ void setGeometry(int posx, int posy, int w, int h);
void setGeometry(const QRect &rect);
QRect geometry() const;
@@ -237,18 +205,11 @@ public:
inline QSize size() const { return geometry().size(); }
inline QPoint position() const { return geometry().topLeft(); }
- inline void setPosition(const QPoint &pt) { setGeometry(QRect(pt, size())); }
- inline void setPosition(int posx, int posy) { setPosition(QPoint(posx, posy)); }
-
-// Temporary backwards-compatible accessors for the benefit of Declarative
-// to be removed ASAP
- inline void setFramePos(const QPoint &pt) { setFramePosition(pt); }
- inline void setPos(const QPoint &pt) { setPosition(pt); }
- inline void setPos(int posx, int posy) { setPosition(posx, posy); }
-// end of temporary accessors
+ void setPosition(const QPoint &pt);
+ void setPosition(int posx, int posy);
void resize(const QSize &newSize);
- inline void resize(int w, int h) { resize(QSize(w, h)); }
+ void resize(int w, int h);
void setFilePath(const QString &filePath);
QString filePath() const;
@@ -295,29 +256,10 @@ public Q_SLOTS:
void setTitle(const QString &);
- void setX(int arg)
- {
- if (x() != arg)
- setGeometry(QRect(arg, y(), width(), height()));
- }
-
- void setY(int arg)
- {
- if (y() != arg)
- setGeometry(QRect(x(), arg, width(), height()));
- }
-
- void setWidth(int arg)
- {
- if (width() != arg)
- setGeometry(QRect(x(), y(), arg, height()));
- }
-
- void setHeight(int arg)
- {
- if (height() != arg)
- setGeometry(QRect(x(), y(), width(), arg));
- }
+ void setX(int arg);
+ void setY(int arg);
+ void setWidth(int arg);
+ void setHeight(int arg);
void setMinimumWidth(int w);
void setMinimumHeight(int h);
diff --git a/src/gui/kernel/qwindow_p.h b/src/gui/kernel/qwindow_p.h
index fcc5540185..305888d02c 100644
--- a/src/gui/kernel/qwindow_p.h
+++ b/src/gui/kernel/qwindow_p.h
@@ -89,7 +89,7 @@ public:
, receivedExpose(false)
, positionPolicy(WindowFrameExclusive)
, contentOrientation(Qt::PrimaryOrientation)
- , windowOrientation(Qt::PrimaryOrientation)
+ , opacity(qreal(1.0))
, minimumSize(0, 0)
, maximumSize(QWINDOWSIZE_MAX, QWINDOWSIZE_MAX)
, modality(Qt::NonModal)
@@ -136,7 +136,7 @@ public:
bool receivedExpose;
PositionPolicy positionPolicy;
Qt::ScreenOrientation contentOrientation;
- Qt::ScreenOrientation windowOrientation;
+ qreal opacity;
QSize minimumSize;
QSize maximumSize;
diff --git a/src/gui/math3d/qmatrix4x4.cpp b/src/gui/math3d/qmatrix4x4.cpp
index 4e35d49118..e0f401bc10 100644
--- a/src/gui/math3d/qmatrix4x4.cpp
+++ b/src/gui/math3d/qmatrix4x4.cpp
@@ -45,6 +45,8 @@
#include <QtGui/qmatrix.h>
#include <QtGui/qtransform.h>
+#include <cmath>
+
QT_BEGIN_NAMESPACE
#ifndef QT_NO_MATRIX4X4
@@ -1456,27 +1458,29 @@ void QMatrix4x4::frustum(float left, float right, float bottom, float top, float
/*!
Multiplies this matrix by another that applies a perspective
- projection. The field of view will be \a angle degrees within
- a window with a given \a aspect ratio. The projection will
- have the specified \a nearPlane and \a farPlane clipping planes.
+ projection. The vertical field of view will be \a verticalAngle degrees
+ within a window with a given \a aspectRatio that determines the horizontal
+ field of view.
+ The projection will have the specified \a nearPlane and \a farPlane clipping
+ planes which are the distances from the viewer to the corresponding planes.
\sa ortho(), frustum()
*/
-void QMatrix4x4::perspective(float angle, float aspect, float nearPlane, float farPlane)
+void QMatrix4x4::perspective(float verticalAngle, float aspectRatio, float nearPlane, float farPlane)
{
// Bail out if the projection volume is zero-sized.
- if (nearPlane == farPlane || aspect == 0.0f)
+ if (nearPlane == farPlane || aspectRatio == 0.0f)
return;
// Construct the projection.
QMatrix4x4 m(1);
- float radians = (angle / 2.0f) * M_PI / 180.0f;
+ float radians = (verticalAngle / 2.0f) * M_PI / 180.0f;
float sine = sinf(radians);
if (sine == 0.0f)
return;
float cotan = cosf(radians) / sine;
float clip = farPlane - nearPlane;
- m.m[0][0] = cotan / aspect;
+ m.m[0][0] = cotan / aspectRatio;
m.m[1][0] = 0.0f;
m.m[2][0] = 0.0f;
m.m[3][0] = 0.0f;
diff --git a/src/gui/math3d/qmatrix4x4.h b/src/gui/math3d/qmatrix4x4.h
index bbad04b8b1..df98f0291a 100644
--- a/src/gui/math3d/qmatrix4x4.h
+++ b/src/gui/math3d/qmatrix4x4.h
@@ -146,7 +146,7 @@ public:
void ortho(const QRectF& rect);
void ortho(float left, float right, float bottom, float top, float nearPlane, float farPlane);
void frustum(float left, float right, float bottom, float top, float nearPlane, float farPlane);
- void perspective(float angle, float aspect, float nearPlane, float farPlane);
+ void perspective(float verticalAngle, float aspectRatio, float nearPlane, float farPlane);
#ifndef QT_NO_VECTOR3D
void lookAt(const QVector3D& eye, const QVector3D& center, const QVector3D& up);
#endif
diff --git a/src/gui/math3d/qquaternion.cpp b/src/gui/math3d/qquaternion.cpp
index 3f39fa43c3..2ccdd315d3 100644
--- a/src/gui/math3d/qquaternion.cpp
+++ b/src/gui/math3d/qquaternion.cpp
@@ -45,6 +45,8 @@
#include <QtCore/qvariant.h>
#include <QtCore/qdebug.h>
+#include <cmath>
+
QT_BEGIN_NAMESPACE
#ifndef QT_NO_QUATERNION
diff --git a/src/gui/opengl/opengl.pri b/src/gui/opengl/opengl.pri
index c241354e9c..2256f201d2 100644
--- a/src/gui/opengl/opengl.pri
+++ b/src/gui/opengl/opengl.pri
@@ -46,5 +46,3 @@ contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles2) {
opengl/qtriangulator.cpp
}
-
-#INCLUDEPATH += ../3rdparty/harfbuzz/src
diff --git a/src/gui/opengl/qopenglpaintdevice.cpp b/src/gui/opengl/qopenglpaintdevice.cpp
index b2ffac69ca..79e692b8cf 100644
--- a/src/gui/opengl/qopenglpaintdevice.cpp
+++ b/src/gui/opengl/qopenglpaintdevice.cpp
@@ -63,11 +63,47 @@ QT_BEGIN_NAMESPACE
\ingroup painting-3D
+ The QOpenGLPaintDevice uses the current QOpenGL context to render
+ QPainter draw commands. It requires OpenGL (ES) 2.0 support or
+ higher.
+
+ \section1 Performance
+
+ The QOpenGLPaintDevice is almost always hardware accelerated and
+ has the potential of being much faster than software
+ rasterization. However, it is more sensitive to state changes, and
+ therefore requires the drawing commands to be carefully ordered to
+ achieve optimal performance.
+
+ \section1 Antialiasing and Quality
+
+ Antialiasing in the OpenGL paint engine is done using
+ multisampling. Most hardware require significantly more memory to
+ do multisampling and the resulting quality is not on par with the
+ quality of the software paint engine. The OpenGL paint engine's
+ strenght lies in its performance, not its visual rendering
+ quality.
+
+ \section1 State Changes
+
When painting to a QOpenGLPaintDevice using QPainter, the state of
- the current OpenGL context will be altered by the paint engine to reflect
- its needs. Applications should not rely upon the OpenGL state being reset
- to its original conditions, particularly the current shader program,
- OpenGL viewport, texture units, and drawing modes.
+ the current OpenGL context will be altered by the paint engine to
+ reflect its needs. Applications should not rely upon the OpenGL
+ state being reset to its original conditions, particularly the
+ current shader program, OpenGL viewport, texture units, and
+ drawing modes.
+
+ \section1 Mixing QPainter and OpenGL
+
+ When intermixing QPainter and OpenGL, it is important to notify
+ QPainter that the OpenGL state may have been cluttered so it can
+ restore its internal state. This is acheived by calling \l
+ QPainter::beginNativePainting() before starting the OpenGL
+ rendering and calling \l QPainter::endNativePainting() after
+ finishing.
+
+ \sa {OpenGL Window Example}
+
*/
class QOpenGLPaintDevicePrivate
diff --git a/src/gui/painting/qcolor.cpp b/src/gui/painting/qcolor.cpp
index 72ca7ad8a8..e7d68f6df8 100644
--- a/src/gui/painting/qcolor.cpp
+++ b/src/gui/painting/qcolor.cpp
@@ -503,7 +503,7 @@ QString QColor::name() const
\li #RRGGBB
\li #RRRGGGBBB
\li #RRRRGGGGBBBB
- \li A name from the list of colors defined in the list of \l{SVG color keyword names}
+ \li A name from the list of colors defined in the list of \l{http://www.w3.org/TR/SVG/types.html#ColorKeywords}{SVG color keyword names}
provided by the World Wide Web Consortium; for example, "steelblue" or "gainsboro".
These color names work on all platforms. Note that these color names are \e not the
same as defined by the Qt::GlobalColor enums, e.g. "green" and Qt::green does not
diff --git a/src/gui/painting/qdrawhelper_ssse3.cpp b/src/gui/painting/qdrawhelper_ssse3.cpp
index 09e0516dcb..9f80c70fcc 100644
--- a/src/gui/painting/qdrawhelper_ssse3.cpp
+++ b/src/gui/painting/qdrawhelper_ssse3.cpp
@@ -60,7 +60,7 @@ inline static void blend_pixel(quint32 &dst, const quint32 src)
shift (4, 8, 12). Checking the alignment inside the loop is unfortunatelly way too slow.
*/
#define BLENDING_LOOP(palignrOffset, length)\
- for (; x < length-3; x += 4) { \
+ for (; x-minusOffsetToAlignSrcOn16Bytes < length-7; x += 4) { \
const __m128i srcVectorLastLoaded = _mm_load_si128((__m128i *)&src[x - minusOffsetToAlignSrcOn16Bytes + 4]);\
const __m128i srcVector = _mm_alignr_epi8(srcVectorLastLoaded, srcVectorPrevLoaded, palignrOffset); \
const __m128i srcVectorAlpha = _mm_and_si128(srcVector, alphaMask); \
diff --git a/src/gui/painting/qmath_p.h b/src/gui/painting/qmath_p.h
index c710ee462a..bc7bb320b7 100644
--- a/src/gui/painting/qmath_p.h
+++ b/src/gui/painting/qmath_p.h
@@ -61,6 +61,7 @@ QT_BEGIN_NAMESPACE
static const qreal Q_PI = qreal(3.14159265358979323846); // pi
static const qreal Q_2PI = qreal(6.28318530717958647693); // 2*pi
static const qreal Q_PI2 = qreal(1.57079632679489661923); // pi/2
+static const qreal Q_MM_PER_INCH = 25.4;
inline int qIntSqrtInt(int v)
{
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index 46648fe297..0e9129f8c0 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -4588,7 +4588,7 @@ void QSpanData::setupMatrix(const QTransform &matrix, int bilin)
txop = inv.type();
bilinear = bilin;
- const bool affine = !m13 && !m23;
+ const bool affine = inv.isAffine();
fast_matrix = affine
&& m11 * m11 + m21 * m21 < 1e4
&& m12 * m12 + m22 * m22 < 1e4
diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp
index e87e6eb83b..5714645728 100644
--- a/src/gui/text/qfontdatabase.cpp
+++ b/src/gui/text/qfontdatabase.cpp
@@ -273,27 +273,15 @@ struct QtFontFoundry
QtFontStyle *QtFontFoundry::style(const QtFontStyle::Key &key, const QString &styleName, bool create)
{
int pos = 0;
- if (count) {
- // if styleName for searching first if possible
- if (!styleName.isEmpty()) {
- for (; pos < count; pos++) {
- if (styles[pos]->styleName == styleName)
- return styles[pos];
- }
- }
- int low = 0;
- int high = count;
- pos = count / 2;
- while (high > low) {
+ for (; pos < count; pos++) {
+ bool hasStyleName = !styleName.isEmpty(); // search styleName first if available
+ if (hasStyleName && !styles[pos]->styleName.isEmpty()) {
+ if (styles[pos]->styleName == styleName)
+ return styles[pos];
+ } else {
if (styles[pos]->key == key)
return styles[pos];
- if (styles[pos]->key < key)
- low = pos + 1;
- else
- high = pos;
- pos = (high + low) / 2;
}
- pos = low;
}
if (!create)
return 0;
@@ -308,7 +296,6 @@ QtFontStyle *QtFontFoundry::style(const QtFontStyle::Key &key, const QString &st
QtFontStyle *style = new QtFontStyle(key);
style->styleName = styleName;
- memmove(styles + pos + 1, styles + pos, (count-pos)*sizeof(QtFontStyle *));
styles[pos] = style;
count++;
return styles[pos];
@@ -594,7 +581,7 @@ QtFontFamily *QFontDatabasePrivate::family(const QString &f, bool create)
if (res < 0)
pos++;
- // qDebug("adding family %s at %d total=%d", f.latin1(), pos, count);
+ // qDebug() << "adding family " << f.toLatin1() << " at " << pos << " total=" << count;
if (!(count % 8)) {
QtFontFamily **newFamilies = (QtFontFamily **)
realloc(families,
diff --git a/src/gui/text/qfontdatabase_qpa.cpp b/src/gui/text/qfontdatabase_qpa.cpp
index 366f995790..70a8af0b66 100644
--- a/src/gui/text/qfontdatabase_qpa.cpp
+++ b/src/gui/text/qfontdatabase_qpa.cpp
@@ -52,7 +52,8 @@
QT_BEGIN_NAMESPACE
-Q_GUI_EXPORT void qt_registerFont(const QString &familyName, const QString &foundryname, int weight,
+Q_GUI_EXPORT void qt_registerFont(const QString &familyName, const QString &stylename,
+ const QString &foundryname, int weight,
QFont::Style style, int stretch, bool antialiased,
bool scalable, int pixelSize, bool fixedPitch,
const QSupportedWritingSystems &writingSystems, void *handle)
@@ -75,7 +76,7 @@ Q_GUI_EXPORT void qt_registerFont(const QString &familyName, const QString &fou
}
QtFontFoundry *foundry = f->foundry(foundryname, true);
- QtFontStyle *fontStyle = foundry->style(styleKey, QString(), true);
+ QtFontStyle *fontStyle = foundry->style(styleKey, stylename, true);
fontStyle->smoothScalable = scalable;
fontStyle->antialiased = antialiased;
QtFontSize *size = fontStyle->pixelSize(pixelSize ? pixelSize : SMOOTH_SCALABLE, true);
diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp
index b9a7e69c9d..aa9879882b 100644
--- a/src/gui/text/qfontengine_ft.cpp
+++ b/src/gui/text/qfontengine_ft.cpp
@@ -588,6 +588,16 @@ static void convertRGBToARGB_V(const uchar *src, uint *dst, int width, int heigh
}
}
+static void convertGRAYToARGB(const uchar *src, uint *dst, int width, int height, int src_pitch) {
+ for (int y = 0; y < height; ++y) {
+ int readpos = (y * src_pitch);
+ int writepos = (y * width);
+ for (int x = 0; x < width; ++x) {
+ dst[writepos + x] = (0xFF << 24) + (src[readpos + x] << 16) + (src[readpos + x] << 8) + src[readpos + x];
+ }
+ }
+}
+
static void convoluteBitmap(const uchar *src, uchar *dst, int width, int height, int pitch)
{
// convolute the bitmap with a triangle filter to get rid of color fringes
@@ -1016,7 +1026,7 @@ QFontEngineFT::Glyph *QFontEngineFT::loadGlyph(QGlyphSet *set, uint glyph,
bitmap.rows = info.height*vfactor;
bitmap.width = hpixels;
bitmap.pitch = format == Format_Mono ? (((info.width + 31) & ~31) >> 3) : ((bitmap.width + 3) & ~3);
- if (!hsubpixel && vfactor == 1)
+ if (!hsubpixel && vfactor == 1 && format != Format_A32)
bitmap.buffer = glyph_buffer;
else
bitmap.buffer = new uchar[bitmap.rows*bitmap.pitch];
@@ -1047,6 +1057,8 @@ QFontEngineFT::Glyph *QFontEngineFT::loadGlyph(QGlyphSet *set, uint glyph,
delete [] convoluted;
} else if (vfactor != 1) {
convertRGBToARGB_V(bitmap.buffer, (uint *)glyph_buffer, info.width, info.height, bitmap.pitch, subpixelType != QFontEngineFT::Subpixel_VRGB, true);
+ } else if (format == Format_A32 && bitmap.pixel_mode == FT_PIXEL_MODE_GRAY) {
+ convertGRAYToARGB(bitmap.buffer, (uint *)glyph_buffer, info.width, info.height, bitmap.pitch);
}
if (bitmap.buffer != glyph_buffer)
diff --git a/src/gui/text/qplatformfontdatabase.cpp b/src/gui/text/qplatformfontdatabase.cpp
index f3e573e313..903b1e4c3d 100644
--- a/src/gui/text/qplatformfontdatabase.cpp
+++ b/src/gui/text/qplatformfontdatabase.cpp
@@ -47,7 +47,8 @@
QT_BEGIN_NAMESPACE
-extern void qt_registerFont(const QString &familyname, const QString &foundryname, int weight,
+extern void qt_registerFont(const QString &familyname, const QString &stylename,
+ const QString &foundryname, int weight,
QFont::Style style, int stretch, bool antialiased,
bool scalable, int pixelSize, bool fixedPitch,
const QSupportedWritingSystems &writingSystems, void *hanlde);
@@ -89,7 +90,7 @@ void QPlatformFontDatabase::registerQPF2Font(const QByteArray &dataArray, void *
}
}
QFont::Stretch stretch = QFont::Unstretched;
- registerFont(fontName,QString(),fontWeight,fontStyle,stretch,true,false,pixelSize,false,writingSystems,handle);
+ registerFont(fontName,QString(),QString(),fontWeight,fontStyle,stretch,true,false,pixelSize,false,writingSystems,handle);
}
} else {
qDebug() << "header verification of QPF2 font failed. maybe it is corrupt?";
@@ -117,7 +118,8 @@ void QPlatformFontDatabase::registerQPF2Font(const QByteArray &dataArray, void *
\sa registerQPF2Font()
*/
-void QPlatformFontDatabase::registerFont(const QString &familyname, const QString &foundryname, QFont::Weight weight,
+void QPlatformFontDatabase::registerFont(const QString &familyname, const QString &stylename,
+ const QString &foundryname, QFont::Weight weight,
QFont::Style style, QFont::Stretch stretch, bool antialiased,
bool scalable, int pixelSize, bool fixedPitch,
const QSupportedWritingSystems &writingSystems, void *usrPtr)
@@ -125,7 +127,7 @@ void QPlatformFontDatabase::registerFont(const QString &familyname, const QStrin
if (scalable)
pixelSize = 0;
- qt_registerFont(familyname, foundryname, weight, style,
+ qt_registerFont(familyname, stylename, foundryname, weight, style,
stretch, antialiased, scalable, pixelSize,
fixedPitch, writingSystems, usrPtr);
}
diff --git a/src/gui/text/qplatformfontdatabase.h b/src/gui/text/qplatformfontdatabase.h
index fe7782be8f..7d9834fa37 100644
--- a/src/gui/text/qplatformfontdatabase.h
+++ b/src/gui/text/qplatformfontdatabase.h
@@ -116,7 +116,8 @@ public:
//callback
static void registerQPF2Font(const QByteArray &dataArray, void *handle);
- static void registerFont(const QString &familyname, const QString &foundryname, QFont::Weight weight,
+ static void registerFont(const QString &familyname, const QString &stylename,
+ const QString &foundryname, QFont::Weight weight,
QFont::Style style, QFont::Stretch stretch, bool antialiased,
bool scalable, int pixelSize, bool fixedPitch,
const QSupportedWritingSystems &writingSystems, void *handle);
diff --git a/src/gui/text/text.pri b/src/gui/text/text.pri
index face6f248f..436b7c7aec 100644
--- a/src/gui/text/text.pri
+++ b/src/gui/text/text.pri
@@ -85,5 +85,3 @@ SOURCES += \
HEADERS += \
text/qplatformfontdatabase.h
-
-INCLUDEPATH += ../3rdparty/harfbuzz/src
diff --git a/src/gui/util/qdesktopservices.cpp b/src/gui/util/qdesktopservices.cpp
index ca284eecd5..94a3343164 100644
--- a/src/gui/util/qdesktopservices.cpp
+++ b/src/gui/util/qdesktopservices.cpp
@@ -250,6 +250,8 @@ void QDesktopServices::unsetUrlHandler(const QString &scheme)
/*!
\enum QDesktopServices::StandardLocation
\since 4.4
+ \obsolete
+ Use QStandardPaths::StandardLocation
This enum describes the different locations that can be queried by
QDesktopServices::storageLocation and QDesktopServices::displayName.
diff --git a/src/network/access/qnetworkcookie.cpp b/src/network/access/qnetworkcookie.cpp
index bfc439ef74..f07516c3fd 100644
--- a/src/network/access/qnetworkcookie.cpp
+++ b/src/network/access/qnetworkcookie.cpp
@@ -90,9 +90,9 @@ QT_BEGIN_NAMESPACE
This class implements cookies as described by the
\l{Netscape Cookie Specification}{initial cookie specification by
- Netscape}, which is somewhat similar to the \l{RFC 2109} specification,
+ Netscape}, which is somewhat similar to the \l{http://www.rfc-editor.org/rfc/rfc2109.txt}{RFC 2109} specification,
plus the \l{Mitigating Cross-site Scripting With HTTP-only Cookies}
- {"HttpOnly" extension}. The more recent \l{RFC 2965} specification
+ {"HttpOnly" extension}. The more recent \l{http://www.rfc-editor.org/rfc/rfc2965.txt}{RFC 2965} specification
(which uses the Set-Cookie2 header) is not supported.
\sa QNetworkCookieJar, QNetworkRequest, QNetworkReply
diff --git a/src/network/access/qnetworkreplyhttpimpl_p.h b/src/network/access/qnetworkreplyhttpimpl_p.h
index 956d5c207f..54a4333dcf 100644
--- a/src/network/access/qnetworkreplyhttpimpl_p.h
+++ b/src/network/access/qnetworkreplyhttpimpl_p.h
@@ -119,7 +119,9 @@ public:
Q_PRIVATE_SLOT(d_func(), void replySslErrors(const QList<QSslError> &, bool *, QList<QSslError> *))
Q_PRIVATE_SLOT(d_func(), void replySslConfigurationChanged(const QSslConfiguration&))
#endif
+#ifndef QT_NO_NETWORKPROXY
Q_PRIVATE_SLOT(d_func(), void proxyAuthenticationRequired(const QNetworkProxy &proxy, QAuthenticator *auth))
+#endif
Q_PRIVATE_SLOT(d_func(), void resetUploadDataSlot(bool *r))
Q_PRIVATE_SLOT(d_func(), void wantUploadDataSlot(qint64))
diff --git a/src/network/doc/images/network-examples.png b/src/network/doc/images/network-examples.png
new file mode 100644
index 0000000000..15dfba850a
--- /dev/null
+++ b/src/network/doc/images/network-examples.png
Binary files differ
diff --git a/src/network/doc/qtnetwork.qdocconf b/src/network/doc/qtnetwork.qdocconf
index 17aa5e4251..702338e224 100644
--- a/src/network/doc/qtnetwork.qdocconf
+++ b/src/network/doc/qtnetwork.qdocconf
@@ -3,21 +3,21 @@ include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf)
project = QtNetwork
description = Qt Network Reference Documentation
url = http://qt-project.org/doc/qtnetwork
-version = 5.0.0
+version = 5.0.1
examplesinstallpath = network
qhp.projects = QtNetwork
qhp.QtNetwork.file = qtnetwork.qhp
-qhp.QtNetwork.namespace = org.qt-project.qtnetwork.500
+qhp.QtNetwork.namespace = org.qt-project.qtnetwork.501
qhp.QtNetwork.virtualFolder = qtnetwork
qhp.QtNetwork.indexTitle = Qt Network
qhp.QtNetwork.indexRoot =
-qhp.QtNetwork.filterAttributes = qtnetwork 5.0.0 qtrefdoc
-qhp.QtNetwork.customFilters.Qt.name = QtNetwork 5.0.0
-qhp.QtNetwork.customFilters.Qt.filterAttributes = qtnetwork 5.0.0
+qhp.QtNetwork.filterAttributes = qtnetwork 5.0.1 qtrefdoc
+qhp.QtNetwork.customFilters.Qt.name = QtNetwork 5.0.1
+qhp.QtNetwork.customFilters.Qt.filterAttributes = qtnetwork 5.0.1
qhp.QtNetwork.subprojects = classes
qhp.QtNetwork.subprojects.classes.title = C++ Classes
diff --git a/src/network/doc/snippets/code/src_network_access_qftp.cpp b/src/network/doc/snippets/code/src_network_access_qftp.cpp
index 77f5ee2df2..4fa81efd84 100644
--- a/src/network/doc/snippets/code/src_network_access_qftp.cpp
+++ b/src/network/doc/snippets/code/src_network_access_qftp.cpp
@@ -40,13 +40,13 @@
//! [0]
QFtp *ftp = new QFtp(parent);
-ftp->connectToHost("ftp.qt.nokia.com");
+ftp->connectToHost("ftp.qt-project.org");
ftp->login();
//! [0]
//! [1]
-ftp->connectToHost("ftp.qt.nokia.com"); // id == 1
+ftp->connectToHost("ftp.qt-project.org"); // id == 1
ftp->login(); // id == 2
ftp->cd("qt"); // id == 3
ftp->get("INSTALL"); // id == 4
diff --git a/src/network/doc/src/examples.qdoc b/src/network/doc/src/examples.qdoc
new file mode 100644
index 0000000000..1d3b83ae80
--- /dev/null
+++ b/src/network/doc/src/examples.qdoc
@@ -0,0 +1,68 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** 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 Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \group examples-network
+ \ingroup all-examples
+ \title Network Examples
+ \brief How to do network programming in Qt.
+
+ \image network-examples.png
+
+ Qt is provided with an extensive set of network classes to support both
+ client-based and server side network programming.
+
+ These examples demonstrate the fundamental aspects of network programming
+ with Qt.
+
+*/
+
+/*
+ \list
+ \li \l{network/blockingfortuneclient}{Blocking Fortune Client}\raisedaster
+ \li \l{network/broadcastreceiver}{Broadcast Receiver}
+ \li \l{network/broadcastsender}{Broadcast Sender}
+ \li \l{network/download}{Download}
+ \li \l{network/downloadmanager}{Download Manager}
+ \li \l{network/network-chat}{Network Chat}
+ \li \l{network/fortuneclient}{Fortune Client}\raisedaster
+ \li \l{network/fortuneserver}{Fortune Server}\raisedaster
+ \li \l{network/qftp}{FTP}\raisedaster
+ \li \l{network/http}{HTTP}
+ \li \l{network/loopback}{Loopback}
+ \li \l{network/threadedfortuneserver}{Threaded Fortune Server}\raisedaster
+ \li \l{network/torrent}{Torrent}
+ \li \l{network/googlesuggest}{Google Suggest}
+ \li \l{network/bearercloud}{Bearer Cloud}\raisedaster
+ \li \l{network/bearermonitor}{Bearer Monitor}
+ \li \l{network/securesocketclient}{Secure Socket Client}
+ \li \l{network/multicastreceiver}{Multicast Receiver}
+ \li \l{network/multicastsender}{Multicast Sender}
+ \endlist
+
+ Examples marked with an asterisk (*) are fully documented.
+*/
diff --git a/src/network/doc/src/ssl.qdoc b/src/network/doc/src/ssl.qdoc
index 0a07e72f93..751c7cd668 100644
--- a/src/network/doc/src/ssl.qdoc
+++ b/src/network/doc/src/ssl.qdoc
@@ -33,8 +33,8 @@
\keyword SSL
The classes below provide support for secure network communication using
- the Secure Sockets Layer (SSL) protocol, using the \l{OpenSSL Toolkit} to
- perform encryption and protocol handling.
+ the Secure Sockets Layer (SSL) protocol, using the OpenSSL Toolkit (\l{http://www.openssl.org/})
+ to perform encryption and protocol handling.
See the \l{General Qt Requirements} page for information about the
versions of OpenSSL that are known to work with Qt.
diff --git a/src/network/kernel/qnetworkproxy.cpp b/src/network/kernel/qnetworkproxy.cpp
index 60139dcc8a..7f1e66a2ce 100644
--- a/src/network/kernel/qnetworkproxy.cpp
+++ b/src/network/kernel/qnetworkproxy.cpp
@@ -84,7 +84,7 @@
\section1 SOCKS5
- The SOCKS5 support in Qt 4 is based on \l{RFC 1928} and \l{RFC 1929}.
+ The SOCKS5 support in Qt 4 is based on \l{http://www.rfc-editor.org/rfc/rfc1928.txt}{RFC 1928} and \l{http://www.rfc-editor.org/rfc/rfc1929.txt}{RFC 1929}.
The supported authentication methods are no authentication and
username/password authentication. Both IPv4 and IPv6 are
supported. Domain names are resolved through the SOCKS5 server if
diff --git a/src/network/socket/qabstractsocket.cpp b/src/network/socket/qabstractsocket.cpp
index 5ff7da9e9d..124f15e586 100644
--- a/src/network/socket/qabstractsocket.cpp
+++ b/src/network/socket/qabstractsocket.cpp
@@ -195,7 +195,7 @@
\fn void QAbstractSocket::disconnected()
This signal is emitted when the socket has been disconnected.
-
+
\warning If you need to delete the sender() of this signal in a slot connected
to it, use the \l{QObject::deleteLater()}{deleteLater()} function.
@@ -639,7 +639,7 @@ bool QAbstractSocketPrivate::initSocketLayer(QAbstractSocket::NetworkLayerProtoc
socketEngine->errorString().toLatin1().constData());
#endif
socketError = socketEngine->error();
- q->setErrorString(socketEngine->errorString());
+ q->setErrorString(socketEngine->errorString());
return false;
}
diff --git a/src/network/socket/qlocalserver_tcp.cpp b/src/network/socket/qlocalserver_tcp.cpp
index cb727a9d2c..a705b18dc5 100644
--- a/src/network/socket/qlocalserver_tcp.cpp
+++ b/src/network/socket/qlocalserver_tcp.cpp
@@ -67,7 +67,7 @@ bool QLocalServerPrivate::listen(const QString &requestedServerName)
else
fullServerName = prefix + requestedServerName;
- QSettings settings(QLatin1String("Trolltech"), QLatin1String("Qt"));
+ QSettings settings(QLatin1String("QtProject"), QLatin1String("Qt"));
if (settings.contains(fullServerName)) {
qWarning("QLocalServer::listen: server name is already in use.");
tcpServer.close();
@@ -87,7 +87,7 @@ bool QLocalServerPrivate::listen(qintptr socketDescriptor)
void QLocalServerPrivate::closeServer()
{
- QSettings settings(QLatin1String("Trolltech"), QLatin1String("Qt"));
+ QSettings settings(QLatin1String("QtProject"), QLatin1String("Qt"));
if (fullServerName == QLatin1String("QLocalServer"))
settings.setValue(fullServerName, QVariant());
else
@@ -126,7 +126,7 @@ bool QLocalServerPrivate::removeServer(const QString &name)
else
serverName = prefix + name;
- QSettings settings(QLatin1String("Trolltech"), QLatin1String("Qt"));
+ QSettings settings(QLatin1String("QtProject"), QLatin1String("Qt"));
if (settings.contains(serverName))
settings.remove(serverName);
diff --git a/src/network/socket/qlocalsocket_tcp.cpp b/src/network/socket/qlocalsocket_tcp.cpp
index 5429d8dc36..913d10f50a 100644
--- a/src/network/socket/qlocalsocket_tcp.cpp
+++ b/src/network/socket/qlocalsocket_tcp.cpp
@@ -238,7 +238,7 @@ void QLocalSocket::connectToServer(const QString &name, OpenMode openMode)
else
d->fullServerName = prefix + name;
- QSettings settings(QLatin1String("Trolltech"), QLatin1String("Qt"));
+ QSettings settings(QLatin1String("QtProject"), QLatin1String("Qt"));
bool ok;
const quint16 port = settings.value(d->fullServerName).toUInt(&ok);
if (!ok) {
diff --git a/src/network/socket/qlocalsocket_win.cpp b/src/network/socket/qlocalsocket_win.cpp
index cb264a4c83..0138a96261 100644
--- a/src/network/socket/qlocalsocket_win.cpp
+++ b/src/network/socket/qlocalsocket_win.cpp
@@ -67,7 +67,7 @@ void QLocalSocketPrivate::_q_winError(ulong windowsError, const QString &functio
Q_Q(QLocalSocket);
QLocalSocket::LocalSocketState currentState = state;
- // If the connectToServer fails due to WaitNamedPipe() time-out, assume ConnectionError
+ // If the connectToServer fails due to WaitNamedPipe() time-out, assume ConnectionError
if (state == QLocalSocket::ConnectingState && windowsError == ERROR_SEM_TIMEOUT)
windowsError = ERROR_NO_DATA;
diff --git a/src/network/ssl/qsslcertificate.cpp b/src/network/ssl/qsslcertificate.cpp
index e9353916cb..6d3a77b45f 100644
--- a/src/network/ssl/qsslcertificate.cpp
+++ b/src/network/ssl/qsslcertificate.cpp
@@ -245,7 +245,7 @@ bool QSslCertificate::isNull() const
expiryDate() and effectiveDate() with QDateTime::currentDateTime()
This function checks that the current
- data-time is within the date-time range during which the
+ date-time is within the date-time range during which the
certificate is considered valid, and checks that the
certificate is not in a blacklist of fraudulent certificates.
diff --git a/src/network/ssl/qsslerror.h b/src/network/ssl/qsslerror.h
index a222e2c58d..1acc5cb6e5 100644
--- a/src/network/ssl/qsslerror.h
+++ b/src/network/ssl/qsslerror.h
@@ -122,6 +122,10 @@ Q_NETWORK_EXPORT QDebug operator<<(QDebug debug, const QSslError::SslError &erro
QT_END_NAMESPACE
+#ifndef QT_NO_SSL
+Q_DECLARE_METATYPE(QList<QSslError>)
+#endif
+
QT_END_HEADER
#endif
diff --git a/src/network/ssl/qsslsocket.h b/src/network/ssl/qsslsocket.h
index 306fb636a6..37f7c484f4 100644
--- a/src/network/ssl/qsslsocket.h
+++ b/src/network/ssl/qsslsocket.h
@@ -223,10 +223,6 @@ private:
QT_END_NAMESPACE
-#ifndef QT_NO_SSL
-Q_DECLARE_METATYPE(QList<QSslError>)
-#endif
-
QT_END_HEADER
#endif
diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp
index 39b49ce09e..9e0331391b 100644
--- a/src/network/ssl/qsslsocket_openssl.cpp
+++ b/src/network/ssl/qsslsocket_openssl.cpp
@@ -229,12 +229,12 @@ static int q_X509Callback(int ok, X509_STORE_CTX *ctx)
{
if (!ok) {
// Store the error and at which depth the error was detected.
- _q_sslErrorList()->errors << qMakePair<int, int>(ctx->error, ctx->error_depth);
+ _q_sslErrorList()->errors << qMakePair<int, int>(q_X509_STORE_CTX_get_error(ctx), q_X509_STORE_CTX_get_error_depth(ctx));
#ifdef QSSLSOCKET_DEBUG
qDebug() << "verification error: dumping bad certificate";
- qDebug() << QSslCertificatePrivate::QSslCertificate_from_X509(ctx->current_cert).toPem();
+ qDebug() << QSslCertificatePrivate::QSslCertificate_from_X509(q_X509_STORE_CTX_get_current_cert(ctx)).toPem();
qDebug() << "dumping chain";
- foreach (QSslCertificate cert, QSslSocketBackendPrivate::STACKOFX509_to_QSslCertificates(ctx->chain)) {
+ foreach (QSslCertificate cert, QSslSocketBackendPrivate::STACKOFX509_to_QSslCertificates(q_X509_STORE_CTX_get_chain(ctx))) {
QString certFormat(QStringLiteral("O=%1 CN=%2 L=%3 OU=%4 C=%5 ST=%6"));
qDebug() << "Issuer:" << "O=" << cert.issuerInfo(QSslCertificate::Organization)
<< "CN=" << cert.issuerInfo(QSslCertificate::CommonName)
diff --git a/src/network/ssl/qsslsocket_openssl_symbols.cpp b/src/network/ssl/qsslsocket_openssl_symbols.cpp
index eeae9d461f..0df77b07f7 100644
--- a/src/network/ssl/qsslsocket_openssl_symbols.cpp
+++ b/src/network/ssl/qsslsocket_openssl_symbols.cpp
@@ -294,6 +294,10 @@ DEFINEFUNC2(int, X509_STORE_add_cert, X509_STORE *a, a, X509 *b, b, return 0, re
DEFINEFUNC(void, X509_STORE_CTX_free, X509_STORE_CTX *a, a, return, DUMMYARG)
DEFINEFUNC4(int, X509_STORE_CTX_init, X509_STORE_CTX *a, a, X509_STORE *b, b, X509 *c, c, STACK_OF(X509) *d, d, return -1, return)
DEFINEFUNC2(int, X509_STORE_CTX_set_purpose, X509_STORE_CTX *a, a, int b, b, return -1, return)
+DEFINEFUNC(int, X509_STORE_CTX_get_error, X509_STORE_CTX *a, a, return -1, return)
+DEFINEFUNC(int, X509_STORE_CTX_get_error_depth, X509_STORE_CTX *a, a, return -1, return)
+DEFINEFUNC(X509 *, X509_STORE_CTX_get_current_cert, X509_STORE_CTX *a, a, return 0, return)
+DEFINEFUNC(STACK_OF(X509) *, X509_STORE_CTX_get_chain, X509_STORE_CTX *a, a, return 0, return)
DEFINEFUNC(X509_STORE_CTX *, X509_STORE_CTX_new, DUMMYARG, DUMMYARG, return 0, return)
#ifdef SSLEAY_MACROS
DEFINEFUNC2(int, i2d_DSAPrivateKey, const DSA *a, a, unsigned char **b, b, return -1, return)
@@ -714,6 +718,10 @@ bool q_resolveOpenSslSymbols()
RESOLVEFUNC(X509_STORE_CTX_init)
RESOLVEFUNC(X509_STORE_CTX_new)
RESOLVEFUNC(X509_STORE_CTX_set_purpose)
+ RESOLVEFUNC(X509_STORE_CTX_get_error)
+ RESOLVEFUNC(X509_STORE_CTX_get_error_depth)
+ RESOLVEFUNC(X509_STORE_CTX_get_current_cert)
+ RESOLVEFUNC(X509_STORE_CTX_get_chain)
RESOLVEFUNC(X509_cmp)
#ifndef SSLEAY_MACROS
RESOLVEFUNC(X509_dup)
diff --git a/src/network/ssl/qsslsocket_openssl_symbols_p.h b/src/network/ssl/qsslsocket_openssl_symbols_p.h
index 40c6522d93..2be84331e3 100644
--- a/src/network/ssl/qsslsocket_openssl_symbols_p.h
+++ b/src/network/ssl/qsslsocket_openssl_symbols_p.h
@@ -398,6 +398,10 @@ int q_X509_STORE_CTX_init(X509_STORE_CTX *ctx, X509_STORE *store,
X509 *x509, STACK_OF(X509) *chain);
X509_STORE_CTX *q_X509_STORE_CTX_new();
int q_X509_STORE_CTX_set_purpose(X509_STORE_CTX *ctx, int purpose);
+int q_X509_STORE_CTX_get_error(X509_STORE_CTX *ctx);
+int q_X509_STORE_CTX_get_error_depth(X509_STORE_CTX *ctx);
+X509 *q_X509_STORE_CTX_get_current_cert(X509_STORE_CTX *ctx);
+STACK_OF(X509) *q_X509_STORE_CTX_get_chain(X509_STORE_CTX *ctx);
#define q_BIO_get_mem_data(b, pp) (int)q_BIO_ctrl(b,BIO_CTRL_INFO,0,(char *)pp)
#define q_BIO_pending(b) (int)q_BIO_ctrl(b,BIO_CTRL_PENDING,0,NULL)
diff --git a/src/opengl/doc/qtopengl.qdocconf b/src/opengl/doc/qtopengl.qdocconf
index 2d8703a1dc..131fdb8968 100644
--- a/src/opengl/doc/qtopengl.qdocconf
+++ b/src/opengl/doc/qtopengl.qdocconf
@@ -23,6 +23,8 @@ imagedirs += images \
depends += qtcore qtgui qtwidgets
+examplesinstallpath = opengl
+
# The following parameters are for creating a qhp file, the qhelpgenerator
# program can convert the qhp file into a qch file which can be opened in
# Qt Assistant and/or Qt Creator.
@@ -37,15 +39,16 @@ qhp.qtopengl.file = qtopengl.qhp
# Namespace for the output file. This namespace is used to distinguish between
# different documentation files in Creator/Assistant.
-qhp.qtopengl.namespace = org.qt-project.qtopengl.500
+qhp.qtopengl.namespace = org.qt-project.qtopengl.501
# Title for the package, will be the main title for the package in
# Assistant/Creator.
-qhp.qtopengl.indexTitle = Qt Script Documentation
+qhp.qtopengl.indexTitle = Qt OpenGL
# Only update the name of the project for the next variables.
qhp.qtopengl.virtualFolder = qtopengl
qhp.qtopengl.subprojects = classes
-qhp.qtopengl.subprojects.classes.title = Qt D-Bus C++ Classes
+qhp.qtopengl.subprojects.classes.title = C++ Classes
+qhp.qtopengl.subprojects.classes.indexTitle = Qt OpenGL C++ Classes
qhp.qtopengl.subprojects.classes.selectors = class fake:headerfile
qhp.qtopengl.subprojects.classes.sortPages = true
diff --git a/src/opengl/opengl.pro b/src/opengl/opengl.pro
index 57892c7300..64b33b8c97 100644
--- a/src/opengl/opengl.pro
+++ b/src/opengl/opengl.pro
@@ -59,5 +59,3 @@ SOURCES += qglshaderprogram.cpp \
gl2paintengineex/qtextureglyphcache_gl.cpp
SOURCES += qgl_qpa.cpp
-
-INCLUDEPATH += ../3rdparty/harfbuzz/src
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index 69f4871c6b..9489762516 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -1477,6 +1477,11 @@ bool operator!=(const QGLFormat& a, const QGLFormat& b)
}
struct QGLContextGroupList {
+ QGLContextGroupList()
+ : m_mutex(QMutex::Recursive)
+ {
+ }
+
void append(QGLContextGroup *group) {
QMutexLocker locker(&m_mutex);
m_list.append(group);
diff --git a/src/opengl/qgl_qpa.cpp b/src/opengl/qgl_qpa.cpp
index 0e8b8abb4f..fa94b7cc37 100644
--- a/src/opengl/qgl_qpa.cpp
+++ b/src/opengl/qgl_qpa.cpp
@@ -70,8 +70,8 @@ QGLFormat QGLFormat::fromSurfaceFormat(const QSurfaceFormat &format)
if (format.depthBufferSize() >= 0)
retFormat.setDepthBufferSize(format.depthBufferSize());
if (format.samples() > 1) {
- retFormat.setSampleBuffers(format.samples());
- retFormat.setSamples(true);
+ retFormat.setSampleBuffers(true);
+ retFormat.setSamples(format.samples());
}
if (format.stencilBufferSize() > 0) {
retFormat.setStencil(true);
@@ -421,7 +421,8 @@ QOpenGLContext *QGLContext::contextHandle() const
}
/*!
- Returns a OpenGL context for the window context specified by \a windowContext
+ Returns a OpenGL context for the window context specified by the \a context
+ parameter.
*/
QGLContext *QGLContext::fromOpenGLContext(QOpenGLContext *context)
{
diff --git a/src/platformsupport/dnd/qsimpledrag.cpp b/src/platformsupport/dnd/qsimpledrag.cpp
index 18e6b97e3c..efaede4c5f 100644
--- a/src/platformsupport/dnd/qsimpledrag.cpp
+++ b/src/platformsupport/dnd/qsimpledrag.cpp
@@ -237,6 +237,7 @@ void QBasicDrag::exitDndEventLoop()
void QBasicDrag::updateCursor(Qt::DropAction action)
{
+#ifndef QT_NO_CURSOR
Qt::CursorShape cursorShape = Qt::ForbiddenCursor;
if (canDrop()) {
switch (action) {
@@ -267,6 +268,7 @@ void QBasicDrag::updateCursor(Qt::DropAction action)
}
}
}
+#endif
updateAction(action);
}
diff --git a/src/platformsupport/eventdispatchers/qeventdispatcher_glib.cpp b/src/platformsupport/eventdispatchers/qeventdispatcher_glib.cpp
index b8f4475d9e..3154e65ec8 100644
--- a/src/platformsupport/eventdispatchers/qeventdispatcher_glib.cpp
+++ b/src/platformsupport/eventdispatchers/qeventdispatcher_glib.cpp
@@ -119,8 +119,6 @@ QPAEventDispatcherGlib::~QPAEventDispatcherGlib()
bool QPAEventDispatcherGlib::processEvents(QEventLoop::ProcessEventsFlags flags)
{
- Q_D(QPAEventDispatcherGlib);
-
m_flags = flags;
return QEventDispatcherGlib::processEvents(m_flags);
}
diff --git a/src/platformsupport/fbconvenience/qfbcursor.cpp b/src/platformsupport/fbconvenience/qfbcursor.cpp
index f3b8ecbf50..bc44055721 100644
--- a/src/platformsupport/fbconvenience/qfbcursor.cpp
+++ b/src/platformsupport/fbconvenience/qfbcursor.cpp
@@ -116,6 +116,7 @@ void QFbCursor::setCursor(const uchar *data, const uchar *mask, int width, int h
mGraphic->set(data, mask, width, height, hotX, hotY);
}
+#ifndef QT_NO_CURSOR
void QFbCursor::changeCursor(QCursor * widgetCursor, QWindow *window)
{
Q_UNUSED(window);
@@ -134,6 +135,7 @@ void QFbCursor::changeCursor(QCursor * widgetCursor, QWindow *window)
if (mOnScreen || mScreen->geometry().intersects(mCurrentRect.translated(mScreenOffset)))
setDirty();
}
+#endif
QT_END_NAMESPACE
diff --git a/src/platformsupport/fbconvenience/qfbcursor_p.h b/src/platformsupport/fbconvenience/qfbcursor_p.h
index 9468e647aa..a56e352533 100644
--- a/src/platformsupport/fbconvenience/qfbcursor_p.h
+++ b/src/platformsupport/fbconvenience/qfbcursor_p.h
@@ -59,7 +59,9 @@ public:
// input methods
virtual void pointerEvent(const QMouseEvent &event);
+#ifndef QT_NO_CURSOR
virtual void changeCursor(QCursor *widgetCursor, QWindow *window);
+#endif
virtual void setDirty() { mDirty = true; /* screen->setDirty(QRect()); */ }
virtual bool isDirty() const { return mDirty; }
diff --git a/src/platformsupport/fontdatabases/basic/qbasicfontdatabase.cpp b/src/platformsupport/fontdatabases/basic/qbasicfontdatabase.cpp
index d0755711de..d50d23e2a9 100644
--- a/src/platformsupport/fontdatabases/basic/qbasicfontdatabase.cpp
+++ b/src/platformsupport/fontdatabases/basic/qbasicfontdatabase.cpp
@@ -452,7 +452,7 @@ QStringList QBasicFontDatabase::addTTFile(const QByteArray &fontData, const QByt
QFont::Stretch stretch = QFont::Unstretched;
- registerFont(family,QString(),weight,style,stretch,true,true,0,fixedPitch,writingSystems,fontFile);
+ registerFont(family,QString::fromLatin1(face->style_name),QString(),weight,style,stretch,true,true,0,fixedPitch,writingSystems,fontFile);
families.append(family);
diff --git a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp
index 128ef396db..2e458d9153 100644
--- a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp
+++ b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp
@@ -362,6 +362,7 @@ void QFontconfigDatabase::populateFontDatabase()
FcChar8 *file_value;
int indexValue;
FcChar8 *foundry_value;
+ FcChar8 *style_value;
FcBool scalable;
FcBool antialias;
@@ -369,7 +370,7 @@ void QFontconfigDatabase::populateFontDatabase()
FcObjectSet *os = FcObjectSetCreate();
FcPattern *pattern = FcPatternCreate();
const char *properties [] = {
- FC_FAMILY, FC_WEIGHT, FC_SLANT,
+ FC_FAMILY, FC_STYLE, FC_WEIGHT, FC_SLANT,
FC_SPACING, FC_FILE, FC_INDEX,
FC_LANG, FC_CHARSET, FC_FOUNDRY, FC_SCALABLE, FC_PIXEL_SIZE, FC_WEIGHT,
FC_WIDTH,
@@ -415,6 +416,8 @@ void QFontconfigDatabase::populateFontDatabase()
scalable = FcTrue;
if (FcPatternGetString(fonts->fonts[i], FC_FOUNDRY, 0, &foundry_value) != FcResultMatch)
foundry_value = 0;
+ if (FcPatternGetString(fonts->fonts[i], FC_STYLE, 0, &style_value) != FcResultMatch)
+ style_value = 0;
if(FcPatternGetBool(fonts->fonts[i],FC_ANTIALIAS,0,&antialias) != FcResultMatch)
antialias = true;
@@ -482,7 +485,8 @@ void QFontconfigDatabase::populateFontDatabase()
bool fixedPitch = spacing_value >= FC_MONO;
QFont::Stretch stretch = QFont::Unstretched;
- QPlatformFontDatabase::registerFont(familyName,QLatin1String((const char *)foundry_value),weight,style,stretch,antialias,scalable,pixel_size,fixedPitch,writingSystems,fontFile);
+ QString styleName = style_value ? QString::fromUtf8((const char *) style_value) : QString();
+ QPlatformFontDatabase::registerFont(familyName,styleName,QLatin1String((const char *)foundry_value),weight,style,stretch,antialias,scalable,pixel_size,fixedPitch,writingSystems,fontFile);
// qDebug() << familyName << (const char *)foundry_value << weight << style << &writingSystems << scalable << true << pixel_size;
}
@@ -506,9 +510,9 @@ void QFontconfigDatabase::populateFontDatabase()
while (f->qtname) {
QString familyQtName = QString::fromLatin1(f->qtname);
- registerFont(familyQtName,QString(),QFont::Normal,QFont::StyleNormal,QFont::Unstretched,true,true,0,f->fixed,ws,0);
- registerFont(familyQtName,QString(),QFont::Normal,QFont::StyleItalic,QFont::Unstretched,true,true,0,f->fixed,ws,0);
- registerFont(familyQtName,QString(),QFont::Normal,QFont::StyleOblique,QFont::Unstretched,true,true,0,f->fixed,ws,0);
+ registerFont(familyQtName,QString(),QString(),QFont::Normal,QFont::StyleNormal,QFont::Unstretched,true,true,0,f->fixed,ws,0);
+ registerFont(familyQtName,QString(),QString(),QFont::Normal,QFont::StyleItalic,QFont::Unstretched,true,true,0,f->fixed,ws,0);
+ registerFont(familyQtName,QString(),QString(),QFont::Normal,QFont::StyleOblique,QFont::Unstretched,true,true,0,f->fixed,ws,0);
++f;
}
diff --git a/src/platformsupport/fontdatabases/fontdatabases.pri b/src/platformsupport/fontdatabases/fontdatabases.pri
index 0fc4e71a3f..003017473b 100644
--- a/src/platformsupport/fontdatabases/fontdatabases.pri
+++ b/src/platformsupport/fontdatabases/fontdatabases.pri
@@ -1,5 +1,4 @@
DEFINES += QT_COMPILES_IN_HARFBUZZ
-INCLUDEPATH += $$QT_SOURCE_TREE/src/3rdparty/harfbuzz/src
!win32|contains(QT_CONFIG, freetype):!mac {
include($$PWD/basic/basic.pri)
diff --git a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
index ef0c1b5103..edb0e90163 100644
--- a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
+++ b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
@@ -227,6 +227,7 @@ void QCoreTextFontDatabase::populateFontDatabase()
for (int i = 0; i < numFonts; ++i) {
CTFontDescriptorRef font = (CTFontDescriptorRef) CFArrayGetValueAtIndex(fonts, i);
QCFString familyName = (CFStringRef) CTFontDescriptorCopyLocalizedAttribute(font, kCTFontFamilyNameAttribute, NULL);
+ QCFString styleName = (CFStringRef)CTFontDescriptorCopyLocalizedAttribute(font, kCTFontStyleNameAttribute, NULL);
QCFType<CFDictionaryRef> styles = (CFDictionaryRef) CTFontDescriptorCopyAttribute(font, kCTFontTraitsAttribute);
QFont::Weight weight = QFont::Normal;
QFont::Style style = QFont::StyleNormal;
@@ -285,7 +286,7 @@ void QCoreTextFontDatabase::populateFontDatabase()
}
CFRetain(font);
- QPlatformFontDatabase::registerFont(familyName, foundryName, weight, style, stretch,
+ QPlatformFontDatabase::registerFont(familyName, styleName, foundryName, weight, style, stretch,
true /* antialiased */, true /* scalable */,
pixelSize, fixedPitch, writingSystems, (void *) font);
CFStringRef psName = (CFStringRef) CTFontDescriptorCopyAttribute(font, kCTFontNameAttribute);
diff --git a/src/platformsupport/input/evdevtouch/qevdevtouch.cpp b/src/platformsupport/input/evdevtouch/qevdevtouch.cpp
index 9dd607b425..042d7547b6 100644
--- a/src/platformsupport/input/evdevtouch/qevdevtouch.cpp
+++ b/src/platformsupport/input/evdevtouch/qevdevtouch.cpp
@@ -457,7 +457,7 @@ void QEvdevTouchScreenData::assignIds()
int maxId = -1;
QHash<int, Contact>::iterator it, ite, bestMatch;
while (!pending.isEmpty() && !candidates.isEmpty()) {
- int bestDist = -1, bestId;
+ int bestDist = -1, bestId = 0;
for (it = pending.begin(), ite = pending.end(); it != ite; ++it) {
int dist;
int id = findClosestContact(candidates, it->x, it->y, &dist);
diff --git a/src/platformsupport/linuxaccessibility/application.cpp b/src/platformsupport/linuxaccessibility/application.cpp
index c2049e536a..22059de864 100644
--- a/src/platformsupport/linuxaccessibility/application.cpp
+++ b/src/platformsupport/linuxaccessibility/application.cpp
@@ -52,6 +52,8 @@
QT_BEGIN_NAMESPACE
+#ifndef QT_NO_ACCESSIBILITY
+
/*!
\class QSpiApplicationAdaptor
\internal
@@ -217,4 +219,6 @@ void QSpiApplicationAdaptor::notifyKeyboardListenerError(const QDBusError& error
}
}
+#endif // QT_NO_ACCESSIBILITY
+
QT_END_NAMESPACE
diff --git a/src/platformsupport/linuxaccessibility/application_p.h b/src/platformsupport/linuxaccessibility/application_p.h
index 14b8a71b42..4a60bbfe84 100644
--- a/src/platformsupport/linuxaccessibility/application_p.h
+++ b/src/platformsupport/linuxaccessibility/application_p.h
@@ -49,6 +49,8 @@
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
+#ifndef QT_NO_ACCESSIBILITY
+
/*
* Used for the root object.
*
@@ -80,6 +82,8 @@ private:
QDBusConnection dbusConnection;
};
+#endif // QT_NO_ACCESSIBILITY
+
QT_END_NAMESPACE
QT_END_HEADER
diff --git a/src/platformsupport/linuxaccessibility/atspiadaptor.cpp b/src/platformsupport/linuxaccessibility/atspiadaptor.cpp
index 6926f546a2..534cf4b73a 100644
--- a/src/platformsupport/linuxaccessibility/atspiadaptor.cpp
+++ b/src/platformsupport/linuxaccessibility/atspiadaptor.cpp
@@ -65,6 +65,8 @@
QT_BEGIN_NAMESPACE
+#ifndef QT_NO_ACCESSIBILITY
+
static bool isDebugging = false;
#define qAtspiDebug if (!::isDebugging); else qDebug
@@ -99,6 +101,7 @@ AtSpiAdaptor::AtSpiAdaptor(DBusConnection *connection, QObject *parent)
, sendObject_row_inserted(0)
, sendObject_row_reordered(0)
, sendObject_selection_changed(0)
+ , sendObject_state_changed(0)
, sendObject_text_attributes_changed(0)
, sendObject_text_bounds_changed(0)
, sendObject_text_caret_moved(0)
@@ -903,6 +906,14 @@ QAIPointer AtSpiAdaptor::interfaceFromPath(const QString& dbusPath) const
return QAIPointer();
}
+void AtSpiAdaptor::notifyStateChange(const QAIPointer &interface, const QString &state, int value)
+{
+ QString path = pathForInterface(interface);
+ QVariantList stateArgs = packDBusSignalArguments(state, value, 0, variantForPath(path));
+ sendDBusSignal(path, QLatin1String(ATSPI_DBUS_INTERFACE_EVENT_OBJECT),
+ QLatin1String("StateChanged"), stateArgs);
+}
+
/*!
This function gets called when Qt notifies about accessibility updates.
@@ -919,19 +930,13 @@ void AtSpiAdaptor::notify(QAccessibleEvent *event)
break;
case QAccessible::ObjectShow: {
if (sendObject || sendObject_state_changed) {
- QString path = pathForInterface(QAIPointer(event->accessibleInterface()));
- QVariantList stateArgs = packDBusSignalArguments(QLatin1String("showing"), 1, 0, variantForPath(path));
- sendDBusSignal(path, QLatin1String(ATSPI_DBUS_INTERFACE_EVENT_OBJECT),
- QLatin1String("StateChanged"), stateArgs);
+ notifyStateChange(QAIPointer(event->accessibleInterface()), QLatin1String("showing"), 1);
}
break;
}
case QAccessible::ObjectHide: {
if (sendObject || sendObject_state_changed) {
- QString path = pathForInterface(QAIPointer(event->accessibleInterface()));
- QVariantList stateArgs = packDBusSignalArguments(QLatin1String("showing"), 0, 0, variantForPath(path));
- sendDBusSignal(path, QLatin1String(ATSPI_DBUS_INTERFACE_EVENT_OBJECT),
- QLatin1String("StateChanged"), stateArgs);
+ notifyStateChange(QAIPointer(event->accessibleInterface()), QLatin1String("showing"), 0);
}
break;
}
@@ -968,7 +973,10 @@ void AtSpiAdaptor::notify(QAccessibleEvent *event)
case QAccessible::TextUpdated: {
if (sendObject || sendObject_text_changed) {
QAIPointer iface = QAIPointer(event->accessibleInterface());
- Q_ASSERT(iface->textInterface());
+ if (!iface || !iface->textInterface()) {
+ qAtspiDebug() << "Received text event for invalid interface.";
+ return;
+ }
QString path = pathForInterface(iface);
int changePosition = 0;
@@ -1023,8 +1031,8 @@ void AtSpiAdaptor::notify(QAccessibleEvent *event)
case QAccessible::TextCaretMoved: {
if (sendObject || sendObject_text_caret_moved) {
QAIPointer iface = QAIPointer(event->accessibleInterface());
- if (!iface->textInterface()) {
- qWarning() << "Sending TextCaretMoved from object that does not implement text interface: " << iface << iface->object();
+ if (!iface || !iface->textInterface()) {
+ qWarning() << "Sending TextCaretMoved from object that does not implement text interface: " << iface;
return;
}
@@ -1049,9 +1057,13 @@ void AtSpiAdaptor::notify(QAccessibleEvent *event)
break;
}
case QAccessible::ValueChanged: {
- if (sendObject || sendObject_value_changed) {
+ if (sendObject || sendObject_value_changed || sendObject_property_change_accessible_value) {
QAIPointer iface = QAIPointer(event->accessibleInterface());
- Q_ASSERT(iface->valueInterface());
+ if (!iface || !iface->valueInterface()) {
+ qWarning() << "ValueChanged event from invalid accessible: " << iface;
+ return;
+ }
+
QString path = pathForInterface(iface);
QVariantList args = packDBusSignalArguments(QLatin1String("accessible-value"), 0, 0, variantForPath(path));
sendDBusSignal(path, QLatin1String(ATSPI_DBUS_INTERFACE_EVENT_OBJECT),
@@ -1061,6 +1073,10 @@ void AtSpiAdaptor::notify(QAccessibleEvent *event)
}
case QAccessible::Selection: {
QAIPointer iface = QAIPointer(event->accessibleInterface());
+ if (!iface) {
+ qWarning() << "Selection event from invalid accessible.";
+ return;
+ }
QString path = pathForInterface(iface);
int selected = iface->state().selected ? 1 : 0;
QVariantList stateArgs = packDBusSignalArguments(QLatin1String("selected"), selected, 0, variantForPath(path));
@@ -1074,14 +1090,15 @@ void AtSpiAdaptor::notify(QAccessibleEvent *event)
QAccessible::State stateChange = static_cast<QAccessibleStateChangeEvent*>(event)->changedStates();
if (stateChange.checked) {
QAIPointer iface = QAIPointer(event->accessibleInterface());
+ if (!iface) {
+ qWarning() << "StateChanged event from invalid accessible.";
+ return;
+ }
int checked = iface->state().checked;
- QString path = pathForInterface(iface);
- QVariantList args = packDBusSignalArguments(QLatin1String("checked"), checked, 0, variantForPath(path));
- sendDBusSignal(path, QLatin1String(ATSPI_DBUS_INTERFACE_EVENT_OBJECT),
- QLatin1String("StateChanged"), args);
+ notifyStateChange(iface, QLatin1String("checked"), checked);
} else if (stateChange.active) {
QAIPointer iface = QAIPointer(event->accessibleInterface());
- if (!(iface->role() == QAccessible::Window && (sendWindow || sendWindow_activate)))
+ if (!iface || !(iface->role() == QAccessible::Window && (sendWindow || sendWindow_activate)))
return;
QString windowTitle = iface->text(QAccessible::Name);
QDBusVariant data;
@@ -1092,9 +1109,15 @@ void AtSpiAdaptor::notify(QAccessibleEvent *event)
QString path = pathForInterface(iface);
sendDBusSignal(path, QLatin1String(ATSPI_DBUS_INTERFACE_EVENT_WINDOW), status, args);
- QVariantList stateArgs = packDBusSignalArguments(QLatin1String("active"), iface->state().active ? 1 : 0, 0, variantForPath(path));
- sendDBusSignal(path, QLatin1String(ATSPI_DBUS_INTERFACE_EVENT_OBJECT),
- QLatin1String("StateChanged"), stateArgs);
+ int isActive = iface->state().active;
+ notifyStateChange(iface, QLatin1String("active"), isActive);
+ } else if (stateChange.disabled) {
+ QAIPointer iface = QAIPointer(event->accessibleInterface());
+ QAccessible::State state = iface->state();
+ bool enabled = !state.disabled;
+
+ notifyStateChange(iface, QLatin1String("enabled"), enabled);
+ notifyStateChange(iface, QLatin1String("sensitive"), enabled);
}
}
break;
@@ -2093,44 +2116,35 @@ bool AtSpiAdaptor::editableTextInterface(const QAIPointer &interface, const QStr
// Value interface
bool AtSpiAdaptor::valueInterface(const QAIPointer &interface, const QString &function, const QDBusMessage &message, const QDBusConnection &connection)
{
- if (0) {
- } else if (function == QLatin1String("SetCurrentValue")) {
+ if (function == QLatin1String("SetCurrentValue")) {
QDBusVariant v = message.arguments().at(2).value<QDBusVariant>();
double value = v.variant().toDouble();
//Temporary fix
//See https://bugzilla.gnome.org/show_bug.cgi?id=652596
interface->valueInterface()->setCurrentValue(value);
connection.send(message.createReply()); // FIXME is the reply needed?
- } else if (function == QLatin1String("GetCurrentValue")) {
- bool success;
- double val = interface->valueInterface()->currentValue().toDouble(&success);
- if (!success) {
- qAtspiDebug ("AtSpiAdaptor::valueInterface: Could not convert current value to double.");
- }
- connection.send(message.createReply(
- QVariant::fromValue(QDBusVariant(QVariant::fromValue(val)))));
- } else if (function == QLatin1String("GetMaximumValue")) {
- bool success;
- double val = interface->valueInterface()->maximumValue().toDouble(&success);
- if (!success) {
- qAtspiDebug ("AtSpiAdaptor::valueInterface: Could not convert current value to double.");
+ } else {
+ QVariant value;
+ if (function == QLatin1String("GetCurrentValue"))
+ value = interface->valueInterface()->currentValue();
+ else if (function == QLatin1String("GetMaximumValue"))
+ value = interface->valueInterface()->maximumValue();
+ else if (function == QLatin1String("GetMinimumIncrement"))
+ value = interface->valueInterface()->minimumStepSize();
+ else if (function == QLatin1String("GetMinimumValue"))
+ value = interface->valueInterface()->minimumValue();
+ else {
+ qAtspiDebug() << "WARNING: AtSpiAdaptor::valueInterface does not implement " << function << message.path();
+ return false;
}
- connection.send(message.createReply(
- QVariant::fromValue(QDBusVariant(QVariant::fromValue(val)))));
- } else if (function == QLatin1String("GetMinimumIncrement")) {
- connection.send(message.createReply(
- QVariant::fromValue(QDBusVariant(QVariant::fromValue(0.0)))));
- } else if (function == QLatin1String("GetMinimumValue")) {
- bool success;
- double val = interface->valueInterface()->minimumValue().toDouble(&success);
- if (!success) {
- qAtspiDebug ("AtSpiAdaptor::valueInterface: Could not convert current value to double.");
+ if (!value.canConvert(QVariant::Double)) {
+ qAtspiDebug() << "AtSpiAdaptor::valueInterface: Could not convert to double: " << function;
}
+
+ // explicitly convert to dbus-variant containing one double since atspi expects that
+ // everything else might fail to convert back on the other end
connection.send(message.createReply(
- QVariant::fromValue(QDBusVariant(QVariant::fromValue(val)))));
- } else {
- qAtspiDebug() << "WARNING: AtSpiAdaptor::valueInterface does not implement " << function << message.path();
- return false;
+ QVariant::fromValue(QDBusVariant(QVariant::fromValue(value.toDouble())))));
}
return true;
}
@@ -2345,4 +2359,6 @@ bool AtSpiAdaptor::tableInterface(const QAIPointer &interface, const QString &fu
return true;
}
+#endif // QT_NO_ACCESSIBILITY
+
QT_END_NAMESPACE
diff --git a/src/platformsupport/linuxaccessibility/atspiadaptor_p.h b/src/platformsupport/linuxaccessibility/atspiadaptor_p.h
index 4a8ff23bef..e6f95195fe 100644
--- a/src/platformsupport/linuxaccessibility/atspiadaptor_p.h
+++ b/src/platformsupport/linuxaccessibility/atspiadaptor_p.h
@@ -56,6 +56,8 @@
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
+#ifndef QT_NO_ACCESSIBILITY
+
class QAccessibleInterface;
class QSpiAccessibleInterface;
class QSpiApplicationAdaptor;
@@ -111,6 +113,8 @@ private:
QString pathForInterface(const QAIPointer &interface, bool inDestructor = false) const;
QString pathForObject(QObject *object) const;
+ void notifyStateChange(const QAIPointer& interface, const QString& state, int value);
+
// accessible helper functions
AtspiRole getRole(const QAIPointer &interface) const;
QSpiRelationArray relationSet(const QAIPointer &interface, const QDBusConnection &connection) const;
@@ -214,6 +218,8 @@ private:
uint sendWindow_unshade : 1;
};
+#endif // QT_NO_ACCESSIBILITY
+
QT_END_NAMESPACE
QT_END_HEADER
diff --git a/src/platformsupport/linuxaccessibility/bridge.cpp b/src/platformsupport/linuxaccessibility/bridge.cpp
index f22dc4e191..bf2486fc57 100644
--- a/src/platformsupport/linuxaccessibility/bridge.cpp
+++ b/src/platformsupport/linuxaccessibility/bridge.cpp
@@ -56,6 +56,8 @@
QT_BEGIN_NAMESPACE
+#ifndef QT_NO_ACCESSIBILITY
+
/*!
\class QSpiAccessibleBridge
\internal
@@ -182,4 +184,6 @@ void QSpiAccessibleBridge::initializeConstantMappings()
qSpiRoleMapping.insert(map[i].role, RoleNames(map[i].spiRole, QLatin1String(map[i].name), tr(map[i].name)));
}
+#endif // QT_NO_ACCESSIBILITY
+
QT_END_NAMESPACE
diff --git a/src/platformsupport/linuxaccessibility/bridge_p.h b/src/platformsupport/linuxaccessibility/bridge_p.h
index f7c243cfbb..3865e06489 100644
--- a/src/platformsupport/linuxaccessibility/bridge_p.h
+++ b/src/platformsupport/linuxaccessibility/bridge_p.h
@@ -51,6 +51,8 @@ class DeviceEventControllerAdaptor;
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
+#ifndef QT_NO_ACCESSIBILITY
+
class DBusConnection;
class QSpiDBusCache;
class AtSpiAdaptor;
@@ -79,6 +81,8 @@ private:
bool initialized;
};
+#endif // QT_NO_ACCESSIBILITY
+
QT_END_NAMESPACE
QT_END_HEADER
diff --git a/src/platformsupport/linuxaccessibility/cache.cpp b/src/platformsupport/linuxaccessibility/cache.cpp
index 81a54a1ce5..9201fc1d8b 100644
--- a/src/platformsupport/linuxaccessibility/cache.cpp
+++ b/src/platformsupport/linuxaccessibility/cache.cpp
@@ -49,6 +49,8 @@
QT_BEGIN_NAMESPACE
+#ifndef QT_NO_ACCESSIBILITY
+
/*!
\class QSpiDBusCache
\internal
@@ -89,4 +91,6 @@ QSpiAccessibleCacheArray QSpiDBusCache::GetItems()
return cacheArray;
}
+#endif // QT_NO_ACCESSIBILITY
+
QT_END_NAMESPACE
diff --git a/src/platformsupport/linuxaccessibility/cache_p.h b/src/platformsupport/linuxaccessibility/cache_p.h
index 898f06f0d6..4b606eadb1 100644
--- a/src/platformsupport/linuxaccessibility/cache_p.h
+++ b/src/platformsupport/linuxaccessibility/cache_p.h
@@ -49,6 +49,8 @@
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
+#ifndef QT_NO_ACCESSIBILITY
+
class QSpiDBusCache : public QObject
{
Q_OBJECT
@@ -66,6 +68,8 @@ public Q_SLOTS:
QSpiAccessibleCacheArray GetItems();
};
+#endif // QT_NO_ACCESSIBILITY
+
QT_END_NAMESPACE
QT_END_HEADER
diff --git a/src/platformsupport/linuxaccessibility/constant_mappings.cpp b/src/platformsupport/linuxaccessibility/constant_mappings.cpp
index a15355f9d3..5138b9a163 100644
--- a/src/platformsupport/linuxaccessibility/constant_mappings.cpp
+++ b/src/platformsupport/linuxaccessibility/constant_mappings.cpp
@@ -55,6 +55,8 @@
QT_BEGIN_NAMESPACE
+#ifndef QT_NO_ACCESSIBILITY
+
QHash <QAccessible::Role, RoleNames> qSpiRoleMapping;
quint64 spiStatesFromQState(QAccessible::State state)
@@ -69,8 +71,6 @@ quint64 spiStatesFromQState(QAccessible::State state)
if (state.disabled) {
unsetSpiStateBit(&spiState, ATSPI_STATE_ENABLED);
- unsetSpiStateBit(&spiState, ATSPI_STATE_SHOWING);
- unsetSpiStateBit(&spiState, ATSPI_STATE_VISIBLE);
unsetSpiStateBit(&spiState, ATSPI_STATE_SENSITIVE);
}
@@ -156,4 +156,6 @@ AtspiRelationType qAccessibleRelationToAtSpiRelation(QAccessible::Relation relat
return ATSPI_RELATION_NULL;
}
+#endif // QT_NO_ACCESSIBILITY
+
QT_END_NAMESPACE
diff --git a/src/platformsupport/linuxaccessibility/constant_mappings_p.h b/src/platformsupport/linuxaccessibility/constant_mappings_p.h
index 837a68516d..870a3a4b2a 100644
--- a/src/platformsupport/linuxaccessibility/constant_mappings_p.h
+++ b/src/platformsupport/linuxaccessibility/constant_mappings_p.h
@@ -53,6 +53,7 @@
#include <QtGui/QAccessible>
#include <atspi/atspi-constants.h>
+#ifndef QT_NO_ACCESSIBILITY
// interface names from at-spi2-core/atspi/atspi-misc-private.h
#define ATSPI_DBUS_NAME_REGISTRY "org.a11y.atspi.Registry"
@@ -135,4 +136,6 @@ AtspiRelationType qAccessibleRelationToAtSpiRelation(QAccessible::Relation relat
QT_END_NAMESPACE
QT_END_HEADER
+#endif // QT_NO_ACCESSIBILITY
+
#endif /* Q_SPI_CONSTANT_MAPPINGS_H */
diff --git a/src/platformsupport/linuxaccessibility/dbusconnection.cpp b/src/platformsupport/linuxaccessibility/dbusconnection.cpp
index a99e8f0a5e..a38570a465 100644
--- a/src/platformsupport/linuxaccessibility/dbusconnection.cpp
+++ b/src/platformsupport/linuxaccessibility/dbusconnection.cpp
@@ -48,6 +48,8 @@
QT_BEGIN_NAMESPACE
+#ifndef QT_NO_ACCESSIBILITY
+
/*!
\class DBusConnection
\internal
@@ -104,4 +106,6 @@ QDBusConnection DBusConnection::connection() const
return dbusConnection;
}
+#endif // QT_NO_ACCESSIBILITY
+
QT_END_NAMESPACE
diff --git a/src/platformsupport/linuxaccessibility/dbusconnection_p.h b/src/platformsupport/linuxaccessibility/dbusconnection_p.h
index 674cf28c34..da090da9cf 100644
--- a/src/platformsupport/linuxaccessibility/dbusconnection_p.h
+++ b/src/platformsupport/linuxaccessibility/dbusconnection_p.h
@@ -49,6 +49,8 @@
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
+#ifndef QT_NO_ACCESSIBILITY
+
class DBusConnection
{
public:
@@ -62,6 +64,8 @@ private:
QDBusConnection dbusConnection;
};
+#endif // QT_NO_ACCESSIBILITY
+
QT_END_NAMESPACE
QT_END_HEADER
diff --git a/src/platformsupport/linuxaccessibility/linuxaccessibility.pri b/src/platformsupport/linuxaccessibility/linuxaccessibility.pri
index 85a02da004..09d437678f 100644
--- a/src/platformsupport/linuxaccessibility/linuxaccessibility.pri
+++ b/src/platformsupport/linuxaccessibility/linuxaccessibility.pri
@@ -1,4 +1,4 @@
-contains(QT_CONFIG, dbus):contains(QT_CONFIG, xcb):contains(QT_CONFIG, accessibility) {
+qtHaveModule(dbus):contains(QT_CONFIG, xcb):contains(QT_CONFIG, accessibility) {
QT += dbus
include(../../3rdparty/atspi2/atspi2.pri)
diff --git a/src/platformsupport/linuxaccessibility/struct_marshallers.cpp b/src/platformsupport/linuxaccessibility/struct_marshallers.cpp
index 713e26f25a..027993c4bd 100644
--- a/src/platformsupport/linuxaccessibility/struct_marshallers.cpp
+++ b/src/platformsupport/linuxaccessibility/struct_marshallers.cpp
@@ -50,6 +50,8 @@
QT_BEGIN_NAMESPACE
+#ifndef QT_NO_ACCESSIBILITY
+
QSpiObjectReference::QSpiObjectReference()
: path(QDBusObjectPath(ATSPI_DBUS_PATH_NULL))
{}
@@ -234,4 +236,6 @@ void qSpiInitializeStructTypes()
qDBusRegisterMetaType<QSpiRelationArray>();
}
+#endif // QT_NO_ACCESSIBILITY
+
QT_END_NAMESPACE
diff --git a/src/plugins/accessible/widgets/main.cpp b/src/plugins/accessible/widgets/main.cpp
index 55b1d375dd..8392ef3a6d 100644
--- a/src/plugins/accessible/widgets/main.cpp
+++ b/src/plugins/accessible/widgets/main.cpp
@@ -199,7 +199,7 @@ QAccessibleInterface *AccessibleFactory::create(const QString &classname, QObjec
} else if (classname == QLatin1String("QSplitterHandle")) {
iface = new QAccessibleWidget(widget, QAccessible::Grip);
#endif
-#ifndef QT_NO_TEXTEDIT
+#if !defined(QT_NO_TEXTEDIT) && !defined(QT_NO_CURSOR)
} else if (classname == QLatin1String("QTextEdit")) {
iface = new QAccessibleTextEdit(widget);
} else if (classname == QLatin1String("QPlainTextEdit")) {
@@ -233,7 +233,7 @@ QAccessibleInterface *AccessibleFactory::create(const QString &classname, QObjec
} else if (classname == QLatin1String("QRubberBand")) {
iface = new QAccessibleWidget(widget, QAccessible::Border);
#endif
-#ifndef QT_NO_TEXTBROWSER
+#if !defined(QT_NO_TEXTBROWSER) && !defined(QT_NO_CURSOR)
} else if (classname == QLatin1String("QTextBrowser")) {
iface = new QAccessibleTextBrowser(widget);
#endif
diff --git a/src/plugins/accessible/widgets/qaccessiblemenu.cpp b/src/plugins/accessible/widgets/qaccessiblemenu.cpp
index 5f7d9a9c30..c7dcee78f0 100644
--- a/src/plugins/accessible/widgets/qaccessiblemenu.cpp
+++ b/src/plugins/accessible/widgets/qaccessiblemenu.cpp
@@ -165,7 +165,7 @@ QAccessibleMenuItem::~QAccessibleMenuItem()
QAccessibleInterface *QAccessibleMenuItem::childAt(int x, int y ) const
{
- for (int i = childCount(); i >= 0; --i) {
+ for (int i = childCount() - 1; i >= 0; --i) {
QAccessibleInterface *childInterface = child(i);
if (childInterface->rect().contains(x,y)) {
return childInterface;
diff --git a/src/plugins/accessible/widgets/qaccessiblewidgets.cpp b/src/plugins/accessible/widgets/qaccessiblewidgets.cpp
index 56e6166e85..e93a82c0ce 100644
--- a/src/plugins/accessible/widgets/qaccessiblewidgets.cpp
+++ b/src/plugins/accessible/widgets/qaccessiblewidgets.cpp
@@ -99,7 +99,7 @@ QList<QWidget*> childWidgets(const QWidget *widget, bool includeTopLevel)
return widgets;
}
-#ifndef QT_NO_TEXTEDIT
+#if !defined(QT_NO_TEXTEDIT) && !defined(QT_NO_CURSOR)
QAccessiblePlainTextEdit::QAccessiblePlainTextEdit(QWidget* o)
:QAccessibleTextWidget(o)
@@ -292,7 +292,7 @@ void QAccessibleTextEdit::scrollToSubstring(int startIndex, int endIndex)
qWarning("AccessibleTextEdit::scrollToSubstring failed!");
}
-#endif // QT_NO_TEXTEDIT
+#endif // QT_NO_TEXTEDIT && QT_NO_CURSOR
#ifndef QT_NO_STACKEDWIDGET
// ======================= QAccessibleStackedWidget ======================
@@ -488,7 +488,7 @@ QAccessibleDialogButtonBox::QAccessibleDialogButtonBox(QWidget *widget)
#endif // QT_NO_DIALOGBUTTONBOX
-#ifndef QT_NO_TEXTBROWSER
+#if !defined(QT_NO_TEXTBROWSER) && !defined(QT_NO_CURSOR)
QAccessibleTextBrowser::QAccessibleTextBrowser(QWidget *widget)
: QAccessibleTextEdit(widget)
{
@@ -499,7 +499,7 @@ QAccessible::Role QAccessibleTextBrowser::role() const
{
return QAccessible::StaticText;
}
-#endif // QT_NO_TEXTBROWSER
+#endif // QT_NO_TEXTBROWSER && QT_NO_CURSOR
#ifndef QT_NO_CALENDARWIDGET
// ===================== QAccessibleCalendarWidget ========================
diff --git a/src/plugins/accessible/widgets/qaccessiblewidgets.h b/src/plugins/accessible/widgets/qaccessiblewidgets.h
index e14b89a63b..fd76dbd076 100644
--- a/src/plugins/accessible/widgets/qaccessiblewidgets.h
+++ b/src/plugins/accessible/widgets/qaccessiblewidgets.h
@@ -122,7 +122,6 @@ protected:
virtual QTextDocument *textDocument() const = 0;
virtual QWidget *viewport() const = 0;
};
-#endif //QT_NO_CURSOR
#ifndef QT_NO_TEXTEDIT
class QAccessiblePlainTextEdit : public QAccessibleTextWidget
@@ -177,6 +176,7 @@ protected:
QWidget *viewport() const;
};
#endif // QT_NO_TEXTEDIT
+#endif //QT_NO_CURSOR
class QAccessibleStackedWidget : public QAccessibleWidget
{
@@ -245,7 +245,7 @@ public:
explicit QAccessibleDialogButtonBox(QWidget *widget);
};
-#ifndef QT_NO_TEXTBROWSER
+#if !defined(QT_NO_TEXTBROWSER) && !defined(QT_NO_CURSOR)
class QAccessibleTextBrowser : public QAccessibleTextEdit
{
public:
@@ -253,7 +253,7 @@ public:
QAccessible::Role role() const;
};
-#endif // QT_NO_TEXTBROWSER
+#endif // QT_NO_TEXTBROWSER && QT_NO_CURSOR
#ifndef QT_NO_CALENDARWIDGET
class QAccessibleCalendarWidget : public QAccessibleWidget
diff --git a/src/plugins/accessible/widgets/rangecontrols.cpp b/src/plugins/accessible/widgets/rangecontrols.cpp
index 954369b6b3..d03130f148 100644
--- a/src/plugins/accessible/widgets/rangecontrols.cpp
+++ b/src/plugins/accessible/widgets/rangecontrols.cpp
@@ -122,6 +122,11 @@ QVariant QAccessibleAbstractSpinBox::minimumValue() const
return abstractSpinBox()->property("minimum");
}
+QVariant QAccessibleAbstractSpinBox::minimumStepSize() const
+{
+ return abstractSpinBox()->property("stepSize");
+}
+
/*!
\class QAccessibleSpinBox
\brief The QAccessibleSpinBox class implements the QAccessibleInterface for spinbox widgets.
@@ -278,6 +283,11 @@ QVariant QAccessibleAbstractSlider::minimumValue() const
return abstractSlider()->minimum();
}
+QVariant QAccessibleAbstractSlider::minimumStepSize() const
+{
+ return abstractSlider()->singleStep();
+}
+
QAbstractSlider *QAccessibleAbstractSlider::abstractSlider() const
{
return static_cast<QAbstractSlider *>(object());
diff --git a/src/plugins/accessible/widgets/rangecontrols.h b/src/plugins/accessible/widgets/rangecontrols.h
index b26d97421a..a370ada199 100644
--- a/src/plugins/accessible/widgets/rangecontrols.h
+++ b/src/plugins/accessible/widgets/rangecontrols.h
@@ -71,6 +71,7 @@ public:
void setCurrentValue(const QVariant &value);
QVariant maximumValue() const;
QVariant minimumValue() const;
+ QVariant minimumStepSize() const;
// FIXME Action interface
@@ -110,6 +111,7 @@ public:
void setCurrentValue(const QVariant &value);
QVariant maximumValue() const;
QVariant minimumValue() const;
+ QVariant minimumStepSize() const;
protected:
QAbstractSlider *abstractSlider() const;
diff --git a/src/plugins/accessible/widgets/simplewidgets.cpp b/src/plugins/accessible/widgets/simplewidgets.cpp
index 1bd509dc41..8bf71da6e1 100644
--- a/src/plugins/accessible/widgets/simplewidgets.cpp
+++ b/src/plugins/accessible/widgets/simplewidgets.cpp
@@ -832,6 +832,14 @@ QVariant QAccessibleProgressBar::minimumValue() const
return progressBar()->minimum();
}
+QVariant QAccessibleProgressBar::minimumStepSize() const
+{
+ // This is arbitrary since any value between min and max is valid.
+ // Some screen readers (orca use it to calculate how many digits to display though,
+ // so it makes sense to return a "sensible" value. Providing 100 increments seems ok.
+ return (progressBar()->maximum() - progressBar()->minimum()) / 100.0;
+}
+
QProgressBar *QAccessibleProgressBar::progressBar() const
{
return qobject_cast<QProgressBar *>(object());
diff --git a/src/plugins/accessible/widgets/simplewidgets.h b/src/plugins/accessible/widgets/simplewidgets.h
index 2e1bca88b4..dbea8d4f09 100644
--- a/src/plugins/accessible/widgets/simplewidgets.h
+++ b/src/plugins/accessible/widgets/simplewidgets.h
@@ -188,6 +188,7 @@ public:
QVariant currentValue() const;
QVariant maximumValue() const;
QVariant minimumValue() const;
+ QVariant minimumStepSize() const;
inline void setCurrentValue(const QVariant &) {}
protected:
diff --git a/src/plugins/accessible/widgets/widgets.pro b/src/plugins/accessible/widgets/widgets.pro
index afabbac9bc..aff60d9781 100644
--- a/src/plugins/accessible/widgets/widgets.pro
+++ b/src/plugins/accessible/widgets/widgets.pro
@@ -1,6 +1,7 @@
TARGET = qtaccessiblewidgets
PLUGIN_TYPE = accessible
+PLUGIN_CLASS_NAME = AccessibleFactory
load(qt_plugin)
QT += core-private gui-private widgets-private
diff --git a/src/plugins/bearer/bearer.pro b/src/plugins/bearer/bearer.pro
index 899eede7bf..0375500306 100644
--- a/src/plugins/bearer/bearer.pro
+++ b/src/plugins/bearer/bearer.pro
@@ -1,6 +1,6 @@
TEMPLATE = subdirs
-linux*:contains(QT_CONFIG, dbus) {
+linux*:qtHaveModule(dbus) {
SUBDIRS += generic
SUBDIRS += connman networkmanager
}
diff --git a/src/plugins/bearer/blackberry/blackberry.pro b/src/plugins/bearer/blackberry/blackberry.pro
index 220a506d90..c75de3aaad 100644
--- a/src/plugins/bearer/blackberry/blackberry.pro
+++ b/src/plugins/bearer/blackberry/blackberry.pro
@@ -1,6 +1,7 @@
TARGET = qbbbearer
PLUGIN_TYPE = bearer
+PLUGIN_CLASS_NAME = QBBEnginePlugin
load(qt_plugin)
QT = core-private network-private
diff --git a/src/plugins/bearer/connman/connman.pro b/src/plugins/bearer/connman/connman.pro
index 99d9b367f2..cccdff0fdb 100644
--- a/src/plugins/bearer/connman/connman.pro
+++ b/src/plugins/bearer/connman/connman.pro
@@ -1,6 +1,7 @@
TARGET = qconnmanbearer
PLUGIN_TYPE = bearer
+PLUGIN_CLASS_NAME = QConnmanEnginePlugin
load(qt_plugin)
QT = core network-private dbus
diff --git a/src/plugins/bearer/connman/qconnmanservice_linux.cpp b/src/plugins/bearer/connman/qconnmanservice_linux.cpp
index 46757ab021..dbfac6b438 100644
--- a/src/plugins/bearer/connman/qconnmanservice_linux.cpp
+++ b/src/plugins/bearer/connman/qconnmanservice_linux.cpp
@@ -57,9 +57,24 @@
#ifndef QT_NO_DBUS
QT_BEGIN_NAMESPACE
-static QDBusConnection dbusConnection = QDBusConnection::systemBus();
+QDBusArgument &operator<<(QDBusArgument &argument, const ConnmanMap &map)
+{
+ argument.beginStructure();
+ argument << map.objectPath << map.propertyMap;
+ argument.endStructure();
+ return argument;
+}
+
+const QDBusArgument &operator>>(const QDBusArgument &argument, ConnmanMap &map)
+{
+ argument.beginStructure();
+ argument >> map.objectPath >> map.propertyMap;
+ argument.endStructure();
+ return argument;
+}
+static QDBusConnection dbusConnection = QDBusConnection::systemBus();
QConnmanManagerInterface::QConnmanManagerInterface( QObject *parent)
: QDBusAbstractInterface(QLatin1String(CONNMAN_SERVICE),
QLatin1String(CONNMAN_MANAGER_PATH),
@@ -301,14 +316,37 @@ QStringList QConnmanManagerInterface::getProfiles()
QStringList QConnmanManagerInterface::getTechnologies()
{
- QVariant var = getProperty("Technologies");
- return qdbus_cast<QStringList >(var);
+ QStringList list;
+ QDBusReply<ConnmanMapList> replyList = this->call(QLatin1String("GetTechnologies"));
+ if (replyList.isValid()) {
+ Q_FOREACH (ConnmanMap map, replyList.value()) {
+ list << map.objectPath.path();
+ }
+ } else {
+ // try for older version
+ QVariant var = getProperty("Technologies");
+ if (!var.isNull()) {
+ list = qdbus_cast<QStringList>(var);
+ }
+ }
+ return list;
}
QStringList QConnmanManagerInterface::getServices()
{
- QVariant var = getProperty("Services");
- return qdbus_cast<QStringList >(var);
+ QStringList list;
+ QDBusReply<ConnmanMapList> replyList = this->call(QLatin1String("GetServices"));
+ if (replyList.isValid()) {
+ Q_FOREACH (ConnmanMap map, replyList.value()) {
+ list << map.objectPath.path();
+ }
+ } else {
+ QVariant var = getProperty("Services");
+ if (!var.isNull()) {
+ list = qdbus_cast<QStringList>(var);
+ }
+ }
+ return list;
}
QString QConnmanManagerInterface::getPathForTechnology(const QString &name)
diff --git a/src/plugins/bearer/connman/qconnmanservice_linux_p.h b/src/plugins/bearer/connman/qconnmanservice_linux_p.h
index be2063f8e8..3ed66f4769 100644
--- a/src/plugins/bearer/connman/qconnmanservice_linux_p.h
+++ b/src/plugins/bearer/connman/qconnmanservice_linux_p.h
@@ -59,6 +59,7 @@
#include <QtDBus/QDBusInterface>
#include <QtDBus/QDBusMessage>
#include <QtDBus/QDBusReply>
+#include <QtDBus/QDBusArgument>
#include <QtDBus/QDBusPendingCallWatcher>
#include <QtDBus/QDBusObjectPath>
@@ -90,11 +91,23 @@
QT_BEGIN_NAMESPACE
+struct ConnmanMap {
+ QDBusObjectPath objectPath;
+ QVariantMap propertyMap;
+};
+
+typedef QList< ConnmanMap > ConnmanMapList;
+
QT_END_NAMESPACE
+Q_DECLARE_METATYPE(QT_PREPEND_NAMESPACE(ConnmanMap))
+Q_DECLARE_METATYPE(QT_PREPEND_NAMESPACE(ConnmanMapList))
QT_BEGIN_NAMESPACE
+QDBusArgument &operator<<(QDBusArgument &argument, const ConnmanMap &obj);
+const QDBusArgument &operator>>(const QDBusArgument &argument, ConnmanMap &obj);
+
class QConnmanManagerInterface : public QDBusAbstractInterface
{
Q_OBJECT
diff --git a/src/plugins/bearer/corewlan/corewlan.pro b/src/plugins/bearer/corewlan/corewlan.pro
index 481b75c8ab..db8651de6e 100644
--- a/src/plugins/bearer/corewlan/corewlan.pro
+++ b/src/plugins/bearer/corewlan/corewlan.pro
@@ -1,6 +1,7 @@
TARGET = qcorewlanbearer
PLUGIN_TYPE = bearer
+PLUGIN_CLASS_NAME = QCoreWlanEnginePlugin
load(qt_plugin)
QT = core-private network-private
diff --git a/src/plugins/bearer/generic/generic.pro b/src/plugins/bearer/generic/generic.pro
index a1da0dddda..d0e17380e3 100644
--- a/src/plugins/bearer/generic/generic.pro
+++ b/src/plugins/bearer/generic/generic.pro
@@ -1,6 +1,7 @@
TARGET = qgenericbearer
PLUGIN_TYPE = bearer
+PLUGIN_CLASS_NAME = QGenericEnginePlugin
load(qt_plugin)
QT = core-private network-private
diff --git a/src/plugins/bearer/nativewifi/nativewifi.pro b/src/plugins/bearer/nativewifi/nativewifi.pro
index 4382cd08cd..e372c8ca05 100644
--- a/src/plugins/bearer/nativewifi/nativewifi.pro
+++ b/src/plugins/bearer/nativewifi/nativewifi.pro
@@ -1,6 +1,7 @@
TARGET = qnativewifibearer
PLUGIN_TYPE = bearer
+PLUGIN_CLASS_NAME = QNativeWifiEnginePlugin
load(qt_plugin)
QT = core-private network-private
diff --git a/src/plugins/bearer/networkmanager/networkmanager.pro b/src/plugins/bearer/networkmanager/networkmanager.pro
index 4f299e22f2..1ed9bfaa1b 100644
--- a/src/plugins/bearer/networkmanager/networkmanager.pro
+++ b/src/plugins/bearer/networkmanager/networkmanager.pro
@@ -1,6 +1,7 @@
TARGET = qnmbearer
PLUGIN_TYPE = bearer
+PLUGIN_CLASS_NAME = QNetworkManagerEnginePlugin
load(qt_plugin)
QT = core network-private dbus
diff --git a/src/plugins/bearer/nla/nla.pro b/src/plugins/bearer/nla/nla.pro
index 56c06a57b1..bac7608477 100644
--- a/src/plugins/bearer/nla/nla.pro
+++ b/src/plugins/bearer/nla/nla.pro
@@ -1,6 +1,7 @@
TARGET = qnlabearer
PLUGIN_TYPE = bearer
+PLUGIN_CLASS_NAME = QNlaEnginePlugin
load(qt_plugin)
QT = core core-private network network-private
diff --git a/src/plugins/generic/evdevkeyboard/evdevkeyboard.pro b/src/plugins/generic/evdevkeyboard/evdevkeyboard.pro
index 97b827b779..281515145f 100644
--- a/src/plugins/generic/evdevkeyboard/evdevkeyboard.pro
+++ b/src/plugins/generic/evdevkeyboard/evdevkeyboard.pro
@@ -1,6 +1,7 @@
TARGET = qevdevkeyboardplugin
PLUGIN_TYPE = generic
+PLUGIN_CLASS_NAME = QEvdevKeyboardPlugin
load(qt_plugin)
QT += core-private platformsupport-private gui-private
diff --git a/src/plugins/generic/evdevmouse/evdevmouse.pro b/src/plugins/generic/evdevmouse/evdevmouse.pro
index c1356593df..9a3cc839cc 100644
--- a/src/plugins/generic/evdevmouse/evdevmouse.pro
+++ b/src/plugins/generic/evdevmouse/evdevmouse.pro
@@ -1,6 +1,7 @@
TARGET = qevdevmouseplugin
PLUGIN_TYPE = generic
+PLUGIN_CLASS_NAME = QEvdevMousePlugin
load(qt_plugin)
QT += core-private platformsupport-private gui-private
diff --git a/src/plugins/generic/evdevtablet/evdevtablet.pro b/src/plugins/generic/evdevtablet/evdevtablet.pro
index 066819be33..ee3fbb3ec1 100644
--- a/src/plugins/generic/evdevtablet/evdevtablet.pro
+++ b/src/plugins/generic/evdevtablet/evdevtablet.pro
@@ -1,6 +1,7 @@
TARGET = qevdevtabletplugin
PLUGIN_TYPE = generic
+PLUGIN_CLASS_NAME = QEvdevTabletPlugin
load(qt_plugin)
SOURCES = main.cpp
diff --git a/src/plugins/generic/evdevtouch/evdevtouch.pro b/src/plugins/generic/evdevtouch/evdevtouch.pro
index 2c1d6913ad..3d1c481c36 100644
--- a/src/plugins/generic/evdevtouch/evdevtouch.pro
+++ b/src/plugins/generic/evdevtouch/evdevtouch.pro
@@ -1,6 +1,7 @@
TARGET = qevdevtouchplugin
PLUGIN_TYPE = generic
+PLUGIN_CLASS_NAME = QEvdevTouchScreenPlugin
load(qt_plugin)
SOURCES = main.cpp
diff --git a/src/plugins/generic/meego/meego.pro b/src/plugins/generic/meego/meego.pro
index b8845418e8..c428517cd5 100644
--- a/src/plugins/generic/meego/meego.pro
+++ b/src/plugins/generic/meego/meego.pro
@@ -1,6 +1,7 @@
TARGET = qmeegointegration
PLUGIN_TYPE = generic
+PLUGIN_CLASS_NAME = QMeeGoIntegrationPlugin
load(qt_plugin)
SOURCES = qmeegointegration.cpp \
diff --git a/src/plugins/generic/tslib/tslib.pro b/src/plugins/generic/tslib/tslib.pro
index ab0645d89a..035857bb73 100644
--- a/src/plugins/generic/tslib/tslib.pro
+++ b/src/plugins/generic/tslib/tslib.pro
@@ -1,6 +1,7 @@
TARGET = qtslibplugin
PLUGIN_TYPE = generic
+PLUGIN_CLASS_NAME = QTsLibPlugin
load(qt_plugin)
HEADERS = qtslib.h
diff --git a/src/plugins/imageformats/gif/gif.pro b/src/plugins/imageformats/gif/gif.pro
index d5acfedff7..898f06e7c7 100644
--- a/src/plugins/imageformats/gif/gif.pro
+++ b/src/plugins/imageformats/gif/gif.pro
@@ -1,6 +1,7 @@
TARGET = qgif
PLUGIN_TYPE = imageformats
+PLUGIN_CLASS_NAME = QGifPlugin
load(qt_plugin)
include(../../../gui/image/qgifhandler.pri)
diff --git a/src/plugins/imageformats/gif/main.h b/src/plugins/imageformats/gif/main.h
index 46d669a97f..c7770edc53 100644
--- a/src/plugins/imageformats/gif/main.h
+++ b/src/plugins/imageformats/gif/main.h
@@ -42,6 +42,8 @@
#include <qimageiohandler.h>
#include <qstringlist.h>
+#ifndef QT_NO_IMAGEFORMATPLUGIN
+
#ifdef QT_NO_IMAGEFORMAT_GIF
#undef QT_NO_IMAGEFORMAT_GIF
#endif
@@ -62,3 +64,5 @@ public:
};
QT_END_NAMESPACE
+
+#endif // QT_NO_IMAGEFORMATPLUGIN
diff --git a/src/plugins/imageformats/ico/ico.pro b/src/plugins/imageformats/ico/ico.pro
index 48bfd6b344..4250fcb4bc 100644
--- a/src/plugins/imageformats/ico/ico.pro
+++ b/src/plugins/imageformats/ico/ico.pro
@@ -1,6 +1,7 @@
TARGET = qico
PLUGIN_TYPE = imageformats
+PLUGIN_CLASS_NAME = QICOPlugin
load(qt_plugin)
QTDIR_build:REQUIRES = "!contains(QT_CONFIG, no-ico)"
diff --git a/src/plugins/imageformats/jpeg/jpeg.pro b/src/plugins/imageformats/jpeg/jpeg.pro
index 35153eb59c..45bf7bbd43 100644
--- a/src/plugins/imageformats/jpeg/jpeg.pro
+++ b/src/plugins/imageformats/jpeg/jpeg.pro
@@ -1,6 +1,7 @@
TARGET = qjpeg
PLUGIN_TYPE = imageformats
+PLUGIN_CLASS_NAME = QJpegPlugin
load(qt_plugin)
QT += core-private
diff --git a/src/plugins/platforminputcontexts/ibus/ibus.pro b/src/plugins/platforminputcontexts/ibus/ibus.pro
index 033d5a4d5c..75a5b5838f 100644
--- a/src/plugins/platforminputcontexts/ibus/ibus.pro
+++ b/src/plugins/platforminputcontexts/ibus/ibus.pro
@@ -1,6 +1,7 @@
TARGET = ibusplatforminputcontextplugin
PLUGIN_TYPE = platforminputcontexts
+PLUGIN_CLASS_NAME = QIbusPlatformInputContextPlugin
load(qt_plugin)
QT += dbus gui-private
diff --git a/src/plugins/platforminputcontexts/maliit/maliit.pro b/src/plugins/platforminputcontexts/maliit/maliit.pro
index dec6833196..1e50f7289b 100644
--- a/src/plugins/platforminputcontexts/maliit/maliit.pro
+++ b/src/plugins/platforminputcontexts/maliit/maliit.pro
@@ -1,6 +1,7 @@
TARGET = maliitplatforminputcontextplugin
PLUGIN_TYPE = platforminputcontexts
+PLUGIN_CLASS_NAME = QMaliitPlatformInputContextPlugin
load(qt_plugin)
QT += dbus gui-private
diff --git a/src/plugins/platforminputcontexts/platforminputcontexts.pro b/src/plugins/platforminputcontexts/platforminputcontexts.pro
index 7c1f55927d..c8449e7e44 100644
--- a/src/plugins/platforminputcontexts/platforminputcontexts.pro
+++ b/src/plugins/platforminputcontexts/platforminputcontexts.pro
@@ -1,4 +1,4 @@
TEMPLATE = subdirs
-contains(QT_CONFIG, dbus) {
+qtHaveModule(dbus) {
!macx:!win32:SUBDIRS += ibus maliit
}
diff --git a/src/plugins/platforms/cocoa/cocoa.pro b/src/plugins/platforms/cocoa/cocoa.pro
index 78fcf20afc..83e2a88e6a 100644
--- a/src/plugins/platforms/cocoa/cocoa.pro
+++ b/src/plugins/platforms/cocoa/cocoa.pro
@@ -1,6 +1,7 @@
TARGET = qcocoa
PLUGIN_TYPE = platforms
+PLUGIN_CLASS_NAME = QCocoaIntegrationPlugin
load(qt_plugin)
OBJECTIVE_SOURCES += main.mm \
@@ -38,6 +39,7 @@ OBJECTIVE_SOURCES += main.mm \
qcocoaservices.mm \
qcocoasystemtrayicon.mm \
qcocoaintrospection.mm \
+ qcocoakeymapper.mm \
HEADERS += qcocoaintegration.h \
qcocoatheme.h \
@@ -72,6 +74,7 @@ HEADERS += qcocoaintegration.h \
qcocoaservices.h \
qcocoasystemtrayicon.h \
qcocoaintrospection.h \
+ qcocoakeymapper.h \
RESOURCES += qcocoaresources.qrc
@@ -79,7 +82,7 @@ LIBS += -framework Cocoa -framework IOKit
QT += core-private gui-private platformsupport-private
-!contains(QT_CONFIG, no-widgets) {
+qtHaveModule(widgets) {
OBJECTIVE_SOURCES += \
qpaintengine_mac.mm \
qprintengine_mac.mm \
@@ -95,13 +98,6 @@ QT += core-private gui-private platformsupport-private
OTHER_FILES += cocoa.json
-# Build the release libqcocoa.dylib only, skip the debug version.
-# The Qt plugin loader will dlopen both if found, causing duplicate
-# Objective-c class definitions for the classes defined in the plugin.
-contains(QT_CONFIG,release):CONFIG -= debug
-contains(QT_CONFIG,debug_and_release):CONFIG -= debug_and_release
-contains(QT_CONFIG,build_all):CONFIG -= build_all
-
# Acccessibility debug support
# DEFINES += QT_COCOA_ENABLE_ACCESSIBILITY_INSPECTOR
# include ($$PWD/../../../../util/accessibilityinspector/accessibilityinspector.pri)
diff --git a/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm b/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm
index df6b64443d..d5841c1983 100644
--- a/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm
+++ b/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm
@@ -122,7 +122,7 @@ static QAccessibleInterface *acast(void *ptr)
[attributes addObject : NSAccessibilityValueAttribute];
}
- return attributes;
+ return [attributes autorelease];
}
- (id)accessibilityAttributeValue:(NSString *)attribute {
@@ -139,7 +139,7 @@ static QAccessibleInterface *acast(void *ptr)
[kids addObject:[QCocoaAccessibleElement elementWithInterface:(void*)childInterface parent:self]];
}
- return NSAccessibilityUnignoredChildren(kids);
+ return kids;
} else if ([attribute isEqualToString:NSAccessibilityFocusedAttribute]) {
// Just check if the app thinks we're focused.
id focusedElement = [NSApp accessibilityAttributeValue:NSAccessibilityFocusedUIElementAttribute];
@@ -239,6 +239,10 @@ static QAccessibleInterface *acast(void *ptr)
if (!accessibleInterface)
return NSAccessibilityUnignoredAncestor(self);
+
+ if (!acast(accessibleInterface)->isValid())
+ return NSAccessibilityUnignoredAncestor(self);
+
QAccessibleInterface *childInterface = acast(accessibleInterface)->childAt(point.x, qt_mac_flipYCoordinate(point.y));
// No child found, meaning we hit this element.
diff --git a/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm b/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm
index 7aa365df67..80c9e227d2 100644
--- a/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm
+++ b/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm
@@ -510,14 +510,16 @@ static bool IsMouseOrKeyEvent( NSEvent* event )
static inline void qt_mac_waitForMoreEvents(NSString *runLoopMode = NSDefaultRunLoopMode)
{
- // If no event exist in the cocoa event que, wait
- // (and free up cpu time) until at least one event occur.
- // This implementation is a bit on the edge, but seems to
- // work fine:
- [NSApp nextEventMatchingMask:NSAnyEventMask
- untilDate:[NSDate distantFuture]
- inMode:runLoopMode
- dequeue:NO];
+ // If no event exist in the cocoa event que, wait (and free up cpu time) until
+ // at least one event occur. Setting 'dequeuing' to 'no' in the following call
+ // causes it to hang under certain circumstances (QTBUG-28283), so we tell it
+ // to dequeue instead, just to repost the event again:
+ NSEvent* event = [NSApp nextEventMatchingMask:NSAnyEventMask
+ untilDate:[NSDate distantFuture]
+ inMode:runLoopMode
+ dequeue:YES];
+ if (event)
+ [NSApp postEvent:event atStart:YES];
}
bool QCocoaEventDispatcher::processEvents(QEventLoop::ProcessEventsFlags flags)
diff --git a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
index f9122f56d1..5747cc01e9 100644
--- a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
+++ b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
@@ -223,7 +223,7 @@ static QString strippedText(QString s)
- (void)showModelessPanel
{
if (mOpenPanel){
- QFileInfo info(*mCurrentSelection);
+ QFileInfo info(!mCurrentSelection->isEmpty() ? *mCurrentSelection : QT_PREPEND_NAMESPACE(QCFString::toQString)(mCurrentDir));
NSString *filepath = QT_PREPEND_NAMESPACE(QCFString::toNSString)(info.filePath());
bool selectable = (mOptions->acceptMode() == QFileDialogOptions::AcceptSave)
|| [self panel:nil shouldShowFilename:filepath];
@@ -241,7 +241,7 @@ static QString strippedText(QString s)
- (BOOL)runApplicationModalPanel
{
- QFileInfo info(*mCurrentSelection);
+ QFileInfo info(!mCurrentSelection->isEmpty() ? *mCurrentSelection : QT_PREPEND_NAMESPACE(QCFString::toQString)(mCurrentDir));
NSString *filepath = QT_PREPEND_NAMESPACE(QCFString::toNSString)(info.filePath());
bool selectable = (mOptions->acceptMode() == QFileDialogOptions::AcceptSave)
|| [self panel:nil shouldShowFilename:filepath];
@@ -266,7 +266,7 @@ static QString strippedText(QString s)
- (void)showWindowModalSheet:(QWindow *)parent
{
- QFileInfo info(*mCurrentSelection);
+ QFileInfo info(!mCurrentSelection->isEmpty() ? *mCurrentSelection : QT_PREPEND_NAMESPACE(QCFString::toQString)(mCurrentDir));
NSString *filepath = QT_PREPEND_NAMESPACE(QCFString::toNSString)(info.filePath());
bool selectable = (mOptions->acceptMode() == QFileDialogOptions::AcceptSave)
|| [self panel:nil shouldShowFilename:filepath];
diff --git a/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm b/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm
index 5ccd019a9b..ff3ba63931 100644
--- a/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm
+++ b/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm
@@ -92,20 +92,16 @@ static QFont qfontForCocoaFont(NSFont *cocoaFont, const QFont &resolveFont)
QFont newFont;
if (cocoaFont) {
int pSize = qRound([cocoaFont pointSize]);
- QString family(QCFString::toQString([cocoaFont familyName]));
- QString typeface(QCFString::toQString([cocoaFont fontName]));
-
- int hyphenPos = typeface.indexOf(QLatin1Char('-'));
- if (hyphenPos != -1) {
- typeface.remove(0, hyphenPos + 1);
- } else {
- typeface = QLatin1String("Normal");
- }
+ CTFontDescriptorRef font = CTFontCopyFontDescriptor((CTFontRef)cocoaFont);
+ // QCoreTextFontDatabase::populateFontDatabase() is using localized names
+ QString family = QCFString::toQString((CFStringRef) CTFontDescriptorCopyLocalizedAttribute(font, kCTFontFamilyNameAttribute, NULL));
+ QString style = QCFString::toQString((CFStringRef) CTFontDescriptorCopyLocalizedAttribute(font, kCTFontStyleNameAttribute, NULL));
- newFont = QFontDatabase().font(family, typeface, pSize);
+ newFont = QFontDatabase().font(family, style, pSize);
newFont.setUnderline(resolveFont.underline());
newFont.setStrikeOut(resolveFont.strikeOut());
+ CFRelease(font);
}
return newFont;
}
diff --git a/src/plugins/platforms/cocoa/qcocoahelpers.mm b/src/plugins/platforms/cocoa/qcocoahelpers.mm
index 9783899742..31a56b9d66 100644
--- a/src/plugins/platforms/cocoa/qcocoahelpers.mm
+++ b/src/plugins/platforms/cocoa/qcocoahelpers.mm
@@ -138,6 +138,8 @@ NSImage *qt_mac_cgimage_to_nsimage(CGImageRef image)
NSImage *qt_mac_create_nsimage(const QPixmap &pm)
{
+ if (pm.isNull())
+ return 0;
QImage image = pm.toImage();
CGImageRef cgImage = qt_mac_image_to_cgimage(image);
NSImage *nsImage = qt_mac_cgimage_to_nsimage(cgImage);
@@ -784,14 +786,49 @@ CGImageRef qt_mac_toCGImage(const QImage &qImage, bool isMask, uchar **dataCopy)
NULL,
false);
} else {
- CGColorSpaceRef cgColourSpaceRef = CGColorSpaceCreateDeviceRGB();
+ // Try get a device color space. Using the device color space means
+ // that the CGImage can be drawn to screen without per-pixel color
+ // space conversion, at the cost of less color accuracy.
+ CGColorSpaceRef cgColourSpaceRef = 0;
+ CMProfileRef sysProfile;
+ if (CMGetSystemProfile(&sysProfile) == noErr)
+ {
+ cgColourSpaceRef = CGColorSpaceCreateWithPlatformColorSpace(sysProfile);
+ CMCloseProfile(sysProfile);
+ }
+
+ // Fall back to Generic RGB if a profile was not found.
+ if (!cgColourSpaceRef)
+ cgColourSpaceRef = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB);
+
+ // Create a CGBitmapInfo contiaining the image format.
+ // Support the 8-bit per component (A)RGB formats.
+ CGBitmapInfo bitmapInfo = kCGBitmapByteOrder32Little;
+ switch (qImage.format()) {
+ case QImage::Format_ARGB32_Premultiplied :
+ bitmapInfo |= kCGImageAlphaPremultipliedFirst;
+ break;
+ case QImage::Format_ARGB32 :
+ bitmapInfo |= kCGImageAlphaFirst;
+ break;
+ case QImage::Format_RGB32 :
+ bitmapInfo |= kCGImageAlphaNoneSkipFirst;
+ break;
+ case QImage::Format_RGB888 :
+ bitmapInfo |= kCGImageAlphaNone;
+ break;
+ default:
+ qWarning() << "qt_mac_toCGImage: Unsupported image format" << qImage.format();
+ break;
+ }
+
cgImage = CGImageCreate(width,
height,
colorBufferSize,
bitDepth,
bytesPrLine,
cgColourSpaceRef,
- kCGBitmapByteOrder32Little | kCGImageAlphaNoneSkipFirst,
+ bitmapInfo,
cgDataProviderRef,
NULL,
false,
diff --git a/src/plugins/platforms/cocoa/qcocoaintegration.h b/src/plugins/platforms/cocoa/qcocoaintegration.h
index 1bb46ea3ea..e455a3552e 100644
--- a/src/plugins/platforms/cocoa/qcocoaintegration.h
+++ b/src/plugins/platforms/cocoa/qcocoaintegration.h
@@ -49,6 +49,7 @@
#include "qcocoaclipboard.h"
#include "qcocoadrag.h"
#include "qcocoaservices.h"
+#include "qcocoakeymapper.h"
#include <QtCore/QScopedPointer>
#include <qpa/qplatformintegration.h>
@@ -121,6 +122,8 @@ public:
QPlatformServices *services() const;
QVariant styleHint(StyleHint hint) const;
+ QList<int> possibleKeys(const QKeyEvent *event) const;
+
void updateScreens();
private:
@@ -138,6 +141,7 @@ private:
QScopedPointer<QCocoaDrag> mCocoaDrag;
QScopedPointer<QPlatformNativeInterface> mNativeInterface;
QScopedPointer<QCocoaServices> mServices;
+ QScopedPointer<QCocoaKeyMapper> mKeyboardMapper;
};
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/cocoa/qcocoaintegration.mm b/src/plugins/platforms/cocoa/qcocoaintegration.mm
index 393c471c25..e096096e99 100644
--- a/src/plugins/platforms/cocoa/qcocoaintegration.mm
+++ b/src/plugins/platforms/cocoa/qcocoaintegration.mm
@@ -199,6 +199,7 @@ QCocoaIntegration::QCocoaIntegration()
, mCocoaDrag(new QCocoaDrag)
, mNativeInterface(new QCocoaNativeInterface)
, mServices(new QCocoaServices)
+ , mKeyboardMapper(new QCocoaKeyMapper)
{
initResources();
QCocoaAutoReleasePool pool;
@@ -414,4 +415,9 @@ QVariant QCocoaIntegration::styleHint(StyleHint hint) const
return QPlatformIntegration::styleHint(hint);
}
+QList<int> QCocoaIntegration::possibleKeys(const QKeyEvent *event) const
+{
+ return mKeyboardMapper->possibleKeys(event);
+}
+
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/cocoa/qcocoakeymapper.h b/src/plugins/platforms/cocoa/qcocoakeymapper.h
new file mode 100644
index 0000000000..693539dd4e
--- /dev/null
+++ b/src/plugins/platforms/cocoa/qcocoakeymapper.h
@@ -0,0 +1,111 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** 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 Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QCOCOAKEYMAPPER_H
+#define QCOCOAKEYMAPPER_H
+
+#include <qcocoahelpers.h>
+
+#include <Cocoa/Cocoa.h>
+#include <Carbon/Carbon.h>
+
+#include <QtCore/QList>
+#include <QtGui/QKeyEvent>
+
+QT_BEGIN_NAMESPACE
+
+/*
+ \internal
+ A Mac KeyboardLayoutItem has 8 possible states:
+ 1. Unmodified
+ 2. Shift
+ 3. Control
+ 4. Control + Shift
+ 5. Alt
+ 6. Alt + Shift
+ 7. Alt + Control
+ 8. Alt + Control + Shift
+ 9. Meta
+ 10. Meta + Shift
+ 11. Meta + Control
+ 12. Meta + Control + Shift
+ 13. Meta + Alt
+ 14. Meta + Alt + Shift
+ 15. Meta + Alt + Control
+ 16. Meta + Alt + Control + Shift
+*/
+struct KeyboardLayoutItem {
+ bool dirty;
+ quint32 qtKey[16]; // Can by any Qt::Key_<foo>, or unicode character
+};
+
+
+class QCocoaKeyMapper
+{
+public:
+ QCocoaKeyMapper();
+ ~QCocoaKeyMapper();
+ QList<int> possibleKeys(const QKeyEvent *event) const;
+ bool updateKeyboard();
+ void deleteLayouts();
+ void updateKeyMap(unsigned short macVirtualKey, QChar unicodeKey);
+ void clearMappings();
+
+private:
+ QCFType<TISInputSourceRef> currentInputSource;
+
+ QLocale keyboardInputLocale;
+ Qt::LayoutDirection keyboardInputDirection;
+ enum { NullMode, UnicodeMode, OtherMode } keyboard_mode;
+ union {
+ const UCKeyboardLayout *unicode;
+ void *other;
+ } keyboard_layout_format;
+ KeyboardLayoutRef currentKeyboardLayout;
+ KeyboardLayoutKind keyboard_kind;
+ UInt32 keyboard_dead;
+ KeyboardLayoutItem *keyLayout[256];
+};
+
+QT_END_NAMESPACE
+
+#endif
+
diff --git a/src/plugins/platforms/cocoa/qcocoakeymapper.mm b/src/plugins/platforms/cocoa/qcocoakeymapper.mm
new file mode 100644
index 0000000000..6df0466355
--- /dev/null
+++ b/src/plugins/platforms/cocoa/qcocoakeymapper.mm
@@ -0,0 +1,468 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** 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 Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qcocoakeymapper.h"
+
+#include <QtCore/QDebug>
+#include <QtGui/QGuiApplication>
+
+QT_BEGIN_NAMESPACE
+
+// QCocoaKeyMapper debug facilities
+//#define DEBUG_KEY_BINDINGS
+//#define DEBUG_KEY_BINDINGS_MODIFIERS
+//#define DEBUG_KEY_MAPS
+
+// Possible modifier states.
+// NOTE: The order of these states match the order in updatePossibleKeyCodes()!
+static const Qt::KeyboardModifiers ModsTbl[] = {
+ Qt::NoModifier, // 0
+ Qt::ShiftModifier, // 1
+ Qt::ControlModifier, // 2
+ Qt::ControlModifier | Qt::ShiftModifier, // 3
+ Qt::AltModifier, // 4
+ Qt::AltModifier | Qt::ShiftModifier, // 5
+ Qt::AltModifier | Qt::ControlModifier, // 6
+ Qt::AltModifier | Qt::ShiftModifier | Qt::ControlModifier, // 7
+ Qt::MetaModifier, // 8
+ Qt::MetaModifier | Qt::ShiftModifier, // 9
+ Qt::MetaModifier | Qt::ControlModifier, // 10
+ Qt::MetaModifier | Qt::ControlModifier | Qt::ShiftModifier,// 11
+ Qt::MetaModifier | Qt::AltModifier, // 12
+ Qt::MetaModifier | Qt::AltModifier | Qt::ShiftModifier, // 13
+ Qt::MetaModifier | Qt::AltModifier | Qt::ControlModifier, // 14
+ Qt::MetaModifier | Qt::AltModifier | Qt::ShiftModifier | Qt::ControlModifier, // 15
+};
+
+bool qt_mac_eat_unicode_key = false;
+
+Q_GUI_EXPORT void qt_mac_secure_keyboard(bool b)
+{
+ static bool secure = false;
+ if (b != secure){
+ b ? EnableSecureEventInput() : DisableSecureEventInput();
+ secure = b;
+ }
+}
+
+/* key maps */
+struct qt_mac_enum_mapper
+{
+ int mac_code;
+ int qt_code;
+#if defined(DEBUG_KEY_BINDINGS)
+# define QT_MAC_MAP_ENUM(x) x, #x
+ const char *desc;
+#else
+# define QT_MAC_MAP_ENUM(x) x
+#endif
+};
+
+//modifiers
+static qt_mac_enum_mapper qt_mac_modifier_symbols[] = {
+ { shiftKey, QT_MAC_MAP_ENUM(Qt::ShiftModifier) },
+ { rightShiftKey, QT_MAC_MAP_ENUM(Qt::ShiftModifier) },
+ { controlKey, QT_MAC_MAP_ENUM(Qt::MetaModifier) },
+ { rightControlKey, QT_MAC_MAP_ENUM(Qt::MetaModifier) },
+ { cmdKey, QT_MAC_MAP_ENUM(Qt::ControlModifier) },
+ { optionKey, QT_MAC_MAP_ENUM(Qt::AltModifier) },
+ { rightOptionKey, QT_MAC_MAP_ENUM(Qt::AltModifier) },
+ { kEventKeyModifierNumLockMask, QT_MAC_MAP_ENUM(Qt::KeypadModifier) },
+ { 0, QT_MAC_MAP_ENUM(0) }
+};
+Qt::KeyboardModifiers qt_mac_get_modifiers(int keys)
+{
+#ifdef DEBUG_KEY_BINDINGS_MODIFIERS
+ qDebug("Qt: internal: **Mapping modifiers: %d (0x%04x)", keys, keys);
+#endif
+ Qt::KeyboardModifiers ret = Qt::NoModifier;
+ for (int i = 0; qt_mac_modifier_symbols[i].qt_code; i++) {
+ if (keys & qt_mac_modifier_symbols[i].mac_code) {
+#ifdef DEBUG_KEY_BINDINGS_MODIFIERS
+ qDebug("Qt: internal: got modifier: %s", qt_mac_modifier_symbols[i].desc);
+#endif
+ ret |= Qt::KeyboardModifier(qt_mac_modifier_symbols[i].qt_code);
+ }
+ }
+ if (qApp->testAttribute(Qt::AA_MacDontSwapCtrlAndMeta)) {
+ Qt::KeyboardModifiers oldModifiers = ret;
+ ret &= ~(Qt::MetaModifier | Qt::ControlModifier);
+ if (oldModifiers & Qt::ControlModifier)
+ ret |= Qt::MetaModifier;
+ if (oldModifiers & Qt::MetaModifier)
+ ret |= Qt::ControlModifier;
+ }
+ return ret;
+}
+static int qt_mac_get_mac_modifiers(Qt::KeyboardModifiers keys)
+{
+#ifdef DEBUG_KEY_BINDINGS_MODIFIERS
+ qDebug("Qt: internal: **Mapping modifiers: %d (0x%04x)", (int)keys, (int)keys);
+#endif
+ int ret = 0;
+ for (int i = 0; qt_mac_modifier_symbols[i].qt_code; i++) {
+ if (keys & qt_mac_modifier_symbols[i].qt_code) {
+#ifdef DEBUG_KEY_BINDINGS_MODIFIERS
+ qDebug("Qt: internal: got modifier: %s", qt_mac_modifier_symbols[i].desc);
+#endif
+ ret |= qt_mac_modifier_symbols[i].mac_code;
+ }
+ }
+
+ if (qApp->testAttribute(Qt::AA_MacDontSwapCtrlAndMeta)) {
+ int oldModifiers = ret;
+ ret &= ~(controlKeyBit | cmdKeyBit);
+ if (oldModifiers & controlKeyBit)
+ ret |= cmdKeyBit;
+ if (oldModifiers & cmdKeyBit)
+ ret |= controlKeyBit;
+ }
+ return ret;
+}
+
+//keyboard keys (non-modifiers)
+static qt_mac_enum_mapper qt_mac_keyboard_symbols[] = {
+ { kHomeCharCode, QT_MAC_MAP_ENUM(Qt::Key_Home) },
+ { kEnterCharCode, QT_MAC_MAP_ENUM(Qt::Key_Enter) },
+ { kEndCharCode, QT_MAC_MAP_ENUM(Qt::Key_End) },
+ { kBackspaceCharCode, QT_MAC_MAP_ENUM(Qt::Key_Backspace) },
+ { kTabCharCode, QT_MAC_MAP_ENUM(Qt::Key_Tab) },
+ { kPageUpCharCode, QT_MAC_MAP_ENUM(Qt::Key_PageUp) },
+ { kPageDownCharCode, QT_MAC_MAP_ENUM(Qt::Key_PageDown) },
+ { kReturnCharCode, QT_MAC_MAP_ENUM(Qt::Key_Return) },
+ { kEscapeCharCode, QT_MAC_MAP_ENUM(Qt::Key_Escape) },
+ { kLeftArrowCharCode, QT_MAC_MAP_ENUM(Qt::Key_Left) },
+ { kRightArrowCharCode, QT_MAC_MAP_ENUM(Qt::Key_Right) },
+ { kUpArrowCharCode, QT_MAC_MAP_ENUM(Qt::Key_Up) },
+ { kDownArrowCharCode, QT_MAC_MAP_ENUM(Qt::Key_Down) },
+ { kHelpCharCode, QT_MAC_MAP_ENUM(Qt::Key_Help) },
+ { kDeleteCharCode, QT_MAC_MAP_ENUM(Qt::Key_Delete) },
+//ascii maps, for debug
+ { ':', QT_MAC_MAP_ENUM(Qt::Key_Colon) },
+ { ';', QT_MAC_MAP_ENUM(Qt::Key_Semicolon) },
+ { '<', QT_MAC_MAP_ENUM(Qt::Key_Less) },
+ { '=', QT_MAC_MAP_ENUM(Qt::Key_Equal) },
+ { '>', QT_MAC_MAP_ENUM(Qt::Key_Greater) },
+ { '?', QT_MAC_MAP_ENUM(Qt::Key_Question) },
+ { '@', QT_MAC_MAP_ENUM(Qt::Key_At) },
+ { ' ', QT_MAC_MAP_ENUM(Qt::Key_Space) },
+ { '!', QT_MAC_MAP_ENUM(Qt::Key_Exclam) },
+ { '"', QT_MAC_MAP_ENUM(Qt::Key_QuoteDbl) },
+ { '#', QT_MAC_MAP_ENUM(Qt::Key_NumberSign) },
+ { '$', QT_MAC_MAP_ENUM(Qt::Key_Dollar) },
+ { '%', QT_MAC_MAP_ENUM(Qt::Key_Percent) },
+ { '&', QT_MAC_MAP_ENUM(Qt::Key_Ampersand) },
+ { '\'', QT_MAC_MAP_ENUM(Qt::Key_Apostrophe) },
+ { '(', QT_MAC_MAP_ENUM(Qt::Key_ParenLeft) },
+ { ')', QT_MAC_MAP_ENUM(Qt::Key_ParenRight) },
+ { '*', QT_MAC_MAP_ENUM(Qt::Key_Asterisk) },
+ { '+', QT_MAC_MAP_ENUM(Qt::Key_Plus) },
+ { ',', QT_MAC_MAP_ENUM(Qt::Key_Comma) },
+ { '-', QT_MAC_MAP_ENUM(Qt::Key_Minus) },
+ { '.', QT_MAC_MAP_ENUM(Qt::Key_Period) },
+ { '/', QT_MAC_MAP_ENUM(Qt::Key_Slash) },
+ { '[', QT_MAC_MAP_ENUM(Qt::Key_BracketLeft) },
+ { ']', QT_MAC_MAP_ENUM(Qt::Key_BracketRight) },
+ { '\\', QT_MAC_MAP_ENUM(Qt::Key_Backslash) },
+ { '_', QT_MAC_MAP_ENUM(Qt::Key_Underscore) },
+ { '`', QT_MAC_MAP_ENUM(Qt::Key_QuoteLeft) },
+ { '{', QT_MAC_MAP_ENUM(Qt::Key_BraceLeft) },
+ { '}', QT_MAC_MAP_ENUM(Qt::Key_BraceRight) },
+ { '|', QT_MAC_MAP_ENUM(Qt::Key_Bar) },
+ { '~', QT_MAC_MAP_ENUM(Qt::Key_AsciiTilde) },
+ { '^', QT_MAC_MAP_ENUM(Qt::Key_AsciiCircum) },
+ { 0, QT_MAC_MAP_ENUM(0) }
+};
+
+static qt_mac_enum_mapper qt_mac_keyvkey_symbols[] = { //real scan codes
+ { 122, QT_MAC_MAP_ENUM(Qt::Key_F1) },
+ { 120, QT_MAC_MAP_ENUM(Qt::Key_F2) },
+ { 99, QT_MAC_MAP_ENUM(Qt::Key_F3) },
+ { 118, QT_MAC_MAP_ENUM(Qt::Key_F4) },
+ { 96, QT_MAC_MAP_ENUM(Qt::Key_F5) },
+ { 97, QT_MAC_MAP_ENUM(Qt::Key_F6) },
+ { 98, QT_MAC_MAP_ENUM(Qt::Key_F7) },
+ { 100, QT_MAC_MAP_ENUM(Qt::Key_F8) },
+ { 101, QT_MAC_MAP_ENUM(Qt::Key_F9) },
+ { 109, QT_MAC_MAP_ENUM(Qt::Key_F10) },
+ { 103, QT_MAC_MAP_ENUM(Qt::Key_F11) },
+ { 111, QT_MAC_MAP_ENUM(Qt::Key_F12) },
+ { 105, QT_MAC_MAP_ENUM(Qt::Key_F13) },
+ { 107, QT_MAC_MAP_ENUM(Qt::Key_F14) },
+ { 113, QT_MAC_MAP_ENUM(Qt::Key_F15) },
+ { 106, QT_MAC_MAP_ENUM(Qt::Key_F16) },
+ { 0, QT_MAC_MAP_ENUM(0) }
+};
+
+static qt_mac_enum_mapper qt_mac_private_unicode[] = {
+ { 0xF700, QT_MAC_MAP_ENUM(Qt::Key_Up) }, //NSUpArrowFunctionKey
+ { 0xF701, QT_MAC_MAP_ENUM(Qt::Key_Down) }, //NSDownArrowFunctionKey
+ { 0xF702, QT_MAC_MAP_ENUM(Qt::Key_Left) }, //NSLeftArrowFunctionKey
+ { 0xF703, QT_MAC_MAP_ENUM(Qt::Key_Right) }, //NSRightArrowFunctionKey
+ { 0xF727, QT_MAC_MAP_ENUM(Qt::Key_Insert) }, //NSInsertFunctionKey
+ { 0xF728, QT_MAC_MAP_ENUM(Qt::Key_Delete) }, //NSDeleteFunctionKey
+ { 0xF729, QT_MAC_MAP_ENUM(Qt::Key_Home) }, //NSHomeFunctionKey
+ { 0xF72B, QT_MAC_MAP_ENUM(Qt::Key_End) }, //NSEndFunctionKey
+ { 0xF72C, QT_MAC_MAP_ENUM(Qt::Key_PageUp) }, //NSPageUpFunctionKey
+ { 0xF72D, QT_MAC_MAP_ENUM(Qt::Key_PageDown) }, //NSPageDownFunctionKey
+ { 0xF72F, QT_MAC_MAP_ENUM(Qt::Key_ScrollLock) }, //NSScrollLockFunctionKey
+ { 0xF730, QT_MAC_MAP_ENUM(Qt::Key_Pause) }, //NSPauseFunctionKey
+ { 0xF731, QT_MAC_MAP_ENUM(Qt::Key_SysReq) }, //NSSysReqFunctionKey
+ { 0xF735, QT_MAC_MAP_ENUM(Qt::Key_Menu) }, //NSMenuFunctionKey
+ { 0xF738, QT_MAC_MAP_ENUM(Qt::Key_Print) }, //NSPrintFunctionKey
+ { 0xF73A, QT_MAC_MAP_ENUM(Qt::Key_Clear) }, //NSClearDisplayFunctionKey
+ { 0xF73D, QT_MAC_MAP_ENUM(Qt::Key_Insert) }, //NSInsertCharFunctionKey
+ { 0xF73E, QT_MAC_MAP_ENUM(Qt::Key_Delete) }, //NSDeleteCharFunctionKey
+ { 0xF741, QT_MAC_MAP_ENUM(Qt::Key_Select) }, //NSSelectFunctionKey
+ { 0xF742, QT_MAC_MAP_ENUM(Qt::Key_Execute) }, //NSExecuteFunctionKey
+ { 0xF746, QT_MAC_MAP_ENUM(Qt::Key_Help) }, //NSHelpFunctionKey
+ { 0xF747, QT_MAC_MAP_ENUM(Qt::Key_Mode_switch) }, //NSModeSwitchFunctionKey
+ { 0, QT_MAC_MAP_ENUM(0) }
+};
+
+static int qt_mac_get_key(int modif, const QChar &key, int virtualKey)
+{
+#ifdef DEBUG_KEY_BINDINGS
+ qDebug("**Mapping key: %d (0x%04x) - %d (0x%04x)", key.unicode(), key.unicode(), virtualKey, virtualKey);
+#endif
+
+ if (key == kClearCharCode && virtualKey == 0x47)
+ return Qt::Key_Clear;
+
+ if (key.isDigit()) {
+#ifdef DEBUG_KEY_BINDINGS
+ qDebug("%d: got key: %d", __LINE__, key.digitValue());
+#endif
+ return key.digitValue() + Qt::Key_0;
+ }
+
+ if (key.isLetter()) {
+#ifdef DEBUG_KEY_BINDINGS
+ qDebug("%d: got key: %d", __LINE__, (key.toUpper().unicode() - 'A'));
+#endif
+ return (key.toUpper().unicode() - 'A') + Qt::Key_A;
+ }
+ if (key.isSymbol()) {
+#ifdef DEBUG_KEY_BINDINGS
+ qDebug("%d: got key: %d", __LINE__, (key.unicode()));
+#endif
+ return key.unicode();
+ }
+
+ for (int i = 0; qt_mac_keyboard_symbols[i].qt_code; i++) {
+ if (qt_mac_keyboard_symbols[i].mac_code == key) {
+ /* To work like Qt for X11 we issue Backtab when Shift + Tab are pressed */
+ if (qt_mac_keyboard_symbols[i].qt_code == Qt::Key_Tab && (modif & Qt::ShiftModifier)) {
+#ifdef DEBUG_KEY_BINDINGS
+ qDebug("%d: got key: Qt::Key_Backtab", __LINE__);
+#endif
+ return Qt::Key_Backtab;
+ }
+
+#ifdef DEBUG_KEY_BINDINGS
+ qDebug("%d: got key: %s", __LINE__, qt_mac_keyboard_symbols[i].desc);
+#endif
+ return qt_mac_keyboard_symbols[i].qt_code;
+ }
+ }
+
+ //last ditch try to match the scan code
+ for (int i = 0; qt_mac_keyvkey_symbols[i].qt_code; i++) {
+ if (qt_mac_keyvkey_symbols[i].mac_code == virtualKey) {
+#ifdef DEBUG_KEY_BINDINGS
+ qDebug("%d: got key: %s", __LINE__, qt_mac_keyvkey_symbols[i].desc);
+#endif
+ return qt_mac_keyvkey_symbols[i].qt_code;
+ }
+ }
+
+ // check if they belong to key codes in private unicode range
+ if (key >= 0xf700 && key <= 0xf747) {
+ if (key >= 0xf704 && key <= 0xf726) {
+ return Qt::Key_F1 + (key.unicode() - 0xf704) ;
+ }
+ for (int i = 0; qt_mac_private_unicode[i].qt_code; i++) {
+ if (qt_mac_private_unicode[i].mac_code == key) {
+ return qt_mac_private_unicode[i].qt_code;
+ }
+ }
+
+ }
+
+ //oh well
+#ifdef DEBUG_KEY_BINDINGS
+ qDebug("Unknown case.. %s:%d %d[%d] %d", __FILE__, __LINE__, key.unicode(), key.toLatin1(), virtualKey);
+#endif
+ return Qt::Key_unknown;
+}
+
+QCocoaKeyMapper::QCocoaKeyMapper()
+{
+ memset(keyLayout, 0, sizeof(keyLayout));
+ keyboard_layout_format.unicode = 0;
+ currentInputSource = 0;
+}
+
+QCocoaKeyMapper::~QCocoaKeyMapper()
+{
+ deleteLayouts();
+}
+
+bool QCocoaKeyMapper::updateKeyboard()
+{
+ const UCKeyboardLayout *uchrData = 0;
+ QCFType<TISInputSourceRef> source = TISCopyCurrentKeyboardInputSource();
+ if (keyboard_mode != NullMode && source == currentInputSource) {
+ return false;
+ }
+ Q_ASSERT(source != 0);
+ CFDataRef data = static_cast<CFDataRef>(TISGetInputSourceProperty(source,
+ kTISPropertyUnicodeKeyLayoutData));
+ uchrData = data ? reinterpret_cast<const UCKeyboardLayout *>(CFDataGetBytePtr(data)) : 0;
+
+ keyboard_kind = LMGetKbdType();
+ if (uchrData) {
+ keyboard_layout_format.unicode = uchrData;
+ keyboard_mode = UnicodeMode;
+ }
+ currentInputSource = source;
+ keyboard_dead = 0;
+ CFStringRef iso639Code;
+
+ CFArrayRef array = static_cast<CFArrayRef>(TISGetInputSourceProperty(currentInputSource, kTISPropertyInputSourceLanguages));
+ iso639Code = static_cast<CFStringRef>(CFArrayGetValueAtIndex(array, 0)); // Actually a RFC3066bis, but it's close enough
+
+ if (iso639Code) {
+ keyboardInputLocale = QLocale(QCFString::toQString(iso639Code));
+ keyboardInputDirection = keyboardInputLocale.textDirection();
+ } else {
+ keyboardInputLocale = QLocale::c();
+ keyboardInputDirection = Qt::LeftToRight;
+ }
+ return true;
+}
+
+void QCocoaKeyMapper::deleteLayouts()
+{
+ keyboard_mode = NullMode;
+ for (int i = 0; i < 255; ++i) {
+ if (keyLayout[i]) {
+ delete keyLayout[i];
+ keyLayout[i] = 0;
+ }
+ }
+}
+
+void QCocoaKeyMapper::clearMappings()
+{
+ deleteLayouts();
+ updateKeyboard();
+}
+
+void QCocoaKeyMapper::updateKeyMap(unsigned short macVirtualKey, QChar unicodeKey)
+{
+ if (updateKeyboard()) {
+ // ### Qt 4 did this:
+ // QKeyMapper::changeKeyboard();
+ }
+ if (keyLayout[macVirtualKey])
+ return;
+
+ UniCharCount buffer_size = 10;
+ UniChar buffer[buffer_size];
+ keyLayout[macVirtualKey] = new KeyboardLayoutItem;
+ for (int i = 0; i < 16; ++i) {
+ UniCharCount out_buffer_size = 0;
+ keyLayout[macVirtualKey]->qtKey[i] = 0;
+
+ const UInt32 keyModifier = ((qt_mac_get_mac_modifiers(ModsTbl[i]) >> 8) & 0xFF);
+ OSStatus err = UCKeyTranslate(keyboard_layout_format.unicode, macVirtualKey, kUCKeyActionDown, keyModifier,
+ keyboard_kind, 0, &keyboard_dead, buffer_size, &out_buffer_size, buffer);
+ if (err == noErr && out_buffer_size) {
+ const QChar unicode(buffer[0]);
+ int qtkey = qt_mac_get_key(keyModifier, unicode, macVirtualKey);
+ if (qtkey == Qt::Key_unknown)
+ qtkey = unicode.unicode();
+ keyLayout[macVirtualKey]->qtKey[i] = qtkey;
+ } else {
+ int qtkey = qt_mac_get_key(keyModifier, unicodeKey, macVirtualKey);
+ if (qtkey == Qt::Key_unknown)
+ qtkey = unicodeKey.unicode();
+ keyLayout[macVirtualKey]->qtKey[i] = qtkey;
+ }
+ }
+#ifdef DEBUG_KEY_MAPS
+ qDebug("updateKeyMap for virtual key = 0x%02x!", (uint)macVirtualKey);
+ for (int i = 0; i < 16; ++i) {
+ qDebug(" [%d] (%d,0x%02x,'%c')", i,
+ keyLayout[macVirtualKey]->qtKey[i],
+ keyLayout[macVirtualKey]->qtKey[i],
+ keyLayout[macVirtualKey]->qtKey[i]);
+ }
+#endif
+}
+
+QList<int> QCocoaKeyMapper::possibleKeys(const QKeyEvent *event) const
+{
+ QList<int> ret;
+ const_cast<QCocoaKeyMapper *>(this)->updateKeyMap(event->nativeVirtualKey(), QChar(event->key()));
+
+ KeyboardLayoutItem *kbItem = keyLayout[event->nativeVirtualKey()];
+
+ if (!kbItem) // Key is not in any keyboard layout (e.g. eisu-key on Japanese keyboard)
+ return ret;
+
+ int baseKey = kbItem->qtKey[0];
+ Qt::KeyboardModifiers keyMods = event->modifiers();
+
+ ret << int(baseKey + keyMods); // The base key is _always_ valid, of course
+
+ for (int i = 1; i < 8; ++i) {
+ Qt::KeyboardModifiers neededMods = ModsTbl[i];
+ int key = kbItem->qtKey[i];
+ if (key && key != baseKey && ((keyMods & neededMods) == neededMods)) {
+ ret << int(key + (keyMods & ~neededMods));
+ }
+ }
+ return ret;
+}
+
+QT_END_NAMESPACE
diff --git a/src/plugins/platforms/cocoa/qcocoanativeinterface.mm b/src/plugins/platforms/cocoa/qcocoanativeinterface.mm
index f0b1bd330a..271c9d2894 100644
--- a/src/plugins/platforms/cocoa/qcocoanativeinterface.mm
+++ b/src/plugins/platforms/cocoa/qcocoanativeinterface.mm
@@ -107,8 +107,10 @@ QPlatformPrinterSupport *QCocoaNativeInterface::createPlatformPrinterSupport()
void *QCocoaNativeInterface::NSPrintInfoForPrintEngine(QPrintEngine *printEngine)
{
#ifndef QT_NO_WIDGETS
- QMacPrintEngine *macPrintEngine = static_cast<QMacPrintEngine *>(printEngine);
- return macPrintEngine->d_func()->printInfo;
+ QMacPrintEnginePrivate *macPrintEnginePriv = static_cast<QMacPrintEngine *>(printEngine)->d_func();
+ if (macPrintEnginePriv->state == QPrinter::Idle && !macPrintEnginePriv->isPrintSessionInitialized())
+ macPrintEnginePriv->initialize();
+ return macPrintEnginePriv->printInfo;
#else
qFatal("Printing is not supported when Qt is configured with -no-widgets");
return 0;
diff --git a/src/plugins/platforms/cocoa/qcocoasystemsettings.mm b/src/plugins/platforms/cocoa/qcocoasystemsettings.mm
index aacf47ec43..692e504432 100644
--- a/src/plugins/platforms/cocoa/qcocoasystemsettings.mm
+++ b/src/plugins/platforms/cocoa/qcocoasystemsettings.mm
@@ -96,6 +96,8 @@ QColor qt_mac_colorForThemeTextColor(ThemeTextColor themeColor)
case kThemeTextColorTabFrontInactive:
case kThemeTextColorBevelButtonInactive:
return QColor(127, 127, 127, 255);
+ case kThemeTextColorMenuItemSelected:
+ return Qt::white;
default:
return QColor(0, 0, 0, 255); // ### TODO: Sample color like Qt 4.
}
@@ -153,21 +155,19 @@ struct QMacPaletteMap {
};
static QMacPaletteMap mac_widget_colors[] = {
-// TODO (msorvig): Fix/match palette behavior with Qt 4 and enable.
-//
-// QMacPaletteMap(QPlatformTheme::ToolButtonPalette, kThemeTextColorBevelButtonActive, kThemeTextColorBevelButtonInactive),
-// QMacPaletteMap(QPlatformTheme::ButtonPalette, kThemeTextColorPushButtonActive, kThemeTextColorPushButtonInactive),
-// QMacPaletteMap(QPlatformTheme::HeaderPalette, kThemeTextColorPushButtonActive, kThemeTextColorPushButtonInactive),
-// QMacPaletteMap(QPlatformTheme::ComboBoxPalette, kThemeTextColorPopupButtonActive, kThemeTextColorPopupButtonInactive),
-// QMacPaletteMap(QPlatformTheme::ItemViewPalette, kThemeTextColorListView, kThemeTextColorDialogInactive),
-// QMacPaletteMap(QPlatformTheme::MessageBoxLabelPelette, kThemeTextColorAlertActive, kThemeTextColorAlertInactive),
-// QMacPaletteMap(QPlatformTheme::TabBarPalette, kThemeTextColorTabFrontActive, kThemeTextColorTabFrontInactive),
-// QMacPaletteMap(QPlatformTheme::LabelPalette, kThemeTextColorPlacardActive, kThemeTextColorPlacardInactive),
-// QMacPaletteMap(QPlatformTheme::GroupBoxPalette, kThemeTextColorPlacardActive, kThemeTextColorPlacardInactive),
-// QMacPaletteMap(QPlatformTheme::MenuPalette, kThemeTextColorPopupLabelActive, kThemeTextColorPopupLabelInactive),
-// ### TODO: The zeros below gives white-on-black text.
-// QMacPaletteMap(QPlatformTheme::TextEditPalette, 0, 0),
-// QMacPaletteMap(QPlatformTheme::TextLineEditPalette, 0, 0),
+ QMacPaletteMap(QPlatformTheme::ToolButtonPalette, kThemeTextColorBevelButtonActive, kThemeTextColorBevelButtonInactive),
+ QMacPaletteMap(QPlatformTheme::ButtonPalette, kThemeTextColorPushButtonActive, kThemeTextColorPushButtonInactive),
+ QMacPaletteMap(QPlatformTheme::HeaderPalette, kThemeTextColorPushButtonActive, kThemeTextColorPushButtonInactive),
+ QMacPaletteMap(QPlatformTheme::ComboBoxPalette, kThemeTextColorPopupButtonActive, kThemeTextColorPopupButtonInactive),
+ QMacPaletteMap(QPlatformTheme::ItemViewPalette, kThemeTextColorListView, kThemeTextColorDialogInactive),
+ QMacPaletteMap(QPlatformTheme::MessageBoxLabelPelette, kThemeTextColorAlertActive, kThemeTextColorAlertInactive),
+ QMacPaletteMap(QPlatformTheme::TabBarPalette, kThemeTextColorTabFrontActive, kThemeTextColorTabFrontInactive),
+ QMacPaletteMap(QPlatformTheme::LabelPalette, kThemeTextColorPlacardActive, kThemeTextColorPlacardInactive),
+ QMacPaletteMap(QPlatformTheme::GroupBoxPalette, kThemeTextColorPlacardActive, kThemeTextColorPlacardInactive),
+ QMacPaletteMap(QPlatformTheme::MenuPalette, kThemeTextColorPopupLabelActive, kThemeTextColorPopupLabelInactive),
+ //### TODO: The zeros below gives white-on-black text.
+ QMacPaletteMap(QPlatformTheme::TextEditPalette, 0, 0),
+ QMacPaletteMap(QPlatformTheme::TextLineEditPalette, 0, 0),
QMacPaletteMap(QPlatformTheme::NPalettes, 0, 0) };
QHash<QPlatformTheme::Palette, QPalette*> qt_mac_createRolePalettes()
@@ -175,7 +175,7 @@ QHash<QPlatformTheme::Palette, QPalette*> qt_mac_createRolePalettes()
QHash<QPlatformTheme::Palette, QPalette*> palettes;
QColor qc;
for (int i = 0; mac_widget_colors[i].paletteRole != QPlatformTheme::NPalettes; i++) {
- QPalette pal;
+ QPalette pal = *qt_mac_createSystemPalette();
if (mac_widget_colors[i].active != 0) {
qc = qt_mac_colorForThemeTextColor(mac_widget_colors[i].active);
pal.setColor(QPalette::Active, QPalette::Text, qc);
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm
index f786e6969f..b545844a24 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.mm
+++ b/src/plugins/platforms/cocoa/qcocoawindow.mm
@@ -49,6 +49,7 @@
#include <QtCore/qfileinfo.h>
#include <QtCore/private/qcore_mac_p.h>
#include <qwindow.h>
+#include <private/qwindow_p.h>
#include <qpa/qwindowsysteminterface.h>
#include <qpa/qplatformscreen.h>
@@ -372,9 +373,9 @@ NSUInteger QCocoaWindow::windowStyleMask(Qt::WindowFlags flags)
if (flags == Qt::Window) {
styleMask = (NSResizableWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | NSTitledWindowMask);
} else if ((flags & Qt::Dialog) && (window()->modality() != Qt::NonModal)) {
- styleMask = NSTitledWindowMask;
+ styleMask = NSResizableWindowMask | NSTitledWindowMask;
} else if (!(flags & Qt::FramelessWindowHint)) {
- if (flags & Qt::WindowMaximizeButtonHint)
+ if ((flags & Qt::Dialog) || (flags & Qt::WindowMaximizeButtonHint))
styleMask |= NSResizableWindowMask;
if (flags & Qt::WindowTitleHint)
styleMask |= NSTitledWindowMask;
@@ -590,9 +591,7 @@ void QCocoaWindow::windowDidResize()
if (!m_nsWindow)
return;
- NSRect rect = [[m_nsWindow contentView]frame];
- // Call setFrameSize which will trigger a frameDidChangeNotification on QNSView.
- [[m_nsWindow contentView] setFrameSize:rect.size];
+ [m_contentView updateGeometry];
}
void QCocoaWindow::windowWillClose()
@@ -651,6 +650,10 @@ void QCocoaWindow::recreateWindow(const QPlatformWindow *parentWindow)
NSRect frame = NSMakeRect(rect.x(), rect.y(), rect.width(), rect.height());
[m_contentView setFrame:frame];
}
+
+ const qreal opacity = qt_window_private(window())->opacity;
+ if (!qFuzzyCompare(opacity, qreal(1.0)))
+ setOpacity(opacity);
}
NSWindow * QCocoaWindow::createNSWindow()
diff --git a/src/plugins/platforms/cocoa/qnsview.h b/src/plugins/platforms/cocoa/qnsview.h
index f93fd86205..9cdfe6f5bb 100644
--- a/src/plugins/platforms/cocoa/qnsview.h
+++ b/src/plugins/platforms/cocoa/qnsview.h
@@ -66,6 +66,7 @@ QT_END_NAMESPACE
QString m_composingText;
bool m_sendKeyEvent;
QStringList *currentCustomDragTypes;
+ bool m_sendUpAsRightButton;
Qt::KeyboardModifiers currentWheelModifiers;
bool m_subscribesForGlobalFrameNotifications;
}
diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm
index b608989e43..678f88baa0 100644
--- a/src/plugins/platforms/cocoa/qnsview.mm
+++ b/src/plugins/platforms/cocoa/qnsview.mm
@@ -84,6 +84,7 @@ static QTouchDevice *touchDevice = 0;
m_sendKeyEvent = false;
m_subscribesForGlobalFrameNotifications = false;
currentCustomDragTypes = 0;
+ m_sendUpAsRightButton = false;
if (!touchDevice) {
touchDevice = new QTouchDevice;
@@ -184,6 +185,9 @@ static QTouchDevice *touchDevice = 0;
geometry = qt_mac_toQRect([self frame]);
}
+ if (m_platformWindow->m_nsWindow && geometry == m_platformWindow->geometry())
+ return;
+
#ifdef QT_COCOA_ENABLE_WINDOW_DEBUG
qDebug() << "QNSView::udpateGeometry" << m_platformWindow << geometry;
#endif
@@ -312,6 +316,7 @@ static QTouchDevice *touchDevice = 0;
);
CGImageRef bsCGImage = m_backingStore->getBackingStoreCGImage();
CGImageRef cleanImg = CGImageCreateWithImageInRect(bsCGImage, backingStoreRect);
+ CGContextSetBlendMode(cgContext, kCGBlendModeCopy);
CGContextDrawImage(cgContext, dirtyWindowRect, cleanImg);
// Clean-up:
@@ -427,6 +432,7 @@ static QTouchDevice *touchDevice = 0;
- (void)mouseDown:(NSEvent *)theEvent
{
+ m_sendUpAsRightButton = false;
if (m_platformWindow->m_activePopupWindow) {
QWindowSystemInterface::handleCloseEvent(m_platformWindow->m_activePopupWindow);
QWindowSystemInterface::flushWindowSystemEvents();
@@ -438,7 +444,12 @@ static QTouchDevice *touchDevice = 0;
[inputManager handleMouseEvent:theEvent];
}
} else {
- m_buttons |= Qt::LeftButton;
+ if ([self convertKeyModifiers:[theEvent modifierFlags]] & Qt::MetaModifier) {
+ m_buttons |= Qt::RightButton;
+ m_sendUpAsRightButton = true;
+ } else {
+ m_buttons |= Qt::LeftButton;
+ }
[self handleMouseEvent:theEvent];
}
}
@@ -452,7 +463,12 @@ static QTouchDevice *touchDevice = 0;
- (void)mouseUp:(NSEvent *)theEvent
{
- m_buttons &= QFlag(~int(Qt::LeftButton));
+ if (m_sendUpAsRightButton) {
+ m_buttons &= QFlag(~int(Qt::RightButton));
+ m_sendUpAsRightButton = false;
+ } else {
+ m_buttons &= QFlag(~int(Qt::LeftButton));
+ }
[self handleMouseEvent:theEvent];
}
@@ -740,9 +756,19 @@ static QTouchDevice *touchDevice = 0;
- (void)handleKeyEvent:(NSEvent *)nsevent eventType:(int)eventType
{
ulong timestamp = [nsevent timestamp] * 1000;
- Qt::KeyboardModifiers modifiers = [self convertKeyModifiers:[nsevent modifierFlags]];
+ ulong nativeModifiers = [nsevent modifierFlags];
+ Qt::KeyboardModifiers modifiers = [self convertKeyModifiers: nativeModifiers];
NSString *charactersIgnoringModifiers = [nsevent charactersIgnoringModifiers];
+ // [from Qt 4 impl] There is no way to get the scan code from carbon. But we cannot
+ // use the value 0, since it indicates that the event originates from somewhere
+ // else than the keyboard.
+ quint32 nativeScanCode = 1;
+
+ UInt32 nativeVirtualKey = 0;
+ EventRef eventRef = EventRef([nsevent eventRef]);
+ GetEventParameter(eventRef, kEventParamKeyCode, typeUInt32, 0, sizeof(nativeVirtualKey), 0, &nativeVirtualKey);
+
QChar ch;
int keyCode;
if ([charactersIgnoringModifiers length] > 0) {
@@ -783,7 +809,8 @@ static QTouchDevice *touchDevice = 0;
}
if (m_sendKeyEvent && m_composingText.isEmpty())
- QWindowSystemInterface::handleKeyEvent(m_window, timestamp, QEvent::Type(eventType), keyCode, modifiers, text);
+ QWindowSystemInterface::handleExtendedKeyEvent(m_window, timestamp, QEvent::Type(eventType), keyCode, modifiers,
+ nativeScanCode, nativeVirtualKey, nativeModifiers, text);
m_sendKeyEvent = false;
}
diff --git a/src/plugins/platforms/cocoa/qnsviewaccessibility.mm b/src/plugins/platforms/cocoa/qnsviewaccessibility.mm
index 6824f19489..da714d3326 100644
--- a/src/plugins/platforms/cocoa/qnsviewaccessibility.mm
+++ b/src/plugins/platforms/cocoa/qnsviewaccessibility.mm
@@ -80,7 +80,7 @@
[kids addObject:[QCocoaAccessibleElement elementWithInterface: m_accessibleRoot->child(i) parent:self ]];
}
- return NSAccessibilityUnignoredChildren(kids);
+ return kids;
} else {
return [super accessibilityAttributeValue:attribute];
}
diff --git a/src/plugins/platforms/directfb/directfb.pro b/src/plugins/platforms/directfb/directfb.pro
index 29c5ebd99b..ec4a612b52 100644
--- a/src/plugins/platforms/directfb/directfb.pro
+++ b/src/plugins/platforms/directfb/directfb.pro
@@ -1,6 +1,7 @@
TARGET = qdirectfb
PLUGIN_TYPE = platforms
+PLUGIN_CLASS_NAME = QDirectFbIntegrationPlugin
load(qt_plugin)
QT += core-private gui-private platformsupport-private
diff --git a/src/plugins/platforms/directfb/qdirectfbblitter.cpp b/src/plugins/platforms/directfb/qdirectfbblitter.cpp
index cac250fb9d..ec6ecd540c 100644
--- a/src/plugins/platforms/directfb/qdirectfbblitter.cpp
+++ b/src/plugins/platforms/directfb/qdirectfbblitter.cpp
@@ -133,7 +133,7 @@ void QDirectFbBlitter::alphaFillRect(const QRectF &rect, const QColor &color, QP
int x, y, w, h;
DFBResult result;
- // check paramters
+ // check parameters
rect.toRect().getRect(&x, &y ,&w, &h);
if ((w <= 0) || (h <= 0)) return;
diff --git a/src/plugins/platforms/directfb/qdirectfbcursor.cpp b/src/plugins/platforms/directfb/qdirectfbcursor.cpp
index 1ff71f3e63..b04848ec40 100644
--- a/src/plugins/platforms/directfb/qdirectfbcursor.cpp
+++ b/src/plugins/platforms/directfb/qdirectfbcursor.cpp
@@ -47,9 +47,12 @@ QT_BEGIN_NAMESPACE
QDirectFBCursor::QDirectFBCursor(QPlatformScreen *screen)
: m_screen(screen)
{
+#ifndef QT_NO_CURSOR
m_image.reset(new QPlatformCursorImage(0, 0, 0, 0, 0, 0));
+#endif
}
+#ifndef QT_NO_CURSOR
void QDirectFBCursor::changeCursor(QCursor *cursor, QWindow *)
{
int xSpot;
@@ -82,5 +85,6 @@ void QDirectFBCursor::changeCursor(QCursor *cursor, QWindow *)
layer->SetCursorShape(layer, surface, xSpot, ySpot);
layer->SetCooperativeLevel(layer, DLSCL_SHARED);
}
+#endif
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/directfb/qdirectfbcursor.h b/src/plugins/platforms/directfb/qdirectfbcursor.h
index bd11b97467..21f205a5a1 100644
--- a/src/plugins/platforms/directfb/qdirectfbcursor.h
+++ b/src/plugins/platforms/directfb/qdirectfbcursor.h
@@ -56,10 +56,14 @@ class QDirectFBCursor : public QPlatformCursor
{
public:
QDirectFBCursor(QPlatformScreen *screen);
+#ifndef QT_NO_CURSOR
void changeCursor(QCursor *cursor, QWindow *window);
+#endif
private:
+#ifndef QT_NO_CURSOR
QScopedPointer<QPlatformCursorImage> m_image;
+#endif
QPlatformScreen *m_screen;
};
diff --git a/src/plugins/platforms/eglfs/eglfs.pro b/src/plugins/platforms/eglfs/eglfs.pro
index 1223b6b133..45059a9cb9 100644
--- a/src/plugins/platforms/eglfs/eglfs.pro
+++ b/src/plugins/platforms/eglfs/eglfs.pro
@@ -1,6 +1,7 @@
TARGET = qeglfs
PLUGIN_TYPE = platforms
+PLUGIN_CLASS_NAME = QEglFSIntegrationPlugin
load(qt_plugin)
QT += core-private gui-private platformsupport-private
diff --git a/src/plugins/platforms/eglfs/qeglfscursor.cpp b/src/plugins/platforms/eglfs/qeglfscursor.cpp
index 85bc8679f2..b29849226f 100644
--- a/src/plugins/platforms/eglfs/qeglfscursor.cpp
+++ b/src/plugins/platforms/eglfs/qeglfscursor.cpp
@@ -55,8 +55,10 @@ QEglFSCursor::QEglFSCursor(QEglFSScreen *screen)
initCursorAtlas();
// initialize the cursor
+#ifndef QT_NO_CURSOR
QCursor cursor(Qt::ArrowCursor);
setCurrentCursor(&cursor);
+#endif
}
QEglFSCursor::~QEglFSCursor()
@@ -183,6 +185,7 @@ void QEglFSCursor::initCursorAtlas()
m_cursorAtlas.image = image;
}
+#ifndef QT_NO_CURSOR
void QEglFSCursor::changeCursor(QCursor *cursor, QWindow *window)
{
Q_UNUSED(window);
@@ -221,6 +224,7 @@ bool QEglFSCursor::setCurrentCursor(QCursor *cursor)
return true;
}
+#endif
void QEglFSCursor::update(const QRegion &rgn)
{
diff --git a/src/plugins/platforms/eglfs/qeglfscursor.h b/src/plugins/platforms/eglfs/qeglfscursor.h
index 9a91b73894..1c82abdb44 100644
--- a/src/plugins/platforms/eglfs/qeglfscursor.h
+++ b/src/plugins/platforms/eglfs/qeglfscursor.h
@@ -57,7 +57,9 @@ public:
QEglFSCursor(QEglFSScreen *screen);
~QEglFSCursor();
+#ifndef QT_NO_CURSOR
void changeCursor(QCursor *cursor, QWindow *widget) Q_DECL_OVERRIDE;
+#endif
void pointerEvent(const QMouseEvent &event) Q_DECL_OVERRIDE;
QPoint pos() const Q_DECL_OVERRIDE;
@@ -68,7 +70,9 @@ public:
virtual void paintOnScreen();
protected:
+#ifndef QT_NO_CURSOR
bool setCurrentCursor(QCursor *cursor);
+#endif
void draw(const QRectF &rect);
void update(const QRegion &region);
diff --git a/src/plugins/platforms/eglfs/qeglfshooks_stub.cpp b/src/plugins/platforms/eglfs/qeglfshooks_stub.cpp
index f60b9ee83d..7106b99490 100644
--- a/src/plugins/platforms/eglfs/qeglfshooks_stub.cpp
+++ b/src/plugins/platforms/eglfs/qeglfshooks_stub.cpp
@@ -50,6 +50,7 @@ QT_BEGIN_NAMESPACE
void QEglFSHooks::platformInit()
{
+ Q_UNUSED(hooks);
}
void QEglFSHooks::platformDestroy()
diff --git a/src/plugins/platforms/eglfs/qeglfswindow.cpp b/src/plugins/platforms/eglfs/qeglfswindow.cpp
index 32d20e6aaa..df665cea84 100644
--- a/src/plugins/platforms/eglfs/qeglfswindow.cpp
+++ b/src/plugins/platforms/eglfs/qeglfswindow.cpp
@@ -75,7 +75,7 @@ void QEglFSWindow::create()
if (m_window)
return;
- if (window()->windowType() == Qt::Desktop) {
+ if (window()->type() == Qt::Desktop) {
QRect rect(QPoint(), hooks->screenSize());
QPlatformWindow::setGeometry(rect);
QWindowSystemInterface::handleGeometryChange(window(), rect);
diff --git a/src/plugins/platforms/kms/kms.pro b/src/plugins/platforms/kms/kms.pro
index 57191d8d97..c0300e0960 100644
--- a/src/plugins/platforms/kms/kms.pro
+++ b/src/plugins/platforms/kms/kms.pro
@@ -1,6 +1,7 @@
TARGET = qkms
PLUGIN_TYPE = platforms
+PLUGIN_CLASS_NAME = QKmsIntegrationPlugin
load(qt_plugin)
QT += core-private gui-private platformsupport-private opengl-private
diff --git a/src/plugins/platforms/linuxfb/linuxfb.pro b/src/plugins/platforms/linuxfb/linuxfb.pro
index 2482a64469..9e9f9b29b7 100644
--- a/src/plugins/platforms/linuxfb/linuxfb.pro
+++ b/src/plugins/platforms/linuxfb/linuxfb.pro
@@ -1,6 +1,7 @@
TARGET = qlinuxfb
PLUGIN_TYPE = platforms
+PLUGIN_CLASS_NAME = QLinuxFbIntegrationPlugin
load(qt_plugin)
QT += core-private gui-private platformsupport-private
diff --git a/src/plugins/platforms/minimal/minimal.pro b/src/plugins/platforms/minimal/minimal.pro
index 9c3d37269c..3131b16232 100644
--- a/src/plugins/platforms/minimal/minimal.pro
+++ b/src/plugins/platforms/minimal/minimal.pro
@@ -1,6 +1,7 @@
TARGET = qminimal
PLUGIN_TYPE = platforms
+PLUGIN_CLASS_NAME = QMinimalIntegrationPlugin
load(qt_plugin)
QT += core-private gui-private platformsupport-private
diff --git a/src/plugins/platforms/minimalegl/minimalegl.pro b/src/plugins/platforms/minimalegl/minimalegl.pro
index 23a6ad9708..00c83eb1ca 100644
--- a/src/plugins/platforms/minimalegl/minimalegl.pro
+++ b/src/plugins/platforms/minimalegl/minimalegl.pro
@@ -1,6 +1,7 @@
TARGET = qminimalegl
PLUGIN_TYPE = platforms
+PLUGIN_CLASS_NAME = QMinimalEglIntegrationPlugin
load(qt_plugin)
QT += core-private gui-private platformsupport-private
diff --git a/src/plugins/platforms/openwfd/openwf.pro b/src/plugins/platforms/openwfd/openwf.pro
index 1b177cba04..2dbcb282db 100644
--- a/src/plugins/platforms/openwfd/openwf.pro
+++ b/src/plugins/platforms/openwfd/openwf.pro
@@ -1,6 +1,7 @@
TARGET = qopenwf
PLUGIN_TYPE = platforms
+PLUGIN_CLASS_NAME = QOpenWFDIntegrationPlugin
load(qt_plugin)
QT += core-private gui-private platformsupport-private
diff --git a/src/plugins/platforms/qnx/qnx.pro b/src/plugins/platforms/qnx/qnx.pro
index fa5f69769c..203cdebda9 100644
--- a/src/plugins/platforms/qnx/qnx.pro
+++ b/src/plugins/platforms/qnx/qnx.pro
@@ -1,4 +1,4 @@
-TARGET = qnx
+TARGET = qqnx
QT += platformsupport platformsupport-private
@@ -140,4 +140,5 @@ include (../../../platformsupport/eglconvenience/eglconvenience.pri)
include (../../../platformsupport/fontdatabases/fontdatabases.pri)
PLUGIN_TYPE = platforms
+PLUGIN_CLASS_NAME = QQnxIntegrationPlugin
load(qt_plugin)
diff --git a/src/plugins/platforms/qnx/qqnxfiledialoghelper.cpp b/src/plugins/platforms/qnx/qqnxfiledialoghelper.cpp
index 262bdb16f4..79d7c7d9ca 100644
--- a/src/plugins/platforms/qnx/qqnxfiledialoghelper.cpp
+++ b/src/plugins/platforms/qnx/qqnxfiledialoghelper.cpp
@@ -43,6 +43,7 @@
#include "qqnxbpseventfilter.h"
#include "qqnxscreen.h"
+#include "qqnxintegration.h"
#include <QDebug>
#include <QEventLoop>
@@ -58,9 +59,9 @@
QT_BEGIN_NAMESPACE
-QQnxFileDialogHelper::QQnxFileDialogHelper(QQnxBpsEventFilter *eventFilter)
+QQnxFileDialogHelper::QQnxFileDialogHelper(const QQnxIntegration *integration)
: QPlatformFileDialogHelper(),
- m_eventFilter(eventFilter),
+ m_integration(integration),
m_dialog(0),
m_acceptMode(QFileDialogOptions::AcceptOpen),
m_selectedFilter(),
@@ -144,8 +145,9 @@ bool QQnxFileDialogHelper::show(Qt::WindowFlags flags, Qt::WindowModality modali
Q_UNUSED(flags);
qFileDialogHelperDebug() << Q_FUNC_INFO;
+ QQnxBpsEventFilter *eventFilter = m_integration->bpsEventFilter();
// We *really* need the bps event filter ;)
- if (!m_eventFilter)
+ if (!eventFilter)
return false;
// Native dialogs can only handle application modal use cases so far
@@ -208,12 +210,15 @@ bool QQnxFileDialogHelper::show(Qt::WindowFlags flags, Qt::WindowModality modali
m_acceptMode = opts->acceptMode();
// Set the libscreen window group and common properties
- QQnxScreen *nativeScreen = static_cast<QQnxScreen *>(parent->screen()->handle());
+
+ QQnxScreen *nativeScreen = parent ? static_cast<QQnxScreen *>(parent->screen()->handle()) :
+ m_integration->primaryDisplay();
+ Q_ASSERT(nativeScreen);
dialog_set_group_id(m_dialog, nativeScreen->windowGroupName());
dialog_set_title_text(m_dialog, opts->windowTitle().toLocal8Bit().constData());
// Register ourselves for dialog domain events from bps
- m_eventFilter->registerForDialogEvents(this);
+ eventFilter->registerForDialogEvents(this);
// Show the dialog
dialog_show(m_dialog);
diff --git a/src/plugins/platforms/qnx/qqnxfiledialoghelper.h b/src/plugins/platforms/qnx/qqnxfiledialoghelper.h
index 352709c763..e17ea80501 100644
--- a/src/plugins/platforms/qnx/qqnxfiledialoghelper.h
+++ b/src/plugins/platforms/qnx/qqnxfiledialoghelper.h
@@ -48,13 +48,13 @@
QT_BEGIN_NAMESPACE
-class QQnxBpsEventFilter;
+class QQnxIntegration;
class QQnxFileDialogHelper : public QPlatformFileDialogHelper
{
Q_OBJECT
public:
- explicit QQnxFileDialogHelper(QQnxBpsEventFilter *eventFilter);
+ explicit QQnxFileDialogHelper(const QQnxIntegration *);
~QQnxFileDialogHelper();
bool handleEvent(bps_event_t *event);
@@ -81,7 +81,7 @@ Q_SIGNALS:
private:
void setNameFilter(const QString &filter);
- QQnxBpsEventFilter *m_eventFilter;
+ const QQnxIntegration *m_integration;
dialog_instance_t m_dialog;
QFileDialogOptions::AcceptMode m_acceptMode;
QString m_selectedFilter;
diff --git a/src/plugins/platforms/qnx/qqnxintegration.cpp b/src/plugins/platforms/qnx/qqnxintegration.cpp
index e594ea952d..bff4dbdc2a 100644
--- a/src/plugins/platforms/qnx/qqnxintegration.cpp
+++ b/src/plugins/platforms/qnx/qqnxintegration.cpp
@@ -406,7 +406,7 @@ QPlatformTheme *QQnxIntegration::createPlatformTheme(const QString &name) const
{
qIntegrationDebug() << Q_FUNC_INFO << "name =" << name;
if (name == QQnxTheme::name())
- return new QQnxTheme(m_fontDatabase, m_bpsEventFilter);
+ return new QQnxTheme(this);
return QPlatformIntegration::createPlatformTheme(name);
}
#endif
diff --git a/src/plugins/platforms/qnx/qqnxintegration.h b/src/plugins/platforms/qnx/qqnxintegration.h
index 97a5e631e8..e3eb9e06ba 100644
--- a/src/plugins/platforms/qnx/qqnxintegration.h
+++ b/src/plugins/platforms/qnx/qqnxintegration.h
@@ -128,10 +128,10 @@ public:
void createDisplay(screen_display_t display, bool isPrimary);
void removeDisplay(QQnxScreen *screen);
+ QQnxScreen *primaryDisplay() const;
private:
void createDisplays();
void destroyDisplays();
- QQnxScreen *primaryDisplay() const;
static void addWindow(screen_window_t qnxWindow, QWindow *window);
static void removeWindow(screen_window_t qnxWindow);
diff --git a/src/plugins/platforms/qnx/qqnxscreen.cpp b/src/plugins/platforms/qnx/qqnxscreen.cpp
index 3b57f5d4e5..5450f086e9 100644
--- a/src/plugins/platforms/qnx/qqnxscreen.cpp
+++ b/src/plugins/platforms/qnx/qqnxscreen.cpp
@@ -429,7 +429,7 @@ void QQnxScreen::addWindow(QQnxWindow *window)
// Such a situation would strangely break focus handling due to the
// invisible desktop widget window being layered on top of normal
// windows
- if (window->window()->windowType() == Qt::Desktop)
+ if (window->window()->type() == Qt::Desktop)
m_childWindows.push_front(window);
else
m_childWindows.push_back(window);
diff --git a/src/plugins/platforms/qnx/qqnxtheme.cpp b/src/plugins/platforms/qnx/qqnxtheme.cpp
index be62c3e410..ae9acd845e 100644
--- a/src/plugins/platforms/qnx/qqnxtheme.cpp
+++ b/src/plugins/platforms/qnx/qqnxtheme.cpp
@@ -43,13 +43,11 @@
#include "qqnxfiledialoghelper.h"
#include "qqnxsystemsettings.h"
+#include "qqnxintegration.h"
QT_BEGIN_NAMESPACE
-QQnxTheme::QQnxTheme(QPlatformFontDatabase *fontDatabase,
- QQnxBpsEventFilter *eventFilter)
- : m_fontDatabase(fontDatabase),
- m_eventFilter(eventFilter)
+QQnxTheme::QQnxTheme(const QQnxIntegration *integration) : m_integration(integration)
{
}
@@ -77,7 +75,7 @@ QPlatformDialogHelper *QQnxTheme::createPlatformDialogHelper(DialogType type) co
{
switch (type) {
case QPlatformTheme::FileDialog:
- return new QQnxFileDialogHelper(m_eventFilter);
+ return new QQnxFileDialogHelper(m_integration);
#ifndef QT_NO_COLORDIALOG
case QPlatformTheme::ColorDialog:
#endif
@@ -91,8 +89,10 @@ QPlatformDialogHelper *QQnxTheme::createPlatformDialogHelper(DialogType type) co
const QFont *QQnxTheme::font(Font type) const
{
- if (m_fonts.isEmpty() && m_fontDatabase)
- m_fonts = qt_qnx_createRoleFonts(m_fontDatabase);
+ QPlatformFontDatabase *fontDatabase = m_integration->fontDatabase();
+
+ if (fontDatabase && m_fonts.isEmpty())
+ m_fonts = qt_qnx_createRoleFonts(fontDatabase);
return m_fonts.value(type, 0);
}
diff --git a/src/plugins/platforms/qnx/qqnxtheme.h b/src/plugins/platforms/qnx/qqnxtheme.h
index ea44d1cee2..17b2eab142 100644
--- a/src/plugins/platforms/qnx/qqnxtheme.h
+++ b/src/plugins/platforms/qnx/qqnxtheme.h
@@ -51,14 +51,12 @@
QT_BEGIN_NAMESPACE
-class QQnxBpsEventFilter;
-
-class QPlatformFontDatabase;
+class QQnxIntegration;
class QQnxTheme : public QPlatformTheme
{
public:
- QQnxTheme(QPlatformFontDatabase *fontDatabase, QQnxBpsEventFilter *eventFilter);
+ explicit QQnxTheme(const QQnxIntegration *);
~QQnxTheme();
static QString name() { return QStringLiteral("blackberry"); }
@@ -69,9 +67,8 @@ public:
const QFont *font(Font type = SystemFont) const;
private:
- QPlatformFontDatabase *m_fontDatabase;
- QQnxBpsEventFilter *m_eventFilter;
mutable QHash<QPlatformTheme::Font, QFont*> m_fonts;
+ const QQnxIntegration *m_integration;
};
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/qnx/qqnxvirtualkeyboardbps.cpp b/src/plugins/platforms/qnx/qqnxvirtualkeyboardbps.cpp
index 059dcb574b..3d2f49aa6c 100644
--- a/src/plugins/platforms/qnx/qqnxvirtualkeyboardbps.cpp
+++ b/src/plugins/platforms/qnx/qqnxvirtualkeyboardbps.cpp
@@ -86,6 +86,11 @@ bool QQnxVirtualKeyboardBps::handleEvent(bps_event_t *event)
bool QQnxVirtualKeyboardBps::showKeyboard()
{
qVirtualKeyboardDebug() << Q_FUNC_INFO << "current visibility=" << isVisible();
+
+ // They keyboard's mode is global between applications, we have to set it each time
+ if ( !isVisible() )
+ applyKeyboardMode(keyboardMode());
+
virtualkeyboard_show();
return true;
}
diff --git a/src/plugins/platforms/qnx/qqnxwindow.cpp b/src/plugins/platforms/qnx/qqnxwindow.cpp
index e4505c6c60..af7a89a399 100644
--- a/src/plugins/platforms/qnx/qqnxwindow.cpp
+++ b/src/plugins/platforms/qnx/qqnxwindow.cpp
@@ -269,7 +269,7 @@ void QQnxWindow::setVisible(bool visible)
root->updateVisibility(root->m_visible);
- window()->requestActivateWindow();
+ window()->requestActivate();
if (window()->isTopLevel() && visible)
QWindowSystemInterface::handleExposeEvent(window(), window()->geometry());
@@ -511,8 +511,8 @@ void QQnxWindow::setScreen(QQnxScreen *platformScreen)
Q_FOREACH (QQnxWindow *childWindow, m_childWindows) {
// Only subwindows and tooltips need necessarily be moved to another display with the window.
- if ((window()->windowType() & Qt::WindowType_Mask) == Qt::SubWindow ||
- (window()->windowType() & Qt::WindowType_Mask) == Qt::ToolTip)
+ if ((window()->type() & Qt::WindowType_Mask) == Qt::SubWindow ||
+ (window()->type() & Qt::WindowType_Mask) == Qt::ToolTip)
childWindow->setScreen(platformScreen);
}
diff --git a/src/plugins/platforms/windows/accessible/comutils.cpp b/src/plugins/platforms/windows/accessible/comutils.cpp
index 5e5a1ebd0f..a67e2c4534 100644
--- a/src/plugins/platforms/windows/accessible/comutils.cpp
+++ b/src/plugins/platforms/windows/accessible/comutils.cpp
@@ -88,7 +88,7 @@ inline uint QColorToOLEColor(const QColor &col)
return qRgba(col.blue(), col.green(), col.red(), 0x00);
}
-bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &typeName, bool out)
+bool QVariant2VARIANT(const QVariant &var, VARIANT &arg, const QByteArray &typeName, bool out)
{
QVariant qvar = var;
// "type" is the expected type, so coerce if necessary
@@ -107,12 +107,12 @@ bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &type
}
if (out && arg.vt == (VT_VARIANT|VT_BYREF) && arg.pvarVal) {
- return QVariantToVARIANT(var, *arg.pvarVal, typeName, false);
+ return QVariant2VARIANT(var, *arg.pvarVal, typeName, false);
}
if (out && proptype == QVariant::UserType && typeName == "QVariant") {
VARIANT *pVariant = new VARIANT;
- QVariantToVARIANT(var, *pVariant, QByteArray(), false);
+ QVariant2VARIANT(var, *pVariant, QByteArray(), false);
arg.vt = VT_VARIANT|VT_BYREF;
arg.pvarVal = pVariant;
return true;
@@ -409,7 +409,7 @@ bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &type
for (LONG j = 0; j < columnCount; ++j) {
QVariant elem = columns.at(j);
VariantInit(&variant);
- QVariantToVARIANT(elem, variant, elem.typeName());
+ QVariant2VARIANT(elem, variant, elem.typeName());
rgIndices[1] = j;
SafeArrayPutElement(array, rgIndices, pElement);
clearVARIANT(&variant);
@@ -425,7 +425,7 @@ bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &type
if (listType != QVariant::LastType)
elem.convert(listType);
VariantInit(&variant);
- QVariantToVARIANT(elem, variant, elem.typeName());
+ QVariant2VARIANT(elem, variant, elem.typeName());
SafeArrayPutElement(array, &index, pElement);
clearVARIANT(&variant);
}
@@ -555,7 +555,7 @@ bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &type
arg.pRecInfo = recordInfo,
arg.pvRecord = record;
if (out) {
- qWarning("QVariantToVARIANT: out-parameter not supported for records");
+ qWarning("QVariant2VARIANT: out-parameter not supported for records");
return false;
}
}
@@ -574,7 +574,7 @@ bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &type
if (arg.pdispVal)
arg.pdispVal->AddRef();
if (out) {
- qWarning("QVariantToVARIANT: out-parameter not supported for IDispatch");
+ qWarning("QVariant2VARIANT: out-parameter not supported for IDispatch");
return false;
}
} else if (!qstrcmp(qvar.typeName(), "IDispatch**")) {
@@ -588,7 +588,7 @@ bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &type
if (arg.punkVal)
arg.punkVal->AddRef();
if (out) {
- qWarning("QVariantToVARIANT: out-parameter not supported for IUnknown");
+ qWarning("QVariant2VARIANT: out-parameter not supported for IUnknown");
return false;
}
#ifdef QAX_SERVER
@@ -602,7 +602,7 @@ bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &type
qAxFactory()->createObjectWrapper(static_cast<QObject*>(user), &arg.pdispVal);
}
if (out) {
- qWarning("QVariantToVARIANT: out-parameter not supported for subtype");
+ qWarning("QVariant2VARIANT: out-parameter not supported for subtype");
return false;
}
#else
@@ -612,7 +612,7 @@ bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &type
arg.vt = VT_DISPATCH;
object->queryInterface(IID_IDispatch, (void**)&arg.pdispVal);
if (out) {
- qWarning("QVariantToVARIANT: out-parameter not supported for subtype");
+ qWarning("QVariant2VARIANT: out-parameter not supported for subtype");
return false;
}
#endif
diff --git a/src/plugins/platforms/windows/accessible/comutils.h b/src/plugins/platforms/windows/accessible/comutils.h
index c9ed2b1224..8593f68d76 100644
--- a/src/plugins/platforms/windows/accessible/comutils.h
+++ b/src/plugins/platforms/windows/accessible/comutils.h
@@ -52,7 +52,8 @@ QT_BEGIN_NAMESPACE
class QVariant;
-bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &typeName, bool out);
+// 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 QString BSTRToQString(const BSTR &bstr)
{
diff --git a/src/plugins/platforms/windows/accessible/iaccessible2.cpp b/src/plugins/platforms/windows/accessible/iaccessible2.cpp
index 03bb94db8f..838cd055ab 100644
--- a/src/plugins/platforms/windows/accessible/iaccessible2.cpp
+++ b/src/plugins/platforms/windows/accessible/iaccessible2.cpp
@@ -1425,7 +1425,7 @@ HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_currentValue(VARIANT *curre
return E_FAIL;
if (QAccessibleValueInterface *valueIface = valueInterface()) {
const QVariant var = valueIface->currentValue();
- if (QVariantToVARIANT(var, *currentValue, QByteArray(), false))
+ if (QVariant2VARIANT(var, *currentValue, QByteArray(), false))
return S_OK;
}
@@ -1456,7 +1456,7 @@ HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_maximumValue(VARIANT *maxim
return E_FAIL;
if (QAccessibleValueInterface *valueIface = valueInterface()) {
const QVariant var = valueIface->maximumValue();
- if (QVariantToVARIANT(var, *maximumValue, QByteArray(), false))
+ if (QVariant2VARIANT(var, *maximumValue, QByteArray(), false))
return S_OK;
}
maximumValue->vt = VT_EMPTY;
@@ -1470,7 +1470,7 @@ HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_minimumValue(VARIANT *minim
return E_FAIL;
if (QAccessibleValueInterface *valueIface = valueInterface()) {
const QVariant var = valueIface->minimumValue();
- if (QVariantToVARIANT(var, *minimumValue, QByteArray(), false))
+ if (QVariant2VARIANT(var, *minimumValue, QByteArray(), false))
return S_OK;
}
minimumValue->vt = VT_EMPTY;
diff --git a/src/plugins/platforms/windows/accessible/qwindowsaccessibility.cpp b/src/plugins/platforms/windows/accessible/qwindowsaccessibility.cpp
index 94a5dd6a68..44a79d86ee 100644
--- a/src/plugins/platforms/windows/accessible/qwindowsaccessibility.cpp
+++ b/src/plugins/platforms/windows/accessible/qwindowsaccessibility.cpp
@@ -48,6 +48,7 @@
#include <QtCore/qlocale.h>
#include <QtCore/qmap.h>
#include <QtCore/qpair.h>
+#include <QtCore/qpointer.h>
#include <QtCore/qsettings.h>
#include <QtGui/qaccessible.h>
#include <QtGui/qaccessible2.h>
@@ -87,10 +88,9 @@
// This stuff is used for widgets/items with no window handle:
-typedef QMap<int, QPair<QObject*,int> > NotifyMap;
+typedef QMap<int, QPair<QPointer<QObject>,int> > NotifyMap;
Q_GLOBAL_STATIC(NotifyMap, qAccessibleRecentSentEvents)
-
QT_BEGIN_NAMESPACE
@@ -182,14 +182,25 @@ void QWindowsAccessibility::notifyAccessibilityUpdate(QAccessibleEvent *event)
HWND hWnd = (HWND)platform->nativeResourceForWindow("handle", window);
static int eventNum = 0;
- if (event->type() != QAccessible::MenuCommand) { // MenuCommand is faked
- // See comment "SENDING EVENTS TO OBJECTS WITH NO WINDOW HANDLE"
+ if (event->type() != QAccessible::MenuCommand && // MenuCommand is faked
+ event->type() != QAccessible::ObjectDestroyed) {
+ /* In some rare occasions, the server (Qt) might get a ::get_accChild call with a
+ childId that references an entry in the cache where there was a dangling
+ QObject-pointer. Previously we crashed on this.
+
+ There is no point in actually notifying the AT client that the object got destroyed,
+ because the AT client won't query for get_accChild if the event is ObjectDestroyed
+ anyway, and we have no other way of mapping the eventId argument to the actual
+ child/descendant object. (Firefox seems to simply completely ignore
+ EVENT_OBJECT_DESTROY).
+
+ We therefore guard each QObject in the cache with a QPointer, and only notify the AT
+ client if the type is not ObjectDestroyed.
+ */
eventNum %= 50; //[0..49]
int eventId = - (eventNum - 1);
-
- qAccessibleRecentSentEvents()->insert(eventId, qMakePair(event->object(), event->child()));
- ::NotifyWinEvent(event->type(), hWnd, OBJID_CLIENT, eventId );
-
+ qAccessibleRecentSentEvents()->insert(eventId, qMakePair(QPointer<QObject>(event->object()), event->child()));
+ ::NotifyWinEvent(event->type(), hWnd, OBJID_CLIENT, eventId);
++eventNum;
}
#endif // Q_OS_WINCE
@@ -233,7 +244,8 @@ IAccessible *QWindowsAccessibility::wrap(QAccessibleInterface *acc)
*/
QPair<QObject*, int> QWindowsAccessibility::getCachedObject(int entryId)
{
- return qAccessibleRecentSentEvents()->value(entryId);
+ QPair<QPointer<QObject>, int> pair = qAccessibleRecentSentEvents()->value(entryId);
+ return qMakePair(pair.first.data(), pair.second);
}
/*
diff --git a/src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.cpp b/src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.cpp
index 328053604e..f1bdc77303 100644
--- a/src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.cpp
+++ b/src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.cpp
@@ -757,7 +757,7 @@ HRESULT STDMETHODCALLTYPE QWindowsMsaaAccessible::get_accChild(VARIANT varChildI
acc = res;
}
} else {
- qWarning("get_accChild got a negative varChildID, but did not find it in cache");
+ qWarning("get_accChild got a negative varChildID (%d), but did not find it in cache", childIndex);
}
} else {
if (childIndex) {
diff --git a/src/plugins/platforms/windows/qwindowsfontdatabase.cpp b/src/plugins/platforms/windows/qwindowsfontdatabase.cpp
index 5a1b4f1522..d4a8bd12d3 100644
--- a/src/plugins/platforms/windows/qwindowsfontdatabase.cpp
+++ b/src/plugins/platforms/windows/qwindowsfontdatabase.cpp
@@ -1033,17 +1033,17 @@ static bool addFontToDatabase(QString familyName, const QString &scriptName,
writingSystems.setSupported(ws);
}
- QPlatformFontDatabase::registerFont(familyName, foundryName, weight,
+ QPlatformFontDatabase::registerFont(familyName, QString(), foundryName, weight,
style, stretch, antialias, scalable, size, fixed, writingSystems, 0);
// add fonts windows can generate for us:
if (weight <= QFont::DemiBold)
- QPlatformFontDatabase::registerFont(familyName, foundryName, QFont::Bold,
+ QPlatformFontDatabase::registerFont(familyName, QString(), foundryName, QFont::Bold,
style, stretch, antialias, scalable, size, fixed, writingSystems, 0);
if (style != QFont::StyleItalic)
- QPlatformFontDatabase::registerFont(familyName, foundryName, weight,
+ QPlatformFontDatabase::registerFont(familyName, QString(), foundryName, weight,
QFont::StyleItalic, stretch, antialias, scalable, size, fixed, writingSystems, 0);
if (weight <= QFont::DemiBold && style != QFont::StyleItalic)
- QPlatformFontDatabase::registerFont(familyName, foundryName, QFont::Bold,
+ QPlatformFontDatabase::registerFont(familyName, QString(), foundryName, QFont::Bold,
QFont::StyleItalic, stretch, antialias, scalable, size, fixed, writingSystems, 0);
if (!englishName.isEmpty())
@@ -1298,43 +1298,6 @@ QFontEngine *QWindowsFontDatabase::fontEngine(const QByteArray &fontData, qreal
return fontEngine;
}
-QStringList QWindowsFontDatabase::fallbacksForFamily(const QString &family, QFont::Style style, QFont::StyleHint styleHint, QChar::Script script) const
-{
- QStringList result = QPlatformFontDatabase::fallbacksForFamily(family, style, styleHint, script);
- if (!result.isEmpty())
- return result;
-
- switch (styleHint) {
- case QFont::Times:
- result << QString::fromLatin1("Times New Roman");
- break;
- case QFont::Courier:
- result << QString::fromLatin1("Courier New");
- break;
- case QFont::Monospace:
- result << QString::fromLatin1("Courier New");
- break;
- case QFont::Cursive:
- result << QString::fromLatin1("Comic Sans MS");
- break;
- case QFont::Fantasy:
- result << QString::fromLatin1("Impact");
- break;
- case QFont::Decorative:
- result << QString::fromLatin1("Old English");
- break;
- case QFont::Helvetica:
- case QFont::System:
- default:
- result << QString::fromLatin1("Arial");
- }
-
- if (QWindowsContext::verboseFonts)
- qDebug() << __FUNCTION__ << family << style << styleHint
- << script << result << m_families.size();
- return result;
-}
-
static QList<quint32> getTrueTypeFontOffsets(const uchar *fontData)
{
QList<quint32> offsets;
@@ -1686,6 +1649,82 @@ LOGFONT QWindowsFontDatabase::fontDefToLOGFONT(const QFontDef &request)
return lf;
}
+static QStringList extraTryFontsForFamily(const QString& family)
+{
+ QStringList result;
+ QFontDatabase db;
+ if (!db.writingSystems(family).contains(QFontDatabase::Symbol)) {
+ if (!tryFonts) {
+ LANGID lid = GetUserDefaultLangID();
+ switch (lid&0xff) {
+ case LANG_CHINESE: // Chinese (Taiwan)
+ if ( lid == 0x0804 ) // Taiwan
+ tryFonts = ch_TW_tryFonts;
+ else
+ tryFonts = ch_CN_tryFonts;
+ break;
+ case LANG_JAPANESE:
+ tryFonts = jp_tryFonts;
+ break;
+ case LANG_KOREAN:
+ tryFonts = kr_tryFonts;
+ break;
+ default:
+ tryFonts = other_tryFonts;
+ break;
+ }
+ }
+ QStringList fm = QFontDatabase().families();
+ const char **tf = tryFonts;
+ while (tf && *tf) {
+ if (fm.contains(QLatin1String(*tf)))
+ result << QLatin1String(*tf);
+ ++tf;
+ }
+ }
+ return result;
+}
+
+QStringList QWindowsFontDatabase::fallbacksForFamily(const QString &family, QFont::Style style, QFont::StyleHint styleHint, QChar::Script script) const
+{
+ QStringList result = QPlatformFontDatabase::fallbacksForFamily(family, style, styleHint, script);
+ if (!result.isEmpty())
+ return result;
+
+ switch (styleHint) {
+ case QFont::Times:
+ result << QString::fromLatin1("Times New Roman");
+ break;
+ case QFont::Courier:
+ result << QString::fromLatin1("Courier New");
+ break;
+ case QFont::Monospace:
+ result << QString::fromLatin1("Courier New");
+ break;
+ case QFont::Cursive:
+ result << QString::fromLatin1("Comic Sans MS");
+ break;
+ case QFont::Fantasy:
+ result << QString::fromLatin1("Impact");
+ break;
+ case QFont::Decorative:
+ result << QString::fromLatin1("Old English");
+ break;
+ case QFont::Helvetica:
+ case QFont::System:
+ default:
+ result << QString::fromLatin1("Arial");
+ }
+
+ result.append(extraTryFontsForFamily(family));
+
+ if (QWindowsContext::verboseFonts)
+ qDebug() << __FUNCTION__ << family << style << styleHint
+ << script << result << m_families.size();
+ return result;
+}
+
+
QFontEngine *QWindowsFontDatabase::createEngine(int script, const QFontDef &request,
HDC fontHdc, int dpi, bool rawMode,
const QStringList &family_list,
@@ -1849,42 +1888,16 @@ QFontEngine *QWindowsFontDatabase::createEngine(int script, const QFontDef &requ
#endif
if (script == QChar::Script_Common
- && !(request.styleStrategy & QFont::NoFontMerging)) {
- QFontDatabase db;
- if (!db.writingSystems(request.family).contains(QFontDatabase::Symbol)) {
- if(!tryFonts) {
- LANGID lid = GetUserDefaultLangID();
- switch( lid&0xff ) {
- case LANG_CHINESE: // Chinese (Taiwan)
- if ( lid == 0x0804 ) // Taiwan
- tryFonts = ch_TW_tryFonts;
- else
- tryFonts = ch_CN_tryFonts;
- break;
- case LANG_JAPANESE:
- tryFonts = jp_tryFonts;
- break;
- case LANG_KOREAN:
- tryFonts = kr_tryFonts;
- break;
- default:
- tryFonts = other_tryFonts;
- break;
- }
- }
- QStringList fm = QFontDatabase().families();
- QStringList list = family_list;
- const char **tf = tryFonts;
- while(tf && *tf) {
- if(fm.contains(QLatin1String(*tf)))
- list << QLatin1String(*tf);
- ++tf;
- }
- QFontEngine *mfe = new QWindowsMultiFontEngine(fe, list);
- mfe->setObjectName(QStringLiteral("QWindowsMultiFontEngine_") + request.family);
- mfe->fontDef = fe->fontDef;
- fe = mfe;
- }
+ && !(request.styleStrategy & QFont::NoFontMerging)) {
+ QStringList extraFonts = extraTryFontsForFamily(request.family);
+ if (extraFonts.size()) {
+ QStringList list = family_list;
+ list.append(extraFonts);
+ QFontEngine *mfe = new QWindowsMultiFontEngine(fe, list);
+ mfe->setObjectName(QStringLiteral("QWindowsMultiFontEngine_") + request.family);
+ mfe->fontDef = fe->fontDef;
+ fe = mfe;
+ }
}
return fe;
}
diff --git a/src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp b/src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp
index d30c1f984d..0509a55eaa 100644
--- a/src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp
+++ b/src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp
@@ -279,20 +279,20 @@ static bool addFontToDatabase(QString familyName, const QString &scriptName,
if (!QDir::isAbsolutePath(value))
value.prepend(QString::fromLocal8Bit(qgetenv("windir") + "\\Fonts\\"));
- QPlatformFontDatabase::registerFont(faceName, foundryName, weight, style, stretch,
+ QPlatformFontDatabase::registerFont(faceName, QString(), foundryName, weight, style, stretch,
antialias, scalable, size, fixed, writingSystems, createFontFile(value, index));
// add fonts windows can generate for us:
if (weight <= QFont::DemiBold)
- QPlatformFontDatabase::registerFont(faceName, foundryName, QFont::Bold, style, stretch,
+ QPlatformFontDatabase::registerFont(faceName, QString(), foundryName, QFont::Bold, style, stretch,
antialias, scalable, size, fixed, writingSystems, createFontFile(value, index));
if (style != QFont::StyleItalic)
- QPlatformFontDatabase::registerFont(faceName, foundryName, weight, QFont::StyleItalic, stretch,
+ QPlatformFontDatabase::registerFont(faceName, QString(), foundryName, weight, QFont::StyleItalic, stretch,
antialias, scalable, size, fixed, writingSystems, createFontFile(value, index));
if (weight <= QFont::DemiBold && style != QFont::StyleItalic)
- QPlatformFontDatabase::registerFont(faceName, foundryName, QFont::Bold, QFont::StyleItalic, stretch,
+ QPlatformFontDatabase::registerFont(faceName, QString(), foundryName, QFont::Bold, QFont::StyleItalic, stretch,
antialias, scalable, size, fixed, writingSystems, createFontFile(value, index));
if (!englishName.isEmpty())
diff --git a/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp b/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp
index f7ba0d237d..210405d4ba 100644
--- a/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp
+++ b/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp
@@ -41,6 +41,11 @@
#ifndef QT_NO_DIRECTWRITE
+#if _WIN32_WINNT < 0x0600
+#undef _WIN32_WINNT
+#define _WIN32_WINNT 0x0600
+#endif
+
#include "qwindowsfontenginedirectwrite.h"
#include "qwindowsfontdatabase.h"
#include "qwindowscontext.h"
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp
index 1f6253438f..3831c6b10e 100644
--- a/src/plugins/platforms/windows/qwindowswindow.cpp
+++ b/src/plugins/platforms/windows/qwindowswindow.cpp
@@ -55,6 +55,7 @@
#include <QtGui/QWindow>
#include <QtGui/QRegion>
#include <private/qwindow_p.h>
+#include <private/qguiapplication_p.h>
#include <qpa/qwindowsysteminterface.h>
#include <QtCore/QDebug>
@@ -321,7 +322,6 @@ void WindowCreationData::fromWindow(const QWindow *w, const Qt::WindowFlags flag
topLevel = ((creationFlags & ForceChild) || embedded) ? false : w->isTopLevel();
if (topLevel && flags == 1) {
- qWarning("Remove me: fixing toplevel window flags");
flags |= Qt::WindowTitleHint|Qt::WindowSystemMenuHint|Qt::WindowMinimizeButtonHint
|Qt::WindowMaximizeButtonHint|Qt::WindowCloseButtonHint;
}
@@ -731,6 +731,9 @@ QWindowsWindow::QWindowsWindow(QWindow *aWindow, const WindowData &data) :
if (QWindowsContext::instance()->systemInfo() & QWindowsContext::SI_SupportsTouch)
QWindowsContext::user32dll.registerTouchWindow(m_data.hwnd, 0);
setWindowState(aWindow->windowState());
+ const qreal opacity = qt_window_private(aWindow)->opacity;
+ if (!qFuzzyCompare(opacity, qreal(1.0)))
+ setOpacity(opacity);
}
QWindowsWindow::~QWindowsWindow()
@@ -1185,8 +1188,21 @@ void QWindowsWindow::setWindowTitle(const QString &title)
{
if (QWindowsContext::verboseWindows)
qDebug() << __FUNCTION__ << this << window() <<title;
- if (m_data.hwnd)
- SetWindowText(m_data.hwnd, (const wchar_t*)title.utf16());
+ if (m_data.hwnd) {
+
+ QString fullTitle = title;
+ if (QGuiApplicationPrivate::displayName) {
+ // Append display name, if set.
+ if (!fullTitle.isEmpty())
+ fullTitle += QStringLiteral(" - ");
+ fullTitle += *QGuiApplicationPrivate::displayName;
+ } else if (fullTitle.isEmpty()) {
+ // Don't let the window title be completely empty, use the app name as fallback.
+ fullTitle = QCoreApplication::applicationName();
+ }
+
+ SetWindowText(m_data.hwnd, (const wchar_t*)fullTitle.utf16());
+ }
}
void QWindowsWindow::setWindowFlags(Qt::WindowFlags flags)
diff --git a/src/plugins/platforms/windows/windows.pro b/src/plugins/platforms/windows/windows.pro
index 794bd3aa35..7f73465135 100644
--- a/src/plugins/platforms/windows/windows.pro
+++ b/src/plugins/platforms/windows/windows.pro
@@ -1,14 +1,13 @@
-TARGET = windows
+TARGET = qwindows
PLUGIN_TYPE = platforms
+PLUGIN_CLASS_NAME = QWindowsIntegrationPlugin
load(qt_plugin)
QT *= core-private
QT *= gui-private
QT *= platformsupport-private
-INCLUDEPATH += ../../../3rdparty/harfbuzz/src
-
# Note: OpenGL32 must precede Gdi32 as it overwrites some functions.
LIBS *= -lole32
!wince*:LIBS *= -lgdi32 -luser32 -lwinspool -limm32 -lwinmm -loleaut32
diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp
index 4c4df137a3..1192894693 100644
--- a/src/plugins/platforms/xcb/qxcbconnection.cpp
+++ b/src/plugins/platforms/xcb/qxcbconnection.cpp
@@ -257,6 +257,7 @@ QXcbConnection::QXcbConnection(QXcbNativeInterface *nativeInterface, const char
, has_shape_extension(false)
, has_randr_extension(false)
, has_input_shape(false)
+ , m_buttons(0)
{
#ifdef XCB_USE_XLIB
Display *dpy = XOpenDisplay(m_displayName.constData());
@@ -312,6 +313,7 @@ QXcbConnection::QXcbConnection(QXcbNativeInterface *nativeInterface, const char
initializeAllAtoms();
m_time = XCB_CURRENT_TIME;
+ m_netWmUserTime = XCB_CURRENT_TIME;
initializeXRandr();
updateScreens();
@@ -662,6 +664,73 @@ void QXcbConnection::handleXcbError(xcb_generic_error_t *error)
#endif
}
+static Qt::MouseButtons translateMouseButtons(int s)
+{
+ Qt::MouseButtons ret = 0;
+ if (s & XCB_BUTTON_MASK_1)
+ ret |= Qt::LeftButton;
+ if (s & XCB_BUTTON_MASK_2)
+ ret |= Qt::MidButton;
+ if (s & XCB_BUTTON_MASK_3)
+ ret |= Qt::RightButton;
+ return ret;
+}
+
+static Qt::MouseButton translateMouseButton(xcb_button_t s)
+{
+ switch (s) {
+ case 1: return Qt::LeftButton;
+ case 2: return Qt::MidButton;
+ case 3: return Qt::RightButton;
+ // Button values 4-7 were already handled as Wheel events, and won't occur here.
+ case 8: return Qt::BackButton; // Also known as Qt::ExtraButton1
+ case 9: return Qt::ForwardButton; // Also known as Qt::ExtraButton2
+ case 10: return Qt::ExtraButton3;
+ case 11: return Qt::ExtraButton4;
+ case 12: return Qt::ExtraButton5;
+ case 13: return Qt::ExtraButton6;
+ case 14: return Qt::ExtraButton7;
+ case 15: return Qt::ExtraButton8;
+ case 16: return Qt::ExtraButton9;
+ case 17: return Qt::ExtraButton10;
+ case 18: return Qt::ExtraButton11;
+ case 19: return Qt::ExtraButton12;
+ case 20: return Qt::ExtraButton13;
+ case 21: return Qt::ExtraButton14;
+ case 22: return Qt::ExtraButton15;
+ case 23: return Qt::ExtraButton16;
+ case 24: return Qt::ExtraButton17;
+ case 25: return Qt::ExtraButton18;
+ case 26: return Qt::ExtraButton19;
+ case 27: return Qt::ExtraButton20;
+ case 28: return Qt::ExtraButton21;
+ case 29: return Qt::ExtraButton22;
+ case 30: return Qt::ExtraButton23;
+ case 31: return Qt::ExtraButton24;
+ default: return Qt::NoButton;
+ }
+}
+
+void QXcbConnection::handleButtonPress(xcb_generic_event_t *ev)
+{
+ xcb_button_press_event_t *event = (xcb_button_press_event_t *)ev;
+
+ // the event explicitly contains the state of the three first buttons,
+ // the rest we need to manage ourselves
+ m_buttons = (m_buttons & ~0x7) | translateMouseButtons(event->state);
+ m_buttons |= translateMouseButton(event->detail);
+}
+
+void QXcbConnection::handleButtonRelease(xcb_generic_event_t *ev)
+{
+ xcb_button_release_event_t *event = (xcb_button_release_event_t *)ev;
+
+ // the event explicitly contains the state of the three first buttons,
+ // the rest we need to manage ourselves
+ m_buttons = (m_buttons & ~0x7) | translateMouseButtons(event->state);
+ m_buttons &= ~translateMouseButton(event->detail);
+}
+
void QXcbConnection::handleXcbEvent(xcb_generic_event_t *event)
{
#ifdef Q_XCB_DEBUG
@@ -686,8 +755,10 @@ void QXcbConnection::handleXcbEvent(xcb_generic_event_t *event)
case XCB_EXPOSE:
HANDLE_PLATFORM_WINDOW_EVENT(xcb_expose_event_t, window, handleExposeEvent);
case XCB_BUTTON_PRESS:
+ handleButtonPress(event);
HANDLE_PLATFORM_WINDOW_EVENT(xcb_button_press_event_t, event, handleButtonPressEvent);
case XCB_BUTTON_RELEASE:
+ handleButtonRelease(event);
HANDLE_PLATFORM_WINDOW_EVENT(xcb_button_release_event_t, event, handleButtonReleaseEvent);
case XCB_MOTION_NOTIFY:
HANDLE_PLATFORM_WINDOW_EVENT(xcb_motion_notify_event_t, event, handleMotionNotifyEvent);
diff --git a/src/plugins/platforms/xcb/qxcbconnection.h b/src/plugins/platforms/xcb/qxcbconnection.h
index c67acb3218..464d918adf 100644
--- a/src/plugins/platforms/xcb/qxcbconnection.h
+++ b/src/plugins/platforms/xcb/qxcbconnection.h
@@ -370,6 +370,9 @@ public:
inline xcb_timestamp_t time() const { return m_time; }
inline void setTime(xcb_timestamp_t t) { if (t > m_time) m_time = t; }
+ inline xcb_timestamp_t netWmUserTime() const { return m_netWmUserTime; }
+ inline void setNetWmUserTime(xcb_timestamp_t t) { if (t > m_netWmUserTime) m_netWmUserTime = t; }
+
bool hasGLX() const { return has_glx_extension; }
bool hasXFixes() const { return xfixes_first_event > 0; }
bool hasXShape() const { return has_shape_extension; }
@@ -380,6 +383,8 @@ public:
xcb_timestamp_t getTimestamp();
+ Qt::MouseButtons buttons() const { return m_buttons; }
+
private slots:
void processXcbEvents();
@@ -400,6 +405,8 @@ private:
QXcbScreen* findOrCreateScreen(QList<QXcbScreen *>& newScreens, int screenNumber,
xcb_screen_t* xcbScreen, xcb_randr_get_output_info_reply_t *output = NULL);
void updateScreens();
+ void handleButtonPress(xcb_generic_event_t *event);
+ void handleButtonRelease(xcb_generic_event_t *event);
bool m_xi2Enabled;
int m_xi2Minor;
@@ -448,6 +455,7 @@ private:
xcb_atom_t m_allAtoms[QXcbAtom::NAtoms];
xcb_timestamp_t m_time;
+ xcb_timestamp_t m_netWmUserTime;
QByteArray m_displayName;
@@ -501,6 +509,8 @@ private:
bool has_shape_extension;
bool has_randr_extension;
bool has_input_shape;
+
+ Qt::MouseButtons m_buttons;
};
#define DISPLAY_FROM_XCB(object) ((Display *)(object->connection()->xlib_display()))
diff --git a/src/plugins/platforms/xcb/qxcbcursor.cpp b/src/plugins/platforms/xcb/qxcbcursor.cpp
index c1cfbd02d6..e1dfe3d6c0 100644
--- a/src/plugins/platforms/xcb/qxcbcursor.cpp
+++ b/src/plugins/platforms/xcb/qxcbcursor.cpp
@@ -291,6 +291,7 @@ QXcbCursor::~QXcbCursor()
xcb_close_font(xcb_connection(), cursorFont);
}
+#ifndef QT_NO_CURSOR
void QXcbCursor::changeCursor(QCursor *cursor, QWindow *widget)
{
QXcbWindow *w = 0;
@@ -507,6 +508,7 @@ xcb_cursor_t QXcbCursor::createBitmapCursor(QCursor *cursor)
}
return c;
}
+#endif
void QXcbCursor::queryPointer(QXcbConnection *c, xcb_window_t *rootWin, QPoint *pos, int *keybMask)
{
diff --git a/src/plugins/platforms/xcb/qxcbcursor.h b/src/plugins/platforms/xcb/qxcbcursor.h
index 4c74034988..a4f3bf11ee 100644
--- a/src/plugins/platforms/xcb/qxcbcursor.h
+++ b/src/plugins/platforms/xcb/qxcbcursor.h
@@ -52,20 +52,26 @@ class QXcbCursor : public QXcbObject, public QPlatformCursor
public:
QXcbCursor(QXcbConnection *conn, QXcbScreen *screen);
~QXcbCursor();
+#ifndef QT_NO_CURSOR
void changeCursor(QCursor *cursor, QWindow *widget);
+#endif
QPoint pos() const;
void setPos(const QPoint &pos);
static void queryPointer(QXcbConnection *c, xcb_window_t *rootWin, QPoint *pos, int *keybMask = 0);
private:
+#ifndef QT_NO_CURSOR
xcb_cursor_t createFontCursor(int cshape);
xcb_cursor_t createBitmapCursor(QCursor *cursor);
xcb_cursor_t createNonStandardCursor(int cshape);
+#endif
QXcbScreen *m_screen;
+#ifndef QT_NO_CURSOR
QMap<int, xcb_cursor_t> m_shapeCursorMap;
QMap<qint64, xcb_cursor_t> m_bitmapCursorMap;
+#endif
};
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp
index a44e7fb959..9c360df900 100644
--- a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp
+++ b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp
@@ -71,6 +71,8 @@ public:
insert("screen",QXcbNativeInterface::Screen);
insert("eglcontext",QXcbNativeInterface::EglContext);
insert("glxcontext",QXcbNativeInterface::GLXContext);
+ insert("apptime",QXcbNativeInterface::AppTime);
+ insert("appusertime",QXcbNativeInterface::AppUserTime);
}
};
@@ -109,18 +111,24 @@ void *QXcbNativeInterface::nativeResourceForScreen(const QByteArray &resource, Q
const QXcbResourceMap::const_iterator it = qXcbResourceMap()->constFind(resource.toLower());
if (it == qXcbResourceMap()->constEnd() || !screen->handle())
return 0;
+ void *result = 0;
const QXcbScreen *xcbScreen = static_cast<QXcbScreen *>(screen->handle());
switch (it.value()) {
case Display:
#ifdef XCB_USE_XLIB
- return xcbScreen->connection()->xlib_display();
-#else
- break;
+ result = xcbScreen->connection()->xlib_display();
#endif
+ break;
+ case AppTime:
+ result = appTime(xcbScreen);
+ break;
+ case AppUserTime:
+ result = appUserTime(xcbScreen);
+ break;
default:
break;
}
- return 0;
+ return result;
}
void *QXcbNativeInterface::nativeResourceForWindow(const QByteArray &resourceString, QWindow *window)
@@ -151,6 +159,36 @@ void *QXcbNativeInterface::nativeResourceForWindow(const QByteArray &resourceStr
return result;
}
+QPlatformNativeInterface::NativeResourceForScreenFunction QXcbNativeInterface::nativeResourceFunctionForScreen(const QByteArray &resource)
+{
+ const QByteArray lowerCaseResource = resource.toLower();
+ if (lowerCaseResource == "setapptime")
+ return NativeResourceForScreenFunction(setAppTime);
+ else if (lowerCaseResource == "setappusertime")
+ return NativeResourceForScreenFunction(setAppUserTime);
+ return 0;
+}
+
+void *QXcbNativeInterface::appTime(const QXcbScreen *screen)
+{
+ return reinterpret_cast<void *>(quintptr(screen->connection()->time()));
+}
+
+void *QXcbNativeInterface::appUserTime(const QXcbScreen *screen)
+{
+ return reinterpret_cast<void *>(quintptr(screen->connection()->netWmUserTime()));
+}
+
+void QXcbNativeInterface::setAppTime(QScreen* screen, xcb_timestamp_t time)
+{
+ static_cast<QXcbScreen *>(screen->handle())->connection()->setTime(time);
+}
+
+void QXcbNativeInterface::setAppUserTime(QScreen* screen, xcb_timestamp_t time)
+{
+ static_cast<QXcbScreen *>(screen->handle())->connection()->setNetWmUserTime(time);
+}
+
QPlatformNativeInterface::NativeResourceForContextFunction QXcbNativeInterface::nativeResourceFunctionForContext(const QByteArray &resource)
{
QByteArray lowerCaseResource = resource.toLower();
diff --git a/src/plugins/platforms/xcb/qxcbnativeinterface.h b/src/plugins/platforms/xcb/qxcbnativeinterface.h
index a7e0a207cb..e2e03fce8f 100644
--- a/src/plugins/platforms/xcb/qxcbnativeinterface.h
+++ b/src/plugins/platforms/xcb/qxcbnativeinterface.h
@@ -43,11 +43,13 @@
#define QXCBNATIVEINTERFACE_H
#include <qpa/qplatformnativeinterface.h>
+#include <xcb/xcb.h>
QT_BEGIN_NAMESPACE
class QWidget;
class QXcbScreen;
+class QXcbConnection;
class QXcbNativeInterface : public QPlatformNativeInterface
{
@@ -59,7 +61,9 @@ public:
Screen,
GraphicsDevice,
EglContext,
- GLXContext
+ GLXContext,
+ AppTime,
+ AppUserTime
};
QXcbNativeInterface();
@@ -69,6 +73,7 @@ public:
void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window);
NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource);
+ NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource) Q_DECL_OVERRIDE;
inline const QByteArray &genericEventFilterType() const { return m_genericEventFilterType; }
@@ -77,6 +82,10 @@ public:
void *connectionForWindow(QWindow *window);
void *screenForWindow(QWindow *window);
void *graphicsDeviceForWindow(QWindow *window);
+ void *appTime(const QXcbScreen *screen);
+ void *appUserTime(const QXcbScreen *screen);
+ static void setAppTime(QScreen *screen, xcb_timestamp_t time);
+ static void setAppUserTime(QScreen *screen, xcb_timestamp_t time);
static void *eglContextForContext(QOpenGLContext *context);
static void *glxContextForContext(QOpenGLContext *context);
diff --git a/src/plugins/platforms/xcb/qxcbscreen.cpp b/src/plugins/platforms/xcb/qxcbscreen.cpp
index 6452186bbf..fc80662c46 100644
--- a/src/plugins/platforms/xcb/qxcbscreen.cpp
+++ b/src/plugins/platforms/xcb/qxcbscreen.cpp
@@ -50,6 +50,7 @@
#include <QDebug>
#include <qpa/qwindowsysteminterface.h>
+#include <private/qmath_p.h>
QT_BEGIN_NAMESPACE
@@ -65,6 +66,7 @@ QXcbScreen::QXcbScreen(QXcbConnection *connection, xcb_screen_t *scr,
, m_orientation(Qt::PrimaryOrientation)
, m_number(number)
, m_refreshRate(60)
+ , m_forcedDpi(-1)
{
if (connection->hasXRandr())
xcb_randr_select_input(xcb_connection(), screen()->root, true);
@@ -81,6 +83,9 @@ QXcbScreen::QXcbScreen(QXcbConnection *connection, xcb_screen_t *scr,
if (m_availableGeometry.isEmpty())
m_availableGeometry = QRect(QPoint(), m_virtualSize);
+ readXResources();
+
+
#ifdef Q_XCB_DEBUG
qDebug();
qDebug("Screen output %s of xcb screen %d:", m_outputName.toUtf8().constData(), m_number);
@@ -242,8 +247,11 @@ QImage::Format QXcbScreen::format() const
QDpi QXcbScreen::logicalDpi() const
{
- return QDpi(25.4 * m_virtualSize.width() / m_virtualSizeMillimeters.width(),
- 25.4 * m_virtualSize.height() / m_virtualSizeMillimeters.height());
+ if (m_forcedDpi > 0)
+ return QDpi(m_forcedDpi, m_forcedDpi);
+
+ return QDpi(Q_MM_PER_INCH * m_virtualSize.width() / m_virtualSizeMillimeters.width(),
+ Q_MM_PER_INCH * m_virtualSize.height() / m_virtualSizeMillimeters.height());
}
QPlatformCursor *QXcbScreen::cursor() const
@@ -315,6 +323,9 @@ void QXcbScreen::handleScreenChange(xcb_randr_screen_change_notify_event_t *chan
QWindowSystemInterface::handleScreenGeometryChange(QPlatformScreen::screen(), geometry());
QWindowSystemInterface::handleScreenAvailableGeometryChange(QPlatformScreen::screen(), availableGeometry());
QWindowSystemInterface::handleScreenOrientationChange(QPlatformScreen::screen(), m_orientation);
+ QWindowSystemInterface::handleScreenLogicalDotsPerInchChange(QPlatformScreen::screen(),
+ Q_MM_PER_INCH * m_virtualSize.width() / m_virtualSizeMillimeters.width(),
+ Q_MM_PER_INCH * m_virtualSize.height() / m_virtualSizeMillimeters.height());
}
void QXcbScreen::updateGeometry(xcb_timestamp_t timestamp)
@@ -470,4 +481,41 @@ QPixmap QXcbScreen::grabWindow(WId window, int x, int y, int width, int height)
return result;
}
+void QXcbScreen::readXResources()
+{
+ int offset = 0;
+ QByteArray resources;
+ while(1) {
+ xcb_get_property_reply_t *reply =
+ xcb_get_property_reply(xcb_connection(),
+ xcb_get_property_unchecked(xcb_connection(), false, screen()->root,
+ XCB_ATOM_RESOURCE_MANAGER,
+ XCB_ATOM_STRING, offset/4, 8192), NULL);
+ bool more = false;
+ if (reply && reply->format == 8 && reply->type == XCB_ATOM_STRING) {
+ resources += QByteArray((const char *)xcb_get_property_value(reply), xcb_get_property_value_length(reply));
+ offset += xcb_get_property_value_length(reply);
+ more = reply->bytes_after != 0;
+ }
+
+ if (reply)
+ free(reply);
+
+ if (!more)
+ break;
+ }
+
+ QList<QByteArray> split = resources.split('\n');
+ for (int i = 0; i < split.size(); ++i) {
+ const QByteArray &r = split.at(i);
+ if (r.startsWith("Xft.dpi:\t")) {
+ bool ok;
+ int dpi = r.mid(sizeof("Xft.dpi:")).toInt(&ok);
+ if (ok)
+ m_forcedDpi = dpi;
+ break;
+ }
+ }
+}
+
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/xcb/qxcbscreen.h b/src/plugins/platforms/xcb/qxcbscreen.h
index d9eee464dc..96d30cde8b 100644
--- a/src/plugins/platforms/xcb/qxcbscreen.h
+++ b/src/plugins/platforms/xcb/qxcbscreen.h
@@ -96,6 +96,7 @@ public:
void updateGeometry(xcb_timestamp_t timestamp);
void updateRefreshRate();
+ void readXResources();
private:
xcb_screen_t *m_screen;
xcb_randr_crtc_t m_crtc;
@@ -114,6 +115,7 @@ private:
QMap<xcb_visualid_t, xcb_visualtype_t> m_visuals;
QXcbCursor *m_cursor;
int m_refreshRate;
+ int m_forcedDpi;
};
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp
index 5e4e749c83..528c4c6580 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.cpp
+++ b/src/plugins/platforms/xcb/qxcbwindow.cpp
@@ -385,6 +385,10 @@ void QXcbWindow::create()
#ifndef QT_NO_DRAGANDDROP
connection()->drag()->dndEnable(this, true);
#endif
+
+ const qreal opacity = qt_window_private(window())->opacity;
+ if (!qFuzzyCompare(opacity, qreal(1.0)))
+ setOpacity(opacity);
}
QXcbWindow::~QXcbWindow()
@@ -1024,6 +1028,7 @@ void QXcbWindow::updateNetWmStateBeforeMap()
void QXcbWindow::updateNetWmUserTime(xcb_timestamp_t timestamp)
{
xcb_window_t wid = m_window;
+ connection()->setNetWmUserTime(timestamp);
const bool isSupportedByWM = connection()->wmSupport()->isSupportedByWM(atom(QXcbAtom::_NET_WM_USER_TIME_WINDOW));
if (m_netWmUserTimeWindow || isSupportedByWM) {
@@ -1112,7 +1117,18 @@ void QXcbWindow::setParent(const QPlatformWindow *parent)
void QXcbWindow::setWindowTitle(const QString &title)
{
- QByteArray ba = title.toUtf8();
+ QString fullTitle = title;
+ if (QGuiApplicationPrivate::displayName) {
+ // Append display name, if set.
+ if (!fullTitle.isEmpty())
+ fullTitle += QString::fromUtf8(" \xe2\x80\x94 "); // unicode character U+2014, EM DASH
+ fullTitle += *QGuiApplicationPrivate::displayName;
+ } else if (fullTitle.isEmpty()) {
+ // Don't let the window title be completely empty, use the app name as fallback.
+ fullTitle = QCoreApplication::applicationName();
+ }
+ const QByteArray ba = fullTitle.toUtf8();
+
Q_XCB_CALL(xcb_change_property(xcb_connection(),
XCB_PROP_MODE_REPLACE,
m_window,
@@ -1460,53 +1476,6 @@ void QXcbWindow::handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *event)
}
}
-static Qt::MouseButtons translateMouseButtons(int s)
-{
- Qt::MouseButtons ret = 0;
- if (s & XCB_BUTTON_MASK_1)
- ret |= Qt::LeftButton;
- if (s & XCB_BUTTON_MASK_2)
- ret |= Qt::MidButton;
- if (s & XCB_BUTTON_MASK_3)
- ret |= Qt::RightButton;
- return ret;
-}
-
-static Qt::MouseButton translateMouseButton(xcb_button_t s)
-{
- switch (s) {
- case 1: return Qt::LeftButton;
- case 2: return Qt::MidButton;
- case 3: return Qt::RightButton;
- // Button values 4-7 were already handled as Wheel events, and won't occur here.
- case 8: return Qt::BackButton; // Also known as Qt::ExtraButton1
- case 9: return Qt::ForwardButton; // Also known as Qt::ExtraButton2
- case 10: return Qt::ExtraButton3;
- case 11: return Qt::ExtraButton4;
- case 12: return Qt::ExtraButton5;
- case 13: return Qt::ExtraButton6;
- case 14: return Qt::ExtraButton7;
- case 15: return Qt::ExtraButton8;
- case 16: return Qt::ExtraButton9;
- case 17: return Qt::ExtraButton10;
- case 18: return Qt::ExtraButton11;
- case 19: return Qt::ExtraButton12;
- case 20: return Qt::ExtraButton13;
- case 21: return Qt::ExtraButton14;
- case 22: return Qt::ExtraButton15;
- case 23: return Qt::ExtraButton16;
- case 24: return Qt::ExtraButton17;
- case 25: return Qt::ExtraButton18;
- case 26: return Qt::ExtraButton19;
- case 27: return Qt::ExtraButton20;
- case 28: return Qt::ExtraButton21;
- case 29: return Qt::ExtraButton22;
- case 30: return Qt::ExtraButton23;
- case 31: return Qt::ExtraButton24;
- default: return Qt::NoButton;
- }
-}
-
void QXcbWindow::handleButtonPressEvent(const xcb_button_press_event_t *event)
{
updateNetWmUserTime(event->time);
@@ -1528,7 +1497,7 @@ void QXcbWindow::handleButtonPressEvent(const xcb_button_press_event_t *event)
return;
}
- handleMouseEvent(event->detail, event->state, event->time, local, global, modifiers);
+ handleMouseEvent(event->time, local, global, modifiers);
}
void QXcbWindow::handleButtonReleaseEvent(const xcb_button_release_event_t *event)
@@ -1537,7 +1506,12 @@ void QXcbWindow::handleButtonReleaseEvent(const xcb_button_release_event_t *even
QPoint global(event->root_x, event->root_y);
Qt::KeyboardModifiers modifiers = connection()->keyboard()->translateModifiers(event->state);
- handleMouseEvent(event->detail, event->state, event->time, local, global, modifiers);
+ if (event->detail >= 4 && event->detail <= 7) {
+ // mouse wheel, handled in handleButtonPressEvent()
+ return;
+ }
+
+ handleMouseEvent(event->time, local, global, modifiers);
}
void QXcbWindow::handleMotionNotifyEvent(const xcb_motion_notify_event_t *event)
@@ -1546,19 +1520,13 @@ void QXcbWindow::handleMotionNotifyEvent(const xcb_motion_notify_event_t *event)
QPoint global(event->root_x, event->root_y);
Qt::KeyboardModifiers modifiers = connection()->keyboard()->translateModifiers(event->state);
- handleMouseEvent(event->detail, event->state, event->time, local, global, modifiers);
+ handleMouseEvent(event->time, local, global, modifiers);
}
-void QXcbWindow::handleMouseEvent(xcb_button_t detail, uint16_t state, xcb_timestamp_t time, const QPoint &local, const QPoint &global, Qt::KeyboardModifiers modifiers)
+void QXcbWindow::handleMouseEvent(xcb_timestamp_t time, const QPoint &local, const QPoint &global, Qt::KeyboardModifiers modifiers)
{
connection()->setTime(time);
-
- Qt::MouseButtons buttons = translateMouseButtons(state);
- Qt::MouseButton button = translateMouseButton(detail);
-
- buttons ^= button; // X event uses state *before*, Qt uses state *after*
-
- QWindowSystemInterface::handleMouseEvent(window(), time, local, global, buttons, modifiers);
+ QWindowSystemInterface::handleMouseEvent(window(), time, local, global, connection()->buttons(), modifiers);
}
class EnterEventChecker
@@ -1786,6 +1754,23 @@ static inline xcb_rectangle_t qRectToXCBRectangle(const QRect &r)
return result;
}
+void QXcbWindow::setOpacity(qreal level)
+{
+ if (!m_window)
+ return;
+
+ quint32 value = qRound64(qBound(qreal(0), level, qreal(1)) * 0xffffffff);
+
+ Q_XCB_CALL(xcb_change_property(xcb_connection(),
+ XCB_PROP_MODE_REPLACE,
+ m_window,
+ atom(QXcbAtom::_NET_WM_WINDOW_OPACITY),
+ XCB_ATOM_CARDINAL,
+ 32,
+ 1,
+ (uchar *)&value));
+}
+
void QXcbWindow::setMask(const QRegion &region)
{
if (!connection()->hasXShape())
diff --git a/src/plugins/platforms/xcb/qxcbwindow.h b/src/plugins/platforms/xcb/qxcbwindow.h
index bd4d18a175..b2c637281d 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.h
+++ b/src/plugins/platforms/xcb/qxcbwindow.h
@@ -109,6 +109,8 @@ public:
bool startSystemResize(const QPoint &pos, Qt::Corner corner);
+ void setOpacity(qreal level);
+
#if !defined(QT_NO_SHAPE)
void setMask(const QRegion &region);
#endif // !QT_NO_SHAPE
@@ -132,11 +134,10 @@ public:
void handleFocusOutEvent(const xcb_focus_out_event_t *event);
void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event);
- void handleMouseEvent(xcb_button_t detail, uint16_t state, xcb_timestamp_t time, const QPoint &local, const QPoint &global, Qt::KeyboardModifiers modifiers);
+ void handleMouseEvent(xcb_timestamp_t time, const QPoint &local, const QPoint &global, Qt::KeyboardModifiers modifiers);
void updateSyncRequestCounter();
void updateNetWmUserTime(xcb_timestamp_t timestamp);
- void netWmUserTime() const;
#if defined(XCB_USE_EGL)
QXcbEGLSurface *eglSurface() const;
diff --git a/src/plugins/platforms/xcb/xcb-plugin.pro b/src/plugins/platforms/xcb/xcb-plugin.pro
index b7b5650eea..5823e97f36 100644
--- a/src/plugins/platforms/xcb/xcb-plugin.pro
+++ b/src/plugins/platforms/xcb/xcb-plugin.pro
@@ -1,6 +1,7 @@
-TARGET = xcb
+TARGET = qxcb
PLUGIN_TYPE = platforms
+PLUGIN_CLASS_NAME = QXcbIntegrationPlugin
load(qt_plugin)
QT += core-private gui-private platformsupport-private
@@ -109,7 +110,7 @@ contains(QT_CONFIG, xcb-qt) {
DEFINES += XCB_USE_RENDER
XCB_DIR = ../../../3rdparty/xcb
INCLUDEPATH += $$XCB_DIR/include $$XCB_DIR/sysinclude
- LIBS += -lxcb -L ./xcb-static -l xcb-static
+ LIBS += -lxcb -L$$OUT_PWD/xcb-static -lxcb-static
} else {
LIBS += -lxcb -lxcb-image -lxcb-keysyms -lxcb-icccm -lxcb-sync -lxcb-xfixes -lxcb-shm -lxcb-randr
!contains(DEFINES, QT_NO_SHAPE):LIBS += -lxcb-shape
diff --git a/src/plugins/platforms/xcb/xcb-static/xcb-static.pro b/src/plugins/platforms/xcb/xcb-static/xcb-static.pro
index d7530fe42e..01667d41db 100644
--- a/src/plugins/platforms/xcb/xcb-static/xcb-static.pro
+++ b/src/plugins/platforms/xcb/xcb-static/xcb-static.pro
@@ -8,7 +8,7 @@ CONFIG += staticlib
XCB_DIR = ../../../../3rdparty/xcb
-INCLUDEPATH += $$XCB_DIR/include/xcb $$XCB_DIR/sysinclude
+INCLUDEPATH += $$XCB_DIR/include $$XCB_DIR/include/xcb $$XCB_DIR/sysinclude
# ignore compiler warnings in 3rdparty code
QMAKE_CFLAGS_STATIC_LIB+=-w
diff --git a/src/plugins/plugins.pro b/src/plugins/plugins.pro
index b056fa4002..3b0ff3f6c8 100644
--- a/src/plugins/plugins.pro
+++ b/src/plugins/plugins.pro
@@ -1,7 +1,7 @@
TEMPLATE = subdirs
SUBDIRS *= sqldrivers bearer
-!contains(QT_CONFIG, no-gui): SUBDIRS *= imageformats platforms platforminputcontexts generic
-!contains(QT_CONFIG, no-widgets): SUBDIRS += accessible
+qtHaveModule(gui): SUBDIRS *= imageformats platforms platforminputcontexts generic
+qtHaveModule(widgets): SUBDIRS += accessible
-!wince*:!contains(QT_CONFIG, no-widgets):SUBDIRS += printsupport
+!wince*:qtHaveModule(widgets): SUBDIRS += printsupport
diff --git a/src/plugins/printsupport/cocoa/cocoa.pro b/src/plugins/printsupport/cocoa/cocoa.pro
index c0206fd2bc..a3b9e2dfcf 100644
--- a/src/plugins/printsupport/cocoa/cocoa.pro
+++ b/src/plugins/printsupport/cocoa/cocoa.pro
@@ -1,6 +1,7 @@
TARGET = cocoaprintersupport
MODULE = cocoaprintersupport
PLUGIN_TYPE = printsupport
+PLUGIN_CLASS_NAME = QCocoaPrinterSupportPlugin
load(qt_plugin)
QT += gui-private printsupport-private
diff --git a/src/plugins/printsupport/cups/cups.pro b/src/plugins/printsupport/cups/cups.pro
index 0ea5058c00..f617738a94 100644
--- a/src/plugins/printsupport/cups/cups.pro
+++ b/src/plugins/printsupport/cups/cups.pro
@@ -1,6 +1,7 @@
TARGET = cupsprintersupport
MODULE = cupsprintersupport
PLUGIN_TYPE = printsupport
+PLUGIN_CLASS_NAME = QCupsPrinterSupportPlugin
load(qt_plugin)
QT += core-private gui-private printsupport printsupport-private
diff --git a/src/plugins/printsupport/windows/windows.pro b/src/plugins/printsupport/windows/windows.pro
index 5b5dd86beb..ae9efa342b 100644
--- a/src/plugins/printsupport/windows/windows.pro
+++ b/src/plugins/printsupport/windows/windows.pro
@@ -1,6 +1,7 @@
TARGET = windowsprintersupport
MODULE = windowsprintersupport
PLUGIN_TYPE = printsupport
+PLUGIN_CLASS_NAME = QWindowsPrinterSupportPlugin
load(qt_plugin)
QT *= core-private
diff --git a/src/plugins/sqldrivers/db2/db2.pro b/src/plugins/sqldrivers/db2/db2.pro
index d04e6f191b..2365c5bc0e 100644
--- a/src/plugins/sqldrivers/db2/db2.pro
+++ b/src/plugins/sqldrivers/db2/db2.pro
@@ -4,4 +4,5 @@ SOURCES = main.cpp
OTHER_FILES += db2.json
include(../../../sql/drivers/db2/qsql_db2.pri)
+PLUGIN_CLASS_NAME = QDB2DriverPlugin
include(../qsqldriverbase.pri)
diff --git a/src/plugins/sqldrivers/ibase/ibase.pro b/src/plugins/sqldrivers/ibase/ibase.pro
index ca2a91aa2e..1f29597a2b 100644
--- a/src/plugins/sqldrivers/ibase/ibase.pro
+++ b/src/plugins/sqldrivers/ibase/ibase.pro
@@ -4,4 +4,5 @@ SOURCES = main.cpp
OTHER_FILES += ibase.json
include(../../../sql/drivers/ibase/qsql_ibase.pri)
+PLUGIN_CLASS_NAME = QIBaseDriverPlugin
include(../qsqldriverbase.pri)
diff --git a/src/plugins/sqldrivers/mysql/mysql.pro b/src/plugins/sqldrivers/mysql/mysql.pro
index 05d1073701..c917bfca48 100644
--- a/src/plugins/sqldrivers/mysql/mysql.pro
+++ b/src/plugins/sqldrivers/mysql/mysql.pro
@@ -4,4 +4,5 @@ SOURCES = main.cpp
OTHER_FILES += mysql.json
include(../../../sql/drivers/mysql/qsql_mysql.pri)
+PLUGIN_CLASS_NAME = QMYSQLDriverPlugin
include(../qsqldriverbase.pri)
diff --git a/src/plugins/sqldrivers/oci/oci.pro b/src/plugins/sqldrivers/oci/oci.pro
index 89642f3653..96a0dd9ab6 100644
--- a/src/plugins/sqldrivers/oci/oci.pro
+++ b/src/plugins/sqldrivers/oci/oci.pro
@@ -4,4 +4,5 @@ SOURCES = main.cpp
OTHER_FILES += oci.json
include(../../../sql/drivers/oci/qsql_oci.pri)
+PLUGIN_CLASS_NAME = QOCIDriverPlugin
include(../qsqldriverbase.pri)
diff --git a/src/plugins/sqldrivers/odbc/odbc.pro b/src/plugins/sqldrivers/odbc/odbc.pro
index 5ebd34fd17..c0020c065f 100644
--- a/src/plugins/sqldrivers/odbc/odbc.pro
+++ b/src/plugins/sqldrivers/odbc/odbc.pro
@@ -4,4 +4,5 @@ SOURCES = main.cpp
OTHER_FILES += odbc.json
include(../../../sql/drivers/odbc/qsql_odbc.pri)
+PLUGIN_CLASS_NAME = QODBCDriverPlugin
include(../qsqldriverbase.pri)
diff --git a/src/plugins/sqldrivers/psql/psql.pro b/src/plugins/sqldrivers/psql/psql.pro
index cb0d27e171..0fabe0e616 100644
--- a/src/plugins/sqldrivers/psql/psql.pro
+++ b/src/plugins/sqldrivers/psql/psql.pro
@@ -4,4 +4,5 @@ SOURCES = main.cpp
OTHER_FILES += psql.json
include(../../../sql/drivers/psql/qsql_psql.pri)
+PLUGIN_CLASS_NAME = QPSQLDriverPlugin
include(../qsqldriverbase.pri)
diff --git a/src/plugins/sqldrivers/sqlite/sqlite.pro b/src/plugins/sqldrivers/sqlite/sqlite.pro
index d1f4aa7233..60b30d70c0 100644
--- a/src/plugins/sqldrivers/sqlite/sqlite.pro
+++ b/src/plugins/sqldrivers/sqlite/sqlite.pro
@@ -6,4 +6,5 @@ include(../../../sql/drivers/sqlite/qsql_sqlite.pri)
wince*: DEFINES += HAVE_LOCALTIME_S=0
+PLUGIN_CLASS_NAME = QSQLiteDriverPlugin
include(../qsqldriverbase.pri)
diff --git a/src/plugins/sqldrivers/sqlite2/sqlite2.pro b/src/plugins/sqldrivers/sqlite2/sqlite2.pro
index 1cbd31c3dc..d69afc119f 100644
--- a/src/plugins/sqldrivers/sqlite2/sqlite2.pro
+++ b/src/plugins/sqldrivers/sqlite2/sqlite2.pro
@@ -4,4 +4,5 @@ SOURCES = smain.cpp
OTHER_FILES += sqlite2.json
include(../../../sql/drivers/sqlite2/qsql_sqlite2.pri)
+PLUGIN_CLASS_NAME = QSQLite2DriverPlugin
include(../qsqldriverbase.pri)
diff --git a/src/plugins/sqldrivers/tds/tds.pro b/src/plugins/sqldrivers/tds/tds.pro
index 9f7c2a193f..88f4b7c451 100644
--- a/src/plugins/sqldrivers/tds/tds.pro
+++ b/src/plugins/sqldrivers/tds/tds.pro
@@ -4,4 +4,5 @@ SOURCES = main.cpp
OTHER_FILES += tds.json
include(../../../sql/drivers/tds/qsql_tds.pri)
+PLUGIN_CLASS_NAME = QTDSDriverPlugin
include(../qsqldriverbase.pri)
diff --git a/src/printsupport/doc/qtprintsupport.qdocconf b/src/printsupport/doc/qtprintsupport.qdocconf
index 98160f3d5d..1a4d37ae49 100644
--- a/src/printsupport/doc/qtprintsupport.qdocconf
+++ b/src/printsupport/doc/qtprintsupport.qdocconf
@@ -3,21 +3,21 @@ include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf)
project = QtPrintSupport
description = Qt Print Support Reference Documentation
url = http://qt-project.org/doc/qtprintsupport
-version = 5.0.0
+version = 5.0.1
examplesinstallpath = printsupport
qhp.projects = QtPrintSupport
qhp.QtPrintSupport.file = qtprintsupport.qhp
-qhp.QtPrintSupport.namespace = org.qt-project.qtprintsupport.500
+qhp.QtPrintSupport.namespace = org.qt-project.qtprintsupport.501
qhp.QtPrintSupport.virtualFolder = qtprintsupport
qhp.QtPrintSupport.indexTitle = Qt Print Support
qhp.QtPrintSupport.indexRoot =
-qhp.QtPrintSupport.filterAttributes = qtprintsupport 5.0.0 qtrefdoc
-qhp.QtPrintSupport.customFilters.Qt.name = QtPrintSupport 5.0.0
-qhp.QtPrintSupport.customFilters.Qt.filterAttributes = qtprintsupport 5.0.0
+qhp.QtPrintSupport.filterAttributes = qtprintsupport 5.0.1 qtrefdoc
+qhp.QtPrintSupport.customFilters.Qt.name = QtPrintSupport 5.0.1
+qhp.QtPrintSupport.customFilters.Qt.filterAttributes = qtprintsupport 5.0.1
qhp.QtPrintSupport.subprojects = classes
qhp.QtPrintSupport.subprojects.classes.title = C++ Classes
diff --git a/src/sql/doc/qtsql.qdocconf b/src/sql/doc/qtsql.qdocconf
index 4de56207f6..6c5af37de8 100644
--- a/src/sql/doc/qtsql.qdocconf
+++ b/src/sql/doc/qtsql.qdocconf
@@ -3,25 +3,25 @@ include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf)
project = QtSql
description = Qt SQL Reference Documentation
url = http://qt-project.org/doc/qtsql
-version = 5.0.0
+version = 5.0.1
examplesinstallpath = sql
qhp.projects = QtSql
qhp.QtSql.file = qtsql.qhp
-qhp.QtSql.namespace = org.qt-project.qtsql.500
+qhp.QtSql.namespace = org.qt-project.qtsql.501
qhp.QtSql.virtualFolder = qtsql
qhp.QtSql.indexTitle = Qt SQL
qhp.QtSql.indexRoot =
-qhp.QtSql.filterAttributes = qtsql 5.0.0 qtrefdoc
-qhp.QtSql.customFilters.Qt.name = QtSql 5.0.0
-qhp.QtSql.customFilters.Qt.filterAttributes = qtsql 5.0.0
+qhp.QtSql.filterAttributes = qtsql 5.0.1 qtrefdoc
+qhp.QtSql.customFilters.Qt.name = QtSql 5.0.1
+qhp.QtSql.customFilters.Qt.filterAttributes = qtsql 5.0.1
qhp.QtSql.subprojects = classes
qhp.QtSql.subprojects.classes.title = C++ Classes
-qhp.QtSql.subprojects.classes.indexTitle = Qt SQL C++ Classes
+qhp.QtSql.subprojects.classes.indexTitle = Qt SQL Module C++ Classes
qhp.QtSql.subprojects.classes.selectors = class fake:headerfile
qhp.QtSql.subprojects.classes.sortPages = true
tagfile = ../../../doc/qtsql/qtsql.tags
diff --git a/src/sql/doc/src/sql-driver.qdoc b/src/sql/doc/src/sql-driver.qdoc
index 57efa5c4cc..d8a468222b 100644
--- a/src/sql/doc/src/sql-driver.qdoc
+++ b/src/sql/doc/src/sql-driver.qdoc
@@ -494,7 +494,7 @@
\snippet code/doc_src_sql-driver.qdoc 15
Users of MinGW may wish to consult the following online document:
- \l{PostgreSQL MinGW/Native Windows}.
+ \l{http://www.postgresql.org/docs/current/static/installation-platform-notes.html#INSTALLATION-NOTES-MINGW}{PostgreSQL MinGW/Native Windows}.
\b{Note:} This database plugin is not supported for Windows CE.
diff --git a/src/sql/doc/src/sql-programming.qdoc b/src/sql/doc/src/sql-programming.qdoc
index aa2eb243b8..ab8eee5b88 100644
--- a/src/sql/doc/src/sql-programming.qdoc
+++ b/src/sql/doc/src/sql-programming.qdoc
@@ -76,7 +76,7 @@
\section2 Driver Layer
- This comprises the classes QSqlDriver, QSqlDriverCreator<T>,
+ This comprises the classes QSqlDriver, QSqlDriverCreator,
QSqlDriverCreatorBase, QSqlDriverPlugin, and QSqlResult.
This layer provides the low-level bridge between the specific databases
@@ -98,8 +98,8 @@
These classes are designed to work with Qt's
\l{Model/View Programming}{model/view framework}.
- Note that to use any of these classes, a QCoreApplication object
- must have been instantiated first.
+ Note that a QCoreApplication object must be instantiated before
+ using any of these classes.
*/
/*!
diff --git a/src/sql/drivers/mysql/qsql_mysql.cpp b/src/sql/drivers/mysql/qsql_mysql.cpp
index e7b86cec42..80c3087bf1 100644
--- a/src/sql/drivers/mysql/qsql_mysql.cpp
+++ b/src/sql/drivers/mysql/qsql_mysql.cpp
@@ -1175,6 +1175,7 @@ bool QMYSQLDriver::hasFeature(DriverFeature f) const
case SimpleLocking:
case EventNotifications:
case FinishQuery:
+ case CancelQuery:
return false;
case QuerySize:
case BLOB:
diff --git a/src/sql/drivers/odbc/qsql_odbc.cpp b/src/sql/drivers/odbc/qsql_odbc.cpp
index 0eb078b0e4..c14e2d68c4 100644
--- a/src/sql/drivers/odbc/qsql_odbc.cpp
+++ b/src/sql/drivers/odbc/qsql_odbc.cpp
@@ -85,7 +85,7 @@ inline static QString fromSQLTCHAR(const QVarLengthArray<SQLTCHAR>& input, int s
result=QString::fromUcs4((const uint *)input.constData(), realsize);
break;
default:
- qCritical("sizeof(SQLTCHAR) is %d. Don't know how to handle this.", sizeof(SQLTCHAR));
+ qCritical("sizeof(SQLTCHAR) is %d. Don't know how to handle this.", int(sizeof(SQLTCHAR)));
}
return result;
}
@@ -105,7 +105,7 @@ inline static QVarLengthArray<SQLTCHAR> toSQLTCHAR(const QString &input)
memcpy(result.data(), input.toUcs4().data(), input.size() * 4);
break;
default:
- qCritical("sizeof(SQLTCHAR) is %d. Don't know how to handle this.", sizeof(SQLTCHAR));
+ qCritical("sizeof(SQLTCHAR) is %d. Don't know how to handle this.", int(sizeof(SQLTCHAR)));
}
result.append(0); // make sure it's null terminated, doesn't matter if it already is, it does if it isn't.
return result;
@@ -646,7 +646,7 @@ static QSqlField qMakeFieldInfo(const QODBCPrivate* p, int i )
return f;
}
-static int qGetODBCVersion(const QString &connOpts)
+static size_t qGetODBCVersion(const QString &connOpts)
{
if (connOpts.contains(QLatin1String("SQL_ATTR_ODBC_VERSION=SQL_OV_ODBC3"), Qt::CaseInsensitive))
return SQL_OV_ODBC3;
@@ -703,13 +703,13 @@ bool QODBCDriverPrivate::setConnectionOptions(const QString& connOpts)
qWarning() << "QODBCDriver::open: Unknown option value '" << val << '\'';
continue;
}
- r = SQLSetConnectAttr(hDbc, SQL_ATTR_ACCESS_MODE, (SQLPOINTER) v, 0);
+ r = SQLSetConnectAttr(hDbc, SQL_ATTR_ACCESS_MODE, (SQLPOINTER) size_t(v), 0);
} else if (opt.toUpper() == QLatin1String("SQL_ATTR_CONNECTION_TIMEOUT")) {
v = val.toUInt();
- r = SQLSetConnectAttr(hDbc, SQL_ATTR_CONNECTION_TIMEOUT, (SQLPOINTER) v, 0);
+ r = SQLSetConnectAttr(hDbc, SQL_ATTR_CONNECTION_TIMEOUT, (SQLPOINTER) size_t(v), 0);
} else if (opt.toUpper() == QLatin1String("SQL_ATTR_LOGIN_TIMEOUT")) {
v = val.toUInt();
- r = SQLSetConnectAttr(hDbc, SQL_ATTR_LOGIN_TIMEOUT, (SQLPOINTER) v, 0);
+ r = SQLSetConnectAttr(hDbc, SQL_ATTR_LOGIN_TIMEOUT, (SQLPOINTER) size_t(v), 0);
} else if (opt.toUpper() == QLatin1String("SQL_ATTR_CURRENT_CATALOG")) {
val.utf16(); // 0 terminate
r = SQLSetConnectAttr(hDbc, SQL_ATTR_CURRENT_CATALOG,
@@ -728,10 +728,10 @@ bool QODBCDriverPrivate::setConnectionOptions(const QString& connOpts)
qWarning() << "QODBCDriver::open: Unknown option value '" << val << '\'';
continue;
}
- r = SQLSetConnectAttr(hDbc, SQL_ATTR_METADATA_ID, (SQLPOINTER) v, 0);
+ r = SQLSetConnectAttr(hDbc, SQL_ATTR_METADATA_ID, (SQLPOINTER) size_t(v), 0);
} else if (opt.toUpper() == QLatin1String("SQL_ATTR_PACKET_SIZE")) {
v = val.toUInt();
- r = SQLSetConnectAttr(hDbc, SQL_ATTR_PACKET_SIZE, (SQLPOINTER) v, 0);
+ r = SQLSetConnectAttr(hDbc, SQL_ATTR_PACKET_SIZE, (SQLPOINTER) size_t(v), 0);
} else if (opt.toUpper() == QLatin1String("SQL_ATTR_TRACEFILE")) {
val.utf16(); // 0 terminate
r = SQLSetConnectAttr(hDbc, SQL_ATTR_TRACEFILE,
@@ -750,7 +750,7 @@ bool QODBCDriverPrivate::setConnectionOptions(const QString& connOpts)
qWarning() << "QODBCDriver::open: Unknown option value '" << val << '\'';
continue;
}
- r = SQLSetConnectAttr(hDbc, SQL_ATTR_TRACE, (SQLPOINTER) v, 0);
+ r = SQLSetConnectAttr(hDbc, SQL_ATTR_TRACE, (SQLPOINTER) size_t(v), 0);
} else if (opt.toUpper() == QLatin1String("SQL_ATTR_CONNECTION_POOLING")) {
if (val == QLatin1String("SQL_CP_OFF"))
v = SQL_CP_OFF;
@@ -764,7 +764,7 @@ bool QODBCDriverPrivate::setConnectionOptions(const QString& connOpts)
qWarning() << "QODBCDriver::open: Unknown option value '" << val << '\'';
continue;
}
- r = SQLSetConnectAttr(hDbc, SQL_ATTR_CONNECTION_POOLING, (SQLPOINTER)v, 0);
+ r = SQLSetConnectAttr(hDbc, SQL_ATTR_CONNECTION_POOLING, (SQLPOINTER) size_t(v), 0);
} else if (opt.toUpper() == QLatin1String("SQL_ATTR_CP_MATCH")) {
if (val.toUpper() == QLatin1String("SQL_CP_STRICT_MATCH"))
v = SQL_CP_STRICT_MATCH;
@@ -776,7 +776,7 @@ bool QODBCDriverPrivate::setConnectionOptions(const QString& connOpts)
qWarning() << "QODBCDriver::open: Unknown option value '" << val << '\'';
continue;
}
- r = SQLSetConnectAttr(hDbc, SQL_ATTR_CP_MATCH, (SQLPOINTER)v, 0);
+ r = SQLSetConnectAttr(hDbc, SQL_ATTR_CP_MATCH, (SQLPOINTER) size_t(v), 0);
} else if (opt.toUpper() == QLatin1String("SQL_ATTR_ODBC_VERSION")) {
// Already handled in QODBCDriver::open()
continue;
@@ -1801,6 +1801,7 @@ bool QODBCDriver::hasFeature(DriverFeature f) const
case BatchOperations:
case SimpleLocking:
case EventNotifications:
+ case CancelQuery:
return false;
case MultipleResultSets:
return d->hasMultiResultSets;
@@ -2171,7 +2172,7 @@ bool QODBCDriver::beginTransaction()
SQLUINTEGER ac(SQL_AUTOCOMMIT_OFF);
SQLRETURN r = SQLSetConnectAttr(d->hDbc,
SQL_ATTR_AUTOCOMMIT,
- (SQLPOINTER)ac,
+ (SQLPOINTER)size_t(ac),
sizeof(ac));
if (r != SQL_SUCCESS) {
setLastError(qMakeError(tr("Unable to disable autocommit"),
@@ -2220,7 +2221,7 @@ bool QODBCDriver::endTrans()
SQLUINTEGER ac(SQL_AUTOCOMMIT_ON);
SQLRETURN r = SQLSetConnectAttr(d->hDbc,
SQL_ATTR_AUTOCOMMIT,
- (SQLPOINTER)ac,
+ (SQLPOINTER)size_t(ac),
sizeof(ac));
if (r != SQL_SUCCESS) {
setLastError(qMakeError(tr("Unable to enable autocommit"), QSqlError::TransactionError, d));
diff --git a/src/sql/drivers/psql/qsql_psql.cpp b/src/sql/drivers/psql/qsql_psql.cpp
index 8a0e2b86ea..b66af49de6 100644
--- a/src/sql/drivers/psql/qsql_psql.cpp
+++ b/src/sql/drivers/psql/qsql_psql.cpp
@@ -695,25 +695,30 @@ QPSQLDriver::Protocol QPSQLDriverPrivate::getPSQLVersion()
int vMaj = rx.cap(1).toInt();
int vMin = rx.cap(2).toInt();
serverVersion = qMakePSQLVersion(vMaj, vMin);
-#ifdef PG_MAJORVERSION
- if (rx.indexIn(QLatin1String(PG_MAJORVERSION)) != -1) {
+#if defined(PG_MAJORVERSION)
+ if (rx.indexIn(QLatin1String(PG_MAJORVERSION)) != -1)
+#elif defined(PG_VERSION)
+ if (rx.indexIn(QLatin1String(PG_VERSION)) != -1)
+#else
+ if (0)
+#endif
+ {
vMaj = rx.cap(1).toInt();
vMin = rx.cap(2).toInt();
+ QPSQLDriver::Protocol clientVersion = qMakePSQLVersion(vMaj, vMin);
+
+ if (serverVersion >= QPSQLDriver::Version9 && clientVersion < QPSQLDriver::Version9) {
+ //Client version before QPSQLDriver::Version9 only supports escape mode for bytea type,
+ //but bytea format is set to hex by default in PSQL 9 and above. So need to force the
+ //server use the old escape mode when connects to the new server with old client library.
+ result = exec("SET bytea_output=escape; ");
+ status = PQresultStatus(result);
+ } else if (serverVersion == QPSQLDriver::VersionUnknown) {
+ serverVersion = clientVersion;
+ if (serverVersion != QPSQLDriver::VersionUnknown)
+ qWarning("The server version of this PostgreSQL is unknown, falling back to the client version.");
+ }
}
- QPSQLDriver::Protocol clientVersion = qMakePSQLVersion(vMaj, vMin);
-
- if (serverVersion >= QPSQLDriver::Version9 && clientVersion < QPSQLDriver::Version9) {
- //Client version before QPSQLDriver::Version9 only supports escape mode for bytea type,
- //but bytea format is set to hex by default in PSQL 9 and above. So need to force the
- //server use the old escape mode when connects to the new server with old client library.
- result = exec("SET bytea_output=escape; ");
- status = PQresultStatus(result);
- } else if (serverVersion == QPSQLDriver::VersionUnknown) {
- serverVersion = clientVersion;
- if (serverVersion != QPSQLDriver::VersionUnknown)
- qWarning("The server version of this PostgreSQL is unknown, falling back to the client version.");
- }
-#endif
}
}
PQclear(result);
@@ -781,6 +786,7 @@ bool QPSQLDriver::hasFeature(DriverFeature f) const
case SimpleLocking:
case FinishQuery:
case MultipleResultSets:
+ case CancelQuery:
return false;
case BLOB:
return d->pro >= QPSQLDriver::Version71;
diff --git a/src/sql/drivers/sqlite/qsql_sqlite.cpp b/src/sql/drivers/sqlite/qsql_sqlite.cpp
index 595ef496ec..a0ccde96d4 100644
--- a/src/sql/drivers/sqlite/qsql_sqlite.cpp
+++ b/src/sql/drivers/sqlite/qsql_sqlite.cpp
@@ -540,6 +540,7 @@ bool QSQLiteDriver::hasFeature(DriverFeature f) const
case BatchOperations:
case EventNotifications:
case MultipleResultSets:
+ case CancelQuery:
return false;
}
return false;
diff --git a/src/sql/kernel/qsql.qdoc b/src/sql/kernel/qsql.qdoc
index b3afe82245..de7ea76181 100644
--- a/src/sql/kernel/qsql.qdoc
+++ b/src/sql/kernel/qsql.qdoc
@@ -45,9 +45,6 @@
\value BeforeFirstRow Before the first record.
\value AfterLastRow After the last record.
- \omitvalue BeforeFirst
- \omitvalue AfterLast
-
\sa QSqlQuery::at()
*/
diff --git a/src/sql/kernel/qsqldriver.cpp b/src/sql/kernel/qsqldriver.cpp
index 62ec4e7e1f..841c563973 100644
--- a/src/sql/kernel/qsqldriver.cpp
+++ b/src/sql/kernel/qsqldriver.cpp
@@ -218,6 +218,7 @@ bool QSqlDriver::isOpenError() const
\value EventNotifications Whether the driver supports database event notifications.
\value FinishQuery Whether the driver can do any low-level resource cleanup when QSqlQuery::finish() is called.
\value MultipleResultSets Whether the driver can access multiple result sets returned from batched statements or stored procedures.
+ \value CancelQuery Whether the driver allows cancelling a running query.
More information about supported features can be found in the
\l{sql-driver.html}{Qt SQL driver} documentation.
diff --git a/src/sql/kernel/qsqlresult.cpp b/src/sql/kernel/qsqlresult.cpp
index 0396e127ec..1259360dd4 100644
--- a/src/sql/kernel/qsqlresult.cpp
+++ b/src/sql/kernel/qsqlresult.cpp
@@ -162,8 +162,6 @@ QString QSqlResultPrivate::positionalToNamedBinding()
for (int i = 0; i < n; ++i) {
QChar ch = sql.at(i);
if (ch == QLatin1Char('?') && !inQuote) {
- // Update the holder position since we are changing the holder name lengths
- holders[count].holderPos = result.size();
result += qFieldSerial(count++);
} else {
if (ch == QLatin1Char('\''))
diff --git a/src/sql/models/qsqlrelationaldelegate.cpp b/src/sql/models/qsqlrelationaldelegate.cpp
index af50c03b2d..e040789fa6 100644
--- a/src/sql/models/qsqlrelationaldelegate.cpp
+++ b/src/sql/models/qsqlrelationaldelegate.cpp
@@ -45,6 +45,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QSqlRelationalDelegate
+ \inmodule QtSql
\brief The QSqlRelationalDelegate class provides a delegate that is used to
display and edit data from a QSqlRelationalTableModel.
@@ -88,11 +89,6 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \fn void QSqlRelationalDelegate::setEditorData(QWidget *editor, const QModelIndex &index) const
- \reimp
-*/
-
-/*!
\fn void QSqlRelationalDelegate::setModelData(QWidget *editor, QAbstractItemModel *model,
const QModelIndex &index) const
\reimp
diff --git a/src/sql/models/qsqlrelationaltablemodel.cpp b/src/sql/models/qsqlrelationaltablemodel.cpp
index c3637f0db7..29a70391b1 100644
--- a/src/sql/models/qsqlrelationaltablemodel.cpp
+++ b/src/sql/models/qsqlrelationaltablemodel.cpp
@@ -67,6 +67,7 @@ typedef QSqlRelationalTableModelSql Sql;
/*!
\class QSqlRelation
+ \inmodule QtSql
\brief The QSqlRelation class stores information about an SQL foreign key.
QSqlRelation is a helper class for QSqlRelationalTableModel. See
diff --git a/src/testlib/3rdparty/valgrind_p.h b/src/testlib/3rdparty/valgrind_p.h
index 6380a9f28d..bbce1b24d6 100644
--- a/src/testlib/3rdparty/valgrind_p.h
+++ b/src/testlib/3rdparty/valgrind_p.h
@@ -259,6 +259,7 @@ typedef
: "cc", "memory" \
); \
_zzq_rlval = _zzq_result; \
+ (void)_zzq_rlval; \
}
#define VALGRIND_GET_NR_CONTEXT(_zzq_rlval) \
diff --git a/src/testlib/doc/qttestlib.qdocconf b/src/testlib/doc/qttestlib.qdocconf
index d4404c7951..2a2a1e4ea0 100644
--- a/src/testlib/doc/qttestlib.qdocconf
+++ b/src/testlib/doc/qttestlib.qdocconf
@@ -1,31 +1,31 @@
include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf)
-project = qttestlib
+project = QtTestLib
description = Qt Test Reference Documentation
-url = http://qt-project.org/doc/qttest
-version = 5.0.0
+url = http://qt-project.org/doc/qttestlib
+version = 5.0.1
-examplesinstallpath = qtestlib
+examplesinstallpath = testlib
-qhp.projects = QtTest
+qhp.projects = QtTestLib
-qhp.QtTest.file = qttestlib.qhp
-qhp.QtTest.namespace = org.qt-project.qttest.500
-qhp.QtTest.virtualFolder = qttest
-qhp.QtTest.indexTitle = Qt Test
-qhp.QtTest.indexRoot =
+qhp.QtTestLib.file = qttestlib.qhp
+qhp.QtTestLib.namespace = org.qt-project.qttest.501
+qhp.QtTestLib.virtualFolder = qttest
+qhp.QtTestLib.indexTitle = Qt Test
+qhp.QtTestLib.indexRoot =
-qhp.QtTest.filterAttributes = qttest 5.0.0 qtrefdoc
-qhp.QtTest.customFilters.Qt.name = QtTest 5.0.0
-qhp.QtTest.customFilters.Qt.filterAttributes = qttest 5.0.0
+qhp.QtTestLib.filterAttributes = qttestlib 5.0.1 qtrefdoc
+qhp.QtTestLib.customFilters.Qt.name = QtTestLib 5.0.1
+qhp.QtTestLib.customFilters.Qt.filterAttributes = qttest 5.0.1
-qhp.QtTest.subprojects = classes
-qhp.QtTest.subprojects.classes.title = C++ Classes
-qhp.QtTest.subprojects.classes.indexTitle = Qt Test C++ Classes
-qhp.QtTest.subprojects.classes.selectors = class fake:headerfile
-qhp.QtTest.subprojects.classes.sortPages = true
+qhp.QtTestLib.subprojects = classes
+qhp.QtTestLib.subprojects.classes.title = C++ Classes
+qhp.QtTestLib.subprojects.classes.indexTitle = Qt Test C++ Classes
+qhp.QtTestLib.subprojects.classes.selectors = class fake:headerfile
+qhp.QtTestLib.subprojects.classes.sortPages = true
-tagfile = ../../../doc/qttest/qttest.tags
+tagfile = ../../../doc/qttestlib/qttestlib.tags
depends += qtcore qtdoc qtwidgets qtgui
diff --git a/src/testlib/doc/snippets/code/doc_src_qsignalspy.cpp b/src/testlib/doc/snippets/code/doc_src_qsignalspy.cpp
index a0fd16f577..6741ae7942 100644
--- a/src/testlib/doc/snippets/code/doc_src_qsignalspy.cpp
+++ b/src/testlib/doc/snippets/code/doc_src_qsignalspy.cpp
@@ -79,3 +79,7 @@ QModelIndex result = qvariant_cast<QModelIndex>(spy.at(0).at(0));
//! [4]
QSignalSpy spy(myPushButton, SIGNAL(clicked(bool)));
//! [4]
+
+//! [5]
+QVERIFY(spy.wait(1000));
+//! [5]
diff --git a/src/testlib/qsignalspy.qdoc b/src/testlib/qsignalspy.qdoc
index 30ab7c8b55..d36716bf2e 100644
--- a/src/testlib/qsignalspy.qdoc
+++ b/src/testlib/qsignalspy.qdoc
@@ -94,4 +94,7 @@
Optionally the event loop can return earlier on a \a timeout (in milliseconds).
Returns true if the signal was emitted at least once in \a timeout milliseconds, otherwise returns false.
+
+ Example:
+ \snippet code/doc_src_qsignalspy.cpp 5
*/
diff --git a/src/testlib/qtestaccessible.h b/src/testlib/qtestaccessible.h
index 2642ee206a..830c5346ed 100644
--- a/src/testlib/qtestaccessible.h
+++ b/src/testlib/qtestaccessible.h
@@ -56,6 +56,8 @@
#include <QtCore/qdebug.h>
#include <QtGui/qaccessible.h>
#include <QtGui/qguiapplication.h>
+#include <QtTest/qtest_global.h>
+#include <QtTest/qtestsystem.h>
QT_BEGIN_HEADER
@@ -254,7 +256,7 @@ private:
str << "Event " << needle->object() << ", type: "
<< needle->type() << ", child: " << needle->child()
<< " not found at head of event list of size " << haystack.size() << " :";
- foreach (const QAccessibleEvent *e, haystack)
+ Q_FOREACH (const QAccessibleEvent *e, haystack)
str << ' ' << e->object() << ", type: "
<< e->type() << ", child: " << e->child();
return rc;
diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp
index d4266c0f9d..2bfd3412c7 100644
--- a/src/testlib/qtestcase.cpp
+++ b/src/testlib/qtestcase.cpp
@@ -185,7 +185,7 @@ QT_BEGIN_NAMESPACE
\relates QTest
- Invokes QTRY_VERIFY_WITH_TIMEOUT() with a timeout of five seconds.
+ Checks the \a condition by invoking QTRY_VERIFY_WITH_TIMEOUT() with a timeout of five seconds.
\note This macro can only be used in a test function that is invoked
by the test framework.
@@ -215,7 +215,8 @@ QT_BEGIN_NAMESPACE
\relates QTest
- Invokes QTRY_COMPARE_WITH_TIMEOUT() with a timeout of five seconds.
+ Performs a comparison of the \a actual and \a expected values by
+ invoking QTRY_COMPARE_WITH_TIMEOUT() with a timeout of five seconds.
\note This macro can only be used in a test function that is invoked
by the test framework.
diff --git a/src/testlib/testlib.pro b/src/testlib/testlib.pro
index db908574fd..6b74f23454 100644
--- a/src/testlib/testlib.pro
+++ b/src/testlib/testlib.pro
@@ -26,6 +26,7 @@ HEADERS = qbenchmark.h \
qtesteventloop.h \
qtest_global.h \
qtest_gui.h \
+ qtest_widgets.h \
qtest.h \
qtestkeyboard.h \
qtestmouse.h \
diff --git a/src/tools/bootstrap/bootstrap.pro b/src/tools/bootstrap/bootstrap.pro
index f2f041b704..0d4b62fd16 100644
--- a/src/tools/bootstrap/bootstrap.pro
+++ b/src/tools/bootstrap/bootstrap.pro
@@ -41,16 +41,6 @@ load(qt_module)
INCLUDEPATH += $$QT_BUILD_TREE/src/corelib/global
-DEPENDPATH += $$INCLUDEPATH \
- ../../corelib/global \
- ../../corelib/kernel \
- ../../corelib/tools \
- ../../corelib/io \
- ../../corelib/codecs \
- ../../corelib/json \
- ../../xml/dom \
- ../../xml/sax
-
SOURCES += \
../../corelib/codecs/qlatincodec.cpp \
../../corelib/codecs/qtextcodec.cpp \
@@ -139,16 +129,6 @@ win32:LIBS += -luser32 -lole32 -ladvapi32
lib.CONFIG = dummy_install
INSTALLS += lib
-# Make dummy "sis" and "freeze" target to keep recursive "make sis/freeze" working.
-sis_target.target = sis
-sis_target.commands =
-sis_target.depends = first
-QMAKE_EXTRA_TARGETS += sis_target
-freeze_target.target = freeze
-freeze_target.commands =
-freeze_target.depends = first
-QMAKE_EXTRA_TARGETS += freeze_target
-
!build_pass {
# We need the forwarding headers before their respective modules are built,
# so do a minimal syncqt run.
diff --git a/src/tools/moc/moc.cpp b/src/tools/moc/moc.cpp
index 96d6e9e456..5fbbd57c22 100644
--- a/src/tools/moc/moc.cpp
+++ b/src/tools/moc/moc.cpp
@@ -831,9 +831,6 @@ static void findRequiredContainers(ClassDef *cdef, QSet<QByteArray> *requiredQtC
void Moc::generate(FILE *out)
{
-
- QDateTime dt = QDateTime::currentDateTime();
- QByteArray dstr = dt.toString().toLatin1();
QByteArray fn = filename;
int i = filename.length()-1;
while (i>0 && filename[i-1] != '/' && filename[i-1] != '\\')
@@ -842,8 +839,7 @@ void Moc::generate(FILE *out)
fn = filename.mid(i);
fprintf(out, "/****************************************************************************\n"
"** Meta object code from reading C++ file '%s'\n**\n" , fn.constData());
- fprintf(out, "** Created: %s\n"
- "** by: The Qt Meta Object Compiler version %d (Qt %s)\n**\n" , dstr.data(), mocOutputRevision, QT_VERSION_STR);
+ fprintf(out, "** Created by: The Qt Meta Object Compiler version %d (Qt %s)\n**\n" , mocOutputRevision, QT_VERSION_STR);
fprintf(out, "** WARNING! All changes made in this file will be lost!\n"
"*****************************************************************************/\n\n");
diff --git a/src/tools/qdbuscpp2xml/qdbuscpp2xml.pro b/src/tools/qdbuscpp2xml/qdbuscpp2xml.pro
index a17b91dd79..02c3655f33 100644
--- a/src/tools/qdbuscpp2xml/qdbuscpp2xml.pro
+++ b/src/tools/qdbuscpp2xml/qdbuscpp2xml.pro
@@ -19,7 +19,6 @@ SOURCES += qdbuscpp2xml.cpp \
$$QT_SOURCE_TREE/src/dbus/qdbusutil.cpp \
$$QT_SOURCE_TREE/src/dbus/qdbusmisc.cpp \
$$QT_SOURCE_TREE/src/dbus/qdbusargument.cpp \
- $$QT_SOURCE_TREE/src/dbus/qdbusmarshaller.cpp \
$$QT_SOURCE_TREE/src/dbus/qdbusextratypes.cpp \
$$QT_SOURCE_TREE/src/dbus/qdbus_symbols.cpp \
$$QT_SOURCE_TREE/src/dbus/qdbusunixfiledescriptor.cpp
diff --git a/src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp b/src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp
index bdc9bc30dc..786d5108fc 100644
--- a/src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp
+++ b/src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp
@@ -498,7 +498,7 @@ static QString stringify(const QString &data)
retval += QLatin1String("\\\"");
else
retval += data[i];
- if (data[i] == QLatin1Char('\r') && data[i+1] == QLatin1Char('\n'))
+ if (i+1 < data.length() && data[i] == QLatin1Char('\r') && data[i+1] == QLatin1Char('\n'))
i++;
retval += QLatin1String("\\n\"\n");
}
diff --git a/src/tools/qdbusxml2cpp/qdbusxml2cpp.pro b/src/tools/qdbusxml2cpp/qdbusxml2cpp.pro
index 7c2bb2e22f..b473014938 100644
--- a/src/tools/qdbusxml2cpp/qdbusxml2cpp.pro
+++ b/src/tools/qdbusxml2cpp/qdbusxml2cpp.pro
@@ -19,7 +19,6 @@ SOURCES = qdbusxml2cpp.cpp \
$$QT_SOURCE_TREE/src/dbus/qdbusutil.cpp \
$$QT_SOURCE_TREE/src/dbus/qdbusmetatype.cpp \
$$QT_SOURCE_TREE/src/dbus/qdbusargument.cpp \
- $$QT_SOURCE_TREE/src/dbus/qdbusmarshaller.cpp \
$$QT_SOURCE_TREE/src/dbus/qdbusextratypes.cpp \
$$QT_SOURCE_TREE/src/dbus/qdbus_symbols.cpp \
$$QT_SOURCE_TREE/src/dbus/qdbusunixfiledescriptor.cpp
diff --git a/src/tools/qdoc/codemarker.cpp b/src/tools/qdoc/codemarker.cpp
index 7cc6b631f6..9fe91d93e8 100644
--- a/src/tools/qdoc/codemarker.cpp
+++ b/src/tools/qdoc/codemarker.cpp
@@ -396,7 +396,7 @@ void CodeMarker::insert(FastSection &fastSection,
bool irrelevant = false;
bool inheritedMember = false;
if (!node->relates()) {
- if (node->parent() != (const InnerNode*)fastSection.innerNode && !node->parent()->isAbstract()) {
+ if (node->parent() != fastSection.parent_) { // && !node->parent()->isAbstract()) {
if (node->type() != Node::QmlProperty) {
inheritedMember = true;
}
@@ -468,7 +468,7 @@ void CodeMarker::insert(FastSection& fastSection,
(parent->subType() == Node::QmlPropertyGroup)) {
parent = parent->parent();
}
- inheritedMember = (parent != (const InnerNode*)fastSection.innerNode);
+ inheritedMember = (parent != fastSection.parent_);
if (!inheritedMember || style == Subpage) {
QString key = sortName(node);
@@ -488,24 +488,24 @@ void CodeMarker::insert(FastSection& fastSection,
}
/*!
- Returns true if \a node represents a reimplemented member function.
- If it is, then it is inserted in the reimplemented member map in the
- section \a fs. And, the test is only performed if \a status is \e OK.
- Otherwise, false is returned.
+ Returns true if \a node represents a reimplemented member
+ function in the class of the FastSection \a fs. If it is
+ a reimplemented function, then it is inserted into the
+ reimplemented member map in \a fs. The test is performed
+ only if \a status is \e OK. True is returned if \a node
+ is inserted into the map. Otherwise, false is returned.
*/
bool CodeMarker::insertReimpFunc(FastSection& fs, Node* node, Status status)
{
- if (node->access() == Node::Private)
- return false;
-
- const FunctionNode* fn = static_cast<const FunctionNode*>(node);
- if ((fn->reimplementedFrom() != 0) && (status == Okay)) {
- bool inherited = (!fn->relates() && (fn->parent() != (const InnerNode*)fs.innerNode));
- if (!inherited) {
- QString key = sortName(fn);
- if (!fs.reimpMemberMap.contains(key)) {
- fs.reimpMemberMap.insert(key,node);
- return true;
+ if ((node->access() != Node::Private) && (node->relates() == 0)) {
+ const FunctionNode* fn = static_cast<const FunctionNode*>(node);
+ if ((fn->reimplementedFrom() != 0) && (status == Okay)) {
+ if (fn->parent() == fs.parent_) {
+ QString key = sortName(fn);
+ if (!fs.reimpMemberMap.contains(key)) {
+ fs.reimpMemberMap.insert(key,node);
+ return true;
+ }
}
}
}
diff --git a/src/tools/qdoc/codemarker.h b/src/tools/qdoc/codemarker.h
index 0e699a62bf..14d33d37a0 100644
--- a/src/tools/qdoc/codemarker.h
+++ b/src/tools/qdoc/codemarker.h
@@ -82,7 +82,7 @@ struct Section
struct FastSection
{
- const InnerNode *innerNode;
+ const InnerNode *parent_;
QString name;
QString divClass;
QString singularMember;
@@ -91,12 +91,12 @@ struct FastSection
QMap<QString, Node *> reimpMemberMap;
QList<QPair<InnerNode *, int> > inherited;
- FastSection(const InnerNode *innerNode0,
+ FastSection(const InnerNode *parent,
const QString& name0,
const QString& divClass0,
const QString& singularMember0,
const QString& pluralMember0)
- : innerNode(innerNode0),
+ : parent_(parent),
name(name0),
divClass(divClass0),
singularMember(singularMember0),
diff --git a/src/tools/qdoc/cppcodemarker.cpp b/src/tools/qdoc/cppcodemarker.cpp
index 3abe4c2a65..74036f4011 100644
--- a/src/tools/qdoc/cppcodemarker.cpp
+++ b/src/tools/qdoc/cppcodemarker.cpp
@@ -449,74 +449,74 @@ QList<Section> CppCodeMarker::sections(const InnerNode *inner,
QList<Section> sections;
if (inner->type() == Node::Class) {
- const ClassNode *classe = static_cast<const ClassNode *>(inner);
+ const ClassNode *classNode = static_cast<const ClassNode *>(inner);
if (style == Summary) {
- FastSection privateFunctions(classe,
+ FastSection privateFunctions(classNode,
"Private Functions",
QString(),
"private function",
"private functions");
- FastSection privateSlots(classe, "Private Slots", QString(), "private slot", "private slots");
- FastSection privateTypes(classe, "Private Types", QString(), "private type", "private types");
- FastSection protectedFunctions(classe,
+ FastSection privateSlots(classNode, "Private Slots", QString(), "private slot", "private slots");
+ FastSection privateTypes(classNode, "Private Types", QString(), "private type", "private types");
+ FastSection protectedFunctions(classNode,
"Protected Functions",
QString(),
"protected function",
"protected functions");
- FastSection protectedSlots(classe,
+ FastSection protectedSlots(classNode,
"Protected Slots",
QString(),
"protected slot",
"protected slots");
- FastSection protectedTypes(classe,
+ FastSection protectedTypes(classNode,
"Protected Types",
QString(),
"protected type",
"protected types");
- FastSection protectedVariables(classe,
+ FastSection protectedVariables(classNode,
"Protected Variables",
QString(),
"protected type",
"protected variables");
- FastSection publicFunctions(classe,
+ FastSection publicFunctions(classNode,
"Public Functions",
QString(),
"public function",
"public functions");
- FastSection publicSignals(classe, "Signals", QString(), "signal", "signal");
- FastSection publicSlots(classe, "Public Slots", QString(), "public slot", "public slots");
- FastSection publicTypes(classe, "Public Types", QString(), "public type", "public types");
- FastSection publicVariables(classe,
+ FastSection publicSignals(classNode, "Signals", QString(), "signal", "signals");
+ FastSection publicSlots(classNode, "Public Slots", QString(), "public slot", "public slots");
+ FastSection publicTypes(classNode, "Public Types", QString(), "public type", "public types");
+ FastSection publicVariables(classNode,
"Public Variables",
QString(),
"public variable",
"public variables");
- FastSection properties(classe, "Properties", QString(), "property", "properties");
- FastSection relatedNonMembers(classe,
+ FastSection properties(classNode, "Properties", QString(), "property", "properties");
+ FastSection relatedNonMembers(classNode,
"Related Non-Members",
QString(),
"related non-member",
"related non-members");
- FastSection staticPrivateMembers(classe,
+ FastSection staticPrivateMembers(classNode,
"Static Private Members",
QString(),
"static private member",
"static private members");
- FastSection staticProtectedMembers(classe,
+ FastSection staticProtectedMembers(classNode,
"Static Protected Members",
QString(),
"static protected member",
"static protected members");
- FastSection staticPublicMembers(classe,
+ FastSection staticPublicMembers(classNode,
"Static Public Members",
QString(),
"static public member",
"static public members");
FastSection macros(inner, "Macros", QString(), "macro", "macros");
- NodeList::ConstIterator r = classe->relatedNodes().constBegin();
- while (r != classe->relatedNodes().constEnd()) {
+ NodeList::ConstIterator r = classNode->relatedNodes().constBegin();
+ while (r != classNode->relatedNodes().constEnd()) {
if ((*r)->type() == Node::Function) {
FunctionNode *func = static_cast<FunctionNode *>(*r);
if (func->isMacro())
@@ -531,7 +531,7 @@ QList<Section> CppCodeMarker::sections(const InnerNode *inner,
}
QStack<const ClassNode *> stack;
- stack.push(classe);
+ stack.push(classNode);
while (!stack.isEmpty()) {
const ClassNode *ancestorClass = stack.pop();
@@ -566,8 +566,7 @@ QList<Section> CppCodeMarker::sections(const InnerNode *inner,
insert(publicSignals, *c, style, status);
}
else if (isStatic) {
- if ((*c)->type() != Node::Variable
- || !(*c)->doc().isEmpty())
+ if ((*c)->type() != Node::Variable || !(*c)->doc().isEmpty())
insert(staticPublicMembers,*c,style,status);
}
else if ((*c)->type() == Node::Property) {
@@ -578,8 +577,9 @@ QList<Section> CppCodeMarker::sections(const InnerNode *inner,
insert(publicVariables, *c, style, status);
}
else if ((*c)->type() == Node::Function) {
- if (!insertReimpFunc(publicFunctions,*c,status))
+ if (!insertReimpFunc(publicFunctions,*c,status)) {
insert(publicFunctions, *c, style, status);
+ }
}
else {
insert(publicTypes, *c, style, status);
@@ -590,8 +590,7 @@ QList<Section> CppCodeMarker::sections(const InnerNode *inner,
insert(protectedSlots, *c, style, status);
}
else if (isStatic) {
- if ((*c)->type() != Node::Variable
- || !(*c)->doc().isEmpty())
+ if ((*c)->type() != Node::Variable || !(*c)->doc().isEmpty())
insert(staticProtectedMembers,*c,style,status);
}
else if ((*c)->type() == Node::Variable) {
@@ -599,8 +598,9 @@ QList<Section> CppCodeMarker::sections(const InnerNode *inner,
insert(protectedVariables,*c,style,status);
}
else if ((*c)->type() == Node::Function) {
- if (!insertReimpFunc(protectedFunctions,*c,status))
+ if (!insertReimpFunc(protectedFunctions,*c,status)) {
insert(protectedFunctions, *c, style, status);
+ }
}
else {
insert(protectedTypes, *c, style, status);
@@ -611,13 +611,13 @@ QList<Section> CppCodeMarker::sections(const InnerNode *inner,
insert(privateSlots, *c, style, status);
}
else if (isStatic) {
- if ((*c)->type() != Node::Variable
- || !(*c)->doc().isEmpty())
+ if ((*c)->type() != Node::Variable || !(*c)->doc().isEmpty())
insert(staticPrivateMembers,*c,style,status);
}
else if ((*c)->type() == Node::Function) {
- if (!insertReimpFunc(privateFunctions,*c,status))
+ if (!insertReimpFunc(privateFunctions,*c,status)) {
insert(privateFunctions, *c, style, status);
+ }
}
else {
insert(privateTypes,*c,style,status);
@@ -654,15 +654,15 @@ QList<Section> CppCodeMarker::sections(const InnerNode *inner,
append(sections, macros);
}
else if (style == Detailed) {
- FastSection memberFunctions(classe,"Member Function Documentation","func","member","members");
- FastSection memberTypes(classe,"Member Type Documentation","types","member","members");
- FastSection memberVariables(classe,"Member Variable Documentation","vars","member","members");
- FastSection properties(classe,"Property Documentation","prop","member","members");
- FastSection relatedNonMembers(classe,"Related Non-Members","relnonmem","member","members");
- FastSection macros(classe,"Macro Documentation","macros","member","members");
-
- NodeList::ConstIterator r = classe->relatedNodes().constBegin();
- while (r != classe->relatedNodes().constEnd()) {
+ FastSection memberFunctions(classNode,"Member Function Documentation","func","member","members");
+ FastSection memberTypes(classNode,"Member Type Documentation","types","member","members");
+ FastSection memberVariables(classNode,"Member Variable Documentation","vars","member","members");
+ FastSection properties(classNode,"Property Documentation","prop","member","members");
+ FastSection relatedNonMembers(classNode,"Related Non-Members","relnonmem","member","members");
+ FastSection macros(classNode,"Macro Documentation","macros","member","members");
+
+ NodeList::ConstIterator r = classNode->relatedNodes().constBegin();
+ while (r != classNode->relatedNodes().constEnd()) {
if ((*r)->type() == Node::Function) {
FunctionNode *func = static_cast<FunctionNode *>(*r);
if (func->isMacro())
@@ -676,8 +676,8 @@ QList<Section> CppCodeMarker::sections(const InnerNode *inner,
++r;
}
- NodeList::ConstIterator c = classe->childNodes().constBegin();
- while (c != classe->childNodes().constEnd()) {
+ NodeList::ConstIterator c = classNode->childNodes().constBegin();
+ while (c != classNode->childNodes().constEnd()) {
if ((*c)->type() == Node::Enum ||
(*c)->type() == Node::Typedef) {
insert(memberTypes, *c, style, status);
@@ -705,10 +705,10 @@ QList<Section> CppCodeMarker::sections(const InnerNode *inner,
append(sections, macros);
}
else {
- FastSection all(classe,QString(),QString(),"member","members");
+ FastSection all(classNode,QString(),QString(),"member","members");
QStack<const ClassNode *> stack;
- stack.push(classe);
+ stack.push(classNode);
while (!stack.isEmpty()) {
const ClassNode *ancestorClass = stack.pop();
diff --git a/src/tools/qdoc/generator.cpp b/src/tools/qdoc/generator.cpp
index 50687d8014..d9aed3ed06 100644
--- a/src/tools/qdoc/generator.cpp
+++ b/src/tools/qdoc/generator.cpp
@@ -1529,9 +1529,9 @@ void Generator::initialize(const Config &config)
if (outputFormats.contains((*g)->format())) {
currentGenerator_ = (*g);
(*g)->initializeGenerator(config);
- QStringList extraImages = config.getCleanPathList((*g)->format() +
- Config::dot +
- CONFIG_EXTRAIMAGES);
+ QStringList extraImages = config.getPathList((*g)->format() +
+ Config::dot +
+ CONFIG_EXTRAIMAGES);
QStringList::ConstIterator e = extraImages.constBegin();
while (e != extraImages.constEnd()) {
QString filePath = *e;
diff --git a/src/tools/qdoc/htmlgenerator.cpp b/src/tools/qdoc/htmlgenerator.cpp
index 1a8425b5ce..6c0248362c 100644
--- a/src/tools/qdoc/htmlgenerator.cpp
+++ b/src/tools/qdoc/htmlgenerator.cpp
@@ -3502,6 +3502,10 @@ QString HtmlGenerator::getLink(const Atom *atom, const Node *relative, const Nod
}
if (!*node) {
*node = qdb_->findUnambiguousTarget(first, ref, relative);
+ if (*node && !(*node)->url().isEmpty() && !ref.isEmpty()) {
+ QString final = (*node)->url() + "#" + ref;
+ return final;
+ }
}
}
if (*node) {
diff --git a/src/tools/qdoc/node.h b/src/tools/qdoc/node.h
index f93e777d84..88be423478 100644
--- a/src/tools/qdoc/node.h
+++ b/src/tools/qdoc/node.h
@@ -822,13 +822,8 @@ private:
QString rt;
QStringList pp;
-#ifdef Q_WS_WIN
Metaness met;
Virtualness vir;
-#else
- Metaness met : 4;
- Virtualness vir : 2;
-#endif
bool con : 1;
bool sta : 1;
bool ove : 1;
diff --git a/src/tools/qdoc/qdoc.pro b/src/tools/qdoc/qdoc.pro
index b489668059..c0f3cd70d1 100644
--- a/src/tools/qdoc/qdoc.pro
+++ b/src/tools/qdoc/qdoc.pro
@@ -5,9 +5,6 @@ DEFINES += QDOC2_COMPAT
INCLUDEPATH += $$QT_SOURCE_TREE/src/tools/qdoc \
$$QT_SOURCE_TREE/src/tools/qdoc/qmlparser
-DEPENDPATH += $$QT_SOURCE_TREE/src/tools/qdoc \
- $$QT_SOURCE_TREE/src/tools/qdoc/qmlparser
-
# Increase the stack size on MSVC to 4M to avoid a stack overflow
win32-msvc*:{
QMAKE_LFLAGS += /STACK:4194304
diff --git a/src/tools/qdoc/qdocdatabase.cpp b/src/tools/qdoc/qdocdatabase.cpp
index fa5b2c013f..806b7b1d48 100644
--- a/src/tools/qdoc/qdocdatabase.cpp
+++ b/src/tools/qdoc/qdocdatabase.cpp
@@ -684,14 +684,15 @@ const Node* QDocDatabase::findNodeForTarget(const QString& target, const Node* r
Inserts a new target into the target table with the specified
\a name, \a node, and \a priority.
*/
-void QDocDatabase::insertTarget(const QString& name, Node* node, int priority)
+void QDocDatabase::insertTarget(const QString& name, TargetRec::Type type, Node* node, int priority)
{
- Target target;
+ TargetRec target;
+ target.type_ = type;
target.node_ = node;
target.priority_ = priority;
Atom a = Atom(Atom::Target, name);
target.ref_ = refForAtom(&a);
- targetMultiMap_.insert(name, target);
+ targetRecMultiMap_.insert(name, target);
}
/*!
@@ -701,16 +702,16 @@ void QDocDatabase::insertTarget(const QString& name, Node* node, int priority)
const Node*
QDocDatabase::findUnambiguousTarget(const QString& target, QString& ref, const Node* relative)
{
- Target bestTarget;
+ TargetRec bestTarget;
int numBestTargets = 0;
- QList<Target> bestTargetList;
+ QList<TargetRec> bestTargetList;
QString key = Doc::canonicalTitle(target);
- TargetMultiMap::iterator i = targetMultiMap_.find(key);
- while (i != targetMultiMap_.end()) {
+ TargetRecMultiMap::iterator i = targetRecMultiMap_.find(key);
+ while (i != targetRecMultiMap_.end()) {
if (i.key() != key)
break;
- const Target& candidate = i.value();
+ const TargetRec& candidate = i.value();
if (candidate.priority_ < bestTarget.priority_) {
bestTarget = candidate;
bestTargetList.clear();
@@ -808,14 +809,14 @@ const DocNode* QDocDatabase::findDocNodeByTitle(const QString& title, const Node
QString QDocDatabase::findTarget(const QString& target, const Node* node) const
{
QString key = Doc::canonicalTitle(target);
- TargetMultiMap::const_iterator i = targetMultiMap_.constFind(key);
+ TargetRecMultiMap::const_iterator i = targetRecMultiMap_.constFind(key);
- if (i != targetMultiMap_.constEnd()) {
+ if (i != targetRecMultiMap_.constEnd()) {
do {
if (i.value().node_ == node)
return i.value().ref_;
++i;
- } while (i != targetMultiMap_.constEnd() && i.key() == key);
+ } while (i != targetRecMultiMap_.constEnd() && i.key() == key);
}
return QString();
}
@@ -840,7 +841,7 @@ void QDocDatabase::resolveTargets(InnerNode* root)
if (child->doc().hasTableOfContents()) {
const QList<Atom*>& toc = child->doc().tableOfContents();
- Target target;
+ TargetRec target;
target.node_ = child;
target.priority_ = 3;
@@ -849,32 +850,32 @@ void QDocDatabase::resolveTargets(InnerNode* root)
QString title = Text::sectionHeading(toc.at(i)).toString();
if (!title.isEmpty()) {
QString key = Doc::canonicalTitle(title);
- targetMultiMap_.insert(key, target);
+ targetRecMultiMap_.insert(key, target);
}
}
}
if (child->doc().hasKeywords()) {
const QList<Atom*>& keywords = child->doc().keywords();
- Target target;
+ TargetRec target;
target.node_ = child;
target.priority_ = 1;
for (int i = 0; i < keywords.size(); ++i) {
target.ref_ = refForAtom(keywords.at(i));
QString key = Doc::canonicalTitle(keywords.at(i)->string());
- targetMultiMap_.insert(key, target);
+ targetRecMultiMap_.insert(key, target);
}
}
if (child->doc().hasTargets()) {
const QList<Atom*>& toc = child->doc().targets();
- Target target;
+ TargetRec target;
target.node_ = child;
target.priority_ = 2;
for (int i = 0; i < toc.size(); ++i) {
target.ref_ = refForAtom(toc.at(i));
QString key = Doc::canonicalTitle(toc.at(i)->string());
- targetMultiMap_.insert(key, target);
+ targetRecMultiMap_.insert(key, target);
}
}
}
diff --git a/src/tools/qdoc/qdocdatabase.h b/src/tools/qdoc/qdocdatabase.h
index 2a91693c02..d715b71e23 100644
--- a/src/tools/qdoc/qdocdatabase.h
+++ b/src/tools/qdoc/qdocdatabase.h
@@ -65,21 +65,23 @@ enum FindFlag {
NonFunction = 0x4
};
-class QDocDatabase
+struct TargetRec
{
+ public:
+ enum Type { Unknown, Target, Keyword, Contents, Class, Function, Page, Subtitle };
+ TargetRec() : node_(0), priority_(INT_MAX), type_(Unknown) { }
+ bool isEmpty() const { return ref_.isEmpty(); }
+ //void debug(int idx, const QString& key);
+ Node* node_;
+ QString ref_;
+ int priority_;
+ Type type_;
+};
+typedef QMultiMap<QString, TargetRec> TargetRecMultiMap;
- struct Target
- {
- public:
- Target() : node_(0), priority_(INT_MAX) { }
- bool isEmpty() const { return ref_.isEmpty(); }
- //void debug(int idx, const QString& key);
- Node* node_;
- QString ref_;
- int priority_;
- };
- typedef QMultiMap<QString, Target> TargetMultiMap;
+class QDocDatabase
+{
public:
static QDocDatabase* qdocDB();
static void destroyQdocDB();
@@ -127,7 +129,7 @@ class QDocDatabase
const Node* resolveTarget(const QString& target, const Node* relative, const Node* self=0);
const Node* findNodeForTarget(const QString& target, const Node* relative);
- void insertTarget(const QString& name, Node* node, int priority);
+ void insertTarget(const QString& name, TargetRec::Type type, Node* node, int priority);
/* convenience functions
Many of these will be either eliminated or replaced.
@@ -226,7 +228,7 @@ class QDocDatabase
NodeMapMap funcIndex_;
TextToNodeMap legaleseTexts_;
DocNodeMultiMap docNodesByTitle_;
- TargetMultiMap targetMultiMap_;
+ TargetRecMultiMap targetRecMultiMap_;
};
QT_END_NAMESPACE
diff --git a/src/tools/qdoc/qdocindexfiles.cpp b/src/tools/qdoc/qdocindexfiles.cpp
index 2db5db3714..fec4f304e3 100644
--- a/src/tools/qdoc/qdocindexfiles.cpp
+++ b/src/tools/qdoc/qdocindexfiles.cpp
@@ -381,15 +381,15 @@ void QDocIndexFiles::readIndexSection(const QDomElement& element,
location = Location(parent->name().toLower() + ".html");
}
else if (element.nodeName() == "keyword") {
- qdb_->insertTarget(name, parent,1);
+ qdb_->insertTarget(name, TargetRec::Keyword, parent, 1);
return;
}
else if (element.nodeName() == "target") {
- qdb_->insertTarget(name, parent,2);
+ qdb_->insertTarget(name, TargetRec::Target, parent, 2);
return;
}
else if (element.nodeName() == "contents") {
- qdb_->insertTarget(name, parent,3);
+ qdb_->insertTarget(name, TargetRec::Contents, parent, 3);
return;
}
else
diff --git a/src/tools/qdoc/tree.cpp b/src/tools/qdoc/tree.cpp
index c622fb929b..e7a8f5b5d0 100644
--- a/src/tools/qdoc/tree.cpp
+++ b/src/tools/qdoc/tree.cpp
@@ -398,6 +398,11 @@ void Tree::addPropertyFunction(PropertyNode* property,
}
/*!
+ This function resolves inheritance and reimplementation settings
+ for each class node found in the namspace beginning ar \a rootNode.
+ If it finds another namespace node in the child list of \a rootNode,
+ it calls itself recursively. For each child of \a rootNode that is a
+ class node, it calls the other resolveInheritance() function.
*/
void Tree::resolveInheritance(NamespaceNode* rootNode)
{
@@ -475,11 +480,24 @@ void Tree::resolveProperties()
}
/*!
+ This function is run twice for each \a classNode in the
+ tree. First it is run with \a pass set to 0 for each
+ \a classNode. Then it is run with \a pass set to 1 for
+ each \a classNode.
+
+ In \a pass 0, all the base classes of \a classNode are
+ found and added to the base class list for \a classNode.
+
+ In \a pass 1, each child of \a classNode that is a function
+ that is reimplemented from one of the base classes is marked
+ as being reimplemented from that class.
+
+ Some property node fixing up is also done in \a pass 1.
*/
-void Tree::resolveInheritance(int pass, ClassNode* classe)
+void Tree::resolveInheritance(int pass, ClassNode* classNode)
{
if (pass == 0) {
- QList<InheritanceBound> bounds = unresolvedInheritanceMap[classe];
+ QList<InheritanceBound> bounds = unresolvedInheritanceMap[classNode];
QList<InheritanceBound>::ConstIterator b = bounds.constBegin();
while (b != bounds.constEnd()) {
Node* n = findClassNode((*b).basePath);
@@ -487,17 +505,17 @@ void Tree::resolveInheritance(int pass, ClassNode* classe)
n = findClassNode((*b).basePath, (*b).parent);
}
if (n) {
- classe->addBaseClass((*b).access, static_cast<ClassNode*>(n), (*b).dataTypeWithTemplateArgs);
+ classNode->addBaseClass((*b).access, static_cast<ClassNode*>(n), (*b).dataTypeWithTemplateArgs);
}
++b;
}
}
else {
- NodeList::ConstIterator c = classe->childNodes().constBegin();
- while (c != classe->childNodes().constEnd()) {
+ NodeList::ConstIterator c = classNode->childNodes().constBegin();
+ while (c != classNode->childNodes().constEnd()) {
if ((*c)->type() == Node::Function) {
FunctionNode* func = (FunctionNode*)* c;
- FunctionNode* from = findVirtualFunctionInBaseClasses(classe, func);
+ FunctionNode* from = findVirtualFunctionInBaseClasses(classNode, func);
if (from != 0) {
if (func->virtualness() == FunctionNode::NonVirtual)
func->setVirtualness(FunctionNode::ImpureVirtual);
@@ -505,7 +523,7 @@ void Tree::resolveInheritance(int pass, ClassNode* classe)
}
}
else if ((*c)->type() == Node::Property) {
- fixPropertyUsingBaseClasses(classe, static_cast<PropertyNode*>(*c));
+ fixPropertyUsingBaseClasses(classNode, static_cast<PropertyNode*>(*c));
}
++c;
}
@@ -551,11 +569,11 @@ void Tree::fixInheritance(NamespaceNode* rootNode)
/*!
*/
-FunctionNode* Tree::findVirtualFunctionInBaseClasses(ClassNode* classe,
+FunctionNode* Tree::findVirtualFunctionInBaseClasses(ClassNode* classNode,
FunctionNode* clone)
{
- QList<RelatedClass>::ConstIterator r = classe->baseClasses().constBegin();
- while (r != classe->baseClasses().constEnd()) {
+ QList<RelatedClass>::ConstIterator r = classNode->baseClasses().constBegin();
+ while (r != classNode->baseClasses().constEnd()) {
FunctionNode* func;
if (((func = findVirtualFunctionInBaseClasses((*r).node, clone)) != 0 ||
(func = (*r).node->findFunctionNode(clone)) != 0)) {
@@ -569,10 +587,10 @@ FunctionNode* Tree::findVirtualFunctionInBaseClasses(ClassNode* classe,
/*!
*/
-void Tree::fixPropertyUsingBaseClasses(ClassNode* classe, PropertyNode* property)
+void Tree::fixPropertyUsingBaseClasses(ClassNode* classNode, PropertyNode* property)
{
- QList<RelatedClass>::const_iterator r = classe->baseClasses().constBegin();
- while (r != classe->baseClasses().constEnd()) {
+ QList<RelatedClass>::const_iterator r = classNode->baseClasses().constBegin();
+ while (r != classNode->baseClasses().constEnd()) {
Node* n = r->node->findChildNodeByNameAndType(property->name(), Node::Property);
if (n) {
PropertyNode* baseProperty = static_cast<PropertyNode*>(n);
@@ -588,10 +606,10 @@ void Tree::fixPropertyUsingBaseClasses(ClassNode* classe, PropertyNode* property
/*!
*/
-NodeList Tree::allBaseClasses(const ClassNode* classe) const
+NodeList Tree::allBaseClasses(const ClassNode* classNode) const
{
NodeList result;
- foreach (const RelatedClass& r, classe->baseClasses()) {
+ foreach (const RelatedClass& r, classNode->baseClasses()) {
result += r.node;
result += allBaseClasses(r.node);
}
diff --git a/src/tools/rcc/rcc.cpp b/src/tools/rcc/rcc.cpp
index 969b644d84..fb952e2970 100644
--- a/src/tools/rcc/rcc.cpp
+++ b/src/tools/rcc/rcc.cpp
@@ -793,9 +793,7 @@ bool RCCResourceLibrary::writeHeader()
writeString("/****************************************************************************\n");
writeString("** Resource object code\n");
writeString("**\n");
- writeString("** Created: ");
- writeByteArray(QDateTime::currentDateTime().toString().toLatin1());
- writeString("\n** by: The Resource Compiler for Qt version ");
+ writeString("** Created by: The Resource Compiler for Qt version ");
writeByteArray(QT_VERSION_STR);
writeString("\n**\n");
writeString("** WARNING! All changes made in this file will be lost!\n");
diff --git a/src/tools/tools.pro b/src/tools/tools.pro
index f7d1e651ff..fa9ed54c50 100644
--- a/src/tools/tools.pro
+++ b/src/tools/tools.pro
@@ -4,20 +4,20 @@ TOOLS_SUBDIRS = src_tools_bootstrap src_tools_moc src_tools_rcc src_tools_qdoc
contains(QT_CONFIG, dbus): TOOLS_SUBDIRS += src_tools_qdbusxml2cpp src_tools_qdbuscpp2xml
!contains(QT_CONFIG, no-widgets): TOOLS_SUBDIRS += src_tools_uic
# Set subdir and respective target name
-src_tools_bootstrap.subdir = $$PWD/bootstrap
+src_tools_bootstrap.subdir = bootstrap
src_tools_bootstrap.target = sub-tools-bootstrap
-src_tools_moc.subdir = $$PWD/moc
+src_tools_moc.subdir = moc
src_tools_moc.target = sub-moc
-src_tools_rcc.subdir = $$PWD/rcc
+src_tools_rcc.subdir = rcc
src_tools_rcc.target = sub-rcc
-src_tools_uic.subdir = $$PWD/uic
+src_tools_uic.subdir = uic
src_tools_uic.target = sub-uic
-src_tools_qdoc.subdir = $$QT_SOURCE_TREE/src/tools/qdoc
+src_tools_qdoc.subdir = qdoc
src_tools_qdoc.target = sub-qdoc
contains(QT_CONFIG, dbus) {
- src_tools_qdbusxml2cpp.subdir = $$QT_SOURCE_TREE/src/tools/qdbusxml2cpp
+ src_tools_qdbusxml2cpp.subdir = qdbusxml2cpp
src_tools_qdbusxml2cpp.target = sub-qdbusxml2cpp
- src_tools_qdbuscpp2xml.subdir = $$QT_SOURCE_TREE/src/tools/qdbuscpp2xml
+ src_tools_qdbuscpp2xml.subdir = qdbuscpp2xml
src_tools_qdbuscpp2xml.target = sub-qdbuscpp2xml
}
diff --git a/src/tools/uic/uic.cpp b/src/tools/uic/uic.cpp
index 38b4780ec9..1188271d99 100644
--- a/src/tools/uic/uic.cpp
+++ b/src/tools/uic/uic.cpp
@@ -134,8 +134,7 @@ void Uic::writeCopyrightHeader(DomUI *ui)
out << "/********************************************************************************\n";
out << "** Form generated from reading UI file '" << QFileInfo(opt.inputFile).fileName() << "'\n";
out << "**\n";
- out << "** Created: " << QDateTime::currentDateTime().toString() << "\n";
- out << "** " << QString::fromLatin1("by: Qt User Interface Compiler version %1\n").arg(QLatin1String(QT_VERSION_STR));
+ out << "** Created by: Qt User Interface Compiler version " << QLatin1String(QT_VERSION_STR) << "\n";
out << "**\n";
out << "** WARNING! All changes made in this file will be lost when recompiling UI file!\n";
out << "********************************************************************************/\n\n";
diff --git a/src/widgets/accessible/qaccessiblewidget.cpp b/src/widgets/accessible/qaccessiblewidget.cpp
index c8a22175fc..2177b2b262 100644
--- a/src/widgets/accessible/qaccessiblewidget.cpp
+++ b/src/widgets/accessible/qaccessiblewidget.cpp
@@ -162,7 +162,6 @@ public:
QAccessible::Role role;
QString name;
QStringList primarySignals;
- const QAccessibleInterface *asking;
};
/*!
@@ -201,7 +200,6 @@ QAccessibleWidget::QAccessibleWidget(QWidget *w, QAccessible::Role role, const Q
d = new QAccessibleWidgetPrivate();
d->role = role;
d->name = name;
- d->asking = 0;
}
/*! \reimp */
diff --git a/src/widgets/dialogs/qdialog.cpp b/src/widgets/dialogs/qdialog.cpp
index 7b47f4e135..290f0a7f65 100644
--- a/src/widgets/dialogs/qdialog.cpp
+++ b/src/widgets/dialogs/qdialog.cpp
@@ -67,8 +67,10 @@ static inline int themeDialogType(const QDialog *dialog)
if (qobject_cast<const QFileDialog *>(dialog))
return QPlatformTheme::FileDialog;
#endif
+#ifndef QT_NO_COLORDIALOG
if (qobject_cast<const QColorDialog *>(dialog))
return QPlatformTheme::ColorDialog;
+#endif
#ifndef QT_NO_FONTDIALOG
if (qobject_cast<const QFontDialog *>(dialog))
return QPlatformTheme::FontDialog;
diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp
index fc8b62d75e..88652271af 100644
--- a/src/widgets/dialogs/qfiledialog.cpp
+++ b/src/widgets/dialogs/qfiledialog.cpp
@@ -363,7 +363,7 @@ QFileDialog::QFileDialog(const QFileDialogArgs &args)
QFileDialog::~QFileDialog()
{
#ifndef QT_NO_SETTINGS
- QSettings settings(QSettings::UserScope, QLatin1String("Trolltech"));
+ QSettings settings(QSettings::UserScope, QLatin1String("QtProject"));
settings.beginGroup(QLatin1String("Qt"));
settings.setValue(QLatin1String("filedialog"), saveState());
#endif
@@ -2229,7 +2229,7 @@ void QFileDialogPrivate::init(const QString &directory, const QString &nameFilte
q->setFileMode(QFileDialog::AnyFile);
#ifndef QT_NO_SETTINGS
- QSettings settings(QSettings::UserScope, QLatin1String("Trolltech"));
+ QSettings settings(QSettings::UserScope, QLatin1String("QtProject"));
settings.beginGroup(QLatin1String("Qt"));
if (!directory.isEmpty())
setLastVisitedDirectory(workingDirectory(directory));
diff --git a/src/widgets/dialogs/qmessagebox.cpp b/src/widgets/dialogs/qmessagebox.cpp
index 1bab8b7785..e93850c1b7 100644
--- a/src/widgets/dialogs/qmessagebox.cpp
+++ b/src/widgets/dialogs/qmessagebox.cpp
@@ -240,7 +240,7 @@ void QMessageBoxPrivate::init(const QString &title, const QString &text)
label->setTextInteractionFlags(Qt::TextInteractionFlags(q->style()->styleHint(QStyle::SH_MessageBox_TextInteractionFlags, 0, q)));
label->setAlignment(Qt::AlignVCenter | Qt::AlignLeft);
label->setOpenExternalLinks(true);
-#if defined(Q_WS_MAC)
+#if defined(Q_OS_MAC)
label->setContentsMargins(16, 0, 0, 0);
#else
label->setContentsMargins(2, 0, 0, 0);
@@ -258,7 +258,7 @@ void QMessageBoxPrivate::init(const QString &title, const QString &text)
q, SLOT(_q_buttonClicked(QAbstractButton*)));
QGridLayout *grid = new QGridLayout;
-#ifndef Q_WS_MAC
+#ifndef Q_OS_MAC
grid->addWidget(iconLabel, 0, 0, 2, 1, Qt::AlignTop);
grid->addWidget(label, 0, 1, 1, 1);
// -- leave space for information label --
@@ -285,7 +285,7 @@ void QMessageBoxPrivate::init(const QString &title, const QString &text)
}
q->setModal(true);
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
QFont f = q->font();
f.setBold(true);
label->setFont(f);
@@ -316,7 +316,7 @@ void QMessageBoxPrivate::updateSize()
if (screenSize.width() <= 1024)
hardLimit = screenSize.width();
#endif
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
int softLimit = qMin(screenSize.width()/2, 420);
#else
// note: ideally on windows, hard and soft limits but it breaks compat
@@ -1328,7 +1328,7 @@ void QMessageBox::changeEvent(QEvent *ev)
}
case QEvent::FontChange:
case QEvent::ApplicationFontChange:
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
{
QFont f = font();
f.setBold(true);
@@ -1348,12 +1348,12 @@ void QMessageBox::keyPressEvent(QKeyEvent *e)
{
Q_D(QMessageBox);
if (e->key() == Qt::Key_Escape
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
|| (e->modifiers() == Qt::ControlModifier && e->key() == Qt::Key_Period)
#endif
) {
if (d->detectedEscapeButton) {
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
d->detectedEscapeButton->animateClick();
#else
d->detectedEscapeButton->click();
@@ -1687,7 +1687,7 @@ QMessageBox::StandardButton QMessageBox::critical(QWidget *parent, const QString
*/
void QMessageBox::about(QWidget *parent, const QString &title, const QString &text)
{
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
static QPointer<QMessageBox> oldMsgBox;
if (oldMsgBox && oldMsgBox->text() == text) {
@@ -1699,7 +1699,7 @@ void QMessageBox::about(QWidget *parent, const QString &title, const QString &te
#endif
QMessageBox *msgBox = new QMessageBox(title, text, Information, 0, 0, 0, parent
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
, Qt::WindowTitleHint | Qt::WindowSystemMenuHint
#endif
);
@@ -1709,7 +1709,7 @@ void QMessageBox::about(QWidget *parent, const QString &title, const QString &te
msgBox->setIconPixmap(icon.pixmap(size));
// should perhaps be a style hint
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
oldMsgBox = msgBox;
#if 0
// ### doesn't work until close button is enabled in title bar
@@ -1740,7 +1740,7 @@ void QMessageBox::about(QWidget *parent, const QString &title, const QString &te
*/
void QMessageBox::aboutQt(QWidget *parent, const QString &title)
{
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
static QPointer<QMessageBox> oldMsgBox;
if (oldMsgBox) {
@@ -1802,7 +1802,7 @@ void QMessageBox::aboutQt(QWidget *parent, const QString &title)
#endif
// should perhaps be a style hint
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
oldMsgBox = msgBox;
#if 0
// ### doesn't work until close button is enabled in title bar
@@ -2467,7 +2467,7 @@ void QMessageBox::setInformativeText(const QString &text)
layout()->removeWidget(d->informativeLabel);
delete d->informativeLabel;
d->informativeLabel = 0;
-#ifndef Q_WS_MAC
+#ifndef Q_OS_MAC
d->label->setContentsMargins(2, 0, 0, 0);
#endif
d->updateSize();
@@ -2481,7 +2481,7 @@ void QMessageBox::setInformativeText(const QString &text)
label->setAlignment(Qt::AlignTop | Qt::AlignLeft);
label->setOpenExternalLinks(true);
label->setWordWrap(true);
-#ifndef Q_WS_MAC
+#ifndef Q_OS_MAC
d->label->setContentsMargins(2, 0, 0, 0);
label->setContentsMargins(2, 0, 0, 6);
label->setIndent(9);
@@ -2511,7 +2511,7 @@ void QMessageBox::setInformativeText(const QString &text)
void QMessageBox::setWindowTitle(const QString &title)
{
// Message boxes on the mac do not have a title
-#ifndef Q_WS_MAC
+#ifndef Q_OS_MAC
QDialog::setWindowTitle(title);
#else
Q_UNUSED(title);
diff --git a/src/widgets/dialogs/qwizard.cpp b/src/widgets/dialogs/qwizard.cpp
index 44518ec7d5..241e9f678a 100644
--- a/src/widgets/dialogs/qwizard.cpp
+++ b/src/widgets/dialogs/qwizard.cpp
@@ -916,7 +916,7 @@ QWizardLayoutInfo QWizardPrivate::layoutInfoForCurrentPage()
info.buttonSpacing = 12;
info.wizStyle = wizStyle;
- if ((info.wizStyle == QWizard::AeroStyle)
+ if (info.wizStyle == QWizard::AeroStyle
#if !defined(QT_NO_STYLE_WINDOWSVISTA)
&& (QVistaHelper::vistaState() == QVistaHelper::Classic || vistaDisabled())
#endif
diff --git a/src/widgets/doc/images/dialog-examples.png b/src/widgets/doc/images/dialog-examples.png
new file mode 100644
index 0000000000..26537b5de3
--- /dev/null
+++ b/src/widgets/doc/images/dialog-examples.png
Binary files differ
diff --git a/src/widgets/doc/images/graphicsview-examples.png b/src/widgets/doc/images/graphicsview-examples.png
new file mode 100644
index 0000000000..8889424023
--- /dev/null
+++ b/src/widgets/doc/images/graphicsview-examples.png
Binary files differ
diff --git a/src/widgets/doc/images/itemviews-examples.png b/src/widgets/doc/images/itemviews-examples.png
new file mode 100644
index 0000000000..a151ea857f
--- /dev/null
+++ b/src/widgets/doc/images/itemviews-examples.png
Binary files differ
diff --git a/src/widgets/doc/images/mainwindow-examples.png b/src/widgets/doc/images/mainwindow-examples.png
new file mode 100644
index 0000000000..3e946a68bf
--- /dev/null
+++ b/src/widgets/doc/images/mainwindow-examples.png
Binary files differ
diff --git a/src/widgets/doc/qtwidgets.qdocconf b/src/widgets/doc/qtwidgets.qdocconf
index 0e4ea0351b..062adc7f7c 100644
--- a/src/widgets/doc/qtwidgets.qdocconf
+++ b/src/widgets/doc/qtwidgets.qdocconf
@@ -3,21 +3,21 @@ include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf)
project = QtWidgets
description = Qt Widgets Reference Documentation
url = http://qt-project.org/doc/qtwidgets
-version = 5.0.0
+version = 5.0.1
examplesinstallpath = widgets
qhp.projects = QtWidgets
qhp.QtWidgets.file = qtwidgets.qhp
-qhp.QtWidgets.namespace = org.qt-project.qtwidgets.500
+qhp.QtWidgets.namespace = org.qt-project.qtwidgets.501
qhp.QtWidgets.virtualFolder = qtwidgets
qhp.QtWidgets.indexTitle = Qt Widgets
qhp.QtWidgets.indexRoot =
-qhp.QtWidgets.filterAttributes = qtwidgets 5.0.0 qtrefdoc
-qhp.QtWidgets.customFilters.Qt.name = QtWidgets 5.0.0
-qhp.QtWidgets.customFilters.Qt.filterAttributes = qtwidgets 5.0.0
+qhp.QtWidgets.filterAttributes = qtwidgets 5.0.1 qtrefdoc
+qhp.QtWidgets.customFilters.Qt.name = QtWidgets 5.0.1
+qhp.QtWidgets.customFilters.Qt.filterAttributes = qtwidgets 5.0.1
qhp.QtWidgets.subprojects = classes
qhp.QtWidgets.subprojects.classes.title = C++ Classes
@@ -27,7 +27,7 @@ qhp.QtWidgets.subprojects.classes.sortPages = true
tagfile = ../../../doc/qtwidgets/qtwidgets.tags
-depends += qtcore qtgui qtdoc qtsql
+depends += qtcore qtgui qtdoc qtsql qtdesigner
headerdirs += ..
diff --git a/src/widgets/doc/snippets/code/src_gui_kernel_qapplication.cpp b/src/widgets/doc/snippets/code/src_gui_kernel_qapplication.cpp
index aa562078a6..b4b1eb5a00 100644
--- a/src/widgets/doc/snippets/code/src_gui_kernel_qapplication.cpp
+++ b/src/widgets/doc/snippets/code/src_gui_kernel_qapplication.cpp
@@ -39,23 +39,25 @@
****************************************************************************/
//! [0]
-int main(int argc, char **argv)
+QCoreApplication* createApplication(int &argc, char *argv[])
{
-#ifdef Q_WS_X11
- bool useGUI = getenv("DISPLAY") != 0;
-#else
- bool useGUI = true;
-#endif
- QApplication app(argc, argv, useGUI);
-
- if (useGUI) {
- // start GUI version
- ...
+ for (int i = 1; i < argc; ++i)
+ if (!qstrcmp(argv[i], "-no-gui"))
+ return new QCoreApplication(argc, argv);
+ return new QApplication(argc, argv);
+}
+
+int main(int argc, char* argv[])
+{
+ QScopedPointer<QCoreApplication> app(createApplication(argc, argv));
+
+ if (qobject_cast<QApplication *>(app.data())) {
+ // start GUI version...
} else {
- // start non-GUI version
- ...
+ // start non-GUI version...
}
- return app.exec();
+
+ return app->exec();
}
//! [0]
diff --git a/src/widgets/doc/src/model-view-programming.qdoc b/src/widgets/doc/src/model-view-programming.qdoc
index 804c91cea4..c665a8dba6 100644
--- a/src/widgets/doc/src/model-view-programming.qdoc
+++ b/src/widgets/doc/src/model-view-programming.qdoc
@@ -1943,9 +1943,6 @@
other components and applications can understand.
\endlist
- For more information, see the \l
- {"Item View Classes" Chapter of C++ GUI Programming with Qt 4}.
-
\section2 Item data handling
Models can provide varying levels of access to the data they provide: They can be
diff --git a/src/widgets/doc/src/qtwidgets-examples.qdoc b/src/widgets/doc/src/qtwidgets-examples.qdoc
index b321942a70..6d00a0b067 100644
--- a/src/widgets/doc/src/qtwidgets-examples.qdoc
+++ b/src/widgets/doc/src/qtwidgets-examples.qdoc
@@ -95,3 +95,73 @@
*/
+/*!
+ \group examples-dialogs
+ \ingroup all-examples
+ \title Dialog Examples
+ \brief Using Qt's standard dialogs and building and using custom dialogs.
+
+ \image dialog-examples.png
+
+ Qt includes standard dialogs for many common operations, such as file
+ selection, printing, and color selection.
+
+ Custom dialogs can also be created for specialized modal or modeless
+ interactions with users.
+*/
+
+/*!
+ \ingroup all-examples
+ \title Itemview Examples
+ \brief Using the model/view framework.
+ \group examples-itemviews
+
+ \image itemviews-examples.png
+
+ Qt provides a lot of capabalities to display pre- and user-defined item models
+ in different ways.
+ The separation of functionality introduced by the model/view architecture gives
+ developers greater flexibility to customize the presentation of items.
+
+*/
+
+/*!
+ \ingroup all-examples
+ \title Graphicsview Examples
+ \brief Using the Graphics View framework.
+ \page examples-graphicsview.html
+
+ \image graphicsview-examples.png
+
+ Qt provides powerful graphics engine that supports easy visualization of items, with
+ support for rotation and zooming.
+ Additionally it provides an event propagation architecture for interaction.
+
+ These examples demonstrate the fundamental aspects of canvas programming with Qt.
+
+ \annotatedlist{examples-graphicsview}
+
+ These examples show the use of graphics widgets and layouts.
+
+ \annotatedlist{examples-graphicsview-layout}
+
+ Some examples demonstrate the use of graphics effects with canvas items.
+
+ \annotatedlist{examples-graphicsview-graphicseffects}
+*/
+
+/*!
+ \group examples-mainwindow
+ \ingroup all-examples
+ \title Main Window Examples
+ \brief Building applications around a main window.
+
+ \image mainwindow-examples.png
+
+ All the standard features of application main windows are provided by Qt.
+
+ Main windows can have pull down menus, tool bars, and dock windows. These
+ separate forms of user input are unified in an integrated action system that
+ also supports keyboard shortcuts and accelerator keys in menu items.
+
+*/
diff --git a/src/widgets/doc/src/widgets-and-layouts/styles.qdoc b/src/widgets/doc/src/widgets-and-layouts/styles.qdoc
index 0154b2c9f6..51812ec9fe 100644
--- a/src/widgets/doc/src/widgets-and-layouts/styles.qdoc
+++ b/src/widgets/doc/src/widgets-and-layouts/styles.qdoc
@@ -1632,7 +1632,7 @@
toolbars with equal orientation (vertical or horizontal) placed
next to each other.
- \l{QToolbar}{QToolbar}s in Qt consist of three elements:
+ \l{QToolBar}{Toolbars} in Qt consist of three elements:
\c CE_ToolBar, \c PE_IndicatorToolBarHandle, and
\c PE_IndicatorToolBarSeparator. It is QMainWindowLayout that
calculates the bounding rectangles (i.e., position and size of the
@@ -1647,7 +1647,7 @@
The dotted lines indicate that the QToolBar keeps an instance of
QToolBarLayout and that QToolBarSeparators are kept by
QToolBarLayout. When the toolbar is floating (i.e., has its own
- window) the \c PE_FrameMenu element is drawn, else QToolbar draws
+ window) the \c PE_FrameMenu element is drawn, else QToolBar draws
\c CE_ToolBar.
Here is an image of a toolbar in the Java style:
diff --git a/src/widgets/doc/src/widgets-and-layouts/stylesheet.qdoc b/src/widgets/doc/src/widgets-and-layouts/stylesheet.qdoc
index b160a22e48..2d9d5bba33 100644
--- a/src/widgets/doc/src/widgets-and-layouts/stylesheet.qdoc
+++ b/src/widgets/doc/src/widgets-and-layouts/stylesheet.qdoc
@@ -138,8 +138,8 @@
/*!
\page stylesheet-syntax.html
- \contentspage {Qt Style Sheet}{Contents}
- \previouspage Qt Style Sheet
+ \contentspage {Qt Style Sheets}{Contents}
+ \previouspage Qt Style Sheets
\nextpage Qt Designer Integration
\title The Style Sheet Syntax
@@ -543,7 +543,7 @@
/*!
\page stylesheet-designer.html
- \contentspage {Qt Style Sheet}{Contents}
+ \contentspage {Qt Style Sheets}{Contents}
\previouspage The Style Sheet Syntax
\nextpage Customizing Qt Widgets Using Style Sheets
\title Qt Designer Integration
@@ -569,7 +569,7 @@
/*!
\page stylesheet-customizing.html
- \contentspage {Qt Style Sheet}{Contents}
+ \contentspage {Qt Style Sheets}{Contents}
\previouspage Qt Designer Integration
\nextpage Qt Style Sheets Reference
\title Customizing Qt Widgets Using Style Sheets
@@ -673,7 +673,7 @@
/*!
\page stylesheet-reference.html
- \contentspage {Qt Style Sheet}{Contents}
+ \contentspage {Qt Style Sheets}{Contents}
\previouspage Customizing Qt Widgets Using Style Sheets
\nextpage Qt Style Sheets Examples
\title Qt Style Sheets Reference
@@ -1754,7 +1754,7 @@
\li \b{\c bottom} \target bottom-prop
\li \l{#Length}{Length}
\li If \l{#position-prop}{position} is \c relative (the
- default), moves a \l{subcontrol} by a certain offset up;
+ default), moves a subcontrol by a certain offset up;
specifying \tt{bottom: \e{y}} is then equivalent to
specifying \tt{\l{Qt Style Sheets Reference#top-prop}{top}: -\e{y}}.
@@ -1906,7 +1906,7 @@
\row
\li \b{\c height} \target height-prop
\li \l{#Length}{Length}
- \li The height of a \l{subcontrol} (or in some case, a widget).
+ \li The height of a subcontrol (or in some case, a widget).
If this property is not specified, it defaults to a value
that depends on the subcontrol/widget and on the current style.
@@ -1944,7 +1944,7 @@
\li \b{\c image}* \target image-prop
\li \l{#Url}{Url}+
\li The image that is drawn in the contents rectangle of a
- \l{subcontrol}.
+ subcontrol.
The image property accepts a list of \l{#Url}{Url}s or
an \c{svg}. The actual image that is drawn is determined
@@ -1959,7 +1959,7 @@
image within the rectangle can be specified using
\l{image-position-prop}{image-position}.
- This property is for \l{subcontrol}s only--we don't support it for
+ This property is for subcontrols only--we don't support it for
other elements.
\warning The QIcon SVG plugin is needed to render SVG images.
@@ -1978,7 +1978,7 @@
\li \b{\c left} \target left-prop
\li \l{#Length}{Length}
\li If \l{#position-prop}{position} is \c relative (the
- default), moves a \l{subcontrol} by a certain offset to
+ default), moves a subcontrol by a certain offset to
the right.
If \l{#position-prop}{position} is \c absolute, the \c
@@ -2232,7 +2232,7 @@
\li \b{\c right} \target right-prop
\li \l{#Length}{Length}
\li If \l{#position-prop}{position} is \c relative (the
- default), moves a \l{subcontrol} by a certain offset to
+ default), moves a subcontrol by a certain offset to
the left; specifying \tt{right: \e{x}} is then equivalent
to specifying \tt{\l{Qt Style Sheets Reference#left-prop}{left}: -\e{x}}.
@@ -2323,7 +2323,7 @@
\row
\li \b{\c subcontrol-origin*} \target subcontrol-origin-prop
\li \l{#Origin}{Origin}
- \li The origin rectangle of the \l subcontrol within the
+ \li The origin rectangle of the subcontrol within the
parent element.
If this property is not specified, the default is \c
@@ -2339,7 +2339,7 @@
\row
\li \b{\c subcontrol-position*} \target subcontrol-position-prop
\li \l{#Alignment}{Alignment}
- \li The alignment of the \l subcontrol within the origin
+ \li The alignment of the subcontrol within the origin
rectangle specified by \l{Qt Style Sheets Reference#subcontrol-origin-prop}
{subcontrol-origin}.
@@ -2380,7 +2380,7 @@
\li \b{\c top} \target top-prop
\li \l{#Length}{Length}
\li If \l{#position-prop}{position} is \c relative (the
- default), moves a \l{subcontrol} by a certain offset
+ default), moves a subcontrol by a certain offset
down.
If \l{#position-prop}{position} is \c absolute, the \c top
@@ -2400,7 +2400,7 @@
\row
\li \b{\c width} \target width-prop
\li \l{#Length}{Length}
- \li The width of a \l{subcontrol} (or a widget in some cases).
+ \li The width of a subcontrol (or a widget in some cases).
If this property is not specified, it defaults to a value
that depends on the subcontrol/widget and on the current style.
@@ -3358,7 +3358,7 @@
/*!
\page stylesheet-examples.html
- \contentspage {Qt Style Sheet}{Contents}
+ \contentspage {Qt Style Sheets}{Contents}
\previouspage Qt Style Sheets Reference
\title Qt Style Sheets Examples
diff --git a/src/widgets/graphicsview/qgraphicsitem.cpp b/src/widgets/graphicsview/qgraphicsitem.cpp
index 48430e60db..f76e89f1a0 100644
--- a/src/widgets/graphicsview/qgraphicsitem.cpp
+++ b/src/widgets/graphicsview/qgraphicsitem.cpp
@@ -1436,6 +1436,7 @@ QGraphicsItem::~QGraphicsItem()
#endif
clearFocus();
+ setFocusProxy(0);
// Update focus scope item ptr.
QGraphicsItem *p = d_ptr->parent;
@@ -1771,24 +1772,6 @@ void QGraphicsItem::setFlag(GraphicsItemFlag flag, bool enabled)
}
/*!
- \internal
-
- Sets the flag \a flag on \a item and all its children, to \a enabled.
-*/
-static void _q_qgraphicsItemSetFlag(QGraphicsItem *item, QGraphicsItem::GraphicsItemFlag flag,
- bool enabled)
-{
- if (item->flags() & flag) {
- // If this item already has the correct flag set, we don't have to
- // propagate it.
- return;
- }
- item->setFlag(flag, enabled);
- foreach (QGraphicsItem *child, item->childItems())
- _q_qgraphicsItemSetFlag(child, flag, enabled);
-}
-
-/*!
Sets the item flags to \a flags. All flags in \a flags are enabled; all
flags not in \a flags are disabled.
@@ -3348,6 +3331,12 @@ void QGraphicsItem::clearFocus()
*/
void QGraphicsItemPrivate::clearFocusHelper(bool giveFocusToParent, bool hiddenByParentPanel)
{
+ QGraphicsItem *subFocusItem = q_ptr;
+ if (flags & QGraphicsItem::ItemIsFocusScope) {
+ while (subFocusItem->d_ptr->focusScopeItem)
+ subFocusItem = subFocusItem->d_ptr->focusScopeItem;
+ }
+
if (giveFocusToParent) {
// Pass focus to the closest parent focus scope
if (!inDestructor) {
@@ -3356,10 +3345,10 @@ void QGraphicsItemPrivate::clearFocusHelper(bool giveFocusToParent, bool hiddenB
if (p->flags() & QGraphicsItem::ItemIsFocusScope) {
if (p->d_ptr->focusScopeItem == q_ptr) {
p->d_ptr->focusScopeItem = 0;
- if (!q_ptr->hasFocus()) //if it has focus, focusScopeItemChange is called elsewhere
+ if (!subFocusItem->hasFocus()) //if it has focus, focusScopeItemChange is called elsewhere
focusScopeItemChange(false);
}
- if (q_ptr->hasFocus())
+ if (subFocusItem->hasFocus())
p->d_ptr->setFocusHelper(Qt::OtherFocusReason, /* climb = */ false,
/* focusFromHide = */ false);
return;
@@ -3369,7 +3358,7 @@ void QGraphicsItemPrivate::clearFocusHelper(bool giveFocusToParent, bool hiddenB
}
}
- if (q_ptr->hasFocus()) {
+ if (subFocusItem->hasFocus()) {
// Invisible items with focus must explicitly clear subfocus.
if (!hiddenByParentPanel)
clearSubFocus(q_ptr);
diff --git a/src/widgets/graphicsview/qgraphicsview.cpp b/src/widgets/graphicsview/qgraphicsview.cpp
index 2012f980db..a1ee562807 100644
--- a/src/widgets/graphicsview/qgraphicsview.cpp
+++ b/src/widgets/graphicsview/qgraphicsview.cpp
@@ -616,6 +616,10 @@ void QGraphicsViewPrivate::mouseMoveEventHandler(QMouseEvent *event)
{
Q_Q(QGraphicsView);
+#ifndef QT_NO_RUBBERBAND
+ updateRubberBand(event);
+#endif
+
storeMouseEvent(event);
lastMouseEvent.setAccepted(false);
@@ -701,6 +705,58 @@ QRegion QGraphicsViewPrivate::rubberBandRegion(const QWidget *widget, const QRec
tmp &= mask.region;
return tmp;
}
+
+void QGraphicsViewPrivate::updateRubberBand(QMouseEvent *event)
+{
+ Q_Q(QGraphicsView);
+ if (dragMode == QGraphicsView::RubberBandDrag && sceneInteractionAllowed) {
+ storeMouseEvent(event);
+ if (rubberBanding) {
+ // Check for enough drag distance
+ if ((mousePressViewPoint - event->pos()).manhattanLength()
+ < QApplication::startDragDistance()) {
+ return;
+ }
+
+ // Update old rubberband
+ if (viewportUpdateMode != QGraphicsView::NoViewportUpdate && !rubberBandRect.isEmpty()) {
+ if (viewportUpdateMode != QGraphicsView::FullViewportUpdate)
+ q->viewport()->update(rubberBandRegion(q->viewport(), rubberBandRect));
+ else
+ updateAll();
+ }
+
+ // Stop rubber banding if the user has let go of all buttons (even
+ // if we didn't get the release events).
+ if (!event->buttons()) {
+ rubberBanding = false;
+ rubberBandRect = QRect();
+ return;
+ }
+
+ // Update rubberband position
+ const QPoint mp = q->mapFromScene(mousePressScenePoint);
+ const QPoint ep = event->pos();
+ rubberBandRect = QRect(qMin(mp.x(), ep.x()), qMin(mp.y(), ep.y()),
+ qAbs(mp.x() - ep.x()) + 1, qAbs(mp.y() - ep.y()) + 1);
+
+ // Update new rubberband
+ if (viewportUpdateMode != QGraphicsView::NoViewportUpdate){
+ if (viewportUpdateMode != QGraphicsView::FullViewportUpdate)
+ q->viewport()->update(rubberBandRegion(q->viewport(), rubberBandRect));
+ else
+ updateAll();
+ }
+ // Set the new selection area
+ QPainterPath selectionArea;
+ selectionArea.addPolygon(mapToScene(rubberBandRect));
+ selectionArea.closeSubpath();
+ if (scene)
+ scene->setSelectionArea(selectionArea, rubberBandSelectionMode,
+ q->viewportTransform());
+ }
+ }
+}
#endif
/*!
@@ -3211,56 +3267,6 @@ void QGraphicsView::mouseMoveEvent(QMouseEvent *event)
{
Q_D(QGraphicsView);
-#ifndef QT_NO_RUBBERBAND
- if (d->dragMode == QGraphicsView::RubberBandDrag && d->sceneInteractionAllowed) {
- d->storeMouseEvent(event);
- if (d->rubberBanding) {
- // Check for enough drag distance
- if ((d->mousePressViewPoint - event->pos()).manhattanLength()
- < QApplication::startDragDistance()) {
- return;
- }
-
- // Update old rubberband
- if (d->viewportUpdateMode != QGraphicsView::NoViewportUpdate && !d->rubberBandRect.isEmpty()) {
- if (d->viewportUpdateMode != FullViewportUpdate)
- viewport()->update(d->rubberBandRegion(viewport(), d->rubberBandRect));
- else
- d->updateAll();
- }
-
- // Stop rubber banding if the user has let go of all buttons (even
- // if we didn't get the release events).
- if (!event->buttons()) {
- d->rubberBanding = false;
- d->rubberBandRect = QRect();
- return;
- }
-
- // Update rubberband position
- const QPoint &mp = mapFromScene(d->mousePressScenePoint);
- QPoint ep = event->pos();
- d->rubberBandRect = QRect(qMin(mp.x(), ep.x()), qMin(mp.y(), ep.y()),
- qAbs(mp.x() - ep.x()) + 1, qAbs(mp.y() - ep.y()) + 1);
-
- // Update new rubberband
- if (d->viewportUpdateMode != QGraphicsView::NoViewportUpdate){
- if (d->viewportUpdateMode != FullViewportUpdate)
- viewport()->update(d->rubberBandRegion(viewport(), d->rubberBandRect));
- else
- d->updateAll();
- }
- // Set the new selection area
- QPainterPath selectionArea;
- selectionArea.addPolygon(mapToScene(d->rubberBandRect));
- selectionArea.closeSubpath();
- if (d->scene)
- d->scene->setSelectionArea(selectionArea, d->rubberBandSelectionMode,
- viewportTransform());
- return;
- }
- } else
-#endif // QT_NO_RUBBERBAND
if (d->dragMode == QGraphicsView::ScrollHandDrag) {
if (d->handScrolling) {
QScrollBar *hBar = horizontalScrollBar();
diff --git a/src/widgets/graphicsview/qgraphicsview_p.h b/src/widgets/graphicsview/qgraphicsview_p.h
index 6b15fb61f2..bb6b44af19 100644
--- a/src/widgets/graphicsview/qgraphicsview_p.h
+++ b/src/widgets/graphicsview/qgraphicsview_p.h
@@ -138,6 +138,7 @@ public:
#ifndef QT_NO_RUBBERBAND
QRect rubberBandRect;
QRegion rubberBandRegion(const QWidget *widget, const QRect &rect) const;
+ void updateRubberBand(QMouseEvent *event);
bool rubberBanding;
Qt::ItemSelectionMode rubberBandSelectionMode;
#endif
diff --git a/src/widgets/itemviews/qabstractitemview.cpp b/src/widgets/itemviews/qabstractitemview.cpp
index ab98bf6438..cb466dfb4b 100644
--- a/src/widgets/itemviews/qabstractitemview.cpp
+++ b/src/widgets/itemviews/qabstractitemview.cpp
@@ -65,7 +65,7 @@
#include <qaccessible.h>
#include <qaccessible2.h>
#endif
-#ifndef QT_NO_GESTURE
+#ifndef QT_NO_GESTURES
# include <qscroller.h>
#endif
diff --git a/src/widgets/itemviews/qlistview.cpp b/src/widgets/itemviews/qlistview.cpp
index e43eda8621..13627b42ac 100644
--- a/src/widgets/itemviews/qlistview.cpp
+++ b/src/widgets/itemviews/qlistview.cpp
@@ -108,10 +108,10 @@ QT_BEGIN_NAMESPACE
be rendered as large or small icons depending on their iconSize().
\table 100%
- \row \li \inlineimage windowsxp-listview.png Screenshot of a Windows XP style list view
+ \row \li \inlineimage windowsvista-listview.png Screenshot of a Windows Vista style list view
\li \inlineimage macintosh-listview.png Screenshot of a Macintosh style table view
\li \inlineimage fusion-listview.png Screenshot of a Fusion style table view
- \row \li A \l{Windows XP Style Widget Gallery}{Windows XP style} list view.
+ \row \li A \l{Windows Vista Style Widget Gallery}{Windows Vista style} list view.
\li A \l{Macintosh Style Widget Gallery}{Macintosh style} list view.
\li A \l{Fusion Style Widget Gallery}{Fusion style} list view.
\endtable
diff --git a/src/widgets/itemviews/qlistwidget.cpp b/src/widgets/itemviews/qlistwidget.cpp
index 766c8e5cc7..183c3538c9 100644
--- a/src/widgets/itemviews/qlistwidget.cpp
+++ b/src/widgets/itemviews/qlistwidget.cpp
@@ -1189,10 +1189,10 @@ void QListWidgetPrivate::_q_dataChanged(const QModelIndex &topLeft,
new current item and the item that was previously current.
\table 100%
- \row \li \inlineimage windowsxp-listview.png Screenshot of a Windows XP style list widget
+ \row \li \inlineimage windowsvista-listview.png Screenshot of a Windows Vista style list widget
\li \inlineimage macintosh-listview.png Screenshot of a Macintosh style table widget
\li \inlineimage fusion-listview.png Screenshot of a Fusion style table widget
- \row \li A \l{Windows XP Style Widget Gallery}{Windows XP style} list widget.
+ \row \li A \l{Windows Vista Style Widget Gallery}{Windows Vista style} list widget.
\li A \l{Macintosh Style Widget Gallery}{Macintosh style} list widget.
\li A \l{Fusion Style Widget Gallery}{Fusion style} list widget.
\endtable
diff --git a/src/widgets/itemviews/qtableview.cpp b/src/widgets/itemviews/qtableview.cpp
index e010c6977e..e84325c730 100644
--- a/src/widgets/itemviews/qtableview.cpp
+++ b/src/widgets/itemviews/qtableview.cpp
@@ -1011,10 +1011,10 @@ void QTableViewPrivate::drawCell(QPainter *painter, const QStyleOptionViewItem &
its appearance in other styles.
\table 100%
- \row \li \inlineimage windowsxp-tableview.png Screenshot of a Windows XP style table view
+ \row \li \inlineimage windowsvista-tableview.png Screenshot of a Windows Vista style table view
\li \inlineimage macintosh-tableview.png Screenshot of a Macintosh style table view
\li \inlineimage fusion-tableview.png Screenshot of a Fusion style table view
- \row \li A \l{Windows XP Style Widget Gallery}{Windows XP style} table view.
+ \row \li A \l{Windows Vista Style Widget Gallery}{Windows Vista style} table view.
\li A \l{Macintosh Style Widget Gallery}{Macintosh style} table view.
\li A \l{Fusion Style Widget Gallery}{Fusion style} table view.
\endtable
diff --git a/src/widgets/itemviews/qtablewidget.cpp b/src/widgets/itemviews/qtablewidget.cpp
index 900af0872a..9793639d74 100644
--- a/src/widgets/itemviews/qtablewidget.cpp
+++ b/src/widgets/itemviews/qtablewidget.cpp
@@ -1539,10 +1539,10 @@ QTableWidgetItem &QTableWidgetItem::operator=(const QTableWidgetItem &other)
clear() function.
\table 100%
- \row \li \inlineimage windowsxp-tableview.png Screenshot of a Windows XP style table widget
+ \row \li \inlineimage windowsvista-tableview.png Screenshot of a Windows Vista style table widget
\li \inlineimage macintosh-tableview.png Screenshot of a Macintosh style table widget
\li \inlineimage fusion-tableview.png Screenshot of a Fusion style table widget
- \row \li A \l{Windows XP Style Widget Gallery}{Windows XP style} table widget.
+ \row \li A \l{Windows Vista Style Widget Gallery}{Windows Vista style} table widget.
\li A \l{Macintosh Style Widget Gallery}{Macintosh style} table widget.
\li A \l{Fusion Style Widget Gallery}{Fusion style} table widget.
\endtable
diff --git a/src/widgets/itemviews/qtreeview.cpp b/src/widgets/itemviews/qtreeview.cpp
index fe34d3de6a..194fb71880 100644
--- a/src/widgets/itemviews/qtreeview.cpp
+++ b/src/widgets/itemviews/qtreeview.cpp
@@ -146,10 +146,10 @@ QT_BEGIN_NAMESPACE
\endomit
\table 100%
- \row \li \inlineimage windowsxp-treeview.png Screenshot of a Windows XP style tree view
+ \row \li \inlineimage windowsvista-treeview.png Screenshot of a Windows Vista style tree view
\li \inlineimage macintosh-treeview.png Screenshot of a Macintosh style tree view
\li \inlineimage fusion-treeview.png Screenshot of a Fusion style tree view
- \row \li A \l{Windows XP Style Widget Gallery}{Windows XP style} tree view.
+ \row \li A \l{Windows Vista Style Widget Gallery}{Windows Vista style} tree view.
\li A \l{Macintosh Style Widget Gallery}{Macintosh style} tree view.
\li A \l{Fusion Style Widget Gallery}{Fusion style} tree view.
\endtable
@@ -876,7 +876,7 @@ bool QTreeView::isSortingEnabled() const
\brief whether animations are enabled
If this property is true the treeview will animate expandsion
- and collasping of branches. If this property is false, the treeview
+ and collapsing of branches. If this property is false, the treeview
will expand or collapse branches immediately without showing
the animation.
@@ -3743,7 +3743,7 @@ void QTreeView::currentChanged(const QModelIndex &current, const QModelIndex &pr
}
#ifndef QT_NO_ACCESSIBILITY
if (QAccessible::isActive() && current.isValid()) {
- int entry = (visualIndex(current) + (header()?1:0))*current.model()->columnCount()+current.column() + 1;
+ int entry = (visualIndex(current) + (header()?1:0))*current.model()->columnCount()+current.column();
QAccessibleEvent event(this, QAccessible::Focus);
event.setChild(entry);
QAccessible::updateAccessibility(&event);
@@ -3763,16 +3763,16 @@ void QTreeView::selectionChanged(const QItemSelection &selected,
// ### does not work properly for selection ranges.
QModelIndex sel = selected.indexes().value(0);
if (sel.isValid()) {
- int entry = (visualIndex(sel) + (header()?1:0))*sel.model()->columnCount()+sel.column() + 1;
- Q_ASSERT(entry > 0);
+ int entry = (visualIndex(sel) + (header()?1:0))*sel.model()->columnCount()+sel.column();
+ Q_ASSERT(entry >= 0);
QAccessibleEvent event(this, QAccessible::Selection);
event.setChild(entry);
QAccessible::updateAccessibility(&event);
}
QModelIndex desel = deselected.indexes().value(0);
if (desel.isValid()) {
- int entry = (visualIndex(desel) + (header()?1:0))*desel.model()->columnCount()+desel.column() + 1;
- Q_ASSERT(entry > 0);
+ int entry = (visualIndex(desel) + (header()?1:0))*desel.model()->columnCount()+desel.column();
+ Q_ASSERT(entry >= 0);
QAccessibleEvent event(this, QAccessible::SelectionRemove);
event.setChild(entry);
QAccessible::updateAccessibility(&event);
diff --git a/src/widgets/itemviews/qtreewidget.cpp b/src/widgets/itemviews/qtreewidget.cpp
index a2eb28e213..c4b71fd05f 100644
--- a/src/widgets/itemviews/qtreewidget.cpp
+++ b/src/widgets/itemviews/qtreewidget.cpp
@@ -2379,10 +2379,10 @@ void QTreeWidgetPrivate::_q_dataChanged(const QModelIndex &topLeft,
whether sorting is enabled.
\table 100%
- \row \li \inlineimage windowsxp-treeview.png Screenshot of a Windows XP style tree widget
+ \row \li \inlineimage windowsvista-treeview.png Screenshot of a Windows Vista style tree widget
\li \inlineimage macintosh-treeview.png Screenshot of a Macintosh style tree widget
\li \inlineimage fusion-treeview.png Screenshot of a Fusion style tree widget
- \row \li A \l{Windows XP Style Widget Gallery}{Windows XP style} tree widget.
+ \row \li A \l{Windows Vista Style Widget Gallery}{Windows Vista style} tree widget.
\li A \l{Macintosh Style Widget Gallery}{Macintosh style} tree widget.
\li A \l{Fusion Style Widget Gallery}{Fusion style} tree widget.
\endtable
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp
index 80912ff409..9d3c5f8616 100644
--- a/src/widgets/kernel/qapplication.cpp
+++ b/src/widgets/kernel/qapplication.cpp
@@ -41,7 +41,6 @@
#include "qplatformdefs.h"
#include "qabstracteventdispatcher.h"
-#include "qaccessible.h"
#include "qapplication.h"
#include "qclipboard.h"
#include "qcursor.h"
@@ -190,6 +189,15 @@ QApplicationPrivate::~QApplicationPrivate()
any given time. For non-QWidget based Qt applications, use QGuiApplication instead,
as it does not depend on the \l QtWidgets library.
+ Some GUI applications provide a special batch mode ie. provide command line
+ arguments for executing tasks without manual intervention. In such non-GUI
+ mode, it is often sufficient to instantiate a plain QCoreApplication to
+ avoid unnecessarily initializing resources needed for a graphical user
+ interface. The following example shows how to dynamically create an
+ appropriate type of application instance:
+
+ \snippet code/src_gui_kernel_qapplication.cpp 0
+
The QApplication object is accessible through the instance() function that
returns a pointer equivalent to the global qApp pointer.
@@ -2653,9 +2661,6 @@ int QApplication::startDragDistance()
*/
int QApplication::exec()
{
-#ifndef QT_NO_ACCESSIBILITY
- QAccessible::setRootObject(qApp);
-#endif
return QGuiApplication::exec();
}
diff --git a/src/widgets/kernel/qapplication.h b/src/widgets/kernel/qapplication.h
index 8a7cb24539..5800ca48b0 100644
--- a/src/widgets/kernel/qapplication.h
+++ b/src/widgets/kernel/qapplication.h
@@ -50,6 +50,9 @@
#ifdef QT_INCLUDE_COMPAT
# include <QtWidgets/qdesktopwidget.h>
#endif
+#ifdef Q_NO_USING_KEYWORD
+#include <QtGui/qpalette.h>
+#endif
#include <QtGui/qguiapplication.h>
QT_BEGIN_HEADER
diff --git a/src/widgets/kernel/qapplication_qpa.cpp b/src/widgets/kernel/qapplication_qpa.cpp
index 21bc9506d4..3568e49ccd 100644
--- a/src/widgets/kernel/qapplication_qpa.cpp
+++ b/src/widgets/kernel/qapplication_qpa.cpp
@@ -421,8 +421,11 @@ void qt_init(QApplicationPrivate *priv, int type)
QColormap::initialize();
+#ifndef QT_NO_TOOLTIP
if (const QPalette *toolTipPalette = QGuiApplicationPrivate::platformTheme()->palette(QPlatformTheme::ToolTipPalette))
QToolTip::setPalette(*toolTipPalette);
+#endif
+
QApplicationPrivate::initializeWidgetFontHash();
}
diff --git a/src/widgets/kernel/qformlayout.cpp b/src/widgets/kernel/qformlayout.cpp
index f875de16df..05f03dc97a 100644
--- a/src/widgets/kernel/qformlayout.cpp
+++ b/src/widgets/kernel/qformlayout.cpp
@@ -1022,7 +1022,7 @@ QStyle* QFormLayoutPrivate::getStyle() const
\li \b{Adherence to the different platform's look and feel guidelines.}
For example, the
- \l{Mac OS X Aqua} and KDE guidelines specify that the
+ \l{https://developer.apple.com/library/mac/#documentation/UserExperience/Conceptual/AppleHIGuidelines/Intro/Intro.html}{Mac OS X Aqua} and KDE guidelines specify that the
labels should be right-aligned, whereas Windows and GNOME
applications normally use left-alignment.
@@ -1065,7 +1065,7 @@ QStyle* QFormLayoutPrivate::getStyle() const
corresponds to what we would get using a two-column
QGridLayout.)
\li Style based on the
- \l{Mac OS X Aqua} guidelines. Labels are right-aligned,
+ \l{https://developer.apple.com/library/mac/#documentation/UserExperience/Conceptual/AppleHIGuidelines/Intro/Intro.html}{Mac OS X Aqua} guidelines. Labels are right-aligned,
the fields don't grow beyond their size hint, and the
form is horizontally centered.
\li Recommended style for
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index 55326e2ef9..ecf73ee777 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -3069,11 +3069,13 @@ void QWidgetPrivate::setEnabled_helper(bool enable)
qt_x11_enforce_cursor(q);
}
#endif
+#ifndef QT_NO_CURSOR
if (q->testAttribute(Qt::WA_SetCursor) || q->isWindow()) {
// enforce the windows behavior of clearing the cursor on
// disabled widgets
qt_qpa_set_cursor(q, false);
}
+#endif
#if defined(Q_WS_MAC)
setEnabled_helper_sys(enable);
#endif
@@ -5472,18 +5474,6 @@ void QWidget::unsetLocale()
d->resolveLocale();
}
-static QString constructWindowTitleFromFilePath(const QString &filePath)
-{
- QFileInfo fi(filePath);
- QString windowTitle = fi.fileName() + QLatin1String("[*]");
-#ifndef Q_WS_MAC
- QString appName = QApplication::applicationName();
- if (!appName.isEmpty())
- windowTitle += QLatin1Char(' ') + QChar(0x2014) + QLatin1Char(' ') + appName;
-#endif
- return windowTitle;
-}
-
/*!
\property QWidget::windowTitle
\brief the window title (caption)
@@ -5500,6 +5490,11 @@ static QString constructWindowTitleFromFilePath(const QString &filePath)
windowModified property is false (the default), the placeholder
is simply removed.
+ On some desktop platforms (including Windows and Unix), the application name
+ (from QGuiApplication::applicationDisplayName) is added at the end of the
+ window title, if set. This is done by the QPA plugin, so it is shown to the
+ user, but isn't part of the \l windowTitle string.
+
\sa windowIcon, windowIconText, windowModified, windowFilePath
*/
QString QWidget::windowTitle() const
@@ -5509,7 +5504,7 @@ QString QWidget::windowTitle() const
if (!d->extra->topextra->caption.isEmpty())
return d->extra->topextra->caption;
if (!d->extra->topextra->filePath.isEmpty())
- return constructWindowTitleFromFilePath(d->extra->topextra->filePath);
+ return QFileInfo(d->extra->topextra->filePath).fileName() + QLatin1String("[*]");
}
return QString();
}
@@ -5681,24 +5676,8 @@ QString QWidget::windowIconText() const
This property only makes sense for windows. It associates a file path with
a window. If you set the file path, but have not set the window title, Qt
- sets the window title to contain a string created using the following
- components.
-
- On Mac OS X:
-
- \list
- \li The file name of the specified path, obtained using QFileInfo::fileName().
- \endlist
-
- On Windows and X11:
-
- \list
- \li The file name of the specified path, obtained using QFileInfo::fileName().
- \li An optional \c{*} character, if the \l windowModified property is set.
- \li The \c{0x2014} unicode character, padded either side by spaces.
- \li The application name, obtained from the application's
- \l{QCoreApplication::}{applicationName} property.
- \endlist
+ sets the window title to the file name of the specified path, obtained using
+ QFileInfo::fileName().
If the window title is set at any point, then the window title takes precedence and
will be shown instead of the file path string.
@@ -10264,6 +10243,7 @@ void QWidget::setWindowOpacity(qreal opacity)
QTLWExtra *extra = d->topData();
extra->opacity = uint(opacity * 255);
setAttribute(Qt::WA_WState_WindowOpacitySet);
+ d->setWindowOpacity_sys(opacity);
if (!testAttribute(Qt::WA_WState_Created))
return;
@@ -10278,8 +10258,6 @@ void QWidget::setWindowOpacity(qreal opacity)
return;
}
#endif
-
- d->setWindowOpacity_sys(opacity);
}
/*!
diff --git a/src/widgets/kernel/qwidgetsfunctions_wince.h b/src/widgets/kernel/qwidgetsfunctions_wince.h
index 39d29b83ad..a113f44043 100644
--- a/src/widgets/kernel/qwidgetsfunctions_wince.h
+++ b/src/widgets/kernel/qwidgetsfunctions_wince.h
@@ -58,4 +58,4 @@ HINSTANCE qt_wince_ShellExecute(HWND hwnd, LPCWSTR operation, LPCWSTR file, LPCW
#endif
#endif // Q_OS_WINCE
-#endif // QWIDGETSFUNCTIONS_WCE_H \ No newline at end of file
+#endif // QWIDGETSFUNCTIONS_WCE_H
diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp
index f25f035382..7519d7f910 100644
--- a/src/widgets/styles/qcommonstyle.cpp
+++ b/src/widgets/styles/qcommonstyle.cpp
@@ -108,7 +108,7 @@ QT_BEGIN_NAMESPACE
subElementRect() are documented here.
\endomit
- \sa QStyle, QWindowsStyle
+ \sa QStyle, QProxyStyle
*/
/*!
@@ -1156,8 +1156,10 @@ void QCommonStylePrivate::startAnimation(QStyleAnimation *animation) const
void QCommonStylePrivate::stopAnimation(const QObject *target) const
{
QStyleAnimation *animation = animations.take(target);
- if (animation && animation->state() != QAbstractAnimation::Stopped)
+ if (animation) {
animation->stop();
+ delete animation;
+ }
}
/*! \internal */
@@ -4634,7 +4636,7 @@ int QCommonStyle::pixelMetric(PixelMetric m, const QStyleOption *opt, const QWid
ret = int(QStyleHelper::dpiScaled(13.));
break;
case PM_MessageBoxIconSize:
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
if (QApplication::desktopSettingsAware()) {
ret = 64; // No DPI scaling, it's handled elsewhere.
} else
diff --git a/src/widgets/styles/qfusionstyle.cpp b/src/widgets/styles/qfusionstyle.cpp
index 623cdb55b9..6450ab049b 100644
--- a/src/widgets/styles/qfusionstyle.cpp
+++ b/src/widgets/styles/qfusionstyle.cpp
@@ -2631,7 +2631,7 @@ void QFusionStyle::drawComplexControl(ComplexControl control, const QStyleOption
buttonOption.QStyleOption::operator=(*comboBox);
buttonOption.rect = rect;
buttonOption.state = (comboBox->state & (State_Enabled | State_MouseOver | State_HasFocus))
- | State_KeyboardFocusChange; // Allways show hig
+ | State_KeyboardFocusChange; // Always show hig
if (sunken) {
buttonOption.state |= State_Sunken;
diff --git a/src/widgets/styles/qgtkpainter.cpp b/src/widgets/styles/qgtkpainter.cpp
index a5c408f20d..206dbf7e0f 100644
--- a/src/widgets/styles/qgtkpainter.cpp
+++ b/src/widgets/styles/qgtkpainter.cpp
@@ -63,6 +63,7 @@ void QGtkPainter::reset(QPainter *painter)
m_hflipped = false;
m_vflipped = false;
m_usePixmapCache = true;
+ m_cliprect = QRect();
}
QString QGtkPainter::uniqueName(const QString &key, GtkStateType state, GtkShadowType shadow,
diff --git a/src/widgets/styles/qgtkstyle.cpp b/src/widgets/styles/qgtkstyle.cpp
index 75d2306da7..3ee242334d 100644
--- a/src/widgets/styles/qgtkstyle.cpp
+++ b/src/widgets/styles/qgtkstyle.cpp
@@ -2204,8 +2204,10 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom
GtkRange *range = (GtkRange*)(horizontal ? gtkHScrollBar : gtkVScrollBar);
- GtkAdjustment *adjustment = d->gtk_range_get_adjustment(range);
+ GtkAdjustment *adjustment = 0;
+ if (d->gtk_adjustment_configure)
+ adjustment = d->gtk_range_get_adjustment(range);
if (adjustment) {
d->gtk_adjustment_configure(adjustment, fakePos, 0, maximum, 0, 0, 0);
} else {
diff --git a/src/widgets/styles/qmacstyle.qdoc b/src/widgets/styles/qmacstyle.qdoc
index caa6bfa79e..29f41752ae 100644
--- a/src/widgets/styles/qmacstyle.qdoc
+++ b/src/widgets/styles/qmacstyle.qdoc
@@ -190,7 +190,7 @@
or Qt::WA_MacNormalSize instead.
*/
-/*! \fn QMacStyle::WidgetSizePolicy QMacStyle::widgetSizePolicy(const QWidget *widget)
+/*! \fn QMacStyle::WidgetSizePolicy QMacStyle::widgetSizePolicy(const QWidget *widget, const QStyleOption *opt = 0)
\obsolete
Call QWidget::testAttribute() with Qt::WA_MacMiniSize, Qt::WA_MacSmallSize,
diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm
index 89ea4d553a..bde33cdb97 100644
--- a/src/widgets/styles/qmacstyle_mac.mm
+++ b/src/widgets/styles/qmacstyle_mac.mm
@@ -1764,8 +1764,8 @@ void QMacStylePrivate::drawColorlessButton(const HIRect &macRect, HIThemeButtonD
QMacStyle::QMacStyle()
: QCommonStyle(*new QMacStylePrivate)
{
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
Q_D(QMacStyle);
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_7) {
d->receiver = [[NotificationReceiver alloc] initWithPrivate:d];
NotificationReceiver *receiver = static_cast<NotificationReceiver *>(d->receiver);
@@ -1778,6 +1778,7 @@ QMacStyle::QMacStyle()
d->nsscroller = [[NSScroller alloc] init];
}
#endif
+ d->indicatorBranchButtonCell = nil;
}
QMacStyle::~QMacStyle()
@@ -2181,11 +2182,11 @@ int QMacStyle::pixelMetric(PixelMetric metric, const QStyleOption *opt, const QW
switch (d->aquaSizeConstrain(opt, widget)) {
case QAquaSizeUnknown:
case QAquaSizeLarge:
- ret = 9;
+ ret = QSysInfo::macVersion() >= QSysInfo::MV_10_8 ? 16 : 9;
break;
case QAquaSizeMini:
case QAquaSizeSmall:
- ret = 7;
+ ret = QSysInfo::macVersion() >= QSysInfo::MV_10_8 ? 14 : 7;
break;
}
break;
@@ -2706,6 +2707,10 @@ int QMacStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w
ret = false;
break;
case SH_ScrollBar_Transient:
+ if (!qobject_cast<const QScrollBar*>(w)) {
+ ret = false;
+ break;
+ }
ret = QSysInfo::MacintoshVersion >= QSysInfo::MV_10_7;
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_7)
@@ -3076,21 +3081,30 @@ void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPai
case PE_IndicatorBranch: {
if (!(opt->state & State_Children))
break;
- HIThemeButtonDrawInfo bi;
- bi.version = qt_mac_hitheme_version;
- bi.state = tds;
- if (tds == kThemeStateInactive && opt->palette.currentColorGroup() == QPalette::Active)
- bi.state = kThemeStateActive;
- if (opt->state & State_Sunken)
- bi.state |= kThemeStatePressed;
- bi.kind = kThemeDisclosureButton;
- if (opt->state & State_Open)
- bi.value = kThemeDisclosureDown;
- else
- bi.value = opt->direction == Qt::LeftToRight ? kThemeDisclosureRight : kThemeDisclosureLeft;
- bi.adornment = kThemeAdornmentNone;
- HIRect hirect = qt_hirectForQRect(opt->rect.adjusted(DisclosureOffset,0,-DisclosureOffset,0));
- HIThemeDrawButton(&hirect, &bi, cg, kHIThemeOrientationNormal, 0);
+ if (!d->indicatorBranchButtonCell)
+ const_cast<QMacStylePrivate *>(d)->indicatorBranchButtonCell = (void *)[[NSButtonCell alloc] init];
+ NSButtonCell *triangleCell = (NSButtonCell *)d->indicatorBranchButtonCell;
+ [triangleCell setButtonType:NSOnOffButton];
+ [triangleCell setState:(opt->state & State_Open) ? NSOnState : NSOffState];
+ [triangleCell setBezelStyle:NSDisclosureBezelStyle];
+ [triangleCell setBackgroundStyle:((opt->state & State_Selected) && w->hasFocus()) ? NSBackgroundStyleDark : NSBackgroundStyleLight];
+
+ CGContextSaveGState(cg);
+ [NSGraphicsContext saveGraphicsState];
+
+ [NSGraphicsContext setCurrentContext:[NSGraphicsContext
+ graphicsContextWithGraphicsPort:(CGContextRef)cg flipped:NO]];
+
+ QRect qtRect = opt->rect.adjusted(DisclosureOffset, 0, -DisclosureOffset, 0);
+ CGRect rect = CGRectMake(qtRect.x() + 1, qtRect.y(), qtRect.width(), qtRect.height());
+ CGContextTranslateCTM(cg, rect.origin.x, rect.origin.y + rect.size.height);
+ CGContextScaleCTM(cg, 1, -1);
+ CGContextTranslateCTM(cg, -rect.origin.x, -rect.origin.y);
+
+ [triangleCell drawBezelWithFrame:rect inView:[triangleCell controlView]];
+
+ [NSGraphicsContext restoreGraphicsState];
+ CGContextRestoreGState(cg);
break; }
case PE_Frame: {
@@ -4906,9 +4920,14 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
}
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
- if (cc == CC_ScrollBar && proxy()->styleHint(SH_ScrollBar_Transient)) {
+ if (cc == CC_ScrollBar && proxy()->styleHint(SH_ScrollBar_Transient, 0, widget)) {
bool wasActive = false;
CGFloat opacity = 1.0;
+ CGFloat expandScale = 1.0;
+ CGFloat expandOffset = -1.0;
+ bool shouldExpand = false;
+ const CGFloat maxExpandScale = tdi.kind == kThemeSmallScrollBar ? 11.0 / 7.0 : 13.0 / 9.0;
+
if (QObject *styleObject = opt->styleObject) {
int oldPos = styleObject->property("_q_stylepos").toInt();
int oldMin = styleObject->property("_q_stylemin").toInt();
@@ -4936,23 +4955,24 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
styleObject->setProperty("_q_stylestate", static_cast<int>(slider->state));
styleObject->setProperty("_q_stylecontrols", static_cast<uint>(slider->activeSubControls));
+ QScrollbarAnimation *anim = qobject_cast<QScrollbarAnimation *>(d->animation(styleObject));
if (transient) {
- QFadeOutAnimation *anim = qobject_cast<QFadeOutAnimation *>(d->animation(styleObject));
if (!anim) {
- anim = new QFadeOutAnimation(styleObject);
+ anim = new QScrollbarAnimation(styleObject);
+ anim->setFadingOut();
d->startAnimation(anim);
- } else {
+ } else if (anim->isFadingOut()) {
// the scrollbar was already fading out while the
// state changed -> restart the fade out animation
anim->setCurrentTime(0);
}
- } else {
+ } else if (anim && anim->isFadingOut()) {
d->stopAnimation(styleObject);
}
}
- QFadeOutAnimation *anim = qobject_cast<QFadeOutAnimation *>(d->animation(styleObject));
- if (anim) {
+ QScrollbarAnimation *anim = qobject_cast<QScrollbarAnimation *>(d->animation(styleObject));
+ if (anim && anim->isFadingOut()) {
// once a scrollbar was active (hovered/pressed), it retains
// the active look even if it's no longer active while fading out
if (oldActiveControls)
@@ -4961,6 +4981,24 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
wasActive = anim->wasActive();
opacity = anim->currentValue();
}
+
+ shouldExpand = (opt->activeSubControls || wasActive) && QSysInfo::macVersion() >= QSysInfo::MV_10_8;
+ if (shouldExpand) {
+ if (!anim && !oldActiveControls) {
+ // Start expand animation only once and when entering
+ anim = new QScrollbarAnimation(styleObject);
+ anim->setExpanding();
+ d->startAnimation(anim);
+ }
+ if (anim && !anim->isFadingOut()) {
+ expandScale = 1.0 + (maxExpandScale - 1.0) * anim->currentValue();
+ expandOffset = 5.5 * anim->currentValue() - 1;
+ } else {
+ // Keep expanded state after the animation ends, and when fading out
+ expandScale = maxExpandScale;
+ expandOffset = 4.5;
+ }
+ }
}
const bool isHorizontal = slider->orientation == Qt::Horizontal;
@@ -4982,38 +5020,30 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
[scroller setControlSize:(tdi.kind == kThemeSmallScrollBar ? NSMiniControlSize
: NSRegularControlSize)];
- if (isHorizontal)
- [scroller setBounds:NSMakeRect(0, -1,
- slider->rect.width(), slider->rect.height())];
- else
- [scroller setBounds:NSMakeRect(-1, 0,
- slider->rect.width(), slider->rect.height())];
+ [scroller setBounds:NSMakeRect(0, 0, slider->rect.width(), slider->rect.height())];
[scroller setScrollerStyle:NSScrollerStyleOverlay];
- // first we draw only the track, by using a disabled scroller
- if (opt->activeSubControls || wasActive) {
- CGContextBeginTransparencyLayerWithRect(cg, qt_hirectForQRect(slider->rect),
- NULL);
- CGContextSetAlpha(cg, opacity);
-
- [scroller setFrame:NSMakeRect(0, 0, slider->rect.width(), slider->rect.height())];
- [scroller setEnabled:NO];
- [scroller displayRectIgnoringOpacity:[scroller bounds]
- inContext:[NSGraphicsContext currentContext]];
+ CGContextBeginTransparencyLayer(cg, NULL);
+ CGContextSetAlpha(cg, opacity);
- CGContextEndTransparencyLayer(cg);
+ // Draw the track when hovering
+ if (opt->activeSubControls || wasActive) {
+ CGRect rect = [scroller bounds];
+ if (shouldExpand) {
+ if (isHorizontal)
+ rect.origin.y += 4.5 - expandOffset;
+ else
+ rect.origin.x += 4.5 - expandOffset;
+ }
+ [scroller drawKnobSlotInRect:rect highlight:YES];
}
- CGContextBeginTransparencyLayerWithRect(cg, qt_hirectForQRect(slider->rect), NULL);
- CGContextSetAlpha(cg, opacity);
-
const qreal length = slider->maximum - slider->minimum + slider->pageStep;
const qreal proportion = slider->pageStep / length;
qreal value = (slider->sliderValue - slider->minimum) / length;
if (isHorizontal && slider->direction == Qt::RightToLeft)
value = 1.0 - value - proportion;
- [scroller setEnabled:(slider->state & State_Enabled) ? YES : NO];
[scroller setKnobProportion:1.0];
const int minKnobWidth = 26;
@@ -5023,18 +5053,27 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
const qreal width = qMax<qreal>(minKnobWidth, plannedWidth);
const qreal totalWidth = slider->rect.width() + plannedWidth - width;
[scroller setFrame:NSMakeRect(0, 0, width, slider->rect.height())];
- CGContextTranslateCTM(cg, value * totalWidth, 0);
+ if (shouldExpand) {
+ CGContextScaleCTM(cg, 1, expandScale);
+ CGContextTranslateCTM(cg, value * totalWidth, -expandOffset);
+ } else {
+ CGContextTranslateCTM(cg, value * totalWidth, 1);
+ }
} else {
const qreal plannedHeight = proportion * slider->rect.height();
const qreal height = qMax<qreal>(minKnobWidth, plannedHeight);
const qreal totalHeight = slider->rect.height() + plannedHeight - height;
[scroller setFrame:NSMakeRect(0, 0, slider->rect.width(), height)];
- CGContextTranslateCTM(cg, 0, value * totalHeight);
+ if (shouldExpand) {
+ CGContextScaleCTM(cg, expandScale, 1);
+ CGContextTranslateCTM(cg, -expandOffset, value * totalHeight);
+ } else {
+ CGContextTranslateCTM(cg, 1, value * totalHeight);
+ }
}
if (length > 0.0) {
[scroller layout];
- [scroller displayRectIgnoringOpacity:[scroller bounds]
- inContext:[NSGraphicsContext currentContext]];
+ [scroller drawKnob];
}
CGContextEndTransparencyLayer(cg);
diff --git a/src/widgets/styles/qmacstyle_mac_p_p.h b/src/widgets/styles/qmacstyle_mac_p_p.h
index c2e5a024a4..dae87bfec6 100644
--- a/src/widgets/styles/qmacstyle_mac_p_p.h
+++ b/src/widgets/styles/qmacstyle_mac_p_p.h
@@ -209,34 +209,50 @@ public:
void* receiver;
void *nsscroller;
#endif
+ void *indicatorBranchButtonCell;
};
-class QFadeOutAnimation : public QNumberStyleAnimation
+class QScrollbarAnimation : public QNumberStyleAnimation
{
Q_OBJECT
public:
- QFadeOutAnimation(QObject *target) : QNumberStyleAnimation(target), _active(false)
+ QScrollbarAnimation(QObject *target) : QNumberStyleAnimation(target), _active(false)
+ { }
+
+ bool wasActive() const { return _active; }
+ void setActive(bool active) { _active = active; }
+
+ bool isFadingOut() const { return _isFadingOut; }
+
+ void setFadingOut()
{
+ _isFadingOut = true;
setDuration(QMacStylePrivate::ScrollBarFadeOutDelay + QMacStylePrivate::ScrollBarFadeOutDuration);
setDelay(QMacStylePrivate::ScrollBarFadeOutDelay);
setStartValue(1.0);
setEndValue(0.0);
}
- bool wasActive() const { return _active; }
- void setActive(bool active) { _active = active; }
+ void setExpanding()
+ {
+ _isFadingOut = false;
+ setDuration(QMacStylePrivate::ScrollBarFadeOutDuration);
+ setStartValue(0.0);
+ setEndValue(1.0);
+ }
private slots:
void updateCurrentTime(int time)
{
QNumberStyleAnimation::updateCurrentTime(time);
- if (qFuzzyIsNull(currentValue()))
+ if (_isFadingOut && qFuzzyIsNull(currentValue()))
target()->setProperty("visible", false);
}
private:
bool _active;
+ bool _isFadingOut;
};
QT_END_NAMESPACE
diff --git a/src/widgets/styles/qstylehelper.cpp b/src/widgets/styles/qstylehelper.cpp
index c6e9a8d013..1630130de2 100644
--- a/src/widgets/styles/qstylehelper.cpp
+++ b/src/widgets/styles/qstylehelper.cpp
@@ -78,7 +78,7 @@ QString uniqueName(const QString &key, const QStyleOption *option, const QSize &
qreal dpiScaled(qreal value)
{
#ifdef Q_OS_MAC
- // On mac the DPI is allways 72 so we should not scale it
+ // On mac the DPI is always 72 so we should not scale it
return value;
#else
static const qreal scale = qreal(qt_defaultDpiX()) / 96.0;
diff --git a/src/widgets/styles/qstyleoption.cpp b/src/widgets/styles/qstyleoption.cpp
index 0ec42e446d..1c2df682cc 100644
--- a/src/widgets/styles/qstyleoption.cpp
+++ b/src/widgets/styles/qstyleoption.cpp
@@ -578,6 +578,7 @@ QStyleOptionFrame::QStyleOptionFrame(int version)
\value None Indicates a normal frame.
\value Flat Indicates a flat frame.
+ \value Rounded Indicates a rounded frame.
*/
/*!
diff --git a/src/widgets/widgets.pro b/src/widgets/widgets.pro
index f8f00af69b..6b9aa92fd9 100644
--- a/src/widgets/widgets.pro
+++ b/src/widgets/widgets.pro
@@ -2,6 +2,7 @@ TARGET = QtWidgets
QT = core-private gui-private
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
@@ -41,15 +42,6 @@ testcocoon {
load(testcocoon)
}
-INCLUDEPATH += ../3rdparty/harfbuzz/src
-
win32:!contains(QT_CONFIG, directwrite) {
DEFINES += QT_NO_DIRECTWRITE
}
-
-load(uic)
-
-uic_dir.name = uic_location
-uic_dir.variable = QMAKE_UIC
-
-QMAKE_PKGCONFIG_VARIABLES += uic_dir
diff --git a/src/widgets/widgets/qabstractscrollarea.cpp b/src/widgets/widgets/qabstractscrollarea.cpp
index 3c21d767be..c277f7bd45 100644
--- a/src/widgets/widgets/qabstractscrollarea.cpp
+++ b/src/widgets/widgets/qabstractscrollarea.cpp
@@ -328,11 +328,14 @@ void QAbstractScrollAreaPrivate::setSingleFingerPanEnabled(bool on)
void QAbstractScrollAreaPrivate::layoutChildren()
{
Q_Q(QAbstractScrollArea);
- bool needh = (hbarpolicy == Qt::ScrollBarAlwaysOn
- || (hbarpolicy == Qt::ScrollBarAsNeeded && hbar->minimum() < hbar->maximum() && !hbar->sizeHint().isEmpty()));
+ bool transient = q->style()->styleHint(QStyle::SH_ScrollBar_Transient, 0, vbar ? vbar : hbar);
+ bool needh = (hbarpolicy == Qt::ScrollBarAlwaysOn && !transient)
+ || ((hbarpolicy == Qt::ScrollBarAsNeeded || transient)
+ && hbar->minimum() < hbar->maximum() && !hbar->sizeHint().isEmpty());
- bool needv = (vbarpolicy == Qt::ScrollBarAlwaysOn
- || (vbarpolicy == Qt::ScrollBarAsNeeded && vbar->minimum() < vbar->maximum() && !vbar->sizeHint().isEmpty()));
+ bool needv = (vbarpolicy == Qt::ScrollBarAlwaysOn && !transient)
+ || ((vbarpolicy == Qt::ScrollBarAsNeeded || transient)
+ && vbar->minimum() < vbar->maximum() && !vbar->sizeHint().isEmpty());
QStyleOption opt(0);
opt.init(q);
@@ -489,12 +492,20 @@ void QAbstractScrollAreaPrivate::layoutChildren()
if (hasMacReverseSizeGrip)
horizontalScrollBarRect.adjust(vsbExt, 0, 0, 0);
#endif
+#ifdef Q_OS_MAC
+ if (!hasCornerWidget && QSysInfo::macVersion() >= QSysInfo::MV_10_8 && transient)
+ horizontalScrollBarRect.adjust(0, 0, cornerOffset.x(), 0);
+#endif
scrollBarContainers[Qt::Horizontal]->setGeometry(QStyle::visualRect(opt.direction, opt.rect, horizontalScrollBarRect));
scrollBarContainers[Qt::Horizontal]->raise();
}
if (needv) {
- const QRect verticalScrollBarRect (QPoint(cornerPoint.x(), controlsRect.top() + hHeaderBottom), QPoint(controlsRect.right(), cornerPoint.y() - 1));
+ QRect verticalScrollBarRect (QPoint(cornerPoint.x(), controlsRect.top() + hHeaderBottom), QPoint(controlsRect.right(), cornerPoint.y() - 1));
+#ifdef Q_OS_MAC
+ if (!hasCornerWidget && QSysInfo::macVersion() >= QSysInfo::MV_10_8 && transient)
+ verticalScrollBarRect.adjust(0, 0, 0, cornerOffset.y());
+#endif
scrollBarContainers[Qt::Vertical]->setGeometry(QStyle::visualRect(opt.direction, opt.rect, verticalScrollBarRect));
scrollBarContainers[Qt::Vertical]->raise();
}
@@ -654,7 +665,6 @@ void QAbstractScrollArea::setVerticalScrollBarPolicy(Qt::ScrollBarPolicy policy)
d->layoutChildren();
if (oldPolicy != d->vbarpolicy)
d->scrollBarPolicyChanged(Qt::Vertical, d->vbarpolicy);
- d->setScrollBarTransient(d->vbar, policy == Qt::ScrollBarAsNeeded);
}
@@ -716,7 +726,6 @@ void QAbstractScrollArea::setHorizontalScrollBarPolicy(Qt::ScrollBarPolicy polic
d->layoutChildren();
if (oldPolicy != d->hbarpolicy)
d->scrollBarPolicyChanged(Qt::Horizontal, d->hbarpolicy);
- d->setScrollBarTransient(d->hbar, policy == Qt::ScrollBarAsNeeded);
}
/*!
@@ -935,7 +944,7 @@ bool QAbstractScrollArea::eventFilter(QObject *o, QEvent *e)
Q_D(QAbstractScrollArea);
if ((o == d->hbar || o == d->vbar) && (e->type() == QEvent::HoverEnter || e->type() == QEvent::HoverLeave)) {
Qt::ScrollBarPolicy policy = o == d->hbar ? d->vbarpolicy : d->hbarpolicy;
- if (policy == Qt::ScrollBarAsNeeded) {
+ if (policy == Qt::ScrollBarAsNeeded || style()->styleHint(QStyle::SH_ScrollBar_Transient, 0, d->vbar ? d->vbar : d->hbar)) {
QScrollBar *sibling = o == d->hbar ? d->vbar : d->hbar;
d->setScrollBarTransient(sibling, e->type() == QEvent::HoverLeave);
}
@@ -1445,9 +1454,11 @@ bool QAbstractScrollAreaPrivate::canStartScrollingAt( const QPoint &startPos )
void QAbstractScrollAreaPrivate::flashScrollBars()
{
- if (hbarpolicy == Qt::ScrollBarAsNeeded)
+ Q_Q(QAbstractScrollArea);
+ bool transient = q->style()->styleHint(QStyle::SH_ScrollBar_Transient, 0, vbar ? vbar : hbar);
+ if (hbarpolicy == Qt::ScrollBarAsNeeded || transient)
hbar->d_func()->flash();
- if (vbarpolicy == Qt::ScrollBarAsNeeded)
+ if (vbarpolicy == Qt::ScrollBarAsNeeded || transient)
vbar->d_func()->flash();
}
diff --git a/src/widgets/widgets/qcheckbox.cpp b/src/widgets/widgets/qcheckbox.cpp
index 1567e30d83..0e2e802006 100644
--- a/src/widgets/widgets/qcheckbox.cpp
+++ b/src/widgets/widgets/qcheckbox.cpp
@@ -124,8 +124,8 @@ public:
\li \inlineimage macintosh-checkbox.png Screenshot of a Macintosh style checkbox
\li A checkbox shown in the \l{Macintosh Style Widget Gallery}{Macintosh widget style}.
\row
- \li \inlineimage windows-checkbox.png Screenshot of a Windows XP style checkbox
- \li A checkbox shown in the \l{Windows XP Style Widget Gallery}{Windows XP widget style}.
+ \li \inlineimage windowsvista-checkbox.png Screenshot of a Windows Vista style checkbox
+ \li A checkbox shown in the \l{Windows Vista Style Widget Gallery}{Windows Vista widget style}.
\row
\li \inlineimage fusion-checkbox.png Screenshot of a Fusion style checkbox
\li A checkbox shown in the \l{Fusion Style Widget Gallery}{Fusion widget style}.
diff --git a/src/widgets/widgets/qdatetimeedit.cpp b/src/widgets/widgets/qdatetimeedit.cpp
index 394e2b537f..a962762bb1 100644
--- a/src/widgets/widgets/qdatetimeedit.cpp
+++ b/src/widgets/widgets/qdatetimeedit.cpp
@@ -105,8 +105,8 @@ QT_BEGIN_NAMESPACE
calendar widget can be retrieved with calendarWidget().
\table 100%
- \row \li \inlineimage windowsxp-datetimeedit.png Screenshot of a Windows XP style date time editing widget
- \li A date time editing widget shown in the \l{Windows XP Style Widget Gallery}{Windows XP widget style}.
+ \row \li \inlineimage windowsvista-datetimeedit.png Screenshot of a Windows Vista style date time editing widget
+ \li A date time editing widget shown in the \l{Windows Vista Style Widget Gallery}{Windows Vista widget style}.
\row \li \inlineimage macintosh-datetimeedit.png Screenshot of a Macintosh style date time editing widget
\li A date time editing widget shown in the \l{Macintosh Style Widget Gallery}{Macintosh widget style}.
\row \li \inlineimage fusion-datetimeedit.png Screenshot of a Fusion style date time editing widget
@@ -1536,8 +1536,8 @@ void QDateTimeEdit::mousePressEvent(QMouseEvent *event)
\endlist
\table 100%
- \row \li \inlineimage windowsxp-timeedit.png Screenshot of a Windows XP style time editing widget
- \li A time editing widget shown in the \l{Windows XP Style Widget Gallery}{Windows XP widget style}.
+ \row \li \inlineimage windowsvista-timeedit.png Screenshot of a Windows Vista style time editing widget
+ \li A time editing widget shown in the \l{Windows Vista Style Widget Gallery}{Windows Vista widget style}.
\row \li \inlineimage macintosh-timeedit.png Screenshot of a Macintosh style time editing widget
\li A time editing widget shown in the \l{Macintosh Style Widget Gallery}{Macintosh widget style}.
\row \li \inlineimage fusion-timeedit.png Screenshot of a Fusion style time editing widget
@@ -1613,8 +1613,8 @@ QTimeEdit::~QTimeEdit()
\endlist
\table 100%
- \row \li \inlineimage windowsxp-dateedit.png Screenshot of a Windows XP style date editing widget
- \li A date editing widget shown in the \l{Windows XP Style Widget Gallery}{Windows XP widget style}.
+ \row \li \inlineimage windowsvista-dateedit.png Screenshot of a Windows Vista style date editing widget
+ \li A date editing widget shown in the \l{Windows Vista Style Widget Gallery}{Windows Vista widget style}.
\row \li \inlineimage macintosh-dateedit.png Screenshot of a Macintosh style date editing widget
\li A date editing widget shown in the \l{Macintosh Style Widget Gallery}{Macintosh widget style}.
\row \li \inlineimage fusion-dateedit.png Screenshot of a Fusion style date editing widget
diff --git a/src/widgets/widgets/qdial.cpp b/src/widgets/widgets/qdial.cpp
index 1f06fed0f6..4bdd5538b9 100644
--- a/src/widgets/widgets/qdial.cpp
+++ b/src/widgets/widgets/qdial.cpp
@@ -231,11 +231,11 @@ int QDialPrivate::valueFromPoint(const QPoint &p) const
\table
\row \li \inlineimage fusion-dial.png Screenshot of a dial in the Fusion widget style
- \li \inlineimage windowsxp-dial.png Screenshot of a dial in the Windows XP widget style
+ \li \inlineimage windowsvista-dial.png Screenshot of a dial in the Windows Vista widget style
\li \inlineimage macintosh-dial.png Screenshot of a dial in the Macintosh widget style
\row \li {3,1} Dials shown in various widget styles (from left to right):
\l{Fusion Style Widget Gallery}{Fusion},
- \l{Windows XP Style Widget Gallery}{Windows XP},
+ \l{Windows Vista Style Widget Gallery}{Windows Vista},
\l{Macintosh Style Widget Gallery}{Macintosh}.
\endtable
diff --git a/src/widgets/widgets/qfontcombobox.cpp b/src/widgets/widgets/qfontcombobox.cpp
index ab878cc98f..f602a47051 100644
--- a/src/widgets/widgets/qfontcombobox.cpp
+++ b/src/widgets/widgets/qfontcombobox.cpp
@@ -314,7 +314,7 @@ void QFontComboBoxPrivate::_q_currentChanged(const QString &text)
filter out certain types of fonts as e.g. non scalable fonts or
monospaced fonts.
- \image windowsxp-fontcombobox.png Screenshot of QFontComboBox on Windows XP
+ \image windowsvista-fontcombobox.png Screenshot of QFontComboBox on Windows Vista
\sa QComboBox, QFont, QFontInfo, QFontMetrics, QFontDatabase, {Character Map Example}
*/
diff --git a/src/widgets/widgets/qgroupbox.cpp b/src/widgets/widgets/qgroupbox.cpp
index e52b8f1a94..e303fe5d6f 100644
--- a/src/widgets/widgets/qgroupbox.cpp
+++ b/src/widgets/widgets/qgroupbox.cpp
@@ -171,10 +171,10 @@ void QGroupBoxPrivate::click()
\snippet widgets/groupbox/window.cpp 2
\table 100%
- \row \li \inlineimage windowsxp-groupbox.png Screenshot of a Windows XP style group box
+ \row \li \inlineimage windowsvista-groupbox.png Screenshot of a Windows Vista style group box
\li \inlineimage macintosh-groupbox.png Screenshot of a Macintosh style group box
\li \inlineimage fusion-groupbox.png Screenshot of a Fusion style group box
- \row \li A \l{Windows XP Style Widget Gallery}{Windows XP style} group box.
+ \row \li A \l{Windows Vista Style Widget Gallery}{Windows Vista style} group box.
\li A \l{Macintosh Style Widget Gallery}{Macintosh style} group box.
\li A \l{Fusion Style Widget Gallery}{Fusion style} group box.
\endtable
diff --git a/src/widgets/widgets/qlabel.cpp b/src/widgets/widgets/qlabel.cpp
index 9465acfdad..63596a64af 100644
--- a/src/widgets/widgets/qlabel.cpp
+++ b/src/widgets/widgets/qlabel.cpp
@@ -141,8 +141,8 @@ QT_BEGIN_NAMESPACE
\li \inlineimage fusion-label.png Screenshot of a Fusion style label
\li A label shown in the \l{Fusion Style Widget Gallery}{Fusion widget style}.
\row
- \li \inlineimage windowsxp-label.png Screenshot of a Windows XP style label
- \li A label shown in the \l{Windows XP Style Widget Gallery}{Windows XP widget style}.
+ \li \inlineimage windowsvista-label.png Screenshot of a Windows Vista style label
+ \li A label shown in the \l{Windows Vista Style Widget Gallery}{Windows Vista widget style}.
\endtable
\sa QLineEdit, QTextEdit, QPixmap, QMovie,
diff --git a/src/widgets/widgets/qlcdnumber.cpp b/src/widgets/widgets/qlcdnumber.cpp
index 69d838bb00..c7a835b629 100644
--- a/src/widgets/widgets/qlcdnumber.cpp
+++ b/src/widgets/widgets/qlcdnumber.cpp
@@ -108,11 +108,11 @@ public:
\table
\row \li
\inlineimage windows-lcdnumber.png Screenshot of a Windows style LCD number widget
- \inlineimage windowsxp-lcdnumber.png Screenshot of a Windows XP style LCD number widget
+ \inlineimage windowsvista-lcdnumber.png Screenshot of a Windows Vista style LCD number widget
\inlineimage macintosh-lcdnumber.png Screenshot of a Macintosh style LCD number widget
\inlineimage fusion-lcdnumber.png Screenshot of a Fusion style LCD number widget
\row \li LCD number widgets shown in various widget styles (from left to right):
- \l{Windows Style Widget Gallery}{Windows}, \l{Windows XP Style Widget Gallery}{Windows XP},
+ \l{Windows Style Widget Gallery}{Windows}, \l{Windows Vista Style Widget Gallery}{Windows Vista},
\l{Macintosh Style Widget Gallery}{Macintosh}, \l{Fusion Style Widget Gallery}{Fusion}.
\endtable
diff --git a/src/widgets/widgets/qlineedit.cpp b/src/widgets/widgets/qlineedit.cpp
index 23dee90406..c250c286bc 100644
--- a/src/widgets/widgets/qlineedit.cpp
+++ b/src/widgets/widgets/qlineedit.cpp
@@ -206,8 +206,8 @@ void QLineEdit::initStyleOption(QStyleOptionFrame *option) const
\table 100%
\row \li \inlineimage macintosh-lineedit.png Screenshot of a Macintosh style line edit
\li A line edit shown in the \l{Macintosh Style Widget Gallery}{Macintosh widget style}.
- \row \li \inlineimage windows-lineedit.png Screenshot of a Windows XP style line edit
- \li A line edit shown in the \l{Windows XP Style Widget Gallery}{Windows XP widget style}.
+ \row \li \inlineimage windowsvista-lineedit.png Screenshot of a Windows Vista style line edit
+ \li A line edit shown in the \l{Windows Vista Style Widget Gallery}{Windows Vista widget style}.
\row \li \inlineimage fusion-lineedit.png Screenshot of a Fusion style line edit
\li A line edit shown in the \l{Fusion Style Widget Gallery}{Fusion widget style}.
\endtable
diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp
index 4d431868ac..17f9ca7911 100644
--- a/src/widgets/widgets/qmenu.cpp
+++ b/src/widgets/widgets/qmenu.cpp
@@ -1856,7 +1856,7 @@ void QMenu::popup(const QPoint &p, QAction *atAction)
QPoint mouse = QCursor::pos();
d->mousePopupPos = mouse;
- const bool snapToMouse = (QRect(p.x() - 3, p.y() - 3, 6, 6).contains(mouse));
+ const bool snapToMouse = !d->causedPopup.widget && (QRect(p.x() - 3, p.y() - 3, 6, 6).contains(mouse));
const QSize menuSize(sizeHint());
if (adjustToDesktop) {
diff --git a/src/widgets/widgets/qmenu_wince.rc b/src/widgets/widgets/qmenu_wince.rc
index 50624eef57..631cd9d47a 100644
--- a/src/widgets/widgets/qmenu_wince.rc
+++ b/src/widgets/widgets/qmenu_wince.rc
@@ -3,9 +3,9 @@
#include <commctrl.h>
#include "winuser.h"
-#if defined (_DEBUG) && defined(QT_DLL)
+#if defined (_DEBUG) && defined(QT_SHARED)
#include "Qt5Widgetsd_resource.rc"
-#elif defined(QT_DLL)
+#elif defined(QT_SHARED)
#include "Qt5Widgets_resource.rc"
#endif
diff --git a/src/widgets/widgets/qprogressbar.cpp b/src/widgets/widgets/qprogressbar.cpp
index 3292116dac..7cf564c8e7 100644
--- a/src/widgets/widgets/qprogressbar.cpp
+++ b/src/widgets/widgets/qprogressbar.cpp
@@ -198,8 +198,8 @@ bool QProgressBarPrivate::repaintRequired() const
\table
\row \li \inlineimage macintosh-progressbar.png Screenshot of a Macintosh style progress bar
\li A progress bar shown in the Macintosh widget style.
- \row \li \inlineimage windowsxp-progressbar.png Screenshot of a Windows XP style progress bar
- \li A progress bar shown in the Windows XP widget style.
+ \row \li \inlineimage windowsvista-progressbar.png Screenshot of a Windows Vista style progress bar
+ \li A progress bar shown in the Windows Vista widget style.
\row \li \inlineimage fusion-progressbar.png Screenshot of a Fusion style progress bar
\li A progress bar shown in the Fusion widget style.
\endtable
diff --git a/src/widgets/widgets/qpushbutton.cpp b/src/widgets/widgets/qpushbutton.cpp
index 0f9243a6c8..dd7c5f9d4f 100644
--- a/src/widgets/widgets/qpushbutton.cpp
+++ b/src/widgets/widgets/qpushbutton.cpp
@@ -168,8 +168,8 @@ QT_BEGIN_NAMESPACE
changed from round to square. Use the setMinimumSize()
function to prevent this behavior.
- \row \li \inlineimage windowsxp-pushbutton.png Screenshot of a Windows XP style push button
- \li A push button shown in the \l{Windows XP Style Widget Gallery}{Windows XP widget style}.
+ \row \li \inlineimage windowsvista-pushbutton.png Screenshot of a Windows Vista style push button
+ \li A push button shown in the \l{Windows Vista Style Widget Gallery}{Windows Vista widget style}.
\row \li \inlineimage fusion-pushbutton.png Screenshot of a Fusion style push button
\li A push button shown in the \l{Fusion Style Widget Gallery}{Fusion widget style}.
\endtable
diff --git a/src/widgets/widgets/qradiobutton.cpp b/src/widgets/widgets/qradiobutton.cpp
index 68681a9dea..bb081ec905 100644
--- a/src/widgets/widgets/qradiobutton.cpp
+++ b/src/widgets/widgets/qradiobutton.cpp
@@ -118,8 +118,8 @@ void QRadioButtonPrivate::init()
\table 100%
\row \li \inlineimage fusion-radiobutton.png Screenshot of a Fusion radio button
\li A radio button shown in the \l{Fusion Style Widget Gallery}{Fusion widget style}.
- \row \li \inlineimage windows-radiobutton.png Screenshot of a Windows XP radio button
- \li A radio button shown in the \l{Windows XP Style Widget Gallery}{Windows XP widget style}.
+ \row \li \inlineimage windowsvista-radiobutton.png Screenshot of a Windows Vista radio button
+ \li A radio button shown in the \l{Windows Vista Style Widget Gallery}{Windows Vista widget style}.
\row \li \inlineimage macintosh-radiobutton.png Screenshot of a Macintosh radio button
\li A radio button shown in the \l{Macintosh Style Widget Gallery}{Macintosh widget style}.
\endtable
diff --git a/src/widgets/widgets/qscrollbar.cpp b/src/widgets/widgets/qscrollbar.cpp
index 32cf9f4467..6ace736391 100644
--- a/src/widgets/widgets/qscrollbar.cpp
+++ b/src/widgets/widgets/qscrollbar.cpp
@@ -192,8 +192,8 @@ QT_BEGIN_NAMESPACE
\table 100%
\row \li \inlineimage macintosh-horizontalscrollbar.png Screenshot of a Macintosh style scroll bar
\li A scroll bar shown in the \l{Macintosh Style Widget Gallery}{Macintosh widget style}.
- \row \li \inlineimage windowsxp-horizontalscrollbar.png Screenshot of a Windows XP style scroll bar
- \li A scroll bar shown in the \l{Windows XP Style Widget Gallery}{Windows XP widget style}.
+ \row \li \inlineimage windowsvista-horizontalscrollbar.png Screenshot of a Windows Vista style scroll bar
+ \li A scroll bar shown in the \l{Windows Vista Style Widget Gallery}{Windows Vista widget style}.
\row \li \inlineimage fusion-horizontalscrollbar.png Screenshot of a Fusion style scroll bar
\li A scroll bar shown in the \l{Fusion Style Widget Gallery}{Fusion widget style}.
\endtable
@@ -234,10 +234,10 @@ void QScrollBarPrivate::setTransient(bool value)
Q_Q(QScrollBar);
if (transient != value) {
transient = value;
- if (transient) {
- if (q->isVisible() && q->style()->styleHint(QStyle::SH_ScrollBar_Transient))
+ if (q->isVisible()) {
+ if (q->style()->styleHint(QStyle::SH_ScrollBar_Transient, 0, q))
q->update();
- } else if (!q->isVisible()) {
+ } else if (!transient) {
q->show();
}
}
@@ -246,7 +246,7 @@ void QScrollBarPrivate::setTransient(bool value)
void QScrollBarPrivate::flash()
{
Q_Q(QScrollBar);
- if (!flashed && q->style()->styleHint(QStyle::SH_ScrollBar_Transient)) {
+ if (!flashed && q->style()->styleHint(QStyle::SH_ScrollBar_Transient, 0, q)) {
flashed = true;
q->show();
}
@@ -325,7 +325,7 @@ void QScrollBar::initStyleOption(QStyleOptionSlider *option) const
option->upsideDown = d->invertedAppearance;
if (d->orientation == Qt::Horizontal)
option->state |= QStyle::State_Horizontal;
- if (d->flashed || !d->transient)
+ if ((d->flashed || !d->transient) && style()->styleHint(QStyle::SH_ScrollBar_Transient, 0, this))
option->state |= QStyle::State_On;
}
@@ -384,7 +384,7 @@ void QScrollBarPrivate::init()
invertedControls = true;
pressedControl = hoverControl = QStyle::SC_None;
pointerOutsidePressedControl = false;
- transient = q->style()->styleHint(QStyle::SH_ScrollBar_Transient);
+ transient = q->style()->styleHint(QStyle::SH_ScrollBar_Transient, 0, q);
flashed = false;
q->setFocusPolicy(Qt::NoFocus);
QSizePolicy sp(QSizePolicy::Minimum, QSizePolicy::Fixed, QSizePolicy::Slider);
@@ -484,7 +484,7 @@ bool QScrollBar::event(QEvent *event)
d_func()->updateHoverControl(he->pos());
break;
case QEvent::StyleChange:
- d_func()->setTransient(style()->styleHint(QStyle::SH_ScrollBar_Transient));
+ d_func()->setTransient(style()->styleHint(QStyle::SH_ScrollBar_Transient, 0, this));
break;
default:
break;
@@ -531,7 +531,7 @@ void QScrollBar::paintEvent(QPaintEvent *)
opt.activeSubControls = (QStyle::SubControl)d->hoverControl;
}
style()->drawComplexControl(QStyle::CC_ScrollBar, &opt, &p, this);
- if (d->flashed && style()->styleHint(QStyle::SH_ScrollBar_Transient)) {
+ if (d->flashed && style()->styleHint(QStyle::SH_ScrollBar_Transient, 0, this)) {
d->flashed = false;
update();
}
diff --git a/src/widgets/widgets/qslider.cpp b/src/widgets/widgets/qslider.cpp
index f96a44c29f..eb16faae2f 100644
--- a/src/widgets/widgets/qslider.cpp
+++ b/src/widgets/widgets/qslider.cpp
@@ -257,8 +257,8 @@ QStyle::SubControl QSliderPrivate::newHoverControl(const QPoint &pos)
\table 100%
\row \li \inlineimage macintosh-slider.png Screenshot of a Macintosh slider
\li A slider shown in the \l{Macintosh Style Widget Gallery}{Macintosh widget style}.
- \row \li \inlineimage windows-slider.png Screenshot of a Windows XP slider
- \li A slider shown in the \l{Windows XP Style Widget Gallery}{Windows XP widget style}.
+ \row \li \inlineimage windowsvista-slider.png Screenshot of a Windows Vista slider
+ \li A slider shown in the \l{Windows Vista Style Widget Gallery}{Windows Vista widget style}.
\row \li \inlineimage fusion-slider.png Screenshot of a Fusion slider
\li A slider shown in the \l{Fusion Style Widget Gallery}{Fusion widget style}.
\endtable
diff --git a/src/widgets/widgets/qspinbox.cpp b/src/widgets/widgets/qspinbox.cpp
index 4754f5c1a6..13fbf3a781 100644
--- a/src/widgets/widgets/qspinbox.cpp
+++ b/src/widgets/widgets/qspinbox.cpp
@@ -153,8 +153,8 @@ public:
setSpecialValueText() for how to do this with QSpinBox.
\table 100%
- \row \li \inlineimage windowsxp-spinbox.png Screenshot of a Windows XP spin box
- \li A spin box shown in the \l{Windows XP Style Widget Gallery}{Windows XP widget style}.
+ \row \li \inlineimage windowsvista-spinbox.png Screenshot of a Windows Vista spin box
+ \li A spin box shown in the \l{Windows Vista Style Widget Gallery}{Windows Vista widget style}.
\row \li \inlineimage fusion-spinbox.png Screenshot of a Fusion spin box
\li A spin box shown in the \l{Fusion Style Widget Gallery}{Fusion widget style}.
\row \li \inlineimage macintosh-spinbox.png Screenshot of a Macintosh spin box
diff --git a/src/widgets/widgets/qsplitter.cpp b/src/widgets/widgets/qsplitter.cpp
index 70c493cedd..9b605e4368 100644
--- a/src/widgets/widgets/qsplitter.cpp
+++ b/src/widgets/widgets/qsplitter.cpp
@@ -68,7 +68,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QSplitterHandle
- \brief The QSplitterHandle class provides handle functionality of the splitter.
+ \brief The QSplitterHandle class provides handle functionality for the splitter.
\ingroup organizers
\inmodule QtWidgets
@@ -80,7 +80,7 @@ QT_BEGIN_NAMESPACE
QSplitterHandle. It is provided for developers who want splitter handles
that provide extra features, such as popup menus.
- The typical way one would create splitter handles is to subclass QSplitter then
+ The typical way one would create splitter handles is to subclass QSplitter and then
reimplement QSplitter::createHandle() to instantiate the custom splitter
handle. For example, a minimum QSplitter subclass might look like this:
@@ -113,7 +113,7 @@ QT_BEGIN_NAMESPACE
/*!
Creates a QSplitter handle with the given \a orientation and
- QSplitter \a parent.
+ \a parent.
*/
QSplitterHandle::QSplitterHandle(Qt::Orientation orientation, QSplitter *parent)
: QWidget(*new QSplitterHandlePrivate, parent, 0)
@@ -888,7 +888,7 @@ QSplitterLayoutStruct *QSplitterPrivate::insertWidget(int index, QWidget *w)
A splitter lets the user control the size of child widgets by dragging the
- boundary between the children. Any number of widgets may be controlled by a
+ boundary between them. Any number of widgets may be controlled by a
single splitter. The typical use of a QSplitter is to create several
widgets and add them using insertWidget() or addWidget().
@@ -921,7 +921,7 @@ QSplitterLayoutStruct *QSplitterPrivate::insertWidget(int index, QWidget *w)
Alternatively, you can save and restore the sizes of the widgets from a
QByteArray using saveState() and restoreState() respectively.
- When you hide() a child its space will be distributed among the
+ When you hide() a child, its space will be distributed among the
other children. It will be reinstated when you show() it again.
\note Adding a QLayout to a QSplitter is not supported (either through
@@ -987,7 +987,7 @@ void QSplitter::refresh()
\property QSplitter::orientation
\brief the orientation of the splitter
- By default the orientation is horizontal (i.e., the widgets are
+ By default, the orientation is horizontal (i.e., the widgets are
laid out side by side). The possible orientations are
Qt::Horizontal and Qt::Vertical.
@@ -1046,7 +1046,7 @@ bool QSplitter::childrenCollapsible() const
}
/*!
- Sets whether the child widget at index \a index is collapsible to \a collapse.
+ Sets whether the child widget at \a index is collapsible to \a collapse.
By default, children are collapsible, meaning that the user can
resize them down to size 0, even if they have a non-zero
@@ -1070,7 +1070,7 @@ void QSplitter::setCollapsible(int index, bool collapse)
}
/*!
- Returns true if the widget at \a index is collapsible, otherwise returns false
+ Returns true if the widget at \a index is collapsible, otherwise returns false.
*/
bool QSplitter::isCollapsible(int index) const
{
@@ -1372,7 +1372,7 @@ void QSplitter::moveSplitter(int pos, int index)
/*!
- Returns the valid range of the splitter with index \a index in
+ Returns the valid range of the splitter at \a index in
*\a{min} and *\a{max} if \a min and \a max are not 0.
*/
@@ -1384,8 +1384,7 @@ void QSplitter::getRange(int index, int *min, int *max) const
/*!
- Returns the closest legal position to \a pos of the widget with index
- \a index.
+ Returns the closest legal position to \a pos of the widget at \a index.
For right-to-left languages such as Arabic and Hebrew, the layout
of horizontal splitters is reversed. Positions are then measured
@@ -1484,7 +1483,7 @@ QSize QSplitter::minimumSizeHint() const
If the splitter's orientation is horizontal, the list contains the
widgets width in pixels, from left to right; if the orientation is
- vertical, the list contains the widgets height in pixels,
+ vertical, the list contains the widgets' heights in pixels,
from top to bottom.
Giving the values to another splitter's setSizes() function will
@@ -1509,21 +1508,21 @@ QList<int> QSplitter::sizes() const
}
/*!
- Sets the child widgets respective sizes to the values given in the \a list.
+ Sets the child widgets' respective sizes to the values given in the \a list.
- If the splitter is horizontal, the values set the widths of each
+ If the splitter is horizontal, the values set the width of each
widget in pixels, from left to right. If the splitter is vertical, the
- heights of each widget is set, from top to bottom.
+ height of each widget is set, from top to bottom.
Extra values in the \a list are ignored. If \a list contains too few
- values, the result is undefined but the program will still be well-behaved.
+ values, the result is undefined, but the program will still be well-behaved.
The overall size of the splitter widget is not affected.
Instead, any additional/missing space is distributed amongst the
widgets according to the relative weight of the sizes.
If you specify a size of 0, the widget will be invisible. The size policies
- of the widgets are preserved. That is, a value smaller then the minimal size
+ of the widgets are preserved. That is, a value smaller than the minimal size
hint of the respective widget will be replaced by the value of the hint.
\sa sizes()
@@ -1616,7 +1615,7 @@ QByteArray QSplitter::saveState() const
Typically this is used in conjunction with QSettings to restore the size
from a past session. Here is an example:
- Restore the splitters's state:
+ Restore the splitter's state:
\snippet splitter/splitter.cpp 2
diff --git a/src/widgets/widgets/qtabwidget.cpp b/src/widgets/widgets/qtabwidget.cpp
index df9ca56e88..abb781960e 100644
--- a/src/widgets/widgets/qtabwidget.cpp
+++ b/src/widgets/widgets/qtabwidget.cpp
@@ -120,10 +120,10 @@ QT_BEGIN_NAMESPACE
area, organizing the individual pages).
\table 100%
- \row \li \inlineimage windowsxp-tabwidget.png Screenshot of a Windows XP style tab widget
+ \row \li \inlineimage windowsvista-tabwidget.png Screenshot of a Windows Vista style tab widget
\li \inlineimage macintosh-tabwidget.png Screenshot of a Macintosh style tab widget
\li \inlineimage fusion-tabwidget.png Screenshot of a Fusion style tab widget
- \row \li A Windows XP style tab widget.
+ \row \li A Windows Vista style tab widget.
\li A Macintosh style tab widget.
\li A Fusion style tab widget.
\endtable
diff --git a/src/widgets/widgets/qtextedit.cpp b/src/widgets/widgets/qtextedit.cpp
index 9f7d66b344..70dcc5b506 100644
--- a/src/widgets/widgets/qtextedit.cpp
+++ b/src/widgets/widgets/qtextedit.cpp
@@ -53,6 +53,9 @@
#include <qmenu.h>
#include <qstyle.h>
#include <qtimer.h>
+#ifndef QT_NO_ACCESSIBILITY
+#include <qaccessible.h>
+#endif
#include "private/qtextdocumentlayout_p.h"
#include "qtextdocument.h"
#include "private/qtextdocument_p.h"
@@ -154,7 +157,7 @@ void QTextEditPrivate::init(const QString &html)
QObject::connect(control, SIGNAL(redoAvailable(bool)), q, SIGNAL(redoAvailable(bool)));
QObject::connect(control, SIGNAL(copyAvailable(bool)), q, SIGNAL(copyAvailable(bool)));
QObject::connect(control, SIGNAL(selectionChanged()), q, SIGNAL(selectionChanged()));
- QObject::connect(control, SIGNAL(cursorPositionChanged()), q, SIGNAL(cursorPositionChanged()));
+ QObject::connect(control, SIGNAL(cursorPositionChanged()), q, SLOT(_q_cursorPositionChanged()));
QObject::connect(control, SIGNAL(textChanged()), q, SLOT(updateMicroFocus()));
@@ -206,6 +209,16 @@ void QTextEditPrivate::_q_repaintContents(const QRectF &contentsRect)
viewport->update(r);
}
+void QTextEditPrivate::_q_cursorPositionChanged()
+{
+ Q_Q(QTextEdit);
+ emit q->cursorPositionChanged();
+#ifndef QT_NO_ACCESSIBILITY
+ QAccessibleTextCursorEvent event(q, q->textCursor().position());
+ QAccessible::updateAccessibility(&event);
+#endif
+}
+
void QTextEditPrivate::pageUpDown(QTextCursor::MoveOperation op, QTextCursor::MoveMode moveMode)
{
QTextCursor cursor = control->textCursor();
diff --git a/src/widgets/widgets/qtextedit.h b/src/widgets/widgets/qtextedit.h
index 178aa7b907..5df44da4cf 100644
--- a/src/widgets/widgets/qtextedit.h
+++ b/src/widgets/widgets/qtextedit.h
@@ -304,6 +304,7 @@ private:
Q_PRIVATE_SLOT(d_func(), void _q_currentCharFormatChanged(const QTextCharFormat &))
Q_PRIVATE_SLOT(d_func(), void _q_adjustScrollbars())
Q_PRIVATE_SLOT(d_func(), void _q_ensureVisible(const QRectF &))
+ Q_PRIVATE_SLOT(d_func(), void _q_cursorPositionChanged())
friend class QTextEditControl;
friend class QTextDocument;
friend class QWidgetTextControl;
diff --git a/src/widgets/widgets/qtextedit_p.h b/src/widgets/widgets/qtextedit_p.h
index d2dd81c13b..7038f16205 100644
--- a/src/widgets/widgets/qtextedit_p.h
+++ b/src/widgets/widgets/qtextedit_p.h
@@ -99,6 +99,7 @@ public:
{ control->processEvent(e, QPointF(horizontalOffset(), verticalOffset()), viewport); }
void _q_currentCharFormatChanged(const QTextCharFormat &format);
+ void _q_cursorPositionChanged();
void updateDefaultTextOption();
diff --git a/src/widgets/widgets/qtoolbar.cpp b/src/widgets/widgets/qtoolbar.cpp
index 2681b0ab4e..80d42e4c95 100644
--- a/src/widgets/widgets/qtoolbar.cpp
+++ b/src/widgets/widgets/qtoolbar.cpp
@@ -273,7 +273,7 @@ bool QToolBarPrivate::mousePressEvent(QMouseEvent *event)
q->initStyleOption(&opt);
if (q->style()->subElementRect(QStyle::SE_ToolBarHandle, &opt, q).contains(event->pos()) == false) {
#ifdef Q_WS_MAC
- // When using the unified toolbar on Mac OS X the user can can click and
+ // When using the unified toolbar on Mac OS X, the user can click and
// drag between toolbar contents to move the window. Make this work by
// implementing the standard mouse-dragging code and then call
// window->move() in mouseMoveEvent below.
@@ -421,13 +421,13 @@ void QToolBarPrivate::plug(const QRect &r)
or insertAction(). Groups of buttons can be separated using
addSeparator() or insertSeparator(). If a toolbar button is not
appropriate, a widget can be inserted instead using addWidget() or
- insertWidget(); examples of suitable widgets are QSpinBox,
- QDoubleSpinBox, and QComboBox. When a toolbar button is pressed it
+ insertWidget(). Examples of suitable widgets are QSpinBox,
+ QDoubleSpinBox, and QComboBox. When a toolbar button is pressed, it
emits the actionTriggered() signal.
- A toolbar can be fixed in place in a particular area (e.g. at the
- top of the window), or it can be movable (isMovable()) between
- toolbar areas; see allowedAreas() and isAreaAllowed().
+ A toolbar can be fixed in place in a particular area (e.g., at the
+ top of the window), or it can be movable between toolbar areas;
+ see setMovable(), isMovable(), allowedAreas() and isAreaAllowed().
When a toolbar is resized in such a way that it is too small to
show all the items it contains, an extension button will appear as
@@ -454,7 +454,7 @@ void QToolBarPrivate::plug(const QRect &r)
\fn void QToolBar::addAction(QAction *action)
\overload
- Appends the action \a action to the toolbar's list of actions.
+ Appends the \a action to the toolbar's list of actions.
\sa QMenu::addAction(), QWidget::addAction()
*/
@@ -464,7 +464,7 @@ void QToolBarPrivate::plug(const QRect &r)
This signal is emitted when an action in this toolbar is triggered.
This happens when the action's tool button is pressed, or when the
- action is triggered in some other way outside the tool bar. The parameter
+ action is triggered in some other way outside the toolbar. The parameter
holds the triggered \a action.
*/
@@ -481,7 +481,7 @@ void QToolBarPrivate::plug(const QRect &r)
/*!
\fn void QToolBar::iconSizeChanged(const QSize &iconSize)
- This signal is emitted when the icon size is changed. The \a
+ This signal is emitted when the icon size is changed. The \a
iconSize parameter holds the toolbar's new icon size.
\sa iconSize, QMainWindow::iconSize
@@ -501,7 +501,7 @@ void QToolBarPrivate::plug(const QRect &r)
\fn void QToolBar::orientationChanged(Qt::Orientation orientation)
This signal is emitted when the orientation of the toolbar changes.
- The new orientation is specified by the \a orientation given.
+ The \a orientation parameter holds the toolbar's new orientation.
\sa orientation
*/
@@ -583,7 +583,7 @@ QToolBar::~QToolBar()
/*! \property QToolBar::movable
\brief whether the user can move the toolbar within the toolbar area,
- or between toolbar areas
+ or between toolbar areas.
By default, this property is true.
@@ -681,8 +681,8 @@ Qt::ToolBarAreas QToolBar::allowedAreas() const
This function should not be used when the toolbar is managed
by QMainWindow. You can use QMainWindow::addToolBar() or
- QMainWindow::insertToolBar() if you wish to move a toolbar (that
- is already added to a main window) to another Qt::ToolBarArea.
+ QMainWindow::insertToolBar() if you wish to move a toolbar that
+ is already added to a main window to another Qt::ToolBarArea.
*/
void QToolBar::setOrientation(Qt::Orientation orientation)
@@ -833,7 +833,7 @@ QAction *QToolBar::addAction(const QString &text,
/*!
\overload
- Creates a new action with the icon \a icon and text \a text. This
+ Creates a new action with the given \a icon and \a text. This
action is added to the end of the toolbar. The action's
\l{QAction::triggered()}{triggered()} signal is connected to \a
member in \a receiver.
@@ -880,7 +880,7 @@ QAction *QToolBar::insertSeparator(QAction *before)
The toolbar takes ownership of \a widget.
- If you add a QToolButton with this method, the tools bar's
+ If you add a QToolButton with this method, the toolbar's
Qt::ToolButtonStyle will not be respected.
\note You should use QAction::setVisible() to change the
diff --git a/src/winmain/winmain.pro b/src/winmain/winmain.pro
index e5da5bd97f..32eae0b9fe 100644
--- a/src/winmain/winmain.pro
+++ b/src/winmain/winmain.pro
@@ -5,7 +5,7 @@ TEMPLATE = lib
TARGET = qtmain
DESTDIR = $$QT.core.libs
-CONFIG += static warn_on depend_includepath
+CONFIG += static
QT = core
contains(QT_CONFIG, build_all):CONFIG += build_all
diff --git a/src/xml/doc/qtxml.qdocconf b/src/xml/doc/qtxml.qdocconf
index 3796e4d53e..bf77059a02 100644
--- a/src/xml/doc/qtxml.qdocconf
+++ b/src/xml/doc/qtxml.qdocconf
@@ -3,21 +3,21 @@ include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf)
project = QtXml
description = Qt XML Reference Documentation
url = http://qt-project.org/doc/qtxml
-version = 5.0.0
+version = 5.0.1
examplesinstallpath = xml
qhp.projects = QtXml
qhp.QtXml.file = qtxml.qhp
-qhp.QtXml.namespace = org.qt-project.qtxml.500
+qhp.QtXml.namespace = org.qt-project.qtxml.501
qhp.QtXml.virtualFolder = qtxml
qhp.QtXml.indexTitle = Qt XML
qhp.QtXml.indexRoot =
-qhp.QtXml.filterAttributes = qtxml 5.0.0 qtrefdoc
-qhp.QtXml.customFilters.Qt.name = QtXml 5.0.0
-qhp.QtXml.customFilters.Qt.filterAttributes = qtxml 5.0.0
+qhp.QtXml.filterAttributes = qtxml 5.0.1 qtrefdoc
+qhp.QtXml.customFilters.Qt.name = QtXml 5.0.1
+qhp.QtXml.customFilters.Qt.filterAttributes = qtxml 5.0.1
qhp.QtXml.subprojects = classes
qhp.QtXml.subprojects.classes.title = C++ Classes