summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/3rdparty/harfbuzz/src/harfbuzz-greek.c4
-rw-r--r--src/corelib/global/qmalloc.cpp2
-rw-r--r--src/corelib/io/qdataurl.cpp4
-rw-r--r--src/corelib/io/qurl.cpp4
-rw-r--r--src/corelib/json/qjsonvalue.cpp10
-rw-r--r--src/corelib/json/qjsonvalue.h1
-rw-r--r--src/corelib/kernel/qmetatype.cpp9
-rw-r--r--src/corelib/kernel/qmetatype.h7
-rw-r--r--src/corelib/kernel/qobject.cpp3
-rw-r--r--src/corelib/kernel/qobject_p.h1
-rw-r--r--src/corelib/kernel/qobjectdefs.h2
-rw-r--r--src/corelib/kernel/qvariant.cpp32
-rw-r--r--src/corelib/kernel/qvariant.h1
-rw-r--r--src/corelib/mimetypes/qmimeprovider.cpp3
-rw-r--r--src/corelib/mimetypes/qmimetype.cpp5
-rw-r--r--src/corelib/mimetypes/qmimetype_p.h1
-rw-r--r--src/corelib/plugin/qfactoryloader.cpp33
-rw-r--r--src/corelib/plugin/qfactoryloader_p.h32
-rw-r--r--src/corelib/tools/qlocale.cpp3
-rw-r--r--src/corelib/tools/qstring.cpp8
-rw-r--r--src/corelib/tools/qstring.h8
-rw-r--r--src/dbus/qdbuspendingcall.cpp8
-rw-r--r--src/dbus/qdbuspendingcall.h2
-rw-r--r--src/dbus/qdbusunixfiledescriptor.cpp8
-rw-r--r--src/dbus/qdbusunixfiledescriptor.h3
-rw-r--r--src/gui/accessible/accessible.pri2
-rw-r--r--src/gui/accessible/qaccessible.cpp27
-rw-r--r--src/gui/accessible/qplatformaccessibility.h (renamed from src/gui/accessible/qplatformaccessibility_qpa.h)0
-rw-r--r--src/gui/accessible/qplatformaccessibility_qpa.cpp24
-rw-r--r--src/gui/image/image.pri2
-rw-r--r--src/gui/image/qbitmap.cpp4
-rw-r--r--src/gui/image/qimage.cpp4
-rw-r--r--src/gui/image/qimagepixmapcleanuphooks.cpp2
-rw-r--r--src/gui/image/qimagereader.cpp59
-rw-r--r--src/gui/image/qimagewriter.cpp54
-rw-r--r--src/gui/image/qnativeimage.cpp2
-rw-r--r--src/gui/image/qpicture.cpp14
-rw-r--r--src/gui/image/qpixmap.cpp4
-rw-r--r--src/gui/image/qpixmap_blitter_p.h2
-rw-r--r--src/gui/image/qpixmap_raster_p.h2
-rw-r--r--src/gui/image/qpixmap_win.cpp2
-rw-r--r--src/gui/image/qplatformpixmap.cpp4
-rw-r--r--src/gui/image/qplatformpixmap.h (renamed from src/gui/image/qplatformpixmap_qpa.h)0
-rw-r--r--src/gui/kernel/kernel.pri42
-rw-r--r--src/gui/kernel/qclipboard_qpa.cpp4
-rw-r--r--src/gui/kernel/qcursor_qpa.cpp2
-rw-r--r--src/gui/kernel/qdnd.cpp4
-rw-r--r--src/gui/kernel/qgenericpluginfactory_qpa.cpp19
-rw-r--r--src/gui/kernel/qguiapplication.cpp46
-rw-r--r--src/gui/kernel/qguiapplication_p.h4
-rw-r--r--src/gui/kernel/qinputmethod.cpp2
-rw-r--r--src/gui/kernel/qinputmethod_p.h4
-rw-r--r--src/gui/kernel/qkeysequence.cpp16
-rw-r--r--src/gui/kernel/qkeysequence.h3
-rw-r--r--src/gui/kernel/qopenglcontext.cpp4
-rw-r--r--src/gui/kernel/qplatformclipboard.h (renamed from src/gui/kernel/qplatformclipboard_qpa.h)0
-rw-r--r--src/gui/kernel/qplatformclipboard_qpa.cpp2
-rw-r--r--src/gui/kernel/qplatformcursor.h (renamed from src/gui/kernel/qplatformcursor_qpa.h)2
-rw-r--r--src/gui/kernel/qplatformcursor_qpa.cpp4
-rw-r--r--src/gui/kernel/qplatformdialoghelper.h (renamed from src/gui/kernel/qplatformdialoghelper_qpa.h)10
-rw-r--r--src/gui/kernel/qplatformdialoghelper_qpa.cpp7
-rw-r--r--src/gui/kernel/qplatformdrag.h (renamed from src/gui/kernel/qplatformdrag_qpa.h)0
-rw-r--r--src/gui/kernel/qplatformdrag_qpa.cpp2
-rw-r--r--src/gui/kernel/qplatforminputcontext.h (renamed from src/gui/kernel/qplatforminputcontext_qpa.h)0
-rw-r--r--src/gui/kernel/qplatforminputcontext_p.h (renamed from src/gui/kernel/qplatforminputcontext_qpa_p.h)0
-rw-r--r--src/gui/kernel/qplatforminputcontext_qpa.cpp4
-rw-r--r--src/gui/kernel/qplatformintegration.h (renamed from src/gui/kernel/qplatformintegration_qpa.h)2
-rw-r--r--src/gui/kernel/qplatformintegration_qpa.cpp12
-rw-r--r--src/gui/kernel/qplatformintegrationfactory_p.h (renamed from src/gui/kernel/qplatformintegrationfactory_qpa_p.h)0
-rw-r--r--src/gui/kernel/qplatformintegrationfactory_qpa.cpp40
-rw-r--r--src/gui/kernel/qplatformintegrationplugin.h (renamed from src/gui/kernel/qplatformintegrationplugin_qpa.h)0
-rw-r--r--src/gui/kernel/qplatformintegrationplugin_qpa.cpp2
-rw-r--r--src/gui/kernel/qplatformnativeinterface.h (renamed from src/gui/kernel/qplatformnativeinterface_qpa.h)0
-rw-r--r--src/gui/kernel/qplatformnativeinterface_qpa.cpp2
-rw-r--r--src/gui/kernel/qplatformopenglcontext.h (renamed from src/gui/kernel/qplatformopenglcontext_qpa.h)0
-rw-r--r--src/gui/kernel/qplatformopenglcontext_qpa.cpp2
-rw-r--r--src/gui/kernel/qplatformscreen.h (renamed from src/gui/kernel/qplatformscreen_qpa.h)4
-rw-r--r--src/gui/kernel/qplatformscreen_p.h (renamed from src/gui/kernel/qplatformscreen_qpa_p.h)0
-rw-r--r--src/gui/kernel/qplatformscreen_qpa.cpp23
-rw-r--r--src/gui/kernel/qplatformscreenpageflipper.h (renamed from src/gui/kernel/qplatformscreenpageflipper_qpa.h)0
-rw-r--r--src/gui/kernel/qplatformscreenpageflipper_qpa.cpp2
-rw-r--r--src/gui/kernel/qplatformservices.h (renamed from src/gui/kernel/qplatformservices_qpa.h)0
-rw-r--r--src/gui/kernel/qplatformservices_qpa.cpp2
-rw-r--r--src/gui/kernel/qplatformsharedgraphicscache.h (renamed from src/gui/kernel/qplatformsharedgraphicscache_qpa.h)0
-rw-r--r--src/gui/kernel/qplatformsharedgraphicscache_qpa.cpp2
-rw-r--r--src/gui/kernel/qplatformsurface.h (renamed from src/gui/kernel/qplatformsurface_qpa.h)0
-rw-r--r--src/gui/kernel/qplatformsurface_qpa.cpp2
-rw-r--r--src/gui/kernel/qplatformtheme.h (renamed from src/gui/kernel/qplatformtheme_qpa.h)14
-rw-r--r--src/gui/kernel/qplatformtheme_qpa.cpp6
-rw-r--r--src/gui/kernel/qplatformthemefactory_p.h (renamed from src/gui/kernel/qplatformthemefactory_qpa_p.h)0
-rw-r--r--src/gui/kernel/qplatformthemefactory_qpa.cpp38
-rw-r--r--src/gui/kernel/qplatformthemeplugin.h (renamed from src/gui/kernel/qplatformthemeplugin_qpa.h)0
-rw-r--r--src/gui/kernel/qplatformthemeplugin_qpa.cpp2
-rw-r--r--src/gui/kernel/qplatformwindow.h (renamed from src/gui/kernel/qplatformwindow_qpa.h)4
-rw-r--r--src/gui/kernel/qplatformwindow_qpa.cpp2
-rw-r--r--src/gui/kernel/qscreen.cpp12
-rw-r--r--src/gui/kernel/qscreen.h4
-rw-r--r--src/gui/kernel/qscreen_p.h4
-rw-r--r--src/gui/kernel/qstylehints.cpp2
-rw-r--r--src/gui/kernel/qwindow.cpp6
-rw-r--r--src/gui/kernel/qwindow_p.h2
-rw-r--r--src/gui/kernel/qwindowsysteminterface_qpa.cpp11
-rw-r--r--src/gui/kernel/qwindowsysteminterface_qpa.h1
-rw-r--r--src/gui/kernel/qwindowsysteminterface_qpa_p.h9
-rw-r--r--src/gui/opengl/qopenglbuffer.cpp25
-rw-r--r--src/gui/opengl/qopengltexturecache.cpp2
-rw-r--r--src/gui/painting/painting.pri2
-rw-r--r--src/gui/painting/qbackingstore.cpp4
-rw-r--r--src/gui/painting/qbezier.cpp11
-rw-r--r--src/gui/painting/qplatformbackingstore.h (renamed from src/gui/painting/qplatformbackingstore_qpa.h)0
-rw-r--r--src/gui/painting/qplatformbackingstore_qpa.cpp2
-rw-r--r--src/gui/text/qfont.cpp2
-rw-r--r--src/gui/text/qfont_qpa.cpp4
-rw-r--r--src/gui/text/qfontdatabase.cpp4
-rw-r--r--src/gui/text/qfontdatabase_qpa.cpp2
-rw-r--r--src/gui/text/qfontengine_qpa.cpp4
-rw-r--r--src/gui/text/qplatformfontdatabase.h (renamed from src/gui/text/qplatformfontdatabase_qpa.h)0
-rw-r--r--src/gui/text/qplatformfontdatabase_qpa.cpp2
-rw-r--r--src/gui/text/qrawfont_qpa.cpp4
-rw-r--r--src/gui/text/qtextengine.cpp39
-rw-r--r--src/gui/text/qtextengine_p.h8
-rw-r--r--src/gui/text/text.pri2
-rw-r--r--src/gui/util/qdesktopservices.cpp4
-rw-r--r--src/network/access/qnetworkreplyhttpimpl.cpp2
-rw-r--r--src/network/bearer/qnetworkconfigmanager_p.cpp29
-rw-r--r--src/network/bearer/qnetworksession.cpp2
-rw-r--r--src/network/kernel/qauthenticator.cpp87
-rw-r--r--src/network/kernel/qauthenticator_p.h4
-rw-r--r--src/opengl/qgl.cpp4
-rw-r--r--src/opengl/qgl_qpa.cpp4
-rw-r--r--src/platformsupport/dnd/qsimpledrag_p.h2
-rw-r--r--src/platformsupport/eglconvenience/qeglplatformcontext.cpp2
-rw-r--r--src/platformsupport/eglconvenience/qeglplatformcontext_p.h4
-rw-r--r--src/platformsupport/fb_base/fb_base.cpp2
-rw-r--r--src/platformsupport/fb_base/fb_base_p.h6
-rw-r--r--src/platformsupport/fontdatabases/basic/qbasicfontdatabase.cpp2
-rw-r--r--src/platformsupport/fontdatabases/basic/qbasicfontdatabase_p.h2
-rw-r--r--src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp2
-rw-r--r--src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase_p.h2
-rw-r--r--src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h2
-rw-r--r--src/platformsupport/inputcontext/inputcontext.pri4
-rw-r--r--src/platformsupport/inputcontext/qplatforminputcontextfactory_p.h (renamed from src/platformsupport/inputcontext/qplatforminputcontextfactory_qpa_p.h)0
-rw-r--r--src/platformsupport/inputcontext/qplatforminputcontextfactory_qpa.cpp6
-rw-r--r--src/platformsupport/inputcontext/qplatforminputcontextplugin_p.h (renamed from src/platformsupport/inputcontext/qplatforminputcontextplugin_qpa_p.h)0
-rw-r--r--src/platformsupport/inputcontext/qplatforminputcontextplugin_qpa.cpp2
-rw-r--r--src/platformsupport/printersupport/genericunix/qgenericunixprintersupport_p.h2
-rw-r--r--src/platformsupport/services/genericunix/qgenericunixservices_p.h2
-rw-r--r--src/platformsupport/themes/genericunix/qgenericunixthemes_p.h2
-rw-r--r--src/plugins/generic/evdevtouch/qevdevtouch.cpp8
-rw-r--r--src/plugins/platforminputcontexts/ibus/ibus.pro2
-rw-r--r--src/plugins/platforminputcontexts/ibus/main.cpp2
-rw-r--r--src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.h2
-rw-r--r--src/plugins/platforminputcontexts/maliit/main.cpp2
-rw-r--r--src/plugins/platforminputcontexts/maliit/maliit.pro2
-rw-r--r--src/plugins/platforminputcontexts/maliit/qmaliitplatforminputcontext.h2
-rw-r--r--src/plugins/platforms/cocoa/cocoa.pro2
-rw-r--r--src/plugins/platforms/cocoa/main.mm4
-rw-r--r--src/plugins/platforms/cocoa/qcocoabackingstore.h2
-rw-r--r--src/plugins/platforms/cocoa/qcocoaclipboard.h2
-rw-r--r--src/plugins/platforms/cocoa/qcocoacolordialoghelper.h6
-rw-r--r--src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm37
-rw-r--r--src/plugins/platforms/cocoa/qcocoacursor.h2
-rw-r--r--src/plugins/platforms/cocoa/qcocoadrag.h2
-rw-r--r--src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm4
-rw-r--r--src/plugins/platforms/cocoa/qcocoafiledialoghelper.h6
-rw-r--r--src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm30
-rw-r--r--src/plugins/platforms/cocoa/qcocoafontdialoghelper.h8
-rw-r--r--src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm37
-rw-r--r--src/plugins/platforms/cocoa/qcocoaglcontext.h2
-rw-r--r--src/plugins/platforms/cocoa/qcocoahelpers.mm2
-rw-r--r--src/plugins/platforms/cocoa/qcocoainputcontext.h2
-rw-r--r--src/plugins/platforms/cocoa/qcocoaintegration.h2
-rw-r--r--src/plugins/platforms/cocoa/qcocoaintegration.mm2
-rw-r--r--src/plugins/platforms/cocoa/qcocoanativeinterface.h4
-rw-r--r--src/plugins/platforms/cocoa/qcocoanativeinterface.mm4
-rw-r--r--src/plugins/platforms/cocoa/qcocoaprintersupport.h2
-rw-r--r--src/plugins/platforms/cocoa/qcocoaservices.h2
-rw-r--r--src/plugins/platforms/cocoa/qcocoasystemsettings.h2
-rw-r--r--src/plugins/platforms/cocoa/qcocoatheme.h2
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.h2
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.mm2
-rw-r--r--src/plugins/platforms/cocoa/qmenu_mac.h2
-rw-r--r--src/plugins/platforms/cocoa/qpaintengine_mac.mm2
-rw-r--r--src/plugins/platforms/cocoa/qprintengine_mac.mm2
-rw-r--r--src/plugins/platforms/directfb/main.cpp2
-rw-r--r--src/plugins/platforms/directfb/qdirectfb_egl.cpp2
-rw-r--r--src/plugins/platforms/directfb/qdirectfbbackingstore.h2
-rw-r--r--src/plugins/platforms/directfb/qdirectfbcursor.h2
-rw-r--r--src/plugins/platforms/directfb/qdirectfbeglhooks.h2
-rw-r--r--src/plugins/platforms/directfb/qdirectfbglcontext.h2
-rw-r--r--src/plugins/platforms/directfb/qdirectfbintegration.cpp2
-rw-r--r--src/plugins/platforms/directfb/qdirectfbintegration.h2
-rw-r--r--src/plugins/platforms/directfb/qdirectfbscreen.h2
-rw-r--r--src/plugins/platforms/directfb/qdirectfbwindow.h2
-rw-r--r--src/plugins/platforms/eglfs/main.cpp2
-rw-r--r--src/plugins/platforms/eglfs/qeglfsbackingstore.h2
-rw-r--r--src/plugins/platforms/eglfs/qeglfshooks.h2
-rw-r--r--src/plugins/platforms/eglfs/qeglfsintegration.cpp2
-rw-r--r--src/plugins/platforms/eglfs/qeglfsintegration.h4
-rw-r--r--src/plugins/platforms/eglfs/qeglfsscreen.h2
-rw-r--r--src/plugins/platforms/eglfs/qeglfswindow.h2
-rw-r--r--src/plugins/platforms/kms/main.cpp2
-rw-r--r--src/plugins/platforms/kms/qkmsbackingstore.h2
-rw-r--r--src/plugins/platforms/kms/qkmscontext.cpp1
-rw-r--r--src/plugins/platforms/kms/qkmscontext.h2
-rw-r--r--src/plugins/platforms/kms/qkmscursor.h2
-rw-r--r--src/plugins/platforms/kms/qkmsintegration.h4
-rw-r--r--src/plugins/platforms/kms/qkmsnativeinterface.h2
-rw-r--r--src/plugins/platforms/kms/qkmsscreen.h2
-rw-r--r--src/plugins/platforms/kms/qkmswindow.h2
-rw-r--r--src/plugins/platforms/linuxfb/main.cpp2
-rw-r--r--src/plugins/platforms/linuxfb/qlinuxfbintegration.h2
-rw-r--r--src/plugins/platforms/minimal/main.cpp2
-rw-r--r--src/plugins/platforms/minimal/qminimalbackingstore.cpp2
-rw-r--r--src/plugins/platforms/minimal/qminimalbackingstore.h4
-rw-r--r--src/plugins/platforms/minimal/qminimalintegration.cpp2
-rw-r--r--src/plugins/platforms/minimal/qminimalintegration.h4
-rw-r--r--src/plugins/platforms/openwfd/main.cpp2
-rw-r--r--src/plugins/platforms/openwfd/qopenwfdbackingstore.h2
-rw-r--r--src/plugins/platforms/openwfd/qopenwfdglcontext.h2
-rw-r--r--src/plugins/platforms/openwfd/qopenwfdintegration.h4
-rw-r--r--src/plugins/platforms/openwfd/qopenwfdnativeinterface.h2
-rw-r--r--src/plugins/platforms/openwfd/qopenwfdscreen.h2
-rw-r--r--src/plugins/platforms/openwfd/qopenwfdwindow.h2
-rw-r--r--src/plugins/platforms/qnx/main.h2
-rw-r--r--src/plugins/platforms/qnx/qqnxclipboard.h2
-rw-r--r--src/plugins/platforms/qnx/qqnxglbackingstore.h2
-rw-r--r--src/plugins/platforms/qnx/qqnxglcontext.h2
-rw-r--r--src/plugins/platforms/qnx/qqnxinputcontext_imf.h4
-rw-r--r--src/plugins/platforms/qnx/qqnxinputcontext_noimf.h4
-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/qqnxnativeinterface.h2
-rw-r--r--src/plugins/platforms/qnx/qqnxrasterbackingstore.h2
-rw-r--r--src/plugins/platforms/qnx/qqnxscreen.h2
-rw-r--r--src/plugins/platforms/qnx/qqnxservices.h2
-rw-r--r--src/plugins/platforms/qnx/qqnxwindow.h2
-rw-r--r--src/plugins/platforms/windows/accessible/qwindowsaccessibility.cpp2
-rw-r--r--src/plugins/platforms/windows/accessible/qwindowsaccessibility.h2
-rw-r--r--src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.cpp2
-rw-r--r--src/plugins/platforms/windows/main.cpp2
-rw-r--r--src/plugins/platforms/windows/qwindowsbackingstore.h2
-rw-r--r--src/plugins/platforms/windows/qwindowsclipboard.h2
-rw-r--r--src/plugins/platforms/windows/qwindowscontext.cpp38
-rw-r--r--src/plugins/platforms/windows/qwindowscursor.h2
-rw-r--r--src/plugins/platforms/windows/qwindowsdialoghelpers.cpp46
-rw-r--r--src/plugins/platforms/windows/qwindowsdialoghelpers.h9
-rw-r--r--src/plugins/platforms/windows/qwindowsdrag.h2
-rw-r--r--src/plugins/platforms/windows/qwindowsfontdatabase.h2
-rw-r--r--src/plugins/platforms/windows/qwindowsfontengine.cpp2
-rw-r--r--src/plugins/platforms/windows/qwindowsglcontext.cpp2
-rw-r--r--src/plugins/platforms/windows/qwindowsglcontext.h2
-rw-r--r--src/plugins/platforms/windows/qwindowsinputcontext.h2
-rw-r--r--src/plugins/platforms/windows/qwindowsintegration.cpp10
-rw-r--r--src/plugins/platforms/windows/qwindowsintegration.h2
-rw-r--r--src/plugins/platforms/windows/qwindowsscreen.cpp6
-rw-r--r--src/plugins/platforms/windows/qwindowsscreen.h4
-rw-r--r--src/plugins/platforms/windows/qwindowsservices.h2
-rw-r--r--src/plugins/platforms/windows/qwindowstheme.cpp18
-rw-r--r--src/plugins/platforms/windows/qwindowstheme.h2
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.cpp42
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.h4
-rw-r--r--src/plugins/platforms/xcb/README4
-rw-r--r--src/plugins/platforms/xcb/main.cpp2
-rw-r--r--src/plugins/platforms/xcb/qdri2context.h2
-rw-r--r--src/plugins/platforms/xcb/qglxintegration.h2
-rw-r--r--src/plugins/platforms/xcb/qxcbbackingstore.h2
-rw-r--r--src/plugins/platforms/xcb/qxcbclipboard.h2
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection.cpp39
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection.h4
-rw-r--r--src/plugins/platforms/xcb/qxcbcursor.h2
-rw-r--r--src/plugins/platforms/xcb/qxcbdrag.h2
-rw-r--r--src/plugins/platforms/xcb/qxcbintegration.cpp6
-rw-r--r--src/plugins/platforms/xcb/qxcbintegration.h4
-rw-r--r--src/plugins/platforms/xcb/qxcbkeyboard.cpp4
-rw-r--r--src/plugins/platforms/xcb/qxcbnativeinterface.h2
-rw-r--r--src/plugins/platforms/xcb/qxcbscreen.cpp39
-rw-r--r--src/plugins/platforms/xcb/qxcbscreen.h6
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.cpp49
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.h6
-rw-r--r--src/plugins/platforms/xcb/xcb.pro2
-rw-r--r--src/plugins/printsupport/cocoa/cocoa.pro2
-rw-r--r--src/plugins/printsupport/cocoa/main.cpp4
-rw-r--r--src/plugins/printsupport/windows/main.cpp2
-rw-r--r--src/plugins/printsupport/windows/qwindowsprintersupport.h2
-rw-r--r--src/printsupport/dialogs/qpagesetupdialog_mac.mm2
-rw-r--r--src/printsupport/dialogs/qpagesetupdialog_win.cpp2
-rw-r--r--src/printsupport/kernel/kernel.pri4
-rw-r--r--src/printsupport/kernel/qplatformprintersupport.h (renamed from src/printsupport/kernel/qplatformprintersupport_qpa.h)0
-rw-r--r--src/printsupport/kernel/qplatformprintersupport_qpa.cpp2
-rw-r--r--src/printsupport/kernel/qplatformprintplugin.cpp12
-rw-r--r--src/printsupport/kernel/qplatformprintplugin.h (renamed from src/printsupport/kernel/qplatformprintplugin_qpa.h)0
-rw-r--r--src/printsupport/kernel/qprintengine_win.cpp2
-rw-r--r--src/printsupport/kernel/qprinter.cpp4
-rw-r--r--src/printsupport/kernel/qprinterinfo.cpp4
-rw-r--r--src/sql/kernel/qsqldatabase.cpp19
-rw-r--r--src/tools/moc/outputrevision.h2
-rw-r--r--src/tools/qdoc/codeparser.cpp18
-rw-r--r--src/tools/qdoc/codeparser.h3
-rw-r--r--src/tools/qdoc/cppcodeparser.cpp122
-rw-r--r--src/tools/qdoc/cppcodeparser.h6
-rw-r--r--src/tools/qdoc/ditaxmlgenerator.cpp34
-rw-r--r--src/tools/qdoc/ditaxmlgenerator.h1
-rw-r--r--src/tools/qdoc/doc.cpp55
-rw-r--r--src/tools/qdoc/doc.h5
-rw-r--r--src/tools/qdoc/doc/qdoc-manual.qdoc37
-rw-r--r--src/tools/qdoc/htmlgenerator.cpp2
-rw-r--r--src/tools/qdoc/node.cpp38
-rw-r--r--src/tools/qdoc/node.h10
-rw-r--r--src/tools/qdoc/qmlvisitor.cpp38
-rw-r--r--src/tools/uic/qclass_lib_map.h12
-rw-r--r--src/widgets/dialogs/qcolordialog.h1
-rw-r--r--src/widgets/dialogs/qdialog.cpp36
-rw-r--r--src/widgets/dialogs/qdialog.h1
-rw-r--r--src/widgets/dialogs/qdialog_p.h4
-rw-r--r--src/widgets/dialogs/qfiledialog.cpp8
-rw-r--r--src/widgets/dialogs/qfiledialog.h1
-rw-r--r--src/widgets/dialogs/qfiledialog_p.h20
-rw-r--r--src/widgets/dialogs/qfontdialog.h3
-rw-r--r--src/widgets/dialogs/qfontdialog_p.h2
-rw-r--r--src/widgets/dialogs/qmessagebox.cpp2
-rw-r--r--src/widgets/dialogs/qwizard_win.cpp2
-rw-r--r--src/widgets/itemviews/qheaderview.cpp29
-rw-r--r--src/widgets/itemviews/qheaderview.h4
-rw-r--r--src/widgets/itemviews/qitemdelegate.cpp3
-rw-r--r--src/widgets/itemviews/qstyleditemdelegate.cpp3
-rw-r--r--src/widgets/kernel/kernel.pri2
-rw-r--r--src/widgets/kernel/qapplication.cpp23
-rw-r--r--src/widgets/kernel/qapplication_p.h12
-rw-r--r--src/widgets/kernel/qapplication_qpa.cpp73
-rw-r--r--src/widgets/kernel/qicon.cpp28
-rw-r--r--src/widgets/kernel/qiconloader.cpp4
-rw-r--r--src/widgets/kernel/qplatformmenu.h (renamed from src/widgets/kernel/qplatformmenu_qpa.h)0
-rw-r--r--src/widgets/kernel/qplatformmenu_qpa.cpp2
-rw-r--r--src/widgets/kernel/qwhatsthis.cpp2
-rw-r--r--src/widgets/kernel/qwidget.cpp28
-rw-r--r--src/widgets/kernel/qwidget_p.h3
-rw-r--r--src/widgets/kernel/qwidget_qpa.cpp80
-rw-r--r--src/widgets/kernel/qwidgetwindow_qpa.cpp21
-rw-r--r--src/widgets/styles/qcommonstyle.cpp2
-rw-r--r--src/widgets/styles/qgtkstyle_p.h2
-rw-r--r--src/widgets/styles/qmacstyle_mac.mm2
-rw-r--r--src/widgets/styles/qstylefactory.cpp17
-rw-r--r--src/widgets/styles/qwindowsvistastyle.cpp2
-rw-r--r--src/widgets/styles/qwindowsxpstyle.cpp4
-rw-r--r--src/widgets/util/qsystemtrayicon_win.cpp2
-rw-r--r--src/widgets/util/qsystemtrayicon_x11.cpp2
-rw-r--r--src/widgets/widgets/qcalendarwidget.cpp4
-rw-r--r--src/widgets/widgets/qcombobox.cpp2
-rw-r--r--src/widgets/widgets/qmenu.cpp4
-rw-r--r--src/widgets/widgets/qmenu_p.h2
-rw-r--r--src/widgets/widgets/qmenubar.cpp2
-rw-r--r--src/widgets/widgets/qwidgetlinecontrol.cpp2
353 files changed, 1485 insertions, 1202 deletions
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-greek.c b/src/3rdparty/harfbuzz/src/harfbuzz-greek.c
index f3c0ff62ef..353685861f 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-greek.c
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-greek.c
@@ -372,6 +372,10 @@ HB_Bool HB_GreekShape(HB_ShaperItem *shaper_item)
*shapedChars = *uc;
logClusters[0] = 0;
+ attributes[0].mark = false;
+ attributes[0].clusterStart = true;
+ attributes[0].dontPrint = false;
+
for (i = 1; i < shaper_item->item.length; ++i) {
hb_uint16 base = shapedChars[slen-1];
hb_uint16 shaped = 0;
diff --git a/src/corelib/global/qmalloc.cpp b/src/corelib/global/qmalloc.cpp
index 4cd1b485df..a5a8181a80 100644
--- a/src/corelib/global/qmalloc.cpp
+++ b/src/corelib/global/qmalloc.cpp
@@ -51,7 +51,7 @@
QT_BEGIN_NAMESPACE
#if !QT_DEPRECATED_SINCE(5, 0)
-// Make sure they're defined to be exportedgit
+// Make sure they're defined to be exported
Q_CORE_EXPORT void *qMalloc(size_t size) Q_ALLOC_SIZE(1);
Q_CORE_EXPORT void qFree(void *ptr);
Q_CORE_EXPORT void *qRealloc(void *ptr, size_t size) Q_ALLOC_SIZE(2);
diff --git a/src/corelib/io/qdataurl.cpp b/src/corelib/io/qdataurl.cpp
index 600f650bb5..84b6dd41c7 100644
--- a/src/corelib/io/qdataurl.cpp
+++ b/src/corelib/io/qdataurl.cpp
@@ -61,8 +61,8 @@ Q_CORE_EXPORT bool qDecodeDataUrl(const QUrl &uri, QString &mimeType, QByteArray
// the following would have been the correct thing, but
// reality often differs from the specification. People have
// data: URIs with ? and #
- //QByteArray data = QByteArray::fromPercentEncoding(uri.path(QUrl::PrettyDecoded).toLatin1());
- QByteArray data = QByteArray::fromPercentEncoding(uri.url(QUrl::PrettyDecoded | QUrl::RemoveScheme).toLatin1());
+ //QByteArray data = QByteArray::fromPercentEncoding(uri.path(QUrl::FullyEncoded).toLatin1());
+ QByteArray data = QByteArray::fromPercentEncoding(uri.url(QUrl::FullyEncoded | QUrl::RemoveScheme).toLatin1());
// parse it:
int pos = data.indexOf(',');
diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp
index 649b3a009c..3e711b12ec 100644
--- a/src/corelib/io/qurl.cpp
+++ b/src/corelib/io/qurl.cpp
@@ -777,7 +777,7 @@ void QUrlPrivate::setUserInfo(const QString &userInfo, int from, int end)
int delimIndex = userInfo.indexOf(QLatin1Char(':'), from);
setUserName(userInfo, from, qMin<uint>(delimIndex, end));
- if (delimIndex == -1) {
+ if (uint(delimIndex) >= uint(end)) {
password.clear();
sectionIsPresent &= ~Password;
sectionHasError &= ~Password;
@@ -2159,7 +2159,7 @@ QString QUrl::toString(FormattingOptions options) const
d->appendPath(url, options, QUrlPrivate::FullUrl);
// check if we need to remove trailing slashes
- if ((options & StripTrailingSlash) && d->path != QLatin1String("/") && url.endsWith(QLatin1Char('/')))
+ if ((options & StripTrailingSlash) && !d->path.isEmpty() && d->path != QLatin1String("/") && url.endsWith(QLatin1Char('/')))
url.chop(1);
}
diff --git a/src/corelib/json/qjsonvalue.cpp b/src/corelib/json/qjsonvalue.cpp
index 3be7089049..7459524fc9 100644
--- a/src/corelib/json/qjsonvalue.cpp
+++ b/src/corelib/json/qjsonvalue.cpp
@@ -548,6 +548,16 @@ QJsonValueRef &QJsonValueRef::operator =(const QJsonValue &val)
return *this;
}
+QJsonValueRef &QJsonValueRef::operator =(const QJsonValueRef &ref)
+{
+ if (is_object)
+ o->setValueAt(index, ref);
+ else
+ a->replace(index, ref);
+
+ return *this;
+}
+
QJsonArray QJsonValueRef::toArray() const
{
return toValue().toArray();
diff --git a/src/corelib/json/qjsonvalue.h b/src/corelib/json/qjsonvalue.h
index 386bee25a4..9d4ad1d108 100644
--- a/src/corelib/json/qjsonvalue.h
+++ b/src/corelib/json/qjsonvalue.h
@@ -147,6 +147,7 @@ public:
inline operator QJsonValue() const { return toValue(); }
QJsonValueRef &operator = (const QJsonValue &val);
+ QJsonValueRef &operator = (const QJsonValueRef &val);
inline QJsonValue::Type type() const { return toValue().type(); }
inline bool isNull() const { return type() == QJsonValue::Null; }
diff --git a/src/corelib/kernel/qmetatype.cpp b/src/corelib/kernel/qmetatype.cpp
index 2756dd5241..48cabeb636 100644
--- a/src/corelib/kernel/qmetatype.cpp
+++ b/src/corelib/kernel/qmetatype.cpp
@@ -161,6 +161,7 @@ struct DefinedTypesFilter {
\value ULong \c{unsigned long}
\value ULongLong ULongLong
\value UShort \c{unsigned short}
+ \value SChar \c{signed char}
\value UChar \c{unsigned char}
\value Float \c float
\value QObjectStar QObject *
@@ -610,7 +611,7 @@ bool QMetaType::isRegistered(int type)
Implementation of QMetaType::type().
*/
-template <int tryNormalizedType>
+template <bool tryNormalizedType>
static inline int qMetaTypeTypeImpl(const char *typeName)
{
int length = qstrlen(typeName);
@@ -718,6 +719,9 @@ bool QMetaType::save(QDataStream &stream, int type, const void *data)
case QMetaType::UShort:
stream << *static_cast<const ushort *>(data);
break;
+ case QMetaType::SChar:
+ stream << *static_cast<const signed char *>(data);
+ break;
case QMetaType::UChar:
stream << *static_cast<const uchar *>(data);
break;
@@ -937,6 +941,9 @@ bool QMetaType::load(QDataStream &stream, int type, void *data)
case QMetaType::UShort:
stream >> *static_cast<ushort *>(data);
break;
+ case QMetaType::SChar:
+ stream >> *static_cast<signed char *>(data);
+ break;
case QMetaType::UChar:
stream >> *static_cast<uchar *>(data);
break;
diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h
index 595da53562..33e7fa43f1 100644
--- a/src/corelib/kernel/qmetatype.h
+++ b/src/corelib/kernel/qmetatype.h
@@ -77,6 +77,7 @@ QT_BEGIN_NAMESPACE
F(UShort, 36, ushort) \
F(UChar, 37, uchar) \
F(Float, 38, float) \
+ F(SChar, 49, signed char) \
#define QT_FOR_EACH_STATIC_PRIMITIVE_POINTER(F)\
F(VoidStar, 31, void*) \
@@ -160,8 +161,7 @@ QT_BEGIN_NAMESPACE
F(UChar, -1, uchar, "unsigned char") \
F(LongLong, -1, qlonglong, "long long") \
F(ULongLong, -1, qulonglong, "unsigned long long") \
- F(Char, -1, char, "qint8") \
- F(Char, -1, char, "signed char") \
+ F(SChar, -1, signed char, "qint8") \
F(UChar, -1, uchar, "quint8") \
F(Short, -1, short, "qint16") \
F(UShort, -1, ushort, "quint16") \
@@ -205,7 +205,7 @@ public:
QT_FOR_EACH_STATIC_TYPE(QT_DEFINE_METATYPE_ID)
FirstCoreType = Bool,
- LastCoreType = QJsonDocument,
+ LastCoreType = SChar,
FirstGuiType = QFont,
LastGuiType = QPolygonF,
FirstWidgetsType = QIcon,
@@ -821,7 +821,6 @@ QT_END_NAMESPACE
Q_DECLARE_BUILTIN_METATYPE(Name, MetaTypeName)
QT_FOR_EACH_STATIC_TYPE(QT_DECLARE_BUILTIN_METATYPE_ITER)
-Q_DECLARE_BUILTIN_METATYPE(signed char, Char)
#undef QT_DECLARE_BUILTIN_METATYPE_ITER
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index 443c799146..9dbc92d32f 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -182,7 +182,6 @@ private:
void (*QAbstractDeclarativeData::destroyed)(QAbstractDeclarativeData *, QObject *) = 0;
void (*QAbstractDeclarativeData::parentChanged)(QAbstractDeclarativeData *, QObject *, QObject *) = 0;
-void (*QAbstractDeclarativeData::objectNameChanged)(QAbstractDeclarativeData *, QObject *) = 0;
void (*QAbstractDeclarativeData::signalEmitted)(QAbstractDeclarativeData *, QObject *, int, void **) = 0;
int (*QAbstractDeclarativeData::receivers)(QAbstractDeclarativeData *, const QObject *, int) = 0;
@@ -989,8 +988,6 @@ void QObject::setObjectName(const QString &name)
Q_D(QObject);
if (d->objectName != name) {
d->objectName = name;
- if (d->declarativeData && d->declarativeData->objectNameChanged)
- d->declarativeData->objectNameChanged(d->declarativeData, this);
emit objectNameChanged(d->objectName);
}
}
diff --git a/src/corelib/kernel/qobject_p.h b/src/corelib/kernel/qobject_p.h
index a31e091ae8..f650a301a7 100644
--- a/src/corelib/kernel/qobject_p.h
+++ b/src/corelib/kernel/qobject_p.h
@@ -89,7 +89,6 @@ class Q_CORE_EXPORT QAbstractDeclarativeData
public:
static void (*destroyed)(QAbstractDeclarativeData *, QObject *);
static void (*parentChanged)(QAbstractDeclarativeData *, QObject *, QObject *);
- static void (*objectNameChanged)(QAbstractDeclarativeData *, QObject *);
static void (*signalEmitted)(QAbstractDeclarativeData *, QObject *, int, void **);
static int (*receivers)(QAbstractDeclarativeData *, const QObject *, int);
};
diff --git a/src/corelib/kernel/qobjectdefs.h b/src/corelib/kernel/qobjectdefs.h
index b9a118e731..567157b03d 100644
--- a/src/corelib/kernel/qobjectdefs.h
+++ b/src/corelib/kernel/qobjectdefs.h
@@ -58,7 +58,7 @@ typedef QArrayData QByteArrayData;
class QString;
#ifndef Q_MOC_OUTPUT_REVISION
-#define Q_MOC_OUTPUT_REVISION 66
+#define Q_MOC_OUTPUT_REVISION 67
#endif
// The following macros are our "extensions" to C++
diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp
index 0b3e0418d0..30ca728208 100644
--- a/src/corelib/kernel/qvariant.cpp
+++ b/src/corelib/kernel/qvariant.cpp
@@ -152,6 +152,8 @@ static qlonglong qMetaTypeNumber(const QVariant::Private *d)
return d->data.ll;
case QMetaType::Char:
return qlonglong(d->data.c);
+ case QMetaType::SChar:
+ return qlonglong(d->data.sc);
case QMetaType::Short:
return qlonglong(d->data.s);
case QMetaType::Long:
@@ -199,6 +201,7 @@ static qlonglong qConvertToNumber(const QVariant::Private *d, bool *ok)
case QVariant::Double:
case QVariant::Int:
case QMetaType::Char:
+ case QMetaType::SChar:
case QMetaType::Short:
case QMetaType::Long:
case QMetaType::Float:
@@ -232,6 +235,7 @@ static qulonglong qConvertToUnsignedNumber(const QVariant::Private *d, bool *ok)
case QVariant::Double:
case QVariant::Int:
case QMetaType::Char:
+ case QMetaType::SChar:
case QMetaType::Short:
case QMetaType::Long:
case QMetaType::Float:
@@ -289,6 +293,7 @@ static bool convert(const QVariant::Private *d, int t, void *result, bool *ok)
*str = QString(*v_cast<QChar>(d));
break;
case QMetaType::Char:
+ case QMetaType::SChar:
case QMetaType::UChar:
*str = QChar::fromLatin1(d->data.c);
break;
@@ -350,6 +355,7 @@ static bool convert(const QVariant::Private *d, int t, void *result, bool *ok)
case QVariant::Int:
case QVariant::LongLong:
case QMetaType::Char:
+ case QMetaType::SChar:
case QMetaType::Short:
case QMetaType::Long:
case QMetaType::Float:
@@ -487,6 +493,7 @@ static bool convert(const QVariant::Private *d, int t, void *result, bool *ok)
*ba = QByteArray::number(d->data.f, 'g', FLT_DIG);
break;
case QMetaType::Char:
+ case QMetaType::SChar:
case QMetaType::UChar:
*ba = QByteArray(1, d->data.c);
break;
@@ -535,6 +542,11 @@ static bool convert(const QVariant::Private *d, int t, void *result, bool *ok)
*static_cast<qulonglong *>(result) = qConvertToUnsignedNumber(d, ok);
return *ok;
}
+ case QMetaType::SChar: {
+ signed char s = qConvertToNumber(d, ok);
+ *static_cast<signed char*>(result) = s;
+ return *ok;
+ }
case QMetaType::UChar: {
*static_cast<uchar *>(result) = qConvertToUnsignedNumber(d, ok);
return *ok;
@@ -555,6 +567,7 @@ static bool convert(const QVariant::Private *d, int t, void *result, bool *ok)
case QVariant::Int:
case QVariant::LongLong:
case QMetaType::Char:
+ case QMetaType::SChar:
case QMetaType::Short:
case QMetaType::Long:
case QMetaType::Float:
@@ -591,6 +604,7 @@ static bool convert(const QVariant::Private *d, int t, void *result, bool *ok)
case QVariant::LongLong:
case QVariant::Int:
case QMetaType::Char:
+ case QMetaType::SChar:
case QMetaType::Short:
case QMetaType::Long:
*f = double(qMetaTypeNumber(d));
@@ -626,6 +640,7 @@ static bool convert(const QVariant::Private *d, int t, void *result, bool *ok)
case QVariant::LongLong:
case QVariant::Int:
case QMetaType::Char:
+ case QMetaType::SChar:
case QMetaType::Short:
case QMetaType::Long:
*f = float(qMetaTypeNumber(d));
@@ -2440,11 +2455,17 @@ static const quint32 qCanConvertMatrix[QVariant::LastCoreType + 1] =
bool QVariant::canConvert(int targetTypeId) const
{
// TODO Reimplement this function, currently it works but it is a historical mess.
- const uint currentType = ((d.type == QMetaType::Float) ? QVariant::Double : d.type);
+ uint currentType = ((d.type == QMetaType::Float) ? QVariant::Double : d.type);
+ if (currentType == QMetaType::SChar || currentType == QMetaType::Char)
+ currentType = QMetaType::UInt;
+ if (targetTypeId == QMetaType::SChar || currentType == QMetaType::Char)
+ targetTypeId = QMetaType::UInt;
if (uint(targetTypeId) == uint(QMetaType::Float)) targetTypeId = QVariant::Double;
+
if (currentType == uint(targetTypeId))
return true;
+
if (targetTypeId < 0 || targetTypeId >= QMetaType::User)
return false;
@@ -2452,12 +2473,16 @@ bool QVariant::canConvert(int targetTypeId) const
if (currentType > int(QMetaType::QUuid) || targetTypeId > int(QMetaType::QUuid)) {
switch (uint(targetTypeId)) {
case QVariant::Int:
- return currentType == QVariant::KeySequence
- || currentType == QMetaType::ULong
+ if (currentType == QVariant::KeySequence)
+ return true;
+ // fall through
+ case QVariant::UInt:
+ return currentType == QMetaType::ULong
|| currentType == QMetaType::Long
|| currentType == QMetaType::UShort
|| currentType == QMetaType::UChar
|| currentType == QMetaType::Char
+ || currentType == QMetaType::SChar
|| currentType == QMetaType::Short;
case QVariant::Image:
return currentType == QVariant::Pixmap || currentType == QVariant::Bitmap;
@@ -2482,6 +2507,7 @@ bool QVariant::canConvert(int targetTypeId) const
return currentType == QVariant::Color || currentType == QVariant::Pixmap;
case QMetaType::Long:
case QMetaType::Char:
+ case QMetaType::SChar:
case QMetaType::UChar:
case QMetaType::ULong:
case QMetaType::Short:
diff --git a/src/corelib/kernel/qvariant.h b/src/corelib/kernel/qvariant.h
index cd8ac9823d..67cec6875a 100644
--- a/src/corelib/kernel/qvariant.h
+++ b/src/corelib/kernel/qvariant.h
@@ -360,6 +360,7 @@ class Q_CORE_EXPORT QVariant
char c;
uchar uc;
short s;
+ signed char sc;
ushort us;
int i;
uint u;
diff --git a/src/corelib/mimetypes/qmimeprovider.cpp b/src/corelib/mimetypes/qmimeprovider.cpp
index 0c2f25a1f9..1f7d06caa4 100644
--- a/src/corelib/mimetypes/qmimeprovider.cpp
+++ b/src/corelib/mimetypes/qmimeprovider.cpp
@@ -529,6 +529,9 @@ QList<QMimeType> QMimeBinaryProvider::allMimeTypes()
void QMimeBinaryProvider::loadMimeTypePrivate(QMimeTypePrivate &data)
{
+ if (data.loaded)
+ return;
+ data.loaded = true;
// load comment and globPatterns
const QString file = data.name + QLatin1String(".xml");
diff --git a/src/corelib/mimetypes/qmimetype.cpp b/src/corelib/mimetypes/qmimetype.cpp
index 5ee70e83b1..3a3112f4fd 100644
--- a/src/corelib/mimetypes/qmimetype.cpp
+++ b/src/corelib/mimetypes/qmimetype.cpp
@@ -63,6 +63,7 @@ bool qt_isQMimeTypeDebuggingActivated (false);
#endif
QMimeTypePrivate::QMimeTypePrivate()
+ : loaded(false)
{}
QMimeTypePrivate::QMimeTypePrivate(const QMimeType &other)
@@ -70,7 +71,8 @@ QMimeTypePrivate::QMimeTypePrivate(const QMimeType &other)
localeComments(other.d->localeComments),
genericIconName(other.d->genericIconName),
iconName(other.d->iconName),
- globPatterns(other.d->globPatterns)
+ globPatterns(other.d->globPatterns),
+ loaded(other.d->loaded)
{}
void QMimeTypePrivate::clear()
@@ -80,6 +82,7 @@ void QMimeTypePrivate::clear()
genericIconName.clear();
iconName.clear();
globPatterns.clear();
+ loaded = false;
}
/*!
diff --git a/src/corelib/mimetypes/qmimetype_p.h b/src/corelib/mimetypes/qmimetype_p.h
index f2c7f966ff..775d5278e2 100644
--- a/src/corelib/mimetypes/qmimetype_p.h
+++ b/src/corelib/mimetypes/qmimetype_p.h
@@ -68,6 +68,7 @@ public:
QString genericIconName;
QString iconName;
QStringList globPatterns;
+ bool loaded;
};
QT_END_NAMESPACE
diff --git a/src/corelib/plugin/qfactoryloader.cpp b/src/corelib/plugin/qfactoryloader.cpp
index fc9e94037f..67b59f96ec 100644
--- a/src/corelib/plugin/qfactoryloader.cpp
+++ b/src/corelib/plugin/qfactoryloader.cpp
@@ -370,6 +370,39 @@ void QFactoryLoader::refreshAll()
}
}
+QMultiMap<int, QString> QFactoryLoader::keyMap() const
+{
+ QMultiMap<int, QString> result;
+ const QString metaDataKey = QStringLiteral("MetaData");
+ const QString keysKey = QStringLiteral("Keys");
+ const QList<QJsonObject> metaDataList = metaData();
+ for (int i = 0; i < metaDataList.size(); ++i) {
+ const QJsonObject metaData = metaDataList.at(i).value(metaDataKey).toObject();
+ const QJsonArray keys = metaData.value(keysKey).toArray();
+ const int keyCount = keys.size();
+ for (int k = 0; k < keyCount; ++k)
+ result.insert(i, keys.at(k).toString());
+ }
+ return result;
+}
+
+int QFactoryLoader::indexOf(const QString &needle) const
+{
+ const QString metaDataKey = QStringLiteral("MetaData");
+ const QString keysKey = QStringLiteral("Keys");
+ const QList<QJsonObject> metaDataList = metaData();
+ for (int i = 0; i < metaDataList.size(); ++i) {
+ const QJsonObject metaData = metaDataList.at(i).value(metaDataKey).toObject();
+ const QJsonArray keys = metaData.value(keysKey).toArray();
+ const int keyCount = keys.size();
+ for (int k = 0; k < keyCount; ++k) {
+ if (!keys.at(k).toString().compare(needle, Qt::CaseInsensitive))
+ return i;
+ }
+ }
+ return -1;
+}
+
QT_END_NAMESPACE
#endif // QT_NO_LIBRARY
diff --git a/src/corelib/plugin/qfactoryloader_p.h b/src/corelib/plugin/qfactoryloader_p.h
index ee7a68d6f8..66ded8074b 100644
--- a/src/corelib/plugin/qfactoryloader_p.h
+++ b/src/corelib/plugin/qfactoryloader_p.h
@@ -56,6 +56,7 @@
#include "QtCore/qobject.h"
#include "QtCore/qstringlist.h"
#include "QtCore/qjsonobject.h"
+#include "QtCore/qmap.h"
#include "private/qlibrary_p.h"
#ifndef QT_NO_LIBRARY
@@ -84,11 +85,42 @@ public:
QLibraryPrivate *library(const QString &key) const;
#endif
+ QMultiMap<int, QString> keyMap() const;
+ int indexOf(const QString &needle) const;
+
void update();
static void refreshAll();
};
+template <class PluginInterface, class FactoryInterface>
+ PluginInterface *qLoadPlugin(const QFactoryLoader *loader, const QString &key)
+{
+ const int index = loader->indexOf(key);
+ if (index != -1) {
+ QObject *factoryObject = loader->instance(index);
+ if (FactoryInterface *factory = qobject_cast<FactoryInterface *>(factoryObject))
+ if (PluginInterface *result = factory->create(key))
+ return result;
+ }
+ return 0;
+}
+
+template <class PluginInterface, class FactoryInterface, class Parameter1>
+PluginInterface *qLoadPlugin1(const QFactoryLoader *loader,
+ const QString &key,
+ const Parameter1 &parameter1)
+{
+ const int index = loader->indexOf(key);
+ if (index != -1) {
+ QObject *factoryObject = loader->instance(index);
+ if (FactoryInterface *factory = qobject_cast<FactoryInterface *>(factoryObject))
+ if (PluginInterface *result = factory->create(key, parameter1))
+ return result;
+ }
+ return 0;
+}
+
QT_END_NAMESPACE
#endif // QT_NO_LIBRARY
diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp
index 88667f7fbd..5913cebc0a 100644
--- a/src/corelib/tools/qlocale.cpp
+++ b/src/corelib/tools/qlocale.cpp
@@ -2148,7 +2148,8 @@ Qt::LayoutDirection QLocale::textDirection() const
lang == QLocale::Hebrew ||
lang == QLocale::Persian ||
lang == QLocale::Urdu ||
- lang == QLocale::Syriac)
+ lang == QLocale::Syriac ||
+ lang == QLocale::Divehi)
return Qt::RightToLeft;
return Qt::LeftToRight;
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp
index 69650f50ef..ebf157a600 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -372,7 +372,7 @@ inline char qToLower(char ch)
/*!
\internal
*/
-bool qStringComparisonHelper(const QString &s1, const char *s2)
+Q_CORE_EXPORT bool qStringComparisonHelper(const QString &s1, const char *s2)
{
// ### optimize me
return s1 == QString::fromAscii(s2);
@@ -381,7 +381,7 @@ bool qStringComparisonHelper(const QString &s1, const char *s2)
/*!
\internal
*/
-bool qStringComparisonHelper(const QString &s1, const QByteArray &s2)
+Q_CORE_EXPORT bool qStringComparisonHelper(const QString &s1, const QByteArray &s2)
{
// ### optimize me
return s1 == QString::fromAscii(s2);
@@ -390,7 +390,7 @@ bool qStringComparisonHelper(const QString &s1, const QByteArray &s2)
/*!
\internal
*/
-bool qStringComparisonHelper(const QStringRef &s1, const char *s2)
+Q_CORE_EXPORT bool qStringComparisonHelper(const QStringRef &s1, const char *s2)
{
// ### optimize me
return s1 == QString::fromAscii(s2);
@@ -399,7 +399,7 @@ bool qStringComparisonHelper(const QStringRef &s1, const char *s2)
/*!
\internal
*/
-bool qStringComparisonHelper(const QStringRef &s1, const QByteArray &s2)
+Q_CORE_EXPORT bool qStringComparisonHelper(const QStringRef &s1, const QByteArray &s2)
{
// ### optimize me
return s1 == QString::fromAscii(s2);
diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h
index 1ddaded7b3..4e59b0f30c 100644
--- a/src/corelib/tools/qstring.h
+++ b/src/corelib/tools/qstring.h
@@ -674,10 +674,10 @@ private:
friend class QTextCodec;
friend class QStringRef;
friend struct QAbstractConcatenable;
- friend bool qStringComparisonHelper(const QString &s1, const char *s2);
- friend bool qStringComparisonHelper(const QString &s1, const QByteArray &s2);
- friend bool qStringComparisonHelper(const QStringRef &s1, const char *s2);
- friend bool qStringComparisonHelper(const QStringRef &s1, const QByteArray &s2);
+ friend Q_CORE_EXPORT bool qStringComparisonHelper(const QString &s1, const char *s2);
+ friend Q_CORE_EXPORT bool qStringComparisonHelper(const QString &s1, const QByteArray &s2);
+ friend Q_CORE_EXPORT bool qStringComparisonHelper(const QStringRef &s1, const char *s2);
+ friend Q_CORE_EXPORT bool qStringComparisonHelper(const QStringRef &s1, const QByteArray &s2);
public:
typedef Data * DataPtr;
inline DataPtr &data_ptr() { return d; }
diff --git a/src/dbus/qdbuspendingcall.cpp b/src/dbus/qdbuspendingcall.cpp
index dfd31242cc..9ae68c7abc 100644
--- a/src/dbus/qdbuspendingcall.cpp
+++ b/src/dbus/qdbuspendingcall.cpp
@@ -286,6 +286,14 @@ QDBusPendingCall &QDBusPendingCall::operator=(const QDBusPendingCall &other)
}
/*!
+ \fn void QDBusPendingCall::swap(QDBusPendingCall &other)
+ \since 5.0
+
+ Swaps this pending call instance with \a other. This function is
+ very fast and never fails.
+*/
+
+/*!
\fn bool QDBusPendingCallWatcher::isFinished() const
Returns true if the pending call has finished processing and the
diff --git a/src/dbus/qdbuspendingcall.h b/src/dbus/qdbuspendingcall.h
index 8655435501..0256c4cc6e 100644
--- a/src/dbus/qdbuspendingcall.h
+++ b/src/dbus/qdbuspendingcall.h
@@ -68,6 +68,8 @@ public:
~QDBusPendingCall();
QDBusPendingCall &operator=(const QDBusPendingCall &other);
+ void swap(QDBusPendingCall &other) { qSwap(d, other.d); }
+
#ifndef Q_QDOC
// pretend that they aren't here
bool isFinished() const;
diff --git a/src/dbus/qdbusunixfiledescriptor.cpp b/src/dbus/qdbusunixfiledescriptor.cpp
index bcf5f64a90..b5e8817ddc 100644
--- a/src/dbus/qdbusunixfiledescriptor.cpp
+++ b/src/dbus/qdbusunixfiledescriptor.cpp
@@ -187,6 +187,14 @@ QDBusUnixFileDescriptor::~QDBusUnixFileDescriptor()
}
/*!
+ \fn void QDBusUnixFileDescriptor::swap(QDBusUnixFileDescriptor &other)
+ \since 5.0
+
+ Swaps this file descriptor instance with \a other. This function
+ is very fast and never fails.
+*/
+
+/*!
Returns true if this Unix file descriptor is valid. A valid Unix file
descriptor is not -1.
diff --git a/src/dbus/qdbusunixfiledescriptor.h b/src/dbus/qdbusunixfiledescriptor.h
index bfb2262a31..9fe0b77230 100644
--- a/src/dbus/qdbusunixfiledescriptor.h
+++ b/src/dbus/qdbusunixfiledescriptor.h
@@ -68,6 +68,9 @@ public:
QDBusUnixFileDescriptor &operator=(const QDBusUnixFileDescriptor &other);
~QDBusUnixFileDescriptor();
+ void swap(QDBusUnixFileDescriptor &other)
+ { qSwap(d, other.d); }
+
bool isValid() const;
int fileDescriptor() const;
diff --git a/src/gui/accessible/accessible.pri b/src/gui/accessible/accessible.pri
index 70ac033f77..abffa2ade8 100644
--- a/src/gui/accessible/accessible.pri
+++ b/src/gui/accessible/accessible.pri
@@ -6,7 +6,7 @@ contains(QT_CONFIG, accessibility) {
accessible/qaccessible2.h \
accessible/qaccessibleobject.h \
accessible/qaccessibleplugin.h \
- accessible/qplatformaccessibility_qpa.h
+ accessible/qplatformaccessibility.h
SOURCES += accessible/qaccessible.cpp \
accessible/qaccessible2.cpp \
diff --git a/src/gui/accessible/qaccessible.cpp b/src/gui/accessible/qaccessible.cpp
index 6f1d505a4e..ec02086d74 100644
--- a/src/gui/accessible/qaccessible.cpp
+++ b/src/gui/accessible/qaccessible.cpp
@@ -48,8 +48,8 @@
#include "qaccessiblebridge.h"
#include <QtGui/QGuiApplication>
#include <private/qguiapplication_p.h>
-#include "qplatformaccessibility_qpa.h"
-#include "qplatformintegration_qpa.h"
+#include <qpa/qplatformaccessibility.h>
+#include <qpa/qplatformintegration.h>
#include <QtCore/qdebug.h>
#include <QtCore/qmetaobject.h>
@@ -570,35 +570,28 @@ QAccessible::RootObjectHandler QAccessible::installRootObjectHandler(RootObjectH
QAccessibleInterface *QAccessible::queryAccessibleInterface(QObject *object)
{
accessibility_active = true;
- QAccessibleInterface *iface = 0;
if (!object)
return 0;
const QMetaObject *mo = object->metaObject();
while (mo) {
- const QLatin1String cn(mo->className());
+ const QString cn = QLatin1String(mo->className());
for (int i = qAccessibleFactories()->count(); i > 0; --i) {
InterfaceFactory factory = qAccessibleFactories()->at(i - 1);
- iface = factory(cn, object);
- if (iface)
+ if (QAccessibleInterface *iface = factory(cn, object))
return iface;
}
#ifndef QT_NO_LIBRARY
- QAccessibleFactoryInterface *factory = qobject_cast<QAccessibleFactoryInterface*>(loader()->instance(cn));
- if (factory) {
- iface = factory->create(cn, object);
- if (iface)
- return iface;
- }
+ if (QAccessibleInterface * iface = qLoadPlugin1<QAccessibleInterface, QAccessibleFactoryInterface>(loader(), cn, object))
+ return iface;
#endif
mo = mo->superClass();
}
- if (!iface) {
- if (object == qApp)
- iface = new QAccessibleApplication;
- }
- return iface;
+ if (object == qApp)
+ return new QAccessibleApplication;
+
+ return 0;
}
/*!
diff --git a/src/gui/accessible/qplatformaccessibility_qpa.h b/src/gui/accessible/qplatformaccessibility.h
index b1efd7cb34..b1efd7cb34 100644
--- a/src/gui/accessible/qplatformaccessibility_qpa.h
+++ b/src/gui/accessible/qplatformaccessibility.h
diff --git a/src/gui/accessible/qplatformaccessibility_qpa.cpp b/src/gui/accessible/qplatformaccessibility_qpa.cpp
index 91b5de1198..271f324000 100644
--- a/src/gui/accessible/qplatformaccessibility_qpa.cpp
+++ b/src/gui/accessible/qplatformaccessibility_qpa.cpp
@@ -38,7 +38,7 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-#include "qplatformaccessibility_qpa.h"
+#include "qplatformaccessibility.h"
#include <private/qfactoryloader_p.h>
#include "qaccessibleplugin.h"
#include "qaccessibleobject.h"
@@ -112,15 +112,21 @@ void QPlatformAccessibility::initialize()
isInit = true; // ### not atomic
#ifndef QT_NO_LIBRARY
- const QStringList l = bridgeloader()->keys();
- for (int i = 0; i < l.count(); ++i) {
- if (QAccessibleBridgeFactoryInterface *factory =
- qobject_cast<QAccessibleBridgeFactoryInterface*>(bridgeloader()->instance(l.at(i)))) {
- QAccessibleBridge * bridge = factory->create(l.at(i));
- if (bridge) {
- bridges()->append(bridge);
- }
+ typedef QMultiMap<int, QString> PluginKeyMap;
+ typedef PluginKeyMap::const_iterator PluginKeyMapConstIterator;
+
+ const PluginKeyMap keyMap = bridgeloader()->keyMap();
+ QAccessibleBridgeFactoryInterface *factory = 0;
+ int i = -1;
+ const PluginKeyMapConstIterator cend = keyMap.constEnd();
+ for (PluginKeyMapConstIterator it = keyMap.constBegin(); it != cend; ++it) {
+ if (it.key() != i) {
+ i = it.key();
+ factory = qobject_cast<QAccessibleBridgeFactoryInterface*>(bridgeloader()->instance(i));
}
+ if (factory)
+ if (QAccessibleBridge *bridge = factory->create(it.value()))
+ bridges()->append(bridge);
}
#endif
}
diff --git a/src/gui/image/image.pri b/src/gui/image/image.pri
index 34a33aa0f0..737b7fcbd4 100644
--- a/src/gui/image/image.pri
+++ b/src/gui/image/image.pri
@@ -21,7 +21,7 @@ HEADERS += \
image/qpixmap_blitter_p.h \
image/qpixmapcache.h \
image/qpixmapcache_p.h \
- image/qplatformpixmap_qpa.h \
+ image/qplatformpixmap.h \
image/qimagepixmapcleanuphooks_p.h \
SOURCES += \
diff --git a/src/gui/image/qbitmap.cpp b/src/gui/image/qbitmap.cpp
index f3c26dd5b2..499f9f48f2 100644
--- a/src/gui/image/qbitmap.cpp
+++ b/src/gui/image/qbitmap.cpp
@@ -40,8 +40,8 @@
****************************************************************************/
#include "qbitmap.h"
-#include "qplatformpixmap_qpa.h"
-#include "qplatformintegration_qpa.h"
+#include <qpa/qplatformpixmap.h>
+#include <qpa/qplatformintegration.h>
#include "qimage.h"
#include "qscreen.h"
#include "qvariant.h"
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp
index 64decd0fd7..89060cfbb4 100644
--- a/src/gui/image/qimage.cpp
+++ b/src/gui/image/qimage.cpp
@@ -50,13 +50,13 @@
#include "qstringlist.h"
#include "qvariant.h"
#include "qimagepixmapcleanuphooks_p.h"
-#include "qplatformintegration_qpa.h"
+#include <qpa/qplatformintegration.h>
#include <private/qguiapplication_p.h>
#include <ctype.h>
#include <stdlib.h>
#include <limits.h>
#include <math.h>
-#include <qplatformpixmap_qpa.h>
+#include <qpa/qplatformpixmap.h>
#include <private/qdrawhelper_p.h>
#include <private/qmemrotate_p.h>
#include <private/qimagescale_p.h>
diff --git a/src/gui/image/qimagepixmapcleanuphooks.cpp b/src/gui/image/qimagepixmapcleanuphooks.cpp
index b118f5f856..548934829e 100644
--- a/src/gui/image/qimagepixmapcleanuphooks.cpp
+++ b/src/gui/image/qimagepixmapcleanuphooks.cpp
@@ -40,7 +40,7 @@
****************************************************************************/
#include "qimagepixmapcleanuphooks_p.h"
-#include "qplatformpixmap_qpa.h"
+#include <qpa/qplatformpixmap.h>
#include "private/qimage_p.h"
diff --git a/src/gui/image/qimagereader.cpp b/src/gui/image/qimagereader.cpp
index c08ac0593b..4cda7304ac 100644
--- a/src/gui/image/qimagereader.cpp
+++ b/src/gui/image/qimagereader.cpp
@@ -224,15 +224,18 @@ static QImageIOHandler *createReadHandlerHelper(QIODevice *device,
QImageIOHandler *handler = 0;
#ifndef QT_NO_LIBRARY
+ typedef QMultiMap<int, QString> PluginKeyMap;
+ typedef PluginKeyMap::const_iterator PluginKeyMapConstIterator;
+
// check if we have plugins that support the image format
QFactoryLoader *l = loader();
- QStringList keys = l->keys();
+ const PluginKeyMap keyMap = l->keyMap();
#endif
QByteArray suffix;
#ifdef QIMAGEREADER_DEBUG
qDebug() << "QImageReader::createReadHandler( device =" << (void *)device << ", format =" << format << "),"
- << keys.size() << "plugins available: " << keys;
+ << keyMap.values().size() << "plugins available: " << keyMap.values();
#endif
#ifndef QT_NO_LIBRARY
@@ -246,7 +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()) {
- int index = keys.indexOf(QString::fromLatin1(suffix));
+ const int index = keyMap.key(QString::fromLatin1(suffix), -1);
if (index != -1) {
#ifdef QIMAGEREADER_DEBUG
qDebug() << "QImageReader::createReadHandler: suffix recognized; the"
@@ -269,13 +272,16 @@ static QImageIOHandler *createReadHandlerHelper(QIODevice *device,
// check if the plugin that claims support for this format can load
// from this device with this format.
const qint64 pos = device ? device->pos() : 0;
- QImageIOPlugin *plugin = qobject_cast<QImageIOPlugin *>(l->instance(QString::fromLatin1(suffix)));
- if (plugin && plugin->capabilities(device, testFormat) & QImageIOPlugin::CanRead) {
- handler = plugin->create(device, testFormat);
+ const int index = keyMap.key(QString::fromLatin1(suffix), -1);
+ if (index != -1) {
+ QImageIOPlugin *plugin = qobject_cast<QImageIOPlugin *>(l->instance(index));
+ if (plugin && plugin->capabilities(device, testFormat) & QImageIOPlugin::CanRead) {
+ handler = plugin->create(device, testFormat);
#ifdef QIMAGEREADER_DEBUG
- qDebug() << "QImageReader::createReadHandler: using the" << suffix
- << "plugin";
+ qDebug() << "QImageReader::createReadHandler: using the" << suffix
+ << "plugin";
#endif
+ }
}
if (device && !device->isSequential())
device->seek(pos);
@@ -287,9 +293,10 @@ static QImageIOHandler *createReadHandlerHelper(QIODevice *device,
const qint64 pos = device ? device->pos() : 0;
if (autoDetectImageFormat) {
- for (int i = 0; i < keys.size(); ++i) {
+ const int keyCount = keyMap.keys().size();
+ for (int i = 0; i < keyCount; ++i) {
if (i != suffixPluginIndex) {
- QImageIOPlugin *plugin = qobject_cast<QImageIOPlugin *>(l->instance(keys.at(i)));
+ QImageIOPlugin *plugin = qobject_cast<QImageIOPlugin *>(l->instance(i));
if (plugin && plugin->capabilities(device, testFormat) & QImageIOPlugin::CanRead) {
#ifdef QIMAGEREADER_DEBUG
qDebug() << "QImageReader::createReadHandler: the" << keys.at(i) << "plugin can read this format";
@@ -300,12 +307,15 @@ static QImageIOHandler *createReadHandlerHelper(QIODevice *device,
}
}
} else {
- QImageIOPlugin *plugin = qobject_cast<QImageIOPlugin *>(l->instance(QLatin1String(testFormat)));
- if (plugin && plugin->capabilities(device, testFormat) & QImageIOPlugin::CanRead) {
+ const int testIndex = keyMap.key(QLatin1String(testFormat), -1);
+ if (testIndex != -1) {
+ QImageIOPlugin *plugin = qobject_cast<QImageIOPlugin *>(l->instance(testIndex));
+ if (plugin && plugin->capabilities(device, testFormat) & QImageIOPlugin::CanRead) {
#ifdef QIMAGEREADER_DEBUG
- qDebug() << "QImageReader::createReadHandler: the" << testFormat << "plugin can read this format";
+ qDebug() << "QImageReader::createReadHandler: the" << testFormat << "plugin can read this format";
#endif
- handler = plugin->create(device, testFormat);
+ handler = plugin->create(device, testFormat);
+ }
}
}
if (device && !device->isSequential())
@@ -363,9 +373,10 @@ static QImageIOHandler *createReadHandlerHelper(QIODevice *device,
if (!handler && (autoDetectImageFormat || ignoresFormatAndExtension)) {
// check if any of our plugins recognize the file from its contents.
const qint64 pos = device ? device->pos() : 0;
- for (int i = 0; i < keys.size(); ++i) {
+ const int keyCount = keyMap.keys().size();
+ for (int i = 0; i < keyCount; ++i) {
if (i != suffixPluginIndex) {
- QImageIOPlugin *plugin = qobject_cast<QImageIOPlugin *>(l->instance(keys.at(i)));
+ QImageIOPlugin *plugin = qobject_cast<QImageIOPlugin *>(l->instance(i));
if (plugin && plugin->capabilities(device, QByteArray()) & QImageIOPlugin::CanRead) {
handler = plugin->create(device, testFormat);
#ifdef QIMAGEREADER_DEBUG
@@ -1413,6 +1424,12 @@ QByteArray QImageReader::imageFormat(QIODevice *device)
return format;
}
+#ifndef QT_NO_LIBRARY
+void supportedImageHandlerFormats(QFactoryLoader *loader,
+ QImageIOPlugin::Capability cap,
+ QSet<QByteArray> *result);
+#endif
+
/*!
Returns the list of image formats supported by QImageReader.
@@ -1442,6 +1459,7 @@ QByteArray QImageReader::imageFormat(QIODevice *device)
\sa setFormat(), QImageWriter::supportedImageFormats(), QImageIOPlugin
*/
+
QList<QByteArray> QImageReader::supportedImageFormats()
{
QSet<QByteArray> formats;
@@ -1449,14 +1467,7 @@ QList<QByteArray> QImageReader::supportedImageFormats()
formats << _qt_BuiltInFormats[i].extension;
#ifndef QT_NO_LIBRARY
- QFactoryLoader *l = loader();
- QStringList keys = l->keys();
-
- for (int i = 0; i < keys.count(); ++i) {
- QImageIOPlugin *plugin = qobject_cast<QImageIOPlugin *>(l->instance(keys.at(i)));
- if (plugin && plugin->capabilities(0, keys.at(i).toLatin1()) & QImageIOPlugin::CanRead)
- formats << keys.at(i).toLatin1();
- }
+ supportedImageHandlerFormats(loader(), QImageIOPlugin::CanRead, &formats);
#endif // QT_NO_LIBRARY
QList<QByteArray> sortedFormats;
diff --git a/src/gui/image/qimagewriter.cpp b/src/gui/image/qimagewriter.cpp
index 56c459ee4d..c1b7a6459a 100644
--- a/src/gui/image/qimagewriter.cpp
+++ b/src/gui/image/qimagewriter.cpp
@@ -136,9 +136,12 @@ static QImageIOHandler *createWriteHandlerHelper(QIODevice *device,
QImageIOHandler *handler = 0;
#ifndef QT_NO_LIBRARY
+ typedef QMultiMap<int, QString> PluginKeyMap;
+ typedef PluginKeyMap::const_iterator PluginKeyMapConstIterator;
+
// check if any plugins can write the image
QFactoryLoader *l = loader();
- QStringList keys = l->keys();
+ const PluginKeyMap keyMap = l->keyMap();
int suffixPluginIndex = -1;
#endif
@@ -149,7 +152,7 @@ static QImageIOHandler *createWriteHandlerHelper(QIODevice *device,
if (QFile *file = qobject_cast<QFile *>(device)) {
if (!(suffix = QFileInfo(file->fileName()).suffix().toLower().toLatin1()).isEmpty()) {
#ifndef QT_NO_LIBRARY
- int index = keys.indexOf(QString::fromLatin1(suffix));
+ const int index = keyMap.key(QString::fromLatin1(suffix), -1);
if (index != -1)
suffixPluginIndex = index;
#endif
@@ -163,9 +166,12 @@ static QImageIOHandler *createWriteHandlerHelper(QIODevice *device,
if (suffixPluginIndex != -1) {
// when format is missing, check if we can find a plugin for the
// suffix.
- QImageIOPlugin *plugin = qobject_cast<QImageIOPlugin *>(l->instance(QString::fromLatin1(suffix)));
- if (plugin && (plugin->capabilities(device, suffix) & QImageIOPlugin::CanWrite))
- handler = plugin->create(device, suffix);
+ const int index = keyMap.key(QString::fromLatin1(suffix), -1);
+ if (index != -1) {
+ QImageIOPlugin *plugin = qobject_cast<QImageIOPlugin *>(l->instance(index));
+ if (plugin && (plugin->capabilities(device, suffix) & QImageIOPlugin::CanWrite))
+ handler = plugin->create(device, suffix);
+ }
}
#endif // QT_NO_LIBRARY
@@ -210,8 +216,9 @@ static QImageIOHandler *createWriteHandlerHelper(QIODevice *device,
#ifndef QT_NO_LIBRARY
if (!testFormat.isEmpty()) {
- for (int i = 0; i < keys.size(); ++i) {
- QImageIOPlugin *plugin = qobject_cast<QImageIOPlugin *>(l->instance(keys.at(i)));
+ const int keyCount = keyMap.keys().size();
+ for (int i = 0; i < keyCount; ++i) {
+ QImageIOPlugin *plugin = qobject_cast<QImageIOPlugin *>(l->instance(i));
if (plugin && (plugin->capabilities(device, testFormat) & QImageIOPlugin::CanWrite)) {
delete handler;
handler = plugin->create(device, testFormat);
@@ -647,6 +654,31 @@ bool QImageWriter::supportsOption(QImageIOHandler::ImageOption option) const
return d->handler->supportsOption(option);
}
+
+#ifndef QT_NO_LIBRARY
+void supportedImageHandlerFormats(QFactoryLoader *loader,
+ QImageIOPlugin::Capability cap,
+ QSet<QByteArray> *result)
+{
+ typedef QMultiMap<int, QString> PluginKeyMap;
+ typedef PluginKeyMap::const_iterator PluginKeyMapConstIterator;
+
+ const PluginKeyMap keyMap = loader->keyMap();
+ const PluginKeyMapConstIterator cend = keyMap.constEnd();
+ int i = -1;
+ QImageIOPlugin *plugin = 0;
+ for (PluginKeyMapConstIterator it = keyMap.constBegin(); it != cend; ++it) {
+ if (it.key() != i) {
+ i = it.key();
+ plugin = qobject_cast<QImageIOPlugin *>(loader->instance(i));
+ }
+ const QByteArray key = it.value().toLatin1();
+ if (plugin && (plugin->capabilities(0, key) & cap) != 0)
+ result->insert(key);
+ }
+}
+#endif // QT_NO_LIBRARY
+
/*!
Returns the list of image formats supported by QImageWriter.
@@ -696,13 +728,7 @@ QList<QByteArray> QImageWriter::supportedImageFormats()
#endif
#ifndef QT_NO_LIBRARY
- QFactoryLoader *l = loader();
- QStringList keys = l->keys();
- for (int i = 0; i < keys.count(); ++i) {
- QImageIOPlugin *plugin = qobject_cast<QImageIOPlugin *>(l->instance(keys.at(i)));
- if (plugin && (plugin->capabilities(0, keys.at(i).toLatin1()) & QImageIOPlugin::CanWrite) != 0)
- formats << keys.at(i).toLatin1();
- }
+ supportedImageHandlerFormats(loader(), QImageIOPlugin::CanWrite, &formats);
#endif // QT_NO_LIBRARY
QList<QByteArray> sortedFormats;
diff --git a/src/gui/image/qnativeimage.cpp b/src/gui/image/qnativeimage.cpp
index 96d7a0487b..c562b0bd6d 100644
--- a/src/gui/image/qnativeimage.cpp
+++ b/src/gui/image/qnativeimage.cpp
@@ -41,7 +41,7 @@
#include <qdebug.h>
#include "qnativeimage_p.h"
-#include "qplatformscreen_qpa.h"
+#include <qpa/qplatformscreen.h>
#include "private/qguiapplication_p.h"
#include "qscreen.h"
diff --git a/src/gui/image/qpicture.cpp b/src/gui/image/qpicture.cpp
index 283002b1d3..34ca077e5b 100644
--- a/src/gui/image/qpicture.cpp
+++ b/src/gui/image/qpicture.cpp
@@ -1400,14 +1400,20 @@ Q_GLOBAL_STATIC(QPHList, pictureHandlers)
void qt_init_picture_plugins()
{
#ifndef QT_NO_LIBRARY
+ typedef QMultiMap<int, QString> PluginKeyMap;
+ typedef PluginKeyMap::const_iterator PluginKeyMapConstIterator;
+
static QBasicMutex mutex;
QMutexLocker locker(&mutex);
static QFactoryLoader loader(QPictureFormatInterface_iid,
QStringLiteral("/pictureformats"));
- QStringList keys = loader.keys();
- for (int i = 0; i < keys.count(); ++i)
- if (QPictureFormatInterface *format = qobject_cast<QPictureFormatInterface*>(loader.instance(keys.at(i))))
- format->installIOHandler(keys.at(i));
+
+ const PluginKeyMap keyMap = loader.keyMap();
+ const PluginKeyMapConstIterator cend = keyMap.constEnd();
+ for (PluginKeyMapConstIterator it = keyMap.constBegin(); it != cend; ++it) {
+ if (QPictureFormatInterface *format = qobject_cast<QPictureFormatInterface*>(loader.instance(it.key())))
+ format->installIOHandler(it.value());
+ }
#endif
}
diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp
index 377d7e036a..4cdf61138c 100644
--- a/src/gui/image/qpixmap.cpp
+++ b/src/gui/image/qpixmap.cpp
@@ -42,7 +42,7 @@
#include <qglobal.h>
#include "qpixmap.h"
-#include "qplatformpixmap_qpa.h"
+#include <qpa/qplatformpixmap.h>
#include "qimagepixmapcleanuphooks_p.h"
#include "qbitmap.h"
@@ -63,7 +63,7 @@
#include "qthread.h"
#include "qdebug.h"
-# include "qplatformintegration_qpa.h"
+#include <qpa/qplatformintegration.h>
#include "qpixmap_raster_p.h"
#include "private/qhexstring_p.h"
diff --git a/src/gui/image/qpixmap_blitter_p.h b/src/gui/image/qpixmap_blitter_p.h
index 95397374c6..174277f9eb 100644
--- a/src/gui/image/qpixmap_blitter_p.h
+++ b/src/gui/image/qpixmap_blitter_p.h
@@ -42,7 +42,7 @@
#ifndef QPIXMAP_BLITTER_P_H
#define QPIXMAP_BLITTER_P_H
-#include <qplatformpixmap_qpa.h>
+#include <qpa/qplatformpixmap.h>
#include <private/qpaintengine_blitter_p.h>
#ifndef QT_NO_BLITTABLE
diff --git a/src/gui/image/qpixmap_raster_p.h b/src/gui/image/qpixmap_raster_p.h
index 864fad42ec..8e1a8ccc03 100644
--- a/src/gui/image/qpixmap_raster_p.h
+++ b/src/gui/image/qpixmap_raster_p.h
@@ -53,7 +53,7 @@
// We mean it.
//
-#include <QtGui/qplatformpixmap_qpa.h>
+#include <qpa/qplatformpixmap.h>
QT_BEGIN_NAMESPACE
diff --git a/src/gui/image/qpixmap_win.cpp b/src/gui/image/qpixmap_win.cpp
index 66a829f5de..c25393c72e 100644
--- a/src/gui/image/qpixmap_win.cpp
+++ b/src/gui/image/qpixmap_win.cpp
@@ -40,7 +40,7 @@
****************************************************************************/
#include "qpixmap.h"
-#include "qplatformpixmap_qpa.h"
+#include <qpa/qplatformpixmap.h>
#include "qpixmap_raster_p.h"
#include <qglobal.h>
diff --git a/src/gui/image/qplatformpixmap.cpp b/src/gui/image/qplatformpixmap.cpp
index 073c267fbe..769cf5f90b 100644
--- a/src/gui/image/qplatformpixmap.cpp
+++ b/src/gui/image/qplatformpixmap.cpp
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#include "qplatformpixmap_qpa.h"
-#include "qplatformintegration_qpa.h"
+#include "qplatformpixmap.h"
+#include <qpa/qplatformintegration.h>
#include <QtCore/qbuffer.h>
#include <QtGui/qbitmap.h>
#include <QtGui/qimagereader.h>
diff --git a/src/gui/image/qplatformpixmap_qpa.h b/src/gui/image/qplatformpixmap.h
index 154c5079a7..154c5079a7 100644
--- a/src/gui/image/qplatformpixmap_qpa.h
+++ b/src/gui/image/qplatformpixmap.h
diff --git a/src/gui/kernel/kernel.pri b/src/gui/kernel/kernel.pri
index 3c1b6b4e48..525871c89b 100644
--- a/src/gui/kernel/kernel.pri
+++ b/src/gui/kernel/kernel.pri
@@ -10,27 +10,27 @@ HEADERS += \
kernel/qgenericplugin_qpa.h \
kernel/qwindowsysteminterface_qpa.h \
kernel/qwindowsysteminterface_qpa_p.h \
- kernel/qplatformintegration_qpa.h \
- kernel/qplatformdrag_qpa.h \
- kernel/qplatformscreen_qpa.h \
- kernel/qplatformscreen_qpa_p.h \
- kernel/qplatforminputcontext_qpa.h \
- kernel/qplatforminputcontext_qpa_p.h \
- kernel/qplatformintegrationfactory_qpa_p.h \
- kernel/qplatformintegrationplugin_qpa.h \
- kernel/qplatformtheme_qpa.h\
- kernel/qplatformthemefactory_qpa_p.h \
- kernel/qplatformthemeplugin_qpa.h \
- kernel/qplatformwindow_qpa.h \
- kernel/qplatformcursor_qpa.h \
- kernel/qplatformclipboard_qpa.h \
- kernel/qplatformnativeinterface_qpa.h \
+ kernel/qplatformintegration.h \
+ kernel/qplatformdrag.h \
+ kernel/qplatformscreen.h \
+ kernel/qplatformscreen_p.h \
+ kernel/qplatforminputcontext.h \
+ kernel/qplatforminputcontext_p.h \
+ kernel/qplatformintegrationfactory_p.h \
+ kernel/qplatformintegrationplugin.h \
+ kernel/qplatformtheme.h\
+ kernel/qplatformthemefactory_p.h \
+ kernel/qplatformthemeplugin.h \
+ kernel/qplatformwindow.h \
+ kernel/qplatformcursor.h \
+ kernel/qplatformclipboard.h \
+ kernel/qplatformnativeinterface.h \
kernel/qsurfaceformat.h \
kernel/qguiapplication.h \
kernel/qguiapplication_p.h \
kernel/qwindow_p.h \
kernel/qwindow.h \
- kernel/qplatformsurface_qpa.h \
+ kernel/qplatformsurface.h \
kernel/qsurface.h \
kernel/qclipboard.h \
kernel/qcursor.h \
@@ -55,10 +55,10 @@ HEADERS += \
kernel/qstylehints.h \
kernel/qtouchdevice.h \
kernel/qtouchdevice_p.h \
- kernel/qplatformsharedgraphicscache_qpa.h \
- kernel/qplatformdialoghelper_qpa.h \
- kernel/qplatformservices_qpa.h \
- kernel/qplatformscreenpageflipper_qpa.h
+ kernel/qplatformsharedgraphicscache.h \
+ kernel/qplatformdialoghelper.h \
+ kernel/qplatformservices.h \
+ kernel/qplatformscreenpageflipper.h
SOURCES += \
kernel/qclipboard_qpa.cpp \
@@ -107,7 +107,7 @@ SOURCES += \
contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles2) {
HEADERS += \
- kernel/qplatformopenglcontext_qpa.h \
+ kernel/qplatformopenglcontext.h \
kernel/qopenglcontext.h \
kernel/qopenglcontext_p.h
diff --git a/src/gui/kernel/qclipboard_qpa.cpp b/src/gui/kernel/qclipboard_qpa.cpp
index 187e09253e..284775c4e2 100644
--- a/src/gui/kernel/qclipboard_qpa.cpp
+++ b/src/gui/kernel/qclipboard_qpa.cpp
@@ -45,8 +45,8 @@
#include "qmimedata.h"
#include "private/qguiapplication_p.h"
-#include "qplatformclipboard_qpa.h"
-#include "qplatformintegration_qpa.h"
+#include <qpa/qplatformclipboard.h>
+#include <qpa/qplatformintegration.h>
QT_BEGIN_NAMESPACE
diff --git a/src/gui/kernel/qcursor_qpa.cpp b/src/gui/kernel/qcursor_qpa.cpp
index 1c719c839e..cc9163fbc0 100644
--- a/src/gui/kernel/qcursor_qpa.cpp
+++ b/src/gui/kernel/qcursor_qpa.cpp
@@ -42,7 +42,7 @@
#include <qcursor.h>
#include <qscreen.h>
#include <private/qcursor_p.h>
-#include <qplatformcursor_qpa.h>
+#include <qpa/qplatformcursor.h>
#include <private/qguiapplication_p.h>
#include <qbitmap.h>
diff --git a/src/gui/kernel/qdnd.cpp b/src/gui/kernel/qdnd.cpp
index 1ed4a96192..8182719830 100644
--- a/src/gui/kernel/qdnd.cpp
+++ b/src/gui/kernel/qdnd.cpp
@@ -59,8 +59,8 @@
#include "qimagewriter.h"
#include "qdebug.h"
#include <ctype.h>
-#include <qplatformintegration_qpa.h>
-#include <qplatformdrag_qpa.h>
+#include <qpa/qplatformintegration.h>
+#include <qpa/qplatformdrag.h>
#include <private/qguiapplication_p.h>
diff --git a/src/gui/kernel/qgenericpluginfactory_qpa.cpp b/src/gui/kernel/qgenericpluginfactory_qpa.cpp
index d4a7a9c20e..90da16f868 100644
--- a/src/gui/kernel/qgenericpluginfactory_qpa.cpp
+++ b/src/gui/kernel/qgenericpluginfactory_qpa.cpp
@@ -79,12 +79,12 @@ Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
*/
QObject *QGenericPluginFactory::create(const QString& key, const QString &specification)
{
- QString driver = key.toLower();
+ const QString driver = key.toLower();
#if !defined(Q_OS_WIN32) || defined(QT_MAKEDLL)
#ifndef QT_NO_LIBRARY
- if (QGenericPluginFactoryInterface *factory = qobject_cast<QGenericPluginFactoryInterface*>(loader()->instance(driver)))
- return factory->create(driver, specification);
+ if (QObject *object = qLoadPlugin1<QObject, QGenericPluginFactoryInterface>(loader(), driver, specification))
+ return object;
#endif
#endif
return 0;
@@ -101,11 +101,14 @@ QStringList QGenericPluginFactory::keys()
#if !defined(Q_OS_WIN32) || defined(QT_MAKEDLL)
#ifndef QT_NO_LIBRARY
- QStringList plugins = loader()->keys();
- for (int i = 0; i < plugins.size(); ++i) {
- if (!list.contains(plugins.at(i)))
- list += plugins.at(i);
- }
+ typedef QMultiMap<int, QString> PluginKeyMap;
+ typedef PluginKeyMap::const_iterator PluginKeyMapConstIterator;
+
+ const PluginKeyMap keyMap = loader()->keyMap();
+ const PluginKeyMapConstIterator cend = keyMap.constEnd();
+ for (PluginKeyMapConstIterator it = keyMap.constBegin(); it != cend; ++it)
+ if (!list.contains(it.value()))
+ list += it.value();
#endif //QT_NO_LIBRARY
#endif //QT_MAKEDLL
return list;
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index b63ed78c4b..bdffb985f7 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -42,14 +42,15 @@
#include "qguiapplication.h"
#include "private/qguiapplication_p.h"
-#include "private/qplatformintegrationfactory_qpa_p.h"
+#include <qpa/qplatformintegrationfactory_p.h>
#include "private/qevent_p.h"
#include "qfont.h"
-#include "qplatformfontdatabase_qpa.h"
-#include "qplatformwindow_qpa.h"
-#include "qplatformnativeinterface_qpa.h"
-#include "qplatformtheme_qpa.h"
-#include "qplatformintegration_qpa.h"
+#include <qpa/qplatformfontdatabase.h>
+#include <qpa/qplatformwindow.h>
+#include <qpa/qplatformnativeinterface.h>
+#include <qpa/qplatformtheme.h>
+#include <qpa/qplatformintegration.h>
+#include <qpa/qplatformdrag.h>
#include <QtCore/QAbstractEventDispatcher>
#include <QtCore/QVariant>
@@ -64,14 +65,14 @@
#include <private/qscreen_p.h>
#include <private/qdrawhelper_p.h>
-#include <QtGui/QPlatformIntegration>
+#include <qpa/qplatformintegration.h>
#include <QtGui/QGenericPluginFactory>
#include <QtGui/qstylehints.h>
#include <QtGui/qinputpanel.h>
#include <QtGui/qpixmapcache.h>
-#include <QtGui/qplatformtheme_qpa.h>
-#include <QtGui/qplatforminputcontext_qpa.h>
-#include <private/qplatforminputcontext_qpa_p.h>
+#include <qpa/qplatformtheme.h>
+#include <qpa/qplatforminputcontext.h>
+#include <qpa/qplatforminputcontext_p.h>
#include <QWindowSystemInterface>
#include "private/qwindowsysteminterface_qpa_p.h"
@@ -79,11 +80,11 @@
#include "private/qcursor_p.h"
#include "private/qdnd_p.h"
-#include <private/qplatformthemefactory_qpa_p.h>
-#include "qplatformdrag_qpa.h"
+#include <qpa/qplatformthemefactory_p.h>
+#include <qpa/qplatformdrag.h>
#ifndef QT_NO_CURSOR
-#include "qplatformcursor_qpa.h"
+#include <qpa/qplatformcursor.h>
#endif
#include <QtGui/QPixmap>
@@ -1090,6 +1091,10 @@ void QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePriv
QGuiApplicationPrivate::reportLogicalDotsPerInchChange(
static_cast<QWindowSystemInterfacePrivate::ScreenLogicalDotsPerInchEvent *>(e));
break;
+ case QWindowSystemInterfacePrivate::ScreenRefreshRate:
+ QGuiApplicationPrivate::reportRefreshRateChange(
+ static_cast<QWindowSystemInterfacePrivate::ScreenRefreshRateEvent *>(e));
+ break;
case QWindowSystemInterfacePrivate::ThemeChange:
QGuiApplicationPrivate::processThemeChanged(
static_cast<QWindowSystemInterfacePrivate::ThemeChangeEvent *>(e));
@@ -1750,6 +1755,21 @@ void QGuiApplicationPrivate::reportLogicalDotsPerInchChange(QWindowSystemInterfa
emit s->logicalDotsPerInchChanged(s->logicalDotsPerInch());
}
+void QGuiApplicationPrivate::reportRefreshRateChange(QWindowSystemInterfacePrivate::ScreenRefreshRateEvent *e)
+{
+ // This operation only makes sense after the QGuiApplication constructor runs
+ if (QCoreApplication::startingUp())
+ return;
+
+ if (!e->screen)
+ return;
+
+ QScreen *s = e->screen.data();
+ s->d_func()->refreshRate = e->rate;
+
+ emit s->refreshRateChanged(s->refreshRate());
+}
+
void QGuiApplicationPrivate::processExposeEvent(QWindowSystemInterfacePrivate::ExposeEvent *e)
{
if (!e->exposed)
diff --git a/src/gui/kernel/qguiapplication_p.h b/src/gui/kernel/qguiapplication_p.h
index 78641de55b..b7b8afc7ad 100644
--- a/src/gui/kernel/qguiapplication_p.h
+++ b/src/gui/kernel/qguiapplication_p.h
@@ -53,14 +53,13 @@
#include "private/qwindowsysteminterface_qpa_p.h"
#include "private/qshortcutmap_p.h"
-#include "qplatformdrag_qpa.h"
-
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
class QPlatformIntegration;
class QPlatformTheme;
+class QPlatformDragQtResponse;
struct QDrawHelperGammaTables;
class Q_GUI_EXPORT QGuiApplicationPrivate : public QCoreApplicationPrivate
@@ -117,6 +116,7 @@ public:
static void reportGeometryChange(QWindowSystemInterfacePrivate::ScreenGeometryEvent *e);
static void reportAvailableGeometryChange(QWindowSystemInterfacePrivate::ScreenAvailableGeometryEvent *e);
static void reportLogicalDotsPerInchChange(QWindowSystemInterfacePrivate::ScreenLogicalDotsPerInchEvent *e);
+ static void reportRefreshRateChange(QWindowSystemInterfacePrivate::ScreenRefreshRateEvent *e);
static void processThemeChanged(QWindowSystemInterfacePrivate::ThemeChangeEvent *tce);
static void processExposeEvent(QWindowSystemInterfacePrivate::ExposeEvent *e);
diff --git a/src/gui/kernel/qinputmethod.cpp b/src/gui/kernel/qinputmethod.cpp
index 0e0bc7237a..a699938dc6 100644
--- a/src/gui/kernel/qinputmethod.cpp
+++ b/src/gui/kernel/qinputmethod.cpp
@@ -43,7 +43,7 @@
#include <private/qinputmethod_p.h>
#include <qguiapplication.h>
#include <qtimer.h>
-#include <private/qplatforminputcontext_qpa_p.h>
+#include <qpa/qplatforminputcontext_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/gui/kernel/qinputmethod_p.h b/src/gui/kernel/qinputmethod_p.h
index 1e55b00318..ad3d2141c1 100644
--- a/src/gui/kernel/qinputmethod_p.h
+++ b/src/gui/kernel/qinputmethod_p.h
@@ -46,8 +46,8 @@
#include <private/qobject_p.h>
#include <QtCore/QWeakPointer>
#include <QTransform>
-#include <qplatforminputcontext_qpa.h>
-#include <qplatformintegration_qpa.h>
+#include <qpa/qplatforminputcontext.h>
+#include <qpa/qplatformintegration.h>
#include <private/qguiapplication_p.h>
QT_BEGIN_HEADER
diff --git a/src/gui/kernel/qkeysequence.cpp b/src/gui/kernel/qkeysequence.cpp
index d03294f246..f94c6d541e 100644
--- a/src/gui/kernel/qkeysequence.cpp
+++ b/src/gui/kernel/qkeysequence.cpp
@@ -41,7 +41,7 @@
#include "qkeysequence.h"
#include "qkeysequence_p.h"
-#include "qplatformtheme_qpa.h"
+#include <qpa/qplatformtheme.h>
#include "private/qguiapplication_p.h"
#ifndef QT_NO_SHORTCUT
@@ -246,6 +246,7 @@ void Q_GUI_EXPORT qt_set_sequence_auto_mnemonic(bool b) { qt_sequence_no_mnemoni
\row \li Refresh \li F5 \li F5 \li F5 \li Ctrl+R, F5
\row \li ZoomIn \li Ctrl+Plus \li Ctrl+Plus \li Ctrl+Plus \li Ctrl+Plus
\row \li ZoomOut \li Ctrl+Minus \li Ctrl+Minus \li Ctrl+Minus \li Ctrl+Minus
+ \row \li FullScreen \li F11, Alt+Enter \li Ctrl+Meta+F \li F11, Ctrl+Shift+F \li Ctrl+F11
\row \li Print \li Ctrl+P \li Ctrl+P \li Ctrl+P \li Ctrl+P
\row \li AddTab \li Ctrl+T \li Ctrl+T \li Ctrl+Shift+N, Ctrl+T \li Ctrl+T
\row \li NextChild \li Ctrl+Tab, Forward, Ctrl+F6 \li Ctrl+}, Forward, Ctrl+Tab \li Ctrl+Tab, Forward, Ctrl+Comma \li Ctrl+Tab, Forward
@@ -638,8 +639,9 @@ static const struct {
{ 0, 0 }
};
-//Table of key bindings. It must be sorted on key sequence.
-//A priority of 1 indicates that this is the primary key binding when multiple are defined.
+// Table of key bindings. It must be sorted on key sequence:
+// The integer value of VK_KEY | Modifier Keys (e.g., VK_META, and etc.)
+// A priority of 1 indicates that this is the primary key binding when multiple are defined.
enum KeyPlatform {
KB_Win = (1 << QPlatformTheme::WindowsKeyboardScheme),
@@ -671,6 +673,7 @@ const QKeyBinding QKeySequencePrivate::keyBindings[] = {
{QKeySequence::FindNext, 0, Qt::Key_F3, KB_X11},
{QKeySequence::FindNext, 1, Qt::Key_F3, KB_Win},
{QKeySequence::Refresh, 0, Qt::Key_F5, KB_Win | KB_X11},
+ {QKeySequence::FullScreen, 1, Qt::Key_F11, KB_Win | KB_KDE},
{QKeySequence::Undo, 0, Qt::Key_F14, KB_X11}, //Undo on sun keyboards
{QKeySequence::Copy, 0, Qt::Key_F16, KB_X11}, //Copy on sun keyboards
{QKeySequence::Paste, 0, Qt::Key_F18, KB_X11}, //Paste on sun keyboards
@@ -749,6 +752,8 @@ const QKeyBinding QKeySequencePrivate::keyBindings[] = {
{QKeySequence::Close, 1, Qt::CTRL | Qt::Key_F4, KB_Win},
{QKeySequence::Close, 0, Qt::CTRL | Qt::Key_F4, KB_Mac},
{QKeySequence::NextChild, 0, Qt::CTRL | Qt::Key_F6, KB_Win},
+ {QKeySequence::FullScreen, 1, Qt::CTRL | Qt::Key_F11, KB_Gnome},
+ {QKeySequence::FullScreen, 0, Qt::CTRL | Qt::SHIFT | Qt::Key_F, KB_KDE},
{QKeySequence::FindPrevious, 1, Qt::CTRL | Qt::SHIFT | Qt::Key_G, KB_Gnome | KB_Mac},
{QKeySequence::FindPrevious, 0, Qt::CTRL | Qt::SHIFT | Qt::Key_G, KB_Win},
{QKeySequence::AddTab, 1, Qt::CTRL | Qt::SHIFT | Qt::Key_N, KB_KDE},
@@ -769,6 +774,7 @@ const QKeyBinding QKeySequencePrivate::keyBindings[] = {
{QKeySequence::PreviousChild, 0, Qt::CTRL | Qt::SHIFT | Qt::Key_F6, KB_Win},
{QKeySequence::Undo, 0, Qt::ALT | Qt::Key_Backspace, KB_Win},
{QKeySequence::DeleteStartOfWord, 0, Qt::ALT | Qt::Key_Backspace, KB_Mac},
+ {QKeySequence::FullScreen, 0, Qt::ALT | Qt::Key_Enter, KB_Win},
{QKeySequence::DeleteEndOfWord, 0, Qt::ALT | Qt::Key_Delete, KB_Mac},
{QKeySequence::Back, 1, Qt::ALT | Qt::Key_Left, KB_Win | KB_X11},
{QKeySequence::MoveToPreviousWord, 0, Qt::ALT | Qt::Key_Left, KB_Mac},
@@ -797,7 +803,8 @@ const QKeyBinding QKeySequencePrivate::keyBindings[] = {
{QKeySequence::SelectStartOfBlock, 0, Qt::META | Qt::SHIFT | Qt::Key_A, KB_Mac},
{QKeySequence::SelectEndOfBlock, 0, Qt::META | Qt::SHIFT | Qt::Key_E, KB_Mac},
{QKeySequence::SelectStartOfLine, 0, Qt::META | Qt::SHIFT | Qt::Key_Left, KB_Mac},
- {QKeySequence::SelectEndOfLine, 0, Qt::META | Qt::SHIFT | Qt::Key_Right, KB_Mac}
+ {QKeySequence::SelectEndOfLine, 0, Qt::META | Qt::SHIFT | Qt::Key_Right, KB_Mac},
+ {QKeySequence::FullScreen, 1, Qt::META | Qt::CTRL | Qt::Key_F, KB_Mac}
};
const uint QKeySequencePrivate::numberOfKeyBindings = sizeof(QKeySequencePrivate::keyBindings)/(sizeof(QKeyBinding));
@@ -879,6 +886,7 @@ const uint QKeySequencePrivate::numberOfKeyBindings = sizeof(QKeySequencePrivate
\value WhatsThis Activate "what's this".
\value ZoomIn Zoom in.
\value ZoomOut Zoom out.
+ \value FullScreen Toggle the window state to/from full screen.
*/
/*!
diff --git a/src/gui/kernel/qkeysequence.h b/src/gui/kernel/qkeysequence.h
index c926e8de1a..4cae253b50 100644
--- a/src/gui/kernel/qkeysequence.h
+++ b/src/gui/kernel/qkeysequence.h
@@ -137,7 +137,8 @@ public:
InsertLineSeparator,
SaveAs,
Preferences,
- Quit
+ Quit,
+ FullScreen
};
enum SequenceFormat {
diff --git a/src/gui/kernel/qopenglcontext.cpp b/src/gui/kernel/qopenglcontext.cpp
index 4668f9e750..b99a4dbd04 100644
--- a/src/gui/kernel/qopenglcontext.cpp
+++ b/src/gui/kernel/qopenglcontext.cpp
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#include "qplatformopenglcontext_qpa.h"
-#include "qplatformintegration_qpa.h"
+#include <qpa/qplatformopenglcontext.h>
+#include <qpa/qplatformintegration.h>
#include "qopenglcontext.h"
#include "qopenglcontext_p.h"
#include "qwindow.h"
diff --git a/src/gui/kernel/qplatformclipboard_qpa.h b/src/gui/kernel/qplatformclipboard.h
index 95c8103b7e..95c8103b7e 100644
--- a/src/gui/kernel/qplatformclipboard_qpa.h
+++ b/src/gui/kernel/qplatformclipboard.h
diff --git a/src/gui/kernel/qplatformclipboard_qpa.cpp b/src/gui/kernel/qplatformclipboard_qpa.cpp
index 7273450077..5a29606391 100644
--- a/src/gui/kernel/qplatformclipboard_qpa.cpp
+++ b/src/gui/kernel/qplatformclipboard_qpa.cpp
@@ -38,7 +38,7 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-#include "qplatformclipboard_qpa.h"
+#include "qplatformclipboard.h"
#ifndef QT_NO_CLIPBOARD
diff --git a/src/gui/kernel/qplatformcursor_qpa.h b/src/gui/kernel/qplatformcursor.h
index fb3e4604d2..1f339c86b7 100644
--- a/src/gui/kernel/qplatformcursor_qpa.h
+++ b/src/gui/kernel/qplatformcursor.h
@@ -57,7 +57,7 @@
#include <QtGui/QMouseEvent>
#include <QtCore/QWeakPointer>
#include <QtCore/QObject>
-#include <QtGui/QPlatformScreen>
+#include <qpa/qplatformscreen.h>
#include <QtGui/QCursor>
QT_BEGIN_HEADER
diff --git a/src/gui/kernel/qplatformcursor_qpa.cpp b/src/gui/kernel/qplatformcursor_qpa.cpp
index 5ea080c40a..40b7967af7 100644
--- a/src/gui/kernel/qplatformcursor_qpa.cpp
+++ b/src/gui/kernel/qplatformcursor_qpa.cpp
@@ -38,13 +38,13 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-#include "qplatformcursor_qpa.h"
+#include "qplatformcursor.h"
#include <QPainter>
#include <QBitmap>
#include <QGuiApplication>
#include <QScreen>
-#include <QPlatformScreen>
+#include <qpa/qplatformscreen.h>
#include <private/qguiapplication_p.h>
#include <QDebug>
diff --git a/src/gui/kernel/qplatformdialoghelper_qpa.h b/src/gui/kernel/qplatformdialoghelper.h
index 5cd3ab055b..5966a241ea 100644
--- a/src/gui/kernel/qplatformdialoghelper_qpa.h
+++ b/src/gui/kernel/qplatformdialoghelper.h
@@ -90,26 +90,20 @@ public:
virtual QVariant styleHint(StyleHint hint) const;
- virtual void platformNativeDialogModalHelp() = 0;
- virtual void _q_platformRunNativeAppModalPanel() = 0;
+ virtual void exec_sys() = 0;
virtual void deleteNativeDialog_sys() = 0;
+
virtual bool show_sys(Qt::WindowFlags windowFlags,
Qt::WindowModality windowModality,
QWindow *parent) = 0;
virtual void hide_sys() = 0;
- virtual DialogCode dialogResultCode_sys() = 0;
-
static QVariant defaultStyleHint(QPlatformDialogHelper::StyleHint hint);
Q_SIGNALS:
- void launchNativeAppModalPanel();
void accept();
void reject();
-
-protected Q_SLOTS:
- void emitLaunchNativeAppModalPanel();
};
class Q_GUI_EXPORT QColorDialogOptions
diff --git a/src/gui/kernel/qplatformdialoghelper_qpa.cpp b/src/gui/kernel/qplatformdialoghelper_qpa.cpp
index f2114d17e0..f00437f69b 100644
--- a/src/gui/kernel/qplatformdialoghelper_qpa.cpp
+++ b/src/gui/kernel/qplatformdialoghelper_qpa.cpp
@@ -39,7 +39,7 @@
**
****************************************************************************/
-#include "qplatformdialoghelper_qpa.h"
+#include "qplatformdialoghelper.h"
#include <QtCore/QVariant>
#include <QtCore/QSharedData>
@@ -94,11 +94,6 @@ QVariant QPlatformDialogHelper::defaultStyleHint(QPlatformDialogHelper::StyleHi
return QVariant();
}
-void QPlatformDialogHelper::emitLaunchNativeAppModalPanel()
-{
- emit launchNativeAppModalPanel();
-}
-
// Font dialog
class QFontDialogOptionsPrivate : public QSharedData
diff --git a/src/gui/kernel/qplatformdrag_qpa.h b/src/gui/kernel/qplatformdrag.h
index 14282c5a21..14282c5a21 100644
--- a/src/gui/kernel/qplatformdrag_qpa.h
+++ b/src/gui/kernel/qplatformdrag.h
diff --git a/src/gui/kernel/qplatformdrag_qpa.cpp b/src/gui/kernel/qplatformdrag_qpa.cpp
index d9fc3a2ab8..8367ad8e06 100644
--- a/src/gui/kernel/qplatformdrag_qpa.cpp
+++ b/src/gui/kernel/qplatformdrag_qpa.cpp
@@ -39,7 +39,7 @@
**
****************************************************************************/
-#include "qplatformdrag_qpa.h"
+#include "qplatformdrag.h"
#include <QtGui/private/qdnd_p.h>
#include <QtGui/QKeyEvent>
diff --git a/src/gui/kernel/qplatforminputcontext_qpa.h b/src/gui/kernel/qplatforminputcontext.h
index 696146b859..696146b859 100644
--- a/src/gui/kernel/qplatforminputcontext_qpa.h
+++ b/src/gui/kernel/qplatforminputcontext.h
diff --git a/src/gui/kernel/qplatforminputcontext_qpa_p.h b/src/gui/kernel/qplatforminputcontext_p.h
index dc12d26ffc..dc12d26ffc 100644
--- a/src/gui/kernel/qplatforminputcontext_qpa_p.h
+++ b/src/gui/kernel/qplatforminputcontext_p.h
diff --git a/src/gui/kernel/qplatforminputcontext_qpa.cpp b/src/gui/kernel/qplatforminputcontext_qpa.cpp
index 53839088c5..0a8633b61d 100644
--- a/src/gui/kernel/qplatforminputcontext_qpa.cpp
+++ b/src/gui/kernel/qplatforminputcontext_qpa.cpp
@@ -39,11 +39,11 @@
**
****************************************************************************/
-#include <qplatforminputcontext_qpa.h>
+#include "qplatforminputcontext.h"
#include <qguiapplication.h>
#include <QRect>
#include "private/qkeymapper_p.h"
-#include "private/qplatforminputcontext_qpa_p.h"
+#include <qpa/qplatforminputcontext_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/gui/kernel/qplatformintegration_qpa.h b/src/gui/kernel/qplatformintegration.h
index a44f4343ef..fb62dafc5c 100644
--- a/src/gui/kernel/qplatformintegration_qpa.h
+++ b/src/gui/kernel/qplatformintegration.h
@@ -54,7 +54,7 @@
//
#include <QtGui/qwindowdefs.h>
-#include <QtGui/qplatformscreen_qpa.h>
+#include <qpa/qplatformscreen.h>
#include <QtGui/qsurfaceformat.h>
QT_BEGIN_HEADER
diff --git a/src/gui/kernel/qplatformintegration_qpa.cpp b/src/gui/kernel/qplatformintegration_qpa.cpp
index 5269d8fb24..8e4ed05576 100644
--- a/src/gui/kernel/qplatformintegration_qpa.cpp
+++ b/src/gui/kernel/qplatformintegration_qpa.cpp
@@ -39,15 +39,15 @@
**
****************************************************************************/
-#include "qplatformintegration_qpa.h"
+#include "qplatformintegration.h"
-#include <QtGui/QPlatformFontDatabase>
-#include <QtGui/QPlatformClipboard>
-#include <QtGui/QPlatformAccessibility>
-#include <QtGui/QPlatformTheme>
+#include <qpa/qplatformfontdatabase.h>
+#include <qpa/qplatformclipboard.h>
+#include <qpa/qplatformaccessibility.h>
+#include <qpa/qplatformtheme.h>
#include <QtGui/private/qguiapplication_p.h>
#include <QtGui/private/qpixmap_raster_p.h>
-#include <QtGui/private/qplatformscreen_qpa_p.h>
+#include <qpa/qplatformscreen_p.h>
#include <private/qdnd_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/gui/kernel/qplatformintegrationfactory_qpa_p.h b/src/gui/kernel/qplatformintegrationfactory_p.h
index 4aae7898fa..4aae7898fa 100644
--- a/src/gui/kernel/qplatformintegrationfactory_qpa_p.h
+++ b/src/gui/kernel/qplatformintegrationfactory_p.h
diff --git a/src/gui/kernel/qplatformintegrationfactory_qpa.cpp b/src/gui/kernel/qplatformintegrationfactory_qpa.cpp
index a84c243355..3b05742f09 100644
--- a/src/gui/kernel/qplatformintegrationfactory_qpa.cpp
+++ b/src/gui/kernel/qplatformintegrationfactory_qpa.cpp
@@ -39,10 +39,11 @@
**
****************************************************************************/
-#include "qplatformintegrationfactory_qpa_p.h"
-#include <QPlatformIntegrationPlugin>
+#include <qpa/qplatformintegrationfactory_p.h>
+#include <qpa/qplatformintegrationplugin.h>
#include "private/qfactoryloader_p.h"
#include "qmutex.h"
+#include "qdir.h"
#include "qguiapplication.h"
#include "qdebug.h"
@@ -58,26 +59,20 @@ Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, directLoader,
QPlatformIntegration *QPlatformIntegrationFactory::create(const QString& key, const QString &platformPluginPath)
{
- QPlatformIntegration *ret = 0;
QStringList paramList = key.split(QLatin1Char(':'));
- QString platform = paramList.takeFirst().toLower();
+ const QString platform = paramList.takeFirst().toLower();
#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)
// Try loading the plugin from platformPluginPath first:
if (!platformPluginPath.isEmpty()) {
QCoreApplication::addLibraryPath(platformPluginPath);
- if (QPlatformIntegrationFactoryInterface *factory =
- qobject_cast<QPlatformIntegrationFactoryInterface*>(directLoader()->instance(platform)))
- ret = factory->create(key, paramList);
-
- if (ret)
+ if (QPlatformIntegration *ret = qLoadPlugin1<QPlatformIntegration, QPlatformIntegrationFactoryInterface >(directLoader(), platform, paramList))
return ret;
}
- if (QPlatformIntegrationFactoryInterface *factory = qobject_cast<QPlatformIntegrationFactoryInterface*>(loader()->instance(platform)))
- ret = factory->create(platform, paramList);
+ if (QPlatformIntegration *ret = qLoadPlugin1<QPlatformIntegration, QPlatformIntegrationFactoryInterface >(loader(), platform, paramList))
+ return ret;
#endif
-
- return ret;
+ return 0;
}
/*!
@@ -86,23 +81,28 @@ QPlatformIntegration *QPlatformIntegrationFactory::create(const QString& key, co
\sa create()
*/
+
QStringList QPlatformIntegrationFactory::keys(const QString &platformPluginPath)
{
#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)
QStringList list;
-
if (!platformPluginPath.isEmpty()) {
QCoreApplication::addLibraryPath(platformPluginPath);
- foreach (const QString &key, directLoader()->keys()) {
- list += key + QString(QLatin1String(" (from %1)")).arg(platformPluginPath);
+ list = directLoader()->keyMap().values();
+ if (!list.isEmpty()) {
+ const QString postFix = QStringLiteral(" (from ")
+ + QDir::toNativeSeparators(platformPluginPath)
+ + QLatin1Char(')');
+ const QStringList::iterator end = list.end();
+ for (QStringList::iterator it = list.begin(); it != end; ++it)
+ (*it).append(postFix);
}
}
-
- list += loader()->keys();
+ list.append(loader()->keyMap().values());
+ return list;
#else
- QStringList list;
+ return QStringList();
#endif
- return list;
}
QT_END_NAMESPACE
diff --git a/src/gui/kernel/qplatformintegrationplugin_qpa.h b/src/gui/kernel/qplatformintegrationplugin.h
index d70569cbba..d70569cbba 100644
--- a/src/gui/kernel/qplatformintegrationplugin_qpa.h
+++ b/src/gui/kernel/qplatformintegrationplugin.h
diff --git a/src/gui/kernel/qplatformintegrationplugin_qpa.cpp b/src/gui/kernel/qplatformintegrationplugin_qpa.cpp
index 7bd1caa1d3..d4debd1f3a 100644
--- a/src/gui/kernel/qplatformintegrationplugin_qpa.cpp
+++ b/src/gui/kernel/qplatformintegrationplugin_qpa.cpp
@@ -39,7 +39,7 @@
**
****************************************************************************/
-#include "qplatformintegrationplugin_qpa.h"
+#include "qplatformintegrationplugin.h"
QT_BEGIN_NAMESPACE
diff --git a/src/gui/kernel/qplatformnativeinterface_qpa.h b/src/gui/kernel/qplatformnativeinterface.h
index 918ba4a9b8..918ba4a9b8 100644
--- a/src/gui/kernel/qplatformnativeinterface_qpa.h
+++ b/src/gui/kernel/qplatformnativeinterface.h
diff --git a/src/gui/kernel/qplatformnativeinterface_qpa.cpp b/src/gui/kernel/qplatformnativeinterface_qpa.cpp
index c17eee4415..f0bd3f0658 100644
--- a/src/gui/kernel/qplatformnativeinterface_qpa.cpp
+++ b/src/gui/kernel/qplatformnativeinterface_qpa.cpp
@@ -39,7 +39,7 @@
**
****************************************************************************/
-#include "qplatformnativeinterface_qpa.h"
+#include "qplatformnativeinterface.h"
QT_BEGIN_NAMESPACE
diff --git a/src/gui/kernel/qplatformopenglcontext_qpa.h b/src/gui/kernel/qplatformopenglcontext.h
index ddcb87ad5a..ddcb87ad5a 100644
--- a/src/gui/kernel/qplatformopenglcontext_qpa.h
+++ b/src/gui/kernel/qplatformopenglcontext.h
diff --git a/src/gui/kernel/qplatformopenglcontext_qpa.cpp b/src/gui/kernel/qplatformopenglcontext_qpa.cpp
index 33adc26482..d38a5864d6 100644
--- a/src/gui/kernel/qplatformopenglcontext_qpa.cpp
+++ b/src/gui/kernel/qplatformopenglcontext_qpa.cpp
@@ -39,7 +39,7 @@
**
****************************************************************************/
-#include "qplatformopenglcontext_qpa.h"
+#include "qplatformopenglcontext.h"
#include <QOpenGLFunctions>
diff --git a/src/gui/kernel/qplatformscreen_qpa.h b/src/gui/kernel/qplatformscreen.h
index 71d734867e..1743024d91 100644
--- a/src/gui/kernel/qplatformscreen_qpa.h
+++ b/src/gui/kernel/qplatformscreen.h
@@ -63,7 +63,7 @@
#include <QtGui/qcursor.h>
#include <QtGui/qimage.h>
#include <QtGui/qwindowdefs.h>
-#include <QtGui/qplatformpixmap_qpa.h>
+#include <qpa/qplatformpixmap.h>
QT_BEGIN_HEADER
@@ -101,6 +101,8 @@ public:
virtual QSizeF physicalSize() const;
virtual QDpi logicalDpi() const;
+ virtual qreal refreshRate() const;
+
virtual Qt::ScreenOrientation orientation() const;
virtual QWindow *topLevelAt(const QPoint &point) const;
diff --git a/src/gui/kernel/qplatformscreen_qpa_p.h b/src/gui/kernel/qplatformscreen_p.h
index ced66be8d7..ced66be8d7 100644
--- a/src/gui/kernel/qplatformscreen_qpa_p.h
+++ b/src/gui/kernel/qplatformscreen_p.h
diff --git a/src/gui/kernel/qplatformscreen_qpa.cpp b/src/gui/kernel/qplatformscreen_qpa.cpp
index 022f198073..1fd96a80a5 100644
--- a/src/gui/kernel/qplatformscreen_qpa.cpp
+++ b/src/gui/kernel/qplatformscreen_qpa.cpp
@@ -39,12 +39,12 @@
**
****************************************************************************/
-#include "qplatformscreen_qpa.h"
+#include "qplatformscreen.h"
#include <QtGui/qguiapplication.h>
-#include <QtGui/qplatformcursor_qpa.h>
+#include <qpa/qplatformcursor.h>
#include <QtGui/private/qguiapplication_p.h>
-#include <QtGui/private/qplatformscreen_qpa_p.h>
-#include <QtGui/qplatformintegration_qpa.h>
+#include <qpa/qplatformscreen_p.h>
+#include <qpa/qplatformintegration.h>
#include <QtGui/qscreen.h>
#include <QtGui/qwindow.h>
@@ -123,8 +123,8 @@ QScreen *QPlatformScreen::screen() const
/*!
Reimplement this function in subclass to return the physical size of the
- screen. The physical size represents the actual physical dimensions of
- the display.
+ screen, in millimeters. The physical size represents the actual physical
+ dimensions of the display.
The default implementation takes the pixel size of the screen, considers a
resolution of 100 dots per inch, and returns the calculated physical size.
@@ -161,6 +161,17 @@ QDpi QPlatformScreen::logicalDpi() const
}
/*!
+ Reimplement this function in subclass to return the vertical refresh rate
+ of the screen, in Hz.
+
+ The default returns 60, a sensible default for modern displays.
+*/
+qreal QPlatformScreen::refreshRate() const
+{
+ return 60;
+}
+
+/*!
Reimplement this function in subclass to return the current orientation
of the screen, for example based on accelerometer data to determine
the device orientation.
diff --git a/src/gui/kernel/qplatformscreenpageflipper_qpa.h b/src/gui/kernel/qplatformscreenpageflipper.h
index 116d2dbf82..116d2dbf82 100644
--- a/src/gui/kernel/qplatformscreenpageflipper_qpa.h
+++ b/src/gui/kernel/qplatformscreenpageflipper.h
diff --git a/src/gui/kernel/qplatformscreenpageflipper_qpa.cpp b/src/gui/kernel/qplatformscreenpageflipper_qpa.cpp
index b912c6055e..babecb061f 100644
--- a/src/gui/kernel/qplatformscreenpageflipper_qpa.cpp
+++ b/src/gui/kernel/qplatformscreenpageflipper_qpa.cpp
@@ -39,7 +39,7 @@
**
****************************************************************************/
-#include "qplatformscreenpageflipper_qpa.h"
+#include "qplatformscreenpageflipper.h"
QT_BEGIN_NAMESPACE
diff --git a/src/gui/kernel/qplatformservices_qpa.h b/src/gui/kernel/qplatformservices.h
index c9bfe020ab..c9bfe020ab 100644
--- a/src/gui/kernel/qplatformservices_qpa.h
+++ b/src/gui/kernel/qplatformservices.h
diff --git a/src/gui/kernel/qplatformservices_qpa.cpp b/src/gui/kernel/qplatformservices_qpa.cpp
index 7993a82f4e..dac9e64e40 100644
--- a/src/gui/kernel/qplatformservices_qpa.cpp
+++ b/src/gui/kernel/qplatformservices_qpa.cpp
@@ -39,7 +39,7 @@
**
****************************************************************************/
-#include "qplatformservices_qpa.h"
+#include "qplatformservices.h"
#include <QtCore/QUrl>
#include <QtCore/QString>
diff --git a/src/gui/kernel/qplatformsharedgraphicscache_qpa.h b/src/gui/kernel/qplatformsharedgraphicscache.h
index 679b8ab7de..679b8ab7de 100644
--- a/src/gui/kernel/qplatformsharedgraphicscache_qpa.h
+++ b/src/gui/kernel/qplatformsharedgraphicscache.h
diff --git a/src/gui/kernel/qplatformsharedgraphicscache_qpa.cpp b/src/gui/kernel/qplatformsharedgraphicscache_qpa.cpp
index 539bb1458f..a3bb8da358 100644
--- a/src/gui/kernel/qplatformsharedgraphicscache_qpa.cpp
+++ b/src/gui/kernel/qplatformsharedgraphicscache_qpa.cpp
@@ -39,7 +39,7 @@
**
****************************************************************************/
-#include "qplatformsharedgraphicscache_qpa.h"
+#include "qplatformsharedgraphicscache.h"
QT_BEGIN_NAMESPACE
diff --git a/src/gui/kernel/qplatformsurface_qpa.h b/src/gui/kernel/qplatformsurface.h
index f64a697fc5..f64a697fc5 100644
--- a/src/gui/kernel/qplatformsurface_qpa.h
+++ b/src/gui/kernel/qplatformsurface.h
diff --git a/src/gui/kernel/qplatformsurface_qpa.cpp b/src/gui/kernel/qplatformsurface_qpa.cpp
index 1f752fe3e2..50cdd68ab6 100644
--- a/src/gui/kernel/qplatformsurface_qpa.cpp
+++ b/src/gui/kernel/qplatformsurface_qpa.cpp
@@ -39,7 +39,7 @@
**
****************************************************************************/
-#include "qplatformsurface_qpa.h"
+#include "qplatformsurface.h"
QT_BEGIN_NAMESPACE
diff --git a/src/gui/kernel/qplatformtheme_qpa.h b/src/gui/kernel/qplatformtheme.h
index 8d936e8267..f4406ffabc 100644
--- a/src/gui/kernel/qplatformtheme_qpa.h
+++ b/src/gui/kernel/qplatformtheme.h
@@ -86,7 +86,8 @@ public:
DialogButtonBoxLayout,
DialogButtonBoxButtonsHaveIcons,
UseFullScreenForPopupMenu,
- KeyboardScheme
+ KeyboardScheme,
+ UiEffects
};
enum DialogType {
@@ -149,6 +150,17 @@ public:
CdeKeyboardScheme
};
+ enum UiEffect
+ {
+ GeneralUiEffect = 0x1,
+ AnimateMenuUiEffect = 0x2,
+ FadeMenuUiEffect = 0x4,
+ AnimateComboUiEffect = 0x8,
+ AnimateTooltipUiEffect = 0x10,
+ FadeTooltipUiEffect = 0x20,
+ AnimateToolBoxUiEffect = 0x40
+ };
+
virtual ~QPlatformTheme();
virtual QPlatformMenu *createPlatformMenu(QMenu *menu = 0) const;
diff --git a/src/gui/kernel/qplatformtheme_qpa.cpp b/src/gui/kernel/qplatformtheme_qpa.cpp
index c6314825d7..c9ffbe248f 100644
--- a/src/gui/kernel/qplatformtheme_qpa.cpp
+++ b/src/gui/kernel/qplatformtheme_qpa.cpp
@@ -39,7 +39,7 @@
**
****************************************************************************/
-#include "qplatformtheme_qpa.h"
+#include "qplatformtheme.h"
#include <QtCore/QVariant>
#include <QtCore/QStringList>
@@ -99,6 +99,8 @@ QT_BEGIN_NAMESPACE
\value KeyboardScheme (int) An integer value (enum KeyboardSchemes) specifying the
keyboard scheme.
+ \value UiEffects (int) A flag value consisting of UiEffect values specifying the enabled UI animations.
+
\sa themeHint(), QStyle::pixelMetric()
*/
@@ -175,6 +177,8 @@ QVariant QPlatformTheme::themeHint(ThemeHint hint) const
return QVariant(-1);
case KeyboardScheme:
return QVariant(int(WindowsKeyboardScheme));
+ case UiEffects:
+ return QVariant(int(0));
}
return QVariant();
}
diff --git a/src/gui/kernel/qplatformthemefactory_qpa_p.h b/src/gui/kernel/qplatformthemefactory_p.h
index 4d659812dc..4d659812dc 100644
--- a/src/gui/kernel/qplatformthemefactory_qpa_p.h
+++ b/src/gui/kernel/qplatformthemefactory_p.h
diff --git a/src/gui/kernel/qplatformthemefactory_qpa.cpp b/src/gui/kernel/qplatformthemefactory_qpa.cpp
index c023a73e7e..c809a7fba3 100644
--- a/src/gui/kernel/qplatformthemefactory_qpa.cpp
+++ b/src/gui/kernel/qplatformthemefactory_qpa.cpp
@@ -39,8 +39,9 @@
**
****************************************************************************/
-#include "qplatformthemefactory_qpa_p.h"
-#include <QPlatformThemePlugin>
+#include <qpa/qplatformthemefactory_p.h>
+#include <qpa/qplatformthemeplugin.h>
+#include <QDir>
#include "private/qfactoryloader_p.h"
#include "qmutex.h"
@@ -58,26 +59,20 @@ Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, directLoader,
QPlatformTheme *QPlatformThemeFactory::create(const QString& key, const QString &platformPluginPath)
{
- QPlatformTheme *ret = 0;
QStringList paramList = key.split(QLatin1Char(':'));
- QString platform = paramList.takeFirst().toLower();
+ const QString platform = paramList.takeFirst().toLower();
#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)
// Try loading the plugin from platformPluginPath first:
if (!platformPluginPath.isEmpty()) {
QCoreApplication::addLibraryPath(platformPluginPath);
- if (QPlatformThemeFactoryInterface *factory =
- qobject_cast<QPlatformThemeFactoryInterface*>(directLoader()->instance(platform)))
- ret = factory->create(key, paramList);
-
- if (ret)
+ if (QPlatformTheme *ret = qLoadPlugin1<QPlatformTheme, QPlatformThemeFactoryInterface>(directLoader(), platform, paramList))
return ret;
}
- if (QPlatformThemeFactoryInterface *factory = qobject_cast<QPlatformThemeFactoryInterface*>(loader()->instance(platform)))
- ret = factory->create(platform, paramList);
+ if (QPlatformTheme *ret = qLoadPlugin1<QPlatformTheme, QPlatformThemeFactoryInterface>(loader(), platform, paramList))
+ return ret;
#endif
-
- return ret;
+ return 0;
}
/*!
@@ -93,16 +88,21 @@ QStringList QPlatformThemeFactory::keys(const QString &platformPluginPath)
if (!platformPluginPath.isEmpty()) {
QCoreApplication::addLibraryPath(platformPluginPath);
- foreach (const QString &key, directLoader()->keys()) {
- list += key + QString(QLatin1String(" (from %1)")).arg(platformPluginPath);
+ list += directLoader()->keyMap().values();
+ if (!list.isEmpty()) {
+ const QString postFix = QStringLiteral(" (from ")
+ + QDir::toNativeSeparators(platformPluginPath)
+ + QLatin1Char(')');
+ const QStringList::iterator end = list.end();
+ for (QStringList::iterator it = list.begin(); it != end; ++it)
+ (*it).append(postFix);
}
}
-
- list += loader()->keys();
+ list += loader()->keyMap().values();
+ return list;
#else
- QStringList list;
+ return QStringList();
#endif
- return list;
}
QT_END_NAMESPACE
diff --git a/src/gui/kernel/qplatformthemeplugin_qpa.h b/src/gui/kernel/qplatformthemeplugin.h
index 3ce7cc5b02..3ce7cc5b02 100644
--- a/src/gui/kernel/qplatformthemeplugin_qpa.h
+++ b/src/gui/kernel/qplatformthemeplugin.h
diff --git a/src/gui/kernel/qplatformthemeplugin_qpa.cpp b/src/gui/kernel/qplatformthemeplugin_qpa.cpp
index da2743d6e3..be18716b28 100644
--- a/src/gui/kernel/qplatformthemeplugin_qpa.cpp
+++ b/src/gui/kernel/qplatformthemeplugin_qpa.cpp
@@ -39,7 +39,7 @@
**
****************************************************************************/
-#include "qplatformthemeplugin_qpa.h"
+#include "qplatformthemeplugin.h"
QT_BEGIN_NAMESPACE
diff --git a/src/gui/kernel/qplatformwindow_qpa.h b/src/gui/kernel/qplatformwindow.h
index 729f35e025..0b4c675e56 100644
--- a/src/gui/kernel/qplatformwindow_qpa.h
+++ b/src/gui/kernel/qplatformwindow.h
@@ -58,8 +58,8 @@
#include <QtCore/qstring.h>
#include <QtGui/qwindowdefs.h>
#include <QtGui/qwindow.h>
-#include <QtGui/qplatformopenglcontext_qpa.h>
-#include <QtGui/qplatformsurface_qpa.h>
+#include <qpa/qplatformopenglcontext.h>
+#include <qpa/qplatformsurface.h>
QT_BEGIN_HEADER
diff --git a/src/gui/kernel/qplatformwindow_qpa.cpp b/src/gui/kernel/qplatformwindow_qpa.cpp
index b507eb4fdd..20817361f8 100644
--- a/src/gui/kernel/qplatformwindow_qpa.cpp
+++ b/src/gui/kernel/qplatformwindow_qpa.cpp
@@ -39,7 +39,7 @@
**
****************************************************************************/
-#include "qplatformwindow_qpa.h"
+#include "qplatformwindow.h"
#include <QtGui/qwindowsysteminterface_qpa.h>
#include <QtGui/qwindow.h>
diff --git a/src/gui/kernel/qscreen.cpp b/src/gui/kernel/qscreen.cpp
index 3546ce01dd..2e0df43e66 100644
--- a/src/gui/kernel/qscreen.cpp
+++ b/src/gui/kernel/qscreen.cpp
@@ -42,7 +42,7 @@
#include "qscreen.h"
#include "qscreen_p.h"
#include "qpixmap.h"
-#include "qplatformscreen_qpa.h"
+#include <qpa/qplatformscreen.h>
#include <QtCore/private/qobject_p.h>
@@ -364,6 +364,16 @@ Qt::ScreenOrientation QScreen::orientation() const
}
/*!
+ \property QScreen::refreshRate
+ \brief the approximate vertical refresh rate of the screen in Hz
+*/
+qreal QScreen::refreshRate() const
+{
+ Q_D(const QScreen);
+ return d->refreshRate;
+}
+
+/*!
\property QScreen::primaryOrientation
\brief the primary screen orientation
diff --git a/src/gui/kernel/qscreen.h b/src/gui/kernel/qscreen.h
index f69e04a595..17f3cd3d43 100644
--- a/src/gui/kernel/qscreen.h
+++ b/src/gui/kernel/qscreen.h
@@ -83,6 +83,7 @@ class Q_GUI_EXPORT QScreen : public QObject
Q_PROPERTY(QRect availableGeometry READ availableGeometry NOTIFY availableGeometryChanged)
Q_PROPERTY(Qt::ScreenOrientation primaryOrientation READ orientation NOTIFY primaryOrientationChanged)
Q_PROPERTY(Qt::ScreenOrientation orientation READ orientation NOTIFY orientationChanged)
+ Q_PROPERTY(qreal refreshRate READ refreshRate NOTIFY refreshRateChanged)
public:
QPlatformScreen *handle() const;
@@ -127,6 +128,8 @@ public:
QPixmap grabWindow(WId window, int x, int y, int w, int h);
+ qreal refreshRate() const;
+
Q_SIGNALS:
void sizeChanged(const QSize &size);
void geometryChanged(const QRect &geometry);
@@ -140,6 +143,7 @@ Q_SIGNALS:
void availableGeometryChanged(const QRect &rect);
void primaryOrientationChanged(Qt::ScreenOrientation orientation);
void orientationChanged(Qt::ScreenOrientation orientation);
+ void refreshRateChanged(qreal refreshRate);
private:
explicit QScreen(QPlatformScreen *screen);
diff --git a/src/gui/kernel/qscreen_p.h b/src/gui/kernel/qscreen_p.h
index c6bf37e87a..b0e1b8671a 100644
--- a/src/gui/kernel/qscreen_p.h
+++ b/src/gui/kernel/qscreen_p.h
@@ -43,7 +43,7 @@
#define QSCREEN_P_H
#include <QtGui/qscreen.h>
-#include <QtGui/qplatformscreen_qpa.h>
+#include <qpa/qplatformscreen.h>
#include <QtCore/private/qobject_p.h>
@@ -63,6 +63,7 @@ public:
geometry = screen->geometry();
availableGeometry = screen->availableGeometry();
logicalDpi = screen->logicalDpi();
+ refreshRate = screen->refreshRate();
updatePrimaryOrientation();
}
@@ -74,6 +75,7 @@ public:
QRect geometry;
QRect availableGeometry;
QDpi logicalDpi;
+ qreal refreshRate;
QPlatformScreen *platformScreen;
};
diff --git a/src/gui/kernel/qstylehints.cpp b/src/gui/kernel/qstylehints.cpp
index 9384d34097..a98e5fbd76 100644
--- a/src/gui/kernel/qstylehints.cpp
+++ b/src/gui/kernel/qstylehints.cpp
@@ -40,7 +40,7 @@
****************************************************************************/
#include <qstylehints.h>
-#include <qplatformintegration_qpa.h>
+#include <qpa/qplatformintegration.h>
#include <private/qguiapplication_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp
index 8b37fce50c..6183b3f6ac 100644
--- a/src/gui/kernel/qwindow.cpp
+++ b/src/gui/kernel/qwindow.cpp
@@ -41,11 +41,11 @@
#include "qwindow.h"
-#include "qplatformwindow_qpa.h"
-#include "qplatformintegration_qpa.h"
+#include <qpa/qplatformwindow.h>
+#include <qpa/qplatformintegration.h>
#include "qsurfaceformat.h"
#ifndef QT_NO_OPENGL
-#include "qplatformopenglcontext_qpa.h"
+#include <qpa/qplatformopenglcontext.h>
#include "qopenglcontext.h"
#endif
#include "qscreen.h"
diff --git a/src/gui/kernel/qwindow_p.h b/src/gui/kernel/qwindow_p.h
index 0afd903ead..92eaf90188 100644
--- a/src/gui/kernel/qwindow_p.h
+++ b/src/gui/kernel/qwindow_p.h
@@ -43,7 +43,7 @@
#define QWINDOW_P_H
#include <QtGui/qwindow.h>
-#include <QtGui/qplatformwindow_qpa.h>
+#include <qpa/qplatformwindow.h>
#include <QtCore/private/qobject_p.h>
diff --git a/src/gui/kernel/qwindowsysteminterface_qpa.cpp b/src/gui/kernel/qwindowsysteminterface_qpa.cpp
index a0b77b8208..c3136b0b0a 100644
--- a/src/gui/kernel/qwindowsysteminterface_qpa.cpp
+++ b/src/gui/kernel/qwindowsysteminterface_qpa.cpp
@@ -39,13 +39,13 @@
**
****************************************************************************/
#include "qwindowsysteminterface_qpa.h"
-#include "qplatformwindow_qpa.h"
+#include <qpa/qplatformwindow.h>
#include "qwindowsysteminterface_qpa_p.h"
#include "private/qguiapplication_p.h"
#include "private/qevent_p.h"
#include "private/qtouchdevice_p.h"
#include <QAbstractEventDispatcher>
-#include <QPlatformDrag>
+#include <qpa/qplatformdrag.h>
#include <qdebug.h>
QT_BEGIN_NAMESPACE
@@ -434,6 +434,13 @@ void QWindowSystemInterface::handleScreenLogicalDotsPerInchChange(QScreen *scree
QWindowSystemInterfacePrivate::queueWindowSystemEvent(e);
}
+void QWindowSystemInterface::handleScreenRefreshRateChange(QScreen *screen, qreal newRefreshRate)
+{
+ QWindowSystemInterfacePrivate::ScreenRefreshRateEvent *e =
+ new QWindowSystemInterfacePrivate::ScreenRefreshRateEvent(screen, newRefreshRate);
+ QWindowSystemInterfacePrivate::queueWindowSystemEvent(e);
+}
+
void QWindowSystemInterface::handleThemeChange(QWindow *tlw)
{
QWindowSystemInterfacePrivate::ThemeChangeEvent *e = new QWindowSystemInterfacePrivate::ThemeChangeEvent(tlw);
diff --git a/src/gui/kernel/qwindowsysteminterface_qpa.h b/src/gui/kernel/qwindowsysteminterface_qpa.h
index 1fbf430bf9..7e0ebf0efc 100644
--- a/src/gui/kernel/qwindowsysteminterface_qpa.h
+++ b/src/gui/kernel/qwindowsysteminterface_qpa.h
@@ -144,6 +144,7 @@ public:
static void handleScreenGeometryChange(QScreen *screen, const QRect &newGeometry);
static void handleScreenAvailableGeometryChange(QScreen *screen, const QRect &newAvailableGeometry);
static void handleScreenLogicalDotsPerInchChange(QScreen *screen, qreal newDpiX, qreal newDpiY);
+ static void handleScreenRefreshRateChange(QScreen *screen, qreal newRefreshRate);
static void handleThemeChange(QWindow *tlw);
diff --git a/src/gui/kernel/qwindowsysteminterface_qpa_p.h b/src/gui/kernel/qwindowsysteminterface_qpa_p.h
index d7be7699e9..c7ad197b3c 100644
--- a/src/gui/kernel/qwindowsysteminterface_qpa_p.h
+++ b/src/gui/kernel/qwindowsysteminterface_qpa_p.h
@@ -66,6 +66,7 @@ public:
ScreenGeometry,
ScreenAvailableGeometry,
ScreenLogicalDotsPerInch,
+ ScreenRefreshRate,
ThemeChange,
Expose
};
@@ -233,6 +234,14 @@ public:
qreal dpiY;
};
+ class ScreenRefreshRateEvent : public WindowSystemEvent {
+ public:
+ ScreenRefreshRateEvent(QScreen *s, qreal r)
+ : WindowSystemEvent(ScreenRefreshRate), screen(s), rate(r) { }
+ QWeakPointer<QScreen> screen;
+ qreal rate;
+ };
+
class ThemeChangeEvent : public WindowSystemEvent {
public:
explicit ThemeChangeEvent(QWindow * w)
diff --git a/src/gui/opengl/qopenglbuffer.cpp b/src/gui/opengl/qopenglbuffer.cpp
index f47f71c121..045eec060b 100644
--- a/src/gui/opengl/qopenglbuffer.cpp
+++ b/src/gui/opengl/qopenglbuffer.cpp
@@ -523,18 +523,7 @@ void *QOpenGLBuffer::map(QOpenGLBuffer::Access access)
#endif
if (!d->guard || !d->guard->id())
return 0;
-#if 0
- if (!glMapBufferARB)
- return 0;
- return glMapBufferARB(d->type, access);
-#endif
- Q_UNUSED(access);
- static bool warned = false;
- if (!warned) {
- qWarning("QOpenGLBuffer::map(): pending implementation");
- warned = true;
- }
- return 0;
+ return d->funcs->glMapBuffer(d->type, access);
}
/*!
@@ -559,17 +548,7 @@ bool QOpenGLBuffer::unmap()
#endif
if (!d->guard || !d->guard->id())
return false;
-#if 0
- if (!glUnmapBufferARB)
- return false;
- return glUnmapBufferARB(d->type) == GL_TRUE;
-#endif
- static bool warned = false;
- if (!warned) {
- qWarning("QOpenGLBuffer::map(): pending implementation");
- warned = true;
- }
- return 0;
+ return d->funcs->glUnmapBuffer(d->type) == GL_TRUE;
}
QT_END_NAMESPACE
diff --git a/src/gui/opengl/qopengltexturecache.cpp b/src/gui/opengl/qopengltexturecache.cpp
index e4d5ff974d..d514d714bd 100644
--- a/src/gui/opengl/qopengltexturecache.cpp
+++ b/src/gui/opengl/qopengltexturecache.cpp
@@ -42,7 +42,7 @@
#include "qopengltexturecache_p.h"
#include <private/qopenglcontext_p.h>
#include <private/qimagepixmapcleanuphooks_p.h>
-#include <qplatformpixmap_qpa.h>
+#include <qpa/qplatformpixmap.h>
QT_BEGIN_NAMESPACE
diff --git a/src/gui/painting/painting.pri b/src/gui/painting/painting.pri
index a8f6a5bf8f..7a20f35b33 100644
--- a/src/gui/painting/painting.pri
+++ b/src/gui/painting/painting.pri
@@ -33,7 +33,7 @@ HEADERS += \
painting/qstroker_p.h \
painting/qtextureglyphcache_p.h \
painting/qtransform.h \
- painting/qplatformbackingstore_qpa.h \
+ painting/qplatformbackingstore.h \
painting/qpaintbuffer_p.h \
painting/qpathsimplifier_p.h
diff --git a/src/gui/painting/qbackingstore.cpp b/src/gui/painting/qbackingstore.cpp
index 63f7ba594f..14694769a9 100644
--- a/src/gui/painting/qbackingstore.cpp
+++ b/src/gui/painting/qbackingstore.cpp
@@ -42,8 +42,8 @@
#include <qbackingstore.h>
#include <qwindow.h>
#include <qpixmap.h>
-#include <qplatformbackingstore_qpa.h>
-#include <qplatformintegration_qpa.h>
+#include <qpa/qplatformbackingstore.h>
+#include <qpa/qplatformintegration.h>
#include <qscreen.h>
#include <private/qguiapplication_p.h>
diff --git a/src/gui/painting/qbezier.cpp b/src/gui/painting/qbezier.cpp
index 57dc5710fa..1a1accc965 100644
--- a/src/gui/painting/qbezier.cpp
+++ b/src/gui/painting/qbezier.cpp
@@ -54,17 +54,6 @@ QT_BEGIN_NAMESPACE
//#define QDEBUG_BEZIER
-#ifdef FLOAT_ACCURACY
-#define INV_EPS (1L<<23)
-#else
-/* The value of 1.0 / (1L<<14) is enough for most applications */
-#define INV_EPS (1L<<14)
-#endif
-
-#ifndef M_SQRT2
-#define M_SQRT2 1.41421356237309504880
-#endif
-
/*!
\internal
*/
diff --git a/src/gui/painting/qplatformbackingstore_qpa.h b/src/gui/painting/qplatformbackingstore.h
index a4df63f4d4..a4df63f4d4 100644
--- a/src/gui/painting/qplatformbackingstore_qpa.h
+++ b/src/gui/painting/qplatformbackingstore.h
diff --git a/src/gui/painting/qplatformbackingstore_qpa.cpp b/src/gui/painting/qplatformbackingstore_qpa.cpp
index 485190d301..34cda00a6e 100644
--- a/src/gui/painting/qplatformbackingstore_qpa.cpp
+++ b/src/gui/painting/qplatformbackingstore_qpa.cpp
@@ -39,7 +39,7 @@
**
****************************************************************************/
-#include <qplatformbackingstore_qpa.h>
+#include "qplatformbackingstore.h"
#include <qwindow.h>
#include <qpixmap.h>
#include <private/qwindow_p.h>
diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp
index cd1556070e..f64b3e823d 100644
--- a/src/gui/text/qfont.cpp
+++ b/src/gui/text/qfont.cpp
@@ -62,7 +62,7 @@
#include <private/qtextengine_p.h>
#include <limits.h>
-#include <QtGui/qplatformscreen_qpa.h>
+#include <qpa/qplatformscreen.h>
#include <QtGui/private/qguiapplication_p.h>
#include <QtCore/QMutexLocker>
diff --git a/src/gui/text/qfont_qpa.cpp b/src/gui/text/qfont_qpa.cpp
index b73b03025b..8422409cb3 100644
--- a/src/gui/text/qfont_qpa.cpp
+++ b/src/gui/text/qfont_qpa.cpp
@@ -40,8 +40,8 @@
****************************************************************************/
#include <QtGui/private/qguiapplication_p.h>
-#include <QtGui/QPlatformIntegration>
-#include <QtGui/QPlatformFontDatabase>
+#include <qpa/qplatformintegration.h>
+#include <qpa/qplatformfontdatabase.h>
QT_BEGIN_NAMESPACE
diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp
index 42096d9ae7..b8e1e0cc3b 100644
--- a/src/gui/text/qfontdatabase.cpp
+++ b/src/gui/text/qfontdatabase.cpp
@@ -50,10 +50,10 @@
#include "qfileinfo.h"
#include "private/qunicodetables_p.h"
#include "qfontengine_p.h"
-#include "qplatformintegration_qpa.h"
+#include <qpa/qplatformintegration.h>
#include <QtGui/private/qguiapplication_p.h>
-#include <QtGui/qplatformfontdatabase_qpa.h>
+#include <qpa/qplatformfontdatabase.h>
#include <stdlib.h>
#include <limits.h>
diff --git a/src/gui/text/qfontdatabase_qpa.cpp b/src/gui/text/qfontdatabase_qpa.cpp
index c2a3aa9722..d7e5441931 100644
--- a/src/gui/text/qfontdatabase_qpa.cpp
+++ b/src/gui/text/qfontdatabase_qpa.cpp
@@ -46,7 +46,7 @@
#include "qplatformdefs.h"
#include <QtGui/private/qguiapplication_p.h>
-#include <QtGui/qplatformfontdatabase_qpa.h>
+#include <qpa/qplatformfontdatabase.h>
#include <QtCore/qmath.h>
diff --git a/src/gui/text/qfontengine_qpa.cpp b/src/gui/text/qfontengine_qpa.cpp
index bf0cfd1404..dcb0a4f8d1 100644
--- a/src/gui/text/qfontengine_qpa.cpp
+++ b/src/gui/text/qfontengine_qpa.cpp
@@ -48,8 +48,8 @@
#include <QtGui/private/qpaintengine_raster_p.h>
#include <QtGui/private/qguiapplication_p.h>
-#include <QtGui/QPlatformFontDatabase>
-#include <QtGui/QPlatformIntegration>
+#include <qpa/qplatformfontdatabase.h>
+#include <qpa/qplatformintegration.h>
QT_BEGIN_NAMESPACE
diff --git a/src/gui/text/qplatformfontdatabase_qpa.h b/src/gui/text/qplatformfontdatabase.h
index 08faf8d84f..08faf8d84f 100644
--- a/src/gui/text/qplatformfontdatabase_qpa.h
+++ b/src/gui/text/qplatformfontdatabase.h
diff --git a/src/gui/text/qplatformfontdatabase_qpa.cpp b/src/gui/text/qplatformfontdatabase_qpa.cpp
index 632d2d89d9..3531202eff 100644
--- a/src/gui/text/qplatformfontdatabase_qpa.cpp
+++ b/src/gui/text/qplatformfontdatabase_qpa.cpp
@@ -39,7 +39,7 @@
**
****************************************************************************/
-#include "qplatformfontdatabase_qpa.h"
+#include "qplatformfontdatabase.h"
#include <QtGui/private/qfontengine_p.h>
#include <QtGui/private/qfontengine_qpa_p.h>
#include <QtCore/QLibraryInfo>
diff --git a/src/gui/text/qrawfont_qpa.cpp b/src/gui/text/qrawfont_qpa.cpp
index d037d5902d..7289450e7f 100644
--- a/src/gui/text/qrawfont_qpa.cpp
+++ b/src/gui/text/qrawfont_qpa.cpp
@@ -44,8 +44,8 @@
#if !defined(QT_NO_RAWFONT)
#include "qrawfont_p.h"
-#include "qplatformintegration_qpa.h"
-#include <QtGui/qplatformfontdatabase_qpa.h>
+#include <qpa/qplatformintegration.h>
+#include <qpa/qplatformfontdatabase.h>
#include <private/qguiapplication_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp
index 9848898d66..20f85d02aa 100644
--- a/src/gui/text/qtextengine.cpp
+++ b/src/gui/text/qtextengine.cpp
@@ -1008,11 +1008,11 @@ void QTextEngine::shapeTextWithHarfbuzz(int item) const
entire_shaper_item.item.length = length(item);
entire_shaper_item.item.bidiLevel = si.analysis.bidiLevel;
- HB_UChar16 upperCased[256]; // XXX what about making this 4096, so we don't have to extend it ever.
+ QVarLengthArray<HB_UChar16, 256> casedString;
if (hasCaseChange(si)) {
- HB_UChar16 *uc = upperCased;
- if (entire_shaper_item.item.length > 256)
- uc = new HB_UChar16[entire_shaper_item.item.length];
+ if (casedString.size() < entire_shaper_item.item.length)
+ casedString.resize(entire_shaper_item.item.length);
+ HB_UChar16 *uc = casedString.data();
for (uint i = 0; i < entire_shaper_item.item.length; ++i) {
if(si.analysis.flags == QScriptAnalysis::Lowercase)
uc[i] = QChar::toLower(entire_shaper_item.string[si.position + i]);
@@ -1031,25 +1031,16 @@ void QTextEngine::shapeTextWithHarfbuzz(int item) const
entire_shaper_item.shaperFlags |= HB_ShaperFlag_UseDesignMetrics;
entire_shaper_item.num_glyphs = qMax(layoutData->glyphLayout.numGlyphs - layoutData->used, int(entire_shaper_item.item.length));
- if (! ensureSpace(entire_shaper_item.num_glyphs)) {
- if (hasCaseChange(si))
- delete [] const_cast<HB_UChar16 *>(entire_shaper_item.string);
+ if (!ensureSpace(entire_shaper_item.num_glyphs))
return;
- }
QGlyphLayout initialGlyphs = availableGlyphs(&si).mid(0, entire_shaper_item.num_glyphs);
if (!stringToGlyphs(&entire_shaper_item, &initialGlyphs, font)) {
- if (! ensureSpace(entire_shaper_item.num_glyphs)) {
- if (hasCaseChange(si))
- delete [] const_cast<HB_UChar16 *>(entire_shaper_item.string);
+ if (!ensureSpace(entire_shaper_item.num_glyphs))
return;
- }
initialGlyphs = availableGlyphs(&si).mid(0, entire_shaper_item.num_glyphs);
-
if (!stringToGlyphs(&entire_shaper_item, &initialGlyphs, font)) {
// ############ if this happens there's a bug in the fontengine
- if (hasCaseChange(si) && entire_shaper_item.string != upperCased)
- delete [] const_cast<HB_UChar16 *>(entire_shaper_item.string);
return;
}
}
@@ -1119,11 +1110,8 @@ void QTextEngine::shapeTextWithHarfbuzz(int item) const
remaining_glyphs -= shaper_item.initialGlyphCount;
do {
- if (! ensureSpace(glyph_pos + shaper_item.num_glyphs + remaining_glyphs)) {
- if (hasCaseChange(si))
- delete [] const_cast<HB_UChar16 *>(entire_shaper_item.string);
+ if (!ensureSpace(glyph_pos + shaper_item.num_glyphs + remaining_glyphs))
return;
- }
const QGlyphLayout g = availableGlyphs(&si).mid(glyph_pos);
if (shaper_item.num_glyphs > shaper_item.item.length)
@@ -1163,9 +1151,6 @@ void QTextEngine::shapeTextWithHarfbuzz(int item) const
si.num_glyphs = glyph_pos;
layoutData->used += si.num_glyphs;
-
- if (hasCaseChange(si) && entire_shaper_item.string != upperCased)
- delete [] const_cast<HB_UChar16 *>(entire_shaper_item.string);
}
static void init(QTextEngine *e)
@@ -1414,12 +1399,14 @@ void QTextEngine::itemize() const
s = 0;
}
Q_ASSERT(position <= length);
- itemizer.generate(prevPosition, position - prevPosition,
- formats()->charFormat(format).fontCapitalization());
+ QFont::Capitalization capitalization =
+ formats()->charFormat(format).hasProperty(QTextFormat::FontCapitalization)
+ ? formats()->charFormat(format).fontCapitalization()
+ : formats()->defaultFont().capitalization();
+ itemizer.generate(prevPosition, position - prevPosition, capitalization);
if (it == end) {
if (position < length)
- itemizer.generate(position, length - position,
- formats()->charFormat(format).fontCapitalization());
+ itemizer.generate(position, length - position, capitalization);
break;
}
format = frag->format;
diff --git a/src/gui/text/qtextengine_p.h b/src/gui/text/qtextengine_p.h
index aac2390943..4d9a49c15b 100644
--- a/src/gui/text/qtextengine_p.h
+++ b/src/gui/text/qtextengine_p.h
@@ -339,14 +339,6 @@ public:
QFontEngine *fontEngine;
};
-inline bool qIsControlChar(ushort uc)
-{
- return uc >= 0x200b && uc <= 0x206f
- && (uc <= 0x200f /* ZW Space, ZWNJ, ZWJ, LRM and RLM */
- || (uc >= 0x2028 && uc <= 0x202f /* LS, PS, LRE, RLE, PDF, LRO, RLO, NNBSP */)
- || uc >= 0x206a /* ISS, ASS, IAFS, AFS, NADS, NODS */);
-}
-
struct Q_AUTOTEST_EXPORT QScriptItem
{
inline QScriptItem()
diff --git a/src/gui/text/text.pri b/src/gui/text/text.pri
index 6587769712..d0dd0ed129 100644
--- a/src/gui/text/text.pri
+++ b/src/gui/text/text.pri
@@ -102,7 +102,7 @@ SOURCES += \
text/qrawfont_qpa.cpp
HEADERS += \
- text/qplatformfontdatabase_qpa.h
+ text/qplatformfontdatabase.h
DEFINES += QT_NO_OPENTYPE
INCLUDEPATH += ../3rdparty/harfbuzz/src
diff --git a/src/gui/util/qdesktopservices.cpp b/src/gui/util/qdesktopservices.cpp
index 1535162735..5e83e7cc00 100644
--- a/src/gui/util/qdesktopservices.cpp
+++ b/src/gui/util/qdesktopservices.cpp
@@ -52,8 +52,8 @@
#include <private/qguiapplication_p.h>
#include <qurl.h>
#include <qmutex.h>
-#include <qplatformservices_qpa.h>
-#include <qplatformintegration_qpa.h>
+#include <qpa/qplatformservices.h>
+#include <qpa/qplatformintegration.h>
#include <qdir.h>
QT_BEGIN_NAMESPACE
diff --git a/src/network/access/qnetworkreplyhttpimpl.cpp b/src/network/access/qnetworkreplyhttpimpl.cpp
index 54868836b6..c9ec287c2c 100644
--- a/src/network/access/qnetworkreplyhttpimpl.cpp
+++ b/src/network/access/qnetworkreplyhttpimpl.cpp
@@ -1569,7 +1569,7 @@ void QNetworkReplyHttpImplPrivate::_q_startOperation()
if (session) {
QObject::connect(session, SIGNAL(error(QNetworkSession::SessionError)),
- q, SLOT(_q_networkSessionFailed()));
+ q, SLOT(_q_networkSessionFailed()), Qt::QueuedConnection);
if (!session->isOpen()) {
session->setSessionProperty(QStringLiteral("ConnectInBackground"), isBackground);
diff --git a/src/network/bearer/qnetworkconfigmanager_p.cpp b/src/network/bearer/qnetworkconfigmanager_p.cpp
index d152adca92..ce04934865 100644
--- a/src/network/bearer/qnetworkconfigmanager_p.cpp
+++ b/src/network/bearer/qnetworkconfigmanager_p.cpp
@@ -366,6 +366,10 @@ void QNetworkConfigurationManagerPrivate::configurationChanged(QNetworkConfigura
void QNetworkConfigurationManagerPrivate::updateConfigurations()
{
+#ifndef QT_NO_LIBRARY
+ typedef QMultiMap<int, QString> PluginKeyMap;
+ typedef PluginKeyMap::const_iterator PluginKeyMapConstIterator;
+#endif
QMutexLocker locker(&mutex);
if (firstUpdate) {
@@ -376,15 +380,12 @@ void QNetworkConfigurationManagerPrivate::updateConfigurations()
#ifndef QT_NO_LIBRARY
QBearerEngine *generic = 0;
-
QFactoryLoader *l = loader();
- foreach (const QString &key, l->keys()) {
- QBearerEnginePlugin *plugin = qobject_cast<QBearerEnginePlugin *>(l->instance(key));
- if (plugin) {
- QBearerEngine *engine = plugin->create(key);
- if (!engine)
- continue;
-
+ const PluginKeyMap keyMap = l->keyMap();
+ const PluginKeyMapConstIterator cend = keyMap.constEnd();
+ for (PluginKeyMapConstIterator it = keyMap.constBegin(); it != cend; ++it) {
+ const QString &key = it.value();
+ if (QBearerEngine *engine = qLoadPlugin<QBearerEngine, QBearerEnginePlugin>(l, key)) {
if (key == QLatin1String("generic"))
generic = engine;
else
@@ -393,13 +394,17 @@ void QNetworkConfigurationManagerPrivate::updateConfigurations()
engine->moveToThread(bearerThread);
connect(engine, SIGNAL(updateCompleted()),
- this, SLOT(updateConfigurations()));
+ this, SLOT(updateConfigurations()),
+ Qt::QueuedConnection);
connect(engine, SIGNAL(configurationAdded(QNetworkConfigurationPrivatePointer)),
- this, SLOT(configurationAdded(QNetworkConfigurationPrivatePointer)));
+ this, SLOT(configurationAdded(QNetworkConfigurationPrivatePointer)),
+ Qt::QueuedConnection);
connect(engine, SIGNAL(configurationRemoved(QNetworkConfigurationPrivatePointer)),
- this, SLOT(configurationRemoved(QNetworkConfigurationPrivatePointer)));
+ this, SLOT(configurationRemoved(QNetworkConfigurationPrivatePointer)),
+ Qt::QueuedConnection);
connect(engine, SIGNAL(configurationChanged(QNetworkConfigurationPrivatePointer)),
- this, SLOT(configurationChanged(QNetworkConfigurationPrivatePointer)));
+ this, SLOT(configurationChanged(QNetworkConfigurationPrivatePointer)),
+ Qt::QueuedConnection);
}
}
diff --git a/src/network/bearer/qnetworksession.cpp b/src/network/bearer/qnetworksession.cpp
index 83e0dc18ac..ee21dffc94 100644
--- a/src/network/bearer/qnetworksession.cpp
+++ b/src/network/bearer/qnetworksession.cpp
@@ -150,7 +150,7 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \enum QNetworkSession::UsagePolicies
+ \enum QNetworkSession::UsagePolicy
\since 5.0
These flags allow the system to inform the application of network usage restrictions that
diff --git a/src/network/kernel/qauthenticator.cpp b/src/network/kernel/qauthenticator.cpp
index 43b3618ea2..6808ae51ca 100644
--- a/src/network/kernel/qauthenticator.cpp
+++ b/src/network/kernel/qauthenticator.cpp
@@ -140,7 +140,7 @@ QAuthenticator::QAuthenticator()
*/
QAuthenticator::~QAuthenticator()
{
- if (d && !d->ref.deref())
+ if (d)
delete d;
}
@@ -148,10 +148,10 @@ QAuthenticator::~QAuthenticator()
Constructs a copy of \a other.
*/
QAuthenticator::QAuthenticator(const QAuthenticator &other)
- : d(other.d)
+ : d(0)
{
- if (d)
- d->ref.ref();
+ if (other.d)
+ *this = other;
}
/*!
@@ -162,12 +162,23 @@ QAuthenticator &QAuthenticator::operator=(const QAuthenticator &other)
if (d == other.d)
return *this;
- if (d && !d->ref.deref())
+ // Do not share the d since challange reponse/based changes
+ // could corrupt the internal store and different network requests
+ // can utilize different types of proxies.
+ detach();
+ if (other.d) {
+ d->user = other.d->user;
+ d->userDomain = other.d->userDomain;
+ d->workstation = other.d->workstation;
+ d->extractedUser = other.d->extractedUser;
+ d->password = other.d->password;
+ d->realm = other.d->realm;
+ d->method = other.d->method;
+ d->options = other.d->options;
+ } else {
delete d;
-
- d = other.d;
- if (d)
- d->ref.ref();
+ d = 0;
+ }
return *this;
}
@@ -209,28 +220,8 @@ QString QAuthenticator::user() const
void QAuthenticator::setUser(const QString &user)
{
detach();
- int separatorPosn = 0;
-
- switch(d->method) {
- case QAuthenticatorPrivate::Ntlm:
- if((separatorPosn = user.indexOf(QLatin1String("\\"))) != -1) {
- //domain name is present
- d->realm.clear();
- d->userDomain = user.left(separatorPosn);
- d->extractedUser = user.mid(separatorPosn + 1);
- d->user = user;
- } else {
- d->extractedUser = user;
- d->user = user;
- d->realm.clear();
- d->userDomain.clear();
- }
- break;
- default:
- d->user = user;
- d->userDomain.clear();
- break;
- }
+ d->user = user;
+ d->updateCredentials();
}
/*!
@@ -259,11 +250,9 @@ void QAuthenticator::detach()
{
if (!d) {
d = new QAuthenticatorPrivate;
- d->ref.store(1);
return;
}
- qAtomicDetach(d);
d->phase = QAuthenticatorPrivate::Start;
}
@@ -325,8 +314,7 @@ bool QAuthenticator::isNull() const
}
QAuthenticatorPrivate::QAuthenticatorPrivate()
- : ref(0)
- , method(None)
+ : method(None)
, hasFailed(false)
, phase(Start)
, nonceCount(0)
@@ -336,6 +324,33 @@ QAuthenticatorPrivate::QAuthenticatorPrivate()
nonceCount = 0;
}
+QAuthenticatorPrivate::~QAuthenticatorPrivate()
+{
+}
+
+void QAuthenticatorPrivate::updateCredentials()
+{
+ int separatorPosn = 0;
+
+ switch (method) {
+ case QAuthenticatorPrivate::Ntlm:
+ if ((separatorPosn = user.indexOf(QLatin1String("\\"))) != -1) {
+ //domain name is present
+ realm.clear();
+ userDomain = user.left(separatorPosn);
+ extractedUser = user.mid(separatorPosn + 1);
+ } else {
+ extractedUser = user;
+ realm.clear();
+ userDomain.clear();
+ }
+ break;
+ default:
+ userDomain.clear();
+ break;
+ }
+}
+
void QAuthenticatorPrivate::parseHttpResponse(const QList<QPair<QByteArray, QByteArray> > &values, bool isProxy)
{
const char *search = isProxy ? "proxy-authenticate" : "www-authenticate";
@@ -369,6 +384,8 @@ void QAuthenticatorPrivate::parseHttpResponse(const QList<QPair<QByteArray, QByt
}
}
+ // Reparse credentials since we know the method now
+ updateCredentials();
challenge = headerVal.trimmed();
QHash<QByteArray, QByteArray> options = parseDigestAuthenticationChallenge(challenge);
diff --git a/src/network/kernel/qauthenticator_p.h b/src/network/kernel/qauthenticator_p.h
index a41b31d333..b96c8c13e1 100644
--- a/src/network/kernel/qauthenticator_p.h
+++ b/src/network/kernel/qauthenticator_p.h
@@ -68,8 +68,8 @@ class Q_AUTOTEST_EXPORT QAuthenticatorPrivate
public:
enum Method { None, Basic, Plain, Login, Ntlm, CramMd5, DigestMd5 };
QAuthenticatorPrivate();
+ ~QAuthenticatorPrivate();
- QAtomicInt ref;
QString user;
QString extractedUser;
QString password;
@@ -104,7 +104,7 @@ public:
static QHash<QByteArray, QByteArray> parseDigestAuthenticationChallenge(const QByteArray &challenge);
void parseHttpResponse(const QList<QPair<QByteArray, QByteArray> >&, bool isProxy);
-
+ void updateCredentials();
};
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index 2801d241ee..263aa639a7 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -55,13 +55,13 @@
#include "gl2paintengineex/qpaintengineex_opengl2_p.h"
-#include <QtGui/QPlatformOpenGLContext>
+#include <qpa/qplatformopenglcontext.h>
#include <qglpixelbuffer.h>
#include <qglframebufferobject.h>
#include <private/qimage_p.h>
-#include <qplatformpixmap_qpa.h>
+#include <qpa/qplatformpixmap.h>
#include <private/qglpixelbuffer_p.h>
#include <private/qimagepixmapcleanuphooks_p.h>
#include "qcolormap.h"
diff --git a/src/opengl/qgl_qpa.cpp b/src/opengl/qgl_qpa.cpp
index 8810b70f08..05c0d9fe39 100644
--- a/src/opengl/qgl_qpa.cpp
+++ b/src/opengl/qgl_qpa.cpp
@@ -45,8 +45,8 @@
#include <QDebug>
#include <private/qapplication_p.h>
-#include <QtGui/QPlatformOpenGLContext>
-#include <QtGui/QPlatformWindow>
+#include <qpa/qplatformopenglcontext.h>
+#include <qpa/qplatformwindow.h>
#include <QtGui/QSurfaceFormat>
#include "qgl.h"
diff --git a/src/platformsupport/dnd/qsimpledrag_p.h b/src/platformsupport/dnd/qsimpledrag_p.h
index 7270684082..fa87f09d06 100644
--- a/src/platformsupport/dnd/qsimpledrag_p.h
+++ b/src/platformsupport/dnd/qsimpledrag_p.h
@@ -42,7 +42,7 @@
#ifndef QSIMPLEDRAG_H
#define QSIMPLEDRAG_H
-#include <qplatformdrag_qpa.h>
+#include <qpa/qplatformdrag.h>
#include <QtCore/QObject>
diff --git a/src/platformsupport/eglconvenience/qeglplatformcontext.cpp b/src/platformsupport/eglconvenience/qeglplatformcontext.cpp
index 71e18203fb..97b4571dbf 100644
--- a/src/platformsupport/eglconvenience/qeglplatformcontext.cpp
+++ b/src/platformsupport/eglconvenience/qeglplatformcontext.cpp
@@ -43,7 +43,7 @@
#include "qeglconvenience_p.h"
-#include <QtGui/QPlatformWindow>
+#include <qpa/qplatformwindow.h>
#include <EGL/egl.h>
diff --git a/src/platformsupport/eglconvenience/qeglplatformcontext_p.h b/src/platformsupport/eglconvenience/qeglplatformcontext_p.h
index 75375fa781..d48d49a696 100644
--- a/src/platformsupport/eglconvenience/qeglplatformcontext_p.h
+++ b/src/platformsupport/eglconvenience/qeglplatformcontext_p.h
@@ -42,8 +42,8 @@
#ifndef QEGLPLATFORMCONTEXT_H
#define QEGLPLATFORMCONTEXT_H
-#include <QtGui/QPlatformWindow>
-#include <QtGui/QPlatformOpenGLContext>
+#include <qpa/qplatformwindow.h>
+#include <qpa/qplatformopenglcontext.h>
#include <EGL/egl.h>
class QEGLPlatformContext : public QPlatformOpenGLContext
diff --git a/src/platformsupport/fb_base/fb_base.cpp b/src/platformsupport/fb_base/fb_base.cpp
index 0cdd091df2..516274962d 100644
--- a/src/platformsupport/fb_base/fb_base.cpp
+++ b/src/platformsupport/fb_base/fb_base.cpp
@@ -43,7 +43,7 @@
#include <qpainter.h>
#include <qdebug.h>
#include <qbitmap.h>
-#include <QPlatformCursor>
+#include <qpa/qplatformcursor.h>
#include <QWindowSystemInterface>
QPlatformSoftwareCursor::QPlatformSoftwareCursor(QPlatformScreen *scr)
diff --git a/src/platformsupport/fb_base/fb_base_p.h b/src/platformsupport/fb_base/fb_base_p.h
index c9862c6c58..187ae961bf 100644
--- a/src/platformsupport/fb_base/fb_base_p.h
+++ b/src/platformsupport/fb_base/fb_base_p.h
@@ -46,9 +46,9 @@
#include <qimage.h>
#include <qtimer.h>
#include <qpainter.h>
-#include <QPlatformCursor>
-#include <QPlatformScreen>
-#include <QPlatformWindow>
+#include <qpa/qplatformcursor.h>
+#include <qpa/qplatformscreen.h>
+#include <qpa/qplatformwindow.h>
#include <QtGui/private/qwindowsurface_p.h>
class QMouseEvent;
diff --git a/src/platformsupport/fontdatabases/basic/qbasicfontdatabase.cpp b/src/platformsupport/fontdatabases/basic/qbasicfontdatabase.cpp
index cddc08c750..e96659d4f6 100644
--- a/src/platformsupport/fontdatabases/basic/qbasicfontdatabase.cpp
+++ b/src/platformsupport/fontdatabases/basic/qbasicfontdatabase.cpp
@@ -42,7 +42,7 @@
#include "qbasicfontdatabase_p.h"
#include <QtGui/private/qguiapplication_p.h>
-#include <QtGui/QPlatformScreen>
+#include <qpa/qplatformscreen.h>
#include <QtCore/QFile>
#include <QtCore/QLibraryInfo>
diff --git a/src/platformsupport/fontdatabases/basic/qbasicfontdatabase_p.h b/src/platformsupport/fontdatabases/basic/qbasicfontdatabase_p.h
index fd6e180c75..eb4b11ca97 100644
--- a/src/platformsupport/fontdatabases/basic/qbasicfontdatabase_p.h
+++ b/src/platformsupport/fontdatabases/basic/qbasicfontdatabase_p.h
@@ -42,7 +42,7 @@
#ifndef QBASICFONTDATABASE_H
#define QBASICFONTDATABASE_H
-#include <QPlatformFontDatabase>
+#include <qpa/qplatformfontdatabase.h>
#include <QtCore/QByteArray>
#include <QtCore/QString>
diff --git a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp
index 9ad9b96d15..d995ffbbad 100644
--- a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp
+++ b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp
@@ -47,7 +47,7 @@
#include <QtCore/QElapsedTimer>
-#include <QtGui/QPlatformScreen>
+#include <qpa/qplatformscreen.h>
#include <QtGui/private/qfontengine_ft_p.h>
#include <QtGui/private/qfontengine_p.h>
diff --git a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase_p.h b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase_p.h
index df62ddeb0b..9859bd7082 100644
--- a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase_p.h
+++ b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase_p.h
@@ -42,7 +42,7 @@
#ifndef QFONTCONFIGDATABASE_H
#define QFONTCONFIGDATABASE_H
-#include <QPlatformFontDatabase>
+#include <qpa/qplatformfontdatabase.h>
#include <QtPlatformSupport/private/qbasicfontdatabase_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h
index 01aed89d47..e38e01d25d 100644
--- a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h
+++ b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h
@@ -42,7 +42,7 @@
#ifndef QCORETEXTFONTDATABASE_H
#define QCORETEXTFONTDATABASE_H
-#include <QPlatformFontDatabase>
+#include <qpa/qplatformfontdatabase.h>
QT_BEGIN_NAMESPACE
diff --git a/src/platformsupport/inputcontext/inputcontext.pri b/src/platformsupport/inputcontext/inputcontext.pri
index e1a44684ba..8debcd0129 100644
--- a/src/platformsupport/inputcontext/inputcontext.pri
+++ b/src/platformsupport/inputcontext/inputcontext.pri
@@ -1,6 +1,6 @@
HEADERS += \
- $$PWD/qplatforminputcontextplugin_qpa_p.h \
- $$PWD/qplatforminputcontextfactory_qpa_p.h
+ $$PWD/qplatforminputcontextplugin_p.h \
+ $$PWD/qplatforminputcontextfactory_p.h
SOURCES += \
$$PWD/qplatforminputcontextplugin_qpa.cpp \
$$PWD/qplatforminputcontextfactory_qpa.cpp
diff --git a/src/platformsupport/inputcontext/qplatforminputcontextfactory_qpa_p.h b/src/platformsupport/inputcontext/qplatforminputcontextfactory_p.h
index a7ed2ebfb3..a7ed2ebfb3 100644
--- a/src/platformsupport/inputcontext/qplatforminputcontextfactory_qpa_p.h
+++ b/src/platformsupport/inputcontext/qplatforminputcontextfactory_p.h
diff --git a/src/platformsupport/inputcontext/qplatforminputcontextfactory_qpa.cpp b/src/platformsupport/inputcontext/qplatforminputcontextfactory_qpa.cpp
index ca3673f670..6d909426a8 100644
--- a/src/platformsupport/inputcontext/qplatforminputcontextfactory_qpa.cpp
+++ b/src/platformsupport/inputcontext/qplatforminputcontextfactory_qpa.cpp
@@ -39,9 +39,9 @@
**
****************************************************************************/
-#include "qplatforminputcontextfactory_qpa_p.h"
-#include "qplatforminputcontextplugin_qpa_p.h"
-#include <QPlatformInputContext>
+#include <qpa/qplatforminputcontextfactory_p.h>
+#include <qpa/qplatforminputcontextplugin_p.h>
+#include <qpa/qplatforminputcontext.h>
#include "private/qfactoryloader_p.h"
#include "qguiapplication.h"
diff --git a/src/platformsupport/inputcontext/qplatforminputcontextplugin_qpa_p.h b/src/platformsupport/inputcontext/qplatforminputcontextplugin_p.h
index e9e419546b..e9e419546b 100644
--- a/src/platformsupport/inputcontext/qplatforminputcontextplugin_qpa_p.h
+++ b/src/platformsupport/inputcontext/qplatforminputcontextplugin_p.h
diff --git a/src/platformsupport/inputcontext/qplatforminputcontextplugin_qpa.cpp b/src/platformsupport/inputcontext/qplatforminputcontextplugin_qpa.cpp
index 88cd9cdf67..670bfd0de5 100644
--- a/src/platformsupport/inputcontext/qplatforminputcontextplugin_qpa.cpp
+++ b/src/platformsupport/inputcontext/qplatforminputcontextplugin_qpa.cpp
@@ -39,7 +39,7 @@
**
****************************************************************************/
-#include "qplatforminputcontextplugin_qpa_p.h"
+#include "qplatforminputcontextplugin_p.h"
QT_BEGIN_NAMESPACE
diff --git a/src/platformsupport/printersupport/genericunix/qgenericunixprintersupport_p.h b/src/platformsupport/printersupport/genericunix/qgenericunixprintersupport_p.h
index 369e8274fd..d6b2d0d080 100644
--- a/src/platformsupport/printersupport/genericunix/qgenericunixprintersupport_p.h
+++ b/src/platformsupport/printersupport/genericunix/qgenericunixprintersupport_p.h
@@ -42,7 +42,7 @@
#ifndef QGENERICUNIXPRINTINGSUPPORT_H
#define QGENERICUNIXPRINTINGSUPPORT_H
-#include <QtPrintSupport/QPlatformPrinterSupport>
+#include <qpa/qplatformprintersupport.h>
QT_BEGIN_NAMESPACE
diff --git a/src/platformsupport/services/genericunix/qgenericunixservices_p.h b/src/platformsupport/services/genericunix/qgenericunixservices_p.h
index 3923a45f89..b0dbccc099 100644
--- a/src/platformsupport/services/genericunix/qgenericunixservices_p.h
+++ b/src/platformsupport/services/genericunix/qgenericunixservices_p.h
@@ -42,7 +42,7 @@
#ifndef QGENERICUNIXDESKTOPSERVICES_H
#define QGENERICUNIXDESKTOPSERVICES_H
-#include <QtGui/qplatformservices_qpa.h>
+#include <qpa/qplatformservices.h>
#include <QtCore/QString>
QT_BEGIN_HEADER
diff --git a/src/platformsupport/themes/genericunix/qgenericunixthemes_p.h b/src/platformsupport/themes/genericunix/qgenericunixthemes_p.h
index cabffc0212..a1b50865ed 100644
--- a/src/platformsupport/themes/genericunix/qgenericunixthemes_p.h
+++ b/src/platformsupport/themes/genericunix/qgenericunixthemes_p.h
@@ -42,7 +42,7 @@
#ifndef QGENERICUNIXTHEMES_H
#define QGENERICUNIXTHEMES_H
-#include <QtGui/QPlatformTheme>
+#include <qpa/qplatformtheme.h>
#include <QtCore/QString>
#include <QtCore/QStringList>
diff --git a/src/plugins/generic/evdevtouch/qevdevtouch.cpp b/src/plugins/generic/evdevtouch/qevdevtouch.cpp
index 327f64412a..01007b74dd 100644
--- a/src/plugins/generic/evdevtouch/qevdevtouch.cpp
+++ b/src/plugins/generic/evdevtouch/qevdevtouch.cpp
@@ -474,11 +474,11 @@ void QTouchScreenData::reportPoints()
// Generate a screen position that is always inside the active window
// or the primary screen.
- const int wx = winRect.left() + int(tp.normalPosition.x() * winRect.width());
- const int wy = winRect.top() + int(tp.normalPosition.y() * winRect.height());
+ const qreal wx = winRect.left() + tp.normalPosition.x() * winRect.width();
+ const qreal wy = winRect.top() + tp.normalPosition.y() * winRect.height();
const qreal sizeRatio = (winRect.width() + winRect.height()) / qreal(hw_w + hw_h);
- tp.area = QRect(0, 0, tp.area.width() * sizeRatio, tp.area.height() * sizeRatio);
- tp.area.moveCenter(QPoint(wx, wy));
+ tp.area = QRectF(0, 0, tp.area.width() * sizeRatio, tp.area.height() * sizeRatio);
+ tp.area.moveCenter(QPointF(wx, wy));
// Calculate normalized pressure.
if (!hw_pressure_min && !hw_pressure_max)
diff --git a/src/plugins/platforminputcontexts/ibus/ibus.pro b/src/plugins/platforminputcontexts/ibus/ibus.pro
index 12419343fa..0fb92f23a8 100644
--- a/src/plugins/platforminputcontexts/ibus/ibus.pro
+++ b/src/plugins/platforminputcontexts/ibus/ibus.pro
@@ -3,7 +3,7 @@ load(qt_plugin)
QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/platforminputcontexts
-QT += dbus platformsupport-private
+QT += dbus platformsupport-private gui-private
SOURCES += $$PWD/qibusplatforminputcontext.cpp \
$$PWD/qibusproxy.cpp \
$$PWD/qibusinputcontextproxy.cpp \
diff --git a/src/plugins/platforminputcontexts/ibus/main.cpp b/src/plugins/platforminputcontexts/ibus/main.cpp
index 19f032b7df..d841426ea7 100644
--- a/src/plugins/platforminputcontexts/ibus/main.cpp
+++ b/src/plugins/platforminputcontexts/ibus/main.cpp
@@ -39,7 +39,7 @@
**
****************************************************************************/
-#include <private/qplatforminputcontextplugin_qpa_p.h>
+#include <qpa/qplatforminputcontextplugin_p.h>
#include <QtCore/QStringList>
#include "qibusplatforminputcontext.h"
diff --git a/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.h b/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.h
index 1ed4262ef6..4d9f42e8d0 100644
--- a/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.h
+++ b/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.h
@@ -41,7 +41,7 @@
#ifndef QIBUSPLATFORMINPUTCONTEXT_H
#define QIBUSPLATFORMINPUTCONTEXT_H
-#include <QPlatformInputContext>
+#include <qpa/qplatforminputcontext.h>
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/platforminputcontexts/maliit/main.cpp b/src/plugins/platforminputcontexts/maliit/main.cpp
index 2552cc0aa6..adeaa7bb31 100644
--- a/src/plugins/platforminputcontexts/maliit/main.cpp
+++ b/src/plugins/platforminputcontexts/maliit/main.cpp
@@ -39,7 +39,7 @@
**
****************************************************************************/
-#include <private/qplatforminputcontextplugin_qpa_p.h>
+#include <qpa/qplatforminputcontextplugin_p.h>
#include <QtCore/QStringList>
#include "qmaliitplatforminputcontext.h"
diff --git a/src/plugins/platforminputcontexts/maliit/maliit.pro b/src/plugins/platforminputcontexts/maliit/maliit.pro
index 445e172637..dbcd22efcb 100644
--- a/src/plugins/platforminputcontexts/maliit/maliit.pro
+++ b/src/plugins/platforminputcontexts/maliit/maliit.pro
@@ -3,7 +3,7 @@ load(qt_plugin)
QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/platforminputcontexts
-QT += dbus platformsupport-private
+QT += dbus platformsupport-private gui-private
SOURCES += $$PWD/qmaliitplatforminputcontext.cpp \
$$PWD/serverproxy.cpp \
$$PWD/serveraddressproxy.cpp \
diff --git a/src/plugins/platforminputcontexts/maliit/qmaliitplatforminputcontext.h b/src/plugins/platforminputcontexts/maliit/qmaliitplatforminputcontext.h
index 2612524619..cb32feed61 100644
--- a/src/plugins/platforminputcontexts/maliit/qmaliitplatforminputcontext.h
+++ b/src/plugins/platforminputcontexts/maliit/qmaliitplatforminputcontext.h
@@ -41,7 +41,7 @@
#ifndef QMALIITPLATFORMINPUTCONTEXT_H
#define QMALIITPLATFORMINPUTCONTEXT_H
-#include <QPlatformInputContext>
+#include <qpa/qplatforminputcontext.h>
#include <QDBusArgument>
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/platforms/cocoa/cocoa.pro b/src/plugins/platforms/cocoa/cocoa.pro
index f149a6775b..ccd98c5b3c 100644
--- a/src/plugins/platforms/cocoa/cocoa.pro
+++ b/src/plugins/platforms/cocoa/cocoa.pro
@@ -77,7 +77,7 @@ RESOURCES += qcocoaresources.qrc
LIBS += -framework Cocoa -framework IOKit
-QT += core-private gui-private widgets-private platformsupport-private printsupport
+QT += core-private gui-private widgets-private platformsupport-private printsupport-private
OTHER_FILES += cocoa.json
target.path += $$[QT_INSTALL_PLUGINS]/platforms
diff --git a/src/plugins/platforms/cocoa/main.mm b/src/plugins/platforms/cocoa/main.mm
index 9857a4e177..fc17bd3fe2 100644
--- a/src/plugins/platforms/cocoa/main.mm
+++ b/src/plugins/platforms/cocoa/main.mm
@@ -41,8 +41,8 @@
#include <Cocoa/Cocoa.h>
-#include <QtGui/QPlatformIntegrationPlugin>
-#include <QtGui/QPlatformThemePlugin>
+#include <qpa/qplatformintegrationplugin.h>
+#include <qpa/qplatformthemeplugin.h>
#include "qcocoaintegration.h"
#include "qcocoatheme.h"
diff --git a/src/plugins/platforms/cocoa/qcocoabackingstore.h b/src/plugins/platforms/cocoa/qcocoabackingstore.h
index 72bb5936c0..36fb4b42ff 100644
--- a/src/plugins/platforms/cocoa/qcocoabackingstore.h
+++ b/src/plugins/platforms/cocoa/qcocoabackingstore.h
@@ -47,7 +47,7 @@
#include "qcocoawindow.h"
#include "qnsview.h"
-#include <QPlatformBackingStore>
+#include <qpa/qplatformbackingstore.h>
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/platforms/cocoa/qcocoaclipboard.h b/src/plugins/platforms/cocoa/qcocoaclipboard.h
index 27505058bf..d387ae9eb0 100644
--- a/src/plugins/platforms/cocoa/qcocoaclipboard.h
+++ b/src/plugins/platforms/cocoa/qcocoaclipboard.h
@@ -42,7 +42,7 @@
#ifndef QCOCOACLIPBOARD_H
#define QCOCOACLIPBOARD_H
-#include <qplatformclipboard_qpa.h>
+#include <qpa/qplatformclipboard.h>
#include "qmacclipboard.h"
#include <QtCore/QScopedPointer>
diff --git a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.h b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.h
index 4b901f3ef3..6e83da9614 100644
--- a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.h
+++ b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.h
@@ -43,7 +43,7 @@
#define QCOCOACOLORDIALOGHELPER_H
#include <QObject>
-#include <qplatformdialoghelper_qpa.h>
+#include <qpa/qplatformdialoghelper.h>
QT_BEGIN_NAMESPACE
@@ -53,13 +53,11 @@ public:
QCocoaColorDialogHelper();
virtual ~QCocoaColorDialogHelper();
- void platformNativeDialogModalHelp();
- void _q_platformRunNativeAppModalPanel();
+ void exec_sys();
void deleteNativeDialog_sys();
bool show_sys(Qt::WindowFlags windowFlags, Qt::WindowModality windowModality, QWindow *parent);
void hide_sys();
- DialogCode dialogResultCode_sys();
void setCurrentColor_sys(const QColor&);
QColor currentColor_sys() const;
diff --git a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm
index 9f4446b32e..99dc3cb94e 100644
--- a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm
+++ b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm
@@ -343,31 +343,16 @@ QCocoaColorDialogHelper::QCocoaColorDialogHelper() :
}
QCocoaColorDialogHelper::~QCocoaColorDialogHelper()
-{
- deleteNativeDialog_sys();
-}
-
-void QCocoaColorDialogHelper::platformNativeDialogModalHelp()
-{
- // Do a queued meta-call to open the native modal dialog so it opens after the new
- // event loop has started to execute (in QDialog::exec). Using a timer rather than
- // a queued meta call is intentional to ensure that the call is only delivered when
- // [NSApp run] runs (timers are handeled special in cocoa). If NSApp is not
- // running (which is the case if e.g a top-most QEventLoop has been
- // interrupted, and the second-most event loop has not yet been reactivated (regardless
- // if [NSApp run] is still on the stack)), showing a native modal dialog will fail.
- QTimer::singleShot(1, this, SIGNAL(launchNativeAppModalPanel()));
-}
+{ }
-void QCocoaColorDialogHelper::_q_platformRunNativeAppModalPanel()
+void QCocoaColorDialogHelper::exec_sys()
{
- // TODO:
-#if 0
- QBoolBlocker nativeDialogOnTop(QApplicationPrivate::native_modal_dialog_active);
-#endif
+ // Note: If NSApp is not running (which is the case if e.g a top-most
+ // QEventLoop has been interrupted, and the second-most event loop has not
+ // yet been reactivated (regardless if [NSApp run] is still on the stack)),
+ // showing a native modal dialog will fail.
QT_MANGLE_NAMESPACE(QNSColorPanelDelegate) *delegate = static_cast<QT_MANGLE_NAMESPACE(QNSColorPanelDelegate) *>(mDelegate);
- [delegate runApplicationModalPanel];
- if (dialogResultCode_sys() == QPlatformDialogHelper::Accepted)
+ if ([delegate runApplicationModalPanel])
emit accept();
else
emit reject();
@@ -397,14 +382,6 @@ void QCocoaColorDialogHelper::hide_sys()
[reinterpret_cast<QT_MANGLE_NAMESPACE(QNSColorPanelDelegate) *>(mDelegate)->mColorPanel close];
}
-QCocoaColorDialogHelper::DialogCode QCocoaColorDialogHelper::dialogResultCode_sys()
-{
- if (!mDelegate)
- return QPlatformDialogHelper::Rejected;
- QT_MANGLE_NAMESPACE(QNSColorPanelDelegate) *delegate = static_cast<QT_MANGLE_NAMESPACE(QNSColorPanelDelegate) *>(mDelegate);
- return [delegate dialogResultCode];
-}
-
void QCocoaColorDialogHelper::setCurrentColor_sys(const QColor &color)
{
if (!mDelegate)
diff --git a/src/plugins/platforms/cocoa/qcocoacursor.h b/src/plugins/platforms/cocoa/qcocoacursor.h
index 85892ee820..b57d624b61 100644
--- a/src/plugins/platforms/cocoa/qcocoacursor.h
+++ b/src/plugins/platforms/cocoa/qcocoacursor.h
@@ -45,7 +45,7 @@
#include <Cocoa/Cocoa.h>
#include <QtCore>
-#include <QtGui/QPlatformCursor>
+#include <qpa/qplatformcursor.h>
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/platforms/cocoa/qcocoadrag.h b/src/plugins/platforms/cocoa/qcocoadrag.h
index 17df54f748..5a0a3fa271 100644
--- a/src/plugins/platforms/cocoa/qcocoadrag.h
+++ b/src/plugins/platforms/cocoa/qcocoadrag.h
@@ -44,7 +44,7 @@
#include <Cocoa/Cocoa.h>
#include <QtGui>
-#include <qplatformdrag_qpa.h>
+#include <qpa/qplatformdrag.h>
#include <QtPlatformSupport/private/qsimpledrag_p.h>
#include <QtGui/private/qdnd_p.h>
diff --git a/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm b/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm
index a3bd4a95ca..ddaa7a762b 100644
--- a/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm
+++ b/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm
@@ -81,8 +81,8 @@
#include "qhash.h"
#include "qmutex.h"
#include "qsocketnotifier.h"
-#include <qplatformwindow_qpa.h>
-#include <qplatformnativeinterface_qpa.h>
+#include <qpa/qplatformwindow.h>
+#include <qpa/qplatformnativeinterface.h>
#include "private/qthread_p.h"
#include "private/qguiapplication_p.h"
#include <qdebug.h>
diff --git a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.h b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.h
index 9768d3e6f9..7d7a0eeea2 100644
--- a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.h
+++ b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.h
@@ -43,7 +43,7 @@
#define QCOCOAFILEDIALOGHELPER_H
#include <QObject>
-#include <qplatformdialoghelper_qpa.h>
+#include <qpa/qplatformdialoghelper.h>
QT_BEGIN_NAMESPACE
@@ -56,15 +56,13 @@ public:
QCocoaFileDialogHelper();
virtual ~QCocoaFileDialogHelper();
- void platformNativeDialogModalHelp();
- void _q_platformRunNativeAppModalPanel();
+ void exec_sys();
bool defaultNameFilterDisables() const;
void deleteNativeDialog_sys();
bool show_sys(Qt::WindowFlags windowFlags, Qt::WindowModality windowModality, QWindow *parent);
void hide_sys();
- QPlatformFileDialogHelper::DialogCode dialogResultCode_sys();
void setDirectory_sys(const QString &directory);
QString directory_sys() const;
void selectFile_sys(const QString &filename);
diff --git a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
index 9bc7df02fb..8c3b5fd5c6 100644
--- a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
+++ b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
@@ -672,36 +672,18 @@ bool QCocoaFileDialogHelper::hideCocoaFilePanel()
}
}
-void QCocoaFileDialogHelper::platformNativeDialogModalHelp()
+void QCocoaFileDialogHelper::exec_sys()
{
- // Do a queued meta-call to open the native modal dialog so it opens after the new
- // event loop has started to execute (in QDialog::exec). Using a timer rather than
- // a queued meta call is intentional to ensure that the call is only delivered when
- // [NSApp run] runs (timers are handeled special in cocoa). If NSApp is not
- // running (which is the case if e.g a top-most QEventLoop has been
- // interrupted, and the second-most event loop has not yet been reactivated (regardless
- // if [NSApp run] is still on the stack)), showing a native modal dialog will fail.
- QTimer::singleShot(1, this, SIGNAL(launchNativeAppModalPanel()));
-}
-
-void QCocoaFileDialogHelper::_q_platformRunNativeAppModalPanel()
-{
- // TODO:
-#if 0
- QBoolBlocker nativeDialogOnTop(QApplicationPrivate::native_modal_dialog_active);
-#endif
+ // Note: If NSApp is not running (which is the case if e.g a top-most
+ // QEventLoop has been interrupted, and the second-most event loop has not
+ // yet been reactivated (regardless if [NSApp run] is still on the stack)),
+ // showing a native modal dialog will fail.
QT_MANGLE_NAMESPACE(QNSOpenSavePanelDelegate) *delegate = static_cast<QT_MANGLE_NAMESPACE(QNSOpenSavePanelDelegate) *>(mDelegate);
- [delegate runApplicationModalPanel];
- if (dialogResultCode_sys() == QPlatformDialogHelper::Accepted)
+ if ([delegate runApplicationModalPanel])
emit accept();
else
emit reject();
-}
-QPlatformDialogHelper::DialogCode QCocoaFileDialogHelper::dialogResultCode_sys()
-{
- QT_MANGLE_NAMESPACE(QNSOpenSavePanelDelegate) *delegate = static_cast<QT_MANGLE_NAMESPACE(QNSOpenSavePanelDelegate) *>(mDelegate);
- return [delegate dialogResultCode];
}
bool QCocoaFileDialogHelper::defaultNameFilterDisables() const
diff --git a/src/plugins/platforms/cocoa/qcocoafontdialoghelper.h b/src/plugins/platforms/cocoa/qcocoafontdialoghelper.h
index f9dd4357a5..d135a958df 100644
--- a/src/plugins/platforms/cocoa/qcocoafontdialoghelper.h
+++ b/src/plugins/platforms/cocoa/qcocoafontdialoghelper.h
@@ -43,7 +43,7 @@
#define QCOCOAFONTDIALOGHELPER_H
#include <QObject>
-#include <qplatformdialoghelper_qpa.h>
+#include <qpa/qplatformdialoghelper.h>
QT_BEGIN_NAMESPACE
@@ -56,15 +56,13 @@ public:
QCocoaFontDialogHelper();
virtual ~QCocoaFontDialogHelper();
- void platformNativeDialogModalHelp();
- void _q_platformRunNativeAppModalPanel();
+ void exec_sys();
+
void deleteNativeDialog_sys();
bool show_sys(Qt::WindowFlags windowFlags, Qt::WindowModality windowModality, QWindow *parent);
void hide_sys();
- QPlatformDialogHelper::DialogCode dialogResultCode_sys();
-
void setCurrentFont_sys(const QFont &);
QFont currentFont_sys() const;
diff --git a/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm b/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm
index 515bc2a6ee..89501f7c9d 100644
--- a/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm
+++ b/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm
@@ -362,31 +362,16 @@ QCocoaFontDialogHelper::QCocoaFontDialogHelper() :
}
QCocoaFontDialogHelper::~QCocoaFontDialogHelper()
-{
- deleteNativeDialog_sys();
-}
-
-void QCocoaFontDialogHelper::platformNativeDialogModalHelp()
-{
- // Do a queued meta-call to open the native modal dialog so it opens after the new
- // event loop has started to execute (in QDialog::exec). Using a timer rather than
- // a queued meta call is intentional to ensure that the call is only delivered when
- // [NSApp run] runs (timers are handeled special in cocoa). If NSApp is not
- // running (which is the case if e.g a top-most QEventLoop has been
- // interrupted, and the second-most event loop has not yet been reactivated (regardless
- // if [NSApp run] is still on the stack)), showing a native modal dialog will fail.
- QTimer::singleShot(1, this, SIGNAL(launchNativeAppModalPanel()));
-}
+{ }
-void QCocoaFontDialogHelper::_q_platformRunNativeAppModalPanel()
+void QCocoaFontDialogHelper::exec_sys()
{
- // TODO:
-#if 0
- QBoolBlocker nativeDialogOnTop(QApplicationPrivate::native_modal_dialog_active);
-#endif
+ // Note: If NSApp is not running (which is the case if e.g a top-most
+ // QEventLoop has been interrupted, and the second-most event loop has not
+ // yet been reactivated (regardless if [NSApp run] is still on the stack)),
+ // showing a native modal dialog will fail.
QT_MANGLE_NAMESPACE(QNSFontPanelDelegate) *delegate = static_cast<QT_MANGLE_NAMESPACE(QNSFontPanelDelegate) *>(mDelegate);
- [delegate runApplicationModalPanel];
- if (dialogResultCode_sys() == QPlatformDialogHelper::Accepted)
+ if ([delegate runApplicationModalPanel])
emit accept();
else
emit reject();
@@ -416,14 +401,6 @@ void QCocoaFontDialogHelper::hide_sys()
[reinterpret_cast<QT_MANGLE_NAMESPACE(QNSFontPanelDelegate) *>(mDelegate)->mFontPanel close];
}
-QCocoaFontDialogHelper::DialogCode QCocoaFontDialogHelper::dialogResultCode_sys()
-{
- if (!mDelegate)
- return QPlatformDialogHelper::Rejected;
- QT_MANGLE_NAMESPACE(QNSFontPanelDelegate) *delegate = static_cast<QT_MANGLE_NAMESPACE(QNSFontPanelDelegate) *>(mDelegate);
- return [delegate dialogResultCode];
-}
-
void QCocoaFontDialogHelper::setCurrentFont_sys(const QFont &font)
{
NSFontManager *mgr = [NSFontManager sharedFontManager];
diff --git a/src/plugins/platforms/cocoa/qcocoaglcontext.h b/src/plugins/platforms/cocoa/qcocoaglcontext.h
index 4f80511f61..6c0fcd1077 100644
--- a/src/plugins/platforms/cocoa/qcocoaglcontext.h
+++ b/src/plugins/platforms/cocoa/qcocoaglcontext.h
@@ -43,7 +43,7 @@
#define QCOCOAGLCONTEXT_H
#include <QtCore/QWeakPointer>
-#include <QtGui/QPlatformOpenGLContext>
+#include <qpa/qplatformopenglcontext.h>
#include <QtGui/QOpenGLContext>
#include <QtGui/QWindow>
diff --git a/src/plugins/platforms/cocoa/qcocoahelpers.mm b/src/plugins/platforms/cocoa/qcocoahelpers.mm
index 60590b966e..8f8d7b84a6 100644
--- a/src/plugins/platforms/cocoa/qcocoahelpers.mm
+++ b/src/plugins/platforms/cocoa/qcocoahelpers.mm
@@ -45,7 +45,7 @@
#include <QtCore>
#include <QtGui>
-#include <qplatformscreen_qpa.h>
+#include <qpa/qplatformscreen.h>
#include <private/qguiapplication_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/platforms/cocoa/qcocoainputcontext.h b/src/plugins/platforms/cocoa/qcocoainputcontext.h
index 1fda29209d..743931193d 100644
--- a/src/plugins/platforms/cocoa/qcocoainputcontext.h
+++ b/src/plugins/platforms/cocoa/qcocoainputcontext.h
@@ -42,7 +42,7 @@
#ifndef QCOCOAINPUTCONTEXT_H
#define QCOCOAINPUTCONTEXT_H
-#include <QtGui/QPlatformInputContext>
+#include <qpa/qplatforminputcontext.h>
#include <QtCore/QPointer>
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/platforms/cocoa/qcocoaintegration.h b/src/plugins/platforms/cocoa/qcocoaintegration.h
index a001b6234a..da84969f00 100644
--- a/src/plugins/platforms/cocoa/qcocoaintegration.h
+++ b/src/plugins/platforms/cocoa/qcocoaintegration.h
@@ -51,7 +51,7 @@
#include "qcocoaservices.h"
#include <QtCore/QScopedPointer>
-#include <QtGui/QPlatformIntegration>
+#include <qpa/qplatformintegration.h>
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/platforms/cocoa/qcocoaintegration.mm b/src/plugins/platforms/cocoa/qcocoaintegration.mm
index 0b87773dee..b82519fd97 100644
--- a/src/plugins/platforms/cocoa/qcocoaintegration.mm
+++ b/src/plugins/platforms/cocoa/qcocoaintegration.mm
@@ -55,7 +55,7 @@
#include "qcocoainputcontext.h"
#include "qmacmime.h"
-#include <QtGui/qplatformaccessibility_qpa.h>
+#include <qpa/qplatformaccessibility.h>
#include <QtCore/qcoreapplication.h>
#include <QtWidgets/QDialog>
diff --git a/src/plugins/platforms/cocoa/qcocoanativeinterface.h b/src/plugins/platforms/cocoa/qcocoanativeinterface.h
index bb4d0f9f6c..0346eafec4 100644
--- a/src/plugins/platforms/cocoa/qcocoanativeinterface.h
+++ b/src/plugins/platforms/cocoa/qcocoanativeinterface.h
@@ -42,8 +42,8 @@
#ifndef QCOCOANATIVEINTERFACE_H
#define QCOCOANATIVEINTERFACE_H
-#include <QtGui/QPlatformNativeInterface>
-#include <QtPrintSupport/QPlatformPrinterSupport>
+#include <qpa/qplatformnativeinterface.h>
+#include <qpa/qplatformprintersupport.h>
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/platforms/cocoa/qcocoanativeinterface.mm b/src/plugins/platforms/cocoa/qcocoanativeinterface.mm
index ca15b6bbfb..df9ae23606 100644
--- a/src/plugins/platforms/cocoa/qcocoanativeinterface.mm
+++ b/src/plugins/platforms/cocoa/qcocoanativeinterface.mm
@@ -46,9 +46,9 @@
#include <qbytearray.h>
#include <qwindow.h>
-#include "qplatformwindow_qpa.h"
+#include <qpa/qplatformwindow.h>
#include "qsurfaceformat.h"
-#include "qplatformopenglcontext_qpa.h"
+#include <qpa/qplatformopenglcontext.h>
#include "qopenglcontext.h"
#include <qdebug.h>
diff --git a/src/plugins/platforms/cocoa/qcocoaprintersupport.h b/src/plugins/platforms/cocoa/qcocoaprintersupport.h
index 2309025bb3..88a83a4f4e 100644
--- a/src/plugins/platforms/cocoa/qcocoaprintersupport.h
+++ b/src/plugins/platforms/cocoa/qcocoaprintersupport.h
@@ -42,7 +42,7 @@
#ifndef QCOCOAPRINTERSUPPORT_H
#define QCOCOAPRINTERSUPPORT_H
-#include <QtPrintSupport/QPlatformPrinterSupport>
+#include <qpa/qplatformprintersupport.h>
class QCocoaPrinterSupport : public QPlatformPrinterSupport
{
diff --git a/src/plugins/platforms/cocoa/qcocoaservices.h b/src/plugins/platforms/cocoa/qcocoaservices.h
index 022c39dc57..e3f5b3dbf0 100644
--- a/src/plugins/platforms/cocoa/qcocoaservices.h
+++ b/src/plugins/platforms/cocoa/qcocoaservices.h
@@ -42,7 +42,7 @@
#ifndef QCOCOADESKTOPSERVICES_H
#define QCOCOADESKTOPSERVICES_H
-#include <QtGui/qplatformservices_qpa.h>
+#include <qpa/qplatformservices.h>
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/platforms/cocoa/qcocoasystemsettings.h b/src/plugins/platforms/cocoa/qcocoasystemsettings.h
index 10cac27dcd..5e1249759b 100644
--- a/src/plugins/platforms/cocoa/qcocoasystemsettings.h
+++ b/src/plugins/platforms/cocoa/qcocoasystemsettings.h
@@ -44,7 +44,7 @@
#include <QtCore/qhash.h>
#include <QtGui/qpalette.h>
-#include <QtGui/qplatformtheme_qpa.h>
+#include <qpa/qplatformtheme.h>
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/platforms/cocoa/qcocoatheme.h b/src/plugins/platforms/cocoa/qcocoatheme.h
index 5cb6f7437d..791f1d4a50 100644
--- a/src/plugins/platforms/cocoa/qcocoatheme.h
+++ b/src/plugins/platforms/cocoa/qcocoatheme.h
@@ -43,7 +43,7 @@
#define QPLATFORMTHEME_COCOA_H
#include <QtCore/QHash>
-#include <QtGui/QPlatformTheme>
+#include <qpa/qplatformtheme.h>
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.h b/src/plugins/platforms/cocoa/qcocoawindow.h
index d08bbe79ce..f2d6ac67bb 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.h
+++ b/src/plugins/platforms/cocoa/qcocoawindow.h
@@ -44,7 +44,7 @@
#include <Cocoa/Cocoa.h>
-#include <QPlatformWindow>
+#include <qpa/qplatformwindow.h>
#include <QRect>
#include "qcocoaglcontext.h"
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm
index 83b6534b7c..5480b32083 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.mm
+++ b/src/plugins/platforms/cocoa/qcocoawindow.mm
@@ -48,7 +48,7 @@
#include <QtCore/private/qcore_mac_p.h>
#include <qwindow.h>
#include <QWindowSystemInterface>
-#include <QPlatformScreen>
+#include <qpa/qplatformscreen.h>
#include <Cocoa/Cocoa.h>
#include <Carbon/Carbon.h>
diff --git a/src/plugins/platforms/cocoa/qmenu_mac.h b/src/plugins/platforms/cocoa/qmenu_mac.h
index d41540a341..7a91e2d5e8 100644
--- a/src/plugins/platforms/cocoa/qmenu_mac.h
+++ b/src/plugins/platforms/cocoa/qmenu_mac.h
@@ -43,7 +43,7 @@
#include <QtCore/qpointer.h>
#include <QtWidgets/qmenu.h>
#include <QtWidgets/qmenubar.h>
-#include <QtWidgets/qplatformmenu_qpa.h>
+#include <qpa/qplatformmenu.h>
@class NSMenuItem;
diff --git a/src/plugins/platforms/cocoa/qpaintengine_mac.mm b/src/plugins/platforms/cocoa/qpaintengine_mac.mm
index 87f3713920..33e6e397a2 100644
--- a/src/plugins/platforms/cocoa/qpaintengine_mac.mm
+++ b/src/plugins/platforms/cocoa/qpaintengine_mac.mm
@@ -56,7 +56,7 @@
#include <qcoreapplication.h>
#include <qmath.h>
-#include <QtGui/qplatformpixmap_qpa.h>
+#include <qpa/qplatformpixmap.h>
#include <private/qfont_p.h>
#include <private/qfontengine_p.h>
diff --git a/src/plugins/platforms/cocoa/qprintengine_mac.mm b/src/plugins/platforms/cocoa/qprintengine_mac.mm
index e432b12e67..921dd2f78f 100644
--- a/src/plugins/platforms/cocoa/qprintengine_mac.mm
+++ b/src/plugins/platforms/cocoa/qprintengine_mac.mm
@@ -43,7 +43,7 @@
#include <qdebug.h>
#include <qthread.h>
#include <QtCore/qcoreapplication.h>
-#include <QtPrintSupport/QPlatformPrinterSupport>
+#include <qpa/qplatformprintersupport.h>
#include "qcocoaautoreleasepool.h"
diff --git a/src/plugins/platforms/directfb/main.cpp b/src/plugins/platforms/directfb/main.cpp
index 26bdd719ca..86af137249 100644
--- a/src/plugins/platforms/directfb/main.cpp
+++ b/src/plugins/platforms/directfb/main.cpp
@@ -39,7 +39,7 @@
**
****************************************************************************/
-#include <QtGui/QPlatformIntegrationPlugin>
+#include <qpa/qplatformintegrationplugin.h>
#include "qdirectfbintegration.h"
#include "qdirectfb_egl.h"
diff --git a/src/plugins/platforms/directfb/qdirectfb_egl.cpp b/src/plugins/platforms/directfb/qdirectfb_egl.cpp
index ac9142c0f4..f595cc4286 100644
--- a/src/plugins/platforms/directfb/qdirectfb_egl.cpp
+++ b/src/plugins/platforms/directfb/qdirectfb_egl.cpp
@@ -45,7 +45,7 @@
#include "qdirectfbeglhooks.h"
#include <QtGui/QOpenGLContext>
-#include <QtGui/QPlatformOpenGLContext>
+#include <qpa/qplatformopenglcontext.h>
#include <QtGui/QScreen>
#include <QtPlatformSupport/private/qeglplatformcontext_p.h>
diff --git a/src/plugins/platforms/directfb/qdirectfbbackingstore.h b/src/plugins/platforms/directfb/qdirectfbbackingstore.h
index 327329a563..63ce626f06 100644
--- a/src/plugins/platforms/directfb/qdirectfbbackingstore.h
+++ b/src/plugins/platforms/directfb/qdirectfbbackingstore.h
@@ -42,7 +42,7 @@
#ifndef QWINDOWSURFACE_DIRECTFB_H
#define QWINDOWSURFACE_DIRECTFB_H
-#include <qplatformbackingstore_qpa.h>
+#include <qpa/qplatformbackingstore.h>
#include <private/qpixmap_blitter_p.h>
#include <directfb.h>
diff --git a/src/plugins/platforms/directfb/qdirectfbcursor.h b/src/plugins/platforms/directfb/qdirectfbcursor.h
index f28e225dc7..64133901d7 100644
--- a/src/plugins/platforms/directfb/qdirectfbcursor.h
+++ b/src/plugins/platforms/directfb/qdirectfbcursor.h
@@ -42,7 +42,7 @@
#ifndef QDIRECTFBCURSOR_H
#define QDIRECTFBCURSOR_H
-#include <QPlatformCursor>
+#include <qpa/qplatformcursor.h>
#include <directfb.h>
#include "qdirectfbconvenience.h"
diff --git a/src/plugins/platforms/directfb/qdirectfbeglhooks.h b/src/plugins/platforms/directfb/qdirectfbeglhooks.h
index d0711b62dd..96bce3b3e8 100644
--- a/src/plugins/platforms/directfb/qdirectfbeglhooks.h
+++ b/src/plugins/platforms/directfb/qdirectfbeglhooks.h
@@ -42,7 +42,7 @@
#ifndef QDIRECTFBEGL_HOOKS_H
#define QDIRECTFBEGL_HOOKS_H
-#include "qplatformintegration_qpa.h"
+#include <qpa/qplatformintegration.h>
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/platforms/directfb/qdirectfbglcontext.h b/src/plugins/platforms/directfb/qdirectfbglcontext.h
index 7aac12c2f9..3e684ceef9 100644
--- a/src/plugins/platforms/directfb/qdirectfbglcontext.h
+++ b/src/plugins/platforms/directfb/qdirectfbglcontext.h
@@ -42,7 +42,7 @@
#ifndef QDIRECTFBGLCONTEXT_H
#define QDIRECTFBGLCONTEXT_H
-#include <QPlatformOpenGLContext>
+#include <qpa/qplatformopenglcontext.h>
#include "qdirectfbconvenience.h"
diff --git a/src/plugins/platforms/directfb/qdirectfbintegration.cpp b/src/plugins/platforms/directfb/qdirectfbintegration.cpp
index d167c465be..834e7dace7 100644
--- a/src/plugins/platforms/directfb/qdirectfbintegration.cpp
+++ b/src/plugins/platforms/directfb/qdirectfbintegration.cpp
@@ -52,7 +52,7 @@
#include <QtGui/private/qpixmap_blitter_p.h>
#include <QtGui/private/qpixmap_raster_p.h>
#include <QtGui/private/qguiapplication_p.h>
-#include <QtGui/qplatformpixmap_qpa.h>
+#include <qpa/qplatformpixmap.h>
#include <QtCore/QCoreApplication>
#include <QtCore/QThread>
#include <QtCore/QAbstractEventDispatcher>
diff --git a/src/plugins/platforms/directfb/qdirectfbintegration.h b/src/plugins/platforms/directfb/qdirectfbintegration.h
index 56d785e00f..c959ae5a33 100644
--- a/src/plugins/platforms/directfb/qdirectfbintegration.h
+++ b/src/plugins/platforms/directfb/qdirectfbintegration.h
@@ -45,7 +45,7 @@
#include "qdirectfbinput.h"
#include "qdirectfbscreen.h"
-#include <QtGui/QPlatformIntegration>
+#include <qpa/qplatformintegration.h>
#include <directfb.h>
#include <directfb_version.h>
diff --git a/src/plugins/platforms/directfb/qdirectfbscreen.h b/src/plugins/platforms/directfb/qdirectfbscreen.h
index 8535239088..6e2aa0d9bf 100644
--- a/src/plugins/platforms/directfb/qdirectfbscreen.h
+++ b/src/plugins/platforms/directfb/qdirectfbscreen.h
@@ -45,7 +45,7 @@
#include "qdirectfbconvenience.h"
#include "qdirectfbcursor.h"
-#include <QtGui/QPlatformIntegration>
+#include <qpa/qplatformintegration.h>
#include <directfb.h>
diff --git a/src/plugins/platforms/directfb/qdirectfbwindow.h b/src/plugins/platforms/directfb/qdirectfbwindow.h
index e0206b5d02..bc9e4d9c4e 100644
--- a/src/plugins/platforms/directfb/qdirectfbwindow.h
+++ b/src/plugins/platforms/directfb/qdirectfbwindow.h
@@ -42,7 +42,7 @@
#ifndef QDIRECTFBWINDOW_H
#define QDIRECTFBWINDOW_H
-#include <QPlatformWindow>
+#include <qpa/qplatformwindow.h>
#include "qdirectfbconvenience.h"
#include "qdirectfbinput.h"
diff --git a/src/plugins/platforms/eglfs/main.cpp b/src/plugins/platforms/eglfs/main.cpp
index 2ca2199619..4565b79610 100644
--- a/src/plugins/platforms/eglfs/main.cpp
+++ b/src/plugins/platforms/eglfs/main.cpp
@@ -39,7 +39,7 @@
**
****************************************************************************/
-#include <QtGui/QPlatformIntegrationPlugin>
+#include <qpa/qplatformintegrationplugin.h>
#include "qeglfsintegration.h"
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/platforms/eglfs/qeglfsbackingstore.h b/src/plugins/platforms/eglfs/qeglfsbackingstore.h
index f723bca685..e9808b7f95 100644
--- a/src/plugins/platforms/eglfs/qeglfsbackingstore.h
+++ b/src/plugins/platforms/eglfs/qeglfsbackingstore.h
@@ -42,7 +42,7 @@
#ifndef QEGLFSBACKINGSTORE_H
#define QEGLFSBACKINGSTORE_H
-#include <QtGui/qplatformbackingstore_qpa.h>
+#include <qpa/qplatformbackingstore.h>
#include <QImage>
#include <QRegion>
diff --git a/src/plugins/platforms/eglfs/qeglfshooks.h b/src/plugins/platforms/eglfs/qeglfshooks.h
index a56c80261b..c6ea209a6f 100644
--- a/src/plugins/platforms/eglfs/qeglfshooks.h
+++ b/src/plugins/platforms/eglfs/qeglfshooks.h
@@ -42,7 +42,7 @@
#ifndef QEGLFSHOOKS_H
#define QEGLFSHOOKS_H
-#include "qplatformintegration_qpa.h"
+#include <qpa/qplatformintegration.h>
#include <EGL/egl.h>
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/platforms/eglfs/qeglfsintegration.cpp b/src/plugins/platforms/eglfs/qeglfsintegration.cpp
index 9b7d9246f9..7025aed4a8 100644
--- a/src/plugins/platforms/eglfs/qeglfsintegration.cpp
+++ b/src/plugins/platforms/eglfs/qeglfsintegration.cpp
@@ -48,7 +48,7 @@
#include <QtPlatformSupport/private/qgenericunixfontdatabase_p.h>
#include <QtPlatformSupport/private/qgenericunixeventdispatcher_p.h>
-#include <QtGui/QPlatformWindow>
+#include <qpa/qplatformwindow.h>
#include <QtGui/QSurfaceFormat>
#include <QtGui/QOpenGLContext>
#include <QtGui/QScreen>
diff --git a/src/plugins/platforms/eglfs/qeglfsintegration.h b/src/plugins/platforms/eglfs/qeglfsintegration.h
index eea36a489d..b7cb715a9c 100644
--- a/src/plugins/platforms/eglfs/qeglfsintegration.h
+++ b/src/plugins/platforms/eglfs/qeglfsintegration.h
@@ -44,8 +44,8 @@
#include "qeglfsscreen.h"
-#include <QtGui/QPlatformIntegration>
-#include <QtGui/QPlatformScreen>
+#include <qpa/qplatformintegration.h>
+#include <qpa/qplatformscreen.h>
QT_BEGIN_HEADER
diff --git a/src/plugins/platforms/eglfs/qeglfsscreen.h b/src/plugins/platforms/eglfs/qeglfsscreen.h
index 66e600d7c2..8c67bf1956 100644
--- a/src/plugins/platforms/eglfs/qeglfsscreen.h
+++ b/src/plugins/platforms/eglfs/qeglfsscreen.h
@@ -42,7 +42,7 @@
#ifndef QEGLFSSCREEN_H
#define QEGLFSSCREEN_H
-#include <QPlatformScreen>
+#include <qpa/qplatformscreen.h>
#include <QtCore/QTextStream>
diff --git a/src/plugins/platforms/eglfs/qeglfswindow.h b/src/plugins/platforms/eglfs/qeglfswindow.h
index 7f40c78550..3e7a68953a 100644
--- a/src/plugins/platforms/eglfs/qeglfswindow.h
+++ b/src/plugins/platforms/eglfs/qeglfswindow.h
@@ -45,7 +45,7 @@
#include "qeglfsintegration.h"
#include "qeglfsscreen.h"
-#include <QPlatformWindow>
+#include <qpa/qplatformwindow.h>
#include <QtWidgets/QWidget>
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/platforms/kms/main.cpp b/src/plugins/platforms/kms/main.cpp
index 422fc5fba6..c1baaf3a4e 100644
--- a/src/plugins/platforms/kms/main.cpp
+++ b/src/plugins/platforms/kms/main.cpp
@@ -39,7 +39,7 @@
**
****************************************************************************/
-#include <QtGui/QPlatformIntegrationPlugin>
+#include <qpa/qplatformintegrationplugin.h>
#include "qkmsintegration.h"
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/platforms/kms/qkmsbackingstore.h b/src/plugins/platforms/kms/qkmsbackingstore.h
index ab276fa753..59d9c9ad94 100644
--- a/src/plugins/platforms/kms/qkmsbackingstore.h
+++ b/src/plugins/platforms/kms/qkmsbackingstore.h
@@ -42,7 +42,7 @@
#ifndef QBACKINGSTORE_KMS_H
#define QBACKINGSTORE_KMS_H
-#include <QtGui/QPlatformBackingStore>
+#include <qpa/qplatformbackingstore.h>
#include <QImage>
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/platforms/kms/qkmscontext.cpp b/src/plugins/platforms/kms/qkmscontext.cpp
index 4ae5325ca7..f2662e094f 100644
--- a/src/plugins/platforms/kms/qkmscontext.cpp
+++ b/src/plugins/platforms/kms/qkmscontext.cpp
@@ -72,7 +72,6 @@ bool QKmsContext::makeCurrent(QPlatformSurface *surface)
void QKmsContext::doneCurrent()
{
- QPlatformOpenGLContext::doneCurrent();
bool ok = eglMakeCurrent(m_device->eglDisplay(), EGL_NO_SURFACE, EGL_NO_SURFACE,
EGL_NO_CONTEXT);
if (!ok)
diff --git a/src/plugins/platforms/kms/qkmscontext.h b/src/plugins/platforms/kms/qkmscontext.h
index 6378780f34..32223ada51 100644
--- a/src/plugins/platforms/kms/qkmscontext.h
+++ b/src/plugins/platforms/kms/qkmscontext.h
@@ -42,7 +42,7 @@
#ifndef QKMSCONTEXT_H
#define QKMSCONTEXT_H
-#include <QtGui/QPlatformOpenGLContext>
+#include <qpa/qplatformopenglcontext.h>
#define EGL_EGLEXT_PROTOTYPES 1
#include <EGL/egl.h>
diff --git a/src/plugins/platforms/kms/qkmscursor.h b/src/plugins/platforms/kms/qkmscursor.h
index f6e1176a36..c0734eb68a 100644
--- a/src/plugins/platforms/kms/qkmscursor.h
+++ b/src/plugins/platforms/kms/qkmscursor.h
@@ -42,7 +42,7 @@
#ifndef QKMSCURSOR_H
#define QKMSCURSOR_H
-#include <QtGui/QPlatformCursor>
+#include <qpa/qplatformcursor.h>
#define EGL_EGLEXT_PROTOTYPES 1
diff --git a/src/plugins/platforms/kms/qkmsintegration.h b/src/plugins/platforms/kms/qkmsintegration.h
index 03fc5080a6..93b3084e9b 100644
--- a/src/plugins/platforms/kms/qkmsintegration.h
+++ b/src/plugins/platforms/kms/qkmsintegration.h
@@ -42,8 +42,8 @@
#ifndef QPLATFORMINTEGRATION_KMS_H
#define QPLATFORMINTEGRATION_KMS_H
-#include <QtGui/QPlatformIntegration>
-#include <QtGui/QPlatformNativeInterface>
+#include <qpa/qplatformintegration.h>
+#include <qpa/qplatformnativeinterface.h>
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/platforms/kms/qkmsnativeinterface.h b/src/plugins/platforms/kms/qkmsnativeinterface.h
index 77a9573250..20949becba 100644
--- a/src/plugins/platforms/kms/qkmsnativeinterface.h
+++ b/src/plugins/platforms/kms/qkmsnativeinterface.h
@@ -44,7 +44,7 @@
#include "qkmsscreen.h"
-#include <QtGui/QPlatformNativeInterface>
+#include <qpa/qplatformnativeinterface.h>
class QKmsNativeInterface : public QPlatformNativeInterface
{
diff --git a/src/plugins/platforms/kms/qkmsscreen.h b/src/plugins/platforms/kms/qkmsscreen.h
index 058314a515..e8e6bda22d 100644
--- a/src/plugins/platforms/kms/qkmsscreen.h
+++ b/src/plugins/platforms/kms/qkmsscreen.h
@@ -42,7 +42,7 @@
#ifndef QKMSSCREEN_H
#define QKMSSCREEN_H
-#include <QtGui/QPlatformScreen>
+#include <qpa/qplatformscreen.h>
#include "qkmsbuffermanager.h"
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/platforms/kms/qkmswindow.h b/src/plugins/platforms/kms/qkmswindow.h
index 2a7839681f..c9b3c2692f 100644
--- a/src/plugins/platforms/kms/qkmswindow.h
+++ b/src/plugins/platforms/kms/qkmswindow.h
@@ -42,7 +42,7 @@
#ifndef QKMSWINDOW_H
#define QKMSWINDOW_H
-#include <QtGui/QPlatformWindow>
+#include <qpa/qplatformwindow.h>
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/platforms/linuxfb/main.cpp b/src/plugins/platforms/linuxfb/main.cpp
index 1339700534..f670b6f5d4 100644
--- a/src/plugins/platforms/linuxfb/main.cpp
+++ b/src/plugins/platforms/linuxfb/main.cpp
@@ -39,7 +39,7 @@
**
****************************************************************************/
-#include <QPlatformIntegrationPlugin>
+#include <qpa/qplatformintegrationplugin.h>
#include "qlinuxfbintegration.h"
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/platforms/linuxfb/qlinuxfbintegration.h b/src/plugins/platforms/linuxfb/qlinuxfbintegration.h
index 3c8f03374a..200cd81bd4 100644
--- a/src/plugins/platforms/linuxfb/qlinuxfbintegration.h
+++ b/src/plugins/platforms/linuxfb/qlinuxfbintegration.h
@@ -42,7 +42,7 @@
#ifndef QGRAPHICSSYSTEM_LINUXFB_H
#define QGRAPHICSSYSTEM_LINUXFB_H
-#include <QPlatformIntegration>
+#include <qpa/qplatformintegration.h>
#include "../fb_base/fb_base.h"
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/platforms/minimal/main.cpp b/src/plugins/platforms/minimal/main.cpp
index 8a6e8fb4b0..9ac75e1050 100644
--- a/src/plugins/platforms/minimal/main.cpp
+++ b/src/plugins/platforms/minimal/main.cpp
@@ -40,7 +40,7 @@
****************************************************************************/
-#include <QtGui/QPlatformIntegrationPlugin>
+#include <qpa/qplatformintegrationplugin.h>
#include "qminimalintegration.h"
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/platforms/minimal/qminimalbackingstore.cpp b/src/plugins/platforms/minimal/qminimalbackingstore.cpp
index 5336dbf3bd..d47633e673 100644
--- a/src/plugins/platforms/minimal/qminimalbackingstore.cpp
+++ b/src/plugins/platforms/minimal/qminimalbackingstore.cpp
@@ -43,7 +43,7 @@
#include "qminimalbackingstore.h"
#include "qscreen.h"
#include <QtCore/qdebug.h>
-#include <QtGui/QPlatformScreen>
+#include <qpa/qplatformscreen.h>
#include <private/qguiapplication_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/platforms/minimal/qminimalbackingstore.h b/src/plugins/platforms/minimal/qminimalbackingstore.h
index 375edaa2f3..ff670f5eb2 100644
--- a/src/plugins/platforms/minimal/qminimalbackingstore.h
+++ b/src/plugins/platforms/minimal/qminimalbackingstore.h
@@ -42,8 +42,8 @@
#ifndef QBACKINGSTORE_MINIMAL_H
#define QBACKINGSTORE_MINIMAL_H
-#include <QtGui/QPlatformBackingStore>
-#include <QtGui/QPlatformWindow>
+#include <qpa/qplatformbackingstore.h>
+#include <qpa/qplatformwindow.h>
#include <QtGui/QImage>
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/platforms/minimal/qminimalintegration.cpp b/src/plugins/platforms/minimal/qminimalintegration.cpp
index 874f270f42..3ad5f6e309 100644
--- a/src/plugins/platforms/minimal/qminimalintegration.cpp
+++ b/src/plugins/platforms/minimal/qminimalintegration.cpp
@@ -49,7 +49,7 @@
#include <QtGui/private/qpixmap_raster_p.h>
#include <QtGui/private/qguiapplication_p.h>
-#include <QtGui/QPlatformWindow>
+#include <qpa/qplatformwindow.h>
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/platforms/minimal/qminimalintegration.h b/src/plugins/platforms/minimal/qminimalintegration.h
index 2b345e009e..7d9db08f3d 100644
--- a/src/plugins/platforms/minimal/qminimalintegration.h
+++ b/src/plugins/platforms/minimal/qminimalintegration.h
@@ -42,8 +42,8 @@
#ifndef QPLATFORMINTEGRATION_MINIMAL_H
#define QPLATFORMINTEGRATION_MINIMAL_H
-#include <QtGui/QPlatformIntegration>
-#include <QtGui/QPlatformScreen>
+#include <qpa/qplatformintegration.h>
+#include <qpa/qplatformscreen.h>
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/platforms/openwfd/main.cpp b/src/plugins/platforms/openwfd/main.cpp
index 4e583e9b2d..0d9508da6c 100644
--- a/src/plugins/platforms/openwfd/main.cpp
+++ b/src/plugins/platforms/openwfd/main.cpp
@@ -39,7 +39,7 @@
**
****************************************************************************/
-#include <QtGui/QPlatformIntegrationPlugin>
+#include <qpa/qplatformintegrationplugin.h>
#include "qopenwfdintegration.h"
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/platforms/openwfd/qopenwfdbackingstore.h b/src/plugins/platforms/openwfd/qopenwfdbackingstore.h
index 4002fd8ffc..84caa81f97 100644
--- a/src/plugins/platforms/openwfd/qopenwfdbackingstore.h
+++ b/src/plugins/platforms/openwfd/qopenwfdbackingstore.h
@@ -42,7 +42,7 @@
#ifndef QOPENWFDBACKINGSTORE_H
#define QOPENWFDBACKINGSTORE_H
-#include <QtGui/QPlatformBackingStore>
+#include <qpa/qplatformbackingstore.h>
#include <QtGui/QImage>
class QOpenWFDBackingStore : public QPlatformBackingStore
diff --git a/src/plugins/platforms/openwfd/qopenwfdglcontext.h b/src/plugins/platforms/openwfd/qopenwfdglcontext.h
index d353eddbb0..7a613cc8a7 100644
--- a/src/plugins/platforms/openwfd/qopenwfdglcontext.h
+++ b/src/plugins/platforms/openwfd/qopenwfdglcontext.h
@@ -42,7 +42,7 @@
#ifndef QOPENWFDGLCONTEXT_H
#define QOPENWFDGLCONTEXT_H
-#include <QtGui/QPlatformOpenGLContext>
+#include <qpa/qplatformopenglcontext.h>
#include "qopenwfddevice.h"
diff --git a/src/plugins/platforms/openwfd/qopenwfdintegration.h b/src/plugins/platforms/openwfd/qopenwfdintegration.h
index 5737dbb00e..7b6a95497f 100644
--- a/src/plugins/platforms/openwfd/qopenwfdintegration.h
+++ b/src/plugins/platforms/openwfd/qopenwfdintegration.h
@@ -42,8 +42,8 @@
#ifndef QOPENWFDINTEGRATION_H
#define QOPENWFDINTEGRATION_H
-#include <QtGui/QPlatformIntegration>
-#include <QtGui/QPlatformScreen>
+#include <qpa/qplatformintegration.h>
+#include <qpa/qplatformscreen.h>
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/platforms/openwfd/qopenwfdnativeinterface.h b/src/plugins/platforms/openwfd/qopenwfdnativeinterface.h
index 955fca7d41..f4ccfe5958 100644
--- a/src/plugins/platforms/openwfd/qopenwfdnativeinterface.h
+++ b/src/plugins/platforms/openwfd/qopenwfdnativeinterface.h
@@ -42,7 +42,7 @@
#ifndef QOPENWFDNATIVEINTERFACE_H
#define QOPENWFDNATIVEINTERFACE_H
-#include <QtGui/QPlatformNativeInterface>
+#include <qpa/qplatformnativeinterface.h>
#include <WF/wfdplatform.h>
diff --git a/src/plugins/platforms/openwfd/qopenwfdscreen.h b/src/plugins/platforms/openwfd/qopenwfdscreen.h
index 8993205a16..ff4a83f663 100644
--- a/src/plugins/platforms/openwfd/qopenwfdscreen.h
+++ b/src/plugins/platforms/openwfd/qopenwfdscreen.h
@@ -42,7 +42,7 @@
#ifndef QOPENWFDSCREEN_H
#define QOPENWFDSCREEN_H
-#include <QtGui/QPlatformScreen>
+#include <qpa/qplatformscreen.h>
#include "qopenwfdoutputbuffer.h"
diff --git a/src/plugins/platforms/openwfd/qopenwfdwindow.h b/src/plugins/platforms/openwfd/qopenwfdwindow.h
index ca531b07ae..9f777b3c4a 100644
--- a/src/plugins/platforms/openwfd/qopenwfdwindow.h
+++ b/src/plugins/platforms/openwfd/qopenwfdwindow.h
@@ -42,7 +42,7 @@
#ifndef QOPENWFDWINDOW_H
#define QOPENWFDWINDOW_H
-#include <QtGui/QPlatformWindow>
+#include <qpa/qplatformwindow.h>
#include <QtCore/QVarLengthArray>
#include "qopenwfdport.h"
diff --git a/src/plugins/platforms/qnx/main.h b/src/plugins/platforms/qnx/main.h
index cc2cfdd000..4033a29121 100644
--- a/src/plugins/platforms/qnx/main.h
+++ b/src/plugins/platforms/qnx/main.h
@@ -39,7 +39,7 @@
**
****************************************************************************/
-#include <QtGui/QPlatformIntegrationPlugin>
+#include <qpa/qplatformintegrationplugin.h>
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/platforms/qnx/qqnxclipboard.h b/src/plugins/platforms/qnx/qqnxclipboard.h
index c9ceff41f6..7a9d7c3121 100644
--- a/src/plugins/platforms/qnx/qqnxclipboard.h
+++ b/src/plugins/platforms/qnx/qqnxclipboard.h
@@ -43,7 +43,7 @@
#define QQNXCLIPBOARD_H
#ifndef QT_NO_CLIPBOARD
-#include <QtGui/QPlatformClipboard>
+#include <qpa/qplatformclipboard.h>
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/platforms/qnx/qqnxglbackingstore.h b/src/plugins/platforms/qnx/qqnxglbackingstore.h
index b694079f37..78ee58f215 100644
--- a/src/plugins/platforms/qnx/qqnxglbackingstore.h
+++ b/src/plugins/platforms/qnx/qqnxglbackingstore.h
@@ -42,7 +42,7 @@
#ifndef QQNXGLBACKINGSTORE_H
#define QQNXGLBACKINGSTORE_H
-#include <QtGui/qplatformbackingstore_qpa.h>
+#include <qpa/qplatformbackingstore.h>
#include <QtOpenGL/private/qglpaintdevice_p.h>
#include <screen/screen.h>
diff --git a/src/plugins/platforms/qnx/qqnxglcontext.h b/src/plugins/platforms/qnx/qqnxglcontext.h
index ee8d61ce00..8b587e7eb8 100644
--- a/src/plugins/platforms/qnx/qqnxglcontext.h
+++ b/src/plugins/platforms/qnx/qqnxglcontext.h
@@ -42,7 +42,7 @@
#ifndef QQNXGLCONTEXT_H
#define QQNXGLCONTEXT_H
-#include <QtGui/QPlatformOpenGLContext>
+#include <qpa/qplatformopenglcontext.h>
#include <QtGui/QSurfaceFormat>
#include <QtCore/QSize>
diff --git a/src/plugins/platforms/qnx/qqnxinputcontext_imf.h b/src/plugins/platforms/qnx/qqnxinputcontext_imf.h
index 5f7d95bc4a..f6f0f60204 100644
--- a/src/plugins/platforms/qnx/qqnxinputcontext_imf.h
+++ b/src/plugins/platforms/qnx/qqnxinputcontext_imf.h
@@ -42,11 +42,11 @@
#ifndef QQNXINPUTCONTEXT_H
#define QQNXINPUTCONTEXT_H
-#include <QtGui/QPlatformInputContext>
+#include <qpa/qplatforminputcontext.h>
#include <QtCore/QLocale>
#include <QtCore/QMetaType>
-#include <QtGui/QPlatformIntegration>
+#include <qpa/qplatformintegration.h>
#include "imf/imf_client.h"
#include "imf/input_control.h"
diff --git a/src/plugins/platforms/qnx/qqnxinputcontext_noimf.h b/src/plugins/platforms/qnx/qqnxinputcontext_noimf.h
index d73c5136b5..93512b26e5 100644
--- a/src/plugins/platforms/qnx/qqnxinputcontext_noimf.h
+++ b/src/plugins/platforms/qnx/qqnxinputcontext_noimf.h
@@ -43,8 +43,8 @@
#define QQNXINPUTCONTEXT_H
#include <QtCore/QLocale>
-#include <QtGui/QPlatformInputContext>
-#include <QtGui/QPlatformIntegration>
+#include <qpa/qplatforminputcontext.h>
+#include <qpa/qplatformintegration.h>
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/platforms/qnx/qqnxintegration.cpp b/src/plugins/platforms/qnx/qqnxintegration.cpp
index 73d8cb2007..dd1a6f8b7e 100644
--- a/src/plugins/platforms/qnx/qqnxintegration.cpp
+++ b/src/plugins/platforms/qnx/qqnxintegration.cpp
@@ -79,7 +79,7 @@
#include "private/qgenericunixeventdispatcher_p.h"
#endif
-#include <QtGui/QPlatformWindow>
+#include <qpa/qplatformwindow.h>
#include <QtGui/QWindowSystemInterface>
#if !defined(QT_NO_OPENGL)
diff --git a/src/plugins/platforms/qnx/qqnxintegration.h b/src/plugins/platforms/qnx/qqnxintegration.h
index a3c476f16e..e0da8cc5f2 100644
--- a/src/plugins/platforms/qnx/qqnxintegration.h
+++ b/src/plugins/platforms/qnx/qqnxintegration.h
@@ -42,7 +42,7 @@
#ifndef QQNXINTEGRATION_H
#define QQNXINTEGRATION_H
-#include <QtGui/qplatformintegration_qpa.h>
+#include <qpa/qplatformintegration.h>
#include <QtCore/qmutex.h>
diff --git a/src/plugins/platforms/qnx/qqnxnativeinterface.h b/src/plugins/platforms/qnx/qqnxnativeinterface.h
index ec896d40fa..f176b0a538 100644
--- a/src/plugins/platforms/qnx/qqnxnativeinterface.h
+++ b/src/plugins/platforms/qnx/qqnxnativeinterface.h
@@ -42,7 +42,7 @@
#ifndef QQNXNATIVEINTERFACE_H
#define QQNXNATIVEINTERFACE_H
-#include <QtGui/QPlatformNativeInterface>
+#include <qpa/qplatformnativeinterface.h>
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/platforms/qnx/qqnxrasterbackingstore.h b/src/plugins/platforms/qnx/qqnxrasterbackingstore.h
index 7a7f211e9a..6a559492e1 100644
--- a/src/plugins/platforms/qnx/qqnxrasterbackingstore.h
+++ b/src/plugins/platforms/qnx/qqnxrasterbackingstore.h
@@ -42,7 +42,7 @@
#ifndef QQNXRASTERWINDOWSURFACE_H
#define QQNXRASTERWINDOWSURFACE_H
-#include <QtGui/qplatformbackingstore_qpa.h>
+#include <qpa/qplatformbackingstore.h>
#include <screen/screen.h>
diff --git a/src/plugins/platforms/qnx/qqnxscreen.h b/src/plugins/platforms/qnx/qqnxscreen.h
index 7816661323..4a13946ec3 100644
--- a/src/plugins/platforms/qnx/qqnxscreen.h
+++ b/src/plugins/platforms/qnx/qqnxscreen.h
@@ -42,7 +42,7 @@
#ifndef QBBSCREEN_H
#define QBBSCREEN_H
-#include <QtGui/QPlatformScreen>
+#include <qpa/qplatformscreen.h>
#include "qqnxrootwindow.h"
diff --git a/src/plugins/platforms/qnx/qqnxservices.h b/src/plugins/platforms/qnx/qqnxservices.h
index fe7c014047..e9fc7cf2e5 100644
--- a/src/plugins/platforms/qnx/qqnxservices.h
+++ b/src/plugins/platforms/qnx/qqnxservices.h
@@ -42,7 +42,7 @@
#ifndef QQNXSERVICES_H
#define QQNXSERVICES_H
-#include <QtGui/QPlatformServices>
+#include <qpa/qplatformservices.h>
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/platforms/qnx/qqnxwindow.h b/src/plugins/platforms/qnx/qqnxwindow.h
index 2ea7bbca51..50b9a423f5 100644
--- a/src/plugins/platforms/qnx/qqnxwindow.h
+++ b/src/plugins/platforms/qnx/qqnxwindow.h
@@ -42,7 +42,7 @@
#ifndef QQNXWINDOW_H
#define QQNXWINDOW_H
-#include <QtGui/QPlatformWindow>
+#include <qpa/qplatformwindow.h>
#include "qqnxbuffer.h"
diff --git a/src/plugins/platforms/windows/accessible/qwindowsaccessibility.cpp b/src/plugins/platforms/windows/accessible/qwindowsaccessibility.cpp
index 17ee6eb82c..6f2a601c50 100644
--- a/src/plugins/platforms/windows/accessible/qwindowsaccessibility.cpp
+++ b/src/plugins/platforms/windows/accessible/qwindowsaccessibility.cpp
@@ -51,7 +51,7 @@
#include <QtCore/qsettings.h>
#include <QtGui/qaccessible.h>
#include <QtGui/qaccessible2.h>
-#include <QtGui/qplatformnativeinterface_qpa.h>
+#include <qpa/qplatformnativeinterface.h>
#include <QtGui/qwindow.h>
#include <QtGui/qguiapplication.h>
diff --git a/src/plugins/platforms/windows/accessible/qwindowsaccessibility.h b/src/plugins/platforms/windows/accessible/qwindowsaccessibility.h
index 3366c32daa..67aaa5b993 100644
--- a/src/plugins/platforms/windows/accessible/qwindowsaccessibility.h
+++ b/src/plugins/platforms/windows/accessible/qwindowsaccessibility.h
@@ -44,7 +44,7 @@
#include "../qtwindowsglobal.h"
#include "../qwindowscontext.h"
-#include <QtGui/QPlatformAccessibility>
+#include <qpa/qplatformaccessibility.h>
#include <oleacc.h>
diff --git a/src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.cpp b/src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.cpp
index 5003d9effd..fafe624e4b 100644
--- a/src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.cpp
+++ b/src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.cpp
@@ -56,7 +56,7 @@
#include <QtGui/qaccessible.h>
#include <QtGui/qaccessible2.h>
#include <QtGui/qguiapplication.h>
-#include <QtGui/qplatformnativeinterface_qpa.h>
+#include <qpa/qplatformnativeinterface.h>
#include <QtGui/qwindow.h>
#include <QtWidgets/qapplication.h>
#include <QtWidgets/qgraphicsitem.h>
diff --git a/src/plugins/platforms/windows/main.cpp b/src/plugins/platforms/windows/main.cpp
index 9f6ce99836..5404d91679 100644
--- a/src/plugins/platforms/windows/main.cpp
+++ b/src/plugins/platforms/windows/main.cpp
@@ -40,7 +40,7 @@
****************************************************************************/
-#include <QtGui/QPlatformIntegrationPlugin>
+#include <qpa/qplatformintegrationplugin.h>
#include <QtCore/QStringList>
#include "qwindowsintegration.h"
diff --git a/src/plugins/platforms/windows/qwindowsbackingstore.h b/src/plugins/platforms/windows/qwindowsbackingstore.h
index 14ce6c3438..75b6e5f736 100644
--- a/src/plugins/platforms/windows/qwindowsbackingstore.h
+++ b/src/plugins/platforms/windows/qwindowsbackingstore.h
@@ -44,7 +44,7 @@
#include "qtwindows_additional.h"
-#include <QtGui/QPlatformBackingStore>
+#include <qpa/qplatformbackingstore.h>
#include <QtCore/QScopedPointer>
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/platforms/windows/qwindowsclipboard.h b/src/plugins/platforms/windows/qwindowsclipboard.h
index 643c785e8b..00c975eae6 100644
--- a/src/plugins/platforms/windows/qwindowsclipboard.h
+++ b/src/plugins/platforms/windows/qwindowsclipboard.h
@@ -44,7 +44,7 @@
#include "qwindowsinternalmimedata.h"
-#include <QtGui/QPlatformClipboard>
+#include <qpa/qplatformclipboard.h>
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp
index 6913bc8dd4..3a2113520d 100644
--- a/src/plugins/platforms/windows/qwindowscontext.cpp
+++ b/src/plugins/platforms/windows/qwindowscontext.cpp
@@ -55,7 +55,7 @@
#include <QtGui/QWindow>
#include <QtGui/QWindowSystemInterface>
-#include <QtGui/QPlatformNativeInterface>
+#include <qpa/qplatformnativeinterface.h>
#include <QtGui/QGuiApplication>
#include <QtCore/QSet>
@@ -595,37 +595,39 @@ QByteArray QWindowsContext::comErrorString(HRESULT hr)
{
switch (hr) {
case S_OK:
- return QByteArray("S_OK");
+ return QByteArrayLiteral("S_OK");
case S_FALSE:
- return QByteArray("S_FALSE");
+ return QByteArrayLiteral("S_FALSE");
case E_UNEXPECTED:
- return QByteArray("E_UNEXPECTED");
+ return QByteArrayLiteral("E_UNEXPECTED");
case CO_E_ALREADYINITIALIZED:
- return QByteArray("CO_E_ALREADYINITIALIZED");
+ return QByteArrayLiteral("CO_E_ALREADYINITIALIZED");
case CO_E_NOTINITIALIZED:
- return QByteArray("CO_E_NOTINITIALIZED");
+ return QByteArrayLiteral("CO_E_NOTINITIALIZED");
case RPC_E_CHANGED_MODE:
- return QByteArray("RPC_E_CHANGED_MODE");
+ return QByteArrayLiteral("RPC_E_CHANGED_MODE");
case OLE_E_WRONGCOMPOBJ:
- return QByteArray("OLE_E_WRONGCOMPOBJ");
+ return QByteArrayLiteral("OLE_E_WRONGCOMPOBJ");
case CO_E_NOT_SUPPORTED:
- return QByteArray("CO_E_NOT_SUPPORTED");
+ return QByteArrayLiteral("CO_E_NOT_SUPPORTED");
case E_NOTIMPL:
- return QByteArray("E_NOTIMPL");
+ return QByteArrayLiteral("E_NOTIMPL");
case E_INVALIDARG:
- return QByteArray("");
+ return QByteArrayLiteral("E_INVALIDARG");
case E_NOINTERFACE:
- return QByteArray("");
+ return QByteArrayLiteral("E_NOINTERFACE");
case E_POINTER:
- return QByteArray("");
+ return QByteArrayLiteral("E_POINTER");
case E_HANDLE:
- return QByteArray("");
+ return QByteArrayLiteral("E_HANDLE");
case E_ABORT:
- return QByteArray("");
+ return QByteArrayLiteral("E_ABORT");
case E_FAIL:
- return QByteArray("");
- case E_ACCESSDENIED:
- return QByteArray("");
+ return QByteArrayLiteral("E_FAIL");
+ case RPC_E_WRONG_THREAD:
+ return QByteArrayLiteral("RPC_E_WRONG_THREAD");
+ case RPC_E_THREAD_NOT_INIT:
+ return QByteArrayLiteral("RPC_E_THREAD_NOT_INIT");
default:
break;
}
diff --git a/src/plugins/platforms/windows/qwindowscursor.h b/src/plugins/platforms/windows/qwindowscursor.h
index 61c43dc4d2..c1bccde46c 100644
--- a/src/plugins/platforms/windows/qwindowscursor.h
+++ b/src/plugins/platforms/windows/qwindowscursor.h
@@ -44,7 +44,7 @@
#include "qtwindows_additional.h"
-#include <QtGui/QPlatformCursor>
+#include <qpa/qplatformcursor.h>
#include <QtCore/QSharedDataPointer>
#include <QtCore/QHash>
diff --git a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp
index 7cd857e3a4..ea47d0abb2 100644
--- a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp
+++ b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp
@@ -519,29 +519,12 @@ void QWindowsDialogHelperBase<BaseClass>::hide_sys()
}
template <class BaseClass>
-void QWindowsDialogHelperBase<BaseClass>::platformNativeDialogModalHelp()
+void QWindowsDialogHelperBase<BaseClass>::exec_sys()
{
if (QWindowsContext::verboseDialogs)
qDebug("%s" , __FUNCTION__);
- if (QWindowsNativeDialogBase *nd =nativeDialog())
- nd->metaObject()->invokeMethod(this,
- "emitLaunchNativeAppModalPanel",
- Qt::QueuedConnection);
-}
-
-template <class BaseClass>
-void QWindowsDialogHelperBase<BaseClass>::_q_platformRunNativeAppModalPanel()
-{
- if (QWindowsNativeDialogBase *nd =nativeDialog())
- nd->exec(m_ownerWindow);
-}
-
-template <class BaseClass>
-QPlatformDialogHelper::DialogCode QWindowsDialogHelperBase<BaseClass>::dialogResultCode_sys()
-{
- if (QWindowsNativeDialogBase *nd =nativeDialog())
- return nd->result();
- return QPlatformDialogHelper::Rejected;
+ if (QWindowsNativeDialogBase *nd = nativeDialog())
+ nd->exec(m_ownerWindow);
}
static inline bool snapToDefaultButtonHint()
@@ -1105,6 +1088,13 @@ QWindowsNativeFileDialogBase *QWindowsNativeFileDialogBase::create(QFileDialogOp
\class QWindowsFileDialogHelper
\brief Helper for native Windows file dialogs
+ Non-modal dialogs are disabled for now. The functionality is
+ implemented in principle, however there are failures
+ when querying the results from a dialog run in another thread.
+ This could probably be fixed be calling CoInitializeEx() with
+ the right parameters from each thread. The problem is though
+ that calls to CoInitialize() occur in several places in Qt.
+
\ingroup qt-lighthouse-win
*/
@@ -1112,6 +1102,7 @@ class QWindowsFileDialogHelper : public QWindowsDialogHelperBase<QPlatformFileDi
{
public:
QWindowsFileDialogHelper() {}
+ virtual bool supportsNonModalDialog() const { return false; }
virtual bool defaultNameFilterDisables() const
{ return true; }
@@ -1135,19 +1126,14 @@ QWindowsNativeDialogBase *QWindowsFileDialogHelper::createNativeDialog()
QWindowsNativeFileDialogBase *result = QWindowsNativeFileDialogBase::create(options()->acceptMode());
if (!result)
return 0;
- QObject::connect(result, SIGNAL(accepted()), this, SIGNAL(accept()),
- Qt::QueuedConnection);
- QObject::connect(result, SIGNAL(rejected()), this, SIGNAL(reject()),
- Qt::QueuedConnection);
+ QObject::connect(result, SIGNAL(accepted()), this, SIGNAL(accept()));
+ QObject::connect(result, SIGNAL(rejected()), this, SIGNAL(reject()));
QObject::connect(result, SIGNAL(directoryEntered(QString)),
- this, SIGNAL(directoryEntered(QString)),
- Qt::QueuedConnection);
+ this, SIGNAL(directoryEntered(QString)));
QObject::connect(result, SIGNAL(currentChanged(QString)),
- this, SIGNAL(currentChanged(QString)),
- Qt::QueuedConnection);
+ this, SIGNAL(currentChanged(QString)));
QObject::connect(result, SIGNAL(filterSelected(QString)),
- this, SIGNAL(filterSelected(QString)),
- Qt::QueuedConnection);
+ this, SIGNAL(filterSelected(QString)));
// Apply settings.
const QSharedPointer<QFileDialogOptions> &opts = options();
diff --git a/src/plugins/platforms/windows/qwindowsdialoghelpers.h b/src/plugins/platforms/windows/qwindowsdialoghelpers.h
index 909ce5984e..8a06c35167 100644
--- a/src/plugins/platforms/windows/qwindowsdialoghelpers.h
+++ b/src/plugins/platforms/windows/qwindowsdialoghelpers.h
@@ -43,8 +43,8 @@
#define QWINDOWSDIALOGHELPER_H
#include "qtwindows_additional.h"
-#include <QtGui/QPlatformDialogHelper>
-#include <QtGui/QPlatformTheme>
+#include <qpa/qplatformdialoghelper.h>
+#include <qpa/qplatformtheme.h>
#include <QtCore/QStringList>
QT_BEGIN_NAMESPACE
@@ -66,8 +66,7 @@ class QWindowsDialogHelperBase : public BaseClass
{
public:
- virtual void platformNativeDialogModalHelp();
- virtual void _q_platformRunNativeAppModalPanel();
+ virtual void exec_sys();
virtual void deleteNativeDialog_sys();
virtual bool show_sys(Qt::WindowFlags windowFlags,
Qt::WindowModality windowModality,
@@ -75,8 +74,6 @@ public:
virtual void hide_sys();
virtual QVariant styleHint(QPlatformDialogHelper::StyleHint) const;
- virtual QPlatformDialogHelper::DialogCode dialogResultCode_sys();
-
virtual bool supportsNonModalDialog() const { return true; }
protected:
diff --git a/src/plugins/platforms/windows/qwindowsdrag.h b/src/plugins/platforms/windows/qwindowsdrag.h
index 7b629baccc..867093ab60 100644
--- a/src/plugins/platforms/windows/qwindowsdrag.h
+++ b/src/plugins/platforms/windows/qwindowsdrag.h
@@ -44,7 +44,7 @@
#include "qwindowsinternalmimedata.h"
-#include <QtGui/QPlatformDrag>
+#include <qpa/qplatformdrag.h>
#include <QtGui/QPixmap>
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/platforms/windows/qwindowsfontdatabase.h b/src/plugins/platforms/windows/qwindowsfontdatabase.h
index f442f492aa..6441e79177 100644
--- a/src/plugins/platforms/windows/qwindowsfontdatabase.h
+++ b/src/plugins/platforms/windows/qwindowsfontdatabase.h
@@ -42,7 +42,7 @@
#ifndef QWINDOWSFONTDATABASE_H
#define QWINDOWSFONTDATABASE_H
-#include <QtGui/QPlatformFontDatabase>
+#include <qpa/qplatformfontdatabase.h>
#include <QtCore/QSharedPointer>
#include "qtwindows_additional.h"
diff --git a/src/plugins/platforms/windows/qwindowsfontengine.cpp b/src/plugins/platforms/windows/qwindowsfontengine.cpp
index f4bd3f0c53..e367707ea3 100644
--- a/src/plugins/platforms/windows/qwindowsfontengine.cpp
+++ b/src/plugins/platforms/windows/qwindowsfontengine.cpp
@@ -227,7 +227,7 @@ int QWindowsFontEngine::getGlyphIndexes(const QChar *str, int numChars, QGlyphLa
if (symbol) {
for (; i < numChars; ++i, ++glyph_pos) {
unsigned int uc = getChar(str, i, numChars);
- glyphs->glyphs[i] = getTrueTypeGlyphIndex(cmap, uc);
+ glyphs->glyphs[glyph_pos] = getTrueTypeGlyphIndex(cmap, uc);
if(!glyphs->glyphs[glyph_pos] && uc < 0x100)
glyphs->glyphs[glyph_pos] = getTrueTypeGlyphIndex(cmap, uc + 0xf000);
}
diff --git a/src/plugins/platforms/windows/qwindowsglcontext.cpp b/src/plugins/platforms/windows/qwindowsglcontext.cpp
index f16a0ca73d..607dabc966 100644
--- a/src/plugins/platforms/windows/qwindowsglcontext.cpp
+++ b/src/plugins/platforms/windows/qwindowsglcontext.cpp
@@ -46,7 +46,7 @@
#include <QtCore/QDebug>
#include <QtCore/QSysInfo>
#include <QtGui/QGuiApplication>
-#include <QtGui/QPlatformNativeInterface>
+#include <qpa/qplatformnativeinterface.h>
#include <wingdi.h>
#include <GL/gl.h>
diff --git a/src/plugins/platforms/windows/qwindowsglcontext.h b/src/plugins/platforms/windows/qwindowsglcontext.h
index a0489e2d02..b83a57d13a 100644
--- a/src/plugins/platforms/windows/qwindowsglcontext.h
+++ b/src/plugins/platforms/windows/qwindowsglcontext.h
@@ -45,7 +45,7 @@
#include "array.h"
#include "qtwindows_additional.h"
-#include <QtGui/QPlatformOpenGLContext>
+#include <qpa/qplatformopenglcontext.h>
#include <QtGui/QOpenGLContext>
#include <QtCore/QSharedPointer>
diff --git a/src/plugins/platforms/windows/qwindowsinputcontext.h b/src/plugins/platforms/windows/qwindowsinputcontext.h
index 610bad08dd..134dfdbd2e 100644
--- a/src/plugins/platforms/windows/qwindowsinputcontext.h
+++ b/src/plugins/platforms/windows/qwindowsinputcontext.h
@@ -44,7 +44,7 @@
#include "qtwindows_additional.h"
-#include <QtGui/QPlatformInputContext>
+#include <qpa/qplatforminputcontext.h>
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/platforms/windows/qwindowsintegration.cpp b/src/plugins/platforms/windows/qwindowsintegration.cpp
index 45f6ecf652..255cf1454c 100644
--- a/src/plugins/platforms/windows/qwindowsintegration.cpp
+++ b/src/plugins/platforms/windows/qwindowsintegration.cpp
@@ -60,7 +60,7 @@
#include "accessible/qwindowsaccessibility.h"
#endif
-#include <QtGui/QPlatformNativeInterface>
+#include <qpa/qplatformnativeinterface.h>
#include <QtGui/QWindowSystemInterface>
#include <QtGui/QBackingStore>
#include <QtGui/private/qpixmap_raster_p.h>
@@ -244,8 +244,10 @@ QPlatformWindow *QWindowsIntegration::createPlatformWindow(QWindow *window) cons
= QWindowsWindow::WindowData::create(window, requested, window->windowTitle());
if (QWindowsContext::verboseIntegration || QWindowsContext::verboseWindows)
qDebug().nospace()
- << __FUNCTION__ << ' ' << window << '\n'
- << " Requested: " << requested.geometry << " Flags="
+ << __FUNCTION__ << '<' << window << '\n'
+ << " Requested: " << requested.geometry << "frame incl.: "
+ << QWindowsGeometryHint::positionIncludesFrame(window)
+ << " Flags="
<< QWindowsWindow::debugWindowFlags(requested.flags) << '\n'
<< " Obtained : " << obtained.geometry << " Margins "
<< obtained.frame << " Flags="
@@ -255,8 +257,6 @@ QPlatformWindow *QWindowsIntegration::createPlatformWindow(QWindow *window) cons
return 0;
if (requested.flags != obtained.flags)
window->setWindowFlags(obtained.flags);
- if (requested.geometry != obtained.geometry)
- QWindowSystemInterface::handleGeometryChange(window, obtained.geometry);
return new QWindowsWindow(window, obtained);
}
diff --git a/src/plugins/platforms/windows/qwindowsintegration.h b/src/plugins/platforms/windows/qwindowsintegration.h
index 84bbf6103a..76393be402 100644
--- a/src/plugins/platforms/windows/qwindowsintegration.h
+++ b/src/plugins/platforms/windows/qwindowsintegration.h
@@ -42,7 +42,7 @@
#ifndef QWINDOWSINTEGRATION_H
#define QWINDOWSINTEGRATION_H
-#include <QtGui/QPlatformIntegration>
+#include <qpa/qplatformintegration.h>
#include <QtCore/QScopedPointer>
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/platforms/windows/qwindowsscreen.cpp b/src/plugins/platforms/windows/qwindowsscreen.cpp
index 2476e15169..cc694fe0ea 100644
--- a/src/plugins/platforms/windows/qwindowsscreen.cpp
+++ b/src/plugins/platforms/windows/qwindowsscreen.cpp
@@ -59,7 +59,8 @@ QT_BEGIN_NAMESPACE
QWindowsScreenData::QWindowsScreenData() :
dpi(96, 96), depth(32), format(QImage::Format_ARGB32_Premultiplied),
- flags(VirtualDesktop), orientation(Qt::LandscapeOrientation)
+ flags(VirtualDesktop), orientation(Qt::LandscapeOrientation),
+ refreshRateHz(60)
{
}
@@ -103,6 +104,9 @@ BOOL QT_WIN_CALLBACK monitorEnumCallback(HMONITOR hMonitor, HDC, LPRECT, LPARAM
data.depth = GetDeviceCaps(hdc, BITSPIXEL);
data.format = data.depth == 16 ? QImage::Format_RGB16 : QImage::Format_RGB32;
data.physicalSizeMM = QSizeF(GetDeviceCaps(hdc, HORZSIZE), GetDeviceCaps(hdc, VERTSIZE));
+ const int refreshRate = GetDeviceCaps(hdc, VREFRESH);
+ if (refreshRate > 1) // 0,1 means heardware default.
+ data.refreshRateHz = refreshRate;
DeleteDC(hdc);
} else {
qWarning("%s: Unable to obtain handle for monitor '%s', defaulting to %g DPI.",
diff --git a/src/plugins/platforms/windows/qwindowsscreen.h b/src/plugins/platforms/windows/qwindowsscreen.h
index 5b9a50b2ab..615d4faf15 100644
--- a/src/plugins/platforms/windows/qwindowsscreen.h
+++ b/src/plugins/platforms/windows/qwindowsscreen.h
@@ -47,7 +47,7 @@
#include <QtCore/QList>
#include <QtCore/QPair>
#include <QtCore/QSharedPointer>
-#include <QtGui/QPlatformScreen>
+#include <qpa/qplatformscreen.h>
QT_BEGIN_NAMESPACE
@@ -70,6 +70,7 @@ struct QWindowsScreenData
unsigned flags;
QString name;
Qt::ScreenOrientation orientation;
+ qreal refreshRateHz;
};
class QWindowsScreen : public QPlatformScreen
@@ -87,6 +88,7 @@ public:
virtual QImage::Format format() const { return m_data.format; }
virtual QSizeF physicalSize() const { return m_data.physicalSizeMM; }
virtual QDpi logicalDpi() const { return m_data.dpi; }
+ virtual qreal refreshRate() const { return m_data.refreshRateHz; }
virtual QString name() const { return m_data.name; }
virtual Qt::ScreenOrientation primaryOrientation() { return m_data.orientation; }
virtual QList<QPlatformScreen *> virtualSiblings() const;
diff --git a/src/plugins/platforms/windows/qwindowsservices.h b/src/plugins/platforms/windows/qwindowsservices.h
index d979ed1af1..c9954b5257 100644
--- a/src/plugins/platforms/windows/qwindowsservices.h
+++ b/src/plugins/platforms/windows/qwindowsservices.h
@@ -42,7 +42,7 @@
#ifndef QWINDOWSDESKTOPSERVICES_H
#define QWINDOWSDESKTOPSERVICES_H
-#include <QtGui/qplatformservices_qpa.h>
+#include <qpa/qplatformservices.h>
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/platforms/windows/qwindowstheme.cpp b/src/plugins/platforms/windows/qwindowstheme.cpp
index 000311a807..63ed20eeef 100644
--- a/src/plugins/platforms/windows/qwindowstheme.cpp
+++ b/src/plugins/platforms/windows/qwindowstheme.cpp
@@ -296,6 +296,22 @@ static inline QStringList styleNames()
return result;
}
+static inline int uiEffects()
+{
+ int result = 0;
+ if (booleanSystemParametersInfo(SPI_GETUIEFFECTS, false))
+ result |= QPlatformTheme::GeneralUiEffect;
+ if (booleanSystemParametersInfo(SPI_GETMENUANIMATION, false))
+ result |= QPlatformTheme::AnimateMenuUiEffect;
+ if (booleanSystemParametersInfo(SPI_GETMENUFADE, false))
+ result |= QPlatformTheme::FadeMenuUiEffect;
+ if (booleanSystemParametersInfo(SPI_GETCOMBOBOXANIMATION, false))
+ result |= QPlatformTheme::AnimateComboUiEffect;
+ if (booleanSystemParametersInfo(SPI_GETTOOLTIPANIMATION, false))
+ result |= QPlatformTheme::AnimateTooltipUiEffect;
+ return result;
+}
+
QVariant QWindowsTheme::themeHint(ThemeHint hint) const
{
switch (hint) {
@@ -315,6 +331,8 @@ QVariant QWindowsTheme::themeHint(ThemeHint hint) const
return QVariant(qRound(qreal(QWindowsContext::instance()->defaultDPI()) * 1.375));
case KeyboardScheme:
return QVariant(int(WindowsKeyboardScheme));
+ case UiEffects:
+ return QVariant(uiEffects());
default:
break;
}
diff --git a/src/plugins/platforms/windows/qwindowstheme.h b/src/plugins/platforms/windows/qwindowstheme.h
index 7515a13a72..223a98caf5 100644
--- a/src/plugins/platforms/windows/qwindowstheme.h
+++ b/src/plugins/platforms/windows/qwindowstheme.h
@@ -42,7 +42,7 @@
#ifndef QWINDOWSTHEME_H
#define QWINDOWSTHEME_H
-#include <QtGui/QPlatformTheme>
+#include <qpa/qplatformtheme.h>
#include <QtGui/QColor>
#include "qtwindows_additional.h"
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp
index 87980487b7..c300f0f5a9 100644
--- a/src/plugins/platforms/windows/qwindowswindow.cpp
+++ b/src/plugins/platforms/windows/qwindowswindow.cpp
@@ -542,6 +542,12 @@ void QWindowsGeometryHint::applyToMinMaxInfo(DWORD style, DWORD exStyle, MINMAXI
<< " out " << *mmi;
}
+bool QWindowsGeometryHint::positionIncludesFrame(const QWindow *w)
+{
+ return qt_window_private(const_cast<QWindow *>(w))->positionPolicy
+ == QWindowPrivate::WindowFrameInclusive;
+}
+
/*!
\class QWindowCreationContext
\brief Active Context for creating windows.
@@ -576,17 +582,24 @@ QWindowCreationContext::QWindowCreationContext(const QWindow *w,
// CW_USEDEFAULT unless set. For now, assume that 0,0 means 'default'
// for toplevels.
if (geometry.isValid()) {
- if (!w->isTopLevel() || geometry.y() >= margins.top()) {
- frameX = geometry.x() - margins.left();
- frameY = geometry.y() - margins.top();
+ frameX = geometry.x();
+ frameY = geometry.y();
+ frameWidth = margins.left() + geometry.width() + margins.right();
+ frameHeight = margins.top() + geometry.height() + margins.bottom();
+ const bool isDefaultPosition = !frameX && !frameY && w->isTopLevel();
+ if (!QWindowsGeometryHint::positionIncludesFrame(w) && !isDefaultPosition) {
+ frameX -= margins.left();
+ frameY -= margins.top();
}
- frameWidth = geometry.width() + margins.left() + margins.right();
- frameHeight = geometry.height() + margins.top() + margins.bottom();
}
if (QWindowsContext::verboseWindows)
qDebug().nospace()
- << __FUNCTION__ << ' ' << w << " min" << geometryHint.minimumSize
- << " min" << geometryHint.maximumSize;
+ << __FUNCTION__ << ' ' << w << geometry
+ << " pos incl. frame" << QWindowsGeometryHint::positionIncludesFrame(w)
+ << " frame: " << frameWidth << 'x' << frameHeight << '+'
+ << frameX << '+' << frameY
+ << " min" << geometryHint.minimumSize
+ << " max" << geometryHint.maximumSize;
}
/*!
@@ -819,7 +832,7 @@ void QWindowsWindow::setGeometry(const QRect &rectIn)
QRect rect = rectIn;
// This means it is a call from QWindow::setFramePos() and
// the coordinates include the frame (size is still the contents rectangle).
- if (qt_window_private(window())->positionPolicy == QWindowPrivate::WindowFrameInclusive) {
+ if (QWindowsGeometryHint::positionIncludesFrame(window())) {
const QMargins margins = frameMargins();
rect.moveTopLeft(rect.topLeft() + QPoint(margins.left(), margins.top()));
}
@@ -1004,21 +1017,30 @@ Qt::WindowFlags QWindowsWindow::setWindowFlags(Qt::WindowFlags flags)
qDebug() << '>' << __FUNCTION__ << this << window() << "\n from: "
<< QWindowsWindow::debugWindowFlags(m_data.flags)
<< "\n to: " << QWindowsWindow::debugWindowFlags(flags);
+ const QRect oldGeometry = geometry();
if (m_data.flags != flags) {
m_data.flags = flags;
if (m_data.hwnd)
m_data = setWindowFlags_sys(flags);
}
+ // When switching to a frameless window, geometry
+ // may change without a WM_MOVE. Report change manually.
+ // Do not send synchronously as not to clobber the widget
+ // geometry in a sequence of setting flags and geometry.
+ const QRect newGeometry = geometry_sys();
+ if (oldGeometry != newGeometry)
+ handleGeometryChange();
+
if (QWindowsContext::verboseWindows)
qDebug() << '<' << __FUNCTION__ << "\n returns: "
- << QWindowsWindow::debugWindowFlags(m_data.flags);
+ << QWindowsWindow::debugWindowFlags(m_data.flags)
+ << " geometry " << oldGeometry << "->" << newGeometry;
return m_data.flags;
}
QWindowsWindow::WindowData QWindowsWindow::setWindowFlags_sys(Qt::WindowFlags wt,
unsigned flags) const
{
- // Geometry changes have not been observed here. Frames change, though.
WindowCreationData creationData;
creationData.fromWindow(window(), wt, flags);
creationData.applyWindowFlags(m_data.hwnd);
diff --git a/src/plugins/platforms/windows/qwindowswindow.h b/src/plugins/platforms/windows/qwindowswindow.h
index badc229718..64fd78d1ce 100644
--- a/src/plugins/platforms/windows/qwindowswindow.h
+++ b/src/plugins/platforms/windows/qwindowswindow.h
@@ -45,7 +45,7 @@
#include "qtwindows_additional.h"
#include "qwindowscursor.h"
-#include <QtGui/QPlatformWindow>
+#include <qpa/qplatformwindow.h>
QT_BEGIN_NAMESPACE
@@ -66,6 +66,8 @@ struct QWindowsGeometryHint
static inline QPoint mapFromGlobal(const HWND hwnd, const QPoint &);
static inline QPoint mapFromGlobal(const QWindow *w, const QPoint &);
+ static bool positionIncludesFrame(const QWindow *w);
+
QSize minimumSize;
QSize maximumSize;
};
diff --git a/src/plugins/platforms/xcb/README b/src/plugins/platforms/xcb/README
index eede0cc149..14e98b8145 100644
--- a/src/plugins/platforms/xcb/README
+++ b/src/plugins/platforms/xcb/README
@@ -1,8 +1,8 @@
Requires libxcb >= 1.5.
Required packages:
-libxcb1 libxcb1-dev libx11-xcb1 libx11-xcb-dev libxcb-keysyms1 libxcb-keysyms1-dev libxcb-image0 libxcb-image0-dev libxcb-shm0 libxcb-shm0-dev libxcb-icccm1 libxcb-icccm1-dev libxcb-sync0 libxcb-sync0-dev libxcb-render-util0 libxcb-render-util0-dev libxcb-xfixes0-dev libxrender-dev libxcb-shape0-dev
+libxcb1 libxcb1-dev libx11-xcb1 libx11-xcb-dev libxcb-keysyms1 libxcb-keysyms1-dev libxcb-image0 libxcb-image0-dev libxcb-shm0 libxcb-shm0-dev libxcb-icccm1 libxcb-icccm1-dev libxcb-sync0 libxcb-sync0-dev libxcb-render-util0 libxcb-render-util0-dev libxcb-xfixes0-dev libxrender-dev libxcb-shape0-dev libxcb-randr0-dev
On Ubuntu 11.10 icccm1 is replaced by icccm4 and xcb-render-util is not available:
-libxcb1 libxcb1-dev libx11-xcb1 libx11-xcb-dev libxcb-keysyms1 libxcb-keysyms1-dev libxcb-image0 libxcb-image0-dev libxcb-shm0 libxcb-shm0-dev libxcb-icccm4 libxcb-icccm4-dev libxcb-sync0 libxcb-sync0-dev libxcb-xfixes0-dev libxrender-dev libxcb-shape0-dev
+libxcb1 libxcb1-dev libx11-xcb1 libx11-xcb-dev libxcb-keysyms1 libxcb-keysyms1-dev libxcb-image0 libxcb-image0-dev libxcb-shm0 libxcb-shm0-dev libxcb-icccm4 libxcb-icccm4-dev libxcb-sync0 libxcb-sync0-dev libxcb-xfixes0-dev libxrender-dev libxcb-shape0-dev libxcb-randr0-dev
The packages for xcb-render-util can be installed manually from http://packages.ubuntu.com/natty/libxcb-render-util0 and http://packages.ubuntu.com/natty/libxcb-render-util0-dev
diff --git a/src/plugins/platforms/xcb/main.cpp b/src/plugins/platforms/xcb/main.cpp
index 50c5a1a017..4474a474fd 100644
--- a/src/plugins/platforms/xcb/main.cpp
+++ b/src/plugins/platforms/xcb/main.cpp
@@ -39,7 +39,7 @@
**
****************************************************************************/
-#include <QtGui/QPlatformIntegrationPlugin>
+#include <qpa/qplatformintegrationplugin.h>
#include "qxcbintegration.h"
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/platforms/xcb/qdri2context.h b/src/plugins/platforms/xcb/qdri2context.h
index d0a1b469a9..8945744b22 100644
--- a/src/plugins/platforms/xcb/qdri2context.h
+++ b/src/plugins/platforms/xcb/qdri2context.h
@@ -42,7 +42,7 @@
#ifndef QDRI2CONTEXT_H
#define QDRI2CONTEXT_H
-#include <QtGui/QPlatformOpenGLContext>
+#include <qpa/qplatformopenglcontext.h>
struct xcb_dri2_dri2_buffer_t;
diff --git a/src/plugins/platforms/xcb/qglxintegration.h b/src/plugins/platforms/xcb/qglxintegration.h
index dce9193eba..8d114b75db 100644
--- a/src/plugins/platforms/xcb/qglxintegration.h
+++ b/src/plugins/platforms/xcb/qglxintegration.h
@@ -45,7 +45,7 @@
#include "qxcbwindow.h"
#include "qxcbscreen.h"
-#include <QtGui/QPlatformOpenGLContext>
+#include <qpa/qplatformopenglcontext.h>
#include <QtGui/QSurfaceFormat>
#include <QtCore/QMutex>
diff --git a/src/plugins/platforms/xcb/qxcbbackingstore.h b/src/plugins/platforms/xcb/qxcbbackingstore.h
index e02c6eb15b..b66a27470e 100644
--- a/src/plugins/platforms/xcb/qxcbbackingstore.h
+++ b/src/plugins/platforms/xcb/qxcbbackingstore.h
@@ -42,7 +42,7 @@
#ifndef QXCBBACKINGSTORE_H
#define QXCBBACKINGSTORE_H
-#include <qplatformbackingstore_qpa.h>
+#include <qpa/qplatformbackingstore.h>
#include <xcb/xcb.h>
diff --git a/src/plugins/platforms/xcb/qxcbclipboard.h b/src/plugins/platforms/xcb/qxcbclipboard.h
index a43518e80b..1b3f12b279 100644
--- a/src/plugins/platforms/xcb/qxcbclipboard.h
+++ b/src/plugins/platforms/xcb/qxcbclipboard.h
@@ -42,7 +42,7 @@
#ifndef QXCBCLIPBOARD_H
#define QXCBCLIPBOARD_H
-#include <QPlatformClipboard>
+#include <qpa/qplatformclipboard.h>
#include <qxcbobject.h>
#include <xcb/xcb.h>
#include <xcb/xfixes.h>
diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp
index 76979bf05f..728dd1dd00 100644
--- a/src/plugins/platforms/xcb/qxcbconnection.cpp
+++ b/src/plugins/platforms/xcb/qxcbconnection.cpp
@@ -60,6 +60,7 @@
#include <stdio.h>
#include <errno.h>
#include <xcb/xfixes.h>
+#include <xcb/randr.h>
#ifdef XCB_USE_XLIB
#include <X11/Xlib.h>
@@ -109,7 +110,9 @@ QXcbConnection::QXcbConnection(QXcbNativeInterface *nativeInterface, const char
, m_has_support_for_dri2(false)
#endif
, xfixes_first_event(0)
+ , xrandr_first_event(0)
, has_shape_extension(false)
+ , has_randr_extension(false)
, has_input_shape(false)
{
m_primaryScreen = 0;
@@ -160,6 +163,8 @@ QXcbConnection::QXcbConnection(QXcbNativeInterface *nativeInterface, const char
xcb_screen_iterator_t it = xcb_setup_roots_iterator(m_setup);
+ initializeXRandr();
+
int screenNumber = 0;
while (it.rem) {
m_screens << new QXcbScreen(this, it.data, screenNumber++);
@@ -586,6 +591,15 @@ void QXcbConnection::handleXcbEvent(xcb_generic_event_t *event)
setTime(((xcb_xfixes_selection_notify_event_t *)event)->timestamp);
m_clipboard->handleXFixesSelectionRequest((xcb_xfixes_selection_notify_event_t *)event);
handled = true;
+ } else if (has_randr_extension && response_type == xrandr_first_event + XCB_RANDR_SCREEN_CHANGE_NOTIFY) {
+ xcb_randr_screen_change_notify_event_t *change_event = (xcb_randr_screen_change_notify_event_t *)event;
+ foreach (QXcbScreen *s, m_screens) {
+ if (s->root() == change_event->root ) {
+ s->updateRefreshRate();
+ break;
+ }
+ }
+ handled = true;
}
}
@@ -1060,6 +1074,31 @@ void QXcbConnection::initializeXRender()
#endif
}
+void QXcbConnection::initializeXRandr()
+{
+ const xcb_query_extension_reply_t *xrandr_reply = xcb_get_extension_data(m_connection, &xcb_randr_id);
+ if (!xrandr_reply || !xrandr_reply->present)
+ return;
+
+ xrandr_first_event = xrandr_reply->first_event;
+
+ xcb_generic_error_t *error = 0;
+ xcb_randr_query_version_cookie_t xrandr_query_cookie = xcb_randr_query_version(m_connection,
+ XCB_RANDR_MAJOR_VERSION,
+ XCB_RANDR_MINOR_VERSION);
+
+ has_randr_extension = true;
+
+ xcb_randr_query_version_reply_t *xrandr_query = xcb_randr_query_version_reply(m_connection,
+ xrandr_query_cookie, &error);
+ if (!xrandr_query || error || (xrandr_query->major_version < 1 || (xrandr_query->major_version == 1 && xrandr_query->minor_version < 2))) {
+ qWarning("QXcbConnection: Failed to initialize XRandr");
+ free(error);
+ has_randr_extension = false;
+ }
+ free(xrandr_query);
+}
+
void QXcbConnection::initializeXShape()
{
const xcb_query_extension_reply_t *xshape_reply = xcb_get_extension_data(m_connection, &xcb_shape_id);
diff --git a/src/plugins/platforms/xcb/qxcbconnection.h b/src/plugins/platforms/xcb/qxcbconnection.h
index 34943bfdef..86eaf5d7d9 100644
--- a/src/plugins/platforms/xcb/qxcbconnection.h
+++ b/src/plugins/platforms/xcb/qxcbconnection.h
@@ -355,6 +355,7 @@ public:
bool hasXFixes() const { return xfixes_first_event > 0; }
bool hasXShape() const { return has_shape_extension; }
+ bool hasXRandr() const { return has_randr_extension; }
bool hasInputShape() const { return has_input_shape; }
private slots:
@@ -365,6 +366,7 @@ private:
void sendConnectionEvent(QXcbAtom::Atom atom, uint id = 0);
void initializeXFixes();
void initializeXRender();
+ void initializeXRandr();
void initializeXShape();
#ifdef XCB_USE_DRI2
void initializeDri2();
@@ -432,8 +434,10 @@ private:
QVector<PeekFunc> m_peekFuncs;
uint32_t xfixes_first_event;
+ uint32_t xrandr_first_event;
bool has_shape_extension;
+ bool has_randr_extension;
bool has_input_shape;
};
diff --git a/src/plugins/platforms/xcb/qxcbcursor.h b/src/plugins/platforms/xcb/qxcbcursor.h
index da243424d5..80fb88b39d 100644
--- a/src/plugins/platforms/xcb/qxcbcursor.h
+++ b/src/plugins/platforms/xcb/qxcbcursor.h
@@ -42,7 +42,7 @@
#ifndef QXCBCURSOR_H
#define QXCBCURSOR_H
-#include <QtGui/QPlatformCursor>
+#include <qpa/qplatformcursor.h>
#include "qxcbscreen.h"
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/platforms/xcb/qxcbdrag.h b/src/plugins/platforms/xcb/qxcbdrag.h
index 710a07a5a4..2f74b3eaf7 100644
--- a/src/plugins/platforms/xcb/qxcbdrag.h
+++ b/src/plugins/platforms/xcb/qxcbdrag.h
@@ -42,7 +42,7 @@
#ifndef QXCBDRAG_H
#define QXCBDRAG_H
-#include <qplatformdrag_qpa.h>
+#include <qpa/qplatformdrag.h>
#include <QtPlatformSupport/private/qsimpledrag_p.h>
#include <qxcbobject.h>
#include <xcb/xcb.h>
diff --git a/src/plugins/platforms/xcb/qxcbintegration.cpp b/src/plugins/platforms/xcb/qxcbintegration.cpp
index 2d3971de69..8dba6e1464 100644
--- a/src/plugins/platforms/xcb/qxcbintegration.cpp
+++ b/src/plugins/platforms/xcb/qxcbintegration.cpp
@@ -68,9 +68,9 @@
#include <X11/Xlib.h>
#endif
-#include <private/qplatforminputcontextfactory_qpa_p.h>
+#include <qpa/qplatforminputcontextfactory_p.h>
#include <private/qgenericunixthemes_p.h>
-#include <qplatforminputcontext_qpa.h>
+#include <qpa/qplatforminputcontext.h>
#if defined(XCB_USE_GLX)
#include "qglxintegration.h"
@@ -82,7 +82,7 @@
#include <QtGui/QOpenGLContext>
#include <QtGui/QScreen>
#ifndef QT_NO_ACCESSIBILITY
-#include <QtGui/QPlatformAccessibility>
+#include <qpa/qplatformaccessibility.h>
#endif
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/platforms/xcb/qxcbintegration.h b/src/plugins/platforms/xcb/qxcbintegration.h
index 6170232d1e..b2245e4de0 100644
--- a/src/plugins/platforms/xcb/qxcbintegration.h
+++ b/src/plugins/platforms/xcb/qxcbintegration.h
@@ -42,8 +42,8 @@
#ifndef QXCBINTEGRATION_H
#define QXCBINTEGRATION_H
-#include <QtGui/QPlatformIntegration>
-#include <QtGui/QPlatformScreen>
+#include <qpa/qplatformintegration.h>
+#include <qpa/qplatformscreen.h>
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/platforms/xcb/qxcbkeyboard.cpp b/src/plugins/platforms/xcb/qxcbkeyboard.cpp
index ef98f82e97..9bd4c9ccdf 100644
--- a/src/plugins/platforms/xcb/qxcbkeyboard.cpp
+++ b/src/plugins/platforms/xcb/qxcbkeyboard.cpp
@@ -49,8 +49,8 @@
#include <private/qguiapplication_p.h>
#include <stdio.h>
-#include <qplatforminputcontext_qpa.h>
-#include <qplatformintegration_qpa.h>
+#include <qpa/qplatforminputcontext.h>
+#include <qpa/qplatformintegration.h>
#ifndef XK_ISO_Left_Tab
#define XK_ISO_Left_Tab 0xFE20
diff --git a/src/plugins/platforms/xcb/qxcbnativeinterface.h b/src/plugins/platforms/xcb/qxcbnativeinterface.h
index c6835ff9e0..354ef76799 100644
--- a/src/plugins/platforms/xcb/qxcbnativeinterface.h
+++ b/src/plugins/platforms/xcb/qxcbnativeinterface.h
@@ -42,7 +42,7 @@
#ifndef QXCBNATIVEINTERFACE_H
#define QXCBNATIVEINTERFACE_H
-#include <QtGui/QPlatformNativeInterface>
+#include <qpa/qplatformnativeinterface.h>
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/platforms/xcb/qxcbscreen.cpp b/src/plugins/platforms/xcb/qxcbscreen.cpp
index ae5e4cce34..fbfaa894eb 100644
--- a/src/plugins/platforms/xcb/qxcbscreen.cpp
+++ b/src/plugins/platforms/xcb/qxcbscreen.cpp
@@ -48,13 +48,23 @@
#include <QDebug>
+#include <xcb/randr.h>
+
+#include <QtGui/QWindowSystemInterface>
+
QT_BEGIN_NAMESPACE
QXcbScreen::QXcbScreen(QXcbConnection *connection, xcb_screen_t *screen, int number)
: QXcbObject(connection)
, m_screen(screen)
, m_number(number)
+ , m_refreshRate(60)
{
+ if (connection->hasXRandr())
+ xcb_randr_select_input(xcb_connection(), screen->root, true);
+
+ updateRefreshRate();
+
#ifdef Q_XCB_DEBUG
qDebug();
qDebug("Information of screen %d:", screen->root);
@@ -63,6 +73,7 @@ QXcbScreen::QXcbScreen(QXcbConnection *connection, xcb_screen_t *screen, int num
qDebug(" depth.........: %d", screen->root_depth);
qDebug(" white pixel...: %x", screen->white_pixel);
qDebug(" black pixel...: %x", screen->black_pixel);
+ qDebug(" refresh rate...: %d", m_refreshRate);
qDebug();
#endif
@@ -228,6 +239,34 @@ QPlatformCursor *QXcbScreen::cursor() const
return m_cursor;
}
+qreal QXcbScreen::refreshRate() const
+{
+ return m_refreshRate;
+}
+
+void QXcbScreen::updateRefreshRate()
+{
+ if (!connection()->hasXRandr())
+ return;
+
+ int rate = m_refreshRate;
+
+ xcb_randr_get_screen_info_reply_t *screenInfoReply =
+ xcb_randr_get_screen_info_reply(xcb_connection(), xcb_randr_get_screen_info_unchecked(xcb_connection(), m_screen->root), 0);
+
+ if (screenInfoReply) {
+ rate = screenInfoReply->rate;
+ free(screenInfoReply);
+ }
+
+ if (rate == m_refreshRate)
+ return;
+
+ m_refreshRate = rate;
+
+ QWindowSystemInterface::handleScreenRefreshRateChange(QPlatformScreen::screen(), rate);
+}
+
int QXcbScreen::screenNumber() const
{
return m_number;
diff --git a/src/plugins/platforms/xcb/qxcbscreen.h b/src/plugins/platforms/xcb/qxcbscreen.h
index ac4ecb1c8d..7a81d8b43a 100644
--- a/src/plugins/platforms/xcb/qxcbscreen.h
+++ b/src/plugins/platforms/xcb/qxcbscreen.h
@@ -42,7 +42,7 @@
#ifndef QXCBSCREEN_H
#define QXCBSCREEN_H
-#include <QtGui/QPlatformScreen>
+#include <qpa/qplatformscreen.h>
#include <QtCore/QString>
#include <xcb/xcb.h>
@@ -69,6 +69,7 @@ public:
QImage::Format format() const;
QSizeF physicalSize() const;
QPlatformCursor *cursor() const;
+ qreal refreshRate() const;
int screenNumber() const;
@@ -84,6 +85,8 @@ public:
QString name() const;
+ void updateRefreshRate();
+
private:
xcb_screen_t *m_screen;
int m_number;
@@ -92,6 +95,7 @@ private:
xcb_window_t m_clientLeader;
QMap<xcb_visualid_t, xcb_visualtype_t> m_visuals;
QXcbCursor *m_cursor;
+ int m_refreshRate;
};
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp
index ffce2f3956..93f1159546 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.cpp
+++ b/src/plugins/platforms/xcb/qxcbwindow.cpp
@@ -50,7 +50,7 @@
#include "qxcbkeyboard.h"
#include "qxcbwmsupport.h"
-#include <qplatformintegration_qpa.h>
+#include <qpa/qplatformintegration.h>
#ifdef XCB_USE_DRI2
#include "qdri2context.h"
@@ -87,7 +87,7 @@
#include <private/qguiapplication_p.h>
#include <private/qwindow_p.h>
-#include <QtGui/QPlatformBackingStore>
+#include <qpa/qplatformbackingstore.h>
#include <QtGui/QWindowSystemInterface>
#include <stdio.h>
@@ -138,10 +138,16 @@ static inline QImage::Format imageFormatForDepth(int depth)
}
}
+static inline bool positionIncludesFrame(QWindow *w)
+{
+ return qt_window_private(w)->positionPolicy == QWindowPrivate::WindowFrameInclusive;
+}
+
QXcbWindow::QXcbWindow(QWindow *window)
: QPlatformWindow(window)
, m_window(0)
, m_syncCounter(0)
+ , m_gravity(XCB_GRAVITY_STATIC)
, m_mapped(false)
, m_transparent(false)
, m_deferredActivation(false)
@@ -176,6 +182,11 @@ void QXcbWindow::create()
return;
}
+ // Determine gravity from initial position. Do not change
+ // later as it will cause the window to move uncontrollably.
+ m_gravity = positionIncludesFrame(window()) ?
+ XCB_GRAVITY_NORTH_WEST : XCB_GRAVITY_STATIC;
+
const quint32 mask = XCB_CW_BACK_PIXMAP | XCB_CW_OVERRIDE_REDIRECT | XCB_CW_SAVE_UNDER | XCB_CW_EVENT_MASK;
const quint32 values[] = {
// XCB_CW_BACK_PIXMAP
@@ -199,6 +210,9 @@ void QXcbWindow::create()
| XCB_EVENT_MASK_FOCUS_CHANGE
};
+ // Parameters to XCreateWindow() are frame corner + inner size.
+ // This fits in case position policy is frame inclusive. There is
+ // currently no way to implement it for frame-exclusive geometries.
QRect rect = window()->geometry();
QPlatformWindow::setGeometry(rect);
@@ -398,13 +412,14 @@ void QXcbWindow::setGeometry(const QRect &rect)
QPlatformWindow::setGeometry(rect);
propagateSizeHints();
+ const QRect wmGeometry = windowToWmGeometry(rect);
const quint32 mask = XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y | XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT;
const qint32 values[] = {
- qBound<qint32>(-XCOORD_MAX, rect.x(), XCOORD_MAX),
- qBound<qint32>(-XCOORD_MAX, rect.y(), XCOORD_MAX),
- qBound<qint32>(1, rect.width(), XCOORD_MAX),
- qBound<qint32>(1, rect.height(), XCOORD_MAX),
+ qBound<qint32>(-XCOORD_MAX, wmGeometry.x(), XCOORD_MAX),
+ qBound<qint32>(-XCOORD_MAX, wmGeometry.y(), XCOORD_MAX),
+ qBound<qint32>(1, wmGeometry.width(), XCOORD_MAX),
+ qBound<qint32>(1, wmGeometry.height(), XCOORD_MAX),
};
Q_XCB_CALL(xcb_configure_window(xcb_connection(), m_window, mask, reinterpret_cast<const quint32*>(values)));
@@ -1118,20 +1133,36 @@ void QXcbWindow::lower()
Q_XCB_CALL(xcb_configure_window(xcb_connection(), m_window, mask, values));
}
+// Adapt the geometry to match the WM expection with regards
+// to gravity.
+QRect QXcbWindow::windowToWmGeometry(QRect r) const
+{
+ if (m_dirtyFrameMargins || m_frameMargins.isNull())
+ return r;
+ const bool frameInclusive = positionIncludesFrame(window());
+ // XCB_GRAVITY_STATIC requires the inner geometry, whereas
+ // XCB_GRAVITY_NORTH_WEST requires the frame geometry
+ if (frameInclusive && m_gravity == XCB_GRAVITY_STATIC) {
+ r.translate(m_frameMargins.left(), m_frameMargins.top());
+ } else if (!frameInclusive && m_gravity == XCB_GRAVITY_NORTH_WEST) {
+ r.translate(-m_frameMargins.left(), -m_frameMargins.top());
+ }
+ return r;
+}
+
void QXcbWindow::propagateSizeHints()
{
// update WM_NORMAL_HINTS
xcb_size_hints_t hints;
memset(&hints, 0, sizeof(hints));
- QRect rect = geometry();
+ const QRect rect = windowToWmGeometry(geometry());
QWindow *win = window();
xcb_size_hints_set_position(&hints, true, rect.x(), rect.y());
xcb_size_hints_set_size(&hints, true, rect.width(), rect.height());
- xcb_size_hints_set_win_gravity(&hints, qt_window_private(win)->positionPolicy == QWindowPrivate::WindowFrameInclusive
- ? XCB_GRAVITY_NORTH_WEST : XCB_GRAVITY_STATIC);
+ xcb_size_hints_set_win_gravity(&hints, m_gravity);
QSize minimumSize = win->minimumSize();
QSize maximumSize = win->maximumSize();
diff --git a/src/plugins/platforms/xcb/qxcbwindow.h b/src/plugins/platforms/xcb/qxcbwindow.h
index 523dd559c1..43eb9e8639 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.h
+++ b/src/plugins/platforms/xcb/qxcbwindow.h
@@ -42,7 +42,7 @@
#ifndef QXCBWINDOW_H
#define QXCBWINDOW_H
-#include <QtGui/QPlatformWindow>
+#include <qpa/qplatformwindow.h>
#include <QtGui/QSurfaceFormat>
#include <QtGui/QImage>
@@ -148,6 +148,8 @@ private:
void setTransparentForMouseEvents(bool transparent);
void updateDoesNotAcceptFocus(bool doesNotAcceptFocus);
+ QRect windowToWmGeometry(QRect r) const;
+
void create();
void destroy();
@@ -166,6 +168,8 @@ private:
Qt::WindowState m_windowState;
+ xcb_gravity_t m_gravity;
+
bool m_mapped;
bool m_transparent;
bool m_deferredActivation;
diff --git a/src/plugins/platforms/xcb/xcb.pro b/src/plugins/platforms/xcb/xcb.pro
index 0da5fb1674..210b770a51 100644
--- a/src/plugins/platforms/xcb/xcb.pro
+++ b/src/plugins/platforms/xcb/xcb.pro
@@ -91,7 +91,7 @@ contains(DEFINES, XCB_USE_DRI2) {
}
}
-LIBS += -lxcb -lxcb-image -lxcb-keysyms -lxcb-icccm -lxcb-sync -lxcb-xfixes -lxcb-shape -lxcb-shm
+LIBS += -lxcb -lxcb-image -lxcb-keysyms -lxcb-icccm -lxcb-sync -lxcb-xfixes -lxcb-shape -lxcb-shm -lxcb-randr
DEFINES += $$QMAKE_DEFINES_XCB
LIBS += $$QMAKE_LIBS_XCB
diff --git a/src/plugins/printsupport/cocoa/cocoa.pro b/src/plugins/printsupport/cocoa/cocoa.pro
index 353094cbae..477715a8e2 100644
--- a/src/plugins/printsupport/cocoa/cocoa.pro
+++ b/src/plugins/printsupport/cocoa/cocoa.pro
@@ -2,7 +2,7 @@ TARGET = cocoaprintersupport
load(qt_plugin)
DESTDIR = $$QT.gui.plugins/printsupport
-QT += printsupport
+QT += gui-private printsupport-private
LIBS += -framework Cocoa
SOURCES += main.cpp
diff --git a/src/plugins/printsupport/cocoa/main.cpp b/src/plugins/printsupport/cocoa/main.cpp
index bc8f2e072c..12918974f3 100644
--- a/src/plugins/printsupport/cocoa/main.cpp
+++ b/src/plugins/printsupport/cocoa/main.cpp
@@ -41,8 +41,8 @@
#include <QtCore/QMetaMethod>
#include <QtGui/QGuiApplication>
-#include <QtGui/QPlatformNativeInterface>
-#include <QtPrintSupport/QPlatformPrinterSupportPlugin>
+#include <qpa/qplatformnativeinterface.h>
+#include <qpa/qplatformprintplugin.h>
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/printsupport/windows/main.cpp b/src/plugins/printsupport/windows/main.cpp
index e29705a8a7..7ddb89212b 100644
--- a/src/plugins/printsupport/windows/main.cpp
+++ b/src/plugins/printsupport/windows/main.cpp
@@ -40,7 +40,7 @@
****************************************************************************/
-#include <QtPrintSupport/qplatformprintplugin_qpa.h>
+#include <qpa/qplatformprintplugin.h>
#include <QtCore/QStringList>
#include "qwindowsprintersupport.h"
diff --git a/src/plugins/printsupport/windows/qwindowsprintersupport.h b/src/plugins/printsupport/windows/qwindowsprintersupport.h
index 35d794aaea..be8758a1bd 100644
--- a/src/plugins/printsupport/windows/qwindowsprintersupport.h
+++ b/src/plugins/printsupport/windows/qwindowsprintersupport.h
@@ -43,7 +43,7 @@
#define WINDOWSPRINTERSUPPORT_H
#include <QtCore/QList>
-#include <QtPrintSupport/QPlatformPrinterSupport>
+#include <qpa/qplatformprintersupport.h>
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
diff --git a/src/printsupport/dialogs/qpagesetupdialog_mac.mm b/src/printsupport/dialogs/qpagesetupdialog_mac.mm
index 1dded4f905..3e84423fd8 100644
--- a/src/printsupport/dialogs/qpagesetupdialog_mac.mm
+++ b/src/printsupport/dialogs/qpagesetupdialog_mac.mm
@@ -46,7 +46,7 @@
#include "qpagesetupdialog.h"
#include "qabstractpagesetupdialog_p.h"
-#include <QtGui/qplatformnativeinterface_qpa.h>
+#include <qpa/qplatformnativeinterface.h>
#include <QtPrintSupport/qprintengine.h>
QT_USE_NAMESPACE
diff --git a/src/printsupport/dialogs/qpagesetupdialog_win.cpp b/src/printsupport/dialogs/qpagesetupdialog_win.cpp
index 9d7387edba..cb69d0400f 100644
--- a/src/printsupport/dialogs/qpagesetupdialog_win.cpp
+++ b/src/printsupport/dialogs/qpagesetupdialog_win.cpp
@@ -47,7 +47,7 @@
#include "../kernel/qprintengine_win_p.h"
#include "qabstractpagesetupdialog_p.h"
#include "qprinter.h"
-#include <QtGui/qplatformnativeinterface_qpa.h>
+#include <qpa/qplatformnativeinterface.h>
QT_BEGIN_NAMESPACE
diff --git a/src/printsupport/kernel/kernel.pri b/src/printsupport/kernel/kernel.pri
index d7c9f56545..10d9f877a0 100644
--- a/src/printsupport/kernel/kernel.pri
+++ b/src/printsupport/kernel/kernel.pri
@@ -6,8 +6,8 @@ HEADERS += \
$$PWD/qprinter_p.h \
$$PWD/qprinterinfo.h \
$$PWD/qprinterinfo_p.h \
- $$PWD/qplatformprintplugin_qpa.h \
- $$PWD/qplatformprintersupport_qpa.h
+ $$PWD/qplatformprintplugin.h \
+ $$PWD/qplatformprintersupport.h
SOURCES += \
$$PWD/qpaintengine_alpha.cpp \
diff --git a/src/printsupport/kernel/qplatformprintersupport_qpa.h b/src/printsupport/kernel/qplatformprintersupport.h
index 5dba56579c..5dba56579c 100644
--- a/src/printsupport/kernel/qplatformprintersupport_qpa.h
+++ b/src/printsupport/kernel/qplatformprintersupport.h
diff --git a/src/printsupport/kernel/qplatformprintersupport_qpa.cpp b/src/printsupport/kernel/qplatformprintersupport_qpa.cpp
index 1ed28b8090..9c0c3f131c 100644
--- a/src/printsupport/kernel/qplatformprintersupport_qpa.cpp
+++ b/src/printsupport/kernel/qplatformprintersupport_qpa.cpp
@@ -39,7 +39,7 @@
**
****************************************************************************/
-#include "qplatformprintersupport_qpa.h"
+#include "qplatformprintersupport.h"
#include <QtPrintSupport/qprinterinfo.h>
diff --git a/src/printsupport/kernel/qplatformprintplugin.cpp b/src/printsupport/kernel/qplatformprintplugin.cpp
index 2c87fcc5e6..854d8810cc 100644
--- a/src/printsupport/kernel/qplatformprintplugin.cpp
+++ b/src/printsupport/kernel/qplatformprintplugin.cpp
@@ -39,7 +39,7 @@
**
****************************************************************************/
-#include "qplatformprintplugin_qpa.h"
+#include "qplatformprintplugin.h"
#include "private/qfactoryloader_p.h"
QT_BEGIN_NAMESPACE
@@ -70,13 +70,9 @@ QPlatformPrinterSupport *QPlatformPrinterSupportPlugin::get()
{
static QPlatformPrinterSupport *singleton = 0;
if (!singleton) {
- QStringList k = loader()->keys();
- if (k.isEmpty())
- return 0;
- QPlatformPrinterSupportPlugin *plugin = qobject_cast<QPlatformPrinterSupportPlugin *>(loader()->instance(k.first()));
- if (!plugin)
- return 0;
- singleton = plugin->create(k.first());
+ const QMultiMap<int, QString> keyMap = loader()->keyMap();
+ if (!keyMap.isEmpty())
+ singleton = qLoadPlugin<QPlatformPrinterSupport, QPlatformPrinterSupportPlugin>(loader(), keyMap.constBegin().value());
}
return singleton;
}
diff --git a/src/printsupport/kernel/qplatformprintplugin_qpa.h b/src/printsupport/kernel/qplatformprintplugin.h
index aec3e02fa6..aec3e02fa6 100644
--- a/src/printsupport/kernel/qplatformprintplugin_qpa.h
+++ b/src/printsupport/kernel/qplatformprintplugin.h
diff --git a/src/printsupport/kernel/qprintengine_win.cpp b/src/printsupport/kernel/qprintengine_win.cpp
index 37d2b27d15..3c079e24f3 100644
--- a/src/printsupport/kernel/qprintengine_win.cpp
+++ b/src/printsupport/kernel/qprintengine_win.cpp
@@ -54,7 +54,7 @@
#include <qdebug.h>
#include <qvector.h>
#include <qpicture.h>
-#include <qplatformpixmap_qpa.h>
+#include <qpa/qplatformpixmap.h>
#include <private/qpicture_p.h>
#include <private/qpixmap_raster_p.h>
diff --git a/src/printsupport/kernel/qprinter.cpp b/src/printsupport/kernel/qprinter.cpp
index fef96d73eb..d7a2a302e4 100644
--- a/src/printsupport/kernel/qprinter.cpp
+++ b/src/printsupport/kernel/qprinter.cpp
@@ -52,8 +52,8 @@
#ifndef QT_NO_PRINTER
-#include "qplatformprintplugin_qpa.h"
-#include <QtPrintSupport/QPlatformPrinterSupport>
+#include <qpa/qplatformprintplugin.h>
+#include <qpa/qplatformprintersupport.h>
#include <private/qpagedpaintdevice_p.h>
#if defined(Q_WS_X11)
diff --git a/src/printsupport/kernel/qprinterinfo.cpp b/src/printsupport/kernel/qprinterinfo.cpp
index 8d498a7e59..3d0ba7f31d 100644
--- a/src/printsupport/kernel/qprinterinfo.cpp
+++ b/src/printsupport/kernel/qprinterinfo.cpp
@@ -30,8 +30,8 @@
#ifndef QT_NO_PRINTER
-#include "qplatformprintplugin_qpa.h"
-#include <QtPrintSupport/QPlatformPrinterSupport>
+#include <qpa/qplatformprintplugin.h>
+#include <qpa/qplatformprintersupport.h>
QT_BEGIN_NAMESPACE
diff --git a/src/sql/kernel/qsqldatabase.cpp b/src/sql/kernel/qsqldatabase.cpp
index f44f475d6c..635ba8b634 100644
--- a/src/sql/kernel/qsqldatabase.cpp
+++ b/src/sql/kernel/qsqldatabase.cpp
@@ -577,11 +577,14 @@ QStringList QSqlDatabase::drivers()
#ifndef QT_NO_LIBRARY
if (QFactoryLoader *fl = loader()) {
- QStringList keys = fl->keys();
- for (QStringList::const_iterator i = keys.constBegin(); i != keys.constEnd(); ++i) {
- if (!list.contains(*i))
- list << *i;
- }
+ typedef QMultiMap<int, QString> PluginKeyMap;
+ typedef PluginKeyMap::const_iterator PluginKeyMapConstIterator;
+
+ const PluginKeyMap keyMap = fl->keyMap();
+ const PluginKeyMapConstIterator cend = keyMap.constEnd();
+ for (PluginKeyMapConstIterator it = keyMap.constBegin(); it != cend; ++it)
+ if (!list.contains(it.value()))
+ list << it.value();
}
#endif
@@ -774,10 +777,8 @@ void QSqlDatabasePrivate::init(const QString &type)
}
#ifndef QT_NO_LIBRARY
- if (!driver && loader()) {
- if (QSqlDriverFactoryInterface *factory = qobject_cast<QSqlDriverFactoryInterface*>(loader()->instance(type)))
- driver = factory->create(type);
- }
+ if (!driver && loader())
+ driver = qLoadPlugin<QSqlDriver, QSqlDriverFactoryInterface>(loader(), type);
#endif // QT_NO_LIBRARY
if (!driver) {
diff --git a/src/tools/moc/outputrevision.h b/src/tools/moc/outputrevision.h
index 590728db6c..faf913f849 100644
--- a/src/tools/moc/outputrevision.h
+++ b/src/tools/moc/outputrevision.h
@@ -43,6 +43,6 @@
#define OUTPUTREVISION_H
// if the output revision changes, you MUST change it in qobjectdefs.h too
-enum { mocOutputRevision = 66 }; // moc format output revision
+enum { mocOutputRevision = 67 }; // moc format output revision
#endif // OUTPUTREVISION_H
diff --git a/src/tools/qdoc/codeparser.cpp b/src/tools/qdoc/codeparser.cpp
index f06cc1f040..1d0c486763 100644
--- a/src/tools/qdoc/codeparser.cpp
+++ b/src/tools/qdoc/codeparser.cpp
@@ -229,7 +229,7 @@ QSet<QString> CodeParser::commonMetaCommands()
*/
void CodeParser::processCommonMetaCommand(const Location& location,
const QString& command,
- const QString& arg,
+ const ArgLocPair& arg,
Node* node,
Tree* tree)
{
@@ -241,13 +241,13 @@ void CodeParser::processCommonMetaCommand(const Location& location,
node->setStatus(Node::Deprecated);
}
else if (command == COMMAND_INGROUP) {
- tree->addToGroup(node, arg);
+ tree->addToGroup(node, arg.first);
}
else if (command == COMMAND_INPUBLICGROUP) {
- tree->addToPublicGroup(node, arg);
+ tree->addToPublicGroup(node, arg.first);
}
else if (command == COMMAND_INMODULE) {
- node->setModuleName(arg);
+ node->setModuleName(arg.first);
}
else if (command == COMMAND_INQMLMODULE) {
node->setQmlModule(arg);
@@ -280,15 +280,15 @@ void CodeParser::processCommonMetaCommand(const Location& location,
node->setThreadSafeness(Node::Reentrant);
}
else if (command == COMMAND_SINCE) {
- node->setSince(arg);
+ node->setSince(arg.first);
}
else if (command == COMMAND_PAGEKEYWORDS) {
- node->addPageKeywords(arg);
+ node->addPageKeywords(arg.first);
}
else if (command == COMMAND_SUBTITLE) {
if (node->type() == Node::Fake) {
FakeNode *fake = static_cast<FakeNode *>(node);
- fake->setSubTitle(arg);
+ fake->setSubTitle(arg.first);
}
else
location.warning(tr("Ignored '\\%1'").arg(COMMAND_SUBTITLE));
@@ -299,11 +299,11 @@ void CodeParser::processCommonMetaCommand(const Location& location,
else if (command == COMMAND_TITLE) {
if (node->type() == Node::Fake) {
FakeNode *fake = static_cast<FakeNode *>(node);
- fake->setTitle(arg);
+ fake->setTitle(arg.first);
if (fake->subType() == Node::Example) {
ExampleNode::exampleNodeMap.insert(fake->title(),static_cast<ExampleNode*>(fake));
}
- nameToTitle.insert(fake->name(),arg);
+ nameToTitle.insert(fake->name(),arg.first);
}
else
location.warning(tr("Ignored '\\%1'").arg(COMMAND_TITLE));
diff --git a/src/tools/qdoc/codeparser.h b/src/tools/qdoc/codeparser.h
index f522567ddb..c4429ff79a 100644
--- a/src/tools/qdoc/codeparser.h
+++ b/src/tools/qdoc/codeparser.h
@@ -89,7 +89,8 @@ public:
protected:
QSet<QString> commonMetaCommands();
void processCommonMetaCommand(const Location& location,
- const QString& command, const QString& arg,
+ const QString& command,
+ const ArgLocPair& arg,
Node *node, Tree *tree);
static void extractPageLinkAndDesc(const QString& arg,
QString* link,
diff --git a/src/tools/qdoc/cppcodeparser.cpp b/src/tools/qdoc/cppcodeparser.cpp
index 4e010fcb77..965455a3d5 100644
--- a/src/tools/qdoc/cppcodeparser.cpp
+++ b/src/tools/qdoc/cppcodeparser.cpp
@@ -537,16 +537,16 @@ QSet<QString> CppCodeParser::topicCommands()
*/
Node* CppCodeParser::processTopicCommand(const Doc& doc,
const QString& command,
- const QString& arg)
+ const ArgLocPair& arg)
{
if (command == COMMAND_FN) {
QStringList parentPath;
FunctionNode *func = 0;
FunctionNode *clone = 0;
- if (!makeFunctionNode(arg, &parentPath, &clone) &&
- !makeFunctionNode("void " + arg, &parentPath, &clone)) {
- doc.location().warning(tr("Invalid syntax in '\\%1'").arg(COMMAND_FN));
+ if (!makeFunctionNode(arg.first, &parentPath, &clone) &&
+ !makeFunctionNode("void " + arg.first, &parentPath, &clone)) {
+ arg.second.warning(tr("Invalid syntax in '\\%1'").arg(COMMAND_FN));
}
else {
if (!activeNamespaces_.isEmpty()) {
@@ -595,10 +595,9 @@ Node* CppCodeParser::processTopicCommand(const Doc& doc,
QStringList parentPath;
FunctionNode *func = 0;
- if (makeFunctionNode(arg, &parentPath, &func, tree_->root())) {
+ if (makeFunctionNode(arg.first, &parentPath, &func, tree_->root())) {
if (!parentPath.isEmpty()) {
- doc.location().warning(tr("Invalid syntax in '\\%1'")
- .arg(COMMAND_MACRO));
+ arg.second.warning(tr("Invalid syntax in '\\%1'").arg(COMMAND_MACRO));
delete func;
func = 0;
}
@@ -615,15 +614,14 @@ Node* CppCodeParser::processTopicCommand(const Doc& doc,
}
return func;
}
- else if (QRegExp("[A-Za-z_][A-Za-z0-9_]+").exactMatch(arg)) {
- func = new FunctionNode(tree_->root(), arg);
+ else if (QRegExp("[A-Za-z_][A-Za-z0-9_]+").exactMatch(arg.first)) {
+ func = new FunctionNode(tree_->root(), arg.first);
func->setAccess(Node::Public);
- func->setLocation(doc.location());
+ func->setLocation(arg.second);
func->setMetaness(FunctionNode::MacroWithoutParams);
}
else {
- doc.location().warning(tr("Invalid syntax in '\\%1'")
- .arg(COMMAND_MACRO));
+ doc.location().warning(tr("Invalid syntax in '\\%1'").arg(COMMAND_MACRO));
}
return func;
@@ -642,7 +640,7 @@ Node* CppCodeParser::processTopicCommand(const Doc& doc,
if (type == Node::Fake)
subtype = Node::QmlClass;
- QStringList paths = arg.split(QLatin1Char(' '));
+ QStringList paths = arg.first.split(QLatin1Char(' '));
QStringList path = paths[0].split("::");
Node *node = 0;
@@ -672,7 +670,7 @@ Node* CppCodeParser::processTopicCommand(const Doc& doc,
if (node == 0) {
doc.location().warning(tr("Cannot find '%1' specified with '\\%2' in any header file")
- .arg(arg).arg(command));
+ .arg(arg.first).arg(command));
lastPath = path;
}
@@ -690,32 +688,33 @@ Node* CppCodeParser::processTopicCommand(const Doc& doc,
}
else if (command == COMMAND_EXAMPLE) {
if (Config::generateExamples) {
- ExampleNode* en = new ExampleNode(tree_->root(), arg);
+ ExampleNode* en = new ExampleNode(tree_->root(), arg.first);
+ en->setLocation(arg.second);
createExampleFileNodes(en);
return en;
}
}
else if (command == COMMAND_EXTERNALPAGE) {
- return new FakeNode(tree_->root(), arg, Node::ExternalPage, Node::ArticlePage);
+ return new FakeNode(tree_->root(), arg.first, Node::ExternalPage, Node::ArticlePage);
}
else if (command == COMMAND_FILE) {
- return new FakeNode(tree_->root(), arg, Node::File, Node::NoPageType);
+ return new FakeNode(tree_->root(), arg.first, Node::File, Node::NoPageType);
}
else if (command == COMMAND_GROUP) {
- return new FakeNode(tree_->root(), arg, Node::Group, Node::OverviewPage);
+ return new FakeNode(tree_->root(), arg.first, Node::Group, Node::OverviewPage);
}
else if (command == COMMAND_HEADERFILE) {
- return new FakeNode(tree_->root(), arg, Node::HeaderFile, Node::ApiPage);
+ return new FakeNode(tree_->root(), arg.first, Node::HeaderFile, Node::ApiPage);
}
else if (command == COMMAND_MODULE) {
- return new FakeNode(tree_->root(), arg, Node::Module, Node::OverviewPage);
+ return new FakeNode(tree_->root(), arg.first, Node::Module, Node::OverviewPage);
}
else if (command == COMMAND_QMLMODULE) {
return FakeNode::lookupQmlModuleNode(tree_, arg);
}
else if (command == COMMAND_PAGE) {
Node::PageType ptype = Node::ArticlePage;
- QStringList args = arg.split(QLatin1Char(' '));
+ QStringList args = arg.first.split(QLatin1Char(' '));
if (args.size() > 1) {
QString t = args[1].toLower();
if (t == "howto")
@@ -751,18 +750,19 @@ Node* CppCodeParser::processTopicCommand(const Doc& doc,
fn = new DitaMapNode(tree_->root(), args[0]);
else
fn = new FakeNode(tree_->root(), args[0], Node::Page, ptype);
+ fn->setLocation(arg.second);
if (ncn) {
ncn->addCollision(fn);
}
return fn;
}
else if (command == COMMAND_DITAMAP) {
- FakeNode* fn = new DitaMapNode(tree_->root(), arg);
+ FakeNode* fn = new DitaMapNode(tree_->root(), arg.first);
return fn;
}
else if (command == COMMAND_QMLCLASS) {
ClassNode* classNode = 0;
- QStringList names = arg.split(QLatin1Char(' '));
+ QStringList names = arg.first.split(QLatin1Char(' '));
if (names.size() > 1)
classNode = tree_->findClassNode(names[1].split("::"));
@@ -779,12 +779,13 @@ Node* CppCodeParser::processTopicCommand(const Doc& doc,
*/
NameCollisionNode* ncn = tree_->checkForCollision(names[0]);
QmlClassNode* qcn = new QmlClassNode(tree_->root(), names[0], classNode);
+ qcn->setLocation(arg.second);
if (ncn)
ncn->addCollision(qcn);
return qcn;
}
else if (command == COMMAND_QMLBASICTYPE) {
- return new QmlBasicTypeNode(tree_->root(), arg);
+ return new QmlBasicTypeNode(tree_->root(), arg.first);
}
else if ((command == COMMAND_QMLSIGNAL) ||
(command == COMMAND_QMLMETHOD) ||
@@ -793,18 +794,39 @@ Node* CppCodeParser::processTopicCommand(const Doc& doc,
QString module;
QString element;
QString type;
- if (splitQmlMethodArg(doc,arg,type,module,element)) {
+ if (splitQmlMethodArg(doc,arg.first,type,module,element)) {
QmlClassNode* qmlClass = tree_->findQmlClassNode(module,element);
if (qmlClass) {
if (command == COMMAND_QMLSIGNAL)
- return makeFunctionNode(doc,arg,qmlClass,Node::QmlSignal,false,COMMAND_QMLSIGNAL);
+ return makeFunctionNode(doc,
+ arg.first,
+ qmlClass,
+ Node::QmlSignal,
+ false,
+ COMMAND_QMLSIGNAL);
else if (command == COMMAND_QMLATTACHEDSIGNAL)
- return makeFunctionNode(doc,arg,qmlClass,Node::QmlSignal,true,COMMAND_QMLATTACHEDSIGNAL);
+ return makeFunctionNode(doc,
+ arg.first,
+ qmlClass,
+ Node::QmlSignal,
+ true,
+ COMMAND_QMLATTACHEDSIGNAL);
else if (command == COMMAND_QMLMETHOD) {
- return makeFunctionNode(doc,arg,qmlClass,Node::QmlMethod,false,COMMAND_QMLMETHOD);
+ return makeFunctionNode(doc,
+ arg.first,
+ qmlClass,
+ Node::QmlMethod,
+ false,
+ COMMAND_QMLMETHOD);
}
else if (command == COMMAND_QMLATTACHEDMETHOD)
- return makeFunctionNode(doc,arg,qmlClass,Node::QmlMethod,true,COMMAND_QMLATTACHEDMETHOD);
+ return makeFunctionNode(doc,
+ arg.
+ first,
+ qmlClass,
+ Node::QmlMethod,
+ true,
+ COMMAND_QMLATTACHEDMETHOD);
else
return 0; // never get here.
}
@@ -925,26 +947,31 @@ bool CppCodeParser::splitQmlMethodArg(const Doc& doc,
*/
Node *CppCodeParser::processTopicCommandGroup(const Doc& doc,
const QString& command,
- const QStringList& args)
+ const ArgList& args)
{
QmlPropGroupNode* qmlPropGroup = 0;
if ((command == COMMAND_QMLPROPERTY) ||
(command == COMMAND_QMLATTACHEDPROPERTY)) {
+ QString arg;
QString type;
QString module;
QString element;
QString property;
bool attached = (command == COMMAND_QMLATTACHEDPROPERTY);
- QStringList::ConstIterator arg = args.begin();
- if (splitQmlPropertyArg(doc,(*arg),type,module,element,property)) {
+ ArgList::ConstIterator argsIter = args.begin();
+ arg = argsIter->first;
+ if (splitQmlPropertyArg(doc,arg,type,module,element,property)) {
QmlClassNode* qmlClass = tree_->findQmlClassNode(module,element);
if (qmlClass) {
qmlPropGroup = new QmlPropGroupNode(qmlClass,property); //,attached);
+ qmlPropGroup->setLocation(location());
}
}
if (qmlPropGroup) {
ClassNode *correspondingClass = static_cast<QmlClassNode*>(qmlPropGroup->parent())->classNode();
QmlPropertyNode *qmlPropNode = new QmlPropertyNode(qmlPropGroup,property,type,attached);
+ qmlPropNode->setLocation(location());
+ qmlPropNode->setQPropertyFlag();
const PropertyNode *correspondingProperty = 0;
if (correspondingClass) {
@@ -954,19 +981,22 @@ Node *CppCodeParser::processTopicCommandGroup(const Doc& doc,
bool writableList = type.startsWith("list") && correspondingProperty->dataType().endsWith('*');
qmlPropNode->setReadOnly(!(writableList || correspondingProperty->isWritable()));
}
- ++arg;
- while (arg != args.end()) {
- if (splitQmlPropertyArg(doc,(*arg),type,module,element,property)) {
+ ++argsIter;
+ while (argsIter != args.end()) {
+ arg = argsIter->first;
+ if (splitQmlPropertyArg(doc,arg,type,module,element,property)) {
QmlPropertyNode* qmlPropNode = new QmlPropertyNode(qmlPropGroup,
property,
type,
attached);
+ qmlPropNode->setLocation(location());
+ qmlPropNode->setQPropertyFlag();
if (correspondingProperty) {
bool writableList = type.startsWith("list") && correspondingProperty->dataType().endsWith('*');
qmlPropNode->setReadOnly(!(writableList || correspondingProperty->isWritable()));
}
}
- ++arg;
+ ++argsIter;
}
}
}
@@ -1001,9 +1031,10 @@ QSet<QString> CppCodeParser::otherMetaCommands()
*/
void CppCodeParser::processOtherMetaCommand(const Doc& doc,
const QString& command,
- const QString& arg,
+ const ArgLocPair& argLocPair,
Node *node)
{
+ QString arg = argLocPair.first;
if (command == COMMAND_INHEADERFILE) {
if (node != 0 && node->isInnerNode()) {
((InnerNode *) node)->addInclude(arg);
@@ -1152,7 +1183,7 @@ void CppCodeParser::processOtherMetaCommand(const Doc& doc,
}
}
else {
- processCommonMetaCommand(doc.location(),command,arg,node,tree_);
+ processCommonMetaCommand(doc.location(),command,argLocPair,node,tree_);
}
}
@@ -1166,8 +1197,8 @@ void CppCodeParser::processOtherMetaCommands(const Doc& doc, Node *node)
const QSet<QString> metaCommands = doc.metaCommandsUsed();
QSet<QString>::ConstIterator cmd = metaCommands.begin();
while (cmd != metaCommands.end()) {
- QStringList args = doc.metaCommandArgs(*cmd);
- QStringList::ConstIterator arg = args.begin();
+ ArgList args = doc.metaCommandArgs(*cmd);
+ ArgList::ConstIterator arg = args.begin();
while (arg != args.end()) {
processOtherMetaCommand(doc, *cmd, *arg, node);
++arg;
@@ -2209,10 +2240,9 @@ bool CppCodeParser::matchDocsAndStuff()
Doc doc(start_loc,end_loc,comment,metacommandsAllowed);
QString topic;
- QStringList args;
+ ArgList args;
- QSet<QString> topicCommandsUsed = topicCommandsAllowed &
- doc.metaCommandsUsed();
+ QSet<QString> topicCommandsUsed = topicCommandsAllowed & doc.metaCommandsUsed();
/*
There should be one topic command in the set,
@@ -2273,7 +2303,7 @@ bool CppCodeParser::matchDocsAndStuff()
}
}
else {
- QStringList::ConstIterator a = args.begin();
+ ArgList::ConstIterator a = args.begin();
while (a != args.end()) {
Doc nodeDoc = doc;
Node *node = processTopicCommand(nodeDoc,topic,*a);
@@ -2468,8 +2498,8 @@ void CppCodeParser::createExampleFileNodes(FakeNode *fake)
proFileName,
userFriendlyFilePath);
if (fullPath.isEmpty()) {
- fake->doc().location().warning(tr("Cannot find file '%1' or '%2'").arg(tmp).arg(proFileName));
- fake->doc().location().warning(tr("EXAMPLE PATH DOES NOT EXIST: %1").arg(examplePath));
+ fake->location().warning(tr("Cannot find file '%1' or '%2'").arg(tmp).arg(proFileName));
+ fake->location().warning(tr(" EXAMPLE PATH DOES NOT EXIST: %1").arg(examplePath));
return;
}
}
diff --git a/src/tools/qdoc/cppcodeparser.h b/src/tools/qdoc/cppcodeparser.h
index 74abb994d9..0f4b5119d6 100644
--- a/src/tools/qdoc/cppcodeparser.h
+++ b/src/tools/qdoc/cppcodeparser.h
@@ -88,12 +88,12 @@ protected:
virtual QSet<QString> topicCommands();
virtual Node *processTopicCommand(const Doc& doc,
const QString& command,
- const QString& arg);
+ const ArgLocPair& arg);
#ifdef QDOC_QML
// might need to implement this in QsCodeParser as well.
virtual Node *processTopicCommandGroup(const Doc& doc,
const QString& command,
- const QStringList& args);
+ const ArgList& args);
bool splitQmlPropertyArg(const Doc& doc,
const QString& arg,
QString& type,
@@ -109,7 +109,7 @@ protected:
virtual QSet<QString> otherMetaCommands();
virtual void processOtherMetaCommand(const Doc& doc,
const QString& command,
- const QString& arg,
+ const ArgLocPair& argLocPair,
Node *node);
void processOtherMetaCommands(const Doc& doc, Node *node);
diff --git a/src/tools/qdoc/ditaxmlgenerator.cpp b/src/tools/qdoc/ditaxmlgenerator.cpp
index 0c88cbc529..b24a6af660 100644
--- a/src/tools/qdoc/ditaxmlgenerator.cpp
+++ b/src/tools/qdoc/ditaxmlgenerator.cpp
@@ -2548,7 +2548,10 @@ void DitaXmlGenerator::generateHeader(const Node* node,
if (!outputclass.isEmpty())
xmlWriter().writeAttribute("outputclass",outputclass);
writeStartTag(nameTag); // <title> or <apiName>
- writeCharacters(name);
+ if (!name.isEmpty())
+ writeCharacters(name);
+ else
+ writeCharacters(node->name());
writeEndTag(); // </title> or </apiName>
}
@@ -3295,7 +3298,7 @@ void DitaXmlGenerator::generateOverviewList(const Node* relative, CodeMarker* /*
QString group;
bool isGroupPage = false;
if (fakeNode->doc().metaCommandsUsed().contains("group")) {
- group = fakeNode->doc().metaCommandArgs("group")[0];
+ group = fakeNode->doc().metaCommandArgs("group")[0].first;
isGroupPage = true;
}
@@ -4493,7 +4496,7 @@ void DitaXmlGenerator::generateDetailedQmlMember(Node* node,
if (qpgn->childNodes().size() == 1) {
qpn = static_cast<QmlPropertyNode*>(*p);
startQmlProperty(qpn,relative,marker);
- writeQmlDesc(node, marker);
+ writeApiDesc(node, marker, node->title());
writeEndTag(); // </qmlPropertyDetail>
writeEndTag(); // </qmlProperty>
}
@@ -4506,7 +4509,7 @@ void DitaXmlGenerator::generateDetailedQmlMember(Node* node,
//writeCharacters("...");
writeEndTag(); // </apiName>
writeStartTag(DT_qmlPropertyGroupDetail);
- writeQmlDesc(node, marker);
+ writeApiDesc(node, marker, node->title());
writeEndTag(); // </qmlPropertyGroupDetail>
while (p != qpgn->childNodes().end()) {
if ((*p)->type() == Node::QmlProperty) {
@@ -4524,7 +4527,7 @@ void DitaXmlGenerator::generateDetailedQmlMember(Node* node,
qpn = static_cast<QmlPropertyNode*>(node);
if (qpn->qmlPropNodes().isEmpty()) {
startQmlProperty(qpn,relative,marker);
- writeQmlDesc(node, marker);
+ writeApiDesc(node, marker, node->title());
writeEndTag(); // </qmlPropertyDetail>
writeEndTag(); // </qmlProperty>
}
@@ -4533,7 +4536,7 @@ void DitaXmlGenerator::generateDetailedQmlMember(Node* node,
if (n->type() == Node::QmlProperty) {
qpn = static_cast<QmlPropertyNode*>(n);
startQmlProperty(qpn,relative,marker);
- writeQmlDesc(node, marker);
+ writeApiDesc(node, marker, node->title());
writeEndTag(); // </qmlPropertyDetail>
writeEndTag(); // </qmlProperty>
}
@@ -4552,7 +4555,7 @@ void DitaXmlGenerator::generateDetailedQmlMember(Node* node,
//writeCharacters("...");
writeEndTag(); // </apiName>
writeStartTag(DT_qmlPropertyGroupDetail);
- writeQmlDesc(node, marker);
+ writeApiDesc(node, marker, node->title());
writeEndTag(); // </qmlPropertyGroupDetail>
NodeList::ConstIterator p = qpn->qmlPropNodes().begin();
while (p != qpn->qmlPropNodes().end()) {
@@ -4603,27 +4606,12 @@ void DitaXmlGenerator::writeQmlRef(DitaTag tag,
writeEndTag(); // </qmlAttached>
}
writeEndTag(); // </qmlXxxDef>
- writeQmlDesc(node, marker);
+ writeApiDesc(node, marker, node->title());
writeEndTag(); // </qmlXxxDetail>
writeEndTag(); // tag
}
/*!
- Writes the <apiDesc> tag and its contents for the \a node.
- The \a marker is used for markeing up the text body.
- */
-void DitaXmlGenerator::writeQmlDesc(Node* node, CodeMarker* marker)
-{
- writeStartTag(DT_apiDesc);
- generateStatus(node, marker);
- generateBody(node, marker);
- generateThreadSafeness(node, marker);
- generateSince(node, marker);
- generateAlsoList(node, marker);
- writeEndTag(); // </apiDesc>
-}
-
-/*!
This generates a <qmlTypeDef> in which the
QML module name and version number are specified.
*/
diff --git a/src/tools/qdoc/ditaxmlgenerator.h b/src/tools/qdoc/ditaxmlgenerator.h
index 538a667849..56cf48614c 100644
--- a/src/tools/qdoc/ditaxmlgenerator.h
+++ b/src/tools/qdoc/ditaxmlgenerator.h
@@ -418,7 +418,6 @@ private:
Node* node,
const InnerNode* relative,
CodeMarker* marker);
- void writeQmlDesc(Node* node, CodeMarker* marker);
void generateDetailedQmlMember(Node* node,
const InnerNode* relative,
CodeMarker* marker);
diff --git a/src/tools/qdoc/doc.cpp b/src/tools/qdoc/doc.cpp
index 3c1bab17af..af7e26dd17 100644
--- a/src/tools/qdoc/doc.cpp
+++ b/src/tools/qdoc/doc.cpp
@@ -113,7 +113,6 @@ enum {
CMD_ENDSIDEBAR,
CMD_ENDTABLE,
CMD_ENDTOPICREF,
- CMD_EXPIRE,
CMD_FOOTNOTE,
CMD_GENERATELIST,
CMD_GRANULARITY,
@@ -231,7 +230,6 @@ static struct {
{ "endsidebar", CMD_ENDSIDEBAR, 0 },
{ "endtable", CMD_ENDTABLE, 0 },
{ "endtopicref", CMD_ENDTOPICREF, 0 },
- { "expire", CMD_EXPIRE, 0 },
{ "footnote", CMD_FOOTNOTE, 0 },
{ "generatelist", CMD_GENERATELIST, 0 },
{ "granularity", CMD_GRANULARITY, 0 }, // ### don't document for now
@@ -348,6 +346,8 @@ static QString cleanLink(const QString &link)
return link.mid(colonPos + 1).simplified();
}
+typedef QMap<QString, ArgList> CommandMap;
+
class DocPrivate : public Shared
{
public:
@@ -370,7 +370,7 @@ public:
QStringList enumItemList;
QStringList omitEnumItemList;
QSet<QString> metacommandsUsed;
- QCommandMap metaCommandMap;
+ CommandMap metaCommandMap;
bool hasLegalese : 1;
bool hasSectioningUnits : 1;
DocPrivateExtra *extra;
@@ -462,7 +462,6 @@ private:
Location& location();
QString detailsUnknownCommand(const QSet<QString>& metaCommandSet,
const QString& str);
- void checkExpiry(const QString& date);
void insertBaseName(const QString &baseName);
void insertTarget(const QString& target, bool keyword);
void include(const QString& fileName, const QString& identifier);
@@ -859,9 +858,6 @@ void DocParser::parse(const QString& source,
append(Atom::TableRight);
}
break;
- case CMD_EXPIRE:
- checkExpiry(getArgument());
- break;
case CMD_FOOTNOTE:
if (openCommand(cmd)) {
enterPara();
@@ -1392,13 +1388,13 @@ void DocParser::parse(const QString& source,
append(Atom::ParaRight);
p1 = getMetaCommandArgument(cmdStr);
}
- priv->metaCommandMap[cmdStr].append(p1);
+ priv->metaCommandMap[cmdStr].append(ArgLocPair(p1,location()));
break;
case NOT_A_CMD:
if (metaCommandSet.contains(cmdStr)) {
priv->metacommandsUsed.insert(cmdStr);
QString arg = getMetaCommandArgument(cmdStr);
- priv->metaCommandMap[cmdStr].append(arg);
+ priv->metaCommandMap[cmdStr].append(ArgLocPair(arg,location()));
if (possibleTopics.contains(cmdStr)) {
priv->topics.append(Topic(cmdStr,arg));
}
@@ -1662,43 +1658,6 @@ QString DocParser::detailsUnknownCommand(const QSet<QString> &metaCommandSet,
return tr("Maybe you meant '\\%1'?").arg(best);
}
-void DocParser::checkExpiry(const QString& date)
-{
- QRegExp ymd("(\\d{4})(?:-(\\d{2})(?:-(\\d{2})))");
-
- if (ymd.exactMatch(date)) {
- int y = ymd.cap(1).toInt();
- int m = ymd.cap(2).toInt();
- int d = ymd.cap(3).toInt();
-
- if (m == 0)
- m = 1;
- if (d == 0)
- d = 1;
- QDate expiryDate(y, m, d);
- if (expiryDate.isValid()) {
- int days = expiryDate.daysTo(QDate::currentDate());
- if (days == 0) {
- location().warning(tr("Documentation expires today"));
- }
- else if (days == 1) {
- location().warning(tr("Documentation expired yesterday"));
- }
- else if (days >= 2) {
- location().warning(tr("Documentation expired %1 days ago")
- .arg(days));
- }
- }
- else {
- location().warning(tr("Date '%1' invalid").arg(date));
- }
- }
- else {
- location().warning(tr("Date '%1' not in YYYY-MM-DD format")
- .arg(date));
- }
-}
-
void DocParser::insertBaseName(const QString &baseName)
{
priv->constructExtra();
@@ -3086,9 +3045,9 @@ const TopicList& Doc::topicsUsed() const
return priv == 0 ? *nullTopicList() : priv->topics;
}
-QStringList Doc::metaCommandArgs(const QString& metacommand) const
+ArgList Doc::metaCommandArgs(const QString& metacommand) const
{
- return priv == 0 ? QStringList() : priv->metaCommandMap.value(metacommand);
+ return priv == 0 ? ArgList() : priv->metaCommandMap.value(metacommand);
}
const QList<Text> &Doc::alsoList() const
diff --git a/src/tools/qdoc/doc.h b/src/tools/qdoc/doc.h
index d3fd2dbb4d..1f83f95362 100644
--- a/src/tools/qdoc/doc.h
+++ b/src/tools/qdoc/doc.h
@@ -63,7 +63,8 @@ class Text;
class FakeNode;
class DitaRef;
-typedef QMap<QString, QStringList> QCommandMap;
+typedef QPair<QString, Location> ArgLocPair;
+typedef QList<ArgLocPair> ArgList;
typedef QMap<QString, QString> QStringMap;
typedef QMultiMap<QString, QString> QStringMultiMap;
@@ -168,7 +169,7 @@ public:
const QStringList &omitEnumItemNames() const;
const QSet<QString> &metaCommandsUsed() const;
const TopicList& topicsUsed() const;
- QStringList metaCommandArgs( const QString& metaCommand ) const;
+ ArgList metaCommandArgs(const QString& metaCommand) const;
const QList<Text> &alsoList() const;
bool hasTableOfContents() const;
bool hasKeywords() const;
diff --git a/src/tools/qdoc/doc/qdoc-manual.qdoc b/src/tools/qdoc/doc/qdoc-manual.qdoc
index fa3301e072..6983f6345f 100644
--- a/src/tools/qdoc/doc/qdoc-manual.qdoc
+++ b/src/tools/qdoc/doc/qdoc-manual.qdoc
@@ -256,7 +256,6 @@
\li \l {04-qdoc-commands-textmarkup.html#e-command} {\\e} \span {class="newStuff"} {(new 5/3/2012)}
\li \l {12-0-qdoc-commands-miscellaneous.html#else-command} {\\else}
\li \l {12-0-qdoc-commands-miscellaneous.html#endif-command} {\\endif}
- \li \l {12-0-qdoc-commands-miscellaneous.html#expire-command} {\\expire}
\li \l {11-qdoc-commands-specialcontent.html#footnote-command} {\\footnote}
\li \l {12-0-qdoc-commands-miscellaneous.html#generatelist-command} {\\generatelist}
\li \l {10-qdoc-commands-tablesandlists.html#header-command} {\\header}
@@ -3506,41 +3505,6 @@
visual appearance of the documentation, and to the process of
generating the documentation.
- \target expire-command
- \section1 \\expire
-
- The \\expire command allows you to define an expiration
- date for your documentation.
-
- When using the \\expire command, QDoc will emit a warning when the
- current date is larger than the specified date. The command
- accepts one argument; the argument's format is yyyy-mm-dd. For
- example:
-
- \code
- / *!
- \page porting.html
-
- \title Porting to Qt 3.x
-
- \expire 2004-12-31
-
- This document describes porting applications from Qt
- 2.x to Qt 3.x.
-
- The Qt 3.x series is not binary compatible with the
- 2.x series.
- ...
- * /
- \endcode
-
- If you run QDoc on 4 July 2005, it will emit the warning
-
- \quotation
- porting.qdoc:6: Documentation expired 185 days ago
- \endquotation
-
-
\target annotatedlist-command
\section1 \\annotatedlist
@@ -8673,7 +8637,6 @@
\li \l {12-0-qdoc-commands-miscellaneous.html#endif-command} {\\endif}
\li \l {13-qdoc-commands-topics.html#enum-command} {\\enum}
\li \l {13-qdoc-commands-topics.html#example-command} {\\example}
- \li \l {12-0-qdoc-commands-miscellaneous.html#expire-command} {\\expire}
\li \l {13-qdoc-commands-topics.html#externalpage-command} {\\externalpage}
\li \l {13-qdoc-commands-topics.html#fn-command} {\\fn}
\li \l {11-qdoc-commands-specialcontent.html#footnote-command} {\\footnote}
diff --git a/src/tools/qdoc/htmlgenerator.cpp b/src/tools/qdoc/htmlgenerator.cpp
index ef3bf8db15..5755b9afb4 100644
--- a/src/tools/qdoc/htmlgenerator.cpp
+++ b/src/tools/qdoc/htmlgenerator.cpp
@@ -2683,7 +2683,7 @@ void HtmlGenerator::generateOverviewList(const Node *relative, CodeMarker * /* m
QString group;
bool isGroupPage = false;
if (fakeNode->doc().metaCommandsUsed().contains("group")) {
- group = fakeNode->doc().metaCommandArgs("group")[0];
+ group = fakeNode->doc().metaCommandArgs("group")[0].first;
isGroupPage = true;
}
diff --git a/src/tools/qdoc/node.cpp b/src/tools/qdoc/node.cpp
index 30fa76ae02..f235753ccd 100644
--- a/src/tools/qdoc/node.cpp
+++ b/src/tools/qdoc/node.cpp
@@ -1478,7 +1478,6 @@ FakeNode::FakeNode(InnerNode* parent, const QString& name, SubType subtype, Node
setPageType(OverviewPage);
break;
case QmlModule:
- setQmlModule(name);
setPageType(OverviewPage);
break;
case QmlClass:
@@ -1574,10 +1573,10 @@ void FakeNode::insertQmlModuleNode(const QString& qmid, FakeNode* fn)
and inserted into the QML module map mapped to the QML module
identifier constructed from \a arg.
*/
-FakeNode* FakeNode::lookupQmlModuleNode(Tree* tree, const QString& arg)
+FakeNode* FakeNode::lookupQmlModuleNode(Tree* tree, const ArgLocPair& arg)
{
QStringList dotSplit;
- QStringList blankSplit = arg.split(QLatin1Char(' '));
+ QStringList blankSplit = arg.first.split(QLatin1Char(' '));
QString qmid = blankSplit[0];
if (blankSplit.size() > 1) {
dotSplit = blankSplit[1].split(QLatin1Char('.'));
@@ -1587,7 +1586,8 @@ FakeNode* FakeNode::lookupQmlModuleNode(Tree* tree, const QString& arg)
if (qmlModuleMap_.contains(qmid))
fn = qmlModuleMap_.value(qmid);
if (!fn) {
- fn = new FakeNode(tree->root(), arg, Node::QmlModule, Node::OverviewPage);
+ fn = new FakeNode(tree->root(), arg.first, Node::QmlModule, Node::OverviewPage);
+ fn->setQmlModule(arg);
insertQmlModuleNode(qmid,fn);
}
return fn;
@@ -2134,10 +2134,10 @@ void QmlClassNode::subclasses(const QString& base, NodeList& subs)
true is returned. If any of the three is not found or is not
correct, false is returned.
*/
-bool Node::setQmlModule(const QString& arg)
+bool Node::setQmlModule(const ArgLocPair& arg)
{
QStringList dotSplit;
- QStringList blankSplit = arg.split(QLatin1Char(' '));
+ QStringList blankSplit = arg.first.split(QLatin1Char(' '));
qmlModuleName_ = blankSplit[0];
qmlModuleVersionMajor_ = "1";
qmlModuleVersionMinor_ = "0";
@@ -2149,10 +2149,10 @@ bool Node::setQmlModule(const QString& arg)
return true;
}
else
- doc().location().warning(tr("Minor version number missing for '\\qmlmodule' or '\\inqmlmodule'; 0 assumed."));
+ arg.second.warning(tr("Minor version number missing for '\\qmlmodule' or '\\inqmlmodule'; 0 assumed."));
}
else
- doc().location().warning(tr("Module version number missing for '\\qmlmodule' or '\\inqmlmodule'; 1.0 assumed."));
+ arg.second.warning(tr("Module version number missing for '\\qmlmodule' or '\\inqmlmodule'; 1.0 assumed."));
return false;
}
@@ -2294,6 +2294,7 @@ QmlPropertyNode::QmlPropertyNode(QmlPropGroupNode *parent,
designable_(FlagValueDefault),
isdefault_(false),
attached_(attached),
+ qproperty_(false),
readOnly_(FlagValueDefault)
{
setPageType(ApiPage);
@@ -2313,6 +2314,7 @@ QmlPropertyNode::QmlPropertyNode(QmlClassNode *parent,
designable_(FlagValueDefault),
isdefault_(false),
attached_(attached),
+ qproperty_(false),
readOnly_(FlagValueDefault)
{
setPageType(ApiPage);
@@ -2339,6 +2341,7 @@ QmlPropertyNode::QmlPropertyNode(QmlPropertyNode* parent,
designable_(FlagValueDefault),
isdefault_(false),
attached_(attached),
+ qproperty_(false),
readOnly_(FlagValueDefault)
{
setPageType(ApiPage);
@@ -2353,18 +2356,19 @@ QmlPropertyNode::QmlPropertyNode(QmlPropertyNode* parent,
*/
bool QmlPropertyNode::isWritable(Tree* tree)
{
- if (readOnly_ != FlagValueDefault) {
+ if (readOnly_ != FlagValueDefault)
return !fromFlagValue(readOnly_, false);
- }
- PropertyNode* pn = correspondingProperty(tree);
- if (pn) {
- return pn->isWritable();
- }
- else {
- location().warning(tr("Can't detect if QML property %1 is read-only; writable assumed.").arg(name()));
- return true;
+ if (qproperty_) {
+ PropertyNode* pn = correspondingProperty(tree);
+ if (pn)
+ return pn->isWritable();
+
+ location().warning(tr("Can't detect if QML property %1::%2::%3 is read-only; "
+ "writable assumed.")
+ .arg(qmlModuleIdentifier()).arg(qmlTypeName()).arg(name()));
}
+ return true;
}
PropertyNode* QmlPropertyNode::correspondingProperty(Tree *tree)
diff --git a/src/tools/qdoc/node.h b/src/tools/qdoc/node.h
index 8083f2c05d..0b8758d92f 100644
--- a/src/tools/qdoc/node.h
+++ b/src/tools/qdoc/node.h
@@ -230,10 +230,11 @@ public:
QString guid() const;
QString ditaXmlHref();
QString extractClassName(const QString &string) const;
+ virtual QString qmlTypeName() const { return name_; }
virtual QString qmlModuleName() const { return qmlModuleName_; }
virtual QString qmlModuleVersion() const { return qmlModuleVersionMajor_ + "." + qmlModuleVersionMinor_; }
virtual QString qmlModuleIdentifier() const { return qmlModuleName_ + qmlModuleVersionMajor_; }
- virtual bool setQmlModule(const QString& );
+ virtual bool setQmlModule(const ArgLocPair& );
virtual ClassNode* classNode() { return 0; }
virtual void clearCurrentChild() { }
virtual const ImportList* importList() const { return 0; }
@@ -476,7 +477,7 @@ public:
virtual bool isQmlPropertyGroup() const { return (nodeSubtype_ == QmlPropertyGroup); }
static void insertQmlModuleNode(const QString& qmid, FakeNode* fn);
- static FakeNode* lookupQmlModuleNode(Tree* tree, const QString& arg);
+ static FakeNode* lookupQmlModuleNode(Tree* tree, const ArgLocPair& arg);
protected:
SubType nodeSubtype_;
@@ -579,6 +580,7 @@ public:
virtual ~QmlPropGroupNode() { }
virtual bool isQmlNode() const { return true; }
virtual bool isQtQuickNode() const { return parent()->isQtQuickNode(); }
+ virtual QString qmlTypeName() const { return parent()->qmlTypeName(); }
virtual QString qmlModuleName() const { return parent()->qmlModuleName(); }
virtual QString qmlModuleVersion() const { return parent()->qmlModuleVersion(); }
virtual QString qmlModuleIdentifier() const { return parent()->qmlModuleIdentifier(); }
@@ -626,6 +628,7 @@ public:
virtual bool isAttached() const { return attached_; }
virtual bool isQmlNode() const { return true; }
virtual bool isQtQuickNode() const { return parent()->isQtQuickNode(); }
+ virtual QString qmlTypeName() const { return parent()->qmlTypeName(); }
virtual QString qmlModuleName() const { return parent()->qmlModuleName(); }
virtual QString qmlModuleVersion() const { return parent()->qmlModuleVersion(); }
virtual QString qmlModuleIdentifier() const { return parent()->qmlModuleIdentifier(); }
@@ -635,6 +638,7 @@ public:
const QString& element() const { return static_cast<QmlPropGroupNode*>(parent())->element(); }
void appendQmlPropNode(QmlPropertyNode* p) { qmlPropNodes_.append(p); }
const NodeList& qmlPropNodes() const { return qmlPropNodes_; }
+ void setQPropertyFlag() { qproperty_ = true; }
private:
QString type_;
@@ -642,6 +646,7 @@ private:
FlagValue designable_;
bool isdefault_;
bool attached_;
+ bool qproperty_;
FlagValue readOnly_;
NodeList qmlPropNodes_;
};
@@ -803,6 +808,7 @@ public:
(type() == QmlSignalHandler));
}
virtual bool isQtQuickNode() const { return parent()->isQtQuickNode(); }
+ virtual QString qmlTypeName() const { return parent()->qmlTypeName(); }
virtual QString qmlModuleName() const { return parent()->qmlModuleName(); }
virtual QString qmlModuleVersion() const { return parent()->qmlModuleVersion(); }
virtual QString qmlModuleIdentifier() const { return parent()->qmlModuleIdentifier(); }
diff --git a/src/tools/qdoc/qmlvisitor.cpp b/src/tools/qdoc/qmlvisitor.cpp
index 1544227fc3..a1031f2e83 100644
--- a/src/tools/qdoc/qmlvisitor.cpp
+++ b/src/tools/qdoc/qmlvisitor.cpp
@@ -242,7 +242,11 @@ void QmlDocVisitor::applyMetacommands(QQmlJS::AST::SourceLocation,
QmlPropArgs qpa;
if (splitQmlPropertyArg(doc, topicsUsed.at(i).args, qpa)) {
QmlPropertyNode* n = new QmlPropertyNode(qpn, qpa.name_, qpa.type_, false);
+ n->setLocation(doc.location());
qpn->appendQmlPropNode(n);
+ n->setReadOnly(qpn->isReadOnly());
+ if (qpn->isDefault())
+ n->setDefault();
}
else
qDebug() << " FAILED TO PARSE QML PROPERTY:"
@@ -254,7 +258,7 @@ void QmlDocVisitor::applyMetacommands(QQmlJS::AST::SourceLocation,
QSet<QString> metacommands = doc.metaCommandsUsed();
if (metacommands.count() > 0) {
QString topic;
- QStringList args;
+ ArgList args;
QSet<QString>::iterator i = metacommands.begin();
while (i != metacommands.end()) {
if (topics.contains(*i)) {
@@ -273,7 +277,7 @@ void QmlDocVisitor::applyMetacommands(QQmlJS::AST::SourceLocation,
QmlPropertyNode* qpn = static_cast<QmlPropertyNode*>(node);
qpn->setReadOnly(0);
if (qpn->dataType() == "alias") {
- QStringList part = args[0].split(QLatin1Char(' '));
+ QStringList part = args[0].first.split(QLatin1Char(' '));
qpn->setDataType(part[0]);
}
}
@@ -319,12 +323,12 @@ void QmlDocVisitor::applyMetacommands(QQmlJS::AST::SourceLocation,
QmlClassNode::insertQmlModuleMember(qmid, qcn);
}
else if (command == COMMAND_QMLINHERITS) {
- if (node->name() == args[0])
- doc.location().warning(tr("%1 tries to inherit itself").arg(args[0]));
+ if (node->name() == args[0].first)
+ doc.location().warning(tr("%1 tries to inherit itself").arg(args[0].first));
else {
- CodeParser::setLink(node, Node::InheritsLink, args[0]);
+ CodeParser::setLink(node, Node::InheritsLink, args[0].first);
if (node->subType() == Node::QmlClass) {
- QmlClassNode::addInheritedBy(args[0],node);
+ QmlClassNode::addInheritedBy(args[0].first,node);
}
}
}
@@ -341,10 +345,10 @@ void QmlDocVisitor::applyMetacommands(QQmlJS::AST::SourceLocation,
}
}
else if ((command == COMMAND_INGROUP) && !args.isEmpty()) {
- QStringList::ConstIterator arg = args.begin();
- while (arg != args.end()) {
- tree->addToGroup(node, *arg);
- ++arg;
+ ArgList::ConstIterator argsIter = args.begin();
+ while (argsIter != args.end()) {
+ tree->addToGroup(node, argsIter->first);
+ ++argsIter;
}
}
else if (command == COMMAND_INTERNAL) {
@@ -362,7 +366,7 @@ void QmlDocVisitor::applyMetacommands(QQmlJS::AST::SourceLocation,
node->setStatus(Node::Preliminary);
}
else if (command == COMMAND_SINCE) {
- QString arg = args.join(" ");
+ QString arg = args[0].first; //.join(" ");
node->setSince(arg);
}
else {
@@ -484,22 +488,12 @@ bool QmlDocVisitor::visit(QQmlJS::AST::UiPublicMember *member)
if (qmlClass) {
QString name = member->name.toString();
QmlPropertyNode *qmlPropNode = new QmlPropertyNode(qmlClass, name, type, false);
+ //qmlPropNode->setLocation(doc.location());
qmlPropNode->setReadOnly(member->isReadonlyMember);
if (member->isDefaultMember)
qmlPropNode->setDefault();
applyDocumentation(member->firstSourceLocation(), qmlPropNode);
}
-#if 0
- if (qmlClass) {
- QString name = member->name->asString();
- QmlPropGroupNode *qmlPropGroup = new QmlPropGroupNode(qmlClass, name, false);
- if (member->isDefaultMember)
- qmlPropGroup->setDefault();
- QmlPropertyNode *qmlPropNode = new QmlPropertyNode(qmlPropGroup, name, type, false);
- qmlPropNode->setWritable(!member->isReadonlyMember);
- applyDocumentation(member->firstSourceLocation(), qmlPropGroup);
- }
-#endif
}
break;
}
diff --git a/src/tools/uic/qclass_lib_map.h b/src/tools/uic/qclass_lib_map.h
index 34ce374750..825813cc29 100644
--- a/src/tools/uic/qclass_lib_map.h
+++ b/src/tools/uic/qclass_lib_map.h
@@ -777,16 +777,6 @@ QT_CLASS_LIB(QWidgetItem, QtWidgets, qlayoutitem.h)
QT_CLASS_LIB(QWidgetItemV2, QtWidgets, qlayoutitem.h)
QT_CLASS_LIB(QPalette, QtGui, qpalette.h)
QT_CLASS_LIB(QColorGroup, QtWidgets, qpalette.h)
-QT_CLASS_LIB(QPlatformCursorImage, QtGui, qplatformcursor_qpa.h)
-QT_CLASS_LIB(QPlatformCursorPrivate, QtGui, qplatformcursor_qpa.h)
-QT_CLASS_LIB(QPlatformCursor, QtGui, qplatformcursor_qpa.h)
-QT_CLASS_LIB(QPlatformOpenGLContext, QtGui, qplatformopenglcontext_qpa.h)
-QT_CLASS_LIB(QPlatformIntegration, QtGui, qplatformintegration_qpa.h)
-QT_CLASS_LIB(QPlatformIntegrationFactoryInterface, QtGui, qplatformintegrationplugin_qpa.h)
-QT_CLASS_LIB(QPlatformIntegrationPlugin, QtGui, qplatformintegrationplugin_qpa.h)
-QT_CLASS_LIB(QPlatformScreen, QtGui, qplatformscreen_qpa.h)
-QT_CLASS_LIB(QPlatformWindow, QtGui, qplatformwindow_qpa.h)
-QT_CLASS_LIB(QPlatformWindowFormat, QtGui, qplatformwindowformat_qpa.h)
QT_CLASS_LIB(QSessionManager, QtGui, qsessionmanager.h)
QT_CLASS_LIB(QShortcut, QtWidgets, qshortcut.h)
QT_CLASS_LIB(QSizePolicy, QtWidgets, qsizepolicy.h)
@@ -915,8 +905,6 @@ QT_CLASS_LIB(QFontInfo, QtGui, qfontinfo.h)
QT_CLASS_LIB(QFontMetrics, QtGui, qfontmetrics.h)
QT_CLASS_LIB(QFontMetricsF, QtGui, qfontmetrics.h)
QT_CLASS_LIB(QGlyphs, QtGui, qglyphs.h)
-QT_CLASS_LIB(QSupportedWritingSystems, QtGui, qplatformfontdatabase_qpa.h)
-QT_CLASS_LIB(QPlatformFontDatabase, QtGui, qplatformfontdatabase_qpa.h)
QT_CLASS_LIB(QStaticText, QtGui, qstatictext.h)
QT_CLASS_LIB(QSyntaxHighlighter, QtGui, qsyntaxhighlighter.h)
QT_CLASS_LIB(QTextCursor, QtGui, qtextcursor.h)
diff --git a/src/widgets/dialogs/qcolordialog.h b/src/widgets/dialogs/qcolordialog.h
index 1daead3879..9e8e56e927 100644
--- a/src/widgets/dialogs/qcolordialog.h
+++ b/src/widgets/dialogs/qcolordialog.h
@@ -124,7 +124,6 @@ private:
Q_PRIVATE_SLOT(d_func(), void _q_newColorTypedIn(QRgb rgb))
Q_PRIVATE_SLOT(d_func(), void _q_newCustom(int, int))
Q_PRIVATE_SLOT(d_func(), void _q_newStandard(int, int))
- Q_PRIVATE_SLOT(d_func(), void _q_platformRunNativeAppModalPanel())
friend class QColorShower;
};
diff --git a/src/widgets/dialogs/qdialog.cpp b/src/widgets/dialogs/qdialog.cpp
index 9410a9b62b..dbe5da8ed4 100644
--- a/src/widgets/dialogs/qdialog.cpp
+++ b/src/widgets/dialogs/qdialog.cpp
@@ -52,10 +52,10 @@
#include "qwhatsthis.h"
#include "qmenu.h"
#include "qcursor.h"
-#include "qplatformtheme_qpa.h"
+#include <qpa/qplatformtheme.h>
#include "private/qdialog_p.h"
#include "private/qguiapplication_p.h"
-#include "qplatformtheme_qpa.h"
+#include <qpa/qplatformtheme.h>
#ifndef QT_NO_ACCESSIBILITY
#include "qaccessible.h"
#endif
@@ -88,8 +88,6 @@ QPlatformDialogHelper *QDialogPrivate::platformHelper() const
if (m_platformHelper) {
QObject::connect(m_platformHelper, SIGNAL(accept()), dialog, SLOT(accept()));
QObject::connect(m_platformHelper, SIGNAL(reject()), dialog, SLOT(reject()));
- QObject::connect(m_platformHelper, SIGNAL(launchNativeAppModalPanel()),
- dialog, SLOT(_q_platformRunNativeAppModalPanel()));
ncThis->initHelper(m_platformHelper);
}
}
@@ -118,13 +116,6 @@ bool QDialogPrivate::setNativeDialogVisible(bool visible)
return nativeDialogInUse;
}
-void QDialogPrivate::_q_platformRunNativeAppModalPanel()
-{
- if (nativeDialogInUse)
- platformHelper()->_q_platformRunNativeAppModalPanel();
-}
-
-
QVariant QDialogPrivate::styleHint(QPlatformDialogHelper::StyleHint hint) const
{
if (const QPlatformDialogHelper *helper = platformHelper())
@@ -132,6 +123,14 @@ QVariant QDialogPrivate::styleHint(QPlatformDialogHelper::StyleHint hint) const
return QPlatformDialogHelper::defaultStyleHint(hint);
}
+void QDialogPrivate::deleteNativeDialog()
+{
+ if (QPlatformDialogHelper *helper = platformHelper()) {
+ helper->deleteNativeDialog_sys();
+ nativeDialogInUse = false;
+ }
+}
+
/*!
\class QDialog
\brief The QDialog class is the base class of dialog windows.
@@ -328,6 +327,7 @@ QDialog::QDialog(QDialogPrivate &dd, QWidget *parent, Qt::WindowFlags f)
QDialog::~QDialog()
{
+ Q_D(QDialog);
QT_TRY {
// Need to hide() here, as our (to-be) overridden hide()
// will not be called in ~QWidget.
@@ -335,6 +335,7 @@ QDialog::~QDialog()
} QT_CATCH(...) {
// we're in the destructor - just swallow the exception
}
+ d->deleteNativeDialog();
}
/*!
@@ -525,13 +526,14 @@ int QDialog::exec()
}
show();
- if (d->nativeDialogInUse)
- d->platformHelper()->platformNativeDialogModalHelp();
-
- QEventLoop eventLoop;
- d->eventLoop = &eventLoop;
QPointer<QDialog> guard = this;
- (void) eventLoop.exec(QEventLoop::DialogExec);
+ if (d->nativeDialogInUse) {
+ d->platformHelper()->exec_sys();
+ } else {
+ QEventLoop eventLoop;
+ d->eventLoop = &eventLoop;
+ (void) eventLoop.exec(QEventLoop::DialogExec);
+ }
if (guard.isNull())
return QDialog::Rejected;
d->eventLoop = 0;
diff --git a/src/widgets/dialogs/qdialog.h b/src/widgets/dialogs/qdialog.h
index f20ff46d41..29a5a724d5 100644
--- a/src/widgets/dialogs/qdialog.h
+++ b/src/widgets/dialogs/qdialog.h
@@ -117,7 +117,6 @@ protected:
private:
Q_DECLARE_PRIVATE(QDialog)
Q_DISABLE_COPY(QDialog)
- Q_PRIVATE_SLOT(d_func(), void _q_platformRunNativeAppModalPanel())
#ifdef Q_OS_WINCE_WM
Q_PRIVATE_SLOT(d_func(), void _q_doneAction())
diff --git a/src/widgets/dialogs/qdialog_p.h b/src/widgets/dialogs/qdialog_p.h
index c40a885f86..3b8a5edb0f 100644
--- a/src/widgets/dialogs/qdialog_p.h
+++ b/src/widgets/dialogs/qdialog_p.h
@@ -58,7 +58,7 @@
#include "QtCore/qpointer.h"
#include "QtWidgets/qdialog.h"
#include "QtWidgets/qpushbutton.h"
-#include <QtGui/QPlatformDialogHelper>
+#include <qpa/qplatformdialoghelper.h>
QT_BEGIN_NAMESPACE
@@ -79,11 +79,11 @@ public:
nativeDialogInUse(false), m_platformHelper(0), m_platformHelperCreated(false)
{}
~QDialogPrivate() { delete m_platformHelper; }
- void _q_platformRunNativeAppModalPanel();
QWindow *parentWindow() const;
bool setNativeDialogVisible(bool visible);
QVariant styleHint(QPlatformDialogHelper::StyleHint hint) const;
+ void deleteNativeDialog();
QPointer<QPushButton> mainDef;
Qt::Orientation orientation;
diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp
index 43bb164366..a87d811d30 100644
--- a/src/widgets/dialogs/qfiledialog.cpp
+++ b/src/widgets/dialogs/qfiledialog.cpp
@@ -362,13 +362,11 @@ QFileDialog::QFileDialog(const QFileDialogArgs &args)
*/
QFileDialog::~QFileDialog()
{
- Q_D(QFileDialog);
#ifndef QT_NO_SETTINGS
QSettings settings(QSettings::UserScope, QLatin1String("Trolltech"));
settings.beginGroup(QLatin1String("Qt"));
settings.setValue(QLatin1String("filedialog"), saveState());
#endif
- d->deleteNativeDialog_sys();
}
/*!
@@ -1372,10 +1370,10 @@ void QFileDialog::setAcceptMode(QFileDialog::AcceptMode mode)
d->qFileDialogUi->lookInCombo->setEditable(false);
}
d->retranslateWindowTitle();
-#if defined(Q_OS_MAC)
- d->deleteNativeDialog_sys();
+ // we need to recreate the native dialog when changing the AcceptMode
+ d->deleteNativeDialog();
+ // clear WA_DontShowOnScreen so that d->canBeNativeDialog() doesn't return false incorrectly
setAttribute(Qt::WA_DontShowOnScreen, false);
-#endif
}
/*
diff --git a/src/widgets/dialogs/qfiledialog.h b/src/widgets/dialogs/qfiledialog.h
index c5298b1227..ee4ae72519 100644
--- a/src/widgets/dialogs/qfiledialog.h
+++ b/src/widgets/dialogs/qfiledialog.h
@@ -252,7 +252,6 @@ private:
Q_PRIVATE_SLOT(d_func(), void _q_rowsInserted(const QModelIndex & parent))
Q_PRIVATE_SLOT(d_func(), void _q_fileRenamed(const QString &path,
const QString oldName, const QString newName))
- Q_PRIVATE_SLOT(d_func(), void _q_platformRunNativeAppModalPanel())
friend class QPlatformDialogHelper;
};
diff --git a/src/widgets/dialogs/qfiledialog_p.h b/src/widgets/dialogs/qfiledialog_p.h
index a66ee757f6..0132d4ba6f 100644
--- a/src/widgets/dialogs/qfiledialog_p.h
+++ b/src/widgets/dialogs/qfiledialog_p.h
@@ -244,8 +244,6 @@ public:
// dialog. Returning false means that a non-native dialog must be
// used instead.
bool canBeNativeDialog();
- void deleteNativeDialog_sys();
- QDialog::DialogCode dialogResultCode_sys();
void setDirectory_sys(const QString &directory);
QString directory_sys() const;
@@ -347,24 +345,6 @@ inline QString QFileDialogPrivate::rootPath() const {
return model->rootPath();
}
-// Dummies for platforms that don't use native dialogs:
-inline void QFileDialogPrivate::deleteNativeDialog_sys()
-{
- if (QPlatformFileDialogHelper *helper = platformFileDialogHelper()) {
- helper->deleteNativeDialog_sys();
- nativeDialogInUse = false;
- }
-}
-
-inline QDialog::DialogCode QFileDialogPrivate::dialogResultCode_sys()
-{
- QDialog::DialogCode result = QDialog::Rejected;
- if (QPlatformDialogHelper *helper = platformHelper())
- if (helper->dialogResultCode_sys() == QPlatformDialogHelper::Accepted)
- result = QDialog::Accepted;
- return result;
-}
-
inline void QFileDialogPrivate::setDirectory_sys(const QString &directory)
{
if (QPlatformFileDialogHelper *helper = platformFileDialogHelper())
diff --git a/src/widgets/dialogs/qfontdialog.h b/src/widgets/dialogs/qfontdialog.h
index c5f654a50a..979293c234 100644
--- a/src/widgets/dialogs/qfontdialog.h
+++ b/src/widgets/dialogs/qfontdialog.h
@@ -118,9 +118,6 @@ private:
Q_PRIVATE_SLOT(d_func(), void _q_styleHighlighted(int))
Q_PRIVATE_SLOT(d_func(), void _q_sizeHighlighted(int))
Q_PRIVATE_SLOT(d_func(), void _q_updateSample())
-#if defined(Q_WS_MAC)
- Q_PRIVATE_SLOT(d_func(), void _q_macRunNativeAppModalPanel())
-#endif
};
Q_DECLARE_OPERATORS_FOR_FLAGS(QFontDialog::FontDialogOptions)
diff --git a/src/widgets/dialogs/qfontdialog_p.h b/src/widgets/dialogs/qfontdialog_p.h
index 75a9045d2b..e7b0e91340 100644
--- a/src/widgets/dialogs/qfontdialog_p.h
+++ b/src/widgets/dialogs/qfontdialog_p.h
@@ -57,7 +57,7 @@
#include "private/qdialog_p.h"
#include "qfontdatabase.h"
#include "qfontdialog.h"
-#include "qplatformdialoghelper_qpa.h"
+#include <qpa/qplatformdialoghelper.h>
#include "qsharedpointer.h"
#ifndef QT_NO_FONTDIALOG
diff --git a/src/widgets/dialogs/qmessagebox.cpp b/src/widgets/dialogs/qmessagebox.cpp
index 5c1a2a4a64..cb32de4bca 100644
--- a/src/widgets/dialogs/qmessagebox.cpp
+++ b/src/widgets/dialogs/qmessagebox.cpp
@@ -67,7 +67,7 @@
#ifdef Q_OS_WIN
# include <QtCore/qt_windows.h>
-# include <QtGui/QPlatformNativeInterface>
+#include <qpa/qplatformnativeinterface.h>
#endif
QT_BEGIN_NAMESPACE
diff --git a/src/widgets/dialogs/qwizard_win.cpp b/src/widgets/dialogs/qwizard_win.cpp
index 49450be75b..3e0aedcabc 100644
--- a/src/widgets/dialogs/qwizard_win.cpp
+++ b/src/widgets/dialogs/qwizard_win.cpp
@@ -45,7 +45,7 @@
#include "qwizard_win_p.h"
#include <private/qsystemlibrary_p.h>
#include <private/qapplication_p.h>
-#include "qplatformnativeinterface_qpa.h"
+#include <qpa/qplatformnativeinterface.h>
#include "qwizard.h"
#include "qpaintengine.h"
#include "qapplication.h"
diff --git a/src/widgets/itemviews/qheaderview.cpp b/src/widgets/itemviews/qheaderview.cpp
index 9b6b2368c9..4ab984b53c 100644
--- a/src/widgets/itemviews/qheaderview.cpp
+++ b/src/widgets/itemviews/qheaderview.cpp
@@ -122,7 +122,7 @@ QDataStream &operator>>(QDataStream &in, QHeaderViewPrivate::SectionItem &sectio
A header can be fixed in place, or made movable with setSectionsMovable(). It can
be made clickable with setSectionsClickable(), and has resizing behavior in
- accordance with setResizeMode() and setSectionResizeMode()
+ accordance with setSectionResizeMode()
\note Double-clicking on a header to resize a section only applies for
visible rows.
@@ -162,7 +162,7 @@ QDataStream &operator>>(QDataStream &in, QHeaderViewPrivate::SectionItem &sectio
The resize mode specifies the behavior of the header sections. It can be
set on the entire header view or on individual sections using
- setResizeMode().
+ setSectionResizeMode().
\value Interactive The user can resize the section. The section can also be
resized programmatically using resizeSection(). The section size
@@ -501,7 +501,7 @@ void QHeaderView::setOffsetToLastSection()
/*!
Returns the length along the orientation of the header.
- \sa sizeHint(), setResizeMode(), offset()
+ \sa sizeHint(), setSectionResizeMode(), offset()
*/
int QHeaderView::length() const
@@ -625,7 +625,7 @@ int QHeaderView::logicalIndexAt(int position) const
Returns the width (or height for vertical headers) of the given
\a logicalIndex.
- \sa length(), setResizeMode(), defaultSectionSize()
+ \sa length(), setSectionResizeMode(), defaultSectionSize()
*/
int QHeaderView::sectionSize(int logicalIndex) const
@@ -1186,7 +1186,7 @@ bool QHeaderView::highlightSections() const
\sa resizeMode(), length(), sectionResized()
*/
-void QHeaderView::setResizeMode(ResizeMode mode)
+void QHeaderView::setSectionResizeMode(ResizeMode mode)
{
Q_D(QHeaderView);
initializeSections();
@@ -1243,10 +1243,19 @@ void QHeaderView::setSectionResizeMode(int logicalIndex, ResizeMode mode)
*/
/*!
+ \obsolete
+ \fn void QHeaderView::setResizeMode(ResizeMode mode)
+
+ Use setSectionResizeMode instead.
+
+ \sa setSectionResizeMode()
+*/
+
+/*!
Returns the resize mode that applies to the section specified by the given
\a logicalIndex.
- \sa setResizeMode()
+ \sa setSectionResizeMode()
*/
QHeaderView::ResizeMode QHeaderView::sectionResizeMode(int logicalIndex) const
@@ -1396,7 +1405,7 @@ Qt::SortOrder QHeaderView::sortIndicatorOrder() const
property will override the resize mode set on the last section in the
header.
- \sa setResizeMode()
+ \sa setSectionResizeMode()
*/
bool QHeaderView::stretchLastSection() const
{
@@ -1428,7 +1437,7 @@ void QHeaderView::setStretchLastSection(bool stretch)
The default value is false.
- \sa setResizeMode()
+ \sa setSectionResizeMode()
*/
bool QHeaderView::cascadingSectionResizes() const
{
@@ -1449,7 +1458,7 @@ void QHeaderView::setCascadingSectionResizes(bool enable)
This property only affects sections that have \l Interactive or \l Fixed
as their resize mode.
- \sa setResizeMode() minimumSectionSize
+ \sa setSectionResizeMode() minimumSectionSize
*/
int QHeaderView::defaultSectionSize() const
{
@@ -1475,7 +1484,7 @@ void QHeaderView::setDefaultSectionSize(int size)
This property is honored by all \l{ResizeMode}{resize modes}.
- \sa setResizeMode() defaultSectionSize
+ \sa setSectionResizeMode() defaultSectionSize
*/
int QHeaderView::minimumSectionSize() const
{
diff --git a/src/widgets/itemviews/qheaderview.h b/src/widgets/itemviews/qheaderview.h
index 0cea318953..f3f5b95a04 100644
--- a/src/widgets/itemviews/qheaderview.h
+++ b/src/widgets/itemviews/qheaderview.h
@@ -131,10 +131,12 @@ public:
void setHighlightSections(bool highlight);
bool highlightSections() const;
- void setResizeMode(ResizeMode mode);
ResizeMode sectionResizeMode(int logicalIndex) const;
+ void setSectionResizeMode(ResizeMode mode);
void setSectionResizeMode(int logicalIndex, ResizeMode mode);
#if QT_DEPRECATED_SINCE(5, 0)
+ inline QT_DEPRECATED void setResizeMode(ResizeMode mode)
+ { setSectionResizeMode(mode); }
inline QT_DEPRECATED void setResizeMode(int logicalindex, ResizeMode mode)
{ setSectionResizeMode(logicalindex, mode); }
inline QT_DEPRECATED ResizeMode resizeMode(int logicalindex) const
diff --git a/src/widgets/itemviews/qitemdelegate.cpp b/src/widgets/itemviews/qitemdelegate.cpp
index 68d31c7dd2..f5700746b8 100644
--- a/src/widgets/itemviews/qitemdelegate.cpp
+++ b/src/widgets/itemviews/qitemdelegate.cpp
@@ -44,7 +44,8 @@
#ifndef QT_NO_ITEMVIEWS
#include <qabstractitemmodel.h>
#include <qapplication.h>
-#include <qplatformintegration_qpa.h>
+#include <qpa/qplatformintegration.h>
+#include <qpa/qplatformdrag.h>
#include <private/qguiapplication_p.h>
#include <qbrush.h>
#include <qlineedit.h>
diff --git a/src/widgets/itemviews/qstyleditemdelegate.cpp b/src/widgets/itemviews/qstyleditemdelegate.cpp
index fc2d18a459..fce80341e1 100644
--- a/src/widgets/itemviews/qstyleditemdelegate.cpp
+++ b/src/widgets/itemviews/qstyleditemdelegate.cpp
@@ -44,7 +44,8 @@
#ifndef QT_NO_ITEMVIEWS
#include <qabstractitemmodel.h>
#include <qapplication.h>
-#include <qplatformintegration_qpa.h>
+#include <qpa/qplatformintegration.h>
+#include <qpa/qplatformdrag.h>
#include <private/qguiapplication_p.h>
#include <qbrush.h>
#include <qlineedit.h>
diff --git a/src/widgets/kernel/kernel.pri b/src/widgets/kernel/kernel.pri
index 97430babd3..9e3d82ea12 100644
--- a/src/widgets/kernel/kernel.pri
+++ b/src/widgets/kernel/kernel.pri
@@ -42,7 +42,7 @@ HEADERS += \
kernel/qsoftkeymanager_common_p.h \
kernel/qdesktopwidget_qpa_p.h \
kernel/qwidgetwindow_qpa_p.h \
- kernel/qplatformmenu_qpa.h
+ kernel/qplatformmenu.h
SOURCES += \
kernel/qaction.cpp \
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp
index 381aa29eba..60328c4cf6 100644
--- a/src/widgets/kernel/qapplication.cpp
+++ b/src/widgets/kernel/qapplication.cpp
@@ -72,7 +72,7 @@
#include <QtWidgets/qgraphicsproxywidget.h>
#include <QtGui/qstylehints.h>
#include <QtGui/qinputmethod.h>
-#include <QtGui/qplatformtheme_qpa.h>
+#include <qpa/qplatformtheme.h>
#include "private/qkeymapper_p.h"
@@ -92,7 +92,7 @@
#include "qgesture.h"
#include "private/qgesturemanager_p.h"
#include "private/qguiapplication_p.h"
-#include "qplatformfontdatabase_qpa.h"
+#include <qpa/qplatformfontdatabase.h>
#ifndef QT_NO_LIBRARY
#include "qlibrary.h"
#endif
@@ -402,13 +402,7 @@ bool Q_WIDGETS_EXPORT qt_tab_all_widgets = true;
bool qt_in_tab_key_event = false;
int qt_antialiasing_threshold = -1;
QSize QApplicationPrivate::app_strut = QSize(0,0); // no default application strut
-bool QApplicationPrivate::animate_ui = true;
-bool QApplicationPrivate::animate_menu = false;
-bool QApplicationPrivate::fade_menu = false;
-bool QApplicationPrivate::animate_combo = false;
-bool QApplicationPrivate::animate_tooltip = false;
-bool QApplicationPrivate::fade_tooltip = false;
-bool QApplicationPrivate::animate_toolbox = false;
+int QApplicationPrivate::enabledAnimations = QPlatformTheme::GeneralUiEffect;
bool QApplicationPrivate::widgetCount = false;
bool QApplicationPrivate::load_testability = false;
#ifdef QT_KEYPAD_NAVIGATION
@@ -685,6 +679,10 @@ void QApplicationPrivate::initialize()
if (qt_is_gui_used)
initializeMultitouch();
+
+ if (QApplication::desktopSettingsAware())
+ if (const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme())
+ QApplicationPrivate::enabledAnimations = theme->themeHint(QPlatformTheme::UiEffects).toInt();
}
/*!
@@ -819,12 +817,7 @@ QApplication::~QApplication()
QApplicationPrivate::obey_desktop_settings = true;
QApplicationPrivate::app_strut = QSize(0, 0);
- QApplicationPrivate::animate_ui = true;
- QApplicationPrivate::animate_menu = false;
- QApplicationPrivate::fade_menu = false;
- QApplicationPrivate::animate_combo = false;
- QApplicationPrivate::animate_tooltip = false;
- QApplicationPrivate::fade_tooltip = false;
+ QApplicationPrivate::enabledAnimations = QPlatformTheme::GeneralUiEffect;
QApplicationPrivate::widgetCount = false;
#ifndef QT_NO_STATEMACHINE
diff --git a/src/widgets/kernel/qapplication_p.h b/src/widgets/kernel/qapplication_p.h
index b1f510c5a5..63862269d6 100644
--- a/src/widgets/kernel/qapplication_p.h
+++ b/src/widgets/kernel/qapplication_p.h
@@ -61,7 +61,7 @@
#include "QtGui/qregion.h"
#include "QtGui/qwindow.h"
#include "qwidget.h"
-#include "QtGui/qplatformnativeinterface_qpa.h"
+#include <qpa/qplatformnativeinterface.h>
#include "QtCore/qmutex.h"
#include "QtCore/qtranslator.h"
#include "QtCore/qbasictimer.h"
@@ -72,7 +72,7 @@
#include <QTime>
#include <QWindowSystemInterface>
#include "private/qwindowsysteminterface_qpa_p.h"
-#include "QtGui/qplatformintegration_qpa.h"
+#include <qpa/qplatformintegration.h>
#include "private/qguiapplication_p.h"
QT_BEGIN_NAMESPACE
@@ -266,13 +266,7 @@ public:
static int wheel_scroll_lines;
#endif
- static bool animate_ui;
- static bool animate_menu;
- static bool animate_tooltip;
- static bool animate_combo;
- static bool fade_menu;
- static bool fade_tooltip;
- static bool animate_toolbox;
+ static int enabledAnimations; // Combination of QPlatformTheme::UiEffect
static bool widgetCount; // Coupled with -widgetcount switch
static bool load_testability; // Coupled with -testability switch
diff --git a/src/widgets/kernel/qapplication_qpa.cpp b/src/widgets/kernel/qapplication_qpa.cpp
index 0651d5bf44..e737fe1d8d 100644
--- a/src/widgets/kernel/qapplication_qpa.cpp
+++ b/src/widgets/kernel/qapplication_qpa.cpp
@@ -52,15 +52,15 @@
#include "private/qevent_p.h"
#include "qgenericpluginfactory_qpa.h"
-#include "private/qplatformintegrationfactory_qpa_p.h"
+#include <qpa/qplatformintegrationfactory_p.h>
#include <qdesktopwidget.h>
-#include <QPlatformCursor>
-#include <QPlatformTheme>
+#include <qpa/qplatformcursor.h>
+#include <qpa/qplatformtheme.h>
#include <qdebug.h>
#include <QWindowSystemInterface>
#include "private/qwindowsysteminterface_qpa_p.h"
-#include <QPlatformIntegration>
+#include <qpa/qplatformintegration.h>
#include "qdesktopwidget_qpa_p.h"
#include "qwidgetwindow_qpa_p.h"
@@ -354,58 +354,47 @@ int QApplication::wheelScrollLines()
}
#endif
-void QApplication::setEffectEnabled(Qt::UIEffect effect, bool enable)
+static inline int uiEffectToFlag(Qt::UIEffect effect)
{
switch (effect) {
+ case Qt::UI_General:
+ return QPlatformTheme::GeneralUiEffect;
case Qt::UI_AnimateMenu:
- QApplicationPrivate::animate_menu = enable;
- break;
+ return QPlatformTheme::AnimateMenuUiEffect;
case Qt::UI_FadeMenu:
- if (enable)
- QApplicationPrivate::animate_menu = true;
- QApplicationPrivate::fade_menu = enable;
- break;
+ return QPlatformTheme::FadeMenuUiEffect;
case Qt::UI_AnimateCombo:
- QApplicationPrivate::animate_combo = enable;
- break;
+ return QPlatformTheme::AnimateComboUiEffect;
case Qt::UI_AnimateTooltip:
- QApplicationPrivate::animate_tooltip = enable;
- break;
+ return QPlatformTheme::AnimateTooltipUiEffect;
case Qt::UI_FadeTooltip:
- if (enable)
- QApplicationPrivate::animate_tooltip = true;
- QApplicationPrivate::fade_tooltip = enable;
- break;
+ return QPlatformTheme::FadeTooltipUiEffect;
case Qt::UI_AnimateToolBox:
- QApplicationPrivate::animate_toolbox = enable;
- break;
- default:
- QApplicationPrivate::animate_ui = enable;
- break;
+ return QPlatformTheme::AnimateToolBoxUiEffect;
+ }
+ return 0;
+}
+
+void QApplication::setEffectEnabled(Qt::UIEffect effect, bool enable)
+{
+ int effectFlags = uiEffectToFlag(effect);
+ if (enable) {
+ if (effectFlags & QPlatformTheme::FadeMenuUiEffect)
+ effectFlags |= QPlatformTheme::AnimateMenuUiEffect;
+ if (effectFlags & QPlatformTheme::FadeTooltipUiEffect)
+ effectFlags |= QPlatformTheme::AnimateTooltipUiEffect;
+ QApplicationPrivate::enabledAnimations |= effectFlags;
+ } else {
+ QApplicationPrivate::enabledAnimations &= ~effectFlags;
}
}
bool QApplication::isEffectEnabled(Qt::UIEffect effect)
{
- if (QColormap::instance().depth() < 16 || !QApplicationPrivate::animate_ui)
+ return QColormap::instance().depth() >= 16
+ && (QApplicationPrivate::enabledAnimations & QPlatformTheme::GeneralUiEffect)
+ && (QApplicationPrivate::enabledAnimations & uiEffectToFlag(effect));
return false;
-
- switch(effect) {
- case Qt::UI_AnimateMenu:
- return QApplicationPrivate::animate_menu;
- case Qt::UI_FadeMenu:
- return QApplicationPrivate::fade_menu;
- case Qt::UI_AnimateCombo:
- return QApplicationPrivate::animate_combo;
- case Qt::UI_AnimateTooltip:
- return QApplicationPrivate::animate_tooltip;
- case Qt::UI_FadeTooltip:
- return QApplicationPrivate::fade_tooltip;
- case Qt::UI_AnimateToolBox:
- return QApplicationPrivate::animate_toolbox;
- default:
- return QApplicationPrivate::animate_ui;
- }
}
QWidget *QApplication::topLevelAt(const QPoint &pos)
diff --git a/src/widgets/kernel/qicon.cpp b/src/widgets/kernel/qicon.cpp
index dc506b780c..448b6a8cfd 100644
--- a/src/widgets/kernel/qicon.cpp
+++ b/src/widgets/kernel/qicon.cpp
@@ -816,10 +816,13 @@ void QIcon::addFile(const QString &fileName, const QSize &size, Mode mode, State
QString suffix = info.suffix();
if (!suffix.isEmpty()) {
// first try version 2 engines..
- if (QIconEngineFactoryInterface *factory = qobject_cast<QIconEngineFactoryInterface*>(loader()->instance(suffix))) {
- if (QIconEngine *engine = factory->create(fileName)) {
- d = new QIconPrivate;
- d->engine = engine;
+ const int index = loader()->indexOf(suffix);
+ if (index != -1) {
+ if (QIconEngineFactoryInterface *factory = qobject_cast<QIconEngineFactoryInterface*>(loader()->instance(index))) {
+ if (QIconEngine *engine = factory->create(fileName)) {
+ d = new QIconPrivate;
+ d->engine = engine;
+ }
}
}
}
@@ -1068,12 +1071,17 @@ QDataStream &operator>>(QDataStream &s, QIcon &icon)
icon.d->engine = engine;
engine->read(s);
#if !defined (QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)
- } else if (QIconEngineFactoryInterface *factory = qobject_cast<QIconEngineFactoryInterface*>(loader()->instance(key))) {
- if (QIconEngine *engine= factory->create()) {
- icon.d = new QIconPrivate;
- icon.d->engine = engine;
- engine->read(s);
- }
+ } else {
+ const int index = loader()->indexOf(key);
+ if (index != -1) {
+ if (QIconEngineFactoryInterface *factory = qobject_cast<QIconEngineFactoryInterface*>(loader()->instance(index))) {
+ if (QIconEngine *engine= factory->create()) {
+ icon.d = new QIconPrivate;
+ icon.d->engine = engine;
+ engine->read(s);
+ } // factory
+ } // instance
+ } // index
#endif
}
} else if (s.version() == QDataStream::Qt_4_2) {
diff --git a/src/widgets/kernel/qiconloader.cpp b/src/widgets/kernel/qiconloader.cpp
index e1828fd1f1..acbf7c1d07 100644
--- a/src/widgets/kernel/qiconloader.cpp
+++ b/src/widgets/kernel/qiconloader.cpp
@@ -48,7 +48,7 @@
#include <QtWidgets/QApplication>
#include <QtWidgets/QIconEnginePlugin>
#include <QtGui/QPixmapCache>
-#include <QtGui/QPlatformTheme>
+#include <qpa/qplatformtheme.h>
#include <QtWidgets/QIconEngine>
#include <QtWidgets/QStyleOption>
#include <QtCore/QList>
@@ -121,7 +121,7 @@ void QIconLoader::ensureInitialized()
QFactoryLoader iconFactoryLoader(QIconEngineFactoryInterface_iid,
QLatin1String("/iconengines"),
Qt::CaseInsensitive);
- if (iconFactoryLoader.keys().contains(QLatin1String("svg")))
+ if (iconFactoryLoader.keyMap().key(QLatin1String("svg"), -1) != -1)
m_supportsSvg = true;
#endif //QT_NO_LIBRARY
}
diff --git a/src/widgets/kernel/qplatformmenu_qpa.h b/src/widgets/kernel/qplatformmenu.h
index cbd7eae6ac..cbd7eae6ac 100644
--- a/src/widgets/kernel/qplatformmenu_qpa.h
+++ b/src/widgets/kernel/qplatformmenu.h
diff --git a/src/widgets/kernel/qplatformmenu_qpa.cpp b/src/widgets/kernel/qplatformmenu_qpa.cpp
index 95a70d9dcd..f28560e560 100644
--- a/src/widgets/kernel/qplatformmenu_qpa.cpp
+++ b/src/widgets/kernel/qplatformmenu_qpa.cpp
@@ -39,7 +39,7 @@
**
****************************************************************************/
-#include "qplatformmenu_qpa.h"
+#include "qplatformmenu.h"
QT_BEGIN_NAMESPACE
diff --git a/src/widgets/kernel/qwhatsthis.cpp b/src/widgets/kernel/qwhatsthis.cpp
index 9f4d8571b3..c1a6ead381 100644
--- a/src/widgets/kernel/qwhatsthis.cpp
+++ b/src/widgets/kernel/qwhatsthis.cpp
@@ -55,7 +55,7 @@
#include "qcursor.h"
#include "qbitmap.h"
#include "qtextdocument.h"
-#include "qplatformtheme_qpa.h"
+#include <qpa/qplatformtheme.h>
#include "private/qtextdocumentlayout_p.h"
#include "qtoolbutton.h"
#include "qdebug.h"
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index 6d5bdf92cd..74612559f0 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -67,7 +67,7 @@
# include "qtoolbar.h"
# include <private/qmainwindowlayout_p.h>
#endif
-#include "qplatformwindow_qpa.h"
+#include <qpa/qplatformwindow.h>
#include "private/qwidgetwindow_qpa_p.h"
#include "qpainter.h"
#include "qtooltip.h"
@@ -1530,7 +1530,7 @@ void QWidgetPrivate::createTLExtra()
x->normalGeometry = QRect(0,0,-1,-1);
x->savedFlags = 0;
x->opacity = 255;
- x->posFromMove = false;
+ x->posIncludesFrame = 0;
x->sizeAdjusted = false;
x->inTopLevelResize = false;
x->inRepaint = false;
@@ -3242,11 +3242,11 @@ int QWidget::y() const
QPoint QWidget::pos() const
{
Q_D(const QWidget);
- if (isWindow() && ! (windowType() == Qt::Popup)) {
- QRect fs = d->frameStrut();
- return QPoint(data->crect.x() - fs.left(), data->crect.y() - fs.top());
- }
- return data->crect.topLeft();
+ QPoint result = data->crect.topLeft();
+ if (isWindow() && ! (windowType() == Qt::Popup))
+ if (!d->maybeTopData() || !d->maybeTopData()->posIncludesFrame)
+ result -= d->frameStrut().topLeft();
+ return result;
}
/*!
@@ -6475,14 +6475,17 @@ void QWidget::move(const QPoint &p)
{
Q_D(QWidget);
setAttribute(Qt::WA_Moved);
- if (isWindow())
- d->topData()->posFromMove = true;
if (testAttribute(Qt::WA_WState_Created)) {
+ if (isWindow())
+ d->topData()->posIncludesFrame = false;
d->setGeometry_sys(p.x() + geometry().x() - QWidget::x(),
p.y() + geometry().y() - QWidget::y(),
width(), height(), true);
d->setDirtyOpaqueRegion();
} else {
+ // no frame yet: see also QWidgetPrivate::fixPosIncludesFrame(), QWindowPrivate::PositionPolicy.
+ if (isWindow())
+ d->topData()->posIncludesFrame = true;
data->crect.moveTopLeft(p); // no frame yet
setAttribute(Qt::WA_PendingMoveEvent);
}
@@ -6499,6 +6502,7 @@ void QWidget::resize(const QSize &s)
Q_D(QWidget);
setAttribute(Qt::WA_Resized);
if (testAttribute(Qt::WA_WState_Created)) {
+ d->fixPosIncludesFrame();
d->setGeometry_sys(geometry().x(), geometry().y(), s.width(), s.height(), false);
d->setDirtyOpaqueRegion();
} else {
@@ -6513,7 +6517,7 @@ void QWidget::setGeometry(const QRect &r)
setAttribute(Qt::WA_Resized);
setAttribute(Qt::WA_Moved);
if (isWindow())
- d->topData()->posFromMove = false;
+ d->topData()->posIncludesFrame = 0;
if (testAttribute(Qt::WA_WState_Created)) {
d->setGeometry_sys(r.x(), r.y(), r.width(), r.height(), true);
d->setDirtyOpaqueRegion();
@@ -6681,11 +6685,11 @@ bool QWidget::restoreGeometry(const QByteArray &geometry)
restoredNormalGeometry.moveTop(qMax(restoredNormalGeometry.top(), availableGeometry.top() + frameHeight));
if (maximized || fullScreen) {
- // set geomerty before setting the window state to make
+ // set geometry before setting the window state to make
// sure the window is maximized to the right screen.
// Skip on windows: the window is restored into a broken
// half-maximized state.
-#ifndef Q_WS_WIN
+#ifndef Q_OS_WIN
setGeometry(restoredNormalGeometry);
#endif
Qt::WindowStates ws = windowState();
diff --git a/src/widgets/kernel/qwidget_p.h b/src/widgets/kernel/qwidget_p.h
index d7c0ec75b0..4b3216c6f0 100644
--- a/src/widgets/kernel/qwidget_p.h
+++ b/src/widgets/kernel/qwidget_p.h
@@ -157,7 +157,7 @@ struct QTLWExtra {
// *************************** Cross-platform bit fields ****************************
uint opacity : 8;
- uint posFromMove : 1;
+ uint posIncludesFrame : 1;
uint sizeAdjusted : 1;
uint inTopLevelResize : 1;
uint inRepaint : 1;
@@ -432,6 +432,7 @@ public:
void scroll_sys(int dx, int dy, const QRect &r);
void deactivateWidgetCleanup();
void setGeometry_sys(int, int, int, int, bool);
+ void fixPosIncludesFrame();
void sendPendingMoveAndResizeEvents(bool recursive = false, bool disableUpdates = false);
void activateChildLayoutsRecursively();
void show_recursive();
diff --git a/src/widgets/kernel/qwidget_qpa.cpp b/src/widgets/kernel/qwidget_qpa.cpp
index a8175455b2..c4d1fb1d0d 100644
--- a/src/widgets/kernel/qwidget_qpa.cpp
+++ b/src/widgets/kernel/qwidget_qpa.cpp
@@ -47,14 +47,15 @@
#include "private/qwidgetwindow_qpa_p.h"
#include "private/qapplication_p.h"
#include "QtWidgets/qdesktopwidget.h"
-#include "QtGui/qplatformwindow_qpa.h"
+#include <qpa/qplatformwindow.h>
#include "QtGui/qsurfaceformat.h"
-#include "QtGui/qplatformopenglcontext_qpa.h"
+#include <qpa/qplatformopenglcontext.h>
#include "QtGui/private/qwindow_p.h"
-#include <QtGui/QPlatformCursor>
+#include <qpa/qplatformcursor.h>
#include <QtGui/QGuiApplication>
#include <QtGui/QScreen>
+#include <QtCore/QMargins>
QT_BEGIN_NAMESPACE
@@ -105,6 +106,7 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO
}
win->setWindowFlags(data.window_flags);
+ fixPosIncludesFrame();
win->setGeometry(q->geometry());
win->setScreen(QGuiApplication::screens().value(topData()->screenIndex, 0));
@@ -126,7 +128,8 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO
}
}
- qt_window_private(win)->positionPolicy = topData()->posFromMove ? QWindowPrivate::WindowFrameInclusive : QWindowPrivate::WindowFrameExclusive;
+ qt_window_private(win)->positionPolicy = topData()->posIncludesFrame ?
+ QWindowPrivate::WindowFrameInclusive : QWindowPrivate::WindowFrameExclusive;
win->create();
data.window_flags = win->windowFlags();
@@ -438,6 +441,31 @@ static inline QRect positionTopLevelWindow(QRect geometry, const QScreen *screen
return geometry;
}
+// move() was invoked with Qt::WA_WState_Created not set (frame geometry
+// unknown), that is, crect has a position including the frame.
+// If we can determine the frame strut, fix that and clear the flag.
+void QWidgetPrivate::fixPosIncludesFrame()
+{
+ Q_Q(QWidget);
+ if (QTLWExtra *te = maybeTopData()) {
+ if (te->posIncludesFrame) {
+ // For Qt::WA_DontShowOnScreen, assume a frame of 0 (for
+ // example, in QGraphicsProxyWidget).
+ if (q->testAttribute(Qt::WA_DontShowOnScreen)) {
+ te->posIncludesFrame = 0;
+ } else {
+ if (q->windowHandle()) {
+ updateFrameStrut();
+ if (!q->data->fstrut_dirty) {
+ data.crect.translate(te->frameStrut.x(), te->frameStrut.y());
+ te->posIncludesFrame = 0;
+ }
+ } // windowHandle()
+ } // !WA_DontShowOnScreen
+ } // posIncludesFrame
+ } // QTLWExtra
+}
+
void QWidgetPrivate::show_sys()
{
Q_Q(QWidget);
@@ -460,6 +488,8 @@ void QWidgetPrivate::show_sys()
return;
if (window) {
+ if (q->isWindow())
+ fixPosIncludesFrame();
QRect geomRect = q->geometry();
if (q->isWindow()) {
if (!q->testAttribute(Qt::WA_Moved))
@@ -491,12 +521,13 @@ void QWidgetPrivate::hide_sys()
QWindow *window = q->windowHandle();
- if (q->testAttribute(Qt::WA_DontShowOnScreen)
- && q->isWindow()
- && q->windowModality() != Qt::NonModal
- && window) {
- // remove our window from the modal window list
- QGuiApplicationPrivate::hideModalWindow(window);
+ if (q->testAttribute(Qt::WA_DontShowOnScreen)) {
+ q->setAttribute(Qt::WA_Mapped, false);
+ if (q->isWindow() && q->windowModality() != Qt::NonModal && window) {
+ // remove our window from the modal window list
+ QGuiApplicationPrivate::hideModalWindow(window);
+ }
+ // do not return here, if window non-zero, we must hide it
}
deactivateWidgetCleanup();
@@ -511,11 +542,8 @@ void QWidgetPrivate::hide_sys()
invalidateBuffer(q->rect());
- if (q->testAttribute(Qt::WA_DontShowOnScreen)) {
- q->setAttribute(Qt::WA_Mapped, false);
- } else if (window) {
- window->setVisible(false);
- }
+ if (window)
+ window->setVisible(false);
}
void QWidgetPrivate::setMaxWindowState_helper()
@@ -545,7 +573,7 @@ void QWidgetPrivate::setFullScreenSize_helper()
data.in_set_window_state = old_state;
}
-static Qt::WindowState effectiveState(Qt::WindowStates state)
+Qt::WindowState effectiveState(Qt::WindowStates state)
{
if (state & Qt::WindowMinimized)
return Qt::WindowMinimized;
@@ -707,7 +735,6 @@ void QWidgetPrivate::setGeometry_sys(int x, int y, int w, int h, bool isMove)
if (!q->testAttribute(Qt::WA_DontShowOnScreen) && !q->testAttribute(Qt::WA_OutsideWSRange)) {
if (q->windowHandle()) {
if (q->isWindow()) {
- qt_window_private(q->windowHandle())->positionPolicy = topData()->posFromMove ? QWindowPrivate::WindowFrameInclusive : QWindowPrivate::WindowFrameExclusive;
q->windowHandle()->setGeometry(q->geometry());
} else {
QPoint posInNativeParent = q->mapTo(q->nativeParentWidget(),QPoint());
@@ -763,8 +790,10 @@ void QWidgetPrivate::setConstraints_sys()
winp->sizeIncrement = QSize(extra->topextra->incw, extra->topextra->inch);
}
- if (winp->platformWindow)
+ if (winp->platformWindow) {
+ fixPosIncludesFrame();
winp->platformWindow->propagateSizeHints();
+ }
}
}
@@ -895,7 +924,20 @@ void QWidgetPrivate::setMask_sys(const QRegion &region)
void QWidgetPrivate::updateFrameStrut()
{
- // XXX
+ Q_Q(QWidget);
+ if (q->data->fstrut_dirty) {
+ if (QTLWExtra *te = maybeTopData()) {
+ if (te->window) {
+ if (const QPlatformWindow *pw = te->window->handle()) {
+ const QMargins margins = pw->frameMargins();
+ if (!margins.isNull()) {
+ te->frameStrut.setCoords(margins.left(), margins.top(), margins.right(), margins.bottom());
+ q->data->fstrut_dirty = false;
+ }
+ }
+ }
+ }
+ }
}
void QWidgetPrivate::setWindowOpacity_sys(qreal level)
diff --git a/src/widgets/kernel/qwidgetwindow_qpa.cpp b/src/widgets/kernel/qwidgetwindow_qpa.cpp
index 0a45cce62e..5639bac3ff 100644
--- a/src/widgets/kernel/qwidgetwindow_qpa.cpp
+++ b/src/widgets/kernel/qwidgetwindow_qpa.cpp
@@ -83,6 +83,12 @@ QObject *QWidgetWindow::focusObject() const
bool QWidgetWindow::event(QEvent *event)
{
+ if (m_widget->testAttribute(Qt::WA_DontShowOnScreen)) {
+ // \a event is uninteresting for QWidgetWindow, the event was probably
+ // generated before WA_DontShowOnScreen was set
+ return m_widget->event(event);
+ }
+
switch (event->type()) {
case QEvent::Close:
handleCloseEvent(static_cast<QCloseEvent *>(event));
@@ -327,10 +333,13 @@ void QWidgetWindow::updateGeometry()
if (m_widget->testAttribute(Qt::WA_OutsideWSRange))
return;
- QMargins margins = frameMargins();
+ const QMargins margins = frameMargins();
m_widget->data->crect = geometry();
- m_widget->d_func()->topData()->frameStrut.setCoords(margins.left(), margins.top(), margins.right(), margins.bottom());
+ QTLWExtra *te = m_widget->d_func()->topData();
+ te->posIncludesFrame= false;
+ te->frameStrut.setCoords(margins.left(), margins.top(), margins.right(), margins.bottom());
+ m_widget->data->fstrut_dirty = false;
}
void QWidgetWindow::handleMoveEvent(QMoveEvent *event)
@@ -447,6 +456,8 @@ void QWidgetWindow::handleExposeEvent(QExposeEvent *event)
}
}
+Qt::WindowState effectiveState(Qt::WindowStates state);
+
void QWidgetWindow::handleWindowStateChangedEvent(QWindowStateChangeEvent *event)
{
// QWindow does currently not know 'active'.
@@ -465,10 +476,16 @@ void QWidgetWindow::handleWindowStateChangedEvent(QWindowStateChangeEvent *event
widgetState |= Qt::WindowMinimized;
break;
case Qt::WindowMaximized:
+ if (effectiveState(widgetState) == Qt::WindowNoState)
+ if (QTLWExtra *tle = m_widget->d_func()->maybeTopData())
+ tle->normalGeometry = m_widget->geometry();
widgetState &= ~Qt::WindowFullScreen;
widgetState |= Qt::WindowMaximized;
break;
case Qt::WindowFullScreen:
+ if (effectiveState(widgetState) == Qt::WindowNoState)
+ if (QTLWExtra *tle = m_widget->d_func()->maybeTopData())
+ tle->normalGeometry = m_widget->geometry();
widgetState &= ~Qt::WindowMaximized;
widgetState |= Qt::WindowFullScreen;
break;
diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp
index b2b1d3fec5..3de94a8f17 100644
--- a/src/widgets/styles/qcommonstyle.cpp
+++ b/src/widgets/styles/qcommonstyle.cpp
@@ -45,7 +45,7 @@
#include <qfile.h>
#include <qapplication.h>
#include <private/qguiapplication_p.h>
-#include <qplatformtheme_qpa.h>
+#include <qpa/qplatformtheme.h>
#include <qbitmap.h>
#include <qcache.h>
#include <qdockwidget.h>
diff --git a/src/widgets/styles/qgtkstyle_p.h b/src/widgets/styles/qgtkstyle_p.h
index b095820626..3cd443122c 100644
--- a/src/widgets/styles/qgtkstyle_p.h
+++ b/src/widgets/styles/qgtkstyle_p.h
@@ -65,7 +65,7 @@
#include <QtWidgets/QGtkStyle>
#include <private/qcleanlooksstyle_p.h>
-#undef signals // Collides with GTK stymbols
+#undef signals // Collides with GTK symbols
#include <gtk/gtk.h>
typedef unsigned long XID;
diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm
index 05bd90abef..662f0e2a60 100644
--- a/src/widgets/styles/qmacstyle_mac.mm
+++ b/src/widgets/styles/qmacstyle_mac.mm
@@ -100,7 +100,7 @@
#include <QtWidgets/qgraphicsproxywidget.h>
#include <QtWidgets/qgraphicsview.h>
#include <private/qstylehelper_p.h>
-#include <QtGui/QPlatformFontDatabase>
+#include <qpa/qplatformfontdatabase.h>
QT_BEGIN_NAMESPACE
diff --git a/src/widgets/styles/qstylefactory.cpp b/src/widgets/styles/qstylefactory.cpp
index 9ed452b516..ec29ae7b99 100644
--- a/src/widgets/styles/qstylefactory.cpp
+++ b/src/widgets/styles/qstylefactory.cpp
@@ -181,10 +181,8 @@ QStyle *QStyleFactory::create(const QString& key)
#endif
{ } // Keep these here - they make the #ifdefery above work
#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)
- if(!ret) {
- if (QStyleFactoryInterface *factory = qobject_cast<QStyleFactoryInterface*>(loader()->instance(style)))
- ret = factory->create(style);
- }
+ if (!ret)
+ ret = qLoadPlugin<QStyle, QStyleFactoryInterface>(loader(), style);
#endif
if(ret)
ret->setObjectName(style);
@@ -199,10 +197,15 @@ QStyle *QStyleFactory::create(const QString& key)
*/
QStringList QStyleFactory::keys()
{
-#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)
- QStringList list = loader()->keys();
-#else
QStringList list;
+#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)
+ typedef QMultiMap<int, QString> PluginKeyMap;
+ typedef PluginKeyMap::const_iterator PluginKeyMapConstIterator;
+
+ const PluginKeyMap keyMap = loader()->keyMap();
+ const PluginKeyMap::const_iterator cend = keyMap.constEnd();
+ for (PluginKeyMap::const_iterator it = keyMap.constBegin(); it != cend; ++it)
+ list.append(it.value());
#endif
#ifndef QT_NO_STYLE_WINDOWS
if (!list.contains(QLatin1String("Windows")))
diff --git a/src/widgets/styles/qwindowsvistastyle.cpp b/src/widgets/styles/qwindowsvistastyle.cpp
index 6fce426dd3..bcb24db663 100644
--- a/src/widgets/styles/qwindowsvistastyle.cpp
+++ b/src/widgets/styles/qwindowsvistastyle.cpp
@@ -46,7 +46,7 @@
#include <private/qstylehelper_p.h>
#include <private/qsystemlibrary_p.h>
#include <private/qapplication_p.h>
-#include <qplatformnativeinterface_qpa.h>
+#include <qpa/qplatformnativeinterface.h>
#if !defined(QT_NO_STYLE_WINDOWSVISTA) || defined(QT_PLUGIN)
diff --git a/src/widgets/styles/qwindowsxpstyle.cpp b/src/widgets/styles/qwindowsxpstyle.cpp
index 091b27d87b..18a28bc556 100644
--- a/src/widgets/styles/qwindowsxpstyle.cpp
+++ b/src/widgets/styles/qwindowsxpstyle.cpp
@@ -46,14 +46,14 @@
#include <private/qobject_p.h>
#include <private/qpaintengine_raster_p.h>
#include <private/qapplication_p.h>
-#include <qplatformnativeinterface_qpa.h>
+#include <qpa/qplatformnativeinterface.h>
#include <private/qstylehelper_p.h>
#include <private/qwidget_p.h>
#include <private/qsystemlibrary_p.h>
#include <qpainter.h>
#include <qpaintengine.h>
#include <qwidget.h>
-#include <qbackingstore.>
+#include <qbackingstore.h>
#include <qapplication.h>
#include <qpixmapcache.h>
diff --git a/src/widgets/util/qsystemtrayicon_win.cpp b/src/widgets/util/qsystemtrayicon_win.cpp
index fa72e791ba..84becf4a70 100644
--- a/src/widgets/util/qsystemtrayicon_win.cpp
+++ b/src/widgets/util/qsystemtrayicon_win.cpp
@@ -52,7 +52,7 @@
#include <private/qsystemlibrary_p.h>
#include <private/qguiapplication_p.h>
-#include <QPlatformNativeInterface>
+#include <qpa/qplatformnativeinterface.h>
#include <QSettings>
#include <QDebug>
#include <QHash>
diff --git a/src/widgets/util/qsystemtrayicon_x11.cpp b/src/widgets/util/qsystemtrayicon_x11.cpp
index 174c39d1f6..e58d0d9315 100644
--- a/src/widgets/util/qsystemtrayicon_x11.cpp
+++ b/src/widgets/util/qsystemtrayicon_x11.cpp
@@ -54,7 +54,7 @@
#include <qguiapplication.h>
#include <qscreen.h>
#include <qbackingstore.h>
-#include <qplatformnativeinterface_qpa.h>
+#include <qpa/qplatformnativeinterface.h>
#include <qdebug.h>
#include <X11/Xlib.h>
diff --git a/src/widgets/widgets/qcalendarwidget.cpp b/src/widgets/widgets/qcalendarwidget.cpp
index acd07d2a5b..5ac7348217 100644
--- a/src/widgets/widgets/qcalendarwidget.cpp
+++ b/src/widgets/widgets/qcalendarwidget.cpp
@@ -2067,9 +2067,9 @@ QCalendarWidget::QCalendarWidget(QWidget *parent)
d->m_model->setView(d->m_view);
d->m_view->setSelectionBehavior(QAbstractItemView::SelectItems);
d->m_view->setSelectionMode(QAbstractItemView::SingleSelection);
- d->m_view->horizontalHeader()->setResizeMode(QHeaderView::Stretch);
+ d->m_view->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
d->m_view->horizontalHeader()->setSectionsClickable(false);
- d->m_view->verticalHeader()->setResizeMode(QHeaderView::Stretch);
+ d->m_view->verticalHeader()->setSectionResizeMode(QHeaderView::Stretch);
d->m_view->verticalHeader()->setSectionsClickable(false);
d->m_selection = d->m_view->selectionModel();
d->createNavigationBar(this);
diff --git a/src/widgets/widgets/qcombobox.cpp b/src/widgets/widgets/qcombobox.cpp
index bea4061076..6a8e7b4641 100644
--- a/src/widgets/widgets/qcombobox.cpp
+++ b/src/widgets/widgets/qcombobox.cpp
@@ -43,7 +43,7 @@
#ifndef QT_NO_COMBOBOX
#include <qstylepainter.h>
-#include <qplatformtheme_qpa.h>
+#include <qpa/qplatformtheme.h>
#include <qlineedit.h>
#include <qapplication.h>
#include <qdesktopwidget.h>
diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp
index fccb062e07..955e2e5c8c 100644
--- a/src/widgets/widgets/qmenu.cpp
+++ b/src/widgets/widgets/qmenu.cpp
@@ -49,7 +49,7 @@
#include "qtimer.h"
#include "qlayout.h"
#include "qpainter.h"
-#include "qplatformtheme_qpa.h"
+#include <qpa/qplatformtheme.h>
#include "qapplication.h"
#include "qdesktopwidget.h"
#ifndef QT_NO_ACCESSIBILITY
@@ -71,7 +71,7 @@
#include <private/qaction_p.h>
#include <private/qsoftkeymanager_p.h>
#include <private/qguiapplication_p.h>
-#include <qplatformtheme_qpa.h>
+#include <qpa/qplatformtheme.h>
QT_BEGIN_NAMESPACE
diff --git a/src/widgets/widgets/qmenu_p.h b/src/widgets/widgets/qmenu_p.h
index d637a9be8f..692fd19050 100644
--- a/src/widgets/widgets/qmenu_p.h
+++ b/src/widgets/widgets/qmenu_p.h
@@ -61,7 +61,7 @@
#include "QtCore/qbasictimer.h"
#include "private/qwidget_p.h"
-#include <qplatformmenu_qpa.h>
+#include <qpa/qplatformmenu.h>
QT_BEGIN_NAMESPACE
diff --git a/src/widgets/widgets/qmenubar.cpp b/src/widgets/widgets/qmenubar.cpp
index 104424cabf..80b6faa1a0 100644
--- a/src/widgets/widgets/qmenubar.cpp
+++ b/src/widgets/widgets/qmenubar.cpp
@@ -55,7 +55,7 @@
#include <qtoolbar.h>
#include <qtoolbutton.h>
#include <qwhatsthis.h>
-#include <qplatformtheme_qpa.h>
+#include <qpa/qplatformtheme.h>
#include "private/qguiapplication_p.h"
#ifndef QT_NO_MENUBAR
diff --git a/src/widgets/widgets/qwidgetlinecontrol.cpp b/src/widgets/widgets/qwidgetlinecontrol.cpp
index 017cbee219..6347593efe 100644
--- a/src/widgets/widgets/qwidgetlinecontrol.cpp
+++ b/src/widgets/widgets/qwidgetlinecontrol.cpp
@@ -46,7 +46,7 @@
#include "qabstractitemview.h"
#include "qclipboard.h"
#include <private/qguiapplication_p.h>
-#include <qplatformtheme_qpa.h>
+#include <qpa/qplatformtheme.h>
#include <qstylehints.h>
#ifndef QT_NO_ACCESSIBILITY
#include "qaccessible.h"